@douyinfe/semi-ui 2.38.3-alpha.1 → 2.38.3-alpha.3

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 (57) hide show
  1. package/dist/umd/semi-ui.js +412 -7
  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/button/index.d.ts +1 -1
  10. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  11. package/lib/cjs/datePicker/datePicker.d.ts +2 -2
  12. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  13. package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
  14. package/lib/cjs/dropdown/dropdownItem.js +2 -1
  15. package/lib/cjs/form/baseForm.d.ts +1 -1
  16. package/lib/cjs/form/field.d.ts +1 -1
  17. package/lib/cjs/input/index.d.ts +1 -1
  18. package/lib/cjs/input/inputGroup.d.ts +1 -1
  19. package/lib/cjs/modal/confirm.d.ts +20 -20
  20. package/lib/cjs/overflowList/index.js +3 -3
  21. package/lib/cjs/rating/index.d.ts +1 -1
  22. package/lib/cjs/rating/item.d.ts +1 -1
  23. package/lib/cjs/select/option.js +2 -1
  24. package/lib/cjs/switch/index.d.ts +1 -1
  25. package/lib/cjs/table/Table.d.ts +2 -2
  26. package/lib/cjs/table/index.d.ts +1 -1
  27. package/lib/cjs/tagInput/index.d.ts +1 -1
  28. package/lib/cjs/timePicker/TimePicker.d.ts +1 -1
  29. package/lib/cjs/timePicker/index.d.ts +1 -1
  30. package/lib/cjs/typography/title.d.ts +2 -2
  31. package/lib/es/anchor/index.d.ts +1 -1
  32. package/lib/es/autoComplete/index.d.ts +1 -1
  33. package/lib/es/button/Button.d.ts +1 -1
  34. package/lib/es/button/buttonGroup.d.ts +1 -1
  35. package/lib/es/button/index.d.ts +1 -1
  36. package/lib/es/datePicker/dateInput.d.ts +1 -1
  37. package/lib/es/datePicker/datePicker.d.ts +2 -2
  38. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  39. package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
  40. package/lib/es/dropdown/dropdownItem.js +2 -1
  41. package/lib/es/form/baseForm.d.ts +1 -1
  42. package/lib/es/form/field.d.ts +1 -1
  43. package/lib/es/input/index.d.ts +1 -1
  44. package/lib/es/input/inputGroup.d.ts +1 -1
  45. package/lib/es/modal/confirm.d.ts +20 -20
  46. package/lib/es/overflowList/index.js +3 -3
  47. package/lib/es/rating/index.d.ts +1 -1
  48. package/lib/es/rating/item.d.ts +1 -1
  49. package/lib/es/select/option.js +2 -1
  50. package/lib/es/switch/index.d.ts +1 -1
  51. package/lib/es/table/Table.d.ts +2 -2
  52. package/lib/es/table/index.d.ts +1 -1
  53. package/lib/es/tagInput/index.d.ts +1 -1
  54. package/lib/es/timePicker/TimePicker.d.ts +1 -1
  55. package/lib/es/timePicker/index.d.ts +1 -1
  56. package/lib/es/typography/title.d.ts +2 -2
  57. package/package.json +9 -8
@@ -58098,7 +58098,8 @@ class DropdownItem extends BaseComponent {
58098
58098
  const events = {};
58099
58099
  if (!disabled) {
58100
58100
  ['onClick', 'onMouseEnter', 'onMouseLeave', 'onContextMenu'].forEach(eventName => {
58101
- if (eventName === "onClick") {
58101
+ const isInAnotherDropdown = this.context.level !== 1;
58102
+ if (isInAnotherDropdown && eventName === "onClick") {
58102
58103
  events["onMouseDown"] = e => {
58103
58104
  var _a, _b;
58104
58105
  if (e.button === 0) {
@@ -63655,11 +63656,413 @@ ReactIntersectionObserver.defaultProps = {
63655
63656
  option: {},
63656
63657
  items: {}
63657
63658
  };
63659
+ ;// CONCATENATED MODULE: ../../node_modules/fast-copy/dist/esm/index.mjs
63660
+ var toStringFunction = Function.prototype.toString;
63661
+ var create = Object.create;
63662
+ var toStringObject = Object.prototype.toString;
63663
+ /**
63664
+ * @classdesc Fallback cache for when WeakMap is not natively supported
63665
+ */
63666
+ var LegacyCache = /** @class */ (function () {
63667
+ function LegacyCache() {
63668
+ this._keys = [];
63669
+ this._values = [];
63670
+ }
63671
+ LegacyCache.prototype.has = function (key) {
63672
+ return !!~this._keys.indexOf(key);
63673
+ };
63674
+ LegacyCache.prototype.get = function (key) {
63675
+ return this._values[this._keys.indexOf(key)];
63676
+ };
63677
+ LegacyCache.prototype.set = function (key, value) {
63678
+ this._keys.push(key);
63679
+ this._values.push(value);
63680
+ };
63681
+ return LegacyCache;
63682
+ }());
63683
+ function createCacheLegacy() {
63684
+ return new LegacyCache();
63685
+ }
63686
+ function createCacheModern() {
63687
+ return new WeakMap();
63688
+ }
63689
+ /**
63690
+ * Get a new cache object to prevent circular references.
63691
+ */
63692
+ var createCache = typeof WeakMap !== 'undefined' ? createCacheModern : createCacheLegacy;
63693
+ /**
63694
+ * Get an empty version of the object with the same prototype it has.
63695
+ */
63696
+ function getCleanClone(prototype) {
63697
+ if (!prototype) {
63698
+ return create(null);
63699
+ }
63700
+ var Constructor = prototype.constructor;
63701
+ if (Constructor === Object) {
63702
+ return prototype === Object.prototype ? {} : create(prototype);
63703
+ }
63704
+ if (Constructor &&
63705
+ ~toStringFunction.call(Constructor).indexOf('[native code]')) {
63706
+ try {
63707
+ return new Constructor();
63708
+ }
63709
+ catch (_a) { }
63710
+ }
63711
+ return create(prototype);
63712
+ }
63713
+ function getRegExpFlagsLegacy(regExp) {
63714
+ var flags = '';
63715
+ if (regExp.global) {
63716
+ flags += 'g';
63717
+ }
63718
+ if (regExp.ignoreCase) {
63719
+ flags += 'i';
63720
+ }
63721
+ if (regExp.multiline) {
63722
+ flags += 'm';
63723
+ }
63724
+ if (regExp.unicode) {
63725
+ flags += 'u';
63726
+ }
63727
+ if (regExp.sticky) {
63728
+ flags += 'y';
63729
+ }
63730
+ return flags;
63731
+ }
63732
+ function getRegExpFlagsModern(regExp) {
63733
+ return regExp.flags;
63734
+ }
63735
+ /**
63736
+ * Get the flags to apply to the copied regexp.
63737
+ */
63738
+ var getRegExpFlags = /test/g.flags === 'g' ? getRegExpFlagsModern : getRegExpFlagsLegacy;
63739
+ function getTagLegacy(value) {
63740
+ var type = toStringObject.call(value);
63741
+ return type.substring(8, type.length - 1);
63742
+ }
63743
+ function getTagModern(value) {
63744
+ return value[Symbol.toStringTag] || getTagLegacy(value);
63745
+ }
63746
+ /**
63747
+ * Get the tag of the value passed, so that the correct copier can be used.
63748
+ */
63749
+ var getTag = typeof Symbol !== 'undefined' ? getTagModern : getTagLegacy;
63750
+
63751
+ var defineProperty = Object.defineProperty, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols;
63752
+ var _a = Object.prototype, esm_hasOwnProperty = _a.hasOwnProperty, propertyIsEnumerable = _a.propertyIsEnumerable;
63753
+ var SUPPORTS_SYMBOL = typeof getOwnPropertySymbols === 'function';
63754
+ function getStrictPropertiesModern(object) {
63755
+ return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
63756
+ }
63757
+ /**
63758
+ * Get the properites used when copying objects strictly. This includes both keys and symbols.
63759
+ */
63760
+ var getStrictProperties = SUPPORTS_SYMBOL
63761
+ ? getStrictPropertiesModern
63762
+ : getOwnPropertyNames;
63763
+ /**
63764
+ * Striclty copy all properties contained on the object.
63765
+ */
63766
+ function copyOwnPropertiesStrict(value, clone, state) {
63767
+ var properties = getStrictProperties(value);
63768
+ for (var index = 0, length_1 = properties.length, property = void 0, descriptor = void 0; index < length_1; ++index) {
63769
+ property = properties[index];
63770
+ if (property === 'callee' || property === 'caller') {
63771
+ continue;
63772
+ }
63773
+ descriptor = getOwnPropertyDescriptor(value, property);
63774
+ if (!descriptor) {
63775
+ // In extra edge cases where the property descriptor cannot be retrived, fall back to
63776
+ // the loose assignment.
63777
+ clone[property] = state.copier(value[property], state);
63778
+ continue;
63779
+ }
63780
+ // Only clone the value if actually a value, not a getter / setter.
63781
+ if (!descriptor.get && !descriptor.set) {
63782
+ descriptor.value = state.copier(descriptor.value, state);
63783
+ }
63784
+ try {
63785
+ defineProperty(clone, property, descriptor);
63786
+ }
63787
+ catch (error) {
63788
+ // Tee above can fail on node in edge cases, so fall back to the loose assignment.
63789
+ clone[property] = descriptor.value;
63790
+ }
63791
+ }
63792
+ return clone;
63793
+ }
63794
+ /**
63795
+ * Deeply copy the indexed values in the array.
63796
+ */
63797
+ function copyArrayLoose(array, state) {
63798
+ var clone = new state.Constructor();
63799
+ // set in the cache immediately to be able to reuse the object recursively
63800
+ state.cache.set(array, clone);
63801
+ for (var index = 0, length_2 = array.length; index < length_2; ++index) {
63802
+ clone[index] = state.copier(array[index], state);
63803
+ }
63804
+ return clone;
63805
+ }
63806
+ /**
63807
+ * Deeply copy the indexed values in the array, as well as any custom properties.
63808
+ */
63809
+ function copyArrayStrict(array, state) {
63810
+ var clone = new state.Constructor();
63811
+ // set in the cache immediately to be able to reuse the object recursively
63812
+ state.cache.set(array, clone);
63813
+ return copyOwnPropertiesStrict(array, clone, state);
63814
+ }
63815
+ /**
63816
+ * Copy the contents of the ArrayBuffer.
63817
+ */
63818
+ function copyArrayBuffer(arrayBuffer, _state) {
63819
+ return arrayBuffer.slice(0);
63820
+ }
63821
+ /**
63822
+ * Create a new Blob with the contents of the original.
63823
+ */
63824
+ function copyBlob(blob, _state) {
63825
+ return blob.slice(0, blob.size, blob.type);
63826
+ }
63827
+ /**
63828
+ * Create a new DataView with the contents of the original.
63829
+ */
63830
+ function copyDataView(dataView, state) {
63831
+ return new state.Constructor(copyArrayBuffer(dataView.buffer));
63832
+ }
63833
+ /**
63834
+ * Create a new Date based on the time of the original.
63835
+ */
63836
+ function copyDate(date, state) {
63837
+ return new state.Constructor(date.getTime());
63838
+ }
63839
+ /**
63840
+ * Deeply copy the keys and values of the original.
63841
+ */
63842
+ function copyMapLoose(map, state) {
63843
+ var clone = new state.Constructor();
63844
+ // set in the cache immediately to be able to reuse the object recursively
63845
+ state.cache.set(map, clone);
63846
+ map.forEach(function (value, key) {
63847
+ clone.set(key, state.copier(value, state));
63848
+ });
63849
+ return clone;
63850
+ }
63851
+ /**
63852
+ * Deeply copy the keys and values of the original, as well as any custom properties.
63853
+ */
63854
+ function copyMapStrict(map, state) {
63855
+ return copyOwnPropertiesStrict(map, copyMapLoose(map, state), state);
63856
+ }
63857
+ function copyObjectLooseLegacy(object, state) {
63858
+ var clone = getCleanClone(state.prototype);
63859
+ // set in the cache immediately to be able to reuse the object recursively
63860
+ state.cache.set(object, clone);
63861
+ for (var key in object) {
63862
+ if (esm_hasOwnProperty.call(object, key)) {
63863
+ clone[key] = state.copier(object[key], state);
63864
+ }
63865
+ }
63866
+ return clone;
63867
+ }
63868
+ function copyObjectLooseModern(object, state) {
63869
+ var clone = getCleanClone(state.prototype);
63870
+ // set in the cache immediately to be able to reuse the object recursively
63871
+ state.cache.set(object, clone);
63872
+ for (var key in object) {
63873
+ if (esm_hasOwnProperty.call(object, key)) {
63874
+ clone[key] = state.copier(object[key], state);
63875
+ }
63876
+ }
63877
+ var symbols = getOwnPropertySymbols(object);
63878
+ for (var index = 0, length_3 = symbols.length, symbol = void 0; index < length_3; ++index) {
63879
+ symbol = symbols[index];
63880
+ if (propertyIsEnumerable.call(object, symbol)) {
63881
+ clone[symbol] = state.copier(object[symbol], state);
63882
+ }
63883
+ }
63884
+ return clone;
63885
+ }
63886
+ /**
63887
+ * Deeply copy the properties (keys and symbols) and values of the original.
63888
+ */
63889
+ var copyObjectLoose = SUPPORTS_SYMBOL
63890
+ ? copyObjectLooseModern
63891
+ : copyObjectLooseLegacy;
63892
+ /**
63893
+ * Deeply copy the properties (keys and symbols) and values of the original, as well
63894
+ * as any hidden or non-enumerable properties.
63895
+ */
63896
+ function copyObjectStrict(object, state) {
63897
+ var clone = getCleanClone(state.prototype);
63898
+ // set in the cache immediately to be able to reuse the object recursively
63899
+ state.cache.set(object, clone);
63900
+ return copyOwnPropertiesStrict(object, clone, state);
63901
+ }
63902
+ /**
63903
+ * Create a new primitive wrapper from the value of the original.
63904
+ */
63905
+ function copyPrimitiveWrapper(primitiveObject, state) {
63906
+ return new state.Constructor(primitiveObject.valueOf());
63907
+ }
63908
+ /**
63909
+ * Create a new RegExp based on the value and flags of the original.
63910
+ */
63911
+ function copyRegExp(regExp, state) {
63912
+ var clone = new state.Constructor(regExp.source, getRegExpFlags(regExp));
63913
+ clone.lastIndex = regExp.lastIndex;
63914
+ return clone;
63915
+ }
63916
+ /**
63917
+ * Return the original value (an identity function).
63918
+ *
63919
+ * @note
63920
+ * THis is used for objects that cannot be copied, such as WeakMap.
63921
+ */
63922
+ function copySelf(value, _state) {
63923
+ return value;
63924
+ }
63925
+ /**
63926
+ * Deeply copy the values of the original.
63927
+ */
63928
+ function copySetLoose(set, state) {
63929
+ var clone = new state.Constructor();
63930
+ // set in the cache immediately to be able to reuse the object recursively
63931
+ state.cache.set(set, clone);
63932
+ set.forEach(function (value) {
63933
+ clone.add(state.copier(value, state));
63934
+ });
63935
+ return clone;
63936
+ }
63937
+ /**
63938
+ * Deeply copy the values of the original, as well as any custom properties.
63939
+ */
63940
+ function copySetStrict(set, state) {
63941
+ return copyOwnPropertiesStrict(set, copySetLoose(set, state), state);
63942
+ }
63943
+
63944
+ var esm_isArray = Array.isArray;
63945
+ var esm_assign = Object.assign;
63946
+ var getPrototypeOf = Object.getPrototypeOf || (function (obj) { return obj.__proto__; });
63947
+ var DEFAULT_LOOSE_OPTIONS = {
63948
+ array: copyArrayLoose,
63949
+ arrayBuffer: copyArrayBuffer,
63950
+ blob: copyBlob,
63951
+ dataView: copyDataView,
63952
+ date: copyDate,
63953
+ error: copySelf,
63954
+ map: copyMapLoose,
63955
+ object: copyObjectLoose,
63956
+ regExp: copyRegExp,
63957
+ set: copySetLoose,
63958
+ };
63959
+ var DEFAULT_STRICT_OPTIONS = esm_assign({}, DEFAULT_LOOSE_OPTIONS, {
63960
+ array: copyArrayStrict,
63961
+ map: copyMapStrict,
63962
+ object: copyObjectStrict,
63963
+ set: copySetStrict,
63964
+ });
63965
+ /**
63966
+ * Get the copiers used for each specific object tag.
63967
+ */
63968
+ function getTagSpecificCopiers(options) {
63969
+ return {
63970
+ Arguments: options.object,
63971
+ Array: options.array,
63972
+ ArrayBuffer: options.arrayBuffer,
63973
+ Blob: options.blob,
63974
+ Boolean: copyPrimitiveWrapper,
63975
+ DataView: options.dataView,
63976
+ Date: options.date,
63977
+ Error: options.error,
63978
+ Float32Array: options.arrayBuffer,
63979
+ Float64Array: options.arrayBuffer,
63980
+ Int8Array: options.arrayBuffer,
63981
+ Int16Array: options.arrayBuffer,
63982
+ Int32Array: options.arrayBuffer,
63983
+ Map: options.map,
63984
+ Number: copyPrimitiveWrapper,
63985
+ Object: options.object,
63986
+ Promise: copySelf,
63987
+ RegExp: options.regExp,
63988
+ Set: options.set,
63989
+ String: copyPrimitiveWrapper,
63990
+ WeakMap: copySelf,
63991
+ WeakSet: copySelf,
63992
+ Uint8Array: options.arrayBuffer,
63993
+ Uint8ClampedArray: options.arrayBuffer,
63994
+ Uint16Array: options.arrayBuffer,
63995
+ Uint32Array: options.arrayBuffer,
63996
+ Uint64Array: options.arrayBuffer,
63997
+ };
63998
+ }
63999
+ /**
64000
+ * Create a custom copier based on the object-specific copy methods passed.
64001
+ */
64002
+ function createCopier(options) {
64003
+ var normalizedOptions = esm_assign({}, DEFAULT_LOOSE_OPTIONS, options);
64004
+ var tagSpecificCopiers = getTagSpecificCopiers(normalizedOptions);
64005
+ var array = tagSpecificCopiers.Array, object = tagSpecificCopiers.Object;
64006
+ function copier(value, state) {
64007
+ state.prototype = state.Constructor = undefined;
64008
+ if (!value || typeof value !== 'object') {
64009
+ return value;
64010
+ }
64011
+ if (state.cache.has(value)) {
64012
+ return state.cache.get(value);
64013
+ }
64014
+ state.prototype = getPrototypeOf(value);
64015
+ state.Constructor = state.prototype && state.prototype.constructor;
64016
+ // plain objects
64017
+ if (!state.Constructor || state.Constructor === Object) {
64018
+ return object(value, state);
64019
+ }
64020
+ // arrays
64021
+ if (esm_isArray(value)) {
64022
+ return array(value, state);
64023
+ }
64024
+ var tagSpecificCopier = tagSpecificCopiers[getTag(value)];
64025
+ if (tagSpecificCopier) {
64026
+ return tagSpecificCopier(value, state);
64027
+ }
64028
+ return typeof value.then === 'function' ? value : object(value, state);
64029
+ }
64030
+ return function copy(value) {
64031
+ return copier(value, {
64032
+ Constructor: undefined,
64033
+ cache: createCache(),
64034
+ copier: copier,
64035
+ prototype: undefined,
64036
+ });
64037
+ };
64038
+ }
64039
+ /**
64040
+ * Create a custom copier based on the object-specific copy methods passed, defaulting to the
64041
+ * same internals as `copyStrict`.
64042
+ */
64043
+ function createStrictCopier(options) {
64044
+ return createCopier(esm_assign({}, DEFAULT_STRICT_OPTIONS, options));
64045
+ }
64046
+ /**
64047
+ * Copy an value deeply as much as possible, where strict recreation of object properties
64048
+ * are maintained. All properties (including non-enumerable ones) are copied with their
64049
+ * original property descriptors on both objects and arrays.
64050
+ */
64051
+ var copyStrict = createStrictCopier({});
64052
+ /**
64053
+ * Copy an value deeply as much as possible.
64054
+ */
64055
+ var esm_index = createCopier({});
64056
+
64057
+
64058
+ //# sourceMappingURL=index.mjs.map
64059
+
63658
64060
  ;// CONCATENATED MODULE: ../semi-foundation/overflowList/foundation.ts
63659
64061
 
63660
64062
 
63661
64063
 
63662
64064
 
64065
+
63663
64066
  const Boundary = overflowList_constants_strings.BOUNDARY_MAP;
63664
64067
  const OverflowDirection = overflowList_constants_strings.OVERFLOW_DIR;
63665
64068
  class OverflowListFoundation extends foundation {
@@ -63690,7 +64093,8 @@ class OverflowListFoundation extends foundation {
63690
64093
  if (!this.isScrollMode()) {
63691
64094
  return overflow;
63692
64095
  }
63693
- const visibleStateArr = items.map(_ref => {
64096
+ const cloneItems = esm_index(items);
64097
+ const visibleStateArr = cloneItems.map(_ref => {
63694
64098
  let {
63695
64099
  key
63696
64100
  } = _ref;
@@ -63699,8 +64103,8 @@ class OverflowListFoundation extends foundation {
63699
64103
  const visibleStart = visibleStateArr.indexOf(true);
63700
64104
  const visibleEnd = visibleStateArr.lastIndexOf(true);
63701
64105
  const overflowList = [];
63702
- overflowList[0] = visibleStart >= 0 ? items.slice(0, visibleStart) : [];
63703
- overflowList[1] = visibleEnd >= 0 ? items.slice(visibleEnd + 1, items.length) : items;
64106
+ overflowList[0] = visibleStart >= 0 ? cloneItems.slice(0, visibleStart) : [];
64107
+ overflowList[1] = visibleEnd >= 0 ? cloneItems.slice(visibleEnd + 1, cloneItems.length) : cloneItems;
63704
64108
  return overflowList;
63705
64109
  }
63706
64110
  handleIntersect(entries) {
@@ -63999,8 +64403,8 @@ class OverflowList extends BaseComponent {
63999
64403
  maxCount = Math.min(maxCount, Math.floor(prevState.containerWidth / overflowList_constants_numbers.MINIMUM_HTML_ELEMENT_WIDTH));
64000
64404
  }
64001
64405
  const isCollapseFromStart = props.collapseFrom === overflowList_Boundary.START;
64002
- const visible = isCollapseFromStart ? cloneDeep(props.items).reverse().slice(0, maxCount) : props.items.slice(0, maxCount);
64003
- const overflow = isCollapseFromStart ? cloneDeep(props.items).reverse().slice(maxCount) : props.items.slice(maxCount);
64406
+ const visible = isCollapseFromStart ? esm_index(props.items).reverse().slice(0, maxCount) : props.items.slice(0, maxCount);
64407
+ const overflow = isCollapseFromStart ? esm_index(props.items).reverse().slice(maxCount) : props.items.slice(maxCount);
64004
64408
  newState.visible = visible;
64005
64409
  newState.overflow = overflow;
64006
64410
  newState.maxCount = maxCount;
@@ -67917,7 +68321,8 @@ class option_Option extends external_root_React_commonjs2_react_commonjs_react_a
67917
68321
  value,
67918
68322
  label,
67919
68323
  children
67920
- }, rest), e)
68324
+ }, rest), e),
68325
+ className
67921
68326
  }, rest));
67922
68327
  }
67923
68328
  const config = {