@hi-ui/tree-select 4.2.1 → 5.0.0-canary.1
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 +46 -0
- package/lib/cjs/TreeSelect.js +8 -5
- package/lib/esm/TreeSelect.js +8 -5
- package/lib/types/TreeSelect.d.ts +7 -3
- package/lib/types/types.d.ts +2 -1
- package/package.json +22 -21
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,51 @@
|
|
1
1
|
# @hi-ui/tree-select
|
2
2
|
|
3
|
+
## 5.0.0-canary.1
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- 6c4bf35af: feat: 下拉选择类组件 appearance 参数增加 contained 类型 (5.0)
|
8
|
+
|
9
|
+
### Patch Changes
|
10
|
+
|
11
|
+
- Updated dependencies [6c4bf35af]
|
12
|
+
- @hi-ui/input@5.0.0-canary.2
|
13
|
+
|
14
|
+
## 5.0.0-canary.0
|
15
|
+
|
16
|
+
### Major Changes
|
17
|
+
|
18
|
+
- 225ebaa51: feat: 组件的 package.json 中的 exports 统一加上 types 配置 (5.0)
|
19
|
+
|
20
|
+
### Minor Changes
|
21
|
+
|
22
|
+
- 428716024: <br>
|
23
|
+
- feat(picker): 下拉选择类组件增加 xs 尺寸 (5.0)
|
24
|
+
- feat(input): 输入框组件增加 xs 尺寸 (5.0)
|
25
|
+
|
26
|
+
### Patch Changes
|
27
|
+
|
28
|
+
- Updated dependencies [428716024]
|
29
|
+
- Updated dependencies [225ebaa51]
|
30
|
+
- Updated dependencies [428716024]
|
31
|
+
- @hi-ui/input@5.0.0-canary.0
|
32
|
+
- @hi-ui/picker@5.0.0-canary.0
|
33
|
+
- @hi-ui/core@5.0.0-canary.0
|
34
|
+
- @hi-ui/use-data-source@5.0.0-canary.0
|
35
|
+
- @hi-ui/use-search-mode@5.0.0-canary.0
|
36
|
+
- @hi-ui/use-toggle@5.0.0-canary.0
|
37
|
+
- @hi-ui/use-uncontrolled-state@5.0.0-canary.0
|
38
|
+
- @hi-ui/icons@5.0.0-canary.0
|
39
|
+
- @hi-ui/highlighter@5.0.0-canary.0
|
40
|
+
- @hi-ui/popper@5.0.0-canary.0
|
41
|
+
- @hi-ui/tree@5.0.0-canary.0
|
42
|
+
- @hi-ui/array-utils@5.0.0-canary.0
|
43
|
+
- @hi-ui/classname@5.0.0-canary.0
|
44
|
+
- @hi-ui/env@5.0.0-canary.0
|
45
|
+
- @hi-ui/func-utils@5.0.0-canary.0
|
46
|
+
- @hi-ui/tree-utils@5.0.0-canary.0
|
47
|
+
- @hi-ui/type-assertion@5.0.0-canary.0
|
48
|
+
|
3
49
|
## 4.2.1
|
4
50
|
|
5
51
|
### Patch Changes
|
package/lib/cjs/TreeSelect.js
CHANGED
@@ -88,7 +88,8 @@ var TreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
88
88
|
prefix = _a.prefix,
|
89
89
|
suffix = _a.suffix,
|
90
90
|
customRender = _a.customRender,
|
91
|
-
|
91
|
+
label = _a.label,
|
92
|
+
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", "invalid", "displayRender", "placeholder", "appearance", "virtual", "itemHeight", "height", "size", "prefix", "suffix", "customRender", "label"]);
|
92
93
|
var i18n = core.useLocaleContext();
|
93
94
|
var placeholder = typeAssertion.isUndef(placeholderProp) ? i18n.get('treeSelect.placeholder') : placeholderProp;
|
94
95
|
var _useUncontrolledToggl = useToggle.useUncontrolledToggle({
|
@@ -236,9 +237,10 @@ var TreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
236
237
|
keyword: keywordProp,
|
237
238
|
onSearch: funcUtils.callAllFuncs(onSearchProp, onSearch),
|
238
239
|
loading: rest.loading !== undefined ? rest.loading : loading,
|
239
|
-
trigger: customRender ? typeof customRender === 'function' ? customRender(selectedItem) : customRender : ( /*#__PURE__*/React__default["default"].createElement(input.MockInput
|
240
|
-
|
241
|
-
|
240
|
+
trigger: customRender ? typeof customRender === 'function' ? customRender(selectedItem) : customRender : ( /*#__PURE__*/React__default["default"].createElement(input.MockInput, {
|
241
|
+
style: {
|
242
|
+
maxWidth: appearance === 'contained' ? '360px' : undefined
|
243
|
+
},
|
242
244
|
// disabled={disabled}
|
243
245
|
size: size,
|
244
246
|
clearable: clearable,
|
@@ -252,7 +254,8 @@ var TreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
252
254
|
data: mergedData,
|
253
255
|
// @ts-ignore
|
254
256
|
invalid: invalid,
|
255
|
-
appearance: appearance
|
257
|
+
appearance: appearance,
|
258
|
+
label: label
|
256
259
|
}))
|
257
260
|
}), typeAssertion.isArrayNonEmpty(treeProps.data) ? ( /*#__PURE__*/React__default["default"].createElement(tree.Tree, Object.assign({
|
258
261
|
size: 'md',
|
package/lib/esm/TreeSelect.js
CHANGED
@@ -76,7 +76,8 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
76
76
|
prefix = _a.prefix,
|
77
77
|
suffix = _a.suffix,
|
78
78
|
customRender = _a.customRender,
|
79
|
-
|
79
|
+
label = _a.label,
|
80
|
+
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", "invalid", "displayRender", "placeholder", "appearance", "virtual", "itemHeight", "height", "size", "prefix", "suffix", "customRender", "label"]);
|
80
81
|
var i18n = useLocaleContext();
|
81
82
|
var placeholder = isUndef(placeholderProp) ? i18n.get('treeSelect.placeholder') : placeholderProp;
|
82
83
|
var _useUncontrolledToggl = useUncontrolledToggle({
|
@@ -224,9 +225,10 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
224
225
|
keyword: keywordProp,
|
225
226
|
onSearch: callAllFuncs(onSearchProp, onSearch),
|
226
227
|
loading: rest.loading !== undefined ? rest.loading : loading,
|
227
|
-
trigger: customRender ? typeof customRender === 'function' ? customRender(selectedItem) : customRender : ( /*#__PURE__*/React.createElement(MockInput
|
228
|
-
|
229
|
-
|
228
|
+
trigger: customRender ? typeof customRender === 'function' ? customRender(selectedItem) : customRender : ( /*#__PURE__*/React.createElement(MockInput, {
|
229
|
+
style: {
|
230
|
+
maxWidth: appearance === 'contained' ? '360px' : undefined
|
231
|
+
},
|
230
232
|
// disabled={disabled}
|
231
233
|
size: size,
|
232
234
|
clearable: clearable,
|
@@ -240,7 +242,8 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
240
242
|
data: mergedData,
|
241
243
|
// @ts-ignore
|
242
244
|
invalid: invalid,
|
243
|
-
appearance: appearance
|
245
|
+
appearance: appearance,
|
246
|
+
label: label
|
244
247
|
}))
|
245
248
|
}), isArrayNonEmpty(treeProps.data) ? ( /*#__PURE__*/React.createElement(Tree, Object.assign({
|
246
249
|
size: 'md',
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { TreeSelectDataItem } from './types';
|
2
|
+
import { TreeSelectDataItem, TreeSelectAppearanceEnum } from './types';
|
3
3
|
import { TreeNodeEventData } from '@hi-ui/tree';
|
4
4
|
import { PickerProps } from '@hi-ui/picker';
|
5
|
-
import {
|
5
|
+
import { HiBaseSizeEnum } from '@hi-ui/core';
|
6
6
|
import { UseDataSource } from '@hi-ui/use-data-source';
|
7
7
|
/**
|
8
8
|
* 树形选择器
|
@@ -105,7 +105,11 @@ export interface TreeSelectProps extends Omit<PickerProps, 'data' | 'onChange' |
|
|
105
105
|
/**
|
106
106
|
* 设置展现形式
|
107
107
|
*/
|
108
|
-
appearance?:
|
108
|
+
appearance?: TreeSelectAppearanceEnum;
|
109
|
+
/**
|
110
|
+
* 设置输入框 label 内容,仅在 appearance 为 contained 时生效
|
111
|
+
*/
|
112
|
+
label?: React.ReactNode;
|
109
113
|
/**
|
110
114
|
* 设置虚拟滚动容器的可视高度。暂不对外暴露
|
111
115
|
* @private
|
package/lib/types/types.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { HiBaseDataItem } from '@hi-ui/core';
|
1
|
+
import { HiBaseAppearanceEnum, HiBaseDataItem } from '@hi-ui/core';
|
2
2
|
import React from 'react';
|
3
3
|
export interface TreeSelectDataItem extends HiBaseDataItem {
|
4
4
|
/**
|
@@ -48,3 +48,4 @@ export interface TreeSelectDataSource<T = any> {
|
|
48
48
|
*/
|
49
49
|
transformResponse?: (response: object) => T;
|
50
50
|
}
|
51
|
+
export declare type TreeSelectAppearanceEnum = HiBaseAppearanceEnum | 'contained' | undefined;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hi-ui/tree-select",
|
3
|
-
"version": "
|
3
|
+
"version": "5.0.0-canary.1",
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
5
5
|
"keywords": [],
|
6
6
|
"author": "HiUI <mi-hiui@xiaomi.com>",
|
@@ -20,7 +20,8 @@
|
|
20
20
|
"exports": {
|
21
21
|
".": {
|
22
22
|
"require": "./lib/cjs/index.js",
|
23
|
-
"default": "./lib/esm/index.js"
|
23
|
+
"default": "./lib/esm/index.js",
|
24
|
+
"types": "./lib/types/index.d.ts"
|
24
25
|
}
|
25
26
|
},
|
26
27
|
"publishConfig": {
|
@@ -43,31 +44,31 @@
|
|
43
44
|
"url": "https://github.com/XiaoMi/hiui/issues"
|
44
45
|
},
|
45
46
|
"dependencies": {
|
46
|
-
"@hi-ui/array-utils": "^
|
47
|
-
"@hi-ui/classname": "^
|
48
|
-
"@hi-ui/env": "^
|
49
|
-
"@hi-ui/func-utils": "^
|
50
|
-
"@hi-ui/highlighter": "^
|
51
|
-
"@hi-ui/icons": "^
|
52
|
-
"@hi-ui/input": "^
|
53
|
-
"@hi-ui/picker": "^
|
54
|
-
"@hi-ui/popper": "^
|
55
|
-
"@hi-ui/tree": "^
|
56
|
-
"@hi-ui/tree-utils": "^
|
57
|
-
"@hi-ui/type-assertion": "^
|
58
|
-
"@hi-ui/use-data-source": "^
|
59
|
-
"@hi-ui/use-search-mode": "^
|
60
|
-
"@hi-ui/use-toggle": "^
|
61
|
-
"@hi-ui/use-uncontrolled-state": "^
|
47
|
+
"@hi-ui/array-utils": "^5.0.0-canary.0",
|
48
|
+
"@hi-ui/classname": "^5.0.0-canary.0",
|
49
|
+
"@hi-ui/env": "^5.0.0-canary.0",
|
50
|
+
"@hi-ui/func-utils": "^5.0.0-canary.0",
|
51
|
+
"@hi-ui/highlighter": "^5.0.0-canary.0",
|
52
|
+
"@hi-ui/icons": "^5.0.0-canary.0",
|
53
|
+
"@hi-ui/input": "^5.0.0-canary.2",
|
54
|
+
"@hi-ui/picker": "^5.0.0-canary.0",
|
55
|
+
"@hi-ui/popper": "^5.0.0-canary.0",
|
56
|
+
"@hi-ui/tree": "^5.0.0-canary.0",
|
57
|
+
"@hi-ui/tree-utils": "^5.0.0-canary.0",
|
58
|
+
"@hi-ui/type-assertion": "^5.0.0-canary.0",
|
59
|
+
"@hi-ui/use-data-source": "^5.0.0-canary.0",
|
60
|
+
"@hi-ui/use-search-mode": "^5.0.0-canary.0",
|
61
|
+
"@hi-ui/use-toggle": "^5.0.0-canary.0",
|
62
|
+
"@hi-ui/use-uncontrolled-state": "^5.0.0-canary.0"
|
62
63
|
},
|
63
64
|
"peerDependencies": {
|
64
|
-
"@hi-ui/core": ">=
|
65
|
+
"@hi-ui/core": ">=5.0.0-canary.0",
|
65
66
|
"react": ">=16.8.6",
|
66
67
|
"react-dom": ">=16.8.6"
|
67
68
|
},
|
68
69
|
"devDependencies": {
|
69
|
-
"@hi-ui/core": "^
|
70
|
-
"@hi-ui/core-css": "^
|
70
|
+
"@hi-ui/core": "^5.0.0-canary.0",
|
71
|
+
"@hi-ui/core-css": "^5.0.0-canary.0",
|
71
72
|
"react": "^17.0.1",
|
72
73
|
"react-dom": "^17.0.1"
|
73
74
|
}
|