@sonny-ui/core 0.1.0-alpha.14 → 0.1.0-alpha.15

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.
@@ -0,0 +1,340 @@
1
+ import {
2
+ ChangeDetectionStrategy,
3
+ Component,
4
+ computed,
5
+ ElementRef,
6
+ forwardRef,
7
+ HostListener,
8
+ inject,
9
+ input,
10
+ model,
11
+ OnDestroy,
12
+ signal,
13
+ viewChild,
14
+ } from '@angular/core';
15
+ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
16
+ import { cn } from '../core/utils/cn';
17
+ import { SnyCalendarComponent } from '../calendar/calendar.component';
18
+ import type { DateRange, DatePickerPreset } from '../calendar/calendar.types';
19
+ import { datePickerTriggerVariants, type DatePickerSize } from '../date-picker/date-picker.variants';
20
+
21
+ @Component({
22
+ selector: 'sny-date-range-picker',
23
+ standalone: true,
24
+ changeDetection: ChangeDetectionStrategy.OnPush,
25
+ imports: [SnyCalendarComponent],
26
+ host: { class: 'relative inline-block w-full' },
27
+ providers: [
28
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SnyDateRangePickerComponent), multi: true },
29
+ ],
30
+ template: `
31
+ <button
32
+ #triggerEl
33
+ type="button"
34
+ role="combobox"
35
+ [attr.aria-expanded]="open()"
36
+ aria-haspopup="dialog"
37
+ [disabled]="isDisabled()"
38
+ [class]="triggerClass()"
39
+ (click)="toggle()"
40
+ (blur)="onTouched()"
41
+ >
42
+ <span [class]="displayValue() ? 'truncate' : 'text-muted-foreground truncate'">
43
+ {{ displayValue() || placeholder() }}
44
+ </span>
45
+ <div class="flex items-center gap-1 shrink-0">
46
+ @if (clearable() && value()?.start) {
47
+ <button
48
+ type="button"
49
+ class="rounded-sm p-0.5 hover:bg-muted transition-colors text-muted-foreground hover:text-foreground"
50
+ (click)="clear($event)"
51
+ aria-label="Clear date range"
52
+ >
53
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>
54
+ </button>
55
+ }
56
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="shrink-0 text-muted-foreground"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></svg>
57
+ </div>
58
+ </button>
59
+
60
+ @if (open()) {
61
+ <div
62
+ #dropdownEl
63
+ role="dialog"
64
+ aria-modal="true"
65
+ aria-label="Choose date range"
66
+ class="fixed z-50 rounded-md border border-border bg-popover text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95"
67
+ >
68
+ <div class="flex flex-col sm:flex-row">
69
+ <!-- Presets sidebar -->
70
+ @if (presets().length > 0) {
71
+ <div class="border-b sm:border-b-0 sm:border-r border-border p-3 space-y-0.5 sm:min-w-[150px]">
72
+ <p class="px-3 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider">Presets</p>
73
+ @for (preset of presets(); track preset.label) {
74
+ <button
75
+ type="button"
76
+ class="w-full text-left px-3 py-2 text-sm rounded-md hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer"
77
+ (mousedown)="selectPreset(preset); $event.preventDefault()"
78
+ >
79
+ {{ preset.label }}
80
+ </button>
81
+ }
82
+ </div>
83
+ }
84
+
85
+ <!-- Calendar(s) -->
86
+ <div class="flex flex-col sm:flex-row">
87
+ @if (dualCalendar()) {
88
+ <!-- Left calendar -->
89
+ <div class="p-1">
90
+ <div class="flex items-center justify-between px-3 py-2">
91
+ <button
92
+ type="button"
93
+ class="inline-flex items-center justify-center rounded-md h-8 w-8 hover:bg-accent hover:text-accent-foreground transition-colors"
94
+ (click)="prevMonth()"
95
+ aria-label="Previous month"
96
+ >
97
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>
98
+ </button>
99
+ <span class="text-sm font-semibold tracking-tight">{{ leftMonthLabel() }}</span>
100
+ <div class="w-8"></div>
101
+ </div>
102
+ <sny-calendar
103
+ mode="range"
104
+ [(rangeValue)]="internalRange"
105
+ [min]="min()"
106
+ [max]="max()"
107
+ [locale]="locale()"
108
+ [showNavigation]="false"
109
+ [borderless]="true"
110
+ [initialViewDate]="leftViewDate()"
111
+ (rangeValueChange)="onRangeChanged($event)"
112
+ />
113
+ </div>
114
+ <div class="border-t sm:border-t-0 sm:border-l border-border"></div>
115
+ <!-- Right calendar -->
116
+ <div class="p-1">
117
+ <div class="flex items-center justify-between px-3 py-2">
118
+ <div class="w-8"></div>
119
+ <span class="text-sm font-semibold tracking-tight">{{ rightMonthLabel() }}</span>
120
+ <button
121
+ type="button"
122
+ class="inline-flex items-center justify-center rounded-md h-8 w-8 hover:bg-accent hover:text-accent-foreground transition-colors"
123
+ (click)="nextMonth()"
124
+ aria-label="Next month"
125
+ >
126
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>
127
+ </button>
128
+ </div>
129
+ <sny-calendar
130
+ mode="range"
131
+ [(rangeValue)]="internalRange"
132
+ [min]="min()"
133
+ [max]="max()"
134
+ [locale]="locale()"
135
+ [showNavigation]="false"
136
+ [borderless]="true"
137
+ [initialViewDate]="rightViewDate()"
138
+ (rangeValueChange)="onRangeChanged($event)"
139
+ />
140
+ </div>
141
+ } @else {
142
+ <!-- Single calendar -->
143
+ <sny-calendar
144
+ mode="range"
145
+ [(rangeValue)]="internalRange"
146
+ [min]="min()"
147
+ [max]="max()"
148
+ [locale]="locale()"
149
+ (rangeValueChange)="onRangeChanged($event)"
150
+ />
151
+ }
152
+ </div>
153
+ </div>
154
+ </div>
155
+ }
156
+ `,
157
+ })
158
+ export class SnyDateRangePickerComponent implements ControlValueAccessor, OnDestroy {
159
+ readonly value = model<DateRange | null>(null);
160
+ readonly placeholder = input('Pick a date range...');
161
+ readonly size = input<DatePickerSize>('md');
162
+ readonly locale = input('en-US');
163
+ readonly dateFormat = input<Intl.DateTimeFormatOptions>({
164
+ month: 'short',
165
+ day: 'numeric',
166
+ year: 'numeric',
167
+ });
168
+ readonly separator = input(' \u2014 ');
169
+ readonly dualCalendar = input(false);
170
+ readonly presets = input<DatePickerPreset[]>([]);
171
+ readonly min = input<Date | undefined>(undefined);
172
+ readonly max = input<Date | undefined>(undefined);
173
+ readonly clearable = input(true);
174
+ readonly disabled = input(false);
175
+ readonly class = input<string>('');
176
+
177
+ readonly open = signal(false);
178
+ readonly internalRange = signal<DateRange | null>(null);
179
+ readonly leftViewDate = signal(new Date());
180
+
181
+ private readonly _disabledByCva = signal(false);
182
+ protected readonly isDisabled = computed(() => this.disabled() || this._disabledByCva());
183
+
184
+ private readonly triggerRef = viewChild<ElementRef<HTMLButtonElement>>('triggerEl');
185
+ private readonly dropdownRef = viewChild<ElementRef<HTMLDivElement>>('dropdownEl');
186
+ private readonly elRef = inject(ElementRef);
187
+
188
+ private scrollHandler: (() => void) | null = null;
189
+ private resizeHandler: (() => void) | null = null;
190
+
191
+ private _onChange: (value: DateRange | null) => void = () => {};
192
+ protected onTouched: () => void = () => {};
193
+
194
+ // Computed
195
+ readonly rightViewDate = computed(() => {
196
+ const d = this.leftViewDate();
197
+ return new Date(d.getFullYear(), d.getMonth() + 1, 1);
198
+ });
199
+
200
+ readonly leftMonthLabel = computed(() =>
201
+ this.leftViewDate().toLocaleDateString(this.locale(), { month: 'long', year: 'numeric' })
202
+ );
203
+
204
+ readonly rightMonthLabel = computed(() =>
205
+ this.rightViewDate().toLocaleDateString(this.locale(), { month: 'long', year: 'numeric' })
206
+ );
207
+
208
+ readonly displayValue = computed(() => {
209
+ const r = this.value();
210
+ if (!r?.start) return '';
211
+ const fmt = (d: Date) => d.toLocaleDateString(this.locale(), this.dateFormat());
212
+ if (!r.end) return fmt(r.start) + this.separator() + '...';
213
+ return fmt(r.start) + this.separator() + fmt(r.end);
214
+ });
215
+
216
+ protected readonly triggerClass = computed(() =>
217
+ cn(datePickerTriggerVariants({ size: this.size() }), this.class())
218
+ );
219
+
220
+ // CVA
221
+ writeValue(val: DateRange | null): void {
222
+ this.value.set(val ?? null);
223
+ this.internalRange.set(val ?? null);
224
+ if (val?.start) {
225
+ this.leftViewDate.set(new Date(val.start.getFullYear(), val.start.getMonth(), 1));
226
+ }
227
+ }
228
+
229
+ registerOnChange(fn: (value: DateRange | null) => void): void {
230
+ this._onChange = fn;
231
+ }
232
+
233
+ registerOnTouched(fn: () => void): void {
234
+ this.onTouched = fn;
235
+ }
236
+
237
+ setDisabledState(isDisabled: boolean): void {
238
+ this._disabledByCva.set(isDisabled);
239
+ }
240
+
241
+ // Actions
242
+ onRangeChanged(range: DateRange | null): void {
243
+ this.internalRange.set(range);
244
+ if (range?.start && range?.end) {
245
+ this.value.set(range);
246
+ this._onChange(range);
247
+ setTimeout(() => this.close(), 150);
248
+ }
249
+ }
250
+
251
+ selectPreset(preset: DatePickerPreset): void {
252
+ this.value.set(preset.range);
253
+ this.internalRange.set(preset.range);
254
+ this._onChange(preset.range);
255
+ this.close();
256
+ }
257
+
258
+ clear(event: Event): void {
259
+ event.stopPropagation();
260
+ this.value.set(null);
261
+ this.internalRange.set(null);
262
+ this._onChange(null);
263
+ }
264
+
265
+ prevMonth(): void {
266
+ this.leftViewDate.update((d) => new Date(d.getFullYear(), d.getMonth() - 1, 1));
267
+ }
268
+
269
+ nextMonth(): void {
270
+ this.leftViewDate.update((d) => new Date(d.getFullYear(), d.getMonth() + 1, 1));
271
+ }
272
+
273
+ toggle(): void {
274
+ if (this.open()) {
275
+ this.close();
276
+ } else {
277
+ this.internalRange.set(this.value());
278
+ this.updateDropdownPosition();
279
+ this.open.set(true);
280
+ this.addGlobalListeners();
281
+ setTimeout(() => this.updateDropdownPosition());
282
+ }
283
+ }
284
+
285
+ close(): void {
286
+ this.open.set(false);
287
+ this.removeGlobalListeners();
288
+ }
289
+
290
+ // Positioning
291
+ private updateDropdownPosition(): void {
292
+ const trigger = this.triggerRef()?.nativeElement;
293
+ if (!trigger) return;
294
+ const rect = trigger.getBoundingClientRect();
295
+ const dropdown = this.dropdownRef()?.nativeElement;
296
+ if (dropdown) {
297
+ dropdown.style.top = `${rect.bottom + 4}px`;
298
+ dropdown.style.left = `${rect.left}px`;
299
+ }
300
+ }
301
+
302
+ private addGlobalListeners(): void {
303
+ this.removeGlobalListeners();
304
+ this.scrollHandler = () => {
305
+ requestAnimationFrame(() => this.updateDropdownPosition());
306
+ };
307
+ this.resizeHandler = () => {
308
+ requestAnimationFrame(() => this.updateDropdownPosition());
309
+ };
310
+ document.addEventListener('scroll', this.scrollHandler, { capture: true, passive: true });
311
+ window.addEventListener('resize', this.resizeHandler, { passive: true });
312
+ }
313
+
314
+ private removeGlobalListeners(): void {
315
+ if (this.scrollHandler) {
316
+ document.removeEventListener('scroll', this.scrollHandler, { capture: true } as EventListenerOptions);
317
+ this.scrollHandler = null;
318
+ }
319
+ if (this.resizeHandler) {
320
+ window.removeEventListener('resize', this.resizeHandler);
321
+ this.resizeHandler = null;
322
+ }
323
+ }
324
+
325
+ ngOnDestroy(): void {
326
+ this.removeGlobalListeners();
327
+ }
328
+
329
+ @HostListener('document:click', ['$event'])
330
+ onDocumentClick(event: MouseEvent): void {
331
+ if (!this.elRef.nativeElement.contains(event.target)) {
332
+ this.close();
333
+ }
334
+ }
335
+
336
+ @HostListener('keydown.escape')
337
+ onEscape(): void {
338
+ this.close();
339
+ }
340
+ }
@@ -0,0 +1 @@
1
+ export { SnyDateRangePickerComponent } from './date-range-picker.component';
@@ -1636,6 +1636,10 @@ declare class SnyLinkDirective {
1636
1636
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SnyLinkDirective, "a[snyLink]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1637
1637
  }
1638
1638
 
1639
+ interface DateRange {
1640
+ start: Date | null;
1641
+ end: Date | null;
1642
+ }
1639
1643
  interface CalendarDay {
1640
1644
  date: Date;
1641
1645
  day: number;
@@ -1643,34 +1647,151 @@ interface CalendarDay {
1643
1647
  isToday: boolean;
1644
1648
  isSelected: boolean;
1645
1649
  isDisabled: boolean;
1650
+ isRangeStart: boolean;
1651
+ isRangeEnd: boolean;
1652
+ isInRange: boolean;
1653
+ isRangePreview: boolean;
1654
+ }
1655
+ type CalendarMode = 'single' | 'range';
1656
+ interface DatePickerPreset {
1657
+ label: string;
1658
+ range: DateRange;
1646
1659
  }
1660
+
1647
1661
  declare class SnyCalendarComponent implements ControlValueAccessor {
1648
1662
  readonly value: _angular_core.ModelSignal<Date | null>;
1649
1663
  readonly min: _angular_core.InputSignal<Date | undefined>;
1650
1664
  readonly max: _angular_core.InputSignal<Date | undefined>;
1651
1665
  readonly locale: _angular_core.InputSignal<string>;
1652
1666
  readonly class: _angular_core.InputSignal<string>;
1667
+ readonly mode: _angular_core.InputSignal<CalendarMode>;
1668
+ readonly rangeValue: _angular_core.ModelSignal<DateRange | null>;
1669
+ readonly showNavigation: _angular_core.InputSignal<boolean>;
1670
+ readonly initialViewDate: _angular_core.InputSignal<Date | undefined>;
1671
+ readonly borderless: _angular_core.InputSignal<boolean>;
1672
+ readonly hostClass: _angular_core.Signal<"inline-block p-3 bg-background" | "inline-block p-4 rounded-md border border-border bg-background">;
1653
1673
  private readonly _disabledByCva;
1674
+ readonly hoveredDate: _angular_core.WritableSignal<Date | null>;
1654
1675
  readonly viewDate: _angular_core.WritableSignal<Date>;
1655
1676
  readonly weekDays: string[];
1656
1677
  private _onChange;
1657
1678
  protected onTouched: () => void;
1658
- writeValue(val: Date | null): void;
1659
- registerOnChange(fn: (value: Date | null) => void): void;
1679
+ writeValue(val: unknown): void;
1680
+ registerOnChange(fn: (value: unknown) => void): void;
1660
1681
  registerOnTouched(fn: () => void): void;
1661
1682
  setDisabledState(isDisabled: boolean): void;
1662
1683
  readonly monthYearLabel: _angular_core.Signal<string>;
1663
1684
  readonly days: _angular_core.Signal<CalendarDay[]>;
1664
1685
  prevMonth(): void;
1665
1686
  nextMonth(): void;
1666
- selectDate(date: Date): void;
1687
+ onDayClick(date: Date): void;
1688
+ onDayHover(date: Date | null): void;
1667
1689
  onKeydown(event: KeyboardEvent): void;
1668
1690
  dayClass(day: CalendarDay): string;
1669
1691
  private navigateDays;
1670
1692
  private createDay;
1671
1693
  private isSameDay;
1672
1694
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SnyCalendarComponent, never>;
1673
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SnyCalendarComponent, "sny-calendar", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
1695
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SnyCalendarComponent, "sny-calendar", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "rangeValue": { "alias": "rangeValue"; "required": false; "isSignal": true; }; "showNavigation": { "alias": "showNavigation"; "required": false; "isSignal": true; }; "initialViewDate": { "alias": "initialViewDate"; "required": false; "isSignal": true; }; "borderless": { "alias": "borderless"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "rangeValue": "rangeValueChange"; }, never, never, true, never>;
1696
+ }
1697
+
1698
+ declare const datePickerTriggerVariants: (props?: ({
1699
+ size?: "sm" | "md" | "lg" | null | undefined;
1700
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1701
+ type DatePickerSize = 'sm' | 'md' | 'lg';
1702
+
1703
+ declare class SnyDatePickerComponent implements ControlValueAccessor, OnDestroy {
1704
+ readonly value: _angular_core.ModelSignal<Date | null>;
1705
+ readonly placeholder: _angular_core.InputSignal<string>;
1706
+ readonly size: _angular_core.InputSignal<DatePickerSize>;
1707
+ readonly locale: _angular_core.InputSignal<string>;
1708
+ readonly dateFormat: _angular_core.InputSignal<Intl.DateTimeFormatOptions>;
1709
+ readonly min: _angular_core.InputSignal<Date | undefined>;
1710
+ readonly max: _angular_core.InputSignal<Date | undefined>;
1711
+ readonly clearable: _angular_core.InputSignal<boolean>;
1712
+ readonly disabled: _angular_core.InputSignal<boolean>;
1713
+ readonly class: _angular_core.InputSignal<string>;
1714
+ readonly open: _angular_core.WritableSignal<boolean>;
1715
+ readonly internalValue: _angular_core.WritableSignal<Date | null>;
1716
+ private readonly _disabledByCva;
1717
+ protected readonly isDisabled: _angular_core.Signal<boolean>;
1718
+ private readonly triggerRef;
1719
+ private readonly dropdownRef;
1720
+ private readonly elRef;
1721
+ private scrollHandler;
1722
+ private resizeHandler;
1723
+ private _onChange;
1724
+ protected onTouched: () => void;
1725
+ writeValue(val: Date | null): void;
1726
+ registerOnChange(fn: (value: Date | null) => void): void;
1727
+ registerOnTouched(fn: () => void): void;
1728
+ setDisabledState(isDisabled: boolean): void;
1729
+ readonly displayValue: _angular_core.Signal<string>;
1730
+ protected readonly triggerClass: _angular_core.Signal<string>;
1731
+ onDateSelected(date: Date | null): void;
1732
+ clear(event: Event): void;
1733
+ toggle(): void;
1734
+ close(): void;
1735
+ private updateDropdownPosition;
1736
+ private addGlobalListeners;
1737
+ private removeGlobalListeners;
1738
+ ngOnDestroy(): void;
1739
+ onDocumentClick(event: MouseEvent): void;
1740
+ onEscape(): void;
1741
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SnyDatePickerComponent, never>;
1742
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SnyDatePickerComponent, "sny-date-picker", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "dateFormat": { "alias": "dateFormat"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
1743
+ }
1744
+
1745
+ declare class SnyDateRangePickerComponent implements ControlValueAccessor, OnDestroy {
1746
+ readonly value: _angular_core.ModelSignal<DateRange | null>;
1747
+ readonly placeholder: _angular_core.InputSignal<string>;
1748
+ readonly size: _angular_core.InputSignal<DatePickerSize>;
1749
+ readonly locale: _angular_core.InputSignal<string>;
1750
+ readonly dateFormat: _angular_core.InputSignal<Intl.DateTimeFormatOptions>;
1751
+ readonly separator: _angular_core.InputSignal<string>;
1752
+ readonly dualCalendar: _angular_core.InputSignal<boolean>;
1753
+ readonly presets: _angular_core.InputSignal<DatePickerPreset[]>;
1754
+ readonly min: _angular_core.InputSignal<Date | undefined>;
1755
+ readonly max: _angular_core.InputSignal<Date | undefined>;
1756
+ readonly clearable: _angular_core.InputSignal<boolean>;
1757
+ readonly disabled: _angular_core.InputSignal<boolean>;
1758
+ readonly class: _angular_core.InputSignal<string>;
1759
+ readonly open: _angular_core.WritableSignal<boolean>;
1760
+ readonly internalRange: _angular_core.WritableSignal<DateRange | null>;
1761
+ readonly leftViewDate: _angular_core.WritableSignal<Date>;
1762
+ private readonly _disabledByCva;
1763
+ protected readonly isDisabled: _angular_core.Signal<boolean>;
1764
+ private readonly triggerRef;
1765
+ private readonly dropdownRef;
1766
+ private readonly elRef;
1767
+ private scrollHandler;
1768
+ private resizeHandler;
1769
+ private _onChange;
1770
+ protected onTouched: () => void;
1771
+ readonly rightViewDate: _angular_core.Signal<Date>;
1772
+ readonly leftMonthLabel: _angular_core.Signal<string>;
1773
+ readonly rightMonthLabel: _angular_core.Signal<string>;
1774
+ readonly displayValue: _angular_core.Signal<string>;
1775
+ protected readonly triggerClass: _angular_core.Signal<string>;
1776
+ writeValue(val: DateRange | null): void;
1777
+ registerOnChange(fn: (value: DateRange | null) => void): void;
1778
+ registerOnTouched(fn: () => void): void;
1779
+ setDisabledState(isDisabled: boolean): void;
1780
+ onRangeChanged(range: DateRange | null): void;
1781
+ selectPreset(preset: DatePickerPreset): void;
1782
+ clear(event: Event): void;
1783
+ prevMonth(): void;
1784
+ nextMonth(): void;
1785
+ toggle(): void;
1786
+ close(): void;
1787
+ private updateDropdownPosition;
1788
+ private addGlobalListeners;
1789
+ private removeGlobalListeners;
1790
+ ngOnDestroy(): void;
1791
+ onDocumentClick(event: MouseEvent): void;
1792
+ onEscape(): void;
1793
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SnyDateRangePickerComponent, never>;
1794
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SnyDateRangePickerComponent, "sny-date-range-picker", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "dateFormat": { "alias": "dateFormat"; "required": false; "isSignal": true; }; "separator": { "alias": "separator"; "required": false; "isSignal": true; }; "dualCalendar": { "alias": "dualCalendar"; "required": false; "isSignal": true; }; "presets": { "alias": "presets"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
1674
1795
  }
1675
1796
 
1676
1797
  type ValidatorHintVariant = 'error' | 'success' | 'warning' | 'info';
@@ -1695,5 +1816,5 @@ declare class SnyValidatorHintDirective {
1695
1816
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SnyValidatorHintDirective, "[snyValidatorHint]", never, { "when": { "alias": "when"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1696
1817
  }
1697
1818
 
1698
- export { SNY_ACCORDION, SNY_ACCORDION_ITEM, SNY_CAROUSEL, SNY_CHAT_BUBBLE, SNY_CONFIG, SNY_DIALOG_DATA, SNY_DRAWER, SNY_DROPDOWN, SNY_FAB, SNY_SHEET_DATA, SNY_STEPS, SNY_TABLE, SNY_TABS, SNY_TIMELINE, SnyAccordionContentDirective, SnyAccordionDirective, SnyAccordionItemDirective, SnyAccordionTriggerDirective, SnyAlertDescriptionDirective, SnyAlertDirective, SnyAlertTitleDirective, SnyAvatarComponent, SnyBadgeDirective, SnyBreadcrumbDirective, SnyBreadcrumbItemDirective, SnyBreadcrumbLinkDirective, SnyBreadcrumbListDirective, SnyBreadcrumbPageDirective, SnyBreadcrumbSeparatorDirective, SnyBulkActionsDefDirective, SnyButtonDirective, SnyButtonGroupDirective, SnyCalendarComponent, SnyCardContentDirective, SnyCardDescriptionDirective, SnyCardDirective, SnyCardFooterDirective, SnyCardHeaderDirective, SnyCardTitleDirective, SnyCarouselContentDirective, SnyCarouselDirective, SnyCarouselItemDirective, SnyCarouselNextDirective, SnyCarouselPrevDirective, SnyCellDefDirective, SnyChatBubbleAvatarDirective, SnyChatBubbleBodyDirective, SnyChatBubbleContentDirective, SnyChatBubbleDirective, SnyChatBubbleFooterDirective, SnyChatBubbleHeaderDirective, SnyCheckboxDirective, SnyComboboxComponent, SnyDataTableComponent, SnyDialogCloseDirective, SnyDialogContentDirective, SnyDialogDescriptionDirective, SnyDialogFooterDirective, SnyDialogHeaderDirective, SnyDialogRef, SnyDialogService, SnyDialogTitleDirective, SnyDiffComponent, SnyDividerComponent, SnyDockDirective, SnyDockItemDirective, SnyDrawerContentDirective, SnyDrawerLayoutComponent, SnyDrawerLayoutDirective, SnyDrawerSideDirective, SnyDropdownContentDirective, SnyDropdownDirective, SnyDropdownTriggerDirective, SnyFabActionDirective, SnyFabDirective, SnyFabTriggerDirective, SnyFieldsetContentDirective, SnyFieldsetDirective, SnyFieldsetLegendDirective, SnyFileInputComponent, SnyHeaderCellDefDirective, SnyIndicatorBadgeDirective, SnyIndicatorDirective, SnyInputDirective, SnyKbdDirective, SnyLabelDirective, SnyLinkDirective, SnyListDirective, SnyListItemActionDirective, SnyListItemContentDirective, SnyListItemDirective, SnyListItemIconDirective, SnyLoaderComponent, SnyMenuContentDirective, SnyMenuItemDirective, SnyMenuLabelDirective, SnyMenuSeparatorDirective, SnyNavbarBrandDirective, SnyNavbarContentDirective, SnyNavbarDirective, SnyNavbarEndDirective, SnyPaginationComponent, SnyProgressComponent, SnyRadialProgressComponent, SnyRadioDirective, SnyRatingComponent, SnyRowExpandDefDirective, SnySelectComponent, SnySheetCloseDirective, SnySheetContentDirective, SnySheetDescriptionDirective, SnySheetHeaderDirective, SnySheetRef, SnySheetService, SnySheetTitleDirective, SnySkeletonDirective, SnySliderComponent, SnyStatDescriptionDirective, SnyStatDirective, SnyStatFigureDirective, SnyStatTitleDirective, SnyStatValueDirective, SnyStatusDirective, SnyStepDirective, SnyStepsDirective, SnySwitchComponent, SnyTableBodyDirective, SnyTableCaptionDirective, SnyTableCellDirective, SnyTableDirective, SnyTableFooterDirective, SnyTableHeadDirective, SnyTableHeaderDirective, SnyTableRowDirective, SnyTabsContentDirective, SnyTabsDirective, SnyTabsListDirective, SnyTabsTriggerDirective, SnyTextareaDirective, SnyTimelineDirective, SnyTimelineEndDirective, SnyTimelineItemDirective, SnyTimelineMiddleDirective, SnyTimelineStartDirective, SnyToastService, SnyToasterComponent, SnyToggleDirective, SnyTooltipDirective, SnyValidatorDirective, SnyValidatorHintDirective, ThemeService, alertVariants, avatarVariants, badgeVariants, buttonGroupVariants, buttonVariants, cardVariants, checkboxVariants, cn, comboboxTriggerVariants, dividerVariants, dropdownContentVariants, dropdownItemVariants, fieldsetVariants, fileInputVariants, inputVariants, kbdVariants, labelVariants, linkVariants, loaderVariants, paginationItemVariants, progressBarVariants, progressTrackVariants, provideSonnyUI, radioVariants, ratingVariants, selectTriggerVariants, skeletonVariants, sliderTrackVariants, statusVariants, switchTrackVariants, tableCellVariants, tableVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, toastVariants, toggleVariants, tooltipVariants };
1699
- export type { AlertVariant, AvatarSize, AvatarVariant, BadgeSize, BadgeVariant, ButtonGroupOrientation, ButtonSize, ButtonVariant, CardPadding, CardVariant, ChatBubbleAlign, ChatBubbleContentVariant, CheckboxSize, ComboboxOption, ComboboxSize, DataTableColumn, DataTablePaginationConfig, DividerOrientation, DividerVariant, DockPosition, DrawerSide, DropdownItemVariant, FabDirection, FabPosition, FieldsetVariant, FileInputSize, FileInputVariant, IndicatorPosition, IndicatorVariant, InputSize, InputVariant, KbdSize, LinkVariant, ListVariant, LoaderSize, LoaderVariant, NavbarVariant, PaginationSize, PaginationVariant, ProgressSize, ProgressVariant, RadialProgressSize, RadialProgressVariant, RadioSize, RatingSize, RatingVariant, SelectOption, SelectSize, SheetSide, SkeletonSize, SkeletonVariant, SliderSize, SnyDialogConfig, SnySheetConfig, SonnyConfig, SortDirection, SortState, StatDescriptionVariant, StatusSize, StatusVariant, StepStatus, StepsOrientation, StepsSize, SwitchSize, TableDensity, TableVariant, TextareaResize, TextareaSize, TextareaVariant, Theme, TimelineConnect, TimelineMiddleVariant, TimelineOrientation, ToastAction, ToastConfig, ToastData, ToastPosition, ToastVariant, ToggleSize, ToggleVariant, TooltipPosition, ValidatorHintVariant };
1819
+ export { SNY_ACCORDION, SNY_ACCORDION_ITEM, SNY_CAROUSEL, SNY_CHAT_BUBBLE, SNY_CONFIG, SNY_DIALOG_DATA, SNY_DRAWER, SNY_DROPDOWN, SNY_FAB, SNY_SHEET_DATA, SNY_STEPS, SNY_TABLE, SNY_TABS, SNY_TIMELINE, SnyAccordionContentDirective, SnyAccordionDirective, SnyAccordionItemDirective, SnyAccordionTriggerDirective, SnyAlertDescriptionDirective, SnyAlertDirective, SnyAlertTitleDirective, SnyAvatarComponent, SnyBadgeDirective, SnyBreadcrumbDirective, SnyBreadcrumbItemDirective, SnyBreadcrumbLinkDirective, SnyBreadcrumbListDirective, SnyBreadcrumbPageDirective, SnyBreadcrumbSeparatorDirective, SnyBulkActionsDefDirective, SnyButtonDirective, SnyButtonGroupDirective, SnyCalendarComponent, SnyCardContentDirective, SnyCardDescriptionDirective, SnyCardDirective, SnyCardFooterDirective, SnyCardHeaderDirective, SnyCardTitleDirective, SnyCarouselContentDirective, SnyCarouselDirective, SnyCarouselItemDirective, SnyCarouselNextDirective, SnyCarouselPrevDirective, SnyCellDefDirective, SnyChatBubbleAvatarDirective, SnyChatBubbleBodyDirective, SnyChatBubbleContentDirective, SnyChatBubbleDirective, SnyChatBubbleFooterDirective, SnyChatBubbleHeaderDirective, SnyCheckboxDirective, SnyComboboxComponent, SnyDataTableComponent, SnyDatePickerComponent, SnyDateRangePickerComponent, SnyDialogCloseDirective, SnyDialogContentDirective, SnyDialogDescriptionDirective, SnyDialogFooterDirective, SnyDialogHeaderDirective, SnyDialogRef, SnyDialogService, SnyDialogTitleDirective, SnyDiffComponent, SnyDividerComponent, SnyDockDirective, SnyDockItemDirective, SnyDrawerContentDirective, SnyDrawerLayoutComponent, SnyDrawerLayoutDirective, SnyDrawerSideDirective, SnyDropdownContentDirective, SnyDropdownDirective, SnyDropdownTriggerDirective, SnyFabActionDirective, SnyFabDirective, SnyFabTriggerDirective, SnyFieldsetContentDirective, SnyFieldsetDirective, SnyFieldsetLegendDirective, SnyFileInputComponent, SnyHeaderCellDefDirective, SnyIndicatorBadgeDirective, SnyIndicatorDirective, SnyInputDirective, SnyKbdDirective, SnyLabelDirective, SnyLinkDirective, SnyListDirective, SnyListItemActionDirective, SnyListItemContentDirective, SnyListItemDirective, SnyListItemIconDirective, SnyLoaderComponent, SnyMenuContentDirective, SnyMenuItemDirective, SnyMenuLabelDirective, SnyMenuSeparatorDirective, SnyNavbarBrandDirective, SnyNavbarContentDirective, SnyNavbarDirective, SnyNavbarEndDirective, SnyPaginationComponent, SnyProgressComponent, SnyRadialProgressComponent, SnyRadioDirective, SnyRatingComponent, SnyRowExpandDefDirective, SnySelectComponent, SnySheetCloseDirective, SnySheetContentDirective, SnySheetDescriptionDirective, SnySheetHeaderDirective, SnySheetRef, SnySheetService, SnySheetTitleDirective, SnySkeletonDirective, SnySliderComponent, SnyStatDescriptionDirective, SnyStatDirective, SnyStatFigureDirective, SnyStatTitleDirective, SnyStatValueDirective, SnyStatusDirective, SnyStepDirective, SnyStepsDirective, SnySwitchComponent, SnyTableBodyDirective, SnyTableCaptionDirective, SnyTableCellDirective, SnyTableDirective, SnyTableFooterDirective, SnyTableHeadDirective, SnyTableHeaderDirective, SnyTableRowDirective, SnyTabsContentDirective, SnyTabsDirective, SnyTabsListDirective, SnyTabsTriggerDirective, SnyTextareaDirective, SnyTimelineDirective, SnyTimelineEndDirective, SnyTimelineItemDirective, SnyTimelineMiddleDirective, SnyTimelineStartDirective, SnyToastService, SnyToasterComponent, SnyToggleDirective, SnyTooltipDirective, SnyValidatorDirective, SnyValidatorHintDirective, ThemeService, alertVariants, avatarVariants, badgeVariants, buttonGroupVariants, buttonVariants, cardVariants, checkboxVariants, cn, comboboxTriggerVariants, datePickerTriggerVariants, dividerVariants, dropdownContentVariants, dropdownItemVariants, fieldsetVariants, fileInputVariants, inputVariants, kbdVariants, labelVariants, linkVariants, loaderVariants, paginationItemVariants, progressBarVariants, progressTrackVariants, provideSonnyUI, radioVariants, ratingVariants, selectTriggerVariants, skeletonVariants, sliderTrackVariants, statusVariants, switchTrackVariants, tableCellVariants, tableVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, toastVariants, toggleVariants, tooltipVariants };
1820
+ export type { AlertVariant, AvatarSize, AvatarVariant, BadgeSize, BadgeVariant, ButtonGroupOrientation, ButtonSize, ButtonVariant, CalendarDay, CalendarMode, CardPadding, CardVariant, ChatBubbleAlign, ChatBubbleContentVariant, CheckboxSize, ComboboxOption, ComboboxSize, DataTableColumn, DataTablePaginationConfig, DatePickerPreset, DatePickerSize, DateRange, DividerOrientation, DividerVariant, DockPosition, DrawerSide, DropdownItemVariant, FabDirection, FabPosition, FieldsetVariant, FileInputSize, FileInputVariant, IndicatorPosition, IndicatorVariant, InputSize, InputVariant, KbdSize, LinkVariant, ListVariant, LoaderSize, LoaderVariant, NavbarVariant, PaginationSize, PaginationVariant, ProgressSize, ProgressVariant, RadialProgressSize, RadialProgressVariant, RadioSize, RatingSize, RatingVariant, SelectOption, SelectSize, SheetSide, SkeletonSize, SkeletonVariant, SliderSize, SnyDialogConfig, SnySheetConfig, SonnyConfig, SortDirection, SortState, StatDescriptionVariant, StatusSize, StatusVariant, StepStatus, StepsOrientation, StepsSize, SwitchSize, TableDensity, TableVariant, TextareaResize, TextareaSize, TextareaVariant, Theme, TimelineConnect, TimelineMiddleVariant, TimelineOrientation, ToastAction, ToastConfig, ToastData, ToastPosition, ToastVariant, ToggleSize, ToggleVariant, TooltipPosition, ValidatorHintVariant };