@guajiritos/general-autocomplete 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/guachos-general-autocomplete.component.mjs +59 -49
- package/esm2020/lib/guachos-general-autocomplete.module.mjs +23 -7
- package/esm2020/utils/pipes/duration.pipe.mjs +4 -4
- package/esm2020/utils/pipes/humanize-duration.pipe.mjs +3 -3
- package/esm2020/utils/pipes/i18n-field.pipe.mjs +3 -3
- package/esm2020/utils/pipes/ida-return.pipe.mjs +4 -4
- package/esm2020/utils/pipes/resolve-property-path.pipe.mjs +3 -3
- package/esm2020/utils/pipes/show-roles.pipe.mjs +4 -4
- package/esm2020/utils/pipes/show-segments.pipe.mjs +4 -4
- package/esm2020/utils/pipes/show-transport-types.pipe.mjs +4 -4
- package/esm2020/utils/services/autocomplete.service.mjs +7 -7
- package/esm2020/utils/services/utils.service.mjs +3 -3
- package/fesm2015/guajiritos-general-autocomplete.mjs +117 -91
- package/fesm2015/guajiritos-general-autocomplete.mjs.map +1 -1
- package/fesm2020/guajiritos-general-autocomplete.mjs +117 -91
- package/fesm2020/guajiritos-general-autocomplete.mjs.map +1 -1
- package/lib/guachos-general-autocomplete.component.d.ts +14 -14
- package/package.json +3 -2
@@ -1,14 +1,14 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { Injectable, Pipe, EventEmitter, forwardRef, Component, ChangeDetectionStrategy, ViewChild, Input, Output, NgModule } from '@angular/core';
|
3
3
|
import * as i4 from '@angular/forms';
|
4
|
-
import {
|
4
|
+
import { UntypedFormControl, Validators, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
5
5
|
import * as i2 from '@ngx-translate/core';
|
6
6
|
import { TranslateModule } from '@ngx-translate/core';
|
7
7
|
import { Subject, takeUntil, debounceTime } from 'rxjs';
|
8
8
|
import * as i1 from '@angular/common/http';
|
9
9
|
import { HttpParams } from '@angular/common/http';
|
10
10
|
import { map } from 'rxjs/operators';
|
11
|
-
import
|
11
|
+
import merge from 'lodash.merge';
|
12
12
|
import * as i3 from '@angular/common';
|
13
13
|
import { CommonModule, UpperCasePipe, CurrencyPipe } from '@angular/common';
|
14
14
|
import * as i5 from '@angular/material/form-field';
|
@@ -60,7 +60,7 @@ class AutocompleteService {
|
|
60
60
|
for (const f of filters) {
|
61
61
|
await this.processFilterString(f, value).then((resp) => {
|
62
62
|
if (Object.keys(filter)?.length) {
|
63
|
-
|
63
|
+
merge(filter, resp);
|
64
64
|
}
|
65
65
|
else {
|
66
66
|
filter = {
|
@@ -145,7 +145,7 @@ class AutocompleteService {
|
|
145
145
|
await this.processParams(r?.filter, r?.value?.toString())
|
146
146
|
.then((data) => {
|
147
147
|
let filtersAux = { ...body?.filter };
|
148
|
-
|
148
|
+
merge(filtersAux, data);
|
149
149
|
body = {
|
150
150
|
...body,
|
151
151
|
filter: filtersAux
|
@@ -193,9 +193,9 @@ class AutocompleteService {
|
|
193
193
|
}));
|
194
194
|
}
|
195
195
|
}
|
196
|
-
AutocompleteService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
197
|
-
AutocompleteService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.
|
198
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
196
|
+
AutocompleteService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AutocompleteService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
197
|
+
AutocompleteService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AutocompleteService, providedIn: 'root' });
|
198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AutocompleteService, decorators: [{
|
199
199
|
type: Injectable,
|
200
200
|
args: [{
|
201
201
|
providedIn: 'root'
|
@@ -239,9 +239,9 @@ class UtilsService {
|
|
239
239
|
}, obj || self);
|
240
240
|
}
|
241
241
|
}
|
242
|
-
UtilsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
243
|
-
UtilsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.
|
244
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
242
|
+
UtilsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
243
|
+
UtilsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UtilsService, providedIn: 'root' });
|
244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UtilsService, decorators: [{
|
245
245
|
type: Injectable,
|
246
246
|
args: [{
|
247
247
|
providedIn: 'root'
|
@@ -267,9 +267,9 @@ class I18nFieldPipe {
|
|
267
267
|
return value[lang] || 'No está definido';
|
268
268
|
}
|
269
269
|
}
|
270
|
-
I18nFieldPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
271
|
-
I18nFieldPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.
|
272
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
270
|
+
I18nFieldPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: I18nFieldPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
271
|
+
I18nFieldPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: I18nFieldPipe, name: "i18nField" });
|
272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: I18nFieldPipe, decorators: [{
|
273
273
|
type: Pipe,
|
274
274
|
args: [{ name: 'i18nField' }]
|
275
275
|
}] });
|
@@ -279,10 +279,10 @@ class DurationTimePipe {
|
|
279
279
|
return UtilsService.getTimePretty(value);
|
280
280
|
}
|
281
281
|
}
|
282
|
-
DurationTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
283
|
-
DurationTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.
|
284
|
-
DurationTimePipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.
|
285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
282
|
+
DurationTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: DurationTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
283
|
+
DurationTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: DurationTimePipe, name: "durationTime" });
|
284
|
+
DurationTimePipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: DurationTimePipe });
|
285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: DurationTimePipe, decorators: [{
|
286
286
|
type: Injectable
|
287
287
|
}, {
|
288
288
|
type: Pipe,
|
@@ -294,9 +294,9 @@ class HumanizeDurationPipe {
|
|
294
294
|
return UtilsService.humanizeDuration(input);
|
295
295
|
}
|
296
296
|
}
|
297
|
-
HumanizeDurationPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
298
|
-
HumanizeDurationPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.
|
299
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
297
|
+
HumanizeDurationPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: HumanizeDurationPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
298
|
+
HumanizeDurationPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: HumanizeDurationPipe, name: "humanizeDuration" });
|
299
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: HumanizeDurationPipe, decorators: [{
|
300
300
|
type: Pipe,
|
301
301
|
args: [{
|
302
302
|
name: 'humanizeDuration'
|
@@ -313,10 +313,10 @@ class IdaReturnPipe {
|
|
313
313
|
}
|
314
314
|
}
|
315
315
|
}
|
316
|
-
IdaReturnPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
317
|
-
IdaReturnPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.
|
318
|
-
IdaReturnPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.
|
319
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
316
|
+
IdaReturnPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: IdaReturnPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
317
|
+
IdaReturnPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: IdaReturnPipe, name: "idaReturn" });
|
318
|
+
IdaReturnPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: IdaReturnPipe });
|
319
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: IdaReturnPipe, decorators: [{
|
320
320
|
type: Injectable
|
321
321
|
}, {
|
322
322
|
type: Pipe,
|
@@ -335,10 +335,10 @@ class ShowRolesPipe {
|
|
335
335
|
return result;
|
336
336
|
}
|
337
337
|
}
|
338
|
-
ShowRolesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
339
|
-
ShowRolesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.
|
340
|
-
ShowRolesPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.
|
341
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
338
|
+
ShowRolesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ShowRolesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
339
|
+
ShowRolesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: ShowRolesPipe, name: "showSegments" });
|
340
|
+
ShowRolesPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ShowRolesPipe });
|
341
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ShowRolesPipe, decorators: [{
|
342
342
|
type: Injectable
|
343
343
|
}, {
|
344
344
|
type: Pipe,
|
@@ -357,10 +357,10 @@ class ShowSegmentsPipe {
|
|
357
357
|
return result;
|
358
358
|
}
|
359
359
|
}
|
360
|
-
ShowSegmentsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
361
|
-
ShowSegmentsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.
|
362
|
-
ShowSegmentsPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.
|
363
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
360
|
+
ShowSegmentsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ShowSegmentsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
361
|
+
ShowSegmentsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: ShowSegmentsPipe, name: "showSegments" });
|
362
|
+
ShowSegmentsPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ShowSegmentsPipe });
|
363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ShowSegmentsPipe, decorators: [{
|
364
364
|
type: Injectable
|
365
365
|
}, {
|
366
366
|
type: Pipe,
|
@@ -379,10 +379,10 @@ class ShowTransportTypesPipe {
|
|
379
379
|
return result;
|
380
380
|
}
|
381
381
|
}
|
382
|
-
ShowTransportTypesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
383
|
-
ShowTransportTypesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.
|
384
|
-
ShowTransportTypesPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.
|
385
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
382
|
+
ShowTransportTypesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ShowTransportTypesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
383
|
+
ShowTransportTypesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: ShowTransportTypesPipe, name: "showTransportTypes" });
|
384
|
+
ShowTransportTypesPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ShowTransportTypesPipe });
|
385
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ShowTransportTypesPipe, decorators: [{
|
386
386
|
type: Injectable
|
387
387
|
}, {
|
388
388
|
type: Pipe,
|
@@ -444,26 +444,27 @@ class ResolvePropertyPath {
|
|
444
444
|
return result;
|
445
445
|
}
|
446
446
|
}
|
447
|
-
ResolvePropertyPath.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
448
|
-
ResolvePropertyPath.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.
|
449
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
447
|
+
ResolvePropertyPath.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ResolvePropertyPath, deps: [{ token: ShowSegmentsPipe }, { token: ShowRolesPipe }, { token: ShowTransportTypesPipe }, { token: IdaReturnPipe }, { token: i3.CurrencyPipe }, { token: HumanizeDurationPipe }, { token: i3.UpperCasePipe }, { token: DurationTimePipe }], target: i0.ɵɵFactoryTarget.Pipe });
|
448
|
+
ResolvePropertyPath.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: ResolvePropertyPath, name: "resolvePropertyPath" });
|
449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ResolvePropertyPath, decorators: [{
|
450
450
|
type: Pipe,
|
451
451
|
args: [{ name: 'resolvePropertyPath' }]
|
452
452
|
}], ctorParameters: function () { return [{ type: ShowSegmentsPipe }, { type: ShowRolesPipe }, { type: ShowTransportTypesPipe }, { type: IdaReturnPipe }, { type: i3.CurrencyPipe }, { type: HumanizeDurationPipe }, { type: i3.UpperCasePipe }, { type: DurationTimePipe }]; } });
|
453
453
|
|
454
454
|
class GuajiritosGeneralAutocompleteComponent {
|
455
|
-
constructor(_autocompleteService, _cdRef, translateService) {
|
455
|
+
constructor(_autocompleteService, _cdRef, _zone, translateService) {
|
456
456
|
this._autocompleteService = _autocompleteService;
|
457
457
|
this._cdRef = _cdRef;
|
458
|
+
this._zone = _zone;
|
458
459
|
this.translateService = translateService;
|
459
460
|
this.unsubscribeAll$ = new Subject();
|
460
461
|
this.firstCall = true;
|
461
462
|
this.restrictionsFilters = [];
|
462
463
|
this.required = true;
|
463
|
-
this.component = new
|
464
|
+
this.component = new UntypedFormControl({
|
464
465
|
value: null, disabled: false
|
465
466
|
});
|
466
|
-
this.
|
467
|
+
this.disabledButton = false;
|
467
468
|
this.loading = false;
|
468
469
|
/**
|
469
470
|
* Possible values 'never', 'auto' or 'always'
|
@@ -477,7 +478,6 @@ class GuajiritosGeneralAutocompleteComponent {
|
|
477
478
|
this.displayOptions = GENERAL_DISPLAY_OPTIONS;
|
478
479
|
this.withoutPaddingBottom = true;
|
479
480
|
this.valueId = false;
|
480
|
-
this.disable = false;
|
481
481
|
this.order = null;
|
482
482
|
this.removeProperties = [];
|
483
483
|
this.SelectElement = new EventEmitter();
|
@@ -506,6 +506,16 @@ class GuajiritosGeneralAutocompleteComponent {
|
|
506
506
|
}
|
507
507
|
};
|
508
508
|
}
|
509
|
+
set disable(flag) {
|
510
|
+
this.disabledButton = flag;
|
511
|
+
if (flag) {
|
512
|
+
this.component.disable();
|
513
|
+
}
|
514
|
+
else {
|
515
|
+
this.component.enable();
|
516
|
+
}
|
517
|
+
this._cdRef.detectChanges();
|
518
|
+
}
|
509
519
|
set url(data) {
|
510
520
|
if (data) {
|
511
521
|
this._url = data;
|
@@ -548,17 +558,19 @@ class GuajiritosGeneralAutocompleteComponent {
|
|
548
558
|
this.component.updateValueAndValidity();
|
549
559
|
}
|
550
560
|
get doFocus() {
|
551
|
-
return this.doFocusSubject
|
561
|
+
return this.doFocusSubject$;
|
552
562
|
}
|
553
563
|
set doFocus(value) {
|
554
|
-
this.doFocusSubject = value;
|
564
|
+
this.doFocusSubject$ = value;
|
555
565
|
if (value) {
|
556
|
-
this.doFocusSubject
|
566
|
+
this.doFocusSubject$
|
557
567
|
.pipe(takeUntil(this.unsubscribeAll$))
|
558
568
|
.subscribe(() => {
|
559
|
-
|
560
|
-
|
561
|
-
|
569
|
+
this._zone.run(() => {
|
570
|
+
setTimeout(() => {
|
571
|
+
this.inputText.nativeElement.focus();
|
572
|
+
}, 500);
|
573
|
+
});
|
562
574
|
});
|
563
575
|
}
|
564
576
|
}
|
@@ -611,32 +623,6 @@ class GuajiritosGeneralAutocompleteComponent {
|
|
611
623
|
}
|
612
624
|
return text;
|
613
625
|
}
|
614
|
-
clear(trigger) {
|
615
|
-
this.component.setValue(null);
|
616
|
-
this.selectedElement = null;
|
617
|
-
this.SelectElement.emit(null);
|
618
|
-
this._cdRef.detectChanges();
|
619
|
-
this.onChanged(null);
|
620
|
-
setTimeout(() => {
|
621
|
-
trigger.openPanel();
|
622
|
-
this._cdRef.detectChanges();
|
623
|
-
}, 200);
|
624
|
-
}
|
625
|
-
onFocus() {
|
626
|
-
this.getAutocompleteByTextHandler(this.getAutocompleteSearchText());
|
627
|
-
}
|
628
|
-
onSelectElement(item) {
|
629
|
-
this.selectedElement = item;
|
630
|
-
this.SelectElement.emit(item);
|
631
|
-
this.value = item;
|
632
|
-
if (this.valueId) {
|
633
|
-
this.onChanged(item?.id);
|
634
|
-
}
|
635
|
-
else {
|
636
|
-
this.onChanged(item);
|
637
|
-
}
|
638
|
-
this._cdRef.detectChanges();
|
639
|
-
}
|
640
626
|
writeValue(value) {
|
641
627
|
if (value) {
|
642
628
|
if (typeof value === 'number') {
|
@@ -663,8 +649,32 @@ class GuajiritosGeneralAutocompleteComponent {
|
|
663
649
|
this.onTouched = fn;
|
664
650
|
this._cdRef.detectChanges();
|
665
651
|
}
|
666
|
-
|
667
|
-
this.
|
652
|
+
clear(trigger) {
|
653
|
+
this.component.setValue(null);
|
654
|
+
this.selectedElement = null;
|
655
|
+
this.SelectElement.emit(null);
|
656
|
+
this._cdRef.detectChanges();
|
657
|
+
this.onChanged(null);
|
658
|
+
this._zone.run(() => {
|
659
|
+
setTimeout(() => {
|
660
|
+
trigger.openPanel();
|
661
|
+
this._cdRef.detectChanges();
|
662
|
+
}, 200);
|
663
|
+
});
|
664
|
+
}
|
665
|
+
onFocus() {
|
666
|
+
this.getAutocompleteByTextHandler(this.getAutocompleteSearchText());
|
667
|
+
}
|
668
|
+
onSelectElement(item) {
|
669
|
+
this.selectedElement = item;
|
670
|
+
this.SelectElement.emit(item);
|
671
|
+
this.value = item;
|
672
|
+
if (this.valueId) {
|
673
|
+
this.onChanged(item?.id);
|
674
|
+
}
|
675
|
+
else {
|
676
|
+
this.onChanged(item);
|
677
|
+
}
|
668
678
|
this._cdRef.detectChanges();
|
669
679
|
}
|
670
680
|
ngOnInit() {
|
@@ -675,15 +685,15 @@ class GuajiritosGeneralAutocompleteComponent {
|
|
675
685
|
this.unsubscribeAll$.complete();
|
676
686
|
}
|
677
687
|
}
|
678
|
-
GuajiritosGeneralAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
679
|
-
GuajiritosGeneralAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.
|
688
|
+
GuajiritosGeneralAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GuajiritosGeneralAutocompleteComponent, deps: [{ token: AutocompleteService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
689
|
+
GuajiritosGeneralAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: GuajiritosGeneralAutocompleteComponent, selector: "guajiritos-general-autocomplete", inputs: { floatLabel: "floatLabel", bodyRequest: "bodyRequest", debounceTimeValue: "debounceTimeValue", detailsTemplate: "detailsTemplate", label: "label", placeholder: "placeholder", field: "field", filterString: "filterString", displayOptions: "displayOptions", withoutPaddingBottom: "withoutPaddingBottom", valueId: "valueId", order: "order", removeProperties: "removeProperties", disable: "disable", url: "url", clearData: "clearData", initialValue: "initialValue", restrictions: "restrictions", isRequired: "isRequired", doFocus: "doFocus" }, outputs: { SelectElement: "SelectElement" }, providers: [
|
680
690
|
{
|
681
691
|
provide: NG_VALUE_ACCESSOR,
|
682
692
|
useExisting: forwardRef(() => GuajiritosGeneralAutocompleteComponent),
|
683
693
|
multi: true
|
684
694
|
}
|
685
|
-
], viewQueries: [{ propertyName: "inputText", first: true, predicate: ["inputText"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field [floatLabel]=\"floatLabel\" [ngClass]=\"{'without-padding-bottom': withoutPaddingBottom}\"\r\n appearance=\"outline\" class=\"w-100\" color=\"accent\">\r\n\r\n <mat-label>{{label | translate}}</mat-label>\r\n <input #inputText #trigger=\"matAutocompleteTrigger\" (blur)=\"onTouched()\" (focus)=\"onFocus()\"
|
686
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
695
|
+
], viewQueries: [{ propertyName: "inputText", first: true, predicate: ["inputText"], descendants: true, static: true }], ngImport: i0, template: "<mat-form-field [floatLabel]=\"floatLabel\" [ngClass]=\"{'without-padding-bottom': withoutPaddingBottom}\"\r\n appearance=\"outline\" class=\"w-100\" color=\"accent\">\r\n\r\n <mat-label>{{label | translate}}</mat-label>\r\n <input #inputText #trigger=\"matAutocompleteTrigger\" (blur)=\"onTouched()\" (focus)=\"onFocus()\"\r\n [formControl]=\"component\" [matAutocomplete]=\"autocomplete\" [placeholder]=\"placeholder | translate\"\r\n aria-label=\"Number\" autocomplete=\"off\" matInput type=\"text\">\r\n <button (click)=\"clear(trigger)\" *ngIf=\"!loading && component?.value\" [disabled]=\"disabledButton\" aria-label=\"Clear\"\r\n mat-icon-button matSuffix>\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <button *ngIf=\"loading\" aria-label=\"Clear\" 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\"\r\n (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\r\n </mat-option>\r\n </mat-autocomplete>\r\n</mat-form-field>\r\n", styles: ["::ng-deep .without-padding-bottom .mat-form-field-wrapper{padding-bottom:0!important}.w-100{width:100%}.display-options{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i8.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i9.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: "component", type: i10.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i10.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "pipe", type: I18nFieldPipe, name: "i18nField" }, { kind: "pipe", type: ResolvePropertyPath, name: "resolvePropertyPath" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
696
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GuajiritosGeneralAutocompleteComponent, decorators: [{
|
687
697
|
type: Component,
|
688
698
|
args: [{ selector: 'guajiritos-general-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
689
699
|
{
|
@@ -691,8 +701,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
691
701
|
useExisting: forwardRef(() => GuajiritosGeneralAutocompleteComponent),
|
692
702
|
multi: true
|
693
703
|
}
|
694
|
-
], template: "<mat-form-field [floatLabel]=\"floatLabel\" [ngClass]=\"{'without-padding-bottom': withoutPaddingBottom}\"\r\n appearance=\"outline\" class=\"w-100\" color=\"accent\">\r\n\r\n <mat-label>{{label | translate}}</mat-label>\r\n <input #inputText #trigger=\"matAutocompleteTrigger\" (blur)=\"onTouched()\" (focus)=\"onFocus()\"
|
695
|
-
}], ctorParameters: function () { return [{ type: AutocompleteService }, { type: i0.ChangeDetectorRef }, { type: i2.TranslateService }]; }, propDecorators: { inputText: [{
|
704
|
+
], template: "<mat-form-field [floatLabel]=\"floatLabel\" [ngClass]=\"{'without-padding-bottom': withoutPaddingBottom}\"\r\n appearance=\"outline\" class=\"w-100\" color=\"accent\">\r\n\r\n <mat-label>{{label | translate}}</mat-label>\r\n <input #inputText #trigger=\"matAutocompleteTrigger\" (blur)=\"onTouched()\" (focus)=\"onFocus()\"\r\n [formControl]=\"component\" [matAutocomplete]=\"autocomplete\" [placeholder]=\"placeholder | translate\"\r\n aria-label=\"Number\" autocomplete=\"off\" matInput type=\"text\">\r\n <button (click)=\"clear(trigger)\" *ngIf=\"!loading && component?.value\" [disabled]=\"disabledButton\" aria-label=\"Clear\"\r\n mat-icon-button matSuffix>\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <button *ngIf=\"loading\" aria-label=\"Clear\" 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\"\r\n (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\r\n </mat-option>\r\n </mat-autocomplete>\r\n</mat-form-field>\r\n", styles: ["::ng-deep .without-padding-bottom .mat-form-field-wrapper{padding-bottom:0!important}.w-100{width:100%}.display-options{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}\n"] }]
|
705
|
+
}], ctorParameters: function () { return [{ type: AutocompleteService }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i2.TranslateService }]; }, propDecorators: { inputText: [{
|
696
706
|
type: ViewChild,
|
697
707
|
args: ['inputText', { static: true }]
|
698
708
|
}], floatLabel: [{
|
@@ -717,14 +727,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
717
727
|
type: Input
|
718
728
|
}], valueId: [{
|
719
729
|
type: Input
|
720
|
-
}], disable: [{
|
721
|
-
type: Input
|
722
730
|
}], order: [{
|
723
731
|
type: Input
|
724
732
|
}], removeProperties: [{
|
725
733
|
type: Input
|
726
734
|
}], SelectElement: [{
|
727
735
|
type: Output
|
736
|
+
}], disable: [{
|
737
|
+
type: Input
|
728
738
|
}], url: [{
|
729
739
|
type: Input
|
730
740
|
}], clearData: [{
|
@@ -741,8 +751,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
741
751
|
|
742
752
|
class GuajiritosGeneralAutocompleteModule {
|
743
753
|
}
|
744
|
-
GuajiritosGeneralAutocompleteModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
745
|
-
GuajiritosGeneralAutocompleteModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.
|
754
|
+
GuajiritosGeneralAutocompleteModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GuajiritosGeneralAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
755
|
+
GuajiritosGeneralAutocompleteModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: GuajiritosGeneralAutocompleteModule, declarations: [GuajiritosGeneralAutocompleteComponent,
|
746
756
|
DurationTimePipe,
|
747
757
|
I18nFieldPipe,
|
748
758
|
ResolvePropertyPath,
|
@@ -760,10 +770,18 @@ GuajiritosGeneralAutocompleteModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersio
|
|
760
770
|
MatButtonModule,
|
761
771
|
MatInputModule,
|
762
772
|
MatAutocompleteModule], exports: [GuajiritosGeneralAutocompleteComponent] });
|
763
|
-
GuajiritosGeneralAutocompleteModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.
|
773
|
+
GuajiritosGeneralAutocompleteModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GuajiritosGeneralAutocompleteModule, providers: [
|
764
774
|
UpperCasePipe,
|
765
775
|
CurrencyPipe,
|
766
|
-
AutocompleteService
|
776
|
+
AutocompleteService,
|
777
|
+
DurationTimePipe,
|
778
|
+
I18nFieldPipe,
|
779
|
+
ResolvePropertyPath,
|
780
|
+
HumanizeDurationPipe,
|
781
|
+
IdaReturnPipe,
|
782
|
+
ShowRolesPipe,
|
783
|
+
ShowSegmentsPipe,
|
784
|
+
ShowTransportTypesPipe
|
767
785
|
], imports: [CommonModule,
|
768
786
|
TranslateModule,
|
769
787
|
FormsModule,
|
@@ -774,7 +792,7 @@ GuajiritosGeneralAutocompleteModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersio
|
|
774
792
|
MatButtonModule,
|
775
793
|
MatInputModule,
|
776
794
|
MatAutocompleteModule] });
|
777
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
795
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GuajiritosGeneralAutocompleteModule, decorators: [{
|
778
796
|
type: NgModule,
|
779
797
|
args: [{
|
780
798
|
declarations: [
|
@@ -803,7 +821,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
803
821
|
providers: [
|
804
822
|
UpperCasePipe,
|
805
823
|
CurrencyPipe,
|
806
|
-
AutocompleteService
|
824
|
+
AutocompleteService,
|
825
|
+
DurationTimePipe,
|
826
|
+
I18nFieldPipe,
|
827
|
+
ResolvePropertyPath,
|
828
|
+
HumanizeDurationPipe,
|
829
|
+
IdaReturnPipe,
|
830
|
+
ShowRolesPipe,
|
831
|
+
ShowSegmentsPipe,
|
832
|
+
ShowTransportTypesPipe
|
807
833
|
],
|
808
834
|
exports: [
|
809
835
|
GuajiritosGeneralAutocompleteComponent
|