@douyinfe/semi-ui 2.34.1 → 2.34.2
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.
- package/dist/css/semi.css +3 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +10 -46
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/datePicker/datePicker.js +1 -2
- package/lib/es/datePicker/datePicker.js +1 -2
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -53471,41 +53471,6 @@ class DatePickerFoundation extends foundation {
|
|
|
53471
53471
|
this._adapter.notifyOpenChange(true);
|
|
53472
53472
|
}
|
|
53473
53473
|
}
|
|
53474
|
-
/**
|
|
53475
|
-
* @deprecated
|
|
53476
|
-
* do these side effects when type is dateRange or dateTimeRange
|
|
53477
|
-
* 1. trigger input blur, if input value is invalid, set input value and state value to previous status
|
|
53478
|
-
* 2. set cachedSelectedValue using given dates(in needConfirm mode)
|
|
53479
|
-
* - directly closePanel without click confirm will set cachedSelectedValue to state value
|
|
53480
|
-
* - select one date(which means that the selection value is incomplete) and click confirm also set cachedSelectedValue to state value
|
|
53481
|
-
*/
|
|
53482
|
-
// rangeTypeSideEffectsWhenClosePanel(inputValue: string, willUpdateDates: Date[]) {
|
|
53483
|
-
// if (this._isRangeType()) {
|
|
53484
|
-
// this._adapter.setRangeInputFocus(false);
|
|
53485
|
-
// /**
|
|
53486
|
-
// * inputValue is string when it is not disabled or can't parsed
|
|
53487
|
-
// * when inputValue is null, picker value will back to last selected value
|
|
53488
|
-
// */
|
|
53489
|
-
// this.handleInputBlur(inputValue);
|
|
53490
|
-
// this.resetCachedSelectedValue(willUpdateDates);
|
|
53491
|
-
// }
|
|
53492
|
-
// }
|
|
53493
|
-
|
|
53494
|
-
/**
|
|
53495
|
-
* @deprecated
|
|
53496
|
-
* clear input value when selected date is not confirmed
|
|
53497
|
-
*/
|
|
53498
|
-
// needConfirmSideEffectsWhenClosePanel(willUpdateDates: Date[] | null | undefined) {
|
|
53499
|
-
// if (this._adapter.needConfirm() && !this._isRangeType()) {
|
|
53500
|
-
// /**
|
|
53501
|
-
// * if `null` input element will show `cachedSelectedValue` formatted value(format in DateInput render)
|
|
53502
|
-
// * if `` input element will show `` directly
|
|
53503
|
-
// */
|
|
53504
|
-
// this._adapter.updateInputValue(null);
|
|
53505
|
-
// this.resetCachedSelectedValue(willUpdateDates);
|
|
53506
|
-
// }
|
|
53507
|
-
// }
|
|
53508
|
-
|
|
53509
53474
|
/**
|
|
53510
53475
|
* clear inset input value when close panel
|
|
53511
53476
|
*/
|
|
@@ -54531,40 +54496,40 @@ class DatePickerFoundation extends foundation {
|
|
|
54531
54496
|
}
|
|
54532
54497
|
/**
|
|
54533
54498
|
* Get the date changed through the date panel or enter
|
|
54534
|
-
* @param {Date[]} dates
|
|
54535
|
-
* @returns {Date[]}
|
|
54536
54499
|
*/
|
|
54537
54500
|
|
|
54538
54501
|
|
|
54539
54502
|
_getChangedDates(dates) {
|
|
54540
54503
|
const type = this._adapter.getProp('type');
|
|
54541
54504
|
|
|
54542
|
-
const
|
|
54505
|
+
const {
|
|
54506
|
+
cachedSelectedValue: lastDate
|
|
54507
|
+
} = this._adapter.getStates();
|
|
54543
54508
|
|
|
54544
54509
|
const changedDates = [];
|
|
54545
54510
|
|
|
54546
54511
|
switch (type) {
|
|
54547
54512
|
case 'dateRange':
|
|
54548
54513
|
case 'dateTimeRange':
|
|
54549
|
-
const [
|
|
54514
|
+
const [lastStart, lastEnd] = lastDate;
|
|
54550
54515
|
const [start, end] = dates;
|
|
54551
54516
|
|
|
54552
|
-
if (!isEqual_isEqual(start,
|
|
54517
|
+
if (!isEqual_isEqual(start, lastStart)) {
|
|
54553
54518
|
changedDates.push(start);
|
|
54554
54519
|
}
|
|
54555
54520
|
|
|
54556
|
-
if (!isEqual_isEqual(end,
|
|
54521
|
+
if (!isEqual_isEqual(end, lastEnd)) {
|
|
54557
54522
|
changedDates.push(end);
|
|
54558
54523
|
}
|
|
54559
54524
|
|
|
54560
54525
|
break;
|
|
54561
54526
|
|
|
54562
54527
|
default:
|
|
54563
|
-
const
|
|
54564
|
-
|
|
54528
|
+
const lastValueSet = new Set();
|
|
54529
|
+
lastDate.forEach(value => lastValueSet.add(isDate(value) && value.valueOf()));
|
|
54565
54530
|
|
|
54566
54531
|
for (const date of dates) {
|
|
54567
|
-
if (!
|
|
54532
|
+
if (!lastValueSet.has(isDate(date) && date.valueOf())) {
|
|
54568
54533
|
changedDates.push(date);
|
|
54569
54534
|
}
|
|
54570
54535
|
}
|
|
@@ -64173,14 +64138,13 @@ class DatePicker extends BaseComponent {
|
|
|
64173
64138
|
isRange: false,
|
|
64174
64139
|
inputValue: null,
|
|
64175
64140
|
value: [],
|
|
64176
|
-
cachedSelectedValue:
|
|
64141
|
+
cachedSelectedValue: [],
|
|
64177
64142
|
prevTimeZone: null,
|
|
64178
64143
|
rangeInputFocus: undefined,
|
|
64179
64144
|
autofocus: props.autoFocus || this.isRangeType(props.type, props.triggerRender) && (props.open || props.defaultOpen),
|
|
64180
64145
|
insetInputValue: null,
|
|
64181
64146
|
triggerDisabled: undefined
|
|
64182
64147
|
};
|
|
64183
|
-
this.adapter.setCache('cachedSelectedValue', null);
|
|
64184
64148
|
this.triggerElRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
64185
64149
|
this.panelRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
64186
64150
|
this.monthGrid = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|