From bf7fa57c9f608becb5535acf32d65cf089c18915 Mon Sep 17 00:00:00 2001 From: toby Date: Mon, 26 Aug 2024 20:19:14 +0800 Subject: [PATCH 01/11] =?UTF-8?q?feat(SideBar):=20mobile-react=E5=88=9B?= =?UTF-8?q?=E5=BB=BASideBar=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/TDesign.db | Bin 1003520 -> 1003520 bytes packages/scripts/api.json | 96 ++++++++++++++++++++-- packages/scripts/vitest/tests/side-bar.js | 19 +++++ 3 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 packages/scripts/vitest/tests/side-bar.js diff --git a/db/TDesign.db b/db/TDesign.db index 7efb731076f02d093c5404ac9a67736f722c1544..4e5dbc5a493f3112b9bae6141c97b12fcc506773 100644 GIT binary patch delta 485 zcmZozVB4_3c7ilx@kAMC#^T0=)&$1Z1g6#m=GFw3)&$np1h&=$_SOWB)&$Ph1g_Qu z?yU(t1rm%A+b>G+XfQGcZ2u+66TD5nVp@eH6QeSxA|o%aB?AYqu`z=p11ASB2QQFw zHe&kHOFThbPKhb$sR2d#1;x`(T;N&87%@HnB2PMyx_*%-8Aw@Q;)!GA-9GCQkNQQR z$%hv6I_zQYVszNfn!wk<#GJ#Cw7nyV?-r{FCo>CE+L^*+zGMh1_5)wi_Oc8HDY3}2BsDh);f2IEoRak>x&{`yMrI0zMplN#Rz}7~21e*Y z2w&&TNdj6V%_$2EBtuznAo0QiDeX+`2be|48JRgLMX7lXPxdW;v2W+o^?P1)ta{qk h`gGk+m=x3=d9d9ER;C74MkdI1Lxr~I`S4F-1^~1OkXir$ delta 217 zcmZozVB4_3c7ilx@G+XfQH5Z2u+66TEG*LqqlS6Bl@vF?vkTzsQpgq^@7&Nd{8Zmw4hB z8Me>5#G`%@sQS=iUWYx*NsM;eSrhmgn3&7>n6`H$@!et-;pk!zNfXsu%$vZ;%)$g@ z_3_4UFU#PQDq!T8KJf-$ERaf+ Date: Mon, 26 Aug 2024 20:19:42 +0800 Subject: [PATCH 02/11] =?UTF-8?q?feat(SideBar):=20mobile-react=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/side-bar/defaultProps.ts | 9 +++ .../src/side-bar/side-bar.en-US.md | 29 ++++++++++ .../src/side-bar/side-bar.md | 29 ++++++++++ .../tdesign-mobile-react/src/side-bar/type.ts | 55 +++++++++++++++++++ 4 files changed, 122 insertions(+) create mode 100644 packages/products/tdesign-mobile-react/src/side-bar/defaultProps.ts create mode 100644 packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md create mode 100644 packages/products/tdesign-mobile-react/src/side-bar/side-bar.md create mode 100644 packages/products/tdesign-mobile-react/src/side-bar/type.ts diff --git a/packages/products/tdesign-mobile-react/src/side-bar/defaultProps.ts b/packages/products/tdesign-mobile-react/src/side-bar/defaultProps.ts new file mode 100644 index 000000000..2617290e9 --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/side-bar/defaultProps.ts @@ -0,0 +1,9 @@ +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdSideBarProps, TdSideBarItemProps } from './type'; + +export const sideBarDefaultProps: TdSideBarProps = { defaultValue: undefined }; + +export const sideBarItemDefaultProps: TdSideBarItemProps = { disabled: false }; diff --git a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md new file mode 100644 index 000000000..82a342a0b --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md @@ -0,0 +1,29 @@ +:: BASE_DOC :: + +## API + + +### SideBar Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N +children | TElement | - | children。Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +defaultValue | String / Number | undefined | \- | N +value | String / Number | - | \- | N +onChange | Function | | Typescript:`(value: number \| string) => void`
| N +onClick | Function | | Typescript:`(value: number \| string, label: string) => void`
| N + + +### SideBarItem Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N +badgeProps | \- | - | Typescript:`BadgeProps` | N +disabled | Boolean | false | \- | N +icon | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +label | String | - | \- | N +value | String / Number | - | \- | N diff --git a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md new file mode 100644 index 000000000..0c2e35263 --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md @@ -0,0 +1,29 @@ +:: BASE_DOC :: + +## API + + +### SideBar Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +children | TElement | - | 侧边导航内容。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +defaultValue | String / Number | undefined | 选项值。非受控属性 | N +value | String / Number | - | 选项值 | N +onChange | Function | | TS 类型:`(value: number \| string) => void`
选项值发生变化时触发 | N +onClick | Function | | TS 类型:`(value: number \| string, label: string) => void`
点击选项时触发 | N + + +### SideBarItem Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +badgeProps | \- | - | 透传至 Badge 组件。TS 类型:`BadgeProps` | N +disabled | Boolean | false | 是否禁用 | N +icon | TElement | - | 图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +label | String | - | 展示的标签 | N +value | String / Number | - | 当前选项的值 | N diff --git a/packages/products/tdesign-mobile-react/src/side-bar/type.ts b/packages/products/tdesign-mobile-react/src/side-bar/type.ts new file mode 100644 index 000000000..69cf7965c --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/side-bar/type.ts @@ -0,0 +1,55 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TElement } from '../common'; + +export interface TdSideBarProps { + /** + * 侧边导航内容 + */ + children?: TElement; + /** + * 选项值。非受控属性 + */ + defaultValue?: string | number; + /** + * 选项值 + */ + value?: string | number; + /** + * 选项值发生变化时触发 + */ + onChange?: (value: number | string) => void; + /** + * 点击选项时触发 + */ + onClick?: (value: number | string, label: string) => void; +} + +export interface TdSideBarItemProps { + /** + * 透传至 Badge 组件 + */ + badgeProps?: BadgeProps; + /** + * 是否禁用 + * @default false + */ + disabled?: boolean; + /** + * 图标 + */ + icon?: TElement; + /** + * 展示的标签 + * @default '' + */ + label?: string; + /** + * 当前选项的值 + */ + value?: string | number; +} From 92b0307b6c20ab9d4aef63b4a2aa22f471145728 Mon Sep 17 00:00:00 2001 From: toby Date: Mon, 26 Aug 2024 20:42:25 +0800 Subject: [PATCH 03/11] =?UTF-8?q?feat(SideBar):=20mobile-react-=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/TDesign.db | Bin 1003520 -> 1003520 bytes packages/scripts/api.json | 14 +++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/db/TDesign.db b/db/TDesign.db index 4e5dbc5a493f3112b9bae6141c97b12fcc506773..b5047a4b810267e9d83221ba9821babb691a677e 100644 GIT binary patch delta 182 zcmZozVB4_3c7ilx*+dy<#bSxp^4)_4u-RSMl=m5b77#Ipz7?n8{Ij47f^QUoD f%}EC80rD9^e4XjLF7ZfBzu?WUyFJf`e-bkQBV{mn delta 165 zcmWN`KM%n`90uS!E!Vo98^j>3q+*xQm1r1iFdAR~2T6%ews!bU7A##1tajAt*xa1N|B`7-K?aOm}O0^;X)6 z Date: Mon, 26 Aug 2024 20:42:44 +0800 Subject: [PATCH 04/11] =?UTF-8?q?feat(SideBar):=20mobile-react=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tdesign-mobile-react/src/side-bar/side-bar.en-US.md | 5 ++--- .../products/tdesign-mobile-react/src/side-bar/side-bar.md | 5 ++--- packages/products/tdesign-mobile-react/src/side-bar/type.ts | 5 +++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md index 82a342a0b..9fd36f807 100644 --- a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md +++ b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md @@ -2,14 +2,13 @@ ## API - ### SideBar Props name | type | default | description | required -- | -- | -- | -- | -- className | String | - | className of component | N style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -children | TElement | - | children。Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +children | String | - | children。Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N defaultValue | String / Number | undefined | \- | N value | String / Number | - | \- | N onChange | Function | | Typescript:`(value: number \| string) => void`
| N @@ -22,7 +21,7 @@ name | type | default | description | required -- | -- | -- | -- | -- className | String | - | className of component | N style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -badgeProps | \- | - | Typescript:`BadgeProps` | N +badgeProps | Object | - | Typescript:`BadgeProps` | N disabled | Boolean | false | \- | N icon | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N label | String | - | \- | N diff --git a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md index 0c2e35263..4ca7b0e7e 100644 --- a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md +++ b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md @@ -2,14 +2,13 @@ ## API - ### SideBar Props 名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- className | String | - | 类名 | N style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -children | TElement | - | 侧边导航内容。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +children | String | - | 侧边导航内容。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N defaultValue | String / Number | undefined | 选项值。非受控属性 | N value | String / Number | - | 选项值 | N onChange | Function | | TS 类型:`(value: number \| string) => void`
选项值发生变化时触发 | N @@ -22,7 +21,7 @@ onClick | Function | | TS 类型:`(value: number \| string, label: string) => -- | -- | -- | -- | -- className | String | - | 类名 | N style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -badgeProps | \- | - | 透传至 Badge 组件。TS 类型:`BadgeProps` | N +badgeProps | Object | - | 透传至 Badge 组件。TS 类型:`BadgeProps` | N disabled | Boolean | false | 是否禁用 | N icon | TElement | - | 图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N label | String | - | 展示的标签 | N diff --git a/packages/products/tdesign-mobile-react/src/side-bar/type.ts b/packages/products/tdesign-mobile-react/src/side-bar/type.ts index 69cf7965c..c49fe95ea 100644 --- a/packages/products/tdesign-mobile-react/src/side-bar/type.ts +++ b/packages/products/tdesign-mobile-react/src/side-bar/type.ts @@ -4,13 +4,14 @@ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC * */ -import { TElement } from '../common'; +import { TNode, TElement } from '../common'; export interface TdSideBarProps { /** * 侧边导航内容 + * @default '' */ - children?: TElement; + children?: TNode; /** * 选项值。非受控属性 */ From 7ea1bcffc10cec8086a3289ea3b2bf4175e86926 Mon Sep 17 00:00:00 2001 From: toby Date: Mon, 26 Aug 2024 20:45:39 +0800 Subject: [PATCH 05/11] =?UTF-8?q?feat(SideBar):=20mobile-react-=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/TDesign.db | Bin 1003520 -> 1003520 bytes packages/scripts/api.json | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/db/TDesign.db b/db/TDesign.db index b5047a4b810267e9d83221ba9821babb691a677e..43d9a8f639c94fff4bc5454ca1156699faf376ad 100644 GIT binary patch delta 132 zcmV-~0DJ#{pgn+~J&+p#caa=J0e695g3;1BGA&g3;1BGA&g Date: Mon, 26 Aug 2024 20:45:59 +0800 Subject: [PATCH 06/11] =?UTF-8?q?feat(SideBar):=20mobile-react=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tdesign-mobile-react/src/side-bar/side-bar.en-US.md | 2 +- packages/products/tdesign-mobile-react/src/side-bar/side-bar.md | 2 +- packages/products/tdesign-mobile-react/src/side-bar/type.ts | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md index 9fd36f807..17fffe010 100644 --- a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md +++ b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md @@ -8,7 +8,7 @@ name | type | default | description | required -- | -- | -- | -- | -- className | String | - | className of component | N style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -children | String | - | children。Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +children | TNode | - | children。Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N defaultValue | String / Number | undefined | \- | N value | String / Number | - | \- | N onChange | Function | | Typescript:`(value: number \| string) => void`
| N diff --git a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md index 4ca7b0e7e..1aa71698f 100644 --- a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md +++ b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md @@ -8,7 +8,7 @@ -- | -- | -- | -- | -- className | String | - | 类名 | N style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -children | String | - | 侧边导航内容。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +children | TNode | - | 侧边导航内容。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N defaultValue | String / Number | undefined | 选项值。非受控属性 | N value | String / Number | - | 选项值 | N onChange | Function | | TS 类型:`(value: number \| string) => void`
选项值发生变化时触发 | N diff --git a/packages/products/tdesign-mobile-react/src/side-bar/type.ts b/packages/products/tdesign-mobile-react/src/side-bar/type.ts index c49fe95ea..d59b58533 100644 --- a/packages/products/tdesign-mobile-react/src/side-bar/type.ts +++ b/packages/products/tdesign-mobile-react/src/side-bar/type.ts @@ -9,7 +9,6 @@ import { TNode, TElement } from '../common'; export interface TdSideBarProps { /** * 侧边导航内容 - * @default '' */ children?: TNode; /** From 150c2d0af6f59c38eec5f61bfa7fc47914ca76d8 Mon Sep 17 00:00:00 2001 From: toby Date: Mon, 26 Aug 2024 21:38:26 +0800 Subject: [PATCH 07/11] =?UTF-8?q?feat(SideBar):=20mobile-react-=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/TDesign.db | Bin 1003520 -> 1003520 bytes packages/scripts/api.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/db/TDesign.db b/db/TDesign.db index 43d9a8f639c94fff4bc5454ca1156699faf376ad..871e8d126b4a5ceeced0ec232441ee624060d9a6 100644 GIT binary patch delta 146 zcmV;D0B!$(pgn+~J&+p#c##}K0eFF6g3;1BGA&g3;1BGA&g Date: Mon, 26 Aug 2024 21:39:24 +0800 Subject: [PATCH 08/11] =?UTF-8?q?feat(SideBar):=20mobile-react=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tdesign-mobile-react/src/side-bar/side-bar.en-US.md | 2 +- packages/products/tdesign-mobile-react/src/side-bar/side-bar.md | 2 +- packages/products/tdesign-mobile-react/src/side-bar/type.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md index 17fffe010..f40d832de 100644 --- a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md +++ b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.en-US.md @@ -21,7 +21,7 @@ name | type | default | description | required -- | -- | -- | -- | -- className | String | - | className of component | N style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -badgeProps | Object | - | Typescript:`BadgeProps` | N +badgeProps | Object | - | Typescript:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/side-bar/type.ts) | N disabled | Boolean | false | \- | N icon | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N label | String | - | \- | N diff --git a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md index 1aa71698f..d8b67a040 100644 --- a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md +++ b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md @@ -21,7 +21,7 @@ onClick | Function | | TS 类型:`(value: number \| string, label: string) => -- | -- | -- | -- | -- className | String | - | 类名 | N style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -badgeProps | Object | - | 透传至 Badge 组件。TS 类型:`BadgeProps` | N +badgeProps | Object | - | 透传至 Badge 组件。TS 类型:`BadgeProps`,[Badge API Documents](./badge?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/side-bar/type.ts) | N disabled | Boolean | false | 是否禁用 | N icon | TElement | - | 图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N label | String | - | 展示的标签 | N diff --git a/packages/products/tdesign-mobile-react/src/side-bar/type.ts b/packages/products/tdesign-mobile-react/src/side-bar/type.ts index d59b58533..182678313 100644 --- a/packages/products/tdesign-mobile-react/src/side-bar/type.ts +++ b/packages/products/tdesign-mobile-react/src/side-bar/type.ts @@ -4,6 +4,7 @@ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC * */ +import { BadgeProps } from '../badge'; import { TNode, TElement } from '../common'; export interface TdSideBarProps { From bc21cde73da0110d178ea6621e1b9b9560e08ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Tue, 27 Aug 2024 16:17:58 +0800 Subject: [PATCH 09/11] feat(side-bar): merge value api --- db/TDesign.db | Bin 1003520 -> 1003520 bytes .../src/side-bar/README.en-US.md | 2 +- .../src/side-bar/README.md | 2 +- .../tdesign-miniprogram/src/side-bar/props.ts | 20 ++++ .../src/side-bar/side-bar-item-props.ts | 33 +++++++ .../tdesign-miniprogram/src/side-bar/type.ts | 62 ++++++++++++ .../src/side-bar/defaultProps.ts | 4 +- .../src/side-bar/side-bar.en-US.md | 2 +- .../src/side-bar/side-bar.md | 2 +- .../tdesign-mobile-react/src/side-bar/type.ts | 8 +- .../tdesign-mobile-vue/src/side-bar/props.ts | 28 ++++++ .../src/side-bar/side-bar-item-props.ts | 30 ++++++ .../tdesign-mobile-vue/src/side-bar/type.ts | 55 +++++++++++ packages/scripts/api.json | 90 ++---------------- 14 files changed, 244 insertions(+), 94 deletions(-) create mode 100644 packages/products/tdesign-miniprogram/src/side-bar/props.ts create mode 100644 packages/products/tdesign-miniprogram/src/side-bar/side-bar-item-props.ts create mode 100644 packages/products/tdesign-miniprogram/src/side-bar/type.ts create mode 100644 packages/products/tdesign-mobile-vue/src/side-bar/props.ts create mode 100644 packages/products/tdesign-mobile-vue/src/side-bar/side-bar-item-props.ts create mode 100644 packages/products/tdesign-mobile-vue/src/side-bar/type.ts diff --git a/db/TDesign.db b/db/TDesign.db index 871e8d126b4a5ceeced0ec232441ee624060d9a6..85fd73b492e6241a27744c23771dd1c0833a295f 100644 GIT binary patch delta 296 zcmWm7ze_?v902h9zPso9;rB{Os+WQ`gb}!CNrQ&r77fynArxmpZMHUv1xHIn26E8S ztKJqwLUOnU%|Ss+MA#qDAJ9^{f8f*di!Hx+7Kdg#QHJKBkOHJIq@YqTDNHFsQdm;h zQaDn$JrNFm*$%4^RfV`iqrUm)DTi7l2Ek-wZqo8F;U24z5#12(k48VueCf znGsBx%XZhE)pHU2riSybrec^1RXZimu+_lBN%iAlfz~?nD!O4!=(`wZOvcB_m;UrH z--m-CNa*Y3;1BGA&gi6$~8@C}lbzO>cE` zWkq&nZgeS^Fcl0Y3kg90${GRz6zH|pbaw*p#w4k#R5_c84IxsH43@6N}vr_0||VXHyH#08wn+s0Za@N1!fAQkx-Yx QqYYk%AfyeqAfyi9tE void`
| N onClick | Function | | Typescript:`(value: number \| string, label: string) => void`
| N diff --git a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md index d8b67a040..2cb3eac33 100644 --- a/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md +++ b/packages/products/tdesign-mobile-react/src/side-bar/side-bar.md @@ -9,8 +9,8 @@ className | String | - | 类名 | N style | Object | - | 样式,TS 类型:`React.CSSProperties` | N children | TNode | - | 侧边导航内容。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N -defaultValue | String / Number | undefined | 选项值。非受控属性 | N value | String / Number | - | 选项值 | N +defaultValue | String / Number | - | 选项值。非受控属性 | N onChange | Function | | TS 类型:`(value: number \| string) => void`
选项值发生变化时触发 | N onClick | Function | | TS 类型:`(value: number \| string, label: string) => void`
点击选项时触发 | N diff --git a/packages/products/tdesign-mobile-react/src/side-bar/type.ts b/packages/products/tdesign-mobile-react/src/side-bar/type.ts index 182678313..f80899ec4 100644 --- a/packages/products/tdesign-mobile-react/src/side-bar/type.ts +++ b/packages/products/tdesign-mobile-react/src/side-bar/type.ts @@ -12,14 +12,14 @@ export interface TdSideBarProps { * 侧边导航内容 */ children?: TNode; - /** - * 选项值。非受控属性 - */ - defaultValue?: string | number; /** * 选项值 */ value?: string | number; + /** + * 选项值,非受控属性 + */ + defaultValue?: string | number; /** * 选项值发生变化时触发 */ diff --git a/packages/products/tdesign-mobile-vue/src/side-bar/props.ts b/packages/products/tdesign-mobile-vue/src/side-bar/props.ts new file mode 100644 index 000000000..c8fe47bf1 --- /dev/null +++ b/packages/products/tdesign-mobile-vue/src/side-bar/props.ts @@ -0,0 +1,28 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdSideBarProps } from './type'; +import { PropType } from 'vue'; + +export default { + /** 选项值 */ + value: { + type: [String, Number] as PropType, + default: undefined, + }, + modelValue: { + type: [String, Number] as PropType, + default: undefined, + }, + /** 选项值,非受控属性 */ + defaultValue: { + type: [String, Number] as PropType, + }, + /** 选项值发生变化时触发 */ + onChange: Function as PropType, + /** 点击选项时触发 */ + onClick: Function as PropType, +}; diff --git a/packages/products/tdesign-mobile-vue/src/side-bar/side-bar-item-props.ts b/packages/products/tdesign-mobile-vue/src/side-bar/side-bar-item-props.ts new file mode 100644 index 000000000..db6dd3853 --- /dev/null +++ b/packages/products/tdesign-mobile-vue/src/side-bar/side-bar-item-props.ts @@ -0,0 +1,30 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdSideBarItemProps } from '../side-bar/type'; +import { PropType } from 'vue'; + +export default { + /** 透传至 Badge 组件 */ + badgeProps: { + type: Object as PropType, + }, + /** 是否禁用 */ + disabled: Boolean, + /** 图标 */ + icon: { + type: Function as PropType, + }, + /** 展示的标签 */ + label: { + type: String, + default: '', + }, + /** 当前选项的值 */ + value: { + type: [String, Number] as PropType, + }, +}; diff --git a/packages/products/tdesign-mobile-vue/src/side-bar/type.ts b/packages/products/tdesign-mobile-vue/src/side-bar/type.ts new file mode 100644 index 000000000..bc44a50f3 --- /dev/null +++ b/packages/products/tdesign-mobile-vue/src/side-bar/type.ts @@ -0,0 +1,55 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TNode } from '../common'; + +export interface TdSideBarProps { + /** + * 选项值 + */ + value?: string | number; + /** + * 选项值,非受控属性 + */ + defaultValue?: string | number; + /** + * 选项值 + */ + modelValue?: string | number; + /** + * 选项值发生变化时触发 + */ + onChange?: (value: number | string) => void; + /** + * 点击选项时触发 + */ + onClick?: (value: number | string, label: string) => void; +} + +export interface TdSideBarItemProps { + /** + * 透传至 Badge 组件 + */ + badgeProps?: object; + /** + * 是否禁用 + * @default false + */ + disabled?: boolean; + /** + * 图标 + */ + icon?: TNode; + /** + * 展示的标签 + * @default '' + */ + label?: string; + /** + * 当前选项的值 + */ + value?: string | number; +} diff --git a/packages/scripts/api.json b/packages/scripts/api.json index aded23993..6823fd912 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -101247,50 +101247,11 @@ ] }, { - "id": 1711973521, - "platform_framework": [ - "16", - "64" - ], - "component": "SideBar", - "field_category": 1, - "field_name": "defaultValue", - "field_type": [ - "1", - "2" - ], - "field_default_value": "undefined", - "field_enum": "", - "field_desc_zh": "选项值。非受控属性", - "field_desc_en": null, - "field_required": 0, - "event_input": "", - "create_time": "2024-04-01 12:12:01", - "update_time": "2024-04-01 12:12:01", - "event_output": null, - "custom_field_type": null, - "syntactic_sugar": null, - "readonly": 1, - "html_attribute": 0, - "trigger_elements": "", - "deprecated": 0, - "version": "", - "test_description": null, - "support_default_value": 0, - "field_category_text": "Props", - "platform_framework_text": [ - "React(Mobile)", - "Miniprogram" - ], - "field_type_text": [ - "String", - "Number" - ] - }, - { - "id": 3379, + "id": 3532, "platform_framework": [ + "8", "16", + "32", "64" ], "component": "SideBar", @@ -101306,46 +101267,6 @@ "field_desc_en": null, "field_required": 0, "event_input": "", - "create_time": "2023-03-13 02:16:36", - "update_time": "2023-03-13 02:16:36", - "event_output": null, - "custom_field_type": null, - "syntactic_sugar": "", - "readonly": 1, - "html_attribute": 0, - "trigger_elements": "", - "deprecated": 0, - "version": "", - "test_description": null, - "support_default_value": 0, - "field_category_text": "Props", - "platform_framework_text": [ - "React(Mobile)", - "Miniprogram" - ], - "field_type_text": [ - "String", - "Number" - ] - }, - { - "id": 3532, - "platform_framework": [ - "8" - ], - "component": "SideBar", - "field_category": 1, - "field_name": "value", - "field_type": [ - "1", - "2" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "选项值", - "field_desc_en": null, - "field_required": 0, - "event_input": "", "create_time": "2023-06-11 07:47:06", "update_time": "2023-06-11 07:47:06", "event_output": null, @@ -101360,7 +101281,10 @@ "support_default_value": 1, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)" + "Vue(Mobile)", + "React(Mobile)", + "Angular(Mobile)", + "Miniprogram" ], "field_type_text": [ "String", From 89325c7832149b74ec7b93748493b9cde2be3270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Tue, 27 Aug 2024 16:18:46 +0800 Subject: [PATCH 10/11] feat(side-bar-item): merge badgeProps api --- db/TDesign.db | Bin 1003520 -> 1003520 bytes .../src/side-bar/README.en-US.md | 2 +- .../src/side-bar/README.md | 2 +- .../tdesign-miniprogram/src/side-bar/type.ts | 4 +- .../src/side-bar/side-bar.en-US.md | 2 +- .../src/side-bar/side-bar.md | 2 +- .../tdesign-mobile-vue/src/side-bar/type.ts | 3 +- packages/scripts/api.json | 43 ++---------------- 8 files changed, 14 insertions(+), 44 deletions(-) diff --git a/db/TDesign.db b/db/TDesign.db index 85fd73b492e6241a27744c23771dd1c0833a295f..53d2e298fc69aa68675aff809779229921f74e75 100644 GIT binary patch delta 363 zcmWN^JxD@9007{-ciy{u_wKw}f+$0C5~8$dP>}v;3R=RcAH*SwewLOX2qhv2qC)Et zlxR~l1krFV1r0$&ffTq%PDN$3WZ+WJ4d3u3bJ1ijy3+zvyRAbobso=mnE-%Sc5*?2 z_Yl9Z6L#$6XJOP?SmoRa&cOz!{EnN_UuAMJ+C53p&*515ED}bw!{N1RWTP5^nxP@h zrD4s~h(m5dcYE} zsGvgUVcD54@(Jf-0R_};kzc`$`Xg8MM`3TF1ng5d?w+JBx(S$?o^fXtYBZh{@yb8h z;YKBZ2VEIdlKtYBXYFTuoVC##njq)q9sWi+WExYj02@Fo9rF6sSWvDZrM%K(s9LXV wWbG1H0Q+Py>(UC)ZSqD2%mZAJo$fhtDkNXDS5zoY3RuO0@(8Py5xMUA2R6oc5C8xG delta 395 zcmZozVB4_3c7ilx-9#B@#=4CO3-#H!o-jP+TC|zn;0z<{3a&+5i>5EkWVD^0TgSsQ z-5{G$VEXMBtYVYj-e%wIXB5l9{CSSY&$1)iAgmKS;UG0Nv*D&<8e^#CaiYX5$TXZ!a{ zyxhIaU5pOfSrhnTIaoNES(vt`W$?}0&Md;PeLK4X|6hI<5r$BP>3jzKVnVD*EN56u zm=`d!F~tELCcqFn*-$}wd$0k2GxPR%PktGu?Vn8fg}8*+xvntq>+xmtuHxnA$>Xl( ty0YCcfnAtmyF&u|Y9`S} Date: Tue, 27 Aug 2024 16:24:06 +0800 Subject: [PATCH 11/11] feat: Angular(Mobile) --- db/TDesign.db | Bin 1003520 -> 1003520 bytes packages/scripts/api.json | 20 ++++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/db/TDesign.db b/db/TDesign.db index 53d2e298fc69aa68675aff809779229921f74e75..e305ec29ff92d8b3a961a3420c868758589c3178 100644 GIT binary patch delta 113 zcmZozVB4_3c7ilx`$QRM#`ea9)&$1Z1g6#m=GFw3)&$np1h&=$_SOWB)&$Ph1g_Qu z?yU(t1rm%E+b>G+@a<%*nEv1*PdbqDxWtppSkb=b5)TmbZeMeW?+GiT#q^0c_+o)n Oq9l*YcH^6TXUhQTuqoUC delta 113 zcmZozVB4_3c7ilx<3t%}#>U2k)&$1Z1g6#m=GFw3)&$np1h&=$_SOWB)&$Ph1g_Qu z?yU(t1rm%A+b>G+@a<%bnEv1*PdbqDxWtpp7}37w5)TmbZeMeW?+GiT#Po?b_+o)n Oq9l*YcH^6TXUhP}E-4TI diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 9339c5756..58eebce90 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -101332,7 +101332,8 @@ "id": 1712580336, "platform_framework": [ "8", - "16" + "16", + "32" ], "component": "SideBar", "field_category": 2, @@ -101361,7 +101362,8 @@ "field_category_text": "Events", "platform_framework_text": [ "Vue(Mobile)", - "React(Mobile)" + "React(Mobile)", + "Angular(Mobile)" ], "field_type_text": [ "Array" @@ -101372,6 +101374,7 @@ "platform_framework": [ "8", "16", + "32", "64" ], "component": "SideBar", @@ -101402,6 +101405,7 @@ "platform_framework_text": [ "Vue(Mobile)", "React(Mobile)", + "Angular(Mobile)", "Miniprogram" ], "field_type_text": [ @@ -101456,6 +101460,7 @@ "platform_framework": [ "8", "16", + "32", "64" ], "component": "SideBarItem", @@ -101486,6 +101491,7 @@ "platform_framework_text": [ "Vue(Mobile)", "React(Mobile)", + "Angular(Mobile)", "Miniprogram" ], "field_type_text": [ @@ -101535,7 +101541,8 @@ "id": 1712580374, "platform_framework": [ "8", - "16" + "16", + "32" ], "component": "SideBarItem", "field_category": 1, @@ -101564,7 +101571,8 @@ "field_category_text": "Props", "platform_framework_text": [ "Vue(Mobile)", - "React(Mobile)" + "React(Mobile)", + "Angular(Mobile)" ], "field_type_text": [ "TNode" @@ -101575,6 +101583,7 @@ "platform_framework": [ "8", "16", + "32", "64" ], "component": "SideBarItem", @@ -101605,6 +101614,7 @@ "platform_framework_text": [ "Vue(Mobile)", "React(Mobile)", + "Angular(Mobile)", "Miniprogram" ], "field_type_text": [ @@ -101616,6 +101626,7 @@ "platform_framework": [ "8", "16", + "32", "64" ], "component": "SideBarItem", @@ -101647,6 +101658,7 @@ "platform_framework_text": [ "Vue(Mobile)", "React(Mobile)", + "Angular(Mobile)", "Miniprogram" ], "field_type_text": [