@onemrvapublic/design-system 19.2.0-develop.8 → 19.2.0-develop.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/de.json +3 -1
- package/assets/i18n/en.json +3 -1
- package/assets/i18n/fr.json +3 -1
- package/assets/i18n/nl.json +3 -1
- package/fesm2022/onemrvapublic-design-system-mat-input-address.mjs +90 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-address.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-phone.mjs +6 -3
- package/fesm2022/onemrvapublic-design-system-mat-input-phone.mjs.map +1 -1
- package/fesm2022/onemrvapublic-design-system-mat-select-search.mjs +2 -3
- package/fesm2022/onemrvapublic-design-system-mat-select-search.mjs.map +1 -1
- package/fesm2022/onemrvapublic-design-system-shared.mjs +25 -1
- package/fesm2022/onemrvapublic-design-system-shared.mjs.map +1 -1
- package/mat-input-address/index.d.ts +1 -0
- package/mat-input-address/src/onemrva-mat-input-address.component.d.ts +22 -0
- package/mat-input-address/src/onemrva-mat-input-address.component.scss +14 -0
- package/mat-input-phone/src/onemrva-mat-input-phone.component.d.ts +2 -1
- package/mat-select-search/src/mat-select-search.component.scss +1 -0
- package/package.json +5 -1
- package/shared/src/lib/services/index.d.ts +1 -0
- package/shared/src/lib/services/osm.service.d.ts +17 -0
package/assets/i18n/de.json
CHANGED
|
@@ -100,7 +100,8 @@
|
|
|
100
100
|
"deselect.all": "Deselect All",
|
|
101
101
|
"search": {
|
|
102
102
|
"filter": "Forschen",
|
|
103
|
-
"notFound": "Kein Ergebnis"
|
|
103
|
+
"notFound": "Kein Ergebnis",
|
|
104
|
+
"not.found": "Kein Ergebnis"
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
107
|
"layout": {
|
|
@@ -135,6 +136,7 @@
|
|
|
135
136
|
"required": "Feld erforderlich",
|
|
136
137
|
"invalid": "Ungültiges Feld",
|
|
137
138
|
"notFound": "Nicht gefunden",
|
|
139
|
+
"not.found": "Nicht gefunden",
|
|
138
140
|
"search": "Suchen",
|
|
139
141
|
"label": "Telefonnummer",
|
|
140
142
|
"hint": "Beginnen Sie mit 0 für belgische Telefonnummern"
|
package/assets/i18n/en.json
CHANGED
|
@@ -100,7 +100,8 @@
|
|
|
100
100
|
"deselect.all": "Deselect All",
|
|
101
101
|
"search": {
|
|
102
102
|
"filter": "Search",
|
|
103
|
-
"notFound": "Not found"
|
|
103
|
+
"notFound": "Not found",
|
|
104
|
+
"not.found": "Not found"
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
107
|
"layout": {
|
|
@@ -135,6 +136,7 @@
|
|
|
135
136
|
"required": "Field required",
|
|
136
137
|
"invalid": "Field invalid",
|
|
137
138
|
"notFound": "Not found",
|
|
139
|
+
"not.found": "Not found",
|
|
138
140
|
"search": "Search",
|
|
139
141
|
"label": "Phone number",
|
|
140
142
|
"hint": "Start with 0 for belgian phone numbers"
|
package/assets/i18n/fr.json
CHANGED
|
@@ -100,7 +100,8 @@
|
|
|
100
100
|
"deselect.all": "Tout désélectionner",
|
|
101
101
|
"search": {
|
|
102
102
|
"filter": "Rechercher",
|
|
103
|
-
"notFound": "Pas de résultat"
|
|
103
|
+
"notFound": "Pas de résultat",
|
|
104
|
+
"not.found": "Pas de résultat"
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
107
|
"layout": {
|
|
@@ -135,6 +136,7 @@
|
|
|
135
136
|
"required": "Champs requis",
|
|
136
137
|
"invalid": "Champs invalide",
|
|
137
138
|
"notFound": "Introuvable",
|
|
139
|
+
"not.found": "Introuvable",
|
|
138
140
|
"search": "Rechercher",
|
|
139
141
|
"label": "Téléphone",
|
|
140
142
|
"hint": "Start with 0 for belgian phone numbers"
|
package/assets/i18n/nl.json
CHANGED
|
@@ -100,7 +100,8 @@
|
|
|
100
100
|
"deselect.all": "Deselect All",
|
|
101
101
|
"search": {
|
|
102
102
|
"filter": "Zoeken",
|
|
103
|
-
"notFound": "Geen resultaten"
|
|
103
|
+
"notFound": "Geen resultaten",
|
|
104
|
+
"not.found": "Geen resultaten"
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
107
|
"layout": {
|
|
@@ -134,6 +135,7 @@
|
|
|
134
135
|
"required": "Veld vereist",
|
|
135
136
|
"invalid": "Ongeldig veld",
|
|
136
137
|
"notFound": "Niet gevonden",
|
|
138
|
+
"not.found": "Niet gevonden",
|
|
137
139
|
"search": "Zoeken",
|
|
138
140
|
"label": "Telefoonnummer",
|
|
139
141
|
"hint": "Begin met 0 voor Belgische telefoonnummers"
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Output, Input, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import * as i5 from '@angular/forms';
|
|
4
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { startWith, debounceTime, switchMap, map } from 'rxjs';
|
|
6
|
+
import * as i2 from '@angular/common';
|
|
7
|
+
import { CommonModule } from '@angular/common';
|
|
8
|
+
import * as i3 from '@angular/material/input';
|
|
9
|
+
import { MatInputModule } from '@angular/material/input';
|
|
10
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
11
|
+
import * as i4 from '@angular/material/select';
|
|
12
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
13
|
+
import * as i6 from '@ngx-translate/core';
|
|
14
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
15
|
+
import { MatAutocompleteTrigger, MatAutocomplete } from '@angular/material/autocomplete';
|
|
16
|
+
import { MatIcon } from '@angular/material/icon';
|
|
17
|
+
import { FlagIconComponent } from '@onemrvapublic/design-system/flag-icon';
|
|
18
|
+
import * as i1 from '@onemrvapublic/design-system/shared';
|
|
19
|
+
|
|
20
|
+
class OnemrvaMatInputAddressComponent {
|
|
21
|
+
constructor(osm) {
|
|
22
|
+
this.osm = osm;
|
|
23
|
+
this.placeholder = 'input.address.placeholder';
|
|
24
|
+
this.readonly = false;
|
|
25
|
+
this.label = 'Address';
|
|
26
|
+
this.noEntriesFoundLabel = 'Not found';
|
|
27
|
+
this.hint = '';
|
|
28
|
+
this.getAddress = new EventEmitter();
|
|
29
|
+
this.isLoading = false;
|
|
30
|
+
}
|
|
31
|
+
ngOnInit() {
|
|
32
|
+
this.results$ = this.address.valueChanges.pipe(startWith(''), debounceTime(300), switchMap((value) => {
|
|
33
|
+
if (!value || value.length <= 2) {
|
|
34
|
+
this.isLoading = false;
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
this.isLoading = true;
|
|
38
|
+
return this.osm.searchAddress(value).pipe(map(results => {
|
|
39
|
+
this.isLoading = false;
|
|
40
|
+
return results;
|
|
41
|
+
}));
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
selectAddress(address) {
|
|
45
|
+
this.address.setValue(address.display_name);
|
|
46
|
+
this.getAddress.emit(address);
|
|
47
|
+
}
|
|
48
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: OnemrvaMatInputAddressComponent, deps: [{ token: i1.OnemRvaOSMService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
49
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: OnemrvaMatInputAddressComponent, isStandalone: true, selector: "onemrva-mat-input-address", inputs: { placeholder: "placeholder", readonly: "readonly", address: "address", label: "label", noEntriesFoundLabel: "noEntriesFoundLabel", hint: "hint" }, outputs: { getAddress: "getAddress" }, ngImport: i0, template: "<mat-form-field appearance=\"outline\">\n <mat-label>{{ label | translate }}</mat-label>\n <mat-icon matSuffix [ngClass]=\"{ spin: isLoading }\">\n {{ isLoading ? 'refresh' : 'search' }}\n </mat-icon>\n\n <input\n type=\"text\"\n matInput\n [formControl]=\"address\"\n [readonly]=\"readonly\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder | translate\"\n />\n\n <mat-hint *ngIf=\"hint\">{{ hint }}</mat-hint>\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"selectAddress($event.option.value)\"\n >\n <mat-option *ngFor=\"let result of results$ | async\" [value]=\"result\">\n <span class=\"country\">\n <flag-icon [countryCode]=\"result.address['country_code']\" />\n {{ result.display_name }}\n </span>\n </mat-option>\n <mat-option *ngIf=\"(results$ | async)?.length === 0\">\n {{ noEntriesFoundLabel | translate }}\n </mat-option>\n </mat-autocomplete>\n</mat-form-field>\n", styles: ["onemrva-mat-input-address mat-form-field{width:100%}onemrva-mat-input-address .spin{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { 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.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i5.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: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }, { kind: "directive", type: MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: 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: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: FlagIconComponent, selector: "flag-icon", inputs: ["countryCode", "mode", "width"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: OnemrvaMatInputAddressComponent, decorators: [{
|
|
52
|
+
type: Component,
|
|
53
|
+
args: [{ selector: 'onemrva-mat-input-address', standalone: true, imports: [
|
|
54
|
+
CommonModule,
|
|
55
|
+
MatInputModule,
|
|
56
|
+
MatFormFieldModule,
|
|
57
|
+
MatSelectModule,
|
|
58
|
+
ReactiveFormsModule,
|
|
59
|
+
TranslateModule,
|
|
60
|
+
MatAutocompleteTrigger,
|
|
61
|
+
MatAutocomplete,
|
|
62
|
+
MatIcon,
|
|
63
|
+
FlagIconComponent,
|
|
64
|
+
], encapsulation: ViewEncapsulation.None, template: "<mat-form-field appearance=\"outline\">\n <mat-label>{{ label | translate }}</mat-label>\n <mat-icon matSuffix [ngClass]=\"{ spin: isLoading }\">\n {{ isLoading ? 'refresh' : 'search' }}\n </mat-icon>\n\n <input\n type=\"text\"\n matInput\n [formControl]=\"address\"\n [readonly]=\"readonly\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder | translate\"\n />\n\n <mat-hint *ngIf=\"hint\">{{ hint }}</mat-hint>\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"selectAddress($event.option.value)\"\n >\n <mat-option *ngFor=\"let result of results$ | async\" [value]=\"result\">\n <span class=\"country\">\n <flag-icon [countryCode]=\"result.address['country_code']\" />\n {{ result.display_name }}\n </span>\n </mat-option>\n <mat-option *ngIf=\"(results$ | async)?.length === 0\">\n {{ noEntriesFoundLabel | translate }}\n </mat-option>\n </mat-autocomplete>\n</mat-form-field>\n", styles: ["onemrva-mat-input-address mat-form-field{width:100%}onemrva-mat-input-address .spin{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}\n"] }]
|
|
65
|
+
}], ctorParameters: () => [{ type: i1.OnemRvaOSMService }], propDecorators: { placeholder: [{
|
|
66
|
+
type: Input
|
|
67
|
+
}], readonly: [{
|
|
68
|
+
type: Input
|
|
69
|
+
}], address: [{
|
|
70
|
+
type: Input
|
|
71
|
+
}], label: [{
|
|
72
|
+
type: Input
|
|
73
|
+
}], noEntriesFoundLabel: [{
|
|
74
|
+
type: Input
|
|
75
|
+
}], hint: [{
|
|
76
|
+
type: Input
|
|
77
|
+
}], getAddress: [{
|
|
78
|
+
type: Output
|
|
79
|
+
}] } });
|
|
80
|
+
|
|
81
|
+
/*
|
|
82
|
+
* Public API Surface of mat-bank-account-input
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Generated bundle index. Do not edit.
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
export { OnemrvaMatInputAddressComponent };
|
|
90
|
+
//# sourceMappingURL=onemrvapublic-design-system-mat-input-address.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onemrvapublic-design-system-mat-input-address.mjs","sources":["../../../../projects/onemrva/design-system/mat-input-address/src/onemrva-mat-input-address.component.ts","../../../../projects/onemrva/design-system/mat-input-address/src/onemrva-mat-input-address.component.html","../../../../projects/onemrva/design-system/mat-input-address/index.ts","../../../../projects/onemrva/design-system/mat-input-address/onemrvapublic-design-system-mat-input-address.ts"],"sourcesContent":["import {\n Component,\n EventEmitter,\n Input,\n Output,\n ViewEncapsulation,\n OnInit,\n} from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { debounceTime, switchMap, Observable, startWith, map } from 'rxjs';\nimport { CommonModule } from '@angular/common';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatSelectModule } from '@angular/material/select';\nimport { TranslateModule } from '@ngx-translate/core';\nimport {\n MatAutocomplete,\n MatAutocompleteTrigger,\n} from '@angular/material/autocomplete';\nimport { MatIcon } from '@angular/material/icon';\nimport { FlagIconComponent } from '@onemrvapublic/design-system/flag-icon';\nimport {\n OnemRvaOSMService,\n OSMResult,\n} from '@onemrvapublic/design-system/shared';\n\n@Component({\n selector: 'onemrva-mat-input-address',\n styleUrls: ['onemrva-mat-input-address.component.scss'],\n templateUrl: 'onemrva-mat-input-address.component.html',\n standalone: true,\n imports: [\n CommonModule,\n MatInputModule,\n MatFormFieldModule,\n MatSelectModule,\n ReactiveFormsModule,\n TranslateModule,\n MatAutocompleteTrigger,\n MatAutocomplete,\n MatIcon,\n FlagIconComponent,\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OnemrvaMatInputAddressComponent implements OnInit {\n @Input() placeholder = 'input.address.placeholder';\n @Input() readonly = false;\n @Input() address!: FormControl;\n @Input() label = 'Address';\n @Input() noEntriesFoundLabel = 'Not found';\n @Input() hint = '';\n @Output() getAddress = new EventEmitter<OSMResult>();\n\n results$!: Observable<OSMResult[]>;\n\n constructor(private osm: OnemRvaOSMService) {}\n\n isLoading = false;\n\n ngOnInit(): void {\n this.results$ = this.address.valueChanges.pipe(\n startWith(''),\n debounceTime(300),\n switchMap((value: string) => {\n if (!value || value.length <= 2) {\n this.isLoading = false;\n return [];\n }\n\n this.isLoading = true;\n return this.osm.searchAddress(value).pipe(\n map(results => {\n this.isLoading = false;\n return results;\n }),\n );\n }),\n );\n }\n\n selectAddress(address: OSMResult) {\n this.address.setValue(address.display_name);\n this.getAddress.emit(address);\n }\n}\n","<mat-form-field appearance=\"outline\">\n <mat-label>{{ label | translate }}</mat-label>\n <mat-icon matSuffix [ngClass]=\"{ spin: isLoading }\">\n {{ isLoading ? 'refresh' : 'search' }}\n </mat-icon>\n\n <input\n type=\"text\"\n matInput\n [formControl]=\"address\"\n [readonly]=\"readonly\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder | translate\"\n />\n\n <mat-hint *ngIf=\"hint\">{{ hint }}</mat-hint>\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"selectAddress($event.option.value)\"\n >\n <mat-option *ngFor=\"let result of results$ | async\" [value]=\"result\">\n <span class=\"country\">\n <flag-icon [countryCode]=\"result.address['country_code']\" />\n {{ result.display_name }}\n </span>\n </mat-option>\n <mat-option *ngIf=\"(results$ | async)?.length === 0\">\n {{ noEntriesFoundLabel | translate }}\n </mat-option>\n </mat-autocomplete>\n</mat-form-field>\n","/*\n * Public API Surface of mat-bank-account-input\n */\n\nexport * from './src/onemrva-mat-input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
|
|
|
73
73
|
this.readonly = false;
|
|
74
74
|
this.label = 'Phone number';
|
|
75
75
|
this.noEntriesFoundLabel = 'Not found';
|
|
76
|
+
this.placeholder = '+32 475 12 34 56';
|
|
76
77
|
this.placeholderLabel = 'Search';
|
|
77
78
|
this.defaultPrefix = '+32';
|
|
78
79
|
this.searchAriaLabel = '';
|
|
@@ -218,7 +219,7 @@ class OnemrvaMatInputPhoneComponent {
|
|
|
218
219
|
}
|
|
219
220
|
phoneNumberValidator(code) {
|
|
220
221
|
return (_control) => {
|
|
221
|
-
let number =
|
|
222
|
+
let number = code + _control.getRawValue();
|
|
222
223
|
if (number === '') {
|
|
223
224
|
return null;
|
|
224
225
|
}
|
|
@@ -237,7 +238,7 @@ class OnemrvaMatInputPhoneComponent {
|
|
|
237
238
|
};
|
|
238
239
|
}
|
|
239
240
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: OnemrvaMatInputPhoneComponent, deps: [{ token: i1.OnemRvaCDNCountryService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
240
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: OnemrvaMatInputPhoneComponent, isStandalone: true, selector: "onemrva-mat-input-phone", inputs: { readonly: "readonly", phoneNumber: "phoneNumber", label: "label", noEntriesFoundLabel: "noEntriesFoundLabel", placeholderLabel: "placeholderLabel", defaultPrefix: "defaultPrefix", searchAriaLabel: "searchAriaLabel", hint: "hint" }, outputs: { getCountry: "getCountry" }, viewQueries: [{ propertyName: "numberInput", first: true, predicate: ["numberInput"], descendants: true }], ngImport: i0, template: "<ng-container>\n <mat-form-field class=\"onemrva-input-phone-number\">\n <mat-label>{{ label }}</mat-label>\n\n <input\n (click)=\"handleClick($event)\"\n type=\"tel\"\n matInput\n phoneNumber\n #numberInput\n placeholder=\"
|
|
241
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: OnemrvaMatInputPhoneComponent, isStandalone: true, selector: "onemrva-mat-input-phone", inputs: { readonly: "readonly", phoneNumber: "phoneNumber", label: "label", noEntriesFoundLabel: "noEntriesFoundLabel", placeholder: "placeholder", placeholderLabel: "placeholderLabel", defaultPrefix: "defaultPrefix", searchAriaLabel: "searchAriaLabel", hint: "hint" }, outputs: { getCountry: "getCountry" }, viewQueries: [{ propertyName: "numberInput", first: true, predicate: ["numberInput"], descendants: true }], ngImport: i0, template: "<ng-container>\n <mat-form-field class=\"onemrva-input-phone-number\">\n <mat-label>{{ label }}</mat-label>\n\n <input\n (click)=\"handleClick($event)\"\n type=\"tel\"\n matInput\n phoneNumber\n #numberInput\n [placeholder]=\"placeholder\"\n [formControl]=\"phoneNumber\"\n class=\"onemrva-text-number\"\n [readOnly]=\"readonly\"\n />\n <mat-select\n matTextPrefix\n class=\"onemrva-phone-number-select\"\n [formControl]=\"countryCode\"\n >\n <mat-select-trigger>\n <flag-icon [countryCode]=\"countryCode.getRawValue()\" />\n </mat-select-trigger>\n <mat-option>\n <mat-select-search\n [formControl]=\"filterCtrl\"\n [ariaLabel]=\"searchAriaLabel\"\n [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\n [placeholderLabel]=\"placeholderLabel\"\n ></mat-select-search>\n </mat-option>\n <mat-option\n *ngFor=\"let country of filteredCountries$ | async\"\n [value]=\"country.code\"\n >\n <flag-icon [countryCode]=\"country.code\" />\n \n {{ country.name }}\n \n <span class=\"dialcode\">\n {{ country.dial_code }}\n </span>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint !== ''\">{{ hint }}</mat-hint>\n <mat-error *ngIf=\"number.invalid\">{{ errors() | translate }}</mat-error>\n </mat-form-field>\n</ng-container>\n", styles: [".onemrva-input-phone-number mat-select .mat-mdc-select-placeholder{width:1em!important;display:block!important}.onemrva-input-phone-number mat-select .mat-mdc-select-placeholder:before{width:1em!important;height:1em!important;background:#eee!important;visibility:visible!important;margin:10px 0!important}.onemrva-input-phone-number mat-select .mat-mdc-select-value{padding-right:8px}.onemrva-input-phone-number .onemrva-text-number{padding-left:12px!important;vertical-align:middle}.onemrva-input-phone-number .mat-mdc-form-field-text-prefix mat-select{line-height:14px!important}.onemrva-input-phone-number span.dialcode{color:#acaab2}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { 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.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4.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", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i4.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatSelectSearchModule }, { kind: "component", type: i5.MatSelectSearchComponent, selector: "mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i6.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: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }, { kind: "directive", type: PhoneNumberDirective, selector: "[phoneNumber]" }, { kind: "component", type: FlagIconComponent, selector: "flag-icon", inputs: ["countryCode", "mode", "width"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
241
242
|
}
|
|
242
243
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: OnemrvaMatInputPhoneComponent, decorators: [{
|
|
243
244
|
type: Component,
|
|
@@ -251,7 +252,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
251
252
|
TranslateModule,
|
|
252
253
|
PhoneNumberDirective,
|
|
253
254
|
FlagIconComponent,
|
|
254
|
-
], encapsulation: ViewEncapsulation.None, template: "<ng-container>\n <mat-form-field class=\"onemrva-input-phone-number\">\n <mat-label>{{ label }}</mat-label>\n\n <input\n (click)=\"handleClick($event)\"\n type=\"tel\"\n matInput\n phoneNumber\n #numberInput\n placeholder=\"
|
|
255
|
+
], encapsulation: ViewEncapsulation.None, template: "<ng-container>\n <mat-form-field class=\"onemrva-input-phone-number\">\n <mat-label>{{ label }}</mat-label>\n\n <input\n (click)=\"handleClick($event)\"\n type=\"tel\"\n matInput\n phoneNumber\n #numberInput\n [placeholder]=\"placeholder\"\n [formControl]=\"phoneNumber\"\n class=\"onemrva-text-number\"\n [readOnly]=\"readonly\"\n />\n <mat-select\n matTextPrefix\n class=\"onemrva-phone-number-select\"\n [formControl]=\"countryCode\"\n >\n <mat-select-trigger>\n <flag-icon [countryCode]=\"countryCode.getRawValue()\" />\n </mat-select-trigger>\n <mat-option>\n <mat-select-search\n [formControl]=\"filterCtrl\"\n [ariaLabel]=\"searchAriaLabel\"\n [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\n [placeholderLabel]=\"placeholderLabel\"\n ></mat-select-search>\n </mat-option>\n <mat-option\n *ngFor=\"let country of filteredCountries$ | async\"\n [value]=\"country.code\"\n >\n <flag-icon [countryCode]=\"country.code\" />\n \n {{ country.name }}\n \n <span class=\"dialcode\">\n {{ country.dial_code }}\n </span>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint !== ''\">{{ hint }}</mat-hint>\n <mat-error *ngIf=\"number.invalid\">{{ errors() | translate }}</mat-error>\n </mat-form-field>\n</ng-container>\n", styles: [".onemrva-input-phone-number mat-select .mat-mdc-select-placeholder{width:1em!important;display:block!important}.onemrva-input-phone-number mat-select .mat-mdc-select-placeholder:before{width:1em!important;height:1em!important;background:#eee!important;visibility:visible!important;margin:10px 0!important}.onemrva-input-phone-number mat-select .mat-mdc-select-value{padding-right:8px}.onemrva-input-phone-number .onemrva-text-number{padding-left:12px!important;vertical-align:middle}.onemrva-input-phone-number .mat-mdc-form-field-text-prefix mat-select{line-height:14px!important}.onemrva-input-phone-number span.dialcode{color:#acaab2}\n"] }]
|
|
255
256
|
}], ctorParameters: () => [{ type: i1.OnemRvaCDNCountryService }], propDecorators: { readonly: [{
|
|
256
257
|
type: Input
|
|
257
258
|
}], phoneNumber: [{
|
|
@@ -260,6 +261,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
260
261
|
type: Input
|
|
261
262
|
}], noEntriesFoundLabel: [{
|
|
262
263
|
type: Input
|
|
264
|
+
}], placeholder: [{
|
|
265
|
+
type: Input
|
|
263
266
|
}], placeholderLabel: [{
|
|
264
267
|
type: Input
|
|
265
268
|
}], defaultPrefix: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onemrvapublic-design-system-mat-input-phone.mjs","sources":["../../../../projects/onemrva/design-system/mat-input-phone/src/phone-number.directive.ts","../../../../projects/onemrva/design-system/mat-input-phone/src/onemrva-mat-input-phone.component.ts","../../../../projects/onemrva/design-system/mat-input-phone/src/onemrva-mat-input-phone.component.html","../../../../projects/onemrva/design-system/mat-input-phone/index.ts","../../../../projects/onemrva/design-system/mat-input-phone/onemrvapublic-design-system-mat-input-phone.ts"],"sourcesContent":["import { Directive, HostListener } from '@angular/core';\n\n@Directive({\n selector: '[phoneNumber]',\n standalone: true,\n})\nexport class PhoneNumberDirective {\n @HostListener('keydown', ['$event']) onKeyDown(event: any) {\n const e = event as KeyboardEvent;\n\n const allowedKey = [\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n ' ',\n 'Backspace',\n 'Delete',\n 'Tab',\n '+',\n '-',\n 'Enter',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\n 'Home',\n 'End',\n ];\n\n if (allowedKey.indexOf(e.key) >= 0) return;\n\n const allowedCtrlShortcuts = ['a', 'c', 'x', 'v'];\n if (e.ctrlKey && allowedCtrlShortcuts.indexOf(e.key) >= 0) return;\n\n e.preventDefault();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n ReactiveFormsModule,\n ValidationErrors,\n ValidatorFn,\n Validators,\n} from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\nimport { TranslateModule } from '@ngx-translate/core';\nimport {\n Observable,\n Subject,\n map,\n startWith,\n debounceTime,\n takeUntil,\n combineLatestWith,\n zip,\n} from 'rxjs';\nimport { MatSelectSearchModule } from '@onemrvapublic/design-system/mat-select-search';\nimport { PhoneNumberDirective } from './phone-number.directive';\nimport parsePhoneNumber from 'libphonenumber-js';\nimport { FlagIconComponent } from '@onemrvapublic/design-system/flag-icon';\nimport {\n OnemRvaCDNCountryService,\n OnemrvaMaterialCountry,\n} from '@onemrvapublic/design-system/shared';\n\n@Component({\n selector: 'onemrva-mat-input-phone',\n styleUrls: ['onemrva-mat-input-phone.component.scss'],\n templateUrl: 'onemrva-mat-input-phone.component.html',\n standalone: true,\n imports: [\n CommonModule,\n MatInputModule,\n MatFormFieldModule,\n MatSelectModule,\n MatSelectSearchModule,\n ReactiveFormsModule,\n TranslateModule,\n PhoneNumberDirective,\n FlagIconComponent,\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OnemrvaMatInputPhoneComponent implements OnInit, OnDestroy {\n @Input()\n readonly = false;\n\n @Input() phoneNumber!: FormControl;\n @Input() label = 'Phone number';\n @Input() noEntriesFoundLabel = 'Not found';\n @Input() placeholderLabel = 'Search';\n @Input() defaultPrefix = '+32';\n @Input() searchAriaLabel = '';\n @Input() hint = '';\n @Output() getCountry = new EventEmitter<any>();\n @ViewChild('numberInput') numberInput!: ElementRef;\n\n countryCode: FormControl = new FormControl('');\n\n public filterCtrl: FormControl<string | null> = new FormControl<string>('');\n\n destroyNotifier$ = new Subject<void>();\n\n public countries$: Observable<OnemrvaMaterialCountry[]> =\n this.cdn.getCountries();\n public filteredCountries$: Observable<OnemrvaMaterialCountry[]>;\n\n constructor(private cdn: OnemRvaCDNCountryService) {\n this.filteredCountries$ = this.filterCtrl.valueChanges.pipe(\n debounceTime(400),\n startWith<string | null>(''), // Explicitly define type\n combineLatestWith(this.countries$), // Ensure correct tuple structure\n map(([search, countries]: [string | null, OnemrvaMaterialCountry[]]) => {\n // Define expected tuple\n return countries.filter((country: OnemrvaMaterialCountry) => {\n if (!search || search.trim() === '') return true; // Return all when search is empty\n return country.name?.toLowerCase().includes(search.toLowerCase());\n });\n }),\n );\n }\n\n get number(): FormControl {\n return this.phoneNumber as FormControl;\n }\n\n ngOnInit(): void {\n this.number.valueChanges\n .pipe(\n startWith(this.number.getRawValue()),\n takeUntil(this.destroyNotifier$),\n )\n .subscribe(number => {\n if (number !== '') {\n if (number.substring(0, 1) !== '+')\n this.countryCode.setValue('', { emitEvent: false });\n if (number === '0') {\n this.cdn\n .findCountryFromPrefix(this.defaultPrefix)\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(country => {\n if (country) {\n //this.getCountry.next(country);\n this.number.setValue(this.defaultPrefix, {\n emitEvent: false,\n });\n this.countryCode.setValue(country.code, { emitEvent: false });\n } else {\n this.countryCode.setValue('');\n }\n this.formatPhoneNumber();\n });\n } else {\n this.cdn\n .findCountryFromPrefix(number)\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(country => {\n if (country) {\n //this.getCountry.next(country);\n this.countryCode.setValue(country.code);\n } else {\n this.countryCode.setValue('');\n }\n this.formatPhoneNumber();\n });\n }\n }\n });\n\n this.countryCode.valueChanges\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(value => {\n let number = this.number.getRawValue();\n zip(\n this.cdn.findCountryFromPrefix(number),\n this.cdn.findCountryFromCode(value),\n ).subscribe(([countryFromVies, countryFromCode]) => {\n // Perform your action here using countryFromVies and countryFromCode\n if (countryFromVies) {\n number = number.replace(countryFromVies.dial_code, '');\n }\n if (countryFromCode) {\n this.getCountry.next(countryFromCode);\n if (number.substring(0, 1) === '+') {\n number = number.replace('+', '');\n }\n number = countryFromCode.dial_code + number;\n this.number.setValue(number, { emitEvent: false });\n this.formatPhoneNumber();\n }\n setTimeout(() => {\n this.numberInput.nativeElement.focus();\n }, 200);\n });\n });\n }\n\n handleClick(e: any) {\n e.stopPropagation();\n }\n\n private clearValidators() {\n let required = false;\n if (this.number.hasValidator(Validators.required)) {\n required = true;\n }\n this.number.clearValidators();\n if (required) {\n this.number.addValidators(Validators.required);\n }\n }\n\n private formatPhoneNumber() {\n this.clearValidators();\n if (this.countryCode.getRawValue() !== '') {\n this.number.addValidators([\n this.phoneNumberValidator(this.countryCode.getRawValue()),\n ]);\n }\n try {\n const parsedPhone = parsePhoneNumber(this.number.getRawValue());\n const code = parsedPhone?.country;\n if (code) {\n this.countryCode.setValue(code, { emitEvent: false });\n this.clearValidators();\n this.number.addValidators([this.phoneNumberValidator(code)]);\n this.number.setValue(parsedPhone?.format('INTERNATIONAL'), {\n emitEvent: false,\n });\n } else {\n this.number.addValidators([genericValidator('input.phone.invalid')]);\n }\n } catch (e: any) {\n this.number.addValidators([genericValidator(e.message)]);\n }\n }\n\n ngOnDestroy() {\n this.destroyNotifier$.next();\n this.destroyNotifier$.complete();\n }\n\n errors() {\n for (const k in this.number.errors) {\n if (k === 'required') {\n return 'input.phone.required';\n } else {\n return 'input.phone.invalid';\n }\n }\n return 'input.phone.unknown.error';\n }\n\n phoneNumberValidator(code: string): ValidatorFn {\n return (_control: AbstractControl): ValidationErrors | null => {\n let number: string = this.countryCode + _control.getRawValue();\n\n if (number === '') {\n return null;\n }\n\n try {\n number = number.replace(code, '');\n const parsedNumber = parsePhoneNumber(number);\n\n if (parsedNumber?.isValid()) {\n return null;\n }\n } catch (e: any) {\n console.warn(e.message);\n return { phoneNumber: { value: 'input.phone.invalid' } };\n }\n return { phoneNumber: { value: 'input.phone.invalid' } };\n };\n }\n}\n\nfunction genericValidator(message: string): ValidatorFn {\n return (_control: AbstractControl): ValidationErrors | null => {\n return { phoneNumber: { value: message } };\n };\n}\n","<ng-container>\n <mat-form-field class=\"onemrva-input-phone-number\">\n <mat-label>{{ label }}</mat-label>\n\n <input\n (click)=\"handleClick($event)\"\n type=\"tel\"\n matInput\n phoneNumber\n #numberInput\n placeholder=\"+32 475 12 34 56\"\n [formControl]=\"phoneNumber\"\n class=\"onemrva-text-number\"\n [readOnly]=\"readonly\"\n />\n <mat-select\n matTextPrefix\n class=\"onemrva-phone-number-select\"\n [formControl]=\"countryCode\"\n >\n <mat-select-trigger>\n <flag-icon [countryCode]=\"countryCode.getRawValue()\" />\n </mat-select-trigger>\n <mat-option>\n <mat-select-search\n [formControl]=\"filterCtrl\"\n [ariaLabel]=\"searchAriaLabel\"\n [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\n [placeholderLabel]=\"placeholderLabel\"\n ></mat-select-search>\n </mat-option>\n <mat-option\n *ngFor=\"let country of filteredCountries$ | async\"\n [value]=\"country.code\"\n >\n <flag-icon [countryCode]=\"country.code\" />\n \n {{ country.name }}\n \n <span class=\"dialcode\">\n {{ country.dial_code }}\n </span>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint !== ''\">{{ hint }}</mat-hint>\n <mat-error *ngIf=\"number.invalid\">{{ errors() | translate }}</mat-error>\n </mat-form-field>\n</ng-container>\n","/*\n * Public API Surface of mat-bank-account-input\n */\n\nexport * from './src/onemrva-mat-input-phone.component';\nexport * from './src/phone-number.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],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s","sources":["../../../../projects/onemrva/design-system/mat-input-phone/src/phone-number.directive.ts","../../../../projects/onemrva/design-system/mat-input-phone/src/onemrva-mat-input-phone.component.ts","../../../../projects/onemrva/design-system/mat-input-phone/src/onemrva-mat-input-phone.component.html","../../../../projects/onemrva/design-system/mat-input-phone/index.ts","../../../../projects/onemrva/design-system/mat-input-phone/onemrvapublic-design-system-mat-input-phone.ts"],"sourcesContent":["import { Directive, HostListener } from '@angular/core';\n\n@Directive({\n selector: '[phoneNumber]',\n standalone: true,\n})\nexport class PhoneNumberDirective {\n @HostListener('keydown', ['$event']) onKeyDown(event: any) {\n const e = event as KeyboardEvent;\n\n const allowedKey = [\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n ' ',\n 'Backspace',\n 'Delete',\n 'Tab',\n '+',\n '-',\n 'Enter',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\n 'Home',\n 'End',\n ];\n\n if (allowedKey.indexOf(e.key) >= 0) return;\n\n const allowedCtrlShortcuts = ['a', 'c', 'x', 'v'];\n if (e.ctrlKey && allowedCtrlShortcuts.indexOf(e.key) >= 0) return;\n\n e.preventDefault();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n ReactiveFormsModule,\n ValidationErrors,\n ValidatorFn,\n Validators,\n} from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\nimport { TranslateModule } from '@ngx-translate/core';\nimport {\n Observable,\n Subject,\n map,\n startWith,\n debounceTime,\n takeUntil,\n combineLatestWith,\n zip,\n} from 'rxjs';\nimport { MatSelectSearchModule } from '@onemrvapublic/design-system/mat-select-search';\nimport { PhoneNumberDirective } from './phone-number.directive';\nimport parsePhoneNumber from 'libphonenumber-js';\nimport { FlagIconComponent } from '@onemrvapublic/design-system/flag-icon';\nimport {\n OnemRvaCDNCountryService,\n OnemrvaMaterialCountry,\n} from '@onemrvapublic/design-system/shared';\n\n@Component({\n selector: 'onemrva-mat-input-phone',\n styleUrls: ['onemrva-mat-input-phone.component.scss'],\n templateUrl: 'onemrva-mat-input-phone.component.html',\n standalone: true,\n imports: [\n CommonModule,\n MatInputModule,\n MatFormFieldModule,\n MatSelectModule,\n MatSelectSearchModule,\n ReactiveFormsModule,\n TranslateModule,\n PhoneNumberDirective,\n FlagIconComponent,\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OnemrvaMatInputPhoneComponent implements OnInit, OnDestroy {\n @Input()\n readonly = false;\n\n @Input() phoneNumber!: FormControl;\n @Input() label = 'Phone number';\n @Input() noEntriesFoundLabel = 'Not found';\n @Input() placeholder = '+32 475 12 34 56';\n @Input() placeholderLabel = 'Search';\n @Input() defaultPrefix = '+32';\n @Input() searchAriaLabel = '';\n @Input() hint = '';\n @Output() getCountry = new EventEmitter<any>();\n @ViewChild('numberInput') numberInput!: ElementRef;\n\n countryCode: FormControl = new FormControl('');\n\n public filterCtrl: FormControl<string | null> = new FormControl<string>('');\n\n destroyNotifier$ = new Subject<void>();\n\n public countries$: Observable<OnemrvaMaterialCountry[]> =\n this.cdn.getCountries();\n public filteredCountries$: Observable<OnemrvaMaterialCountry[]>;\n\n constructor(private cdn: OnemRvaCDNCountryService) {\n this.filteredCountries$ = this.filterCtrl.valueChanges.pipe(\n debounceTime(400),\n startWith<string | null>(''), // Explicitly define type\n combineLatestWith(this.countries$), // Ensure correct tuple structure\n map(([search, countries]: [string | null, OnemrvaMaterialCountry[]]) => {\n // Define expected tuple\n return countries.filter((country: OnemrvaMaterialCountry) => {\n if (!search || search.trim() === '') return true; // Return all when search is empty\n return country.name?.toLowerCase().includes(search.toLowerCase());\n });\n }),\n );\n }\n\n get number(): FormControl {\n return this.phoneNumber as FormControl;\n }\n\n ngOnInit(): void {\n this.number.valueChanges\n .pipe(\n startWith(this.number.getRawValue()),\n takeUntil(this.destroyNotifier$),\n )\n .subscribe(number => {\n if (number !== '') {\n if (number.substring(0, 1) !== '+')\n this.countryCode.setValue('', { emitEvent: false });\n if (number === '0') {\n this.cdn\n .findCountryFromPrefix(this.defaultPrefix)\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(country => {\n if (country) {\n //this.getCountry.next(country);\n this.number.setValue(this.defaultPrefix, {\n emitEvent: false,\n });\n this.countryCode.setValue(country.code, { emitEvent: false });\n } else {\n this.countryCode.setValue('');\n }\n this.formatPhoneNumber();\n });\n } else {\n this.cdn\n .findCountryFromPrefix(number)\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(country => {\n if (country) {\n //this.getCountry.next(country);\n this.countryCode.setValue(country.code);\n } else {\n this.countryCode.setValue('');\n }\n this.formatPhoneNumber();\n });\n }\n }\n });\n\n this.countryCode.valueChanges\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(value => {\n let number = this.number.getRawValue();\n zip(\n this.cdn.findCountryFromPrefix(number),\n this.cdn.findCountryFromCode(value),\n ).subscribe(([countryFromVies, countryFromCode]) => {\n // Perform your action here using countryFromVies and countryFromCode\n if (countryFromVies) {\n number = number.replace(countryFromVies.dial_code, '');\n }\n if (countryFromCode) {\n this.getCountry.next(countryFromCode);\n if (number.substring(0, 1) === '+') {\n number = number.replace('+', '');\n }\n number = countryFromCode.dial_code + number;\n this.number.setValue(number, { emitEvent: false });\n this.formatPhoneNumber();\n }\n setTimeout(() => {\n this.numberInput.nativeElement.focus();\n }, 200);\n });\n });\n }\n\n handleClick(e: any) {\n e.stopPropagation();\n }\n\n private clearValidators() {\n let required = false;\n if (this.number.hasValidator(Validators.required)) {\n required = true;\n }\n this.number.clearValidators();\n if (required) {\n this.number.addValidators(Validators.required);\n }\n }\n\n private formatPhoneNumber() {\n this.clearValidators();\n if (this.countryCode.getRawValue() !== '') {\n this.number.addValidators([\n this.phoneNumberValidator(this.countryCode.getRawValue()),\n ]);\n }\n try {\n const parsedPhone = parsePhoneNumber(this.number.getRawValue());\n const code = parsedPhone?.country;\n if (code) {\n this.countryCode.setValue(code, { emitEvent: false });\n this.clearValidators();\n this.number.addValidators([this.phoneNumberValidator(code)]);\n this.number.setValue(parsedPhone?.format('INTERNATIONAL'), {\n emitEvent: false,\n });\n } else {\n this.number.addValidators([genericValidator('input.phone.invalid')]);\n }\n } catch (e: any) {\n this.number.addValidators([genericValidator(e.message)]);\n }\n }\n\n ngOnDestroy() {\n this.destroyNotifier$.next();\n this.destroyNotifier$.complete();\n }\n\n errors() {\n for (const k in this.number.errors) {\n if (k === 'required') {\n return 'input.phone.required';\n } else {\n return 'input.phone.invalid';\n }\n }\n return 'input.phone.unknown.error';\n }\n\n phoneNumberValidator(code: string): ValidatorFn {\n return (_control: AbstractControl): ValidationErrors | null => {\n let number: string = code + _control.getRawValue();\n\n if (number === '') {\n return null;\n }\n\n try {\n number = number.replace(code, '');\n const parsedNumber = parsePhoneNumber(number);\n\n if (parsedNumber?.isValid()) {\n return null;\n }\n } catch (e: any) {\n console.warn(e.message);\n return { phoneNumber: { value: 'input.phone.invalid' } };\n }\n return { phoneNumber: { value: 'input.phone.invalid' } };\n };\n }\n}\n\nfunction genericValidator(message: string): ValidatorFn {\n return (_control: AbstractControl): ValidationErrors | null => {\n return { phoneNumber: { value: message } };\n };\n}\n","<ng-container>\n <mat-form-field class=\"onemrva-input-phone-number\">\n <mat-label>{{ label }}</mat-label>\n\n <input\n (click)=\"handleClick($event)\"\n type=\"tel\"\n matInput\n phoneNumber\n #numberInput\n [placeholder]=\"placeholder\"\n [formControl]=\"phoneNumber\"\n class=\"onemrva-text-number\"\n [readOnly]=\"readonly\"\n />\n <mat-select\n matTextPrefix\n class=\"onemrva-phone-number-select\"\n [formControl]=\"countryCode\"\n >\n <mat-select-trigger>\n <flag-icon [countryCode]=\"countryCode.getRawValue()\" />\n </mat-select-trigger>\n <mat-option>\n <mat-select-search\n [formControl]=\"filterCtrl\"\n [ariaLabel]=\"searchAriaLabel\"\n [noEntriesFoundLabel]=\"noEntriesFoundLabel\"\n [placeholderLabel]=\"placeholderLabel\"\n ></mat-select-search>\n </mat-option>\n <mat-option\n *ngFor=\"let country of filteredCountries$ | async\"\n [value]=\"country.code\"\n >\n <flag-icon [countryCode]=\"country.code\" />\n \n {{ country.name }}\n \n <span class=\"dialcode\">\n {{ country.dial_code }}\n </span>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint !== ''\">{{ hint }}</mat-hint>\n <mat-error *ngIf=\"number.invalid\">{{ errors() | translate }}</mat-error>\n </mat-form-field>\n</ng-container>\n","/*\n * Public API Surface of mat-bank-account-input\n */\n\nexport * from './src/onemrva-mat-input-phone.component';\nexport * from './src/phone-number.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;MAMa,oBAAoB,CAAA;AACM,IAAA,SAAS,CAAC,KAAU,EAAA;QACvD,MAAM,CAAC,GAAG,KAAsB;AAEhC,QAAA,MAAM,UAAU,GAAG;YACjB,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,WAAW;YACX,QAAQ;YACR,KAAK;YACL,GAAG;YACH,GAAG;YACH,OAAO;YACP,WAAW;YACX,YAAY;YACZ,SAAS;YACT,WAAW;YACX,MAAM;YACN,KAAK;SACN;QAED,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE;QAEpC,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AACjD,QAAA,IAAI,CAAC,CAAC,OAAO,IAAI,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,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,EAAA,CAAA;sBADP;gBAGQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,mBAAmB,EAAA,CAAA;sBAA3B;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,gBAAgB,EAAA,CAAA;sBAAxB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,eAAe,EAAA,CAAA;sBAAvB;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACS,UAAU,EAAA,CAAA;sBAAnB;gBACyB,WAAW,EAAA,CAAA;sBAApC,SAAS;uBAAC,aAAa;;AAsL1B,SAAS,gBAAgB,CAAC,OAAe,EAAA;IACvC,OAAO,CAAC,QAAyB,KAA6B;QAC5D,OAAO,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;AAC5C,KAAC;AACH;;AEpQA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -274,7 +274,6 @@ class MatSelectSearchComponent {
|
|
|
274
274
|
});
|
|
275
275
|
}));
|
|
276
276
|
}))
|
|
277
|
-
.pipe(takeUntil(this._onDestroy))
|
|
278
277
|
.subscribe();
|
|
279
278
|
// add or remove css class depending on whether to show the no entries found message
|
|
280
279
|
// note: this is hacky
|
|
@@ -499,7 +498,7 @@ class MatSelectSearchComponent {
|
|
|
499
498
|
useExisting: forwardRef(() => MatSelectSearchComponent),
|
|
500
499
|
multi: true,
|
|
501
500
|
},
|
|
502
|
-
], queries: [{ propertyName: "clearIcon", first: true, predicate: MatSelectSearchClearDirective, descendants: true }, { propertyName: "noEntriesFound", first: true, predicate: MatSelectNoEntriesFoundDirective, descendants: true }], viewQueries: [{ propertyName: "searchSelectInput", first: true, predicate: ["searchSelectInput"], descendants: true, read: ElementRef, static: true }, { propertyName: "innerSelectSearch", first: true, predicate: ["innerSelectSearch"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<!--\nCopyright (c) 2018 Bithost GmbH All Rights Reserved.\n\nUse of this source code is governed by an MIT-style license that can be\nfound in the LICENSE file at https://angular.io/license\n-->\n<!-- Placeholder to adjust vertical offset of the mat-option elements -->\n<input matInput class=\"mat-select-search-input mat-select-search-hidden\" />\n\n<!-- Note: the mat-datepicker-content mat-tab-header are needed to inherit the material theme colors, see PR #22 -->\n<div\n #innerSelectSearch\n class=\"mat-select-search-inner mat-typography mat-datepicker-content mat-tab-header\"\n [ngClass]=\"{\n 'mat-select-search-inner-multiple': matSelect.multiple,\n 'mat-select-search-inner-toggle-all': _isToggleAllCheckboxVisible(),\n }\"\n>\n <mat-checkbox\n *ngIf=\"_isToggleAllCheckboxVisible()\"\n [color]=\"matFormField.color\"\n class=\"mat-select-search-toggle-all-checkbox\"\n [checked]=\"toggleAllCheckboxChecked\"\n [indeterminate]=\"toggleAllCheckboxIndeterminate\"\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\"\n matTooltipClass=\"ngx-mat-select-search-toggle-all-tooltip\"\n [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\n (change)=\"_emitSelectAllBooleanToParent($event.checked)\"\n ></mat-checkbox>\n\n <input\n class=\"mat-select-search-input\"\n autocomplete=\"off\"\n [type]=\"type\"\n [formControl]=\"_formControl\"\n #searchSelectInput\n (keydown)=\"_handleKeydown($event)\"\n (keyup)=\"_handleKeyup($event)\"\n (blur)=\"onBlur()\"\n [placeholder]=\"placeholderLabel\"\n [attr.aria-label]=\"ariaLabel\"\n />\n <mat-icon *ngIf=\"value === '' && !searching\" class=\"suffix\">search</mat-icon>\n <mat-spinner\n *ngIf=\"searching\"\n class=\"mat-select-search-spinner\"\n diameter=\"16\"\n ></mat-spinner>\n\n <button\n *ngIf=\"!hideClearSearchButton && value && !searching\"\n mat-icon-button\n aria-label=\"Clear\"\n (click)=\"_reset(true)\"\n class=\"mat-select-search-clear\"\n >\n <ng-content\n *ngIf=\"clearIcon; else defaultIcon\"\n select=\"[matSelectSearchClear]\"\n ></ng-content>\n <ng-template #defaultIcon>\n <mat-icon [svgIcon]=\"closeSvgIcon\">\n {{ !closeSvgIcon ? closeIcon : null }}\n </mat-icon>\n </ng-template>\n </button>\n\n <ng-content select=\".mat-select-search-custom-header-content\"></ng-content>\n\n <mat-divider></mat-divider>\n</div>\n\n<div\n *ngIf=\"_showNoEntriesFound$ | async\"\n class=\"mat-select-search-no-entries-found\"\n>\n <ng-content\n *ngIf=\"noEntriesFound; else defaultNoEntriesFound\"\n select=\"[matSelectNoEntriesFound]\"\n ></ng-content>\n <ng-template #defaultNoEntriesFound>{{ noEntriesFoundLabel }}</ng-template>\n</div>\n", styles: [".mat-select-search-hidden{visibility:hidden}.mat-select-search-inner{position:absolute;top:0;left:0;width:100%;z-index:100;font-size:inherit;box-shadow:none}.mat-select-search-inner.mat-select-search-inner-multiple.mat-select-search-inner-toggle-all{display:flex;align-items:center}.suffix{position:absolute;top:12px;right:14px}.mat-select-search-input{box-sizing:border-box;width:100%;border:none;font-family:inherit;font-size:inherit;color:currentColor;outline:none;background:#fff;padding:0 44px 0 16px;height:calc(3em - 1px);line-height:calc(3em - 1px)}:host-context([dir=rtl]) .mat-select-search-input{padding-right:16px;padding-left:44px}.mat-select-search-inner-toggle-all .mat-select-search-input{padding-left:5px}.mat-select-search-no-entries-found{padding-top:8px}.mat-select-search-clear{position:absolute;right:4px;top:0}:host-context([dir=rtl]) .mat-select-search-clear{right:auto;left:4px}.mat-select-search-spinner{position:absolute;right:16px;top:calc(50% - 8px)}:host-context([dir=rtl]) .mat-select-search-spinner{right:auto;left:16px}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search{position:sticky;top:0;z-index:1;opacity:1;margin-top:-8px;pointer-events:all}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search .mat-icon{margin-right:0;margin-left:0}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search mat-pseudo-checkbox{display:none}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search .mdc-list-item__primary-text{opacity:1}.mat-select-search-toggle-all-checkbox{padding-left:5px}:host-context([dir=rtl]) .mat-select-search-toggle-all-checkbox{padding-left:0;padding-right:5px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
501
|
+
], queries: [{ propertyName: "clearIcon", first: true, predicate: MatSelectSearchClearDirective, descendants: true }, { propertyName: "noEntriesFound", first: true, predicate: MatSelectNoEntriesFoundDirective, descendants: true }], viewQueries: [{ propertyName: "searchSelectInput", first: true, predicate: ["searchSelectInput"], descendants: true, read: ElementRef, static: true }, { propertyName: "innerSelectSearch", first: true, predicate: ["innerSelectSearch"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<!--\nCopyright (c) 2018 Bithost GmbH All Rights Reserved.\n\nUse of this source code is governed by an MIT-style license that can be\nfound in the LICENSE file at https://angular.io/license\n-->\n<!-- Placeholder to adjust vertical offset of the mat-option elements -->\n<input matInput class=\"mat-select-search-input mat-select-search-hidden\" />\n\n<!-- Note: the mat-datepicker-content mat-tab-header are needed to inherit the material theme colors, see PR #22 -->\n<div\n #innerSelectSearch\n class=\"mat-select-search-inner mat-typography mat-datepicker-content mat-tab-header\"\n [ngClass]=\"{\n 'mat-select-search-inner-multiple': matSelect.multiple,\n 'mat-select-search-inner-toggle-all': _isToggleAllCheckboxVisible(),\n }\"\n>\n <mat-checkbox\n *ngIf=\"_isToggleAllCheckboxVisible()\"\n [color]=\"matFormField.color\"\n class=\"mat-select-search-toggle-all-checkbox\"\n [checked]=\"toggleAllCheckboxChecked\"\n [indeterminate]=\"toggleAllCheckboxIndeterminate\"\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\"\n matTooltipClass=\"ngx-mat-select-search-toggle-all-tooltip\"\n [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\n (change)=\"_emitSelectAllBooleanToParent($event.checked)\"\n ></mat-checkbox>\n\n <input\n class=\"mat-select-search-input\"\n autocomplete=\"off\"\n [type]=\"type\"\n [formControl]=\"_formControl\"\n #searchSelectInput\n (keydown)=\"_handleKeydown($event)\"\n (keyup)=\"_handleKeyup($event)\"\n (blur)=\"onBlur()\"\n [placeholder]=\"placeholderLabel\"\n [attr.aria-label]=\"ariaLabel\"\n />\n <mat-icon *ngIf=\"value === '' && !searching\" class=\"suffix\">search</mat-icon>\n <mat-spinner\n *ngIf=\"searching\"\n class=\"mat-select-search-spinner\"\n diameter=\"16\"\n ></mat-spinner>\n\n <button\n *ngIf=\"!hideClearSearchButton && value && !searching\"\n mat-icon-button\n aria-label=\"Clear\"\n (click)=\"_reset(true)\"\n class=\"mat-select-search-clear\"\n >\n <ng-content\n *ngIf=\"clearIcon; else defaultIcon\"\n select=\"[matSelectSearchClear]\"\n ></ng-content>\n <ng-template #defaultIcon>\n <mat-icon [svgIcon]=\"closeSvgIcon\">\n {{ !closeSvgIcon ? closeIcon : null }}\n </mat-icon>\n </ng-template>\n </button>\n\n <ng-content select=\".mat-select-search-custom-header-content\"></ng-content>\n\n <mat-divider></mat-divider>\n</div>\n\n<div\n *ngIf=\"_showNoEntriesFound$ | async\"\n class=\"mat-select-search-no-entries-found\"\n>\n <ng-content\n *ngIf=\"noEntriesFound; else defaultNoEntriesFound\"\n select=\"[matSelectNoEntriesFound]\"\n ></ng-content>\n <ng-template #defaultNoEntriesFound>{{ noEntriesFoundLabel }}</ng-template>\n</div>\n", styles: [".mat-select-search-hidden{visibility:hidden}.mat-select-search-inner{position:absolute;top:0;left:0;width:100%;z-index:100;font-size:inherit;box-shadow:none}.mat-select-search-inner.mat-select-search-inner-multiple.mat-select-search-inner-toggle-all{display:flex;align-items:center}.suffix{position:absolute;top:12px;right:14px}.mat-select-search-input{box-sizing:border-box;width:100%;border:none;font-family:inherit;font-size:inherit;color:currentColor;outline:none;background:#fff;padding:0 44px 0 16px;height:calc(3em - 1px);line-height:calc(3em - 1px)}:host-context([dir=rtl]) .mat-select-search-input{padding-right:16px;padding-left:44px}.mat-select-search-inner-toggle-all .mat-select-search-input{padding-left:5px}.mat-select-search-no-entries-found{padding-top:8px;padding-bottom:8px}.mat-select-search-clear{position:absolute;right:4px;top:0}:host-context([dir=rtl]) .mat-select-search-clear{right:auto;left:4px}.mat-select-search-spinner{position:absolute;right:16px;top:calc(50% - 8px)}:host-context([dir=rtl]) .mat-select-search-spinner{right:auto;left:16px}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search{position:sticky;top:0;z-index:1;opacity:1;margin-top:-8px;pointer-events:all}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search .mat-icon{margin-right:0;margin-left:0}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search mat-pseudo-checkbox{display:none}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search .mdc-list-item__primary-text{opacity:1}.mat-select-search-toggle-all-checkbox{padding-left:5px}:host-context([dir=rtl]) .mat-select-search-toggle-all-checkbox{padding-left:0;padding-right:5px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
503
502
|
}
|
|
504
503
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: MatSelectSearchComponent, decorators: [{
|
|
505
504
|
type: Component,
|
|
@@ -521,7 +520,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
521
520
|
MatInput,
|
|
522
521
|
MatDivider,
|
|
523
522
|
AsyncPipe,
|
|
524
|
-
], template: "<!--\nCopyright (c) 2018 Bithost GmbH All Rights Reserved.\n\nUse of this source code is governed by an MIT-style license that can be\nfound in the LICENSE file at https://angular.io/license\n-->\n<!-- Placeholder to adjust vertical offset of the mat-option elements -->\n<input matInput class=\"mat-select-search-input mat-select-search-hidden\" />\n\n<!-- Note: the mat-datepicker-content mat-tab-header are needed to inherit the material theme colors, see PR #22 -->\n<div\n #innerSelectSearch\n class=\"mat-select-search-inner mat-typography mat-datepicker-content mat-tab-header\"\n [ngClass]=\"{\n 'mat-select-search-inner-multiple': matSelect.multiple,\n 'mat-select-search-inner-toggle-all': _isToggleAllCheckboxVisible(),\n }\"\n>\n <mat-checkbox\n *ngIf=\"_isToggleAllCheckboxVisible()\"\n [color]=\"matFormField.color\"\n class=\"mat-select-search-toggle-all-checkbox\"\n [checked]=\"toggleAllCheckboxChecked\"\n [indeterminate]=\"toggleAllCheckboxIndeterminate\"\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\"\n matTooltipClass=\"ngx-mat-select-search-toggle-all-tooltip\"\n [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\n (change)=\"_emitSelectAllBooleanToParent($event.checked)\"\n ></mat-checkbox>\n\n <input\n class=\"mat-select-search-input\"\n autocomplete=\"off\"\n [type]=\"type\"\n [formControl]=\"_formControl\"\n #searchSelectInput\n (keydown)=\"_handleKeydown($event)\"\n (keyup)=\"_handleKeyup($event)\"\n (blur)=\"onBlur()\"\n [placeholder]=\"placeholderLabel\"\n [attr.aria-label]=\"ariaLabel\"\n />\n <mat-icon *ngIf=\"value === '' && !searching\" class=\"suffix\">search</mat-icon>\n <mat-spinner\n *ngIf=\"searching\"\n class=\"mat-select-search-spinner\"\n diameter=\"16\"\n ></mat-spinner>\n\n <button\n *ngIf=\"!hideClearSearchButton && value && !searching\"\n mat-icon-button\n aria-label=\"Clear\"\n (click)=\"_reset(true)\"\n class=\"mat-select-search-clear\"\n >\n <ng-content\n *ngIf=\"clearIcon; else defaultIcon\"\n select=\"[matSelectSearchClear]\"\n ></ng-content>\n <ng-template #defaultIcon>\n <mat-icon [svgIcon]=\"closeSvgIcon\">\n {{ !closeSvgIcon ? closeIcon : null }}\n </mat-icon>\n </ng-template>\n </button>\n\n <ng-content select=\".mat-select-search-custom-header-content\"></ng-content>\n\n <mat-divider></mat-divider>\n</div>\n\n<div\n *ngIf=\"_showNoEntriesFound$ | async\"\n class=\"mat-select-search-no-entries-found\"\n>\n <ng-content\n *ngIf=\"noEntriesFound; else defaultNoEntriesFound\"\n select=\"[matSelectNoEntriesFound]\"\n ></ng-content>\n <ng-template #defaultNoEntriesFound>{{ noEntriesFoundLabel }}</ng-template>\n</div>\n", styles: [".mat-select-search-hidden{visibility:hidden}.mat-select-search-inner{position:absolute;top:0;left:0;width:100%;z-index:100;font-size:inherit;box-shadow:none}.mat-select-search-inner.mat-select-search-inner-multiple.mat-select-search-inner-toggle-all{display:flex;align-items:center}.suffix{position:absolute;top:12px;right:14px}.mat-select-search-input{box-sizing:border-box;width:100%;border:none;font-family:inherit;font-size:inherit;color:currentColor;outline:none;background:#fff;padding:0 44px 0 16px;height:calc(3em - 1px);line-height:calc(3em - 1px)}:host-context([dir=rtl]) .mat-select-search-input{padding-right:16px;padding-left:44px}.mat-select-search-inner-toggle-all .mat-select-search-input{padding-left:5px}.mat-select-search-no-entries-found{padding-top:8px}.mat-select-search-clear{position:absolute;right:4px;top:0}:host-context([dir=rtl]) .mat-select-search-clear{right:auto;left:4px}.mat-select-search-spinner{position:absolute;right:16px;top:calc(50% - 8px)}:host-context([dir=rtl]) .mat-select-search-spinner{right:auto;left:16px}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search{position:sticky;top:0;z-index:1;opacity:1;margin-top:-8px;pointer-events:all}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search .mat-icon{margin-right:0;margin-left:0}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search mat-pseudo-checkbox{display:none}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search .mdc-list-item__primary-text{opacity:1}.mat-select-search-toggle-all-checkbox{padding-left:5px}:host-context([dir=rtl]) .mat-select-search-toggle-all-checkbox{padding-left:0;padding-right:5px}\n"] }]
|
|
523
|
+
], template: "<!--\nCopyright (c) 2018 Bithost GmbH All Rights Reserved.\n\nUse of this source code is governed by an MIT-style license that can be\nfound in the LICENSE file at https://angular.io/license\n-->\n<!-- Placeholder to adjust vertical offset of the mat-option elements -->\n<input matInput class=\"mat-select-search-input mat-select-search-hidden\" />\n\n<!-- Note: the mat-datepicker-content mat-tab-header are needed to inherit the material theme colors, see PR #22 -->\n<div\n #innerSelectSearch\n class=\"mat-select-search-inner mat-typography mat-datepicker-content mat-tab-header\"\n [ngClass]=\"{\n 'mat-select-search-inner-multiple': matSelect.multiple,\n 'mat-select-search-inner-toggle-all': _isToggleAllCheckboxVisible(),\n }\"\n>\n <mat-checkbox\n *ngIf=\"_isToggleAllCheckboxVisible()\"\n [color]=\"matFormField.color\"\n class=\"mat-select-search-toggle-all-checkbox\"\n [checked]=\"toggleAllCheckboxChecked\"\n [indeterminate]=\"toggleAllCheckboxIndeterminate\"\n [matTooltip]=\"toggleAllCheckboxTooltipMessage\"\n matTooltipClass=\"ngx-mat-select-search-toggle-all-tooltip\"\n [matTooltipPosition]=\"toggleAllCheckboxTooltipPosition\"\n (change)=\"_emitSelectAllBooleanToParent($event.checked)\"\n ></mat-checkbox>\n\n <input\n class=\"mat-select-search-input\"\n autocomplete=\"off\"\n [type]=\"type\"\n [formControl]=\"_formControl\"\n #searchSelectInput\n (keydown)=\"_handleKeydown($event)\"\n (keyup)=\"_handleKeyup($event)\"\n (blur)=\"onBlur()\"\n [placeholder]=\"placeholderLabel\"\n [attr.aria-label]=\"ariaLabel\"\n />\n <mat-icon *ngIf=\"value === '' && !searching\" class=\"suffix\">search</mat-icon>\n <mat-spinner\n *ngIf=\"searching\"\n class=\"mat-select-search-spinner\"\n diameter=\"16\"\n ></mat-spinner>\n\n <button\n *ngIf=\"!hideClearSearchButton && value && !searching\"\n mat-icon-button\n aria-label=\"Clear\"\n (click)=\"_reset(true)\"\n class=\"mat-select-search-clear\"\n >\n <ng-content\n *ngIf=\"clearIcon; else defaultIcon\"\n select=\"[matSelectSearchClear]\"\n ></ng-content>\n <ng-template #defaultIcon>\n <mat-icon [svgIcon]=\"closeSvgIcon\">\n {{ !closeSvgIcon ? closeIcon : null }}\n </mat-icon>\n </ng-template>\n </button>\n\n <ng-content select=\".mat-select-search-custom-header-content\"></ng-content>\n\n <mat-divider></mat-divider>\n</div>\n\n<div\n *ngIf=\"_showNoEntriesFound$ | async\"\n class=\"mat-select-search-no-entries-found\"\n>\n <ng-content\n *ngIf=\"noEntriesFound; else defaultNoEntriesFound\"\n select=\"[matSelectNoEntriesFound]\"\n ></ng-content>\n <ng-template #defaultNoEntriesFound>{{ noEntriesFoundLabel }}</ng-template>\n</div>\n", styles: [".mat-select-search-hidden{visibility:hidden}.mat-select-search-inner{position:absolute;top:0;left:0;width:100%;z-index:100;font-size:inherit;box-shadow:none}.mat-select-search-inner.mat-select-search-inner-multiple.mat-select-search-inner-toggle-all{display:flex;align-items:center}.suffix{position:absolute;top:12px;right:14px}.mat-select-search-input{box-sizing:border-box;width:100%;border:none;font-family:inherit;font-size:inherit;color:currentColor;outline:none;background:#fff;padding:0 44px 0 16px;height:calc(3em - 1px);line-height:calc(3em - 1px)}:host-context([dir=rtl]) .mat-select-search-input{padding-right:16px;padding-left:44px}.mat-select-search-inner-toggle-all .mat-select-search-input{padding-left:5px}.mat-select-search-no-entries-found{padding-top:8px;padding-bottom:8px}.mat-select-search-clear{position:absolute;right:4px;top:0}:host-context([dir=rtl]) .mat-select-search-clear{right:auto;left:4px}.mat-select-search-spinner{position:absolute;right:16px;top:calc(50% - 8px)}:host-context([dir=rtl]) .mat-select-search-spinner{right:auto;left:16px}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search{position:sticky;top:0;z-index:1;opacity:1;margin-top:-8px;pointer-events:all}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search .mat-icon{margin-right:0;margin-left:0}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search mat-pseudo-checkbox{display:none}::ng-deep .mat-mdc-option[aria-disabled=true].contains-mat-select-search .mdc-list-item__primary-text{opacity:1}.mat-select-search-toggle-all-checkbox{padding-left:5px}:host-context([dir=rtl]) .mat-select-search-toggle-all-checkbox{padding-left:0;padding-right:5px}\n"] }]
|
|
525
524
|
}], ctorParameters: () => [{ type: i3.MatSelect, decorators: [{
|
|
526
525
|
type: Inject,
|
|
527
526
|
args: [MatSelect]
|