@ardium-ui/ui 5.0.0-alpha.91 → 5.0.0-alpha.92

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.
@@ -418,8 +418,8 @@ class _NgModelComponentBase extends _FocusableComponentBase {
418
418
  }
419
419
  //! event handlers
420
420
  onFocus(event) {
421
- super.onFocus(event);
422
421
  this._shouldEmitTouched = false;
422
+ super.onFocus(event);
423
423
  }
424
424
  onBlur(event) {
425
425
  this._shouldEmitTouched = true;
@@ -6429,6 +6429,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
6429
6429
  args: [{ standalone: true, selector: 'ard-calendar > ng-template[_ard-tmp-repository]' }]
6430
6430
  }], ctorParameters: () => [{ type: i0.TemplateRef }] });
6431
6431
 
6432
+ function isMonthOutOfRange(month, year, min, max) {
6433
+ const dateForMinComparison = new Date(year, month + 1, 0); // last day of month
6434
+ if (isDefined(min) && dateForMinComparison < min)
6435
+ return -1;
6436
+ const dateForMaxComparison = new Date(year, month, 1); // first day of month
6437
+ if (isDefined(max) && dateForMaxComparison > max)
6438
+ return 1;
6439
+ return 0;
6440
+ }
6441
+ function getCalendarMonthsArray(year, min, max) {
6442
+ const months = [];
6443
+ for (let month = 0; month < 12; month++) {
6444
+ const monthData = {
6445
+ value: month,
6446
+ valueDate: new Date(year, month, 2),
6447
+ disabled: !!isMonthOutOfRange(month, year, min, max),
6448
+ };
6449
+ months.push(monthData);
6450
+ }
6451
+ return months;
6452
+ }
6453
+
6432
6454
  /**
6433
6455
  * Generates a layout array to be used to create a calendar page for the given year and month.
6434
6456
  *
@@ -6513,638 +6535,720 @@ function isDayOutOfRange(date, min, max) {
6513
6535
  return 0;
6514
6536
  }
6515
6537
 
6516
- function isMonthOutOfRange(month, year, min, max) {
6517
- const dateForMinComparison = new Date(year, month + 1, 0); // last day of month
6518
- if (isDefined(min) && dateForMinComparison < min)
6519
- return -1;
6520
- const dateForMaxComparison = new Date(year, month, 1); // first day of month
6521
- if (isDefined(max) && dateForMaxComparison > max)
6522
- return 1;
6523
- return 0;
6524
- }
6525
- function getCalendarMonthsArray(year, min, max) {
6526
- const months = [];
6527
- for (let month = 0; month < 12; month++) {
6528
- const monthData = {
6529
- value: month,
6530
- valueDate: new Date(year, month, 2),
6531
- disabled: !!isMonthOutOfRange(month, year, min, max),
6532
- };
6533
- months.push(monthData);
6534
- }
6535
- return months;
6536
- }
6537
-
6538
- function getCalendarYearsArray(startYear, yearCount, min, max) {
6539
- return new Array(yearCount).fill(startYear).map((v, i) => ({ value: v + i, valueDate: new Date(v + i, 1, 1), disabled: !!isYearOutOfRange(v + i, min, max) }));
6540
- }
6541
- function isYearOutOfRange(year, min, max) {
6542
- const dateForMinComparison = new Date(year, 11, 31);
6543
- if (isDefined(min) && dateForMinComparison < min)
6544
- return -1;
6545
- const dateForMaxComparison = new Date(year, 0, 1);
6546
- if (isDefined(max) && dateForMaxComparison > max)
6547
- return 1;
6548
- return 0;
6538
+ const ARD_ICON_BUTTON_DEFAULTS = new InjectionToken('ard-icon-button-defaults', {
6539
+ factory: () => ({ ..._simpleButtonDefaults, ..._focusableComponentDefaults }),
6540
+ });
6541
+ function provideIconButtonDefaults(config) {
6542
+ return { provide: ARD_ICON_BUTTON_DEFAULTS, useValue: { ..._simpleButtonDefaults, ..._focusableComponentDefaults, ...config } };
6549
6543
  }
6550
6544
 
6551
- class _AbstractCalendar extends _FormFieldComponentBase {
6545
+ class ArdiumIconButtonComponent extends _FocusableComponentBase {
6552
6546
  constructor(defaults) {
6553
6547
  super(defaults);
6554
- this.TODAY = computed(() => createDate(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), this.UTC()));
6555
- //! appearance
6548
+ this.wrapperClasses = input('');
6549
+ this.type = input(this._DEFAULTS.type);
6550
+ this.ariaLabel = input('');
6551
+ //! button settings
6556
6552
  this.color = input(this._DEFAULTS.color);
6557
- this.ngClasses = computed(() => [`ard-color-${this.color()}`].join(' '));
6558
- //! active view
6559
- this.activeView = model(this._DEFAULTS.activeView);
6560
- this.activeYear = model(this._DEFAULTS.activeYear);
6561
- this.activeMonth = model(this._DEFAULTS.activeMonth);
6562
- this.activePageChange = output();
6563
- this.firstWeekday = input(this._DEFAULTS.firstWeekday, {
6564
- transform: v => {
6565
- const value = coerceNumberProperty(v, this._DEFAULTS.firstWeekday);
6566
- if (!Number.isInteger(value)) {
6567
- console.error(new Error(`ARD-NF${this.componentId}1A: [firstWeekday] must be a positive integer, got "${value}". Using default value instead.`));
6568
- return this._DEFAULTS.firstWeekday;
6569
- }
6570
- if (value < 0 || value > 6) {
6571
- console.error(new Error(`ARD-NF${this.componentId}1B: [firstWeekday] must be between 0 and 6, got "${value}". Using modulo operator to adjust the value.`));
6572
- }
6573
- return value % 7;
6574
- },
6575
- });
6576
- this.multipleYearPageChangeModifier = input(this._DEFAULTS.multipleYearPageChangeModifier, {
6577
- transform: v => {
6578
- const value = coerceNumberProperty(v, this._DEFAULTS.multipleYearPageChangeModifier);
6579
- if (!Number.isInteger(value) || value < 1) {
6580
- console.error(new Error(`ARD-NF${this.componentId}2: [multipleYearPageChangeModifier] must be a positive integer, got "${value}". Using default value instead.`));
6581
- return this._DEFAULTS.multipleYearPageChangeModifier;
6582
- }
6583
- return value;
6584
- },
6585
- });
6586
- this.multipleYearOffset = input(this._DEFAULTS.multipleYearOffset, {
6587
- transform: v => {
6588
- const value = coerceNumberProperty(v, this._DEFAULTS.multipleYearOffset);
6589
- if (!Number.isInteger(value) || value < 0) {
6590
- console.error(new Error(`ARD-NF${this.componentId}3: [multipleYearOffset] must be a non-negative integer, got "${value}". Using default value instead.`));
6591
- return this._DEFAULTS.multipleYearOffset;
6592
- }
6593
- return value;
6594
- },
6595
- });
6596
- this.multipleYearPageSize = input(this._DEFAULTS.multipleYearPageSize, {
6597
- transform: v => {
6598
- const value = coerceNumberProperty(v, this._DEFAULTS.multipleYearPageSize);
6599
- if (!Number.isInteger(value) || value < 1) {
6600
- console.error(new Error(`ARD-NF${this.componentId}5: [multipleYearPageSize] must be a positive integer, got "${value}". Using default value instead.`));
6601
- return this._DEFAULTS.multipleYearPageSize;
6602
- }
6603
- return value;
6604
- },
6605
- });
6606
- this.multiCalendarLocation = input(this._DEFAULTS.multiCalendarLocation);
6607
- this.autoFocus = input(this._DEFAULTS.autoFocus, { transform: v => coerceBooleanProperty(v) });
6608
- this.staticHeight = input(this._DEFAULTS.staticHeight, { transform: v => coerceBooleanProperty(v) });
6609
- this.hideFloatingMonth = input(this._DEFAULTS.hideFloatingMonth, {
6553
+ this.lightColoring = input(this._DEFAULTS.lightColoring, {
6610
6554
  transform: v => coerceBooleanProperty(v),
6611
6555
  });
6612
- //! value
6613
- this.selectionStart = signal(null);
6614
- this.selectionEnd = signal(null);
6615
- this.yearSelect = output();
6616
- this.monthSelect = output();
6617
- this.min = input(this._DEFAULTS.min, {
6618
- transform: v => (v === null ? null : coerceDateProperty(v, this._DEFAULTS.min)),
6619
- });
6620
- this.max = input(this._DEFAULTS.max, {
6621
- transform: v => (v === null ? null : coerceDateProperty(v, this._DEFAULTS.max)),
6556
+ this.compact = input(this._DEFAULTS.compact, { transform: v => coerceBooleanProperty(v) });
6557
+ this.pointerEventsWhenDisabled = input(this._DEFAULTS.pointerEventsWhenDisabled, {
6558
+ transform: v => coerceBooleanProperty(v),
6622
6559
  });
6623
- this.UTC = input(this._DEFAULTS.UTC, { transform: v => coerceBooleanProperty(v) });
6624
- this._UTCAfterInit = signal(this._DEFAULTS.UTC);
6625
- this.filter = input(this._DEFAULTS.filter);
6626
- this.isDayFilteredOut = computed(() => {
6627
- return (day, month = this.activeMonth(), year = this.activeYear()) => {
6628
- return this.filter()?.(createDate(year, month, day, this.UTC())) ?? false;
6629
- };
6560
+ this.ngClasses = computed(() => [
6561
+ 'ard-appearance-transparent',
6562
+ `ard-color-${this.disabled() ? ComponentColor.None : this.color()}`,
6563
+ this.lightColoring() ? `ard-light-coloring` : '',
6564
+ this.compact() ? 'ard-compact' : '',
6565
+ ].join(' '));
6566
+ }
6567
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumIconButtonComponent, deps: [{ token: ARD_ICON_BUTTON_DEFAULTS }], target: i0.ɵɵFactoryTarget.Component }); }
6568
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.15", type: ArdiumIconButtonComponent, isStandalone: false, selector: "ard-icon-button", inputs: { wrapperClasses: { classPropertyName: "wrapperClasses", publicName: "wrapperClasses", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, lightColoring: { classPropertyName: "lightColoring", publicName: "lightColoring", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, pointerEventsWhenDisabled: { classPropertyName: "pointerEventsWhenDisabled", publicName: "pointerEventsWhenDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ard-button-with-pointer-events-when-disabled": "pointerEventsWhenDisabled()" } }, usesInheritance: true, ngImport: i0, template: "<button\r\n class=\"ard-icon-button\"\r\n [type]=\"type()\"\r\n [ngClass]=\"ngClasses()\"\r\n [tabindex]=\"tabIndex()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n>\r\n <ng-content></ng-content>\r\n</button>\r\n", styles: ["@layer ard-ui{ard-icon-button{display:block}.ard-icon-button{display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.ard-icon-button .ard-button-content{max-height:100%;display:flex;align-items:center;justify-content:center}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
6569
+ }
6570
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumIconButtonComponent, decorators: [{
6571
+ type: Component,
6572
+ args: [{ standalone: false, selector: 'ard-icon-button', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
6573
+ '[class.ard-button-with-pointer-events-when-disabled]': 'pointerEventsWhenDisabled()',
6574
+ }, template: "<button\r\n class=\"ard-icon-button\"\r\n [type]=\"type()\"\r\n [ngClass]=\"ngClasses()\"\r\n [tabindex]=\"tabIndex()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n>\r\n <ng-content></ng-content>\r\n</button>\r\n", styles: ["@layer ard-ui{ard-icon-button{display:block}.ard-icon-button{display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.ard-icon-button .ard-button-content{max-height:100%;display:flex;align-items:center;justify-content:center}}\n"] }]
6575
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
6576
+ type: Inject,
6577
+ args: [ARD_ICON_BUTTON_DEFAULTS]
6578
+ }] }] });
6579
+
6580
+ const TODAY$2 = new Date();
6581
+ class DaysViewComponent {
6582
+ constructor() {
6583
+ this.tabIndex = input.required();
6584
+ this.readOnly = input.required();
6585
+ this.disabled = input.required();
6586
+ this.autoFocus = input.required();
6587
+ this._isUsingKeyboard = input.required();
6588
+ //! active year/month
6589
+ this.activeYear = input.required();
6590
+ this.activeMonth = input.required();
6591
+ this.selectedDate = input.required();
6592
+ this.selectedDateEnd = input.required();
6593
+ this.rangeSelectionMode = input.required();
6594
+ this.UTC = input.required();
6595
+ this.min = input.required();
6596
+ this.max = input.required();
6597
+ this.multiCalendarLocation = input.required();
6598
+ this.isDayFilteredOut = input.required();
6599
+ this.highlightedDay = input.required();
6600
+ this.highlightedDayDate = computed(() => {
6601
+ const day = this.highlightedDay();
6602
+ if (day === null)
6603
+ return null;
6604
+ return createDate(this.activeYear(), this.activeMonth(), day, this.UTC());
6630
6605
  });
6631
- //! highlighting days
6632
- this.highlightedDay = model(null);
6633
- this.highlightDayEvent = output({ alias: 'highlightDay' });
6634
- //! highlighting months
6635
- this._highlightedMonth = signal(null);
6636
- this.highlightedMonth = this._highlightedMonth.asReadonly();
6637
- //! highlighting years
6638
- this.__highlightedYear = signal(null);
6639
- this.highlightedYear = this.__highlightedYear.asReadonly();
6640
- this.currentYearRangeStart = linkedSignal(() => {
6641
- // align to a multiple of 4 and subtract offset
6642
- const rangeStartForCurrentYear = this.TODAY().getFullYear() - (this.TODAY().getFullYear() % 4) - this.multipleYearOffset() * 4;
6643
- const activeYear = this.activeYear();
6644
- const offset = roundToMultiple(activeYear - rangeStartForCurrentYear + 1, this.multipleYearPageSize(), 'up') - this.multipleYearPageSize(); // check how many n-year pages need to be turned
6645
- return rangeStartForCurrentYear + offset;
6606
+ //! focusing
6607
+ this.focusableElement = viewChild.required('focusableElement');
6608
+ //! calendar data
6609
+ this.firstWeekday = input.required();
6610
+ this.staticHeight = input.required();
6611
+ this.hideFloatingMonth = input.required();
6612
+ this.activeCalendarData = computed(() => getCalendarDayData(this.activeYear(), this.activeMonth(), this.firstWeekday(), this.min(), this.max(), this.staticHeight(), !this.hideFloatingMonth()));
6613
+ this.reserveTopRow = computed(() => !this.hideFloatingMonth() && this.activeCalendarData().leadingSpaces < 3);
6614
+ this.weekdayArray = computed(() => getCalendarWeekdayArray(this.firstWeekday()));
6615
+ this.currentAriaLabel = computed(() => {
6616
+ const day = this.highlightedDay();
6617
+ if (day === null) {
6618
+ return '';
6619
+ }
6620
+ return new Date(this.activeYear(), this.activeMonth(), day).toLocaleDateString(undefined, {
6621
+ weekday: 'long',
6622
+ year: 'numeric',
6623
+ month: 'long',
6624
+ day: 'numeric',
6625
+ });
6646
6626
  });
6647
- //! internals
6648
- this._isUsingKeyboard = signal(false);
6627
+ //! outputs
6628
+ this.triggerOpenYearsView = output();
6629
+ this.triggerOpenMonthsView = output();
6630
+ this.triggerSelectDay = output();
6631
+ this.triggerChangeMonth = output();
6632
+ this.triggerChangeYear = output();
6633
+ this.triggerHighlightDay = output();
6634
+ this.triggerHighlightNextDay = output();
6635
+ this.triggerHighlightPreviousDay = output();
6636
+ this.triggerHighlightFirstDay = output();
6637
+ this.triggerHighlightLastDay = output();
6638
+ this.triggerHighlightSameDayPreviousPage = output();
6639
+ this.triggerHighlightSameDayNextPage = output();
6640
+ this.focusEvent = output({ alias: 'focus' });
6641
+ this.blurEvent = output({ alias: 'blur' });
6649
6642
  //! templates
6650
- this.templateRepository = contentChild(_CalendarTemplateRepositoryDirective);
6651
- this.yearsViewHeaderTemplate = contentChild(ArdCalendarYearsViewHeaderTemplateDirective);
6652
- this.monthsViewHeaderTemplate = contentChild(ArdCalendarMonthsViewHeaderTemplateDirective);
6653
- this.daysViewHeaderTemplate = contentChild(ArdCalendarDaysViewHeaderTemplateDirective);
6654
- this.floatingMonthTemplate = contentChild(ArdCalendarFloatingMonthTemplateDirective);
6655
- this.yearTemplate = contentChild(ArdCalendarYearTemplateDirective);
6656
- this.monthTemplate = contentChild(ArdCalendarMonthTemplateDirective);
6657
- this.dayTemplate = contentChild(ArdCalendarDayTemplateDirective);
6658
- this.weekdayTemplate = contentChild(ArdCalendarWeekdayTemplateDirective);
6643
+ this.daysViewHeaderTemplate = input.required();
6644
+ this.floatingMonthTemplate = input.required();
6645
+ this.weekdayTemplate = input.required();
6646
+ this.dayTemplate = input.required();
6659
6647
  //! template customizations
6660
- this.daysViewHeaderDateFormat = input(this._DEFAULTS.daysViewHeaderDateFormat); // 'MMM YYYY'
6661
- this.yearsViewHeaderDateFormat = input(this._DEFAULTS.yearsViewHeaderDateFormat); // 'YYYY'
6662
- this.monthsViewHeaderDateFormat = input(this._DEFAULTS.monthsViewHeaderDateFormat); // 'YYYY'
6663
- this.weekdayDateFormat = input(this._DEFAULTS.weekdayDateFormat); // 'EEEEE'
6664
- this.weekdayTitleDateFormat = input(this._DEFAULTS.weekdayTitleDateFormat); // 'EEEE'
6665
- this.floatingMonthDateFormat = input(this._DEFAULTS.floatingMonthDateFormat); // 'LLL'
6666
- this.floatingMonthTitleDateFormat = input(this._DEFAULTS.floatingMonthTitleDateFormat); // 'LLLL'
6667
- this.yearDateFormat = input(this._DEFAULTS.yearDateFormat); // 'YYYY'
6668
- this.monthDateFormat = input(this._DEFAULTS.monthDateFormat); // 'MMM'
6669
- this.dayDateFormat = input(this._DEFAULTS.dayDateFormat); // 'D'
6670
- }
6671
- onTriggerOpenDaysView() {
6672
- this.activeView.set(ArdCalendarView.Days);
6648
+ this.daysViewHeaderDateFormat = input.required(); // 'MMM YYYY'
6649
+ this.weekdayDateFormat = input.required(); // 'EEEEE'
6650
+ this.weekdayTitleDateFormat = input.required(); // 'EEEE'
6651
+ this.floatingMonthDateFormat = input.required(); // 'LLL'
6652
+ this.floatingMonthTitleDateFormat = input.required(); // 'LLLL'
6653
+ this.dayDateFormat = input.required(); // 'D'
6654
+ //! template contexts
6655
+ this.daysViewHeaderContext = computed(() => ({
6656
+ nextMonth: () => {
6657
+ this.triggerChangeMonth.emit(this.activeMonth() + 1);
6658
+ },
6659
+ prevMonth: () => {
6660
+ this.triggerChangeMonth.emit(this.activeMonth() - 1);
6661
+ },
6662
+ nextYear: () => {
6663
+ this.triggerChangeYear.emit(this.activeYear() + 1);
6664
+ },
6665
+ prevYear: () => {
6666
+ this.triggerChangeYear.emit(this.activeYear() - 1);
6667
+ },
6668
+ openYearsView: () => {
6669
+ this.triggerOpenYearsView.emit();
6670
+ },
6671
+ openMonthsView: () => {
6672
+ this.triggerOpenMonthsView.emit();
6673
+ },
6674
+ onFocus: (event) => {
6675
+ this.focusEvent.emit(event);
6676
+ },
6677
+ onBlur: (event) => {
6678
+ this.blurEvent.emit(event);
6679
+ },
6680
+ canGoToNextPage: !this.isMonthOutOfRange(this.activeMonth() + 1),
6681
+ canGoToPreviousPage: !this.isMonthOutOfRange(this.activeMonth() - 1),
6682
+ hideNextPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Left ||
6683
+ this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
6684
+ hidePreviousPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Right ||
6685
+ this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
6686
+ year: this.activeYear(),
6687
+ month: this.activeMonth(),
6688
+ $implicit: getUTCDate(this.activeYear(), this.activeMonth(), 2), // second day of month to prevent timezone issues
6689
+ }));
6690
+ this.weekdayContext = computed(() => (dayIndex) => {
6691
+ // create a date object for the given day index (0 = Sunday, 1 = Monday, etc.)
6692
+ // add 4 because January 4, 1970 is a Sunday
6693
+ const date = getUTCDate(1970, 0, 4 + dayIndex);
6694
+ return {
6695
+ dayIndex,
6696
+ date,
6697
+ $implicit: date,
6698
+ };
6699
+ });
6700
+ this.floatingMonthContext = computed(() => {
6701
+ const date = getUTCDate(this.activeYear(), this.activeMonth(), 2); // second day of month to prevent timezone issues
6702
+ return {
6703
+ month: this.activeMonth(),
6704
+ date,
6705
+ $implicit: date,
6706
+ };
6707
+ });
6708
+ this.dayContext = computed(() => (day) => {
6709
+ const date = getUTCDate(this.activeYear(), this.activeMonth(), day);
6710
+ return {
6711
+ value: day,
6712
+ date,
6713
+ $implicit: day,
6714
+ select: (dayOrDate) => {
6715
+ this.triggerSelectDay.emit(dayOrDate instanceof Date ? dayOrDate.getDate() : dayOrDate);
6716
+ },
6717
+ };
6718
+ });
6673
6719
  }
6674
- onTriggerOpenMonthsView() {
6675
- this.activeView.set(ArdCalendarView.Months);
6720
+ onMouseMove() {
6721
+ if (this._isUsingKeyboard())
6722
+ return;
6723
+ if (this.highlightedDay())
6724
+ this.triggerHighlightDay.emit(null);
6676
6725
  }
6677
- onTriggerOpenYearsView() {
6678
- this.activeView.set(ArdCalendarView.Years);
6726
+ ngAfterViewInit() {
6727
+ if (!this.autoFocus())
6728
+ return;
6729
+ this.focus();
6730
+ this.triggerHighlightDay.emit(1);
6679
6731
  }
6680
- _emitChange() {
6681
- this._onChangeRegistered?.(this.value());
6732
+ focus() {
6733
+ this.focusableElement().nativeElement.focus();
6682
6734
  }
6683
- ngOnChanges(changes) {
6684
- if (changes['UTC']) {
6685
- if (changes['UTC'].firstChange) {
6686
- this._UTCAfterInit.set(changes['UTC'].currentValue);
6687
- }
6688
- else {
6689
- console.error(`ARD-NF${this.componentId}4: <ard-${this.componentName}>'s [UTC] attribute should not be changed dynamically. This change will be ignored.`);
6690
- }
6691
- }
6692
- if (changes['value']) {
6693
- this.writeValue(changes['value'].currentValue);
6735
+ isDaySelected(day) {
6736
+ if (day instanceof Date)
6737
+ day = day.getDate();
6738
+ const isStartDateSelected = this.isDaySelectedStart(day);
6739
+ if (this.rangeSelectionMode()) {
6740
+ const isEndDateSelected = this.isDaySelectedEnd(day);
6741
+ return isStartDateSelected || isEndDateSelected;
6694
6742
  }
6743
+ return isStartDateSelected;
6695
6744
  }
6696
- _emitActivePageChange() {
6697
- this.activePageChange.emit({ year: this.activeYear(), month: this.activeMonth() });
6745
+ isDaySelectedStart(day) {
6746
+ if (day instanceof Date)
6747
+ day = day.getDate();
6748
+ const selected = this.selectedDate();
6749
+ const { year, month, date } = getDateComponents(selected, this.UTC());
6750
+ const isStartDateSelected = selected !== null && this.activeYear() === year && this.activeMonth() === month && day === date;
6751
+ return isStartDateSelected;
6698
6752
  }
6699
- _emitHighlightedDate() {
6700
- const day = this.highlightedDay();
6701
- if (!day)
6702
- return;
6703
- const date = createDate(this.activeYear(), this.activeMonth(), day, this.UTC());
6704
- this.highlightDayEvent.emit(date);
6753
+ isDaySelectedEnd(day) {
6754
+ if (day instanceof Date)
6755
+ day = day.getDate();
6756
+ const selected = this.selectedDateEnd();
6757
+ const { year, month, date } = getDateComponents(selected, this.UTC());
6758
+ const isEndDateSelected = selected !== null && this.activeYear() === year && this.activeMonth() === month && day === date;
6759
+ return isEndDateSelected;
6705
6760
  }
6706
- //! selecting days
6707
- isDayOutOfRange(day, month = this.activeMonth(), year = this.activeYear()) {
6708
- const dayDate = new Date(year, month, day);
6709
- return isDayOutOfRange(dayDate, this.min(), this.max());
6761
+ isDayBetweenSelectedRange(day) {
6762
+ if (!this.rangeSelectionMode())
6763
+ return false;
6764
+ if (day instanceof Date)
6765
+ day = day.getDate();
6766
+ const selected = this.selectedDate();
6767
+ const selectedEnd = this.selectedDateEnd();
6768
+ if (selected === null || selectedEnd === null || selected >= selectedEnd)
6769
+ return false;
6770
+ return this._isDayBetweenDates(day, selected, selectedEnd);
6710
6771
  }
6711
- selectDay(day) {
6712
- const startValue = this.selectionStart();
6713
- // reset selection
6714
- if (isNull(day)) {
6715
- if (!isDefined(startValue))
6716
- return;
6717
- this.selectionStart.set(null);
6718
- this.selectionEnd.set(null);
6719
- return;
6720
- }
6772
+ isDayBetweenSelectedHighlighted(day) {
6773
+ if (!this.rangeSelectionMode() || this.selectedDateEnd())
6774
+ return false;
6721
6775
  if (day instanceof Date)
6722
6776
  day = day.getDate();
6723
- // check if day is out of range or filtered out
6724
- if ((day && this.isDayOutOfRange(day)) || this.isDayFilteredOut()(day))
6777
+ const selected = this.selectedDate();
6778
+ const highlightedEnd = this.highlightedDayDate();
6779
+ if (selected === null || highlightedEnd === null || selected >= highlightedEnd)
6780
+ return false;
6781
+ return this._isDayBetweenDates(day, selected, highlightedEnd);
6782
+ }
6783
+ _isDayBetweenDates(day, startDate, endDate) {
6784
+ const date = createDate(this.activeYear(), this.activeMonth(), day, this.UTC());
6785
+ return date >= startDate && date <= endDate;
6786
+ }
6787
+ onCalendarDayMouseover(day) {
6788
+ if (this._isUsingKeyboard())
6725
6789
  return;
6726
- // range selection logic
6727
- const endValue = this.selectionEnd();
6728
- const newDate = createDate(this.activeYear(), this.activeMonth(), day, this.UTC());
6729
- if (this.isRangeSelector) {
6730
- // select end date
6731
- if (isDefined(startValue) && !isDefined(endValue) && newDate > startValue) {
6732
- this.selectionEnd.set(newDate);
6733
- return;
6734
- }
6735
- // reset end date and start a new selection
6736
- this.selectionEnd.set(null);
6737
- }
6738
- // avoid setting the same date again
6739
- if (startValue &&
6740
- startValue.getFullYear() === this.activeYear() &&
6741
- startValue.getMonth() === this.activeMonth() &&
6742
- startValue.getDate() === day) {
6790
+ if (this.disabled() || this.readOnly())
6743
6791
  return;
6744
- }
6745
- this.selectionStart.set(newDate);
6746
- }
6747
- selectCurrentlyHighlightedDay() {
6748
- if (!isDefined(this.highlightedDay()))
6792
+ if (day && this.isDayFilteredOut()(day))
6749
6793
  return;
6750
- this.selectDay(this.highlightedDay());
6794
+ this.triggerHighlightDay.emit(day);
6751
6795
  }
6752
- setHighlightedDay(day, month = this.activeMonth(), year = this.activeYear()) {
6753
- if (isNull(day)) {
6754
- this.highlightedDay.update(() => day);
6755
- this._emitHighlightedDate();
6796
+ onCalendarDayClick(day) {
6797
+ if (this.disabled() || this.readOnly())
6756
6798
  return;
6757
- }
6758
- const date = createDate(year, month, day, this.UTC());
6759
- const outOfRange = this.isDayOutOfRange(day, month, year);
6760
- if (outOfRange === -1) {
6761
- this._highlightMinDay();
6799
+ if (day === null)
6762
6800
  return;
6763
- }
6764
- if (outOfRange === 1) {
6765
- this._highlightMaxDay();
6801
+ if (this.isDayFilteredOut()(day))
6766
6802
  return;
6767
- }
6768
- this.highlightedDay.update(() => date.getDate());
6769
- if (date.getFullYear() !== this.activeYear()) {
6770
- this.activeYear.set(date.getFullYear());
6771
- }
6772
- if (date.getMonth() !== this.activeMonth()) {
6773
- this.activeMonth.set(date.getMonth());
6774
- }
6775
- this._emitHighlightedDate();
6776
- this._emitActivePageChange();
6803
+ this.triggerHighlightDay.emit(day);
6804
+ this.focus();
6805
+ this.triggerSelectDay.emit(day);
6777
6806
  }
6778
- _highlightMinDay() {
6779
- const min = this.min();
6780
- if (!isDefined(min))
6807
+ onDayGridFocus() {
6808
+ if (this.disabled() || this.readOnly())
6781
6809
  return;
6782
- this.activeYear.set(min.getFullYear());
6783
- this.activeMonth.set(min.getMonth());
6784
- this.highlightedDay.set(min.getDate());
6785
- this._emitHighlightedDate();
6786
- this._emitActivePageChange();
6810
+ this.triggerHighlightFirstDay.emit();
6787
6811
  }
6788
- _highlightMaxDay() {
6789
- const max = this.max();
6790
- if (!isDefined(max))
6812
+ onDayGridBlur() {
6813
+ if (this.disabled() || this.readOnly())
6791
6814
  return;
6792
- this.activeYear.set(max.getFullYear());
6793
- this.activeMonth.set(max.getMonth());
6794
- this.highlightedDay.set(max.getDate());
6795
- this._emitHighlightedDate();
6796
- this._emitActivePageChange();
6815
+ this.triggerHighlightDay.emit(null);
6797
6816
  }
6798
- highlightNextDay(offset = 1) {
6799
- const currentDay = this.highlightedDay();
6800
- const newDay = isDefined(currentDay) ? currentDay + offset : 1;
6801
- this.setHighlightedDay(newDay);
6817
+ onDayGridClick() {
6818
+ if (this.disabled() || this.readOnly())
6819
+ return;
6820
+ if (this.highlightedDay() !== null)
6821
+ return;
6822
+ this.triggerHighlightFirstDay.emit();
6802
6823
  }
6803
- highlightPreviousDay(offset = 1) {
6804
- this.highlightNextDay(offset * -1);
6824
+ //! helpers
6825
+ isDayToday(day) {
6826
+ return this.activeYear() === TODAY$2.getFullYear() && this.activeMonth() === TODAY$2.getMonth() && day === TODAY$2.getDate();
6805
6827
  }
6806
- highlightFirstDay() {
6807
- this.setHighlightedDay(1);
6828
+ isMonthOutOfRange(month) {
6829
+ return isMonthOutOfRange(month, this.activeYear(), this.min(), this.max());
6808
6830
  }
6809
- highlightLastDay() {
6810
- const daysInMonth = createDate(this.activeYear(), this.activeMonth() + 1, 0, this.UTC()).getDate();
6811
- this.setHighlightedDay(daysInMonth);
6831
+ //! keyboard controls
6832
+ onMainGridKeydown(event) {
6833
+ if (this.disabled() || this.readOnly())
6834
+ return;
6835
+ switch (event.code) {
6836
+ case 'Space':
6837
+ case 'Enter':
6838
+ this._onEnterPress(event);
6839
+ break;
6840
+ case 'ArrowUp':
6841
+ this._onArrowUpPress(event);
6842
+ break;
6843
+ case 'ArrowDown':
6844
+ this._onArrowDownPress(event);
6845
+ break;
6846
+ case 'ArrowLeft':
6847
+ this._onArrowLeftPress(event);
6848
+ break;
6849
+ case 'ArrowRight':
6850
+ this._onArrowRightPress(event);
6851
+ break;
6852
+ case 'Home':
6853
+ this._onHomePress(event);
6854
+ break;
6855
+ case 'End':
6856
+ this._onEndPress(event);
6857
+ break;
6858
+ case 'PageUp':
6859
+ this._onPageUpPress(event);
6860
+ break;
6861
+ case 'PageDown':
6862
+ this._onPageDownPress(event);
6863
+ break;
6864
+ default:
6865
+ return;
6866
+ }
6812
6867
  }
6813
- highlightSameDayNextMonth() {
6814
- const month = this.activeMonth();
6815
- const year = this.activeYear();
6816
- const newMonth = month + 1;
6817
- const newYear = year + Math.floor(newMonth / 12);
6818
- this.setHighlightedDay(this.highlightedDay(), newMonth % 12, newYear);
6868
+ //select currently selected entry
6869
+ _onEnterPress(event) {
6870
+ event.preventDefault();
6871
+ this.triggerSelectDay.emit(this.highlightedDay());
6819
6872
  }
6820
- highlightSameDayPreviousMonth() {
6821
- const month = this.activeMonth();
6822
- const year = this.activeYear();
6823
- const newMonth = month - 1;
6824
- const newYear = year + Math.floor(newMonth / 12);
6825
- this.setHighlightedDay(this.highlightedDay(), newMonth % 12, newYear);
6873
+ //highlight the entry one line below
6874
+ _onArrowDownPress(event) {
6875
+ event.preventDefault();
6876
+ this.triggerHighlightNextDay.emit(7);
6826
6877
  }
6827
- highlightSameDayNextYear() {
6828
- this.setHighlightedDay(this.highlightedDay(), this.activeMonth(), this.activeYear() + 1);
6878
+ //highlight the entry one line above
6879
+ _onArrowUpPress(event) {
6880
+ event.preventDefault();
6881
+ this.triggerHighlightPreviousDay.emit(7);
6829
6882
  }
6830
- highlightSameDayPreviousYear() {
6831
- this.setHighlightedDay(this.highlightedDay(), this.activeMonth(), this.activeYear() - 1);
6883
+ //highlight next entry
6884
+ _onArrowRightPress(event) {
6885
+ event.preventDefault();
6886
+ this.triggerHighlightNextDay.emit(1);
6832
6887
  }
6833
- //! selecting months
6834
- isMonthSelected(month) {
6835
- if (month instanceof Date)
6836
- month = month.getMonth();
6837
- return (this.selectionStart() !== null &&
6838
- this.activeYear() === this.selectionStart()?.getFullYear() &&
6839
- month === this.selectionStart()?.getMonth());
6888
+ //highlight previous entry
6889
+ _onArrowLeftPress(event) {
6890
+ event.preventDefault();
6891
+ this.triggerHighlightPreviousDay.emit(1);
6840
6892
  }
6841
- isMonthOutOfRange(month, year = this.activeYear()) {
6842
- return isMonthOutOfRange(month, year, this.min(), this.max());
6893
+ //highlight first entry on the page
6894
+ _onHomePress(event) {
6895
+ event.preventDefault();
6896
+ this.triggerHighlightFirstDay.emit();
6843
6897
  }
6844
- changeMonth(newMonth) {
6845
- if (isNull(newMonth)) {
6846
- this.activeMonth.set(this.TODAY().getMonth());
6847
- this._emitActivePageChange();
6848
- return true;
6849
- }
6850
- if (this.isMonthOutOfRange(newMonth))
6851
- return false;
6852
- if (newMonth > 11) {
6853
- this.activeYear.update(v => v + 1);
6854
- this.activeMonth.set(0);
6855
- }
6856
- else if (newMonth < 0) {
6857
- this.activeYear.update(v => v - 1);
6858
- this.activeMonth.set(11);
6859
- }
6860
- else {
6861
- this.activeMonth.set(newMonth);
6862
- }
6863
- this._emitActivePageChange();
6864
- return true;
6898
+ //highlight last entry on the page
6899
+ _onEndPress(event) {
6900
+ event.preventDefault();
6901
+ this.triggerHighlightLastDay.emit();
6865
6902
  }
6866
- selectMonth(newMonth) {
6867
- if (isNull(newMonth) || this.isMonthOutOfRange(newMonth))
6868
- return;
6869
- const wasSuccessful = this.changeMonth(newMonth);
6870
- if (!wasSuccessful)
6871
- return;
6872
- this.activeView.set(ArdCalendarView.Days);
6873
- this.monthSelect.emit(newMonth);
6903
+ //alone: highlight same entry on the next page
6904
+ //with alt: highlight same entry multiple pages after (12 pages)
6905
+ _onPageDownPress(event) {
6906
+ event.preventDefault();
6907
+ this.triggerHighlightSameDayNextPage.emit(event.altKey);
6874
6908
  }
6875
- selectCurrentlyHighlightedMonth() {
6876
- if (!isDefined(this.highlightedMonth()))
6909
+ //alone: highlight same entry on the previous page
6910
+ //with alt: highlight same entry multiple pages before (12 pages)
6911
+ _onPageUpPress(event) {
6912
+ event.preventDefault();
6913
+ this.triggerHighlightSameDayPreviousPage.emit(event.altKey);
6914
+ }
6915
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DaysViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
6916
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: DaysViewComponent, isStandalone: false, selector: "ard-days-view", inputs: { tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: true, transformFunction: null }, _isUsingKeyboard: { classPropertyName: "_isUsingKeyboard", publicName: "_isUsingKeyboard", isSignal: true, isRequired: true, transformFunction: null }, activeYear: { classPropertyName: "activeYear", publicName: "activeYear", isSignal: true, isRequired: true, transformFunction: null }, activeMonth: { classPropertyName: "activeMonth", publicName: "activeMonth", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null }, selectedDateEnd: { classPropertyName: "selectedDateEnd", publicName: "selectedDateEnd", isSignal: true, isRequired: true, transformFunction: null }, rangeSelectionMode: { classPropertyName: "rangeSelectionMode", publicName: "rangeSelectionMode", isSignal: true, isRequired: true, transformFunction: null }, UTC: { classPropertyName: "UTC", publicName: "UTC", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, multiCalendarLocation: { classPropertyName: "multiCalendarLocation", publicName: "multiCalendarLocation", isSignal: true, isRequired: true, transformFunction: null }, isDayFilteredOut: { classPropertyName: "isDayFilteredOut", publicName: "isDayFilteredOut", isSignal: true, isRequired: true, transformFunction: null }, highlightedDay: { classPropertyName: "highlightedDay", publicName: "highlightedDay", isSignal: true, isRequired: true, transformFunction: null }, firstWeekday: { classPropertyName: "firstWeekday", publicName: "firstWeekday", isSignal: true, isRequired: true, transformFunction: null }, staticHeight: { classPropertyName: "staticHeight", publicName: "staticHeight", isSignal: true, isRequired: true, transformFunction: null }, hideFloatingMonth: { classPropertyName: "hideFloatingMonth", publicName: "hideFloatingMonth", isSignal: true, isRequired: true, transformFunction: null }, daysViewHeaderTemplate: { classPropertyName: "daysViewHeaderTemplate", publicName: "daysViewHeaderTemplate", isSignal: true, isRequired: true, transformFunction: null }, floatingMonthTemplate: { classPropertyName: "floatingMonthTemplate", publicName: "floatingMonthTemplate", isSignal: true, isRequired: true, transformFunction: null }, weekdayTemplate: { classPropertyName: "weekdayTemplate", publicName: "weekdayTemplate", isSignal: true, isRequired: true, transformFunction: null }, dayTemplate: { classPropertyName: "dayTemplate", publicName: "dayTemplate", isSignal: true, isRequired: true, transformFunction: null }, daysViewHeaderDateFormat: { classPropertyName: "daysViewHeaderDateFormat", publicName: "daysViewHeaderDateFormat", isSignal: true, isRequired: true, transformFunction: null }, weekdayDateFormat: { classPropertyName: "weekdayDateFormat", publicName: "weekdayDateFormat", isSignal: true, isRequired: true, transformFunction: null }, weekdayTitleDateFormat: { classPropertyName: "weekdayTitleDateFormat", publicName: "weekdayTitleDateFormat", isSignal: true, isRequired: true, transformFunction: null }, floatingMonthDateFormat: { classPropertyName: "floatingMonthDateFormat", publicName: "floatingMonthDateFormat", isSignal: true, isRequired: true, transformFunction: null }, floatingMonthTitleDateFormat: { classPropertyName: "floatingMonthTitleDateFormat", publicName: "floatingMonthTitleDateFormat", isSignal: true, isRequired: true, transformFunction: null }, dayDateFormat: { classPropertyName: "dayDateFormat", publicName: "dayDateFormat", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { triggerOpenYearsView: "triggerOpenYearsView", triggerOpenMonthsView: "triggerOpenMonthsView", triggerSelectDay: "triggerSelectDay", triggerChangeMonth: "triggerChangeMonth", triggerChangeYear: "triggerChangeYear", triggerHighlightDay: "triggerHighlightDay", triggerHighlightNextDay: "triggerHighlightNextDay", triggerHighlightPreviousDay: "triggerHighlightPreviousDay", triggerHighlightFirstDay: "triggerHighlightFirstDay", triggerHighlightLastDay: "triggerHighlightLastDay", triggerHighlightSameDayPreviousPage: "triggerHighlightSameDayPreviousPage", triggerHighlightSameDayNextPage: "triggerHighlightSameDayNextPage", focusEvent: "focus", blurEvent: "blur" }, host: { listeners: { "mousemove": "onMouseMove()" } }, viewQueries: [{ propertyName: "focusableElement", first: true, predicate: ["focusableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ard-days-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultDaysViewHeaderTemplate\r\n let-currDate\r\n let-nextMonth=\"nextMonth\"\r\n let-prevMonth=\"prevMonth\"\r\n let-canGoToNextMonth=\"canGoToNextPage\"\r\n let-canGoToPreviousMonth=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openYearsView=\"openYearsView\"\r\n let-onFocus=\"onFocus\"\r\n let-onBlur=\"onBlur\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevMonth()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousMonth\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openYearsView()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n >\r\n {{ currDate | date: this.daysViewHeaderDateFormat() | uppercase }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextMonth()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextMonth\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"daysViewHeaderTemplate() || defaultDaysViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"daysViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div class=\"ard-calendar__weekdays\">\r\n <ng-template\r\n #defaultWeekdayTemplate\r\n let-date\r\n >\r\n <div\r\n class=\"ard-calendar__weekday\"\r\n [title]=\"date | date: weekdayTitleDateFormat() | titlecase\"\r\n >\r\n {{ date | date: weekdayDateFormat() | uppercase }}\r\n </div>\r\n </ng-template>\r\n @for (weekdayIndex of weekdayArray(); track weekdayIndex) {\r\n <ng-template\r\n [ngTemplateOutlet]=\"weekdayTemplate() || defaultWeekdayTemplate\"\r\n [ngTemplateOutletContext]=\"weekdayContext()(weekdayIndex)\"\r\n />\r\n }\r\n </div>\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__days-grid\"\r\n [class.ard-reserve-top-row]=\"reserveTopRow()\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onDayGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onDayGridBlur()\"\r\n (click)=\"onDayGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @if (!hideFloatingMonth()) {\r\n <div class=\"ard-calendar__floating-month\">\r\n <ng-template\r\n #defaultFloatingMonthTemplate\r\n let-date\r\n >\r\n <div [title]=\"date | date: floatingMonthTitleDateFormat() | titlecase\">\r\n {{ date | date: floatingMonthDateFormat() | uppercase }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"floatingMonthTemplate() || defaultFloatingMonthTemplate\"\r\n [ngTemplateOutletContext]=\"floatingMonthContext()\"\r\n />\r\n </div>\r\n }\r\n @for (week of activeCalendarData().array; track $index) {\r\n @for (day of week; track day ? day : activeCalendarData().leadingSpaces - $index) {\r\n @if (day === null) {\r\n <div class=\"ard-calendar__entry ard-calendar__entry-empty\"></div>\r\n } @else {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedDay() === day.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isDayBetweenSelectedHighlighted(day.value)\"\r\n [class.ard-calendar__entry-disabled]=\"day.disabled || isDayFilteredOut()(day.value)\"\r\n [class.ard-calendar__entry-selected]=\"isDaySelected(day.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isDaySelectedStart(day.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isDaySelectedEnd(day.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isDayBetweenSelectedRange(day.value)\"\r\n [class.ard-calendar-today]=\"isDayToday(day.value)\"\r\n (click)=\"onCalendarDayClick(day.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarDayMouseover(day.value)\"\r\n role=\"gridcell\"\r\n >\r\n <div class=\"ard-calendar__entry-button\">\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultDayTemplate\r\n let-date=\"date\"\r\n >\r\n {{ date | date: dayDateFormat() }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"dayTemplate() || defaultDayTemplate\"\r\n [ngTemplateOutletContext]=\"dayContext()(day.value)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-days-view{display:block}}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: ["wrapperClasses", "type", "ariaLabel", "color", "lightColoring", "compact", "pointerEventsWhenDisabled"] }, { kind: "component", type: ArdiumIconComponent, selector: "ard-icon", inputs: ["ariaLabel", "icon", "filled", "weight", "grade", "opticalSize"] }, { kind: "component", type: ArdiumButtonComponent, selector: "ard-button", inputs: ["variant", "vertical"], outputs: ["focus", "blur"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: i1.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6917
+ }
6918
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DaysViewComponent, decorators: [{
6919
+ type: Component,
6920
+ args: [{ standalone: false, selector: 'ard-days-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ard-days-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultDaysViewHeaderTemplate\r\n let-currDate\r\n let-nextMonth=\"nextMonth\"\r\n let-prevMonth=\"prevMonth\"\r\n let-canGoToNextMonth=\"canGoToNextPage\"\r\n let-canGoToPreviousMonth=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openYearsView=\"openYearsView\"\r\n let-onFocus=\"onFocus\"\r\n let-onBlur=\"onBlur\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevMonth()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousMonth\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openYearsView()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n >\r\n {{ currDate | date: this.daysViewHeaderDateFormat() | uppercase }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextMonth()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextMonth\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"daysViewHeaderTemplate() || defaultDaysViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"daysViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div class=\"ard-calendar__weekdays\">\r\n <ng-template\r\n #defaultWeekdayTemplate\r\n let-date\r\n >\r\n <div\r\n class=\"ard-calendar__weekday\"\r\n [title]=\"date | date: weekdayTitleDateFormat() | titlecase\"\r\n >\r\n {{ date | date: weekdayDateFormat() | uppercase }}\r\n </div>\r\n </ng-template>\r\n @for (weekdayIndex of weekdayArray(); track weekdayIndex) {\r\n <ng-template\r\n [ngTemplateOutlet]=\"weekdayTemplate() || defaultWeekdayTemplate\"\r\n [ngTemplateOutletContext]=\"weekdayContext()(weekdayIndex)\"\r\n />\r\n }\r\n </div>\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__days-grid\"\r\n [class.ard-reserve-top-row]=\"reserveTopRow()\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onDayGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onDayGridBlur()\"\r\n (click)=\"onDayGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @if (!hideFloatingMonth()) {\r\n <div class=\"ard-calendar__floating-month\">\r\n <ng-template\r\n #defaultFloatingMonthTemplate\r\n let-date\r\n >\r\n <div [title]=\"date | date: floatingMonthTitleDateFormat() | titlecase\">\r\n {{ date | date: floatingMonthDateFormat() | uppercase }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"floatingMonthTemplate() || defaultFloatingMonthTemplate\"\r\n [ngTemplateOutletContext]=\"floatingMonthContext()\"\r\n />\r\n </div>\r\n }\r\n @for (week of activeCalendarData().array; track $index) {\r\n @for (day of week; track day ? day : activeCalendarData().leadingSpaces - $index) {\r\n @if (day === null) {\r\n <div class=\"ard-calendar__entry ard-calendar__entry-empty\"></div>\r\n } @else {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedDay() === day.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isDayBetweenSelectedHighlighted(day.value)\"\r\n [class.ard-calendar__entry-disabled]=\"day.disabled || isDayFilteredOut()(day.value)\"\r\n [class.ard-calendar__entry-selected]=\"isDaySelected(day.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isDaySelectedStart(day.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isDaySelectedEnd(day.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isDayBetweenSelectedRange(day.value)\"\r\n [class.ard-calendar-today]=\"isDayToday(day.value)\"\r\n (click)=\"onCalendarDayClick(day.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarDayMouseover(day.value)\"\r\n role=\"gridcell\"\r\n >\r\n <div class=\"ard-calendar__entry-button\">\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultDayTemplate\r\n let-date=\"date\"\r\n >\r\n {{ date | date: dayDateFormat() }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"dayTemplate() || defaultDayTemplate\"\r\n [ngTemplateOutletContext]=\"dayContext()(day.value)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-days-view{display:block}}\n"] }]
6921
+ }], propDecorators: { onMouseMove: [{
6922
+ type: HostListener,
6923
+ args: ['mousemove']
6924
+ }] } });
6925
+
6926
+ function getCalendarYearsArray(startYear, yearCount, min, max) {
6927
+ return new Array(yearCount).fill(startYear).map((v, i) => ({ value: v + i, valueDate: new Date(v + i, 1, 1), disabled: !!isYearOutOfRange(v + i, min, max) }));
6928
+ }
6929
+ function isYearOutOfRange(year, min, max) {
6930
+ const dateForMinComparison = new Date(year, 11, 31);
6931
+ if (isDefined(min) && dateForMinComparison < min)
6932
+ return -1;
6933
+ const dateForMaxComparison = new Date(year, 0, 1);
6934
+ if (isDefined(max) && dateForMaxComparison > max)
6935
+ return 1;
6936
+ return 0;
6937
+ }
6938
+
6939
+ const TODAY$1 = new Date();
6940
+ class MonthsViewComponent {
6941
+ constructor() {
6942
+ this.tabIndex = input.required();
6943
+ this.readOnly = input.required();
6944
+ this.disabled = input.required();
6945
+ this.autoFocus = input.required();
6946
+ this._isUsingKeyboard = input.required();
6947
+ this.color = input.required();
6948
+ this.activeYear = input.required();
6949
+ this.activeMonth = input.required();
6950
+ this.selectedDate = input.required();
6951
+ this.selectedDateEnd = input.required();
6952
+ this.rangeSelectionMode = input.required();
6953
+ this.UTC = input.required();
6954
+ this.min = input.required();
6955
+ this.max = input.required();
6956
+ this.multiCalendarLocation = input.required();
6957
+ this.monthsArray = computed(() => getCalendarMonthsArray(this.activeYear(), this.min(), this.max()));
6958
+ this.currentAriaLabel = computed(() => {
6959
+ const month = this.highlightedMonth();
6960
+ if (month === null) {
6961
+ return '';
6962
+ }
6963
+ return new Date(this.activeYear(), month, 1).toLocaleDateString(undefined, {
6964
+ year: 'numeric',
6965
+ month: 'long',
6966
+ });
6967
+ });
6968
+ //! outputs
6969
+ this.triggerOpenYearsView = output();
6970
+ this.triggerOpenDaysView = output();
6971
+ this.focusEvent = output({ alias: 'focus' });
6972
+ this.blurEvent = output({ alias: 'blur' });
6973
+ this.triggerSelectMonth = output();
6974
+ this.triggeChangeYear = output();
6975
+ this.triggerHighlightMonth = output();
6976
+ this.triggerHighlightNextMonth = output();
6977
+ this.triggerHighlightPreviousMonth = output();
6978
+ this.triggerHighlightFirstMonth = output();
6979
+ this.triggerHighlightLastMonth = output();
6980
+ this.triggerHighlightSameMonthPreviousPage = output();
6981
+ this.triggerHighlightSameMonthNextPage = output();
6982
+ //! calendar entry hover & click
6983
+ this.highlightedMonth = input.required();
6984
+ this.highlightedMonthDate = computed(() => {
6985
+ const month = this.highlightedMonth();
6986
+ if (isNull(month))
6987
+ return null;
6988
+ return new Date(this.activeYear(), month, 2);
6989
+ });
6990
+ //! focusing
6991
+ this.focusableElement = viewChild.required('focusableElement');
6992
+ //! templates
6993
+ this.monthsViewHeaderTemplate = input.required();
6994
+ this.monthTemplate = input.required();
6995
+ //! template customizations
6996
+ this.monthsViewHeaderDateFormat = input.required(); // 'YYYY'
6997
+ this.monthDateFormat = input.required(); // 'MMM'
6998
+ //! template contexts
6999
+ this.monthsViewHeaderContext = computed(() => ({
7000
+ nextPage: () => {
7001
+ this.triggeChangeYear.emit(this.activeYear() + 1);
7002
+ },
7003
+ prevPage: () => {
7004
+ this.triggeChangeYear.emit(this.activeYear() - 1);
7005
+ },
7006
+ openYearsView: () => {
7007
+ this.triggerOpenYearsView.emit();
7008
+ },
7009
+ openDaysView: () => {
7010
+ this.triggerOpenDaysView.emit();
7011
+ },
7012
+ onFocus: (event) => {
7013
+ this.focusEvent.emit(event);
7014
+ },
7015
+ onBlur: (event) => {
7016
+ this.blurEvent.emit(event);
7017
+ },
7018
+ canGoToNextPage: !this.isYearOutOfRange(this.activeYear() + 1),
7019
+ canGoToPreviousPage: !this.isYearOutOfRange(this.activeYear() - 1),
7020
+ hideNextPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Left ||
7021
+ this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
7022
+ hidePreviousPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Right ||
7023
+ this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
7024
+ year: this.activeYear(),
7025
+ date: getUTCDate(this.activeYear(), 0, 2), // second day of month to prevent timezone issues
7026
+ $implicit: this.activeYear(),
7027
+ }));
7028
+ this.monthContext = computed(() => (month) => {
7029
+ const date = getUTCDate(this.activeYear(), month, 2); // second day of month to prevent timezone issues
7030
+ return {
7031
+ month,
7032
+ date,
7033
+ $implicit: date,
7034
+ select: (month) => {
7035
+ if (month instanceof Date)
7036
+ month = month.getMonth();
7037
+ this.triggerSelectMonth.emit(month);
7038
+ },
7039
+ };
7040
+ });
7041
+ }
7042
+ onMouseMove() {
7043
+ if (this._isUsingKeyboard())
6877
7044
  return;
6878
- this.selectMonth(this.highlightedMonth());
7045
+ if (this.highlightedMonth())
7046
+ this.triggerHighlightMonth.emit(null);
6879
7047
  }
6880
- setHighlightedMonth(month, year = this.activeYear()) {
6881
- if (isNull(month)) {
6882
- this._highlightedMonth.update(() => month);
7048
+ ngAfterViewInit() {
7049
+ if (!this.autoFocus())
6883
7050
  return;
6884
- }
6885
- const date = createDate(year, month, 15, this.UTC());
6886
- const outOfRange = this.isMonthOutOfRange(month, year);
6887
- if (outOfRange === -1) {
6888
- this._highlightMinMonth();
7051
+ this.focus();
7052
+ this.triggerHighlightMonth.emit(0);
7053
+ }
7054
+ onCalendarMonthMouseover(month) {
7055
+ if (this._isUsingKeyboard())
6889
7056
  return;
6890
- }
6891
- if (outOfRange === 1) {
6892
- this._highlightMaxMonth();
7057
+ if (this.disabled() || this.readOnly())
6893
7058
  return;
6894
- }
6895
- this._highlightedMonth.update(() => date.getMonth());
6896
- if (date.getFullYear() !== this.activeYear()) {
6897
- this.activeYear.set(date.getFullYear());
6898
- this._emitActivePageChange();
6899
- }
7059
+ this.triggerHighlightMonth.emit(month);
6900
7060
  }
6901
- _highlightMinMonth() {
6902
- const min = this.min();
6903
- if (!isDefined(min))
7061
+ onCalendarMonthClick(month) {
7062
+ if (this.disabled() || this.readOnly())
6904
7063
  return;
6905
- this.activeYear.set(min.getFullYear());
6906
- this._emitActivePageChange();
6907
- this._highlightedMonth.set(min.getMonth());
7064
+ this.triggerSelectMonth.emit(month);
6908
7065
  }
6909
- _highlightMaxMonth() {
6910
- const max = this.max();
6911
- if (!isDefined(max))
7066
+ onMonthGridFocus() {
7067
+ if (this.disabled() || this.readOnly())
6912
7068
  return;
6913
- this.activeYear.set(max.getFullYear());
6914
- this._emitActivePageChange();
6915
- this._highlightedMonth.set(max.getMonth());
6916
- }
6917
- highlightNextMonth(offset = 1) {
6918
- const currentMonth = this.highlightedMonth();
6919
- const newMonth = isDefined(currentMonth) ? currentMonth + offset : 0;
6920
- this.setHighlightedMonth(newMonth);
6921
- }
6922
- highlightPreviousMonth(offset = 1) {
6923
- this.highlightNextMonth(offset * -1);
7069
+ this.triggerHighlightMonth.emit(0);
6924
7070
  }
6925
- highlightFirstMonth() {
6926
- this.setHighlightedMonth(0);
7071
+ onMonthGridBlur() {
7072
+ if (this.disabled() || this.readOnly())
7073
+ return;
7074
+ this.triggerHighlightMonth.emit(null);
6927
7075
  }
6928
- highlightLastMonth() {
6929
- this.setHighlightedMonth(11);
7076
+ onMonthGridClick() {
7077
+ if (this.disabled() || this.readOnly())
7078
+ return;
7079
+ if (this.highlightedMonth() !== null)
7080
+ return;
7081
+ this.triggerHighlightMonth.emit(0);
6930
7082
  }
6931
- highlightSameMonthNextYear(multiple) {
6932
- this.setHighlightedMonth(this.highlightedMonth(), this.activeYear() + (multiple ? 10 : 1));
7083
+ focus() {
7084
+ this.focusableElement().nativeElement.focus();
6933
7085
  }
6934
- highlightSameMonthPreviousYear(multiple) {
6935
- this.setHighlightedMonth(this.highlightedMonth(), this.activeYear() - (multiple ? 10 : 1));
7086
+ //! keyboard controls
7087
+ onMainGridKeydown(event) {
7088
+ if (this.disabled() || this.readOnly())
7089
+ return;
7090
+ switch (event.code) {
7091
+ case 'Space':
7092
+ case 'Enter':
7093
+ this._onEnterPress(event);
7094
+ break;
7095
+ case 'ArrowUp':
7096
+ this._onArrowUpPress(event);
7097
+ break;
7098
+ case 'ArrowDown':
7099
+ this._onArrowDownPress(event);
7100
+ break;
7101
+ case 'ArrowLeft':
7102
+ this._onArrowLeftPress(event);
7103
+ break;
7104
+ case 'ArrowRight':
7105
+ this._onArrowRightPress(event);
7106
+ break;
7107
+ case 'Home':
7108
+ this._onHomePress(event);
7109
+ break;
7110
+ case 'End':
7111
+ this._onEndPress(event);
7112
+ break;
7113
+ case 'PageUp':
7114
+ this._onPageUpPress(event);
7115
+ break;
7116
+ case 'PageDown':
7117
+ this._onPageDownPress(event);
7118
+ break;
7119
+ default:
7120
+ return;
7121
+ }
6936
7122
  }
6937
- //! selecting years
6938
- isYearSelected(year) {
6939
- if (year instanceof Date)
6940
- year = year.getFullYear();
6941
- return this.selectionStart() !== null && year === this.selectionStart()?.getFullYear();
7123
+ //select currently selected entry
7124
+ _onEnterPress(event) {
7125
+ event.preventDefault();
7126
+ const month = this.highlightedMonth();
7127
+ if (isNull(month))
7128
+ return;
7129
+ this.triggerSelectMonth.emit(month);
6942
7130
  }
6943
- isYearOutOfRange(year) {
6944
- return isYearOutOfRange(year, this.min(), this.max());
7131
+ //highlight the entry one line below
7132
+ _onArrowDownPress(event) {
7133
+ event.preventDefault();
7134
+ this.triggerHighlightNextMonth.emit(4); //4 months per line
6945
7135
  }
6946
- changeYear(year) {
6947
- if (isNull(year)) {
6948
- this.activeYear.set(this.TODAY().getFullYear());
6949
- this._emitActivePageChange();
6950
- return true;
6951
- }
6952
- if (this.isYearOutOfRange(year))
6953
- return false;
6954
- this.activeYear.set(year);
6955
- this._emitActivePageChange();
6956
- return true;
7136
+ //highlight the entry one line above
7137
+ _onArrowUpPress(event) {
7138
+ event.preventDefault();
7139
+ this.triggerHighlightPreviousMonth.emit(4); //4 months per line
6957
7140
  }
6958
- selectYear(year) {
6959
- if (isNull(year))
6960
- return;
6961
- if (year instanceof Date)
6962
- year = year.getFullYear();
6963
- const wasSuccessful = this.changeYear(year);
6964
- if (!wasSuccessful)
6965
- return;
6966
- this.activeView.set(ArdCalendarView.Months);
6967
- this.yearSelect.emit(year);
7141
+ //highlight next entry
7142
+ _onArrowRightPress(event) {
7143
+ event.preventDefault();
7144
+ this.triggerHighlightNextMonth.emit(1);
6968
7145
  }
6969
- selectCurrentlyHighlightedYear() {
6970
- if (!isDefined(this.highlightedYear()))
6971
- return;
6972
- this.selectYear(this.highlightedYear());
7146
+ //highlight previous entry
7147
+ _onArrowLeftPress(event) {
7148
+ event.preventDefault();
7149
+ this.triggerHighlightPreviousMonth.emit(1);
6973
7150
  }
6974
- setHighlightedYear(year) {
6975
- if (isNull(year)) {
6976
- this.__highlightedYear.update(() => year);
6977
- return;
6978
- }
6979
- const date = createDate(year, 0, 1, this.UTC());
6980
- const outOfRange = this.isYearOutOfRange(year);
6981
- if (outOfRange === -1) {
6982
- this._highlightMinYear();
6983
- return;
6984
- }
6985
- if (outOfRange === 1) {
6986
- this._highlightMaxYear();
6987
- return;
6988
- }
6989
- const newYear = date.getFullYear();
6990
- this.__highlightedYear.update(() => newYear);
6991
- if (newYear < this.currentYearRangeStart() || newYear >= this.currentYearRangeStart() + this.multipleYearPageSize()) {
6992
- // round the offset away from zero: 0.1 -> 1, -0.1 -> -1
6993
- // this is to ensure the range start is always shifted by n years
6994
- const offset = roundFromZero((newYear - this.currentYearRangeStart()) / this.multipleYearPageSize());
6995
- this.currentYearRangeStart.update(v => v + offset * this.multipleYearPageSize());
6996
- }
7151
+ //highlight first entry on the page
7152
+ _onHomePress(event) {
7153
+ event.preventDefault();
7154
+ this.triggerHighlightFirstMonth.emit();
6997
7155
  }
6998
- changeYearsViewPage(offset) {
6999
- const newYearRangeStart = this.currentYearRangeStart() + offset * this.multipleYearPageSize();
7000
- this.currentYearRangeStart.set(newYearRangeStart);
7156
+ //highlight last entry on the page
7157
+ _onEndPress(event) {
7158
+ event.preventDefault();
7159
+ this.triggerHighlightLastMonth.emit();
7001
7160
  }
7002
- _highlightMinYear() {
7003
- const min = this.min();
7004
- if (!isDefined(min))
7005
- return;
7006
- this.__highlightedYear.set(min.getFullYear());
7161
+ //alone: highlight same entry on the next page
7162
+ //with alt: highlight same entry multiple pages after (10 pages)
7163
+ _onPageDownPress(event) {
7164
+ event.preventDefault();
7165
+ this.triggerHighlightSameMonthNextPage.emit(event.altKey);
7007
7166
  }
7008
- _highlightMaxYear() {
7009
- const max = this.max();
7010
- if (!isDefined(max))
7011
- return;
7012
- this.__highlightedYear.set(max.getFullYear());
7167
+ //alone: highlight same entry on the previous page
7168
+ //with alt: highlight same entry multiple pages before (10 pages)
7169
+ _onPageUpPress(event) {
7170
+ event.preventDefault();
7171
+ this.triggerHighlightSameMonthPreviousPage.emit(event.altKey);
7013
7172
  }
7014
- highlightNextYear(offset = 1) {
7015
- const currentYear = this.highlightedYear();
7016
- const newYear = isDefined(currentYear) ? currentYear + offset : null;
7017
- this.setHighlightedYear(newYear);
7173
+ //! helpers
7174
+ isMonthToday(month) {
7175
+ return this.activeYear() === TODAY$1.getFullYear() && month === TODAY$1.getMonth();
7018
7176
  }
7019
- highlightPreviousYear(offset = 1) {
7020
- this.highlightNextYear(offset * -1);
7177
+ isMonthSelected(month) {
7178
+ if (month instanceof Date)
7179
+ month = month.getMonth();
7180
+ const isStartDateSelected = this.isMonthSelectedStart(month);
7181
+ if (this.rangeSelectionMode()) {
7182
+ const isEndDateSelected = this.isMonthSelectedEnd(month);
7183
+ return isStartDateSelected || isEndDateSelected;
7184
+ }
7185
+ return isStartDateSelected;
7021
7186
  }
7022
- highlightFirstYear() {
7023
- this.setHighlightedYear(this.currentYearRangeStart());
7187
+ isMonthSelectedStart(month) {
7188
+ if (month instanceof Date)
7189
+ month = month.getMonth();
7190
+ const selected = this.selectedDate();
7191
+ const { year, month: selectedMonth } = getDateComponents(selected, this.UTC());
7192
+ const isStartDateSelected = selected !== null && this.activeYear() === year && month === selectedMonth;
7193
+ return isStartDateSelected;
7024
7194
  }
7025
- highlightLastYear() {
7026
- this.setHighlightedYear(this.currentYearRangeStart() + this.multipleYearPageSize() - 1);
7195
+ isMonthSelectedEnd(month) {
7196
+ if (month instanceof Date)
7197
+ month = month.getMonth();
7198
+ const selected = this.selectedDateEnd();
7199
+ const { year, month: selectedMonth } = getDateComponents(selected, this.UTC());
7200
+ const isEndDateSelected = selected !== null && this.activeYear() === year && month === selectedMonth;
7201
+ return isEndDateSelected;
7027
7202
  }
7028
- highlightSameYearNextPage(multiple) {
7029
- const year = this.highlightedYear() ?? this.currentYearRangeStart();
7030
- this.setHighlightedYear(year + (multiple ? this.multipleYearPageChangeModifier() : 1) * this.multipleYearPageSize());
7203
+ isMonthBetweenSelectedRange(month) {
7204
+ if (!this.rangeSelectionMode())
7205
+ return false;
7206
+ if (month instanceof Date)
7207
+ month = month.getMonth();
7208
+ const selected = this.selectedDate();
7209
+ const selectedEnd = this.selectedDateEnd();
7210
+ if (selected === null || selectedEnd === null || selected >= selectedEnd)
7211
+ return false;
7212
+ return this._isMonthBetweenDates(month, selected, selectedEnd);
7031
7213
  }
7032
- highlightSameYearPreviousPage(multiple) {
7033
- const year = this.highlightedYear() ?? this.currentYearRangeStart();
7034
- this.setHighlightedYear(year - (multiple ? this.multipleYearPageChangeModifier() : 1) * this.multipleYearPageSize());
7214
+ isMonthBetweenSelectedHighlighted(month) {
7215
+ if (!this.rangeSelectionMode() || this.selectedDateEnd())
7216
+ return false;
7217
+ if (month instanceof Date)
7218
+ month = month.getMonth();
7219
+ const selected = this.selectedDate();
7220
+ const highlightedEnd = this.highlightedMonthDate();
7221
+ if (selected === null || highlightedEnd === null || selected >= highlightedEnd)
7222
+ return false;
7223
+ return this._isMonthBetweenDates(month, selected, highlightedEnd);
7035
7224
  }
7036
- onDocumentMousemove() {
7037
- this._isUsingKeyboard.set(false);
7225
+ _isMonthBetweenDates(month, startDate, endDate) {
7226
+ const { year: startYear, month: startMonth } = getDateComponents(startDate, this.UTC());
7227
+ const { year: endYear, month: endMonth } = getDateComponents(endDate, this.UTC());
7228
+ return startYear <= this.activeYear() && startMonth <= month && endYear >= this.activeYear() && endMonth >= month;
7038
7229
  }
7039
- onDocumentKeydown() {
7040
- this._isUsingKeyboard.set(true);
7230
+ isYearOutOfRange(year) {
7231
+ return isYearOutOfRange(year, this.min(), this.max());
7041
7232
  }
7042
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: _AbstractCalendar, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
7043
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.15", type: _AbstractCalendar, isStandalone: true, inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, activeView: { classPropertyName: "activeView", publicName: "activeView", isSignal: true, isRequired: false, transformFunction: null }, activeYear: { classPropertyName: "activeYear", publicName: "activeYear", isSignal: true, isRequired: false, transformFunction: null }, activeMonth: { classPropertyName: "activeMonth", publicName: "activeMonth", isSignal: true, isRequired: false, transformFunction: null }, firstWeekday: { classPropertyName: "firstWeekday", publicName: "firstWeekday", isSignal: true, isRequired: false, transformFunction: null }, multipleYearPageChangeModifier: { classPropertyName: "multipleYearPageChangeModifier", publicName: "multipleYearPageChangeModifier", isSignal: true, isRequired: false, transformFunction: null }, multipleYearOffset: { classPropertyName: "multipleYearOffset", publicName: "multipleYearOffset", isSignal: true, isRequired: false, transformFunction: null }, multipleYearPageSize: { classPropertyName: "multipleYearPageSize", publicName: "multipleYearPageSize", isSignal: true, isRequired: false, transformFunction: null }, multiCalendarLocation: { classPropertyName: "multiCalendarLocation", publicName: "multiCalendarLocation", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, staticHeight: { classPropertyName: "staticHeight", publicName: "staticHeight", isSignal: true, isRequired: false, transformFunction: null }, hideFloatingMonth: { classPropertyName: "hideFloatingMonth", publicName: "hideFloatingMonth", 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 }, UTC: { classPropertyName: "UTC", publicName: "UTC", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, highlightedDay: { classPropertyName: "highlightedDay", publicName: "highlightedDay", isSignal: true, isRequired: false, transformFunction: null }, daysViewHeaderDateFormat: { classPropertyName: "daysViewHeaderDateFormat", publicName: "daysViewHeaderDateFormat", isSignal: true, isRequired: false, transformFunction: null }, yearsViewHeaderDateFormat: { classPropertyName: "yearsViewHeaderDateFormat", publicName: "yearsViewHeaderDateFormat", isSignal: true, isRequired: false, transformFunction: null }, monthsViewHeaderDateFormat: { classPropertyName: "monthsViewHeaderDateFormat", publicName: "monthsViewHeaderDateFormat", isSignal: true, isRequired: false, transformFunction: null }, weekdayDateFormat: { classPropertyName: "weekdayDateFormat", publicName: "weekdayDateFormat", isSignal: true, isRequired: false, transformFunction: null }, weekdayTitleDateFormat: { classPropertyName: "weekdayTitleDateFormat", publicName: "weekdayTitleDateFormat", isSignal: true, isRequired: false, transformFunction: null }, floatingMonthDateFormat: { classPropertyName: "floatingMonthDateFormat", publicName: "floatingMonthDateFormat", isSignal: true, isRequired: false, transformFunction: null }, floatingMonthTitleDateFormat: { classPropertyName: "floatingMonthTitleDateFormat", publicName: "floatingMonthTitleDateFormat", isSignal: true, isRequired: false, transformFunction: null }, yearDateFormat: { classPropertyName: "yearDateFormat", publicName: "yearDateFormat", isSignal: true, isRequired: false, transformFunction: null }, monthDateFormat: { classPropertyName: "monthDateFormat", publicName: "monthDateFormat", isSignal: true, isRequired: false, transformFunction: null }, dayDateFormat: { classPropertyName: "dayDateFormat", publicName: "dayDateFormat", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeView: "activeViewChange", activeYear: "activeYearChange", activeMonth: "activeMonthChange", activePageChange: "activePageChange", yearSelect: "yearSelect", monthSelect: "monthSelect", highlightedDay: "highlightedDayChange", highlightDayEvent: "highlightDay" }, host: { listeners: { "document:mousemove": "onDocumentMousemove()", "document:keydown": "onDocumentKeydown()" } }, queries: [{ propertyName: "templateRepository", first: true, predicate: _CalendarTemplateRepositoryDirective, descendants: true, isSignal: true }, { propertyName: "yearsViewHeaderTemplate", first: true, predicate: ArdCalendarYearsViewHeaderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "monthsViewHeaderTemplate", first: true, predicate: ArdCalendarMonthsViewHeaderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "daysViewHeaderTemplate", first: true, predicate: ArdCalendarDaysViewHeaderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "floatingMonthTemplate", first: true, predicate: ArdCalendarFloatingMonthTemplateDirective, descendants: true, isSignal: true }, { propertyName: "yearTemplate", first: true, predicate: ArdCalendarYearTemplateDirective, descendants: true, isSignal: true }, { propertyName: "monthTemplate", first: true, predicate: ArdCalendarMonthTemplateDirective, descendants: true, isSignal: true }, { propertyName: "dayTemplate", first: true, predicate: ArdCalendarDayTemplateDirective, descendants: true, isSignal: true }, { propertyName: "weekdayTemplate", first: true, predicate: ArdCalendarWeekdayTemplateDirective, descendants: true, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
7233
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MonthsViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7234
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: MonthsViewComponent, isStandalone: false, selector: "ard-months-view", inputs: { tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: true, transformFunction: null }, _isUsingKeyboard: { classPropertyName: "_isUsingKeyboard", publicName: "_isUsingKeyboard", isSignal: true, isRequired: true, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: true, transformFunction: null }, activeYear: { classPropertyName: "activeYear", publicName: "activeYear", isSignal: true, isRequired: true, transformFunction: null }, activeMonth: { classPropertyName: "activeMonth", publicName: "activeMonth", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null }, selectedDateEnd: { classPropertyName: "selectedDateEnd", publicName: "selectedDateEnd", isSignal: true, isRequired: true, transformFunction: null }, rangeSelectionMode: { classPropertyName: "rangeSelectionMode", publicName: "rangeSelectionMode", isSignal: true, isRequired: true, transformFunction: null }, UTC: { classPropertyName: "UTC", publicName: "UTC", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, multiCalendarLocation: { classPropertyName: "multiCalendarLocation", publicName: "multiCalendarLocation", isSignal: true, isRequired: true, transformFunction: null }, highlightedMonth: { classPropertyName: "highlightedMonth", publicName: "highlightedMonth", isSignal: true, isRequired: true, transformFunction: null }, monthsViewHeaderTemplate: { classPropertyName: "monthsViewHeaderTemplate", publicName: "monthsViewHeaderTemplate", isSignal: true, isRequired: true, transformFunction: null }, monthTemplate: { classPropertyName: "monthTemplate", publicName: "monthTemplate", isSignal: true, isRequired: true, transformFunction: null }, monthsViewHeaderDateFormat: { classPropertyName: "monthsViewHeaderDateFormat", publicName: "monthsViewHeaderDateFormat", isSignal: true, isRequired: true, transformFunction: null }, monthDateFormat: { classPropertyName: "monthDateFormat", publicName: "monthDateFormat", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { triggerOpenYearsView: "triggerOpenYearsView", triggerOpenDaysView: "triggerOpenDaysView", focusEvent: "focus", blurEvent: "blur", triggerSelectMonth: "triggerSelectMonth", triggeChangeYear: "triggeChangeYear", triggerHighlightMonth: "triggerHighlightMonth", triggerHighlightNextMonth: "triggerHighlightNextMonth", triggerHighlightPreviousMonth: "triggerHighlightPreviousMonth", triggerHighlightFirstMonth: "triggerHighlightFirstMonth", triggerHighlightLastMonth: "triggerHighlightLastMonth", triggerHighlightSameMonthPreviousPage: "triggerHighlightSameMonthPreviousPage", triggerHighlightSameMonthNextPage: "triggerHighlightSameMonthNextPage" }, host: { listeners: { "mousemove": "onMouseMove()" } }, viewQueries: [{ propertyName: "focusableElement", first: true, predicate: ["focusableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ard-months-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultMonthsViewHeaderTemplate\r\n let-date=\"date\"\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openDaysView=\"openDaysView\"\r\n let-onFocus=\"onFocus\"\r\n let-onBlur=\"onBlur\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [color]=\"color()\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n >\r\n {{ date | date: monthsViewHeaderDateFormat() }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthsViewHeaderTemplate() || defaultMonthsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"monthsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onMonthGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onMonthGridBlur()\"\r\n (click)=\"onMonthGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (month of monthsArray(); track $index) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedMonth() === month.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isMonthBetweenSelectedHighlighted(month.value)\"\r\n [class.ard-calendar__entry-disabled]=\"month.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isMonthSelected(month.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isMonthSelectedStart(month.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isMonthSelectedEnd(month.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isMonthBetweenSelectedRange(month.value)\"\r\n [class.ard-calendar-today]=\"isMonthToday(month.value)\"\r\n (click)=\"onCalendarMonthClick(month.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarMonthMouseover(month.value)\"\r\n role=\"gridcell\"\r\n >\r\n <div class=\"ard-calendar__entry-button\">\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultMonthTemplate\r\n let-month\r\n >\r\n {{ month | date: monthDateFormat() : '+0000' | uppercase }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthTemplate() || defaultMonthTemplate\"\r\n [ngTemplateOutletContext]=\"monthContext()(month.value)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-months-view{display:block}}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: ["wrapperClasses", "type", "ariaLabel", "color", "lightColoring", "compact", "pointerEventsWhenDisabled"] }, { kind: "component", type: ArdiumIconComponent, selector: "ard-icon", inputs: ["ariaLabel", "icon", "filled", "weight", "grade", "opticalSize"] }, { kind: "component", type: ArdiumButtonComponent, selector: "ard-button", inputs: ["variant", "vertical"], outputs: ["focus", "blur"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i1.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7044
7235
  }
7045
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: _AbstractCalendar, decorators: [{
7046
- type: Directive,
7047
- args: [{}]
7048
- }], ctorParameters: () => [{ type: undefined }], propDecorators: { onDocumentMousemove: [{
7049
- type: HostListener,
7050
- args: ['document:mousemove']
7051
- }], onDocumentKeydown: [{
7236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MonthsViewComponent, decorators: [{
7237
+ type: Component,
7238
+ args: [{ standalone: false, selector: 'ard-months-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ard-months-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultMonthsViewHeaderTemplate\r\n let-date=\"date\"\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openDaysView=\"openDaysView\"\r\n let-onFocus=\"onFocus\"\r\n let-onBlur=\"onBlur\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [color]=\"color()\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n >\r\n {{ date | date: monthsViewHeaderDateFormat() }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthsViewHeaderTemplate() || defaultMonthsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"monthsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onMonthGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onMonthGridBlur()\"\r\n (click)=\"onMonthGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (month of monthsArray(); track $index) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedMonth() === month.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isMonthBetweenSelectedHighlighted(month.value)\"\r\n [class.ard-calendar__entry-disabled]=\"month.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isMonthSelected(month.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isMonthSelectedStart(month.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isMonthSelectedEnd(month.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isMonthBetweenSelectedRange(month.value)\"\r\n [class.ard-calendar-today]=\"isMonthToday(month.value)\"\r\n (click)=\"onCalendarMonthClick(month.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarMonthMouseover(month.value)\"\r\n role=\"gridcell\"\r\n >\r\n <div class=\"ard-calendar__entry-button\">\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultMonthTemplate\r\n let-month\r\n >\r\n {{ month | date: monthDateFormat() : '+0000' | uppercase }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthTemplate() || defaultMonthTemplate\"\r\n [ngTemplateOutletContext]=\"monthContext()(month.value)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-months-view{display:block}}\n"] }]
7239
+ }], propDecorators: { onMouseMove: [{
7052
7240
  type: HostListener,
7053
- args: ['document:keydown']
7241
+ args: ['mousemove']
7054
7242
  }] } });
7055
7243
 
7056
- const _calendarDefaults = {
7057
- ..._formFieldComponentDefaults,
7058
- color: ComponentColor.Primary,
7059
- activeView: ArdCalendarView.Days,
7060
- activeYear: new Date().getFullYear(),
7061
- activeMonth: new Date().getMonth(),
7062
- firstWeekday: 1,
7063
- multipleYearPageChangeModifier: 5,
7064
- multipleYearOffset: 2,
7065
- multipleYearPageSize: 24,
7066
- staticHeight: false,
7067
- hideFloatingMonth: false,
7068
- autoFocus: false,
7069
- multiCalendarLocation: ArdMultiCalendarLocation.Only,
7070
- min: null,
7071
- max: null,
7072
- filter: null,
7073
- UTC: false,
7074
- // template customizations
7075
- daysViewHeaderDateFormat: 'MMM yyyy',
7076
- yearsViewHeaderDateFormat: 'yyyy',
7077
- monthsViewHeaderDateFormat: 'yyyy',
7078
- weekdayDateFormat: 'EEEEE',
7079
- weekdayTitleDateFormat: 'EEEE',
7080
- floatingMonthDateFormat: 'LLL',
7081
- floatingMonthTitleDateFormat: 'LLLL',
7082
- yearDateFormat: 'yyyy',
7083
- monthDateFormat: 'MMM',
7084
- dayDateFormat: 'd',
7085
- };
7086
- const ARD_CALENDAR_DEFAULTS = new InjectionToken('ard-calendar-defaults', {
7087
- factory: () => ({
7088
- ..._calendarDefaults,
7089
- }),
7090
- });
7091
- function provideCalendarDefaults(config) {
7092
- return { provide: ARD_CALENDAR_DEFAULTS, useValue: { ..._calendarDefaults, ...config } };
7093
- }
7094
-
7095
- const ARD_ICON_BUTTON_DEFAULTS = new InjectionToken('ard-icon-button-defaults', {
7096
- factory: () => ({ ..._simpleButtonDefaults, ..._focusableComponentDefaults }),
7097
- });
7098
- function provideIconButtonDefaults(config) {
7099
- return { provide: ARD_ICON_BUTTON_DEFAULTS, useValue: { ..._simpleButtonDefaults, ..._focusableComponentDefaults, ...config } };
7100
- }
7101
-
7102
- class ArdiumIconButtonComponent extends _FocusableComponentBase {
7103
- constructor(defaults) {
7104
- super(defaults);
7105
- this.wrapperClasses = input('');
7106
- this.type = input(this._DEFAULTS.type);
7107
- this.ariaLabel = input('');
7108
- //! button settings
7109
- this.color = input(this._DEFAULTS.color);
7110
- this.lightColoring = input(this._DEFAULTS.lightColoring, {
7111
- transform: v => coerceBooleanProperty(v),
7112
- });
7113
- this.compact = input(this._DEFAULTS.compact, { transform: v => coerceBooleanProperty(v) });
7114
- this.pointerEventsWhenDisabled = input(this._DEFAULTS.pointerEventsWhenDisabled, {
7115
- transform: v => coerceBooleanProperty(v),
7116
- });
7117
- this.ngClasses = computed(() => [
7118
- 'ard-appearance-transparent',
7119
- `ard-color-${this.disabled() ? ComponentColor.None : this.color()}`,
7120
- this.lightColoring() ? `ard-light-coloring` : '',
7121
- this.compact() ? 'ard-compact' : '',
7122
- ].join(' '));
7123
- }
7124
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumIconButtonComponent, deps: [{ token: ARD_ICON_BUTTON_DEFAULTS }], target: i0.ɵɵFactoryTarget.Component }); }
7125
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.15", type: ArdiumIconButtonComponent, isStandalone: false, selector: "ard-icon-button", inputs: { wrapperClasses: { classPropertyName: "wrapperClasses", publicName: "wrapperClasses", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, lightColoring: { classPropertyName: "lightColoring", publicName: "lightColoring", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, pointerEventsWhenDisabled: { classPropertyName: "pointerEventsWhenDisabled", publicName: "pointerEventsWhenDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ard-button-with-pointer-events-when-disabled": "pointerEventsWhenDisabled()" } }, usesInheritance: true, ngImport: i0, template: "<button\r\n class=\"ard-icon-button\"\r\n [type]=\"type()\"\r\n [ngClass]=\"ngClasses()\"\r\n [tabindex]=\"tabIndex()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n>\r\n <ng-content></ng-content>\r\n</button>\r\n", styles: ["@layer ard-ui{ard-icon-button{display:block}.ard-icon-button{display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.ard-icon-button .ard-button-content{max-height:100%;display:flex;align-items:center;justify-content:center}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
7126
- }
7127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumIconButtonComponent, decorators: [{
7128
- type: Component,
7129
- args: [{ standalone: false, selector: 'ard-icon-button', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
7130
- '[class.ard-button-with-pointer-events-when-disabled]': 'pointerEventsWhenDisabled()',
7131
- }, template: "<button\r\n class=\"ard-icon-button\"\r\n [type]=\"type()\"\r\n [ngClass]=\"ngClasses()\"\r\n [tabindex]=\"tabIndex()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n>\r\n <ng-content></ng-content>\r\n</button>\r\n", styles: ["@layer ard-ui{ard-icon-button{display:block}.ard-icon-button{display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.ard-icon-button .ard-button-content{max-height:100%;display:flex;align-items:center;justify-content:center}}\n"] }]
7132
- }], ctorParameters: () => [{ type: undefined, decorators: [{
7133
- type: Inject,
7134
- args: [ARD_ICON_BUTTON_DEFAULTS]
7135
- }] }] });
7136
-
7137
- const TODAY$2 = new Date();
7138
- class DaysViewComponent {
7244
+ const TODAY = new Date();
7245
+ class YearsViewComponent {
7139
7246
  constructor() {
7140
7247
  this.tabIndex = input.required();
7141
7248
  this.readOnly = input.required();
7142
7249
  this.disabled = input.required();
7143
7250
  this.autoFocus = input.required();
7144
7251
  this._isUsingKeyboard = input.required();
7145
- //! active year/month
7146
- this.activeYear = input.required();
7147
- this.activeMonth = input.required();
7148
7252
  this.selectedDate = input.required();
7149
7253
  this.selectedDateEnd = input.required();
7150
7254
  this.rangeSelectionMode = input.required();
@@ -7152,232 +7256,197 @@ class DaysViewComponent {
7152
7256
  this.min = input.required();
7153
7257
  this.max = input.required();
7154
7258
  this.multiCalendarLocation = input.required();
7155
- this.isDayFilteredOut = input.required();
7156
- this.highlightedDay = input.required();
7157
- this.highlightedDayDate = computed(() => {
7158
- const day = this.highlightedDay();
7159
- if (day === null)
7160
- return null;
7161
- return createDate(this.activeYear(), this.activeMonth(), day, this.UTC());
7162
- });
7163
- //! focusing
7164
- this.focusableElement = viewChild.required('focusableElement');
7165
- //! calendar data
7166
- this.firstWeekday = input.required();
7167
- this.staticHeight = input.required();
7168
- this.hideFloatingMonth = input.required();
7169
- this.activeCalendarData = computed(() => getCalendarDayData(this.activeYear(), this.activeMonth(), this.firstWeekday(), this.min(), this.max(), this.staticHeight(), !this.hideFloatingMonth()));
7170
- this.reserveTopRow = computed(() => !this.hideFloatingMonth() && this.activeCalendarData().leadingSpaces < 3);
7171
- this.weekdayArray = computed(() => getCalendarWeekdayArray(this.firstWeekday()));
7259
+ this.currentYearRangeStart = input.required();
7260
+ this.multipleYearPageSize = input.required();
7261
+ this.yearsArray = computed(() => getCalendarYearsArray(this.currentYearRangeStart(), this.multipleYearPageSize(), this.min(), this.max()));
7172
7262
  this.currentAriaLabel = computed(() => {
7173
- const day = this.highlightedDay();
7174
- if (day === null) {
7175
- return '';
7176
- }
7177
- return new Date(this.activeYear(), this.activeMonth(), day).toLocaleDateString(undefined, {
7178
- weekday: 'long',
7179
- year: 'numeric',
7180
- month: 'long',
7181
- day: 'numeric',
7182
- });
7263
+ return this.highlightedYear()?.toString() ?? '';
7264
+ });
7265
+ //! outputs
7266
+ this.triggerOpenMonthsView = output();
7267
+ this.triggerOpenDaysView = output();
7268
+ this.focusEvent = output({ alias: 'focus' });
7269
+ this.blurEvent = output({ alias: 'blur' });
7270
+ this.triggerSelectYear = output();
7271
+ this.triggerChangeYearsViewPage = output();
7272
+ this.triggerHighlightYear = output();
7273
+ this.triggerHighlightNextYear = output();
7274
+ this.triggerHighlightPreviousYear = output();
7275
+ this.triggerHighlightFirstYear = output();
7276
+ this.triggerHighlightLastYear = output();
7277
+ this.triggerHighlightSameYearPreviousPage = output();
7278
+ this.triggerHighlightSameYearNextPage = output();
7279
+ //! calendar entry hover & click
7280
+ this.highlightedYear = input.required();
7281
+ this.highlightedYearDate = computed(() => {
7282
+ const year = this.highlightedYear();
7283
+ if (isNull(year))
7284
+ return null;
7285
+ return new Date(year, 0, 1);
7183
7286
  });
7184
- //! outputs
7185
- this.triggerOpenYearsView = output();
7186
- this.triggerOpenMonthsView = output();
7187
- this.triggerSelectDay = output();
7188
- this.triggerChangeMonth = output();
7189
- this.triggerChangeYear = output();
7190
- this.triggerHighlightDay = output();
7191
- this.triggerHighlightNextDay = output();
7192
- this.triggerHighlightPreviousDay = output();
7193
- this.triggerHighlightFirstDay = output();
7194
- this.triggerHighlightLastDay = output();
7195
- this.triggerHighlightSameDayPreviousPage = output();
7196
- this.triggerHighlightSameDayNextPage = output();
7197
- this.focusEvent = output({ alias: 'focus' });
7198
- this.blurEvent = output({ alias: 'blur' });
7287
+ //! focusing
7288
+ this.focusableElement = viewChild.required('focusableElement');
7199
7289
  //! templates
7200
- this.daysViewHeaderTemplate = input.required();
7201
- this.floatingMonthTemplate = input.required();
7202
- this.weekdayTemplate = input.required();
7203
- this.dayTemplate = input.required();
7290
+ this.yearsViewHeaderTemplate = input.required();
7291
+ this.yearTemplate = input.required();
7204
7292
  //! template customizations
7205
- this.daysViewHeaderDateFormat = input.required(); // 'MMM YYYY'
7206
- this.weekdayDateFormat = input.required(); // 'EEEEE'
7207
- this.weekdayTitleDateFormat = input.required(); // 'EEEE'
7208
- this.floatingMonthDateFormat = input.required(); // 'LLL'
7209
- this.floatingMonthTitleDateFormat = input.required(); // 'LLLL'
7210
- this.dayDateFormat = input.required(); // 'D'
7293
+ this.yearsViewHeaderDateFormat = input.required(); // 'YYYY'
7294
+ this.yearDateFormat = input.required(); // 'YYYY'
7211
7295
  //! template contexts
7212
- this.daysViewHeaderContext = computed(() => ({
7213
- nextMonth: () => {
7214
- this.triggerChangeMonth.emit(this.activeMonth() + 1);
7215
- },
7216
- prevMonth: () => {
7217
- this.triggerChangeMonth.emit(this.activeMonth() - 1);
7218
- },
7219
- nextYear: () => {
7220
- this.triggerChangeYear.emit(this.activeYear() + 1);
7221
- },
7222
- prevYear: () => {
7223
- this.triggerChangeYear.emit(this.activeYear() - 1);
7224
- },
7225
- openYearsView: () => {
7226
- this.triggerOpenYearsView.emit();
7227
- },
7228
- openMonthsView: () => {
7229
- this.triggerOpenMonthsView.emit();
7230
- },
7231
- canGoToNextPage: !this.isMonthOutOfRange(this.activeMonth() + 1),
7232
- canGoToPreviousPage: !this.isMonthOutOfRange(this.activeMonth() - 1),
7233
- hideNextPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Left ||
7234
- this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
7235
- hidePreviousPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Right ||
7236
- this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
7237
- year: this.activeYear(),
7238
- month: this.activeMonth(),
7239
- $implicit: getUTCDate(this.activeYear(), this.activeMonth(), 2), // second day of month to prevent timezone issues
7240
- }));
7241
- this.weekdayContext = computed(() => (dayIndex) => {
7242
- // create a date object for the given day index (0 = Sunday, 1 = Monday, etc.)
7243
- // add 4 because January 4, 1970 is a Sunday
7244
- const date = getUTCDate(1970, 0, 4 + dayIndex);
7245
- return {
7246
- dayIndex,
7247
- date,
7248
- $implicit: date,
7296
+ this.yearsViewHeaderContext = computed(() => {
7297
+ const yearRangeStart = this.currentYearRangeStart();
7298
+ const yearRangeEnd = yearRangeStart + 23;
7299
+ const dateRange = new DateRange(getUTCDate(yearRangeStart, 0, 2), // second day of month to prevent timezone issues
7300
+ getUTCDate(yearRangeEnd, 0, 2));
7301
+ const yearRange = {
7302
+ from: yearRangeStart,
7303
+ to: yearRangeEnd,
7249
7304
  };
7250
- });
7251
- this.floatingMonthContext = computed(() => {
7252
- const date = getUTCDate(this.activeYear(), this.activeMonth(), 2); // second day of month to prevent timezone issues
7253
7305
  return {
7254
- month: this.activeMonth(),
7255
- date,
7256
- $implicit: date,
7306
+ nextPage: () => {
7307
+ this.triggerChangeYearsViewPage.emit(1);
7308
+ },
7309
+ prevPage: () => {
7310
+ this.triggerChangeYearsViewPage.emit(-1);
7311
+ },
7312
+ openMonthsView: () => {
7313
+ this.triggerOpenMonthsView.emit();
7314
+ },
7315
+ openDaysView: () => {
7316
+ this.triggerOpenDaysView.emit();
7317
+ },
7318
+ onFocus: (event) => {
7319
+ this.focusEvent.emit(event);
7320
+ },
7321
+ onBlur: (event) => {
7322
+ this.blurEvent.emit(event);
7323
+ },
7324
+ canGoToNextPage: !this.isYearOutOfRange(yearRangeEnd + 1),
7325
+ canGoToPreviousPage: !this.isYearOutOfRange(yearRangeStart - 1),
7326
+ hideNextPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Left ||
7327
+ this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
7328
+ hidePreviousPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Right ||
7329
+ this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
7330
+ yearRange: yearRange,
7331
+ dateRange,
7332
+ $implicit: dateRange,
7257
7333
  };
7258
7334
  });
7259
- this.dayContext = computed(() => (day) => {
7260
- const date = getUTCDate(this.activeYear(), this.activeMonth(), day);
7261
- return {
7262
- value: day,
7263
- date,
7264
- $implicit: day,
7265
- select: (dayOrDate) => {
7266
- this.triggerSelectDay.emit(dayOrDate instanceof Date ? dayOrDate.getDate() : dayOrDate);
7267
- },
7335
+ this.yearContext = computed(() => {
7336
+ return (year) => {
7337
+ const date = getUTCDate(year, 1, 2); // second day of month to prevent timezone issues
7338
+ return {
7339
+ value: year,
7340
+ date,
7341
+ $implicit: date,
7342
+ select: (year) => {
7343
+ this.triggerSelectYear.emit(year);
7344
+ },
7345
+ };
7268
7346
  };
7269
7347
  });
7270
7348
  }
7271
7349
  onMouseMove() {
7272
7350
  if (this._isUsingKeyboard())
7273
7351
  return;
7274
- if (this.highlightedDay())
7275
- this.triggerHighlightDay.emit(null);
7352
+ if (this.highlightedYear())
7353
+ this.triggerHighlightYear.emit(null);
7276
7354
  }
7277
7355
  ngAfterViewInit() {
7278
7356
  if (!this.autoFocus())
7279
7357
  return;
7280
7358
  this.focus();
7281
- this.triggerHighlightDay.emit(1);
7359
+ this.triggerHighlightYear.emit(this.currentYearRangeStart());
7282
7360
  }
7283
- focus() {
7284
- this.focusableElement().nativeElement.focus();
7361
+ onCalendarYearMouseover(year) {
7362
+ if (this._isUsingKeyboard() || this.disabled() || this.readOnly())
7363
+ return;
7364
+ this.triggerHighlightYear.emit(year);
7285
7365
  }
7286
- isDaySelected(day) {
7287
- if (day instanceof Date)
7288
- day = day.getDate();
7289
- const isStartDateSelected = this.isDaySelectedStart(day);
7366
+ onCalendarYearClick(year) {
7367
+ if (this.disabled() || this.readOnly())
7368
+ return;
7369
+ this.triggerSelectYear.emit(year);
7370
+ }
7371
+ onYearGridFocus() {
7372
+ if (this.disabled() || this.readOnly())
7373
+ return;
7374
+ this.triggerHighlightFirstYear.emit();
7375
+ }
7376
+ onYearGridBlur() {
7377
+ if (this.disabled() || this.readOnly())
7378
+ return;
7379
+ this.triggerHighlightYear.emit(null);
7380
+ }
7381
+ onYearGridClick() {
7382
+ if (this.disabled() || this.readOnly())
7383
+ return;
7384
+ if (this.highlightedYear() !== null)
7385
+ return;
7386
+ this.triggerHighlightFirstYear.emit();
7387
+ }
7388
+ //! helpers
7389
+ isYearToday(year) {
7390
+ return year === TODAY.getFullYear();
7391
+ }
7392
+ isYearSelected(year) {
7393
+ if (year instanceof Date)
7394
+ year = year.getFullYear();
7395
+ const isStartDateSelected = this.isYearSelectedStart(year);
7290
7396
  if (this.rangeSelectionMode()) {
7291
- const isEndDateSelected = this.isDaySelectedEnd(day);
7397
+ const isEndDateSelected = this.isYearSelectedEnd(year);
7292
7398
  return isStartDateSelected || isEndDateSelected;
7293
7399
  }
7294
7400
  return isStartDateSelected;
7295
7401
  }
7296
- isDaySelectedStart(day) {
7297
- if (day instanceof Date)
7298
- day = day.getDate();
7402
+ isYearSelectedStart(year) {
7403
+ if (year instanceof Date)
7404
+ year = year.getFullYear();
7299
7405
  const selected = this.selectedDate();
7300
- const { year, month, date } = getDateComponents(selected, this.UTC());
7301
- const isStartDateSelected = selected !== null && this.activeYear() === year && this.activeMonth() === month && day === date;
7406
+ const { year: selectedYear } = getDateComponents(selected, this.UTC());
7407
+ const isStartDateSelected = selected !== null && year === selectedYear;
7302
7408
  return isStartDateSelected;
7303
7409
  }
7304
- isDaySelectedEnd(day) {
7305
- if (day instanceof Date)
7306
- day = day.getDate();
7410
+ isYearSelectedEnd(year) {
7411
+ if (year instanceof Date)
7412
+ year = year.getFullYear();
7307
7413
  const selected = this.selectedDateEnd();
7308
- const { year, month, date } = getDateComponents(selected, this.UTC());
7309
- const isEndDateSelected = selected !== null && this.activeYear() === year && this.activeMonth() === month && day === date;
7414
+ const { year: selectedYear } = getDateComponents(selected, this.UTC());
7415
+ const isEndDateSelected = selected !== null && year === selectedYear;
7310
7416
  return isEndDateSelected;
7311
7417
  }
7312
- isDayBetweenSelectedRange(day) {
7418
+ isYearBetweenSelectedRange(year) {
7313
7419
  if (!this.rangeSelectionMode())
7314
7420
  return false;
7315
- if (day instanceof Date)
7316
- day = day.getDate();
7421
+ if (year instanceof Date)
7422
+ year = year.getFullYear();
7317
7423
  const selected = this.selectedDate();
7318
7424
  const selectedEnd = this.selectedDateEnd();
7319
7425
  if (selected === null || selectedEnd === null || selected >= selectedEnd)
7320
7426
  return false;
7321
- return this._isDayBetweenDates(day, selected, selectedEnd);
7427
+ return this._isYearBetweenDates(year, selected, selectedEnd);
7322
7428
  }
7323
- isDayBetweenSelectedHighlighted(day) {
7429
+ isYearBetweenSelectedHighlighted(year) {
7324
7430
  if (!this.rangeSelectionMode() || this.selectedDateEnd())
7325
7431
  return false;
7326
- if (day instanceof Date)
7327
- day = day.getDate();
7432
+ if (year instanceof Date)
7433
+ year = year.getFullYear();
7328
7434
  const selected = this.selectedDate();
7329
- const highlightedEnd = this.highlightedDayDate();
7435
+ const highlightedEnd = this.highlightedYearDate();
7330
7436
  if (selected === null || highlightedEnd === null || selected >= highlightedEnd)
7331
7437
  return false;
7332
- return this._isDayBetweenDates(day, selected, highlightedEnd);
7333
- }
7334
- _isDayBetweenDates(day, startDate, endDate) {
7335
- const date = createDate(this.activeYear(), this.activeMonth(), day, this.UTC());
7336
- return date >= startDate && date <= endDate;
7337
- }
7338
- onCalendarDayMouseover(day) {
7339
- if (this._isUsingKeyboard())
7340
- return;
7341
- if (this.disabled() || this.readOnly())
7342
- return;
7343
- if (day && this.isDayFilteredOut()(day))
7344
- return;
7345
- this.triggerHighlightDay.emit(day);
7346
- }
7347
- onCalendarDayClick(day) {
7348
- if (this.disabled() || this.readOnly())
7349
- return;
7350
- if (day === null)
7351
- return;
7352
- if (this.isDayFilteredOut()(day))
7353
- return;
7354
- this.triggerHighlightDay.emit(day);
7355
- this.focus();
7356
- this.triggerSelectDay.emit(day);
7357
- }
7358
- onDayGridFocus() {
7359
- if (this.disabled() || this.readOnly())
7360
- return;
7361
- this.triggerHighlightFirstDay.emit();
7362
- }
7363
- onDayGridBlur() {
7364
- if (this.disabled() || this.readOnly())
7365
- return;
7366
- this.triggerHighlightDay.emit(null);
7438
+ return this._isYearBetweenDates(year, selected, highlightedEnd);
7367
7439
  }
7368
- onDayGridClick() {
7369
- if (this.disabled() || this.readOnly())
7370
- return;
7371
- if (this.highlightedDay() !== null)
7372
- return;
7373
- this.triggerHighlightFirstDay.emit();
7440
+ _isYearBetweenDates(year, startDate, endDate) {
7441
+ const { year: startYear } = getDateComponents(startDate, this.UTC());
7442
+ const { year: endYear } = getDateComponents(endDate, this.UTC());
7443
+ return startYear <= year && endYear >= year;
7374
7444
  }
7375
- //! helpers
7376
- isDayToday(day) {
7377
- return this.activeYear() === TODAY$2.getFullYear() && this.activeMonth() === TODAY$2.getMonth() && day === TODAY$2.getDate();
7445
+ isYearOutOfRange(year) {
7446
+ return isYearOutOfRange(year, this.min(), this.max());
7378
7447
  }
7379
- isMonthOutOfRange(month) {
7380
- return isMonthOutOfRange(month, this.activeYear(), this.min(), this.max());
7448
+ focus() {
7449
+ this.focusableElement().nativeElement.focus();
7381
7450
  }
7382
7451
  //! keyboard controls
7383
7452
  onMainGridKeydown(event) {
@@ -7419,659 +7488,620 @@ class DaysViewComponent {
7419
7488
  //select currently selected entry
7420
7489
  _onEnterPress(event) {
7421
7490
  event.preventDefault();
7422
- this.triggerSelectDay.emit(this.highlightedDay());
7491
+ const year = this.highlightedYear();
7492
+ if (isNull(year))
7493
+ return;
7494
+ this.triggerSelectYear.emit(year);
7423
7495
  }
7424
7496
  //highlight the entry one line below
7425
7497
  _onArrowDownPress(event) {
7426
7498
  event.preventDefault();
7427
- this.triggerHighlightNextDay.emit(7);
7499
+ this.triggerHighlightNextYear.emit(4); //4 years per line
7428
7500
  }
7429
7501
  //highlight the entry one line above
7430
7502
  _onArrowUpPress(event) {
7431
7503
  event.preventDefault();
7432
- this.triggerHighlightPreviousDay.emit(7);
7504
+ this.triggerHighlightPreviousYear.emit(4); //4 years per line
7433
7505
  }
7434
7506
  //highlight next entry
7435
7507
  _onArrowRightPress(event) {
7436
7508
  event.preventDefault();
7437
- this.triggerHighlightNextDay.emit(1);
7509
+ this.triggerHighlightNextYear.emit(1);
7438
7510
  }
7439
7511
  //highlight previous entry
7440
7512
  _onArrowLeftPress(event) {
7441
7513
  event.preventDefault();
7442
- this.triggerHighlightPreviousDay.emit(1);
7514
+ this.triggerHighlightPreviousYear.emit(1);
7443
7515
  }
7444
7516
  //highlight first entry on the page
7445
7517
  _onHomePress(event) {
7446
7518
  event.preventDefault();
7447
- this.triggerHighlightFirstDay.emit();
7519
+ this.triggerHighlightFirstYear.emit();
7448
7520
  }
7449
7521
  //highlight last entry on the page
7450
7522
  _onEndPress(event) {
7451
7523
  event.preventDefault();
7452
- this.triggerHighlightLastDay.emit();
7453
- }
7454
- //alone: highlight same entry on the next page
7455
- //with alt: highlight same entry multiple pages after (12 pages)
7456
- _onPageDownPress(event) {
7457
- event.preventDefault();
7458
- this.triggerHighlightSameDayNextPage.emit(event.altKey);
7524
+ this.triggerHighlightLastYear.emit();
7459
7525
  }
7460
7526
  //alone: highlight same entry on the previous page
7461
- //with alt: highlight same entry multiple pages before (12 pages)
7527
+ //with alt: highlight same entry multiple pages before
7462
7528
  _onPageUpPress(event) {
7463
7529
  event.preventDefault();
7464
- this.triggerHighlightSameDayPreviousPage.emit(event.altKey);
7530
+ this.triggerHighlightSameYearPreviousPage.emit(event.altKey);
7465
7531
  }
7466
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DaysViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7467
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: DaysViewComponent, isStandalone: false, selector: "ard-days-view", inputs: { tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: true, transformFunction: null }, _isUsingKeyboard: { classPropertyName: "_isUsingKeyboard", publicName: "_isUsingKeyboard", isSignal: true, isRequired: true, transformFunction: null }, activeYear: { classPropertyName: "activeYear", publicName: "activeYear", isSignal: true, isRequired: true, transformFunction: null }, activeMonth: { classPropertyName: "activeMonth", publicName: "activeMonth", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null }, selectedDateEnd: { classPropertyName: "selectedDateEnd", publicName: "selectedDateEnd", isSignal: true, isRequired: true, transformFunction: null }, rangeSelectionMode: { classPropertyName: "rangeSelectionMode", publicName: "rangeSelectionMode", isSignal: true, isRequired: true, transformFunction: null }, UTC: { classPropertyName: "UTC", publicName: "UTC", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, multiCalendarLocation: { classPropertyName: "multiCalendarLocation", publicName: "multiCalendarLocation", isSignal: true, isRequired: true, transformFunction: null }, isDayFilteredOut: { classPropertyName: "isDayFilteredOut", publicName: "isDayFilteredOut", isSignal: true, isRequired: true, transformFunction: null }, highlightedDay: { classPropertyName: "highlightedDay", publicName: "highlightedDay", isSignal: true, isRequired: true, transformFunction: null }, firstWeekday: { classPropertyName: "firstWeekday", publicName: "firstWeekday", isSignal: true, isRequired: true, transformFunction: null }, staticHeight: { classPropertyName: "staticHeight", publicName: "staticHeight", isSignal: true, isRequired: true, transformFunction: null }, hideFloatingMonth: { classPropertyName: "hideFloatingMonth", publicName: "hideFloatingMonth", isSignal: true, isRequired: true, transformFunction: null }, daysViewHeaderTemplate: { classPropertyName: "daysViewHeaderTemplate", publicName: "daysViewHeaderTemplate", isSignal: true, isRequired: true, transformFunction: null }, floatingMonthTemplate: { classPropertyName: "floatingMonthTemplate", publicName: "floatingMonthTemplate", isSignal: true, isRequired: true, transformFunction: null }, weekdayTemplate: { classPropertyName: "weekdayTemplate", publicName: "weekdayTemplate", isSignal: true, isRequired: true, transformFunction: null }, dayTemplate: { classPropertyName: "dayTemplate", publicName: "dayTemplate", isSignal: true, isRequired: true, transformFunction: null }, daysViewHeaderDateFormat: { classPropertyName: "daysViewHeaderDateFormat", publicName: "daysViewHeaderDateFormat", isSignal: true, isRequired: true, transformFunction: null }, weekdayDateFormat: { classPropertyName: "weekdayDateFormat", publicName: "weekdayDateFormat", isSignal: true, isRequired: true, transformFunction: null }, weekdayTitleDateFormat: { classPropertyName: "weekdayTitleDateFormat", publicName: "weekdayTitleDateFormat", isSignal: true, isRequired: true, transformFunction: null }, floatingMonthDateFormat: { classPropertyName: "floatingMonthDateFormat", publicName: "floatingMonthDateFormat", isSignal: true, isRequired: true, transformFunction: null }, floatingMonthTitleDateFormat: { classPropertyName: "floatingMonthTitleDateFormat", publicName: "floatingMonthTitleDateFormat", isSignal: true, isRequired: true, transformFunction: null }, dayDateFormat: { classPropertyName: "dayDateFormat", publicName: "dayDateFormat", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { triggerOpenYearsView: "triggerOpenYearsView", triggerOpenMonthsView: "triggerOpenMonthsView", triggerSelectDay: "triggerSelectDay", triggerChangeMonth: "triggerChangeMonth", triggerChangeYear: "triggerChangeYear", triggerHighlightDay: "triggerHighlightDay", triggerHighlightNextDay: "triggerHighlightNextDay", triggerHighlightPreviousDay: "triggerHighlightPreviousDay", triggerHighlightFirstDay: "triggerHighlightFirstDay", triggerHighlightLastDay: "triggerHighlightLastDay", triggerHighlightSameDayPreviousPage: "triggerHighlightSameDayPreviousPage", triggerHighlightSameDayNextPage: "triggerHighlightSameDayNextPage", focusEvent: "focus", blurEvent: "blur" }, host: { listeners: { "mousemove": "onMouseMove()" } }, viewQueries: [{ propertyName: "focusableElement", first: true, predicate: ["focusableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ard-days-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultDaysViewHeaderTemplate\r\n let-currDate\r\n let-nextMonth=\"nextMonth\"\r\n let-prevMonth=\"prevMonth\"\r\n let-canGoToNextMonth=\"canGoToNextPage\"\r\n let-canGoToPreviousMonth=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openYearsView=\"openYearsView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevMonth()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousMonth\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openYearsView()\"\r\n >\r\n {{ currDate | date : this.daysViewHeaderDateFormat() | uppercase }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextMonth()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextMonth\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"daysViewHeaderTemplate() || defaultDaysViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"daysViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div class=\"ard-calendar__weekdays\">\r\n <ng-template\r\n #defaultWeekdayTemplate\r\n let-date\r\n >\r\n <div\r\n class=\"ard-calendar__weekday\"\r\n [title]=\"date | date : weekdayTitleDateFormat() | titlecase\"\r\n >\r\n {{ date | date : weekdayDateFormat() | uppercase }}\r\n </div>\r\n </ng-template>\r\n @for (weekdayIndex of weekdayArray(); track weekdayIndex) {\r\n <ng-template\r\n [ngTemplateOutlet]=\"weekdayTemplate() || defaultWeekdayTemplate\"\r\n [ngTemplateOutletContext]=\"weekdayContext()(weekdayIndex)\"\r\n />\r\n }\r\n </div>\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__days-grid\"\r\n [class.ard-reserve-top-row]=\"reserveTopRow()\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onDayGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onDayGridBlur()\"\r\n (click)=\"onDayGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @if (!hideFloatingMonth()) {\r\n <div class=\"ard-calendar__floating-month\">\r\n <ng-template\r\n #defaultFloatingMonthTemplate\r\n let-date\r\n >\r\n <div [title]=\"date | date : floatingMonthTitleDateFormat() | titlecase\">\r\n {{ date | date : floatingMonthDateFormat() | uppercase }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"floatingMonthTemplate() || defaultFloatingMonthTemplate\"\r\n [ngTemplateOutletContext]=\"floatingMonthContext()\"\r\n />\r\n </div>\r\n } @for (week of activeCalendarData().array; track $index) { @for (day of week; track day ? day :\r\n activeCalendarData().leadingSpaces - $index) { @if (day === null) {\r\n <div class=\"ard-calendar__entry ard-calendar__entry-empty\"></div>\r\n } @else {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedDay() === day.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isDayBetweenSelectedHighlighted(day.value)\"\r\n [class.ard-calendar__entry-disabled]=\"day.disabled || isDayFilteredOut()(day.value)\"\r\n [class.ard-calendar__entry-selected]=\"isDaySelected(day.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isDaySelectedStart(day.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isDaySelectedEnd(day.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isDayBetweenSelectedRange(day.value)\"\r\n [class.ard-calendar-today]=\"isDayToday(day.value)\"\r\n (click)=\"onCalendarDayClick(day.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarDayMouseover(day.value)\"\r\n role=\"gridcell\"\r\n >\r\n <div class=\"ard-calendar__entry-button\">\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultDayTemplate\r\n let-date=\"date\"\r\n >\r\n {{ date | date : dayDateFormat() }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"dayTemplate() || defaultDayTemplate\"\r\n [ngTemplateOutletContext]=\"dayContext()(day.value)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n } } }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-days-view{display:block}}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: ["wrapperClasses", "type", "ariaLabel", "color", "lightColoring", "compact", "pointerEventsWhenDisabled"] }, { kind: "component", type: ArdiumIconComponent, selector: "ard-icon", inputs: ["ariaLabel", "icon", "filled", "weight", "grade", "opticalSize"] }, { kind: "component", type: ArdiumButtonComponent, selector: "ard-button", inputs: ["variant", "vertical"], outputs: ["focus", "blur"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: i1.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7532
+ //alone: highlight same entry on the next page
7533
+ //with alt: highlight same entry multiple pages after
7534
+ _onPageDownPress(event) {
7535
+ event.preventDefault();
7536
+ this.triggerHighlightSameYearNextPage.emit(event.altKey);
7537
+ }
7538
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: YearsViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7539
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: YearsViewComponent, isStandalone: false, selector: "ard-years-view", inputs: { tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: true, transformFunction: null }, _isUsingKeyboard: { classPropertyName: "_isUsingKeyboard", publicName: "_isUsingKeyboard", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null }, selectedDateEnd: { classPropertyName: "selectedDateEnd", publicName: "selectedDateEnd", isSignal: true, isRequired: true, transformFunction: null }, rangeSelectionMode: { classPropertyName: "rangeSelectionMode", publicName: "rangeSelectionMode", isSignal: true, isRequired: true, transformFunction: null }, UTC: { classPropertyName: "UTC", publicName: "UTC", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, multiCalendarLocation: { classPropertyName: "multiCalendarLocation", publicName: "multiCalendarLocation", isSignal: true, isRequired: true, transformFunction: null }, currentYearRangeStart: { classPropertyName: "currentYearRangeStart", publicName: "currentYearRangeStart", isSignal: true, isRequired: true, transformFunction: null }, multipleYearPageSize: { classPropertyName: "multipleYearPageSize", publicName: "multipleYearPageSize", isSignal: true, isRequired: true, transformFunction: null }, highlightedYear: { classPropertyName: "highlightedYear", publicName: "highlightedYear", isSignal: true, isRequired: true, transformFunction: null }, yearsViewHeaderTemplate: { classPropertyName: "yearsViewHeaderTemplate", publicName: "yearsViewHeaderTemplate", isSignal: true, isRequired: true, transformFunction: null }, yearTemplate: { classPropertyName: "yearTemplate", publicName: "yearTemplate", isSignal: true, isRequired: true, transformFunction: null }, yearsViewHeaderDateFormat: { classPropertyName: "yearsViewHeaderDateFormat", publicName: "yearsViewHeaderDateFormat", isSignal: true, isRequired: true, transformFunction: null }, yearDateFormat: { classPropertyName: "yearDateFormat", publicName: "yearDateFormat", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { triggerOpenMonthsView: "triggerOpenMonthsView", triggerOpenDaysView: "triggerOpenDaysView", focusEvent: "focus", blurEvent: "blur", triggerSelectYear: "triggerSelectYear", triggerChangeYearsViewPage: "triggerChangeYearsViewPage", triggerHighlightYear: "triggerHighlightYear", triggerHighlightNextYear: "triggerHighlightNextYear", triggerHighlightPreviousYear: "triggerHighlightPreviousYear", triggerHighlightFirstYear: "triggerHighlightFirstYear", triggerHighlightLastYear: "triggerHighlightLastYear", triggerHighlightSameYearPreviousPage: "triggerHighlightSameYearPreviousPage", triggerHighlightSameYearNextPage: "triggerHighlightSameYearNextPage" }, host: { listeners: { "mousemove": "onMouseMove()" } }, viewQueries: [{ propertyName: "focusableElement", first: true, predicate: ["focusableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ard-years-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultYearsViewHeaderTemplate\r\n let-dateRange=\"dateRange\"\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openDaysView=\"openDaysView\"\r\n let-onFocus=\"onFocus\"\r\n let-onBlur=\"onBlur\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n >\r\n {{ dateRange.from | date: yearsViewHeaderDateFormat() }}\r\n &mdash;\r\n {{ dateRange.to | date: yearsViewHeaderDateFormat() }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearsViewHeaderTemplate() || defaultYearsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"yearsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onYearGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onYearGridBlur()\"\r\n (click)=\"onYearGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (year of yearsArray(); track year) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedYear() === year.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isYearBetweenSelectedHighlighted(year.value)\"\r\n [class.ard-calendar__entry-disabled]=\"year.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isYearSelected(year.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isYearSelectedStart(year.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isYearSelectedEnd(year.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isYearBetweenSelectedRange(year.value)\"\r\n [class.ard-calendar-today]=\"isYearToday(year.value)\"\r\n (click)=\"onCalendarYearClick(year.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarYearMouseover(year.value)\"\r\n role=\"gridcell\"\r\n >\r\n <div class=\"ard-calendar__entry-button\">\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultYearTemplate\r\n let-year\r\n >\r\n {{ year | date: yearDateFormat() }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearTemplate() || defaultYearTemplate\"\r\n [ngTemplateOutletContext]=\"yearContext()(year.value)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-years-view{display:block}}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: ["wrapperClasses", "type", "ariaLabel", "color", "lightColoring", "compact", "pointerEventsWhenDisabled"] }, { kind: "component", type: ArdiumIconComponent, selector: "ard-icon", inputs: ["ariaLabel", "icon", "filled", "weight", "grade", "opticalSize"] }, { kind: "component", type: ArdiumButtonComponent, selector: "ard-button", inputs: ["variant", "vertical"], outputs: ["focus", "blur"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7468
7540
  }
7469
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DaysViewComponent, decorators: [{
7541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: YearsViewComponent, decorators: [{
7470
7542
  type: Component,
7471
- args: [{ standalone: false, selector: 'ard-days-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ard-days-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultDaysViewHeaderTemplate\r\n let-currDate\r\n let-nextMonth=\"nextMonth\"\r\n let-prevMonth=\"prevMonth\"\r\n let-canGoToNextMonth=\"canGoToNextPage\"\r\n let-canGoToPreviousMonth=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openYearsView=\"openYearsView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevMonth()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousMonth\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openYearsView()\"\r\n >\r\n {{ currDate | date : this.daysViewHeaderDateFormat() | uppercase }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextMonth()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextMonth\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"daysViewHeaderTemplate() || defaultDaysViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"daysViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div class=\"ard-calendar__weekdays\">\r\n <ng-template\r\n #defaultWeekdayTemplate\r\n let-date\r\n >\r\n <div\r\n class=\"ard-calendar__weekday\"\r\n [title]=\"date | date : weekdayTitleDateFormat() | titlecase\"\r\n >\r\n {{ date | date : weekdayDateFormat() | uppercase }}\r\n </div>\r\n </ng-template>\r\n @for (weekdayIndex of weekdayArray(); track weekdayIndex) {\r\n <ng-template\r\n [ngTemplateOutlet]=\"weekdayTemplate() || defaultWeekdayTemplate\"\r\n [ngTemplateOutletContext]=\"weekdayContext()(weekdayIndex)\"\r\n />\r\n }\r\n </div>\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__days-grid\"\r\n [class.ard-reserve-top-row]=\"reserveTopRow()\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onDayGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onDayGridBlur()\"\r\n (click)=\"onDayGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @if (!hideFloatingMonth()) {\r\n <div class=\"ard-calendar__floating-month\">\r\n <ng-template\r\n #defaultFloatingMonthTemplate\r\n let-date\r\n >\r\n <div [title]=\"date | date : floatingMonthTitleDateFormat() | titlecase\">\r\n {{ date | date : floatingMonthDateFormat() | uppercase }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"floatingMonthTemplate() || defaultFloatingMonthTemplate\"\r\n [ngTemplateOutletContext]=\"floatingMonthContext()\"\r\n />\r\n </div>\r\n } @for (week of activeCalendarData().array; track $index) { @for (day of week; track day ? day :\r\n activeCalendarData().leadingSpaces - $index) { @if (day === null) {\r\n <div class=\"ard-calendar__entry ard-calendar__entry-empty\"></div>\r\n } @else {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedDay() === day.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isDayBetweenSelectedHighlighted(day.value)\"\r\n [class.ard-calendar__entry-disabled]=\"day.disabled || isDayFilteredOut()(day.value)\"\r\n [class.ard-calendar__entry-selected]=\"isDaySelected(day.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isDaySelectedStart(day.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isDaySelectedEnd(day.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isDayBetweenSelectedRange(day.value)\"\r\n [class.ard-calendar-today]=\"isDayToday(day.value)\"\r\n (click)=\"onCalendarDayClick(day.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarDayMouseover(day.value)\"\r\n role=\"gridcell\"\r\n >\r\n <div class=\"ard-calendar__entry-button\">\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultDayTemplate\r\n let-date=\"date\"\r\n >\r\n {{ date | date : dayDateFormat() }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"dayTemplate() || defaultDayTemplate\"\r\n [ngTemplateOutletContext]=\"dayContext()(day.value)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n } } }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-days-view{display:block}}\n"] }]
7543
+ args: [{ standalone: false, selector: 'ard-years-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ard-years-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultYearsViewHeaderTemplate\r\n let-dateRange=\"dateRange\"\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openDaysView=\"openDaysView\"\r\n let-onFocus=\"onFocus\"\r\n let-onBlur=\"onBlur\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n >\r\n {{ dateRange.from | date: yearsViewHeaderDateFormat() }}\r\n &mdash;\r\n {{ dateRange.to | date: yearsViewHeaderDateFormat() }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearsViewHeaderTemplate() || defaultYearsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"yearsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onYearGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onYearGridBlur()\"\r\n (click)=\"onYearGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (year of yearsArray(); track year) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedYear() === year.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isYearBetweenSelectedHighlighted(year.value)\"\r\n [class.ard-calendar__entry-disabled]=\"year.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isYearSelected(year.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isYearSelectedStart(year.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isYearSelectedEnd(year.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isYearBetweenSelectedRange(year.value)\"\r\n [class.ard-calendar-today]=\"isYearToday(year.value)\"\r\n (click)=\"onCalendarYearClick(year.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarYearMouseover(year.value)\"\r\n role=\"gridcell\"\r\n >\r\n <div class=\"ard-calendar__entry-button\">\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultYearTemplate\r\n let-year\r\n >\r\n {{ year | date: yearDateFormat() }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearTemplate() || defaultYearTemplate\"\r\n [ngTemplateOutletContext]=\"yearContext()(year.value)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-years-view{display:block}}\n"] }]
7472
7544
  }], propDecorators: { onMouseMove: [{
7473
7545
  type: HostListener,
7474
7546
  args: ['mousemove']
7475
7547
  }] } });
7476
7548
 
7477
- const TODAY$1 = new Date();
7478
- class MonthsViewComponent {
7479
- constructor() {
7480
- this.tabIndex = input.required();
7481
- this.readOnly = input.required();
7482
- this.disabled = input.required();
7483
- this.autoFocus = input.required();
7484
- this._isUsingKeyboard = input.required();
7485
- this.color = input.required();
7486
- this.activeYear = input.required();
7487
- this.activeMonth = input.required();
7488
- this.selectedDate = input.required();
7489
- this.selectedDateEnd = input.required();
7490
- this.rangeSelectionMode = input.required();
7491
- this.UTC = input.required();
7492
- this.min = input.required();
7493
- this.max = input.required();
7494
- this.multiCalendarLocation = input.required();
7495
- this.monthsArray = computed(() => getCalendarMonthsArray(this.activeYear(), this.min(), this.max()));
7496
- this.currentAriaLabel = computed(() => {
7497
- const month = this.highlightedMonth();
7498
- if (month === null) {
7499
- return '';
7500
- }
7501
- return new Date(this.activeYear(), month, 1).toLocaleDateString(undefined, {
7502
- year: 'numeric',
7503
- month: 'long',
7504
- });
7505
- });
7506
- //! outputs
7507
- this.triggerOpenYearsView = output();
7508
- this.triggerOpenDaysView = output();
7509
- this.focusEvent = output({ alias: 'focus' });
7510
- this.blurEvent = output({ alias: 'blur' });
7511
- this.triggerSelectMonth = output();
7512
- this.triggeChangeYear = output();
7513
- this.triggerHighlightMonth = output();
7514
- this.triggerHighlightNextMonth = output();
7515
- this.triggerHighlightPreviousMonth = output();
7516
- this.triggerHighlightFirstMonth = output();
7517
- this.triggerHighlightLastMonth = output();
7518
- this.triggerHighlightSameMonthPreviousPage = output();
7519
- this.triggerHighlightSameMonthNextPage = output();
7520
- //! calendar entry hover & click
7521
- this.highlightedMonth = input.required();
7522
- this.highlightedMonthDate = computed(() => {
7523
- const month = this.highlightedMonth();
7524
- if (isNull(month))
7525
- return null;
7526
- return new Date(this.activeYear(), month, 2);
7527
- });
7528
- //! focusing
7529
- this.focusableElement = viewChild.required('focusableElement');
7530
- //! templates
7531
- this.monthsViewHeaderTemplate = input.required();
7532
- this.monthTemplate = input.required();
7533
- //! template customizations
7534
- this.monthsViewHeaderDateFormat = input.required(); // 'YYYY'
7535
- this.monthDateFormat = input.required(); // 'MMM'
7536
- //! template contexts
7537
- this.monthsViewHeaderContext = computed(() => ({
7538
- nextPage: () => {
7539
- this.triggeChangeYear.emit(this.activeYear() + 1);
7549
+ class _AbstractCalendar extends _FormFieldComponentBase {
7550
+ constructor(defaults) {
7551
+ super(defaults);
7552
+ this.TODAY = computed(() => createDate(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), this.UTC()));
7553
+ //! appearance
7554
+ this.color = input(this._DEFAULTS.color);
7555
+ this.ngClasses = computed(() => [`ard-color-${this.color()}`].join(' '));
7556
+ //! active view
7557
+ this.activeView = model(this._DEFAULTS.activeView);
7558
+ this.activeYear = model(this._DEFAULTS.activeYear);
7559
+ this.activeMonth = model(this._DEFAULTS.activeMonth);
7560
+ this.activePageChange = output();
7561
+ this.firstWeekday = input(this._DEFAULTS.firstWeekday, {
7562
+ transform: v => {
7563
+ const value = coerceNumberProperty(v, this._DEFAULTS.firstWeekday);
7564
+ if (!Number.isInteger(value)) {
7565
+ console.error(new Error(`ARD-NF${this.componentId}1A: [firstWeekday] must be a positive integer, got "${value}". Using default value instead.`));
7566
+ return this._DEFAULTS.firstWeekday;
7567
+ }
7568
+ if (value < 0 || value > 6) {
7569
+ console.error(new Error(`ARD-NF${this.componentId}1B: [firstWeekday] must be between 0 and 6, got "${value}". Using modulo operator to adjust the value.`));
7570
+ }
7571
+ return value % 7;
7540
7572
  },
7541
- prevPage: () => {
7542
- this.triggeChangeYear.emit(this.activeYear() - 1);
7573
+ });
7574
+ this.multipleYearPageChangeModifier = input(this._DEFAULTS.multipleYearPageChangeModifier, {
7575
+ transform: v => {
7576
+ const value = coerceNumberProperty(v, this._DEFAULTS.multipleYearPageChangeModifier);
7577
+ if (!Number.isInteger(value) || value < 1) {
7578
+ console.error(new Error(`ARD-NF${this.componentId}2: [multipleYearPageChangeModifier] must be a positive integer, got "${value}". Using default value instead.`));
7579
+ return this._DEFAULTS.multipleYearPageChangeModifier;
7580
+ }
7581
+ return value;
7543
7582
  },
7544
- openYearsView: () => {
7545
- this.triggerOpenYearsView.emit();
7583
+ });
7584
+ this.multipleYearOffset = input(this._DEFAULTS.multipleYearOffset, {
7585
+ transform: v => {
7586
+ const value = coerceNumberProperty(v, this._DEFAULTS.multipleYearOffset);
7587
+ if (!Number.isInteger(value) || value < 0) {
7588
+ console.error(new Error(`ARD-NF${this.componentId}3: [multipleYearOffset] must be a non-negative integer, got "${value}". Using default value instead.`));
7589
+ return this._DEFAULTS.multipleYearOffset;
7590
+ }
7591
+ return value;
7546
7592
  },
7547
- openDaysView: () => {
7548
- this.triggerOpenDaysView.emit();
7593
+ });
7594
+ this.multipleYearPageSize = input(this._DEFAULTS.multipleYearPageSize, {
7595
+ transform: v => {
7596
+ const value = coerceNumberProperty(v, this._DEFAULTS.multipleYearPageSize);
7597
+ if (!Number.isInteger(value) || value < 1) {
7598
+ console.error(new Error(`ARD-NF${this.componentId}5: [multipleYearPageSize] must be a positive integer, got "${value}". Using default value instead.`));
7599
+ return this._DEFAULTS.multipleYearPageSize;
7600
+ }
7601
+ return value;
7549
7602
  },
7550
- canGoToNextPage: !this.isYearOutOfRange(this.activeYear() + 1),
7551
- canGoToPreviousPage: !this.isYearOutOfRange(this.activeYear() - 1),
7552
- hideNextPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Left ||
7553
- this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
7554
- hidePreviousPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Right ||
7555
- this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
7556
- year: this.activeYear(),
7557
- date: getUTCDate(this.activeYear(), 0, 2), // second day of month to prevent timezone issues
7558
- $implicit: this.activeYear(),
7559
- }));
7560
- this.monthContext = computed(() => (month) => {
7561
- const date = getUTCDate(this.activeYear(), month, 2); // second day of month to prevent timezone issues
7562
- return {
7563
- month,
7564
- date,
7565
- $implicit: date,
7566
- select: (month) => {
7567
- if (month instanceof Date)
7568
- month = month.getMonth();
7569
- this.triggerSelectMonth.emit(month);
7570
- },
7603
+ });
7604
+ this.multiCalendarLocation = input(this._DEFAULTS.multiCalendarLocation);
7605
+ this.autoFocus = input(this._DEFAULTS.autoFocus, { transform: v => coerceBooleanProperty(v) });
7606
+ this.staticHeight = input(this._DEFAULTS.staticHeight, { transform: v => coerceBooleanProperty(v) });
7607
+ this.hideFloatingMonth = input(this._DEFAULTS.hideFloatingMonth, {
7608
+ transform: v => coerceBooleanProperty(v),
7609
+ });
7610
+ this.daysViewComponent = viewChild.required(DaysViewComponent);
7611
+ this.monthsViewComponent = viewChild.required(MonthsViewComponent);
7612
+ this.yearsViewComponent = viewChild.required(YearsViewComponent);
7613
+ //! value
7614
+ this.selectionStart = signal(null);
7615
+ this.selectionEnd = signal(null);
7616
+ this.yearSelect = output();
7617
+ this.monthSelect = output();
7618
+ this.min = input(this._DEFAULTS.min, {
7619
+ transform: v => (v === null ? null : coerceDateProperty(v, this._DEFAULTS.min)),
7620
+ });
7621
+ this.max = input(this._DEFAULTS.max, {
7622
+ transform: v => (v === null ? null : coerceDateProperty(v, this._DEFAULTS.max)),
7623
+ });
7624
+ this.UTC = input(this._DEFAULTS.UTC, { transform: v => coerceBooleanProperty(v) });
7625
+ this._UTCAfterInit = signal(this._DEFAULTS.UTC);
7626
+ this.filter = input(this._DEFAULTS.filter);
7627
+ this.isDayFilteredOut = computed(() => {
7628
+ return (day, month = this.activeMonth(), year = this.activeYear()) => {
7629
+ return this.filter()?.(createDate(year, month, day, this.UTC())) ?? false;
7571
7630
  };
7572
7631
  });
7632
+ //! highlighting days
7633
+ this.highlightedDay = model(null);
7634
+ this.highlightDayEvent = output({ alias: 'highlightDay' });
7635
+ //! highlighting months
7636
+ this._highlightedMonth = signal(null);
7637
+ this.highlightedMonth = this._highlightedMonth.asReadonly();
7638
+ //! highlighting years
7639
+ this.__highlightedYear = signal(null);
7640
+ this.highlightedYear = this.__highlightedYear.asReadonly();
7641
+ this.currentYearRangeStart = linkedSignal(() => {
7642
+ // align to a multiple of 4 and subtract offset
7643
+ const rangeStartForCurrentYear = this.TODAY().getFullYear() - (this.TODAY().getFullYear() % 4) - this.multipleYearOffset() * 4;
7644
+ const activeYear = this.activeYear();
7645
+ const offset = roundToMultiple(activeYear - rangeStartForCurrentYear + 1, this.multipleYearPageSize(), 'up') - this.multipleYearPageSize(); // check how many n-year pages need to be turned
7646
+ return rangeStartForCurrentYear + offset;
7647
+ });
7648
+ //! internals
7649
+ this._isUsingKeyboard = signal(false);
7650
+ //! templates
7651
+ this.templateRepository = contentChild(_CalendarTemplateRepositoryDirective);
7652
+ this.yearsViewHeaderTemplate = contentChild(ArdCalendarYearsViewHeaderTemplateDirective);
7653
+ this.monthsViewHeaderTemplate = contentChild(ArdCalendarMonthsViewHeaderTemplateDirective);
7654
+ this.daysViewHeaderTemplate = contentChild(ArdCalendarDaysViewHeaderTemplateDirective);
7655
+ this.floatingMonthTemplate = contentChild(ArdCalendarFloatingMonthTemplateDirective);
7656
+ this.yearTemplate = contentChild(ArdCalendarYearTemplateDirective);
7657
+ this.monthTemplate = contentChild(ArdCalendarMonthTemplateDirective);
7658
+ this.dayTemplate = contentChild(ArdCalendarDayTemplateDirective);
7659
+ this.weekdayTemplate = contentChild(ArdCalendarWeekdayTemplateDirective);
7660
+ //! template customizations
7661
+ this.daysViewHeaderDateFormat = input(this._DEFAULTS.daysViewHeaderDateFormat); // 'MMM YYYY'
7662
+ this.yearsViewHeaderDateFormat = input(this._DEFAULTS.yearsViewHeaderDateFormat); // 'YYYY'
7663
+ this.monthsViewHeaderDateFormat = input(this._DEFAULTS.monthsViewHeaderDateFormat); // 'YYYY'
7664
+ this.weekdayDateFormat = input(this._DEFAULTS.weekdayDateFormat); // 'EEEEE'
7665
+ this.weekdayTitleDateFormat = input(this._DEFAULTS.weekdayTitleDateFormat); // 'EEEE'
7666
+ this.floatingMonthDateFormat = input(this._DEFAULTS.floatingMonthDateFormat); // 'LLL'
7667
+ this.floatingMonthTitleDateFormat = input(this._DEFAULTS.floatingMonthTitleDateFormat); // 'LLLL'
7668
+ this.yearDateFormat = input(this._DEFAULTS.yearDateFormat); // 'YYYY'
7669
+ this.monthDateFormat = input(this._DEFAULTS.monthDateFormat); // 'MMM'
7670
+ this.dayDateFormat = input(this._DEFAULTS.dayDateFormat); // 'D'
7573
7671
  }
7574
- onMouseMove() {
7575
- if (this._isUsingKeyboard())
7576
- return;
7577
- if (this.highlightedMonth())
7578
- this.triggerHighlightMonth.emit(null);
7672
+ openDaysView() {
7673
+ this.activeView.set(ArdCalendarView.Days);
7674
+ setTimeout(() => {
7675
+ this.daysViewComponent().focus();
7676
+ }, 0);
7579
7677
  }
7580
- ngAfterViewInit() {
7581
- if (!this.autoFocus())
7582
- return;
7583
- this.focus();
7584
- this.triggerHighlightMonth.emit(0);
7678
+ openMonthsView() {
7679
+ this.activeView.set(ArdCalendarView.Months);
7680
+ setTimeout(() => {
7681
+ this.monthsViewComponent().focus();
7682
+ }, 0);
7585
7683
  }
7586
- onCalendarMonthMouseover(month) {
7587
- if (this._isUsingKeyboard())
7588
- return;
7589
- if (this.disabled() || this.readOnly())
7590
- return;
7591
- this.triggerHighlightMonth.emit(month);
7684
+ openYearsView() {
7685
+ this.activeView.set(ArdCalendarView.Years);
7686
+ setTimeout(() => {
7687
+ this.yearsViewComponent().focus();
7688
+ }, 0);
7592
7689
  }
7593
- onCalendarMonthClick(month) {
7594
- if (this.disabled() || this.readOnly())
7595
- return;
7596
- this.triggerSelectMonth.emit(month);
7690
+ _emitChange() {
7691
+ this._onChangeRegistered?.(this.value());
7597
7692
  }
7598
- onMonthGridFocus() {
7599
- if (this.disabled() || this.readOnly())
7600
- return;
7601
- this.triggerHighlightMonth.emit(0);
7693
+ ngOnChanges(changes) {
7694
+ if (changes['UTC']) {
7695
+ if (changes['UTC'].firstChange) {
7696
+ this._UTCAfterInit.set(changes['UTC'].currentValue);
7697
+ }
7698
+ else {
7699
+ console.error(`ARD-NF${this.componentId}4: <ard-${this.componentName}>'s [UTC] attribute should not be changed dynamically. This change will be ignored.`);
7700
+ }
7701
+ }
7702
+ if (changes['value']) {
7703
+ this.writeValue(changes['value'].currentValue);
7704
+ }
7602
7705
  }
7603
- onMonthGridBlur() {
7604
- if (this.disabled() || this.readOnly())
7605
- return;
7606
- this.triggerHighlightMonth.emit(null);
7706
+ _emitActivePageChange() {
7707
+ this.activePageChange.emit({ year: this.activeYear(), month: this.activeMonth() });
7607
7708
  }
7608
- onMonthGridClick() {
7609
- if (this.disabled() || this.readOnly())
7610
- return;
7611
- if (this.highlightedMonth() !== null)
7709
+ _emitHighlightedDate() {
7710
+ const day = this.highlightedDay();
7711
+ if (!day)
7612
7712
  return;
7613
- this.triggerHighlightMonth.emit(0);
7713
+ const date = createDate(this.activeYear(), this.activeMonth(), day, this.UTC());
7714
+ this.highlightDayEvent.emit(date);
7614
7715
  }
7615
- focus() {
7616
- this.focusableElement().nativeElement.focus();
7716
+ //! selecting days
7717
+ isDayOutOfRange(day, month = this.activeMonth(), year = this.activeYear()) {
7718
+ const dayDate = new Date(year, month, day);
7719
+ return isDayOutOfRange(dayDate, this.min(), this.max());
7617
7720
  }
7618
- //! keyboard controls
7619
- onMainGridKeydown(event) {
7620
- if (this.disabled() || this.readOnly())
7721
+ selectDay(day) {
7722
+ const startValue = this.selectionStart();
7723
+ // reset selection
7724
+ if (isNull(day)) {
7725
+ if (!isDefined(startValue))
7726
+ return;
7727
+ this.selectionStart.set(null);
7728
+ this.selectionEnd.set(null);
7621
7729
  return;
7622
- switch (event.code) {
7623
- case 'Space':
7624
- case 'Enter':
7625
- this._onEnterPress(event);
7626
- break;
7627
- case 'ArrowUp':
7628
- this._onArrowUpPress(event);
7629
- break;
7630
- case 'ArrowDown':
7631
- this._onArrowDownPress(event);
7632
- break;
7633
- case 'ArrowLeft':
7634
- this._onArrowLeftPress(event);
7635
- break;
7636
- case 'ArrowRight':
7637
- this._onArrowRightPress(event);
7638
- break;
7639
- case 'Home':
7640
- this._onHomePress(event);
7641
- break;
7642
- case 'End':
7643
- this._onEndPress(event);
7644
- break;
7645
- case 'PageUp':
7646
- this._onPageUpPress(event);
7647
- break;
7648
- case 'PageDown':
7649
- this._onPageDownPress(event);
7650
- break;
7651
- default:
7730
+ }
7731
+ if (day instanceof Date)
7732
+ day = day.getDate();
7733
+ // check if day is out of range or filtered out
7734
+ if ((day && this.isDayOutOfRange(day)) || this.isDayFilteredOut()(day))
7735
+ return;
7736
+ // range selection logic
7737
+ const endValue = this.selectionEnd();
7738
+ const newDate = createDate(this.activeYear(), this.activeMonth(), day, this.UTC());
7739
+ if (this.isRangeSelector) {
7740
+ // select end date
7741
+ if (isDefined(startValue) && !isDefined(endValue) && newDate > startValue) {
7742
+ this.selectionEnd.set(newDate);
7652
7743
  return;
7744
+ }
7745
+ // reset end date and start a new selection
7746
+ this.selectionEnd.set(null);
7653
7747
  }
7654
- }
7655
- //select currently selected entry
7656
- _onEnterPress(event) {
7657
- event.preventDefault();
7658
- const month = this.highlightedMonth();
7659
- if (isNull(month))
7748
+ // avoid setting the same date again
7749
+ if (startValue &&
7750
+ startValue.getFullYear() === this.activeYear() &&
7751
+ startValue.getMonth() === this.activeMonth() &&
7752
+ startValue.getDate() === day) {
7660
7753
  return;
7661
- this.triggerSelectMonth.emit(month);
7662
- }
7663
- //highlight the entry one line below
7664
- _onArrowDownPress(event) {
7665
- event.preventDefault();
7666
- this.triggerHighlightNextMonth.emit(4); //4 months per line
7754
+ }
7755
+ this.selectionStart.set(newDate);
7667
7756
  }
7668
- //highlight the entry one line above
7669
- _onArrowUpPress(event) {
7670
- event.preventDefault();
7671
- this.triggerHighlightPreviousMonth.emit(4); //4 months per line
7757
+ selectCurrentlyHighlightedDay() {
7758
+ if (!isDefined(this.highlightedDay()))
7759
+ return;
7760
+ this.selectDay(this.highlightedDay());
7672
7761
  }
7673
- //highlight next entry
7674
- _onArrowRightPress(event) {
7675
- event.preventDefault();
7676
- this.triggerHighlightNextMonth.emit(1);
7762
+ setHighlightedDay(day, month = this.activeMonth(), year = this.activeYear()) {
7763
+ if (isNull(day)) {
7764
+ this.highlightedDay.update(() => day);
7765
+ this._emitHighlightedDate();
7766
+ return;
7767
+ }
7768
+ const date = createDate(year, month, day, this.UTC());
7769
+ const outOfRange = this.isDayOutOfRange(day, month, year);
7770
+ if (outOfRange === -1) {
7771
+ this._highlightMinDay();
7772
+ return;
7773
+ }
7774
+ if (outOfRange === 1) {
7775
+ this._highlightMaxDay();
7776
+ return;
7777
+ }
7778
+ this.highlightedDay.update(() => date.getDate());
7779
+ if (date.getFullYear() !== this.activeYear()) {
7780
+ this.activeYear.set(date.getFullYear());
7781
+ }
7782
+ if (date.getMonth() !== this.activeMonth()) {
7783
+ this.activeMonth.set(date.getMonth());
7784
+ }
7785
+ this._emitHighlightedDate();
7786
+ this._emitActivePageChange();
7677
7787
  }
7678
- //highlight previous entry
7679
- _onArrowLeftPress(event) {
7680
- event.preventDefault();
7681
- this.triggerHighlightPreviousMonth.emit(1);
7788
+ _highlightMinDay() {
7789
+ const min = this.min();
7790
+ if (!isDefined(min))
7791
+ return;
7792
+ this.activeYear.set(min.getFullYear());
7793
+ this.activeMonth.set(min.getMonth());
7794
+ this.highlightedDay.set(min.getDate());
7795
+ this._emitHighlightedDate();
7796
+ this._emitActivePageChange();
7682
7797
  }
7683
- //highlight first entry on the page
7684
- _onHomePress(event) {
7685
- event.preventDefault();
7686
- this.triggerHighlightFirstMonth.emit();
7798
+ _highlightMaxDay() {
7799
+ const max = this.max();
7800
+ if (!isDefined(max))
7801
+ return;
7802
+ this.activeYear.set(max.getFullYear());
7803
+ this.activeMonth.set(max.getMonth());
7804
+ this.highlightedDay.set(max.getDate());
7805
+ this._emitHighlightedDate();
7806
+ this._emitActivePageChange();
7687
7807
  }
7688
- //highlight last entry on the page
7689
- _onEndPress(event) {
7690
- event.preventDefault();
7691
- this.triggerHighlightLastMonth.emit();
7808
+ highlightNextDay(offset = 1) {
7809
+ const currentDay = this.highlightedDay();
7810
+ const newDay = isDefined(currentDay) ? currentDay + offset : 1;
7811
+ this.setHighlightedDay(newDay);
7692
7812
  }
7693
- //alone: highlight same entry on the next page
7694
- //with alt: highlight same entry multiple pages after (10 pages)
7695
- _onPageDownPress(event) {
7696
- event.preventDefault();
7697
- this.triggerHighlightSameMonthNextPage.emit(event.altKey);
7813
+ highlightPreviousDay(offset = 1) {
7814
+ this.highlightNextDay(offset * -1);
7698
7815
  }
7699
- //alone: highlight same entry on the previous page
7700
- //with alt: highlight same entry multiple pages before (10 pages)
7701
- _onPageUpPress(event) {
7702
- event.preventDefault();
7703
- this.triggerHighlightSameMonthPreviousPage.emit(event.altKey);
7816
+ highlightFirstDay() {
7817
+ this.setHighlightedDay(1);
7704
7818
  }
7705
- //! helpers
7706
- isMonthToday(month) {
7707
- return this.activeYear() === TODAY$1.getFullYear() && month === TODAY$1.getMonth();
7819
+ highlightLastDay() {
7820
+ const daysInMonth = createDate(this.activeYear(), this.activeMonth() + 1, 0, this.UTC()).getDate();
7821
+ this.setHighlightedDay(daysInMonth);
7708
7822
  }
7709
- isMonthSelected(month) {
7710
- if (month instanceof Date)
7711
- month = month.getMonth();
7712
- const isStartDateSelected = this.isMonthSelectedStart(month);
7713
- if (this.rangeSelectionMode()) {
7714
- const isEndDateSelected = this.isMonthSelectedEnd(month);
7715
- return isStartDateSelected || isEndDateSelected;
7716
- }
7717
- return isStartDateSelected;
7823
+ highlightSameDayNextMonth() {
7824
+ const month = this.activeMonth();
7825
+ const year = this.activeYear();
7826
+ const newMonth = month + 1;
7827
+ const newYear = year + Math.floor(newMonth / 12);
7828
+ this.setHighlightedDay(this.highlightedDay(), newMonth % 12, newYear);
7718
7829
  }
7719
- isMonthSelectedStart(month) {
7720
- if (month instanceof Date)
7721
- month = month.getMonth();
7722
- const selected = this.selectedDate();
7723
- const { year, month: selectedMonth } = getDateComponents(selected, this.UTC());
7724
- const isStartDateSelected = selected !== null && this.activeYear() === year && month === selectedMonth;
7725
- return isStartDateSelected;
7830
+ highlightSameDayPreviousMonth() {
7831
+ const month = this.activeMonth();
7832
+ const year = this.activeYear();
7833
+ const newMonth = month - 1;
7834
+ const newYear = year + Math.floor(newMonth / 12);
7835
+ this.setHighlightedDay(this.highlightedDay(), newMonth % 12, newYear);
7726
7836
  }
7727
- isMonthSelectedEnd(month) {
7728
- if (month instanceof Date)
7729
- month = month.getMonth();
7730
- const selected = this.selectedDateEnd();
7731
- const { year, month: selectedMonth } = getDateComponents(selected, this.UTC());
7732
- const isEndDateSelected = selected !== null && this.activeYear() === year && month === selectedMonth;
7733
- return isEndDateSelected;
7837
+ highlightSameDayNextYear() {
7838
+ this.setHighlightedDay(this.highlightedDay(), this.activeMonth(), this.activeYear() + 1);
7734
7839
  }
7735
- isMonthBetweenSelectedRange(month) {
7736
- if (!this.rangeSelectionMode())
7737
- return false;
7738
- if (month instanceof Date)
7739
- month = month.getMonth();
7740
- const selected = this.selectedDate();
7741
- const selectedEnd = this.selectedDateEnd();
7742
- if (selected === null || selectedEnd === null || selected >= selectedEnd)
7743
- return false;
7744
- return this._isMonthBetweenDates(month, selected, selectedEnd);
7840
+ highlightSameDayPreviousYear() {
7841
+ this.setHighlightedDay(this.highlightedDay(), this.activeMonth(), this.activeYear() - 1);
7745
7842
  }
7746
- isMonthBetweenSelectedHighlighted(month) {
7747
- if (!this.rangeSelectionMode() || this.selectedDateEnd())
7748
- return false;
7843
+ //! selecting months
7844
+ isMonthSelected(month) {
7749
7845
  if (month instanceof Date)
7750
7846
  month = month.getMonth();
7751
- const selected = this.selectedDate();
7752
- const highlightedEnd = this.highlightedMonthDate();
7753
- if (selected === null || highlightedEnd === null || selected >= highlightedEnd)
7754
- return false;
7755
- return this._isMonthBetweenDates(month, selected, highlightedEnd);
7756
- }
7757
- _isMonthBetweenDates(month, startDate, endDate) {
7758
- const { year: startYear, month: startMonth } = getDateComponents(startDate, this.UTC());
7759
- const { year: endYear, month: endMonth } = getDateComponents(endDate, this.UTC());
7760
- return startYear <= this.activeYear() && startMonth <= month && endYear >= this.activeYear() && endMonth >= month;
7847
+ return (this.selectionStart() !== null &&
7848
+ this.activeYear() === this.selectionStart()?.getFullYear() &&
7849
+ month === this.selectionStart()?.getMonth());
7761
7850
  }
7762
- isYearOutOfRange(year) {
7763
- return isYearOutOfRange(year, this.min(), this.max());
7851
+ isMonthOutOfRange(month, year = this.activeYear()) {
7852
+ return isMonthOutOfRange(month, year, this.min(), this.max());
7764
7853
  }
7765
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MonthsViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7766
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: MonthsViewComponent, isStandalone: false, selector: "ard-months-view", inputs: { tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: true, transformFunction: null }, _isUsingKeyboard: { classPropertyName: "_isUsingKeyboard", publicName: "_isUsingKeyboard", isSignal: true, isRequired: true, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: true, transformFunction: null }, activeYear: { classPropertyName: "activeYear", publicName: "activeYear", isSignal: true, isRequired: true, transformFunction: null }, activeMonth: { classPropertyName: "activeMonth", publicName: "activeMonth", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null }, selectedDateEnd: { classPropertyName: "selectedDateEnd", publicName: "selectedDateEnd", isSignal: true, isRequired: true, transformFunction: null }, rangeSelectionMode: { classPropertyName: "rangeSelectionMode", publicName: "rangeSelectionMode", isSignal: true, isRequired: true, transformFunction: null }, UTC: { classPropertyName: "UTC", publicName: "UTC", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, multiCalendarLocation: { classPropertyName: "multiCalendarLocation", publicName: "multiCalendarLocation", isSignal: true, isRequired: true, transformFunction: null }, highlightedMonth: { classPropertyName: "highlightedMonth", publicName: "highlightedMonth", isSignal: true, isRequired: true, transformFunction: null }, monthsViewHeaderTemplate: { classPropertyName: "monthsViewHeaderTemplate", publicName: "monthsViewHeaderTemplate", isSignal: true, isRequired: true, transformFunction: null }, monthTemplate: { classPropertyName: "monthTemplate", publicName: "monthTemplate", isSignal: true, isRequired: true, transformFunction: null }, monthsViewHeaderDateFormat: { classPropertyName: "monthsViewHeaderDateFormat", publicName: "monthsViewHeaderDateFormat", isSignal: true, isRequired: true, transformFunction: null }, monthDateFormat: { classPropertyName: "monthDateFormat", publicName: "monthDateFormat", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { triggerOpenYearsView: "triggerOpenYearsView", triggerOpenDaysView: "triggerOpenDaysView", focusEvent: "focus", blurEvent: "blur", triggerSelectMonth: "triggerSelectMonth", triggeChangeYear: "triggeChangeYear", triggerHighlightMonth: "triggerHighlightMonth", triggerHighlightNextMonth: "triggerHighlightNextMonth", triggerHighlightPreviousMonth: "triggerHighlightPreviousMonth", triggerHighlightFirstMonth: "triggerHighlightFirstMonth", triggerHighlightLastMonth: "triggerHighlightLastMonth", triggerHighlightSameMonthPreviousPage: "triggerHighlightSameMonthPreviousPage", triggerHighlightSameMonthNextPage: "triggerHighlightSameMonthNextPage" }, host: { listeners: { "mousemove": "onMouseMove()" } }, viewQueries: [{ propertyName: "focusableElement", first: true, predicate: ["focusableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ard-months-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultMonthsViewHeaderTemplate\r\n let-date=\"date\"\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openDaysView=\"openDaysView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [color]=\"color()\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n >\r\n {{ date | date : monthsViewHeaderDateFormat() }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthsViewHeaderTemplate() || defaultMonthsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"monthsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onMonthGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onMonthGridBlur()\"\r\n (click)=\"onMonthGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (month of monthsArray(); track $index) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedMonth() === month.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isMonthBetweenSelectedHighlighted(month.value)\"\r\n [class.ard-calendar__entry-disabled]=\"month.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isMonthSelected(month.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isMonthSelectedStart(month.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isMonthSelectedEnd(month.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isMonthBetweenSelectedRange(month.value)\"\r\n [class.ard-calendar-today]=\"isMonthToday(month.value)\"\r\n (click)=\"onCalendarMonthClick(month.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarMonthMouseover(month.value)\"\r\n role=\"gridcell\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"ard-calendar__entry-button\"\r\n tabindex=\"-1\"\r\n >\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultMonthTemplate\r\n let-month\r\n >\r\n {{ month | date : monthDateFormat() : '+0000' | uppercase }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthTemplate() || defaultMonthTemplate\"\r\n [ngTemplateOutletContext]=\"monthContext()(month.value)\"\r\n />\r\n </div>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-months-view{display:block}}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: ["wrapperClasses", "type", "ariaLabel", "color", "lightColoring", "compact", "pointerEventsWhenDisabled"] }, { kind: "component", type: ArdiumIconComponent, selector: "ard-icon", inputs: ["ariaLabel", "icon", "filled", "weight", "grade", "opticalSize"] }, { kind: "component", type: ArdiumButtonComponent, selector: "ard-button", inputs: ["variant", "vertical"], outputs: ["focus", "blur"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i1.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7767
- }
7768
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MonthsViewComponent, decorators: [{
7769
- type: Component,
7770
- args: [{ standalone: false, selector: 'ard-months-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ard-months-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultMonthsViewHeaderTemplate\r\n let-date=\"date\"\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openDaysView=\"openDaysView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [color]=\"color()\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n >\r\n {{ date | date : monthsViewHeaderDateFormat() }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthsViewHeaderTemplate() || defaultMonthsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"monthsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onMonthGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onMonthGridBlur()\"\r\n (click)=\"onMonthGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (month of monthsArray(); track $index) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedMonth() === month.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isMonthBetweenSelectedHighlighted(month.value)\"\r\n [class.ard-calendar__entry-disabled]=\"month.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isMonthSelected(month.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isMonthSelectedStart(month.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isMonthSelectedEnd(month.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isMonthBetweenSelectedRange(month.value)\"\r\n [class.ard-calendar-today]=\"isMonthToday(month.value)\"\r\n (click)=\"onCalendarMonthClick(month.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarMonthMouseover(month.value)\"\r\n role=\"gridcell\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"ard-calendar__entry-button\"\r\n tabindex=\"-1\"\r\n >\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultMonthTemplate\r\n let-month\r\n >\r\n {{ month | date : monthDateFormat() : '+0000' | uppercase }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthTemplate() || defaultMonthTemplate\"\r\n [ngTemplateOutletContext]=\"monthContext()(month.value)\"\r\n />\r\n </div>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-months-view{display:block}}\n"] }]
7771
- }], propDecorators: { onMouseMove: [{
7772
- type: HostListener,
7773
- args: ['mousemove']
7774
- }] } });
7775
-
7776
- const TODAY = new Date();
7777
- class YearsViewComponent {
7778
- constructor() {
7779
- this.tabIndex = input.required();
7780
- this.readOnly = input.required();
7781
- this.disabled = input.required();
7782
- this.autoFocus = input.required();
7783
- this._isUsingKeyboard = input.required();
7784
- this.selectedDate = input.required();
7785
- this.selectedDateEnd = input.required();
7786
- this.rangeSelectionMode = input.required();
7787
- this.UTC = input.required();
7788
- this.min = input.required();
7789
- this.max = input.required();
7790
- this.multiCalendarLocation = input.required();
7791
- this.currentYearRangeStart = input.required();
7792
- this.multipleYearPageSize = input.required();
7793
- this.yearsArray = computed(() => getCalendarYearsArray(this.currentYearRangeStart(), this.multipleYearPageSize(), this.min(), this.max()));
7794
- this.currentAriaLabel = computed(() => {
7795
- return this.highlightedYear()?.toString() ?? '';
7796
- });
7797
- //! outputs
7798
- this.triggerOpenMonthsView = output();
7799
- this.triggerOpenDaysView = output();
7800
- this.focusEvent = output({ alias: 'focus' });
7801
- this.blurEvent = output({ alias: 'blur' });
7802
- this.triggerSelectYear = output();
7803
- this.triggerChangeYearsViewPage = output();
7804
- this.triggerHighlightYear = output();
7805
- this.triggerHighlightNextYear = output();
7806
- this.triggerHighlightPreviousYear = output();
7807
- this.triggerHighlightFirstYear = output();
7808
- this.triggerHighlightLastYear = output();
7809
- this.triggerHighlightSameYearPreviousPage = output();
7810
- this.triggerHighlightSameYearNextPage = output();
7811
- //! calendar entry hover & click
7812
- this.highlightedYear = input.required();
7813
- this.highlightedYearDate = computed(() => {
7814
- const year = this.highlightedYear();
7815
- if (isNull(year))
7816
- return null;
7817
- return new Date(year, 0, 1);
7818
- });
7819
- //! focusing
7820
- this.focusableElement = viewChild.required('focusableElement');
7821
- //! templates
7822
- this.yearsViewHeaderTemplate = input.required();
7823
- this.yearTemplate = input.required();
7824
- //! template customizations
7825
- this.yearsViewHeaderDateFormat = input.required(); // 'YYYY'
7826
- this.yearDateFormat = input.required(); // 'YYYY'
7827
- //! template contexts
7828
- this.yearsViewHeaderContext = computed(() => {
7829
- const yearRangeStart = this.currentYearRangeStart();
7830
- const yearRangeEnd = yearRangeStart + 23;
7831
- const dateRange = new DateRange(getUTCDate(yearRangeStart, 0, 2), // second day of month to prevent timezone issues
7832
- getUTCDate(yearRangeEnd, 0, 2));
7833
- const yearRange = {
7834
- from: yearRangeStart,
7835
- to: yearRangeEnd,
7836
- };
7837
- return {
7838
- nextPage: () => {
7839
- this.triggerChangeYearsViewPage.emit(1);
7840
- },
7841
- prevPage: () => {
7842
- this.triggerChangeYearsViewPage.emit(-1);
7843
- },
7844
- openMonthsView: () => {
7845
- this.triggerOpenMonthsView.emit();
7846
- },
7847
- openDaysView: () => {
7848
- this.triggerOpenDaysView.emit();
7849
- },
7850
- canGoToNextPage: !this.isYearOutOfRange(yearRangeEnd + 1),
7851
- canGoToPreviousPage: !this.isYearOutOfRange(yearRangeStart - 1),
7852
- hideNextPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Left ||
7853
- this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
7854
- hidePreviousPageButton: this.multiCalendarLocation() === ArdMultiCalendarLocation.Right ||
7855
- this.multiCalendarLocation() === ArdMultiCalendarLocation.Inner,
7856
- yearRange: yearRange,
7857
- dateRange,
7858
- $implicit: dateRange,
7859
- };
7860
- });
7861
- this.yearContext = computed(() => {
7862
- return (year) => {
7863
- const date = getUTCDate(year, 1, 2); // second day of month to prevent timezone issues
7864
- return {
7865
- value: year,
7866
- date,
7867
- $implicit: date,
7868
- select: (year) => {
7869
- this.triggerSelectYear.emit(year);
7870
- },
7871
- };
7872
- };
7873
- });
7854
+ changeMonth(newMonth) {
7855
+ if (isNull(newMonth)) {
7856
+ this.activeMonth.set(this.TODAY().getMonth());
7857
+ this._emitActivePageChange();
7858
+ return true;
7859
+ }
7860
+ if (this.isMonthOutOfRange(newMonth))
7861
+ return false;
7862
+ if (newMonth > 11) {
7863
+ this.activeYear.update(v => v + 1);
7864
+ this.activeMonth.set(0);
7865
+ }
7866
+ else if (newMonth < 0) {
7867
+ this.activeYear.update(v => v - 1);
7868
+ this.activeMonth.set(11);
7869
+ }
7870
+ else {
7871
+ this.activeMonth.set(newMonth);
7872
+ }
7873
+ this._emitActivePageChange();
7874
+ return true;
7874
7875
  }
7875
- onMouseMove() {
7876
- if (this._isUsingKeyboard())
7876
+ selectMonth(newMonth) {
7877
+ if (isNull(newMonth) || this.isMonthOutOfRange(newMonth))
7877
7878
  return;
7878
- if (this.highlightedYear())
7879
- this.triggerHighlightYear.emit(null);
7880
- }
7881
- ngAfterViewInit() {
7882
- if (!this.autoFocus())
7879
+ const wasSuccessful = this.changeMonth(newMonth);
7880
+ if (!wasSuccessful)
7883
7881
  return;
7884
- this.focus();
7885
- this.triggerHighlightYear.emit(this.currentYearRangeStart());
7882
+ this.openDaysView();
7883
+ this.monthSelect.emit(newMonth);
7886
7884
  }
7887
- onCalendarYearMouseover(year) {
7888
- if (this._isUsingKeyboard() || this.disabled() || this.readOnly())
7885
+ selectCurrentlyHighlightedMonth() {
7886
+ if (!isDefined(this.highlightedMonth()))
7889
7887
  return;
7890
- this.triggerHighlightYear.emit(year);
7888
+ this.selectMonth(this.highlightedMonth());
7891
7889
  }
7892
- onCalendarYearClick(year) {
7893
- if (this.disabled() || this.readOnly())
7890
+ setHighlightedMonth(month, year = this.activeYear()) {
7891
+ if (isNull(month)) {
7892
+ this._highlightedMonth.update(() => month);
7894
7893
  return;
7895
- this.triggerSelectYear.emit(year);
7896
- }
7897
- onYearGridFocus() {
7898
- if (this.disabled() || this.readOnly())
7894
+ }
7895
+ const date = createDate(year, month, 15, this.UTC());
7896
+ const outOfRange = this.isMonthOutOfRange(month, year);
7897
+ if (outOfRange === -1) {
7898
+ this._highlightMinMonth();
7899
7899
  return;
7900
- this.triggerHighlightFirstYear.emit();
7901
- }
7902
- onYearGridBlur() {
7903
- if (this.disabled() || this.readOnly())
7900
+ }
7901
+ if (outOfRange === 1) {
7902
+ this._highlightMaxMonth();
7904
7903
  return;
7905
- this.triggerHighlightYear.emit(null);
7904
+ }
7905
+ this._highlightedMonth.update(() => date.getMonth());
7906
+ if (date.getFullYear() !== this.activeYear()) {
7907
+ this.activeYear.set(date.getFullYear());
7908
+ this._emitActivePageChange();
7909
+ }
7906
7910
  }
7907
- onYearGridClick() {
7908
- if (this.disabled() || this.readOnly())
7911
+ _highlightMinMonth() {
7912
+ const min = this.min();
7913
+ if (!isDefined(min))
7909
7914
  return;
7910
- if (this.highlightedYear() !== null)
7915
+ this.activeYear.set(min.getFullYear());
7916
+ this._emitActivePageChange();
7917
+ this._highlightedMonth.set(min.getMonth());
7918
+ }
7919
+ _highlightMaxMonth() {
7920
+ const max = this.max();
7921
+ if (!isDefined(max))
7911
7922
  return;
7912
- this.triggerHighlightFirstYear.emit();
7923
+ this.activeYear.set(max.getFullYear());
7924
+ this._emitActivePageChange();
7925
+ this._highlightedMonth.set(max.getMonth());
7913
7926
  }
7914
- //! helpers
7915
- isYearToday(year) {
7916
- return year === TODAY.getFullYear();
7927
+ highlightNextMonth(offset = 1) {
7928
+ const currentMonth = this.highlightedMonth();
7929
+ const newMonth = isDefined(currentMonth) ? currentMonth + offset : 0;
7930
+ this.setHighlightedMonth(newMonth);
7931
+ }
7932
+ highlightPreviousMonth(offset = 1) {
7933
+ this.highlightNextMonth(offset * -1);
7934
+ }
7935
+ highlightFirstMonth() {
7936
+ this.setHighlightedMonth(0);
7937
+ }
7938
+ highlightLastMonth() {
7939
+ this.setHighlightedMonth(11);
7940
+ }
7941
+ highlightSameMonthNextYear(multiple) {
7942
+ this.setHighlightedMonth(this.highlightedMonth(), this.activeYear() + (multiple ? 10 : 1));
7917
7943
  }
7918
- isYearSelected(year) {
7919
- if (year instanceof Date)
7920
- year = year.getFullYear();
7921
- const isStartDateSelected = this.isYearSelectedStart(year);
7922
- if (this.rangeSelectionMode()) {
7923
- const isEndDateSelected = this.isYearSelectedEnd(year);
7924
- return isStartDateSelected || isEndDateSelected;
7925
- }
7926
- return isStartDateSelected;
7944
+ highlightSameMonthPreviousYear(multiple) {
7945
+ this.setHighlightedMonth(this.highlightedMonth(), this.activeYear() - (multiple ? 10 : 1));
7927
7946
  }
7928
- isYearSelectedStart(year) {
7947
+ //! selecting years
7948
+ isYearSelected(year) {
7929
7949
  if (year instanceof Date)
7930
7950
  year = year.getFullYear();
7931
- const selected = this.selectedDate();
7932
- const { year: selectedYear } = getDateComponents(selected, this.UTC());
7933
- const isStartDateSelected = selected !== null && year === selectedYear;
7934
- return isStartDateSelected;
7951
+ return this.selectionStart() !== null && year === this.selectionStart()?.getFullYear();
7935
7952
  }
7936
- isYearSelectedEnd(year) {
7937
- if (year instanceof Date)
7938
- year = year.getFullYear();
7939
- const selected = this.selectedDateEnd();
7940
- const { year: selectedYear } = getDateComponents(selected, this.UTC());
7941
- const isEndDateSelected = selected !== null && year === selectedYear;
7942
- return isEndDateSelected;
7953
+ isYearOutOfRange(year) {
7954
+ return isYearOutOfRange(year, this.min(), this.max());
7943
7955
  }
7944
- isYearBetweenSelectedRange(year) {
7945
- if (!this.rangeSelectionMode())
7946
- return false;
7947
- if (year instanceof Date)
7948
- year = year.getFullYear();
7949
- const selected = this.selectedDate();
7950
- const selectedEnd = this.selectedDateEnd();
7951
- if (selected === null || selectedEnd === null || selected >= selectedEnd)
7956
+ changeYear(year) {
7957
+ if (isNull(year)) {
7958
+ this.activeYear.set(this.TODAY().getFullYear());
7959
+ this._emitActivePageChange();
7960
+ return true;
7961
+ }
7962
+ if (this.isYearOutOfRange(year))
7952
7963
  return false;
7953
- return this._isYearBetweenDates(year, selected, selectedEnd);
7964
+ this.activeYear.set(year);
7965
+ this._emitActivePageChange();
7966
+ return true;
7954
7967
  }
7955
- isYearBetweenSelectedHighlighted(year) {
7956
- if (!this.rangeSelectionMode() || this.selectedDateEnd())
7957
- return false;
7968
+ selectYear(year) {
7969
+ if (isNull(year))
7970
+ return;
7958
7971
  if (year instanceof Date)
7959
7972
  year = year.getFullYear();
7960
- const selected = this.selectedDate();
7961
- const highlightedEnd = this.highlightedYearDate();
7962
- if (selected === null || highlightedEnd === null || selected >= highlightedEnd)
7963
- return false;
7964
- return this._isYearBetweenDates(year, selected, highlightedEnd);
7973
+ const wasSuccessful = this.changeYear(year);
7974
+ if (!wasSuccessful)
7975
+ return;
7976
+ this.openMonthsView();
7977
+ this.yearSelect.emit(year);
7965
7978
  }
7966
- _isYearBetweenDates(year, startDate, endDate) {
7967
- const { year: startYear } = getDateComponents(startDate, this.UTC());
7968
- const { year: endYear } = getDateComponents(endDate, this.UTC());
7969
- return startYear <= year && endYear >= year;
7979
+ selectCurrentlyHighlightedYear() {
7980
+ if (!isDefined(this.highlightedYear()))
7981
+ return;
7982
+ this.selectYear(this.highlightedYear());
7970
7983
  }
7971
- isYearOutOfRange(year) {
7972
- return isYearOutOfRange(year, this.min(), this.max());
7984
+ setHighlightedYear(year) {
7985
+ if (isNull(year)) {
7986
+ this.__highlightedYear.update(() => year);
7987
+ return;
7988
+ }
7989
+ const date = createDate(year, 0, 1, this.UTC());
7990
+ const outOfRange = this.isYearOutOfRange(year);
7991
+ if (outOfRange === -1) {
7992
+ this._highlightMinYear();
7993
+ return;
7994
+ }
7995
+ if (outOfRange === 1) {
7996
+ this._highlightMaxYear();
7997
+ return;
7998
+ }
7999
+ const newYear = date.getFullYear();
8000
+ this.__highlightedYear.update(() => newYear);
8001
+ if (newYear < this.currentYearRangeStart() || newYear >= this.currentYearRangeStart() + this.multipleYearPageSize()) {
8002
+ // round the offset away from zero: 0.1 -> 1, -0.1 -> -1
8003
+ // this is to ensure the range start is always shifted by n years
8004
+ const offset = roundFromZero((newYear - this.currentYearRangeStart()) / this.multipleYearPageSize());
8005
+ this.currentYearRangeStart.update(v => v + offset * this.multipleYearPageSize());
8006
+ }
7973
8007
  }
7974
- focus() {
7975
- this.focusableElement().nativeElement.focus();
8008
+ changeYearsViewPage(offset) {
8009
+ const newYearRangeStart = this.currentYearRangeStart() + offset * this.multipleYearPageSize();
8010
+ this.currentYearRangeStart.set(newYearRangeStart);
7976
8011
  }
7977
- //! keyboard controls
7978
- onMainGridKeydown(event) {
7979
- if (this.disabled() || this.readOnly())
8012
+ _highlightMinYear() {
8013
+ const min = this.min();
8014
+ if (!isDefined(min))
7980
8015
  return;
7981
- switch (event.code) {
7982
- case 'Space':
7983
- case 'Enter':
7984
- this._onEnterPress(event);
7985
- break;
7986
- case 'ArrowUp':
7987
- this._onArrowUpPress(event);
7988
- break;
7989
- case 'ArrowDown':
7990
- this._onArrowDownPress(event);
7991
- break;
7992
- case 'ArrowLeft':
7993
- this._onArrowLeftPress(event);
7994
- break;
7995
- case 'ArrowRight':
7996
- this._onArrowRightPress(event);
7997
- break;
7998
- case 'Home':
7999
- this._onHomePress(event);
8000
- break;
8001
- case 'End':
8002
- this._onEndPress(event);
8003
- break;
8004
- case 'PageUp':
8005
- this._onPageUpPress(event);
8006
- break;
8007
- case 'PageDown':
8008
- this._onPageDownPress(event);
8009
- break;
8010
- default:
8011
- return;
8012
- }
8016
+ this.__highlightedYear.set(min.getFullYear());
8013
8017
  }
8014
- //select currently selected entry
8015
- _onEnterPress(event) {
8016
- event.preventDefault();
8017
- const year = this.highlightedYear();
8018
- if (isNull(year))
8018
+ _highlightMaxYear() {
8019
+ const max = this.max();
8020
+ if (!isDefined(max))
8019
8021
  return;
8020
- this.triggerSelectYear.emit(year);
8022
+ this.__highlightedYear.set(max.getFullYear());
8021
8023
  }
8022
- //highlight the entry one line below
8023
- _onArrowDownPress(event) {
8024
- event.preventDefault();
8025
- this.triggerHighlightNextYear.emit(4); //4 years per line
8024
+ highlightNextYear(offset = 1) {
8025
+ const currentYear = this.highlightedYear();
8026
+ const newYear = isDefined(currentYear) ? currentYear + offset : null;
8027
+ this.setHighlightedYear(newYear);
8026
8028
  }
8027
- //highlight the entry one line above
8028
- _onArrowUpPress(event) {
8029
- event.preventDefault();
8030
- this.triggerHighlightPreviousYear.emit(4); //4 years per line
8029
+ highlightPreviousYear(offset = 1) {
8030
+ this.highlightNextYear(offset * -1);
8031
8031
  }
8032
- //highlight next entry
8033
- _onArrowRightPress(event) {
8034
- event.preventDefault();
8035
- this.triggerHighlightNextYear.emit(1);
8032
+ highlightFirstYear() {
8033
+ this.setHighlightedYear(this.currentYearRangeStart());
8036
8034
  }
8037
- //highlight previous entry
8038
- _onArrowLeftPress(event) {
8039
- event.preventDefault();
8040
- this.triggerHighlightPreviousYear.emit(1);
8035
+ highlightLastYear() {
8036
+ this.setHighlightedYear(this.currentYearRangeStart() + this.multipleYearPageSize() - 1);
8041
8037
  }
8042
- //highlight first entry on the page
8043
- _onHomePress(event) {
8044
- event.preventDefault();
8045
- this.triggerHighlightFirstYear.emit();
8038
+ highlightSameYearNextPage(multiple) {
8039
+ const year = this.highlightedYear() ?? this.currentYearRangeStart();
8040
+ this.setHighlightedYear(year + (multiple ? this.multipleYearPageChangeModifier() : 1) * this.multipleYearPageSize());
8046
8041
  }
8047
- //highlight last entry on the page
8048
- _onEndPress(event) {
8049
- event.preventDefault();
8050
- this.triggerHighlightLastYear.emit();
8042
+ highlightSameYearPreviousPage(multiple) {
8043
+ const year = this.highlightedYear() ?? this.currentYearRangeStart();
8044
+ this.setHighlightedYear(year - (multiple ? this.multipleYearPageChangeModifier() : 1) * this.multipleYearPageSize());
8051
8045
  }
8052
- //alone: highlight same entry on the previous page
8053
- //with alt: highlight same entry multiple pages before
8054
- _onPageUpPress(event) {
8055
- event.preventDefault();
8056
- this.triggerHighlightSameYearPreviousPage.emit(event.altKey);
8046
+ onDocumentMousemove() {
8047
+ this._isUsingKeyboard.set(false);
8057
8048
  }
8058
- //alone: highlight same entry on the next page
8059
- //with alt: highlight same entry multiple pages after
8060
- _onPageDownPress(event) {
8061
- event.preventDefault();
8062
- this.triggerHighlightSameYearNextPage.emit(event.altKey);
8049
+ onDocumentKeydown() {
8050
+ this._isUsingKeyboard.set(true);
8063
8051
  }
8064
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: YearsViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8065
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: YearsViewComponent, isStandalone: false, selector: "ard-years-view", inputs: { tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: true, transformFunction: null }, _isUsingKeyboard: { classPropertyName: "_isUsingKeyboard", publicName: "_isUsingKeyboard", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null }, selectedDateEnd: { classPropertyName: "selectedDateEnd", publicName: "selectedDateEnd", isSignal: true, isRequired: true, transformFunction: null }, rangeSelectionMode: { classPropertyName: "rangeSelectionMode", publicName: "rangeSelectionMode", isSignal: true, isRequired: true, transformFunction: null }, UTC: { classPropertyName: "UTC", publicName: "UTC", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, multiCalendarLocation: { classPropertyName: "multiCalendarLocation", publicName: "multiCalendarLocation", isSignal: true, isRequired: true, transformFunction: null }, currentYearRangeStart: { classPropertyName: "currentYearRangeStart", publicName: "currentYearRangeStart", isSignal: true, isRequired: true, transformFunction: null }, multipleYearPageSize: { classPropertyName: "multipleYearPageSize", publicName: "multipleYearPageSize", isSignal: true, isRequired: true, transformFunction: null }, highlightedYear: { classPropertyName: "highlightedYear", publicName: "highlightedYear", isSignal: true, isRequired: true, transformFunction: null }, yearsViewHeaderTemplate: { classPropertyName: "yearsViewHeaderTemplate", publicName: "yearsViewHeaderTemplate", isSignal: true, isRequired: true, transformFunction: null }, yearTemplate: { classPropertyName: "yearTemplate", publicName: "yearTemplate", isSignal: true, isRequired: true, transformFunction: null }, yearsViewHeaderDateFormat: { classPropertyName: "yearsViewHeaderDateFormat", publicName: "yearsViewHeaderDateFormat", isSignal: true, isRequired: true, transformFunction: null }, yearDateFormat: { classPropertyName: "yearDateFormat", publicName: "yearDateFormat", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { triggerOpenMonthsView: "triggerOpenMonthsView", triggerOpenDaysView: "triggerOpenDaysView", focusEvent: "focus", blurEvent: "blur", triggerSelectYear: "triggerSelectYear", triggerChangeYearsViewPage: "triggerChangeYearsViewPage", triggerHighlightYear: "triggerHighlightYear", triggerHighlightNextYear: "triggerHighlightNextYear", triggerHighlightPreviousYear: "triggerHighlightPreviousYear", triggerHighlightFirstYear: "triggerHighlightFirstYear", triggerHighlightLastYear: "triggerHighlightLastYear", triggerHighlightSameYearPreviousPage: "triggerHighlightSameYearPreviousPage", triggerHighlightSameYearNextPage: "triggerHighlightSameYearNextPage" }, host: { listeners: { "mousemove": "onMouseMove()" } }, viewQueries: [{ propertyName: "focusableElement", first: true, predicate: ["focusableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ard-years-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultYearsViewHeaderTemplate\r\n let-dateRange=\"dateRange\"\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openDaysView=\"openDaysView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n >\r\n {{ dateRange.from | date : yearsViewHeaderDateFormat() }}\r\n &mdash;\r\n {{ dateRange.to | date : yearsViewHeaderDateFormat() }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearsViewHeaderTemplate() || defaultYearsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"yearsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onYearGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onYearGridBlur()\"\r\n (click)=\"onYearGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (year of yearsArray(); track year) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedYear() === year.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isYearBetweenSelectedHighlighted(year.value)\"\r\n [class.ard-calendar__entry-disabled]=\"year.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isYearSelected(year.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isYearSelectedStart(year.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isYearSelectedEnd(year.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isYearBetweenSelectedRange(year.value)\"\r\n [class.ard-calendar-today]=\"isYearToday(year.value)\"\r\n (click)=\"onCalendarYearClick(year.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarYearMouseover(year.value)\"\r\n role=\"gridcell\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"ard-calendar__entry-button\"\r\n tabindex=\"-1\"\r\n aria-hidden=\"true\"\r\n >\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultYearTemplate\r\n let-year\r\n >\r\n {{ year | date : yearDateFormat() }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearTemplate() || defaultYearTemplate\"\r\n [ngTemplateOutletContext]=\"yearContext()(year.value)\"\r\n />\r\n </div>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-years-view{display:block}}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: ["wrapperClasses", "type", "ariaLabel", "color", "lightColoring", "compact", "pointerEventsWhenDisabled"] }, { kind: "component", type: ArdiumIconComponent, selector: "ard-icon", inputs: ["ariaLabel", "icon", "filled", "weight", "grade", "opticalSize"] }, { kind: "component", type: ArdiumButtonComponent, selector: "ard-button", inputs: ["variant", "vertical"], outputs: ["focus", "blur"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8052
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: _AbstractCalendar, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
8053
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.15", type: _AbstractCalendar, isStandalone: true, inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, activeView: { classPropertyName: "activeView", publicName: "activeView", isSignal: true, isRequired: false, transformFunction: null }, activeYear: { classPropertyName: "activeYear", publicName: "activeYear", isSignal: true, isRequired: false, transformFunction: null }, activeMonth: { classPropertyName: "activeMonth", publicName: "activeMonth", isSignal: true, isRequired: false, transformFunction: null }, firstWeekday: { classPropertyName: "firstWeekday", publicName: "firstWeekday", isSignal: true, isRequired: false, transformFunction: null }, multipleYearPageChangeModifier: { classPropertyName: "multipleYearPageChangeModifier", publicName: "multipleYearPageChangeModifier", isSignal: true, isRequired: false, transformFunction: null }, multipleYearOffset: { classPropertyName: "multipleYearOffset", publicName: "multipleYearOffset", isSignal: true, isRequired: false, transformFunction: null }, multipleYearPageSize: { classPropertyName: "multipleYearPageSize", publicName: "multipleYearPageSize", isSignal: true, isRequired: false, transformFunction: null }, multiCalendarLocation: { classPropertyName: "multiCalendarLocation", publicName: "multiCalendarLocation", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, staticHeight: { classPropertyName: "staticHeight", publicName: "staticHeight", isSignal: true, isRequired: false, transformFunction: null }, hideFloatingMonth: { classPropertyName: "hideFloatingMonth", publicName: "hideFloatingMonth", 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 }, UTC: { classPropertyName: "UTC", publicName: "UTC", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, highlightedDay: { classPropertyName: "highlightedDay", publicName: "highlightedDay", isSignal: true, isRequired: false, transformFunction: null }, daysViewHeaderDateFormat: { classPropertyName: "daysViewHeaderDateFormat", publicName: "daysViewHeaderDateFormat", isSignal: true, isRequired: false, transformFunction: null }, yearsViewHeaderDateFormat: { classPropertyName: "yearsViewHeaderDateFormat", publicName: "yearsViewHeaderDateFormat", isSignal: true, isRequired: false, transformFunction: null }, monthsViewHeaderDateFormat: { classPropertyName: "monthsViewHeaderDateFormat", publicName: "monthsViewHeaderDateFormat", isSignal: true, isRequired: false, transformFunction: null }, weekdayDateFormat: { classPropertyName: "weekdayDateFormat", publicName: "weekdayDateFormat", isSignal: true, isRequired: false, transformFunction: null }, weekdayTitleDateFormat: { classPropertyName: "weekdayTitleDateFormat", publicName: "weekdayTitleDateFormat", isSignal: true, isRequired: false, transformFunction: null }, floatingMonthDateFormat: { classPropertyName: "floatingMonthDateFormat", publicName: "floatingMonthDateFormat", isSignal: true, isRequired: false, transformFunction: null }, floatingMonthTitleDateFormat: { classPropertyName: "floatingMonthTitleDateFormat", publicName: "floatingMonthTitleDateFormat", isSignal: true, isRequired: false, transformFunction: null }, yearDateFormat: { classPropertyName: "yearDateFormat", publicName: "yearDateFormat", isSignal: true, isRequired: false, transformFunction: null }, monthDateFormat: { classPropertyName: "monthDateFormat", publicName: "monthDateFormat", isSignal: true, isRequired: false, transformFunction: null }, dayDateFormat: { classPropertyName: "dayDateFormat", publicName: "dayDateFormat", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeView: "activeViewChange", activeYear: "activeYearChange", activeMonth: "activeMonthChange", activePageChange: "activePageChange", yearSelect: "yearSelect", monthSelect: "monthSelect", highlightedDay: "highlightedDayChange", highlightDayEvent: "highlightDay" }, host: { listeners: { "document:mousemove": "onDocumentMousemove()", "document:keydown": "onDocumentKeydown()" } }, queries: [{ propertyName: "templateRepository", first: true, predicate: _CalendarTemplateRepositoryDirective, descendants: true, isSignal: true }, { propertyName: "yearsViewHeaderTemplate", first: true, predicate: ArdCalendarYearsViewHeaderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "monthsViewHeaderTemplate", first: true, predicate: ArdCalendarMonthsViewHeaderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "daysViewHeaderTemplate", first: true, predicate: ArdCalendarDaysViewHeaderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "floatingMonthTemplate", first: true, predicate: ArdCalendarFloatingMonthTemplateDirective, descendants: true, isSignal: true }, { propertyName: "yearTemplate", first: true, predicate: ArdCalendarYearTemplateDirective, descendants: true, isSignal: true }, { propertyName: "monthTemplate", first: true, predicate: ArdCalendarMonthTemplateDirective, descendants: true, isSignal: true }, { propertyName: "dayTemplate", first: true, predicate: ArdCalendarDayTemplateDirective, descendants: true, isSignal: true }, { propertyName: "weekdayTemplate", first: true, predicate: ArdCalendarWeekdayTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "daysViewComponent", first: true, predicate: DaysViewComponent, descendants: true, isSignal: true }, { propertyName: "monthsViewComponent", first: true, predicate: MonthsViewComponent, descendants: true, isSignal: true }, { propertyName: "yearsViewComponent", first: true, predicate: YearsViewComponent, descendants: true, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
8066
8054
  }
8067
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: YearsViewComponent, decorators: [{
8068
- type: Component,
8069
- args: [{ standalone: false, selector: 'ard-years-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ard-years-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultYearsViewHeaderTemplate\r\n let-dateRange=\"dateRange\"\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-hideNextPageButton=\"hideNextPageButton\"\r\n let-hidePreviousPageButton=\"hidePreviousPageButton\"\r\n let-openDaysView=\"openDaysView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <div>\r\n @if (!hidePreviousPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n >\r\n {{ dateRange.from | date : yearsViewHeaderDateFormat() }}\r\n &mdash;\r\n {{ dateRange.to | date : yearsViewHeaderDateFormat() }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div>\r\n @if (!hideNextPageButton) {\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearsViewHeaderTemplate() || defaultYearsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"yearsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onYearGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onYearGridBlur()\"\r\n (click)=\"onYearGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (year of yearsArray(); track year) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedYear() === year.value\"\r\n [class.ard-calendar__entry-highlighted-in-range]=\"isYearBetweenSelectedHighlighted(year.value)\"\r\n [class.ard-calendar__entry-disabled]=\"year.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isYearSelected(year.value)\"\r\n [class.ard-calendar__entry-selected-start]=\"isYearSelectedStart(year.value)\"\r\n [class.ard-calendar__entry-selected-end]=\"isYearSelectedEnd(year.value)\"\r\n [class.ard-calendar__entry-selected-in-range]=\"isYearBetweenSelectedRange(year.value)\"\r\n [class.ard-calendar-today]=\"isYearToday(year.value)\"\r\n (click)=\"onCalendarYearClick(year.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarYearMouseover(year.value)\"\r\n role=\"gridcell\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"ard-calendar__entry-button\"\r\n tabindex=\"-1\"\r\n aria-hidden=\"true\"\r\n >\r\n <div class=\"ard-range-overlay\"></div>\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultYearTemplate\r\n let-year\r\n >\r\n {{ year | date : yearDateFormat() }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearTemplate() || defaultYearTemplate\"\r\n [ngTemplateOutletContext]=\"yearContext()(year.value)\"\r\n />\r\n </div>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: ["@layer ard-ui{ard-years-view{display:block}}\n"] }]
8070
- }], propDecorators: { onMouseMove: [{
8055
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: _AbstractCalendar, decorators: [{
8056
+ type: Directive,
8057
+ args: [{}]
8058
+ }], ctorParameters: () => [{ type: undefined }], propDecorators: { onDocumentMousemove: [{
8071
8059
  type: HostListener,
8072
- args: ['mousemove']
8060
+ args: ['document:mousemove']
8061
+ }], onDocumentKeydown: [{
8062
+ type: HostListener,
8063
+ args: ['document:keydown']
8073
8064
  }] } });
8074
8065
 
8066
+ const _calendarDefaults = {
8067
+ ..._formFieldComponentDefaults,
8068
+ color: ComponentColor.Primary,
8069
+ activeView: ArdCalendarView.Days,
8070
+ activeYear: new Date().getFullYear(),
8071
+ activeMonth: new Date().getMonth(),
8072
+ firstWeekday: 1,
8073
+ multipleYearPageChangeModifier: 5,
8074
+ multipleYearOffset: 2,
8075
+ multipleYearPageSize: 24,
8076
+ staticHeight: false,
8077
+ hideFloatingMonth: false,
8078
+ autoFocus: false,
8079
+ multiCalendarLocation: ArdMultiCalendarLocation.Only,
8080
+ min: null,
8081
+ max: null,
8082
+ filter: null,
8083
+ UTC: false,
8084
+ // template customizations
8085
+ daysViewHeaderDateFormat: 'MMM yyyy',
8086
+ yearsViewHeaderDateFormat: 'yyyy',
8087
+ monthsViewHeaderDateFormat: 'yyyy',
8088
+ weekdayDateFormat: 'EEEEE',
8089
+ weekdayTitleDateFormat: 'EEEE',
8090
+ floatingMonthDateFormat: 'LLL',
8091
+ floatingMonthTitleDateFormat: 'LLLL',
8092
+ yearDateFormat: 'yyyy',
8093
+ monthDateFormat: 'MMM',
8094
+ dayDateFormat: 'd',
8095
+ };
8096
+ const ARD_CALENDAR_DEFAULTS = new InjectionToken('ard-calendar-defaults', {
8097
+ factory: () => ({
8098
+ ..._calendarDefaults,
8099
+ }),
8100
+ });
8101
+ function provideCalendarDefaults(config) {
8102
+ return { provide: ARD_CALENDAR_DEFAULTS, useValue: { ..._calendarDefaults, ...config } };
8103
+ }
8104
+
8075
8105
  class ArdiumCalendarComponent extends _AbstractCalendar {
8076
8106
  constructor(defaults) {
8077
8107
  super(defaults);
@@ -8111,7 +8141,7 @@ class ArdiumCalendarComponent extends _AbstractCalendar {
8111
8141
  provide: ARD_FORM_FIELD_CONTROL,
8112
8142
  useExisting: ArdiumCalendarComponent,
8113
8143
  },
8114
- ], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"ard-calendar\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @switch (activeView()) { @case ('days') {\r\n <ard-days-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [staticHeight]=\"staticHeight()\"\r\n [highlightedDay]=\"highlightedDay()\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [hideFloatingMonth]=\"hideFloatingMonth()\"\r\n [isDayFilteredOut]=\"isDayFilteredOut()\"\r\n [daysViewHeaderTemplate]=\"daysViewHeaderTemplate()?.template ?? templateRepository()?.daysViewHeaderTmp()?.template\"\r\n [floatingMonthTemplate]=\"floatingMonthTemplate()?.template ?? templateRepository()?.floatingMonthTmp()?.template\"\r\n [weekdayTemplate]=\"weekdayTemplate()?.template ?? templateRepository()?.weekdayTmp()?.template\"\r\n [dayTemplate]=\"dayTemplate()?.template ?? templateRepository()?.dayTmp()?.template\"\r\n [daysViewHeaderDateFormat]=\"daysViewHeaderDateFormat()\"\r\n [weekdayDateFormat]=\"weekdayDateFormat()\"\r\n [weekdayTitleDateFormat]=\"weekdayTitleDateFormat()\"\r\n [floatingMonthDateFormat]=\"floatingMonthDateFormat()\"\r\n [floatingMonthTitleDateFormat]=\"floatingMonthTitleDateFormat()\"\r\n [dayDateFormat]=\"dayDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggerChangeMonth)=\"changeMonth($event)\"\r\n (triggerChangeYear)=\"changeYear($event)\"\r\n (triggerHighlightDay)=\"setHighlightedDay($event)\"\r\n (triggerHighlightFirstDay)=\"highlightFirstDay()\"\r\n (triggerHighlightLastDay)=\"highlightLastDay()\"\r\n (triggerHighlightNextDay)=\"highlightNextDay($event)\"\r\n (triggerHighlightPreviousDay)=\"highlightPreviousDay($event)\"\r\n (triggerHighlightSameDayNextPage)=\"$event ? highlightSameDayNextYear() : highlightSameDayNextMonth()\"\r\n (triggerHighlightSameDayPreviousPage)=\"$event ? highlightSameDayPreviousYear() : highlightSameDayPreviousMonth()\"\r\n (triggerSelectDay)=\"selectDay($event)\"\r\n />\r\n } @case ('months') {\r\n <ard-months-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [color]=\"color()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [highlightedMonth]=\"highlightedMonth()\"\r\n [monthsViewHeaderTemplate]=\"monthsViewHeaderTemplate()?.template ?? templateRepository()?.monthsViewHeaderTmp()?.template\"\r\n [monthTemplate]=\"monthTemplate()?.template ?? templateRepository()?.monthTmp()?.template\"\r\n [monthsViewHeaderDateFormat]=\"monthsViewHeaderDateFormat()\"\r\n [monthDateFormat]=\"monthDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggeChangeYear)=\"changeYear($event)\"\r\n (triggerSelectMonth)=\"selectMonth($event)\"\r\n (triggerHighlightMonth)=\"setHighlightedMonth($event)\"\r\n (triggerHighlightFirstMonth)=\"highlightFirstMonth()\"\r\n (triggerHighlightLastMonth)=\"highlightLastMonth()\"\r\n (triggerHighlightNextMonth)=\"highlightNextMonth($event)\"\r\n (triggerHighlightPreviousMonth)=\"highlightPreviousMonth($event)\"\r\n (triggerHighlightSameMonthNextPage)=\"highlightSameMonthNextYear($event)\"\r\n (triggerHighlightSameMonthPreviousPage)=\"highlightSameMonthPreviousYear($event)\"\r\n />\r\n } @case ('years') {\r\n <ard-years-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [highlightedYear]=\"highlightedYear()\"\r\n [currentYearRangeStart]=\"currentYearRangeStart()\"\r\n [multipleYearPageSize]=\"multipleYearPageSize()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [yearsViewHeaderTemplate]=\"yearsViewHeaderTemplate()?.template ?? templateRepository()?.yearsViewHeaderTmp()?.template\"\r\n [yearTemplate]=\"yearTemplate()?.template ?? templateRepository()?.yearTmp()?.template\"\r\n [yearsViewHeaderDateFormat]=\"yearsViewHeaderDateFormat()\"\r\n [yearDateFormat]=\"yearDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerSelectYear)=\"selectYear($event)\"\r\n (triggerChangeYearsViewPage)=\"changeYearsViewPage($event)\"\r\n (triggerHighlightYear)=\"setHighlightedYear($event)\"\r\n (triggerHighlightFirstYear)=\"highlightFirstYear()\"\r\n (triggerHighlightLastYear)=\"highlightLastYear()\"\r\n (triggerHighlightNextYear)=\"highlightNextYear($event)\"\r\n (triggerHighlightPreviousYear)=\"highlightPreviousYear($event)\"\r\n (triggerHighlightSameYearNextPage)=\"highlightSameYearNextPage($event)\"\r\n (triggerHighlightSameYearPreviousPage)=\"highlightSameYearPreviousPage($event)\"\r\n />\r\n } }\r\n</div>\r\n", styles: ["@layer ard-ui{ard-calendar,ard-range-calendar{display:block}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: DaysViewComponent, selector: "ard-days-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "activeYear", "activeMonth", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "isDayFilteredOut", "highlightedDay", "firstWeekday", "staticHeight", "hideFloatingMonth", "daysViewHeaderTemplate", "floatingMonthTemplate", "weekdayTemplate", "dayTemplate", "daysViewHeaderDateFormat", "weekdayDateFormat", "weekdayTitleDateFormat", "floatingMonthDateFormat", "floatingMonthTitleDateFormat", "dayDateFormat"], outputs: ["triggerOpenYearsView", "triggerOpenMonthsView", "triggerSelectDay", "triggerChangeMonth", "triggerChangeYear", "triggerHighlightDay", "triggerHighlightNextDay", "triggerHighlightPreviousDay", "triggerHighlightFirstDay", "triggerHighlightLastDay", "triggerHighlightSameDayPreviousPage", "triggerHighlightSameDayNextPage", "focus", "blur"] }, { kind: "component", type: MonthsViewComponent, selector: "ard-months-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "color", "activeYear", "activeMonth", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "highlightedMonth", "monthsViewHeaderTemplate", "monthTemplate", "monthsViewHeaderDateFormat", "monthDateFormat"], outputs: ["triggerOpenYearsView", "triggerOpenDaysView", "focus", "blur", "triggerSelectMonth", "triggeChangeYear", "triggerHighlightMonth", "triggerHighlightNextMonth", "triggerHighlightPreviousMonth", "triggerHighlightFirstMonth", "triggerHighlightLastMonth", "triggerHighlightSameMonthPreviousPage", "triggerHighlightSameMonthNextPage"] }, { kind: "component", type: YearsViewComponent, selector: "ard-years-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "currentYearRangeStart", "multipleYearPageSize", "highlightedYear", "yearsViewHeaderTemplate", "yearTemplate", "yearsViewHeaderDateFormat", "yearDateFormat"], outputs: ["triggerOpenMonthsView", "triggerOpenDaysView", "focus", "blur", "triggerSelectYear", "triggerChangeYearsViewPage", "triggerHighlightYear", "triggerHighlightNextYear", "triggerHighlightPreviousYear", "triggerHighlightFirstYear", "triggerHighlightLastYear", "triggerHighlightSameYearPreviousPage", "triggerHighlightSameYearNextPage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
8144
+ ], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"ard-calendar\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @switch (activeView()) { @case ('days') {\r\n <ard-days-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [staticHeight]=\"staticHeight()\"\r\n [highlightedDay]=\"highlightedDay()\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [hideFloatingMonth]=\"hideFloatingMonth()\"\r\n [isDayFilteredOut]=\"isDayFilteredOut()\"\r\n [daysViewHeaderTemplate]=\"daysViewHeaderTemplate()?.template ?? templateRepository()?.daysViewHeaderTmp()?.template\"\r\n [floatingMonthTemplate]=\"floatingMonthTemplate()?.template ?? templateRepository()?.floatingMonthTmp()?.template\"\r\n [weekdayTemplate]=\"weekdayTemplate()?.template ?? templateRepository()?.weekdayTmp()?.template\"\r\n [dayTemplate]=\"dayTemplate()?.template ?? templateRepository()?.dayTmp()?.template\"\r\n [daysViewHeaderDateFormat]=\"daysViewHeaderDateFormat()\"\r\n [weekdayDateFormat]=\"weekdayDateFormat()\"\r\n [weekdayTitleDateFormat]=\"weekdayTitleDateFormat()\"\r\n [floatingMonthDateFormat]=\"floatingMonthDateFormat()\"\r\n [floatingMonthTitleDateFormat]=\"floatingMonthTitleDateFormat()\"\r\n [dayDateFormat]=\"dayDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenMonthsView)=\"openMonthsView()\"\r\n (triggerOpenYearsView)=\"openYearsView()\"\r\n (triggerChangeMonth)=\"changeMonth($event)\"\r\n (triggerChangeYear)=\"changeYear($event)\"\r\n (triggerHighlightDay)=\"setHighlightedDay($event)\"\r\n (triggerHighlightFirstDay)=\"highlightFirstDay()\"\r\n (triggerHighlightLastDay)=\"highlightLastDay()\"\r\n (triggerHighlightNextDay)=\"highlightNextDay($event)\"\r\n (triggerHighlightPreviousDay)=\"highlightPreviousDay($event)\"\r\n (triggerHighlightSameDayNextPage)=\"$event ? highlightSameDayNextYear() : highlightSameDayNextMonth()\"\r\n (triggerHighlightSameDayPreviousPage)=\"$event ? highlightSameDayPreviousYear() : highlightSameDayPreviousMonth()\"\r\n (triggerSelectDay)=\"selectDay($event)\"\r\n />\r\n } @case ('months') {\r\n <ard-months-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [color]=\"color()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [highlightedMonth]=\"highlightedMonth()\"\r\n [monthsViewHeaderTemplate]=\"monthsViewHeaderTemplate()?.template ?? templateRepository()?.monthsViewHeaderTmp()?.template\"\r\n [monthTemplate]=\"monthTemplate()?.template ?? templateRepository()?.monthTmp()?.template\"\r\n [monthsViewHeaderDateFormat]=\"monthsViewHeaderDateFormat()\"\r\n [monthDateFormat]=\"monthDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"openDaysView()\"\r\n (triggerOpenYearsView)=\"openYearsView()\"\r\n (triggeChangeYear)=\"changeYear($event)\"\r\n (triggerSelectMonth)=\"selectMonth($event)\"\r\n (triggerHighlightMonth)=\"setHighlightedMonth($event)\"\r\n (triggerHighlightFirstMonth)=\"highlightFirstMonth()\"\r\n (triggerHighlightLastMonth)=\"highlightLastMonth()\"\r\n (triggerHighlightNextMonth)=\"highlightNextMonth($event)\"\r\n (triggerHighlightPreviousMonth)=\"highlightPreviousMonth($event)\"\r\n (triggerHighlightSameMonthNextPage)=\"highlightSameMonthNextYear($event)\"\r\n (triggerHighlightSameMonthPreviousPage)=\"highlightSameMonthPreviousYear($event)\"\r\n />\r\n } @case ('years') {\r\n <ard-years-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [highlightedYear]=\"highlightedYear()\"\r\n [currentYearRangeStart]=\"currentYearRangeStart()\"\r\n [multipleYearPageSize]=\"multipleYearPageSize()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [yearsViewHeaderTemplate]=\"yearsViewHeaderTemplate()?.template ?? templateRepository()?.yearsViewHeaderTmp()?.template\"\r\n [yearTemplate]=\"yearTemplate()?.template ?? templateRepository()?.yearTmp()?.template\"\r\n [yearsViewHeaderDateFormat]=\"yearsViewHeaderDateFormat()\"\r\n [yearDateFormat]=\"yearDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"openDaysView()\"\r\n (triggerOpenMonthsView)=\"openMonthsView()\"\r\n (triggerSelectYear)=\"selectYear($event)\"\r\n (triggerChangeYearsViewPage)=\"changeYearsViewPage($event)\"\r\n (triggerHighlightYear)=\"setHighlightedYear($event)\"\r\n (triggerHighlightFirstYear)=\"highlightFirstYear()\"\r\n (triggerHighlightLastYear)=\"highlightLastYear()\"\r\n (triggerHighlightNextYear)=\"highlightNextYear($event)\"\r\n (triggerHighlightPreviousYear)=\"highlightPreviousYear($event)\"\r\n (triggerHighlightSameYearNextPage)=\"highlightSameYearNextPage($event)\"\r\n (triggerHighlightSameYearPreviousPage)=\"highlightSameYearPreviousPage($event)\"\r\n />\r\n } }\r\n</div>\r\n", styles: ["@layer ard-ui{ard-calendar,ard-range-calendar{display:block}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: DaysViewComponent, selector: "ard-days-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "activeYear", "activeMonth", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "isDayFilteredOut", "highlightedDay", "firstWeekday", "staticHeight", "hideFloatingMonth", "daysViewHeaderTemplate", "floatingMonthTemplate", "weekdayTemplate", "dayTemplate", "daysViewHeaderDateFormat", "weekdayDateFormat", "weekdayTitleDateFormat", "floatingMonthDateFormat", "floatingMonthTitleDateFormat", "dayDateFormat"], outputs: ["triggerOpenYearsView", "triggerOpenMonthsView", "triggerSelectDay", "triggerChangeMonth", "triggerChangeYear", "triggerHighlightDay", "triggerHighlightNextDay", "triggerHighlightPreviousDay", "triggerHighlightFirstDay", "triggerHighlightLastDay", "triggerHighlightSameDayPreviousPage", "triggerHighlightSameDayNextPage", "focus", "blur"] }, { kind: "component", type: MonthsViewComponent, selector: "ard-months-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "color", "activeYear", "activeMonth", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "highlightedMonth", "monthsViewHeaderTemplate", "monthTemplate", "monthsViewHeaderDateFormat", "monthDateFormat"], outputs: ["triggerOpenYearsView", "triggerOpenDaysView", "focus", "blur", "triggerSelectMonth", "triggeChangeYear", "triggerHighlightMonth", "triggerHighlightNextMonth", "triggerHighlightPreviousMonth", "triggerHighlightFirstMonth", "triggerHighlightLastMonth", "triggerHighlightSameMonthPreviousPage", "triggerHighlightSameMonthNextPage"] }, { kind: "component", type: YearsViewComponent, selector: "ard-years-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "currentYearRangeStart", "multipleYearPageSize", "highlightedYear", "yearsViewHeaderTemplate", "yearTemplate", "yearsViewHeaderDateFormat", "yearDateFormat"], outputs: ["triggerOpenMonthsView", "triggerOpenDaysView", "focus", "blur", "triggerSelectYear", "triggerChangeYearsViewPage", "triggerHighlightYear", "triggerHighlightNextYear", "triggerHighlightPreviousYear", "triggerHighlightFirstYear", "triggerHighlightLastYear", "triggerHighlightSameYearPreviousPage", "triggerHighlightSameYearNextPage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
8115
8145
  }
8116
8146
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumCalendarComponent, decorators: [{
8117
8147
  type: Component,
@@ -8125,7 +8155,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
8125
8155
  provide: ARD_FORM_FIELD_CONTROL,
8126
8156
  useExisting: ArdiumCalendarComponent,
8127
8157
  },
8128
- ], template: "<div\r\n class=\"ard-calendar\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @switch (activeView()) { @case ('days') {\r\n <ard-days-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [staticHeight]=\"staticHeight()\"\r\n [highlightedDay]=\"highlightedDay()\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [hideFloatingMonth]=\"hideFloatingMonth()\"\r\n [isDayFilteredOut]=\"isDayFilteredOut()\"\r\n [daysViewHeaderTemplate]=\"daysViewHeaderTemplate()?.template ?? templateRepository()?.daysViewHeaderTmp()?.template\"\r\n [floatingMonthTemplate]=\"floatingMonthTemplate()?.template ?? templateRepository()?.floatingMonthTmp()?.template\"\r\n [weekdayTemplate]=\"weekdayTemplate()?.template ?? templateRepository()?.weekdayTmp()?.template\"\r\n [dayTemplate]=\"dayTemplate()?.template ?? templateRepository()?.dayTmp()?.template\"\r\n [daysViewHeaderDateFormat]=\"daysViewHeaderDateFormat()\"\r\n [weekdayDateFormat]=\"weekdayDateFormat()\"\r\n [weekdayTitleDateFormat]=\"weekdayTitleDateFormat()\"\r\n [floatingMonthDateFormat]=\"floatingMonthDateFormat()\"\r\n [floatingMonthTitleDateFormat]=\"floatingMonthTitleDateFormat()\"\r\n [dayDateFormat]=\"dayDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggerChangeMonth)=\"changeMonth($event)\"\r\n (triggerChangeYear)=\"changeYear($event)\"\r\n (triggerHighlightDay)=\"setHighlightedDay($event)\"\r\n (triggerHighlightFirstDay)=\"highlightFirstDay()\"\r\n (triggerHighlightLastDay)=\"highlightLastDay()\"\r\n (triggerHighlightNextDay)=\"highlightNextDay($event)\"\r\n (triggerHighlightPreviousDay)=\"highlightPreviousDay($event)\"\r\n (triggerHighlightSameDayNextPage)=\"$event ? highlightSameDayNextYear() : highlightSameDayNextMonth()\"\r\n (triggerHighlightSameDayPreviousPage)=\"$event ? highlightSameDayPreviousYear() : highlightSameDayPreviousMonth()\"\r\n (triggerSelectDay)=\"selectDay($event)\"\r\n />\r\n } @case ('months') {\r\n <ard-months-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [color]=\"color()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [highlightedMonth]=\"highlightedMonth()\"\r\n [monthsViewHeaderTemplate]=\"monthsViewHeaderTemplate()?.template ?? templateRepository()?.monthsViewHeaderTmp()?.template\"\r\n [monthTemplate]=\"monthTemplate()?.template ?? templateRepository()?.monthTmp()?.template\"\r\n [monthsViewHeaderDateFormat]=\"monthsViewHeaderDateFormat()\"\r\n [monthDateFormat]=\"monthDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggeChangeYear)=\"changeYear($event)\"\r\n (triggerSelectMonth)=\"selectMonth($event)\"\r\n (triggerHighlightMonth)=\"setHighlightedMonth($event)\"\r\n (triggerHighlightFirstMonth)=\"highlightFirstMonth()\"\r\n (triggerHighlightLastMonth)=\"highlightLastMonth()\"\r\n (triggerHighlightNextMonth)=\"highlightNextMonth($event)\"\r\n (triggerHighlightPreviousMonth)=\"highlightPreviousMonth($event)\"\r\n (triggerHighlightSameMonthNextPage)=\"highlightSameMonthNextYear($event)\"\r\n (triggerHighlightSameMonthPreviousPage)=\"highlightSameMonthPreviousYear($event)\"\r\n />\r\n } @case ('years') {\r\n <ard-years-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [highlightedYear]=\"highlightedYear()\"\r\n [currentYearRangeStart]=\"currentYearRangeStart()\"\r\n [multipleYearPageSize]=\"multipleYearPageSize()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [yearsViewHeaderTemplate]=\"yearsViewHeaderTemplate()?.template ?? templateRepository()?.yearsViewHeaderTmp()?.template\"\r\n [yearTemplate]=\"yearTemplate()?.template ?? templateRepository()?.yearTmp()?.template\"\r\n [yearsViewHeaderDateFormat]=\"yearsViewHeaderDateFormat()\"\r\n [yearDateFormat]=\"yearDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerSelectYear)=\"selectYear($event)\"\r\n (triggerChangeYearsViewPage)=\"changeYearsViewPage($event)\"\r\n (triggerHighlightYear)=\"setHighlightedYear($event)\"\r\n (triggerHighlightFirstYear)=\"highlightFirstYear()\"\r\n (triggerHighlightLastYear)=\"highlightLastYear()\"\r\n (triggerHighlightNextYear)=\"highlightNextYear($event)\"\r\n (triggerHighlightPreviousYear)=\"highlightPreviousYear($event)\"\r\n (triggerHighlightSameYearNextPage)=\"highlightSameYearNextPage($event)\"\r\n (triggerHighlightSameYearPreviousPage)=\"highlightSameYearPreviousPage($event)\"\r\n />\r\n } }\r\n</div>\r\n", styles: ["@layer ard-ui{ard-calendar,ard-range-calendar{display:block}}\n"] }]
8158
+ ], template: "<div\r\n class=\"ard-calendar\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @switch (activeView()) { @case ('days') {\r\n <ard-days-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [staticHeight]=\"staticHeight()\"\r\n [highlightedDay]=\"highlightedDay()\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [hideFloatingMonth]=\"hideFloatingMonth()\"\r\n [isDayFilteredOut]=\"isDayFilteredOut()\"\r\n [daysViewHeaderTemplate]=\"daysViewHeaderTemplate()?.template ?? templateRepository()?.daysViewHeaderTmp()?.template\"\r\n [floatingMonthTemplate]=\"floatingMonthTemplate()?.template ?? templateRepository()?.floatingMonthTmp()?.template\"\r\n [weekdayTemplate]=\"weekdayTemplate()?.template ?? templateRepository()?.weekdayTmp()?.template\"\r\n [dayTemplate]=\"dayTemplate()?.template ?? templateRepository()?.dayTmp()?.template\"\r\n [daysViewHeaderDateFormat]=\"daysViewHeaderDateFormat()\"\r\n [weekdayDateFormat]=\"weekdayDateFormat()\"\r\n [weekdayTitleDateFormat]=\"weekdayTitleDateFormat()\"\r\n [floatingMonthDateFormat]=\"floatingMonthDateFormat()\"\r\n [floatingMonthTitleDateFormat]=\"floatingMonthTitleDateFormat()\"\r\n [dayDateFormat]=\"dayDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenMonthsView)=\"openMonthsView()\"\r\n (triggerOpenYearsView)=\"openYearsView()\"\r\n (triggerChangeMonth)=\"changeMonth($event)\"\r\n (triggerChangeYear)=\"changeYear($event)\"\r\n (triggerHighlightDay)=\"setHighlightedDay($event)\"\r\n (triggerHighlightFirstDay)=\"highlightFirstDay()\"\r\n (triggerHighlightLastDay)=\"highlightLastDay()\"\r\n (triggerHighlightNextDay)=\"highlightNextDay($event)\"\r\n (triggerHighlightPreviousDay)=\"highlightPreviousDay($event)\"\r\n (triggerHighlightSameDayNextPage)=\"$event ? highlightSameDayNextYear() : highlightSameDayNextMonth()\"\r\n (triggerHighlightSameDayPreviousPage)=\"$event ? highlightSameDayPreviousYear() : highlightSameDayPreviousMonth()\"\r\n (triggerSelectDay)=\"selectDay($event)\"\r\n />\r\n } @case ('months') {\r\n <ard-months-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [color]=\"color()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [highlightedMonth]=\"highlightedMonth()\"\r\n [monthsViewHeaderTemplate]=\"monthsViewHeaderTemplate()?.template ?? templateRepository()?.monthsViewHeaderTmp()?.template\"\r\n [monthTemplate]=\"monthTemplate()?.template ?? templateRepository()?.monthTmp()?.template\"\r\n [monthsViewHeaderDateFormat]=\"monthsViewHeaderDateFormat()\"\r\n [monthDateFormat]=\"monthDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"openDaysView()\"\r\n (triggerOpenYearsView)=\"openYearsView()\"\r\n (triggeChangeYear)=\"changeYear($event)\"\r\n (triggerSelectMonth)=\"selectMonth($event)\"\r\n (triggerHighlightMonth)=\"setHighlightedMonth($event)\"\r\n (triggerHighlightFirstMonth)=\"highlightFirstMonth()\"\r\n (triggerHighlightLastMonth)=\"highlightLastMonth()\"\r\n (triggerHighlightNextMonth)=\"highlightNextMonth($event)\"\r\n (triggerHighlightPreviousMonth)=\"highlightPreviousMonth($event)\"\r\n (triggerHighlightSameMonthNextPage)=\"highlightSameMonthNextYear($event)\"\r\n (triggerHighlightSameMonthPreviousPage)=\"highlightSameMonthPreviousYear($event)\"\r\n />\r\n } @case ('years') {\r\n <ard-years-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [highlightedYear]=\"highlightedYear()\"\r\n [currentYearRangeStart]=\"currentYearRangeStart()\"\r\n [multipleYearPageSize]=\"multipleYearPageSize()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [yearsViewHeaderTemplate]=\"yearsViewHeaderTemplate()?.template ?? templateRepository()?.yearsViewHeaderTmp()?.template\"\r\n [yearTemplate]=\"yearTemplate()?.template ?? templateRepository()?.yearTmp()?.template\"\r\n [yearsViewHeaderDateFormat]=\"yearsViewHeaderDateFormat()\"\r\n [yearDateFormat]=\"yearDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"openDaysView()\"\r\n (triggerOpenMonthsView)=\"openMonthsView()\"\r\n (triggerSelectYear)=\"selectYear($event)\"\r\n (triggerChangeYearsViewPage)=\"changeYearsViewPage($event)\"\r\n (triggerHighlightYear)=\"setHighlightedYear($event)\"\r\n (triggerHighlightFirstYear)=\"highlightFirstYear()\"\r\n (triggerHighlightLastYear)=\"highlightLastYear()\"\r\n (triggerHighlightNextYear)=\"highlightNextYear($event)\"\r\n (triggerHighlightPreviousYear)=\"highlightPreviousYear($event)\"\r\n (triggerHighlightSameYearNextPage)=\"highlightSameYearNextPage($event)\"\r\n (triggerHighlightSameYearPreviousPage)=\"highlightSameYearPreviousPage($event)\"\r\n />\r\n } }\r\n</div>\r\n", styles: ["@layer ard-ui{ard-calendar,ard-range-calendar{display:block}}\n"] }]
8129
8159
  }], ctorParameters: () => [{ type: undefined, decorators: [{
8130
8160
  type: Inject,
8131
8161
  args: [ARD_CALENDAR_DEFAULTS]
@@ -8270,7 +8300,7 @@ class ArdiumRangeCalendarComponent extends _AbstractCalendar {
8270
8300
  provide: ARD_FORM_FIELD_CONTROL,
8271
8301
  useExisting: ArdiumRangeCalendarComponent,
8272
8302
  },
8273
- ], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"ard-calendar\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @switch (activeView()) { @case ('days') {\r\n <ard-days-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [staticHeight]=\"staticHeight()\"\r\n [highlightedDay]=\"highlightedDay()\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [hideFloatingMonth]=\"hideFloatingMonth()\"\r\n [isDayFilteredOut]=\"isDayFilteredOut()\"\r\n [daysViewHeaderTemplate]=\"daysViewHeaderTemplate()?.template ?? templateRepository()?.daysViewHeaderTmp()?.template\"\r\n [floatingMonthTemplate]=\"floatingMonthTemplate()?.template ?? templateRepository()?.floatingMonthTmp()?.template\"\r\n [weekdayTemplate]=\"weekdayTemplate()?.template ?? templateRepository()?.weekdayTmp()?.template\"\r\n [dayTemplate]=\"dayTemplate()?.template ?? templateRepository()?.dayTmp()?.template\"\r\n [daysViewHeaderDateFormat]=\"daysViewHeaderDateFormat()\"\r\n [weekdayDateFormat]=\"weekdayDateFormat()\"\r\n [weekdayTitleDateFormat]=\"weekdayTitleDateFormat()\"\r\n [floatingMonthDateFormat]=\"floatingMonthDateFormat()\"\r\n [floatingMonthTitleDateFormat]=\"floatingMonthTitleDateFormat()\"\r\n [dayDateFormat]=\"dayDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggerChangeMonth)=\"changeMonth($event)\"\r\n (triggerChangeYear)=\"changeYear($event)\"\r\n (triggerHighlightDay)=\"setHighlightedDay($event)\"\r\n (triggerHighlightFirstDay)=\"highlightFirstDay()\"\r\n (triggerHighlightLastDay)=\"highlightLastDay()\"\r\n (triggerHighlightNextDay)=\"highlightNextDay($event)\"\r\n (triggerHighlightPreviousDay)=\"highlightPreviousDay($event)\"\r\n (triggerHighlightSameDayNextPage)=\"$event ? highlightSameDayNextYear() : highlightSameDayNextMonth()\"\r\n (triggerHighlightSameDayPreviousPage)=\"$event ? highlightSameDayPreviousYear() : highlightSameDayPreviousMonth()\"\r\n (triggerSelectDay)=\"selectDay($event)\"\r\n />\r\n } @case ('months') {\r\n <ard-months-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [color]=\"color()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [highlightedMonth]=\"highlightedMonth()\"\r\n [monthsViewHeaderTemplate]=\"monthsViewHeaderTemplate()?.template ?? templateRepository()?.monthsViewHeaderTmp()?.template\"\r\n [monthTemplate]=\"monthTemplate()?.template ?? templateRepository()?.monthTmp()?.template\"\r\n [monthsViewHeaderDateFormat]=\"monthsViewHeaderDateFormat()\"\r\n [monthDateFormat]=\"monthDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggeChangeYear)=\"changeYear($event)\"\r\n (triggerSelectMonth)=\"selectMonth($event)\"\r\n (triggerHighlightMonth)=\"setHighlightedMonth($event)\"\r\n (triggerHighlightFirstMonth)=\"highlightFirstMonth()\"\r\n (triggerHighlightLastMonth)=\"highlightLastMonth()\"\r\n (triggerHighlightNextMonth)=\"highlightNextMonth($event)\"\r\n (triggerHighlightPreviousMonth)=\"highlightPreviousMonth($event)\"\r\n (triggerHighlightSameMonthNextPage)=\"highlightSameMonthNextYear($event)\"\r\n (triggerHighlightSameMonthPreviousPage)=\"highlightSameMonthPreviousYear($event)\"\r\n />\r\n } @case ('years') {\r\n <ard-years-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [highlightedYear]=\"highlightedYear()\"\r\n [currentYearRangeStart]=\"currentYearRangeStart()\"\r\n [multipleYearPageSize]=\"multipleYearPageSize()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [yearsViewHeaderTemplate]=\"yearsViewHeaderTemplate()?.template ?? templateRepository()?.yearsViewHeaderTmp()?.template\"\r\n [yearTemplate]=\"yearTemplate()?.template ?? templateRepository()?.yearTmp()?.template\"\r\n [yearsViewHeaderDateFormat]=\"yearsViewHeaderDateFormat()\"\r\n [yearDateFormat]=\"yearDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerSelectYear)=\"selectYear($event)\"\r\n (triggerChangeYearsViewPage)=\"changeYearsViewPage($event)\"\r\n (triggerHighlightYear)=\"setHighlightedYear($event)\"\r\n (triggerHighlightFirstYear)=\"highlightFirstYear()\"\r\n (triggerHighlightLastYear)=\"highlightLastYear()\"\r\n (triggerHighlightNextYear)=\"highlightNextYear($event)\"\r\n (triggerHighlightPreviousYear)=\"highlightPreviousYear($event)\"\r\n (triggerHighlightSameYearNextPage)=\"highlightSameYearNextPage($event)\"\r\n (triggerHighlightSameYearPreviousPage)=\"highlightSameYearPreviousPage($event)\"\r\n />\r\n } }\r\n</div>\r\n", styles: ["@layer ard-ui{ard-calendar,ard-range-calendar{display:block}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: DaysViewComponent, selector: "ard-days-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "activeYear", "activeMonth", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "isDayFilteredOut", "highlightedDay", "firstWeekday", "staticHeight", "hideFloatingMonth", "daysViewHeaderTemplate", "floatingMonthTemplate", "weekdayTemplate", "dayTemplate", "daysViewHeaderDateFormat", "weekdayDateFormat", "weekdayTitleDateFormat", "floatingMonthDateFormat", "floatingMonthTitleDateFormat", "dayDateFormat"], outputs: ["triggerOpenYearsView", "triggerOpenMonthsView", "triggerSelectDay", "triggerChangeMonth", "triggerChangeYear", "triggerHighlightDay", "triggerHighlightNextDay", "triggerHighlightPreviousDay", "triggerHighlightFirstDay", "triggerHighlightLastDay", "triggerHighlightSameDayPreviousPage", "triggerHighlightSameDayNextPage", "focus", "blur"] }, { kind: "component", type: MonthsViewComponent, selector: "ard-months-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "color", "activeYear", "activeMonth", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "highlightedMonth", "monthsViewHeaderTemplate", "monthTemplate", "monthsViewHeaderDateFormat", "monthDateFormat"], outputs: ["triggerOpenYearsView", "triggerOpenDaysView", "focus", "blur", "triggerSelectMonth", "triggeChangeYear", "triggerHighlightMonth", "triggerHighlightNextMonth", "triggerHighlightPreviousMonth", "triggerHighlightFirstMonth", "triggerHighlightLastMonth", "triggerHighlightSameMonthPreviousPage", "triggerHighlightSameMonthNextPage"] }, { kind: "component", type: YearsViewComponent, selector: "ard-years-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "currentYearRangeStart", "multipleYearPageSize", "highlightedYear", "yearsViewHeaderTemplate", "yearTemplate", "yearsViewHeaderDateFormat", "yearDateFormat"], outputs: ["triggerOpenMonthsView", "triggerOpenDaysView", "focus", "blur", "triggerSelectYear", "triggerChangeYearsViewPage", "triggerHighlightYear", "triggerHighlightNextYear", "triggerHighlightPreviousYear", "triggerHighlightFirstYear", "triggerHighlightLastYear", "triggerHighlightSameYearPreviousPage", "triggerHighlightSameYearNextPage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
8303
+ ], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"ard-calendar\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @switch (activeView()) { @case ('days') {\r\n <ard-days-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [staticHeight]=\"staticHeight()\"\r\n [highlightedDay]=\"highlightedDay()\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [hideFloatingMonth]=\"hideFloatingMonth()\"\r\n [isDayFilteredOut]=\"isDayFilteredOut()\"\r\n [daysViewHeaderTemplate]=\"daysViewHeaderTemplate()?.template ?? templateRepository()?.daysViewHeaderTmp()?.template\"\r\n [floatingMonthTemplate]=\"floatingMonthTemplate()?.template ?? templateRepository()?.floatingMonthTmp()?.template\"\r\n [weekdayTemplate]=\"weekdayTemplate()?.template ?? templateRepository()?.weekdayTmp()?.template\"\r\n [dayTemplate]=\"dayTemplate()?.template ?? templateRepository()?.dayTmp()?.template\"\r\n [daysViewHeaderDateFormat]=\"daysViewHeaderDateFormat()\"\r\n [weekdayDateFormat]=\"weekdayDateFormat()\"\r\n [weekdayTitleDateFormat]=\"weekdayTitleDateFormat()\"\r\n [floatingMonthDateFormat]=\"floatingMonthDateFormat()\"\r\n [floatingMonthTitleDateFormat]=\"floatingMonthTitleDateFormat()\"\r\n [dayDateFormat]=\"dayDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenMonthsView)=\"openMonthsView()\"\r\n (triggerOpenYearsView)=\"openYearsView()\"\r\n (triggerChangeMonth)=\"changeMonth($event)\"\r\n (triggerChangeYear)=\"changeYear($event)\"\r\n (triggerHighlightDay)=\"setHighlightedDay($event)\"\r\n (triggerHighlightFirstDay)=\"highlightFirstDay()\"\r\n (triggerHighlightLastDay)=\"highlightLastDay()\"\r\n (triggerHighlightNextDay)=\"highlightNextDay($event)\"\r\n (triggerHighlightPreviousDay)=\"highlightPreviousDay($event)\"\r\n (triggerHighlightSameDayNextPage)=\"$event ? highlightSameDayNextYear() : highlightSameDayNextMonth()\"\r\n (triggerHighlightSameDayPreviousPage)=\"$event ? highlightSameDayPreviousYear() : highlightSameDayPreviousMonth()\"\r\n (triggerSelectDay)=\"selectDay($event)\"\r\n />\r\n } @case ('months') {\r\n <ard-months-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [color]=\"color()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [highlightedMonth]=\"highlightedMonth()\"\r\n [monthsViewHeaderTemplate]=\"monthsViewHeaderTemplate()?.template ?? templateRepository()?.monthsViewHeaderTmp()?.template\"\r\n [monthTemplate]=\"monthTemplate()?.template ?? templateRepository()?.monthTmp()?.template\"\r\n [monthsViewHeaderDateFormat]=\"monthsViewHeaderDateFormat()\"\r\n [monthDateFormat]=\"monthDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"openDaysView()\"\r\n (triggerOpenYearsView)=\"openYearsView()\"\r\n (triggeChangeYear)=\"changeYear($event)\"\r\n (triggerSelectMonth)=\"selectMonth($event)\"\r\n (triggerHighlightMonth)=\"setHighlightedMonth($event)\"\r\n (triggerHighlightFirstMonth)=\"highlightFirstMonth()\"\r\n (triggerHighlightLastMonth)=\"highlightLastMonth()\"\r\n (triggerHighlightNextMonth)=\"highlightNextMonth($event)\"\r\n (triggerHighlightPreviousMonth)=\"highlightPreviousMonth($event)\"\r\n (triggerHighlightSameMonthNextPage)=\"highlightSameMonthNextYear($event)\"\r\n (triggerHighlightSameMonthPreviousPage)=\"highlightSameMonthPreviousYear($event)\"\r\n />\r\n } @case ('years') {\r\n <ard-years-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [highlightedYear]=\"highlightedYear()\"\r\n [currentYearRangeStart]=\"currentYearRangeStart()\"\r\n [multipleYearPageSize]=\"multipleYearPageSize()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [yearsViewHeaderTemplate]=\"yearsViewHeaderTemplate()?.template ?? templateRepository()?.yearsViewHeaderTmp()?.template\"\r\n [yearTemplate]=\"yearTemplate()?.template ?? templateRepository()?.yearTmp()?.template\"\r\n [yearsViewHeaderDateFormat]=\"yearsViewHeaderDateFormat()\"\r\n [yearDateFormat]=\"yearDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"openDaysView()\"\r\n (triggerOpenMonthsView)=\"openMonthsView()\"\r\n (triggerSelectYear)=\"selectYear($event)\"\r\n (triggerChangeYearsViewPage)=\"changeYearsViewPage($event)\"\r\n (triggerHighlightYear)=\"setHighlightedYear($event)\"\r\n (triggerHighlightFirstYear)=\"highlightFirstYear()\"\r\n (triggerHighlightLastYear)=\"highlightLastYear()\"\r\n (triggerHighlightNextYear)=\"highlightNextYear($event)\"\r\n (triggerHighlightPreviousYear)=\"highlightPreviousYear($event)\"\r\n (triggerHighlightSameYearNextPage)=\"highlightSameYearNextPage($event)\"\r\n (triggerHighlightSameYearPreviousPage)=\"highlightSameYearPreviousPage($event)\"\r\n />\r\n } }\r\n</div>\r\n", styles: ["@layer ard-ui{ard-calendar,ard-range-calendar{display:block}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: DaysViewComponent, selector: "ard-days-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "activeYear", "activeMonth", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "isDayFilteredOut", "highlightedDay", "firstWeekday", "staticHeight", "hideFloatingMonth", "daysViewHeaderTemplate", "floatingMonthTemplate", "weekdayTemplate", "dayTemplate", "daysViewHeaderDateFormat", "weekdayDateFormat", "weekdayTitleDateFormat", "floatingMonthDateFormat", "floatingMonthTitleDateFormat", "dayDateFormat"], outputs: ["triggerOpenYearsView", "triggerOpenMonthsView", "triggerSelectDay", "triggerChangeMonth", "triggerChangeYear", "triggerHighlightDay", "triggerHighlightNextDay", "triggerHighlightPreviousDay", "triggerHighlightFirstDay", "triggerHighlightLastDay", "triggerHighlightSameDayPreviousPage", "triggerHighlightSameDayNextPage", "focus", "blur"] }, { kind: "component", type: MonthsViewComponent, selector: "ard-months-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "color", "activeYear", "activeMonth", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "highlightedMonth", "monthsViewHeaderTemplate", "monthTemplate", "monthsViewHeaderDateFormat", "monthDateFormat"], outputs: ["triggerOpenYearsView", "triggerOpenDaysView", "focus", "blur", "triggerSelectMonth", "triggeChangeYear", "triggerHighlightMonth", "triggerHighlightNextMonth", "triggerHighlightPreviousMonth", "triggerHighlightFirstMonth", "triggerHighlightLastMonth", "triggerHighlightSameMonthPreviousPage", "triggerHighlightSameMonthNextPage"] }, { kind: "component", type: YearsViewComponent, selector: "ard-years-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "selectedDate", "selectedDateEnd", "rangeSelectionMode", "UTC", "min", "max", "multiCalendarLocation", "currentYearRangeStart", "multipleYearPageSize", "highlightedYear", "yearsViewHeaderTemplate", "yearTemplate", "yearsViewHeaderDateFormat", "yearDateFormat"], outputs: ["triggerOpenMonthsView", "triggerOpenDaysView", "focus", "blur", "triggerSelectYear", "triggerChangeYearsViewPage", "triggerHighlightYear", "triggerHighlightNextYear", "triggerHighlightPreviousYear", "triggerHighlightFirstYear", "triggerHighlightLastYear", "triggerHighlightSameYearPreviousPage", "triggerHighlightSameYearNextPage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
8274
8304
  }
8275
8305
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumRangeCalendarComponent, decorators: [{
8276
8306
  type: Component,
@@ -8284,7 +8314,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
8284
8314
  provide: ARD_FORM_FIELD_CONTROL,
8285
8315
  useExisting: ArdiumRangeCalendarComponent,
8286
8316
  },
8287
- ], template: "<div\r\n class=\"ard-calendar\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @switch (activeView()) { @case ('days') {\r\n <ard-days-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [staticHeight]=\"staticHeight()\"\r\n [highlightedDay]=\"highlightedDay()\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [hideFloatingMonth]=\"hideFloatingMonth()\"\r\n [isDayFilteredOut]=\"isDayFilteredOut()\"\r\n [daysViewHeaderTemplate]=\"daysViewHeaderTemplate()?.template ?? templateRepository()?.daysViewHeaderTmp()?.template\"\r\n [floatingMonthTemplate]=\"floatingMonthTemplate()?.template ?? templateRepository()?.floatingMonthTmp()?.template\"\r\n [weekdayTemplate]=\"weekdayTemplate()?.template ?? templateRepository()?.weekdayTmp()?.template\"\r\n [dayTemplate]=\"dayTemplate()?.template ?? templateRepository()?.dayTmp()?.template\"\r\n [daysViewHeaderDateFormat]=\"daysViewHeaderDateFormat()\"\r\n [weekdayDateFormat]=\"weekdayDateFormat()\"\r\n [weekdayTitleDateFormat]=\"weekdayTitleDateFormat()\"\r\n [floatingMonthDateFormat]=\"floatingMonthDateFormat()\"\r\n [floatingMonthTitleDateFormat]=\"floatingMonthTitleDateFormat()\"\r\n [dayDateFormat]=\"dayDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggerChangeMonth)=\"changeMonth($event)\"\r\n (triggerChangeYear)=\"changeYear($event)\"\r\n (triggerHighlightDay)=\"setHighlightedDay($event)\"\r\n (triggerHighlightFirstDay)=\"highlightFirstDay()\"\r\n (triggerHighlightLastDay)=\"highlightLastDay()\"\r\n (triggerHighlightNextDay)=\"highlightNextDay($event)\"\r\n (triggerHighlightPreviousDay)=\"highlightPreviousDay($event)\"\r\n (triggerHighlightSameDayNextPage)=\"$event ? highlightSameDayNextYear() : highlightSameDayNextMonth()\"\r\n (triggerHighlightSameDayPreviousPage)=\"$event ? highlightSameDayPreviousYear() : highlightSameDayPreviousMonth()\"\r\n (triggerSelectDay)=\"selectDay($event)\"\r\n />\r\n } @case ('months') {\r\n <ard-months-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [color]=\"color()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [highlightedMonth]=\"highlightedMonth()\"\r\n [monthsViewHeaderTemplate]=\"monthsViewHeaderTemplate()?.template ?? templateRepository()?.monthsViewHeaderTmp()?.template\"\r\n [monthTemplate]=\"monthTemplate()?.template ?? templateRepository()?.monthTmp()?.template\"\r\n [monthsViewHeaderDateFormat]=\"monthsViewHeaderDateFormat()\"\r\n [monthDateFormat]=\"monthDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggeChangeYear)=\"changeYear($event)\"\r\n (triggerSelectMonth)=\"selectMonth($event)\"\r\n (triggerHighlightMonth)=\"setHighlightedMonth($event)\"\r\n (triggerHighlightFirstMonth)=\"highlightFirstMonth()\"\r\n (triggerHighlightLastMonth)=\"highlightLastMonth()\"\r\n (triggerHighlightNextMonth)=\"highlightNextMonth($event)\"\r\n (triggerHighlightPreviousMonth)=\"highlightPreviousMonth($event)\"\r\n (triggerHighlightSameMonthNextPage)=\"highlightSameMonthNextYear($event)\"\r\n (triggerHighlightSameMonthPreviousPage)=\"highlightSameMonthPreviousYear($event)\"\r\n />\r\n } @case ('years') {\r\n <ard-years-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [highlightedYear]=\"highlightedYear()\"\r\n [currentYearRangeStart]=\"currentYearRangeStart()\"\r\n [multipleYearPageSize]=\"multipleYearPageSize()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [yearsViewHeaderTemplate]=\"yearsViewHeaderTemplate()?.template ?? templateRepository()?.yearsViewHeaderTmp()?.template\"\r\n [yearTemplate]=\"yearTemplate()?.template ?? templateRepository()?.yearTmp()?.template\"\r\n [yearsViewHeaderDateFormat]=\"yearsViewHeaderDateFormat()\"\r\n [yearDateFormat]=\"yearDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerSelectYear)=\"selectYear($event)\"\r\n (triggerChangeYearsViewPage)=\"changeYearsViewPage($event)\"\r\n (triggerHighlightYear)=\"setHighlightedYear($event)\"\r\n (triggerHighlightFirstYear)=\"highlightFirstYear()\"\r\n (triggerHighlightLastYear)=\"highlightLastYear()\"\r\n (triggerHighlightNextYear)=\"highlightNextYear($event)\"\r\n (triggerHighlightPreviousYear)=\"highlightPreviousYear($event)\"\r\n (triggerHighlightSameYearNextPage)=\"highlightSameYearNextPage($event)\"\r\n (triggerHighlightSameYearPreviousPage)=\"highlightSameYearPreviousPage($event)\"\r\n />\r\n } }\r\n</div>\r\n", styles: ["@layer ard-ui{ard-calendar,ard-range-calendar{display:block}}\n"] }]
8317
+ ], template: "<div\r\n class=\"ard-calendar\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @switch (activeView()) { @case ('days') {\r\n <ard-days-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [staticHeight]=\"staticHeight()\"\r\n [highlightedDay]=\"highlightedDay()\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [hideFloatingMonth]=\"hideFloatingMonth()\"\r\n [isDayFilteredOut]=\"isDayFilteredOut()\"\r\n [daysViewHeaderTemplate]=\"daysViewHeaderTemplate()?.template ?? templateRepository()?.daysViewHeaderTmp()?.template\"\r\n [floatingMonthTemplate]=\"floatingMonthTemplate()?.template ?? templateRepository()?.floatingMonthTmp()?.template\"\r\n [weekdayTemplate]=\"weekdayTemplate()?.template ?? templateRepository()?.weekdayTmp()?.template\"\r\n [dayTemplate]=\"dayTemplate()?.template ?? templateRepository()?.dayTmp()?.template\"\r\n [daysViewHeaderDateFormat]=\"daysViewHeaderDateFormat()\"\r\n [weekdayDateFormat]=\"weekdayDateFormat()\"\r\n [weekdayTitleDateFormat]=\"weekdayTitleDateFormat()\"\r\n [floatingMonthDateFormat]=\"floatingMonthDateFormat()\"\r\n [floatingMonthTitleDateFormat]=\"floatingMonthTitleDateFormat()\"\r\n [dayDateFormat]=\"dayDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenMonthsView)=\"openMonthsView()\"\r\n (triggerOpenYearsView)=\"openYearsView()\"\r\n (triggerChangeMonth)=\"changeMonth($event)\"\r\n (triggerChangeYear)=\"changeYear($event)\"\r\n (triggerHighlightDay)=\"setHighlightedDay($event)\"\r\n (triggerHighlightFirstDay)=\"highlightFirstDay()\"\r\n (triggerHighlightLastDay)=\"highlightLastDay()\"\r\n (triggerHighlightNextDay)=\"highlightNextDay($event)\"\r\n (triggerHighlightPreviousDay)=\"highlightPreviousDay($event)\"\r\n (triggerHighlightSameDayNextPage)=\"$event ? highlightSameDayNextYear() : highlightSameDayNextMonth()\"\r\n (triggerHighlightSameDayPreviousPage)=\"$event ? highlightSameDayPreviousYear() : highlightSameDayPreviousMonth()\"\r\n (triggerSelectDay)=\"selectDay($event)\"\r\n />\r\n } @case ('months') {\r\n <ard-months-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [color]=\"color()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [highlightedMonth]=\"highlightedMonth()\"\r\n [monthsViewHeaderTemplate]=\"monthsViewHeaderTemplate()?.template ?? templateRepository()?.monthsViewHeaderTmp()?.template\"\r\n [monthTemplate]=\"monthTemplate()?.template ?? templateRepository()?.monthTmp()?.template\"\r\n [monthsViewHeaderDateFormat]=\"monthsViewHeaderDateFormat()\"\r\n [monthDateFormat]=\"monthDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"openDaysView()\"\r\n (triggerOpenYearsView)=\"openYearsView()\"\r\n (triggeChangeYear)=\"changeYear($event)\"\r\n (triggerSelectMonth)=\"selectMonth($event)\"\r\n (triggerHighlightMonth)=\"setHighlightedMonth($event)\"\r\n (triggerHighlightFirstMonth)=\"highlightFirstMonth()\"\r\n (triggerHighlightLastMonth)=\"highlightLastMonth()\"\r\n (triggerHighlightNextMonth)=\"highlightNextMonth($event)\"\r\n (triggerHighlightPreviousMonth)=\"highlightPreviousMonth($event)\"\r\n (triggerHighlightSameMonthNextPage)=\"highlightSameMonthNextYear($event)\"\r\n (triggerHighlightSameMonthPreviousPage)=\"highlightSameMonthPreviousYear($event)\"\r\n />\r\n } @case ('years') {\r\n <ard-years-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [highlightedYear]=\"highlightedYear()\"\r\n [currentYearRangeStart]=\"currentYearRangeStart()\"\r\n [multipleYearPageSize]=\"multipleYearPageSize()\"\r\n [selectedDate]=\"selectionStart()\"\r\n [selectedDateEnd]=\"endDate()\"\r\n [rangeSelectionMode]=\"isRangeSelector\"\r\n [UTC]=\"UTC()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [multiCalendarLocation]=\"multiCalendarLocation()\"\r\n [yearsViewHeaderTemplate]=\"yearsViewHeaderTemplate()?.template ?? templateRepository()?.yearsViewHeaderTmp()?.template\"\r\n [yearTemplate]=\"yearTemplate()?.template ?? templateRepository()?.yearTmp()?.template\"\r\n [yearsViewHeaderDateFormat]=\"yearsViewHeaderDateFormat()\"\r\n [yearDateFormat]=\"yearDateFormat()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"openDaysView()\"\r\n (triggerOpenMonthsView)=\"openMonthsView()\"\r\n (triggerSelectYear)=\"selectYear($event)\"\r\n (triggerChangeYearsViewPage)=\"changeYearsViewPage($event)\"\r\n (triggerHighlightYear)=\"setHighlightedYear($event)\"\r\n (triggerHighlightFirstYear)=\"highlightFirstYear()\"\r\n (triggerHighlightLastYear)=\"highlightLastYear()\"\r\n (triggerHighlightNextYear)=\"highlightNextYear($event)\"\r\n (triggerHighlightPreviousYear)=\"highlightPreviousYear($event)\"\r\n (triggerHighlightSameYearNextPage)=\"highlightSameYearNextPage($event)\"\r\n (triggerHighlightSameYearPreviousPage)=\"highlightSameYearPreviousPage($event)\"\r\n />\r\n } }\r\n</div>\r\n", styles: ["@layer ard-ui{ard-calendar,ard-range-calendar{display:block}}\n"] }]
8288
8318
  }], ctorParameters: () => [{ type: undefined, decorators: [{
8289
8319
  type: Inject,
8290
8320
  args: [ARD_CALENDAR_DEFAULTS]