@douyinfe/semi-ui 2.4.0 → 2.5.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.
Files changed (95) hide show
  1. package/cascader/__test__/cascader.test.js +24 -0
  2. package/cascader/_story/cascader.stories.js +73 -0
  3. package/cascader/index.tsx +5 -2
  4. package/datePicker/_story/v2/FixInputRangeFocus.jsx +25 -0
  5. package/datePicker/_story/v2/index.js +2 -1
  6. package/datePicker/datePicker.tsx +4 -0
  7. package/dist/css/semi.css +51 -27
  8. package/dist/css/semi.min.css +1 -1
  9. package/dist/umd/semi-ui.js +481 -182
  10. package/dist/umd/semi-ui.js.map +1 -1
  11. package/dist/umd/semi-ui.min.js +1 -1
  12. package/dist/umd/semi-ui.min.js.map +1 -1
  13. package/form/_story/demo.jsx +1 -0
  14. package/input/index.tsx +1 -0
  15. package/input/textarea.tsx +1 -1
  16. package/lib/cjs/autoComplete/index.d.ts +1 -1
  17. package/lib/cjs/cascader/index.js +6 -0
  18. package/lib/cjs/datePicker/datePicker.js +16 -8
  19. package/lib/cjs/dropdown/index.d.ts +1 -1
  20. package/lib/cjs/form/baseForm.d.ts +1 -1
  21. package/lib/cjs/form/field.d.ts +1 -1
  22. package/lib/cjs/input/index.js +2 -1
  23. package/lib/cjs/input/textarea.js +1 -1
  24. package/lib/cjs/select/index.d.ts +3 -3
  25. package/lib/cjs/select/index.js +32 -28
  26. package/lib/cjs/select/option.js +2 -2
  27. package/lib/cjs/select/virtualRow.js +2 -2
  28. package/lib/cjs/table/Table.d.ts +1 -1
  29. package/lib/cjs/table/Table.js +8 -2
  30. package/lib/cjs/table/interface.d.ts +1 -0
  31. package/lib/cjs/tabs/interface.d.ts +1 -1
  32. package/lib/cjs/timePicker/TimePicker.js +2 -1
  33. package/lib/cjs/tooltip/index.d.ts +1 -1
  34. package/lib/cjs/tooltip/index.js +6 -2
  35. package/lib/cjs/tree/index.d.ts +2 -0
  36. package/lib/cjs/tree/index.js +15 -8
  37. package/lib/cjs/treeSelect/index.d.ts +2 -0
  38. package/lib/cjs/treeSelect/index.js +64 -27
  39. package/lib/cjs/upload/fileCard.js +31 -22
  40. package/lib/cjs/upload/index.d.ts +6 -0
  41. package/lib/cjs/upload/index.js +15 -8
  42. package/lib/cjs/upload/interface.d.ts +8 -6
  43. package/lib/es/autoComplete/index.d.ts +1 -1
  44. package/lib/es/cascader/index.js +5 -0
  45. package/lib/es/datePicker/datePicker.js +16 -8
  46. package/lib/es/dropdown/index.d.ts +1 -1
  47. package/lib/es/form/baseForm.d.ts +1 -1
  48. package/lib/es/form/field.d.ts +1 -1
  49. package/lib/es/input/index.js +2 -1
  50. package/lib/es/input/textarea.js +1 -1
  51. package/lib/es/select/index.d.ts +3 -3
  52. package/lib/es/select/index.js +30 -26
  53. package/lib/es/select/option.js +2 -2
  54. package/lib/es/select/virtualRow.js +2 -2
  55. package/lib/es/table/Table.d.ts +1 -1
  56. package/lib/es/table/Table.js +10 -2
  57. package/lib/es/table/interface.d.ts +1 -0
  58. package/lib/es/tabs/interface.d.ts +1 -1
  59. package/lib/es/timePicker/TimePicker.js +2 -1
  60. package/lib/es/tooltip/index.d.ts +1 -1
  61. package/lib/es/tooltip/index.js +6 -2
  62. package/lib/es/tree/index.d.ts +2 -0
  63. package/lib/es/tree/index.js +15 -8
  64. package/lib/es/treeSelect/index.d.ts +2 -0
  65. package/lib/es/treeSelect/index.js +64 -27
  66. package/lib/es/upload/fileCard.js +31 -24
  67. package/lib/es/upload/index.d.ts +6 -0
  68. package/lib/es/upload/index.js +14 -8
  69. package/lib/es/upload/interface.d.ts +8 -6
  70. package/package.json +9 -8
  71. package/select/index.tsx +18 -19
  72. package/select/option.tsx +2 -2
  73. package/select/virtualRow.tsx +2 -2
  74. package/table/Table.tsx +7 -2
  75. package/table/_story/table.stories.js +1 -2
  76. package/table/_story/v2/FixedHeaderMerge/index.jsx +98 -0
  77. package/table/_story/v2/FixedResizable/index.jsx +114 -0
  78. package/table/_story/v2/defaultFilteredValue.tsx +123 -0
  79. package/table/_story/v2/index.js +5 -0
  80. package/table/interface.ts +1 -0
  81. package/tabs/interface.ts +1 -1
  82. package/timePicker/TimePicker.tsx +1 -0
  83. package/tooltip/__test__/tooltip.test.js +48 -4
  84. package/tooltip/_story/tooltip.stories.js +83 -1
  85. package/tooltip/index.tsx +4 -4
  86. package/tree/__test__/treeMultiple.test.js +94 -0
  87. package/tree/_story/tree.stories.js +169 -0
  88. package/tree/index.tsx +12 -5
  89. package/treeSelect/__test__/treeMultiple.test.js +94 -0
  90. package/treeSelect/_story/treeSelect.stories.js +242 -0
  91. package/treeSelect/index.tsx +72 -40
  92. package/upload/_story/upload.stories.js +22 -6
  93. package/upload/fileCard.tsx +23 -23
  94. package/upload/index.tsx +15 -6
  95. package/upload/interface.ts +7 -5
@@ -179,6 +179,7 @@ class BasicDemoWithInit extends Component {
179
179
  <BasicSelect onChange={this.changeLabelPos} value={labelPosition}>
180
180
  <BasicSelect.Option value='top'>top</BasicSelect.Option>
181
181
  <BasicSelect.Option value='left'>left</BasicSelect.Option>
182
+ <BasicSelect.Option value='inset'>inset</BasicSelect.Option>
182
183
  </BasicSelect>
183
184
  <BasicSelect onChange={this.changeLabelAlign} value={labelAlign}>
184
185
  <BasicSelect.Option value='left'>left</BasicSelect.Option>
package/input/index.tsx CHANGED
@@ -387,6 +387,7 @@ class Input extends BaseComponent<InputProps, InputState> {
387
387
  prefix,
388
388
  mode,
389
389
  insetLabel,
390
+ insetLabelId,
390
391
  validateStatus,
391
392
  type,
392
393
  readonly,
@@ -313,7 +313,7 @@ class TextArea extends BaseComponent<TextAreaProps, TextAreaState> {
313
313
  }
314
314
  );
315
315
  const itemProps = {
316
- ...omit(rest, 'insetLabel', 'getValueLength', 'onClear', 'showClear'),
316
+ ...omit(rest, 'insetLabel', 'insetLabelId', 'getValueLength', 'onClear', 'showClear'),
317
317
  className: itemCls,
318
318
  disabled,
319
319
  readOnly: readonly,
@@ -113,7 +113,7 @@ declare class AutoComplete<T extends AutoCompleteItems> extends BaseComponent<Au
113
113
  onBlur: PropTypes.Requireable<(...args: any[]) => any>;
114
114
  onFocus: PropTypes.Requireable<(...args: any[]) => any>;
115
115
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
116
- position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
116
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
117
117
  placeholder: PropTypes.Requireable<string>;
118
118
  prefix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
119
119
  onChangeWithObject: PropTypes.Requireable<boolean>;
@@ -42,6 +42,8 @@ var _isString2 = _interopRequireDefault(require("lodash/isString"));
42
42
 
43
43
  var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
44
44
 
45
+ var _isSet2 = _interopRequireDefault(require("lodash/isSet"));
46
+
45
47
  var _react = _interopRequireWildcard(require("react"));
46
48
 
47
49
  var _reactDom = _interopRequireDefault(require("react-dom"));
@@ -776,6 +778,10 @@ class Cascader extends _baseComponent.default {
776
778
  realKeys = formatKeys;
777
779
  }
778
780
 
781
+ if ((0, _isSet2.default)(realKeys)) {
782
+ realKeys = [...realKeys];
783
+ }
784
+
779
785
  const calRes = (0, _treeUtil.calcCheckedKeys)((0, _flatten2.default)(realKeys), keyEntities);
780
786
  const checkedKeys = new _set.default(calRes.checkedKeys);
781
787
  const halfCheckedKeys = new _set.default(calRes.halfCheckedKeys); // disableStrictly
@@ -434,6 +434,10 @@ class DatePicker extends _baseComponent.default {
434
434
 
435
435
  if (prevProps.open !== this.props.open) {
436
436
  this.foundation.initPanelOpenStatus();
437
+
438
+ if (!this.props.open) {
439
+ this.foundation.clearRangeInputFocus();
440
+ }
437
441
  }
438
442
  }
439
443
 
@@ -604,14 +608,18 @@ class DatePicker extends _baseComponent.default {
604
608
  onRangeClear: this.handleRangeInputClear,
605
609
  onRangeEndTabPress: this.handleRangeEndTabPress
606
610
  });
607
- return /*#__PURE__*/_react.default.createElement("div", {
608
- onClick: this.handleTriggerWrapperClick,
609
- className: inputCls
610
- }, typeof triggerRender === 'function' ? /*#__PURE__*/_react.default.createElement(_trigger.default, (0, _assign.default)({}, props, {
611
- triggerRender: triggerRender,
612
- componentName: "DatePicker",
613
- componentProps: (0, _assign.default)({}, this.props)
614
- })) : /*#__PURE__*/_react.default.createElement(_dateInput.default, (0, _assign.default)({}, props)));
611
+ return (
612
+ /*#__PURE__*/
613
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events
614
+ _react.default.createElement("div", {
615
+ onClick: this.handleTriggerWrapperClick,
616
+ className: inputCls
617
+ }, typeof triggerRender === 'function' ? /*#__PURE__*/_react.default.createElement(_trigger.default, (0, _assign.default)({}, props, {
618
+ triggerRender: triggerRender,
619
+ componentName: "DatePicker",
620
+ componentProps: (0, _assign.default)({}, this.props)
621
+ })) : /*#__PURE__*/_react.default.createElement(_dateInput.default, (0, _assign.default)({}, props)))
622
+ );
615
623
  }
616
624
 
617
625
  render() {
@@ -58,7 +58,7 @@ declare class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
58
58
  render: PropTypes.Requireable<PropTypes.ReactNodeLike>;
59
59
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
60
60
  visible: PropTypes.Requireable<boolean>;
61
- position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
61
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
62
62
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
63
63
  mouseEnterDelay: PropTypes.Requireable<number>;
64
64
  mouseLeaveDelay: PropTypes.Requireable<number>;
@@ -80,7 +80,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
80
80
  emptyContent?: React.ReactNode;
81
81
  onDropdownVisibleChange?: (visible: boolean) => void;
82
82
  zIndex?: number;
83
- position?: "top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver";
83
+ position?: "top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
84
84
  onSearch?: (value: string) => void;
85
85
  dropdownClassName?: string;
86
86
  dropdownStyle?: React.CSSProperties;
@@ -28,7 +28,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
28
28
  emptyContent?: import("react").ReactNode;
29
29
  onDropdownVisibleChange?: (visible: boolean) => void;
30
30
  zIndex?: number;
31
- position?: "top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver";
31
+ position?: "top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
32
32
  onSearch?: (value: string) => void;
33
33
  dropdownClassName?: string;
34
34
  dropdownStyle?: import("react").CSSProperties;
@@ -364,6 +364,7 @@ class Input extends _baseComponent.default {
364
364
  prefix,
365
365
  mode,
366
366
  insetLabel,
367
+ insetLabelId,
367
368
  validateStatus,
368
369
  type,
369
370
  readonly,
@@ -379,7 +380,7 @@ class Input extends _baseComponent.default {
379
380
  maxLength,
380
381
  getValueLength
381
382
  } = _a,
382
- rest = __rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "placeholder", "prefix", "mode", "insetLabel", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength"]);
383
+ rest = __rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength"]);
383
384
 
384
385
  const {
385
386
  value,
@@ -280,7 +280,7 @@ class TextArea extends _baseComponent.default {
280
280
  ["".concat(prefixCls, "-textarea-autosize")]: autosize,
281
281
  ["".concat(prefixCls, "-textarea-showClear")]: showClear
282
282
  });
283
- const itemProps = (0, _assign.default)((0, _assign.default)({}, (0, _omit2.default)(rest, 'insetLabel', 'getValueLength', 'onClear', 'showClear')), {
283
+ const itemProps = (0, _assign.default)((0, _assign.default)({}, (0, _omit2.default)(rest, 'insetLabel', 'insetLabelId', 'getValueLength', 'onClear', 'showClear')), {
284
284
  className: itemCls,
285
285
  disabled,
286
286
  readOnly: readonly,
@@ -165,7 +165,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
165
165
  emptyContent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
166
166
  onDropdownVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
167
167
  zIndex: PropTypes.Requireable<number>;
168
- position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
168
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
169
169
  onSearch: PropTypes.Requireable<(...args: any[]) => any>;
170
170
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
171
171
  dropdownClassName: PropTypes.Requireable<string>;
@@ -243,8 +243,8 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
243
243
  renderOption(option: OptionProps, optionIndex: number, style?: React.CSSProperties): any;
244
244
  renderCreateOption(option: OptionProps, isFocused: boolean, optionIndex: number, style: React.CSSProperties): JSX.Element;
245
245
  onOptionHover(optionIndex: number): void;
246
- renderWithGroup(visibileOptions: OptionProps[]): JSX.Element[];
247
- renderVirtualizeList(visibileOptions: OptionProps[]): JSX.Element;
246
+ renderWithGroup(visibleOptions: OptionProps[]): JSX.Element[];
247
+ renderVirtualizeList(visibleOptions: OptionProps[]): JSX.Element;
248
248
  renderOptions(children?: React.ReactNode): JSX.Element;
249
249
  renderSingleSelection(selections: Map<OptionProps['label'], any>, filterable: boolean): JSX.Element;
250
250
  renderMultipleSelection(selections: Map<OptionProps['label'], any>, filterable: boolean): JSX.Element;
@@ -56,7 +56,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
56
56
 
57
57
  var _propTypes = _interopRequireDefault(require("prop-types"));
58
58
 
59
- var _context15 = _interopRequireDefault(require("../configProvider/context"));
59
+ var _context16 = _interopRequireDefault(require("../configProvider/context"));
60
60
 
61
61
  var _foundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/select/foundation"));
62
62
 
@@ -347,11 +347,19 @@ class Select extends _baseComponent.default {
347
347
  el.focus();
348
348
  } catch (error) {}
349
349
  },
350
- updateScrollTop: () => {
351
- var _context9, _context10;
350
+ updateScrollTop: index => {
351
+ var _context10, _context11;
352
352
 
353
353
  // eslint-disable-next-line max-len
354
- let destNode = document.querySelector((0, _concat.default)(_context9 = (0, _concat.default)(_context10 = "#".concat(prefixcls, "-")).call(_context10, this.selectOptionListID, " .")).call(_context9, prefixcls, "-option-selected"));
354
+ let optionClassName = ".".concat(prefixcls, "-option-selected");
355
+
356
+ if (index !== undefined) {
357
+ var _context9;
358
+
359
+ optionClassName = (0, _concat.default)(_context9 = ".".concat(prefixcls, "-option:nth-child(")).call(_context9, index, ")");
360
+ }
361
+
362
+ let destNode = document.querySelector((0, _concat.default)(_context10 = (0, _concat.default)(_context11 = "#".concat(prefixcls, "-")).call(_context11, this.selectOptionListID, " ")).call(_context10, optionClassName));
355
363
 
356
364
  if ((0, _isArray.default)(destNode)) {
357
365
  // eslint-disable-next-line prefer-destructuring
@@ -379,10 +387,10 @@ class Select extends _baseComponent.default {
379
387
  }
380
388
 
381
389
  componentDidUpdate(prevProps, prevState) {
382
- var _context11, _context12;
390
+ var _context12, _context13;
383
391
 
384
- const prevChildrenKeys = (0, _map2.default)(_context11 = _react.default.Children.toArray(prevProps.children)).call(_context11, child => child.key);
385
- const nowChildrenKeys = (0, _map2.default)(_context12 = _react.default.Children.toArray(this.props.children)).call(_context12, child => child.key);
392
+ const prevChildrenKeys = (0, _map2.default)(_context12 = _react.default.Children.toArray(prevProps.children)).call(_context12, child => child.key);
393
+ const nowChildrenKeys = (0, _map2.default)(_context13 = _react.default.Children.toArray(this.props.children)).call(_context13, child => child.key);
386
394
  let isOptionsChanged = false;
387
395
 
388
396
  if (!(0, _isEqual2.default)(prevChildrenKeys, nowChildrenKeys) || !(0, _isEqual2.default)(prevProps.optionList, this.props.optionList)) {
@@ -572,33 +580,29 @@ class Select extends _baseComponent.default {
572
580
  this.foundation.handleOptionMouseEnter(optionIndex);
573
581
  }
574
582
 
575
- renderWithGroup(visibileOptions) {
583
+ renderWithGroup(visibleOptions) {
576
584
  const content = [];
577
585
  const groupStatus = new _map.default();
578
- (0, _forEach.default)(visibileOptions).call(visibileOptions, (option, optionIndex) => {
586
+ (0, _forEach.default)(visibleOptions).call(visibleOptions, (option, optionIndex) => {
579
587
  const parentGroup = option._parentGroup;
580
588
  const optionContent = this.renderOption(option, optionIndex);
581
589
 
582
- if (parentGroup && groupStatus.has(parentGroup.label)) {
583
- // group content already insert
584
- content.push(optionContent);
585
- } else if (parentGroup) {
590
+ if (parentGroup && !groupStatus.has(parentGroup.label)) {
591
+ // when use with OptionGroup and group content not already insert
586
592
  const groupContent = /*#__PURE__*/_react.default.createElement(_optionGroup.default, (0, _assign.default)({}, parentGroup, {
587
593
  key: parentGroup.label
588
594
  }));
589
595
 
590
596
  groupStatus.set(parentGroup.label, true);
591
597
  content.push(groupContent);
592
- content.push(optionContent);
593
- } else {
594
- // when not use with OptionGroup
595
- content.push(optionContent);
596
598
  }
599
+
600
+ content.push(optionContent);
597
601
  });
598
602
  return content;
599
603
  }
600
604
 
601
- renderVirtualizeList(visibileOptions) {
605
+ renderVirtualizeList(visibleOptions) {
602
606
  const {
603
607
  virtualize
604
608
  } = this.props;
@@ -613,10 +617,10 @@ class Select extends _baseComponent.default {
613
617
  return /*#__PURE__*/_react.default.createElement(_reactWindow.FixedSizeList, {
614
618
  ref: this.virtualizeListRef,
615
619
  height: height || _constants.numbers.LIST_HEIGHT,
616
- itemCount: visibileOptions.length,
620
+ itemCount: visibleOptions.length,
617
621
  itemSize: itemSize,
618
622
  itemData: {
619
- visibileOptions,
623
+ visibleOptions,
620
624
  renderOption: this.renderOption
621
625
  },
622
626
  width: width || '100%',
@@ -627,7 +631,7 @@ class Select extends _baseComponent.default {
627
631
  }
628
632
 
629
633
  renderOptions(children) {
630
- var _context13;
634
+ var _context14;
631
635
 
632
636
  const {
633
637
  dropdownMinWidth,
@@ -647,11 +651,11 @@ class Select extends _baseComponent.default {
647
651
  multiple
648
652
  } = this.props; // Do a filter first, instead of directly judging in forEach, so that the focusIndex can correspond to
649
653
 
650
- const visibileOptions = (0, _filter.default)(options).call(options, item => item._show);
651
- let listContent = this.renderWithGroup(visibileOptions);
654
+ const visibleOptions = (0, _filter.default)(options).call(options, item => item._show);
655
+ let listContent = this.renderWithGroup(visibleOptions);
652
656
 
653
657
  if (virtualize) {
654
- listContent = this.renderVirtualizeList(visibileOptions);
658
+ listContent = this.renderVirtualizeList(visibleOptions);
655
659
  }
656
660
 
657
661
  const style = (0, _assign.default)({
@@ -663,7 +667,7 @@ class Select extends _baseComponent.default {
663
667
  });
664
668
  const isEmpty = !options.length || !(0, _some.default)(options).call(options, item => item._show);
665
669
  return /*#__PURE__*/_react.default.createElement("div", {
666
- id: (0, _concat.default)(_context13 = "".concat(prefixcls, "-")).call(_context13, this.selectOptionListID),
670
+ id: (0, _concat.default)(_context14 = "".concat(prefixcls, "-")).call(_context14, this.selectOptionListID),
667
671
  className: dropdownClassName,
668
672
  style: style
669
673
  }, outerTopSlot, /*#__PURE__*/_react.default.createElement("div", {
@@ -891,7 +895,7 @@ class Select extends _baseComponent.default {
891
895
  }
892
896
 
893
897
  renderSelection() {
894
- var _context14;
898
+ var _context15;
895
899
 
896
900
  const {
897
901
  disabled,
@@ -975,7 +979,7 @@ class Select extends _baseComponent.default {
975
979
  role: "combobox",
976
980
  "aria-disabled": disabled,
977
981
  "aria-expanded": isOpen,
978
- "aria-controls": (0, _concat.default)(_context14 = "".concat(prefixcls, "-")).call(_context14, this.selectOptionListID),
982
+ "aria-controls": (0, _concat.default)(_context15 = "".concat(prefixcls, "-")).call(_context15, this.selectOptionListID),
979
983
  "aria-haspopup": "listbox",
980
984
  "aria-label": "select value",
981
985
  "aria-invalid": this.props['aria-invalid'],
@@ -1042,7 +1046,7 @@ class Select extends _baseComponent.default {
1042
1046
 
1043
1047
  }
1044
1048
 
1045
- Select.contextType = _context15.default;
1049
+ Select.contextType = _context16.default;
1046
1050
  Select.Option = _option.default;
1047
1051
  Select.OptGroup = _optionGroup.default;
1048
1052
  Select.propTypes = {
@@ -65,9 +65,9 @@ class Option extends _react.PureComponent {
65
65
  const {
66
66
  props
67
67
  } = this;
68
- const isDisbled = props.disabled;
68
+ const isDisabled = props.disabled;
69
69
 
70
- if (!isDisbled) {
70
+ if (!isDisabled) {
71
71
  props.onSelect((0, _assign.default)((0, _assign.default)({}, rest), {
72
72
  value,
73
73
  label: label || children
@@ -15,9 +15,9 @@ const VirtualRow = _ref => {
15
15
  style
16
16
  } = _ref;
17
17
  const {
18
- visibileOptions
18
+ visibleOptions
19
19
  } = data;
20
- const option = visibileOptions[index];
20
+ const option = visibleOptions[index];
21
21
  return data.renderOption(option, index, style);
22
22
  };
23
23
 
@@ -298,7 +298,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
298
298
  showSizeChanger?: boolean;
299
299
  showQuickJumper?: boolean;
300
300
  popoverZIndex?: number;
301
- popoverPosition?: "top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver";
301
+ popoverPosition?: "top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
302
302
  hideOnSinglePage?: boolean;
303
303
  hoverShowPageSelect?: boolean;
304
304
  };
@@ -566,10 +566,15 @@ class Table extends _baseComponent.default {
566
566
  titleArr.push(sorter);
567
567
  }
568
568
 
569
+ const stateFilteredValue = (0, _get2.default)(curQuery, 'filteredValue');
570
+ const defaultFilteredValue = (0, _get2.default)(curQuery, 'defaultFilteredValue');
571
+ const filteredValue = stateFilteredValue ? stateFilteredValue : defaultFilteredValue;
572
+
569
573
  if ((0, _isArray.default)(column.filters) && column.filters.length || /*#__PURE__*/(0, _react.isValidElement)(column.filterDropdown)) {
570
574
  const filter = /*#__PURE__*/_react.default.createElement(_ColumnFilter.default, (0, _assign.default)({
571
575
  key: _constants.strings.DEFAULT_KEY_COLUMN_FILTER
572
576
  }, curQuery, {
577
+ filteredValue: filteredValue,
573
578
  onFilterDropdownVisibleChange: visible => _this.foundation.toggleShowFilter(dataIndex, visible),
574
579
  onSelect: data => _this.foundation.handleFilterSelect(dataIndex, data)
575
580
  }));
@@ -1154,11 +1159,12 @@ class Table extends _baseComponent.default {
1154
1159
  willUpdateStates.cachedColumns = props.columns;
1155
1160
  willUpdateStates.cachedChildren = null;
1156
1161
  } else if (props.children && props.children !== state.cachedChildren) {
1157
- const newFlattenColumns = (0, _utils.flattenColumns)((0, _getColumns.default)(props.children));
1162
+ const newNestedColumns = (0, _getColumns.default)(props.children);
1163
+ const newFlattenColumns = (0, _utils.flattenColumns)(newNestedColumns);
1158
1164
  const columns = (0, _utils.mergeColumns)(state.queries, newFlattenColumns, null, false);
1159
1165
  willUpdateStates.flattenColumns = newFlattenColumns;
1160
1166
  willUpdateStates.queries = [...columns];
1161
- willUpdateStates.cachedColumns = [...columns];
1167
+ willUpdateStates.cachedColumns = [...newNestedColumns];
1162
1168
  willUpdateStates.cachedChildren = props.children;
1163
1169
  } // Update controlled selection column
1164
1170
 
@@ -63,6 +63,7 @@ export interface ColumnProps<RecordType extends Record<string, any> = any> {
63
63
  className?: string;
64
64
  colSpan?: number;
65
65
  dataIndex?: string;
66
+ defaultFilteredValue?: any[];
66
67
  defaultSortOrder?: SortOrder;
67
68
  filterChildrenRecord?: boolean;
68
69
  filterDropdown?: React.ReactNode;
@@ -52,7 +52,7 @@ export interface TabBarProps {
52
52
  export interface TabPaneProps {
53
53
  className?: string;
54
54
  disabled?: boolean;
55
- icon?: string;
55
+ icon?: ReactNode;
56
56
  itemKey?: string;
57
57
  style?: CSSProperties;
58
58
  tab?: ReactNode;
@@ -330,6 +330,7 @@ class TimePicker extends _baseComponent.default {
330
330
  panelFooter,
331
331
  rangeSeparator,
332
332
  onOpenChange,
333
+ onChangeWithDateFirst,
333
334
  popupClassName: propPopupClassName,
334
335
  hideDisabledOptions,
335
336
  use12Hours,
@@ -341,7 +342,7 @@ class TimePicker extends _baseComponent.default {
341
342
  motion,
342
343
  autoAdjustOverflow
343
344
  } = _a,
344
- rest = __rest(_a, ["prefixCls", "placeholder", "disabled", "defaultValue", "className", "popupStyle", "size", "style", "locale", "localeCode", "zIndex", "getPopupContainer", "insetLabel", "insetLabelId", "inputStyle", "showClear", "panelHeader", "panelFooter", "rangeSeparator", "onOpenChange", "popupClassName", "hideDisabledOptions", "use12Hours", "minuteStep", "hourStep", "secondStep", "scrollItemProps", "triggerRender", "motion", "autoAdjustOverflow"]);
345
+ rest = __rest(_a, ["prefixCls", "placeholder", "disabled", "defaultValue", "className", "popupStyle", "size", "style", "locale", "localeCode", "zIndex", "getPopupContainer", "insetLabel", "insetLabelId", "inputStyle", "showClear", "panelHeader", "panelFooter", "rangeSeparator", "onOpenChange", "onChangeWithDateFirst", "popupClassName", "hideDisabledOptions", "use12Hours", "minuteStep", "hourStep", "secondStep", "scrollItemProps", "triggerRender", "motion", "autoAdjustOverflow"]);
345
346
 
346
347
  const format = this.foundation.getDefaultFormatIfNeed();
347
348
  const position = this.foundation.getPosition();
@@ -67,7 +67,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
67
67
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
68
68
  motion: PropTypes.Requireable<boolean | object>;
69
69
  autoAdjustOverflow: PropTypes.Requireable<boolean>;
70
- position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
70
+ position: PropTypes.Requireable<"top" | "topLeft" | "topRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom" | "bottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
71
71
  getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
72
72
  mouseEnterDelay: PropTypes.Requireable<number>;
73
73
  mouseLeaveDelay: PropTypes.Requireable<number>;
@@ -484,11 +484,15 @@ class Tooltip extends _baseComponent.default {
484
484
  }
485
485
  };
486
486
 
487
- document.addEventListener('click', this.clickOutsideHandler, false);
487
+ document.addEventListener('mousedown', this.clickOutsideHandler, {
488
+ capture: true
489
+ });
488
490
  },
489
491
  unregisterClickOutsideHandler: () => {
490
492
  if (this.clickOutsideHandler) {
491
- document.removeEventListener('click', this.clickOutsideHandler, false);
493
+ document.removeEventListener('mousedown', this.clickOutsideHandler, {
494
+ capture: true
495
+ });
492
496
  this.clickOutsideHandler = null;
493
497
  }
494
498
  },
@@ -70,6 +70,7 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
70
70
  onDragStart: PropTypes.Requireable<(...args: any[]) => any>;
71
71
  onDrop: PropTypes.Requireable<(...args: any[]) => any>;
72
72
  labelEllipsis: PropTypes.Requireable<boolean>;
73
+ checkRelation: PropTypes.Requireable<string>;
73
74
  'aria-label': PropTypes.Requireable<string>;
74
75
  };
75
76
  static defaultProps: {
@@ -90,6 +91,7 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
90
91
  disableStrictly: boolean;
91
92
  draggable: boolean;
92
93
  autoExpandWhenDragEnter: boolean;
94
+ checkRelation: string;
93
95
  };
94
96
  static TreeNode: typeof TreeNode;
95
97
  inputRef: React.RefObject<typeof Input>;
@@ -236,6 +236,7 @@ class Tree extends _baseComponent.default {
236
236
  selectedKeys: [],
237
237
  checkedKeys: new _set.default(),
238
238
  halfCheckedKeys: new _set.default(),
239
+ realCheckedKeys: new _set.default([]),
239
240
  motionKeys: new _set.default([]),
240
241
  motionType: 'hide',
241
242
  expandedKeys: new _set.default(props.expandedKeys),
@@ -446,12 +447,16 @@ class Tree extends _baseComponent.default {
446
447
  }
447
448
 
448
449
  if (checkedKeyValues) {
449
- const {
450
- checkedKeys,
451
- halfCheckedKeys
452
- } = (0, _treeUtil.calcCheckedKeys)(checkedKeyValues, keyEntities);
453
- newState.checkedKeys = checkedKeys;
454
- newState.halfCheckedKeys = halfCheckedKeys;
450
+ if (props.checkRelation === 'unRelated') {
451
+ newState.realCheckedKeys = new _set.default(checkedKeyValues);
452
+ } else if (props.checkRelation === 'related') {
453
+ const {
454
+ checkedKeys,
455
+ halfCheckedKeys
456
+ } = (0, _treeUtil.calcCheckedKeys)(checkedKeyValues, keyEntities);
457
+ newState.checkedKeys = checkedKeys;
458
+ newState.halfCheckedKeys = halfCheckedKeys;
459
+ }
455
460
  }
456
461
  } // update loadedKeys
457
462
 
@@ -461,7 +466,7 @@ class Tree extends _baseComponent.default {
461
466
  } // update disableStrictly
462
467
 
463
468
 
464
- if (treeData && props.disableStrictly) {
469
+ if (treeData && props.disableStrictly && props.checkRelation === 'related') {
465
470
  newState.disabledKeys = (0, _treeUtil.calcDisabledKeys)(keyEntities);
466
471
  }
467
472
 
@@ -782,6 +787,7 @@ Tree.propTypes = {
782
787
  onDragStart: _propTypes.default.func,
783
788
  onDrop: _propTypes.default.func,
784
789
  labelEllipsis: _propTypes.default.bool,
790
+ checkRelation: _propTypes.default.string,
785
791
  'aria-label': _propTypes.default.string
786
792
  };
787
793
  Tree.defaultProps = {
@@ -801,7 +807,8 @@ Tree.defaultProps = {
801
807
  expandAction: false,
802
808
  disableStrictly: false,
803
809
  draggable: false,
804
- autoExpandWhenDragEnter: true
810
+ autoExpandWhenDragEnter: true,
811
+ checkRelation: 'related'
805
812
  };
806
813
  Tree.TreeNode = _treeNode.default;
807
814
  var _default = Tree;
@@ -168,6 +168,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
168
168
  optionListStyle: PropTypes.Requireable<object>;
169
169
  searchRender: PropTypes.Requireable<boolean | ((...args: any[]) => any)>;
170
170
  renderSelectedItem: PropTypes.Requireable<(...args: any[]) => any>;
171
+ checkRelation: PropTypes.Requireable<string>;
171
172
  'aria-label': PropTypes.Requireable<string>;
172
173
  };
173
174
  static defaultProps: Partial<TreeSelectProps>;
@@ -192,6 +193,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
192
193
  removeTag: (removedKey: TreeNodeData['key']) => void;
193
194
  handleClick: (e: React.MouseEvent) => void;
194
195
  handleSelectionEnterPress: (e: React.KeyboardEvent<HTMLDivElement>) => void;
196
+ hasValue: () => boolean;
195
197
  showClearBtn: () => boolean;
196
198
  renderTagList: () => React.ReactNode[];
197
199
  /**