@wkly/datetime-picker 12.1.0 → 13.1.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.
Files changed (60) hide show
  1. package/cdk-overlay/package.json +5 -6
  2. package/cdk-overlay/public-api.d.ts +10 -0
  3. package/cdk-overlay/wkly-datetime-picker-cdk-overlay.d.ts +1 -0
  4. package/config.d.ts +3 -0
  5. package/esm2020/cdk-overlay/public-api.mjs +137 -0
  6. package/{esm2015/cdk-overlay/wkly-datetime-picker-cdk-overlay.js → esm2020/cdk-overlay/wkly-datetime-picker-cdk-overlay.mjs} +1 -1
  7. package/esm2020/config.mjs +100 -0
  8. package/esm2020/field.component.mjs +253 -0
  9. package/esm2020/picker.component.mjs +960 -0
  10. package/esm2020/presentation.mjs +303 -0
  11. package/esm2020/public-api.mjs +31 -0
  12. package/{esm2015/wkly-datetime-picker.js → esm2020/wkly-datetime-picker.mjs} +1 -1
  13. package/fesm2015/wkly-datetime-picker-cdk-overlay.mjs +143 -0
  14. package/fesm2015/wkly-datetime-picker-cdk-overlay.mjs.map +1 -0
  15. package/fesm2015/wkly-datetime-picker.mjs +1629 -0
  16. package/fesm2015/wkly-datetime-picker.mjs.map +1 -0
  17. package/fesm2020/wkly-datetime-picker-cdk-overlay.mjs +143 -0
  18. package/fesm2020/wkly-datetime-picker-cdk-overlay.mjs.map +1 -0
  19. package/fesm2020/wkly-datetime-picker.mjs +1627 -0
  20. package/fesm2020/wkly-datetime-picker.mjs.map +1 -0
  21. package/field.component.d.ts +3 -0
  22. package/package.json +34 -14
  23. package/picker.component.d.ts +3 -0
  24. package/presentation.d.ts +7 -0
  25. package/public-api.d.ts +8 -0
  26. package/wkly-datetime-picker.d.ts +1 -1
  27. package/bundles/wkly-datetime-picker-cdk-overlay.umd.js +0 -675
  28. package/bundles/wkly-datetime-picker-cdk-overlay.umd.js.map +0 -1
  29. package/bundles/wkly-datetime-picker.umd.js +0 -2378
  30. package/bundles/wkly-datetime-picker.umd.js.map +0 -1
  31. package/cdk-overlay/public-api.ngfactory.d.ts +0 -3
  32. package/cdk-overlay/wkly-datetime-picker-cdk-overlay.metadata.json +0 -1
  33. package/esm2015/cdk-overlay/public-api.js +0 -127
  34. package/esm2015/cdk-overlay/public-api.ngfactory.js +0 -19
  35. package/esm2015/cdk-overlay/public-api.ngsummary.json +0 -1
  36. package/esm2015/cdk-overlay/wkly-datetime-picker-cdk-overlay.ngsummary.json +0 -1
  37. package/esm2015/config.js +0 -241
  38. package/esm2015/config.ngsummary.json +0 -1
  39. package/esm2015/field.component.css.shim.ngstyle.js +0 -9
  40. package/esm2015/field.component.js +0 -240
  41. package/esm2015/field.component.ngfactory.js +0 -52
  42. package/esm2015/field.component.ngsummary.json +0 -1
  43. package/esm2015/picker.component.js +0 -934
  44. package/esm2015/picker.component.ngfactory.js +0 -137
  45. package/esm2015/picker.component.ngsummary.json +0 -1
  46. package/esm2015/presentation.js +0 -295
  47. package/esm2015/presentation.ngsummary.json +0 -1
  48. package/esm2015/public-api.js +0 -24
  49. package/esm2015/public-api.ngfactory.js +0 -13
  50. package/esm2015/public-api.ngsummary.json +0 -1
  51. package/esm2015/wkly-datetime-picker.ngsummary.json +0 -1
  52. package/fesm2015/wkly-datetime-picker-cdk-overlay.js +0 -134
  53. package/fesm2015/wkly-datetime-picker-cdk-overlay.js.map +0 -1
  54. package/fesm2015/wkly-datetime-picker.js +0 -1720
  55. package/fesm2015/wkly-datetime-picker.js.map +0 -1
  56. package/field.component.css.shim.ngstyle.d.ts +0 -1
  57. package/field.component.ngfactory.d.ts +0 -1
  58. package/picker.component.ngfactory.d.ts +0 -1
  59. package/public-api.ngfactory.d.ts +0 -3
  60. package/wkly-datetime-picker.metadata.json +0 -1
@@ -1,1720 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, EventEmitter, Directive, Input, Output, Component, forwardRef, Inject, LOCALE_ID, PLATFORM_ID, ElementRef, ChangeDetectorRef, ViewChild, Injectable, ComponentFactoryResolver, Injector, ApplicationRef, HostListener, NgModule } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { isPlatformBrowser, getLocaleFirstDayOfWeek, DOCUMENT, CommonModule } from '@angular/common';
5
- import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
6
- import { integer, createWeekGenerator, absoluteWeekOf, firstEpochDayOf, floorMod } from '@wkly/core';
7
- import { WklyGregorianCalendarAdapter, resolveWeekOffset, error, validateSelection, decodeIso, normalizeDigits } from '@wkly/adapters';
8
- import { DEFAULT_OVERSCAN_WEEKS, WklyPickerInputsPropertyKeys, WklyPickerOutputsPropertyKeys, coerceBoolean, resolveWklyTranslation, validateDrafts, draftDayDifference, setDraftDayDifference, calendarMonthBounds, createWeekRows, INPUT_NAMES } from '@wkly/presentation';
9
- export * from '@wkly/presentation';
10
-
11
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15
- return c > 3 && r && Object.defineProperty(target, key, r), r;
16
- };
17
- var __metadata = (this && this.__metadata) || function (k, v) {
18
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19
- };
20
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
21
- const WKLY_CLOCK = new InjectionToken("WKLY_CLOCK", {
22
- providedIn: "root",
23
- factory: () => ({ now: () => new Date() }),
24
- });
25
- const WKLY_CONFIG = new InjectionToken("WKLY_CONFIG", { providedIn: "root", factory: () => ({}) });
26
- const WKLY_LOCALIZATION = new InjectionToken("WKLY_LOCALIZATION", { providedIn: "root", factory: () => ({}) });
27
- const WKLY_TRANSLATIONS = new InjectionToken("WKLY_TRANSLATIONS", { providedIn: "root", factory: () => ({}) });
28
- /** Shared public inputs/outputs inherited by the picker and both trigger directives. */
29
- // Inherited inputs need literal names in published decorator metadata.
30
- class WklyPickerInputs {
31
- constructor() {
32
- this[_a] = "datetime";
33
- this[_b] = null;
34
- this[_d] = "";
35
- this[_e] = null;
36
- this[_f] = {
37
- kind: "full-month",
38
- };
39
- this[_g] = "locale";
40
- this[_h] = false;
41
- this[_j] = 1;
42
- this[_k] = 1;
43
- this[_l] = null;
44
- this[_m] = null;
45
- this[_o] = null;
46
- this[_p] = null;
47
- this[_q] = null;
48
- this[_r] = false;
49
- this[_s] = false;
50
- this[_t] = false;
51
- this[_u] = "locale";
52
- this[_v] = null;
53
- this[_w] = 256;
54
- this[_x] = DEFAULT_OVERSCAN_WEEKS;
55
- this[_y] = null;
56
- this[_z] = null;
57
- this[_0] = null;
58
- this[_1] = true;
59
- this[_2] = [];
60
- this[_3] = null;
61
- this[_4] = new EventEmitter();
62
- this[_5] = new EventEmitter(true);
63
- this[_6] = new EventEmitter();
64
- this[_7] = new EventEmitter();
65
- this[_8] = new EventEmitter(true);
66
- this[_9] = new EventEmitter();
67
- }
68
- }
69
- _a = WklyPickerInputsPropertyKeys.Mode, _b = WklyPickerInputsPropertyKeys.Value, _c = WklyPickerInputsPropertyKeys.CalendarAdapter, _d = WklyPickerInputsPropertyKeys.Locale, _e = WklyPickerInputsPropertyKeys.WeekOffset, _f = WklyPickerInputsPropertyKeys.ViewportPreset, _g = WklyPickerInputsPropertyKeys.HourCycle, _h = WklyPickerInputsPropertyKeys.ShowSeconds, _j = WklyPickerInputsPropertyKeys.MinuteStep, _k = WklyPickerInputsPropertyKeys.SecondStep, _l = WklyPickerInputsPropertyKeys.Min, _m = WklyPickerInputsPropertyKeys.Max, _o = WklyPickerInputsPropertyKeys.IsDateDisabled, _p = WklyPickerInputsPropertyKeys.IsTimeDisabled, _q = WklyPickerInputsPropertyKeys.RangeValidator, _r = WklyPickerInputsPropertyKeys.AllowRangeAcrossDisabled, _s = WklyPickerInputsPropertyKeys.Required, _t = WklyPickerInputsPropertyKeys.Disabled, _u = WklyPickerInputsPropertyKeys.WeekLabelMode, _v = WklyPickerInputsPropertyKeys.WeekLabelFormatter, _w = WklyPickerInputsPropertyKeys.WeekCacheSize, _x = WklyPickerInputsPropertyKeys.OverscanWeeks, _y = WklyPickerInputsPropertyKeys.AriaLabel, _z = WklyPickerInputsPropertyKeys.AriaDescribedBy, _0 = WklyPickerInputsPropertyKeys.InitialEpochDay, _1 = WklyPickerInputsPropertyKeys.CloseOnBackdrop, _2 = WklyPickerInputsPropertyKeys.Validators, _3 = WklyPickerInputsPropertyKeys.Translations, _4 = WklyPickerOutputsPropertyKeys.ValueChange, _5 = WklyPickerOutputsPropertyKeys.ValidationChange, _6 = WklyPickerOutputsPropertyKeys.Opened, _7 = WklyPickerOutputsPropertyKeys.Closed, _8 = WklyPickerOutputsPropertyKeys.ViewportChange, _9 = WklyPickerOutputsPropertyKeys.ViewModeChange;
70
- WklyPickerInputs.decorators = [
71
- { type: Directive, args: [{
72
- inputs: [
73
- "mode",
74
- "value",
75
- "calendarAdapter",
76
- "locale",
77
- "weekOffset",
78
- "viewportPreset",
79
- "hourCycle",
80
- "showSeconds",
81
- "minuteStep",
82
- "secondStep",
83
- "min",
84
- "max",
85
- "isDateDisabled",
86
- "isTimeDisabled",
87
- "rangeValidator",
88
- "allowRangeAcrossDisabled",
89
- "required",
90
- "disabled",
91
- "weekLabelMode",
92
- "weekLabelFormatter",
93
- "weekCacheSize",
94
- "overscanWeeks",
95
- "ariaLabel",
96
- "ariaDescribedBy",
97
- "initialEpochDay",
98
- "closeOnBackdrop",
99
- "validators",
100
- "translations",
101
- ],
102
- outputs: [
103
- "valueChange",
104
- "validationChange",
105
- "opened",
106
- "closed",
107
- "viewportChange",
108
- "viewModeChange",
109
- ],
110
- },] }
111
- ];
112
- __decorate([
113
- Input(),
114
- __metadata("design:type", String)
115
- ], WklyPickerInputs.prototype, _a, void 0);
116
- __decorate([
117
- Input(),
118
- __metadata("design:type", Object)
119
- ], WklyPickerInputs.prototype, _b, void 0);
120
- __decorate([
121
- Input(),
122
- __metadata("design:type", Object)
123
- ], WklyPickerInputs.prototype, _c, void 0);
124
- __decorate([
125
- Input(),
126
- __metadata("design:type", String)
127
- ], WklyPickerInputs.prototype, _d, void 0);
128
- __decorate([
129
- Input(),
130
- __metadata("design:type", Object)
131
- ], WklyPickerInputs.prototype, _e, void 0);
132
- __decorate([
133
- Input(),
134
- __metadata("design:type", Object)
135
- ], WklyPickerInputs.prototype, _f, void 0);
136
- __decorate([
137
- Input(),
138
- __metadata("design:type", String)
139
- ], WklyPickerInputs.prototype, _g, void 0);
140
- __decorate([
141
- Input(),
142
- __metadata("design:type", Boolean)
143
- ], WklyPickerInputs.prototype, _h, void 0);
144
- __decorate([
145
- Input(),
146
- __metadata("design:type", Number)
147
- ], WklyPickerInputs.prototype, _j, void 0);
148
- __decorate([
149
- Input(),
150
- __metadata("design:type", Number)
151
- ], WklyPickerInputs.prototype, _k, void 0);
152
- __decorate([
153
- Input(),
154
- __metadata("design:type", Object)
155
- ], WklyPickerInputs.prototype, _l, void 0);
156
- __decorate([
157
- Input(),
158
- __metadata("design:type", Object)
159
- ], WklyPickerInputs.prototype, _m, void 0);
160
- __decorate([
161
- Input(),
162
- __metadata("design:type", Object)
163
- ], WklyPickerInputs.prototype, _o, void 0);
164
- __decorate([
165
- Input(),
166
- __metadata("design:type", Object)
167
- ], WklyPickerInputs.prototype, _p, void 0);
168
- __decorate([
169
- Input(),
170
- __metadata("design:type", Object)
171
- ], WklyPickerInputs.prototype, _q, void 0);
172
- __decorate([
173
- Input(),
174
- __metadata("design:type", Object)
175
- ], WklyPickerInputs.prototype, _r, void 0);
176
- __decorate([
177
- Input(),
178
- __metadata("design:type", Object)
179
- ], WklyPickerInputs.prototype, _s, void 0);
180
- __decorate([
181
- Input(),
182
- __metadata("design:type", Object)
183
- ], WklyPickerInputs.prototype, _t, void 0);
184
- __decorate([
185
- Input(),
186
- __metadata("design:type", String)
187
- ], WklyPickerInputs.prototype, _u, void 0);
188
- __decorate([
189
- Input(),
190
- __metadata("design:type", Object)
191
- ], WklyPickerInputs.prototype, _v, void 0);
192
- __decorate([
193
- Input(),
194
- __metadata("design:type", Object)
195
- ], WklyPickerInputs.prototype, _w, void 0);
196
- __decorate([
197
- Input(),
198
- __metadata("design:type", Object)
199
- ], WklyPickerInputs.prototype, _x, void 0);
200
- __decorate([
201
- Input(),
202
- __metadata("design:type", Object)
203
- ], WklyPickerInputs.prototype, _y, void 0);
204
- __decorate([
205
- Input(),
206
- __metadata("design:type", Object)
207
- ], WklyPickerInputs.prototype, _z, void 0);
208
- __decorate([
209
- Input(),
210
- __metadata("design:type", Object)
211
- ], WklyPickerInputs.prototype, _0, void 0);
212
- __decorate([
213
- Input(),
214
- __metadata("design:type", Object)
215
- ], WklyPickerInputs.prototype, _1, void 0);
216
- __decorate([
217
- Input(),
218
- __metadata("design:type", Array)
219
- ], WklyPickerInputs.prototype, _2, void 0);
220
- __decorate([
221
- Input(),
222
- __metadata("design:type", Object)
223
- ], WklyPickerInputs.prototype, _3, void 0);
224
- __decorate([
225
- Output(),
226
- __metadata("design:type", Object)
227
- ], WklyPickerInputs.prototype, _4, void 0);
228
- __decorate([
229
- Output(),
230
- __metadata("design:type", Object)
231
- ], WklyPickerInputs.prototype, _5, void 0);
232
- __decorate([
233
- Output(),
234
- __metadata("design:type", Object)
235
- ], WklyPickerInputs.prototype, _6, void 0);
236
- __decorate([
237
- Output(),
238
- __metadata("design:type", Object)
239
- ], WklyPickerInputs.prototype, _7, void 0);
240
- __decorate([
241
- Output(),
242
- __metadata("design:type", Object)
243
- ], WklyPickerInputs.prototype, _8, void 0);
244
- __decorate([
245
- Output(),
246
- __metadata("design:type", Object)
247
- ], WklyPickerInputs.prototype, _9, void 0);
248
-
249
- class WklyDateTimePickerComponent extends WklyPickerInputs {
250
- constructor(defaultLocale, defaults, clock, strings, defaultTranslations, platform, host, changeDetector) {
251
- super();
252
- this.defaultLocale = defaultLocale;
253
- this.defaults = defaults;
254
- this.clock = clock;
255
- this.strings = strings;
256
- this.defaultTranslations = defaultTranslations;
257
- this.host = host;
258
- this.changeDetector = changeDetector;
259
- this.presentation = "inline";
260
- this.viewMode = "calendar";
261
- this.endView = "date";
262
- this.effectiveLocale = "en-US";
263
- this.effectiveOffset = 0;
264
- this.effectiveHourCycle = "h24";
265
- this.direction = "ltr";
266
- this.rows = [];
267
- this.weekdays = [];
268
- this.drafts = [];
269
- this.errors = [];
270
- this.today = 0;
271
- this.focused = 0;
272
- this.anchorWeek = 0;
273
- this.firstWeek = 0;
274
- this.visibleCount = 6;
275
- this.rowHeight = 76;
276
- this.scrollHeight = 152076;
277
- this.paddingTop = 0;
278
- this.initialized = false;
279
- this.compact = false;
280
- this.WklyPickerInputsPropertyKeys = WklyPickerInputsPropertyKeys;
281
- this.baseWeek = 0;
282
- this.firstSupportedDay = 0;
283
- this.lastSupportedDay = 0;
284
- this.firstSupportedWeek = 0;
285
- this.lastSupportedWeek = 0;
286
- this.initialMonth = "";
287
- this.clipMonth = false;
288
- this.browser = false;
289
- this.destroyed = false;
290
- this.snapPending = false;
291
- this.onChange = () => { };
292
- this.onTouched = () => { };
293
- this.validatorChanged = () => { };
294
- this.configErrors = [];
295
- this.pendingValue = null;
296
- this.emittedValue = null;
297
- this.manualDateEndpoint = 0;
298
- this.browser = isPlatformBrowser(platform);
299
- }
300
- ngOnInit() {
301
- this.initialize();
302
- }
303
- ngOnChanges(changes) {
304
- if (this.initialized) {
305
- if (Object.keys(changes).length === 1 &&
306
- changes[WklyPickerInputsPropertyKeys.Value] &&
307
- this.emittedValue ===
308
- JSON.stringify(this[WklyPickerInputsPropertyKeys.Value])) {
309
- this.emittedValue = null;
310
- return;
311
- }
312
- const focus = this.focused;
313
- this.configure();
314
- if (changes[WklyPickerInputsPropertyKeys.Value] ||
315
- changes[WklyPickerInputsPropertyKeys.Mode] ||
316
- changes[WklyPickerInputsPropertyKeys.CalendarAdapter]) {
317
- this.load(this[WklyPickerInputsPropertyKeys.Value]);
318
- this.position(this.focused, true);
319
- }
320
- else {
321
- this.check();
322
- if (changes[WklyPickerInputsPropertyKeys.ViewportPreset])
323
- this.position(focus, true);
324
- else
325
- this.scrollToEpochDay(focus);
326
- }
327
- }
328
- }
329
- initialize() {
330
- if (this.initialized)
331
- return;
332
- this.configure();
333
- const initialEpochDay = this[WklyPickerInputsPropertyKeys.InitialEpochDay];
334
- this.today = this.browser
335
- ? Math.floor(this.clock.now().getTime() / 86400000)
336
- : initialEpochDay === null
337
- ? 0
338
- : initialEpochDay;
339
- this.focused =
340
- initialEpochDay === null
341
- ? this.defaults.initialEpochDay === undefined
342
- ? this.today
343
- : this.defaults.initialEpochDay
344
- : initialEpochDay;
345
- this.load(this[WklyPickerInputsPropertyKeys.Value]);
346
- this.initialized = true;
347
- this.position(this.focused, true);
348
- }
349
- configure() {
350
- this.configErrors = [];
351
- [
352
- WklyPickerInputsPropertyKeys.ShowSeconds,
353
- WklyPickerInputsPropertyKeys.AllowRangeAcrossDisabled,
354
- WklyPickerInputsPropertyKeys.Required,
355
- WklyPickerInputsPropertyKeys.Disabled,
356
- WklyPickerInputsPropertyKeys.CloseOnBackdrop,
357
- ].forEach((key) => (this[key] = coerceBoolean(this[key])));
358
- this.effectiveLocale =
359
- this[WklyPickerInputsPropertyKeys.Locale] ||
360
- this.defaults.locale ||
361
- this.defaultLocale;
362
- this.direction = /^(ar|he|fa|ur)(-|$)/.test(this.effectiveLocale)
363
- ? "rtl"
364
- : "ltr";
365
- this.adapter =
366
- this[WklyPickerInputsPropertyKeys.CalendarAdapter] ||
367
- new WklyGregorianCalendarAdapter(this.effectiveLocale);
368
- try {
369
- let firstDay;
370
- try {
371
- firstDay = getLocaleFirstDayOfWeek(this.effectiveLocale);
372
- }
373
- catch (_) { }
374
- this.effectiveOffset = resolveWeekOffset(this.effectiveLocale, this[WklyPickerInputsPropertyKeys.WeekOffset], this.defaults.weekOffset, firstDay);
375
- integer(this[WklyPickerInputsPropertyKeys.WeekCacheSize]);
376
- integer(this[WklyPickerInputsPropertyKeys.OverscanWeeks]);
377
- if (this[WklyPickerInputsPropertyKeys.WeekCacheSize] < 0 ||
378
- this[WklyPickerInputsPropertyKeys.OverscanWeeks] < 0 ||
379
- this[WklyPickerInputsPropertyKeys.OverscanWeeks] > 50)
380
- throw new RangeError();
381
- if (![
382
- "datetime",
383
- "date",
384
- "time",
385
- "datetime-range",
386
- "date-range",
387
- "time-range",
388
- ].includes(this[WklyPickerInputsPropertyKeys.Mode]))
389
- throw new RangeError();
390
- const preset = this[WklyPickerInputsPropertyKeys.ViewportPreset];
391
- if (preset.kind === "weeks") {
392
- integer(preset.visibleWeekCount);
393
- if (preset.visibleWeekCount < 1 || preset.visibleWeekCount > 52)
394
- throw new RangeError();
395
- }
396
- if (preset.kind === "full-month-and-around")
397
- for (const n of [
398
- preset.extraWeeksBefore || 0,
399
- preset.extraWeeksAfter || 0,
400
- ]) {
401
- integer(n);
402
- if (n < 0 || n > 52)
403
- throw new RangeError();
404
- }
405
- this.generator = createWeekGenerator({
406
- weekOffset: this.effectiveOffset,
407
- cacheSize: this[WklyPickerInputsPropertyKeys.WeekCacheSize],
408
- });
409
- }
410
- catch (_) {
411
- this.configErrors.push(error("configuration-error", this[WklyPickerInputsPropertyKeys.WeekOffset]));
412
- this.generator = createWeekGenerator();
413
- this.effectiveOffset = 0;
414
- }
415
- this.setSupportedScrollRange();
416
- const hourCycle = this[WklyPickerInputsPropertyKeys.HourCycle];
417
- // Host value/configuration feedback must retain the user's switchable format.
418
- if (hourCycle !== "switchable" || this.configuredHourCycle !== hourCycle) {
419
- this.effectiveHourCycle =
420
- hourCycle === "h12"
421
- ? "h12"
422
- : hourCycle === "locale"
423
- ? new Intl.DateTimeFormat(this.effectiveLocale, {
424
- hour: "numeric",
425
- timeZone: "UTC",
426
- }).resolvedOptions().hour12
427
- ? "h12"
428
- : "h24"
429
- : "h24";
430
- }
431
- this.configuredHourCycle = hourCycle;
432
- this.weekdays = Array.from({ length: 7 }, (_, i) => this.adapter.formatWeekday(this.effectiveOffset + i, "short"));
433
- }
434
- setSupportedScrollRange() {
435
- let [first, last] = this.adapter.supportedEpochDayRange;
436
- const [firstYear, lastYear] = this.adapter.supportedYearRange;
437
- const yearOf = (day) => this.adapter.epochDayToDate(day).year;
438
- if (yearOf(first) < firstYear) {
439
- let low = first, high = last;
440
- while (low < high) {
441
- const mid = Math.floor((low + high) / 2);
442
- if (yearOf(mid) < firstYear)
443
- low = mid + 1;
444
- else
445
- high = mid;
446
- }
447
- first = low;
448
- }
449
- if (yearOf(last) > lastYear) {
450
- let low = first, high = last;
451
- while (low < high) {
452
- const mid = Math.ceil((low + high) / 2);
453
- if (yearOf(mid) > lastYear)
454
- high = mid - 1;
455
- else
456
- low = mid;
457
- }
458
- last = low;
459
- }
460
- if (first > last ||
461
- yearOf(first) < firstYear ||
462
- yearOf(first) > lastYear ||
463
- yearOf(last) < firstYear ||
464
- yearOf(last) > lastYear)
465
- throw new RangeError("No supported days within the calendar year range");
466
- this.firstSupportedDay = first;
467
- this.lastSupportedDay = last;
468
- this.firstSupportedWeek = absoluteWeekOf(first, this.effectiveOffset);
469
- this.lastSupportedWeek = absoluteWeekOf(last, this.effectiveOffset);
470
- }
471
- clampFirstWeek(week) {
472
- // Keep supported weeks inside the viewport; renderRows adds the buffer rows.
473
- const last = Math.max(this.firstSupportedWeek, this.lastSupportedWeek - this.visibleCount + 1);
474
- return Math.max(this.firstSupportedWeek, Math.min(last, week));
475
- }
476
- ngAfterViewInit() {
477
- this.resetScroll();
478
- if (this.browser && typeof ResizeObserver !== "undefined") {
479
- this.observer = new ResizeObserver(() => {
480
- this.compact = this.host.nativeElement.clientWidth < 338;
481
- const row = this.host.nativeElement.querySelector(".week-row");
482
- // CSS heights and scrollTop use layout pixels; client rectangles include zoom.
483
- const height = row ? parseFloat(getComputedStyle(row).height) : 0;
484
- if (height && height !== this.rowHeight) {
485
- this.rowHeight = height;
486
- this.scrollHeight = this.rowHeight * 2001;
487
- this.renderRows();
488
- this.resetScroll();
489
- }
490
- });
491
- this.observer.observe(this.host.nativeElement);
492
- }
493
- }
494
- ngOnDestroy() {
495
- this.destroyed = true;
496
- if (this.observer)
497
- this.observer.disconnect();
498
- if (this.scrollEndTimer)
499
- clearTimeout(this.scrollEndTimer);
500
- if (this.generator)
501
- this.generator.clearCache();
502
- }
503
- t(key) {
504
- return resolveWklyTranslation(key, this.effectiveLocale, this[WklyPickerInputsPropertyKeys.Translations] ||
505
- this.defaultTranslations, this.strings);
506
- }
507
- get isRange() {
508
- return this[WklyPickerInputsPropertyKeys.Mode].endsWith("-range");
509
- }
510
- get hasDate() {
511
- return !this[WklyPickerInputsPropertyKeys.Mode].startsWith("time");
512
- }
513
- get hasTime() {
514
- return (this[WklyPickerInputsPropertyKeys.Mode] !== "date" &&
515
- this[WklyPickerInputsPropertyKeys.Mode] !== "date-range");
516
- }
517
- get submitVisible() {
518
- return (this.presentation === "transient" &&
519
- (this[WklyPickerInputsPropertyKeys.Mode] !== "date" ||
520
- this.viewMode === "manual"));
521
- }
522
- get title() {
523
- try {
524
- const d = this.adapter.epochDayToDate(Math.max(this.firstSupportedDay, Math.min(this.lastSupportedDay, firstEpochDayOf(this.anchorWeek, this.effectiveOffset))));
525
- return this.adapter.formatMonth(d) + " " + this.adapter.formatYear(d);
526
- }
527
- catch (_) {
528
- return "";
529
- }
530
- }
531
- get canSubmit() {
532
- return (!this[WklyPickerInputsPropertyKeys.Disabled] &&
533
- !this.errors.length &&
534
- this.pendingValue !== null);
535
- }
536
- blank(day) {
537
- const safe = Math.max(this.firstSupportedDay, Math.min(this.lastSupportedDay, day));
538
- return {
539
- date: this.adapter.epochDayToDate(safe),
540
- hour: 0,
541
- minute: 0,
542
- second: 0,
543
- present: false,
544
- };
545
- }
546
- load(value) {
547
- this.drafts = [this.blank(this.focused), this.blank(this.focused)];
548
- const validation = validateSelection(value, this, this.adapter);
549
- if (value !== null && !validation.length) {
550
- const values = typeof value === "string" ? [value] : value;
551
- values.forEach((v, i) => {
552
- const d = decodeIso(v);
553
- this.drafts[i] = {
554
- date: this.hasDate
555
- ? this.adapter.epochDayToDate(d.epochDay)
556
- : this.blank(this.today).date,
557
- hour: d.hour,
558
- minute: d.minute,
559
- second: d.second,
560
- present: true,
561
- };
562
- if (i === 0 && this.hasDate)
563
- this.focused = d.epochDay;
564
- });
565
- }
566
- if (validation.length) {
567
- this.pendingValue = null;
568
- this.report(validation);
569
- }
570
- else
571
- this.check();
572
- }
573
- writeValue(value) {
574
- this[WklyPickerInputsPropertyKeys.Value] = value;
575
- if (this.initialized) {
576
- this.load(value);
577
- this.position(this.focused, true);
578
- }
579
- }
580
- registerOnChange(fn) {
581
- this.onChange = fn;
582
- }
583
- registerOnTouched(fn) {
584
- this.onTouched = fn;
585
- }
586
- setDisabledState(disabled) {
587
- this[WklyPickerInputsPropertyKeys.Disabled] = disabled;
588
- }
589
- validate(_control) {
590
- return this.errors.length ? { wkly: this.errors } : null;
591
- }
592
- registerOnValidatorChange(fn) {
593
- this.validatorChanged = fn;
594
- }
595
- touched() {
596
- Promise.resolve().then(() => this.onTouched());
597
- }
598
- report(errors) {
599
- const changed = JSON.stringify(this.errors) !== JSON.stringify(errors);
600
- this.errors = errors;
601
- if (changed) {
602
- this[WklyPickerOutputsPropertyKeys.ValidationChange].emit(errors);
603
- this.validatorChanged();
604
- }
605
- }
606
- check() {
607
- const result = validateDrafts({
608
- drafts: this.drafts,
609
- configErrors: this.configErrors,
610
- adapter: this.adapter,
611
- selection: this,
612
- mode: this[WklyPickerInputsPropertyKeys.Mode],
613
- isRange: this.isRange,
614
- hasDate: this.hasDate,
615
- hasTime: this.hasTime,
616
- showSeconds: this[WklyPickerInputsPropertyKeys.ShowSeconds],
617
- required: this[WklyPickerInputsPropertyKeys.Required],
618
- });
619
- this.pendingValue = result.pendingValue;
620
- this.report(result.errors);
621
- }
622
- trackDraft(index) {
623
- // Endpoint controls keep their identity and focus when draft objects swap.
624
- return index;
625
- }
626
- orderDrafts() {
627
- if (!this.isRange || !this.drafts.every((draft) => draft.present))
628
- return;
629
- if (this.drafts.some((draft) => draft.unsupportedEpochDay !== undefined))
630
- return;
631
- try {
632
- const a = this.drafts[0], b = this.drafts[1];
633
- const key = (d) => this.adapter.dateToEpochDay(d.date) * 86400 +
634
- (d.hour || 0) * 3600 +
635
- (d.minute || 0) * 60 +
636
- (d.second || 0);
637
- if (key(a) > key(b))
638
- this.drafts = [b, a];
639
- }
640
- catch (_) {
641
- // Impossible or incomplete dates remain editable until corrected.
642
- }
643
- }
644
- finish() {
645
- if (this[WklyPickerInputsPropertyKeys.Disabled])
646
- return;
647
- this.orderDrafts();
648
- if (this.viewMode === "manual" && this.hasDate)
649
- this.positionOnManualDate();
650
- this.check();
651
- if (this.presentation === "inline" && this.canSubmit)
652
- this.commit();
653
- }
654
- commit() {
655
- if (!this.canSubmit)
656
- return;
657
- const next = this.pendingValue;
658
- if (JSON.stringify(next) !==
659
- JSON.stringify(this[WklyPickerInputsPropertyKeys.Value])) {
660
- this[WklyPickerInputsPropertyKeys.Value] = next;
661
- this.emittedValue = JSON.stringify(next);
662
- this.onChange(next);
663
- this[WklyPickerOutputsPropertyKeys.ValueChange].emit(next);
664
- }
665
- this.onTouched();
666
- }
667
- submit(reason = "submit") {
668
- this.check();
669
- if (!this.canSubmit)
670
- return;
671
- this.commit();
672
- if (this.presentation === "transient")
673
- this[WklyPickerOutputsPropertyKeys.Closed].emit(reason);
674
- }
675
- cancel(reason = "close-button") {
676
- if (this[WklyPickerInputsPropertyKeys.Disabled])
677
- return;
678
- this.load(this[WklyPickerInputsPropertyKeys.Value]);
679
- this.onTouched();
680
- this[WklyPickerOutputsPropertyKeys.Closed].emit(reason);
681
- }
682
- now() {
683
- if (this[WklyPickerInputsPropertyKeys.Disabled])
684
- return;
685
- const n = this.clock.now();
686
- const day = Math.floor(n.getTime() / 86400000);
687
- this.drafts = [0, 1].map((index) => (Object.assign(Object.assign({}, this.clockDraft(day, n)), { present: index === 0 || this.isRange })));
688
- if (this.hasDate &&
689
- (day < this.firstSupportedDay || day > this.lastSupportedDay)) {
690
- this.report([error("unsupported-adapter-date", day)]);
691
- return;
692
- }
693
- this.focused = day;
694
- this.position(day, true);
695
- this.check();
696
- this.submit("now");
697
- }
698
- clockDraft(day, now) {
699
- return Object.assign(Object.assign({}, this.blank(day)), { hour: now.getUTCHours(), minute: Math.floor(now.getUTCMinutes() / this[WklyPickerInputsPropertyKeys.MinuteStep]) * this[WklyPickerInputsPropertyKeys.MinuteStep], second: this[WklyPickerInputsPropertyKeys.ShowSeconds]
700
- ? Math.floor(now.getUTCSeconds() / this[WklyPickerInputsPropertyKeys.SecondStep]) * this[WklyPickerInputsPropertyKeys.SecondStep]
701
- : 0 });
702
- }
703
- initializeManualRange() {
704
- if (!this.isRange ||
705
- !this.hasDate ||
706
- this.drafts.every((draft) => draft.present))
707
- return;
708
- let seed = this.drafts.find((draft) => draft.present);
709
- if (!seed) {
710
- if (this[WklyPickerInputsPropertyKeys.Value] !== null)
711
- return;
712
- const now = this.clock.now();
713
- const initialEpochDay = this[WklyPickerInputsPropertyKeys.InitialEpochDay];
714
- const day = initialEpochDay === null
715
- ? this.defaults.initialEpochDay === undefined
716
- ? Math.floor(now.getTime() / 86400000)
717
- : this.defaults.initialEpochDay
718
- : initialEpochDay;
719
- seed = Object.assign(Object.assign({}, this.clockDraft(day, now)), { present: true });
720
- }
721
- // Complete missing endpoints without replacing selected or invalid drafts.
722
- const initial = seed;
723
- this.drafts = this.drafts.map((draft) => draft.present ? draft : Object.assign(Object.assign({}, initial), { date: Object.assign({}, initial.date) }));
724
- this.finish();
725
- // Positioning renders before validation; refresh completion controls afterward.
726
- this.changeDetector.markForCheck();
727
- }
728
- toggleView() {
729
- if (this[WklyPickerInputsPropertyKeys.Disabled] || !this.hasDate)
730
- return;
731
- this.viewMode = this.viewMode === "calendar" ? "manual" : "calendar";
732
- if (this.viewMode === "manual")
733
- this.initializeManualRange();
734
- if (this.viewMode === "calendar")
735
- this.positionOnManualDate();
736
- this[WklyPickerOutputsPropertyKeys.ViewModeChange].emit(this.viewMode);
737
- if (this.viewMode === "calendar")
738
- setTimeout(() => this.resetScroll());
739
- }
740
- positionOnManualDate() {
741
- const draft = this.drafts[this.manualDateEndpoint];
742
- if (!draft || !draft.present)
743
- return;
744
- try {
745
- // A valid day follows the selection. An impossible day keeps its draft
746
- // fields but still shows the chosen month in the calendar.
747
- const target = this.adapter.dateToEpochDay(draft.date);
748
- this.focused = target;
749
- this.position(target, true);
750
- }
751
- catch (_) {
752
- try {
753
- const first = this.adapter.dateToEpochDay(Object.assign(Object.assign({}, draft.date), { day: 1 }));
754
- this.focused = first;
755
- this.position(first, true);
756
- }
757
- catch (_) { }
758
- }
759
- }
760
- months(draft) {
761
- try {
762
- return this.adapter.getMonths(draft.date.year).map((m) => m.label);
763
- }
764
- catch (_) {
765
- return [];
766
- }
767
- }
768
- monthCount(draft) {
769
- return this.months(draft).length || 12;
770
- }
771
- get inDays() {
772
- return draftDayDifference(this.drafts, this.adapter);
773
- }
774
- get inDaysLabel() {
775
- const days = this.inDays;
776
- return this.t("inDays").replace(/{{\s*days\s*}}/g, days === null
777
- ? this.t("daysUnavailable")
778
- : new Intl.NumberFormat(this.effectiveLocale, {
779
- useGrouping: false,
780
- }).format(days));
781
- }
782
- get resultingEndDate() {
783
- try {
784
- const draft = this.drafts[1];
785
- if (draft.unsupportedEpochDay !== undefined ||
786
- this.adapter.validateDate(draft.date).length)
787
- return "";
788
- return [
789
- this.adapter.formatDay(draft.date),
790
- this.adapter.formatMonth(draft.date),
791
- this.adapter.formatYear(draft.date),
792
- ].join(" ");
793
- }
794
- catch (_) {
795
- return "";
796
- }
797
- }
798
- toggleEndView(view) {
799
- if (this[WklyPickerInputsPropertyKeys.Disabled])
800
- return;
801
- this.endView = view;
802
- }
803
- days(value) {
804
- if (this[WklyPickerInputsPropertyKeys.Disabled])
805
- return;
806
- this.manualDateEndpoint = 1;
807
- setDraftDayDifference(this.drafts, this.adapter, value);
808
- this.check();
809
- }
810
- field(index, field, value) {
811
- if (this[WklyPickerInputsPropertyKeys.Disabled])
812
- return;
813
- const draft = this.drafts[index];
814
- draft.present = true;
815
- if (field === "day" || field === "year" || field === "month") {
816
- this.manualDateEndpoint = index;
817
- delete draft.unsupportedEpochDay;
818
- let date = Object.assign(Object.assign({}, draft.date), { [field]: value });
819
- if (field === "month") {
820
- let month;
821
- try {
822
- month = this.adapter
823
- .getMonths(date.year)
824
- .find((m) => m.month === value);
825
- }
826
- catch (_) { }
827
- date = Object.assign(Object.assign({}, date), { monthCode: month ? month.monthCode : "" });
828
- }
829
- if (field === "year" && value !== null) {
830
- try {
831
- const months = this.adapter.getMonths(value);
832
- const month = months.find((m) => m.monthCode === date.monthCode);
833
- if (month)
834
- date = Object.assign(Object.assign({}, date), { month: month.month });
835
- }
836
- catch (_) { }
837
- }
838
- draft.date = date;
839
- }
840
- else if (field === "hour" && this.effectiveHourCycle === "h12")
841
- draft.hour =
842
- value === null
843
- ? null
844
- : value >= 1 && value <= 12
845
- ? (value % 12) + ((draft.hour || 0) >= 12 ? 12 : 0)
846
- : 24 + value;
847
- else
848
- draft[field] = value;
849
- this.check();
850
- }
851
- displayHour(draft) {
852
- return draft.hour === null
853
- ? null
854
- : this.effectiveHourCycle === "h12"
855
- ? draft.hour % 12 || 12
856
- : draft.hour;
857
- }
858
- period(index, period) {
859
- if (this[WklyPickerInputsPropertyKeys.Disabled])
860
- return;
861
- if (period === "24")
862
- this.effectiveHourCycle = "h24";
863
- else {
864
- this.effectiveHourCycle = "h12";
865
- this.drafts[index].hour =
866
- ((this.drafts[index].hour || 0) % 12) + (period === "pm" ? 12 : 0);
867
- this.drafts[index].present = true;
868
- this.finish();
869
- }
870
- }
871
- selected(day) {
872
- return this.drafts.some((d) => {
873
- try {
874
- return d.present && this.adapter.dateToEpochDay(d.date) === day;
875
- }
876
- catch (_) {
877
- return false;
878
- }
879
- });
880
- }
881
- inRange(day) {
882
- if (!this.isRange || !this.drafts.every((d) => d.present))
883
- return false;
884
- try {
885
- const a = this.adapter.dateToEpochDay(this.drafts[0].date), b = this.adapter.dateToEpochDay(this.drafts[1].date);
886
- return day > Math.min(a, b) && day < Math.max(a, b);
887
- }
888
- catch (_) {
889
- return false;
890
- }
891
- }
892
- dayDisabled(day) {
893
- var _a, _b;
894
- if (day < this.firstSupportedDay || day > this.lastSupportedDay)
895
- return true;
896
- try {
897
- const date = this.adapter.epochDayToDate(day);
898
- const isDateDisabled = this[WklyPickerInputsPropertyKeys.IsDateDisabled];
899
- if (isDateDisabled &&
900
- isDateDisabled(day, {
901
- mode: this[WklyPickerInputsPropertyKeys.Mode],
902
- endpoint: this.isRange
903
- ? ((_a = this.drafts[0]) === null || _a === void 0 ? void 0 : _a.present) && !((_b = this.drafts[1]) === null || _b === void 0 ? void 0 : _b.present)
904
- ? "end"
905
- : "start"
906
- : "single",
907
- calendarDate: date,
908
- }))
909
- return true;
910
- const min = this[WklyPickerInputsPropertyKeys.Min];
911
- const max = this[WklyPickerInputsPropertyKeys.Max];
912
- if (min && day < decodeIso(min).epochDay)
913
- return true;
914
- if (max && day > decodeIso(max).epochDay)
915
- return true;
916
- return false;
917
- }
918
- catch (_) {
919
- return true;
920
- }
921
- }
922
- select(day) {
923
- if (this[WklyPickerInputsPropertyKeys.Disabled] || this.dayDisabled(day))
924
- return;
925
- this.focused = day;
926
- const index = this.isRange && this.drafts[0].present && !this.drafts[1].present ? 1 : 0;
927
- if (this.isRange && index === 0)
928
- this.drafts[1].present = false;
929
- delete this.drafts[index].unsupportedEpochDay;
930
- this.drafts[index].date = this.adapter.epochDayToDate(day);
931
- this.drafts[index].present = true;
932
- this.orderDrafts();
933
- this.renderRows();
934
- this.finish();
935
- if (this.presentation === "transient" &&
936
- this[WklyPickerInputsPropertyKeys.Mode] === "date" &&
937
- this.viewMode === "calendar")
938
- this.submit("auto-submit");
939
- }
940
- key(event, day) {
941
- let delta = 0;
942
- if (event.key === "ArrowLeft")
943
- delta = -1;
944
- if (event.key === "ArrowRight")
945
- delta = 1;
946
- if (event.key === "ArrowUp")
947
- delta = -7;
948
- if (event.key === "ArrowDown")
949
- delta = 7;
950
- if (event.key === "PageUp")
951
- delta = -7 * (event.shiftKey ? this.visibleCount : 1);
952
- if (event.key === "PageDown")
953
- delta = 7 * (event.shiftKey ? this.visibleCount : 1);
954
- if (event.key === "Home") {
955
- event.preventDefault();
956
- this.scrollToEpochDay(this.today, { focus: true });
957
- }
958
- if (delta) {
959
- event.preventDefault();
960
- const target = day + delta;
961
- if (target >= this.firstSupportedDay && target <= this.lastSupportedDay)
962
- this.scrollToEpochDay(target, { focus: true });
963
- }
964
- }
965
- position(day, preset = false, options = {}) {
966
- day = Math.max(this.firstSupportedDay, Math.min(this.lastSupportedDay, day));
967
- this.anchorWeek = absoluteWeekOf(day, this.effectiveOffset);
968
- const viewportPreset = this[WklyPickerInputsPropertyKeys.ViewportPreset];
969
- this.clipMonth = preset && viewportPreset.kind === "full-month";
970
- if (preset && viewportPreset.kind !== "weeks") {
971
- const d = this.adapter.epochDayToDate(day);
972
- this.initialMonth = d.year + "/" + d.monthCode;
973
- const [start, end] = calendarMonthBounds(this.adapter, day);
974
- this.firstWeek = absoluteWeekOf(start, this.effectiveOffset);
975
- this.visibleCount =
976
- absoluteWeekOf(end, this.effectiveOffset) - this.firstWeek + 1;
977
- if (viewportPreset.kind === "full-month-and-around" &&
978
- !this.configErrors.length) {
979
- const before = viewportPreset.extraWeeksBefore || 0, after = viewportPreset.extraWeeksAfter || 0;
980
- this.firstWeek -= before;
981
- this.visibleCount += before + after;
982
- }
983
- }
984
- else {
985
- if (viewportPreset.kind === "weeks")
986
- this.visibleCount = this.configErrors.length
987
- ? 6
988
- : viewportPreset.visibleWeekCount;
989
- this.firstWeek =
990
- this.anchorWeek -
991
- (options.align === "start"
992
- ? 0
993
- : options.align === "end"
994
- ? this.visibleCount - 1
995
- : Math.floor(this.visibleCount / 2));
996
- }
997
- this.firstWeek = this.clampFirstWeek(this.firstWeek);
998
- this.baseWeek = this.firstWeek - 1000;
999
- this.renderRows();
1000
- // Apply the new runway before writing scrollTop or locating a focus target.
1001
- this.changeDetector.detectChanges();
1002
- this.resetScroll();
1003
- }
1004
- resetScroll() {
1005
- // Round week boundaries to avoid scrollTop truncation under CSS zoom.
1006
- if (this.scroller)
1007
- this.scroller.nativeElement.scrollTop = Math.round(1000 * this.rowHeight);
1008
- }
1009
- scroll(event) {
1010
- const element = event.target;
1011
- this.snapPending = true;
1012
- this.scheduleSnap();
1013
- // Quantize displacement around the reset point, equally in both directions.
1014
- const relativeRows = element.scrollTop / this.rowHeight - 1000;
1015
- const index = 1000 + Math.sign(relativeRows) * Math.round(Math.abs(relativeRows));
1016
- const requestedFirst = this.baseWeek + index;
1017
- const first = this.clampFirstWeek(requestedFirst);
1018
- if (requestedFirst !== first) {
1019
- element.scrollTop = Math.round((first - this.baseWeek) * this.rowHeight);
1020
- }
1021
- if (first === this.firstWeek)
1022
- return;
1023
- this.clipMonth = false;
1024
- this.firstWeek = first;
1025
- this.anchorWeek = first + Math.floor(this.visibleCount / 2);
1026
- if (index < 100 || index > 1900) {
1027
- // Preserve signed displacement from this week; modulo turns fractional
1028
- // rounding just below a boundary into almost a full row after rebasing.
1029
- const offset = element.scrollTop - (first - this.baseWeek) * this.rowHeight;
1030
- this.baseWeek = first - 1000;
1031
- element.scrollTop = Math.round(1000 * this.rowHeight + offset);
1032
- }
1033
- this.renderRows();
1034
- }
1035
- scheduleSnap() {
1036
- if (this.scrollEndTimer)
1037
- clearTimeout(this.scrollEndTimer);
1038
- this.scrollEndTimer = setTimeout(() => this.snapWeek(), 200);
1039
- }
1040
- snapWeek() {
1041
- if (this.scrollEndTimer)
1042
- clearTimeout(this.scrollEndTimer);
1043
- this.scrollEndTimer = undefined;
1044
- if (!this.snapPending || !this.scroller)
1045
- return;
1046
- this.snapPending = false;
1047
- // Align the current virtual week without rebuilding or rebasing its rows.
1048
- const element = this.scroller.nativeElement;
1049
- const target = Math.round((this.firstWeek - this.baseWeek) * this.rowHeight);
1050
- if (element.scrollTop !== target)
1051
- element.scrollTop = target;
1052
- }
1053
- showFirstWeek(week) {
1054
- const first = this.clampFirstWeek(week);
1055
- if (first === this.firstWeek)
1056
- return;
1057
- this.clipMonth = false;
1058
- this.firstWeek = first;
1059
- this.anchorWeek = first + Math.floor(this.visibleCount / 2);
1060
- this.baseWeek = first - 1000;
1061
- this.renderRows();
1062
- this.resetScroll();
1063
- }
1064
- canMoveWeek(delta) {
1065
- return this.clampFirstWeek(this.firstWeek + delta) !== this.firstWeek;
1066
- }
1067
- moveWeek(delta) {
1068
- if (!this[WklyPickerInputsPropertyKeys.Disabled])
1069
- this.showFirstWeek(this.firstWeek + delta);
1070
- }
1071
- renderRows() {
1072
- // Keep the virtual scroll offset here; row data is shared across Angular versions.
1073
- const overscan = Math.max(0, Math.min(50, this[WklyPickerInputsPropertyKeys.OverscanWeeks] || 0));
1074
- const start = this.firstWeek - overscan;
1075
- this.paddingTop = (start - this.baseWeek) * this.rowHeight;
1076
- this.rows = createWeekRows({
1077
- generator: this.generator,
1078
- adapter: this.adapter,
1079
- startWeek: start,
1080
- count: this.visibleCount + 2 * overscan,
1081
- firstVisibleWeek: this.firstWeek,
1082
- firstSupportedDay: this.firstSupportedDay,
1083
- lastSupportedDay: this.lastSupportedDay,
1084
- clipMonth: this.clipMonth,
1085
- initialMonth: this.initialMonth,
1086
- weekLabelMode: this[WklyPickerInputsPropertyKeys.WeekLabelMode],
1087
- weekLabelFormatter: this[WklyPickerInputsPropertyKeys.WeekLabelFormatter] || null,
1088
- isDayDisabled: (day) => this.dayDisabled(day),
1089
- });
1090
- this[WklyPickerOutputsPropertyKeys.ViewportChange].emit({
1091
- firstVisibleAbsoluteWeek: this.firstWeek,
1092
- lastVisibleAbsoluteWeek: this.firstWeek + this.visibleCount - 1,
1093
- anchorAbsoluteWeek: this.anchorWeek,
1094
- });
1095
- }
1096
- // Retain day DOM nodes and keyboard focus when row metadata is regenerated.
1097
- trackCell(_i, cell) {
1098
- return cell.epochDay;
1099
- }
1100
- trackRow(_i, row) {
1101
- return row.week.absoluteWeek;
1102
- }
1103
- scrollToEpochDay(day, options = {}) {
1104
- integer(day);
1105
- this.adapter.epochDayToDate(day);
1106
- day = Math.max(this.firstSupportedDay, Math.min(this.lastSupportedDay, day));
1107
- // position renders synchronously; publish the tab stop before that render.
1108
- if (options.focus)
1109
- this.focused = day;
1110
- this.position(day, false, options);
1111
- if (options.select)
1112
- this.select(day);
1113
- if (options.focus)
1114
- this.focusDay();
1115
- }
1116
- scrollToAbsoluteWeek(week, options = {}) {
1117
- // A boundary week can start before the adapter's first supported day.
1118
- const first = firstEpochDayOf(week, this.effectiveOffset);
1119
- this.scrollToEpochDay(week === this.firstSupportedWeek
1120
- ? Math.max(first, this.firstSupportedDay)
1121
- : first, options);
1122
- }
1123
- scrollToCalendarDate(date, options = {}) {
1124
- this.scrollToEpochDay(this.adapter.dateToEpochDay(date), options);
1125
- }
1126
- scrollToValue(value, options = {}) {
1127
- this.scrollToEpochDay(decodeIso(value).epochDay, options);
1128
- }
1129
- focusDay() {
1130
- if (!this.browser)
1131
- return;
1132
- setTimeout(() => {
1133
- var _a;
1134
- if (this.destroyed)
1135
- return;
1136
- this.changeDetector.detectChanges();
1137
- const day = this.host.nativeElement.querySelector('[data-day="' + this.focused + '"]');
1138
- const fallback = this.host.nativeElement.querySelector("button:not(:disabled),input:not(:disabled)");
1139
- (_a = (day || fallback)) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
1140
- });
1141
- }
1142
- }
1143
- WklyDateTimePickerComponent.decorators = [
1144
- { type: Component, args: [{
1145
- selector: "wkly-datetime-picker",
1146
- template: "<section\n class=\"wkly\"\n [attr.dir]=\"direction\"\n [attr.aria-label]=\"\n this[WklyPickerInputsPropertyKeys.AriaLabel] || 'Date and time picker'\n \"\n [attr.aria-describedby]=\"this[WklyPickerInputsPropertyKeys.AriaDescribedBy]\"\n (focusout)=\"touched()\"\n>\n <header class=\"toolbar\">\n <button\n *ngIf=\"hasDate\"\n type=\"button\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [attr.aria-label]=\"t(viewMode === 'calendar' ? 'manual' : 'calendar')\"\n (click)=\"toggleView()\"\n >\n {{ viewMode === \"calendar\" ? \"\u2637\" : \"\u25A6\" }}\n </button>\n <span *ngIf=\"hasDate\" class=\"year-control\">{{ title }}</span>\n <span class=\"spacer\"></span\n ><button\n type=\"button\"\n class=\"now\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n (click)=\"now()\"\n >\n {{ t(\"now\") }}\n </button>\n <button\n *ngIf=\"presentation === 'transient'\"\n type=\"button\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [attr.aria-label]=\"t('close')\"\n (click)=\"cancel()\"\n >\n \u00D7\n </button>\n </header>\n <ng-container *ngIf=\"hasDate && viewMode === 'calendar'\">\n <div\n role=\"grid\"\n [attr.aria-label]=\"\n this[WklyPickerInputsPropertyKeys.AriaLabel] || 'Calendar'\n \"\n [attr.aria-multiselectable]=\"isRange\"\n >\n <div\n role=\"row\"\n class=\"week-head\"\n [class.no-label]=\"\n compact ||\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] === 'hidden' &&\n !this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n \"\n >\n <span\n *ngIf=\"\n !compact &&\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] !== 'hidden' ||\n this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n \"\n role=\"columnheader\"\n aria-label=\"Week\"\n ></span\n ><span *ngFor=\"let day of weekdays\" role=\"columnheader\">{{ day }}</span>\n </div>\n <div\n #scroller\n class=\"week-scroll\"\n [style.height.px]=\"visibleCount * rowHeight\"\n (scroll)=\"scroll($event)\"\n (scrollend)=\"snapWeek()\"\n >\n <div [style.height.px]=\"scrollHeight\" class=\"scroll-space\">\n <div class=\"rows\" [style.top.px]=\"paddingTop\">\n <div\n *ngFor=\"let row of rows; trackBy: trackRow\"\n role=\"row\"\n class=\"week-row\"\n [class.no-label]=\"\n compact ||\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] ===\n 'hidden' &&\n !this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n \"\n >\n <span\n *ngIf=\"\n !compact &&\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] !==\n 'hidden' ||\n this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n \"\n role=\"rowheader\"\n class=\"week-number\"\n >{{ row.label }}</span\n >\n <div\n *ngFor=\"\n let cell of row.cells;\n let dayIndex = index;\n trackBy: trackCell\n \"\n role=\"gridcell\"\n [attr.data-weekday-index]=\"dayIndex\"\n [attr.aria-colindex]=\"\n dayIndex +\n (compact ||\n (this[WklyPickerInputsPropertyKeys.WeekLabelMode] ===\n 'hidden' &&\n !this[WklyPickerInputsPropertyKeys.WeekLabelFormatter])\n ? 1\n : 2)\n \"\n [attr.aria-selected]=\"selected(cell.epochDay)\"\n [attr.aria-disabled]=\"\n cell.disabled || this[WklyPickerInputsPropertyKeys.Disabled]\n \"\n [class.range]=\"inRange(cell.epochDay)\"\n [class.hidden]=\"cell.hidden\"\n [class.odd-month]=\"cell.date && cell.date.month % 2 === 1\"\n >\n <span [class]=\"'annotation annotation--' + dayIndex\">{{\n cell.annotation\n }}</span>\n <button\n type=\"button\"\n class=\"day\"\n [attr.data-day]=\"cell.epochDay\"\n [attr.aria-label]=\"cell.accessible\"\n [attr.aria-current]=\"cell.epochDay === today ? 'date' : null\"\n [attr.aria-disabled]=\"\n cell.disabled || this[WklyPickerInputsPropertyKeys.Disabled]\n \"\n [attr.tabindex]=\"\n !cell.hidden && cell.epochDay === focused ? 0 : -1\n \"\n [class.selected]=\"selected(cell.epochDay)\"\n [class.today]=\"cell.epochDay === today\"\n (focus)=\"focused = cell.epochDay\"\n (click)=\"select(cell.epochDay)\"\n (keydown)=\"key($event, cell.epochDay)\"\n >\n {{ cell.label }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"week-navigation\">\n <button\n type=\"button\"\n [disabled]=\"\n this[WklyPickerInputsPropertyKeys.Disabled] || !canMoveWeek(-1)\n \"\n [attr.aria-label]=\"t('previous')\"\n (click)=\"moveWeek(-1)\"\n >\n \u2191</button\n ><span>{{ title }}</span\n ><button\n type=\"button\"\n [disabled]=\"\n this[WklyPickerInputsPropertyKeys.Disabled] || !canMoveWeek(1)\n \"\n [attr.aria-label]=\"t('next')\"\n (click)=\"moveWeek(1)\"\n >\n \u2193\n </button>\n </div>\n </ng-container>\n <ng-container\n *ngFor=\"let draft of drafts; let i = index; trackBy: trackDraft\"\n >\n <fieldset\n *ngIf=\"(i === 0 || isRange) && (hasTime || viewMode === 'manual')\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [attr.aria-label]=\"isRange ? t(i === 0 ? 'start' : 'end') : null\"\n >\n <legend *ngIf=\"isRange\">\n <ng-container\n *ngIf=\"\n i === 1 && hasDate && viewMode === 'manual';\n else endpointLabel\n \"\n >\n <span class=\"end-view-toggle\">\n <button\n type=\"button\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [attr.aria-pressed]=\"endView === 'date'\"\n (click)=\"toggleEndView('date')\"\n >\n {{ t(\"end\") }}\n </button>\n <button\n type=\"button\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [attr.aria-pressed]=\"endView === 'days'\"\n (click)=\"toggleEndView('days')\"\n >\n {{ inDaysLabel }}\n </button>\n </span>\n </ng-container>\n <ng-template #endpointLabel>{{\n t(i === 0 ? \"start\" : \"end\")\n }}</ng-template>\n </legend>\n <div\n *ngIf=\"\n i === 1 && hasDate && viewMode === 'manual' && endView === 'days'\n \"\n class=\"date-fields in-days-fields\"\n >\n <span class=\"resulting-end-date\" [attr.aria-label]=\"t('endDate')\">{{\n resultingEndDate\n }}</span>\n <wkly-field\n [label]=\"t('days')\"\n [hideLabel]=\"true\"\n [previousLabel]=\"t('daysPrevious')\"\n [nextLabel]=\"t('daysNext')\"\n [locale]=\"effectiveLocale\"\n [value]=\"inDays\"\n [min]=\"-9999\"\n [max]=\"9999\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [invalid]=\"!!errors.length\"\n (valueChange)=\"days($event)\"\n (complete)=\"finish()\"\n ></wkly-field>\n </div>\n <div\n *ngIf=\"\n hasDate && viewMode === 'manual' && (i === 0 || endView === 'date')\n \"\n class=\"date-fields\"\n >\n <wkly-field\n [label]=\"t('day')\"\n [locale]=\"effectiveLocale\"\n [value]=\"draft.date.day\"\n [min]=\"1\"\n [max]=\"31\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [invalid]=\"!!errors.length\"\n (valueChange)=\"field(i, 'day', $event)\"\n (complete)=\"finish()\"\n ></wkly-field>\n <wkly-field\n [label]=\"t('month')\"\n [locale]=\"effectiveLocale\"\n [value]=\"draft.date.month\"\n [min]=\"1\"\n [max]=\"monthCount(draft)\"\n [labels]=\"months(draft)\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [invalid]=\"!!errors.length\"\n (valueChange)=\"field(i, 'month', $event)\"\n (complete)=\"finish()\"\n ></wkly-field>\n <wkly-field\n [label]=\"t('year')\"\n [locale]=\"effectiveLocale\"\n [value]=\"draft.date.year\"\n [min]=\"adapter.supportedYearRange[0]\"\n [max]=\"adapter.supportedYearRange[1]\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [invalid]=\"!!errors.length\"\n (valueChange)=\"field(i, 'year', $event)\"\n (complete)=\"finish()\"\n ></wkly-field>\n </div>\n <div\n *ngIf=\"hasTime\"\n class=\"time-fields\"\n [class.seconds]=\"this[WklyPickerInputsPropertyKeys.ShowSeconds]\"\n >\n <wkly-field\n [label]=\"t('hour')\"\n [locale]=\"effectiveLocale\"\n [value]=\"displayHour(draft)\"\n [min]=\"effectiveHourCycle === 'h12' ? 1 : 0\"\n [max]=\"effectiveHourCycle === 'h12' ? 12 : 23\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [invalid]=\"!!errors.length\"\n (valueChange)=\"field(i, 'hour', $event)\"\n (complete)=\"finish()\"\n ></wkly-field>\n <wkly-field\n [label]=\"t('minute')\"\n [locale]=\"effectiveLocale\"\n [value]=\"draft.minute\"\n [max]=\"59\"\n [step]=\"\n this[WklyPickerInputsPropertyKeys.MinuteStep] > 0 &&\n 60 % this[WklyPickerInputsPropertyKeys.MinuteStep] === 0\n ? this[WklyPickerInputsPropertyKeys.MinuteStep]\n : 1\n \"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [invalid]=\"!!errors.length\"\n (valueChange)=\"field(i, 'minute', $event)\"\n (complete)=\"finish()\"\n ></wkly-field>\n <wkly-field\n *ngIf=\"this[WklyPickerInputsPropertyKeys.ShowSeconds]\"\n [label]=\"t('second')\"\n [locale]=\"effectiveLocale\"\n [value]=\"draft.second\"\n [max]=\"59\"\n [step]=\"\n this[WklyPickerInputsPropertyKeys.SecondStep] > 0 &&\n 60 % this[WklyPickerInputsPropertyKeys.SecondStep] === 0\n ? this[WklyPickerInputsPropertyKeys.SecondStep]\n : 1\n \"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [invalid]=\"!!errors.length\"\n (valueChange)=\"field(i, 'second', $event)\"\n (complete)=\"finish()\"\n ></wkly-field>\n <div class=\"period\">\n <button\n *ngIf=\"\n effectiveHourCycle === 'h12' ||\n this[WklyPickerInputsPropertyKeys.HourCycle] === 'switchable'\n \"\n type=\"button\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [attr.aria-pressed]=\"\n effectiveHourCycle === 'h12' && (draft.hour || 0) < 12\n \"\n (click)=\"period(i, 'am')\"\n >\n {{ t(\"am\") }}</button\n ><button\n type=\"button\"\n [disabled]=\"\n this[WklyPickerInputsPropertyKeys.Disabled] ||\n this[WklyPickerInputsPropertyKeys.HourCycle] !== 'switchable'\n \"\n [attr.aria-pressed]=\"effectiveHourCycle === 'h24'\"\n (click)=\"period(i, '24')\"\n >\n 24</button\n ><button\n *ngIf=\"\n effectiveHourCycle === 'h12' ||\n this[WklyPickerInputsPropertyKeys.HourCycle] === 'switchable'\n \"\n type=\"button\"\n [disabled]=\"this[WklyPickerInputsPropertyKeys.Disabled]\"\n [attr.aria-pressed]=\"\n effectiveHourCycle === 'h12' && (draft.hour || 0) >= 12\n \"\n (click)=\"period(i, 'pm')\"\n >\n {{ t(\"pm\") }}\n </button>\n </div>\n </div>\n </fieldset>\n </ng-container>\n <div class=\"validation\" role=\"status\" aria-live=\"polite\">\n <p *ngFor=\"let err of errors\">! {{ t(err.messageKey) }}</p>\n </div>\n <footer *ngIf=\"submitVisible\">\n <button\n type=\"button\"\n class=\"confirm\"\n [disabled]=\"!canSubmit\"\n (click)=\"submit()\"\n >\n {{ t(\"confirm\") }}\n </button>\n </footer>\n</section>\n",
1147
- providers: [
1148
- {
1149
- provide: NG_VALUE_ACCESSOR,
1150
- useExisting: forwardRef(() => WklyDateTimePickerComponent),
1151
- multi: true,
1152
- },
1153
- {
1154
- provide: NG_VALIDATORS,
1155
- useExisting: forwardRef(() => WklyDateTimePickerComponent),
1156
- multi: true,
1157
- },
1158
- ],
1159
- styles: [":host{display:block;width:100%;box-sizing:border-box;--wkly-background-color: #fff;--wkly-background-color-alternate: #fafafa;--wkly-text-color: #192c28;--wkly-muted-color: #52635e;--wkly-border-color: #dce5e1;--wkly-accent-color: #176c55;--wkly-accent-color-alternate: #6ea494;--wkly-accent-text-color: #fff;--wkly-range-color: #e5f1ee;--wkly-error-color: #b42318;--wkly-focus-color: #245bd6;--wkly-size-multiplier: 1;--wkly-size-unit: 3.5em;color:var(--wkly-text-color);font:14px/1.4 system-ui,sans-serif;container-type:inline-size}.wkly{background:var(--wkly-background-color);border:1px solid var(--wkly-border-color);border-radius:14px;overflow:hidden;min-width:0;font-size:calc(14px * clamp(1,var(--wkly-size-multiplier),1.5))}button{font:inherit;color:inherit;min-width:var(--wkly-size-unit);min-height:var(--wkly-size-unit);border:0;background:transparent;border-radius:8px;cursor:pointer}@media (hover: hover) and (pointer: fine){button:hover:not(:disabled):not([aria-disabled=\"true\"]):not(.selected){background:var(--wkly-accent-color-alternate)}}button:disabled,button[aria-disabled=true]{opacity:.4;cursor:default}button:focus-visible{outline:2px solid var(--wkly-focus-color);outline-offset:-2px}.toolbar{display:flex;align-items:center;padding:8px;grid-gap:3px;gap:3px;border-bottom:1px solid var(--wkly-border-color)}.spacer{flex:1}.year-control{padding:0 6px;font-weight:650;text-align:start;line-height:1.2}.now{color:var(--wkly-accent-color);font-weight:650}.week-head,.week-row{display:grid;grid-template-columns:28px repeat(7,minmax(0,1fr))}.week-head{font-size:.85em;color:var(--wkly-muted-color);height:34px;align-items:center;text-align:center}.week-row{height:calc(var(--wkly-size-unit) * clamp(1,var(--wkly-size-multiplier),1));align-items:end}.no-label{grid-template-columns:repeat(7,minmax(0,1fr))}.week-scroll{overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;overflow-anchor:none;scrollbar-width:thin;max-height:65vh;touch-action:pan-y}.scroll-space{position:relative}.rows{position:absolute;left:0;right:0}.week-number{font-size:.85em;text-align:center;align-self:end;line-height:var(--wkly-size-unit);color:var(--wkly-muted-color)}[role=gridcell]{position:relative;min-width:0;height:var(--wkly-size-unit);text-align:center}[role=gridcell].odd-month:not(.range):not(.today){background:var(--wkly-background-color-alternate)}.day{width:100%;min-width:0;height:var(--wkly-size-unit);padding:0;border-radius:8px}.annotation{position:absolute;bottom:.25em;white-space:nowrap;font-size:1.25em;font-weight:650;line-height:1;pointer-events:none;z-index:1;color:var(--wkly-muted-color);color:color-mix(in srgb,var(--wkly-muted-color) 50%,transparent);text-shadow:0 0 2px --wkly-background-color,0 0 4px --wkly-background-color}.odd-month .annotation{text-shadow:0 0 2px --wkly-background-color-alternate,0 0 4px --wkly-background-color-alternate}.annotation:empty{display:none}.annotation--0{inset-inline-start:10%;bottom:1.75em}.annotation--1{inset-inline-start:-5%}.annotation--2{inset-inline-start:-20%}.annotation--3{inset-inline-start:-50%;inset-inline-end:-50%}.annotation--4{inset-inline-end:-20%}.annotation--5{inset-inline-end:-5%}.annotation--6{inset-inline-end:10%}.range{background:var(--wkly-range-color)}.day.selected{background:var(--wkly-accent-color);color:var(--wkly-accent-text-color);font-weight:700}.today:after{content:\"\";display:block;width:5px;height:5px;background:currentColor;border-radius:50%;position:absolute;bottom:2px;left:calc(50% - 2px)}.today{font-weight:750;box-shadow:inset 0 0 0 1px var(--wkly-accent-color)}.hidden{visibility:hidden}.week-navigation{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--wkly-border-color);font-size:.85em;color:var(--wkly-muted-color)}fieldset{border:0;padding:0 12px;margin:0;min-width:0}legend{padding-top:.85em;font-weight:650;color:var(--wkly-accent-color)}.date-fields{display:grid;grid-template-columns:1fr 2fr 1.4fr;grid-gap:7px;gap:7px;padding:12px 0}.end-view-toggle{display:inline-flex}.end-view-toggle button{min-height:0;min-width:0;padding:0 6px;border-radius:0;line-height:inherit}.end-view-toggle button:first-child{padding-inline-start:0}.end-view-toggle button+button{border-inline-start:1px solid var(--wkly-text-color)}.end-view-toggle button[aria-pressed=false]{color:var(--wkly-muted-color);font-weight:400}.in-days-fields{grid-template-columns:minmax(0,1fr);grid-gap:0;gap:0;text-align:center}.resulting-end-date{font-size:11px;color:var(--wkly-muted-color);height:1.4em;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.time-fields{display:grid;grid-template-columns:1fr 1fr 52px;grid-gap:8px;gap:8px;padding:14px 0;border-top:1px solid var(--wkly-border-color)}.time-fields.seconds{grid-template-columns:1fr 1fr 1fr 48px}.period{display:flex;flex-direction:column;justify-content:center;grid-gap:2px;gap:2px;padding-top:1.25em}.period button{font-size:.85em}.period [aria-pressed=true]{background:var(--wkly-range-color);box-shadow:inset 0 0 0 1px var(--wkly-accent-color);font-weight:700}.validation{color:var(--wkly-error-color);font-size:.85em}.validation p{margin:.5em .85em}footer{padding:12px;border-top:1px solid var(--wkly-border-color)}.confirm{background:var(--wkly-accent-color);color:var(--wkly-accent-text-color);width:100%;font-weight:650}@media (forced-colors: active){.day.selected{outline:2px solid Highlight}.range{border-bottom:2px solid Highlight}.today{outline:1px dashed CanvasText}}@media (prefers-reduced-motion: reduce){*{scroll-behavior:auto!important;animation:none!important}}\n"]
1160
- },] }
1161
- ];
1162
- WklyDateTimePickerComponent.ctorParameters = () => [
1163
- { type: String, decorators: [{ type: Inject, args: [LOCALE_ID,] }] },
1164
- { type: undefined, decorators: [{ type: Inject, args: [WKLY_CONFIG,] }] },
1165
- { type: undefined, decorators: [{ type: Inject, args: [WKLY_CLOCK,] }] },
1166
- { type: undefined, decorators: [{ type: Inject, args: [WKLY_LOCALIZATION,] }] },
1167
- { type: undefined, decorators: [{ type: Inject, args: [WKLY_TRANSLATIONS,] }] },
1168
- { type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
1169
- { type: ElementRef },
1170
- { type: ChangeDetectorRef }
1171
- ];
1172
- WklyDateTimePickerComponent.propDecorators = {
1173
- scroller: [{ type: ViewChild, args: ["scroller",] }]
1174
- };
1175
-
1176
- /** Native-dialog factory. Browser resources are allocated only by open(). */
1177
- class WklyDateTimePickerDialogService {
1178
- constructor(resolver, injector, app, document, platform) {
1179
- this.resolver = resolver;
1180
- this.injector = injector;
1181
- this.app = app;
1182
- this.document = document;
1183
- this.platform = platform;
1184
- }
1185
- open(trigger, onCancel, backdrop = true, injector) {
1186
- if (!isPlatformBrowser(this.platform))
1187
- throw new Error("Picker presentations can only open in a browser");
1188
- const dialog = this.document.createElement("dialog");
1189
- dialog.setAttribute("aria-label", "Date and time picker");
1190
- Object.assign(dialog.style, {
1191
- padding: "0",
1192
- border: "0",
1193
- borderRadius: "14px",
1194
- width: "min(390px, 100vw)",
1195
- maxWidth: "100vw",
1196
- maxHeight: "94vh",
1197
- background: "transparent",
1198
- });
1199
- const component = this.resolver
1200
- .resolveComponentFactory(WklyDateTimePickerComponent)
1201
- .create(injector || this.injector);
1202
- component.instance.presentation = "transient";
1203
- dialog.appendChild(component.location.nativeElement);
1204
- this.document.body.appendChild(dialog);
1205
- this.app.attachView(component.hostView);
1206
- const cancel = (event) => {
1207
- event.preventDefault();
1208
- onCancel("escape");
1209
- };
1210
- const click = (event) => {
1211
- if (backdrop && event.target === dialog) {
1212
- const r = dialog.getBoundingClientRect();
1213
- if (event.clientX < r.left ||
1214
- event.clientX > r.right ||
1215
- event.clientY < r.top ||
1216
- event.clientY > r.bottom)
1217
- onCancel("backdrop");
1218
- }
1219
- };
1220
- const keydown = (event) => {
1221
- if (event.key !== "Tab")
1222
- return;
1223
- const controls = Array.from(dialog.querySelectorAll('button:not(:disabled),input:not(:disabled),[tabindex="0"]')).filter((el) => el.tabIndex >= 0 &&
1224
- el.getClientRects().length &&
1225
- getComputedStyle(el).visibility !== "hidden");
1226
- const first = controls[0], last = controls[controls.length - 1];
1227
- if (first &&
1228
- (event.shiftKey
1229
- ? this.document.activeElement === first
1230
- : this.document.activeElement === last)) {
1231
- event.preventDefault();
1232
- (event.shiftKey ? last : first).focus();
1233
- }
1234
- };
1235
- dialog.addEventListener("cancel", cancel);
1236
- dialog.addEventListener("click", click);
1237
- dialog.addEventListener("keydown", keydown);
1238
- dialog.showModal();
1239
- return {
1240
- component,
1241
- destroy: () => {
1242
- dialog.removeEventListener("cancel", cancel);
1243
- dialog.removeEventListener("click", click);
1244
- dialog.removeEventListener("keydown", keydown);
1245
- dialog.close();
1246
- this.app.detachView(component.hostView);
1247
- component.destroy();
1248
- dialog.remove();
1249
- trigger.focus();
1250
- },
1251
- };
1252
- }
1253
- }
1254
- WklyDateTimePickerDialogService.ɵprov = i0.ɵɵdefineInjectable({ factory: function WklyDateTimePickerDialogService_Factory() { return new WklyDateTimePickerDialogService(i0.ɵɵinject(i0.ComponentFactoryResolver), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(i0.ApplicationRef), i0.ɵɵinject(i1.DOCUMENT), i0.ɵɵinject(i0.PLATFORM_ID)); }, token: WklyDateTimePickerDialogService, providedIn: "root" });
1255
- WklyDateTimePickerDialogService.decorators = [
1256
- { type: Injectable, args: [{ providedIn: "root" },] }
1257
- ];
1258
- WklyDateTimePickerDialogService.ctorParameters = () => [
1259
- { type: ComponentFactoryResolver },
1260
- { type: Injector },
1261
- { type: ApplicationRef },
1262
- { type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
1263
- { type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
1264
- ];
1265
- /** Shared trigger lifecycle; optional presentation packages extend this class. */
1266
- class WklyTriggerBase extends WklyPickerInputs {
1267
- constructor(element) {
1268
- super();
1269
- this.element = element;
1270
- this.ref = null;
1271
- this.subscriptions = [];
1272
- this.errors = [];
1273
- this.change = () => { };
1274
- this.touched = () => { };
1275
- this.validation = () => { };
1276
- }
1277
- open() {
1278
- if (this[WklyPickerInputsPropertyKeys.Disabled] || this.ref)
1279
- return;
1280
- this.ref = this.create();
1281
- const picker = this.ref.component.instance;
1282
- this.copy();
1283
- this.subscriptions = [
1284
- picker[WklyPickerOutputsPropertyKeys.ValueChange].subscribe((value) => {
1285
- this[WklyPickerInputsPropertyKeys.Value] = value;
1286
- this.change(value);
1287
- this[WklyPickerOutputsPropertyKeys.ValueChange].emit(value);
1288
- this.display();
1289
- }),
1290
- picker[WklyPickerOutputsPropertyKeys.ValidationChange].subscribe((errors) => {
1291
- this.errors = errors;
1292
- this[WklyPickerOutputsPropertyKeys.ValidationChange].emit(errors);
1293
- this.validation();
1294
- }),
1295
- picker[WklyPickerOutputsPropertyKeys.Closed].subscribe((reason) => this.close(reason)),
1296
- picker[WklyPickerOutputsPropertyKeys.ViewportChange].subscribe((value) => this[WklyPickerOutputsPropertyKeys.ViewportChange].emit(value)),
1297
- picker[WklyPickerOutputsPropertyKeys.ViewModeChange].subscribe((value) => this[WklyPickerOutputsPropertyKeys.ViewModeChange].emit(value)),
1298
- ];
1299
- this.ref.component.changeDetectorRef.detectChanges();
1300
- picker.focusDay();
1301
- this[WklyPickerOutputsPropertyKeys.Opened].emit();
1302
- }
1303
- key(event) {
1304
- if (event.key === "Enter" ||
1305
- event.key === " " ||
1306
- event.key === "ArrowDown") {
1307
- event.preventDefault();
1308
- this.open();
1309
- }
1310
- }
1311
- blur() {
1312
- this.touched();
1313
- }
1314
- close(reason = "programmatic") {
1315
- if (!this.ref)
1316
- return;
1317
- const ref = this.ref;
1318
- this.ref = null;
1319
- this.subscriptions.forEach((s) => s.unsubscribe());
1320
- this.subscriptions = [];
1321
- ref.destroy();
1322
- this.touched();
1323
- this[WklyPickerOutputsPropertyKeys.Closed].emit(reason);
1324
- }
1325
- ngOnChanges() {
1326
- [
1327
- WklyPickerInputsPropertyKeys.ShowSeconds,
1328
- WklyPickerInputsPropertyKeys.AllowRangeAcrossDisabled,
1329
- WklyPickerInputsPropertyKeys.Required,
1330
- WklyPickerInputsPropertyKeys.Disabled,
1331
- WklyPickerInputsPropertyKeys.CloseOnBackdrop,
1332
- ].forEach((key) => (this[key] = coerceBoolean(this[key])));
1333
- this.checkValue();
1334
- this.display();
1335
- if (this.ref) {
1336
- this.copy();
1337
- this.ref.component.instance.ngOnChanges({
1338
- [WklyPickerInputsPropertyKeys.Value]: true,
1339
- });
1340
- this.ref.component.changeDetectorRef.detectChanges();
1341
- }
1342
- }
1343
- ngOnDestroy() {
1344
- this.close();
1345
- }
1346
- copy() {
1347
- if (this.ref)
1348
- for (const name of INPUT_NAMES)
1349
- this.ref.component.instance[name] = this[name];
1350
- }
1351
- display() {
1352
- const host = this.element.nativeElement;
1353
- if (host.tagName === "INPUT") {
1354
- host.readOnly = true;
1355
- const value = this[WklyPickerInputsPropertyKeys.Value];
1356
- host.value =
1357
- value === null
1358
- ? ""
1359
- : typeof value === "string"
1360
- ? value
1361
- : value.join(" — ");
1362
- host.disabled = this[WklyPickerInputsPropertyKeys.Disabled];
1363
- host.setAttribute("aria-haspopup", "dialog");
1364
- }
1365
- }
1366
- checkValue() {
1367
- this.errors = validateSelection(this[WklyPickerInputsPropertyKeys.Value], this, this[WklyPickerInputsPropertyKeys.CalendarAdapter] ||
1368
- new WklyGregorianCalendarAdapter(this[WklyPickerInputsPropertyKeys.Locale] || "en-US"));
1369
- this[WklyPickerOutputsPropertyKeys.ValidationChange].emit(this.errors);
1370
- this.validation();
1371
- }
1372
- writeValue(value) {
1373
- this[WklyPickerInputsPropertyKeys.Value] = value;
1374
- this.checkValue();
1375
- this.display();
1376
- if (this.ref)
1377
- this.ref.component.instance.writeValue(value);
1378
- }
1379
- registerOnChange(fn) {
1380
- this.change = fn;
1381
- }
1382
- registerOnTouched(fn) {
1383
- this.touched = fn;
1384
- }
1385
- setDisabledState(value) {
1386
- this[WklyPickerInputsPropertyKeys.Disabled] = value;
1387
- this.display();
1388
- if (this.ref)
1389
- this.ref.component.instance.setDisabledState(value);
1390
- }
1391
- validate() {
1392
- return this.errors.length ? { wkly: this.errors } : null;
1393
- }
1394
- registerOnValidatorChange(fn) {
1395
- this.validation = fn;
1396
- }
1397
- scrollToEpochDay(day, options) {
1398
- var _a;
1399
- this.open();
1400
- (_a = this.ref) === null || _a === void 0 ? void 0 : _a.component.instance.scrollToEpochDay(day, options);
1401
- }
1402
- scrollToAbsoluteWeek(week, options) {
1403
- var _a;
1404
- this.open();
1405
- (_a = this.ref) === null || _a === void 0 ? void 0 : _a.component.instance.scrollToAbsoluteWeek(week, options);
1406
- }
1407
- scrollToCalendarDate(date, options) {
1408
- var _a;
1409
- this.open();
1410
- (_a = this.ref) === null || _a === void 0 ? void 0 : _a.component.instance.scrollToCalendarDate(date, options);
1411
- }
1412
- scrollToValue(value, options) {
1413
- var _a;
1414
- this.open();
1415
- (_a = this.ref) === null || _a === void 0 ? void 0 : _a.component.instance.scrollToValue(value, options);
1416
- }
1417
- }
1418
- WklyTriggerBase.decorators = [
1419
- { type: Directive }
1420
- ];
1421
- WklyTriggerBase.ctorParameters = () => [
1422
- { type: ElementRef }
1423
- ];
1424
- WklyTriggerBase.propDecorators = {
1425
- open: [{ type: HostListener, args: ["click",] }],
1426
- key: [{ type: HostListener, args: ["keydown", ["$event"],] }],
1427
- blur: [{ type: HostListener, args: ["blur",] }]
1428
- };
1429
- class WklyDateTimePickerDialogDirective extends WklyTriggerBase {
1430
- constructor(element, service, triggerInjector) {
1431
- super(element);
1432
- this.service = service;
1433
- this.triggerInjector = triggerInjector;
1434
- }
1435
- create() {
1436
- return this.service.open(this.element.nativeElement, (reason) => this.close(reason), this[WklyPickerInputsPropertyKeys.CloseOnBackdrop], this.triggerInjector);
1437
- }
1438
- }
1439
- WklyDateTimePickerDialogDirective.decorators = [
1440
- { type: Directive, args: [{
1441
- selector: "[wklyDateTimePickerDialog]",
1442
- exportAs: "wklyDialog",
1443
- providers: [
1444
- {
1445
- provide: NG_VALUE_ACCESSOR,
1446
- useExisting: forwardRef(() => WklyDateTimePickerDialogDirective),
1447
- multi: true,
1448
- },
1449
- {
1450
- provide: NG_VALIDATORS,
1451
- useExisting: forwardRef(() => WklyDateTimePickerDialogDirective),
1452
- multi: true,
1453
- },
1454
- ],
1455
- },] }
1456
- ];
1457
- WklyDateTimePickerDialogDirective.ctorParameters = () => [
1458
- { type: ElementRef },
1459
- { type: WklyDateTimePickerDialogService },
1460
- { type: Injector }
1461
- ];
1462
-
1463
- class WklyFieldComponent {
1464
- constructor() {
1465
- this.value = 0;
1466
- this.label = "";
1467
- this.hideLabel = false;
1468
- this.previousLabel = "";
1469
- this.nextLabel = "";
1470
- this.min = 0;
1471
- this.max = 59;
1472
- this.step = 1;
1473
- this.locale = "en-US";
1474
- this.disabled = false;
1475
- this.invalid = false;
1476
- this.labels = null;
1477
- this.valueChange = new EventEmitter();
1478
- this.complete = new EventEmitter();
1479
- this.before = null;
1480
- this.touchY = 0;
1481
- this.touchSteps = 0;
1482
- this.touchChanged = false;
1483
- this.typed = null;
1484
- this.inputTimer = null;
1485
- this.wheelTimer = null;
1486
- }
1487
- get display() {
1488
- if (this.typed !== null)
1489
- return this.typed;
1490
- return this.value === null
1491
- ? ""
1492
- : this.labels
1493
- ? this.labels[this.value - this.min] || String(this.value)
1494
- : new Intl.NumberFormat(this.locale, {
1495
- useGrouping: false,
1496
- minimumIntegerDigits: this.max < 60 ? 2 : 1,
1497
- }).format(this.value);
1498
- }
1499
- ngOnChanges(changes) {
1500
- if (changes.value && this.min < 0 && this.typed !== null) {
1501
- const typedValue = this.typed === "" || this.typed === "-" ? null : Number(this.typed);
1502
- if (this.value !== typedValue) {
1503
- // External date edits replace a pending relative-day preview.
1504
- this.cancelInput();
1505
- this.typed = null;
1506
- }
1507
- }
1508
- }
1509
- ngOnDestroy() {
1510
- this.cancelInput();
1511
- if (this.wheelTimer !== null)
1512
- clearTimeout(this.wheelTimer);
1513
- }
1514
- next(delta) {
1515
- const count = Math.floor((this.max - this.min) / this.step) + 1;
1516
- return (this.min +
1517
- floorMod(Math.floor(((this.value === null ? this.min : this.value) - this.min) /
1518
- this.step) + delta, count) *
1519
- this.step);
1520
- }
1521
- neighbor(delta) {
1522
- const n = this.next(delta);
1523
- return this.labels
1524
- ? this.labels[n - this.min] || ""
1525
- : new Intl.NumberFormat(this.locale, { useGrouping: false }).format(n);
1526
- }
1527
- stepBy(delta) {
1528
- if (this.disabled)
1529
- return;
1530
- this.scrollBy(delta);
1531
- this.complete.emit();
1532
- }
1533
- begin(event) {
1534
- this.before = this.value;
1535
- event.target.select();
1536
- }
1537
- type(event) {
1538
- if (this.disabled)
1539
- return;
1540
- const input = event.target;
1541
- const raw = input.value;
1542
- const numeric = Array.from(raw).every((character) => normalizeDigits(character).length === 1);
1543
- if (this.min < 0 && !this.labels) {
1544
- // Preserve the sign while using the same locale digit normalization.
1545
- const signed = raw
1546
- .replace(/[\u200e\u200f\u061c]/g, "")
1547
- .replace(/\u2212/g, "-");
1548
- const digits = normalizeDigits(signed);
1549
- this.typed = input.value = (signed.startsWith("-") ? "-" : "") + digits;
1550
- this.value =
1551
- digits === ""
1552
- ? null
1553
- : Math.max(this.min, Math.min(this.max, Number(this.typed)));
1554
- if (this.value !== null && Number(this.typed) !== this.value)
1555
- this.typed = input.value = String(this.value);
1556
- }
1557
- else if (numeric) {
1558
- const normalized = normalizeDigits(raw);
1559
- this.typed = input.value =
1560
- this.min >= 0 && this.max < 100 ? normalized.slice(-2) : normalized;
1561
- this.value = this.typed === "" ? null : Number(this.typed);
1562
- }
1563
- else if (this.labels) {
1564
- const search = raw.trim().toLocaleLowerCase(this.locale);
1565
- this.typed = raw;
1566
- const matches = this.labels
1567
- .map((label, index) => ({ label, index }))
1568
- .filter((item) => item.label.toLocaleLowerCase(this.locale).includes(search));
1569
- this.value = matches.length === 1 ? this.min + matches[0].index : null;
1570
- }
1571
- else {
1572
- this.typed = input.value = normalizeDigits(raw);
1573
- this.value = this.typed === "" ? null : Number(this.typed);
1574
- }
1575
- this.valueChange.emit(this.value);
1576
- this.cancelInput();
1577
- if (!numeric && this.labels && this.value !== null)
1578
- this.complete.emit();
1579
- this.inputTimer = setTimeout(() => {
1580
- this.inputTimer = null;
1581
- this.typed = null;
1582
- if (!this.disabled)
1583
- this.complete.emit();
1584
- }, 1000);
1585
- }
1586
- key(event) {
1587
- if (event.key === "Escape") {
1588
- event.preventDefault();
1589
- event.stopPropagation();
1590
- this.cancelInput();
1591
- this.typed = null;
1592
- this.value = this.before;
1593
- this.valueChange.emit(this.before);
1594
- event.target.value = this.display;
1595
- event.target.blur();
1596
- }
1597
- if (event.key === "Enter") {
1598
- event.preventDefault();
1599
- event.stopPropagation();
1600
- this.finish();
1601
- }
1602
- const delta = event.key === "ArrowUp"
1603
- ? -1
1604
- : event.key === "ArrowDown"
1605
- ? 1
1606
- : event.key === "PageUp"
1607
- ? -5
1608
- : event.key === "PageDown"
1609
- ? 5
1610
- : 0;
1611
- if (delta) {
1612
- event.preventDefault();
1613
- this.stepBy(delta);
1614
- }
1615
- }
1616
- finish() {
1617
- this.cancelInput();
1618
- this.typed = null;
1619
- this.complete.emit();
1620
- }
1621
- wheel(event) {
1622
- if (this.disabled || Math.abs(event.deltaY) < 1)
1623
- return;
1624
- event.preventDefault();
1625
- this.scrollBy(event.deltaY > 0 ? 1 : -1);
1626
- if (this.wheelTimer !== null)
1627
- clearTimeout(this.wheelTimer);
1628
- this.wheelTimer = setTimeout(() => {
1629
- this.wheelTimer = null;
1630
- this.complete.emit();
1631
- }, 140);
1632
- }
1633
- touchStart(event) {
1634
- this.touchY = event.touches[0].clientY;
1635
- this.touchSteps = 0;
1636
- this.touchChanged = false;
1637
- }
1638
- touchMove(event) {
1639
- this.applyTouchY(event.touches[0].clientY);
1640
- }
1641
- touchEnd(event) {
1642
- this.applyTouchY(event.changedTouches[0].clientY);
1643
- if (this.touchChanged)
1644
- this.complete.emit();
1645
- this.touchChanged = false;
1646
- }
1647
- cancelInput() {
1648
- if (this.inputTimer !== null)
1649
- clearTimeout(this.inputTimer);
1650
- this.inputTimer = null;
1651
- }
1652
- scrollBy(delta) {
1653
- if (this.disabled || !delta)
1654
- return;
1655
- this.cancelInput();
1656
- this.typed = null;
1657
- this.value = this.next(delta);
1658
- this.valueChange.emit(this.value);
1659
- }
1660
- applyTouchY(y) {
1661
- // Count total gesture steps so repeated move events do not duplicate changes.
1662
- if (this.disabled)
1663
- return;
1664
- const delta = this.touchY - y;
1665
- const steps = Math.abs(delta) > 16
1666
- ? Math.sign(delta) * Math.max(1, Math.round(Math.abs(delta) / 40))
1667
- : 0;
1668
- const change = steps - this.touchSteps;
1669
- if (!change)
1670
- return;
1671
- this.scrollBy(change);
1672
- this.touchSteps = steps;
1673
- this.touchChanged = true;
1674
- }
1675
- }
1676
- WklyFieldComponent.decorators = [
1677
- { type: Component, args: [{
1678
- selector: "wkly-field",
1679
- template: "<div\n class=\"field\"\n (wheel)=\"wheel($event)\"\n (touchstart)=\"touchStart($event)\"\n (touchmove)=\"touchMove($event)\"\n (touchend)=\"touchEnd($event)\"\n (touchcancel)=\"touchEnd($event)\"\n>\n <span *ngIf=\"!hideLabel\" class=\"label\">{{ label }}</span>\n <button\n type=\"button\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"previousLabel || label + ': previous'\"\n (click)=\"stepBy(-1)\"\n >\n {{ neighbor(-1) }}\n </button>\n <input\n [attr.aria-label]=\"label\"\n [attr.aria-invalid]=\"invalid\"\n [disabled]=\"disabled\"\n [value]=\"display\"\n [attr.inputmode]=\"labels ? 'text' : min < 0 ? 'text' : 'numeric'\"\n autocomplete=\"off\"\n (focus)=\"begin($event)\"\n (input)=\"type($event)\"\n (blur)=\"finish()\"\n (keydown)=\"key($event)\"\n />\n <button\n type=\"button\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"nextLabel || label + ': next'\"\n (click)=\"stepBy(1)\"\n >\n {{ neighbor(1) }}\n </button>\n</div>\n",
1680
- styles: [".field{display:flex;flex-direction:column;align-items:stretch;min-width:0;text-align:center;touch-action:pan-x}.label{font-size:11px;color:var(--wkly-muted-color, #54616e);margin-bottom:4px}button,input{font:inherit;box-sizing:border-box;min-height:44px;width:100%;border:0;text-align:center;background:transparent;color:inherit;border-radius:7px}button{color:var(--wkly-muted-color, #54616e);cursor:pointer}input{font-size:18px;font-weight:650;background:var(--wkly-range-color, #e5f1ee);border-block:2px solid var(--wkly-accent-color, #176c55)}input[aria-invalid=true]{border-color:var(--wkly-error-color, #b42318)}:focus-visible{outline:2px solid var(--wkly-focus-color, #124ee0);outline-offset:1px}button:disabled,input:disabled{opacity:.45}@media (hover: hover) and (pointer: fine){button:hover:not(:disabled){background:var(--wkly-range-color, #e5f1ee)}}\n"]
1681
- },] }
1682
- ];
1683
- WklyFieldComponent.propDecorators = {
1684
- value: [{ type: Input }],
1685
- label: [{ type: Input }],
1686
- hideLabel: [{ type: Input }],
1687
- previousLabel: [{ type: Input }],
1688
- nextLabel: [{ type: Input }],
1689
- min: [{ type: Input }],
1690
- max: [{ type: Input }],
1691
- step: [{ type: Input }],
1692
- locale: [{ type: Input }],
1693
- disabled: [{ type: Input }],
1694
- invalid: [{ type: Input }],
1695
- labels: [{ type: Input }],
1696
- valueChange: [{ type: Output }],
1697
- complete: [{ type: Output }]
1698
- };
1699
-
1700
- class WklyDateTimePickerModule {
1701
- }
1702
- WklyDateTimePickerModule.decorators = [
1703
- { type: NgModule, args: [{
1704
- imports: [CommonModule],
1705
- declarations: [
1706
- WklyDateTimePickerComponent,
1707
- WklyDateTimePickerDialogDirective,
1708
- WklyFieldComponent,
1709
- ],
1710
- entryComponents: [WklyDateTimePickerComponent],
1711
- exports: [WklyDateTimePickerComponent, WklyDateTimePickerDialogDirective],
1712
- },] }
1713
- ];
1714
-
1715
- /**
1716
- * Generated bundle index. Do not edit.
1717
- */
1718
-
1719
- export { WKLY_CLOCK, WKLY_CONFIG, WKLY_LOCALIZATION, WKLY_TRANSLATIONS, WklyDateTimePickerComponent, WklyDateTimePickerDialogDirective, WklyDateTimePickerDialogService, WklyDateTimePickerModule, WklyFieldComponent, WklyPickerInputs, WklyTriggerBase };
1720
- //# sourceMappingURL=wkly-datetime-picker.js.map