Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: descriptions api update #219

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db/TDesign.db
Binary file not shown.
5 changes: 5 additions & 0 deletions packages/products/tdesign-react/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ export type HorizontalAlignEnum = 'left' | 'center' | 'right';

export type VerticalAlignEnum = 'top' | 'middle' | 'bottom';

export enum LayoutEnum {
VERTICAL = 'vertical',
HORIZONTAL = 'horizontal',
}

export type ClassName = { [className: string]: any } | ClassName[] | string;

export type CSSSelector = string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import { TdDescriptionsProps, TdDescriptionItemProps } from './type';
export const descriptionsDefaultProps: TdDescriptionsProps = {
bordered: false,
columns: 2,
contentAlign: 'left',
itemLayout: 'horizontal',
labelAlign: 'left',
layout: 'horizontal',
size: 'medium',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ style | Object | - | 样式,Typescript:`React.CSSProperties` | N
bordered | Boolean | false | set description list with grey border | N
colon | Boolean | - | set label with ":" on the right | N
columns | Number | 2 | count of DescriptionItem in one row | N
contentAlign | String | left | options: left/right/center | N
contentStyle | Object | - | style of description cotent。Typescript:`Styles`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
itemLayout | String | horizontal | layout direction of description item。options: horizontal/vertical | N
items | Array | - | list of descriptions items。Typescript:`Array<T>` | N
labelAlign | String | left | options: left/right/center | N
labelClassName | String / Object / Array | - | Typescript:`ClassName`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
labelStyle | Object | - | style of description item。Typescript:`Styles`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
layout | String | horizontal | layout direction。options: horizontal/vertical | N
size | String | medium | a descriptions has three size。options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
title | TNode | - | title of descriptions。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
bordered | Boolean | false | 是否带边框 | N
colon | Boolean | - | 字段名右侧是否携带冒号“:” | N
columns | Number | 2 | 一行 DescriptionItem 的数量 | N
contentAlign | String | left | 字段值内容的对齐方式:左对齐、居中对齐。可选项:left/right/center | N
contentStyle | Object | - | 自定义描述项内容的样式。TS 类型:`Styles`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
itemLayout | String | horizontal | 描述项的排列方向。可选项:horizontal/vertical | N
items | Array | - | 描述项的列表。TS 类型:`Array<T>` | N
labelAlign | String | left | 字段标签对齐方式:左对齐、右对齐、居中对齐。可选项:left/right/center | N
labelClassName | String / Object / Array | - | 自定义描述项的标签的类名,示例:'name1 name2 name3' 或 `['name1', 'name2']` 或 `[{ 'name1': true }]`。TS 类型:`ClassName`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
labelStyle | Object | - | 自定义描述项标签的样式。TS 类型:`Styles`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
layout | String | horizontal | 排列方向。可选项:horizontal/vertical | N
size | String | medium | 组件尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
title | TNode | - | 描述列表的标题。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
Expand Down
16 changes: 5 additions & 11 deletions packages/products/tdesign-react/src/descriptions/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TNode, SizeEnum, ClassName } from '../common';
import { TNode, SizeEnum, Styles } from '../common';

export interface TdDescriptionsProps {
/**
Expand All @@ -22,10 +22,9 @@ export interface TdDescriptionsProps {
*/
columns?: number;
/**
* 字段值内容的对齐方式:左对齐、居中对齐
* @default left
* 自定义描述项内容的样式
*/
contentAlign?: 'left' | 'right' | 'center';
contentStyle?: Styles;
/**
* 描述项的排列方向
* @default horizontal
Expand All @@ -36,14 +35,9 @@ export interface TdDescriptionsProps {
*/
items?: Array<T>;
/**
* 字段标签对齐方式:左对齐、右对齐、居中对齐
* @default left
* 自定义描述项标签的样式
*/
labelAlign?: 'left' | 'right' | 'center';
/**
* 自定义描述项的标签的类名,示例:'name1 name2 name3' 或 `['name1', 'name2']` 或 `[{ 'name1': true }]`
*/
labelClassName?: ClassName;
labelStyle?: Styles;
/**
* 排列方向
* @default horizontal
Expand Down
5 changes: 5 additions & 0 deletions packages/products/tdesign-vue-next/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ export type HorizontalAlignEnum = 'left' | 'center' | 'right';

export type VerticalAlignEnum = 'top' | 'middle' | 'bottom';

export enum LayoutEnum {
VERTICAL = 'vertical',
HORIZONTAL = 'horizontal',
}

export type ClassName = { [className: string]: any } | ClassName[] | string;

export type CSSSelector = string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ name | type | default | description | required
bordered | Boolean | false | set description list with grey border | N
colon | Boolean | - | set label with ":" on the right | N
columns | Number | 2 | count of DescriptionItem in one row | N
contentAlign | String | left | options: left/right/center | N
contentStyle | Object | - | style of description cotent。Typescript:`Styles`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
itemLayout | String | horizontal | layout direction of description item。options: horizontal/vertical | N
items | Array | - | list of descriptions items。Typescript:`Array<T>` | N
labelAlign | String | left | options: left/right/center | N
labelClassName | String / Object / Array | - | Typescript:`ClassName`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
labelStyle | Object | - | style of description item。Typescript:`Styles`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
layout | String | horizontal | layout direction。options: horizontal/vertical | N
size | String | medium | a descriptions has three size。options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
title | String / Slot / Function | - | title of descriptions。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
bordered | Boolean | false | 是否带边框 | N
colon | Boolean | - | 字段名右侧是否携带冒号“:” | N
columns | Number | 2 | 一行 DescriptionItem 的数量 | N
contentAlign | String | left | 字段值内容的对齐方式:左对齐、居中对齐。可选项:left/right/center | N
contentStyle | Object | - | 自定义描述项内容的样式。TS 类型:`Styles`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
itemLayout | String | horizontal | 描述项的排列方向。可选项:horizontal/vertical | N
items | Array | - | 描述项的列表。TS 类型:`Array<T>` | N
labelAlign | String | left | 字段标签对齐方式:左对齐、右对齐、居中对齐。可选项:left/right/center | N
labelClassName | String / Object / Array | - | 自定义描述项的标签的类名,示例:'name1 name2 name3' 或 `['name1', 'name2']` 或 `[{ 'name1': true }]`。TS 类型:`ClassName`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
labelStyle | Object | - | 自定义描述项标签的样式。TS 类型:`Styles`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
layout | String | horizontal | 排列方向。可选项:horizontal/vertical | N
size | String | medium | 组件尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
title | String / Slot / Function | - | 描述列表的标题。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
Expand Down
26 changes: 6 additions & 20 deletions packages/products/tdesign-vue-next/src/descriptions/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ export default {
type: Number,
default: 2,
},
/** 字段值内容的对齐方式:左对齐、居中对齐 */
contentAlign: {
type: String as PropType<TdDescriptionsProps['contentAlign']>,
default: 'left' as TdDescriptionsProps['contentAlign'],
validator(val: TdDescriptionsProps['contentAlign']): boolean {
if (!val) return true;
return ['left', 'right', 'center'].includes(val);
},
/** 自定义描述项内容的样式 */
contentStyle: {
type: Object as PropType<TdDescriptionsProps['contentStyle']>,
},
/** 描述项的排列方向 */
itemLayout: {
Expand All @@ -39,18 +34,9 @@ export default {
items: {
type: Array as PropType<TdDescriptionsProps['items']>,
},
/** 字段标签对齐方式:左对齐、右对齐、居中对齐 */
labelAlign: {
type: String as PropType<TdDescriptionsProps['labelAlign']>,
default: 'left' as TdDescriptionsProps['labelAlign'],
validator(val: TdDescriptionsProps['labelAlign']): boolean {
if (!val) return true;
return ['left', 'right', 'center'].includes(val);
},
},
/** 自定义描述项的标签的类名,示例:'name1 name2 name3' 或 `['name1', 'name2']` 或 `[{ 'name1': true }]` */
labelClassName: {
type: [String, Object, Array] as PropType<TdDescriptionsProps['labelClassName']>,
/** 自定义描述项标签的样式 */
labelStyle: {
type: Object as PropType<TdDescriptionsProps['labelStyle']>,
},
/** 排列方向 */
layout: {
Expand Down
16 changes: 5 additions & 11 deletions packages/products/tdesign-vue-next/src/descriptions/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TNode, SizeEnum, ClassName } from '../common';
import { TNode, SizeEnum, Styles } from '../common';

export interface TdDescriptionsProps {
/**
Expand All @@ -22,10 +22,9 @@ export interface TdDescriptionsProps {
*/
columns?: number;
/**
* 字段值内容的对齐方式:左对齐、居中对齐
* @default left
* 自定义描述项内容的样式
*/
contentAlign?: 'left' | 'right' | 'center';
contentStyle?: Styles;
/**
* 描述项的排列方向
* @default horizontal
Expand All @@ -36,14 +35,9 @@ export interface TdDescriptionsProps {
*/
items?: Array<T>;
/**
* 字段标签对齐方式:左对齐、右对齐、居中对齐
* @default left
* 自定义描述项标签的样式
*/
labelAlign?: 'left' | 'right' | 'center';
/**
* 自定义描述项的标签的类名,示例:'name1 name2 name3' 或 `['name1', 'name2']` 或 `[{ 'name1': true }]`
*/
labelClassName?: ClassName;
labelStyle?: Styles;
/**
* 排列方向
* @default horizontal
Expand Down
5 changes: 5 additions & 0 deletions packages/products/tdesign-vue/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export type HorizontalAlignEnum = 'left' | 'center' | 'right';

export type VerticalAlignEnum = 'top' | 'middle' | 'bottom';

export enum LayoutEnum {
VERTICAL = 'vertical',
HORIZONTAL = 'horizontal',
}

export type ClassName = { [className: string]: any } | ClassName[] | string;

export type CSSSelector = string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ name | type | default | description | required
bordered | Boolean | false | set description list with grey border | N
colon | Boolean | - | set label with ":" on the right | N
columns | Number | 2 | count of DescriptionItem in one row | N
contentAlign | String | left | options: left/right/center | N
contentStyle | Object | - | style of description cotent。Typescript:`Styles`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
itemLayout | String | horizontal | layout direction of description item。options: horizontal/vertical | N
items | Array | - | list of descriptions items。Typescript:`Array<T>` | N
labelAlign | String | left | options: left/right/center | N
labelClassName | String / Object / Array | - | Typescript:`ClassName`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
labelStyle | Object | - | style of description item。Typescript:`Styles`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
layout | String | horizontal | layout direction。options: horizontal/vertical | N
size | String | medium | a descriptions has three size。options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
title | String / Slot / Function | - | title of descriptions。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
bordered | Boolean | false | 是否带边框 | N
colon | Boolean | - | 字段名右侧是否携带冒号“:” | N
columns | Number | 2 | 一行 DescriptionItem 的数量 | N
contentAlign | String | left | 字段值内容的对齐方式:左对齐、居中对齐。可选项:left/right/center | N
contentStyle | Object | - | 自定义描述项内容的样式。TS 类型:`Styles`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
itemLayout | String | horizontal | 描述项的排列方向。可选项:horizontal/vertical | N
items | Array | - | 描述项的列表。TS 类型:`Array<T>` | N
labelAlign | String | left | 字段标签对齐方式:左对齐、右对齐、居中对齐。可选项:left/right/center | N
labelClassName | String / Object / Array | - | 自定义描述项的标签的类名,示例:'name1 name2 name3' 或 `['name1', 'name2']` 或 `[{ 'name1': true }]`。TS 类型:`ClassName`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
labelStyle | Object | - | 自定义描述项标签的样式。TS 类型:`Styles`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
layout | String | horizontal | 排列方向。可选项:horizontal/vertical | N
size | String | medium | 组件尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
title | String / Slot / Function | - | 描述列表的标题。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
Expand Down
26 changes: 6 additions & 20 deletions packages/products/tdesign-vue/src/descriptions/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ export default {
type: Number,
default: 2,
},
/** 字段值内容的对齐方式:左对齐、居中对齐 */
contentAlign: {
type: String as PropType<TdDescriptionsProps['contentAlign']>,
default: 'left' as TdDescriptionsProps['contentAlign'],
validator(val: TdDescriptionsProps['contentAlign']): boolean {
if (!val) return true;
return ['left', 'right', 'center'].includes(val);
},
/** 自定义描述项内容的样式 */
contentStyle: {
type: Object as PropType<TdDescriptionsProps['contentStyle']>,
},
/** 描述项的排列方向 */
itemLayout: {
Expand All @@ -39,18 +34,9 @@ export default {
items: {
type: Array as PropType<TdDescriptionsProps['items']>,
},
/** 字段标签对齐方式:左对齐、右对齐、居中对齐 */
labelAlign: {
type: String as PropType<TdDescriptionsProps['labelAlign']>,
default: 'left' as TdDescriptionsProps['labelAlign'],
validator(val: TdDescriptionsProps['labelAlign']): boolean {
if (!val) return true;
return ['left', 'right', 'center'].includes(val);
},
},
/** 自定义描述项的标签的类名,示例:'name1 name2 name3' 或 `['name1', 'name2']` 或 `[{ 'name1': true }]` */
labelClassName: {
type: [String, Object, Array] as PropType<TdDescriptionsProps['labelClassName']>,
/** 自定义描述项标签的样式 */
labelStyle: {
type: Object as PropType<TdDescriptionsProps['labelStyle']>,
},
/** 排列方向 */
layout: {
Expand Down
16 changes: 5 additions & 11 deletions packages/products/tdesign-vue/src/descriptions/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TNode, SizeEnum, ClassName } from '../common';
import { TNode, SizeEnum, Styles } from '../common';

export interface TdDescriptionsProps {
/**
Expand All @@ -22,10 +22,9 @@ export interface TdDescriptionsProps {
*/
columns?: number;
/**
* 字段值内容的对齐方式:左对齐、居中对齐
* @default left
* 自定义描述项内容的样式
*/
contentAlign?: 'left' | 'right' | 'center';
contentStyle?: Styles;
/**
* 描述项的排列方向
* @default horizontal
Expand All @@ -36,14 +35,9 @@ export interface TdDescriptionsProps {
*/
items?: Array<T>;
/**
* 字段标签对齐方式:左对齐、右对齐、居中对齐
* @default left
* 自定义描述项标签的样式
*/
labelAlign?: 'left' | 'right' | 'center';
/**
* 自定义描述项的标签的类名,示例:'name1 name2 name3' 或 `['name1', 'name2']` 或 `[{ 'name1': true }]`
*/
labelClassName?: ClassName;
labelStyle?: Styles;
/**
* 排列方向
* @default horizontal
Expand Down
Loading
Loading