@guajiritos/general-autocomplete 0.1.8 → 1.0.0

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 (35) hide show
  1. package/README.md +0 -1
  2. package/esm2022/lib/guachos-general-autocomplete.component.mjs +36 -56
  3. package/esm2022/public-api.mjs +2 -3
  4. package/esm2022/utils/constants/constants.mjs +11 -0
  5. package/esm2022/utils/pipes/resolve-property-path.pipe.mjs +17 -61
  6. package/esm2022/utils/services/utils.service.mjs +8 -31
  7. package/fesm2022/guajiritos-general-autocomplete.mjs +57 -511
  8. package/fesm2022/guajiritos-general-autocomplete.mjs.map +1 -1
  9. package/lib/guachos-general-autocomplete.component.d.ts +5 -17
  10. package/package.json +8 -7
  11. package/public-api.d.ts +1 -2
  12. package/utils/constants/{contacts.d.ts → constants.d.ts} +1 -1
  13. package/utils/pipes/resolve-property-path.pipe.d.ts +9 -18
  14. package/utils/services/utils.service.d.ts +4 -16
  15. package/esm2022/utils/constants/contacts.mjs +0 -10
  16. package/esm2022/utils/interfaces/interfaces.mjs +0 -12
  17. package/esm2022/utils/pipes/duration.pipe.mjs +0 -18
  18. package/esm2022/utils/pipes/humanize-duration.pipe.mjs +0 -17
  19. package/esm2022/utils/pipes/i18n-field.pipe.mjs +0 -28
  20. package/esm2022/utils/pipes/ida-return.pipe.mjs +0 -23
  21. package/esm2022/utils/pipes/pipes.module.mjs +0 -84
  22. package/esm2022/utils/pipes/show-roles.pipe.mjs +0 -24
  23. package/esm2022/utils/pipes/show-segments.pipe.mjs +0 -24
  24. package/esm2022/utils/pipes/show-transport-types.pipe.mjs +0 -24
  25. package/esm2022/utils/services/autocomplete.service.mjs +0 -161
  26. package/utils/interfaces/interfaces.d.ts +0 -39
  27. package/utils/pipes/duration.pipe.d.ts +0 -8
  28. package/utils/pipes/humanize-duration.pipe.d.ts +0 -7
  29. package/utils/pipes/i18n-field.pipe.d.ts +0 -7
  30. package/utils/pipes/ida-return.pipe.d.ts +0 -8
  31. package/utils/pipes/pipes.module.d.ts +0 -15
  32. package/utils/pipes/show-roles.pipe.d.ts +0 -8
  33. package/utils/pipes/show-segments.pipe.d.ts +0 -8
  34. package/utils/pipes/show-transport-types.pipe.d.ts +0 -8
  35. package/utils/services/autocomplete.service.d.ts +0 -15
@@ -1,5 +1,7 @@
1
+ import * as i1 from '@guajiritos/services';
2
+ import { DisplayOptionItemType, I18nPipe } from '@guajiritos/services';
1
3
  import * as i0 from '@angular/core';
2
- import { Injectable, Pipe, NgModule, signal, EventEmitter, forwardRef, Component, ChangeDetectionStrategy, ViewChild, Input, Output } from '@angular/core';
4
+ import { Injectable, Pipe, signal, EventEmitter, forwardRef, Component, ChangeDetectionStrategy, ViewChild, Input, Output } from '@angular/core';
3
5
  import * as i7 from '@angular/forms';
4
6
  import { UntypedFormControl, Validators, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
5
7
  import * as i4 from '@angular/material/autocomplete';
@@ -9,8 +11,7 @@ import { MatFormFieldModule } from '@angular/material/form-field';
9
11
  import * as i2 from '@ngx-translate/core';
10
12
  import { TranslateModule } from '@ngx-translate/core';
11
13
  import { Subject, takeUntil, debounceTime } from 'rxjs';
12
- import * as i5 from '@angular/common';
13
- import { CurrencyPipe, UpperCasePipe, NgClass, NgIf, NgForOf, NgStyle, NgTemplateOutlet } from '@angular/common';
14
+ import { NgIf, NgForOf, NgStyle, NgTemplateOutlet, NgClass } from '@angular/common';
14
15
  import * as i6 from '@angular/material/input';
15
16
  import { MatInputModule } from '@angular/material/input';
16
17
  import * as i8 from '@angular/material/button';
@@ -19,387 +20,49 @@ import * as i9 from '@angular/material/icon';
19
20
  import { MatIconModule } from '@angular/material/icon';
20
21
  import * as i10 from '@angular/material/progress-spinner';
21
22
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
22
- import * as i1 from '@angular/common/http';
23
- import { HttpParams } from '@angular/common/http';
24
- import { map } from 'rxjs/operators';
25
- import merge from 'lodash.merge';
26
- import * as i5$1 from '@angular/material/core';
27
-
28
- var CustomPipes;
29
- (function (CustomPipes) {
30
- CustomPipes["SHOW_SEGMENTS"] = "showSegments";
31
- CustomPipes["DURATION_TIME"] = "durationTime";
32
- CustomPipes["HUMANIZE_DURATION"] = "humanizeDuration";
33
- CustomPipes["SHOW_TRANSPORT_TYPES"] = "showTransportTypes";
34
- CustomPipes["SHOW_ROLES"] = "showRoles";
35
- CustomPipes["IDA_RETURN"] = "idaReturn";
36
- CustomPipes["CURRENCY"] = "currency";
37
- CustomPipes["UPPERCASE"] = "uppercase";
38
- })(CustomPipes || (CustomPipes = {}));
23
+ import * as i5 from '@angular/material/core';
39
24
 
40
25
  const GENERAL_DISPLAY_OPTIONS = {
41
26
  firthLabel: [
42
27
  {
43
- type: 'path',
28
+ type: DisplayOptionItemType.PATH,
44
29
  path: ['name']
45
30
  }
46
31
  ],
47
32
  applyTranslate: true
48
33
  };
49
34
 
50
- class AutocompleteService {
51
- constructor(_httpClient) {
52
- this._httpClient = _httpClient;
53
- this.httpOptions = {};
54
- }
55
- processParams(filters, value) {
56
- return new Promise((resolve, reject) => {
57
- setTimeout(async () => {
58
- let filter = {};
59
- if (Array.isArray(filters)) {
60
- for (const f of filters) {
61
- await this.processFilterString(f, value).then((resp) => {
62
- if (Object.keys(filter)?.length) {
63
- merge(filter, resp);
64
- }
65
- else {
66
- filter = {
67
- ...filter,
68
- ...resp
69
- };
70
- }
71
- if (f === filters[filters?.length - 1]) {
72
- resolve(filter);
73
- }
74
- });
75
- }
76
- }
77
- else if (typeof filters === 'string') {
78
- await this.processFilterString(filters, value).then((resp) => {
79
- filter = {
80
- ...filter,
81
- ...resp
82
- };
83
- resolve(filter);
84
- });
85
- }
86
- else {
87
- reject(null);
88
- }
89
- }, 100);
90
- });
91
- }
92
- async processFilterString(filter, value) {
93
- let f = {};
94
- const arrayFilters = filter?.split('[');
95
- if (arrayFilters?.findIndex((a) => a === 'filter') >= 0) {
96
- arrayFilters?.splice(0, 1);
97
- }
98
- await this.createObjectFilters(arrayFilters, value).then((data) => {
99
- f = data;
100
- });
101
- return f;
102
- }
103
- async createObjectFilters(array, value) {
104
- for (let filter of array) {
105
- filter = filter?.replace(']', '');
106
- if (array.length > 1) {
107
- array.splice(0, 1);
108
- return { [filter]: await this.createObjectFilters(array, value) };
109
- }
110
- else {
111
- if (filter === '$like') {
112
- return { [filter]: '%' + value + '%' };
113
- }
114
- else {
115
- return { [filter]: value };
116
- }
117
- }
118
- }
119
- }
120
- async getAutocompleteByText(url, text, field, restrictions, removeProperties, order, bodyRequest) {
121
- let httpParams = new HttpParams().set('offset', '0');
122
- httpParams = httpParams.append('limit', '20');
123
- if (order) {
124
- httpParams = httpParams.append('order', order);
125
- }
126
- if (!text) {
127
- text = '';
128
- }
129
- if (bodyRequest) {
130
- let body = {};
131
- if (text && text !== '') {
132
- await this.processParams(field, text)
133
- .then((data) => {
134
- body = {
135
- ...bodyRequest,
136
- filter: data
137
- };
138
- });
139
- }
140
- else {
141
- body = JSON.parse(JSON.stringify(bodyRequest));
142
- }
143
- if (restrictions?.length) {
144
- for (let r of restrictions) {
145
- await this.processParams(r?.filter, r?.value?.toString())
146
- .then((data) => {
147
- let filtersAux = { ...body?.filter };
148
- merge(filtersAux, data);
149
- body = {
150
- ...body,
151
- filter: filtersAux
152
- };
153
- httpParams = httpParams.set('form', JSON.stringify(body));
154
- });
155
- }
156
- }
157
- else {
158
- httpParams = httpParams.append('form', JSON.stringify(body));
159
- }
160
- }
161
- else {
162
- if (text && text !== '') {
163
- if (Array.isArray(field)) {
164
- for (const f of field) {
165
- httpParams = httpParams.append(f, '%' + text + '%');
166
- }
167
- }
168
- else {
169
- if (field?.includes('$like')) {
170
- httpParams = httpParams.append(field, '%' + text + '%');
171
- }
172
- else if (field) {
173
- httpParams = httpParams.append(field, text);
174
- }
175
- }
176
- }
177
- restrictions?.forEach((restriction) => {
178
- if (restriction?.value) {
179
- httpParams = httpParams.append(restriction?.filter, restriction.value?.toString());
180
- }
181
- });
182
- }
183
- this.httpOptions = { params: httpParams };
184
- return this._httpClient
185
- .get(url, this.httpOptions)
186
- .pipe(map((result) => {
187
- result?.data?.map((item) => {
188
- removeProperties?.forEach((property) => {
189
- delete item[property];
190
- });
191
- });
192
- return result;
193
- }));
194
- }
195
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: AutocompleteService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
196
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: AutocompleteService, providedIn: 'root' }); }
197
- }
198
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: AutocompleteService, decorators: [{
199
- type: Injectable,
200
- args: [{
201
- providedIn: 'root'
202
- }]
203
- }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
204
-
205
35
  class UtilsService {
206
36
  /**
207
- * Convierte el tiempo pasado por parámetro en horas y minutos
37
+ * Resolves the value of a property in an object by providing a path.
208
38
  *
209
- * @param time - Tiempo
210
- * @returns Devuelve las horas y minutos
39
+ * @param {any} obj - The object to traverse.
40
+ * @param {string[]} path - An array of strings representing the path to the desired property.
41
+ * @return {any} The value of the property at the given path, or null if the path is invalid.
211
42
  */
212
- static getTime(time) {
213
- const hours = parseInt(Number(time) / 3600 + '', 10);
214
- time = Number(time) - (hours * 3600);
215
- const minutes = parseInt(Number(time) / 60 + '', 10);
216
- return { hours, minutes };
217
- }
218
- /**
219
- * Devuelve el tiempo en formato 'hh:mm'
220
- *
221
- * @param time - Tiempo
222
- */
223
- static getTimePretty(time) {
224
- const { hours, minutes } = UtilsService.getTime(time);
225
- return (hours < 10 ? '0' + hours : hours) + ':' + (minutes < 10 ? '0' + minutes : minutes);
226
- }
227
- /**
228
- * Devuelve el tiempo en formato 'hhh : mmm'
229
- *
230
- * @param time - Tiempo
231
- */
232
- static humanizeDuration(time) {
233
- const { hours, minutes } = UtilsService.getTime(time);
234
- return (hours < 10 ? '0' + hours : hours) + 'h : ' + (minutes < 10 ? '0' + minutes : minutes) + 'm';
235
- }
236
43
  static resolvePropertyByPath(obj, path) {
237
44
  return path.reduce((prev, curr) => {
238
45
  return prev ? prev[curr] : null;
239
46
  }, obj || self);
240
47
  }
241
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
242
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: UtilsService, providedIn: 'root' }); }
48
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
49
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UtilsService, providedIn: 'root' }); }
243
50
  }
244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: UtilsService, decorators: [{
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UtilsService, decorators: [{
245
52
  type: Injectable,
246
53
  args: [{
247
54
  providedIn: 'root'
248
55
  }]
249
56
  }] });
250
57
 
251
- class DurationTimePipe {
252
- transform(value) {
253
- return UtilsService.getTimePretty(value);
254
- }
255
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: DurationTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
256
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.1", ngImport: i0, type: DurationTimePipe, name: "durationTime" }); }
257
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: DurationTimePipe }); }
258
- }
259
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: DurationTimePipe, decorators: [{
260
- type: Injectable
261
- }, {
262
- type: Pipe,
263
- args: [{ name: 'durationTime' }]
264
- }] });
265
-
266
- class HumanizeDurationPipe {
267
- transform(input) {
268
- return UtilsService.humanizeDuration(input);
269
- }
270
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: HumanizeDurationPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
271
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.1", ngImport: i0, type: HumanizeDurationPipe, name: "humanizeDuration" }); }
272
- }
273
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: HumanizeDurationPipe, decorators: [{
274
- type: Pipe,
275
- args: [{
276
- name: 'humanizeDuration'
277
- }]
278
- }] });
279
-
280
- class I18nFieldPipe {
281
- transform(value, lang) {
282
- if (!value) {
283
- return '';
284
- }
285
- if (typeof value === 'string') {
286
- return value;
287
- }
288
- const keys = Object.keys(value);
289
- if (!value[lang]) {
290
- let i = 0;
291
- while (i < keys?.length && (value[keys[i]] === null || value[keys[i]] === '')) {
292
- i++;
293
- }
294
- return keys?.length > i ? value[keys[i]] : 'No está definido';
295
- }
296
- return value[lang] || 'No está definido';
297
- }
298
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: I18nFieldPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
299
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.1", ngImport: i0, type: I18nFieldPipe, name: "i18nField" }); }
300
- }
301
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: I18nFieldPipe, decorators: [{
302
- type: Pipe,
303
- args: [{ name: 'i18nField' }]
304
- }] });
305
-
306
- class IdaReturnPipe {
307
- transform(value) {
308
- if (value === CustomPipes.IDA_RETURN) {
309
- return 'Ida y Vuelta';
310
- }
311
- else {
312
- return 'solo Ida';
313
- }
314
- }
315
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: IdaReturnPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
316
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.1", ngImport: i0, type: IdaReturnPipe, name: "idaReturn" }); }
317
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: IdaReturnPipe }); }
318
- }
319
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: IdaReturnPipe, decorators: [{
320
- type: Injectable
321
- }, {
322
- type: Pipe,
323
- args: [{ name: 'idaReturn' }]
324
- }] });
325
-
326
- class ShowRolesPipe {
327
- transform(value) {
328
- let result = '';
329
- if (value?.length) {
330
- value.forEach(item => {
331
- result += item?.Rol?.name + ', ';
332
- });
333
- result = result.substring(0, result?.length - 2);
334
- }
335
- return result;
336
- }
337
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: ShowRolesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
338
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.1", ngImport: i0, type: ShowRolesPipe, name: "showSegments" }); }
339
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: ShowRolesPipe }); }
340
- }
341
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: ShowRolesPipe, decorators: [{
342
- type: Injectable
343
- }, {
344
- type: Pipe,
345
- args: [{ name: 'showSegments' }]
346
- }] });
347
-
348
- class ShowSegmentsPipe {
349
- transform(value) {
350
- let result = '';
351
- if (value?.length) {
352
- value.forEach(item => {
353
- result += item?.Segment?.PlaceOrigin?.alpha3 + '-' + item?.Segment?.PlaceDestination?.alpha3 + ', ';
354
- });
355
- result = result.substring(0, result?.length - 2);
356
- }
357
- return result;
358
- }
359
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: ShowSegmentsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
360
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.1", ngImport: i0, type: ShowSegmentsPipe, name: "showSegments" }); }
361
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: ShowSegmentsPipe }); }
362
- }
363
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: ShowSegmentsPipe, decorators: [{
364
- type: Injectable
365
- }, {
366
- type: Pipe,
367
- args: [{ name: 'showSegments' }]
368
- }] });
369
-
370
- class ShowTransportTypesPipe {
371
- transform(value) {
372
- let result = '';
373
- if (value?.length) {
374
- value.forEach(item => {
375
- result += item?.TransportType?.name['es'] + ', ';
376
- });
377
- result = result.substring(0, result?.length - 2);
378
- }
379
- return result;
380
- }
381
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: ShowTransportTypesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
382
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.1", ngImport: i0, type: ShowTransportTypesPipe, name: "showTransportTypes" }); }
383
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: ShowTransportTypesPipe }); }
384
- }
385
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: ShowTransportTypesPipe, decorators: [{
386
- type: Injectable
387
- }, {
388
- type: Pipe,
389
- args: [{ name: 'showTransportTypes' }]
390
- }] });
391
-
392
58
  class ResolvePropertyPath {
393
- constructor(_showSegmentPipe, _showRolesPipe, _showTransportTypesPipe, _idaReturnPipe, _currencyPipe, _humanizeDurationPipe, _upperCasePipe, _durationPipe) {
394
- this._showSegmentPipe = _showSegmentPipe;
395
- this._showRolesPipe = _showRolesPipe;
396
- this._showTransportTypesPipe = _showTransportTypesPipe;
397
- this._idaReturnPipe = _idaReturnPipe;
398
- this._currencyPipe = _currencyPipe;
399
- this._humanizeDurationPipe = _humanizeDurationPipe;
400
- this._upperCasePipe = _upperCasePipe;
401
- this._durationPipe = _durationPipe;
402
- }
59
+ /**
60
+ * Transforms the given object based on the provided path and returns the transformed string.
61
+ *
62
+ * @param {any} obj - The object to be transformed.
63
+ * @param {DisplayOptionItem[]} path - The array of display option items used for transformation.
64
+ * @return {string} The transformed string.
65
+ */
403
66
  transform(obj, path) {
404
67
  let result = '';
405
68
  path?.forEach((item) => {
@@ -408,119 +71,20 @@ class ResolvePropertyPath {
408
71
  }
409
72
  else {
410
73
  if (item?.path) {
411
- let value = UtilsService.resolvePropertyByPath(obj, item.path);
412
- switch (item?.customPipe) {
413
- case CustomPipes.SHOW_SEGMENTS:
414
- value = this._showSegmentPipe.transform(value);
415
- break;
416
- case CustomPipes.DURATION_TIME:
417
- value = this._durationPipe.transform(value);
418
- break;
419
- case CustomPipes.HUMANIZE_DURATION:
420
- value = this._humanizeDurationPipe.transform(value);
421
- break;
422
- case CustomPipes.SHOW_TRANSPORT_TYPES:
423
- value = this._showTransportTypesPipe.transform(value);
424
- break;
425
- case CustomPipes.SHOW_ROLES:
426
- value = this._showRolesPipe.transform(value);
427
- break;
428
- case CustomPipes.IDA_RETURN:
429
- value = this._idaReturnPipe.transform(value);
430
- break;
431
- case CustomPipes.CURRENCY:
432
- value = this._currencyPipe.transform(value);
433
- break;
434
- case CustomPipes.UPPERCASE:
435
- value = this._upperCasePipe.transform(value);
436
- break;
437
- default:
438
- break;
439
- }
440
- result += value;
74
+ result += UtilsService.resolvePropertyByPath(obj, item.path);
441
75
  }
442
76
  }
443
77
  });
444
78
  return result;
445
79
  }
446
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: ResolvePropertyPath, deps: [{ token: ShowSegmentsPipe }, { token: ShowRolesPipe }, { token: ShowTransportTypesPipe }, { token: IdaReturnPipe }, { token: i5.CurrencyPipe }, { token: HumanizeDurationPipe }, { token: i5.UpperCasePipe }, { token: DurationTimePipe }], target: i0.ɵɵFactoryTarget.Pipe }); }
447
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.1", ngImport: i0, type: ResolvePropertyPath, name: "resolvePropertyPath" }); }
80
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ResolvePropertyPath, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
81
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: ResolvePropertyPath, isStandalone: true, name: "resolvePropertyPath" }); }
448
82
  }
449
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: ResolvePropertyPath, decorators: [{
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ResolvePropertyPath, decorators: [{
450
84
  type: Pipe,
451
- args: [{ name: 'resolvePropertyPath' }]
452
- }], ctorParameters: function () { return [{ type: ShowSegmentsPipe }, { type: ShowRolesPipe }, { type: ShowTransportTypesPipe }, { type: IdaReturnPipe }, { type: i5.CurrencyPipe }, { type: HumanizeDurationPipe }, { type: i5.UpperCasePipe }, { type: DurationTimePipe }]; } });
453
-
454
- class PipesModule {
455
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
456
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.1", ngImport: i0, type: PipesModule, declarations: [DurationTimePipe,
457
- HumanizeDurationPipe,
458
- I18nFieldPipe,
459
- IdaReturnPipe,
460
- ResolvePropertyPath,
461
- ShowRolesPipe,
462
- ShowSegmentsPipe,
463
- ShowTransportTypesPipe], imports: [CurrencyPipe,
464
- UpperCasePipe], exports: [DurationTimePipe,
465
- HumanizeDurationPipe,
466
- I18nFieldPipe,
467
- IdaReturnPipe,
468
- ResolvePropertyPath,
469
- ShowRolesPipe,
470
- ShowSegmentsPipe,
471
- ShowTransportTypesPipe] }); }
472
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: PipesModule, providers: [
473
- DurationTimePipe,
474
- HumanizeDurationPipe,
475
- I18nFieldPipe,
476
- IdaReturnPipe,
477
- ResolvePropertyPath,
478
- ShowRolesPipe,
479
- ShowSegmentsPipe,
480
- ShowTransportTypesPipe,
481
- CurrencyPipe,
482
- UpperCasePipe
483
- ] }); }
484
- }
485
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: PipesModule, decorators: [{
486
- type: NgModule,
487
85
  args: [{
488
- declarations: [
489
- DurationTimePipe,
490
- HumanizeDurationPipe,
491
- I18nFieldPipe,
492
- IdaReturnPipe,
493
- ResolvePropertyPath,
494
- ShowRolesPipe,
495
- ShowSegmentsPipe,
496
- ShowTransportTypesPipe,
497
- ],
498
- imports: [
499
- CurrencyPipe,
500
- UpperCasePipe
501
- ],
502
- exports: [
503
- DurationTimePipe,
504
- HumanizeDurationPipe,
505
- I18nFieldPipe,
506
- IdaReturnPipe,
507
- ResolvePropertyPath,
508
- ShowRolesPipe,
509
- ShowSegmentsPipe,
510
- ShowTransportTypesPipe
511
- ],
512
- providers: [
513
- DurationTimePipe,
514
- HumanizeDurationPipe,
515
- I18nFieldPipe,
516
- IdaReturnPipe,
517
- ResolvePropertyPath,
518
- ShowRolesPipe,
519
- ShowSegmentsPipe,
520
- ShowTransportTypesPipe,
521
- CurrencyPipe,
522
- UpperCasePipe
523
- ]
86
+ name: 'resolvePropertyPath',
87
+ standalone: true
524
88
  }]
525
89
  }] });
526
90
 
@@ -535,7 +99,6 @@ class GuajiritosGeneralAutocomplete {
535
99
  this.selectedElement = signal(null);
536
100
  this._url = signal(null);
537
101
  this.restrictionsFilters = signal([]);
538
- this.validators = signal([]);
539
102
  this.disabledButton = signal(false);
540
103
  this.loading = signal(false);
541
104
  this.required = signal(false);
@@ -550,6 +113,7 @@ class GuajiritosGeneralAutocomplete {
550
113
  this.showLabel = true;
551
114
  this.appearance = 'outline';
552
115
  this.color = 'accent';
116
+ this.subscriptSizing = 'dynamic';
553
117
  this.placeholder = 'Seleccione un elemento';
554
118
  this.field = ['name'];
555
119
  this.filterString = 'filter[$and][name][$like]';
@@ -606,7 +170,7 @@ class GuajiritosGeneralAutocomplete {
606
170
  this.SelectElement.emit(null);
607
171
  this.filteredOptions.set([]);
608
172
  this.propagateChange(null);
609
- },
173
+ }
610
174
  });
611
175
  }
612
176
  }
@@ -658,24 +222,8 @@ class GuajiritosGeneralAutocomplete {
658
222
  this.inputText?.nativeElement?.focus();
659
223
  }, 500);
660
224
  });
661
- },
662
- });
663
- }
664
- }
665
- /**
666
- * Set custom validators for autocomplete
667
- *
668
- * @param validators - A list of customs validators
669
- */
670
- set customValidators(validators) {
671
- if (validators?.length) {
672
- validators.forEach((validator) => {
673
- this.component.addValidators(validator.validator);
225
+ }
674
226
  });
675
- this.validators.set(validators);
676
- }
677
- else {
678
- this.validators.set([]);
679
227
  }
680
228
  }
681
229
  /**
@@ -704,7 +252,7 @@ class GuajiritosGeneralAutocomplete {
704
252
  this.firstCall.set(false);
705
253
  }
706
254
  this.wasSelected.set(false);
707
- },
255
+ }
708
256
  });
709
257
  }
710
258
  /**
@@ -720,7 +268,7 @@ class GuajiritosGeneralAutocomplete {
720
268
  next: (result) => {
721
269
  this.filteredOptions.set(result?.payload?.data ?? result?.data);
722
270
  this.loading.set(false);
723
- },
271
+ }
724
272
  });
725
273
  });
726
274
  }
@@ -806,36 +354,33 @@ class GuajiritosGeneralAutocomplete {
806
354
  this.getAutocompleteByTextHandler(this.getAutocompleteSearchText());
807
355
  }
808
356
  }
809
- /**
810
- * Acción al seleccionar un elemento
811
- *
812
- * @param item - Elemento seleccionado
813
- */
814
- onSelectElement(item) {
815
- this.wasSelected.set(true);
816
- this.selectedElement.set(item);
817
- this.SelectElement.emit(item);
818
- if (this.valueId) {
819
- this.propagateChange(typeof item === 'object' ? item?.id : item);
820
- }
821
- else {
822
- this.propagateChange(item);
357
+ optionSelected($event) {
358
+ if ($event?.option?.value) {
359
+ this.wasSelected.set(true);
360
+ this.selectedElement.set($event.option.value);
361
+ this.SelectElement.emit($event.option.value);
362
+ if (this.valueId) {
363
+ this.propagateChange(typeof $event.option.value === 'object' ? $event.option.value?.id : $event.option.value);
364
+ }
365
+ else {
366
+ this.propagateChange($event.option.value);
367
+ }
823
368
  }
824
369
  }
825
370
  ngOnDestroy() {
826
371
  this.unsubscribeAll$.next();
827
372
  this.unsubscribeAll$.complete();
828
373
  }
829
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: GuajiritosGeneralAutocomplete, deps: [{ token: AutocompleteService }, { token: i0.NgZone }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
830
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: GuajiritosGeneralAutocomplete, isStandalone: true, selector: "guajiritos-general-autocomplete", inputs: { floatLabel: "floatLabel", bodyRequest: "bodyRequest", debounceTimeValue: "debounceTimeValue", detailsTemplate: "detailsTemplate", label: "label", showLabel: "showLabel", appearance: "appearance", color: "color", placeholder: "placeholder", field: "field", filterString: "filterString", displayOptions: "displayOptions", withoutPaddingBottom: "withoutPaddingBottom", valueId: "valueId", showSuffix: "showSuffix", order: "order", suffixIcon: "suffixIcon", removeProperties: "removeProperties", url: "url", clearData: "clearData", initialValue: "initialValue", restrictions: "restrictions", isRequired: "isRequired", doFocus: "doFocus", customValidators: "customValidators" }, outputs: { SelectElement: "SelectElement" }, providers: [
374
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GuajiritosGeneralAutocomplete, deps: [{ token: i1.AutocompleteService }, { token: i0.NgZone }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
375
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GuajiritosGeneralAutocomplete, isStandalone: true, selector: "guajiritos-general-autocomplete", inputs: { floatLabel: "floatLabel", bodyRequest: "bodyRequest", debounceTimeValue: "debounceTimeValue", detailsTemplate: "detailsTemplate", label: "label", showLabel: "showLabel", appearance: "appearance", color: "color", subscriptSizing: "subscriptSizing", placeholder: "placeholder", field: "field", filterString: "filterString", displayOptions: "displayOptions", withoutPaddingBottom: "withoutPaddingBottom", valueId: "valueId", showSuffix: "showSuffix", order: "order", suffixIcon: "suffixIcon", removeProperties: "removeProperties", url: "url", clearData: "clearData", initialValue: "initialValue", restrictions: "restrictions", isRequired: "isRequired", doFocus: "doFocus" }, outputs: { SelectElement: "SelectElement" }, providers: [
831
376
  {
832
377
  provide: NG_VALUE_ACCESSOR,
833
378
  useExisting: forwardRef(() => GuajiritosGeneralAutocomplete),
834
- multi: true,
835
- },
836
- ], viewQueries: [{ propertyName: "inputText", first: true, predicate: ["inputText"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field [floatLabel]=\"floatLabel\" [ngClass]=\"{'without-padding-bottom': withoutPaddingBottom}\" class=\"w-100\"\r\n [appearance]=\"appearance\" [color]=\"color\">\r\n\r\n <mat-label *ngIf=\"showLabel\">{{label | translate}}</mat-label>\r\n <mat-icon matSuffix *ngIf=\"showSuffix\">{{suffixIcon ?? \"search\"}}</mat-icon>\r\n <input #inputText #trigger=\"matAutocompleteTrigger\" (focus)=\"onFocus()\" [formControl]=\"component\"\r\n [matAutocomplete]=\"autocomplete\" [placeholder]=\"placeholder | translate\" aria-label=\"autocomplete\"\r\n autocomplete=\"off\" matInput type=\"text\" [required]=\"required()\">\r\n <button (click)=\"clear(trigger)\" *ngIf=\"!loading() && component?.value\" [disabled]=\"disabledButton()\"\r\n aria-label=\"Clear\" mat-icon-button matSuffix>\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <button *ngIf=\"loading()\" aria-label=\"search\" mat-icon-button matSuffix>\r\n <mat-spinner [value]=\"90\" color=\"accent\" diameter=\"25\"></mat-spinner>\r\n </button>\r\n <mat-autocomplete #autocomplete=\"matAutocomplete\" [displayWith]=\"displayFn\">\r\n <mat-option *ngFor=\"let option of filteredOptions()\" [value]=\"option\" (onSelectionChange)=\"onSelectElement(option)\">\r\n\r\n <ng-container *ngIf=\"!displayOptions && !detailsTemplate\">\r\n {{ option?.name | i18nField: translateService.currentLang }}\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!detailsTemplate\">\r\n <div class=\"display-options\">\r\n <span [ngStyle]=\"{'line-height': displayOptions?.secondLabel ? '16px' : ''}\">\r\n {{option | resolvePropertyPath:displayOptions.firthLabel | i18nField: translateService.currentLang}}\r\n </span>\r\n <span *ngIf=\"displayOptions?.secondLabel\" class=\"mat-caption\">\r\n {{option | resolvePropertyPath: displayOptions.secondLabel | i18nField: translateService.currentLang}}\r\n </span>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"detailsTemplate\">\r\n <ng-container *ngTemplateOutlet=\"detailsTemplate;context:{$implicit: option }\"></ng-container>\r\n </ng-container>\r\n </mat-option>\r\n </mat-autocomplete>\r\n\r\n <mat-error *ngIf=\"component.hasError('required')\">\r\n {{'Este campo es requerido.' | translate}}\r\n </mat-error>\r\n\r\n <mat-error *ngIf=\"component.hasError('invalidSelection')\">\r\n {{'Debe seleccionar un elemento.' | translate}}\r\n </mat-error>\r\n\r\n <ng-container *ngFor=\"let validator of validators()\">\r\n <mat-error *ngIf=\"component.hasError(validator.key)\">\r\n {{validator.message | translate}}\r\n </mat-error>\r\n </ng-container>\r\n</mat-form-field>\r\n", styles: [".w-100{width:100%}.display-options{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i4.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple", "hideSingleSelectionIndicator"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i4.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i7.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: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i8.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i9.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i10.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: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: PipesModule }, { kind: "pipe", type: I18nFieldPipe, name: "i18nField" }, { kind: "pipe", type: ResolvePropertyPath, name: "resolvePropertyPath" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
379
+ multi: true
380
+ }
381
+ ], viewQueries: [{ propertyName: "inputText", first: true, predicate: ["inputText"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field [floatLabel]=\"floatLabel\" class=\"w-100\" [appearance]=\"appearance\" [color]=\"color\"\r\n [subscriptSizing]=\"subscriptSizing\">\r\n\r\n <mat-label *ngIf=\"showLabel\">{{ label | translate }}</mat-label>\r\n <mat-icon matSuffix *ngIf=\"showSuffix\">{{ suffixIcon ?? \"search\" }}</mat-icon>\r\n <input #inputText #trigger=\"matAutocompleteTrigger\" (focus)=\"onFocus()\" [formControl]=\"component\"\r\n [matAutocomplete]=\"autocomplete\" [placeholder]=\"placeholder | translate\" aria-label=\"autocomplete\"\r\n autocomplete=\"off\" matInput type=\"text\" [required]=\"required()\">\r\n <button (click)=\"clear(trigger)\" *ngIf=\"!loading() && component?.value\" [disabled]=\"disabledButton()\"\r\n aria-label=\"Clear\" mat-icon-button matSuffix>\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <button *ngIf=\"loading()\" aria-label=\"search\" mat-icon-button matSuffix>\r\n <mat-spinner [value]=\"90\" color=\"accent\" diameter=\"25\"></mat-spinner>\r\n </button>\r\n <mat-autocomplete #autocomplete=\"matAutocomplete\" [displayWith]=\"displayFn\" requireSelection\r\n (optionSelected)=\"optionSelected($event)\">\r\n <mat-option *ngFor=\"let option of filteredOptions()\" [value]=\"option\">\r\n\r\n <ng-container *ngIf=\"!displayOptions && !detailsTemplate\">\r\n {{ option?.name | i18n: translateService.currentLang }}\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!detailsTemplate\">\r\n <div class=\"display-options\">\r\n <span [ngStyle]=\"{'line-height': displayOptions?.secondLabel ? '16px' : ''}\">\r\n {{ option | resolvePropertyPath:displayOptions.firthLabel | i18n: translateService.currentLang }}\r\n </span>\r\n <span *ngIf=\"displayOptions?.secondLabel\" class=\"mat-caption\">\r\n {{ option | resolvePropertyPath: displayOptions.secondLabel | i18n: translateService.currentLang }}\r\n </span>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"detailsTemplate\">\r\n <ng-container *ngTemplateOutlet=\"detailsTemplate;context:{$implicit: option }\"></ng-container>\r\n </ng-container>\r\n </mat-option>\r\n </mat-autocomplete>\r\n\r\n <mat-error *ngIf=\"component.invalid\">\r\n {{ 'Este campo es requerido.' | translate }}\r\n </mat-error>\r\n</mat-form-field>\r\n", styles: [".w-100{width:100%}.display-options{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i4.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple", "hideSingleSelectionIndicator"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i4.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i7.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: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i8.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i9.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i10.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: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }, { kind: "pipe", type: ResolvePropertyPath, name: "resolvePropertyPath" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
837
382
  }
838
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: GuajiritosGeneralAutocomplete, decorators: [{
383
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GuajiritosGeneralAutocomplete, decorators: [{
839
384
  type: Component,
840
385
  args: [{ selector: 'guajiritos-general-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
841
386
  MatFormFieldModule,
@@ -850,16 +395,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImpor
850
395
  NgIf,
851
396
  NgForOf,
852
397
  NgStyle,
853
- PipesModule,
854
398
  NgTemplateOutlet,
399
+ I18nPipe,
400
+ ResolvePropertyPath
855
401
  ], providers: [
856
402
  {
857
403
  provide: NG_VALUE_ACCESSOR,
858
404
  useExisting: forwardRef(() => GuajiritosGeneralAutocomplete),
859
- multi: true,
860
- },
861
- ], template: "<mat-form-field [floatLabel]=\"floatLabel\" [ngClass]=\"{'without-padding-bottom': withoutPaddingBottom}\" class=\"w-100\"\r\n [appearance]=\"appearance\" [color]=\"color\">\r\n\r\n <mat-label *ngIf=\"showLabel\">{{label | translate}}</mat-label>\r\n <mat-icon matSuffix *ngIf=\"showSuffix\">{{suffixIcon ?? \"search\"}}</mat-icon>\r\n <input #inputText #trigger=\"matAutocompleteTrigger\" (focus)=\"onFocus()\" [formControl]=\"component\"\r\n [matAutocomplete]=\"autocomplete\" [placeholder]=\"placeholder | translate\" aria-label=\"autocomplete\"\r\n autocomplete=\"off\" matInput type=\"text\" [required]=\"required()\">\r\n <button (click)=\"clear(trigger)\" *ngIf=\"!loading() && component?.value\" [disabled]=\"disabledButton()\"\r\n aria-label=\"Clear\" mat-icon-button matSuffix>\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <button *ngIf=\"loading()\" aria-label=\"search\" mat-icon-button matSuffix>\r\n <mat-spinner [value]=\"90\" color=\"accent\" diameter=\"25\"></mat-spinner>\r\n </button>\r\n <mat-autocomplete #autocomplete=\"matAutocomplete\" [displayWith]=\"displayFn\">\r\n <mat-option *ngFor=\"let option of filteredOptions()\" [value]=\"option\" (onSelectionChange)=\"onSelectElement(option)\">\r\n\r\n <ng-container *ngIf=\"!displayOptions && !detailsTemplate\">\r\n {{ option?.name | i18nField: translateService.currentLang }}\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!detailsTemplate\">\r\n <div class=\"display-options\">\r\n <span [ngStyle]=\"{'line-height': displayOptions?.secondLabel ? '16px' : ''}\">\r\n {{option | resolvePropertyPath:displayOptions.firthLabel | i18nField: translateService.currentLang}}\r\n </span>\r\n <span *ngIf=\"displayOptions?.secondLabel\" class=\"mat-caption\">\r\n {{option | resolvePropertyPath: displayOptions.secondLabel | i18nField: translateService.currentLang}}\r\n </span>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"detailsTemplate\">\r\n <ng-container *ngTemplateOutlet=\"detailsTemplate;context:{$implicit: option }\"></ng-container>\r\n </ng-container>\r\n </mat-option>\r\n </mat-autocomplete>\r\n\r\n <mat-error *ngIf=\"component.hasError('required')\">\r\n {{'Este campo es requerido.' | translate}}\r\n </mat-error>\r\n\r\n <mat-error *ngIf=\"component.hasError('invalidSelection')\">\r\n {{'Debe seleccionar un elemento.' | translate}}\r\n </mat-error>\r\n\r\n <ng-container *ngFor=\"let validator of validators()\">\r\n <mat-error *ngIf=\"component.hasError(validator.key)\">\r\n {{validator.message | translate}}\r\n </mat-error>\r\n </ng-container>\r\n</mat-form-field>\r\n", styles: [".w-100{width:100%}.display-options{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}\n"] }]
862
- }], ctorParameters: function () { return [{ type: AutocompleteService }, { type: i0.NgZone }, { type: i2.TranslateService }]; }, propDecorators: { inputText: [{
405
+ multi: true
406
+ }
407
+ ], template: "<mat-form-field [floatLabel]=\"floatLabel\" class=\"w-100\" [appearance]=\"appearance\" [color]=\"color\"\r\n [subscriptSizing]=\"subscriptSizing\">\r\n\r\n <mat-label *ngIf=\"showLabel\">{{ label | translate }}</mat-label>\r\n <mat-icon matSuffix *ngIf=\"showSuffix\">{{ suffixIcon ?? \"search\" }}</mat-icon>\r\n <input #inputText #trigger=\"matAutocompleteTrigger\" (focus)=\"onFocus()\" [formControl]=\"component\"\r\n [matAutocomplete]=\"autocomplete\" [placeholder]=\"placeholder | translate\" aria-label=\"autocomplete\"\r\n autocomplete=\"off\" matInput type=\"text\" [required]=\"required()\">\r\n <button (click)=\"clear(trigger)\" *ngIf=\"!loading() && component?.value\" [disabled]=\"disabledButton()\"\r\n aria-label=\"Clear\" mat-icon-button matSuffix>\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <button *ngIf=\"loading()\" aria-label=\"search\" mat-icon-button matSuffix>\r\n <mat-spinner [value]=\"90\" color=\"accent\" diameter=\"25\"></mat-spinner>\r\n </button>\r\n <mat-autocomplete #autocomplete=\"matAutocomplete\" [displayWith]=\"displayFn\" requireSelection\r\n (optionSelected)=\"optionSelected($event)\">\r\n <mat-option *ngFor=\"let option of filteredOptions()\" [value]=\"option\">\r\n\r\n <ng-container *ngIf=\"!displayOptions && !detailsTemplate\">\r\n {{ option?.name | i18n: translateService.currentLang }}\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!detailsTemplate\">\r\n <div class=\"display-options\">\r\n <span [ngStyle]=\"{'line-height': displayOptions?.secondLabel ? '16px' : ''}\">\r\n {{ option | resolvePropertyPath:displayOptions.firthLabel | i18n: translateService.currentLang }}\r\n </span>\r\n <span *ngIf=\"displayOptions?.secondLabel\" class=\"mat-caption\">\r\n {{ option | resolvePropertyPath: displayOptions.secondLabel | i18n: translateService.currentLang }}\r\n </span>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"detailsTemplate\">\r\n <ng-container *ngTemplateOutlet=\"detailsTemplate;context:{$implicit: option }\"></ng-container>\r\n </ng-container>\r\n </mat-option>\r\n </mat-autocomplete>\r\n\r\n <mat-error *ngIf=\"component.invalid\">\r\n {{ 'Este campo es requerido.' | translate }}\r\n </mat-error>\r\n</mat-form-field>\r\n", styles: [".w-100{width:100%}.display-options{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}\n"] }]
408
+ }], ctorParameters: function () { return [{ type: i1.AutocompleteService }, { type: i0.NgZone }, { type: i2.TranslateService }]; }, propDecorators: { inputText: [{
863
409
  type: ViewChild,
864
410
  args: ['inputText', { static: true }]
865
411
  }], floatLabel: [{
@@ -878,6 +424,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImpor
878
424
  type: Input
879
425
  }], color: [{
880
426
  type: Input
427
+ }], subscriptSizing: [{
428
+ type: Input
881
429
  }], placeholder: [{
882
430
  type: Input
883
431
  }], field: [{
@@ -912,8 +460,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImpor
912
460
  type: Input
913
461
  }], doFocus: [{
914
462
  type: Input
915
- }], customValidators: [{
916
- type: Input
917
463
  }] } });
918
464
 
919
465
  /*
@@ -924,5 +470,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImpor
924
470
  * Generated bundle index. Do not edit.
925
471
  */
926
472
 
927
- export { CustomPipes, GENERAL_DISPLAY_OPTIONS, GuajiritosGeneralAutocomplete };
473
+ export { GENERAL_DISPLAY_OPTIONS, GuajiritosGeneralAutocomplete };
928
474
  //# sourceMappingURL=guajiritos-general-autocomplete.mjs.map