@douyinfe/semi-foundation 2.17.0-beta.1 → 2.17.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.
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -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.1",
3
+ "version": "2.17.0",
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": "f2829772791684497142f4bf6839063b9ef4427f",
27
+ "gitHead": "802e57ecc50de44c7ad4b2322bdd864eb9727cc3",
28
28
  "devDependencies": {
29
29
  "@babel/plugin-proposal-decorators": "^7.15.8",
30
30
  "@babel/plugin-transform-runtime": "^7.15.8",
@@ -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