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 { EventEmitter, Directive, Input, Output, Component, ViewChild, ViewChildren, NgModule } from '@angular/core';
|
|
2
|
+
import { EventEmitter, Directive, Input, Output, signal, input, output, effect, untracked, Component, ViewChild, ViewChildren, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/cdk/overlay';
|
|
4
4
|
import { ConnectionPositionPair, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
5
5
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
@@ -17,8 +17,9 @@ import { FormsModule } from '@angular/forms';
|
|
|
17
17
|
class TimepickerDirective {
|
|
18
18
|
set createOverlayOnInput(openStatus) {
|
|
19
19
|
this.openStatus = openStatus;
|
|
20
|
-
if (this.originEl && this.openStatus)
|
|
20
|
+
if (this.originEl && this.openStatus) {
|
|
21
21
|
this.createOverlay(this.originEl);
|
|
22
|
+
}
|
|
22
23
|
}
|
|
23
24
|
;
|
|
24
25
|
constructor(templateRef, overlay, viewContainerRef) {
|
|
@@ -98,11 +99,11 @@ function TimePickerComponent_ng_template_3_div_0_li_3_Template(rf, ctx) { if (rf
|
|
|
98
99
|
const interval_r3 = ctx.$implicit;
|
|
99
100
|
const i_r5 = ctx.index;
|
|
100
101
|
const ctx_r3 = i0.ɵɵnextContext(3);
|
|
101
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c6, i_r5 === ctx_r3.isHighlighted));
|
|
102
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c6, i_r5 === ctx_r3.isHighlighted()));
|
|
102
103
|
i0.ɵɵadvance(2);
|
|
103
104
|
i0.ɵɵtextInterpolate1(" ", interval_r3, " ");
|
|
104
105
|
i0.ɵɵadvance();
|
|
105
|
-
i0.ɵɵproperty("ngIf", interval_r3 === ctx_r3.chosenTime);
|
|
106
|
+
i0.ɵɵproperty("ngIf", interval_r3 === ctx_r3.chosenTime());
|
|
106
107
|
} }
|
|
107
108
|
function TimePickerComponent_ng_template_3_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
108
109
|
i0.ɵɵelementStart(0, "div", 8)(1, "ul", null, 2);
|
|
@@ -110,15 +111,15 @@ function TimePickerComponent_ng_template_3_div_0_Template(rf, ctx) { if (rf & 1)
|
|
|
110
111
|
i0.ɵɵelementEnd()();
|
|
111
112
|
} if (rf & 2) {
|
|
112
113
|
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
113
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c5, ctx_r3.dropdownWidth || ctx_r3.inputWidth));
|
|
114
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c5, ctx_r3.dropdownWidth() || ctx_r3.inputWidth()));
|
|
114
115
|
i0.ɵɵadvance(3);
|
|
115
|
-
i0.ɵɵproperty("ngForOf", ctx_r3.timeIntervals);
|
|
116
|
+
i0.ɵɵproperty("ngForOf", ctx_r3.timeIntervals());
|
|
116
117
|
} }
|
|
117
118
|
function TimePickerComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
|
|
118
119
|
i0.ɵɵtemplate(0, TimePickerComponent_ng_template_3_div_0_Template, 4, 4, "div", 7);
|
|
119
120
|
} if (rf & 2) {
|
|
120
121
|
const ctx_r3 = i0.ɵɵnextContext();
|
|
121
|
-
i0.ɵɵproperty("ngIf", ctx_r3.openStatus);
|
|
122
|
+
i0.ɵɵproperty("ngIf", ctx_r3.openStatus());
|
|
122
123
|
} }
|
|
123
124
|
dayjs.extend(utc);
|
|
124
125
|
dayjs.extend(timezone);
|
|
@@ -134,64 +135,152 @@ class TimePickerComponent {
|
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
137
|
constructor() {
|
|
137
|
-
|
|
138
|
-
this.
|
|
139
|
-
this.
|
|
140
|
-
this.
|
|
141
|
-
this.
|
|
142
|
-
this.
|
|
143
|
-
this.
|
|
144
|
-
this.
|
|
145
|
-
this.
|
|
146
|
-
this.
|
|
147
|
-
|
|
148
|
-
this.
|
|
149
|
-
this.
|
|
150
|
-
this.
|
|
151
|
-
this.
|
|
152
|
-
this.
|
|
153
|
-
this.
|
|
154
|
-
this.
|
|
155
|
-
this.
|
|
138
|
+
// Convert to signals for better performance and change detection
|
|
139
|
+
this.currTime = signal('');
|
|
140
|
+
this.chosenTime = signal('');
|
|
141
|
+
this.openStatus = signal(false);
|
|
142
|
+
this.isHighlighted = signal(0);
|
|
143
|
+
this.isInvalid = signal(false);
|
|
144
|
+
this.timeIntervals = signal([]);
|
|
145
|
+
this.shouldScroll = signal(false);
|
|
146
|
+
this.userInputFlag = signal(false);
|
|
147
|
+
this.givenTimeFlag = signal(true);
|
|
148
|
+
// Signal-based inputs with backward compatibility
|
|
149
|
+
this.clockFormat = input(12);
|
|
150
|
+
this.timezone = input("Asia/Kolkata");
|
|
151
|
+
this.height = input("max-content");
|
|
152
|
+
this.inputWidth = input("100px");
|
|
153
|
+
this.dropdownWidth = input(undefined);
|
|
154
|
+
this.interval = input(15);
|
|
155
|
+
this.dateAsEpoch = input(dayjs.tz(dayjs(), "Asia/Kolkata").valueOf());
|
|
156
|
+
this.firstInterval = input();
|
|
157
|
+
this.rangeValidity = input(true);
|
|
158
|
+
this.showTooltip = input(true);
|
|
159
|
+
this.dispayToolTip = this.showTooltip();
|
|
160
|
+
this.givenTime = input();
|
|
161
|
+
this.minTime = input(undefined);
|
|
162
|
+
this.triggerChange = input(true);
|
|
163
|
+
this.disable = input(false);
|
|
164
|
+
// Internal state for computed first interval
|
|
165
|
+
this.computedFirstInterval = null;
|
|
166
|
+
this._isInitializing = false;
|
|
167
|
+
// Signal-based output with backward compatibility
|
|
168
|
+
this.timeEmitter = output();
|
|
169
|
+
// Effect to handle triggerChange from parent component (timerangepicker)
|
|
170
|
+
effect(() => {
|
|
171
|
+
const triggerValue = this.triggerChange();
|
|
172
|
+
const firstIntervalValue = this.firstInterval();
|
|
173
|
+
// Only update if not during user input and firstInterval is provided
|
|
174
|
+
if (!untracked(() => this.userInputFlag()) && firstIntervalValue && !this._isInitializing) {
|
|
175
|
+
const newTime = dayjs.tz(firstIntervalValue, untracked(() => this.timezone())).format(this.timeFormat);
|
|
176
|
+
// Only update if the time actually changed
|
|
177
|
+
if (untracked(() => this.chosenTime()) !== newTime) {
|
|
178
|
+
// Use setTimeout to defer signal writes and avoid circular dependencies
|
|
179
|
+
setTimeout(() => {
|
|
180
|
+
this.chosenTime.set(newTime);
|
|
181
|
+
this.isInvalid.set(!this.checkTimeValidity(newTime.trim()));
|
|
182
|
+
// CRITICAL FIX: Repopulate dropdown when firstInterval changes
|
|
183
|
+
this.populateDropdown();
|
|
184
|
+
// Recalculate closest interval
|
|
185
|
+
this.calculateClosestInterval(newTime);
|
|
186
|
+
// Emit the updated time
|
|
187
|
+
const timedayjs = this.getdayjs(newTime);
|
|
188
|
+
this.emitTime({
|
|
189
|
+
valid: !this.isInvalid(),
|
|
190
|
+
time: newTime,
|
|
191
|
+
epoch: timedayjs.valueOf()
|
|
192
|
+
});
|
|
193
|
+
}, 0);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
});
|
|
156
197
|
}
|
|
157
198
|
ngOnInit() {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
ngOnChanges() {
|
|
169
|
-
this.timeFormat = this.clockFormat === 12 ? "hh:mm a" : "HH:mm";
|
|
170
|
-
if (this.timeFormat) {
|
|
171
|
-
let chosenTimedayjs = this.getdayjs(this.chosenTime);
|
|
172
|
-
// if the first interval is >= the chosen time
|
|
173
|
-
// then only update the value of chosen time
|
|
174
|
-
// else it remains the same
|
|
175
|
-
if (this.firstInterval >= chosenTimedayjs.valueOf() && this.rangeValidity && !this.userInputFlag) {
|
|
176
|
-
this.chosenTime = dayjs.tz(this.firstInterval, this.timezone).format(this.timeFormat);
|
|
177
|
-
chosenTimedayjs = this.getdayjs(this.chosenTime);
|
|
199
|
+
this._isInitializing = true;
|
|
200
|
+
// Ensure timeFormat is set before initialization
|
|
201
|
+
this.timeFormat = this.clockFormat() === 12 ? "hh:mm a" : "HH:mm";
|
|
202
|
+
// Initialize chosenTime - use firstInterval from parent if available, otherwise calculate
|
|
203
|
+
if (!this.givenTime() && !this.minTime()) {
|
|
204
|
+
let initialTime;
|
|
205
|
+
// If firstInterval is provided by parent (timerangepicker), use it
|
|
206
|
+
if (this.firstInterval()) {
|
|
207
|
+
initialTime = dayjs.tz(this.firstInterval(), this.timezone()).format(this.timeFormat);
|
|
178
208
|
}
|
|
179
|
-
|
|
180
|
-
|
|
209
|
+
else {
|
|
210
|
+
// Get current time and round to nearest interval using original logic
|
|
211
|
+
const now = dayjs.tz(dayjs(), this.timezone());
|
|
212
|
+
const interval = this.interval();
|
|
213
|
+
const minutes = now.minute();
|
|
214
|
+
const offset = interval - (minutes % interval);
|
|
215
|
+
// Round to next interval if we're past halfway point
|
|
216
|
+
const roundedTime = offset >= interval / 2
|
|
217
|
+
? now.add(offset, "m").second(0).millisecond(0)
|
|
218
|
+
: now.subtract(interval - offset, "m").second(0).millisecond(0);
|
|
219
|
+
initialTime = roundedTime.format(this.timeFormat);
|
|
181
220
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
221
|
+
this.chosenTime.set(initialTime);
|
|
222
|
+
// Set userInputFlag to false to avoid validation issues during initialization
|
|
223
|
+
this.userInputFlag.set(false);
|
|
224
|
+
// Populate dropdown first to compute the first interval
|
|
225
|
+
this.populateDropdown();
|
|
226
|
+
// Now validate with the computed first interval
|
|
227
|
+
this.isInvalid.set(!this.checkTimeValidity(this.chosenTime().trim()));
|
|
228
|
+
let chosenTimedayjs = this.getdayjs(this.chosenTime());
|
|
229
|
+
// Defer emission to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
230
|
+
setTimeout(() => {
|
|
188
231
|
this.emitTime({
|
|
189
|
-
valid: !this.isInvalid,
|
|
190
|
-
time: this.chosenTime,
|
|
232
|
+
valid: !this.isInvalid(),
|
|
233
|
+
time: this.chosenTime(),
|
|
191
234
|
epoch: chosenTimedayjs.valueOf()
|
|
192
235
|
});
|
|
193
|
-
|
|
194
|
-
|
|
236
|
+
}, 0);
|
|
237
|
+
// Calculate closest interval
|
|
238
|
+
this.calculateClosestInterval(this.chosenTime());
|
|
239
|
+
this._isInitializing = false;
|
|
240
|
+
}
|
|
241
|
+
else if (this.givenTime()) {
|
|
242
|
+
// When givenTime is present, use the given time as the initial value
|
|
243
|
+
// but the dropdown will start from 12:00 AM
|
|
244
|
+
this.chosenTime.set(dayjs.tz(this.givenTime(), this.timezone()).format(this.timeFormat));
|
|
245
|
+
this.userInputFlag.set(false);
|
|
246
|
+
// Populate dropdown first to compute the first interval
|
|
247
|
+
this.populateDropdown();
|
|
248
|
+
// Now validate with the computed first interval
|
|
249
|
+
this.isInvalid.set(!this.checkTimeValidity(this.chosenTime().trim()));
|
|
250
|
+
let chosenTimedayjs = this.getdayjs(this.chosenTime());
|
|
251
|
+
// Defer emission to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
252
|
+
setTimeout(() => {
|
|
253
|
+
this.emitTime({
|
|
254
|
+
valid: !this.isInvalid(),
|
|
255
|
+
time: this.chosenTime(),
|
|
256
|
+
epoch: chosenTimedayjs.valueOf()
|
|
257
|
+
});
|
|
258
|
+
}, 0);
|
|
259
|
+
// Calculate closest interval
|
|
260
|
+
this.calculateClosestInterval(this.chosenTime());
|
|
261
|
+
this._isInitializing = false;
|
|
262
|
+
}
|
|
263
|
+
else if (this.minTime()) {
|
|
264
|
+
// Use min time directly - this matches original behavior
|
|
265
|
+
this.chosenTime.set(dayjs.tz(this.minTime(), this.timezone()).format(this.timeFormat));
|
|
266
|
+
this.userInputFlag.set(false);
|
|
267
|
+
// Populate dropdown first to compute the first interval
|
|
268
|
+
this.populateDropdown();
|
|
269
|
+
// For minTime, validation should only check format, not time comparison
|
|
270
|
+
// This matches the original logic where minTime bypasses time validation
|
|
271
|
+
this.isInvalid.set(!this.checkTimeValidity(this.chosenTime().trim()));
|
|
272
|
+
let chosenTimedayjs = this.getdayjs(this.chosenTime());
|
|
273
|
+
// Defer emission to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
274
|
+
setTimeout(() => {
|
|
275
|
+
this.emitTime({
|
|
276
|
+
valid: !this.isInvalid(),
|
|
277
|
+
time: this.chosenTime(),
|
|
278
|
+
epoch: chosenTimedayjs.valueOf()
|
|
279
|
+
});
|
|
280
|
+
}, 0);
|
|
281
|
+
// Calculate closest interval
|
|
282
|
+
this.calculateClosestInterval(this.chosenTime());
|
|
283
|
+
this._isInitializing = false;
|
|
195
284
|
}
|
|
196
285
|
}
|
|
197
286
|
emitTime(data) {
|
|
@@ -199,13 +288,12 @@ class TimePickerComponent {
|
|
|
199
288
|
}
|
|
200
289
|
// function to get dayjs object when time is given in string
|
|
201
290
|
getdayjs(time = '00:00') {
|
|
202
|
-
;
|
|
203
291
|
if (!time || typeof time !== 'string') {
|
|
204
292
|
throw new Error('Time must be a string');
|
|
205
293
|
}
|
|
206
294
|
let hours;
|
|
207
295
|
let minutes;
|
|
208
|
-
if (this.clockFormat === 24) {
|
|
296
|
+
if (this.clockFormat() === 24) {
|
|
209
297
|
hours = parseInt(time.split(':')[0]);
|
|
210
298
|
minutes = parseInt(time.split(':')[1]);
|
|
211
299
|
}
|
|
@@ -221,70 +309,88 @@ class TimePickerComponent {
|
|
|
221
309
|
hours = 0;
|
|
222
310
|
}
|
|
223
311
|
}
|
|
224
|
-
|
|
312
|
+
// Use the date from dateAsEpoch but set the time to the parsed hours and minutes
|
|
313
|
+
const baseDate = dayjs.tz(this.dateAsEpoch(), this.timezone());
|
|
314
|
+
const result = baseDate.hour(hours).minute(minutes).second(0).millisecond(0);
|
|
315
|
+
return result;
|
|
225
316
|
}
|
|
226
317
|
closeDropdown() {
|
|
227
318
|
this.dispayToolTip = false;
|
|
228
|
-
this.userInputFlag
|
|
229
|
-
this.openStatus
|
|
319
|
+
this.userInputFlag.set(false);
|
|
320
|
+
this.openStatus.set(false);
|
|
230
321
|
if (this.timepickerDirective)
|
|
231
322
|
this.timepickerDirective.destroyOverlay();
|
|
232
323
|
}
|
|
233
324
|
// toggle timepicker dropdown
|
|
234
325
|
openDropdown() {
|
|
235
326
|
this.dispayToolTip = true;
|
|
236
|
-
this.openStatus
|
|
327
|
+
this.openStatus.set(true);
|
|
237
328
|
}
|
|
238
329
|
checkTimeValidity(time) {
|
|
239
330
|
const RE12 = /^(([0][1-9]|1[0-2]):([0-5][0-9])( )?(am|pm|AM|PM))$/i;
|
|
240
331
|
const RE24 = /^([01][0-9]|2[0-3]):[0-5][0-9]$/;
|
|
241
|
-
const RE = this.clockFormat === 12 ? RE12 : RE24;
|
|
332
|
+
const RE = this.clockFormat() === 12 ? RE12 : RE24;
|
|
333
|
+
// Check if the time format is valid first
|
|
334
|
+
if (!time.match(RE)) {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
// Restore proper validation logic
|
|
242
338
|
const timedayjs = this.getdayjs(time);
|
|
243
339
|
let flag = false;
|
|
244
|
-
//
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
dayjs.tz(this.firstInterval, this.timezone).format(this.timeFormat).valueOf() === dayjs.tz(dayjs(), this.timezone).startOf("day").format(this.timeFormat).valueOf())) {
|
|
340
|
+
// Original logic: if minTime, givenTime, or firstInterval is start of day, only check format
|
|
341
|
+
if (this.minTime() ||
|
|
342
|
+
this.givenTime() ||
|
|
343
|
+
(this.firstInterval() &&
|
|
344
|
+
dayjs.tz(this.firstInterval(), this.timezone()).format(this.timeFormat).valueOf() === dayjs.tz(dayjs(), this.timezone()).startOf("day").format(this.timeFormat).valueOf())) {
|
|
345
|
+
// Only check format validation, not time comparison
|
|
251
346
|
flag = time.match(RE) ? true : false;
|
|
252
347
|
}
|
|
253
348
|
else {
|
|
254
|
-
|
|
349
|
+
// Check against current time for normal cases
|
|
350
|
+
const currentTime = dayjs.tz(dayjs(), this.timezone());
|
|
351
|
+
const timeDiff = timedayjs.diff(currentTime, "m");
|
|
352
|
+
flag = timeDiff >= 0;
|
|
255
353
|
}
|
|
256
354
|
return flag;
|
|
257
355
|
}
|
|
258
356
|
// update chosen time as soon as the user clicks on an interval
|
|
259
357
|
onTimeSelect(time) {
|
|
260
|
-
this.isInvalid
|
|
261
|
-
if (!this.isInvalid) {
|
|
262
|
-
this.chosenTime
|
|
263
|
-
this.calculateClosestInterval(this.chosenTime);
|
|
358
|
+
this.isInvalid.set(!this.checkTimeValidity(time.trim()));
|
|
359
|
+
if (!this.isInvalid()) {
|
|
360
|
+
this.chosenTime.set(time);
|
|
361
|
+
this.calculateClosestInterval(this.chosenTime());
|
|
264
362
|
}
|
|
265
363
|
const timedayjs = this.getdayjs(time);
|
|
266
364
|
this.emitTime({
|
|
267
|
-
valid: !this.isInvalid,
|
|
365
|
+
valid: !this.isInvalid(),
|
|
268
366
|
time: time,
|
|
269
367
|
epoch: timedayjs.valueOf()
|
|
270
368
|
});
|
|
271
|
-
this.openStatus
|
|
369
|
+
this.openStatus.set(false);
|
|
272
370
|
if (this.timepickerDirective)
|
|
273
371
|
this.timepickerDirective.destroyOverlay();
|
|
274
372
|
}
|
|
275
373
|
// checks validity of time on input change and calculates the closest interval
|
|
276
374
|
onTimeChange(time) {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
375
|
+
// Set user input flag to prevent effects from overriding
|
|
376
|
+
this.userInputFlag.set(true);
|
|
377
|
+
// Update the chosenTime signal
|
|
378
|
+
this.chosenTime.set(time);
|
|
379
|
+
const isValid = this.checkTimeValidity(time.trim());
|
|
380
|
+
this.isInvalid.set(!isValid);
|
|
381
|
+
// Clear user input flag after a delay to allow effects to work again
|
|
382
|
+
setTimeout(() => {
|
|
383
|
+
this.userInputFlag.set(false);
|
|
384
|
+
}, 1000); // 1 second delay
|
|
385
|
+
if (!this.isInvalid()) {
|
|
386
|
+
this.openStatus.set(false);
|
|
281
387
|
if (this.timepickerDirective)
|
|
282
388
|
this.timepickerDirective.destroyOverlay();
|
|
283
389
|
this.calculateClosestInterval(time);
|
|
284
390
|
}
|
|
285
391
|
const timedayjs = this.getdayjs(time);
|
|
286
392
|
this.emitTime({
|
|
287
|
-
valid: !this.isInvalid,
|
|
393
|
+
valid: !this.isInvalid(),
|
|
288
394
|
time: time,
|
|
289
395
|
epoch: timedayjs.valueOf()
|
|
290
396
|
});
|
|
@@ -292,67 +398,79 @@ class TimePickerComponent {
|
|
|
292
398
|
calculateClosestInterval(time) {
|
|
293
399
|
let roundedEpoch;
|
|
294
400
|
// Converting time and date to a dayjs object
|
|
295
|
-
const chosenDate = dayjs.tz(this.dateAsEpoch, this.timezone).format("DD-MM-YYYY"); // 05-01-2024
|
|
296
|
-
const parsedTimeWithDate = dayjs.tz(`${chosenDate} ${time}`, `DD-MM-YYYY ${this.timeFormat}`, this.timezone);
|
|
401
|
+
const chosenDate = dayjs.tz(this.dateAsEpoch(), this.timezone()).format("DD-MM-YYYY"); // 05-01-2024
|
|
402
|
+
const parsedTimeWithDate = dayjs.tz(`${chosenDate} ${time}`, `DD-MM-YYYY ${this.timeFormat}`, this.timezone());
|
|
297
403
|
// Converting dayjs object to epoch
|
|
298
404
|
const chosenTimeEpoch = parsedTimeWithDate.valueOf();
|
|
299
|
-
const offset = this.interval - (dayjs.tz(chosenTimeEpoch, this.timezone).minute() % this.interval);
|
|
300
|
-
if (this.minTime && !this.givenTime) {
|
|
301
|
-
this.isHighlighted
|
|
405
|
+
const offset = this.interval() - (dayjs.tz(chosenTimeEpoch, this.timezone()).minute() % this.interval());
|
|
406
|
+
if (this.minTime() && !this.givenTime()) {
|
|
407
|
+
this.isHighlighted.set(0);
|
|
302
408
|
return;
|
|
303
409
|
}
|
|
304
|
-
roundedEpoch = offset >= this.interval / 2 ? (dayjs.tz(chosenTimeEpoch, this.timezone).subtract(this.interval - offset, "m")).valueOf() : (dayjs.tz(chosenTimeEpoch, this.timezone).add(offset, "m")).valueOf();
|
|
410
|
+
roundedEpoch = offset >= this.interval() / 2 ? (dayjs.tz(chosenTimeEpoch, this.timezone()).subtract(this.interval() - offset, "m")).valueOf() : (dayjs.tz(chosenTimeEpoch, this.timezone()).add(offset, "m")).valueOf();
|
|
305
411
|
// finding the index of element that needs to be highlighted
|
|
306
|
-
if (chosenTimeEpoch > dayjs.tz(this.dateAsEpoch, this.timezone).endOf("day").subtract(this.interval, "m").valueOf()) {
|
|
307
|
-
this.isHighlighted
|
|
412
|
+
if (chosenTimeEpoch > dayjs.tz(this.dateAsEpoch(), this.timezone()).endOf("day").subtract(this.interval(), "m").valueOf()) {
|
|
413
|
+
this.isHighlighted.set(this.timeIntervals().length - 1);
|
|
308
414
|
}
|
|
309
415
|
else {
|
|
310
|
-
const roundedEpochdayjs = dayjs.tz(roundedEpoch, this.timezone);
|
|
311
|
-
this.isHighlighted
|
|
312
|
-
const intervalObj = dayjs.tz(`${chosenDate} ${interval}`, `DD-MM-YYYY ${this.timeFormat}`, this.timezone);
|
|
416
|
+
const roundedEpochdayjs = dayjs.tz(roundedEpoch, this.timezone());
|
|
417
|
+
this.isHighlighted.set(this.timeIntervals().findIndex(interval => {
|
|
418
|
+
const intervalObj = dayjs.tz(`${chosenDate} ${interval}`, `DD-MM-YYYY ${this.timeFormat}`, this.timezone());
|
|
313
419
|
return intervalObj.isSame(roundedEpochdayjs);
|
|
314
|
-
});
|
|
420
|
+
}));
|
|
315
421
|
}
|
|
316
422
|
}
|
|
317
423
|
// populates the dropdown according to the first interval received
|
|
318
424
|
populateDropdown() {
|
|
319
|
-
this.timeIntervals
|
|
425
|
+
this.timeIntervals.set([]);
|
|
426
|
+
// Compute the effective first interval
|
|
427
|
+
let effectiveFirstInterval = this.firstInterval();
|
|
320
428
|
// if picker is used as an individual component
|
|
321
|
-
if (!
|
|
429
|
+
if (!effectiveFirstInterval) {
|
|
322
430
|
// firstInterval is initialised according to the current time
|
|
323
431
|
// if the date is same as the current date
|
|
324
|
-
if (dayjs.tz(this.dateAsEpoch, this.timezone).format("DD-MM-YYYY") === dayjs.tz(dayjs(), this.timezone).format("DD-MM-YYYY") && !this.minTime) {
|
|
325
|
-
const offset = this.interval - (dayjs.tz(dayjs(), this.timezone).minute() % this.interval);
|
|
326
|
-
|
|
432
|
+
if (dayjs.tz(this.dateAsEpoch(), this.timezone()).format("DD-MM-YYYY") === dayjs.tz(dayjs(), this.timezone()).format("DD-MM-YYYY") && !this.minTime()) {
|
|
433
|
+
const offset = this.interval() - (dayjs.tz(dayjs(), this.timezone()).minute() % this.interval());
|
|
434
|
+
effectiveFirstInterval = dayjs.tz(dayjs(), this.timezone()).add(offset, "m").valueOf();
|
|
327
435
|
}
|
|
328
436
|
// if minimum time to show is provided
|
|
329
|
-
else if (this.minTime) {
|
|
330
|
-
const
|
|
331
|
-
|
|
437
|
+
else if (this.minTime()) {
|
|
438
|
+
const minTimeDayjs = dayjs.tz(this.minTime(), this.timezone());
|
|
439
|
+
const offset = this.interval() - (minTimeDayjs.minute() % this.interval());
|
|
440
|
+
effectiveFirstInterval = minTimeDayjs.add(offset, "m").valueOf();
|
|
332
441
|
}
|
|
333
442
|
// else the firstInterval is initialised as start of day
|
|
334
443
|
else {
|
|
335
|
-
|
|
444
|
+
effectiveFirstInterval = dayjs.tz(dayjs(), this.timezone()).startOf("day").valueOf();
|
|
336
445
|
}
|
|
337
446
|
}
|
|
338
|
-
if (this.givenTime
|
|
339
|
-
|
|
340
|
-
|
|
447
|
+
if (this.givenTime()) {
|
|
448
|
+
// When givenTime is present, always start from 12:00 AM (start of day)
|
|
449
|
+
// regardless of whether the time has passed or not
|
|
450
|
+
effectiveFirstInterval = dayjs.tz(this.dateAsEpoch(), this.timezone()).startOf('day').valueOf();
|
|
451
|
+
this.givenTimeFlag.set(false);
|
|
341
452
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
const
|
|
453
|
+
// Store the computed first interval for later use
|
|
454
|
+
this.computedFirstInterval = effectiveFirstInterval;
|
|
455
|
+
const dateAsString = dayjs.tz(this.dateAsEpoch(), this.timezone()).format('DD-MM-YYYY');
|
|
456
|
+
const intervalAsString = dayjs.tz(effectiveFirstInterval, this.timezone()).format(this.timeFormat);
|
|
457
|
+
let start = dayjs.tz(`${dateAsString} ${intervalAsString}`, `DD-MM-YYYY ${this.timeFormat}`, this.timezone());
|
|
458
|
+
const end = dayjs.tz(this.dateAsEpoch(), this.timezone()).endOf('d');
|
|
346
459
|
while (start.valueOf() < end.valueOf()) {
|
|
347
|
-
this.timeIntervals.
|
|
348
|
-
start = start.add(this.interval, "m");
|
|
460
|
+
this.timeIntervals.update(intervals => [...intervals, start.format(this.timeFormat)]);
|
|
461
|
+
start = start.add(this.interval(), "m");
|
|
349
462
|
}
|
|
350
|
-
//
|
|
351
|
-
// and the
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
463
|
+
// NEW: Handle end-of-day case - if firstInterval is at or very close to end of day
|
|
464
|
+
// and we're on the same date, show only 11:59 PM
|
|
465
|
+
const endOfDay = dayjs.tz(this.dateAsEpoch(), this.timezone()).endOf("d");
|
|
466
|
+
const firstIntervalDayjs = dayjs.tz(effectiveFirstInterval, this.timezone());
|
|
467
|
+
// Check if firstInterval is at or very close to end of day (within 1 minute)
|
|
468
|
+
const isAtEndOfDay = firstIntervalDayjs.isSame(endOfDay, 'day') &&
|
|
469
|
+
firstIntervalDayjs.diff(endOfDay, 'minute') >= -1;
|
|
470
|
+
if (isAtEndOfDay || this.timeIntervals().length === 0) {
|
|
471
|
+
// Clear existing intervals and add only 11:59 PM
|
|
472
|
+
this.timeIntervals.set([]);
|
|
473
|
+
this.timeIntervals.update(intervals => [...intervals, endOfDay.format(this.timeFormat)]);
|
|
356
474
|
}
|
|
357
475
|
}
|
|
358
476
|
ngOnDestroy() {
|
|
@@ -371,59 +489,27 @@ class TimePickerComponent {
|
|
|
371
489
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.timepickerDirective = _t.first);
|
|
372
490
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tooltipDirective = _t.first);
|
|
373
491
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.timeIntervalRefs = _t);
|
|
374
|
-
} }, inputs: { clockFormat: "clockFormat", timezone: "timezone", height: "height", inputWidth: "inputWidth", dropdownWidth: "dropdownWidth", interval: "interval", dateAsEpoch: "dateAsEpoch", firstInterval: "firstInterval", rangeValidity: "rangeValidity", showTooltip: "showTooltip", givenTime: "givenTime", minTime: "minTime", triggerChange: "triggerChange", disable: "disable" }, outputs: { timeEmitter: "timeEmitter" },
|
|
492
|
+
} }, inputs: { clockFormat: [1, "clockFormat"], timezone: [1, "timezone"], height: [1, "height"], inputWidth: [1, "inputWidth"], dropdownWidth: [1, "dropdownWidth"], interval: [1, "interval"], dateAsEpoch: [1, "dateAsEpoch"], firstInterval: [1, "firstInterval"], rangeValidity: [1, "rangeValidity"], showTooltip: [1, "showTooltip"], givenTime: [1, "givenTime"], minTime: [1, "minTime"], triggerChange: [1, "triggerChange"], disable: [1, "disable"] }, outputs: { timeEmitter: "timeEmitter" }, decls: 5, vars: 19, consts: [["input", ""], ["dropdownContainer", ""], ["dropdown", ""], ["timeInterval", ""], [1, "timepicker-container", 3, "ngStyle", "ngClass"], ["type", "text", "misToolTip", "", "cdkOverlayOrigin", "", 1, "h7", 3, "ngModelChange", "click", "ngModel", "ngClass", "ngStyle", "showToolTip", "text", "position", "showOnHover"], ["libTimepicker", "", 3, "statusEmitter", "originEl", "openStatus"], ["class", "timepicker-dropdown", 3, "ngStyle", 4, "ngIf"], [1, "timepicker-dropdown", 3, "ngStyle"], [3, "ngClass", "click", 4, "ngFor", "ngForOf"], [3, "click", "ngClass"], ["class", "ic-ui-check-24 selected-icon", 4, "ngIf"], [1, "ic-ui-check-24", "selected-icon"]], template: function TimePickerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
375
493
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
376
494
|
i0.ɵɵelementStart(0, "div", 4)(1, "input", 5, 0);
|
|
377
|
-
i0.ɵɵ
|
|
378
|
-
i0.ɵɵlistener("ngModelChange", function TimePickerComponent_Template_input_ngModelChange_1_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onTimeChange(ctx.chosenTime)); })("click", function TimePickerComponent_Template_input_click_1_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.openDropdown()); });
|
|
495
|
+
i0.ɵɵlistener("ngModelChange", function TimePickerComponent_Template_input_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onTimeChange($event)); })("click", function TimePickerComponent_Template_input_click_1_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.openDropdown()); });
|
|
379
496
|
i0.ɵɵelementEnd();
|
|
380
497
|
i0.ɵɵtemplate(3, TimePickerComponent_ng_template_3_Template, 1, 1, "ng-template", 6, 1, i0.ɵɵtemplateRefExtractor);
|
|
381
498
|
i0.ɵɵlistener("statusEmitter", function TimePickerComponent_Template_ng_template_statusEmitter_3_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.closeDropdown()); });
|
|
382
499
|
i0.ɵɵelementEnd();
|
|
383
500
|
} if (rf & 2) {
|
|
384
501
|
const input_r6 = i0.ɵɵreference(2);
|
|
385
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(11, _c2, ctx.height))("ngClass", i0.ɵɵpureFunction1(13, _c3, ctx.disable));
|
|
502
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(11, _c2, ctx.height()))("ngClass", i0.ɵɵpureFunction1(13, _c3, ctx.disable()));
|
|
386
503
|
i0.ɵɵadvance();
|
|
387
|
-
i0.ɵɵ
|
|
388
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(15, _c4, ctx.isInvalid || !ctx.rangeValidity))("ngStyle", i0.ɵɵpureFunction1(17, _c5, ctx.inputWidth))("showToolTip", ctx.showTooltip && (ctx.isInvalid || !ctx.rangeValidity) && ctx.dispayToolTip)("text", "Invalid Time")("position", "top")("showOnHover", false);
|
|
504
|
+
i0.ɵɵproperty("ngModel", ctx.chosenTime())("ngClass", i0.ɵɵpureFunction1(15, _c4, ctx.isInvalid() || !ctx.rangeValidity()))("ngStyle", i0.ɵɵpureFunction1(17, _c5, ctx.inputWidth()))("showToolTip", ctx.showTooltip() && (ctx.isInvalid() || !ctx.rangeValidity()) && ctx.dispayToolTip)("text", "Invalid Time")("position", "top")("showOnHover", false);
|
|
389
505
|
i0.ɵɵadvance(2);
|
|
390
|
-
i0.ɵɵproperty("originEl", input_r6)("openStatus", ctx.openStatus);
|
|
506
|
+
i0.ɵɵproperty("originEl", input_r6)("openStatus", ctx.openStatus());
|
|
391
507
|
} }, dependencies: [i1$1.NgClass, i1$1.NgForOf, i1$1.NgIf, i1$1.NgStyle, i2.DefaultValueAccessor, i2.NgControlStatus, i2.NgModel, i3.ToolTipDirective, i1.CdkOverlayOrigin, TimepickerDirective], styles: [".h1[_ngcontent-%COMP%]{font-size:40px;font-weight:400;letter-spacing:0px;line-height:48px}.h2[_ngcontent-%COMP%]{font-size:32px;font-weight:400;letter-spacing:0px;line-height:40px}.h3[_ngcontent-%COMP%]{font-size:28px;font-weight:400;letter-spacing:0px;line-height:36px}.h4[_ngcontent-%COMP%]{font-size:24px;font-weight:400;letter-spacing:0px;line-height:32px}.h5-b[_ngcontent-%COMP%]{font-size:20px;font-weight:700;letter-spacing:.25px;line-height:28px}.h5[_ngcontent-%COMP%]{font-size:20px;font-weight:400;letter-spacing:.15px;line-height:28px}.h6-b[_ngcontent-%COMP%]{font-size:16px;font-weight:700;letter-spacing:0px;line-height:24px}.h6[_ngcontent-%COMP%]{font-size:16px;font-weight:400;letter-spacing:0px;line-height:24px}.p[_ngcontent-%COMP%]{font-size:16px;font-weight:400;letter-spacing:0px;line-height:180%}.h7-b[_ngcontent-%COMP%]{font-size:14px;font-weight:700;letter-spacing:.25px;line-height:20px}.h7[_ngcontent-%COMP%]{font-size:14px;font-weight:400;letter-spacing:.2px;line-height:20px}.h8-b[_ngcontent-%COMP%]{font-size:12px;font-weight:700;letter-spacing:.25px;line-height:18px}.h8[_ngcontent-%COMP%]{font-size:12px;font-weight:400;letter-spacing:.2px;line-height:18px}.h9[_ngcontent-%COMP%]{font-size:10px;font-weight:400;letter-spacing:0px;line-height:15px}.btn-lg-b[_ngcontent-%COMP%]{font-size:16px;font-weight:700;letter-spacing:.5px;line-height:24px}.btn-lg[_ngcontent-%COMP%]{font-size:16px;font-weight:400;letter-spacing:.2px;line-height:24px}.btn-sm[_ngcontent-%COMP%]{font-size:14px;font-weight:400;letter-spacing:.25px;line-height:20px}.btn-link[_ngcontent-%COMP%]{font-size:16px;font-weight:400;letter-spacing:0px;line-height:24px}.display-1[_ngcontent-%COMP%]{font-size:48px;font-weight:400;letter-spacing:0px;line-height:56px}.display-2[_ngcontent-%COMP%]{font-size:14px;font-weight:400;letter-spacing:.5px;line-height:20px}*[_ngcontent-%COMP%]{box-sizing:border-box;font-family:Lato}.timepicker-container[_ngcontent-%COMP%]{display:inline-block;position:relative}input[_ngcontent-%COMP%]{text-align:center;border:none;border-bottom:1px solid #e0e0e0;outline:none;height:100%;width:100px;padding:4px 16px}input[_ngcontent-%COMP%]:hover{background:#f5f7fc}input[_ngcontent-%COMP%]:focus, input[_ngcontent-%COMP%]:active{background:#e6ebf7;border-bottom:1px solid #0937b2}.timepicker-dropdown[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 4px);left:0;max-height:200px;overflow-y:auto;border:1px solid #e0e0e0;box-shadow:0 12px 24px #0000001f,0 4px 8px #0000001f;border-radius:4px;padding:8px;background:#fff}.timepicker-dropdown[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.timepicker-dropdown[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:0;padding:0}.timepicker-dropdown[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{text-align:start;list-style:none;padding:6px 12px;cursor:pointer;font-size:14px;color:#181f33;display:flex;justify-content:space-between;align-items:center}.timepicker-dropdown[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover{background:#f5f7fc;border-radius:6px}.timepicker-dropdown[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .selected-icon[_ngcontent-%COMP%]{font-weight:900}.highlight[_ngcontent-%COMP%]{background-color:#f5f7fc;border-radius:6px}.invalid[_ngcontent-%COMP%]{background:#fae1ea!important;border-bottom:1px solid #b00020!important}.disable[_ngcontent-%COMP%]{pointer-events:none!important;opacity:.5!important}"] }); }
|
|
392
508
|
}
|
|
393
509
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimePickerComponent, [{
|
|
394
510
|
type: Component,
|
|
395
|
-
args: [{ selector: "mis-timepicker", template: "<div class=\"timepicker-container\" [ngStyle]=\"{ height: height }\" [ngClass]=\"{'disable': disable}\">\n <input\n type=\"text\"\n [
|
|
396
|
-
}], () => [], {
|
|
397
|
-
type: Input
|
|
398
|
-
}], timezone: [{
|
|
399
|
-
type: Input
|
|
400
|
-
}], height: [{
|
|
401
|
-
type: Input
|
|
402
|
-
}], inputWidth: [{
|
|
403
|
-
type: Input
|
|
404
|
-
}], dropdownWidth: [{
|
|
405
|
-
type: Input
|
|
406
|
-
}], interval: [{
|
|
407
|
-
type: Input
|
|
408
|
-
}], dateAsEpoch: [{
|
|
409
|
-
type: Input
|
|
410
|
-
}], firstInterval: [{
|
|
411
|
-
type: Input
|
|
412
|
-
}], rangeValidity: [{
|
|
413
|
-
type: Input
|
|
414
|
-
}], showTooltip: [{
|
|
415
|
-
type: Input
|
|
416
|
-
}], givenTime: [{
|
|
417
|
-
type: Input
|
|
418
|
-
}], minTime: [{
|
|
419
|
-
type: Input
|
|
420
|
-
}], triggerChange: [{
|
|
421
|
-
type: Input
|
|
422
|
-
}], disable: [{
|
|
423
|
-
type: Input
|
|
424
|
-
}], timeEmitter: [{
|
|
425
|
-
type: Output
|
|
426
|
-
}], input: [{
|
|
511
|
+
args: [{ selector: "mis-timepicker", template: "<div class=\"timepicker-container\" [ngStyle]=\"{ height: height() }\" [ngClass]=\"{'disable': disable()}\">\n <input\n type=\"text\"\n [ngModel]=\"chosenTime()\"\n (ngModelChange)=\"onTimeChange($event)\"\n [ngClass]=\"{ invalid: isInvalid() || !rangeValidity() }\"\n [ngStyle]=\"{ width: inputWidth() }\"\n (click)=\"openDropdown()\"\n misToolTip\n [showToolTip]=\"showTooltip() && (isInvalid() || !rangeValidity()) && dispayToolTip\"\n [text]=\"'Invalid Time'\"\n [position]=\"'top'\"\n [showOnHover]=\"false\"\n #input\n cdkOverlayOrigin\n class=\"h7\"\n />\n\n <ng-template #dropdownContainer libTimepicker [originEl]=\"input\" [openStatus]=\"openStatus()\" (statusEmitter)=\"closeDropdown()\">\n <div *ngIf=\"openStatus()\" class=\"timepicker-dropdown\" [ngStyle]=\"{ width: dropdownWidth() || inputWidth() }\">\n <ul #dropdown>\n <li #timeInterval (click)=\"onTimeSelect(interval)\" *ngFor=\"let interval of timeIntervals(); index as i\" [ngClass]=\"{ highlight: i === isHighlighted() }\">\n {{ interval }}\n <div class=\"ic-ui-check-24 selected-icon\" *ngIf=\"interval === chosenTime()\"></div>\n </li>\n </ul>\n </div>\n </ng-template>\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{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}*{box-sizing:border-box;font-family:Lato}.timepicker-container{display:inline-block;position:relative}input{text-align:center;border:none;border-bottom:1px solid #e0e0e0;outline:none;height:100%;width:100px;padding:4px 16px}input:hover{background:#f5f7fc}input:focus,input:active{background:#e6ebf7;border-bottom:1px solid #0937b2}.timepicker-dropdown{position:absolute;top:calc(100% + 4px);left:0;max-height:200px;overflow-y:auto;border:1px solid #e0e0e0;box-shadow:0 12px 24px #0000001f,0 4px 8px #0000001f;border-radius:4px;padding:8px;background:#fff}.timepicker-dropdown::-webkit-scrollbar{display:none}.timepicker-dropdown ul{margin:0;padding:0}.timepicker-dropdown li{text-align:start;list-style:none;padding:6px 12px;cursor:pointer;font-size:14px;color:#181f33;display:flex;justify-content:space-between;align-items:center}.timepicker-dropdown li:hover{background:#f5f7fc;border-radius:6px}.timepicker-dropdown li .selected-icon{font-weight:900}.highlight{background-color:#f5f7fc;border-radius:6px}.invalid{background:#fae1ea!important;border-bottom:1px solid #b00020!important}.disable{pointer-events:none!important;opacity:.5!important}\n"] }]
|
|
512
|
+
}], () => [], { input: [{
|
|
427
513
|
type: ViewChild,
|
|
428
514
|
args: ["input", { static: true }]
|
|
429
515
|
}], timepickerDirective: [{
|