@hi-ui/tree-select 4.0.0-beta.30 → 4.0.0-beta.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,7 +100,10 @@ var TreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
100
100
  displayRenderProp = _a.displayRender,
101
101
  placeholderProp = _a.placeholder,
102
102
  appearance = _a.appearance,
103
- rest = tslib.__rest(_a, ["prefixCls", "role", "className", "data", "dataSource", "disabled", "onOpen", "onClose", "fieldNames", "defaultExpandAll", "expandedIds", "defaultExpandedIds", "onExpand", "defaultValue", "value", "onChange", "searchable", "searchMode", "onLoadChildren", "render", "filterOption", "onSearch", "clearable", "invalid", "displayRender", "placeholder", "appearance"]);
103
+ virtual = _a.virtual,
104
+ itemHeight = _a.itemHeight,
105
+ height = _a.height,
106
+ rest = tslib.__rest(_a, ["prefixCls", "role", "className", "data", "dataSource", "disabled", "onOpen", "onClose", "fieldNames", "defaultExpandAll", "expandedIds", "defaultExpandedIds", "onExpand", "defaultValue", "value", "onChange", "searchable", "searchMode", "onLoadChildren", "render", "filterOption", "onSearch", "clearable", "invalid", "displayRender", "placeholder", "appearance", "virtual", "itemHeight", "height"]);
104
107
 
105
108
  var i18n = localeContext.useLocaleContext();
106
109
  var placeholder = typeAssertion.isUndef(placeholderProp) ? i18n.get('treeSelect.placeholder') : placeholderProp;
@@ -282,8 +285,11 @@ var TreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
282
285
  onSelect: onSelect,
283
286
  // onLoadChildren 缓存数据
284
287
  // TODO: 支持 fieldNames
285
- // 禁用时被选中的样式处理
286
- onLoadChildren: onLoadChildren
288
+ // @ts-ignore
289
+ onLoadChildren: onLoadChildren,
290
+ virtual: virtual,
291
+ itemHeight: itemHeight,
292
+ height: height
287
293
  }, treeProps)) : null);
288
294
  });
289
295
 
@@ -67,7 +67,10 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
67
67
  displayRenderProp = _a.displayRender,
68
68
  placeholderProp = _a.placeholder,
69
69
  appearance = _a.appearance,
70
- rest = __rest(_a, ["prefixCls", "role", "className", "data", "dataSource", "disabled", "onOpen", "onClose", "fieldNames", "defaultExpandAll", "expandedIds", "defaultExpandedIds", "onExpand", "defaultValue", "value", "onChange", "searchable", "searchMode", "onLoadChildren", "render", "filterOption", "onSearch", "clearable", "invalid", "displayRender", "placeholder", "appearance"]);
70
+ virtual = _a.virtual,
71
+ itemHeight = _a.itemHeight,
72
+ height = _a.height,
73
+ rest = __rest(_a, ["prefixCls", "role", "className", "data", "dataSource", "disabled", "onOpen", "onClose", "fieldNames", "defaultExpandAll", "expandedIds", "defaultExpandedIds", "onExpand", "defaultValue", "value", "onChange", "searchable", "searchMode", "onLoadChildren", "render", "filterOption", "onSearch", "clearable", "invalid", "displayRender", "placeholder", "appearance", "virtual", "itemHeight", "height"]);
71
74
 
72
75
  var i18n = useLocaleContext();
73
76
  var placeholder = isUndef(placeholderProp) ? i18n.get('treeSelect.placeholder') : placeholderProp;
@@ -249,8 +252,11 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
249
252
  onSelect: onSelect,
250
253
  // onLoadChildren 缓存数据
251
254
  // TODO: 支持 fieldNames
252
- // 禁用时被选中的样式处理
253
- onLoadChildren: onLoadChildren
255
+ // @ts-ignore
256
+ onLoadChildren: onLoadChildren,
257
+ virtual: virtual,
258
+ itemHeight: itemHeight,
259
+ height: height
254
260
  }, treeProps)) : null);
255
261
  });
256
262
 
@@ -113,4 +113,18 @@ export interface TreeSelectProps extends Omit<PickerProps, 'data' | 'onChange' |
113
113
  * 设置展现形式
114
114
  */
115
115
  appearance?: HiBaseAppearanceEnum;
116
+ /**
117
+ * 设置虚拟滚动容器的可视高度。暂不对外暴露
118
+ * @private
119
+ */
120
+ height?: number;
121
+ /**
122
+ * 设置虚拟列表每项的固定高度。暂不对外暴露
123
+ * @private
124
+ */
125
+ itemHeight?: number;
126
+ /**
127
+ * 设置 `true` 开启虚拟滚动
128
+ */
129
+ virtual?: boolean;
116
130
  }
@@ -3,11 +3,11 @@ export interface TreeSelectDataItem {
3
3
  /**
4
4
  * 节点唯一 id
5
5
  */
6
- id: React.ReactText;
6
+ id?: React.ReactText;
7
7
  /**
8
8
  * 节点标题
9
9
  */
10
- title: React.ReactNode;
10
+ title?: React.ReactNode;
11
11
  /**
12
12
  * 子级数据
13
13
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/tree-select",
3
- "version": "4.0.0-beta.30",
3
+ "version": "4.0.0-beta.33",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HIUI <mi-hiui@xiaomi.com>",
@@ -48,18 +48,18 @@
48
48
  "@hi-ui/core": "^4.0.0-beta.8",
49
49
  "@hi-ui/core-css": "^4.0.0-beta.5",
50
50
  "@hi-ui/env": "^4.0.0-beta.0",
51
- "@hi-ui/func-utils": "^4.0.0-beta.11",
52
- "@hi-ui/highlighter": "^4.0.0-beta.8",
51
+ "@hi-ui/func-utils": "^4.0.0-beta.12",
52
+ "@hi-ui/highlighter": "^4.0.0-beta.9",
53
53
  "@hi-ui/icons": "^4.0.0-beta.10",
54
- "@hi-ui/input": "^4.0.0-beta.13",
55
- "@hi-ui/locale-context": "^4.0.0-beta.17",
56
- "@hi-ui/picker": "^4.0.0-beta.22",
57
- "@hi-ui/popper": "^4.0.0-beta.12",
58
- "@hi-ui/tree": "^4.0.0-beta.28",
54
+ "@hi-ui/input": "^4.0.0-beta.15",
55
+ "@hi-ui/locale-context": "^4.0.0-beta.18",
56
+ "@hi-ui/picker": "^4.0.0-beta.24",
57
+ "@hi-ui/popper": "^4.0.0-beta.14",
58
+ "@hi-ui/tree": "^4.0.0-beta.31",
59
59
  "@hi-ui/tree-utils": "^4.0.0-beta.4",
60
60
  "@hi-ui/type-assertion": "^4.0.0-beta.4",
61
61
  "@hi-ui/use-data-source": "^4.0.0-beta.5",
62
- "@hi-ui/use-search-mode": "^4.0.0-beta.17",
62
+ "@hi-ui/use-search-mode": "^4.0.0-beta.19",
63
63
  "@hi-ui/use-toggle": "^4.0.0-beta.4",
64
64
  "@hi-ui/use-uncontrolled-state": "^4.0.0-beta.4"
65
65
  },
@@ -72,5 +72,5 @@
72
72
  "react": "^17.0.1",
73
73
  "react-dom": "^17.0.1"
74
74
  },
75
- "gitHead": "798e91b8086b524e9ef1df8fef404bbf284198f5"
75
+ "gitHead": "64cc3305632f0d88f852f4a95cba7c27ff388a2d"
76
76
  }