@douyinfe/semi-ui 2.17.0-beta.0 → 2.17.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.
@@ -34935,6 +34935,10 @@ class foundation_AutoCompleteFoundation extends foundation {
34935
34935
  this._adapter.notifyChange(inputValue);
34936
34936
 
34937
34937
  this._modifyFocusIndex(inputValue);
34938
+
34939
+ if (!this.isPanelOpen) {
34940
+ this.openDropdown();
34941
+ }
34938
34942
  }
34939
34943
 
34940
34944
  handleSelect(option, optionIndex) {
@@ -36937,7 +36941,7 @@ class autoComplete_AutoComplete extends baseComponent_BaseComponent {
36937
36941
  } = this.state;
36938
36942
  const useCustomTrigger = typeof triggerRender === 'function';
36939
36943
 
36940
- const outerProps = assign_default()({
36944
+ const outerProps = assign_default()(assign_default()({
36941
36945
  style,
36942
36946
  className: useCustomTrigger ? classnames_default()(className) : classnames_default()({
36943
36947
  [autoComplete_prefixCls]: true,
@@ -36946,7 +36950,10 @@ class autoComplete_AutoComplete extends baseComponent_BaseComponent {
36946
36950
  onClick: this.handleInputClick,
36947
36951
  ref: this.triggerRef,
36948
36952
  id
36949
- }, keyboardEventSet);
36953
+ }, keyboardEventSet), {
36954
+ // tooltip give tabindex 0 to children by default, autoComplete just need the input get focus, so outer div's tabindex set to -1
36955
+ tabIndex: -1
36956
+ });
36950
36957
 
36951
36958
  const innerProps = {
36952
36959
  disabled,
@@ -49749,7 +49756,10 @@ class checkbox_Checkbox extends baseComponent_BaseComponent {
49749
49756
  }
49750
49757
 
49751
49758
  isInGroup() {
49752
- return Boolean(this.context && this.context.checkboxGroup);
49759
+ // Why do we need to determine whether there is a value in props?
49760
+ // If there is no value in the props of the checkbox in the context of the checkboxGroup,
49761
+ // it will be considered not to belong to the checkboxGroup。
49762
+ return Boolean(this.context && this.context.checkboxGroup && 'value' in this.props);
49753
49763
  }
49754
49764
 
49755
49765
  focus() {
@@ -54334,6 +54344,37 @@ class cascader_Cascader extends baseComponent_BaseComponent {
54334
54344
  return firstInProps || treeDataHasChange;
54335
54345
  };
54336
54346
 
54347
+ const getRealKeys = (realValue, keyEntities) => {
54348
+ // normallizedValue is used to save the value in two-dimensional array format
54349
+ let normallizedValue = [];
54350
+
54351
+ if (is_array_default()(realValue)) {
54352
+ normallizedValue = is_array_default()(realValue[0]) ? realValue : [realValue];
54353
+ } else {
54354
+ if (realValue !== undefined) {
54355
+ normallizedValue = [[realValue]];
54356
+ }
54357
+ } // formatValuePath is used to save value of valuePath
54358
+
54359
+
54360
+ const formatValuePath = [];
54361
+
54362
+ for_each_default()(normallizedValue).call(normallizedValue, valueItem => {
54363
+ const formatItem = onChangeWithObject ? map_default()(valueItem).call(valueItem, i => i === null || i === void 0 ? void 0 : i.value) : valueItem;
54364
+ formatValuePath.push(formatItem);
54365
+ }); // formatKeys is used to save key of value
54366
+
54367
+
54368
+ const formatKeys = [];
54369
+
54370
+ for_each_default()(formatValuePath).call(formatValuePath, v => {
54371
+ const formatKeyItem = util_findKeysForValues(v, keyEntities);
54372
+ !isEmpty_default()(formatKeyItem) && formatKeys.push(formatKeyItem);
54373
+ });
54374
+
54375
+ return formatKeys;
54376
+ };
54377
+
54337
54378
  const needUpdateTreeData = needUpdate('treeData') || needUpdateData();
54338
54379
  const needUpdateValue = needUpdate('value') || isEmpty_default()(prevProps) && defaultValue;
54339
54380
 
@@ -54350,35 +54391,15 @@ class cascader_Cascader extends baseComponent_BaseComponent {
54350
54391
  let realKeys = prevState.checkedKeys; // when data was updated
54351
54392
 
54352
54393
  if (needUpdateValue) {
54353
- // normallizedValue is used to save the value in two-dimensional array format
54354
- let normallizedValue = [];
54355
- const realValue = needUpdate('value') ? value : defaultValue; // eslint-disable-next-line max-depth
54356
-
54357
- if (is_array_default()(realValue)) {
54358
- normallizedValue = is_array_default()(realValue[0]) ? realValue : [realValue];
54359
- } else {
54360
- if (realValue !== undefined) {
54361
- normallizedValue = [[realValue]];
54362
- }
54363
- } // formatValuePath is used to save value of valuePath
54364
-
54365
-
54366
- const formatValuePath = [];
54367
-
54368
- for_each_default()(normallizedValue).call(normallizedValue, valueItem => {
54369
- const formatItem = onChangeWithObject ? map_default()(valueItem).call(valueItem, i => i === null || i === void 0 ? void 0 : i.value) : valueItem;
54370
- formatValuePath.push(formatItem);
54371
- }); // formatKeys is used to save key of value
54372
-
54373
-
54374
- const formatKeys = [];
54375
-
54376
- for_each_default()(formatValuePath).call(formatValuePath, v => {
54377
- const formatKeyItem = util_findKeysForValues(v, keyEntities);
54378
- !isEmpty_default()(formatKeyItem) && formatKeys.push(formatKeyItem);
54379
- });
54380
-
54381
- realKeys = formatKeys;
54394
+ const realValue = needUpdate('value') ? value : defaultValue;
54395
+ realKeys = getRealKeys(realValue, keyEntities);
54396
+ } else {
54397
+ // needUpdateValue is false
54398
+ // if treeData is updated & Cascader is controlled, realKeys should be recalculated
54399
+ if (needUpdateTreeData && 'value' in props) {
54400
+ const realValue = value;
54401
+ realKeys = getRealKeys(realValue, keyEntities);
54402
+ }
54382
54403
  }
54383
54404
 
54384
54405
  if (isSet_default()(realKeys)) {
@@ -68707,7 +68728,7 @@ class empty_Empty extends baseComponent_BaseComponent {
68707
68728
  darkModeImage
68708
68729
  } = this.props;
68709
68730
  const alt = typeof description === 'string' ? description : 'empty';
68710
- const imgSrc = this.state.mode && darkModeImage ? darkModeImage : image;
68731
+ const imgSrc = this.state.mode === 'dark' && darkModeImage ? darkModeImage : image;
68711
68732
  let imageNode = null;
68712
68733
 
68713
68734
  if (typeof imgSrc === 'string') {
@@ -91311,8 +91332,8 @@ class foundation_TableFoundation extends foundation {
91311
91332
  filteredData = new core_js_stable_map_default.a();
91312
91333
  }
91313
91334
 
91314
- each_default()(currentFilteredValue, value => {
91315
- each_default()(dataSource, record => {
91335
+ each_default()(dataSource, record => {
91336
+ each_default()(currentFilteredValue, value => {
91316
91337
  const childrenRecords = get_default()(record, childrenRecordName);
91317
91338
 
91318
91339
  const recordKey = this.getRecordKey(record);
@@ -99298,23 +99319,20 @@ class foundation_TimePickerFoundation extends foundation {
99298
99319
  timeZone,
99299
99320
  __prevTimeZone
99300
99321
  } = props;
99322
+ let dates = this.parseValue(value);
99323
+ const invalid = this.validateDates(dates);
99301
99324
 
99302
- if (!isNullOrUndefined(value)) {
99303
- let dates = this.parseValue(value);
99304
- const invalid = this.validateDates(dates);
99305
-
99306
- if (!invalid) {
99307
- if (this.isValidTimeZone(timeZone)) {
99308
- dates = map_default()(dates).call(dates, date => date_fns_extra_utcToZonedTime(this.isValidTimeZone(__prevTimeZone) ? date_fns_extra_zonedTimeToUtc(date, __prevTimeZone) : date, timeZone));
99309
- }
99310
-
99311
- const inputValue = this.formatValue(dates);
99312
- this.setState({
99313
- value: dates,
99314
- invalid,
99315
- inputValue
99316
- });
99325
+ if (!invalid) {
99326
+ if (this.isValidTimeZone(timeZone)) {
99327
+ dates = map_default()(dates).call(dates, date => date_fns_extra_utcToZonedTime(this.isValidTimeZone(__prevTimeZone) ? date_fns_extra_zonedTimeToUtc(date, __prevTimeZone) : date, timeZone));
99317
99328
  }
99329
+
99330
+ const inputValue = this.formatValue(dates);
99331
+ this.setState({
99332
+ value: dates,
99333
+ invalid,
99334
+ inputValue
99335
+ });
99318
99336
  }
99319
99337
  }
99320
99338