@lekoala/date-picker 0.5.1 → 0.5.3
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/README.md +296 -294
- package/custom-elements.json +3 -0
- package/dist/date-picker.js +256 -91
- package/dist/date-picker.min.css +1 -1
- package/dist/date-picker.min.js +11 -12
- package/dist/date-picker.standalone.min.js +12 -506
- package/dist/types/date-calendar.d.ts +5 -90
- package/dist/types/date-picker.d.ts +12 -314
- package/dist/types/date.d.ts.map +1 -1
- package/docs/API.md +444 -442
- package/docs/ARCHITECTURE.md +2 -0
- package/docs/DECISIONS.md +74 -74
- package/docs/USE_CASES.md +156 -156
- package/package.json +3 -3
- package/src/activation-intents.js +9 -0
- package/src/date-calendar.js +99 -18
- package/src/date-field.js +57 -10
- package/src/date-picker.js +187 -86
- package/src/date.js +4 -1
- package/dist/types/date-calendar.d.ts.map +0 -1
- package/dist/types/date-field.d.ts +0 -104
- package/dist/types/date-field.d.ts.map +0 -1
- package/dist/types/date-picker.d.ts.map +0 -1
- package/dist/types/time.d.ts +0 -8
- package/dist/types/time.d.ts.map +0 -1
- package/dist/types/upgrade-properties.d.ts +0 -8
- package/dist/types/upgrade-properties.d.ts.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CalendarModel } from "./calendar-model.js";
|
|
2
1
|
export type DateRange = {
|
|
3
2
|
start: string;
|
|
4
3
|
end: string;
|
|
@@ -34,39 +33,6 @@ export type DateDisabledPredicate = (date: string) => boolean;
|
|
|
34
33
|
/** @typedef {(date:string, state:DateState) => Node | string | null | undefined} DayRenderer */
|
|
35
34
|
/** @typedef {(date:string) => boolean} DateDisabledPredicate */
|
|
36
35
|
export declare class DateCalendarElement extends HTMLElement {
|
|
37
|
-
_id: string;
|
|
38
|
-
_model: CalendarModel;
|
|
39
|
-
_connected: boolean;
|
|
40
|
-
_rendering: boolean;
|
|
41
|
-
/** @type {DateSource | null} */
|
|
42
|
-
_source: DateSource | null;
|
|
43
|
-
_sourceStates: Map<any, any>;
|
|
44
|
-
_loadedRanges: Set<any>;
|
|
45
|
-
_loadController: AbortController | null;
|
|
46
|
-
_loadingKey: string;
|
|
47
|
-
/** @type {Promise<"loaded" | "cancelled" | "failed"> | null} */
|
|
48
|
-
_loadingPromise: Promise<"loaded" | "cancelled" | "failed"> | null;
|
|
49
|
-
/** @type {DateStateResolver | null} */
|
|
50
|
-
_dateState: DateStateResolver | null;
|
|
51
|
-
/** @type {DayRenderer | null} */
|
|
52
|
-
_renderDay: DayRenderer | null;
|
|
53
|
-
/** @type {DateDisabledPredicate | null} */
|
|
54
|
-
_isDateDisabled: DateDisabledPredicate | null;
|
|
55
|
-
/** @type {DateRange} */
|
|
56
|
-
_highlightedRange: DateRange;
|
|
57
|
-
/** @type {DateRange} */
|
|
58
|
-
_paintedRange: DateRange;
|
|
59
|
-
_paintedPreview: boolean;
|
|
60
|
-
/** @type {Map<string, DateState>} States of the current rendered grid. */
|
|
61
|
-
_renderedStates: Map<string, DateState>;
|
|
62
|
-
/** @type {typeof import("./messages.js").DEFAULT_MESSAGES | null} */
|
|
63
|
-
_messages: typeof import("./messages.js").DEFAULT_MESSAGES | null;
|
|
64
|
-
/** @type {Partial<import("./control-classes.js").ControlClasses> | null} */
|
|
65
|
-
_controlClasses: Partial<import("./control-classes.js").ControlClasses> | null;
|
|
66
|
-
/** @type {(() => void) | null} */
|
|
67
|
-
_stopDefaultMessages: (() => void) | null;
|
|
68
|
-
/** @type {(() => void) | null} */
|
|
69
|
-
_stopDefaultControlClasses: (() => void) | null;
|
|
70
36
|
static observedAttributes: string[];
|
|
71
37
|
/** @public @param {Partial<import("./control-classes.js").ControlClasses>} classes */
|
|
72
38
|
static setDefaultControlClasses(classes: Partial<import("./control-classes.js").ControlClasses>): void;
|
|
@@ -102,7 +68,8 @@ export declare class DateCalendarElement extends HTMLElement {
|
|
|
102
68
|
constructor();
|
|
103
69
|
connectedCallback(): void;
|
|
104
70
|
disconnectedCallback(): void;
|
|
105
|
-
|
|
71
|
+
/** @param {string} name @param {string|null} _oldValue @param {string|null} newValue */
|
|
72
|
+
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
106
73
|
/** @public */
|
|
107
74
|
get locale(): string;
|
|
108
75
|
set locale(value: string);
|
|
@@ -169,33 +136,15 @@ export declare class DateCalendarElement extends HTMLElement {
|
|
|
169
136
|
/** @public @returns {DateDisabledPredicate | null} */
|
|
170
137
|
get isDateDisabled(): DateDisabledPredicate | null;
|
|
171
138
|
set isDateDisabled(value: DateDisabledPredicate | null);
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
/** @param {string} value */
|
|
176
|
-
_clamp(value: string): string;
|
|
177
|
-
_weeks(display?: string): string[][];
|
|
178
|
-
/** @param {HTMLElement} element @returns {string} */
|
|
179
|
-
_focusTargetKey(element: HTMLElement): string;
|
|
180
|
-
/** @param {string} [display] */
|
|
181
|
-
_range(display?: string): {
|
|
182
|
-
start: string;
|
|
183
|
-
end: string;
|
|
139
|
+
/** @public @param {string} date @returns {DateState & {disabled: boolean}} */
|
|
140
|
+
getDateState(date: string): DateState & {
|
|
141
|
+
disabled: boolean;
|
|
184
142
|
};
|
|
185
|
-
/** @public @param {string} date */
|
|
186
|
-
getDateState(date: string): any;
|
|
187
143
|
/** @public */
|
|
188
144
|
refreshSource(): Promise<void>;
|
|
189
145
|
/** @public Ensure source state exists for the month containing a typed/selected date.
|
|
190
146
|
* @param {string} date @returns {Promise<boolean>} */
|
|
191
147
|
ensureDate(date: string): Promise<boolean>;
|
|
192
|
-
/** @param {string} display @param {boolean} [rerender] @returns {Promise<"loaded" | "cancelled" | "failed">} */
|
|
193
|
-
_loadDisplay(display: string, rerender?: boolean): Promise<"loaded" | "cancelled" | "failed">;
|
|
194
|
-
/** @param {string} display @param {{emit?:boolean}} [options] */
|
|
195
|
-
_setDisplay(display: string, options?: {
|
|
196
|
-
emit?: boolean;
|
|
197
|
-
}): string;
|
|
198
|
-
_emitDisplayChange(): void;
|
|
199
148
|
/** @public */
|
|
200
149
|
previousMonth(): string;
|
|
201
150
|
/** @public */
|
|
@@ -204,25 +153,6 @@ export declare class DateCalendarElement extends HTMLElement {
|
|
|
204
153
|
focusDate(date: string, options?: {
|
|
205
154
|
moveFocus?: boolean;
|
|
206
155
|
}): void;
|
|
207
|
-
/** @param {string} previous @param {string} next @param {boolean} [moveFocus] */
|
|
208
|
-
_moveFocusDom(previous: string, next: string, moveFocus?: boolean): void;
|
|
209
|
-
/** @param {string} previousValue @param {string} nextValue */
|
|
210
|
-
_moveSelectionDom(previousValue: string, nextValue: string): boolean;
|
|
211
|
-
/**
|
|
212
|
-
* Accessible name of one day cell. The band contribution is dropped while a
|
|
213
|
-
* preview is projected onto `highlightedRange`: a proposal must not be
|
|
214
|
-
* announced as a committed range start/end.
|
|
215
|
-
* @param {string} date @param {DateState} state
|
|
216
|
-
* @param {"" | "start" | "in" | "end" | "single"} position
|
|
217
|
-
*/
|
|
218
|
-
_dayLabel(date: string, state: DateState, position: "" | "start" | "in" | "end" | "single"): string;
|
|
219
|
-
/**
|
|
220
|
-
* Repaint the range band over the cells already rendered. The band is
|
|
221
|
-
* presentation on top of the same grid, so it must never rebuild it: a full
|
|
222
|
-
* render would drop `renderDay()` nodes and fight the roving focus on every
|
|
223
|
-
* hover of a live range preview.
|
|
224
|
-
*/
|
|
225
|
-
_updateRangeDom(): void;
|
|
226
156
|
/** @public */
|
|
227
157
|
focusGrid(): void;
|
|
228
158
|
/**
|
|
@@ -234,21 +164,6 @@ export declare class DateCalendarElement extends HTMLElement {
|
|
|
234
164
|
* @param {string} date @returns {Promise<boolean>}
|
|
235
165
|
*/
|
|
236
166
|
activateDate(date: string): Promise<boolean>;
|
|
237
|
-
/** @param {MouseEvent} event */
|
|
238
|
-
_onClick(event: MouseEvent): void;
|
|
239
|
-
/** @param {Event} event */
|
|
240
|
-
_onChange(event: Event): void;
|
|
241
|
-
/**
|
|
242
|
-
* Real DOM focus is the single source of truth for `datefocus`: the model is
|
|
243
|
-
* synced here and the event is announced from here, so the temporary focus
|
|
244
|
-
* arithmetic in `_onKeyDown` cannot emit phantom events, and setting
|
|
245
|
-
* `focusedDate` without moving focus stays silent.
|
|
246
|
-
* @param {FocusEvent} event
|
|
247
|
-
*/
|
|
248
|
-
_onFocusIn(event: FocusEvent): void;
|
|
249
|
-
/** @param {KeyboardEvent} event */
|
|
250
|
-
_onKeyDown(event: KeyboardEvent): void;
|
|
251
167
|
/** @public @param {boolean} [load] */
|
|
252
168
|
render(load?: boolean): void;
|
|
253
169
|
}
|
|
254
|
-
//# sourceMappingURL=date-calendar.d.ts.map
|
|
@@ -1,81 +1,5 @@
|
|
|
1
1
|
import { DateCalendarElement } from "./date-calendar.js";
|
|
2
|
-
import { DateFieldController } from "./date-field.js";
|
|
3
|
-
import { DateRangeController } from "./date-range.js";
|
|
4
2
|
export declare class DatePickerElement extends HTMLElement {
|
|
5
|
-
_id: string;
|
|
6
|
-
_connected: boolean;
|
|
7
|
-
_reflecting: boolean;
|
|
8
|
-
_value: string;
|
|
9
|
-
_input: HTMLInputElement | null;
|
|
10
|
-
/** @type {DateFieldController | null} */
|
|
11
|
-
_field: DateFieldController | null;
|
|
12
|
-
/** @type {DateFieldController[] | null} */
|
|
13
|
-
_fields: DateFieldController[] | null;
|
|
14
|
-
/** @type {DateRangeController | null} */
|
|
15
|
-
_range: DateRangeController | null;
|
|
16
|
-
_orderTags: Set<any>;
|
|
17
|
-
/** Native time companions, [start, end]. @type {[HTMLInputElement | null, HTMLInputElement | null]} */
|
|
18
|
-
_timeFields: [HTMLInputElement | null, HTMLInputElement | null];
|
|
19
|
-
/** Time inputs currently holding our order error. @type {Set<HTMLInputElement>} */
|
|
20
|
-
_timeOrderOwned: Set<HTMLInputElement>;
|
|
21
|
-
/** @type {"" | "start" | "end"} */
|
|
22
|
-
_lastFocusEndpoint: "" | "start" | "end";
|
|
23
|
-
_rangeCommitId: number;
|
|
24
|
-
/** Grid activation intents, keyed by date: the generation at interaction
|
|
25
|
-
* time (range mode supersession/stale protection) plus the bound a drag
|
|
26
|
-
* drop targets, empty for a normal pick.
|
|
27
|
-
* @type {Map<string, {id: number, endpoint: "" | "start" | "end"}>} */
|
|
28
|
-
_pendingIntents: Map<string, {
|
|
29
|
-
id: number;
|
|
30
|
-
endpoint: "" | "start" | "end";
|
|
31
|
-
}>;
|
|
32
|
-
/** Candidate date currently projected onto the calendar band, if any. */
|
|
33
|
-
_previewDate: string;
|
|
34
|
-
/** Live endpoint drag, or null. @type {{pointerId:number, endpoint:"start"|"end", x:number, y:number, date:string, active:boolean} | null} */
|
|
35
|
-
_drag: {
|
|
36
|
-
pointerId: number;
|
|
37
|
-
endpoint: "start" | "end";
|
|
38
|
-
x: number;
|
|
39
|
-
y: number;
|
|
40
|
-
date: string;
|
|
41
|
-
active: boolean;
|
|
42
|
-
} | null;
|
|
43
|
-
/** A real drag already committed; swallow the click that follows it. */
|
|
44
|
-
_suppressGridClick: boolean;
|
|
45
|
-
/** Overlaid calendar triggers, one per field (single) or per bound (range). @type {{button: HTMLButtonElement, endpoint: "" | "start" | "end"}[]} */
|
|
46
|
-
_buttons: {
|
|
47
|
-
button: HTMLButtonElement;
|
|
48
|
-
endpoint: "" | "start" | "end";
|
|
49
|
-
}[];
|
|
50
|
-
/** Control that opened the popover, so single mode can restore focus to it.
|
|
51
|
-
* @type {HTMLElement | null} */
|
|
52
|
-
_returnFocus: HTMLElement | null;
|
|
53
|
-
_panel: HTMLDivElement | null;
|
|
54
|
-
_calendar: DateCalendarElement | null;
|
|
55
|
-
_originalDescribedBy: string;
|
|
56
|
-
_rangeOriginalDescribedBy: string[];
|
|
57
|
-
_formatHint: HTMLSpanElement | null;
|
|
58
|
-
_generatedPlaceholder: boolean;
|
|
59
|
-
_controller: AbortController | null;
|
|
60
|
-
_stopTracking: (() => void) | null;
|
|
61
|
-
_open: boolean;
|
|
62
|
-
_suppressFocusOpen: boolean;
|
|
63
|
-
/** @type {typeof import("./messages.js").DEFAULT_MESSAGES | null} */
|
|
64
|
-
_messages: typeof import("./messages.js").DEFAULT_MESSAGES | null;
|
|
65
|
-
/** @type {Partial<import("./control-classes.js").ControlClasses> | null} */
|
|
66
|
-
_controlClasses: Partial<import("./control-classes.js").ControlClasses> | null;
|
|
67
|
-
/** @type {(() => void) | null} */
|
|
68
|
-
_stopDefaultMessages: (() => void) | null;
|
|
69
|
-
/** @type {any} */
|
|
70
|
-
_source: any;
|
|
71
|
-
/** @type {any} */
|
|
72
|
-
_dateState: any;
|
|
73
|
-
/** @type {any} */
|
|
74
|
-
_renderDay: any;
|
|
75
|
-
/** @type {any} */
|
|
76
|
-
_isDateDisabled: any;
|
|
77
|
-
/** Public picker coordinate-space request. @type {"viewport" | "document"} */
|
|
78
|
-
_coordinateSpace: "viewport" | "document";
|
|
79
3
|
static observedAttributes: string[];
|
|
80
4
|
/** @public @param {Partial<import("./control-classes.js").ControlClasses>} classes */
|
|
81
5
|
static setDefaultControlClasses(classes: Partial<import("./control-classes.js").ControlClasses>): void;
|
|
@@ -109,19 +33,8 @@ export declare class DatePickerElement extends HTMLElement {
|
|
|
109
33
|
rangeOrderEnd: string;
|
|
110
34
|
};
|
|
111
35
|
constructor();
|
|
112
|
-
_rangeMode(): boolean;
|
|
113
36
|
connectedCallback(): void;
|
|
114
|
-
_connectSingle(): void;
|
|
115
|
-
/**
|
|
116
|
-
* Find optional native time companions. They stay fully native (no hidden
|
|
117
|
-
* input, no field controller); the picker only coordinates from/to order.
|
|
118
|
-
* A bad composition never breaks the date picker: warn and leave times alone.
|
|
119
|
-
*/
|
|
120
|
-
_discoverTimeFields(): void;
|
|
121
|
-
_connectRange(): void;
|
|
122
37
|
disconnectedCallback(): void;
|
|
123
|
-
/** @param {DateFieldController | null} field */
|
|
124
|
-
_teardownField(field: DateFieldController | null): void;
|
|
125
38
|
/** @param {string} name @param {string|null} oldValue @param {string|null} newValue */
|
|
126
39
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
127
40
|
/** @public */
|
|
@@ -169,228 +82,21 @@ export declare class DatePickerElement extends HTMLElement {
|
|
|
169
82
|
get messages(): typeof import("./messages.js").DEFAULT_MESSAGES;
|
|
170
83
|
/** @param {Partial<typeof import("./messages.js").DEFAULT_MESSAGES> | null} value */
|
|
171
84
|
set messages(value: Partial<typeof import("./messages.js").DEFAULT_MESSAGES> | null);
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
set isDateDisabled(value: any);
|
|
85
|
+
/** @public @returns {import("./date-calendar.js").DateSource | null} */
|
|
86
|
+
get source(): import("./date-calendar.js").DateSource | null;
|
|
87
|
+
set source(value: import("./date-calendar.js").DateSource | null);
|
|
88
|
+
/** @public @returns {import("./date-calendar.js").DateStateResolver | null} */
|
|
89
|
+
get dateState(): import("./date-calendar.js").DateStateResolver | null;
|
|
90
|
+
set dateState(value: import("./date-calendar.js").DateStateResolver | null);
|
|
91
|
+
/** @public @returns {import("./date-calendar.js").DayRenderer | null} */
|
|
92
|
+
get renderDay(): import("./date-calendar.js").DayRenderer | null;
|
|
93
|
+
set renderDay(value: import("./date-calendar.js").DayRenderer | null);
|
|
94
|
+
/** @public @returns {import("./date-calendar.js").DateDisabledPredicate | null} */
|
|
95
|
+
get isDateDisabled(): import("./date-calendar.js").DateDisabledPredicate | null;
|
|
96
|
+
set isDateDisabled(value: import("./date-calendar.js").DateDisabledPredicate | null);
|
|
185
97
|
/** @public JS-only coordinate-space policy: "viewport" by default, "document" as an explicit opt-in; a change made while open applies to the next opening only. @returns {"viewport" | "document"} */
|
|
186
98
|
get coordinateSpace(): "viewport" | "document";
|
|
187
99
|
set coordinateSpace(value: "viewport" | "document");
|
|
188
|
-
_adapter(): {
|
|
189
|
-
locale: string;
|
|
190
|
-
placeholder: string;
|
|
191
|
-
format(value: string): string;
|
|
192
|
-
parse(text: string): string;
|
|
193
|
-
};
|
|
194
|
-
_setupFormValue(): void;
|
|
195
|
-
_syncInputState(): void;
|
|
196
|
-
_syncRangeFields(): void;
|
|
197
|
-
_setRangeAria(): void;
|
|
198
|
-
/**
|
|
199
|
-
* Create one calendar trigger. It is a real button overlaid inside the
|
|
200
|
-
* field's own box (see the CSS): the field reserves the room, the trigger
|
|
201
|
-
* stays transparent, and the field's focus ring wraps both.
|
|
202
|
-
* @param {"" | "start" | "end"} endpoint
|
|
203
|
-
* @returns {HTMLButtonElement}
|
|
204
|
-
*/
|
|
205
|
-
_createTrigger(endpoint: "" | "start" | "end"): HTMLButtonElement;
|
|
206
|
-
/**
|
|
207
|
-
* Build the popup once and one trigger per field. Each trigger is inserted
|
|
208
|
-
* immediately after its own field so DOM order follows visual/tab order
|
|
209
|
-
* (`date -> its trigger -> next control`). The hidden ISO field may sit
|
|
210
|
-
* between the two; it is not focusable.
|
|
211
|
-
*/
|
|
212
|
-
_build(): void;
|
|
213
|
-
/** @param {AbortSignal} signal @param {HTMLInputElement | null | undefined} input @param {() => void} restore */
|
|
214
|
-
_bindPopup(signal: AbortSignal, input: HTMLInputElement | null | undefined, restore: () => void): void;
|
|
215
|
-
_bind(): void;
|
|
216
|
-
_bindRange(): void;
|
|
217
|
-
/**
|
|
218
|
-
* Point the shared calendar at one range bound and invalidate any pending
|
|
219
|
-
* activation, so a late response can never commit on the wrong bound.
|
|
220
|
-
* @param {"start" | "end"} endpoint
|
|
221
|
-
*/
|
|
222
|
-
_activateRangeEndpoint(endpoint: "start" | "end"): void;
|
|
223
|
-
/**
|
|
224
|
-
* Range has one trigger per bound. A press on the other bound's trigger is a
|
|
225
|
-
* local switch, not a toggle: it repoints the single open popup instead of
|
|
226
|
-
* closing it. Only a press on the already-active bound toggles shut.
|
|
227
|
-
* @param {"start" | "end"} endpoint
|
|
228
|
-
* @param {MouseEvent} event
|
|
229
|
-
*/
|
|
230
|
-
_onRangeTriggerClick(endpoint: "start" | "end", event: MouseEvent): void;
|
|
231
|
-
/**
|
|
232
|
-
* ArrowDown on a trigger opens the popup and drops into the grid, like the
|
|
233
|
-
* field itself (Enter/Space go through the click path). Needed because focus
|
|
234
|
-
* now returns to the trigger that opened the popover.
|
|
235
|
-
* @param {"" | "start" | "end"} endpoint
|
|
236
|
-
* @param {KeyboardEvent} event
|
|
237
|
-
*/
|
|
238
|
-
_onTriggerKeyDown(endpoint: "" | "start" | "end", event: KeyboardEvent): void;
|
|
239
|
-
/** @param {"" | "start" | "end"} endpoint @param {KeyboardEvent} event */
|
|
240
|
-
_onFieldKeyDown(endpoint: "" | "start" | "end", event: KeyboardEvent): void;
|
|
241
|
-
/** @param {"" | "start" | "end"} endpoint @param {FocusEvent} event */
|
|
242
|
-
_onFieldFocus(endpoint: "" | "start" | "end", event: FocusEvent): void;
|
|
243
|
-
/** Record range-mode grid activation intent (click or keyboard) so a stale,
|
|
244
|
-
* late-confirmed dateactivate can be recognized and dropped. Each new grid
|
|
245
|
-
* activation supersedes every earlier pending one.
|
|
246
|
-
* @param {Event} event */
|
|
247
|
-
_captureGridIntent(event: Event): void;
|
|
248
|
-
/** Whether one bound can receive a user pick right now.
|
|
249
|
-
* @param {"start" | "end"} bound */
|
|
250
|
-
_boundEditable(bound: "start" | "end"): boolean;
|
|
251
|
-
/**
|
|
252
|
-
* Single write path for a calendar-driven range change. Both fields are
|
|
253
|
-
* synchronized before anything is announced, because one transition can move
|
|
254
|
-
* both bounds at once (`10` then `5` commits `start 10 -> 5` together with
|
|
255
|
-
* `end "" -> 10`); writing bound by bound would expose an intermediate
|
|
256
|
-
* inverted pair. Synthetic `input`/`change` stay on the bounds that moved.
|
|
257
|
-
* @param {import("./date-range.js").RangeTransition} transition
|
|
258
|
-
*/
|
|
259
|
-
_applyRangeTransition(transition: import("./date-range.js").RangeTransition): void;
|
|
260
|
-
/**
|
|
261
|
-
* Project a candidate date onto the calendar band. Purely visual: no
|
|
262
|
-
* `rangechange`, no field write, no validation and no source request — the
|
|
263
|
-
* projection reads the month state already loaded, and the real availability
|
|
264
|
-
* check still runs on commit.
|
|
265
|
-
* @param {string} date @param {"" | "start" | "end"} [endpoint]
|
|
266
|
-
*/
|
|
267
|
-
_setPreview(date: string, endpoint?: "" | "start" | "end"): void;
|
|
268
|
-
/** Drop the projection and put the committed range back on the band. */
|
|
269
|
-
_clearPreview(): void;
|
|
270
|
-
/** @param {Event} event */
|
|
271
|
-
_onGridDateFocus(event: Event): void;
|
|
272
|
-
/**
|
|
273
|
-
* Hover candidate. `focusedDate` stays the keyboard target only: pointer
|
|
274
|
-
* hover never moves it, it just feeds the same projection.
|
|
275
|
-
* @param {Event} event
|
|
276
|
-
*/
|
|
277
|
-
_onGridPointerOver(event: Event): void;
|
|
278
|
-
_onGridPointerLeave(): void;
|
|
279
|
-
/** @param {EventTarget | null} target @returns {string} */
|
|
280
|
-
_cellDate(target: EventTarget | null): string;
|
|
281
|
-
/** @param {number} x @param {number} y @returns {string} */
|
|
282
|
-
_dateAtPoint(x: number, y: number): string;
|
|
283
|
-
/**
|
|
284
|
-
* Arm an endpoint drag. Only a complete, ordered range offers two distinct
|
|
285
|
-
* handles; a one-day range carries both markers on the same cell, and
|
|
286
|
-
* guessing which one the user meant would be worse than not dragging.
|
|
287
|
-
* @param {Event} event
|
|
288
|
-
*/
|
|
289
|
-
_onGridPointerDown(event: Event): void;
|
|
290
|
-
/** @param {Event} event */
|
|
291
|
-
_onGridPointerMove(event: Event): void;
|
|
292
|
-
/** @param {Event} event */
|
|
293
|
-
_onGridPointerUp(event: Event): void;
|
|
294
|
-
/** @param {Event} event */
|
|
295
|
-
_onGridPointerCancel(event: Event): void;
|
|
296
|
-
/** @param {number} pointerId */
|
|
297
|
-
_releaseDragCapture(pointerId: number): void;
|
|
298
|
-
/** Expose whether the band currently offers draggable handles, and whether
|
|
299
|
-
* one is being dragged, so the cursor can say so. */
|
|
300
|
-
_syncDragAffordance(): void;
|
|
301
|
-
/** @param {KeyboardEvent} event */
|
|
302
|
-
_onEscape(event: KeyboardEvent): void;
|
|
303
|
-
_syncCalendarOptions(): void;
|
|
304
|
-
_refreshLocale(): void;
|
|
305
|
-
_refreshButtonLabel(): void;
|
|
306
|
-
/** Each bound has its own trigger, so each needs its own accessible name: the
|
|
307
|
-
* bound label is what tells two otherwise identical triggers apart. */
|
|
308
|
-
_refreshRangeButtonLabel(): void;
|
|
309
|
-
/** @param {string} value */
|
|
310
|
-
_reflectValue(value: string): void;
|
|
311
|
-
/** @param {string} value @param {{emit?:boolean,format?:boolean,reflect?:boolean,moveDisplay?:boolean}} [options] */
|
|
312
|
-
_setValue(value: string, options?: {
|
|
313
|
-
emit?: boolean;
|
|
314
|
-
format?: boolean;
|
|
315
|
-
reflect?: boolean;
|
|
316
|
-
moveDisplay?: boolean;
|
|
317
|
-
}): void;
|
|
318
|
-
/**
|
|
319
|
-
* Calendar-backed availability gate injected into the field controllers.
|
|
320
|
-
* A cancelled or failed source load confirms nothing: do not fill the
|
|
321
|
-
* submitted ISO field nor treat the date as available.
|
|
322
|
-
* @param {string} date @param {{moveDisplay?: boolean}} [options]
|
|
323
|
-
* @returns {Promise<{ok: boolean, message?: string}>}
|
|
324
|
-
*/
|
|
325
|
-
_confirmDate(date: string, options?: {
|
|
326
|
-
moveDisplay?: boolean;
|
|
327
|
-
}): Promise<{
|
|
328
|
-
ok: boolean;
|
|
329
|
-
message?: string;
|
|
330
|
-
}>;
|
|
331
|
-
/** @param {boolean} emit @param {{force?: boolean, moveDisplay?: boolean}} [options] */
|
|
332
|
-
_commitText(emit: boolean, options?: {
|
|
333
|
-
force?: boolean;
|
|
334
|
-
moveDisplay?: boolean;
|
|
335
|
-
}): Promise<boolean>;
|
|
336
|
-
/** @param {"start" | "end"} which */
|
|
337
|
-
_commitFieldText(which: "start" | "end"): Promise<boolean>;
|
|
338
|
-
/** @param {"start" | "end"} which @param {string} value
|
|
339
|
-
* @param {{emit?:boolean, format?:boolean, user?:boolean}} [options] @returns {boolean} */
|
|
340
|
-
_setBound(which: "start" | "end", value: string, options?: {
|
|
341
|
-
emit?: boolean;
|
|
342
|
-
format?: boolean;
|
|
343
|
-
user?: boolean;
|
|
344
|
-
}): boolean;
|
|
345
|
-
/** Atomic pair update: canonical + visible + hidden before one event.
|
|
346
|
-
* @param {string} start @param {string} end @param {{emit?:boolean, format?:boolean}} [options] */
|
|
347
|
-
_setRange(start: string, end: string, options?: {
|
|
348
|
-
emit?: boolean;
|
|
349
|
-
format?: boolean;
|
|
350
|
-
}): void;
|
|
351
|
-
/** @param {"start" | "end"} which */
|
|
352
|
-
_boundCanonical(which: "start" | "end"): string;
|
|
353
|
-
_emitRangeChange(): void;
|
|
354
|
-
/** Displayable projection of the business range. An inverted or start-less
|
|
355
|
-
* pair shows no misleading band. @returns {{start:string, end:string}} */
|
|
356
|
-
_displayRange(): {
|
|
357
|
-
start: string;
|
|
358
|
-
end: string;
|
|
359
|
-
};
|
|
360
|
-
/** Put the committed range back on the calendar band, dropping any
|
|
361
|
-
* projection currently shown over it. */
|
|
362
|
-
_syncHighlight(): void;
|
|
363
|
-
/**
|
|
364
|
-
* Cross-bound validity: the order error is attributed to the bound that was
|
|
365
|
-
* just modified; the other bound only loses a stale order error, never its
|
|
366
|
-
* independent parse/source validity.
|
|
367
|
-
* @param {"start" | "end"} which
|
|
368
|
-
*/
|
|
369
|
-
_revalidateRange(which: "start" | "end"): void;
|
|
370
|
-
/**
|
|
371
|
-
* Single-mode from/to order on the shared date: `start <= end`.
|
|
372
|
-
* The order error is attributed to the bound that was just modified; the
|
|
373
|
-
* other bound only loses a stale order error, never its native validity.
|
|
374
|
-
* Missing, empty or disabled times fall back to no order constraint: times
|
|
375
|
-
* are never implicitly required. Equality stays valid (duration rules are
|
|
376
|
-
* application-owned).
|
|
377
|
-
* @param {"start" | "end"} which
|
|
378
|
-
*/
|
|
379
|
-
_revalidateTimeOrder(which: "start" | "end"): void;
|
|
380
|
-
_clearTimeOrderValidity(): void;
|
|
381
|
-
_restoreDefault(): void;
|
|
382
|
-
_restoreRangeDefault(): void;
|
|
383
|
-
/** @param {"start" | "end"} which */
|
|
384
|
-
_focusField(which: "start" | "end"): void;
|
|
385
|
-
/**
|
|
386
|
-
* Restore focus to the control that opened the popover (single mode). focus()
|
|
387
|
-
* must not run synchronously from a keydown handler (Chromium drops focus
|
|
388
|
-
* changes there) and must not re-open the popover under the default
|
|
389
|
-
* open-on-focus. Deferring keeps _suppressFocusOpen active for the call.
|
|
390
|
-
*/
|
|
391
|
-
_restoreFocus(): void;
|
|
392
|
-
/** @returns {"" | "start" | "end"} */
|
|
393
|
-
_resolveRangeEndpoint(): "" | "start" | "end";
|
|
394
100
|
/** @public */
|
|
395
101
|
validate(): Promise<boolean>;
|
|
396
102
|
/** @public @param {{moveFocus?:boolean, endpoint?:"start"|"end", returnFocus?:HTMLElement}} [options] */
|
|
@@ -399,14 +105,6 @@ export declare class DatePickerElement extends HTMLElement {
|
|
|
399
105
|
endpoint?: "start" | "end";
|
|
400
106
|
returnFocus?: HTMLElement;
|
|
401
107
|
}): void;
|
|
402
|
-
/** @param {boolean} expanded */
|
|
403
|
-
_setExpanded(expanded: boolean): void;
|
|
404
108
|
/** @public @param {boolean} [restoreFocus] */
|
|
405
109
|
hide(restoreFocus?: boolean): void;
|
|
406
|
-
/** The bound to restore focus to after closing a range popup: the active
|
|
407
|
-
* endpoint first (it moved after the first selection), then the next
|
|
408
|
-
* focusable bound.
|
|
409
|
-
* @returns {"" | "start" | "end"} */
|
|
410
|
-
_restoreFocusEndpoint(): "" | "start" | "end";
|
|
411
110
|
}
|
|
412
|
-
//# sourceMappingURL=date-picker.d.ts.map
|
package/dist/types/date.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/date.js"],"names":[],"mappings":"AAGA,2BAA2B;AAC3B,wBAAgB,UAAU,CAAC,IAAI,EADnB,MACmB,WAE9B;AAED,iDAAiD;AACjD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