quang 19.0.28 → 19.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/auth/README.md +10 -0
  2. package/auth/index.d.ts +195 -9
  3. package/auth/mobile/index.d.ts +5 -1
  4. package/components/autocomplete/README.md +18 -0
  5. package/components/autocomplete/index.d.ts +67 -1
  6. package/components/checkbox/index.d.ts +15 -1
  7. package/components/date/index.d.ts +89 -1
  8. package/components/input/index.d.ts +19 -1
  9. package/components/paginator/index.d.ts +68 -5
  10. package/components/select/index.d.ts +32 -1
  11. package/components/shared/index.d.ts +112 -4
  12. package/components/table/index.d.ts +70 -1
  13. package/components/wysiwyg/index.d.ts +51 -1
  14. package/data-handling/index.d.ts +10 -0
  15. package/device/index.d.ts +14 -1
  16. package/fesm2022/quang-auth.mjs +18 -18
  17. package/fesm2022/quang-auth.mjs.map +1 -1
  18. package/fesm2022/quang-components-autocomplete.mjs +121 -24
  19. package/fesm2022/quang-components-autocomplete.mjs.map +1 -1
  20. package/fesm2022/quang-components-checkbox.mjs +3 -3
  21. package/fesm2022/quang-components-checkbox.mjs.map +1 -1
  22. package/fesm2022/quang-components-date.mjs +3 -3
  23. package/fesm2022/quang-components-date.mjs.map +1 -1
  24. package/fesm2022/quang-components-input.mjs +3 -3
  25. package/fesm2022/quang-components-input.mjs.map +1 -1
  26. package/fesm2022/quang-components-paginator.mjs +13 -13
  27. package/fesm2022/quang-components-paginator.mjs.map +1 -1
  28. package/fesm2022/quang-components-select.mjs +3 -3
  29. package/fesm2022/quang-components-select.mjs.map +1 -1
  30. package/fesm2022/quang-components-shared.mjs +25 -22
  31. package/fesm2022/quang-components-shared.mjs.map +1 -1
  32. package/fesm2022/quang-components-table.mjs +3 -3
  33. package/fesm2022/quang-components-table.mjs.map +1 -1
  34. package/fesm2022/quang-components-wysiwyg.mjs +3 -3
  35. package/fesm2022/quang-components-wysiwyg.mjs.map +1 -1
  36. package/fesm2022/quang-data-handling.mjs +54 -0
  37. package/fesm2022/quang-data-handling.mjs.map +1 -0
  38. package/fesm2022/quang-device.mjs +3 -3
  39. package/fesm2022/quang-device.mjs.map +1 -1
  40. package/fesm2022/quang-loader.mjs +6 -6
  41. package/fesm2022/quang-loader.mjs.map +1 -1
  42. package/fesm2022/quang-overlay-modal.mjs +3 -3
  43. package/fesm2022/quang-overlay-modal.mjs.map +1 -1
  44. package/fesm2022/quang-overlay-popover.mjs +8 -8
  45. package/fesm2022/quang-overlay-popover.mjs.map +1 -1
  46. package/fesm2022/quang-overlay-shared.mjs +9 -9
  47. package/fesm2022/quang-overlay-shared.mjs.map +1 -1
  48. package/fesm2022/quang-overlay-toast.mjs +6 -6
  49. package/fesm2022/quang-overlay-toast.mjs.map +1 -1
  50. package/fesm2022/quang-overlay-tooltip.mjs +7 -7
  51. package/fesm2022/quang-overlay-tooltip.mjs.map +1 -1
  52. package/fesm2022/quang-translation.mjs +6 -6
  53. package/fesm2022/quang-translation.mjs.map +1 -1
  54. package/forms/index.d.ts +51 -2
  55. package/index.d.ts +13 -9
  56. package/loader/index.d.ts +69 -4
  57. package/overlay/modal/index.d.ts +34 -1
  58. package/overlay/popover/index.d.ts +25 -1
  59. package/overlay/shared/index.d.ts +116 -3
  60. package/overlay/toast/index.d.ts +44 -2
  61. package/overlay/tooltip/index.d.ts +23 -2
  62. package/package.json +13 -9
  63. package/shared/index.d.ts +16 -1
  64. package/translation/index.d.ts +62 -4
  65. package/auth/auth-providers.d.ts +0 -39
  66. package/auth/auth.service.d.ts +0 -52
  67. package/auth/directives/has-at-least-one-role.directive.d.ts +0 -26
  68. package/auth/directives/has-every-role.directive.d.ts +0 -26
  69. package/auth/directives/is-authenticated.directive.d.ts +0 -14
  70. package/auth/directives/is-not-authenticated.directive.d.ts +0 -14
  71. package/auth/guards/index.d.ts +0 -2
  72. package/auth/guards/is-allowed.guard.d.ts +0 -2
  73. package/auth/guards/is-authenticated.guard.d.ts +0 -2
  74. package/auth/logout-on-error.interceptor.d.ts +0 -9
  75. package/auth/mobile/mobile-auth-feature.d.ts +0 -2
  76. package/auth/token-storage/index.d.ts +0 -3
  77. package/auth/token-storage/local-storage-feature.d.ts +0 -2
  78. package/auth/token-storage/memory-storage-feature.d.ts +0 -12
  79. package/auth/token-storage/session-storage-feature.d.ts +0 -2
  80. package/components/autocomplete/autocomplete.component.d.ts +0 -43
  81. package/components/checkbox/checkbox.component.d.ts +0 -11
  82. package/components/date/date.component.d.ts +0 -85
  83. package/components/input/input.component.d.ts +0 -15
  84. package/components/paginator/paginator-language.service.d.ts +0 -10
  85. package/components/paginator/paginator.component.d.ts +0 -30
  86. package/components/paginator/paginator.module.d.ts +0 -7
  87. package/components/paginator/paginator.service.d.ts +0 -6
  88. package/components/paginator/paginatorIntl.d.ts +0 -12
  89. package/components/select/select.component.d.ts +0 -29
  90. package/components/shared/ErrorData.d.ts +0 -4
  91. package/components/shared/makeId.d.ts +0 -1
  92. package/components/shared/option-list/option-list.component.d.ts +0 -53
  93. package/components/shared/quang-base-component.directive.d.ts +0 -50
  94. package/components/table/table.component.d.ts +0 -66
  95. package/components/wysiwyg/wysiwyg.component.d.ts +0 -46
  96. package/device/resize-observable.service.d.ts +0 -11
  97. package/forms/form-group-model.d.ts +0 -18
  98. package/forms/validators.d.ts +0 -43
  99. package/loader/loader-providers.d.ts +0 -23
  100. package/loader/loader.component.d.ts +0 -23
  101. package/loader/loader.interceptor.d.ts +0 -10
  102. package/loader/loader.service.d.ts +0 -9
  103. package/overlay/modal/modal.component.d.ts +0 -29
  104. package/overlay/popover/popover.component.d.ts +0 -13
  105. package/overlay/popover/popover.directive.d.ts +0 -11
  106. package/overlay/shared/CustomViewportRuler.d.ts +0 -63
  107. package/overlay/shared/quang-base-overlay.component.d.ts +0 -9
  108. package/overlay/shared/quang-base-overlay.directive.d.ts +0 -44
  109. package/overlay/toast/toast.component.d.ts +0 -13
  110. package/overlay/toast/toast.service.d.ts +0 -27
  111. package/overlay/tooltip/tooltip.component.d.ts +0 -11
  112. package/overlay/tooltip/tooltip.directive.d.ts +0 -11
  113. package/shared/intercept-utils.d.ts +0 -13
  114. package/translation/translation-loader.service.d.ts +0 -10
  115. package/translation/translation-providers.d.ts +0 -28
  116. package/translation/translation.service.d.ts +0 -15
  117. package/translation/translations.tokens.d.ts +0 -5
@@ -1,9 +1,10 @@
1
- import { NgClass, NgIf } from '@angular/common';
1
+ import { NgClass, NgStyle } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { input, viewChild, signal, computed, output, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { input, viewChild, signal, computed, output, effect, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
4
4
  import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
5
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
6
  import { TranslocoPipe } from '@jsverse/transloco';
7
+ import { QuangTooltipDirective } from 'quang/overlay/tooltip';
7
8
  import { Subject, debounceTime, distinctUntilChanged } from 'rxjs';
8
9
  import { QuangBaseComponent, OptionListParentType, QuangOptionListComponent } from 'quang/components/shared';
9
10
 
@@ -25,14 +26,22 @@ class QuangAutocompleteComponent extends QuangBaseComponent {
25
26
  this.selectOptions = input.required();
26
27
  this.translateValue = input(true);
27
28
  this.scrollBehaviorOnOpen = input('smooth');
28
- this.optionList = viewChild('optionList');
29
29
  /**
30
30
  * Only emits the value without saving it in ngControl
31
31
  */
32
32
  this.emitOnly = input(false);
33
+ this.multiple = input(false);
34
+ /**
35
+ * Set the maximum length in characters of the single chip.
36
+ */
37
+ this.chipMaxLength = input(0);
38
+ this.multiSelectDisplayMode = input('vertical');
39
+ this.optionList = viewChild('optionList');
33
40
  this._showOptions = signal(null);
34
41
  this._inputValue = signal('');
35
42
  this._optionHideTimeout = signal(undefined);
43
+ this._chipList = signal([]);
44
+ this._selectedOptions = signal([]);
36
45
  this.inputValue$ = new Subject();
37
46
  this.selectOptionsChange = toObservable(this.selectOptions)
38
47
  .pipe(takeUntilDestroyed())
@@ -43,7 +52,12 @@ class QuangAutocompleteComponent extends QuangBaseComponent {
43
52
  });
44
53
  this._filteredOptions = computed(() => {
45
54
  const text = this._inputValue();
46
- return text?.length ? this.filterOptions(text) : this.selectOptions();
55
+ if (this.multiple()) {
56
+ return this.filterOptions(text).filter((x) => !this._chipList().some((chip) => chip === x.value));
57
+ }
58
+ else {
59
+ return text?.length ? this.filterOptions(text) : this.selectOptions();
60
+ }
47
61
  });
48
62
  this.selectedOption = output();
49
63
  this.searchTextChange = output();
@@ -51,6 +65,40 @@ class QuangAutocompleteComponent extends QuangBaseComponent {
51
65
  this.internalFilterOptions = input(true);
52
66
  this.ParentType = OptionListParentType.AUTOCOMPLETE;
53
67
  this.formValueChange$ = undefined;
68
+ this.selectInput = viewChild('selectInput');
69
+ this.chipContainer = viewChild('chipContainer');
70
+ this.autocompleteContainer = viewChild('autocompleteContainer');
71
+ this.inputHeight = signal(0);
72
+ this.onChangeSelectInput = effect(() => {
73
+ const selectInput = this.selectInput();
74
+ if (selectInput) {
75
+ this.inputHeight.set(selectInput?.nativeElement?.getBoundingClientRect().height);
76
+ selectInput.nativeElement.addEventListener('keydown', (e) => {
77
+ if (this.multiple() && this._chipList().length > 0 && !this._inputValue()?.length && e.key === 'Backspace') {
78
+ e.preventDefault();
79
+ // this.deleteChip(this._chipList()[this._chipList().length - 1])
80
+ const chipContainer = this.chipContainer()?.nativeElement;
81
+ if (chipContainer) {
82
+ const chips = chipContainer.querySelectorAll('.chip button.btn-chip');
83
+ if (chips.length > 0) {
84
+ const focusChip = chips[chips.length - 1];
85
+ focusChip.focus();
86
+ focusChip.addEventListener('keydown', (event) => {
87
+ if (event.key === 'Backspace') {
88
+ event.preventDefault();
89
+ this.deleteChip(this._chipList()[this._chipList().length - 1]);
90
+ selectInput.nativeElement.focus();
91
+ }
92
+ else {
93
+ event.preventDefault();
94
+ }
95
+ });
96
+ }
97
+ }
98
+ }
99
+ });
100
+ }
101
+ });
54
102
  this.inputValue$
55
103
  .pipe(takeUntilDestroyed(), debounceTime(this.searchTextDebounce()), distinctUntilChanged())
56
104
  .subscribe((value) => {
@@ -61,8 +109,9 @@ class QuangAutocompleteComponent extends QuangBaseComponent {
61
109
  }
62
110
  }
63
111
  this._inputValue.set(value?.toString() || '');
64
- if (!this._inputValue()?.length && !this.emitOnly())
112
+ if (!this._inputValue()?.length && !this.emitOnly() && !this.multiple()) {
65
113
  this._ngControl()?.control?.patchValue(null);
114
+ }
66
115
  });
67
116
  toObservable(this._showOptions)
68
117
  .pipe(takeUntilDestroyed())
@@ -108,8 +157,9 @@ class QuangAutocompleteComponent extends QuangBaseComponent {
108
157
  }
109
158
  filterOptions(value) {
110
159
  const options = this.selectOptions();
111
- if (this.internalFilterOptions())
160
+ if (this.internalFilterOptions()) {
112
161
  return options.filter((x) => x.label.toLowerCase().includes(value.toLowerCase()));
162
+ }
113
163
  return options;
114
164
  }
115
165
  onChangedHandler(value) {
@@ -117,26 +167,42 @@ class QuangAutocompleteComponent extends QuangBaseComponent {
117
167
  this.setInputValue();
118
168
  }
119
169
  onValueChange(value, hideOptions = true) {
120
- this.onChangedHandler(value);
121
- if (hideOptions) {
122
- this.hideOptionVisibility();
170
+ if (this.multiple()) {
171
+ this.onSelectValue(value);
172
+ this.onChangedHandler(this._chipList());
173
+ if (this._chipList().some((x) => x === value)) {
174
+ this.inputValue$.next('');
175
+ }
176
+ }
177
+ else {
178
+ this.onChangedHandler(value);
179
+ if (hideOptions) {
180
+ this.hideOptionVisibility();
181
+ }
182
+ this.selectedOption.emit(value);
123
183
  }
124
- this.selectedOption.emit(value);
125
184
  }
126
185
  checkInputValue() {
127
186
  const option = this.selectOptions().find((x) => x.label.toLowerCase() === this._inputValue()?.toLowerCase());
128
- if (option?.value === this._value())
129
- return;
130
- if (option) {
131
- this.onChangedHandler(option.value ?? '');
132
- }
133
- else if (!this.syncFormWithText()) {
134
- this.onChangedHandler('');
187
+ if (!this.multiple()) {
188
+ if (option?.value === this._value())
189
+ return;
190
+ if (option) {
191
+ this.onChangedHandler(option.value ?? '');
192
+ }
193
+ else if (!this.syncFormWithText()) {
194
+ this.onChangedHandler('');
195
+ }
135
196
  }
136
197
  }
137
198
  writeValue(val) {
138
199
  super.writeValue(val);
139
200
  this.setInputValue(true);
201
+ if (Array.isArray(val)) {
202
+ val.forEach((x) => {
203
+ this.onSelectValue(x);
204
+ });
205
+ }
140
206
  }
141
207
  onBlurInput(event) {
142
208
  if (event?.relatedTarget?.id !== this.optionList()?.optionListContainer()?.nativeElement?.id)
@@ -145,7 +211,7 @@ class QuangAutocompleteComponent extends QuangBaseComponent {
145
211
  onBlurHandler() {
146
212
  setTimeout(() => {
147
213
  this.hideOptionVisibility();
148
- if (!this._inputValue()?.length && !this.emitOnly()) {
214
+ if (!this._inputValue()?.length && !this.emitOnly() && !this.multiple()) {
149
215
  this._ngControl()?.control?.patchValue(null);
150
216
  }
151
217
  super.onBlurHandler();
@@ -160,8 +226,39 @@ class QuangAutocompleteComponent extends QuangBaseComponent {
160
226
  if (!this.syncFormWithText())
161
227
  this.inputValue$.next(this._inputValue() ?? '');
162
228
  }
163
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: QuangAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
164
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.14", type: QuangAutocompleteComponent, isStandalone: true, selector: "quang-autocomplete", inputs: { syncFormWithText: { classPropertyName: "syncFormWithText", publicName: "syncFormWithText", isSignal: true, isRequired: false, transformFunction: null }, optionListMaxHeight: { classPropertyName: "optionListMaxHeight", publicName: "optionListMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, selectOptions: { classPropertyName: "selectOptions", publicName: "selectOptions", isSignal: true, isRequired: true, transformFunction: null }, translateValue: { classPropertyName: "translateValue", publicName: "translateValue", isSignal: true, isRequired: false, transformFunction: null }, scrollBehaviorOnOpen: { classPropertyName: "scrollBehaviorOnOpen", publicName: "scrollBehaviorOnOpen", isSignal: true, isRequired: false, transformFunction: null }, emitOnly: { classPropertyName: "emitOnly", publicName: "emitOnly", isSignal: true, isRequired: false, transformFunction: null }, searchTextDebounce: { classPropertyName: "searchTextDebounce", publicName: "searchTextDebounce", isSignal: true, isRequired: false, transformFunction: null }, internalFilterOptions: { classPropertyName: "internalFilterOptions", publicName: "internalFilterOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedOption: "selectedOption", searchTextChange: "searchTextChange" }, providers: [
229
+ getDescription(chip) {
230
+ const valueChip = this.selectOptions().find((x) => x.value === chip);
231
+ return valueChip ? valueChip.label.toString() : '';
232
+ }
233
+ onSelectValue(value) {
234
+ const newChip = this.selectOptions().find((x) => x.value === value);
235
+ if (newChip && !this._chipList().some((x) => x === newChip?.value)) {
236
+ this.createChipList(newChip);
237
+ this._selectedOptions.update((list) => [...list, newChip]);
238
+ }
239
+ }
240
+ /**
241
+ * remove chip from chips list
242
+ * @param chipValue chip to delete
243
+ */
244
+ deleteChip(chipValue) {
245
+ const stringChipValue = chipValue?.toString();
246
+ const i = this._chipList()?.findIndex((x) => x.toString() === stringChipValue);
247
+ if (i >= 0) {
248
+ const currentList = this._chipList();
249
+ if (Array.isArray(currentList) && currentList.length > 0) {
250
+ this._chipList.update((list) => list.filter((_, index) => index !== i));
251
+ this.onChangedHandler(this._chipList());
252
+ }
253
+ }
254
+ }
255
+ createChipList(chip) {
256
+ if (chip) {
257
+ this._chipList.update((list) => [...list, chip.value]);
258
+ }
259
+ }
260
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
261
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: QuangAutocompleteComponent, isStandalone: true, selector: "quang-autocomplete", inputs: { syncFormWithText: { classPropertyName: "syncFormWithText", publicName: "syncFormWithText", isSignal: true, isRequired: false, transformFunction: null }, optionListMaxHeight: { classPropertyName: "optionListMaxHeight", publicName: "optionListMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, selectOptions: { classPropertyName: "selectOptions", publicName: "selectOptions", isSignal: true, isRequired: true, transformFunction: null }, translateValue: { classPropertyName: "translateValue", publicName: "translateValue", isSignal: true, isRequired: false, transformFunction: null }, scrollBehaviorOnOpen: { classPropertyName: "scrollBehaviorOnOpen", publicName: "scrollBehaviorOnOpen", isSignal: true, isRequired: false, transformFunction: null }, emitOnly: { classPropertyName: "emitOnly", publicName: "emitOnly", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, chipMaxLength: { classPropertyName: "chipMaxLength", publicName: "chipMaxLength", isSignal: true, isRequired: false, transformFunction: null }, multiSelectDisplayMode: { classPropertyName: "multiSelectDisplayMode", publicName: "multiSelectDisplayMode", isSignal: true, isRequired: false, transformFunction: null }, searchTextDebounce: { classPropertyName: "searchTextDebounce", publicName: "searchTextDebounce", isSignal: true, isRequired: false, transformFunction: null }, internalFilterOptions: { classPropertyName: "internalFilterOptions", publicName: "internalFilterOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedOption: "selectedOption", searchTextChange: "searchTextChange" }, providers: [
165
262
  {
166
263
  provide: NG_VALUE_ACCESSOR,
167
264
  useExisting: forwardRef(() => QuangAutocompleteComponent),
@@ -171,11 +268,11 @@ class QuangAutocompleteComponent extends QuangBaseComponent {
171
268
  provide: QuangOptionListComponent,
172
269
  multi: false,
173
270
  },
174
- ], viewQueries: [{ propertyName: "optionList", first: true, predicate: ["optionList"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"autocomplete-container\">\n <label\n [htmlFor]=\"componentId()\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled() || isReadonly()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_inputValue()\"\n (blur)=\"onBlurInput($event)\"\n (input)=\"onChangeInput($event)\"\n (mousedown)=\"showOptionVisibility()\"\n #selectInput\n autocomplete=\"off\"\n class=\"form-control\"\n type=\"text\"\n />\n <quang-option-list\n [_isDisabled]=\"_isDisabled()\"\n [_value]=\"_value()\"\n [componentClass]=\"componentClass()\"\n [componentLabel]=\"componentLabel()\"\n [componentTabIndex]=\"componentTabIndex()\"\n [nullOption]=\"false\"\n [optionListMaxHeight]=\"optionListMaxHeight()\"\n [parentID]=\"componentId()\"\n [parentType]=\"ParentType\"\n [scrollBehaviorOnOpen]=\"scrollBehaviorOnOpen()\"\n [selectButtonRef]=\"selectInput\"\n [selectOptions]=\"_filteredOptions()\"\n [translateValue]=\"translateValue()\"\n (blurHandler)=\"onBlurOptionList($event)\"\n (changedHandler)=\"onValueChange($event)\"\n *ngIf=\"_showOptions()\"\n #optionList\n selectionMode=\"single\"\n ></quang-option-list>\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: [":host{display:block}.autocomplete-container{margin-bottom:1rem;position:relative}\n"], dependencies: [{ kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QuangOptionListComponent, selector: "quang-option-list", inputs: ["selectionMode", "optionListMaxHeight", "selectOptions", "selectButtonRef", "_value", "_isDisabled", "componentClass", "componentLabel", "componentTabIndex", "translateValue", "nullOption", "scrollBehaviorOnOpen", "parentType", "parentID"], outputs: ["changedHandler", "blurHandler"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
271
+ ], viewQueries: [{ propertyName: "optionList", first: true, predicate: ["optionList"], descendants: true, isSignal: true }, { propertyName: "selectInput", first: true, predicate: ["selectInput"], descendants: true, isSignal: true }, { propertyName: "chipContainer", first: true, predicate: ["chipContainer"], descendants: true, isSignal: true }, { propertyName: "autocompleteContainer", first: true, predicate: ["autocompleteContainer"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n [ngStyle]=\"{ '--chip-max-length': chipMaxLength() ? chipMaxLength() + 'ch' : 'none' }\"\n #autocompleteContainer\n class=\"autocomplete-container\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n }\n <div\n [ngClass]=\"multiSelectDisplayMode() === 'horizontal' ? 'horizontal form-control' : ''\"\n #chipContainer\n class=\"container-wrap\"\n >\n @if (multiple() && _chipList().length > 0) {\n @for (chip of _chipList(); track $index) {\n @if (getDescription(chip)) {\n <div\n [quangTooltip]=\"chipMaxLength() ? getDescription(chip) : ''\"\n class=\"chip chip-hover\"\n >\n <p [ngClass]=\"{ 'm-0': isReadonly() || _isDisabled() }\">\n {{ getDescription(chip) }}\n </p>\n @if (!isReadonly() && !_isDisabled()) {\n <button\n [tabIndex]=\"$index + 1\"\n (click)=\"deleteChip(chip)\"\n class=\"btn btn-chip\"\n type=\"button\"\n >\n <svg\n class=\"ionicon\"\n fill=\"currentColor\"\n height=\"24\"\n viewBox=\"0 0 512 512\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M368 368L144 144M368 144L144 368\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"32\"\n />\n </svg>\n </button>\n }\n </div>\n }\n }\n }\n\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [class.form-control]=\"multiSelectDisplayMode() !== 'horizontal'\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled() || isReadonly()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_inputValue()\"\n (blur)=\"onBlurInput($event)\"\n (input)=\"onChangeInput($event)\"\n (mousedown)=\"showOptionVisibility()\"\n #selectInput\n autocomplete=\"off\"\n type=\"text\"\n />\n </div>\n @if (_showOptions()) {\n <quang-option-list\n [_isDisabled]=\"_isDisabled()\"\n [_value]=\"_value()\"\n [componentClass]=\"componentClass()\"\n [componentLabel]=\"componentLabel()\"\n [componentTabIndex]=\"componentTabIndex()\"\n [nullOption]=\"false\"\n [optionListMaxHeight]=\"optionListMaxHeight()\"\n [parentID]=\"componentId()\"\n [parentType]=\"ParentType\"\n [scrollBehaviorOnOpen]=\"scrollBehaviorOnOpen()\"\n [selectButtonRef]=\"autocompleteContainer\"\n [selectOptions]=\"_filteredOptions()\"\n [translateValue]=\"translateValue()\"\n (blurHandler)=\"onBlurOptionList($event)\"\n (changedHandler)=\"onValueChange($event)\"\n #optionList\n selectionMode=\"single\"\n />\n }\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n", styles: [":host{display:block;--chip-max-length: none}.autocomplete-container{margin-bottom:1rem;position:relative}.chip:has(.btn-chip:disabled):hover{filter:unset;cursor:unset}.container-wrap{display:flex;flex-wrap:wrap;gap:.5rem}.container-wrap.horizontal{display:flex}.container-wrap.horizontal .chip-container{max-width:70%;margin-bottom:0;margin-left:.5rem;flex-wrap:nowrap;white-space:nowrap;overflow-x:auto;position:absolute;align-items:center}.container-wrap.horizontal .chip-container .chip{white-space:nowrap}.container-wrap.horizontal input{min-width:30%;flex:1 1 0;width:auto;border:none}.container-wrap.horizontal input:focus-visible{outline:none}.chip{display:flex;justify-content:space-between;align-items:center;padding:.25rem .5rem;border-radius:16px;color:var(--bs-btn-color);background-color:rgba(var(--bs-primary-rgb),.1);border-width:1px;border-style:solid;border-color:var(--bs-primary-border-subtle);height:2rem}.chip p{margin:0;max-width:var(--chip-max-length);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.chip .btn-chip{text-align:end;padding:0;min-width:unset}.chip .btn-chip:hover{opacity:80%}.chip .btn-chip:active{border-color:transparent}.chip .btn-chip svg{color:var(--bs-primary);vertical-align:sub}.chip:has(.btn-chip:focus-visible){border-width:2px;filter:brightness(80%)}\n"], dependencies: [{ kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: QuangOptionListComponent, selector: "quang-option-list", inputs: ["selectionMode", "optionListMaxHeight", "selectOptions", "selectButtonRef", "_value", "_isDisabled", "componentClass", "componentLabel", "componentTabIndex", "translateValue", "nullOption", "scrollBehaviorOnOpen", "parentType", "parentID"], outputs: ["changedHandler", "blurHandler"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: QuangTooltipDirective, selector: "[quangTooltip]", inputs: ["quangTooltip", "showMethod"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
175
272
  }
176
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: QuangAutocompleteComponent, decorators: [{
273
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangAutocompleteComponent, decorators: [{
177
274
  type: Component,
178
- args: [{ selector: 'quang-autocomplete', imports: [TranslocoPipe, NgClass, NgIf, QuangOptionListComponent], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
275
+ args: [{ selector: 'quang-autocomplete', imports: [TranslocoPipe, NgClass, QuangOptionListComponent, NgStyle, QuangTooltipDirective], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
179
276
  {
180
277
  provide: NG_VALUE_ACCESSOR,
181
278
  useExisting: forwardRef(() => QuangAutocompleteComponent),
@@ -185,7 +282,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
185
282
  provide: QuangOptionListComponent,
186
283
  multi: false,
187
284
  },
188
- ], template: "<div class=\"autocomplete-container\">\n <label\n [htmlFor]=\"componentId()\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled() || isReadonly()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_inputValue()\"\n (blur)=\"onBlurInput($event)\"\n (input)=\"onChangeInput($event)\"\n (mousedown)=\"showOptionVisibility()\"\n #selectInput\n autocomplete=\"off\"\n class=\"form-control\"\n type=\"text\"\n />\n <quang-option-list\n [_isDisabled]=\"_isDisabled()\"\n [_value]=\"_value()\"\n [componentClass]=\"componentClass()\"\n [componentLabel]=\"componentLabel()\"\n [componentTabIndex]=\"componentTabIndex()\"\n [nullOption]=\"false\"\n [optionListMaxHeight]=\"optionListMaxHeight()\"\n [parentID]=\"componentId()\"\n [parentType]=\"ParentType\"\n [scrollBehaviorOnOpen]=\"scrollBehaviorOnOpen()\"\n [selectButtonRef]=\"selectInput\"\n [selectOptions]=\"_filteredOptions()\"\n [translateValue]=\"translateValue()\"\n (blurHandler)=\"onBlurOptionList($event)\"\n (changedHandler)=\"onValueChange($event)\"\n *ngIf=\"_showOptions()\"\n #optionList\n selectionMode=\"single\"\n ></quang-option-list>\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: [":host{display:block}.autocomplete-container{margin-bottom:1rem;position:relative}\n"] }]
285
+ ], template: "<div\n [ngStyle]=\"{ '--chip-max-length': chipMaxLength() ? chipMaxLength() + 'ch' : 'none' }\"\n #autocompleteContainer\n class=\"autocomplete-container\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n }\n <div\n [ngClass]=\"multiSelectDisplayMode() === 'horizontal' ? 'horizontal form-control' : ''\"\n #chipContainer\n class=\"container-wrap\"\n >\n @if (multiple() && _chipList().length > 0) {\n @for (chip of _chipList(); track $index) {\n @if (getDescription(chip)) {\n <div\n [quangTooltip]=\"chipMaxLength() ? getDescription(chip) : ''\"\n class=\"chip chip-hover\"\n >\n <p [ngClass]=\"{ 'm-0': isReadonly() || _isDisabled() }\">\n {{ getDescription(chip) }}\n </p>\n @if (!isReadonly() && !_isDisabled()) {\n <button\n [tabIndex]=\"$index + 1\"\n (click)=\"deleteChip(chip)\"\n class=\"btn btn-chip\"\n type=\"button\"\n >\n <svg\n class=\"ionicon\"\n fill=\"currentColor\"\n height=\"24\"\n viewBox=\"0 0 512 512\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M368 368L144 144M368 144L144 368\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"32\"\n />\n </svg>\n </button>\n }\n </div>\n }\n }\n }\n\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [class.form-control]=\"multiSelectDisplayMode() !== 'horizontal'\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled() || isReadonly()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_inputValue()\"\n (blur)=\"onBlurInput($event)\"\n (input)=\"onChangeInput($event)\"\n (mousedown)=\"showOptionVisibility()\"\n #selectInput\n autocomplete=\"off\"\n type=\"text\"\n />\n </div>\n @if (_showOptions()) {\n <quang-option-list\n [_isDisabled]=\"_isDisabled()\"\n [_value]=\"_value()\"\n [componentClass]=\"componentClass()\"\n [componentLabel]=\"componentLabel()\"\n [componentTabIndex]=\"componentTabIndex()\"\n [nullOption]=\"false\"\n [optionListMaxHeight]=\"optionListMaxHeight()\"\n [parentID]=\"componentId()\"\n [parentType]=\"ParentType\"\n [scrollBehaviorOnOpen]=\"scrollBehaviorOnOpen()\"\n [selectButtonRef]=\"autocompleteContainer\"\n [selectOptions]=\"_filteredOptions()\"\n [translateValue]=\"translateValue()\"\n (blurHandler)=\"onBlurOptionList($event)\"\n (changedHandler)=\"onValueChange($event)\"\n #optionList\n selectionMode=\"single\"\n />\n }\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n", styles: [":host{display:block;--chip-max-length: none}.autocomplete-container{margin-bottom:1rem;position:relative}.chip:has(.btn-chip:disabled):hover{filter:unset;cursor:unset}.container-wrap{display:flex;flex-wrap:wrap;gap:.5rem}.container-wrap.horizontal{display:flex}.container-wrap.horizontal .chip-container{max-width:70%;margin-bottom:0;margin-left:.5rem;flex-wrap:nowrap;white-space:nowrap;overflow-x:auto;position:absolute;align-items:center}.container-wrap.horizontal .chip-container .chip{white-space:nowrap}.container-wrap.horizontal input{min-width:30%;flex:1 1 0;width:auto;border:none}.container-wrap.horizontal input:focus-visible{outline:none}.chip{display:flex;justify-content:space-between;align-items:center;padding:.25rem .5rem;border-radius:16px;color:var(--bs-btn-color);background-color:rgba(var(--bs-primary-rgb),.1);border-width:1px;border-style:solid;border-color:var(--bs-primary-border-subtle);height:2rem}.chip p{margin:0;max-width:var(--chip-max-length);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.chip .btn-chip{text-align:end;padding:0;min-width:unset}.chip .btn-chip:hover{opacity:80%}.chip .btn-chip:active{border-color:transparent}.chip .btn-chip svg{color:var(--bs-primary);vertical-align:sub}.chip:has(.btn-chip:focus-visible){border-width:2px;filter:brightness(80%)}\n"] }]
189
286
  }], ctorParameters: () => [] });
190
287
 
191
288
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"quang-components-autocomplete.mjs","sources":["../../../projects/quang/components/autocomplete/autocomplete.component.ts","../../../projects/quang/components/autocomplete/autocomplete.component.html","../../../projects/quang/components/autocomplete/quang-components-autocomplete.ts"],"sourcesContent":["import { NgClass, NgIf } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n forwardRef,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core'\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'\nimport { NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\nimport { Subject, Subscription, debounceTime, distinctUntilChanged } from 'rxjs'\n\nimport {\n OptionListParentType,\n QuangBaseComponent,\n QuangOptionListComponent,\n SelectOption,\n} from 'quang/components/shared'\n\n@Component({\n selector: 'quang-autocomplete',\n imports: [TranslocoPipe, NgClass, NgIf, QuangOptionListComponent],\n templateUrl: './autocomplete.component.html',\n styleUrl: './autocomplete.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => QuangAutocompleteComponent),\n multi: true,\n },\n {\n provide: QuangOptionListComponent,\n multi: false,\n },\n ],\n})\n/**\n * Autocomplete component for providing suggestion options {@link SelectOption} as the user types.\n *\n * @usageNotes\n * This component displays a list of filtered options based on user input.\n * It allows users to select an option from the suggestions and emits the event `selectedOption` when an option is selected.\n *\n * `searchTextDebounce` is by default set to 300ms.\n */\nexport class QuangAutocompleteComponent extends QuangBaseComponent<string | number> {\n // the form can't be a random text but must be one of the options if this is false\n syncFormWithText = input<boolean>(false)\n\n optionListMaxHeight = input<string>('200px')\n\n selectOptions = input.required<SelectOption[]>()\n\n translateValue = input<boolean>(true)\n\n scrollBehaviorOnOpen = input<ScrollBehavior>('smooth')\n\n optionList = viewChild<QuangOptionListComponent>('optionList')\n\n /**\n * Only emits the value without saving it in ngControl\n */\n emitOnly = input<boolean>(false)\n\n _showOptions = signal<boolean | null>(null)\n\n _inputValue = signal<string>('')\n\n _optionHideTimeout = signal<any | undefined>(undefined)\n\n inputValue$ = new Subject<string>()\n\n selectOptionsChange = toObservable(this.selectOptions)\n .pipe(takeUntilDestroyed())\n .subscribe(() => {\n if (!this._inputValue()) {\n this.setInputValue()\n }\n })\n\n _filteredOptions = computed<SelectOption[]>(() => {\n const text = this._inputValue()\n return text?.length ? this.filterOptions(text) : this.selectOptions()\n })\n\n selectedOption = output<string | number | null>()\n\n searchTextChange = output<string>()\n\n searchTextDebounce = input<number>(300)\n\n internalFilterOptions = input<boolean>(true)\n\n readonly ParentType = OptionListParentType.AUTOCOMPLETE\n\n formValueChange$: Subscription | undefined = undefined\n\n constructor() {\n super()\n this.inputValue$\n .pipe(takeUntilDestroyed(), debounceTime(this.searchTextDebounce()), distinctUntilChanged())\n .subscribe((value) => {\n if (value !== this._inputValue()) {\n this.searchTextChange.emit(value?.toString() || '')\n if (this.syncFormWithText()) {\n this.onValueChange(value, false)\n }\n }\n this._inputValue.set(value?.toString() || '')\n if (!this._inputValue()?.length && !this.emitOnly()) this._ngControl()?.control?.patchValue(null)\n })\n toObservable(this._showOptions)\n .pipe(takeUntilDestroyed())\n .subscribe((data) => {\n if (!data && data !== null) {\n this.checkInputValue()\n }\n })\n }\n\n override setupFormControl(): void {\n super.setupFormControl()\n const formControl = this._ngControl()?.control\n if (this.formValueChange$) {\n this.formValueChange$.unsubscribe()\n this.formValueChange$ = undefined\n }\n if (formControl) {\n this.formValueChange$ = formControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {\n if (!this.syncFormWithText() && !value) {\n this._inputValue.set('')\n }\n })\n }\n }\n\n showOptionVisibility(): void {\n if (this._optionHideTimeout()) {\n clearTimeout(this._optionHideTimeout())\n this._optionHideTimeout.set(null)\n }\n this._showOptions.set(true)\n }\n\n hideOptionVisibility(skipTimeout = false): void {\n if (this._optionHideTimeout()) {\n clearTimeout(this._optionHideTimeout())\n }\n this._optionHideTimeout.set(\n setTimeout(\n () => {\n this._showOptions.set(false)\n },\n skipTimeout ? 0 : 50\n )\n )\n }\n\n onChangeInput(value: any): void {\n this.showOptionVisibility()\n this.inputValue$.next(value.target?.value)\n }\n\n filterOptions(value: string): SelectOption[] {\n const options = this.selectOptions()\n if (this.internalFilterOptions()) return options.filter((x) => x.label.toLowerCase().includes(value.toLowerCase()))\n return options\n }\n\n override onChangedHandler(value: string | number): void {\n super.onChangedHandler(value)\n this.setInputValue()\n }\n\n onValueChange(value: string | number, hideOptions = true): void {\n this.onChangedHandler(value)\n if (hideOptions) {\n this.hideOptionVisibility()\n }\n this.selectedOption.emit(value)\n }\n\n checkInputValue(): void {\n const option = this.selectOptions().find((x) => x.label.toLowerCase() === this._inputValue()?.toLowerCase())\n if (option?.value === this._value()) return\n if (option) {\n this.onChangedHandler(option.value ?? '')\n } else if (!this.syncFormWithText()) {\n this.onChangedHandler('')\n }\n }\n\n override writeValue(val: string | number): void {\n super.writeValue(val)\n this.setInputValue(true)\n }\n\n onBlurInput(event: FocusEvent) {\n if ((event?.relatedTarget as HTMLDivElement)?.id !== this.optionList()?.optionListContainer()?.nativeElement?.id)\n this.onBlurHandler()\n }\n\n override onBlurHandler() {\n setTimeout(() => {\n this.hideOptionVisibility()\n if (!this._inputValue()?.length && !this.emitOnly()) {\n this._ngControl()?.control?.patchValue(null)\n }\n super.onBlurHandler()\n }, 100)\n }\n\n onBlurOptionList(event: any): void {\n if (event) this.hideOptionVisibility()\n }\n\n setInputValue(resetOnMiss = false) {\n this._inputValue.set(\n this.selectOptions().find((x) => x.value === this._value())?.label ?? (resetOnMiss ? '' : this._inputValue())\n )\n if (!this.syncFormWithText()) this.inputValue$.next(this._inputValue() ?? '')\n }\n}\n","<div class=\"autocomplete-container\">\n <label\n [htmlFor]=\"componentId()\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled() || isReadonly()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_inputValue()\"\n (blur)=\"onBlurInput($event)\"\n (input)=\"onChangeInput($event)\"\n (mousedown)=\"showOptionVisibility()\"\n #selectInput\n autocomplete=\"off\"\n class=\"form-control\"\n type=\"text\"\n />\n <quang-option-list\n [_isDisabled]=\"_isDisabled()\"\n [_value]=\"_value()\"\n [componentClass]=\"componentClass()\"\n [componentLabel]=\"componentLabel()\"\n [componentTabIndex]=\"componentTabIndex()\"\n [nullOption]=\"false\"\n [optionListMaxHeight]=\"optionListMaxHeight()\"\n [parentID]=\"componentId()\"\n [parentType]=\"ParentType\"\n [scrollBehaviorOnOpen]=\"scrollBehaviorOnOpen()\"\n [selectButtonRef]=\"selectInput\"\n [selectOptions]=\"_filteredOptions()\"\n [translateValue]=\"translateValue()\"\n (blurHandler)=\"onBlurOptionList($event)\"\n (changedHandler)=\"onValueChange($event)\"\n *ngIf=\"_showOptions()\"\n #optionList\n selectionMode=\"single\"\n ></quang-option-list>\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":";;;;;;;;;AA2CA;;;;;;;;AAQG;AACG,MAAO,0BAA2B,SAAQ,kBAAmC,CAAA;AAoDjF,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAnDT,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAU,KAAK,CAAC;AAExC,QAAA,IAAA,CAAA,mBAAmB,GAAG,KAAK,CAAS,OAAO,CAAC;AAE5C,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAkB;AAEhD,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAU,IAAI,CAAC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B,EACrB,OAAA,EAAA,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,wBAAwB,CAAC,EAAA,eAAA,EAGhD,uBAAuB,CAAC,MAAM,EAEpC,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,gCAAgC,CAAC;AACzD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACD,wBAAA;AACE,4BAAA,OAAO,EAAE,wBAAwB;AACjC,4BAAA,KAAK,EAAE,KAAK;AACb,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,q+DAAA,EAAA,MAAA,EAAA,CAAA,qFAAA,CAAA,EAAA;;;AEzCH;;AAEG;;;;"}
1
+ {"version":3,"file":"quang-components-autocomplete.mjs","sources":["../../../projects/quang/components/autocomplete/autocomplete.component.ts","../../../projects/quang/components/autocomplete/autocomplete.component.html","../../../projects/quang/components/autocomplete/quang-components-autocomplete.ts"],"sourcesContent":["import { NgClass, NgStyle } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n computed,\n effect,\n forwardRef,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core'\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'\nimport { NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\nimport { QuangTooltipDirective } from 'quang/overlay/tooltip'\nimport { Subject, Subscription, debounceTime, distinctUntilChanged } from 'rxjs'\n\nimport {\n OptionListParentType,\n QuangBaseComponent,\n QuangOptionListComponent,\n SelectOption,\n} from 'quang/components/shared'\n\n@Component({\n selector: 'quang-autocomplete',\n imports: [TranslocoPipe, NgClass, QuangOptionListComponent, NgStyle, QuangTooltipDirective],\n templateUrl: './autocomplete.component.html',\n styleUrl: './autocomplete.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => QuangAutocompleteComponent),\n multi: true,\n },\n {\n provide: QuangOptionListComponent,\n multi: false,\n },\n ],\n})\n/**\n * Autocomplete component for providing suggestion options {@link SelectOption} as the user types.\n *\n * @usageNotes\n * This component displays a list of filtered options based on user input.\n * It allows users to select an option from the suggestions and emits the event `selectedOption` when an option is selected.\n *\n * `searchTextDebounce` is by default set to 300ms.\n */\nexport class QuangAutocompleteComponent extends QuangBaseComponent<string | number | string[] | number[]> {\n // the form can't be a random text but must be one of the options if this is false\n syncFormWithText = input<boolean>(false)\n\n optionListMaxHeight = input<string>('200px')\n\n selectOptions = input.required<SelectOption[]>()\n\n translateValue = input<boolean>(true)\n\n scrollBehaviorOnOpen = input<ScrollBehavior>('smooth')\n\n /**\n * Only emits the value without saving it in ngControl\n */\n emitOnly = input<boolean>(false)\n\n multiple = input<boolean>(false)\n\n /**\n * Set the maximum length in characters of the single chip.\n */\n chipMaxLength = input<number>(0)\n\n multiSelectDisplayMode = input<'vertical' | 'horizontal'>('vertical')\n\n optionList = viewChild<QuangOptionListComponent>('optionList')\n\n _showOptions = signal<boolean | null>(null)\n\n _inputValue = signal<string>('')\n\n _optionHideTimeout = signal<any | undefined>(undefined)\n\n _chipList = signal<string[]>([])\n\n _selectedOptions = signal<SelectOption[]>([])\n\n inputValue$ = new Subject<string>()\n\n selectOptionsChange = toObservable(this.selectOptions)\n .pipe(takeUntilDestroyed())\n .subscribe(() => {\n if (!this._inputValue()) {\n this.setInputValue()\n }\n })\n\n _filteredOptions = computed<SelectOption[]>(() => {\n const text = this._inputValue()\n if (this.multiple()) {\n return this.filterOptions(text).filter((x) => !this._chipList().some((chip) => chip === x.value))\n } else {\n return text?.length ? this.filterOptions(text) : this.selectOptions()\n }\n })\n\n selectedOption = output<string | number | null>()\n\n searchTextChange = output<string>()\n\n searchTextDebounce = input<number>(300)\n\n internalFilterOptions = input<boolean>(true)\n\n readonly ParentType = OptionListParentType.AUTOCOMPLETE\n\n formValueChange$: Subscription | undefined = undefined\n\n private readonly selectInput = viewChild<ElementRef>('selectInput')\n private readonly chipContainer = viewChild<ElementRef>('chipContainer')\n private readonly autocompleteContainer = viewChild<ElementRef>('autocompleteContainer')\n\n inputHeight = signal<number>(0)\n\n private readonly onChangeSelectInput = effect(() => {\n const selectInput = this.selectInput()\n if (selectInput) {\n this.inputHeight.set(selectInput?.nativeElement?.getBoundingClientRect().height)\n selectInput.nativeElement.addEventListener('keydown', (e: KeyboardEvent) => {\n if (this.multiple() && this._chipList().length > 0 && !this._inputValue()?.length && e.key === 'Backspace') {\n e.preventDefault()\n // this.deleteChip(this._chipList()[this._chipList().length - 1])\n const chipContainer = this.chipContainer()?.nativeElement\n if (chipContainer) {\n const chips = chipContainer.querySelectorAll('.chip button.btn-chip')\n if (chips.length > 0) {\n const focusChip = chips[chips.length - 1]\n focusChip.focus()\n focusChip.addEventListener('keydown', (event: KeyboardEvent) => {\n if (event.key === 'Backspace') {\n event.preventDefault()\n this.deleteChip(this._chipList()[this._chipList().length - 1])\n selectInput.nativeElement.focus()\n } else {\n event.preventDefault()\n }\n })\n }\n }\n }\n })\n }\n })\n\n constructor() {\n super()\n this.inputValue$\n .pipe(takeUntilDestroyed(), debounceTime(this.searchTextDebounce()), distinctUntilChanged())\n .subscribe((value) => {\n if (value !== this._inputValue()) {\n this.searchTextChange.emit(value?.toString() || '')\n if (this.syncFormWithText()) {\n this.onValueChange(value, false)\n }\n }\n this._inputValue.set(value?.toString() || '')\n if (!this._inputValue()?.length && !this.emitOnly() && !this.multiple()) {\n this._ngControl()?.control?.patchValue(null)\n }\n })\n toObservable(this._showOptions)\n .pipe(takeUntilDestroyed())\n .subscribe((data) => {\n if (!data && data !== null) {\n this.checkInputValue()\n }\n })\n }\n\n override setupFormControl(): void {\n super.setupFormControl()\n const formControl = this._ngControl()?.control\n if (this.formValueChange$) {\n this.formValueChange$.unsubscribe()\n this.formValueChange$ = undefined\n }\n if (formControl) {\n this.formValueChange$ = formControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {\n if (!this.syncFormWithText() && !value) {\n this._inputValue.set('')\n }\n })\n }\n }\n\n showOptionVisibility(): void {\n if (this._optionHideTimeout()) {\n clearTimeout(this._optionHideTimeout())\n this._optionHideTimeout.set(null)\n }\n this._showOptions.set(true)\n }\n\n hideOptionVisibility(skipTimeout = false): void {\n if (this._optionHideTimeout()) {\n clearTimeout(this._optionHideTimeout())\n }\n this._optionHideTimeout.set(\n setTimeout(\n () => {\n this._showOptions.set(false)\n },\n skipTimeout ? 0 : 50\n )\n )\n }\n\n onChangeInput(value: any): void {\n this.showOptionVisibility()\n this.inputValue$.next(value.target?.value)\n }\n\n filterOptions(value: string): SelectOption[] {\n const options = this.selectOptions()\n if (this.internalFilterOptions()) {\n return options.filter((x) => x.label.toLowerCase().includes(value.toLowerCase()))\n }\n return options\n }\n\n override onChangedHandler(value: string | number | string[] | number[]): void {\n super.onChangedHandler(value)\n this.setInputValue()\n }\n\n onValueChange(value: string | number, hideOptions = true): void {\n if (this.multiple()) {\n this.onSelectValue(value)\n this.onChangedHandler(this._chipList())\n if (this._chipList().some((x) => x === value)) {\n this.inputValue$.next('')\n }\n } else {\n this.onChangedHandler(value)\n if (hideOptions) {\n this.hideOptionVisibility()\n }\n this.selectedOption.emit(value)\n }\n }\n\n checkInputValue(): void {\n const option = this.selectOptions().find((x) => x.label.toLowerCase() === this._inputValue()?.toLowerCase())\n if (!this.multiple()) {\n if (option?.value === this._value()) return\n if (option) {\n this.onChangedHandler(option.value ?? '')\n } else if (!this.syncFormWithText()) {\n this.onChangedHandler('')\n }\n }\n }\n\n override writeValue(val: string | number | string[] | number[]): void {\n super.writeValue(val)\n this.setInputValue(true)\n if (Array.isArray(val)) {\n val.forEach((x) => {\n this.onSelectValue(x)\n })\n }\n }\n\n onBlurInput(event: FocusEvent) {\n if ((event?.relatedTarget as HTMLDivElement)?.id !== this.optionList()?.optionListContainer()?.nativeElement?.id)\n this.onBlurHandler()\n }\n\n override onBlurHandler() {\n setTimeout(() => {\n this.hideOptionVisibility()\n if (!this._inputValue()?.length && !this.emitOnly() && !this.multiple()) {\n this._ngControl()?.control?.patchValue(null)\n }\n super.onBlurHandler()\n }, 100)\n }\n\n onBlurOptionList(event: any): void {\n if (event) this.hideOptionVisibility()\n }\n\n setInputValue(resetOnMiss = false) {\n this._inputValue.set(\n this.selectOptions().find((x) => x.value === this._value())?.label ?? (resetOnMiss ? '' : this._inputValue())\n )\n if (!this.syncFormWithText()) this.inputValue$.next(this._inputValue() ?? '')\n }\n\n getDescription(chip: any): string {\n const valueChip = this.selectOptions().find((x) => x.value === chip)\n return valueChip ? valueChip.label.toString() : ''\n }\n\n onSelectValue(value: any): void {\n const newChip = this.selectOptions().find((x) => x.value === value)\n if (newChip && !this._chipList().some((x) => x === newChip?.value)) {\n this.createChipList(newChip)\n this._selectedOptions.update((list) => [...list, newChip])\n }\n }\n\n /**\n * remove chip from chips list\n * @param chipValue chip to delete\n */\n deleteChip(chipValue: any): void {\n const stringChipValue = chipValue?.toString()\n const i = this._chipList()?.findIndex((x) => x.toString() === stringChipValue)\n if (i >= 0) {\n const currentList = this._chipList()\n if (Array.isArray(currentList) && currentList.length > 0) {\n this._chipList.update((list) => (list as string[]).filter((_, index) => index !== i))\n this.onChangedHandler(this._chipList())\n }\n }\n }\n\n createChipList(chip: any): void {\n if (chip) {\n this._chipList.update((list) => [...list, chip.value])\n }\n }\n}\n","<div\n [ngStyle]=\"{ '--chip-max-length': chipMaxLength() ? chipMaxLength() + 'ch' : 'none' }\"\n #autocompleteContainer\n class=\"autocomplete-container\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n }\n <div\n [ngClass]=\"multiSelectDisplayMode() === 'horizontal' ? 'horizontal form-control' : ''\"\n #chipContainer\n class=\"container-wrap\"\n >\n @if (multiple() && _chipList().length > 0) {\n @for (chip of _chipList(); track $index) {\n @if (getDescription(chip)) {\n <div\n [quangTooltip]=\"chipMaxLength() ? getDescription(chip) : ''\"\n class=\"chip chip-hover\"\n >\n <p [ngClass]=\"{ 'm-0': isReadonly() || _isDisabled() }\">\n {{ getDescription(chip) }}\n </p>\n @if (!isReadonly() && !_isDisabled()) {\n <button\n [tabIndex]=\"$index + 1\"\n (click)=\"deleteChip(chip)\"\n class=\"btn btn-chip\"\n type=\"button\"\n >\n <svg\n class=\"ionicon\"\n fill=\"currentColor\"\n height=\"24\"\n viewBox=\"0 0 512 512\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M368 368L144 144M368 144L144 368\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"32\"\n />\n </svg>\n </button>\n }\n </div>\n }\n }\n }\n\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [class.form-control]=\"multiSelectDisplayMode() !== 'horizontal'\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled() || isReadonly()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_inputValue()\"\n (blur)=\"onBlurInput($event)\"\n (input)=\"onChangeInput($event)\"\n (mousedown)=\"showOptionVisibility()\"\n #selectInput\n autocomplete=\"off\"\n type=\"text\"\n />\n </div>\n @if (_showOptions()) {\n <quang-option-list\n [_isDisabled]=\"_isDisabled()\"\n [_value]=\"_value()\"\n [componentClass]=\"componentClass()\"\n [componentLabel]=\"componentLabel()\"\n [componentTabIndex]=\"componentTabIndex()\"\n [nullOption]=\"false\"\n [optionListMaxHeight]=\"optionListMaxHeight()\"\n [parentID]=\"componentId()\"\n [parentType]=\"ParentType\"\n [scrollBehaviorOnOpen]=\"scrollBehaviorOnOpen()\"\n [selectButtonRef]=\"autocompleteContainer\"\n [selectOptions]=\"_filteredOptions()\"\n [translateValue]=\"translateValue()\"\n (blurHandler)=\"onBlurOptionList($event)\"\n (changedHandler)=\"onValueChange($event)\"\n #optionList\n selectionMode=\"single\"\n />\n }\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AA8CA;;;;;;;;AAQG;AACG,MAAO,0BAA2B,SAAQ,kBAAyD,CAAA;AAyGvG,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAxGT,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAU,KAAK,CAAC;AAExC,QAAA,IAAA,CAAA,mBAAmB,GAAG,KAAK,CAAS,OAAO,CAAC;AAE5C,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAkB;AAEhD,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAU,IAAI,CAAC;AAErC,QAAA,IAAA,CAAA,oBAAoB,GAAG,KAAK,CAAiB,QAAQ,CAAC;AAEtD;;AAEG;AACH,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,CAAC;AAEhC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,CAAC;AAEhC;;AAEG;AACH,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAS,CAAC,CAAC;AAEhC,QAAA,IAAA,CAAA,sBAAsB,GAAG,KAAK,CAA4B,UAAU,CAAC;AAErE,QAAA,IAAA,CAAA,UAAU,GAAG,SAAS,CAA2B,YAAY,CAAC;AA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A;kBA5BtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,WACrB,CAAC,aAAa,EAAE,OAAO,EAAE,wBAAwB,EAAE,OAAO,EAAE,qBAAqB,CAAC,EAAA,eAAA,EAG1E,uBAAuB,CAAC,MAAM,EAEpC,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,gCAAgC,CAAC;AACzD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACD,wBAAA;AACE,4BAAA,OAAO,EAAE,wBAAwB;AACjC,4BAAA,KAAK,EAAE,KAAK;AACb,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,2vHAAA,EAAA,MAAA,EAAA,CAAA,kyCAAA,CAAA,EAAA;;;AE5CH;;AAEG;;;;"}
@@ -25,8 +25,8 @@ class QuangCheckboxComponent extends QuangBaseComponent {
25
25
  const inputElement = $event.target;
26
26
  this.onChangedHandler(inputElement.checked);
27
27
  }
28
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: QuangCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
29
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.14", type: QuangCheckboxComponent, isStandalone: true, selector: "quang-checkbox", inputs: { labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, checkType: { classPropertyName: "checkType", publicName: "checkType", isSignal: true, isRequired: true, transformFunction: null }, removeMargin: { classPropertyName: "removeMargin", publicName: "removeMargin", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
28
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
29
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.0", type: QuangCheckboxComponent, isStandalone: true, selector: "quang-checkbox", inputs: { labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, checkType: { classPropertyName: "checkType", publicName: "checkType", isSignal: true, isRequired: true, transformFunction: null }, removeMargin: { classPropertyName: "removeMargin", publicName: "removeMargin", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
30
30
  {
31
31
  provide: NG_VALUE_ACCESSOR,
32
32
  useExisting: forwardRef(() => QuangCheckboxComponent),
@@ -34,7 +34,7 @@ class QuangCheckboxComponent extends QuangBaseComponent {
34
34
  },
35
35
  ], usesInheritance: true, ngImport: i0, template: "<div\n [class.form-check-reverse]=\"labelPosition() === 'left' && checkType() === 'checkbox'\"\n [class.form-switch]=\"checkType() === 'toggle'\"\n [class.label-bottom]=\"labelPosition() === 'bottom'\"\n [class.label-left]=\"labelPosition() === 'left' && checkType() === 'toggle'\"\n [class.label-right]=\"labelPosition() === 'right' && checkType() === 'toggle'\"\n [class.label-top]=\"labelPosition() === 'top'\"\n [class.toggle-wrapper]=\"checkType() === 'toggle'\"\n [ngClass]=\"{ 'mb-3': !removeMargin(), 'form-check': !removeMargin() }\"\n>\n <label\n [htmlFor]=\"componentId()\"\n [ngClass]=\"{ 'cursor-pointer': !_isDisabled() }\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [attr.role]=\"checkType() === 'checkbox' ? 'checkbox' : 'switch'\"\n [checked]=\"_value()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\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-check-input {{ _isDisabled() ? '' : 'cursor-pointer' }}\"\n type=\"checkbox\"\n />\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: [":host{display:block}.label-top{display:flex;flex-direction:column}.label-top input{margin:unset;float:unset}.label-bottom{display:flex;flex-direction:column-reverse}.label-bottom input{margin:unset;float:unset}.label-right{flex-direction:row-reverse;justify-content:start}.label-right label{margin-left:.5rem;margin-bottom:0;align-self:center}.label-left{flex-direction:row}.label-left label{margin-bottom:0;align-self:center}.toggle-wrapper{display:flex;padding-left:unset}.toggle-wrapper label{display:block}.toggle-wrapper input{margin-left:unset;width:3em;height:1.5em}.direction-row{flex-direction:row}.direction-row .form-label{margin-right:.5rem}.direction-reverse-row{flex-direction:row-reverse;justify-content:start}.direction-reverse-row input{margin-right:.5rem}.direction-column{flex-direction:column}.cursor-pointer{cursor:pointer}\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 }); }
36
36
  }
37
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: QuangCheckboxComponent, decorators: [{
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangCheckboxComponent, decorators: [{
38
38
  type: Component,
39
39
  args: [{ selector: 'quang-checkbox', providers: [
40
40
  {
@@ -1 +1 @@
1
- {"version":3,"file":"quang-components-checkbox.mjs","sources":["../../../projects/quang/components/checkbox/checkbox.component.ts","../../../projects/quang/components/checkbox/checkbox.component.html","../../../projects/quang/components/checkbox/quang-components-checkbox.ts"],"sourcesContent":["import { NgClass, NgIf } from '@angular/common'\nimport { ChangeDetectionStrategy, Component, forwardRef, input } from '@angular/core'\nimport { NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\n\nimport { QuangBaseComponent } from 'quang/components/shared'\n\nexport type LabelPosition = 'top' | 'left' | 'right' | 'bottom'\n\n@Component({\n selector: 'quang-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => QuangCheckboxComponent),\n multi: true,\n },\n ],\n imports: [TranslocoPipe, NgIf, NgClass],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * Checkbox component for rendering a `checkbox` or a `toggle` switch.\n *\n * @usageNotes\n * This component can be configured to display as a standard checkbox or as a toggle switch,\n * depending on the `checkType` input property.\n *\n * The component label can be aligned in {@link LabelPosition} by setting the `labelPosition` input property.\n */\nexport class QuangCheckboxComponent extends QuangBaseComponent<boolean> {\n labelPosition = input<LabelPosition>('top')\n\n checkType = input.required<'checkbox' | 'toggle'>()\n\n removeMargin = input<boolean>(false)\n\n override onChangedEventHandler($event: Event) {\n const inputElement = $event.target as HTMLInputElement\n this.onChangedHandler(inputElement.checked)\n }\n}\n","<div\n [class.form-check-reverse]=\"labelPosition() === 'left' && checkType() === 'checkbox'\"\n [class.form-switch]=\"checkType() === 'toggle'\"\n [class.label-bottom]=\"labelPosition() === 'bottom'\"\n [class.label-left]=\"labelPosition() === 'left' && checkType() === 'toggle'\"\n [class.label-right]=\"labelPosition() === 'right' && checkType() === 'toggle'\"\n [class.label-top]=\"labelPosition() === 'top'\"\n [class.toggle-wrapper]=\"checkType() === 'toggle'\"\n [ngClass]=\"{ 'mb-3': !removeMargin(), 'form-check': !removeMargin() }\"\n>\n <label\n [htmlFor]=\"componentId()\"\n [ngClass]=\"{ 'cursor-pointer': !_isDisabled() }\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [attr.role]=\"checkType() === 'checkbox' ? 'checkbox' : 'switch'\"\n [checked]=\"_value()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\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-check-input {{ _isDisabled() ? '' : 'cursor-pointer' }}\"\n type=\"checkbox\"\n />\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":";;;;;;;AAwBA;;;;;;;;AAQG;AACG,MAAO,sBAAuB,SAAQ,kBAA2B,CAAA;AAvBvE,IAAA,WAAA,GAAA;;AAwBE,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAgB,KAAK,CAAC;AAE3C,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAyB;AAEnD,QAAA,IAAA,CAA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A,CAAA,g1BAAA,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;;4FAY3B,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAvBlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAGf,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,4BAA4B,CAAC;AACrD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;qBACF,EACQ,OAAA,EAAA,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,EAAA,eAAA,EACtB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,o4DAAA,EAAA,MAAA,EAAA,CAAA,g1BAAA,CAAA,EAAA;;;AEtBjD;;AAEG;;;;"}
1
+ {"version":3,"file":"quang-components-checkbox.mjs","sources":["../../../projects/quang/components/checkbox/checkbox.component.ts","../../../projects/quang/components/checkbox/checkbox.component.html","../../../projects/quang/components/checkbox/quang-components-checkbox.ts"],"sourcesContent":["import { NgClass, NgIf } from '@angular/common'\nimport { ChangeDetectionStrategy, Component, forwardRef, input } from '@angular/core'\nimport { NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\n\nimport { QuangBaseComponent } from 'quang/components/shared'\n\nexport type LabelPosition = 'top' | 'left' | 'right' | 'bottom'\n\n@Component({\n selector: 'quang-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => QuangCheckboxComponent),\n multi: true,\n },\n ],\n imports: [TranslocoPipe, NgIf, NgClass],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * Checkbox component for rendering a `checkbox` or a `toggle` switch.\n *\n * @usageNotes\n * This component can be configured to display as a standard checkbox or as a toggle switch,\n * depending on the `checkType` input property.\n *\n * The component label can be aligned in {@link LabelPosition} by setting the `labelPosition` input property.\n */\nexport class QuangCheckboxComponent extends QuangBaseComponent<boolean> {\n labelPosition = input<LabelPosition>('top')\n\n checkType = input.required<'checkbox' | 'toggle'>()\n\n removeMargin = input<boolean>(false)\n\n override onChangedEventHandler($event: Event) {\n const inputElement = $event.target as HTMLInputElement\n this.onChangedHandler(inputElement.checked)\n }\n}\n","<div\n [class.form-check-reverse]=\"labelPosition() === 'left' && checkType() === 'checkbox'\"\n [class.form-switch]=\"checkType() === 'toggle'\"\n [class.label-bottom]=\"labelPosition() === 'bottom'\"\n [class.label-left]=\"labelPosition() === 'left' && checkType() === 'toggle'\"\n [class.label-right]=\"labelPosition() === 'right' && checkType() === 'toggle'\"\n [class.label-top]=\"labelPosition() === 'top'\"\n [class.toggle-wrapper]=\"checkType() === 'toggle'\"\n [ngClass]=\"{ 'mb-3': !removeMargin(), 'form-check': !removeMargin() }\"\n>\n <label\n [htmlFor]=\"componentId()\"\n [ngClass]=\"{ 'cursor-pointer': !_isDisabled() }\"\n *ngIf=\"componentLabel()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [attr.role]=\"checkType() === 'checkbox' ? 'checkbox' : 'switch'\"\n [checked]=\"_value()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\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-check-input {{ _isDisabled() ? '' : 'cursor-pointer' }}\"\n type=\"checkbox\"\n />\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":";;;;;;;AAwBA;;;;;;;;AAQG;AACG,MAAO,sBAAuB,SAAQ,kBAA2B,CAAA;AAvBvE,IAAA,WAAA,GAAA;;AAwBE,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAgB,KAAK,CAAC;AAE3C,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAyB;AAEnD,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAU,KAAK,CAAC;AAMrC;AAJU,IAAA,qBAAqB,CAAC,MAAa,EAAA;AAC1C,QAAA,MAAM,YAAY,GAAG,MAAM,CAAC,MAA0B;AACtD,QAAA,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,OAAO,CAAC;;8GATlC,sBAAsB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAnBtB,YAAA,EA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AAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,4BAA4B,CAAC;AACrD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;qBACF,EACQ,OAAA,EAAA,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,EAAA,eAAA,EACtB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,o4DAAA,EAAA,MAAA,EAAA,CAAA,g1BAAA,CAAA,EAAA;;;AEtBjD;;AAEG;;;;"}
@@ -374,10 +374,10 @@ class QuangDateComponent extends QuangBaseComponent {
374
374
  }
375
375
  }
376
376
  }
377
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: QuangDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
378
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.14", 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 }); }
377
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
378
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.0", 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
379
  }
380
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: QuangDateComponent, decorators: [{
380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: QuangDateComponent, decorators: [{
381
381
  type: Component,
382
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
383
  }], ctorParameters: () => [], propDecorators: { _quangTranslationService: [{