From bd1f071f744e7cd46132202361865dd900454ca0 Mon Sep 17 00:00:00 2001 From: HaixingOoO <974758671@qq.com> Date: Sun, 2 Aug 2026 14:39:59 +0800 Subject: [PATCH 1/6] feat(Scrollbar): new add Scrollbar api --- db/TDesign.db | Bin 1150976 -> 1159168 bytes .../components/scrollbar/defaultProps.ts | 14 + .../components/scrollbar/scrollbar.en-US.md | 34 + .../components/scrollbar/scrollbar.md | 34 + .../packages/components/scrollbar/type.ts | 108 +++ .../packages/components/scrollbar/props.ts | 73 ++ .../components/scrollbar/scrollbar.en-US.md | 36 + .../components/scrollbar/scrollbar.md | 36 + .../packages/components/scrollbar/type.ts | 108 +++ .../tdesign-vue/src/scrollbar/props.ts | 73 ++ .../src/scrollbar/scrollbar.en-US.md | 36 + .../tdesign-vue/src/scrollbar/scrollbar.md | 36 + .../tdesign-vue/src/scrollbar/type.ts | 108 +++ packages/scripts/api.json | 864 ++++++++++++++++++ packages/scripts/map.json | 4 + .../server/controllers/ComponentApi/const.ts | 1 + 16 files changed, 1565 insertions(+) create mode 100644 packages/products/tdesign-react/packages/components/scrollbar/defaultProps.ts create mode 100644 packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md create mode 100644 packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md create mode 100644 packages/products/tdesign-react/packages/components/scrollbar/type.ts create mode 100644 packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts create mode 100644 packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md create mode 100644 packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md create mode 100644 packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts create mode 100644 packages/products/tdesign-vue/src/scrollbar/props.ts create mode 100644 packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md create mode 100644 packages/products/tdesign-vue/src/scrollbar/scrollbar.md create mode 100644 packages/products/tdesign-vue/src/scrollbar/type.ts diff --git a/db/TDesign.db b/db/TDesign.db index b3394ecc704fe2908464ddd4a9a4dc1b0c6f88da..c2ecea0ae94a702823cd839b0eeb0f8ce6350e4d 100644 GIT binary patch delta 5750 zcmcIo3vd%<9#7J=O`7JhLPdPBFm!B%w&^1U7O= z^KJh7-|zAJ{_j6sM^<)yx^mz)dy~OnyiFYj<6y}=W7FBDp$d!D`o0mkx4vHJcA3o9 z_pR@|PF9`BzX|gs2Axu%q1W+j>^ke%9=raebJpzU{z#)^p7V-fYT(%HsN-#AQvcX;$L};m z9>)v44|9(A!<_RmmwCPEQ$wt=$+0-TuFJW>bd%#xj&a9z$H$I$O#e3h#q@jAr?KPR z&c(5hR=e(sHLh`Oi0|xiK4^>0UE`Xq00>^~zRNWw{?8|!d1v!Vj2lho4DnmP=jt@M zZP#oc+J0#pvAtnCVLM_wVB2TwwsqQAo8PwGw!YvG1)mlCw%|&^&uuGhi)>Y{8}Tzs zUAI`uTiB}t5x`(u*bhXaS*70VBalj6IY{_b>a9hDFZS2ft|}1(J~eo?=df$4`sLb} zM2kiZ5sXS*{e%dr)SE96UXAJ|XpIUGO&YbDctE8tze_Y~)P7>8Mr|YR*Qlk$4vnfS zBerX#nYd4-M$Qr2G%7-D)u>uxi%MOJ5t}tCkJ!|kSmTN())05jE+GstL*De<2h8uA z%boKbBlc@{%F<l-PB-w6{ZB9s$9P?76=pW_)MO#8{=>6CH9))Au?6D)hi_q zA5B~sln=+WTb=2b&kW0_&wX+6@o?uC7yDqoavdHPktN~IQuQv$tB@cok`FO{6v@6w zEmd8aaS@TK!MyHrY13_33wIc&*`pQRAbrq7I_NwdG|O#7_-J!89paHHe-&Wj;Awf_ z75S+r`Mee%UFc|bfZ_n#iUh^HpHj*a(Rg6l2k z5U;2$r4LfMX$0|Mj`foQNBV*^8$f&=SyGR+h;-GdQyCs}c!6exxg=s~ZwTvG2m-$u z(L!4UR?sZTg(-n)#ZnBTNHZ5{rCA>;FU^n;RZ~N`YrldOzvl_!EmMs>C(kg&u*y*Q zVc~k)kj+$Zuk}UCzbv`=19^YT^XC30cUjJ_oMraoM$vEsrs0392A50`qqj&5Sjik~ zvDH4WvNBuX*M@X~Z=pkNh+og~jKFa03V#5FP_s}GQH)vO!WCXl5V%&&A09uGcyVC# zT-W%>dDTF%z&IAH11utS4-qWeLwOcZ?hMP;SO6|K3An4Dd}natr07&|9;&)J1z2bG zk?l%_?E z4@6xN<^U2@@#lc}Wl1|MQ z3U)l2NJ+RY!kPVz0oxw>?#T)Z70kk7Xtv2EQt*=uBl=v zMYeN{e<9}lF90UD+jFC9FzS+gI5`@pgYxFoS*kPh%v+0c8g5P|e3PoW9940#=zknV zA`?n;v=W>lP^UocM%0RSaE@$YxN9j8MOre)u^d>@e95b%Xlz1@>#~FIn=k3+CeU7n z^`p)lh!*27iC{8Xy+J0wB!81xIF+{24+bY+kez&0R+Nxv1?_tJQHjaI?9G4<3+gkZstPKP3}joE)R!&USigiEKem6o?Y{90rHyTNg_)DTdf0Q{26HKm)9>(Dru5a-BlCh;jW4bQX|9&afWrK zvB)0Hk4`X}%kSz3(`^E`qBBghezOp1L#hEoSw{xBb`&8Kv7c$B(!iiRbRg09s(kht zD3xUC1$pn0(cz)d;r(MhugUv{p&V)ma%~}~dO%dXPt<2lVV81II@Ce$;wu!oA_(P2N)WiRJvcHpG%R0|L{aE%6RsSU!e5W;}P=SL<%3^y5%KAkuc2a#&H85T-kupGPr6u*F6vHVF< zS5wv5Apx_%5VngcDc92zV3+BzJ0f&gk+Kps^`JSaaItKat_+cQJ=EmMIx7{mM6D%* zqN#FTmT_QKv_!fuCE3jrC2Q6p8V&dmMY3N9a-uv%aI0*ADp=J@P-{^6EM!$wb+%_= zmMCpg#90JMsJK`W=RCdU89Aq8b5X2YFPPJjlcK}JO3V|)U1?rT4id5ezqt7o0X=MH3s7Ut23ws6=gV`hf-L{ zu1_tUNfC-SFhL0B&9o1ZSzn=sQ~C&1&1!d`(Q1CiCBJ3_dgY(VP#S0GFBXJP5gdT5r?Im0iM-0)Pp=UGskrdzIug8%t(d$L##%u||p zcsN^rI@8)}jk{g>f6f)7H%TpuFMUlz|D}G@bXXYDcWdRLGp?oF)7(^5Mvws>X8jif CBF1rcX=vjz8JAtulP2Bs*s|`Au$n;mxnn6-cSNh1QiQ@w;`FDQVS++elwmmvi zv}U*G9`a@P)7JdPnI{$H>!~ApIgkA5vPsBn?zZ4TI@@VwJ4Ft0HcsN~oP%?6m~(M5 zr*JB#v1}*Y&?Q(EBg`IyN#yziMKVnKVUx|qp;T0+*T?9ER`TBU5(hV0K5h^VU=Ev zK?`e3l5T|6FY*WZwLDK}QskUHxPFP`=<*mj%(OIlujpoYw-u&JRpH&!@Q4NyP`j8R zXaTy!Hnb!tVWnB|D_+_k2M?<~uSXGG4Cys&KBT*`qp$cWPJYm>6gfu!w(CCn`5y7g z{EGMcO82BVO?s%9Ax+j!ht767i~}C8D)|IQrTvPuBKb%F3fhKt7ALXp9CQ?HhtL$N z6LX>>m=h void`
Triggered while scrolling | N + +### ScrollbarInstanceFunctions 组件实例方法 + +name | params | return | description +-- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N +getValues | \- | `PositionValues ` | required。Get the view object containing complete scrolling information。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | required。Scroll to a specific set of coordinates。Typescript: `ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | required。Scroll to one side。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md new file mode 100644 index 000000000..d2bfaf72c --- /dev/null +++ b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md @@ -0,0 +1,34 @@ +:: BASE_DOC :: + +## API + +### Scrollbar Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +ariaLabel | String | - | 视图层的 aria-label 文本 | N +autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N +container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N +disabled | Boolean | false | 禁止滚动 | N +id | String | - | 视图层的 ID | N +noResize | Boolean | false | 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) | N +role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N +step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N +tabindex | String / Number | - | 包裹容器的 tabindex | N +thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N +viewClass | String | - | 视图(内容区)的自定义类名 | N +visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N +wrapClass | String | - | 包裹容器的自定义类名 | N +onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N + +### ScrollbarInstanceFunctions 组件实例方法 + +名称 | 参数 | 返回值 | 描述 +-- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +getValues | \- | `PositionValues ` | 必需。获取包含完整滚动信息的视图对象。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | 必需。滚动到一组特定坐标。TS 类型:`ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | 必需。滚动到某一边。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-react/packages/components/scrollbar/type.ts b/packages/products/tdesign-react/packages/components/scrollbar/type.ts new file mode 100644 index 000000000..bab94ddd7 --- /dev/null +++ b/packages/products/tdesign-react/packages/components/scrollbar/type.ts @@ -0,0 +1,108 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +export interface TdScrollbarProps { + /** + * 视图层的 aria-label 文本 + * @default '' + */ + ariaLabel?: string; + /** + * 滚动条 hover 时是否向外扩展(增加交互热区) + * @default true + */ + autoExpand?: boolean; + /** + * 设置滚动容器的最大高度/宽度 + */ + container?: ScrollbarContainerProps; + /** + * 禁止滚动 + * @default false + */ + disabled?: boolean; + /** + * 视图层的 ID + * @default '' + */ + id?: string; + /** + * 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) + * @default false + */ + noResize?: boolean; + /** + * 视图层的 WAI-ARIA 角色 + * @default scrollbar + */ + role?: string; + /** + * 滚动步长 + */ + step?: { x?: number; y?: number }; + /** + * 包裹容器的 tabindex + */ + tabindex?: string | number; + /** + * 滚动条滑块的最小尺寸(px) + * @default 20 + */ + thumbMinSize?: number; + /** + * 视图(内容区)的自定义类名 + * @default '' + */ + viewClass?: string; + /** + * 滚动条的显示形式 + * @default hover + */ + visibility?: 'always' | 'hover' | 'hide'; + /** + * 包裹容器的自定义类名 + * @default '' + */ + wrapClass?: string; + /** + * 滚动时触发 + */ + onScroll?: (context: { e: Event }) => void; +} + +/** 组件实例方法 */ +export interface ScrollbarInstanceFunctions { + /** + * 获取包含完整滚动信息的视图对象 + */ + getValues: () => PositionValues; + /** + * 滚动到一组特定坐标 + */ + scrollTo: (options: { top?: number; left?: number; behavior?: ScrollBehavior }) => void; + /** + * 滚动到某一边 + */ + scrollToEdge: (position: PositionEdge) => void; +} + +export interface PositionValues { + left: number; + top: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; + scrollHeight: number; + clientWidth: number; + clientHeight: number; +} + +export type ScrollToFn = { + (x: number, y: number): void; + (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; +}; + +export type PositionEdge = 'left' | 'right' | 'top' | 'bottom'; diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts b/packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts new file mode 100644 index 000000000..363ce51aa --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts @@ -0,0 +1,73 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdScrollbarProps } from './type'; +import { PropType } from 'vue'; + +export default { + /** 视图层的 aria-label 文本 */ + ariaLabel: { + type: String, + default: '', + }, + /** 滚动条 hover 时是否向外扩展(增加交互热区) */ + autoExpand: { + type: Boolean, + default: true, + }, + /** 设置滚动容器的最大高度/宽度 */ + container: { + type: Object as PropType, + }, + /** 禁止滚动 */ + disabled: Boolean, + /** 视图层的 ID */ + id: { + type: String, + default: '', + }, + /** 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) */ + noResize: Boolean, + /** 视图层的 WAI-ARIA 角色 */ + role: { + type: String, + default: 'scrollbar', + }, + /** 滚动步长 */ + step: { + type: Object as PropType, + }, + /** 包裹容器的 tabindex */ + tabindex: { + type: [String, Number] as PropType, + }, + /** 滚动条滑块的最小尺寸(px) */ + thumbMinSize: { + type: Number, + default: 20, + }, + /** 视图(内容区)的自定义类名 */ + viewClass: { + type: String, + default: '', + }, + /** 滚动条的显示形式 */ + visibility: { + type: String as PropType, + default: 'hover' as TdScrollbarProps['visibility'], + validator(val: TdScrollbarProps['visibility']): boolean { + if (!val) return true; + return ['always', 'hover', 'hide'].includes(val); + }, + }, + /** 包裹容器的自定义类名 */ + wrapClass: { + type: String, + default: '', + }, + /** 滚动时触发 */ + onScroll: Function as PropType, +}; diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md new file mode 100644 index 000000000..d5c13a0fd --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md @@ -0,0 +1,36 @@ +:: BASE_DOC :: + +## API + +### Scrollbar Props + +name | type | default | description | required +-- | -- | -- | -- | -- +ariaLabel | String | - | aria-label text in view layer | N +autoExpand | Boolean | true | Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)? | N +container | Object | - | Set the maximum height/width of the scrolling container.。Typescript: `ScrollbarContainerProps` | N +disabled | Boolean | false | disabled scroll | N +id | String | - | ID of the view layer | N +noResize | Boolean | false | Does the container size respond to changes? (If the container size is constant, enabling this feature can optimize performance.) | N +role | String | scrollbar | WAI-ARIA role in the view layer | N +step | Object | - | Rolling step。Typescript: `{x?:number;y?:number}` | N +tabindex | String / Number | - | tabindex of the container | N +thumbMinSize | Number | 20 | Minimum size (px) of the scroll bar slider. | N +viewClass | String | - | Custom class name for the view (content area) | N +visibility | String | hover | Scroll bar display format。options: always/hover/hide | N +wrapClass | String | - | Custom class name of the wrapper container | N +onScroll | Function | | Typescript: `(context:{e:Event}) => void`
Triggered while scrolling | N + +### Scrollbar Events + +name | params | description +-- | -- | -- +scroll | `(context:{e:Event})` | Triggered while scrolling + +### ScrollbarInstanceFunctions 组件实例方法 + +name | params | return | description +-- | -- | -- | -- +getValues | \- | `PositionValues ` | required。Get the view object containing complete scrolling information。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | required。Scroll to a specific set of coordinates。Typescript: `ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | required。Scroll to one side。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md new file mode 100644 index 000000000..cb19bbb70 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md @@ -0,0 +1,36 @@ +:: BASE_DOC :: + +## API + +### Scrollbar Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +ariaLabel | String | - | 视图层的 aria-label 文本 | N +autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N +container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N +disabled | Boolean | false | 禁止滚动 | N +id | String | - | 视图层的 ID | N +noResize | Boolean | false | 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) | N +role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N +step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N +tabindex | String / Number | - | 包裹容器的 tabindex | N +thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N +viewClass | String | - | 视图(内容区)的自定义类名 | N +visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N +wrapClass | String | - | 包裹容器的自定义类名 | N +onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N + +### Scrollbar Events + +名称 | 参数 | 描述 +-- | -- | -- +scroll | `(context:{e:Event})` | 滚动时触发 + +### ScrollbarInstanceFunctions 组件实例方法 + +名称 | 参数 | 返回值 | 描述 +-- | -- | -- | -- +getValues | \- | `PositionValues ` | 必需。获取包含完整滚动信息的视图对象。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | 必需。滚动到一组特定坐标。TS 类型:`ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | 必需。滚动到某一边。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts b/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts new file mode 100644 index 000000000..bab94ddd7 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts @@ -0,0 +1,108 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +export interface TdScrollbarProps { + /** + * 视图层的 aria-label 文本 + * @default '' + */ + ariaLabel?: string; + /** + * 滚动条 hover 时是否向外扩展(增加交互热区) + * @default true + */ + autoExpand?: boolean; + /** + * 设置滚动容器的最大高度/宽度 + */ + container?: ScrollbarContainerProps; + /** + * 禁止滚动 + * @default false + */ + disabled?: boolean; + /** + * 视图层的 ID + * @default '' + */ + id?: string; + /** + * 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) + * @default false + */ + noResize?: boolean; + /** + * 视图层的 WAI-ARIA 角色 + * @default scrollbar + */ + role?: string; + /** + * 滚动步长 + */ + step?: { x?: number; y?: number }; + /** + * 包裹容器的 tabindex + */ + tabindex?: string | number; + /** + * 滚动条滑块的最小尺寸(px) + * @default 20 + */ + thumbMinSize?: number; + /** + * 视图(内容区)的自定义类名 + * @default '' + */ + viewClass?: string; + /** + * 滚动条的显示形式 + * @default hover + */ + visibility?: 'always' | 'hover' | 'hide'; + /** + * 包裹容器的自定义类名 + * @default '' + */ + wrapClass?: string; + /** + * 滚动时触发 + */ + onScroll?: (context: { e: Event }) => void; +} + +/** 组件实例方法 */ +export interface ScrollbarInstanceFunctions { + /** + * 获取包含完整滚动信息的视图对象 + */ + getValues: () => PositionValues; + /** + * 滚动到一组特定坐标 + */ + scrollTo: (options: { top?: number; left?: number; behavior?: ScrollBehavior }) => void; + /** + * 滚动到某一边 + */ + scrollToEdge: (position: PositionEdge) => void; +} + +export interface PositionValues { + left: number; + top: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; + scrollHeight: number; + clientWidth: number; + clientHeight: number; +} + +export type ScrollToFn = { + (x: number, y: number): void; + (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; +}; + +export type PositionEdge = 'left' | 'right' | 'top' | 'bottom'; diff --git a/packages/products/tdesign-vue/src/scrollbar/props.ts b/packages/products/tdesign-vue/src/scrollbar/props.ts new file mode 100644 index 000000000..363ce51aa --- /dev/null +++ b/packages/products/tdesign-vue/src/scrollbar/props.ts @@ -0,0 +1,73 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdScrollbarProps } from './type'; +import { PropType } from 'vue'; + +export default { + /** 视图层的 aria-label 文本 */ + ariaLabel: { + type: String, + default: '', + }, + /** 滚动条 hover 时是否向外扩展(增加交互热区) */ + autoExpand: { + type: Boolean, + default: true, + }, + /** 设置滚动容器的最大高度/宽度 */ + container: { + type: Object as PropType, + }, + /** 禁止滚动 */ + disabled: Boolean, + /** 视图层的 ID */ + id: { + type: String, + default: '', + }, + /** 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) */ + noResize: Boolean, + /** 视图层的 WAI-ARIA 角色 */ + role: { + type: String, + default: 'scrollbar', + }, + /** 滚动步长 */ + step: { + type: Object as PropType, + }, + /** 包裹容器的 tabindex */ + tabindex: { + type: [String, Number] as PropType, + }, + /** 滚动条滑块的最小尺寸(px) */ + thumbMinSize: { + type: Number, + default: 20, + }, + /** 视图(内容区)的自定义类名 */ + viewClass: { + type: String, + default: '', + }, + /** 滚动条的显示形式 */ + visibility: { + type: String as PropType, + default: 'hover' as TdScrollbarProps['visibility'], + validator(val: TdScrollbarProps['visibility']): boolean { + if (!val) return true; + return ['always', 'hover', 'hide'].includes(val); + }, + }, + /** 包裹容器的自定义类名 */ + wrapClass: { + type: String, + default: '', + }, + /** 滚动时触发 */ + onScroll: Function as PropType, +}; diff --git a/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md new file mode 100644 index 000000000..10368ab88 --- /dev/null +++ b/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md @@ -0,0 +1,36 @@ +:: BASE_DOC :: + +## API + +### Scrollbar Props + +name | type | default | description | required +-- | -- | -- | -- | -- +ariaLabel | String | - | aria-label text in view layer | N +autoExpand | Boolean | true | Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)? | N +container | Object | - | Set the maximum height/width of the scrolling container.。Typescript: `ScrollbarContainerProps` | N +disabled | Boolean | false | disabled scroll | N +id | String | - | ID of the view layer | N +noResize | Boolean | false | Does the container size respond to changes? (If the container size is constant, enabling this feature can optimize performance.) | N +role | String | scrollbar | WAI-ARIA role in the view layer | N +step | Object | - | Rolling step。Typescript: `{x?:number;y?:number}` | N +tabindex | String / Number | - | tabindex of the container | N +thumbMinSize | Number | 20 | Minimum size (px) of the scroll bar slider. | N +viewClass | String | - | Custom class name for the view (content area) | N +visibility | String | hover | Scroll bar display format。options: always/hover/hide | N +wrapClass | String | - | Custom class name of the wrapper container | N +onScroll | Function | | Typescript: `(context:{e:Event}) => void`
Triggered while scrolling | N + +### Scrollbar Events + +name | params | description +-- | -- | -- +scroll | `(context:{e:Event})` | Triggered while scrolling + +### ScrollbarInstanceFunctions 组件实例方法 + +name | params | return | description +-- | -- | -- | -- +getValues | \- | `PositionValues ` | required。Get the view object containing complete scrolling information。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | required。Scroll to a specific set of coordinates。Typescript: `ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | required。Scroll to one side。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue/src/scrollbar/scrollbar.md b/packages/products/tdesign-vue/src/scrollbar/scrollbar.md new file mode 100644 index 000000000..353d5ad2b --- /dev/null +++ b/packages/products/tdesign-vue/src/scrollbar/scrollbar.md @@ -0,0 +1,36 @@ +:: BASE_DOC :: + +## API + +### Scrollbar Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +ariaLabel | String | - | 视图层的 aria-label 文本 | N +autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N +container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N +disabled | Boolean | false | 禁止滚动 | N +id | String | - | 视图层的 ID | N +noResize | Boolean | false | 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) | N +role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N +step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N +tabindex | String / Number | - | 包裹容器的 tabindex | N +thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N +viewClass | String | - | 视图(内容区)的自定义类名 | N +visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N +wrapClass | String | - | 包裹容器的自定义类名 | N +onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N + +### Scrollbar Events + +名称 | 参数 | 描述 +-- | -- | -- +scroll | `(context:{e:Event})` | 滚动时触发 + +### ScrollbarInstanceFunctions 组件实例方法 + +名称 | 参数 | 返回值 | 描述 +-- | -- | -- | -- +getValues | \- | `PositionValues ` | 必需。获取包含完整滚动信息的视图对象。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
+scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | 必需。滚动到一组特定坐标。TS 类型:`ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts) +scrollToEdge | `(position:PositionEdge) ` | \- | 必需。滚动到某一边。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue/src/scrollbar/type.ts b/packages/products/tdesign-vue/src/scrollbar/type.ts new file mode 100644 index 000000000..bab94ddd7 --- /dev/null +++ b/packages/products/tdesign-vue/src/scrollbar/type.ts @@ -0,0 +1,108 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +export interface TdScrollbarProps { + /** + * 视图层的 aria-label 文本 + * @default '' + */ + ariaLabel?: string; + /** + * 滚动条 hover 时是否向外扩展(增加交互热区) + * @default true + */ + autoExpand?: boolean; + /** + * 设置滚动容器的最大高度/宽度 + */ + container?: ScrollbarContainerProps; + /** + * 禁止滚动 + * @default false + */ + disabled?: boolean; + /** + * 视图层的 ID + * @default '' + */ + id?: string; + /** + * 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) + * @default false + */ + noResize?: boolean; + /** + * 视图层的 WAI-ARIA 角色 + * @default scrollbar + */ + role?: string; + /** + * 滚动步长 + */ + step?: { x?: number; y?: number }; + /** + * 包裹容器的 tabindex + */ + tabindex?: string | number; + /** + * 滚动条滑块的最小尺寸(px) + * @default 20 + */ + thumbMinSize?: number; + /** + * 视图(内容区)的自定义类名 + * @default '' + */ + viewClass?: string; + /** + * 滚动条的显示形式 + * @default hover + */ + visibility?: 'always' | 'hover' | 'hide'; + /** + * 包裹容器的自定义类名 + * @default '' + */ + wrapClass?: string; + /** + * 滚动时触发 + */ + onScroll?: (context: { e: Event }) => void; +} + +/** 组件实例方法 */ +export interface ScrollbarInstanceFunctions { + /** + * 获取包含完整滚动信息的视图对象 + */ + getValues: () => PositionValues; + /** + * 滚动到一组特定坐标 + */ + scrollTo: (options: { top?: number; left?: number; behavior?: ScrollBehavior }) => void; + /** + * 滚动到某一边 + */ + scrollToEdge: (position: PositionEdge) => void; +} + +export interface PositionValues { + left: number; + top: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; + scrollHeight: number; + clientWidth: number; + clientHeight: number; +} + +export type ScrollToFn = { + (x: number, y: number): void; + (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; +}; + +export type PositionEdge = 'left' | 'right' | 'top' | 'bottom'; diff --git a/packages/scripts/api.json b/packages/scripts/api.json index bb0551ec5..9e58cfebd 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -109894,6 +109894,870 @@ ], "field_type_text": [] }, + { + "id": 1785643138, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "ariaLabel", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "视图层的 aria-label 文本", + "field_desc_en": "aria-label text in view layer", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:58:58", + "update_time": "2026-08-02 03:58:58", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642956, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "autoExpand", + "field_type": [ + "4" + ], + "field_default_value": "true", + "field_enum": "", + "field_desc_zh": "滚动条 hover 时是否向外扩展(增加交互热区)", + "field_desc_en": "Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)?", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:55:56", + "update_time": "2026-08-02 03:55:56", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "Boolean" + ] + }, + { + "id": 1785642550, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "container", + "field_type": [ + "8" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "设置滚动容器的最大高度/宽度", + "field_desc_en": "Set the maximum height/width of the scrolling container.", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:49:10", + "update_time": "2026-08-02 03:49:10", + "event_output": null, + "custom_field_type": "ScrollbarContainerProps", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "Object" + ] + }, + { + "id": 1785642610, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "disabled", + "field_type": [ + "4" + ], + "field_default_value": "false", + "field_enum": "", + "field_desc_zh": "禁止滚动", + "field_desc_en": "disabled scroll", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:50:10", + "update_time": "2026-08-02 03:50:10", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "Boolean" + ] + }, + { + "id": 1785643082, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "id", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "视图层的 ID", + "field_desc_en": "ID of the view layer", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:58:02", + "update_time": "2026-08-02 03:58:02", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642246, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "noResize", + "field_type": [ + "4" + ], + "field_default_value": "false", + "field_enum": "", + "field_desc_zh": "容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能)", + "field_desc_en": "Does the container size respond to changes? (If the container size is constant, enabling this feature can optimize performance.)", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:44:06", + "update_time": "2026-08-02 03:44:06", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "Boolean" + ] + }, + { + "id": 1785643111, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "role", + "field_type": [ + "1" + ], + "field_default_value": "scrollbar", + "field_enum": "", + "field_desc_zh": "视图层的 WAI-ARIA 角色", + "field_desc_en": "WAI-ARIA role in the view layer", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:58:31", + "update_time": "2026-08-02 03:58:31", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642680, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "step", + "field_type": [ + "8" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "滚动步长", + "field_desc_en": "Rolling step", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:51:20", + "update_time": "2026-08-02 03:51:20", + "event_output": null, + "custom_field_type": "{x?:number;y?:number}", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "Object" + ] + }, + { + "id": 1785643171, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "tabindex", + "field_type": [ + "1", + "2" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "包裹容器的 tabindex", + "field_desc_en": "tabindex of the container", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:59:31", + "update_time": "2026-08-02 03:59:31", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "String", + "Number" + ] + }, + { + "id": 1785642391, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "thumbMinSize", + "field_type": [ + "2" + ], + "field_default_value": "20", + "field_enum": "", + "field_desc_zh": "滚动条滑块的最小尺寸(px)", + "field_desc_en": "Minimum size (px) of the scroll bar slider.", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:46:31", + "update_time": "2026-08-02 03:46:31", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "Number" + ] + }, + { + "id": 1785642840, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "viewClass", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "视图(内容区)的自定义类名", + "field_desc_en": "Custom class name for the view (content area)", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:54:00", + "update_time": "2026-08-02 03:54:00", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642898, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "visibility", + "field_type": [ + "1" + ], + "field_default_value": "hover", + "field_enum": "always/hover/hide", + "field_desc_zh": "滚动条的显示形式", + "field_desc_en": "Scroll bar display format", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:54:58", + "update_time": "2026-08-02 03:54:58", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642797, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 1, + "field_name": "wrapClass", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "包裹容器的自定义类名", + "field_desc_en": "Custom class name of the wrapper container", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:53:17", + "update_time": "2026-08-02 03:53:17", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785643580, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 2, + "field_name": "scroll", + "field_type": [ + "1", + "2" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "滚动时触发", + "field_desc_en": "Triggered while scrolling", + "field_required": 0, + "event_input": "(context:{e:Event})", + "create_time": "2026-08-02 04:06:20", + "update_time": "2026-08-02 04:06:20", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "String", + "Number" + ] + }, + { + "id": 1785647487, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 4, + "field_name": "getValues", + "field_type": [ + "1", + "2" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "获取包含完整滚动信息的视图对象", + "field_desc_en": "Get the view object containing complete scrolling information", + "field_required": 1, + "event_input": "", + "create_time": "2026-08-02 05:11:28", + "update_time": "2026-08-02 05:11:28", + "event_output": "PositionValues 【 interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }】", + "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": "Functions", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String", + "Number" + ] + }, + { + "id": 1785646744, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 4, + "field_name": "scrollTo", + "field_type": [ + "32" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "滚动到一组特定坐标", + "field_desc_en": "Scroll to a specific set of coordinates", + "field_required": 1, + "event_input": "(options: { top?: number; left?: number; behavior?: ScrollBehavior })", + "create_time": "2026-08-02 04:59:04", + "update_time": "2026-08-02 04:59:04", + "event_output": "", + "custom_field_type": "ScrollToFn【type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }】", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Functions", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Function" + ] + }, + { + "id": 1785646985, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 4, + "field_name": "scrollToEdge", + "field_type": [ + "32" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "滚动到某一边", + "field_desc_en": "Scroll to one side", + "field_required": 1, + "event_input": "(position:PositionEdge) 【type PositionEdge = \"left\"|\"right\"|\"top\"|\"bottom\"】", + "create_time": "2026-08-02 05:03:05", + "update_time": "2026-08-02 05:03:05", + "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": "Functions", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Function" + ] + }, + { + "id": 1785642818, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 256, + "field_name": "viewStyle", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "视图(内容区)的自定义内联样式", + "field_desc_en": "Custom inline styles for view (content area)", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:53:38", + "update_time": "2026-08-02 03:53:38", + "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": "CSS Variables", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785642756, + "platform_framework": [ + "1", + "2" + ], + "component": "Scrollbar", + "field_category": 256, + "field_name": "wrapStyle", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "包裹容器的自定义内联样式", + "field_desc_en": "Custom inline styles for wrapping containers", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 03:52:36", + "update_time": "2026-08-02 03:52:36", + "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": "CSS Variables", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785650133, + "platform_framework": [ + "1", + "2" + ], + "component": "ScrollbarValues", + "field_category": 1, + "field_name": "PositionEdge", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "left/right/top/bottom", + "field_desc_zh": "滚动到某一边", + "field_desc_en": "Scroll to one side", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 05:55:33", + "update_time": "2026-08-02 05:55:33", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785650340, + "platform_framework": [ + "1", + "2" + ], + "component": "ScrollbarValues", + "field_category": 1, + "field_name": "PositionEdge", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "left/right/top/bottom", + "field_desc_zh": "滚动到某一边", + "field_desc_en": "Scroll to one side", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 05:59:00", + "update_time": "2026-08-02 05:59:00", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, + { + "id": 1785650036, + "platform_framework": [ + "1", + "2" + ], + "component": "ScrollbarValues", + "field_category": 1, + "field_name": "PositionValues", + "field_type": [ + "8" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "获取包含完整滚动信息的视图对象", + "field_desc_en": "Get the view object containing complete scrolling information", + "field_required": 0, + "event_input": "", + "create_time": "2026-08-02 05:53:56", + "update_time": "2026-08-02 05:53:56", + "event_output": null, + "custom_field_type": "{left: (scrollLeft / (scrollWidth - clientWidth)) || 0,top: (scrollTop / (scrollHeight - clientHeight)) || 0,scrollLeft,scrollTop,scrollWidth,scrollHeight,clientWidth, clientHeight}", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "Object" + ] + }, { "id": 1542, "platform_framework": [ diff --git a/packages/scripts/map.json b/packages/scripts/map.json index 70eabcf1d..368821b5c 100644 --- a/packages/scripts/map.json +++ b/packages/scripts/map.json @@ -877,6 +877,10 @@ "value": "Row", "label": "栅格-横向" }, + { + "value": "Scrollbar", + "label": "滚动条" + }, { "value": "Search", "label": "搜索" diff --git a/packages/server/controllers/ComponentApi/const.ts b/packages/server/controllers/ComponentApi/const.ts index df0d48d17..ee10f4c9a 100644 --- a/packages/server/controllers/ComponentApi/const.ts +++ b/packages/server/controllers/ComponentApi/const.ts @@ -368,6 +368,7 @@ export const COMPONENTS_PC: Array = [ { value: 'AutoCompleteConfig', label: '自动填充全局配置', type: 'TS' }, { value: 'QRCode', label: '二维码' }, { value: 'QRCodeConfig', label: '二维码全局配置', type: 'TS' }, + { value: 'Scrollbar', label: '滚动条' }, ].sort((a, b) => a.value.localeCompare(b.value)); export const COMPONENTS_MOBILE: Array = [ From ab72c19a069c8c8d959da5a485f0914cf1d488ab Mon Sep 17 00:00:00 2001 From: liweijie <674416404@qq.com> Date: Mon, 14 Sep 2026 15:16:57 +0800 Subject: [PATCH 2/6] =?UTF-8?q?chore(scripts):=20=E5=B0=86=20event=5Foutpu?= =?UTF-8?q?t=20=E7=A9=BA=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=94=B9=E4=B8=BA=20nu?= =?UTF-8?q?ll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/scripts/api.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 790013042..06f47629b 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -110855,7 +110855,7 @@ "event_input": "(options: { top?: number; left?: number; behavior?: ScrollBehavior })", "create_time": "2026-08-02 04:59:04", "update_time": "2026-08-02 04:59:04", - "event_output": "", + "event_output": null, "custom_field_type": "ScrollToFn【type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }】", "syntactic_sugar": null, "readonly": 1, From a9b5cf150e8adc6e0c0ba3deb02bf9adc2ae598e Mon Sep 17 00:00:00 2001 From: liweijie <674416404@qq.com> Date: Mon, 21 Sep 2026 14:09:05 +0800 Subject: [PATCH 3/6] =?UTF-8?q?chore(api):=20=E6=9B=B4=E6=96=B0=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=20API=20=E5=85=83=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/scripts/api.json | 1537 ++++++++++++++----------------------- 1 file changed, 564 insertions(+), 973 deletions(-) diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 1dacca31b..06f47629b 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -15237,45 +15237,6 @@ "TNode" ] }, - { - "id": 1789893952, - "platform_framework": [ - "1", - "2" - ], - "component": "Button", - "field_category": 1, - "field_name": "content", - "field_type": [ - "64" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "分割面板的内容节点,必须意思SplitPanel", - "field_desc_en": "split's children elements", - "field_required": 0, - "event_input": "", - "create_time": "2026-09-20 08:45:52", - "update_time": "2026-09-20 08:45:52", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "TNode" - ] - }, { "id": 2412, "platform_framework": [ @@ -22941,6 +22902,43 @@ "Boolean" ] }, + { + "id": 3538, + "platform_framework": [ + "16" + ], + "component": "Cascader", + "field_category": 1, + "field_name": "lazy", + "field_type": [ + "4" + ], + "field_default_value": "false", + "field_enum": "", + "field_desc_zh": "是否异步加载", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2023-06-20 17:43:02", + "update_time": "2023-06-20 17:43:02", + "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)" + ], + "field_type_text": [ + "Boolean" + ] + }, { "id": 394, "platform_framework": [ @@ -23545,7 +23543,6 @@ { "id": 1712024363, "platform_framework": [ - "8", "16", "64", "128" @@ -23576,7 +23573,6 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)", "React(Mobile)", "Miniprogram", "UniApp" @@ -23585,6 +23581,45 @@ "String" ] }, + { + "id": 1712578657, + "platform_framework": [ + "8" + ], + "component": "Cascader", + "field_category": 1, + "field_name": "placeholder", + "field_type": [ + "1", + "64" + ], + "field_default_value": "'选择选项'", + "field_enum": "", + "field_desc_zh": "未选中时的提示文案", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2024-04-08 12:17:37", + "update_time": "2024-04-08 12:17:37", + "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": [ + "String", + "TNode" + ] + }, { "id": 398, "platform_framework": [ @@ -34307,7 +34342,7 @@ "create_time": "2021-08-06 05:48:42", "update_time": "2021-08-10 05:28:54", "event_output": null, - "custom_field_type": "CheckboxIconType【type CheckboxIconType = 'circle' | 'line' | 'rectangle' | boolean | Array;】", + "custom_field_type": "CheckboxIconType【type CheckboxIconType = 'circle' | 'line' | 'rectangle' | string[];】", "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, @@ -53001,7 +53036,9 @@ "id": 1760451356, "platform_framework": [ "1", - "2" + "2", + "8", + "16" ], "component": "Divider", "field_category": 1, @@ -53031,7 +53068,9 @@ "field_category_text": "Props", "platform_framework_text": [ "Vue(PC)", - "React(PC)" + "React(PC)", + "Vue(Mobile)", + "React(Mobile)" ], "field_type_text": [ "String", @@ -68436,8 +68475,7 @@ "id": 2970, "platform_framework": [ "1", - "2", - "16" + "2" ], "component": "Guide", "field_category": 1, @@ -68466,8 +68504,7 @@ "field_category_text": "Props", "platform_framework_text": [ "Vue(PC)", - "React(PC)", - "React(Mobile)" + "React(PC)" ], "field_type_text": [ "TNode" @@ -70224,7 +70261,6 @@ "id": 1708481323, "platform_framework": [ "8", - "16", "64", "128" ], @@ -70255,7 +70291,6 @@ "field_category_text": "Props", "platform_framework_text": [ "Vue(Mobile)", - "React(Mobile)", "Miniprogram", "UniApp" ], @@ -70268,8 +70303,7 @@ "platform_framework": [ "1", "2", - "8", - "16" + "8" ], "component": "GuideStep", "field_category": 1, @@ -70300,8 +70334,7 @@ "platform_framework_text": [ "Vue(PC)", "React(PC)", - "Vue(Mobile)", - "React(Mobile)" + "Vue(Mobile)" ], "field_type_text": [ "String", @@ -70350,8 +70383,7 @@ { "id": 2953, "platform_framework": [ - "2", - "16" + "2" ], "component": "GuideStep", "field_category": 1, @@ -70380,8 +70412,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "React(PC)", - "React(Mobile)" + "React(PC)" ], "field_type_text": [ "String", @@ -70393,8 +70424,7 @@ "platform_framework": [ "1", "2", - "8", - "16" + "8" ], "component": "GuideStep", "field_category": 1, @@ -70424,8 +70454,7 @@ "platform_framework_text": [ "Vue(PC)", "React(PC)", - "Vue(Mobile)", - "React(Mobile)" + "Vue(Mobile)" ], "field_type_text": [ "TNode" @@ -70436,8 +70465,7 @@ "platform_framework": [ "1", "2", - "8", - "16" + "8" ], "component": "GuideStep", "field_category": 1, @@ -70468,8 +70496,7 @@ "platform_framework_text": [ "Vue(PC)", "React(PC)", - "Vue(Mobile)", - "React(Mobile)" + "Vue(Mobile)" ], "field_type_text": [ "String", @@ -70518,7 +70545,6 @@ { "id": 1721621588, "platform_framework": [ - "16", "64", "128" ], @@ -70548,7 +70574,6 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "React(Mobile)", "Miniprogram", "UniApp" ], @@ -70598,8 +70623,7 @@ { "id": 1709178118, "platform_framework": [ - "8", - "16" + "8" ], "component": "GuideStep", "field_category": 1, @@ -70627,8 +70651,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)", - "React(Mobile)" + "Vue(Mobile)" ], "field_type_text": [ "TNode" @@ -70639,8 +70662,7 @@ "platform_framework": [ "1", "2", - "8", - "16" + "8" ], "component": "GuideStep", "field_category": 1, @@ -70670,8 +70692,7 @@ "platform_framework_text": [ "Vue(PC)", "React(PC)", - "Vue(Mobile)", - "React(Mobile)" + "Vue(Mobile)" ], "field_type_text": [ "Number" @@ -70759,7 +70780,6 @@ "id": 1709178151, "platform_framework": [ "8", - "16", "64", "128" ], @@ -70790,7 +70810,6 @@ "field_category_text": "Props", "platform_framework_text": [ "Vue(Mobile)", - "React(Mobile)", "Miniprogram", "UniApp" ], @@ -70804,7 +70823,6 @@ "1", "2", "8", - "16", "64", "128" ], @@ -70837,7 +70855,6 @@ "Vue(PC)", "React(PC)", "Vue(Mobile)", - "React(Mobile)", "Miniprogram", "UniApp" ], @@ -70850,8 +70867,7 @@ "platform_framework": [ "1", "2", - "8", - "16" + "8" ], "component": "GuideStep", "field_category": 1, @@ -70881,8 +70897,7 @@ "platform_framework_text": [ "Vue(PC)", "React(PC)", - "Vue(Mobile)", - "React(Mobile)" + "Vue(Mobile)" ], "field_type_text": [ "Array" @@ -70970,7 +70985,6 @@ "id": 1709197181, "platform_framework": [ "8", - "16", "64", "128" ], @@ -71001,7 +71015,6 @@ "field_category_text": "Props", "platform_framework_text": [ "Vue(Mobile)", - "React(Mobile)", "Miniprogram", "UniApp" ], @@ -71012,8 +71025,7 @@ { "id": 1709178092, "platform_framework": [ - "8", - "16" + "8" ], "component": "GuideStep", "field_category": 1, @@ -71041,8 +71053,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)", - "React(Mobile)" + "Vue(Mobile)" ], "field_type_text": [ "Object" @@ -71132,7 +71143,6 @@ "1", "2", "8", - "16", "64", "128" ], @@ -71165,7 +71175,6 @@ "Vue(PC)", "React(PC)", "Vue(Mobile)", - "React(Mobile)", "Miniprogram", "UniApp" ], @@ -71179,7 +71188,6 @@ "1", "2", "8", - "16", "64", "128" ], @@ -71212,7 +71220,6 @@ "Vue(PC)", "React(PC)", "Vue(Mobile)", - "React(Mobile)", "Miniprogram", "UniApp" ], @@ -71264,8 +71271,7 @@ "platform_framework": [ "1", "2", - "8", - "16" + "8" ], "component": "GuideStep", "field_category": 1, @@ -71296,8 +71302,7 @@ "platform_framework_text": [ "Vue(PC)", "React(PC)", - "Vue(Mobile)", - "React(Mobile)" + "Vue(Mobile)" ], "field_type_text": [ "String", @@ -74273,7 +74278,7 @@ "html_attribute": 0, "trigger_elements": "", "deprecated": 0, - "version": "{ \"Vue(Mobile)\": \"1.12.0\" }", + "version": "{ \"Vue(Mobile)\": \"1.12.0\", \"React(Mobile)\": \"0.21.1\" }", "test_description": null, "support_default_value": 0, "field_category_text": "Props", @@ -77580,6 +77585,7 @@ { "id": 1710, "platform_framework": [ + "16", "64", "128" ], @@ -77609,6 +77615,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "React(Mobile)", "Miniprogram", "UniApp" ], @@ -78892,6 +78899,7 @@ { "id": 1713, "platform_framework": [ + "16", "64", "128" ], @@ -78921,6 +78929,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "React(Mobile)", "Miniprogram", "UniApp" ], @@ -87674,6 +87683,43 @@ ], "field_type_text": [] }, + { + "id": 1981, + "platform_framework": [ + "16" + ], + "component": "Message", + "field_category": 2, + "field_name": "change", + "field_type": [ + "32" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "可见性变化时触发", + "field_desc_en": null, + "field_required": 0, + "event_input": "(visible: boolean)", + "create_time": "2021-11-28 10:47:20", + "update_time": "2022-07-05 07:06:08", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 1, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Events", + "platform_framework_text": [ + "React(Mobile)" + ], + "field_type_text": [ + "Function" + ] + }, { "id": 3016, "platform_framework": [ @@ -87709,6 +87755,45 @@ ], "field_type_text": [] }, + { + "id": 3437, + "platform_framework": [ + "16" + ], + "component": "Message", + "field_category": 2, + "field_name": "close", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "关闭消息时触发", + "field_desc_en": "close message event", + "field_required": 0, + "event_input": "(context: { trigger: 'close-click' | 'duration-end', e?: MouseEvent })", + "create_time": "2023-03-28 07:15:58", + "update_time": "2023-03-28 07:15:58", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 1, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Events", + "platform_framework_text": [ + "React(Mobile)" + ], + "field_type_text": [ + "String", + "TNode" + ] + }, { "id": 103, "platform_framework": [ @@ -87752,6 +87837,43 @@ ], "field_type_text": [] }, + { + "id": 1984, + "platform_framework": [ + "16" + ], + "component": "Message", + "field_category": 2, + "field_name": "closed", + "field_type": [ + "32" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "关闭消息并且动画结束后触发", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2021-11-28 10:51:22", + "update_time": "2021-11-28 10:51:44", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 1, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Events", + "platform_framework_text": [ + "React(Mobile)" + ], + "field_type_text": [ + "Function" + ] + }, { "id": 104, "platform_framework": [ @@ -87834,6 +87956,80 @@ ], "field_type_text": [] }, + { + "id": 1982, + "platform_framework": [ + "16" + ], + "component": "Message", + "field_category": 2, + "field_name": "open", + "field_type": [ + "32" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "展示Message时触发", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2021-11-28 10:49:12", + "update_time": "2021-11-28 10:50:15", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 1, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Events", + "platform_framework_text": [ + "React(Mobile)" + ], + "field_type_text": [ + "Function" + ] + }, + { + "id": 1983, + "platform_framework": [ + "16" + ], + "component": "Message", + "field_category": 2, + "field_name": "opened", + "field_type": [ + "32" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "展示Message时并且动画结束后触发", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2021-11-28 10:50:50", + "update_time": "2021-11-28 10:51:51", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 1, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Events", + "platform_framework_text": [ + "React(Mobile)" + ], + "field_type_text": [ + "Function" + ] + }, { "id": 1712057171, "platform_framework": [ @@ -88536,6 +88732,7 @@ { "id": 1624, "platform_framework": [ + "16", "64", "128" ], @@ -88565,6 +88762,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "React(Mobile)", "Miniprogram", "UniApp" ], @@ -90129,7 +90327,6 @@ "id": 1712057349, "platform_framework": [ "8", - "16", "64", "128" ], @@ -90160,7 +90357,6 @@ "field_category_text": "Props", "platform_framework_text": [ "Vue(Mobile)", - "React(Mobile)", "Miniprogram", "UniApp" ], @@ -94351,7 +94547,7 @@ "create_time": "2022-06-21 09:12:37", "update_time": "2022-06-24 06:22:10", "event_output": null, - "custom_field_type": "PickerColumn | Array | ((item: Array) => Array)【type PickerColumn = PickerColumnItem[]】【interface PickerColumnItem { label: string,value: string,disabled?: boolean}】", + "custom_field_type": "PickerColumn | Array | ((item: Array) => Array)【type PickerColumn = PickerColumnItem[]】【interface PickerColumnItem { label: string,value: string,disabled?: boolean}】", "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, @@ -94700,7 +94896,7 @@ "field_category": 1, "field_name": "option", "field_type": [ - "32" + "64" ], "field_default_value": "", "field_enum": "", @@ -94726,7 +94922,7 @@ "React(Mobile)" ], "field_type_text": [ - "Function" + "TNode" ] }, { @@ -95015,6 +95211,7 @@ { "id": 1471, "platform_framework": [ + "16", "64" ], "component": "Picker", @@ -95043,6 +95240,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "React(Mobile)", "Miniprogram" ], "field_type_text": [ @@ -95128,8 +95326,7 @@ { "id": 1773297544, "platform_framework": [ - "8", - "16" + "8" ], "component": "Picker", "field_category": 1, @@ -95146,7 +95343,7 @@ "create_time": "2026-03-12 06:39:04", "update_time": "2026-03-12 06:39:04", "event_output": null, - "custom_field_type": "PickerWheelConfig【interface PickerWheelConfig { inertiaDuration?: number; bounceDuration?: number; transitionDuration?: number; inertiaTimeThreshold?: number; inertiaDistanceThreshold?: number; boundOffset?: number; clickDistanceThreshold?: number; clickTimeThreshold?: number;}】", + "custom_field_type": "PickerWheelConfig 【interface PickerWheelConfig { inertiaDuration?: number; bounceDuration?: number; transitionDuration?: number; inertiaTimeThreshold?: number; inertiaDistanceThreshold?: number; boundOffset?: number; clickDistanceThreshold?: number; clickTimeThreshold?: number;}】", "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, @@ -95157,8 +95354,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)", - "React(Mobile)" + "Vue(Mobile)" ], "field_type_text": [ "Object" @@ -95551,7 +95747,7 @@ "field_desc_zh": "任何一列选中都会触发,不同的列参数不同。`context.column` 表示第几列变化,`context.index` 表示变化那一列的选中项下标", "field_desc_en": null, "field_required": 0, - "event_input": "(value: Array, context: PickerContext)", + "event_input": "(value: Array,context: PickerContext)", "create_time": "2021-08-23 08:27:06", "update_time": "2022-06-23 07:16:03", "event_output": null, @@ -104274,6 +104470,43 @@ "String" ] }, + { + "id": 1419, + "platform_framework": [ + "16" + ], + "component": "Radio", + "field_category": 1, + "field_name": "align", + "field_type": [ + "1" + ], + "field_default_value": "left", + "field_enum": "left/right", + "field_desc_zh": "已废弃。复选框和内容相对位置", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2021-08-10 05:21:42", + "update_time": "2021-08-10 06:29:39", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": null, + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "React(Mobile)" + ], + "field_type_text": [ + "String" + ] + }, { "id": 2035, "platform_framework": [ @@ -104572,6 +104805,7 @@ { "id": 1418, "platform_framework": [ + "16", "64", "128" ], @@ -104601,6 +104835,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "React(Mobile)", "Miniprogram", "UniApp" ], @@ -104611,8 +104846,7 @@ { "id": 1712656500, "platform_framework": [ - "8", - "16" + "8" ], "component": "Radio", "field_category": 1, @@ -104640,8 +104874,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)", - "React(Mobile)" + "Vue(Mobile)" ], "field_type_text": [ "Boolean" @@ -112141,7 +112374,6 @@ "id": 1712030157, "platform_framework": [ "8", - "16", "64", "128" ], @@ -112172,7 +112404,6 @@ "field_category_text": "Props", "platform_framework_text": [ "Vue(Mobile)", - "React(Mobile)", "Miniprogram", "UniApp" ], @@ -112222,8 +112453,7 @@ { "id": 1733883439, "platform_framework": [ - "8", - "16" + "8" ], "component": "Search", "field_category": 1, @@ -112252,8 +112482,7 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)", - "React(Mobile)" + "Vue(Mobile)" ], "field_type_text": [ "String", @@ -112498,6 +112727,78 @@ "Object" ] }, + { + "id": 1547, + "platform_framework": [], + "component": "Search", + "field_category": 1, + "field_name": "prefixIcon", + "field_type": [ + "1", + "64" + ], + "field_default_value": "'search'", + "field_enum": "", + "field_desc_zh": "已废弃。前置图标,默认为搜索图标。值为 `null` 时则不显示", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2021-09-01 08:17:25", + "update_time": "2022-07-20 14:46:16", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": null, + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [], + "field_type_text": [ + "String", + "TNode" + ] + }, + { + "id": 1835, + "platform_framework": [ + "16" + ], + "component": "Search", + "field_category": 1, + "field_name": "prefixIcon", + "field_type": [ + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "前置图标,默认为搜索图标。值为 `null` 时则不显示", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2021-11-10 05:27:50", + "update_time": "2022-07-20 14:46:02", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 1, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "React(Mobile)" + ], + "field_type_text": [ + "TNode" + ] + }, { "id": 2854, "platform_framework": [ @@ -120987,24 +121288,64 @@ ] }, { - "id": 1789893903, + "id": 3457, "platform_framework": [ + "1", "2" ], - "component": "Split", + "component": "Statistic", "field_category": 1, - "field_name": "children", + "field_name": "animation", "field_type": [ - "64" + "8" ], "field_default_value": "", "field_enum": "", - "field_desc_zh": "分割面板的内容节点,同 content,必须是SplitPanel", - "field_desc_en": "split's children elements", + "field_desc_zh": "动画效果控制,`duration` 指动画的过渡时间`单位:毫秒`,`valueFrom` 指动画的起始数值。`{ duration, valueFrom }`", + "field_desc_en": "Animation effect control, `duration` refers to the transition time of the animation `unit: millisecond`, `valueFrom` refers to the initial value of the animation. `{ duration, valueFrom }`", "field_required": 0, "event_input": "", - "create_time": "2026-09-20 08:45:03", - "update_time": "2026-09-20 08:45:03", + "create_time": "2023-04-20 11:25:15", + "update_time": "2023-04-20 11:25:15", + "event_output": null, + "custom_field_type": "animation【interface animation { duration: number; valueFrom: number; }】", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "Object" + ] + }, + { + "id": 3455, + "platform_framework": [ + "1", + "2" + ], + "component": "Statistic", + "field_category": 1, + "field_name": "animationStart", + "field_type": [ + "4" + ], + "field_default_value": "false", + "field_enum": "", + "field_desc_zh": "是否开始动画", + "field_desc_en": "Whether to start animation", + "field_required": 0, + "event_input": "", + "create_time": "2023-04-20 11:11:10", + "update_time": "2023-04-20 11:11:10", "event_output": null, "custom_field_type": null, "syntactic_sugar": null, @@ -121017,32 +121358,33 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(PC)", "React(PC)" ], "field_type_text": [ - "TNode" + "Boolean" ] }, { - "id": 1785667918, + "id": 3459, "platform_framework": [ "1", "2" ], - "component": "Split", + "component": "Statistic", "field_category": 1, - "field_name": "direction", + "field_name": "color", "field_type": [ "1" ], - "field_default_value": "horizontal", - "field_enum": "horizontal/vertical", - "field_desc_zh": "分割方向。horizontal:左右排列;vertical:上下排列", - "field_desc_en": "Dividing direction. Horizontal: arranged horizontally; Vertical: arranged vertically.", + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "颜色风格,预设五个 TDesign 颜色风格:黑色(black)、蓝色(blue)、红色(red)、橙色(orange)、绿色(green)支持深浅色模式切换。也可以自定义任何 [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) 支持颜色值,深浅色模式切换需自行适配", + "field_desc_en": "The color style can support TDesign's light and dark modes with the following options: black, blue, red, orange, and green. Alternatively, it can be any [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) value, but in this case, TDesign's light and dark modes will not be supported.", "field_required": 0, "event_input": "", - "create_time": "2026-08-02 10:51:58", - "update_time": "2026-08-02 10:51:58", + "create_time": "2023-04-20 11:27:29", + "update_time": "2023-04-20 11:27:29", "event_output": null, "custom_field_type": null, "syntactic_sugar": null, @@ -121063,853 +121405,65 @@ ] }, { - "id": 1785668466, + "id": 3453, + "platform_framework": [ + "1", + "2" + ], + "component": "Statistic", + "field_category": 1, + "field_name": "decimalPlaces", + "field_type": [ + "2" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "小数保留位数", + "field_desc_en": " Decimal places", + "field_required": 0, + "event_input": "", + "create_time": "2023-04-20 11:08:56", + "update_time": "2023-04-20 11:08:56", + "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(PC)", + "React(PC)" + ], + "field_type_text": [ + "Number" + ] + }, + { + "id": 3462, "platform_framework": [ "1", "2" ], - "component": "Split", + "component": "Statistic", "field_category": 1, - "field_name": "draggerIcon", + "field_name": "extra", "field_type": [ "1", "64" ], "field_default_value": "", "field_enum": "", - "field_desc_zh": "拖拽图标", - "field_desc_en": "Drag icons", + "field_desc_zh": "额外的显示内容", + "field_desc_en": " Additional display content", "field_required": 0, "event_input": "", - "create_time": "2026-08-02 11:01:06", - "update_time": "2026-08-02 11:01:06", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "String", - "TNode" - ] - }, - { - "id": 1785667969, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 1, - "field_name": "gap", - "field_type": [ - "2" - ], - "field_default_value": "0", - "field_enum": "", - "field_desc_zh": "面板之间的间距(px),会体现在分割条视觉上", - "field_desc_en": "The spacing (px) between panels will be reflected in the visual appearance of the divider.", - "field_required": 0, - "event_input": "", - "create_time": "2026-08-02 10:52:49", - "update_time": "2026-08-02 10:52:49", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "Number" - ] - }, - { - "id": 1785668424, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 1, - "field_name": "lazy", - "field_type": [ - "4" - ], - "field_default_value": "false", - "field_enum": "", - "field_desc_zh": "延迟渲染模式", - "field_desc_en": "Deferred rendering mode", - "field_required": 0, - "event_input": "", - "create_time": "2026-08-02 11:00:24", - "update_time": "2026-08-02 11:00:24", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "Boolean" - ] - }, - { - "id": 1785668557, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 1, - "field_name": "panelSize", - "field_type": [ - "8" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "定义每个面板的最大最小比例", - "field_desc_en": "Define the maximum and minimum scale for each panel.", - "field_required": 0, - "event_input": "", - "create_time": "2026-08-02 11:02:37", - "update_time": "2026-08-02 11:02:37", - "event_output": null, - "custom_field_type": "{min?: number; max?: number }", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "Object" - ] - }, - { - "id": 1785668156, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 1, - "field_name": "splitterClassName", - "field_type": [ - "1" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "自定义分割条的样式类名", - "field_desc_en": "Custom divider style class name", - "field_required": 0, - "event_input": "", - "create_time": "2026-08-02 10:55:56", - "update_time": "2026-08-02 10:55:56", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "String" - ] - }, - { - "id": 1785668109, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 1, - "field_name": "splitterSize", - "field_type": [ - "2" - ], - "field_default_value": "6", - "field_enum": "", - "field_desc_zh": "分割条的可交互区域宽度/高度(px)", - "field_desc_en": "Width/height (px) of the interactive area of ​​the divider bar", - "field_required": 0, - "event_input": "", - "create_time": "2026-08-02 10:55:09", - "update_time": "2026-08-02 10:55:09", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "Number" - ] - }, - { - "id": 1785668599, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 2, - "field_name": "resize", - "field_type": [ - "8" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "拖拽过程中尺寸变化的回调(像素值数组)", - "field_desc_en": "Callback (array of pixel values) for size changes during dragging.", - "field_required": 0, - "event_input": "(sizes: number[])", - "create_time": "2026-08-02 11:03:19", - "update_time": "2026-08-02 11:03:19", - "event_output": null, - "custom_field_type": "{min?: number max?: number }", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "Object" - ] - }, - { - "id": 1785668746, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 2, - "field_name": "resizeEnd", - "field_type": [ - "8" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "拖拽结束时的回调", - "field_desc_en": "Callback when drag ends", - "field_required": 0, - "event_input": "(sizes: number[])", - "create_time": "2026-08-02 11:05:46", - "update_time": "2026-08-02 11:05:46", - "event_output": null, - "custom_field_type": "{min?: number max?: number }", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "Object" - ] - }, - { - "id": 1785668717, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 2, - "field_name": "resizeStart", - "field_type": [ - "8" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "开始拖拽时的回调", - "field_desc_en": "Callback when drag starts", - "field_required": 0, - "event_input": "(sizes: number[])", - "create_time": "2026-08-02 11:05:17", - "update_time": "2026-08-02 11:05:17", - "event_output": null, - "custom_field_type": "{min?: number max?: number }", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "Object" - ] - }, - { - "id": 1785668792, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 4, - "field_name": "getSizes", - "field_type": [ - "8" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "获取当前各面板的像素尺寸", - "field_desc_en": "Get the current pixel size of each panel", - "field_required": 0, - "event_input": "", - "create_time": "2026-08-02 11:06:32", - "update_time": "2026-08-02 11:06:32", - "event_output": "number[]", - "custom_field_type": "{min?: number max?: number }", - "syntactic_sugar": null, - "readonly": 1, - "html_attribute": 0, - "trigger_elements": "", - "deprecated": 0, - "version": "", - "test_description": null, - "support_default_value": 0, - "field_category_text": "Functions", - "platform_framework_text": [ - "Vue(PC)", - "React(PC)" - ], - "field_type_text": [ - "Object" - ] - }, - { - "id": 1785668892, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 4, - "field_name": "reset", - "field_type": [ - "8" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "重置为初始尺寸", - "field_desc_en": "Reset to initial size", - "field_required": 0, - "event_input": "", - "create_time": "2026-08-02 11:08:12", - "update_time": "2026-08-02 11:08:12", - "event_output": null, - "custom_field_type": "{min?: number max?: number }", - "syntactic_sugar": null, - "readonly": 1, - "html_attribute": 0, - "trigger_elements": "", - "deprecated": 0, - "version": "", - "test_description": null, - "support_default_value": 0, - "field_category_text": "Functions", - "platform_framework_text": [ - "Vue(PC)", - "React(PC)" - ], - "field_type_text": [ - "Object" - ] - }, - { - "id": 1785668850, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 4, - "field_name": "setSizes", - "field_type": [ - "8" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "程序化设置尺寸", - "field_desc_en": "Programmatically set size", - "field_required": 0, - "event_input": "(sizes: (number | string | 'auto')[]) ", - "create_time": "2026-08-02 11:07:30", - "update_time": "2026-08-02 11:07:30", - "event_output": null, - "custom_field_type": "{min?: number max?: number }", - "syntactic_sugar": null, - "readonly": 1, - "html_attribute": 0, - "trigger_elements": "", - "deprecated": 0, - "version": "", - "test_description": null, - "support_default_value": 0, - "field_category_text": "Functions", - "platform_framework_text": [ - "Vue(PC)", - "React(PC)" - ], - "field_type_text": [ - "Object" - ] - }, - { - "id": 1785668191, - "platform_framework": [ - "1", - "2" - ], - "component": "Split", - "field_category": 256, - "field_name": "splitterStyle", - "field_type": [ - "1" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "自定义分割条的内联样式", - "field_desc_en": "Customize the inline style of the splitter", - "field_required": 0, - "event_input": "", - "create_time": "2026-08-02 10:56:31", - "update_time": "2026-08-02 10:56:31", - "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": "CSS Variables", - "platform_framework_text": [ - "Vue(PC)", - "React(PC)" - ], - "field_type_text": [ - "String" - ] - }, - { - "id": 1785669246, - "platform_framework": [ - "1", - "2" - ], - "component": "SplitPanel", - "field_category": 1, - "field_name": "defaultSize", - "field_type": [ - "1", - "2" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "初始面板大小,支持数字 px 或者文字 '百分比%' 类型", - "field_desc_en": "Initial panel size, supports numeric pixels (px) or text percentages (%).", - "field_required": 0, - "event_input": "(sizes: (number | string | 'auto')[]) ", - "create_time": "2026-08-02 11:14:06", - "update_time": "2026-08-02 11:14:06", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "String", - "Number" - ] - }, - { - "id": 1785669101, - "platform_framework": [ - "1", - "2" - ], - "component": "SplitPanel", - "field_category": 1, - "field_name": "max", - "field_type": [ - "1", - "2" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "当前面板的最大尺寸,支持数字 px 或者文字 '百分比%' 类型-继承父级 panelSize.max", - "field_desc_en": "The maximum size of the current panel, supporting numbers in pixels (px) or percentages (%).-Inherited from parent panelSize.max", - "field_required": 0, - "event_input": "(sizes: (number | string | 'auto')[]) ", - "create_time": "2026-08-02 11:11:41", - "update_time": "2026-08-02 11:11:41", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "String", - "Number" - ] - }, - { - "id": 1785669035, - "platform_framework": [ - "1", - "2" - ], - "component": "SplitPanel", - "field_category": 1, - "field_name": "min", - "field_type": [ - "1", - "2" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "当前面板的最小尺寸,支持数字 px 或者文字 '百分比%' 类型-继承父级 panelSize.min", - "field_desc_en": "The minimum size of the current panel, supporting numbers in pixels (px) or percentages (%).-Inherited from parent panelSize.min", - "field_required": 0, - "event_input": "(sizes: (number | string | 'auto')[]) ", - "create_time": "2026-08-02 11:10:35", - "update_time": "2026-08-02 11:10:35", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "String", - "Number" - ] - }, - { - "id": 1785669272, - "platform_framework": [ - "1", - "2" - ], - "component": "SplitPanel", - "field_category": 1, - "field_name": "resizable", - "field_type": [ - "4" - ], - "field_default_value": "true", - "field_enum": "", - "field_desc_zh": "是否开启拖拽伸缩", - "field_desc_en": "Enable drag-and-drop scaling?", - "field_required": 0, - "event_input": "(sizes: (number | string | 'auto')[]) ", - "create_time": "2026-08-02 11:14:32", - "update_time": "2026-08-02 11:14:32", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "Boolean" - ] - }, - { - "id": 3457, - "platform_framework": [ - "1", - "2" - ], - "component": "Statistic", - "field_category": 1, - "field_name": "animation", - "field_type": [ - "8" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "动画效果控制,`duration` 指动画的过渡时间`单位:毫秒`,`valueFrom` 指动画的起始数值。`{ duration, valueFrom }`", - "field_desc_en": "Animation effect control, `duration` refers to the transition time of the animation `unit: millisecond`, `valueFrom` refers to the initial value of the animation. `{ duration, valueFrom }`", - "field_required": 0, - "event_input": "", - "create_time": "2023-04-20 11:25:15", - "update_time": "2023-04-20 11:25:15", - "event_output": null, - "custom_field_type": "animation【interface animation { duration: number; valueFrom: number; }】", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "Object" - ] - }, - { - "id": 3455, - "platform_framework": [ - "1", - "2" - ], - "component": "Statistic", - "field_category": 1, - "field_name": "animationStart", - "field_type": [ - "4" - ], - "field_default_value": "false", - "field_enum": "", - "field_desc_zh": "是否开始动画", - "field_desc_en": "Whether to start animation", - "field_required": 0, - "event_input": "", - "create_time": "2023-04-20 11:11:10", - "update_time": "2023-04-20 11:11:10", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "Boolean" - ] - }, - { - "id": 3459, - "platform_framework": [ - "1", - "2" - ], - "component": "Statistic", - "field_category": 1, - "field_name": "color", - "field_type": [ - "1" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "颜色风格,预设五个 TDesign 颜色风格:黑色(black)、蓝色(blue)、红色(red)、橙色(orange)、绿色(green)支持深浅色模式切换。也可以自定义任何 [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) 支持颜色值,深浅色模式切换需自行适配", - "field_desc_en": "The color style can support TDesign's light and dark modes with the following options: black, blue, red, orange, and green. Alternatively, it can be any [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) value, but in this case, TDesign's light and dark modes will not be supported.", - "field_required": 0, - "event_input": "", - "create_time": "2023-04-20 11:27:29", - "update_time": "2023-04-20 11:27:29", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "String" - ] - }, - { - "id": 3453, - "platform_framework": [ - "1", - "2" - ], - "component": "Statistic", - "field_category": 1, - "field_name": "decimalPlaces", - "field_type": [ - "2" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "小数保留位数", - "field_desc_en": " Decimal places", - "field_required": 0, - "event_input": "", - "create_time": "2023-04-20 11:08:56", - "update_time": "2023-04-20 11:08:56", - "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(PC)", - "React(PC)" - ], - "field_type_text": [ - "Number" - ] - }, - { - "id": 3462, - "platform_framework": [ - "1", - "2" - ], - "component": "Statistic", - "field_category": 1, - "field_name": "extra", - "field_type": [ - "1", - "64" - ], - "field_default_value": "", - "field_enum": "", - "field_desc_zh": "额外的显示内容", - "field_desc_en": " Additional display content", - "field_required": 0, - "event_input": "", - "create_time": "2023-04-20 11:30:06", - "update_time": "2023-04-20 11:30:06", + "create_time": "2023-04-20 11:30:06", + "update_time": "2023-04-20 11:30:06", "event_output": null, "custom_field_type": null, "syntactic_sugar": null, @@ -129089,6 +128643,43 @@ "Function" ] }, + { + "id": 1537, + "platform_framework": [ + "16" + ], + "component": "Switch", + "field_category": 1, + "field_name": "colors", + "field_type": [ + "16" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "自定义颜色,[打开时的颜色,关闭时的颜色]。组件默认颜色为 ['#0052d9', 'rgba(0, 0, 0, .26']。示例:[blue, gray]", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2021-09-01 03:30:56", + "update_time": "2022-04-01 00:38:19", + "event_output": null, + "custom_field_type": "string[]", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 1, + "version": null, + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "React(Mobile)" + ], + "field_type_text": [ + "Array" + ] + }, { "id": 425, "platform_framework": [ @@ -155259,7 +154850,7 @@ ], "field_default_value": "", "field_enum": "", - "field_desc_zh": "是否支持拖拽排序", + "field_desc_zh": "是否支持拖拽排序。", "field_desc_en": null, "field_required": 0, "event_input": "", From 4f8b3fcd8cf68f97df5e848c632a057e22fd0126 Mon Sep 17 00:00:00 2001 From: Uyarn Date: Mon, 21 Sep 2026 17:01:55 +0800 Subject: [PATCH 4/6] chore: update api --- db/TDesign.db | Bin 1159168 -> 1159168 bytes .../components/scrollbar/defaultProps.ts | 2 +- .../components/scrollbar/scrollbar.en-US.md | 6 +- .../components/scrollbar/scrollbar.md | 6 +- .../packages/components/scrollbar/type.ts | 14 +-- .../packages/components/scrollbar/props.ts | 11 ++- .../components/scrollbar/scrollbar.en-US.md | 6 +- .../components/scrollbar/scrollbar.md | 6 +- .../packages/components/scrollbar/type.ts | 14 +-- .../tdesign-vue/src/scrollbar/props.ts | 11 ++- .../src/scrollbar/scrollbar.en-US.md | 6 +- .../tdesign-vue/src/scrollbar/scrollbar.md | 6 +- .../tdesign-vue/src/scrollbar/type.ts | 14 +-- packages/scripts/api.json | 80 +++++++++--------- 14 files changed, 94 insertions(+), 88 deletions(-) diff --git a/db/TDesign.db b/db/TDesign.db index 9ff0e9c3888fcb9e04fe3d85c054de146af55323..f7e513da7c653b2e96c386e0c4a2f38a9893620d 100644 GIT binary patch delta 295 zcmZp8;MVZKZGtr8;)ycOjEfr+S`!#s6PQ{Pm|GKAS`%1X6WCf4*jp1gS`#>16S!Iv zxLXr=S`&C%6Zl#a_*)YMwk8NJ?AK>p%^<>%%D{JvPnPEp_f2kgu42x69M3pJ*k`k= zvDL9gv)p9yW1h>9%H+%Rol$(UVSp)Dqu!!aNft(VPW9_OxY5Mnx zf)dkXCJQ=EmzXFxnT6>+!=ml$Cki?+3bB4+-~ef9R9ch{)w*?}pcV^IYwGm-69x0P z&zme5#>B$6lA&w*kEw!fmW?Wl62K}I8AW+L6FGQ|jTsmiI5~JZco{gd^7gVZ2PYTh m=j0?M7A2OJ16S!Iv zxLXr=S`&C%6Zl#a_*)YMwk8NJ?APa8$socg&cJtzPnPEp_f2kgu42x69M3pJ*k`k= zv3_BVX1U4Y$2^zmJ(DlvYDV$NiVvPo7oR9Ng{4t$QTq1v69pX@xf-<=rAo3e%5%z3 z&z~TuHGSi1LB;9&CJ07tpEp@BjESX5Z&AYZA5#U}nD%r|zcx)!E6iR&!!u2xBqLQJ zIX|x?F*7fPXB}$S)|# Z%mt}0NG(dsFUn2KOHS3(TsB=$5&$+?V1WPt diff --git a/packages/products/tdesign-react/packages/components/scrollbar/defaultProps.ts b/packages/products/tdesign-react/packages/components/scrollbar/defaultProps.ts index 5bddc8a56..08e7896ce 100644 --- a/packages/products/tdesign-react/packages/components/scrollbar/defaultProps.ts +++ b/packages/products/tdesign-react/packages/components/scrollbar/defaultProps.ts @@ -6,8 +6,8 @@ import { TdScrollbarProps } from './type'; export const scrollbarDefaultProps: TdScrollbarProps = { autoExpand: true, + autoresize: true, disabled: false, - noResize: false, role: 'scrollbar', thumbMinSize: 20, visibility: 'hover', diff --git a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md index 17e2e3a57..202569515 100644 --- a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md +++ b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md @@ -10,17 +10,17 @@ className | String | - | className of component | N style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N ariaLabel | String | - | aria-label text in view layer | N autoExpand | Boolean | true | Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)? | N +autoresize | Boolean | true | Does the container size respond to changes | N container | Object | - | Set the maximum height/width of the scrolling container.。Typescript: `ScrollbarContainerProps` | N disabled | Boolean | false | disabled scroll | N id | String | - | ID of the view layer | N -noResize | Boolean | false | Does the container size respond to changes? (If the container size is constant, enabling this feature can optimize performance.) | N role | String | scrollbar | WAI-ARIA role in the view layer | N step | Object | - | Rolling step。Typescript: `{x?:number;y?:number}` | N tabindex | String / Number | - | tabindex of the container | N thumbMinSize | Number | 20 | Minimum size (px) of the scroll bar slider. | N -viewClass | String | - | Custom class name for the view (content area) | N +viewClassName | String | - | Custom class name for the view (content area) | N visibility | String | hover | Scroll bar display format。options: always/hover/hide | N -wrapClass | String | - | Custom class name of the wrapper container | N +wrapClassName | String | - | Custom class name of the wrapper container | N onScroll | Function | | Typescript: `(context:{e:Event}) => void`
Triggered while scrolling | N ### ScrollbarInstanceFunctions 组件实例方法 diff --git a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md index d2bfaf72c..dc337702f 100644 --- a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md +++ b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md @@ -10,17 +10,17 @@ className | String | - | 类名 | N style | Object | - | 样式,TS 类型:`React.CSSProperties` | N ariaLabel | String | - | 视图层的 aria-label 文本 | N autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N +autoresize | Boolean | true | 容器尺寸是否响应变化 | N container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N disabled | Boolean | false | 禁止滚动 | N id | String | - | 视图层的 ID | N -noResize | Boolean | false | 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) | N role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N tabindex | String / Number | - | 包裹容器的 tabindex | N thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N -viewClass | String | - | 视图(内容区)的自定义类名 | N +viewClassName | String | - | 视图(内容区)的自定义类名 | N visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N -wrapClass | String | - | 包裹容器的自定义类名 | N +wrapClassName | String | - | 包裹容器的自定义类名 | N onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N ### ScrollbarInstanceFunctions 组件实例方法 diff --git a/packages/products/tdesign-react/packages/components/scrollbar/type.ts b/packages/products/tdesign-react/packages/components/scrollbar/type.ts index bab94ddd7..549ae09ae 100644 --- a/packages/products/tdesign-react/packages/components/scrollbar/type.ts +++ b/packages/products/tdesign-react/packages/components/scrollbar/type.ts @@ -15,6 +15,11 @@ export interface TdScrollbarProps { * @default true */ autoExpand?: boolean; + /** + * 容器尺寸是否响应变化 + * @default true + */ + autoresize?: boolean; /** * 设置滚动容器的最大高度/宽度 */ @@ -29,11 +34,6 @@ export interface TdScrollbarProps { * @default '' */ id?: string; - /** - * 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) - * @default false - */ - noResize?: boolean; /** * 视图层的 WAI-ARIA 角色 * @default scrollbar @@ -56,7 +56,7 @@ export interface TdScrollbarProps { * 视图(内容区)的自定义类名 * @default '' */ - viewClass?: string; + viewClassName?: string; /** * 滚动条的显示形式 * @default hover @@ -66,7 +66,7 @@ export interface TdScrollbarProps { * 包裹容器的自定义类名 * @default '' */ - wrapClass?: string; + wrapClassName?: string; /** * 滚动时触发 */ diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts b/packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts index 363ce51aa..59edfd0df 100644 --- a/packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/props.ts @@ -18,6 +18,11 @@ export default { type: Boolean, default: true, }, + /** 容器尺寸是否响应变化 */ + autoresize: { + type: Boolean, + default: true, + }, /** 设置滚动容器的最大高度/宽度 */ container: { type: Object as PropType, @@ -29,8 +34,6 @@ export default { type: String, default: '', }, - /** 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) */ - noResize: Boolean, /** 视图层的 WAI-ARIA 角色 */ role: { type: String, @@ -50,7 +53,7 @@ export default { default: 20, }, /** 视图(内容区)的自定义类名 */ - viewClass: { + viewClassName: { type: String, default: '', }, @@ -64,7 +67,7 @@ export default { }, }, /** 包裹容器的自定义类名 */ - wrapClass: { + wrapClassName: { type: String, default: '', }, diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md index d5c13a0fd..28ab76cc7 100644 --- a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md @@ -8,17 +8,17 @@ name | type | default | description | required -- | -- | -- | -- | -- ariaLabel | String | - | aria-label text in view layer | N autoExpand | Boolean | true | Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)? | N +autoresize | Boolean | true | Does the container size respond to changes | N container | Object | - | Set the maximum height/width of the scrolling container.。Typescript: `ScrollbarContainerProps` | N disabled | Boolean | false | disabled scroll | N id | String | - | ID of the view layer | N -noResize | Boolean | false | Does the container size respond to changes? (If the container size is constant, enabling this feature can optimize performance.) | N role | String | scrollbar | WAI-ARIA role in the view layer | N step | Object | - | Rolling step。Typescript: `{x?:number;y?:number}` | N tabindex | String / Number | - | tabindex of the container | N thumbMinSize | Number | 20 | Minimum size (px) of the scroll bar slider. | N -viewClass | String | - | Custom class name for the view (content area) | N +viewClassName | String | - | Custom class name for the view (content area) | N visibility | String | hover | Scroll bar display format。options: always/hover/hide | N -wrapClass | String | - | Custom class name of the wrapper container | N +wrapClassName | String | - | Custom class name of the wrapper container | N onScroll | Function | | Typescript: `(context:{e:Event}) => void`
Triggered while scrolling | N ### Scrollbar Events diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md index cb19bbb70..f5c23f5cc 100644 --- a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md @@ -8,17 +8,17 @@ -- | -- | -- | -- | -- ariaLabel | String | - | 视图层的 aria-label 文本 | N autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N +autoresize | Boolean | true | 容器尺寸是否响应变化 | N container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N disabled | Boolean | false | 禁止滚动 | N id | String | - | 视图层的 ID | N -noResize | Boolean | false | 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) | N role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N tabindex | String / Number | - | 包裹容器的 tabindex | N thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N -viewClass | String | - | 视图(内容区)的自定义类名 | N +viewClassName | String | - | 视图(内容区)的自定义类名 | N visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N -wrapClass | String | - | 包裹容器的自定义类名 | N +wrapClassName | String | - | 包裹容器的自定义类名 | N onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N ### Scrollbar Events diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts b/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts index bab94ddd7..549ae09ae 100644 --- a/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts @@ -15,6 +15,11 @@ export interface TdScrollbarProps { * @default true */ autoExpand?: boolean; + /** + * 容器尺寸是否响应变化 + * @default true + */ + autoresize?: boolean; /** * 设置滚动容器的最大高度/宽度 */ @@ -29,11 +34,6 @@ export interface TdScrollbarProps { * @default '' */ id?: string; - /** - * 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) - * @default false - */ - noResize?: boolean; /** * 视图层的 WAI-ARIA 角色 * @default scrollbar @@ -56,7 +56,7 @@ export interface TdScrollbarProps { * 视图(内容区)的自定义类名 * @default '' */ - viewClass?: string; + viewClassName?: string; /** * 滚动条的显示形式 * @default hover @@ -66,7 +66,7 @@ export interface TdScrollbarProps { * 包裹容器的自定义类名 * @default '' */ - wrapClass?: string; + wrapClassName?: string; /** * 滚动时触发 */ diff --git a/packages/products/tdesign-vue/src/scrollbar/props.ts b/packages/products/tdesign-vue/src/scrollbar/props.ts index 363ce51aa..59edfd0df 100644 --- a/packages/products/tdesign-vue/src/scrollbar/props.ts +++ b/packages/products/tdesign-vue/src/scrollbar/props.ts @@ -18,6 +18,11 @@ export default { type: Boolean, default: true, }, + /** 容器尺寸是否响应变化 */ + autoresize: { + type: Boolean, + default: true, + }, /** 设置滚动容器的最大高度/宽度 */ container: { type: Object as PropType, @@ -29,8 +34,6 @@ export default { type: String, default: '', }, - /** 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) */ - noResize: Boolean, /** 视图层的 WAI-ARIA 角色 */ role: { type: String, @@ -50,7 +53,7 @@ export default { default: 20, }, /** 视图(内容区)的自定义类名 */ - viewClass: { + viewClassName: { type: String, default: '', }, @@ -64,7 +67,7 @@ export default { }, }, /** 包裹容器的自定义类名 */ - wrapClass: { + wrapClassName: { type: String, default: '', }, diff --git a/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md index 10368ab88..b84a61fed 100644 --- a/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md +++ b/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md @@ -8,17 +8,17 @@ name | type | default | description | required -- | -- | -- | -- | -- ariaLabel | String | - | aria-label text in view layer | N autoExpand | Boolean | true | Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)? | N +autoresize | Boolean | true | Does the container size respond to changes | N container | Object | - | Set the maximum height/width of the scrolling container.。Typescript: `ScrollbarContainerProps` | N disabled | Boolean | false | disabled scroll | N id | String | - | ID of the view layer | N -noResize | Boolean | false | Does the container size respond to changes? (If the container size is constant, enabling this feature can optimize performance.) | N role | String | scrollbar | WAI-ARIA role in the view layer | N step | Object | - | Rolling step。Typescript: `{x?:number;y?:number}` | N tabindex | String / Number | - | tabindex of the container | N thumbMinSize | Number | 20 | Minimum size (px) of the scroll bar slider. | N -viewClass | String | - | Custom class name for the view (content area) | N +viewClassName | String | - | Custom class name for the view (content area) | N visibility | String | hover | Scroll bar display format。options: always/hover/hide | N -wrapClass | String | - | Custom class name of the wrapper container | N +wrapClassName | String | - | Custom class name of the wrapper container | N onScroll | Function | | Typescript: `(context:{e:Event}) => void`
Triggered while scrolling | N ### Scrollbar Events diff --git a/packages/products/tdesign-vue/src/scrollbar/scrollbar.md b/packages/products/tdesign-vue/src/scrollbar/scrollbar.md index 353d5ad2b..1fde76131 100644 --- a/packages/products/tdesign-vue/src/scrollbar/scrollbar.md +++ b/packages/products/tdesign-vue/src/scrollbar/scrollbar.md @@ -8,17 +8,17 @@ -- | -- | -- | -- | -- ariaLabel | String | - | 视图层的 aria-label 文本 | N autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N +autoresize | Boolean | true | 容器尺寸是否响应变化 | N container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N disabled | Boolean | false | 禁止滚动 | N id | String | - | 视图层的 ID | N -noResize | Boolean | false | 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) | N role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N tabindex | String / Number | - | 包裹容器的 tabindex | N thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N -viewClass | String | - | 视图(内容区)的自定义类名 | N +viewClassName | String | - | 视图(内容区)的自定义类名 | N visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N -wrapClass | String | - | 包裹容器的自定义类名 | N +wrapClassName | String | - | 包裹容器的自定义类名 | N onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N ### Scrollbar Events diff --git a/packages/products/tdesign-vue/src/scrollbar/type.ts b/packages/products/tdesign-vue/src/scrollbar/type.ts index bab94ddd7..549ae09ae 100644 --- a/packages/products/tdesign-vue/src/scrollbar/type.ts +++ b/packages/products/tdesign-vue/src/scrollbar/type.ts @@ -15,6 +15,11 @@ export interface TdScrollbarProps { * @default true */ autoExpand?: boolean; + /** + * 容器尺寸是否响应变化 + * @default true + */ + autoresize?: boolean; /** * 设置滚动容器的最大高度/宽度 */ @@ -29,11 +34,6 @@ export interface TdScrollbarProps { * @default '' */ id?: string; - /** - * 容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能) - * @default false - */ - noResize?: boolean; /** * 视图层的 WAI-ARIA 角色 * @default scrollbar @@ -56,7 +56,7 @@ export interface TdScrollbarProps { * 视图(内容区)的自定义类名 * @default '' */ - viewClass?: string; + viewClassName?: string; /** * 滚动条的显示形式 * @default hover @@ -66,7 +66,7 @@ export interface TdScrollbarProps { * 包裹容器的自定义类名 * @default '' */ - wrapClass?: string; + wrapClassName?: string; /** * 滚动时触发 */ diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 06f47629b..6d205529d 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -110323,27 +110323,27 @@ ] }, { - "id": 1785642550, + "id": 1785642246, "platform_framework": [ "1", "2" ], "component": "Scrollbar", "field_category": 1, - "field_name": "container", + "field_name": "autoresize", "field_type": [ - "8" + "4" ], - "field_default_value": "", + "field_default_value": "true", "field_enum": "", - "field_desc_zh": "设置滚动容器的最大高度/宽度", - "field_desc_en": "Set the maximum height/width of the scrolling container.", + "field_desc_zh": "容器尺寸是否响应变化", + "field_desc_en": "Does the container size respond to changes", "field_required": 0, "event_input": "", - "create_time": "2026-08-02 03:49:10", - "update_time": "2026-08-02 03:49:10", + "create_time": "2026-08-02 03:44:06", + "update_time": "2026-08-02 03:44:06", "event_output": null, - "custom_field_type": "ScrollbarContainerProps", + "custom_field_type": null, "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, @@ -110358,31 +110358,31 @@ "React(PC)" ], "field_type_text": [ - "Object" + "Boolean" ] }, { - "id": 1785642610, + "id": 1785642550, "platform_framework": [ "1", "2" ], "component": "Scrollbar", "field_category": 1, - "field_name": "disabled", + "field_name": "container", "field_type": [ - "4" + "8" ], - "field_default_value": "false", + "field_default_value": "", "field_enum": "", - "field_desc_zh": "禁止滚动", - "field_desc_en": "disabled scroll", + "field_desc_zh": "设置滚动容器的最大高度/宽度", + "field_desc_en": "Set the maximum height/width of the scrolling container.", "field_required": 0, "event_input": "", - "create_time": "2026-08-02 03:50:10", - "update_time": "2026-08-02 03:50:10", + "create_time": "2026-08-02 03:49:10", + "update_time": "2026-08-02 03:49:10", "event_output": null, - "custom_field_type": null, + "custom_field_type": "ScrollbarContainerProps", "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, @@ -110397,29 +110397,29 @@ "React(PC)" ], "field_type_text": [ - "Boolean" + "Object" ] }, { - "id": 1785643082, + "id": 1785642610, "platform_framework": [ "1", "2" ], "component": "Scrollbar", "field_category": 1, - "field_name": "id", + "field_name": "disabled", "field_type": [ - "1" + "4" ], - "field_default_value": "", + "field_default_value": "false", "field_enum": "", - "field_desc_zh": "视图层的 ID", - "field_desc_en": "ID of the view layer", + "field_desc_zh": "禁止滚动", + "field_desc_en": "disabled scroll", "field_required": 0, "event_input": "", - "create_time": "2026-08-02 03:58:02", - "update_time": "2026-08-02 03:58:02", + "create_time": "2026-08-02 03:50:10", + "update_time": "2026-08-02 03:50:10", "event_output": null, "custom_field_type": null, "syntactic_sugar": null, @@ -110436,29 +110436,29 @@ "React(PC)" ], "field_type_text": [ - "String" + "Boolean" ] }, { - "id": 1785642246, + "id": 1785643082, "platform_framework": [ "1", "2" ], "component": "Scrollbar", "field_category": 1, - "field_name": "noResize", + "field_name": "id", "field_type": [ - "4" + "1" ], - "field_default_value": "false", + "field_default_value": "", "field_enum": "", - "field_desc_zh": "容器尺寸是否响应变化(若容器尺寸恒定,开启可优化性能)", - "field_desc_en": "Does the container size respond to changes? (If the container size is constant, enabling this feature can optimize performance.)", + "field_desc_zh": "视图层的 ID", + "field_desc_en": "ID of the view layer", "field_required": 0, "event_input": "", - "create_time": "2026-08-02 03:44:06", - "update_time": "2026-08-02 03:44:06", + "create_time": "2026-08-02 03:58:02", + "update_time": "2026-08-02 03:58:02", "event_output": null, "custom_field_type": null, "syntactic_sugar": null, @@ -110475,7 +110475,7 @@ "React(PC)" ], "field_type_text": [ - "Boolean" + "String" ] }, { @@ -110644,7 +110644,7 @@ ], "component": "Scrollbar", "field_category": 1, - "field_name": "viewClass", + "field_name": "viewClassName", "field_type": [ "1" ], @@ -110722,7 +110722,7 @@ ], "component": "Scrollbar", "field_category": 1, - "field_name": "wrapClass", + "field_name": "wrapClassName", "field_type": [ "1" ], From e786c43d608afe0cdebfe0a9319c34f8debbe2cb Mon Sep 17 00:00:00 2001 From: Uyarn Date: Mon, 21 Sep 2026 17:27:52 +0800 Subject: [PATCH 5/6] chore: update api --- db/TDesign.db | Bin 1159168 -> 1159168 bytes .../components/scrollbar/scrollbar.en-US.md | 6 +++--- .../components/scrollbar/scrollbar.md | 6 +++--- .../packages/components/scrollbar/type.ts | 9 +++++++-- .../components/scrollbar/scrollbar.en-US.md | 8 ++++---- .../components/scrollbar/scrollbar.md | 8 ++++---- .../packages/components/scrollbar/type.ts | 9 +++++++-- .../src/scrollbar/scrollbar.en-US.md | 8 ++++---- .../tdesign-vue/src/scrollbar/scrollbar.md | 8 ++++---- .../tdesign-vue/src/scrollbar/type.ts | 9 +++++++-- packages/scripts/api.json | 8 ++++---- 11 files changed, 47 insertions(+), 32 deletions(-) diff --git a/db/TDesign.db b/db/TDesign.db index f7e513da7c653b2e96c386e0c4a2f38a9893620d..5ee1f05c2179fa59dbc7480d0070207fae2551ed 100644 GIT binary patch delta 410 zcmZp8;MVZKZGtr8s);hrjH?16S!Iv zxLXr=S`&C%6Zl#a_*)YMwk8NJ>h~*V5Mi)q;Jd}=$Mczoi`#;02^T-7I1>lQJPu9v zMz$9WZ&+`$YOz!>Ut=}^DujYYgGCvQI*S@L7iCDYFv>GZGV=0j+jFE&*O(~iJuOf` zbovAfJ|Px`T1|!NtrG>+L>rkGC4p3OiUL)ts&eoe8#CBXe>+7mN>8D}-bx{_G&d== z$XcNi&aP!kW0)!h(jpJk5?c+{(wI42bB18OSd+@4SPZ#zu-tU@NrHUSx6criP_0(T zNX<;oD6zLHE-A{)OIN6Y+moAE;Q^7Go*2R>%vPS6Qj%d0W^)4N!XeziU;*Lj-zNz! zpYAtFaN+dS34)uq&zmf0&By`_ho( A%K!iX delta 420 zcmZp8;MVZKZGtr8;)ycOjEfr+S`!#s6PQ{Pm|GKAS`%1X6WCf4*jp1gS`#>16S!Iv zxLXr=S`&C%6Zl#a_*)YMwk8NJ>epM%Ai|K!z;}yJmgf-nO>TCsV$ORU&p1TbXS1uZ z)v-pi++^`%p39KR_Y8|b$~onyTTK?!+MY34P=Jwx^$P4f!9``16& zGvjH`v}X;=Uo`K1zrAs~;B-b2zeTYSR{=c{Tg$;~Y|LOiU2c+KJ)_?AxswFd#DkNI z@^f;M5{sOH9!t#3ODzg0$}cG1E1f{p% JnkT3x2mtC0kGlW> diff --git a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md index 202569515..895cf8b53 100644 --- a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md +++ b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md @@ -11,17 +11,17 @@ style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSPropert ariaLabel | String | - | aria-label text in view layer | N autoExpand | Boolean | true | Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)? | N autoresize | Boolean | true | Does the container size respond to changes | N -container | Object | - | Set the maximum height/width of the scrolling container.。Typescript: `ScrollbarContainerProps` | N +container | Object | - | Set the maximum height/width of the scrolling container。Typescript: `{ height?:string \| number; maxHeight?: string \| number; width?: string \| number; maxWidth?: string \| number }` | N disabled | Boolean | false | disabled scroll | N id | String | - | ID of the view layer | N role | String | scrollbar | WAI-ARIA role in the view layer | N -step | Object | - | Rolling step。Typescript: `{x?:number;y?:number}` | N +step | Object | - | Rolling step。Typescript: `{ x?: number; y?: number}` | N tabindex | String / Number | - | tabindex of the container | N thumbMinSize | Number | 20 | Minimum size (px) of the scroll bar slider. | N viewClassName | String | - | Custom class name for the view (content area) | N visibility | String | hover | Scroll bar display format。options: always/hover/hide | N wrapClassName | String | - | Custom class name of the wrapper container | N -onScroll | Function | | Typescript: `(context:{e:Event}) => void`
Triggered while scrolling | N +onScroll | Function | | Typescript: `({ scrollTop: number, scrollLeft: number }) => void`
Triggered while scrolling | N ### ScrollbarInstanceFunctions 组件实例方法 diff --git a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md index dc337702f..a7f7213a9 100644 --- a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md +++ b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md @@ -11,17 +11,17 @@ style | Object | - | 样式,TS 类型:`React.CSSProperties` | N ariaLabel | String | - | 视图层的 aria-label 文本 | N autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N autoresize | Boolean | true | 容器尺寸是否响应变化 | N -container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N +container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`{ height?:string \| number; maxHeight?: string \| number; width?: string \| number; maxWidth?: string \| number }` | N disabled | Boolean | false | 禁止滚动 | N id | String | - | 视图层的 ID | N role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N -step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N +step | Object | - | 滚动步长。TS 类型:`{ x?: number; y?: number}` | N tabindex | String / Number | - | 包裹容器的 tabindex | N thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N viewClassName | String | - | 视图(内容区)的自定义类名 | N visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N wrapClassName | String | - | 包裹容器的自定义类名 | N -onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N +onScroll | Function | | TS 类型:`({ scrollTop: number, scrollLeft: number }) => void`
滚动时触发 | N ### ScrollbarInstanceFunctions 组件实例方法 diff --git a/packages/products/tdesign-react/packages/components/scrollbar/type.ts b/packages/products/tdesign-react/packages/components/scrollbar/type.ts index 549ae09ae..fe0a4186f 100644 --- a/packages/products/tdesign-react/packages/components/scrollbar/type.ts +++ b/packages/products/tdesign-react/packages/components/scrollbar/type.ts @@ -23,7 +23,12 @@ export interface TdScrollbarProps { /** * 设置滚动容器的最大高度/宽度 */ - container?: ScrollbarContainerProps; + container?: { + height?: string | number; + maxHeight?: string | number; + width?: string | number; + maxWidth?: string | number; + }; /** * 禁止滚动 * @default false @@ -70,7 +75,7 @@ export interface TdScrollbarProps { /** * 滚动时触发 */ - onScroll?: (context: { e: Event }) => void; + onScroll?: ({ scrollTop: number, scrollLeft: number }) => void; } /** 组件实例方法 */ diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md index 28ab76cc7..b588048d3 100644 --- a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md @@ -9,23 +9,23 @@ name | type | default | description | required ariaLabel | String | - | aria-label text in view layer | N autoExpand | Boolean | true | Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)? | N autoresize | Boolean | true | Does the container size respond to changes | N -container | Object | - | Set the maximum height/width of the scrolling container.。Typescript: `ScrollbarContainerProps` | N +container | Object | - | Set the maximum height/width of the scrolling container。Typescript: `{ height?:string \| number; maxHeight?: string \| number; width?: string \| number; maxWidth?: string \| number }` | N disabled | Boolean | false | disabled scroll | N id | String | - | ID of the view layer | N role | String | scrollbar | WAI-ARIA role in the view layer | N -step | Object | - | Rolling step。Typescript: `{x?:number;y?:number}` | N +step | Object | - | Rolling step。Typescript: `{ x?: number; y?: number}` | N tabindex | String / Number | - | tabindex of the container | N thumbMinSize | Number | 20 | Minimum size (px) of the scroll bar slider. | N viewClassName | String | - | Custom class name for the view (content area) | N visibility | String | hover | Scroll bar display format。options: always/hover/hide | N wrapClassName | String | - | Custom class name of the wrapper container | N -onScroll | Function | | Typescript: `(context:{e:Event}) => void`
Triggered while scrolling | N +onScroll | Function | | Typescript: `({ scrollTop: number, scrollLeft: number }) => void`
Triggered while scrolling | N ### Scrollbar Events name | params | description -- | -- | -- -scroll | `(context:{e:Event})` | Triggered while scrolling +scroll | `({ scrollTop: number, scrollLeft: number }) ` | Triggered while scrolling ### ScrollbarInstanceFunctions 组件实例方法 diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md index f5c23f5cc..7e6a9c79c 100644 --- a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md @@ -9,23 +9,23 @@ ariaLabel | String | - | 视图层的 aria-label 文本 | N autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N autoresize | Boolean | true | 容器尺寸是否响应变化 | N -container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N +container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`{ height?:string \| number; maxHeight?: string \| number; width?: string \| number; maxWidth?: string \| number }` | N disabled | Boolean | false | 禁止滚动 | N id | String | - | 视图层的 ID | N role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N -step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N +step | Object | - | 滚动步长。TS 类型:`{ x?: number; y?: number}` | N tabindex | String / Number | - | 包裹容器的 tabindex | N thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N viewClassName | String | - | 视图(内容区)的自定义类名 | N visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N wrapClassName | String | - | 包裹容器的自定义类名 | N -onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N +onScroll | Function | | TS 类型:`({ scrollTop: number, scrollLeft: number }) => void`
滚动时触发 | N ### Scrollbar Events 名称 | 参数 | 描述 -- | -- | -- -scroll | `(context:{e:Event})` | 滚动时触发 +scroll | `({ scrollTop: number, scrollLeft: number }) ` | 滚动时触发 ### ScrollbarInstanceFunctions 组件实例方法 diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts b/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts index 549ae09ae..fe0a4186f 100644 --- a/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts @@ -23,7 +23,12 @@ export interface TdScrollbarProps { /** * 设置滚动容器的最大高度/宽度 */ - container?: ScrollbarContainerProps; + container?: { + height?: string | number; + maxHeight?: string | number; + width?: string | number; + maxWidth?: string | number; + }; /** * 禁止滚动 * @default false @@ -70,7 +75,7 @@ export interface TdScrollbarProps { /** * 滚动时触发 */ - onScroll?: (context: { e: Event }) => void; + onScroll?: ({ scrollTop: number, scrollLeft: number }) => void; } /** 组件实例方法 */ diff --git a/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md index b84a61fed..b479d3ed7 100644 --- a/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md +++ b/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md @@ -9,23 +9,23 @@ name | type | default | description | required ariaLabel | String | - | aria-label text in view layer | N autoExpand | Boolean | true | Should the scrollbar expand outwards when hovering (to increase the interactive hotspot)? | N autoresize | Boolean | true | Does the container size respond to changes | N -container | Object | - | Set the maximum height/width of the scrolling container.。Typescript: `ScrollbarContainerProps` | N +container | Object | - | Set the maximum height/width of the scrolling container。Typescript: `{ height?:string \| number; maxHeight?: string \| number; width?: string \| number; maxWidth?: string \| number }` | N disabled | Boolean | false | disabled scroll | N id | String | - | ID of the view layer | N role | String | scrollbar | WAI-ARIA role in the view layer | N -step | Object | - | Rolling step。Typescript: `{x?:number;y?:number}` | N +step | Object | - | Rolling step。Typescript: `{ x?: number; y?: number}` | N tabindex | String / Number | - | tabindex of the container | N thumbMinSize | Number | 20 | Minimum size (px) of the scroll bar slider. | N viewClassName | String | - | Custom class name for the view (content area) | N visibility | String | hover | Scroll bar display format。options: always/hover/hide | N wrapClassName | String | - | Custom class name of the wrapper container | N -onScroll | Function | | Typescript: `(context:{e:Event}) => void`
Triggered while scrolling | N +onScroll | Function | | Typescript: `({ scrollTop: number, scrollLeft: number }) => void`
Triggered while scrolling | N ### Scrollbar Events name | params | description -- | -- | -- -scroll | `(context:{e:Event})` | Triggered while scrolling +scroll | `({ scrollTop: number, scrollLeft: number }) ` | Triggered while scrolling ### ScrollbarInstanceFunctions 组件实例方法 diff --git a/packages/products/tdesign-vue/src/scrollbar/scrollbar.md b/packages/products/tdesign-vue/src/scrollbar/scrollbar.md index 1fde76131..a56e46bd4 100644 --- a/packages/products/tdesign-vue/src/scrollbar/scrollbar.md +++ b/packages/products/tdesign-vue/src/scrollbar/scrollbar.md @@ -9,23 +9,23 @@ ariaLabel | String | - | 视图层的 aria-label 文本 | N autoExpand | Boolean | true | 滚动条 hover 时是否向外扩展(增加交互热区) | N autoresize | Boolean | true | 容器尺寸是否响应变化 | N -container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`ScrollbarContainerProps` | N +container | Object | - | 设置滚动容器的最大高度/宽度。TS 类型:`{ height?:string \| number; maxHeight?: string \| number; width?: string \| number; maxWidth?: string \| number }` | N disabled | Boolean | false | 禁止滚动 | N id | String | - | 视图层的 ID | N role | String | scrollbar | 视图层的 WAI-ARIA 角色 | N -step | Object | - | 滚动步长。TS 类型:`{x?:number;y?:number}` | N +step | Object | - | 滚动步长。TS 类型:`{ x?: number; y?: number}` | N tabindex | String / Number | - | 包裹容器的 tabindex | N thumbMinSize | Number | 20 | 滚动条滑块的最小尺寸(px) | N viewClassName | String | - | 视图(内容区)的自定义类名 | N visibility | String | hover | 滚动条的显示形式。可选项:always/hover/hide | N wrapClassName | String | - | 包裹容器的自定义类名 | N -onScroll | Function | | TS 类型:`(context:{e:Event}) => void`
滚动时触发 | N +onScroll | Function | | TS 类型:`({ scrollTop: number, scrollLeft: number }) => void`
滚动时触发 | N ### Scrollbar Events 名称 | 参数 | 描述 -- | -- | -- -scroll | `(context:{e:Event})` | 滚动时触发 +scroll | `({ scrollTop: number, scrollLeft: number }) ` | 滚动时触发 ### ScrollbarInstanceFunctions 组件实例方法 diff --git a/packages/products/tdesign-vue/src/scrollbar/type.ts b/packages/products/tdesign-vue/src/scrollbar/type.ts index 549ae09ae..fe0a4186f 100644 --- a/packages/products/tdesign-vue/src/scrollbar/type.ts +++ b/packages/products/tdesign-vue/src/scrollbar/type.ts @@ -23,7 +23,12 @@ export interface TdScrollbarProps { /** * 设置滚动容器的最大高度/宽度 */ - container?: ScrollbarContainerProps; + container?: { + height?: string | number; + maxHeight?: string | number; + width?: string | number; + maxWidth?: string | number; + }; /** * 禁止滚动 * @default false @@ -70,7 +75,7 @@ export interface TdScrollbarProps { /** * 滚动时触发 */ - onScroll?: (context: { e: Event }) => void; + onScroll?: ({ scrollTop: number, scrollLeft: number }) => void; } /** 组件实例方法 */ diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 6d205529d..3b9db26d4 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -110376,13 +110376,13 @@ "field_default_value": "", "field_enum": "", "field_desc_zh": "设置滚动容器的最大高度/宽度", - "field_desc_en": "Set the maximum height/width of the scrolling container.", + "field_desc_en": "Set the maximum height/width of the scrolling container", "field_required": 0, "event_input": "", "create_time": "2026-08-02 03:49:10", "update_time": "2026-08-02 03:49:10", "event_output": null, - "custom_field_type": "ScrollbarContainerProps", + "custom_field_type": "{ height?:string | number; maxHeight?: string | number; width?: string | number; maxWidth?: string | number }", "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, @@ -110538,7 +110538,7 @@ "create_time": "2026-08-02 03:51:20", "update_time": "2026-08-02 03:51:20", "event_output": null, - "custom_field_type": "{x?:number;y?:number}", + "custom_field_type": "{ x?: number; y?: number}", "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, @@ -110771,7 +110771,7 @@ "field_desc_zh": "滚动时触发", "field_desc_en": "Triggered while scrolling", "field_required": 0, - "event_input": "(context:{e:Event})", + "event_input": "({ scrollTop: number, scrollLeft: number }) ", "create_time": "2026-08-02 04:06:20", "update_time": "2026-08-02 04:06:20", "event_output": null, From fa4a90f41dd1dce13f119f6e14c23eebaaa1716e Mon Sep 17 00:00:00 2001 From: Uyarn Date: Mon, 21 Sep 2026 17:52:50 +0800 Subject: [PATCH 6/6] fix: fix scrollbar scrollTo func override --- db/TDesign.db | Bin 1159168 -> 1159168 bytes packages/frontend/src/pages/api/const.js | 4 +- packages/frontend/src/pages/api/import.vue | 10 +++++ .../components/scrollbar/scrollbar.en-US.md | 2 +- .../components/scrollbar/scrollbar.md | 2 +- .../packages/components/scrollbar/type.ts | 2 +- .../components/scrollbar/scrollbar.en-US.md | 2 +- .../components/scrollbar/scrollbar.md | 2 +- .../packages/components/scrollbar/type.ts | 2 +- .../src/scrollbar/scrollbar.en-US.md | 2 +- .../tdesign-vue/src/scrollbar/scrollbar.md | 2 +- .../tdesign-vue/src/scrollbar/type.ts | 2 +- packages/scripts/api.json | 4 +- packages/scripts/types/index.js | 40 +++++++++++++++--- 14 files changed, 57 insertions(+), 19 deletions(-) diff --git a/db/TDesign.db b/db/TDesign.db index 5ee1f05c2179fa59dbc7480d0070207fae2551ed..4d2daa1d70eb31aa08c169a12b501892f98c9105 100644 GIT binary patch delta 230 zcmZp8;MVZKZGtr8nu#*btZNwbrk-p}X-#2lO<`(HVQx)fX-#2mO<`+IVQ)?0Xied4 zP2p-y;ciXgX-(m6P2p=z;crb5*qS0ZcRn{SGXn>Q00Un&ukUuA1%i%jLe2JzvZPrU z?(+pZ3 uTp{?0g@u8E!D~AET0u9lCapzTQYhva8#6FWms%^BM8GVy?bYi9TNweD(MO5^ delta 134 zcmV;10D1p_;6{MpMvxl;s*xN+1*!lphADw$g=7JRWCDd`1BGM+g=7VVWCn#~2Zdw^ zg=7hZWD1333x#A1g=7tdWDbR74~1k9wPX>Up9=s000;;W01kT%1GfyI5kUsCFyO-h ow-Bfi^8^HfbfRjP2dxoCmzSmyFPFck5k;3)rxClie6A6M0nack +
+ +
+ +
+
diff --git a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md index 895cf8b53..7e6c50e75 100644 --- a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md +++ b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.en-US.md @@ -30,5 +30,5 @@ name | params | return | description className | String | - | className of component | N style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N getValues | \- | `PositionValues ` | required。Get the view object containing complete scrolling information。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
-scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | required。Scroll to a specific set of coordinates。Typescript: `ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts) +scrollTo | `ScrollToFn` | \- | required。Scroll to a specific set of coordinates。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
`type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`
scrollToEdge | `(position:PositionEdge) ` | \- | required。Scroll to one side。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md index a7f7213a9..cdc4847ab 100644 --- a/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md +++ b/packages/products/tdesign-react/packages/components/scrollbar/scrollbar.md @@ -30,5 +30,5 @@ onScroll | Function | | TS 类型:`({ scrollTop: number, scrollLeft: number } className | String | - | 类名 | N style | Object | - | 样式,TS 类型:`React.CSSProperties` | N getValues | \- | `PositionValues ` | 必需。获取包含完整滚动信息的视图对象。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
-scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | 必需。滚动到一组特定坐标。TS 类型:`ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts) +scrollTo | `ScrollToFn` | \- | 必需。滚动到一组特定坐标。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
`type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`
scrollToEdge | `(position:PositionEdge) ` | \- | 必需。滚动到某一边。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-react/packages/components/scrollbar/type.ts b/packages/products/tdesign-react/packages/components/scrollbar/type.ts index fe0a4186f..589194004 100644 --- a/packages/products/tdesign-react/packages/components/scrollbar/type.ts +++ b/packages/products/tdesign-react/packages/components/scrollbar/type.ts @@ -87,7 +87,7 @@ export interface ScrollbarInstanceFunctions { /** * 滚动到一组特定坐标 */ - scrollTo: (options: { top?: number; left?: number; behavior?: ScrollBehavior }) => void; + scrollTo: ScrollToFn; /** * 滚动到某一边 */ diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md index b588048d3..387b77875 100644 --- a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.en-US.md @@ -32,5 +32,5 @@ scroll | `({ scrollTop: number, scrollLeft: number }) ` | Triggered while scroll name | params | return | description -- | -- | -- | -- getValues | \- | `PositionValues ` | required。Get the view object containing complete scrolling information。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
-scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | required。Scroll to a specific set of coordinates。Typescript: `ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts) +scrollTo | `ScrollToFn` | \- | required。Scroll to a specific set of coordinates。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
`type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`
scrollToEdge | `(position:PositionEdge) ` | \- | required。Scroll to one side。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md index 7e6a9c79c..dd306f799 100644 --- a/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/scrollbar.md @@ -32,5 +32,5 @@ scroll | `({ scrollTop: number, scrollLeft: number }) ` | 滚动时触发 名称 | 参数 | 返回值 | 描述 -- | -- | -- | -- getValues | \- | `PositionValues ` | 必需。获取包含完整滚动信息的视图对象。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
-scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | 必需。滚动到一组特定坐标。TS 类型:`ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts) +scrollTo | `ScrollToFn` | \- | 必需。滚动到一组特定坐标。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
`type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`
scrollToEdge | `(position:PositionEdge) ` | \- | 必需。滚动到某一边。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts b/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts index fe0a4186f..589194004 100644 --- a/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts +++ b/packages/products/tdesign-vue-next/packages/components/scrollbar/type.ts @@ -87,7 +87,7 @@ export interface ScrollbarInstanceFunctions { /** * 滚动到一组特定坐标 */ - scrollTo: (options: { top?: number; left?: number; behavior?: ScrollBehavior }) => void; + scrollTo: ScrollToFn; /** * 滚动到某一边 */ diff --git a/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md b/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md index b479d3ed7..8697c9b74 100644 --- a/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md +++ b/packages/products/tdesign-vue/src/scrollbar/scrollbar.en-US.md @@ -32,5 +32,5 @@ scroll | `({ scrollTop: number, scrollLeft: number }) ` | Triggered while scroll name | params | return | description -- | -- | -- | -- getValues | \- | `PositionValues ` | required。Get the view object containing complete scrolling information。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
-scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | required。Scroll to a specific set of coordinates。Typescript: `ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts) +scrollTo | `ScrollToFn` | \- | required。Scroll to a specific set of coordinates。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
`type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`
scrollToEdge | `(position:PositionEdge) ` | \- | required。Scroll to one side。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue/src/scrollbar/scrollbar.md b/packages/products/tdesign-vue/src/scrollbar/scrollbar.md index a56e46bd4..fc4ef6277 100644 --- a/packages/products/tdesign-vue/src/scrollbar/scrollbar.md +++ b/packages/products/tdesign-vue/src/scrollbar/scrollbar.md @@ -32,5 +32,5 @@ scroll | `({ scrollTop: number, scrollLeft: number }) ` | 滚动时触发 名称 | 参数 | 返回值 | 描述 -- | -- | -- | -- getValues | \- | `PositionValues ` | 必需。获取包含完整滚动信息的视图对象。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
` interface PositionValues { left:number,top: number,scrollLeft:number,scrollTop:number,scrollWidth:number,scrollHeight:number, clientWidth:number,clientHeight:number }`
-scrollTo | `(options: { top?: number; left?: number; behavior?: ScrollBehavior })` | \- | 必需。滚动到一组特定坐标。TS 类型:`ScrollToFn` `type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts) +scrollTo | `ScrollToFn` | \- | 必需。滚动到一组特定坐标。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
`type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }`
scrollToEdge | `(position:PositionEdge) ` | \- | 必需。滚动到某一边。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/scrollbar/type.ts)。
`type PositionEdge = "left"\|"right"\|"top"\|"bottom"`
diff --git a/packages/products/tdesign-vue/src/scrollbar/type.ts b/packages/products/tdesign-vue/src/scrollbar/type.ts index fe0a4186f..589194004 100644 --- a/packages/products/tdesign-vue/src/scrollbar/type.ts +++ b/packages/products/tdesign-vue/src/scrollbar/type.ts @@ -87,7 +87,7 @@ export interface ScrollbarInstanceFunctions { /** * 滚动到一组特定坐标 */ - scrollTo: (options: { top?: number; left?: number; behavior?: ScrollBehavior }) => void; + scrollTo: ScrollToFn; /** * 滚动到某一边 */ diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 3b9db26d4..58cea5f31 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -110852,11 +110852,11 @@ "field_desc_zh": "滚动到一组特定坐标", "field_desc_en": "Scroll to a specific set of coordinates", "field_required": 1, - "event_input": "(options: { top?: number; left?: number; behavior?: ScrollBehavior })", + "event_input": "ScrollToFn【type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }】", "create_time": "2026-08-02 04:59:04", "update_time": "2026-08-02 04:59:04", "event_output": null, - "custom_field_type": "ScrollToFn【type ScrollToFn = { (x: number, y: number): void; (options: { top?: number; left?: number; behavior?: ScrollBehavior }): void; }】", + "custom_field_type": null, "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, diff --git a/packages/scripts/types/index.js b/packages/scripts/types/index.js index 0f8ec782a..3a8f9bc54 100644 --- a/packages/scripts/types/index.js +++ b/packages/scripts/types/index.js @@ -129,6 +129,21 @@ function getPropsApiType(api, framework) { }; } +/** + * Functions 的参数可能是普通参数列表,也可能已经是完整函数类型(具名重载 / call signature / 箭头函数)。 + * 后者不能再包一层 `(type) => void`。 + */ +function isCompleteFunctionType(str) { + if (!str || typeof str !== 'string') return false; + const s = str.trim(); + if (!s) return false; + if (/[\u4e00-\u9fff]/.test(s) || //i.test(s)) return false; + if (s.startsWith('{') && s.endsWith('}')) return true; + if (s.includes('=>')) return true; + if (s.startsWith('(') || s.includes(':')) return false; + return /^[A-Za-z_$][\w.$]*(<.*>)?$/.test(s); +} + function getEventsApiType(api) { let r = { type: '()', @@ -138,12 +153,19 @@ function getEventsApiType(api) { if (api.event_input) { const { baseName: rawBaseName, exports, imports } = formatTsTypeDesc(api.event_input); // 容错处理:event_input 中可能误用分号分隔参数,需替换为逗号 - const baseName = rawBaseName ? rawBaseName.replace(/;/g, ',') : rawBaseName; - r = { - type: baseName ? (baseName.startsWith('(') ? `${baseName}` : `(${baseName})`) : '()', - exports, - imports, - }; + const baseName = rawBaseName ? rawBaseName.replace(/;/g, ',').trim() : rawBaseName; + if (api.field_category_text === 'Functions' && isCompleteFunctionType(baseName)) { + r = { type: baseName, exports, imports }; + } else { + r = { + type: baseName ? (baseName.startsWith('(') ? `${baseName}` : `(${baseName})`) : '()', + exports, + imports, + }; + } + } + if (api.field_category_text === 'Functions' && isCompleteFunctionType(r.type)) { + return r; } if (api.event_output) { const { baseName, exports, imports } = formatTsTypeDesc(api.event_output); @@ -212,7 +234,7 @@ function formatApi(api, framework, plugin) { const comment = getComment(api); // 计算导入和导出内容 const csType = api.custom_field_type; - let r = ''; + let r = { baseName: '', exports: [], imports: [] }; if (csType) { r = formatTsTypeDesc(csType); exportsApi = exportsApi.concat(r.exports); @@ -223,6 +245,10 @@ function formatApi(api, framework, plugin) { // UniApp 中默认值为 undefined 的 Props 属性,TS 类型需加上 | null let finalType = type; + // Functions 若填写了完整 TS 类型(如 ScrollToFn 重载),优先用它作为方法类型 + if (api.field_category_text === 'Functions' && isCompleteFunctionType(r.baseName)) { + finalType = r.baseName.trim(); + } if ( framework === 'UniApp' && api.field_default_value === 'undefined' &&