@hi-ui/check-tree-select 4.1.0 → 4.3.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 CHANGED
@@ -1,5 +1,29 @@
1
1
  # @hi-ui/check-tree-select
2
2
 
3
+ ## 4.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2604](https://github.com/XiaoMi/hiui/pull/2604) [`2dd977a5c`](https://github.com/XiaoMi/hiui/commit/2dd977a5c0db411e07aa5c4ea50ef04f37ebf8d2) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: add size api
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`534bfd298`](https://github.com/XiaoMi/hiui/commit/534bfd29852003af2209c3a64e5f1b2b1d37c19e)]:
12
+ - @hi-ui/tree@4.5.2
13
+
14
+ ## 4.2.0
15
+
16
+ ### Minor Changes
17
+
18
+ - [#2531](https://github.com/XiaoMi/hiui/pull/2531) [`0a9d90ac5`](https://github.com/XiaoMi/hiui/commit/0a9d90ac53bdf66aa2b83b698b58d2cdeb98d912) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: 增加 tagInputProps API,支持显示内容高度自适应
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [[`bd5940eba`](https://github.com/XiaoMi/hiui/commit/bd5940eba7d7a80aa676f37bb804ea27544864d2), [`0a9d90ac5`](https://github.com/XiaoMi/hiui/commit/0a9d90ac53bdf66aa2b83b698b58d2cdeb98d912)]:
23
+ - @hi-ui/picker@4.1.1
24
+ - @hi-ui/popper@4.0.5
25
+ - @hi-ui/tag-input@4.0.6
26
+
3
27
  ## 4.1.0
4
28
 
5
29
  ### Minor Changes
@@ -71,7 +71,7 @@ var DEFAULT_VALUE = [];
71
71
  var DEFAULT_FIELD_NAMES = {};
72
72
  var DEFAULT_EXPANDED_IDS = [];
73
73
  /**
74
- * TODO: What is CheckTreeSelect
74
+ * 多项树形选择器
75
75
  */
76
76
 
77
77
  var CheckTreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
@@ -115,7 +115,10 @@ var CheckTreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
115
115
  itemHeight = _a.itemHeight,
116
116
  height = _a.height,
117
117
  showCheckAll = _a.showCheckAll,
118
- rest = tslib.__rest(_a, ["prefixCls", "role", "className", "data", "dataSource", "disabled", "visible", "onOpen", "onClose", "fieldNames", "checkedMode", "defaultExpandAll", "expandedIds", "defaultExpandedIds", "onExpand", "defaultValue", "value", "onChange", "searchable", "searchMode", "onLoadChildren", "render", "filterOption", "onSearch", "clearable", "invalid", "displayRender", "placeholder", "appearance", "virtual", "itemHeight", "height", "showCheckAll"]);
118
+ tagInputProps = _a.tagInputProps,
119
+ _a$size = _a.size,
120
+ size = _a$size === void 0 ? 'md' : _a$size,
121
+ rest = tslib.__rest(_a, ["prefixCls", "role", "className", "data", "dataSource", "disabled", "visible", "onOpen", "onClose", "fieldNames", "checkedMode", "defaultExpandAll", "expandedIds", "defaultExpandedIds", "onExpand", "defaultValue", "value", "onChange", "searchable", "searchMode", "onLoadChildren", "render", "filterOption", "onSearch", "clearable", "invalid", "displayRender", "placeholder", "appearance", "virtual", "itemHeight", "height", "showCheckAll", "tagInputProps", "size"]);
119
122
 
120
123
  var i18n = core.useLocaleContext();
121
124
  var placeholder = typeAssertion.isUndef(placeholderProp) ? i18n.get('checkTreeSelect.placeholder') : placeholderProp;
@@ -334,10 +337,8 @@ var CheckTreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
334
337
  onSearch: funcUtils.callAllFuncs(onSearchProp, onSearch),
335
338
  footer: renderDefaultFooter(),
336
339
  loading: rest.loading !== undefined ? rest.loading : loading,
337
- trigger: /*#__PURE__*/React__default["default"].createElement(tagInput.TagInputMock // ref={targetElementRef}
338
- // onClick={openMenu}
339
- // disabled={disabled}
340
- , {
340
+ trigger: /*#__PURE__*/React__default["default"].createElement(tagInput.TagInputMock, Object.assign({}, tagInputProps, {
341
+ size: size,
341
342
  // ref={targetElementRef}
342
343
  // onClick={openMenu}
343
344
  // disabled={disabled}
@@ -353,11 +354,12 @@ var CheckTreeSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
353
354
  data: mergedData,
354
355
  // @ts-ignore
355
356
  invalid: invalid
356
- })
357
+ }))
357
358
  }), typeAssertion.isArrayNonEmpty(treeProps.data) ?
358
359
  /*#__PURE__*/
359
360
  // 只做渲染,不做逻辑处理(比如搜索过滤后,check操作的是对过滤后的data操作,这是不符合预期的)
360
361
  React__default["default"].createElement(tree.Tree, Object.assign({
362
+ size: 'md',
361
363
  className: prefixCls + "__tree",
362
364
  selectable: false,
363
365
  checkable: true,
@@ -14,7 +14,7 @@ Object.defineProperty(exports, '__esModule', {
14
14
  });
15
15
  var css_248z = "";
16
16
 
17
- var __styleInject__ = require('inject-head-style')["default"];
17
+ var __styleInject__ = require('style-inject')["default"];
18
18
 
19
19
  __styleInject__(css_248z);
20
20
 
@@ -33,7 +33,7 @@ var DEFAULT_VALUE = [];
33
33
  var DEFAULT_FIELD_NAMES = {};
34
34
  var DEFAULT_EXPANDED_IDS = [];
35
35
  /**
36
- * TODO: What is CheckTreeSelect
36
+ * 多项树形选择器
37
37
  */
38
38
 
39
39
  var CheckTreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
@@ -77,7 +77,10 @@ var CheckTreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
77
77
  itemHeight = _a.itemHeight,
78
78
  height = _a.height,
79
79
  showCheckAll = _a.showCheckAll,
80
- rest = __rest(_a, ["prefixCls", "role", "className", "data", "dataSource", "disabled", "visible", "onOpen", "onClose", "fieldNames", "checkedMode", "defaultExpandAll", "expandedIds", "defaultExpandedIds", "onExpand", "defaultValue", "value", "onChange", "searchable", "searchMode", "onLoadChildren", "render", "filterOption", "onSearch", "clearable", "invalid", "displayRender", "placeholder", "appearance", "virtual", "itemHeight", "height", "showCheckAll"]);
80
+ tagInputProps = _a.tagInputProps,
81
+ _a$size = _a.size,
82
+ size = _a$size === void 0 ? 'md' : _a$size,
83
+ rest = __rest(_a, ["prefixCls", "role", "className", "data", "dataSource", "disabled", "visible", "onOpen", "onClose", "fieldNames", "checkedMode", "defaultExpandAll", "expandedIds", "defaultExpandedIds", "onExpand", "defaultValue", "value", "onChange", "searchable", "searchMode", "onLoadChildren", "render", "filterOption", "onSearch", "clearable", "invalid", "displayRender", "placeholder", "appearance", "virtual", "itemHeight", "height", "showCheckAll", "tagInputProps", "size"]);
81
84
 
82
85
  var i18n = useLocaleContext();
83
86
  var placeholder = isUndef(placeholderProp) ? i18n.get('checkTreeSelect.placeholder') : placeholderProp;
@@ -296,10 +299,8 @@ var CheckTreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
296
299
  onSearch: callAllFuncs(onSearchProp, onSearch),
297
300
  footer: renderDefaultFooter(),
298
301
  loading: rest.loading !== undefined ? rest.loading : loading,
299
- trigger: /*#__PURE__*/React.createElement(TagInputMock // ref={targetElementRef}
300
- // onClick={openMenu}
301
- // disabled={disabled}
302
- , {
302
+ trigger: /*#__PURE__*/React.createElement(TagInputMock, Object.assign({}, tagInputProps, {
303
+ size: size,
303
304
  // ref={targetElementRef}
304
305
  // onClick={openMenu}
305
306
  // disabled={disabled}
@@ -315,11 +316,12 @@ var CheckTreeSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
315
316
  data: mergedData,
316
317
  // @ts-ignore
317
318
  invalid: invalid
318
- })
319
+ }))
319
320
  }), isArrayNonEmpty(treeProps.data) ?
320
321
  /*#__PURE__*/
321
322
  // 只做渲染,不做逻辑处理(比如搜索过滤后,check操作的是对过滤后的data操作,这是不符合预期的)
322
323
  React.createElement(Tree, Object.assign({
324
+ size: 'md',
323
325
  className: prefixCls + "__tree",
324
326
  selectable: false,
325
327
  checkable: true,
@@ -7,7 +7,7 @@
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
- import __styleInject__ from 'inject-head-style';
10
+ import __styleInject__ from 'style-inject';
11
11
  var css_248z = "";
12
12
 
13
13
  __styleInject__(css_248z);
@@ -2,8 +2,10 @@ import React from 'react';
2
2
  import { CheckTreeSelectDataItem, CheckTreeSelectItemEventData, CheckTreeSelectAppearanceEnum } from './types';
3
3
  import { FlattedTreeNodeData } from '@hi-ui/tree';
4
4
  import { PickerProps } from '@hi-ui/picker';
5
+ import { TagInputMockProps } from '@hi-ui/tag-input';
6
+ import { HiBaseSizeEnum } from '@hi-ui/core';
5
7
  /**
6
- * TODO: What is CheckTreeSelect
8
+ * 多项树形选择器
7
9
  */
8
10
  export declare const CheckTreeSelect: React.ForwardRefExoticComponent<CheckTreeSelectProps & React.RefAttributes<HTMLDivElement | null>>;
9
11
  export interface CheckTreeSelectProps extends Omit<PickerProps, 'data' | 'onChange' | 'value' | 'trigger' | 'scrollable'> {
@@ -135,6 +137,14 @@ export interface CheckTreeSelectProps extends Omit<PickerProps, 'data' | 'onChan
135
137
  * 是否开启全选功能,需要对数据全量操作。异步数据场景暂不支持,可自行渲染弹层底部实现
136
138
  */
137
139
  showCheckAll?: boolean;
140
+ /**
141
+ * TagInput 参数设置
142
+ */
143
+ tagInputProps?: TagInputMockProps;
144
+ /**
145
+ * 设置尺寸
146
+ */
147
+ size?: HiBaseSizeEnum;
138
148
  }
139
149
  /**
140
150
  * 在 checkedIdsSet 为数据合法的情况下,查找所有的半选中态的节点 ids
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/check-tree-select",
3
- "version": "4.1.0",
3
+ "version": "4.3.0",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HiUI <mi-hiui@xiaomi.com>",
@@ -50,10 +50,10 @@
50
50
  "@hi-ui/func-utils": "^4.0.1",
51
51
  "@hi-ui/highlighter": "^4.0.5",
52
52
  "@hi-ui/icons": "^4.0.4",
53
- "@hi-ui/picker": "^4.0.6",
54
- "@hi-ui/popper": "^4.0.4",
55
- "@hi-ui/tag-input": "^4.0.5",
56
- "@hi-ui/tree": "^4.0.9",
53
+ "@hi-ui/picker": "^4.1.1",
54
+ "@hi-ui/popper": "^4.0.5",
55
+ "@hi-ui/tag-input": "^4.0.6",
56
+ "@hi-ui/tree": "^4.5.2",
57
57
  "@hi-ui/tree-utils": "^4.0.2",
58
58
  "@hi-ui/type-assertion": "^4.0.1",
59
59
  "@hi-ui/use-check": "^4.0.2",
@@ -69,8 +69,7 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@hi-ui/core": "^4.0.4",
72
- "@hi-ui/core-css": "^4.0.1",
73
- "@hi-ui/hi-build": "^4.0.1",
72
+ "@hi-ui/core-css": "^4.1.1",
74
73
  "react": "^17.0.1",
75
74
  "react-dom": "^17.0.1"
76
75
  }