@wlcm/angular 17.5.26 → 17.5.28
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/forms/esm2022/lib/forms/components/autocomplete/autocomplete.component.mjs +5 -4
- package/forms/esm2022/lib/forms/components/select/select.component.mjs +13 -9
- package/forms/esm2022/lib/forms/constants/index.mjs +2 -1
- package/forms/esm2022/lib/forms/models/_index.mjs +2 -1
- package/forms/esm2022/lib/forms/models/autocomplete.models.mjs +2 -0
- package/forms/esm2022/lib/forms/services/index.mjs +2 -1
- package/forms/esm2022/lib/forms/services/places.api.mjs +58 -0
- package/forms/fesm2022/wlcm-angular-forms.mjs +84 -24
- package/forms/fesm2022/wlcm-angular-forms.mjs.map +1 -1
- package/forms/lib/forms/components/autocomplete/autocomplete.component.d.ts +8 -5
- package/forms/lib/forms/components/select/select.component.d.ts +4 -2
- package/forms/lib/forms/constants/index.d.ts +1 -0
- package/forms/lib/forms/models/_index.d.ts +1 -0
- package/forms/lib/forms/models/autocomplete.models.d.ts +2 -0
- package/forms/lib/forms/services/index.d.ts +1 -0
- package/forms/lib/forms/services/places.api.d.ts +11 -0
- package/package.json +2 -1
- package/phone-input/esm2022/lib/components/country-code-select/country-code-select.component.mjs +2 -2
- package/phone-input/fesm2022/wlcm-angular-phone-input.mjs +1 -1
- package/phone-input/fesm2022/wlcm-angular-phone-input.mjs.map +1 -1
@@ -5,11 +5,11 @@ import * as i4 from '@angular/forms';
|
|
5
5
|
import { Validators, NgControl, ControlContainer, FormControl, NG_VALUE_ACCESSOR, NG_VALIDATORS, ReactiveFormsModule } from '@angular/forms';
|
6
6
|
import * as i1 from '@angular/common';
|
7
7
|
import { CommonModule } from '@angular/common';
|
8
|
-
import { Subject, takeUntil, merge, fromEvent, observeOn, asyncScheduler, BehaviorSubject, EMPTY, switchMap, take, tap, concatMap, filter, timer, map, first } from 'rxjs';
|
8
|
+
import { Subject, Observable, takeUntil, merge, fromEvent, observeOn, asyncScheduler, BehaviorSubject, EMPTY, switchMap, take, tap, concatMap, filter, timer, map, first } from 'rxjs';
|
9
|
+
import { WlcmAutocompleteOption, DEFAULT_QUERY_PARAMS, WlcmIconName, WlcmIconDirective } from '@wlcm/angular/core';
|
9
10
|
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
|
10
11
|
import * as i3$1 from '@angular/material/select';
|
11
12
|
import { MatOption, MAT_SELECT_CONFIG, MatSelect, MatSelectModule } from '@angular/material/select';
|
12
|
-
import { DEFAULT_QUERY_PARAMS, WlcmIconName, WlcmIconDirective } from '@wlcm/angular/core';
|
13
13
|
import * as i1$1 from '@angular/material/autocomplete';
|
14
14
|
import { MatAutocomplete, MatAutocompleteOrigin, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, MatAutocompleteTrigger, MatAutocompleteModule } from '@angular/material/autocomplete';
|
15
15
|
import { RxLet } from '@rx-angular/template/let';
|
@@ -45,6 +45,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
45
45
|
args: [{ providedIn: 'root' }]
|
46
46
|
}] });
|
47
47
|
|
48
|
+
const WLCM_ERRORS = new InjectionToken('WLCM_ERRORS');
|
49
|
+
const WLCM_PRIORITY_ERRORS = new InjectionToken('WLCM_PRIORITY_ERRORS', {
|
50
|
+
providedIn: 'root',
|
51
|
+
factory: () => new Set(),
|
52
|
+
});
|
53
|
+
|
54
|
+
const WLCM_INPUT = new InjectionToken('WLCM_INPUT');
|
55
|
+
const WLCM_INPUT_BINDER = new InjectionToken('WLCM_INPUT_BINDER');
|
56
|
+
const WLCM_FORM_FIELD = new InjectionToken('WLCM_FORM_FIELD');
|
57
|
+
|
58
|
+
const WLCM_SELECT_CONFIG = new InjectionToken('WLCM_SELECT_CONFIG');
|
59
|
+
|
60
|
+
const WLCM_MAPS_API_ERROR = `Google Maps JavaScript API not loaded. Please ensure the following script is included in your HTML: <script src="https://maps.googleapis.com/maps/api/js?key=[apiKey]&libraries=places"></script>`;
|
61
|
+
|
62
|
+
const DEFAULT_PAGINATED_DATA = {
|
63
|
+
totalPages: 1,
|
64
|
+
totalItems: 1,
|
65
|
+
currPage: 1,
|
66
|
+
data: [],
|
67
|
+
};
|
68
|
+
class WlcmDefaultPlacesApi {
|
69
|
+
constructor() {
|
70
|
+
this._autocompleteService = new google.maps.places.AutocompleteService();
|
71
|
+
this._placesService = new google.maps.places.PlacesService(document.createElement('div'));
|
72
|
+
if (typeof google === 'undefined') {
|
73
|
+
throw new Error(WLCM_MAPS_API_ERROR);
|
74
|
+
}
|
75
|
+
}
|
76
|
+
getPlacesPaginated(query) {
|
77
|
+
return new Observable((subscriber) => {
|
78
|
+
const request = { input: query };
|
79
|
+
this._autocompleteService.getPlacePredictions(request, (predictions, status) => {
|
80
|
+
const result = { ...DEFAULT_PAGINATED_DATA };
|
81
|
+
if (status === google.maps.places.PlacesServiceStatus.OK) {
|
82
|
+
result.data = predictions.map((prediction) => {
|
83
|
+
return new WlcmAutocompleteOption(prediction.place_id, prediction.description, prediction.description, prediction);
|
84
|
+
});
|
85
|
+
}
|
86
|
+
subscriber.next(result);
|
87
|
+
subscriber.complete();
|
88
|
+
});
|
89
|
+
});
|
90
|
+
}
|
91
|
+
get placesService() {
|
92
|
+
return this._placesService;
|
93
|
+
}
|
94
|
+
get autocompleteService() {
|
95
|
+
return this._autocompleteService;
|
96
|
+
}
|
97
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmDefaultPlacesApi, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
98
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmDefaultPlacesApi }); }
|
99
|
+
}
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmDefaultPlacesApi, decorators: [{
|
101
|
+
type: Injectable
|
102
|
+
}], ctorParameters: () => [] });
|
103
|
+
class WlcmPlacesApi {
|
104
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmPlacesApi, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
105
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmPlacesApi, providedIn: 'root', useClass: WlcmDefaultPlacesApi }); }
|
106
|
+
}
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmPlacesApi, decorators: [{
|
108
|
+
type: Injectable,
|
109
|
+
args: [{
|
110
|
+
providedIn: 'root',
|
111
|
+
useClass: WlcmDefaultPlacesApi,
|
112
|
+
}]
|
113
|
+
}] });
|
114
|
+
|
48
115
|
const WLCM_FORM = new InjectionToken('WLCM_FORM');
|
49
116
|
const WLCM_FORM_PROVIDER = {
|
50
117
|
provide: WLCM_FORM,
|
@@ -71,12 +138,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
71
138
|
}]
|
72
139
|
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
73
140
|
|
74
|
-
const WLCM_ERRORS = new InjectionToken('WLCM_ERRORS');
|
75
|
-
const WLCM_PRIORITY_ERRORS = new InjectionToken('WLCM_PRIORITY_ERRORS', {
|
76
|
-
providedIn: 'root',
|
77
|
-
factory: () => new Set(),
|
78
|
-
});
|
79
|
-
|
80
141
|
class ErrorsMapperPipe {
|
81
142
|
constructor(changeDetectorRef, errors, priorityErrors) {
|
82
143
|
this.changeDetectorRef = changeDetectorRef;
|
@@ -126,10 +187,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
126
187
|
args: [WLCM_PRIORITY_ERRORS]
|
127
188
|
}] }] });
|
128
189
|
|
129
|
-
const WLCM_INPUT = new InjectionToken('WLCM_INPUT');
|
130
|
-
const WLCM_INPUT_BINDER = new InjectionToken('WLCM_INPUT_BINDER');
|
131
|
-
const WLCM_FORM_FIELD = new InjectionToken('WLCM_FORM_FIELD');
|
132
|
-
|
133
190
|
class WlcmFormFieldPrefixDirective {
|
134
191
|
constructor() {
|
135
192
|
this.handlerClick = (event) => {
|
@@ -346,8 +403,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
346
403
|
args: ['class.required']
|
347
404
|
}] } });
|
348
405
|
|
349
|
-
const WLCM_SELECT_CONFIG = new InjectionToken('WLCM_SELECT_CONFIG');
|
350
|
-
|
351
406
|
let AutocompleteDirective = class AutocompleteDirective {
|
352
407
|
constructor(zone, autocomplete) {
|
353
408
|
this.zone = zone;
|
@@ -410,6 +465,7 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent {
|
|
410
465
|
this.required = false;
|
411
466
|
this.placeholder = '';
|
412
467
|
this.selectOptionFormat = input('ValueOnly');
|
468
|
+
this.noResultsTemplate = input();
|
413
469
|
this.control = new FormControl('');
|
414
470
|
this._loadMore$ = new Subject();
|
415
471
|
this._options$ = new BehaviorSubject([]);
|
@@ -523,7 +579,7 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent {
|
|
523
579
|
this._blurStream$.next(merge(...blurObservables).pipe(map(() => this.control?.markAsTouched())));
|
524
580
|
}
|
525
581
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmAutocompleteComponent, deps: [{ token: WLCM_FORM_FIELD }], target: i0.ɵɵFactoryTarget.Component }); }
|
526
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
582
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: WlcmAutocompleteComponent, isStandalone: true, selector: "wlcm-autocomplete", inputs: { pullDataMethod: { classPropertyName: "pullDataMethod", publicName: "pullDataMethod", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, selectOptionFormat: { classPropertyName: "selectOptionFormat", publicName: "selectOptionFormat", isSignal: true, isRequired: false, transformFunction: null }, noResultsTemplate: { classPropertyName: "noResultsTemplate", publicName: "noResultsTemplate", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wlcm-autocomplete" }, providers: [
|
527
583
|
{ provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, useValue: { overlayPanelClass: PANEL_CLASS$1 } },
|
528
584
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmAutocompleteComponent), multi: true },
|
529
585
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmAutocompleteComponent), multi: true },
|
@@ -534,7 +590,7 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent {
|
|
534
590
|
return { bind: () => autocomplete };
|
535
591
|
},
|
536
592
|
},
|
537
|
-
], viewQueries: [{ propertyName: "inputElement", first: true, predicate: WLCM_INPUT, descendants: true, read: ElementRef }, { propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true }, { propertyName: "autocomplete", first: true, predicate: MatAutocomplete, descendants: true }], ngImport: i0, template: "<input\n wlcmInput\n type=\"text\"\n [matAutocomplete]=\"autocomplete\"\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n (blur)=\"blured()\"\n/>\n\n<mat-autocomplete\n #autocomplete=\"matAutocomplete\"\n wlcmAutocomplete\n [disableRipple]=\"true\"\n [displayWith]=\"displayWith\"\n [hideSingleSelectionIndicator]=\"true\"\n (panelScrolled)=\"loadMore()\"\n>\n <ng-container *rxLet=\"$any(options$ | async); let options\">\n <mat-option *ngFor=\"let option of options\" [value]=\"option\">\n {{ option.viewValue }}\n </mat-option>\n\n <mat-option [disabled]=\"true\" *ngIf=\"options.length === 0\">\n No results found\n </mat-option>\n </ng-container>\n</mat-autocomplete>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i1$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i1$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: AutocompleteDirective, selector: "[wlcmAutocomplete]", outputs: ["panelScrolled"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: "directive", type: WlcmInputDirective, selector: "[wlcmInput]" }, { kind: "directive", type: RxLet, selector: "[rxLet]", inputs: ["rxLet", "rxLetStrategy", "rxLetComplete", "rxLetError", "rxLetSuspense", "rxLetContextTrigger", "rxLetCompleteTrigger", "rxLetErrorTrigger", "rxLetSuspenseTrigger", "rxLetNextTrigger", "rxLetRenderCallback", "rxLetParent", "rxLetPatchZone"], outputs: ["rendered"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
593
|
+
], viewQueries: [{ propertyName: "inputElement", first: true, predicate: WLCM_INPUT, descendants: true, read: ElementRef }, { propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true }, { propertyName: "autocomplete", first: true, predicate: MatAutocomplete, descendants: true }], ngImport: i0, template: "<input\n wlcmInput\n type=\"text\"\n [matAutocomplete]=\"autocomplete\"\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n (blur)=\"blured()\"\n/>\n\n<mat-autocomplete\n #autocomplete=\"matAutocomplete\"\n wlcmAutocomplete\n [disableRipple]=\"true\"\n [displayWith]=\"displayWith\"\n [hideSingleSelectionIndicator]=\"true\"\n (panelScrolled)=\"loadMore()\"\n>\n <ng-container *rxLet=\"$any(options$ | async); let options\">\n <mat-option *ngFor=\"let option of options\" [value]=\"option\">\n {{ option.viewValue }}\n </mat-option>\n\n <mat-option [disabled]=\"true\" *ngIf=\"options.length === 0\">\n @if (noResultsTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n noResultsTemplate()!;\n context: { $implicit: control.value }\n \"\n ></ng-container>\n } @else {\n No results found\n }\n </mat-option>\n </ng-container>\n</mat-autocomplete>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i1$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i1$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: AutocompleteDirective, selector: "[wlcmAutocomplete]", outputs: ["panelScrolled"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: "directive", type: WlcmInputDirective, selector: "[wlcmInput]" }, { kind: "directive", type: RxLet, selector: "[rxLet]", inputs: ["rxLet", "rxLetStrategy", "rxLetComplete", "rxLetError", "rxLetSuspense", "rxLetContextTrigger", "rxLetCompleteTrigger", "rxLetErrorTrigger", "rxLetSuspenseTrigger", "rxLetNextTrigger", "rxLetRenderCallback", "rxLetParent", "rxLetPatchZone"], outputs: ["rendered"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
538
594
|
};
|
539
595
|
WlcmAutocompleteComponent = __decorate([
|
540
596
|
UntilDestroy(),
|
@@ -562,7 +618,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
562
618
|
return { bind: () => autocomplete };
|
563
619
|
},
|
564
620
|
},
|
565
|
-
], template: "<input\n wlcmInput\n type=\"text\"\n [matAutocomplete]=\"autocomplete\"\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n (blur)=\"blured()\"\n/>\n\n<mat-autocomplete\n #autocomplete=\"matAutocomplete\"\n wlcmAutocomplete\n [disableRipple]=\"true\"\n [displayWith]=\"displayWith\"\n [hideSingleSelectionIndicator]=\"true\"\n (panelScrolled)=\"loadMore()\"\n>\n <ng-container *rxLet=\"$any(options$ | async); let options\">\n <mat-option *ngFor=\"let option of options\" [value]=\"option\">\n {{ option.viewValue }}\n </mat-option>\n\n <mat-option [disabled]=\"true\" *ngIf=\"options.length === 0\">\n No results found\n </mat-option>\n </ng-container>\n</mat-autocomplete>\n" }]
|
621
|
+
], template: "<input\n wlcmInput\n type=\"text\"\n [matAutocomplete]=\"autocomplete\"\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n (blur)=\"blured()\"\n/>\n\n<mat-autocomplete\n #autocomplete=\"matAutocomplete\"\n wlcmAutocomplete\n [disableRipple]=\"true\"\n [displayWith]=\"displayWith\"\n [hideSingleSelectionIndicator]=\"true\"\n (panelScrolled)=\"loadMore()\"\n>\n <ng-container *rxLet=\"$any(options$ | async); let options\">\n <mat-option *ngFor=\"let option of options\" [value]=\"option\">\n {{ option.viewValue }}\n </mat-option>\n\n <mat-option [disabled]=\"true\" *ngIf=\"options.length === 0\">\n @if (noResultsTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n noResultsTemplate()!;\n context: { $implicit: control.value }\n \"\n ></ng-container>\n } @else {\n No results found\n }\n </mat-option>\n </ng-container>\n</mat-autocomplete>\n" }]
|
566
622
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
567
623
|
type: Inject,
|
568
624
|
args: [WLCM_FORM_FIELD]
|
@@ -682,10 +738,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
682
738
|
const PANEL_CLASS = 'wlcm-select-panel';
|
683
739
|
const DEFAULT_CONFIG = { overlayPanelClass: [PANEL_CLASS] };
|
684
740
|
const mergeConfig = (config) => {
|
685
|
-
|
741
|
+
const customizer = (_default, _new) => {
|
686
742
|
if (Array.isArray(_default))
|
687
743
|
return _default.concat(_new);
|
688
|
-
}
|
744
|
+
};
|
745
|
+
return mergeWith({ ...DEFAULT_CONFIG }, config, customizer);
|
689
746
|
};
|
690
747
|
let WlcmSelectComponent = class WlcmSelectComponent {
|
691
748
|
openPanel() {
|
@@ -701,8 +758,10 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
701
758
|
this.selectOptionFormat = input('ValueOnly');
|
702
759
|
this.optionTemplate = input(null);
|
703
760
|
this.triggerTemplate = input(null);
|
704
|
-
this.selectionChange = output();
|
705
761
|
this.isOptionDisabled = input(() => false);
|
762
|
+
this.selectionChange = output();
|
763
|
+
this.opened = output();
|
764
|
+
this.closed = output();
|
706
765
|
this.control = new FormControl();
|
707
766
|
this.WlcmIconName = WlcmIconName;
|
708
767
|
this.matOptions = viewChildren(MatOption);
|
@@ -735,6 +794,7 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
735
794
|
this.selectionChange.emit(event);
|
736
795
|
}
|
737
796
|
panelOpened() {
|
797
|
+
this.opened.emit();
|
738
798
|
this.handleClickOutside();
|
739
799
|
}
|
740
800
|
updateOptionsStatus() {
|
@@ -780,7 +840,7 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
780
840
|
}
|
781
841
|
}
|
782
842
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmSelectComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: WLCM_FORM_FIELD }, { token: WLCM_FORM_CONTROL, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
783
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: WlcmSelectComponent, isStandalone: true, selector: "wlcm-select", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, selectOptionFormat: { classPropertyName: "selectOptionFormat", publicName: "selectOptionFormat", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, triggerTemplate: { classPropertyName: "triggerTemplate", publicName: "triggerTemplate", isSignal: true, isRequired: false, transformFunction: null }, isOptionDisabled: { classPropertyName: "isOptionDisabled", publicName: "isOptionDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange" }, host: { listeners: { "click": "openPanel()" } }, providers: [
|
843
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: WlcmSelectComponent, isStandalone: true, selector: "wlcm-select", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, selectOptionFormat: { classPropertyName: "selectOptionFormat", publicName: "selectOptionFormat", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, triggerTemplate: { classPropertyName: "triggerTemplate", publicName: "triggerTemplate", isSignal: true, isRequired: false, transformFunction: null }, isOptionDisabled: { classPropertyName: "isOptionDisabled", publicName: "isOptionDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange", opened: "opened", closed: "closed" }, host: { listeners: { "click": "openPanel()" } }, providers: [
|
784
844
|
WLCM_FORM_CONTROL_PROVIDER,
|
785
845
|
{
|
786
846
|
provide: MAT_SELECT_CONFIG,
|
@@ -791,7 +851,7 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
791
851
|
},
|
792
852
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
793
853
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
794
|
-
], viewQueries: [{ propertyName: "matOptions", predicate: MatOption, descendants: true, isSignal: true }, { propertyName: "matSelect", first: true, predicate: MatSelect, descendants: true }], hostDirectives: [{ directive: WlcmSelectInputBinderDirective }], ngImport: i0, template: "<mat-select\n #selectComponent\n [multiple]=\"multiple\"\n [disableRipple]=\"true\"\n [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n [hideSingleSelectionIndicator]=\"true\"\n [ngClass]=\"{ focused: selectComponent.focused }\"\n (selectionChange)=\"select($event)\"\n (opened)=\"panelOpened()\"\n>\n @if (triggerTemplate()) {\n <mat-select-trigger>\n <ng-container\n *ngTemplateOutlet=\"\n triggerTemplate();\n context: $any({ $implicit: selectComponent.selected })\n \"\n ></ng-container>\n </mat-select-trigger>\n }\n\n <mat-option\n *ngFor=\"let option of options()\"\n [value]=\"selectOptionFormat() === 'CompleteOption' ? option : option.value\"\n >\n @if (optionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n optionTemplate();\n context: $any({ $implicit: option })\n \"\n ></ng-container>\n } @else {\n {{ option.viewValue }}\n }\n </mat-option>\n</mat-select>\n\n<div class=\"wlcm-select-arrow\">\n <ng-container\n [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"\n [wlcmIconStopPropagation]=\"false\"\n ></ng-container>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.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: "directive", type: i3$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: "directive", type: WlcmIconDirective, selector: "[wlcmIcon]", inputs: ["wlcmIcon", "wlcmIconStopPropagation"], outputs: ["wlcmIconClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
854
|
+
], viewQueries: [{ propertyName: "matOptions", predicate: MatOption, descendants: true, isSignal: true }, { propertyName: "matSelect", first: true, predicate: MatSelect, descendants: true }], hostDirectives: [{ directive: WlcmSelectInputBinderDirective }], ngImport: i0, template: "<mat-select\n #selectComponent\n [multiple]=\"multiple\"\n [disableRipple]=\"true\"\n [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n [hideSingleSelectionIndicator]=\"true\"\n [ngClass]=\"{ focused: selectComponent.focused }\"\n (selectionChange)=\"select($event)\"\n (opened)=\"panelOpened()\"\n (closed)=\"closed.emit()\"\n>\n @if (triggerTemplate()) {\n <mat-select-trigger>\n <ng-container\n *ngTemplateOutlet=\"\n triggerTemplate();\n context: $any({ $implicit: selectComponent.selected })\n \"\n ></ng-container>\n </mat-select-trigger>\n }\n\n <mat-option\n *ngFor=\"let option of options()\"\n [value]=\"selectOptionFormat() === 'CompleteOption' ? option : option.value\"\n >\n @if (optionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n optionTemplate();\n context: $any({ $implicit: option })\n \"\n ></ng-container>\n } @else {\n {{ option.viewValue }}\n }\n </mat-option>\n</mat-select>\n\n<div class=\"wlcm-select-arrow\">\n <ng-container\n [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"\n [wlcmIconStopPropagation]=\"false\"\n ></ng-container>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.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: "directive", type: i3$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: "directive", type: WlcmIconDirective, selector: "[wlcmIcon]", inputs: ["wlcmIcon", "wlcmIconStopPropagation"], outputs: ["wlcmIconClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
795
855
|
};
|
796
856
|
WlcmSelectComponent = __decorate([
|
797
857
|
UntilDestroy(),
|
@@ -810,7 +870,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
810
870
|
},
|
811
871
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
812
872
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
813
|
-
], template: "<mat-select\n #selectComponent\n [multiple]=\"multiple\"\n [disableRipple]=\"true\"\n [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n [hideSingleSelectionIndicator]=\"true\"\n [ngClass]=\"{ focused: selectComponent.focused }\"\n (selectionChange)=\"select($event)\"\n (opened)=\"panelOpened()\"\n>\n @if (triggerTemplate()) {\n <mat-select-trigger>\n <ng-container\n *ngTemplateOutlet=\"\n triggerTemplate();\n context: $any({ $implicit: selectComponent.selected })\n \"\n ></ng-container>\n </mat-select-trigger>\n }\n\n <mat-option\n *ngFor=\"let option of options()\"\n [value]=\"selectOptionFormat() === 'CompleteOption' ? option : option.value\"\n >\n @if (optionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n optionTemplate();\n context: $any({ $implicit: option })\n \"\n ></ng-container>\n } @else {\n {{ option.viewValue }}\n }\n </mat-option>\n</mat-select>\n\n<div class=\"wlcm-select-arrow\">\n <ng-container\n [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"\n [wlcmIconStopPropagation]=\"false\"\n ></ng-container>\n</div>\n" }]
|
873
|
+
], template: "<mat-select\n #selectComponent\n [multiple]=\"multiple\"\n [disableRipple]=\"true\"\n [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n [hideSingleSelectionIndicator]=\"true\"\n [ngClass]=\"{ focused: selectComponent.focused }\"\n (selectionChange)=\"select($event)\"\n (opened)=\"panelOpened()\"\n (closed)=\"closed.emit()\"\n>\n @if (triggerTemplate()) {\n <mat-select-trigger>\n <ng-container\n *ngTemplateOutlet=\"\n triggerTemplate();\n context: $any({ $implicit: selectComponent.selected })\n \"\n ></ng-container>\n </mat-select-trigger>\n }\n\n <mat-option\n *ngFor=\"let option of options()\"\n [value]=\"selectOptionFormat() === 'CompleteOption' ? option : option.value\"\n >\n @if (optionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n optionTemplate();\n context: $any({ $implicit: option })\n \"\n ></ng-container>\n } @else {\n {{ option.viewValue }}\n }\n </mat-option>\n</mat-select>\n\n<div class=\"wlcm-select-arrow\">\n <ng-container\n [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"\n [wlcmIconStopPropagation]=\"false\"\n ></ng-container>\n</div>\n" }]
|
814
874
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
815
875
|
type: Inject,
|
816
876
|
args: [WLCM_FORM_FIELD]
|
@@ -892,5 +952,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
892
952
|
* Generated bundle index. Do not edit.
|
893
953
|
*/
|
894
954
|
|
895
|
-
export { WLCM_ERRORS, WLCM_FORM, WLCM_FORM_CONTROL, WLCM_FORM_CONTROL_PROVIDER, WLCM_FORM_FIELD, WLCM_FORM_FIELD_INPUT_CLASS, WLCM_FORM_PROVIDER, WLCM_INPUT, WLCM_INPUT_BINDER, WLCM_PRIORITY_ERRORS, WLCM_SELECT_CONFIG, WlcmAutocompleteComponent, WlcmCheckboxComponent, WlcmErrorComponent, WlcmFormFieldComponent, WlcmFormFieldCustomContainerDirective, WlcmFormFieldHintDirective, WlcmFormFieldPrefixDirective, WlcmFormFieldSuffixDirective, WlcmFormsModule, WlcmInputDirective, WlcmLabelComponent, WlcmSelectComponent, WlcmSelectInputBinderDirective };
|
955
|
+
export { WLCM_ERRORS, WLCM_FORM, WLCM_FORM_CONTROL, WLCM_FORM_CONTROL_PROVIDER, WLCM_FORM_FIELD, WLCM_FORM_FIELD_INPUT_CLASS, WLCM_FORM_PROVIDER, WLCM_INPUT, WLCM_INPUT_BINDER, WLCM_MAPS_API_ERROR, WLCM_PRIORITY_ERRORS, WLCM_SELECT_CONFIG, WlcmAutocompleteComponent, WlcmCheckboxComponent, WlcmErrorComponent, WlcmFormFieldComponent, WlcmFormFieldCustomContainerDirective, WlcmFormFieldHintDirective, WlcmFormFieldPrefixDirective, WlcmFormFieldSuffixDirective, WlcmFormsModule, WlcmInputDirective, WlcmLabelComponent, WlcmSelectComponent, WlcmSelectInputBinderDirective };
|
896
956
|
//# sourceMappingURL=wlcm-angular-forms.mjs.map
|