@hi-ui/tree-select 4.3.1 → 4.4.0
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.
- package/CHANGELOG.md +11 -0
- package/lib/cjs/TreeSelect.js +4 -2
- package/lib/esm/TreeSelect.js +4 -2
- package/lib/types/TreeSelect.d.ts +4 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @hi-ui/tree-select
|
|
2
2
|
|
|
3
|
+
## 4.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#3472](https://github.com/XiaoMi/hiui/pull/3472) [`1fae66f2d`](https://github.com/XiaoMi/hiui/commit/1fae66f2d10e4b3eba30e2af74bc793af91061d0) Thanks [@zyprepare](https://github.com/zyprepare)! - feat(tree): add shouldShowSwitcher prop for custom switcher display logic (#3471)
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`1fae66f2d`](https://github.com/XiaoMi/hiui/commit/1fae66f2d10e4b3eba30e2af74bc793af91061d0)]:
|
|
12
|
+
- @hi-ui/tree@4.7.0
|
|
13
|
+
|
|
3
14
|
## 4.3.1
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/lib/cjs/TreeSelect.js
CHANGED
|
@@ -89,7 +89,8 @@ var TreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
89
89
|
prefix = _a.prefix,
|
|
90
90
|
suffix = _a.suffix,
|
|
91
91
|
customRender = _a.customRender,
|
|
92
|
-
|
|
92
|
+
shouldShowSwitcher = _a.shouldShowSwitcher,
|
|
93
|
+
rest = tslib.__rest(_a, ["prefixCls", "role", "className", "data", "dataSource", "disabled", "visible", "onOpen", "onClose", "fieldNames", "defaultExpandAll", "expandedIds", "defaultExpandedIds", "onExpand", "defaultValue", "value", "onChange", "searchable", "searchMode", "onLoadChildren", "render", "filterOption", "keyword", "onSearch", "clearable", "onClear", "invalid", "displayRender", "placeholder", "appearance", "virtual", "itemHeight", "height", "size", "prefix", "suffix", "customRender", "shouldShowSwitcher"]);
|
|
93
94
|
var i18n = core.useLocaleContext();
|
|
94
95
|
var pickerInnerRef = React.useRef(null);
|
|
95
96
|
var placeholder = typeAssertion.isUndef(placeholderProp) ? i18n.get('treeSelect.placeholder') : placeholderProp;
|
|
@@ -277,7 +278,8 @@ var TreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
277
278
|
onLoadChildren: onLoadChildren,
|
|
278
279
|
virtual: virtual,
|
|
279
280
|
itemHeight: itemHeight,
|
|
280
|
-
height: height
|
|
281
|
+
height: height,
|
|
282
|
+
shouldShowSwitcher: shouldShowSwitcher
|
|
281
283
|
}, treeProps))) : null);
|
|
282
284
|
});
|
|
283
285
|
if (env.__DEV__) {
|
package/lib/esm/TreeSelect.js
CHANGED
|
@@ -77,7 +77,8 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
77
77
|
prefix = _a.prefix,
|
|
78
78
|
suffix = _a.suffix,
|
|
79
79
|
customRender = _a.customRender,
|
|
80
|
-
|
|
80
|
+
shouldShowSwitcher = _a.shouldShowSwitcher,
|
|
81
|
+
rest = __rest(_a, ["prefixCls", "role", "className", "data", "dataSource", "disabled", "visible", "onOpen", "onClose", "fieldNames", "defaultExpandAll", "expandedIds", "defaultExpandedIds", "onExpand", "defaultValue", "value", "onChange", "searchable", "searchMode", "onLoadChildren", "render", "filterOption", "keyword", "onSearch", "clearable", "onClear", "invalid", "displayRender", "placeholder", "appearance", "virtual", "itemHeight", "height", "size", "prefix", "suffix", "customRender", "shouldShowSwitcher"]);
|
|
81
82
|
var i18n = useLocaleContext();
|
|
82
83
|
var pickerInnerRef = useRef(null);
|
|
83
84
|
var placeholder = isUndef(placeholderProp) ? i18n.get('treeSelect.placeholder') : placeholderProp;
|
|
@@ -265,7 +266,8 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
265
266
|
onLoadChildren: onLoadChildren,
|
|
266
267
|
virtual: virtual,
|
|
267
268
|
itemHeight: itemHeight,
|
|
268
|
-
height: height
|
|
269
|
+
height: height,
|
|
270
|
+
shouldShowSwitcher: shouldShowSwitcher
|
|
269
271
|
}, treeProps))) : null);
|
|
270
272
|
});
|
|
271
273
|
if (__DEV__) {
|
|
@@ -140,4 +140,8 @@ export interface TreeSelectProps extends Omit<PickerProps, 'data' | 'onChange' |
|
|
|
140
140
|
* 自定义触发器
|
|
141
141
|
*/
|
|
142
142
|
customRender?: React.ReactNode | ((selectedItem: TreeSelectDataItem | null) => React.ReactNode);
|
|
143
|
+
/**
|
|
144
|
+
* 自定义切换器显示逻辑
|
|
145
|
+
*/
|
|
146
|
+
shouldShowSwitcher?: (node: TreeNodeEventData) => boolean;
|
|
143
147
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hi-ui/tree-select",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "HiUI <mi-hiui@xiaomi.com>",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@hi-ui/input": "^4.4.0",
|
|
53
53
|
"@hi-ui/picker": "^4.1.8",
|
|
54
54
|
"@hi-ui/popper": "^4.1.7",
|
|
55
|
-
"@hi-ui/tree": "^4.
|
|
55
|
+
"@hi-ui/tree": "^4.7.0",
|
|
56
56
|
"@hi-ui/tree-utils": "^4.1.4",
|
|
57
57
|
"@hi-ui/type-assertion": "^4.0.4",
|
|
58
58
|
"@hi-ui/use-data-source": "^4.0.4",
|