@hi-ui/check-select 4.0.9 → 4.1.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 +13 -0
- package/lib/cjs/CheckSelect.js +4 -3
- package/lib/esm/CheckSelect.js +4 -3
- package/lib/types/CheckSelect.d.ts +4 -0
- package/package.json +2 -3
- package/LICENSE +0 -21
package/CHANGELOG.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# @hi-ui/check-select
|
2
|
+
|
3
|
+
## 4.1.1
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#2334](https://github.com/XiaoMi/hiui/pull/2334) [`c9e6f4ad6`](https://github.com/XiaoMi/hiui/commit/c9e6f4ad6c1050b86bee5db681214d39830305c7) Thanks [@zyprepare](https://github.com/zyprepare)! - 修复问题:设置 loading 无效果
|
8
|
+
|
9
|
+
## 4.1.0
|
10
|
+
|
11
|
+
### Minor Changes
|
12
|
+
|
13
|
+
- [#2304](https://github.com/XiaoMi/hiui/pull/2304) [`feaec9a67`](https://github.com/XiaoMi/hiui/commit/feaec9a67a05e315f6f3370115eaf0c8c418faf7) Thanks [@zyprepare](https://github.com/zyprepare)! - 增加 customRender api
|
package/lib/cjs/CheckSelect.js
CHANGED
@@ -115,7 +115,8 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
115
115
|
onSearchProp = _a.onSearch,
|
116
116
|
_a$fieldNames = _a.fieldNames,
|
117
117
|
fieldNames = _a$fieldNames === void 0 ? DEFAULT_FIELD_NAMES : _a$fieldNames,
|
118
|
-
|
118
|
+
customRender = _a.customRender,
|
119
|
+
rest = tslib.__rest(_a, ["prefixCls", "role", "className", "children", "disabled", "clearable", "showCheckAll", "showOnlyShowChecked", "placeholder", "displayRender", "onSelect", "height", "itemHeight", "virtual", "visible", "onOpen", "onClose", "appearance", "invalid", "dataSource", "filterOption", "searchable", "render", "renderExtraFooter", "onSearch", "fieldNames", "customRender"]);
|
119
120
|
|
120
121
|
var i18n = core.useLocaleContext();
|
121
122
|
var placeholder = typeAssertion.isUndef(placeholderProp) ? i18n.get('checkSelect.placeholder') : placeholderProp; // ************************** Picker ************************* //
|
@@ -308,9 +309,9 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
308
309
|
searchable: searchable,
|
309
310
|
scrollable: !inVirtual,
|
310
311
|
onSearch: funcUtils.callAllFuncs(onSearchProp, onSearch),
|
311
|
-
loading: loading,
|
312
|
+
loading: rest.loading !== undefined ? rest.loading : loading,
|
312
313
|
footer: renderDefaultFooter(),
|
313
|
-
trigger: /*#__PURE__*/React__default["default"].createElement(tagInput.TagInputMock, {
|
314
|
+
trigger: customRender ? typeof customRender === 'function' ? customRender(checkedItems) : customRender : /*#__PURE__*/React__default["default"].createElement(tagInput.TagInputMock, {
|
314
315
|
clearable: clearable,
|
315
316
|
placeholder: placeholder,
|
316
317
|
// @ts-ignore
|
package/lib/esm/CheckSelect.js
CHANGED
@@ -73,7 +73,8 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
73
73
|
onSearchProp = _a.onSearch,
|
74
74
|
_a$fieldNames = _a.fieldNames,
|
75
75
|
fieldNames = _a$fieldNames === void 0 ? DEFAULT_FIELD_NAMES : _a$fieldNames,
|
76
|
-
|
76
|
+
customRender = _a.customRender,
|
77
|
+
rest = __rest(_a, ["prefixCls", "role", "className", "children", "disabled", "clearable", "showCheckAll", "showOnlyShowChecked", "placeholder", "displayRender", "onSelect", "height", "itemHeight", "virtual", "visible", "onOpen", "onClose", "appearance", "invalid", "dataSource", "filterOption", "searchable", "render", "renderExtraFooter", "onSearch", "fieldNames", "customRender"]);
|
77
78
|
|
78
79
|
var i18n = useLocaleContext();
|
79
80
|
var placeholder = isUndef(placeholderProp) ? i18n.get('checkSelect.placeholder') : placeholderProp; // ************************** Picker ************************* //
|
@@ -266,9 +267,9 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
266
267
|
searchable: searchable,
|
267
268
|
scrollable: !inVirtual,
|
268
269
|
onSearch: callAllFuncs(onSearchProp, onSearch),
|
269
|
-
loading: loading,
|
270
|
+
loading: rest.loading !== undefined ? rest.loading : loading,
|
270
271
|
footer: renderDefaultFooter(),
|
271
|
-
trigger: /*#__PURE__*/React.createElement(TagInputMock, {
|
272
|
+
trigger: customRender ? typeof customRender === 'function' ? customRender(checkedItems) : customRender : /*#__PURE__*/React.createElement(TagInputMock, {
|
272
273
|
clearable: clearable,
|
273
274
|
placeholder: placeholder,
|
274
275
|
// @ts-ignore
|
@@ -97,6 +97,10 @@ export interface CheckSelectProps extends Omit<PickerProps, 'trigger' | 'scrolla
|
|
97
97
|
* 是否开启查看仅已选功能
|
98
98
|
*/
|
99
99
|
showOnlyShowChecked?: boolean;
|
100
|
+
/**
|
101
|
+
* 自定义渲染选中的内容
|
102
|
+
*/
|
103
|
+
customRender?: React.ReactNode | ((option: CheckSelectItemEventData[]) => React.ReactNode);
|
100
104
|
}
|
101
105
|
/**
|
102
106
|
* TODO: What is CheckSelectOption
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hi-ui/check-select",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.1.1",
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
5
5
|
"keywords": [],
|
6
6
|
"author": "HiUI <mi-hiui@xiaomi.com>",
|
@@ -77,6 +77,5 @@
|
|
77
77
|
"@hi-ui/hi-build": "^4.0.1",
|
78
78
|
"react": "^17.0.1",
|
79
79
|
"react-dom": "^17.0.1"
|
80
|
-
}
|
81
|
-
"gitHead": "d075180134a471227e6c344a5bbbb98d91904f9a"
|
80
|
+
}
|
82
81
|
}
|
package/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2018 Xiaomi
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|