@douyinfe/semi-ui 2.43.0-beta.0 → 2.43.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.
@@ -19750,10 +19750,7 @@ class Portal extends external_root_React_commonjs2_react_commonjs_react_amd_reac
19750
19750
  var _a, _b;
19751
19751
  try {
19752
19752
  let container = undefined;
19753
- if (!_this.el) {
19754
- _this.el = document.createElement('div');
19755
- }
19756
- if (!((_a = _this.state) === null || _a === void 0 ? void 0 : _a.container)) {
19753
+ if (!_this.el || !((_a = _this.state) === null || _a === void 0 ? void 0 : _a.container) || !Array.from(_this.state.container.childNodes).includes(_this.el)) {
19757
19754
  _this.el = document.createElement('div');
19758
19755
  const getContainer = _this.props.getPopupContainer || context.getPopupContainer || defaultGetContainer;
19759
19756
  const portalContainer = getContainer();
@@ -22267,7 +22264,7 @@ const popover_constants_cssClasses = {
22267
22264
  };
22268
22265
  const popover_constants_strings = {
22269
22266
  POSITION_SET: ['top', 'topLeft', 'topRight', 'left', 'leftTop', 'leftBottom', 'right', 'rightTop', 'rightBottom', 'bottom', 'bottomLeft', 'bottomRight', 'leftTopOver', 'rightTopOver'],
22270
- TRIGGER_SET: ['hover', 'focus', 'click', 'custom'],
22267
+ TRIGGER_SET: ['hover', 'focus', 'click', 'custom', 'contextMenu'],
22271
22268
  DEFAULT_ARROW_STYLE: {
22272
22269
  borderOpacity: '1',
22273
22270
  backgroundColor: 'var(--semi-color-bg-3)',
@@ -39223,10 +39220,15 @@ class TagInputFoundation extends foundation {
39223
39220
  }
39224
39221
  };
39225
39222
  this.handleInputCompositionStart = e => {
39223
+ const {
39224
+ maxLength
39225
+ } = this.getProps();
39226
+ if (!isNumber_default()(maxLength)) {
39227
+ return;
39228
+ }
39226
39229
  this._adapter.setEntering(true);
39227
39230
  };
39228
39231
  this.handleInputCompositionEnd = e => {
39229
- this._adapter.setEntering(false);
39230
39232
  const {
39231
39233
  value
39232
39234
  } = e.target;
@@ -39235,27 +39237,31 @@ class TagInputFoundation extends foundation {
39235
39237
  onInputExceed,
39236
39238
  separator
39237
39239
  } = this.getProps();
39240
+ if (!isNumber_default()(maxLength)) {
39241
+ return;
39242
+ }
39243
+ this._adapter.setEntering(false);
39238
39244
  let allowChange = true;
39239
- const {
39240
- inputValue
39241
- } = this.getStates();
39242
- if (isNumber_default()(maxLength)) {
39243
- const inputArr = utils_getSplitedArray(inputValue, separator);
39244
- let index = 0;
39245
- for (; index < inputArr.length; index++) {
39246
- if (inputArr[index].length > maxLength) {
39247
- allowChange = false;
39248
- isFunction_default()(onInputExceed) && onInputExceed(value);
39249
- break;
39250
- }
39245
+ const inputArr = utils_getSplitedArray(value, separator);
39246
+ let index = 0;
39247
+ for (; index < inputArr.length; index++) {
39248
+ if (inputArr[index].length > maxLength) {
39249
+ allowChange = false;
39250
+ isFunction_default()(onInputExceed) && onInputExceed(value);
39251
+ break;
39251
39252
  }
39252
- if (!allowChange) {
39253
- const newInputArr = inputArr.slice(0, index);
39254
- if (index < inputArr.length) {
39255
- newInputArr.push(inputArr[index].slice(0, maxLength));
39256
- }
39257
- this._adapter.setInputValue(newInputArr.join(separator));
39253
+ }
39254
+ if (!allowChange) {
39255
+ const newInputArr = inputArr.slice(0, index);
39256
+ if (index < inputArr.length) {
39257
+ newInputArr.push(inputArr[index].slice(0, maxLength));
39258
39258
  }
39259
+ this._adapter.setInputValue(newInputArr.join(separator));
39260
+ } else {
39261
+ // Why does it need to be updated here instead of in onChange when the value meets the maxLength limit?
39262
+ // Because in firefox, the state change in InputCompositionEnd causes onChange to not be triggered after
39263
+ // the composition input completes input.
39264
+ this._adapter.setInputValue(value);
39259
39265
  }
39260
39266
  };
39261
39267
  /**
@@ -60264,7 +60270,7 @@ const dropdown_constants_cssClasses = {
60264
60270
  };
60265
60271
  const dropdown_constants_strings = {
60266
60272
  POSITION_SET: tooltip_constants_strings.POSITION_SET,
60267
- TRIGGER_SET: ['hover', 'focus', 'click', 'custom'],
60273
+ TRIGGER_SET: ['hover', 'focus', 'click', 'custom', 'contextMenu'],
60268
60274
  DEFAULT_LEAVE_DELAY: 100,
60269
60275
  ITEM_TYPE: ['primary', 'secondary', 'tertiary', 'warning', 'danger']
60270
60276
  };
@@ -100796,8 +100802,8 @@ class Preview extends BaseComponent {
100796
100802
  if (item.isIntersecting && src) {
100797
100803
  item.target.src = src;
100798
100804
  item.target.removeAttribute("data-src");
100805
+ this.previewObserver.unobserve(item.target);
100799
100806
  }
100800
- this.previewObserver.unobserve(item.target);
100801
100807
  });
100802
100808
  }, {
100803
100809
  root: document.querySelector(`#${this.previewGroupId}`),