@fibrae/semi-foundation 0.1.1 → 0.2.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.
- package/dist/anchor/foundation.d.ts +1 -1
- package/dist/anchor/foundation.js +21 -21
- package/dist/audio-player/foundation.d.ts +10 -10
- package/dist/audio-player/foundation.js +19 -19
- package/dist/auto-complete/foundation.d.ts +12 -12
- package/dist/auto-complete/foundation.js +51 -51
- package/dist/avatar/foundation.d.ts +5 -5
- package/dist/avatar/foundation.js +16 -16
- package/dist/backtop/foundation.d.ts +2 -2
- package/dist/backtop/foundation.js +7 -7
- package/dist/banner/foundation.d.ts +1 -1
- package/dist/banner/foundation.js +4 -4
- package/dist/base/auto-close-foundation.d.ts +8 -8
- package/dist/base/auto-close-foundation.js +15 -15
- package/dist/base/foundation.d.ts +4 -3
- package/dist/base/foundation.js +12 -11
- package/dist/breadcrumb/foundation.d.ts +5 -5
- package/dist/breadcrumb/foundation.js +9 -10
- package/dist/breadcrumb/item-foundation.d.ts +3 -3
- package/dist/breadcrumb/item-foundation.js +6 -6
- package/dist/calendar/event-util.js +1 -1
- package/dist/calendar/foundation.js +4 -4
- package/dist/calendar/month-foundation.d.ts +2 -2
- package/dist/calendar/month-foundation.js +6 -6
- package/dist/carousel/foundation.d.ts +17 -17
- package/dist/carousel/foundation.js +51 -51
- package/dist/cascader/foundation.d.ts +34 -26
- package/dist/cascader/foundation.js +143 -121
- package/dist/checkbox/checkbox-foundation.d.ts +2 -2
- package/dist/checkbox/checkbox-foundation.js +15 -15
- package/dist/checkbox/checkbox-group-foundation.d.ts +2 -2
- package/dist/checkbox/checkbox-group-foundation.js +8 -8
- package/dist/code-highlight/index.d.ts +1 -1
- package/dist/code-highlight/index.js +3 -3
- package/dist/collapse/foundation.d.ts +2 -2
- package/dist/collapse/foundation.js +7 -7
- package/dist/collapsible/foundation.d.ts +3 -3
- package/dist/collapsible/foundation.js +8 -8
- package/dist/color-picker/alpha-slider-foundation.d.ts +2 -4
- package/dist/color-picker/alpha-slider-foundation.js +10 -10
- package/dist/color-picker/color-choose-area-foundation.d.ts +2 -5
- package/dist/color-picker/color-choose-area-foundation.js +14 -14
- package/dist/color-picker/color-slider-foundation.d.ts +2 -4
- package/dist/color-picker/color-slider-foundation.js +10 -10
- package/dist/color-picker/data-part-foundation.d.ts +5 -5
- package/dist/color-picker/data-part-foundation.js +11 -11
- package/dist/color-picker/foundation.d.ts +4 -4
- package/dist/color-picker/foundation.js +10 -10
- package/dist/config-provider/breakpoint-observer.d.ts +3 -3
- package/dist/config-provider/breakpoint-observer.js +6 -6
- package/dist/cropper/foundation.d.ts +15 -15
- package/dist/cropper/foundation.js +26 -23
- package/dist/date-picker/_utils/picker-type.d.ts +1 -1
- package/dist/date-picker/foundation.d.ts +36 -36
- package/dist/date-picker/foundation.js +125 -129
- package/dist/date-picker/input-foundation.d.ts +9 -9
- package/dist/date-picker/input-foundation.js +28 -28
- package/dist/date-picker/months-grid-foundation.d.ts +16 -16
- package/dist/date-picker/months-grid-foundation.js +64 -65
- package/dist/date-picker/year-and-month-foundation.d.ts +3 -3
- package/dist/date-picker/year-and-month-foundation.js +11 -11
- package/dist/drag-move/foundation.d.ts +2 -2
- package/dist/drag-move/foundation.js +15 -13
- package/dist/dropdown/foundation.d.ts +8 -5
- package/dist/dropdown/foundation.js +32 -28
- package/dist/dropdown/menu-foundation.d.ts +1 -1
- package/dist/dropdown/menu-foundation.js +11 -11
- package/dist/feedback/foundation.d.ts +9 -9
- package/dist/feedback/foundation.js +33 -33
- package/dist/form/form-api-proxy.d.ts +8 -7
- package/dist/form/form-api-proxy.js +25 -25
- package/dist/form/foundation.d.ts +5 -5
- package/dist/form/foundation.js +60 -61
- package/dist/highlight/foundation.js +1 -1
- package/dist/hot-keys/foundation.d.ts +2 -2
- package/dist/hot-keys/foundation.js +5 -5
- package/dist/image/image-foundation.d.ts +4 -4
- package/dist/image/image-foundation.js +10 -10
- package/dist/image/preview-footer-foundation.d.ts +3 -3
- package/dist/image/preview-footer-foundation.js +10 -10
- package/dist/image/preview-foundation.js +7 -6
- package/dist/image/preview-image-foundation.d.ts +6 -8
- package/dist/image/preview-image-foundation.js +14 -14
- package/dist/image/preview-inner-foundation.d.ts +9 -9
- package/dist/image/preview-inner-foundation.js +38 -38
- package/dist/input/foundation.d.ts +10 -10
- package/dist/input/foundation.js +47 -49
- package/dist/input/text-entry-foundation.d.ts +3 -3
- package/dist/input/text-entry-foundation.js +14 -14
- package/dist/input/textarea-foundation.d.ts +7 -7
- package/dist/input/textarea-foundation.js +36 -36
- package/dist/input-number/foundation.d.ts +16 -14
- package/dist/input-number/foundation.js +54 -53
- package/dist/json-viewer/foundation.d.ts +8 -8
- package/dist/json-viewer/foundation.js +23 -23
- package/dist/lottie/foundation.d.ts +1 -1
- package/dist/lottie/foundation.js +4 -4
- package/dist/markdown-render/foundation.d.ts +1 -1
- package/dist/markdown-render/foundation.js +4 -4
- package/dist/modal/modal-content-foundation.d.ts +7 -7
- package/dist/modal/modal-content-foundation.js +20 -20
- package/dist/modal/modal-foundation.d.ts +6 -6
- package/dist/modal/modal-foundation.js +24 -24
- package/dist/navigation/foundation.d.ts +1 -1
- package/dist/navigation/foundation.js +14 -14
- package/dist/navigation/item-foundation.d.ts +1 -1
- package/dist/navigation/item-foundation.js +8 -8
- package/dist/navigation/sub-nav-foundation.d.ts +3 -3
- package/dist/navigation/sub-nav-foundation.js +17 -17
- package/dist/notification/notification-list-foundation.d.ts +7 -7
- package/dist/notification/notification-list-foundation.js +12 -12
- package/dist/overflow-list/foundation.d.ts +4 -4
- package/dist/overflow-list/foundation.js +18 -18
- package/dist/pagination/foundation.d.ts +8 -8
- package/dist/pagination/foundation.js +28 -28
- package/dist/pincode/foundation.d.ts +5 -5
- package/dist/pincode/foundation.js +22 -22
- package/dist/popconfirm/popconfirm-foundation.d.ts +7 -7
- package/dist/popconfirm/popconfirm-foundation.js +26 -26
- package/dist/radio/radio-foundation.d.ts +5 -5
- package/dist/radio/radio-foundation.js +15 -15
- package/dist/radio/radio-group-foundation.d.ts +2 -2
- package/dist/radio/radio-group-foundation.js +9 -9
- package/dist/rating/foundation.d.ts +10 -10
- package/dist/rating/foundation.js +35 -35
- package/dist/resizable/group/index.d.ts +6 -6
- package/dist/resizable/group/index.js +40 -40
- package/dist/resizable/single/index.d.ts +2 -2
- package/dist/resizable/single/index.js +9 -9
- package/dist/scroll-list/item-foundation.d.ts +7 -7
- package/dist/scroll-list/item-foundation.js +35 -35
- package/dist/select/foundation.d.ts +42 -56
- package/dist/select/foundation.js +214 -279
- package/dist/select/option-foundation.d.ts +23 -27
- package/dist/select/option-foundation.js +10 -18
- package/dist/side-sheet/side-sheet-foundation.d.ts +6 -6
- package/dist/side-sheet/side-sheet-foundation.js +22 -22
- package/dist/slider/foundation.d.ts +16 -16
- package/dist/slider/foundation.js +46 -46
- package/dist/sortable/accessibility.d.ts +1 -1
- package/dist/sortable/accessibility.js +2 -2
- package/dist/spin/foundation.d.ts +2 -2
- package/dist/spin/foundation.js +6 -6
- package/dist/steps/utils.d.ts +1 -1
- package/dist/switch/foundation.d.ts +2 -2
- package/dist/switch/foundation.js +7 -7
- package/dist/table/foundation.d.ts +14 -14
- package/dist/table/foundation.js +93 -93
- package/dist/table/utils.d.ts +2 -2
- package/dist/tabs/foundation.d.ts +5 -5
- package/dist/tabs/foundation.js +17 -17
- package/dist/tag-input/foundation.d.ts +11 -11
- package/dist/tag-input/foundation.js +52 -52
- package/dist/time-picker/foundation.d.ts +13 -13
- package/dist/time-picker/foundation.js +39 -39
- package/dist/time-picker/input-foundation.d.ts +4 -4
- package/dist/time-picker/input-foundation.js +13 -13
- package/dist/toast/toast-list-foundation.d.ts +7 -7
- package/dist/toast/toast-list-foundation.js +14 -14
- package/dist/tooltip/foundation.d.ts +9 -9
- package/dist/tooltip/foundation.js +67 -61
- package/dist/transfer/foundation.d.ts +22 -9
- package/dist/transfer/foundation.js +38 -23
- package/dist/tree/foundation.d.ts +14 -14
- package/dist/tree/foundation.js +61 -61
- package/dist/tree/shared.d.ts +1 -1
- package/dist/tree-select/foundation.d.ts +26 -20
- package/dist/tree-select/foundation.js +91 -83
- package/dist/typography/ellipsis.d.ts +4 -4
- package/dist/typography/ellipsis.js +8 -8
- package/dist/typography/format-numeral.d.ts +1 -1
- package/dist/typography/format-numeral.js +2 -2
- package/dist/upload/constants.d.ts +1 -1
- package/dist/upload/foundation.d.ts +17 -17
- package/dist/upload/foundation.js +92 -92
- package/dist/upload/utils.d.ts +3 -3
- package/dist/upload/utils.js +6 -6
- package/dist/user-guide/foundation.d.ts +3 -3
- package/dist/user-guide/foundation.js +19 -19
- package/dist/utils/a11y.d.ts +1 -1
- package/dist/utils/announcer.d.ts +2 -2
- package/dist/utils/announcer.js +4 -4
- package/dist/utils/focus-handle.d.ts +1 -1
- package/dist/utils/focus-handle.js +1 -2
- package/dist/utils/focus-scope.d.ts +5 -5
- package/dist/utils/focus-scope.js +10 -10
- package/dist/utils/is-promise.d.ts +1 -1
- package/dist/utils/release-holder.d.ts +2 -2
- package/dist/utils/release-holder.js +4 -4
- package/dist/video-player/foundation.d.ts +15 -15
- package/dist/video-player/foundation.js +89 -89
- package/dist/video-player/progress-foundation.d.ts +2 -2
- package/dist/video-player/progress-foundation.js +12 -12
- package/package.json +2 -2
|
@@ -25,7 +25,7 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
25
25
|
#focusRecordTimers = /* @__PURE__ */ new Set();
|
|
26
26
|
#initialized = false;
|
|
27
27
|
#setRangeInputFocus(rangeInputFocus) {
|
|
28
|
-
this.
|
|
28
|
+
this.adapter.setRangeInputFocus(rangeInputFocus);
|
|
29
29
|
if (rangeInputFocus) this.#recordFocusLater(rangeInputFocus);
|
|
30
30
|
}
|
|
31
31
|
#recordFocusLater(rangeInputFocus) {
|
|
@@ -65,7 +65,7 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
65
65
|
return needConfirm(this.getProps());
|
|
66
66
|
}
|
|
67
67
|
#parseValue(value) {
|
|
68
|
-
const dateFnsLocale = this.
|
|
68
|
+
const dateFnsLocale = this.adapter.getProp("dateFnsLocale");
|
|
69
69
|
let dateObj;
|
|
70
70
|
if (isValidDate(value)) dateObj = value;
|
|
71
71
|
else if (typeof value === "string") dateObj = compatibleParse(value, this.getProp("format"), void 0, dateFnsLocale);
|
|
@@ -84,9 +84,9 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
84
84
|
if (!Array.isArray(value)) _value = value ? [value] : [];
|
|
85
85
|
else _value = value;
|
|
86
86
|
const changedDates = this.#getChangedDates(_value);
|
|
87
|
-
if (!this.
|
|
87
|
+
if (!this.isControlledComponent() && !this.#someDateDisabled(changedDates, _value) && !this.#needConfirm() && this.#isValueCommittable(_value)) this.adapter.updateValue(_value);
|
|
88
88
|
}
|
|
89
|
-
this.
|
|
89
|
+
this.adapter.updateInputValue(input);
|
|
90
90
|
}
|
|
91
91
|
#isValueCommittable(value) {
|
|
92
92
|
return !this.#isRangeType() || isRangeValueComplete(value);
|
|
@@ -94,11 +94,11 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
94
94
|
#notifyChange(value) {
|
|
95
95
|
if (!this.#isValueCommittable(value)) return;
|
|
96
96
|
const { notifyValue, notifyDate } = this.disposeCallbackArgs(value);
|
|
97
|
-
this.
|
|
97
|
+
this.adapter.notifyChange(notifyDate, notifyValue);
|
|
98
98
|
}
|
|
99
99
|
#getChangedDates(dates) {
|
|
100
|
-
const type = this.
|
|
101
|
-
const { cachedSelectedValue: lastDate } = this.
|
|
100
|
+
const type = this.adapter.getProp("type");
|
|
101
|
+
const { cachedSelectedValue: lastDate } = this.adapter.getStates();
|
|
102
102
|
const changedDates = [];
|
|
103
103
|
switch (type) {
|
|
104
104
|
case "dateRange":
|
|
@@ -156,25 +156,25 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
156
156
|
if (this.#shouldFocusRangeStart(result)) this.#setRangeInputFocus("rangeStart");
|
|
157
157
|
}
|
|
158
158
|
#getInitialValue() {
|
|
159
|
-
return this.
|
|
159
|
+
return this.isControlledComponent() ? this.getProp("value") : this.getProp("defaultValue");
|
|
160
160
|
}
|
|
161
161
|
#resolveValue(value, timeZone, prevTimeZone) {
|
|
162
162
|
const _value = (Array.isArray(value) ? [...value] : (value || value === 0) && [value]) || [];
|
|
163
163
|
return this.parseWithTimezone(_value, timeZone, prevTimeZone);
|
|
164
164
|
}
|
|
165
165
|
#initPanelOpenStatus(defaultOpen) {
|
|
166
|
-
this.
|
|
166
|
+
this.adapter.togglePanel(Boolean((this.getProp("open") || defaultOpen) && !this.getProp("disabled")));
|
|
167
167
|
}
|
|
168
168
|
#openPanel() {
|
|
169
169
|
if (!this.getProp("disabled") && !this.#isPanelShown()) {
|
|
170
|
-
if (!this.
|
|
171
|
-
this.
|
|
170
|
+
if (!this.isControlledComponent("open")) this.open();
|
|
171
|
+
this.adapter.notifyOpenChange(true);
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
#resetCachedSelectedValue(willUpdateDates) {
|
|
175
|
-
const { value, cachedSelectedValue } = this.
|
|
175
|
+
const { value, cachedSelectedValue } = this.adapter.getStates();
|
|
176
176
|
const newCachedSelectedValue = Array.isArray(willUpdateDates) ? willUpdateDates : value;
|
|
177
|
-
if (!isEqual(newCachedSelectedValue, cachedSelectedValue)) this.
|
|
177
|
+
if (!isEqual(newCachedSelectedValue, cachedSelectedValue)) this.adapter.updateCachedSelectedValue(newCachedSelectedValue);
|
|
178
178
|
}
|
|
179
179
|
#resetInnerSelectedStates(e) {
|
|
180
180
|
this.#resetCachedSelectedValue();
|
|
@@ -183,11 +183,11 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
183
183
|
}
|
|
184
184
|
#resetFocus(e) {
|
|
185
185
|
this.#setRangeInputFocus(false);
|
|
186
|
-
this.
|
|
186
|
+
this.adapter.notifyBlur(e);
|
|
187
187
|
}
|
|
188
188
|
#clearInputValue() {
|
|
189
|
-
this.
|
|
190
|
-
this.
|
|
189
|
+
this.adapter.updateInputValue(null);
|
|
190
|
+
this.adapter.updateInsetInputValue(null);
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
193
|
* Parses a multiple input part by part with `parse`; an empty or unparsable part, or more than `max` dates,
|
|
@@ -252,10 +252,7 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
252
252
|
const separator = rangeSeparator;
|
|
253
253
|
parsedResult = input.split(separator).map((cur) => cur && compatibleParse(cur, formatToken, nowDate, dateFnsLocale)).filter(Boolean);
|
|
254
254
|
formatedInput = parsedResult && parsedResult.map((v) => v && isValid(v) && this.localeFormat(v, formatToken)).join(separator);
|
|
255
|
-
if (parsedResult && formatedInput === input)
|
|
256
|
-
parsedResult.sort((d1, d2) => d1.getTime() - d2.getTime());
|
|
257
|
-
result = parsedResult;
|
|
258
|
-
}
|
|
255
|
+
if (parsedResult && formatedInput === input) result = parsedResult.toSorted((d1, d2) => d1.getTime() - d2.getTime());
|
|
259
256
|
}
|
|
260
257
|
}
|
|
261
258
|
return result;
|
|
@@ -300,8 +297,7 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
300
297
|
const parsedVal = compatibleParse(cur, formatToken, nowDate, dateFnsLocale);
|
|
301
298
|
return isValidDate(parsedVal) && this.localeFormat(parsedVal, formatToken) === cur ? parsedVal : null;
|
|
302
299
|
});
|
|
303
|
-
|
|
304
|
-
result = parsedResult;
|
|
300
|
+
result = Array.isArray(parsedResult) && parsedResult.every((item) => isValid(item)) ? parsedResult.toSorted((d1, d2) => d1.getTime() - d2.getTime()) : parsedResult;
|
|
305
301
|
}
|
|
306
302
|
}
|
|
307
303
|
return result;
|
|
@@ -356,7 +352,7 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
356
352
|
});
|
|
357
353
|
}
|
|
358
354
|
localeFormat(date, token) {
|
|
359
|
-
const dateFnsLocale = this.
|
|
355
|
+
const dateFnsLocale = this.adapter.getProp("dateFnsLocale");
|
|
360
356
|
return format(date, token, { locale: dateFnsLocale });
|
|
361
357
|
}
|
|
362
358
|
/**
|
|
@@ -426,89 +422,89 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
426
422
|
});
|
|
427
423
|
this.#initPanelOpenStatus(this.getProp("defaultOpen"));
|
|
428
424
|
}
|
|
429
|
-
initFromProps({ value, timeZone, prevTimeZone }) {
|
|
425
|
+
initFromProps = ({ value, timeZone, prevTimeZone }) => {
|
|
430
426
|
const result = this.#resolveValue(value, timeZone, prevTimeZone);
|
|
431
|
-
this.
|
|
427
|
+
this.adapter.updatePrevTimezone(prevTimeZone);
|
|
432
428
|
this.#clearInputValue();
|
|
433
|
-
this.
|
|
429
|
+
this.adapter.updateValue(result);
|
|
434
430
|
this.#resetCachedSelectedValue(result);
|
|
435
431
|
this.#initRangeInputFocus(result);
|
|
436
|
-
if (this.#needConfirm()) this.
|
|
437
|
-
}
|
|
432
|
+
if (this.#needConfirm()) this.adapter.updateCachedSelectedValue(result);
|
|
433
|
+
};
|
|
438
434
|
/** Called for a mousedown outside the trigger and the panel while the panel is shown */
|
|
439
|
-
handleClickOutside(e) {
|
|
440
|
-
this.
|
|
435
|
+
handleClickOutside = (e) => {
|
|
436
|
+
this.adapter.notifyClickOutSide(e);
|
|
441
437
|
if (!this.#needConfirm()) this.closePanel(e);
|
|
442
|
-
}
|
|
438
|
+
};
|
|
443
439
|
/** @param e the mousedown outside that closes the panel, passed on to onBlur */
|
|
444
440
|
closePanel(e) {
|
|
445
|
-
if (this.
|
|
446
|
-
if (typeof this.getProp("triggerRender") === "function") this.
|
|
447
|
-
else if (this.getProp("insetInput")) this.
|
|
441
|
+
if (this.adapter.isKeyboardFocusInPanel()) {
|
|
442
|
+
if (typeof this.getProp("triggerRender") === "function") this.adapter.setTriggerFocus();
|
|
443
|
+
else if (this.getProp("insetInput")) this.adapter.setTriggerDisabled(false, () => this.adapter.setTriggerFocus());
|
|
448
444
|
else this.focus(this.getState("rangeInputFocus") || void 0);
|
|
449
445
|
}
|
|
450
|
-
if (!this.
|
|
446
|
+
if (!this.isControlledComponent("open")) this.close(e);
|
|
451
447
|
else this.#resetInnerSelectedStates(e);
|
|
452
|
-
this.
|
|
448
|
+
this.adapter.notifyOpenChange(false);
|
|
453
449
|
}
|
|
454
|
-
open() {
|
|
450
|
+
open = () => {
|
|
455
451
|
this.#restartFocusRecords();
|
|
456
|
-
this.
|
|
457
|
-
}
|
|
452
|
+
this.adapter.togglePanel(true);
|
|
453
|
+
};
|
|
458
454
|
/** The controlled `open` turned true: starts what an uncontrolled open would */
|
|
459
|
-
handleControlledOpen() {
|
|
455
|
+
handleControlledOpen = () => {
|
|
460
456
|
this.#restartFocusRecords();
|
|
461
|
-
}
|
|
462
|
-
handleEscKeyDown() {
|
|
457
|
+
};
|
|
458
|
+
handleEscKeyDown = () => {
|
|
463
459
|
if (this.#needConfirm()) this.handleCancel();
|
|
464
460
|
else this.closePanel();
|
|
465
|
-
}
|
|
466
|
-
close(e) {
|
|
467
|
-
this.
|
|
461
|
+
};
|
|
462
|
+
close = (e) => {
|
|
463
|
+
this.adapter.togglePanel(false);
|
|
468
464
|
this.#clearFocusRecords();
|
|
469
465
|
this.#resetInnerSelectedStates(e);
|
|
470
|
-
}
|
|
466
|
+
};
|
|
471
467
|
/** Closes the panel without a blur or a returned focus, as when a Vue KeepAlive deactivates the host */
|
|
472
|
-
deactivate() {
|
|
473
|
-
if (!this.
|
|
474
|
-
this.
|
|
468
|
+
deactivate = () => {
|
|
469
|
+
if (!this.isControlledComponent("open")) {
|
|
470
|
+
this.adapter.togglePanel(false);
|
|
475
471
|
this.#clearFocusRecords();
|
|
476
472
|
}
|
|
477
473
|
this.#resetCachedSelectedValue();
|
|
478
474
|
this.#setRangeInputFocus(false);
|
|
479
475
|
this.#clearInputValue();
|
|
480
|
-
this.
|
|
481
|
-
}
|
|
476
|
+
this.adapter.notifyOpenChange(false);
|
|
477
|
+
};
|
|
482
478
|
destroy() {
|
|
483
479
|
this.#cancelFocusRecords();
|
|
484
480
|
}
|
|
485
|
-
focus(focusType) {
|
|
486
|
-
if (typeof this.getProp("triggerRender") === "function") this.
|
|
481
|
+
focus = (focusType) => {
|
|
482
|
+
if (typeof this.getProp("triggerRender") === "function") this.adapter.setTriggerFocus();
|
|
487
483
|
else if (this.#hasTwoInputs()) this.#setRangeInputFocus(focusType ?? "rangeStart");
|
|
488
|
-
else if (this.getProp("insetInput") && this.#isPanelShown()) this.
|
|
489
|
-
else this.
|
|
490
|
-
}
|
|
491
|
-
blur() {
|
|
492
|
-
this.
|
|
484
|
+
else if (this.getProp("insetInput") && this.#isPanelShown()) this.adapter.setInsetInputFocus();
|
|
485
|
+
else this.adapter.setInputFocus();
|
|
486
|
+
};
|
|
487
|
+
blur = () => {
|
|
488
|
+
this.adapter.blurFocusedElement();
|
|
493
489
|
if (this.#isRangeType()) this.#setRangeInputFocus(false);
|
|
494
|
-
}
|
|
490
|
+
};
|
|
495
491
|
/** The controlled `open` turned false: clears what an uncontrolled close would */
|
|
496
|
-
handleControlledClose() {
|
|
492
|
+
handleControlledClose = () => {
|
|
497
493
|
this.#clearFocusRecords();
|
|
498
|
-
const { type } = this.
|
|
499
|
-
const { rangeInputFocus } = this.
|
|
494
|
+
const { type } = this.adapter.getProps();
|
|
495
|
+
const { rangeInputFocus } = this.adapter.getStates();
|
|
500
496
|
if (type === "dateTimeRange" && rangeInputFocus) this.#setRangeInputFocus(false);
|
|
501
|
-
}
|
|
497
|
+
};
|
|
502
498
|
/** Whether the range input other than `currentRangeInput` has been focused since the panel opened */
|
|
503
|
-
hasOtherRangeInputBeenFocused(currentRangeInput) {
|
|
499
|
+
hasOtherRangeInputBeenFocused = (currentRangeInput) => {
|
|
504
500
|
return this.getState("focusRecords")[currentRangeInput === "rangeStart" ? "rangeEnd" : "rangeStart"];
|
|
505
|
-
}
|
|
506
|
-
handleInputChange(input, e) {
|
|
501
|
+
};
|
|
502
|
+
handleInputChange = (input, e) => {
|
|
507
503
|
const result = this.#isMultiple() ? this.#parseMultipleInput(input, (part) => this.parseInput(part)) : this.parseInput(input);
|
|
508
504
|
const { value: stateValue } = this.getStates();
|
|
509
505
|
this.#updateCachedSelectedValueFromInput(input);
|
|
510
506
|
if (result && result.length || input === "") {
|
|
511
|
-
if (e
|
|
507
|
+
if (typeof e === "object" && e !== null && strings$1.CLEARBTN_CLICKED_EVENT_FLAG in e && e[strings$1.CLEARBTN_CLICKED_EVENT_FLAG] && this.isControlledComponent("value")) {
|
|
512
508
|
this.#notifyChange(result);
|
|
513
509
|
return;
|
|
514
510
|
}
|
|
@@ -517,12 +513,12 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
517
513
|
if (!this.#someDateDisabled(changedDates, result)) {
|
|
518
514
|
if (!isEqual(result, stateValue)) this.#notifyChange(result);
|
|
519
515
|
}
|
|
520
|
-
} else this.
|
|
521
|
-
}
|
|
516
|
+
} else this.adapter.updateInputValue(input);
|
|
517
|
+
};
|
|
522
518
|
/**
|
|
523
519
|
* Always updates insetInputValue; inputValue and value are updated only when the text parses to a valid date.
|
|
524
520
|
*/
|
|
525
|
-
handleInsetInputChange({ insetInputStr, format, insetInputValue }) {
|
|
521
|
+
handleInsetInputChange = ({ insetInputStr, format, insetInputValue }) => {
|
|
526
522
|
const _isMultiple = this.#isMultiple();
|
|
527
523
|
const result = _isMultiple ? this.#parseMultipleInput(insetInputStr, (part) => this.parseInput(part, format)) : this.parseInput(insetInputStr, format);
|
|
528
524
|
const { value: stateValue } = this.getStates();
|
|
@@ -531,43 +527,43 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
531
527
|
const changedDates = this.#getChangedDates(result);
|
|
532
528
|
if (!this.#someDateDisabled(changedDates, result)) {
|
|
533
529
|
if (!isEqual(result, stateValue)) {
|
|
534
|
-
if (!this.
|
|
530
|
+
if (!this.isControlledComponent() && !this.#needConfirm() && this.#isValueCommittable(result)) this.adapter.updateValue(result);
|
|
535
531
|
this.#notifyChange(result);
|
|
536
532
|
}
|
|
537
533
|
const triggerInput = _isMultiple ? this.formatMultipleDates(result) : this.formatDates(result);
|
|
538
|
-
this.
|
|
534
|
+
this.adapter.updateInputValue(triggerInput);
|
|
539
535
|
}
|
|
540
536
|
}
|
|
541
|
-
this.
|
|
542
|
-
}
|
|
543
|
-
handleRangeEndTabPress() {
|
|
537
|
+
this.adapter.updateInsetInputValue(insetInputValue);
|
|
538
|
+
};
|
|
539
|
+
handleRangeEndTabPress = () => {
|
|
544
540
|
this.#setRangeInputFocus(false);
|
|
545
|
-
}
|
|
546
|
-
handleInputFocus(e, range) {
|
|
541
|
+
};
|
|
542
|
+
handleInputFocus = (e, range) => {
|
|
547
543
|
if (range && !this.#isRangeType()) return;
|
|
548
|
-
const rangeInputFocus = this.
|
|
544
|
+
const rangeInputFocus = this.adapter.getState("rangeInputFocus");
|
|
549
545
|
if (range) this.#setRangeInputFocus(range);
|
|
550
|
-
if (!range || !rangeInputFocus) this.
|
|
551
|
-
}
|
|
552
|
-
handleSetRangeFocus(rangeInputFocus) {
|
|
546
|
+
if (!range || !rangeInputFocus) this.adapter.notifyFocus(e, range);
|
|
547
|
+
};
|
|
548
|
+
handleSetRangeFocus = (rangeInputFocus) => {
|
|
553
549
|
this.#setRangeInputFocus(rangeInputFocus);
|
|
554
|
-
}
|
|
555
|
-
handleInputClear(e) {
|
|
556
|
-
this.
|
|
557
|
-
}
|
|
558
|
-
handleRangeInputClear(e) {
|
|
550
|
+
};
|
|
551
|
+
handleInputClear = (e) => {
|
|
552
|
+
this.adapter.notifyClear(e);
|
|
553
|
+
};
|
|
554
|
+
handleRangeInputClear = (e) => {
|
|
559
555
|
const value = [];
|
|
560
556
|
const inputValue = "";
|
|
561
|
-
if (!this.
|
|
557
|
+
if (!this.isControlledComponent("value")) {
|
|
562
558
|
this.#updateValueAndInput(value, true, inputValue);
|
|
563
|
-
this.
|
|
559
|
+
this.adapter.updateInsetInputValue(null);
|
|
564
560
|
this.#resetCachedSelectedValue(value);
|
|
565
561
|
}
|
|
566
562
|
this.#notifyChange(value);
|
|
567
563
|
this.#setRangeInputFocus(false);
|
|
568
|
-
this.
|
|
569
|
-
}
|
|
570
|
-
handleInputComplete(input = "") {
|
|
564
|
+
this.adapter.notifyClear(e);
|
|
565
|
+
};
|
|
566
|
+
handleInputComplete = (input = "") => {
|
|
571
567
|
let parsedResult = input ? this.#isMultiple() ? this.#parseMultipleInput(input, (part) => this.parseInput(part), { needDedupe: true }) : this.parseInput(input) : [];
|
|
572
568
|
parsedResult = parsedResult && parsedResult.length ? parsedResult : this.getState("value");
|
|
573
569
|
if (!(this.#isRangeType() ? input.split(this.getProp("rangeSeparator")).every((part) => !part.trim()) : !input.trim()) && !parsedResult?.length) return;
|
|
@@ -585,15 +581,15 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
585
581
|
this.#updateValueAndInput(parsedResult);
|
|
586
582
|
const changedDates = this.#getChangedDates(parsedResult);
|
|
587
583
|
if (!this.#someDateDisabled(changedDates, parsedResult) && !isEqual(parsedResult, stateValue)) this.#notifyChange(parsedResult);
|
|
588
|
-
}
|
|
584
|
+
};
|
|
589
585
|
/**
|
|
590
586
|
* @param options `rangeInputFocus` is the range input the dates were picked for, when the panel has moved
|
|
591
587
|
* the focus on before telling about the change
|
|
592
588
|
*/
|
|
593
|
-
handleSelectedChange(value, options) {
|
|
594
|
-
const { type, format, rangeSeparator, insetInput } = this.
|
|
589
|
+
handleSelectedChange = (value, options) => {
|
|
590
|
+
const { type, format, rangeSeparator, insetInput } = this.adapter.getProps();
|
|
595
591
|
const { value: stateValue } = this.getStates();
|
|
596
|
-
const controlled = this.
|
|
592
|
+
const controlled = this.isControlledComponent();
|
|
597
593
|
const closePanel = options?.closePanel ?? true;
|
|
598
594
|
const needCheckFocusRecord = options?.needCheckFocusRecord ?? true;
|
|
599
595
|
const dates = Array.isArray(value) ? [...value] : value ? [value] : [];
|
|
@@ -615,20 +611,20 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
615
611
|
});
|
|
616
612
|
}
|
|
617
613
|
if (this.#isRangeType() && !isRangeValueComplete(dates)) {
|
|
618
|
-
this.
|
|
619
|
-
this.
|
|
614
|
+
this.adapter.updateInputValue(inputValue);
|
|
615
|
+
this.adapter.updateInsetInputValue(insetInputValue);
|
|
620
616
|
return;
|
|
621
617
|
} else if (!controlled) {
|
|
622
618
|
this.#updateValueAndInput(dates, true, inputValue);
|
|
623
|
-
this.
|
|
619
|
+
this.adapter.updateInsetInputValue(insetInputValue);
|
|
624
620
|
}
|
|
625
621
|
if (!isEqual(value, stateValue)) this.#notifyChange(value);
|
|
626
622
|
}
|
|
627
623
|
const { rangeStart, rangeEnd } = this.getState("focusRecords");
|
|
628
624
|
const focusRecordChecked = !needCheckFocusRecord || rangeStart && rangeEnd;
|
|
629
625
|
if (type === "date" && !this.#isMultiple() && closePanel || type === "dateRange" && isRangeValueComplete(dates) && closePanel && focusRecordChecked) this.closePanel();
|
|
630
|
-
}
|
|
631
|
-
handleYMSelectedChange({ currentMonth, currentYear } = {}) {
|
|
626
|
+
};
|
|
627
|
+
handleYMSelectedChange = ({ currentMonth, currentYear } = {}) => {
|
|
632
628
|
const { type } = this.getProps();
|
|
633
629
|
if (type === "year") this.handleSelectedChange([new Date(currentYear["left"], 0)]);
|
|
634
630
|
else if (type === "month") {
|
|
@@ -639,25 +635,25 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
639
635
|
const dateRight = new Date(currentYear["right"], currentMonth["right"] - 1);
|
|
640
636
|
this.handleSelectedChange([dateLeft, dateRight]);
|
|
641
637
|
}
|
|
642
|
-
}
|
|
643
|
-
handleConfirm() {
|
|
644
|
-
const { cachedSelectedValue, value } = this.
|
|
638
|
+
};
|
|
639
|
+
handleConfirm = () => {
|
|
640
|
+
const { cachedSelectedValue, value } = this.adapter.getStates();
|
|
645
641
|
const isComplete = this.#isRangeType() ? isRangeValueComplete(cachedSelectedValue) : !cachedSelectedValue.some((date) => date == null);
|
|
646
642
|
const newValue = isComplete ? cachedSelectedValue : value;
|
|
647
|
-
if (this.#needConfirm() && !this.
|
|
643
|
+
if (this.#needConfirm() && !this.isControlledComponent()) this.adapter.updateValue(newValue);
|
|
648
644
|
this.closePanel();
|
|
649
645
|
if (isComplete) {
|
|
650
646
|
const { notifyValue, notifyDate } = this.disposeCallbackArgs(cachedSelectedValue);
|
|
651
|
-
this.
|
|
647
|
+
this.adapter.notifyConfirm(notifyDate, notifyValue);
|
|
652
648
|
}
|
|
653
|
-
}
|
|
654
|
-
handleCancel() {
|
|
649
|
+
};
|
|
650
|
+
handleCancel = () => {
|
|
655
651
|
this.closePanel();
|
|
656
652
|
const value = this.getState("value");
|
|
657
653
|
const { notifyValue, notifyDate } = this.disposeCallbackArgs(value);
|
|
658
|
-
this.
|
|
659
|
-
}
|
|
660
|
-
handlePresetClick(item, e) {
|
|
654
|
+
this.adapter.notifyCancel(notifyDate, notifyValue);
|
|
655
|
+
};
|
|
656
|
+
handlePresetClick = (item, e) => {
|
|
661
657
|
const { type, timeZone } = this.getProps();
|
|
662
658
|
const start = typeof item.start === "function" ? item.start() : item.start;
|
|
663
659
|
const end = typeof item.end === "function" ? item.end() : item.end;
|
|
@@ -681,25 +677,25 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
681
677
|
value = this.parseWithTimezone([start, end], timeZone);
|
|
682
678
|
this.handleSelectedChange(value, { needCheckFocusRecord: false });
|
|
683
679
|
}
|
|
684
|
-
this.
|
|
685
|
-
}
|
|
686
|
-
disabledDisposeDate(date, ...rest) {
|
|
680
|
+
this.adapter.notifyPresetsClick(item, e);
|
|
681
|
+
};
|
|
682
|
+
disabledDisposeDate = (date, ...rest) => {
|
|
687
683
|
return DatePickerFoundation.disposeDateFn(this.getProp("timeZone"), this.getProp("disabledDate"), date, ...rest);
|
|
688
|
-
}
|
|
689
|
-
disabledDisposeTime(date, ...rest) {
|
|
684
|
+
};
|
|
685
|
+
disabledDisposeTime = (date, ...rest) => {
|
|
690
686
|
return DatePickerFoundation.disposeDateFn(this.getProp("timeZone"), this.getProp("disabledTime"), date, ...rest);
|
|
691
|
-
}
|
|
687
|
+
};
|
|
692
688
|
/**
|
|
693
689
|
* Opens the panel on trigger click and, for range types, focuses rangeStart when no range input is focused.
|
|
694
690
|
* Non-range triggers are native inputs that already handle focus. isEventTarget tells a click on the input
|
|
695
691
|
* wrapper itself from one bubbled up from a child, which already handled focus.
|
|
696
692
|
*/
|
|
697
693
|
handleTriggerWrapperClick(e) {
|
|
698
|
-
const { disabled, triggerRender } = this.
|
|
699
|
-
const { rangeInputFocus } = this.
|
|
694
|
+
const { disabled, triggerRender } = this.adapter.getProps();
|
|
695
|
+
const { rangeInputFocus } = this.adapter.getStates();
|
|
700
696
|
if (disabled) return;
|
|
701
697
|
if (this.#isRangeType() && !rangeInputFocus) {
|
|
702
|
-
if (this.
|
|
698
|
+
if (this.adapter.isEventTarget(e)) this.handleInputFocus(e, "rangeStart");
|
|
703
699
|
else if (typeof triggerRender === "function") this.#setRangeInputFocus("rangeStart");
|
|
704
700
|
this.#openPanel();
|
|
705
701
|
} else this.#openPanel();
|
|
@@ -711,26 +707,26 @@ var DatePickerFoundation = class DatePickerFoundation extends BaseFoundation {
|
|
|
711
707
|
* control that must not open it stops propagation itself). Keys reach handleTriggerWrapperClick through
|
|
712
708
|
* handleTriggerKeyDown instead, so the check stays out of it.
|
|
713
709
|
*/
|
|
714
|
-
handleTriggerClick(e, isCustomTrigger) {
|
|
710
|
+
handleTriggerClick = (e, isCustomTrigger) => {
|
|
715
711
|
if (isCustomTrigger || !isInnerControlActivation(e)) this.handleTriggerWrapperClick(e);
|
|
716
|
-
}
|
|
712
|
+
};
|
|
717
713
|
/**
|
|
718
714
|
* APG combobox: Down Arrow on the closed trigger opens the panel (once it is open, the Popover moves focus into
|
|
719
715
|
* it). A custom trigger that is itself the Tab stop is a button, so Enter and Space open it too.
|
|
720
716
|
*/
|
|
721
|
-
handleTriggerKeyDown(e, isTriggerButton) {
|
|
722
|
-
const open = this.
|
|
717
|
+
handleTriggerKeyDown = (e, isTriggerButton) => {
|
|
718
|
+
const open = this.isControlledComponent("open") ? this.getProp("open") : this.getState("panelShow");
|
|
723
719
|
const opens = e.key === "ArrowDown" || isTriggerButton && (e.key === "Enter" || e.key === " ");
|
|
724
720
|
if (!open && opens) {
|
|
725
721
|
e.preventDefault();
|
|
726
722
|
this.handleTriggerWrapperClick(e);
|
|
727
723
|
}
|
|
728
|
-
}
|
|
729
|
-
handlePanelVisibleChange(visible) {
|
|
724
|
+
};
|
|
725
|
+
handlePanelVisibleChange = (visible) => {
|
|
730
726
|
if (visible) {
|
|
731
|
-
if (this.getProp("insetInput")) this.
|
|
732
|
-
this.
|
|
733
|
-
} else this.
|
|
734
|
-
}
|
|
727
|
+
if (this.getProp("insetInput")) this.adapter.setInsetInputFocus();
|
|
728
|
+
this.adapter.setTriggerDisabled(true);
|
|
729
|
+
} else this.adapter.setTriggerDisabled(false);
|
|
730
|
+
};
|
|
735
731
|
};
|
|
736
732
|
export { DatePickerFoundation as default };
|
|
@@ -130,15 +130,15 @@ export default class InputFoundation extends BaseFoundation<DateInputAdapter, Da
|
|
|
130
130
|
static concatInsetInputValue(props: InputProps, { insetInputValue }: {
|
|
131
131
|
insetInputValue: InsetInputValue;
|
|
132
132
|
}): string;
|
|
133
|
-
handleChange(value: string, e: unknown)
|
|
134
|
-
handleInputComplete(e:
|
|
135
|
-
handleInputClear(e: unknown)
|
|
133
|
+
handleChange: (value: string, e: unknown) => void;
|
|
134
|
+
handleInputComplete: (e: Pick<KeyboardEvent, "key" | "target">) => void;
|
|
135
|
+
handleInputClear: (e: unknown) => void;
|
|
136
136
|
handleRangeInputClear(e: Pick<Event, 'stopPropagation'>): void;
|
|
137
|
-
handleRangeInputClearClick(e: Pick<MouseEvent,
|
|
138
|
-
handleRangeInputClearMouseDown(e: Pick<MouseEvent,
|
|
139
|
-
handleRangeInputEnterPress(e: Pick<KeyboardEvent,
|
|
140
|
-
handleRangeInputEndKeyPress(e: Pick<KeyboardEvent,
|
|
141
|
-
handleRangeInputFocus(e: unknown, rangeType: RangeInput)
|
|
142
|
-
handleInsetInputChange({ value, panel, field, insetInputValue }: InsetInputChangeFoundationProps)
|
|
137
|
+
handleRangeInputClearClick: (e: Pick<MouseEvent, "detail" | "stopPropagation">) => void;
|
|
138
|
+
handleRangeInputClearMouseDown: (e: Pick<MouseEvent, "button" | "preventDefault" | "stopPropagation">) => void;
|
|
139
|
+
handleRangeInputEnterPress: (e: Pick<KeyboardEvent, "key">, rangeInputValue: string) => void;
|
|
140
|
+
handleRangeInputEndKeyPress: (e: Pick<KeyboardEvent, "key">) => void;
|
|
141
|
+
handleRangeInputFocus: (e: unknown, rangeType: RangeInput) => void;
|
|
142
|
+
handleInsetInputChange: ({ value, panel, field, insetInputValue }: InsetInputChangeFoundationProps) => void;
|
|
143
143
|
}
|
|
144
144
|
export {};
|
|
@@ -22,7 +22,7 @@ var InputFoundation = class InputFoundation extends BaseFoundation {
|
|
|
22
22
|
return `${rangeStart}${props.rangeSeparator}${rangeEnd}`;
|
|
23
23
|
}
|
|
24
24
|
#autoFillTimeToInsetInputValue({ panel, field, insetInputValue, format: format$1 }) {
|
|
25
|
-
const { type, defaultPickerValue, dateFnsLocale } = this.
|
|
25
|
+
const { type, defaultPickerValue, dateFnsLocale } = this.adapter.getProps();
|
|
26
26
|
const { dateInput, timeInput } = insetInputValue[panel];
|
|
27
27
|
if (!type.includes("Time") || field !== "dateInput" || timeInput) return insetInputValue;
|
|
28
28
|
const dateFormatToken = format$1.split(" ")[0] ?? strings.FORMAT_FULL_DATE;
|
|
@@ -148,37 +148,37 @@ var InputFoundation = class InputFoundation extends BaseFoundation {
|
|
|
148
148
|
default: return "";
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
handleChange(value, e) {
|
|
152
|
-
this.
|
|
153
|
-
}
|
|
154
|
-
handleInputComplete(e) {
|
|
155
|
-
if (e.key === KEY_CODE_ENTER) this.
|
|
156
|
-
}
|
|
157
|
-
handleInputClear(e) {
|
|
158
|
-
this.
|
|
159
|
-
}
|
|
151
|
+
handleChange = (value, e) => {
|
|
152
|
+
this.adapter.notifyChange(value, e);
|
|
153
|
+
};
|
|
154
|
+
handleInputComplete = (e) => {
|
|
155
|
+
if (e.key === KEY_CODE_ENTER && e.target instanceof HTMLInputElement) this.adapter.notifyEnter(e.target.value);
|
|
156
|
+
};
|
|
157
|
+
handleInputClear = (e) => {
|
|
158
|
+
this.adapter.notifyClear(e);
|
|
159
|
+
};
|
|
160
160
|
handleRangeInputClear(e) {
|
|
161
161
|
e.stopPropagation();
|
|
162
|
-
this.
|
|
162
|
+
this.adapter.notifyRangeInputClear(e);
|
|
163
163
|
}
|
|
164
|
-
handleRangeInputClearClick(e) {
|
|
164
|
+
handleRangeInputClearClick = (e) => {
|
|
165
165
|
if (e.detail === 0) this.handleRangeInputClear(e);
|
|
166
|
-
}
|
|
167
|
-
handleRangeInputClearMouseDown(e) {
|
|
166
|
+
};
|
|
167
|
+
handleRangeInputClearMouseDown = (e) => {
|
|
168
168
|
if (isSecondaryPress(e)) e.preventDefault();
|
|
169
169
|
else this.handleRangeInputClear(e);
|
|
170
|
-
}
|
|
171
|
-
handleRangeInputEnterPress(e, rangeInputValue) {
|
|
172
|
-
if (e.key === KEY_CODE_ENTER) this.
|
|
173
|
-
}
|
|
174
|
-
handleRangeInputEndKeyPress(e) {
|
|
175
|
-
if (e.key === KEY_CODE_TAB) this.
|
|
176
|
-
}
|
|
177
|
-
handleRangeInputFocus(e, rangeType) {
|
|
178
|
-
this.
|
|
179
|
-
}
|
|
180
|
-
handleInsetInputChange({ value, panel, field, insetInputValue }) {
|
|
181
|
-
const props = this.
|
|
170
|
+
};
|
|
171
|
+
handleRangeInputEnterPress = (e, rangeInputValue) => {
|
|
172
|
+
if (e.key === KEY_CODE_ENTER) this.adapter.notifyEnter(rangeInputValue);
|
|
173
|
+
};
|
|
174
|
+
handleRangeInputEndKeyPress = (e) => {
|
|
175
|
+
if (e.key === KEY_CODE_TAB) this.adapter.notifyTabPress(e);
|
|
176
|
+
};
|
|
177
|
+
handleRangeInputFocus = (e, rangeType) => {
|
|
178
|
+
this.adapter.notifyRangeInputFocus(e, rangeType);
|
|
179
|
+
};
|
|
180
|
+
handleInsetInputChange = ({ value, panel, field, insetInputValue }) => {
|
|
181
|
+
const props = this.adapter.getProps();
|
|
182
182
|
const { format, type, rangeSeparator } = props;
|
|
183
183
|
const insetFormatToken = getInsetInputFormatToken({
|
|
184
184
|
type,
|
|
@@ -204,11 +204,11 @@ var InputFoundation = class InputFoundation extends BaseFoundation {
|
|
|
204
204
|
format: insetFormatToken
|
|
205
205
|
});
|
|
206
206
|
const finalInsetInputStr = InputFoundation.concatInsetInputValue(props, { insetInputValue: filledTimeInsetInputValue });
|
|
207
|
-
this.
|
|
207
|
+
this.adapter.notifyInsetInputChange({
|
|
208
208
|
insetInputValue: filledTimeInsetInputValue,
|
|
209
209
|
format: insetFormatToken,
|
|
210
210
|
insetInputStr: finalInsetInputStr
|
|
211
211
|
});
|
|
212
|
-
}
|
|
212
|
+
};
|
|
213
213
|
};
|
|
214
214
|
export { InputFoundation as default };
|
|
@@ -116,7 +116,7 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
116
116
|
static getValidTimeFormat(format?: string): string;
|
|
117
117
|
static getValidDateFormat(props: Pick<MonthsGridFoundationProps, 'format' | 'type'>): string;
|
|
118
118
|
/** The disabled hours, minutes and seconds `disabledTime` gives the time panel of `panelType` */
|
|
119
|
-
static calcDisabledTime({ disabledTime, type }: Pick<MonthsGridFoundationProps, 'disabledTime' | 'type'>,
|
|
119
|
+
static calcDisabledTime({ disabledTime, type }: Pick<MonthsGridFoundationProps, 'disabledTime' | 'type'>, { rangeStart, rangeEnd, monthLeft }: Pick<MonthsGridFoundationState, 'rangeStart' | 'rangeEnd' | 'monthLeft'>, panelType: PanelType): {
|
|
120
120
|
disabledHours?: () => number[];
|
|
121
121
|
disabledMinutes?: (hour: number) => number[];
|
|
122
122
|
disabledSeconds?: (hour: number, minute: number) => number[];
|
|
@@ -159,22 +159,22 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
159
159
|
}>;
|
|
160
160
|
init(): void;
|
|
161
161
|
/** Moves the panels when `defaultPickerValue` changes; the first value is applied by getInitialState */
|
|
162
|
-
initDefaultPickerValue()
|
|
163
|
-
updateSelectedFromProps(values: (Date | null)[], refreshPicker?: boolean)
|
|
164
|
-
toYearMonth(panelType: PanelType, target: Date)
|
|
165
|
-
prevMonth(panelType: PanelType)
|
|
166
|
-
nextMonth(panelType: PanelType)
|
|
167
|
-
prevYear(panelType: PanelType)
|
|
168
|
-
nextYear(panelType: PanelType)
|
|
169
|
-
handleDayClick(day: MonthDayInfo, panelType: PanelType)
|
|
170
|
-
handleDayHover({ fullDate }?: {
|
|
162
|
+
initDefaultPickerValue: () => void;
|
|
163
|
+
updateSelectedFromProps: (values: (Date | null)[], refreshPicker?: boolean) => void;
|
|
164
|
+
toYearMonth: (panelType: PanelType, target: Date) => void;
|
|
165
|
+
prevMonth: (panelType: PanelType) => void;
|
|
166
|
+
nextMonth: (panelType: PanelType) => void;
|
|
167
|
+
prevYear: (panelType: PanelType) => void;
|
|
168
|
+
nextYear: (panelType: PanelType) => void;
|
|
169
|
+
handleDayClick: (day: MonthDayInfo, panelType: PanelType) => void;
|
|
170
|
+
handleDayHover: ({ fullDate }?: {
|
|
171
171
|
fullDate: string;
|
|
172
|
-
})
|
|
173
|
-
handleTimeChange(newTime: {
|
|
172
|
+
}) => void;
|
|
173
|
+
handleTimeChange: (newTime: {
|
|
174
174
|
timeStampValue: number;
|
|
175
|
-
}, panelType: PanelType)
|
|
176
|
-
showYearPicker(panelType: PanelType)
|
|
177
|
-
showTimePicker(panelType: PanelType)
|
|
178
|
-
showDatePanel(panelType: PanelType)
|
|
175
|
+
}, panelType: PanelType) => void;
|
|
176
|
+
showYearPicker: (panelType: PanelType) => void;
|
|
177
|
+
showTimePicker: (panelType: PanelType) => void;
|
|
178
|
+
showDatePanel: (panelType: PanelType) => void;
|
|
179
179
|
}
|
|
180
180
|
export {};
|