@hi-ui/check-select 4.6.3 → 5.0.0-alpha.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 +102 -0
- package/lib/cjs/CheckSelect.js +55 -28
- package/lib/cjs/styles/index.scss.js +1 -1
- package/lib/esm/CheckSelect.js +57 -30
- package/lib/esm/styles/index.scss.js +1 -1
- package/lib/types/CheckSelect.d.ts +22 -2
- package/lib/types/types.d.ts +1 -1
- package/package.json +29 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,107 @@
|
|
|
1
1
|
# @hi-ui/check-select
|
|
2
2
|
|
|
3
|
+
## 5.0.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 1b05b44a4: feat: 组件的 package.json 中的 exports 统一加上 types 配置 (5.0)
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 77ed66eac: <br>
|
|
12
|
+
- feat(picker): 下拉选择类组件增加 xs 尺寸 (5.0)
|
|
13
|
+
- feat(input): 输入框组件增加 xs 尺寸 (5.0)
|
|
14
|
+
- 632dbda3a: feat: 下拉选择组件增加 showIndicator 参数 & 修改 appearance 中的 unset 样式 (5.0)
|
|
15
|
+
- 1b51c1bbe: feat: 下拉选择类组件 appearance 参数增加 contained 类型 (5.0)
|
|
16
|
+
- 6eac4b78b: feat: 输入框和选择器组件增加 borderless 形态 (5.0)
|
|
17
|
+
- df25ec39b: feat(select): 增加 creatableInSearch、createTitle 参数,支持在搜索无结果时可创建选项 (5.0)
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- eb5506b8d: style(picker): 移除 picker 组件中的 \_\_text 样式定义 (5.0)
|
|
22
|
+
- 958805d8b: fix(tag-input): 修复 contained 模式下 displayRender 设置无效问题 (5.0)
|
|
23
|
+
- c3ec579cd: fix: 修改组件问题 (5.0)
|
|
24
|
+
- 8116f0304: fix: 修改 UI 问题 (5.0)
|
|
25
|
+
- cfaf8c48d: perf: 对下拉选择类组件的 customRender 的内容增加 memoization 以优化性能 (5.0)
|
|
26
|
+
- 61d132802: build: 将 package.json 中 exports 配置中的 types 配置放在最上面 (5.0)
|
|
27
|
+
- e39572f8f: style(tag-input): 增加 flex-wrap 属性以优化标签换行展示 (5.0)
|
|
28
|
+
- 9f2ee08cf: <br>
|
|
29
|
+
- style(tag-input): 间距调整 (5.0)
|
|
30
|
+
- style(select): 选择类组件选项圆角改为 4px (5.0)
|
|
31
|
+
- style(picker): 搜索框样式调整 (5.0)
|
|
32
|
+
- 85bb84874: style: 统一调整选择类组件 hover 时的背景色 (5.0)
|
|
33
|
+
- c125e4c48: fix: 修复 UI 问题 (5.0)
|
|
34
|
+
- Updated dependencies [abebb5eed]
|
|
35
|
+
- Updated dependencies [7bda04e64]
|
|
36
|
+
- Updated dependencies [7ac9bc99a]
|
|
37
|
+
- Updated dependencies [77ed66eac]
|
|
38
|
+
- Updated dependencies [ddd2acc79]
|
|
39
|
+
- Updated dependencies [5de7a848b]
|
|
40
|
+
- Updated dependencies [1b05b44a4]
|
|
41
|
+
- Updated dependencies [0cd15438e]
|
|
42
|
+
- Updated dependencies [958805d8b]
|
|
43
|
+
- Updated dependencies [eb69f0baa]
|
|
44
|
+
- Updated dependencies [a01771e8d]
|
|
45
|
+
- Updated dependencies [67960d871]
|
|
46
|
+
- Updated dependencies [cee645726]
|
|
47
|
+
- Updated dependencies [de7f92b26]
|
|
48
|
+
- Updated dependencies [b35327262]
|
|
49
|
+
- Updated dependencies [8116f0304]
|
|
50
|
+
- Updated dependencies [85bb84874]
|
|
51
|
+
- Updated dependencies [77ed66eac]
|
|
52
|
+
- Updated dependencies [632dbda3a]
|
|
53
|
+
- Updated dependencies [2c7c65a5a]
|
|
54
|
+
- Updated dependencies [36bb992d3]
|
|
55
|
+
- Updated dependencies [1b51c1bbe]
|
|
56
|
+
- Updated dependencies [2e0eca2d3]
|
|
57
|
+
- Updated dependencies [61d132802]
|
|
58
|
+
- Updated dependencies [e39572f8f]
|
|
59
|
+
- Updated dependencies [6ebf40f96]
|
|
60
|
+
- Updated dependencies [9f2ee08cf]
|
|
61
|
+
- Updated dependencies [6eac4b78b]
|
|
62
|
+
- Updated dependencies [bcd3d08dd]
|
|
63
|
+
- Updated dependencies [4fb586f6f]
|
|
64
|
+
- Updated dependencies [c125e4c48]
|
|
65
|
+
- Updated dependencies [b7ad460d8]
|
|
66
|
+
- Updated dependencies [df25ec39b]
|
|
67
|
+
- @hi-ui/picker@5.0.0-alpha.0
|
|
68
|
+
- @hi-ui/input@5.0.0-alpha.0
|
|
69
|
+
- @hi-ui/tag-input@5.0.0-alpha.0
|
|
70
|
+
- @hi-ui/core@5.0.0-alpha.0
|
|
71
|
+
- @hi-ui/use-check@5.0.0-alpha.0
|
|
72
|
+
- @hi-ui/use-children@5.0.0-alpha.0
|
|
73
|
+
- @hi-ui/use-data-source@5.0.0-alpha.0
|
|
74
|
+
- @hi-ui/use-id@5.0.0-alpha.0
|
|
75
|
+
- @hi-ui/use-latest@5.0.0-alpha.0
|
|
76
|
+
- @hi-ui/use-search-mode@5.0.0-alpha.0
|
|
77
|
+
- @hi-ui/use-toggle@5.0.0-alpha.0
|
|
78
|
+
- @hi-ui/use-uncontrolled-state@5.0.0-alpha.0
|
|
79
|
+
- @hi-ui/icons@5.0.0-alpha.0
|
|
80
|
+
- @hi-ui/checkbox@5.0.0-alpha.0
|
|
81
|
+
- @hi-ui/highlighter@5.0.0-alpha.0
|
|
82
|
+
- @hi-ui/popper@5.0.0-alpha.0
|
|
83
|
+
- @hi-ui/virtual-list@5.0.0-alpha.0
|
|
84
|
+
- @hi-ui/array-utils@5.0.0-alpha.0
|
|
85
|
+
- @hi-ui/classname@5.0.0-alpha.0
|
|
86
|
+
- @hi-ui/dom-utils@5.0.0-alpha.0
|
|
87
|
+
- @hi-ui/env@5.0.0-alpha.0
|
|
88
|
+
- @hi-ui/func-utils@5.0.0-alpha.0
|
|
89
|
+
- @hi-ui/times@5.0.0-alpha.0
|
|
90
|
+
- @hi-ui/tree-utils@5.0.0-alpha.0
|
|
91
|
+
- @hi-ui/type-assertion@5.0.0-alpha.0
|
|
92
|
+
|
|
93
|
+
## 4.6.4
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- [#3196](https://github.com/XiaoMi/hiui/pull/3196) [`80a909d2d`](https://github.com/XiaoMi/hiui/commit/80a909d2dae99d68d71f2ec6f4b210080d032ec0) Thanks [@KEH3](https://github.com/KEH3)! - fix(popper): ref 中增加更新位置方法解决上游组件弹窗被遮挡问题 (#3195)
|
|
98
|
+
|
|
99
|
+
- [#3208](https://github.com/XiaoMi/hiui/pull/3208) [`36086f4c8`](https://github.com/XiaoMi/hiui/commit/36086f4c8ab11728dd4d0bb34b4d9301c6068452) Thanks [@zyprepare](https://github.com/zyprepare)! - fix(select): 修复多级分组下分组标题左间距不对问题 (#3207)
|
|
100
|
+
|
|
101
|
+
- Updated dependencies [[`80a909d2d`](https://github.com/XiaoMi/hiui/commit/80a909d2dae99d68d71f2ec6f4b210080d032ec0)]:
|
|
102
|
+
- @hi-ui/picker@4.1.8
|
|
103
|
+
- @hi-ui/popper@4.1.7
|
|
104
|
+
|
|
3
105
|
## 4.6.3
|
|
4
106
|
|
|
5
107
|
### Patch Changes
|
package/lib/cjs/CheckSelect.js
CHANGED
|
@@ -36,6 +36,7 @@ var useSearchMode = require('@hi-ui/use-search-mode');
|
|
|
36
36
|
require('@hi-ui/use-children');
|
|
37
37
|
var useFlattenData = require('./hooks/use-flatten-data.js');
|
|
38
38
|
var index = require('./utils/index.js');
|
|
39
|
+
var useId = require('@hi-ui/use-id');
|
|
39
40
|
function _interopDefaultCompat(e) {
|
|
40
41
|
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
41
42
|
'default': e
|
|
@@ -85,6 +86,8 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
85
86
|
titleRender = _a.render,
|
|
86
87
|
renderExtraFooter = _a.renderExtraFooter,
|
|
87
88
|
onSearchProp = _a.onSearch,
|
|
89
|
+
onItemCreate = _a.onItemCreate,
|
|
90
|
+
creatableInSearch = _a.creatableInSearch,
|
|
88
91
|
_a$fieldNames = _a.fieldNames,
|
|
89
92
|
fieldNames = _a$fieldNames === void 0 ? DEFAULT_FIELD_NAMES : _a$fieldNames,
|
|
90
93
|
_a$checkedOnEntered = _a.checkedOnEntered,
|
|
@@ -97,10 +100,14 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
97
100
|
suffix = _a.suffix,
|
|
98
101
|
onKeyDownProp = _a.onKeyDown,
|
|
99
102
|
keywordProp = _a.keyword,
|
|
100
|
-
|
|
103
|
+
label = _a.label,
|
|
104
|
+
_a$showIndicator = _a.showIndicator,
|
|
105
|
+
showIndicator = _a$showIndicator === void 0 ? true : _a$showIndicator,
|
|
106
|
+
rest = tslib.__rest(_a, ["prefixCls", "role", "className", "children", "disabled", "clearable", "showCheckAll", "showOnlyShowChecked", "placeholder", "displayRender", "onSelect", "height", "itemHeight", "virtual", "visible", "onOpen", "onClose", "onClear", "appearance", "invalid", "dataSource", "searchOnInit", "filterOption", "searchable", "render", "renderExtraFooter", "onSearch", "onItemCreate", "creatableInSearch", "fieldNames", "checkedOnEntered", "customRender", "tagInputProps", "size", "prefix", "suffix", "onKeyDown", "keyword", "label", "showIndicator"]);
|
|
101
107
|
var i18n = core.useLocaleContext();
|
|
102
108
|
var placeholder = typeAssertion.isUndef(placeholderProp) ? i18n.get('checkSelect.placeholder') : placeholderProp;
|
|
103
109
|
// ************************** Picker ************************* //
|
|
110
|
+
var pickerInnerRef = React.useRef(null);
|
|
104
111
|
var _useUncontrolledToggl = useToggle.useUncontrolledToggle({
|
|
105
112
|
visible: visible,
|
|
106
113
|
disabled: disabled,
|
|
@@ -173,7 +180,7 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
173
180
|
checked: node.checked,
|
|
174
181
|
disabled: node.disabled
|
|
175
182
|
}, /*#__PURE__*/React__default["default"].createElement(highlighter.Highlighter, {
|
|
176
|
-
keyword: searchValue
|
|
183
|
+
keyword: new RegExp(searchValue, 'ig')
|
|
177
184
|
}, node.title))) : true;
|
|
178
185
|
return ret;
|
|
179
186
|
}, [titleRender, searchValue, searchMode]);
|
|
@@ -259,12 +266,29 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
259
266
|
var handleKeyDown = useLatest.useLatestCallback(function (evt) {
|
|
260
267
|
var key = evt.key;
|
|
261
268
|
if (key === 'Enter' && checkedOnEntered) {
|
|
269
|
+
if (creatableInSearch && showData.length === 0) {
|
|
270
|
+
handleCreate(searchValue);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
262
273
|
var focusedItem = showData[focusedIndex];
|
|
263
274
|
if (focusedItem) {
|
|
264
275
|
onSelect(focusedItem, !isCheckedId(focusedItem.id));
|
|
265
276
|
}
|
|
266
277
|
}
|
|
267
278
|
});
|
|
279
|
+
var handleCreate = useLatest.useLatestCallback(function (keyword) {
|
|
280
|
+
var _a;
|
|
281
|
+
var id = keyword + "-" + useId.uuid();
|
|
282
|
+
var createdItem = {
|
|
283
|
+
id: id,
|
|
284
|
+
title: keyword
|
|
285
|
+
};
|
|
286
|
+
onSelect(createdItem, true);
|
|
287
|
+
onItemCreate === null || onItemCreate === void 0 ? void 0 : onItemCreate(createdItem);
|
|
288
|
+
// 创建后重置搜索和关闭弹窗
|
|
289
|
+
(_a = pickerInnerRef.current) === null || _a === void 0 ? void 0 : _a.resetSearch();
|
|
290
|
+
menuVisibleAction.off();
|
|
291
|
+
});
|
|
268
292
|
// 更新 focused 索引
|
|
269
293
|
React.useEffect(function () {
|
|
270
294
|
setFocusedIndex(defaultIndex);
|
|
@@ -280,6 +304,9 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
280
304
|
}
|
|
281
305
|
return extra;
|
|
282
306
|
};
|
|
307
|
+
var customRenderContent = React.useMemo(function () {
|
|
308
|
+
return customRender ? typeof customRender === 'function' ? customRender(mergedCheckedItems) : customRender : null;
|
|
309
|
+
}, [customRender, mergedCheckedItems]);
|
|
283
310
|
var expandedViewRef = React.useRef('normal');
|
|
284
311
|
var virtualListProps = {
|
|
285
312
|
height: height,
|
|
@@ -292,16 +319,21 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
292
319
|
var cls = classname.cx(prefixCls, className, prefixCls + "--" + (menuVisible ? 'open' : 'closed'));
|
|
293
320
|
var listRef = React.useRef(null);
|
|
294
321
|
React.useEffect(function () {
|
|
295
|
-
var _a;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
(_a =
|
|
322
|
+
var _a, _b;
|
|
323
|
+
if (menuVisible) {
|
|
324
|
+
// 数据改变时更新弹窗显示位置,避免弹窗内容被遮挡
|
|
325
|
+
(_a = pickerInnerRef.current) === null || _a === void 0 ? void 0 : _a.update();
|
|
326
|
+
// 数据改变时触发一次滚动条显示
|
|
327
|
+
if (typeAssertion.isArrayNonEmpty(showData)) {
|
|
328
|
+
(_b = listRef.current) === null || _b === void 0 ? void 0 : _b.scrollTo(undefined);
|
|
329
|
+
}
|
|
299
330
|
}
|
|
300
331
|
}, [menuVisible, showData]);
|
|
301
332
|
return /*#__PURE__*/React__default["default"].createElement(context.CheckSelectProvider, {
|
|
302
333
|
value: context$1
|
|
303
334
|
}, /*#__PURE__*/React__default["default"].createElement(picker.Picker, Object.assign({
|
|
304
335
|
ref: ref,
|
|
336
|
+
innerRef: pickerInnerRef,
|
|
305
337
|
className: cls
|
|
306
338
|
}, rootProps, {
|
|
307
339
|
visible: menuVisible,
|
|
@@ -315,16 +347,24 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
315
347
|
onSearch: funcUtils.callAllFuncs(onSearchProp, onSearch),
|
|
316
348
|
loading: rest.loading !== undefined ? rest.loading : loading,
|
|
317
349
|
footer: renderDefaultFooter(),
|
|
318
|
-
|
|
350
|
+
creatableInSearch: creatableInSearch,
|
|
351
|
+
onCreate: handleCreate,
|
|
352
|
+
trigger: customRender ? customRenderContent : ( /*#__PURE__*/React__default["default"].createElement(tagInput.TagInputMock, Object.assign({
|
|
353
|
+
style: {
|
|
354
|
+
maxWidth: appearance === 'contained' ? '360px' : undefined
|
|
355
|
+
}
|
|
356
|
+
}, tagInputProps, {
|
|
319
357
|
size: size,
|
|
320
358
|
clearable: clearable,
|
|
321
359
|
placeholder: placeholder,
|
|
322
360
|
// @ts-ignore
|
|
323
361
|
displayRender: displayRender,
|
|
362
|
+
showIndicator: showIndicator,
|
|
324
363
|
prefix: prefix,
|
|
325
364
|
suffix: [menuVisible ? /*#__PURE__*/React__default["default"].createElement(icons.UpOutlined, null) : /*#__PURE__*/React__default["default"].createElement(icons.DownOutlined, null), suffix],
|
|
326
365
|
focused: menuVisible,
|
|
327
366
|
appearance: appearance,
|
|
367
|
+
label: label,
|
|
328
368
|
value: value,
|
|
329
369
|
// @ts-ignore
|
|
330
370
|
onChange: tryChangeValue,
|
|
@@ -378,7 +418,8 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
378
418
|
}, virtualListProps), function (node, index) {
|
|
379
419
|
/* 反向 map,搜索删选数据时会对数据进行处理 */
|
|
380
420
|
return 'groupTitle' in node ? ( /*#__PURE__*/React__default["default"].createElement(CheckSelectOptionGroup, {
|
|
381
|
-
label: node.groupTitle
|
|
421
|
+
label: node.groupTitle,
|
|
422
|
+
depth: node.depth
|
|
382
423
|
})) : ( /*#__PURE__*/React__default["default"].createElement(CheckSelectOption, {
|
|
383
424
|
option: node,
|
|
384
425
|
depth: node.depth,
|
|
@@ -404,7 +445,6 @@ var CheckSelectOption = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
404
445
|
option = _a$option === void 0 ? {} : _a$option,
|
|
405
446
|
onClick = _a.onClick,
|
|
406
447
|
titleRender = _a.titleRender,
|
|
407
|
-
depth = _a.depth,
|
|
408
448
|
focused = _a.focused,
|
|
409
449
|
rest = tslib.__rest(_a, ["prefixCls", "className", "children", "option", "onClick", "titleRender", "depth", "focused"]);
|
|
410
450
|
var _useCheckSelectContex = context.useCheckSelectContext(),
|
|
@@ -438,7 +478,7 @@ var CheckSelectOption = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
438
478
|
className: cls
|
|
439
479
|
}, rest, {
|
|
440
480
|
onClick: handleOptionCheck
|
|
441
|
-
}),
|
|
481
|
+
}), renderTitle(eventNodeRef.current, titleRender));
|
|
442
482
|
});
|
|
443
483
|
// @ts-ignore
|
|
444
484
|
CheckSelectOption.HiName = 'CheckSelectOption';
|
|
@@ -451,33 +491,20 @@ var CheckSelectOptionGroup = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
451
491
|
prefixCls = _a$prefixCls3 === void 0 ? optionGroupPrefix : _a$prefixCls3,
|
|
452
492
|
className = _a.className,
|
|
453
493
|
label = _a.label,
|
|
454
|
-
rest = tslib.__rest(_a, ["prefixCls", "className", "label"]);
|
|
494
|
+
rest = tslib.__rest(_a, ["prefixCls", "className", "label", "depth"]);
|
|
455
495
|
var cls = classname.cx(prefixCls, className);
|
|
456
|
-
return /*#__PURE__*/React__default["default"].createElement("
|
|
496
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
497
|
+
className: prefixCls + "__divider"
|
|
498
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
|
|
457
499
|
ref: ref,
|
|
458
500
|
className: cls
|
|
459
|
-
}, rest), /*#__PURE__*/React__default["default"].createElement("span", null, label));
|
|
501
|
+
}, rest), /*#__PURE__*/React__default["default"].createElement("span", null, label)));
|
|
460
502
|
});
|
|
461
503
|
// @ts-ignore
|
|
462
504
|
CheckSelectOptionGroup.HiName = 'CheckSelectOptionGroup';
|
|
463
505
|
if (env.__DEV__) {
|
|
464
506
|
CheckSelectOptionGroup.displayName = 'CheckSelectOptionGroup';
|
|
465
507
|
}
|
|
466
|
-
/**
|
|
467
|
-
* 渲染空白占位
|
|
468
|
-
*/
|
|
469
|
-
var renderIndent = function renderIndent(prefixCls, depth) {
|
|
470
|
-
return arrayUtils.times(depth, function (index) {
|
|
471
|
-
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
472
|
-
key: index,
|
|
473
|
-
style: {
|
|
474
|
-
alignSelf: 'stretch'
|
|
475
|
-
}
|
|
476
|
-
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
477
|
-
className: classname.cx(prefixCls + "__indent")
|
|
478
|
-
}));
|
|
479
|
-
});
|
|
480
|
-
};
|
|
481
508
|
exports.CheckSelect = CheckSelect;
|
|
482
509
|
exports.CheckSelectOption = CheckSelectOption;
|
|
483
510
|
exports.CheckSelectOptionGroup = CheckSelectOptionGroup;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
|
13
13
|
value: true
|
|
14
14
|
});
|
|
15
|
-
var css_248z = ".hi-
|
|
15
|
+
var css_248z = ".hi-v5-check-select-option {-webkit-box-sizing: border-box;box-sizing: border-box;width: 100%;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;position: relative;border-radius: var(--hi-v5-border-radius-md, 4px);cursor: pointer;font-size: var(--hi-v5-text-size-md, 0.875rem);font-weight: var(--hi-v5-text-weight-normal, 400);line-height: var(--hi-v5-text-lineheight-md, 1.375rem);color: var(--hi-v5-color-gray-700, #1a1d26);}.hi-v5-check-select-option__indent {display: inline-block;width: 16px;height: 100%;}.hi-v5-check-select-option__title {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-sizing: border-box;box-sizing: border-box;width: 100%;padding: calc(var(--hi-v5-spacing-2, 4px) + 1px) var(--hi-v5-spacing-4, 8px);font-size: inherit;-webkit-text-size-adjust: none;-moz-text-size-adjust: none;-ms-text-size-adjust: none;text-size-adjust: none;font-weight: inherit;color: inherit;line-height: inherit;}.hi-v5-check-select-option:hover {background-color: var(--hi-v5-color-gray-50, #f2f4f7);}.hi-v5-check-select-option--focused {background-color: var(--hi-v5-color-gray-50, #f2f4f7);}.hi-v5-check-select-option--disabled {cursor: not-allowed;color: var(--hi-v5-color-gray-500, #91959e);}.hi-v5-check-select-option-group {display: inline-block;padding: calc(var(--hi-v5-spacing-2, 4px) + 1px) var(--hi-v5-spacing-4, 8px);font-size: var(--hi-v5-text-size-md, 0.875rem);font-weight: var(--hi-v5-text-weight-normal, 400);line-height: var(--hi-v5-text-lineheight-md, 1.375rem);color: var(--hi-v5-color-gray-600, #60636b);}.hi-v5-check-select-option-group__divider {-webkit-box-sizing: border-box;box-sizing: border-box;width: calc(100% + var(--hi-v5-spacing-4, 8px));height: 1px;margin: var(--hi-v5-spacing-2, 4px) calc(var(--hi-v5-spacing-2, 4px) * -1);background-color: var(--hi-v5-color-gray-200, #e6e8eb);}.hi-v5-check-select-option-group__divider:first-child {display: none;}";
|
|
16
16
|
var __styleInject__ = require('@hi-ui/style-inject')["default"];
|
|
17
17
|
__styleInject__(css_248z);
|
|
18
18
|
exports["default"] = css_248z;
|
package/lib/esm/CheckSelect.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
10
|
import { __rest } from 'tslib';
|
|
11
|
-
import React, { forwardRef, useCallback, useMemo, useState, useEffect
|
|
11
|
+
import React, { forwardRef, useRef, useCallback, useMemo, useState, useEffect } from 'react';
|
|
12
12
|
import { getPrefixCls, cx } from '@hi-ui/classname';
|
|
13
13
|
import { __DEV__ } from '@hi-ui/env';
|
|
14
14
|
import { useCheckSelect } from './use-check-select.js';
|
|
@@ -21,7 +21,7 @@ import { isUndef, isFunction, isArrayNonEmpty } from '@hi-ui/type-assertion';
|
|
|
21
21
|
import VirtualList, { useCheckInVirtual } from '@hi-ui/virtual-list';
|
|
22
22
|
import { Picker } from '@hi-ui/picker';
|
|
23
23
|
import { mockDefaultHandlers } from '@hi-ui/dom-utils';
|
|
24
|
-
import { uniqBy
|
|
24
|
+
import { uniqBy } from '@hi-ui/array-utils';
|
|
25
25
|
import { Highlighter } from '@hi-ui/highlighter';
|
|
26
26
|
import { useUncontrolledToggle } from '@hi-ui/use-toggle';
|
|
27
27
|
import { callAllFuncs } from '@hi-ui/func-utils';
|
|
@@ -30,6 +30,7 @@ import { useAsyncSearch, useTreeCustomSearch, useFilterSearch, useSearchMode } f
|
|
|
30
30
|
import '@hi-ui/use-children';
|
|
31
31
|
import { flattenData } from './hooks/use-flatten-data.js';
|
|
32
32
|
import { getAllCheckedStatus, isCheckableOption, isOption } from './utils/index.js';
|
|
33
|
+
import { uuid } from '@hi-ui/use-id';
|
|
33
34
|
var _role = 'check-select';
|
|
34
35
|
var _prefix = getPrefixCls(_role);
|
|
35
36
|
var DEFAULT_FIELD_NAMES = {};
|
|
@@ -71,6 +72,8 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
71
72
|
titleRender = _a.render,
|
|
72
73
|
renderExtraFooter = _a.renderExtraFooter,
|
|
73
74
|
onSearchProp = _a.onSearch,
|
|
75
|
+
onItemCreate = _a.onItemCreate,
|
|
76
|
+
creatableInSearch = _a.creatableInSearch,
|
|
74
77
|
_a$fieldNames = _a.fieldNames,
|
|
75
78
|
fieldNames = _a$fieldNames === void 0 ? DEFAULT_FIELD_NAMES : _a$fieldNames,
|
|
76
79
|
_a$checkedOnEntered = _a.checkedOnEntered,
|
|
@@ -83,10 +86,14 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
83
86
|
suffix = _a.suffix,
|
|
84
87
|
onKeyDownProp = _a.onKeyDown,
|
|
85
88
|
keywordProp = _a.keyword,
|
|
86
|
-
|
|
89
|
+
label = _a.label,
|
|
90
|
+
_a$showIndicator = _a.showIndicator,
|
|
91
|
+
showIndicator = _a$showIndicator === void 0 ? true : _a$showIndicator,
|
|
92
|
+
rest = __rest(_a, ["prefixCls", "role", "className", "children", "disabled", "clearable", "showCheckAll", "showOnlyShowChecked", "placeholder", "displayRender", "onSelect", "height", "itemHeight", "virtual", "visible", "onOpen", "onClose", "onClear", "appearance", "invalid", "dataSource", "searchOnInit", "filterOption", "searchable", "render", "renderExtraFooter", "onSearch", "onItemCreate", "creatableInSearch", "fieldNames", "checkedOnEntered", "customRender", "tagInputProps", "size", "prefix", "suffix", "onKeyDown", "keyword", "label", "showIndicator"]);
|
|
87
93
|
var i18n = useLocaleContext();
|
|
88
94
|
var placeholder = isUndef(placeholderProp) ? i18n.get('checkSelect.placeholder') : placeholderProp;
|
|
89
95
|
// ************************** Picker ************************* //
|
|
96
|
+
var pickerInnerRef = useRef(null);
|
|
90
97
|
var _useUncontrolledToggl = useUncontrolledToggle({
|
|
91
98
|
visible: visible,
|
|
92
99
|
disabled: disabled,
|
|
@@ -159,7 +166,7 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
159
166
|
checked: node.checked,
|
|
160
167
|
disabled: node.disabled
|
|
161
168
|
}, /*#__PURE__*/React.createElement(Highlighter, {
|
|
162
|
-
keyword: searchValue
|
|
169
|
+
keyword: new RegExp(searchValue, 'ig')
|
|
163
170
|
}, node.title))) : true;
|
|
164
171
|
return ret;
|
|
165
172
|
}, [titleRender, searchValue, searchMode]);
|
|
@@ -245,12 +252,29 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
245
252
|
var handleKeyDown = useLatestCallback(function (evt) {
|
|
246
253
|
var key = evt.key;
|
|
247
254
|
if (key === 'Enter' && checkedOnEntered) {
|
|
255
|
+
if (creatableInSearch && showData.length === 0) {
|
|
256
|
+
handleCreate(searchValue);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
248
259
|
var focusedItem = showData[focusedIndex];
|
|
249
260
|
if (focusedItem) {
|
|
250
261
|
onSelect(focusedItem, !isCheckedId(focusedItem.id));
|
|
251
262
|
}
|
|
252
263
|
}
|
|
253
264
|
});
|
|
265
|
+
var handleCreate = useLatestCallback(function (keyword) {
|
|
266
|
+
var _a;
|
|
267
|
+
var id = keyword + "-" + uuid();
|
|
268
|
+
var createdItem = {
|
|
269
|
+
id: id,
|
|
270
|
+
title: keyword
|
|
271
|
+
};
|
|
272
|
+
onSelect(createdItem, true);
|
|
273
|
+
onItemCreate === null || onItemCreate === void 0 ? void 0 : onItemCreate(createdItem);
|
|
274
|
+
// 创建后重置搜索和关闭弹窗
|
|
275
|
+
(_a = pickerInnerRef.current) === null || _a === void 0 ? void 0 : _a.resetSearch();
|
|
276
|
+
menuVisibleAction.off();
|
|
277
|
+
});
|
|
254
278
|
// 更新 focused 索引
|
|
255
279
|
useEffect(function () {
|
|
256
280
|
setFocusedIndex(defaultIndex);
|
|
@@ -266,6 +290,9 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
266
290
|
}
|
|
267
291
|
return extra;
|
|
268
292
|
};
|
|
293
|
+
var customRenderContent = useMemo(function () {
|
|
294
|
+
return customRender ? typeof customRender === 'function' ? customRender(mergedCheckedItems) : customRender : null;
|
|
295
|
+
}, [customRender, mergedCheckedItems]);
|
|
269
296
|
var expandedViewRef = useRef('normal');
|
|
270
297
|
var virtualListProps = {
|
|
271
298
|
height: height,
|
|
@@ -278,16 +305,21 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
278
305
|
var cls = cx(prefixCls, className, prefixCls + "--" + (menuVisible ? 'open' : 'closed'));
|
|
279
306
|
var listRef = useRef(null);
|
|
280
307
|
useEffect(function () {
|
|
281
|
-
var _a;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
(_a =
|
|
308
|
+
var _a, _b;
|
|
309
|
+
if (menuVisible) {
|
|
310
|
+
// 数据改变时更新弹窗显示位置,避免弹窗内容被遮挡
|
|
311
|
+
(_a = pickerInnerRef.current) === null || _a === void 0 ? void 0 : _a.update();
|
|
312
|
+
// 数据改变时触发一次滚动条显示
|
|
313
|
+
if (isArrayNonEmpty(showData)) {
|
|
314
|
+
(_b = listRef.current) === null || _b === void 0 ? void 0 : _b.scrollTo(undefined);
|
|
315
|
+
}
|
|
285
316
|
}
|
|
286
317
|
}, [menuVisible, showData]);
|
|
287
318
|
return /*#__PURE__*/React.createElement(CheckSelectProvider, {
|
|
288
319
|
value: context
|
|
289
320
|
}, /*#__PURE__*/React.createElement(Picker, Object.assign({
|
|
290
321
|
ref: ref,
|
|
322
|
+
innerRef: pickerInnerRef,
|
|
291
323
|
className: cls
|
|
292
324
|
}, rootProps, {
|
|
293
325
|
visible: menuVisible,
|
|
@@ -301,16 +333,24 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
301
333
|
onSearch: callAllFuncs(onSearchProp, onSearch),
|
|
302
334
|
loading: rest.loading !== undefined ? rest.loading : loading,
|
|
303
335
|
footer: renderDefaultFooter(),
|
|
304
|
-
|
|
336
|
+
creatableInSearch: creatableInSearch,
|
|
337
|
+
onCreate: handleCreate,
|
|
338
|
+
trigger: customRender ? customRenderContent : ( /*#__PURE__*/React.createElement(TagInputMock, Object.assign({
|
|
339
|
+
style: {
|
|
340
|
+
maxWidth: appearance === 'contained' ? '360px' : undefined
|
|
341
|
+
}
|
|
342
|
+
}, tagInputProps, {
|
|
305
343
|
size: size,
|
|
306
344
|
clearable: clearable,
|
|
307
345
|
placeholder: placeholder,
|
|
308
346
|
// @ts-ignore
|
|
309
347
|
displayRender: displayRender,
|
|
348
|
+
showIndicator: showIndicator,
|
|
310
349
|
prefix: prefix,
|
|
311
350
|
suffix: [menuVisible ? /*#__PURE__*/React.createElement(UpOutlined, null) : /*#__PURE__*/React.createElement(DownOutlined, null), suffix],
|
|
312
351
|
focused: menuVisible,
|
|
313
352
|
appearance: appearance,
|
|
353
|
+
label: label,
|
|
314
354
|
value: value,
|
|
315
355
|
// @ts-ignore
|
|
316
356
|
onChange: tryChangeValue,
|
|
@@ -364,7 +404,8 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
364
404
|
}, virtualListProps), function (node, index) {
|
|
365
405
|
/* 反向 map,搜索删选数据时会对数据进行处理 */
|
|
366
406
|
return 'groupTitle' in node ? ( /*#__PURE__*/React.createElement(CheckSelectOptionGroup, {
|
|
367
|
-
label: node.groupTitle
|
|
407
|
+
label: node.groupTitle,
|
|
408
|
+
depth: node.depth
|
|
368
409
|
})) : ( /*#__PURE__*/React.createElement(CheckSelectOption, {
|
|
369
410
|
option: node,
|
|
370
411
|
depth: node.depth,
|
|
@@ -390,7 +431,6 @@ var CheckSelectOption = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
390
431
|
option = _a$option === void 0 ? {} : _a$option,
|
|
391
432
|
onClick = _a.onClick,
|
|
392
433
|
titleRender = _a.titleRender,
|
|
393
|
-
depth = _a.depth,
|
|
394
434
|
focused = _a.focused,
|
|
395
435
|
rest = __rest(_a, ["prefixCls", "className", "children", "option", "onClick", "titleRender", "depth", "focused"]);
|
|
396
436
|
var _useCheckSelectContex = useCheckSelectContext(),
|
|
@@ -424,7 +464,7 @@ var CheckSelectOption = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
424
464
|
className: cls
|
|
425
465
|
}, rest, {
|
|
426
466
|
onClick: handleOptionCheck
|
|
427
|
-
}),
|
|
467
|
+
}), renderTitle(eventNodeRef.current, titleRender));
|
|
428
468
|
});
|
|
429
469
|
// @ts-ignore
|
|
430
470
|
CheckSelectOption.HiName = 'CheckSelectOption';
|
|
@@ -437,31 +477,18 @@ var CheckSelectOptionGroup = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
437
477
|
prefixCls = _a$prefixCls3 === void 0 ? optionGroupPrefix : _a$prefixCls3,
|
|
438
478
|
className = _a.className,
|
|
439
479
|
label = _a.label,
|
|
440
|
-
rest = __rest(_a, ["prefixCls", "className", "label"]);
|
|
480
|
+
rest = __rest(_a, ["prefixCls", "className", "label", "depth"]);
|
|
441
481
|
var cls = cx(prefixCls, className);
|
|
442
|
-
return /*#__PURE__*/React.createElement("div",
|
|
482
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
483
|
+
className: prefixCls + "__divider"
|
|
484
|
+
}), /*#__PURE__*/React.createElement("div", Object.assign({
|
|
443
485
|
ref: ref,
|
|
444
486
|
className: cls
|
|
445
|
-
}, rest), /*#__PURE__*/React.createElement("span", null, label));
|
|
487
|
+
}, rest), /*#__PURE__*/React.createElement("span", null, label)));
|
|
446
488
|
});
|
|
447
489
|
// @ts-ignore
|
|
448
490
|
CheckSelectOptionGroup.HiName = 'CheckSelectOptionGroup';
|
|
449
491
|
if (__DEV__) {
|
|
450
492
|
CheckSelectOptionGroup.displayName = 'CheckSelectOptionGroup';
|
|
451
493
|
}
|
|
452
|
-
/**
|
|
453
|
-
* 渲染空白占位
|
|
454
|
-
*/
|
|
455
|
-
var renderIndent = function renderIndent(prefixCls, depth) {
|
|
456
|
-
return times(depth, function (index) {
|
|
457
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
458
|
-
key: index,
|
|
459
|
-
style: {
|
|
460
|
-
alignSelf: 'stretch'
|
|
461
|
-
}
|
|
462
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
463
|
-
className: cx(prefixCls + "__indent")
|
|
464
|
-
}));
|
|
465
|
-
});
|
|
466
|
-
};
|
|
467
494
|
export { CheckSelect, CheckSelectOption, CheckSelectOptionGroup };
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
10
|
import __styleInject__ from '@hi-ui/style-inject';
|
|
11
|
-
var css_248z = ".hi-
|
|
11
|
+
var css_248z = ".hi-v5-check-select-option {-webkit-box-sizing: border-box;box-sizing: border-box;width: 100%;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;position: relative;border-radius: var(--hi-v5-border-radius-md, 4px);cursor: pointer;font-size: var(--hi-v5-text-size-md, 0.875rem);font-weight: var(--hi-v5-text-weight-normal, 400);line-height: var(--hi-v5-text-lineheight-md, 1.375rem);color: var(--hi-v5-color-gray-700, #1a1d26);}.hi-v5-check-select-option__indent {display: inline-block;width: 16px;height: 100%;}.hi-v5-check-select-option__title {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-sizing: border-box;box-sizing: border-box;width: 100%;padding: calc(var(--hi-v5-spacing-2, 4px) + 1px) var(--hi-v5-spacing-4, 8px);font-size: inherit;-webkit-text-size-adjust: none;-moz-text-size-adjust: none;-ms-text-size-adjust: none;text-size-adjust: none;font-weight: inherit;color: inherit;line-height: inherit;}.hi-v5-check-select-option:hover {background-color: var(--hi-v5-color-gray-50, #f2f4f7);}.hi-v5-check-select-option--focused {background-color: var(--hi-v5-color-gray-50, #f2f4f7);}.hi-v5-check-select-option--disabled {cursor: not-allowed;color: var(--hi-v5-color-gray-500, #91959e);}.hi-v5-check-select-option-group {display: inline-block;padding: calc(var(--hi-v5-spacing-2, 4px) + 1px) var(--hi-v5-spacing-4, 8px);font-size: var(--hi-v5-text-size-md, 0.875rem);font-weight: var(--hi-v5-text-weight-normal, 400);line-height: var(--hi-v5-text-lineheight-md, 1.375rem);color: var(--hi-v5-color-gray-600, #60636b);}.hi-v5-check-select-option-group__divider {-webkit-box-sizing: border-box;box-sizing: border-box;width: calc(100% + var(--hi-v5-spacing-4, 8px));height: 1px;margin: var(--hi-v5-spacing-2, 4px) calc(var(--hi-v5-spacing-2, 4px) * -1);background-color: var(--hi-v5-color-gray-200, #e6e8eb);}.hi-v5-check-select-option-group__divider:first-child {display: none;}";
|
|
12
12
|
__styleInject__(css_248z);
|
|
13
13
|
export { css_248z as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UseCheckSelectProps } from './use-check-select';
|
|
3
|
-
import type { HiBaseHTMLProps } from '@hi-ui/core';
|
|
3
|
+
import type { HiBaseHTMLProps, HiBaseSizeEnum } from '@hi-ui/core';
|
|
4
4
|
import { CheckSelectAppearanceEnum, CheckSelectDataItem, CheckSelectItemEventData, CheckSelectMergedItem } from './types';
|
|
5
5
|
import { TagInputMockProps } from '@hi-ui/tag-input';
|
|
6
6
|
import { PickerProps } from '@hi-ui/picker';
|
|
@@ -39,7 +39,7 @@ export interface CheckSelectProps extends Omit<PickerProps, 'trigger' | 'scrolla
|
|
|
39
39
|
/**
|
|
40
40
|
* 自定义尺寸
|
|
41
41
|
*/
|
|
42
|
-
size?:
|
|
42
|
+
size?: HiBaseSizeEnum;
|
|
43
43
|
/**
|
|
44
44
|
* 自定义渲染节点的 title 内容
|
|
45
45
|
*/
|
|
@@ -56,6 +56,10 @@ export interface CheckSelectProps extends Omit<PickerProps, 'trigger' | 'scrolla
|
|
|
56
56
|
* 设置展现形式
|
|
57
57
|
*/
|
|
58
58
|
appearance?: CheckSelectAppearanceEnum;
|
|
59
|
+
/**
|
|
60
|
+
* 设置输入框 label 内容,仅在 appearance 为 contained 时生效
|
|
61
|
+
*/
|
|
62
|
+
label?: React.ReactNode;
|
|
59
63
|
/**
|
|
60
64
|
* 节点搜索模式,仅在mode=normal模式下生效
|
|
61
65
|
*/
|
|
@@ -118,10 +122,26 @@ export interface CheckSelectProps extends Omit<PickerProps, 'trigger' | 'scrolla
|
|
|
118
122
|
* TagInput 参数设置
|
|
119
123
|
*/
|
|
120
124
|
tagInputProps?: TagInputMockProps;
|
|
125
|
+
/**
|
|
126
|
+
* 是否开启创建选项
|
|
127
|
+
*/
|
|
128
|
+
creatableInSearch?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* 创建选项时触发
|
|
131
|
+
*/
|
|
132
|
+
onItemCreate?: (item: CheckSelectMergedItem) => void;
|
|
133
|
+
/**
|
|
134
|
+
* 是否展示箭头
|
|
135
|
+
*/
|
|
136
|
+
showIndicator?: boolean;
|
|
121
137
|
}
|
|
122
138
|
export declare const CheckSelectOption: React.ForwardRefExoticComponent<Pick<CheckSelectOptionProps, string | number> & React.RefAttributes<HTMLDivElement | null>>;
|
|
123
139
|
export interface CheckSelectOptionProps extends HiBaseHTMLProps {
|
|
124
140
|
}
|
|
125
141
|
export declare const CheckSelectOptionGroup: React.ForwardRefExoticComponent<Pick<CheckSelectOptionGroupProps, string | number> & React.RefAttributes<HTMLDivElement | null>>;
|
|
126
142
|
export interface CheckSelectOptionGroupProps extends HiBaseHTMLProps {
|
|
143
|
+
/**
|
|
144
|
+
* 深度
|
|
145
|
+
*/
|
|
146
|
+
depth?: number;
|
|
127
147
|
}
|
package/lib/types/types.d.ts
CHANGED
|
@@ -49,4 +49,4 @@ export interface FlattedCheckSelectDataItem extends CheckSelectDataItem {
|
|
|
49
49
|
}
|
|
50
50
|
export interface CheckSelectItemEventData extends FlattedCheckSelectDataItem, CheckSelectRequiredProps {
|
|
51
51
|
}
|
|
52
|
-
export declare type CheckSelectAppearanceEnum = HiBaseAppearanceEnum | undefined;
|
|
52
|
+
export declare type CheckSelectAppearanceEnum = HiBaseAppearanceEnum | 'contained' | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hi-ui/check-select",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.0",
|
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "HiUI <mi-hiui@xiaomi.com>",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"typings": "lib/types/index.d.ts",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
|
+
"types": "./lib/types/index.d.ts",
|
|
22
23
|
"require": "./lib/cjs/index.js",
|
|
23
24
|
"default": "./lib/esm/index.js"
|
|
24
25
|
}
|
|
@@ -43,38 +44,39 @@
|
|
|
43
44
|
"url": "https://github.com/XiaoMi/hiui/issues"
|
|
44
45
|
},
|
|
45
46
|
"dependencies": {
|
|
46
|
-
"@hi-ui/array-utils": "^
|
|
47
|
-
"@hi-ui/checkbox": "^
|
|
48
|
-
"@hi-ui/classname": "^
|
|
49
|
-
"@hi-ui/dom-utils": "^
|
|
50
|
-
"@hi-ui/env": "^
|
|
51
|
-
"@hi-ui/func-utils": "^
|
|
52
|
-
"@hi-ui/highlighter": "^
|
|
53
|
-
"@hi-ui/icons": "^
|
|
54
|
-
"@hi-ui/input": "^
|
|
55
|
-
"@hi-ui/picker": "^
|
|
56
|
-
"@hi-ui/popper": "^
|
|
57
|
-
"@hi-ui/tag-input": "^
|
|
58
|
-
"@hi-ui/times": "^
|
|
59
|
-
"@hi-ui/tree-utils": "^
|
|
60
|
-
"@hi-ui/type-assertion": "^
|
|
61
|
-
"@hi-ui/use-check": "^
|
|
62
|
-
"@hi-ui/use-children": "^
|
|
63
|
-
"@hi-ui/use-data-source": "^
|
|
64
|
-
"@hi-ui/use-
|
|
65
|
-
"@hi-ui/use-
|
|
66
|
-
"@hi-ui/use-
|
|
67
|
-
"@hi-ui/use-
|
|
68
|
-
"@hi-ui/
|
|
47
|
+
"@hi-ui/array-utils": "^5.0.0-alpha.0",
|
|
48
|
+
"@hi-ui/checkbox": "^5.0.0-alpha.0",
|
|
49
|
+
"@hi-ui/classname": "^5.0.0-alpha.0",
|
|
50
|
+
"@hi-ui/dom-utils": "^5.0.0-alpha.0",
|
|
51
|
+
"@hi-ui/env": "^5.0.0-alpha.0",
|
|
52
|
+
"@hi-ui/func-utils": "^5.0.0-alpha.0",
|
|
53
|
+
"@hi-ui/highlighter": "^5.0.0-alpha.0",
|
|
54
|
+
"@hi-ui/icons": "^5.0.0-alpha.0",
|
|
55
|
+
"@hi-ui/input": "^5.0.0-alpha.0",
|
|
56
|
+
"@hi-ui/picker": "^5.0.0-alpha.0",
|
|
57
|
+
"@hi-ui/popper": "^5.0.0-alpha.0",
|
|
58
|
+
"@hi-ui/tag-input": "^5.0.0-alpha.0",
|
|
59
|
+
"@hi-ui/times": "^5.0.0-alpha.0",
|
|
60
|
+
"@hi-ui/tree-utils": "^5.0.0-alpha.0",
|
|
61
|
+
"@hi-ui/type-assertion": "^5.0.0-alpha.0",
|
|
62
|
+
"@hi-ui/use-check": "^5.0.0-alpha.0",
|
|
63
|
+
"@hi-ui/use-children": "^5.0.0-alpha.0",
|
|
64
|
+
"@hi-ui/use-data-source": "^5.0.0-alpha.0",
|
|
65
|
+
"@hi-ui/use-id": "^5.0.0-alpha.0",
|
|
66
|
+
"@hi-ui/use-latest": "^5.0.0-alpha.0",
|
|
67
|
+
"@hi-ui/use-search-mode": "^5.0.0-alpha.0",
|
|
68
|
+
"@hi-ui/use-toggle": "^5.0.0-alpha.0",
|
|
69
|
+
"@hi-ui/use-uncontrolled-state": "^5.0.0-alpha.0",
|
|
70
|
+
"@hi-ui/virtual-list": "^5.0.0-alpha.0"
|
|
69
71
|
},
|
|
70
72
|
"peerDependencies": {
|
|
71
|
-
"@hi-ui/core": ">=
|
|
73
|
+
"@hi-ui/core": ">=5.0.0-alpha.0",
|
|
72
74
|
"react": ">=16.8.6",
|
|
73
75
|
"react-dom": ">=16.8.6"
|
|
74
76
|
},
|
|
75
77
|
"devDependencies": {
|
|
76
|
-
"@hi-ui/core": "^
|
|
77
|
-
"@hi-ui/core-css": "^
|
|
78
|
+
"@hi-ui/core": "^5.0.0-alpha.0",
|
|
79
|
+
"@hi-ui/core-css": "^5.0.0-alpha.0",
|
|
78
80
|
"react": "^17.0.1",
|
|
79
81
|
"react-dom": "^17.0.1"
|
|
80
82
|
}
|