@wlcm/angular 19.1.4 → 19.1.5

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,146 +1,32 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, output, input, effect, Directive, forwardRef, Optional, Inject, Injectable, InjectionToken, ElementRef, Injector, ViewContainerRef, HostBinding, signal, computed, ViewChild, HostListener, inject, Host, ContentChild, viewChild, contentChild, NgModule } from '@angular/core';
2
+ import { InjectionToken, Injectable, input, Injector, ViewContainerRef, Directive, HostBinding, HostListener, forwardRef, ElementRef, Optional, Inject, signal, computed, Component, inject, Host, Input, ContentChild, output, effect, ViewChild, viewChild, contentChild, NgModule } from '@angular/core';
3
3
  import { CommonModule } from '@angular/common';
4
- import * as i2$1 from '@angular/material/datepicker';
5
- import { yearsPerPage, MatCalendar, MatRangeDateSelectionModel, MatDateSelectionModel, MAT_DATE_RANGE_SELECTION_STRATEGY, DefaultMatCalendarRangeStrategy, MatMonthView, MatDatepickerModule, DateRange, MatSingleDateSelectionModel } from '@angular/material/datepicker';
4
+ import * as i2 from '@angular/material/datepicker';
5
+ import { MatRangeDateSelectionModel, MatDateSelectionModel, DateRange, yearsPerPage, MatCalendar, MAT_DATE_RANGE_SELECTION_STRATEGY, DefaultMatCalendarRangeStrategy, MatDatepickerModule, MatMonthView, MatSingleDateSelectionModel } from '@angular/material/datepicker';
6
6
  import { WLCM_FORM_FIELD, WLCM_FORM_CONTROL_PROVIDER, WLCM_INPUT_BINDER, WlcmFormsModule } from '@wlcm/angular/forms';
7
- import { merge, EMPTY, filter, Subject, tap, startWith, takeUntil, BehaviorSubject, switchMap, fromEvent, map } from 'rxjs';
8
- import * as i1$1 from '@angular/cdk/overlay';
9
- import { OverlayRef, CdkOverlayOrigin, OverlayConfig, Overlay } from '@angular/cdk/overlay';
7
+ import { merge, EMPTY, filter, BehaviorSubject, switchMap, fromEvent, map, Subject, tap, startWith, takeUntil } from 'rxjs';
8
+ import * as i3 from '@angular/forms';
9
+ import { NG_VALUE_ACCESSOR, NG_VALIDATORS, ControlContainer } from '@angular/forms';
10
+ import * as i1$1 from '@angular/material/core';
11
+ import { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS } from '@angular/material/core';
10
12
  import { __decorate, __metadata } from 'tslib';
11
- import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
12
- import * as i2 from '@wlcm/angular/button';
13
- import { WlcmButtonModule } from '@wlcm/angular/button';
14
- import * as i1 from '@angular/material/core';
15
- import { MAT_DATE_FORMATS, MAT_DATE_LOCALE, DateAdapter } from '@angular/material/core';
16
- import { isBefore, startOfDay, isAfter, format, endOfMonth, add, startOfMonth, parse, isValid } from 'date-fns';
17
- import { WlcmIconName, WlcmIconDirective } from '@wlcm/angular/core';
13
+ import { format, isBefore, startOfDay, isAfter, parse, isValid, endOfMonth, add, startOfMonth } from 'date-fns';
18
14
  import { DateFnsAdapter } from '@angular/material-date-fns-adapter';
19
15
  import { enUS } from 'date-fns/locale';
16
+ import * as i1 from '@angular/cdk/overlay';
17
+ import { OverlayRef, OverlayConfig, Overlay } from '@angular/cdk/overlay';
20
18
  import { ComponentPortal } from '@angular/cdk/portal';
21
- import * as i3 from '@angular/forms';
22
- import { NG_VALUE_ACCESSOR, NG_VALIDATORS, ControlContainer } from '@angular/forms';
23
-
24
- class WlcmDateRangePickerBottomPanelComponent {
25
- constructor(picker) {
26
- this.picker = picker;
27
- }
28
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangePickerBottomPanelComponent, deps: [{ token: WlcmDateRangePickerComponent }], target: i0.ɵɵFactoryTarget.Component }); }
29
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: WlcmDateRangePickerBottomPanelComponent, isStandalone: true, selector: "wlcm-date-range-picker-bottom-panel", ngImport: i0, template: "<div class=\"wlcm-date-range-picker-bottom-panel\">\n <wlcm-button type=\"paddingless\" (clicked)=\"picker.reset()\">Reset</wlcm-button>\n\n <wlcm-button (clicked)=\"picker.apply()\" [isDisabled]=\"!picker.isComplete()\">\n Apply\n </wlcm-button>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: WlcmButtonModule }, { kind: "component", type: i2.WlcmButtonComponent, selector: "wlcm-button", inputs: ["type", "size", "isDisabled", "isLoading"], outputs: ["clicked"] }] }); }
30
- }
31
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangePickerBottomPanelComponent, decorators: [{
32
- type: Component,
33
- args: [{ selector: 'wlcm-date-range-picker-bottom-panel', standalone: true, imports: [CommonModule, WlcmButtonModule], template: "<div class=\"wlcm-date-range-picker-bottom-panel\">\n <wlcm-button type=\"paddingless\" (clicked)=\"picker.reset()\">Reset</wlcm-button>\n\n <wlcm-button (clicked)=\"picker.apply()\" [isDisabled]=\"!picker.isComplete()\">\n Apply\n </wlcm-button>\n</div>\n" }]
34
- }], ctorParameters: () => [{ type: WlcmDateRangePickerComponent }] });
35
-
36
- class WlcmDataRangeCalendar {
37
- constructor(location, element, calendar, dateAdapter, datepickerConfig) {
38
- this.element = element;
39
- this.calendar = calendar;
40
- this.dateAdapter = dateAdapter;
41
- this.datepickerConfig = datepickerConfig;
42
- this.dateChange = output();
43
- this.viewChange = output();
44
- this.disabled = input(false);
45
- this.location = location;
46
- effect(() => {
47
- if (this.disabled()) {
48
- this.element.nativeElement.classList.add('wlcm-calendar-disabled');
49
- }
50
- else {
51
- this.element.nativeElement.classList.remove('wlcm-calendar-disabled');
52
- }
53
- });
54
- this.handleConfigValues();
55
- }
56
- get minDate() {
57
- return this.datepickerConfig.minDate?.();
58
- }
59
- get maxDate() {
60
- return this.datepickerConfig.maxDate?.();
61
- }
62
- prevMonth() {
63
- this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.calendar.activeDate, -1));
64
- }
65
- nextMonth() {
66
- this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.calendar.activeDate, 1));
67
- }
68
- prevYear() {
69
- this.dateChange.emit(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage));
70
- }
71
- nextYear() {
72
- this.dateChange.emit(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage));
73
- }
74
- handleConfigValues() {
75
- this.calendar.dateFilter = (date) => {
76
- if (this.minDate && isBefore(startOfDay(date), startOfDay(this.minDate)))
77
- return false;
78
- if (this.maxDate && isAfter(startOfDay(date), startOfDay(this.maxDate)))
79
- return false;
80
- return true;
81
- };
82
- }
83
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDataRangeCalendar, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
84
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.4", type: WlcmDataRangeCalendar, isStandalone: true, inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateChange: "dateChange", viewChange: "viewChange" }, ngImport: i0 }); }
85
- }
86
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDataRangeCalendar, decorators: [{
87
- type: Directive
88
- }], ctorParameters: () => [{ type: undefined }, { type: i0.ElementRef }, { type: i2$1.MatCalendar }, { type: i1.DateAdapter }, { type: undefined }] });
19
+ import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
20
+ import * as i2$1 from '@wlcm/angular/button';
21
+ import { WlcmButtonModule } from '@wlcm/angular/button';
22
+ import { WlcmIconName, WlcmIconDirective } from '@wlcm/angular/core';
89
23
 
90
- class WlcmCalendarHeaderComponent {
91
- constructor(dateAdapter, dateFormats, calendar) {
92
- this.dateAdapter = dateAdapter;
93
- this.dateFormats = dateFormats;
94
- this.calendar = calendar;
95
- this.WlcmIconName = WlcmIconName;
96
- this.next = input();
97
- this.previous = input();
98
- this.disableLeftArrow = input(false);
99
- this.disableRightArrow = input(false);
100
- this.displayLeftArrow = input(true);
101
- this.displayRightArrow = input(true);
102
- }
103
- previousClicked() {
104
- if (this.previous())
105
- return this.previous()();
106
- this.calendar.activeDate =
107
- this.calendar.currentView == 'month'
108
- ? this.dateAdapter.addCalendarMonths(this.calendar.activeDate, -1)
109
- : this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage);
110
- }
111
- nextClicked() {
112
- if (this.next())
113
- return this.next()();
114
- this.calendar.activeDate =
115
- this.calendar.currentView == 'month'
116
- ? this.dateAdapter.addCalendarMonths(this.calendar.activeDate, 1)
117
- : this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage);
118
- }
119
- changeCalendarView() {
120
- if (this.calendar.currentView === 'multi-year') {
121
- this.calendar.currentView = 'month';
122
- return;
123
- }
124
- this.calendar.currentView = 'multi-year';
125
- }
126
- get periodLabel() {
127
- return this.dateAdapter.format(this.calendar.activeDate, this.dateFormats.display.monthYearLabel);
128
- }
129
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmCalendarHeaderComponent, deps: [{ token: i1.DateAdapter }, { token: MAT_DATE_FORMATS, optional: true }, { token: forwardRef(() => MatCalendar) }], target: i0.ɵɵFactoryTarget.Component }); }
130
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: WlcmCalendarHeaderComponent, isStandalone: true, selector: "wlcm-calendar-header", inputs: { next: { classPropertyName: "next", publicName: "next", isSignal: true, isRequired: false, transformFunction: null }, previous: { classPropertyName: "previous", publicName: "previous", isSignal: true, isRequired: false, transformFunction: null }, disableLeftArrow: { classPropertyName: "disableLeftArrow", publicName: "disableLeftArrow", isSignal: true, isRequired: false, transformFunction: null }, disableRightArrow: { classPropertyName: "disableRightArrow", publicName: "disableRightArrow", isSignal: true, isRequired: false, transformFunction: null }, displayLeftArrow: { classPropertyName: "displayLeftArrow", publicName: "displayLeftArrow", isSignal: true, isRequired: false, transformFunction: null }, displayRightArrow: { classPropertyName: "displayRightArrow", publicName: "displayRightArrow", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wlcm-calendar-header" }, ngImport: i0, template: "<div class=\"wlcm-calendar-header-button-container\">\n @if (displayLeftArrow()) {\n <button\n class=\"wlcm-calendar-header-button wlcm-calendar-header-button-left\"\n [disabled]=\"disableLeftArrow()\"\n (click)=\"previousClicked()\"\n >\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n </button>\n }\n</div>\n\n<button\n class=\"wlcm-calendar-header-change-view-button\"\n (click)=\"changeCalendarView()\"\n>\n <div class=\"wlcm-calendar-header-period-label\">\n {{ periodLabel }}\n </div>\n\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n</button>\n\n<div class=\"wlcm-calendar-header-button-container\">\n @if (displayRightArrow()) {\n <button\n class=\"wlcm-calendar-header-button wlcm-calendar-header-button-right\"\n [disabled]=\"disableRightArrow()\"\n (click)=\"nextClicked()\"\n >\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n </button>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: WlcmIconDirective, selector: "[wlcmIcon]", inputs: ["wlcmIcon", "wlcmIconStopPropagation"], outputs: ["wlcmIconClicked"] }] }); }
131
- }
132
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmCalendarHeaderComponent, decorators: [{
133
- type: Component,
134
- args: [{ selector: 'wlcm-calendar-header', host: { class: 'wlcm-calendar-header' }, standalone: true, imports: [CommonModule, WlcmIconDirective], template: "<div class=\"wlcm-calendar-header-button-container\">\n @if (displayLeftArrow()) {\n <button\n class=\"wlcm-calendar-header-button wlcm-calendar-header-button-left\"\n [disabled]=\"disableLeftArrow()\"\n (click)=\"previousClicked()\"\n >\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n </button>\n }\n</div>\n\n<button\n class=\"wlcm-calendar-header-change-view-button\"\n (click)=\"changeCalendarView()\"\n>\n <div class=\"wlcm-calendar-header-period-label\">\n {{ periodLabel }}\n </div>\n\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n</button>\n\n<div class=\"wlcm-calendar-header-button-container\">\n @if (displayRightArrow()) {\n <button\n class=\"wlcm-calendar-header-button wlcm-calendar-header-button-right\"\n [disabled]=\"disableRightArrow()\"\n (click)=\"nextClicked()\"\n >\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n </button>\n }\n</div>\n" }]
135
- }], ctorParameters: () => [{ type: i1.DateAdapter }, { type: undefined, decorators: [{
136
- type: Optional
137
- }, {
138
- type: Inject,
139
- args: [MAT_DATE_FORMATS]
140
- }] }, { type: i2$1.MatCalendar, decorators: [{
141
- type: Inject,
142
- args: [forwardRef(() => MatCalendar)]
143
- }] }] });
24
+ const WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL = new InjectionToken('WLCM_DATE_RANGE_SELECTION_MODEL');
25
+ const WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL_PROVIDER = {
26
+ provide: WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL,
27
+ useFactory: (adapter) => new MatRangeDateSelectionModel(adapter),
28
+ deps: [DateAdapter],
29
+ };
144
30
 
145
31
  function range(length, valueFunction) {
146
32
  const valuesArray = Array(length);
@@ -186,231 +72,47 @@ const WLCM_DEFAULT_DATEPICKER_PROVIDERS = [
186
72
  const WLCM_DATEPICKER_CONFIG = new InjectionToken('WLCM_DATEPICKER_CONFIG', { providedIn: 'root', factory: () => ({ selectOnly: false }) });
187
73
  const WLCM_DATEPICKER_INPUT_CLASS = 'wlcm-datepicker-input';
188
74
 
189
- class WlcmDateRangeCalendarHeaderComponent {
190
- constructor(rangeCalendar, dateFormats, calendar, datepickerConfig) {
191
- this.rangeCalendar = rangeCalendar;
192
- this.dateFormats = dateFormats;
193
- this.calendar = calendar;
194
- this.datepickerConfig = datepickerConfig;
195
- this.WlcmIconName = WlcmIconName;
196
- this.previous = () => {
197
- if (this.isPreviousDisabled)
198
- return;
199
- if (this.calendar.currentView !== 'month') {
200
- return this.rangeCalendar.prevYear();
201
- }
202
- return this.rangeCalendar.prevMonth();
203
- };
204
- this.next = () => {
205
- if (this.isNextDisabled)
206
- return;
207
- if (this.calendar.currentView !== 'month') {
208
- return this.rangeCalendar.nextYear();
209
- }
210
- return this.rangeCalendar.nextMonth();
211
- };
75
+ let WlcmDatepickerTrigger = class WlcmDatepickerTrigger {
76
+ get isOnlySelect() {
77
+ return this.selectOnly();
212
78
  }
213
- get minDate() {
214
- return this.datepickerConfig.minDate?.();
79
+ constructor(overlay, viewContainerRef, selectionModel) {
80
+ this.overlay = overlay;
81
+ this.viewContainerRef = viewContainerRef;
82
+ this.selectionModel = selectionModel;
83
+ this.minDate = input(this.defaultDatepickerConfig.minDate?.());
84
+ this.maxDate = input(this.defaultDatepickerConfig.maxDate?.());
85
+ this.selectOnly = input(this.defaultDatepickerConfig.selectOnly || false);
86
+ this.overlayRef = this.overlay.create(this.createOverlayConfig());
87
+ this.handleBackdropClick();
215
88
  }
216
- get maxDate() {
217
- return this.datepickerConfig.maxDate?.();
89
+ open() {
90
+ const injector = Injector.create({
91
+ providers: [{ provide: OverlayRef, useValue: this.overlayRef }],
92
+ parent: this.datepickerInjector,
93
+ });
94
+ const portal = new ComponentPortal(this.componentType, this.viewContainerRef, injector);
95
+ this.updatePositionStrategy();
96
+ this.componentRef = this.overlayRef.attach(portal);
218
97
  }
219
- get isPreviousDisabled() {
220
- if (!this.minDate)
221
- return false;
222
- let previousPeriod = endOfMonth(add(this.calendar.activeDate, { months: -1 }));
223
- if (this.calendar.currentView !== 'month') {
224
- previousPeriod = add(this.calendar.activeDate, { years: -1 });
225
- }
226
- return isBefore(previousPeriod, this.minDate);
98
+ close() {
99
+ this.overlayRef.detach();
227
100
  }
228
- get isNextDisabled() {
229
- if (!this.maxDate)
230
- return false;
231
- let nextPeriod = startOfMonth(add(this.calendar.activeDate, { months: 1 }));
232
- if (this.calendar.currentView !== 'month') {
233
- nextPeriod = add(this.calendar.activeDate, { years: 1 });
234
- }
235
- return isBefore(this.maxDate, nextPeriod);
101
+ get isOpen() {
102
+ return this.overlayRef.hasAttached();
236
103
  }
237
- get canDisplayLeftArrow() {
238
- return !this.rangeCalendar || this.rangeCalendar.location === 'left' || this.calendar.currentView !== 'month';
104
+ get opened() {
105
+ return merge(this.overlayRef?.attachments() || EMPTY).pipe(filter(() => this.overlayRef.hasAttached()));
239
106
  }
240
- get canDisplayRightArrow() {
241
- return !this.rangeCalendar || this.rangeCalendar.location === 'right' || this.calendar.currentView !== 'month';
107
+ get closed() {
108
+ return (this.overlayRef?.detachments() || EMPTY).pipe(filter(() => !this.overlayRef.hasAttached()));
242
109
  }
243
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangeCalendarHeaderComponent, deps: [{ token: WlcmDataRangeCalendar, optional: true }, { token: MAT_DATE_FORMATS, optional: true }, { token: forwardRef(() => MatCalendar) }, { token: WLCM_DATEPICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
244
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: WlcmDateRangeCalendarHeaderComponent, isStandalone: true, selector: "wlcm-date-range-calendar-header", ngImport: i0, template: "<wlcm-calendar-header\n [next]=\"next\"\n [previous]=\"previous\"\n [disableLeftArrow]=\"isPreviousDisabled\"\n [disableRightArrow]=\"isNextDisabled\"\n [displayLeftArrow]=\"canDisplayLeftArrow && !rangeCalendar.disabled()\"\n [displayRightArrow]=\"canDisplayRightArrow && !rangeCalendar.disabled()\"\n></wlcm-calendar-header>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: WlcmCalendarHeaderComponent, selector: "wlcm-calendar-header", inputs: ["next", "previous", "disableLeftArrow", "disableRightArrow", "displayLeftArrow", "displayRightArrow"] }] }); }
245
- }
246
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangeCalendarHeaderComponent, decorators: [{
247
- type: Component,
248
- args: [{ selector: 'wlcm-date-range-calendar-header', standalone: true, imports: [CommonModule, WlcmCalendarHeaderComponent], template: "<wlcm-calendar-header\n [next]=\"next\"\n [previous]=\"previous\"\n [disableLeftArrow]=\"isPreviousDisabled\"\n [disableRightArrow]=\"isNextDisabled\"\n [displayLeftArrow]=\"canDisplayLeftArrow && !rangeCalendar.disabled()\"\n [displayRightArrow]=\"canDisplayRightArrow && !rangeCalendar.disabled()\"\n></wlcm-calendar-header>\n" }]
249
- }], ctorParameters: () => [{ type: WlcmDataRangeCalendar, decorators: [{
250
- type: Optional
251
- }] }, { type: undefined, decorators: [{
252
- type: Optional
253
- }, {
254
- type: Inject,
255
- args: [MAT_DATE_FORMATS]
256
- }] }, { type: i2$1.MatCalendar, decorators: [{
257
- type: Inject,
258
- args: [forwardRef(() => MatCalendar)]
259
- }] }, { type: undefined, decorators: [{
260
- type: Inject,
261
- args: [WLCM_DATEPICKER_CONFIG]
262
- }] }] });
263
-
264
- const WLCM_DATE_RANGE_PICKER_CONFIG = new InjectionToken('WLCM_DATE_RANGE_PICKER_CONFIG', { providedIn: 'root', factory: () => ({}) });
265
-
266
- const WLCM_DATE_RANGE_SELECTION_MODEL = new InjectionToken('WLCM_DATE_RANGE_SELECTION_MODEL');
267
- const WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER = {
268
- provide: WLCM_DATE_RANGE_SELECTION_MODEL,
269
- useFactory: (adapter) => new MatRangeDateSelectionModel(adapter),
270
- deps: [DateAdapter],
271
- };
272
-
273
- const WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL = new InjectionToken('WLCM_DATE_RANGE_SELECTION_MODEL');
274
- const WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL_PROVIDER = {
275
- provide: WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL,
276
- useFactory: (adapter) => new MatRangeDateSelectionModel(adapter),
277
- deps: [DateAdapter],
278
- };
279
-
280
- let WlcmLeftCalendarDirective = class WlcmLeftCalendarDirective extends WlcmDataRangeCalendar {
281
- constructor(element, dateAdapter, calendar, datepickerConfig) {
282
- super('left', element, calendar, dateAdapter, datepickerConfig);
283
- this.element = element;
284
- this.dateAdapter = dateAdapter;
285
- this.calendar = calendar;
286
- this.datepickerConfig = datepickerConfig;
287
- this.handleYearChange();
288
- this.handleMonthChange();
289
- }
290
- handleYearChange() {
291
- this.calendar.yearSelected.pipe(untilDestroyed(this)).subscribe((date) => this.dateChange.emit(date));
292
- }
293
- handleMonthChange() {
294
- this.calendar.monthSelected.pipe(untilDestroyed(this)).subscribe((date) => this.dateChange.emit(date));
295
- }
296
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmLeftCalendarDirective, deps: [{ token: i0.ElementRef }, { token: i1.DateAdapter }, { token: forwardRef(() => MatCalendar) }, { token: WLCM_DATEPICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Directive }); }
297
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: WlcmLeftCalendarDirective, isStandalone: true, selector: "[wlcmLeftCalendar]", providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmLeftCalendarDirective) }], usesInheritance: true, ngImport: i0 }); }
298
- };
299
- WlcmLeftCalendarDirective = __decorate([
300
- UntilDestroy(),
301
- __metadata("design:paramtypes", [ElementRef,
302
- DateAdapter,
303
- MatCalendar, Object])
304
- ], WlcmLeftCalendarDirective);
305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmLeftCalendarDirective, decorators: [{
306
- type: Directive,
307
- args: [{
308
- selector: '[wlcmLeftCalendar]',
309
- standalone: true,
310
- providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmLeftCalendarDirective) }],
311
- }]
312
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter }, { type: i2$1.MatCalendar, decorators: [{
313
- type: Inject,
314
- args: [forwardRef(() => MatCalendar)]
315
- }] }, { type: undefined, decorators: [{
316
- type: Inject,
317
- args: [WLCM_DATEPICKER_CONFIG]
318
- }] }] });
319
-
320
- let WlcmRightCalendarDirective = class WlcmRightCalendarDirective extends WlcmDataRangeCalendar {
321
- constructor(element, dateAdapter, calendar, datepickerConfig) {
322
- super('right', element, calendar, dateAdapter, datepickerConfig);
323
- this.element = element;
324
- this.dateAdapter = dateAdapter;
325
- this.calendar = calendar;
326
- this.datepickerConfig = datepickerConfig;
327
- this.handleYearChange();
328
- this.handleMonthChange();
329
- }
330
- handleYearChange() {
331
- this.calendar.yearSelected
332
- .pipe(untilDestroyed(this))
333
- .subscribe((date) => this.dateChange.emit(this.dateAdapter.addCalendarMonths(date, -1)));
334
- }
335
- handleMonthChange() {
336
- this.calendar.monthSelected
337
- .pipe(untilDestroyed(this))
338
- .subscribe((date) => this.dateChange.emit(this.dateAdapter.addCalendarMonths(date, -1)));
339
- }
340
- nextMonth() {
341
- this.dateChange.emit(this.calendar.activeDate);
342
- }
343
- prevYear() {
344
- this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage), -1));
345
- }
346
- nextYear() {
347
- this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage), -1));
348
- }
349
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmRightCalendarDirective, deps: [{ token: i0.ElementRef }, { token: i1.DateAdapter }, { token: forwardRef(() => MatCalendar) }, { token: WLCM_DATEPICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Directive }); }
350
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: WlcmRightCalendarDirective, isStandalone: true, selector: "[wlcmRightCalendar]", providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmRightCalendarDirective) }], usesInheritance: true, ngImport: i0 }); }
351
- };
352
- WlcmRightCalendarDirective = __decorate([
353
- UntilDestroy(),
354
- __metadata("design:paramtypes", [ElementRef,
355
- DateAdapter,
356
- MatCalendar, Object])
357
- ], WlcmRightCalendarDirective);
358
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmRightCalendarDirective, decorators: [{
359
- type: Directive,
360
- args: [{
361
- selector: '[wlcmRightCalendar]',
362
- standalone: true,
363
- providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmRightCalendarDirective) }],
364
- }]
365
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter }, { type: i2$1.MatCalendar, decorators: [{
366
- type: Inject,
367
- args: [forwardRef(() => MatCalendar)]
368
- }] }, { type: undefined, decorators: [{
369
- type: Inject,
370
- args: [WLCM_DATEPICKER_CONFIG]
371
- }] }] });
372
-
373
- let WlcmDatepickerTrigger = class WlcmDatepickerTrigger {
374
- get isOnlySelect() {
375
- return this.selectOnly();
376
- }
377
- constructor(overlay, viewContainerRef, selectionModel) {
378
- this.overlay = overlay;
379
- this.viewContainerRef = viewContainerRef;
380
- this.selectionModel = selectionModel;
381
- this.minDate = input(this.defaultDatepickerConfig.minDate?.());
382
- this.maxDate = input(this.defaultDatepickerConfig.maxDate?.());
383
- this.selectOnly = input(this.defaultDatepickerConfig.selectOnly || false);
384
- this.overlayRef = this.overlay.create(this.createOverlayConfig());
385
- this.handleBackdropClick();
386
- }
387
- open() {
388
- const injector = Injector.create({
389
- providers: [{ provide: OverlayRef, useValue: this.overlayRef }],
390
- parent: this.datepickerInjector,
391
- });
392
- const portal = new ComponentPortal(this.componentType, this.viewContainerRef, injector);
393
- this.updatePositionStrategy();
394
- this.componentRef = this.overlayRef.attach(portal);
395
- }
396
- close() {
397
- this.overlayRef.detach();
398
- }
399
- get isOpen() {
400
- return this.overlayRef.hasAttached();
401
- }
402
- get opened() {
403
- return merge(this.overlayRef?.attachments() || EMPTY).pipe(filter(() => this.overlayRef.hasAttached()));
404
- }
405
- get closed() {
406
- return (this.overlayRef?.detachments() || EMPTY).pipe(filter(() => !this.overlayRef.hasAttached()));
407
- }
408
- get datepickerInjector() {
409
- const parent = this.viewContainerRef.injector;
410
- return Injector.create({
411
- parent,
412
- providers: [{ provide: WLCM_DATEPICKER_CONFIG, useValue: this.datepickerConfig }],
413
- });
110
+ get datepickerInjector() {
111
+ const parent = this.viewContainerRef.injector;
112
+ return Injector.create({
113
+ parent,
114
+ providers: [{ provide: WLCM_DATEPICKER_CONFIG, useValue: this.datepickerConfig }],
115
+ });
414
116
  }
415
117
  get defaultDatepickerConfig() {
416
118
  return this.viewContainerRef.injector.get(WLCM_DATEPICKER_CONFIG, {}, { optional: true });
@@ -424,9 +126,6 @@ let WlcmDatepickerTrigger = class WlcmDatepickerTrigger {
424
126
  config.selectOnly = this.selectOnly();
425
127
  return config;
426
128
  }
427
- get overlayOrigin() {
428
- return new CdkOverlayOrigin(this.connectedTo);
429
- }
430
129
  handleBackdropClick() {
431
130
  this.overlayRef
432
131
  .backdropClick()
@@ -434,8 +133,7 @@ let WlcmDatepickerTrigger = class WlcmDatepickerTrigger {
434
133
  .subscribe(() => this.close());
435
134
  }
436
135
  updatePositionStrategy() {
437
- const origin = this.overlayOrigin.elementRef;
438
- const strategy = this.overlay.position().flexibleConnectedTo(origin);
136
+ const strategy = this.overlay.position().flexibleConnectedTo(this.connectedTo);
439
137
  strategy.withPositions([
440
138
  { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
441
139
  { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
@@ -451,7 +149,7 @@ let WlcmDatepickerTrigger = class WlcmDatepickerTrigger {
451
149
  backdropClass: 'transparent',
452
150
  });
453
151
  }
454
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDatepickerTrigger, deps: [{ token: i1$1.Overlay }, { token: i0.ViewContainerRef }, { token: i2$1.MatDateSelectionModel }], target: i0.ɵɵFactoryTarget.Directive }); }
152
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDatepickerTrigger, deps: [{ token: i1.Overlay }, { token: i0.ViewContainerRef }, { token: i2.MatDateSelectionModel }], target: i0.ɵɵFactoryTarget.Directive }); }
455
153
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.4", type: WlcmDatepickerTrigger, isStandalone: true, inputs: { minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, selectOnly: { classPropertyName: "selectOnly", publicName: "selectOnly", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.wlcm-datepicker-select-only-mode": "this.isOnlySelect" } }, ngImport: i0 }); }
456
154
  };
457
155
  WlcmDatepickerTrigger = __decorate([
@@ -462,234 +160,69 @@ WlcmDatepickerTrigger = __decorate([
462
160
  ], WlcmDatepickerTrigger);
463
161
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDatepickerTrigger, decorators: [{
464
162
  type: Directive
465
- }], ctorParameters: () => [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }, { type: i2$1.MatDateSelectionModel }], propDecorators: { isOnlySelect: [{
163
+ }], ctorParameters: () => [{ type: i1.Overlay }, { type: i0.ViewContainerRef }, { type: i2.MatDateSelectionModel }], propDecorators: { isOnlySelect: [{
466
164
  type: HostBinding,
467
165
  args: ['class.wlcm-datepicker-select-only-mode']
468
166
  }] } });
469
167
 
470
- class WlcmCalendarDirective {
471
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmCalendarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
472
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: WlcmCalendarDirective, isStandalone: true, selector: "[wlcmCalendar]", host: { classAttribute: "wlcm-calendar" }, ngImport: i0 }); }
473
- }
474
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmCalendarDirective, decorators: [{
475
- type: Directive,
476
- args: [{
477
- selector: '[wlcmCalendar]',
478
- host: { class: 'wlcm-calendar' },
479
- standalone: true,
480
- }]
481
- }] });
482
-
483
- let WlcmDateRangePickerComponent = class WlcmDateRangePickerComponent {
484
- constructor(rangeConfig, rangeSelectionStrategy, localSelectionModel, triggerSelectionModel, trigger, datepickerConfig, dateAdapter) {
485
- this.rangeConfig = rangeConfig;
486
- this.rangeSelectionStrategy = rangeSelectionStrategy;
487
- this.localSelectionModel = localSelectionModel;
488
- this.triggerSelectionModel = triggerSelectionModel;
489
- this.trigger = trigger;
490
- this.datepickerConfig = datepickerConfig;
491
- this.dateAdapter = dateAdapter;
492
- this.headerComponent = WlcmDateRangeCalendarHeaderComponent;
493
- this._isViewInitialized = false;
494
- this._isComplete = signal(false);
495
- this.isComplete = computed(() => this._isComplete());
496
- this.startDate = signal(new Date());
497
- this.leftCalendarYearViewActivated = signal(false);
498
- this.rightCalendarYearViewActivated = signal(false);
499
- this.handleSelectionChanged();
500
- this.localSelectionModel.updateSelection(this.triggerSelectionModel.selection, this);
501
- if (this.triggerSelectionModel.selection.start) {
502
- this.startDate.set(this.triggerSelectionModel.selection.start);
503
- }
504
- if (this.rangeConfig.headerComponent) {
505
- this.headerComponent = this.rangeConfig.headerComponent;
168
+ class WlcmDatepickerInputBase {
169
+ handleBlur() {
170
+ this.updateSelection();
171
+ this._touched?.();
172
+ }
173
+ handleInput() {
174
+ if (this.isValidFormat(this.currentValue, this.dateFormats.parse.dateInput)) {
175
+ this.updateSelection();
506
176
  }
507
- effect(() => {
508
- if (!this._isViewInitialized)
509
- return;
510
- this.leftCalendar.activeDate = this.startDate();
511
- this.rightCalendar.activeDate = this.dateAdapter.addCalendarMonths(this.startDate(), 1);
512
- this.rightCalendar.startAt = this.dateAdapter.addCalendarMonths(this.startDate(), 1);
513
- });
177
+ this._validatorChanged?.();
514
178
  }
515
- ngAfterViewInit() {
516
- this._isViewInitialized = true;
517
- this.leftCalendar.viewChanged.pipe(untilDestroyed(this)).subscribe((view) => {
518
- this.leftCalendarYearViewActivated.set(view !== 'month');
519
- });
520
- this.rightCalendar.viewChanged.pipe(untilDestroyed(this)).subscribe((view) => {
521
- this.rightCalendarYearViewActivated.set(view !== 'month');
522
- });
523
- this.handleRightCalendarPreviewChange();
179
+ get datepickerInputClass() {
180
+ return WLCM_DATEPICKER_INPUT_CLASS;
524
181
  }
525
- calendarSelection(event) {
526
- const newSelection = this.rangeSelectionStrategy.selectionFinished(event.value, this.localSelectionModel.selection, event.event);
527
- this.localSelectionModel.updateSelection(newSelection, this);
182
+ constructor(element, dateAdapter, dateFormats, trigger) {
183
+ this.element = element;
184
+ this.dateAdapter = dateAdapter;
185
+ this.dateFormats = dateFormats;
186
+ this.trigger = trigger;
528
187
  }
529
- calendarDragDrop(event) {
530
- this.localSelectionModel.updateSelection(event.value, this);
188
+ writeValue(value) {
189
+ this.updateInputValue(value);
531
190
  }
532
- apply() {
533
- this.triggerSelectionModel.updateSelection(this.localSelectionModel.selection, this);
534
- this.trigger.close();
191
+ registerOnChange(callback) {
192
+ this._changed = callback;
535
193
  }
536
- reset() {
537
- this.trigger.close();
194
+ registerOnTouched(callback) {
195
+ this._touched = callback;
538
196
  }
539
- get selected() {
540
- return this.localSelectionModel.selection;
197
+ registerOnValidatorChange(callback) {
198
+ this._validatorChanged = callback;
541
199
  }
542
- get leftCalendarActiveCell() {
543
- return this.leftCalendarElement.nativeElement.querySelector('.mat-calendar-body-active');
200
+ validate() {
201
+ if (!this.currentValue)
202
+ return null;
203
+ const isValid = this.isValidFormat(this.currentValue, this.dateFormats.parse.dateInput);
204
+ if (!isValid) {
205
+ return {
206
+ [WlcmDateValidation.Format]: { value: this.currentValue, format: this.dateFormats.parse.dateInput },
207
+ required: false,
208
+ };
209
+ }
210
+ const date = this.parseCurrentValue();
211
+ if (this.minDate && isBefore(startOfDay(date), startOfDay(this.minDate))) {
212
+ return { [WlcmDateValidation.MinDate]: { minDate: this.minDate, currentDate: date } };
213
+ }
214
+ if (this.maxDate && isAfter(startOfDay(date), startOfDay(this.maxDate))) {
215
+ return { [WlcmDateValidation.MaxDate]: { maxDate: this.maxDate, currentDate: date } };
216
+ }
217
+ return null;
544
218
  }
545
- handleSelectionChanged() {
546
- this.localSelectionModel.selectionChanged
547
- .pipe(untilDestroyed(this))
548
- .subscribe(() => this._isComplete.set(this.localSelectionModel.isComplete()));
219
+ parseCurrentValue() {
220
+ const date = this.dateAdapter.parse(this.currentValue, this.dateFormats.parse.dateInput);
221
+ return this.dateAdapter.getValidDateOrNull(date);
549
222
  }
550
- handleRightCalendarPreviewChange() {
551
- const viewChanged = new Subject();
552
- this.rightCalendar.viewChanged
553
- .pipe(untilDestroyed(this))
554
- .pipe(tap(() => viewChanged.next()))
555
- .pipe(startWith(this.rightCalendar.currentView))
556
- .subscribe((view) => {
557
- if (view !== 'month')
558
- return;
559
- this.rightCalendar.monthView._matCalendarBody.previewChange
560
- .pipe(takeUntil(viewChanged), untilDestroyed(this))
561
- .subscribe(() => {
562
- if (this.leftCalendar.currentView !== 'month' || !this.leftCalendar.monthView._rangeStart)
563
- return;
564
- this.leftCalendar.monthView._previewStart = this.rightCalendar.monthView._previewStart;
565
- this.leftCalendar.monthView._previewEnd = this.rightCalendar.monthView._previewEnd;
566
- const activeCell = this.leftCalendarActiveCell;
567
- if (activeCell && activeCell === document.activeElement)
568
- activeCell.blur();
569
- this.leftCalendar.monthView._changeDetectorRef.markForCheck();
570
- });
571
- });
572
- }
573
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangePickerComponent, deps: [{ token: WLCM_DATE_RANGE_PICKER_CONFIG, optional: true }, { token: MAT_DATE_RANGE_SELECTION_STRATEGY }, { token: WLCM_DATE_RANGE_SELECTION_MODEL }, { token: WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL }, { token: WlcmDatepickerTrigger }, { token: WLCM_DATEPICKER_CONFIG }, { token: i1.DateAdapter }], target: i0.ɵɵFactoryTarget.Component }); }
574
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: WlcmDateRangePickerComponent, isStandalone: true, selector: "wlcm-date-range-picker", providers: [
575
- {
576
- provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
577
- useClass: DefaultMatCalendarRangeStrategy,
578
- },
579
- WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER,
580
- ], viewQueries: [{ propertyName: "leftCalendar", first: true, predicate: WlcmLeftCalendarDirective, descendants: true, read: MatCalendar }, { propertyName: "rightCalendar", first: true, predicate: WlcmRightCalendarDirective, descendants: true, read: MatCalendar }, { propertyName: "leftCalendarElement", first: true, predicate: WlcmLeftCalendarDirective, descendants: true, read: ElementRef }, { propertyName: "monthView", first: true, predicate: MatMonthView, descendants: true }], ngImport: i0, template: "<div class=\"wlcm-date-range-picker-panel\">\n <div class=\"wlcm-date-range-picker-body\">\n <mat-calendar\n wlcmCalendar\n wlcmLeftCalendar\n [selected]=\"selected\"\n [disabled]=\"rightCalendarYearViewActivated()\"\n [headerComponent]=\"headerComponent\"\n (_userSelection)=\"calendarSelection($event)\"\n (_userDragDrop)=\"calendarDragDrop($event)\"\n (dateChange)=\"startDate.set($event)\"\n ></mat-calendar>\n\n <mat-calendar\n wlcmCalendar\n wlcmRightCalendar\n [selected]=\"selected\"\n [disabled]=\"leftCalendarYearViewActivated()\"\n [headerComponent]=\"headerComponent\"\n (_userSelection)=\"calendarSelection($event)\"\n (_userDragDrop)=\"calendarDragDrop($event)\"\n (dateChange)=\"startDate.set($event)\"\n ></mat-calendar>\n </div>\n\n <wlcm-date-range-picker-bottom-panel></wlcm-date-range-picker-bottom-panel>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2$1.MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "directive", type: WlcmCalendarDirective, selector: "[wlcmCalendar]" }, { kind: "directive", type: WlcmLeftCalendarDirective, selector: "[wlcmLeftCalendar]" }, { kind: "directive", type: WlcmRightCalendarDirective, selector: "[wlcmRightCalendar]" }, { kind: "component", type: WlcmDateRangePickerBottomPanelComponent, selector: "wlcm-date-range-picker-bottom-panel" }] }); }
581
- };
582
- WlcmDateRangePickerComponent = __decorate([
583
- UntilDestroy(),
584
- __metadata("design:paramtypes", [Object, Object, MatDateSelectionModel,
585
- MatDateSelectionModel,
586
- WlcmDatepickerTrigger, Object, DateAdapter])
587
- ], WlcmDateRangePickerComponent);
588
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangePickerComponent, decorators: [{
589
- type: Component,
590
- args: [{ selector: 'wlcm-date-range-picker', standalone: true, imports: [
591
- CommonModule,
592
- MatDatepickerModule,
593
- WlcmCalendarDirective,
594
- WlcmLeftCalendarDirective,
595
- WlcmRightCalendarDirective,
596
- WlcmDateRangePickerBottomPanelComponent,
597
- ], providers: [
598
- {
599
- provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
600
- useClass: DefaultMatCalendarRangeStrategy,
601
- },
602
- WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER,
603
- ], template: "<div class=\"wlcm-date-range-picker-panel\">\n <div class=\"wlcm-date-range-picker-body\">\n <mat-calendar\n wlcmCalendar\n wlcmLeftCalendar\n [selected]=\"selected\"\n [disabled]=\"rightCalendarYearViewActivated()\"\n [headerComponent]=\"headerComponent\"\n (_userSelection)=\"calendarSelection($event)\"\n (_userDragDrop)=\"calendarDragDrop($event)\"\n (dateChange)=\"startDate.set($event)\"\n ></mat-calendar>\n\n <mat-calendar\n wlcmCalendar\n wlcmRightCalendar\n [selected]=\"selected\"\n [disabled]=\"leftCalendarYearViewActivated()\"\n [headerComponent]=\"headerComponent\"\n (_userSelection)=\"calendarSelection($event)\"\n (_userDragDrop)=\"calendarDragDrop($event)\"\n (dateChange)=\"startDate.set($event)\"\n ></mat-calendar>\n </div>\n\n <wlcm-date-range-picker-bottom-panel></wlcm-date-range-picker-bottom-panel>\n</div>\n" }]
604
- }], ctorParameters: () => [{ type: undefined, decorators: [{
605
- type: Optional
606
- }, {
607
- type: Inject,
608
- args: [WLCM_DATE_RANGE_PICKER_CONFIG]
609
- }] }, { type: undefined, decorators: [{
610
- type: Inject,
611
- args: [MAT_DATE_RANGE_SELECTION_STRATEGY]
612
- }] }, { type: i2$1.MatDateSelectionModel, decorators: [{
613
- type: Inject,
614
- args: [WLCM_DATE_RANGE_SELECTION_MODEL]
615
- }] }, { type: i2$1.MatDateSelectionModel, decorators: [{
616
- type: Inject,
617
- args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
618
- }] }, { type: WlcmDatepickerTrigger }, { type: undefined, decorators: [{
619
- type: Inject,
620
- args: [WLCM_DATEPICKER_CONFIG]
621
- }] }, { type: i1.DateAdapter }], propDecorators: { leftCalendar: [{
622
- type: ViewChild,
623
- args: [WlcmLeftCalendarDirective, { read: MatCalendar }]
624
- }], rightCalendar: [{
625
- type: ViewChild,
626
- args: [WlcmRightCalendarDirective, { read: MatCalendar }]
627
- }], leftCalendarElement: [{
628
- type: ViewChild,
629
- args: [WlcmLeftCalendarDirective, { read: ElementRef }]
630
- }], monthView: [{
631
- type: ViewChild,
632
- args: [MatMonthView]
633
- }] } });
634
-
635
- class WlcmDatepickerInputBase {
636
- handleBlur() {
637
- this.updateSelection();
638
- this._touched?.();
639
- }
640
- handleInput() {
641
- if (this.isValidFormat(this.currentValue, this.dateFormats.parse.dateInput)) {
642
- this.updateSelection();
643
- }
644
- this._validatorChanged?.();
645
- }
646
- get datepickerInputClass() {
647
- return WLCM_DATEPICKER_INPUT_CLASS;
648
- }
649
- constructor(element, dateAdapter, dateFormats, trigger) {
650
- this.element = element;
651
- this.dateAdapter = dateAdapter;
652
- this.dateFormats = dateFormats;
653
- this.trigger = trigger;
654
- }
655
- writeValue(value) {
656
- this.updateInputValue(value);
657
- }
658
- registerOnChange(callback) {
659
- this._changed = callback;
660
- }
661
- registerOnTouched(callback) {
662
- this._touched = callback;
663
- }
664
- registerOnValidatorChange(callback) {
665
- this._validatorChanged = callback;
666
- }
667
- validate() {
668
- if (!this.currentValue)
669
- return null;
670
- const isValid = this.isValidFormat(this.currentValue, this.dateFormats.parse.dateInput);
671
- if (!isValid) {
672
- return {
673
- [WlcmDateValidation.Format]: { value: this.currentValue, format: this.dateFormats.parse.dateInput },
674
- required: false,
675
- };
676
- }
677
- const date = this.parseCurrentValue();
678
- if (this.minDate && isBefore(startOfDay(date), startOfDay(this.minDate))) {
679
- return { [WlcmDateValidation.MinDate]: { minDate: this.minDate, currentDate: date } };
680
- }
681
- if (this.maxDate && isAfter(startOfDay(date), startOfDay(this.maxDate))) {
682
- return { [WlcmDateValidation.MaxDate]: { maxDate: this.maxDate, currentDate: date } };
683
- }
684
- return null;
685
- }
686
- parseCurrentValue() {
687
- const date = this.dateAdapter.parse(this.currentValue, this.dateFormats.parse.dateInput);
688
- return this.dateAdapter.getValidDateOrNull(date);
689
- }
690
- isValidFormat(value, pattern) {
691
- const parsedDate = parse(value, pattern, new Date());
692
- return isValid(parsedDate) && value === format(parsedDate, pattern);
223
+ isValidFormat(value, pattern) {
224
+ const parsedDate = parse(value, pattern, new Date());
225
+ return isValid(parsedDate) && value === format(parsedDate, pattern);
693
226
  }
694
227
  get minDate() {
695
228
  return this.trigger.minDate?.();
@@ -715,7 +248,7 @@ class WlcmDatepickerInputBase {
715
248
  }
716
249
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDatepickerInputBase, decorators: [{
717
250
  type: Directive
718
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter }, { type: undefined }, { type: WlcmDatepickerTrigger }], propDecorators: { handleBlur: [{
251
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: undefined }, { type: WlcmDatepickerTrigger }], propDecorators: { handleBlur: [{
719
252
  type: HostListener,
720
253
  args: ['blur']
721
254
  }], handleInput: [{
@@ -773,78 +306,13 @@ class WlcmDateRangePickerInputBase extends WlcmDatepickerInputBase {
773
306
  }
774
307
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangePickerInputBase, decorators: [{
775
308
  type: Directive
776
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter }, { type: undefined }, { type: WlcmDatepickerTrigger }] });
309
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: undefined }, { type: WlcmDatepickerTrigger }] });
777
310
 
778
311
  var WlcmDateRangeValidation;
779
312
  (function (WlcmDateRangeValidation) {
780
313
  WlcmDateRangeValidation["StartExceedsEnd"] = "wlcmDateRangeStartExceedsEnd";
781
314
  })(WlcmDateRangeValidation || (WlcmDateRangeValidation = {}));
782
315
 
783
- let DateRangePickerInputEndDirective = class DateRangePickerInputEndDirective extends WlcmDateRangePickerInputBase {
784
- constructor(element, dateAdapter, dateFormats, selectionModel, trigger) {
785
- super(element, dateAdapter, dateFormats, trigger);
786
- this.element = element;
787
- this.dateAdapter = dateAdapter;
788
- this.dateFormats = dateFormats;
789
- this.selectionModel = selectionModel;
790
- this.trigger = trigger;
791
- this.updateSelection = () => {
792
- let end = this.parseCurrentValue();
793
- this.selectionModel.updateSelection(new DateRange(this.selectionModel.selection.start, end), this);
794
- };
795
- this.handleSelectionChange();
796
- }
797
- validate() {
798
- const defaultErrors = super.validate();
799
- if (isValid(this.selectionModel.selection.start)) {
800
- const endDate = this.parseCurrentValue();
801
- if (endDate && isAfter(this.selectionModel.selection.start, endDate)) {
802
- return { [WlcmDateRangeValidation.StartExceedsEnd]: true, ...(defaultErrors ?? {}) };
803
- }
804
- }
805
- return defaultErrors;
806
- }
807
- handleSelectionChange() {
808
- this.selectionModel.selectionChanged.pipe(untilDestroyed(this)).subscribe(({ selection }) => {
809
- const validDate = this.dateAdapter.getValidDateOrNull(selection.end);
810
- this._changed?.(validDate);
811
- this.updateInputValue(validDate);
812
- this._validatorChanged?.();
813
- });
814
- }
815
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DateRangePickerInputEndDirective, deps: [{ token: i0.ElementRef }, { token: i1.DateAdapter }, { token: MAT_DATE_FORMATS, optional: true }, { token: WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL }, { token: WlcmDatepickerTrigger }], target: i0.ɵɵFactoryTarget.Directive }); }
816
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: DateRangePickerInputEndDirective, isStandalone: true, selector: "[wlcmDateRangePickerInputEnd]", host: { classAttribute: "wlcm-date-range-picker-input-field" }, providers: [
817
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
818
- { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
819
- ], usesInheritance: true, ngImport: i0 }); }
820
- };
821
- DateRangePickerInputEndDirective = __decorate([
822
- UntilDestroy(),
823
- __metadata("design:paramtypes", [ElementRef,
824
- DateAdapter, Object, MatDateSelectionModel,
825
- WlcmDatepickerTrigger])
826
- ], DateRangePickerInputEndDirective);
827
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DateRangePickerInputEndDirective, decorators: [{
828
- type: Directive,
829
- args: [{
830
- selector: '[wlcmDateRangePickerInputEnd]',
831
- host: { class: 'wlcm-date-range-picker-input-field' },
832
- standalone: true,
833
- providers: [
834
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
835
- { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
836
- ],
837
- }]
838
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter }, { type: undefined, decorators: [{
839
- type: Optional
840
- }, {
841
- type: Inject,
842
- args: [MAT_DATE_FORMATS]
843
- }] }, { type: i2$1.MatDateSelectionModel, decorators: [{
844
- type: Inject,
845
- args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
846
- }] }, { type: WlcmDatepickerTrigger }] });
847
-
848
316
  let DateRangePickerInputStartDirective = class DateRangePickerInputStartDirective extends WlcmDateRangePickerInputBase {
849
317
  constructor(element, dateAdapter, dateFormats, selectionModel, trigger) {
850
318
  super(element, dateAdapter, dateFormats, trigger);
@@ -877,7 +345,7 @@ let DateRangePickerInputStartDirective = class DateRangePickerInputStartDirectiv
877
345
  this._validatorChanged?.();
878
346
  });
879
347
  }
880
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DateRangePickerInputStartDirective, deps: [{ token: i0.ElementRef }, { token: i1.DateAdapter }, { token: MAT_DATE_FORMATS, optional: true }, { token: WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL }, { token: WlcmDatepickerTrigger }], target: i0.ɵɵFactoryTarget.Directive }); }
348
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DateRangePickerInputStartDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.DateAdapter }, { token: MAT_DATE_FORMATS, optional: true }, { token: WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL }, { token: WlcmDatepickerTrigger }], target: i0.ɵɵFactoryTarget.Directive }); }
881
349
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: DateRangePickerInputStartDirective, isStandalone: true, selector: "[wlcmDateRangePickerInputStart]", host: { classAttribute: "wlcm-date-range-picker-input-field" }, providers: [
882
350
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateRangePickerInputStartDirective), multi: true },
883
351
  { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateRangePickerInputStartDirective), multi: true },
@@ -900,65 +368,315 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
900
368
  { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateRangePickerInputStartDirective), multi: true },
901
369
  ],
902
370
  }]
903
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter }, { type: undefined, decorators: [{
371
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: undefined, decorators: [{
904
372
  type: Optional
905
373
  }, {
906
374
  type: Inject,
907
375
  args: [MAT_DATE_FORMATS]
908
- }] }, { type: i2$1.MatDateSelectionModel, decorators: [{
376
+ }] }, { type: i2.MatDateSelectionModel, decorators: [{
909
377
  type: Inject,
910
378
  args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
911
379
  }] }, { type: WlcmDatepickerTrigger }] });
912
380
 
913
- class DateRangePickerErrors {
914
- static throwNoStartInputError() {
915
- throw new Error('The input element with the wlcmDateRangePickerInputStart directive is missing');
916
- }
917
- static throwNoEndInputError() {
918
- throw new Error('The input element with the wlcmDateRangePickerInputEnd directive is missing');
919
- }
920
- }
381
+ const WLCM_DATE_RANGE_PICKER_CONFIG = new InjectionToken('WLCM_DATE_RANGE_PICKER_CONFIG', { providedIn: 'root', factory: () => ({}) });
921
382
 
922
- class WlcmDateRangePickerInputComponent extends WlcmDatepickerTrigger {
923
- constructor(overlay, viewContainerRef, selectionModel, formField, controlContainer) {
924
- super(overlay, viewContainerRef, selectionModel);
925
- this.overlay = overlay;
926
- this.viewContainerRef = viewContainerRef;
927
- this.selectionModel = selectionModel;
928
- this.formField = formField;
929
- this.controlContainer = controlContainer;
930
- this._focusStream$ = new BehaviorSubject(EMPTY);
931
- this._blurStream$ = new BehaviorSubject(EMPTY);
932
- this.focus$ = this._focusStream$.pipe(switchMap((stream) => stream));
933
- this.blur$ = this._blurStream$.pipe(switchMap((stream) => stream));
934
- this.componentType = WlcmDateRangePickerComponent;
383
+ const WLCM_DATE_RANGE_SELECTION_MODEL = new InjectionToken('WLCM_DATE_RANGE_SELECTION_MODEL');
384
+ const WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER = {
385
+ provide: WLCM_DATE_RANGE_SELECTION_MODEL,
386
+ useFactory: (adapter) => new MatRangeDateSelectionModel(adapter),
387
+ deps: [DateAdapter],
388
+ };
389
+
390
+ class WlcmDateRangePicker {
391
+ constructor(localSelectionModel, rangeSelectionStrategy) {
392
+ this.localSelectionModel = localSelectionModel;
393
+ this.rangeSelectionStrategy = rangeSelectionStrategy;
394
+ this._isComplete = signal(false);
395
+ this.isComplete = computed(() => this._isComplete());
396
+ this.handleSelectionChanged();
935
397
  }
936
- ngAfterContentInit() {
937
- this.checkInputs();
938
- this.attachFocusBlurListeners();
398
+ calendarSelection(event) {
399
+ const newSelection = this.rangeSelectionStrategy.selectionFinished(event.value, this.localSelectionModel.selection, event.event);
400
+ this.localSelectionModel.updateSelection(newSelection, this);
939
401
  }
940
- ngAfterViewInit() {
941
- this.connectedTo = this.formField.inputContainer;
402
+ calendarDragDrop(event) {
403
+ this.localSelectionModel.updateSelection(event.value, this);
942
404
  }
943
- isFocused() {
944
- return (this.startInputElement === document.activeElement ||
945
- this.endInputElement === document.activeElement ||
946
- this.isOpen);
405
+ get selected() {
406
+ return this.localSelectionModel.selection;
947
407
  }
948
- focus() {
949
- if (this.selectOnly())
950
- return this.open();
951
- if (!this.isFocused())
952
- this.startInputElement.focus();
408
+ handleSelectionChanged() {
409
+ this.localSelectionModel.selectionChanged
410
+ .pipe(untilDestroyed(this))
411
+ .subscribe(() => this._isComplete.set(this.localSelectionModel.isComplete()));
953
412
  }
954
- get control() {
955
- return this.controlContainer?.control;
413
+ }
414
+
415
+ class WlcmDateRangePickerBottomPanelComponent {
416
+ constructor(picker) {
417
+ this.picker = picker;
956
418
  }
957
- get startInputElement() {
958
- return this.startInput.element.nativeElement;
419
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangePickerBottomPanelComponent, deps: [{ token: WlcmDateRangePicker }], target: i0.ɵɵFactoryTarget.Component }); }
420
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: WlcmDateRangePickerBottomPanelComponent, isStandalone: true, selector: "wlcm-date-range-picker-bottom-panel", ngImport: i0, template: "<div class=\"wlcm-date-range-picker-bottom-panel\">\n <wlcm-button type=\"paddingless\" (clicked)=\"picker.reset()\">Reset</wlcm-button>\n\n <wlcm-button (clicked)=\"picker.apply()\" [isDisabled]=\"!picker.isComplete()\">\n Apply\n </wlcm-button>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: WlcmButtonModule }, { kind: "component", type: i2$1.WlcmButtonComponent, selector: "wlcm-button", inputs: ["type", "size", "isDisabled", "isLoading"], outputs: ["clicked"] }] }); }
421
+ }
422
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangePickerBottomPanelComponent, decorators: [{
423
+ type: Component,
424
+ args: [{ selector: 'wlcm-date-range-picker-bottom-panel', standalone: true, imports: [CommonModule, WlcmButtonModule], template: "<div class=\"wlcm-date-range-picker-bottom-panel\">\n <wlcm-button type=\"paddingless\" (clicked)=\"picker.reset()\">Reset</wlcm-button>\n\n <wlcm-button (clicked)=\"picker.apply()\" [isDisabled]=\"!picker.isComplete()\">\n Apply\n </wlcm-button>\n</div>\n" }]
425
+ }], ctorParameters: () => [{ type: WlcmDateRangePicker }] });
426
+
427
+ class WlcmCalendarHeaderComponent {
428
+ constructor(dateAdapter, dateFormats, calendar) {
429
+ this.dateAdapter = dateAdapter;
430
+ this.dateFormats = dateFormats;
431
+ this.calendar = calendar;
432
+ this.WlcmIconName = WlcmIconName;
433
+ this.next = input();
434
+ this.previous = input();
435
+ this.disableLeftArrow = input(false);
436
+ this.disableRightArrow = input(false);
437
+ this.displayLeftArrow = input(true);
438
+ this.displayRightArrow = input(true);
959
439
  }
960
- get endInputElement() {
961
- return this.endInput.element.nativeElement;
440
+ previousClicked() {
441
+ if (this.previous())
442
+ return this.previous()();
443
+ this.calendar.activeDate =
444
+ this.calendar.currentView == 'month'
445
+ ? this.dateAdapter.addCalendarMonths(this.calendar.activeDate, -1)
446
+ : this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage);
447
+ }
448
+ nextClicked() {
449
+ if (this.next())
450
+ return this.next()();
451
+ this.calendar.activeDate =
452
+ this.calendar.currentView == 'month'
453
+ ? this.dateAdapter.addCalendarMonths(this.calendar.activeDate, 1)
454
+ : this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage);
455
+ }
456
+ changeCalendarView() {
457
+ if (this.calendar.currentView === 'multi-year') {
458
+ this.calendar.currentView = 'month';
459
+ return;
460
+ }
461
+ this.calendar.currentView = 'multi-year';
462
+ }
463
+ get periodLabel() {
464
+ return this.dateAdapter.format(this.calendar.activeDate, this.dateFormats.display.monthYearLabel);
465
+ }
466
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmCalendarHeaderComponent, deps: [{ token: i1$1.DateAdapter }, { token: MAT_DATE_FORMATS, optional: true }, { token: forwardRef(() => MatCalendar) }], target: i0.ɵɵFactoryTarget.Component }); }
467
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: WlcmCalendarHeaderComponent, isStandalone: true, selector: "wlcm-calendar-header", inputs: { next: { classPropertyName: "next", publicName: "next", isSignal: true, isRequired: false, transformFunction: null }, previous: { classPropertyName: "previous", publicName: "previous", isSignal: true, isRequired: false, transformFunction: null }, disableLeftArrow: { classPropertyName: "disableLeftArrow", publicName: "disableLeftArrow", isSignal: true, isRequired: false, transformFunction: null }, disableRightArrow: { classPropertyName: "disableRightArrow", publicName: "disableRightArrow", isSignal: true, isRequired: false, transformFunction: null }, displayLeftArrow: { classPropertyName: "displayLeftArrow", publicName: "displayLeftArrow", isSignal: true, isRequired: false, transformFunction: null }, displayRightArrow: { classPropertyName: "displayRightArrow", publicName: "displayRightArrow", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wlcm-calendar-header" }, ngImport: i0, template: "<div class=\"wlcm-calendar-header-button-container\">\n @if (displayLeftArrow()) {\n <button\n class=\"wlcm-calendar-header-button wlcm-calendar-header-button-left\"\n [disabled]=\"disableLeftArrow()\"\n (click)=\"previousClicked()\"\n >\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n </button>\n }\n</div>\n\n<button\n class=\"wlcm-calendar-header-change-view-button\"\n (click)=\"changeCalendarView()\"\n>\n <div class=\"wlcm-calendar-header-period-label\">\n {{ periodLabel }}\n </div>\n\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n</button>\n\n<div class=\"wlcm-calendar-header-button-container\">\n @if (displayRightArrow()) {\n <button\n class=\"wlcm-calendar-header-button wlcm-calendar-header-button-right\"\n [disabled]=\"disableRightArrow()\"\n (click)=\"nextClicked()\"\n >\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n </button>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: WlcmIconDirective, selector: "[wlcmIcon]", inputs: ["wlcmIcon", "wlcmIconStopPropagation"], outputs: ["wlcmIconClicked"] }] }); }
468
+ }
469
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmCalendarHeaderComponent, decorators: [{
470
+ type: Component,
471
+ args: [{ selector: 'wlcm-calendar-header', host: { class: 'wlcm-calendar-header' }, standalone: true, imports: [CommonModule, WlcmIconDirective], template: "<div class=\"wlcm-calendar-header-button-container\">\n @if (displayLeftArrow()) {\n <button\n class=\"wlcm-calendar-header-button wlcm-calendar-header-button-left\"\n [disabled]=\"disableLeftArrow()\"\n (click)=\"previousClicked()\"\n >\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n </button>\n }\n</div>\n\n<button\n class=\"wlcm-calendar-header-change-view-button\"\n (click)=\"changeCalendarView()\"\n>\n <div class=\"wlcm-calendar-header-period-label\">\n {{ periodLabel }}\n </div>\n\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n</button>\n\n<div class=\"wlcm-calendar-header-button-container\">\n @if (displayRightArrow()) {\n <button\n class=\"wlcm-calendar-header-button wlcm-calendar-header-button-right\"\n [disabled]=\"disableRightArrow()\"\n (click)=\"nextClicked()\"\n >\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n </button>\n }\n</div>\n" }]
472
+ }], ctorParameters: () => [{ type: i1$1.DateAdapter }, { type: undefined, decorators: [{
473
+ type: Optional
474
+ }, {
475
+ type: Inject,
476
+ args: [MAT_DATE_FORMATS]
477
+ }] }, { type: i2.MatCalendar, decorators: [{
478
+ type: Inject,
479
+ args: [forwardRef(() => MatCalendar)]
480
+ }] }] });
481
+
482
+ class WlcmCalendarDirective {
483
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmCalendarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
484
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: WlcmCalendarDirective, isStandalone: true, selector: "[wlcmCalendar]", host: { classAttribute: "wlcm-calendar" }, ngImport: i0 }); }
485
+ }
486
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmCalendarDirective, decorators: [{
487
+ type: Directive,
488
+ args: [{
489
+ selector: '[wlcmCalendar]',
490
+ host: { class: 'wlcm-calendar' },
491
+ standalone: true,
492
+ }]
493
+ }] });
494
+
495
+ let SingleCalendarRangePickerComponent = class SingleCalendarRangePickerComponent extends WlcmDateRangePicker {
496
+ constructor(rangeConfig, rangeSelectionStrategy, localSelectionModel, triggerSelectionModel, trigger, datepickerConfig, dateAdapter) {
497
+ super(localSelectionModel, rangeSelectionStrategy);
498
+ this.rangeConfig = rangeConfig;
499
+ this.rangeSelectionStrategy = rangeSelectionStrategy;
500
+ this.localSelectionModel = localSelectionModel;
501
+ this.triggerSelectionModel = triggerSelectionModel;
502
+ this.trigger = trigger;
503
+ this.datepickerConfig = datepickerConfig;
504
+ this.dateAdapter = dateAdapter;
505
+ this.headerComponent = WlcmCalendarHeaderComponent;
506
+ this.localSelectionModel.updateSelection(this.triggerSelectionModel.selection, this);
507
+ }
508
+ get minDate() {
509
+ return this.datepickerConfig.minDate?.();
510
+ }
511
+ get maxDate() {
512
+ return this.datepickerConfig.maxDate?.();
513
+ }
514
+ apply() {
515
+ this.triggerSelectionModel.updateSelection(this.localSelectionModel.selection, this);
516
+ this.trigger.close();
517
+ }
518
+ reset() {
519
+ this.trigger.close();
520
+ }
521
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SingleCalendarRangePickerComponent, deps: [{ token: WLCM_DATE_RANGE_PICKER_CONFIG, optional: true }, { token: MAT_DATE_RANGE_SELECTION_STRATEGY }, { token: WLCM_DATE_RANGE_SELECTION_MODEL }, { token: WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL }, { token: WlcmDatepickerTrigger }, { token: WLCM_DATEPICKER_CONFIG }, { token: i1$1.DateAdapter }], target: i0.ɵɵFactoryTarget.Component }); }
522
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: SingleCalendarRangePickerComponent, isStandalone: true, selector: "wlcm-single-calendar-range-picker", providers: [
523
+ {
524
+ provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
525
+ useClass: DefaultMatCalendarRangeStrategy,
526
+ },
527
+ { provide: WlcmDateRangePicker, useExisting: forwardRef(() => SingleCalendarRangePickerComponent) },
528
+ WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER,
529
+ ], usesInheritance: true, ngImport: i0, template: "<div class=\"wlcm-date-range-picker-panel\">\n <div class=\"signal-calendar-range-picker-body\">\n <mat-calendar\n wlcmCalendar\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [selected]=\"selected\"\n [headerComponent]=\"headerComponent\"\n (_userSelection)=\"calendarSelection($event)\"\n (_userDragDrop)=\"calendarDragDrop($event)\"\n ></mat-calendar>\n </div>\n\n <wlcm-date-range-picker-bottom-panel></wlcm-date-range-picker-bottom-panel>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2.MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "directive", type: WlcmCalendarDirective, selector: "[wlcmCalendar]" }, { kind: "component", type: WlcmDateRangePickerBottomPanelComponent, selector: "wlcm-date-range-picker-bottom-panel" }] }); }
530
+ };
531
+ SingleCalendarRangePickerComponent = __decorate([
532
+ UntilDestroy(),
533
+ __metadata("design:paramtypes", [Object, Object, MatDateSelectionModel,
534
+ MatDateSelectionModel,
535
+ WlcmDatepickerTrigger, Object, DateAdapter])
536
+ ], SingleCalendarRangePickerComponent);
537
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SingleCalendarRangePickerComponent, decorators: [{
538
+ type: Component,
539
+ args: [{ selector: 'wlcm-single-calendar-range-picker', imports: [CommonModule, MatDatepickerModule, WlcmCalendarDirective, WlcmDateRangePickerBottomPanelComponent], providers: [
540
+ {
541
+ provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
542
+ useClass: DefaultMatCalendarRangeStrategy,
543
+ },
544
+ { provide: WlcmDateRangePicker, useExisting: forwardRef(() => SingleCalendarRangePickerComponent) },
545
+ WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER,
546
+ ], template: "<div class=\"wlcm-date-range-picker-panel\">\n <div class=\"signal-calendar-range-picker-body\">\n <mat-calendar\n wlcmCalendar\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [selected]=\"selected\"\n [headerComponent]=\"headerComponent\"\n (_userSelection)=\"calendarSelection($event)\"\n (_userDragDrop)=\"calendarDragDrop($event)\"\n ></mat-calendar>\n </div>\n\n <wlcm-date-range-picker-bottom-panel></wlcm-date-range-picker-bottom-panel>\n</div>\n" }]
547
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
548
+ type: Optional
549
+ }, {
550
+ type: Inject,
551
+ args: [WLCM_DATE_RANGE_PICKER_CONFIG]
552
+ }] }, { type: undefined, decorators: [{
553
+ type: Inject,
554
+ args: [MAT_DATE_RANGE_SELECTION_STRATEGY]
555
+ }] }, { type: i2.MatDateSelectionModel, decorators: [{
556
+ type: Inject,
557
+ args: [WLCM_DATE_RANGE_SELECTION_MODEL]
558
+ }] }, { type: i2.MatDateSelectionModel, decorators: [{
559
+ type: Inject,
560
+ args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
561
+ }] }, { type: WlcmDatepickerTrigger }, { type: undefined, decorators: [{
562
+ type: Inject,
563
+ args: [WLCM_DATEPICKER_CONFIG]
564
+ }] }, { type: i1$1.DateAdapter }] });
565
+
566
+ let DateRangePickerInputEndDirective = class DateRangePickerInputEndDirective extends WlcmDateRangePickerInputBase {
567
+ constructor(element, dateAdapter, dateFormats, selectionModel, trigger) {
568
+ super(element, dateAdapter, dateFormats, trigger);
569
+ this.element = element;
570
+ this.dateAdapter = dateAdapter;
571
+ this.dateFormats = dateFormats;
572
+ this.selectionModel = selectionModel;
573
+ this.trigger = trigger;
574
+ this.updateSelection = () => {
575
+ let end = this.parseCurrentValue();
576
+ this.selectionModel.updateSelection(new DateRange(this.selectionModel.selection.start, end), this);
577
+ };
578
+ this.handleSelectionChange();
579
+ }
580
+ validate() {
581
+ const defaultErrors = super.validate();
582
+ if (isValid(this.selectionModel.selection.start)) {
583
+ const endDate = this.parseCurrentValue();
584
+ if (endDate && isAfter(this.selectionModel.selection.start, endDate)) {
585
+ return { [WlcmDateRangeValidation.StartExceedsEnd]: true, ...(defaultErrors ?? {}) };
586
+ }
587
+ }
588
+ return defaultErrors;
589
+ }
590
+ handleSelectionChange() {
591
+ this.selectionModel.selectionChanged.pipe(untilDestroyed(this)).subscribe(({ selection }) => {
592
+ const validDate = this.dateAdapter.getValidDateOrNull(selection.end);
593
+ this._changed?.(validDate);
594
+ this.updateInputValue(validDate);
595
+ this._validatorChanged?.();
596
+ });
597
+ }
598
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DateRangePickerInputEndDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.DateAdapter }, { token: MAT_DATE_FORMATS, optional: true }, { token: WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL }, { token: WlcmDatepickerTrigger }], target: i0.ɵɵFactoryTarget.Directive }); }
599
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: DateRangePickerInputEndDirective, isStandalone: true, selector: "[wlcmDateRangePickerInputEnd]", host: { classAttribute: "wlcm-date-range-picker-input-field" }, providers: [
600
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
601
+ { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
602
+ ], usesInheritance: true, ngImport: i0 }); }
603
+ };
604
+ DateRangePickerInputEndDirective = __decorate([
605
+ UntilDestroy(),
606
+ __metadata("design:paramtypes", [ElementRef,
607
+ DateAdapter, Object, MatDateSelectionModel,
608
+ WlcmDatepickerTrigger])
609
+ ], DateRangePickerInputEndDirective);
610
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DateRangePickerInputEndDirective, decorators: [{
611
+ type: Directive,
612
+ args: [{
613
+ selector: '[wlcmDateRangePickerInputEnd]',
614
+ host: { class: 'wlcm-date-range-picker-input-field' },
615
+ standalone: true,
616
+ providers: [
617
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
618
+ { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
619
+ ],
620
+ }]
621
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: undefined, decorators: [{
622
+ type: Optional
623
+ }, {
624
+ type: Inject,
625
+ args: [MAT_DATE_FORMATS]
626
+ }] }, { type: i2.MatDateSelectionModel, decorators: [{
627
+ type: Inject,
628
+ args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
629
+ }] }, { type: WlcmDatepickerTrigger }] });
630
+
631
+ class DateRangePickerErrors {
632
+ static throwNoStartInputError() {
633
+ throw new Error('The input element with the wlcmDateRangePickerInputStart directive is missing');
634
+ }
635
+ static throwNoEndInputError() {
636
+ throw new Error('The input element with the wlcmDateRangePickerInputEnd directive is missing');
637
+ }
638
+ }
639
+
640
+ class WlcmDateRangePickerInputComponent extends WlcmDatepickerTrigger {
641
+ constructor(overlay, viewContainerRef, selectionModel, formField, controlContainer) {
642
+ super(overlay, viewContainerRef, selectionModel);
643
+ this.overlay = overlay;
644
+ this.viewContainerRef = viewContainerRef;
645
+ this.selectionModel = selectionModel;
646
+ this.formField = formField;
647
+ this.controlContainer = controlContainer;
648
+ this._focusStream$ = new BehaviorSubject(EMPTY);
649
+ this._blurStream$ = new BehaviorSubject(EMPTY);
650
+ this.focus$ = this._focusStream$.pipe(switchMap((stream) => stream));
651
+ this.blur$ = this._blurStream$.pipe(switchMap((stream) => stream));
652
+ this.componentType = SingleCalendarRangePickerComponent;
653
+ }
654
+ ngAfterContentInit() {
655
+ this.checkInputs();
656
+ this.attachFocusBlurListeners();
657
+ }
658
+ ngAfterViewInit() {
659
+ this.connectedTo = this.formField.inputContainer;
660
+ }
661
+ isFocused() {
662
+ return (this.startInputElement === document.activeElement ||
663
+ this.endInputElement === document.activeElement ||
664
+ this.isOpen);
665
+ }
666
+ focus() {
667
+ if (this.selectOnly())
668
+ return this.open();
669
+ if (!this.isFocused())
670
+ this.startInputElement.focus();
671
+ }
672
+ get control() {
673
+ return this.controlContainer?.control;
674
+ }
675
+ get startInputElement() {
676
+ return this.startInput.element.nativeElement;
677
+ }
678
+ get endInputElement() {
679
+ return this.endInput.element.nativeElement;
962
680
  }
963
681
  checkInputs() {
964
682
  if (!this.startInput)
@@ -977,8 +695,8 @@ class WlcmDateRangePickerInputComponent extends WlcmDatepickerTrigger {
977
695
  this._focusStream$.next(merge(...focusObservables).pipe(map(voidFn)));
978
696
  this._blurStream$.next(merge(...blurObservables).pipe(map(() => this.control?.markAsTouched())));
979
697
  }
980
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangePickerInputComponent, deps: [{ token: i1$1.Overlay }, { token: i0.ViewContainerRef }, { token: WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL }, { token: WLCM_FORM_FIELD, host: true }, { token: ControlContainer, host: true }], target: i0.ɵɵFactoryTarget.Component }); }
981
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: WlcmDateRangePickerInputComponent, isStandalone: true, selector: "wlcm-date-range-picker-input", host: { classAttribute: "wlcm-date-range-picker-input" }, providers: [
698
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangePickerInputComponent, deps: [{ token: i1.Overlay }, { token: i0.ViewContainerRef }, { token: WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL }, { token: WLCM_FORM_FIELD, host: true }, { token: ControlContainer, host: true }], target: i0.ɵɵFactoryTarget.Component }); }
699
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: WlcmDateRangePickerInputComponent, isStandalone: true, selector: "wlcm-date-range-picker-input", inputs: { componentType: "componentType" }, host: { classAttribute: "wlcm-date-range-picker-input" }, providers: [
982
700
  WLCM_FORM_CONTROL_PROVIDER,
983
701
  WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL_PROVIDER,
984
702
  {
@@ -1005,7 +723,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
1005
723
  },
1006
724
  { provide: WlcmDatepickerTrigger, useExisting: forwardRef(() => WlcmDateRangePickerInputComponent) },
1007
725
  ], template: "<div class=\"wlcm-date-range-picker-inputs-container\">\n <div class=\"wlcm-date-range-picker-input-field-wrapper\">\n <ng-content select=\"[wlcmDateRangePickerInputStart]\"></ng-content>\n </div>\n\n <div class=\"wlcm-date-range-picker-input-dash\"></div>\n\n <div class=\"wlcm-date-range-picker-input-field-wrapper\">\n <ng-content select=\"[wlcmDateRangePickerInputEnd]\"></ng-content>\n </div>\n</div>\n", styles: [".wlcm-date-range-picker-inputs-container{display:flex;align-items:center}\n"] }]
1008
- }], ctorParameters: () => [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }, { type: i2$1.MatDateSelectionModel, decorators: [{
726
+ }], ctorParameters: () => [{ type: i1.Overlay }, { type: i0.ViewContainerRef }, { type: i2.MatDateSelectionModel, decorators: [{
1009
727
  type: Inject,
1010
728
  args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
1011
729
  }] }, { type: undefined, decorators: [{
@@ -1018,7 +736,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
1018
736
  }, {
1019
737
  type: Inject,
1020
738
  args: [ControlContainer]
1021
- }] }], propDecorators: { startInput: [{
739
+ }] }], propDecorators: { componentType: [{
740
+ type: Input
741
+ }], startInput: [{
1022
742
  type: ContentChild,
1023
743
  args: [DateRangePickerInputStartDirective]
1024
744
  }], endInput: [{
@@ -1026,6 +746,366 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
1026
746
  args: [DateRangePickerInputEndDirective]
1027
747
  }] } });
1028
748
 
749
+ class WlcmDataRangeCalendar {
750
+ constructor(location, element, calendar, dateAdapter, datepickerConfig) {
751
+ this.element = element;
752
+ this.calendar = calendar;
753
+ this.dateAdapter = dateAdapter;
754
+ this.datepickerConfig = datepickerConfig;
755
+ this.dateChange = output();
756
+ this.viewChange = output();
757
+ this.disabled = input(false);
758
+ this.location = location;
759
+ effect(() => {
760
+ if (this.disabled()) {
761
+ this.element.nativeElement.classList.add('wlcm-calendar-disabled');
762
+ }
763
+ else {
764
+ this.element.nativeElement.classList.remove('wlcm-calendar-disabled');
765
+ }
766
+ });
767
+ this.handleConfigValues();
768
+ }
769
+ get minDate() {
770
+ return this.datepickerConfig.minDate?.();
771
+ }
772
+ get maxDate() {
773
+ return this.datepickerConfig.maxDate?.();
774
+ }
775
+ prevMonth() {
776
+ this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.calendar.activeDate, -1));
777
+ }
778
+ nextMonth() {
779
+ this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.calendar.activeDate, 1));
780
+ }
781
+ prevYear() {
782
+ this.dateChange.emit(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage));
783
+ }
784
+ nextYear() {
785
+ this.dateChange.emit(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage));
786
+ }
787
+ handleConfigValues() {
788
+ this.calendar.dateFilter = (date) => {
789
+ if (this.minDate && isBefore(startOfDay(date), startOfDay(this.minDate)))
790
+ return false;
791
+ if (this.maxDate && isAfter(startOfDay(date), startOfDay(this.maxDate)))
792
+ return false;
793
+ return true;
794
+ };
795
+ }
796
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDataRangeCalendar, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
797
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.4", type: WlcmDataRangeCalendar, isStandalone: true, inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateChange: "dateChange", viewChange: "viewChange" }, ngImport: i0 }); }
798
+ }
799
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDataRangeCalendar, decorators: [{
800
+ type: Directive
801
+ }], ctorParameters: () => [{ type: undefined }, { type: i0.ElementRef }, { type: i2.MatCalendar }, { type: i1$1.DateAdapter }, { type: undefined }] });
802
+
803
+ let WlcmLeftCalendarDirective = class WlcmLeftCalendarDirective extends WlcmDataRangeCalendar {
804
+ constructor(element, dateAdapter, calendar, datepickerConfig) {
805
+ super('left', element, calendar, dateAdapter, datepickerConfig);
806
+ this.element = element;
807
+ this.dateAdapter = dateAdapter;
808
+ this.calendar = calendar;
809
+ this.datepickerConfig = datepickerConfig;
810
+ this.handleYearChange();
811
+ this.handleMonthChange();
812
+ }
813
+ handleYearChange() {
814
+ this.calendar.yearSelected.pipe(untilDestroyed(this)).subscribe((date) => this.dateChange.emit(date));
815
+ }
816
+ handleMonthChange() {
817
+ this.calendar.monthSelected.pipe(untilDestroyed(this)).subscribe((date) => this.dateChange.emit(date));
818
+ }
819
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmLeftCalendarDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.DateAdapter }, { token: forwardRef(() => MatCalendar) }, { token: WLCM_DATEPICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Directive }); }
820
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: WlcmLeftCalendarDirective, isStandalone: true, selector: "[wlcmLeftCalendar]", providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmLeftCalendarDirective) }], usesInheritance: true, ngImport: i0 }); }
821
+ };
822
+ WlcmLeftCalendarDirective = __decorate([
823
+ UntilDestroy(),
824
+ __metadata("design:paramtypes", [ElementRef,
825
+ DateAdapter,
826
+ MatCalendar, Object])
827
+ ], WlcmLeftCalendarDirective);
828
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmLeftCalendarDirective, decorators: [{
829
+ type: Directive,
830
+ args: [{
831
+ selector: '[wlcmLeftCalendar]',
832
+ standalone: true,
833
+ providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmLeftCalendarDirective) }],
834
+ }]
835
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: i2.MatCalendar, decorators: [{
836
+ type: Inject,
837
+ args: [forwardRef(() => MatCalendar)]
838
+ }] }, { type: undefined, decorators: [{
839
+ type: Inject,
840
+ args: [WLCM_DATEPICKER_CONFIG]
841
+ }] }] });
842
+
843
+ let WlcmRightCalendarDirective = class WlcmRightCalendarDirective extends WlcmDataRangeCalendar {
844
+ constructor(element, dateAdapter, calendar, datepickerConfig) {
845
+ super('right', element, calendar, dateAdapter, datepickerConfig);
846
+ this.element = element;
847
+ this.dateAdapter = dateAdapter;
848
+ this.calendar = calendar;
849
+ this.datepickerConfig = datepickerConfig;
850
+ this.handleYearChange();
851
+ this.handleMonthChange();
852
+ }
853
+ handleYearChange() {
854
+ this.calendar.yearSelected
855
+ .pipe(untilDestroyed(this))
856
+ .subscribe((date) => this.dateChange.emit(this.dateAdapter.addCalendarMonths(date, -1)));
857
+ }
858
+ handleMonthChange() {
859
+ this.calendar.monthSelected
860
+ .pipe(untilDestroyed(this))
861
+ .subscribe((date) => this.dateChange.emit(this.dateAdapter.addCalendarMonths(date, -1)));
862
+ }
863
+ nextMonth() {
864
+ this.dateChange.emit(this.calendar.activeDate);
865
+ }
866
+ prevYear() {
867
+ this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage), -1));
868
+ }
869
+ nextYear() {
870
+ this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage), -1));
871
+ }
872
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmRightCalendarDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.DateAdapter }, { token: forwardRef(() => MatCalendar) }, { token: WLCM_DATEPICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Directive }); }
873
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: WlcmRightCalendarDirective, isStandalone: true, selector: "[wlcmRightCalendar]", providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmRightCalendarDirective) }], usesInheritance: true, ngImport: i0 }); }
874
+ };
875
+ WlcmRightCalendarDirective = __decorate([
876
+ UntilDestroy(),
877
+ __metadata("design:paramtypes", [ElementRef,
878
+ DateAdapter,
879
+ MatCalendar, Object])
880
+ ], WlcmRightCalendarDirective);
881
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmRightCalendarDirective, decorators: [{
882
+ type: Directive,
883
+ args: [{
884
+ selector: '[wlcmRightCalendar]',
885
+ standalone: true,
886
+ providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmRightCalendarDirective) }],
887
+ }]
888
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: i2.MatCalendar, decorators: [{
889
+ type: Inject,
890
+ args: [forwardRef(() => MatCalendar)]
891
+ }] }, { type: undefined, decorators: [{
892
+ type: Inject,
893
+ args: [WLCM_DATEPICKER_CONFIG]
894
+ }] }] });
895
+
896
+ class WlcmDateRangeCalendarHeaderComponent {
897
+ constructor(rangeCalendar, dateFormats, calendar, datepickerConfig) {
898
+ this.rangeCalendar = rangeCalendar;
899
+ this.dateFormats = dateFormats;
900
+ this.calendar = calendar;
901
+ this.datepickerConfig = datepickerConfig;
902
+ this.WlcmIconName = WlcmIconName;
903
+ this.previous = () => {
904
+ if (this.isPreviousDisabled)
905
+ return;
906
+ if (this.calendar.currentView !== 'month') {
907
+ return this.rangeCalendar.prevYear();
908
+ }
909
+ return this.rangeCalendar.prevMonth();
910
+ };
911
+ this.next = () => {
912
+ if (this.isNextDisabled)
913
+ return;
914
+ if (this.calendar.currentView !== 'month') {
915
+ return this.rangeCalendar.nextYear();
916
+ }
917
+ return this.rangeCalendar.nextMonth();
918
+ };
919
+ }
920
+ get minDate() {
921
+ return this.datepickerConfig.minDate?.();
922
+ }
923
+ get maxDate() {
924
+ return this.datepickerConfig.maxDate?.();
925
+ }
926
+ get isPreviousDisabled() {
927
+ if (!this.minDate)
928
+ return false;
929
+ let previousPeriod = endOfMonth(add(this.calendar.activeDate, { months: -1 }));
930
+ if (this.calendar.currentView !== 'month') {
931
+ previousPeriod = add(this.calendar.activeDate, { years: -1 });
932
+ }
933
+ return isBefore(previousPeriod, this.minDate);
934
+ }
935
+ get isNextDisabled() {
936
+ if (!this.maxDate)
937
+ return false;
938
+ let nextPeriod = startOfMonth(add(this.calendar.activeDate, { months: 1 }));
939
+ if (this.calendar.currentView !== 'month') {
940
+ nextPeriod = add(this.calendar.activeDate, { years: 1 });
941
+ }
942
+ return isBefore(this.maxDate, nextPeriod);
943
+ }
944
+ get canDisplayLeftArrow() {
945
+ return !this.rangeCalendar || this.rangeCalendar.location === 'left' || this.calendar.currentView !== 'month';
946
+ }
947
+ get canDisplayRightArrow() {
948
+ return !this.rangeCalendar || this.rangeCalendar.location === 'right' || this.calendar.currentView !== 'month';
949
+ }
950
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangeCalendarHeaderComponent, deps: [{ token: WlcmDataRangeCalendar, optional: true }, { token: MAT_DATE_FORMATS, optional: true }, { token: forwardRef(() => MatCalendar) }, { token: WLCM_DATEPICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
951
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: WlcmDateRangeCalendarHeaderComponent, isStandalone: true, selector: "wlcm-date-range-calendar-header", ngImport: i0, template: "<wlcm-calendar-header\n [next]=\"next\"\n [previous]=\"previous\"\n [disableLeftArrow]=\"isPreviousDisabled\"\n [disableRightArrow]=\"isNextDisabled\"\n [displayLeftArrow]=\"canDisplayLeftArrow && !rangeCalendar.disabled()\"\n [displayRightArrow]=\"canDisplayRightArrow && !rangeCalendar.disabled()\"\n></wlcm-calendar-header>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: WlcmCalendarHeaderComponent, selector: "wlcm-calendar-header", inputs: ["next", "previous", "disableLeftArrow", "disableRightArrow", "displayLeftArrow", "displayRightArrow"] }] }); }
952
+ }
953
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDateRangeCalendarHeaderComponent, decorators: [{
954
+ type: Component,
955
+ args: [{ selector: 'wlcm-date-range-calendar-header', standalone: true, imports: [CommonModule, WlcmCalendarHeaderComponent], template: "<wlcm-calendar-header\n [next]=\"next\"\n [previous]=\"previous\"\n [disableLeftArrow]=\"isPreviousDisabled\"\n [disableRightArrow]=\"isNextDisabled\"\n [displayLeftArrow]=\"canDisplayLeftArrow && !rangeCalendar.disabled()\"\n [displayRightArrow]=\"canDisplayRightArrow && !rangeCalendar.disabled()\"\n></wlcm-calendar-header>\n" }]
956
+ }], ctorParameters: () => [{ type: WlcmDataRangeCalendar, decorators: [{
957
+ type: Optional
958
+ }] }, { type: undefined, decorators: [{
959
+ type: Optional
960
+ }, {
961
+ type: Inject,
962
+ args: [MAT_DATE_FORMATS]
963
+ }] }, { type: i2.MatCalendar, decorators: [{
964
+ type: Inject,
965
+ args: [forwardRef(() => MatCalendar)]
966
+ }] }, { type: undefined, decorators: [{
967
+ type: Inject,
968
+ args: [WLCM_DATEPICKER_CONFIG]
969
+ }] }] });
970
+
971
+ let DoubleCalendarRangePickerComponent = class DoubleCalendarRangePickerComponent extends WlcmDateRangePicker {
972
+ constructor(rangeConfig, rangeSelectionStrategy, localSelectionModel, triggerSelectionModel, trigger, datepickerConfig, dateAdapter) {
973
+ super(localSelectionModel, rangeSelectionStrategy);
974
+ this.rangeConfig = rangeConfig;
975
+ this.rangeSelectionStrategy = rangeSelectionStrategy;
976
+ this.localSelectionModel = localSelectionModel;
977
+ this.triggerSelectionModel = triggerSelectionModel;
978
+ this.trigger = trigger;
979
+ this.datepickerConfig = datepickerConfig;
980
+ this.dateAdapter = dateAdapter;
981
+ this.headerComponent = WlcmDateRangeCalendarHeaderComponent;
982
+ this._isViewInitialized = signal(false);
983
+ this.startDate = signal(new Date());
984
+ this.leftCalendarYearViewActivated = signal(false);
985
+ this.rightCalendarYearViewActivated = signal(false);
986
+ this.localSelectionModel.updateSelection(this.triggerSelectionModel.selection, this);
987
+ if (this.triggerSelectionModel.selection.start) {
988
+ this.startDate.set(this.triggerSelectionModel.selection.start);
989
+ }
990
+ if (this.rangeConfig.headerComponent) {
991
+ this.headerComponent = this.rangeConfig.headerComponent;
992
+ }
993
+ effect(() => {
994
+ if (!this._isViewInitialized())
995
+ return;
996
+ const startDate = this.startDate();
997
+ this.leftCalendar.activeDate = startDate;
998
+ this.rightCalendar.activeDate = this.dateAdapter.addCalendarMonths(startDate, 1);
999
+ this.rightCalendar.startAt = this.rightCalendar.activeDate;
1000
+ });
1001
+ }
1002
+ ngAfterViewInit() {
1003
+ this._isViewInitialized.set(true);
1004
+ this.leftCalendar.viewChanged.pipe(untilDestroyed(this)).subscribe((view) => {
1005
+ this.leftCalendarYearViewActivated.set(view !== 'month');
1006
+ });
1007
+ this.rightCalendar.viewChanged.pipe(untilDestroyed(this)).subscribe((view) => {
1008
+ this.rightCalendarYearViewActivated.set(view !== 'month');
1009
+ });
1010
+ this.handleRightCalendarPreviewChange();
1011
+ }
1012
+ apply() {
1013
+ this.triggerSelectionModel.updateSelection(this.localSelectionModel.selection, this);
1014
+ this.trigger.close();
1015
+ }
1016
+ reset() {
1017
+ this.trigger.close();
1018
+ }
1019
+ get leftCalendarActiveCell() {
1020
+ return this.leftCalendarElement.nativeElement.querySelector('.mat-calendar-body-active');
1021
+ }
1022
+ handleRightCalendarPreviewChange() {
1023
+ const viewChanged = new Subject();
1024
+ this.rightCalendar.viewChanged
1025
+ .pipe(untilDestroyed(this))
1026
+ .pipe(tap(() => viewChanged.next()))
1027
+ .pipe(startWith(this.rightCalendar.currentView))
1028
+ .subscribe((view) => {
1029
+ if (view !== 'month')
1030
+ return;
1031
+ this.rightCalendar.monthView._matCalendarBody.previewChange
1032
+ .pipe(takeUntil(viewChanged), untilDestroyed(this))
1033
+ .subscribe(() => {
1034
+ if (this.leftCalendar.currentView !== 'month' || !this.leftCalendar.monthView._rangeStart)
1035
+ return;
1036
+ this.leftCalendar.monthView._previewStart = this.rightCalendar.monthView._previewStart;
1037
+ this.leftCalendar.monthView._previewEnd = this.rightCalendar.monthView._previewEnd;
1038
+ const activeCell = this.leftCalendarActiveCell;
1039
+ if (activeCell && activeCell === document.activeElement)
1040
+ activeCell.blur();
1041
+ this.leftCalendar.monthView._changeDetectorRef.markForCheck();
1042
+ });
1043
+ });
1044
+ }
1045
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DoubleCalendarRangePickerComponent, deps: [{ token: WLCM_DATE_RANGE_PICKER_CONFIG, optional: true }, { token: MAT_DATE_RANGE_SELECTION_STRATEGY }, { token: WLCM_DATE_RANGE_SELECTION_MODEL }, { token: WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL }, { token: WlcmDatepickerTrigger }, { token: WLCM_DATEPICKER_CONFIG }, { token: i1$1.DateAdapter }], target: i0.ɵɵFactoryTarget.Component }); }
1046
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: DoubleCalendarRangePickerComponent, isStandalone: true, selector: "wlcm-double-calendar-range-picker", providers: [
1047
+ {
1048
+ provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
1049
+ useClass: DefaultMatCalendarRangeStrategy,
1050
+ },
1051
+ { provide: WlcmDateRangePicker, useExisting: forwardRef(() => DoubleCalendarRangePickerComponent) },
1052
+ WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER,
1053
+ ], viewQueries: [{ propertyName: "leftCalendar", first: true, predicate: WlcmLeftCalendarDirective, descendants: true, read: MatCalendar }, { propertyName: "rightCalendar", first: true, predicate: WlcmRightCalendarDirective, descendants: true, read: MatCalendar }, { propertyName: "leftCalendarElement", first: true, predicate: WlcmLeftCalendarDirective, descendants: true, read: ElementRef }, { propertyName: "monthView", first: true, predicate: MatMonthView, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"wlcm-date-range-picker-panel\">\n <div class=\"double-calendar-range-picker-body\">\n <mat-calendar\n wlcmCalendar\n wlcmLeftCalendar\n [selected]=\"selected\"\n [disabled]=\"rightCalendarYearViewActivated()\"\n [headerComponent]=\"headerComponent\"\n (_userSelection)=\"calendarSelection($event)\"\n (_userDragDrop)=\"calendarDragDrop($event)\"\n (dateChange)=\"startDate.set($event)\"\n ></mat-calendar>\n\n <mat-calendar\n wlcmCalendar\n wlcmRightCalendar\n [selected]=\"selected\"\n [disabled]=\"leftCalendarYearViewActivated()\"\n [headerComponent]=\"headerComponent\"\n (_userSelection)=\"calendarSelection($event)\"\n (_userDragDrop)=\"calendarDragDrop($event)\"\n (dateChange)=\"startDate.set($event)\"\n ></mat-calendar>\n </div>\n\n <wlcm-date-range-picker-bottom-panel></wlcm-date-range-picker-bottom-panel>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2.MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "directive", type: WlcmCalendarDirective, selector: "[wlcmCalendar]" }, { kind: "directive", type: WlcmLeftCalendarDirective, selector: "[wlcmLeftCalendar]" }, { kind: "directive", type: WlcmRightCalendarDirective, selector: "[wlcmRightCalendar]" }, { kind: "component", type: WlcmDateRangePickerBottomPanelComponent, selector: "wlcm-date-range-picker-bottom-panel" }] }); }
1054
+ };
1055
+ DoubleCalendarRangePickerComponent = __decorate([
1056
+ UntilDestroy(),
1057
+ __metadata("design:paramtypes", [Object, Object, MatDateSelectionModel,
1058
+ MatDateSelectionModel,
1059
+ WlcmDatepickerTrigger, Object, DateAdapter])
1060
+ ], DoubleCalendarRangePickerComponent);
1061
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DoubleCalendarRangePickerComponent, decorators: [{
1062
+ type: Component,
1063
+ args: [{ selector: 'wlcm-double-calendar-range-picker', imports: [
1064
+ CommonModule,
1065
+ MatDatepickerModule,
1066
+ WlcmCalendarDirective,
1067
+ WlcmLeftCalendarDirective,
1068
+ WlcmRightCalendarDirective,
1069
+ WlcmDateRangePickerBottomPanelComponent,
1070
+ ], providers: [
1071
+ {
1072
+ provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
1073
+ useClass: DefaultMatCalendarRangeStrategy,
1074
+ },
1075
+ { provide: WlcmDateRangePicker, useExisting: forwardRef(() => DoubleCalendarRangePickerComponent) },
1076
+ WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER,
1077
+ ], template: "<div class=\"wlcm-date-range-picker-panel\">\n <div class=\"double-calendar-range-picker-body\">\n <mat-calendar\n wlcmCalendar\n wlcmLeftCalendar\n [selected]=\"selected\"\n [disabled]=\"rightCalendarYearViewActivated()\"\n [headerComponent]=\"headerComponent\"\n (_userSelection)=\"calendarSelection($event)\"\n (_userDragDrop)=\"calendarDragDrop($event)\"\n (dateChange)=\"startDate.set($event)\"\n ></mat-calendar>\n\n <mat-calendar\n wlcmCalendar\n wlcmRightCalendar\n [selected]=\"selected\"\n [disabled]=\"leftCalendarYearViewActivated()\"\n [headerComponent]=\"headerComponent\"\n (_userSelection)=\"calendarSelection($event)\"\n (_userDragDrop)=\"calendarDragDrop($event)\"\n (dateChange)=\"startDate.set($event)\"\n ></mat-calendar>\n </div>\n\n <wlcm-date-range-picker-bottom-panel></wlcm-date-range-picker-bottom-panel>\n</div>\n" }]
1078
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1079
+ type: Optional
1080
+ }, {
1081
+ type: Inject,
1082
+ args: [WLCM_DATE_RANGE_PICKER_CONFIG]
1083
+ }] }, { type: undefined, decorators: [{
1084
+ type: Inject,
1085
+ args: [MAT_DATE_RANGE_SELECTION_STRATEGY]
1086
+ }] }, { type: i2.MatDateSelectionModel, decorators: [{
1087
+ type: Inject,
1088
+ args: [WLCM_DATE_RANGE_SELECTION_MODEL]
1089
+ }] }, { type: i2.MatDateSelectionModel, decorators: [{
1090
+ type: Inject,
1091
+ args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
1092
+ }] }, { type: WlcmDatepickerTrigger }, { type: undefined, decorators: [{
1093
+ type: Inject,
1094
+ args: [WLCM_DATEPICKER_CONFIG]
1095
+ }] }, { type: i1$1.DateAdapter }], propDecorators: { leftCalendar: [{
1096
+ type: ViewChild,
1097
+ args: [WlcmLeftCalendarDirective, { read: MatCalendar }]
1098
+ }], rightCalendar: [{
1099
+ type: ViewChild,
1100
+ args: [WlcmRightCalendarDirective, { read: MatCalendar }]
1101
+ }], leftCalendarElement: [{
1102
+ type: ViewChild,
1103
+ args: [WlcmLeftCalendarDirective, { read: ElementRef }]
1104
+ }], monthView: [{
1105
+ type: ViewChild,
1106
+ args: [MatMonthView]
1107
+ }] } });
1108
+
1029
1109
  let WlcmDatepickerInputDirective = class WlcmDatepickerInputDirective extends WlcmDatepickerInputBase {
1030
1110
  constructor(element, dateAdapter, dateFormats, selectionModel, trigger) {
1031
1111
  super(element, dateAdapter, dateFormats, trigger);
@@ -1051,7 +1131,7 @@ let WlcmDatepickerInputDirective = class WlcmDatepickerInputDirective extends Wl
1051
1131
  this._touched?.();
1052
1132
  });
1053
1133
  }
1054
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDatepickerInputDirective, deps: [{ token: i0.ElementRef }, { token: i1.DateAdapter }, { token: MAT_DATE_FORMATS }, { token: i2$1.MatDateSelectionModel }, { token: WlcmDatepickerTrigger }], target: i0.ɵɵFactoryTarget.Directive }); }
1134
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDatepickerInputDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.DateAdapter }, { token: MAT_DATE_FORMATS }, { token: i2.MatDateSelectionModel }, { token: WlcmDatepickerTrigger }], target: i0.ɵɵFactoryTarget.Directive }); }
1055
1135
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: WlcmDatepickerInputDirective, isStandalone: true, selector: "[wlcmDatepickerInput]", host: { classAttribute: "wlcm-form-field-input" }, providers: [
1056
1136
  { provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmDatepickerInputDirective), multi: true },
1057
1137
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmDatepickerInputDirective), multi: true },
@@ -1075,10 +1155,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
1075
1155
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmDatepickerInputDirective), multi: true },
1076
1156
  ],
1077
1157
  }]
1078
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter }, { type: undefined, decorators: [{
1158
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: undefined, decorators: [{
1079
1159
  type: Inject,
1080
1160
  args: [MAT_DATE_FORMATS]
1081
- }] }, { type: i2$1.MatDateSelectionModel }, { type: WlcmDatepickerTrigger }] });
1161
+ }] }, { type: i2.MatDateSelectionModel }, { type: WlcmDatepickerTrigger }] });
1082
1162
 
1083
1163
  class WlcmDatepickerPanelComponent {
1084
1164
  constructor(selectionModel, trigger, config) {
@@ -1092,13 +1172,13 @@ class WlcmDatepickerPanelComponent {
1092
1172
  this.selectionModel.updateSelection(date, this);
1093
1173
  this.trigger.close();
1094
1174
  }
1095
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDatepickerPanelComponent, deps: [{ token: i2$1.MatDateSelectionModel }, { token: WlcmDatepickerTrigger }, { token: WLCM_DATEPICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
1096
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.1.4", type: WlcmDatepickerPanelComponent, isStandalone: true, selector: "wlcm-datepicker-panel", host: { classAttribute: "wlcm-datepicker-panel" }, viewQueries: [{ propertyName: "matCalendar", first: true, predicate: MatCalendar, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-calendar\n wlcmCalendar\n [minDate]=\"config.minDate?.()\"\n [maxDate]=\"config.maxDate?.()\"\n [startAt]=\"selectionModel.selection\"\n [selected]=\"selectionModel.selection\"\n [headerComponent]=\"headerComponent\"\n (selectedChange)=\"select($event)\"\n></mat-calendar>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2$1.MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "directive", type: WlcmCalendarDirective, selector: "[wlcmCalendar]" }] }); }
1175
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDatepickerPanelComponent, deps: [{ token: i2.MatDateSelectionModel }, { token: WlcmDatepickerTrigger }, { token: WLCM_DATEPICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
1176
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.1.4", type: WlcmDatepickerPanelComponent, isStandalone: true, selector: "wlcm-datepicker-panel", host: { classAttribute: "wlcm-datepicker-panel" }, viewQueries: [{ propertyName: "matCalendar", first: true, predicate: MatCalendar, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-calendar\n wlcmCalendar\n [minDate]=\"config.minDate?.()\"\n [maxDate]=\"config.maxDate?.()\"\n [startAt]=\"selectionModel.selection\"\n [selected]=\"selectionModel.selection\"\n [headerComponent]=\"headerComponent\"\n (selectedChange)=\"select($event)\"\n></mat-calendar>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2.MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "directive", type: WlcmCalendarDirective, selector: "[wlcmCalendar]" }] }); }
1097
1177
  }
1098
1178
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDatepickerPanelComponent, decorators: [{
1099
1179
  type: Component,
1100
1180
  args: [{ selector: 'wlcm-datepicker-panel', host: { class: 'wlcm-datepicker-panel' }, standalone: true, imports: [CommonModule, MatDatepickerModule, WlcmCalendarDirective], template: "<mat-calendar\n wlcmCalendar\n [minDate]=\"config.minDate?.()\"\n [maxDate]=\"config.maxDate?.()\"\n [startAt]=\"selectionModel.selection\"\n [selected]=\"selectionModel.selection\"\n [headerComponent]=\"headerComponent\"\n (selectedChange)=\"select($event)\"\n></mat-calendar>\n" }]
1101
- }], ctorParameters: () => [{ type: i2$1.MatDateSelectionModel }, { type: WlcmDatepickerTrigger }, { type: undefined, decorators: [{
1181
+ }], ctorParameters: () => [{ type: i2.MatDateSelectionModel }, { type: WlcmDatepickerTrigger }, { type: undefined, decorators: [{
1102
1182
  type: Inject,
1103
1183
  args: [WLCM_DATEPICKER_CONFIG]
1104
1184
  }] }] });
@@ -1145,7 +1225,7 @@ class WlcmDatepickerInputContainerComponent extends WlcmDatepickerTrigger {
1145
1225
  this._focusStream$.next(merge(...focusObservables).pipe(map(voidFn)));
1146
1226
  this._blurStream$.next(merge(...blurObservables).pipe(map(voidFn)));
1147
1227
  }
1148
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDatepickerInputContainerComponent, deps: [{ token: i1$1.Overlay }, { token: i0.ViewContainerRef }, { token: i2$1.MatDateSelectionModel }, { token: WLCM_FORM_FIELD, host: true }], target: i0.ɵɵFactoryTarget.Component }); }
1228
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmDatepickerInputContainerComponent, deps: [{ token: i1.Overlay }, { token: i0.ViewContainerRef }, { token: i2.MatDateSelectionModel }, { token: WLCM_FORM_FIELD, host: true }], target: i0.ɵɵFactoryTarget.Component }); }
1149
1229
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.1.4", type: WlcmDatepickerInputContainerComponent, isStandalone: true, selector: "wlcm-datepicker-input-container", host: { classAttribute: "wlcm-datepicker-input-container" }, providers: [
1150
1230
  {
1151
1231
  provide: WLCM_INPUT_BINDER,
@@ -1175,7 +1255,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
1175
1255
  { provide: WlcmDatepickerTrigger, useExisting: forwardRef(() => WlcmDatepickerInputContainerComponent) },
1176
1256
  { provide: MatDateSelectionModel, useClass: MatSingleDateSelectionModel },
1177
1257
  ], template: "<ng-content select=\"[wlcmDatepickerInput]\"></ng-content>\n" }]
1178
- }], ctorParameters: () => [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }, { type: i2$1.MatDateSelectionModel }, { type: undefined, decorators: [{
1258
+ }], ctorParameters: () => [{ type: i1.Overlay }, { type: i0.ViewContainerRef }, { type: i2.MatDateSelectionModel }, { type: undefined, decorators: [{
1179
1259
  type: Host
1180
1260
  }, {
1181
1261
  type: Inject,
@@ -1225,5 +1305,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
1225
1305
  * Generated bundle index. Do not edit.
1226
1306
  */
1227
1307
 
1228
- export { DateRangePickerInputEndDirective, DateRangePickerInputStartDirective, WLCM_DATEPICKER_CONFIG, WlcmDateRangeInputValidator, WlcmDateRangePickerInputComponent, WlcmDateRangeValidation, WlcmDateValidation, WlcmDatepickerInputContainerComponent, WlcmDatepickerInputDirective, WlcmDatepickerModule };
1308
+ export { DateRangePickerInputEndDirective, DateRangePickerInputStartDirective, DoubleCalendarRangePickerComponent, SingleCalendarRangePickerComponent, WLCM_DATEPICKER_CONFIG, WlcmDateRangeInputValidator, WlcmDateRangePicker, WlcmDateRangePickerInputComponent, WlcmDateRangeValidation, WlcmDateValidation, WlcmDatepickerInputContainerComponent, WlcmDatepickerInputDirective, WlcmDatepickerModule };
1229
1309
  //# sourceMappingURL=wlcm-angular-datepicker.mjs.map