@spartan-ng/brain 0.0.1-alpha.717 → 0.0.1-alpha.718

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.
@@ -1,180 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, ElementRef, input, computed, Directive, signal, Injectable, ChangeDetectorRef, Injector, booleanAttribute, model, numberAttribute, contentChild, contentChildren, linkedSignal, afterNextRender, effect, ViewContainerRef, TemplateRef, untracked } from '@angular/core';
2
+ import { input, Directive, InjectionToken, inject, signal, Injectable, ChangeDetectorRef, Injector, booleanAttribute, model, numberAttribute, computed, contentChild, linkedSignal, afterNextRender, DestroyRef, ElementRef, effect, ViewContainerRef, TemplateRef, untracked } from '@angular/core';
3
3
  import { injectDateAdapter } from '@spartan-ng/brain/date-time';
4
4
  import { outputToObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
5
  import { BrnSelect } from '@spartan-ng/brain/select';
6
6
 
7
- const BrnCalendarToken = new InjectionToken('BrnCalendarToken');
8
- function provideBrnCalendar(instance) {
9
- return { provide: BrnCalendarToken, useExisting: instance };
10
- }
11
- /**
12
- * Inject the calendar component.
13
- */
14
- function injectBrnCalendar() {
15
- return inject(BrnCalendarToken);
16
- }
17
-
18
- class BrnCalendarCellButton {
19
- /** Access the date adapter */
20
- _dateAdapter = injectDateAdapter();
21
- /** Access the calendar component */
22
- _calendar = injectBrnCalendar();
23
- /** Access the element ref */
24
- _elementRef = inject(ElementRef);
25
- /** The date this cell represents */
26
- date = input.required(...(ngDevMode ? [{ debugName: "date" }] : /* istanbul ignore next */ []));
27
- /** Whether this date is currently selected */
28
- selected = computed(() => this._calendar.isSelected(this.date()), ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
29
- start = computed(() => this._calendar.isStartOfRange(this.date()), ...(ngDevMode ? [{ debugName: "start" }] : /* istanbul ignore next */ []));
30
- end = computed(() => this._calendar.isEndOfRange(this.date()), ...(ngDevMode ? [{ debugName: "end" }] : /* istanbul ignore next */ []));
31
- betweenRange = computed(() => this._calendar.isBetweenRange(this.date()), ...(ngDevMode ? [{ debugName: "betweenRange" }] : /* istanbul ignore next */ []));
32
- highlighted = computed(() => this._calendar.highlightDays().some((d) => this._dateAdapter.isSameDay(this.date(), d)), ...(ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []));
33
- /** Whether this date is focusable */
34
- focusable = computed(() => this._dateAdapter.isSameDay(this._calendar.focusedDate(), this.date()), ...(ngDevMode ? [{ debugName: "focusable" }] : /* istanbul ignore next */ []));
35
- outside = computed(() => {
36
- const focusedDate = this._calendar.focusedDate();
37
- return !this._dateAdapter.isSameMonth(this.date(), focusedDate);
38
- }, ...(ngDevMode ? [{ debugName: "outside" }] : /* istanbul ignore next */ []));
39
- /** Whether this date is today */
40
- today = computed(() => this._dateAdapter.isSameDay(this.date(), this._dateAdapter.now()), ...(ngDevMode ? [{ debugName: "today" }] : /* istanbul ignore next */ []));
41
- /** Whether this date is disabled */
42
- disabled = computed(() => this._calendar.isDateDisabled(this.date()) || this._calendar.disabled(), ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
43
- /**
44
- * Focus the previous cell.
45
- */
46
- focusPrevious(event) {
47
- event.preventDefault();
48
- event.stopPropagation();
49
- // in rtl, the arrow keys are reversed.
50
- const targetDate = this._dateAdapter.add(this._calendar.focusedDate(), {
51
- days: this.getDirection() === 'rtl' ? 1 : -1,
52
- });
53
- this._calendar.setFocusedDate(targetDate);
54
- }
55
- /**
56
- * Focus the next cell.
57
- */
58
- focusNext(event) {
59
- event.preventDefault();
60
- event.stopPropagation();
61
- const targetDate = this._dateAdapter.add(this._calendar.focusedDate(), {
62
- days: this.getDirection() === 'rtl' ? -1 : 1,
63
- });
64
- this._calendar.setFocusedDate(targetDate);
65
- }
66
- /**
67
- * Focus the above cell.
68
- */
69
- focusAbove(event) {
70
- event.preventDefault();
71
- event.stopPropagation();
72
- this._calendar.setFocusedDate(this._dateAdapter.subtract(this._calendar.focusedDate(), { days: 7 }));
73
- }
74
- /**
75
- * Focus the below cell.
76
- */
77
- focusBelow(event) {
78
- event.preventDefault();
79
- event.stopPropagation();
80
- this._calendar.setFocusedDate(this._dateAdapter.add(this._calendar.focusedDate(), { days: 7 }));
81
- }
82
- /**
83
- * Focus the first date of the month.
84
- */
85
- focusFirst(event) {
86
- event.preventDefault();
87
- event.stopPropagation();
88
- this._calendar.setFocusedDate(this._dateAdapter.startOfMonth(this._calendar.focusedDate()));
89
- }
90
- /**
91
- * Focus the last date of the month.
92
- */
93
- focusLast(event) {
94
- event.preventDefault();
95
- event.stopPropagation();
96
- this._calendar.setFocusedDate(this._dateAdapter.endOfMonth(this._calendar.focusedDate()));
97
- }
98
- /**
99
- * Focus the same date in the previous month.
100
- */
101
- focusPreviousMonth(event) {
102
- event.preventDefault();
103
- event.stopPropagation();
104
- const date = this._dateAdapter.getDate(this._calendar.focusedDate());
105
- let previousMonthTarget = this._dateAdapter.startOfMonth(this._calendar.focusedDate());
106
- previousMonthTarget = this._dateAdapter.subtract(previousMonthTarget, { months: 1 });
107
- const lastDay = this._dateAdapter.endOfMonth(previousMonthTarget);
108
- // if we are on a date that does not exist in the previous month, we should focus the last day of the month.
109
- if (date > this._dateAdapter.getDate(lastDay)) {
110
- this._calendar.setFocusedDate(lastDay);
111
- }
112
- else {
113
- this._calendar.setFocusedDate(this._dateAdapter.set(previousMonthTarget, { day: date }));
114
- }
115
- }
116
- /**
117
- * Focus the same date in the next month.
118
- */
119
- focusNextMonth(event) {
120
- event.preventDefault();
121
- event.stopPropagation();
122
- const date = this._dateAdapter.getDate(this._calendar.focusedDate());
123
- let nextMonthTarget = this._dateAdapter.startOfMonth(this._calendar.focusedDate());
124
- nextMonthTarget = this._dateAdapter.add(nextMonthTarget, { months: 1 });
125
- const lastDay = this._dateAdapter.endOfMonth(nextMonthTarget);
126
- // if we are on a date that does not exist in the next month, we should focus the last day of the month.
127
- if (date > this._dateAdapter.getDate(lastDay)) {
128
- this._calendar.setFocusedDate(lastDay);
129
- }
130
- else {
131
- this._calendar.setFocusedDate(this._dateAdapter.set(nextMonthTarget, { day: date }));
132
- }
133
- }
134
- /**
135
- * Get the direction of the element.
136
- */
137
- getDirection() {
138
- return getComputedStyle(this._elementRef.nativeElement).direction === 'rtl' ? 'rtl' : 'ltr';
139
- }
140
- focus() {
141
- this._elementRef.nativeElement.focus();
142
- }
143
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarCellButton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
144
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnCalendarCellButton, isStandalone: true, selector: "button[brnCalendarCellButton]", inputs: { date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "gridcell", "type": "button" }, listeners: { "click": "_calendar.selectDate(date())", "keydown.arrowLeft": "focusPrevious($event)", "keydown.arrowRight": "focusNext($event)", "keydown.arrowUp": "focusAbove($event)", "keydown.arrowDown": "focusBelow($event)", "keydown.home": "focusFirst($event)", "keydown.end": "focusLast($event)", "keydown.pageUp": "focusPreviousMonth($event)", "keydown.pageDown": "focusNextMonth($event)" }, properties: { "tabindex": "focusable() ? 0 : -1", "attr.data-outside": "!selected() && outside() && (!end() && !start())? '' : null", "attr.data-today": "today() && !selected() ? '' : null", "attr.data-selected": "selected() ? '' : null", "attr.data-disabled": "disabled() ? '' : null", "attr.aria-selected": "selected() ? 'true' : null", "attr.aria-disabled": "disabled() ? 'true' : null", "attr.data-range-start": "start() ? \"\" : null", "attr.data-range-end": "end() ? \"\" : null", "attr.data-highlighted": "highlighted() ? \"\" : null", "attr.data-range-between": "betweenRange() ? \"\" : null", "disabled": "disabled()" } }, ngImport: i0 });
145
- }
146
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarCellButton, decorators: [{
147
- type: Directive,
148
- args: [{
149
- selector: 'button[brnCalendarCellButton]',
150
- host: {
151
- role: 'gridcell',
152
- '[tabindex]': 'focusable() ? 0 : -1',
153
- type: 'button',
154
- '[attr.data-outside]': "!selected() && outside() && (!end() && !start())? '' : null",
155
- '[attr.data-today]': "today() && !selected() ? '' : null",
156
- '[attr.data-selected]': "selected() ? '' : null",
157
- '[attr.data-disabled]': "disabled() ? '' : null",
158
- '[attr.aria-selected]': "selected() ? 'true' : null",
159
- '[attr.aria-disabled]': "disabled() ? 'true' : null",
160
- '[attr.data-range-start]': 'start() ? "" : null',
161
- '[attr.data-range-end]': 'end() ? "" : null',
162
- '[attr.data-highlighted]': 'highlighted() ? "" : null',
163
- '[attr.data-range-between]': 'betweenRange() ? "" : null',
164
- '[disabled]': 'disabled()',
165
- '(click)': '_calendar.selectDate(date())',
166
- '(keydown.arrowLeft)': 'focusPrevious($event)',
167
- '(keydown.arrowRight)': 'focusNext($event)',
168
- '(keydown.arrowUp)': 'focusAbove($event)',
169
- '(keydown.arrowDown)': 'focusBelow($event)',
170
- '(keydown.home)': 'focusFirst($event)',
171
- '(keydown.end)': 'focusLast($event)',
172
- '(keydown.pageUp)': 'focusPreviousMonth($event)',
173
- '(keydown.pageDown)': 'focusNextMonth($event)',
174
- },
175
- }]
176
- }], propDecorators: { date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: true }] }] } });
177
-
178
7
  let uniqueId = 0;
179
8
  class BrnCalendarHeader {
180
9
  /** The unique id for the header */
@@ -194,6 +23,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
194
23
  }]
195
24
  }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
196
25
 
26
+ const BrnCalendarToken = new InjectionToken('BrnCalendarToken');
27
+ function provideBrnCalendar(instance) {
28
+ return { provide: BrnCalendarToken, useExisting: instance };
29
+ }
30
+ /**
31
+ * Inject the calendar component.
32
+ */
33
+ function injectBrnCalendar() {
34
+ return inject(BrnCalendarToken);
35
+ }
36
+
197
37
  const BrnCalendarI18nToken = new InjectionToken('BrnCalendarI18nToken');
198
38
  /**
199
39
  * Provide the calendar i18n configuration.
@@ -259,6 +99,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
259
99
  args: [{ providedIn: 'root' }]
260
100
  }] });
261
101
 
102
+ const compareDays = (a, b, dateAdapter) => {
103
+ if (a === b)
104
+ return true;
105
+ if (!a || !b)
106
+ return false;
107
+ if (a.length !== b.length)
108
+ return false;
109
+ return a.every((day, i) => dateAdapter.isSameDay(day, b[i]));
110
+ };
111
+
262
112
  class BrnCalendar {
263
113
  _i18n = injectBrnCalendarI18n();
264
114
  /** Access the date adapter */
@@ -286,8 +136,7 @@ class BrnCalendar {
286
136
  defaultFocusedDate = input(...(ngDevMode ? [undefined, { debugName: "defaultFocusedDate" }] : /* istanbul ignore next */ []));
287
137
  /** @internal Access the header */
288
138
  header = contentChild(BrnCalendarHeader, ...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
289
- /** Store the cells */
290
- _cells = contentChildren(BrnCalendarCellButton, { ...(ngDevMode ? { debugName: "_cells" } : /* istanbul ignore next */ {}), descendants: true });
139
+ _cells = [];
291
140
  /**
292
141
  * The focused date.
293
142
  */
@@ -318,7 +167,7 @@ class BrnCalendar {
318
167
  firstDay = this._dateAdapter.add(firstDay, { days: 1 });
319
168
  }
320
169
  return days;
321
- }, ...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
170
+ }, { ...(ngDevMode ? { debugName: "days" } : /* istanbul ignore next */ {}), equal: (a, b) => compareDays(a, b, this._dateAdapter) });
322
171
  /** @internal Constrain a date to the min and max boundaries */
323
172
  constrainDate(date) {
324
173
  const min = this.min();
@@ -383,8 +232,7 @@ class BrnCalendar {
383
232
  // wait until the cells have all updated
384
233
  afterNextRender({
385
234
  write: () => {
386
- // focus the cell with the target date.
387
- const cell = this._cells().find((c) => this._dateAdapter.isSameDay(c.date(), date));
235
+ const cell = this._cells.find((c) => this._dateAdapter.isSameDay(c.date(), date));
388
236
  if (cell) {
389
237
  cell.focus();
390
238
  }
@@ -422,8 +270,17 @@ class BrnCalendar {
422
270
  isBetweenRange(_) {
423
271
  return false;
424
272
  }
273
+ unregisterCalendarCell(cell) {
274
+ const index = this._cells.indexOf(cell);
275
+ if (index !== -1) {
276
+ this._cells.splice(index, 1);
277
+ }
278
+ }
279
+ registerCalendarCell(cell) {
280
+ this._cells.push(cell);
281
+ }
425
282
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendar, deps: [], target: i0.ɵɵFactoryTarget.Directive });
426
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnCalendar, isStandalone: true, selector: "[brnCalendar]", inputs: { highlightDays: { classPropertyName: "highlightDays", publicName: "highlightDays", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, dateDisabled: { classPropertyName: "dateDisabled", publicName: "dateDisabled", isSignal: true, isRequired: false, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: false, transformFunction: null }, defaultFocusedDate: { classPropertyName: "defaultFocusedDate", publicName: "defaultFocusedDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { date: "dateChange" }, providers: [provideBrnCalendar(BrnCalendar)], queries: [{ propertyName: "header", first: true, predicate: BrnCalendarHeader, descendants: true, isSignal: true }, { propertyName: "_cells", predicate: BrnCalendarCellButton, descendants: true, isSignal: true }], ngImport: i0 });
283
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnCalendar, isStandalone: true, selector: "[brnCalendar]", inputs: { highlightDays: { classPropertyName: "highlightDays", publicName: "highlightDays", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, dateDisabled: { classPropertyName: "dateDisabled", publicName: "dateDisabled", isSignal: true, isRequired: false, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: false, transformFunction: null }, defaultFocusedDate: { classPropertyName: "defaultFocusedDate", publicName: "defaultFocusedDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { date: "dateChange" }, providers: [provideBrnCalendar(BrnCalendar)], queries: [{ propertyName: "header", first: true, predicate: BrnCalendarHeader, descendants: true, isSignal: true }], ngImport: i0 });
427
284
  }
428
285
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendar, decorators: [{
429
286
  type: Directive,
@@ -431,9 +288,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
431
288
  selector: '[brnCalendar]',
432
289
  providers: [provideBrnCalendar(BrnCalendar)],
433
290
  }]
434
- }], propDecorators: { highlightDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightDays", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: false }] }, { type: i0.Output, args: ["dateChange"] }], dateDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateDisabled", required: false }] }], weekStartsOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStartsOn", required: false }] }], defaultFocusedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFocusedDate", required: false }] }], header: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BrnCalendarHeader), { isSignal: true }] }], _cells: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BrnCalendarCellButton), { ...{
435
- descendants: true,
436
- }, isSignal: true }] }] } });
291
+ }], propDecorators: { highlightDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightDays", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: false }] }, { type: i0.Output, args: ["dateChange"] }], dateDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateDisabled", required: false }] }], weekStartsOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStartsOn", required: false }] }], defaultFocusedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFocusedDate", required: false }] }], header: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BrnCalendarHeader), { isSignal: true }] }] } });
437
292
 
438
293
  class BrnCalendarCell {
439
294
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarCell, deps: [], target: i0.ɵɵFactoryTarget.Directive });
@@ -449,6 +304,171 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
449
304
  }]
450
305
  }] });
451
306
 
307
+ class BrnCalendarCellButton {
308
+ /** Access the date adapter */
309
+ _dateAdapter = injectDateAdapter();
310
+ _destroyRef = inject(DestroyRef);
311
+ /** Access the calendar component */
312
+ _calendar = injectBrnCalendar();
313
+ /** Access the element ref */
314
+ _elementRef = inject(ElementRef);
315
+ /** The date this cell represents */
316
+ date = input.required(...(ngDevMode ? [{ debugName: "date" }] : /* istanbul ignore next */ []));
317
+ /** Whether this date is currently selected */
318
+ selected = computed(() => this._calendar.isSelected(this.date()), ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
319
+ start = computed(() => this._calendar.isStartOfRange(this.date()), ...(ngDevMode ? [{ debugName: "start" }] : /* istanbul ignore next */ []));
320
+ end = computed(() => this._calendar.isEndOfRange(this.date()), ...(ngDevMode ? [{ debugName: "end" }] : /* istanbul ignore next */ []));
321
+ betweenRange = computed(() => this._calendar.isBetweenRange(this.date()), ...(ngDevMode ? [{ debugName: "betweenRange" }] : /* istanbul ignore next */ []));
322
+ highlighted = computed(() => this._calendar.highlightDays().some((d) => this._dateAdapter.isSameDay(this.date(), d)), ...(ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []));
323
+ constructor() {
324
+ this._calendar.registerCalendarCell(this);
325
+ this._destroyRef.onDestroy(() => this._calendar.unregisterCalendarCell(this));
326
+ }
327
+ /** Whether this date is focusable */
328
+ focusable = computed(() => this._dateAdapter.isSameDay(this._calendar.focusedDate(), this.date()), ...(ngDevMode ? [{ debugName: "focusable" }] : /* istanbul ignore next */ []));
329
+ outside = computed(() => {
330
+ const focusedDate = this._calendar.focusedDate();
331
+ return !this._dateAdapter.isSameMonth(this.date(), focusedDate);
332
+ }, ...(ngDevMode ? [{ debugName: "outside" }] : /* istanbul ignore next */ []));
333
+ /** Whether this date is today */
334
+ today = computed(() => this._dateAdapter.isSameDay(this.date(), this._dateAdapter.now()), ...(ngDevMode ? [{ debugName: "today" }] : /* istanbul ignore next */ []));
335
+ /** Whether this date is disabled */
336
+ disabled = computed(() => this._calendar.isDateDisabled(this.date()) || this._calendar.disabled(), ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
337
+ /**
338
+ * Focus the previous cell.
339
+ */
340
+ focusPrevious(event) {
341
+ event.preventDefault();
342
+ event.stopPropagation();
343
+ // in rtl, the arrow keys are reversed.
344
+ const targetDate = this._dateAdapter.add(this._calendar.focusedDate(), {
345
+ days: this.getDirection() === 'rtl' ? 1 : -1,
346
+ });
347
+ this._calendar.setFocusedDate(targetDate);
348
+ }
349
+ /**
350
+ * Focus the next cell.
351
+ */
352
+ focusNext(event) {
353
+ event.preventDefault();
354
+ event.stopPropagation();
355
+ const targetDate = this._dateAdapter.add(this._calendar.focusedDate(), {
356
+ days: this.getDirection() === 'rtl' ? -1 : 1,
357
+ });
358
+ this._calendar.setFocusedDate(targetDate);
359
+ }
360
+ /**
361
+ * Focus the above cell.
362
+ */
363
+ focusAbove(event) {
364
+ event.preventDefault();
365
+ event.stopPropagation();
366
+ this._calendar.setFocusedDate(this._dateAdapter.subtract(this._calendar.focusedDate(), { days: 7 }));
367
+ }
368
+ /**
369
+ * Focus the below cell.
370
+ */
371
+ focusBelow(event) {
372
+ event.preventDefault();
373
+ event.stopPropagation();
374
+ this._calendar.setFocusedDate(this._dateAdapter.add(this._calendar.focusedDate(), { days: 7 }));
375
+ }
376
+ /**
377
+ * Focus the first date of the month.
378
+ */
379
+ focusFirst(event) {
380
+ event.preventDefault();
381
+ event.stopPropagation();
382
+ this._calendar.setFocusedDate(this._dateAdapter.startOfMonth(this._calendar.focusedDate()));
383
+ }
384
+ /**
385
+ * Focus the last date of the month.
386
+ */
387
+ focusLast(event) {
388
+ event.preventDefault();
389
+ event.stopPropagation();
390
+ this._calendar.setFocusedDate(this._dateAdapter.endOfMonth(this._calendar.focusedDate()));
391
+ }
392
+ /**
393
+ * Focus the same date in the previous month.
394
+ */
395
+ focusPreviousMonth(event) {
396
+ event.preventDefault();
397
+ event.stopPropagation();
398
+ const date = this._dateAdapter.getDate(this._calendar.focusedDate());
399
+ let previousMonthTarget = this._dateAdapter.startOfMonth(this._calendar.focusedDate());
400
+ previousMonthTarget = this._dateAdapter.subtract(previousMonthTarget, { months: 1 });
401
+ const lastDay = this._dateAdapter.endOfMonth(previousMonthTarget);
402
+ // if we are on a date that does not exist in the previous month, we should focus the last day of the month.
403
+ if (date > this._dateAdapter.getDate(lastDay)) {
404
+ this._calendar.setFocusedDate(lastDay);
405
+ }
406
+ else {
407
+ this._calendar.setFocusedDate(this._dateAdapter.set(previousMonthTarget, { day: date }));
408
+ }
409
+ }
410
+ /**
411
+ * Focus the same date in the next month.
412
+ */
413
+ focusNextMonth(event) {
414
+ event.preventDefault();
415
+ event.stopPropagation();
416
+ const date = this._dateAdapter.getDate(this._calendar.focusedDate());
417
+ let nextMonthTarget = this._dateAdapter.startOfMonth(this._calendar.focusedDate());
418
+ nextMonthTarget = this._dateAdapter.add(nextMonthTarget, { months: 1 });
419
+ const lastDay = this._dateAdapter.endOfMonth(nextMonthTarget);
420
+ // if we are on a date that does not exist in the next month, we should focus the last day of the month.
421
+ if (date > this._dateAdapter.getDate(lastDay)) {
422
+ this._calendar.setFocusedDate(lastDay);
423
+ }
424
+ else {
425
+ this._calendar.setFocusedDate(this._dateAdapter.set(nextMonthTarget, { day: date }));
426
+ }
427
+ }
428
+ /**
429
+ * Get the direction of the element.
430
+ */
431
+ getDirection() {
432
+ return getComputedStyle(this._elementRef.nativeElement).direction === 'rtl' ? 'rtl' : 'ltr';
433
+ }
434
+ focus() {
435
+ this._elementRef.nativeElement.focus();
436
+ }
437
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarCellButton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
438
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnCalendarCellButton, isStandalone: true, selector: "button[brnCalendarCellButton]", inputs: { date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "gridcell", "type": "button" }, listeners: { "click": "_calendar.selectDate(date())", "keydown.arrowLeft": "focusPrevious($event)", "keydown.arrowRight": "focusNext($event)", "keydown.arrowUp": "focusAbove($event)", "keydown.arrowDown": "focusBelow($event)", "keydown.home": "focusFirst($event)", "keydown.end": "focusLast($event)", "keydown.pageUp": "focusPreviousMonth($event)", "keydown.pageDown": "focusNextMonth($event)" }, properties: { "tabindex": "focusable() ? 0 : -1", "attr.data-outside": "!selected() && outside() && (!end() && !start())? true : null", "attr.data-today": "today() && !selected() ? true : null", "attr.data-selected-single": "selected() && !start() && !end() && !betweenRange() ? true : null", "attr.data-disabled": "disabled() ? true : null", "attr.aria-selected": "selected() ? true : null", "attr.aria-disabled": "disabled() ? true : null", "attr.data-range-start": "start() ? true : null", "attr.data-range-end": "end() ? true : null", "attr.data-highlighted": "highlighted() ? true : null", "attr.data-range-middle": "betweenRange() ? true : null", "disabled": "disabled()" } }, ngImport: i0 });
439
+ }
440
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarCellButton, decorators: [{
441
+ type: Directive,
442
+ args: [{
443
+ selector: 'button[brnCalendarCellButton]',
444
+ host: {
445
+ role: 'gridcell',
446
+ '[tabindex]': 'focusable() ? 0 : -1',
447
+ type: 'button',
448
+ '[attr.data-outside]': '!selected() && outside() && (!end() && !start())? true : null',
449
+ '[attr.data-today]': 'today() && !selected() ? true : null',
450
+ '[attr.data-selected-single]': 'selected() && !start() && !end() && !betweenRange() ? true : null',
451
+ '[attr.data-disabled]': 'disabled() ? true : null',
452
+ '[attr.aria-selected]': 'selected() ? true : null',
453
+ '[attr.aria-disabled]': 'disabled() ? true : null',
454
+ '[attr.data-range-start]': 'start() ? true : null',
455
+ '[attr.data-range-end]': 'end() ? true : null',
456
+ '[attr.data-highlighted]': 'highlighted() ? true : null',
457
+ '[attr.data-range-middle]': 'betweenRange() ? true : null',
458
+ '[disabled]': 'disabled()',
459
+ '(click)': '_calendar.selectDate(date())',
460
+ '(keydown.arrowLeft)': 'focusPrevious($event)',
461
+ '(keydown.arrowRight)': 'focusNext($event)',
462
+ '(keydown.arrowUp)': 'focusAbove($event)',
463
+ '(keydown.arrowDown)': 'focusBelow($event)',
464
+ '(keydown.home)': 'focusFirst($event)',
465
+ '(keydown.end)': 'focusLast($event)',
466
+ '(keydown.pageUp)': 'focusPreviousMonth($event)',
467
+ '(keydown.pageDown)': 'focusNextMonth($event)',
468
+ },
469
+ }]
470
+ }], ctorParameters: () => [], propDecorators: { date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: true }] }] } });
471
+
452
472
  class BrnCalendarGrid {
453
473
  /** Access the calendar component */
454
474
  _calendar = injectBrnCalendar();
@@ -772,6 +792,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
772
792
 
773
793
  class BrnCalendarMulti {
774
794
  _i18n = injectBrnCalendarI18n();
795
+ _cells = [];
775
796
  /**
776
797
  * Determine if a date is the start of a range. In a date picker, this is always false.
777
798
  * @param date The date to check.
@@ -828,8 +849,6 @@ class BrnCalendarMulti {
828
849
  defaultFocusedDate = input(...(ngDevMode ? [undefined, { debugName: "defaultFocusedDate" }] : /* istanbul ignore next */ []));
829
850
  /** @internal Access the header */
830
851
  header = contentChild(BrnCalendarHeader, ...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
831
- /** Store the cells */
832
- _cells = contentChildren(BrnCalendarCellButton, { ...(ngDevMode ? { debugName: "_cells" } : /* istanbul ignore next */ {}), descendants: true });
833
852
  /**
834
853
  * The focused date.
835
854
  */
@@ -860,7 +879,7 @@ class BrnCalendarMulti {
860
879
  firstDay = this._dateAdapter.add(firstDay, { days: 1 });
861
880
  }
862
881
  return days;
863
- }, ...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
882
+ }, { ...(ngDevMode ? { debugName: "days" } : /* istanbul ignore next */ {}), equal: (a, b) => compareDays(a, b, this._dateAdapter) });
864
883
  isSelected(date) {
865
884
  return this.date()?.some((d) => this._dateAdapter.isSameDay(d, date)) ?? false;
866
885
  }
@@ -938,8 +957,7 @@ class BrnCalendarMulti {
938
957
  // wait until the cells have all updated
939
958
  afterNextRender({
940
959
  write: () => {
941
- // focus the cell with the target date.
942
- const cell = this._cells().find((c) => this._dateAdapter.isSameDay(c.date(), date));
960
+ const cell = this._cells.find((c) => this._dateAdapter.isSameDay(c.date(), date));
943
961
  if (cell) {
944
962
  cell.focus();
945
963
  }
@@ -950,8 +968,17 @@ class BrnCalendarMulti {
950
968
  // we must update the view to ensure the focused cell is visible.
951
969
  this._changeDetector.detectChanges();
952
970
  }
971
+ unregisterCalendarCell(cell) {
972
+ const index = this._cells.indexOf(cell);
973
+ if (index !== -1) {
974
+ this._cells.splice(index, 1);
975
+ }
976
+ }
977
+ registerCalendarCell(cell) {
978
+ this._cells.push(cell);
979
+ }
953
980
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarMulti, deps: [], target: i0.ɵɵFactoryTarget.Directive });
954
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnCalendarMulti, isStandalone: true, selector: "[brnCalendarMulti]", inputs: { highlightDays: { classPropertyName: "highlightDays", publicName: "highlightDays", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, minSelection: { classPropertyName: "minSelection", publicName: "minSelection", isSignal: true, isRequired: false, transformFunction: null }, maxSelection: { classPropertyName: "maxSelection", publicName: "maxSelection", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, dateDisabled: { classPropertyName: "dateDisabled", publicName: "dateDisabled", isSignal: true, isRequired: false, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: false, transformFunction: null }, defaultFocusedDate: { classPropertyName: "defaultFocusedDate", publicName: "defaultFocusedDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { date: "dateChange" }, providers: [provideBrnCalendar(BrnCalendarMulti)], queries: [{ propertyName: "header", first: true, predicate: BrnCalendarHeader, descendants: true, isSignal: true }, { propertyName: "_cells", predicate: BrnCalendarCellButton, descendants: true, isSignal: true }], ngImport: i0 });
981
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnCalendarMulti, isStandalone: true, selector: "[brnCalendarMulti]", inputs: { highlightDays: { classPropertyName: "highlightDays", publicName: "highlightDays", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, minSelection: { classPropertyName: "minSelection", publicName: "minSelection", isSignal: true, isRequired: false, transformFunction: null }, maxSelection: { classPropertyName: "maxSelection", publicName: "maxSelection", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, dateDisabled: { classPropertyName: "dateDisabled", publicName: "dateDisabled", isSignal: true, isRequired: false, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: false, transformFunction: null }, defaultFocusedDate: { classPropertyName: "defaultFocusedDate", publicName: "defaultFocusedDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { date: "dateChange" }, providers: [provideBrnCalendar(BrnCalendarMulti)], queries: [{ propertyName: "header", first: true, predicate: BrnCalendarHeader, descendants: true, isSignal: true }], ngImport: i0 });
955
982
  }
956
983
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarMulti, decorators: [{
957
984
  type: Directive,
@@ -959,11 +986,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
959
986
  selector: '[brnCalendarMulti]',
960
987
  providers: [provideBrnCalendar(BrnCalendarMulti)],
961
988
  }]
962
- }], propDecorators: { highlightDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightDays", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], minSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSelection", required: false }] }], maxSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelection", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: false }] }, { type: i0.Output, args: ["dateChange"] }], dateDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateDisabled", required: false }] }], weekStartsOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStartsOn", required: false }] }], defaultFocusedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFocusedDate", required: false }] }], header: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BrnCalendarHeader), { isSignal: true }] }], _cells: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BrnCalendarCellButton), { ...{
963
- descendants: true,
964
- }, isSignal: true }] }] } });
989
+ }], propDecorators: { highlightDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightDays", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], minSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSelection", required: false }] }], maxSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelection", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: false }] }, { type: i0.Output, args: ["dateChange"] }], dateDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateDisabled", required: false }] }], weekStartsOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStartsOn", required: false }] }], defaultFocusedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFocusedDate", required: false }] }], header: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BrnCalendarHeader), { isSignal: true }] }] } });
965
990
 
966
991
  class BrnCalendarRange {
992
+ _cells = [];
967
993
  _i18n = injectBrnCalendarI18n();
968
994
  // /** Access the date adapter */
969
995
  _dateAdapter = injectDateAdapter();
@@ -988,8 +1014,6 @@ class BrnCalendarRange {
988
1014
  defaultFocusedDate = input(...(ngDevMode ? [undefined, { debugName: "defaultFocusedDate" }] : /* istanbul ignore next */ []));
989
1015
  /** @internal Access the header */
990
1016
  header = contentChild(BrnCalendarHeader, ...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
991
- /** Store the cells */
992
- _cells = contentChildren(BrnCalendarCellButton, { ...(ngDevMode ? { debugName: "_cells" } : /* istanbul ignore next */ {}), descendants: true });
993
1017
  /**
994
1018
  * The focused date.
995
1019
  */
@@ -1028,7 +1052,7 @@ class BrnCalendarRange {
1028
1052
  firstDay = this._dateAdapter.add(firstDay, { days: 1 });
1029
1053
  }
1030
1054
  return days;
1031
- }, ...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
1055
+ }, { ...(ngDevMode ? { debugName: "days" } : /* istanbul ignore next */ {}), equal: (a, b) => compareDays(a, b, this._dateAdapter) });
1032
1056
  isSelected(date) {
1033
1057
  const start = this.startDate();
1034
1058
  const end = this.endDate();
@@ -1115,8 +1139,7 @@ class BrnCalendarRange {
1115
1139
  // wait until the cells have all updated
1116
1140
  afterNextRender({
1117
1141
  write: () => {
1118
- // focus the cell with the target date.
1119
- const cell = this._cells().find((c) => this._dateAdapter.isSameDay(c.date(), date));
1142
+ const cell = this._cells.find((c) => this._dateAdapter.isSameDay(c.date(), date));
1120
1143
  if (cell) {
1121
1144
  cell.focus();
1122
1145
  }
@@ -1164,8 +1187,17 @@ class BrnCalendarRange {
1164
1187
  !this._dateAdapter.isSameDay(date, start) &&
1165
1188
  !this._dateAdapter.isSameDay(date, end));
1166
1189
  }
1190
+ unregisterCalendarCell(cell) {
1191
+ const index = this._cells.indexOf(cell);
1192
+ if (index !== -1) {
1193
+ this._cells.splice(index, 1);
1194
+ }
1195
+ }
1196
+ registerCalendarCell(cell) {
1197
+ this._cells.push(cell);
1198
+ }
1167
1199
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarRange, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1168
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnCalendarRange, isStandalone: true, selector: "[brnCalendarRange]", inputs: { highlightDays: { classPropertyName: "highlightDays", publicName: "highlightDays", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dateDisabled: { classPropertyName: "dateDisabled", publicName: "dateDisabled", isSignal: true, isRequired: false, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: false, transformFunction: null }, defaultFocusedDate: { classPropertyName: "defaultFocusedDate", publicName: "defaultFocusedDate", isSignal: true, isRequired: false, transformFunction: null }, startDate: { classPropertyName: "startDate", publicName: "startDate", isSignal: true, isRequired: false, transformFunction: null }, endDate: { classPropertyName: "endDate", publicName: "endDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { startDate: "startDateChange", endDate: "endDateChange" }, providers: [provideBrnCalendar(BrnCalendarRange)], queries: [{ propertyName: "header", first: true, predicate: BrnCalendarHeader, descendants: true, isSignal: true }, { propertyName: "_cells", predicate: BrnCalendarCellButton, descendants: true, isSignal: true }], ngImport: i0 });
1200
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnCalendarRange, isStandalone: true, selector: "[brnCalendarRange]", inputs: { highlightDays: { classPropertyName: "highlightDays", publicName: "highlightDays", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dateDisabled: { classPropertyName: "dateDisabled", publicName: "dateDisabled", isSignal: true, isRequired: false, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: false, transformFunction: null }, defaultFocusedDate: { classPropertyName: "defaultFocusedDate", publicName: "defaultFocusedDate", isSignal: true, isRequired: false, transformFunction: null }, startDate: { classPropertyName: "startDate", publicName: "startDate", isSignal: true, isRequired: false, transformFunction: null }, endDate: { classPropertyName: "endDate", publicName: "endDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { startDate: "startDateChange", endDate: "endDateChange" }, providers: [provideBrnCalendar(BrnCalendarRange)], queries: [{ propertyName: "header", first: true, predicate: BrnCalendarHeader, descendants: true, isSignal: true }], ngImport: i0 });
1169
1201
  }
1170
1202
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarRange, decorators: [{
1171
1203
  type: Directive,
@@ -1173,9 +1205,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
1173
1205
  selector: '[brnCalendarRange]',
1174
1206
  providers: [provideBrnCalendar(BrnCalendarRange)],
1175
1207
  }]
1176
- }], propDecorators: { highlightDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightDays", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], dateDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateDisabled", required: false }] }], weekStartsOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStartsOn", required: false }] }], defaultFocusedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFocusedDate", required: false }] }], header: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BrnCalendarHeader), { isSignal: true }] }], _cells: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BrnCalendarCellButton), { ...{
1177
- descendants: true,
1178
- }, isSignal: true }] }], startDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "startDate", required: false }] }, { type: i0.Output, args: ["startDateChange"] }], endDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "endDate", required: false }] }, { type: i0.Output, args: ["endDateChange"] }] } });
1208
+ }], propDecorators: { highlightDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightDays", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], dateDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateDisabled", required: false }] }], weekStartsOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStartsOn", required: false }] }], defaultFocusedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFocusedDate", required: false }] }], header: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BrnCalendarHeader), { isSignal: true }] }], startDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "startDate", required: false }] }, { type: i0.Output, args: ["startDateChange"] }], endDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "endDate", required: false }] }, { type: i0.Output, args: ["endDateChange"] }] } });
1179
1209
 
1180
1210
  const BrnCalendarImports = [
1181
1211
  BrnCalendarCellButton,
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-calendar.mjs","sources":["../../../../libs/brain/calendar/src/lib/brn-calendar.token.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-cell-button.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-header.ts","../../../../libs/brain/calendar/src/lib/i18n/calendar-i18n.ts","../../../../libs/brain/calendar/src/lib/brn-calendar.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-cell.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-grid.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-month-select.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-next-button.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-previous-button.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-week.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-weekday.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-year-select.ts","../../../../libs/brain/calendar/src/lib/mode/brn-calendar-multiple.ts","../../../../libs/brain/calendar/src/lib/mode/brn-calendar-range.ts","../../../../libs/brain/calendar/src/index.ts","../../../../libs/brain/calendar/src/spartan-ng-brain-calendar.ts"],"sourcesContent":["import {\n\ttype ExistingProvider,\n\tinject,\n\tInjectionToken,\n\ttype InputSignal,\n\ttype Signal,\n\ttype Type,\n\ttype WritableSignal,\n} from '@angular/core';\nimport type { BrnCalendarHeader } from './brn-calendar-header';\n\nexport interface BrnCalendarBase<T> {\n\tisSelected: (date: T) => boolean;\n\tselectDate: (date: T) => void;\n\n\tconstrainDate: (date: T) => T;\n\tisDateDisabled: (date: T) => boolean;\n\tsetFocusedDate: (date: T) => void;\n\n\tisStartOfRange: (date: T) => boolean;\n\tisEndOfRange: (date: T) => boolean;\n\tisBetweenRange: (date: T) => boolean;\n\n\tdisabled: Signal<boolean>;\n\tfocusedDate: WritableSignal<T>;\n\theader: Signal<BrnCalendarHeader | undefined>;\n\tdays: Signal<T[]>;\n\thighlightDays: InputSignal<T[]>;\n}\n\nexport const BrnCalendarToken = new InjectionToken<BrnCalendarBase<unknown>>('BrnCalendarToken');\n\nexport function provideBrnCalendar<T>(instance: Type<BrnCalendarBase<T>>): ExistingProvider {\n\treturn { provide: BrnCalendarToken, useExisting: instance };\n}\n\n/**\n * Inject the calendar component.\n */\nexport function injectBrnCalendar<T>(): BrnCalendarBase<T> {\n\treturn inject(BrnCalendarToken) as BrnCalendarBase<T>;\n}\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { injectBrnCalendar } from './brn-calendar.token';\n\n@Directive({\n\tselector: 'button[brnCalendarCellButton]',\n\thost: {\n\t\trole: 'gridcell',\n\t\t'[tabindex]': 'focusable() ? 0 : -1',\n\t\ttype: 'button',\n\t\t'[attr.data-outside]': \"!selected() && outside() && (!end() && !start())? '' : null\",\n\t\t'[attr.data-today]': \"today() && !selected() ? '' : null\",\n\t\t'[attr.data-selected]': \"selected() ? '' : null\",\n\t\t'[attr.data-disabled]': \"disabled() ? '' : null\",\n\t\t'[attr.aria-selected]': \"selected() ? 'true' : null\",\n\t\t'[attr.aria-disabled]': \"disabled() ? 'true' : null\",\n\t\t'[attr.data-range-start]': 'start() ? \"\" : null',\n\t\t'[attr.data-range-end]': 'end() ? \"\" : null',\n\t\t'[attr.data-highlighted]': 'highlighted() ? \"\" : null',\n\t\t'[attr.data-range-between]': 'betweenRange() ? \"\" : null',\n\t\t'[disabled]': 'disabled()',\n\t\t'(click)': '_calendar.selectDate(date())',\n\t\t'(keydown.arrowLeft)': 'focusPrevious($event)',\n\t\t'(keydown.arrowRight)': 'focusNext($event)',\n\t\t'(keydown.arrowUp)': 'focusAbove($event)',\n\t\t'(keydown.arrowDown)': 'focusBelow($event)',\n\t\t'(keydown.home)': 'focusFirst($event)',\n\t\t'(keydown.end)': 'focusLast($event)',\n\t\t'(keydown.pageUp)': 'focusPreviousMonth($event)',\n\t\t'(keydown.pageDown)': 'focusNextMonth($event)',\n\t},\n})\nexport class BrnCalendarCellButton<T> {\n\t/** Access the date adapter */\n\tprotected readonly _dateAdapter = injectDateAdapter<T>();\n\n\t/** Access the calendar component */\n\tprotected readonly _calendar = injectBrnCalendar<T>();\n\n\t/** Access the element ref */\n\tprivate readonly _elementRef = inject<ElementRef<HTMLButtonElement>>(ElementRef);\n\n\t/** The date this cell represents */\n\tpublic readonly date = input.required<T>();\n\n\t/** Whether this date is currently selected */\n\tpublic readonly selected = computed(() => this._calendar.isSelected(this.date()));\n\tpublic readonly start = computed(() => this._calendar.isStartOfRange(this.date()));\n\tpublic readonly end = computed(() => this._calendar.isEndOfRange(this.date()));\n\tpublic readonly betweenRange = computed(() => this._calendar.isBetweenRange(this.date()));\n\tpublic readonly highlighted = computed(() =>\n\t\tthis._calendar.highlightDays().some((d) => this._dateAdapter.isSameDay(this.date(), d)),\n\t);\n\n\t/** Whether this date is focusable */\n\tpublic readonly focusable = computed(() => this._dateAdapter.isSameDay(this._calendar.focusedDate(), this.date()));\n\n\tpublic readonly outside = computed(() => {\n\t\tconst focusedDate = this._calendar.focusedDate();\n\t\treturn !this._dateAdapter.isSameMonth(this.date(), focusedDate);\n\t});\n\n\t/** Whether this date is today */\n\tpublic readonly today = computed(() => this._dateAdapter.isSameDay(this.date(), this._dateAdapter.now()));\n\n\t/** Whether this date is disabled */\n\tpublic readonly disabled = computed(() => this._calendar.isDateDisabled(this.date()) || this._calendar.disabled());\n\n\t/**\n\t * Focus the previous cell.\n\t */\n\tprotected focusPrevious(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\t// in rtl, the arrow keys are reversed.\n\t\tconst targetDate = this._dateAdapter.add(this._calendar.focusedDate(), {\n\t\t\tdays: this.getDirection() === 'rtl' ? 1 : -1,\n\t\t});\n\n\t\tthis._calendar.setFocusedDate(targetDate);\n\t}\n\n\t/**\n\t * Focus the next cell.\n\t */\n\tprotected focusNext(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tconst targetDate = this._dateAdapter.add(this._calendar.focusedDate(), {\n\t\t\tdays: this.getDirection() === 'rtl' ? -1 : 1,\n\t\t});\n\n\t\tthis._calendar.setFocusedDate(targetDate);\n\t}\n\n\t/**\n\t * Focus the above cell.\n\t */\n\tprotected focusAbove(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._calendar.setFocusedDate(this._dateAdapter.subtract(this._calendar.focusedDate(), { days: 7 }));\n\t}\n\n\t/**\n\t * Focus the below cell.\n\t */\n\tprotected focusBelow(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._calendar.setFocusedDate(this._dateAdapter.add(this._calendar.focusedDate(), { days: 7 }));\n\t}\n\n\t/**\n\t * Focus the first date of the month.\n\t */\n\tprotected focusFirst(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._calendar.setFocusedDate(this._dateAdapter.startOfMonth(this._calendar.focusedDate()));\n\t}\n\n\t/**\n\t * Focus the last date of the month.\n\t */\n\tprotected focusLast(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._calendar.setFocusedDate(this._dateAdapter.endOfMonth(this._calendar.focusedDate()));\n\t}\n\n\t/**\n\t * Focus the same date in the previous month.\n\t */\n\tprotected focusPreviousMonth(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tconst date = this._dateAdapter.getDate(this._calendar.focusedDate());\n\n\t\tlet previousMonthTarget = this._dateAdapter.startOfMonth(this._calendar.focusedDate());\n\t\tpreviousMonthTarget = this._dateAdapter.subtract(previousMonthTarget, { months: 1 });\n\n\t\tconst lastDay = this._dateAdapter.endOfMonth(previousMonthTarget);\n\n\t\t// if we are on a date that does not exist in the previous month, we should focus the last day of the month.\n\t\tif (date > this._dateAdapter.getDate(lastDay)) {\n\t\t\tthis._calendar.setFocusedDate(lastDay);\n\t\t} else {\n\t\t\tthis._calendar.setFocusedDate(this._dateAdapter.set(previousMonthTarget, { day: date }));\n\t\t}\n\t}\n\n\t/**\n\t * Focus the same date in the next month.\n\t */\n\tprotected focusNextMonth(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tconst date = this._dateAdapter.getDate(this._calendar.focusedDate());\n\n\t\tlet nextMonthTarget = this._dateAdapter.startOfMonth(this._calendar.focusedDate());\n\t\tnextMonthTarget = this._dateAdapter.add(nextMonthTarget, { months: 1 });\n\n\t\tconst lastDay = this._dateAdapter.endOfMonth(nextMonthTarget);\n\n\t\t// if we are on a date that does not exist in the next month, we should focus the last day of the month.\n\t\tif (date > this._dateAdapter.getDate(lastDay)) {\n\t\t\tthis._calendar.setFocusedDate(lastDay);\n\t\t} else {\n\t\t\tthis._calendar.setFocusedDate(this._dateAdapter.set(nextMonthTarget, { day: date }));\n\t\t}\n\t}\n\n\t/**\n\t * Get the direction of the element.\n\t */\n\tprivate getDirection(): 'ltr' | 'rtl' {\n\t\treturn getComputedStyle(this._elementRef.nativeElement).direction === 'rtl' ? 'rtl' : 'ltr';\n\t}\n\n\tfocus(): void {\n\t\tthis._elementRef.nativeElement.focus();\n\t}\n}\n","import { Directive, input } from '@angular/core';\n\nlet uniqueId = 0;\n\n@Directive({\n\tselector: '[brnCalendarHeader]',\n\thost: {\n\t\t'[id]': 'id()',\n\t\t'aria-live': 'polite',\n\t\trole: 'presentation',\n\t},\n})\nexport class BrnCalendarHeader {\n\t/** The unique id for the header */\n\tpublic readonly id = input<string>(`brn-calendar-header-${++uniqueId}`);\n}\n","import { inject, Injectable, InjectionToken, type Provider, signal } from '@angular/core';\n\nexport type Weekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type MonthLabels = [\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n];\n\nexport interface BrnCalendarI18n {\n\tformatWeekdayName: (index: number) => string;\n\tformatHeader: (month: number, year: number) => string;\n\tformatYear: (year: number) => string;\n\tformatMonth: (month: number) => string;\n\tlabelPrevious: () => string;\n\tlabelNext: () => string;\n\tlabelWeekday: (index: number) => string;\n\tmonths: () => [string, string, string, string, string, string, string, string, string, string, string, string];\n\tyears: (startYear?: number, endYear?: number) => number[];\n\tfirstDayOfWeek: () => Weekday;\n}\n\nexport const BrnCalendarI18nToken = new InjectionToken<BrnCalendarI18nService>('BrnCalendarI18nToken');\n\n/**\n * Provide the calendar i18n configuration.\n */\nexport function provideBrnCalendarI18n(configuration?: BrnCalendarI18n): Provider {\n\treturn {\n\t\tprovide: BrnCalendarI18nToken,\n\t\tuseFactory: () => {\n\t\t\tconst service = new BrnCalendarI18nService();\n\t\t\tservice.use(configuration ?? defaultCalendarI18n);\n\t\t\treturn service;\n\t\t},\n\t};\n}\n\nconst defaultCalendarI18n: BrnCalendarI18n = {\n\tformatWeekdayName: (index: number) => {\n\t\tconst weekdays = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];\n\t\treturn weekdays[index];\n\t},\n\tmonths: () => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n\tyears: (startYear = 1925, endYear = new Date().getFullYear() + 1) =>\n\t\tArray.from({ length: endYear - startYear + 1 }, (_, i) => startYear + i),\n\tformatHeader: (month: number, year: number) => {\n\t\treturn new Date(year, month).toLocaleDateString(undefined, {\n\t\t\tmonth: 'long',\n\t\t\tyear: 'numeric',\n\t\t});\n\t},\n\tformatMonth: (month: number) => {\n\t\treturn new Date(2000, month).toLocaleDateString(undefined, {\n\t\t\tmonth: 'short',\n\t\t});\n\t},\n\tformatYear: (year: number): string => {\n\t\treturn new Date(year, 0).toLocaleDateString(undefined, {\n\t\t\tyear: 'numeric',\n\t\t});\n\t},\n\tlabelPrevious: () => 'Go to the previous month',\n\tlabelNext: () => 'Go to the next month',\n\tlabelWeekday: (index: number) => {\n\t\tconst weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\t\treturn weekdays[index];\n\t},\n\tfirstDayOfWeek: () => 0,\n};\n\n/**\n * Inject the calendar i18n configuration.\n */\nexport function injectBrnCalendarI18n(): BrnCalendarI18nService {\n\treturn inject(BrnCalendarI18nToken, { optional: true }) ?? inject(BrnCalendarI18nService); // fallback\n}\n\n@Injectable({ providedIn: 'root' })\nexport class BrnCalendarI18nService {\n\tprivate readonly _config = signal<BrnCalendarI18n>(defaultCalendarI18n);\n\n\tpublic readonly config = this._config.asReadonly();\n\n\tpublic use(config: Partial<BrnCalendarI18n>) {\n\t\tthis._config.set({ ...this.config(), ...config });\n\t}\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\tChangeDetectorRef,\n\tcomputed,\n\tcontentChild,\n\tcontentChildren,\n\tDirective,\n\tinject,\n\tInjector,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\tnumberAttribute,\n} from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { BrnCalendarCellButton } from './brn-calendar-cell-button';\nimport { BrnCalendarHeader } from './brn-calendar-header';\nimport { type BrnCalendarBase, provideBrnCalendar } from './brn-calendar.token';\nimport { injectBrnCalendarI18n, type Weekday } from './i18n/calendar-i18n';\n\n@Directive({\n\tselector: '[brnCalendar]',\n\tproviders: [provideBrnCalendar(BrnCalendar)],\n})\nexport class BrnCalendar<T> implements BrnCalendarBase<T> {\n\tprivate readonly _i18n = injectBrnCalendarI18n();\n\n\t/** Access the date adapter */\n\tprotected readonly _dateAdapter = injectDateAdapter<T>();\n\n\t/** Access the change detector */\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the injector */\n\tprivate readonly _injector = inject(Injector);\n\n\t/** The days to highlight. */\n\tpublic readonly highlightDays = input<T[]>([]);\n\n\t/** The minimum date that can be selected.*/\n\tpublic readonly min = input<T>();\n\n\t/** The maximum date that can be selected. */\n\tpublic readonly max = input<T>();\n\n\t/** Determine if the date picker is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** The selected value. */\n\tpublic readonly date = model<T>();\n\n\t/** Whether a specific date is disabled. */\n\tpublic readonly dateDisabled = input<(date: T) => boolean>(() => false);\n\n\t/** The day the week starts on */\n\tpublic readonly weekStartsOn = input<Weekday, NumberInput | undefined>(undefined, {\n\t\ttransform: (v: unknown) => (v === undefined || v === null ? undefined : (numberAttribute(v) as Weekday)),\n\t});\n\n\tprotected readonly _weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek());\n\n\t/** The default focused date. */\n\tpublic readonly defaultFocusedDate = input<T>();\n\n\t/** @internal Access the header */\n\tpublic readonly header = contentChild(BrnCalendarHeader);\n\n\t/** Store the cells */\n\tprotected readonly _cells = contentChildren<BrnCalendarCellButton<T>>(BrnCalendarCellButton, {\n\t\tdescendants: true,\n\t});\n\n\t/**\n\t * The focused date.\n\t */\n\tpublic readonly focusedDate = linkedSignal(() =>\n\t\tthis.constrainDate(this.defaultFocusedDate() ?? this.date() ?? this._dateAdapter.now()),\n\t);\n\n\t/**\n\t * Get all the days to display, this is the days of the current month\n\t * and the days of the previous and next month to fill the grid.\n\t */\n\tpublic readonly days = computed(() => {\n\t\tconst weekStartsOn = this._weekStartsOn();\n\t\tconst month = this.focusedDate();\n\t\tconst days: T[] = [];\n\n\t\t// Get the first and last day of the month.\n\t\tlet firstDay = this._dateAdapter.startOfMonth(month);\n\t\tlet lastDay = this._dateAdapter.endOfMonth(month);\n\n\t\t// we need to subtract until we get the to starting day before or on the start of the month.\n\t\twhile (this._dateAdapter.getDay(firstDay) !== weekStartsOn) {\n\t\t\tfirstDay = this._dateAdapter.subtract(firstDay, { days: 1 });\n\t\t}\n\n\t\tconst weekEndsOn = (weekStartsOn + 6) % 7;\n\n\t\t// we need to add until we get to the ending day after or on the end of the month.\n\t\twhile (this._dateAdapter.getDay(lastDay) !== weekEndsOn) {\n\t\t\tlastDay = this._dateAdapter.add(lastDay, { days: 1 });\n\t\t}\n\n\t\t// collect all the days to display.\n\t\twhile (firstDay <= lastDay) {\n\t\t\tdays.push(firstDay);\n\t\t\tfirstDay = this._dateAdapter.add(firstDay, { days: 1 });\n\t\t}\n\n\t\treturn days;\n\t});\n\n\t/** @internal Constrain a date to the min and max boundaries */\n\tconstrainDate(date: T): T {\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\t// If there is no min or max, return the date.\n\t\tif (!min && !max) {\n\t\t\treturn date;\n\t\t}\n\n\t\t// If there is a min and the date is before the min, return the min.\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn min;\n\t\t}\n\n\t\t// If there is a max and the date is after the max, return the max.\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn max;\n\t\t}\n\n\t\t// Return the date.\n\t\treturn date;\n\t}\n\n\t/** @internal Determine if a date is disabled */\n\tisDateDisabled(date: T): boolean {\n\t\t// if the calendar is disabled we can't select this date\n\t\tif (this.disabled()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if the date is outside the min and max range\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if this specific date is disabled\n\t\tconst disabledFn = this.dateDisabled();\n\n\t\tif (disabledFn(date)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tisSelected(date: T): boolean {\n\t\tconst selected = this.date() as T | undefined;\n\t\treturn selected !== undefined && this._dateAdapter.isSameDay(date, selected);\n\t}\n\n\tselectDate(date: T): void {\n\t\tif (this.isSelected(date)) {\n\t\t\tthis.date.set(undefined);\n\t\t} else {\n\t\t\tthis.date.set(date);\n\t\t}\n\t\tthis.focusedDate.set(date);\n\t}\n\n\t/** @internal Set the focused date */\n\tsetFocusedDate(date: T): void {\n\t\t// check if the date is disabled.\n\t\tif (this.isDateDisabled(date)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.focusedDate.set(date);\n\n\t\t// wait until the cells have all updated\n\t\tafterNextRender(\n\t\t\t{\n\t\t\t\twrite: () => {\n\t\t\t\t\t// focus the cell with the target date.\n\t\t\t\t\tconst cell = this._cells().find((c) => this._dateAdapter.isSameDay(c.date(), date));\n\n\t\t\t\t\tif (cell) {\n\t\t\t\t\t\tcell.focus();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tinjector: this._injector,\n\t\t\t},\n\t\t);\n\n\t\t// we must update the view to ensure the focused cell is visible.\n\t\tthis._changeDetector.detectChanges();\n\t}\n\n\t/**\n\t * Determine if a date is the start of a range. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisStartOfRange(_: T): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine if a date is the end of a range. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisEndOfRange(_: T): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine if a date is between the start and end dates. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns True if the date is between the start and end dates, false otherwise.\n\t * @internal\n\t */\n\tisBetweenRange(_: T): boolean {\n\t\treturn false;\n\t}\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n\tselector: '[brnCalendarCell]',\n\thost: {\n\t\trole: 'presentation',\n\t},\n})\nexport class BrnCalendarCell {}\n","import { Directive } from '@angular/core';\nimport { injectBrnCalendar } from './brn-calendar.token';\n\n@Directive({\n\tselector: '[brnCalendarGrid]',\n\thost: {\n\t\trole: 'grid',\n\t\t'[attr.aria-labelledby]': '_calendar.header()?.id()',\n\t},\n})\nexport class BrnCalendarGrid<T> {\n\t/** Access the calendar component */\n\tprotected readonly _calendar = injectBrnCalendar<T>();\n}\n","import { computed, Directive, effect, inject } from '@angular/core';\nimport { outputToObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { BrnSelect } from '@spartan-ng/brain/select';\nimport { injectBrnCalendar } from './brn-calendar.token';\nimport { injectBrnCalendarI18n } from './i18n/calendar-i18n';\n\n@Directive({\n\tselector: 'brnSelect[brnCalendarMonthSelect],hlm-select[brnCalendarMonthSelect]',\n})\nexport class BrnCalendarMonthSelect {\n\t/** Access the select */\n\tprivate readonly _select = inject(BrnSelect);\n\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar();\n\n\t/** Access the date adapter */\n\tprivate readonly _dateAdapter = injectDateAdapter();\n\n\t/** Access the calendar i18n */\n\tprotected readonly _i18n = injectBrnCalendarI18n();\n\n\tprotected readonly _selectedMonth = computed(() => {\n\t\treturn this._i18n.config().months()[this._dateAdapter.getMonth(this._calendar.focusedDate())];\n\t});\n\n\tconstructor() {\n\t\t// React to user selection through the injected select's typed `value` output rather than a\n\t\t// host-listener `$event` (which Angular types as `Event`). The month select's values are the\n\t\t// month strings, so narrow to `string` before handling.\n\t\toutputToObservable(this._select.value)\n\t\t\t.pipe(takeUntilDestroyed())\n\t\t\t.subscribe((value) => {\n\t\t\t\tif (typeof value === 'string') {\n\t\t\t\t\tthis.monthSelected(value);\n\t\t\t\t}\n\t\t\t});\n\n\t\teffect(() => {\n\t\t\tthis._select.writeValue(this._selectedMonth());\n\t\t});\n\t}\n\n\t/** Focus selected month */\n\tprivate monthSelected(selectedMonth: string): void {\n\t\tconst month = this._i18n\n\t\t\t.config()\n\t\t\t.months()\n\t\t\t.findIndex((month) => month === selectedMonth);\n\t\tconst targetDate = this._dateAdapter.set(this._calendar.focusedDate(), { month });\n\t\tthis._calendar.focusedDate.set(targetDate);\n\t}\n}\n","import { Directive } from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { injectBrnCalendar } from './brn-calendar.token';\nimport { injectBrnCalendarI18n } from './i18n/calendar-i18n';\n\n@Directive({\n\tselector: '[brnCalendarNextButton]',\n\thost: {\n\t\ttype: 'button',\n\t\t'data-slot': 'calendar-next-button',\n\t\t'[attr.aria-label]': '_i18n.config().labelNext()',\n\t\t'(click)': 'focusNextMonth()',\n\t},\n})\nexport class BrnCalendarNextButton {\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar();\n\n\t/** Access the date adapter */\n\tprivate readonly _dateAdapter = injectDateAdapter();\n\n\t/** Access the calendar i18n */\n\tprotected readonly _i18n = injectBrnCalendarI18n();\n\n\t/** Focus the next month */\n\tprotected focusNextMonth(): void {\n\t\tconst focusedDate = this._calendar.focusedDate();\n\t\tconst date = this._dateAdapter.getDate(focusedDate);\n\n\t\t// go to start of month first, then add 1 month to avoid day overflow\n\t\tlet nextMonthTarget = this._dateAdapter.startOfMonth(focusedDate);\n\t\tnextMonthTarget = this._dateAdapter.add(nextMonthTarget, { months: 1 });\n\n\t\tconst lastDay = this._dateAdapter.endOfMonth(nextMonthTarget);\n\n\t\t// if we are on a date that does not exist in the next month, clamp to the last day of the month.\n\t\tlet targetDate: typeof focusedDate;\n\t\tif (date > this._dateAdapter.getDate(lastDay)) {\n\t\t\ttargetDate = lastDay;\n\t\t} else {\n\t\t\ttargetDate = this._dateAdapter.set(nextMonthTarget, { day: date });\n\t\t}\n\n\t\t// if the date is disabled, but there are available dates in the month, focus the constrained date.\n\t\tconst possibleDate = this._calendar.constrainDate(targetDate);\n\n\t\tif (this._dateAdapter.isSameMonth(possibleDate, targetDate)) {\n\t\t\t// if this date is within the same month, then focus it\n\t\t\tthis._calendar.focusedDate.set(possibleDate);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._calendar.focusedDate.set(targetDate);\n\t}\n}\n","import { Directive } from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { injectBrnCalendar } from './brn-calendar.token';\nimport { injectBrnCalendarI18n } from './i18n/calendar-i18n';\n\n@Directive({\n\tselector: '[brnCalendarPreviousButton]',\n\thost: {\n\t\ttype: 'button',\n\t\t'data-slot': 'calendar-previous-button',\n\t\t'[attr.aria-label]': '_i18n.config().labelPrevious()',\n\t\t'(click)': 'focusPreviousMonth()',\n\t},\n})\nexport class BrnCalendarPreviousButton {\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar();\n\n\t/** Access the date adapter */\n\tprivate readonly _dateAdapter = injectDateAdapter();\n\n\t/** Access the calendar i18n */\n\tprotected readonly _i18n = injectBrnCalendarI18n();\n\n\t/** Focus the previous month */\n\tprotected focusPreviousMonth(): void {\n\t\tconst focusedDate = this._calendar.focusedDate();\n\t\tconst date = this._dateAdapter.getDate(focusedDate);\n\n\t\t// go to start of month first, then subtract 1 month to avoid day overflow\n\t\tlet previousMonthTarget = this._dateAdapter.startOfMonth(focusedDate);\n\t\tpreviousMonthTarget = this._dateAdapter.subtract(previousMonthTarget, { months: 1 });\n\n\t\tconst lastDay = this._dateAdapter.endOfMonth(previousMonthTarget);\n\n\t\t// if we are on a date that does not exist in the previous month, clamp to the last day of the month.\n\t\tlet targetDate: typeof focusedDate;\n\t\tif (date > this._dateAdapter.getDate(lastDay)) {\n\t\t\ttargetDate = lastDay;\n\t\t} else {\n\t\t\ttargetDate = this._dateAdapter.set(previousMonthTarget, { day: date });\n\t\t}\n\n\t\t// if the date is disabled, but there are available dates in the month, focus the constrained date.\n\t\tconst possibleDate = this._calendar.constrainDate(targetDate);\n\n\t\tif (this._dateAdapter.isSameMonth(possibleDate, targetDate)) {\n\t\t\t// if this date is within the same month, then focus it\n\t\t\tthis._calendar.focusedDate.set(possibleDate);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._calendar.focusedDate.set(targetDate);\n\t}\n}\n","import {\n\tChangeDetectorRef,\n\tDirective,\n\ttype EmbeddedViewRef,\n\ttype OnDestroy,\n\tTemplateRef,\n\tViewContainerRef,\n\tcomputed,\n\teffect,\n\tinject,\n\tuntracked,\n} from '@angular/core';\nimport { injectBrnCalendar } from './brn-calendar.token';\n\n@Directive({\n\tselector: '[brnCalendarWeek]',\n})\nexport class BrnCalendarWeek<T> implements OnDestroy {\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar<T>();\n\n\t/** Access the view container ref */\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\n\t/** Access the change detector */\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the template ref */\n\tprivate readonly _templateRef = inject<TemplateRef<BrnWeekContext<T>>>(TemplateRef);\n\n\t// get the weeks to display.\n\tprotected readonly _weeks = computed(() => {\n\t\tconst days = this._calendar.days();\n\t\tconst weeks = [];\n\n\t\tfor (let i = 0; i < days.length; i += 7) {\n\t\t\tweeks.push(days.slice(i, i + 7));\n\t\t}\n\n\t\treturn weeks;\n\t});\n\n\t/** Store the view refs */\n\tprivate _viewRefs: EmbeddedViewRef<BrnWeekContext<T>>[] = [];\n\n\t// Make sure the template checker knows the type of the context with which the\n\t// template of this directive will be rendered\n\tstatic ngTemplateContextGuard<T>(_: BrnCalendarWeek<T>, ctx: unknown): ctx is BrnWeekContext<T> {\n\t\treturn true;\n\t}\n\n\tconstructor() {\n\t\t// this should use `afterRenderEffect` but it's not available in the current version\n\t\teffect(() => {\n\t\t\tconst weeks = this._weeks();\n\t\t\tuntracked(() => this._renderWeeks(weeks));\n\t\t});\n\t}\n\n\tprivate _renderWeeks(weeks: T[][]): void {\n\t\t// Destroy all the views when the directive is destroyed\n\t\tfor (const viewRef of this._viewRefs) {\n\t\t\tviewRef.destroy();\n\t\t}\n\n\t\tthis._viewRefs = [];\n\n\t\t// Create a new view for each week\n\t\tfor (const week of weeks) {\n\t\t\tconst viewRef = this._viewContainerRef.createEmbeddedView(this._templateRef, {\n\t\t\t\t$implicit: week,\n\t\t\t});\n\t\t\tthis._viewRefs.push(viewRef);\n\t\t}\n\n\t\tthis._changeDetector.detectChanges();\n\t}\n\n\tngOnDestroy(): void {\n\t\t// Destroy all the views when the directive is destroyed\n\t\tfor (const viewRef of this._viewRefs) {\n\t\t\tviewRef.destroy();\n\t\t}\n\t}\n}\n\ninterface BrnWeekContext<T> {\n\t$implicit: T[];\n}\n","import {\n\tChangeDetectorRef,\n\tcomputed,\n\tDirective,\n\teffect,\n\ttype EmbeddedViewRef,\n\tinject,\n\ttype OnDestroy,\n\tTemplateRef,\n\tuntracked,\n\tViewContainerRef,\n} from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { injectBrnCalendar } from './brn-calendar.token';\n\n@Directive({\n\tselector: '[brnCalendarWeekday]',\n})\nexport class BrnCalendarWeekday<T> implements OnDestroy {\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar<T>();\n\n\t/** Access the date time adapter */\n\tprivate readonly _dateAdapter = injectDateAdapter<T>();\n\n\t/** Access the view container ref */\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\n\t/** Access the change detector */\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the template ref */\n\tprivate readonly _templateRef = inject<TemplateRef<BrnWeekdayContext>>(TemplateRef);\n\n\t/** Get the days of the week to display in the header. */\n\tprotected readonly _weekdays = computed(() => this._calendar.days().slice(0, 7));\n\n\t/** Store the view refs */\n\tprivate _viewRefs: EmbeddedViewRef<BrnWeekdayContext>[] = [];\n\n\t// Make sure the template checker knows the type of the context with which the\n\t// template of this directive will be rendered\n\tstatic ngTemplateContextGuard<T>(_: BrnCalendarWeekday<T>, ctx: unknown): ctx is BrnWeekdayContext {\n\t\treturn true;\n\t}\n\n\tconstructor() {\n\t\t// Create a new view for each day\n\t\teffect(() => {\n\t\t\t// Get the weekdays to display\n\t\t\tconst weekdays = this._weekdays();\n\t\t\t// Render the weekdays\n\t\t\tuntracked(() => this._renderWeekdays(weekdays));\n\t\t});\n\t}\n\n\tprivate _renderWeekdays(weekdays: T[]): void {\n\t\t// Destroy all the views when the directive is destroyed\n\t\tfor (const viewRef of this._viewRefs) {\n\t\t\tviewRef.destroy();\n\t\t}\n\n\t\tthis._viewRefs = [];\n\n\t\t// Create a new view for each day\n\t\tfor (const day of weekdays) {\n\t\t\tconst viewRef = this._viewContainerRef.createEmbeddedView(this._templateRef, {\n\t\t\t\t$implicit: this._dateAdapter.getDay(day),\n\t\t\t});\n\t\t\tthis._viewRefs.push(viewRef);\n\t\t}\n\n\t\tthis._changeDetector.detectChanges();\n\t}\n\n\tngOnDestroy(): void {\n\t\t// Destroy all the views when the directive is destroyed\n\t\tfor (const viewRef of this._viewRefs) {\n\t\t\tviewRef.destroy();\n\t\t}\n\t}\n}\n\ninterface BrnWeekdayContext {\n\t$implicit: number;\n}\n","import { Directive, effect, inject } from '@angular/core';\nimport { outputToObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { BrnSelect } from '@spartan-ng/brain/select';\nimport { injectBrnCalendar } from './brn-calendar.token';\nimport { injectBrnCalendarI18n } from './i18n/calendar-i18n';\n\n@Directive({\n\tselector: 'brnSelect[brnCalendarYearSelect],hlm-select[brnCalendarYearSelect]',\n})\nexport class BrnCalendarYearSelect {\n\t/** Access the select */\n\tprivate readonly _select = inject(BrnSelect);\n\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar();\n\n\t/** Access the date adapter */\n\tprivate readonly _dateAdapter = injectDateAdapter();\n\n\t/** Access the calendar i18n */\n\tprotected readonly _i18n = injectBrnCalendarI18n();\n\n\tconstructor() {\n\t\t// React to user selection through the injected select's typed `value` output rather than a\n\t\t// host-listener `$event` (which Angular types as `Event`). The year select's values are\n\t\t// numbers, so narrow to `number` before handling.\n\t\toutputToObservable(this._select.value)\n\t\t\t.pipe(takeUntilDestroyed())\n\t\t\t.subscribe((value) => {\n\t\t\t\tif (typeof value === 'number') {\n\t\t\t\t\tthis.yearSelected(value);\n\t\t\t\t}\n\t\t\t});\n\n\t\teffect(() => {\n\t\t\tthis._select.writeValue(this._dateAdapter.getYear(this._calendar.focusedDate()));\n\t\t});\n\t}\n\n\t/** Focus selected year */\n\tprivate yearSelected(year: number): void {\n\t\tconst targetDate = this._dateAdapter.set(this._calendar.focusedDate(), { year });\n\t\tthis._calendar.focusedDate.set(targetDate);\n\t}\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\tChangeDetectorRef,\n\tcomputed,\n\tcontentChild,\n\tcontentChildren,\n\tDirective,\n\tinject,\n\tInjector,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\tnumberAttribute,\n} from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { BrnCalendarCellButton } from '../brn-calendar-cell-button';\nimport { BrnCalendarHeader } from '../brn-calendar-header';\nimport { type BrnCalendarBase, provideBrnCalendar } from '../brn-calendar.token';\nimport { injectBrnCalendarI18n, type Weekday } from '../i18n/calendar-i18n';\n\n@Directive({\n\tselector: '[brnCalendarMulti]',\n\tproviders: [provideBrnCalendar(BrnCalendarMulti)],\n})\nexport class BrnCalendarMulti<T> implements BrnCalendarBase<T> {\n\tprivate readonly _i18n = injectBrnCalendarI18n();\n\n\t/**\n\t * Determine if a date is the start of a range. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisStartOfRange(_: T): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine if a date is the end of a range. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisEndOfRange(_: T): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine if a date is between the start and end dates. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns True if the date is between the start and end dates, false otherwise.\n\t * @internal\n\t */\n\tisBetweenRange(_: T): boolean {\n\t\treturn false;\n\t}\n\n\t// /** Access the date adapter */\n\tprotected readonly _dateAdapter = injectDateAdapter<T>();\n\n\t/** Access the change detector */\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the injector */\n\tprivate readonly _injector = inject(Injector);\n\n\t/** The days to highlight. */\n\tpublic readonly highlightDays = input<T[]>([]);\n\n\t/** The minimum date that can be selected.*/\n\tpublic readonly min = input<T>();\n\n\t/** The maximum date that can be selected. */\n\tpublic readonly max = input<T>();\n\n\t/** The minimum selectable dates. */\n\tpublic readonly minSelection = input<number, NumberInput>(undefined, {\n\t\ttransform: numberAttribute,\n\t});\n\n\t/** The maximum selectable dates. */\n\tpublic readonly maxSelection = input<number, NumberInput>(undefined, {\n\t\ttransform: numberAttribute,\n\t});\n\n\t/** Determine if the date picker is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** The selected value. */\n\tpublic readonly date = model<T[]>();\n\n\t/** Whether a specific date is disabled. */\n\tpublic readonly dateDisabled = input<(date: T) => boolean>(() => false);\n\n\t/** The day the week starts on */\n\tpublic readonly weekStartsOn = input<Weekday, NumberInput | undefined>(undefined, {\n\t\ttransform: (v: unknown) => (v === undefined || v === null ? undefined : (numberAttribute(v) as Weekday)),\n\t});\n\n\tprotected readonly _weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek());\n\n\t/** The default focused date. */\n\tpublic readonly defaultFocusedDate = input<T>();\n\n\t/** @internal Access the header */\n\tpublic readonly header = contentChild(BrnCalendarHeader);\n\n\t/** Store the cells */\n\tprotected readonly _cells = contentChildren<BrnCalendarCellButton<T>>(BrnCalendarCellButton, {\n\t\tdescendants: true,\n\t});\n\n\t/**\n\t * The focused date.\n\t */\n\tpublic readonly focusedDate = linkedSignal(() =>\n\t\tthis.constrainDate(this.defaultFocusedDate() ?? this._dateAdapter.now()),\n\t);\n\n\t/**\n\t * Get all the days to display, this is the days of the current month\n\t * and the days of the previous and next month to fill the grid.\n\t */\n\tpublic readonly days = computed(() => {\n\t\tconst weekStartsOn = this._weekStartsOn();\n\t\tconst month = this.focusedDate();\n\t\tconst days: T[] = [];\n\n\t\t// Get the first and last day of the month.\n\t\tlet firstDay = this._dateAdapter.startOfMonth(month);\n\t\tlet lastDay = this._dateAdapter.endOfMonth(month);\n\n\t\t// we need to subtract until we get the to starting day before or on the start of the month.\n\t\twhile (this._dateAdapter.getDay(firstDay) !== weekStartsOn) {\n\t\t\tfirstDay = this._dateAdapter.subtract(firstDay, { days: 1 });\n\t\t}\n\n\t\tconst weekEndsOn = (weekStartsOn + 6) % 7;\n\n\t\t// we need to add until we get to the ending day after or on the end of the month.\n\t\twhile (this._dateAdapter.getDay(lastDay) !== weekEndsOn) {\n\t\t\tlastDay = this._dateAdapter.add(lastDay, { days: 1 });\n\t\t}\n\n\t\t// collect all the days to display.\n\t\twhile (firstDay <= lastDay) {\n\t\t\tdays.push(firstDay);\n\t\t\tfirstDay = this._dateAdapter.add(firstDay, { days: 1 });\n\t\t}\n\n\t\treturn days;\n\t});\n\n\tisSelected(date: T): boolean {\n\t\treturn this.date()?.some((d) => this._dateAdapter.isSameDay(d, date)) ?? false;\n\t}\n\n\tselectDate(date: T): void {\n\t\tconst selected = this.date() as T[] | undefined;\n\t\tif (this.isSelected(date)) {\n\t\t\tconst minSelection = this.minSelection();\n\t\t\tif (selected?.length === minSelection) {\n\t\t\t\t// min selection reached, do not allow to deselect\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.date.set(selected?.filter((d) => !this._dateAdapter.isSameDay(d, date)));\n\t\t} else {\n\t\t\tconst maxSelection = this.maxSelection();\n\t\t\tif (selected?.length === maxSelection) {\n\t\t\t\t// max selection reached, reset the selection to date\n\t\t\t\tthis.date.set([date]);\n\t\t\t} else {\n\t\t\t\t// add the date to the selection\n\t\t\t\tthis.date.set([...(selected ?? []), date]);\n\t\t\t}\n\t\t}\n\t}\n\n\t// same as in brn-calendar.directive.ts\n\t/** @internal Constrain a date to the min and max boundaries */\n\tconstrainDate(date: T): T {\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\t// If there is no min or max, return the date.\n\t\tif (!min && !max) {\n\t\t\treturn date;\n\t\t}\n\n\t\t// If there is a min and the date is before the min, return the min.\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn min;\n\t\t}\n\n\t\t// If there is a max and the date is after the max, return the max.\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn max;\n\t\t}\n\n\t\t// Return the date.\n\t\treturn date;\n\t}\n\n\t/** @internal Determine if a date is disabled */\n\tisDateDisabled(date: T): boolean {\n\t\t// if the calendar is disabled we can't select this date\n\t\tif (this.disabled()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if the date is outside the min and max range\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if this specific date is disabled\n\t\tconst disabledFn = this.dateDisabled();\n\n\t\tif (disabledFn(date)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/** @internal Set the focused date */\n\tsetFocusedDate(date: T): void {\n\t\t// check if the date is disabled.\n\t\tif (this.isDateDisabled(date)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.focusedDate.set(date);\n\n\t\t// wait until the cells have all updated\n\t\tafterNextRender(\n\t\t\t{\n\t\t\t\twrite: () => {\n\t\t\t\t\t// focus the cell with the target date.\n\t\t\t\t\tconst cell = this._cells().find((c) => this._dateAdapter.isSameDay(c.date(), date));\n\n\t\t\t\t\tif (cell) {\n\t\t\t\t\t\tcell.focus();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tinjector: this._injector,\n\t\t\t},\n\t\t);\n\n\t\t// we must update the view to ensure the focused cell is visible.\n\t\tthis._changeDetector.detectChanges();\n\t}\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\tChangeDetectorRef,\n\tcomputed,\n\tcontentChild,\n\tcontentChildren,\n\tDirective,\n\tinject,\n\tInjector,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\tnumberAttribute,\n} from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { BrnCalendarCellButton } from '../brn-calendar-cell-button';\nimport { BrnCalendarHeader } from '../brn-calendar-header';\nimport { type BrnCalendarBase, provideBrnCalendar } from '../brn-calendar.token';\nimport { injectBrnCalendarI18n, type Weekday } from '../i18n/calendar-i18n';\n\n@Directive({\n\tselector: '[brnCalendarRange]',\n\tproviders: [provideBrnCalendar(BrnCalendarRange)],\n})\nexport class BrnCalendarRange<T> implements BrnCalendarBase<T> {\n\tprivate readonly _i18n = injectBrnCalendarI18n();\n\t// /** Access the date adapter */\n\tprotected readonly _dateAdapter = injectDateAdapter<T>();\n\n\t/** Access the change detector */\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the injector */\n\tprivate readonly _injector = inject(Injector);\n\n\t/** The days to highlight. */\n\tpublic readonly highlightDays = input<T[]>([]);\n\n\t/** The minimum date that can be selected.*/\n\tpublic readonly min = input<T>();\n\n\t/** The maximum date that can be selected. */\n\tpublic readonly max = input<T>();\n\n\t/** Determine if the date picker is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Whether a specific date is disabled. */\n\tpublic readonly dateDisabled = input<(date: T) => boolean>(() => false);\n\n\t/** The day the week starts on */\n\tpublic readonly weekStartsOn = input<Weekday, NumberInput | undefined>(undefined, {\n\t\ttransform: (v: unknown) => (v === undefined || v === null ? undefined : (numberAttribute(v) as Weekday)),\n\t});\n\n\tprotected readonly _weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek());\n\n\t/** The default focused date. */\n\tpublic readonly defaultFocusedDate = input<T>();\n\n\t/** @internal Access the header */\n\tpublic readonly header = contentChild(BrnCalendarHeader);\n\n\t/** Store the cells */\n\tprotected readonly _cells = contentChildren<BrnCalendarCellButton<T>>(BrnCalendarCellButton, {\n\t\tdescendants: true,\n\t});\n\n\t/**\n\t * The focused date.\n\t */\n\tpublic readonly focusedDate = linkedSignal(() =>\n\t\tthis.constrainDate(this.defaultFocusedDate() ?? this.startDate() ?? this._dateAdapter.now()),\n\t);\n\n\t/**\n\t * The selected start date\n\t */\n\tpublic readonly startDate = model<T>();\n\n\t/**\n\t * The selected end date\n\t */\n\tpublic readonly endDate = model<T>();\n\n\t/**\n\t * Get all the days to display, this is the days of the current month\n\t * and the days of the previous and next month to fill the grid.\n\t */\n\tpublic readonly days = computed(() => {\n\t\tconst weekStartsOn = this._weekStartsOn();\n\t\tconst month = this.focusedDate();\n\t\tconst days: T[] = [];\n\n\t\t// Get the first and last day of the month.\n\t\tlet firstDay = this._dateAdapter.startOfMonth(month);\n\t\tlet lastDay = this._dateAdapter.endOfMonth(month);\n\n\t\t// we need to subtract until we get the to starting day before or on the start of the month.\n\t\twhile (this._dateAdapter.getDay(firstDay) !== weekStartsOn) {\n\t\t\tfirstDay = this._dateAdapter.subtract(firstDay, { days: 1 });\n\t\t}\n\n\t\tconst weekEndsOn = (weekStartsOn + 6) % 7;\n\n\t\t// we need to add until we get to the ending day after or on the end of the month.\n\t\twhile (this._dateAdapter.getDay(lastDay) !== weekEndsOn) {\n\t\t\tlastDay = this._dateAdapter.add(lastDay, { days: 1 });\n\t\t}\n\n\t\t// collect all the days to display.\n\t\twhile (firstDay <= lastDay) {\n\t\t\tdays.push(firstDay);\n\t\t\tfirstDay = this._dateAdapter.add(firstDay, { days: 1 });\n\t\t}\n\n\t\treturn days;\n\t});\n\n\tisSelected(date: T): boolean {\n\t\tconst start = this.startDate();\n\t\tconst end = this.endDate();\n\n\t\tif (!start && !end) {\n\t\t\treturn false;\n\t\t}\n\t\tconst isStartSelected = start ? this._dateAdapter.isSameDay(date, start) : false;\n\t\tconst isEndSelected = end ? this._dateAdapter.isSameDay(date, end) : false;\n\n\t\treturn isStartSelected || isEndSelected;\n\t}\n\n\tselectDate(date: T): void {\n\t\tconst start = this.startDate();\n\t\tconst end = this.endDate();\n\n\t\tif (!start && !end) {\n\t\t\tthis.startDate.set(date);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (start && !end) {\n\t\t\tif (this._dateAdapter.isAfter(date, start)) {\n\t\t\t\tthis.endDate.set(date);\n\t\t\t} else if (this._dateAdapter.isBefore(date, start)) {\n\t\t\t\tthis.startDate.set(date);\n\t\t\t\tthis.endDate.set(start);\n\t\t\t} else if (this._dateAdapter.isSameDay(date, start)) {\n\t\t\t\tthis.endDate.set(date);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// If both start and end are selected, reset selection\n\t\tthis.startDate.set(date);\n\n\t\tthis.endDate.set(undefined);\n\t}\n\n\t// same as in brn-calendar.directive.ts\n\t/** @internal Constrain a date to the min and max boundaries */\n\tconstrainDate(date: T): T {\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\t// If there is no min or max, return the date.\n\t\tif (!min && !max) {\n\t\t\treturn date;\n\t\t}\n\n\t\t// If there is a min and the date is before the min, return the min.\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn min;\n\t\t}\n\n\t\t// If there is a max and the date is after the max, return the max.\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn max;\n\t\t}\n\n\t\t// Return the date.\n\t\treturn date;\n\t}\n\n\t/** @internal Determine if a date is disabled */\n\tisDateDisabled(date: T): boolean {\n\t\t// if the calendar is disabled we can't select this date\n\t\tif (this.disabled()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if the date is outside the min and max range\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if this specific date is disabled\n\t\tconst disabledFn = this.dateDisabled();\n\n\t\tif (disabledFn(date)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/** @internal Set the focused date */\n\tsetFocusedDate(date: T): void {\n\t\t// check if the date is disabled.\n\t\tif (this.isDateDisabled(date)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.focusedDate.set(date);\n\n\t\t// wait until the cells have all updated\n\t\tafterNextRender(\n\t\t\t{\n\t\t\t\twrite: () => {\n\t\t\t\t\t// focus the cell with the target date.\n\t\t\t\t\tconst cell = this._cells().find((c) => this._dateAdapter.isSameDay(c.date(), date));\n\n\t\t\t\t\tif (cell) {\n\t\t\t\t\t\tcell.focus();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tinjector: this._injector,\n\t\t\t},\n\t\t);\n\n\t\t// we must update the view to ensure the focused cell is visible.\n\t\tthis._changeDetector.detectChanges();\n\t}\n\n\t/**\n\t * Determine if a date is the start of a range.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisStartOfRange(date: T): boolean {\n\t\tconst start = this.startDate();\n\t\treturn start ? this._dateAdapter.isSameDay(date, start) : false;\n\t}\n\n\t/**\n\t * Determine if a date is the end of a range.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisEndOfRange(date: T): boolean {\n\t\tconst end = this.endDate();\n\t\treturn end ? this._dateAdapter.isSameDay(date, end) : false;\n\t}\n\n\t/**\n\t * Determine if a date is between the start and end dates.\n\t * @param date The date to check.\n\t * @returns True if the date is between the start and end dates, false otherwise.\n\t * @internal\n\t */\n\tisBetweenRange(date: T): boolean {\n\t\tconst start = this.startDate();\n\t\tconst end = this.endDate();\n\n\t\tif (!start || !end) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tthis._dateAdapter.isAfter(date, start) &&\n\t\t\tthis._dateAdapter.isBefore(date, end) &&\n\t\t\t!this._dateAdapter.isSameDay(date, start) &&\n\t\t\t!this._dateAdapter.isSameDay(date, end)\n\t\t);\n\t}\n}\n","import { BrnCalendar } from './lib/brn-calendar';\nimport { BrnCalendarCell } from './lib/brn-calendar-cell';\nimport { BrnCalendarCellButton } from './lib/brn-calendar-cell-button';\nimport { BrnCalendarGrid } from './lib/brn-calendar-grid';\nimport { BrnCalendarHeader } from './lib/brn-calendar-header';\nimport { BrnCalendarMonthSelect } from './lib/brn-calendar-month-select';\nimport { BrnCalendarNextButton } from './lib/brn-calendar-next-button';\nimport { BrnCalendarPreviousButton } from './lib/brn-calendar-previous-button';\nimport { BrnCalendarWeek } from './lib/brn-calendar-week';\nimport { BrnCalendarWeekday } from './lib/brn-calendar-weekday';\nimport { BrnCalendarYearSelect } from './lib/brn-calendar-year-select';\nimport { BrnCalendarMulti } from './lib/mode/brn-calendar-multiple';\nimport { BrnCalendarRange } from './lib/mode/brn-calendar-range';\n\nexport * from './lib/brn-calendar';\nexport * from './lib/brn-calendar-cell';\nexport * from './lib/brn-calendar-cell-button';\nexport * from './lib/brn-calendar-grid';\nexport * from './lib/brn-calendar-header';\nexport * from './lib/brn-calendar-month-select';\nexport * from './lib/brn-calendar-next-button';\nexport * from './lib/brn-calendar-previous-button';\nexport * from './lib/brn-calendar-week';\nexport * from './lib/brn-calendar-weekday';\nexport * from './lib/brn-calendar-year-select';\nexport * from './lib/brn-calendar.token';\nexport * from './lib/i18n/calendar-i18n';\nexport * from './lib/mode/brn-calendar-multiple';\nexport * from './lib/mode/brn-calendar-range';\n\nexport const BrnCalendarImports = [\n\tBrnCalendarCellButton,\n\tBrnCalendarGrid,\n\tBrnCalendarHeader,\n\tBrnCalendarNextButton,\n\tBrnCalendarPreviousButton,\n\tBrnCalendarWeek,\n\tBrnCalendarWeekday,\n\tBrnCalendar,\n\tBrnCalendarCell,\n\tBrnCalendarMulti,\n\tBrnCalendarRange,\n\tBrnCalendarMonthSelect,\n\tBrnCalendarYearSelect,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MA8Ba,gBAAgB,GAAG,IAAI,cAAc,CAA2B,kBAAkB;AAEzF,SAAU,kBAAkB,CAAI,QAAkC,EAAA;IACvE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE;AAC5D;AAEA;;AAEG;SACa,iBAAiB,GAAA;AAChC,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAuB;AACtD;;MCTa,qBAAqB,CAAA;;IAEd,YAAY,GAAG,iBAAiB,EAAK;;IAGrC,SAAS,GAAG,iBAAiB,EAAK;;AAGpC,IAAA,WAAW,GAAG,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A,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAGe,qBAAqB,CAAA,EAAA,EAAA,GAAE;AAC5F,4BAAA,WAAW,EAAE,IAAI;AACjB,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACxCK,MAAM,kBAAkB,GAAG;IACjC,qBAAqB;IACrB,eAAe;IACf,iBAAiB;IACjB,qBAAqB;IACrB,yBAAyB;IACzB,eAAe;IACf,kBAAkB;IAClB,WAAW;IACX,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,sBAAsB;IACtB,qBAAqB;;;AC3CtB;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-calendar.mjs","sources":["../../../../libs/brain/calendar/src/lib/brn-calendar-header.ts","../../../../libs/brain/calendar/src/lib/brn-calendar.token.ts","../../../../libs/brain/calendar/src/lib/i18n/calendar-i18n.ts","../../../../libs/brain/calendar/src/lib/utils/compare-days.ts","../../../../libs/brain/calendar/src/lib/brn-calendar.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-cell.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-cell-button.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-grid.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-month-select.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-next-button.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-previous-button.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-week.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-weekday.ts","../../../../libs/brain/calendar/src/lib/brn-calendar-year-select.ts","../../../../libs/brain/calendar/src/lib/mode/brn-calendar-multiple.ts","../../../../libs/brain/calendar/src/lib/mode/brn-calendar-range.ts","../../../../libs/brain/calendar/src/index.ts","../../../../libs/brain/calendar/src/spartan-ng-brain-calendar.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\n\nlet uniqueId = 0;\n\n@Directive({\n\tselector: '[brnCalendarHeader]',\n\thost: {\n\t\t'[id]': 'id()',\n\t\t'aria-live': 'polite',\n\t\trole: 'presentation',\n\t},\n})\nexport class BrnCalendarHeader {\n\t/** The unique id for the header */\n\tpublic readonly id = input<string>(`brn-calendar-header-${++uniqueId}`);\n}\n","import {\n\ttype ExistingProvider,\n\tinject,\n\tInjectionToken,\n\ttype InputSignal,\n\ttype Signal,\n\ttype Type,\n\ttype WritableSignal,\n} from '@angular/core';\nimport type { BrnCalendarCellButton } from './brn-calendar-cell-button';\nimport type { BrnCalendarHeader } from './brn-calendar-header';\n\nexport interface BrnCalendarBase<T> {\n\tisSelected: (date: T) => boolean;\n\tselectDate: (date: T) => void;\n\n\tconstrainDate: (date: T) => T;\n\tisDateDisabled: (date: T) => boolean;\n\tsetFocusedDate: (date: T) => void;\n\n\tisStartOfRange: (date: T) => boolean;\n\tisEndOfRange: (date: T) => boolean;\n\tisBetweenRange: (date: T) => boolean;\n\n\tdisabled: Signal<boolean>;\n\tfocusedDate: WritableSignal<T>;\n\theader: Signal<BrnCalendarHeader | undefined>;\n\tdays: Signal<T[]>;\n\thighlightDays: InputSignal<T[]>;\n\n\tunregisterCalendarCell(cell: BrnCalendarCellButton<T>): void;\n\tregisterCalendarCell(cell: BrnCalendarCellButton<T>): void;\n}\n\nexport const BrnCalendarToken = new InjectionToken<BrnCalendarBase<unknown>>('BrnCalendarToken');\n\nexport function provideBrnCalendar<T>(instance: Type<BrnCalendarBase<T>>): ExistingProvider {\n\treturn { provide: BrnCalendarToken, useExisting: instance };\n}\n\n/**\n * Inject the calendar component.\n */\nexport function injectBrnCalendar<T>(): BrnCalendarBase<T> {\n\treturn inject(BrnCalendarToken) as BrnCalendarBase<T>;\n}\n","import { inject, Injectable, InjectionToken, type Provider, signal } from '@angular/core';\n\nexport type Weekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type MonthLabels = [\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n\tstring,\n];\n\nexport interface BrnCalendarI18n {\n\tformatWeekdayName: (index: number) => string;\n\tformatHeader: (month: number, year: number) => string;\n\tformatYear: (year: number) => string;\n\tformatMonth: (month: number) => string;\n\tlabelPrevious: () => string;\n\tlabelNext: () => string;\n\tlabelWeekday: (index: number) => string;\n\tmonths: () => [string, string, string, string, string, string, string, string, string, string, string, string];\n\tyears: (startYear?: number, endYear?: number) => number[];\n\tfirstDayOfWeek: () => Weekday;\n}\n\nexport const BrnCalendarI18nToken = new InjectionToken<BrnCalendarI18nService>('BrnCalendarI18nToken');\n\n/**\n * Provide the calendar i18n configuration.\n */\nexport function provideBrnCalendarI18n(configuration?: BrnCalendarI18n): Provider {\n\treturn {\n\t\tprovide: BrnCalendarI18nToken,\n\t\tuseFactory: () => {\n\t\t\tconst service = new BrnCalendarI18nService();\n\t\t\tservice.use(configuration ?? defaultCalendarI18n);\n\t\t\treturn service;\n\t\t},\n\t};\n}\n\nconst defaultCalendarI18n: BrnCalendarI18n = {\n\tformatWeekdayName: (index: number) => {\n\t\tconst weekdays = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];\n\t\treturn weekdays[index];\n\t},\n\tmonths: () => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n\tyears: (startYear = 1925, endYear = new Date().getFullYear() + 1) =>\n\t\tArray.from({ length: endYear - startYear + 1 }, (_, i) => startYear + i),\n\tformatHeader: (month: number, year: number) => {\n\t\treturn new Date(year, month).toLocaleDateString(undefined, {\n\t\t\tmonth: 'long',\n\t\t\tyear: 'numeric',\n\t\t});\n\t},\n\tformatMonth: (month: number) => {\n\t\treturn new Date(2000, month).toLocaleDateString(undefined, {\n\t\t\tmonth: 'short',\n\t\t});\n\t},\n\tformatYear: (year: number): string => {\n\t\treturn new Date(year, 0).toLocaleDateString(undefined, {\n\t\t\tyear: 'numeric',\n\t\t});\n\t},\n\tlabelPrevious: () => 'Go to the previous month',\n\tlabelNext: () => 'Go to the next month',\n\tlabelWeekday: (index: number) => {\n\t\tconst weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\t\treturn weekdays[index];\n\t},\n\tfirstDayOfWeek: () => 0,\n};\n\n/**\n * Inject the calendar i18n configuration.\n */\nexport function injectBrnCalendarI18n(): BrnCalendarI18nService {\n\treturn inject(BrnCalendarI18nToken, { optional: true }) ?? inject(BrnCalendarI18nService); // fallback\n}\n\n@Injectable({ providedIn: 'root' })\nexport class BrnCalendarI18nService {\n\tprivate readonly _config = signal<BrnCalendarI18n>(defaultCalendarI18n);\n\n\tpublic readonly config = this._config.asReadonly();\n\n\tpublic use(config: Partial<BrnCalendarI18n>) {\n\t\tthis._config.set({ ...this.config(), ...config });\n\t}\n}\n","import type { BrnDateAdapter } from '@spartan-ng/brain/date-time';\n\nexport const compareDays = <T>(a: T[], b: T[], dateAdapter: BrnDateAdapter<T>): boolean => {\n\tif (a === b) return true;\n\tif (!a || !b) return false;\n\tif (a.length !== b.length) return false;\n\treturn a.every((day, i) => dateAdapter.isSameDay(day, b[i]));\n};\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\tChangeDetectorRef,\n\tcomputed,\n\tcontentChild,\n\tDirective,\n\tinject,\n\tInjector,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\tnumberAttribute,\n} from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { BrnCalendarCellButton } from './brn-calendar-cell-button';\nimport { BrnCalendarHeader } from './brn-calendar-header';\nimport { type BrnCalendarBase, provideBrnCalendar } from './brn-calendar.token';\nimport { injectBrnCalendarI18n, type Weekday } from './i18n/calendar-i18n';\nimport { compareDays } from './utils/compare-days';\n\n@Directive({\n\tselector: '[brnCalendar]',\n\tproviders: [provideBrnCalendar(BrnCalendar)],\n})\nexport class BrnCalendar<T> implements BrnCalendarBase<T> {\n\tprivate readonly _i18n = injectBrnCalendarI18n();\n\n\t/** Access the date adapter */\n\tprotected readonly _dateAdapter = injectDateAdapter<T>();\n\n\t/** Access the change detector */\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the injector */\n\tprivate readonly _injector = inject(Injector);\n\n\t/** The days to highlight. */\n\tpublic readonly highlightDays = input<T[]>([]);\n\n\t/** The minimum date that can be selected.*/\n\tpublic readonly min = input<T>();\n\n\t/** The maximum date that can be selected. */\n\tpublic readonly max = input<T>();\n\n\t/** Determine if the date picker is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** The selected value. */\n\tpublic readonly date = model<T>();\n\n\t/** Whether a specific date is disabled. */\n\tpublic readonly dateDisabled = input<(date: T) => boolean>(() => false);\n\n\t/** The day the week starts on */\n\tpublic readonly weekStartsOn = input<Weekday, NumberInput | undefined>(undefined, {\n\t\ttransform: (v: unknown) => (v === undefined || v === null ? undefined : (numberAttribute(v) as Weekday)),\n\t});\n\n\tprotected readonly _weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek());\n\n\t/** The default focused date. */\n\tpublic readonly defaultFocusedDate = input<T>();\n\n\t/** @internal Access the header */\n\tpublic readonly header = contentChild(BrnCalendarHeader);\n\n\tprivate readonly _cells: BrnCalendarCellButton<T>[] = [];\n\n\t/**\n\t * The focused date.\n\t */\n\tpublic readonly focusedDate = linkedSignal(() =>\n\t\tthis.constrainDate(this.defaultFocusedDate() ?? this.date() ?? this._dateAdapter.now()),\n\t);\n\n\t/**\n\t * Get all the days to display, this is the days of the current month\n\t * and the days of the previous and next month to fill the grid.\n\t */\n\tpublic readonly days = computed(\n\t\t() => {\n\t\t\tconst weekStartsOn = this._weekStartsOn();\n\t\t\tconst month = this.focusedDate();\n\t\t\tconst days: T[] = [];\n\n\t\t\t// Get the first and last day of the month.\n\t\t\tlet firstDay = this._dateAdapter.startOfMonth(month);\n\t\t\tlet lastDay = this._dateAdapter.endOfMonth(month);\n\n\t\t\t// we need to subtract until we get the to starting day before or on the start of the month.\n\t\t\twhile (this._dateAdapter.getDay(firstDay) !== weekStartsOn) {\n\t\t\t\tfirstDay = this._dateAdapter.subtract(firstDay, { days: 1 });\n\t\t\t}\n\n\t\t\tconst weekEndsOn = (weekStartsOn + 6) % 7;\n\n\t\t\t// we need to add until we get to the ending day after or on the end of the month.\n\t\t\twhile (this._dateAdapter.getDay(lastDay) !== weekEndsOn) {\n\t\t\t\tlastDay = this._dateAdapter.add(lastDay, { days: 1 });\n\t\t\t}\n\n\t\t\t// collect all the days to display.\n\t\t\twhile (firstDay <= lastDay) {\n\t\t\t\tdays.push(firstDay);\n\t\t\t\tfirstDay = this._dateAdapter.add(firstDay, { days: 1 });\n\t\t\t}\n\n\t\t\treturn days;\n\t\t},\n\t\t{\n\t\t\tequal: (a, b) => compareDays(a, b, this._dateAdapter),\n\t\t},\n\t);\n\n\t/** @internal Constrain a date to the min and max boundaries */\n\tconstrainDate(date: T): T {\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\t// If there is no min or max, return the date.\n\t\tif (!min && !max) {\n\t\t\treturn date;\n\t\t}\n\n\t\t// If there is a min and the date is before the min, return the min.\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn min;\n\t\t}\n\n\t\t// If there is a max and the date is after the max, return the max.\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn max;\n\t\t}\n\n\t\t// Return the date.\n\t\treturn date;\n\t}\n\n\t/** @internal Determine if a date is disabled */\n\tisDateDisabled(date: T): boolean {\n\t\t// if the calendar is disabled we can't select this date\n\t\tif (this.disabled()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if the date is outside the min and max range\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if this specific date is disabled\n\t\tconst disabledFn = this.dateDisabled();\n\n\t\tif (disabledFn(date)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tisSelected(date: T): boolean {\n\t\tconst selected = this.date() as T | undefined;\n\t\treturn selected !== undefined && this._dateAdapter.isSameDay(date, selected);\n\t}\n\n\tselectDate(date: T): void {\n\t\tif (this.isSelected(date)) {\n\t\t\tthis.date.set(undefined);\n\t\t} else {\n\t\t\tthis.date.set(date);\n\t\t}\n\t\tthis.focusedDate.set(date);\n\t}\n\n\t/** @internal Set the focused date */\n\tsetFocusedDate(date: T): void {\n\t\t// check if the date is disabled.\n\t\tif (this.isDateDisabled(date)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.focusedDate.set(date);\n\t\t// wait until the cells have all updated\n\n\t\tafterNextRender(\n\t\t\t{\n\t\t\t\twrite: () => {\n\t\t\t\t\tconst cell = this._cells.find((c) => this._dateAdapter.isSameDay(c.date(), date));\n\t\t\t\t\tif (cell) {\n\t\t\t\t\t\tcell.focus();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tinjector: this._injector,\n\t\t\t},\n\t\t);\n\t\t// we must update the view to ensure the focused cell is visible.\n\t\tthis._changeDetector.detectChanges();\n\t}\n\n\t/**\n\t * Determine if a date is the start of a range. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisStartOfRange(_: T): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine if a date is the end of a range. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisEndOfRange(_: T): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine if a date is between the start and end dates. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns True if the date is between the start and end dates, false otherwise.\n\t * @internal\n\t */\n\tisBetweenRange(_: T): boolean {\n\t\treturn false;\n\t}\n\n\tunregisterCalendarCell(cell: BrnCalendarCellButton<T>): void {\n\t\tconst index = this._cells.indexOf(cell);\n\t\tif (index !== -1) {\n\t\t\tthis._cells.splice(index, 1);\n\t\t}\n\t}\n\tregisterCalendarCell(cell: BrnCalendarCellButton<T>): void {\n\t\tthis._cells.push(cell);\n\t}\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n\tselector: '[brnCalendarCell]',\n\thost: {\n\t\trole: 'presentation',\n\t},\n})\nexport class BrnCalendarCell {}\n","import { computed, DestroyRef, Directive, ElementRef, inject, input } from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { injectBrnCalendar } from './brn-calendar.token';\n\n@Directive({\n\tselector: 'button[brnCalendarCellButton]',\n\thost: {\n\t\trole: 'gridcell',\n\t\t'[tabindex]': 'focusable() ? 0 : -1',\n\t\ttype: 'button',\n\t\t'[attr.data-outside]': '!selected() && outside() && (!end() && !start())? true : null',\n\t\t'[attr.data-today]': 'today() && !selected() ? true : null',\n\t\t'[attr.data-selected-single]': 'selected() && !start() && !end() && !betweenRange() ? true : null',\n\t\t'[attr.data-disabled]': 'disabled() ? true : null',\n\t\t'[attr.aria-selected]': 'selected() ? true : null',\n\t\t'[attr.aria-disabled]': 'disabled() ? true : null',\n\t\t'[attr.data-range-start]': 'start() ? true : null',\n\t\t'[attr.data-range-end]': 'end() ? true : null',\n\t\t'[attr.data-highlighted]': 'highlighted() ? true : null',\n\t\t'[attr.data-range-middle]': 'betweenRange() ? true : null',\n\t\t'[disabled]': 'disabled()',\n\t\t'(click)': '_calendar.selectDate(date())',\n\t\t'(keydown.arrowLeft)': 'focusPrevious($event)',\n\t\t'(keydown.arrowRight)': 'focusNext($event)',\n\t\t'(keydown.arrowUp)': 'focusAbove($event)',\n\t\t'(keydown.arrowDown)': 'focusBelow($event)',\n\t\t'(keydown.home)': 'focusFirst($event)',\n\t\t'(keydown.end)': 'focusLast($event)',\n\t\t'(keydown.pageUp)': 'focusPreviousMonth($event)',\n\t\t'(keydown.pageDown)': 'focusNextMonth($event)',\n\t},\n})\nexport class BrnCalendarCellButton<T> {\n\t/** Access the date adapter */\n\tprotected readonly _dateAdapter = injectDateAdapter<T>();\n\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\n\t/** Access the calendar component */\n\tprotected readonly _calendar = injectBrnCalendar<T>();\n\n\t/** Access the element ref */\n\tprivate readonly _elementRef = inject<ElementRef<HTMLButtonElement>>(ElementRef);\n\n\t/** The date this cell represents */\n\tpublic readonly date = input.required<T>();\n\n\t/** Whether this date is currently selected */\n\tpublic readonly selected = computed(() => this._calendar.isSelected(this.date()));\n\tpublic readonly start = computed(() => this._calendar.isStartOfRange(this.date()));\n\tpublic readonly end = computed(() => this._calendar.isEndOfRange(this.date()));\n\tpublic readonly betweenRange = computed(() => this._calendar.isBetweenRange(this.date()));\n\tpublic readonly highlighted = computed(() =>\n\t\tthis._calendar.highlightDays().some((d) => this._dateAdapter.isSameDay(this.date(), d)),\n\t);\n\n\tconstructor() {\n\t\tthis._calendar.registerCalendarCell(this);\n\n\t\tthis._destroyRef.onDestroy(() => this._calendar.unregisterCalendarCell(this));\n\t}\n\n\t/** Whether this date is focusable */\n\tpublic readonly focusable = computed(() => this._dateAdapter.isSameDay(this._calendar.focusedDate(), this.date()));\n\n\tpublic readonly outside = computed(() => {\n\t\tconst focusedDate = this._calendar.focusedDate();\n\t\treturn !this._dateAdapter.isSameMonth(this.date(), focusedDate);\n\t});\n\n\t/** Whether this date is today */\n\tpublic readonly today = computed(() => this._dateAdapter.isSameDay(this.date(), this._dateAdapter.now()));\n\n\t/** Whether this date is disabled */\n\tpublic readonly disabled = computed(() => this._calendar.isDateDisabled(this.date()) || this._calendar.disabled());\n\n\t/**\n\t * Focus the previous cell.\n\t */\n\tprotected focusPrevious(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\t// in rtl, the arrow keys are reversed.\n\t\tconst targetDate = this._dateAdapter.add(this._calendar.focusedDate(), {\n\t\t\tdays: this.getDirection() === 'rtl' ? 1 : -1,\n\t\t});\n\n\t\tthis._calendar.setFocusedDate(targetDate);\n\t}\n\n\t/**\n\t * Focus the next cell.\n\t */\n\tprotected focusNext(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tconst targetDate = this._dateAdapter.add(this._calendar.focusedDate(), {\n\t\t\tdays: this.getDirection() === 'rtl' ? -1 : 1,\n\t\t});\n\n\t\tthis._calendar.setFocusedDate(targetDate);\n\t}\n\n\t/**\n\t * Focus the above cell.\n\t */\n\tprotected focusAbove(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._calendar.setFocusedDate(this._dateAdapter.subtract(this._calendar.focusedDate(), { days: 7 }));\n\t}\n\n\t/**\n\t * Focus the below cell.\n\t */\n\tprotected focusBelow(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._calendar.setFocusedDate(this._dateAdapter.add(this._calendar.focusedDate(), { days: 7 }));\n\t}\n\n\t/**\n\t * Focus the first date of the month.\n\t */\n\tprotected focusFirst(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._calendar.setFocusedDate(this._dateAdapter.startOfMonth(this._calendar.focusedDate()));\n\t}\n\n\t/**\n\t * Focus the last date of the month.\n\t */\n\tprotected focusLast(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tthis._calendar.setFocusedDate(this._dateAdapter.endOfMonth(this._calendar.focusedDate()));\n\t}\n\n\t/**\n\t * Focus the same date in the previous month.\n\t */\n\tprotected focusPreviousMonth(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tconst date = this._dateAdapter.getDate(this._calendar.focusedDate());\n\n\t\tlet previousMonthTarget = this._dateAdapter.startOfMonth(this._calendar.focusedDate());\n\t\tpreviousMonthTarget = this._dateAdapter.subtract(previousMonthTarget, { months: 1 });\n\n\t\tconst lastDay = this._dateAdapter.endOfMonth(previousMonthTarget);\n\n\t\t// if we are on a date that does not exist in the previous month, we should focus the last day of the month.\n\t\tif (date > this._dateAdapter.getDate(lastDay)) {\n\t\t\tthis._calendar.setFocusedDate(lastDay);\n\t\t} else {\n\t\t\tthis._calendar.setFocusedDate(this._dateAdapter.set(previousMonthTarget, { day: date }));\n\t\t}\n\t}\n\n\t/**\n\t * Focus the same date in the next month.\n\t */\n\tprotected focusNextMonth(event: Event): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tconst date = this._dateAdapter.getDate(this._calendar.focusedDate());\n\n\t\tlet nextMonthTarget = this._dateAdapter.startOfMonth(this._calendar.focusedDate());\n\t\tnextMonthTarget = this._dateAdapter.add(nextMonthTarget, { months: 1 });\n\n\t\tconst lastDay = this._dateAdapter.endOfMonth(nextMonthTarget);\n\n\t\t// if we are on a date that does not exist in the next month, we should focus the last day of the month.\n\t\tif (date > this._dateAdapter.getDate(lastDay)) {\n\t\t\tthis._calendar.setFocusedDate(lastDay);\n\t\t} else {\n\t\t\tthis._calendar.setFocusedDate(this._dateAdapter.set(nextMonthTarget, { day: date }));\n\t\t}\n\t}\n\n\t/**\n\t * Get the direction of the element.\n\t */\n\tprivate getDirection(): 'ltr' | 'rtl' {\n\t\treturn getComputedStyle(this._elementRef.nativeElement).direction === 'rtl' ? 'rtl' : 'ltr';\n\t}\n\n\tfocus(): void {\n\t\tthis._elementRef.nativeElement.focus();\n\t}\n}\n","import { Directive } from '@angular/core';\nimport { injectBrnCalendar } from './brn-calendar.token';\n\n@Directive({\n\tselector: '[brnCalendarGrid]',\n\thost: {\n\t\trole: 'grid',\n\t\t'[attr.aria-labelledby]': '_calendar.header()?.id()',\n\t},\n})\nexport class BrnCalendarGrid<T> {\n\t/** Access the calendar component */\n\tprotected readonly _calendar = injectBrnCalendar<T>();\n}\n","import { computed, Directive, effect, inject } from '@angular/core';\nimport { outputToObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { BrnSelect } from '@spartan-ng/brain/select';\nimport { injectBrnCalendar } from './brn-calendar.token';\nimport { injectBrnCalendarI18n } from './i18n/calendar-i18n';\n\n@Directive({\n\tselector: 'brnSelect[brnCalendarMonthSelect],hlm-select[brnCalendarMonthSelect]',\n})\nexport class BrnCalendarMonthSelect {\n\t/** Access the select */\n\tprivate readonly _select = inject(BrnSelect);\n\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar();\n\n\t/** Access the date adapter */\n\tprivate readonly _dateAdapter = injectDateAdapter();\n\n\t/** Access the calendar i18n */\n\tprotected readonly _i18n = injectBrnCalendarI18n();\n\n\tprotected readonly _selectedMonth = computed(() => {\n\t\treturn this._i18n.config().months()[this._dateAdapter.getMonth(this._calendar.focusedDate())];\n\t});\n\n\tconstructor() {\n\t\t// React to user selection through the injected select's typed `value` output rather than a\n\t\t// host-listener `$event` (which Angular types as `Event`). The month select's values are the\n\t\t// month strings, so narrow to `string` before handling.\n\t\toutputToObservable(this._select.value)\n\t\t\t.pipe(takeUntilDestroyed())\n\t\t\t.subscribe((value) => {\n\t\t\t\tif (typeof value === 'string') {\n\t\t\t\t\tthis.monthSelected(value);\n\t\t\t\t}\n\t\t\t});\n\n\t\teffect(() => {\n\t\t\tthis._select.writeValue(this._selectedMonth());\n\t\t});\n\t}\n\n\t/** Focus selected month */\n\tprivate monthSelected(selectedMonth: string): void {\n\t\tconst month = this._i18n\n\t\t\t.config()\n\t\t\t.months()\n\t\t\t.findIndex((month) => month === selectedMonth);\n\t\tconst targetDate = this._dateAdapter.set(this._calendar.focusedDate(), { month });\n\t\tthis._calendar.focusedDate.set(targetDate);\n\t}\n}\n","import { Directive } from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { injectBrnCalendar } from './brn-calendar.token';\nimport { injectBrnCalendarI18n } from './i18n/calendar-i18n';\n\n@Directive({\n\tselector: '[brnCalendarNextButton]',\n\thost: {\n\t\ttype: 'button',\n\t\t'data-slot': 'calendar-next-button',\n\t\t'[attr.aria-label]': '_i18n.config().labelNext()',\n\t\t'(click)': 'focusNextMonth()',\n\t},\n})\nexport class BrnCalendarNextButton {\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar();\n\n\t/** Access the date adapter */\n\tprivate readonly _dateAdapter = injectDateAdapter();\n\n\t/** Access the calendar i18n */\n\tprotected readonly _i18n = injectBrnCalendarI18n();\n\n\t/** Focus the next month */\n\tprotected focusNextMonth(): void {\n\t\tconst focusedDate = this._calendar.focusedDate();\n\t\tconst date = this._dateAdapter.getDate(focusedDate);\n\n\t\t// go to start of month first, then add 1 month to avoid day overflow\n\t\tlet nextMonthTarget = this._dateAdapter.startOfMonth(focusedDate);\n\t\tnextMonthTarget = this._dateAdapter.add(nextMonthTarget, { months: 1 });\n\n\t\tconst lastDay = this._dateAdapter.endOfMonth(nextMonthTarget);\n\n\t\t// if we are on a date that does not exist in the next month, clamp to the last day of the month.\n\t\tlet targetDate: typeof focusedDate;\n\t\tif (date > this._dateAdapter.getDate(lastDay)) {\n\t\t\ttargetDate = lastDay;\n\t\t} else {\n\t\t\ttargetDate = this._dateAdapter.set(nextMonthTarget, { day: date });\n\t\t}\n\n\t\t// if the date is disabled, but there are available dates in the month, focus the constrained date.\n\t\tconst possibleDate = this._calendar.constrainDate(targetDate);\n\n\t\tif (this._dateAdapter.isSameMonth(possibleDate, targetDate)) {\n\t\t\t// if this date is within the same month, then focus it\n\t\t\tthis._calendar.focusedDate.set(possibleDate);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._calendar.focusedDate.set(targetDate);\n\t}\n}\n","import { Directive } from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { injectBrnCalendar } from './brn-calendar.token';\nimport { injectBrnCalendarI18n } from './i18n/calendar-i18n';\n\n@Directive({\n\tselector: '[brnCalendarPreviousButton]',\n\thost: {\n\t\ttype: 'button',\n\t\t'data-slot': 'calendar-previous-button',\n\t\t'[attr.aria-label]': '_i18n.config().labelPrevious()',\n\t\t'(click)': 'focusPreviousMonth()',\n\t},\n})\nexport class BrnCalendarPreviousButton {\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar();\n\n\t/** Access the date adapter */\n\tprivate readonly _dateAdapter = injectDateAdapter();\n\n\t/** Access the calendar i18n */\n\tprotected readonly _i18n = injectBrnCalendarI18n();\n\n\t/** Focus the previous month */\n\tprotected focusPreviousMonth(): void {\n\t\tconst focusedDate = this._calendar.focusedDate();\n\t\tconst date = this._dateAdapter.getDate(focusedDate);\n\n\t\t// go to start of month first, then subtract 1 month to avoid day overflow\n\t\tlet previousMonthTarget = this._dateAdapter.startOfMonth(focusedDate);\n\t\tpreviousMonthTarget = this._dateAdapter.subtract(previousMonthTarget, { months: 1 });\n\n\t\tconst lastDay = this._dateAdapter.endOfMonth(previousMonthTarget);\n\n\t\t// if we are on a date that does not exist in the previous month, clamp to the last day of the month.\n\t\tlet targetDate: typeof focusedDate;\n\t\tif (date > this._dateAdapter.getDate(lastDay)) {\n\t\t\ttargetDate = lastDay;\n\t\t} else {\n\t\t\ttargetDate = this._dateAdapter.set(previousMonthTarget, { day: date });\n\t\t}\n\n\t\t// if the date is disabled, but there are available dates in the month, focus the constrained date.\n\t\tconst possibleDate = this._calendar.constrainDate(targetDate);\n\n\t\tif (this._dateAdapter.isSameMonth(possibleDate, targetDate)) {\n\t\t\t// if this date is within the same month, then focus it\n\t\t\tthis._calendar.focusedDate.set(possibleDate);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._calendar.focusedDate.set(targetDate);\n\t}\n}\n","import {\n\tChangeDetectorRef,\n\tcomputed,\n\tDirective,\n\teffect,\n\ttype EmbeddedViewRef,\n\tinject,\n\ttype OnDestroy,\n\tTemplateRef,\n\tuntracked,\n\tViewContainerRef,\n} from '@angular/core';\nimport { injectBrnCalendar } from './brn-calendar.token';\n\n@Directive({\n\tselector: '[brnCalendarWeek]',\n})\nexport class BrnCalendarWeek<T> implements OnDestroy {\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar<T>();\n\n\t/** Access the view container ref */\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\n\t/** Access the change detector */\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the template ref */\n\tprivate readonly _templateRef = inject<TemplateRef<BrnWeekContext<T>>>(TemplateRef);\n\n\t// get the weeks to display.\n\tprotected readonly _weeks = computed(() => {\n\t\tconst days = this._calendar.days();\n\t\tconst weeks = [];\n\n\t\tfor (let i = 0; i < days.length; i += 7) {\n\t\t\tweeks.push(days.slice(i, i + 7));\n\t\t}\n\n\t\treturn weeks;\n\t});\n\n\t/** Store the view refs */\n\tprivate _viewRefs: EmbeddedViewRef<BrnWeekContext<T>>[] = [];\n\n\t// Make sure the template checker knows the type of the context with which the\n\t// template of this directive will be rendered\n\tstatic ngTemplateContextGuard<T>(_: BrnCalendarWeek<T>, ctx: unknown): ctx is BrnWeekContext<T> {\n\t\treturn true;\n\t}\n\n\tconstructor() {\n\t\t// this should use `afterRenderEffect` but it's not available in the current version\n\t\teffect(() => {\n\t\t\tconst weeks = this._weeks();\n\t\t\tuntracked(() => this._renderWeeks(weeks));\n\t\t});\n\t}\n\n\tprivate _renderWeeks(weeks: T[][]): void {\n\t\t// Destroy all the views when the directive is destroyed\n\t\tfor (const viewRef of this._viewRefs) {\n\t\t\tviewRef.destroy();\n\t\t}\n\n\t\tthis._viewRefs = [];\n\n\t\t// Create a new view for each week\n\t\tfor (const week of weeks) {\n\t\t\tconst viewRef = this._viewContainerRef.createEmbeddedView(this._templateRef, {\n\t\t\t\t$implicit: week,\n\t\t\t});\n\t\t\tthis._viewRefs.push(viewRef);\n\t\t}\n\n\t\tthis._changeDetector.detectChanges();\n\t}\n\n\tngOnDestroy(): void {\n\t\t// Destroy all the views when the directive is destroyed\n\t\tfor (const viewRef of this._viewRefs) {\n\t\t\tviewRef.destroy();\n\t\t}\n\t}\n}\n\ninterface BrnWeekContext<T> {\n\t$implicit: T[];\n}\n","import {\n\tChangeDetectorRef,\n\tcomputed,\n\tDirective,\n\teffect,\n\ttype EmbeddedViewRef,\n\tinject,\n\ttype OnDestroy,\n\tTemplateRef,\n\tuntracked,\n\tViewContainerRef,\n} from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { injectBrnCalendar } from './brn-calendar.token';\n\n@Directive({\n\tselector: '[brnCalendarWeekday]',\n})\nexport class BrnCalendarWeekday<T> implements OnDestroy {\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar<T>();\n\n\t/** Access the date time adapter */\n\tprivate readonly _dateAdapter = injectDateAdapter<T>();\n\n\t/** Access the view container ref */\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\n\t/** Access the change detector */\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the template ref */\n\tprivate readonly _templateRef = inject<TemplateRef<BrnWeekdayContext>>(TemplateRef);\n\n\t/** Get the days of the week to display in the header. */\n\tprotected readonly _weekdays = computed(() => this._calendar.days().slice(0, 7));\n\n\t/** Store the view refs */\n\tprivate _viewRefs: EmbeddedViewRef<BrnWeekdayContext>[] = [];\n\n\t// Make sure the template checker knows the type of the context with which the\n\t// template of this directive will be rendered\n\tstatic ngTemplateContextGuard<T>(_: BrnCalendarWeekday<T>, ctx: unknown): ctx is BrnWeekdayContext {\n\t\treturn true;\n\t}\n\n\tconstructor() {\n\t\t// Create a new view for each day\n\t\teffect(() => {\n\t\t\t// Get the weekdays to display\n\t\t\tconst weekdays = this._weekdays();\n\t\t\t// Render the weekdays\n\t\t\tuntracked(() => this._renderWeekdays(weekdays));\n\t\t});\n\t}\n\n\tprivate _renderWeekdays(weekdays: T[]): void {\n\t\t// Destroy all the views when the directive is destroyed\n\t\tfor (const viewRef of this._viewRefs) {\n\t\t\tviewRef.destroy();\n\t\t}\n\n\t\tthis._viewRefs = [];\n\n\t\t// Create a new view for each day\n\t\tfor (const day of weekdays) {\n\t\t\tconst viewRef = this._viewContainerRef.createEmbeddedView(this._templateRef, {\n\t\t\t\t$implicit: this._dateAdapter.getDay(day),\n\t\t\t});\n\t\t\tthis._viewRefs.push(viewRef);\n\t\t}\n\n\t\tthis._changeDetector.detectChanges();\n\t}\n\n\tngOnDestroy(): void {\n\t\t// Destroy all the views when the directive is destroyed\n\t\tfor (const viewRef of this._viewRefs) {\n\t\t\tviewRef.destroy();\n\t\t}\n\t}\n}\n\ninterface BrnWeekdayContext {\n\t$implicit: number;\n}\n","import { Directive, effect, inject } from '@angular/core';\nimport { outputToObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { BrnSelect } from '@spartan-ng/brain/select';\nimport { injectBrnCalendar } from './brn-calendar.token';\nimport { injectBrnCalendarI18n } from './i18n/calendar-i18n';\n\n@Directive({\n\tselector: 'brnSelect[brnCalendarYearSelect],hlm-select[brnCalendarYearSelect]',\n})\nexport class BrnCalendarYearSelect {\n\t/** Access the select */\n\tprivate readonly _select = inject(BrnSelect);\n\n\t/** Access the calendar */\n\tprivate readonly _calendar = injectBrnCalendar();\n\n\t/** Access the date adapter */\n\tprivate readonly _dateAdapter = injectDateAdapter();\n\n\t/** Access the calendar i18n */\n\tprotected readonly _i18n = injectBrnCalendarI18n();\n\n\tconstructor() {\n\t\t// React to user selection through the injected select's typed `value` output rather than a\n\t\t// host-listener `$event` (which Angular types as `Event`). The year select's values are\n\t\t// numbers, so narrow to `number` before handling.\n\t\toutputToObservable(this._select.value)\n\t\t\t.pipe(takeUntilDestroyed())\n\t\t\t.subscribe((value) => {\n\t\t\t\tif (typeof value === 'number') {\n\t\t\t\t\tthis.yearSelected(value);\n\t\t\t\t}\n\t\t\t});\n\n\t\teffect(() => {\n\t\t\tthis._select.writeValue(this._dateAdapter.getYear(this._calendar.focusedDate()));\n\t\t});\n\t}\n\n\t/** Focus selected year */\n\tprivate yearSelected(year: number): void {\n\t\tconst targetDate = this._dateAdapter.set(this._calendar.focusedDate(), { year });\n\t\tthis._calendar.focusedDate.set(targetDate);\n\t}\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\tChangeDetectorRef,\n\tcomputed,\n\tcontentChild,\n\tDirective,\n\tinject,\n\tInjector,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\tnumberAttribute,\n} from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { BrnCalendarCellButton } from '../brn-calendar-cell-button';\nimport { BrnCalendarHeader } from '../brn-calendar-header';\nimport { type BrnCalendarBase, provideBrnCalendar } from '../brn-calendar.token';\nimport { injectBrnCalendarI18n, type Weekday } from '../i18n/calendar-i18n';\nimport { compareDays } from '../utils/compare-days';\n\n@Directive({\n\tselector: '[brnCalendarMulti]',\n\tproviders: [provideBrnCalendar(BrnCalendarMulti)],\n})\nexport class BrnCalendarMulti<T> implements BrnCalendarBase<T> {\n\tprivate readonly _i18n = injectBrnCalendarI18n();\n\n\tprivate readonly _cells: BrnCalendarCellButton<T>[] = [];\n\n\t/**\n\t * Determine if a date is the start of a range. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisStartOfRange(_: T): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine if a date is the end of a range. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisEndOfRange(_: T): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine if a date is between the start and end dates. In a date picker, this is always false.\n\t * @param date The date to check.\n\t * @returns True if the date is between the start and end dates, false otherwise.\n\t * @internal\n\t */\n\tisBetweenRange(_: T): boolean {\n\t\treturn false;\n\t}\n\n\t// /** Access the date adapter */\n\tprotected readonly _dateAdapter = injectDateAdapter<T>();\n\n\t/** Access the change detector */\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the injector */\n\tprivate readonly _injector = inject(Injector);\n\n\t/** The days to highlight. */\n\tpublic readonly highlightDays = input<T[]>([]);\n\n\t/** The minimum date that can be selected.*/\n\tpublic readonly min = input<T>();\n\n\t/** The maximum date that can be selected. */\n\tpublic readonly max = input<T>();\n\n\t/** The minimum selectable dates. */\n\tpublic readonly minSelection = input<number, NumberInput>(undefined, {\n\t\ttransform: numberAttribute,\n\t});\n\n\t/** The maximum selectable dates. */\n\tpublic readonly maxSelection = input<number, NumberInput>(undefined, {\n\t\ttransform: numberAttribute,\n\t});\n\n\t/** Determine if the date picker is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** The selected value. */\n\tpublic readonly date = model<T[]>();\n\n\t/** Whether a specific date is disabled. */\n\tpublic readonly dateDisabled = input<(date: T) => boolean>(() => false);\n\n\t/** The day the week starts on */\n\tpublic readonly weekStartsOn = input<Weekday, NumberInput | undefined>(undefined, {\n\t\ttransform: (v: unknown) => (v === undefined || v === null ? undefined : (numberAttribute(v) as Weekday)),\n\t});\n\n\tprotected readonly _weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek());\n\n\t/** The default focused date. */\n\tpublic readonly defaultFocusedDate = input<T>();\n\n\t/** @internal Access the header */\n\tpublic readonly header = contentChild(BrnCalendarHeader);\n\n\t/**\n\t * The focused date.\n\t */\n\tpublic readonly focusedDate = linkedSignal(() =>\n\t\tthis.constrainDate(this.defaultFocusedDate() ?? this._dateAdapter.now()),\n\t);\n\n\t/**\n\t * Get all the days to display, this is the days of the current month\n\t * and the days of the previous and next month to fill the grid.\n\t */\n\tpublic readonly days = computed(\n\t\t() => {\n\t\t\tconst weekStartsOn = this._weekStartsOn();\n\t\t\tconst month = this.focusedDate();\n\t\t\tconst days: T[] = [];\n\n\t\t\t// Get the first and last day of the month.\n\t\t\tlet firstDay = this._dateAdapter.startOfMonth(month);\n\t\t\tlet lastDay = this._dateAdapter.endOfMonth(month);\n\n\t\t\t// we need to subtract until we get the to starting day before or on the start of the month.\n\t\t\twhile (this._dateAdapter.getDay(firstDay) !== weekStartsOn) {\n\t\t\t\tfirstDay = this._dateAdapter.subtract(firstDay, { days: 1 });\n\t\t\t}\n\n\t\t\tconst weekEndsOn = (weekStartsOn + 6) % 7;\n\n\t\t\t// we need to add until we get to the ending day after or on the end of the month.\n\t\t\twhile (this._dateAdapter.getDay(lastDay) !== weekEndsOn) {\n\t\t\t\tlastDay = this._dateAdapter.add(lastDay, { days: 1 });\n\t\t\t}\n\n\t\t\t// collect all the days to display.\n\t\t\twhile (firstDay <= lastDay) {\n\t\t\t\tdays.push(firstDay);\n\t\t\t\tfirstDay = this._dateAdapter.add(firstDay, { days: 1 });\n\t\t\t}\n\n\t\t\treturn days;\n\t\t},\n\t\t{\n\t\t\tequal: (a, b) => compareDays(a, b, this._dateAdapter),\n\t\t},\n\t);\n\n\tisSelected(date: T): boolean {\n\t\treturn this.date()?.some((d) => this._dateAdapter.isSameDay(d, date)) ?? false;\n\t}\n\n\tselectDate(date: T): void {\n\t\tconst selected = this.date() as T[] | undefined;\n\t\tif (this.isSelected(date)) {\n\t\t\tconst minSelection = this.minSelection();\n\t\t\tif (selected?.length === minSelection) {\n\t\t\t\t// min selection reached, do not allow to deselect\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.date.set(selected?.filter((d) => !this._dateAdapter.isSameDay(d, date)));\n\t\t} else {\n\t\t\tconst maxSelection = this.maxSelection();\n\t\t\tif (selected?.length === maxSelection) {\n\t\t\t\t// max selection reached, reset the selection to date\n\t\t\t\tthis.date.set([date]);\n\t\t\t} else {\n\t\t\t\t// add the date to the selection\n\t\t\t\tthis.date.set([...(selected ?? []), date]);\n\t\t\t}\n\t\t}\n\t}\n\n\t// same as in brn-calendar.directive.ts\n\t/** @internal Constrain a date to the min and max boundaries */\n\tconstrainDate(date: T): T {\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\t// If there is no min or max, return the date.\n\t\tif (!min && !max) {\n\t\t\treturn date;\n\t\t}\n\n\t\t// If there is a min and the date is before the min, return the min.\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn min;\n\t\t}\n\n\t\t// If there is a max and the date is after the max, return the max.\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn max;\n\t\t}\n\n\t\t// Return the date.\n\t\treturn date;\n\t}\n\n\t/** @internal Determine if a date is disabled */\n\tisDateDisabled(date: T): boolean {\n\t\t// if the calendar is disabled we can't select this date\n\t\tif (this.disabled()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if the date is outside the min and max range\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if this specific date is disabled\n\t\tconst disabledFn = this.dateDisabled();\n\n\t\tif (disabledFn(date)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/** @internal Set the focused date */\n\tsetFocusedDate(date: T): void {\n\t\t// check if the date is disabled.\n\t\tif (this.isDateDisabled(date)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.focusedDate.set(date);\n\n\t\t// wait until the cells have all updated\n\t\tafterNextRender(\n\t\t\t{\n\t\t\t\twrite: () => {\n\t\t\t\t\tconst cell = this._cells.find((c) => this._dateAdapter.isSameDay(c.date(), date));\n\t\t\t\t\tif (cell) {\n\t\t\t\t\t\tcell.focus();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tinjector: this._injector,\n\t\t\t},\n\t\t);\n\n\t\t// we must update the view to ensure the focused cell is visible.\n\t\tthis._changeDetector.detectChanges();\n\t}\n\n\tunregisterCalendarCell(cell: BrnCalendarCellButton<T>): void {\n\t\tconst index = this._cells.indexOf(cell);\n\t\tif (index !== -1) {\n\t\t\tthis._cells.splice(index, 1);\n\t\t}\n\t}\n\tregisterCalendarCell(cell: BrnCalendarCellButton<T>): void {\n\t\tthis._cells.push(cell);\n\t}\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\tChangeDetectorRef,\n\tcomputed,\n\tcontentChild,\n\tDirective,\n\tinject,\n\tInjector,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\tnumberAttribute,\n} from '@angular/core';\nimport { injectDateAdapter } from '@spartan-ng/brain/date-time';\nimport { BrnCalendarCellButton } from '../brn-calendar-cell-button';\nimport { BrnCalendarHeader } from '../brn-calendar-header';\nimport { type BrnCalendarBase, provideBrnCalendar } from '../brn-calendar.token';\nimport { injectBrnCalendarI18n, type Weekday } from '../i18n/calendar-i18n';\nimport { compareDays } from '../utils/compare-days';\n\n@Directive({\n\tselector: '[brnCalendarRange]',\n\tproviders: [provideBrnCalendar(BrnCalendarRange)],\n})\nexport class BrnCalendarRange<T> implements BrnCalendarBase<T> {\n\tprivate readonly _cells: BrnCalendarCellButton<T>[] = [];\n\n\tprivate readonly _i18n = injectBrnCalendarI18n();\n\t// /** Access the date adapter */\n\tprotected readonly _dateAdapter = injectDateAdapter<T>();\n\n\t/** Access the change detector */\n\tprivate readonly _changeDetector = inject(ChangeDetectorRef);\n\n\t/** Access the injector */\n\tprivate readonly _injector = inject(Injector);\n\n\t/** The days to highlight. */\n\tpublic readonly highlightDays = input<T[]>([]);\n\n\t/** The minimum date that can be selected.*/\n\tpublic readonly min = input<T>();\n\n\t/** The maximum date that can be selected. */\n\tpublic readonly max = input<T>();\n\n\t/** Determine if the date picker is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Whether a specific date is disabled. */\n\tpublic readonly dateDisabled = input<(date: T) => boolean>(() => false);\n\n\t/** The day the week starts on */\n\tpublic readonly weekStartsOn = input<Weekday, NumberInput | undefined>(undefined, {\n\t\ttransform: (v: unknown) => (v === undefined || v === null ? undefined : (numberAttribute(v) as Weekday)),\n\t});\n\n\tprotected readonly _weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek());\n\n\t/** The default focused date. */\n\tpublic readonly defaultFocusedDate = input<T>();\n\n\t/** @internal Access the header */\n\tpublic readonly header = contentChild(BrnCalendarHeader);\n\n\t/**\n\t * The focused date.\n\t */\n\tpublic readonly focusedDate = linkedSignal(() =>\n\t\tthis.constrainDate(this.defaultFocusedDate() ?? this.startDate() ?? this._dateAdapter.now()),\n\t);\n\n\t/**\n\t * The selected start date\n\t */\n\tpublic readonly startDate = model<T>();\n\n\t/**\n\t * The selected end date\n\t */\n\tpublic readonly endDate = model<T>();\n\n\t/**\n\t * Get all the days to display, this is the days of the current month\n\t * and the days of the previous and next month to fill the grid.\n\t */\n\tpublic readonly days = computed(\n\t\t() => {\n\t\t\tconst weekStartsOn = this._weekStartsOn();\n\t\t\tconst month = this.focusedDate();\n\t\t\tconst days: T[] = [];\n\n\t\t\t// Get the first and last day of the month.\n\t\t\tlet firstDay = this._dateAdapter.startOfMonth(month);\n\t\t\tlet lastDay = this._dateAdapter.endOfMonth(month);\n\n\t\t\t// we need to subtract until we get the to starting day before or on the start of the month.\n\t\t\twhile (this._dateAdapter.getDay(firstDay) !== weekStartsOn) {\n\t\t\t\tfirstDay = this._dateAdapter.subtract(firstDay, { days: 1 });\n\t\t\t}\n\n\t\t\tconst weekEndsOn = (weekStartsOn + 6) % 7;\n\n\t\t\t// we need to add until we get to the ending day after or on the end of the month.\n\t\t\twhile (this._dateAdapter.getDay(lastDay) !== weekEndsOn) {\n\t\t\t\tlastDay = this._dateAdapter.add(lastDay, { days: 1 });\n\t\t\t}\n\n\t\t\t// collect all the days to display.\n\t\t\twhile (firstDay <= lastDay) {\n\t\t\t\tdays.push(firstDay);\n\t\t\t\tfirstDay = this._dateAdapter.add(firstDay, { days: 1 });\n\t\t\t}\n\n\t\t\treturn days;\n\t\t},\n\t\t{\n\t\t\tequal: (a, b) => compareDays(a, b, this._dateAdapter),\n\t\t},\n\t);\n\n\tisSelected(date: T): boolean {\n\t\tconst start = this.startDate();\n\t\tconst end = this.endDate();\n\n\t\tif (!start && !end) {\n\t\t\treturn false;\n\t\t}\n\t\tconst isStartSelected = start ? this._dateAdapter.isSameDay(date, start) : false;\n\t\tconst isEndSelected = end ? this._dateAdapter.isSameDay(date, end) : false;\n\n\t\treturn isStartSelected || isEndSelected;\n\t}\n\n\tselectDate(date: T): void {\n\t\tconst start = this.startDate();\n\t\tconst end = this.endDate();\n\n\t\tif (!start && !end) {\n\t\t\tthis.startDate.set(date);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (start && !end) {\n\t\t\tif (this._dateAdapter.isAfter(date, start)) {\n\t\t\t\tthis.endDate.set(date);\n\t\t\t} else if (this._dateAdapter.isBefore(date, start)) {\n\t\t\t\tthis.startDate.set(date);\n\t\t\t\tthis.endDate.set(start);\n\t\t\t} else if (this._dateAdapter.isSameDay(date, start)) {\n\t\t\t\tthis.endDate.set(date);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// If both start and end are selected, reset selection\n\t\tthis.startDate.set(date);\n\n\t\tthis.endDate.set(undefined);\n\t}\n\n\t// same as in brn-calendar.directive.ts\n\t/** @internal Constrain a date to the min and max boundaries */\n\tconstrainDate(date: T): T {\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\t// If there is no min or max, return the date.\n\t\tif (!min && !max) {\n\t\t\treturn date;\n\t\t}\n\n\t\t// If there is a min and the date is before the min, return the min.\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn min;\n\t\t}\n\n\t\t// If there is a max and the date is after the max, return the max.\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn max;\n\t\t}\n\n\t\t// Return the date.\n\t\treturn date;\n\t}\n\n\t/** @internal Determine if a date is disabled */\n\tisDateDisabled(date: T): boolean {\n\t\t// if the calendar is disabled we can't select this date\n\t\tif (this.disabled()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if the date is outside the min and max range\n\t\tconst min = this.min();\n\t\tconst max = this.max();\n\n\t\tif (min && this._dateAdapter.isBefore(date, this._dateAdapter.startOfDay(min))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (max && this._dateAdapter.isAfter(date, this._dateAdapter.endOfDay(max))) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if this specific date is disabled\n\t\tconst disabledFn = this.dateDisabled();\n\n\t\tif (disabledFn(date)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/** @internal Set the focused date */\n\tsetFocusedDate(date: T): void {\n\t\t// check if the date is disabled.\n\t\tif (this.isDateDisabled(date)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.focusedDate.set(date);\n\n\t\t// wait until the cells have all updated\n\n\t\tafterNextRender(\n\t\t\t{\n\t\t\t\twrite: () => {\n\t\t\t\t\tconst cell = this._cells.find((c) => this._dateAdapter.isSameDay(c.date(), date));\n\t\t\t\t\tif (cell) {\n\t\t\t\t\t\tcell.focus();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tinjector: this._injector,\n\t\t\t},\n\t\t);\n\n\t\t// we must update the view to ensure the focused cell is visible.\n\t\tthis._changeDetector.detectChanges();\n\t}\n\n\t/**\n\t * Determine if a date is the start of a range.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisStartOfRange(date: T): boolean {\n\t\tconst start = this.startDate();\n\t\treturn start ? this._dateAdapter.isSameDay(date, start) : false;\n\t}\n\n\t/**\n\t * Determine if a date is the end of a range.\n\t * @param date The date to check.\n\t * @returns Always false.\n\t * @internal\n\t */\n\tisEndOfRange(date: T): boolean {\n\t\tconst end = this.endDate();\n\t\treturn end ? this._dateAdapter.isSameDay(date, end) : false;\n\t}\n\n\t/**\n\t * Determine if a date is between the start and end dates.\n\t * @param date The date to check.\n\t * @returns True if the date is between the start and end dates, false otherwise.\n\t * @internal\n\t */\n\tisBetweenRange(date: T): boolean {\n\t\tconst start = this.startDate();\n\t\tconst end = this.endDate();\n\n\t\tif (!start || !end) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tthis._dateAdapter.isAfter(date, start) &&\n\t\t\tthis._dateAdapter.isBefore(date, end) &&\n\t\t\t!this._dateAdapter.isSameDay(date, start) &&\n\t\t\t!this._dateAdapter.isSameDay(date, end)\n\t\t);\n\t}\n\n\tunregisterCalendarCell(cell: BrnCalendarCellButton<T>): void {\n\t\tconst index = this._cells.indexOf(cell);\n\t\tif (index !== -1) {\n\t\t\tthis._cells.splice(index, 1);\n\t\t}\n\t}\n\tregisterCalendarCell(cell: BrnCalendarCellButton<T>): void {\n\t\tthis._cells.push(cell);\n\t}\n}\n","import { BrnCalendar } from './lib/brn-calendar';\nimport { BrnCalendarCell } from './lib/brn-calendar-cell';\nimport { BrnCalendarCellButton } from './lib/brn-calendar-cell-button';\nimport { BrnCalendarGrid } from './lib/brn-calendar-grid';\nimport { BrnCalendarHeader } from './lib/brn-calendar-header';\nimport { BrnCalendarMonthSelect } from './lib/brn-calendar-month-select';\nimport { BrnCalendarNextButton } from './lib/brn-calendar-next-button';\nimport { BrnCalendarPreviousButton } from './lib/brn-calendar-previous-button';\nimport { BrnCalendarWeek } from './lib/brn-calendar-week';\nimport { BrnCalendarWeekday } from './lib/brn-calendar-weekday';\nimport { BrnCalendarYearSelect } from './lib/brn-calendar-year-select';\nimport { BrnCalendarMulti } from './lib/mode/brn-calendar-multiple';\nimport { BrnCalendarRange } from './lib/mode/brn-calendar-range';\n\nexport * from './lib/brn-calendar';\nexport * from './lib/brn-calendar-cell';\nexport * from './lib/brn-calendar-cell-button';\nexport * from './lib/brn-calendar-grid';\nexport * from './lib/brn-calendar-header';\nexport * from './lib/brn-calendar-month-select';\nexport * from './lib/brn-calendar-next-button';\nexport * from './lib/brn-calendar-previous-button';\nexport * from './lib/brn-calendar-week';\nexport * from './lib/brn-calendar-weekday';\nexport * from './lib/brn-calendar-year-select';\nexport * from './lib/brn-calendar.token';\nexport * from './lib/i18n/calendar-i18n';\nexport * from './lib/mode/brn-calendar-multiple';\nexport * from './lib/mode/brn-calendar-range';\n\nexport const BrnCalendarImports = [\n\tBrnCalendarCellButton,\n\tBrnCalendarGrid,\n\tBrnCalendarHeader,\n\tBrnCalendarNextButton,\n\tBrnCalendarPreviousButton,\n\tBrnCalendarWeek,\n\tBrnCalendarWeekday,\n\tBrnCalendar,\n\tBrnCalendarCell,\n\tBrnCalendarMulti,\n\tBrnCalendarRange,\n\tBrnCalendarMonthSelect,\n\tBrnCalendarYearSelect,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEA,IAAI,QAAQ,GAAG,CAAC;MAUH,iBAAiB,CAAA;;IAEb,EAAE,GAAG,KAAK,CAAS,CAAA,oBAAA,EAAuB,EAAE,QAAQ,CAAA,CAAE,yEAAC;2HAF3D,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;+GAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,QAAA,EAAA,MAAA,EAAA,cAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAR7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,IAAI,EAAE;AACL,wBAAA,MAAM,EAAE,MAAM;AACd,wBAAA,WAAW,EAAE,QAAQ;AACrB,wBAAA,IAAI,EAAE,cAAc;AACpB,qBAAA;AACD,iBAAA;;;MCuBY,gBAAgB,GAAG,IAAI,cAAc,CAA2B,kBAAkB;AAEzF,SAAU,kBAAkB,CAAI,QAAkC,EAAA;IACvE,OAAO,EAA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
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/spartan-ng/spartan"
@@ -7,6 +7,7 @@ import * as _spartan_ng_brain_calendar from '@spartan-ng/brain/calendar';
7
7
  declare class BrnCalendarCellButton<T> {
8
8
  /** Access the date adapter */
9
9
  protected readonly _dateAdapter: _spartan_ng_brain_date_time.BrnDateAdapter<T>;
10
+ private readonly _destroyRef;
10
11
  /** Access the calendar component */
11
12
  protected readonly _calendar: _spartan_ng_brain_calendar.BrnCalendarBase<T>;
12
13
  /** Access the element ref */
@@ -19,6 +20,7 @@ declare class BrnCalendarCellButton<T> {
19
20
  readonly end: _angular_core.Signal<boolean>;
20
21
  readonly betweenRange: _angular_core.Signal<boolean>;
21
22
  readonly highlighted: _angular_core.Signal<boolean>;
23
+ constructor();
22
24
  /** Whether this date is focusable */
23
25
  readonly focusable: _angular_core.Signal<boolean>;
24
26
  readonly outside: _angular_core.Signal<boolean>;
@@ -88,6 +90,8 @@ interface BrnCalendarBase<T> {
88
90
  header: Signal<BrnCalendarHeader | undefined>;
89
91
  days: Signal<T[]>;
90
92
  highlightDays: InputSignal<T[]>;
93
+ unregisterCalendarCell(cell: BrnCalendarCellButton<T>): void;
94
+ registerCalendarCell(cell: BrnCalendarCellButton<T>): void;
91
95
  }
92
96
  declare const BrnCalendarToken: InjectionToken<BrnCalendarBase<unknown>>;
93
97
  declare function provideBrnCalendar<T>(instance: Type<BrnCalendarBase<T>>): ExistingProvider;
@@ -167,8 +171,7 @@ declare class BrnCalendar<T> implements BrnCalendarBase<T> {
167
171
  readonly defaultFocusedDate: _angular_core.InputSignal<T | undefined>;
168
172
  /** @internal Access the header */
169
173
  readonly header: _angular_core.Signal<BrnCalendarHeader | undefined>;
170
- /** Store the cells */
171
- protected readonly _cells: _angular_core.Signal<readonly BrnCalendarCellButton<T>[]>;
174
+ private readonly _cells;
172
175
  /**
173
176
  * The focused date.
174
177
  */
@@ -207,8 +210,10 @@ declare class BrnCalendar<T> implements BrnCalendarBase<T> {
207
210
  * @internal
208
211
  */
209
212
  isBetweenRange(_: T): boolean;
213
+ unregisterCalendarCell(cell: BrnCalendarCellButton<T>): void;
214
+ registerCalendarCell(cell: BrnCalendarCellButton<T>): void;
210
215
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnCalendar<any>, never>;
211
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnCalendar<any>, "[brnCalendar]", never, { "highlightDays": { "alias": "highlightDays"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "date": { "alias": "date"; "required": false; "isSignal": true; }; "dateDisabled": { "alias": "dateDisabled"; "required": false; "isSignal": true; }; "weekStartsOn": { "alias": "weekStartsOn"; "required": false; "isSignal": true; }; "defaultFocusedDate": { "alias": "defaultFocusedDate"; "required": false; "isSignal": true; }; }, { "date": "dateChange"; }, ["header", "_cells"], never, true, never>;
216
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnCalendar<any>, "[brnCalendar]", never, { "highlightDays": { "alias": "highlightDays"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "date": { "alias": "date"; "required": false; "isSignal": true; }; "dateDisabled": { "alias": "dateDisabled"; "required": false; "isSignal": true; }; "weekStartsOn": { "alias": "weekStartsOn"; "required": false; "isSignal": true; }; "defaultFocusedDate": { "alias": "defaultFocusedDate"; "required": false; "isSignal": true; }; }, { "date": "dateChange"; }, ["header"], never, true, never>;
212
217
  }
213
218
 
214
219
  declare class BrnCalendarCell {
@@ -333,6 +338,7 @@ declare class BrnCalendarYearSelect {
333
338
 
334
339
  declare class BrnCalendarMulti<T> implements BrnCalendarBase<T> {
335
340
  private readonly _i18n;
341
+ private readonly _cells;
336
342
  /**
337
343
  * Determine if a date is the start of a range. In a date picker, this is always false.
338
344
  * @param date The date to check.
@@ -382,8 +388,6 @@ declare class BrnCalendarMulti<T> implements BrnCalendarBase<T> {
382
388
  readonly defaultFocusedDate: _angular_core.InputSignal<T | undefined>;
383
389
  /** @internal Access the header */
384
390
  readonly header: _angular_core.Signal<BrnCalendarHeader | undefined>;
385
- /** Store the cells */
386
- protected readonly _cells: _angular_core.Signal<readonly BrnCalendarCellButton<T>[]>;
387
391
  /**
388
392
  * The focused date.
389
393
  */
@@ -401,11 +405,14 @@ declare class BrnCalendarMulti<T> implements BrnCalendarBase<T> {
401
405
  isDateDisabled(date: T): boolean;
402
406
  /** @internal Set the focused date */
403
407
  setFocusedDate(date: T): void;
408
+ unregisterCalendarCell(cell: BrnCalendarCellButton<T>): void;
409
+ registerCalendarCell(cell: BrnCalendarCellButton<T>): void;
404
410
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnCalendarMulti<any>, never>;
405
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnCalendarMulti<any>, "[brnCalendarMulti]", never, { "highlightDays": { "alias": "highlightDays"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "minSelection": { "alias": "minSelection"; "required": false; "isSignal": true; }; "maxSelection": { "alias": "maxSelection"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "date": { "alias": "date"; "required": false; "isSignal": true; }; "dateDisabled": { "alias": "dateDisabled"; "required": false; "isSignal": true; }; "weekStartsOn": { "alias": "weekStartsOn"; "required": false; "isSignal": true; }; "defaultFocusedDate": { "alias": "defaultFocusedDate"; "required": false; "isSignal": true; }; }, { "date": "dateChange"; }, ["header", "_cells"], never, true, never>;
411
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnCalendarMulti<any>, "[brnCalendarMulti]", never, { "highlightDays": { "alias": "highlightDays"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "minSelection": { "alias": "minSelection"; "required": false; "isSignal": true; }; "maxSelection": { "alias": "maxSelection"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "date": { "alias": "date"; "required": false; "isSignal": true; }; "dateDisabled": { "alias": "dateDisabled"; "required": false; "isSignal": true; }; "weekStartsOn": { "alias": "weekStartsOn"; "required": false; "isSignal": true; }; "defaultFocusedDate": { "alias": "defaultFocusedDate"; "required": false; "isSignal": true; }; }, { "date": "dateChange"; }, ["header"], never, true, never>;
406
412
  }
407
413
 
408
414
  declare class BrnCalendarRange<T> implements BrnCalendarBase<T> {
415
+ private readonly _cells;
409
416
  private readonly _i18n;
410
417
  protected readonly _dateAdapter: _spartan_ng_brain_date_time.BrnDateAdapter<T>;
411
418
  /** Access the change detector */
@@ -429,8 +436,6 @@ declare class BrnCalendarRange<T> implements BrnCalendarBase<T> {
429
436
  readonly defaultFocusedDate: _angular_core.InputSignal<T | undefined>;
430
437
  /** @internal Access the header */
431
438
  readonly header: _angular_core.Signal<BrnCalendarHeader | undefined>;
432
- /** Store the cells */
433
- protected readonly _cells: _angular_core.Signal<readonly BrnCalendarCellButton<T>[]>;
434
439
  /**
435
440
  * The focused date.
436
441
  */
@@ -477,8 +482,10 @@ declare class BrnCalendarRange<T> implements BrnCalendarBase<T> {
477
482
  * @internal
478
483
  */
479
484
  isBetweenRange(date: T): boolean;
485
+ unregisterCalendarCell(cell: BrnCalendarCellButton<T>): void;
486
+ registerCalendarCell(cell: BrnCalendarCellButton<T>): void;
480
487
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnCalendarRange<any>, never>;
481
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnCalendarRange<any>, "[brnCalendarRange]", never, { "highlightDays": { "alias": "highlightDays"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "dateDisabled": { "alias": "dateDisabled"; "required": false; "isSignal": true; }; "weekStartsOn": { "alias": "weekStartsOn"; "required": false; "isSignal": true; }; "defaultFocusedDate": { "alias": "defaultFocusedDate"; "required": false; "isSignal": true; }; "startDate": { "alias": "startDate"; "required": false; "isSignal": true; }; "endDate": { "alias": "endDate"; "required": false; "isSignal": true; }; }, { "startDate": "startDateChange"; "endDate": "endDateChange"; }, ["header", "_cells"], never, true, never>;
488
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnCalendarRange<any>, "[brnCalendarRange]", never, { "highlightDays": { "alias": "highlightDays"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "dateDisabled": { "alias": "dateDisabled"; "required": false; "isSignal": true; }; "weekStartsOn": { "alias": "weekStartsOn"; "required": false; "isSignal": true; }; "defaultFocusedDate": { "alias": "defaultFocusedDate"; "required": false; "isSignal": true; }; "startDate": { "alias": "startDate"; "required": false; "isSignal": true; }; "endDate": { "alias": "endDate"; "required": false; "isSignal": true; }; }, { "startDate": "startDateChange"; "endDate": "endDateChange"; }, ["header"], never, true, never>;
482
489
  }
483
490
 
484
491
  declare const BrnCalendarImports: readonly [typeof BrnCalendarCellButton, typeof BrnCalendarGrid, typeof BrnCalendarHeader, typeof BrnCalendarNextButton, typeof BrnCalendarPreviousButton, typeof BrnCalendarWeek, typeof BrnCalendarWeekday, typeof BrnCalendar, typeof BrnCalendarCell, typeof BrnCalendarMulti, typeof BrnCalendarRange, typeof BrnCalendarMonthSelect, typeof BrnCalendarYearSelect];