From a694a5982872a59cfada048e1c3e4ad380e7fba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Fri, 29 Nov 2024 23:13:25 +0800 Subject: [PATCH 1/2] feat: update api --- db/TDesign.db | Bin 1003520 -> 1003520 bytes .../src/drawer/README.en-US.md | 4 +- .../tdesign-miniprogram/src/drawer/README.md | 4 +- .../tdesign-miniprogram/src/drawer/type.ts | 78 ++++++++++++++++- .../src/drawer/drawer.en-US.md | 5 +- .../tdesign-mobile-react/src/drawer/drawer.md | 5 +- .../tdesign-mobile-react/src/drawer/type.ts | 8 +- .../src/drawer/drawer.en-US.md | 9 +- .../tdesign-mobile-vue/src/drawer/drawer.md | 9 +- .../tdesign-mobile-vue/src/drawer/props.ts | 4 +- .../tdesign-mobile-vue/src/drawer/type.ts | 9 +- packages/scripts/api.json | 82 ++---------------- 12 files changed, 118 insertions(+), 99 deletions(-) diff --git a/db/TDesign.db b/db/TDesign.db index 53f27b87e9031f43484b1366d362482261328e80..329d5cc143cde8b49905ce455011a4388b46e461 100644 GIT binary patch delta 444 zcmZozVB4_3c7ilx=tLQ3#?Z!u)&$1Z1g6#m=GFw3)&$nA32a;PnV5{GixsflVq$dJ z{;7b?fl<9tvtM6|iBXbKoP(Fwkb$F7*4UVVfq|2QmxGsqgY#pBOHpEZYSFYRHc`RH z4NV#)MVaa8sYO-_Ao1yMA8<>sK~zk4C}xwKKB3k?zrh+A97o_Pk+P> z#5~)lKjO`*Wns@?w3^PEz*jQ8I)P7i`>X`MXN*idXSUZR@x5YU;l9HlvOOoAZ>oeY zhbjXP^E_6*4Bpo~e%wd664__7yRa>0<6-S$F=3tugN)fAIN4CaYI{Zl-(GeWepe=o L?V25Y*N+1LS0IdC delta 496 zcmZozVB4_3c7imc*F+g-Mz6+%)&$1Z1g6#m=GFw3)&$nA32a;PnHVol7b{@9#l-M< z`=!_Y`p`x-yox-`mcy{oZy?jT4Lx)7cxiWSJNo zwyQO8&1PX@oHPA!3)hSK#|=$3Nkt0!b_!2hw>{ahRw1D*F{d;&q_QB@HYKqnH9_IU z!WGY#?1G9XC_J0G;aTsx=NorFo!9+j2TcJZQLD^!rY%31R3Tt@_R7M=e@-n!}E!;VY|o!?i@yzCgG{d(_0>Lr%Vrc z#LY8(O9Pj|^llJqzZXXYD9rfVr$6EbVxH~OAMs|@vT)yFw3*JDz*oYUF})&zPmYPb zX#2DTzGsZv8`type DrawerTriggerSource = 'overlay'`
item-click | `(index: number; item: DrawerItem)` | \- overlay-click | \- | \- diff --git a/packages/products/tdesign-miniprogram/src/drawer/README.md b/packages/products/tdesign-miniprogram/src/drawer/README.md index f2e8a9fed..460b90b27 100644 --- a/packages/products/tdesign-miniprogram/src/drawer/README.md +++ b/packages/products/tdesign-miniprogram/src/drawer/README.md @@ -11,7 +11,7 @@ custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场 close-on-overlay-click | Boolean | true | 点击蒙层时是否触发抽屉关闭事件 | N destroy-on-close | Boolean | false | 抽屉关闭时是否销毁节点 | N footer | Slot | - | `0.29.0`。抽屉的底部。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -items | Array | - | 抽屉里的列表项。TS 类型:`DrawerItem[] ` `interface DrawerItem { title: string; icon: string; }。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts)`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts) | N +items | Array | - | 抽屉里的列表项。TS 类型:`DrawerItem[]` `interface DrawerItem { title: string; icon: string; }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts) | N placement | String | right | 抽屉方向。可选项:left/right | N show-overlay | Boolean | true | 是否显示遮罩层 | N title | String / Slot | - | `0.29.0`。抽屉的标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N @@ -23,6 +23,6 @@ z-index | Number | 11500 | 抽屉层级,样式默认为 11500 | N 名称 | 参数 | 描述 -- | -- | -- -close | `(trigger: TriggerSource)` | 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts)。
`type TriggerSource = 'overlay'`
+close | `(trigger: DrawerTriggerSource)` | 关闭时触发。。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts)。
`type DrawerTriggerSource = 'overlay'`
item-click | `(index: number; item: DrawerItem)` | 点击抽屉里的列表项 overlay-click | \- | 如果蒙层存在,点击蒙层时触发 diff --git a/packages/products/tdesign-miniprogram/src/drawer/type.ts b/packages/products/tdesign-miniprogram/src/drawer/type.ts index 9e2b017cc..18a201399 100644 --- a/packages/products/tdesign-miniprogram/src/drawer/type.ts +++ b/packages/products/tdesign-miniprogram/src/drawer/type.ts @@ -4,4 +4,80 @@ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC * */ -[object Object] \ No newline at end of file +export interface TdDrawerProps { + /** + * 点击蒙层时是否触发抽屉关闭事件 + * @default true + */ + closeOnOverlayClick?: { + type: BooleanConstructor; + value?: boolean; + }; + /** + * 抽屉关闭时是否销毁节点 + * @default false + */ + destroyOnClose?: { + type: BooleanConstructor; + value?: boolean; + }; + /** + * 抽屉里的列表项 + */ + items?: { + type: ArrayConstructor; + value?: DrawerItem[]; + }; + /** + * 抽屉方向 + * @default right + */ + placement?: { + type: StringConstructor; + value?: 'left' | 'right'; + }; + /** + * 是否显示遮罩层 + * @default true + */ + showOverlay?: { + type: BooleanConstructor; + value?: boolean; + }; + /** + * 抽屉的标题 + */ + title?: { + type: StringConstructor; + value?: string; + }; + /** + * 是否使用了自定义导航栏 + * @default false + */ + usingCustomNavbar?: { + type: BooleanConstructor; + value?: boolean; + }; + /** + * 组件是否可见 + * @default false + */ + visible?: { + type: BooleanConstructor; + value?: boolean; + }; + /** + * 抽屉层级,样式默认为 11500 + * @default 11500 + */ + zIndex?: { + type: NumberConstructor; + value?: number; + }; +} + +export interface DrawerItem { + title: string; + icon: string; +} diff --git a/packages/products/tdesign-mobile-react/src/drawer/drawer.en-US.md b/packages/products/tdesign-mobile-react/src/drawer/drawer.en-US.md index 0aa49bed9..0de4c96a6 100644 --- a/packages/products/tdesign-mobile-react/src/drawer/drawer.en-US.md +++ b/packages/products/tdesign-mobile-react/src/drawer/drawer.en-US.md @@ -1,6 +1,7 @@ :: BASE_DOC :: ## API + ### Drawer Props name | type | default | description | required @@ -11,7 +12,7 @@ attach | String / Function | - | Typescript:`AttachNode`。[see more ts defini closeOnOverlayClick | Boolean | true | \- | N destroyOnClose | Boolean | false | \- | N footer | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N -items | Array | - | Typescript:`DrawerItem[] ` `interface DrawerItem { title: string; icon: TNode; }`。[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/drawer/type.ts) | N +items | Array | - | Typescript:`DrawerItem[] ` `interface DrawerItem { title: string; icon?: TNode; }`。[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/drawer/type.ts) | N placement | String | right | options: left/right | N showOverlay | Boolean | true | \- | N title | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N @@ -19,7 +20,7 @@ visible | Boolean | false | \- | N zIndex | Number | - | \- | N onBeforeClose | Function | | Typescript:`() => void`
| N onBeforeOpen | Function | | Typescript:`() => void`
| N -onClose | Function | | Typescript:`(trigger: TriggerSource) => void`
| N +onClose | Function | | Typescript:`(trigger: DrawerTriggerSource) => void`
[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/drawer/type.ts)。
`type DrawerTriggerSource = 'overlay'`
| N onItemClick | Function | | Typescript:`( index: number, item: DrawerItem, context: { e: MouseEvent }) => void`
| N onOverlayClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`
| N diff --git a/packages/products/tdesign-mobile-react/src/drawer/drawer.md b/packages/products/tdesign-mobile-react/src/drawer/drawer.md index 938b2d034..043a365ee 100644 --- a/packages/products/tdesign-mobile-react/src/drawer/drawer.md +++ b/packages/products/tdesign-mobile-react/src/drawer/drawer.md @@ -1,6 +1,7 @@ :: BASE_DOC :: ## API + ### Drawer Props 名称 | 类型 | 默认值 | 描述 | 必传 @@ -11,7 +12,7 @@ attach | String / Function | - | 抽屉挂载的节点,默认挂在组件本 closeOnOverlayClick | Boolean | true | 点击蒙层时是否触发抽屉关闭事件 | N destroyOnClose | Boolean | false | 抽屉关闭时是否销毁节点 | N footer | TElement | - | 抽屉的底部。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N -items | Array | - | 抽屉里的列表项。TS 类型:`DrawerItem[] ` `interface DrawerItem { title: string; icon: TNode; }`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/drawer/type.ts) | N +items | Array | - | 抽屉里的列表项。TS 类型:`DrawerItem[] ` `interface DrawerItem { title: string; icon?: TNode; }`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/drawer/type.ts) | N placement | String | right | 抽屉方向。可选项:left/right | N showOverlay | Boolean | true | 是否显示遮罩层 | N title | TNode | - | 抽屉的标题。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N @@ -19,7 +20,7 @@ visible | Boolean | false | 组件是否可见 | N zIndex | Number | - | 抽屉层级,样式默认为 1500 | N onBeforeClose | Function | | TS 类型:`() => void`
抽屉执行关闭动画效果前触发 | N onBeforeOpen | Function | | TS 类型:`() => void`
抽屉执行打开动画效果前触发 | N -onClose | Function | | TS 类型:`(trigger: TriggerSource) => void`
关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts)。
`type TriggerSource = 'overlay'`
| N +onClose | Function | | TS 类型:`(trigger: DrawerTriggerSource) => void`
关闭时触发。。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/drawer/type.ts)。
`type DrawerTriggerSource = 'overlay'`
| N onItemClick | Function | | TS 类型:`( index: number, item: DrawerItem, context: { e: MouseEvent }) => void`
点击抽屉里的列表项 | N onOverlayClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`
如果蒙层存在,点击蒙层时触发 | N diff --git a/packages/products/tdesign-mobile-react/src/drawer/type.ts b/packages/products/tdesign-mobile-react/src/drawer/type.ts index 48953ac6f..a3f78269f 100644 --- a/packages/products/tdesign-mobile-react/src/drawer/type.ts +++ b/packages/products/tdesign-mobile-react/src/drawer/type.ts @@ -62,9 +62,9 @@ export interface TdDrawerProps { */ onBeforeOpen?: () => void; /** - * 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts)。
`type TriggerSource = 'overlay'`
+ * 关闭时触发。 */ - onClose?: (trigger: TriggerSource) => void; + onClose?: (trigger: DrawerTriggerSource) => void; /** * 点击抽屉里的列表项 */ @@ -108,7 +108,9 @@ export interface DrawerInstance { export interface DrawerItem { title: string; - icon: TNode; + icon?: TNode; } +export type DrawerTriggerSource = 'overlay'; + export type DrawerMethod = (options?: DrawerOptions) => void; diff --git a/packages/products/tdesign-mobile-vue/src/drawer/drawer.en-US.md b/packages/products/tdesign-mobile-vue/src/drawer/drawer.en-US.md index 5f5e27478..cae323f77 100644 --- a/packages/products/tdesign-mobile-vue/src/drawer/drawer.en-US.md +++ b/packages/products/tdesign-mobile-vue/src/drawer/drawer.en-US.md @@ -1,15 +1,16 @@ :: BASE_DOC :: ## API + ### Drawer Props name | type | default | description | required -- | -- | -- | -- | -- attach | String / Function | - | Typescript:`AttachNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N -closeOnOverlayClick | Boolean | undefined | \- | N +closeOnOverlayClick | Boolean | true | \- | N destroyOnClose | Boolean | false | \- | N footer | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N -items | Array | - | Typescript:`DrawerItem[] ` `interface DrawerItem { title: string; icon: TNode; }`。[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/drawer/type.ts) | N +items | Array | - | Typescript:`DrawerItem[] ` `interface DrawerItem { title: string; icon?: TNode; }`。[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/drawer/type.ts) | N placement | String | right | options: left/right | N showOverlay | Boolean | true | \- | N title | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N @@ -17,7 +18,7 @@ visible | Boolean | false | \- | N zIndex | Number | - | \- | N onBeforeClose | Function | | Typescript:`() => void`
| N onBeforeOpen | Function | | Typescript:`() => void`
| N -onClose | Function | | Typescript:`(trigger: TriggerSource) => void`
| N +onClose | Function | | Typescript:`(trigger: DrawerTriggerSource) => void`
[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts)。
`type DrawerTriggerSource = 'overlay'`
| N onItemClick | Function | | Typescript:`( index: number, item: DrawerItem, context: { e: MouseEvent }) => void`
| N onOverlayClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`
| N @@ -27,7 +28,7 @@ name | params | description -- | -- | -- before-close | \- | \- before-open | \- | \- -close | `(trigger: TriggerSource)` | \- +close | `(trigger: DrawerTriggerSource)` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts)。
`type DrawerTriggerSource = 'overlay'`
item-click | `( index: number, item: DrawerItem, context: { e: MouseEvent })` | \- overlay-click | `(context: { e: MouseEvent })` | \- diff --git a/packages/products/tdesign-mobile-vue/src/drawer/drawer.md b/packages/products/tdesign-mobile-vue/src/drawer/drawer.md index 053fb8dd4..aded46fdb 100644 --- a/packages/products/tdesign-mobile-vue/src/drawer/drawer.md +++ b/packages/products/tdesign-mobile-vue/src/drawer/drawer.md @@ -1,15 +1,16 @@ :: BASE_DOC :: ## API + ### Drawer Props 名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- attach | String / Function | - | 抽屉挂载的节点,默认挂在组件本身的位置。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:`AttachNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N -closeOnOverlayClick | Boolean | undefined | 点击蒙层时是否触发抽屉关闭事件 | N +closeOnOverlayClick | Boolean | true | 点击蒙层时是否触发抽屉关闭事件 | N destroyOnClose | Boolean | false | 抽屉关闭时是否销毁节点 | N footer | Slot / Function | - | 抽屉的底部。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N -items | Array | - | 抽屉里的列表项。TS 类型:`DrawerItem[] ` `interface DrawerItem { title: string; icon: TNode; }`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts) | N +items | Array | - | 抽屉里的列表项。TS 类型:`DrawerItem[] ` `interface DrawerItem { title: string; icon?: TNode; }`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts) | N placement | String | right | 抽屉方向。可选项:left/right | N showOverlay | Boolean | true | 是否显示遮罩层 | N title | String / Slot / Function | - | 抽屉的标题。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N @@ -17,7 +18,7 @@ visible | Boolean | false | 组件是否可见 | N zIndex | Number | - | 抽屉层级,样式默认为 1500 | N onBeforeClose | Function | | TS 类型:`() => void`
抽屉执行关闭动画效果前触发 | N onBeforeOpen | Function | | TS 类型:`() => void`
抽屉执行打开动画效果前触发 | N -onClose | Function | | TS 类型:`(trigger: TriggerSource) => void`
关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts)。
`type TriggerSource = 'overlay'`
| N +onClose | Function | | TS 类型:`(trigger: DrawerTriggerSource) => void`
关闭时触发。。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts)。
`type DrawerTriggerSource = 'overlay'`
| N onItemClick | Function | | TS 类型:`( index: number, item: DrawerItem, context: { e: MouseEvent }) => void`
点击抽屉里的列表项 | N onOverlayClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`
如果蒙层存在,点击蒙层时触发 | N @@ -27,7 +28,7 @@ onOverlayClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void -- | -- | -- before-close | \- | 抽屉执行关闭动画效果前触发 before-open | \- | 抽屉执行打开动画效果前触发 -close | `(trigger: TriggerSource)` | 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts)。
`type TriggerSource = 'overlay'`
+close | `(trigger: DrawerTriggerSource)` | 关闭时触发。。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts)。
`type DrawerTriggerSource = 'overlay'`
item-click | `( index: number, item: DrawerItem, context: { e: MouseEvent })` | 点击抽屉里的列表项 overlay-click | `(context: { e: MouseEvent })` | 如果蒙层存在,点击蒙层时触发 diff --git a/packages/products/tdesign-mobile-vue/src/drawer/props.ts b/packages/products/tdesign-mobile-vue/src/drawer/props.ts index ea3ecf925..1b7c7ab35 100644 --- a/packages/products/tdesign-mobile-vue/src/drawer/props.ts +++ b/packages/products/tdesign-mobile-vue/src/drawer/props.ts @@ -15,7 +15,7 @@ export default { /** 点击蒙层时是否触发抽屉关闭事件 */ closeOnOverlayClick: { type: Boolean, - default: undefined, + default: true, }, /** 抽屉关闭时是否销毁节点 */ destroyOnClose: Boolean, @@ -55,7 +55,7 @@ export default { onBeforeClose: Function as PropType, /** 抽屉执行打开动画效果前触发 */ onBeforeOpen: Function as PropType, - /** 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts)。
`type TriggerSource = 'overlay'`
*/ + /** 关闭时触发。 */ onClose: Function as PropType, /** 点击抽屉里的列表项 */ onItemClick: Function as PropType, diff --git a/packages/products/tdesign-mobile-vue/src/drawer/type.ts b/packages/products/tdesign-mobile-vue/src/drawer/type.ts index b66741266..cf0cf2755 100644 --- a/packages/products/tdesign-mobile-vue/src/drawer/type.ts +++ b/packages/products/tdesign-mobile-vue/src/drawer/type.ts @@ -13,6 +13,7 @@ export interface TdDrawerProps { attach?: AttachNode; /** * 点击蒙层时是否触发抽屉关闭事件 + * @default true */ closeOnOverlayClick?: boolean; /** @@ -60,9 +61,9 @@ export interface TdDrawerProps { */ onBeforeOpen?: () => void; /** - * 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts)。
`type TriggerSource = 'overlay'`
+ * 关闭时触发。 */ - onClose?: (trigger: TriggerSource) => void; + onClose?: (trigger: DrawerTriggerSource) => void; /** * 点击抽屉里的列表项 */ @@ -106,7 +107,9 @@ export interface DrawerInstance { export interface DrawerItem { title: string; - icon: TNode; + icon?: TNode; } +export type DrawerTriggerSource = 'overlay'; + export type DrawerMethod = (options?: DrawerOptions) => void; diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 48c2e5836..adcd174a6 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -42358,6 +42358,7 @@ "1", "2", "4", + "8", "16", "32", "64" @@ -42391,6 +42392,7 @@ "Vue(PC)", "React(PC)", "Angular(PC)", + "Vue(Mobile)", "React(Mobile)", "Angular(Mobile)", "Miniprogram" @@ -42399,43 +42401,6 @@ "Boolean" ] }, - { - "id": 1712581243, - "platform_framework": [ - "8" - ], - "component": "Drawer", - "field_category": 1, - "field_name": "closeOnOverlayClick", - "field_type": [ - "4" - ], - "field_default_value": "undefined", - "field_enum": "", - "field_desc_zh": "点击蒙层时是否触发抽屉关闭事件", - "field_desc_en": null, - "field_required": 0, - "event_input": "", - "create_time": "2024-04-08 13:00:43", - "update_time": "2024-04-08 13:00:43", - "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": [ - "Vue(Mobile)" - ], - "field_type_text": [ - "Boolean" - ] - }, { "id": 1062, "platform_framework": [ @@ -42759,7 +42724,7 @@ "create_time": "2022-03-31 03:39:31", "update_time": "2022-06-16 08:09:43", "event_output": null, - "custom_field_type": "DrawerItem[] 【interface DrawerItem { title: string; icon: TNode; }】", + "custom_field_type": "DrawerItem[] 【interface DrawerItem { title: string; icon?: TNode; }】", "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, @@ -42798,7 +42763,7 @@ "create_time": "2023-02-28 12:04:36", "update_time": "2023-02-28 12:04:36", "event_output": null, - "custom_field_type": "DrawerItem[] 【interface DrawerItem { title: string; icon: string; }】。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts)", + "custom_field_type": "DrawerItem[]【interface DrawerItem { title: string; icon: string; }】", "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, @@ -43533,6 +43498,7 @@ { "id": 2545, "platform_framework": [ + "8", "16", "32", "64" @@ -43543,10 +43509,10 @@ "field_type": [], "field_default_value": "", "field_enum": "", - "field_desc_zh": "关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/drawer/type.ts)。
`type TriggerSource = 'overlay'`
", + "field_desc_zh": "关闭时触发。", "field_desc_en": null, "field_required": 0, - "event_input": "(trigger: TriggerSource)", + "event_input": "(trigger: DrawerTriggerSource)【type DrawerTriggerSource = 'overlay'】", "create_time": "2022-04-06 08:50:33", "update_time": "2022-04-06 08:50:33", "event_output": null, @@ -43561,45 +43527,13 @@ "support_default_value": 0, "field_category_text": "Events", "platform_framework_text": [ + "Vue(Mobile)", "React(Mobile)", "Angular(Mobile)", "Miniprogram" ], "field_type_text": [] }, - { - "id": 1712579200, - "platform_framework": [ - "8" - ], - "component": "Drawer", - "field_category": 2, - "field_name": "close", - "field_type": [], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts)。
`type TriggerSource = 'overlay'`
", - "field_desc_en": null, - "field_required": 0, - "event_input": "(trigger: TriggerSource)", - "create_time": "2024-04-08 12:26:40", - "update_time": "2024-04-08 12:26:40", - "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": "Events", - "platform_framework_text": [ - "Vue(Mobile)" - ], - "field_type_text": [] - }, { "id": 700, "platform_framework": [ From 6900d10e68e0d330454173cca88c1ed6e54aef65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 2 Dec 2024 11:09:43 +0800 Subject: [PATCH 2/2] feat: update api --- db/TDesign.db | Bin 1003520 -> 1003520 bytes .../src/drawer/README.en-US.md | 2 +- .../tdesign-miniprogram/src/drawer/README.md | 2 +- .../tdesign-miniprogram/src/drawer/props.ts | 4 ++-- .../tdesign-miniprogram/src/drawer/type.ts | 1 - .../src/drawer/defaultProps.ts | 2 +- .../src/drawer/drawer.en-US.md | 2 +- .../tdesign-mobile-react/src/drawer/drawer.md | 2 +- .../tdesign-mobile-react/src/drawer/type.ts | 1 - .../src/drawer/drawer.en-US.md | 2 +- .../tdesign-mobile-vue/src/drawer/drawer.md | 2 +- .../tdesign-mobile-vue/src/drawer/props.ts | 2 +- .../tdesign-mobile-vue/src/drawer/type.ts | 1 - .../tdesign-react/src/drawer/defaultProps.ts | 2 +- .../tdesign-react/src/drawer/drawer.en-US.md | 1 + .../tdesign-react/src/drawer/drawer.md | 1 + .../products/tdesign-react/src/drawer/type.ts | 1 - .../src/drawer/drawer.en-US.md | 1 + .../tdesign-vue-next/src/drawer/drawer.md | 1 + .../tdesign-vue-next/src/drawer/props.ts | 2 +- .../tdesign-vue-next/src/drawer/type.ts | 1 - .../tdesign-vue/src/drawer/drawer.en-US.md | 1 + .../products/tdesign-vue/src/drawer/drawer.md | 1 + .../products/tdesign-vue/src/drawer/props.ts | 2 +- .../products/tdesign-vue/src/drawer/type.ts | 1 - packages/scripts/api.json | 2 +- 26 files changed, 20 insertions(+), 20 deletions(-) diff --git a/db/TDesign.db b/db/TDesign.db index 329d5cc143cde8b49905ce455011a4388b46e461..75627dd7afb4eccfd98de6cb16910bebafc59323 100644 GIT binary patch delta 124 zcmZozVB4_3c7ilx*hCp;#<0eO)&$1Z1g6#m=GFw3)&$np1h&=$_N@sV%hrqSWa4k* z7v%lNTgP*NeJ9rn&g&d^IQ+LNa?EAtX%uQ document.body。TS 类型:`AttachNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N -closeOnOverlayClick | Boolean | true | 点击蒙层时是否触发抽屉关闭事件 | N +closeOnOverlayClick | Boolean | undefined | 点击蒙层时是否触发抽屉关闭事件 | N destroyOnClose | Boolean | false | 抽屉关闭时是否销毁节点 | N footer | TElement | - | 抽屉的底部。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N items | Array | - | 抽屉里的列表项。TS 类型:`DrawerItem[] ` `interface DrawerItem { title: string; icon?: TNode; }`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/drawer/type.ts) | N diff --git a/packages/products/tdesign-mobile-react/src/drawer/type.ts b/packages/products/tdesign-mobile-react/src/drawer/type.ts index a3f78269f..80533e531 100644 --- a/packages/products/tdesign-mobile-react/src/drawer/type.ts +++ b/packages/products/tdesign-mobile-react/src/drawer/type.ts @@ -14,7 +14,6 @@ export interface TdDrawerProps { attach?: AttachNode; /** * 点击蒙层时是否触发抽屉关闭事件 - * @default true */ closeOnOverlayClick?: boolean; /** diff --git a/packages/products/tdesign-mobile-vue/src/drawer/drawer.en-US.md b/packages/products/tdesign-mobile-vue/src/drawer/drawer.en-US.md index cae323f77..fdb5f1f33 100644 --- a/packages/products/tdesign-mobile-vue/src/drawer/drawer.en-US.md +++ b/packages/products/tdesign-mobile-vue/src/drawer/drawer.en-US.md @@ -7,7 +7,7 @@ name | type | default | description | required -- | -- | -- | -- | -- attach | String / Function | - | Typescript:`AttachNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N -closeOnOverlayClick | Boolean | true | \- | N +closeOnOverlayClick | Boolean | undefined | \- | N destroyOnClose | Boolean | false | \- | N footer | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N items | Array | - | Typescript:`DrawerItem[] ` `interface DrawerItem { title: string; icon?: TNode; }`。[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/drawer/type.ts) | N diff --git a/packages/products/tdesign-mobile-vue/src/drawer/drawer.md b/packages/products/tdesign-mobile-vue/src/drawer/drawer.md index aded46fdb..575b2f004 100644 --- a/packages/products/tdesign-mobile-vue/src/drawer/drawer.md +++ b/packages/products/tdesign-mobile-vue/src/drawer/drawer.md @@ -7,7 +7,7 @@ 名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- attach | String / Function | - | 抽屉挂载的节点,默认挂在组件本身的位置。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:`AttachNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N -closeOnOverlayClick | Boolean | true | 点击蒙层时是否触发抽屉关闭事件 | N +closeOnOverlayClick | Boolean | undefined | 点击蒙层时是否触发抽屉关闭事件 | N destroyOnClose | Boolean | false | 抽屉关闭时是否销毁节点 | N footer | Slot / Function | - | 抽屉的底部。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N items | Array | - | 抽屉里的列表项。TS 类型:`DrawerItem[] ` `interface DrawerItem { title: string; icon?: TNode; }`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/drawer/type.ts) | N diff --git a/packages/products/tdesign-mobile-vue/src/drawer/props.ts b/packages/products/tdesign-mobile-vue/src/drawer/props.ts index 1b7c7ab35..4dd9f54df 100644 --- a/packages/products/tdesign-mobile-vue/src/drawer/props.ts +++ b/packages/products/tdesign-mobile-vue/src/drawer/props.ts @@ -15,7 +15,7 @@ export default { /** 点击蒙层时是否触发抽屉关闭事件 */ closeOnOverlayClick: { type: Boolean, - default: true, + default: undefined, }, /** 抽屉关闭时是否销毁节点 */ destroyOnClose: Boolean, diff --git a/packages/products/tdesign-mobile-vue/src/drawer/type.ts b/packages/products/tdesign-mobile-vue/src/drawer/type.ts index cf0cf2755..babf5d68b 100644 --- a/packages/products/tdesign-mobile-vue/src/drawer/type.ts +++ b/packages/products/tdesign-mobile-vue/src/drawer/type.ts @@ -13,7 +13,6 @@ export interface TdDrawerProps { attach?: AttachNode; /** * 点击蒙层时是否触发抽屉关闭事件 - * @default true */ closeOnOverlayClick?: boolean; /** diff --git a/packages/products/tdesign-react/src/drawer/defaultProps.ts b/packages/products/tdesign-react/src/drawer/defaultProps.ts index 9f12ce8da..664c5407e 100644 --- a/packages/products/tdesign-react/src/drawer/defaultProps.ts +++ b/packages/products/tdesign-react/src/drawer/defaultProps.ts @@ -6,7 +6,7 @@ import { TdDrawerProps } from './type'; export const drawerDefaultProps: TdDrawerProps = { closeOnEscKeydown: undefined, - closeOnOverlayClick: true, + closeOnOverlayClick: undefined, destroyOnClose: false, footer: true, forceRender: false, diff --git a/packages/products/tdesign-react/src/drawer/drawer.en-US.md b/packages/products/tdesign-react/src/drawer/drawer.en-US.md index 305b3ffed..c1ea50ce4 100644 --- a/packages/products/tdesign-react/src/drawer/drawer.en-US.md +++ b/packages/products/tdesign-react/src/drawer/drawer.en-US.md @@ -1,6 +1,7 @@ :: BASE_DOC :: ## API + ### Drawer Props name | type | default | description | required diff --git a/packages/products/tdesign-react/src/drawer/drawer.md b/packages/products/tdesign-react/src/drawer/drawer.md index ad4d4659a..e405b9e51 100644 --- a/packages/products/tdesign-react/src/drawer/drawer.md +++ b/packages/products/tdesign-react/src/drawer/drawer.md @@ -1,6 +1,7 @@ :: BASE_DOC :: ## API + ### Drawer Props 名称 | 类型 | 默认值 | 描述 | 必传 diff --git a/packages/products/tdesign-react/src/drawer/type.ts b/packages/products/tdesign-react/src/drawer/type.ts index 00d612c50..9364f129b 100644 --- a/packages/products/tdesign-react/src/drawer/type.ts +++ b/packages/products/tdesign-react/src/drawer/type.ts @@ -35,7 +35,6 @@ export interface TdDrawerProps { closeOnEscKeydown?: boolean; /** * 点击蒙层时是否触发抽屉关闭事件 - * @default true */ closeOnOverlayClick?: boolean; /** diff --git a/packages/products/tdesign-vue-next/src/drawer/drawer.en-US.md b/packages/products/tdesign-vue-next/src/drawer/drawer.en-US.md index 089997b7d..658591454 100644 --- a/packages/products/tdesign-vue-next/src/drawer/drawer.en-US.md +++ b/packages/products/tdesign-vue-next/src/drawer/drawer.en-US.md @@ -1,6 +1,7 @@ :: BASE_DOC :: ## API + ### Drawer Props name | type | default | description | required diff --git a/packages/products/tdesign-vue-next/src/drawer/drawer.md b/packages/products/tdesign-vue-next/src/drawer/drawer.md index 7376f8304..24dd9f467 100644 --- a/packages/products/tdesign-vue-next/src/drawer/drawer.md +++ b/packages/products/tdesign-vue-next/src/drawer/drawer.md @@ -37,6 +37,7 @@ 如果您不确定问题是否是由该规则引起的,或者确定该规则不是问题的根本原因,请在 `GitHub` 上提出一个 `issue`,并提供可以重现问题的代码。这将有助于我们更好地了解您的问题并提供更好的帮助。 ## API + ### Drawer Props 名称 | 类型 | 默认值 | 描述 | 必传 diff --git a/packages/products/tdesign-vue-next/src/drawer/props.ts b/packages/products/tdesign-vue-next/src/drawer/props.ts index fe740f2e4..39e652774 100644 --- a/packages/products/tdesign-vue-next/src/drawer/props.ts +++ b/packages/products/tdesign-vue-next/src/drawer/props.ts @@ -32,7 +32,7 @@ export default { /** 点击蒙层时是否触发抽屉关闭事件 */ closeOnOverlayClick: { type: Boolean, - default: true, + default: undefined, }, /** 确认按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 TNode 自定义按钮时,需自行控制确认事件 */ confirmBtn: { diff --git a/packages/products/tdesign-vue-next/src/drawer/type.ts b/packages/products/tdesign-vue-next/src/drawer/type.ts index bbec01c84..022e5bafa 100644 --- a/packages/products/tdesign-vue-next/src/drawer/type.ts +++ b/packages/products/tdesign-vue-next/src/drawer/type.ts @@ -30,7 +30,6 @@ export interface TdDrawerProps { closeOnEscKeydown?: boolean; /** * 点击蒙层时是否触发抽屉关闭事件 - * @default true */ closeOnOverlayClick?: boolean; /** diff --git a/packages/products/tdesign-vue/src/drawer/drawer.en-US.md b/packages/products/tdesign-vue/src/drawer/drawer.en-US.md index 4e98b2f18..708a490a4 100644 --- a/packages/products/tdesign-vue/src/drawer/drawer.en-US.md +++ b/packages/products/tdesign-vue/src/drawer/drawer.en-US.md @@ -1,6 +1,7 @@ :: BASE_DOC :: ## API + ### Drawer Props name | type | default | description | required diff --git a/packages/products/tdesign-vue/src/drawer/drawer.md b/packages/products/tdesign-vue/src/drawer/drawer.md index f6eccbe2f..332101b38 100644 --- a/packages/products/tdesign-vue/src/drawer/drawer.md +++ b/packages/products/tdesign-vue/src/drawer/drawer.md @@ -1,6 +1,7 @@ :: BASE_DOC :: ## API + ### Drawer Props 名称 | 类型 | 默认值 | 描述 | 必传 diff --git a/packages/products/tdesign-vue/src/drawer/props.ts b/packages/products/tdesign-vue/src/drawer/props.ts index 936e64fcd..3c592e31f 100644 --- a/packages/products/tdesign-vue/src/drawer/props.ts +++ b/packages/products/tdesign-vue/src/drawer/props.ts @@ -32,7 +32,7 @@ export default { /** 点击蒙层时是否触发抽屉关闭事件 */ closeOnOverlayClick: { type: Boolean, - default: true, + default: undefined, }, /** 确认按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 TNode 自定义按钮时,需自行控制确认事件 */ confirmBtn: { diff --git a/packages/products/tdesign-vue/src/drawer/type.ts b/packages/products/tdesign-vue/src/drawer/type.ts index bbec01c84..022e5bafa 100644 --- a/packages/products/tdesign-vue/src/drawer/type.ts +++ b/packages/products/tdesign-vue/src/drawer/type.ts @@ -30,7 +30,6 @@ export interface TdDrawerProps { closeOnEscKeydown?: boolean; /** * 点击蒙层时是否触发抽屉关闭事件 - * @default true */ closeOnOverlayClick?: boolean; /** diff --git a/packages/scripts/api.json b/packages/scripts/api.json index adcd174a6..877304dd0 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -42369,7 +42369,7 @@ "field_type": [ "4" ], - "field_default_value": "true", + "field_default_value": "undefined", "field_enum": "", "field_desc_zh": "点击蒙层时是否触发抽屉关闭事件", "field_desc_en": null,