@hi-ui/check-select 4.3.6 → 4.4.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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @hi-ui/check-select
2
2
 
3
+ ## 4.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2771](https://github.com/XiaoMi/hiui/pull/2771) [`eee27bd5f`](https://github.com/XiaoMi/hiui/commit/eee27bd5f81a89169c1c2dc993b9100731cafcbd) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复 keyword 受控时搜索结果有误的问题
8
+
9
+ ## 4.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#2746](https://github.com/XiaoMi/hiui/pull/2746) [`b3a13135c`](https://github.com/XiaoMi/hiui/commit/b3a13135c77e75291d5864ff7fcf63ddb2ff46b8) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: add prefix api
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [[`a9b9c93fc`](https://github.com/XiaoMi/hiui/commit/a9b9c93fc3a3fea60d14052a5afeef9daf7efa1b), [`b3a13135c`](https://github.com/XiaoMi/hiui/commit/b3a13135c77e75291d5864ff7fcf63ddb2ff46b8), [`ca008e4ae`](https://github.com/XiaoMi/hiui/commit/ca008e4ae9753bc1f11efcdcbf09121d1ef07b56)]:
18
+ - @hi-ui/input@4.1.0
19
+ - @hi-ui/tag-input@4.1.0
20
+ - @hi-ui/tree-utils@4.1.6
21
+
3
22
  ## 4.3.6
4
23
 
5
24
  ### Patch Changes
@@ -89,8 +89,11 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
89
89
  tagInputProps = _a.tagInputProps,
90
90
  _a$size = _a.size,
91
91
  size = _a$size === void 0 ? 'md' : _a$size,
92
+ prefix = _a.prefix,
93
+ suffix = _a.suffix,
92
94
  onKeyDownProp = _a.onKeyDown,
93
- 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", "tagInputProps", "size", "onKeyDown"]);
95
+ keywordProp = _a.keyword,
96
+ 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", "tagInputProps", "size", "prefix", "suffix", "onKeyDown", "keyword"]);
94
97
  var i18n = core.useLocaleContext();
95
98
  var placeholder = typeAssertion.isUndef(placeholderProp) ? i18n.get('checkSelect.placeholder') : placeholderProp;
96
99
  // ************************** Picker ************************* //
@@ -145,6 +148,7 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
145
148
  });
146
149
  var _useSearchMode = useSearchMode.useSearchMode({
147
150
  searchable: searchableProp,
151
+ keyword: keywordProp,
148
152
  strategies: [dataSourceStrategy, customSearchStrategy, filterSearchStrategy]
149
153
  }),
150
154
  stateInSearch = _useSearchMode.state,
@@ -284,6 +288,7 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
284
288
  onOpen: menuVisibleAction.on,
285
289
  onClose: menuVisibleAction.off,
286
290
  onKeyDown: domUtils.mockDefaultHandlers(handleKeyDown, onKeyDownProp),
291
+ keyword: keywordProp,
287
292
  searchable: searchable,
288
293
  scrollable: !inVirtual,
289
294
  onSearch: funcUtils.callAllFuncs(onSearchProp, onSearch),
@@ -295,7 +300,8 @@ var CheckSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
295
300
  placeholder: placeholder,
296
301
  // @ts-ignore
297
302
  displayRender: displayRender,
298
- suffix: menuVisible ? /*#__PURE__*/React__default["default"].createElement(icons.UpOutlined, null) : /*#__PURE__*/React__default["default"].createElement(icons.DownOutlined, null),
303
+ prefix: prefix,
304
+ suffix: [menuVisible ? /*#__PURE__*/React__default["default"].createElement(icons.UpOutlined, null) : /*#__PURE__*/React__default["default"].createElement(icons.DownOutlined, null), suffix],
299
305
  focused: menuVisible,
300
306
  appearance: appearance,
301
307
  value: value,
@@ -75,8 +75,11 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
75
75
  tagInputProps = _a.tagInputProps,
76
76
  _a$size = _a.size,
77
77
  size = _a$size === void 0 ? 'md' : _a$size,
78
+ prefix = _a.prefix,
79
+ suffix = _a.suffix,
78
80
  onKeyDownProp = _a.onKeyDown,
79
- 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", "tagInputProps", "size", "onKeyDown"]);
81
+ keywordProp = _a.keyword,
82
+ 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", "tagInputProps", "size", "prefix", "suffix", "onKeyDown", "keyword"]);
80
83
  var i18n = useLocaleContext();
81
84
  var placeholder = isUndef(placeholderProp) ? i18n.get('checkSelect.placeholder') : placeholderProp;
82
85
  // ************************** Picker ************************* //
@@ -131,6 +134,7 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
131
134
  });
132
135
  var _useSearchMode = useSearchMode({
133
136
  searchable: searchableProp,
137
+ keyword: keywordProp,
134
138
  strategies: [dataSourceStrategy, customSearchStrategy, filterSearchStrategy]
135
139
  }),
136
140
  stateInSearch = _useSearchMode.state,
@@ -270,6 +274,7 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
270
274
  onOpen: menuVisibleAction.on,
271
275
  onClose: menuVisibleAction.off,
272
276
  onKeyDown: mockDefaultHandlers(handleKeyDown, onKeyDownProp),
277
+ keyword: keywordProp,
273
278
  searchable: searchable,
274
279
  scrollable: !inVirtual,
275
280
  onSearch: callAllFuncs(onSearchProp, onSearch),
@@ -281,7 +286,8 @@ var CheckSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
281
286
  placeholder: placeholder,
282
287
  // @ts-ignore
283
288
  displayRender: displayRender,
284
- suffix: menuVisible ? /*#__PURE__*/React.createElement(UpOutlined, null) : /*#__PURE__*/React.createElement(DownOutlined, null),
289
+ prefix: prefix,
290
+ suffix: [menuVisible ? /*#__PURE__*/React.createElement(UpOutlined, null) : /*#__PURE__*/React.createElement(DownOutlined, null), suffix],
285
291
  focused: menuVisible,
286
292
  appearance: appearance,
287
293
  value: value,
@@ -75,9 +75,13 @@ export interface CheckSelectProps extends Omit<PickerProps, 'trigger' | 'scrolla
75
75
  */
76
76
  renderExtraFooter?: () => React.ReactNode;
77
77
  /**
78
- * 自定义 input 后缀 icon
78
+ * 选择框前置内容
79
79
  */
80
- suffixIcon?: React.ReactNode;
80
+ prefix?: React.ReactNode;
81
+ /**
82
+ * 选择框后置内容
83
+ */
84
+ suffix?: React.ReactNode;
81
85
  /**
82
86
  * 自定义清除 tags 的 icon
83
87
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/check-select",
3
- "version": "4.3.6",
3
+ "version": "4.4.1",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HiUI <mi-hiui@xiaomi.com>",
@@ -51,12 +51,12 @@
51
51
  "@hi-ui/func-utils": "^4.0.4",
52
52
  "@hi-ui/highlighter": "^4.0.8",
53
53
  "@hi-ui/icons": "^4.0.18",
54
- "@hi-ui/input": "^4.0.13",
54
+ "@hi-ui/input": "^4.1.0",
55
55
  "@hi-ui/picker": "^4.1.5",
56
56
  "@hi-ui/popper": "^4.1.4",
57
- "@hi-ui/tag-input": "^4.0.10",
57
+ "@hi-ui/tag-input": "^4.1.0",
58
58
  "@hi-ui/times": "^4.0.4",
59
- "@hi-ui/tree-utils": "^4.1.4",
59
+ "@hi-ui/tree-utils": "^4.1.6",
60
60
  "@hi-ui/type-assertion": "^4.0.4",
61
61
  "@hi-ui/use-check": "^4.0.5",
62
62
  "@hi-ui/use-children": "^4.0.4",