Skip to content

Commit

Permalink
feat: add disabled to TreeNodeModel
Browse files Browse the repository at this point in the history
  • Loading branch information
chaishi committed Nov 30, 2023
1 parent 5124ae4 commit 5713da7
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 8 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/products/tdesign-react/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export type InfinityScroll = TScroll;

export interface ScrollToElementParams {
/** 跳转元素下标 */
index: number;
index?: number;
/** 跳转元素距离顶部的距离 */
top?: number;
/** 单个元素高度非固定场景下,即 isFixedRowHeight = false。延迟设置元素位置,一般用于依赖不同高度异步渲染等场景,单位:毫秒 */
Expand All @@ -124,5 +124,5 @@ export interface ScrollToElementParams {
}

export interface ComponentScrollToElementParams extends ScrollToElementParams {
key: string | number;
key?: string | number;
}
1 change: 1 addition & 0 deletions packages/products/tdesign-react/src/tree/tree.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/products/tdesign-react/src/tree/tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions packages/products/tdesign-react/src/tree/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ export interface TreeNodeModel<T extends TreeOptionData = TreeOptionData> extend
* 节点数据,泛型 `T` 表示树节点 TS 类型,继承 `TreeOptionData`
*/
data: T;
/**
* 禁用状态
*/
disabled: boolean;
/**
* 当前节点是否展开
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/products/tdesign-vue-next/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export type InfinityScroll = TScroll;

export interface ScrollToElementParams {
/** 跳转元素下标 */
index: number;
index?: number;
/** 跳转元素距离顶部的距离 */
top?: number;
/** 单个元素高度非固定场景下,即 isFixedRowHeight = false。延迟设置元素位置,一般用于依赖不同高度异步渲染等场景,单位:毫秒 */
Expand All @@ -128,5 +128,5 @@ export interface ScrollToElementParams {
}

export interface ComponentScrollToElementParams extends ScrollToElementParams {
key: string | number;
key?: string | number;
}
1 change: 1 addition & 0 deletions packages/products/tdesign-vue-next/src/tree/tree.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/products/tdesign-vue-next/src/tree/tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions packages/products/tdesign-vue-next/src/tree/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ export interface TreeNodeModel<T extends TreeOptionData = TreeOptionData> extend
* 节点数据,泛型 `T` 表示树节点 TS 类型,继承 `TreeOptionData`
*/
data: T;
/**
* 禁用状态
*/
disabled: boolean;
/**
* 当前节点是否展开
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/products/tdesign-vue/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export type InfinityScroll = TScroll;

export interface ScrollToElementParams {
/** 跳转元素下标 */
index: number;
index?: number;
/** 跳转元素距离顶部的距离 */
top?: number;
/** 单个元素高度非固定场景下,即 isFixedRowHeight = false。延迟设置元素位置,一般用于依赖不同高度异步渲染等场景,单位:毫秒 */
Expand All @@ -122,5 +122,5 @@ export interface ScrollToElementParams {
}

export interface ComponentScrollToElementParams extends ScrollToElementParams {
key: string | number;
key?: string | number;
}
1 change: 1 addition & 0 deletions packages/products/tdesign-vue/src/tree/tree.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/products/tdesign-vue/src/tree/tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions packages/products/tdesign-vue/src/tree/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@ export interface TreeNodeModel<T extends TreeOptionData = TreeOptionData> extend
* 节点数据,泛型 `T` 表示树节点 TS 类型,继承 `TreeOptionData`
*/
data: T;
/**
* 禁用状态
*/
disabled: boolean;
/**
* 当前节点是否展开
*/
Expand Down
41 changes: 41 additions & 0 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
4 changes: 2 additions & 2 deletions packages/scripts/types/global/base.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export type InfinityScroll = TScroll;

export interface ScrollToElementParams {
/** 跳转元素下标 */
index: number;
index?: number;
/** 跳转元素距离顶部的距离 */
top?: number;
/** 单个元素高度非固定场景下,即 isFixedRowHeight = false。延迟设置元素位置,一般用于依赖不同高度异步渲染等场景,单位:毫秒 */
Expand All @@ -87,5 +87,5 @@ export interface ScrollToElementParams {
}

export interface ComponentScrollToElementParams extends ScrollToElementParams {
key: string | number;
key?: string | number;
}

0 comments on commit 5713da7

Please sign in to comment.