@libs-ui/components-datetime-picker 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.
Files changed (33) hide show
  1. package/README.md +3 -0
  2. package/custom-ranges/calendar/calendar.component.d.ts +141 -0
  3. package/custom-ranges/custom-ranges.component.d.ts +62 -0
  4. package/defines/calendar.define.d.ts +13 -0
  5. package/defines/common-date.define.d.ts +2 -0
  6. package/defines/date-options.define.d.ts +19 -0
  7. package/esm2022/custom-ranges/calendar/calendar.component.mjs +1287 -0
  8. package/esm2022/custom-ranges/custom-ranges.component.mjs +307 -0
  9. package/esm2022/defines/calendar.define.mjs +135 -0
  10. package/esm2022/defines/common-date.define.mjs +4 -0
  11. package/esm2022/defines/date-options.define.mjs +53 -0
  12. package/esm2022/index.mjs +5 -0
  13. package/esm2022/interfaces/calendar-emit.interface.mjs +2 -0
  14. package/esm2022/interfaces/calendar-variables.interface.mjs +6 -0
  15. package/esm2022/interfaces/function-control.interface.mjs +2 -0
  16. package/esm2022/interfaces/index.mjs +7 -0
  17. package/esm2022/interfaces/picker.interface.mjs +2 -0
  18. package/esm2022/interfaces/time-variables.interface.mjs +2 -0
  19. package/esm2022/interfaces/valid.interface.mjs +2 -0
  20. package/esm2022/libs-ui-components-datetime-picker.mjs +5 -0
  21. package/esm2022/picker.component.mjs +247 -0
  22. package/fesm2022/libs-ui-components-datetime-picker.mjs +2024 -0
  23. package/fesm2022/libs-ui-components-datetime-picker.mjs.map +1 -0
  24. package/index.d.ts +4 -0
  25. package/interfaces/calendar-emit.interface.d.ts +25 -0
  26. package/interfaces/calendar-variables.interface.d.ts +80 -0
  27. package/interfaces/function-control.interface.d.ts +12 -0
  28. package/interfaces/index.d.ts +6 -0
  29. package/interfaces/picker.interface.d.ts +26 -0
  30. package/interfaces/time-variables.interface.d.ts +36 -0
  31. package/interfaces/valid.interface.d.ts +5 -0
  32. package/package.json +35 -0
  33. package/picker.component.d.ts +89 -0
@@ -0,0 +1,2024 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, computed, input, model, output, inject, viewChild, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { LibsUiComponentsLabelComponent } from '@libs-ui/components-label';
4
+ import { LibsUiComponentsPopoverComponent } from '@libs-ui/components-popover';
5
+ import { UtilsLanguageConstants, get, UtilsCache, getDayjs, UtilsHttpParamsRequestInstance, isEmpty, set, ERROR_MESSAGE_EMPTY_VALID } from '@libs-ui/utils';
6
+ import * as i1 from '@ngx-translate/core';
7
+ import { TranslateService, TranslateModule } from '@ngx-translate/core';
8
+ import { LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';
9
+ import { LibsUiComponentsDropdownComponent } from '@libs-ui/components-dropdown';
10
+ import { LibsUiComponentsInputsInputComponent } from '@libs-ui/components-inputs-input';
11
+ import dayjs from 'dayjs';
12
+ import isoWeek from 'dayjs/plugin/isoWeek';
13
+ import { returnListObject, returnDetailObject } from '@libs-ui/services-http-request';
14
+
15
+ const getDateOptions = () => {
16
+ const dateOptions = {
17
+ [UtilsLanguageConstants.VI]: {
18
+ monthNames: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'],
19
+ ranges: { today: 'Hôm nay', yesterday: 'Hôm qua', _7days_ago: '7 ngày trước', _30days_ago: '30 ngày trước', this_month: 'Tháng này', last_month: 'Tháng trước', _3months_ago: '90 ngày trước' },
20
+ daysOfWeek: ['T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'CN'],
21
+ applyLabel: 'Lưu',
22
+ cancelLabel: 'Huỷ bỏ',
23
+ fromLabel: 'Từ',
24
+ toLabel: 'Đến',
25
+ customRangeLabel: 'Tùy Chỉnh',
26
+ },
27
+ [UtilsLanguageConstants.EN]: {
28
+ monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
29
+ ranges: { today: 'Today', yesterday: 'Yesterday', _7days_ago: '7 days ago', _30days_ago: '30 days ago', this_month: 'This month', last_month: 'Last month', _3months_ago: '90 days ago' },
30
+ daysOfWeek: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],
31
+ applyLabel: 'Apply',
32
+ cancelLabel: 'Cancel',
33
+ fromLabel: 'From',
34
+ toLabel: 'To',
35
+ customRangeLabel: 'Customize',
36
+ },
37
+ };
38
+ return get(dateOptions, UtilsCache.getLang());
39
+ };
40
+ const defaultLocaleConfig = () => {
41
+ return {
42
+ direction: 'ltr',
43
+ separator: ' - ',
44
+ weekLabel: 'W',
45
+ applyLabel: 'Apply',
46
+ cancelLabel: 'Cancel',
47
+ clearLabel: 'Clear',
48
+ customRangeLabel: 'customRangeLabel',
49
+ daysOfWeek: [],
50
+ monthNames: [],
51
+ firstDay: 1,
52
+ };
53
+ };
54
+ const getDateRangeDefault = () => {
55
+ return {
56
+ today: [getDayjs().hour(0).minute(0).second(0).millisecond(0), getDayjs().hour(23).minute(59).second(59)],
57
+ yesterday: [getDayjs().subtract(1, 'days').hour(0).minute(0).second(0).millisecond(0), getDayjs().subtract(1, 'days').hour(23).minute(59).second(59)],
58
+ _7days_ago: [getDayjs().subtract(6, 'days').hour(0).second(0).minute(0).millisecond(0), getDayjs().hour(23).minute(59).second(59)],
59
+ _30days_ago: [getDayjs().subtract(29, 'days').hour(0).second(0).minute(0).millisecond(0), getDayjs().hour(23).minute(59).second(59)],
60
+ this_month: [getDayjs().startOf('month'), getDayjs().endOf('month')],
61
+ last_month: [getDayjs().subtract(1, 'month').startOf('month'), getDayjs().subtract(1, 'month').endOf('month')],
62
+ _3months_ago: [getDayjs().subtract(89, 'days').hour(0).second(0).minute(0).millisecond(0), getDayjs().hour(23).minute(59).second(59)],
63
+ };
64
+ };
65
+ const getDateOptionsDefault = () => ({ ...defaultLocaleConfig(), ...getDateOptions() });
66
+
67
+ const getMonthsDefault = () => {
68
+ return [
69
+ {
70
+ id: 1,
71
+ label: 'i18n_january',
72
+ maxDays: 31,
73
+ },
74
+ {
75
+ id: 2,
76
+ label: 'i18n_february',
77
+ maxDays: 29,
78
+ },
79
+ {
80
+ id: 3,
81
+ label: 'i18n_march',
82
+ maxDays: 31,
83
+ },
84
+ {
85
+ id: 4,
86
+ label: 'i18n_april',
87
+ maxDays: 30,
88
+ },
89
+ {
90
+ id: 5,
91
+ label: 'i18n_may',
92
+ maxDays: 31,
93
+ },
94
+ {
95
+ id: 6,
96
+ label: 'i18n_june',
97
+ maxDays: 30,
98
+ },
99
+ {
100
+ id: 7,
101
+ label: 'i18n_july',
102
+ maxDays: 31,
103
+ },
104
+ {
105
+ id: 8,
106
+ label: 'i18n_august',
107
+ maxDays: 31,
108
+ },
109
+ {
110
+ id: 9,
111
+ label: 'i18n_september',
112
+ maxDays: 30,
113
+ },
114
+ {
115
+ id: 10,
116
+ label: 'i18n_october',
117
+ maxDays: 31,
118
+ },
119
+ {
120
+ id: 11,
121
+ label: 'i18n_november',
122
+ maxDays: 30,
123
+ },
124
+ {
125
+ id: 12,
126
+ label: 'i18n_december',
127
+ maxDays: 31,
128
+ },
129
+ ];
130
+ };
131
+ const getMonthsListConfig = (translate) => {
132
+ return {
133
+ type: 'text',
134
+ httpRequestData: signal({
135
+ objectInstance: returnListObject(getMonthsDefault()),
136
+ functionName: 'list',
137
+ argumentsValue: [],
138
+ }),
139
+ configTemplateText: signal({
140
+ fieldKey: 'id',
141
+ autoScrollToItemSelected: true,
142
+ getValue: (item) => {
143
+ const label = translate.instant(item.label || ' ', { year: ' ' });
144
+ return label.substring(0, UtilsCache.getLang() === UtilsLanguageConstants.VI ? label.length : 3);
145
+ },
146
+ getClassIncludePopover: () => 'libs-ui-font-h5r',
147
+ }),
148
+ };
149
+ };
150
+ const getMonthsDetailById = () => {
151
+ return {
152
+ objectInstance: returnDetailObject(UtilsHttpParamsRequestInstance(), getMonthsDefault()),
153
+ functionName: 'detailByData',
154
+ argumentsValue: [],
155
+ guideAutoUpdateArgumentsValue: {
156
+ paging: {},
157
+ detailById: {
158
+ fieldUpdate: '[0]',
159
+ fieldGetValue: '',
160
+ subFieldUpdate: 'keys',
161
+ },
162
+ },
163
+ };
164
+ };
165
+ const getYearsListConfig = (listOfYears = []) => {
166
+ return {
167
+ type: 'text',
168
+ httpRequestData: signal({
169
+ objectInstance: returnListObject(listOfYears),
170
+ functionName: 'list',
171
+ argumentsValue: [],
172
+ }),
173
+ configTemplateText: signal({
174
+ fieldKey: 'id',
175
+ autoScrollToItemSelected: true,
176
+ getValue: (item) => {
177
+ return item.label;
178
+ },
179
+ getClassIncludeTooltip: () => 'libs-ui-font-h5r',
180
+ }),
181
+ };
182
+ };
183
+ const getYearsDetailById = (listOfYears = []) => {
184
+ return {
185
+ objectInstance: returnDetailObject(UtilsHttpParamsRequestInstance(), listOfYears),
186
+ functionName: 'detailByData',
187
+ argumentsValue: [],
188
+ guideAutoUpdateArgumentsValue: {
189
+ paging: {},
190
+ detailById: {
191
+ fieldUpdate: '[0]',
192
+ fieldGetValue: '',
193
+ subFieldUpdate: 'keys',
194
+ },
195
+ },
196
+ };
197
+ };
198
+
199
+ const DEFAULT_MIN_YEAR = 1945;
200
+ const DEFAULT_MAX_YEAR = getDayjs().year() + 5;
201
+
202
+ var SideEnum;
203
+ (function (SideEnum) {
204
+ SideEnum["left"] = "left";
205
+ SideEnum["right"] = "right";
206
+ })(SideEnum || (SideEnum = {}));
207
+
208
+ /* eslint-disable @typescript-eslint/no-unused-expressions */
209
+ /* eslint-disable @typescript-eslint/no-explicit-any */
210
+ dayjs.extend(isoWeek);
211
+ class LibsUiComponentsDatetimePickerCustomRangesCalendarComponent {
212
+ /** PROPERTY */
213
+ sideEnum = SideEnum;
214
+ calendarVariables = signal({ left: signal({}), right: signal({}) });
215
+ timepickerVariables = signal({ left: signal({ selectedHour: 0, selectedMinute: 0 }), right: signal({ selectedHour: 23, selectedMinute: 59 }) });
216
+ disableMonth = signal({ left: signal([]), right: signal([]) });
217
+ today = signal(getDayjs());
218
+ listKeyFromSelected = signal({ month: undefined, year: undefined });
219
+ listKeyToSelected = signal({ month: undefined, year: undefined });
220
+ checkShowListDropdown = signal({});
221
+ selectedQuickRange = signal('');
222
+ leftCalendar = signal({});
223
+ rightCalendar = signal({});
224
+ listMonthsConfig = signal(undefined);
225
+ monthHttpDetailConfig = signal(getMonthsDetailById());
226
+ listLeftYearConfig = signal(undefined);
227
+ listRightYearConfig = signal(undefined);
228
+ listYearConfig = signal(undefined);
229
+ leftYearHttpDetailConfig = signal(undefined);
230
+ rightYearHttpDetailConfig = signal(undefined);
231
+ timePickerError = signal(false);
232
+ computedDisplayTimeLeft = computed(() => this.computedDisplayTime({ selectedHour: this.timepickerValueItem().lefthour(), selectedMinute: this.timepickerValueItem().leftminute() }));
233
+ computedDisplayTimeRight = computed(() => this.computedDisplayTime({ selectedHour: this.timepickerValueItem().righthour(), selectedMinute: this.timepickerValueItem().rightminute() }));
234
+ computedDisplayTimeLeftInputHour = computed(() => this.computedDisplayTimeInput(SideEnum.left, 'hour'));
235
+ computedDisplayTimeLeftInputMinute = computed(() => this.computedDisplayTimeInput(SideEnum.left, 'minute'));
236
+ computedDisplayTimeRightInputHour = computed(() => this.computedDisplayTimeInput(SideEnum.right, 'hour'));
237
+ computedDisplayTimeRightInputMinute = computed(() => this.computedDisplayTimeInput(SideEnum.right, 'minute'));
238
+ timepickerValueItem = signal({ lefthour: signal(0), leftminute: signal(0), righthour: signal(0), rightminute: signal(0) });
239
+ functionControls = new Map();
240
+ pickingDate = signal(false);
241
+ isShown = signal(false);
242
+ nowHoveredDate = signal(null);
243
+ timePickerIncrement = signal(1);
244
+ selectedLabel = signal(undefined);
245
+ keyCodeBackspace = signal(false);
246
+ checkBackspaceFocus = signal({ lefthour: signal(1), leftminute: signal(1), righthour: signal(1), rightminute: signal(1) });
247
+ isZero = signal(undefined);
248
+ oldDate = signal({ start: dayjs(0), end: dayjs(0) });
249
+ isSelectedData = signal({ leftmonth: false, leftyear: false, rightmonth: false, rightyear: false });
250
+ splitPickerDate = signal({ start: signal({ month: 0, year: 0, day: 0, hour: 0, minute: 0 }), end: signal({ month: 0, year: 0, day: 0, hour: 23, minute: 59 }) });
251
+ /** INPUT */
252
+ quickRangesArray = input([]);
253
+ zIndex = input(1200, { transform: (value) => value ?? 1200 });
254
+ classInclude = input('');
255
+ isSingle = input(false);
256
+ showDropdownsSelect = input(true);
257
+ hasTimePicker = input(true);
258
+ flagMouse = input({ isMouseEnter: false, isMouseEnterContent: false });
259
+ dateOptions = input({ ...defaultLocaleConfig(), ...getDateOptions() });
260
+ autoApply = input(false);
261
+ hasSecondPicker = input(false);
262
+ showRangeLabelOnInput = input(undefined);
263
+ startDate = model(getDayjs().startOf('day'));
264
+ endDate = model(getDayjs().endOf('day'));
265
+ minDate = input(undefined, { transform: this.transformMinMaxDate.bind(this) });
266
+ maxDate = input(undefined, { transform: this.transformMinMaxDate.bind(this) });
267
+ listYearHiddenInputSearch = input(true, { transform: (value) => value ?? true });
268
+ /** OUTPUT */
269
+ outChangStageFlagMouse = output();
270
+ // readonly outStartDateChanged = output<{ startDate: Dayjs | undefined }>();
271
+ // readonly outEndDateChanged = output<{ endDate: Dayjs | undefined }>();
272
+ outPickerDate = output();
273
+ // readonly outRangeClicked: EventEmitter<IRangesClicked> = new EventEmitter();
274
+ outCancel = output();
275
+ outUpdateWidth = output();
276
+ outFunctionsControl = output();
277
+ /** INJECTION */
278
+ translate = inject(TranslateService);
279
+ pickerContainer = viewChild('pickerContainer');
280
+ constructor() {
281
+ this.listMonthsConfig.set(getMonthsListConfig(this.translate));
282
+ effect(() => {
283
+ const oldStart = getDayjs({ date: this.startDate()?.clone() });
284
+ const oldEnd = getDayjs({ date: this.endDate()?.clone() });
285
+ untracked(() => {
286
+ this.oldDate.set({ start: oldStart, end: oldEnd });
287
+ });
288
+ });
289
+ }
290
+ ngOnInit() {
291
+ const startDate = getDayjs({ date: this.startDate()?.clone() });
292
+ const endDate = getDayjs({ date: this.endDate()?.clone() });
293
+ this.splitPickerDate.update((current) => {
294
+ current.start.update((sideCurrent) => {
295
+ sideCurrent.day = (startDate ?? getDayjs().startOf('day')).date();
296
+ return sideCurrent;
297
+ });
298
+ current.end.update((sideCurrent) => {
299
+ sideCurrent.day = (endDate ?? getDayjs().endOf('day')).date();
300
+ return sideCurrent;
301
+ });
302
+ return current;
303
+ });
304
+ if (startDate) {
305
+ this.updateElement();
306
+ }
307
+ if (startDate && this.hasTimePicker()) {
308
+ this.setStartDate(startDate);
309
+ this.renderTimePicker(SideEnum.left);
310
+ }
311
+ if (endDate && this.hasTimePicker()) {
312
+ this.setEndDate(endDate);
313
+ this.renderTimePicker(SideEnum.right);
314
+ }
315
+ this.buildConfigYear(SideEnum.left);
316
+ this.buildConfigYear(SideEnum.right, startDate?.year());
317
+ this.updateMonthsInView();
318
+ this.renderCalendar(SideEnum.left);
319
+ if ((getDayjs({ date: this.maxDate() })?.year() ?? DEFAULT_MAX_YEAR) < (startDate?.year() || 0)) {
320
+ this.handlerSelectedDropdown({ key: getDayjs({ date: this.maxDate() })?.year() }, SideEnum.left + 'year');
321
+ }
322
+ if (!this.isSingle()) {
323
+ this.renderCalendar(SideEnum.right);
324
+ if ((getDayjs({ date: this.maxDate() })?.year() ?? DEFAULT_MAX_YEAR) < (endDate?.year() || 0)) {
325
+ this.handlerSelectedDropdown({ key: getDayjs({ date: this.maxDate() })?.year() }, SideEnum.right + 'year');
326
+ }
327
+ }
328
+ // this.renderRanges();
329
+ this.formatMonthYear();
330
+ this.outUpdateWidth.emit(1);
331
+ this.updateElement();
332
+ this.timepickerValueItem.set({
333
+ lefthour: signal(this.timepickerVariables().left().selectedHour),
334
+ righthour: signal(this.timepickerVariables().right().selectedHour),
335
+ leftminute: signal(this.timepickerVariables().left().selectedMinute),
336
+ rightminute: signal(this.timepickerVariables().right().selectedMinute),
337
+ });
338
+ // this.outFunctionsControl.emit({ buildDefaultRange: this.buildDefaultRange.bind(this), applyToSelect: this.applyToSelect.bind(this) })
339
+ }
340
+ buildConfigYear(side, startYear) {
341
+ const minDate = getDayjs({ date: this.minDate() });
342
+ const maxDate = getDayjs({ date: this.maxDate() });
343
+ const listLeftYear = [];
344
+ const listRightYear = [];
345
+ if (side === SideEnum.left) {
346
+ const start = maxDate?.year() ?? DEFAULT_MAX_YEAR;
347
+ const end = minDate?.year() ?? DEFAULT_MIN_YEAR;
348
+ for (let i = start; i >= end; i--) {
349
+ listLeftYear.push({
350
+ id: i,
351
+ label: `${i}`,
352
+ });
353
+ }
354
+ this.listLeftYearConfig.set(getYearsListConfig(listLeftYear));
355
+ this.leftYearHttpDetailConfig.set(getYearsDetailById(listLeftYear));
356
+ return;
357
+ }
358
+ const start = maxDate?.year() ?? DEFAULT_MAX_YEAR;
359
+ const end = startYear ?? minDate?.year() ?? getDayjs().year();
360
+ for (let i = start; i >= end; i--) {
361
+ listRightYear.push({
362
+ id: i,
363
+ label: `${i}`,
364
+ });
365
+ }
366
+ this.listRightYearConfig.set(getYearsListConfig(listRightYear));
367
+ this.rightYearHttpDetailConfig.set(getYearsDetailById(listRightYear));
368
+ }
369
+ handlerChangeFlagMouse(flagMouse) {
370
+ this.outChangStageFlagMouse.emit(flagMouse);
371
+ }
372
+ updateStartEndDate(date) {
373
+ date = getDayjs({ date });
374
+ if (this.endDate() || date.isBefore(getDayjs({ date: this.startDate() }), 'day')) {
375
+ if (this.hasTimePicker()) {
376
+ date = this.getDateWithTime(date, SideEnum.left);
377
+ }
378
+ this.endDate.set(undefined);
379
+ this.setStartDate(getDayjs({ date: date.clone() }));
380
+ return;
381
+ }
382
+ if (!this.endDate() && this.startDate() && date.isBefore(getDayjs({ date: this.startDate() }))) {
383
+ this.setEndDate(getDayjs({ date: this.startDate()?.clone() }));
384
+ return;
385
+ }
386
+ if (this.hasTimePicker()) {
387
+ date = getDayjs({ date: this.getDateWithTime(date, SideEnum.right) });
388
+ }
389
+ if (!date.isBefore(getDayjs({ date: this.startDate() }), 'day')) {
390
+ this.setEndDate(getDayjs({ date: date.clone() }));
391
+ }
392
+ if (this.autoApply()) {
393
+ this.calculateSelectedLabel();
394
+ }
395
+ }
396
+ calculateSelectedLabel() {
397
+ this.updateElement();
398
+ }
399
+ formatMonthYear() {
400
+ const month = (this.calendarVariables().left().dropdowns?.()?.currentMonth ?? 0) + 1;
401
+ this.listKeyFromSelected.update((current) => {
402
+ current.month = month;
403
+ current.year = this.calendarVariables().left().dropdowns?.()?.currentYear;
404
+ return current;
405
+ });
406
+ if (this.isSingle()) {
407
+ this.isSelectedData.set({ leftmonth: true, leftyear: true, rightmonth: true, rightyear: true });
408
+ return;
409
+ }
410
+ const rightMonth = (this.calendarVariables().right().dropdowns?.()?.currentMonth ?? 0) + 1;
411
+ this.listKeyToSelected.update((current) => {
412
+ current.month = rightMonth;
413
+ current.year = this.calendarVariables().right().dropdowns?.()?.currentYear;
414
+ return current;
415
+ });
416
+ this.isSelectedData.set({ leftmonth: true, leftyear: true, rightmonth: true, rightyear: true });
417
+ }
418
+ setStartDate(startDate) {
419
+ if (!this.startDate()) {
420
+ return;
421
+ }
422
+ if (typeof startDate === 'string') {
423
+ this.startDate.set(getDayjs({ date: dayjs(startDate, this.dateOptions().format), returnDayjsIfConfigDateNotExist: true }));
424
+ }
425
+ if (typeof startDate === 'object') {
426
+ this.pickingDate.set(true);
427
+ this.startDate.set(getDayjs({ date: startDate, returnDayjsIfConfigDateNotExist: true }));
428
+ }
429
+ if (!this.hasTimePicker()) {
430
+ this.pickingDate.set(true);
431
+ this.startDate.set(getDayjs({ date: this.startDate()?.startOf('day') }));
432
+ }
433
+ this.setStartDateInTimePicker();
434
+ if (this.minDate() && this.startDate()?.isBefore(this.minDate())) {
435
+ this.startDate.set(getDayjs({ date: this.minDate() })?.clone());
436
+ this.setStartDateInTimePicker();
437
+ }
438
+ if (this.maxDate() && this.startDate()?.isAfter(this.maxDate())) {
439
+ this.startDate.set(getDayjs({ date: this.maxDate() })?.clone());
440
+ this.setStartDateInTimePicker();
441
+ }
442
+ if (!this.isShown()) {
443
+ this.updateElement();
444
+ }
445
+ // this.outStartDateChanged.emit({ startDate: this.startDate() });
446
+ this.updateMonthsInView();
447
+ }
448
+ setStartDateInTimePicker() {
449
+ if (!this.hasTimePicker() || !this.timePickerIncrement()) {
450
+ return;
451
+ }
452
+ this.startDate.update((current) => {
453
+ if (!current) {
454
+ return;
455
+ }
456
+ current.minute(Math.round(current.minute() / this.timePickerIncrement()) * this.timePickerIncrement());
457
+ return current;
458
+ });
459
+ }
460
+ setEndDate(endDate) {
461
+ if (typeof endDate === 'string') {
462
+ this.endDate.set(getDayjs({ date: dayjs(endDate, this.dateOptions().format), returnDayjsIfConfigDateNotExist: true }));
463
+ }
464
+ if (typeof endDate === 'object') {
465
+ this.pickingDate.set(false);
466
+ this.endDate.set(getDayjs({ date: dayjs(endDate), returnDayjsIfConfigDateNotExist: true }));
467
+ }
468
+ if (!this.endDate() || !this.startDate()) {
469
+ return this.updateMonthsInView();
470
+ }
471
+ if (!this.hasTimePicker()) {
472
+ this.pickingDate.set(false);
473
+ this.endDate.set(this.endDate()?.add(1, 'd').startOf('day').subtract(1, 'second'));
474
+ }
475
+ if (this.hasTimePicker() && this.timePickerIncrement()) {
476
+ this.endDate.update((current) => {
477
+ if (!current) {
478
+ return;
479
+ }
480
+ current.minute(Math.round(current.minute() / this.timePickerIncrement()) * this.timePickerIncrement());
481
+ return current;
482
+ });
483
+ }
484
+ if (this.endDate()?.isBefore(this.startDate())) {
485
+ this.endDate.set(this.startDate()?.clone());
486
+ }
487
+ if (this.maxDate() && this.endDate()?.isAfter(this.maxDate())) {
488
+ this.endDate.set(getDayjs({ date: this.maxDate() })?.clone());
489
+ }
490
+ // this.outEndDateChanged.emit({ endDate: this.endDate() });
491
+ this.updateMonthsInView();
492
+ }
493
+ handlerHoverDate(event, side, row, col) {
494
+ event.stopPropagation();
495
+ const leftCalDate = this.calendarVariables().left().calendar?.[row][col];
496
+ const rightCalDate = this.calendarVariables().right().calendar?.[row][col];
497
+ if (!this.pickingDate || !rightCalDate || !leftCalDate) {
498
+ return;
499
+ }
500
+ this.nowHoveredDate.set(side === SideEnum.left ? leftCalDate : rightCalDate);
501
+ this.renderCalendar(SideEnum.left);
502
+ this.renderCalendar(SideEnum.right);
503
+ }
504
+ getDisable(type) {
505
+ const minDate = getDayjs({ date: this.minDate() });
506
+ const maxDate = getDayjs({ date: this.maxDate() });
507
+ if (type === 'left') {
508
+ this.disableMonth().left.set([]);
509
+ if (minDate && minDate?.year() === this.listKeyFromSelected().year) {
510
+ for (let i = 1; i < minDate?.month() + 1; i++) {
511
+ this.disableMonth().left.update((current) => {
512
+ current.push(i);
513
+ return current;
514
+ });
515
+ }
516
+ }
517
+ if (maxDate && maxDate?.year() === this.listKeyFromSelected().year) {
518
+ for (let i = maxDate?.month() + 2; i < 13; i++) {
519
+ this.disableMonth().left.update((current) => {
520
+ current.push(i);
521
+ return current;
522
+ });
523
+ }
524
+ }
525
+ return;
526
+ }
527
+ this.disableMonth().right.set([]);
528
+ if (minDate && minDate?.year() === this.listKeyToSelected().year) {
529
+ for (let i = 1; i < minDate?.month() + 1; i++) {
530
+ this.disableMonth().right.update((current) => {
531
+ current.push(i);
532
+ return current;
533
+ });
534
+ }
535
+ }
536
+ if (maxDate && maxDate?.year() === this.listKeyToSelected().year) {
537
+ for (let i = maxDate?.month() + 2; i < 13; i++) {
538
+ this.disableMonth().right.update((current) => {
539
+ current.push(i);
540
+ return current;
541
+ });
542
+ }
543
+ }
544
+ if (Number(this.listKeyFromSelected().year) === Number(this.listKeyToSelected().year)) {
545
+ for (let i = 1; i <= Number(this.listKeyFromSelected().month); i++) {
546
+ this.disableMonth().right.update((current) => {
547
+ current.push(i);
548
+ return current;
549
+ });
550
+ }
551
+ }
552
+ }
553
+ handlerClickPrev(side) {
554
+ if (side === SideEnum.left && this.leftCalendar().month) {
555
+ this.leftCalendar.update((current) => {
556
+ current.month = current.month?.subtract(1, 'month');
557
+ return current;
558
+ });
559
+ this.listKeyFromSelected.update((current) => {
560
+ current.month = (this.leftCalendar().month?.month() ?? 0) + 1;
561
+ current.year = this.leftCalendar().month?.year();
562
+ return current;
563
+ });
564
+ return this.updateCalendars();
565
+ }
566
+ this.rightCalendar.update((current) => {
567
+ current.month = current.month?.subtract(1, 'month');
568
+ return current;
569
+ });
570
+ this.listKeyToSelected.update((current) => {
571
+ current.month = (this.rightCalendar().month?.month() ?? 0) + 1;
572
+ current.year = this.rightCalendar().month?.year();
573
+ return current;
574
+ });
575
+ this.getDisable('right');
576
+ this.updateCalendars();
577
+ }
578
+ handlerClickNext(side) {
579
+ if (side === SideEnum.left) {
580
+ this.leftCalendar.update((current) => {
581
+ current.month = current.month?.add(1, 'month');
582
+ return current;
583
+ });
584
+ this.listKeyFromSelected.update((current) => {
585
+ current.month = (this.leftCalendar().month?.month() ?? 0) + 1;
586
+ current.year = this.leftCalendar().month?.year();
587
+ return current;
588
+ });
589
+ if (this.listKeyFromSelected().month === this.listKeyToSelected().month && this.listKeyFromSelected().year === this.listKeyToSelected().year) {
590
+ this.rightCalendar.update((current) => {
591
+ current.month = current.month?.add(1, 'month');
592
+ return current;
593
+ });
594
+ this.listKeyToSelected.update((current) => {
595
+ current.month = (this.rightCalendar().month?.month() ?? 0) + 1;
596
+ current.year = this.rightCalendar().month?.year();
597
+ return current;
598
+ });
599
+ }
600
+ this.getDisable('right');
601
+ return this.updateCalendars();
602
+ }
603
+ this.rightCalendar.update((current) => {
604
+ current.month = current.month?.add(1, 'month');
605
+ return current;
606
+ });
607
+ this.listKeyToSelected.update((current) => {
608
+ current.month = (this.rightCalendar().month?.month() ?? 0) + 1;
609
+ current.year = this.rightCalendar().month?.year();
610
+ return current;
611
+ });
612
+ this.updateCalendars();
613
+ }
614
+ handlerPickerDate(event, side, row, col) {
615
+ event.stopPropagation();
616
+ if (event.target?.tagName === 'TD') {
617
+ if (event.target.classList && !event.target.classList.contains('available')) {
618
+ return;
619
+ }
620
+ }
621
+ if (event.target.tagName === 'SPAN') {
622
+ if (event.target.parentElement && event.target.parentElement.classList && !event.target.parentElement.classList.contains('available')) {
623
+ return;
624
+ }
625
+ }
626
+ if (!this.dateOptions().customRangeLabel) {
627
+ return;
628
+ }
629
+ if (this.quickRangesArray().length) {
630
+ this.selectedQuickRange.set(this.dateOptions().customRangeLabel);
631
+ }
632
+ const date = side === SideEnum.left ? this.leftCalendar().calendar?.[row][col] : this.rightCalendar().calendar?.[row][col];
633
+ if (!date) {
634
+ return;
635
+ }
636
+ this.splitPickerDate.update((current) => {
637
+ current[side === SideEnum.left ? 'start' : 'end'].update((sideCurrent) => {
638
+ sideCurrent.day = date.date();
639
+ return sideCurrent;
640
+ });
641
+ return current;
642
+ });
643
+ this.updateStartEndDate(date);
644
+ if (this.isSingle() && this.startDate()) {
645
+ this.setEndDate(this.startDate());
646
+ this.updateElement();
647
+ if (this.autoApply()) {
648
+ this.handlerClickApply();
649
+ }
650
+ }
651
+ this.updateView();
652
+ if (this.autoApply() && this.startDate() && this.endDate()) {
653
+ this.handlerClickApply();
654
+ }
655
+ }
656
+ handlerClickApply(event) {
657
+ event?.stopPropagation();
658
+ // this.validate();
659
+ // if (!this.validate()) {
660
+ // return;
661
+ // }
662
+ if (this.hasTimePicker()) {
663
+ this.setTimeInput(SideEnum.left);
664
+ this.setTimeInput(SideEnum.right);
665
+ }
666
+ this.calculateSelectedLabel();
667
+ if (this.selectedLabel()) {
668
+ this.outPickerDate.emit({ displayLabel: this.selectedLabel(), startDate: this.startDate(), endDate: this.endDate(), detailDatePicker: this.splitPickerDate() });
669
+ }
670
+ }
671
+ handlerClickCancel(event) {
672
+ event.stopPropagation();
673
+ this.startDate.set(dayjs(0));
674
+ this.endDate.set(dayjs(0));
675
+ this.outCancel.emit('');
676
+ }
677
+ handlerFunctionControl(event, type) {
678
+ this.functionControls.set(type, event);
679
+ }
680
+ handlerSelectedDropdown(event, type) {
681
+ this.outChangStageFlagMouse.emit({
682
+ isMouseEnter: false,
683
+ isMouseEnterContent: false,
684
+ isContainerHasScroll: false,
685
+ });
686
+ if (!event) {
687
+ return;
688
+ }
689
+ switch (type) {
690
+ case `${SideEnum.left}month`:
691
+ case `${SideEnum.right}month`:
692
+ this.updateMonthSelect(event, type);
693
+ break;
694
+ case `${SideEnum.left}year`:
695
+ case `${SideEnum.right}year`:
696
+ this.updateYearSelect(event, type);
697
+ break;
698
+ default:
699
+ break;
700
+ }
701
+ this.splitPickerDate.update((current) => {
702
+ if (type === `${SideEnum.left}month` || type === `${SideEnum.left}year`) {
703
+ current.start.update((start) => {
704
+ if (type === `${SideEnum.left}month`) {
705
+ start.month = event.key;
706
+ }
707
+ if (type === `${SideEnum.left}year`) {
708
+ start.year = event.key;
709
+ }
710
+ return start;
711
+ });
712
+ return current;
713
+ }
714
+ current.end.update((end) => {
715
+ if (type === `${SideEnum.right}month`) {
716
+ end.month = event.key;
717
+ }
718
+ if (type === `${SideEnum.right}year`) {
719
+ end.year = event.key;
720
+ }
721
+ return end;
722
+ });
723
+ return current;
724
+ });
725
+ }
726
+ updateMonthSelect(event, type) {
727
+ const side = type.includes(SideEnum.left) ? SideEnum.left : SideEnum.right;
728
+ const year = this.calendarVariables()[side]().dropdowns?.()?.currentYear || getDayjs().year();
729
+ const month = Number(event.key) - 1;
730
+ if (side === SideEnum.left) {
731
+ if (this.isSelectedData().leftmonth) {
732
+ this.isSelectedData.update((current) => {
733
+ current.leftmonth = false;
734
+ return current;
735
+ });
736
+ this.getDisable('right');
737
+ return;
738
+ }
739
+ this.listKeyFromSelected.update((current) => {
740
+ current.month = event.key;
741
+ return current;
742
+ });
743
+ if (Number(event.key) >= Number(this.listKeyFromSelected().month) && Number(this.listKeyFromSelected().year) === Number(this.listKeyToSelected().year)) {
744
+ if (Number(event.key) <= 11) {
745
+ this.listKeyToSelected.update((current) => {
746
+ current.month = Number(event.key) + 1;
747
+ return current;
748
+ });
749
+ }
750
+ if (Number(event.key) === 12) {
751
+ this.listKeyToSelected.update((current) => {
752
+ current.month = 1;
753
+ current.year += 1;
754
+ return current;
755
+ });
756
+ }
757
+ }
758
+ }
759
+ if (side === SideEnum.right) {
760
+ if (this.isSelectedData().rightmonth) {
761
+ this.isSelectedData.update((current) => {
762
+ current.rightmonth = false;
763
+ return current;
764
+ });
765
+ this.getDisable('right');
766
+ return;
767
+ }
768
+ this.listKeyToSelected.update((current) => {
769
+ current.month = event.key;
770
+ return current;
771
+ });
772
+ }
773
+ this.functionControls.get(type)?.removeList();
774
+ this.getDisable('right');
775
+ this.monthOrYearChanged(month, year, side);
776
+ }
777
+ updateYearSelect(event, type) {
778
+ const side = type.includes(SideEnum.left) ? SideEnum.left : SideEnum.right;
779
+ if (side === SideEnum.left) {
780
+ if (this.isSelectedData()?.leftyear) {
781
+ this.isSelectedData.update((current) => {
782
+ current.leftyear = false;
783
+ return current;
784
+ });
785
+ this.getDisable('left');
786
+ // this.SetListYearRight(this.listViewKeySelectedYear as number);
787
+ this.functionControls.get(type)?.removeList();
788
+ return;
789
+ }
790
+ this.listKeyFromSelected.update((current) => {
791
+ current.year = event.key;
792
+ return current;
793
+ });
794
+ if (this.listKeyFromSelected().year && this.listKeyToSelected().year && this.listKeyFromSelected().year >= this.listKeyToSelected().year) {
795
+ this.listKeyToSelected.update((current) => {
796
+ current.year = event.key;
797
+ return current;
798
+ });
799
+ if (this.listKeyFromSelected().month && Number(this.listKeyFromSelected().month) <= 11) {
800
+ this.listKeyToSelected.update((current) => {
801
+ current.month = Number(this.listKeyFromSelected().month) + 1;
802
+ return current;
803
+ });
804
+ }
805
+ if (this.listKeyFromSelected().month && this.listKeyFromSelected().month === 12) {
806
+ this.listKeyToSelected.update((current) => {
807
+ current.month = Number(this.listKeyFromSelected().month);
808
+ return current;
809
+ });
810
+ }
811
+ }
812
+ this.getDisable('left');
813
+ this.buildConfigYear(SideEnum.right, this.listKeyFromSelected().year);
814
+ this.functionControls.get(type)?.removeList();
815
+ }
816
+ if (side === SideEnum.right) {
817
+ if (this.isSelectedData().rightyear) {
818
+ this.isSelectedData.update((current) => {
819
+ current.rightyear = false;
820
+ return current;
821
+ });
822
+ this.getDisable('right');
823
+ return;
824
+ }
825
+ this.listKeyToSelected.update((current) => {
826
+ current.year = event.key;
827
+ return current;
828
+ });
829
+ if (this.listKeyFromSelected().year && this.listKeyToSelected().year && this.listKeyFromSelected().year >= this.listKeyToSelected().year) {
830
+ if (this.listKeyFromSelected().month && Number(this.listKeyFromSelected().month) <= 11) {
831
+ this.listKeyToSelected.update((current) => {
832
+ current.month = Number(this.listKeyFromSelected().month) + 1;
833
+ return current;
834
+ });
835
+ }
836
+ if (this.listKeyFromSelected().month && this.listKeyFromSelected().month === 12) {
837
+ this.listKeyToSelected.update((current) => {
838
+ current.month = Number(this.listKeyFromSelected().month);
839
+ return current;
840
+ });
841
+ }
842
+ }
843
+ }
844
+ this.getDisable('right');
845
+ let month = getDayjs().month();
846
+ if (side === SideEnum.right && this.listKeyFromSelected().month) {
847
+ month = Number(this.listKeyFromSelected().month) - 1;
848
+ }
849
+ if (side === SideEnum.left && this.listKeyFromSelected().month) {
850
+ month = Number(this.listKeyFromSelected().month) - 1;
851
+ }
852
+ const year = Number(event.key);
853
+ this.monthOrYearChanged(month, year, side);
854
+ }
855
+ monthOrYearChanged(month, year, side) {
856
+ const isLeft = side === SideEnum.left;
857
+ const minDate = getDayjs({ date: this.minDate() });
858
+ const maxDate = getDayjs({ date: this.maxDate() });
859
+ if (minDate && (year < minDate?.year() || (year === minDate?.year() && month < minDate?.month()))) {
860
+ month = minDate?.month();
861
+ year = minDate?.year();
862
+ }
863
+ if (maxDate && (year > maxDate?.year() || (year === maxDate?.year() && month > maxDate?.month()))) {
864
+ month = maxDate?.month();
865
+ year = maxDate?.year();
866
+ }
867
+ const dropdowns = this.calendarVariables()[side]().dropdowns;
868
+ if (dropdowns?.()) {
869
+ dropdowns.update((current) => {
870
+ current.currentYear = year;
871
+ current.currentMonth = month;
872
+ return current;
873
+ });
874
+ }
875
+ if (isLeft && this.leftCalendar().month) {
876
+ this.leftCalendar.update((current) => {
877
+ current.month = current.month?.month(month).year(year);
878
+ return current;
879
+ });
880
+ return this.updateCalendars();
881
+ }
882
+ if (month === 12) {
883
+ this.rightCalendar.update((current) => {
884
+ current.month = current.month?.clone().add(1, 'month');
885
+ return current;
886
+ });
887
+ return this.updateCalendars();
888
+ }
889
+ this.rightCalendar.update((current) => {
890
+ current.month = current.month?.month(month).year(year);
891
+ return current;
892
+ });
893
+ this.updateCalendars();
894
+ }
895
+ handlerInputEvent(event, type) {
896
+ if (event.keyCode !== 8) {
897
+ event.keyCode &&
898
+ this.checkBackspaceFocus.update((current) => {
899
+ current[type].set(1);
900
+ return current;
901
+ });
902
+ this.keyCodeBackspace.set(false);
903
+ return;
904
+ }
905
+ this.keyCodeBackspace.set(true);
906
+ switch (type) {
907
+ case 'leftminute':
908
+ if (isEmpty(this.timepickerValueItem().leftminute())) {
909
+ if (this.checkBackspaceFocus()[type]() === 1) {
910
+ this.checkBackspaceFocus.update((current) => {
911
+ current[type].set(current[type]() + 1);
912
+ return current;
913
+ });
914
+ return;
915
+ }
916
+ this.checkBackspaceFocus.update((current) => {
917
+ current[type].set(1);
918
+ return current;
919
+ });
920
+ this.functionControls.get(`${SideEnum.left}hour`)?.focus();
921
+ }
922
+ break;
923
+ case 'rightminute':
924
+ if (isEmpty(this.timepickerValueItem().rightminute())) {
925
+ if (this.checkBackspaceFocus()[type]() === 1) {
926
+ this.checkBackspaceFocus.update((current) => {
927
+ current[type].set(current[type]() + 1);
928
+ return current;
929
+ });
930
+ return;
931
+ }
932
+ this.checkBackspaceFocus.update((current) => {
933
+ current[type].set(1);
934
+ return current;
935
+ });
936
+ this.functionControls.get(`${SideEnum.right}hour`)?.focus();
937
+ }
938
+ break;
939
+ }
940
+ }
941
+ handlerFocusAndBlurTime(event, type) {
942
+ if (event.name === 'focus') {
943
+ return;
944
+ }
945
+ const eventInput = event.event;
946
+ const target = eventInput.target;
947
+ switch (type) {
948
+ case 'lefthour':
949
+ this.timepickerVariables().left.update((current) => {
950
+ current.selectedHour = !isEmpty(this.timepickerValueItem().lefthour()) ? this.timepickerValueItem().lefthour() : 0;
951
+ return current;
952
+ });
953
+ if (Number(this.timepickerValueItem().lefthour()) === 0 || isEmpty(this.timepickerValueItem().lefthour())) {
954
+ this.timepickerValueItem.update((current) => {
955
+ current.lefthour.set(0);
956
+ return current;
957
+ });
958
+ target.value = '00';
959
+ break;
960
+ }
961
+ if (Number(this.timepickerValueItem().lefthour()) < 10) {
962
+ target.value = `0${Number(this.timepickerValueItem().lefthour())}`;
963
+ }
964
+ break;
965
+ case 'righthour':
966
+ this.timepickerVariables().right.update((current) => {
967
+ current.selectedHour = !isEmpty(this.timepickerValueItem().righthour()) ? this.timepickerValueItem().righthour() : 0;
968
+ return current;
969
+ });
970
+ if (Number(this.timepickerValueItem().righthour()) === 0 || isEmpty(this.timepickerValueItem().righthour())) {
971
+ this.timepickerValueItem.update((current) => {
972
+ current.righthour.set(0);
973
+ return current;
974
+ });
975
+ target.value = '00';
976
+ break;
977
+ }
978
+ if (Number(this.timepickerValueItem().righthour()) < 10) {
979
+ target.value = `0${Number(this.timepickerValueItem().righthour())}`;
980
+ }
981
+ break;
982
+ case 'leftminute':
983
+ this.timepickerVariables().left.update((current) => {
984
+ current.selectedMinute = !isEmpty(this.timepickerValueItem().leftminute()) ? this.timepickerValueItem().leftminute() : 0;
985
+ return current;
986
+ });
987
+ if (Number(this.timepickerValueItem().leftminute()) === 0 || isEmpty(this.timepickerValueItem().leftminute())) {
988
+ this.timepickerValueItem.update((current) => {
989
+ current.leftminute.set(0);
990
+ return current;
991
+ });
992
+ target.value = '00';
993
+ break;
994
+ }
995
+ if (Number(this.timepickerValueItem().leftminute()) < 10) {
996
+ target.value = `0${Number(this.timepickerValueItem().leftminute())}`;
997
+ }
998
+ break;
999
+ case 'rightminute':
1000
+ this.timepickerVariables().right.update((current) => {
1001
+ current.selectedMinute = !isEmpty(this.timepickerValueItem().rightminute()) ? this.timepickerValueItem().rightminute() : 0;
1002
+ return current;
1003
+ });
1004
+ if (Number(this.timepickerValueItem().rightminute()) === 0 || isEmpty(this.timepickerValueItem().rightminute())) {
1005
+ this.timepickerValueItem.update((current) => {
1006
+ current.rightminute.set(0);
1007
+ return current;
1008
+ });
1009
+ target.value = '00';
1010
+ break;
1011
+ }
1012
+ if (Number(this.timepickerValueItem().rightminute()) < 10) {
1013
+ target.value = `0${Number(this.timepickerValueItem().rightminute())}`;
1014
+ }
1015
+ break;
1016
+ }
1017
+ }
1018
+ handlerChangeTimeValue(event, type) {
1019
+ this.timepickerValueItem.update((current) => {
1020
+ current[type].set(event);
1021
+ return current;
1022
+ });
1023
+ const side = type.includes(SideEnum.left) ? SideEnum.left : SideEnum.right;
1024
+ const attr = type.includes('hour') ? 'hour' : 'minute';
1025
+ this.splitPickerDate.update((current) => {
1026
+ current[side === SideEnum.left ? 'start' : 'end'].update((sideCurrent) => {
1027
+ sideCurrent[attr] = event;
1028
+ return sideCurrent;
1029
+ });
1030
+ return current;
1031
+ });
1032
+ if ((type !== 'lefthour' && type !== 'righthour') || event === undefined) {
1033
+ this.isZero.set(false);
1034
+ return;
1035
+ }
1036
+ if (`${event}`.length === 2 || Number(event) > 2 || (Number(event) <= 2 && Number(event) > 0 && this.isZero()) || (this.isZero() && !this.keyCodeBackspace())) {
1037
+ this.isZero.set(false);
1038
+ this.functionControls.get(type === 'lefthour' ? `${SideEnum.left}minute` : `${SideEnum.right}minute`)?.focus();
1039
+ return;
1040
+ }
1041
+ if (Number(event) === 0 && !this.keyCodeBackspace()) {
1042
+ this.isZero.set(true);
1043
+ return;
1044
+ }
1045
+ }
1046
+ handlerShowListDropdown(event, type) {
1047
+ this.checkShowListDropdown.update((current) => {
1048
+ current[type] = event;
1049
+ return current;
1050
+ });
1051
+ }
1052
+ convertItemMonth = (item) => {
1053
+ if (!item) {
1054
+ return '';
1055
+ }
1056
+ set(item, 'labelDisplay', this.translate.instant(item.label || ' ', { year: '' }));
1057
+ return item;
1058
+ };
1059
+ convertItemYear = (item) => {
1060
+ if (!item) {
1061
+ return '';
1062
+ }
1063
+ item.labelDisplay = this.translate.instant('i18n_year_param', { year: item.label });
1064
+ return item;
1065
+ };
1066
+ updateMonthsInView() {
1067
+ if (this.endDate()) {
1068
+ if (!this.isSingle() &&
1069
+ this.leftCalendar().month &&
1070
+ this.rightCalendar().month &&
1071
+ ((this.leftCalendar() && this.startDate()?.format('YYYY-MM') === this.leftCalendar().month?.format('YYYY-MM')) || (this.rightCalendar() && this.startDate()?.format('YYYY-MM') === this.rightCalendar().month?.format('YYYY-MM'))) &&
1072
+ (this.endDate()?.format('YYYY-MM') === this.leftCalendar().month?.format('YYYY-MM') || this.endDate()?.format('YYYY-MM') === this.rightCalendar().month?.format('YYYY-MM'))) {
1073
+ return;
1074
+ }
1075
+ if (this.startDate()) {
1076
+ this.leftCalendar.update((current) => {
1077
+ current.month = this.startDate()?.clone()?.date(2);
1078
+ return current;
1079
+ });
1080
+ if (this.endDate()?.month() !== this.startDate()?.month() || this.endDate()?.year() !== this.startDate()?.year()) {
1081
+ this.rightCalendar.update((current) => {
1082
+ current.month = this.endDate()?.clone()?.date(2);
1083
+ return current;
1084
+ });
1085
+ return;
1086
+ }
1087
+ this.rightCalendar.update((current) => {
1088
+ current.month = this.startDate()?.clone()?.date(2)?.add(1, 'month');
1089
+ return current;
1090
+ });
1091
+ }
1092
+ }
1093
+ if (this.startDate() &&
1094
+ this.leftCalendar().month &&
1095
+ this.rightCalendar().month &&
1096
+ this.leftCalendar().month?.format('YYYY-MM') !== this.startDate()?.format('YYYY-MM') &&
1097
+ this.rightCalendar().month?.format('YYYY-MM') !== this.startDate()?.format('YYYY-MM')) {
1098
+ this.leftCalendar.update((current) => {
1099
+ current.month = this.startDate()?.clone()?.date(2);
1100
+ return current;
1101
+ });
1102
+ this.rightCalendar.update((current) => {
1103
+ current.month = this.startDate()?.clone()?.date(2)?.add(1, 'month');
1104
+ return current;
1105
+ });
1106
+ }
1107
+ }
1108
+ setTimeInput(side) {
1109
+ const hour = parseInt(`${this.timepickerVariables()[side]().selectedHour}`);
1110
+ const minute = parseInt(`${this.timepickerVariables()[side]().selectedMinute}`);
1111
+ if (side === SideEnum.left && this.startDate()) {
1112
+ let start = this.startDate()?.clone();
1113
+ start = start?.hour(hour);
1114
+ start = start?.minute(minute);
1115
+ this.setStartDate(start);
1116
+ if (this.isSingle()) {
1117
+ this.endDate.set(this.startDate()?.clone());
1118
+ }
1119
+ if (this.endDate() && this.endDate()?.format('YYYY-MM-DD') === start?.format('YYYY-MM-DD') && this.endDate()?.isBefore(start)) {
1120
+ this.setEndDate(start?.clone());
1121
+ }
1122
+ if (!this.endDate() && start && this.hasTimePicker()) {
1123
+ const startClone = this.getDateWithTime(start, SideEnum.right);
1124
+ if (startClone.isBefore(start)) {
1125
+ this.timepickerVariables()[SideEnum.right].update((current) => {
1126
+ current.selectedHour = hour;
1127
+ current.selectedMinute = minute;
1128
+ return current;
1129
+ });
1130
+ }
1131
+ }
1132
+ return;
1133
+ }
1134
+ if (this.endDate()) {
1135
+ let end = this.endDate()?.clone();
1136
+ end = end?.hour(hour);
1137
+ end = end?.minute(minute);
1138
+ this.setEndDate(end);
1139
+ }
1140
+ this.updateCalendars();
1141
+ this.renderTimePicker(SideEnum.left);
1142
+ this.renderTimePicker(SideEnum.right);
1143
+ }
1144
+ updateCalendars() {
1145
+ this.renderCalendar(SideEnum.left);
1146
+ this.renderCalendar(SideEnum.right);
1147
+ if (this.endDate() === null) {
1148
+ return;
1149
+ }
1150
+ this.calculateSelectedLabel();
1151
+ }
1152
+ renderCalendar(side) {
1153
+ // side enum
1154
+ const mainCalendar = side === SideEnum.left ? this.leftCalendar() : this.rightCalendar();
1155
+ if (!mainCalendar.month || this.dateOptions().firstDay === undefined || this.dateOptions().firstDay === undefined) {
1156
+ return;
1157
+ }
1158
+ const month = mainCalendar.month.month();
1159
+ const year = mainCalendar.month.year();
1160
+ const hour = mainCalendar.month.hour();
1161
+ const minute = mainCalendar.month.minute();
1162
+ const second = mainCalendar.month.second();
1163
+ const daysInMonth = getDayjs({ date: new Date(year, month) }).daysInMonth();
1164
+ const firstDay = getDayjs({ date: new Date(year, month, 1) });
1165
+ const lastDay = getDayjs({ date: new Date(year, month, daysInMonth) });
1166
+ const lastMonth = getDayjs({ date: firstDay.subtract(1, 'month') }).month();
1167
+ const lastYear = getDayjs({ date: firstDay.subtract(1, 'month') }).year();
1168
+ const daysInLastMonth = getDayjs({ date: new Date(lastYear, lastMonth) }).daysInMonth();
1169
+ const dayOfWeek = firstDay.day();
1170
+ const calendar = {};
1171
+ calendar.firstDay = firstDay;
1172
+ calendar.lastDay = lastDay;
1173
+ for (let i = 0; i < 6; i++) {
1174
+ calendar[i] = [];
1175
+ }
1176
+ let startDay = daysInLastMonth - dayOfWeek + (this.dateOptions().firstDay ?? 1) + 1;
1177
+ if (startDay > daysInLastMonth) {
1178
+ startDay -= 7;
1179
+ }
1180
+ if (dayOfWeek === this.dateOptions().firstDay) {
1181
+ startDay = daysInLastMonth - 6;
1182
+ }
1183
+ let curDate = getDayjs({ date: new Date(lastYear, lastMonth, startDay, 12, minute, second) });
1184
+ for (let i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = getDayjs({ date: curDate }).add(24, 'hour')) {
1185
+ if (i > 0 && col % 7 === 0) {
1186
+ col = 0;
1187
+ row++;
1188
+ }
1189
+ calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second);
1190
+ curDate = curDate.hour(12);
1191
+ const minDate = getDayjs({ date: this.minDate() });
1192
+ const maxDate = getDayjs({ date: this.maxDate() });
1193
+ if (minDate && calendar[row][col].format('YYYY-MM-DD') === minDate?.format('YYYY-MM-DD') && calendar[row][col].isBefore(minDate) && side === 'left') {
1194
+ calendar[row][col] = minDate?.clone();
1195
+ }
1196
+ if (maxDate && calendar[row][col].format('YYYY-MM-DD') === maxDate?.format('YYYY-MM-DD') && calendar[row][col].isAfter(maxDate) && side === 'right') {
1197
+ calendar[row][col] = maxDate?.clone();
1198
+ }
1199
+ }
1200
+ if (side === SideEnum.left) {
1201
+ this.leftCalendar.update((current) => {
1202
+ current.calendar = calendar;
1203
+ return current;
1204
+ });
1205
+ }
1206
+ if (side === SideEnum.right) {
1207
+ this.rightCalendar.update((current) => {
1208
+ current.calendar = calendar;
1209
+ return current;
1210
+ });
1211
+ }
1212
+ const minDate = side === 'left' ? getDayjs({ date: this.minDate() }) : getDayjs({ date: this.startDate() });
1213
+ const maxDate = getDayjs({ date: this.maxDate() });
1214
+ this.calendarVariables()[side].set({
1215
+ month: month,
1216
+ year: year,
1217
+ hour: hour,
1218
+ minute: minute,
1219
+ second: second,
1220
+ daysInMonth: daysInMonth,
1221
+ firstDay: firstDay,
1222
+ lastDay: lastDay,
1223
+ lastMonth: lastMonth,
1224
+ lastYear: lastYear,
1225
+ daysInLastMonth: daysInLastMonth,
1226
+ dayOfWeek: dayOfWeek,
1227
+ calRows: signal(Array.from(Array(6).keys())),
1228
+ calCols: signal(Array.from(Array(7).keys())),
1229
+ classes: {},
1230
+ minDate: minDate,
1231
+ maxDate: maxDate,
1232
+ calendar: calendar,
1233
+ dropdowns: signal({}),
1234
+ });
1235
+ if (this.showDropdownsSelect()) {
1236
+ const currentMonth = calendar[1][1].month();
1237
+ const currentYear = calendar[1][1].year();
1238
+ const maxYear = maxDate?.year() ?? DEFAULT_MAX_YEAR;
1239
+ const minYear = minDate?.year() ?? DEFAULT_MIN_YEAR;
1240
+ const inMinYear = currentYear === minYear;
1241
+ const inMaxYear = currentYear === maxYear;
1242
+ const years = [];
1243
+ for (let y = minYear; y <= maxYear; y++) {
1244
+ years.push(y);
1245
+ }
1246
+ this.calendarVariables()[side]()
1247
+ .dropdowns?.set({
1248
+ currentMonth: currentMonth,
1249
+ currentYear: currentYear,
1250
+ maxYear: maxYear,
1251
+ minYear: minYear,
1252
+ inMinYear: inMinYear,
1253
+ inMaxYear: inMaxYear,
1254
+ monthArrays: signal(Array.from(Array(12).keys())),
1255
+ yearArrays: signal(years),
1256
+ });
1257
+ }
1258
+ this.buildCells(calendar, side);
1259
+ }
1260
+ buildCells(calendar, side) {
1261
+ for (let row = 0; row < 6; row++) {
1262
+ const classless = this.calendarVariables()[side]();
1263
+ if (classless.classes) {
1264
+ classless.classes[row] = {};
1265
+ }
1266
+ for (let col = 0; col < 7; col++) {
1267
+ const classes = [];
1268
+ const startDate = getDayjs({ date: this.startDate() });
1269
+ const endDate = getDayjs({ date: this.endDate() });
1270
+ const nowHoveredDate = this.nowHoveredDate();
1271
+ if (calendar[row][col].isSame(new Date(), 'day')) {
1272
+ classes.push('today');
1273
+ }
1274
+ if (calendar[row][col].isoWeekday() > 5) {
1275
+ classes.push('weekend');
1276
+ }
1277
+ if (calendar[row][col].month() !== calendar[1][1].month()) {
1278
+ classes.push('off');
1279
+ }
1280
+ if (this.minDate() && calendar[row][col].isBefore(this.minDate(), 'day')) {
1281
+ classes.push('off', 'disabled');
1282
+ }
1283
+ if (this.calendarVariables()[side]().maxDate && calendar[row][col].isAfter(this.calendarVariables()[side]().maxDate, 'day')) {
1284
+ classes.push('off', 'disabled');
1285
+ }
1286
+ if (startDate && calendar[row][col].format('YYYY-MM-DD') === startDate?.format('YYYY-MM-DD')) {
1287
+ classes.push('active', 'start-date');
1288
+ }
1289
+ if (endDate !== null && calendar[row][col].format('YYYY-MM-DD') === endDate?.format('YYYY-MM-DD')) {
1290
+ classes.push('active', 'end-date');
1291
+ }
1292
+ if (startDate && calendar[row][col].format('YYYY-MM-DD') === startDate?.format('YYYY-MM-DD') && (!endDate || (endDate !== null && calendar[row][col].format('YYYY-MM-DD') === endDate?.format('YYYY-MM-DD')))) {
1293
+ classes.push('active', 'full-date');
1294
+ }
1295
+ if (startDate &&
1296
+ endDate &&
1297
+ ((nowHoveredDate !== null && this.pickingDate()) || endDate !== null) &&
1298
+ calendar[row][col] > startDate &&
1299
+ (calendar[row][col] < endDate || (nowHoveredDate && calendar[row][col] < nowHoveredDate && this.pickingDate()))) {
1300
+ classes.push(!classes.find((el) => el === 'off') ? 'in-range' : 'focus-off');
1301
+ }
1302
+ let cname = '', disabled = false;
1303
+ for (let i = 0; i < classes.length; i++) {
1304
+ cname += classes[i] + ' ';
1305
+ if (classes[i] === 'disabled') {
1306
+ disabled = true;
1307
+ }
1308
+ }
1309
+ if (!disabled) {
1310
+ cname += 'available';
1311
+ }
1312
+ if (classless.classes) {
1313
+ classless.classes[row][col] = cname.replace(/^\s+|\s+$/g, '');
1314
+ }
1315
+ }
1316
+ }
1317
+ }
1318
+ renderTimePicker(side) {
1319
+ let selected = getDayjs(), minDate;
1320
+ const maxDate = getDayjs({ date: this.maxDate() });
1321
+ const startDate = getDayjs({ date: this.startDate() });
1322
+ const endDate = getDayjs({ date: this.endDate() });
1323
+ if (side === SideEnum.left && startDate) {
1324
+ selected = startDate.clone();
1325
+ minDate = this.maxDate();
1326
+ }
1327
+ if (side === SideEnum.right && endDate) {
1328
+ selected = endDate.clone();
1329
+ minDate = this.startDate();
1330
+ }
1331
+ if (side === SideEnum.right && !endDate) {
1332
+ if (!startDate) {
1333
+ return;
1334
+ }
1335
+ selected = getDayjs({ date: this.getDateWithTime(startDate, SideEnum.right) });
1336
+ if (selected.isBefore(startDate)) {
1337
+ selected = startDate.clone();
1338
+ }
1339
+ minDate = startDate;
1340
+ }
1341
+ const start = 0;
1342
+ const end = 23;
1343
+ this.timepickerVariables()[side].set({
1344
+ hours: [],
1345
+ minutes: [],
1346
+ minutesLabel: [],
1347
+ seconds: [],
1348
+ secondsLabel: [],
1349
+ disabledHours: [],
1350
+ disabledMinutes: [],
1351
+ disabledSeconds: [],
1352
+ selectedHour: 0,
1353
+ selectedMinute: 0,
1354
+ selectedSecond: 0,
1355
+ });
1356
+ for (let i = start; i <= end; i++) {
1357
+ const i_in_24 = i;
1358
+ const time = selected.clone().hour(i_in_24);
1359
+ let disabled = false;
1360
+ if (minDate && time.minute(59).isBefore(minDate)) {
1361
+ disabled = true;
1362
+ }
1363
+ if (maxDate && time.minute(0).isAfter(maxDate)) {
1364
+ disabled = true;
1365
+ }
1366
+ this.timepickerVariables()[side].update((current) => {
1367
+ current.hours?.push(i);
1368
+ if (i_in_24 === selected.hour() && !disabled) {
1369
+ current.selectedHour = i;
1370
+ }
1371
+ if (disabled) {
1372
+ current.disabledHours?.push(i);
1373
+ }
1374
+ return current;
1375
+ });
1376
+ }
1377
+ for (let i = 0; i < 60; i += this.timePickerIncrement()) {
1378
+ const padded = i < 10 ? '0' + i : `${i}`;
1379
+ const time = selected.clone().minute(i);
1380
+ let disabled = false;
1381
+ if (minDate && time.second(59).isBefore(minDate)) {
1382
+ disabled = true;
1383
+ }
1384
+ if (maxDate && time.second(0).isAfter(maxDate)) {
1385
+ disabled = true;
1386
+ }
1387
+ this.timepickerVariables()[side].update((current) => {
1388
+ current.minutes?.push(i);
1389
+ current.minutesLabel?.push(padded);
1390
+ if (selected.minute() === i && !disabled) {
1391
+ current.selectedMinute = i;
1392
+ }
1393
+ if (disabled) {
1394
+ current.disabledMinutes?.push(i);
1395
+ }
1396
+ return current;
1397
+ });
1398
+ }
1399
+ this.timepickerVariables()[side].update((current) => {
1400
+ current.selected = selected;
1401
+ return current;
1402
+ });
1403
+ }
1404
+ updateElement() {
1405
+ if (!this.startDate()) {
1406
+ return;
1407
+ }
1408
+ if (this.isSingle()) {
1409
+ this.selectedLabel.set(this.startDate()?.format('DD/MM/YYYY'));
1410
+ return;
1411
+ }
1412
+ if (this.endDate()) {
1413
+ // if we use ranges and should show range label on input
1414
+ if (this.quickRangesArray().length && this.showRangeLabelOnInput() && this.selectedQuickRange() && this.dateOptions().customRangeLabel !== this.selectedQuickRange()) {
1415
+ this.selectedLabel.set(this.selectedQuickRange());
1416
+ return;
1417
+ }
1418
+ this.selectedLabel.set(`${this.startDate()?.format('DD/MM/YYYY')}${this.dateOptions().separator}${this.endDate()?.format('DD/MM/YYYY')}`);
1419
+ return;
1420
+ }
1421
+ this.selectedLabel.set(`${this.startDate()?.format('DD/MM/YYYY')}${this.dateOptions().separator}${this.startDate()?.format('DD/MM/YYYY')}`);
1422
+ }
1423
+ updateView() {
1424
+ if (this.hasTimePicker()) {
1425
+ this.renderTimePicker(SideEnum.left);
1426
+ this.renderTimePicker(SideEnum.right);
1427
+ }
1428
+ this.updateMonthsInView();
1429
+ this.updateCalendars();
1430
+ }
1431
+ getDateWithTime(date, side) {
1432
+ const hour = parseInt(`${this.timepickerVariables()[side]().selectedHour}`, 10);
1433
+ const minute = parseInt(`${this.timepickerVariables()[side]().selectedMinute}`, 10);
1434
+ const second = this.hasSecondPicker() && !isEmpty(this.timepickerVariables()[side]().selectedSecond) ? parseInt(`${this.timepickerVariables()[side]().selectedSecond}`, 10) : 0;
1435
+ return date.clone().hour(hour).minute(minute).second(second);
1436
+ }
1437
+ transformMinMaxDate(value) {
1438
+ if (isEmpty(value)) {
1439
+ return undefined;
1440
+ }
1441
+ if (dayjs.isDayjs(value)) {
1442
+ return value;
1443
+ }
1444
+ if (typeof value === 'string') {
1445
+ return getDayjs({ date: value });
1446
+ }
1447
+ return undefined;
1448
+ }
1449
+ computedDisplayTime(side) {
1450
+ let strHours = side.selectedHour;
1451
+ let strMinute = side.selectedMinute;
1452
+ if ((side.selectedHour || 0) < 10) {
1453
+ strHours = `0${side.selectedHour ?? 0}`;
1454
+ }
1455
+ if ((side.selectedMinute || 0) < 10) {
1456
+ strMinute = `0${side.selectedMinute ?? 0}`;
1457
+ }
1458
+ return `${strHours}:${strMinute}`;
1459
+ }
1460
+ computedDisplayTimeInput(side, timeType) {
1461
+ const time = timeType === 'hour' ? (side === SideEnum.left ? this.timepickerValueItem().lefthour() : this.timepickerValueItem().righthour()) : side === SideEnum.left ? this.timepickerValueItem().leftminute() : this.timepickerValueItem().rightminute();
1462
+ if (!time) {
1463
+ return '00';
1464
+ }
1465
+ if (time < 10) {
1466
+ return `0${time}`;
1467
+ }
1468
+ return time;
1469
+ }
1470
+ ngOnDestroy() {
1471
+ return;
1472
+ }
1473
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsDatetimePickerCustomRangesCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1474
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsDatetimePickerCustomRangesCalendarComponent, isStandalone: true, selector: "libs_ui-components-datetime-picker-custom_ranges-calendar", inputs: { quickRangesArray: { classPropertyName: "quickRangesArray", publicName: "quickRangesArray", isSignal: true, isRequired: false, transformFunction: null }, zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, classInclude: { classPropertyName: "classInclude", publicName: "classInclude", isSignal: true, isRequired: false, transformFunction: null }, isSingle: { classPropertyName: "isSingle", publicName: "isSingle", isSignal: true, isRequired: false, transformFunction: null }, showDropdownsSelect: { classPropertyName: "showDropdownsSelect", publicName: "showDropdownsSelect", isSignal: true, isRequired: false, transformFunction: null }, hasTimePicker: { classPropertyName: "hasTimePicker", publicName: "hasTimePicker", isSignal: true, isRequired: false, transformFunction: null }, flagMouse: { classPropertyName: "flagMouse", publicName: "flagMouse", isSignal: true, isRequired: false, transformFunction: null }, dateOptions: { classPropertyName: "dateOptions", publicName: "dateOptions", isSignal: true, isRequired: false, transformFunction: null }, autoApply: { classPropertyName: "autoApply", publicName: "autoApply", isSignal: true, isRequired: false, transformFunction: null }, hasSecondPicker: { classPropertyName: "hasSecondPicker", publicName: "hasSecondPicker", isSignal: true, isRequired: false, transformFunction: null }, showRangeLabelOnInput: { classPropertyName: "showRangeLabelOnInput", publicName: "showRangeLabelOnInput", isSignal: true, isRequired: false, transformFunction: null }, startDate: { classPropertyName: "startDate", publicName: "startDate", isSignal: true, isRequired: false, transformFunction: null }, endDate: { classPropertyName: "endDate", publicName: "endDate", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, listYearHiddenInputSearch: { classPropertyName: "listYearHiddenInputSearch", publicName: "listYearHiddenInputSearch", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { startDate: "startDateChange", endDate: "endDateChange", outChangStageFlagMouse: "outChangStageFlagMouse", outPickerDate: "outPickerDate", outCancel: "outCancel", outUpdateWidth: "outUpdateWidth", outFunctionsControl: "outFunctionsControl" }, viewQueries: [{ propertyName: "pickerContainer", first: true, predicate: ["pickerContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"libs-ui-component-custom_ranges-calendar test-class\">\n <div class=\"relative flex\">\n <div\n class=\"libs-ui-component-custom_ranges-calendar\"\n [class.right]=\"isSingle()\"\n [class.left]=\"!isSingle()\">\n <div class=\"rounded-[4px] bg-[#ffffff]\">\n @if (calendarVariables(); as calendarVariables) {\n <table>\n <thead>\n <tr>\n <th\n colspan=\"7\"\n class=\"month\">\n @if (showDropdownsSelect() && calendarVariables.left().dropdowns?.()) {\n <div class=\"!flex mb-[10px] w-full\">\n <div class=\"w-3/4 flex items-center\">\n <div class=\"mr-[8px]\">\n <libs_ui-components-dropdown\n [isNgContent]=\"true\"\n [zIndex]=\"zIndex() + 1\"\n [popoverCustomConfig]=\"{ widthByParent: false, ignoreArrow: true, paddingLeftItem: true, classInclude: '!w-[130px]', position: { mode: 'center', distance: 0 } }\"\n [listMaxItemShow]=\"10\"\n [listClickExactly]=\"false\"\n [listKeysDisable]=\"disableMonth().left()\"\n [listHasButtonUnSelectOption]=\"false\"\n [convertItemSelected]=\"convertItemMonth\"\n [listConfig]=\"listMonthsConfig()\"\n [listKeySelected]=\"listKeyFromSelected().month\"\n [flagMouse]=\"flagMouse()\"\n [listHiddenInputSearch]=\"true\"\n [httpRequestDetailItemById]=\"monthHttpDetailConfig()\"\n (outSelectKey)=\"handlerSelectedDropdown($event, sideEnum.left + 'month')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.left + 'month')\"\n (outChangStageFlagMouse)=\"handlerChangeFlagMouse($event)\"\n (outShowList)=\"handlerShowListDropdown($event, sideEnum.left + 'month')\">\n <div\n class=\"libs-ui-component-custom_ranges-calendar-dropdown\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.left + 'month']\"\n [class.text-[#6a7383]]=\"!checkShowListDropdown()[sideEnum.left + 'month']\">\n <div\n class=\"libs-ui-font-h4m\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ dateOptions().monthNames && calendarVariables.left().calendar && dateOptions().monthNames[calendarVariables.left().calendar?.[1]?.[1]?.month() ?? -1] }}\n </div>\n <i\n class=\"libs-ui-icon-chevron-right text-[13px] text-[#6a7383]\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.left + 'month']\"\n [style.fontWeight]=\"500\"\n [style.rotate]=\"!checkShowListDropdown()[sideEnum.left + 'month'] ? '90deg' : '270deg'\"></i>\n </div>\n </libs_ui-components-dropdown>\n </div>\n <div>\n <libs_ui-components-dropdown\n [listMaxItemShow]=\"10\"\n [isNgContent]=\"true\"\n [zIndex]=\"zIndex() + 1\"\n [popoverCustomConfig]=\"{ widthByParent: false, ignoreArrow: true, paddingLeftItem: true, classInclude: '!w-[110px]', position: { mode: 'center', distance: 0 } }\"\n [listClickExactly]=\"false\"\n [listHasButtonUnSelectOption]=\"false\"\n [convertItemSelected]=\"convertItemYear\"\n [listHiddenInputSearch]=\"listYearHiddenInputSearch()\"\n [listConfig]=\"listLeftYearConfig()\"\n [listKeySelected]=\"listKeyFromSelected().year\"\n [flagMouse]=\"flagMouse()\"\n [httpRequestDetailItemById]=\"leftYearHttpDetailConfig()\"\n (outChangStageFlagMouse)=\"handlerChangeFlagMouse($event)\"\n (outShowList)=\"handlerShowListDropdown($event, sideEnum.left + 'year')\"\n (outSelectKey)=\"handlerSelectedDropdown($event, sideEnum.left + 'year')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.left + 'year')\">\n <div\n class=\"libs-ui-component-custom_ranges-calendar-dropdown\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.left + 'year']\"\n [class.text-[#6a7383]]=\"!checkShowListDropdown()[sideEnum.left + 'year']\">\n <div\n class=\"libs-ui-font-h4m\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ calendarVariables.left().calendar && calendarVariables.left().calendar?.[1]?.[1]?.format(' YYYY') }}\n </div>\n <i\n class=\"libs-ui-icon-chevron-right text-[13px] text-[#6a7383]\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.left + 'year']\"\n [style.fontWeight]=\"500\"\n [style.rotate]=\"!checkShowListDropdown()[sideEnum.left + 'year'] ? '90deg' : '270deg'\"></i>\n </div>\n </libs_ui-components-dropdown>\n </div>\n </div>\n\n <div class=\"w-1/4 flex items-center relative\">\n @if (!calendarVariables.left().minDate || calendarVariables.left().minDate?.isBefore(calendarVariables.left().calendar && calendarVariables.left().calendar?.firstDay)) {\n <div (click)=\"handlerClickPrev(sideEnum.left)\">\n <div class=\"flex items-center justify-center absolute left-0 top-[-3px]\">\n <i class=\"libs-ui-icon-chevron-right rotate-[180deg] text-[#6a7383] cursor-pointer libs-ui-component-custom_ranges-calendar-icon\"></i>\n </div>\n </div>\n }\n @if ((!calendarVariables.left().maxDate || calendarVariables.left().maxDate?.isAfter(calendarVariables.left().calendar && calendarVariables.left().calendar?.lastDay)) && isSingle()) {\n <div (click)=\"handlerClickNext(sideEnum.left)\">\n <div class=\"flex items-center justify-center ml-[12px] absolute right-0 top-[-3px]\">\n <i class=\"libs-ui-icon-chevron-right text-[#6a7383] cursor-pointer libs-ui-component-custom_ranges-calendar-icon\"></i>\n </div>\n </div>\n }\n </div>\n </div>\n }\n @if (!showDropdownsSelect() || !calendarVariables.left().dropdowns) {\n {{ dateOptions().monthNames && calendarVariables.left().calendar && dateOptions().monthNames[calendarVariables.left().calendar?.[1]?.[1]?.month() ?? -1] }}\n {{ calendarVariables.left().calendar && calendarVariables.left().calendar?.[1]?.[1]?.format(' YYYY') }}\n }\n </th>\n </tr>\n <tr class=\"week-days\">\n @for (dayofweek of dateOptions().daysOfWeek; track dayofweek) {\n <th>\n <span\n class=\"libs-ui-font-h6m text-[#6a7383]\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ dayofweek }}\n </span>\n </th>\n }\n </tr>\n </thead>\n <tbody class=\"drp-animate\">\n @for (row of calendarVariables.left().calRows?.(); track row) {\n <tr\n class=\"h-[32px]\"\n [class]=\"calendarVariables.left().classes && calendarVariables.left().classes?.[row]?.classList\">\n @for (col of calendarVariables.left().calCols?.(); track col) {\n <td\n class=\"libs-ui-font-h5r\"\n [class.today]=\"\n calendarVariables.left().calendar &&\n calendarVariables.left().calendar?.[row]?.[col]?.date() === today().date() &&\n calendarVariables.left().calendar?.[row]?.[col]?.month() === today().month() &&\n calendarVariables.left().calendar?.[row]?.[col]?.year() === today().year()\n \"\n [class]=\"calendarVariables.left().classes && calendarVariables.left().classes?.[row]?.[col]\"\n (click)=\"handlerPickerDate($event, sideEnum.left, row, col)\"\n (mouseenter)=\"handlerHoverDate($event, sideEnum.left, row, col)\">\n <span class=\"libs-ui-font-h5r\">{{ calendarVariables.left().calendar && calendarVariables.left().calendar?.[row]?.[col]?.date() }}</span>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n </div>\n @if (hasTimePicker()) {\n <div>\n <div class=\"flex justify-center column items-center pt-[12px]\">\n <div\n class=\"w-full flex justify-center items-center rounded-[4px] border\"\n [class.border-[#e6e8ed]]=\"!timePickerError()\"\n [class.border-[#ff5454]]=\"timePickerError()\">\n <libs_ui-components-inputs-input\n classInclude=\"!w-[30px] !p-0 !border-none !text-center libs-ui-font-h4s !text-[#071631]\"\n dataType=\"int\"\n [focusTimeOut]=\"0\"\n [blurTimeOut]=\"0\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [maxValueNumber]=\"23\"\n [minValueNumber]=\"0\"\n [maxLength]=\"2\"\n [value]=\"timepickerValueItem().lefthour()\"\n (outInputEvent)=\"handlerInputEvent($event, 'lefthour')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.left + 'hour')\"\n (outChange)=\"handlerChangeTimeValue($event, 'lefthour')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurTime($event, 'lefthour')\" />\n <span class=\"libs-ui-font-h3s text-[#333333]\">:</span>\n <libs_ui-components-inputs-input\n classInclude=\"!w-[30px] !p-0 !border-none !text-center !libs-ui-font-h4s !text-[#071631]\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n dataType=\"int\"\n [focusTimeOut]=\"0\"\n [blurTimeOut]=\"0\"\n [maxValueNumber]=\"59\"\n [minValueNumber]=\"0\"\n [maxLength]=\"2\"\n [value]=\"timepickerValueItem().leftminute()\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.left + 'minute')\"\n (outInputEvent)=\"handlerInputEvent($event, 'leftminute')\"\n (outChange)=\"handlerChangeTimeValue($event, 'leftminute')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurTime($event, 'leftminute')\" />\n </div>\n </div>\n </div>\n }\n </div>\n\n @if (!isSingle()) {\n <div class=\"libs-ui-component-custom_ranges-calendar right ml-[24px]\">\n <div class=\"rounded-[4px] bg-[#ffffff]\">\n @if (calendarVariables()) {\n <table>\n <thead>\n <tr>\n <th\n colspan=\"7\"\n class=\"month\">\n @if (showDropdownsSelect() && calendarVariables().left().dropdowns?.()) {\n <div class=\"!flex mb-[10px] w-full\">\n <div class=\"w-3/4 flex items-center\">\n <div class=\"mr-[8px]\">\n <libs_ui-components-dropdown\n [isNgContent]=\"true\"\n [zIndex]=\"zIndex() + 1\"\n [popoverCustomConfig]=\"{ widthByParent: false, ignoreArrow: true, paddingLeftItem: true, classInclude: '!w-[130px]', position: { mode: 'center', distance: 0 } }\"\n [listMaxItemShow]=\"10\"\n [listClickExactly]=\"false\"\n [listKeysDisable]=\"disableMonth().right()\"\n [listHasButtonUnSelectOption]=\"false\"\n [convertItemSelected]=\"convertItemMonth\"\n [listHiddenInputSearch]=\"true\"\n [listConfig]=\"listMonthsConfig()\"\n [listKeySelected]=\"listKeyToSelected().month\"\n [flagMouse]=\"flagMouse()\"\n [httpRequestDetailItemById]=\"monthHttpDetailConfig()\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.right + 'month')\"\n (outSelectKey)=\"handlerSelectedDropdown($event, sideEnum.right + 'month')\"\n (outChangStageFlagMouse)=\"handlerChangeFlagMouse($event)\"\n (outShowList)=\"handlerShowListDropdown($event, sideEnum.right + 'month')\">\n <div\n class=\"libs-ui-component-custom_ranges-calendar-dropdown\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.right + 'month']\"\n [class.text-[#6a7383]]=\"!checkShowListDropdown()[sideEnum.right + 'month']\">\n <div\n class=\"libs-ui-font-h4m\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.right + 'month']\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ dateOptions().monthNames && calendarVariables().right().calendar && dateOptions().monthNames[calendarVariables().right().calendar?.[1]?.[1]?.month() ?? -1] }}\n </div>\n <i\n class=\"libs-ui-icon-chevron-right text-[13px] text-[#6a7383]\"\n [style.fontWeight]=\"500\"\n [style.rotate]=\"!checkShowListDropdown()[sideEnum.right + 'month'] ? '90deg' : '270deg'\"></i>\n </div>\n </libs_ui-components-dropdown>\n </div>\n <div>\n <libs_ui-components-dropdown\n [listMaxItemShow]=\"10\"\n [zIndex]=\"zIndex() + 1\"\n [isNgContent]=\"true\"\n [popoverCustomConfig]=\"{ widthByParent: false, ignoreArrow: true, paddingLeftItem: true, classInclude: '!w-[110px]', position: { mode: 'center', distance: 0 } }\"\n [listClickExactly]=\"false\"\n [listHasButtonUnSelectOption]=\"false\"\n [convertItemSelected]=\"convertItemYear\"\n [listHiddenInputSearch]=\"listYearHiddenInputSearch()\"\n [listConfig]=\"listRightYearConfig()\"\n [listKeySelected]=\"listKeyToSelected().year\"\n [flagMouse]=\"flagMouse()\"\n [httpRequestDetailItemById]=\"rightYearHttpDetailConfig()\"\n (outSelectKey)=\"handlerSelectedDropdown($event, sideEnum.right + 'year')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.right + 'year')\"\n (outChangStageFlagMouse)=\"handlerChangeFlagMouse($event)\"\n (outShowList)=\"handlerShowListDropdown($event, sideEnum.right + 'year')\">\n <div\n class=\"libs-ui-component-custom_ranges-calendar-dropdown\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.right + 'year']\"\n [class.text-[#6a7383]]=\"!checkShowListDropdown()[sideEnum.right + 'year']\">\n <div\n class=\"libs-ui-font-h4m\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ calendarVariables().right().calendar && calendarVariables().right().calendar?.[1]?.[1]?.format('YYYY') }}\n </div>\n <i\n class=\"libs-ui-icon-chevron-right text-[13px] text-[#6a7383]\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.right + 'year']\"\n [style.fontWeight]=\"500\"\n [style.rotate]=\"!checkShowListDropdown()[sideEnum.right + 'year'] ? '90deg' : '270deg'\"></i>\n </div>\n </libs_ui-components-dropdown>\n </div>\n </div>\n <div class=\"w-1/4 flex items-center relative\">\n @if (\n (listKeyFromSelected().year &&\n listKeyToSelected().year &&\n !(listKeyFromSelected().year + 1 === listKeyToSelected().year && listKeyFromSelected().month === 12 && listKeyToSelected().month === 1) &&\n listKeyFromSelected().year < listKeyToSelected().year) ||\n (listKeyFromSelected().month && listKeyToSelected().month && listKeyFromSelected().month + 1 < +listKeyToSelected().month)\n ) {\n <div\n class=\"flex items-center justify-center absolute left-0 top-[-3px]\"\n (click)=\"handlerClickPrev(sideEnum.right)\">\n <i class=\"libs-ui-icon-chevron-right rotate-[180deg] text-[#6a7383] cursor-pointer libs-ui-component-custom_ranges-calendar-icon\"></i>\n </div>\n }\n @if (\n listKeyFromSelected().month &&\n listKeyToSelected().month &&\n listKeyFromSelected().month > listKeyToSelected().month &&\n listKeyFromSelected().year &&\n listKeyToSelected().year &&\n listKeyFromSelected().year === listKeyToSelected().year\n ) {\n <div class=\"bg-[#ffffff] w-[21px] h-[21px] cursor-none flex items-center justify-center rounded-[50px]\"></div>\n }\n @if (\n !calendarVariables().right().maxDate ||\n calendarVariables()\n .right()\n .maxDate?.isAfter(calendarVariables().right().calendar && calendarVariables().right().calendar?.lastDay)\n ) {\n <div (click)=\"handlerClickNext(sideEnum.right)\">\n <div class=\"flex items-center justify-center ml-[12px] absolute right-0 top-[-3px]\">\n <i class=\"libs-ui-icon-chevron-right text-[#6a7383] cursor-pointer libs-ui-component-custom_ranges-calendar-icon\"></i>\n </div>\n </div>\n }\n </div>\n </div>\n }\n @if (!showDropdownsSelect() || !calendarVariables().right().dropdowns) {\n {{ dateOptions().monthNames && calendarVariables().right().calendar && dateOptions().monthNames[calendarVariables().right().calendar?.[1]?.[1]?.month() ?? -1] }}\n {{ calendarVariables().right().calendar && calendarVariables().right().calendar?.[1]?.[1]?.format('YYYY') }}\n }\n </th>\n </tr>\n <tr class=\"week-days\">\n @for (dayofweek of dateOptions().daysOfWeek; track dayofweek) {\n <th>\n <span\n class=\"libs-ui-font-h6m text-[#6a7383]\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ dayofweek }}\n </span>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of calendarVariables().right().calRows?.(); track row) {\n <tr\n class=\"h-[32px]\"\n [class]=\"calendarVariables().right().classes && calendarVariables().right().classes?.[row]?.classList\">\n @for (col of calendarVariables().right().calCols?.(); track col) {\n <td\n class=\"libs-ui-font-h5r\"\n [class]=\"calendarVariables().right().classes && calendarVariables().right().classes?.[row]?.[col]\"\n [class.today]=\"\n calendarVariables().right().calendar &&\n calendarVariables().right().calendar?.[row]?.[col]?.date() === today().date() &&\n calendarVariables().right().calendar?.[row]?.[col]?.month() === today().month() &&\n calendarVariables().right().calendar &&\n calendarVariables().right().calendar?.[row]?.[col]?.year() === today().year()\n \"\n (click)=\"handlerPickerDate($event, sideEnum.right, row, col)\"\n (mouseenter)=\"handlerHoverDate($event, sideEnum.right, row, col)\">\n <span>{{ calendarVariables().right().calendar?.[row]?.[col]?.date() }}</span>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n </div>\n @if (hasTimePicker()) {\n <div>\n <div class=\"flex justify-center items-center pt-[12px]\">\n <div\n class=\"w-full flex justify-center items-center rounded-[4px] border\"\n [class.border-[#e6e8ed]]=\"!timePickerError()\"\n [class.border-[#ff5454]]=\"timePickerError()\">\n <libs_ui-components-inputs-input\n classInclude=\"!w-[30px] !p-0 !border-none !text-center !libs-ui-font-h4s !text-[#071631]\"\n dataType=\"int\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [maxValueNumber]=\"23\"\n [minValueNumber]=\"0\"\n [focusTimeOut]=\"0\"\n [blurTimeOut]=\"0\"\n [maxLength]=\"2\"\n [value]=\"timepickerValueItem().righthour()\"\n (outChange)=\"handlerChangeTimeValue($event, 'righthour')\"\n (outInputEvent)=\"handlerInputEvent($event, 'righthour')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, 'righthour')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurTime($event, 'righthour')\" />\n <span class=\"libs-ui-font-h3s text-[#333333]\">:</span>\n <libs_ui-components-inputs-input\n classInclude=\"!w-[30px] !p-0 !border-none !text-center libs-ui-font-h4s !text-[#071631]\"\n dataType=\"int\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [maxValueNumber]=\"59\"\n [minValueNumber]=\"0\"\n [focusTimeOut]=\"0\"\n [blurTimeOut]=\"0\"\n [maxLength]=\"2\"\n [value]=\"timepickerValueItem().rightminute()\"\n (outInputEvent)=\"handlerInputEvent($event, 'rightminute')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, 'rightminute')\"\n (outChange)=\"handlerChangeTimeValue($event, 'rightminute')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurTime($event, 'rightminute')\" />\n </div>\n </div>\n </div>\n }\n </div>\n }\n </div>\n <div>\n <div class=\"flex w-full\">\n @if (!isSingle() && hasTimePicker()) {\n <div class=\"mt-[8px] libs-ui-font-h7r text-[#ff5454] h-[14px]\">\n @if (timePickerError()) {\n <span>{{ 'i18n_date_compare_start_end_message_error' | translate }}</span>\n }\n </div>\n }\n </div>\n @if (!quickRangesArray().length || !isSingle()) {\n <div class=\"flex w-full pt-[16px] justify-between\">\n <div class=\"flex items-center\">\n @if (!isSingle()) {\n @if (!endDate()) {\n <div class=\"text-[#cdd0d6] libs-ui-font-h6r\">\n <span>{{ startDate()?.format('DD/MM/YYYY') }}</span>\n @if (hasTimePicker()) {\n <span>{{ computedDisplayTimeLeft() }}</span>\n }\n &hyphen;\n <span>{{ startDate()?.format('DD/MM/YYYY') }}</span>\n @if (hasTimePicker()) {\n <span>{{ computedDisplayTimeRight() }}</span>\n }\n </div>\n }\n @if (endDate()) {\n <div class=\"text-[#cdd0d6] libs-ui-font-h6r\">\n <span>{{ startDate()?.format('DD/MM/YYYY') }}</span>\n @if (hasTimePicker()) {\n <span>{{ computedDisplayTimeLeft() }}</span>\n }\n &hyphen;\n <span>{{ endDate()?.format('DD/MM/YYYY') }}</span>\n @if (hasTimePicker()) {\n <span>{{ computedDisplayTimeRight() }}</span>\n }\n </div>\n }\n }\n </div>\n\n <div class=\"flex\">\n <libs_ui-components-buttons-button\n class=\"mr-[12px]\"\n label=\"i18n_cancel\"\n type=\"button-third\"\n (outClick)=\"handlerClickCancel($event)\" />\n <libs_ui-components-buttons-button\n label=\"i18n_select\"\n (outClick)=\"handlerClickApply($event)\" />\n </div>\n </div>\n }\n </div>\n</div>\n", styles: [".libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-dropdown{display:flex;align-items:center}.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-dropdown:hover{color:var(--libs-ui-color-light-1)}.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-dropdown:hover i:before,.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-dropdown:hover i:after{color:var(--libs-ui-color-light-1)!important}.libs-ui-component-custom_ranges-calendar table{border-collapse:inherit;border-spacing:0 2px}.libs-ui-component-custom_ranges-calendar th,.libs-ui-component-custom_ranges-calendar td{padding:0;text-align:center;min-width:32px}.libs-ui-component-custom_ranges-calendar th span,.libs-ui-component-custom_ranges-calendar td span{pointer-events:none}.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-icon:hover{color:var(--libs-ui-color-light-1)}.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-icon:hover i:before,.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-icon:hover i:after{color:var(--libs-ui-color-light-1)!important}.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-icon:before{font-size:20px}.libs-ui-component-custom_ranges-calendar td,.libs-ui-component-custom_ranges-calendar th{cursor:pointer;height:2em;width:2em}.libs-ui-component-custom_ranges-calendar td.available:hover,.libs-ui-component-custom_ranges-calendar th.available:hover{background-color:#f8f5fe;border-color:transparent;border-radius:8px;color:inherit;background-repeat:no-repeat;background-size:.5em;background-position:center;margin:.25em 0;opacity:.8;transform:scale(1);transition:all .45s cubic-bezier(.23,1,.32,1) 0ms}.libs-ui-component-custom_ranges-calendar td{margin:.25em 0;background-color:#fff;transition:background-color .2s ease;transform:scale(1);transition:all .45s cubic-bezier(.23,1,.32,1) 0ms;color:#071631!important}.libs-ui-component-custom_ranges-calendar td:hover{color:#8e61ee!important}.libs-ui-component-custom_ranges-calendar td.off,.libs-ui-component-custom_ranges-calendar td.off.in-range,.libs-ui-component-custom_ranges-calendar td.off.start-date,.libs-ui-component-custom_ranges-calendar td.off.end-date{background-color:#fff;border-color:transparent;color:#cdd0d6!important}.libs-ui-component-custom_ranges-calendar td.focus-off{background-color:#f8f5fe!important}.libs-ui-component-custom_ranges-calendar td.in-range{background-color:#f8f5fe;border-color:transparent;border-radius:0;color:#8e61ee!important}.libs-ui-component-custom_ranges-calendar td.today{position:relative;color:#8e61ee!important}.libs-ui-component-custom_ranges-calendar td.today:after{position:absolute;content:\"\";width:2px;height:2px;background-color:#8e61ee;left:49%;bottom:5px}.libs-ui-component-custom_ranges-calendar td.active{transition:background .3s ease-out;background:#0000001a}.libs-ui-component-custom_ranges-calendar td.active.today:after{position:absolute;content:\"\";background-color:#fff}.libs-ui-component-custom_ranges-calendar td.active.start-date{border-radius:8px 0 0 8px}.libs-ui-component-custom_ranges-calendar td.active.end-date{border-radius:0 8px 8px 0}.libs-ui-component-custom_ranges-calendar td.active.full-date{border-radius:8px}.libs-ui-component-custom_ranges-calendar td.active,.libs-ui-component-custom_ranges-calendar td.active:hover{background-color:#8e61ee;border-color:transparent;color:#fff!important}.libs-ui-component-custom_ranges-calendar th.month{width:auto}.libs-ui-component-custom_ranges-calendar td.disabled,.libs-ui-component-custom_ranges-calendar option.disabled{color:#999!important;cursor:not-allowed;text-decoration:line-through;background-color:#f4f5f7}.libs-ui-component-custom_ranges-calendar .dropdowns{background-repeat:no-repeat;background-size:10px;background-position-y:center;background-position-x:right}.libs-ui-component-custom_ranges-calendar th.month>div{position:relative;display:inline-block}@media (min-width: 564px){.libs-ui-component-custom_ranges{width:auto}}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsDropdownComponent, selector: "libs_ui-components-dropdown", inputs: ["useXssFilter", "popoverElementRefCustom", "classInclude", "ignoreStopPropagationEvent", "flagMouse", "flagMouseContent", "popoverCustomConfig", "isNgContent", "zIndex", "convertItemSelected", "getPopoverItemSelected", "httpRequestDetailItemById", "lengthKeys", "textDisplayWhenNoSelect", "textDisplayWhenMultiSelect", "classIncludeTextDisplayWhenNoSelect", "fieldLabel", "fieldGetLabel", "labelPopoverConfig", "labelPopoverFullWidth", "hasContentUnitRight", "listSearchNoDataTemplateRef", "fieldGetImage", "imageSize", "typeShape", "fieldGetIcon", "fieldGetTextAvatar", "fieldGetColorAvatar", "classAvatarInclude", "getLastTextAfterSpace", "linkImageError", "showError", "showBorderError", "disable", "readonly", "labelConfig", "disableLabel", "listSearchConfig", "isSearchOnline", "listHiddenInputSearch", "listSearchPadding", "listKeySearch", "listDividerClassInclude", "listConfig", "listButtonsOther", "listHasButtonUnSelectOption", "listClickExactly", "listBackgroundCustom", "listMaxItemShow", "listKeySelected", "listMultiKeySelected", "listKeysDisable", "listKeysHidden", "validRequired", "validMaxItemSelected", "changeValidUndefinedResetError", "allowSelectItemMultiple", "focusInputSearch", "onlyEmitDataWhenReset", "resetKeyWhenSelectAllKey", "listConfigHasDivider", "classIncludeIcon", "classIncludeContent", "listIgnoreClassDisableDefaultWhenUseKeysDisableItem", "tabKeyActive", "tabsConfig", "ignoreBorderBottom"], outputs: ["flagMouseChange", "flagMouseContentChange", "lengthKeysChange", "showBorderErrorChange", "listKeySelectedChange", "listMultiKeySelectedChange", "tabKeyActiveChange", "outSelectKey", "outSelectMultiKey", "outFunctionsControl", "outValidEvent", "outChangStageFlagMouse", "outDataChange", "outClickButtonOther", "outShowList", "outChangeTabKeyActive"] }, { 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"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive", "isHandlerEnterDocumentClickButton"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1475
+ }
1476
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsDatetimePickerCustomRangesCalendarComponent, decorators: [{
1477
+ type: Component,
1478
+ args: [{ selector: 'libs_ui-components-datetime-picker-custom_ranges-calendar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [TranslateModule, LibsUiComponentsDropdownComponent, LibsUiComponentsInputsInputComponent, LibsUiComponentsButtonsButtonComponent], template: "<div class=\"libs-ui-component-custom_ranges-calendar test-class\">\n <div class=\"relative flex\">\n <div\n class=\"libs-ui-component-custom_ranges-calendar\"\n [class.right]=\"isSingle()\"\n [class.left]=\"!isSingle()\">\n <div class=\"rounded-[4px] bg-[#ffffff]\">\n @if (calendarVariables(); as calendarVariables) {\n <table>\n <thead>\n <tr>\n <th\n colspan=\"7\"\n class=\"month\">\n @if (showDropdownsSelect() && calendarVariables.left().dropdowns?.()) {\n <div class=\"!flex mb-[10px] w-full\">\n <div class=\"w-3/4 flex items-center\">\n <div class=\"mr-[8px]\">\n <libs_ui-components-dropdown\n [isNgContent]=\"true\"\n [zIndex]=\"zIndex() + 1\"\n [popoverCustomConfig]=\"{ widthByParent: false, ignoreArrow: true, paddingLeftItem: true, classInclude: '!w-[130px]', position: { mode: 'center', distance: 0 } }\"\n [listMaxItemShow]=\"10\"\n [listClickExactly]=\"false\"\n [listKeysDisable]=\"disableMonth().left()\"\n [listHasButtonUnSelectOption]=\"false\"\n [convertItemSelected]=\"convertItemMonth\"\n [listConfig]=\"listMonthsConfig()\"\n [listKeySelected]=\"listKeyFromSelected().month\"\n [flagMouse]=\"flagMouse()\"\n [listHiddenInputSearch]=\"true\"\n [httpRequestDetailItemById]=\"monthHttpDetailConfig()\"\n (outSelectKey)=\"handlerSelectedDropdown($event, sideEnum.left + 'month')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.left + 'month')\"\n (outChangStageFlagMouse)=\"handlerChangeFlagMouse($event)\"\n (outShowList)=\"handlerShowListDropdown($event, sideEnum.left + 'month')\">\n <div\n class=\"libs-ui-component-custom_ranges-calendar-dropdown\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.left + 'month']\"\n [class.text-[#6a7383]]=\"!checkShowListDropdown()[sideEnum.left + 'month']\">\n <div\n class=\"libs-ui-font-h4m\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ dateOptions().monthNames && calendarVariables.left().calendar && dateOptions().monthNames[calendarVariables.left().calendar?.[1]?.[1]?.month() ?? -1] }}\n </div>\n <i\n class=\"libs-ui-icon-chevron-right text-[13px] text-[#6a7383]\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.left + 'month']\"\n [style.fontWeight]=\"500\"\n [style.rotate]=\"!checkShowListDropdown()[sideEnum.left + 'month'] ? '90deg' : '270deg'\"></i>\n </div>\n </libs_ui-components-dropdown>\n </div>\n <div>\n <libs_ui-components-dropdown\n [listMaxItemShow]=\"10\"\n [isNgContent]=\"true\"\n [zIndex]=\"zIndex() + 1\"\n [popoverCustomConfig]=\"{ widthByParent: false, ignoreArrow: true, paddingLeftItem: true, classInclude: '!w-[110px]', position: { mode: 'center', distance: 0 } }\"\n [listClickExactly]=\"false\"\n [listHasButtonUnSelectOption]=\"false\"\n [convertItemSelected]=\"convertItemYear\"\n [listHiddenInputSearch]=\"listYearHiddenInputSearch()\"\n [listConfig]=\"listLeftYearConfig()\"\n [listKeySelected]=\"listKeyFromSelected().year\"\n [flagMouse]=\"flagMouse()\"\n [httpRequestDetailItemById]=\"leftYearHttpDetailConfig()\"\n (outChangStageFlagMouse)=\"handlerChangeFlagMouse($event)\"\n (outShowList)=\"handlerShowListDropdown($event, sideEnum.left + 'year')\"\n (outSelectKey)=\"handlerSelectedDropdown($event, sideEnum.left + 'year')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.left + 'year')\">\n <div\n class=\"libs-ui-component-custom_ranges-calendar-dropdown\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.left + 'year']\"\n [class.text-[#6a7383]]=\"!checkShowListDropdown()[sideEnum.left + 'year']\">\n <div\n class=\"libs-ui-font-h4m\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ calendarVariables.left().calendar && calendarVariables.left().calendar?.[1]?.[1]?.format(' YYYY') }}\n </div>\n <i\n class=\"libs-ui-icon-chevron-right text-[13px] text-[#6a7383]\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.left + 'year']\"\n [style.fontWeight]=\"500\"\n [style.rotate]=\"!checkShowListDropdown()[sideEnum.left + 'year'] ? '90deg' : '270deg'\"></i>\n </div>\n </libs_ui-components-dropdown>\n </div>\n </div>\n\n <div class=\"w-1/4 flex items-center relative\">\n @if (!calendarVariables.left().minDate || calendarVariables.left().minDate?.isBefore(calendarVariables.left().calendar && calendarVariables.left().calendar?.firstDay)) {\n <div (click)=\"handlerClickPrev(sideEnum.left)\">\n <div class=\"flex items-center justify-center absolute left-0 top-[-3px]\">\n <i class=\"libs-ui-icon-chevron-right rotate-[180deg] text-[#6a7383] cursor-pointer libs-ui-component-custom_ranges-calendar-icon\"></i>\n </div>\n </div>\n }\n @if ((!calendarVariables.left().maxDate || calendarVariables.left().maxDate?.isAfter(calendarVariables.left().calendar && calendarVariables.left().calendar?.lastDay)) && isSingle()) {\n <div (click)=\"handlerClickNext(sideEnum.left)\">\n <div class=\"flex items-center justify-center ml-[12px] absolute right-0 top-[-3px]\">\n <i class=\"libs-ui-icon-chevron-right text-[#6a7383] cursor-pointer libs-ui-component-custom_ranges-calendar-icon\"></i>\n </div>\n </div>\n }\n </div>\n </div>\n }\n @if (!showDropdownsSelect() || !calendarVariables.left().dropdowns) {\n {{ dateOptions().monthNames && calendarVariables.left().calendar && dateOptions().monthNames[calendarVariables.left().calendar?.[1]?.[1]?.month() ?? -1] }}\n {{ calendarVariables.left().calendar && calendarVariables.left().calendar?.[1]?.[1]?.format(' YYYY') }}\n }\n </th>\n </tr>\n <tr class=\"week-days\">\n @for (dayofweek of dateOptions().daysOfWeek; track dayofweek) {\n <th>\n <span\n class=\"libs-ui-font-h6m text-[#6a7383]\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ dayofweek }}\n </span>\n </th>\n }\n </tr>\n </thead>\n <tbody class=\"drp-animate\">\n @for (row of calendarVariables.left().calRows?.(); track row) {\n <tr\n class=\"h-[32px]\"\n [class]=\"calendarVariables.left().classes && calendarVariables.left().classes?.[row]?.classList\">\n @for (col of calendarVariables.left().calCols?.(); track col) {\n <td\n class=\"libs-ui-font-h5r\"\n [class.today]=\"\n calendarVariables.left().calendar &&\n calendarVariables.left().calendar?.[row]?.[col]?.date() === today().date() &&\n calendarVariables.left().calendar?.[row]?.[col]?.month() === today().month() &&\n calendarVariables.left().calendar?.[row]?.[col]?.year() === today().year()\n \"\n [class]=\"calendarVariables.left().classes && calendarVariables.left().classes?.[row]?.[col]\"\n (click)=\"handlerPickerDate($event, sideEnum.left, row, col)\"\n (mouseenter)=\"handlerHoverDate($event, sideEnum.left, row, col)\">\n <span class=\"libs-ui-font-h5r\">{{ calendarVariables.left().calendar && calendarVariables.left().calendar?.[row]?.[col]?.date() }}</span>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n </div>\n @if (hasTimePicker()) {\n <div>\n <div class=\"flex justify-center column items-center pt-[12px]\">\n <div\n class=\"w-full flex justify-center items-center rounded-[4px] border\"\n [class.border-[#e6e8ed]]=\"!timePickerError()\"\n [class.border-[#ff5454]]=\"timePickerError()\">\n <libs_ui-components-inputs-input\n classInclude=\"!w-[30px] !p-0 !border-none !text-center libs-ui-font-h4s !text-[#071631]\"\n dataType=\"int\"\n [focusTimeOut]=\"0\"\n [blurTimeOut]=\"0\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [maxValueNumber]=\"23\"\n [minValueNumber]=\"0\"\n [maxLength]=\"2\"\n [value]=\"timepickerValueItem().lefthour()\"\n (outInputEvent)=\"handlerInputEvent($event, 'lefthour')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.left + 'hour')\"\n (outChange)=\"handlerChangeTimeValue($event, 'lefthour')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurTime($event, 'lefthour')\" />\n <span class=\"libs-ui-font-h3s text-[#333333]\">:</span>\n <libs_ui-components-inputs-input\n classInclude=\"!w-[30px] !p-0 !border-none !text-center !libs-ui-font-h4s !text-[#071631]\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n dataType=\"int\"\n [focusTimeOut]=\"0\"\n [blurTimeOut]=\"0\"\n [maxValueNumber]=\"59\"\n [minValueNumber]=\"0\"\n [maxLength]=\"2\"\n [value]=\"timepickerValueItem().leftminute()\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.left + 'minute')\"\n (outInputEvent)=\"handlerInputEvent($event, 'leftminute')\"\n (outChange)=\"handlerChangeTimeValue($event, 'leftminute')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurTime($event, 'leftminute')\" />\n </div>\n </div>\n </div>\n }\n </div>\n\n @if (!isSingle()) {\n <div class=\"libs-ui-component-custom_ranges-calendar right ml-[24px]\">\n <div class=\"rounded-[4px] bg-[#ffffff]\">\n @if (calendarVariables()) {\n <table>\n <thead>\n <tr>\n <th\n colspan=\"7\"\n class=\"month\">\n @if (showDropdownsSelect() && calendarVariables().left().dropdowns?.()) {\n <div class=\"!flex mb-[10px] w-full\">\n <div class=\"w-3/4 flex items-center\">\n <div class=\"mr-[8px]\">\n <libs_ui-components-dropdown\n [isNgContent]=\"true\"\n [zIndex]=\"zIndex() + 1\"\n [popoverCustomConfig]=\"{ widthByParent: false, ignoreArrow: true, paddingLeftItem: true, classInclude: '!w-[130px]', position: { mode: 'center', distance: 0 } }\"\n [listMaxItemShow]=\"10\"\n [listClickExactly]=\"false\"\n [listKeysDisable]=\"disableMonth().right()\"\n [listHasButtonUnSelectOption]=\"false\"\n [convertItemSelected]=\"convertItemMonth\"\n [listHiddenInputSearch]=\"true\"\n [listConfig]=\"listMonthsConfig()\"\n [listKeySelected]=\"listKeyToSelected().month\"\n [flagMouse]=\"flagMouse()\"\n [httpRequestDetailItemById]=\"monthHttpDetailConfig()\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.right + 'month')\"\n (outSelectKey)=\"handlerSelectedDropdown($event, sideEnum.right + 'month')\"\n (outChangStageFlagMouse)=\"handlerChangeFlagMouse($event)\"\n (outShowList)=\"handlerShowListDropdown($event, sideEnum.right + 'month')\">\n <div\n class=\"libs-ui-component-custom_ranges-calendar-dropdown\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.right + 'month']\"\n [class.text-[#6a7383]]=\"!checkShowListDropdown()[sideEnum.right + 'month']\">\n <div\n class=\"libs-ui-font-h4m\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.right + 'month']\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ dateOptions().monthNames && calendarVariables().right().calendar && dateOptions().monthNames[calendarVariables().right().calendar?.[1]?.[1]?.month() ?? -1] }}\n </div>\n <i\n class=\"libs-ui-icon-chevron-right text-[13px] text-[#6a7383]\"\n [style.fontWeight]=\"500\"\n [style.rotate]=\"!checkShowListDropdown()[sideEnum.right + 'month'] ? '90deg' : '270deg'\"></i>\n </div>\n </libs_ui-components-dropdown>\n </div>\n <div>\n <libs_ui-components-dropdown\n [listMaxItemShow]=\"10\"\n [zIndex]=\"zIndex() + 1\"\n [isNgContent]=\"true\"\n [popoverCustomConfig]=\"{ widthByParent: false, ignoreArrow: true, paddingLeftItem: true, classInclude: '!w-[110px]', position: { mode: 'center', distance: 0 } }\"\n [listClickExactly]=\"false\"\n [listHasButtonUnSelectOption]=\"false\"\n [convertItemSelected]=\"convertItemYear\"\n [listHiddenInputSearch]=\"listYearHiddenInputSearch()\"\n [listConfig]=\"listRightYearConfig()\"\n [listKeySelected]=\"listKeyToSelected().year\"\n [flagMouse]=\"flagMouse()\"\n [httpRequestDetailItemById]=\"rightYearHttpDetailConfig()\"\n (outSelectKey)=\"handlerSelectedDropdown($event, sideEnum.right + 'year')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, sideEnum.right + 'year')\"\n (outChangStageFlagMouse)=\"handlerChangeFlagMouse($event)\"\n (outShowList)=\"handlerShowListDropdown($event, sideEnum.right + 'year')\">\n <div\n class=\"libs-ui-component-custom_ranges-calendar-dropdown\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.right + 'year']\"\n [class.text-[#6a7383]]=\"!checkShowListDropdown()[sideEnum.right + 'year']\">\n <div\n class=\"libs-ui-font-h4m\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ calendarVariables().right().calendar && calendarVariables().right().calendar?.[1]?.[1]?.format('YYYY') }}\n </div>\n <i\n class=\"libs-ui-icon-chevron-right text-[13px] text-[#6a7383]\"\n [class.text-[var(--libs-ui-color-dark)]]=\"checkShowListDropdown()[sideEnum.right + 'year']\"\n [style.fontWeight]=\"500\"\n [style.rotate]=\"!checkShowListDropdown()[sideEnum.right + 'year'] ? '90deg' : '270deg'\"></i>\n </div>\n </libs_ui-components-dropdown>\n </div>\n </div>\n <div class=\"w-1/4 flex items-center relative\">\n @if (\n (listKeyFromSelected().year &&\n listKeyToSelected().year &&\n !(listKeyFromSelected().year + 1 === listKeyToSelected().year && listKeyFromSelected().month === 12 && listKeyToSelected().month === 1) &&\n listKeyFromSelected().year < listKeyToSelected().year) ||\n (listKeyFromSelected().month && listKeyToSelected().month && listKeyFromSelected().month + 1 < +listKeyToSelected().month)\n ) {\n <div\n class=\"flex items-center justify-center absolute left-0 top-[-3px]\"\n (click)=\"handlerClickPrev(sideEnum.right)\">\n <i class=\"libs-ui-icon-chevron-right rotate-[180deg] text-[#6a7383] cursor-pointer libs-ui-component-custom_ranges-calendar-icon\"></i>\n </div>\n }\n @if (\n listKeyFromSelected().month &&\n listKeyToSelected().month &&\n listKeyFromSelected().month > listKeyToSelected().month &&\n listKeyFromSelected().year &&\n listKeyToSelected().year &&\n listKeyFromSelected().year === listKeyToSelected().year\n ) {\n <div class=\"bg-[#ffffff] w-[21px] h-[21px] cursor-none flex items-center justify-center rounded-[50px]\"></div>\n }\n @if (\n !calendarVariables().right().maxDate ||\n calendarVariables()\n .right()\n .maxDate?.isAfter(calendarVariables().right().calendar && calendarVariables().right().calendar?.lastDay)\n ) {\n <div (click)=\"handlerClickNext(sideEnum.right)\">\n <div class=\"flex items-center justify-center ml-[12px] absolute right-0 top-[-3px]\">\n <i class=\"libs-ui-icon-chevron-right text-[#6a7383] cursor-pointer libs-ui-component-custom_ranges-calendar-icon\"></i>\n </div>\n </div>\n }\n </div>\n </div>\n }\n @if (!showDropdownsSelect() || !calendarVariables().right().dropdowns) {\n {{ dateOptions().monthNames && calendarVariables().right().calendar && dateOptions().monthNames[calendarVariables().right().calendar?.[1]?.[1]?.month() ?? -1] }}\n {{ calendarVariables().right().calendar && calendarVariables().right().calendar?.[1]?.[1]?.format('YYYY') }}\n }\n </th>\n </tr>\n <tr class=\"week-days\">\n @for (dayofweek of dateOptions().daysOfWeek; track dayofweek) {\n <th>\n <span\n class=\"libs-ui-font-h6m text-[#6a7383]\"\n [style.fontWeight]=\"500\"\n [style.fontStyle]=\"'normal'\">\n {{ dayofweek }}\n </span>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of calendarVariables().right().calRows?.(); track row) {\n <tr\n class=\"h-[32px]\"\n [class]=\"calendarVariables().right().classes && calendarVariables().right().classes?.[row]?.classList\">\n @for (col of calendarVariables().right().calCols?.(); track col) {\n <td\n class=\"libs-ui-font-h5r\"\n [class]=\"calendarVariables().right().classes && calendarVariables().right().classes?.[row]?.[col]\"\n [class.today]=\"\n calendarVariables().right().calendar &&\n calendarVariables().right().calendar?.[row]?.[col]?.date() === today().date() &&\n calendarVariables().right().calendar?.[row]?.[col]?.month() === today().month() &&\n calendarVariables().right().calendar &&\n calendarVariables().right().calendar?.[row]?.[col]?.year() === today().year()\n \"\n (click)=\"handlerPickerDate($event, sideEnum.right, row, col)\"\n (mouseenter)=\"handlerHoverDate($event, sideEnum.right, row, col)\">\n <span>{{ calendarVariables().right().calendar?.[row]?.[col]?.date() }}</span>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n </div>\n @if (hasTimePicker()) {\n <div>\n <div class=\"flex justify-center items-center pt-[12px]\">\n <div\n class=\"w-full flex justify-center items-center rounded-[4px] border\"\n [class.border-[#e6e8ed]]=\"!timePickerError()\"\n [class.border-[#ff5454]]=\"timePickerError()\">\n <libs_ui-components-inputs-input\n classInclude=\"!w-[30px] !p-0 !border-none !text-center !libs-ui-font-h4s !text-[#071631]\"\n dataType=\"int\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [maxValueNumber]=\"23\"\n [minValueNumber]=\"0\"\n [focusTimeOut]=\"0\"\n [blurTimeOut]=\"0\"\n [maxLength]=\"2\"\n [value]=\"timepickerValueItem().righthour()\"\n (outChange)=\"handlerChangeTimeValue($event, 'righthour')\"\n (outInputEvent)=\"handlerInputEvent($event, 'righthour')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, 'righthour')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurTime($event, 'righthour')\" />\n <span class=\"libs-ui-font-h3s text-[#333333]\">:</span>\n <libs_ui-components-inputs-input\n classInclude=\"!w-[30px] !p-0 !border-none !text-center libs-ui-font-h4s !text-[#071631]\"\n dataType=\"int\"\n [autoAddZeroLessThan10InTypeInt]=\"true\"\n [emitEmptyInDataTypeNumber]=\"true\"\n [maxValueNumber]=\"59\"\n [minValueNumber]=\"0\"\n [focusTimeOut]=\"0\"\n [blurTimeOut]=\"0\"\n [maxLength]=\"2\"\n [value]=\"timepickerValueItem().rightminute()\"\n (outInputEvent)=\"handlerInputEvent($event, 'rightminute')\"\n (outFunctionsControl)=\"handlerFunctionControl($event, 'rightminute')\"\n (outChange)=\"handlerChangeTimeValue($event, 'rightminute')\"\n (outFocusAndBlurEvent)=\"handlerFocusAndBlurTime($event, 'rightminute')\" />\n </div>\n </div>\n </div>\n }\n </div>\n }\n </div>\n <div>\n <div class=\"flex w-full\">\n @if (!isSingle() && hasTimePicker()) {\n <div class=\"mt-[8px] libs-ui-font-h7r text-[#ff5454] h-[14px]\">\n @if (timePickerError()) {\n <span>{{ 'i18n_date_compare_start_end_message_error' | translate }}</span>\n }\n </div>\n }\n </div>\n @if (!quickRangesArray().length || !isSingle()) {\n <div class=\"flex w-full pt-[16px] justify-between\">\n <div class=\"flex items-center\">\n @if (!isSingle()) {\n @if (!endDate()) {\n <div class=\"text-[#cdd0d6] libs-ui-font-h6r\">\n <span>{{ startDate()?.format('DD/MM/YYYY') }}</span>\n @if (hasTimePicker()) {\n <span>{{ computedDisplayTimeLeft() }}</span>\n }\n &hyphen;\n <span>{{ startDate()?.format('DD/MM/YYYY') }}</span>\n @if (hasTimePicker()) {\n <span>{{ computedDisplayTimeRight() }}</span>\n }\n </div>\n }\n @if (endDate()) {\n <div class=\"text-[#cdd0d6] libs-ui-font-h6r\">\n <span>{{ startDate()?.format('DD/MM/YYYY') }}</span>\n @if (hasTimePicker()) {\n <span>{{ computedDisplayTimeLeft() }}</span>\n }\n &hyphen;\n <span>{{ endDate()?.format('DD/MM/YYYY') }}</span>\n @if (hasTimePicker()) {\n <span>{{ computedDisplayTimeRight() }}</span>\n }\n </div>\n }\n }\n </div>\n\n <div class=\"flex\">\n <libs_ui-components-buttons-button\n class=\"mr-[12px]\"\n label=\"i18n_cancel\"\n type=\"button-third\"\n (outClick)=\"handlerClickCancel($event)\" />\n <libs_ui-components-buttons-button\n label=\"i18n_select\"\n (outClick)=\"handlerClickApply($event)\" />\n </div>\n </div>\n }\n </div>\n</div>\n", styles: [".libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-dropdown{display:flex;align-items:center}.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-dropdown:hover{color:var(--libs-ui-color-light-1)}.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-dropdown:hover i:before,.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-dropdown:hover i:after{color:var(--libs-ui-color-light-1)!important}.libs-ui-component-custom_ranges-calendar table{border-collapse:inherit;border-spacing:0 2px}.libs-ui-component-custom_ranges-calendar th,.libs-ui-component-custom_ranges-calendar td{padding:0;text-align:center;min-width:32px}.libs-ui-component-custom_ranges-calendar th span,.libs-ui-component-custom_ranges-calendar td span{pointer-events:none}.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-icon:hover{color:var(--libs-ui-color-light-1)}.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-icon:hover i:before,.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-icon:hover i:after{color:var(--libs-ui-color-light-1)!important}.libs-ui-component-custom_ranges-calendar .libs-ui-component-custom_ranges-calendar-icon:before{font-size:20px}.libs-ui-component-custom_ranges-calendar td,.libs-ui-component-custom_ranges-calendar th{cursor:pointer;height:2em;width:2em}.libs-ui-component-custom_ranges-calendar td.available:hover,.libs-ui-component-custom_ranges-calendar th.available:hover{background-color:#f8f5fe;border-color:transparent;border-radius:8px;color:inherit;background-repeat:no-repeat;background-size:.5em;background-position:center;margin:.25em 0;opacity:.8;transform:scale(1);transition:all .45s cubic-bezier(.23,1,.32,1) 0ms}.libs-ui-component-custom_ranges-calendar td{margin:.25em 0;background-color:#fff;transition:background-color .2s ease;transform:scale(1);transition:all .45s cubic-bezier(.23,1,.32,1) 0ms;color:#071631!important}.libs-ui-component-custom_ranges-calendar td:hover{color:#8e61ee!important}.libs-ui-component-custom_ranges-calendar td.off,.libs-ui-component-custom_ranges-calendar td.off.in-range,.libs-ui-component-custom_ranges-calendar td.off.start-date,.libs-ui-component-custom_ranges-calendar td.off.end-date{background-color:#fff;border-color:transparent;color:#cdd0d6!important}.libs-ui-component-custom_ranges-calendar td.focus-off{background-color:#f8f5fe!important}.libs-ui-component-custom_ranges-calendar td.in-range{background-color:#f8f5fe;border-color:transparent;border-radius:0;color:#8e61ee!important}.libs-ui-component-custom_ranges-calendar td.today{position:relative;color:#8e61ee!important}.libs-ui-component-custom_ranges-calendar td.today:after{position:absolute;content:\"\";width:2px;height:2px;background-color:#8e61ee;left:49%;bottom:5px}.libs-ui-component-custom_ranges-calendar td.active{transition:background .3s ease-out;background:#0000001a}.libs-ui-component-custom_ranges-calendar td.active.today:after{position:absolute;content:\"\";background-color:#fff}.libs-ui-component-custom_ranges-calendar td.active.start-date{border-radius:8px 0 0 8px}.libs-ui-component-custom_ranges-calendar td.active.end-date{border-radius:0 8px 8px 0}.libs-ui-component-custom_ranges-calendar td.active.full-date{border-radius:8px}.libs-ui-component-custom_ranges-calendar td.active,.libs-ui-component-custom_ranges-calendar td.active:hover{background-color:#8e61ee;border-color:transparent;color:#fff!important}.libs-ui-component-custom_ranges-calendar th.month{width:auto}.libs-ui-component-custom_ranges-calendar td.disabled,.libs-ui-component-custom_ranges-calendar option.disabled{color:#999!important;cursor:not-allowed;text-decoration:line-through;background-color:#f4f5f7}.libs-ui-component-custom_ranges-calendar .dropdowns{background-repeat:no-repeat;background-size:10px;background-position-y:center;background-position-x:right}.libs-ui-component-custom_ranges-calendar th.month>div{position:relative;display:inline-block}@media (min-width: 564px){.libs-ui-component-custom_ranges{width:auto}}\n"] }]
1479
+ }], ctorParameters: () => [] });
1480
+
1481
+ class LibsUiComponentsDatetimePickerCustomRangesComponent {
1482
+ /** PROPERTY */
1483
+ showCalTableInRanges = signal(false);
1484
+ quickRangesArray = signal([]);
1485
+ selectedQuickRange = signal(''); // quick range đã được lưu trước đó
1486
+ chosenQuickRange = signal(undefined); // quick range đang được chọn
1487
+ calendarShowing = signal(false);
1488
+ timeouts = signal([]);
1489
+ calendarFunctionControlEvent = signal(undefined);
1490
+ chosenSingleDate = signal(undefined);
1491
+ chosenDateRange = signal(undefined);
1492
+ /** INPUT */
1493
+ // readonly SelectedQuickRange = input<string>('');
1494
+ zIndex = input(1200, { transform: (value) => value ?? 1200 });
1495
+ classInclude = input('');
1496
+ extendRanges = input([]);
1497
+ widthByParent = input(false);
1498
+ autoApply = input(false);
1499
+ minDate = input();
1500
+ maxDate = input();
1501
+ listYearHiddenInputSearch = input(true, { transform: (value) => value ?? true });
1502
+ positionQuickRanges = input('left', { transform: (value) => value ?? 'left' });
1503
+ isSingle = input(false, { transform: (value) => value ?? false });
1504
+ hasTimePicker = input(true);
1505
+ flagMouse = input({ isMouseEnter: false, isMouseEnterContent: false });
1506
+ dateOptions = input(getDateOptionsDefault());
1507
+ alwaysShowCalendars = input(false);
1508
+ startDate = model(getDayjs().startOf('day'));
1509
+ endDate = model(getDayjs().endOf('day'));
1510
+ showCustomRangeLabel = input(undefined);
1511
+ keepCalendarOpeningWithRange = input(undefined);
1512
+ singleDateSelected = input(undefined, {
1513
+ transform: (value) => {
1514
+ if (!value || !value.date) {
1515
+ return;
1516
+ }
1517
+ let date = value.date;
1518
+ if (typeof date === 'string') {
1519
+ date = getDayjs({ date, returnDayjsIfConfigDateNotExist: true });
1520
+ }
1521
+ return {
1522
+ ...value,
1523
+ date,
1524
+ };
1525
+ },
1526
+ });
1527
+ dateRangeSelected = input(undefined, {
1528
+ transform: (value) => {
1529
+ if (!value) {
1530
+ return;
1531
+ }
1532
+ let startDate = value.startDate;
1533
+ let endDate = value.endDate;
1534
+ if (typeof startDate === 'string') {
1535
+ startDate = getDayjs({ date: startDate, returnDayjsIfConfigDateNotExist: true });
1536
+ }
1537
+ if (typeof endDate === 'string') {
1538
+ endDate = getDayjs({ date: endDate, returnDayjsIfConfigDateNotExist: true });
1539
+ }
1540
+ return {
1541
+ ...value,
1542
+ startDate,
1543
+ endDate,
1544
+ };
1545
+ },
1546
+ });
1547
+ /** OUTPUT */
1548
+ outChangStageFlagMouse = output();
1549
+ outUpdateWidth = output();
1550
+ outCancel = output();
1551
+ outSelectSingleDate = output();
1552
+ outSelectDateRange = output();
1553
+ outClickMenuRangeCustom = output();
1554
+ constructor() {
1555
+ effect(() => untracked(this.onAfterViewInit.bind(this)));
1556
+ }
1557
+ onAfterViewInit() {
1558
+ if (!this.startDate()) {
1559
+ this.startDate.set(getDayjs().startOf('day'));
1560
+ }
1561
+ if (!this.endDate()) {
1562
+ this.endDate.set(getDayjs().endOf('day'));
1563
+ }
1564
+ const dateRangeSelected = this.dateRangeSelected();
1565
+ const singleDateSelected = this.singleDateSelected();
1566
+ const customRange = {
1567
+ id: this.dateOptions()?.customRangeLabel || '',
1568
+ label: this.dateOptions()?.customRangeLabel || '',
1569
+ };
1570
+ if (this.isSingle()) {
1571
+ if (this.hasTimePicker()) {
1572
+ const now = getDayjs();
1573
+ this.startDate.update((current) => {
1574
+ if (current) {
1575
+ current.set('hour', 10).set('minute', 30);
1576
+ // current.hour(now.hour()).minute(now.minute());
1577
+ }
1578
+ return current;
1579
+ });
1580
+ this.endDate.update((current) => {
1581
+ if (current) {
1582
+ current.hour(now.hour()).minute(now.minute());
1583
+ }
1584
+ return current;
1585
+ });
1586
+ }
1587
+ if (singleDateSelected?.date) {
1588
+ this.startDate.set(getDayjs({ date: singleDateSelected.date }));
1589
+ this.endDate.set(getDayjs({ date: singleDateSelected.date }));
1590
+ }
1591
+ this.renderRanges();
1592
+ return;
1593
+ }
1594
+ if (dateRangeSelected) {
1595
+ this.selectedQuickRange.set(dateRangeSelected.quickRangeId ? dateRangeSelected.quickRangeId : customRange.id);
1596
+ this.chosenQuickRange.set(dateRangeSelected.quickRangeId ?? customRange.id);
1597
+ this.startDate.set(getDayjs({ date: dateRangeSelected.startDate }));
1598
+ this.endDate.set(getDayjs({ date: dateRangeSelected.endDate }));
1599
+ }
1600
+ if (this.hasTimePicker()) {
1601
+ this.selectedQuickRange.set(customRange.id);
1602
+ this.chosenQuickRange.set(customRange.id);
1603
+ }
1604
+ if (this.selectedQuickRange() === this.dateOptions()?.customRangeLabel) {
1605
+ this.showCalTableInRanges.set(true);
1606
+ }
1607
+ this.renderRanges();
1608
+ }
1609
+ updateWidth() {
1610
+ const timeoutId = setTimeout(() => {
1611
+ this.outUpdateWidth.emit(1);
1612
+ });
1613
+ this.timeouts.update((ids) => [...ids, timeoutId]);
1614
+ }
1615
+ renderRanges() {
1616
+ if (this.isSingle()) {
1617
+ this.showCalTableInRanges.set(true);
1618
+ return;
1619
+ }
1620
+ const rangesDefault = getDateRangeDefault();
1621
+ const ranges = this.dateOptions()?.ranges;
1622
+ this.quickRangesArray.set([]);
1623
+ for (const key in ranges) {
1624
+ const rangeValue = rangesDefault[key];
1625
+ const start = getDayjs({ date: rangeValue[0], returnDayjsIfConfigDateNotExist: true });
1626
+ const end = getDayjs({ date: rangeValue[1], returnDayjsIfConfigDateNotExist: true });
1627
+ this.quickRangesArray.update((current) => {
1628
+ current.push({
1629
+ id: key,
1630
+ label: ranges[key],
1631
+ values: [start, end],
1632
+ });
1633
+ return current;
1634
+ });
1635
+ }
1636
+ if (this.showCustomRangeLabel() && this.dateOptions()?.customRangeLabel) {
1637
+ this.quickRangesArray.update((current) => {
1638
+ current.push({
1639
+ id: this.dateOptions()?.customRangeLabel || '',
1640
+ label: this.dateOptions()?.customRangeLabel || '',
1641
+ });
1642
+ return current;
1643
+ });
1644
+ }
1645
+ if (this.extendRanges()) {
1646
+ this.quickRangesArray.update((current) => {
1647
+ current.unshift(...this.extendRanges());
1648
+ return current;
1649
+ });
1650
+ }
1651
+ if (!this.quickRangesArray().length) {
1652
+ this.showCalTableInRanges.set(true);
1653
+ }
1654
+ }
1655
+ handlerCancel() {
1656
+ this.outCancel.emit('');
1657
+ }
1658
+ handlerPickerDate(event) {
1659
+ this.chosenSingleDate.set({
1660
+ displayLabel: event.displayLabel,
1661
+ date: event.startDate,
1662
+ values: event.detailDatePicker.start(),
1663
+ });
1664
+ if (!this.isSingle() && event.startDate && !event.endDate) {
1665
+ const endTime = event.detailDatePicker.end();
1666
+ event.endDate = event.startDate
1667
+ .clone()
1668
+ .hour(endTime.hour)
1669
+ .minute(endTime.minute)
1670
+ .second(59);
1671
+ }
1672
+ this.chosenDateRange.set({
1673
+ quickRangeId: this.chosenQuickRange(),
1674
+ ...event,
1675
+ });
1676
+ const chosenSingleDate = this.chosenSingleDate();
1677
+ const chosenDateRange = this.chosenDateRange();
1678
+ if (this.isSingle() && chosenSingleDate) {
1679
+ this.outSelectSingleDate.emit(chosenSingleDate);
1680
+ return;
1681
+ }
1682
+ if (!chosenDateRange || (!chosenDateRange.startDate && !chosenDateRange.endDate)) {
1683
+ return;
1684
+ }
1685
+ this.outSelectDateRange.emit(chosenDateRange);
1686
+ }
1687
+ handlerClickRange(e, range) {
1688
+ e.stopPropagation();
1689
+ this.chosenQuickRange.set(range.id);
1690
+ if (range.id === this.dateOptions()?.customRangeLabel) {
1691
+ if (!this.calendarShowing() && !this.showCalTableInRanges()) {
1692
+ this.calendarShowing.set(true);
1693
+ this.showCalTableInRanges.set(true);
1694
+ this.outClickMenuRangeCustom.emit(range);
1695
+ this.updateWidth();
1696
+ }
1697
+ return;
1698
+ }
1699
+ this.updateWidth();
1700
+ if (this.extendRanges()) {
1701
+ const findExternalRange = this.extendRanges().find((item) => item.label === range.id);
1702
+ if (findExternalRange && range.id === findExternalRange.label) {
1703
+ if (findExternalRange.values) {
1704
+ this.outSelectDateRange.emit({ quickRangeId: findExternalRange.id, displayLabel: findExternalRange.label, startDate: findExternalRange.values[0], endDate: findExternalRange.values[1] });
1705
+ return;
1706
+ }
1707
+ this.outSelectDateRange.emit({ quickRangeId: findExternalRange.id, displayLabel: findExternalRange.label, startDate: undefined, endDate: undefined });
1708
+ return;
1709
+ }
1710
+ }
1711
+ // const dates = range.values ?? [];
1712
+ // this.startDate.set(dates[0].clone().hour(0).minute(0).second(0));
1713
+ // this.endDate.set(dates[1].clone().hour(23).minute(59).second(59));
1714
+ // this.timeValue = { hour: 0, toHour: 0, minute: 23, toMinute: 59 };
1715
+ // this.timepickerVariables.left.selectedHour = 0;
1716
+ // this.timepickerVariables.left.selectedMinute = 0;
1717
+ // this.timepickerVariables.right.selectedHour = 23;
1718
+ // this.timepickerVariables.right.selectedMinute = 59;
1719
+ // this.showRangeLabelOnInput && label !== this.localeDay.customRangeLabel ? this.chosenLabel = label : this.calculateChosenLabel();
1720
+ // // this.autoApply.set(true);
1721
+ // if (!this.hasTimePicker()) {
1722
+ // if(this.startDate()) {
1723
+ // this.startDate.set(this.startDate()?.startOf('day'));
1724
+ // }
1725
+ // if(this.endDate()) {
1726
+ // this.endDate.set(this.endDate()?.endOf('day'));
1727
+ // }
1728
+ // }
1729
+ // if (!this.alwaysShowCalendars()) {
1730
+ // this.calendarShowing.set(false);
1731
+ // }
1732
+ // this.outClickRange.emit(range);
1733
+ if (!this.keepCalendarOpeningWithRange() || !this.alwaysShowCalendars()) {
1734
+ this.outSelectDateRange.emit({ quickRangeId: range.id, displayLabel: range.label, startDate: range.values?.[0], endDate: range.values?.[1] });
1735
+ return;
1736
+ }
1737
+ // if (this.timePicker) {
1738
+ // this.renderTimePicker(SideEnum.left);
1739
+ // this.renderTimePicker(SideEnum.right);
1740
+ // }
1741
+ // if (this.getMaxDate() && this.getMaxDate().isSame(dates[0], 'month')) {
1742
+ // this.rightCalendar.month = this.rightCalendar.month && this.rightCalendar.month.month(dates[0].month());
1743
+ // this.rightCalendar.month = this.rightCalendar.month && this.rightCalendar.month.year(dates[0].year());
1744
+ // this.leftCalendar.month = this.leftCalendar.month && this.leftCalendar.month.month(dates[0].month() - 1);
1745
+ // this.leftCalendar.month = this.leftCalendar.month && this.leftCalendar.month.year(dates[1].year());
1746
+ // return this.updateCalendars();
1747
+ // }
1748
+ // this.leftCalendar.month = this.leftCalendar.month && this.leftCalendar.month.month(dates[0].month());
1749
+ // this.leftCalendar.month = this.leftCalendar.month && this.leftCalendar.month.year(dates[0].year());
1750
+ // const nextMonth = dates[0].clone().add(1, 'month');
1751
+ // this.rightCalendar.month = this.rightCalendar.month && this.rightCalendar.month.month(nextMonth.month());
1752
+ // this.rightCalendar.month = this.rightCalendar.month && this.rightCalendar.month.year(nextMonth.year());
1753
+ // this.updateCalendars();
1754
+ return;
1755
+ }
1756
+ handlerClickCancel(event) {
1757
+ event.stopPropagation();
1758
+ // this.startDate.set(dayjs(0));
1759
+ // this.endDate.set(dayjs(0));
1760
+ this.outCancel.emit('');
1761
+ }
1762
+ handlerChangeFlagMouse(flagMouse) {
1763
+ this.outChangStageFlagMouse.emit(flagMouse);
1764
+ }
1765
+ handlerFunctionsControl(event) {
1766
+ this.calendarFunctionControlEvent.set(event);
1767
+ }
1768
+ ngOnDestroy() {
1769
+ this.timeouts().forEach((item) => clearTimeout(item));
1770
+ // this.onDestroy.next();
1771
+ // this.onDestroy.complete();
1772
+ }
1773
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsDatetimePickerCustomRangesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1774
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsDatetimePickerCustomRangesComponent, isStandalone: true, selector: "libs_ui-components-datetime-picker-custom_ranges", inputs: { zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, classInclude: { classPropertyName: "classInclude", publicName: "classInclude", isSignal: true, isRequired: false, transformFunction: null }, extendRanges: { classPropertyName: "extendRanges", publicName: "extendRanges", isSignal: true, isRequired: false, transformFunction: null }, widthByParent: { classPropertyName: "widthByParent", publicName: "widthByParent", isSignal: true, isRequired: false, transformFunction: null }, autoApply: { classPropertyName: "autoApply", publicName: "autoApply", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, listYearHiddenInputSearch: { classPropertyName: "listYearHiddenInputSearch", publicName: "listYearHiddenInputSearch", isSignal: true, isRequired: false, transformFunction: null }, positionQuickRanges: { classPropertyName: "positionQuickRanges", publicName: "positionQuickRanges", isSignal: true, isRequired: false, transformFunction: null }, isSingle: { classPropertyName: "isSingle", publicName: "isSingle", isSignal: true, isRequired: false, transformFunction: null }, hasTimePicker: { classPropertyName: "hasTimePicker", publicName: "hasTimePicker", isSignal: true, isRequired: false, transformFunction: null }, flagMouse: { classPropertyName: "flagMouse", publicName: "flagMouse", isSignal: true, isRequired: false, transformFunction: null }, dateOptions: { classPropertyName: "dateOptions", publicName: "dateOptions", isSignal: true, isRequired: false, transformFunction: null }, alwaysShowCalendars: { classPropertyName: "alwaysShowCalendars", publicName: "alwaysShowCalendars", isSignal: true, isRequired: false, transformFunction: null }, startDate: { classPropertyName: "startDate", publicName: "startDate", isSignal: true, isRequired: false, transformFunction: null }, endDate: { classPropertyName: "endDate", publicName: "endDate", isSignal: true, isRequired: false, transformFunction: null }, showCustomRangeLabel: { classPropertyName: "showCustomRangeLabel", publicName: "showCustomRangeLabel", isSignal: true, isRequired: false, transformFunction: null }, keepCalendarOpeningWithRange: { classPropertyName: "keepCalendarOpeningWithRange", publicName: "keepCalendarOpeningWithRange", isSignal: true, isRequired: false, transformFunction: null }, singleDateSelected: { classPropertyName: "singleDateSelected", publicName: "singleDateSelected", isSignal: true, isRequired: false, transformFunction: null }, dateRangeSelected: { classPropertyName: "dateRangeSelected", publicName: "dateRangeSelected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { startDate: "startDateChange", endDate: "endDateChange", outChangStageFlagMouse: "outChangStageFlagMouse", outUpdateWidth: "outUpdateWidth", outCancel: "outCancel", outSelectSingleDate: "outSelectSingleDate", outSelectDateRange: "outSelectDateRange", outClickMenuRangeCustom: "outClickMenuRangeCustom" }, ngImport: i0, template: "<div\n #pickerContainer\n class=\"libs-ui-component-custom_ranges flex rounded-[4px] bg-[#ffffff] z-[1000] overflow-hidden\"\n [class.flex-row-reverse]=\"positionQuickRanges() === 'right'\">\n @if (!isSingle()) {\n <div\n class=\"libs-ui-component-custom_ranges-ranges {{ classInclude() || '' }}\"\n [class.border-l-[#e6e8ed]]=\"positionQuickRanges() === 'right' && showCalTableInRanges()\"\n [class.border-l]=\"positionQuickRanges() === 'right' && showCalTableInRanges()\"\n [class.border-r-[#e6e8ed]]=\"positionQuickRanges() === 'left' && showCalTableInRanges()\"\n [class.border-r]=\"positionQuickRanges() === 'left' && showCalTableInRanges()\"\n [class.!min-h-[260px]]=\"showCalTableInRanges() && !isSingle()\"\n [class.!min-h-[300px]]=\"hasTimePicker() && !isSingle()\"\n [class.!w-[160px]]=\"!widthByParent()\"\n [class.!w-full]=\"widthByParent()\">\n @for (range of quickRangesArray(); track range.id) {\n <div\n class=\"flex items-center hover:bg-[var(--libs-ui-color-light-3)] cursor-pointer px-[16px] py-[8px]\"\n [class.libs-ui-selected-range]=\"range.id === chosenQuickRange() && showCustomRangeLabel()\"\n [class.bg-[var(--libs-ui-color-light-3)]]=\"range.id === chosenQuickRange() || range.id === selectedQuickRange()\"\n (click)=\"handlerClickRange($event, range)\">\n <div class=\"libs-ui-font-h5r flex text-[#333333] min-w-0 w-full\">\n <div\n LibsUiComponentsPopoverDirective\n [ignoreStopPropagationEvent]=\"true\"\n type=\"text\"\n [config]=\"{ maxWidth: 160, direction: 'top', zIndex: (zIndex() || 1000) + 1 }\"\n [innerHTML]=\"range.label\"></div>\n </div>\n <i\n class=\"text-[12px] ml-[16px]\"\n [class.libs-ui-icon-check]=\"range.id === selectedQuickRange()\"\n [class.text-[var(--libs-ui-color-default)]]=\"range.id === selectedQuickRange()\"></i>\n </div>\n }\n </div>\n }\n @if (showCalTableInRanges()) {\n <div class=\"m-[16px] w-full\">\n <libs_ui-components-datetime-picker-custom_ranges-calendar\n [isSingle]=\"isSingle()\"\n [autoApply]=\"autoApply()\"\n [zIndex]=\"zIndex()\"\n [flagMouse]=\"flagMouse()\"\n [dateOptions]=\"dateOptions()\"\n [hasTimePicker]=\"hasTimePicker()\"\n [quickRangesArray]=\"quickRangesArray()\"\n [startDate]=\"startDate()\"\n [endDate]=\"endDate()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [listYearHiddenInputSearch]=\"listYearHiddenInputSearch()\"\n [classInclude]=\"'w-full'\"\n (outCancel)=\"handlerCancel()\"\n (outPickerDate)=\"handlerPickerDate($event)\"\n (outFunctionsControl)=\"handlerFunctionsControl($event)\"\n (outChangStageFlagMouse)=\"handlerChangeFlagMouse($event)\" />\n </div>\n }\n</div>\n", styles: [".libs-ui-component-custom_ranges{position:relative;box-shadow:0 2px 4px #00000029,0 2px 8px #0000001f}.libs-ui-component-custom_ranges .libs-ui-component-custom_ranges-ranges{width:159px;flex-shrink:0}.libs-ui-component-custom_ranges .libs-ui-component-custom_ranges-ranges .libs-ui-selected-range{position:relative}.libs-ui-component-custom_ranges .libs-ui-component-custom_ranges-ranges .libs-ui-selected-range:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:2px;background-color:var(--libs-ui-color-default)!important}@media (min-width: 564px){.libs-ui-component-custom_ranges{width:auto}}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: LibsUiComponentsDatetimePickerCustomRangesCalendarComponent, selector: "libs_ui-components-datetime-picker-custom_ranges-calendar", inputs: ["quickRangesArray", "zIndex", "classInclude", "isSingle", "showDropdownsSelect", "hasTimePicker", "flagMouse", "dateOptions", "autoApply", "hasSecondPicker", "showRangeLabelOnInput", "startDate", "endDate", "minDate", "maxDate", "listYearHiddenInputSearch"], outputs: ["startDateChange", "endDateChange", "outChangStageFlagMouse", "outPickerDate", "outCancel", "outUpdateWidth", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "initEventInElementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1775
+ }
1776
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsDatetimePickerCustomRangesComponent, decorators: [{
1777
+ type: Component,
1778
+ args: [{ selector: 'libs_ui-components-datetime-picker-custom_ranges', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [TranslateModule, LibsUiComponentsDatetimePickerCustomRangesCalendarComponent, LibsUiComponentsPopoverComponent], template: "<div\n #pickerContainer\n class=\"libs-ui-component-custom_ranges flex rounded-[4px] bg-[#ffffff] z-[1000] overflow-hidden\"\n [class.flex-row-reverse]=\"positionQuickRanges() === 'right'\">\n @if (!isSingle()) {\n <div\n class=\"libs-ui-component-custom_ranges-ranges {{ classInclude() || '' }}\"\n [class.border-l-[#e6e8ed]]=\"positionQuickRanges() === 'right' && showCalTableInRanges()\"\n [class.border-l]=\"positionQuickRanges() === 'right' && showCalTableInRanges()\"\n [class.border-r-[#e6e8ed]]=\"positionQuickRanges() === 'left' && showCalTableInRanges()\"\n [class.border-r]=\"positionQuickRanges() === 'left' && showCalTableInRanges()\"\n [class.!min-h-[260px]]=\"showCalTableInRanges() && !isSingle()\"\n [class.!min-h-[300px]]=\"hasTimePicker() && !isSingle()\"\n [class.!w-[160px]]=\"!widthByParent()\"\n [class.!w-full]=\"widthByParent()\">\n @for (range of quickRangesArray(); track range.id) {\n <div\n class=\"flex items-center hover:bg-[var(--libs-ui-color-light-3)] cursor-pointer px-[16px] py-[8px]\"\n [class.libs-ui-selected-range]=\"range.id === chosenQuickRange() && showCustomRangeLabel()\"\n [class.bg-[var(--libs-ui-color-light-3)]]=\"range.id === chosenQuickRange() || range.id === selectedQuickRange()\"\n (click)=\"handlerClickRange($event, range)\">\n <div class=\"libs-ui-font-h5r flex text-[#333333] min-w-0 w-full\">\n <div\n LibsUiComponentsPopoverDirective\n [ignoreStopPropagationEvent]=\"true\"\n type=\"text\"\n [config]=\"{ maxWidth: 160, direction: 'top', zIndex: (zIndex() || 1000) + 1 }\"\n [innerHTML]=\"range.label\"></div>\n </div>\n <i\n class=\"text-[12px] ml-[16px]\"\n [class.libs-ui-icon-check]=\"range.id === selectedQuickRange()\"\n [class.text-[var(--libs-ui-color-default)]]=\"range.id === selectedQuickRange()\"></i>\n </div>\n }\n </div>\n }\n @if (showCalTableInRanges()) {\n <div class=\"m-[16px] w-full\">\n <libs_ui-components-datetime-picker-custom_ranges-calendar\n [isSingle]=\"isSingle()\"\n [autoApply]=\"autoApply()\"\n [zIndex]=\"zIndex()\"\n [flagMouse]=\"flagMouse()\"\n [dateOptions]=\"dateOptions()\"\n [hasTimePicker]=\"hasTimePicker()\"\n [quickRangesArray]=\"quickRangesArray()\"\n [startDate]=\"startDate()\"\n [endDate]=\"endDate()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [listYearHiddenInputSearch]=\"listYearHiddenInputSearch()\"\n [classInclude]=\"'w-full'\"\n (outCancel)=\"handlerCancel()\"\n (outPickerDate)=\"handlerPickerDate($event)\"\n (outFunctionsControl)=\"handlerFunctionsControl($event)\"\n (outChangStageFlagMouse)=\"handlerChangeFlagMouse($event)\" />\n </div>\n }\n</div>\n", styles: [".libs-ui-component-custom_ranges{position:relative;box-shadow:0 2px 4px #00000029,0 2px 8px #0000001f}.libs-ui-component-custom_ranges .libs-ui-component-custom_ranges-ranges{width:159px;flex-shrink:0}.libs-ui-component-custom_ranges .libs-ui-component-custom_ranges-ranges .libs-ui-selected-range{position:relative}.libs-ui-component-custom_ranges .libs-ui-component-custom_ranges-ranges .libs-ui-selected-range:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:2px;background-color:var(--libs-ui-color-default)!important}@media (min-width: 564px){.libs-ui-component-custom_ranges{width:auto}}\n"] }]
1779
+ }], ctorParameters: () => [] });
1780
+
1781
+ class LibsUiComponentsDatetimePickerComponent {
1782
+ /** PROPERTY */
1783
+ ERROR_MESSAGE_EMPTY_VALID = ERROR_MESSAGE_EMPTY_VALID;
1784
+ showRangesPopup = signal(false);
1785
+ width = computed(this.computedWidth.bind(this));
1786
+ singleError = signal({ message: undefined });
1787
+ chosenDateFromRanges = signal({});
1788
+ selectedDateFromCalendar;
1789
+ displayRangeTitle = computed(() => {
1790
+ const selectedLabel = this.chosenDateFromRanges().selectedLabel;
1791
+ if (this.isSingle() || !selectedLabel) {
1792
+ return;
1793
+ }
1794
+ return selectedLabel;
1795
+ });
1796
+ popoverFunctionControlEvent = signal(undefined);
1797
+ /** INPUT */
1798
+ dateOptions = input(getDateOptionsDefault(), { transform: (value) => value ?? getDateOptionsDefault() });
1799
+ showCustomRangeLabel = input(true, { transform: (value) => value ?? true });
1800
+ labelConfig = input();
1801
+ disable = input(false);
1802
+ readonly = input(false);
1803
+ classInclude = input('');
1804
+ classPickerInclude = input('');
1805
+ classPickerContentInclude = input('');
1806
+ ignoreBorderQuickRange = input(false);
1807
+ useColorModeExist = input(false);
1808
+ hasTimePicker = input(true);
1809
+ allowReset = input(true);
1810
+ widthByLabel = input(true, { transform: (value) => value ?? true });
1811
+ directionPopover = input('bottom', { transform: (value) => value ?? 'bottom' });
1812
+ defaultWidth = input(undefined);
1813
+ isSingle = input(false);
1814
+ extendRanges = input([]);
1815
+ isBorderError = input(false);
1816
+ minDate = input();
1817
+ maxDate = input();
1818
+ placeholder = input();
1819
+ listYearHiddenInputSearch = input(false, { transform: (value) => value ?? false });
1820
+ validRequired = input(undefined);
1821
+ ignoreStopPropagationEvent = input(false);
1822
+ flagMouse = model({ isMouseEnter: false, isMouseEnterContent: false });
1823
+ widthByParent = input(false);
1824
+ zIndex = input(1200, { transform: (value) => value ?? 1200 });
1825
+ rangesPopoverPosition = input('start', { transform: (value) => value ?? 'start' });
1826
+ rangesPopoverPositionDistance = input(0, { transform: (value) => value ?? 0 });
1827
+ isNgContent = input(false);
1828
+ classIncludeCustomRanges = input('');
1829
+ autoApply = input(false);
1830
+ positionQuickRanges = input('left'); // vị trí list chọn nhanh khoảng thời gian
1831
+ trackDateRageUpdateLabel = input(false);
1832
+ singleDateSelected = model();
1833
+ dateRangeSelected = model();
1834
+ /** OUTPUT */
1835
+ outChangStageFlagMouse = output();
1836
+ outReset = output();
1837
+ outSelectSingleDate = output();
1838
+ outSelectDateRange = output();
1839
+ outFunctionsControl = output();
1840
+ constructor() {
1841
+ effect(() => {
1842
+ const date = this.singleDateSelected()?.date;
1843
+ if (date) {
1844
+ untracked(() => {
1845
+ const formatDate = this.hasTimePicker() ? 'DD/MM/YYYY HH:mm' : 'DD/MM/YYYY';
1846
+ const startTime = getDayjs({ date }).format(formatDate);
1847
+ this.chosenDateFromRanges.set({ selectedLabel: startTime });
1848
+ });
1849
+ }
1850
+ });
1851
+ effect(() => {
1852
+ if (this.trackDateRageUpdateLabel()) {
1853
+ this.updateChosenDateFromRangesFromDateRangeSelected(this.dateRangeSelected());
1854
+ return;
1855
+ }
1856
+ untracked(() => this.updateChosenDateFromRangesFromDateRangeSelected(this.dateRangeSelected()));
1857
+ });
1858
+ }
1859
+ ngOnInit() {
1860
+ this.outFunctionsControl.emit(this.FunctionsControl);
1861
+ }
1862
+ get FunctionsControl() {
1863
+ return {
1864
+ checkIsValid: this.checkIsValid.bind(this),
1865
+ resetError: this.resetError.bind(this),
1866
+ reset: this.reset.bind(this),
1867
+ };
1868
+ }
1869
+ handlerSelectRanges(event) {
1870
+ event.stopPropagation();
1871
+ }
1872
+ handlerChangStageFlagMouse(flagMouse) {
1873
+ this.flagMouse.set(flagMouse);
1874
+ }
1875
+ handlerChangStagePopoverFlagMouse(flagMouse) {
1876
+ if (this.flagMouse()?.isMouseEnterContent) {
1877
+ flagMouse.isMouseEnterContent = true;
1878
+ }
1879
+ this.outChangStageFlagMouse.emit(flagMouse);
1880
+ }
1881
+ handlerFunctionControl(event) {
1882
+ this.popoverFunctionControlEvent.set(event);
1883
+ }
1884
+ handlerPopoverEvent(event) {
1885
+ if (event === 'remove') {
1886
+ this.showRangesPopup.set(false);
1887
+ }
1888
+ }
1889
+ async handlerPickerSingleDate(data) {
1890
+ this.outSelectSingleDate.emit(data);
1891
+ this.chosenDateFromRanges.set({ selectedLabel: data.displayLabel });
1892
+ if (this.hasTimePicker()) {
1893
+ const startTime = getDayjs({ date: data.date, returnDayjsIfConfigDateNotExist: true }).format('DD/MM/YYYY HH:mm');
1894
+ this.chosenDateFromRanges.update((current) => {
1895
+ current.selectedLabel = `${startTime}`;
1896
+ return current;
1897
+ });
1898
+ }
1899
+ this.singleDateSelected.set(data);
1900
+ this.popoverFunctionControlEvent()?.removePopoverOverlay();
1901
+ await this.checkIsValid();
1902
+ }
1903
+ async handlerPickerDateRange(data) {
1904
+ if ((data.displayLabel?.indexOf('Invalid Date') ?? -1) > -1) {
1905
+ return;
1906
+ }
1907
+ // this.selectedKey = data.selectedLabel;
1908
+ this.chosenDateFromRanges.set({ selectedLabel: data.displayLabel });
1909
+ // this.selected.start = getDayjs<Dayjs>({date:data.startDate});
1910
+ // this.selected.end = getDayjs<Dayjs>({date:data.endDate});
1911
+ if (this.hasTimePicker()) {
1912
+ const startTime = getDayjs({ date: data.startDate, returnDayjsIfConfigDateNotExist: true }).format('DD/MM/YYYY HH:mm');
1913
+ const endTime = getDayjs({ date: data.endDate, returnDayjsIfConfigDateNotExist: true }).format('DD/MM/YYYY HH:mm');
1914
+ this.chosenDateFromRanges.update((current) => {
1915
+ current.selectedLabel = `${startTime} - ${endTime}`;
1916
+ return current;
1917
+ });
1918
+ }
1919
+ // this.moDatePicker.emit(this.singleDatePicker ? { chosenLabel: this.dateValue.chosenLabel, singleDate: this.dateValue.startDate?.utc(), startDate: this.dateValue.startDate?.utc(), endDate: this.dateValue.endDate?.utc() } : { chosenLabel: this.dateValue.chosenLabel, startDate: this.dateValue.startDate?.utc(), endDate: this.dateValue.endDate?.utc() });
1920
+ const showViewExternalRangeLabel = this.extendRanges()?.find((item) => item.id === this.chosenDateFromRanges().selectedLabel);
1921
+ if (this.extendRanges() && showViewExternalRangeLabel) {
1922
+ this.chosenDateFromRanges.update((current) => {
1923
+ current.selectedLabel = showViewExternalRangeLabel && showViewExternalRangeLabel.label;
1924
+ return current;
1925
+ });
1926
+ }
1927
+ this.dateRangeSelected.set({ quickRangeId: data.quickRangeId, displayLabel: data.displayLabel, startDate: data.startDate, endDate: data.endDate });
1928
+ this.outSelectDateRange.emit({ quickRangeId: data.quickRangeId, displayLabel: data.displayLabel, startDate: data.startDate, endDate: data.endDate });
1929
+ this.popoverFunctionControlEvent()?.removePopoverOverlay();
1930
+ await this.checkIsValid();
1931
+ }
1932
+ updateChosenDateFromRangesFromDateRangeSelected(dateRangeSelected) {
1933
+ untracked(() => {
1934
+ if (dateRangeSelected?.quickRangeId) {
1935
+ const findKeyRange = Object.keys(this.dateOptions().ranges).find((key) => key === dateRangeSelected?.quickRangeId);
1936
+ if (findKeyRange) {
1937
+ this.chosenDateFromRanges.set({ selectedLabel: this.dateOptions().ranges[findKeyRange] });
1938
+ return;
1939
+ }
1940
+ }
1941
+ if (dateRangeSelected?.startDate && dateRangeSelected?.endDate) {
1942
+ const formatDate = this.hasTimePicker() ? 'DD/MM/YYYY HH:mm' : 'DD/MM/YYYY';
1943
+ const startTime = getDayjs({ date: dateRangeSelected?.startDate })?.format(formatDate);
1944
+ const endTime = getDayjs({ date: dateRangeSelected?.endDate })?.format(formatDate);
1945
+ this.chosenDateFromRanges.set({ selectedLabel: `${startTime} - ${endTime}` });
1946
+ }
1947
+ });
1948
+ }
1949
+ async handlerReset(event) {
1950
+ event?.stopPropagation();
1951
+ await this.reset(true);
1952
+ }
1953
+ async reset(checkIsValid, dateRangeReset, singleDateReset) {
1954
+ this.chosenDateFromRanges.set({});
1955
+ this.dateRangeSelected.set(dateRangeReset);
1956
+ if (dateRangeReset) {
1957
+ this.updateChosenDateFromRangesFromDateRangeSelected(dateRangeReset);
1958
+ }
1959
+ if (singleDateReset) {
1960
+ this.singleDateSelected.set(singleDateReset);
1961
+ }
1962
+ this.outReset.emit(dateRangeReset || singleDateReset);
1963
+ if (checkIsValid && this.validRequired()) {
1964
+ await this.checkIsValid();
1965
+ }
1966
+ }
1967
+ handlerUpdateWidth() {
1968
+ this.popoverFunctionControlEvent()?.updatePopoverOverlayPosition();
1969
+ }
1970
+ handlerCancel() {
1971
+ this.popoverFunctionControlEvent()?.removePopoverOverlay();
1972
+ }
1973
+ async checkIsValid() {
1974
+ if (this.readonly() || this.disable()) {
1975
+ return true;
1976
+ }
1977
+ await this.validate();
1978
+ return this.singleError().message ? false : true;
1979
+ }
1980
+ async validate() {
1981
+ this.singleError.set({ message: undefined });
1982
+ if (!this.validRequired()) {
1983
+ return;
1984
+ }
1985
+ if (this.validRequired() && !this.chosenDateFromRanges().selectedLabel) {
1986
+ this.singleError.set({
1987
+ message: this.validRequired()?.message || ERROR_MESSAGE_EMPTY_VALID,
1988
+ interpolateParams: this.validRequired()?.interpolateParams || {},
1989
+ });
1990
+ return;
1991
+ }
1992
+ }
1993
+ async resetError(message, interpolateParams) {
1994
+ this.singleError.set({ message, interpolateParams });
1995
+ }
1996
+ computedWidth() {
1997
+ if (this.widthByLabel()) {
1998
+ return;
1999
+ }
2000
+ if (this.defaultWidth()) {
2001
+ return this.defaultWidth();
2002
+ }
2003
+ if (this.hasTimePicker()) {
2004
+ return !this.isSingle() ? 322 : 190;
2005
+ }
2006
+ return !this.isSingle() ? 232 : 152;
2007
+ }
2008
+ ngOnDestroy() {
2009
+ return;
2010
+ }
2011
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsDatetimePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2012
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsDatetimePickerComponent, isStandalone: true, selector: "libs_ui-components-datetime-picker", inputs: { dateOptions: { classPropertyName: "dateOptions", publicName: "dateOptions", isSignal: true, isRequired: false, transformFunction: null }, showCustomRangeLabel: { classPropertyName: "showCustomRangeLabel", publicName: "showCustomRangeLabel", isSignal: true, isRequired: false, transformFunction: null }, labelConfig: { classPropertyName: "labelConfig", publicName: "labelConfig", 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 }, classInclude: { classPropertyName: "classInclude", publicName: "classInclude", isSignal: true, isRequired: false, transformFunction: null }, classPickerInclude: { classPropertyName: "classPickerInclude", publicName: "classPickerInclude", isSignal: true, isRequired: false, transformFunction: null }, classPickerContentInclude: { classPropertyName: "classPickerContentInclude", publicName: "classPickerContentInclude", isSignal: true, isRequired: false, transformFunction: null }, ignoreBorderQuickRange: { classPropertyName: "ignoreBorderQuickRange", publicName: "ignoreBorderQuickRange", isSignal: true, isRequired: false, transformFunction: null }, useColorModeExist: { classPropertyName: "useColorModeExist", publicName: "useColorModeExist", isSignal: true, isRequired: false, transformFunction: null }, hasTimePicker: { classPropertyName: "hasTimePicker", publicName: "hasTimePicker", isSignal: true, isRequired: false, transformFunction: null }, allowReset: { classPropertyName: "allowReset", publicName: "allowReset", isSignal: true, isRequired: false, transformFunction: null }, widthByLabel: { classPropertyName: "widthByLabel", publicName: "widthByLabel", isSignal: true, isRequired: false, transformFunction: null }, directionPopover: { classPropertyName: "directionPopover", publicName: "directionPopover", isSignal: true, isRequired: false, transformFunction: null }, defaultWidth: { classPropertyName: "defaultWidth", publicName: "defaultWidth", isSignal: true, isRequired: false, transformFunction: null }, isSingle: { classPropertyName: "isSingle", publicName: "isSingle", isSignal: true, isRequired: false, transformFunction: null }, extendRanges: { classPropertyName: "extendRanges", publicName: "extendRanges", isSignal: true, isRequired: false, transformFunction: null }, isBorderError: { classPropertyName: "isBorderError", publicName: "isBorderError", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, listYearHiddenInputSearch: { classPropertyName: "listYearHiddenInputSearch", publicName: "listYearHiddenInputSearch", isSignal: true, isRequired: false, transformFunction: null }, validRequired: { classPropertyName: "validRequired", publicName: "validRequired", isSignal: true, isRequired: false, transformFunction: null }, ignoreStopPropagationEvent: { classPropertyName: "ignoreStopPropagationEvent", publicName: "ignoreStopPropagationEvent", isSignal: true, isRequired: false, transformFunction: null }, flagMouse: { classPropertyName: "flagMouse", publicName: "flagMouse", isSignal: true, isRequired: false, transformFunction: null }, widthByParent: { classPropertyName: "widthByParent", publicName: "widthByParent", isSignal: true, isRequired: false, transformFunction: null }, zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, rangesPopoverPosition: { classPropertyName: "rangesPopoverPosition", publicName: "rangesPopoverPosition", isSignal: true, isRequired: false, transformFunction: null }, rangesPopoverPositionDistance: { classPropertyName: "rangesPopoverPositionDistance", publicName: "rangesPopoverPositionDistance", isSignal: true, isRequired: false, transformFunction: null }, isNgContent: { classPropertyName: "isNgContent", publicName: "isNgContent", isSignal: true, isRequired: false, transformFunction: null }, classIncludeCustomRanges: { classPropertyName: "classIncludeCustomRanges", publicName: "classIncludeCustomRanges", isSignal: true, isRequired: false, transformFunction: null }, autoApply: { classPropertyName: "autoApply", publicName: "autoApply", isSignal: true, isRequired: false, transformFunction: null }, positionQuickRanges: { classPropertyName: "positionQuickRanges", publicName: "positionQuickRanges", isSignal: true, isRequired: false, transformFunction: null }, trackDateRageUpdateLabel: { classPropertyName: "trackDateRageUpdateLabel", publicName: "trackDateRageUpdateLabel", isSignal: true, isRequired: false, transformFunction: null }, singleDateSelected: { classPropertyName: "singleDateSelected", publicName: "singleDateSelected", isSignal: true, isRequired: false, transformFunction: null }, dateRangeSelected: { classPropertyName: "dateRangeSelected", publicName: "dateRangeSelected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { flagMouse: "flagMouseChange", singleDateSelected: "singleDateSelectedChange", dateRangeSelected: "dateRangeSelectedChange", outChangStageFlagMouse: "outChangStageFlagMouse", outReset: "outReset", outSelectSingleDate: "outSelectSingleDate", outSelectDateRange: "outSelectDateRange", outFunctionsControl: "outFunctionsControl" }, ngImport: i0, template: "<div class=\"libs-ui-date-picker {{ classInclude() }}\">\n @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 [buttonsRight]=\"labelConfig.buttonsRight\"\n [disableButtonsLeft]=\"labelConfig.disableButtonsLeft || disable()\"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight || disable()\"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable || disable()\"\n [popover]=\"labelConfig.popover\"\n [iconPopoverClass]=\"labelConfig.iconPopoverClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [limitLength]=\"labelConfig.limitLength\"\n [buttonsDescription]=\"labelConfig.buttonsDescription\"\n [disableButtonsDescription]=\"labelConfig.disableButtonsDescription || disable()\"\n [buttonsDescriptionContainerClass]=\"labelConfig.buttonsDescriptionContainerClass\"\n [count]=\"labelConfig.count\" />\n }\n <div class=\"flex w-full\">\n <libs_ui-components-popover\n [class]=\"classPickerInclude()\"\n [ignoreShowPopover]=\"disable() || readonly()\"\n [mode]=\"'click'\"\n [ignoreHiddenPopoverContentWhenMouseLeave]=\"true\"\n [ignoreStopPropagationEvent]=\"ignoreStopPropagationEvent()\"\n [flagMouse]=\"flagMouse()\"\n [config]=\"{\n animationConfig: {},\n maxWidth: 770,\n maxHeight: 425,\n directionDistance: 2,\n template: customRangesRef,\n widthByParent: widthByParent(),\n whiteTheme: true,\n ignoreArrow: true,\n zIndex: zIndex(),\n classInclude: 'rounded-[4px] ',\n direction: directionPopover(),\n position: { mode: rangesPopoverPosition(), distance: rangesPopoverPositionDistance() },\n }\"\n (outChangStageFlagMouse)=\"handlerChangStagePopoverFlagMouse($event)\"\n (outFunctionsControl)=\"handlerFunctionControl($event)\"\n (outEvent)=\"handlerPopoverEvent($event)\">\n @if (!isNgContent()) {\n <div\n #containerRef\n class=\"flex items-center px-[12px] h-[32px] rounded-[4px] bg-[#ffffff] cursor-pointer libs-ui-font-h5r {{ classPickerContentInclude() }}\"\n [class.libs-ui-disable]=\"disable()\"\n [class.libs-ui-disable-background]=\"disable()\"\n [class.!border-none]=\"ignoreBorderQuickRange()\"\n [class.libs-ui-border-general]=\"!singleError().message && !ignoreBorderQuickRange()\"\n [class.libs-ui-border-error-general]=\"(singleError().message || isBorderError()) && !ignoreBorderQuickRange()\"\n [class.min-w-[284px]]=\"!chosenDateFromRanges().selectedLabel && !isSingle() && hasTimePicker()\"\n [class.!border]=\"showRangesPopup() && !ignoreBorderQuickRange() && !readonly()\"\n [class.!border-[#4e8cf7]]=\"showRangesPopup() && !ignoreBorderQuickRange() && !readonly()\"\n [class.libs-ui-readonly]=\"readonly()\"\n [class.libs-ui-readonly-background]=\"readonly()\"\n [style.width.px]=\"width()\"\n (click)=\"handlerSelectRanges($event)\">\n <div class=\"libs-ui-icon-calendar text-[#9ca2ad] text-[16px]\"></div>\n <div\n class=\"ml-[8px] libs-ui-date-picker-label\"\n [class.!text-[#071631]]=\"!disable()\"\n [class.!text-[#9ca2ad]]=\"disable()\">\n @if (!chosenDateFromRanges().selectedLabel) {\n @if (!isSingle()) {\n @if (!placeholder()) {\n <span class=\"text-[#9ca2ad]\">\n dd/mm/yyyy\n @if (hasTimePicker()) {\n <span>&nbsp;hh:mm</span>\n }\n - dd/mm/yyyy\n @if (hasTimePicker()) {\n <span>&nbsp;hh:mm</span>\n }\n </span>\n } @else {\n <span class=\"text-[#9ca2ad]\">\n @let constHtmlPlaceholder = placeholder() || ' ';\n {{ constHtmlPlaceholder | translate }}\n </span>\n }\n }\n @if (isSingle()) {\n @if (!placeholder()) {\n <span class=\"text-[#9ca2ad]\">\n dd/mm/yyyy\n @if (hasTimePicker()) {\n <span>&nbsp;hh:mm</span>\n }\n </span>\n } @else {\n <span class=\"text-[#9ca2ad]\">\n @let constHtmlPlaceholder = placeholder() || ' ';\n {{ constHtmlPlaceholder | translate }}\n </span>\n }\n }\n }\n @if (chosenDateFromRanges().selectedLabel && !isSingle()) {\n {{ displayRangeTitle() }}\n }\n @if (chosenDateFromRanges().selectedLabel && isSingle()) {\n <span [class.text-[#29c7cc]]=\"useColorModeExist() || false\">\n {{ chosenDateFromRanges().selectedLabel }}\n </span>\n }\n </div>\n @if (chosenDateFromRanges().selectedLabel && allowReset() && !disable() && !readonly()) {\n <div class=\"pl-[12px] ml-auto h-full flex items-center\">\n <i\n class=\"libs-ui-icon-close-circle-solid text-[16px] text-[#cdd0d6]\"\n (click)=\"handlerReset($event)\"></i>\n </div>\n }\n </div>\n }\n @if (isNgContent()) {\n <div (click)=\"handlerSelectRanges($event)\">\n <ng-content></ng-content>\n </div>\n }\n </libs_ui-components-popover>\n </div>\n @if (singleError().message && !validRequired()?.ignoreMessage) {\n @let constHtmlMessage = singleError().message || ERROR_MESSAGE_EMPTY_VALID;\n <div\n class=\"mt-[8px] text-[#ee2d41] libs-ui-font-h7r libs-ui-text-error\"\n [innerHTML]=\"constHtmlMessage | translate: validRequired()?.interpolateParams\"></div>\n }\n</div>\n\n<ng-template #customRangesRef>\n <libs_ui-components-datetime-picker-custom_ranges\n [zIndex]=\"zIndex()\"\n [classInclude]=\"classIncludeCustomRanges()\"\n [widthByParent]=\"widthByParent()\"\n [dateOptions]=\"dateOptions()\"\n [positionQuickRanges]=\"positionQuickRanges()\"\n [showCustomRangeLabel]=\"showCustomRangeLabel()\"\n [autoApply]=\"autoApply()\"\n [isSingle]=\"isSingle()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [listYearHiddenInputSearch]=\"listYearHiddenInputSearch()\"\n [singleDateSelected]=\"singleDateSelected()\"\n [dateRangeSelected]=\"dateRangeSelected()\"\n [extendRanges]=\"extendRanges()\"\n [hasTimePicker]=\"hasTimePicker()\"\n (outUpdateWidth)=\"handlerUpdateWidth()\"\n (outCancel)=\"handlerCancel()\"\n (outSelectSingleDate)=\"handlerPickerSingleDate($event)\"\n (outSelectDateRange)=\"handlerPickerDateRange($event)\"\n (outChangStageFlagMouse)=\"handlerChangStageFlagMouse($event)\"\n (outClickMenuRangeCustom)=\"handlerUpdateWidth()\" />\n</ng-template>\n", styles: [""], 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: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "initEventInElementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsDatetimePickerCustomRangesComponent, selector: "libs_ui-components-datetime-picker-custom_ranges", inputs: ["zIndex", "classInclude", "extendRanges", "widthByParent", "autoApply", "minDate", "maxDate", "listYearHiddenInputSearch", "positionQuickRanges", "isSingle", "hasTimePicker", "flagMouse", "dateOptions", "alwaysShowCalendars", "startDate", "endDate", "showCustomRangeLabel", "keepCalendarOpeningWithRange", "singleDateSelected", "dateRangeSelected"], outputs: ["startDateChange", "endDateChange", "outChangStageFlagMouse", "outUpdateWidth", "outCancel", "outSelectSingleDate", "outSelectDateRange", "outClickMenuRangeCustom"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2013
+ }
2014
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsDatetimePickerComponent, decorators: [{
2015
+ type: Component,
2016
+ args: [{ selector: 'libs_ui-components-datetime-picker', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [TranslateModule, LibsUiComponentsLabelComponent, LibsUiComponentsPopoverComponent, LibsUiComponentsDatetimePickerCustomRangesComponent], template: "<div class=\"libs-ui-date-picker {{ classInclude() }}\">\n @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 [buttonsRight]=\"labelConfig.buttonsRight\"\n [disableButtonsLeft]=\"labelConfig.disableButtonsLeft || disable()\"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight || disable()\"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable || disable()\"\n [popover]=\"labelConfig.popover\"\n [iconPopoverClass]=\"labelConfig.iconPopoverClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [limitLength]=\"labelConfig.limitLength\"\n [buttonsDescription]=\"labelConfig.buttonsDescription\"\n [disableButtonsDescription]=\"labelConfig.disableButtonsDescription || disable()\"\n [buttonsDescriptionContainerClass]=\"labelConfig.buttonsDescriptionContainerClass\"\n [count]=\"labelConfig.count\" />\n }\n <div class=\"flex w-full\">\n <libs_ui-components-popover\n [class]=\"classPickerInclude()\"\n [ignoreShowPopover]=\"disable() || readonly()\"\n [mode]=\"'click'\"\n [ignoreHiddenPopoverContentWhenMouseLeave]=\"true\"\n [ignoreStopPropagationEvent]=\"ignoreStopPropagationEvent()\"\n [flagMouse]=\"flagMouse()\"\n [config]=\"{\n animationConfig: {},\n maxWidth: 770,\n maxHeight: 425,\n directionDistance: 2,\n template: customRangesRef,\n widthByParent: widthByParent(),\n whiteTheme: true,\n ignoreArrow: true,\n zIndex: zIndex(),\n classInclude: 'rounded-[4px] ',\n direction: directionPopover(),\n position: { mode: rangesPopoverPosition(), distance: rangesPopoverPositionDistance() },\n }\"\n (outChangStageFlagMouse)=\"handlerChangStagePopoverFlagMouse($event)\"\n (outFunctionsControl)=\"handlerFunctionControl($event)\"\n (outEvent)=\"handlerPopoverEvent($event)\">\n @if (!isNgContent()) {\n <div\n #containerRef\n class=\"flex items-center px-[12px] h-[32px] rounded-[4px] bg-[#ffffff] cursor-pointer libs-ui-font-h5r {{ classPickerContentInclude() }}\"\n [class.libs-ui-disable]=\"disable()\"\n [class.libs-ui-disable-background]=\"disable()\"\n [class.!border-none]=\"ignoreBorderQuickRange()\"\n [class.libs-ui-border-general]=\"!singleError().message && !ignoreBorderQuickRange()\"\n [class.libs-ui-border-error-general]=\"(singleError().message || isBorderError()) && !ignoreBorderQuickRange()\"\n [class.min-w-[284px]]=\"!chosenDateFromRanges().selectedLabel && !isSingle() && hasTimePicker()\"\n [class.!border]=\"showRangesPopup() && !ignoreBorderQuickRange() && !readonly()\"\n [class.!border-[#4e8cf7]]=\"showRangesPopup() && !ignoreBorderQuickRange() && !readonly()\"\n [class.libs-ui-readonly]=\"readonly()\"\n [class.libs-ui-readonly-background]=\"readonly()\"\n [style.width.px]=\"width()\"\n (click)=\"handlerSelectRanges($event)\">\n <div class=\"libs-ui-icon-calendar text-[#9ca2ad] text-[16px]\"></div>\n <div\n class=\"ml-[8px] libs-ui-date-picker-label\"\n [class.!text-[#071631]]=\"!disable()\"\n [class.!text-[#9ca2ad]]=\"disable()\">\n @if (!chosenDateFromRanges().selectedLabel) {\n @if (!isSingle()) {\n @if (!placeholder()) {\n <span class=\"text-[#9ca2ad]\">\n dd/mm/yyyy\n @if (hasTimePicker()) {\n <span>&nbsp;hh:mm</span>\n }\n - dd/mm/yyyy\n @if (hasTimePicker()) {\n <span>&nbsp;hh:mm</span>\n }\n </span>\n } @else {\n <span class=\"text-[#9ca2ad]\">\n @let constHtmlPlaceholder = placeholder() || ' ';\n {{ constHtmlPlaceholder | translate }}\n </span>\n }\n }\n @if (isSingle()) {\n @if (!placeholder()) {\n <span class=\"text-[#9ca2ad]\">\n dd/mm/yyyy\n @if (hasTimePicker()) {\n <span>&nbsp;hh:mm</span>\n }\n </span>\n } @else {\n <span class=\"text-[#9ca2ad]\">\n @let constHtmlPlaceholder = placeholder() || ' ';\n {{ constHtmlPlaceholder | translate }}\n </span>\n }\n }\n }\n @if (chosenDateFromRanges().selectedLabel && !isSingle()) {\n {{ displayRangeTitle() }}\n }\n @if (chosenDateFromRanges().selectedLabel && isSingle()) {\n <span [class.text-[#29c7cc]]=\"useColorModeExist() || false\">\n {{ chosenDateFromRanges().selectedLabel }}\n </span>\n }\n </div>\n @if (chosenDateFromRanges().selectedLabel && allowReset() && !disable() && !readonly()) {\n <div class=\"pl-[12px] ml-auto h-full flex items-center\">\n <i\n class=\"libs-ui-icon-close-circle-solid text-[16px] text-[#cdd0d6]\"\n (click)=\"handlerReset($event)\"></i>\n </div>\n }\n </div>\n }\n @if (isNgContent()) {\n <div (click)=\"handlerSelectRanges($event)\">\n <ng-content></ng-content>\n </div>\n }\n </libs_ui-components-popover>\n </div>\n @if (singleError().message && !validRequired()?.ignoreMessage) {\n @let constHtmlMessage = singleError().message || ERROR_MESSAGE_EMPTY_VALID;\n <div\n class=\"mt-[8px] text-[#ee2d41] libs-ui-font-h7r libs-ui-text-error\"\n [innerHTML]=\"constHtmlMessage | translate: validRequired()?.interpolateParams\"></div>\n }\n</div>\n\n<ng-template #customRangesRef>\n <libs_ui-components-datetime-picker-custom_ranges\n [zIndex]=\"zIndex()\"\n [classInclude]=\"classIncludeCustomRanges()\"\n [widthByParent]=\"widthByParent()\"\n [dateOptions]=\"dateOptions()\"\n [positionQuickRanges]=\"positionQuickRanges()\"\n [showCustomRangeLabel]=\"showCustomRangeLabel()\"\n [autoApply]=\"autoApply()\"\n [isSingle]=\"isSingle()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [listYearHiddenInputSearch]=\"listYearHiddenInputSearch()\"\n [singleDateSelected]=\"singleDateSelected()\"\n [dateRangeSelected]=\"dateRangeSelected()\"\n [extendRanges]=\"extendRanges()\"\n [hasTimePicker]=\"hasTimePicker()\"\n (outUpdateWidth)=\"handlerUpdateWidth()\"\n (outCancel)=\"handlerCancel()\"\n (outSelectSingleDate)=\"handlerPickerSingleDate($event)\"\n (outSelectDateRange)=\"handlerPickerDateRange($event)\"\n (outChangStageFlagMouse)=\"handlerChangStageFlagMouse($event)\"\n (outClickMenuRangeCustom)=\"handlerUpdateWidth()\" />\n</ng-template>\n" }]
2017
+ }], ctorParameters: () => [] });
2018
+
2019
+ /**
2020
+ * Generated bundle index. Do not edit.
2021
+ */
2022
+
2023
+ export { DEFAULT_MAX_YEAR, DEFAULT_MIN_YEAR, LibsUiComponentsDatetimePickerComponent, SideEnum, defaultLocaleConfig, getDateOptions, getDateOptionsDefault, getDateRangeDefault };
2024
+ //# sourceMappingURL=libs-ui-components-datetime-picker.mjs.map