@douyinfe/semi-ui 2.15.0-beta.0 → 2.15.2-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.
@@ -233,9 +233,11 @@ class Radio extends _baseComponent.default {
233
233
  focusInner: focusVisible && !focusOuter,
234
234
  onInputFocus: this.handleFocusVisible,
235
235
  onInputBlur: this.handleBlur
236
- })), isCardRadioGroup ? /*#__PURE__*/_react.default.createElement("div", {
237
- className: "".concat(prefix, "-isCardRadioGroup_content")
238
- }, renderContent()) : renderContent());
236
+ })), /*#__PURE__*/_react.default.createElement("div", {
237
+ className: (0, _classnames.default)(["".concat(prefix, "-content"), {
238
+ ["".concat(prefix, "-isCardRadioGroup_content")]: isCardRadioGroup
239
+ }])
240
+ }, renderContent()));
239
241
  }
240
242
 
241
243
  }
@@ -722,7 +722,7 @@ class Tooltip extends _baseComponent.default {
722
722
  }
723
723
  },
724
724
  tabIndex: 0,
725
- 'data-popupId': id
725
+ 'data-popupid': id
726
726
  })); // If you do not add a layer of div, in order to bind the events and className in the tooltip, you need to cloneElement children, but this time it may overwrite the children's original ref reference
727
727
  // So if the user adds ref to the content, you need to use callback ref: https://github.com/facebook/react/issues/8873
728
728
 
@@ -27,6 +27,8 @@ var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stabl
27
27
 
28
28
  var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
29
29
 
30
+ var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
31
+
30
32
  var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
31
33
 
32
34
  var _get2 = _interopRequireDefault(require("lodash/get"));
@@ -71,6 +73,8 @@ require("@douyinfe/semi-foundation/lib/cjs/tree/tree.css");
71
73
 
72
74
  var _semiIcons = require("@douyinfe/semi-icons");
73
75
 
76
+ var _checkboxGroup = _interopRequireDefault(require("../checkbox/checkboxGroup"));
77
+
74
78
  var _interface = require("./interface");
75
79
 
76
80
  _forEachInstanceProperty(_context2 = _Object$keys2(_interface)).call(_context2, function (key) {
@@ -652,7 +656,9 @@ class Tree extends _baseComponent.default {
652
656
  inputValue,
653
657
  filteredKeys,
654
658
  dragOverNodeKey,
655
- dropPosition
659
+ dropPosition,
660
+ checkedKeys,
661
+ realCheckedKeys
656
662
  } = this.state;
657
663
  const {
658
664
  blockNode,
@@ -671,7 +677,8 @@ class Tree extends _baseComponent.default {
671
677
  draggable,
672
678
  renderFullLabel,
673
679
  labelEllipsis,
674
- virtualize
680
+ virtualize,
681
+ checkRelation
675
682
  } = this.props;
676
683
  const wrapperCls = (0, _classnames.default)("".concat(prefixcls, "-wrapper"), className);
677
684
  const listCls = (0, _classnames.default)("".concat(prefixcls, "-option-list"), {
@@ -729,7 +736,9 @@ class Tree extends _baseComponent.default {
729
736
  style: style
730
737
  }, filterTreeNode ? this.renderInput() : null, /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({
731
738
  className: listCls
732
- }, ariaAttr), noData ? this.renderEmpty() : this.renderNodeList())));
739
+ }, ariaAttr), noData ? this.renderEmpty() : multiple ? /*#__PURE__*/_react.default.createElement(_checkboxGroup.default, {
740
+ value: (0, _from.default)(checkRelation === 'related' ? checkedKeys : realCheckedKeys)
741
+ }, this.renderNodeList()) : this.renderNodeList())));
733
742
  }
734
743
 
735
744
  }
@@ -342,7 +342,8 @@ class TreeNode extends _react.PureComponent {
342
342
  renderCheckbox() {
343
343
  const {
344
344
  checked,
345
- halfChecked
345
+ halfChecked,
346
+ eventKey
346
347
  } = this.props;
347
348
  const disabled = this.isDisabled();
348
349
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -351,6 +352,7 @@ class TreeNode extends _react.PureComponent {
351
352
  onKeyPress: this.handleCheckEnterPress
352
353
  }, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, {
353
354
  "aria-label": 'Toggle the checked state of checkbox',
355
+ value: eventKey,
354
356
  indeterminate: halfChecked,
355
357
  checked: checked,
356
358
  disabled: Boolean(disabled)
@@ -28,6 +28,8 @@ var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
28
28
 
29
29
  var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
30
30
 
31
+ var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
32
+
31
33
  var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
32
34
 
33
35
  var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
@@ -96,6 +98,8 @@ var _utils = require("../_utils");
96
98
 
97
99
  var _semiIcons = require("@douyinfe/semi-icons");
98
100
 
101
+ var _checkboxGroup = _interopRequireDefault(require("../checkbox/checkboxGroup"));
102
+
99
103
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
100
104
 
101
105
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -875,7 +879,9 @@ class TreeSelect extends _baseComponent.default {
875
879
  motionType,
876
880
  inputValue,
877
881
  filteredKeys,
878
- flattenNodes
882
+ flattenNodes,
883
+ checkedKeys,
884
+ realCheckedKeys
879
885
  } = this.state;
880
886
  const {
881
887
  loadData,
@@ -892,7 +898,8 @@ class TreeSelect extends _baseComponent.default {
892
898
  optionListStyle,
893
899
  searchPosition,
894
900
  renderLabel,
895
- renderFullLabel
901
+ renderFullLabel,
902
+ checkRelation
896
903
  } = this.props;
897
904
  const wrapperCls = (0, _classnames.default)("".concat(prefixTree, "-wrapper"));
898
905
  const listCls = (0, _classnames.default)("".concat(prefixTree, "-option-list"), {
@@ -933,7 +940,9 @@ class TreeSelect extends _baseComponent.default {
933
940
  role: "tree",
934
941
  "aria-multiselectable": multiple ? true : false,
935
942
  style: optionListStyle
936
- }, noData ? this.renderEmpty() : this.renderNodeList()), outerBottomSlot));
943
+ }, noData ? this.renderEmpty() : multiple ? /*#__PURE__*/_react.default.createElement(_checkboxGroup.default, {
944
+ value: (0, _from.default)(checkRelation === 'related' ? checkedKeys : realCheckedKeys)
945
+ }, this.renderNodeList()) : this.renderNodeList()), outerBottomSlot));
937
946
  };
938
947
 
939
948
  this.state = {
@@ -210,9 +210,11 @@ class Radio extends BaseComponent {
210
210
  focusInner: focusVisible && !focusOuter,
211
211
  onInputFocus: this.handleFocusVisible,
212
212
  onInputBlur: this.handleBlur
213
- })), isCardRadioGroup ? /*#__PURE__*/React.createElement("div", {
214
- className: "".concat(prefix, "-isCardRadioGroup_content")
215
- }, renderContent()) : renderContent());
213
+ })), /*#__PURE__*/React.createElement("div", {
214
+ className: cls(["".concat(prefix, "-content"), {
215
+ ["".concat(prefix, "-isCardRadioGroup_content")]: isCardRadioGroup
216
+ }])
217
+ }, renderContent()));
216
218
  }
217
219
 
218
220
  }
@@ -684,7 +684,7 @@ export default class Tooltip extends BaseComponent {
684
684
  }
685
685
  },
686
686
  tabIndex: 0,
687
- 'data-popupId': id
687
+ 'data-popupid': id
688
688
  })); // If you do not add a layer of div, in order to bind the events and className in the tooltip, you need to cloneElement children, but this time it may overwrite the children's original ref reference
689
689
  // So if the user adds ref to the content, you need to use callback ref: https://github.com/facebook/react/issues/8873
690
690
 
@@ -7,6 +7,7 @@ import _Set from "@babel/runtime-corejs3/core-js-stable/set";
7
7
  import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
8
8
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
9
9
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
10
+ import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
10
11
 
11
12
  /* eslint-disable max-lines-per-function */
12
13
  import React from 'react';
@@ -27,6 +28,7 @@ import NodeList from './nodeList';
27
28
  import LocaleConsumer from '../locale/localeConsumer';
28
29
  import '@douyinfe/semi-foundation/lib/es/tree/tree.css';
29
30
  import { IconSearch } from '@douyinfe/semi-icons';
31
+ import CheckboxGroup from '../checkbox/checkboxGroup';
30
32
  export * from './interface';
31
33
  const prefixcls = cssClasses.PREFIX;
32
34
 
@@ -593,7 +595,9 @@ class Tree extends BaseComponent {
593
595
  inputValue,
594
596
  filteredKeys,
595
597
  dragOverNodeKey,
596
- dropPosition
598
+ dropPosition,
599
+ checkedKeys,
600
+ realCheckedKeys
597
601
  } = this.state;
598
602
  const {
599
603
  blockNode,
@@ -612,7 +616,8 @@ class Tree extends BaseComponent {
612
616
  draggable,
613
617
  renderFullLabel,
614
618
  labelEllipsis,
615
- virtualize
619
+ virtualize,
620
+ checkRelation
616
621
  } = this.props;
617
622
  const wrapperCls = cls("".concat(prefixcls, "-wrapper"), className);
618
623
  const listCls = cls("".concat(prefixcls, "-option-list"), {
@@ -670,7 +675,9 @@ class Tree extends BaseComponent {
670
675
  style: style
671
676
  }, filterTreeNode ? this.renderInput() : null, /*#__PURE__*/React.createElement("div", _Object$assign({
672
677
  className: listCls
673
- }, ariaAttr), noData ? this.renderEmpty() : this.renderNodeList())));
678
+ }, ariaAttr), noData ? this.renderEmpty() : multiple ? /*#__PURE__*/React.createElement(CheckboxGroup, {
679
+ value: _Array$from(checkRelation === 'related' ? checkedKeys : realCheckedKeys)
680
+ }, this.renderNodeList()) : this.renderNodeList())));
674
681
  }
675
682
 
676
683
  }
@@ -303,7 +303,8 @@ export default class TreeNode extends PureComponent {
303
303
  renderCheckbox() {
304
304
  const {
305
305
  checked,
306
- halfChecked
306
+ halfChecked,
307
+ eventKey
307
308
  } = this.props;
308
309
  const disabled = this.isDisabled();
309
310
  return /*#__PURE__*/React.createElement("div", {
@@ -312,6 +313,7 @@ export default class TreeNode extends PureComponent {
312
313
  onKeyPress: this.handleCheckEnterPress
313
314
  }, /*#__PURE__*/React.createElement(Checkbox, {
314
315
  "aria-label": 'Toggle the checked state of checkbox',
316
+ value: eventKey,
315
317
  indeterminate: halfChecked,
316
318
  checked: checked,
317
319
  disabled: Boolean(disabled)
@@ -11,6 +11,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
11
11
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
12
12
  import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
13
13
  import _Set from "@babel/runtime-corejs3/core-js-stable/set";
14
+ import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
14
15
  import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
15
16
  import React, { Fragment } from 'react';
16
17
  import ReactDOM from 'react-dom';
@@ -39,6 +40,7 @@ import Trigger from '../trigger';
39
40
  import TagInput from '../tagInput';
40
41
  import { isSemiIcon } from '../_utils';
41
42
  import { IconChevronDown, IconClear, IconSearch } from '@douyinfe/semi-icons';
43
+ import CheckboxGroup from '../checkbox/checkboxGroup';
42
44
  const prefixcls = cssClasses.PREFIX;
43
45
  const prefixTree = cssClasses.PREFIX_TREE;
44
46
  const key = 0;
@@ -821,7 +823,9 @@ class TreeSelect extends BaseComponent {
821
823
  motionType,
822
824
  inputValue,
823
825
  filteredKeys,
824
- flattenNodes
826
+ flattenNodes,
827
+ checkedKeys,
828
+ realCheckedKeys
825
829
  } = this.state;
826
830
  const {
827
831
  loadData,
@@ -838,7 +842,8 @@ class TreeSelect extends BaseComponent {
838
842
  optionListStyle,
839
843
  searchPosition,
840
844
  renderLabel,
841
- renderFullLabel
845
+ renderFullLabel,
846
+ checkRelation
842
847
  } = this.props;
843
848
  const wrapperCls = cls("".concat(prefixTree, "-wrapper"));
844
849
  const listCls = cls("".concat(prefixTree, "-option-list"), {
@@ -879,7 +884,9 @@ class TreeSelect extends BaseComponent {
879
884
  role: "tree",
880
885
  "aria-multiselectable": multiple ? true : false,
881
886
  style: optionListStyle
882
- }, noData ? this.renderEmpty() : this.renderNodeList()), outerBottomSlot));
887
+ }, noData ? this.renderEmpty() : multiple ? /*#__PURE__*/React.createElement(CheckboxGroup, {
888
+ value: _Array$from(checkRelation === 'related' ? checkedKeys : realCheckedKeys)
889
+ }, this.renderNodeList()) : this.renderNodeList()), outerBottomSlot));
883
890
  };
884
891
 
885
892
  this.state = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.15.0-beta.0",
3
+ "version": "2.15.2-alpha.0",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -15,11 +15,11 @@
15
15
  "dependencies": {
16
16
  "@babel/runtime-corejs3": "^7.15.4",
17
17
  "@douyinfe/semi-animation": "2.12.0",
18
- "@douyinfe/semi-animation-react": "2.15.0-beta.0",
19
- "@douyinfe/semi-foundation": "2.15.0-beta.0",
20
- "@douyinfe/semi-icons": "2.15.0-beta.0",
21
- "@douyinfe/semi-illustrations": "2.15.0-beta.0",
22
- "@douyinfe/semi-theme-default": "2.15.0-beta.0",
18
+ "@douyinfe/semi-animation-react": "2.15.2-alpha.0",
19
+ "@douyinfe/semi-foundation": "2.15.2-alpha.0",
20
+ "@douyinfe/semi-icons": "2.15.2-alpha.0",
21
+ "@douyinfe/semi-illustrations": "2.15.0",
22
+ "@douyinfe/semi-theme-default": "2.15.2-alpha.0",
23
23
  "@types/react-window": "^1.8.2",
24
24
  "async-validator": "^3.5.0",
25
25
  "classnames": "^2.2.6",
@@ -69,13 +69,13 @@
69
69
  ],
70
70
  "author": "",
71
71
  "license": "MIT",
72
- "gitHead": "09fa8ba9a3765537c9de842dbcc2f97d515b54d9",
72
+ "gitHead": "2a0f381a9b559286fe9891093222198792fe5313",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",
76
76
  "@babel/preset-env": "^7.15.8",
77
77
  "@babel/preset-react": "^7.14.5",
78
- "@douyinfe/semi-scss-compile": "2.15.0-beta.0",
78
+ "@douyinfe/semi-scss-compile": "2.15.2-alpha.0",
79
79
  "@storybook/addon-knobs": "^6.3.1",
80
80
  "@types/lodash": "^4.14.176",
81
81
  "babel-loader": "^8.2.2",
@@ -254,18 +254,18 @@ _RadioGroup.story = {
254
254
 
255
255
  export const RadioWithVertical = () => {
256
256
  return (
257
- <Radio.Group>
258
- <Radio value="A" displayMode="vertical">
257
+ <Radio.Group direction="vertical">
258
+ <Radio value="A">
259
259
  无限长的一串字The Storybook webapp UI can be customised with this addon. It can be used to
260
260
  change the header, show/hide various UI elements and to enable full-screen mode by default.
261
261
  </Radio>
262
- <Radio value="C" displayMode="vertical">
262
+ <Radio value="C">
263
263
  C
264
264
  </Radio>
265
- <Radio value="D" displayMode="vertical">
265
+ <Radio value="D">
266
266
  D
267
267
  </Radio>
268
- <Radio value="E" displayMode="vertical">
268
+ <Radio value="E">
269
269
  E
270
270
  </Radio>
271
271
  </Radio.Group>
package/radio/radio.tsx CHANGED
@@ -285,11 +285,9 @@ class Radio extends BaseComponent<RadioProps, RadioState> {
285
285
  onInputFocus={this.handleFocusVisible}
286
286
  onInputBlur={this.handleBlur}
287
287
  />
288
- {
289
- isCardRadioGroup ?
290
- <div className={`${prefix}-isCardRadioGroup_content`}>{renderContent()}</div> :
291
- renderContent()
292
- }
288
+ <div className={cls([`${prefix}-content`, { [`${prefix}-isCardRadioGroup_content`]: isCardRadioGroup }])}>
289
+ {renderContent()}
290
+ </div>
293
291
  </label>
294
292
  );
295
293
  }
package/tooltip/index.tsx CHANGED
@@ -717,7 +717,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
717
717
  }
718
718
  },
719
719
  tabIndex: 0, // a11y keyboard
720
- 'data-popupId': id
720
+ 'data-popupid': id
721
721
  });
722
722
 
723
723
  // If you do not add a layer of div, in order to bind the events and className in the tooltip, you need to cloneElement children, but this time it may overwrite the children's original ref reference
package/tree/index.tsx CHANGED
@@ -41,6 +41,7 @@ import {
41
41
  KeyEntity,
42
42
  OptionProps
43
43
  } from './interface';
44
+ import CheckboxGroup from '../checkbox/checkboxGroup';
44
45
 
45
46
  export * from './interface';
46
47
  export { AutoSizerProps } from './autoSizer';
@@ -688,6 +689,8 @@ class Tree extends BaseComponent<TreeProps, TreeState> {
688
689
  filteredKeys,
689
690
  dragOverNodeKey,
690
691
  dropPosition,
692
+ checkedKeys,
693
+ realCheckedKeys,
691
694
  } = this.state;
692
695
 
693
696
  const {
@@ -708,6 +711,7 @@ class Tree extends BaseComponent<TreeProps, TreeState> {
708
711
  renderFullLabel,
709
712
  labelEllipsis,
710
713
  virtualize,
714
+ checkRelation,
711
715
  } = this.props;
712
716
  const wrapperCls = cls(`${prefixcls}-wrapper`, className);
713
717
  const listCls = cls(`${prefixcls}-option-list`, {
@@ -762,7 +766,12 @@ class Tree extends BaseComponent<TreeProps, TreeState> {
762
766
  <div aria-label={this.props['aria-label']} className={wrapperCls} style={style}>
763
767
  {filterTreeNode ? this.renderInput() : null}
764
768
  <div className={listCls} {...ariaAttr}>
765
- {noData ? this.renderEmpty() : this.renderNodeList()}
769
+ {noData ? this.renderEmpty() : (multiple ?
770
+ (<CheckboxGroup value={Array.from(checkRelation === 'related' ? checkedKeys : realCheckedKeys)}>
771
+ {this.renderNodeList()}
772
+ </CheckboxGroup>) :
773
+ this.renderNodeList()
774
+ )}
766
775
  </div>
767
776
  </div>
768
777
  </TreeContext.Provider>
package/tree/treeNode.tsx CHANGED
@@ -221,7 +221,7 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
221
221
  }
222
222
 
223
223
  renderCheckbox() {
224
- const { checked, halfChecked } = this.props;
224
+ const { checked, halfChecked, eventKey } = this.props;
225
225
  const disabled = this.isDisabled();
226
226
  return (
227
227
  <div
@@ -231,6 +231,7 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
231
231
  >
232
232
  <Checkbox
233
233
  aria-label='Toggle the checked state of checkbox'
234
+ value={eventKey}
234
235
  indeterminate={halfChecked}
235
236
  checked={checked}
236
237
  disabled={Boolean(disabled)}
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { Icon, Button, Form, Popover, Tag, Typography } from '../../index';
2
+ import { Icon, Button, Form, Popover, Tag, Typography, CheckboxGroup } from '../../index';
3
3
  import TreeSelect from '../index';
4
4
  import { flattenDeep } from 'lodash';
5
5
  import CustomTrigger from './CustomTrigger';
@@ -152,6 +152,43 @@ const treeDataWithoutValue = [
152
152
  },
153
153
  ];
154
154
 
155
+ export const TreeSelectWrapper = () => (
156
+ <div>
157
+ <div>github issue 750 修改测试用例</div>
158
+ <CheckboxGroup>
159
+ <TreeSelect
160
+ showClear={true}
161
+ expandAll
162
+ style={{width: 400}}
163
+ treeData={[
164
+ {
165
+ key: '1',
166
+ label: '所有节点',
167
+ value: '1',
168
+ children: [
169
+ { key: '20006251', label: 'Semi', value: 'semi@bytedance.com' },
170
+ { key: '20006248', label: 'Design', value: 'design@bytedance.com' },
171
+ {
172
+ key: '20006205',
173
+ label: 'React',
174
+ value: 'react@bytedance.com',
175
+ },
176
+ ],
177
+ },
178
+ ]}
179
+ multiple
180
+ filterTreeNode
181
+ showFilteredOnly={true}
182
+ leafOnly
183
+ />
184
+ </CheckboxGroup>
185
+ </div>
186
+ );
187
+
188
+ TreeSelectWrapper.story = {
189
+ name: 'treeSelect wrapper',
190
+ };
191
+
155
192
  class SimpleTree extends React.Component {
156
193
  render() {
157
194
  return (
@@ -50,6 +50,7 @@ import { isSemiIcon } from '../_utils';
50
50
  import { OptionProps, TreeProps, TreeState, FlattenNode, TreeNodeData, TreeNodeProps } from '../tree/interface';
51
51
  import { Motion } from '../_base/base';
52
52
  import { IconChevronDown, IconClear, IconSearch } from '@douyinfe/semi-icons';
53
+ import CheckboxGroup from '../checkbox/checkboxGroup';
53
54
 
54
55
  export type ExpandAction = false | 'click' | 'doubleClick';
55
56
 
@@ -1301,7 +1302,7 @@ class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState> {
1301
1302
  };
1302
1303
 
1303
1304
  renderTree = () => {
1304
- const { keyEntities, motionKeys, motionType, inputValue, filteredKeys, flattenNodes } = this.state;
1305
+ const { keyEntities, motionKeys, motionType, inputValue, filteredKeys, flattenNodes, checkedKeys, realCheckedKeys } = this.state;
1305
1306
  const {
1306
1307
  loadData,
1307
1308
  filterTreeNode,
@@ -1318,6 +1319,7 @@ class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState> {
1318
1319
  searchPosition,
1319
1320
  renderLabel,
1320
1321
  renderFullLabel,
1322
+ checkRelation,
1321
1323
  } = this.props;
1322
1324
  const wrapperCls = cls(`${prefixTree}-wrapper`);
1323
1325
  const listCls = cls(`${prefixTree}-option-list`, {
@@ -1362,7 +1364,12 @@ class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState> {
1362
1364
  this.renderInput()
1363
1365
  }
1364
1366
  <div className={listCls} role="tree" aria-multiselectable={multiple ? true : false} style={optionListStyle}>
1365
- {noData ? this.renderEmpty() : this.renderNodeList()}
1367
+ { noData ? this.renderEmpty() : (multiple ?
1368
+ (<CheckboxGroup value={Array.from(checkRelation === 'related' ? checkedKeys : realCheckedKeys)}>
1369
+ {this.renderNodeList()}
1370
+ </CheckboxGroup>) :
1371
+ this.renderNodeList()
1372
+ )}
1366
1373
  </div>
1367
1374
  {outerBottomSlot}
1368
1375
  </div>