@douyinfe/semi-ui 2.45.3-alpha.0 → 2.45.3-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/umd/semi-ui.js +36 -30
  2. package/dist/umd/semi-ui.js.map +1 -1
  3. package/dist/umd/semi-ui.min.js +1 -1
  4. package/dist/umd/semi-ui.min.js.map +1 -1
  5. package/lib/cjs/anchor/index.d.ts +1 -1
  6. package/lib/cjs/autoComplete/index.d.ts +1 -1
  7. package/lib/cjs/button/Button.d.ts +1 -1
  8. package/lib/cjs/button/buttonGroup.d.ts +1 -1
  9. package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
  10. package/lib/cjs/carousel/index.d.ts +2 -2
  11. package/lib/cjs/cascader/index.d.ts +2 -0
  12. package/lib/cjs/cascader/index.js +14 -0
  13. package/lib/cjs/datePicker/datePicker.d.ts +1 -1
  14. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  15. package/lib/cjs/dropdown/index.d.ts +1 -1
  16. package/lib/cjs/form/baseForm.d.ts +2 -2
  17. package/lib/cjs/form/field.d.ts +2 -2
  18. package/lib/cjs/modal/confirm.d.ts +9 -9
  19. package/lib/cjs/popover/index.d.ts +1 -1
  20. package/lib/cjs/select/index.d.ts +1 -1
  21. package/lib/cjs/table/Table.d.ts +1 -1
  22. package/lib/cjs/tooltip/index.d.ts +1 -1
  23. package/lib/cjs/typography/base.d.ts +2 -1
  24. package/lib/cjs/typography/base.js +5 -16
  25. package/lib/cjs/typography/interface.d.ts +1 -2
  26. package/lib/cjs/typography/title.d.ts +1 -1
  27. package/lib/es/anchor/index.d.ts +1 -1
  28. package/lib/es/autoComplete/index.d.ts +1 -1
  29. package/lib/es/button/Button.d.ts +1 -1
  30. package/lib/es/button/buttonGroup.d.ts +1 -1
  31. package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
  32. package/lib/es/carousel/index.d.ts +2 -2
  33. package/lib/es/cascader/index.d.ts +2 -0
  34. package/lib/es/cascader/index.js +14 -0
  35. package/lib/es/datePicker/datePicker.d.ts +1 -1
  36. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  37. package/lib/es/dropdown/index.d.ts +1 -1
  38. package/lib/es/form/baseForm.d.ts +2 -2
  39. package/lib/es/form/field.d.ts +2 -2
  40. package/lib/es/modal/confirm.d.ts +9 -9
  41. package/lib/es/popover/index.d.ts +1 -1
  42. package/lib/es/select/index.d.ts +1 -1
  43. package/lib/es/table/Table.d.ts +1 -1
  44. package/lib/es/tooltip/index.d.ts +1 -1
  45. package/lib/es/typography/base.d.ts +2 -1
  46. package/lib/es/typography/base.js +5 -16
  47. package/lib/es/typography/interface.d.ts +1 -2
  48. package/lib/es/typography/title.d.ts +1 -1
  49. package/package.json +8 -8
@@ -17962,9 +17962,6 @@ Typography.propTypes = {
17962
17962
  className: (prop_types_default()).string
17963
17963
  };
17964
17964
  /* harmony default export */ const typography_typography = (Typography);
17965
- // EXTERNAL MODULE: ../../node_modules/lodash/isFunction.js
17966
- var isFunction = __webpack_require__("2q8g");
17967
- var isFunction_default = /*#__PURE__*/__webpack_require__.n(isFunction);
17968
17965
  // EXTERNAL MODULE: ../../node_modules/lodash/isNull.js
17969
17966
  var isNull = __webpack_require__("R7V3");
17970
17967
  var isNull_default = /*#__PURE__*/__webpack_require__.n(isNull);
@@ -17983,6 +17980,9 @@ var isUndefined_default = /*#__PURE__*/__webpack_require__.n(isUndefined);
17983
17980
  // EXTERNAL MODULE: ../../node_modules/lodash/isEqual.js
17984
17981
  var isEqual = __webpack_require__("nnRT");
17985
17982
  var isEqual_default = /*#__PURE__*/__webpack_require__.n(isEqual);
17983
+ // EXTERNAL MODULE: ../../node_modules/lodash/isFunction.js
17984
+ var isFunction = __webpack_require__("2q8g");
17985
+ var isFunction_default = /*#__PURE__*/__webpack_require__.n(isFunction);
17986
17986
  // EXTERNAL MODULE: ../../node_modules/lodash/isEmpty.js
17987
17987
  var isEmpty = __webpack_require__("MwrP");
17988
17988
  var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty);
@@ -23676,7 +23676,6 @@ ReactResizeObserver.defaultProps = {
23676
23676
 
23677
23677
 
23678
23678
 
23679
-
23680
23679
  var base_rest = undefined && undefined.__rest || function (s, e) {
23681
23680
  var t = {};
23682
23681
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
@@ -23767,7 +23766,6 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
23767
23766
  return updateOverflow;
23768
23767
  };
23769
23768
  this.showTooltip = () => {
23770
- var _a, _b;
23771
23769
  const {
23772
23770
  isOverflowed,
23773
23771
  isTruncated,
@@ -23785,7 +23783,8 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
23785
23783
  return show;
23786
23784
  }
23787
23785
  const defaultOpts = {
23788
- type: 'tooltip'
23786
+ type: 'tooltip',
23787
+ opts: {}
23789
23788
  };
23790
23789
  if (typeof showTooltip === 'object') {
23791
23790
  if (showTooltip.type && showTooltip.type.toLowerCase() === 'popover') {
@@ -23794,14 +23793,7 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
23794
23793
  // style: { width: '240px' },
23795
23794
  showArrow: true
23796
23795
  }
23797
- }, showTooltip, {
23798
- opts: {
23799
- className: classnames_default()({
23800
- [`${base_prefixCls}-ellipsis-popover`]: true,
23801
- [(_a = showTooltip === null || showTooltip === void 0 ? void 0 : showTooltip.opts) === null || _a === void 0 ? void 0 : _a.className]: Boolean((_b = showTooltip === null || showTooltip === void 0 ? void 0 : showTooltip.opts) === null || _b === void 0 ? void 0 : _b.className)
23802
- })
23803
- }
23804
- });
23796
+ }, showTooltip);
23805
23797
  }
23806
23798
  return Object.assign(Object.assign({}, defaultOpts), showTooltip);
23807
23799
  }
@@ -24203,12 +24195,9 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
24203
24195
  if (showTooltip) {
24204
24196
  const {
24205
24197
  type,
24206
- opts,
24207
- renderTooltip
24198
+ opts
24208
24199
  } = showTooltip;
24209
- if (isFunction_default()(renderTooltip)) {
24210
- return renderTooltip(children, content);
24211
- } else if (type.toLowerCase() === 'popover') {
24200
+ if (type.toLowerCase() === 'popover') {
24212
24201
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(popover_0, Object.assign({
24213
24202
  content: children,
24214
24203
  position: "top"
@@ -37008,6 +36997,8 @@ class CascaderFoundation extends foundation {
37008
36997
  init() {
37009
36998
  const isOpen = this.getProp('open') || this.getProp('defaultOpen');
37010
36999
  this.collectOptions(true);
37000
+ this._adapter.updateLoadingKeyRefValue(new Set());
37001
+ this._adapter.updateLoadedKeyRefValue(new Set());
37011
37002
  if (isOpen && !this._isDisabled()) {
37012
37003
  this.open();
37013
37004
  }
@@ -37194,11 +37185,11 @@ class CascaderFoundation extends foundation {
37194
37185
  } = this.getProps();
37195
37186
  const {
37196
37187
  activeKeys,
37197
- loadingKeys,
37198
37188
  loading,
37199
37189
  keyEntities: keyEntityState,
37200
37190
  selectedKeys: selectedKeysState
37201
37191
  } = this.getStates();
37192
+ const loadingKeys = this._adapter.getLoadingKeyRefValue();
37202
37193
  const filterable = this._isFilterable();
37203
37194
  const loadingActive = [...activeKeys].filter(i => loadingKeys.has(i));
37204
37195
  const valuePath = onChangeWithObject ? util_normalizedArr(value).map(i => i.value) : util_normalizedArr(value);
@@ -37446,17 +37437,18 @@ class CascaderFoundation extends foundation {
37446
37437
  data,
37447
37438
  key
37448
37439
  } = item;
37449
- const {
37450
- loadedKeys: prevLoadedKeys,
37451
- loadingKeys: prevLoadingKeys
37452
- } = this.getCopyFromState(['loadedKeys', 'loadingKeys']);
37440
+ const prevLoadingKeys = cloneDeep_default()(this._adapter.getLoadingKeyRefValue());
37441
+ const prevLoadedKeys = cloneDeep_default()(this._adapter.getLoadedKeyRefValue());
37453
37442
  const newLoadedKeys = prevLoadedKeys.add(key);
37454
37443
  const newLoadingKeys = new Set([...prevLoadingKeys]);
37455
37444
  newLoadingKeys.delete(key);
37456
37445
  // onLoad should trigger before internal setState to avoid `loadData` trigger twice.
37457
37446
  this._adapter.notifyOnLoad(newLoadedKeys, data);
37447
+ this._adapter.updateLoadingKeyRefValue(newLoadingKeys);
37448
+ this._adapter.updateLoadedKeyRefValue(newLoadedKeys);
37458
37449
  this._adapter.updateStates({
37459
- loadingKeys: newLoadingKeys
37450
+ loadingKeys: newLoadingKeys,
37451
+ loadedKeys: newLoadedKeys
37460
37452
  });
37461
37453
  }
37462
37454
  notifyIfLoadData(item) {
@@ -37468,10 +37460,8 @@ class CascaderFoundation extends foundation {
37468
37460
  loading: false
37469
37461
  });
37470
37462
  if (!data.isLeaf && !data.children && this.getProp('loadData')) {
37471
- const {
37472
- loadedKeys,
37473
- loadingKeys
37474
- } = this.getCopyFromState(['loadedKeys', 'loadingKeys']);
37463
+ const loadedKeys = this._adapter.getLoadedKeyRefValue();
37464
+ const loadingKeys = cloneDeep_default()(this._adapter.getLoadingKeyRefValue());
37475
37465
  if (loadedKeys.has(key) || loadingKeys.has(key)) {
37476
37466
  return;
37477
37467
  }
@@ -37482,8 +37472,10 @@ class CascaderFoundation extends foundation {
37482
37472
  keyEntities
37483
37473
  } = this.getStates();
37484
37474
  const optionPath = this.getItemPropPath(key, [], keyEntities);
37475
+ const newLoadingKeys = loadingKeys.add(key);
37476
+ this._adapter.updateLoadingKeyRefValue(newLoadingKeys);
37485
37477
  this._adapter.updateStates({
37486
- loadingKeys: loadingKeys.add(key)
37478
+ loadingKeys: newLoadingKeys
37487
37479
  });
37488
37480
  this._adapter.notifyLoadData(optionPath, this.handleNodeLoad.bind(this, item));
37489
37481
  }
@@ -47979,6 +47971,8 @@ class Cascader extends BaseComponent {
47979
47971
  this.optionsRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
47980
47972
  this.clickOutsideHandler = null;
47981
47973
  this.foundation = new CascaderFoundation(this.adapter);
47974
+ this.loadingKeysRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
47975
+ this.loadedKeysRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
47982
47976
  }
47983
47977
  get adapter() {
47984
47978
  var _this = this;
@@ -48124,6 +48118,18 @@ class Cascader extends BaseComponent {
48124
48118
  this.setState({
48125
48119
  isFocus
48126
48120
  });
48121
+ },
48122
+ updateLoadingKeyRefValue: keys => {
48123
+ this.loadingKeysRef.current = keys;
48124
+ },
48125
+ getLoadingKeyRefValue: () => {
48126
+ return this.loadingKeysRef.current;
48127
+ },
48128
+ updateLoadedKeyRefValue: keys => {
48129
+ this.loadedKeysRef.current = keys;
48130
+ },
48131
+ getLoadedKeyRefValue: () => {
48132
+ return this.loadedKeysRef.current;
48127
48133
  }
48128
48134
  });
48129
48135
  }