@libs-ui/components-datetime-input 0.1.1-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnVuY3Rpb24tY29udHJvbC1ldmVudC5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzLXVpL2NvbXBvbmVudHMvZGF0ZXRpbWUvaW5wdXQvc3JjL2ludGVyZmFjZXMvZnVuY3Rpb24tY29udHJvbC1ldmVudC5pbnRlcmZhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IElJbnB1dEZ1bmN0aW9uQ29udHJvbEV2ZW50IH0gZnJvbSAnQGxpYnMtdWkvY29tcG9uZW50cy1pbnB1dHMtaW5wdXQnO1xuXG5leHBvcnQgaW50ZXJmYWNlIElNdWx0aUZ1bmN0aW9uRGF0ZUlucHV0Q29udHJvbEV2ZW50IHtcbiAgZnJvbUhvdXJzPzogSUlucHV0RnVuY3Rpb25Db250cm9sRXZlbnQ7XG4gIHRvSG91cnM/OiBJSW5wdXRGdW5jdGlvbkNvbnRyb2xFdmVudDtcbiAgZnJvbU1pbnV0ZXM/OiBJSW5wdXRGdW5jdGlvbkNvbnRyb2xFdmVudDtcbiAgdG9NaW51dGVzPzogSUlucHV0RnVuY3Rpb25Db250cm9sRXZlbnQ7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgSURhdGVUaW1lSW5wdXRGdW5jdGlvbkNvbnRyb2xFdmVudCB7XG4gIGNoZWNrSXNWYWxpZDogKCkgPT4gUHJvbWlzZTxib29sZWFuPjtcbiAgcmVzZXRFcnJvcjogKHJlc2V0QWxsPzogYm9vbGVhbikgPT4gUHJvbWlzZTx2b2lkPjtcbiAgc2V0TWVzc2FnZUVycm9yOiAobWVzc2FnZTogc3RyaW5nIHwgdW5kZWZpbmVkKSA9PiBQcm9taXNlPHZvaWQ+O1xufVxuIl19
@@ -0,0 +1,4 @@
1
+ export * from './input.interface';
2
+ export * from './function-control-event.interface';
3
+ export * from './valid.interface';
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzLXVpL2NvbXBvbmVudHMvZGF0ZXRpbWUvaW5wdXQvc3JjL2ludGVyZmFjZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLG9DQUFvQyxDQUFDO0FBQ25ELGNBQWMsbUJBQW1CLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2lucHV0LmludGVyZmFjZSc7XG5leHBvcnQgKiBmcm9tICcuL2Z1bmN0aW9uLWNvbnRyb2wtZXZlbnQuaW50ZXJmYWNlJztcbmV4cG9ydCAqIGZyb20gJy4vdmFsaWQuaW50ZXJmYWNlJztcbiJdfQ==
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXQuaW50ZXJmYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy11aS9jb21wb25lbnRzL2RhdGV0aW1lL2lucHV0L3NyYy9pbnRlcmZhY2VzL2lucHV0LmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgV3JpdGFibGVTaWduYWwgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuZXhwb3J0IGludGVyZmFjZSBJQ2hhbmdlRm9jdXNJbnB1dCB7XG4gIGhvdXJzRm9jdXM/OiBib29sZWFuO1xuICBtaW51dGVzRm9jdXM/OiBib29sZWFuO1xuICBjaGFuZ2VCb3JkZXI/OiBib29sZWFuO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIElTZWxlY3RlZE11bHRpVGltZSB7XG4gIGZyb20/OiBXcml0YWJsZVNpZ25hbDxJU2VsZWN0ZWRUaW1lSW5wdXQ+O1xuICB0bz86IFdyaXRhYmxlU2lnbmFsPElTZWxlY3RlZFRpbWVJbnB1dD47XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgSVNlbGVjdGVkVGltZUlucHV0IHtcbiAgaG91cnM/OiBzdHJpbmcgfCBudW1iZXI7XG4gIG1pbnV0ZT86IHN0cmluZyB8IG51bWJlcjtcbn1cbiJdfQ==
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWQuaW50ZXJmYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy11aS9jb21wb25lbnRzL2RhdGV0aW1lL2lucHV0L3NyYy9pbnRlcmZhY2VzL3ZhbGlkLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSU1lc3NhZ2VUcmFuc2xhdGUgfSBmcm9tICdAbGlicy11aS9pbnRlcmZhY2VzLXR5cGVzJztcbmV4cG9ydCBpbnRlcmZhY2UgSVZhbGlkQ29tcGFyZSBleHRlbmRzIElNZXNzYWdlVHJhbnNsYXRlIHtcbiAgaXNDaGVja0Vycm9yVGltZUVuZEdyZWF0ZXJUaW1lU3RhcnQ/OiBib29sZWFuO1xuICBpc0NoZWNrRXJyb3JUaW1lRHVwbGljYXRlPzogYm9vbGVhbjtcbn1cbiJdfQ==
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlicy11aS1jb21wb25lbnRzLWRhdGV0aW1lLWlucHV0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy11aS9jb21wb25lbnRzL2RhdGV0aW1lL2lucHV0L3NyYy9saWJzLXVpLWNvbXBvbmVudHMtZGF0ZXRpbWUtaW5wdXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0=
@@ -0,0 +1,541 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, input, output, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { LibsUiComponentsInputsInputComponent } from '@libs-ui/components-inputs-input';
4
+ import { LibsUiComponentsLabelComponent } from '@libs-ui/components-label';
5
+ import { isNil, get, cloneDeep } from '@libs-ui/utils';
6
+ import * as i1 from '@ngx-translate/core';
7
+ import { TranslateModule } from '@ngx-translate/core';
8
+ import { timer } from 'rxjs';
9
+
10
+ const CheckTimeDisplay = (time) => {
11
+ const timeReturn = { hours: time.hours, minutes: time.minute };
12
+ if (Number(time.hours) > 23) {
13
+ timeReturn.hours = 23;
14
+ }
15
+ if (Number(time.minute) > 59) {
16
+ timeReturn.minutes = 59;
17
+ }
18
+ if (Number(time.hours) === 0 || Number(time.hours) < 0) {
19
+ timeReturn.hours = `00`;
20
+ }
21
+ if (Number(time.minute) === 0 || Number(time.minute) < 0) {
22
+ timeReturn.minutes = `00`;
23
+ }
24
+ if (Number(time.hours) && Number(time.hours) < 10) {
25
+ timeReturn.hours = `0${Number(time.hours)}`;
26
+ }
27
+ if (Number(time.minute) && Number(time.minute) < 10) {
28
+ timeReturn.minutes = `0${Number(time.minute)}`;
29
+ }
30
+ return timeReturn;
31
+ };
32
+ const CompareTime = (cloneDeepTime, time) => {
33
+ if (!cloneDeepTime && time) {
34
+ return true;
35
+ }
36
+ if (cloneDeepTime && !time) {
37
+ return false;
38
+ }
39
+ if (Number(cloneDeepTime?.from?.()?.hours) !== Number(time?.from?.()?.hours)) {
40
+ return true;
41
+ }
42
+ if (Number(cloneDeepTime?.from?.()?.minute) !== Number(time?.from?.()?.minute)) {
43
+ return true;
44
+ }
45
+ if (Number(cloneDeepTime?.to?.()?.hours) !== Number(time?.to?.()?.hours)) {
46
+ return true;
47
+ }
48
+ if (Number(cloneDeepTime?.to?.()?.minute) !== Number(time?.to?.()?.minute)) {
49
+ return true;
50
+ }
51
+ return false;
52
+ };
53
+
54
+ class LibsUiComponentsDatetimeInputComponent {
55
+ // #region PROPERTY
56
+ hours = signal(undefined);
57
+ minutes = signal(undefined);
58
+ toHours = signal(undefined);
59
+ toMinutes = signal(undefined);
60
+ isErrorRequired = signal(false);
61
+ isErrorMultiRequired = signal(false);
62
+ isErrorMultiValidCompareTime = signal(false);
63
+ focusInput = signal({});
64
+ cloneDeepTimeOutput = signal(undefined);
65
+ changeBorderFocus = signal({
66
+ changeBorder: false,
67
+ hoursFocus: false,
68
+ minutesFocus: false,
69
+ });
70
+ otherError = signal(undefined);
71
+ isZero = signal(false);
72
+ keyCodeBackspace = signal(false);
73
+ isSelected = signal(undefined);
74
+ writeDrownFromKeyboard = signal(undefined);
75
+ checkBackspaceFocusToHours = signal(1);
76
+ checkBackspaceFocusMinutes = signal(1);
77
+ checkBackspaceFocusToMinutes = signal(1);
78
+ multiTime = input(false);
79
+ selectedTime = input();
80
+ classIncludeBetweenTime = input(undefined);
81
+ fromAndToDateLabel = input();
82
+ resetInput = input(true);
83
+ disable = input(false);
84
+ readonly = input(false);
85
+ labelConfig = input(undefined);
86
+ validRequired = input(undefined);
87
+ validCompareTime = input(undefined);
88
+ ignoreBorder = input(false);
89
+ ignoreMultiIcon = input(false);
90
+ classDatePickerInput = input();
91
+ ignoreShowValid = input(false);
92
+ ignoreCheckValidWhenInput = input(false); // biến này dùng để có chạy validate ngay thời điểm khi nhập từ bán phím
93
+ ignoreAllowEqualTime = input(true); // biến này dùng để biết đc có cho 2 time bằng nhau hay không
94
+ emitDataSingleDataWhenUseMultiTime = input(false); // true khi muốn emit data riêng khi dùng dạng multi
95
+ classIncludeInput = input('', { transform: (value) => value ?? 'libs-ui-font-h5r' });
96
+ showBorderError = input(false);
97
+ defaultHeight = input(28);
98
+ ignoreWithDefault = input(false);
99
+ isEmitRealTime = input(false);
100
+ outEmitSingleTime = output();
101
+ outEmitMultiTime = output();
102
+ outClickButtonLabel = output();
103
+ outSwitchEventLabel = output();
104
+ outLabelRightClick = output();
105
+ outFunctionsControl = output();
106
+ outEmitValid = output();
107
+ outResetTime = output();
108
+ outEmitRealTime = output();
109
+ constructor() {
110
+ effect(() => {
111
+ const selectedTime = this.selectedTime();
112
+ if (!selectedTime) {
113
+ return;
114
+ }
115
+ untracked(() => this.formatSelectedTime(selectedTime));
116
+ });
117
+ }
118
+ // ngOnChanges(changes: SimpleChanges): void {
119
+ // if (changes.selectedTime && changes.selectedTime.currentValue && CompareTimeOutPut(changes.selectedTime.previousValue, changes.selectedTime.currentValue)) {
120
+ // }
121
+ // }
122
+ ngOnInit() {
123
+ this.outFunctionsControl.emit(this.FunctionsControl);
124
+ this.checkValid(true);
125
+ }
126
+ get FunctionsControl() {
127
+ return {
128
+ checkIsValid: this.checkValid.bind(this),
129
+ setMessageError: this.setMessageError.bind(this),
130
+ resetError: this.resetError.bind(this),
131
+ };
132
+ }
133
+ formatSelectedTime(data) {
134
+ const fromData = data.from?.();
135
+ const toData = data.to?.();
136
+ if (this.writeDrownFromKeyboard()) {
137
+ return;
138
+ }
139
+ if ((!fromData?.hours && fromData?.hours !== 0) || (!fromData?.minute && fromData?.minute !== 0) || (this.multiTime() && ((!toData?.hours && toData?.hours !== 0) || (!toData?.minute && toData?.minute !== 0)))) {
140
+ this.reset(this.multiTime());
141
+ this.isSelected.set(false);
142
+ return;
143
+ }
144
+ if (isNaN(Number(fromData?.hours)) || isNaN(Number(fromData?.minute)) || (this.multiTime() && (isNaN(Number(toData?.minute)) || isNaN(Number(toData?.minute))))) {
145
+ this.reset(this.multiTime());
146
+ this.isSelected.set(false);
147
+ return;
148
+ }
149
+ if (!fromData && !toData) {
150
+ this.reset(this.multiTime());
151
+ this.isSelected.set(false);
152
+ return;
153
+ }
154
+ if (fromData && !isNil(fromData.hours) && !isNil(fromData.minute)) {
155
+ const timeFromCheckValid = CheckTimeDisplay({ hours: fromData.hours, minute: fromData.minute });
156
+ this.hours.set(timeFromCheckValid.hours);
157
+ this.minutes.set(timeFromCheckValid.minutes);
158
+ }
159
+ if (toData && !isNil(toData.hours) && !isNil(toData.minute) && this.multiTime()) {
160
+ const timeToCheckValid = CheckTimeDisplay({ hours: toData.hours, minute: toData.minute });
161
+ this.toHours.set(timeToCheckValid.hours);
162
+ this.toMinutes.set(timeToCheckValid.minutes);
163
+ }
164
+ this.isSelected.set(true);
165
+ }
166
+ handlerFocusAndBlur(event, type) {
167
+ const eventInput = event.event;
168
+ const target = eventInput.target;
169
+ if (event.name === 'focus') {
170
+ this.changeBorderFocus.update((current) => {
171
+ current.changeBorder = true;
172
+ current.hoursFocus = true;
173
+ current.minutesFocus = false;
174
+ return current;
175
+ });
176
+ if (!get(this.getInstance(), type) && get(this.getInstance(), type) !== 0) {
177
+ this.isZero.set(false);
178
+ }
179
+ return;
180
+ }
181
+ this.changeBorderFocus.update((current) => {
182
+ current.hoursFocus = false;
183
+ return current;
184
+ });
185
+ timer(0)
186
+ .pipe()
187
+ .subscribe(() => {
188
+ if (!this.changeBorderFocus().hoursFocus && !this.changeBorderFocus().minutesFocus) {
189
+ this.changeBorderFocus.update((current) => {
190
+ current.changeBorder = false;
191
+ return current;
192
+ });
193
+ }
194
+ });
195
+ if (Number(get(this.getInstance(), type)) === 0) {
196
+ get(this.getInstance(), type, undefined, true).set('00');
197
+ target.value = get(this.getInstance(), type);
198
+ return;
199
+ }
200
+ if (Number(get(this.getInstance(), type)) && Number(get(this.getInstance(), type)) <= 2 && Number(get(this.getInstance(), type)) !== 0) {
201
+ get(this.getInstance(), type, undefined, true).set(`0${Number(get(this.getInstance(), type))}`);
202
+ target.value = get(this.getInstance(), type);
203
+ }
204
+ }
205
+ handlerFocusAndBlurMinutes(event, type) {
206
+ if (event.name === 'focus') {
207
+ this.changeBorderFocus.update((current) => {
208
+ current.changeBorder = true;
209
+ current.minutesFocus = true;
210
+ current.hoursFocus = false;
211
+ return current;
212
+ });
213
+ if (!get(this.getInstance(), type) && get(this.getInstance(), type) !== 0) {
214
+ this.isZero.set(false);
215
+ }
216
+ return;
217
+ }
218
+ this.changeBorderFocus.update((current) => {
219
+ current.minutesFocus = false;
220
+ return current;
221
+ });
222
+ timer(0)
223
+ .pipe()
224
+ .subscribe(() => {
225
+ if (!this.changeBorderFocus().hoursFocus && !this.changeBorderFocus().minutesFocus) {
226
+ this.changeBorderFocus.update((current) => {
227
+ current.changeBorder = false;
228
+ return current;
229
+ });
230
+ }
231
+ });
232
+ const eventInput = event.event;
233
+ const target = eventInput.target;
234
+ if (Number(get(this.getInstance(), type)) === 0) {
235
+ get(this.getInstance(), type, undefined, true).set('00');
236
+ target.value = get(this.getInstance(), type);
237
+ return;
238
+ }
239
+ if (Number(get(this.getInstance(), type)) && Number(get(this.getInstance(), type)) <= 5 && Number(get(this.getInstance(), type)) !== 0) {
240
+ get(this.getInstance(), type, undefined, true).set(`0${Number(get(this.getInstance(), type))}`);
241
+ target.value = get(this.getInstance(), type);
242
+ }
243
+ }
244
+ handlerValueHoursChange(data, type) {
245
+ data = data;
246
+ if (data === 0) {
247
+ this.isZero.set(true);
248
+ }
249
+ if (this.isSelected() || Number(get(this.getInstance(), type)) === Number(data)) {
250
+ if (data === 0 && !this.keyCodeBackspace() && get(this.getInstance(), type) !== '00') {
251
+ this.checkFocus(type);
252
+ }
253
+ return;
254
+ }
255
+ if (data === undefined) {
256
+ get(this.getInstance(), type, undefined, true).set(data);
257
+ this.isZero.set(false);
258
+ this.applyTime();
259
+ return;
260
+ }
261
+ get(this.getInstance(), type, undefined, true).set(data);
262
+ if (data === 0) {
263
+ get(this.getInstance(), type, undefined, true).set('0');
264
+ }
265
+ this.isSelected.set(false);
266
+ this.checkValid(this.ignoreCheckValidWhenInput());
267
+ if (data > 2 && data !== 0 && `${data}`.length < 2) {
268
+ get(this.getInstance(), type, undefined, true).set(`0${data}`);
269
+ this.checkFocus(type);
270
+ }
271
+ if (`${data}`.length === 2) {
272
+ this.checkFocus(type);
273
+ }
274
+ if (data <= 2 && data > 0 && this.isZero() && `${data}`.length === 1) {
275
+ get(this.getInstance(), type, undefined, true).set(`0${data}`);
276
+ this.checkFocus(type);
277
+ }
278
+ if (data !== 0) {
279
+ this.isZero.set(false);
280
+ }
281
+ this.applyTime();
282
+ }
283
+ handlerValueMinutesChange(data, type) {
284
+ data = data;
285
+ if (data === 0) {
286
+ this.isZero.set(true);
287
+ }
288
+ if (this.isSelected() || Number(get(this.getInstance(), type)) === Number(data)) {
289
+ if (data === 0 && !this.keyCodeBackspace() && get(this.getInstance(), type) !== '00') {
290
+ this.checkFocus(type);
291
+ }
292
+ return;
293
+ }
294
+ if (data === undefined) {
295
+ get(this.getInstance(), type, undefined, true).set(data);
296
+ this.isZero.set(false);
297
+ this.applyTime();
298
+ return;
299
+ }
300
+ get(this.getInstance(), type, undefined, true).set(data);
301
+ if (data === 0) {
302
+ get(this.getInstance(), type, undefined, true).set('0');
303
+ }
304
+ this.isSelected.set(false);
305
+ this.checkValid(this.ignoreCheckValidWhenInput());
306
+ if (`${data}`.length === 2) {
307
+ this.checkFocus(type);
308
+ }
309
+ if (data > 5 && `${data}`.length < 2) {
310
+ get(this.getInstance(), type, undefined, true).set(`0${data}`);
311
+ this.checkFocus(type);
312
+ }
313
+ if (data <= 5 && data > 0 && this.isZero() && `${data}`.length === 1) {
314
+ get(this.getInstance(), type, undefined, true).set(`0${data}`);
315
+ this.checkFocus(type);
316
+ }
317
+ if (data !== 0) {
318
+ this.isZero.set(false);
319
+ }
320
+ this.applyTime();
321
+ }
322
+ checkFocus(type) {
323
+ if (type === 'toMinutes' || this.keyCodeBackspace()) {
324
+ return;
325
+ }
326
+ switch (type) {
327
+ case 'hours':
328
+ this.focusInput().fromMinutes?.focus();
329
+ break;
330
+ case 'toHours':
331
+ this.focusInput().toMinutes?.focus();
332
+ break;
333
+ case 'minutes':
334
+ if (this.multiTime()) {
335
+ this.focusInput().toHours?.focus();
336
+ }
337
+ break;
338
+ }
339
+ }
340
+ handlerClickButtonLabel(button) {
341
+ this.outClickButtonLabel.emit(button);
342
+ }
343
+ handlerSwitchLabel(toggleEvent) {
344
+ this.outSwitchEventLabel.emit(toggleEvent);
345
+ }
346
+ handlerEventLabelRightLabel() {
347
+ this.outLabelRightClick.emit(true);
348
+ }
349
+ async checkValid(isValidateDefault = false) {
350
+ if (this.disable() || this.readonly()) {
351
+ return true;
352
+ }
353
+ this.isErrorRequired.set(false);
354
+ this.isErrorMultiRequired.set(false);
355
+ this.isErrorMultiValidCompareTime.set(false);
356
+ let valid = true;
357
+ if (!isValidateDefault) {
358
+ if ((isNil(this.hours()) || isNil(this.minutes())) && this.validRequired()) {
359
+ this.isErrorRequired.set(true);
360
+ valid = false;
361
+ }
362
+ if (this.multiTime()) {
363
+ if (this.validRequired() && (isNil(this.toHours()) || isNil(this.toMinutes()))) {
364
+ this.isErrorMultiRequired.set(true);
365
+ valid = false;
366
+ }
367
+ if (this.hours() &&
368
+ this.toHours() &&
369
+ this.minutes() &&
370
+ this.toMinutes() &&
371
+ this.validCompareTime() &&
372
+ this.validCompareTime()?.isCheckErrorTimeEndGreaterTimeStart &&
373
+ (Number(this.hours()) > Number(this.toHours()) || (Number(this.hours()) === Number(this.toHours()) && (this.ignoreAllowEqualTime() ? Number(this.minutes()) >= Number(this.toMinutes()) : Number(this.minutes()) > Number(this.toMinutes()))))) {
374
+ this.isErrorMultiValidCompareTime.set(true);
375
+ valid = false;
376
+ }
377
+ if (this.hours() &&
378
+ this.toHours() &&
379
+ this.minutes() &&
380
+ this.toMinutes() &&
381
+ this.validCompareTime() &&
382
+ this.validCompareTime()?.isCheckErrorTimeDuplicate &&
383
+ Number(this.hours()) === Number(this.toHours()) &&
384
+ Number(this.minutes()) === Number(this.toMinutes())) {
385
+ this.isErrorMultiValidCompareTime.set(true);
386
+ valid = false;
387
+ }
388
+ }
389
+ }
390
+ this.outEmitValid.emit({ validRequired: !(this.isErrorMultiRequired() || this.isErrorRequired()), validCompare: !this.isErrorMultiValidCompareTime() });
391
+ return valid;
392
+ }
393
+ emitRealTime() {
394
+ this.outEmitRealTime.emit({ from: signal({ hours: Number(this.hours()), minute: Number(this.minutes()) }), to: signal({ hours: Number(this.toHours()), minute: Number(this.toMinutes()) }) });
395
+ }
396
+ async applyTime() {
397
+ if (this.isEmitRealTime()) {
398
+ this.emitRealTime();
399
+ }
400
+ if (this.cloneDeepTimeOutput() && !CompareTime(this.cloneDeepTimeOutput(), { from: signal({ hours: this.hours(), minute: this.minutes() }), to: signal({ hours: this.toHours(), minute: this.toMinutes() }) })) {
401
+ return;
402
+ }
403
+ this.cloneDeepTimeOutput.set(cloneDeep({ from: signal({ hours: this.hours(), minute: this.minutes() }), to: signal({ hours: this.toHours(), minute: this.toMinutes() }) }));
404
+ if (this.multiTime()) {
405
+ if (this.emitDataSingleDataWhenUseMultiTime()) {
406
+ this.checkValid(this.ignoreCheckValidWhenInput());
407
+ const from = signal({});
408
+ const to = signal({});
409
+ if (!isNil(this.hours()) && !isNil(this.minutes()) && !this.isErrorRequired()) {
410
+ from.set({ hours: Number(this.hours()), minute: Number(this.minutes()) });
411
+ }
412
+ if (!isNil(this.toHours()) && !isNil(this.toMinutes()) && !this.isErrorMultiRequired()) {
413
+ to.set({ hours: Number(this.toHours()), minute: Number(this.toMinutes()) });
414
+ }
415
+ if (this.validCompareTime() && this.isErrorMultiValidCompareTime()) {
416
+ return;
417
+ }
418
+ this.outEmitMultiTime.emit({ from: from, to: to });
419
+ return;
420
+ }
421
+ if (!isNil(this.hours()) && !isNil(this.minutes()) && !isNil(this.toMinutes()) && !isNil(this.toHours()) && (await this.checkValid(this.ignoreCheckValidWhenInput()))) {
422
+ this.outEmitMultiTime.emit({ from: signal({ hours: Number(this.hours()), minute: Number(this.minutes()) }), to: signal({ hours: Number(this.toHours()), minute: Number(this.toMinutes()) }) });
423
+ return;
424
+ }
425
+ if (isNil(this.hours()) && isNil(this.minutes()) && isNil(this.toMinutes()) && isNil(this.toHours())) {
426
+ this.outEmitMultiTime.emit({ from: signal({ hours: undefined, minute: undefined }), to: signal({ hours: undefined, minute: undefined }) });
427
+ return;
428
+ }
429
+ }
430
+ if (!isNil(this.hours()) && !isNil(this.minutes()) && (await this.checkValid(this.ignoreCheckValidWhenInput()))) {
431
+ this.outEmitSingleTime.emit({ hours: Number(this.hours()), minute: Number(this.minutes()) });
432
+ }
433
+ }
434
+ handlerFocus(event, type) {
435
+ this.focusInput.update((current) => {
436
+ current[type] = event;
437
+ return current;
438
+ });
439
+ }
440
+ eventInput(event, type) {
441
+ this.isSelected.set(false);
442
+ this.writeDrownFromKeyboard.set(true);
443
+ if (event.keyCode === 96 && Number(get(this.getInstance(), type)) === 0) {
444
+ this.isZero.set(true);
445
+ }
446
+ if (event.keyCode !== 8) {
447
+ if (event.keyCode) {
448
+ this.checkBackspaceFocusMinutes.set(1);
449
+ this.checkBackspaceFocusToHours.set(1);
450
+ this.checkBackspaceFocusToMinutes.set(1);
451
+ }
452
+ this.keyCodeBackspace.set(false);
453
+ return;
454
+ }
455
+ this.keyCodeBackspace.set(true);
456
+ switch (type) {
457
+ case 'minutes':
458
+ if (isNil(this.minutes())) {
459
+ if (this.checkBackspaceFocusMinutes() === 1) {
460
+ this.checkBackspaceFocusMinutes.update((current) => {
461
+ current = current + 1;
462
+ return current;
463
+ });
464
+ return;
465
+ }
466
+ this.checkBackspaceFocusMinutes.set(1);
467
+ this.focusInput().fromHours?.focus();
468
+ }
469
+ break;
470
+ case 'toHours':
471
+ if (isNil(this.toHours())) {
472
+ if (this.checkBackspaceFocusToHours() === 1) {
473
+ this.checkBackspaceFocusToHours.update((current) => {
474
+ current = current + 1;
475
+ return current;
476
+ });
477
+ return;
478
+ }
479
+ this.checkBackspaceFocusToHours.set(1);
480
+ this.focusInput().fromMinutes?.focus();
481
+ }
482
+ break;
483
+ case 'toMinutes':
484
+ if (isNil(this.toMinutes())) {
485
+ if (this.checkBackspaceFocusToMinutes() === 1) {
486
+ this.checkBackspaceFocusToMinutes.update((current) => {
487
+ current = current + 1;
488
+ return current;
489
+ });
490
+ return;
491
+ }
492
+ this.checkBackspaceFocusToMinutes.set(1);
493
+ this.focusInput().toHours?.focus();
494
+ }
495
+ break;
496
+ }
497
+ }
498
+ reset(multiTime) {
499
+ this.hours.set(undefined);
500
+ this.minutes.set(undefined);
501
+ if (multiTime) {
502
+ this.toHours.set(undefined);
503
+ this.toMinutes.set(undefined);
504
+ }
505
+ }
506
+ handlerClickClear() {
507
+ this.checkValid(true);
508
+ this.hours.set(undefined);
509
+ this.minutes.set(undefined);
510
+ if (this.multiTime()) {
511
+ this.toHours.set(undefined);
512
+ this.toMinutes.set(undefined);
513
+ }
514
+ this.outResetTime.emit(undefined);
515
+ this.checkValid(this.ignoreCheckValidWhenInput());
516
+ }
517
+ async resetError() {
518
+ this.isErrorRequired.set(false);
519
+ this.isErrorMultiRequired.set(false);
520
+ this.isErrorMultiValidCompareTime.set(false);
521
+ }
522
+ async setMessageError(message) {
523
+ this.otherError.set({ message });
524
+ }
525
+ getInstance() {
526
+ return this;
527
+ }
528
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsDatetimeInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
529
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsDatetimeInputComponent, isStandalone: true, selector: "libs_ui-components-datetime-input", inputs: { multiTime: { classPropertyName: "multiTime", publicName: "multiTime", isSignal: true, isRequired: false, transformFunction: null }, selectedTime: { classPropertyName: "selectedTime", publicName: "selectedTime", isSignal: true, isRequired: false, transformFunction: null }, classIncludeBetweenTime: { classPropertyName: "classIncludeBetweenTime", publicName: "classIncludeBetweenTime", isSignal: true, isRequired: false, transformFunction: null }, fromAndToDateLabel: { classPropertyName: "fromAndToDateLabel", publicName: "fromAndToDateLabel", isSignal: true, isRequired: false, transformFunction: null }, resetInput: { classPropertyName: "resetInput", publicName: "resetInput", isSignal: true, isRequired: false, transformFunction: null }, disable: { classPropertyName: "disable", publicName: "disable", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, labelConfig: { classPropertyName: "labelConfig", publicName: "labelConfig", isSignal: true, isRequired: false, transformFunction: null }, validRequired: { classPropertyName: "validRequired", publicName: "validRequired", isSignal: true, isRequired: false, transformFunction: null }, validCompareTime: { classPropertyName: "validCompareTime", publicName: "validCompareTime", isSignal: true, isRequired: false, transformFunction: null }, ignoreBorder: { classPropertyName: "ignoreBorder", publicName: "ignoreBorder", isSignal: true, isRequired: false, transformFunction: null }, ignoreMultiIcon: { classPropertyName: "ignoreMultiIcon", publicName: "ignoreMultiIcon", isSignal: true, isRequired: false, transformFunction: null }, classDatePickerInput: { classPropertyName: "classDatePickerInput", publicName: "classDatePickerInput", isSignal: true, isRequired: false, transformFunction: null }, ignoreShowValid: { classPropertyName: "ignoreShowValid", publicName: "ignoreShowValid", isSignal: true, isRequired: false, transformFunction: null }, ignoreCheckValidWhenInput: { classPropertyName: "ignoreCheckValidWhenInput", publicName: "ignoreCheckValidWhenInput", isSignal: true, isRequired: false, transformFunction: null }, ignoreAllowEqualTime: { classPropertyName: "ignoreAllowEqualTime", publicName: "ignoreAllowEqualTime", isSignal: true, isRequired: false, transformFunction: null }, emitDataSingleDataWhenUseMultiTime: { classPropertyName: "emitDataSingleDataWhenUseMultiTime", publicName: "emitDataSingleDataWhenUseMultiTime", isSignal: true, isRequired: false, transformFunction: null }, classIncludeInput: { classPropertyName: "classIncludeInput", publicName: "classIncludeInput", isSignal: true, isRequired: false, transformFunction: null }, showBorderError: { classPropertyName: "showBorderError", publicName: "showBorderError", isSignal: true, isRequired: false, transformFunction: null }, defaultHeight: { classPropertyName: "defaultHeight", publicName: "defaultHeight", isSignal: true, isRequired: false, transformFunction: null }, ignoreWithDefault: { classPropertyName: "ignoreWithDefault", publicName: "ignoreWithDefault", isSignal: true, isRequired: false, transformFunction: null }, isEmitRealTime: { classPropertyName: "isEmitRealTime", publicName: "isEmitRealTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outEmitSingleTime: "outEmitSingleTime", outEmitMultiTime: "outEmitMultiTime", outClickButtonLabel: "outClickButtonLabel", outSwitchEventLabel: "outSwitchEventLabel", outLabelRightClick: "outLabelRightClick", outFunctionsControl: "outFunctionsControl", outEmitValid: "outEmitValid", outResetTime: "outResetTime", outEmitRealTime: "outEmitRealTime" }, ngImport: i0, template: "@if (labelConfig(); as labelConfig) {\n <libs_ui-components-label\n [classInclude]=\"labelConfig.classInclude\"\n [labelLeft]=\"labelConfig.labelLeft\"\n [labelLeftClass]=\"labelConfig.labelLeftClass\"\n [required]=\"labelConfig.required\"\n [description]=\"labelConfig.description\"\n [descriptionClass]=\"labelConfig.descriptionClass\"\n [labelRight]=\"labelConfig.labelRight\"\n [labelRightClass]=\"labelConfig.labelRightClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [buttonsLeft]=\"labelConfig.buttonsLeft\"\n [disableButtonsLeft]=\"labelConfig.disableButtonsLeft\"\n [buttonsRight]=\"labelConfig.buttonsRight\"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight\"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable\"\n [popover]=\"labelConfig.popover\"\n [iconPopoverClass]=\"labelConfig.iconPopoverClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [limitLength]=\"labelConfig.limitLength\"\n [count]=\"labelConfig.count\"\n (outClickButton)=\"handlerClickButtonLabel($event)\"\n (outSwitchEvent)=\"handlerSwitchLabel($event)\"\n (outLabelRightClick)=\"handlerEventLabelRightLabel()\" />\n}\n<div class=\"flex items-baseline\">\n <div\n class=\" libs-ui-date-time-input {{ classDatePickerInput() ?? '' }} relative\"\n [class.!w-[123px]]=\"!ignoreWithDefault() && resetInput() && !multiTime()\"\n [class.!w-[155px]]=\"!ignoreWithDefault() && !resetInput() && multiTime()\"\n [class.!w-[99px]]=\"!ignoreWithDefault() && !resetInput() && !multiTime()\"\n [class.!w-[179px]]=\"!ignoreWithDefault() && resetInput() && multiTime()\"\n [class.!bg-[#f8f9fa]]=\"readonly()\"\n [class.libs-ui-border-general]=\"!isErrorRequired() && !isErrorMultiValidCompareTime() && !ignoreBorder()\"\n [class.!border]=\"changeBorderFocus().changeBorder && !ignoreBorder() && !(isErrorRequired() || isErrorMultiValidCompareTime())\"\n [class.!border-[1px]]=\"changeBorderFocus().changeBorder && !ignoreBorder() && !(isErrorRequired() || isErrorMultiValidCompareTime())\"\n [class.!border-[#4e8cf7]]=\"changeBorderFocus().changeBorder && !ignoreBorder() && !(isErrorRequired() || isErrorMultiValidCompareTime())\"\n [class.libs-ui-border-error-general]=\"(isErrorRequired() || isErrorMultiValidCompareTime() || showBorderError()) && !ignoreBorder()\">\n <div class=\"pr-[8px] pl-[16px] h-full flex items-center\">\n <i\n class=\"libs-ui-icon-clock text-[14px] text-[#9ca2ad]\"\n [class.opacity-0.5]=\"disable()\"></i>\n </div>\n <div class=\"flex items-baseline\">\n <div\n [class.!w-[16px]]=\"hours()\"\n [class.!w-[18px]]=\"!hours()\">\n <libs_ui-components-inputs-input\n classInclude=\"!p-0 w-full !border-none text-center text-[#333333] {{ classIncludeInput() }}\"\n [dataType]=\"'int'\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [disable]=\"disable()\"\n [defaultHeight]=\"defaultHeight()\"\n [readonly]=\"readonly()\"\n [maxValueNumber]=\"23\"\n [minValueNumber]=\"0\"\n [value]=\"hours() || ''\"\n [placeholder]=\"'hh'\"\n [focusTimeOut]=\"0\"\n (outInputEvent)=\"eventInput($event, 'hours')\"\n (outChange)=\"handlerValueHoursChange($event, 'hours')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlur($event, 'hours')\"\n (outFunctionsControl)=\"handlerFocus($event, 'fromHours')\"\n [maxLength]=\"2\" />\n </div>\n <div\n class=\"libs-ui-font-h4r flex items-center\"\n [class.!text-[#9ca2ad]]=\"!hours() && !minutes()\"\n [class.!text-[#071631]]=\"hours() || minutes()\"\n [class.opacity-0.5]=\"disable()\">\n &colon;\n </div>\n <div\n [class.w-[16px]]=\"minutes()\"\n [class.w-[28px]]=\"!minutes()\">\n <libs_ui-components-inputs-input\n classInclude=\"w-full !p-0 !border-none text-center text-[#333333] {{ classIncludeInput() }}\"\n [dataType]=\"'int'\"\n [disable]=\"disable()\"\n [defaultHeight]=\"defaultHeight()\"\n [readonly]=\"readonly()\"\n [placeholder]=\"'mm'\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [maxValueNumber]=\"59\"\n [focusTimeOut]=\"0\"\n (outInputEvent)=\"eventInput($event, 'minutes')\"\n (outFunctionsControl)=\"handlerFocus($event, 'fromMinutes')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurMinutes($event, 'minutes')\"\n (outChange)=\"handlerValueMinutesChange($event, 'minutes')\"\n [value]=\"minutes() || ''\"\n [maxLength]=\"2\" />\n </div>\n </div>\n @if (multiTime()) {\n <div\n class=\"ml-[4px] mr-[3px] h-full flex items-center pt-[1px] libs-ui-font-h6r\"\n [class.text-[#9ca2ad]]=\"!hours() && !minutes() && !toHours() && !toMinutes()\"\n [class.text-[#071631]]=\"hours() || minutes() || toHours() || toMinutes()\">\n -\n </div>\n <div class=\"flex items-baseline\">\n <div\n [class.!w-[16px]]=\"toHours()\"\n [class.!w-[18px]]=\"!toHours()\">\n <libs_ui-components-inputs-input\n classInclude=\"w-full !p-0 !border-none text-center text-[#333333] {{ classIncludeInput() }}\"\n [dataType]=\"'int'\"\n [disable]=\"disable()\"\n [defaultHeight]=\"defaultHeight()\"\n [readonly]=\"readonly()\"\n [maxValueNumber]=\"23\"\n [minValueNumber]=\"0\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [value]=\"toHours() || ''\"\n [placeholder]=\"'hh'\"\n [focusTimeOut]=\"0\"\n (outInputEvent)=\"eventInput($event, 'toHours')\"\n (outFunctionsControl)=\"handlerFocus($event, 'toHours')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlur($event, 'toHours')\"\n (outChange)=\"handlerValueHoursChange($event, 'toHours')\"\n [maxLength]=\"2\" />\n </div>\n <div\n class=\"libs-ui-font-h4r flex items-center\"\n [class.!text-[#9ca2ad]]=\"!toHours() && !toMinutes()\"\n [class.!text-[#071631]]=\"toHours() || toMinutes()\"\n [class.opacity-0.5]=\"disable()\">\n &colon;\n </div>\n <div\n [class.!w-[16px]]=\"toMinutes()\"\n [class.!w-[28px]]=\"!toMinutes()\">\n <libs_ui-components-inputs-input\n classInclude=\"w-full !p-0 !border-none text-center text-[#333333] {{ classIncludeInput() }}\"\n [dataType]=\"'int'\"\n [defaultHeight]=\"defaultHeight()\"\n [disable]=\"disable()\"\n [readonly]=\"readonly()\"\n [placeholder]=\"'mm'\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [maxValueNumber]=\"59\"\n [focusTimeOut]=\"0\"\n [value]=\"toMinutes() || ''\"\n [maxLength]=\"2\"\n (outInputEvent)=\"eventInput($event, 'toMinutes')\"\n (outFunctionsControl)=\"handlerFocus($event, 'toMinutes')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurMinutes($event, 'toMinutes')\"\n (outChange)=\"handlerValueMinutesChange($event, 'toMinutes')\" />\n </div>\n </div>\n }\n @if (resetInput() && (hours() || minutes()) && !disable() && !readonly()) {\n <div\n class=\"h-full items-center flex ml-[2px] cursor-pointer absolute right-[10px] top-0\"\n (click)=\"handlerClickClear()\">\n <i class=\"libs-ui-icon-close-circle-solid !before:text-[8px] text-[#cdd0d6]\"></i>\n </div>\n }\n </div>\n</div>\n@if (!ignoreShowValid() && !isErrorMultiValidCompareTime() && (isErrorMultiRequired() || isErrorRequired()) && !disable() && !readonly()) {\n <div class=\"flex items-center mt-[8px] bottom-0\">\n @let constHtmlMessage = validRequired()?.message || 'i18n_valid_empty_message';\n <span\n [class]=\"'libs-ui-message-error libs-ui-font-h7r libs-ui-text-error'\"\n [innerHtml]=\"constHtmlMessage | translate: validRequired()?.interpolateParams\"></span>\n </div>\n}\n@if (!ignoreShowValid() && isErrorMultiValidCompareTime() && !disable() && !readonly()) {\n <div class=\"flex items-center mt-[8px] bottom-0\">\n @let constHtmlMessage = validCompareTime()?.message || 'i18n_invalid_end_date_selected';\n <span\n class=\"libs-ui-message-error libs-ui-font-h7r libs-ui-text-error\"\n [innerHtml]=\"constHtmlMessage | translate: validCompareTime()?.interpolateParams\"></span>\n </div>\n}\n\n@if (!ignoreShowValid() && !isErrorMultiValidCompareTime() && !isErrorMultiRequired() && !isErrorRequired() && !disable() && !readonly() && otherError()?.message) {\n <div class=\"flex items-center mt-[8px] bottom-0\">\n @let constHtmlMessage = otherError()?.message || ' ';\n <span\n class=\"libs-ui-message-error libs-ui-font-h7r libs-ui-text-error\"\n [innerHtml]=\"constHtmlMessage | translate: otherError()?.interpolateParams\"></span>\n </div>\n}\n", styles: [".libs-ui-date-time-input{display:flex;align-items:center;height:32px;border-radius:4px;background-color:#fff}:host ::ng-deep ::-webkit-input-placeholder{color:#9ca2ad!important;text-indent:0}:host ::ng-deep ::-moz-placeholder{color:#9ca2ad!important;text-indent:0}:host ::ng-deep :-ms-input-placeholder{color:#9ca2ad!important;text-indent:0}:host ::ng-deep :-moz-placeholder{color:#9ca2ad!important;text-indent:0}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsLabelComponent, selector: "libs_ui-components-label", inputs: ["iconPopoverClass", "classInclude", "labelLeft", "labelLeftClass", "labelLeftBehindToggleButton", "popover", "required", "buttonsLeft", "disableButtonsLeft", "buttonsRight", "disableButtonsRight", "labelRight", "labelRightClass", "labelRightRequired", "hasToggle", "toggleSize", "toggleActive", "toggleDisable", "description", "descriptionClass", "buttonsDescription", "disableButtonsDescription", "buttonsDescriptionContainerClass", "onlyShowCount", "zIndexPopover", "timerDestroyPopover", "count", "limitLength"], outputs: ["outClickButton", "outSwitchEvent", "outLabelRightClick", "outLabelLeftClick"] }, { kind: "component", type: LibsUiComponentsInputsInputComponent, selector: "libs_ui-components-inputs-input", inputs: ["tagInput", "dataType", "typeInput", "modeInput", "tabInsertContentTagInput", "textAreaEnterNotNewLine", "emitEmptyInDataTypeNumber", "keepZeroInTypeInt", "autoAddZeroLessThan10InTypeInt", "ignoreBlockInputMaxValue", "maxValueNumber", "minValueNumber", "fixedFloat", "acceptNegativeValue", "valueUpDownNumber", "classInclude", "maxLength", "readonly", "disable", "noBorder", "backgroundNone", "borderError", "useColorModeExist", "placeholder", "keepPlaceholderOnly", "value", "autoRemoveEmoji", "defaultHeight", "minHeightTextArea", "maxHeightTextArea", "focusTimeOut", "selectAllTimeOut", "blurTimeOut", "zIndexPopoverContent", "classContainerInput", "showCount", "ignoreStopPropagationEvent", "resize", "templateLeftBottomInput", "templateRightBottomInput", "classContainerBottomInput", "ignoreWidthInput100", "iframeTextareaCustomStyle", "iconLeftClass", "popoverContentIconLeft", "iconRightClass", "popoverContentIconRight", "resetAutoCompletePassword", "acceptOnlyClickIcon", "setIconRightColorSameColorDisableReadOnly", "onlyAcceptNegativeValue", "maxLengthNumberCount", "focusInput"], outputs: ["maxValueNumberChange", "minValueNumberChange", "fixedFloatChange", "acceptNegativeValueChange", "maxLengthChange", "valueChange", "maxLengthNumberCountChange", "outHeightAreaChange", "outChange", "outFocusAndBlurEvent", "outEnterEvent", "outInputEvent", "outIconLeft", "outIconRight", "outFunctionsControl", "outFilesDrop", "outFileDrop", "outChangeValueByButtonUpDown"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
530
+ }
531
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsDatetimeInputComponent, decorators: [{
532
+ type: Component,
533
+ args: [{ selector: 'libs_ui-components-datetime-input', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [TranslateModule, LibsUiComponentsLabelComponent, LibsUiComponentsInputsInputComponent], template: "@if (labelConfig(); as labelConfig) {\n <libs_ui-components-label\n [classInclude]=\"labelConfig.classInclude\"\n [labelLeft]=\"labelConfig.labelLeft\"\n [labelLeftClass]=\"labelConfig.labelLeftClass\"\n [required]=\"labelConfig.required\"\n [description]=\"labelConfig.description\"\n [descriptionClass]=\"labelConfig.descriptionClass\"\n [labelRight]=\"labelConfig.labelRight\"\n [labelRightClass]=\"labelConfig.labelRightClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [buttonsLeft]=\"labelConfig.buttonsLeft\"\n [disableButtonsLeft]=\"labelConfig.disableButtonsLeft\"\n [buttonsRight]=\"labelConfig.buttonsRight\"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight\"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable\"\n [popover]=\"labelConfig.popover\"\n [iconPopoverClass]=\"labelConfig.iconPopoverClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [limitLength]=\"labelConfig.limitLength\"\n [count]=\"labelConfig.count\"\n (outClickButton)=\"handlerClickButtonLabel($event)\"\n (outSwitchEvent)=\"handlerSwitchLabel($event)\"\n (outLabelRightClick)=\"handlerEventLabelRightLabel()\" />\n}\n<div class=\"flex items-baseline\">\n <div\n class=\" libs-ui-date-time-input {{ classDatePickerInput() ?? '' }} relative\"\n [class.!w-[123px]]=\"!ignoreWithDefault() && resetInput() && !multiTime()\"\n [class.!w-[155px]]=\"!ignoreWithDefault() && !resetInput() && multiTime()\"\n [class.!w-[99px]]=\"!ignoreWithDefault() && !resetInput() && !multiTime()\"\n [class.!w-[179px]]=\"!ignoreWithDefault() && resetInput() && multiTime()\"\n [class.!bg-[#f8f9fa]]=\"readonly()\"\n [class.libs-ui-border-general]=\"!isErrorRequired() && !isErrorMultiValidCompareTime() && !ignoreBorder()\"\n [class.!border]=\"changeBorderFocus().changeBorder && !ignoreBorder() && !(isErrorRequired() || isErrorMultiValidCompareTime())\"\n [class.!border-[1px]]=\"changeBorderFocus().changeBorder && !ignoreBorder() && !(isErrorRequired() || isErrorMultiValidCompareTime())\"\n [class.!border-[#4e8cf7]]=\"changeBorderFocus().changeBorder && !ignoreBorder() && !(isErrorRequired() || isErrorMultiValidCompareTime())\"\n [class.libs-ui-border-error-general]=\"(isErrorRequired() || isErrorMultiValidCompareTime() || showBorderError()) && !ignoreBorder()\">\n <div class=\"pr-[8px] pl-[16px] h-full flex items-center\">\n <i\n class=\"libs-ui-icon-clock text-[14px] text-[#9ca2ad]\"\n [class.opacity-0.5]=\"disable()\"></i>\n </div>\n <div class=\"flex items-baseline\">\n <div\n [class.!w-[16px]]=\"hours()\"\n [class.!w-[18px]]=\"!hours()\">\n <libs_ui-components-inputs-input\n classInclude=\"!p-0 w-full !border-none text-center text-[#333333] {{ classIncludeInput() }}\"\n [dataType]=\"'int'\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [disable]=\"disable()\"\n [defaultHeight]=\"defaultHeight()\"\n [readonly]=\"readonly()\"\n [maxValueNumber]=\"23\"\n [minValueNumber]=\"0\"\n [value]=\"hours() || ''\"\n [placeholder]=\"'hh'\"\n [focusTimeOut]=\"0\"\n (outInputEvent)=\"eventInput($event, 'hours')\"\n (outChange)=\"handlerValueHoursChange($event, 'hours')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlur($event, 'hours')\"\n (outFunctionsControl)=\"handlerFocus($event, 'fromHours')\"\n [maxLength]=\"2\" />\n </div>\n <div\n class=\"libs-ui-font-h4r flex items-center\"\n [class.!text-[#9ca2ad]]=\"!hours() && !minutes()\"\n [class.!text-[#071631]]=\"hours() || minutes()\"\n [class.opacity-0.5]=\"disable()\">\n &colon;\n </div>\n <div\n [class.w-[16px]]=\"minutes()\"\n [class.w-[28px]]=\"!minutes()\">\n <libs_ui-components-inputs-input\n classInclude=\"w-full !p-0 !border-none text-center text-[#333333] {{ classIncludeInput() }}\"\n [dataType]=\"'int'\"\n [disable]=\"disable()\"\n [defaultHeight]=\"defaultHeight()\"\n [readonly]=\"readonly()\"\n [placeholder]=\"'mm'\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [maxValueNumber]=\"59\"\n [focusTimeOut]=\"0\"\n (outInputEvent)=\"eventInput($event, 'minutes')\"\n (outFunctionsControl)=\"handlerFocus($event, 'fromMinutes')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurMinutes($event, 'minutes')\"\n (outChange)=\"handlerValueMinutesChange($event, 'minutes')\"\n [value]=\"minutes() || ''\"\n [maxLength]=\"2\" />\n </div>\n </div>\n @if (multiTime()) {\n <div\n class=\"ml-[4px] mr-[3px] h-full flex items-center pt-[1px] libs-ui-font-h6r\"\n [class.text-[#9ca2ad]]=\"!hours() && !minutes() && !toHours() && !toMinutes()\"\n [class.text-[#071631]]=\"hours() || minutes() || toHours() || toMinutes()\">\n -\n </div>\n <div class=\"flex items-baseline\">\n <div\n [class.!w-[16px]]=\"toHours()\"\n [class.!w-[18px]]=\"!toHours()\">\n <libs_ui-components-inputs-input\n classInclude=\"w-full !p-0 !border-none text-center text-[#333333] {{ classIncludeInput() }}\"\n [dataType]=\"'int'\"\n [disable]=\"disable()\"\n [defaultHeight]=\"defaultHeight()\"\n [readonly]=\"readonly()\"\n [maxValueNumber]=\"23\"\n [minValueNumber]=\"0\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [value]=\"toHours() || ''\"\n [placeholder]=\"'hh'\"\n [focusTimeOut]=\"0\"\n (outInputEvent)=\"eventInput($event, 'toHours')\"\n (outFunctionsControl)=\"handlerFocus($event, 'toHours')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlur($event, 'toHours')\"\n (outChange)=\"handlerValueHoursChange($event, 'toHours')\"\n [maxLength]=\"2\" />\n </div>\n <div\n class=\"libs-ui-font-h4r flex items-center\"\n [class.!text-[#9ca2ad]]=\"!toHours() && !toMinutes()\"\n [class.!text-[#071631]]=\"toHours() || toMinutes()\"\n [class.opacity-0.5]=\"disable()\">\n &colon;\n </div>\n <div\n [class.!w-[16px]]=\"toMinutes()\"\n [class.!w-[28px]]=\"!toMinutes()\">\n <libs_ui-components-inputs-input\n classInclude=\"w-full !p-0 !border-none text-center text-[#333333] {{ classIncludeInput() }}\"\n [dataType]=\"'int'\"\n [defaultHeight]=\"defaultHeight()\"\n [disable]=\"disable()\"\n [readonly]=\"readonly()\"\n [placeholder]=\"'mm'\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [maxValueNumber]=\"59\"\n [focusTimeOut]=\"0\"\n [value]=\"toMinutes() || ''\"\n [maxLength]=\"2\"\n (outInputEvent)=\"eventInput($event, 'toMinutes')\"\n (outFunctionsControl)=\"handlerFocus($event, 'toMinutes')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurMinutes($event, 'toMinutes')\"\n (outChange)=\"handlerValueMinutesChange($event, 'toMinutes')\" />\n </div>\n </div>\n }\n @if (resetInput() && (hours() || minutes()) && !disable() && !readonly()) {\n <div\n class=\"h-full items-center flex ml-[2px] cursor-pointer absolute right-[10px] top-0\"\n (click)=\"handlerClickClear()\">\n <i class=\"libs-ui-icon-close-circle-solid !before:text-[8px] text-[#cdd0d6]\"></i>\n </div>\n }\n </div>\n</div>\n@if (!ignoreShowValid() && !isErrorMultiValidCompareTime() && (isErrorMultiRequired() || isErrorRequired()) && !disable() && !readonly()) {\n <div class=\"flex items-center mt-[8px] bottom-0\">\n @let constHtmlMessage = validRequired()?.message || 'i18n_valid_empty_message';\n <span\n [class]=\"'libs-ui-message-error libs-ui-font-h7r libs-ui-text-error'\"\n [innerHtml]=\"constHtmlMessage | translate: validRequired()?.interpolateParams\"></span>\n </div>\n}\n@if (!ignoreShowValid() && isErrorMultiValidCompareTime() && !disable() && !readonly()) {\n <div class=\"flex items-center mt-[8px] bottom-0\">\n @let constHtmlMessage = validCompareTime()?.message || 'i18n_invalid_end_date_selected';\n <span\n class=\"libs-ui-message-error libs-ui-font-h7r libs-ui-text-error\"\n [innerHtml]=\"constHtmlMessage | translate: validCompareTime()?.interpolateParams\"></span>\n </div>\n}\n\n@if (!ignoreShowValid() && !isErrorMultiValidCompareTime() && !isErrorMultiRequired() && !isErrorRequired() && !disable() && !readonly() && otherError()?.message) {\n <div class=\"flex items-center mt-[8px] bottom-0\">\n @let constHtmlMessage = otherError()?.message || ' ';\n <span\n class=\"libs-ui-message-error libs-ui-font-h7r libs-ui-text-error\"\n [innerHtml]=\"constHtmlMessage | translate: otherError()?.interpolateParams\"></span>\n </div>\n}\n", styles: [".libs-ui-date-time-input{display:flex;align-items:center;height:32px;border-radius:4px;background-color:#fff}:host ::ng-deep ::-webkit-input-placeholder{color:#9ca2ad!important;text-indent:0}:host ::ng-deep ::-moz-placeholder{color:#9ca2ad!important;text-indent:0}:host ::ng-deep :-ms-input-placeholder{color:#9ca2ad!important;text-indent:0}:host ::ng-deep :-moz-placeholder{color:#9ca2ad!important;text-indent:0}\n"] }]
534
+ }], ctorParameters: () => [] });
535
+
536
+ /**
537
+ * Generated bundle index. Do not edit.
538
+ */
539
+
540
+ export { LibsUiComponentsDatetimeInputComponent };
541
+ //# sourceMappingURL=libs-ui-components-datetime-input.mjs.map