mapa-library-ui 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/mapa-library-ui-src-lib-components-datepicker-range.mjs +158 -43
- package/fesm2022/mapa-library-ui-src-lib-components-datepicker-range.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs +97 -23
- package/fesm2022/mapa-library-ui-src-lib-components-datepicker.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-form.mjs +157 -42
- package/fesm2022/mapa-library-ui-src-lib-components-form.mjs.map +1 -1
- package/fesm2022/mapa-library-ui-src-lib-components-table.mjs +97 -23
- package/fesm2022/mapa-library-ui-src-lib-components-table.mjs.map +1 -1
- package/fesm2022/mapa-library-ui.mjs +158 -43
- package/fesm2022/mapa-library-ui.mjs.map +1 -1
- package/index.d.ts +24 -7
- package/mapa-library-ui-1.5.2.tgz +0 -0
- package/package.json +1 -1
- package/src/lib/components/datepicker-range/index.d.ts +11 -5
- package/mapa-library-ui-1.5.0.tgz +0 -0
|
@@ -4,7 +4,7 @@ import { InjectionToken, inject, Injector, signal, Optional, Inject, Injectable,
|
|
|
4
4
|
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import * as i2 from '@angular/forms';
|
|
6
6
|
import { FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
-
import { provideNativeDateAdapter } from '@angular/material/core';
|
|
7
|
+
import { DateAdapter, provideNativeDateAdapter } from '@angular/material/core';
|
|
8
8
|
import * as i3 from '@angular/material/datepicker';
|
|
9
9
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
10
10
|
import * as i4 from '@angular/material/form-field';
|
|
@@ -14,9 +14,11 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
14
14
|
import * as i6 from '@angular/material/input';
|
|
15
15
|
import { MatInputModule } from '@angular/material/input';
|
|
16
16
|
import { NgxMaskDirective, provideNgxMask } from 'ngx-mask';
|
|
17
|
-
import {
|
|
17
|
+
import { getStoredAppLanguage, getIntlLocale, getMapaUiTexts } from 'mapa-frontend-i18n';
|
|
18
18
|
|
|
19
19
|
const DAY_MONTH_YEAR_PATTERN = /^(\d{2})\/(\d{2})\/(\d{4})$/;
|
|
20
|
+
const MONTH_DAY_YEAR_PATTERN = /^(\d{2})\/(\d{2})\/(\d{4})$/;
|
|
21
|
+
const DOCS_LANGUAGE_STORAGE_KEY = "mapa-library-ui-docs-language";
|
|
20
22
|
function isValidDate(date) {
|
|
21
23
|
return !Number.isNaN(date.getTime());
|
|
22
24
|
}
|
|
@@ -29,7 +31,93 @@ function formatDateAsDayMonthYear(date) {
|
|
|
29
31
|
const year = `${date.getFullYear()}`;
|
|
30
32
|
return `${day}/${month}/${year}`;
|
|
31
33
|
}
|
|
32
|
-
function
|
|
34
|
+
function formatDateAsMonthDayYear(date) {
|
|
35
|
+
const day = `${date.getDate()}`.padStart(2, "0");
|
|
36
|
+
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
37
|
+
const year = `${date.getFullYear()}`;
|
|
38
|
+
return `${month}/${day}/${year}`;
|
|
39
|
+
}
|
|
40
|
+
function normalizeDateLocale(value) {
|
|
41
|
+
if (typeof value !== "string") {
|
|
42
|
+
return "pt-BR";
|
|
43
|
+
}
|
|
44
|
+
const normalizedValue = value.trim().toLowerCase();
|
|
45
|
+
if (normalizedValue.startsWith("en")) {
|
|
46
|
+
return "en";
|
|
47
|
+
}
|
|
48
|
+
if (normalizedValue.startsWith("es")) {
|
|
49
|
+
return "es";
|
|
50
|
+
}
|
|
51
|
+
return "pt-BR";
|
|
52
|
+
}
|
|
53
|
+
function getDocsStoredLanguage() {
|
|
54
|
+
if (typeof window === "undefined") {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
return window.localStorage.getItem(DOCS_LANGUAGE_STORAGE_KEY);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function getActiveDateLocale() {
|
|
65
|
+
return normalizeDateLocale(getDocsStoredLanguage() ?? getStoredAppLanguage());
|
|
66
|
+
}
|
|
67
|
+
function isMonthFirstDateLocale(locale = getActiveDateLocale()) {
|
|
68
|
+
return normalizeDateLocale(locale) === "en";
|
|
69
|
+
}
|
|
70
|
+
function getActiveDateFormat(locale = getActiveDateLocale()) {
|
|
71
|
+
return isMonthFirstDateLocale(locale) ? "MM/DD/YYYY" : "DD/MM/YYYY";
|
|
72
|
+
}
|
|
73
|
+
function getActiveMaterialDateFormat(locale = getActiveDateLocale()) {
|
|
74
|
+
return isMonthFirstDateLocale(locale) ? "MM/dd/yyyy" : "dd/MM/yyyy";
|
|
75
|
+
}
|
|
76
|
+
function getDateInputMask(_locale = getActiveDateLocale()) {
|
|
77
|
+
return "00/00/0000";
|
|
78
|
+
}
|
|
79
|
+
function formatDateForLocale(date, locale = getActiveDateLocale()) {
|
|
80
|
+
return isMonthFirstDateLocale(locale)
|
|
81
|
+
? formatDateAsMonthDayYear(date)
|
|
82
|
+
: formatDateAsDayMonthYear(date);
|
|
83
|
+
}
|
|
84
|
+
function parseOrderedDate(value, pattern, order) {
|
|
85
|
+
const match = pattern.exec(value.trim());
|
|
86
|
+
if (!match) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
const [, firstValue, secondValue, yearValue] = match;
|
|
90
|
+
const year = Number(yearValue);
|
|
91
|
+
const month = Number(order === "month-first" ? firstValue : secondValue);
|
|
92
|
+
const day = Number(order === "month-first" ? secondValue : firstValue);
|
|
93
|
+
const parsedDate = new Date(year, month - 1, day);
|
|
94
|
+
if (parsedDate.getFullYear() !== year ||
|
|
95
|
+
parsedDate.getMonth() !== month - 1 ||
|
|
96
|
+
parsedDate.getDate() !== day) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
return parsedDate;
|
|
100
|
+
}
|
|
101
|
+
function parseLocaleDateValue(value, locale = getActiveDateLocale()) {
|
|
102
|
+
const normalizedLocale = normalizeDateLocale(locale);
|
|
103
|
+
const parsers = normalizedLocale === "en"
|
|
104
|
+
? [
|
|
105
|
+
() => parseOrderedDate(value, MONTH_DAY_YEAR_PATTERN, "month-first"),
|
|
106
|
+
() => parseOrderedDate(value, DAY_MONTH_YEAR_PATTERN, "day-first"),
|
|
107
|
+
]
|
|
108
|
+
: [
|
|
109
|
+
() => parseOrderedDate(value, DAY_MONTH_YEAR_PATTERN, "day-first"),
|
|
110
|
+
() => parseOrderedDate(value, MONTH_DAY_YEAR_PATTERN, "month-first"),
|
|
111
|
+
];
|
|
112
|
+
for (const parse of parsers) {
|
|
113
|
+
const parsedDate = parse();
|
|
114
|
+
if (parsedDate) {
|
|
115
|
+
return parsedDate;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
function parseDateValue(value, locale = getActiveDateLocale()) {
|
|
33
121
|
if (value instanceof Date) {
|
|
34
122
|
return isValidDate(value) ? new Date(value.getTime()) : null;
|
|
35
123
|
}
|
|
@@ -44,11 +132,11 @@ function parseDateValue(value) {
|
|
|
44
132
|
if (!trimmedValue) {
|
|
45
133
|
return null;
|
|
46
134
|
}
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
return
|
|
135
|
+
const localeDate = parseLocaleDateValue(trimmedValue, locale);
|
|
136
|
+
if (localeDate) {
|
|
137
|
+
return localeDate;
|
|
50
138
|
}
|
|
51
|
-
if (DAY_MONTH_YEAR_PATTERN.test(trimmedValue)) {
|
|
139
|
+
if (DAY_MONTH_YEAR_PATTERN.test(trimmedValue) || MONTH_DAY_YEAR_PATTERN.test(trimmedValue)) {
|
|
52
140
|
return null;
|
|
53
141
|
}
|
|
54
142
|
const parsedDate = new Date(trimmedValue);
|
|
@@ -58,21 +146,7 @@ function isDateValue(value) {
|
|
|
58
146
|
return parseDateValue(value) !== null;
|
|
59
147
|
}
|
|
60
148
|
function parseBrazilianDate(value) {
|
|
61
|
-
|
|
62
|
-
if (!match) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
const [, dayValue, monthValue, yearValue] = match;
|
|
66
|
-
const day = Number(dayValue);
|
|
67
|
-
const month = Number(monthValue);
|
|
68
|
-
const year = Number(yearValue);
|
|
69
|
-
const parsedDate = new Date(year, month - 1, day);
|
|
70
|
-
if (parsedDate.getFullYear() !== year ||
|
|
71
|
-
parsedDate.getMonth() !== month - 1 ||
|
|
72
|
-
parsedDate.getDate() !== day) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
return parsedDate;
|
|
149
|
+
return parseOrderedDate(value, DAY_MONTH_YEAR_PATTERN, "day-first");
|
|
76
150
|
}
|
|
77
151
|
function normalizeDateInput(value) {
|
|
78
152
|
return parseDateValue(value);
|
|
@@ -91,7 +165,7 @@ function formatLocaleDate(value, dateStyle = "short") {
|
|
|
91
165
|
if (!date) {
|
|
92
166
|
return "";
|
|
93
167
|
}
|
|
94
|
-
return new Intl.DateTimeFormat(getIntlLocale(
|
|
168
|
+
return new Intl.DateTimeFormat(getIntlLocale(getActiveDateLocale()), {
|
|
95
169
|
dateStyle,
|
|
96
170
|
}).format(date);
|
|
97
171
|
}
|
|
@@ -101,7 +175,7 @@ function formatLocaleDateTime(value, options = {}) {
|
|
|
101
175
|
return "";
|
|
102
176
|
}
|
|
103
177
|
const { dateStyle = "short", timeStyle = "short" } = options;
|
|
104
|
-
return new Intl.DateTimeFormat(getIntlLocale(
|
|
178
|
+
return new Intl.DateTimeFormat(getIntlLocale(getActiveDateLocale()), {
|
|
105
179
|
dateStyle,
|
|
106
180
|
timeStyle,
|
|
107
181
|
}).format(date);
|
|
@@ -195,27 +269,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
195
269
|
args: [MAPA_UI_TEXTS]
|
|
196
270
|
}] }] });
|
|
197
271
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
272
|
+
function getMapaDatepickerRangeFormats() {
|
|
273
|
+
const dateInput = getActiveMaterialDateFormat();
|
|
274
|
+
return {
|
|
275
|
+
parse: {
|
|
276
|
+
dateInput,
|
|
277
|
+
},
|
|
278
|
+
display: {
|
|
279
|
+
dateInput,
|
|
280
|
+
monthYearLabel: "MMM YYYY",
|
|
281
|
+
dateA11yLabel: "LL",
|
|
282
|
+
monthYearA11yLabel: "MMMM YYYY",
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
}
|
|
209
286
|
class MapaDatepickerRange {
|
|
210
287
|
constructor(i18n, cdr) {
|
|
211
288
|
this.i18n = i18n;
|
|
212
289
|
this.cdr = cdr;
|
|
213
290
|
this.destroyRef = inject(DestroyRef);
|
|
214
|
-
this.
|
|
291
|
+
this.dateAdapter = inject((DateAdapter));
|
|
215
292
|
this.emptyValue = {
|
|
216
293
|
startDate: null,
|
|
217
294
|
endDate: null,
|
|
218
295
|
};
|
|
296
|
+
this.currentLocale = null;
|
|
219
297
|
this.formDatepicker = new FormGroup({
|
|
220
298
|
startDate: new FormControl(null),
|
|
221
299
|
endDate: new FormControl(null),
|
|
@@ -228,7 +306,14 @@ class MapaDatepickerRange {
|
|
|
228
306
|
get texts() {
|
|
229
307
|
return this.i18n.textsSignal();
|
|
230
308
|
}
|
|
309
|
+
get dateInputMask() {
|
|
310
|
+
return getDateInputMask(this.getLocale());
|
|
311
|
+
}
|
|
312
|
+
get activeDateFormat() {
|
|
313
|
+
return getActiveDateFormat(this.getLocale());
|
|
314
|
+
}
|
|
231
315
|
ngOnInit() {
|
|
316
|
+
this.syncLocaleSettings();
|
|
232
317
|
if (!this.element?.key) {
|
|
233
318
|
throw new Error("mapa-datepicker-range requires element.key to resolve the target control.");
|
|
234
319
|
}
|
|
@@ -253,6 +338,9 @@ class MapaDatepickerRange {
|
|
|
253
338
|
this.updateExternalFromDatepicker(value);
|
|
254
339
|
});
|
|
255
340
|
}
|
|
341
|
+
ngDoCheck() {
|
|
342
|
+
this.syncLocaleSettings();
|
|
343
|
+
}
|
|
256
344
|
get startDatePlaceholder() {
|
|
257
345
|
return this.texts.datepicker.startDatePlaceholder;
|
|
258
346
|
}
|
|
@@ -260,6 +348,7 @@ class MapaDatepickerRange {
|
|
|
260
348
|
return this.texts.datepicker.endDatePlaceholder;
|
|
261
349
|
}
|
|
262
350
|
syncFromExternal(value) {
|
|
351
|
+
this.syncLocaleSettings();
|
|
263
352
|
const nextValue = value ?? this.emptyValue;
|
|
264
353
|
const displayValue = {
|
|
265
354
|
startDate: nextValue.startDate,
|
|
@@ -282,6 +371,7 @@ class MapaDatepickerRange {
|
|
|
282
371
|
this.cdr.markForCheck();
|
|
283
372
|
}
|
|
284
373
|
updateExternalFromDisplay(value) {
|
|
374
|
+
this.syncLocaleSettings();
|
|
285
375
|
const nextValue = {
|
|
286
376
|
startDate: value.startDate ?? null,
|
|
287
377
|
endDate: value.endDate ?? null,
|
|
@@ -295,12 +385,13 @@ class MapaDatepickerRange {
|
|
|
295
385
|
this.cdr.markForCheck();
|
|
296
386
|
}
|
|
297
387
|
updateExternalFromDatepicker(value) {
|
|
388
|
+
this.syncLocaleSettings();
|
|
298
389
|
if (!value.startDate || !value.endDate) {
|
|
299
390
|
return;
|
|
300
391
|
}
|
|
301
392
|
const nextValue = {
|
|
302
|
-
startDate:
|
|
303
|
-
endDate:
|
|
393
|
+
startDate: formatDateForLocale(value.startDate, this.getLocale()),
|
|
394
|
+
endDate: formatDateForLocale(value.endDate, this.getLocale()),
|
|
304
395
|
};
|
|
305
396
|
this.patchExternalValue(nextValue);
|
|
306
397
|
this.formDisplay.patchValue(nextValue, { emitEvent: false });
|
|
@@ -333,11 +424,35 @@ class MapaDatepickerRange {
|
|
|
333
424
|
this.patchExternalValue(defaultRange);
|
|
334
425
|
this.cdr.markForCheck();
|
|
335
426
|
}
|
|
427
|
+
getLocale() {
|
|
428
|
+
return this.currentLocale ?? getActiveDateLocale();
|
|
429
|
+
}
|
|
430
|
+
syncLocaleSettings() {
|
|
431
|
+
const nextLocale = getActiveDateLocale();
|
|
432
|
+
if (this.currentLocale === nextLocale) {
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
this.currentLocale = nextLocale;
|
|
436
|
+
this.dateAdapter.setLocale(nextLocale);
|
|
437
|
+
const datepickerValue = this.formDatepicker.getRawValue();
|
|
438
|
+
const hasDateRange = !!datepickerValue.startDate && !!datepickerValue.endDate;
|
|
439
|
+
if (hasDateRange) {
|
|
440
|
+
const formattedRange = {
|
|
441
|
+
startDate: formatDateForLocale(datepickerValue.startDate, nextLocale),
|
|
442
|
+
endDate: formatDateForLocale(datepickerValue.endDate, nextLocale),
|
|
443
|
+
};
|
|
444
|
+
this.formDisplay.patchValue(formattedRange, { emitEvent: false });
|
|
445
|
+
if (this.rangeControl) {
|
|
446
|
+
this.patchExternalValue(formattedRange);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
this.cdr.markForCheck();
|
|
450
|
+
}
|
|
336
451
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: MapaDatepickerRange, deps: [{ token: MapaI18nService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
337
452
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: MapaDatepickerRange, isStandalone: true, selector: "mapa-datepicker-range", inputs: { formGroup: "formGroup", element: "element" }, providers: [
|
|
338
453
|
provideNgxMask(),
|
|
339
|
-
provideNativeDateAdapter(
|
|
340
|
-
], ngImport: i0, template: "@if (element.label) {\n <div class=\"mapa-datepicker-range__label\">\n {{ element.label }}\n </div>\n}\n<section class=\"mapa-datepicker-range\" [formGroup]=\"formDisplay\">\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"mapa-datepicker-range__start-date\"\n >\n <input\n matInput\n formControlName=\"startDate\"\n [placeholder]=\"startDatePlaceholder\"\n mask=\"
|
|
454
|
+
provideNativeDateAdapter(getMapaDatepickerRangeFormats()),
|
|
455
|
+
], ngImport: i0, template: "@if (element.label) {\n <div class=\"mapa-datepicker-range__label\">\n {{ element.label }}\n </div>\n}\n<section class=\"mapa-datepicker-range\" [formGroup]=\"formDisplay\">\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"mapa-datepicker-range__start-date\"\n >\n <input\n matInput\n formControlName=\"startDate\"\n [placeholder]=\"startDatePlaceholder\"\n [mask]=\"dateInputMask\"\n [attr.data-date-format]=\"activeDateFormat\"\n />\n </mat-form-field>\n <div class=\"mapa-datepicker-range__divider\">–</div>\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"mapa-datepicker-range__end-date\"\n >\n <input\n matInput\n formControlName=\"endDate\"\n [placeholder]=\"endDatePlaceholder\"\n [mask]=\"dateInputMask\"\n [attr.data-date-format]=\"activeDateFormat\"\n />\n <mat-icon matSuffix (click)=\"cleanDatepicker()\">close</mat-icon>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker touchUi=\"true\" #picker></mat-date-range-picker>\n </mat-form-field>\n</section>\n<section class=\"mapa--hidden\">\n <mat-form-field [formGroup]=\"formDatepicker\">\n <mat-date-range-input [rangePicker]=\"picker\">\n <input matStartDate formControlName=\"startDate\" />\n <input matEndDate formControlName=\"endDate\" />\n </mat-date-range-input>\n </mat-form-field>\n</section>\n", styles: [":host ::ng-deep .mat-mdc-form-field-type-mat-date-range-input .mdc-text-field--outlined{background-color:#fff}:host ::ng-deep .mat-mdc-form-field-type-mat-date-range-input .mat-mdc-text-field-wrapper{min-height:48px!important;height:48px!important}:host ::ng-deep .mat-mdc-form-field-type-mat-date-range-input .mat-mdc-text-field-wrapper.mdc-text-field--outlined{padding-left:unset!important;padding-right:unset!important}:host ::ng-deep .mapa-datepicker-range{display:flex;align-items:center;justify-content:flex-start;background-color:#fff;border:2px solid #a7aaad;border-radius:8px;padding:0 .75em;min-height:48px;height:48px;width:310px}:host ::ng-deep .mapa-datepicker-range__label{font-family:var(--mapa-font-heading, \"Asap\", \"Inter\", sans-serif);display:block;font-size:12px;font-style:normal;font-weight:600;line-height:16px;text-transform:uppercase;margin-bottom:16px}:host ::ng-deep .mapa-datepicker-range__start-date{width:100px!important;display:flex;align-items:center;align-self:stretch}:host ::ng-deep .mapa-datepicker-range__start-date .mat-mdc-input-element,:host ::ng-deep .mapa-datepicker-range__start-date .mat-mdc-text-field-wrapper{width:100px!important}:host ::ng-deep .mapa-datepicker-range__end-date{width:100px!important;min-width:100px!important;display:flex;align-items:center;align-self:stretch}:host ::ng-deep .mapa-datepicker-range__end-date .mat-mdc-input-element,:host ::ng-deep .mapa-datepicker-range__end-date .mat-mdc-text-field-wrapper{width:100px!important;min-width:100px!important}:host ::ng-deep .mapa-datepicker-range__divider{margin:0 8px}:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-icon-suffix{display:flex;align-items:center;gap:4px;margin-left:96px;padding:unset!important}:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-icon-suffix .mat-icon,:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-icon-suffix .mat-datepicker-toggle{margin:0}:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-flex{display:flex;align-items:center;min-height:100%}:host ::ng-deep .mapa-datepicker-range .mat-mdc-text-field-wrapper{padding:0!important;align-items:center!important;display:flex;background:#fff;min-height:100%}:host ::ng-deep .mapa-datepicker-range .mdc-notched-outline{display:none}:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-infix{padding:0!important;min-height:unset!important;border-top:unset!important;display:flex;align-items:center;height:100%}:host ::ng-deep .mapa-datepicker-range .mat-mdc-input-element{align-self:center;height:100%;line-height:24px;margin:0!important;padding:0 8px 0 0!important;text-align:center;vertical-align:middle}:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-error-wrapper,:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-hint-wrapper,:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-subscript-wrapper{padding:0!important}:host ::ng-deep .mapa--hidden{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions", "instantPrefix"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i3.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i3.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i3.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i3.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
341
456
|
}
|
|
342
457
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: MapaDatepickerRange, decorators: [{
|
|
343
458
|
type: Component,
|
|
@@ -351,8 +466,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
351
466
|
MatInputModule,
|
|
352
467
|
], providers: [
|
|
353
468
|
provideNgxMask(),
|
|
354
|
-
provideNativeDateAdapter(
|
|
355
|
-
], standalone: true, template: "@if (element.label) {\n <div class=\"mapa-datepicker-range__label\">\n {{ element.label }}\n </div>\n}\n<section class=\"mapa-datepicker-range\" [formGroup]=\"formDisplay\">\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"mapa-datepicker-range__start-date\"\n >\n <input\n matInput\n formControlName=\"startDate\"\n [placeholder]=\"startDatePlaceholder\"\n mask=\"
|
|
469
|
+
provideNativeDateAdapter(getMapaDatepickerRangeFormats()),
|
|
470
|
+
], standalone: true, template: "@if (element.label) {\n <div class=\"mapa-datepicker-range__label\">\n {{ element.label }}\n </div>\n}\n<section class=\"mapa-datepicker-range\" [formGroup]=\"formDisplay\">\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"mapa-datepicker-range__start-date\"\n >\n <input\n matInput\n formControlName=\"startDate\"\n [placeholder]=\"startDatePlaceholder\"\n [mask]=\"dateInputMask\"\n [attr.data-date-format]=\"activeDateFormat\"\n />\n </mat-form-field>\n <div class=\"mapa-datepicker-range__divider\">–</div>\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"mapa-datepicker-range__end-date\"\n >\n <input\n matInput\n formControlName=\"endDate\"\n [placeholder]=\"endDatePlaceholder\"\n [mask]=\"dateInputMask\"\n [attr.data-date-format]=\"activeDateFormat\"\n />\n <mat-icon matSuffix (click)=\"cleanDatepicker()\">close</mat-icon>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker touchUi=\"true\" #picker></mat-date-range-picker>\n </mat-form-field>\n</section>\n<section class=\"mapa--hidden\">\n <mat-form-field [formGroup]=\"formDatepicker\">\n <mat-date-range-input [rangePicker]=\"picker\">\n <input matStartDate formControlName=\"startDate\" />\n <input matEndDate formControlName=\"endDate\" />\n </mat-date-range-input>\n </mat-form-field>\n</section>\n", styles: [":host ::ng-deep .mat-mdc-form-field-type-mat-date-range-input .mdc-text-field--outlined{background-color:#fff}:host ::ng-deep .mat-mdc-form-field-type-mat-date-range-input .mat-mdc-text-field-wrapper{min-height:48px!important;height:48px!important}:host ::ng-deep .mat-mdc-form-field-type-mat-date-range-input .mat-mdc-text-field-wrapper.mdc-text-field--outlined{padding-left:unset!important;padding-right:unset!important}:host ::ng-deep .mapa-datepicker-range{display:flex;align-items:center;justify-content:flex-start;background-color:#fff;border:2px solid #a7aaad;border-radius:8px;padding:0 .75em;min-height:48px;height:48px;width:310px}:host ::ng-deep .mapa-datepicker-range__label{font-family:var(--mapa-font-heading, \"Asap\", \"Inter\", sans-serif);display:block;font-size:12px;font-style:normal;font-weight:600;line-height:16px;text-transform:uppercase;margin-bottom:16px}:host ::ng-deep .mapa-datepicker-range__start-date{width:100px!important;display:flex;align-items:center;align-self:stretch}:host ::ng-deep .mapa-datepicker-range__start-date .mat-mdc-input-element,:host ::ng-deep .mapa-datepicker-range__start-date .mat-mdc-text-field-wrapper{width:100px!important}:host ::ng-deep .mapa-datepicker-range__end-date{width:100px!important;min-width:100px!important;display:flex;align-items:center;align-self:stretch}:host ::ng-deep .mapa-datepicker-range__end-date .mat-mdc-input-element,:host ::ng-deep .mapa-datepicker-range__end-date .mat-mdc-text-field-wrapper{width:100px!important;min-width:100px!important}:host ::ng-deep .mapa-datepicker-range__divider{margin:0 8px}:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-icon-suffix{display:flex;align-items:center;gap:4px;margin-left:96px;padding:unset!important}:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-icon-suffix .mat-icon,:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-icon-suffix .mat-datepicker-toggle{margin:0}:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-flex{display:flex;align-items:center;min-height:100%}:host ::ng-deep .mapa-datepicker-range .mat-mdc-text-field-wrapper{padding:0!important;align-items:center!important;display:flex;background:#fff;min-height:100%}:host ::ng-deep .mapa-datepicker-range .mdc-notched-outline{display:none}:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-infix{padding:0!important;min-height:unset!important;border-top:unset!important;display:flex;align-items:center;height:100%}:host ::ng-deep .mapa-datepicker-range .mat-mdc-input-element{align-self:center;height:100%;line-height:24px;margin:0!important;padding:0 8px 0 0!important;text-align:center;vertical-align:middle}:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-error-wrapper,:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-hint-wrapper,:host ::ng-deep .mapa-datepicker-range .mat-mdc-form-field-subscript-wrapper{padding:0!important}:host ::ng-deep .mapa--hidden{display:none}\n"] }]
|
|
356
471
|
}], ctorParameters: () => [{ type: MapaI18nService }, { type: i0.ChangeDetectorRef }], propDecorators: { formGroup: [{
|
|
357
472
|
type: Input
|
|
358
473
|
}], element: [{
|
|
@@ -371,5 +486,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
371
486
|
* Generated bundle index. Do not edit.
|
|
372
487
|
*/
|
|
373
488
|
|
|
374
|
-
export {
|
|
489
|
+
export { MapaDatepickerRange, getMapaDatepickerRangeFormats };
|
|
375
490
|
//# sourceMappingURL=mapa-library-ui-src-lib-components-datepicker-range.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapa-library-ui-src-lib-components-datepicker-range.mjs","sources":["../../../projects/mapa-library-ui/src/lib/core/utils/date.util.ts","../../../projects/mapa-library-ui/src/lib/core/i18n/mapa-ui-texts.ts","../../../projects/mapa-library-ui/src/lib/core/services/mapa-i18n.service.ts","../../../projects/mapa-library-ui/src/lib/components/datepicker-range/src/datepicker-range.component.ts","../../../projects/mapa-library-ui/src/lib/components/datepicker-range/src/datepicker-range.component.html","../../../projects/mapa-library-ui/src/lib/components/datepicker-range/public-api.ts","../../../projects/mapa-library-ui/src/datepicker-range.ts","../../../projects/mapa-library-ui/src/mapa-library-ui-src-lib-components-datepicker-range.ts"],"sourcesContent":["import { getIntlLocale, getStoredAppLanguage } from \"mapa-frontend-i18n\";\n\nconst DAY_MONTH_YEAR_PATTERN = /^(\\d{2})\\/(\\d{2})\\/(\\d{4})$/;\n\nexport type DateInput = Date | string | number | null | undefined;\n\nfunction isValidDate(date: Date): boolean {\n return !Number.isNaN(date.getTime());\n}\n\nfunction buildUtcDate(\n date: Date,\n dayOffset: number,\n hours: number,\n minutes: number,\n seconds: number,\n milliseconds: number,\n): Date {\n return new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate() + dayOffset,\n hours,\n minutes,\n seconds,\n milliseconds,\n ),\n );\n}\n\nexport function formatDateAsDayMonthYear(date: Date): string {\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const year = `${date.getFullYear()}`;\n\n return `${day}/${month}/${year}`;\n}\n\nexport function parseDateValue(value: unknown): Date | null {\n if (value instanceof Date) {\n return isValidDate(value) ? new Date(value.getTime()) : null;\n }\n\n if (typeof value === \"number\") {\n const parsedDate = new Date(value);\n return isValidDate(parsedDate) ? parsedDate : null;\n }\n\n if (typeof value !== \"string\") {\n return null;\n }\n\n const trimmedValue = value.trim();\n if (!trimmedValue) {\n return null;\n }\n\n const brazilianDate = parseBrazilianDate(trimmedValue);\n if (brazilianDate) {\n return brazilianDate;\n }\n\n if (DAY_MONTH_YEAR_PATTERN.test(trimmedValue)) {\n return null;\n }\n\n const parsedDate = new Date(trimmedValue);\n return isValidDate(parsedDate) ? parsedDate : null;\n}\n\nexport function isDateValue(value: unknown): boolean {\n return parseDateValue(value) !== null;\n}\n\nexport function parseBrazilianDate(value: string): Date | null {\n const match = DAY_MONTH_YEAR_PATTERN.exec(value.trim());\n if (!match) {\n return null;\n }\n\n const [, dayValue, monthValue, yearValue] = match;\n const day = Number(dayValue);\n const month = Number(monthValue);\n const year = Number(yearValue);\n const parsedDate = new Date(year, month - 1, day);\n\n if (\n parsedDate.getFullYear() !== year ||\n parsedDate.getMonth() !== month - 1 ||\n parsedDate.getDate() !== day\n ) {\n return null;\n }\n\n return parsedDate;\n}\n\nexport function normalizeDateInput(value: DateInput): Date | null {\n return parseDateValue(value);\n}\n\nexport function formatBrazilianDate(value: DateInput): string {\n const date = normalizeDateInput(value);\n return date ? formatDateAsDayMonthYear(date) : \"\";\n}\n\nexport function addDays(date: Date, days: number): Date {\n const nextDate = new Date(date);\n nextDate.setDate(nextDate.getDate() + days);\n return nextDate;\n}\n\nexport type LocaleDateStyle = \"short\" | \"medium\" | \"long\" | \"full\";\n\nexport function formatLocaleDate(\n value: DateInput,\n dateStyle: LocaleDateStyle = \"short\",\n): string {\n const date = normalizeDateInput(value);\n if (!date) {\n return \"\";\n }\n\n return new Intl.DateTimeFormat(getIntlLocale(getStoredAppLanguage()), {\n dateStyle,\n }).format(date);\n}\n\nexport function formatLocaleDateTime(\n value: DateInput,\n options: { dateStyle?: LocaleDateStyle; timeStyle?: LocaleDateStyle } = {},\n): string {\n const date = normalizeDateInput(value);\n if (!date) {\n return \"\";\n }\n\n const { dateStyle = \"short\", timeStyle = \"short\" } = options;\n\n return new Intl.DateTimeFormat(getIntlLocale(getStoredAppLanguage()), {\n dateStyle,\n timeStyle,\n }).format(date);\n}\n\nexport function getDefaultDateRange(days = 60): {\n startDate: string;\n endDate: string;\n} {\n const today = new Date();\n\n return {\n startDate: formatBrazilianDate(addDays(today, -days)),\n endDate: formatBrazilianDate(today),\n };\n}\n\nexport function getRelativeDateRange(daysBack: number): {\n startDate: Date;\n endDate: Date;\n} {\n const endDate = new Date();\n endDate.setHours(23, 59, 59, 999);\n\n const startDate = new Date();\n startDate.setHours(0, 0, 0, 0);\n startDate.setDate(startDate.getDate() - daysBack);\n\n return { startDate, endDate };\n}\n\nexport function toUtcRangeStartIso(value: DateInput): string | undefined {\n const date = normalizeDateInput(value);\n return date ? buildUtcDate(date, 0, 3, 0, 0, 0).toISOString() : undefined;\n}\n\nexport function toUtcRangeEndIso(value: DateInput): string | undefined {\n const date = normalizeDateInput(value);\n return date ? buildUtcDate(date, 1, 2, 59, 59, 999).toISOString() : undefined;\n}\n\nexport function toUtcDayExclusiveEndIso(value: DateInput): string | undefined {\n const date = normalizeDateInput(value);\n return date ? buildUtcDate(date, 1, 3, 0, 0, 0).toISOString() : undefined;\n}\n","import { InjectionToken, Provider } from \"@angular/core\";\nimport {\n MapaUiTextGroups,\n PartialMapaUiTexts,\n ValidationContext,\n ValidationTextResolver,\n getMapaUiTexts,\n} from \"mapa-frontend-i18n\";\n\nexport type MapaUiTexts = MapaUiTextGroups;\nexport type ValidationMessageContext = ValidationContext;\nexport type { PartialMapaUiTexts, ValidationTextResolver };\n\nexport const MAPA_UI_TEXTS = new InjectionToken<PartialMapaUiTexts>(\n \"MAPA_UI_TEXTS\"\n);\n\nfunction getDefaultTexts(): MapaUiTexts {\n return getMapaUiTexts(\"pt-BR\") as MapaUiTexts;\n}\n\nexport function mergeMapaUiTexts(\n customTexts?: PartialMapaUiTexts | null\n): MapaUiTexts {\n const defaults = getDefaultTexts();\n\n return {\n common: { ...defaults.common, ...(customTexts?.common ?? {}) },\n filters: { ...defaults.filters, ...(customTexts?.filters ?? {}) },\n datepicker: { ...defaults.datepicker, ...(customTexts?.datepicker ?? {}) },\n capability: { ...defaults.capability, ...(customTexts?.capability ?? {}) },\n paginator: { ...defaults.paginator, ...(customTexts?.paginator ?? {}) },\n warning: { ...defaults.warning, ...(customTexts?.warning ?? {}) },\n table: { ...defaults.table, ...(customTexts?.table ?? {}) },\n validation: { ...defaults.validation, ...(customTexts?.validation ?? {}) },\n };\n}\n\nexport function provideMapaUiTexts(texts: PartialMapaUiTexts): Provider {\n return {\n provide: MAPA_UI_TEXTS,\n useValue: texts,\n };\n}\n","import { Inject, Injectable, Injector, Optional, inject, signal } from \"@angular/core\";\nimport { toObservable } from \"@angular/core/rxjs-interop\";\nimport {\n MAPA_UI_TEXTS,\n MapaUiTexts,\n PartialMapaUiTexts,\n ValidationMessageContext,\n ValidationTextResolver,\n mergeMapaUiTexts,\n} from \"../i18n/mapa-ui-texts\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class MapaI18nService {\n private readonly injector = inject(Injector);\n private readonly textsState = signal<MapaUiTexts>(mergeMapaUiTexts());\n\n readonly textsSignal = this.textsState.asReadonly();\n readonly texts$ = toObservable(this.textsSignal, { injector: this.injector });\n\n constructor(\n @Optional() @Inject(MAPA_UI_TEXTS) customTexts: PartialMapaUiTexts | null\n ) {\n if (customTexts) {\n this.textsState.set(mergeMapaUiTexts(customTexts));\n }\n }\n\n get texts(): MapaUiTexts {\n return this.textsState();\n }\n\n setTexts(texts: PartialMapaUiTexts): void {\n this.textsState.set(mergeMapaUiTexts(texts));\n }\n\n resolveValidationText(\n key: keyof MapaUiTexts[\"validation\"],\n context?: ValidationMessageContext\n ): string {\n return this.resolveText(this.texts.validation[key], context);\n }\n\n private resolveText(\n value: ValidationTextResolver,\n context?: ValidationMessageContext\n ): string {\n return typeof value === \"function\" ? value(context) : value;\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n Input,\n OnInit,\n inject,\n} from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport {\n FormControl,\n FormGroup,\n ReactiveFormsModule,\n} from \"@angular/forms\";\nimport { provideNativeDateAdapter } from \"@angular/material/core\";\nimport { MatDatepickerModule } from \"@angular/material/datepicker\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { MatIconModule } from \"@angular/material/icon\";\nimport { MatInputModule } from \"@angular/material/input\";\nimport { NgxMaskDirective, provideNgxMask } from \"ngx-mask\";\nimport { MapaI18nService } from \"../../../core/services/mapa-i18n.service\";\nimport {\n formatDateAsDayMonthYear,\n getRelativeDateRange,\n parseDateValue,\n} from \"../../../core/utils/date.util\";\nimport { DatepickerRange } from \"../../../core/elements/datepicker-range\";\n\nexport interface MapaDatepickerRangeControlValue {\n startDate: string | null;\n endDate: string | null;\n}\n\nexport type MapaDatepickerRangeFormGroup = FormGroup;\n\ntype MapaDatepickerInternalRangeValue = {\n startDate: Date | null;\n endDate: Date | null;\n};\n\ntype MapaDatepickerInternalRangeFormGroup = FormGroup<{\n startDate: FormControl<MapaDatepickerInternalRangeValue[\"startDate\"]>;\n endDate: FormControl<MapaDatepickerInternalRangeValue[\"endDate\"]>;\n}>;\n\ntype MapaDatepickerRangeDisplayFormGroup = FormGroup<{\n startDate: FormControl<string | null>;\n endDate: FormControl<string | null>;\n}>;\n\nexport const MAPA_DATEPICKER_RANGE_FORMATS = {\n parse: {\n dateInput: \"DD/MM/YYYY\",\n },\n display: {\n dateInput: \"DD/MM/YYYY\",\n monthYearLabel: \"MMM YYYY\",\n dateA11yLabel: \"LL\",\n monthYearA11yLabel: \"MMMM YYYY\",\n },\n};\n\n@Component({\n selector: \"mapa-datepicker-range\",\n templateUrl: \"./datepicker-range.component.html\",\n styleUrl: \"./datepicker-range.component.scss\",\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n ReactiveFormsModule,\n NgxMaskDirective,\n MatDatepickerModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n ],\n providers: [\n provideNgxMask(),\n provideNativeDateAdapter(MAPA_DATEPICKER_RANGE_FORMATS),\n ],\n standalone: true,\n})\nexport class MapaDatepickerRange implements OnInit {\n @Input() formGroup!: FormGroup;\n @Input() element!: DatepickerRange;\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly defaultDaysBack = 60;\n private readonly emptyValue: MapaDatepickerRangeControlValue = {\n startDate: null,\n endDate: null,\n };\n\n readonly formDatepicker: MapaDatepickerInternalRangeFormGroup = new FormGroup({\n startDate: new FormControl<Date | null>(null),\n endDate: new FormControl<Date | null>(null),\n });\n\n readonly formDisplay: MapaDatepickerRangeDisplayFormGroup = new FormGroup({\n startDate: new FormControl<string | null>(null),\n endDate: new FormControl<string | null>(null),\n });\n\n rangeControl!: FormControl<MapaDatepickerRangeControlValue | null>;\n\n constructor(\n private readonly i18n: MapaI18nService,\n private readonly cdr: ChangeDetectorRef\n ) {}\n\n get texts() {\n return this.i18n.textsSignal();\n }\n\n ngOnInit(): void {\n if (!this.element?.key) {\n throw new Error(\"mapa-datepicker-range requires element.key to resolve the target control.\");\n }\n\n this.rangeControl = this.formGroup.get(this.element.key) as FormControl<\n MapaDatepickerRangeControlValue | null\n >;\n\n if (!this.rangeControl) {\n throw new Error(\n `mapa-datepicker-range could not find control '${this.element.key}' in formGroup.`\n );\n }\n\n this.syncFromExternal(this.rangeControl.value);\n\n this.rangeControl.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((value) => {\n this.syncFromExternal(value);\n });\n\n this.formDisplay.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((value) => {\n this.updateExternalFromDisplay(value);\n });\n\n this.formDatepicker.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((value) => {\n this.updateExternalFromDatepicker(value);\n });\n }\n\n get startDatePlaceholder(): string {\n return this.texts.datepicker.startDatePlaceholder;\n }\n\n get endDatePlaceholder(): string {\n return this.texts.datepicker.endDatePlaceholder;\n }\n\n private syncFromExternal(value: MapaDatepickerRangeControlValue | null): void {\n const nextValue = value ?? this.emptyValue;\n const displayValue: MapaDatepickerRangeControlValue = {\n startDate: nextValue.startDate,\n endDate: nextValue.endDate,\n };\n const datepickerValue: MapaDatepickerInternalRangeValue = {\n startDate: parseDateValue(nextValue.startDate),\n endDate: parseDateValue(nextValue.endDate),\n };\n\n const currentDisplay = this.formDisplay.getRawValue();\n if (\n currentDisplay.startDate !== displayValue.startDate ||\n currentDisplay.endDate !== displayValue.endDate\n ) {\n this.formDisplay.patchValue(displayValue, { emitEvent: false });\n }\n\n const currentDatepicker = this.formDatepicker.getRawValue();\n if (\n !this.areDatesEqual(currentDatepicker.startDate, datepickerValue.startDate) ||\n !this.areDatesEqual(currentDatepicker.endDate, datepickerValue.endDate)\n ) {\n this.formDatepicker.patchValue(datepickerValue, { emitEvent: false });\n }\n\n this.cdr.markForCheck();\n }\n\n private updateExternalFromDisplay(\n value: Partial<MapaDatepickerRangeControlValue>\n ): void {\n const nextValue: MapaDatepickerRangeControlValue = {\n startDate: value.startDate ?? null,\n endDate: value.endDate ?? null,\n };\n\n this.patchExternalValue(nextValue);\n\n const nextDatepickerValue: MapaDatepickerInternalRangeValue = {\n startDate: parseDateValue(nextValue.startDate),\n endDate: parseDateValue(nextValue.endDate),\n };\n this.formDatepicker.patchValue(nextDatepickerValue, { emitEvent: false });\n this.cdr.markForCheck();\n }\n\n private updateExternalFromDatepicker(\n value: Partial<MapaDatepickerInternalRangeValue>\n ): void {\n if (!value.startDate || !value.endDate) {\n return;\n }\n\n const nextValue: MapaDatepickerRangeControlValue = {\n startDate: formatDateAsDayMonthYear(value.startDate),\n endDate: formatDateAsDayMonthYear(value.endDate),\n };\n\n this.patchExternalValue(nextValue);\n this.formDisplay.patchValue(nextValue, { emitEvent: false });\n this.cdr.markForCheck();\n }\n\n private patchExternalValue(nextValue: MapaDatepickerRangeControlValue): void {\n const currentValue = this.rangeControl.value;\n\n if (\n currentValue?.startDate === nextValue.startDate &&\n currentValue?.endDate === nextValue.endDate\n ) {\n return;\n }\n\n this.rangeControl.patchValue(nextValue);\n }\n\n private areDatesEqual(first: Date | null, second: Date | null): boolean {\n if (first === second) {\n return true;\n }\n\n if (!first || !second) {\n return false;\n }\n\n return first.getTime() === second.getTime();\n }\n\n cleanDatepicker() {\n const defaultRange = {\n startDate: null,\n endDate: null,\n };\n\n this.formDatepicker.patchValue(defaultRange, { emitEvent: false });\n this.formDisplay.patchValue(defaultRange, { emitEvent: false });\n this.patchExternalValue(defaultRange);\n this.cdr.markForCheck();\n }\n}\n\nexport type MapaDatepickerRangeComponent = MapaDatepickerRange;\n","@if (element.label) {\n <div class=\"mapa-datepicker-range__label\">\n {{ element.label }}\n </div>\n}\n<section class=\"mapa-datepicker-range\" [formGroup]=\"formDisplay\">\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"mapa-datepicker-range__start-date\"\n >\n <input\n matInput\n formControlName=\"startDate\"\n [placeholder]=\"startDatePlaceholder\"\n mask=\"00/00/0000\"\n />\n </mat-form-field>\n <div class=\"mapa-datepicker-range__divider\">–</div>\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"mapa-datepicker-range__end-date\"\n >\n <input\n matInput\n formControlName=\"endDate\"\n [placeholder]=\"endDatePlaceholder\"\n mask=\"00/00/0000\"\n />\n <mat-icon matSuffix (click)=\"cleanDatepicker()\">close</mat-icon>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker touchUi=\"true\" #picker></mat-date-range-picker>\n </mat-form-field>\n</section>\n<section class=\"mapa--hidden\">\n <mat-form-field [formGroup]=\"formDatepicker\">\n <mat-date-range-input [rangePicker]=\"picker\">\n <input matStartDate formControlName=\"startDate\" />\n <input matEndDate formControlName=\"endDate\" />\n </mat-date-range-input>\n </mat-form-field>\n</section>\n","/*\n * Public API Surface of mapa-library-ui datepicker-range\n */\n\nexport * from './src/datepicker-range.component';","/*\n * Public API Surface of mapa-library-ui datepicker-range\n */\n\nexport * from './lib/components/datepicker-range/public-api';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './datepicker-range';\n"],"names":["i1.MapaI18nService"],"mappings":";;;;;;;;;;;;;;;;;;AAEA,MAAM,sBAAsB,GAAG,6BAA6B;AAI5D,SAAS,WAAW,CAAC,IAAU,EAAA;IAC7B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;AACtC;AAEA,SAAS,YAAY,CACnB,IAAU,EACV,SAAiB,EACjB,KAAa,EACb,OAAe,EACf,OAAe,EACf,YAAoB,EAAA;AAEpB,IAAA,OAAO,IAAI,IAAI,CACb,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,WAAW,EAAE,EAClB,IAAI,CAA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BACP,YAAY;wBACZ,mBAAmB;wBACnB,gBAAgB;wBAChB,mBAAmB;wBACnB,kBAAkB;wBAClB,aAAa;wBACb,cAAc;qBACf,EAAA,SAAA,EACU;AACT,wBAAA,cAAc,EAAE;wBAChB,wBAAwB,CAAC,6BAA6B,CAAC;AACxD,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,u3CAAA,EAAA,MAAA,EAAA,CAAA,w3FAAA,CAAA,EAAA;;sBAGf;;sBACA;;;AEtFH;;AAEG;;ACFH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mapa-library-ui-src-lib-components-datepicker-range.mjs","sources":["../../../projects/mapa-library-ui/src/lib/core/utils/date.util.ts","../../../projects/mapa-library-ui/src/lib/core/i18n/mapa-ui-texts.ts","../../../projects/mapa-library-ui/src/lib/core/services/mapa-i18n.service.ts","../../../projects/mapa-library-ui/src/lib/components/datepicker-range/src/datepicker-range.component.ts","../../../projects/mapa-library-ui/src/lib/components/datepicker-range/src/datepicker-range.component.html","../../../projects/mapa-library-ui/src/lib/components/datepicker-range/public-api.ts","../../../projects/mapa-library-ui/src/datepicker-range.ts","../../../projects/mapa-library-ui/src/mapa-library-ui-src-lib-components-datepicker-range.ts"],"sourcesContent":["import { getIntlLocale, getStoredAppLanguage } from \"mapa-frontend-i18n\";\n\nconst DAY_MONTH_YEAR_PATTERN = /^(\\d{2})\\/(\\d{2})\\/(\\d{4})$/;\nconst MONTH_DAY_YEAR_PATTERN = /^(\\d{2})\\/(\\d{2})\\/(\\d{4})$/;\nconst DOCS_LANGUAGE_STORAGE_KEY = \"mapa-library-ui-docs-language\";\n\nexport type MapaDateLocale = \"pt-BR\" | \"en\" | \"es\";\nexport type MapaDateFormat = \"DD/MM/YYYY\" | \"MM/DD/YYYY\";\n\nexport type DateInput = Date | string | number | null | undefined;\n\nfunction isValidDate(date: Date): boolean {\n return !Number.isNaN(date.getTime());\n}\n\nfunction buildUtcDate(\n date: Date,\n dayOffset: number,\n hours: number,\n minutes: number,\n seconds: number,\n milliseconds: number,\n): Date {\n return new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate() + dayOffset,\n hours,\n minutes,\n seconds,\n milliseconds,\n ),\n );\n}\n\nexport function formatDateAsDayMonthYear(date: Date): string {\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const year = `${date.getFullYear()}`;\n\n return `${day}/${month}/${year}`;\n}\n\nexport function formatDateAsMonthDayYear(date: Date): string {\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const year = `${date.getFullYear()}`;\n\n return `${month}/${day}/${year}`;\n}\n\nexport function normalizeDateLocale(value: unknown): MapaDateLocale {\n if (typeof value !== \"string\") {\n return \"pt-BR\";\n }\n\n const normalizedValue = value.trim().toLowerCase();\n\n if (normalizedValue.startsWith(\"en\")) {\n return \"en\";\n }\n\n if (normalizedValue.startsWith(\"es\")) {\n return \"es\";\n }\n\n return \"pt-BR\";\n}\n\nfunction getDocsStoredLanguage(): string | null {\n if (typeof window === \"undefined\") {\n return null;\n }\n\n try {\n return window.localStorage.getItem(DOCS_LANGUAGE_STORAGE_KEY);\n } catch {\n return null;\n }\n}\n\nexport function getActiveDateLocale(): MapaDateLocale {\n return normalizeDateLocale(getDocsStoredLanguage() ?? getStoredAppLanguage());\n}\n\nexport function isMonthFirstDateLocale(locale = getActiveDateLocale()): boolean {\n return normalizeDateLocale(locale) === \"en\";\n}\n\nexport function getActiveDateFormat(locale = getActiveDateLocale()): MapaDateFormat {\n return isMonthFirstDateLocale(locale) ? \"MM/DD/YYYY\" : \"DD/MM/YYYY\";\n}\n\nexport function getActiveMaterialDateFormat(locale = getActiveDateLocale()): string {\n return isMonthFirstDateLocale(locale) ? \"MM/dd/yyyy\" : \"dd/MM/yyyy\";\n}\n\nexport function getDateInputMask(_locale = getActiveDateLocale()): string {\n return \"00/00/0000\";\n}\n\nexport function formatDateForLocale(date: Date, locale = getActiveDateLocale()): string {\n return isMonthFirstDateLocale(locale)\n ? formatDateAsMonthDayYear(date)\n : formatDateAsDayMonthYear(date);\n}\n\nfunction parseOrderedDate(\n value: string,\n pattern: RegExp,\n order: \"day-first\" | \"month-first\"\n): Date | null {\n const match = pattern.exec(value.trim());\n if (!match) {\n return null;\n }\n\n const [, firstValue, secondValue, yearValue] = match;\n const year = Number(yearValue);\n const month = Number(order === \"month-first\" ? firstValue : secondValue);\n const day = Number(order === \"month-first\" ? secondValue : firstValue);\n const parsedDate = new Date(year, month - 1, day);\n\n if (\n parsedDate.getFullYear() !== year ||\n parsedDate.getMonth() !== month - 1 ||\n parsedDate.getDate() !== day\n ) {\n return null;\n }\n\n return parsedDate;\n}\n\nexport function parseLocaleDateValue(\n value: string,\n locale = getActiveDateLocale()\n): Date | null {\n const normalizedLocale = normalizeDateLocale(locale);\n const parsers =\n normalizedLocale === \"en\"\n ? [\n () => parseOrderedDate(value, MONTH_DAY_YEAR_PATTERN, \"month-first\"),\n () => parseOrderedDate(value, DAY_MONTH_YEAR_PATTERN, \"day-first\"),\n ]\n : [\n () => parseOrderedDate(value, DAY_MONTH_YEAR_PATTERN, \"day-first\"),\n () => parseOrderedDate(value, MONTH_DAY_YEAR_PATTERN, \"month-first\"),\n ];\n\n for (const parse of parsers) {\n const parsedDate = parse();\n if (parsedDate) {\n return parsedDate;\n }\n }\n\n return null;\n}\n\nexport function parseDateValue(\n value: unknown,\n locale = getActiveDateLocale()\n): Date | null {\n if (value instanceof Date) {\n return isValidDate(value) ? new Date(value.getTime()) : null;\n }\n\n if (typeof value === \"number\") {\n const parsedDate = new Date(value);\n return isValidDate(parsedDate) ? parsedDate : null;\n }\n\n if (typeof value !== \"string\") {\n return null;\n }\n\n const trimmedValue = value.trim();\n if (!trimmedValue) {\n return null;\n }\n\n const localeDate = parseLocaleDateValue(trimmedValue, locale);\n if (localeDate) {\n return localeDate;\n }\n\n if (DAY_MONTH_YEAR_PATTERN.test(trimmedValue) || MONTH_DAY_YEAR_PATTERN.test(trimmedValue)) {\n return null;\n }\n\n const parsedDate = new Date(trimmedValue);\n return isValidDate(parsedDate) ? parsedDate : null;\n}\n\nexport function isDateValue(value: unknown): boolean {\n return parseDateValue(value) !== null;\n}\n\nexport function parseBrazilianDate(value: string): Date | null {\n return parseOrderedDate(value, DAY_MONTH_YEAR_PATTERN, \"day-first\");\n}\n\nexport function normalizeDateInput(value: DateInput): Date | null {\n return parseDateValue(value);\n}\n\nexport function formatBrazilianDate(value: DateInput): string {\n const date = normalizeDateInput(value);\n return date ? formatDateAsDayMonthYear(date) : \"\";\n}\n\nexport function addDays(date: Date, days: number): Date {\n const nextDate = new Date(date);\n nextDate.setDate(nextDate.getDate() + days);\n return nextDate;\n}\n\nexport type LocaleDateStyle = \"short\" | \"medium\" | \"long\" | \"full\";\n\nexport function formatLocaleDate(\n value: DateInput,\n dateStyle: LocaleDateStyle = \"short\",\n): string {\n const date = normalizeDateInput(value);\n if (!date) {\n return \"\";\n }\n\n return new Intl.DateTimeFormat(getIntlLocale(getActiveDateLocale()), {\n dateStyle,\n }).format(date);\n}\n\nexport function formatLocaleDateTime(\n value: DateInput,\n options: { dateStyle?: LocaleDateStyle; timeStyle?: LocaleDateStyle } = {},\n): string {\n const date = normalizeDateInput(value);\n if (!date) {\n return \"\";\n }\n\n const { dateStyle = \"short\", timeStyle = \"short\" } = options;\n\n return new Intl.DateTimeFormat(getIntlLocale(getActiveDateLocale()), {\n dateStyle,\n timeStyle,\n }).format(date);\n}\n\nexport function getDefaultDateRange(days = 60): {\n startDate: string;\n endDate: string;\n} {\n const today = new Date();\n\n return {\n startDate: formatBrazilianDate(addDays(today, -days)),\n endDate: formatBrazilianDate(today),\n };\n}\n\nexport function getRelativeDateRange(daysBack: number): {\n startDate: Date;\n endDate: Date;\n} {\n const endDate = new Date();\n endDate.setHours(23, 59, 59, 999);\n\n const startDate = new Date();\n startDate.setHours(0, 0, 0, 0);\n startDate.setDate(startDate.getDate() - daysBack);\n\n return { startDate, endDate };\n}\n\nexport function toUtcRangeStartIso(value: DateInput): string | undefined {\n const date = normalizeDateInput(value);\n return date ? buildUtcDate(date, 0, 3, 0, 0, 0).toISOString() : undefined;\n}\n\nexport function toUtcRangeEndIso(value: DateInput): string | undefined {\n const date = normalizeDateInput(value);\n return date ? buildUtcDate(date, 1, 2, 59, 59, 999).toISOString() : undefined;\n}\n\nexport function toUtcDayExclusiveEndIso(value: DateInput): string | undefined {\n const date = normalizeDateInput(value);\n return date ? buildUtcDate(date, 1, 3, 0, 0, 0).toISOString() : undefined;\n}\n","import { InjectionToken, Provider } from \"@angular/core\";\nimport {\n MapaUiTextGroups,\n PartialMapaUiTexts,\n ValidationContext,\n ValidationTextResolver,\n getMapaUiTexts,\n} from \"mapa-frontend-i18n\";\n\nexport type MapaUiTexts = MapaUiTextGroups;\nexport type ValidationMessageContext = ValidationContext;\nexport type { PartialMapaUiTexts, ValidationTextResolver };\n\nexport const MAPA_UI_TEXTS = new InjectionToken<PartialMapaUiTexts>(\n \"MAPA_UI_TEXTS\"\n);\n\nfunction getDefaultTexts(): MapaUiTexts {\n return getMapaUiTexts(\"pt-BR\") as MapaUiTexts;\n}\n\nexport function mergeMapaUiTexts(\n customTexts?: PartialMapaUiTexts | null\n): MapaUiTexts {\n const defaults = getDefaultTexts();\n\n return {\n common: { ...defaults.common, ...(customTexts?.common ?? {}) },\n filters: { ...defaults.filters, ...(customTexts?.filters ?? {}) },\n datepicker: { ...defaults.datepicker, ...(customTexts?.datepicker ?? {}) },\n capability: { ...defaults.capability, ...(customTexts?.capability ?? {}) },\n paginator: { ...defaults.paginator, ...(customTexts?.paginator ?? {}) },\n warning: { ...defaults.warning, ...(customTexts?.warning ?? {}) },\n table: { ...defaults.table, ...(customTexts?.table ?? {}) },\n validation: { ...defaults.validation, ...(customTexts?.validation ?? {}) },\n };\n}\n\nexport function provideMapaUiTexts(texts: PartialMapaUiTexts): Provider {\n return {\n provide: MAPA_UI_TEXTS,\n useValue: texts,\n };\n}\n","import { Inject, Injectable, Injector, Optional, inject, signal } from \"@angular/core\";\nimport { toObservable } from \"@angular/core/rxjs-interop\";\nimport {\n MAPA_UI_TEXTS,\n MapaUiTexts,\n PartialMapaUiTexts,\n ValidationMessageContext,\n ValidationTextResolver,\n mergeMapaUiTexts,\n} from \"../i18n/mapa-ui-texts\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class MapaI18nService {\n private readonly injector = inject(Injector);\n private readonly textsState = signal<MapaUiTexts>(mergeMapaUiTexts());\n\n readonly textsSignal = this.textsState.asReadonly();\n readonly texts$ = toObservable(this.textsSignal, { injector: this.injector });\n\n constructor(\n @Optional() @Inject(MAPA_UI_TEXTS) customTexts: PartialMapaUiTexts | null\n ) {\n if (customTexts) {\n this.textsState.set(mergeMapaUiTexts(customTexts));\n }\n }\n\n get texts(): MapaUiTexts {\n return this.textsState();\n }\n\n setTexts(texts: PartialMapaUiTexts): void {\n this.textsState.set(mergeMapaUiTexts(texts));\n }\n\n resolveValidationText(\n key: keyof MapaUiTexts[\"validation\"],\n context?: ValidationMessageContext\n ): string {\n return this.resolveText(this.texts.validation[key], context);\n }\n\n private resolveText(\n value: ValidationTextResolver,\n context?: ValidationMessageContext\n ): string {\n return typeof value === \"function\" ? value(context) : value;\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n Input,\n DoCheck,\n OnInit,\n inject,\n} from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport {\n FormControl,\n FormGroup,\n ReactiveFormsModule,\n} from \"@angular/forms\";\nimport { DateAdapter, provideNativeDateAdapter } from \"@angular/material/core\";\nimport { MatDatepickerModule } from \"@angular/material/datepicker\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { MatIconModule } from \"@angular/material/icon\";\nimport { MatInputModule } from \"@angular/material/input\";\nimport { NgxMaskDirective, provideNgxMask } from \"ngx-mask\";\nimport { MapaI18nService } from \"../../../core/services/mapa-i18n.service\";\nimport {\n formatDateForLocale,\n getActiveDateFormat,\n getActiveDateLocale,\n getActiveMaterialDateFormat,\n getDateInputMask,\n MapaDateLocale,\n parseDateValue,\n} from \"../../../core/utils/date.util\";\nimport { DatepickerRange } from \"../../../core/elements/datepicker-range\";\n\nexport interface MapaDatepickerRangeControlValue {\n startDate: string | null;\n endDate: string | null;\n}\n\nexport type MapaDatepickerRangeFormGroup = FormGroup;\n\ntype MapaDatepickerInternalRangeValue = {\n startDate: Date | null;\n endDate: Date | null;\n};\n\ntype MapaDatepickerInternalRangeFormGroup = FormGroup<{\n startDate: FormControl<MapaDatepickerInternalRangeValue[\"startDate\"]>;\n endDate: FormControl<MapaDatepickerInternalRangeValue[\"endDate\"]>;\n}>;\n\ntype MapaDatepickerRangeDisplayFormGroup = FormGroup<{\n startDate: FormControl<string | null>;\n endDate: FormControl<string | null>;\n}>;\n\nexport function getMapaDatepickerRangeFormats() {\n const dateInput = getActiveMaterialDateFormat();\n\n return {\n parse: {\n dateInput,\n },\n display: {\n dateInput,\n monthYearLabel: \"MMM YYYY\",\n dateA11yLabel: \"LL\",\n monthYearA11yLabel: \"MMMM YYYY\",\n },\n };\n}\n\n@Component({\n selector: \"mapa-datepicker-range\",\n templateUrl: \"./datepicker-range.component.html\",\n styleUrl: \"./datepicker-range.component.scss\",\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n ReactiveFormsModule,\n NgxMaskDirective,\n MatDatepickerModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n ],\n providers: [\n provideNgxMask(),\n provideNativeDateAdapter(getMapaDatepickerRangeFormats()),\n ],\n standalone: true,\n})\nexport class MapaDatepickerRange implements OnInit, DoCheck {\n @Input() formGroup!: FormGroup;\n @Input() element!: DatepickerRange;\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly dateAdapter = inject(DateAdapter<Date>);\n private readonly emptyValue: MapaDatepickerRangeControlValue = {\n startDate: null,\n endDate: null,\n };\n private currentLocale: MapaDateLocale | null = null;\n\n readonly formDatepicker: MapaDatepickerInternalRangeFormGroup = new FormGroup({\n startDate: new FormControl<Date | null>(null),\n endDate: new FormControl<Date | null>(null),\n });\n\n readonly formDisplay: MapaDatepickerRangeDisplayFormGroup = new FormGroup({\n startDate: new FormControl<string | null>(null),\n endDate: new FormControl<string | null>(null),\n });\n\n rangeControl!: FormControl<MapaDatepickerRangeControlValue | null>;\n\n constructor(\n private readonly i18n: MapaI18nService,\n private readonly cdr: ChangeDetectorRef\n ) {}\n\n get texts() {\n return this.i18n.textsSignal();\n }\n\n get dateInputMask(): string {\n return getDateInputMask(this.getLocale());\n }\n\n get activeDateFormat(): string {\n return getActiveDateFormat(this.getLocale());\n }\n\n ngOnInit(): void {\n this.syncLocaleSettings();\n\n if (!this.element?.key) {\n throw new Error(\"mapa-datepicker-range requires element.key to resolve the target control.\");\n }\n\n this.rangeControl = this.formGroup.get(this.element.key) as FormControl<\n MapaDatepickerRangeControlValue | null\n >;\n\n if (!this.rangeControl) {\n throw new Error(\n `mapa-datepicker-range could not find control '${this.element.key}' in formGroup.`\n );\n }\n\n this.syncFromExternal(this.rangeControl.value);\n\n this.rangeControl.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((value) => {\n this.syncFromExternal(value);\n });\n\n this.formDisplay.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((value) => {\n this.updateExternalFromDisplay(value);\n });\n\n this.formDatepicker.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((value) => {\n this.updateExternalFromDatepicker(value);\n });\n }\n\n ngDoCheck(): void {\n this.syncLocaleSettings();\n }\n\n get startDatePlaceholder(): string {\n return this.texts.datepicker.startDatePlaceholder;\n }\n\n get endDatePlaceholder(): string {\n return this.texts.datepicker.endDatePlaceholder;\n }\n\n private syncFromExternal(value: MapaDatepickerRangeControlValue | null): void {\n this.syncLocaleSettings();\n\n const nextValue = value ?? this.emptyValue;\n const displayValue: MapaDatepickerRangeControlValue = {\n startDate: nextValue.startDate,\n endDate: nextValue.endDate,\n };\n const datepickerValue: MapaDatepickerInternalRangeValue = {\n startDate: parseDateValue(nextValue.startDate),\n endDate: parseDateValue(nextValue.endDate),\n };\n\n const currentDisplay = this.formDisplay.getRawValue();\n if (\n currentDisplay.startDate !== displayValue.startDate ||\n currentDisplay.endDate !== displayValue.endDate\n ) {\n this.formDisplay.patchValue(displayValue, { emitEvent: false });\n }\n\n const currentDatepicker = this.formDatepicker.getRawValue();\n if (\n !this.areDatesEqual(currentDatepicker.startDate, datepickerValue.startDate) ||\n !this.areDatesEqual(currentDatepicker.endDate, datepickerValue.endDate)\n ) {\n this.formDatepicker.patchValue(datepickerValue, { emitEvent: false });\n }\n\n this.cdr.markForCheck();\n }\n\n private updateExternalFromDisplay(\n value: Partial<MapaDatepickerRangeControlValue>\n ): void {\n this.syncLocaleSettings();\n\n const nextValue: MapaDatepickerRangeControlValue = {\n startDate: value.startDate ?? null,\n endDate: value.endDate ?? null,\n };\n\n this.patchExternalValue(nextValue);\n\n const nextDatepickerValue: MapaDatepickerInternalRangeValue = {\n startDate: parseDateValue(nextValue.startDate),\n endDate: parseDateValue(nextValue.endDate),\n };\n this.formDatepicker.patchValue(nextDatepickerValue, { emitEvent: false });\n this.cdr.markForCheck();\n }\n\n private updateExternalFromDatepicker(\n value: Partial<MapaDatepickerInternalRangeValue>\n ): void {\n this.syncLocaleSettings();\n\n if (!value.startDate || !value.endDate) {\n return;\n }\n\n const nextValue: MapaDatepickerRangeControlValue = {\n startDate: formatDateForLocale(value.startDate, this.getLocale()),\n endDate: formatDateForLocale(value.endDate, this.getLocale()),\n };\n\n this.patchExternalValue(nextValue);\n this.formDisplay.patchValue(nextValue, { emitEvent: false });\n this.cdr.markForCheck();\n }\n\n private patchExternalValue(nextValue: MapaDatepickerRangeControlValue): void {\n const currentValue = this.rangeControl.value;\n\n if (\n currentValue?.startDate === nextValue.startDate &&\n currentValue?.endDate === nextValue.endDate\n ) {\n return;\n }\n\n this.rangeControl.patchValue(nextValue);\n }\n\n private areDatesEqual(first: Date | null, second: Date | null): boolean {\n if (first === second) {\n return true;\n }\n\n if (!first || !second) {\n return false;\n }\n\n return first.getTime() === second.getTime();\n }\n\n cleanDatepicker() {\n const defaultRange = {\n startDate: null,\n endDate: null,\n };\n\n this.formDatepicker.patchValue(defaultRange, { emitEvent: false });\n this.formDisplay.patchValue(defaultRange, { emitEvent: false });\n this.patchExternalValue(defaultRange);\n this.cdr.markForCheck();\n }\n\n private getLocale(): MapaDateLocale {\n return this.currentLocale ?? getActiveDateLocale();\n }\n\n private syncLocaleSettings(): void {\n const nextLocale = getActiveDateLocale();\n\n if (this.currentLocale === nextLocale) {\n return;\n }\n\n this.currentLocale = nextLocale;\n this.dateAdapter.setLocale(nextLocale);\n\n const datepickerValue = this.formDatepicker.getRawValue();\n const hasDateRange = !!datepickerValue.startDate && !!datepickerValue.endDate;\n\n if (hasDateRange) {\n const formattedRange: MapaDatepickerRangeControlValue = {\n startDate: formatDateForLocale(datepickerValue.startDate!, nextLocale),\n endDate: formatDateForLocale(datepickerValue.endDate!, nextLocale),\n };\n\n this.formDisplay.patchValue(formattedRange, { emitEvent: false });\n\n if (this.rangeControl) {\n this.patchExternalValue(formattedRange);\n }\n }\n\n this.cdr.markForCheck();\n }\n}\n\nexport type MapaDatepickerRangeComponent = MapaDatepickerRange;\n","@if (element.label) {\n <div class=\"mapa-datepicker-range__label\">\n {{ element.label }}\n </div>\n}\n<section class=\"mapa-datepicker-range\" [formGroup]=\"formDisplay\">\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"mapa-datepicker-range__start-date\"\n >\n <input\n matInput\n formControlName=\"startDate\"\n [placeholder]=\"startDatePlaceholder\"\n [mask]=\"dateInputMask\"\n [attr.data-date-format]=\"activeDateFormat\"\n />\n </mat-form-field>\n <div class=\"mapa-datepicker-range__divider\">–</div>\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"mapa-datepicker-range__end-date\"\n >\n <input\n matInput\n formControlName=\"endDate\"\n [placeholder]=\"endDatePlaceholder\"\n [mask]=\"dateInputMask\"\n [attr.data-date-format]=\"activeDateFormat\"\n />\n <mat-icon matSuffix (click)=\"cleanDatepicker()\">close</mat-icon>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker touchUi=\"true\" #picker></mat-date-range-picker>\n </mat-form-field>\n</section>\n<section class=\"mapa--hidden\">\n <mat-form-field [formGroup]=\"formDatepicker\">\n <mat-date-range-input [rangePicker]=\"picker\">\n <input matStartDate formControlName=\"startDate\" />\n <input matEndDate formControlName=\"endDate\" />\n </mat-date-range-input>\n </mat-form-field>\n</section>\n","/*\n * Public API Surface of mapa-library-ui datepicker-range\n */\n\nexport * from './src/datepicker-range.component';","/*\n * Public API Surface of mapa-library-ui datepicker-range\n */\n\nexport * from './lib/components/datepicker-range/public-api';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './datepicker-range';\n"],"names":["i1.MapaI18nService"],"mappings":";;;;;;;;;;;;;;;;;;AAEA,MAAM,sBAAsB,GAAG,6BAA6B;AAC5D,MAAM,sBAAsB,GAAG,6BAA6B;AAC5D,MAAM,yBAAyB,GAAG,+BAA+B;AAOjE,SAAS,WAAW,CAAC,IAAU,EAAA;IAC7B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;AACtC;AAEA,SAAS,YAAY,CACnB,IAAU,EACV,SAAiB,EACjB,KAAa,EACb,OAAe,EACf,OAAe,EACf,YAAoB,EAAA;AAEpB,IAAA,OAAO,IAAI,IAAI,CACb,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,WAAW,EAAE,EAClB,IAAI,CAAC,QAAQ,EAAE,EACf,IAAI,CAAC,OAAO,EAAE,GAAG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