@douyinfe/semi-ui 2.34.2 → 2.35.0

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.
@@ -73657,7 +73657,10 @@ class OverflowList extends BaseComponent {
73657
73657
  }
73658
73658
 
73659
73659
  componentDidUpdate(prevProps, prevState) {
73660
- if (!isEqual_default()(prevProps.items, this.props.items)) {
73660
+ const prevItemsKeys = prevProps.items.map(item => item.key);
73661
+ const nowItemsKeys = this.props.items.map(item => item.key); // Determine whether to update by comparing key values
73662
+
73663
+ if (!isEqual_default()(prevItemsKeys, nowItemsKeys)) {
73661
73664
  this.itemRefs = {};
73662
73665
  this.setState({
73663
73666
  visibleState: new Map()
@@ -76349,7 +76352,7 @@ class SelectFoundation extends foundation {
76349
76352
 
76350
76353
  const selectedValue = onChangeWithObject && typeof propValue !== 'undefined' ? propValue.value : propValue;
76351
76354
  const selectedOptions = originalOptions.filter(option => option.value === selectedValue);
76352
- const noMatchOptionInList = !selectedOptions.length && typeof selectedValue !== 'undefined'; // If the current value, there is a matching option in the optionList
76355
+ const noMatchOptionInList = !selectedOptions.length && typeof selectedValue !== 'undefined' && selectedValue !== null; // If the current value, there is a matching option in the optionList
76353
76356
 
76354
76357
  if (selectedOptions.length) {
76355
76358
  const selectedOption = selectedOptions[0];
@@ -83298,7 +83301,7 @@ class SliderFoundation extends foundation {
83298
83301
  */
83299
83302
 
83300
83303
 
83301
- this.handleMousePos = (pageX, pageY) => {
83304
+ this.handleMousePos = (clientX, clientY) => {
83302
83305
  const parentRect = this._adapter.getParentRect();
83303
83306
 
83304
83307
  const scrollParent = this._adapter.getScrollParentVal();
@@ -83306,8 +83309,8 @@ class SliderFoundation extends foundation {
83306
83309
  const parentX = parentRect ? parentRect.left : 0;
83307
83310
  const parentY = parentRect ? parentRect.top : 0;
83308
83311
  return {
83309
- x: pageX - parentX + scrollParent.scrollLeft,
83310
- y: pageY - parentY + scrollParent.scrollTop
83312
+ x: clientX - parentX + scrollParent.scrollLeft,
83313
+ y: clientY - parentY + scrollParent.scrollTop
83311
83314
  };
83312
83315
  };
83313
83316
  /**
@@ -83368,9 +83371,9 @@ class SliderFoundation extends foundation {
83368
83371
  startPos = sliderY + len;
83369
83372
  } else {
83370
83373
  startPos = vertical ? sliderY : sliderX;
83371
- }
83374
+ } // startPos = chooseMovePos === 'max' && isDrag ? currentPos[0] : startPos;
83375
+ // eslint-disable-next-line one-var
83372
83376
 
83373
- startPos = chooseMovePos === 'max' && isDrag ? currentPos[0] : startPos; // eslint-disable-next-line one-var
83374
83377
 
83375
83378
  let endPos;
83376
83379
 
@@ -83378,9 +83381,8 @@ class SliderFoundation extends foundation {
83378
83381
  endPos = sliderY;
83379
83382
  } else {
83380
83383
  endPos = vertical ? sliderY + sliderHeight : sliderX + sliderWidth;
83381
- }
83384
+ } // endPos = chooseMovePos === 'min' && isDrag && range ? currentPos[1] : endPos;
83382
83385
 
83383
- endPos = chooseMovePos === 'min' && isDrag && range ? currentPos[1] : endPos;
83384
83386
 
83385
83387
  if (vertical && verticalReverse) {
83386
83388
  if (position >= startPos) {
@@ -83433,7 +83435,7 @@ class SliderFoundation extends foundation {
83433
83435
  let stepValue;
83434
83436
 
83435
83437
  if (vertical && verticalReverse) {
83436
- isMin = !isMin;
83438
+ //isMin = !isMin;
83437
83439
  stepValue = (startPos + len - pos) / len * (max - min) + min;
83438
83440
  } else {
83439
83441
  stepValue = (pos - startPos) / len * (max - min) + min;
@@ -83455,11 +83457,7 @@ class SliderFoundation extends foundation {
83455
83457
  }
83456
83458
 
83457
83459
  if (range && stepValue !== compareValue) {
83458
- if (vertical && verticalReverse) {
83459
- return isMin ? [currentValue[0], stepValue] : [stepValue, currentValue[1]];
83460
- } else {
83461
- return isMin ? [stepValue, currentValue[1]] : [currentValue[0], stepValue];
83462
- }
83460
+ return isMin ? [stepValue, currentValue[1]] : [currentValue[0], stepValue];
83463
83461
  } else if (!range && stepValue !== compareValue) {
83464
83462
  return stepValue;
83465
83463
  } else {
@@ -83496,11 +83494,7 @@ class SliderFoundation extends foundation {
83496
83494
  const len = vertical ? sliderHeight : sliderWidth;
83497
83495
 
83498
83496
  if (range) {
83499
- if (vertical && verticalReverse) {
83500
- return [startPos + len - (value[0] - min) * len / (max - min), startPos + len - (value[1] - min) * len / (max - min)];
83501
- } else {
83502
- return [(value[0] - min) * len / (max - min) + startPos, (value[1] - min) * len / (max - min) + startPos];
83503
- }
83497
+ return [(value[0] - min) * len / (max - min) + startPos, (value[1] - min) * len / (max - min) + startPos];
83504
83498
  } else {
83505
83499
  return (value - min) * len / (max - min) + startPos;
83506
83500
  }
@@ -83658,7 +83652,7 @@ class SliderFoundation extends foundation {
83658
83652
  this._adapter.setDragging([dragging[0], true]);
83659
83653
  }
83660
83654
 
83661
- const mousePos = this.handleMousePos(e.pageX, e.pageY);
83655
+ const mousePos = this.handleMousePos(e.clientX, e.clientY);
83662
83656
  let pos = vertical ? mousePos.y : mousePos.x;
83663
83657
 
83664
83658
  if (!this._adapter.isEventFromHandle(e)) {
@@ -83694,7 +83688,7 @@ class SliderFoundation extends foundation {
83694
83688
  }
83695
83689
 
83696
83690
  this.onHandleEnter(chooseMovePos);
83697
- const mousePos = this.handleMousePos(e.pageX, e.pageY);
83691
+ const mousePos = this.handleMousePos(e.clientX, e.clientY);
83698
83692
  let pagePos = vertical ? mousePos.y : mousePos.x;
83699
83693
  pagePos = pagePos - this._dragOffset;
83700
83694
 
@@ -83994,7 +83988,7 @@ class SliderFoundation extends foundation {
83994
83988
  const {
83995
83989
  vertical
83996
83990
  } = this.getProps();
83997
- const mousePos = this.handleMousePos(e.pageX, e.pageY);
83991
+ const mousePos = this.handleMousePos(e.clientX, e.clientY);
83998
83992
  const position = vertical ? mousePos.y : mousePos.x;
83999
83993
  const isMin = this.checkWhichHandle(position);
84000
83994
  const outPutValue = this.calculateOutputValue(position, isMin);