@aquera/nile-elements 2.0.19 → 2.0.20
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 +5 -0
- package/demo/index.js +0 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1254 -488
- package/dist/nile-badge/index.cjs.js +1 -1
- package/dist/nile-badge/index.esm.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
- package/dist/nile-badge/nile-badge.css.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.css.cjs.js.map +1 -1
- package/dist/nile-badge/nile-badge.css.esm.js +24 -3
- package/dist/nile-badge/nile-badge.esm.js +5 -3
- package/dist/nile-calendar/index.cjs.js +1 -1
- package/dist/nile-calendar/index.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js +2 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.esm.js +357 -2
- package/dist/nile-calendar/nile-calendar.esm.js +365 -41
- package/dist/nile-calendar/timezones.cjs.js +1 -1
- package/dist/nile-calendar/timezones.cjs.js.map +1 -1
- package/dist/nile-calendar/timezones.esm.js +1 -1
- package/dist/nile-date-time-picker/index.cjs.js +2 -0
- package/dist/nile-date-time-picker/index.cjs.js.map +1 -0
- package/dist/nile-date-time-picker/index.esm.js +1 -0
- package/dist/nile-date-time-picker/nile-date-time-picker.cjs.js +2 -0
- package/dist/nile-date-time-picker/nile-date-time-picker.cjs.js.map +1 -0
- package/dist/nile-date-time-picker/nile-date-time-picker.css.cjs.js +2 -0
- package/dist/nile-date-time-picker/nile-date-time-picker.css.cjs.js.map +1 -0
- package/dist/nile-date-time-picker/nile-date-time-picker.css.esm.js +13 -0
- package/dist/nile-date-time-picker/nile-date-time-picker.esm.js +53 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-badge/nile-badge.css.js +24 -3
- package/dist/src/nile-badge/nile-badge.css.js.map +1 -1
- package/dist/src/nile-badge/nile-badge.d.ts +7 -4
- package/dist/src/nile-badge/nile-badge.js +22 -5
- package/dist/src/nile-badge/nile-badge.js.map +1 -1
- package/dist/src/nile-badge/nile-badge.test.js +88 -0
- package/dist/src/nile-badge/nile-badge.test.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.css.js +355 -0
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.d.ts +175 -0
- package/dist/src/nile-calendar/nile-calendar.js +1726 -26
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.test.d.ts +1 -0
- package/dist/src/nile-calendar/nile-calendar.test.js +3580 -0
- package/dist/src/nile-calendar/nile-calendar.test.js.map +1 -1
- package/dist/src/nile-calendar/timezones.d.ts +21 -0
- package/dist/src/nile-calendar/timezones.js +49 -0
- package/dist/src/nile-calendar/timezones.js.map +1 -1
- package/dist/src/nile-date-time-picker/index.d.ts +1 -0
- package/dist/src/nile-date-time-picker/index.js +2 -0
- package/dist/src/nile-date-time-picker/index.js.map +1 -0
- package/dist/src/nile-date-time-picker/nile-date-time-picker.css.d.ts +11 -0
- package/dist/src/nile-date-time-picker/nile-date-time-picker.css.js +49 -0
- package/dist/src/nile-date-time-picker/nile-date-time-picker.css.js.map +1 -0
- package/dist/src/nile-date-time-picker/nile-date-time-picker.d.ts +173 -0
- package/dist/src/nile-date-time-picker/nile-date-time-picker.js +1270 -0
- package/dist/src/nile-date-time-picker/nile-date-time-picker.js.map +1 -0
- package/dist/src/nile-date-time-picker/nile-date-time-picker.test.d.ts +143 -0
- package/dist/src/nile-date-time-picker/nile-date-time-picker.test.js +7277 -0
- package/dist/src/nile-date-time-picker/nile-date-time-picker.test.js.map +1 -0
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utilities/animation-registry.cjs.js +1 -1
- package/dist/utilities/animation-registry.cjs.js.map +1 -1
- package/dist/utilities/animation-registry.esm.js +1 -1
- package/package.json +3 -1
- package/scripts/coverage-report.mjs +96 -0
- package/src/index.ts +1 -0
- package/src/nile-badge/nile-badge.css.ts +24 -3
- package/src/nile-badge/nile-badge.test.ts +102 -0
- package/src/nile-badge/nile-badge.ts +28 -5
- package/src/nile-calendar/nile-calendar.css.ts +355 -0
- package/src/nile-calendar/nile-calendar.test.ts +3793 -0
- package/src/nile-calendar/nile-calendar.ts +1760 -28
- package/src/nile-calendar/timezones.ts +57 -0
- package/src/nile-date-time-picker/index.ts +1 -0
- package/src/nile-date-time-picker/nile-date-time-picker.css.ts +54 -0
- package/src/nile-date-time-picker/nile-date-time-picker.test.ts +7886 -0
- package/src/nile-date-time-picker/nile-date-time-picker.ts +1153 -0
- package/vscode-html-custom-data.json +161 -6
|
@@ -13,11 +13,67 @@ type NileCalendarDateRange = {
|
|
|
13
13
|
endDate: string;
|
|
14
14
|
};
|
|
15
15
|
type TimeUnits = 'minutes' | 'hours' | 'days' | 'weeks' | 'months';
|
|
16
|
+
/** A wall clock — digits on a clock face. Local time*/
|
|
17
|
+
export type CalendarWallClock = {
|
|
18
|
+
year: number;
|
|
19
|
+
/** 1–12 (January = 1), NOT the 0–11 month of JavaScript `Date`; subtract 1 before `new Date(...)`. */
|
|
20
|
+
month: number;
|
|
21
|
+
day: number;
|
|
22
|
+
hours: number;
|
|
23
|
+
minutes: number;
|
|
24
|
+
seconds: number;
|
|
25
|
+
ms: number;
|
|
26
|
+
};
|
|
27
|
+
export declare function instantFromValueString(raw: string | null | undefined): number | null;
|
|
28
|
+
/** Digits as written, with no zone conversion. */
|
|
29
|
+
export declare function wallClockFromOffsetLess(raw: string | null | undefined): CalendarWallClock | null;
|
|
30
|
+
export declare function wallClockInZone(epochMs: number, zone: string): CalendarWallClock;
|
|
31
|
+
export declare function instantFromBracketedValue(raw: string | null | undefined): {
|
|
32
|
+
epochMs: number;
|
|
33
|
+
timezone: string;
|
|
34
|
+
} | null;
|
|
16
35
|
/**
|
|
17
36
|
* Nile icon component.
|
|
18
37
|
*
|
|
19
38
|
* @tag nile-calendar
|
|
20
39
|
*
|
|
40
|
+
* @csspart calendar-container - The outer container.
|
|
41
|
+
* @csspart calendar-switcher - The Absolute / Relative tab switcher.
|
|
42
|
+
* @csspart button-container - The default variant's button row.
|
|
43
|
+
* @csspart calendar-wrapper - Wraps the month grid.
|
|
44
|
+
* @csspart trigger - The month and year dropdown triggers.
|
|
45
|
+
* @csspart calendar-day-N - A day cell, where N is the day of the month.
|
|
46
|
+
* @csspart current-date-dot - The marker on today's date.
|
|
47
|
+
*
|
|
48
|
+
* Parts that exist only in `variant="date-time-picker"`:
|
|
49
|
+
* @csspart calendar-config - The row holding the type switcher.
|
|
50
|
+
* @csspart calendar - One month's header and grid.
|
|
51
|
+
* @csspart calendar-header - The month header row.
|
|
52
|
+
* @csspart calendar-header-prev - The previous-month icon.
|
|
53
|
+
* @csspart calendar-header-next - The next-month icon.
|
|
54
|
+
* @csspart calendar-header-center - The month and year area.
|
|
55
|
+
* @csspart days-container - The grid of day cells.
|
|
56
|
+
* @csspart day-name - A weekday label (Sun, Mon, ...).
|
|
57
|
+
* @csspart calendar-day-label - The number inside a day cell.
|
|
58
|
+
* @csspart tp-chevron - The expand / collapse control.
|
|
59
|
+
* @csspart tp-scroll-area - The scrolling area under the grid.
|
|
60
|
+
* @csspart tp-scroll-content - The content inside the scrolling area.
|
|
61
|
+
* @csspart tp-time-fields - The row of time inputs.
|
|
62
|
+
* @csspart tp-time-field - One time input (hours, minutes, seconds, milliseconds).
|
|
63
|
+
* @csspart tp-stepper - The up/down stepper inside a time input.
|
|
64
|
+
* @csspart tp-stepper-btn - Either stepper button.
|
|
65
|
+
* @csspart tp-stepper-btn-up - The increase button.
|
|
66
|
+
* @csspart tp-stepper-btn-down - The decrease button.
|
|
67
|
+
* @csspart tp-timezone - The timezone section.
|
|
68
|
+
* @csspart tp-timezone-header - The timezone label row.
|
|
69
|
+
* @csspart tp-timezone-label - The "Timezone" label.
|
|
70
|
+
* @csspart tp-timezone-local-link - The "Use local timezone" link.
|
|
71
|
+
* @csspart tp-timezone-select - The timezone select.
|
|
72
|
+
* @csspart tp-footer - The footer.
|
|
73
|
+
* @csspart tp-footer-actions - The Reset and Apply group.
|
|
74
|
+
* @csspart tp-set-to-now-button - The "Set to now" button.
|
|
75
|
+
* @csspart clear-button - The Reset button.
|
|
76
|
+
* @csspart apply-button - The Apply button.
|
|
21
77
|
*/
|
|
22
78
|
export declare class NileCalendar extends NileElement {
|
|
23
79
|
/**
|
|
@@ -29,6 +85,7 @@ export declare class NileCalendar extends NileElement {
|
|
|
29
85
|
allowedDates: string;
|
|
30
86
|
range: boolean;
|
|
31
87
|
hideTypes: boolean;
|
|
88
|
+
showTypes: boolean;
|
|
32
89
|
doubleClickUnselect: boolean;
|
|
33
90
|
allowClear: boolean;
|
|
34
91
|
type: 'absolute' | 'relative';
|
|
@@ -41,6 +98,7 @@ export declare class NileCalendar extends NileElement {
|
|
|
41
98
|
showMonthDropdown: boolean;
|
|
42
99
|
showYearDropdown: boolean;
|
|
43
100
|
dateFormat: string;
|
|
101
|
+
structuredInput: boolean;
|
|
44
102
|
startDate: Date | null;
|
|
45
103
|
endDate: Date | null;
|
|
46
104
|
isSelectingStart: boolean;
|
|
@@ -50,20 +108,82 @@ export declare class NileCalendar extends NileElement {
|
|
|
50
108
|
currentYear: number;
|
|
51
109
|
allowedDatesLocal: NileCalendarDateRange | any;
|
|
52
110
|
disabled: boolean;
|
|
111
|
+
variant: 'default' | 'date-time-picker';
|
|
112
|
+
timezone: string;
|
|
113
|
+
/** the timezone the consumer configured; Reset restores this (internal changes never overwrite it) */
|
|
114
|
+
private configuredTimezone;
|
|
115
|
+
/** the zone the component itself is assigning, so updated() can tell it from a consumer change */
|
|
116
|
+
private internalTimezone;
|
|
117
|
+
private setTimezoneInternally;
|
|
118
|
+
hideTimeFields: string[];
|
|
119
|
+
/** every field shown, minus the keys in hideTimeFields (a non-array value counts as an empty list) */
|
|
120
|
+
private get resolvedTimeFields();
|
|
121
|
+
private get tpFewFieldsNoTz();
|
|
122
|
+
expanded: boolean;
|
|
123
|
+
tpLockedHeight: string | null;
|
|
124
|
+
tpHours: number | null;
|
|
125
|
+
tpMinutes: number | null;
|
|
126
|
+
tpSeconds: number | null;
|
|
127
|
+
tpMilliseconds: number | null;
|
|
128
|
+
tpFocusedTimeField: string | null;
|
|
129
|
+
/** the day the keyboard last moved to; owns the grid's single tab stop (roving tabindex) */
|
|
130
|
+
tpFocusDate: {
|
|
131
|
+
year: number;
|
|
132
|
+
month: number;
|
|
133
|
+
day: number;
|
|
134
|
+
} | null;
|
|
135
|
+
tpEditingText: string;
|
|
136
|
+
private seedInstant;
|
|
137
|
+
private seedFieldsKey;
|
|
138
|
+
private seedZone;
|
|
53
139
|
connectedCallback(): void;
|
|
54
140
|
disconnectedCallback(): void;
|
|
141
|
+
protected firstUpdated(): void;
|
|
55
142
|
protected updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
143
|
+
private tpResizeObserver?;
|
|
144
|
+
/** the `.base--date-time-picker` element the observer currently watches */
|
|
145
|
+
private tpObservedBase;
|
|
146
|
+
private releasePanelObserver;
|
|
147
|
+
/** (re)points the observer at the rendered panel; a no-op while it already watches that element */
|
|
148
|
+
private observeCollapsedBase;
|
|
149
|
+
private captureCollapsedHeight;
|
|
150
|
+
private measurePanel;
|
|
151
|
+
private applyMonthYearDropdownAnimation;
|
|
56
152
|
private get monthNames();
|
|
57
153
|
private get yearOptions();
|
|
58
154
|
private onMonthSelected;
|
|
59
155
|
private onYearSelected;
|
|
156
|
+
/** brings the currently-selected month/year option into view when a dropdown opens */
|
|
157
|
+
private scrollSelectedIntoView;
|
|
158
|
+
private smoothScrollTo;
|
|
60
159
|
checkValidAllowedDate(): void;
|
|
160
|
+
/**
|
|
161
|
+
* The year range month navigation enforces. An explicit `startYear` / `endYear` always wins; the date-time-picker
|
|
162
|
+
* variant falls back to the dropdown's 2000-2050 for an unset side, while the default calendar leaves it open as published.
|
|
163
|
+
*/
|
|
164
|
+
private get minYear();
|
|
165
|
+
private get maxYear();
|
|
61
166
|
private isPrevDisabled;
|
|
62
167
|
private isNextDisabled;
|
|
63
168
|
private formatDate;
|
|
64
169
|
private parseDate;
|
|
65
170
|
private handleStartDateInput;
|
|
66
171
|
private handleEndDateInput;
|
|
172
|
+
private maskValuesMap;
|
|
173
|
+
private boundMaskInputs;
|
|
174
|
+
private unbindStructuredInput;
|
|
175
|
+
private bindStructuredInput;
|
|
176
|
+
private dateMaskSegments;
|
|
177
|
+
private timeMaskSegments;
|
|
178
|
+
private buildMaskLayout;
|
|
179
|
+
private maskLayoutFor;
|
|
180
|
+
private computeMaskDisplay;
|
|
181
|
+
private initMaskValues;
|
|
182
|
+
/** clamp a filled segment into range (year is left unclamped) */
|
|
183
|
+
private clampMaskSegment;
|
|
184
|
+
private maskValuesFor;
|
|
185
|
+
private onMaskKeydown;
|
|
186
|
+
private onMaskBlur;
|
|
67
187
|
/**
|
|
68
188
|
* Render method
|
|
69
189
|
*/
|
|
@@ -99,6 +219,7 @@ export declare class NileCalendar extends NileElement {
|
|
|
99
219
|
* @returns
|
|
100
220
|
*/
|
|
101
221
|
isAllowedDate(day: number, month: number, year: number): boolean;
|
|
222
|
+
private dayCellLabel;
|
|
102
223
|
clearDate(mode?: ClearMode): void;
|
|
103
224
|
/**
|
|
104
225
|
* @function handle_date-click/select
|
|
@@ -111,6 +232,25 @@ export declare class NileCalendar extends NileElement {
|
|
|
111
232
|
* Function to be called on initialization to set all other properties
|
|
112
233
|
*/
|
|
113
234
|
initializeValue(): void;
|
|
235
|
+
/** Forget any retained instant, in every category. */
|
|
236
|
+
private clearInstantSeed;
|
|
237
|
+
private instantSeedFieldsKey;
|
|
238
|
+
private seedFromInstant;
|
|
239
|
+
private trySeedFromInstantValue;
|
|
240
|
+
/**
|
|
241
|
+
* Seeds `value` from a string with the published conversion: `new Date(raw)` shifted by the host offset. Every variant
|
|
242
|
+
* keeps it, because the default calendar must behave exactly as the published component; the date-time-picker variant
|
|
243
|
+
* re-derives its value from its own parsers in `initializeValue`.
|
|
244
|
+
*/
|
|
245
|
+
private dateFromValueString;
|
|
246
|
+
/**
|
|
247
|
+
* One bound of a `range` value. In the date-time-picker variant `YYYY-MM-DD` is a calendar day, not a UTC instant: it
|
|
248
|
+
* lands on that local day, at 00:00:00.000 for the start and 23:59:59.999 for the end (what clicking the day produces).
|
|
249
|
+
* Every other string, and every bound of the default calendar, goes through `new Date(raw)` exactly as published.
|
|
250
|
+
*/
|
|
251
|
+
private rangeBoundFromValue;
|
|
252
|
+
private parsePresetValue;
|
|
253
|
+
private parseZonedValue;
|
|
114
254
|
/**
|
|
115
255
|
* Function to handle relative date selection
|
|
116
256
|
*/
|
|
@@ -118,6 +258,9 @@ export declare class NileCalendar extends NileElement {
|
|
|
118
258
|
handleUnitChange(event: CustomEvent): void;
|
|
119
259
|
handleTimeValueClick(unit: TimeUnits, value: number, event: any): void;
|
|
120
260
|
createRelativePeriod(unit: String, value: number): {
|
|
261
|
+
startDate: null;
|
|
262
|
+
endDate: null;
|
|
263
|
+
} | {
|
|
121
264
|
startDate: Date;
|
|
122
265
|
endDate: Date;
|
|
123
266
|
};
|
|
@@ -144,6 +287,38 @@ export declare class NileCalendar extends NileElement {
|
|
|
144
287
|
value: any;
|
|
145
288
|
} | null): void;
|
|
146
289
|
private getDaysArray;
|
|
290
|
+
private renderDateTimePicker;
|
|
291
|
+
private renderDateTimePickerAbsolute;
|
|
292
|
+
private renderExpandedCalendar;
|
|
293
|
+
private renderCollapsedMonth;
|
|
294
|
+
private renderVariantMonth;
|
|
295
|
+
private getCollapsedWindowDays;
|
|
296
|
+
private getFullMonthDays;
|
|
297
|
+
/**
|
|
298
|
+
* Arrow keys move by a day / week, Home and End to the week's first and last day, PageUp and PageDown by a month
|
|
299
|
+
* (Shift: a year). The target is clamped to the month's length and to the year range; a day that the collapsed
|
|
300
|
+
* three-week window does not show expands the calendar to reveal it.
|
|
301
|
+
*/
|
|
302
|
+
private handleDayNavigationKey;
|
|
303
|
+
private moveDayFocus;
|
|
304
|
+
private tpSelectDate;
|
|
305
|
+
private resetTimeUnits;
|
|
306
|
+
private renderTimeFields;
|
|
307
|
+
private renderTimeField;
|
|
308
|
+
private get timezoneOptions();
|
|
309
|
+
private renderTimezone;
|
|
310
|
+
private handleTimezoneChange;
|
|
311
|
+
private handleUseLocalTimezone;
|
|
312
|
+
private toggleExpanded;
|
|
313
|
+
private composeLocalTimezoneValue;
|
|
314
|
+
private composeValueISO;
|
|
315
|
+
private wallClockToInstant;
|
|
316
|
+
private zoneOffsetMs;
|
|
317
|
+
private hasSelection;
|
|
318
|
+
private handleSetToNow;
|
|
319
|
+
private handleApply;
|
|
320
|
+
private handleReset;
|
|
321
|
+
private emitDateTimePickerChange;
|
|
147
322
|
}
|
|
148
323
|
export default NileCalendar;
|
|
149
324
|
declare global {
|