@aaamb/ngx-design-system 1.3.7 → 1.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, output, computed, Component, signal, effect, forwardRef, ViewChild, HostListener, CUSTOM_ELEMENTS_SCHEMA, EventEmitter, Input, Output, Attribute } from '@angular/core';
2
+ import { input, output, computed, Component, signal, effect, forwardRef, ViewChild, HostListener, ElementRef, CUSTOM_ELEMENTS_SCHEMA, EventEmitter, Input, Output, Attribute } from '@angular/core';
3
3
  import * as i1$1 from '@angular/forms';
4
4
  import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormBuilder, Validators } from '@angular/forms';
5
5
  import * as i2 from '@angular/common';
@@ -1769,6 +1769,7 @@ class DatepickerSelectorComponent {
1769
1769
  buttonColor = input('white', ...(ngDevMode ? [{ debugName: "buttonColor" }] : /* istanbul ignore next */ []));
1770
1770
  buttonOnlyIconButton = input(false, ...(ngDevMode ? [{ debugName: "buttonOnlyIconButton" }] : /* istanbul ignore next */ []));
1771
1771
  buttonIcon = input('edit_calendar', ...(ngDevMode ? [{ debugName: "buttonIcon" }] : /* istanbul ignore next */ []));
1772
+ buttonLabelMode = input('option', ...(ngDevMode ? [{ debugName: "buttonLabelMode" }] : /* istanbul ignore next */ []));
1772
1773
  selectorTriggerRef;
1773
1774
  dateOptions = {
1774
1775
  annually: 'annually',
@@ -1788,7 +1789,17 @@ class DatepickerSelectorComponent {
1788
1789
  hoveredTimeFrame = signal(null, ...(ngDevMode ? [{ debugName: "hoveredTimeFrame" }] : /* istanbul ignore next */ []));
1789
1790
  isSelectorOpen = signal(false, ...(ngDevMode ? [{ debugName: "isSelectorOpen" }] : /* istanbul ignore next */ []));
1790
1791
  openToLeft = signal(false, ...(ngDevMode ? [{ debugName: "openToLeft" }] : /* istanbul ignore next */ []));
1792
+ selectedDate = signal(this.getToday(), ...(ngDevMode ? [{ debugName: "selectedDate" }] : /* istanbul ignore next */ []));
1791
1793
  currentTimeFrameLabel = computed(() => this.pickerOptions.find((option) => option.mode === this.selectedTimeFrame())?.label ?? 'Monthly', ...(ngDevMode ? [{ debugName: "currentTimeFrameLabel" }] : /* istanbul ignore next */ []));
1794
+ buttonLabel = computed(() => {
1795
+ if (this.buttonLabelMode() === 'option') {
1796
+ return this.currentTimeFrameLabel();
1797
+ }
1798
+ const date = this.selectedDate();
1799
+ return date
1800
+ ? this.formatSelectionLabel(this.selectedTimeFrame(), date)
1801
+ : this.currentTimeFrameLabel();
1802
+ }, ...(ngDevMode ? [{ debugName: "buttonLabel" }] : /* istanbul ignore next */ []));
1792
1803
  activePreviewTimeFrame = computed(() => this.hoveredTimeFrame(), ...(ngDevMode ? [{ debugName: "activePreviewTimeFrame" }] : /* istanbul ignore next */ []));
1793
1804
  date = this.getToday();
1794
1805
  cvaDisabled = false;
@@ -1823,9 +1834,37 @@ class DatepickerSelectorComponent {
1823
1834
  const normalizedDate = this.normalizeDateByMode(mode, value);
1824
1835
  this.selectedTimeFrame.set(mode);
1825
1836
  this.date = normalizedDate;
1837
+ this.selectedDate.set(normalizedDate);
1826
1838
  this.onChange(normalizedDate);
1827
1839
  this.onTouched();
1828
1840
  }
1841
+ formatSelectionLabel(mode, date) {
1842
+ const year = date.getFullYear();
1843
+ if (mode === this.dateOptions.annually) {
1844
+ return String(year);
1845
+ }
1846
+ if (mode === this.dateOptions.monthly) {
1847
+ return new Intl.DateTimeFormat('en-US', {
1848
+ month: 'long',
1849
+ year: 'numeric',
1850
+ }).format(date);
1851
+ }
1852
+ if (mode === this.dateOptions.quarterly) {
1853
+ return `Q${Math.floor(date.getMonth() / 3) + 1} ${year}`;
1854
+ }
1855
+ if (mode === this.dateOptions.weekly) {
1856
+ const start = this.getStartOfWeek(date);
1857
+ const end = new Date(start);
1858
+ end.setDate(start.getDate() + 6);
1859
+ return `${this.formatNumericDate(start)} - ${this.formatNumericDate(end)}`;
1860
+ }
1861
+ return this.formatNumericDate(date);
1862
+ }
1863
+ formatNumericDate(date) {
1864
+ const month = String(date.getMonth() + 1).padStart(2, '0');
1865
+ const day = String(date.getDate()).padStart(2, '0');
1866
+ return `${month}/${day}/${date.getFullYear()}`;
1867
+ }
1829
1868
  normalizeDateByMode(mode, value) {
1830
1869
  const parsedDate = this.toDate(value);
1831
1870
  if (!parsedDate) {
@@ -1903,16 +1942,18 @@ class DatepickerSelectorComponent {
1903
1942
  const spaceToRight = viewportWidth - triggerRect.left;
1904
1943
  const spaceToLeft = triggerRect.right;
1905
1944
  const shouldOpenToLeft = spaceToRight < estimatedPopoverWidth &&
1906
- spaceToLeft >= estimatedPopoverWidth;
1945
+ spaceToLeft > spaceToRight;
1907
1946
  this.openToLeft.set(shouldOpenToLeft);
1908
1947
  }
1909
1948
  writeValue(value) {
1910
1949
  if (!this.hasReceivedInitialWrite) {
1911
1950
  this.hasReceivedInitialWrite = true;
1912
1951
  this.date = value ? this.toDate(value) : this.getToday();
1952
+ this.selectedDate.set(this.date);
1913
1953
  return;
1914
1954
  }
1915
1955
  this.date = this.toDate(value);
1956
+ this.selectedDate.set(this.date);
1916
1957
  }
1917
1958
  registerOnChange(fn) {
1918
1959
  this.onChange = fn;
@@ -1937,7 +1978,7 @@ class DatepickerSelectorComponent {
1937
1978
  this.closeSelector();
1938
1979
  }
1939
1980
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DatepickerSelectorComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1940
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: DatepickerSelectorComponent, isStandalone: true, selector: "ads-datepicker-selector", inputs: { isPickerDisabled: { classPropertyName: "isPickerDisabled", publicName: "isPickerDisabled", isSignal: true, isRequired: false, transformFunction: null }, buttonVariant: { classPropertyName: "buttonVariant", publicName: "buttonVariant", isSignal: true, isRequired: false, transformFunction: null }, buttonColor: { classPropertyName: "buttonColor", publicName: "buttonColor", isSignal: true, isRequired: false, transformFunction: null }, buttonOnlyIconButton: { classPropertyName: "buttonOnlyIconButton", publicName: "buttonOnlyIconButton", isSignal: true, isRequired: false, transformFunction: null }, buttonIcon: { classPropertyName: "buttonIcon", publicName: "buttonIcon", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:resize": "onWindowResize()", "document:click": "onDocumentClick($event)" } }, providers: [
1981
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: DatepickerSelectorComponent, isStandalone: true, selector: "ads-datepicker-selector", inputs: { isPickerDisabled: { classPropertyName: "isPickerDisabled", publicName: "isPickerDisabled", isSignal: true, isRequired: false, transformFunction: null }, buttonVariant: { classPropertyName: "buttonVariant", publicName: "buttonVariant", isSignal: true, isRequired: false, transformFunction: null }, buttonColor: { classPropertyName: "buttonColor", publicName: "buttonColor", isSignal: true, isRequired: false, transformFunction: null }, buttonOnlyIconButton: { classPropertyName: "buttonOnlyIconButton", publicName: "buttonOnlyIconButton", isSignal: true, isRequired: false, transformFunction: null }, buttonIcon: { classPropertyName: "buttonIcon", publicName: "buttonIcon", isSignal: true, isRequired: false, transformFunction: null }, buttonLabelMode: { classPropertyName: "buttonLabelMode", publicName: "buttonLabelMode", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:resize": "onWindowResize()", "document:click": "onDocumentClick($event)" } }, providers: [
1941
1982
  {
1942
1983
  provide: NZ_I18N,
1943
1984
  useValue: en_US,
@@ -1951,7 +1992,7 @@ class DatepickerSelectorComponent {
1951
1992
  useExisting: forwardRef(() => DatepickerSelectorComponent),
1952
1993
  multi: true,
1953
1994
  },
1954
- ], viewQueries: [{ propertyName: "selectorTriggerRef", first: true, predicate: ["selectorTrigger"], descendants: true }], ngImport: i0, template: "<div class=\"relative inline-flex flex-col gap-3 w-full max-w-90\">\n <div class=\"flex items-center justify-between gap-3\">\n <button\n #selectorTrigger\n ads-button=\"\"\n type=\"button\"\n [variant]=\"buttonVariant()\"\n [color]=\"buttonColor()\"\n [onlyIconButton]=\"buttonOnlyIconButton()\"\n [iconButton]=\"buttonIcon()\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggleSelector()\"\n [attr.aria-expanded]=\"isSelectorOpen()\"\n aria-haspopup=\"menu\"\n >\n <ads-icon [iconName]=\"buttonIcon()\" [size]=\"16\"></ads-icon>\n @if (!buttonOnlyIconButton()) {\n <span>{{ currentTimeFrameLabel() }}</span>\n }\n </button>\n\n @if (isSelectorOpen()) {\n <div\n class=\"absolute top-[calc(100%+0.5rem)] z-20 flex items-start gap-3\"\n [class.left-0]=\"!openToLeft()\"\n [class.right-0]=\"openToLeft()\"\n [class.flex-row]=\"!openToLeft()\"\n [class.flex-row-reverse]=\"openToLeft()\"\n role=\"menu\"\n (mouseleave)=\"clearPreview()\"\n >\n <div class=\"w-60 overflow-hidden rounded-lg shadow-lg\">\n @for (option of pickerOptions; track option.mode) {\n <div\n type=\"button\"\n class=\"flex w-full items-center justify-between border-b border-b-neutral-disabled-bg bg-white px-4 py-3 text-left text-sm text-green-base transition-colors last:border-b-0 hover:bg-aqua-6 cursor-pointer\"\n (mouseenter)=\"previewTimeFrame(option.mode)\"\n role=\"menuitem\"\n >\n <span>{{ option.label }}</span>\n </div>\n }\n </div>\n\n @if (activePreviewTimeFrame()) {\n @switch (activePreviewTimeFrame()) {\n @case (dateOptions.annually) {\n <nz-date-picker\n nzDropdownClassName=\"datePicker-box\"\n nzInline\n nzMode=\"year\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.annually, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.monthly) {\n <nz-date-picker\n nzInline\n nzMode=\"month\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.monthly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.weekly) {\n <nz-date-picker\n nzInline\n nzMode=\"week\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.weekly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.quarterly) {\n <nz-date-picker\n nzInline\n nzMode=\"quarter\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.quarterly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.daily) {\n <nz-date-picker\n nzInline\n [nzShowToday]=\"false\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.daily, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n }\n }\n </div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzDatePickerModule }, { kind: "component", type: i1.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-quarter-picker,nz-year-picker,nz-range-picker", inputs: ["nzInline", "nzAllowClear", "nzAutoFocus", "nzDisabled", "nzInputReadOnly", "nzOpen", "nzDisabledDate", "nzLocale", "nzPlaceHolder", "nzPopupStyle", "nzDropdownClassName", "nzSize", "nzStatus", "nzFormat", "nzVariant", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzShowToday", "nzMode", "nzShowNow", "nzRanges", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzPlacement", "nzShowWeekNumber", "nzShowTime"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }, { kind: "component", type: IconComponent, selector: "ads-icon", inputs: ["iconName", "size", "title", "color"] }, { kind: "component", type: ButtonComponent, selector: "button[ads-button]", inputs: ["variant", "color", "buttonType", "disabled", "fullWidth", "iconButton", "onlyIconButton", "iconColor"], outputs: ["clicked"] }] });
1995
+ ], viewQueries: [{ propertyName: "selectorTriggerRef", first: true, predicate: ["selectorTrigger"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"relative inline-flex flex-col gap-3 w-full max-w-90\">\n <div class=\"flex items-center justify-between gap-3\">\n <button\n #selectorTrigger\n ads-button=\"\"\n type=\"button\"\n [variant]=\"buttonVariant()\"\n [color]=\"buttonColor()\"\n [onlyIconButton]=\"buttonOnlyIconButton()\"\n [iconButton]=\"buttonIcon()\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggleSelector()\"\n [attr.aria-expanded]=\"isSelectorOpen()\"\n aria-haspopup=\"menu\"\n >\n <ads-icon [iconName]=\"buttonIcon()\" [size]=\"16\"></ads-icon>\n @if (!buttonOnlyIconButton()) {\n <span>{{ buttonLabel() }}</span>\n }\n </button>\n\n @if (isSelectorOpen()) {\n <div\n class=\"absolute top-[calc(100%+0.5rem)] z-20 flex items-start gap-3\"\n [class.left-0]=\"!openToLeft()\"\n [class.right-0]=\"openToLeft()\"\n [class.flex-row]=\"!openToLeft()\"\n [class.flex-row-reverse]=\"openToLeft()\"\n role=\"menu\"\n (mouseleave)=\"clearPreview()\"\n >\n <div class=\"w-60 overflow-hidden rounded-lg shadow-lg\">\n @for (option of pickerOptions; track option.mode) {\n <div\n type=\"button\"\n class=\"flex w-full items-center justify-between border-b border-b-neutral-disabled-bg bg-white px-4 py-3 text-left text-sm text-green-base transition-colors last:border-b-0 hover:bg-aqua-6 cursor-pointer\"\n (mouseenter)=\"previewTimeFrame(option.mode)\"\n role=\"menuitem\"\n >\n <span>{{ option.label }}</span>\n </div>\n }\n </div>\n\n @if (activePreviewTimeFrame()) {\n @switch (activePreviewTimeFrame()) {\n @case (dateOptions.annually) {\n <nz-date-picker\n nzDropdownClassName=\"datePicker-box\"\n nzInline\n nzMode=\"year\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.annually, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.monthly) {\n <nz-date-picker\n nzInline\n nzMode=\"month\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.monthly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.weekly) {\n <nz-date-picker\n nzInline\n nzMode=\"week\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.weekly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.quarterly) {\n <nz-date-picker\n nzInline\n nzMode=\"quarter\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.quarterly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.daily) {\n <nz-date-picker\n nzInline\n [nzShowToday]=\"false\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.daily, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n }\n }\n </div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzDatePickerModule }, { kind: "component", type: i1.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-quarter-picker,nz-year-picker,nz-range-picker", inputs: ["nzInline", "nzAllowClear", "nzAutoFocus", "nzDisabled", "nzInputReadOnly", "nzOpen", "nzDisabledDate", "nzLocale", "nzPlaceHolder", "nzPopupStyle", "nzDropdownClassName", "nzSize", "nzStatus", "nzFormat", "nzVariant", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzShowToday", "nzMode", "nzShowNow", "nzRanges", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzPlacement", "nzShowWeekNumber", "nzShowTime"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }, { kind: "component", type: IconComponent, selector: "ads-icon", inputs: ["iconName", "size", "title", "color"] }, { kind: "component", type: ButtonComponent, selector: "button[ads-button]", inputs: ["variant", "color", "buttonType", "disabled", "fullWidth", "iconButton", "onlyIconButton", "iconColor"], outputs: ["clicked"] }] });
1955
1996
  }
1956
1997
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DatepickerSelectorComponent, decorators: [{
1957
1998
  type: Component,
@@ -1975,10 +2016,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
1975
2016
  useExisting: forwardRef(() => DatepickerSelectorComponent),
1976
2017
  multi: true,
1977
2018
  },
1978
- ], template: "<div class=\"relative inline-flex flex-col gap-3 w-full max-w-90\">\n <div class=\"flex items-center justify-between gap-3\">\n <button\n #selectorTrigger\n ads-button=\"\"\n type=\"button\"\n [variant]=\"buttonVariant()\"\n [color]=\"buttonColor()\"\n [onlyIconButton]=\"buttonOnlyIconButton()\"\n [iconButton]=\"buttonIcon()\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggleSelector()\"\n [attr.aria-expanded]=\"isSelectorOpen()\"\n aria-haspopup=\"menu\"\n >\n <ads-icon [iconName]=\"buttonIcon()\" [size]=\"16\"></ads-icon>\n @if (!buttonOnlyIconButton()) {\n <span>{{ currentTimeFrameLabel() }}</span>\n }\n </button>\n\n @if (isSelectorOpen()) {\n <div\n class=\"absolute top-[calc(100%+0.5rem)] z-20 flex items-start gap-3\"\n [class.left-0]=\"!openToLeft()\"\n [class.right-0]=\"openToLeft()\"\n [class.flex-row]=\"!openToLeft()\"\n [class.flex-row-reverse]=\"openToLeft()\"\n role=\"menu\"\n (mouseleave)=\"clearPreview()\"\n >\n <div class=\"w-60 overflow-hidden rounded-lg shadow-lg\">\n @for (option of pickerOptions; track option.mode) {\n <div\n type=\"button\"\n class=\"flex w-full items-center justify-between border-b border-b-neutral-disabled-bg bg-white px-4 py-3 text-left text-sm text-green-base transition-colors last:border-b-0 hover:bg-aqua-6 cursor-pointer\"\n (mouseenter)=\"previewTimeFrame(option.mode)\"\n role=\"menuitem\"\n >\n <span>{{ option.label }}</span>\n </div>\n }\n </div>\n\n @if (activePreviewTimeFrame()) {\n @switch (activePreviewTimeFrame()) {\n @case (dateOptions.annually) {\n <nz-date-picker\n nzDropdownClassName=\"datePicker-box\"\n nzInline\n nzMode=\"year\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.annually, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.monthly) {\n <nz-date-picker\n nzInline\n nzMode=\"month\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.monthly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.weekly) {\n <nz-date-picker\n nzInline\n nzMode=\"week\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.weekly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.quarterly) {\n <nz-date-picker\n nzInline\n nzMode=\"quarter\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.quarterly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.daily) {\n <nz-date-picker\n nzInline\n [nzShowToday]=\"false\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.daily, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n }\n }\n </div>\n }\n </div>\n</div>\n" }]
1979
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { isPickerDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPickerDisabled", required: false }] }], buttonVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonVariant", required: false }] }], buttonColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonColor", required: false }] }], buttonOnlyIconButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonOnlyIconButton", required: false }] }], buttonIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonIcon", required: false }] }], selectorTriggerRef: [{
2019
+ ], template: "<div class=\"relative inline-flex flex-col gap-3 w-full max-w-90\">\n <div class=\"flex items-center justify-between gap-3\">\n <button\n #selectorTrigger\n ads-button=\"\"\n type=\"button\"\n [variant]=\"buttonVariant()\"\n [color]=\"buttonColor()\"\n [onlyIconButton]=\"buttonOnlyIconButton()\"\n [iconButton]=\"buttonIcon()\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggleSelector()\"\n [attr.aria-expanded]=\"isSelectorOpen()\"\n aria-haspopup=\"menu\"\n >\n <ads-icon [iconName]=\"buttonIcon()\" [size]=\"16\"></ads-icon>\n @if (!buttonOnlyIconButton()) {\n <span>{{ buttonLabel() }}</span>\n }\n </button>\n\n @if (isSelectorOpen()) {\n <div\n class=\"absolute top-[calc(100%+0.5rem)] z-20 flex items-start gap-3\"\n [class.left-0]=\"!openToLeft()\"\n [class.right-0]=\"openToLeft()\"\n [class.flex-row]=\"!openToLeft()\"\n [class.flex-row-reverse]=\"openToLeft()\"\n role=\"menu\"\n (mouseleave)=\"clearPreview()\"\n >\n <div class=\"w-60 overflow-hidden rounded-lg shadow-lg\">\n @for (option of pickerOptions; track option.mode) {\n <div\n type=\"button\"\n class=\"flex w-full items-center justify-between border-b border-b-neutral-disabled-bg bg-white px-4 py-3 text-left text-sm text-green-base transition-colors last:border-b-0 hover:bg-aqua-6 cursor-pointer\"\n (mouseenter)=\"previewTimeFrame(option.mode)\"\n role=\"menuitem\"\n >\n <span>{{ option.label }}</span>\n </div>\n }\n </div>\n\n @if (activePreviewTimeFrame()) {\n @switch (activePreviewTimeFrame()) {\n @case (dateOptions.annually) {\n <nz-date-picker\n nzDropdownClassName=\"datePicker-box\"\n nzInline\n nzMode=\"year\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.annually, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.monthly) {\n <nz-date-picker\n nzInline\n nzMode=\"month\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.monthly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.weekly) {\n <nz-date-picker\n nzInline\n nzMode=\"week\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.weekly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.quarterly) {\n <nz-date-picker\n nzInline\n nzMode=\"quarter\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.quarterly, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n @case (dateOptions.daily) {\n <nz-date-picker\n nzInline\n [nzShowToday]=\"false\"\n [(ngModel)]=\"date\"\n (ngModelChange)=\"onDateChange(dateOptions.daily, $event)\"\n [nzDisabled]=\"isDisabled()\"\n [nzDisabledDate]=\"disableFutureDates\"\n ></nz-date-picker>\n }\n }\n }\n </div>\n }\n </div>\n</div>\n" }]
2020
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { isPickerDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPickerDisabled", required: false }] }], buttonVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonVariant", required: false }] }], buttonColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonColor", required: false }] }], buttonOnlyIconButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonOnlyIconButton", required: false }] }], buttonIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonIcon", required: false }] }], buttonLabelMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonLabelMode", required: false }] }], selectorTriggerRef: [{
1980
2021
  type: ViewChild,
1981
- args: ['selectorTrigger']
2022
+ args: ['selectorTrigger', { read: ElementRef }]
1982
2023
  }], onWindowResize: [{
1983
2024
  type: HostListener,
1984
2025
  args: ['window:resize']