@douyinfe/semi-ui 2.44.0 → 2.44.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.
@@ -71052,7 +71052,7 @@ class Select extends BaseComponent {
71052
71052
  }, locale.createText), option.value)));
71053
71053
  return defaultCreateItem;
71054
71054
  }
71055
- const customCreateItem = renderCreateItem(option.value, isFocused);
71055
+ const customCreateItem = renderCreateItem(option.value, isFocused, style);
71056
71056
  return (
71057
71057
  /*#__PURE__*/
71058
71058
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/interactive-supports-focus
@@ -71336,9 +71336,8 @@ class Select extends BaseComponent {
71336
71336
  const {
71337
71337
  maxTagCount
71338
71338
  } = this.props;
71339
- const maxVisibleCount = selections.size - maxTagCount;
71340
- const newOverFlowItemCount = maxVisibleCount > 0 ? maxVisibleCount + items.length - 1 : items.length - 1;
71341
- if (items.length > 1 && overflowItemCount !== newOverFlowItemCount) {
71339
+ const newOverFlowItemCount = selections.size - maxTagCount > 0 ? selections.size - maxTagCount + items.length - 1 : items.length - 1;
71340
+ if (overflowItemCount !== newOverFlowItemCount) {
71342
71341
  this.foundation.updateOverflowItemCount(selections.size, newOverFlowItemCount);
71343
71342
  }
71344
71343
  }
@@ -71351,6 +71350,7 @@ class Select extends BaseComponent {
71351
71350
  className: `${select_prefixcls}-content-wrapper-collapse`
71352
71351
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(overflowList_0, {
71353
71352
  items: normalTags,
71353
+ key: String(selections.length),
71354
71354
  overflowRenderer: overflowItems => this.renderOverflow(overflowItems, length - 1),
71355
71355
  onOverflow: overflowItems => this.handleOverflow(overflowItems),
71356
71356
  visibleItemRenderer: (item, index) => this.renderTag(item, index)
@@ -78194,7 +78194,7 @@ function mergeQueries(query) {
78194
78194
  * @param {Object[]} newColumns
78195
78195
  */
78196
78196
  function withResizeWidth(columns, newColumns) {
78197
- const _newColumns = Object.assign({}, newColumns);
78197
+ const _newColumns = [...newColumns];
78198
78198
  for (const column of columns) {
78199
78199
  if (!isNullOrUndefined(column.width)) {
78200
78200
  const currentColumn = column.key;
@@ -88870,8 +88870,10 @@ class Tree extends BaseComponent {
88870
88870
  const treeDataHasChange = prevProps && prevProps.treeData !== props.treeData;
88871
88871
  return firstInProps || treeDataHasChange;
88872
88872
  };
88873
+ const needUpdateTreeData = needUpdate('treeData');
88874
+ const needUpdateSimpleJson = needUpdate('treeDataSimpleJson');
88873
88875
  // Update the data of tree in state
88874
- if (needUpdate('treeData') || props.draggable && needUpdateData()) {
88876
+ if (needUpdateTreeData || props.draggable && needUpdateData()) {
88875
88877
  treeData = props.treeData;
88876
88878
  newState.treeData = treeData;
88877
88879
  const entitiesMap = convertDataToEntities(treeData);
@@ -88879,7 +88881,7 @@ class Tree extends BaseComponent {
88879
88881
  keyEntities = newState.keyEntities;
88880
88882
  newState.cachedKeyValuePairs = Object.assign({}, entitiesMap.valueEntities);
88881
88883
  valueEntities = newState.cachedKeyValuePairs;
88882
- } else if (needUpdate('treeDataSimpleJson')) {
88884
+ } else if (needUpdateSimpleJson) {
88883
88885
  // Convert treeDataSimpleJson to treeData
88884
88886
  treeData = convertJsonToData(props.treeDataSimpleJson);
88885
88887
  newState.treeData = treeData;
@@ -88896,7 +88898,7 @@ class Tree extends BaseComponent {
88896
88898
  newState.motionType = null;
88897
88899
  }
88898
88900
  }
88899
- const dataUpdated = needUpdate('treeDataSimpleJson') || needUpdate('treeData');
88901
+ const dataUpdated = needUpdateSimpleJson || needUpdateTreeData;
88900
88902
  const expandAllWhenDataChange = dataUpdated && props.expandAll;
88901
88903
  if (!isSeaching) {
88902
88904
  // Update expandedKeys
@@ -89019,7 +89021,7 @@ class Tree extends BaseComponent {
89019
89021
  if (props.value) {
89020
89022
  checkedKeyValues = findKeysForValues(normalizeValue(props.value, withObject) || [], valueEntities, isMultiple);
89021
89023
  } else {
89022
- checkedKeyValues = updateKeys(prevState.checkedKeys, keyEntities);
89024
+ checkedKeyValues = updateKeys(props.checkRelation === 'related' ? prevState.checkedKeys : prevState.realCheckedKeys, keyEntities);
89023
89025
  }
89024
89026
  }
89025
89027
  if (checkedKeyValues) {
@@ -91050,8 +91052,10 @@ class TreeSelect extends BaseComponent {
91050
91052
  const newState = {
91051
91053
  prevProps: props
91052
91054
  };
91055
+ const needUpdateTreeData = needUpdate('treeData');
91056
+ const needUpdateExpandedKeys = needUpdate('expandedKeys');
91053
91057
  // TreeNode
91054
- if (needUpdate('treeData')) {
91058
+ if (needUpdateTreeData) {
91055
91059
  treeData = props.treeData;
91056
91060
  newState.treeData = treeData;
91057
91061
  const entitiesMap = convertDataToEntities(treeData);
@@ -91067,9 +91071,9 @@ class TreeSelect extends BaseComponent {
91067
91071
  newState.motionType = null;
91068
91072
  }
91069
91073
  }
91070
- const expandAllWhenDataChange = needUpdate('treeData') && props.expandAll;
91074
+ const expandAllWhenDataChange = needUpdateTreeData && props.expandAll;
91071
91075
  // expandedKeys
91072
- if (needUpdate('expandedKeys') || prevProps && needUpdate('autoExpandParent')) {
91076
+ if (needUpdateExpandedKeys || prevProps && needUpdate('autoExpandParent')) {
91073
91077
  newState.expandedKeys = calcExpandedKeys(props.expandedKeys, keyEntities, props.autoExpandParent || !prevProps);
91074
91078
  // only show animation when treeData does not change
91075
91079
  if (prevProps && props.motion && !treeData) {
@@ -91090,7 +91094,7 @@ class TreeSelect extends BaseComponent {
91090
91094
  newState.expandedKeys = calcExpandedKeysForValues(normalizeValue(props.value, withObject), keyEntities, props.multiple, valueEntities);
91091
91095
  }
91092
91096
  // flattenNodes
91093
- if (treeData || needUpdate('expandedKeys')) {
91097
+ if (treeData || needUpdateExpandedKeys) {
91094
91098
  const flattenNodes = flattenTreeData(treeData || prevState.treeData, newState.expandedKeys || prevState.expandedKeys);
91095
91099
  newState.flattenNodes = flattenNodes;
91096
91100
  }
@@ -91121,7 +91125,7 @@ class TreeSelect extends BaseComponent {
91121
91125
  if (props.value) {
91122
91126
  checkedKeyValues = findKeysForValues(normalizeValue(props.value, withObject) || [], valueEntities, isMultiple);
91123
91127
  } else {
91124
- checkedKeyValues = updateKeys(prevState.checkedKeys, keyEntities);
91128
+ checkedKeyValues = updateKeys(props.checkRelation === 'related' ? prevState.checkedKeys : prevState.realCheckedKeys, keyEntities);
91125
91129
  }
91126
91130
  }
91127
91131
  if (checkedKeyValues) {
@@ -91142,7 +91146,7 @@ class TreeSelect extends BaseComponent {
91142
91146
  newState.loadedKeys = new Set(props.loadedKeys);
91143
91147
  }
91144
91148
  // ================== rePosKey ==================
91145
- if (needUpdate('treeData') || needUpdate('value')) {
91149
+ if (needUpdateTreeData || needUpdate('value')) {
91146
91150
  newState.rePosKey = rePosKey + 1;
91147
91151
  }
91148
91152
  // ================ disableStrictly =================
@@ -98538,13 +98542,13 @@ class ArrayFieldComponent extends external_root_React_commonjs2_react_commonjs_r
98538
98542
  keys
98539
98543
  });
98540
98544
  }
98541
- addWithInitValue(lineObject) {
98545
+ addWithInitValue(rowVal) {
98542
98546
  const updater = this.context;
98543
98547
  const {
98544
98548
  field
98545
98549
  } = this.props;
98546
98550
  const newArrayFieldVal = updater.getValue(field) ? updater.getValue(field).slice() : [];
98547
- newArrayFieldVal.push(lineObject);
98551
+ newArrayFieldVal.push(rowVal);
98548
98552
  updater.updateStateValue(field, newArrayFieldVal, {});
98549
98553
  updater.updateArrayField(field, {
98550
98554
  updateKey: new Date().valueOf()