i-tech-shared-components 1.1.6 → 1.1.9

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 (128) hide show
  1. package/.npmignore +2 -0
  2. package/README.md +23 -23
  3. package/esm2022/i-tech-shared-components.mjs +5 -0
  4. package/esm2022/lib/components/autocomplete-select/autocomplete-select.component.mjs +409 -0
  5. package/esm2022/lib/components/button/button.component.mjs +122 -0
  6. package/esm2022/lib/components/clear-value/clear-value.component.mjs +34 -0
  7. package/esm2022/lib/components/date-picker/date-picker.component.mjs +111 -0
  8. package/esm2022/lib/components/date-range-datepicker/date-range-datepicker.component.mjs +118 -0
  9. package/esm2022/lib/components/icon-button/icon-button.component.mjs +49 -0
  10. package/esm2022/lib/components/menu/menu.component.mjs +51 -0
  11. package/esm2022/lib/components/text/text-input.component.mjs +73 -0
  12. package/esm2022/lib/directives/date-mask.directive.mjs +92 -0
  13. package/esm2022/lib/directives/input-mask.directive.mjs +92 -0
  14. package/esm2022/lib/interfaces/app-input.interface.mjs +2 -0
  15. package/esm2022/lib/interfaces/autocomplete-configs.interface.mjs +2 -0
  16. package/esm2022/lib/interfaces/button-types.enum.mjs +17 -0
  17. package/esm2022/lib/interfaces/dropdown-selection.constants.mjs +12 -0
  18. package/esm2022/lib/pipes/array-to-string.pipe.mjs +17 -0
  19. package/esm2022/lib/pipes/generate-error-messages.pipe.mjs +31 -0
  20. package/esm2022/lib/pipes/get-value-by-key-from-object.pipe.mjs +45 -0
  21. package/esm2022/lib/services/input.service.mjs +29 -0
  22. package/esm2022/public-api.mjs +20 -0
  23. package/fesm2022/i-tech-shared-components.mjs +1216 -0
  24. package/fesm2022/i-tech-shared-components.mjs.map +1 -0
  25. package/index.d.ts +5 -0
  26. package/lib/components/autocomplete-select/autocomplete-select.component.d.ts +84 -0
  27. package/lib/components/button/button.component.d.ts +65 -0
  28. package/lib/components/clear-value/clear-value.component.d.ts +9 -0
  29. package/lib/components/date-picker/date-picker.component.d.ts +35 -0
  30. package/lib/components/date-range-datepicker/date-range-datepicker.component.d.ts +36 -0
  31. package/lib/components/icon-button/icon-button.component.d.ts +14 -0
  32. package/lib/components/menu/menu.component.d.ts +28 -0
  33. package/lib/components/text/text-input.component.d.ts +21 -0
  34. package/lib/directives/date-mask.directive.d.ts +25 -0
  35. package/lib/directives/input-mask.directive.d.ts +21 -0
  36. package/lib/interfaces/app-input.interface.d.ts +31 -0
  37. package/lib/interfaces/autocomplete-configs.interface.d.ts +37 -0
  38. package/lib/interfaces/button-types.enum.d.ts +15 -0
  39. package/lib/interfaces/dropdown-selection.constants.d.ts +10 -0
  40. package/lib/pipes/array-to-string.pipe.d.ts +7 -0
  41. package/lib/pipes/generate-error-messages.pipe.d.ts +10 -0
  42. package/lib/pipes/get-value-by-key-from-object.pipe.d.ts +7 -0
  43. package/lib/services/input.service.d.ts +7 -0
  44. package/package.json +32 -19
  45. package/{src/public-api.ts → public-api.d.ts} +16 -20
  46. package/theme/_buttons.scss +63 -63
  47. package/theme/_color_themes.scss +136 -136
  48. package/theme/_date_picker.scss +77 -77
  49. package/theme/_form_fields.scss +112 -112
  50. package/theme/_icon-button.scss +123 -123
  51. package/theme/_label.scss +119 -119
  52. package/theme/_mat-selects.scss +248 -248
  53. package/theme/_menu.scss +9 -9
  54. package/theme/_text_input.scss +28 -28
  55. package/theme/variables/_colors.scss +20 -20
  56. package/theme.scss +31 -33
  57. package/docs/README.md +0 -87
  58. package/docs/components/autocomplete-select/autocomplete-select.component/README.md +0 -13
  59. package/docs/components/autocomplete-select/autocomplete-select.component/classes/AutocompleteSelectComponent.md +0 -793
  60. package/docs/components/button/button.component/README.md +0 -13
  61. package/docs/components/button/button.component/classes/ButtonComponent.md +0 -191
  62. package/docs/components/button/button.component.spec/README.md +0 -7
  63. package/docs/components/clear-value/clear-value.component/README.md +0 -13
  64. package/docs/components/clear-value/clear-value.component/classes/ClearValueComponent.md +0 -47
  65. package/docs/components/date-picker/date-picker.component/README.md +0 -13
  66. package/docs/components/date-picker/date-picker.component/classes/DatePickerComponent.md +0 -253
  67. package/docs/components/date-range-datepicker/date-range-datepicker.component/README.md +0 -13
  68. package/docs/components/date-range-datepicker/date-range-datepicker.component/classes/DateRangeDatepickerComponent.md +0 -341
  69. package/docs/components/icon-button/icon-button.component/README.md +0 -13
  70. package/docs/components/icon-button/icon-button.component/classes/IconButtonComponent.md +0 -107
  71. package/docs/components/label/label.component/README.md +0 -13
  72. package/docs/components/label/label.component/classes/LabelComponent.md +0 -97
  73. package/docs/components/menu/menu.component/README.md +0 -13
  74. package/docs/components/menu/menu.component/classes/MenuComponent.md +0 -139
  75. package/docs/components/text/text-input.component/README.md +0 -13
  76. package/docs/components/text/text-input.component/classes/TextInputComponent.md +0 -133
  77. package/docs/interfaces/app-input.interface/README.md +0 -13
  78. package/docs/interfaces/app-input.interface/interfaces/AppInputInterface.md +0 -297
  79. package/docs/interfaces/autocomplete-configs.interface/README.md +0 -13
  80. package/docs/interfaces/autocomplete-configs.interface/interfaces/AutocompleteConfigsInterface.md +0 -357
  81. package/docs/interfaces/button-types.enum/README.md +0 -13
  82. package/docs/interfaces/button-types.enum/enumerations/ButtonType.md +0 -69
  83. package/docs/interfaces/dropdown-selection.constants/README.md +0 -17
  84. package/docs/interfaces/dropdown-selection.constants/enumerations/DropdownSelectionType.md +0 -37
  85. package/docs/interfaces/dropdown-selection.constants/variables/DropdownItemIcon.md +0 -27
  86. package/docs/interfaces/label-type.enum/README.md +0 -13
  87. package/docs/interfaces/label-type.enum/enumerations/LabelTypeEnum.md +0 -127
  88. package/docs/services/input.service/README.md +0 -13
  89. package/docs/services/input.service/classes/InputService.md +0 -31
  90. package/ng-package.json +0 -17
  91. package/src/README.md +0 -0
  92. package/src/lib/components/autocomplete-select/autocomplete-select.component.html +0 -211
  93. package/src/lib/components/autocomplete-select/autocomplete-select.component.scss +0 -58
  94. package/src/lib/components/autocomplete-select/autocomplete-select.component.ts +0 -430
  95. package/src/lib/components/autocomplete-select/loader.svg +0 -6
  96. package/src/lib/components/button/button.component.css +0 -0
  97. package/src/lib/components/button/button.component.html +0 -48
  98. package/src/lib/components/button/button.component.spec.ts +0 -23
  99. package/src/lib/components/button/button.component.ts +0 -106
  100. package/src/lib/components/clear-value/clear-value.component.ts +0 -44
  101. package/src/lib/components/date-picker/date-picker.component.html +0 -61
  102. package/src/lib/components/date-picker/date-picker.component.ts +0 -75
  103. package/src/lib/components/date-range-datepicker/date-range-datepicker.component.html +0 -44
  104. package/src/lib/components/date-range-datepicker/date-range-datepicker.component.ts +0 -105
  105. package/src/lib/components/icon-button/icon-button.component.html +0 -27
  106. package/src/lib/components/icon-button/icon-button.component.scss +0 -0
  107. package/src/lib/components/icon-button/icon-button.component.ts +0 -37
  108. package/src/lib/components/label/label.component.html +0 -15
  109. package/src/lib/components/label/label.component.ts +0 -33
  110. package/src/lib/components/menu/menu.component.html +0 -20
  111. package/src/lib/components/menu/menu.component.scss +0 -9
  112. package/src/lib/components/menu/menu.component.ts +0 -39
  113. package/src/lib/components/text/text-input.component.html +0 -91
  114. package/src/lib/components/text/text-input.component.ts +0 -73
  115. package/src/lib/directives/date-mask.directive.ts +0 -97
  116. package/src/lib/directives/input-mask.directive.ts +0 -93
  117. package/src/lib/interfaces/app-input.interface.ts +0 -32
  118. package/src/lib/interfaces/autocomplete-configs.interface.ts +0 -37
  119. package/src/lib/interfaces/button-types.enum.ts +0 -19
  120. package/src/lib/interfaces/dropdown-selection.constants.ts +0 -11
  121. package/src/lib/interfaces/label-type.enum.ts +0 -14
  122. package/src/lib/pipes/array-to-string.pipe.ts +0 -13
  123. package/src/lib/pipes/generate-error-messages.pipe.ts +0 -31
  124. package/src/lib/pipes/get-value-by-key-from-object.pipe.ts +0 -46
  125. package/src/lib/services/input.service.ts +0 -30
  126. package/tsconfig.lib.json +0 -15
  127. package/tsconfig.lib.prod.json +0 -11
  128. package/tsconfig.spec.json +0 -15
@@ -0,0 +1,1216 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Pipe, inject, Injectable, Directive, Input, HostListener, EventEmitter, Component, Output, ViewChild } from '@angular/core';
3
+ import * as i2 from '@ngx-translate/core';
4
+ import { TranslateModule, TranslatePipe, TranslateService } from '@ngx-translate/core';
5
+ import * as i3 from '@angular/forms';
6
+ import { NgControl, FormControlName, ReactiveFormsModule, UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
7
+ import { MatIconButton, MatFabButton, MatButton } from '@angular/material/button';
8
+ import { NgClass, NgIf, NgOptimizedImage, NgFor, NgForOf } from '@angular/common';
9
+ import { MatTooltip } from '@angular/material/tooltip';
10
+ import * as i1 from '@angular/material/icon';
11
+ import { MatIcon, MatIconModule } from '@angular/material/icon';
12
+ import * as i4 from '@angular/material/form-field';
13
+ import { MatFormFieldModule, MatLabel } from '@angular/material/form-field';
14
+ import { MatInput } from '@angular/material/input';
15
+ import { NgxMaskDirective, NgxMaskPipe, NgxMaskService } from 'ngx-mask';
16
+ import { MatProgressSpinner } from '@angular/material/progress-spinner';
17
+ import * as i5 from '@angular/material/select';
18
+ import { MatSelectModule } from '@angular/material/select';
19
+ import * as i6 from '@angular/material/core';
20
+ import * as i3$1 from '@angular/material/datepicker';
21
+ import { MatDatepickerModule } from '@angular/material/datepicker';
22
+ import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu';
23
+
24
+ class GenerateErrorMessagesPipe {
25
+ constructor(translateService) {
26
+ this.translateService = translateService;
27
+ }
28
+ transform(control, label, defaultPatternKey = 'fixed') {
29
+ if (!control.errors) {
30
+ return '';
31
+ }
32
+ let translateParams;
33
+ let errorMessageKey = '';
34
+ const key = (Object.keys(control.errors)[0]);
35
+ translateParams = { ERROR_KEY: this.translateService.instant(label) || 'Field' };
36
+ errorMessageKey = (key === 'pattern') ?
37
+ 'errorMessages.pattern.' + defaultPatternKey : 'errorMessages.' + key;
38
+ return this.translateService.instant(errorMessageKey, translateParams);
39
+ }
40
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GenerateErrorMessagesPipe, deps: [{ token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe }); }
41
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: GenerateErrorMessagesPipe, isStandalone: true, name: "generateErrorMessages" }); }
42
+ }
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GenerateErrorMessagesPipe, decorators: [{
44
+ type: Pipe,
45
+ args: [{
46
+ name: 'generateErrorMessages',
47
+ standalone: true,
48
+ pure: true
49
+ }]
50
+ }], ctorParameters: () => [{ type: i2.TranslateService }] });
51
+
52
+ class ArrayToStringPipe {
53
+ transform(value) {
54
+ return (typeof value === 'string') ? value : value.join(',');
55
+ }
56
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArrayToStringPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
57
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ArrayToStringPipe, isStandalone: true, name: "arrayToString" }); }
58
+ }
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArrayToStringPipe, decorators: [{
60
+ type: Pipe,
61
+ args: [{
62
+ name: 'arrayToString',
63
+ standalone: true
64
+ }]
65
+ }] });
66
+
67
+ class GetValueByKeyFromObjectPipe {
68
+ transform(keys, data, withParams = null, withParamSymbol) {
69
+ if (typeof keys === 'string') {
70
+ return data[keys];
71
+ }
72
+ else {
73
+ let returnValue = data;
74
+ keys.forEach((key) => {
75
+ if (!returnValue) {
76
+ return;
77
+ }
78
+ returnValue = returnValue[key];
79
+ });
80
+ if (withParams) {
81
+ withParams.forEach((param) => {
82
+ let include = data;
83
+ if (typeof param === 'object') {
84
+ param.forEach((key) => {
85
+ include = (include) ? include[key] : null;
86
+ });
87
+ }
88
+ else {
89
+ include = include[param];
90
+ }
91
+ if (include !== undefined && include !== null) {
92
+ returnValue += (withParamSymbol ? withParamSymbol : ' ') + include;
93
+ }
94
+ });
95
+ }
96
+ return ((returnValue !== "undefined") && (returnValue !== null)) ? returnValue : '---';
97
+ }
98
+ }
99
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetValueByKeyFromObjectPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
100
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: GetValueByKeyFromObjectPipe, isStandalone: true, name: "getValueByKeyFromObject" }); }
101
+ }
102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetValueByKeyFromObjectPipe, decorators: [{
103
+ type: Pipe,
104
+ args: [{
105
+ name: 'getValueByKeyFromObject',
106
+ standalone: true
107
+ }]
108
+ }] });
109
+
110
+ class NoopValueAccessor {
111
+ writeValue() { }
112
+ registerOnChange() { }
113
+ registerOnTouched() { }
114
+ }
115
+ class InputService {
116
+ injectNgControl() {
117
+ const ngControl = inject(NgControl, { self: true, optional: true });
118
+ if (!ngControl)
119
+ throw new Error('...');
120
+ if (ngControl instanceof FormControlName) {
121
+ ngControl.valueAccessor = new NoopValueAccessor();
122
+ return ngControl;
123
+ }
124
+ throw new Error(`...`);
125
+ }
126
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
127
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputService, providedIn: 'root' }); }
128
+ }
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputService, decorators: [{
130
+ type: Injectable,
131
+ args: [{
132
+ providedIn: 'root'
133
+ }]
134
+ }] });
135
+
136
+ /**
137
+ * Enum representing different types of buttons.
138
+ */
139
+ var ButtonType;
140
+ (function (ButtonType) {
141
+ /** A filled button with solid background, typically used for primary actions. */
142
+ ButtonType["FILLED"] = "FILLED";
143
+ /** A tonal button with lighter background, used for secondary actions. */
144
+ ButtonType["TONAL"] = "TONAL";
145
+ /** An outlined button with a border and no background. */
146
+ ButtonType["OUTLINE"] = "OUTLINE";
147
+ /** A text button with no background or border, ideal for minimal UI. */
148
+ ButtonType["TEXT"] = "TEXT";
149
+ /** A warning button with special styling to indicate caution or alert actions. */
150
+ ButtonType["WARNING"] = "WARNING";
151
+ })(ButtonType || (ButtonType = {}));
152
+
153
+ class InputMaskDirective {
154
+ set min(value) {
155
+ this.minimumValue = Number(value);
156
+ }
157
+ set max(value) {
158
+ this.maximumValue = Number(value);
159
+ }
160
+ set float(value) {
161
+ this.isFloat = value === 'true';
162
+ }
163
+ onPaste(event) {
164
+ this.makeValidation(event, true);
165
+ }
166
+ constructor(elementRef) {
167
+ this.elementRef = elementRef;
168
+ this.regexFloat = new RegExp(/^([0-9]*[.])?[0-9]+$/);
169
+ this.regexOnlyNumbers = new RegExp(/^-?[0-9]+(?:\.[0-9]+)?$/);
170
+ this.elementRef.nativeElement.addEventListener('keypress', (event) => {
171
+ this.makeValidation(event);
172
+ });
173
+ }
174
+ makeValidation(event, fromPaste = false) {
175
+ let value;
176
+ let newChar;
177
+ if (!fromPaste) {
178
+ newChar = String.fromCharCode(event.keyCode);
179
+ const cursorPos = event.target.selectionStart;
180
+ const inputText = event.target.value;
181
+ value = `${inputText.slice(0, cursorPos)}${newChar}${inputText.slice(cursorPos, inputText.length)}`;
182
+ }
183
+ else {
184
+ value = event.clipboardData?.getData('text/plain');
185
+ }
186
+ if (this.inputMask === 'number') {
187
+ return this.checkingForNumbers(value, event, newChar, fromPaste);
188
+ }
189
+ else {
190
+ return this.checkingForTexts(value, event);
191
+ }
192
+ }
193
+ checkingForNumbers(value, event, newChar, fromPaste = false) {
194
+ if ((isNaN(this.minimumValue) || this.minimumValue < 0) && value === '-') {
195
+ value = Number('-0');
196
+ }
197
+ if (this.isFloat && (newChar === '.')) {
198
+ value += '0';
199
+ }
200
+ if (!this.isFloat && fromPaste && value.includes('.')) {
201
+ event.preventDefault();
202
+ return false;
203
+ }
204
+ const regex = (this.isFloat) ? this.regexFloat : this.regexOnlyNumbers;
205
+ if (!regex.test(value) ||
206
+ (this.minimumValue && value < this.minimumValue) ||
207
+ (this.maximumValue && value > this.maximumValue)) {
208
+ event.preventDefault();
209
+ return false;
210
+ }
211
+ return true;
212
+ }
213
+ checkingForTexts(value, event) {
214
+ let regex = new RegExp(/^[A-Za-z0-9]*$/);
215
+ if (!regex.test(value)) {
216
+ event.preventDefault();
217
+ return false;
218
+ }
219
+ return true;
220
+ }
221
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputMaskDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
222
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: InputMaskDirective, isStandalone: true, selector: "[inputMask]", inputs: { inputMask: "inputMask", min: "min", max: "max", float: "float" }, host: { listeners: { "paste": "onPaste($event)" } }, ngImport: i0 }); }
223
+ }
224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputMaskDirective, decorators: [{
225
+ type: Directive,
226
+ args: [{
227
+ selector: '[inputMask]',
228
+ standalone: true
229
+ }]
230
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { inputMask: [{
231
+ type: Input
232
+ }], min: [{
233
+ type: Input
234
+ }], max: [{
235
+ type: Input
236
+ }], float: [{
237
+ type: Input
238
+ }], onPaste: [{
239
+ type: HostListener,
240
+ args: ['paste', ['$event']]
241
+ }] } });
242
+
243
+ class IconButtonComponent {
244
+ constructor() {
245
+ this.size = 'medium';
246
+ this.type = 'tonal';
247
+ this.buttonClick = new EventEmitter();
248
+ }
249
+ onClick(event) {
250
+ if (!this.disabled) {
251
+ this.buttonClick.emit();
252
+ }
253
+ }
254
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
255
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: IconButtonComponent, isStandalone: true, selector: "i-tech-icon-button", inputs: { size: "size", type: "type", iconSvg: "iconSvg", iconName: "iconName", tooltip: "tooltip", disabled: "disabled" }, outputs: { buttonClick: "buttonClick" }, ngImport: i0, template: "<button\n *ngIf=\"['tonal','standard'].includes(type)\"\n mat-icon-button\n [ngClass]=\"{small: size === 'small', tonal: type === 'tonal', standard: type === 'standard'}\"\n [matTooltip]=\"tooltip | translate\"\n [matTooltipDisabled]=\"!tooltip\"\n [disabled]=\"disabled || false\"\n (click)=\"onClick($event)\"\n>\n <mat-icon *ngIf=\"iconSvg\" [svgIcon]=\"iconSvg\"></mat-icon>\n <mat-icon *ngIf=\"iconName\">{{iconName}}</mat-icon>\n</button>\n\n<button\n *ngIf=\"type === 'filled'\"\n mat-fab\n class=\"filled\"\n [ngClass]=\"{small: size === 'small'}\"\n [matTooltip]=\"tooltip | translate\"\n [matTooltipDisabled]=\"!tooltip\"\n [color]=\"'primary'\"\n [disabled]=\"disabled || false\"\n (click)=\"onClick($event)\"\n>\n <mat-icon *ngIf=\"iconSvg\" [svgIcon]=\"iconSvg\"></mat-icon>\n <mat-icon *ngIf=\"iconName\">{{iconName}}</mat-icon>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatFabButton, selector: "button[mat-fab]", inputs: ["extended"], exportAs: ["matButton"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
256
+ }
257
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IconButtonComponent, decorators: [{
258
+ type: Component,
259
+ args: [{ selector: 'i-tech-icon-button', imports: [
260
+ MatIconButton,
261
+ NgClass,
262
+ MatTooltip,
263
+ TranslateModule,
264
+ MatIcon,
265
+ MatFabButton,
266
+ NgIf
267
+ ], standalone: true, template: "<button\n *ngIf=\"['tonal','standard'].includes(type)\"\n mat-icon-button\n [ngClass]=\"{small: size === 'small', tonal: type === 'tonal', standard: type === 'standard'}\"\n [matTooltip]=\"tooltip | translate\"\n [matTooltipDisabled]=\"!tooltip\"\n [disabled]=\"disabled || false\"\n (click)=\"onClick($event)\"\n>\n <mat-icon *ngIf=\"iconSvg\" [svgIcon]=\"iconSvg\"></mat-icon>\n <mat-icon *ngIf=\"iconName\">{{iconName}}</mat-icon>\n</button>\n\n<button\n *ngIf=\"type === 'filled'\"\n mat-fab\n class=\"filled\"\n [ngClass]=\"{small: size === 'small'}\"\n [matTooltip]=\"tooltip | translate\"\n [matTooltipDisabled]=\"!tooltip\"\n [color]=\"'primary'\"\n [disabled]=\"disabled || false\"\n (click)=\"onClick($event)\"\n>\n <mat-icon *ngIf=\"iconSvg\" [svgIcon]=\"iconSvg\"></mat-icon>\n <mat-icon *ngIf=\"iconName\">{{iconName}}</mat-icon>\n</button>\n" }]
268
+ }], propDecorators: { size: [{
269
+ type: Input
270
+ }], type: [{
271
+ type: Input
272
+ }], iconSvg: [{
273
+ type: Input
274
+ }], iconName: [{
275
+ type: Input
276
+ }], tooltip: [{
277
+ type: Input
278
+ }], disabled: [{
279
+ type: Input
280
+ }], buttonClick: [{
281
+ type: Output
282
+ }] } });
283
+
284
+ class TextInputComponent {
285
+ set inputData(data) {
286
+ // If submit becomes true, mark the control as touched
287
+ if (data?.submit && this.ngControl.control) {
288
+ this.ngControl.control.markAsTouched();
289
+ }
290
+ this._inputData = data;
291
+ }
292
+ get inputData() {
293
+ return this._inputData;
294
+ }
295
+ constructor(inputService) {
296
+ this.inputService = inputService;
297
+ this.focusOutEmitter = new EventEmitter();
298
+ this.customErrorStateMatcher = {
299
+ isErrorState: (control, form) => {
300
+ return !!(control && control.invalid && this.inputData?.submit);
301
+ }
302
+ };
303
+ this.ngControl = this.inputService.injectNgControl();
304
+ }
305
+ onFocusOut() {
306
+ if (this._inputData.focusOutEmit) {
307
+ this.focusOutEmitter.emit();
308
+ }
309
+ }
310
+ clear() {
311
+ if (this.ngControl) {
312
+ this.ngControl.control.reset();
313
+ }
314
+ }
315
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextInputComponent, deps: [{ token: InputService }], target: i0.ɵɵFactoryTarget.Component }); }
316
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: TextInputComponent, isStandalone: true, selector: "i-tech-text-input", inputs: { inputData: "inputData" }, outputs: { focusOutEmitter: "focusOutEmitter" }, ngImport: i0, template: "<div *ngIf=\"inputData && ngControl\">\n <div class=\"w-100\">\n <mat-label [ngClass]=\"{\n 'readonly-color' : inputData.readOnly || ngControl.control.disabled,\n 'invalid-label-color': !!(ngControl.control.errors && inputData.submit)\n }\"\n *ngIf=\"inputData.label\">\n {{ inputData.label | translate }}\n </mat-label>\n <span *ngIf=\"inputData.required\" class=\"required-input\"\n [ngClass]=\"{'readonly-color' : inputData.readOnly || ngControl.control.disabled}\">*</span>\n </div>\n <mat-form-field appearance=\"outline\" class=\"w-100\"\n [class.readonly-field]=\"inputData.readOnly || ngControl.control.disabled\"\n >\n <!-- Leading Icon -->\n <mat-icon *ngIf=\"inputData.iconPrefix\"\n matPrefix\n [ngClass]=\"{\n 'readonly-color' : !inputData.iconPrefixColor && (inputData.readOnly || ngControl.control.disabled),\n 'default-form-icon-color' : !inputData.iconPrefixColor && !(inputData.readOnly || ngControl.control.disabled)\n }\"\n [matTooltip]=\"((inputData.iconPrefixTooltip || '') | translate)\"\n [style.color]=\"inputData.iconPrefixColor || null\"\n >{{ inputData.iconPrefix }}\n </mat-icon>\n\n <mat-icon *ngIf=\"inputData.iconPrefixSvg\"\n matPrefix\n [matTooltip]=\"((inputData.iconPrefixTooltip || '') | translate)\"\n [svgIcon]=\"inputData.iconPrefixSvg\"\n ></mat-icon>\n\n <!-- Input Field -->\n <input matInput\n *ngIf=\"!inputData.textarea\"\n [type]=\"inputData.type || 'text'\"\n [readonly]=\"inputData.readOnly\"\n [placeholder]=\"(inputData.placeholder || '') | translate\"\n [pattern]=\"inputData.pattern!\"\n [formControl]=\"ngControl.control\"\n [mask]=\"inputData.mask || ''\"\n [ngClass]=\"{'readonly-color readonly-cursor' : inputData.readOnly || ngControl.control.disabled}\"\n [inputMask]=\"inputData.inputMask!\"\n [errorStateMatcher]=\"customErrorStateMatcher\"\n (blur)=\"onFocusOut()\"\n >\n\n <textarea matInput\n *ngIf=\"inputData.textarea\"\n [type]=\"inputData.type || 'text'\"\n [readonly]=\"inputData.readOnly\"\n [placeholder]=\"(inputData.placeholder || '') | translate\"\n [pattern]=\"inputData.pattern!\"\n [formControl]=\"ngControl.control\"\n [ngClass]=\"{'readonly-color' : inputData.readOnly || ngControl.control.disabled}\"\n [errorStateMatcher]=\"customErrorStateMatcher\"\n ></textarea>\n\n <!-- Clear Icon -->\n <i-tech-icon-button\n *ngIf=\"inputData.clearable\"\n iconName=\"cancel\"\n matSuffix\n [disabled]=\"inputData.readOnly || ngControl.control.disabled || false\"\n [ngClass]=\"inputData.readOnly || ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n (click)=\"clear()\"\n >\n </i-tech-icon-button>\n\n <!-- Trailing Icon -->\n <i-tech-icon-button\n *ngIf=\"inputData.iconSuffix\"\n [iconName]=\"inputData.iconSuffix\"\n [disabled]=\"inputData.readOnly || ngControl.control.disabled || false\"\n [ngClass]=\"inputData.readOnly || ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n matSuffix\n >\n </i-tech-icon-button>\n\n <!-- Error Messages -->\n <mat-error *ngIf=\"!!(ngControl.control.errors && inputData.submit)\">\n {{ ngControl.control | generateErrorMessages : (inputData.label || '') : inputData.defaultPatternKey }}\n </mat-error>\n\n <!-- Helper Text -->\n <mat-hint *ngIf=\"!(!!(ngControl.control.errors && inputData.submit)) && inputData.hint\">\n {{ inputData.hint | translate }}\n </mat-hint>\n </mat-form-field>\n</div>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: GenerateErrorMessagesPipe, name: "generateErrorMessages" }, { kind: "component", type: IconButtonComponent, selector: "i-tech-icon-button", inputs: ["size", "type", "iconSvg", "iconName", "tooltip", "disabled"], outputs: ["buttonClick"] }, { kind: "directive", type: InputMaskDirective, selector: "[inputMask]", inputs: ["inputMask", "min", "max", "float"] }, { kind: "directive", type: NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "showTemplate", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }] }); }
317
+ }
318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextInputComponent, decorators: [{
319
+ type: Component,
320
+ args: [{ selector: 'i-tech-text-input', imports: [
321
+ TranslateModule,
322
+ NgClass,
323
+ MatIcon,
324
+ MatTooltip,
325
+ MatInput,
326
+ ReactiveFormsModule,
327
+ NgIf,
328
+ GenerateErrorMessagesPipe,
329
+ IconButtonComponent,
330
+ InputMaskDirective,
331
+ NgxMaskDirective,
332
+ MatFormFieldModule
333
+ ], standalone: true, template: "<div *ngIf=\"inputData && ngControl\">\n <div class=\"w-100\">\n <mat-label [ngClass]=\"{\n 'readonly-color' : inputData.readOnly || ngControl.control.disabled,\n 'invalid-label-color': !!(ngControl.control.errors && inputData.submit)\n }\"\n *ngIf=\"inputData.label\">\n {{ inputData.label | translate }}\n </mat-label>\n <span *ngIf=\"inputData.required\" class=\"required-input\"\n [ngClass]=\"{'readonly-color' : inputData.readOnly || ngControl.control.disabled}\">*</span>\n </div>\n <mat-form-field appearance=\"outline\" class=\"w-100\"\n [class.readonly-field]=\"inputData.readOnly || ngControl.control.disabled\"\n >\n <!-- Leading Icon -->\n <mat-icon *ngIf=\"inputData.iconPrefix\"\n matPrefix\n [ngClass]=\"{\n 'readonly-color' : !inputData.iconPrefixColor && (inputData.readOnly || ngControl.control.disabled),\n 'default-form-icon-color' : !inputData.iconPrefixColor && !(inputData.readOnly || ngControl.control.disabled)\n }\"\n [matTooltip]=\"((inputData.iconPrefixTooltip || '') | translate)\"\n [style.color]=\"inputData.iconPrefixColor || null\"\n >{{ inputData.iconPrefix }}\n </mat-icon>\n\n <mat-icon *ngIf=\"inputData.iconPrefixSvg\"\n matPrefix\n [matTooltip]=\"((inputData.iconPrefixTooltip || '') | translate)\"\n [svgIcon]=\"inputData.iconPrefixSvg\"\n ></mat-icon>\n\n <!-- Input Field -->\n <input matInput\n *ngIf=\"!inputData.textarea\"\n [type]=\"inputData.type || 'text'\"\n [readonly]=\"inputData.readOnly\"\n [placeholder]=\"(inputData.placeholder || '') | translate\"\n [pattern]=\"inputData.pattern!\"\n [formControl]=\"ngControl.control\"\n [mask]=\"inputData.mask || ''\"\n [ngClass]=\"{'readonly-color readonly-cursor' : inputData.readOnly || ngControl.control.disabled}\"\n [inputMask]=\"inputData.inputMask!\"\n [errorStateMatcher]=\"customErrorStateMatcher\"\n (blur)=\"onFocusOut()\"\n >\n\n <textarea matInput\n *ngIf=\"inputData.textarea\"\n [type]=\"inputData.type || 'text'\"\n [readonly]=\"inputData.readOnly\"\n [placeholder]=\"(inputData.placeholder || '') | translate\"\n [pattern]=\"inputData.pattern!\"\n [formControl]=\"ngControl.control\"\n [ngClass]=\"{'readonly-color' : inputData.readOnly || ngControl.control.disabled}\"\n [errorStateMatcher]=\"customErrorStateMatcher\"\n ></textarea>\n\n <!-- Clear Icon -->\n <i-tech-icon-button\n *ngIf=\"inputData.clearable\"\n iconName=\"cancel\"\n matSuffix\n [disabled]=\"inputData.readOnly || ngControl.control.disabled || false\"\n [ngClass]=\"inputData.readOnly || ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n (click)=\"clear()\"\n >\n </i-tech-icon-button>\n\n <!-- Trailing Icon -->\n <i-tech-icon-button\n *ngIf=\"inputData.iconSuffix\"\n [iconName]=\"inputData.iconSuffix\"\n [disabled]=\"inputData.readOnly || ngControl.control.disabled || false\"\n [ngClass]=\"inputData.readOnly || ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n matSuffix\n >\n </i-tech-icon-button>\n\n <!-- Error Messages -->\n <mat-error *ngIf=\"!!(ngControl.control.errors && inputData.submit)\">\n {{ ngControl.control | generateErrorMessages : (inputData.label || '') : inputData.defaultPatternKey }}\n </mat-error>\n\n <!-- Helper Text -->\n <mat-hint *ngIf=\"!(!!(ngControl.control.errors && inputData.submit)) && inputData.hint\">\n {{ inputData.hint | translate }}\n </mat-hint>\n </mat-form-field>\n</div>\n" }]
334
+ }], ctorParameters: () => [{ type: InputService }], propDecorators: { inputData: [{
335
+ type: Input
336
+ }], focusOutEmitter: [{
337
+ type: Output
338
+ }] } });
339
+
340
+ /**
341
+ * A reusable button component with Material Design styling and custom functionality.
342
+ */
343
+ class ButtonComponent {
344
+ constructor() {
345
+ /**
346
+ * The text displayed inside the button.
347
+ */
348
+ this.text = '';
349
+ /**
350
+ * Data attribute used for Cypress or other testing frameworks.
351
+ */
352
+ this.data_cy = '';
353
+ /**
354
+ * Font icon class for displaying an icon (e.g., Material Icons).
355
+ */
356
+ this.fontIcon = '';
357
+ /**
358
+ * SVG icon name for displaying an SVG icon.
359
+ */
360
+ this.svgIcon = '';
361
+ /**
362
+ * Defines the type of button (e.g., `FILLED`, `OUTLINED`).
363
+ */
364
+ this.type = ButtonType.FILLED;
365
+ /**
366
+ * Additional custom classes to style the button.
367
+ */
368
+ this.customClass = '';
369
+ /**
370
+ * If true, the button acts as a submit button.
371
+ */
372
+ this.submit = false;
373
+ /**
374
+ * If true, the button is disabled and cannot be clicked.
375
+ */
376
+ this.disabled = false;
377
+ /**
378
+ * Indicates whether the button is currently activated.
379
+ */
380
+ this.activated = false;
381
+ /**
382
+ * The color of the button (e.g., `primary`, `warn`).
383
+ */
384
+ this.color = 'primary';
385
+ /**
386
+ * Emits an event when the button is clicked.
387
+ */
388
+ this.buttonClick = new EventEmitter();
389
+ /**
390
+ * Enum reference for `ButtonType` to use in templates.
391
+ */
392
+ this.ButtonType = ButtonType;
393
+ }
394
+ /**
395
+ * Handles the button click event.
396
+ *
397
+ * @param event - The mouse event triggered by clicking the button.
398
+ */
399
+ onClick(event) {
400
+ if (!this.disabled && !this.submit) {
401
+ this.buttonClick.emit();
402
+ }
403
+ }
404
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
405
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ButtonComponent, isStandalone: true, selector: "i-tech-button", inputs: { text: "text", data_cy: "data_cy", fontIcon: "fontIcon", svgIcon: "svgIcon", type: "type", customClass: "customClass", submit: "submit", disabled: "disabled", activated: "activated", color: "color" }, outputs: { buttonClick: "buttonClick" }, providers: [
406
+ NgxMaskDirective,
407
+ NgxMaskPipe,
408
+ TranslatePipe,
409
+ TranslateService
410
+ ], ngImport: i0, template: "<button *ngIf=\"[ButtonType.FILLED,ButtonType.WARNING].includes(type)\"\n mat-flat-button\n [attr.data-cy]=\"data_cy\"\n [color]=\"type === ButtonType.WARNING ? 'warn' : color\"\n [class.activated]=\"activated\"\n [ngClass]=\"(customClass || '')\"\n [disabled]=\"disabled || submit\"\n (click)=\"onClick($event)\"\n>\n <span *ngIf=\"submit\" class=\"spinner-overlay\">\n <mat-spinner diameter=\"16\"></mat-spinner>\n </span>\n <mat-icon *ngIf=\"fontIcon && !submit\">{{fontIcon}}</mat-icon>\n <mat-icon *ngIf=\"svgIcon && !submit\" [svgIcon]=\"svgIcon\"></mat-icon>\n <span>{{text | translate}}</span>\n</button>\n<button *ngIf=\"[ButtonType.TONAL,ButtonType.TEXT].includes(type)\"\n mat-button\n [attr.data-cy]=\"data_cy\"\n [ngClass]=\"(type === ButtonType.TONAL ? 'tertiary ' : '') + (customClass || '')\"\n [class.activated]=\"activated\"\n [disabled]=\"disabled || submit\"\n (click)=\"onClick($event)\"\n>\n <span *ngIf=\"submit\" class=\"spinner-overlay\">\n <mat-spinner diameter=\"16\"></mat-spinner>\n </span>\n <mat-icon *ngIf=\"fontIcon && !submit\">{{fontIcon}}</mat-icon>\n <mat-icon *ngIf=\"svgIcon && !submit\" [svgIcon]=\"svgIcon\"></mat-icon>\n\n <span>{{text | translate}}</span>\n</button>\n<button *ngIf=\"type === ButtonType.OUTLINE\"\n [color]=\"color\"\n mat-stroked-button\n [attr.data-cy]=\"data_cy\"\n [ngClass]=\"(customClass || '') \"\n [disabled]=\"disabled || submit\"\n (click)=\"onClick($event)\"\n [class.activated]=\"activated\"\n>\n <span *ngIf=\"submit\" class=\"spinner-overlay\">\n <mat-spinner diameter=\"16\"></mat-spinner>\n </span>\n <mat-icon *ngIf=\"fontIcon && !submit\" >{{fontIcon}}</mat-icon>\n <mat-icon *ngIf=\"svgIcon && !submit\" [svgIcon]=\"svgIcon\"></mat-icon>\n <span>{{text | translate}}</span>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
411
+ }
412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ButtonComponent, decorators: [{
413
+ type: Component,
414
+ args: [{ selector: 'i-tech-button', standalone: true, imports: [
415
+ MatButton,
416
+ NgClass,
417
+ MatProgressSpinner,
418
+ NgIf,
419
+ MatIconModule,
420
+ TranslateModule
421
+ ], providers: [
422
+ NgxMaskDirective,
423
+ NgxMaskPipe,
424
+ TranslatePipe,
425
+ TranslateService
426
+ ], template: "<button *ngIf=\"[ButtonType.FILLED,ButtonType.WARNING].includes(type)\"\n mat-flat-button\n [attr.data-cy]=\"data_cy\"\n [color]=\"type === ButtonType.WARNING ? 'warn' : color\"\n [class.activated]=\"activated\"\n [ngClass]=\"(customClass || '')\"\n [disabled]=\"disabled || submit\"\n (click)=\"onClick($event)\"\n>\n <span *ngIf=\"submit\" class=\"spinner-overlay\">\n <mat-spinner diameter=\"16\"></mat-spinner>\n </span>\n <mat-icon *ngIf=\"fontIcon && !submit\">{{fontIcon}}</mat-icon>\n <mat-icon *ngIf=\"svgIcon && !submit\" [svgIcon]=\"svgIcon\"></mat-icon>\n <span>{{text | translate}}</span>\n</button>\n<button *ngIf=\"[ButtonType.TONAL,ButtonType.TEXT].includes(type)\"\n mat-button\n [attr.data-cy]=\"data_cy\"\n [ngClass]=\"(type === ButtonType.TONAL ? 'tertiary ' : '') + (customClass || '')\"\n [class.activated]=\"activated\"\n [disabled]=\"disabled || submit\"\n (click)=\"onClick($event)\"\n>\n <span *ngIf=\"submit\" class=\"spinner-overlay\">\n <mat-spinner diameter=\"16\"></mat-spinner>\n </span>\n <mat-icon *ngIf=\"fontIcon && !submit\">{{fontIcon}}</mat-icon>\n <mat-icon *ngIf=\"svgIcon && !submit\" [svgIcon]=\"svgIcon\"></mat-icon>\n\n <span>{{text | translate}}</span>\n</button>\n<button *ngIf=\"type === ButtonType.OUTLINE\"\n [color]=\"color\"\n mat-stroked-button\n [attr.data-cy]=\"data_cy\"\n [ngClass]=\"(customClass || '') \"\n [disabled]=\"disabled || submit\"\n (click)=\"onClick($event)\"\n [class.activated]=\"activated\"\n>\n <span *ngIf=\"submit\" class=\"spinner-overlay\">\n <mat-spinner diameter=\"16\"></mat-spinner>\n </span>\n <mat-icon *ngIf=\"fontIcon && !submit\" >{{fontIcon}}</mat-icon>\n <mat-icon *ngIf=\"svgIcon && !submit\" [svgIcon]=\"svgIcon\"></mat-icon>\n <span>{{text | translate}}</span>\n</button>\n" }]
427
+ }], ctorParameters: () => [], propDecorators: { text: [{
428
+ type: Input
429
+ }], data_cy: [{
430
+ type: Input
431
+ }], fontIcon: [{
432
+ type: Input
433
+ }], svgIcon: [{
434
+ type: Input
435
+ }], type: [{
436
+ type: Input
437
+ }], customClass: [{
438
+ type: Input
439
+ }], submit: [{
440
+ type: Input
441
+ }], disabled: [{
442
+ type: Input
443
+ }], activated: [{
444
+ type: Input
445
+ }], color: [{
446
+ type: Input
447
+ }], buttonClick: [{
448
+ type: Output
449
+ }] } });
450
+
451
+ class ClearValueComponent {
452
+ constructor() {
453
+ this.reset = new EventEmitter();
454
+ }
455
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ClearValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
456
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ClearValueComponent, isStandalone: true, selector: "i-tech-clear-value", inputs: { className: "className", additionalClass: "additionalClass" }, outputs: { reset: "reset" }, ngImport: i0, template: `<img
457
+ class="pointer"
458
+ [ngClass]="className || 'standard'"
459
+ (click)="reset.emit()"
460
+ ngSrc="./ic_close.svg"
461
+ height="24" width="24" alt=""/>`, isInline: true, styles: ["img{position:absolute;width:15px;height:15px}.big{width:25px;height:25px}.range_date{right:-65px;top:15px}.standard{right:-20px;top:40px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }] }); }
462
+ }
463
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ClearValueComponent, decorators: [{
464
+ type: Component,
465
+ args: [{ selector: 'i-tech-clear-value', template: `<img
466
+ class="pointer"
467
+ [ngClass]="className || 'standard'"
468
+ (click)="reset.emit()"
469
+ ngSrc="./ic_close.svg"
470
+ height="24" width="24" alt=""/>`, imports: [
471
+ NgClass,
472
+ NgOptimizedImage
473
+ ], standalone: true, styles: ["img{position:absolute;width:15px;height:15px}.big{width:25px;height:25px}.range_date{right:-65px;top:15px}.standard{right:-20px;top:40px}\n"] }]
474
+ }], propDecorators: { className: [{
475
+ type: Input
476
+ }], additionalClass: [{
477
+ type: Input
478
+ }], reset: [{
479
+ type: Output
480
+ }] } });
481
+
482
+ class AutocompleteSelectComponent {
483
+ /**
484
+ * For working configs.
485
+ */
486
+ set configs(data) {
487
+ this.selectConfig = data;
488
+ if (!data) {
489
+ return;
490
+ }
491
+ if ((typeof this.selectConfig.paginate) === 'function') {
492
+ if (this.firstRequest) {
493
+ return;
494
+ }
495
+ this.getData();
496
+ this.firstRequest = true;
497
+ return;
498
+ }
499
+ this.data = this.selectConfig.paginate;
500
+ this.findAndSetDefaultValueFromData();
501
+ }
502
+ ;
503
+ handleVisibilityChange() {
504
+ this.tabVisibility = !document.hidden;
505
+ if (this.ngControl.control.value) {
506
+ return;
507
+ }
508
+ this.closePanelAndUnsetFocus();
509
+ if (!document.hidden) {
510
+ this.isNeededForRecall = true;
511
+ this.pending = true;
512
+ setTimeout(() => {
513
+ this.pending = false;
514
+ }, 4000);
515
+ }
516
+ }
517
+ constructor(inputService) {
518
+ this.inputService = inputService;
519
+ this.selectionChange = new EventEmitter();
520
+ this.emitAction = new EventEmitter();
521
+ this.pending = false;
522
+ this.data = [];
523
+ this.paginationData = { current: 1, last: 0 };
524
+ this.firstRequest = false;
525
+ this.showPlaceholder = true;
526
+ this.isNeededForRecall = false;
527
+ this.accessToNextRequest = true;
528
+ this.disabled = false;
529
+ this.blockRecallDefaultValueSetter = false;
530
+ this.requestLoading = false;
531
+ this.ButtonType = ButtonType;
532
+ this.customErrorStateMatcher = {
533
+ isErrorState: (control, form) => {
534
+ return !!(control && control.invalid && this.submitValue);
535
+ }
536
+ };
537
+ this.ngControl = this.inputService.injectNgControl();
538
+ }
539
+ ngOnChanges(changes) {
540
+ if (changes['selectConfig'] && this.selectConfig) {
541
+ if ((typeof this.selectConfig.paginate) === 'function') {
542
+ this.getData();
543
+ }
544
+ }
545
+ }
546
+ ngAfterViewInit() {
547
+ this.ngControl.control.valueChanges.subscribe((res) => {
548
+ if (this.data.length && res && !this.blockRecallDefaultValueSetter) {
549
+ this.findAndSetDefaultValueFromData();
550
+ }
551
+ });
552
+ }
553
+ hardReload() {
554
+ this.getData('', true);
555
+ }
556
+ /**
557
+ * Dynamic request for select data.
558
+ * @param searchText - The input value to search options by.
559
+ * @param fromSearch - Access for search .
560
+ * @returns Select data.
561
+ */
562
+ getData(searchText, fromSearch) {
563
+ if (!fromSearch && !this.accessToNextRequest) {
564
+ return;
565
+ }
566
+ if (this.requestLoading) {
567
+ return;
568
+ }
569
+ if (fromSearch) {
570
+ this.paginationData.current = 1;
571
+ this.accessToNextRequest = true;
572
+ }
573
+ const functionToDo = this.selectConfig.paginate(this.paginationData.current, searchText);
574
+ this.requestLoading = true;
575
+ functionToDo?.subscribe((data) => {
576
+ const dataToAdd = ('content' in data) ? data.content : data;
577
+ if ('content' in data) {
578
+ this.accessToNextRequest = !data.last || (data.totalPages > this.paginationData.current);
579
+ }
580
+ this.data = (fromSearch || this.selectConfig?.blockPagination) ? dataToAdd : [...this.data, ...dataToAdd];
581
+ this.pending = false;
582
+ this.requestLoading = false;
583
+ if (!dataToAdd.length) {
584
+ this.paginationData.last = this.paginationData.current;
585
+ return;
586
+ }
587
+ this.paginationData.current += 1;
588
+ this.paginationData.last += 1;
589
+ setTimeout(() => {
590
+ this.findAndSetDefaultValueFromData();
591
+ }, 10);
592
+ }, () => {
593
+ this.pending = false;
594
+ this.requestLoading = false;
595
+ });
596
+ }
597
+ findAndSetDefaultValueFromData() {
598
+ if (this.selectConfig.multiple) {
599
+ if (this.ngControl.value && this.ngControl.value.length == 1) {
600
+ this.setShowingValue(this.data.find((item) => item.id === this.ngControl.value[0]));
601
+ }
602
+ }
603
+ else {
604
+ const isDisabled = this.ngControl.disabled;
605
+ if (isDisabled) {
606
+ // TODO Remove after migrating all selects
607
+ // this.ngControl.control.enable();
608
+ // if (!this.ngControl.value && !this.data.length) {
609
+ // this.ngControl.control.disable();
610
+ // return;
611
+ // }
612
+ // this.setDefaultValue();
613
+ // this.ngControl.control.disable();
614
+ }
615
+ else {
616
+ if (!this.ngControl.value && !this.data) {
617
+ return;
618
+ }
619
+ this.setDefaultValue();
620
+ }
621
+ }
622
+ }
623
+ setDefaultValue() {
624
+ this.defaultValue = this.data.find((item) => item.id === this.ngControl.value);
625
+ this.baseData = this.defaultValue;
626
+ if (!this.defaultValue) {
627
+ return;
628
+ }
629
+ this.selectionChange.emit();
630
+ this.setShowingValue(this.defaultValue);
631
+ }
632
+ optionClick(showingData) {
633
+ this.baseData = showingData;
634
+ if (!this.selectConfig.multiple) {
635
+ this.setShowingValue(showingData);
636
+ this.matSelect.close();
637
+ return;
638
+ }
639
+ if (this.searchInput) {
640
+ if (this.selectConfig.multiple) {
641
+ this.searchInput?.nativeElement?.focus();
642
+ }
643
+ else {
644
+ this.inputFocusOut();
645
+ }
646
+ }
647
+ this.setShowingValue(showingData);
648
+ this.showPlaceholder = false;
649
+ }
650
+ addNewItemEvent() {
651
+ this.isNeededForRecall = true;
652
+ this.emitAction.emit();
653
+ }
654
+ /**
655
+ * Filter and show.
656
+ * @param data - Existing chosen data.
657
+ */
658
+ setShowingValue(data) {
659
+ if (!data) {
660
+ return;
661
+ }
662
+ // TODO refactor this part fully
663
+ let include = data;
664
+ let includeOptional = data;
665
+ if (this.selectConfig.valueToShowByKey) {
666
+ this.selectConfig.valueToShowByKey.forEach((param) => {
667
+ if (typeof param === 'object') {
668
+ param.forEach((key) => {
669
+ include = (include) ? include[key] : null;
670
+ });
671
+ }
672
+ else {
673
+ include = include[param];
674
+ }
675
+ });
676
+ if (this.selectConfig.showFullTextWithOptionalOnSelectedValue) {
677
+ this.selectConfig.valueToShowByParam?.forEach((param) => {
678
+ if (typeof param === 'object') {
679
+ param.forEach((key) => {
680
+ includeOptional = (includeOptional) ? includeOptional[key] : null;
681
+ });
682
+ }
683
+ else {
684
+ includeOptional = includeOptional[param];
685
+ }
686
+ });
687
+ if (this.selectConfig.valueToShowByParam && typeof includeOptional === 'string') {
688
+ include += (this.selectConfig.withParamSymbol || '') + includeOptional;
689
+ }
690
+ }
691
+ }
692
+ this.showingValue = include;
693
+ this.blockRecallDefaultValueSetter = true;
694
+ }
695
+ /**
696
+ * Block another events.
697
+ * @param event - Element click event.
698
+ */
699
+ preventDefault(event) {
700
+ if (!this.selectConfig.multiple) {
701
+ return;
702
+ }
703
+ event.preventDefault();
704
+ }
705
+ registerPanelScrollEvent(element) {
706
+ if (this.selectConfig.paginateOnScroll === false) {
707
+ return;
708
+ }
709
+ const panel = element.panel.nativeElement;
710
+ panel.addEventListener('scroll', (event) => this.loadDataOnScroll(event));
711
+ }
712
+ loadDataOnScroll(event) {
713
+ const pos = (event.target.scrollTop || event.target.scrollTop) + event.target.offsetHeight;
714
+ const max = event.target.scrollHeight;
715
+ if ((pos + 1) >= max) {
716
+ if (this.paginationData.current === this.paginationData.last || this.selectConfig.blockPagination) {
717
+ return;
718
+ }
719
+ this.getData();
720
+ }
721
+ }
722
+ focusSearchInput() {
723
+ if (this.selectConfig.search && this.searchInput) {
724
+ this.searchInput.nativeElement.focus();
725
+ }
726
+ }
727
+ inputFocusOut() {
728
+ this.isNeededForRecall = !!this.searchInput.nativeElement.value;
729
+ this.searchInput.nativeElement.value = '';
730
+ this.showPlaceholder = true;
731
+ this.clearTimeoutForSearch();
732
+ }
733
+ resetValue() {
734
+ this.selectionChange.emit(null);
735
+ this.ngControl.reset(null);
736
+ this.inputFocusOut();
737
+ }
738
+ getDataWithSearch(value, event) {
739
+ this.clearTimeoutForSearch();
740
+ if (value.length >= 1) {
741
+ this.searchTimeoutId = setTimeout(() => {
742
+ this.getData(value, true);
743
+ }, 800);
744
+ }
745
+ else if (value.length <= 1 && event.keyCode === 8) {
746
+ this.getData(value, true);
747
+ }
748
+ }
749
+ clearTimeoutForSearch() {
750
+ if (this.searchTimeoutId) {
751
+ clearTimeout(this.searchTimeoutId);
752
+ this.searchTimeoutId = 0;
753
+ }
754
+ }
755
+ openSelection() {
756
+ if (this.selectConfig.disabled || this.ngControl.control.disabled) {
757
+ return;
758
+ }
759
+ this.showPlaceholder ? this.matSelect.open() : this.closePanelAndUnsetFocus();
760
+ this.showPlaceholder = !this.showPlaceholder;
761
+ if (!this.showPlaceholder) {
762
+ this.reCallData();
763
+ }
764
+ }
765
+ closePanelAndUnsetFocus() {
766
+ this.matSelect.close();
767
+ if (this.searchInput) {
768
+ this.searchInput.nativeElement.blur();
769
+ }
770
+ }
771
+ openedChange(event) {
772
+ if (event) {
773
+ if (this.isNeededForRecall) {
774
+ this.reCallData();
775
+ return;
776
+ }
777
+ if (!this.selectConfig.search) {
778
+ this.pending = false;
779
+ this.reCallData();
780
+ }
781
+ return;
782
+ }
783
+ this.showPlaceholder = true;
784
+ }
785
+ reCallData() {
786
+ // TODO refactor this part
787
+ if (!this.isNeededForRecall) {
788
+ return;
789
+ }
790
+ this.data = [];
791
+ this.pending = true;
792
+ this.paginationData = {
793
+ current: 1,
794
+ last: 0
795
+ };
796
+ this.accessToNextRequest = true;
797
+ if ((typeof this.selectConfig.paginate) === 'function') {
798
+ this.getData();
799
+ }
800
+ else {
801
+ this.pending = false;
802
+ this.data = this.selectConfig.paginate;
803
+ }
804
+ this.isNeededForRecall = false;
805
+ }
806
+ emitSelectionChangeAndClose(event) {
807
+ this.selectionChange.emit(event.value);
808
+ if (this.selectConfig.multiple) {
809
+ if (!event.value?.length) {
810
+ this.ngControl.control.reset();
811
+ }
812
+ return;
813
+ }
814
+ this.matSelect.close();
815
+ }
816
+ iconClick(matSelect, searchInput) {
817
+ matSelect.open();
818
+ searchInput?.nativeElement?.focus();
819
+ }
820
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AutocompleteSelectComponent, deps: [{ token: InputService }], target: i0.ɵɵFactoryTarget.Component }); }
821
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AutocompleteSelectComponent, isStandalone: true, selector: "i-tech-autocomplete-select", inputs: { className: "className", submitValue: "submitValue", configs: "configs", detectChanges: "detectChanges" }, outputs: { selectionChange: "selectionChange", emitAction: "emitAction" }, host: { listeners: { "document:visibilitychange": "handleVisibilityChange()" } }, viewQueries: [{ propertyName: "matSelect", first: true, predicate: ["matSelect"], descendants: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "allSelected", first: true, predicate: ["allSelected"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"new-mat-autocomplete\" id=\"mat_autocomplete\"\n [ngClass]=\"{\n 'mat-select-without_icon': !selectConfig.iconUrl && !selectConfig.activeStateIconUrl,\n 'mat-select-with-search': selectConfig.search,\n 'without-label': selectConfig.hideLabel,\n 'invalid_field': ngControl.control.errors && submitValue,\n 'readonly-field': selectConfig.readOnly || ngControl.control.disabled\n }\"\n [matTooltip]=\"(selectConfig.hover && !ngControl.control.disabled ? ((selectConfig.hover || '') | translate) : '')\"\n [matTooltipClass]=\"'mat-mdc-tooltip big-td-mat-tooltip'\"\n [matTooltipPosition]=\"'above'\"\n *ngIf=\"selectConfig && ngControl\">\n\n <div class=\"w-100\" *ngIf=\"!selectConfig.hideLabel\">\n <mat-label [ngClass]=\"{\n 'readonly-color' : selectConfig.readOnly || ngControl.control.disabled,\n 'invalid-label-color': !!(ngControl.control.errors && submitValue)\n }\">\n {{ selectConfig.label | translate }}\n </mat-label>\n <span *ngIf=\"selectConfig.required\" class=\"required-input\"\n [ngClass]=\"{'readonly-color' : ngControl.control.disabled}\">*</span>\n </div>\n\n\n <!-- Search Input -->\n <div class=\"search-input w-100\"\n (click)=\"$event.stopPropagation();$event.preventDefault()\"\n [ngClass]=\"{ hide_input_placeholder: showPlaceholder || ngControl.control.disabled }\"\n *ngIf=\"selectConfig.search\"\n >\n <input autocomplete=\"off\"\n id=\"searchInput\"\n type=\"text\"\n [ngClass]=\"{'pr-25': !selectConfig.iconUrl}\"\n #searchInput\n [disabled]=\"ngControl.control.disabled || selectConfig.hover\"\n [placeholder]=\"(ngControl.control.disabled || selectConfig.hover) ? '' : 'Search'\"\n (focusout)=\"inputFocusOut()\"\n (focus)=\"openSelection()\"\n (keydown)=\"$event.stopPropagation()\"\n (keyup)=\"getDataWithSearch(searchInput.value,$event)\">\n\n <!-- Search Icon -->\n <span class=\"search-icon\">\n <i-tech-icon-button\n class=\"mr-10\"\n [ngClass]=\"selectConfig.readOnly || ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n *ngIf=\"selectConfig.iconPrefix && !showPlaceholder\"\n [iconName]=\"selectConfig.iconPrefix || ''\"\n [disabled]=\"selectConfig.readOnly || false\"\n matPrefix\n >\n </i-tech-icon-button>\n </span>\n </div>\n\n <!-- Placeholder/Selected Value Display -->\n <ng-container *ngIf=\"showPlaceholder && selectConfig.search\">\n <div class=\"custom-placeholder\"\n *ngIf=\"(!ngControl?.value && !ngControl?.value?.length) ||\n (selectConfig.multiple && ngControl?.value && !ngControl?.value?.length)\"\n [ngClass]=\"selectConfig.readOnly || ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n >\n {{ ((selectConfig.placeholder || '') | translate) }}\n </div>\n <div class=\"custom-placeholder custom-value ellipsis\"\n [ngClass]=\"{\n 'pr-42': selectConfig.iconUrl,\n 'readonly-color': selectConfig.readOnly || ngControl.control.disabled,\n 'default-form-icon-color': !(selectConfig.readOnly || ngControl.control.disabled)\n }\"\n *ngIf=\"ngControl?.value\"\n >\n {{ selectConfig?.multiple ? (ngControl.value | arrayToString) : showingValue }}\n </div>\n </ng-container>\n\n <!-- Custom Icon -->\n <img class=\"left_icon_new pointer\"\n (click)=\"iconClick(matSelect, searchInput)\"\n *ngIf=\"!selectConfig.matIconName && (selectConfig.iconUrl || selectConfig.activeStateIconUrl)\"\n [src]=\"'assets/images/icons/global/' + (ngControl.control?.value && selectConfig?.activeStateIconUrl ? selectConfig.activeStateIconUrl : selectConfig.iconUrl)\">\n\n <mat-form-field appearance=\"outline\" class=\"w-100\" (click)=\"selectConfig?.search ? focusSearchInput() : null\">\n <!-- Material Select -->\n <mat-select #matSelect=\"matSelect\"\n [panelClass]=\"'autocomplete-transform-panel-location'\"\n [attr.aria-placeholder]=\"(selectConfig.placeholder || '') | translate\"\n [aria-label]=\"selectConfig.label | translate\"\n [id]=\"selectConfig.filtrationKey || ''\"\n (opened)=\"registerPanelScrollEvent(matSelect)\"\n (openedChange)=\"openedChange($event)\"\n [formControl]=\"ngControl.control\"\n [multiple]=\"selectConfig.multiple\"\n (selectionChange)=\"emitSelectionChangeAndClose($event)\"\n [errorStateMatcher]=\"customErrorStateMatcher\"\n [placeholder]=\"(selectConfig.placeholder || '') | translate\"\n [disabled]=\"ngControl.control.disabled\"\n >\n\n <!-- Loading State -->\n <mat-option *ngIf=\"pending\" class=\"option_loading relative\">\n <div class=\"request_loading\">\n <img ngSrc=\"./loader.svg\" alt=\"\" height=\"200\" width=\"200\"/>\n </div>\n </mat-option>\n\n <!-- Options -->\n <ng-container *ngIf=\"data?.length && !pending\">\n <!-- Add New Option -->\n <mat-option *ngIf=\"selectConfig.actions\"\n class=\"pointer add_new\"\n disabled\n (click)=\"closePanelAndUnsetFocus();addNewItemEvent()\">\n <!-- (click)=\"ngControl.control.reset(null);matSelect._onBlur();closePanelAndUnsetFocus();addNewItemEvent()\">-->\n <i-tech-button\n [type]=\"ButtonType.OUTLINE\"\n [fontIcon]=\"'add'\"\n [text]=\"('dropdown_add_item' | translate : {INPUT_NAME: (selectConfig.label | translate)}) \"\n [customClass]=\"'w-100 mat-autocomplete-select-button'\">\n </i-tech-button>\n </mat-option>\n\n <!-- Regular Options -->\n <ng-container *ngIf=\"!selectConfig?.changeText && data.length\">\n <mat-option *ngFor=\"let item of data\"\n [value]=\"selectConfig.valueByKey | getValueByKeyFromObject : item\"\n (mouseup)=\"optionClick(item)\"\n (mousedown)=\"preventDefault($event)\">\n {{ ((selectConfig.valueToShowByKey | getValueByKeyFromObject : item : selectConfig.valueToShowByParam : selectConfig.withParamSymbol) || '') | translate }}\n </mat-option>\n </ng-container>\n\n <!-- Custom Text Options -->\n <ng-container *ngIf=\"selectConfig?.changeText && data.length\">\n <mat-option *ngFor=\"let item of data\"\n [value]=\"selectConfig.valueByKey | getValueByKeyFromObject : item\"\n (mouseup)=\"optionClick(item)\"\n (mousedown)=\"preventDefault($event)\"\n [disabled]=\"selectConfig?.changeText[item].disabled\">\n {{ selectConfig?.changeText[item].text | translate }}\n </mat-option>\n </ng-container>\n </ng-container>\n\n <!-- Empty State -->\n <ng-container *ngIf=\"!pending && !data.length\">\n <mat-option disabled class=\"empty_selection_state\">\n <div class=\"actions_and_tile add_new flex_column w-100 flex_center_align_center\">\n <span>{{ 'dropdown_no_items' | translate }}</span>\n <div class=\"mt-10\">\n <i-tech-button\n *ngIf=\"selectConfig?.actions\"\n [type]=\"ButtonType.OUTLINE\"\n (buttonClick)=\"closePanelAndUnsetFocus();addNewItemEvent()\"\n [customClass]=\"'mat-autocomplete-select-button'\"\n [fontIcon]=\"'add'\"\n [text]=\"('dropdown_add_item' | translate : {INPUT_NAME: (selectConfig.label | translate)}) \">\n </i-tech-button>\n </div>\n </div>\n </mat-option>\n </ng-container>\n </mat-select>\n <mat-icon *ngIf=\"selectConfig.iconPrefix\"\n matPrefix\n [ngClass]=\"{\n 'readonly-color' : !selectConfig['iconPrefixColor'] && (selectConfig.readOnly || ngControl.control.disabled),\n 'default-form-icon-color' : !selectConfig['iconPrefixColor'] && !(selectConfig.readOnly || ngControl.control.disabled)\n }\"\n [matTooltip]=\"((selectConfig?.['iconPrefixTooltip'] || '') | translate)\"\n >{{ selectConfig.iconPrefix }}\n </mat-icon>\n\n <mat-icon *ngIf=\"selectConfig['iconPrefixSvg']\"\n matPrefix\n [matTooltip]=\"((selectConfig?.['iconPrefixTooltip'] || '') | translate)\"\n [svgIcon]=\"selectConfig['iconPrefixSvg'] || ''\"\n ></mat-icon>\n\n <i-tech-icon-button\n *ngIf=\"selectConfig.search && selectConfig.clearable && !ngControl.control.disabled && !!ngControl.control.value\"\n iconName=\"cancel\"\n matSuffix\n [disabled]=\"selectConfig.readOnly || false\"\n [ngClass]=\"selectConfig.readOnly || ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n (click)=\"$event.stopPropagation();$event.preventDefault();ngControl.control.reset(null);matSelect._onBlur();closePanelAndUnsetFocus()\"\n >\n </i-tech-icon-button>\n <mat-icon\n matSuffix\n class=\"select-arrow\"\n [class.open]=\"matSelect.panelOpen\"\n [ngClass]=\"{\n 'readonly-color': selectConfig.readOnly || ngControl.control.disabled,\n 'default-form-icon-color': !(selectConfig.readOnly || ngControl.control.disabled),\n 'mt-8': !!ngControl.control.value && selectConfig.clearable\n }\"\n >\n keyboard_arrow_down\n </mat-icon>\n <!-- Error Message -->\n <mat-error *ngIf=\"!!(ngControl.control.errors && submitValue)\">\n {{ ngControl.control | generateErrorMessages : selectConfig.label : selectConfig.defaultPatternKey }}\n </mat-error>\n </mat-form-field>\n\n <!-- Reset Button -->\n <i-tech-clear-value *ngIf=\"selectConfig.reset\" (reset)=\"resetValue()\"></i-tech-clear-value>\n</div>\n", styles: [".left_icon_new{position:absolute;right:2px;top:1px}::ng-deep .request_loading{width:40px;height:40px;background-color:#fff!important}::ng-deep .request_loading:hover{background-color:var(--primary99)!important}::ng-deep .request_loading:focus{background-color:var(--primary99)!important}::ng-deep .request_loading img{position:absolute;left:50%;top:50%;width:100%;height:100%;transform:translate(-50%,-50%)}::ng-deep .mat-mdc-option.add_new{opacity:1!important;pointer-events:auto!important}::ng-deep .mat-mdc-option.add_new .mat-pseudo-checkbox{display:none!important}::ng-deep .mat-mdc-option.add_new .mdc-list-item__primary-text{display:inline-block!important;width:100%!important}::ng-deep .mat-mdc-option.add_new span{color:unset!important;font-size:unset!important;margin:unset!important;opacity:1!important}@media (min-width: 1920px) and (max-width: 2500px){.mat-autocomplete{height:90px!important}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "component", type: IconButtonComponent, selector: "i-tech-icon-button", inputs: ["size", "type", "iconSvg", "iconName", "tooltip", "disabled"], outputs: ["buttonClick"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: ButtonComponent, selector: "i-tech-button", inputs: ["text", "data_cy", "fontIcon", "svgIcon", "type", "customClass", "submit", "disabled", "activated", "color"], outputs: ["buttonClick"] }, { kind: "pipe", type: GetValueByKeyFromObjectPipe, name: "getValueByKeyFromObject" }, { kind: "pipe", type: ArrayToStringPipe, name: "arrayToString" }, { kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: GenerateErrorMessagesPipe, name: "generateErrorMessages" }, { kind: "component", type: ClearValueComponent, selector: "i-tech-clear-value", inputs: ["className", "additionalClass"], outputs: ["reset"] }, { kind: "ngmodule", type: MatFormFieldModule }] }); }
822
+ }
823
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AutocompleteSelectComponent, decorators: [{
824
+ type: Component,
825
+ args: [{ selector: 'i-tech-autocomplete-select', imports: [
826
+ NgClass,
827
+ MatTooltip,
828
+ NgIf,
829
+ NgFor,
830
+ TranslateModule,
831
+ IconButtonComponent,
832
+ ReactiveFormsModule,
833
+ MatSelectModule,
834
+ ButtonComponent,
835
+ GetValueByKeyFromObjectPipe,
836
+ ArrayToStringPipe,
837
+ NgOptimizedImage,
838
+ MatIcon,
839
+ GenerateErrorMessagesPipe,
840
+ ClearValueComponent,
841
+ MatFormFieldModule
842
+ ], standalone: true, template: "<div class=\"new-mat-autocomplete\" id=\"mat_autocomplete\"\n [ngClass]=\"{\n 'mat-select-without_icon': !selectConfig.iconUrl && !selectConfig.activeStateIconUrl,\n 'mat-select-with-search': selectConfig.search,\n 'without-label': selectConfig.hideLabel,\n 'invalid_field': ngControl.control.errors && submitValue,\n 'readonly-field': selectConfig.readOnly || ngControl.control.disabled\n }\"\n [matTooltip]=\"(selectConfig.hover && !ngControl.control.disabled ? ((selectConfig.hover || '') | translate) : '')\"\n [matTooltipClass]=\"'mat-mdc-tooltip big-td-mat-tooltip'\"\n [matTooltipPosition]=\"'above'\"\n *ngIf=\"selectConfig && ngControl\">\n\n <div class=\"w-100\" *ngIf=\"!selectConfig.hideLabel\">\n <mat-label [ngClass]=\"{\n 'readonly-color' : selectConfig.readOnly || ngControl.control.disabled,\n 'invalid-label-color': !!(ngControl.control.errors && submitValue)\n }\">\n {{ selectConfig.label | translate }}\n </mat-label>\n <span *ngIf=\"selectConfig.required\" class=\"required-input\"\n [ngClass]=\"{'readonly-color' : ngControl.control.disabled}\">*</span>\n </div>\n\n\n <!-- Search Input -->\n <div class=\"search-input w-100\"\n (click)=\"$event.stopPropagation();$event.preventDefault()\"\n [ngClass]=\"{ hide_input_placeholder: showPlaceholder || ngControl.control.disabled }\"\n *ngIf=\"selectConfig.search\"\n >\n <input autocomplete=\"off\"\n id=\"searchInput\"\n type=\"text\"\n [ngClass]=\"{'pr-25': !selectConfig.iconUrl}\"\n #searchInput\n [disabled]=\"ngControl.control.disabled || selectConfig.hover\"\n [placeholder]=\"(ngControl.control.disabled || selectConfig.hover) ? '' : 'Search'\"\n (focusout)=\"inputFocusOut()\"\n (focus)=\"openSelection()\"\n (keydown)=\"$event.stopPropagation()\"\n (keyup)=\"getDataWithSearch(searchInput.value,$event)\">\n\n <!-- Search Icon -->\n <span class=\"search-icon\">\n <i-tech-icon-button\n class=\"mr-10\"\n [ngClass]=\"selectConfig.readOnly || ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n *ngIf=\"selectConfig.iconPrefix && !showPlaceholder\"\n [iconName]=\"selectConfig.iconPrefix || ''\"\n [disabled]=\"selectConfig.readOnly || false\"\n matPrefix\n >\n </i-tech-icon-button>\n </span>\n </div>\n\n <!-- Placeholder/Selected Value Display -->\n <ng-container *ngIf=\"showPlaceholder && selectConfig.search\">\n <div class=\"custom-placeholder\"\n *ngIf=\"(!ngControl?.value && !ngControl?.value?.length) ||\n (selectConfig.multiple && ngControl?.value && !ngControl?.value?.length)\"\n [ngClass]=\"selectConfig.readOnly || ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n >\n {{ ((selectConfig.placeholder || '') | translate) }}\n </div>\n <div class=\"custom-placeholder custom-value ellipsis\"\n [ngClass]=\"{\n 'pr-42': selectConfig.iconUrl,\n 'readonly-color': selectConfig.readOnly || ngControl.control.disabled,\n 'default-form-icon-color': !(selectConfig.readOnly || ngControl.control.disabled)\n }\"\n *ngIf=\"ngControl?.value\"\n >\n {{ selectConfig?.multiple ? (ngControl.value | arrayToString) : showingValue }}\n </div>\n </ng-container>\n\n <!-- Custom Icon -->\n <img class=\"left_icon_new pointer\"\n (click)=\"iconClick(matSelect, searchInput)\"\n *ngIf=\"!selectConfig.matIconName && (selectConfig.iconUrl || selectConfig.activeStateIconUrl)\"\n [src]=\"'assets/images/icons/global/' + (ngControl.control?.value && selectConfig?.activeStateIconUrl ? selectConfig.activeStateIconUrl : selectConfig.iconUrl)\">\n\n <mat-form-field appearance=\"outline\" class=\"w-100\" (click)=\"selectConfig?.search ? focusSearchInput() : null\">\n <!-- Material Select -->\n <mat-select #matSelect=\"matSelect\"\n [panelClass]=\"'autocomplete-transform-panel-location'\"\n [attr.aria-placeholder]=\"(selectConfig.placeholder || '') | translate\"\n [aria-label]=\"selectConfig.label | translate\"\n [id]=\"selectConfig.filtrationKey || ''\"\n (opened)=\"registerPanelScrollEvent(matSelect)\"\n (openedChange)=\"openedChange($event)\"\n [formControl]=\"ngControl.control\"\n [multiple]=\"selectConfig.multiple\"\n (selectionChange)=\"emitSelectionChangeAndClose($event)\"\n [errorStateMatcher]=\"customErrorStateMatcher\"\n [placeholder]=\"(selectConfig.placeholder || '') | translate\"\n [disabled]=\"ngControl.control.disabled\"\n >\n\n <!-- Loading State -->\n <mat-option *ngIf=\"pending\" class=\"option_loading relative\">\n <div class=\"request_loading\">\n <img ngSrc=\"./loader.svg\" alt=\"\" height=\"200\" width=\"200\"/>\n </div>\n </mat-option>\n\n <!-- Options -->\n <ng-container *ngIf=\"data?.length && !pending\">\n <!-- Add New Option -->\n <mat-option *ngIf=\"selectConfig.actions\"\n class=\"pointer add_new\"\n disabled\n (click)=\"closePanelAndUnsetFocus();addNewItemEvent()\">\n <!-- (click)=\"ngControl.control.reset(null);matSelect._onBlur();closePanelAndUnsetFocus();addNewItemEvent()\">-->\n <i-tech-button\n [type]=\"ButtonType.OUTLINE\"\n [fontIcon]=\"'add'\"\n [text]=\"('dropdown_add_item' | translate : {INPUT_NAME: (selectConfig.label | translate)}) \"\n [customClass]=\"'w-100 mat-autocomplete-select-button'\">\n </i-tech-button>\n </mat-option>\n\n <!-- Regular Options -->\n <ng-container *ngIf=\"!selectConfig?.changeText && data.length\">\n <mat-option *ngFor=\"let item of data\"\n [value]=\"selectConfig.valueByKey | getValueByKeyFromObject : item\"\n (mouseup)=\"optionClick(item)\"\n (mousedown)=\"preventDefault($event)\">\n {{ ((selectConfig.valueToShowByKey | getValueByKeyFromObject : item : selectConfig.valueToShowByParam : selectConfig.withParamSymbol) || '') | translate }}\n </mat-option>\n </ng-container>\n\n <!-- Custom Text Options -->\n <ng-container *ngIf=\"selectConfig?.changeText && data.length\">\n <mat-option *ngFor=\"let item of data\"\n [value]=\"selectConfig.valueByKey | getValueByKeyFromObject : item\"\n (mouseup)=\"optionClick(item)\"\n (mousedown)=\"preventDefault($event)\"\n [disabled]=\"selectConfig?.changeText[item].disabled\">\n {{ selectConfig?.changeText[item].text | translate }}\n </mat-option>\n </ng-container>\n </ng-container>\n\n <!-- Empty State -->\n <ng-container *ngIf=\"!pending && !data.length\">\n <mat-option disabled class=\"empty_selection_state\">\n <div class=\"actions_and_tile add_new flex_column w-100 flex_center_align_center\">\n <span>{{ 'dropdown_no_items' | translate }}</span>\n <div class=\"mt-10\">\n <i-tech-button\n *ngIf=\"selectConfig?.actions\"\n [type]=\"ButtonType.OUTLINE\"\n (buttonClick)=\"closePanelAndUnsetFocus();addNewItemEvent()\"\n [customClass]=\"'mat-autocomplete-select-button'\"\n [fontIcon]=\"'add'\"\n [text]=\"('dropdown_add_item' | translate : {INPUT_NAME: (selectConfig.label | translate)}) \">\n </i-tech-button>\n </div>\n </div>\n </mat-option>\n </ng-container>\n </mat-select>\n <mat-icon *ngIf=\"selectConfig.iconPrefix\"\n matPrefix\n [ngClass]=\"{\n 'readonly-color' : !selectConfig['iconPrefixColor'] && (selectConfig.readOnly || ngControl.control.disabled),\n 'default-form-icon-color' : !selectConfig['iconPrefixColor'] && !(selectConfig.readOnly || ngControl.control.disabled)\n }\"\n [matTooltip]=\"((selectConfig?.['iconPrefixTooltip'] || '') | translate)\"\n >{{ selectConfig.iconPrefix }}\n </mat-icon>\n\n <mat-icon *ngIf=\"selectConfig['iconPrefixSvg']\"\n matPrefix\n [matTooltip]=\"((selectConfig?.['iconPrefixTooltip'] || '') | translate)\"\n [svgIcon]=\"selectConfig['iconPrefixSvg'] || ''\"\n ></mat-icon>\n\n <i-tech-icon-button\n *ngIf=\"selectConfig.search && selectConfig.clearable && !ngControl.control.disabled && !!ngControl.control.value\"\n iconName=\"cancel\"\n matSuffix\n [disabled]=\"selectConfig.readOnly || false\"\n [ngClass]=\"selectConfig.readOnly || ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n (click)=\"$event.stopPropagation();$event.preventDefault();ngControl.control.reset(null);matSelect._onBlur();closePanelAndUnsetFocus()\"\n >\n </i-tech-icon-button>\n <mat-icon\n matSuffix\n class=\"select-arrow\"\n [class.open]=\"matSelect.panelOpen\"\n [ngClass]=\"{\n 'readonly-color': selectConfig.readOnly || ngControl.control.disabled,\n 'default-form-icon-color': !(selectConfig.readOnly || ngControl.control.disabled),\n 'mt-8': !!ngControl.control.value && selectConfig.clearable\n }\"\n >\n keyboard_arrow_down\n </mat-icon>\n <!-- Error Message -->\n <mat-error *ngIf=\"!!(ngControl.control.errors && submitValue)\">\n {{ ngControl.control | generateErrorMessages : selectConfig.label : selectConfig.defaultPatternKey }}\n </mat-error>\n </mat-form-field>\n\n <!-- Reset Button -->\n <i-tech-clear-value *ngIf=\"selectConfig.reset\" (reset)=\"resetValue()\"></i-tech-clear-value>\n</div>\n", styles: [".left_icon_new{position:absolute;right:2px;top:1px}::ng-deep .request_loading{width:40px;height:40px;background-color:#fff!important}::ng-deep .request_loading:hover{background-color:var(--primary99)!important}::ng-deep .request_loading:focus{background-color:var(--primary99)!important}::ng-deep .request_loading img{position:absolute;left:50%;top:50%;width:100%;height:100%;transform:translate(-50%,-50%)}::ng-deep .mat-mdc-option.add_new{opacity:1!important;pointer-events:auto!important}::ng-deep .mat-mdc-option.add_new .mat-pseudo-checkbox{display:none!important}::ng-deep .mat-mdc-option.add_new .mdc-list-item__primary-text{display:inline-block!important;width:100%!important}::ng-deep .mat-mdc-option.add_new span{color:unset!important;font-size:unset!important;margin:unset!important;opacity:1!important}@media (min-width: 1920px) and (max-width: 2500px){.mat-autocomplete{height:90px!important}}\n"] }]
843
+ }], ctorParameters: () => [{ type: InputService }], propDecorators: { matSelect: [{
844
+ type: ViewChild,
845
+ args: ['matSelect']
846
+ }], searchInput: [{
847
+ type: ViewChild,
848
+ args: ['searchInput']
849
+ }], className: [{
850
+ type: Input
851
+ }], submitValue: [{
852
+ type: Input
853
+ }], configs: [{
854
+ type: Input
855
+ }], detectChanges: [{
856
+ type: Input
857
+ }], selectionChange: [{
858
+ type: Output
859
+ }], emitAction: [{
860
+ type: Output
861
+ }], allSelected: [{
862
+ type: ViewChild,
863
+ args: ['allSelected']
864
+ }], handleVisibilityChange: [{
865
+ type: HostListener,
866
+ args: ['document:visibilitychange']
867
+ }] } });
868
+
869
+ class DateMaskDirective {
870
+ constructor(elementRef, injector) {
871
+ this.elementRef = elementRef;
872
+ this.injector = injector;
873
+ this.expressions = {
874
+ DMY: 'M0/d0/0000',
875
+ DM: 'M0/d0'
876
+ };
877
+ this.dateRegex = new RegExp(/^\s*(1[012]|0?[1-9])\/(3[01]|[12][0-9]|0?[1-9])\/((?:19|20)\d{2})\s*$/);
878
+ this.dayMonthRegex = new RegExp(/^\s*(1[012]|0?[1-9])\/(3[01]|[12][0-9]|0?[1-9])$/);
879
+ this.previousValue = '';
880
+ this.maskService = this.injector.get(NgxMaskService);
881
+ }
882
+ onInput() {
883
+ let value = this.elementRef.nativeElement.value;
884
+ if (this.existsZerosInString(value)) {
885
+ value = this.previousValue;
886
+ }
887
+ const maskedValue = this.maskService.applyMask(value, this.maskType === 'DAY_MONTH' ? this.expressions.DM : this.expressions.DMY);
888
+ if (this.maskType !== 'DAY_MONTH' && !isNaN(new Date(maskedValue).getTime())) {
889
+ if (this.matDatepicker) {
890
+ this.matDatepicker.select(new Date(maskedValue));
891
+ }
892
+ else if (this.rangeFormControl) {
893
+ this.rangeFormControl.setValue(new Date(maskedValue));
894
+ }
895
+ }
896
+ if (isNaN(new Date(maskedValue).getTime())) {
897
+ this.matDatepicker.select(null);
898
+ }
899
+ this.elementRef.nativeElement.value = maskedValue || null;
900
+ this.previousValue = maskedValue || null;
901
+ }
902
+ onPaste(event) {
903
+ const pastedValue = event.clipboardData?.getData('text/plain');
904
+ if (!pastedValue) {
905
+ return;
906
+ }
907
+ if (this.maskType === 'DAY_MONTH') {
908
+ if (!this.dayMonthRegex.test(pastedValue)) {
909
+ event?.preventDefault();
910
+ }
911
+ }
912
+ else {
913
+ if (!this.dateRegex.test(pastedValue)) {
914
+ event?.preventDefault();
915
+ }
916
+ }
917
+ }
918
+ existsZerosInString(date) {
919
+ const dateToArray = date.split('/');
920
+ let isValid;
921
+ if (this.maskType === 'DAY_MONTH') {
922
+ isValid = !!dateToArray.find((part) => part.includes('00'));
923
+ }
924
+ else {
925
+ if (dateToArray.length < 3) {
926
+ isValid = !!dateToArray.find((part) => part.includes('00'));
927
+ }
928
+ else {
929
+ isValid = (dateToArray[2][0] == '0') || (+dateToArray[2][0] > 2);
930
+ }
931
+ }
932
+ return isValid;
933
+ }
934
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateMaskDirective, deps: [{ token: i0.ElementRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
935
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DateMaskDirective, isStandalone: true, selector: "[dateMask]", inputs: { maskType: "maskType", matDatepicker: "matDatepicker", rangeFormControl: "rangeFormControl" }, host: { listeners: { "input": "onInput()", "paste": "onPaste($event)" } }, providers: [NgxMaskDirective], ngImport: i0 }); }
936
+ }
937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateMaskDirective, decorators: [{
938
+ type: Directive,
939
+ args: [{
940
+ selector: '[dateMask]',
941
+ providers: [NgxMaskDirective],
942
+ standalone: true
943
+ }]
944
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Injector }], propDecorators: { maskType: [{
945
+ type: Input
946
+ }], matDatepicker: [{
947
+ type: Input
948
+ }], rangeFormControl: [{
949
+ type: Input
950
+ }], onInput: [{
951
+ type: HostListener,
952
+ args: ['input']
953
+ }], onPaste: [{
954
+ type: HostListener,
955
+ args: ['paste', ['$event']]
956
+ }] } });
957
+
958
+ class DatePickerComponent {
959
+ constructor(inputService) {
960
+ this.inputService = inputService;
961
+ this.label = '';
962
+ this.required = false;
963
+ this.pastDatesDisabled = false;
964
+ this.hintText = '';
965
+ this.placeholder = 'MM/DD/YYYY';
966
+ this.submit = false;
967
+ this.valueChangeEmitter = new EventEmitter();
968
+ this.isOpen = false;
969
+ this.focused = false;
970
+ this.today = new Date();
971
+ // Filter to disable past dates
972
+ this.dateFilter = (date) => {
973
+ if (this.pastDatesDisabled) {
974
+ const today = this.today;
975
+ return date ? date >= today : false;
976
+ }
977
+ else {
978
+ return true;
979
+ }
980
+ };
981
+ this.customErrorStateMatcher = {
982
+ isErrorState: (control, form) => {
983
+ return !!(control && control.invalid && this.submit);
984
+ }
985
+ };
986
+ this.ngControl = this.inputService.injectNgControl();
987
+ }
988
+ emitChange() {
989
+ if (!this.valueChangeEmit) {
990
+ return;
991
+ }
992
+ this.valueChangeEmitter.emit();
993
+ }
994
+ clickForFocusOut() {
995
+ setTimeout(() => {
996
+ this.inputElement.nativeElement.focus();
997
+ this.inputElement.nativeElement.blur();
998
+ }, 120);
999
+ }
1000
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatePickerComponent, deps: [{ token: InputService }], target: i0.ɵɵFactoryTarget.Component }); }
1001
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DatePickerComponent, isStandalone: true, selector: "i-tech-date-picker", inputs: { label: "label", defaultPatternKey: "defaultPatternKey", required: "required", pastDatesDisabled: "pastDatesDisabled", hintText: "hintText", placeholder: "placeholder", iconPrefix: "iconPrefix", iconPrefixSvg: "iconPrefixSvg", iconPrefixTooltip: "iconPrefixTooltip", iconPrefixColor: "iconPrefixColor", iconPrefixVariant: "iconPrefixVariant", valueChangeEmit: "valueChangeEmit", submit: "submit" }, outputs: { valueChangeEmitter: "valueChangeEmitter" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true }], ngImport: i0, template: "<div class=\"flex_column relative mat-date-range-input\" *ngIf=\"ngControl\" [ngClass]=\"{'check_requirements': submit}\">\n <div class=\"w-100\">\n <mat-label [ngClass]=\"{\n 'readonly-color' : ngControl.control.disabled,\n 'invalid-label-color': !!(ngControl.control.errors && submit)\n }\">\n {{ label | translate }}\n </mat-label>\n <span *ngIf=\"required\" class=\"required-input\" [ngClass]=\"{'readonly-color' : ngControl.control.disabled}\">*</span>\n </div>\n <mat-form-field appearance=\"outline\" [ngClass]=\"{'opened_calendar': isOpen}\"\n [class.readonly-field]=\"ngControl.control.disabled\">\n <input matInput #inputElement\n type=\"text\"\n [formControl]=\"ngControl.control\"\n [placeholder]=\"placeholder | translate\"\n dateMask\n [matDatepicker]=\"datePicker\"\n [errorStateMatcher]=\"customErrorStateMatcher\"\n [matDatepickerFilter]=\"dateFilter\"\n (focus)=\"focused = true\"\n (click)=\"datePicker.open();\"\n (dateChange)=\"emitChange()\"\n >\n\n <mat-icon *ngIf=\"iconPrefix\"\n matPrefix\n [matTooltip]=\"((iconPrefixTooltip || '') | translate)\"\n [style.color]=\"iconPrefixColor\"\n >{{ iconPrefix }}\n </mat-icon>\n\n <mat-icon *ngIf=\"iconPrefixSvg\"\n matPrefix\n [matTooltip]=\"((iconPrefixTooltip || '') | translate)\"\n [svgIcon]=\"iconPrefixSvg\"\n ></mat-icon>\n\n <i-tech-icon-button matSuffix\n [iconName]=\"'date_range'\"\n [disabled]=\"ngControl.control.disabled\"\n (click)=\"datePicker.open()\"\n [ngClass]=\"ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n ></i-tech-icon-button>\n\n <mat-datepicker #datePicker (closed)=\"isOpen = false;clickForFocusOut()\"\n (opened)=\"isOpen = true;focused = true\"></mat-datepicker>\n\n <!-- Error Messages -->\n <mat-error *ngIf=\"!!(ngControl.control.errors && submit)\">\n {{ ngControl.control | generateErrorMessages : label : defaultPatternKey }}\n </mat-error>\n\n <!-- Helper Text -->\n <mat-hint *ngIf=\"!(!!(ngControl.control.errors && submit)) && hintText\"\n [ngClass]=\"{'readonly-color' : ngControl.control.disabled}\"\n >\n {{ hintText | translate }}\n </mat-hint>\n\n </mat-form-field>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: DateMaskDirective, selector: "[dateMask]", inputs: ["maskType", "matDatepicker", "rangeFormControl"] }, { kind: "pipe", type: GenerateErrorMessagesPipe, name: "generateErrorMessages" }, { kind: "component", type: IconButtonComponent, selector: "i-tech-icon-button", inputs: ["size", "type", "iconSvg", "iconName", "tooltip", "disabled"], outputs: ["buttonClick"] }] }); }
1002
+ }
1003
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatePickerComponent, decorators: [{
1004
+ type: Component,
1005
+ args: [{ selector: 'i-tech-date-picker', imports: [
1006
+ NgClass, NgIf,
1007
+ TranslateModule,
1008
+ ReactiveFormsModule,
1009
+ MatFormFieldModule,
1010
+ MatDatepickerModule,
1011
+ MatInput,
1012
+ MatTooltip,
1013
+ MatIconModule,
1014
+ DateMaskDirective,
1015
+ GenerateErrorMessagesPipe, IconButtonComponent
1016
+ ], standalone: true, template: "<div class=\"flex_column relative mat-date-range-input\" *ngIf=\"ngControl\" [ngClass]=\"{'check_requirements': submit}\">\n <div class=\"w-100\">\n <mat-label [ngClass]=\"{\n 'readonly-color' : ngControl.control.disabled,\n 'invalid-label-color': !!(ngControl.control.errors && submit)\n }\">\n {{ label | translate }}\n </mat-label>\n <span *ngIf=\"required\" class=\"required-input\" [ngClass]=\"{'readonly-color' : ngControl.control.disabled}\">*</span>\n </div>\n <mat-form-field appearance=\"outline\" [ngClass]=\"{'opened_calendar': isOpen}\"\n [class.readonly-field]=\"ngControl.control.disabled\">\n <input matInput #inputElement\n type=\"text\"\n [formControl]=\"ngControl.control\"\n [placeholder]=\"placeholder | translate\"\n dateMask\n [matDatepicker]=\"datePicker\"\n [errorStateMatcher]=\"customErrorStateMatcher\"\n [matDatepickerFilter]=\"dateFilter\"\n (focus)=\"focused = true\"\n (click)=\"datePicker.open();\"\n (dateChange)=\"emitChange()\"\n >\n\n <mat-icon *ngIf=\"iconPrefix\"\n matPrefix\n [matTooltip]=\"((iconPrefixTooltip || '') | translate)\"\n [style.color]=\"iconPrefixColor\"\n >{{ iconPrefix }}\n </mat-icon>\n\n <mat-icon *ngIf=\"iconPrefixSvg\"\n matPrefix\n [matTooltip]=\"((iconPrefixTooltip || '') | translate)\"\n [svgIcon]=\"iconPrefixSvg\"\n ></mat-icon>\n\n <i-tech-icon-button matSuffix\n [iconName]=\"'date_range'\"\n [disabled]=\"ngControl.control.disabled\"\n (click)=\"datePicker.open()\"\n [ngClass]=\"ngControl.control.disabled ? 'readonly-color' : 'default-form-icon-color'\"\n ></i-tech-icon-button>\n\n <mat-datepicker #datePicker (closed)=\"isOpen = false;clickForFocusOut()\"\n (opened)=\"isOpen = true;focused = true\"></mat-datepicker>\n\n <!-- Error Messages -->\n <mat-error *ngIf=\"!!(ngControl.control.errors && submit)\">\n {{ ngControl.control | generateErrorMessages : label : defaultPatternKey }}\n </mat-error>\n\n <!-- Helper Text -->\n <mat-hint *ngIf=\"!(!!(ngControl.control.errors && submit)) && hintText\"\n [ngClass]=\"{'readonly-color' : ngControl.control.disabled}\"\n >\n {{ hintText | translate }}\n </mat-hint>\n\n </mat-form-field>\n</div>\n" }]
1017
+ }], ctorParameters: () => [{ type: InputService }], propDecorators: { label: [{
1018
+ type: Input
1019
+ }], defaultPatternKey: [{
1020
+ type: Input
1021
+ }], required: [{
1022
+ type: Input
1023
+ }], pastDatesDisabled: [{
1024
+ type: Input
1025
+ }], hintText: [{
1026
+ type: Input
1027
+ }], placeholder: [{
1028
+ type: Input
1029
+ }], iconPrefix: [{
1030
+ type: Input
1031
+ }], iconPrefixSvg: [{
1032
+ type: Input
1033
+ }], iconPrefixTooltip: [{
1034
+ type: Input
1035
+ }], iconPrefixColor: [{
1036
+ type: Input
1037
+ }], iconPrefixVariant: [{
1038
+ type: Input
1039
+ }], valueChangeEmit: [{
1040
+ type: Input
1041
+ }], submit: [{
1042
+ type: Input
1043
+ }], inputElement: [{
1044
+ type: ViewChild,
1045
+ args: ['inputElement']
1046
+ }], valueChangeEmitter: [{
1047
+ type: Output
1048
+ }] } });
1049
+
1050
+ class DateRangeDatepickerComponent {
1051
+ constructor() {
1052
+ this.submit = false;
1053
+ this.clearValue = true;
1054
+ this.errorMessage = '';
1055
+ this.hintText = 'MM/DD/YYYY - MM/DD/YYYY';
1056
+ this.resetForm = new EventEmitter();
1057
+ this.selectionChange = new EventEmitter();
1058
+ this.isOpen = false;
1059
+ this.dateRangeForm = new UntypedFormGroup({
1060
+ startDate: new UntypedFormControl('', [Validators.maxLength(10)]),
1061
+ endDate: new UntypedFormControl('', [Validators.maxLength(10)]),
1062
+ });
1063
+ this.customErrorStateMatcher = {
1064
+ isErrorState: (control, form) => {
1065
+ return !!(control && control.invalid && this.submit);
1066
+ }
1067
+ };
1068
+ }
1069
+ ngAfterViewInit() {
1070
+ setTimeout(() => {
1071
+ if (this.defaultValue?.length) {
1072
+ this.dateRangeForm.patchValue({
1073
+ startDate: this.defaultValue[0],
1074
+ endDate: this.defaultValue[1]
1075
+ });
1076
+ }
1077
+ });
1078
+ }
1079
+ ngOnChanges(changes) {
1080
+ setTimeout(() => {
1081
+ if (changes['value']?.currentValue && !(changes['value'].currentValue[0])) {
1082
+ if (this.picker) {
1083
+ this.dateRangeForm.reset();
1084
+ this.picker.select(null);
1085
+ }
1086
+ }
1087
+ else if (changes['value'] && this.value?.length) {
1088
+ this.dateRangeForm.setValue({
1089
+ startDate: new Date(this.value[0] || ''),
1090
+ endDate: new Date(this.value[1] || '')
1091
+ });
1092
+ }
1093
+ }, 10);
1094
+ }
1095
+ clickForFocusOut() {
1096
+ setTimeout(() => {
1097
+ this.min.nativeElement.focus();
1098
+ this.min.nativeElement.blur();
1099
+ }, 120);
1100
+ }
1101
+ setDate(value, element) {
1102
+ this.selectionChange.emit(value);
1103
+ element.blur();
1104
+ }
1105
+ keyEventHandler(event, value, element) {
1106
+ if (event.code === 'Enter') {
1107
+ this.setDate(value, element);
1108
+ }
1109
+ }
1110
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateRangeDatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1111
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DateRangeDatepickerComponent, isStandalone: true, selector: "app-mat-range-datepicker", inputs: { label: "label", placeholder: "placeholder", value: "value", defaultValue: "defaultValue", key: "key", submit: "submit", clearValue: "clearValue", errorMessage: "errorMessage", onePlaceholder: "onePlaceholder", hintText: "hintText" }, outputs: { resetForm: "resetForm", selectionChange: "selectionChange" }, viewQueries: [{ propertyName: "picker", first: true, predicate: ["picker"], descendants: true }, { propertyName: "min", first: true, predicate: ["min"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"flex_column relative mat-date-range-input\"\n [formGroup]=\"dateRangeForm\"\n>\n <div class=\"w-100\">\n <mat-label>\n {{(label || '') | translate}}\n </mat-label>\n </div>\n <mat-form-field appearance=\"outline\" [ngClass]=\"{'opened_calendar': isOpen}\">\n <mat-date-range-input [rangePicker]=\"picker\">\n <input formControlName=\"startDate\"\n [placeholder]=\" (placeholder ? placeholder[0] : 'Start Date')\"\n [title]=\"key ? key.title : 'Date'\"\n [attr.data-accessKey]=\"key ? key.start : 'minStartDate'\"\n [attr.data-parentKey]=\"key ? (key.start + '_' + key.end) : 'minStartDate_maxEndDate'\"\n matStartDate #min\n dateMask\n [errorStateMatcher]=\"customErrorStateMatcher\"\n [rangeFormControl]=\"dateRangeForm.controls['startDate']\"\n (keydown)=\"keyEventHandler($event,[min.value, max.value || null],min)\"\n (dateChange)=\"setDate([min.value, max.value || null],min)\">\n <input formControlName=\"endDate\"\n [placeholder]=\"(placeholder ? placeholder[1] : 'End Date')\"\n [title]=\"key ? key.title : 'Date'\"\n [attr.data-accessKey]=\"key ? key.end : 'maxEndDate'\"\n [attr.data-parentKey]=\"key ? (key.start + '_' + key.end) : 'minStartDate_maxEndDate'\"\n matEndDate #max\n dateMask\n [errorStateMatcher]=\"customErrorStateMatcher\"\n [rangeFormControl]=\"dateRangeForm.controls['endDate']\"\n (keydown)=\"keyEventHandler($event,[min.value, max.value || null],max)\"\n (dateChange)=\"setDate([min.value, max.value || null],max)\">\n </mat-date-range-input>\n <i-tech-icon-button matSuffix\n [iconName]=\"'cancel'\"\n (buttonClick)=\"selectionChange.emit([null, null])\"\n class=\"default-form-icon-color\"\n *ngIf=\"dateRangeForm.get('startDate')?.value && this.dateRangeForm.get('endDate')?.value\"\n ></i-tech-icon-button>\n <i-tech-icon-button matSuffix [iconName]=\"'date_range'\" (buttonClick)=\"picker.open()\" class=\"default-form-icon-color\"></i-tech-icon-button>\n <mat-date-range-picker #picker (closed)=\"isOpen = false;clickForFocusOut()\" (opened)=\"isOpen = true\"></mat-date-range-picker>\n <mat-hint *ngIf=\"hintText && !errorMessage\">{{hintText}}</mat-hint>\n </mat-form-field>\n</div>\n", dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3$1.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i3$1.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i3$1.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i3$1.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "component", type: IconButtonComponent, selector: "i-tech-icon-button", inputs: ["size", "type", "iconSvg", "iconName", "tooltip", "disabled"], outputs: ["buttonClick"] }, { kind: "directive", type: DateMaskDirective, selector: "[dateMask]", inputs: ["maskType", "matDatepicker", "rangeFormControl"] }] }); }
1112
+ }
1113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateRangeDatepickerComponent, decorators: [{
1114
+ type: Component,
1115
+ args: [{ selector: 'app-mat-range-datepicker', imports: [
1116
+ MatFormFieldModule,
1117
+ ReactiveFormsModule,
1118
+ MatDatepickerModule,
1119
+ NgClass, NgIf,
1120
+ TranslateModule,
1121
+ IconButtonComponent, DateMaskDirective
1122
+ ], standalone: true, template: "<div class=\"flex_column relative mat-date-range-input\"\n [formGroup]=\"dateRangeForm\"\n>\n <div class=\"w-100\">\n <mat-label>\n {{(label || '') | translate}}\n </mat-label>\n </div>\n <mat-form-field appearance=\"outline\" [ngClass]=\"{'opened_calendar': isOpen}\">\n <mat-date-range-input [rangePicker]=\"picker\">\n <input formControlName=\"startDate\"\n [placeholder]=\" (placeholder ? placeholder[0] : 'Start Date')\"\n [title]=\"key ? key.title : 'Date'\"\n [attr.data-accessKey]=\"key ? key.start : 'minStartDate'\"\n [attr.data-parentKey]=\"key ? (key.start + '_' + key.end) : 'minStartDate_maxEndDate'\"\n matStartDate #min\n dateMask\n [errorStateMatcher]=\"customErrorStateMatcher\"\n [rangeFormControl]=\"dateRangeForm.controls['startDate']\"\n (keydown)=\"keyEventHandler($event,[min.value, max.value || null],min)\"\n (dateChange)=\"setDate([min.value, max.value || null],min)\">\n <input formControlName=\"endDate\"\n [placeholder]=\"(placeholder ? placeholder[1] : 'End Date')\"\n [title]=\"key ? key.title : 'Date'\"\n [attr.data-accessKey]=\"key ? key.end : 'maxEndDate'\"\n [attr.data-parentKey]=\"key ? (key.start + '_' + key.end) : 'minStartDate_maxEndDate'\"\n matEndDate #max\n dateMask\n [errorStateMatcher]=\"customErrorStateMatcher\"\n [rangeFormControl]=\"dateRangeForm.controls['endDate']\"\n (keydown)=\"keyEventHandler($event,[min.value, max.value || null],max)\"\n (dateChange)=\"setDate([min.value, max.value || null],max)\">\n </mat-date-range-input>\n <i-tech-icon-button matSuffix\n [iconName]=\"'cancel'\"\n (buttonClick)=\"selectionChange.emit([null, null])\"\n class=\"default-form-icon-color\"\n *ngIf=\"dateRangeForm.get('startDate')?.value && this.dateRangeForm.get('endDate')?.value\"\n ></i-tech-icon-button>\n <i-tech-icon-button matSuffix [iconName]=\"'date_range'\" (buttonClick)=\"picker.open()\" class=\"default-form-icon-color\"></i-tech-icon-button>\n <mat-date-range-picker #picker (closed)=\"isOpen = false;clickForFocusOut()\" (opened)=\"isOpen = true\"></mat-date-range-picker>\n <mat-hint *ngIf=\"hintText && !errorMessage\">{{hintText}}</mat-hint>\n </mat-form-field>\n</div>\n" }]
1123
+ }], propDecorators: { label: [{
1124
+ type: Input
1125
+ }], placeholder: [{
1126
+ type: Input
1127
+ }], value: [{
1128
+ type: Input
1129
+ }], defaultValue: [{
1130
+ type: Input
1131
+ }], key: [{
1132
+ type: Input
1133
+ }], submit: [{
1134
+ type: Input
1135
+ }], clearValue: [{
1136
+ type: Input
1137
+ }], errorMessage: [{
1138
+ type: Input
1139
+ }], onePlaceholder: [{
1140
+ type: Input
1141
+ }], hintText: [{
1142
+ type: Input
1143
+ }], resetForm: [{
1144
+ type: Output
1145
+ }], selectionChange: [{
1146
+ type: Output
1147
+ }], picker: [{
1148
+ type: ViewChild,
1149
+ args: ['picker']
1150
+ }], min: [{
1151
+ type: ViewChild,
1152
+ args: ['min']
1153
+ }] } });
1154
+
1155
+ var DropdownSelectionType;
1156
+ (function (DropdownSelectionType) {
1157
+ DropdownSelectionType["UPLOAD"] = "UPLOAD";
1158
+ DropdownSelectionType["DOWNLOAD"] = "DOWNLOAD";
1159
+ DropdownSelectionType["BLANK"] = "BLANK";
1160
+ })(DropdownSelectionType || (DropdownSelectionType = {}));
1161
+ const DropdownItemIcon = {
1162
+ [DropdownSelectionType.UPLOAD]: 'upload',
1163
+ [DropdownSelectionType.DOWNLOAD]: 'download',
1164
+ [DropdownSelectionType.BLANK]: 'blank',
1165
+ };
1166
+
1167
+ class MenuComponent {
1168
+ constructor() {
1169
+ this.positionX = 'before';
1170
+ this.menuOptions = [];
1171
+ this.emitEvent = new EventEmitter();
1172
+ this.ButtonType = ButtonType;
1173
+ this.DropdownItemIcon = DropdownItemIcon;
1174
+ this.matMenuState = false;
1175
+ }
1176
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1177
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MenuComponent, isStandalone: true, selector: "i-tech-menu", inputs: { text: "text", dataName: "dataName", containerClass: "containerClass", positionX: "positionX", menuOptions: "menuOptions" }, outputs: { emitEvent: "emitEvent" }, ngImport: i0, template: "<div class=\"custom_dropdown_container\"\n [attr.data-name]=\"dataName\"\n [ngClass]=\"containerClass\"\n>\n <i-tech-button\n [matMenuTriggerFor]=\"beforeMenu\"\n [type]=\"ButtonType.OUTLINE\"\n [fontIcon]=\"'keyboard_arrow_down'\"\n [text]=\"(text || '') \"\n (menuOpened)=\"matMenuState = true\"\n (menuClosed)=\"matMenuState = false\"\n [activated]=\"matMenuState\"\n ></i-tech-button>\n <mat-menu #beforeMenu=\"matMenu\" [xPosition]=\"positionX\">\n <button mat-menu-item *ngFor=\"let option of menuOptions\" (click)=\"emitEvent.emit(option.value)\">\n <mat-icon *ngIf=\"option.type\" [svgIcon]=\"DropdownItemIcon[option.type]\"></mat-icon>\n <mat-label class=\"meu_item_label\">{{(option.text || '') | translate}}</mat-label>\n </button>\n </mat-menu>\n</div>\n", styles: [".custom_dropdown_container app-mat-button{display:inline-block}mat-menu{height:max-content}\n"], dependencies: [{ kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ButtonComponent, selector: "i-tech-button", inputs: ["text", "data_cy", "fontIcon", "svgIcon", "type", "customClass", "submit", "disabled", "activated", "color"], outputs: ["buttonClick"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }] }); }
1178
+ }
1179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MenuComponent, decorators: [{
1180
+ type: Component,
1181
+ args: [{ selector: "i-tech-menu", standalone: true, imports: [
1182
+ MatMenuTrigger,
1183
+ MatMenu,
1184
+ MatIcon,
1185
+ NgIf,
1186
+ NgForOf,
1187
+ MatMenuItem,
1188
+ TranslateModule,
1189
+ NgClass,
1190
+ ButtonComponent,
1191
+ MatLabel
1192
+ ], template: "<div class=\"custom_dropdown_container\"\n [attr.data-name]=\"dataName\"\n [ngClass]=\"containerClass\"\n>\n <i-tech-button\n [matMenuTriggerFor]=\"beforeMenu\"\n [type]=\"ButtonType.OUTLINE\"\n [fontIcon]=\"'keyboard_arrow_down'\"\n [text]=\"(text || '') \"\n (menuOpened)=\"matMenuState = true\"\n (menuClosed)=\"matMenuState = false\"\n [activated]=\"matMenuState\"\n ></i-tech-button>\n <mat-menu #beforeMenu=\"matMenu\" [xPosition]=\"positionX\">\n <button mat-menu-item *ngFor=\"let option of menuOptions\" (click)=\"emitEvent.emit(option.value)\">\n <mat-icon *ngIf=\"option.type\" [svgIcon]=\"DropdownItemIcon[option.type]\"></mat-icon>\n <mat-label class=\"meu_item_label\">{{(option.text || '') | translate}}</mat-label>\n </button>\n </mat-menu>\n</div>\n", styles: [".custom_dropdown_container app-mat-button{display:inline-block}mat-menu{height:max-content}\n"] }]
1193
+ }], propDecorators: { text: [{
1194
+ type: Input
1195
+ }], dataName: [{
1196
+ type: Input
1197
+ }], containerClass: [{
1198
+ type: Input
1199
+ }], positionX: [{
1200
+ type: Input
1201
+ }], menuOptions: [{
1202
+ type: Input
1203
+ }], emitEvent: [{
1204
+ type: Output
1205
+ }] } });
1206
+
1207
+ /*
1208
+ * Public API Surface of shared-components
1209
+ */
1210
+
1211
+ /**
1212
+ * Generated bundle index. Do not edit.
1213
+ */
1214
+
1215
+ export { ArrayToStringPipe, AutocompleteSelectComponent, ButtonComponent, ButtonType, ClearValueComponent, DatePickerComponent, DateRangeDatepickerComponent, GenerateErrorMessagesPipe, GetValueByKeyFromObjectPipe, IconButtonComponent, InputMaskDirective, InputService, MenuComponent, TextInputComponent };
1216
+ //# sourceMappingURL=i-tech-shared-components.mjs.map