@spartan-ng/brain 0.0.1-alpha.707 → 0.0.1-alpha.708
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/spartan-ng-brain-accordion.mjs +30 -30
- package/fesm2022/spartan-ng-brain-accordion.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-alert-dialog.mjs +19 -19
- package/fesm2022/spartan-ng-brain-alert-dialog.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-autocomplete.mjs +89 -102
- package/fesm2022/spartan-ng-brain-autocomplete.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-avatar.mjs +15 -15
- package/fesm2022/spartan-ng-brain-avatar.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-button.mjs +4 -4
- package/fesm2022/spartan-ng-brain-button.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-calendar.mjs +120 -127
- package/fesm2022/spartan-ng-brain-calendar.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-checkbox.mjs +24 -24
- package/fesm2022/spartan-ng-brain-checkbox.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-collapsible.mjs +17 -17
- package/fesm2022/spartan-ng-brain-collapsible.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-combobox.mjs +151 -178
- package/fesm2022/spartan-ng-brain-combobox.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-command.mjs +43 -52
- package/fesm2022/spartan-ng-brain-command.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-core.mjs +5 -5
- package/fesm2022/spartan-ng-brain-core.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-date-time-luxon.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-date-time.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-dialog.mjs +72 -86
- package/fesm2022/spartan-ng-brain-dialog.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-field.mjs +38 -43
- package/fesm2022/spartan-ng-brain-field.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-forms.mjs +20 -20
- package/fesm2022/spartan-ng-brain-forms.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-hover-card.mjs +24 -32
- package/fesm2022/spartan-ng-brain-hover-card.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-input-otp.mjs +23 -25
- package/fesm2022/spartan-ng-brain-input-otp.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-input.mjs +6 -6
- package/fesm2022/spartan-ng-brain-input.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-label.mjs +6 -6
- package/fesm2022/spartan-ng-brain-label.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-navigation-menu.mjs +49 -53
- package/fesm2022/spartan-ng-brain-navigation-menu.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-popover.mjs +13 -15
- package/fesm2022/spartan-ng-brain-popover.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-progress.mjs +11 -13
- package/fesm2022/spartan-ng-brain-progress.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-radio-group.mjs +28 -34
- package/fesm2022/spartan-ng-brain-radio-group.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-resizable.mjs +23 -23
- package/fesm2022/spartan-ng-brain-resizable.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-select.mjs +102 -105
- package/fesm2022/spartan-ng-brain-select.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-separator.mjs +7 -7
- package/fesm2022/spartan-ng-brain-separator.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-sheet.mjs +24 -24
- package/fesm2022/spartan-ng-brain-sheet.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-slider.mjs +52 -76
- package/fesm2022/spartan-ng-brain-slider.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-sonner.mjs +108 -132
- package/fesm2022/spartan-ng-brain-sonner.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-switch.mjs +21 -23
- package/fesm2022/spartan-ng-brain-switch.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-tabs.mjs +36 -39
- package/fesm2022/spartan-ng-brain-tabs.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-textarea.mjs +6 -6
- package/fesm2022/spartan-ng-brain-textarea.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-toggle-group.mjs +21 -27
- package/fesm2022/spartan-ng-brain-toggle-group.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-toggle.mjs +10 -12
- package/fesm2022/spartan-ng-brain-toggle.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-tooltip.mjs +27 -27
- package/fesm2022/spartan-ng-brain-tooltip.mjs.map +1 -1
- package/hlm-tailwind-preset.css +6 -6
- package/package.json +44 -43
- package/{autocomplete/index.d.ts → types/spartan-ng-brain-autocomplete.d.ts} +10 -10
- package/{calendar/index.d.ts → types/spartan-ng-brain-calendar.d.ts} +2 -2
- package/{combobox/index.d.ts → types/spartan-ng-brain-combobox.d.ts} +10 -10
- package/{dialog/index.d.ts → types/spartan-ng-brain-dialog.d.ts} +1 -1
- package/{hover-card/index.d.ts → types/spartan-ng-brain-hover-card.d.ts} +1 -1
- package/{select/index.d.ts → types/spartan-ng-brain-select.d.ts} +11 -11
- /package/{accordion/index.d.ts → types/spartan-ng-brain-accordion.d.ts} +0 -0
- /package/{alert-dialog/index.d.ts → types/spartan-ng-brain-alert-dialog.d.ts} +0 -0
- /package/{avatar/index.d.ts → types/spartan-ng-brain-avatar.d.ts} +0 -0
- /package/{button/index.d.ts → types/spartan-ng-brain-button.d.ts} +0 -0
- /package/{checkbox/index.d.ts → types/spartan-ng-brain-checkbox.d.ts} +0 -0
- /package/{collapsible/index.d.ts → types/spartan-ng-brain-collapsible.d.ts} +0 -0
- /package/{command/index.d.ts → types/spartan-ng-brain-command.d.ts} +0 -0
- /package/{core/index.d.ts → types/spartan-ng-brain-core.d.ts} +0 -0
- /package/{date-time-luxon/index.d.ts → types/spartan-ng-brain-date-time-luxon.d.ts} +0 -0
- /package/{date-time/index.d.ts → types/spartan-ng-brain-date-time.d.ts} +0 -0
- /package/{field/index.d.ts → types/spartan-ng-brain-field.d.ts} +0 -0
- /package/{forms/index.d.ts → types/spartan-ng-brain-forms.d.ts} +0 -0
- /package/{input-otp/index.d.ts → types/spartan-ng-brain-input-otp.d.ts} +0 -0
- /package/{input/index.d.ts → types/spartan-ng-brain-input.d.ts} +0 -0
- /package/{label/index.d.ts → types/spartan-ng-brain-label.d.ts} +0 -0
- /package/{navigation-menu/index.d.ts → types/spartan-ng-brain-navigation-menu.d.ts} +0 -0
- /package/{popover/index.d.ts → types/spartan-ng-brain-popover.d.ts} +0 -0
- /package/{progress/index.d.ts → types/spartan-ng-brain-progress.d.ts} +0 -0
- /package/{radio-group/index.d.ts → types/spartan-ng-brain-radio-group.d.ts} +0 -0
- /package/{resizable/index.d.ts → types/spartan-ng-brain-resizable.d.ts} +0 -0
- /package/{separator/index.d.ts → types/spartan-ng-brain-separator.d.ts} +0 -0
- /package/{sheet/index.d.ts → types/spartan-ng-brain-sheet.d.ts} +0 -0
- /package/{slider/index.d.ts → types/spartan-ng-brain-slider.d.ts} +0 -0
- /package/{sonner/index.d.ts → types/spartan-ng-brain-sonner.d.ts} +0 -0
- /package/{switch/index.d.ts → types/spartan-ng-brain-switch.d.ts} +0 -0
- /package/{tabs/index.d.ts → types/spartan-ng-brain-tabs.d.ts} +0 -0
- /package/{textarea/index.d.ts → types/spartan-ng-brain-textarea.d.ts} +0 -0
- /package/{toggle-group/index.d.ts → types/spartan-ng-brain-toggle-group.d.ts} +0 -0
- /package/{toggle/index.d.ts → types/spartan-ng-brain-toggle.d.ts} +0 -0
- /package/{tooltip/index.d.ts → types/spartan-ng-brain-tooltip.d.ts} +0 -0
- /package/{index.d.ts → types/spartan-ng-brain.d.ts} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
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';
|
|
3
3
|
import { injectDateAdapter } from '@spartan-ng/brain/date-time';
|
|
4
|
+
import { outputToObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
5
|
import { BrnSelect } from '@spartan-ng/brain/select';
|
|
5
6
|
|
|
6
7
|
const BrnCalendarToken = new InjectionToken('BrnCalendarToken');
|
|
@@ -22,23 +23,23 @@ class BrnCalendarCellButton {
|
|
|
22
23
|
/** Access the element ref */
|
|
23
24
|
_elementRef = inject(ElementRef);
|
|
24
25
|
/** The date this cell represents */
|
|
25
|
-
date = input.required(...(ngDevMode ? [{ debugName: "date" }] : []));
|
|
26
|
+
date = input.required(...(ngDevMode ? [{ debugName: "date" }] : /* istanbul ignore next */ []));
|
|
26
27
|
/** Whether this date is currently selected */
|
|
27
|
-
selected = computed(() => this._calendar.isSelected(this.date()), ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
28
|
-
start = computed(() => this._calendar.isStartOfRange(this.date()), ...(ngDevMode ? [{ debugName: "start" }] : []));
|
|
29
|
-
end = computed(() => this._calendar.isEndOfRange(this.date()), ...(ngDevMode ? [{ debugName: "end" }] : []));
|
|
30
|
-
betweenRange = computed(() => this._calendar.isBetweenRange(this.date()), ...(ngDevMode ? [{ debugName: "betweenRange" }] : []));
|
|
31
|
-
highlighted = computed(() => this._calendar.highlightDays().some((d) => this._dateAdapter.isSameDay(this.date(), d)), ...(ngDevMode ? [{ debugName: "highlighted" }] : []));
|
|
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 */ []));
|
|
32
33
|
/** Whether this date is focusable */
|
|
33
|
-
focusable = computed(() => this._dateAdapter.isSameDay(this._calendar.focusedDate(), this.date()), ...(ngDevMode ? [{ debugName: "focusable" }] : []));
|
|
34
|
+
focusable = computed(() => this._dateAdapter.isSameDay(this._calendar.focusedDate(), this.date()), ...(ngDevMode ? [{ debugName: "focusable" }] : /* istanbul ignore next */ []));
|
|
34
35
|
outside = computed(() => {
|
|
35
36
|
const focusedDate = this._calendar.focusedDate();
|
|
36
37
|
return !this._dateAdapter.isSameMonth(this.date(), focusedDate);
|
|
37
|
-
}, ...(ngDevMode ? [{ debugName: "outside" }] : []));
|
|
38
|
+
}, ...(ngDevMode ? [{ debugName: "outside" }] : /* istanbul ignore next */ []));
|
|
38
39
|
/** Whether this date is today */
|
|
39
|
-
today = computed(() => this._dateAdapter.isSameDay(this.date(), this._dateAdapter.now()), ...(ngDevMode ? [{ debugName: "today" }] : []));
|
|
40
|
+
today = computed(() => this._dateAdapter.isSameDay(this.date(), this._dateAdapter.now()), ...(ngDevMode ? [{ debugName: "today" }] : /* istanbul ignore next */ []));
|
|
40
41
|
/** Whether this date is disabled */
|
|
41
|
-
disabled = computed(() => this._calendar.isDateDisabled(this.date()) || this._calendar.disabled(), ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
42
|
+
disabled = computed(() => this._calendar.isDateDisabled(this.date()) || this._calendar.disabled(), ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
42
43
|
/**
|
|
43
44
|
* Focus the previous cell.
|
|
44
45
|
*/
|
|
@@ -139,10 +140,10 @@ class BrnCalendarCellButton {
|
|
|
139
140
|
focus() {
|
|
140
141
|
this._elementRef.nativeElement.focus();
|
|
141
142
|
}
|
|
142
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
143
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
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 });
|
|
144
145
|
}
|
|
145
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarCellButton, decorators: [{
|
|
146
147
|
type: Directive,
|
|
147
148
|
args: [{
|
|
148
149
|
selector: 'button[brnCalendarCellButton]',
|
|
@@ -177,11 +178,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
177
178
|
let uniqueId = 0;
|
|
178
179
|
class BrnCalendarHeader {
|
|
179
180
|
/** The unique id for the header */
|
|
180
|
-
id = input(`brn-calendar-header-${++uniqueId}`, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
181
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
182
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
181
|
+
id = input(`brn-calendar-header-${++uniqueId}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
182
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
183
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnCalendarHeader, isStandalone: true, selector: "[brnCalendarHeader]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-live": "polite", "role": "presentation" }, properties: { "id": "id()" } }, ngImport: i0 });
|
|
183
184
|
}
|
|
184
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarHeader, decorators: [{
|
|
185
186
|
type: Directive,
|
|
186
187
|
args: [{
|
|
187
188
|
selector: '[brnCalendarHeader]',
|
|
@@ -245,15 +246,15 @@ function injectBrnCalendarI18n() {
|
|
|
245
246
|
return inject(BrnCalendarI18nToken, { optional: true }) ?? inject(BrnCalendarI18nService); // fallback
|
|
246
247
|
}
|
|
247
248
|
class BrnCalendarI18nService {
|
|
248
|
-
_config = signal(defaultCalendarI18n, ...(ngDevMode ? [{ debugName: "_config" }] : []));
|
|
249
|
+
_config = signal(defaultCalendarI18n, ...(ngDevMode ? [{ debugName: "_config" }] : /* istanbul ignore next */ []));
|
|
249
250
|
config = this._config.asReadonly();
|
|
250
251
|
use(config) {
|
|
251
252
|
this._config.set({ ...this.config(), ...config });
|
|
252
253
|
}
|
|
253
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
254
|
-
/** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
254
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarI18nService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
255
|
+
/** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarI18nService, providedIn: 'root' });
|
|
255
256
|
}
|
|
256
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarI18nService, decorators: [{
|
|
257
258
|
type: Injectable,
|
|
258
259
|
args: [{ providedIn: 'root' }]
|
|
259
260
|
}] });
|
|
@@ -267,36 +268,30 @@ class BrnCalendar {
|
|
|
267
268
|
/** Access the injector */
|
|
268
269
|
_injector = inject(Injector);
|
|
269
270
|
/** The days to highlight. */
|
|
270
|
-
highlightDays = input([], ...(ngDevMode ? [{ debugName: "highlightDays" }] : []));
|
|
271
|
+
highlightDays = input([], ...(ngDevMode ? [{ debugName: "highlightDays" }] : /* istanbul ignore next */ []));
|
|
271
272
|
/** The minimum date that can be selected.*/
|
|
272
|
-
min = input(...(ngDevMode ? [undefined, { debugName: "min" }] : []));
|
|
273
|
+
min = input(...(ngDevMode ? [undefined, { debugName: "min" }] : /* istanbul ignore next */ []));
|
|
273
274
|
/** The maximum date that can be selected. */
|
|
274
|
-
max = input(...(ngDevMode ? [undefined, { debugName: "max" }] : []));
|
|
275
|
+
max = input(...(ngDevMode ? [undefined, { debugName: "max" }] : /* istanbul ignore next */ []));
|
|
275
276
|
/** Determine if the date picker is disabled. */
|
|
276
|
-
disabled = input(false, ...(ngDevMode ?
|
|
277
|
-
transform: booleanAttribute,
|
|
278
|
-
}]));
|
|
277
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
279
278
|
/** The selected value. */
|
|
280
|
-
date = model(...(ngDevMode ? [undefined, { debugName: "date" }] : []));
|
|
279
|
+
date = model(...(ngDevMode ? [undefined, { debugName: "date" }] : /* istanbul ignore next */ []));
|
|
281
280
|
/** Whether a specific date is disabled. */
|
|
282
|
-
dateDisabled = input(() => false, ...(ngDevMode ? [{ debugName: "dateDisabled" }] : []));
|
|
281
|
+
dateDisabled = input(() => false, ...(ngDevMode ? [{ debugName: "dateDisabled" }] : /* istanbul ignore next */ []));
|
|
283
282
|
/** The day the week starts on */
|
|
284
|
-
weekStartsOn = input(undefined, ...(ngDevMode ?
|
|
285
|
-
|
|
286
|
-
}]));
|
|
287
|
-
_weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek(), ...(ngDevMode ? [{ debugName: "_weekStartsOn" }] : []));
|
|
283
|
+
weekStartsOn = input(undefined, { ...(ngDevMode ? { debugName: "weekStartsOn" } : /* istanbul ignore next */ {}), transform: (v) => (v === undefined || v === null ? undefined : numberAttribute(v)) });
|
|
284
|
+
_weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek(), ...(ngDevMode ? [{ debugName: "_weekStartsOn" }] : /* istanbul ignore next */ []));
|
|
288
285
|
/** The default focused date. */
|
|
289
|
-
defaultFocusedDate = input(...(ngDevMode ? [undefined, { debugName: "defaultFocusedDate" }] : []));
|
|
286
|
+
defaultFocusedDate = input(...(ngDevMode ? [undefined, { debugName: "defaultFocusedDate" }] : /* istanbul ignore next */ []));
|
|
290
287
|
/** @internal Access the header */
|
|
291
|
-
header = contentChild(BrnCalendarHeader, ...(ngDevMode ? [{ debugName: "header" }] : []));
|
|
288
|
+
header = contentChild(BrnCalendarHeader, ...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
|
|
292
289
|
/** Store the cells */
|
|
293
|
-
_cells = contentChildren(BrnCalendarCellButton, ...(ngDevMode ?
|
|
294
|
-
descendants: true,
|
|
295
|
-
}]));
|
|
290
|
+
_cells = contentChildren(BrnCalendarCellButton, { ...(ngDevMode ? { debugName: "_cells" } : /* istanbul ignore next */ {}), descendants: true });
|
|
296
291
|
/**
|
|
297
292
|
* The focused date.
|
|
298
293
|
*/
|
|
299
|
-
focusedDate = linkedSignal(() => this.constrainDate(this.defaultFocusedDate() ?? this.date() ?? this._dateAdapter.now()), ...(ngDevMode ? [{ debugName: "focusedDate" }] : []));
|
|
294
|
+
focusedDate = linkedSignal(() => this.constrainDate(this.defaultFocusedDate() ?? this.date() ?? this._dateAdapter.now()), ...(ngDevMode ? [{ debugName: "focusedDate" }] : /* istanbul ignore next */ []));
|
|
300
295
|
/**
|
|
301
296
|
* Get all the days to display, this is the days of the current month
|
|
302
297
|
* and the days of the previous and next month to fill the grid.
|
|
@@ -323,7 +318,7 @@ class BrnCalendar {
|
|
|
323
318
|
firstDay = this._dateAdapter.add(firstDay, { days: 1 });
|
|
324
319
|
}
|
|
325
320
|
return days;
|
|
326
|
-
}, ...(ngDevMode ? [{ debugName: "days" }] : []));
|
|
321
|
+
}, ...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
|
|
327
322
|
/** @internal Constrain a date to the min and max boundaries */
|
|
328
323
|
constrainDate(date) {
|
|
329
324
|
const min = this.min();
|
|
@@ -427,10 +422,10 @@ class BrnCalendar {
|
|
|
427
422
|
isBetweenRange(_) {
|
|
428
423
|
return false;
|
|
429
424
|
}
|
|
430
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
431
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "
|
|
425
|
+
/** @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 });
|
|
432
427
|
}
|
|
433
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
428
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendar, decorators: [{
|
|
434
429
|
type: Directive,
|
|
435
430
|
args: [{
|
|
436
431
|
selector: '[brnCalendar]',
|
|
@@ -441,10 +436,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
441
436
|
}, isSignal: true }] }] } });
|
|
442
437
|
|
|
443
438
|
class BrnCalendarCell {
|
|
444
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
445
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
439
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarCell, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
440
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnCalendarCell, isStandalone: true, selector: "[brnCalendarCell]", host: { attributes: { "role": "presentation" } }, ngImport: i0 });
|
|
446
441
|
}
|
|
447
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
442
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarCell, decorators: [{
|
|
448
443
|
type: Directive,
|
|
449
444
|
args: [{
|
|
450
445
|
selector: '[brnCalendarCell]',
|
|
@@ -457,10 +452,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
457
452
|
class BrnCalendarGrid {
|
|
458
453
|
/** Access the calendar component */
|
|
459
454
|
_calendar = injectBrnCalendar();
|
|
460
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
461
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
455
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarGrid, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
456
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnCalendarGrid, isStandalone: true, selector: "[brnCalendarGrid]", host: { attributes: { "role": "grid" }, properties: { "attr.aria-labelledby": "_calendar.header()?.id()" } }, ngImport: i0 });
|
|
462
457
|
}
|
|
463
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
458
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarGrid, decorators: [{
|
|
464
459
|
type: Directive,
|
|
465
460
|
args: [{
|
|
466
461
|
selector: '[brnCalendarGrid]',
|
|
@@ -482,8 +477,18 @@ class BrnCalendarMonthSelect {
|
|
|
482
477
|
_i18n = injectBrnCalendarI18n();
|
|
483
478
|
_selectedMonth = computed(() => {
|
|
484
479
|
return this._i18n.config().months()[this._dateAdapter.getMonth(this._calendar.focusedDate())];
|
|
485
|
-
}, ...(ngDevMode ? [{ debugName: "_selectedMonth" }] : []));
|
|
480
|
+
}, ...(ngDevMode ? [{ debugName: "_selectedMonth" }] : /* istanbul ignore next */ []));
|
|
486
481
|
constructor() {
|
|
482
|
+
// React to user selection through the injected select's typed `value` output rather than a
|
|
483
|
+
// host-listener `$event` (which Angular types as `Event`). The month select's values are the
|
|
484
|
+
// month strings, so narrow to `string` before handling.
|
|
485
|
+
outputToObservable(this._select.value)
|
|
486
|
+
.pipe(takeUntilDestroyed())
|
|
487
|
+
.subscribe((value) => {
|
|
488
|
+
if (typeof value === 'string') {
|
|
489
|
+
this.monthSelected(value);
|
|
490
|
+
}
|
|
491
|
+
});
|
|
487
492
|
effect(() => {
|
|
488
493
|
this._select.writeValue(this._selectedMonth());
|
|
489
494
|
});
|
|
@@ -497,16 +502,13 @@ class BrnCalendarMonthSelect {
|
|
|
497
502
|
const targetDate = this._dateAdapter.set(this._calendar.focusedDate(), { month });
|
|
498
503
|
this._calendar.focusedDate.set(targetDate);
|
|
499
504
|
}
|
|
500
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
501
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
505
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarMonthSelect, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
506
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnCalendarMonthSelect, isStandalone: true, selector: "brnSelect[brnCalendarMonthSelect],hlm-select[brnCalendarMonthSelect]", ngImport: i0 });
|
|
502
507
|
}
|
|
503
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
508
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarMonthSelect, decorators: [{
|
|
504
509
|
type: Directive,
|
|
505
510
|
args: [{
|
|
506
511
|
selector: 'brnSelect[brnCalendarMonthSelect],hlm-select[brnCalendarMonthSelect]',
|
|
507
|
-
host: {
|
|
508
|
-
'(valueChange)': 'monthSelected($event)',
|
|
509
|
-
},
|
|
510
512
|
}]
|
|
511
513
|
}], ctorParameters: () => [] });
|
|
512
514
|
|
|
@@ -542,10 +544,10 @@ class BrnCalendarNextButton {
|
|
|
542
544
|
}
|
|
543
545
|
this._calendar.focusedDate.set(targetDate);
|
|
544
546
|
}
|
|
545
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
546
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
547
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarNextButton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
548
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnCalendarNextButton, isStandalone: true, selector: "[brnCalendarNextButton]", host: { attributes: { "type": "button", "data-slot": "calendar-next-button" }, listeners: { "click": "focusNextMonth()" }, properties: { "attr.aria-label": "_i18n.config().labelNext()" } }, ngImport: i0 });
|
|
547
549
|
}
|
|
548
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarNextButton, decorators: [{
|
|
549
551
|
type: Directive,
|
|
550
552
|
args: [{
|
|
551
553
|
selector: '[brnCalendarNextButton]',
|
|
@@ -590,10 +592,10 @@ class BrnCalendarPreviousButton {
|
|
|
590
592
|
}
|
|
591
593
|
this._calendar.focusedDate.set(targetDate);
|
|
592
594
|
}
|
|
593
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
594
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
595
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarPreviousButton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
596
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnCalendarPreviousButton, isStandalone: true, selector: "[brnCalendarPreviousButton]", host: { attributes: { "type": "button", "data-slot": "calendar-previous-button" }, listeners: { "click": "focusPreviousMonth()" }, properties: { "attr.aria-label": "_i18n.config().labelPrevious()" } }, ngImport: i0 });
|
|
595
597
|
}
|
|
596
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
598
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarPreviousButton, decorators: [{
|
|
597
599
|
type: Directive,
|
|
598
600
|
args: [{
|
|
599
601
|
selector: '[brnCalendarPreviousButton]',
|
|
@@ -623,7 +625,7 @@ class BrnCalendarWeek {
|
|
|
623
625
|
weeks.push(days.slice(i, i + 7));
|
|
624
626
|
}
|
|
625
627
|
return weeks;
|
|
626
|
-
}, ...(ngDevMode ? [{ debugName: "_weeks" }] : []));
|
|
628
|
+
}, ...(ngDevMode ? [{ debugName: "_weeks" }] : /* istanbul ignore next */ []));
|
|
627
629
|
/** Store the view refs */
|
|
628
630
|
_viewRefs = [];
|
|
629
631
|
// Make sure the template checker knows the type of the context with which the
|
|
@@ -659,10 +661,10 @@ class BrnCalendarWeek {
|
|
|
659
661
|
viewRef.destroy();
|
|
660
662
|
}
|
|
661
663
|
}
|
|
662
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
663
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
664
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarWeek, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
665
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnCalendarWeek, isStandalone: true, selector: "[brnCalendarWeek]", ngImport: i0 });
|
|
664
666
|
}
|
|
665
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarWeek, decorators: [{
|
|
666
668
|
type: Directive,
|
|
667
669
|
args: [{
|
|
668
670
|
selector: '[brnCalendarWeek]',
|
|
@@ -681,7 +683,7 @@ class BrnCalendarWeekday {
|
|
|
681
683
|
/** Access the template ref */
|
|
682
684
|
_templateRef = inject(TemplateRef);
|
|
683
685
|
/** Get the days of the week to display in the header. */
|
|
684
|
-
_weekdays = computed(() => this._calendar.days().slice(0, 7), ...(ngDevMode ? [{ debugName: "_weekdays" }] : []));
|
|
686
|
+
_weekdays = computed(() => this._calendar.days().slice(0, 7), ...(ngDevMode ? [{ debugName: "_weekdays" }] : /* istanbul ignore next */ []));
|
|
685
687
|
/** Store the view refs */
|
|
686
688
|
_viewRefs = [];
|
|
687
689
|
// Make sure the template checker knows the type of the context with which the
|
|
@@ -719,10 +721,10 @@ class BrnCalendarWeekday {
|
|
|
719
721
|
viewRef.destroy();
|
|
720
722
|
}
|
|
721
723
|
}
|
|
722
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
723
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
724
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarWeekday, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
725
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnCalendarWeekday, isStandalone: true, selector: "[brnCalendarWeekday]", ngImport: i0 });
|
|
724
726
|
}
|
|
725
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
727
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarWeekday, decorators: [{
|
|
726
728
|
type: Directive,
|
|
727
729
|
args: [{
|
|
728
730
|
selector: '[brnCalendarWeekday]',
|
|
@@ -739,6 +741,16 @@ class BrnCalendarYearSelect {
|
|
|
739
741
|
/** Access the calendar i18n */
|
|
740
742
|
_i18n = injectBrnCalendarI18n();
|
|
741
743
|
constructor() {
|
|
744
|
+
// React to user selection through the injected select's typed `value` output rather than a
|
|
745
|
+
// host-listener `$event` (which Angular types as `Event`). The year select's values are
|
|
746
|
+
// numbers, so narrow to `number` before handling.
|
|
747
|
+
outputToObservable(this._select.value)
|
|
748
|
+
.pipe(takeUntilDestroyed())
|
|
749
|
+
.subscribe((value) => {
|
|
750
|
+
if (typeof value === 'number') {
|
|
751
|
+
this.yearSelected(value);
|
|
752
|
+
}
|
|
753
|
+
});
|
|
742
754
|
effect(() => {
|
|
743
755
|
this._select.writeValue(this._dateAdapter.getYear(this._calendar.focusedDate()));
|
|
744
756
|
});
|
|
@@ -748,16 +760,13 @@ class BrnCalendarYearSelect {
|
|
|
748
760
|
const targetDate = this._dateAdapter.set(this._calendar.focusedDate(), { year });
|
|
749
761
|
this._calendar.focusedDate.set(targetDate);
|
|
750
762
|
}
|
|
751
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
752
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
763
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarYearSelect, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
764
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnCalendarYearSelect, isStandalone: true, selector: "brnSelect[brnCalendarYearSelect],hlm-select[brnCalendarYearSelect]", ngImport: i0 });
|
|
753
765
|
}
|
|
754
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarYearSelect, decorators: [{
|
|
755
767
|
type: Directive,
|
|
756
768
|
args: [{
|
|
757
769
|
selector: 'brnSelect[brnCalendarYearSelect],hlm-select[brnCalendarYearSelect]',
|
|
758
|
-
host: {
|
|
759
|
-
'(valueChange)': 'yearSelected($event)',
|
|
760
|
-
},
|
|
761
770
|
}]
|
|
762
771
|
}], ctorParameters: () => [] });
|
|
763
772
|
|
|
@@ -797,44 +806,34 @@ class BrnCalendarMulti {
|
|
|
797
806
|
/** Access the injector */
|
|
798
807
|
_injector = inject(Injector);
|
|
799
808
|
/** The days to highlight. */
|
|
800
|
-
highlightDays = input([], ...(ngDevMode ? [{ debugName: "highlightDays" }] : []));
|
|
809
|
+
highlightDays = input([], ...(ngDevMode ? [{ debugName: "highlightDays" }] : /* istanbul ignore next */ []));
|
|
801
810
|
/** The minimum date that can be selected.*/
|
|
802
|
-
min = input(...(ngDevMode ? [undefined, { debugName: "min" }] : []));
|
|
811
|
+
min = input(...(ngDevMode ? [undefined, { debugName: "min" }] : /* istanbul ignore next */ []));
|
|
803
812
|
/** The maximum date that can be selected. */
|
|
804
|
-
max = input(...(ngDevMode ? [undefined, { debugName: "max" }] : []));
|
|
813
|
+
max = input(...(ngDevMode ? [undefined, { debugName: "max" }] : /* istanbul ignore next */ []));
|
|
805
814
|
/** The minimum selectable dates. */
|
|
806
|
-
minSelection = input(undefined, ...(ngDevMode ?
|
|
807
|
-
transform: numberAttribute,
|
|
808
|
-
}]));
|
|
815
|
+
minSelection = input(undefined, { ...(ngDevMode ? { debugName: "minSelection" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
809
816
|
/** The maximum selectable dates. */
|
|
810
|
-
maxSelection = input(undefined, ...(ngDevMode ?
|
|
811
|
-
transform: numberAttribute,
|
|
812
|
-
}]));
|
|
817
|
+
maxSelection = input(undefined, { ...(ngDevMode ? { debugName: "maxSelection" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
813
818
|
/** Determine if the date picker is disabled. */
|
|
814
|
-
disabled = input(false, ...(ngDevMode ?
|
|
815
|
-
transform: booleanAttribute,
|
|
816
|
-
}]));
|
|
819
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
817
820
|
/** The selected value. */
|
|
818
|
-
date = model(...(ngDevMode ? [undefined, { debugName: "date" }] : []));
|
|
821
|
+
date = model(...(ngDevMode ? [undefined, { debugName: "date" }] : /* istanbul ignore next */ []));
|
|
819
822
|
/** Whether a specific date is disabled. */
|
|
820
|
-
dateDisabled = input(() => false, ...(ngDevMode ? [{ debugName: "dateDisabled" }] : []));
|
|
823
|
+
dateDisabled = input(() => false, ...(ngDevMode ? [{ debugName: "dateDisabled" }] : /* istanbul ignore next */ []));
|
|
821
824
|
/** The day the week starts on */
|
|
822
|
-
weekStartsOn = input(undefined, ...(ngDevMode ?
|
|
823
|
-
|
|
824
|
-
}]));
|
|
825
|
-
_weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek(), ...(ngDevMode ? [{ debugName: "_weekStartsOn" }] : []));
|
|
825
|
+
weekStartsOn = input(undefined, { ...(ngDevMode ? { debugName: "weekStartsOn" } : /* istanbul ignore next */ {}), transform: (v) => (v === undefined || v === null ? undefined : numberAttribute(v)) });
|
|
826
|
+
_weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek(), ...(ngDevMode ? [{ debugName: "_weekStartsOn" }] : /* istanbul ignore next */ []));
|
|
826
827
|
/** The default focused date. */
|
|
827
|
-
defaultFocusedDate = input(...(ngDevMode ? [undefined, { debugName: "defaultFocusedDate" }] : []));
|
|
828
|
+
defaultFocusedDate = input(...(ngDevMode ? [undefined, { debugName: "defaultFocusedDate" }] : /* istanbul ignore next */ []));
|
|
828
829
|
/** @internal Access the header */
|
|
829
|
-
header = contentChild(BrnCalendarHeader, ...(ngDevMode ? [{ debugName: "header" }] : []));
|
|
830
|
+
header = contentChild(BrnCalendarHeader, ...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
|
|
830
831
|
/** Store the cells */
|
|
831
|
-
_cells = contentChildren(BrnCalendarCellButton, ...(ngDevMode ?
|
|
832
|
-
descendants: true,
|
|
833
|
-
}]));
|
|
832
|
+
_cells = contentChildren(BrnCalendarCellButton, { ...(ngDevMode ? { debugName: "_cells" } : /* istanbul ignore next */ {}), descendants: true });
|
|
834
833
|
/**
|
|
835
834
|
* The focused date.
|
|
836
835
|
*/
|
|
837
|
-
focusedDate = linkedSignal(() => this.constrainDate(this.defaultFocusedDate() ?? this._dateAdapter.now()), ...(ngDevMode ? [{ debugName: "focusedDate" }] : []));
|
|
836
|
+
focusedDate = linkedSignal(() => this.constrainDate(this.defaultFocusedDate() ?? this._dateAdapter.now()), ...(ngDevMode ? [{ debugName: "focusedDate" }] : /* istanbul ignore next */ []));
|
|
838
837
|
/**
|
|
839
838
|
* Get all the days to display, this is the days of the current month
|
|
840
839
|
* and the days of the previous and next month to fill the grid.
|
|
@@ -861,7 +860,7 @@ class BrnCalendarMulti {
|
|
|
861
860
|
firstDay = this._dateAdapter.add(firstDay, { days: 1 });
|
|
862
861
|
}
|
|
863
862
|
return days;
|
|
864
|
-
}, ...(ngDevMode ? [{ debugName: "days" }] : []));
|
|
863
|
+
}, ...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
|
|
865
864
|
isSelected(date) {
|
|
866
865
|
return this.date()?.some((d) => this._dateAdapter.isSameDay(d, date)) ?? false;
|
|
867
866
|
}
|
|
@@ -951,10 +950,10 @@ class BrnCalendarMulti {
|
|
|
951
950
|
// we must update the view to ensure the focused cell is visible.
|
|
952
951
|
this._changeDetector.detectChanges();
|
|
953
952
|
}
|
|
954
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
955
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "
|
|
953
|
+
/** @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 });
|
|
956
955
|
}
|
|
957
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
956
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarMulti, decorators: [{
|
|
958
957
|
type: Directive,
|
|
959
958
|
args: [{
|
|
960
959
|
selector: '[brnCalendarMulti]',
|
|
@@ -973,42 +972,36 @@ class BrnCalendarRange {
|
|
|
973
972
|
/** Access the injector */
|
|
974
973
|
_injector = inject(Injector);
|
|
975
974
|
/** The days to highlight. */
|
|
976
|
-
highlightDays = input([], ...(ngDevMode ? [{ debugName: "highlightDays" }] : []));
|
|
975
|
+
highlightDays = input([], ...(ngDevMode ? [{ debugName: "highlightDays" }] : /* istanbul ignore next */ []));
|
|
977
976
|
/** The minimum date that can be selected.*/
|
|
978
|
-
min = input(...(ngDevMode ? [undefined, { debugName: "min" }] : []));
|
|
977
|
+
min = input(...(ngDevMode ? [undefined, { debugName: "min" }] : /* istanbul ignore next */ []));
|
|
979
978
|
/** The maximum date that can be selected. */
|
|
980
|
-
max = input(...(ngDevMode ? [undefined, { debugName: "max" }] : []));
|
|
979
|
+
max = input(...(ngDevMode ? [undefined, { debugName: "max" }] : /* istanbul ignore next */ []));
|
|
981
980
|
/** Determine if the date picker is disabled. */
|
|
982
|
-
disabled = input(false, ...(ngDevMode ?
|
|
983
|
-
transform: booleanAttribute,
|
|
984
|
-
}]));
|
|
981
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
985
982
|
/** Whether a specific date is disabled. */
|
|
986
|
-
dateDisabled = input(() => false, ...(ngDevMode ? [{ debugName: "dateDisabled" }] : []));
|
|
983
|
+
dateDisabled = input(() => false, ...(ngDevMode ? [{ debugName: "dateDisabled" }] : /* istanbul ignore next */ []));
|
|
987
984
|
/** The day the week starts on */
|
|
988
|
-
weekStartsOn = input(undefined, ...(ngDevMode ?
|
|
989
|
-
|
|
990
|
-
}]));
|
|
991
|
-
_weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek(), ...(ngDevMode ? [{ debugName: "_weekStartsOn" }] : []));
|
|
985
|
+
weekStartsOn = input(undefined, { ...(ngDevMode ? { debugName: "weekStartsOn" } : /* istanbul ignore next */ {}), transform: (v) => (v === undefined || v === null ? undefined : numberAttribute(v)) });
|
|
986
|
+
_weekStartsOn = computed(() => this.weekStartsOn() ?? this._i18n.config().firstDayOfWeek(), ...(ngDevMode ? [{ debugName: "_weekStartsOn" }] : /* istanbul ignore next */ []));
|
|
992
987
|
/** The default focused date. */
|
|
993
|
-
defaultFocusedDate = input(...(ngDevMode ? [undefined, { debugName: "defaultFocusedDate" }] : []));
|
|
988
|
+
defaultFocusedDate = input(...(ngDevMode ? [undefined, { debugName: "defaultFocusedDate" }] : /* istanbul ignore next */ []));
|
|
994
989
|
/** @internal Access the header */
|
|
995
|
-
header = contentChild(BrnCalendarHeader, ...(ngDevMode ? [{ debugName: "header" }] : []));
|
|
990
|
+
header = contentChild(BrnCalendarHeader, ...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
|
|
996
991
|
/** Store the cells */
|
|
997
|
-
_cells = contentChildren(BrnCalendarCellButton, ...(ngDevMode ?
|
|
998
|
-
descendants: true,
|
|
999
|
-
}]));
|
|
992
|
+
_cells = contentChildren(BrnCalendarCellButton, { ...(ngDevMode ? { debugName: "_cells" } : /* istanbul ignore next */ {}), descendants: true });
|
|
1000
993
|
/**
|
|
1001
994
|
* The focused date.
|
|
1002
995
|
*/
|
|
1003
|
-
focusedDate = linkedSignal(() => this.constrainDate(this.defaultFocusedDate() ?? this.startDate() ?? this._dateAdapter.now()), ...(ngDevMode ? [{ debugName: "focusedDate" }] : []));
|
|
996
|
+
focusedDate = linkedSignal(() => this.constrainDate(this.defaultFocusedDate() ?? this.startDate() ?? this._dateAdapter.now()), ...(ngDevMode ? [{ debugName: "focusedDate" }] : /* istanbul ignore next */ []));
|
|
1004
997
|
/**
|
|
1005
998
|
* The selected start date
|
|
1006
999
|
*/
|
|
1007
|
-
startDate = model(...(ngDevMode ? [undefined, { debugName: "startDate" }] : []));
|
|
1000
|
+
startDate = model(...(ngDevMode ? [undefined, { debugName: "startDate" }] : /* istanbul ignore next */ []));
|
|
1008
1001
|
/**
|
|
1009
1002
|
* The selected end date
|
|
1010
1003
|
*/
|
|
1011
|
-
endDate = model(...(ngDevMode ? [undefined, { debugName: "endDate" }] : []));
|
|
1004
|
+
endDate = model(...(ngDevMode ? [undefined, { debugName: "endDate" }] : /* istanbul ignore next */ []));
|
|
1012
1005
|
/**
|
|
1013
1006
|
* Get all the days to display, this is the days of the current month
|
|
1014
1007
|
* and the days of the previous and next month to fill the grid.
|
|
@@ -1035,7 +1028,7 @@ class BrnCalendarRange {
|
|
|
1035
1028
|
firstDay = this._dateAdapter.add(firstDay, { days: 1 });
|
|
1036
1029
|
}
|
|
1037
1030
|
return days;
|
|
1038
|
-
}, ...(ngDevMode ? [{ debugName: "days" }] : []));
|
|
1031
|
+
}, ...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
|
|
1039
1032
|
isSelected(date) {
|
|
1040
1033
|
const start = this.startDate();
|
|
1041
1034
|
const end = this.endDate();
|
|
@@ -1171,10 +1164,10 @@ class BrnCalendarRange {
|
|
|
1171
1164
|
!this._dateAdapter.isSameDay(date, start) &&
|
|
1172
1165
|
!this._dateAdapter.isSameDay(date, end));
|
|
1173
1166
|
}
|
|
1174
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1175
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "
|
|
1167
|
+
/** @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 });
|
|
1176
1169
|
}
|
|
1177
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCalendarRange, decorators: [{
|
|
1178
1171
|
type: Directive,
|
|
1179
1172
|
args: [{
|
|
1180
1173
|
selector: '[brnCalendarRange]',
|