Skip to content

Commit 42ee66b

Browse files
feat(ActionSheet): update ActionSheetItem interface type (#781)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent e9d893d commit 42ee66b

File tree

11 files changed

+30
-25
lines changed

11 files changed

+30
-25
lines changed

db/TDesign.db

0 Bytes
Binary file not shown.

packages/products/tdesign-miniprogram/packages/components/action-sheet/README.en-US.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ align | String | center | `0.29.0`。options: center/left | N
1212
cancel-text | String | - | \- | N
1313
count | Number | 8 | \- | N
1414
description | String | - | `0.29.0` | N
15-
items | Array | - | required。Typescript`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; color?: string; disabled?: boolean; icon?: string; suffixIcon?: string }`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/action-sheet/type.ts) | Y
16-
popup-props | Object | {} | Typescript`PopupProps`[Popup API Documents](./popup?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/action-sheet/type.ts) | N
15+
items | Array | - | required。Typescript: `Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; description?: string; color?: string; disabled?: boolean; icon?: string; suffixIcon?: string }`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/action-sheet/type.ts) | Y
16+
popup-props | Object | {} | Typescript: `PopupProps`[Popup API Documents](./popup?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/action-sheet/type.ts) | N
1717
show-cancel | Boolean | true | \- | N
1818
show-overlay | Boolean | true | \- | N
1919
theme | String | list | options: list/grid | N

packages/products/tdesign-miniprogram/packages/components/action-sheet/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ align | String | center | `0.29.0`。水平对齐方式。可选项:center/lef
1212
cancel-text | String | - | 设置取消按钮的文本 | N
1313
count | Number | 8 | 设置每页展示菜单的数量,仅当 type=grid 时有效 | N
1414
description | String | - | `0.29.0`。动作面板描述文字 | N
15-
items | Array | - | 必需。菜单项。TS 类型:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; color?: string; disabled?: boolean; icon?: string; suffixIcon?: string }`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/action-sheet/type.ts) | Y
15+
items | Array | - | 必需。菜单项。TS 类型:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; description?: string; color?: string; disabled?: boolean; icon?: string; suffixIcon?: string }`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/action-sheet/type.ts) | Y
1616
popup-props | Object | {} | 透传 Popup 组件全部属性。TS 类型:`PopupProps`[Popup API Documents](./popup?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/action-sheet/type.ts) | N
1717
show-cancel | Boolean | true | 是否显示取消按钮 | N
1818
show-overlay | Boolean | true | 是否显示遮罩层 | N

packages/products/tdesign-miniprogram/packages/components/action-sheet/type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export interface TdActionSheetProps {
107107

108108
export interface ActionSheetItem {
109109
label: string;
110+
description?: string;
110111
color?: string;
111112
disabled?: boolean;
112113
icon?: string;

packages/products/tdesign-mobile-react/src/action-sheet/action-sheet.en-US.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
name | type | default | description | required
88
-- | -- | -- | -- | --
99
className | String | - | className of component | N
10-
style | Object | - | CSS(Cascading Style Sheets),Typescript`React.CSSProperties` | N
10+
style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N
1111
align | String | center | options: center/left | N
1212
cancelText | String | - | \- | N
1313
count | Number | 8 | \- | N
1414
description | String | - | \- | N
15-
items | Array | - | Typescript`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; color?: string; disabled?: boolean; icon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts) | N
16-
popupProps | Object | {} | Typescript`PopupProps`[Popup API Documents](./popup?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts) | N
15+
items | Array | - | Typescript: `Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; description?: string; color?: string; disabled?: boolean; icon?: TNode; suffixIcon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts) | N
16+
popupProps | Object | {} | Typescript: `PopupProps`[Popup API Documents](./popup?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts) | N
1717
showCancel | Boolean | true | \- | N
1818
showOverlay | Boolean | true | \- | N
1919
theme | String | list | options: list/grid | N
2020
visible | Boolean | false | \- | N
2121
defaultVisible | Boolean | false | uncontrolled property | N
22-
onCancel | Function | | Typescript`(context: { e: MouseEvent }) => void`<br/> | N
23-
onClose | Function | | Typescript`(trigger: ActionSheetTriggerSource) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts)。<br/>`type ActionSheetTriggerSource = 'overlay' \| 'command' \| 'select' `<br/> | N
24-
onSelected | Function | | Typescript`(selected: ActionSheetItem \| string, index: number) => void`<br/> | N
22+
onCancel | Function | | Typescript: `(context: { e: MouseEvent }) => void`<br/> | N
23+
onClose | Function | | Typescript: `(trigger: ActionSheetTriggerSource) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts)。<br/>`type ActionSheetTriggerSource = 'overlay' \| 'command' \| 'select' `<br/> | N
24+
onSelected | Function | | Typescript: `(selected: ActionSheetItem \| string, index: number) => void`<br/> | N

packages/products/tdesign-mobile-react/src/action-sheet/action-sheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ align | String | center | 水平对齐方式。可选项:center/left | N
1212
cancelText | String | - | 设置取消按钮的文本 | N
1313
count | Number | 8 | 设置每页展示菜单的数量,仅当 type=grid 时有效 | N
1414
description | String | - | 动作面板描述文字 | N
15-
items | Array | - | 菜单项。TS 类型:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; color?: string; disabled?: boolean; icon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts) | N
15+
items | Array | - | 菜单项。TS 类型:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; description?: string; color?: string; disabled?: boolean; icon?: TNode; suffixIcon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts) | N
1616
popupProps | Object | {} | 透传 Popup 组件全部属性。TS 类型:`PopupProps`[Popup API Documents](./popup?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts) | N
1717
showCancel | Boolean | true | 是否显示取消按钮 | N
1818
showOverlay | Boolean | true | 是否显示遮罩层 | N

packages/products/tdesign-mobile-react/src/action-sheet/type.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ export interface TdActionSheetProps {
8080

8181
export interface ActionSheetItem {
8282
label: string;
83+
description?: string;
8384
color?: string;
8485
disabled?: boolean;
8586
icon?: TNode;
87+
suffixIcon?: TNode;
8688
badge?: BadgeProps;
8789
}
8890

packages/products/tdesign-mobile-vue/src/action-sheet/action-sheet.en-US.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ align | String | center | options: center/left | N
1010
cancelText | String | - | \- | N
1111
count | Number | 8 | \- | N
1212
description | String | - | \- | N
13-
items | Array | - | Typescript`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; color?: string; disabled?: boolean; icon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N
14-
popupProps | Object | {} | Typescript`PopupProps`[Popup API Documents](./popup?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N
13+
items | Array | - | Typescript: `Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; description?: string; color?: string; disabled?: boolean; icon?: TNode; suffixIcon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N
14+
popupProps | Object | {} | Typescript: `PopupProps`[Popup API Documents](./popup?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N
1515
showCancel | Boolean | true | \- | N
1616
showOverlay | Boolean | true | \- | N
1717
theme | String | list | options: list/grid | N
18-
visible | Boolean | false | required。`v-model` and `v-model:visible` is supported | Y
19-
defaultVisible | Boolean | false | required。uncontrolled property | Y
20-
onCancel | Function | | Typescript`(context: { e: MouseEvent }) => void`<br/> | N
21-
onClose | Function | | Typescript`(trigger: ActionSheetTriggerSource) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts)。<br/>`type ActionSheetTriggerSource = 'overlay' \| 'command' \| 'select' `<br/> | N
22-
onSelected | Function | | Typescript`(selected: ActionSheetItem \| string, index: number) => void`<br/> | N
18+
visible | Boolean | false | `v-model` and `v-model:visible` is supported | N
19+
defaultVisible | Boolean | false | uncontrolled property | N
20+
onCancel | Function | | Typescript: `(context: { e: MouseEvent }) => void`<br/> | N
21+
onClose | Function | | Typescript: `(trigger: ActionSheetTriggerSource) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts)。<br/>`type ActionSheetTriggerSource = 'overlay' \| 'command' \| 'select' `<br/> | N
22+
onSelected | Function | | Typescript: `(selected: ActionSheetItem \| string, index: number) => void`<br/> | N
2323

2424
### ActionSheet Events
2525

packages/products/tdesign-mobile-vue/src/action-sheet/action-sheet.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ align | String | center | 水平对齐方式。可选项:center/left | N
1010
cancelText | String | - | 设置取消按钮的文本 | N
1111
count | Number | 8 | 设置每页展示菜单的数量,仅当 type=grid 时有效 | N
1212
description | String | - | 动作面板描述文字 | N
13-
items | Array | - | 菜单项。TS 类型:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; color?: string; disabled?: boolean; icon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N
13+
items | Array | - | 菜单项。TS 类型:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; description?: string; color?: string; disabled?: boolean; icon?: TNode; suffixIcon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N
1414
popupProps | Object | {} | 透传 Popup 组件全部属性。TS 类型:`PopupProps`[Popup API Documents](./popup?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N
1515
showCancel | Boolean | true | 是否显示取消按钮 | N
1616
showOverlay | Boolean | true | 是否显示遮罩层 | N
1717
theme | String | list | 展示类型,列表和表格形式展示。可选项:list/grid | N
18-
visible | Boolean | false | 必需。显示与隐藏。支持语法糖 `v-model``v-model:visible` | Y
19-
defaultVisible | Boolean | false | 必需。显示与隐藏。非受控属性 | Y
18+
visible | Boolean | false | 显示与隐藏。支持语法糖 `v-model``v-model:visible` | N
19+
defaultVisible | Boolean | false | 显示与隐藏。非受控属性 | N
2020
onCancel | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>点击取消按钮时触发 | N
2121
onClose | Function | | TS 类型:`(trigger: ActionSheetTriggerSource) => void`<br/>关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts)。<br/>`type ActionSheetTriggerSource = 'overlay' \| 'command' \| 'select' `<br/> | N
2222
onSelected | Function | | TS 类型:`(selected: ActionSheetItem \| string, index: number) => void`<br/>选择菜单项时触发 | N

packages/products/tdesign-mobile-vue/src/action-sheet/type.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ export interface TdActionSheetProps {
5757
* 显示与隐藏
5858
* @default false
5959
*/
60-
visible: boolean;
60+
visible?: boolean;
6161
/**
6262
* 显示与隐藏,非受控属性
6363
* @default false
6464
*/
65-
defaultVisible: boolean;
65+
defaultVisible?: boolean;
6666
/**
6767
* 显示与隐藏
6868
* @default false
6969
*/
70-
modelValue: boolean;
70+
modelValue?: boolean;
7171
/**
7272
* 点击取消按钮时触发
7373
*/
@@ -84,9 +84,11 @@ export interface TdActionSheetProps {
8484

8585
export interface ActionSheetItem {
8686
label: string;
87+
description?: string;
8788
color?: string;
8889
disabled?: boolean;
8990
icon?: TNode;
91+
suffixIcon?: TNode;
9092
badge?: BadgeProps;
9193
}
9294

0 commit comments

Comments
 (0)