@douyinfe/semi-ui 2.17.1 → 2.18.0-beta.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 (149) hide show
  1. package/anchor/index.tsx +1 -1
  2. package/anchor/link.tsx +3 -4
  3. package/autoComplete/__test__/autoComplete.test.js +6 -6
  4. package/autoComplete/index.tsx +1 -1
  5. package/autoComplete/option.tsx +164 -0
  6. package/calendar/__test__/calendar.test.js +21 -2
  7. package/calendar/_story/calendar.stories.js +31 -0
  8. package/calendar/index.tsx +3 -1
  9. package/calendar/interface.ts +2 -1
  10. package/carousel/index.tsx +5 -5
  11. package/dist/css/semi.css +160 -22
  12. package/dist/css/semi.min.css +1 -1
  13. package/dist/umd/semi-ui.js +332 -74
  14. package/dist/umd/semi-ui.js.map +1 -1
  15. package/dist/umd/semi-ui.min.js +1 -1
  16. package/dist/umd/semi-ui.min.js.map +1 -1
  17. package/form/_story/FieldProps/labelOptional.jsx +30 -0
  18. package/form/_story/form.stories.js +7 -0
  19. package/form/hoc/withField.tsx +1 -0
  20. package/form/label.tsx +21 -7
  21. package/gulpfile.js +3 -1
  22. package/lib/cjs/_base/base.css +35 -0
  23. package/lib/cjs/anchor/index.js +2 -1
  24. package/lib/cjs/anchor/link.d.ts +1 -1
  25. package/lib/cjs/anchor/link.js +9 -5
  26. package/lib/cjs/autoComplete/index.d.ts +1 -1
  27. package/lib/cjs/autoComplete/index.js +1 -1
  28. package/lib/cjs/autoComplete/option.d.ts +50 -0
  29. package/lib/cjs/autoComplete/option.js +218 -0
  30. package/lib/cjs/calendar/index.d.ts +2 -0
  31. package/lib/cjs/calendar/index.js +3 -1
  32. package/lib/cjs/calendar/interface.d.ts +2 -1
  33. package/lib/cjs/carousel/index.js +2 -2
  34. package/lib/cjs/form/hoc/withField.js +2 -1
  35. package/lib/cjs/form/label.d.ts +8 -5
  36. package/lib/cjs/form/label.js +15 -4
  37. package/lib/cjs/locale/interface.d.ts +3 -0
  38. package/lib/cjs/locale/source/ar.js +3 -0
  39. package/lib/cjs/locale/source/de.js +3 -0
  40. package/lib/cjs/locale/source/en_GB.js +3 -0
  41. package/lib/cjs/locale/source/en_US.js +3 -0
  42. package/lib/cjs/locale/source/es.js +3 -0
  43. package/lib/cjs/locale/source/fr.js +3 -0
  44. package/lib/cjs/locale/source/id_ID.js +3 -0
  45. package/lib/cjs/locale/source/it.js +3 -0
  46. package/lib/cjs/locale/source/ja_JP.js +3 -0
  47. package/lib/cjs/locale/source/ko_KR.js +3 -0
  48. package/lib/cjs/locale/source/ms_MY.js +3 -0
  49. package/lib/cjs/locale/source/pt_BR.js +3 -0
  50. package/lib/cjs/locale/source/ru_RU.js +3 -0
  51. package/lib/cjs/locale/source/th_TH.js +3 -0
  52. package/lib/cjs/locale/source/tr_TR.js +3 -0
  53. package/lib/cjs/locale/source/vi_VN.js +3 -0
  54. package/lib/cjs/locale/source/zh_CN.js +3 -0
  55. package/lib/cjs/locale/source/zh_TW.js +3 -0
  56. package/lib/cjs/modal/Modal.js +0 -8
  57. package/lib/cjs/modal/ModalContent.js +4 -1
  58. package/lib/cjs/tag/group.d.ts +3 -0
  59. package/lib/cjs/tag/group.js +24 -6
  60. package/lib/cjs/tag/index.d.ts +2 -1
  61. package/lib/cjs/tag/index.js +7 -5
  62. package/lib/cjs/tag/interface.d.ts +2 -1
  63. package/lib/cjs/tree/index.d.ts +3 -1
  64. package/lib/cjs/tree/index.js +23 -0
  65. package/lib/cjs/tree/interface.d.ts +4 -0
  66. package/lib/es/_base/base.css +35 -0
  67. package/lib/es/anchor/index.js +2 -1
  68. package/lib/es/anchor/link.d.ts +1 -1
  69. package/lib/es/anchor/link.js +9 -5
  70. package/lib/es/autoComplete/index.d.ts +1 -1
  71. package/lib/es/autoComplete/index.js +1 -1
  72. package/lib/es/autoComplete/option.d.ts +50 -0
  73. package/lib/es/autoComplete/option.js +188 -0
  74. package/lib/es/calendar/index.d.ts +2 -0
  75. package/lib/es/calendar/index.js +3 -1
  76. package/lib/es/calendar/interface.d.ts +2 -1
  77. package/lib/es/carousel/index.js +2 -2
  78. package/lib/es/form/hoc/withField.js +2 -1
  79. package/lib/es/form/label.d.ts +8 -5
  80. package/lib/es/form/label.js +13 -4
  81. package/lib/es/locale/interface.d.ts +3 -0
  82. package/lib/es/locale/source/ar.js +3 -0
  83. package/lib/es/locale/source/de.js +3 -0
  84. package/lib/es/locale/source/en_GB.js +3 -0
  85. package/lib/es/locale/source/en_US.js +3 -0
  86. package/lib/es/locale/source/es.js +3 -0
  87. package/lib/es/locale/source/fr.js +3 -0
  88. package/lib/es/locale/source/id_ID.js +3 -0
  89. package/lib/es/locale/source/it.js +3 -0
  90. package/lib/es/locale/source/ja_JP.js +3 -0
  91. package/lib/es/locale/source/ko_KR.js +3 -0
  92. package/lib/es/locale/source/ms_MY.js +3 -0
  93. package/lib/es/locale/source/pt_BR.js +3 -0
  94. package/lib/es/locale/source/ru_RU.js +3 -0
  95. package/lib/es/locale/source/th_TH.js +3 -0
  96. package/lib/es/locale/source/tr_TR.js +3 -0
  97. package/lib/es/locale/source/vi_VN.js +3 -0
  98. package/lib/es/locale/source/zh_CN.js +3 -0
  99. package/lib/es/locale/source/zh_TW.js +3 -0
  100. package/lib/es/modal/Modal.js +0 -8
  101. package/lib/es/modal/ModalContent.js +4 -1
  102. package/lib/es/tag/group.d.ts +3 -0
  103. package/lib/es/tag/group.js +24 -6
  104. package/lib/es/tag/index.d.ts +2 -1
  105. package/lib/es/tag/index.js +7 -5
  106. package/lib/es/tag/interface.d.ts +2 -1
  107. package/lib/es/tree/index.d.ts +3 -1
  108. package/lib/es/tree/index.js +22 -0
  109. package/lib/es/tree/interface.d.ts +4 -0
  110. package/locale/interface.ts +3 -0
  111. package/locale/source/ar.ts +3 -0
  112. package/locale/source/de.ts +3 -0
  113. package/locale/source/en_GB.ts +3 -0
  114. package/locale/source/en_US.ts +3 -0
  115. package/locale/source/es.ts +3 -0
  116. package/locale/source/fr.ts +3 -0
  117. package/locale/source/id_ID.ts +3 -0
  118. package/locale/source/it.ts +3 -0
  119. package/locale/source/ja_JP.ts +3 -0
  120. package/locale/source/ko_KR.ts +3 -0
  121. package/locale/source/ms_MY.ts +3 -0
  122. package/locale/source/pt_BR.ts +3 -0
  123. package/locale/source/ru_RU.ts +3 -0
  124. package/locale/source/th_TH.ts +3 -0
  125. package/locale/source/tr_TR.ts +4 -1
  126. package/locale/source/vi_VN.ts +3 -0
  127. package/locale/source/zh_CN.ts +3 -0
  128. package/locale/source/zh_TW.ts +3 -0
  129. package/modal/Modal.tsx +0 -6
  130. package/modal/ModalContent.tsx +4 -1
  131. package/modal/__test__/modal.test.js +1 -1
  132. package/modal/_story/__snapshots__/modal.stories.tsx.snap +203 -0
  133. package/package.json +7 -7
  134. package/radio/_story/radio.stories.js +2 -2
  135. package/rating/__test__/rating.test.js +1 -1
  136. package/select/__test__/select.test.js +11 -17
  137. package/select/_story/select.stories.js +6 -6
  138. package/steps/_story/steps.stories.js +3 -3
  139. package/switch/_story/switch.stories.js +4 -4
  140. package/switch/_story/switch.stories.tsx +4 -4
  141. package/tag/_story/tag.stories.js +57 -1
  142. package/tag/group.tsx +20 -3
  143. package/tag/index.tsx +6 -5
  144. package/tag/interface.ts +2 -1
  145. package/transfer/_story/transfer.stories.js +2 -2
  146. package/tree/_story/tree.stories.js +152 -3
  147. package/tree/index.tsx +16 -1
  148. package/tree/interface.ts +6 -0
  149. package/upload/_story/upload.stories.js +2 -2
@@ -30711,6 +30711,9 @@ const local = {
30711
30711
  clearSelectAll: '取消全选',
30712
30712
  total: '共 ${total} 项',
30713
30713
  selected: '已选 ${total} 项'
30714
+ },
30715
+ Form: {
30716
+ optional: '(可选)'
30714
30717
  }
30715
30718
  }; // 中文
30716
30719
 
@@ -34286,10 +34289,14 @@ class link_Link extends baseComponent_BaseComponent {
34286
34289
  } = this.props;
34287
34290
 
34288
34291
  if (!this.context.autoCollapse) {
34289
- return this.props.children;
34292
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
34293
+ role: "list"
34294
+ }, children);
34290
34295
  }
34291
34296
 
34292
- return activeLink === href || childMap[href] && childMap[href].has(activeLink) ? children : null;
34297
+ return activeLink === href || childMap[href] && childMap[href].has(activeLink) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
34298
+ role: "list"
34299
+ }, children) : null;
34293
34300
  };
34294
34301
 
34295
34302
  this.foundation = new linkFoundation_LinkFoundation(this.adapter);
@@ -34365,8 +34372,7 @@ class link_Link extends baseComponent_BaseComponent {
34365
34372
  ["".concat(link_prefixCls, "-link-title-disabled")]: disabled
34366
34373
  });
34367
34374
  const ariaProps = {
34368
- 'aria-disabled': disabled,
34369
- 'aria-label': href
34375
+ 'aria-disabled': disabled
34370
34376
  };
34371
34377
 
34372
34378
  if (active) {
@@ -34379,7 +34385,8 @@ class link_Link extends baseComponent_BaseComponent {
34379
34385
 
34380
34386
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
34381
34387
  className: linkCls,
34382
- style: style
34388
+ style: style,
34389
+ role: "listitem"
34383
34390
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({
34384
34391
  role: "link",
34385
34392
  tabIndex: 0
@@ -34683,7 +34690,8 @@ class anchor_Anchor extends baseComponent_BaseComponent {
34683
34690
  top: slideBarTop
34684
34691
  }
34685
34692
  })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
34686
- className: anchorWrapper
34693
+ className: anchorWrapper,
34694
+ role: "list"
34687
34695
  }, children)));
34688
34696
  }
34689
34697
 
@@ -34751,7 +34759,9 @@ const VALIDATE_STATUS = ['default', 'error', 'warning', 'success']; // const VAL
34751
34759
 
34752
34760
 
34753
34761
  const autoComplete_constants_cssClasses = {
34754
- PREFIX: "".concat(BASE_CLASS_PREFIX, "-autocomplete")
34762
+ PREFIX: "".concat(BASE_CLASS_PREFIX, "-autocomplete"),
34763
+ PREFIX_OPTION: "".concat(BASE_CLASS_PREFIX, "-autoComplete-option"),
34764
+ PREFIX_GROUP: "".concat(BASE_CLASS_PREFIX, "-autoComplete-group")
34755
34765
  };
34756
34766
  const autoComplete_constants_strings = {
34757
34767
  SIZE: ['small', 'large', 'default'],
@@ -36529,27 +36539,7 @@ trigger_Trigger.propTypes = {
36529
36539
  style: prop_types_default.a.object
36530
36540
  };
36531
36541
  /* harmony default export */ var trigger_0 = (trigger_Trigger);
36532
- // CONCATENATED MODULE: ../semi-foundation/select/constants.ts
36533
-
36534
-
36535
- const select_constants_cssClasses = {
36536
- PREFIX: "".concat(BASE_CLASS_PREFIX, "-select"),
36537
- PREFIX_OPTION: "".concat(BASE_CLASS_PREFIX, "-select-option"),
36538
- PREFIX_GROUP: "".concat(BASE_CLASS_PREFIX, "-select-group")
36539
- };
36540
- const select_constants_strings = {
36541
- SIZE_SET: ['small', 'large', 'default'],
36542
- POSITION_SET: tooltip_constants_strings.POSITION_SET,
36543
- MODE_SELECT: 'select',
36544
- MODE_AUTOCOMPLETE: 'autoComplete',
36545
- // MODE_TAGS: 'tags',
36546
- STATUS: VALIDATE_STATUS
36547
- };
36548
- const select_constants_numbers = {
36549
- LIST_HEIGHT: 300
36550
- };
36551
-
36552
- // CONCATENATED MODULE: ./select/option.tsx
36542
+ // CONCATENATED MODULE: ./autoComplete/option.tsx
36553
36543
 
36554
36544
 
36555
36545
 
@@ -36631,10 +36621,9 @@ class option_Option extends external_root_React_commonjs2_react_commonjs_react_a
36631
36621
  onMouseEnter,
36632
36622
  prefixCls,
36633
36623
  renderOptionItem,
36634
- inputValue,
36635
- id
36624
+ inputValue
36636
36625
  } = _a,
36637
- rest = option_rest(_a, ["children", "disabled", "value", "selected", "label", "empty", "emptyContent", "onSelect", "focused", "showTick", "className", "style", "onMouseEnter", "prefixCls", "renderOptionItem", "inputValue", "id"]);
36626
+ rest = option_rest(_a, ["children", "disabled", "value", "selected", "label", "empty", "emptyContent", "onSelect", "focused", "showTick", "className", "style", "onMouseEnter", "prefixCls", "renderOptionItem", "inputValue"]);
36638
36627
 
36639
36628
  const optionClassName = classnames_default()(prefixCls, {
36640
36629
  ["".concat(prefixCls, "-disabled")]: disabled,
@@ -36698,7 +36687,6 @@ class option_Option extends external_root_React_commonjs2_react_commonjs_react_a
36698
36687
  },
36699
36688
  onMouseEnter: e => onMouseEnter && onMouseEnter(e),
36700
36689
  role: "option",
36701
- id: id,
36702
36690
  "aria-selected": selected ? "true" : "false",
36703
36691
  "aria-disabled": disabled ? "true" : "false",
36704
36692
  style: style
@@ -36737,9 +36725,9 @@ option_Option.propTypes = {
36737
36725
  inputValue: prop_types_default.a.string
36738
36726
  };
36739
36727
  option_Option.defaultProps = {
36740
- prefixCls: select_constants_cssClasses.PREFIX_OPTION
36728
+ prefixCls: autoComplete_constants_cssClasses.PREFIX_OPTION
36741
36729
  };
36742
- /* harmony default export */ var select_option = (option_Option);
36730
+ /* harmony default export */ var autoComplete_option = (option_Option);
36743
36731
  // EXTERNAL MODULE: ../semi-foundation/autoComplete/autoComplete.scss
36744
36732
  var autoComplete = __webpack_require__("t64S");
36745
36733
 
@@ -37000,7 +36988,7 @@ class autoComplete_AutoComplete extends baseComponent_BaseComponent {
37000
36988
  focusIndex
37001
36989
  } = this.state;
37002
36990
  const isFocused = optionIndex === focusIndex;
37003
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(select_option, assign_default()({
36991
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(autoComplete_option, assign_default()({
37004
36992
  showTick: false,
37005
36993
  onSelect: (v, e) => this.onSelect(v, optionIndex, e),
37006
36994
  // selected={selection.has(option.label)}
@@ -37135,7 +37123,7 @@ autoComplete_AutoComplete.propTypes = {
37135
37123
  validateStatus: prop_types_default.a.oneOf(autoComplete_statusSet),
37136
37124
  zIndex: prop_types_default.a.number
37137
37125
  };
37138
- autoComplete_AutoComplete.Option = select_option;
37126
+ autoComplete_AutoComplete.Option = autoComplete_option;
37139
37127
  autoComplete_AutoComplete.defaultProps = {
37140
37128
  stopPropagation: true,
37141
37129
  motion: true,
@@ -43568,7 +43556,10 @@ const calcRangeData = (value, start, rangeLen, mode, locale) => {
43568
43556
  const calcWeekData = function (value) {
43569
43557
  let mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'week';
43570
43558
  let locale = arguments.length > 2 ? arguments[2] : undefined;
43571
- const start = startOfWeek(value);
43559
+ let weekStartsOn = arguments.length > 3 ? arguments[3] : undefined;
43560
+ const start = startOfWeek(value, {
43561
+ weekStartsOn
43562
+ });
43572
43563
  return calcRangeData(value, start, 7, mode, locale);
43573
43564
  };
43574
43565
  /**
@@ -43834,6 +43825,7 @@ const renderDailyEvent = event => {
43834
43825
 
43835
43826
 
43836
43827
 
43828
+
43837
43829
  class foundation_CalendarFoundation extends foundation {
43838
43830
  constructor(adapter) {
43839
43831
  super(assign_default()({}, adapter));
@@ -43936,7 +43928,10 @@ class foundation_CalendarFoundation extends foundation {
43936
43928
  data.month = format_format(value, 'LLL', {
43937
43929
  locale: dateFnsLocale
43938
43930
  });
43939
- data.week = calcWeekData(value, 'week', dateFnsLocale);
43931
+ const {
43932
+ weekStartsOn
43933
+ } = this.getProps();
43934
+ data.week = calcWeekData(value, 'week', dateFnsLocale, weekStartsOn);
43940
43935
 
43941
43936
  this._adapter.setWeeklyData(data);
43942
43937
 
@@ -43964,10 +43959,13 @@ class foundation_CalendarFoundation extends foundation {
43964
43959
 
43965
43960
  const monthStart = startOfMonth(value);
43966
43961
  const data = {};
43962
+ const {
43963
+ weekStartsOn
43964
+ } = this.getProps();
43967
43965
  const numberOfWeek = getWeeksInMonth(value);
43968
43966
 
43969
43967
  map_default()(_context = [...instance_keys_default()(_context2 = Array(numberOfWeek)).call(_context2)]).call(_context, ind => {
43970
- data[ind] = calcWeekData(addDays(monthStart, ind * 7), 'month', dateFnsLocale);
43968
+ data[ind] = calcWeekData(addDays(monthStart, ind * 7), 'month', dateFnsLocale, weekStartsOn);
43971
43969
  });
43972
43970
 
43973
43971
  this._adapter.setMonthlyData(data);
@@ -45898,6 +45896,7 @@ calendar_Calendar.propTypes = {
45898
45896
  })),
45899
45897
  mode: prop_types_default.a.string,
45900
45898
  showCurrTime: prop_types_default.a.bool,
45899
+ weekStartsOn: prop_types_default.a.number,
45901
45900
  scrollTop: prop_types_default.a.number,
45902
45901
  onClick: prop_types_default.a.func,
45903
45902
  renderTimeDisplay: prop_types_default.a.func,
@@ -45914,7 +45913,8 @@ calendar_Calendar.defaultProps = {
45914
45913
  mode: 'week',
45915
45914
  markWeekend: false,
45916
45915
  height: 600,
45917
- scrollTop: 400
45916
+ scrollTop: 400,
45917
+ weekStartsOn: 0
45918
45918
  };
45919
45919
 
45920
45920
  /* harmony default export */ var calendar_0 = (calendar_Calendar);
@@ -46643,7 +46643,7 @@ class foundation_CarouselFoundation extends foundation {
46643
46643
 
46644
46644
  this._adapter.setIsReverse(stateActiveIndex > targetIndex);
46645
46645
 
46646
- if (this.getIsControledComponent()) {
46646
+ if (this.getIsControlledComponent()) {
46647
46647
  this._notifyChange(targetIndex);
46648
46648
  } else {
46649
46649
  this._notifyChange(targetIndex);
@@ -46660,7 +46660,7 @@ class foundation_CarouselFoundation extends foundation {
46660
46660
 
46661
46661
  this._adapter.setIsReverse(false);
46662
46662
 
46663
- if (this.getIsControledComponent()) {
46663
+ if (this.getIsControlledComponent()) {
46664
46664
  this._notifyChange(targetIndex);
46665
46665
  } else {
46666
46666
  this._notifyChange(targetIndex);
@@ -46677,7 +46677,7 @@ class foundation_CarouselFoundation extends foundation {
46677
46677
 
46678
46678
  this._adapter.setIsReverse(true);
46679
46679
 
46680
- if (this.getIsControledComponent()) {
46680
+ if (this.getIsControlledComponent()) {
46681
46681
  this._notifyChange(targetIndex);
46682
46682
  } else {
46683
46683
  this._notifyChange(targetIndex);
@@ -46739,7 +46739,7 @@ class foundation_CarouselFoundation extends foundation {
46739
46739
  return speed;
46740
46740
  }
46741
46741
 
46742
- getIsControledComponent() {
46742
+ getIsControlledComponent() {
46743
46743
  return this._isInProps('activeIndex');
46744
46744
  }
46745
46745
 
@@ -46773,7 +46773,7 @@ class foundation_CarouselFoundation extends foundation {
46773
46773
 
46774
46774
  this._notifyChange(activeIndex);
46775
46775
 
46776
- if (!this.getIsControledComponent()) {
46776
+ if (!this.getIsControlledComponent()) {
46777
46777
  this.handleNewActiveIndex(activeIndex);
46778
46778
  }
46779
46779
  }
@@ -47066,7 +47066,7 @@ class carousel_Carousel extends baseComponent_BaseComponent {
47066
47066
  };
47067
47067
 
47068
47068
  this.handleAutoPlay = () => {
47069
- if (!this.foundation.getIsControledComponent()) {
47069
+ if (!this.foundation.getIsControlledComponent()) {
47070
47070
  this.foundation.handleAutoPlay();
47071
47071
  }
47072
47072
  };
@@ -47086,7 +47086,7 @@ class carousel_Carousel extends baseComponent_BaseComponent {
47086
47086
  autoPlay
47087
47087
  } = this.props;
47088
47088
 
47089
- if ((typeof autoPlay !== 'object' || autoPlay.hoverToPause) && !this.foundation.getIsControledComponent()) {
47089
+ if ((typeof autoPlay !== 'object' || autoPlay.hoverToPause) && !this.foundation.getIsControlledComponent()) {
47090
47090
  this.foundation.handleAutoPlay();
47091
47091
  }
47092
47092
  };
@@ -50624,13 +50624,13 @@ class tag_Tag extends external_root_React_commonjs2_react_commonjs_react_amd_rea
50624
50624
  }
50625
50625
  }
50626
50626
 
50627
- close(e, value) {
50627
+ close(e, value, tagKey) {
50628
50628
  const {
50629
50629
  onClose
50630
50630
  } = this.props;
50631
50631
  e.stopPropagation();
50632
50632
  e.nativeEvent.stopImmediatePropagation();
50633
- onClose && onClose(value, e); // when user call e.preventDefault() in onClick callback, tag will not hidden
50633
+ onClose && onClose(value, e, tagKey); // when user call e.preventDefault() in onClick callback, tag will not hidden
50634
50634
 
50635
50635
  if (e.defaultPrevented) {
50636
50636
  return;
@@ -50649,7 +50649,7 @@ class tag_Tag extends external_root_React_commonjs2_react_commonjs_react_amd_rea
50649
50649
  switch (event.key) {
50650
50650
  case "Backspace":
50651
50651
  case "Delete":
50652
- closable && this.close(event, this.props.children);
50652
+ closable && this.close(event, this.props.children, this.props.tagKey);
50653
50653
  handlePrevent(event);
50654
50654
  break;
50655
50655
 
@@ -50686,6 +50686,7 @@ class tag_Tag extends external_root_React_commonjs2_react_commonjs_react_amd_rea
50686
50686
 
50687
50687
  const _a = this.props,
50688
50688
  {
50689
+ tagKey,
50689
50690
  children,
50690
50691
  size,
50691
50692
  color,
@@ -50699,7 +50700,7 @@ class tag_Tag extends external_root_React_commonjs2_react_commonjs_react_amd_rea
50699
50700
  avatarShape,
50700
50701
  tabIndex
50701
50702
  } = _a,
50702
- attr = tag_rest(_a, ["children", "size", "color", "closable", "visible", "onClose", "onClick", "className", "type", "avatarSrc", "avatarShape", "tabIndex"]);
50703
+ attr = tag_rest(_a, ["tagKey", "children", "size", "color", "closable", "visible", "onClose", "onClick", "className", "type", "avatarSrc", "avatarShape", "tabIndex"]);
50703
50704
 
50704
50705
  const {
50705
50706
  visible: isVisible
@@ -50732,7 +50733,7 @@ class tag_Tag extends external_root_React_commonjs2_react_commonjs_react_amd_rea
50732
50733
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events
50733
50734
  external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
50734
50735
  className: "".concat(tag_prefixCls, "-close"),
50735
- onClick: e => this.close(e, children)
50736
+ onClick: e => this.close(e, children, tagKey)
50736
50737
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, {
50737
50738
  size: "small"
50738
50739
  })) : null;
@@ -50758,6 +50759,7 @@ tag_Tag.defaultProps = {
50758
50759
  };
50759
50760
  tag_Tag.propTypes = {
50760
50761
  children: prop_types_default.a.node,
50762
+ tagKey: prop_types_default.a.oneOf([prop_types_default.a.string, prop_types_default.a.number]),
50761
50763
  size: prop_types_default.a.oneOf(tagSize),
50762
50764
  color: prop_types_default.a.oneOf(tagColors),
50763
50765
  type: prop_types_default.a.oneOf(tagType),
@@ -69416,7 +69418,10 @@ class ModalContent_ModalContent extends baseComponent_BaseComponent {
69416
69418
  }, this.getMaskElement(), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
69417
69419
  role: "none",
69418
69420
  tabIndex: -1,
69419
- className: "".concat(modal_constants_cssClasses.DIALOG, "-wrap"),
69421
+ className: classnames_default()({
69422
+ ["".concat(modal_constants_cssClasses.DIALOG, "-wrap")]: true,
69423
+ ["".concat(modal_constants_cssClasses.DIALOG, "-wrap-center")]: this.props.centered
69424
+ }),
69420
69425
  onClick: maskClosable ? this.onMaskClick : null,
69421
69426
  onMouseUp: maskClosable ? this.onMaskMouseUp : null
69422
69427
  }, this.getDialogElement())); // eslint-disable-next-line max-len
@@ -69906,14 +69911,6 @@ class Modal_Modal extends baseComponent_BaseComponent {
69906
69911
  let style = styleFromProps;
69907
69912
  const maskStyle = maskStyleFromProps;
69908
69913
  const renderFooter = 'footer' in this.props ? footer : this.renderFooter();
69909
-
69910
- if (this.props.centered) {
69911
- style = assign_default()({
69912
- transform: 'translateY(-50%)',
69913
- top: '50%'
69914
- }, style);
69915
- }
69916
-
69917
69914
  let wrapperStyle = {
69918
69915
  zIndex
69919
69916
  };
@@ -71861,6 +71858,7 @@ const form_constants_numbers = {};
71861
71858
 
71862
71859
 
71863
71860
 
71861
+
71864
71862
  const label_prefixCls = form_constants_cssClasses.PREFIX;
71865
71863
  class label_Label extends external_root_React_commonjs2_react_commonjs_react_amd_react_["PureComponent"] {
71866
71864
  render() {
@@ -71875,7 +71873,8 @@ class label_Label extends external_root_React_commonjs2_react_commonjs_react_amd
71875
71873
  style,
71876
71874
  className,
71877
71875
  extra,
71878
- id
71876
+ id,
71877
+ optional
71879
71878
  } = this.props;
71880
71879
  const labelCls = classnames_default()(className, {
71881
71880
  ["".concat(label_prefixCls, "-field-label")]: true,
@@ -71887,10 +71886,15 @@ class label_Label extends external_root_React_commonjs2_react_commonjs_react_amd
71887
71886
  });
71888
71887
  const labelStyle = style ? style : {};
71889
71888
  width ? labelStyle.width = width : null;
71889
+ const optionalText = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
71890
+ componentName: "Form"
71891
+ }, locale => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
71892
+ className: "".concat(label_prefixCls, "-field-label-optional-text")
71893
+ }, locale.optional));
71890
71894
  const textContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
71891
71895
  className: "".concat(label_prefixCls, "-field-label-text"),
71892
71896
  "x-semi-prop": "label"
71893
- }, typeof text !== 'undefined' ? text : children);
71897
+ }, typeof text !== 'undefined' ? text : children, optional ? optionalText : null);
71894
71898
  const contentWithExtra = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, textContent, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
71895
71899
  className: "".concat(label_prefixCls, "-field-label-extra")
71896
71900
  }, extra));
@@ -71907,7 +71911,8 @@ label_Label.defaultProps = {
71907
71911
  required: false,
71908
71912
  name: '',
71909
71913
  align: 'left',
71910
- className: ''
71914
+ className: '',
71915
+ optional: false
71911
71916
  };
71912
71917
  label_Label.propTypes = {
71913
71918
  id: prop_types_default.a.string,
@@ -71920,7 +71925,8 @@ label_Label.propTypes = {
71920
71925
  width: prop_types_default.a.oneOfType([prop_types_default.a.number, prop_types_default.a.string]),
71921
71926
  style: prop_types_default.a.object,
71922
71927
  className: prop_types_default.a.string,
71923
- extra: prop_types_default.a.node
71928
+ extra: prop_types_default.a.node,
71929
+ optional: prop_types_default.a.bool
71924
71930
  };
71925
71931
  // CONCATENATED MODULE: ./input/inputGroup.tsx
71926
71932
 
@@ -81530,6 +81536,26 @@ class foundation_SelectFoundation extends foundation {
81530
81536
  }
81531
81537
 
81532
81538
  }
81539
+ // CONCATENATED MODULE: ../semi-foundation/select/constants.ts
81540
+
81541
+
81542
+ const select_constants_cssClasses = {
81543
+ PREFIX: "".concat(BASE_CLASS_PREFIX, "-select"),
81544
+ PREFIX_OPTION: "".concat(BASE_CLASS_PREFIX, "-select-option"),
81545
+ PREFIX_GROUP: "".concat(BASE_CLASS_PREFIX, "-select-group")
81546
+ };
81547
+ const select_constants_strings = {
81548
+ SIZE_SET: ['small', 'large', 'default'],
81549
+ POSITION_SET: tooltip_constants_strings.POSITION_SET,
81550
+ MODE_SELECT: 'select',
81551
+ MODE_AUTOCOMPLETE: 'autoComplete',
81552
+ // MODE_TAGS: 'tags',
81553
+ STATUS: VALIDATE_STATUS
81554
+ };
81555
+ const select_constants_numbers = {
81556
+ LIST_HEIGHT: 300
81557
+ };
81558
+
81533
81559
  // CONCATENATED MODULE: ./tag/group.tsx
81534
81560
 
81535
81561
 
@@ -81605,10 +81631,11 @@ class group_TagGroup extends external_root_React_commonjs2_react_commonjs_react_
81605
81631
  tagList,
81606
81632
  size,
81607
81633
  mode,
81608
- avatarShape
81634
+ avatarShape,
81635
+ onTagClose
81609
81636
  } = this.props;
81610
81637
 
81611
- const renderTags = map_default()(tagList).call(tagList, (tag, index) => {
81638
+ const renderTags = map_default()(tagList).call(tagList, tag => {
81612
81639
  if (mode === 'custom') {
81613
81640
  return tag;
81614
81641
  }
@@ -81621,9 +81648,24 @@ class group_TagGroup extends external_root_React_commonjs2_react_commonjs_react_
81621
81648
  tag.avatarShape = avatarShape;
81622
81649
  }
81623
81650
 
81624
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tag_Tag, assign_default()({
81625
- key: "".concat(index, "-tag")
81626
- }, tag));
81651
+ if (!tag.tagKey) {
81652
+ if (typeof tag.children === 'string' || typeof tag.children === 'number') {
81653
+ tag.tagKey = tag.children;
81654
+ } else {
81655
+ tag.tagKey = Math.random();
81656
+ }
81657
+ }
81658
+
81659
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tag_Tag, assign_default()({}, tag, {
81660
+ key: tag.tagKey,
81661
+ onClose: (tagChildren, e, tagKey) => {
81662
+ if (tag.onClose) {
81663
+ tag.onClose(tagChildren, e, tagKey);
81664
+ }
81665
+
81666
+ onTagClose && onTagClose(tagChildren, e, tagKey);
81667
+ }
81668
+ }));
81627
81669
  });
81628
81670
 
81629
81671
  return renderTags;
@@ -81655,7 +81697,8 @@ group_TagGroup.defaultProps = {
81655
81697
  style: {},
81656
81698
  className: '',
81657
81699
  size: group_tagSize[0],
81658
- avatarShape: 'square'
81700
+ avatarShape: 'square',
81701
+ onTagClose: () => undefined
81659
81702
  };
81660
81703
  group_TagGroup.propTypes = {
81661
81704
  children: prop_types_default.a.node,
@@ -81666,6 +81709,7 @@ group_TagGroup.propTypes = {
81666
81709
  tagList: prop_types_default.a.array,
81667
81710
  size: prop_types_default.a.oneOf(group_tagSize),
81668
81711
  mode: prop_types_default.a.string,
81712
+ onTagClose: prop_types_default.a.func,
81669
81713
  showPopover: prop_types_default.a.bool,
81670
81714
  popoverProps: prop_types_default.a.object,
81671
81715
  avatarShape: prop_types_default.a.oneOf(group_avatarShapeSet)
@@ -81791,6 +81835,197 @@ const VirtualRow = _ref => {
81791
81835
  };
81792
81836
 
81793
81837
  /* harmony default export */ var virtualRow = (VirtualRow);
81838
+ // CONCATENATED MODULE: ./select/option.tsx
81839
+
81840
+
81841
+
81842
+
81843
+
81844
+ var select_option_rest = undefined && undefined.__rest || function (s, e) {
81845
+ var t = {};
81846
+
81847
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && index_of_default()(e).call(e, p) < 0) t[p] = s[p];
81848
+
81849
+ if (s != null && typeof get_own_property_symbols_default.a === "function") for (var i = 0, p = get_own_property_symbols_default()(s); i < p.length; i++) {
81850
+ if (index_of_default()(e).call(e, p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
81851
+ }
81852
+ return t;
81853
+ };
81854
+ /* eslint-disable max-len */
81855
+
81856
+
81857
+
81858
+
81859
+
81860
+
81861
+
81862
+
81863
+
81864
+
81865
+ class select_option_Option extends external_root_React_commonjs2_react_commonjs_react_amd_react_["PureComponent"] {
81866
+ onClick(_a, event) {
81867
+ var {
81868
+ value,
81869
+ label,
81870
+ children
81871
+ } = _a,
81872
+ rest = select_option_rest(_a, ["value", "label", "children"]);
81873
+
81874
+ const {
81875
+ props
81876
+ } = this;
81877
+ const isDisabled = props.disabled;
81878
+
81879
+ if (!isDisabled) {
81880
+ props.onSelect(assign_default()(assign_default()({}, rest), {
81881
+ value,
81882
+ label: label || children
81883
+ }), event);
81884
+ }
81885
+ }
81886
+
81887
+ renderOptionContent(_ref) {
81888
+ let {
81889
+ config,
81890
+ children,
81891
+ inputValue,
81892
+ prefixCls
81893
+ } = _ref;
81894
+
81895
+ if (isString_default()(children) && inputValue) {
81896
+ return Object(_utils["d" /* getHighLightTextHTML */])(config);
81897
+ }
81898
+
81899
+ return children;
81900
+ }
81901
+
81902
+ render() {
81903
+ const _a = this.props,
81904
+ {
81905
+ children,
81906
+ disabled,
81907
+ value,
81908
+ selected,
81909
+ label,
81910
+ empty,
81911
+ emptyContent,
81912
+ onSelect,
81913
+ focused,
81914
+ showTick,
81915
+ className,
81916
+ style,
81917
+ onMouseEnter,
81918
+ prefixCls,
81919
+ renderOptionItem,
81920
+ inputValue,
81921
+ id
81922
+ } = _a,
81923
+ rest = select_option_rest(_a, ["children", "disabled", "value", "selected", "label", "empty", "emptyContent", "onSelect", "focused", "showTick", "className", "style", "onMouseEnter", "prefixCls", "renderOptionItem", "inputValue", "id"]);
81924
+
81925
+ const optionClassName = classnames_default()(prefixCls, {
81926
+ ["".concat(prefixCls, "-disabled")]: disabled,
81927
+ ["".concat(prefixCls, "-selected")]: selected,
81928
+ ["".concat(prefixCls, "-focused")]: focused,
81929
+ ["".concat(prefixCls, "-empty")]: empty,
81930
+ [className]: className
81931
+ });
81932
+ const selectedIconClassName = classnames_default()(["".concat(prefixCls, "-icon")]);
81933
+
81934
+ if (empty) {
81935
+ if (emptyContent === null) {
81936
+ return null;
81937
+ }
81938
+
81939
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
81940
+ componentName: "Select"
81941
+ }, locale => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
81942
+ className: optionClassName,
81943
+ "x-semi-prop": "emptyContent"
81944
+ }, emptyContent || locale.emptyText));
81945
+ } // Since there are empty, locale and other logic, the custom renderOptionItem is directly converged to the internal option instead of being placed in Select/index
81946
+
81947
+
81948
+ if (typeof renderOptionItem === 'function') {
81949
+ return renderOptionItem(assign_default()({
81950
+ disabled,
81951
+ focused,
81952
+ selected,
81953
+ style,
81954
+ label,
81955
+ value,
81956
+ inputValue,
81957
+ onMouseEnter: e => onMouseEnter(e),
81958
+ onClick: e => this.onClick(assign_default()({
81959
+ value,
81960
+ label,
81961
+ children
81962
+ }, rest), e)
81963
+ }, rest));
81964
+ }
81965
+
81966
+ const config = {
81967
+ searchWords: inputValue,
81968
+ sourceString: children,
81969
+ option: {
81970
+ highlightClassName: "".concat(prefixCls, "-keyword")
81971
+ }
81972
+ };
81973
+ return (
81974
+ /*#__PURE__*/
81975
+ // eslint-disable-next-line jsx-a11y/interactive-supports-focus,jsx-a11y/click-events-have-key-events
81976
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
81977
+ className: optionClassName,
81978
+ onClick: e => {
81979
+ this.onClick(assign_default()({
81980
+ value,
81981
+ label,
81982
+ children
81983
+ }, rest), e);
81984
+ },
81985
+ onMouseEnter: e => onMouseEnter && onMouseEnter(e),
81986
+ role: "option",
81987
+ id: id,
81988
+ "aria-selected": selected ? "true" : "false",
81989
+ "aria-disabled": disabled ? "true" : "false",
81990
+ style: style
81991
+ }, showTick ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
81992
+ className: selectedIconClassName
81993
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconTick, null)) : null, isString_default()(children) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
81994
+ className: "".concat(prefixCls, "-text")
81995
+ }, this.renderOptionContent({
81996
+ children,
81997
+ config,
81998
+ inputValue,
81999
+ prefixCls
82000
+ })) : children)
82001
+ );
82002
+ }
82003
+
82004
+ }
82005
+
82006
+ select_option_Option.isSelectOption = true;
82007
+ select_option_Option.propTypes = {
82008
+ children: prop_types_default.a.node,
82009
+ disabled: prop_types_default.a.bool,
82010
+ value: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
82011
+ selected: prop_types_default.a.bool,
82012
+ label: prop_types_default.a.node,
82013
+ empty: prop_types_default.a.bool,
82014
+ emptyContent: prop_types_default.a.node,
82015
+ onSelect: prop_types_default.a.func,
82016
+ focused: prop_types_default.a.bool,
82017
+ showTick: prop_types_default.a.bool,
82018
+ className: prop_types_default.a.string,
82019
+ style: prop_types_default.a.object,
82020
+ onMouseEnter: prop_types_default.a.func,
82021
+ prefixCls: prop_types_default.a.string,
82022
+ renderOptionItem: prop_types_default.a.func,
82023
+ inputValue: prop_types_default.a.string
82024
+ };
82025
+ select_option_Option.defaultProps = {
82026
+ prefixCls: select_constants_cssClasses.PREFIX_OPTION
82027
+ };
82028
+ /* harmony default export */ var select_option = (select_option_Option);
81794
82029
  // CONCATENATED MODULE: ./select/optionGroup.tsx
81795
82030
 
81796
82031
 
@@ -89870,9 +90105,9 @@ class foundation_SwitchFoundation extends foundation {
89870
90105
 
89871
90106
  handleChange(checked, e) {
89872
90107
  const propChecked = this.getProps().checked;
89873
- const isControledComponent = typeof propChecked !== 'undefined';
90108
+ const isControlledComponent = typeof propChecked !== 'undefined';
89874
90109
 
89875
- if (isControledComponent) {
90110
+ if (isControlledComponent) {
89876
90111
  this._adapter.notifyChange(checked, e);
89877
90112
  } else {
89878
90113
  this._adapter.setNativeControlChecked(checked);
@@ -102811,6 +103046,7 @@ var tree = __webpack_require__("Q8Yr");
102811
103046
 
102812
103047
 
102813
103048
 
103049
+
102814
103050
  /* eslint-disable max-lines-per-function */
102815
103051
 
102816
103052
 
@@ -102843,6 +103079,25 @@ class tree_Tree extends baseComponent_BaseComponent {
102843
103079
  this.foundation.handleInputChange(value);
102844
103080
  };
102845
103081
 
103082
+ this.scrollTo = scrollData => {
103083
+ var _a;
103084
+
103085
+ const {
103086
+ key,
103087
+ align = 'center'
103088
+ } = scrollData;
103089
+ const {
103090
+ flattenNodes
103091
+ } = this.state;
103092
+
103093
+ if (key) {
103094
+ const index = flattenNodes === null || flattenNodes === void 0 ? void 0 : find_index_default()(flattenNodes).call(flattenNodes, node => {
103095
+ return node.key === key;
103096
+ });
103097
+ index >= 0 && ((_a = this.virtualizedListRef.current) === null || _a === void 0 ? void 0 : _a.scrollToItem(index, align));
103098
+ }
103099
+ };
103100
+
102846
103101
  this.renderEmpty = () => {
102847
103102
  const {
102848
103103
  emptyContent
@@ -103004,6 +103259,7 @@ class tree_Tree extends baseComponent_BaseComponent {
103004
103259
  this.optionsRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
103005
103260
  this.foundation = new foundation_TreeFoundation(this.adapter);
103006
103261
  this.dragNode = null;
103262
+ this.virtualizedListRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
103007
103263
  }
103008
103264
  /**
103009
103265
  * Process of getDerivedStateFromProps was inspired by rc-tree
@@ -103376,6 +103632,7 @@ class tree_Tree extends baseComponent_BaseComponent {
103376
103632
  width
103377
103633
  } = _ref4;
103378
103634
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(FixedSizeList, {
103635
+ ref: this.virtualizedListRef,
103379
103636
  itemCount: flattenNodes.length,
103380
103637
  itemSize: virtualize.itemSize,
103381
103638
  height: height,
@@ -111040,7 +111297,8 @@ function withField(Component, opts) {
111040
111297
  if (arrayFieldState) {
111041
111298
  initVal = arrayFieldState.shouldUseInitValue && typeof initValue !== 'undefined' ? initValue : initValueInFormOpts;
111042
111299
  }
111043
- } catch (err) {}
111300
+ } catch (err) {} // FIXME typeof initVal
111301
+
111044
111302
 
111045
111303
  const [value, setValue, getVal] = useStateWithGetter(typeof initVal !== undefined ? initVal : null);
111046
111304