@douyinfe/semi-ui 2.23.5 → 2.23.7

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.
@@ -19304,23 +19304,26 @@ class foundation_Tooltip extends foundation {
19304
19304
 
19305
19305
 
19306
19306
  if (this.isTB(position)) {
19307
- isHeightOverFlow = isViewYOverFlow && isContainerYOverFlow;
19307
+ isHeightOverFlow = isViewYOverFlow && isContainerYOverFlow; // Related PR: https://github.com/DouyinFE/semi-design/pull/1297
19308
+ // If clientRight or restClientRight less than 0, means that the left and right parts of the trigger are blocked
19309
+ // Then the display of the wrapper will also be affected, make width overflow to offset the wrapper
19308
19310
 
19309
19311
  if (position === 'top' || position === 'bottom') {
19310
- isWidthOverFlow = isViewXOverFlowSideHalf && isContainerXOverFlowSideHalf;
19312
+ isWidthOverFlow = isViewXOverFlowSideHalf && isContainerXOverFlowSideHalf || clientRight < 0 || restClientRight < 0;
19311
19313
  } else {
19312
- isWidthOverFlow = isViewXOverFlowSide && isContainerXOverFlowSide;
19314
+ isWidthOverFlow = isViewXOverFlowSide && isContainerXOverFlowSide || clientRight < 0 || restClientRight < 0;
19313
19315
  }
19314
19316
  } // 左右方向 left and right
19315
19317
 
19316
19318
 
19317
19319
  if (this.isLR(position)) {
19318
- isWidthOverFlow = isViewXOverFlow && isContainerXOverFlow;
19320
+ isWidthOverFlow = isViewXOverFlow && isContainerXOverFlow; // If clientTop or restClientTop less than 0, means that the top and bottom parts of the trigger are blocked
19321
+ // Then the display of the wrapper will also be affected, make height overflow to offset the wrapper
19319
19322
 
19320
19323
  if (position === 'left' || position === 'right') {
19321
- isHeightOverFlow = isViewYOverFlowSideHalf && isContainerYOverFlowSideHalf;
19324
+ isHeightOverFlow = isViewYOverFlowSideHalf && isContainerYOverFlowSideHalf || clientTop < 0 || restClientTop < 0;
19322
19325
  } else {
19323
- isHeightOverFlow = isViewYOverFlowSide && isContainerYOverFlowSide;
19326
+ isHeightOverFlow = isViewYOverFlowSide && isContainerYOverFlowSide || clientTop < 0 || restClientTop < 0;
19324
19327
  }
19325
19328
  }
19326
19329
  }
@@ -70215,16 +70218,8 @@ class foundation_SelectFoundation extends foundation {
70215
70218
  }
70216
70219
  }
70217
70220
 
70218
- close(e) {
70221
+ close(e, closeCb) {
70219
70222
  // to support A11y, closing the panel trigger does not necessarily lose focus
70220
- const isFilterable = this._isFilterable();
70221
-
70222
- if (isFilterable) {
70223
- // this.unBindKeyBoardEvent();
70224
- this.clearInput();
70225
- this.toggle2SearchInput(false);
70226
- }
70227
-
70228
70223
  this._adapter.closeMenu();
70229
70224
 
70230
70225
  this._adapter.notifyDropdownVisibleChange(false);
@@ -70235,6 +70230,22 @@ class foundation_SelectFoundation extends foundation {
70235
70230
 
70236
70231
  this._adapter.unregisterClickOutsideHandler(); // this._adapter.updateFocusState(false);
70237
70232
 
70233
+
70234
+ const isFilterable = this._isFilterable();
70235
+
70236
+ if (isFilterable) {
70237
+ this.toggle2SearchInput(false);
70238
+ }
70239
+
70240
+ this._adapter.once('popoverClose', () => {
70241
+ if (isFilterable) {
70242
+ this.clearInput();
70243
+ }
70244
+
70245
+ if (closeCb) {
70246
+ closeCb();
70247
+ }
70248
+ });
70238
70249
  }
70239
70250
 
70240
70251
  onSelect(option, optionIndex, event) {
@@ -70278,21 +70289,24 @@ class foundation_SelectFoundation extends foundation {
70278
70289
  value,
70279
70290
  label
70280
70291
  }, rest)); // If it is a controlled component, directly notify
70292
+ // Make sure that the operations of updating updateOptions are done after the animation ends
70293
+ // otherwise the content will be updated when the popup layer is not collapsed, and it looks like it will flash once when it is closed
70281
70294
 
70282
70295
 
70283
70296
  if (this._isControlledComponent()) {
70284
- this._notifyChange(selections);
70285
-
70286
- this.close(event);
70297
+ this.close(event, () => {
70298
+ this._notifyChange(selections);
70299
+ });
70287
70300
  } else {
70288
70301
  this._adapter.updateSelection(selections); // notify user
70289
70302
 
70290
70303
 
70291
- this._notifyChange(selections); // Update the selected item in the drop-down box
70292
-
70304
+ this._notifyChange(selections);
70293
70305
 
70294
- this.close(event);
70295
- this.updateOptionsActiveStatus(selections);
70306
+ this.close(event, () => {
70307
+ // Update the selected item in the drop-down box
70308
+ this.updateOptionsActiveStatus(selections);
70309
+ });
70296
70310
  }
70297
70311
  }
70298
70312
 
@@ -71183,6 +71197,10 @@ class foundation_SelectFoundation extends foundation {
71183
71197
  }
71184
71198
  }
71185
71199
 
71200
+ handlePopoverClose() {
71201
+ this._adapter.emit('popoverClose');
71202
+ }
71203
+
71186
71204
  }
71187
71205
  // CONCATENATED MODULE: ../semi-foundation/select/constants.ts
71188
71206
 
@@ -71731,6 +71749,7 @@ var select_select = __webpack_require__("1d3+");
71731
71749
 
71732
71750
 
71733
71751
 
71752
+
71734
71753
 
71735
71754
 
71736
71755
  const select_prefixcls = select_constants_cssClasses.PREFIX;
@@ -71828,6 +71847,7 @@ class select_Select extends baseComponent_BaseComponent {
71828
71847
  this.onMouseLeave = this.onMouseLeave.bind(this);
71829
71848
  this.renderOption = this.renderOption.bind(this);
71830
71849
  this.onKeyPress = this.onKeyPress.bind(this);
71850
+ this.eventManager = new Event_Event();
71831
71851
  this.foundation = new foundation_SelectFoundation(this.adapter);
71832
71852
  Object(warning["a" /* default */])('optionLabelProp' in this.props, '[Semi Select] \'optionLabelProp\' has already been deprecated, please use \'renderSelectedItem\' instead.');
71833
71853
  Object(warning["a" /* default */])('labelInValue' in this.props, '[Semi Select] \'labelInValue\' has already been deprecated, please use \'onChangeWithObject\' instead.');
@@ -71923,6 +71943,10 @@ class select_Select extends baseComponent_BaseComponent {
71923
71943
  }
71924
71944
  };
71925
71945
  return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, super.adapter), keyboardAdapter), filterAdapter), multipleAdapter), {
71946
+ on: (eventName, eventCallback) => this.eventManager.on(eventName, eventCallback),
71947
+ off: eventName => this.eventManager.off(eventName),
71948
+ once: (eventName, eventCallback) => this.eventManager.once(eventName, eventCallback),
71949
+ emit: eventName => this.eventManager.emit(eventName),
71926
71950
  // Collect all subitems, each item is visible by default when collected, and is not selected
71927
71951
  getOptionsFromChildren: function () {
71928
71952
  let children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.children;
@@ -72775,7 +72799,8 @@ class select_Select extends baseComponent_BaseComponent {
72775
72799
  spacing: spacing,
72776
72800
  stopPropagation: stopPropagation,
72777
72801
  disableArrowKeyDown: true,
72778
- onVisibleChange: status => this.handlePopoverVisibleChange(status)
72802
+ onVisibleChange: status => this.handlePopoverVisibleChange(status),
72803
+ afterClose: () => this.foundation.handlePopoverClose()
72779
72804
  }, selection);
72780
72805
  }
72781
72806
 
@@ -89023,7 +89048,6 @@ class TimePicker_TimePicker extends baseComponent_BaseComponent {
89023
89048
  outerProps.onClick = this.openPanel;
89024
89049
  }
89025
89050
 
89026
- console.log("===>", disabled ? false : open, motion);
89027
89051
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", Object.assign({
89028
89052
  ref: this.setTimePickerRef,
89029
89053
  className: classnames_default()({
@@ -102939,7 +102963,7 @@ class preview_Preview extends baseComponent_BaseComponent {
102939
102963
  const finalSrcList = [...srcArr, ...srcListInChildren];
102940
102964
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(PreviewContext.Provider, {
102941
102965
  value: {
102942
- isGroup: finalSrcList.length > 1,
102966
+ isGroup: true,
102943
102967
  previewSrc: finalSrcList,
102944
102968
  titles: titles,
102945
102969
  currentIndex,