@douyinfe/semi-foundation 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.
@@ -12,6 +12,6 @@ $module: #{$prefix}-portal;
12
12
  &-inner {
13
13
  position: absolute;
14
14
  background-color: transparent;
15
- min-width: fit-content;
15
+ min-width: max-content;
16
16
  }
17
17
  }
@@ -153,6 +153,9 @@ class AutoCompleteFoundation<P = Record<string, any>, S = Record<string, any>> e
153
153
  this._adapter.notifySearch(inputValue);
154
154
  this._adapter.notifyChange(inputValue);
155
155
  this._modifyFocusIndex(inputValue);
156
+ if (!this.isPanelOpen){
157
+ this.openDropdown();
158
+ }
156
159
  }
157
160
 
158
161
  handleSelect(option: StateOptionItem, optionIndex?: number): void {
@@ -389,7 +392,7 @@ class AutoCompleteFoundation<P = Record<string, any>, S = Record<string, any>> e
389
392
  if (!visible){
390
393
  this.openDropdown();
391
394
  } else {
392
- if (focusIndex !== undefined && focusIndex !== -1 && options.length !== 0) {
395
+ if (focusIndex !== undefined && focusIndex !== -1 && options.length !== 0) {
393
396
  const visibleOptions = options.filter((item: StateOptionItem) => item.show);
394
397
  const selectedOption = visibleOptions[focusIndex];
395
398
  this.handleSelect(selectedOption, focusIndex);
@@ -11,5 +11,5 @@
11
11
  .semi-portal-inner {
12
12
  position: absolute;
13
13
  background-color: transparent;
14
- min-width: fit-content;
14
+ min-width: max-content;
15
15
  }
@@ -12,6 +12,6 @@ $module: #{$prefix}-portal;
12
12
  &-inner {
13
13
  position: absolute;
14
14
  background-color: transparent;
15
- min-width: fit-content;
15
+ min-width: max-content;
16
16
  }
17
17
  }
@@ -192,6 +192,10 @@ class AutoCompleteFoundation extends _foundation.default {
192
192
  this._adapter.notifyChange(inputValue);
193
193
 
194
194
  this._modifyFocusIndex(inputValue);
195
+
196
+ if (!this.isPanelOpen) {
197
+ this.openDropdown();
198
+ }
195
199
  }
196
200
 
197
201
  handleSelect(option, optionIndex) {
@@ -400,8 +400,8 @@ class TableFoundation extends _foundation.default {
400
400
  filteredData = new _map.default();
401
401
  }
402
402
 
403
- (0, _each2.default)(currentFilteredValue, value => {
404
- (0, _each2.default)(dataSource, record => {
403
+ (0, _each2.default)(dataSource, record => {
404
+ (0, _each2.default)(currentFilteredValue, value => {
405
405
  const childrenRecords = (0, _get2.default)(record, childrenRecordName);
406
406
  const recordKey = this.getRecordKey(record);
407
407
  let filteredChildren;
@@ -215,23 +215,20 @@ class TimePickerFoundation extends _foundation.default {
215
215
  timeZone,
216
216
  __prevTimeZone
217
217
  } = props;
218
+ let dates = this.parseValue(value);
219
+ const invalid = this.validateDates(dates);
218
220
 
219
- if (!(0, _isNullOrUndefined.default)(value)) {
220
- let dates = this.parseValue(value);
221
- const invalid = this.validateDates(dates);
222
-
223
- if (!invalid) {
224
- if (this.isValidTimeZone(timeZone)) {
225
- dates = (0, _map.default)(dates).call(dates, date => (0, _dateFnsExtra.utcToZonedTime)(this.isValidTimeZone(__prevTimeZone) ? (0, _dateFnsExtra.zonedTimeToUtc)(date, __prevTimeZone) : date, timeZone));
226
- }
227
-
228
- const inputValue = this.formatValue(dates);
229
- this.setState({
230
- value: dates,
231
- invalid,
232
- inputValue
233
- });
221
+ if (!invalid) {
222
+ if (this.isValidTimeZone(timeZone)) {
223
+ dates = (0, _map.default)(dates).call(dates, date => (0, _dateFnsExtra.utcToZonedTime)(this.isValidTimeZone(__prevTimeZone) ? (0, _dateFnsExtra.zonedTimeToUtc)(date, __prevTimeZone) : date, timeZone));
234
224
  }
225
+
226
+ const inputValue = this.formatValue(dates);
227
+ this.setState({
228
+ value: dates,
229
+ invalid,
230
+ inputValue
231
+ });
235
232
  }
236
233
  }
237
234
 
@@ -11,5 +11,5 @@
11
11
  .semi-portal-inner {
12
12
  position: absolute;
13
13
  background-color: transparent;
14
- min-width: fit-content;
14
+ min-width: max-content;
15
15
  }
@@ -12,6 +12,6 @@ $module: #{$prefix}-portal;
12
12
  &-inner {
13
13
  position: absolute;
14
14
  background-color: transparent;
15
- min-width: fit-content;
15
+ min-width: max-content;
16
16
  }
17
17
  }
@@ -168,6 +168,10 @@ class AutoCompleteFoundation extends BaseFoundation {
168
168
  this._adapter.notifyChange(inputValue);
169
169
 
170
170
  this._modifyFocusIndex(inputValue);
171
+
172
+ if (!this.isPanelOpen) {
173
+ this.openDropdown();
174
+ }
171
175
  }
172
176
 
173
177
  handleSelect(option, optionIndex) {
@@ -360,8 +360,8 @@ class TableFoundation extends BaseFoundation {
360
360
  filteredData = new _Map();
361
361
  }
362
362
 
363
- _each(currentFilteredValue, value => {
364
- _each(dataSource, record => {
363
+ _each(dataSource, record => {
364
+ _each(currentFilteredValue, value => {
365
365
  const childrenRecords = _get(record, childrenRecordName);
366
366
 
367
367
  const recordKey = this.getRecordKey(record);
@@ -192,23 +192,20 @@ class TimePickerFoundation extends BaseFoundation {
192
192
  timeZone,
193
193
  __prevTimeZone
194
194
  } = props;
195
+ let dates = this.parseValue(value);
196
+ const invalid = this.validateDates(dates);
195
197
 
196
- if (!isNullOrUndefined(value)) {
197
- let dates = this.parseValue(value);
198
- const invalid = this.validateDates(dates);
199
-
200
- if (!invalid) {
201
- if (this.isValidTimeZone(timeZone)) {
202
- dates = _mapInstanceProperty(dates).call(dates, date => utcToZonedTime(this.isValidTimeZone(__prevTimeZone) ? zonedTimeToUtc(date, __prevTimeZone) : date, timeZone));
203
- }
204
-
205
- const inputValue = this.formatValue(dates);
206
- this.setState({
207
- value: dates,
208
- invalid,
209
- inputValue
210
- });
198
+ if (!invalid) {
199
+ if (this.isValidTimeZone(timeZone)) {
200
+ dates = _mapInstanceProperty(dates).call(dates, date => utcToZonedTime(this.isValidTimeZone(__prevTimeZone) ? zonedTimeToUtc(date, __prevTimeZone) : date, timeZone));
211
201
  }
202
+
203
+ const inputValue = this.formatValue(dates);
204
+ this.setState({
205
+ value: dates,
206
+ invalid,
207
+ inputValue
208
+ });
212
209
  }
213
210
  }
214
211
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.17.0-beta.0",
3
+ "version": "2.17.1",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
@@ -24,7 +24,7 @@
24
24
  "*.scss",
25
25
  "*.css"
26
26
  ],
27
- "gitHead": "471474bb6fe0a743bc3daba532279969cc9374a5",
27
+ "gitHead": "e2dfadcc7f24b9af6cab08b64ac0ead052219961",
28
28
  "devDependencies": {
29
29
  "@babel/plugin-proposal-decorators": "^7.15.8",
30
30
  "@babel/plugin-transform-runtime": "^7.15.8",
@@ -393,8 +393,8 @@ class TableFoundation<RecordType> extends BaseFoundation<TableAdapter<RecordType
393
393
  dataSource = Array.from(filteredData && filteredData.values());
394
394
  filteredData = new Map();
395
395
  }
396
- each(currentFilteredValue, value => {
397
- each(dataSource, record => {
396
+ each(dataSource, record => {
397
+ each(currentFilteredValue, value => {
398
398
  const childrenRecords = get(record, childrenRecordName);
399
399
  const recordKey = this.getRecordKey(record);
400
400
 
@@ -203,27 +203,26 @@ class TimePickerFoundation<P = Record<string, any>, S = Record<string, any>> ext
203
203
 
204
204
  refreshProps(props: any = {}) {
205
205
  const { value, timeZone, __prevTimeZone } = props;
206
- if (!isNullOrUndefined(value)) {
207
- let dates = this.parseValue(value);
208
- const invalid = this.validateDates(dates);
209
-
210
- if (!invalid) {
211
- if (this.isValidTimeZone(timeZone)) {
212
- dates = dates.map(date =>
213
- utcToZonedTime(
214
- this.isValidTimeZone(__prevTimeZone) ? zonedTimeToUtc(date, __prevTimeZone) : date,
215
- timeZone
216
- )
217
- );
218
- }
219
- const inputValue = this.formatValue(dates);
206
+
207
+ let dates = this.parseValue(value);
208
+ const invalid = this.validateDates(dates);
220
209
 
221
- this.setState({
222
- value: dates,
223
- invalid,
224
- inputValue,
225
- } as any);
210
+ if (!invalid) {
211
+ if (this.isValidTimeZone(timeZone)) {
212
+ dates = dates.map(date =>
213
+ utcToZonedTime(
214
+ this.isValidTimeZone(__prevTimeZone) ? zonedTimeToUtc(date, __prevTimeZone) : date,
215
+ timeZone
216
+ )
217
+ );
226
218
  }
219
+ const inputValue = this.formatValue(dates);
220
+
221
+ this.setState({
222
+ value: dates,
223
+ invalid,
224
+ inputValue,
225
+ } as any);
227
226
  }
228
227
  }
229
228