@wlcm/angular 18.2.20 → 18.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/button/esm2022/index.mjs +3 -0
- package/button/esm2022/lib/button.module.mjs +16 -0
- package/button/esm2022/lib/components/button/button.component.mjs +37 -0
- package/button/esm2022/lib/models/button.models.mjs +2 -0
- package/button/esm2022/wlcm-angular-button.mjs +5 -0
- package/button/fesm2022/wlcm-angular-button.mjs +7 -7
- package/button/fesm2022/wlcm-angular-button.mjs.map +1 -1
- package/core/esm2022/index.mjs +17 -0
- package/core/esm2022/lib/components/default-loader/default-loader.component.mjs +12 -0
- package/core/esm2022/lib/components/icons/calendar-icon/calendar-icon.component.mjs +12 -0
- package/core/esm2022/lib/components/icons/chevron-down-icon/chevron-down-icon.component.mjs +12 -0
- package/core/esm2022/lib/components/icons/close-icon/close-icon.component.mjs +12 -0
- package/core/esm2022/lib/components/icons/search-icon/search-icon.component.mjs +12 -0
- package/core/esm2022/lib/components/loader/loader.component.mjs +32 -0
- package/core/esm2022/lib/constants/_index.mjs +3 -0
- package/core/esm2022/lib/constants/http.constants.mjs +6 -0
- package/core/esm2022/lib/constants/icon.contants.mjs +15 -0
- package/core/esm2022/lib/constants/loader.constants.mjs +7 -0
- package/core/esm2022/lib/directives/_index.mjs +2 -0
- package/core/esm2022/lib/directives/icon.directive.mjs +49 -0
- package/core/esm2022/lib/models/_index.mjs +3 -0
- package/core/esm2022/lib/models/icon.models.mjs +7 -0
- package/core/esm2022/lib/models/option.models.mjs +17 -0
- package/core/esm2022/lib/services/scroll-detection.api.mjs +27 -0
- package/core/esm2022/lib/utils/paginated-data-emulator.utils.mjs +20 -0
- package/core/esm2022/lib/utils/stream.utils.mjs +16 -0
- package/core/esm2022/wlcm-angular-core.mjs +5 -0
- package/core/fesm2022/wlcm-angular-core.mjs +24 -24
- package/core/fesm2022/wlcm-angular-core.mjs.map +1 -1
- package/datepicker/esm2022/index.mjs +14 -0
- package/datepicker/esm2022/lib/components/calendar-header/calendar-header.component.mjs +63 -0
- package/datepicker/esm2022/lib/components/range/date-range-calendar-header/date-range-calendar-header.component.mjs +87 -0
- package/datepicker/esm2022/lib/components/range/date-range-picker-bottom-panel/date-range-picker-bottom-panel.component.mjs +19 -0
- package/datepicker/esm2022/lib/components/range/date-range-picker-input/date-range-picker-input.component.mjs +126 -0
- package/datepicker/esm2022/lib/components/range/double-calendar-range-picker/double-calendar-range-picker.component.mjs +168 -0
- package/datepicker/esm2022/lib/components/range/single-calendar-range-picker/single-calendar-range-picker.component.mjs +95 -0
- package/datepicker/esm2022/lib/components/single/datepicker-input-container/datepicker-input-container.component.mjs +92 -0
- package/datepicker/esm2022/lib/components/single/datepicker-panel/datepicker-panel.component.mjs +33 -0
- package/datepicker/esm2022/lib/constants/datepicker.constants.mjs +23 -0
- package/datepicker/esm2022/lib/constants/range/date-range-picker.constants.mjs +5 -0
- package/datepicker/esm2022/lib/constants/range/date-range-selection-model.constants.mjs +10 -0
- package/datepicker/esm2022/lib/constants/range/date-range-trigger-selection-model.constants.mjs +10 -0
- package/datepicker/esm2022/lib/datepicker.module.mjs +33 -0
- package/datepicker/esm2022/lib/directives/calendar.directive.mjs +15 -0
- package/datepicker/esm2022/lib/directives/datepicker-input.base.mjs +103 -0
- package/datepicker/esm2022/lib/directives/datepicker-trigger.base.mjs +105 -0
- package/datepicker/esm2022/lib/directives/ragne/date-range-picker-input-end.directive.mjs +81 -0
- package/datepicker/esm2022/lib/directives/ragne/date-range-picker-input-start.directive.mjs +81 -0
- package/datepicker/esm2022/lib/directives/ragne/date-range-picker-input.base.mjs +58 -0
- package/datepicker/esm2022/lib/directives/ragne/left-calendar.directive.mjs +51 -0
- package/datepicker/esm2022/lib/directives/ragne/right-calendar.directive.mjs +64 -0
- package/datepicker/esm2022/lib/directives/single/datepicker-input.directive.mjs +67 -0
- package/datepicker/esm2022/lib/models/date-picker.models.mjs +29 -0
- package/datepicker/esm2022/lib/models/range/data-range-calendar.models.mjs +61 -0
- package/datepicker/esm2022/lib/models/range/date-range-picker.models.mjs +27 -0
- package/datepicker/esm2022/lib/models/range/date-range-validation.models.mjs +5 -0
- package/datepicker/esm2022/lib/utils/range/date-range-input.validators.mjs +16 -0
- package/datepicker/esm2022/lib/utils/range/date-range-picker-errors.mjs +9 -0
- package/datepicker/esm2022/wlcm-angular-datepicker.mjs +5 -0
- package/datepicker/fesm2022/wlcm-angular-datepicker.mjs +701 -605
- package/datepicker/fesm2022/wlcm-angular-datepicker.mjs.map +1 -1
- package/datepicker/index.d.ts +4 -1
- package/datepicker/lib/components/range/date-range-picker-bottom-panel/date-range-picker-bottom-panel.component.d.ts +3 -3
- package/datepicker/lib/components/range/date-range-picker-input/date-range-picker-input.component.d.ts +5 -5
- package/datepicker/lib/components/range/{date-range-picker/date-range-picker.component.d.ts → double-calendar-range-picker/double-calendar-range-picker.component.d.ts} +12 -16
- package/datepicker/lib/components/range/single-calendar-range-picker/single-calendar-range-picker.component.d.ts +27 -0
- package/datepicker/lib/constants/range/date-range-picker.constants.d.ts +2 -1
- package/datepicker/lib/directives/datepicker-input.base.d.ts +1 -1
- package/datepicker/lib/directives/datepicker-trigger.base.d.ts +2 -3
- package/datepicker/lib/directives/ragne/date-range-picker-input.base.d.ts +1 -1
- package/datepicker/lib/models/range/data-range-calendar.models.d.ts +1 -1
- package/datepicker/lib/models/range/date-range-picker.models.d.ts +15 -1
- package/filters/esm2022/index.mjs +6 -0
- package/filters/esm2022/lib/components/filters-group/filters-group.component.mjs +13 -0
- package/filters/esm2022/lib/constants/filter.constants.mjs +3 -0
- package/filters/esm2022/lib/constants/index.mjs +2 -0
- package/filters/esm2022/lib/directives/filter.directive.mjs +11 -0
- package/filters/esm2022/lib/directives/index.mjs +2 -0
- package/filters/esm2022/lib/filters.module.mjs +20 -0
- package/filters/esm2022/lib/models/array-filter.models.mjs +73 -0
- package/filters/esm2022/lib/models/filter.models.mjs +39 -0
- package/filters/esm2022/lib/models/filters-group.models.mjs +60 -0
- package/filters/esm2022/lib/models/index.mjs +4 -0
- package/filters/esm2022/wlcm-angular-filters.mjs +5 -0
- package/filters/fesm2022/wlcm-angular-filters.mjs +13 -13
- package/filters/fesm2022/wlcm-angular-filters.mjs.map +1 -1
- package/filters/lib/models/filters-group.models.d.ts +1 -1
- package/forms/esm2022/index.mjs +13 -0
- package/forms/esm2022/lib/forms/components/autocomplete/autocomplete.component.mjs +243 -0
- package/forms/esm2022/lib/forms/components/checkbox/checkbox.component.mjs +85 -0
- package/forms/esm2022/lib/forms/components/checkbox-group/checkbox-group.component.mjs +87 -0
- package/forms/esm2022/lib/forms/components/error/error.component.mjs +12 -0
- package/forms/esm2022/lib/forms/components/form-field/form-field.component.mjs +137 -0
- package/forms/esm2022/lib/forms/components/index.mjs +9 -0
- package/forms/esm2022/lib/forms/components/label/label.component.mjs +23 -0
- package/forms/esm2022/lib/forms/components/partials/autocomplete-suffix/autocomplete-suffix.component.mjs +19 -0
- package/forms/esm2022/lib/forms/components/partials/index.mjs +2 -0
- package/forms/esm2022/lib/forms/components/select/select.component.mjs +330 -0
- package/forms/esm2022/lib/forms/constants/form-elements.constants.mjs +5 -0
- package/forms/esm2022/lib/forms/constants/form-errors.constants.mjs +7 -0
- package/forms/esm2022/lib/forms/constants/form-field.constants.mjs +2 -0
- package/forms/esm2022/lib/forms/constants/form-state-handlers.constants.mjs +13 -0
- package/forms/esm2022/lib/forms/constants/index.mjs +6 -0
- package/forms/esm2022/lib/forms/constants/select.constants.mjs +3 -0
- package/forms/esm2022/lib/forms/directives/autocomplete.directive.mjs +64 -0
- package/forms/esm2022/lib/forms/directives/form-field-custom-container.directive.mjs +17 -0
- package/forms/esm2022/lib/forms/directives/form-field-hint.directive.mjs +15 -0
- package/forms/esm2022/lib/forms/directives/form-field-prefix.directive.mjs +22 -0
- package/forms/esm2022/lib/forms/directives/form-field-suffix.directive.mjs +14 -0
- package/forms/esm2022/lib/forms/directives/input.directive.mjs +47 -0
- package/forms/esm2022/lib/forms/directives/select-input-binder.directive.mjs +33 -0
- package/forms/esm2022/lib/forms/forms.module.mjs +64 -0
- package/forms/esm2022/lib/forms/models/_index.mjs +6 -0
- package/forms/esm2022/lib/forms/models/autocomplete.models.mjs +10 -0
- package/forms/esm2022/lib/forms/models/form-errors.models.mjs +2 -0
- package/forms/esm2022/lib/forms/models/form.models.mjs +2 -0
- package/forms/esm2022/lib/forms/models/input.models.mjs +2 -0
- package/forms/esm2022/lib/forms/models/select.models.mjs +2 -0
- package/forms/esm2022/lib/forms/pipes/errors-mapper.pipe.mjs +53 -0
- package/forms/esm2022/lib/forms/services/form-state-handler.service.mjs +19 -0
- package/forms/esm2022/lib/forms/services/index.mjs +3 -0
- package/forms/esm2022/lib/forms/services/places.api.mjs +62 -0
- package/forms/esm2022/wlcm-angular-forms.mjs +5 -0
- package/forms/fesm2022/wlcm-angular-forms.mjs +85 -73
- package/forms/fesm2022/wlcm-angular-forms.mjs.map +1 -1
- package/forms/lib/forms/components/autocomplete/autocomplete.component.d.ts +1 -0
- package/forms/lib/forms/components/select/select.component.d.ts +2 -0
- package/forms/lib/forms/models/autocomplete.models.d.ts +1 -1
- package/package.json +1 -1
- package/phone-input/esm2022/index.mjs +5 -0
- package/phone-input/esm2022/lib/components/country-code-select/country-code-select.component.mjs +32 -0
- package/phone-input/esm2022/lib/components/phone-input-container/phone-input-container.component.mjs +107 -0
- package/phone-input/esm2022/lib/constants/country-code-options.constants.mjs +20 -0
- package/phone-input/esm2022/lib/constants/phone-adapter.constants.mjs +3 -0
- package/phone-input/esm2022/lib/directives/phone-input.directive.mjs +155 -0
- package/phone-input/esm2022/lib/models/country-code.models.mjs +10 -0
- package/phone-input/esm2022/lib/models/phone-adapter.models.mjs +3 -0
- package/phone-input/esm2022/lib/models/phone.models.mjs +5 -0
- package/phone-input/esm2022/lib/phone-input.module.mjs +20 -0
- package/phone-input/esm2022/lib/pipes/phone-code.pipe.mjs +18 -0
- package/phone-input/esm2022/wlcm-angular-phone-input.mjs +5 -0
- package/phone-input/fesm2022/wlcm-angular-phone-input.mjs +17 -17
- package/phone-input/fesm2022/wlcm-angular-phone-input.mjs.map +1 -1
- package/search-field/esm2022/index.mjs +3 -0
- package/search-field/esm2022/lib/components/search-field/search-field.component.mjs +39 -0
- package/search-field/esm2022/lib/search-field.module.mjs +18 -0
- package/search-field/esm2022/wlcm-angular-search-field.mjs +5 -0
- package/search-field/fesm2022/wlcm-angular-search-field.mjs +7 -7
- package/search-field/fesm2022/wlcm-angular-search-field.mjs.map +1 -1
- package/stepper/esm2022/index.mjs +11 -0
- package/stepper/esm2022/lib/components/step/step.component.mjs +53 -0
- package/stepper/esm2022/lib/components/step-header/step-header.component.mjs +81 -0
- package/stepper/esm2022/lib/components/stepper/stepper.component.mjs +15 -0
- package/stepper/esm2022/lib/components/stepper-header/stepper-header.component.mjs +16 -0
- package/stepper/esm2022/lib/constants/step.constants.mjs +9 -0
- package/stepper/esm2022/lib/constants/stepper.stepper.mjs +3 -0
- package/stepper/esm2022/lib/directives/load-on-active-step.directive.mjs +51 -0
- package/stepper/esm2022/lib/models/step.models.mjs +60 -0
- package/stepper/esm2022/lib/models/stepper.models.mjs +114 -0
- package/stepper/esm2022/lib/stepper.module.mjs +34 -0
- package/stepper/esm2022/wlcm-angular-stepper.mjs +5 -0
- package/stepper/fesm2022/wlcm-angular-stepper.mjs +25 -25
- package/stepper/fesm2022/wlcm-angular-stepper.mjs.map +1 -1
- package/stepper/lib/models/step.models.d.ts +1 -1
- package/stepper/lib/models/stepper.models.d.ts +1 -1
- package/styles/components/datepicker/date-range-picker/_date-range-picker-body.scss +1 -1
- package/styles/components/datepicker/date-range-picker/_date-range-picker-input.scss +1 -0
- package/table/esm2022/index.mjs +9 -0
- package/table/esm2022/lib/components/table/table.component.mjs +79 -0
- package/table/esm2022/lib/components/table-head/table-head.component.mjs +18 -0
- package/table/esm2022/lib/components/table-head-actions/table-head-actions.component.mjs +41 -0
- package/table/esm2022/lib/components/table-head-data/table-head-data.component.mjs +12 -0
- package/table/esm2022/lib/components/table-row/table-row.component.mjs +87 -0
- package/table/esm2022/lib/components/table-row-actions/table-row-actions.component.mjs +12 -0
- package/table/esm2022/lib/components/table-row-data/table-row-data.component.mjs +12 -0
- package/table/esm2022/lib/components/table-row-spacer/table-row-spacer.component.mjs +12 -0
- package/table/esm2022/lib/constants/table-row.constants.mjs +3 -0
- package/table/esm2022/lib/constants/table.constants.mjs +5 -0
- package/table/esm2022/lib/directives/scrollable-table-container.directive.mjs +46 -0
- package/table/esm2022/lib/models/table-config-manager.models.mjs +18 -0
- package/table/esm2022/lib/models/table-row.models.mjs +2 -0
- package/table/esm2022/lib/models/table-selection-model.mjs +48 -0
- package/table/esm2022/lib/models/table.models.mjs +2 -0
- package/table/esm2022/lib/pipes/table-row-injector.pipe.mjs +24 -0
- package/table/esm2022/lib/table.module.mjs +38 -0
- package/table/esm2022/lib/utils/table-errors.utils.mjs +6 -0
- package/table/esm2022/wlcm-angular-table.mjs +5 -0
- package/table/fesm2022/wlcm-angular-table.mjs +34 -34
- package/table/fesm2022/wlcm-angular-table.mjs.map +1 -1
@@ -1,146 +1,32 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import {
|
2
|
+
import { InjectionToken, Injectable, input, Injector, ViewContainerRef, Directive, HostBinding, HostListener, forwardRef, ElementRef, Optional, Inject, signal, computed, Component, Type, ViewChild, inject, Host, Input, ContentChild, output, effect, viewChild, contentChild, NgModule } from '@angular/core';
|
3
3
|
import { CommonModule } from '@angular/common';
|
4
|
-
import * as i2
|
5
|
-
import {
|
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,
|
8
|
-
import * as
|
9
|
-
import {
|
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 {
|
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
|
22
|
-
import
|
23
|
-
|
24
|
-
|
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
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
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);
|
@@ -154,10 +40,10 @@ class WlcmDateAdapter extends DateFnsAdapter {
|
|
154
40
|
const formatString = style === 'long' ? 'EEEE' : 'EEEEEE';
|
155
41
|
return range(7, (i) => format(new Date(2017, 0, i + 1), formatString));
|
156
42
|
}
|
157
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
158
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDateAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
44
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDateAdapter }); }
|
159
45
|
}
|
160
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDateAdapter, decorators: [{
|
161
47
|
type: Injectable
|
162
48
|
}] });
|
163
49
|
var WlcmDateValidation;
|
@@ -186,234 +72,50 @@ 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
|
190
|
-
|
191
|
-
this.
|
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
|
-
};
|
212
|
-
}
|
213
|
-
get minDate() {
|
214
|
-
return this.datepickerConfig.minDate?.();
|
75
|
+
let WlcmDatepickerTrigger = class WlcmDatepickerTrigger {
|
76
|
+
get isOnlySelect() {
|
77
|
+
return this.selectOnly();
|
215
78
|
}
|
216
|
-
|
217
|
-
|
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();
|
218
88
|
}
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
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);
|
227
97
|
}
|
228
|
-
|
229
|
-
|
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);
|
98
|
+
close() {
|
99
|
+
this.overlayRef.detach();
|
236
100
|
}
|
237
|
-
get
|
238
|
-
return
|
101
|
+
get isOpen() {
|
102
|
+
return this.overlayRef.hasAttached();
|
239
103
|
}
|
240
|
-
get
|
241
|
-
return
|
104
|
+
get opened() {
|
105
|
+
return merge(this.overlayRef?.attachments() || EMPTY).pipe(filter(() => this.overlayRef.hasAttached()));
|
242
106
|
}
|
243
|
-
|
244
|
-
|
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, WlcmIconDirective], 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();
|
107
|
+
get closed() {
|
108
|
+
return (this.overlayRef?.detachments() || EMPTY).pipe(filter(() => !this.overlayRef.hasAttached()));
|
289
109
|
}
|
290
|
-
|
291
|
-
|
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
|
+
});
|
292
116
|
}
|
293
|
-
|
294
|
-
this.
|
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
|
-
});
|
414
|
-
}
|
415
|
-
get defaultDatepickerConfig() {
|
416
|
-
return this.viewContainerRef.injector.get(WLCM_DATEPICKER_CONFIG, {}, { optional: true });
|
117
|
+
get defaultDatepickerConfig() {
|
118
|
+
return this.viewContainerRef.injector.get(WLCM_DATEPICKER_CONFIG, {}, { optional: true });
|
417
119
|
}
|
418
120
|
get datepickerConfig() {
|
419
121
|
const config = this.defaultDatepickerConfig;
|
@@ -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
|
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,8 +149,8 @@ let WlcmDatepickerTrigger = class WlcmDatepickerTrigger {
|
|
451
149
|
backdropClass: 'transparent',
|
452
150
|
});
|
453
151
|
}
|
454
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
455
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
152
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerTrigger, deps: [{ token: i1.Overlay }, { token: i0.ViewContainerRef }, { token: i2.MatDateSelectionModel }], target: i0.ɵɵFactoryTarget.Directive }); }
|
153
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.6", type: WlcmDatepickerTrigger, 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([
|
458
156
|
UntilDestroy(),
|
@@ -460,178 +158,13 @@ WlcmDatepickerTrigger = __decorate([
|
|
460
158
|
ViewContainerRef,
|
461
159
|
MatDateSelectionModel])
|
462
160
|
], WlcmDatepickerTrigger);
|
463
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerTrigger, decorators: [{
|
464
162
|
type: Directive
|
465
|
-
}], ctorParameters: () => [{ type: i1
|
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;
|
506
|
-
}
|
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
|
-
});
|
514
|
-
}
|
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();
|
524
|
-
}
|
525
|
-
calendarSelection(event) {
|
526
|
-
const newSelection = this.rangeSelectionStrategy.selectionFinished(event.value, this.localSelectionModel.selection, event.event);
|
527
|
-
this.localSelectionModel.updateSelection(newSelection, this);
|
528
|
-
}
|
529
|
-
calendarDragDrop(event) {
|
530
|
-
this.localSelectionModel.updateSelection(event.value, this);
|
531
|
-
}
|
532
|
-
apply() {
|
533
|
-
this.triggerSelectionModel.updateSelection(this.localSelectionModel.selection, this);
|
534
|
-
this.trigger.close();
|
535
|
-
}
|
536
|
-
reset() {
|
537
|
-
this.trigger.close();
|
538
|
-
}
|
539
|
-
get selected() {
|
540
|
-
return this.localSelectionModel.selection;
|
541
|
-
}
|
542
|
-
get leftCalendarActiveCell() {
|
543
|
-
return this.leftCalendarElement.nativeElement.querySelector('.mat-calendar-body-active');
|
544
|
-
}
|
545
|
-
handleSelectionChanged() {
|
546
|
-
this.localSelectionModel.selectionChanged
|
547
|
-
.pipe(untilDestroyed(this))
|
548
|
-
.subscribe(() => this._isComplete.set(this.localSelectionModel.isComplete()));
|
549
|
-
}
|
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
168
|
class WlcmDatepickerInputBase {
|
636
169
|
handleBlur() {
|
637
170
|
this.updateSelection();
|
@@ -710,12 +243,12 @@ class WlcmDatepickerInputBase {
|
|
710
243
|
}
|
711
244
|
this.inputElement.value = newValue;
|
712
245
|
}
|
713
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
714
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
246
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerInputBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
|
247
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: WlcmDatepickerInputBase, host: { listeners: { "blur": "handleBlur()", "input": "handleInput()" }, properties: { "class": "this.datepickerInputClass" } }, ngImport: i0 }); }
|
715
248
|
}
|
716
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", 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: [{
|
@@ -753,9 +286,11 @@ class WlcmDateRangePickerInputBase extends WlcmDatepickerInputBase {
|
|
753
286
|
this.changeInputSize();
|
754
287
|
}
|
755
288
|
changeInputSize() {
|
756
|
-
|
757
|
-
|
758
|
-
|
289
|
+
requestAnimationFrame(() => {
|
290
|
+
const value = this.currentValue || this.inputElement.placeholder;
|
291
|
+
this._inputMirror.innerHTML = value;
|
292
|
+
this.inputElement.style.width = `${this._inputMirror.offsetWidth + 2}px`;
|
293
|
+
});
|
759
294
|
}
|
760
295
|
createInputMirror() {
|
761
296
|
const inputMirror = document.createElement('div');
|
@@ -768,19 +303,19 @@ class WlcmDateRangePickerInputBase extends WlcmDatepickerInputBase {
|
|
768
303
|
target.style.fontFamily = inputElementStyles.fontFamily;
|
769
304
|
target.style.letterSpacing = inputElementStyles.letterSpacing;
|
770
305
|
}
|
771
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
772
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
306
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDateRangePickerInputBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
|
307
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: WlcmDateRangePickerInputBase, usesInheritance: true, ngImport: i0 }); }
|
773
308
|
}
|
774
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDateRangePickerInputBase, decorators: [{
|
775
310
|
type: Directive
|
776
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter }, { type: undefined }, { type: WlcmDatepickerTrigger }] });
|
311
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: undefined }, { type: WlcmDatepickerTrigger }] });
|
777
312
|
|
778
313
|
var WlcmDateRangeValidation;
|
779
314
|
(function (WlcmDateRangeValidation) {
|
780
315
|
WlcmDateRangeValidation["StartExceedsEnd"] = "wlcmDateRangeStartExceedsEnd";
|
781
316
|
})(WlcmDateRangeValidation || (WlcmDateRangeValidation = {}));
|
782
317
|
|
783
|
-
let
|
318
|
+
let DateRangePickerInputStartDirective = class DateRangePickerInputStartDirective extends WlcmDateRangePickerInputBase {
|
784
319
|
constructor(element, dateAdapter, dateFormats, selectionModel, trigger) {
|
785
320
|
super(element, dateAdapter, dateFormats, trigger);
|
786
321
|
this.element = element;
|
@@ -789,16 +324,16 @@ let DateRangePickerInputEndDirective = class DateRangePickerInputEndDirective ex
|
|
789
324
|
this.selectionModel = selectionModel;
|
790
325
|
this.trigger = trigger;
|
791
326
|
this.updateSelection = () => {
|
792
|
-
let
|
793
|
-
this.selectionModel.updateSelection(new DateRange(this.selectionModel.selection.
|
327
|
+
let start = this.parseCurrentValue();
|
328
|
+
this.selectionModel.updateSelection(new DateRange(start, this.selectionModel.selection.end), this);
|
794
329
|
};
|
795
330
|
this.handleSelectionChange();
|
796
331
|
}
|
797
332
|
validate() {
|
798
333
|
const defaultErrors = super.validate();
|
799
|
-
if (isValid(this.selectionModel.selection.
|
800
|
-
const
|
801
|
-
if (
|
334
|
+
if (this.selectionModel.isComplete() && isValid(this.selectionModel.selection.end)) {
|
335
|
+
const startDate = this.parseCurrentValue();
|
336
|
+
if (startDate && isAfter(startDate, this.selectionModel.selection.end)) {
|
802
337
|
return { [WlcmDateRangeValidation.StartExceedsEnd]: true, ...(defaultErrors ?? {}) };
|
803
338
|
}
|
804
339
|
}
|
@@ -806,46 +341,237 @@ let DateRangePickerInputEndDirective = class DateRangePickerInputEndDirective ex
|
|
806
341
|
}
|
807
342
|
handleSelectionChange() {
|
808
343
|
this.selectionModel.selectionChanged.pipe(untilDestroyed(this)).subscribe(({ selection }) => {
|
809
|
-
const validDate = this.dateAdapter.getValidDateOrNull(selection.
|
344
|
+
const validDate = this.dateAdapter.getValidDateOrNull(selection.start);
|
810
345
|
this._changed?.(validDate);
|
811
346
|
this.updateInputValue(validDate);
|
812
347
|
this._validatorChanged?.();
|
813
348
|
});
|
814
349
|
}
|
815
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
816
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
817
|
-
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() =>
|
818
|
-
{ provide: NG_VALIDATORS, useExisting: forwardRef(() =>
|
350
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", 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 }); }
|
351
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: DateRangePickerInputStartDirective, isStandalone: true, selector: "[wlcmDateRangePickerInputStart]", host: { classAttribute: "wlcm-date-range-picker-input-field" }, providers: [
|
352
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateRangePickerInputStartDirective), multi: true },
|
353
|
+
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => DateRangePickerInputStartDirective), multi: true },
|
819
354
|
], usesInheritance: true, ngImport: i0 }); }
|
820
355
|
};
|
821
|
-
|
356
|
+
DateRangePickerInputStartDirective = __decorate([
|
822
357
|
UntilDestroy(),
|
823
358
|
__metadata("design:paramtypes", [ElementRef,
|
824
359
|
DateAdapter, Object, MatDateSelectionModel,
|
825
360
|
WlcmDatepickerTrigger])
|
826
|
-
],
|
827
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
361
|
+
], DateRangePickerInputStartDirective);
|
362
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: DateRangePickerInputStartDirective, decorators: [{
|
828
363
|
type: Directive,
|
829
364
|
args: [{
|
830
|
-
selector: '[
|
365
|
+
selector: '[wlcmDateRangePickerInputStart]',
|
831
366
|
host: { class: 'wlcm-date-range-picker-input-field' },
|
832
367
|
standalone: true,
|
833
368
|
providers: [
|
834
|
-
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() =>
|
835
|
-
{ provide: NG_VALIDATORS, useExisting: forwardRef(() =>
|
369
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateRangePickerInputStartDirective), multi: true },
|
370
|
+
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => DateRangePickerInputStartDirective), multi: true },
|
836
371
|
],
|
837
372
|
}]
|
838
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter }, { type: undefined, decorators: [{
|
373
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: undefined, decorators: [{
|
839
374
|
type: Optional
|
840
375
|
}, {
|
841
376
|
type: Inject,
|
842
377
|
args: [MAT_DATE_FORMATS]
|
843
|
-
}] }, { type: i2
|
378
|
+
}] }, { type: i2.MatDateSelectionModel, decorators: [{
|
844
379
|
type: Inject,
|
845
380
|
args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
|
846
381
|
}] }, { type: WlcmDatepickerTrigger }] });
|
847
382
|
|
848
|
-
|
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();
|
397
|
+
}
|
398
|
+
calendarSelection(event) {
|
399
|
+
const newSelection = this.rangeSelectionStrategy.selectionFinished(event.value, this.localSelectionModel.selection, event.event);
|
400
|
+
this.localSelectionModel.updateSelection(newSelection, this);
|
401
|
+
}
|
402
|
+
calendarDragDrop(event) {
|
403
|
+
this.localSelectionModel.updateSelection(event.value, this);
|
404
|
+
}
|
405
|
+
get selected() {
|
406
|
+
return this.localSelectionModel.selection;
|
407
|
+
}
|
408
|
+
handleSelectionChanged() {
|
409
|
+
this.localSelectionModel.selectionChanged
|
410
|
+
.pipe(untilDestroyed(this))
|
411
|
+
.subscribe(() => this._isComplete.set(this.localSelectionModel.isComplete()));
|
412
|
+
}
|
413
|
+
}
|
414
|
+
|
415
|
+
class WlcmDateRangePickerBottomPanelComponent {
|
416
|
+
constructor(picker) {
|
417
|
+
this.picker = picker;
|
418
|
+
}
|
419
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDateRangePickerBottomPanelComponent, deps: [{ token: WlcmDateRangePicker }], target: i0.ɵɵFactoryTarget.Component }); }
|
420
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", 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: "18.2.6", 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
|
+
const WLCM_DATE_RANGE_PICKER_CONFIG = new InjectionToken('WLCM_DATE_RANGE_PICKER_CONFIG', { providedIn: 'root', factory: () => ({}) });
|
428
|
+
const WLCM_DATE_RANGE_PICKER_BP = new InjectionToken('WLCM_DATE_RANGE_PICKER_BP', { providedIn: 'root', factory: () => WlcmDateRangePickerBottomPanelComponent });
|
429
|
+
|
430
|
+
class WlcmCalendarHeaderComponent {
|
431
|
+
constructor(dateAdapter, dateFormats, calendar) {
|
432
|
+
this.dateAdapter = dateAdapter;
|
433
|
+
this.dateFormats = dateFormats;
|
434
|
+
this.calendar = calendar;
|
435
|
+
this.WlcmIconName = WlcmIconName;
|
436
|
+
this.next = input();
|
437
|
+
this.previous = input();
|
438
|
+
this.disableLeftArrow = input(false);
|
439
|
+
this.disableRightArrow = input(false);
|
440
|
+
this.displayLeftArrow = input(true);
|
441
|
+
this.displayRightArrow = input(true);
|
442
|
+
}
|
443
|
+
previousClicked() {
|
444
|
+
if (this.previous())
|
445
|
+
return this.previous()();
|
446
|
+
this.calendar.activeDate =
|
447
|
+
this.calendar.currentView == 'month'
|
448
|
+
? this.dateAdapter.addCalendarMonths(this.calendar.activeDate, -1)
|
449
|
+
: this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage);
|
450
|
+
}
|
451
|
+
nextClicked() {
|
452
|
+
if (this.next())
|
453
|
+
return this.next()();
|
454
|
+
this.calendar.activeDate =
|
455
|
+
this.calendar.currentView == 'month'
|
456
|
+
? this.dateAdapter.addCalendarMonths(this.calendar.activeDate, 1)
|
457
|
+
: this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage);
|
458
|
+
}
|
459
|
+
changeCalendarView() {
|
460
|
+
if (this.calendar.currentView === 'multi-year') {
|
461
|
+
this.calendar.currentView = 'month';
|
462
|
+
return;
|
463
|
+
}
|
464
|
+
this.calendar.currentView = 'multi-year';
|
465
|
+
}
|
466
|
+
get periodLabel() {
|
467
|
+
return this.dateAdapter.format(this.calendar.activeDate, this.dateFormats.display.monthYearLabel);
|
468
|
+
}
|
469
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmCalendarHeaderComponent, deps: [{ token: i1$1.DateAdapter }, { token: MAT_DATE_FORMATS, optional: true }, { token: forwardRef(() => MatCalendar) }], target: i0.ɵɵFactoryTarget.Component }); }
|
470
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", 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"] }] }); }
|
471
|
+
}
|
472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmCalendarHeaderComponent, decorators: [{
|
473
|
+
type: Component,
|
474
|
+
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" }]
|
475
|
+
}], ctorParameters: () => [{ type: i1$1.DateAdapter }, { type: undefined, decorators: [{
|
476
|
+
type: Optional
|
477
|
+
}, {
|
478
|
+
type: Inject,
|
479
|
+
args: [MAT_DATE_FORMATS]
|
480
|
+
}] }, { type: i2.MatCalendar, decorators: [{
|
481
|
+
type: Inject,
|
482
|
+
args: [forwardRef(() => MatCalendar)]
|
483
|
+
}] }] });
|
484
|
+
|
485
|
+
class WlcmCalendarDirective {
|
486
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmCalendarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
487
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: WlcmCalendarDirective, isStandalone: true, selector: "[wlcmCalendar]", host: { classAttribute: "wlcm-calendar" }, ngImport: i0 }); }
|
488
|
+
}
|
489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmCalendarDirective, decorators: [{
|
490
|
+
type: Directive,
|
491
|
+
args: [{
|
492
|
+
selector: '[wlcmCalendar]',
|
493
|
+
host: { class: 'wlcm-calendar' },
|
494
|
+
standalone: true,
|
495
|
+
}]
|
496
|
+
}] });
|
497
|
+
|
498
|
+
let SingleCalendarRangePickerComponent = class SingleCalendarRangePickerComponent extends WlcmDateRangePicker {
|
499
|
+
constructor(rangeSelectionStrategy, localSelectionModel, triggerSelectionModel, trigger, datepickerConfig, pickerBottomPanel, dateAdapter) {
|
500
|
+
super(localSelectionModel, rangeSelectionStrategy);
|
501
|
+
this.rangeSelectionStrategy = rangeSelectionStrategy;
|
502
|
+
this.localSelectionModel = localSelectionModel;
|
503
|
+
this.triggerSelectionModel = triggerSelectionModel;
|
504
|
+
this.trigger = trigger;
|
505
|
+
this.datepickerConfig = datepickerConfig;
|
506
|
+
this.pickerBottomPanel = pickerBottomPanel;
|
507
|
+
this.dateAdapter = dateAdapter;
|
508
|
+
this.headerComponent = WlcmCalendarHeaderComponent;
|
509
|
+
this.localSelectionModel.updateSelection(this.triggerSelectionModel.selection, this);
|
510
|
+
}
|
511
|
+
ngAfterViewInit() {
|
512
|
+
this.bottomPanelContainer.createComponent(this.pickerBottomPanel);
|
513
|
+
}
|
514
|
+
get minDate() {
|
515
|
+
return this.datepickerConfig.minDate?.();
|
516
|
+
}
|
517
|
+
get maxDate() {
|
518
|
+
return this.datepickerConfig.maxDate?.();
|
519
|
+
}
|
520
|
+
apply() {
|
521
|
+
this.triggerSelectionModel.updateSelection(this.localSelectionModel.selection, this);
|
522
|
+
this.trigger.close();
|
523
|
+
}
|
524
|
+
reset() {
|
525
|
+
this.trigger.close();
|
526
|
+
}
|
527
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: SingleCalendarRangePickerComponent, deps: [{ 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: WLCM_DATE_RANGE_PICKER_BP }, { token: i1$1.DateAdapter }], target: i0.ɵɵFactoryTarget.Component }); }
|
528
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: SingleCalendarRangePickerComponent, isStandalone: true, selector: "wlcm-single-calendar-range-picker", providers: [
|
529
|
+
{
|
530
|
+
provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
|
531
|
+
useClass: DefaultMatCalendarRangeStrategy,
|
532
|
+
},
|
533
|
+
{ provide: WlcmDateRangePicker, useExisting: forwardRef(() => SingleCalendarRangePickerComponent) },
|
534
|
+
WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER,
|
535
|
+
], viewQueries: [{ propertyName: "bottomPanelContainer", first: true, predicate: ["bottomPanelContainer"], descendants: true, read: ViewContainerRef }], 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 <ng-container #bottomPanelContainer></ng-container>\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]" }] }); }
|
536
|
+
};
|
537
|
+
SingleCalendarRangePickerComponent = __decorate([
|
538
|
+
UntilDestroy(),
|
539
|
+
__metadata("design:paramtypes", [Object, MatDateSelectionModel,
|
540
|
+
MatDateSelectionModel,
|
541
|
+
WlcmDatepickerTrigger, Object, Type,
|
542
|
+
DateAdapter])
|
543
|
+
], SingleCalendarRangePickerComponent);
|
544
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: SingleCalendarRangePickerComponent, decorators: [{
|
545
|
+
type: Component,
|
546
|
+
args: [{ selector: 'wlcm-single-calendar-range-picker', imports: [CommonModule, MatDatepickerModule, WlcmCalendarDirective], standalone: true, providers: [
|
547
|
+
{
|
548
|
+
provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
|
549
|
+
useClass: DefaultMatCalendarRangeStrategy,
|
550
|
+
},
|
551
|
+
{ provide: WlcmDateRangePicker, useExisting: forwardRef(() => SingleCalendarRangePickerComponent) },
|
552
|
+
WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER,
|
553
|
+
], 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 <ng-container #bottomPanelContainer></ng-container>\n</div>\n" }]
|
554
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
555
|
+
type: Inject,
|
556
|
+
args: [MAT_DATE_RANGE_SELECTION_STRATEGY]
|
557
|
+
}] }, { type: i2.MatDateSelectionModel, decorators: [{
|
558
|
+
type: Inject,
|
559
|
+
args: [WLCM_DATE_RANGE_SELECTION_MODEL]
|
560
|
+
}] }, { type: i2.MatDateSelectionModel, decorators: [{
|
561
|
+
type: Inject,
|
562
|
+
args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
|
563
|
+
}] }, { type: WlcmDatepickerTrigger }, { type: undefined, decorators: [{
|
564
|
+
type: Inject,
|
565
|
+
args: [WLCM_DATEPICKER_CONFIG]
|
566
|
+
}] }, { type: i0.Type, decorators: [{
|
567
|
+
type: Inject,
|
568
|
+
args: [WLCM_DATE_RANGE_PICKER_BP]
|
569
|
+
}] }, { type: i1$1.DateAdapter }], propDecorators: { bottomPanelContainer: [{
|
570
|
+
type: ViewChild,
|
571
|
+
args: ['bottomPanelContainer', { read: ViewContainerRef }]
|
572
|
+
}] } });
|
573
|
+
|
574
|
+
let DateRangePickerInputEndDirective = class DateRangePickerInputEndDirective extends WlcmDateRangePickerInputBase {
|
849
575
|
constructor(element, dateAdapter, dateFormats, selectionModel, trigger) {
|
850
576
|
super(element, dateAdapter, dateFormats, trigger);
|
851
577
|
this.element = element;
|
@@ -854,16 +580,16 @@ let DateRangePickerInputStartDirective = class DateRangePickerInputStartDirectiv
|
|
854
580
|
this.selectionModel = selectionModel;
|
855
581
|
this.trigger = trigger;
|
856
582
|
this.updateSelection = () => {
|
857
|
-
let
|
858
|
-
this.selectionModel.updateSelection(new DateRange(
|
583
|
+
let end = this.parseCurrentValue();
|
584
|
+
this.selectionModel.updateSelection(new DateRange(this.selectionModel.selection.start, end), this);
|
859
585
|
};
|
860
586
|
this.handleSelectionChange();
|
861
587
|
}
|
862
588
|
validate() {
|
863
589
|
const defaultErrors = super.validate();
|
864
|
-
if (
|
865
|
-
const
|
866
|
-
if (
|
590
|
+
if (isValid(this.selectionModel.selection.start)) {
|
591
|
+
const endDate = this.parseCurrentValue();
|
592
|
+
if (endDate && isAfter(this.selectionModel.selection.start, endDate)) {
|
867
593
|
return { [WlcmDateRangeValidation.StartExceedsEnd]: true, ...(defaultErrors ?? {}) };
|
868
594
|
}
|
869
595
|
}
|
@@ -871,41 +597,41 @@ let DateRangePickerInputStartDirective = class DateRangePickerInputStartDirectiv
|
|
871
597
|
}
|
872
598
|
handleSelectionChange() {
|
873
599
|
this.selectionModel.selectionChanged.pipe(untilDestroyed(this)).subscribe(({ selection }) => {
|
874
|
-
const validDate = this.dateAdapter.getValidDateOrNull(selection.
|
600
|
+
const validDate = this.dateAdapter.getValidDateOrNull(selection.end);
|
875
601
|
this._changed?.(validDate);
|
876
602
|
this.updateInputValue(validDate);
|
877
603
|
this._validatorChanged?.();
|
878
604
|
});
|
879
605
|
}
|
880
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
881
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
882
|
-
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() =>
|
883
|
-
{ provide: NG_VALIDATORS, useExisting: forwardRef(() =>
|
606
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", 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 }); }
|
607
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: DateRangePickerInputEndDirective, isStandalone: true, selector: "[wlcmDateRangePickerInputEnd]", host: { classAttribute: "wlcm-date-range-picker-input-field" }, providers: [
|
608
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
|
609
|
+
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
|
884
610
|
], usesInheritance: true, ngImport: i0 }); }
|
885
611
|
};
|
886
|
-
|
612
|
+
DateRangePickerInputEndDirective = __decorate([
|
887
613
|
UntilDestroy(),
|
888
614
|
__metadata("design:paramtypes", [ElementRef,
|
889
615
|
DateAdapter, Object, MatDateSelectionModel,
|
890
616
|
WlcmDatepickerTrigger])
|
891
|
-
],
|
892
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
617
|
+
], DateRangePickerInputEndDirective);
|
618
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: DateRangePickerInputEndDirective, decorators: [{
|
893
619
|
type: Directive,
|
894
620
|
args: [{
|
895
|
-
selector: '[
|
621
|
+
selector: '[wlcmDateRangePickerInputEnd]',
|
896
622
|
host: { class: 'wlcm-date-range-picker-input-field' },
|
897
623
|
standalone: true,
|
898
624
|
providers: [
|
899
|
-
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() =>
|
900
|
-
{ provide: NG_VALIDATORS, useExisting: forwardRef(() =>
|
625
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
|
626
|
+
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => DateRangePickerInputEndDirective), multi: true },
|
901
627
|
],
|
902
628
|
}]
|
903
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter }, { type: undefined, decorators: [{
|
629
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: undefined, decorators: [{
|
904
630
|
type: Optional
|
905
631
|
}, {
|
906
632
|
type: Inject,
|
907
633
|
args: [MAT_DATE_FORMATS]
|
908
|
-
}] }, { type: i2
|
634
|
+
}] }, { type: i2.MatDateSelectionModel, decorators: [{
|
909
635
|
type: Inject,
|
910
636
|
args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
|
911
637
|
}] }, { type: WlcmDatepickerTrigger }] });
|
@@ -931,7 +657,7 @@ class WlcmDateRangePickerInputComponent extends WlcmDatepickerTrigger {
|
|
931
657
|
this._blurStream$ = new BehaviorSubject(EMPTY);
|
932
658
|
this.focus$ = this._focusStream$.pipe(switchMap((stream) => stream));
|
933
659
|
this.blur$ = this._blurStream$.pipe(switchMap((stream) => stream));
|
934
|
-
this.componentType =
|
660
|
+
this.componentType = SingleCalendarRangePickerComponent;
|
935
661
|
}
|
936
662
|
ngAfterContentInit() {
|
937
663
|
this.checkInputs();
|
@@ -977,8 +703,8 @@ class WlcmDateRangePickerInputComponent extends WlcmDatepickerTrigger {
|
|
977
703
|
this._focusStream$.next(merge(...focusObservables).pipe(map(voidFn)));
|
978
704
|
this._blurStream$.next(merge(...blurObservables).pipe(map(() => this.control?.markAsTouched())));
|
979
705
|
}
|
980
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
981
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
706
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", 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 }); }
|
707
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: WlcmDateRangePickerInputComponent, isStandalone: true, selector: "wlcm-date-range-picker-input", inputs: { componentType: "componentType" }, host: { classAttribute: "wlcm-date-range-picker-input" }, providers: [
|
982
708
|
WLCM_FORM_CONTROL_PROVIDER,
|
983
709
|
WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL_PROVIDER,
|
984
710
|
{
|
@@ -991,7 +717,7 @@ class WlcmDateRangePickerInputComponent extends WlcmDatepickerTrigger {
|
|
991
717
|
{ provide: WlcmDatepickerTrigger, useExisting: forwardRef(() => WlcmDateRangePickerInputComponent) },
|
992
718
|
], queries: [{ propertyName: "startInput", first: true, predicate: DateRangePickerInputStartDirective, descendants: true }, { propertyName: "endInput", first: true, predicate: DateRangePickerInputEndDirective, descendants: true }], exportAs: ["wlcmDateRangePickerInput"], usesInheritance: true, ngImport: i0, 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"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: WlcmFormsModule }] }); }
|
993
719
|
}
|
994
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
720
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDateRangePickerInputComponent, decorators: [{
|
995
721
|
type: Component,
|
996
722
|
args: [{ selector: 'wlcm-date-range-picker-input', host: { class: 'wlcm-date-range-picker-input' }, exportAs: 'wlcmDateRangePickerInput', standalone: true, imports: [CommonModule, WlcmFormsModule, DateRangePickerInputStartDirective, DateRangePickerInputEndDirective], providers: [
|
997
723
|
WLCM_FORM_CONTROL_PROVIDER,
|
@@ -1005,7 +731,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
1005
731
|
},
|
1006
732
|
{ provide: WlcmDatepickerTrigger, useExisting: forwardRef(() => WlcmDateRangePickerInputComponent) },
|
1007
733
|
], 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
|
734
|
+
}], ctorParameters: () => [{ type: i1.Overlay }, { type: i0.ViewContainerRef }, { type: i2.MatDateSelectionModel, decorators: [{
|
1009
735
|
type: Inject,
|
1010
736
|
args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
|
1011
737
|
}] }, { type: undefined, decorators: [{
|
@@ -1018,7 +744,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
1018
744
|
}, {
|
1019
745
|
type: Inject,
|
1020
746
|
args: [ControlContainer]
|
1021
|
-
}] }], propDecorators: {
|
747
|
+
}] }], propDecorators: { componentType: [{
|
748
|
+
type: Input
|
749
|
+
}], startInput: [{
|
1022
750
|
type: ContentChild,
|
1023
751
|
args: [DateRangePickerInputStartDirective]
|
1024
752
|
}], endInput: [{
|
@@ -1026,6 +754,374 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
1026
754
|
args: [DateRangePickerInputEndDirective]
|
1027
755
|
}] } });
|
1028
756
|
|
757
|
+
class WlcmDataRangeCalendar {
|
758
|
+
constructor(location, element, calendar, dateAdapter, datepickerConfig) {
|
759
|
+
this.element = element;
|
760
|
+
this.calendar = calendar;
|
761
|
+
this.dateAdapter = dateAdapter;
|
762
|
+
this.datepickerConfig = datepickerConfig;
|
763
|
+
this.dateChange = output();
|
764
|
+
this.viewChange = output();
|
765
|
+
this.disabled = input(false);
|
766
|
+
this.location = location;
|
767
|
+
effect(() => {
|
768
|
+
if (this.disabled()) {
|
769
|
+
this.element.nativeElement.classList.add('wlcm-calendar-disabled');
|
770
|
+
}
|
771
|
+
else {
|
772
|
+
this.element.nativeElement.classList.remove('wlcm-calendar-disabled');
|
773
|
+
}
|
774
|
+
});
|
775
|
+
this.handleConfigValues();
|
776
|
+
}
|
777
|
+
get minDate() {
|
778
|
+
return this.datepickerConfig.minDate?.();
|
779
|
+
}
|
780
|
+
get maxDate() {
|
781
|
+
return this.datepickerConfig.maxDate?.();
|
782
|
+
}
|
783
|
+
prevMonth() {
|
784
|
+
this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.calendar.activeDate, -1));
|
785
|
+
}
|
786
|
+
nextMonth() {
|
787
|
+
this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.calendar.activeDate, 1));
|
788
|
+
}
|
789
|
+
prevYear() {
|
790
|
+
this.dateChange.emit(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage));
|
791
|
+
}
|
792
|
+
nextYear() {
|
793
|
+
this.dateChange.emit(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage));
|
794
|
+
}
|
795
|
+
handleConfigValues() {
|
796
|
+
this.calendar.dateFilter = (date) => {
|
797
|
+
if (this.minDate && isBefore(startOfDay(date), startOfDay(this.minDate)))
|
798
|
+
return false;
|
799
|
+
if (this.maxDate && isAfter(startOfDay(date), startOfDay(this.maxDate)))
|
800
|
+
return false;
|
801
|
+
return true;
|
802
|
+
};
|
803
|
+
}
|
804
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDataRangeCalendar, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
|
805
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.6", type: WlcmDataRangeCalendar, inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateChange: "dateChange", viewChange: "viewChange" }, ngImport: i0 }); }
|
806
|
+
}
|
807
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDataRangeCalendar, decorators: [{
|
808
|
+
type: Directive
|
809
|
+
}], ctorParameters: () => [{ type: undefined }, { type: i0.ElementRef }, { type: i2.MatCalendar }, { type: i1$1.DateAdapter }, { type: undefined }] });
|
810
|
+
|
811
|
+
let WlcmLeftCalendarDirective = class WlcmLeftCalendarDirective extends WlcmDataRangeCalendar {
|
812
|
+
constructor(element, dateAdapter, calendar, datepickerConfig) {
|
813
|
+
super('left', element, calendar, dateAdapter, datepickerConfig);
|
814
|
+
this.element = element;
|
815
|
+
this.dateAdapter = dateAdapter;
|
816
|
+
this.calendar = calendar;
|
817
|
+
this.datepickerConfig = datepickerConfig;
|
818
|
+
this.handleYearChange();
|
819
|
+
this.handleMonthChange();
|
820
|
+
}
|
821
|
+
handleYearChange() {
|
822
|
+
this.calendar.yearSelected.pipe(untilDestroyed(this)).subscribe((date) => this.dateChange.emit(date));
|
823
|
+
}
|
824
|
+
handleMonthChange() {
|
825
|
+
this.calendar.monthSelected.pipe(untilDestroyed(this)).subscribe((date) => this.dateChange.emit(date));
|
826
|
+
}
|
827
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmLeftCalendarDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.DateAdapter }, { token: forwardRef(() => MatCalendar) }, { token: WLCM_DATEPICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Directive }); }
|
828
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: WlcmLeftCalendarDirective, isStandalone: true, selector: "[wlcmLeftCalendar]", providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmLeftCalendarDirective) }], usesInheritance: true, ngImport: i0 }); }
|
829
|
+
};
|
830
|
+
WlcmLeftCalendarDirective = __decorate([
|
831
|
+
UntilDestroy(),
|
832
|
+
__metadata("design:paramtypes", [ElementRef,
|
833
|
+
DateAdapter,
|
834
|
+
MatCalendar, Object])
|
835
|
+
], WlcmLeftCalendarDirective);
|
836
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmLeftCalendarDirective, decorators: [{
|
837
|
+
type: Directive,
|
838
|
+
args: [{
|
839
|
+
selector: '[wlcmLeftCalendar]',
|
840
|
+
standalone: true,
|
841
|
+
providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmLeftCalendarDirective) }],
|
842
|
+
}]
|
843
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: i2.MatCalendar, decorators: [{
|
844
|
+
type: Inject,
|
845
|
+
args: [forwardRef(() => MatCalendar)]
|
846
|
+
}] }, { type: undefined, decorators: [{
|
847
|
+
type: Inject,
|
848
|
+
args: [WLCM_DATEPICKER_CONFIG]
|
849
|
+
}] }] });
|
850
|
+
|
851
|
+
let WlcmRightCalendarDirective = class WlcmRightCalendarDirective extends WlcmDataRangeCalendar {
|
852
|
+
constructor(element, dateAdapter, calendar, datepickerConfig) {
|
853
|
+
super('right', element, calendar, dateAdapter, datepickerConfig);
|
854
|
+
this.element = element;
|
855
|
+
this.dateAdapter = dateAdapter;
|
856
|
+
this.calendar = calendar;
|
857
|
+
this.datepickerConfig = datepickerConfig;
|
858
|
+
this.handleYearChange();
|
859
|
+
this.handleMonthChange();
|
860
|
+
}
|
861
|
+
handleYearChange() {
|
862
|
+
this.calendar.yearSelected
|
863
|
+
.pipe(untilDestroyed(this))
|
864
|
+
.subscribe((date) => this.dateChange.emit(this.dateAdapter.addCalendarMonths(date, -1)));
|
865
|
+
}
|
866
|
+
handleMonthChange() {
|
867
|
+
this.calendar.monthSelected
|
868
|
+
.pipe(untilDestroyed(this))
|
869
|
+
.subscribe((date) => this.dateChange.emit(this.dateAdapter.addCalendarMonths(date, -1)));
|
870
|
+
}
|
871
|
+
nextMonth() {
|
872
|
+
this.dateChange.emit(this.calendar.activeDate);
|
873
|
+
}
|
874
|
+
prevYear() {
|
875
|
+
this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage), -1));
|
876
|
+
}
|
877
|
+
nextYear() {
|
878
|
+
this.dateChange.emit(this.dateAdapter.addCalendarMonths(this.dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage), -1));
|
879
|
+
}
|
880
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmRightCalendarDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.DateAdapter }, { token: forwardRef(() => MatCalendar) }, { token: WLCM_DATEPICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Directive }); }
|
881
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: WlcmRightCalendarDirective, isStandalone: true, selector: "[wlcmRightCalendar]", providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmRightCalendarDirective) }], usesInheritance: true, ngImport: i0 }); }
|
882
|
+
};
|
883
|
+
WlcmRightCalendarDirective = __decorate([
|
884
|
+
UntilDestroy(),
|
885
|
+
__metadata("design:paramtypes", [ElementRef,
|
886
|
+
DateAdapter,
|
887
|
+
MatCalendar, Object])
|
888
|
+
], WlcmRightCalendarDirective);
|
889
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmRightCalendarDirective, decorators: [{
|
890
|
+
type: Directive,
|
891
|
+
args: [{
|
892
|
+
selector: '[wlcmRightCalendar]',
|
893
|
+
standalone: true,
|
894
|
+
providers: [{ provide: WlcmDataRangeCalendar, useExisting: forwardRef(() => WlcmRightCalendarDirective) }],
|
895
|
+
}]
|
896
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: i2.MatCalendar, decorators: [{
|
897
|
+
type: Inject,
|
898
|
+
args: [forwardRef(() => MatCalendar)]
|
899
|
+
}] }, { type: undefined, decorators: [{
|
900
|
+
type: Inject,
|
901
|
+
args: [WLCM_DATEPICKER_CONFIG]
|
902
|
+
}] }] });
|
903
|
+
|
904
|
+
class WlcmDateRangeCalendarHeaderComponent {
|
905
|
+
constructor(rangeCalendar, dateFormats, calendar, datepickerConfig) {
|
906
|
+
this.rangeCalendar = rangeCalendar;
|
907
|
+
this.dateFormats = dateFormats;
|
908
|
+
this.calendar = calendar;
|
909
|
+
this.datepickerConfig = datepickerConfig;
|
910
|
+
this.WlcmIconName = WlcmIconName;
|
911
|
+
this.previous = () => {
|
912
|
+
if (this.isPreviousDisabled)
|
913
|
+
return;
|
914
|
+
if (this.calendar.currentView !== 'month') {
|
915
|
+
return this.rangeCalendar.prevYear();
|
916
|
+
}
|
917
|
+
return this.rangeCalendar.prevMonth();
|
918
|
+
};
|
919
|
+
this.next = () => {
|
920
|
+
if (this.isNextDisabled)
|
921
|
+
return;
|
922
|
+
if (this.calendar.currentView !== 'month') {
|
923
|
+
return this.rangeCalendar.nextYear();
|
924
|
+
}
|
925
|
+
return this.rangeCalendar.nextMonth();
|
926
|
+
};
|
927
|
+
}
|
928
|
+
get minDate() {
|
929
|
+
return this.datepickerConfig.minDate?.();
|
930
|
+
}
|
931
|
+
get maxDate() {
|
932
|
+
return this.datepickerConfig.maxDate?.();
|
933
|
+
}
|
934
|
+
get isPreviousDisabled() {
|
935
|
+
if (!this.minDate)
|
936
|
+
return false;
|
937
|
+
let previousPeriod = endOfMonth(add(this.calendar.activeDate, { months: -1 }));
|
938
|
+
if (this.calendar.currentView !== 'month') {
|
939
|
+
previousPeriod = add(this.calendar.activeDate, { years: -1 });
|
940
|
+
}
|
941
|
+
return isBefore(previousPeriod, this.minDate);
|
942
|
+
}
|
943
|
+
get isNextDisabled() {
|
944
|
+
if (!this.maxDate)
|
945
|
+
return false;
|
946
|
+
let nextPeriod = startOfMonth(add(this.calendar.activeDate, { months: 1 }));
|
947
|
+
if (this.calendar.currentView !== 'month') {
|
948
|
+
nextPeriod = add(this.calendar.activeDate, { years: 1 });
|
949
|
+
}
|
950
|
+
return isBefore(this.maxDate, nextPeriod);
|
951
|
+
}
|
952
|
+
get canDisplayLeftArrow() {
|
953
|
+
return !this.rangeCalendar || this.rangeCalendar.location === 'left' || this.calendar.currentView !== 'month';
|
954
|
+
}
|
955
|
+
get canDisplayRightArrow() {
|
956
|
+
return !this.rangeCalendar || this.rangeCalendar.location === 'right' || this.calendar.currentView !== 'month';
|
957
|
+
}
|
958
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", 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 }); }
|
959
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", 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"] }] }); }
|
960
|
+
}
|
961
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDateRangeCalendarHeaderComponent, decorators: [{
|
962
|
+
type: Component,
|
963
|
+
args: [{ selector: 'wlcm-date-range-calendar-header', standalone: true, imports: [CommonModule, WlcmCalendarHeaderComponent, WlcmIconDirective], 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" }]
|
964
|
+
}], ctorParameters: () => [{ type: WlcmDataRangeCalendar, decorators: [{
|
965
|
+
type: Optional
|
966
|
+
}] }, { type: undefined, decorators: [{
|
967
|
+
type: Optional
|
968
|
+
}, {
|
969
|
+
type: Inject,
|
970
|
+
args: [MAT_DATE_FORMATS]
|
971
|
+
}] }, { type: i2.MatCalendar, decorators: [{
|
972
|
+
type: Inject,
|
973
|
+
args: [forwardRef(() => MatCalendar)]
|
974
|
+
}] }, { type: undefined, decorators: [{
|
975
|
+
type: Inject,
|
976
|
+
args: [WLCM_DATEPICKER_CONFIG]
|
977
|
+
}] }] });
|
978
|
+
|
979
|
+
let DoubleCalendarRangePickerComponent = class DoubleCalendarRangePickerComponent extends WlcmDateRangePicker {
|
980
|
+
constructor(rangeConfig, rangeSelectionStrategy, localSelectionModel, triggerSelectionModel, trigger, datepickerConfig, pickerBottomPanel, dateAdapter) {
|
981
|
+
super(localSelectionModel, rangeSelectionStrategy);
|
982
|
+
this.rangeConfig = rangeConfig;
|
983
|
+
this.rangeSelectionStrategy = rangeSelectionStrategy;
|
984
|
+
this.localSelectionModel = localSelectionModel;
|
985
|
+
this.triggerSelectionModel = triggerSelectionModel;
|
986
|
+
this.trigger = trigger;
|
987
|
+
this.datepickerConfig = datepickerConfig;
|
988
|
+
this.pickerBottomPanel = pickerBottomPanel;
|
989
|
+
this.dateAdapter = dateAdapter;
|
990
|
+
this.headerComponent = WlcmDateRangeCalendarHeaderComponent;
|
991
|
+
this._isViewInitialized = signal(false);
|
992
|
+
this.startDate = signal(new Date());
|
993
|
+
this.leftCalendarYearViewActivated = signal(false);
|
994
|
+
this.rightCalendarYearViewActivated = signal(false);
|
995
|
+
this.localSelectionModel.updateSelection(this.triggerSelectionModel.selection, this);
|
996
|
+
if (this.triggerSelectionModel.selection.start) {
|
997
|
+
this.startDate.set(this.triggerSelectionModel.selection.start);
|
998
|
+
}
|
999
|
+
if (this.rangeConfig.headerComponent) {
|
1000
|
+
this.headerComponent = this.rangeConfig.headerComponent;
|
1001
|
+
}
|
1002
|
+
effect(() => {
|
1003
|
+
if (!this._isViewInitialized())
|
1004
|
+
return;
|
1005
|
+
const startDate = this.startDate();
|
1006
|
+
this.leftCalendar.activeDate = startDate;
|
1007
|
+
this.rightCalendar.activeDate = this.dateAdapter.addCalendarMonths(startDate, 1);
|
1008
|
+
this.rightCalendar.startAt = this.rightCalendar.activeDate;
|
1009
|
+
});
|
1010
|
+
}
|
1011
|
+
ngAfterViewInit() {
|
1012
|
+
this._isViewInitialized.set(true);
|
1013
|
+
this.leftCalendar.viewChanged.pipe(untilDestroyed(this)).subscribe((view) => {
|
1014
|
+
this.leftCalendarYearViewActivated.set(view !== 'month');
|
1015
|
+
});
|
1016
|
+
this.rightCalendar.viewChanged.pipe(untilDestroyed(this)).subscribe((view) => {
|
1017
|
+
this.rightCalendarYearViewActivated.set(view !== 'month');
|
1018
|
+
});
|
1019
|
+
this.bottomPanelContainer.createComponent(this.pickerBottomPanel);
|
1020
|
+
this.handleRightCalendarPreviewChange();
|
1021
|
+
}
|
1022
|
+
apply() {
|
1023
|
+
this.triggerSelectionModel.updateSelection(this.localSelectionModel.selection, this);
|
1024
|
+
this.trigger.close();
|
1025
|
+
}
|
1026
|
+
reset() {
|
1027
|
+
this.trigger.close();
|
1028
|
+
}
|
1029
|
+
get leftCalendarActiveCell() {
|
1030
|
+
return this.leftCalendarElement.nativeElement.querySelector('.mat-calendar-body-active');
|
1031
|
+
}
|
1032
|
+
handleRightCalendarPreviewChange() {
|
1033
|
+
const viewChanged = new Subject();
|
1034
|
+
this.rightCalendar.viewChanged
|
1035
|
+
.pipe(untilDestroyed(this))
|
1036
|
+
.pipe(tap(() => viewChanged.next()))
|
1037
|
+
.pipe(startWith(this.rightCalendar.currentView))
|
1038
|
+
.subscribe((view) => {
|
1039
|
+
if (view !== 'month')
|
1040
|
+
return;
|
1041
|
+
this.rightCalendar.monthView._matCalendarBody.previewChange
|
1042
|
+
.pipe(takeUntil(viewChanged), untilDestroyed(this))
|
1043
|
+
.subscribe(() => {
|
1044
|
+
if (this.leftCalendar.currentView !== 'month' || !this.leftCalendar.monthView._rangeStart)
|
1045
|
+
return;
|
1046
|
+
this.leftCalendar.monthView._previewStart = this.rightCalendar.monthView._previewStart;
|
1047
|
+
this.leftCalendar.monthView._previewEnd = this.rightCalendar.monthView._previewEnd;
|
1048
|
+
const activeCell = this.leftCalendarActiveCell;
|
1049
|
+
if (activeCell && activeCell === document.activeElement)
|
1050
|
+
activeCell.blur();
|
1051
|
+
this.leftCalendar.monthView._changeDetectorRef.markForCheck();
|
1052
|
+
});
|
1053
|
+
});
|
1054
|
+
}
|
1055
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", 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: WLCM_DATE_RANGE_PICKER_BP }, { token: i1$1.DateAdapter }], target: i0.ɵɵFactoryTarget.Component }); }
|
1056
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: DoubleCalendarRangePickerComponent, isStandalone: true, selector: "wlcm-double-calendar-range-picker", providers: [
|
1057
|
+
{
|
1058
|
+
provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
|
1059
|
+
useClass: DefaultMatCalendarRangeStrategy,
|
1060
|
+
},
|
1061
|
+
{ provide: WlcmDateRangePicker, useExisting: forwardRef(() => DoubleCalendarRangePickerComponent) },
|
1062
|
+
WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER,
|
1063
|
+
], 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: "bottomPanelContainer", first: true, predicate: ["bottomPanelContainer"], descendants: true, read: ViewContainerRef }, { 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 <ng-container #bottomPanelContainer></ng-container>\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]" }] }); }
|
1064
|
+
};
|
1065
|
+
DoubleCalendarRangePickerComponent = __decorate([
|
1066
|
+
UntilDestroy(),
|
1067
|
+
__metadata("design:paramtypes", [Object, Object, MatDateSelectionModel,
|
1068
|
+
MatDateSelectionModel,
|
1069
|
+
WlcmDatepickerTrigger, Object, Type,
|
1070
|
+
DateAdapter])
|
1071
|
+
], DoubleCalendarRangePickerComponent);
|
1072
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: DoubleCalendarRangePickerComponent, decorators: [{
|
1073
|
+
type: Component,
|
1074
|
+
args: [{ selector: 'wlcm-double-calendar-range-picker', imports: [
|
1075
|
+
CommonModule,
|
1076
|
+
MatDatepickerModule,
|
1077
|
+
WlcmCalendarDirective,
|
1078
|
+
WlcmLeftCalendarDirective,
|
1079
|
+
WlcmRightCalendarDirective,
|
1080
|
+
], standalone: true, providers: [
|
1081
|
+
{
|
1082
|
+
provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
|
1083
|
+
useClass: DefaultMatCalendarRangeStrategy,
|
1084
|
+
},
|
1085
|
+
{ provide: WlcmDateRangePicker, useExisting: forwardRef(() => DoubleCalendarRangePickerComponent) },
|
1086
|
+
WLCM_DATE_RANGE_SELECTION_MODEL_PROVIDER,
|
1087
|
+
], 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 <ng-container #bottomPanelContainer></ng-container>\n</div>\n" }]
|
1088
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
1089
|
+
type: Optional
|
1090
|
+
}, {
|
1091
|
+
type: Inject,
|
1092
|
+
args: [WLCM_DATE_RANGE_PICKER_CONFIG]
|
1093
|
+
}] }, { type: undefined, decorators: [{
|
1094
|
+
type: Inject,
|
1095
|
+
args: [MAT_DATE_RANGE_SELECTION_STRATEGY]
|
1096
|
+
}] }, { type: i2.MatDateSelectionModel, decorators: [{
|
1097
|
+
type: Inject,
|
1098
|
+
args: [WLCM_DATE_RANGE_SELECTION_MODEL]
|
1099
|
+
}] }, { type: i2.MatDateSelectionModel, decorators: [{
|
1100
|
+
type: Inject,
|
1101
|
+
args: [WLCM_DATE_RANGE_TRIGGER_SELECTION_MODEL]
|
1102
|
+
}] }, { type: WlcmDatepickerTrigger }, { type: undefined, decorators: [{
|
1103
|
+
type: Inject,
|
1104
|
+
args: [WLCM_DATEPICKER_CONFIG]
|
1105
|
+
}] }, { type: i0.Type, decorators: [{
|
1106
|
+
type: Inject,
|
1107
|
+
args: [WLCM_DATE_RANGE_PICKER_BP]
|
1108
|
+
}] }, { type: i1$1.DateAdapter }], propDecorators: { leftCalendar: [{
|
1109
|
+
type: ViewChild,
|
1110
|
+
args: [WlcmLeftCalendarDirective, { read: MatCalendar }]
|
1111
|
+
}], rightCalendar: [{
|
1112
|
+
type: ViewChild,
|
1113
|
+
args: [WlcmRightCalendarDirective, { read: MatCalendar }]
|
1114
|
+
}], leftCalendarElement: [{
|
1115
|
+
type: ViewChild,
|
1116
|
+
args: [WlcmLeftCalendarDirective, { read: ElementRef }]
|
1117
|
+
}], bottomPanelContainer: [{
|
1118
|
+
type: ViewChild,
|
1119
|
+
args: ['bottomPanelContainer', { read: ViewContainerRef }]
|
1120
|
+
}], monthView: [{
|
1121
|
+
type: ViewChild,
|
1122
|
+
args: [MatMonthView]
|
1123
|
+
}] } });
|
1124
|
+
|
1029
1125
|
let WlcmDatepickerInputDirective = class WlcmDatepickerInputDirective extends WlcmDatepickerInputBase {
|
1030
1126
|
constructor(element, dateAdapter, dateFormats, selectionModel, trigger) {
|
1031
1127
|
super(element, dateAdapter, dateFormats, trigger);
|
@@ -1051,8 +1147,8 @@ let WlcmDatepickerInputDirective = class WlcmDatepickerInputDirective extends Wl
|
|
1051
1147
|
this._touched?.();
|
1052
1148
|
});
|
1053
1149
|
}
|
1054
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1055
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
1150
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", 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 }); }
|
1151
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: WlcmDatepickerInputDirective, isStandalone: true, selector: "[wlcmDatepickerInput]", host: { classAttribute: "wlcm-form-field-input" }, providers: [
|
1056
1152
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmDatepickerInputDirective), multi: true },
|
1057
1153
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmDatepickerInputDirective), multi: true },
|
1058
1154
|
], exportAs: ["wlcmDatepickerInput"], usesInheritance: true, ngImport: i0 }); }
|
@@ -1063,7 +1159,7 @@ WlcmDatepickerInputDirective = __decorate([
|
|
1063
1159
|
DateAdapter, Object, MatDateSelectionModel,
|
1064
1160
|
WlcmDatepickerTrigger])
|
1065
1161
|
], WlcmDatepickerInputDirective);
|
1066
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerInputDirective, decorators: [{
|
1067
1163
|
type: Directive,
|
1068
1164
|
args: [{
|
1069
1165
|
selector: '[wlcmDatepickerInput]',
|
@@ -1075,10 +1171,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
1075
1171
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmDatepickerInputDirective), multi: true },
|
1076
1172
|
],
|
1077
1173
|
}]
|
1078
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter }, { type: undefined, decorators: [{
|
1174
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.DateAdapter }, { type: undefined, decorators: [{
|
1079
1175
|
type: Inject,
|
1080
1176
|
args: [MAT_DATE_FORMATS]
|
1081
|
-
}] }, { type: i2
|
1177
|
+
}] }, { type: i2.MatDateSelectionModel }, { type: WlcmDatepickerTrigger }] });
|
1082
1178
|
|
1083
1179
|
class WlcmDatepickerPanelComponent {
|
1084
1180
|
constructor(selectionModel, trigger, config) {
|
@@ -1092,13 +1188,13 @@ class WlcmDatepickerPanelComponent {
|
|
1092
1188
|
this.selectionModel.updateSelection(date, this);
|
1093
1189
|
this.trigger.close();
|
1094
1190
|
}
|
1095
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1096
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
1191
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerPanelComponent, deps: [{ token: i2.MatDateSelectionModel }, { token: WlcmDatepickerTrigger }, { token: WLCM_DATEPICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
|
1192
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.6", 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
1193
|
}
|
1098
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerPanelComponent, decorators: [{
|
1099
1195
|
type: Component,
|
1100
1196
|
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
|
1197
|
+
}], ctorParameters: () => [{ type: i2.MatDateSelectionModel }, { type: WlcmDatepickerTrigger }, { type: undefined, decorators: [{
|
1102
1198
|
type: Inject,
|
1103
1199
|
args: [WLCM_DATEPICKER_CONFIG]
|
1104
1200
|
}] }] });
|
@@ -1145,8 +1241,8 @@ class WlcmDatepickerInputContainerComponent extends WlcmDatepickerTrigger {
|
|
1145
1241
|
this._focusStream$.next(merge(...focusObservables).pipe(map(voidFn)));
|
1146
1242
|
this._blurStream$.next(merge(...blurObservables).pipe(map(voidFn)));
|
1147
1243
|
}
|
1148
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1149
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
1244
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerInputContainerComponent, deps: [{ token: i1.Overlay }, { token: i0.ViewContainerRef }, { token: i2.MatDateSelectionModel }, { token: WLCM_FORM_FIELD, host: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
1245
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.6", type: WlcmDatepickerInputContainerComponent, isStandalone: true, selector: "wlcm-datepicker-input-container", host: { classAttribute: "wlcm-datepicker-input-container" }, providers: [
|
1150
1246
|
{
|
1151
1247
|
provide: WLCM_INPUT_BINDER,
|
1152
1248
|
useFactory: () => {
|
@@ -1160,7 +1256,7 @@ class WlcmDatepickerInputContainerComponent extends WlcmDatepickerTrigger {
|
|
1160
1256
|
{ provide: MatDateSelectionModel, useClass: MatSingleDateSelectionModel },
|
1161
1257
|
], queries: [{ propertyName: "inputRef", first: true, predicate: WlcmDatepickerInputDirective, descendants: true, read: ElementRef, isSignal: true }], exportAs: ["wlcmDatepicker"], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"[wlcmDatepickerInput]\"></ng-content>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
|
1162
1258
|
}
|
1163
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerInputContainerComponent, decorators: [{
|
1164
1260
|
type: Component,
|
1165
1261
|
args: [{ selector: 'wlcm-datepicker-input-container', host: { class: 'wlcm-datepicker-input-container' }, exportAs: 'wlcmDatepicker', standalone: true, imports: [CommonModule], providers: [
|
1166
1262
|
{
|
@@ -1175,7 +1271,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
1175
1271
|
{ provide: WlcmDatepickerTrigger, useExisting: forwardRef(() => WlcmDatepickerInputContainerComponent) },
|
1176
1272
|
{ provide: MatDateSelectionModel, useClass: MatSingleDateSelectionModel },
|
1177
1273
|
], template: "<ng-content select=\"[wlcmDatepickerInput]\"></ng-content>\n" }]
|
1178
|
-
}], ctorParameters: () => [{ type: i1
|
1274
|
+
}], ctorParameters: () => [{ type: i1.Overlay }, { type: i0.ViewContainerRef }, { type: i2.MatDateSelectionModel }, { type: undefined, decorators: [{
|
1179
1275
|
type: Host
|
1180
1276
|
}, {
|
1181
1277
|
type: Inject,
|
@@ -1204,15 +1300,15 @@ const publicDirectives = [
|
|
1204
1300
|
DateRangePickerInputEndDirective,
|
1205
1301
|
];
|
1206
1302
|
class WlcmDatepickerModule {
|
1207
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1208
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
1303
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1304
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerModule, imports: [CommonModule, WlcmDatepickerInputContainerComponent, WlcmDateRangePickerInputComponent, WlcmDatepickerInputDirective,
|
1209
1305
|
DateRangePickerInputStartDirective,
|
1210
1306
|
DateRangePickerInputEndDirective], exports: [WlcmDatepickerInputContainerComponent, WlcmDateRangePickerInputComponent, WlcmDatepickerInputDirective,
|
1211
1307
|
DateRangePickerInputStartDirective,
|
1212
1308
|
DateRangePickerInputEndDirective] }); }
|
1213
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
1309
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerModule, providers: [...WLCM_DEFAULT_DATEPICKER_PROVIDERS], imports: [CommonModule, publicComponents] }); }
|
1214
1310
|
}
|
1215
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1311
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: WlcmDatepickerModule, decorators: [{
|
1216
1312
|
type: NgModule,
|
1217
1313
|
args: [{
|
1218
1314
|
imports: [CommonModule, ...publicComponents, ...publicDirectives],
|
@@ -1225,5 +1321,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
1225
1321
|
* Generated bundle index. Do not edit.
|
1226
1322
|
*/
|
1227
1323
|
|
1228
|
-
export { DateRangePickerInputEndDirective, DateRangePickerInputStartDirective, WLCM_DATEPICKER_CONFIG, WlcmDateRangeInputValidator, WlcmDateRangePickerInputComponent, WlcmDateRangeValidation, WlcmDateValidation, WlcmDatepickerInputContainerComponent, WlcmDatepickerInputDirective, WlcmDatepickerModule };
|
1324
|
+
export { DateRangePickerInputEndDirective, DateRangePickerInputStartDirective, DoubleCalendarRangePickerComponent, SingleCalendarRangePickerComponent, WLCM_DATEPICKER_CONFIG, WlcmDateRangeInputValidator, WlcmDateRangePicker, WlcmDateRangePickerInputComponent, WlcmDateRangeValidation, WlcmDateValidation, WlcmDatepickerInputContainerComponent, WlcmDatepickerInputDirective, WlcmDatepickerModule };
|
1229
1325
|
//# sourceMappingURL=wlcm-angular-datepicker.mjs.map
|