quang 19.0.19-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.
Files changed (127) hide show
  1. package/README.md +25 -0
  2. package/auth/README.md +160 -0
  3. package/auth/auth-providers.d.ts +39 -0
  4. package/auth/auth.service.d.ts +52 -0
  5. package/auth/directives/has-at-least-one-role.directive.d.ts +26 -0
  6. package/auth/directives/has-every-role.directive.d.ts +26 -0
  7. package/auth/directives/is-authenticated.directive.d.ts +14 -0
  8. package/auth/directives/is-not-authenticated.directive.d.ts +14 -0
  9. package/auth/guards/index.d.ts +2 -0
  10. package/auth/guards/is-allowed.guard.d.ts +2 -0
  11. package/auth/guards/is-authenticated.guard.d.ts +2 -0
  12. package/auth/index.d.ts +9 -0
  13. package/auth/logout-on-error.interceptor.d.ts +9 -0
  14. package/auth/mobile/index.d.ts +1 -0
  15. package/auth/mobile/mobile-auth-feature.d.ts +2 -0
  16. package/auth/token-storage/index.d.ts +3 -0
  17. package/auth/token-storage/local-storage-feature.d.ts +2 -0
  18. package/auth/token-storage/memory-storage-feature.d.ts +12 -0
  19. package/auth/token-storage/session-storage-feature.d.ts +2 -0
  20. package/components/autocomplete/autocomplete.component.d.ts +43 -0
  21. package/components/autocomplete/index.d.ts +1 -0
  22. package/components/checkbox/checkbox.component.d.ts +11 -0
  23. package/components/checkbox/index.d.ts +1 -0
  24. package/components/date/date.component.d.ts +85 -0
  25. package/components/date/global-date.component.scss +1 -0
  26. package/components/date/index.d.ts +1 -0
  27. package/components/input/index.d.ts +1 -0
  28. package/components/input/input.component.d.ts +15 -0
  29. package/components/paginator/index.d.ts +5 -0
  30. package/components/paginator/paginator-language.service.d.ts +10 -0
  31. package/components/paginator/paginator.component.d.ts +30 -0
  32. package/components/paginator/paginator.module.d.ts +7 -0
  33. package/components/paginator/paginator.service.d.ts +6 -0
  34. package/components/paginator/paginatorIntl.d.ts +12 -0
  35. package/components/select/index.d.ts +1 -0
  36. package/components/select/select.component.d.ts +29 -0
  37. package/components/shared/ErrorData.d.ts +4 -0
  38. package/components/shared/index.d.ts +4 -0
  39. package/components/shared/makeId.d.ts +1 -0
  40. package/components/shared/option-list/option-list.component.d.ts +50 -0
  41. package/components/shared/quang-base-component.directive.d.ts +50 -0
  42. package/components/table/index.d.ts +1 -0
  43. package/components/table/table.component.d.ts +66 -0
  44. package/components/wysiwyg/global-wysiswyg.component.scss +1 -0
  45. package/components/wysiwyg/index.d.ts +1 -0
  46. package/components/wysiwyg/wysiwyg.component.d.ts +46 -0
  47. package/device/index.d.ts +1 -0
  48. package/device/resize-observable.service.d.ts +11 -0
  49. package/fesm2022/quang-auth-mobile.mjs +48 -0
  50. package/fesm2022/quang-auth-mobile.mjs.map +1 -0
  51. package/fesm2022/quang-auth.mjs +473 -0
  52. package/fesm2022/quang-auth.mjs.map +1 -0
  53. package/fesm2022/quang-components-autocomplete.mjs +196 -0
  54. package/fesm2022/quang-components-autocomplete.mjs.map +1 -0
  55. package/fesm2022/quang-components-checkbox.mjs +53 -0
  56. package/fesm2022/quang-components-checkbox.mjs.map +1 -0
  57. package/fesm2022/quang-components-date.mjs +392 -0
  58. package/fesm2022/quang-components-date.mjs.map +1 -0
  59. package/fesm2022/quang-components-input.mjs +54 -0
  60. package/fesm2022/quang-components-input.mjs.map +1 -0
  61. package/fesm2022/quang-components-paginator.mjs +157 -0
  62. package/fesm2022/quang-components-paginator.mjs.map +1 -0
  63. package/fesm2022/quang-components-select.mjs +123 -0
  64. package/fesm2022/quang-components-select.mjs.map +1 -0
  65. package/fesm2022/quang-components-shared.mjs +386 -0
  66. package/fesm2022/quang-components-shared.mjs.map +1 -0
  67. package/fesm2022/quang-components-table.mjs +162 -0
  68. package/fesm2022/quang-components-table.mjs.map +1 -0
  69. package/fesm2022/quang-components-wysiwyg.mjs +230 -0
  70. package/fesm2022/quang-components-wysiwyg.mjs.map +1 -0
  71. package/fesm2022/quang-device.mjs +42 -0
  72. package/fesm2022/quang-device.mjs.map +1 -0
  73. package/fesm2022/quang-forms.mjs +188 -0
  74. package/fesm2022/quang-forms.mjs.map +1 -0
  75. package/fesm2022/quang-loader.mjs +116 -0
  76. package/fesm2022/quang-loader.mjs.map +1 -0
  77. package/fesm2022/quang-overlay-modal.mjs +118 -0
  78. package/fesm2022/quang-overlay-modal.mjs.map +1 -0
  79. package/fesm2022/quang-overlay-popover.mjs +70 -0
  80. package/fesm2022/quang-overlay-popover.mjs.map +1 -0
  81. package/fesm2022/quang-overlay-shared.mjs +359 -0
  82. package/fesm2022/quang-overlay-shared.mjs.map +1 -0
  83. package/fesm2022/quang-overlay-toast.mjs +105 -0
  84. package/fesm2022/quang-overlay-toast.mjs.map +1 -0
  85. package/fesm2022/quang-overlay-tooltip.mjs +56 -0
  86. package/fesm2022/quang-overlay-tooltip.mjs.map +1 -0
  87. package/fesm2022/quang-shared.mjs +29 -0
  88. package/fesm2022/quang-shared.mjs.map +1 -0
  89. package/fesm2022/quang-translation.mjs +119 -0
  90. package/fesm2022/quang-translation.mjs.map +1 -0
  91. package/fesm2022/quang.mjs +23 -0
  92. package/fesm2022/quang.mjs.map +1 -0
  93. package/forms/README.md +6 -0
  94. package/forms/form-group-model.d.ts +18 -0
  95. package/forms/index.d.ts +2 -0
  96. package/forms/validators.d.ts +43 -0
  97. package/index.d.ts +30 -0
  98. package/loader/README.md +14 -0
  99. package/loader/index.d.ts +4 -0
  100. package/loader/loader-providers.d.ts +23 -0
  101. package/loader/loader.component.d.ts +23 -0
  102. package/loader/loader.interceptor.d.ts +10 -0
  103. package/loader/loader.service.d.ts +9 -0
  104. package/overlay/modal/index.d.ts +1 -0
  105. package/overlay/modal/modal.component.d.ts +29 -0
  106. package/overlay/popover/index.d.ts +1 -0
  107. package/overlay/popover/popover.component.d.ts +13 -0
  108. package/overlay/popover/popover.directive.d.ts +11 -0
  109. package/overlay/shared/CustomViewportRuler.d.ts +63 -0
  110. package/overlay/shared/index.d.ts +3 -0
  111. package/overlay/shared/quang-base-overlay.component.d.ts +9 -0
  112. package/overlay/shared/quang-base-overlay.directive.d.ts +44 -0
  113. package/overlay/toast/index.d.ts +2 -0
  114. package/overlay/toast/toast.component.d.ts +13 -0
  115. package/overlay/toast/toast.service.d.ts +27 -0
  116. package/overlay/tooltip/index.d.ts +2 -0
  117. package/overlay/tooltip/tooltip.component.d.ts +11 -0
  118. package/overlay/tooltip/tooltip.directive.d.ts +11 -0
  119. package/package.json +146 -0
  120. package/shared/index.d.ts +1 -0
  121. package/shared/intercept-utils.d.ts +13 -0
  122. package/translation/README.md +21 -0
  123. package/translation/index.d.ts +4 -0
  124. package/translation/translation-loader.service.d.ts +10 -0
  125. package/translation/translation-providers.d.ts +28 -0
  126. package/translation/translation.service.d.ts +15 -0
  127. package/translation/translations.tokens.d.ts +5 -0
@@ -0,0 +1,392 @@
1
+ import { NgIf, NgClass } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { input, viewChild, computed, signal, inject, effect, forwardRef, Optional, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
+ import { TranslocoPipe } from '@jsverse/transloco';
7
+ import AirDatepicker from 'air-datepicker';
8
+ import en from 'air-datepicker/locale/en';
9
+ import fr from 'air-datepicker/locale/fr';
10
+ import it from 'air-datepicker/locale/it';
11
+ import { isMatch, parse, format } from 'date-fns';
12
+ import { QuangTranslationService } from 'quang/translation';
13
+ import { fromEvent, debounceTime } from 'rxjs';
14
+ import { QuangBaseComponent } from 'quang/components/shared';
15
+
16
+ /**
17
+ * Datepicker component based on {@link https://air-datepicker.com/docs}.
18
+ *
19
+ * @usageNotes
20
+ * 1. It can be used to only display the `timepicker` component by setting
21
+ * `[showOnlyTimepicker]="true"`
22
+ *
23
+ * 2. `datepickerOptions` can be used to override the default options of the component to get full access to all the
24
+ * possible customizations that Air Datepicker provides. See {@link https://air-datepicker.com/examples}
25
+ * Please note that overriding the `container` and `locale` properties and the `onSelect` and `onHide`
26
+ * events might cause the component to malfunction.
27
+ */
28
+ class QuangDateComponent extends QuangBaseComponent {
29
+ constructor() {
30
+ super();
31
+ /**
32
+ * Format to use to show on the input field.
33
+ * The format is based on the standard {@link https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table}
34
+ * Default: dd/MM/yyyy
35
+ * @default dd/MM/yyyy
36
+ */
37
+ this.dateFormat = input('dd/MM/yyyy');
38
+ /**
39
+ * Format to use to show on the time inside the input field.
40
+ * The format is based on the standard {@link https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table}
41
+ * Default: HH:mm
42
+ * @default HH:mm
43
+ */
44
+ this.timeFormat = input('HH:mm');
45
+ /**
46
+ * Calendar locale, if not provided the component will try to use the one provided in {@link QuangTranslationService}
47
+ * if the language is not set in {@link QuangTranslationService} it will use the browser language
48
+ * Use this parameter only to override default behavior
49
+ */
50
+ this.activeLanguageOverride = input(undefined);
51
+ /**
52
+ * If true enable the timepicker inside the calendar
53
+ */
54
+ this.timepicker = input(false);
55
+ /**
56
+ * The message to show inside the input if the date is invalid
57
+ */
58
+ this.invalidDateMessage = input('');
59
+ this.showOnlyTimepicker = input(false);
60
+ this.minHour = input(0);
61
+ this.maxHour = input(24);
62
+ this.minMinute = input(0);
63
+ this.maxMinute = input(59);
64
+ this.minDate = input(undefined);
65
+ this.maxDate = input(undefined);
66
+ this.showInline = input(false);
67
+ this.calendarClasses = input('');
68
+ this.buttonClass = input('');
69
+ this.datepickerOptions = input(undefined);
70
+ this._inputForDate = viewChild('inputForDate');
71
+ this.contentTemplate = viewChild.required('calendarButton');
72
+ this.hasNoContent = computed(() => this.contentTemplate()?.nativeElement.children.length === 0);
73
+ this._quangTranslationService = signal(inject(QuangTranslationService));
74
+ this._quangTranslationActiveLang = computed(() => this._quangTranslationService()?.activeLang() ?? null);
75
+ this.multipleDatesSeparator = input(' - ');
76
+ this.rangeSelection = input(false);
77
+ this._activeLanguage = computed(() => {
78
+ if (this.activeLanguageOverride()) {
79
+ return this.activeLanguageOverride();
80
+ }
81
+ if (this._quangTranslationService()) {
82
+ return this._quangTranslationActiveLang();
83
+ }
84
+ return navigator.language;
85
+ });
86
+ this._airDatepickerInstance = signal(undefined);
87
+ this.searchTextDebounce = input(500);
88
+ this.targetPosition = signal('bottom left');
89
+ this._generateAirDatepickerEffect = effect(() => {
90
+ this.setupCalendar();
91
+ }, { allowSignalWrites: true });
92
+ this.valueFormat = computed(() => this.showOnlyTimepicker()
93
+ ? this.timeFormat()
94
+ : this.dateFormat() + (this.showTimepicker() ? ` ${this.timeFormat()}` : ''));
95
+ this.inputValueString = computed(() => this.formatDate(this._value()));
96
+ this.showTimepicker = computed(() => !this.rangeSelection() && (this.timepicker() || this.showOnlyTimepicker()));
97
+ this.isMouseInsideCalendar = signal(false);
98
+ this.isMouseOutsideCalendar = computed(() => !this.isMouseInsideCalendar());
99
+ fromEvent(document, 'scroll', { capture: true })
100
+ .pipe(takeUntilDestroyed(), debounceTime(250))
101
+ .subscribe(() => {
102
+ if (this._airDatepickerInstance()?.visible) {
103
+ this.setupCalendar();
104
+ }
105
+ });
106
+ }
107
+ setupCalendar() {
108
+ if (this._inputForDate()?.nativeElement) {
109
+ const currentValue = this._value();
110
+ let targetDate;
111
+ if (currentValue && typeof currentValue === 'string') {
112
+ targetDate = [currentValue];
113
+ }
114
+ else if (currentValue && typeof currentValue === 'object') {
115
+ targetDate = [];
116
+ if (currentValue.dateFrom) {
117
+ targetDate.push(currentValue.dateFrom);
118
+ }
119
+ if (currentValue.dateTo) {
120
+ targetDate.push(currentValue.dateTo);
121
+ }
122
+ }
123
+ this.setCalendarPosition();
124
+ const airDatepickerOpts = {
125
+ autoClose: true,
126
+ classes: this.calendarClasses(),
127
+ dateFormat: this.dateFormat(),
128
+ inline: this.showInline(),
129
+ isMobile: false,
130
+ multipleDatesSeparator: this.multipleDatesSeparator(),
131
+ range: this.rangeSelection(),
132
+ timepicker: this.showTimepicker(),
133
+ onlyTimepicker: this.showOnlyTimepicker(),
134
+ timeFormat: this.timeFormat(),
135
+ minHours: this.minHour(),
136
+ maxHours: this.maxHour(),
137
+ minMinutes: this.minMinute(),
138
+ maxMinutes: this.maxMinute(),
139
+ minDate: this.minDate(),
140
+ maxDate: this.maxDate(),
141
+ toggleSelected: false,
142
+ multipleDates: false,
143
+ selectedDates: targetDate,
144
+ position: this.targetPosition(),
145
+ locale: this.getLocale(),
146
+ onSelect: ({ date }) => {
147
+ if (!Array.isArray(date)) {
148
+ let selectTargetDate = date;
149
+ if (!this.showTimepicker()) {
150
+ selectTargetDate = this.dateToUtc(date);
151
+ }
152
+ this.onChangedHandler(selectTargetDate.toISOString());
153
+ }
154
+ if (this.showInline()) {
155
+ this.onHideCalendar();
156
+ }
157
+ },
158
+ onHide: (isAnimationComplete) => {
159
+ if (isAnimationComplete) {
160
+ this.onHideCalendar();
161
+ }
162
+ },
163
+ ...(this.datepickerOptions() ?? {}),
164
+ onShow: (isAnimationComplete) => {
165
+ const datepicker = this._airDatepickerInstance()?.$datepicker;
166
+ if (datepicker) {
167
+ datepicker.onmouseenter = () => {
168
+ this.isMouseInsideCalendar.set(true);
169
+ };
170
+ datepicker.onmouseleave = () => {
171
+ this.isMouseInsideCalendar.set(false);
172
+ };
173
+ }
174
+ if (isAnimationComplete || !this.showTimepicker()) {
175
+ return;
176
+ }
177
+ this.setupTimepicker();
178
+ },
179
+ };
180
+ if (this._airDatepickerInstance()) {
181
+ if (this._airDatepickerInstance()?.visible) {
182
+ this._airDatepickerInstance()?.update(airDatepickerOpts);
183
+ }
184
+ else {
185
+ this._airDatepickerInstance()?.update(airDatepickerOpts, { silent: true });
186
+ }
187
+ if (!targetDate) {
188
+ this._airDatepickerInstance()?.setFocusDate(false);
189
+ this._airDatepickerInstance()?.clear({ silent: true });
190
+ }
191
+ else {
192
+ this._airDatepickerInstance()?.selectDate(targetDate, { updateTime: true });
193
+ }
194
+ }
195
+ else {
196
+ this._airDatepickerInstance.set(new AirDatepicker(this._inputForDate()?.nativeElement, airDatepickerOpts));
197
+ }
198
+ if (this.showInline()) {
199
+ this.setupTimepicker();
200
+ }
201
+ }
202
+ }
203
+ onChangeText($event) {
204
+ const value = $event.target?.value;
205
+ if (value) {
206
+ // TODO: check format for DateRange
207
+ if (value.length === this.valueFormat().length && isMatch(value, this.valueFormat())) {
208
+ this.onChangedHandler(this.setupInputStringToDate(value).toISOString());
209
+ }
210
+ }
211
+ else {
212
+ this.onChangedHandler(value);
213
+ }
214
+ }
215
+ onBlurHandler() {
216
+ super.onBlurHandler();
217
+ if (this.isMouseOutsideCalendar() && this._airDatepickerInstance()?.visible) {
218
+ this._airDatepickerInstance()?.hide();
219
+ }
220
+ }
221
+ setupInputStringToDate(value) {
222
+ let targetDate = parse(value, this.valueFormat(), new Date());
223
+ if (!this.showTimepicker()) {
224
+ targetDate = this.dateToUtc(targetDate);
225
+ }
226
+ return targetDate;
227
+ }
228
+ onChangedHandler(value) {
229
+ let targetDate = value;
230
+ const currentValue = this._value();
231
+ if (typeof targetDate === 'string' && (!currentValue || typeof currentValue === 'string')) {
232
+ if (!this.showTimepicker() && targetDate) {
233
+ // remove time from date
234
+ targetDate = `${targetDate.split('T')[0]}T00:00:00.000Z`;
235
+ }
236
+ else if (this.showOnlyTimepicker() && currentValue && targetDate) {
237
+ targetDate = `${currentValue.split('T')[0]}T${targetDate.split('T')[1]}`;
238
+ }
239
+ }
240
+ else if (this.rangeSelection() &&
241
+ typeof targetDate === 'object' &&
242
+ (currentValue === null || typeof currentValue === 'object')) {
243
+ if (!this.showTimepicker() && targetDate?.dateFrom) {
244
+ // remove time from date
245
+ targetDate.dateFrom = `${targetDate.dateFrom.split('T')[0]}T00:00:00.000Z`;
246
+ }
247
+ else if (this.showOnlyTimepicker() && currentValue?.dateFrom && targetDate?.dateFrom) {
248
+ targetDate.dateFrom = `${currentValue?.dateFrom.split('T')[0]}T${targetDate.dateFrom.split('T')[1]}`;
249
+ }
250
+ if (!this.showTimepicker() && targetDate?.dateTo) {
251
+ // remove time from date
252
+ targetDate.dateTo = `${targetDate.dateTo.split('T')[0]}T00:00:00.000Z`;
253
+ }
254
+ else if (this.showOnlyTimepicker() && currentValue?.dateTo && targetDate?.dateTo) {
255
+ targetDate.dateTo = `${currentValue?.dateTo.split('T')[0]}T${targetDate.dateTo.split('T')[1]}`;
256
+ }
257
+ }
258
+ if (JSON.stringify(currentValue) === JSON.stringify(targetDate)) {
259
+ return;
260
+ }
261
+ this._value.set(targetDate);
262
+ }
263
+ onHideCalendar() {
264
+ const valueInput = this._inputForDate()?.nativeElement.value;
265
+ let value = valueInput;
266
+ if (this.rangeSelection()) {
267
+ value = { dateFrom: '', dateTo: '' };
268
+ const [dateFrom, dateTo] = valueInput.split(this.multipleDatesSeparator());
269
+ value.dateFrom = dateFrom ?? '';
270
+ value.dateTo = dateTo ?? '';
271
+ if (!value.dateFrom || !isMatch(value.dateFrom, this.valueFormat())) {
272
+ value.dateFrom = null;
273
+ }
274
+ else {
275
+ value.dateFrom = this.setupInputStringToDate(value.dateFrom).toISOString();
276
+ }
277
+ if (!value.dateTo || !isMatch(value.dateTo, this.valueFormat())) {
278
+ value.dateTo = null;
279
+ }
280
+ else {
281
+ value.dateTo = this.setupInputStringToDate(value.dateTo).toISOString();
282
+ }
283
+ this.onChangedHandler(value);
284
+ }
285
+ else if (isMatch(value, this.valueFormat())) {
286
+ this.onChangedHandler(this.setupInputStringToDate(value).toISOString());
287
+ }
288
+ else {
289
+ this.onChangedHandler(null);
290
+ }
291
+ if (this.formControl()?.getRawValue() !== this._value()) {
292
+ super.onChangedHandler(this._value());
293
+ }
294
+ else if (this.onTouched) {
295
+ this.onTouched();
296
+ }
297
+ this.onBlurHandler();
298
+ }
299
+ formatDate(val) {
300
+ if (val && typeof val === 'string') {
301
+ return format(val, this.valueFormat());
302
+ }
303
+ if (val && typeof val === 'object') {
304
+ let dateFromFormat = '';
305
+ let dateToFormat = '';
306
+ if (val.dateFrom) {
307
+ dateFromFormat = format(val.dateFrom, this.valueFormat());
308
+ }
309
+ if (val.dateTo) {
310
+ dateToFormat = format(val.dateTo, this.valueFormat());
311
+ }
312
+ return `${dateFromFormat}${this.multipleDatesSeparator()}${dateToFormat}`;
313
+ }
314
+ return '';
315
+ }
316
+ openDatePicker() {
317
+ if (this._inputForDate()?.nativeElement) {
318
+ this._inputForDate()?.nativeElement.focus();
319
+ }
320
+ }
321
+ interceptInputInteraction($event) {
322
+ if (!this.isReadonly())
323
+ return;
324
+ $event.stopPropagation();
325
+ $event.stopImmediatePropagation();
326
+ $event.preventDefault();
327
+ }
328
+ getLocale() {
329
+ switch (this._activeLanguage()?.toLowerCase()) {
330
+ case 'en':
331
+ return en.default || en;
332
+ case 'it':
333
+ return it.default || it;
334
+ case 'fr':
335
+ return fr.default || fr;
336
+ default:
337
+ return en.default || en;
338
+ }
339
+ }
340
+ onCancel() {
341
+ this._inputForDate()?.nativeElement.blur();
342
+ }
343
+ dateToUtc(date) {
344
+ // convert to UTC time removing the timezone
345
+ return new Date(date.getTime() - date.getTimezoneOffset() * 60000);
346
+ }
347
+ setCalendarPosition() {
348
+ const windowInnerHeight = window.innerHeight;
349
+ const inputBoundingClientRect = this._inputForDate()?.nativeElement.getBoundingClientRect();
350
+ const diff = windowInnerHeight - inputBoundingClientRect.height - inputBoundingClientRect.top - 239;
351
+ if (diff >= 0) {
352
+ this.targetPosition.set('bottom left');
353
+ }
354
+ else {
355
+ this.targetPosition.set('top left');
356
+ }
357
+ }
358
+ setupTimepicker() {
359
+ const timepicker = document.getElementsByClassName('air-datepicker-time')?.[0];
360
+ if (timepicker) {
361
+ const inputs = timepicker.getElementsByTagName('input');
362
+ for (const input of Array.from(inputs)) {
363
+ input.setAttribute('type', 'number');
364
+ input.setAttribute('maxLength', '2');
365
+ input.className = 'form-control';
366
+ input.onmouseup = (evt) => {
367
+ evt.stopImmediatePropagation();
368
+ };
369
+ input.onblur = () => {
370
+ if (this.isMouseOutsideCalendar()) {
371
+ this._airDatepickerInstance()?.hide();
372
+ }
373
+ };
374
+ }
375
+ }
376
+ }
377
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QuangDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
378
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.5", type: QuangDateComponent, isStandalone: true, selector: "quang-date", inputs: { dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null }, timeFormat: { classPropertyName: "timeFormat", publicName: "timeFormat", isSignal: true, isRequired: false, transformFunction: null }, activeLanguageOverride: { classPropertyName: "activeLanguageOverride", publicName: "activeLanguageOverride", isSignal: true, isRequired: false, transformFunction: null }, timepicker: { classPropertyName: "timepicker", publicName: "timepicker", isSignal: true, isRequired: false, transformFunction: null }, invalidDateMessage: { classPropertyName: "invalidDateMessage", publicName: "invalidDateMessage", isSignal: true, isRequired: false, transformFunction: null }, showOnlyTimepicker: { classPropertyName: "showOnlyTimepicker", publicName: "showOnlyTimepicker", isSignal: true, isRequired: false, transformFunction: null }, minHour: { classPropertyName: "minHour", publicName: "minHour", isSignal: true, isRequired: false, transformFunction: null }, maxHour: { classPropertyName: "maxHour", publicName: "maxHour", isSignal: true, isRequired: false, transformFunction: null }, minMinute: { classPropertyName: "minMinute", publicName: "minMinute", isSignal: true, isRequired: false, transformFunction: null }, maxMinute: { classPropertyName: "maxMinute", publicName: "maxMinute", 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 }, showInline: { classPropertyName: "showInline", publicName: "showInline", isSignal: true, isRequired: false, transformFunction: null }, calendarClasses: { classPropertyName: "calendarClasses", publicName: "calendarClasses", isSignal: true, isRequired: false, transformFunction: null }, buttonClass: { classPropertyName: "buttonClass", publicName: "buttonClass", isSignal: true, isRequired: false, transformFunction: null }, datepickerOptions: { classPropertyName: "datepickerOptions", publicName: "datepickerOptions", isSignal: true, isRequired: false, transformFunction: null }, multipleDatesSeparator: { classPropertyName: "multipleDatesSeparator", publicName: "multipleDatesSeparator", isSignal: true, isRequired: false, transformFunction: null }, rangeSelection: { classPropertyName: "rangeSelection", publicName: "rangeSelection", isSignal: true, isRequired: false, transformFunction: null }, searchTextDebounce: { classPropertyName: "searchTextDebounce", publicName: "searchTextDebounce", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => QuangDateComponent), multi: true }], viewQueries: [{ propertyName: "_inputForDate", first: true, predicate: ["inputForDate"], descendants: true, isSignal: true }, { propertyName: "contentTemplate", first: true, predicate: ["calendarButton"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"mb-3\">\n <label\n [htmlFor]=\"componentId()\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <div\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n class=\"input-date-container\"\n >\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [autocomplete]=\"'off'\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [class.with-button-calendar]=\"!hasNoContent()\"\n [disabled]=\"_isDisabled()\"\n [hidden]=\"showInline()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"inputValueString()\"\n (blur)=\"onBlurHandler()\"\n (focus)=\"interceptInputInteraction($event)\"\n (input)=\"onChangeText($event)\"\n (mouseenter)=\"isMouseInsideCalendar.set(true)\"\n (mouseleave)=\"isMouseInsideCalendar.set(false)\"\n (search)=\"onCancel()\"\n #inputForDate\n class=\"form-control\"\n type=\"search\"\n />\n <button\n [attr.required]=\"getIsRequiredControl()\"\n [class.border-danger]=\"_showErrors()\"\n [class.border-success]=\"_showSuccess()\"\n [hidden]=\"showInline() || hasNoContent() || _isDisabled()\"\n [ngClass]=\"buttonClass()\"\n (click)=\"_ngControl()?.disabled ? null : openDatePicker()\"\n #calendarButton\n aria-label=\"calendar-button\"\n class=\"btn btn-outline-secondary btn-outline-calendar\"\n type=\"button\"\n >\n <ng-content></ng-content>\n </button>\n </div>\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n *ngIf=\"helpMessage()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n</div>\n", styles: ["input::-webkit-search-cancel-button{-webkit-appearance:none;height:.75rem;width:.75rem;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 3 1024 1024' width='12' height='12' fill='currentColor'%3E%3Cpath d='M9 1018q5 4 10.5 6.5 5.5 2.5 11.5 2.5 6 0 11.5-2.5 5.5-2.5 10.5-6.5l459-459 459 459q5 4 10.5 6.5 5.5 2.5 11.5 2.5 6 0 11.5-2.5 5.5-2.5 10.5-6.5 9-9 9-22 0-13-9-22l-459-459 459-459q9-9 9-22 0-13-9-22-9-9-22-9-13 0-22 9l-459 459-459-459q-9-9-22-9-13 0-22 9-9 9-9 22 0 13 9 22l459 459-459 459q-9 9-9 22 0 13 9 22l0 0z'/%3E%3C/svg%3E%0A\");cursor:pointer}::ng-deep .air-datepicker{z-index:99999}::ng-deep .air-datepicker .air-datepicker--pointer{display:none}::ng-deep .air-datepicker .air-datepicker-time{display:block}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--current{display:none}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--sliders{display:flex;justify-content:center;padding-top:.25rem;gap:1rem}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--sliders .air-datepicker-time--row{width:100%;position:relative}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--sliders .air-datepicker-time--row:first-child:after{content:\":\";display:inline;font-size:1rem;position:absolute;right:-.65rem}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--sliders .air-datepicker-time--row input{width:100%;text-align:center;padding:0;padding-left:1rem;border-color:var(--bs-border-color)}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--sliders .air-datepicker-time--row .form-control:focus{box-shadow:unset!important}::ng-deep .air-datepicker.-inline-.-only-timepicker-{border:0}::ng-deep .air-datepicker.-inline-.-only-timepicker- .air-datepicker--time{border:0}:host{display:block}:host .input-date-container{display:flex}:host input{flex:1}:host input.with-button-calendar{border-top-right-radius:0;border-bottom-right-radius:0}:host input:disabled{border-radius:var(--bs-border-radius)}:host .btn-outline-calendar{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;min-width:unset;display:flex;border-color:var(--bs-border-color)}:host .border-danger{border-color:var(--bs-form-invalid-border-color)}:host .border-success{border-color:var(--bs-form-valid-border-color)}\n"], dependencies: [{ kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
379
+ }
380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QuangDateComponent, decorators: [{
381
+ type: Component,
382
+ args: [{ selector: 'quang-date', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => QuangDateComponent), multi: true }], imports: [TranslocoPipe, NgIf, NgClass], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mb-3\">\n <label\n [htmlFor]=\"componentId()\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <div\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n class=\"input-date-container\"\n >\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [autocomplete]=\"'off'\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [class.with-button-calendar]=\"!hasNoContent()\"\n [disabled]=\"_isDisabled()\"\n [hidden]=\"showInline()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"inputValueString()\"\n (blur)=\"onBlurHandler()\"\n (focus)=\"interceptInputInteraction($event)\"\n (input)=\"onChangeText($event)\"\n (mouseenter)=\"isMouseInsideCalendar.set(true)\"\n (mouseleave)=\"isMouseInsideCalendar.set(false)\"\n (search)=\"onCancel()\"\n #inputForDate\n class=\"form-control\"\n type=\"search\"\n />\n <button\n [attr.required]=\"getIsRequiredControl()\"\n [class.border-danger]=\"_showErrors()\"\n [class.border-success]=\"_showSuccess()\"\n [hidden]=\"showInline() || hasNoContent() || _isDisabled()\"\n [ngClass]=\"buttonClass()\"\n (click)=\"_ngControl()?.disabled ? null : openDatePicker()\"\n #calendarButton\n aria-label=\"calendar-button\"\n class=\"btn btn-outline-secondary btn-outline-calendar\"\n type=\"button\"\n >\n <ng-content></ng-content>\n </button>\n </div>\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n *ngIf=\"helpMessage()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n</div>\n", styles: ["input::-webkit-search-cancel-button{-webkit-appearance:none;height:.75rem;width:.75rem;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 3 1024 1024' width='12' height='12' fill='currentColor'%3E%3Cpath d='M9 1018q5 4 10.5 6.5 5.5 2.5 11.5 2.5 6 0 11.5-2.5 5.5-2.5 10.5-6.5l459-459 459 459q5 4 10.5 6.5 5.5 2.5 11.5 2.5 6 0 11.5-2.5 5.5-2.5 10.5-6.5 9-9 9-22 0-13-9-22l-459-459 459-459q9-9 9-22 0-13-9-22-9-9-22-9-13 0-22 9l-459 459-459-459q-9-9-22-9-13 0-22 9-9 9-9 22 0 13 9 22l459 459-459 459q-9 9-9 22 0 13 9 22l0 0z'/%3E%3C/svg%3E%0A\");cursor:pointer}::ng-deep .air-datepicker{z-index:99999}::ng-deep .air-datepicker .air-datepicker--pointer{display:none}::ng-deep .air-datepicker .air-datepicker-time{display:block}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--current{display:none}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--sliders{display:flex;justify-content:center;padding-top:.25rem;gap:1rem}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--sliders .air-datepicker-time--row{width:100%;position:relative}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--sliders .air-datepicker-time--row:first-child:after{content:\":\";display:inline;font-size:1rem;position:absolute;right:-.65rem}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--sliders .air-datepicker-time--row input{width:100%;text-align:center;padding:0;padding-left:1rem;border-color:var(--bs-border-color)}::ng-deep .air-datepicker .air-datepicker-time .air-datepicker-time--sliders .air-datepicker-time--row .form-control:focus{box-shadow:unset!important}::ng-deep .air-datepicker.-inline-.-only-timepicker-{border:0}::ng-deep .air-datepicker.-inline-.-only-timepicker- .air-datepicker--time{border:0}:host{display:block}:host .input-date-container{display:flex}:host input{flex:1}:host input.with-button-calendar{border-top-right-radius:0;border-bottom-right-radius:0}:host input:disabled{border-radius:var(--bs-border-radius)}:host .btn-outline-calendar{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;min-width:unset;display:flex;border-color:var(--bs-border-color)}:host .border-danger{border-color:var(--bs-form-invalid-border-color)}:host .border-success{border-color:var(--bs-form-valid-border-color)}\n"] }]
383
+ }], ctorParameters: () => [], propDecorators: { _quangTranslationService: [{
384
+ type: Optional
385
+ }] } });
386
+
387
+ /**
388
+ * Generated bundle index. Do not edit.
389
+ */
390
+
391
+ export { QuangDateComponent };
392
+ //# sourceMappingURL=quang-components-date.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quang-components-date.mjs","sources":["../../../projects/quang/components/date/date.component.ts","../../../projects/quang/components/date/date.component.html","../../../projects/quang/components/date/quang-components-date.ts"],"sourcesContent":["import { NgClass, NgIf } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Optional,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\nimport { NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\nimport AirDatepicker, {\n AirDatepickerDate,\n AirDatepickerLocale,\n AirDatepickerOptions,\n AirDatepickerPosition,\n} from 'air-datepicker'\nimport en from 'air-datepicker/locale/en'\nimport fr from 'air-datepicker/locale/fr'\nimport it from 'air-datepicker/locale/it'\nimport { format, isMatch, parse } from 'date-fns'\nimport { QuangTranslationService } from 'quang/translation'\nimport { debounceTime, fromEvent } from 'rxjs'\n\nimport { QuangBaseComponent } from 'quang/components/shared'\n\nexport interface DateRange {\n dateFrom: string | null\n dateTo: string | null\n}\n\nexport type QuangDatepickerOptions = AirDatepickerOptions\n\n@Component({\n selector: 'quang-date',\n templateUrl: './date.component.html',\n styleUrl: './date.component.scss',\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => QuangDateComponent), multi: true }],\n imports: [TranslocoPipe, NgIf, NgClass],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * Datepicker component based on {@link https://air-datepicker.com/docs}.\n *\n * @usageNotes\n * 1. It can be used to only display the `timepicker` component by setting\n * `[showOnlyTimepicker]=\"true\"`\n *\n * 2. `datepickerOptions` can be used to override the default options of the component to get full access to all the\n * possible customizations that Air Datepicker provides. See {@link https://air-datepicker.com/examples}\n * Please note that overriding the `container` and `locale` properties and the `onSelect` and `onHide`\n * events might cause the component to malfunction.\n */\nexport class QuangDateComponent extends QuangBaseComponent<string | DateRange | null> {\n /**\n * Format to use to show on the input field.\n * The format is based on the standard {@link https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table}\n * Default: dd/MM/yyyy\n * @default dd/MM/yyyy\n */\n dateFormat = input<string>('dd/MM/yyyy')\n\n /**\n * Format to use to show on the time inside the input field.\n * The format is based on the standard {@link https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table}\n * Default: HH:mm\n * @default HH:mm\n */\n timeFormat = input<string>('HH:mm')\n\n /**\n * Calendar locale, if not provided the component will try to use the one provided in {@link QuangTranslationService}\n * if the language is not set in {@link QuangTranslationService} it will use the browser language\n * Use this parameter only to override default behavior\n */\n activeLanguageOverride = input<string | undefined>(undefined)\n\n /**\n * If true enable the timepicker inside the calendar\n */\n timepicker = input<boolean>(false)\n\n /**\n * The message to show inside the input if the date is invalid\n */\n invalidDateMessage = input<string>('')\n\n showOnlyTimepicker = input<boolean>(false)\n\n minHour = input<number>(0)\n\n maxHour = input<number>(24)\n\n minMinute = input<number>(0)\n\n maxMinute = input<number>(59)\n\n minDate = input<Date | undefined>(undefined)\n\n maxDate = input<Date | undefined>(undefined)\n\n showInline = input<boolean>(false)\n\n calendarClasses = input<string>('')\n\n buttonClass = input<string>('')\n\n datepickerOptions = input<QuangDatepickerOptions | undefined>(undefined)\n\n _inputForDate = viewChild<ElementRef>('inputForDate')\n\n contentTemplate = viewChild.required<ElementRef>('calendarButton')\n\n hasNoContent = computed(() => this.contentTemplate()?.nativeElement.children.length === 0)\n\n @Optional() _quangTranslationService = signal<QuangTranslationService | undefined>(inject(QuangTranslationService))\n\n _quangTranslationActiveLang = computed(() => this._quangTranslationService()?.activeLang() ?? null)\n\n multipleDatesSeparator = input<string>(' - ')\n\n rangeSelection = input(false)\n\n _activeLanguage = computed(() => {\n if (this.activeLanguageOverride()) {\n return this.activeLanguageOverride()\n }\n if (this._quangTranslationService()) {\n return this._quangTranslationActiveLang()\n }\n return navigator.language\n })\n\n _airDatepickerInstance = signal<AirDatepicker | undefined>(undefined)\n\n searchTextDebounce = input<number>(500)\n\n targetPosition = signal<AirDatepickerPosition>('bottom left')\n\n _generateAirDatepickerEffect = effect(\n () => {\n this.setupCalendar()\n },\n { allowSignalWrites: true }\n )\n\n valueFormat = computed(() =>\n this.showOnlyTimepicker()\n ? this.timeFormat()\n : this.dateFormat() + (this.showTimepicker() ? ` ${this.timeFormat()}` : '')\n )\n\n inputValueString = computed(() => this.formatDate(this._value()))\n\n constructor() {\n super()\n\n fromEvent(document, 'scroll', { capture: true })\n .pipe(takeUntilDestroyed(), debounceTime(250))\n .subscribe(() => {\n if (this._airDatepickerInstance()?.visible) {\n this.setupCalendar()\n }\n })\n }\n\n showTimepicker = computed(() => !this.rangeSelection() && (this.timepicker() || this.showOnlyTimepicker()))\n\n isMouseInsideCalendar = signal(false)\n\n isMouseOutsideCalendar = computed(() => !this.isMouseInsideCalendar())\n\n setupCalendar() {\n if (this._inputForDate()?.nativeElement) {\n const currentValue = this._value()\n let targetDate: AirDatepickerDate[] | undefined\n if (currentValue && typeof currentValue === 'string') {\n targetDate = [currentValue]\n } else if (currentValue && typeof currentValue === 'object') {\n targetDate = []\n if (currentValue.dateFrom) {\n targetDate.push(currentValue.dateFrom)\n }\n if (currentValue.dateTo) {\n targetDate.push(currentValue.dateTo)\n }\n }\n this.setCalendarPosition()\n const airDatepickerOpts: QuangDatepickerOptions = {\n autoClose: true,\n classes: this.calendarClasses(),\n dateFormat: this.dateFormat(),\n inline: this.showInline(),\n isMobile: false,\n multipleDatesSeparator: this.multipleDatesSeparator(),\n range: this.rangeSelection(),\n timepicker: this.showTimepicker(),\n onlyTimepicker: this.showOnlyTimepicker(),\n timeFormat: this.timeFormat(),\n minHours: this.minHour(),\n maxHours: this.maxHour(),\n minMinutes: this.minMinute(),\n maxMinutes: this.maxMinute(),\n minDate: this.minDate(),\n maxDate: this.maxDate(),\n toggleSelected: false,\n multipleDates: false,\n selectedDates: targetDate,\n position: this.targetPosition(),\n locale: this.getLocale(),\n onSelect: ({ date }) => {\n if (!Array.isArray(date)) {\n let selectTargetDate = date\n if (!this.showTimepicker()) {\n selectTargetDate = this.dateToUtc(date)\n }\n this.onChangedHandler(selectTargetDate.toISOString())\n }\n if (this.showInline()) {\n this.onHideCalendar()\n }\n },\n onHide: (isAnimationComplete: boolean) => {\n if (isAnimationComplete) {\n this.onHideCalendar()\n }\n },\n ...(this.datepickerOptions() ?? {}),\n onShow: (isAnimationComplete) => {\n const datepicker = this._airDatepickerInstance()?.$datepicker\n if (datepicker) {\n datepicker.onmouseenter = () => {\n this.isMouseInsideCalendar.set(true)\n }\n datepicker.onmouseleave = () => {\n this.isMouseInsideCalendar.set(false)\n }\n }\n if (isAnimationComplete || !this.showTimepicker()) {\n return\n }\n this.setupTimepicker()\n },\n }\n\n if (this._airDatepickerInstance()) {\n if (this._airDatepickerInstance()?.visible) {\n this._airDatepickerInstance()?.update(airDatepickerOpts)\n } else {\n this._airDatepickerInstance()?.update(airDatepickerOpts, { silent: true })\n }\n\n if (!targetDate) {\n this._airDatepickerInstance()?.setFocusDate(false)\n this._airDatepickerInstance()?.clear({ silent: true })\n } else {\n this._airDatepickerInstance()?.selectDate(targetDate, { updateTime: true })\n }\n } else {\n this._airDatepickerInstance.set(new AirDatepicker(this._inputForDate()?.nativeElement, airDatepickerOpts))\n }\n\n if (this.showInline()) {\n this.setupTimepicker()\n }\n }\n }\n\n onChangeText($event: Event): void {\n const value = ($event.target as HTMLInputElement)?.value\n if (value) {\n // TODO: check format for DateRange\n if (value.length === this.valueFormat().length && isMatch(value, this.valueFormat())) {\n this.onChangedHandler(this.setupInputStringToDate(value).toISOString())\n }\n } else {\n this.onChangedHandler(value)\n }\n }\n\n override onBlurHandler() {\n super.onBlurHandler()\n\n if (this.isMouseOutsideCalendar() && this._airDatepickerInstance()?.visible) {\n this._airDatepickerInstance()?.hide()\n }\n }\n\n setupInputStringToDate(value: string) {\n let targetDate = parse(value, this.valueFormat(), new Date())\n if (!this.showTimepicker()) {\n targetDate = this.dateToUtc(targetDate)\n }\n return targetDate\n }\n\n override onChangedHandler(value: string | DateRange | null): void {\n let targetDate = value\n const currentValue = this._value()\n if (typeof targetDate === 'string' && (!currentValue || typeof currentValue === 'string')) {\n if (!this.showTimepicker() && targetDate) {\n // remove time from date\n targetDate = `${targetDate.split('T')[0]}T00:00:00.000Z`\n } else if (this.showOnlyTimepicker() && currentValue && targetDate) {\n targetDate = `${currentValue.split('T')[0]}T${targetDate.split('T')[1]}`\n }\n } else if (\n this.rangeSelection() &&\n typeof targetDate === 'object' &&\n (currentValue === null || typeof currentValue === 'object')\n ) {\n if (!this.showTimepicker() && targetDate?.dateFrom) {\n // remove time from date\n targetDate.dateFrom = `${targetDate.dateFrom.split('T')[0]}T00:00:00.000Z`\n } else if (this.showOnlyTimepicker() && currentValue?.dateFrom && targetDate?.dateFrom) {\n targetDate.dateFrom = `${currentValue?.dateFrom.split('T')[0]}T${targetDate.dateFrom.split('T')[1]}`\n }\n if (!this.showTimepicker() && targetDate?.dateTo) {\n // remove time from date\n targetDate.dateTo = `${targetDate.dateTo.split('T')[0]}T00:00:00.000Z`\n } else if (this.showOnlyTimepicker() && currentValue?.dateTo && targetDate?.dateTo) {\n targetDate.dateTo = `${currentValue?.dateTo.split('T')[0]}T${targetDate.dateTo.split('T')[1]}`\n }\n }\n\n if (JSON.stringify(currentValue) === JSON.stringify(targetDate)) {\n return\n }\n\n this._value.set(targetDate)\n }\n\n onHideCalendar(): void {\n const valueInput: string = this._inputForDate()?.nativeElement.value\n let value: string | DateRange = valueInput\n if (this.rangeSelection()) {\n value = { dateFrom: '', dateTo: '' }\n const [dateFrom, dateTo] = valueInput.split(this.multipleDatesSeparator())\n value.dateFrom = dateFrom ?? ''\n value.dateTo = dateTo ?? ''\n if (!value.dateFrom || !isMatch(value.dateFrom, this.valueFormat())) {\n value.dateFrom = null\n } else {\n value.dateFrom = this.setupInputStringToDate(value.dateFrom).toISOString()\n }\n if (!value.dateTo || !isMatch(value.dateTo, this.valueFormat())) {\n value.dateTo = null\n } else {\n value.dateTo = this.setupInputStringToDate(value.dateTo).toISOString()\n }\n this.onChangedHandler(value)\n } else if (isMatch(value, this.valueFormat())) {\n this.onChangedHandler(this.setupInputStringToDate(value).toISOString())\n } else {\n this.onChangedHandler(null)\n }\n\n if (this.formControl()?.getRawValue() !== this._value()) {\n super.onChangedHandler(this._value())\n } else if (this.onTouched) {\n this.onTouched()\n }\n\n this.onBlurHandler()\n }\n\n formatDate(val: string | DateRange | null): string {\n if (val && typeof val === 'string') {\n return format(val, this.valueFormat())\n }\n if (val && typeof val === 'object') {\n let dateFromFormat = ''\n let dateToFormat = ''\n if (val.dateFrom) {\n dateFromFormat = format(val.dateFrom, this.valueFormat())\n }\n if (val.dateTo) {\n dateToFormat = format(val.dateTo, this.valueFormat())\n }\n return `${dateFromFormat}${this.multipleDatesSeparator()}${dateToFormat}`\n }\n return ''\n }\n\n openDatePicker() {\n if (this._inputForDate()?.nativeElement) {\n this._inputForDate()?.nativeElement.focus()\n }\n }\n\n interceptInputInteraction($event: Event) {\n if (!this.isReadonly()) return\n\n $event.stopPropagation()\n $event.stopImmediatePropagation()\n $event.preventDefault()\n }\n\n getLocale(): AirDatepickerLocale {\n switch (this._activeLanguage()?.toLowerCase()) {\n case 'en':\n return (en as any).default || en\n case 'it':\n return (it as any).default || it\n case 'fr':\n return (fr as any).default || fr\n default:\n return (en as any).default || en\n }\n }\n\n onCancel(): void {\n this._inputForDate()?.nativeElement.blur()\n }\n\n private dateToUtc(date: Date): Date {\n // convert to UTC time removing the timezone\n return new Date(date.getTime() - date.getTimezoneOffset() * 60000)\n }\n\n private setCalendarPosition() {\n const windowInnerHeight = window.innerHeight\n const inputBoundingClientRect = this._inputForDate()?.nativeElement.getBoundingClientRect()\n const diff = windowInnerHeight - inputBoundingClientRect.height - inputBoundingClientRect.top - 239\n if (diff >= 0) {\n this.targetPosition.set('bottom left')\n } else {\n this.targetPosition.set('top left')\n }\n }\n\n private setupTimepicker() {\n const timepicker = document.getElementsByClassName('air-datepicker-time')?.[0]\n if (timepicker) {\n const inputs = timepicker.getElementsByTagName('input')\n for (const input of Array.from(inputs)) {\n input.setAttribute('type', 'number')\n input.setAttribute('maxLength', '2')\n input.className = 'form-control'\n input.onmouseup = (evt) => {\n evt.stopImmediatePropagation()\n }\n input.onblur = () => {\n if (this.isMouseOutsideCalendar()) {\n this._airDatepickerInstance()?.hide()\n }\n }\n }\n }\n }\n}\n","<div class=\"mb-3\">\n <label\n [htmlFor]=\"componentId()\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <div\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n class=\"input-date-container\"\n >\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [autocomplete]=\"'off'\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [class.with-button-calendar]=\"!hasNoContent()\"\n [disabled]=\"_isDisabled()\"\n [hidden]=\"showInline()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"inputValueString()\"\n (blur)=\"onBlurHandler()\"\n (focus)=\"interceptInputInteraction($event)\"\n (input)=\"onChangeText($event)\"\n (mouseenter)=\"isMouseInsideCalendar.set(true)\"\n (mouseleave)=\"isMouseInsideCalendar.set(false)\"\n (search)=\"onCancel()\"\n #inputForDate\n class=\"form-control\"\n type=\"search\"\n />\n <button\n [attr.required]=\"getIsRequiredControl()\"\n [class.border-danger]=\"_showErrors()\"\n [class.border-success]=\"_showSuccess()\"\n [hidden]=\"showInline() || hasNoContent() || _isDisabled()\"\n [ngClass]=\"buttonClass()\"\n (click)=\"_ngControl()?.disabled ? null : openDatePicker()\"\n #calendarButton\n aria-label=\"calendar-button\"\n class=\"btn btn-outline-secondary btn-outline-calendar\"\n type=\"button\"\n >\n <ng-content></ng-content>\n </button>\n </div>\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n *ngIf=\"helpMessage()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgDA;;;;;;;;;;;AAWG;AACG,MAAO,kBAAmB,SAAQ,kBAA6C,CAAA;AAqGnF,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AArGT;;;;;AAKG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAS,YAAY,CAAC;AAExC;;;;;AAKG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAS,OAAO,CAAC;AAEnC;;;;AAIG;AACH,QAAA,IAAA,CAAA,sBAAsB,GAAG,KAAK,CAAqB,SAAS,CAAC;AAE7D;;AAEG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAU,KAAK,CAAC;AAElC;;AAEG;AACH,QAA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QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,wrEAoEA,EDvBY,MAAA,EAAA,CAAA,mzEAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,aAAa,EAAE,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,IAAI,6FAAE,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAe3B,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBApB9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EAGX,SAAA,EAAA,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,wBAAwB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAA,OAAA,EAClG,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,EACtB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,wrEAAA,EAAA,MAAA,EAAA,CAAA,mzEAAA,CAAA,EAAA;wDA4EnC,wBAAwB,EAAA,CAAA;sBAAnC;;;AE1HH;;AAEG;;;;"}
@@ -0,0 +1,54 @@
1
+ import { NgIf, NgClass } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { input, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
+ import { TranslocoPipe } from '@jsverse/transloco';
7
+ import { QuangBaseComponent } from 'quang/components/shared';
8
+
9
+ /**
10
+ * Input component that handles all the types declared in {@link InputType}
11
+ * @property {boolean} resizable just for textarea {@link InputType}
12
+ */
13
+ class QuangInputComponent extends QuangBaseComponent {
14
+ constructor() {
15
+ super();
16
+ this.componentType = input.required();
17
+ this.maxLengthText = input(null);
18
+ this.minLengthText = input(null);
19
+ this.minNumber = input(undefined);
20
+ this.maxNumber = input(undefined);
21
+ this.componentStep = input(1);
22
+ this.resizable = input(true);
23
+ toObservable(this.componentType)
24
+ .pipe(takeUntilDestroyed(this.destroyRef))
25
+ .subscribe(() => {
26
+ this.setupFormControl();
27
+ });
28
+ }
29
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QuangInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
30
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.5", type: QuangInputComponent, isStandalone: true, selector: "quang-input", inputs: { componentType: { classPropertyName: "componentType", publicName: "componentType", isSignal: true, isRequired: true, transformFunction: null }, maxLengthText: { classPropertyName: "maxLengthText", publicName: "maxLengthText", isSignal: true, isRequired: false, transformFunction: null }, minLengthText: { classPropertyName: "minLengthText", publicName: "minLengthText", isSignal: true, isRequired: false, transformFunction: null }, minNumber: { classPropertyName: "minNumber", publicName: "minNumber", isSignal: true, isRequired: false, transformFunction: null }, maxNumber: { classPropertyName: "maxNumber", publicName: "maxNumber", isSignal: true, isRequired: false, transformFunction: null }, componentStep: { classPropertyName: "componentStep", publicName: "componentStep", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
31
+ {
32
+ provide: NG_VALUE_ACCESSOR,
33
+ useExisting: forwardRef(() => QuangInputComponent),
34
+ multi: true,
35
+ },
36
+ ], usesInheritance: true, ngImport: i0, template: "<div\n *ngIf=\"componentType()\"\n class=\"mb-3\"\n>\n <label\n [htmlFor]=\"componentId()\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <ng-container *ngIf=\"componentType() !== 'textarea'\">\n <input\n [attr.maxLength]=\"maxLengthText()\"\n [attr.minLength]=\"minLengthText()\"\n [attr.required]=\"getIsRequiredControl()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [max]=\"maxNumber()\"\n [min]=\"minNumber()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [step]=\"componentStep()\"\n [tabIndex]=\"componentTabIndex()\"\n [type]=\"componentType()\"\n [value]=\"_value()\"\n (blur)=\"onBlurHandler()\"\n (input)=\"onChangedEventHandler($event)\"\n autocomplete=\"off\"\n class=\"form-control\"\n />\n </ng-container>\n <ng-container *ngIf=\"componentType() === 'textarea'\">\n <textarea\n [attr.maxLength]=\"maxLengthText()\"\n [attr.minLength]=\"minLengthText()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [class.no-resize]=\"!resizable()\"\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_value()\"\n (blur)=\"onBlurHandler()\"\n (input)=\"onChangedEventHandler($event)\"\n class=\"form-control\"\n ></textarea>\n </ng-container>\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n *ngIf=\"helpMessage()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n</div>\n", styles: ["input::-webkit-search-cancel-button{-webkit-appearance:none;height:.75rem;width:.75rem;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 3 1024 1024' width='12' height='12' fill='currentColor'%3E%3Cpath d='M9 1018q5 4 10.5 6.5 5.5 2.5 11.5 2.5 6 0 11.5-2.5 5.5-2.5 10.5-6.5l459-459 459 459q5 4 10.5 6.5 5.5 2.5 11.5 2.5 6 0 11.5-2.5 5.5-2.5 10.5-6.5 9-9 9-22 0-13-9-22l-459-459 459-459q9-9 9-22 0-13-9-22-9-9-22-9-13 0-22 9l-459 459-459-459q-9-9-22-9-13 0-22 9-9 9-9 22 0 13 9 22l459 459-459 459q-9 9-9 22 0 13 9 22l0 0z'/%3E%3C/svg%3E%0A\");cursor:pointer}:host{display:block}.no-resize{resize:none}\n"], dependencies: [{ kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
37
+ }
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QuangInputComponent, decorators: [{
39
+ type: Component,
40
+ args: [{ selector: 'quang-input', providers: [
41
+ {
42
+ provide: NG_VALUE_ACCESSOR,
43
+ useExisting: forwardRef(() => QuangInputComponent),
44
+ multi: true,
45
+ },
46
+ ], imports: [TranslocoPipe, NgIf, NgClass], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"componentType()\"\n class=\"mb-3\"\n>\n <label\n [htmlFor]=\"componentId()\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <ng-container *ngIf=\"componentType() !== 'textarea'\">\n <input\n [attr.maxLength]=\"maxLengthText()\"\n [attr.minLength]=\"minLengthText()\"\n [attr.required]=\"getIsRequiredControl()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [max]=\"maxNumber()\"\n [min]=\"minNumber()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [step]=\"componentStep()\"\n [tabIndex]=\"componentTabIndex()\"\n [type]=\"componentType()\"\n [value]=\"_value()\"\n (blur)=\"onBlurHandler()\"\n (input)=\"onChangedEventHandler($event)\"\n autocomplete=\"off\"\n class=\"form-control\"\n />\n </ng-container>\n <ng-container *ngIf=\"componentType() === 'textarea'\">\n <textarea\n [attr.maxLength]=\"maxLengthText()\"\n [attr.minLength]=\"minLengthText()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [class.no-resize]=\"!resizable()\"\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_value()\"\n (blur)=\"onBlurHandler()\"\n (input)=\"onChangedEventHandler($event)\"\n class=\"form-control\"\n ></textarea>\n </ng-container>\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n *ngIf=\"helpMessage()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n</div>\n", styles: ["input::-webkit-search-cancel-button{-webkit-appearance:none;height:.75rem;width:.75rem;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 3 1024 1024' width='12' height='12' fill='currentColor'%3E%3Cpath d='M9 1018q5 4 10.5 6.5 5.5 2.5 11.5 2.5 6 0 11.5-2.5 5.5-2.5 10.5-6.5l459-459 459 459q5 4 10.5 6.5 5.5 2.5 11.5 2.5 6 0 11.5-2.5 5.5-2.5 10.5-6.5 9-9 9-22 0-13-9-22l-459-459 459-459q9-9 9-22 0-13-9-22-9-9-22-9-13 0-22 9l-459 459-459-459q-9-9-22-9-13 0-22 9-9 9-9 22 0 13 9 22l459 459-459 459q-9 9-9 22 0 13 9 22l0 0z'/%3E%3C/svg%3E%0A\");cursor:pointer}:host{display:block}.no-resize{resize:none}\n"] }]
47
+ }], ctorParameters: () => [] });
48
+
49
+ /**
50
+ * Generated bundle index. Do not edit.
51
+ */
52
+
53
+ export { QuangInputComponent };
54
+ //# sourceMappingURL=quang-components-input.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quang-components-input.mjs","sources":["../../../projects/quang/components/input/input.component.ts","../../../projects/quang/components/input/input.component.html","../../../projects/quang/components/input/quang-components-input.ts"],"sourcesContent":["import { NgClass, NgIf } from '@angular/common'\nimport { ChangeDetectionStrategy, Component, forwardRef, input } from '@angular/core'\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'\nimport { NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\n\nimport { QuangBaseComponent } from 'quang/components/shared'\n\nexport type InputType = 'text' | 'textarea' | 'password' | 'email' | 'number' | 'url' | 'search' | 'tel' | 'color'\n\n@Component({\n selector: 'quang-input',\n templateUrl: './input.component.html',\n styleUrl: './input.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => QuangInputComponent),\n multi: true,\n },\n ],\n imports: [TranslocoPipe, NgIf, NgClass],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * Input component that handles all the types declared in {@link InputType}\n * @property {boolean} resizable just for textarea {@link InputType}\n */\nexport class QuangInputComponent extends QuangBaseComponent<string | number> {\n componentType = input.required<InputType>()\n\n maxLengthText = input<number | null>(null)\n\n minLengthText = input<number | null>(null)\n\n minNumber = input<number | undefined>(undefined)\n\n maxNumber = input<number | undefined>(undefined)\n\n componentStep = input<number>(1)\n\n resizable = input(true)\n\n constructor() {\n super()\n toObservable(this.componentType)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.setupFormControl()\n })\n }\n}\n","<div\n *ngIf=\"componentType()\"\n class=\"mb-3\"\n>\n <label\n [htmlFor]=\"componentId()\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <ng-container *ngIf=\"componentType() !== 'textarea'\">\n <input\n [attr.maxLength]=\"maxLengthText()\"\n [attr.minLength]=\"minLengthText()\"\n [attr.required]=\"getIsRequiredControl()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [max]=\"maxNumber()\"\n [min]=\"minNumber()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [step]=\"componentStep()\"\n [tabIndex]=\"componentTabIndex()\"\n [type]=\"componentType()\"\n [value]=\"_value()\"\n (blur)=\"onBlurHandler()\"\n (input)=\"onChangedEventHandler($event)\"\n autocomplete=\"off\"\n class=\"form-control\"\n />\n </ng-container>\n <ng-container *ngIf=\"componentType() === 'textarea'\">\n <textarea\n [attr.maxLength]=\"maxLengthText()\"\n [attr.minLength]=\"minLengthText()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [class.no-resize]=\"!resizable()\"\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_value()\"\n (blur)=\"onBlurHandler()\"\n (input)=\"onChangedEventHandler($event)\"\n class=\"form-control\"\n ></textarea>\n </ng-container>\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n *ngIf=\"helpMessage()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAyBA;;;AAGG;AACG,MAAO,mBAAoB,SAAQ,kBAAmC,CAAA;AAe1E,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AAfT,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAa;AAE3C,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAgB,IAAI,CAAC;AAE1C,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAgB,IAAI,CAAC;AAE1C,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAqB,SAAS,CAAC;AAEhD,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAqB,SAAS,CAAC;AAEhD,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAS,CAAC,CAAC;AAEhC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;AAIrB,QAAA,YAAY,CAAC,IAAI,CAAC,aAAa;AAC5B,aAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC;aACxC,SAAS,CAAC,MAAK;YACd,IAAI,CAAC,gBAAgB,EAAE;AACzB,SAAC,CAAC;;8GArBK,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EA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