@hi-ui/check-select 4.0.0-beta.28 → 4.0.0-beta.30
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/lib/cjs/CheckSelect.js +44 -34
- package/lib/cjs/use-check-select.js +17 -15
- package/lib/esm/CheckSelect.js +46 -36
- package/lib/esm/use-check-select.js +18 -16
- package/lib/types/CheckSelect.d.ts +0 -4
- package/lib/types/context.d.ts +2 -0
- package/lib/types/use-check-select.d.ts +2 -1
- package/package.json +12 -12
package/lib/cjs/CheckSelect.js
CHANGED
@@ -114,7 +114,7 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
114
114
|
onSearchProp = _a.onSearch,
|
115
115
|
_a$fieldNames = _a.fieldNames,
|
116
116
|
fieldNames = _a$fieldNames === void 0 ? DEFAULT_FIELD_NAMES : _a$fieldNames,
|
117
|
-
rest = tslib.__rest(_a, ["prefixCls", "role", "className", "children", "disabled", "clearable", "
|
117
|
+
rest = tslib.__rest(_a, ["prefixCls", "role", "className", "children", "disabled", "clearable", "showCheckAll", "showOnlyShowChecked", "placeholder", "displayRender", "onSelect", "height", "itemHeight", "virtual", "onOpen", "onClose", "appearance", "invalid", "dataSource", "filterOption", "searchable", "render", "renderExtraFooter", "onSearch", "fieldNames"]);
|
118
118
|
|
119
119
|
var i18n = localeContext.useLocaleContext();
|
120
120
|
var placeholder = typeAssertion.isUndef(placeholderProp) ? i18n.get('checkSelect.placeholder') : placeholderProp; // ************************** Picker ************************* //
|
@@ -133,34 +133,20 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
133
133
|
}
|
134
134
|
|
135
135
|
return item.title;
|
136
|
-
}, [displayRenderProp]);
|
137
|
-
|
138
|
-
var _useState = React.useState([]),
|
139
|
-
selectedItems = _useState[0],
|
140
|
-
setSelectedItems = _useState[1];
|
141
|
-
|
142
|
-
var onSelect = useLatest.useLatestCallback(function (value, item, shouldChecked) {
|
143
|
-
onSelectProp === null || onSelectProp === void 0 ? void 0 : onSelectProp(value, item, shouldChecked);
|
144
|
-
|
145
|
-
if (shouldChecked) {
|
146
|
-
// TODO:as useCheckList
|
147
|
-
setSelectedItems(function (prev) {
|
148
|
-
return [].concat(prev, [item]);
|
149
|
-
});
|
150
|
-
}
|
151
|
-
});
|
136
|
+
}, [displayRenderProp]);
|
152
137
|
|
153
138
|
var _b = useCheckSelect.useCheckSelect(Object.assign(Object.assign({}, rest), {
|
154
139
|
children: children,
|
155
140
|
fieldNames: fieldNames,
|
156
|
-
onSelect:
|
141
|
+
onSelect: onSelectProp
|
157
142
|
})),
|
158
143
|
rootProps = _b.rootProps,
|
159
144
|
context$1 = tslib.__rest(_b, ["rootProps"]);
|
160
145
|
|
161
146
|
var value = context$1.value,
|
162
147
|
tryChangeValue = context$1.tryChangeValue,
|
163
|
-
flattedData = context$1.flattedData
|
148
|
+
flattedData = context$1.flattedData,
|
149
|
+
checkedItems = context$1.checkedItems; // ************************** 搜索 ************************* //
|
164
150
|
|
165
151
|
var _c = useSearchMode.useAsyncSearch({
|
166
152
|
dataSource: dataSource,
|
@@ -216,16 +202,16 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
216
202
|
var shouldUseSearch = !!searchValue && !hasError;
|
217
203
|
var showData = React.useMemo(function () {
|
218
204
|
return shouldUseSearch ? stateInSearch.data : flattedData;
|
219
|
-
}, [shouldUseSearch, flattedData, stateInSearch.data]); //
|
205
|
+
}, [shouldUseSearch, flattedData, stateInSearch.data]); // 根据 id 进行合并,注意必须是扁平数据
|
220
206
|
|
221
207
|
var mergedData = React.useMemo(function () {
|
222
|
-
var nextData =
|
208
|
+
var nextData = checkedItems.concat(flattedData);
|
223
209
|
return arrayUtils.uniqBy(nextData, 'id');
|
224
|
-
}, [
|
210
|
+
}, [checkedItems, flattedData]);
|
225
211
|
|
226
|
-
var
|
227
|
-
filterItems =
|
228
|
-
setFilterItems =
|
212
|
+
var _useState = React.useState(null),
|
213
|
+
filterItems = _useState[0],
|
214
|
+
setFilterItems = _useState[1];
|
229
215
|
|
230
216
|
var dropdownItems = filterItems || showData;
|
231
217
|
var activeExpandable = showOnlyShowChecked && !!filterItems && menuVisible;
|
@@ -250,23 +236,47 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
250
236
|
allChecked = _useMemo[0],
|
251
237
|
indeterminate = _useMemo[1];
|
252
238
|
|
239
|
+
var valueLatestRef = useLatest.useLatestRef(value);
|
253
240
|
var toggleCheckAll = React.useCallback(function (showChecked) {
|
254
|
-
var
|
255
|
-
|
256
|
-
});
|
241
|
+
var value = valueLatestRef.current; // 当前页的数据选项
|
242
|
+
|
257
243
|
var items = dropdownItems.filter(function (item) {
|
258
244
|
return !('groupTitle' in item);
|
259
245
|
});
|
246
|
+
var targetIds = items.map(function (_ref2) {
|
247
|
+
var id = _ref2.id;
|
248
|
+
return id;
|
249
|
+
});
|
250
|
+
var allData = arrayUtils.uniqBy(items.concat(mergedData), 'id');
|
260
251
|
|
261
252
|
if (showChecked) {
|
262
|
-
|
263
|
-
|
264
|
-
return id;
|
265
|
-
})
|
253
|
+
var nextCheckedIds = Array.from(new Set(value.concat(targetIds)));
|
254
|
+
var changedIds = nextCheckedIds.filter(function (id) {
|
255
|
+
return !value.includes(id);
|
256
|
+
});
|
257
|
+
var changedItems = allData.filter(function (_ref3) {
|
258
|
+
var id = _ref3.id;
|
259
|
+
return changedIds.includes(id);
|
260
|
+
});
|
261
|
+
tryChangeValue(nextCheckedIds, changedItems, showChecked);
|
266
262
|
} else {
|
267
|
-
|
263
|
+
var _nextCheckedIds = value.filter(function (id) {
|
264
|
+
return !targetIds.includes(id);
|
265
|
+
});
|
266
|
+
|
267
|
+
var _changedIds = value.filter(function (id) {
|
268
|
+
return !_nextCheckedIds.includes(id);
|
269
|
+
});
|
270
|
+
|
271
|
+
var _changedItems = allData.filter(function (_ref4) {
|
272
|
+
var id = _ref4.id;
|
273
|
+
return _changedIds.includes(id);
|
274
|
+
}); // items
|
275
|
+
|
276
|
+
|
277
|
+
tryChangeValue(_nextCheckedIds, _changedItems, showChecked);
|
268
278
|
}
|
269
|
-
}, [dropdownItems, mergedData,
|
279
|
+
}, [dropdownItems, mergedData, valueLatestRef, tryChangeValue]);
|
270
280
|
|
271
281
|
var renderDefaultFooter = function renderDefaultFooter() {
|
272
282
|
var extra = renderExtraFooter ? renderExtraFooter() : null;
|
@@ -65,33 +65,34 @@ var useCheckSelect = function useCheckSelect(_a) {
|
|
65
65
|
tryChangeValue = _useUncontrolledState[1];
|
66
66
|
|
67
67
|
var onSelectLatest = useLatest.useLatestCallback(onSelect);
|
68
|
-
var
|
68
|
+
var usedItemsRef = React.useRef([]); // 扁平化的选中数据,可能包括异步临时选中缓存数据
|
69
|
+
|
70
|
+
var _useState = React.useState([]),
|
71
|
+
checkedItems = _useState[0],
|
72
|
+
setCheckedItems = _useState[1];
|
73
|
+
|
69
74
|
var proxyTryChangeValue = React.useCallback(function (value, item, shouldChecked) {
|
70
75
|
var changedItems = item;
|
71
76
|
|
72
77
|
if (!Array.isArray(item)) {
|
73
78
|
changedItems = [item];
|
74
|
-
|
75
|
-
if (shouldChecked) {
|
76
|
-
selectedItemsRef.current.push(item);
|
77
|
-
}
|
78
|
-
|
79
79
|
onSelectLatest(value, item, shouldChecked);
|
80
80
|
}
|
81
81
|
|
82
|
-
var
|
82
|
+
var usedItems = arrayUtils.uniqBy([].concat(changedItems, usedItemsRef.current, flattedDataRef.current), 'id');
|
83
|
+
usedItemsRef.current = usedItems; // 使用最新的value
|
83
84
|
|
84
|
-
var
|
85
|
-
.filter(function (item) {
|
85
|
+
var nextCheckedItems = usedItems.filter(function (item) {
|
86
86
|
return value.includes(item.id);
|
87
|
-
}).map(function (item) {
|
88
|
-
return 'raw' in item ? item.raw : item;
|
89
87
|
});
|
90
|
-
|
88
|
+
setCheckedItems(nextCheckedItems);
|
89
|
+
tryChangeValue(value, // 处理脏数据
|
91
90
|
changedItems.map(function (item) {
|
92
91
|
return 'raw' in item ? item.raw : item;
|
93
|
-
}),
|
94
|
-
|
92
|
+
}), nextCheckedItems.map(function (item) {
|
93
|
+
return 'raw' in item ? item.raw : item;
|
94
|
+
}));
|
95
|
+
}, [tryChangeValue, onSelectLatest, flattedDataRef, usedItemsRef]);
|
95
96
|
|
96
97
|
var _useCheckDefault = useCheck.useCheck({
|
97
98
|
disabled: disabled,
|
@@ -109,7 +110,8 @@ var useCheckSelect = function useCheckSelect(_a) {
|
|
109
110
|
value: value,
|
110
111
|
tryChangeValue: proxyTryChangeValue,
|
111
112
|
onSelect: onOptionCheck,
|
112
|
-
isCheckedId: isCheckedId
|
113
|
+
isCheckedId: isCheckedId,
|
114
|
+
checkedItems: checkedItems
|
113
115
|
};
|
114
116
|
};
|
115
117
|
|
package/lib/esm/CheckSelect.js
CHANGED
@@ -8,13 +8,13 @@
|
|
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,
|
11
|
+
import React, { forwardRef, useCallback, useMemo, useState, useRef } 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';
|
15
15
|
import { UpOutlined, DownOutlined } from '@hi-ui/icons';
|
16
16
|
import { CheckSelectProvider, useCheckSelectContext } from './context.js';
|
17
|
-
import {
|
17
|
+
import { useLatestRef } from '@hi-ui/use-latest';
|
18
18
|
import Checkbox from '@hi-ui/checkbox';
|
19
19
|
import { TagInputMock } from '@hi-ui/tag-input';
|
20
20
|
import { isUndef, isFunction, isArrayNonEmpty } from '@hi-ui/type-assertion';
|
@@ -72,7 +72,7 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
72
72
|
onSearchProp = _a.onSearch,
|
73
73
|
_a$fieldNames = _a.fieldNames,
|
74
74
|
fieldNames = _a$fieldNames === void 0 ? DEFAULT_FIELD_NAMES : _a$fieldNames,
|
75
|
-
rest = __rest(_a, ["prefixCls", "role", "className", "children", "disabled", "clearable", "
|
75
|
+
rest = __rest(_a, ["prefixCls", "role", "className", "children", "disabled", "clearable", "showCheckAll", "showOnlyShowChecked", "placeholder", "displayRender", "onSelect", "height", "itemHeight", "virtual", "onOpen", "onClose", "appearance", "invalid", "dataSource", "filterOption", "searchable", "render", "renderExtraFooter", "onSearch", "fieldNames"]);
|
76
76
|
|
77
77
|
var i18n = useLocaleContext();
|
78
78
|
var placeholder = isUndef(placeholderProp) ? i18n.get('checkSelect.placeholder') : placeholderProp; // ************************** Picker ************************* //
|
@@ -91,34 +91,20 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
91
91
|
}
|
92
92
|
|
93
93
|
return item.title;
|
94
|
-
}, [displayRenderProp]);
|
95
|
-
|
96
|
-
var _useState = useState([]),
|
97
|
-
selectedItems = _useState[0],
|
98
|
-
setSelectedItems = _useState[1];
|
99
|
-
|
100
|
-
var onSelect = useLatestCallback(function (value, item, shouldChecked) {
|
101
|
-
onSelectProp === null || onSelectProp === void 0 ? void 0 : onSelectProp(value, item, shouldChecked);
|
102
|
-
|
103
|
-
if (shouldChecked) {
|
104
|
-
// TODO:as useCheckList
|
105
|
-
setSelectedItems(function (prev) {
|
106
|
-
return [].concat(prev, [item]);
|
107
|
-
});
|
108
|
-
}
|
109
|
-
});
|
94
|
+
}, [displayRenderProp]);
|
110
95
|
|
111
96
|
var _b = useCheckSelect(Object.assign(Object.assign({}, rest), {
|
112
97
|
children: children,
|
113
98
|
fieldNames: fieldNames,
|
114
|
-
onSelect:
|
99
|
+
onSelect: onSelectProp
|
115
100
|
})),
|
116
101
|
rootProps = _b.rootProps,
|
117
102
|
context = __rest(_b, ["rootProps"]);
|
118
103
|
|
119
104
|
var value = context.value,
|
120
105
|
tryChangeValue = context.tryChangeValue,
|
121
|
-
flattedData = context.flattedData
|
106
|
+
flattedData = context.flattedData,
|
107
|
+
checkedItems = context.checkedItems; // ************************** 搜索 ************************* //
|
122
108
|
|
123
109
|
var _c = useAsyncSearch({
|
124
110
|
dataSource: dataSource,
|
@@ -174,16 +160,16 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
174
160
|
var shouldUseSearch = !!searchValue && !hasError;
|
175
161
|
var showData = useMemo(function () {
|
176
162
|
return shouldUseSearch ? stateInSearch.data : flattedData;
|
177
|
-
}, [shouldUseSearch, flattedData, stateInSearch.data]); //
|
163
|
+
}, [shouldUseSearch, flattedData, stateInSearch.data]); // 根据 id 进行合并,注意必须是扁平数据
|
178
164
|
|
179
165
|
var mergedData = useMemo(function () {
|
180
|
-
var nextData =
|
166
|
+
var nextData = checkedItems.concat(flattedData);
|
181
167
|
return uniqBy(nextData, 'id');
|
182
|
-
}, [
|
168
|
+
}, [checkedItems, flattedData]);
|
183
169
|
|
184
|
-
var
|
185
|
-
filterItems =
|
186
|
-
setFilterItems =
|
170
|
+
var _useState = useState(null),
|
171
|
+
filterItems = _useState[0],
|
172
|
+
setFilterItems = _useState[1];
|
187
173
|
|
188
174
|
var dropdownItems = filterItems || showData;
|
189
175
|
var activeExpandable = showOnlyShowChecked && !!filterItems && menuVisible;
|
@@ -208,23 +194,47 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
208
194
|
allChecked = _useMemo[0],
|
209
195
|
indeterminate = _useMemo[1];
|
210
196
|
|
197
|
+
var valueLatestRef = useLatestRef(value);
|
211
198
|
var toggleCheckAll = useCallback(function (showChecked) {
|
212
|
-
var
|
213
|
-
|
214
|
-
});
|
199
|
+
var value = valueLatestRef.current; // 当前页的数据选项
|
200
|
+
|
215
201
|
var items = dropdownItems.filter(function (item) {
|
216
202
|
return !('groupTitle' in item);
|
217
203
|
});
|
204
|
+
var targetIds = items.map(function (_ref2) {
|
205
|
+
var id = _ref2.id;
|
206
|
+
return id;
|
207
|
+
});
|
208
|
+
var allData = uniqBy(items.concat(mergedData), 'id');
|
218
209
|
|
219
210
|
if (showChecked) {
|
220
|
-
|
221
|
-
|
222
|
-
return id;
|
223
|
-
})
|
211
|
+
var nextCheckedIds = Array.from(new Set(value.concat(targetIds)));
|
212
|
+
var changedIds = nextCheckedIds.filter(function (id) {
|
213
|
+
return !value.includes(id);
|
214
|
+
});
|
215
|
+
var changedItems = allData.filter(function (_ref3) {
|
216
|
+
var id = _ref3.id;
|
217
|
+
return changedIds.includes(id);
|
218
|
+
});
|
219
|
+
tryChangeValue(nextCheckedIds, changedItems, showChecked);
|
224
220
|
} else {
|
225
|
-
|
221
|
+
var _nextCheckedIds = value.filter(function (id) {
|
222
|
+
return !targetIds.includes(id);
|
223
|
+
});
|
224
|
+
|
225
|
+
var _changedIds = value.filter(function (id) {
|
226
|
+
return !_nextCheckedIds.includes(id);
|
227
|
+
});
|
228
|
+
|
229
|
+
var _changedItems = allData.filter(function (_ref4) {
|
230
|
+
var id = _ref4.id;
|
231
|
+
return _changedIds.includes(id);
|
232
|
+
}); // items
|
233
|
+
|
234
|
+
|
235
|
+
tryChangeValue(_nextCheckedIds, _changedItems, showChecked);
|
226
236
|
}
|
227
|
-
}, [dropdownItems, mergedData,
|
237
|
+
}, [dropdownItems, mergedData, valueLatestRef, tryChangeValue]);
|
228
238
|
|
229
239
|
var renderDefaultFooter = function renderDefaultFooter() {
|
230
240
|
var extra = renderExtraFooter ? renderExtraFooter() : null;
|
@@ -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 { useRef, useCallback } from 'react';
|
11
|
+
import { useRef, useState, useCallback } from 'react';
|
12
12
|
import { useUncontrolledState } from '@hi-ui/use-uncontrolled-state';
|
13
13
|
import { uniqBy } from '@hi-ui/array-utils';
|
14
14
|
import { useCheck } from '@hi-ui/use-check';
|
@@ -49,33 +49,34 @@ var useCheckSelect = function useCheckSelect(_a) {
|
|
49
49
|
tryChangeValue = _useUncontrolledState[1];
|
50
50
|
|
51
51
|
var onSelectLatest = useLatestCallback(onSelect);
|
52
|
-
var
|
52
|
+
var usedItemsRef = useRef([]); // 扁平化的选中数据,可能包括异步临时选中缓存数据
|
53
|
+
|
54
|
+
var _useState = useState([]),
|
55
|
+
checkedItems = _useState[0],
|
56
|
+
setCheckedItems = _useState[1];
|
57
|
+
|
53
58
|
var proxyTryChangeValue = useCallback(function (value, item, shouldChecked) {
|
54
59
|
var changedItems = item;
|
55
60
|
|
56
61
|
if (!Array.isArray(item)) {
|
57
62
|
changedItems = [item];
|
58
|
-
|
59
|
-
if (shouldChecked) {
|
60
|
-
selectedItemsRef.current.push(item);
|
61
|
-
}
|
62
|
-
|
63
63
|
onSelectLatest(value, item, shouldChecked);
|
64
64
|
}
|
65
65
|
|
66
|
-
var
|
66
|
+
var usedItems = uniqBy([].concat(changedItems, usedItemsRef.current, flattedDataRef.current), 'id');
|
67
|
+
usedItemsRef.current = usedItems; // 使用最新的value
|
67
68
|
|
68
|
-
var
|
69
|
-
.filter(function (item) {
|
69
|
+
var nextCheckedItems = usedItems.filter(function (item) {
|
70
70
|
return value.includes(item.id);
|
71
|
-
}).map(function (item) {
|
72
|
-
return 'raw' in item ? item.raw : item;
|
73
71
|
});
|
74
|
-
|
72
|
+
setCheckedItems(nextCheckedItems);
|
73
|
+
tryChangeValue(value, // 处理脏数据
|
75
74
|
changedItems.map(function (item) {
|
76
75
|
return 'raw' in item ? item.raw : item;
|
77
|
-
}),
|
78
|
-
|
76
|
+
}), nextCheckedItems.map(function (item) {
|
77
|
+
return 'raw' in item ? item.raw : item;
|
78
|
+
}));
|
79
|
+
}, [tryChangeValue, onSelectLatest, flattedDataRef, usedItemsRef]);
|
79
80
|
|
80
81
|
var _useCheckDefault = useCheck({
|
81
82
|
disabled: disabled,
|
@@ -93,7 +94,8 @@ var useCheckSelect = function useCheckSelect(_a) {
|
|
93
94
|
value: value,
|
94
95
|
tryChangeValue: proxyTryChangeValue,
|
95
96
|
onSelect: onOptionCheck,
|
96
|
-
isCheckedId: isCheckedId
|
97
|
+
isCheckedId: isCheckedId,
|
98
|
+
checkedItems: checkedItems
|
97
99
|
};
|
98
100
|
};
|
99
101
|
|
package/lib/types/context.d.ts
CHANGED
@@ -7,6 +7,7 @@ export declare const CheckSelectProvider: import("react").Provider<Omit<{
|
|
7
7
|
tryChangeValue: (value: import("react").ReactText[], item: import("./types").CheckSelectEventData | import("./types").CheckSelectEventData[], shouldChecked: boolean) => void;
|
8
8
|
onSelect: (targetItem: import("packages/hooks/use-check/lib/types").UseCheckItem, shouldChecked: boolean) => void;
|
9
9
|
isCheckedId: (id: import("react").ReactText) => boolean;
|
10
|
+
checkedItems: import("./types").CheckSelectEventData[];
|
10
11
|
}, "rootProps"> | null>;
|
11
12
|
export declare const useCheckSelectContext: () => Omit<{
|
12
13
|
rootProps: {};
|
@@ -16,4 +17,5 @@ export declare const useCheckSelectContext: () => Omit<{
|
|
16
17
|
tryChangeValue: (value: import("react").ReactText[], item: import("./types").CheckSelectEventData | import("./types").CheckSelectEventData[], shouldChecked: boolean) => void;
|
17
18
|
onSelect: (targetItem: import("packages/hooks/use-check/lib/types").UseCheckItem, shouldChecked: boolean) => void;
|
18
19
|
isCheckedId: (id: import("react").ReactText) => boolean;
|
20
|
+
checkedItems: import("./types").CheckSelectEventData[];
|
19
21
|
}, "rootProps">;
|
@@ -9,6 +9,7 @@ export declare const useCheckSelect: ({ data: dataProp, children, disabled, valu
|
|
9
9
|
tryChangeValue: (value: React.ReactText[], item: CheckSelectEventData | CheckSelectEventData[], shouldChecked: boolean) => void;
|
10
10
|
onSelect: (targetItem: import("@hi-ui/use-check").UseCheckItem, shouldChecked: boolean) => void;
|
11
11
|
isCheckedId: (id: React.ReactText) => boolean;
|
12
|
+
checkedItems: CheckSelectEventData[];
|
12
13
|
};
|
13
14
|
export interface UseCheckSelectProps {
|
14
15
|
/**
|
@@ -25,7 +26,7 @@ export interface UseCheckSelectProps {
|
|
25
26
|
* changedItems: 变更的选项集合
|
26
27
|
* checkedItems:所有选中项的选项集合
|
27
28
|
*/
|
28
|
-
onChange?: (value: React.ReactText[], changedItems
|
29
|
+
onChange?: (value: React.ReactText[], changedItems: CheckSelectDataItem[], checkedItems: CheckSelectDataItem[]) => void;
|
29
30
|
/**
|
30
31
|
* 选中值时回调。暂不对外暴露
|
31
32
|
* @private
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hi-ui/check-select",
|
3
|
-
"version": "4.0.0-beta.
|
3
|
+
"version": "4.0.0-beta.30",
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
5
5
|
"keywords": [],
|
6
6
|
"author": "HIUI <mi-hiui@xiaomi.com>",
|
@@ -44,19 +44,19 @@
|
|
44
44
|
},
|
45
45
|
"dependencies": {
|
46
46
|
"@hi-ui/array-utils": "^4.0.0-beta.7",
|
47
|
-
"@hi-ui/checkbox": "^4.0.0-beta.
|
47
|
+
"@hi-ui/checkbox": "^4.0.0-beta.11",
|
48
48
|
"@hi-ui/classname": "^4.0.0-beta.0",
|
49
49
|
"@hi-ui/core": "^4.0.0-beta.8",
|
50
50
|
"@hi-ui/core-css": "^4.0.0-beta.5",
|
51
51
|
"@hi-ui/env": "^4.0.0-beta.0",
|
52
|
-
"@hi-ui/func-utils": "^4.0.0-beta.
|
53
|
-
"@hi-ui/highlighter": "^4.0.0-beta.
|
52
|
+
"@hi-ui/func-utils": "^4.0.0-beta.12",
|
53
|
+
"@hi-ui/highlighter": "^4.0.0-beta.9",
|
54
54
|
"@hi-ui/icons": "^4.0.0-beta.10",
|
55
|
-
"@hi-ui/input": "^4.0.0-beta.
|
56
|
-
"@hi-ui/locale-context": "^4.0.0-beta.
|
57
|
-
"@hi-ui/picker": "^4.0.0-beta.
|
58
|
-
"@hi-ui/popper": "^4.0.0-beta.
|
59
|
-
"@hi-ui/tag-input": "^4.0.0-beta.
|
55
|
+
"@hi-ui/input": "^4.0.0-beta.14",
|
56
|
+
"@hi-ui/locale-context": "^4.0.0-beta.18",
|
57
|
+
"@hi-ui/picker": "^4.0.0-beta.23",
|
58
|
+
"@hi-ui/popper": "^4.0.0-beta.13",
|
59
|
+
"@hi-ui/tag-input": "^4.0.0-beta.18",
|
60
60
|
"@hi-ui/times": "^4.0.0-beta.5",
|
61
61
|
"@hi-ui/tree-utils": "^4.0.0-beta.4",
|
62
62
|
"@hi-ui/type-assertion": "^4.0.0-beta.4",
|
@@ -64,10 +64,10 @@
|
|
64
64
|
"@hi-ui/use-children": "^4.0.0-beta.4",
|
65
65
|
"@hi-ui/use-data-source": "^4.0.0-beta.5",
|
66
66
|
"@hi-ui/use-latest": "^4.0.0-beta.4",
|
67
|
-
"@hi-ui/use-search-mode": "^4.0.0-beta.
|
67
|
+
"@hi-ui/use-search-mode": "^4.0.0-beta.18",
|
68
68
|
"@hi-ui/use-toggle": "^4.0.0-beta.4",
|
69
69
|
"@hi-ui/use-uncontrolled-state": "^4.0.0-beta.4",
|
70
|
-
"rc-virtual-list": "^3.4.
|
70
|
+
"rc-virtual-list": "^3.4.7"
|
71
71
|
},
|
72
72
|
"peerDependencies": {
|
73
73
|
"react": ">=16.8.6",
|
@@ -78,5 +78,5 @@
|
|
78
78
|
"react": "^17.0.1",
|
79
79
|
"react-dom": "^17.0.1"
|
80
80
|
},
|
81
|
-
"gitHead": "
|
81
|
+
"gitHead": "1639653e72981dcce445765c8b80866adcffcad0"
|
82
82
|
}
|