@douyinfe/semi-ui 2.28.0 → 2.28.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.
@@ -53482,7 +53482,7 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
53482
53482
  rangeEnd
53483
53483
  } = this.getStates();
53484
53484
 
53485
- if (values && values.length) {
53485
+ if (values && (values === null || values === void 0 ? void 0 : values.length)) {
53486
53486
  switch (type) {
53487
53487
  case 'date':
53488
53488
  this._initDatePickerFromValue(values, refreshPicker);
@@ -53594,8 +53594,25 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
53594
53594
  pickerDate: values[1] || monthRight.pickerDate
53595
53595
  }));
53596
53596
 
53597
- this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_LEFT, adjustResult.monthLeft.pickerDate);
53598
- this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_RIGHT, adjustResult.monthRight.pickerDate); // init range
53597
+ const validValue = Array.isArray(values) && values.filter(item => item).length > 1;
53598
+
53599
+ if (validValue) {
53600
+ this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_LEFT, adjustResult.monthLeft.pickerDate);
53601
+ this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_RIGHT, adjustResult.monthRight.pickerDate);
53602
+ } else {
53603
+ const selectedDate = values.find(item => item); // 如果日期不完整且输入日期不在面板范围内,则更新面板
53604
+
53605
+ if (selectedDate) {
53606
+ const notLeftMonth = (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.getMonth()) !== monthLeft.pickerDate.getMonth();
53607
+ const notRightMonth = (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.getMonth()) !== monthRight.pickerDate.getMonth();
53608
+
53609
+ if (notLeftMonth && notRightMonth) {
53610
+ this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_LEFT, adjustResult.monthLeft.pickerDate);
53611
+ this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_RIGHT, adjustResult.monthRight.pickerDate);
53612
+ }
53613
+ }
53614
+ } // init range
53615
+
53599
53616
 
53600
53617
  const formatToken = withTime ? datePicker_constants_strings.FORMAT_DATE_TIME : datePicker_constants_strings.FORMAT_FULL_DATE;
53601
53618
  let rangeStart = values[0] && format_format(values[0], formatToken);
@@ -57833,7 +57850,7 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
57833
57850
  }
57834
57851
  monthsGrid_MonthsGrid.propTypes = {
57835
57852
  type: prop_types_default.a.oneOf(datePicker_constants_strings.TYPE_SET),
57836
- defaultValue: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number, prop_types_default.a.object, prop_types_default.a.array]),
57853
+ defaultValue: prop_types_default.a.array,
57837
57854
  defaultPickerValue: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number, prop_types_default.a.object, prop_types_default.a.array]),
57838
57855
  multiple: prop_types_default.a.bool,
57839
57856
  max: prop_types_default.a.number,
@@ -67234,6 +67251,7 @@ class resizeObserver_ReactResizeObserver extends baseComponent_BaseComponent {
67234
67251
  if (this.observer) {
67235
67252
  this.observer.disconnect();
67236
67253
  this.observer = null;
67254
+ this.element = null;
67237
67255
  }
67238
67256
  }
67239
67257
 
@@ -67241,6 +67259,10 @@ class resizeObserver_ReactResizeObserver extends baseComponent_BaseComponent {
67241
67259
  let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
67242
67260
  const element = this.getElement();
67243
67261
 
67262
+ if (!this.observer) {
67263
+ this.observer = new ResizeObserver_es["a" /* default */](this.props.onResize);
67264
+ }
67265
+
67244
67266
  if (!(element && element instanceof Element)) {
67245
67267
  // stop everything if not defined
67246
67268
  this.observer.disconnect();