mis-crystal-design-system 18.0.24 → 18.1.0-signal-test
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/action-list/action-list.component.d.ts +17 -15
- package/async-search-dropdown/async-dropdown.component.d.ts +43 -61
- package/button/button.component.d.ts +35 -13
- package/button/button.directive.d.ts +10 -8
- package/checkbox/checkbox.component.d.ts +15 -12
- package/chip/chip.component.d.ts +9 -11
- package/datepicker_v2/models/dp-config.model.d.ts +1 -0
- package/datepicker_v2/tz-datepicker.directive.d.ts +15 -18
- package/datepicker_v2/tz-dp-container/tz-dp-container.component.d.ts +42 -21
- package/daterangepicker_v2/tz-daterangepicker.directive.d.ts +12 -14
- package/daterangepicker_v2/tz-drp-container/tz-drp-container.component.d.ts +46 -23
- package/drawer/drawer-body/drawer-body.component.d.ts +2 -2
- package/dropdown/calculate-container-height.directive.d.ts +7 -8
- package/dropdown/dropdown.component.d.ts +41 -49
- package/dynamic-form/dynamic-form.component.d.ts +20 -16
- package/esm2022/action-list/action-list.component.mjs +112 -89
- package/esm2022/async-search-dropdown/async-dropdown.component.mjs +256 -326
- package/esm2022/button/button.component.mjs +55 -48
- package/esm2022/button/button.directive.mjs +36 -40
- package/esm2022/checkbox/checkbox.component.mjs +75 -70
- package/esm2022/chip/chip.component.mjs +20 -33
- package/esm2022/datepicker_v2/models/dp-config.model.mjs +1 -1
- package/esm2022/datepicker_v2/tz-datepicker.directive.mjs +42 -71
- package/esm2022/datepicker_v2/tz-dp-container/tz-dp-container.component.mjs +202 -172
- package/esm2022/datepicker_v2/utils/index.mjs +2 -1
- package/esm2022/daterangepicker_v2/tz-daterangepicker.directive.mjs +26 -51
- package/esm2022/daterangepicker_v2/tz-drp-container/tz-drp-container.component.mjs +282 -235
- package/esm2022/drawer/drawer-body/drawer-body.component.mjs +8 -7
- package/esm2022/dropdown/calculate-container-height.directive.mjs +25 -22
- package/esm2022/dropdown/dropdown.component.mjs +162 -186
- package/esm2022/dynamic-form/dynamic-form.component.mjs +118 -72
- package/esm2022/fab/fab.component.mjs +29 -33
- package/esm2022/filter/filter-panel/filter-panel.component.mjs +60 -58
- package/esm2022/input/directives/input/input.directive.mjs +22 -26
- package/esm2022/input/mis-input.component.mjs +41 -45
- package/esm2022/input-stepper/input-stepper/input-stepper.component.mjs +40 -50
- package/esm2022/loader/loader.component.mjs +8 -11
- package/esm2022/mobile-filter/mobile-filter.component.mjs +61 -61
- package/esm2022/modal/module-wrapper/module-wrapper.component.mjs +11 -9
- package/esm2022/multi-select-dropdown/multi-select-dropdown.component.mjs +235 -281
- package/esm2022/nested-multi-select-dropdown/nested-multi-select-dropdown.component.mjs +250 -287
- package/esm2022/phone-input/phone-input.component.mjs +21 -43
- package/esm2022/radio-button/radio-button.component.mjs +15 -27
- package/esm2022/ske-loader/ske-loader.component.mjs +15 -29
- package/esm2022/slider/slider.component.mjs +23 -33
- package/esm2022/slider/slider.module.mjs +4 -11
- package/esm2022/snackbar/snackbar/snackbar.component.mjs +21 -15
- package/esm2022/snackbar/snackbar.service.mjs +3 -2
- package/esm2022/specificdatepicker/tz-sdp-container/tz-sdp-container.component.mjs +230 -343
- package/esm2022/specificdatepicker/tz-specificdatepicker.directive.mjs +77 -105
- package/esm2022/star-rating/star-rating.component.mjs +57 -71
- package/esm2022/switch/switch.component.mjs +34 -36
- package/esm2022/table/actions-cell/actions-cell.component.mjs +55 -54
- package/esm2022/table/custom-table-cell.directive.mjs +22 -18
- package/esm2022/table/filter/filter.component.mjs +60 -42
- package/esm2022/table/sort-icons.directive.mjs +16 -8
- package/esm2022/table/sub-table/sub-table.component.mjs +41 -44
- package/esm2022/table/table.component.mjs +181 -165
- package/esm2022/timepicker/timepicker.component.mjs +244 -159
- package/esm2022/timepicker/timepicker.directive.mjs +3 -2
- package/esm2022/timerangepicker/timerangepicker.component.mjs +200 -159
- package/esm2022/toast/toast.component.mjs +6 -7
- package/esm2022/toast/toast.data.service.mjs +15 -9
- package/esm2022/tooltip/tooltip-container/tooltip.component.mjs +12 -12
- package/esm2022/tooltip/tooltip.directive.mjs +4 -4
- package/esm2022/virtual-scroll/virtual-scroll.component.mjs +57 -59
- package/fab/fab.component.d.ts +12 -8
- package/fesm2022/mis-crystal-design-system-action-list.mjs +111 -88
- package/fesm2022/mis-crystal-design-system-action-list.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-async-search-dropdown.mjs +253 -324
- package/fesm2022/mis-crystal-design-system-async-search-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-button.mjs +88 -85
- package/fesm2022/mis-crystal-design-system-button.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-checkbox.mjs +74 -69
- package/fesm2022/mis-crystal-design-system-checkbox.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-chip.mjs +19 -32
- package/fesm2022/mis-crystal-design-system-chip.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-datepicker_v2.mjs +242 -240
- package/fesm2022/mis-crystal-design-system-datepicker_v2.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-daterangepicker_v2.mjs +305 -283
- package/fesm2022/mis-crystal-design-system-daterangepicker_v2.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-drawer.mjs +7 -6
- package/fesm2022/mis-crystal-design-system-drawer.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-dropdown.mjs +183 -204
- package/fesm2022/mis-crystal-design-system-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-dynamic-form.mjs +118 -72
- package/fesm2022/mis-crystal-design-system-dynamic-form.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-fab.mjs +28 -32
- package/fesm2022/mis-crystal-design-system-fab.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-filter.mjs +59 -57
- package/fesm2022/mis-crystal-design-system-filter.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-input-stepper.mjs +39 -49
- package/fesm2022/mis-crystal-design-system-input-stepper.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-input.mjs +62 -71
- package/fesm2022/mis-crystal-design-system-input.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-loader.mjs +7 -10
- package/fesm2022/mis-crystal-design-system-loader.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-mobile-filter.mjs +60 -60
- package/fesm2022/mis-crystal-design-system-mobile-filter.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-modal.mjs +10 -8
- package/fesm2022/mis-crystal-design-system-modal.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-multi-select-dropdown.mjs +233 -279
- package/fesm2022/mis-crystal-design-system-multi-select-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-nested-multi-select-dropdown.mjs +249 -286
- package/fesm2022/mis-crystal-design-system-nested-multi-select-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-phone-input.mjs +20 -42
- package/fesm2022/mis-crystal-design-system-phone-input.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-radio-button.mjs +14 -26
- package/fesm2022/mis-crystal-design-system-radio-button.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-ske-loader.mjs +14 -28
- package/fesm2022/mis-crystal-design-system-ske-loader.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-slider.mjs +25 -42
- package/fesm2022/mis-crystal-design-system-slider.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-snackbar.mjs +22 -15
- package/fesm2022/mis-crystal-design-system-snackbar.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-specificdatepicker.mjs +304 -445
- package/fesm2022/mis-crystal-design-system-specificdatepicker.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-star-rating.mjs +56 -70
- package/fesm2022/mis-crystal-design-system-star-rating.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-switch.mjs +33 -35
- package/fesm2022/mis-crystal-design-system-switch.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-table.mjs +365 -321
- package/fesm2022/mis-crystal-design-system-table.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-timepicker.mjs +245 -159
- package/fesm2022/mis-crystal-design-system-timepicker.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-timerangepicker.mjs +199 -158
- package/fesm2022/mis-crystal-design-system-timerangepicker.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-toast.mjs +18 -13
- package/fesm2022/mis-crystal-design-system-toast.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-tooltip.mjs +14 -14
- package/fesm2022/mis-crystal-design-system-tooltip.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-virtual-scroll.mjs +57 -59
- package/fesm2022/mis-crystal-design-system-virtual-scroll.mjs.map +1 -1
- package/filter/filter-panel/filter-panel.component.d.ts +14 -14
- package/input/directives/input/input.directive.d.ts +6 -10
- package/input/mis-input.component.d.ts +12 -13
- package/input-stepper/input-stepper/input-stepper.component.d.ts +8 -7
- package/loader/loader.component.d.ts +3 -6
- package/mobile-filter/mobile-filter.component.d.ts +15 -15
- package/modal/module-wrapper/module-wrapper.component.d.ts +2 -3
- package/multi-select-dropdown/multi-select-dropdown.component.d.ts +89 -51
- package/nested-multi-select-dropdown/nested-multi-select-dropdown.component.d.ts +99 -56
- package/package.json +17 -17
- package/phone-input/phone-input.component.d.ts +16 -18
- package/radio-button/radio-button.component.d.ts +9 -11
- package/ske-loader/ske-loader.component.d.ts +8 -11
- package/slider/slider.component.d.ts +8 -11
- package/slider/slider.module.d.ts +1 -2
- package/snackbar/snackbar/snackbar.component.d.ts +3 -3
- package/specificdatepicker/tz-sdp-container/tz-sdp-container.component.d.ts +35 -35
- package/specificdatepicker/tz-specificdatepicker.directive.d.ts +24 -28
- package/star-rating/star-rating.component.d.ts +18 -18
- package/switch/switch.component.d.ts +8 -10
- package/table/actions-cell/actions-cell.component.d.ts +14 -14
- package/table/custom-table-cell.directive.d.ts +3 -3
- package/table/filter/filter.component.d.ts +9 -9
- package/table/sub-table/sub-table.component.d.ts +5 -5
- package/table/table.component.d.ts +38 -35
- package/timepicker/timepicker.component.d.ts +29 -28
- package/timerangepicker/timerangepicker.component.d.ts +36 -33
- package/toast/toast.data.service.d.ts +1 -1
- package/tooltip/tooltip-container/tooltip.component.d.ts +4 -4
- package/virtual-scroll/virtual-scroll.component.d.ts +8 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Component, Inject, HostListener,
|
|
2
|
+
import { InjectionToken, signal, computed, Component, Inject, HostListener, input, output, effect, Injector, Directive, Self, Optional, NgModule } from '@angular/core';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import timezone from 'dayjs/plugin/timezone';
|
|
5
5
|
import utc from 'dayjs/plugin/utc';
|
|
@@ -72,6 +72,7 @@ const getMonth = (index) => {
|
|
|
72
72
|
month = "December";
|
|
73
73
|
break;
|
|
74
74
|
default:
|
|
75
|
+
month = null;
|
|
75
76
|
break;
|
|
76
77
|
}
|
|
77
78
|
return month;
|
|
@@ -92,7 +93,7 @@ function TzDpContainerComponent_div_6_Template(rf, ctx) { if (rf & 1) {
|
|
|
92
93
|
} if (rf & 2) {
|
|
93
94
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
94
95
|
i0.ɵɵadvance();
|
|
95
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r1.isYearSelectionFlow ? ctx_r1.selectedYear : ctx_r1.availableMonths[ctx_r1.currentMonthNumber], " ");
|
|
96
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.isYearSelectionFlow() ? ctx_r1.selectedYear() : ctx_r1.availableMonths()[ctx_r1.currentMonthNumber()], " ");
|
|
96
97
|
} }
|
|
97
98
|
function TzDpContainerComponent_div_7_Template(rf, ctx) { if (rf & 1) {
|
|
98
99
|
const _r3 = i0.ɵɵgetCurrentView();
|
|
@@ -103,19 +104,19 @@ function TzDpContainerComponent_div_7_Template(rf, ctx) { if (rf & 1) {
|
|
|
103
104
|
} if (rf & 2) {
|
|
104
105
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
105
106
|
i0.ɵɵadvance();
|
|
106
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r1.isSelectingYear ? ctx_r1.yearRange : ctx_r1.currentYearNumber, " ");
|
|
107
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.isSelectingYear() ? ctx_r1.yearRange : ctx_r1.currentYearNumber(), " ");
|
|
107
108
|
} }
|
|
108
109
|
function TzDpContainerComponent_div_12_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
109
110
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
110
111
|
i0.ɵɵelementStart(0, "div", 21);
|
|
111
|
-
i0.ɵɵlistener("click", function TzDpContainerComponent_div_12_div_2_Template_div_click_0_listener() { const ctx_r4 = i0.ɵɵrestoreView(_r4); const month_r6 = ctx_r4.$implicit; const i_r7 = ctx_r4.index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(!ctx_r1.disabledMonths[i_r7] && ctx_r1.selectMonth(month_r6)); });
|
|
112
|
+
i0.ɵɵlistener("click", function TzDpContainerComponent_div_12_div_2_Template_div_click_0_listener() { const ctx_r4 = i0.ɵɵrestoreView(_r4); const month_r6 = ctx_r4.$implicit; const i_r7 = ctx_r4.index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(!ctx_r1.disabledMonths()[i_r7] && ctx_r1.selectMonth(month_r6)); });
|
|
112
113
|
i0.ɵɵtext(1);
|
|
113
114
|
i0.ɵɵelementEnd();
|
|
114
115
|
} if (rf & 2) {
|
|
115
116
|
const month_r6 = ctx.$implicit;
|
|
116
117
|
const i_r7 = ctx.index;
|
|
117
118
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
118
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(2, _c1, ctx_r1.disabledMonths[i_r7], !ctx_r1.disabledMonths[ctx_r1.currentMonthNumber] && month_r6 === ctx_r1.availableMonths[ctx_r1.currentMonthNumber]));
|
|
119
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(2, _c1, ctx_r1.disabledMonths()[i_r7], !ctx_r1.disabledMonths()[ctx_r1.currentMonthNumber()] && month_r6 === ctx_r1.availableMonths()[ctx_r1.currentMonthNumber()]));
|
|
119
120
|
i0.ɵɵadvance();
|
|
120
121
|
i0.ɵɵtextInterpolate1(" ", month_r6, " ");
|
|
121
122
|
} }
|
|
@@ -126,19 +127,19 @@ function TzDpContainerComponent_div_12_Template(rf, ctx) { if (rf & 1) {
|
|
|
126
127
|
} if (rf & 2) {
|
|
127
128
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
128
129
|
i0.ɵɵadvance(2);
|
|
129
|
-
i0.ɵɵproperty("ngForOf", ctx_r1.availableMonths);
|
|
130
|
+
i0.ɵɵproperty("ngForOf", ctx_r1.availableMonths());
|
|
130
131
|
} }
|
|
131
132
|
function TzDpContainerComponent_div_13_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
132
133
|
const _r8 = i0.ɵɵgetCurrentView();
|
|
133
134
|
i0.ɵɵelementStart(0, "div", 24);
|
|
134
|
-
i0.ɵɵlistener("click", function TzDpContainerComponent_div_13_div_2_Template_div_click_0_listener() { const ctx_r8 = i0.ɵɵrestoreView(_r8); const year_r10 = ctx_r8.$implicit; const i_r11 = ctx_r8.index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(!ctx_r1.disabledYears[i_r11] && ctx_r1.selectYear(year_r10)); });
|
|
135
|
+
i0.ɵɵlistener("click", function TzDpContainerComponent_div_13_div_2_Template_div_click_0_listener() { const ctx_r8 = i0.ɵɵrestoreView(_r8); const year_r10 = ctx_r8.$implicit; const i_r11 = ctx_r8.index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(!ctx_r1.disabledYears()[i_r11] && ctx_r1.selectYear(year_r10)); });
|
|
135
136
|
i0.ɵɵtext(1);
|
|
136
137
|
i0.ɵɵelementEnd();
|
|
137
138
|
} if (rf & 2) {
|
|
138
139
|
const year_r10 = ctx.$implicit;
|
|
139
140
|
const i_r11 = ctx.index;
|
|
140
141
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
141
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(2, _c2, ctx_r1.disabledYears[i_r11], year_r10 === ctx_r1.currentYearNumber));
|
|
142
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(2, _c2, ctx_r1.disabledYears()[i_r11], year_r10 === ctx_r1.currentYearNumber()));
|
|
142
143
|
i0.ɵɵadvance();
|
|
143
144
|
i0.ɵɵtextInterpolate1(" ", year_r10, " ");
|
|
144
145
|
} }
|
|
@@ -149,7 +150,7 @@ function TzDpContainerComponent_div_13_Template(rf, ctx) { if (rf & 1) {
|
|
|
149
150
|
} if (rf & 2) {
|
|
150
151
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
151
152
|
i0.ɵɵadvance(2);
|
|
152
|
-
i0.ɵɵproperty("ngForOf", ctx_r1.availableYears);
|
|
153
|
+
i0.ɵɵproperty("ngForOf", ctx_r1.availableYears());
|
|
153
154
|
} }
|
|
154
155
|
function TzDpContainerComponent_div_14_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
155
156
|
i0.ɵɵelementStart(0, "div", 27)(1, "span", 28);
|
|
@@ -169,7 +170,7 @@ function TzDpContainerComponent_div_14_Template(rf, ctx) { if (rf & 1) {
|
|
|
169
170
|
} if (rf & 2) {
|
|
170
171
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
171
172
|
i0.ɵɵadvance();
|
|
172
|
-
i0.ɵɵproperty("ngForOf", ctx_r1.weekDays);
|
|
173
|
+
i0.ɵɵproperty("ngForOf", ctx_r1.weekDays());
|
|
173
174
|
} }
|
|
174
175
|
function TzDpContainerComponent_div_15_div_1_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
175
176
|
i0.ɵɵelementStart(0, "span", 33);
|
|
@@ -179,7 +180,7 @@ function TzDpContainerComponent_div_15_div_1_span_1_Template(rf, ctx) { if (rf &
|
|
|
179
180
|
const day_r14 = i0.ɵɵnextContext().$implicit;
|
|
180
181
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
181
182
|
i0.ɵɵproperty("tabindex", day_r14.isDisabledDay ? -1 : 0)("ngClass", i0.ɵɵpureFunction3(4, _c5, day_r14.isCurrentDay, day_r14.isSelectedDay, day_r14.isDisabledDay));
|
|
182
|
-
i0.ɵɵattribute("aria-label", ctx_r1.retractDayMonth(day_r14.date, ctx_r1.currentMonth, ctx_r1.currentYearNumber));
|
|
183
|
+
i0.ɵɵattribute("aria-label", ctx_r1.retractDayMonth(day_r14.date, ctx_r1.currentMonth(), ctx_r1.currentYearNumber()));
|
|
183
184
|
i0.ɵɵadvance();
|
|
184
185
|
i0.ɵɵtextInterpolate1(" ", day_r14.date, " ");
|
|
185
186
|
} }
|
|
@@ -202,7 +203,7 @@ function TzDpContainerComponent_div_15_Template(rf, ctx) { if (rf & 1) {
|
|
|
202
203
|
} if (rf & 2) {
|
|
203
204
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
204
205
|
i0.ɵɵadvance();
|
|
205
|
-
i0.ɵɵproperty("ngForOf", ctx_r1.currentMonthDates);
|
|
206
|
+
i0.ɵɵproperty("ngForOf", ctx_r1.currentMonthDates());
|
|
206
207
|
} }
|
|
207
208
|
function TzDpContainerComponent_div_16_div_15_Template(rf, ctx) { if (rf & 1) {
|
|
208
209
|
const _r16 = i0.ɵɵgetCurrentView();
|
|
@@ -210,7 +211,7 @@ function TzDpContainerComponent_div_16_div_15_Template(rf, ctx) { if (rf & 1) {
|
|
|
210
211
|
i0.ɵɵtext(2, "AM/PM");
|
|
211
212
|
i0.ɵɵelementEnd();
|
|
212
213
|
i0.ɵɵelementStart(3, "select", 46);
|
|
213
|
-
i0.ɵɵ
|
|
214
|
+
i0.ɵɵlistener("ngModelChange", function TzDpContainerComponent_div_16_div_15_Template_select_ngModelChange_3_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.selectedAmPmSignal.set($event)); });
|
|
214
215
|
i0.ɵɵelementStart(4, "option", 47);
|
|
215
216
|
i0.ɵɵtext(5, "AM");
|
|
216
217
|
i0.ɵɵelementEnd();
|
|
@@ -220,7 +221,7 @@ function TzDpContainerComponent_div_16_div_15_Template(rf, ctx) { if (rf & 1) {
|
|
|
220
221
|
} if (rf & 2) {
|
|
221
222
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
222
223
|
i0.ɵɵadvance(3);
|
|
223
|
-
i0.ɵɵ
|
|
224
|
+
i0.ɵɵproperty("ngModel", ctx_r1.selectedAmPm());
|
|
224
225
|
} }
|
|
225
226
|
function TzDpContainerComponent_div_16_Template(rf, ctx) { if (rf & 1) {
|
|
226
227
|
const _r15 = i0.ɵɵgetCurrentView();
|
|
@@ -231,8 +232,7 @@ function TzDpContainerComponent_div_16_Template(rf, ctx) { if (rf & 1) {
|
|
|
231
232
|
i0.ɵɵtext(7, "Hour");
|
|
232
233
|
i0.ɵɵelementEnd();
|
|
233
234
|
i0.ɵɵelementStart(8, "input", 39);
|
|
234
|
-
i0.ɵɵ
|
|
235
|
-
i0.ɵɵlistener("input", function TzDpContainerComponent_div_16_Template_input_input_8_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onHourInput($event)); })("blur", function TzDpContainerComponent_div_16_Template_input_blur_8_listener() { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.validateHourInput()); });
|
|
235
|
+
i0.ɵɵlistener("ngModelChange", function TzDpContainerComponent_div_16_Template_input_ngModelChange_8_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.selectedHourSignal.set($event)); })("input", function TzDpContainerComponent_div_16_Template_input_input_8_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onHourInput($event)); })("blur", function TzDpContainerComponent_div_16_Template_input_blur_8_listener() { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.validateHourInput()); });
|
|
236
236
|
i0.ɵɵelementEnd()();
|
|
237
237
|
i0.ɵɵelementStart(9, "div", 40);
|
|
238
238
|
i0.ɵɵtext(10, ":");
|
|
@@ -241,20 +241,16 @@ function TzDpContainerComponent_div_16_Template(rf, ctx) { if (rf & 1) {
|
|
|
241
241
|
i0.ɵɵtext(13, "Minute");
|
|
242
242
|
i0.ɵɵelementEnd();
|
|
243
243
|
i0.ɵɵelementStart(14, "input", 42);
|
|
244
|
-
i0.ɵɵ
|
|
245
|
-
i0.ɵɵlistener("input", function TzDpContainerComponent_div_16_Template_input_input_14_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onMinuteInput($event)); })("blur", function TzDpContainerComponent_div_16_Template_input_blur_14_listener() { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.validateMinuteInput()); });
|
|
244
|
+
i0.ɵɵlistener("ngModelChange", function TzDpContainerComponent_div_16_Template_input_ngModelChange_14_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.selectedMinuteSignal.set($event)); })("input", function TzDpContainerComponent_div_16_Template_input_input_14_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onMinuteInput($event)); })("blur", function TzDpContainerComponent_div_16_Template_input_blur_14_listener() { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.validateMinuteInput()); });
|
|
246
245
|
i0.ɵɵelementEnd()();
|
|
247
246
|
i0.ɵɵtemplate(15, TzDpContainerComponent_div_16_div_15_Template, 8, 1, "div", 43);
|
|
248
247
|
i0.ɵɵelementEnd()();
|
|
249
248
|
} if (rf & 2) {
|
|
250
249
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
251
250
|
i0.ɵɵadvance(8);
|
|
252
|
-
i0.ɵɵproperty("min", ctx_r1.is12HourFormat() ? 1 : 0)("max", ctx_r1.is12HourFormat() ? 12 : 23)("step", 1);
|
|
253
|
-
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.selectedHour);
|
|
254
|
-
i0.ɵɵproperty("title", ctx_r1.is12HourFormat() ? "Enter hour (1-12)" : "Enter hour (0-23)");
|
|
251
|
+
i0.ɵɵproperty("min", ctx_r1.is12HourFormat() ? 1 : 0)("max", ctx_r1.is12HourFormat() ? 12 : 23)("step", 1)("ngModel", ctx_r1.selectedHour())("title", ctx_r1.is12HourFormat() ? "Enter hour (1-12)" : "Enter hour (0-23)");
|
|
255
252
|
i0.ɵɵadvance(6);
|
|
256
|
-
i0.ɵɵproperty("step", 1);
|
|
257
|
-
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.selectedMinute);
|
|
253
|
+
i0.ɵɵproperty("step", 1)("ngModel", ctx_r1.selectedMinute());
|
|
258
254
|
i0.ɵɵadvance();
|
|
259
255
|
i0.ɵɵproperty("ngIf", ctx_r1.is12HourFormat());
|
|
260
256
|
} }
|
|
@@ -269,9 +265,10 @@ function TzDpContainerComponent_div_17_Template(rf, ctx) { if (rf & 1) {
|
|
|
269
265
|
i0.ɵɵtext(4, "Apply");
|
|
270
266
|
i0.ɵɵelementEnd()();
|
|
271
267
|
} if (rf & 2) {
|
|
268
|
+
let tmp_1_0;
|
|
272
269
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
273
270
|
i0.ɵɵadvance(3);
|
|
274
|
-
i0.ɵɵproperty("disabled", !(ctx_r1.data.date || ctx_r1.localSelectedDate.date));
|
|
271
|
+
i0.ɵɵproperty("disabled", !(ctx_r1.data.date || ((tmp_1_0 = ctx_r1.localSelectedDate()) == null ? null : tmp_1_0.date)));
|
|
275
272
|
} }
|
|
276
273
|
dayjs.extend(utc);
|
|
277
274
|
dayjs.extend(timezone);
|
|
@@ -285,22 +282,52 @@ class TzDpContainerComponent {
|
|
|
285
282
|
return dayjs(...args);
|
|
286
283
|
};
|
|
287
284
|
this.rawWeekDays = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
|
|
288
|
-
|
|
289
|
-
this.
|
|
290
|
-
this.
|
|
291
|
-
this.
|
|
292
|
-
this.
|
|
293
|
-
|
|
294
|
-
this.
|
|
295
|
-
this.
|
|
296
|
-
this.
|
|
297
|
-
this.
|
|
298
|
-
this.
|
|
299
|
-
|
|
300
|
-
this.
|
|
301
|
-
this.
|
|
302
|
-
this.
|
|
303
|
-
this.
|
|
285
|
+
// Signal-based state management
|
|
286
|
+
this.weekDaysSignal = signal([]);
|
|
287
|
+
this.currentMonthNumberSignal = signal(0);
|
|
288
|
+
this.currentMonthSignal = signal("January");
|
|
289
|
+
this.currentYearNumberSignal = signal(0);
|
|
290
|
+
this.currentMonthDatesSignal = signal([]);
|
|
291
|
+
this.isPreviousMonthDisabledSignal = signal(false);
|
|
292
|
+
this.isNextMonthDisabledSignal = signal(false);
|
|
293
|
+
this.localSelectedDateSignal = signal(null);
|
|
294
|
+
this.allowBookingOnDisabledDaySignal = signal(false);
|
|
295
|
+
this.currentSelectionSignal = signal(null);
|
|
296
|
+
// Time functionality signals
|
|
297
|
+
this.selectedHourSignal = signal(0);
|
|
298
|
+
this.selectedMinuteSignal = signal(0);
|
|
299
|
+
this.selectedAmPmSignal = signal('AM');
|
|
300
|
+
this.isSelectingMonthSignal = signal(false);
|
|
301
|
+
this.isSelectingYearSignal = signal(false);
|
|
302
|
+
this.availableYearsSignal = signal([]);
|
|
303
|
+
this.availableMonthsSignal = signal([]);
|
|
304
|
+
this.disabledMonthsSignal = signal([]);
|
|
305
|
+
this.disabledYearsSignal = signal([]);
|
|
306
|
+
this.selectedYearSignal = signal(0);
|
|
307
|
+
this.isYearSelectionFlowSignal = signal(false);
|
|
308
|
+
// Computed properties for template access
|
|
309
|
+
this.weekDays = computed(() => this.weekDaysSignal());
|
|
310
|
+
this.currentMonthNumber = computed(() => this.currentMonthNumberSignal());
|
|
311
|
+
this.currentMonth = computed(() => this.currentMonthSignal());
|
|
312
|
+
this.currentYearNumber = computed(() => this.currentYearNumberSignal());
|
|
313
|
+
this.currentMonthDates = computed(() => this.currentMonthDatesSignal());
|
|
314
|
+
this.isPreviousMonthDisabled = computed(() => this.isPreviousMonthDisabledSignal());
|
|
315
|
+
this.isNextMonthDisabled = computed(() => this.isNextMonthDisabledSignal());
|
|
316
|
+
this.localSelectedDate = computed(() => this.localSelectedDateSignal());
|
|
317
|
+
this.allowBookingOnDisabledDay = computed(() => this.allowBookingOnDisabledDaySignal());
|
|
318
|
+
this.currentSelection = computed(() => this.currentSelectionSignal());
|
|
319
|
+
// Time functionality computed properties
|
|
320
|
+
this.selectedHour = computed(() => this.selectedHourSignal());
|
|
321
|
+
this.selectedMinute = computed(() => this.selectedMinuteSignal());
|
|
322
|
+
this.selectedAmPm = computed(() => this.selectedAmPmSignal());
|
|
323
|
+
this.isSelectingMonth = computed(() => this.isSelectingMonthSignal());
|
|
324
|
+
this.isSelectingYear = computed(() => this.isSelectingYearSignal());
|
|
325
|
+
this.availableYears = computed(() => this.availableYearsSignal());
|
|
326
|
+
this.availableMonths = computed(() => this.availableMonthsSignal());
|
|
327
|
+
this.disabledMonths = computed(() => this.disabledMonthsSignal());
|
|
328
|
+
this.disabledYears = computed(() => this.disabledYearsSignal());
|
|
329
|
+
this.selectedYear = computed(() => this.selectedYearSignal());
|
|
330
|
+
this.isYearSelectionFlow = computed(() => this.isYearSelectionFlowSignal());
|
|
304
331
|
this.data = data;
|
|
305
332
|
// Initialize parseZoneInstance with better error handling
|
|
306
333
|
this.parseZoneInstance = (...args) => {
|
|
@@ -317,14 +344,14 @@ class TzDpContainerComponent {
|
|
|
317
344
|
return dayjs(...args);
|
|
318
345
|
}
|
|
319
346
|
};
|
|
320
|
-
// Set default values safely
|
|
321
|
-
this.
|
|
322
|
-
this.
|
|
323
|
-
this.
|
|
324
|
-
this.
|
|
347
|
+
// Set default values safely using signals
|
|
348
|
+
this.currentMonthNumberSignal.set(this.parseZoneInstance().month());
|
|
349
|
+
this.currentMonthSignal.set(getMonth(this.currentMonthNumberSignal()));
|
|
350
|
+
this.currentYearNumberSignal.set(this.parseZoneInstance().year());
|
|
351
|
+
this.weekDaysSignal.set(this.rawWeekDays.map((day, index) => ({
|
|
325
352
|
label: `${day[0]}${day.slice(1).toLowerCase()}`,
|
|
326
353
|
isCurrentDay: this.parseZoneInstance().day() === index
|
|
327
|
-
}));
|
|
354
|
+
})));
|
|
328
355
|
if (!this.data?.dpConfig?.format) {
|
|
329
356
|
this.data.dpConfig = {
|
|
330
357
|
...this.data.dpConfig,
|
|
@@ -334,8 +361,8 @@ class TzDpContainerComponent {
|
|
|
334
361
|
if (!this.data?.date) {
|
|
335
362
|
this.data.date = this.parseZoneInstance().format(this.data.dpConfig.format);
|
|
336
363
|
}
|
|
337
|
-
this.
|
|
338
|
-
this.
|
|
364
|
+
this.availableMonthsSignal.set(Array.from({ length: 12 }, (_, i) => dayjs().month(i).format('MMMM')));
|
|
365
|
+
this.availableYearsSignal.set(Array.from({ length: 12 }, (_, index) => this.currentYearNumberSignal() - 6 + index));
|
|
339
366
|
}
|
|
340
367
|
onHourInput(event) {
|
|
341
368
|
if (this.data.dpConfig.enableTime !== true)
|
|
@@ -344,12 +371,12 @@ class TzDpContainerComponent {
|
|
|
344
371
|
if (!isNaN(value)) {
|
|
345
372
|
if (this.is12HourFormat()) {
|
|
346
373
|
if (value >= 1 && value <= 12) {
|
|
347
|
-
this.
|
|
374
|
+
this.selectedHourSignal.set(value);
|
|
348
375
|
}
|
|
349
376
|
}
|
|
350
377
|
else {
|
|
351
378
|
if (value >= 0 && value <= 23) {
|
|
352
|
-
this.
|
|
379
|
+
this.selectedHourSignal.set(value);
|
|
353
380
|
}
|
|
354
381
|
}
|
|
355
382
|
}
|
|
@@ -359,32 +386,32 @@ class TzDpContainerComponent {
|
|
|
359
386
|
return;
|
|
360
387
|
const value = parseInt(event.target.value);
|
|
361
388
|
if (!isNaN(value) && value >= 0 && value <= 59) {
|
|
362
|
-
this.
|
|
389
|
+
this.selectedMinuteSignal.set(value);
|
|
363
390
|
}
|
|
364
391
|
}
|
|
365
392
|
validateHourInput() {
|
|
366
393
|
if (this.data.dpConfig.enableTime !== true)
|
|
367
394
|
return;
|
|
368
395
|
if (this.is12HourFormat()) {
|
|
369
|
-
if (this.
|
|
370
|
-
this.
|
|
371
|
-
if (this.
|
|
372
|
-
this.
|
|
396
|
+
if (this.selectedHourSignal() < 1)
|
|
397
|
+
this.selectedHourSignal.set(1);
|
|
398
|
+
if (this.selectedHourSignal() > 12)
|
|
399
|
+
this.selectedHourSignal.set(12);
|
|
373
400
|
}
|
|
374
401
|
else {
|
|
375
|
-
if (this.
|
|
376
|
-
this.
|
|
377
|
-
if (this.
|
|
378
|
-
this.
|
|
402
|
+
if (this.selectedHourSignal() < 0)
|
|
403
|
+
this.selectedHourSignal.set(0);
|
|
404
|
+
if (this.selectedHourSignal() > 23)
|
|
405
|
+
this.selectedHourSignal.set(23);
|
|
379
406
|
}
|
|
380
407
|
}
|
|
381
408
|
validateMinuteInput() {
|
|
382
409
|
if (this.data.dpConfig.enableTime !== true)
|
|
383
410
|
return;
|
|
384
|
-
if (this.
|
|
385
|
-
this.
|
|
386
|
-
if (this.
|
|
387
|
-
this.
|
|
411
|
+
if (this.selectedMinuteSignal() < 0)
|
|
412
|
+
this.selectedMinuteSignal.set(0);
|
|
413
|
+
if (this.selectedMinuteSignal() > 59)
|
|
414
|
+
this.selectedMinuteSignal.set(59);
|
|
388
415
|
}
|
|
389
416
|
is12HourFormat() {
|
|
390
417
|
return this.data.dpConfig.enableTime === true &&
|
|
@@ -397,14 +424,14 @@ class TzDpContainerComponent {
|
|
|
397
424
|
this.currentDateInstance();
|
|
398
425
|
this.calculateMinMaxDays();
|
|
399
426
|
this.calculateDisabledMonthsAndYears();
|
|
400
|
-
this.generateDates(this.
|
|
427
|
+
this.currentMonthDatesSignal.set(this.generateDates(this.currentMonthNumberSignal(), this.currentYearNumberSignal()));
|
|
401
428
|
// Initialize time if enabled
|
|
402
429
|
if (this.data.dpConfig.enableTime === true) {
|
|
403
430
|
this.initializeTimeValues();
|
|
404
431
|
}
|
|
405
432
|
}
|
|
406
433
|
get yearRange() {
|
|
407
|
-
return `${this.
|
|
434
|
+
return `${this.selectedYearSignal() - 6} - ${this.selectedYearSignal() + 5}`;
|
|
408
435
|
}
|
|
409
436
|
initializeTimeValues() {
|
|
410
437
|
if (this.data.dpConfig.enableTime === true) {
|
|
@@ -414,24 +441,24 @@ class TzDpContainerComponent {
|
|
|
414
441
|
const currentDate = this.parseZoneInstance(this.data.date, this.data.dpConfig.format);
|
|
415
442
|
if (currentDate.isValid()) {
|
|
416
443
|
let hour = currentDate.hour();
|
|
417
|
-
this.
|
|
444
|
+
this.selectedMinuteSignal.set(currentDate.minute());
|
|
418
445
|
if (this.is12HourFormat()) {
|
|
419
446
|
if (hour === 0) {
|
|
420
447
|
hour = 12;
|
|
421
|
-
this.
|
|
448
|
+
this.selectedAmPmSignal.set('AM');
|
|
422
449
|
}
|
|
423
450
|
else if (hour > 12) {
|
|
424
451
|
hour = hour - 12;
|
|
425
|
-
this.
|
|
452
|
+
this.selectedAmPmSignal.set('PM');
|
|
426
453
|
}
|
|
427
454
|
else if (hour === 12) {
|
|
428
|
-
this.
|
|
455
|
+
this.selectedAmPmSignal.set('PM');
|
|
429
456
|
}
|
|
430
457
|
else {
|
|
431
|
-
this.
|
|
458
|
+
this.selectedAmPmSignal.set('AM');
|
|
432
459
|
}
|
|
433
460
|
}
|
|
434
|
-
this.
|
|
461
|
+
this.selectedHourSignal.set(hour);
|
|
435
462
|
}
|
|
436
463
|
else {
|
|
437
464
|
// Invalid date, use defaults
|
|
@@ -473,15 +500,15 @@ class TzDpContainerComponent {
|
|
|
473
500
|
else {
|
|
474
501
|
amPm = 'AM';
|
|
475
502
|
}
|
|
476
|
-
this.
|
|
477
|
-
this.
|
|
478
|
-
this.
|
|
503
|
+
this.selectedHourSignal.set(hour12);
|
|
504
|
+
this.selectedMinuteSignal.set(currentMinute);
|
|
505
|
+
this.selectedAmPmSignal.set(amPm);
|
|
479
506
|
}
|
|
480
507
|
else {
|
|
481
508
|
// Use current time directly for 24-hour format
|
|
482
|
-
this.
|
|
483
|
-
this.
|
|
484
|
-
this.
|
|
509
|
+
this.selectedHourSignal.set(currentHour);
|
|
510
|
+
this.selectedMinuteSignal.set(currentMinute);
|
|
511
|
+
this.selectedAmPmSignal.set('AM'); // Not used in 24-hour format but keep consistent
|
|
485
512
|
}
|
|
486
513
|
}
|
|
487
514
|
currentDateInstance() {
|
|
@@ -489,94 +516,97 @@ class TzDpContainerComponent {
|
|
|
489
516
|
if (this.data.date) {
|
|
490
517
|
const selectedDate = dayjs(this.data.date, this.data.dpConfig.format);
|
|
491
518
|
if (selectedDate.isValid()) {
|
|
492
|
-
this.
|
|
493
|
-
this.
|
|
494
|
-
this.
|
|
495
|
-
|
|
496
|
-
|
|
519
|
+
this.selectedYearSignal.set(selectedDate.year());
|
|
520
|
+
this.currentYearNumberSignal.set(selectedDate.year());
|
|
521
|
+
this.currentMonthNumberSignal.set(selectedDate.month());
|
|
522
|
+
this.currentMonthSignal.set(getMonth(selectedDate.month()));
|
|
523
|
+
if (!this.localSelectedDateSignal()) {
|
|
524
|
+
this.localSelectedDateSignal.set({
|
|
497
525
|
date: selectedDate.date(),
|
|
498
526
|
weekDay: selectedDate.day(),
|
|
499
527
|
month: selectedDate.month(),
|
|
500
528
|
year: selectedDate.year(),
|
|
501
529
|
isSelectedDay: true
|
|
502
|
-
};
|
|
530
|
+
});
|
|
503
531
|
}
|
|
504
532
|
}
|
|
505
533
|
}
|
|
506
534
|
}
|
|
507
535
|
catch (error) {
|
|
508
|
-
this.
|
|
509
|
-
this.
|
|
510
|
-
this.
|
|
536
|
+
this.currentYearNumberSignal.set(this.parseZoneInstance().year());
|
|
537
|
+
this.currentMonthNumberSignal.set(this.parseZoneInstance().month());
|
|
538
|
+
this.currentMonthSignal.set(getMonth(this.currentMonthNumberSignal()));
|
|
511
539
|
}
|
|
512
|
-
this.
|
|
540
|
+
this.currentMonthDatesSignal.set(this.generateDates(this.currentMonthNumberSignal(), this.currentYearNumberSignal()));
|
|
513
541
|
}
|
|
514
542
|
calculateMinMaxDays() {
|
|
515
|
-
const currentInstance = this.parseZoneInstance().year(this.
|
|
543
|
+
const currentInstance = this.parseZoneInstance().year(this.currentYearNumberSignal()).month(this.currentMonthNumberSignal());
|
|
516
544
|
if (this.data.dpConfig.minDate) {
|
|
517
545
|
const minDate = this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format);
|
|
518
546
|
if (minDate?.isValid()) {
|
|
519
|
-
this.
|
|
547
|
+
this.isPreviousMonthDisabledSignal.set(minDate.isSameOrAfter(currentInstance, "month"));
|
|
520
548
|
}
|
|
521
549
|
}
|
|
522
550
|
if (this.data.dpConfig.maxDate) {
|
|
523
551
|
const maxDate = this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format);
|
|
524
552
|
if (maxDate?.isValid()) {
|
|
525
|
-
this.
|
|
553
|
+
this.isNextMonthDisabledSignal.set(maxDate.isSameOrBefore(currentInstance, "month"));
|
|
526
554
|
}
|
|
527
555
|
}
|
|
528
556
|
}
|
|
529
557
|
calculateDisabledMonthsAndYears() {
|
|
530
558
|
const minDate = !!this.data.dpConfig.minDate ? this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format) : dayjs('invalid');
|
|
531
559
|
const maxDate = !!this.data.dpConfig.maxDate ? this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format) : dayjs('invalid');
|
|
532
|
-
this.
|
|
533
|
-
const monthDate = this.parseZoneInstance().year(this.
|
|
560
|
+
this.disabledMonthsSignal.set(this.availableMonthsSignal().map((month, index) => {
|
|
561
|
+
const monthDate = this.parseZoneInstance().year(this.selectedYearSignal()).month(index);
|
|
534
562
|
return (minDate.isValid() && monthDate.isBefore(minDate, 'month')) ||
|
|
535
563
|
(maxDate.isValid() && monthDate.isAfter(maxDate, 'month'));
|
|
536
|
-
});
|
|
537
|
-
this.
|
|
564
|
+
}));
|
|
565
|
+
this.disabledYearsSignal.set(this.availableYearsSignal().map((year) => {
|
|
538
566
|
const yearDate = this.parseZoneInstance().year(year);
|
|
539
567
|
return (minDate.isValid() && yearDate.isBefore(minDate, 'year')) ||
|
|
540
568
|
(maxDate.isValid() && yearDate.isAfter(maxDate, 'year'));
|
|
541
|
-
});
|
|
542
|
-
if (this.
|
|
543
|
-
this.
|
|
544
|
-
this.
|
|
569
|
+
}));
|
|
570
|
+
if (this.isSelectingYearSignal()) {
|
|
571
|
+
this.isPreviousMonthDisabledSignal.set(minDate.isValid() && ((this.selectedYearSignal() - 6) <= minDate.year()));
|
|
572
|
+
this.isNextMonthDisabledSignal.set(maxDate.isValid() && ((this.selectedYearSignal() + 5) >= maxDate.year()));
|
|
545
573
|
}
|
|
546
574
|
}
|
|
547
575
|
navigateView(direction) {
|
|
548
|
-
if ((direction === 'NEXT' && (this.
|
|
549
|
-
(direction === 'PREVIOUS' && (this.
|
|
576
|
+
if ((direction === 'NEXT' && (this.isNextMonthDisabledSignal() || this.isSelectingMonthSignal())) ||
|
|
577
|
+
(direction === 'PREVIOUS' && (this.isPreviousMonthDisabledSignal() || this.isSelectingMonthSignal()))) {
|
|
550
578
|
return;
|
|
551
579
|
}
|
|
552
|
-
if (this.
|
|
553
|
-
this.
|
|
554
|
-
this.
|
|
580
|
+
if (this.isSelectingYearSignal()) {
|
|
581
|
+
const newSelectedYear = this.selectedYearSignal() + (direction === "NEXT" ? 12 : -12);
|
|
582
|
+
this.selectedYearSignal.set(newSelectedYear);
|
|
583
|
+
this.availableYearsSignal.set(Array.from({ length: 12 }, (_, index) => newSelectedYear - 6 + index));
|
|
555
584
|
}
|
|
556
585
|
else {
|
|
557
|
-
let thisMonth = this.parseZoneInstance().year(this.
|
|
586
|
+
let thisMonth = this.parseZoneInstance().year(this.currentYearNumberSignal()).month(this.currentMonthNumberSignal());
|
|
558
587
|
thisMonth = direction === "NEXT" ? thisMonth.add(1, "month") : thisMonth.subtract(1, "month");
|
|
559
|
-
this.
|
|
560
|
-
this.
|
|
561
|
-
this.
|
|
562
|
-
this.
|
|
588
|
+
this.currentMonthNumberSignal.set(thisMonth.month());
|
|
589
|
+
this.currentMonthSignal.set(getMonth(thisMonth.month()));
|
|
590
|
+
this.selectedYearSignal.set(thisMonth.year());
|
|
591
|
+
this.currentYearNumberSignal.set(thisMonth.year());
|
|
592
|
+
this.currentMonthDatesSignal.set(this.generateDates(thisMonth.month(), thisMonth.year()));
|
|
563
593
|
}
|
|
564
594
|
this.calculateMinMaxDays();
|
|
565
595
|
this.calculateDisabledMonthsAndYears();
|
|
566
596
|
}
|
|
567
597
|
navigateMonth(direction) {
|
|
568
598
|
try {
|
|
569
|
-
let thisMonth = dayjs().year(this.
|
|
599
|
+
let thisMonth = dayjs().year(this.currentYearNumberSignal()).month(this.currentMonthNumberSignal());
|
|
570
600
|
if (direction === "NEXT") {
|
|
571
601
|
thisMonth = thisMonth.add(1, "month");
|
|
572
602
|
}
|
|
573
603
|
else if (direction === "PREVIOUS") {
|
|
574
604
|
thisMonth = thisMonth.subtract(1, "month");
|
|
575
605
|
}
|
|
576
|
-
this.
|
|
577
|
-
this.
|
|
578
|
-
this.
|
|
579
|
-
this.
|
|
606
|
+
this.currentMonthNumberSignal.set(thisMonth.month());
|
|
607
|
+
this.currentMonthSignal.set(getMonth(thisMonth.month()));
|
|
608
|
+
this.currentYearNumberSignal.set(thisMonth.year());
|
|
609
|
+
this.currentMonthDatesSignal.set(this.generateDates(thisMonth.month(), thisMonth.year()));
|
|
580
610
|
this.calculateMinMaxDays();
|
|
581
611
|
}
|
|
582
612
|
catch (error) {
|
|
@@ -620,13 +650,13 @@ class TzDpContainerComponent {
|
|
|
620
650
|
const isCurrentDay = currentDateInstance.format(this.data.dpConfig.format) === dayjs().format(this.data.dpConfig.format);
|
|
621
651
|
let isSelectedDay = false;
|
|
622
652
|
// Prioritize current selection over previously applied date
|
|
623
|
-
if (this.
|
|
624
|
-
this.
|
|
625
|
-
this.
|
|
626
|
-
this.
|
|
653
|
+
if (this.localSelectedDateSignal() &&
|
|
654
|
+
this.localSelectedDateSignal().date === currentDate &&
|
|
655
|
+
this.localSelectedDateSignal().month === month &&
|
|
656
|
+
this.localSelectedDateSignal().year === currentYearNumber) {
|
|
627
657
|
isSelectedDay = true;
|
|
628
658
|
}
|
|
629
|
-
else if (this.data.date && !this.
|
|
659
|
+
else if (this.data.date && !this.localSelectedDateSignal()) {
|
|
630
660
|
// Only check previously applied date if no current selection
|
|
631
661
|
try {
|
|
632
662
|
if (this.data.dpConfig.enableTime) {
|
|
@@ -694,21 +724,21 @@ class TzDpContainerComponent {
|
|
|
694
724
|
return;
|
|
695
725
|
try {
|
|
696
726
|
// Create the base date selection without time
|
|
697
|
-
this.
|
|
727
|
+
this.currentSelectionSignal.set(this.parseZoneInstance().year(this.currentYearNumberSignal()).month(this.currentMonthNumberSignal()).date(day.date).hour(0).minute(0).second(0).millisecond(0));
|
|
698
728
|
// Apply the current time values to the selection
|
|
699
729
|
if (this.data.dpConfig.enableTime === true) {
|
|
700
|
-
let hour = this.
|
|
730
|
+
let hour = this.selectedHourSignal();
|
|
701
731
|
if (this.is12HourFormat()) {
|
|
702
|
-
if (this.
|
|
732
|
+
if (this.selectedAmPmSignal() === 'PM' && hour !== 12) {
|
|
703
733
|
hour += 12;
|
|
704
734
|
}
|
|
705
|
-
else if (this.
|
|
735
|
+
else if (this.selectedAmPmSignal() === 'AM' && hour === 12) {
|
|
706
736
|
hour = 0;
|
|
707
737
|
}
|
|
708
738
|
}
|
|
709
|
-
this.
|
|
739
|
+
this.currentSelectionSignal.set(this.currentSelectionSignal()
|
|
710
740
|
.hour(hour)
|
|
711
|
-
.minute(this.
|
|
741
|
+
.minute(this.selectedMinuteSignal()));
|
|
712
742
|
}
|
|
713
743
|
let maxDate = null;
|
|
714
744
|
let minDate = null;
|
|
@@ -728,17 +758,17 @@ class TzDpContainerComponent {
|
|
|
728
758
|
// Silently handle min date parsing error
|
|
729
759
|
}
|
|
730
760
|
}
|
|
731
|
-
this.
|
|
732
|
-
if (((!minDate || this.
|
|
733
|
-
this.
|
|
761
|
+
this.allowBookingOnDisabledDaySignal.set(this.data.allowBookingOnDisabledDay);
|
|
762
|
+
if (((!minDate || this.currentSelectionSignal().isSameOrAfter(minDate)) && (!maxDate || this.currentSelectionSignal().isSameOrBefore(maxDate)) && this.allowBookingOnDisabledDaySignal()) || (!day.isDisabledDay && !this.allowBookingOnDisabledDaySignal())) {
|
|
763
|
+
this.localSelectedDateSignal.set({
|
|
734
764
|
...day,
|
|
735
|
-
month: this.
|
|
736
|
-
year: this.
|
|
737
|
-
};
|
|
765
|
+
month: this.currentMonthNumberSignal(),
|
|
766
|
+
year: this.currentYearNumberSignal()
|
|
767
|
+
});
|
|
738
768
|
// Force calendar re-render to show highlighting
|
|
739
|
-
this.
|
|
740
|
-
// Automatically
|
|
741
|
-
if (!this.data.dpConfig.enableTime) {
|
|
769
|
+
this.currentMonthDatesSignal.set(this.generateDates(this.currentMonthNumberSignal(), this.currentYearNumberSignal()));
|
|
770
|
+
// Automatically apply when neither time nor apply button is enabled, otherwise wait for user action
|
|
771
|
+
if (!this.data.dpConfig.enableTime && !this.data.dpConfig.showApplyButton) {
|
|
742
772
|
this.applyDate(day);
|
|
743
773
|
}
|
|
744
774
|
}
|
|
@@ -755,22 +785,22 @@ class TzDpContainerComponent {
|
|
|
755
785
|
try {
|
|
756
786
|
if (this.data.dpConfig.enableTime === true) {
|
|
757
787
|
// Always use time input values when time is enabled, regardless of currentSelection
|
|
758
|
-
let hour = this.
|
|
788
|
+
let hour = this.selectedHourSignal();
|
|
759
789
|
if (this.is12HourFormat()) {
|
|
760
|
-
if (this.
|
|
790
|
+
if (this.selectedAmPmSignal() === 'PM' && hour !== 12) {
|
|
761
791
|
hour += 12;
|
|
762
792
|
}
|
|
763
|
-
else if (this.
|
|
793
|
+
else if (this.selectedAmPmSignal() === 'AM' && hour === 12) {
|
|
764
794
|
hour = 0;
|
|
765
795
|
}
|
|
766
796
|
}
|
|
767
797
|
// Create a new date instance with the selected time
|
|
768
798
|
const finalSelection = dayjs()
|
|
769
|
-
.year(this.
|
|
770
|
-
.month(this.
|
|
771
|
-
.date(this.
|
|
799
|
+
.year(this.currentYearNumberSignal())
|
|
800
|
+
.month(this.currentMonthNumberSignal())
|
|
801
|
+
.date(this.localSelectedDateSignal()?.date || day?.date || dayjs().date())
|
|
772
802
|
.hour(hour)
|
|
773
|
-
.minute(this.
|
|
803
|
+
.minute(this.selectedMinuteSignal())
|
|
774
804
|
.second(0)
|
|
775
805
|
.millisecond(0);
|
|
776
806
|
date = finalSelection.format(this.data.dpConfig.format);
|
|
@@ -778,16 +808,16 @@ class TzDpContainerComponent {
|
|
|
778
808
|
else {
|
|
779
809
|
// Date-only format - no time
|
|
780
810
|
date = dayjs()
|
|
781
|
-
.year(this.
|
|
782
|
-
.month(this.
|
|
783
|
-
.date(day ? day.date : this.
|
|
811
|
+
.year(this.currentYearNumberSignal())
|
|
812
|
+
.month(this.currentMonthNumberSignal())
|
|
813
|
+
.date(day ? day.date : this.localSelectedDateSignal()?.date || dayjs().date())
|
|
784
814
|
.hour(0)
|
|
785
815
|
.minute(0)
|
|
786
816
|
.second(0)
|
|
787
817
|
.millisecond(0)
|
|
788
818
|
.format(this.data.dpConfig.format);
|
|
789
819
|
}
|
|
790
|
-
if (day || this.
|
|
820
|
+
if (day || this.localSelectedDateSignal() || (this.data.dpConfig.enableTime === true)) {
|
|
791
821
|
this.data.dateChange(date);
|
|
792
822
|
}
|
|
793
823
|
else {
|
|
@@ -806,44 +836,45 @@ class TzDpContainerComponent {
|
|
|
806
836
|
this.data.dateChange("");
|
|
807
837
|
}
|
|
808
838
|
toggleMonthSelector() {
|
|
809
|
-
if (this.
|
|
839
|
+
if (this.isYearSelectionFlowSignal())
|
|
810
840
|
return;
|
|
811
|
-
this.
|
|
812
|
-
this.
|
|
841
|
+
this.isSelectingMonthSignal.set(!this.isSelectingMonthSignal());
|
|
842
|
+
this.isSelectingYearSignal.set(false);
|
|
813
843
|
this.calculateDisabledMonthsAndYears();
|
|
814
844
|
}
|
|
815
845
|
toggleYearSelector() {
|
|
816
|
-
this.
|
|
817
|
-
this.
|
|
818
|
-
this.
|
|
819
|
-
this.
|
|
846
|
+
this.isSelectingYearSignal.set(!this.isSelectingYearSignal());
|
|
847
|
+
this.selectedYearSignal.set(this.currentYearNumberSignal());
|
|
848
|
+
this.availableYearsSignal.set(Array.from({ length: 12 }, (_, index) => this.selectedYearSignal() - 6 + index));
|
|
849
|
+
this.isSelectingMonthSignal.set(false);
|
|
820
850
|
this.calculateDisabledMonthsAndYears();
|
|
821
851
|
}
|
|
822
852
|
resetDateSelection() {
|
|
823
|
-
this.
|
|
853
|
+
this.localSelectedDateSignal.set({
|
|
824
854
|
date: 0,
|
|
825
855
|
weekDay: 0,
|
|
826
856
|
isCurrentDay: false,
|
|
827
857
|
isSelectedDay: false,
|
|
828
858
|
isDisabledDay: false,
|
|
829
859
|
toastMessage: ''
|
|
830
|
-
};
|
|
860
|
+
});
|
|
831
861
|
this.data.date = '';
|
|
832
862
|
}
|
|
833
863
|
selectMonth(month) {
|
|
834
|
-
this.
|
|
835
|
-
this.
|
|
836
|
-
this.
|
|
837
|
-
this.
|
|
864
|
+
this.currentMonthNumberSignal.set(this.availableMonthsSignal().indexOf(month));
|
|
865
|
+
this.currentMonthSignal.set(getMonth(this.currentMonthNumberSignal()));
|
|
866
|
+
this.isSelectingMonthSignal.set(false);
|
|
867
|
+
this.isYearSelectionFlowSignal.set(false);
|
|
838
868
|
this.resetDateSelection();
|
|
839
|
-
this.
|
|
869
|
+
this.currentMonthDatesSignal.set(this.generateDates(this.currentMonthNumberSignal(), this.currentYearNumberSignal()));
|
|
840
870
|
this.calculateMinMaxDays();
|
|
841
871
|
}
|
|
842
872
|
selectYear(year) {
|
|
843
|
-
this.
|
|
844
|
-
this.
|
|
845
|
-
this.
|
|
846
|
-
this.
|
|
873
|
+
this.selectedYearSignal.set(year);
|
|
874
|
+
this.currentYearNumberSignal.set(year);
|
|
875
|
+
this.isSelectingYearSignal.set(false);
|
|
876
|
+
this.isSelectingMonthSignal.set(true);
|
|
877
|
+
this.isYearSelectionFlowSignal.set(true);
|
|
847
878
|
this.resetDateSelection();
|
|
848
879
|
this.calculateDisabledMonthsAndYears();
|
|
849
880
|
}
|
|
@@ -876,21 +907,21 @@ class TzDpContainerComponent {
|
|
|
876
907
|
} if (rf & 2) {
|
|
877
908
|
i0.ɵɵproperty("ngClass", ctx.data.disableBoxShadow ? "remove-box-shadow" : "")("cdkTrapFocusAutoCapture", true);
|
|
878
909
|
i0.ɵɵadvance(3);
|
|
879
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c0, ctx.isPreviousMonthDisabled || ctx.isSelectingMonth));
|
|
910
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c0, ctx.isPreviousMonthDisabled() || ctx.isSelectingMonth()));
|
|
880
911
|
i0.ɵɵadvance(3);
|
|
881
|
-
i0.ɵɵproperty("ngIf", !ctx.isSelectingYear);
|
|
912
|
+
i0.ɵɵproperty("ngIf", !ctx.isSelectingYear());
|
|
882
913
|
i0.ɵɵadvance();
|
|
883
|
-
i0.ɵɵproperty("ngIf", !ctx.isSelectingMonth);
|
|
914
|
+
i0.ɵɵproperty("ngIf", !ctx.isSelectingMonth());
|
|
884
915
|
i0.ɵɵadvance();
|
|
885
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(14, _c0, ctx.isNextMonthDisabled || ctx.isSelectingMonth));
|
|
916
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(14, _c0, ctx.isNextMonthDisabled() || ctx.isSelectingMonth()));
|
|
886
917
|
i0.ɵɵadvance(4);
|
|
887
|
-
i0.ɵɵproperty("ngIf", ctx.isSelectingMonth && !ctx.isSelectingYear);
|
|
918
|
+
i0.ɵɵproperty("ngIf", ctx.isSelectingMonth() && !ctx.isSelectingYear());
|
|
888
919
|
i0.ɵɵadvance();
|
|
889
|
-
i0.ɵɵproperty("ngIf", ctx.isSelectingYear && !ctx.isSelectingMonth);
|
|
920
|
+
i0.ɵɵproperty("ngIf", ctx.isSelectingYear() && !ctx.isSelectingMonth());
|
|
890
921
|
i0.ɵɵadvance();
|
|
891
|
-
i0.ɵɵproperty("ngIf", !ctx.isSelectingMonth && !ctx.isSelectingYear);
|
|
922
|
+
i0.ɵɵproperty("ngIf", !ctx.isSelectingMonth() && !ctx.isSelectingYear());
|
|
892
923
|
i0.ɵɵadvance();
|
|
893
|
-
i0.ɵɵproperty("ngIf", !ctx.isSelectingMonth && !ctx.isSelectingYear);
|
|
924
|
+
i0.ɵɵproperty("ngIf", !ctx.isSelectingMonth() && !ctx.isSelectingYear());
|
|
894
925
|
i0.ɵɵadvance();
|
|
895
926
|
i0.ɵɵproperty("ngIf", ctx.data.dpConfig.enableTime === true);
|
|
896
927
|
i0.ɵɵadvance();
|
|
@@ -899,7 +930,7 @@ class TzDpContainerComponent {
|
|
|
899
930
|
}
|
|
900
931
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TzDpContainerComponent, [{
|
|
901
932
|
type: Component,
|
|
902
|
-
args: [{ selector: "mis-tz-dp", template: "<div class=\"datepicker-container\" [ngClass]=\"data.disableBoxShadow?'remove-box-shadow':''\" aria-label=\"date picker\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\n <div tabindex=\"-1\" cdkFocusInitial></div>\n <div class=\"datepicker-container__header\">\n <div\n class=\"datepicker-container__arrow__icon\"\n (click)=\"navigateView('PREVIOUS')\"\n tabindex=\"0\"\n aria-label=\"Previous Month\"\n (keyup.enter)=\"navigateView('PREVIOUS')\"\n [ngClass]=\"{\n 'disabled-month': isPreviousMonthDisabled || isSelectingMonth\n }\"\n >\n <svg width=\"20\" height=\"16\" viewBox=\"0 0 20 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M19.7071 8.70711C20.0976 8.31658 20.0976 7.68342 19.7071 7.29289L13.3431 0.928933C12.9526 0.538409 12.3195 0.538409 11.9289 0.928933C11.5384 1.31946 11.5384 1.95262 11.9289 2.34315L17.5858 8L11.9289 13.6569C11.5384 14.0474 11.5384 14.6805 11.9289 15.0711C12.3195 15.4616 12.9526 15.4616 13.3431 15.0711L19.7071 8.70711ZM-8.74228e-08 9L19 9L19 7L8.74228e-08 7L-8.74228e-08 9Z\"\n fill=\"#181F33\"\n ></path>\n </svg>\n </div>\n\n <div *ngIf=\"!isSelectingYear\" (click)=\"toggleMonthSelector()\" class=\"month-header\">\n {{ isYearSelectionFlow ? selectedYear : availableMonths[currentMonthNumber] }}\n </div>\n <div *ngIf=\"!isSelectingMonth\" (click)=\"toggleYearSelector()\" class=\"year-header\">\n {{ isSelectingYear ? yearRange : currentYearNumber }}\n </div>\n\n\n <div\n class=\"datepicker-container__arrow__icon\"\n (click)=\"navigateView('NEXT')\"\n tabindex=\"0\"\n aria-label=\"Next Month\"\n (keyup.enter)=\"navigateView('NEXT')\"\n [ngClass]=\"{\n 'disabled-month': isNextMonthDisabled || isSelectingMonth\n }\"\n >\n <svg width=\"20\" height=\"16\" viewBox=\"0 0 20 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M19.7071 8.70711C20.0976 8.31658 20.0976 7.68342 19.7071 7.29289L13.3431 0.928933C12.9526 0.538409 12.3195 0.538409 11.9289 0.928933C11.5384 1.31946 11.5384 1.95262 11.9289 2.34315L17.5858 8L11.9289 13.6569C11.5384 14.0474 11.5384 14.6805 11.9289 15.0711C12.3195 15.4616 12.9526 15.4616 13.3431 15.0711L19.7071 8.70711ZM-8.74228e-08 9L19 9L19 7L8.74228e-08 7L-8.74228e-08 9Z\"\n fill=\"#181F33\"\n ></path>\n </svg>\n </div>\n </div>\n <div class=\"datepicker-container__body\">\n\n <div *ngIf=\"isSelectingMonth && !isSelectingYear\" class=\"month-selector\">\n <div class=\"row\">\n <div *ngFor=\"let month of availableMonths; let i = index\" \n class=\"month\" \n (click)=\"!disabledMonths[i] && selectMonth(month)\" \n [ngClass]=\"{\n 'disable-month': disabledMonths[i],\n 'select-month': !disabledMonths[currentMonthNumber] && month === availableMonths[currentMonthNumber]\n }\">\n {{ month }}\n </div>\n </div>\n </div>\n \n <div *ngIf=\"isSelectingYear && !isSelectingMonth\" class=\"year-selector\">\n <div class=\"row\">\n <div *ngFor=\"let year of availableYears; let i = index\" \n class=\"year\" \n (click)=\"!disabledYears[i] && selectYear(year)\" \n [ngClass]=\"{\n 'disable-year': disabledYears[i],\n 'select-year': year === currentYearNumber\n }\">\n {{ year }}\n </div>\n </div>\n </div>\n\n <div *ngIf=\"!isSelectingMonth && !isSelectingYear\" class=\"datepicker-container__weekdays\">\n <div class=\"datepicker-container__weekday\" *ngFor=\"let weekDay of weekDays\">\n <span [ngClass]=\"{ 'current-day': weekDay.isCurrentDay }\">{{ weekDay.label }}</span>\n </div>\n </div>\n <div *ngIf=\"!isSelectingMonth && !isSelectingYear\" class=\"datepicker-container__days\">\n <div\n class=\"datepicker-container__day\"\n [ngClass]=\"{\n 'selected-day': day.isSelectedDay,\n 'disabled-day': day.isDisabledDay,\n 'is-valid-date': day.date > 0 && !day.isSelectedDay\n }\"\n *ngFor=\"let day of currentMonthDates\"\n (click)=\"selectDay(day)\"\n (keyup.enter)=\"selectDay(day)\"\n >\n <span\n *ngIf=\"day.date > 0\"\n [tabindex]=\"day.isDisabledDay ? -1 : 0\"\n [ngClass]=\"{\n 'current-day': day.isCurrentDay,\n 'selected-day': day.isSelectedDay,\n 'disabled-day': day.isDisabledDay\n }\"\n [attr.aria-label]=\"retractDayMonth(day.date, currentMonth, currentYearNumber)\"\n >\n {{ day.date }}\n </span>\n </div>\n </div>\n </div>\n\n <!-- Time Picker Section -->\n <div class=\"datepicker-container__time\" *ngIf=\"data.dpConfig.enableTime === true\">\n <div class=\"time-picker-header\">\n <span>Time</span>\n </div>\n <div class=\"time-picker-controls\">\n <div class=\"time-input-group\">\n <label for=\"hourInput\">Hour</label>\n <input \n id=\"hourInput\"\n type=\"number\" \n [min]=\"is12HourFormat() ? 1 : 0\"\n [max]=\"is12HourFormat() ? 12 : 23\"\n [step]=\"1\"\n [(ngModel)]=\"selectedHour\"\n (input)=\"onHourInput($event)\"\n (blur)=\"validateHourInput()\"\n class=\"time-input\"\n [title]=\"is12HourFormat() ? 'Enter hour (1-12)' : 'Enter hour (0-23)'\">\n </div>\n <div class=\"time-separator\">:</div>\n <div class=\"time-input-group\">\n <label for=\"minuteInput\">Minute</label>\n <input \n id=\"minuteInput\"\n type=\"number\" \n min=\"0\" \n max=\"59\"\n [step]=\"1\"\n [(ngModel)]=\"selectedMinute\"\n (input)=\"onMinuteInput($event)\"\n (blur)=\"validateMinuteInput()\"\n class=\"time-input\"\n title=\"Enter minute (0-59)\">\n </div>\n <div class=\"am-pm-selector\" *ngIf=\"is12HourFormat()\">\n <label for=\"amPmSelect\">AM/PM</label>\n <select \n id=\"amPmSelect\"\n [(ngModel)]=\"selectedAmPm\"\n class=\"am-pm-select\">\n <option value=\"AM\">AM</option>\n <option value=\"PM\">PM</option>\n </select>\n </div>\n </div>\n </div>\n\n <div class=\"datepicker-container__footer\" *ngIf=\"data.dpConfig.showApplyButton || data.dpConfig.enableTime\">\n <button mis-button size=\"md\" type=\"'none'\" (click)=\"cancelDatePicker()\">Cancel</button>\n <button mis-button size=\"md\" type=\"primary\" (click)=\"applyDate()\" [disabled]=\"!(data.date || localSelectedDate.date)\">Apply</button>\n </div>\n</div>\n", styles: [".h1{font-size:40px;font-weight:400;letter-spacing:0px;line-height:48px}.h2{font-size:32px;font-weight:400;letter-spacing:0px;line-height:40px}.h3{font-size:28px;font-weight:400;letter-spacing:0px;line-height:36px}.h4{font-size:24px;font-weight:400;letter-spacing:0px;line-height:32px}.h5-b{font-size:20px;font-weight:700;letter-spacing:.25px;line-height:28px}.h5{font-size:20px;font-weight:400;letter-spacing:.15px;line-height:28px}.h6-b{font-size:16px;font-weight:700;letter-spacing:0px;line-height:24px}.h6{font-size:16px;font-weight:400;letter-spacing:0px;line-height:24px}.p{font-size:16px;font-weight:400;letter-spacing:0px;line-height:180%}.h7-b{font-size:14px;font-weight:700;letter-spacing:.25px;line-height:20px}.h7,.datepicker-container .datepicker-container__body .month,.datepicker-container .datepicker-container__body .year{font-size:14px;font-weight:400;letter-spacing:.2px;line-height:20px}.h8-b{font-size:12px;font-weight:700;letter-spacing:.25px;line-height:18px}.h8{font-size:12px;font-weight:400;letter-spacing:.2px;line-height:18px}.h9{font-size:10px;font-weight:400;letter-spacing:0px;line-height:15px}.btn-lg-b{font-size:16px;font-weight:700;letter-spacing:.5px;line-height:24px}.btn-lg{font-size:16px;font-weight:400;letter-spacing:.2px;line-height:24px}.btn-sm{font-size:14px;font-weight:400;letter-spacing:.25px;line-height:20px}.btn-link{font-size:16px;font-weight:400;letter-spacing:0px;line-height:24px}.display-1{font-size:48px;font-weight:400;letter-spacing:0px;line-height:56px}.display-2{font-size:14px;font-weight:400;letter-spacing:.5px;line-height:20px}:root{--pmry-200: #99BAF7;--pmry-100: #CBDDFB;--pmry-500: #0937B2;--pmry-400: #3C68D0;--pmry-600: #062A99;--pmry-700: #041F80;--pmry-300: #638FE7;--pmry-800: #021567;--pmry-900: #010F55;--sec-d-purple: #40447F;--sec-maroon: #6B034E;--sec-mud-red: #B23600;--sec-orange: #ED711C;--sec-purple: #815FD5;--sec-teal: #10ADAE;--sec-yellow: #D4900C;--sec-green: #547F40;--sec-bright-green: #27D22E;--sec-dark-teal: #035F6B;--sec-chocolate: #7C2F33;--sec-rube-pink: #C13D6D;--sec-cerulean: #0087B2;--sem-error: #B00020;--sem-info: #0091FF;--sem-warning: #FF9D00;--sem-success: #38AF49;--grey-bg-1: #FAFAFA;--grey-bg: #F5F5F5;--grey-seperators: #E0E0E0;--grey-disabled: #C8CDD3;--grey-hover: #F5F7FC;--grey-pressed: #E6EBF7;--grey-row: #F5F7FC;--dec-light-yellow: #F4E7C3;--dec-light-purple: #DACFF9;--dec-light-green: #E4F5E9;--dec-light-green2: #F1FFF3;--dec-light-pink: #FAE1EA;--dec-: #F4CBC1;--dec-lt-orange: #FAEFED;--dec-light-blue: #CFECF9;--dec-row-selection: #F1FDF8;--dec-row-selection2: #F2FBFF;--dec-row-lines: #D3E1E9;--text-white: #FFFFFF;--text-disabled: #929DAB;--text-muted: #6A737D;--text-black: #181F33;--MR-solid-blue2:#C8D5F6;--MR-solid-purple:#C9C3FB;--MR-solid-orange:#EEAC9F;--MR-solid-green:#ACDADA;--MR-solid-brown:#E8C8AF;--MR-solid-yellow:#FFEFC7;--MR-solid-blue:#BBE6FF;--MR-solid-pink:#FFC6F2;--tr-hover:#F0F3FA;--tr-pressed:#DAE1F3}.datepicker-container{background:#fff;border:1px solid #e0e0e0;box-shadow:0 12px 24px #0000001f,0 4px 8px #0000001f;border-radius:12px;display:flex;flex-direction:column;font-family:Lato;-webkit-user-select:none;user-select:none;box-sizing:border-box;width:290px}.datepicker-container .datepicker-container__header{display:flex;height:32px;margin:16px;justify-content:space-between;align-items:center;width:258px}.datepicker-container .datepicker-container__header span{font-size:16px;font-style:normal;font-weight:700;line-height:24px;letter-spacing:.2px;text-align:center}.datepicker-container .datepicker-container__header .month-header,.datepicker-container .datepicker-container__header .year-header{padding:8px;border-radius:10px}.datepicker-container .datepicker-container__header .month-header:hover,.datepicker-container .datepicker-container__header .year-header:hover{cursor:pointer;background-color:#e6ebf7}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon{height:20px;width:20px;display:flex;align-items:center;justify-content:center;border-radius:4px;padding:4px}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon.disabled-month{opacity:.5;cursor:not-allowed}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon:not(.disabled-month):hover{cursor:pointer;background-color:#cbddfb}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon:nth-child(1){transform:rotate(180deg)}.datepicker-container .datepicker-container__body{width:258px;height:100%;margin:0 16px 16px}.datepicker-container .datepicker-container__body .row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:10px}.datepicker-container .datepicker-container__body .month,.datepicker-container .datepicker-container__body .year{padding:10px 6px;cursor:pointer;border-radius:5px;text-align:center;background-color:#fff}.datepicker-container .datepicker-container__body .month:hover,.datepicker-container .datepicker-container__body .year:hover{background-color:#cbddfb}.datepicker-container .datepicker-container__body .disable-month,.datepicker-container .datepicker-container__body .disable-year{cursor:default;color:#c8cdd3}.datepicker-container .datepicker-container__body .disable-month:hover,.datepicker-container .datepicker-container__body .disable-year:hover{background-color:transparent}.datepicker-container .datepicker-container__body .select-month,.datepicker-container .datepicker-container__body .select-year{background-color:#0937b2;color:#fff}.datepicker-container .datepicker-container__body .select-month:hover,.datepicker-container .datepicker-container__body .select-year:hover{cursor:pointer;background-color:#cbddfb}.datepicker-container .datepicker-container__body .datepicker-container__weekdays{width:100%;display:flex;padding-bottom:10px}.datepicker-container .datepicker-container__body .datepicker-container__weekdays .datepicker-container__weekday{width:36px;height:18px;text-align:center}.datepicker-container .datepicker-container__body .datepicker-container__weekdays .datepicker-container__weekday span{font-size:12px;font-style:normal;font-weight:400;line-height:18px;letter-spacing:.2px;text-align:center;color:#c7c7c7}.datepicker-container .datepicker-container__body .datepicker-container__weekdays .datepicker-container__weekday span.current-day{font-weight:700;letter-spacing:.25px;color:#181f33}.datepicker-container .datepicker-container__body .datepicker-container__days{display:flex;flex-wrap:wrap;gap:2px}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:4px}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.selected-day{background-color:#0937b2;cursor:pointer}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.disabled-day{cursor:default}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.disabled-day:hover{background-color:transparent}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.is-valid-date:not(.disabled-day):not(.selected-day):hover{background-color:#cbddfb;cursor:pointer}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.is-valid-date:not(.disabled-day):not(.selected-day):hover span.selected-day{color:#181f33!important}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span{font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.2px;text-align:center;color:#181f33}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span.current-day{font-weight:700;letter-spacing:.25px}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span.selected-day{color:#fff}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span.disabled-day{color:#c7c7c7}.datepicker-container .datepicker-container__time{border-top:1px solid #e0e0e0;padding:16px;margin:0 16px}.datepicker-container .datepicker-container__time .time-picker-header{margin-bottom:12px}.datepicker-container .datepicker-container__time .time-picker-header span{font-size:14px;font-weight:600;color:#181f33}.datepicker-container .datepicker-container__time .time-picker-controls{display:flex;align-items:center;gap:8px}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group{display:flex;flex-direction:column;gap:4px}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group label{font-size:12px;font-weight:500;color:#6a737d}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input{width:50px;height:32px;padding:4px 8px;border:1px solid #e0e0e0;border-radius:4px;font-size:14px;text-align:center}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input:focus{outline:none;border-color:#0937b2;box-shadow:0 0 0 2px #0937b21a}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input:invalid{border-color:#dc3545;background-color:#fff5f5}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input::-webkit-inner-spin-button,.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input[type=number]{-moz-appearance:textfield}.datepicker-container .datepicker-container__time .time-picker-controls .time-separator{font-size:18px;font-weight:600;color:#181f33;margin-top:20px}.datepicker-container .datepicker-container__time .time-picker-controls .am-pm-selector{display:flex;flex-direction:column;gap:4px}.datepicker-container .datepicker-container__time .time-picker-controls .am-pm-selector label{font-size:12px;font-weight:500;color:#6a737d}.datepicker-container .datepicker-container__time .time-picker-controls .am-pm-selector .am-pm-select{width:60px;height:42px;padding:4px 8px;border:1px solid #e0e0e0;border-radius:4px;font-size:14px;background-color:#fff}.datepicker-container .datepicker-container__time .time-picker-controls .am-pm-selector .am-pm-select:focus{outline:none;border-color:#0937b2;box-shadow:0 0 0 2px #0937b21a}.datepicker-container .datepicker-container__footer{display:flex;justify-content:flex-end;gap:8px;bottom:0;align-items:center;position:sticky;padding:16px;border-top:1px solid #e0e0e0}.remove-box-shadow{box-shadow:none!important;border:none!important;border-radius:0!important}\n"] }]
|
|
933
|
+
args: [{ selector: "mis-tz-dp", template: "<div class=\"datepicker-container\" [ngClass]=\"data.disableBoxShadow?'remove-box-shadow':''\" aria-label=\"date picker\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\n <div tabindex=\"-1\" cdkFocusInitial></div>\n <div class=\"datepicker-container__header\">\n <div\n class=\"datepicker-container__arrow__icon\"\n (click)=\"navigateView('PREVIOUS')\"\n tabindex=\"0\"\n aria-label=\"Previous Month\"\n (keyup.enter)=\"navigateView('PREVIOUS')\"\n [ngClass]=\"{\n 'disabled-month': isPreviousMonthDisabled() || isSelectingMonth()\n }\"\n >\n <svg width=\"20\" height=\"16\" viewBox=\"0 0 20 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M19.7071 8.70711C20.0976 8.31658 20.0976 7.68342 19.7071 7.29289L13.3431 0.928933C12.9526 0.538409 12.3195 0.538409 11.9289 0.928933C11.5384 1.31946 11.5384 1.95262 11.9289 2.34315L17.5858 8L11.9289 13.6569C11.5384 14.0474 11.5384 14.6805 11.9289 15.0711C12.3195 15.4616 12.9526 15.4616 13.3431 15.0711L19.7071 8.70711ZM-8.74228e-08 9L19 9L19 7L8.74228e-08 7L-8.74228e-08 9Z\"\n fill=\"#181F33\"\n ></path>\n </svg>\n </div>\n\n <div *ngIf=\"!isSelectingYear()\" (click)=\"toggleMonthSelector()\" class=\"month-header\">\n {{ isYearSelectionFlow() ? selectedYear() : availableMonths()[currentMonthNumber()] }}\n </div>\n <div *ngIf=\"!isSelectingMonth()\" (click)=\"toggleYearSelector()\" class=\"year-header\">\n {{ isSelectingYear() ? yearRange : currentYearNumber() }}\n </div>\n\n\n <div\n class=\"datepicker-container__arrow__icon\"\n (click)=\"navigateView('NEXT')\"\n tabindex=\"0\"\n aria-label=\"Next Month\"\n (keyup.enter)=\"navigateView('NEXT')\"\n [ngClass]=\"{\n 'disabled-month': isNextMonthDisabled() || isSelectingMonth()\n }\"\n >\n <svg width=\"20\" height=\"16\" viewBox=\"0 0 20 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M19.7071 8.70711C20.0976 8.31658 20.0976 7.68342 19.7071 7.29289L13.3431 0.928933C12.9526 0.538409 12.3195 0.538409 11.9289 0.928933C11.5384 1.31946 11.5384 1.95262 11.9289 2.34315L17.5858 8L11.9289 13.6569C11.5384 14.0474 11.5384 14.6805 11.9289 15.0711C12.3195 15.4616 12.9526 15.4616 13.3431 15.0711L19.7071 8.70711ZM-8.74228e-08 9L19 9L19 7L8.74228e-08 7L-8.74228e-08 9Z\"\n fill=\"#181F33\"\n ></path>\n </svg>\n </div>\n </div>\n <div class=\"datepicker-container__body\">\n\n <div *ngIf=\"isSelectingMonth() && !isSelectingYear()\" class=\"month-selector\">\n <div class=\"row\">\n <div *ngFor=\"let month of availableMonths(); let i = index\" \n class=\"month\" \n (click)=\"!disabledMonths()[i] && selectMonth(month)\" \n [ngClass]=\"{\n 'disable-month': disabledMonths()[i],\n 'select-month': !disabledMonths()[currentMonthNumber()] && month === availableMonths()[currentMonthNumber()]\n }\">\n {{ month }}\n </div>\n </div>\n </div>\n \n <div *ngIf=\"isSelectingYear() && !isSelectingMonth()\" class=\"year-selector\">\n <div class=\"row\">\n <div *ngFor=\"let year of availableYears(); let i = index\" \n class=\"year\" \n (click)=\"!disabledYears()[i] && selectYear(year)\" \n [ngClass]=\"{\n 'disable-year': disabledYears()[i],\n 'select-year': year === currentYearNumber()\n }\">\n {{ year }}\n </div>\n </div>\n </div>\n\n <div *ngIf=\"!isSelectingMonth() && !isSelectingYear()\" class=\"datepicker-container__weekdays\">\n <div class=\"datepicker-container__weekday\" *ngFor=\"let weekDay of weekDays()\">\n <span [ngClass]=\"{ 'current-day': weekDay.isCurrentDay }\">{{ weekDay.label }}</span>\n </div>\n </div>\n <div *ngIf=\"!isSelectingMonth() && !isSelectingYear()\" class=\"datepicker-container__days\">\n <div\n class=\"datepicker-container__day\"\n [ngClass]=\"{\n 'selected-day': day.isSelectedDay,\n 'disabled-day': day.isDisabledDay,\n 'is-valid-date': day.date > 0 && !day.isSelectedDay\n }\"\n *ngFor=\"let day of currentMonthDates()\"\n (click)=\"selectDay(day)\"\n (keyup.enter)=\"selectDay(day)\"\n >\n <span\n *ngIf=\"day.date > 0\"\n [tabindex]=\"day.isDisabledDay ? -1 : 0\"\n [ngClass]=\"{\n 'current-day': day.isCurrentDay,\n 'selected-day': day.isSelectedDay,\n 'disabled-day': day.isDisabledDay\n }\"\n [attr.aria-label]=\"retractDayMonth(day.date, currentMonth(), currentYearNumber())\"\n >\n {{ day.date }}\n </span>\n </div>\n </div>\n </div>\n\n <!-- Time Picker Section -->\n <div class=\"datepicker-container__time\" *ngIf=\"data.dpConfig.enableTime === true\">\n <div class=\"time-picker-header\">\n <span>Time</span>\n </div>\n <div class=\"time-picker-controls\">\n <div class=\"time-input-group\">\n <label for=\"hourInput\">Hour</label>\n <input \n id=\"hourInput\"\n type=\"number\" \n [min]=\"is12HourFormat() ? 1 : 0\"\n [max]=\"is12HourFormat() ? 12 : 23\"\n [step]=\"1\"\n [ngModel]=\"selectedHour()\"\n (ngModelChange)=\"selectedHourSignal.set($event)\"\n (input)=\"onHourInput($event)\"\n (blur)=\"validateHourInput()\"\n class=\"time-input\"\n [title]=\"is12HourFormat() ? 'Enter hour (1-12)' : 'Enter hour (0-23)'\">\n </div>\n <div class=\"time-separator\">:</div>\n <div class=\"time-input-group\">\n <label for=\"minuteInput\">Minute</label>\n <input \n id=\"minuteInput\"\n type=\"number\" \n min=\"0\" \n max=\"59\"\n [step]=\"1\"\n [ngModel]=\"selectedMinute()\"\n (ngModelChange)=\"selectedMinuteSignal.set($event)\"\n (input)=\"onMinuteInput($event)\"\n (blur)=\"validateMinuteInput()\"\n class=\"time-input\"\n title=\"Enter minute (0-59)\">\n </div>\n <div class=\"am-pm-selector\" *ngIf=\"is12HourFormat()\">\n <label for=\"amPmSelect\">AM/PM</label>\n <select \n id=\"amPmSelect\"\n [ngModel]=\"selectedAmPm()\"\n (ngModelChange)=\"selectedAmPmSignal.set($event)\"\n class=\"am-pm-select\">\n <option value=\"AM\">AM</option>\n <option value=\"PM\">PM</option>\n </select>\n </div>\n </div>\n </div>\n\n <div class=\"datepicker-container__footer\" *ngIf=\"data.dpConfig.showApplyButton || data.dpConfig.enableTime\">\n <button mis-button size=\"md\" type=\"'none'\" (click)=\"cancelDatePicker()\">Cancel</button>\n <button mis-button size=\"md\" type=\"primary\" (click)=\"applyDate()\" [disabled]=\"!(data.date || localSelectedDate()?.date)\">Apply</button>\n </div>\n</div>\n", styles: [".h1{font-size:40px;font-weight:400;letter-spacing:0px;line-height:48px}.h2{font-size:32px;font-weight:400;letter-spacing:0px;line-height:40px}.h3{font-size:28px;font-weight:400;letter-spacing:0px;line-height:36px}.h4{font-size:24px;font-weight:400;letter-spacing:0px;line-height:32px}.h5-b{font-size:20px;font-weight:700;letter-spacing:.25px;line-height:28px}.h5{font-size:20px;font-weight:400;letter-spacing:.15px;line-height:28px}.h6-b{font-size:16px;font-weight:700;letter-spacing:0px;line-height:24px}.h6{font-size:16px;font-weight:400;letter-spacing:0px;line-height:24px}.p{font-size:16px;font-weight:400;letter-spacing:0px;line-height:180%}.h7-b{font-size:14px;font-weight:700;letter-spacing:.25px;line-height:20px}.h7,.datepicker-container .datepicker-container__body .month,.datepicker-container .datepicker-container__body .year{font-size:14px;font-weight:400;letter-spacing:.2px;line-height:20px}.h8-b{font-size:12px;font-weight:700;letter-spacing:.25px;line-height:18px}.h8{font-size:12px;font-weight:400;letter-spacing:.2px;line-height:18px}.h9{font-size:10px;font-weight:400;letter-spacing:0px;line-height:15px}.btn-lg-b{font-size:16px;font-weight:700;letter-spacing:.5px;line-height:24px}.btn-lg{font-size:16px;font-weight:400;letter-spacing:.2px;line-height:24px}.btn-sm{font-size:14px;font-weight:400;letter-spacing:.25px;line-height:20px}.btn-link{font-size:16px;font-weight:400;letter-spacing:0px;line-height:24px}.display-1{font-size:48px;font-weight:400;letter-spacing:0px;line-height:56px}.display-2{font-size:14px;font-weight:400;letter-spacing:.5px;line-height:20px}:root{--pmry-200: #99BAF7;--pmry-100: #CBDDFB;--pmry-500: #0937B2;--pmry-400: #3C68D0;--pmry-600: #062A99;--pmry-700: #041F80;--pmry-300: #638FE7;--pmry-800: #021567;--pmry-900: #010F55;--sec-d-purple: #40447F;--sec-maroon: #6B034E;--sec-mud-red: #B23600;--sec-orange: #ED711C;--sec-purple: #815FD5;--sec-teal: #10ADAE;--sec-yellow: #D4900C;--sec-green: #547F40;--sec-bright-green: #27D22E;--sec-dark-teal: #035F6B;--sec-chocolate: #7C2F33;--sec-rube-pink: #C13D6D;--sec-cerulean: #0087B2;--sem-error: #B00020;--sem-info: #0091FF;--sem-warning: #FF9D00;--sem-success: #38AF49;--grey-bg-1: #FAFAFA;--grey-bg: #F5F5F5;--grey-seperators: #E0E0E0;--grey-disabled: #C8CDD3;--grey-hover: #F5F7FC;--grey-pressed: #E6EBF7;--grey-row: #F5F7FC;--dec-light-yellow: #F4E7C3;--dec-light-purple: #DACFF9;--dec-light-green: #E4F5E9;--dec-light-green2: #F1FFF3;--dec-light-pink: #FAE1EA;--dec-: #F4CBC1;--dec-lt-orange: #FAEFED;--dec-light-blue: #CFECF9;--dec-row-selection: #F1FDF8;--dec-row-selection2: #F2FBFF;--dec-row-lines: #D3E1E9;--text-white: #FFFFFF;--text-disabled: #929DAB;--text-muted: #6A737D;--text-black: #181F33;--MR-solid-blue2:#C8D5F6;--MR-solid-purple:#C9C3FB;--MR-solid-orange:#EEAC9F;--MR-solid-green:#ACDADA;--MR-solid-brown:#E8C8AF;--MR-solid-yellow:#FFEFC7;--MR-solid-blue:#BBE6FF;--MR-solid-pink:#FFC6F2;--tr-hover:#F0F3FA;--tr-pressed:#DAE1F3}.datepicker-container{background:#fff;border:1px solid #e0e0e0;box-shadow:0 12px 24px #0000001f,0 4px 8px #0000001f;border-radius:12px;display:flex;flex-direction:column;font-family:Lato;-webkit-user-select:none;user-select:none;box-sizing:border-box;width:290px}.datepicker-container .datepicker-container__header{display:flex;height:32px;margin:16px;justify-content:space-between;align-items:center;width:258px}.datepicker-container .datepicker-container__header span{font-size:16px;font-style:normal;font-weight:700;line-height:24px;letter-spacing:.2px;text-align:center}.datepicker-container .datepicker-container__header .month-header,.datepicker-container .datepicker-container__header .year-header{padding:8px;border-radius:10px}.datepicker-container .datepicker-container__header .month-header:hover,.datepicker-container .datepicker-container__header .year-header:hover{cursor:pointer;background-color:#e6ebf7}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon{height:20px;width:20px;display:flex;align-items:center;justify-content:center;border-radius:4px;padding:4px}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon.disabled-month{opacity:.5;cursor:not-allowed}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon:not(.disabled-month):hover{cursor:pointer;background-color:#cbddfb}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon:nth-child(1){transform:rotate(180deg)}.datepicker-container .datepicker-container__body{width:258px;height:100%;margin:0 16px 16px}.datepicker-container .datepicker-container__body .row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:10px}.datepicker-container .datepicker-container__body .month,.datepicker-container .datepicker-container__body .year{padding:10px 6px;cursor:pointer;border-radius:5px;text-align:center;background-color:#fff}.datepicker-container .datepicker-container__body .month:hover,.datepicker-container .datepicker-container__body .year:hover{background-color:#cbddfb}.datepicker-container .datepicker-container__body .disable-month,.datepicker-container .datepicker-container__body .disable-year{cursor:default;color:#c8cdd3}.datepicker-container .datepicker-container__body .disable-month:hover,.datepicker-container .datepicker-container__body .disable-year:hover{background-color:transparent}.datepicker-container .datepicker-container__body .select-month,.datepicker-container .datepicker-container__body .select-year{background-color:#0937b2;color:#fff}.datepicker-container .datepicker-container__body .select-month:hover,.datepicker-container .datepicker-container__body .select-year:hover{cursor:pointer;background-color:#cbddfb}.datepicker-container .datepicker-container__body .datepicker-container__weekdays{width:100%;display:flex;padding-bottom:10px}.datepicker-container .datepicker-container__body .datepicker-container__weekdays .datepicker-container__weekday{width:36px;height:18px;text-align:center}.datepicker-container .datepicker-container__body .datepicker-container__weekdays .datepicker-container__weekday span{font-size:12px;font-style:normal;font-weight:400;line-height:18px;letter-spacing:.2px;text-align:center;color:#c7c7c7}.datepicker-container .datepicker-container__body .datepicker-container__weekdays .datepicker-container__weekday span.current-day{font-weight:700;letter-spacing:.25px;color:#181f33}.datepicker-container .datepicker-container__body .datepicker-container__days{display:flex;flex-wrap:wrap;gap:2px}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:4px}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.selected-day{background-color:#0937b2;cursor:pointer}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.disabled-day{cursor:default}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.disabled-day:hover{background-color:transparent}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.is-valid-date:not(.disabled-day):not(.selected-day):hover{background-color:#cbddfb;cursor:pointer}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.is-valid-date:not(.disabled-day):not(.selected-day):hover span.selected-day{color:#181f33!important}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span{font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.2px;text-align:center;color:#181f33}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span.current-day{font-weight:700;letter-spacing:.25px}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span.selected-day{color:#fff}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span.disabled-day{color:#c7c7c7}.datepicker-container .datepicker-container__time{border-top:1px solid #e0e0e0;padding:16px;margin:0 16px}.datepicker-container .datepicker-container__time .time-picker-header{margin-bottom:12px}.datepicker-container .datepicker-container__time .time-picker-header span{font-size:14px;font-weight:600;color:#181f33}.datepicker-container .datepicker-container__time .time-picker-controls{display:flex;align-items:center;gap:8px}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group{display:flex;flex-direction:column;gap:4px}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group label{font-size:12px;font-weight:500;color:#6a737d}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input{width:50px;height:32px;padding:4px 8px;border:1px solid #e0e0e0;border-radius:4px;font-size:14px;text-align:center}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input:focus{outline:none;border-color:#0937b2;box-shadow:0 0 0 2px #0937b21a}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input:invalid{border-color:#dc3545;background-color:#fff5f5}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input::-webkit-inner-spin-button,.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.datepicker-container .datepicker-container__time .time-picker-controls .time-input-group .time-input[type=number]{-moz-appearance:textfield}.datepicker-container .datepicker-container__time .time-picker-controls .time-separator{font-size:18px;font-weight:600;color:#181f33;margin-top:20px}.datepicker-container .datepicker-container__time .time-picker-controls .am-pm-selector{display:flex;flex-direction:column;gap:4px}.datepicker-container .datepicker-container__time .time-picker-controls .am-pm-selector label{font-size:12px;font-weight:500;color:#6a737d}.datepicker-container .datepicker-container__time .time-picker-controls .am-pm-selector .am-pm-select{width:60px;height:42px;padding:4px 8px;border:1px solid #e0e0e0;border-radius:4px;font-size:14px;background-color:#fff}.datepicker-container .datepicker-container__time .time-picker-controls .am-pm-selector .am-pm-select:focus{outline:none;border-color:#0937b2;box-shadow:0 0 0 2px #0937b21a}.datepicker-container .datepicker-container__footer{display:flex;justify-content:flex-end;gap:8px;bottom:0;align-items:center;position:sticky;padding:16px;border-top:1px solid #e0e0e0}.remove-box-shadow{box-shadow:none!important;border:none!important;border-radius:0!important}\n"] }]
|
|
903
934
|
}], () => [{ type: undefined, decorators: [{
|
|
904
935
|
type: Inject,
|
|
905
936
|
args: [CONTAINER_DATA]
|
|
@@ -910,39 +941,37 @@ class TzDpContainerComponent {
|
|
|
910
941
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TzDpContainerComponent, { className: "TzDpContainerComponent" }); })();
|
|
911
942
|
|
|
912
943
|
class TzDatepickerDirective {
|
|
913
|
-
// dd-mm-yyyy 01-12-2022
|
|
914
|
-
set selectedDate(date) {
|
|
915
|
-
this.date = date;
|
|
916
|
-
}
|
|
917
|
-
set datesDisabled(dates) {
|
|
918
|
-
this.dpDisabledDates = dates;
|
|
919
|
-
}
|
|
920
944
|
constructor(control, element, overlay, viewContainerRef) {
|
|
921
945
|
this.control = control;
|
|
922
946
|
this.element = element;
|
|
923
947
|
this.overlay = overlay;
|
|
924
948
|
this.viewContainerRef = viewContainerRef;
|
|
925
|
-
|
|
926
|
-
this.
|
|
927
|
-
this.
|
|
928
|
-
this.
|
|
929
|
-
this.
|
|
930
|
-
this.
|
|
931
|
-
this.
|
|
932
|
-
|
|
933
|
-
this.
|
|
934
|
-
this.
|
|
935
|
-
this.
|
|
949
|
+
// Signal-based inputs
|
|
950
|
+
this.dpConfig = input();
|
|
951
|
+
this.selectedDate = input('');
|
|
952
|
+
this.datesDisabled = input([]);
|
|
953
|
+
this.dateMessages = input([]);
|
|
954
|
+
this.positionX = input("center");
|
|
955
|
+
this.positionY = input("bottom");
|
|
956
|
+
this.offsetX = input(0);
|
|
957
|
+
this.offsetY = input(0);
|
|
958
|
+
this.allowBookingOnDisabledDay = input(false);
|
|
959
|
+
this.disableBoxShadow = input(false);
|
|
960
|
+
this.disableOverLay = input(false);
|
|
961
|
+
this.openElement = input(false);
|
|
962
|
+
// Signal-based output
|
|
963
|
+
this.dateChange = output();
|
|
936
964
|
this.isOpen = false;
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
965
|
+
// Effect to watch openElement signal changes
|
|
966
|
+
effect(() => {
|
|
967
|
+
const openElement = this.openElement();
|
|
968
|
+
if (openElement) {
|
|
969
|
+
this.open();
|
|
970
|
+
}
|
|
971
|
+
else {
|
|
972
|
+
this.close();
|
|
973
|
+
}
|
|
974
|
+
});
|
|
946
975
|
}
|
|
947
976
|
ngOnInit() { }
|
|
948
977
|
toggleDatePicker() {
|
|
@@ -967,26 +996,26 @@ class TzDatepickerDirective {
|
|
|
967
996
|
}
|
|
968
997
|
}
|
|
969
998
|
open() {
|
|
970
|
-
|
|
999
|
+
const dpConfig = {
|
|
971
1000
|
format: DATE_FORMAT,
|
|
972
1001
|
minDate: "",
|
|
973
1002
|
maxDate: "",
|
|
974
1003
|
showApplyButton: false,
|
|
975
|
-
...this.dpConfig
|
|
1004
|
+
...this.dpConfig()
|
|
976
1005
|
};
|
|
977
1006
|
this.isOpen = true;
|
|
978
1007
|
const positionStrategy = this.overlay
|
|
979
1008
|
.position()
|
|
980
1009
|
.flexibleConnectedTo(this.element)
|
|
981
1010
|
.withPositions(genPositionPairs({
|
|
982
|
-
positionX: this.positionX,
|
|
983
|
-
positionY: this.positionY,
|
|
984
|
-
offsetX: this.offsetX,
|
|
985
|
-
offsetY: this.offsetY
|
|
1011
|
+
positionX: this.positionX(),
|
|
1012
|
+
positionY: this.positionY(),
|
|
1013
|
+
offsetX: this.offsetX(),
|
|
1014
|
+
offsetY: this.offsetY()
|
|
986
1015
|
}, true))
|
|
987
1016
|
.withPush(true);
|
|
988
1017
|
const config = new OverlayConfig({
|
|
989
|
-
hasBackdrop: !this.disableOverLay,
|
|
1018
|
+
hasBackdrop: !this.disableOverLay(),
|
|
990
1019
|
positionStrategy,
|
|
991
1020
|
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
992
1021
|
backdropClass: "cdk-overlay-transparent-backdrop"
|
|
@@ -997,13 +1026,13 @@ class TzDatepickerDirective {
|
|
|
997
1026
|
{
|
|
998
1027
|
provide: CONTAINER_DATA,
|
|
999
1028
|
useValue: {
|
|
1000
|
-
messages: this.dateMessages,
|
|
1001
|
-
date: this.control?.control.value || this.
|
|
1002
|
-
allowBookingOnDisabledDay: this.allowBookingOnDisabledDay,
|
|
1003
|
-
dpConfig:
|
|
1004
|
-
datesDisabled: this.
|
|
1029
|
+
messages: this.dateMessages(),
|
|
1030
|
+
date: this.control?.control.value || this.selectedDate(),
|
|
1031
|
+
allowBookingOnDisabledDay: this.allowBookingOnDisabledDay(),
|
|
1032
|
+
dpConfig: dpConfig,
|
|
1033
|
+
datesDisabled: this.datesDisabled(),
|
|
1005
1034
|
dateChange: this.applyDate.bind(this),
|
|
1006
|
-
disableBoxShadow: this.disableBoxShadow,
|
|
1035
|
+
disableBoxShadow: this.disableBoxShadow(),
|
|
1007
1036
|
}
|
|
1008
1037
|
}
|
|
1009
1038
|
]
|
|
@@ -1023,7 +1052,6 @@ class TzDatepickerDirective {
|
|
|
1023
1052
|
}
|
|
1024
1053
|
this.dateChange.emit(date);
|
|
1025
1054
|
this.control?.control.patchValue(date);
|
|
1026
|
-
this.date = date;
|
|
1027
1055
|
this.close();
|
|
1028
1056
|
}
|
|
1029
1057
|
close() {
|
|
@@ -1034,7 +1062,7 @@ class TzDatepickerDirective {
|
|
|
1034
1062
|
static { this.ɵfac = function TzDatepickerDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TzDatepickerDirective)(i0.ɵɵdirectiveInject(i3.NgControl, 10), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i2$1.Overlay), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); }; }
|
|
1035
1063
|
static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: TzDatepickerDirective, selectors: [["input", "misTzDp", ""]], hostBindings: function TzDatepickerDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
1036
1064
|
i0.ɵɵlistener("click", function TzDatepickerDirective_click_HostBindingHandler() { return ctx.toggleDatePicker(); })("keydown.enter", function TzDatepickerDirective_keydown_enter_HostBindingHandler() { return ctx.toggleDatePickerOnEnter(); })("keydown.esc", function TzDatepickerDirective_keydown_esc_HostBindingHandler() { return ctx.closeOnEsc(); });
|
|
1037
|
-
} }, inputs: { dpConfig: "dpConfig", selectedDate: "selectedDate", datesDisabled: "datesDisabled", dateMessages: "dateMessages", positionX: "positionX", positionY: "positionY", offsetX: "offsetX", offsetY: "offsetY", allowBookingOnDisabledDay: "allowBookingOnDisabledDay", disableBoxShadow: "disableBoxShadow", disableOverLay: "disableOverLay", openElement: "openElement" }, outputs: { dateChange: "dateChange" }
|
|
1065
|
+
} }, inputs: { dpConfig: [1, "dpConfig"], selectedDate: [1, "selectedDate"], datesDisabled: [1, "datesDisabled"], dateMessages: [1, "dateMessages"], positionX: [1, "positionX"], positionY: [1, "positionY"], offsetX: [1, "offsetX"], offsetY: [1, "offsetY"], allowBookingOnDisabledDay: [1, "allowBookingOnDisabledDay"], disableBoxShadow: [1, "disableBoxShadow"], disableOverLay: [1, "disableOverLay"], openElement: [1, "openElement"] }, outputs: { dateChange: "dateChange" } }); }
|
|
1038
1066
|
}
|
|
1039
1067
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TzDatepickerDirective, [{
|
|
1040
1068
|
type: Directive,
|
|
@@ -1045,33 +1073,7 @@ class TzDatepickerDirective {
|
|
|
1045
1073
|
type: Self
|
|
1046
1074
|
}, {
|
|
1047
1075
|
type: Optional
|
|
1048
|
-
}] }, { type: i0.ElementRef }, { type: i2$1.Overlay }, { type: i0.ViewContainerRef }], {
|
|
1049
|
-
type: Input
|
|
1050
|
-
}], selectedDate: [{
|
|
1051
|
-
type: Input
|
|
1052
|
-
}], datesDisabled: [{
|
|
1053
|
-
type: Input
|
|
1054
|
-
}], dateMessages: [{
|
|
1055
|
-
type: Input
|
|
1056
|
-
}], positionX: [{
|
|
1057
|
-
type: Input
|
|
1058
|
-
}], positionY: [{
|
|
1059
|
-
type: Input
|
|
1060
|
-
}], offsetX: [{
|
|
1061
|
-
type: Input
|
|
1062
|
-
}], offsetY: [{
|
|
1063
|
-
type: Input
|
|
1064
|
-
}], allowBookingOnDisabledDay: [{
|
|
1065
|
-
type: Input
|
|
1066
|
-
}], dateChange: [{
|
|
1067
|
-
type: Output
|
|
1068
|
-
}], disableBoxShadow: [{
|
|
1069
|
-
type: Input
|
|
1070
|
-
}], disableOverLay: [{
|
|
1071
|
-
type: Input
|
|
1072
|
-
}], openElement: [{
|
|
1073
|
-
type: Input
|
|
1074
|
-
}], toggleDatePicker: [{
|
|
1076
|
+
}] }, { type: i0.ElementRef }, { type: i2$1.Overlay }, { type: i0.ViewContainerRef }], { toggleDatePicker: [{
|
|
1075
1077
|
type: HostListener,
|
|
1076
1078
|
args: ["click"]
|
|
1077
1079
|
}], toggleDatePickerOnEnter: [{
|