From 5713da7f79d73fd24859f76c811c0f7d558b12a2 Mon Sep 17 00:00:00 2001 From: chaishi <974383157@qq.com> Date: Thu, 30 Nov 2023 11:32:57 +0800 Subject: [PATCH] feat: add disabled to TreeNodeModel --- db/TDesign.db | Bin 856064 -> 856064 bytes packages/products/tdesign-react/src/common.ts | 4 +- .../tdesign-react/src/tree/tree.en-US.md | 1 + .../products/tdesign-react/src/tree/tree.md | 1 + .../products/tdesign-react/src/tree/type.ts | 4 ++ .../products/tdesign-vue-next/src/common.ts | 4 +- .../tdesign-vue-next/src/tree/tree.en-US.md | 1 + .../tdesign-vue-next/src/tree/tree.md | 1 + .../tdesign-vue-next/src/tree/type.ts | 4 ++ packages/products/tdesign-vue/src/common.ts | 4 +- .../tdesign-vue/src/tree/tree.en-US.md | 1 + .../products/tdesign-vue/src/tree/tree.md | 1 + .../products/tdesign-vue/src/tree/type.ts | 4 ++ packages/scripts/api.json | 41 ++++++++++++++++++ packages/scripts/types/global/base.tpl | 4 +- 15 files changed, 67 insertions(+), 8 deletions(-) diff --git a/db/TDesign.db b/db/TDesign.db index cc1c649b32f88b8ef7284d9ae3d364aeaae40c11..76a736ba6d968ff82d53785c4dfa2b1da3dc6463 100644 GIT binary patch delta 268 zcmZozVA8O_WP&uK+C&*=Ry78_cnB_SO`R))dax z6t1l)+zbA*R4^McP2Z=$D7ICO=LQoKU)l6k%sf`xjhJ~(axvCT|HI2u&B@Hdl$yb$ z$GvQO10PSzM-dK=V+{ORJZ`*axnFWKaS3rcaU9#K$hnTAzH+*nBnzWDrz|5cuc|R8 zudy)$0|O@qF9$CJ2gnHakfPL7zxG>{tsC6OFM1tkD3TQz}Xg=7JRWCDd`1BGM+g=7VVWCn#~2Zdw^ zg=7hZWD2!p3!wi5cLOp4m%bnY7PTG>*aDZR0}MR3G6M|B3IT|h{0$6y3HJvB0s;(a p3HG;u4h)3x5(f!F01s*mMh(pi=?el15(z@JAqgxAw?YXGz6KdYC+7eF diff --git a/packages/products/tdesign-react/src/common.ts b/packages/products/tdesign-react/src/common.ts index 1adbe36e8..4a18766df 100644 --- a/packages/products/tdesign-react/src/common.ts +++ b/packages/products/tdesign-react/src/common.ts @@ -115,7 +115,7 @@ export type InfinityScroll = TScroll; export interface ScrollToElementParams { /** 跳转元素下标 */ - index: number; + index?: number; /** 跳转元素距离顶部的距离 */ top?: number; /** 单个元素高度非固定场景下,即 isFixedRowHeight = false。延迟设置元素位置,一般用于依赖不同高度异步渲染等场景,单位:毫秒 */ @@ -124,5 +124,5 @@ export interface ScrollToElementParams { } export interface ComponentScrollToElementParams extends ScrollToElementParams { - key: string | number; + key?: string | number; } diff --git a/packages/products/tdesign-react/src/tree/tree.en-US.md b/packages/products/tdesign-react/src/tree/tree.en-US.md index 5ba21ce54..edcd94f7d 100644 --- a/packages/products/tdesign-react/src/tree/tree.en-US.md +++ b/packages/products/tdesign-react/src/tree/tree.en-US.md @@ -98,6 +98,7 @@ name | type | default | description | required actived | Boolean | - | required | Y checked | Boolean | - | required | Y data | Object | - | required。node data, extends `TreeOptionData`。Typescript:`T` | Y +disabled | Boolean | - | required。node disabled state | Y expanded | Boolean | - | required | Y indeterminate | Boolean | - | required | Y loading | Boolean | - | required | Y diff --git a/packages/products/tdesign-react/src/tree/tree.md b/packages/products/tdesign-react/src/tree/tree.md index 6ea17b8b7..a7ae1a6b0 100644 --- a/packages/products/tdesign-react/src/tree/tree.md +++ b/packages/products/tdesign-react/src/tree/tree.md @@ -98,6 +98,7 @@ visible | Boolean | false | 节点是否可视 | N actived | Boolean | - | 必需。当前节点是否处于高亮激活态 | Y checked | Boolean | - | 必需。当前节点是否被选中 | Y data | Object | - | 必需。节点数据,泛型 `T` 表示树节点 TS 类型,继承 `TreeOptionData`。TS 类型:`T` | Y +disabled | Boolean | - | 必需。禁用状态 | Y expanded | Boolean | - | 必需。当前节点是否展开 | Y indeterminate | Boolean | - | 必需。当前节点是否处于半选状态 | Y loading | Boolean | - | 必需。当前节点是否处于加载中状态 | Y diff --git a/packages/products/tdesign-react/src/tree/type.ts b/packages/products/tdesign-react/src/tree/type.ts index c8ab4be18..efbd9f23d 100644 --- a/packages/products/tdesign-react/src/tree/type.ts +++ b/packages/products/tdesign-react/src/tree/type.ts @@ -376,6 +376,10 @@ export interface TreeNodeModel extend * 节点数据,泛型 `T` 表示树节点 TS 类型,继承 `TreeOptionData` */ data: T; + /** + * 禁用状态 + */ + disabled: boolean; /** * 当前节点是否展开 */ diff --git a/packages/products/tdesign-vue-next/src/common.ts b/packages/products/tdesign-vue-next/src/common.ts index 689048813..e099003f4 100644 --- a/packages/products/tdesign-vue-next/src/common.ts +++ b/packages/products/tdesign-vue-next/src/common.ts @@ -119,7 +119,7 @@ export type InfinityScroll = TScroll; export interface ScrollToElementParams { /** 跳转元素下标 */ - index: number; + index?: number; /** 跳转元素距离顶部的距离 */ top?: number; /** 单个元素高度非固定场景下,即 isFixedRowHeight = false。延迟设置元素位置,一般用于依赖不同高度异步渲染等场景,单位:毫秒 */ @@ -128,5 +128,5 @@ export interface ScrollToElementParams { } export interface ComponentScrollToElementParams extends ScrollToElementParams { - key: string | number; + key?: string | number; } diff --git a/packages/products/tdesign-vue-next/src/tree/tree.en-US.md b/packages/products/tdesign-vue-next/src/tree/tree.en-US.md index 44d06f93c..90e97dde0 100644 --- a/packages/products/tdesign-vue-next/src/tree/tree.en-US.md +++ b/packages/products/tdesign-vue-next/src/tree/tree.en-US.md @@ -110,6 +110,7 @@ name | type | default | description | required actived | Boolean | - | required | Y checked | Boolean | - | required | Y data | Object | - | required。node data, extends `TreeOptionData`。Typescript:`T` | Y +disabled | Boolean | - | required。node disabled state | Y expanded | Boolean | - | required | Y indeterminate | Boolean | - | required | Y loading | Boolean | - | required | Y diff --git a/packages/products/tdesign-vue-next/src/tree/tree.md b/packages/products/tdesign-vue-next/src/tree/tree.md index 979609c72..592ddb259 100644 --- a/packages/products/tdesign-vue-next/src/tree/tree.md +++ b/packages/products/tdesign-vue-next/src/tree/tree.md @@ -110,6 +110,7 @@ visible | Boolean | false | 节点是否可视 | N actived | Boolean | - | 必需。当前节点是否处于高亮激活态 | Y checked | Boolean | - | 必需。当前节点是否被选中 | Y data | Object | - | 必需。节点数据,泛型 `T` 表示树节点 TS 类型,继承 `TreeOptionData`。TS 类型:`T` | Y +disabled | Boolean | - | 必需。禁用状态 | Y expanded | Boolean | - | 必需。当前节点是否展开 | Y indeterminate | Boolean | - | 必需。当前节点是否处于半选状态 | Y loading | Boolean | - | 必需。当前节点是否处于加载中状态 | Y diff --git a/packages/products/tdesign-vue-next/src/tree/type.ts b/packages/products/tdesign-vue-next/src/tree/type.ts index 9c9a005e1..0c79e2a6c 100644 --- a/packages/products/tdesign-vue-next/src/tree/type.ts +++ b/packages/products/tdesign-vue-next/src/tree/type.ts @@ -376,6 +376,10 @@ export interface TreeNodeModel extend * 节点数据,泛型 `T` 表示树节点 TS 类型,继承 `TreeOptionData` */ data: T; + /** + * 禁用状态 + */ + disabled: boolean; /** * 当前节点是否展开 */ diff --git a/packages/products/tdesign-vue/src/common.ts b/packages/products/tdesign-vue/src/common.ts index 1e35eb7ba..2496ae479 100644 --- a/packages/products/tdesign-vue/src/common.ts +++ b/packages/products/tdesign-vue/src/common.ts @@ -113,7 +113,7 @@ export type InfinityScroll = TScroll; export interface ScrollToElementParams { /** 跳转元素下标 */ - index: number; + index?: number; /** 跳转元素距离顶部的距离 */ top?: number; /** 单个元素高度非固定场景下,即 isFixedRowHeight = false。延迟设置元素位置,一般用于依赖不同高度异步渲染等场景,单位:毫秒 */ @@ -122,5 +122,5 @@ export interface ScrollToElementParams { } export interface ComponentScrollToElementParams extends ScrollToElementParams { - key: string | number; + key?: string | number; } diff --git a/packages/products/tdesign-vue/src/tree/tree.en-US.md b/packages/products/tdesign-vue/src/tree/tree.en-US.md index e59e2434d..80e87f811 100644 --- a/packages/products/tdesign-vue/src/tree/tree.en-US.md +++ b/packages/products/tdesign-vue/src/tree/tree.en-US.md @@ -110,6 +110,7 @@ name | type | default | description | required actived | Boolean | - | required | Y checked | Boolean | - | required | Y data | Object | - | required。node data, extends `TreeOptionData`。Typescript:`T` | Y +disabled | Boolean | - | required。node disabled state | Y expanded | Boolean | - | required | Y indeterminate | Boolean | - | required | Y loading | Boolean | - | required | Y diff --git a/packages/products/tdesign-vue/src/tree/tree.md b/packages/products/tdesign-vue/src/tree/tree.md index 1d3d1d939..a54645c45 100644 --- a/packages/products/tdesign-vue/src/tree/tree.md +++ b/packages/products/tdesign-vue/src/tree/tree.md @@ -110,6 +110,7 @@ visible | Boolean | false | 节点是否可视 | N actived | Boolean | - | 必需。当前节点是否处于高亮激活态 | Y checked | Boolean | - | 必需。当前节点是否被选中 | Y data | Object | - | 必需。节点数据,泛型 `T` 表示树节点 TS 类型,继承 `TreeOptionData`。TS 类型:`T` | Y +disabled | Boolean | - | 必需。禁用状态 | Y expanded | Boolean | - | 必需。当前节点是否展开 | Y indeterminate | Boolean | - | 必需。当前节点是否处于半选状态 | Y loading | Boolean | - | 必需。当前节点是否处于加载中状态 | Y diff --git a/packages/products/tdesign-vue/src/tree/type.ts b/packages/products/tdesign-vue/src/tree/type.ts index 0e15336eb..e0de332c8 100644 --- a/packages/products/tdesign-vue/src/tree/type.ts +++ b/packages/products/tdesign-vue/src/tree/type.ts @@ -371,6 +371,10 @@ export interface TreeNodeModel extend * 节点数据,泛型 `T` 表示树节点 TS 类型,继承 `TreeOptionData` */ data: T; + /** + * 禁用状态 + */ + disabled: boolean; /** * 当前节点是否展开 */ diff --git a/packages/scripts/api.json b/packages/scripts/api.json index d11fe800a..968eb31bc 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -111623,6 +111623,47 @@ "Object" ] }, + { + "id": 1701315118, + "platform_framework": [ + "1", + "2", + "4" + ], + "component": "TreeNodeModel", + "field_category": 1, + "field_name": "disabled", + "field_type": [ + "4" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "禁用状态", + "field_desc_en": "node disabled state", + "field_required": 1, + "event_input": "", + "create_time": "2023-11-30 03:31:58", + "update_time": "2023-11-30 03:31: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)", + "Angular(PC)" + ], + "field_type_text": [ + "Boolean" + ] + }, { "id": 718, "platform_framework": [ diff --git a/packages/scripts/types/global/base.tpl b/packages/scripts/types/global/base.tpl index ba915abac..327760bfa 100644 --- a/packages/scripts/types/global/base.tpl +++ b/packages/scripts/types/global/base.tpl @@ -78,7 +78,7 @@ export type InfinityScroll = TScroll; export interface ScrollToElementParams { /** 跳转元素下标 */ - index: number; + index?: number; /** 跳转元素距离顶部的距离 */ top?: number; /** 单个元素高度非固定场景下,即 isFixedRowHeight = false。延迟设置元素位置,一般用于依赖不同高度异步渲染等场景,单位:毫秒 */ @@ -87,5 +87,5 @@ export interface ScrollToElementParams { } export interface ComponentScrollToElementParams extends ScrollToElementParams { - key: string | number; + key?: string | number; }