@onemrvapublic/design-system 20.0.0-develop.2 → 20.0.0-develop.4
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/fesm2022/onemrvapublic-design-system-mat-address.mjs +84 -0
- package/fesm2022/onemrvapublic-design-system-mat-address.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-address.mjs +33 -6
- package/fesm2022/onemrvapublic-design-system-mat-input-address.mjs.map +1 -1
- package/fesm2022/onemrvapublic-design-system-mat-input-country.mjs +4 -3
- package/fesm2022/onemrvapublic-design-system-mat-input-country.mjs.map +1 -1
- package/fesm2022/onemrvapublic-design-system-mat-multi-select.mjs +2 -2
- package/fesm2022/onemrvapublic-design-system-mat-multi-select.mjs.map +1 -1
- package/fesm2022/onemrvapublic-design-system-shared.mjs.map +1 -1
- package/fesm2022/onemrvapublic-design-system.mjs +104 -11
- package/fesm2022/onemrvapublic-design-system.mjs.map +1 -1
- package/index.d.ts +29 -4
- package/mat-address/index.d.ts +29 -0
- package/mat-address/src/onemrva-address.scss +50 -0
- package/mat-input-address/index.d.ts +2 -1
- package/mat-input-country/src/onemrva-mat-input-country.component.scss +11 -5
- package/package.json +5 -5
- package/shared/index.d.ts +1 -0
- package/address/index.d.ts +0 -8
- package/address/src/address.scss +0 -0
- package/fesm2022/onemrvapublic-design-system-address.mjs +0 -22
- package/fesm2022/onemrvapublic-design-system-address.mjs.map +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Output, Input, Component } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import * as i1 from '@angular/material/form-field';
|
|
5
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
6
|
+
import * as i2 from '@angular/forms';
|
|
7
|
+
import { FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import { OnemrvaMatInputAddressComponent } from '@onemrvapublic/design-system/mat-input-address';
|
|
9
|
+
import { OnemrvaMatInputCountryComponent } from '@onemrvapublic/design-system/mat-input-country';
|
|
10
|
+
import * as i3 from '@angular/material/input';
|
|
11
|
+
import { MatInputModule } from '@angular/material/input';
|
|
12
|
+
import * as i4 from '@ngx-translate/core';
|
|
13
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
14
|
+
import { merge } from 'rxjs';
|
|
15
|
+
|
|
16
|
+
class OnemRvaAddress {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.INSMode = false;
|
|
19
|
+
this.update = new EventEmitter();
|
|
20
|
+
this.countryForm = new FormControl('be', [Validators.required]);
|
|
21
|
+
this.addressControl = new FormControl('');
|
|
22
|
+
this.postalCodeControl = new FormControl('');
|
|
23
|
+
this.cityControl = new FormControl('');
|
|
24
|
+
this.boiteControl = new FormControl('');
|
|
25
|
+
this.numeroControl = new FormControl('');
|
|
26
|
+
this.NISControl = new FormControl('');
|
|
27
|
+
}
|
|
28
|
+
ngOnInit() {
|
|
29
|
+
merge(this.countryForm.valueChanges, this.addressControl.valueChanges, this.postalCodeControl.valueChanges, this.cityControl.valueChanges, this.boiteControl.valueChanges, this.numeroControl.valueChanges, this.NISControl.valueChanges).subscribe(() => {
|
|
30
|
+
const change = {
|
|
31
|
+
country: this.countryForm.value || undefined,
|
|
32
|
+
street: this.addressControl.value || undefined,
|
|
33
|
+
postal_code: this.postalCodeControl.value || undefined,
|
|
34
|
+
city: this.cityControl.value || undefined,
|
|
35
|
+
street_number: this.numeroControl.value || undefined,
|
|
36
|
+
nis: this.NISControl.value || undefined,
|
|
37
|
+
};
|
|
38
|
+
this.update.emit(change);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
onAddressSelected(result) {
|
|
42
|
+
const city = result.address.city || result.address.village || result.address.town;
|
|
43
|
+
if (city) {
|
|
44
|
+
this.cityControl.setValue(city);
|
|
45
|
+
}
|
|
46
|
+
const houseNumber = result.address.house_number;
|
|
47
|
+
if (houseNumber) {
|
|
48
|
+
this.numeroControl.setValue(houseNumber);
|
|
49
|
+
}
|
|
50
|
+
const postalCode = result.address.postcode;
|
|
51
|
+
if (postalCode) {
|
|
52
|
+
this.postalCodeControl.setValue(postalCode);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: OnemRvaAddress, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
56
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: OnemRvaAddress, isStandalone: true, selector: "onemrva-address", inputs: { INSMode: "INSMode" }, outputs: { update: "update" }, ngImport: i0, template: "<onemrva-mat-input-country\n [country]=\"countryForm\"\n label=\"{{ 'input.country.label' | translate }}\"\n noEntriesFoundLabel=\"{{ 'input.country.not.found' | translate }}\"\n placeholderLabel=\"{{ 'input.country.search' | translate }}\"\n searchAriaLabel=\"{{ 'input.country.search' | translate }}\"\n></onemrva-mat-input-country>\n\n<div class=\"line-2\">\n <onemrva-mat-input-address\n mode=\"road-only\"\n [countryCodes]=\"[countryForm.value || '']\"\n [address]=\"addressControl\"\n (getAddress)=\"onAddressSelected($event)\"\n >\n </onemrva-mat-input-address>\n\n <mat-form-field>\n <mat-label>{{ 'input.address.number.label' | translate }}</mat-label>\n <input\n matInput\n [formControl]=\"numeroControl\"\n [placeholder]=\"'input.address.number.placeholder' | translate\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{'input.address.box.label' | translate}}</mat-label>\n <input\n matInput\n [formControl]=\"boiteControl\"\n [placeholder]=\"'input.address.box.placeholder' | translate\"\n />\n </mat-form-field>\n</div>\n\n<div class=\"line-3\">\n <mat-form-field>\n <mat-label>{{ 'input.address.postal-code.label' | translate}}</mat-label>\n <input\n matInput\n [formControl]=\"postalCodeControl\"\n [placeholder]=\"'input.address.postal-code.label' | translate\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'input.address.city.label' | translate }}</mat-label>\n <input\n matInput\n [formControl]=\"cityControl\"\n [placeholder]=\"'input.address.city.placeholder' | translate\"\n />\n </mat-form-field>\n</div>\n\n@if(INSMode) {\n<div class=\"line-4\">\n <mat-form-field>\n <mat-label>{{ 'input.address.nis.label' }}</mat-label>\n <input\n matInput\n [formControl]=\"NISControl\"\n [placeholder]=\"'input.address.nis.placeholder' | translate\"\n />\n </mat-form-field>\n</div>\n}\n", styles: [":host{display:flex;flex-direction:column;width:400px}:host onemrva-mat-input-country{display:flex;width:100%}:host .line-2{display:flex}:host .line-2 onemrva-mat-input-address{width:248px;max-width:248px;margin-right:var(--spacer)}:host .line-2 mat-form-field:first-of-type{margin-right:var(--spacer)}:host .line-3{width:100%;display:flex}:host .line-3 mat-form-field:first-child{display:flex;width:30%;margin-right:var(--spacer)}:host .line-3 mat-form-field:last-child{display:flex;width:auto;flex-grow:1}:host .line-4{width:100%;display:flex}:host .line-4 mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { 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: OnemrvaMatInputCountryComponent, selector: "onemrva-mat-input-country", inputs: ["readonly", "country", "label", "noEntriesFoundLabel", "hint", "placeholderLabel", "searchAriaLabel"], outputs: ["getCountry"] }, { 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: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "component", type: OnemrvaMatInputAddressComponent, selector: "onemrva-mat-input-address", inputs: ["placeholder", "readonly", "address", "mode", "label", "noEntriesFoundLabel", "hint", "countryCodes"], outputs: ["getAddress"] }] }); }
|
|
57
|
+
}
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: OnemRvaAddress, decorators: [{
|
|
59
|
+
type: Component,
|
|
60
|
+
args: [{ selector: 'onemrva-address', imports: [
|
|
61
|
+
CommonModule,
|
|
62
|
+
MatFormFieldModule,
|
|
63
|
+
ReactiveFormsModule,
|
|
64
|
+
OnemrvaMatInputCountryComponent,
|
|
65
|
+
MatInputModule,
|
|
66
|
+
TranslateModule,
|
|
67
|
+
OnemrvaMatInputAddressComponent,
|
|
68
|
+
], standalone: true, template: "<onemrva-mat-input-country\n [country]=\"countryForm\"\n label=\"{{ 'input.country.label' | translate }}\"\n noEntriesFoundLabel=\"{{ 'input.country.not.found' | translate }}\"\n placeholderLabel=\"{{ 'input.country.search' | translate }}\"\n searchAriaLabel=\"{{ 'input.country.search' | translate }}\"\n></onemrva-mat-input-country>\n\n<div class=\"line-2\">\n <onemrva-mat-input-address\n mode=\"road-only\"\n [countryCodes]=\"[countryForm.value || '']\"\n [address]=\"addressControl\"\n (getAddress)=\"onAddressSelected($event)\"\n >\n </onemrva-mat-input-address>\n\n <mat-form-field>\n <mat-label>{{ 'input.address.number.label' | translate }}</mat-label>\n <input\n matInput\n [formControl]=\"numeroControl\"\n [placeholder]=\"'input.address.number.placeholder' | translate\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{'input.address.box.label' | translate}}</mat-label>\n <input\n matInput\n [formControl]=\"boiteControl\"\n [placeholder]=\"'input.address.box.placeholder' | translate\"\n />\n </mat-form-field>\n</div>\n\n<div class=\"line-3\">\n <mat-form-field>\n <mat-label>{{ 'input.address.postal-code.label' | translate}}</mat-label>\n <input\n matInput\n [formControl]=\"postalCodeControl\"\n [placeholder]=\"'input.address.postal-code.label' | translate\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'input.address.city.label' | translate }}</mat-label>\n <input\n matInput\n [formControl]=\"cityControl\"\n [placeholder]=\"'input.address.city.placeholder' | translate\"\n />\n </mat-form-field>\n</div>\n\n@if(INSMode) {\n<div class=\"line-4\">\n <mat-form-field>\n <mat-label>{{ 'input.address.nis.label' }}</mat-label>\n <input\n matInput\n [formControl]=\"NISControl\"\n [placeholder]=\"'input.address.nis.placeholder' | translate\"\n />\n </mat-form-field>\n</div>\n}\n", styles: [":host{display:flex;flex-direction:column;width:400px}:host onemrva-mat-input-country{display:flex;width:100%}:host .line-2{display:flex}:host .line-2 onemrva-mat-input-address{width:248px;max-width:248px;margin-right:var(--spacer)}:host .line-2 mat-form-field:first-of-type{margin-right:var(--spacer)}:host .line-3{width:100%;display:flex}:host .line-3 mat-form-field:first-child{display:flex;width:30%;margin-right:var(--spacer)}:host .line-3 mat-form-field:last-child{display:flex;width:auto;flex-grow:1}:host .line-4{width:100%;display:flex}:host .line-4 mat-form-field{width:100%}\n"] }]
|
|
69
|
+
}], propDecorators: { INSMode: [{
|
|
70
|
+
type: Input
|
|
71
|
+
}], update: [{
|
|
72
|
+
type: Output
|
|
73
|
+
}] } });
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
* Public API Surface of mat-bank-account-input
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Generated bundle index. Do not edit.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
export { OnemRvaAddress };
|
|
84
|
+
//# sourceMappingURL=onemrvapublic-design-system-mat-address.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onemrvapublic-design-system-mat-address.mjs","sources":["../../../../projects/onemrva/design-system/mat-address/src/onemrva-address.ts","../../../../projects/onemrva/design-system/mat-address/src/onemrva-address.html","../../../../projects/onemrva/design-system/mat-address/index.ts","../../../../projects/onemrva/design-system/mat-address/onemrvapublic-design-system-mat-address.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { OnemrvaMatInputAddressComponent } from '@onemrvapublic/design-system/mat-input-address';\nimport { OnemrvaMatInputCountryComponent } from '@onemrvapublic/design-system/mat-input-country';\nimport { OSMResult } from '@onemrvapublic/design-system/shared';\nimport { MatInputModule } from '@angular/material/input';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { merge } from 'rxjs';\n\n@Component({\n selector: 'onemrva-address',\n imports: [\n CommonModule,\n MatFormFieldModule,\n ReactiveFormsModule,\n OnemrvaMatInputCountryComponent,\n MatInputModule,\n TranslateModule,\n OnemrvaMatInputAddressComponent,\n ],\n templateUrl: './onemrva-address.html',\n standalone: true,\n styleUrl: './onemrva-address.scss',\n})\nexport class OnemRvaAddress implements OnInit {\n @Input()\n INSMode?: boolean = false;\n\n @Output()\n update = new EventEmitter<{\n country?: string;\n street?: string;\n postal_code?: string;\n city?: string;\n street_number?: string;\n nis?: string;\n }>();\n\n countryForm = new FormControl('be', [Validators.required]);\n\n addressControl = new FormControl('');\n\n postalCodeControl = new FormControl('');\n cityControl = new FormControl('');\n boiteControl = new FormControl('');\n numeroControl = new FormControl('');\n NISControl = new FormControl('');\n\n ngOnInit() {\n merge(\n this.countryForm.valueChanges,\n this.addressControl.valueChanges,\n this.postalCodeControl.valueChanges,\n this.cityControl.valueChanges,\n this.boiteControl.valueChanges,\n this.numeroControl.valueChanges,\n this.NISControl.valueChanges,\n ).subscribe(() => {\n const change = {\n country: this.countryForm.value || undefined,\n street: this.addressControl.value || undefined,\n postal_code: this.postalCodeControl.value || undefined,\n city: this.cityControl.value || undefined,\n street_number: this.numeroControl.value || undefined,\n nis: this.NISControl.value || undefined,\n };\n\n this.update.emit(change);\n });\n }\n\n onAddressSelected(result: OSMResult) {\n const city =\n result.address.city || result.address.village || result.address.town;\n if (city) {\n this.cityControl.setValue(city);\n }\n\n const houseNumber = result.address.house_number;\n if (houseNumber) {\n this.numeroControl.setValue(houseNumber);\n }\n\n const postalCode = result.address.postcode;\n if (postalCode) {\n this.postalCodeControl.setValue(postalCode);\n }\n }\n}\n","<onemrva-mat-input-country\n [country]=\"countryForm\"\n label=\"{{ 'input.country.label' | translate }}\"\n noEntriesFoundLabel=\"{{ 'input.country.not.found' | translate }}\"\n placeholderLabel=\"{{ 'input.country.search' | translate }}\"\n searchAriaLabel=\"{{ 'input.country.search' | translate }}\"\n></onemrva-mat-input-country>\n\n<div class=\"line-2\">\n <onemrva-mat-input-address\n mode=\"road-only\"\n [countryCodes]=\"[countryForm.value || '']\"\n [address]=\"addressControl\"\n (getAddress)=\"onAddressSelected($event)\"\n >\n </onemrva-mat-input-address>\n\n <mat-form-field>\n <mat-label>{{ 'input.address.number.label' | translate }}</mat-label>\n <input\n matInput\n [formControl]=\"numeroControl\"\n [placeholder]=\"'input.address.number.placeholder' | translate\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{'input.address.box.label' | translate}}</mat-label>\n <input\n matInput\n [formControl]=\"boiteControl\"\n [placeholder]=\"'input.address.box.placeholder' | translate\"\n />\n </mat-form-field>\n</div>\n\n<div class=\"line-3\">\n <mat-form-field>\n <mat-label>{{ 'input.address.postal-code.label' | translate}}</mat-label>\n <input\n matInput\n [formControl]=\"postalCodeControl\"\n [placeholder]=\"'input.address.postal-code.label' | translate\"\n />\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'input.address.city.label' | translate }}</mat-label>\n <input\n matInput\n [formControl]=\"cityControl\"\n [placeholder]=\"'input.address.city.placeholder' | translate\"\n />\n </mat-form-field>\n</div>\n\n@if(INSMode) {\n<div class=\"line-4\">\n <mat-form-field>\n <mat-label>{{ 'input.address.nis.label' }}</mat-label>\n <input\n matInput\n [formControl]=\"NISControl\"\n [placeholder]=\"'input.address.nis.placeholder' | translate\"\n />\n </mat-form-field>\n</div>\n}\n","/*\n * Public API Surface of mat-bank-account-input\n */\n\nexport * from './src/onemrva-address';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MA0Ba,cAAc,CAAA;AAf3B,IAAA,WAAA,GAAA;QAiBE,IAAO,CAAA,OAAA,GAAa,KAAK;AAGzB,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,YAAY,EAOrB;AAEJ,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAE1D,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC;AAEpC,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC;AACvC,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC;AACjC,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC;AAClC,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC;AACnC,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC;AA0CjC;IAxCC,QAAQ,GAAA;QACN,KAAK,CACH,IAAI,CAAC,WAAW,CAAC,YAAY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,EAAA,iBAAiB,EAClB,OAAA,EAAA;wBACP,YAAY;wBACZ,kBAAkB;wBAClB,mBAAmB;wBACnB,+BAA+B;wBAC/B,cAAc;wBACd,eAAe;wBACf,+BAA+B;AAChC,qBAAA,EAAA,UAAA,EAEW,IAAI,EAAA,QAAA,EAAA,27DAAA,EAAA,MAAA,EAAA,CAAA,4kBAAA,CAAA,EAAA;8BAKhB,OAAO,EAAA,CAAA;sBADN;gBAID,MAAM,EAAA,CAAA;sBADL;;;AE9BH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, inject, ViewChild, Output, Input, ViewEncapsulation, Component } from '@angular/core';
|
|
2
|
+
import { Pipe, EventEmitter, inject, ViewChild, Output, Input, ViewEncapsulation, Component } from '@angular/core';
|
|
3
3
|
import * as i4 from '@angular/forms';
|
|
4
4
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { startWith, debounceTime, switchMap, of, map } from 'rxjs';
|
|
@@ -17,12 +17,35 @@ import { MatIcon } from '@angular/material/icon';
|
|
|
17
17
|
import { FlagIconComponent } from '@onemrvapublic/design-system/flag-icon';
|
|
18
18
|
import { OnemRvaOSMService } from '@onemrvapublic/design-system/shared';
|
|
19
19
|
|
|
20
|
+
class OSMAddressFormatPipe {
|
|
21
|
+
transform(result) {
|
|
22
|
+
if (result.address.country_code !== 'be') {
|
|
23
|
+
return result.display_name;
|
|
24
|
+
}
|
|
25
|
+
const town = result.address.village || result.address.city || result.address.town;
|
|
26
|
+
if (result.address.house_number) {
|
|
27
|
+
return `${result.address.road} ${result.address.house_number}, ${result.address.postcode} ${town}`;
|
|
28
|
+
}
|
|
29
|
+
return `${result.address.road}, ${result.address.postcode} ${town}`;
|
|
30
|
+
}
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: OSMAddressFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
32
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: OSMAddressFormatPipe, isStandalone: true, name: "addressFormatter" }); }
|
|
33
|
+
}
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: OSMAddressFormatPipe, decorators: [{
|
|
35
|
+
type: Pipe,
|
|
36
|
+
args: [{
|
|
37
|
+
name: 'addressFormatter',
|
|
38
|
+
standalone: true,
|
|
39
|
+
}]
|
|
40
|
+
}] });
|
|
41
|
+
|
|
20
42
|
class OnemrvaMatInputAddressComponent {
|
|
21
43
|
constructor() {
|
|
22
44
|
this.placeholder = 'input.address.placeholder';
|
|
23
45
|
this.readonly = false;
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
46
|
+
this.mode = 'full';
|
|
47
|
+
this.label = 'input.address.label';
|
|
48
|
+
this.noEntriesFoundLabel = 'input.address.not-found';
|
|
26
49
|
this.hint = '';
|
|
27
50
|
this.countryCodes = ['be'];
|
|
28
51
|
this.getAddress = new EventEmitter();
|
|
@@ -50,7 +73,8 @@ class OnemrvaMatInputAddressComponent {
|
|
|
50
73
|
}));
|
|
51
74
|
}
|
|
52
75
|
selectAddress(address, emit = true) {
|
|
53
|
-
this.address.
|
|
76
|
+
const finalValue = this.mode === 'road-only' ? address.address.road : address.display_name;
|
|
77
|
+
this.address.setValue(finalValue, { emitEvent: emit });
|
|
54
78
|
this.getAddress.emit(address);
|
|
55
79
|
}
|
|
56
80
|
clear() {
|
|
@@ -62,7 +86,7 @@ class OnemrvaMatInputAddressComponent {
|
|
|
62
86
|
this.autocompleteTrigger.closePanel();
|
|
63
87
|
}
|
|
64
88
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: OnemrvaMatInputAddressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
65
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: OnemrvaMatInputAddressComponent, isStandalone: true, selector: "onemrva-mat-input-address", inputs: { placeholder: "placeholder", readonly: "readonly", address: "address", label: "label", noEntriesFoundLabel: "noEntriesFoundLabel", hint: "hint", countryCodes: "countryCodes" }, outputs: { getAddress: "getAddress" }, viewQueries: [{ propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true }], ngImport: i0, template: "<mat-form-field appearance=\"outline\">\n <mat-label>{{ label | translate }}</mat-label>\n <mat-icon matPrefix [ngClass]=\"{ spin: isLoading }\">\n {{ isLoading ? 'refresh' : 'search' }}\n </mat-icon>\n\n @if (address.value !== '') {\n <mat-icon matSuffix class=\"clickable\" (click)=\"clear()\">close</mat-icon>\n }\n <input\n type=\"text\"\n matInput\n [formControl]=\"address\"\n [readonly]=\"readonly\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder | translate\"\n (keydown.enter)=\"handleEnter()\"\n />\n\n @if (hint) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"selectAddress($event.option.value)\"\n >\n @for (result of results$ | async; track result.place_id) {\n <mat-option [value]=\"result\">\n <span class=\"country\">\n <flag-icon [countryCode]=\"result.address['country_code']\" />\n {{ result
|
|
89
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: OnemrvaMatInputAddressComponent, isStandalone: true, selector: "onemrva-mat-input-address", inputs: { placeholder: "placeholder", readonly: "readonly", address: "address", mode: "mode", label: "label", noEntriesFoundLabel: "noEntriesFoundLabel", hint: "hint", countryCodes: "countryCodes" }, outputs: { getAddress: "getAddress" }, viewQueries: [{ propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true }], ngImport: i0, template: "<mat-form-field appearance=\"outline\">\n <mat-label>{{ label | translate }}</mat-label>\n <mat-icon matPrefix [ngClass]=\"{ spin: isLoading }\">\n {{ isLoading ? 'refresh' : 'search' }}\n </mat-icon>\n\n @if (address.value !== '') {\n <mat-icon matSuffix class=\"clickable\" (click)=\"clear()\">close</mat-icon>\n }\n <input\n type=\"text\"\n matInput\n [formControl]=\"address\"\n [readonly]=\"readonly\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder | translate\"\n (keydown.enter)=\"handleEnter()\"\n />\n\n @if (hint) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"selectAddress($event.option.value)\"\n >\n @for (result of results$ | async; track result.place_id) {\n <mat-option [value]=\"result\">\n <span class=\"country\">\n <flag-icon [countryCode]=\"result.address['country_code']\" />\n {{ result | addressFormatter }}\n </span>\n </mat-option>\n }\n @if (showNoResult) {\n <mat-option>\n {{ noEntriesFoundLabel | translate }}\n </mat-option>\n }\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}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.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: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { 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: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i5.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"] }, { kind: "pipe", type: OSMAddressFormatPipe, name: "addressFormatter" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
66
90
|
}
|
|
67
91
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: OnemrvaMatInputAddressComponent, decorators: [{
|
|
68
92
|
type: Component,
|
|
@@ -77,13 +101,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
77
101
|
MatAutocomplete,
|
|
78
102
|
MatIcon,
|
|
79
103
|
FlagIconComponent,
|
|
80
|
-
|
|
104
|
+
OSMAddressFormatPipe,
|
|
105
|
+
], encapsulation: ViewEncapsulation.None, template: "<mat-form-field appearance=\"outline\">\n <mat-label>{{ label | translate }}</mat-label>\n <mat-icon matPrefix [ngClass]=\"{ spin: isLoading }\">\n {{ isLoading ? 'refresh' : 'search' }}\n </mat-icon>\n\n @if (address.value !== '') {\n <mat-icon matSuffix class=\"clickable\" (click)=\"clear()\">close</mat-icon>\n }\n <input\n type=\"text\"\n matInput\n [formControl]=\"address\"\n [readonly]=\"readonly\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder | translate\"\n (keydown.enter)=\"handleEnter()\"\n />\n\n @if (hint) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"selectAddress($event.option.value)\"\n >\n @for (result of results$ | async; track result.place_id) {\n <mat-option [value]=\"result\">\n <span class=\"country\">\n <flag-icon [countryCode]=\"result.address['country_code']\" />\n {{ result | addressFormatter }}\n </span>\n </mat-option>\n }\n @if (showNoResult) {\n <mat-option>\n {{ noEntriesFoundLabel | translate }}\n </mat-option>\n }\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}\n"] }]
|
|
81
106
|
}], propDecorators: { placeholder: [{
|
|
82
107
|
type: Input
|
|
83
108
|
}], readonly: [{
|
|
84
109
|
type: Input
|
|
85
110
|
}], address: [{
|
|
86
111
|
type: Input
|
|
112
|
+
}], mode: [{
|
|
113
|
+
type: Input
|
|
87
114
|
}], label: [{
|
|
88
115
|
type: Input
|
|
89
116
|
}], noEntriesFoundLabel: [{
|
|
@@ -1 +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 ViewChild,\n inject,\n} from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { debounceTime, switchMap, Observable, startWith, map, of } 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 @Input() countryCodes = ['be'];\n @Output() getAddress = new EventEmitter<OSMResult>();\n\n @ViewChild(MatAutocompleteTrigger, { static: false })\n autocompleteTrigger!: MatAutocompleteTrigger;\n\n results$!: Observable<OSMResult[]>;\n\n private readonly osm = inject(OnemRvaOSMService);\n\n isLoading = false;\n\n firstResult: null | OSMResult = null;\n showNoResult = false;\n\n ngOnInit(): void {\n this.results$ = this.address.valueChanges.pipe(\n startWith(''),\n debounceTime(300),\n switchMap((value: string) => {\n this.showNoResult = false;\n this.firstResult = null;\n if (!value || value.length <= 2) {\n this.isLoading = false;\n this.autocompleteTrigger.closePanel();\n return of([]);\n }\n\n this.isLoading = true;\n return this.osm.searchAddress(value, this.countryCodes).pipe(\n map(results => {\n this.showNoResult = results.length === 0;\n this.isLoading = false;\n this.firstResult = results[0];\n return results;\n }),\n );\n }),\n );\n }\n\n selectAddress(address: OSMResult, emit = true) {\n this.address.setValue(address.display_name, { emitEvent: emit });\n this.getAddress.emit(address);\n }\n\n clear() {\n this.address.setValue('');\n }\n\n handleEnter() {\n if (this.firstResult !== null) this.selectAddress(this.firstResult, false);\n this.autocompleteTrigger.closePanel();\n }\n}\n","<mat-form-field appearance=\"outline\">\n <mat-label>{{ label | translate }}</mat-label>\n <mat-icon matPrefix [ngClass]=\"{ spin: isLoading }\">\n {{ isLoading ? 'refresh' : 'search' }}\n </mat-icon>\n\n @if (address.value !== '') {\n <mat-icon matSuffix class=\"clickable\" (click)=\"clear()\">close</mat-icon>\n }\n <input\n type=\"text\"\n matInput\n [formControl]=\"address\"\n [readonly]=\"readonly\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder | translate\"\n (keydown.enter)=\"handleEnter()\"\n />\n\n @if (hint) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"selectAddress($event.option.value)\"\n >\n @for (result of results$ | async; track result.place_id) {\n <mat-option [value]=\"result\">\n <span class=\"country\">\n <flag-icon [countryCode]=\"result.address['country_code']\" />\n {{ result.display_name }}\n </span>\n </mat-option>\n }\n @if (showNoResult) {\n <mat-option>\n {{ noEntriesFoundLabel | translate }}\n </mat-option>\n }\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-address.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;MA+Ca,+BAA+B,CAAA;AAnB5C,IAAA,WAAA,GAAA;QAoBW,IAAW,CAAA,WAAA,GAAG,2BAA2B;QACzC,IAAQ,CAAA,QAAA,GAAG,KAAK;QAEhB,IAAK,CAAA,KAAA,GAAG,SAAS;QACjB,IAAmB,CAAA,mBAAA,GAAG,WAAW;QACjC,IAAI,CAAA,IAAA,GAAG,EAAE;AACT,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,IAAI,CAAC;AACpB,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,YAAY,EAAa;AAOnC,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAEhD,IAAS,CAAA,SAAA,GAAG,KAAK;QAEjB,IAAW,CAAA,WAAA,GAAqB,IAAI;QACpC,IAAY,CAAA,YAAA,GAAG,KAAK;AAyCrB;IAvCC,QAAQ,GAAA;QACN,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAC5C,SAAS,CAAC,EAAE,CAAC,EACb,YAAY,CAAC,GAAG,CAAC,EACjB,SAAS,CAAC,CAAC,KAAa,KAAI;AAC1B,YAAA,IAAI,CAAC,YAAY,GAAG,KAAK;AACzB,YAAA,IAAI,CAAC,WAAW,GAAG,IAAI;YACvB,IAAI,CAAC,K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P,OAAA,EAAA;wBACP,YAAY;wBACZ,cAAc;wBACd,kBAAkB;wBAClB,eAAe;wBACf,mBAAmB;wBACnB,eAAe;wBACf,sBAAsB;wBACtB,eAAe;wBACf,OAAO;wBACP,iBAAiB;qBAClB,EACc,aAAA,EAAA,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,0qCAAA,EAAA,MAAA,EAAA,CAAA,0HAAA,CAAA,EAAA;8BAG5B,WAAW,EAAA,CAAA;sBAAnB;gBACQ,QAAQ,EAAA,CAAA;sBAAhB;gBACQ,OAAO,EAAA,CAAA;sBAAf;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,mBAAmB,EAAA,CAAA;sBAA3B;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBACS,UAAU,EAAA,CAAA;sBAAnB;gBAGD,mBAAmB,EAAA,CAAA;sBADlB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,sBAAsB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;;AEzDtD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"onemrvapublic-design-system-mat-input-address.mjs","sources":["../../../../projects/onemrva/design-system/mat-input-address/src/format-osm.directive.ts","../../../../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 { Pipe, PipeTransform } from '@angular/core';\nimport { OSMResult } from '@onemrvapublic/design-system/shared';\n\n@Pipe({\n name: 'addressFormatter',\n standalone: true,\n})\nexport class OSMAddressFormatPipe implements PipeTransform {\n transform(result: OSMResult): string {\n if (result.address.country_code !== 'be') {\n return result.display_name;\n }\n\n const town =\n result.address.village || result.address.city || result.address.town;\n if (result.address.house_number) {\n return `${result.address.road} ${result.address.house_number}, ${result.address.postcode} ${town}`;\n }\n\n return `${result.address.road}, ${result.address.postcode} ${town}`;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n ViewEncapsulation,\n OnInit,\n ViewChild,\n inject,\n} from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { debounceTime, switchMap, Observable, startWith, map, of } 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';\nimport { OSMAddressFormatPipe } from './format-osm.directive';\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 OSMAddressFormatPipe,\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() mode: 'road-only' | 'full' = 'full';\n @Input() label = 'input.address.label';\n @Input() noEntriesFoundLabel = 'input.address.not-found';\n @Input() hint = '';\n @Input() countryCodes = ['be'];\n @Output() getAddress = new EventEmitter<OSMResult>();\n\n @ViewChild(MatAutocompleteTrigger, { static: false })\n autocompleteTrigger!: MatAutocompleteTrigger;\n\n results$!: Observable<OSMResult[]>;\n\n private readonly osm = inject(OnemRvaOSMService);\n\n isLoading = false;\n\n firstResult: null | OSMResult = null;\n showNoResult = false;\n\n ngOnInit(): void {\n this.results$ = this.address.valueChanges.pipe(\n startWith(''),\n debounceTime(300),\n switchMap((value: string) => {\n this.showNoResult = false;\n this.firstResult = null;\n if (!value || value.length <= 2) {\n this.isLoading = false;\n this.autocompleteTrigger.closePanel();\n return of([]);\n }\n\n this.isLoading = true;\n return this.osm.searchAddress(value, this.countryCodes).pipe(\n map(results => {\n this.showNoResult = results.length === 0;\n this.isLoading = false;\n this.firstResult = results[0];\n return results;\n }),\n );\n }),\n );\n }\n\n selectAddress(address: OSMResult, emit = true) {\n const finalValue =\n this.mode === 'road-only' ? address.address.road : address.display_name;\n\n this.address.setValue(finalValue, { emitEvent: emit });\n this.getAddress.emit(address);\n }\n\n clear() {\n this.address.setValue('');\n }\n\n handleEnter() {\n if (this.firstResult !== null) this.selectAddress(this.firstResult, false);\n this.autocompleteTrigger.closePanel();\n }\n}\n","<mat-form-field appearance=\"outline\">\n <mat-label>{{ label | translate }}</mat-label>\n <mat-icon matPrefix [ngClass]=\"{ spin: isLoading }\">\n {{ isLoading ? 'refresh' : 'search' }}\n </mat-icon>\n\n @if (address.value !== '') {\n <mat-icon matSuffix class=\"clickable\" (click)=\"clear()\">close</mat-icon>\n }\n <input\n type=\"text\"\n matInput\n [formControl]=\"address\"\n [readonly]=\"readonly\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder | translate\"\n (keydown.enter)=\"handleEnter()\"\n />\n\n @if (hint) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n (optionSelected)=\"selectAddress($event.option.value)\"\n >\n @for (result of results$ | async; track result.place_id) {\n <mat-option [value]=\"result\">\n <span class=\"country\">\n <flag-icon [countryCode]=\"result.address['country_code']\" />\n {{ result | addressFormatter }}\n </span>\n </mat-option>\n }\n @if (showNoResult) {\n <mat-option>\n {{ noEntriesFoundLabel | translate }}\n </mat-option>\n }\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-address.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;MAOa,oBAAoB,CAAA;AAC/B,IAAA,SAAS,CAAC,MAAiB,EAAA;QACzB,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,KAAK,IAAI,EAAE;YACxC,OAAO,MAAM,CAAC,YAAY;;AAG5B,QAAA,MAAM,IAAI,GACR,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI;AACtE,QAAA,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE;YAC/B,OAAO,CAAA,EAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA,CAAA,EAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAA,EAAA,EAAK,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE;;AAGpG,QAAA,OAAO,CAAG,EAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA,EAAA,EAAK,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAI,CAAA,EAAA,IAAI,EAAE;;8GAZ1D,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,kBAAA,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,kBAAkB;AACxB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;MC2CY,+B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B;wBACjB,oBAAoB;qBACrB,EACc,aAAA,EAAA,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,grCAAA,EAAA,MAAA,EAAA,CAAA,0HAAA,CAAA,EAAA;8BAG5B,WAAW,EAAA,CAAA;sBAAnB;gBACQ,QAAQ,EAAA,CAAA;sBAAhB;gBACQ,OAAO,EAAA,CAAA;sBAAf;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,mBAAmB,EAAA,CAAA;sBAA3B;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBACS,UAAU,EAAA,CAAA;sBAAnB;gBAGD,mBAAmB,EAAA,CAAA;sBADlB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,sBAAsB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;;AE5DtD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -47,7 +47,8 @@ class OnemrvaMatInputCountryComponent {
|
|
|
47
47
|
combineLatestWith(this.countries$), map(([value, countries]) => {
|
|
48
48
|
// ✅ Explicitly defining types
|
|
49
49
|
return countries.find((country) => value !== null &&
|
|
50
|
-
country.code
|
|
50
|
+
country.code.toLowerCase() ===
|
|
51
|
+
value.substring(0, country.code.length).toLowerCase());
|
|
51
52
|
}));
|
|
52
53
|
}
|
|
53
54
|
handleClick(e) {
|
|
@@ -62,7 +63,7 @@ class OnemrvaMatInputCountryComponent {
|
|
|
62
63
|
return 'input.country.unknown.error';
|
|
63
64
|
}
|
|
64
65
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: OnemrvaMatInputCountryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
65
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: OnemrvaMatInputCountryComponent, isStandalone: true, selector: "onemrva-mat-input-country", inputs: { readonly: "readonly", country: "country", label: "label", noEntriesFoundLabel: "noEntriesFoundLabel", hint: "hint", placeholderLabel: "placeholderLabel", searchAriaLabel: "searchAriaLabel" }, outputs: { getCountry: "getCountry" }, ngImport: i0, template: "<mat-form-field class=\"onemrva-input-country\">\n <mat-label>{{ label }}</mat-label>\n <mat-select class=\"onemrva-country-select\" [formControl]=\"country\">\n <mat-select-trigger>\n <mat-country-item\n [countryCode]=\"country.getRawValue()\"\n [countryName]=\"(selectedCountry$ | async)?.name\"\n />\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 @for (country of filteredCountries$ | async; track country.
|
|
66
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: OnemrvaMatInputCountryComponent, isStandalone: true, selector: "onemrva-mat-input-country", inputs: { readonly: "readonly", country: "country", label: "label", noEntriesFoundLabel: "noEntriesFoundLabel", hint: "hint", placeholderLabel: "placeholderLabel", searchAriaLabel: "searchAriaLabel" }, outputs: { getCountry: "getCountry" }, ngImport: i0, template: "<mat-form-field class=\"onemrva-input-country\">\n <mat-label>{{ label }}</mat-label>\n <mat-select class=\"onemrva-country-select\" [formControl]=\"country\">\n <mat-select-trigger>\n <mat-country-item\n [countryCode]=\"country.getRawValue().toLowerCase()\"\n [countryName]=\"(selectedCountry$ | async)?.name\"\n />\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 @for (country of filteredCountries$ | async; track country.name) {\n <mat-option [value]=\"country.code.toLowerCase()\">\n <mat-country-item\n [countryCode]=\"country.code.toLowerCase()\"\n [countryName]=\"country.name\"\n />\n </mat-option>\n }\n </mat-select>\n @if (hint !== '') {\n <mat-hint>{{ hint }}</mat-hint>\n }\n @if (country.invalid) {\n <mat-error>{{ errors() | translate }}</mat-error>\n }\n</mat-form-field>\n", styles: ["mat-form-field.onemrva-input-country{width:100%}:host mat-option.mdc-list-item .country{position:relative;display:block;padding-top:var(--half-spacer)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatInputModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3.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: i3.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatSelectSearchModule }, { kind: "component", type: i4.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: 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: "component", type: OnemrvaCountryItemComponent, selector: "mat-country-item", inputs: ["countryCode", "countryName"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
66
67
|
}
|
|
67
68
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: OnemrvaMatInputCountryComponent, decorators: [{
|
|
68
69
|
type: Component,
|
|
@@ -75,7 +76,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
75
76
|
ReactiveFormsModule,
|
|
76
77
|
TranslateModule,
|
|
77
78
|
OnemrvaCountryItemComponent,
|
|
78
|
-
], encapsulation: ViewEncapsulation.None, template: "<mat-form-field class=\"onemrva-input-country\">\n <mat-label>{{ label }}</mat-label>\n <mat-select class=\"onemrva-country-select\" [formControl]=\"country\">\n <mat-select-trigger>\n <mat-country-item\n [countryCode]=\"country.getRawValue()\"\n [countryName]=\"(selectedCountry$ | async)?.name\"\n />\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 @for (country of filteredCountries$ | async; track country.
|
|
79
|
+
], encapsulation: ViewEncapsulation.None, template: "<mat-form-field class=\"onemrva-input-country\">\n <mat-label>{{ label }}</mat-label>\n <mat-select class=\"onemrva-country-select\" [formControl]=\"country\">\n <mat-select-trigger>\n <mat-country-item\n [countryCode]=\"country.getRawValue().toLowerCase()\"\n [countryName]=\"(selectedCountry$ | async)?.name\"\n />\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 @for (country of filteredCountries$ | async; track country.name) {\n <mat-option [value]=\"country.code.toLowerCase()\">\n <mat-country-item\n [countryCode]=\"country.code.toLowerCase()\"\n [countryName]=\"country.name\"\n />\n </mat-option>\n }\n </mat-select>\n @if (hint !== '') {\n <mat-hint>{{ hint }}</mat-hint>\n }\n @if (country.invalid) {\n <mat-error>{{ errors() | translate }}</mat-error>\n }\n</mat-form-field>\n", styles: ["mat-form-field.onemrva-input-country{width:100%}:host mat-option.mdc-list-item .country{position:relative;display:block;padding-top:var(--half-spacer)}\n"] }]
|
|
79
80
|
}], ctorParameters: () => [], propDecorators: { readonly: [{
|
|
80
81
|
type: Input
|
|
81
82
|
}], country: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onemrvapublic-design-system-mat-input-country.mjs","sources":["../../../../projects/onemrva/design-system/mat-input-country/src/onemrva-mat-input-country.component.ts","../../../../projects/onemrva/design-system/mat-input-country/src/onemrva-mat-input-country.component.html","../../../../projects/onemrva/design-system/mat-input-country/index.ts","../../../../projects/onemrva/design-system/mat-input-country/onemrvapublic-design-system-mat-input-country.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n Component,\n EventEmitter,\n inject,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { FormControl, ReactiveFormsModule } 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 map,\n startWith,\n debounceTime,\n combineLatestWith,\n} from 'rxjs';\nimport { MatSelectSearchModule } from '@onemrvapublic/design-system/mat-select-search';\nimport {\n OnemRvaCDNCountryService,\n OnemrvaMaterialCountry,\n} from '@onemrvapublic/design-system/shared';\nimport { OnemrvaCountryItemComponent } from '@onemrvapublic/design-system/mat-country-item';\n\n@Component({\n selector: 'onemrva-mat-input-country',\n styleUrls: ['onemrva-mat-input-country.component.scss'],\n templateUrl: 'onemrva-mat-input-country.component.html',\n standalone: true,\n imports: [\n CommonModule,\n MatInputModule,\n MatFormFieldModule,\n MatSelectModule,\n MatSelectSearchModule,\n ReactiveFormsModule,\n TranslateModule,\n OnemrvaCountryItemComponent,\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OnemrvaMatInputCountryComponent implements OnInit {\n @Input()\n readonly = false;\n\n @Input() country!: FormControl;\n\n @Input() label = 'Country';\n @Input() noEntriesFoundLabel = 'Not found';\n @Input() hint = '';\n @Input() placeholderLabel = 'Search';\n @Input() searchAriaLabel = '';\n @Output() getCountry = new EventEmitter<any>();\n\n public filterCtrl: FormControl<string | null> = new FormControl<string>('');\n\n public countries$: Observable<OnemrvaMaterialCountry[]>;\n public filteredCountries$: Observable<OnemrvaMaterialCountry[]>;\n public selectedCountry$?: Observable<OnemrvaMaterialCountry | undefined>;\n\n public setValue(country: OnemrvaMaterialCountry) {\n this.country.setValue(country.code);\n this.getCountry.emit(country);\n }\n\n private readonly cdn = inject(OnemRvaCDNCountryService);\n\n constructor() {\n this.countries$ = this.cdn.getCountries();\n\n this.filteredCountries$ = this.filterCtrl.valueChanges.pipe(\n debounceTime(400),\n startWith<string | null>(''), // ✅ Explicitly setting type\n combineLatestWith(this.countries$),\n map(([search, countries]: [string | null, OnemrvaMaterialCountry[]]) => {\n return countries.filter((country: OnemrvaMaterialCountry) => {\n if (!search || search.trim() === '') return true; // ✅ Avoids returning an entire array\n return country.name?.toLowerCase().includes(search.toLowerCase());\n });\n }),\n );\n }\n\n ngOnInit(): void {\n this.selectedCountry$ = this.country.valueChanges.pipe(\n startWith<string | null>(this.country.getRawValue()), // ✅ Explicitly set type\n combineLatestWith(this.countries$),\n map(([value, countries]: [string | null, OnemrvaMaterialCountry[]]) => {\n // ✅ Explicitly defining types\n return countries.find(\n (country: OnemrvaMaterialCountry) =>\n value !== null &&\n country.code
|
|
1
|
+
{"version":3,"file":"onemrvapublic-design-system-mat-input-country.mjs","sources":["../../../../projects/onemrva/design-system/mat-input-country/src/onemrva-mat-input-country.component.ts","../../../../projects/onemrva/design-system/mat-input-country/src/onemrva-mat-input-country.component.html","../../../../projects/onemrva/design-system/mat-input-country/index.ts","../../../../projects/onemrva/design-system/mat-input-country/onemrvapublic-design-system-mat-input-country.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n Component,\n EventEmitter,\n inject,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { FormControl, ReactiveFormsModule } 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 map,\n startWith,\n debounceTime,\n combineLatestWith,\n} from 'rxjs';\nimport { MatSelectSearchModule } from '@onemrvapublic/design-system/mat-select-search';\nimport {\n OnemRvaCDNCountryService,\n OnemrvaMaterialCountry,\n} from '@onemrvapublic/design-system/shared';\nimport { OnemrvaCountryItemComponent } from '@onemrvapublic/design-system/mat-country-item';\n\n@Component({\n selector: 'onemrva-mat-input-country',\n styleUrls: ['onemrva-mat-input-country.component.scss'],\n templateUrl: 'onemrva-mat-input-country.component.html',\n standalone: true,\n imports: [\n CommonModule,\n MatInputModule,\n MatFormFieldModule,\n MatSelectModule,\n MatSelectSearchModule,\n ReactiveFormsModule,\n TranslateModule,\n OnemrvaCountryItemComponent,\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OnemrvaMatInputCountryComponent implements OnInit {\n @Input()\n readonly = false;\n\n @Input() country!: FormControl;\n\n @Input() label = 'Country';\n @Input() noEntriesFoundLabel = 'Not found';\n @Input() hint = '';\n @Input() placeholderLabel = 'Search';\n @Input() searchAriaLabel = '';\n @Output() getCountry = new EventEmitter<any>();\n\n public filterCtrl: FormControl<string | null> = new FormControl<string>('');\n\n public countries$: Observable<OnemrvaMaterialCountry[]>;\n public filteredCountries$: Observable<OnemrvaMaterialCountry[]>;\n public selectedCountry$?: Observable<OnemrvaMaterialCountry | undefined>;\n\n public setValue(country: OnemrvaMaterialCountry) {\n this.country.setValue(country.code);\n this.getCountry.emit(country);\n }\n\n private readonly cdn = inject(OnemRvaCDNCountryService);\n\n constructor() {\n this.countries$ = this.cdn.getCountries();\n\n this.filteredCountries$ = this.filterCtrl.valueChanges.pipe(\n debounceTime(400),\n startWith<string | null>(''), // ✅ Explicitly setting type\n combineLatestWith(this.countries$),\n map(([search, countries]: [string | null, OnemrvaMaterialCountry[]]) => {\n return countries.filter((country: OnemrvaMaterialCountry) => {\n if (!search || search.trim() === '') return true; // ✅ Avoids returning an entire array\n return country.name?.toLowerCase().includes(search.toLowerCase());\n });\n }),\n );\n }\n\n ngOnInit(): void {\n this.selectedCountry$ = this.country.valueChanges.pipe(\n startWith<string | null>(this.country.getRawValue()), // ✅ Explicitly set type\n combineLatestWith(this.countries$),\n map(([value, countries]: [string | null, OnemrvaMaterialCountry[]]) => {\n // ✅ Explicitly defining types\n return countries.find(\n (country: OnemrvaMaterialCountry) =>\n value !== null &&\n country.code.toLowerCase() ===\n value.substring(0, country.code.length).toLowerCase(),\n );\n }),\n );\n }\n\n handleClick(e: any) {\n e.stopPropagation();\n }\n\n public errors() {\n for (const k in this.country.errors) {\n if (k === 'required') {\n return 'input.country.required';\n }\n }\n return 'input.country.unknown.error';\n }\n}\n","<mat-form-field class=\"onemrva-input-country\">\n <mat-label>{{ label }}</mat-label>\n <mat-select class=\"onemrva-country-select\" [formControl]=\"country\">\n <mat-select-trigger>\n <mat-country-item\n [countryCode]=\"country.getRawValue().toLowerCase()\"\n [countryName]=\"(selectedCountry$ | async)?.name\"\n />\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 @for (country of filteredCountries$ | async; track country.name) {\n <mat-option [value]=\"country.code.toLowerCase()\">\n <mat-country-item\n [countryCode]=\"country.code.toLowerCase()\"\n [countryName]=\"country.name\"\n />\n </mat-option>\n }\n </mat-select>\n @if (hint !== '') {\n <mat-hint>{{ hint }}</mat-hint>\n }\n @if (country.invalid) {\n <mat-error>{{ errors() | translate }}</mat-error>\n }\n</mat-form-field>\n","/*\n * Public API Surface of mat-bank-account-input\n */\n\nexport * from './src/onemrva-mat-input-country.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;MA8Ca,+BAA+B,CAAA;AAmBnC,IAAA,QAAQ,CAAC,OAA+B,EAAA;QAC7C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;AACnC,QAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;;AAK/B,IAAA,WAAA,GAAA;QAxBA,IAAQ,CAAA,QAAA,GAAG,KAAK;QAIP,IAAK,CAAA,KAAA,GAAG,SAAS;QACjB,IAAmB,CAAA,mBAAA,GAAG,WAAW;QACjC,IAAI,CAAA,IAAA,GAAG,EAAE;QACT,IAAgB,CAAA,gBAAA,GAAG,QAAQ;QAC3B,IAAe,C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AAA,EAAA,IAAA,EAAA,eAAe,4FACf,2BAA2B,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,aAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAIlB,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAjB3C,SAAS;+BACE,2BAA2B,EAAA,UAAA,EAGzB,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,cAAc;wBACd,kBAAkB;wBAClB,eAAe;wBACf,qBAAqB;wBACrB,mBAAmB;wBACnB,eAAe;wBACf,2BAA2B;qBAC5B,EACc,aAAA,EAAA,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,+mCAAA,EAAA,MAAA,EAAA,CAAA,2JAAA,CAAA,EAAA;wDAIrC,QAAQ,EAAA,CAAA;sBADP;gBAGQ,OAAO,EAAA,CAAA;sBAAf;gBAEQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,mBAAmB,EAAA,CAAA;sBAA3B;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,gBAAgB,EAAA,CAAA;sBAAxB;gBACQ,eAAe,EAAA,CAAA;sBAAvB;gBACS,UAAU,EAAA,CAAA;sBAAnB;;;AEzDH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -150,7 +150,7 @@ class OnemrvaMatMultiSelectComponent extends MatFormFieldControl {
|
|
|
150
150
|
useExisting: forwardRef(() => OnemrvaMatMultiSelectComponent),
|
|
151
151
|
multi: true,
|
|
152
152
|
},
|
|
153
|
-
], queries: [{ propertyName: "matOptions", predicate: MatOption }], usesInheritance: true, ngImport: i0, template: "<mat-select\n [multiple]=\"multiple\"\n [formControl]=\"formControl\"\n [attr.data-cy]=\"dataCy\"\n [attr.aria-label]=\"label\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n>\n @if (multiple && selectionToggle) {\n <div class=\"selection-choice text-right\">\n <a\n tabindex=\"1\"\n [ngClass]=\"{ 'mat-disabled': isAllSelected() }\"\n (click)=\"selectAll()\"\n >{{ 'select.select.all' | translate }}</a\n ><span class=\"separator\"> | </span>\n <a\n tabindex=\"2\"\n [ngClass]=\"{ 'mat-disabled': isNoneSelected() }\"\n (click)=\"deselectAll($event)\"\n >{{ 'select.deselect.all' | translate }}</a\n >\n </div>\n }\n <div class=\"option-list\">\n <!-- @if (showFilter) {\n <mat-option>\n <mat-select-search\n [formControl]=\"searchFilter\"\n ariaLabel=\"{{ 'select.search.filter' | translate }}\"\n noEntriesFoundLabel=\"{{ 'select.search.notFound' | translate }}\"\n placeholderLabel=\"{{ 'select.search.filter' | translate }}\"\n ></mat-select-search>\n </mat-option>\n } -->\n @for (matOption of matOptions$ | async; track matOption.value) {\n <ng-container>\n <mat-option\n [disabled]=\"matOption.disabled\"\n [value]=\"matOption.value\"\n [attr.data-cy]=\"matOption._getHostElement().dataset['cy']\"\n >\n {{ matOption._text?.nativeElement?.textContent }}\n </mat-option>\n </ng-container>\n }\n </div>\n</mat-select>\n@if (multiple && counter > 0) {\n <div class=\"mat-select-counter float-right position-absolute text-center\">\n <span class=\"text\">{{ counter }}</span\n ><mat-icon (click)=\"deselectAll($event)\">close</mat-icon>\n </div>\n}\n", styles: [":host{display:inline-block;width:100%}:host .mat-select-counter{top:var(--spacer);right:var(--triple-spacer);display:block;padding:var(--quarter-spacer) var(--half-spacer) var(--quarter-spacer) var(--spacer);background:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container);min-width:var(--triple-spacer);font-family:var(--brand-font);border:1px solid var(--mat-sys-primary);border-radius:var(--button-border-radius)}:host .mat-select-counter span.text{font-family:var(--sys-label-large-font);font-style:normal;font-weight:500;font-size:.75rem;line-height:1.25rem}:host .mat-select-counter mat-icon{font-size:.75rem;height:.75rem;width:.75rem;line-height:1rem;padding:0 var(--quarter-spacer) 0 var(--quarter-spacer);cursor:pointer}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.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: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
153
|
+
], queries: [{ propertyName: "matOptions", predicate: MatOption }], usesInheritance: true, ngImport: i0, template: "<mat-select\n [multiple]=\"multiple\"\n [formControl]=\"formControl\"\n [attr.data-cy]=\"dataCy\"\n [attr.aria-label]=\"label\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n [placeholder]=\"'select.select.placeholder' | translate\"\n>\n @if (multiple && selectionToggle) {\n <div class=\"selection-choice text-right\">\n <a\n tabindex=\"1\"\n [ngClass]=\"{ 'mat-disabled': isAllSelected() }\"\n (click)=\"selectAll()\"\n >{{ 'select.select.all' | translate }}</a\n ><span class=\"separator\"> | </span>\n <a\n tabindex=\"2\"\n [ngClass]=\"{ 'mat-disabled': isNoneSelected() }\"\n (click)=\"deselectAll($event)\"\n >{{ 'select.deselect.all' | translate }}</a\n >\n </div>\n }\n <div class=\"option-list\">\n <!-- @if (showFilter) {\n <mat-option>\n <mat-select-search\n [formControl]=\"searchFilter\"\n ariaLabel=\"{{ 'select.search.filter' | translate }}\"\n noEntriesFoundLabel=\"{{ 'select.search.notFound' | translate }}\"\n placeholderLabel=\"{{ 'select.search.filter' | translate }}\"\n ></mat-select-search>\n </mat-option>\n } -->\n @for (matOption of matOptions$ | async; track matOption.value) {\n <ng-container>\n <mat-option\n [disabled]=\"matOption.disabled\"\n [value]=\"matOption.value\"\n [attr.data-cy]=\"matOption._getHostElement().dataset['cy']\"\n >\n {{ matOption._text?.nativeElement?.textContent }}\n </mat-option>\n </ng-container>\n }\n </div>\n</mat-select>\n@if (multiple && counter > 0) {\n <div class=\"mat-select-counter float-right position-absolute text-center\">\n <span class=\"text\">{{ counter }}</span\n ><mat-icon (click)=\"deselectAll($event)\">close</mat-icon>\n </div>\n}\n", styles: [":host{display:inline-block;width:100%}:host .mat-select-counter{top:var(--spacer);right:var(--triple-spacer);display:block;padding:var(--quarter-spacer) var(--half-spacer) var(--quarter-spacer) var(--spacer);background:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container);min-width:var(--triple-spacer);font-family:var(--brand-font);border:1px solid var(--mat-sys-primary);border-radius:var(--button-border-radius)}:host .mat-select-counter span.text{font-family:var(--sys-label-large-font);font-style:normal;font-weight:500;font-size:.75rem;line-height:1.25rem}:host .mat-select-counter mat-icon{font-size:.75rem;height:.75rem;width:.75rem;line-height:1rem;padding:0 var(--quarter-spacer) 0 var(--quarter-spacer);cursor:pointer}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.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: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
154
154
|
}
|
|
155
155
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: OnemrvaMatMultiSelectComponent, decorators: [{
|
|
156
156
|
type: Component,
|
|
@@ -172,7 +172,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
172
172
|
MatSelectModule,
|
|
173
173
|
AsyncPipe,
|
|
174
174
|
MatIcon,
|
|
175
|
-
], standalone: true, encapsulation: ViewEncapsulation.Emulated, template: "<mat-select\n [multiple]=\"multiple\"\n [formControl]=\"formControl\"\n [attr.data-cy]=\"dataCy\"\n [attr.aria-label]=\"label\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n>\n @if (multiple && selectionToggle) {\n <div class=\"selection-choice text-right\">\n <a\n tabindex=\"1\"\n [ngClass]=\"{ 'mat-disabled': isAllSelected() }\"\n (click)=\"selectAll()\"\n >{{ 'select.select.all' | translate }}</a\n ><span class=\"separator\"> | </span>\n <a\n tabindex=\"2\"\n [ngClass]=\"{ 'mat-disabled': isNoneSelected() }\"\n (click)=\"deselectAll($event)\"\n >{{ 'select.deselect.all' | translate }}</a\n >\n </div>\n }\n <div class=\"option-list\">\n <!-- @if (showFilter) {\n <mat-option>\n <mat-select-search\n [formControl]=\"searchFilter\"\n ariaLabel=\"{{ 'select.search.filter' | translate }}\"\n noEntriesFoundLabel=\"{{ 'select.search.notFound' | translate }}\"\n placeholderLabel=\"{{ 'select.search.filter' | translate }}\"\n ></mat-select-search>\n </mat-option>\n } -->\n @for (matOption of matOptions$ | async; track matOption.value) {\n <ng-container>\n <mat-option\n [disabled]=\"matOption.disabled\"\n [value]=\"matOption.value\"\n [attr.data-cy]=\"matOption._getHostElement().dataset['cy']\"\n >\n {{ matOption._text?.nativeElement?.textContent }}\n </mat-option>\n </ng-container>\n }\n </div>\n</mat-select>\n@if (multiple && counter > 0) {\n <div class=\"mat-select-counter float-right position-absolute text-center\">\n <span class=\"text\">{{ counter }}</span\n ><mat-icon (click)=\"deselectAll($event)\">close</mat-icon>\n </div>\n}\n", styles: [":host{display:inline-block;width:100%}:host .mat-select-counter{top:var(--spacer);right:var(--triple-spacer);display:block;padding:var(--quarter-spacer) var(--half-spacer) var(--quarter-spacer) var(--spacer);background:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container);min-width:var(--triple-spacer);font-family:var(--brand-font);border:1px solid var(--mat-sys-primary);border-radius:var(--button-border-radius)}:host .mat-select-counter span.text{font-family:var(--sys-label-large-font);font-style:normal;font-weight:500;font-size:.75rem;line-height:1.25rem}:host .mat-select-counter mat-icon{font-size:.75rem;height:.75rem;width:.75rem;line-height:1rem;padding:0 var(--quarter-spacer) 0 var(--quarter-spacer);cursor:pointer}\n"] }]
|
|
175
|
+
], standalone: true, encapsulation: ViewEncapsulation.Emulated, template: "<mat-select\n [multiple]=\"multiple\"\n [formControl]=\"formControl\"\n [attr.data-cy]=\"dataCy\"\n [attr.aria-label]=\"label\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n [placeholder]=\"'select.select.placeholder' | translate\"\n>\n @if (multiple && selectionToggle) {\n <div class=\"selection-choice text-right\">\n <a\n tabindex=\"1\"\n [ngClass]=\"{ 'mat-disabled': isAllSelected() }\"\n (click)=\"selectAll()\"\n >{{ 'select.select.all' | translate }}</a\n ><span class=\"separator\"> | </span>\n <a\n tabindex=\"2\"\n [ngClass]=\"{ 'mat-disabled': isNoneSelected() }\"\n (click)=\"deselectAll($event)\"\n >{{ 'select.deselect.all' | translate }}</a\n >\n </div>\n }\n <div class=\"option-list\">\n <!-- @if (showFilter) {\n <mat-option>\n <mat-select-search\n [formControl]=\"searchFilter\"\n ariaLabel=\"{{ 'select.search.filter' | translate }}\"\n noEntriesFoundLabel=\"{{ 'select.search.notFound' | translate }}\"\n placeholderLabel=\"{{ 'select.search.filter' | translate }}\"\n ></mat-select-search>\n </mat-option>\n } -->\n @for (matOption of matOptions$ | async; track matOption.value) {\n <ng-container>\n <mat-option\n [disabled]=\"matOption.disabled\"\n [value]=\"matOption.value\"\n [attr.data-cy]=\"matOption._getHostElement().dataset['cy']\"\n >\n {{ matOption._text?.nativeElement?.textContent }}\n </mat-option>\n </ng-container>\n }\n </div>\n</mat-select>\n@if (multiple && counter > 0) {\n <div class=\"mat-select-counter float-right position-absolute text-center\">\n <span class=\"text\">{{ counter }}</span\n ><mat-icon (click)=\"deselectAll($event)\">close</mat-icon>\n </div>\n}\n", styles: [":host{display:inline-block;width:100%}:host .mat-select-counter{top:var(--spacer);right:var(--triple-spacer);display:block;padding:var(--quarter-spacer) var(--half-spacer) var(--quarter-spacer) var(--spacer);background:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container);min-width:var(--triple-spacer);font-family:var(--brand-font);border:1px solid var(--mat-sys-primary);border-radius:var(--button-border-radius)}:host .mat-select-counter span.text{font-family:var(--sys-label-large-font);font-style:normal;font-weight:500;font-size:.75rem;line-height:1.25rem}:host .mat-select-counter mat-icon{font-size:.75rem;height:.75rem;width:.75rem;line-height:1rem;padding:0 var(--quarter-spacer) 0 var(--quarter-spacer);cursor:pointer}\n"] }]
|
|
176
176
|
}], ctorParameters: () => [], propDecorators: { multiple: [{
|
|
177
177
|
type: Input
|
|
178
178
|
}], formControl: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onemrvapublic-design-system-mat-multi-select.mjs","sources":["../../../../projects/onemrva/design-system/mat-multi-select/src/onemrva-mat-multi-select.component.ts","../../../../projects/onemrva/design-system/mat-multi-select/src/onemrva-mat-multi-select.component.html","../../../../projects/onemrva/design-system/mat-multi-select/src/onemrva-mat-multi-select.module.ts","../../../../projects/onemrva/design-system/mat-multi-select/onemrvapublic-design-system-mat-multi-select.ts"],"sourcesContent":["import {\n AfterContentChecked,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n forwardRef,\n HostBinding,\n inject,\n Input,\n OnDestroy,\n OnInit,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n FormControl,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { MatOption } from '@angular/material/core';\nimport {\n debounceTime,\n map,\n Observable,\n startWith,\n Subject,\n takeUntil,\n} from 'rxjs';\nimport { AsyncPipe, NgClass } from '@angular/common';\nimport { MatIcon } from '@angular/material/icon';\nimport { MatSelectModule } from '@angular/material/select';\n\nlet NEXT_ID = 0;\n\n@Component({\n selector: 'onemrva-mat-multi-select',\n templateUrl: 'onemrva-mat-multi-select.component.html',\n styleUrl: 'onemrva-mat-multi-select.component.scss',\n providers: [\n {\n provide: MatFormFieldControl,\n useExisting: OnemrvaMatMultiSelectComponent,\n multi: false,\n },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => OnemrvaMatMultiSelectComponent),\n multi: true,\n },\n ],\n imports: [\n NgClass,\n TranslatePipe,\n ReactiveFormsModule,\n MatSelectModule,\n AsyncPipe,\n MatIcon,\n ],\n standalone: true,\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class OnemrvaMatMultiSelectComponent\n extends MatFormFieldControl<any>\n implements OnInit, OnDestroy, AfterContentChecked\n{\n counter = 0;\n _values: any[] = [];\n public override stateChanges = new Subject<void>();\n\n @Input()\n multiple = true;\n\n @Input()\n formControl!: FormControl;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('attr.role')\n public role = 'select';\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('attr.aria-label')\n public label = '';\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('attr.aria-invalid')\n public invalid = false;\n\n @Input()\n showFilter = true;\n\n @Input()\n selectionToggle = true;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('attr.data-cy')\n public dataCy = `onemrva-mat-multi-select-${NEXT_ID++}`;\n\n searchFilter: FormControl = new FormControl<string>('');\n\n @ContentChildren(MatOption)\n matOptions: QueryList<MatOption> = new QueryList<MatOption>();\n matOptions$?: Observable<MatOption<any>[]>;\n onDestroy$: Subject<any> = new Subject<any>();\n\n @HostBinding('style.opacity')\n get opacity() {\n return this.disabled ? 0.25 : 1;\n }\n\n override focused = false;\n\n onFocus() {\n this.focused = true;\n this.stateChanges.next();\n }\n\n onBlur() {\n this.focused = false;\n this.stateChanges.next();\n }\n\n translate = inject(TranslateService);\n cd = inject(ChangeDetectorRef);\n\n constructor() {\n super();\n setTimeout(() => {\n this.focused = false;\n }, 3000);\n }\n\n // Function to call when the rating changes.\n onChange = (_values: any[]) => {\n //\n };\n\n // Function to call when the input is touched (when a star is clicked).\n onTouched = () => {\n //\n };\n\n // Allows Angular to update the model (rating).\n // Update the model and changes needed for the view here.\n writeValue(values: any[] | any | undefined | null): void {\n if (this.multiple) {\n this.counter = 0;\n if (Array.isArray(values)) this.counter = values.length;\n //else if (Array.isArray(this._values)) this.counter = this._values.length;\n }\n this._values = values;\n this.onChange(this._values);\n }\n\n // Allows Angular to register a function to call when the model (rating) changes.\n // Save the function as a property to call later here.\n registerOnChange(fn: (value: any[]) => void): void {\n this.onChange = fn;\n }\n\n // Allows Angular to register a function to call when the input has been touched.\n // Save the function as a property to call later here.\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n isAllSelected() {\n return this.counter === this.matOptions.length;\n }\n\n selectAll() {\n this._values = this.matOptions.map(option => {\n return option.value;\n });\n this.formControl.setValue(this._values);\n }\n\n isNoneSelected() {\n return this.counter === 0;\n }\n\n deselectAll(_$event: MouseEvent) {\n this._values = [];\n this.formControl.setValue(this._values);\n }\n\n onContainerClick(_event: MouseEvent): void {\n //\n }\n\n setDescribedByIds(_ids: string[]): void {\n //\n }\n\n ngOnDestroy(): void {\n this.onDestroy$.next('');\n this.onDestroy$.complete();\n }\n\n optionSize = 0;\n\n ngOnInit(): void {\n this.matOptions$ = this.searchFilter.valueChanges.pipe(\n debounceTime(200),\n startWith(''),\n map((value: string) => {\n this.optionSize = this.matOptions.length;\n if (this._values !== null) {\n this.counter = this._values.length;\n }\n if (value === '') {\n return this.matOptions.filter(_o => {\n return true;\n });\n }\n return this.matOptions.filter(option => {\n return option?._text?.nativeElement.innerHTML\n .toLowerCase()\n .includes(value.toLowerCase());\n });\n }),\n );\n this.formControl.valueChanges\n .pipe(takeUntil(this.onDestroy$))\n .subscribe(values => {\n this._values = values;\n this.counter = this._values.length;\n });\n }\n\n ngAfterContentChecked(): void {\n if (this.matOptions.length !== this.optionSize) {\n this.optionSize = this.matOptions.length;\n this.counter = 0;\n this.searchFilter.updateValueAndValidity({ emitEvent: true });\n }\n }\n}\n","<mat-select\n [multiple]=\"multiple\"\n [formControl]=\"formControl\"\n [attr.data-cy]=\"dataCy\"\n [attr.aria-label]=\"label\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n>\n @if (multiple && selectionToggle) {\n <div class=\"selection-choice text-right\">\n <a\n tabindex=\"1\"\n [ngClass]=\"{ 'mat-disabled': isAllSelected() }\"\n (click)=\"selectAll()\"\n >{{ 'select.select.all' | translate }}</a\n ><span class=\"separator\"> | </span>\n <a\n tabindex=\"2\"\n [ngClass]=\"{ 'mat-disabled': isNoneSelected() }\"\n (click)=\"deselectAll($event)\"\n >{{ 'select.deselect.all' | translate }}</a\n >\n </div>\n }\n <div class=\"option-list\">\n <!-- @if (showFilter) {\n <mat-option>\n <mat-select-search\n [formControl]=\"searchFilter\"\n ariaLabel=\"{{ 'select.search.filter' | translate }}\"\n noEntriesFoundLabel=\"{{ 'select.search.notFound' | translate }}\"\n placeholderLabel=\"{{ 'select.search.filter' | translate }}\"\n ></mat-select-search>\n </mat-option>\n } -->\n @for (matOption of matOptions$ | async; track matOption.value) {\n <ng-container>\n <mat-option\n [disabled]=\"matOption.disabled\"\n [value]=\"matOption.value\"\n [attr.data-cy]=\"matOption._getHostElement().dataset['cy']\"\n >\n {{ matOption._text?.nativeElement?.textContent }}\n </mat-option>\n </ng-container>\n }\n </div>\n</mat-select>\n@if (multiple && counter > 0) {\n <div class=\"mat-select-counter float-right position-absolute text-center\">\n <span class=\"text\">{{ counter }}</span\n ><mat-icon (click)=\"deselectAll($event)\">close</mat-icon>\n </div>\n}\n","import { NgModule } from '@angular/core';\nimport { OnemrvaMatMultiSelectComponent } from './onemrva-mat-multi-select.component';\n\n@NgModule({\n declarations: [],\n imports: [OnemrvaMatMultiSelectComponent],\n exports: [],\n})\nexport class OnemrvaMatMultiSelectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAkCA,IAAI,OAAO,GAAG,CAAC;AA6BT,MAAO,8BACX,SAAQ,mBAAwB,CAAA;AA0ChC,IAAA,IACI,OAAO,GAAA;QACT,OAAO,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC;;IAKjC,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;AACnB,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,E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AAmB;gBAI1B,UAAU,EAAA,CAAA;sBADT;gBAID,eAAe,EAAA,CAAA;sBADd;gBAKM,MAAM,EAAA,CAAA;sBADZ,KAAK;uBAAC,cAAc;gBAMrB,UAAU,EAAA,CAAA;sBADT,eAAe;uBAAC,SAAS;gBAMtB,OAAO,EAAA,CAAA;sBADV,WAAW;uBAAC,eAAe;;;MElGjB,2BAA2B,CAAA;8GAA3B,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA3B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YAH5B,8BAA8B,CAAA,EAAA,CAAA,CAAA;AAG7B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YAH5B,8BAA8B,CAAA,EAAA,CAAA,CAAA;;2FAG7B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBALvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;oBAChB,OAAO,EAAE,CAAC,8BAA8B,CAAC;AACzC,oBAAA,OAAO,EAAE,EAAE;AACZ,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"onemrvapublic-design-system-mat-multi-select.mjs","sources":["../../../../projects/onemrva/design-system/mat-multi-select/src/onemrva-mat-multi-select.component.ts","../../../../projects/onemrva/design-system/mat-multi-select/src/onemrva-mat-multi-select.component.html","../../../../projects/onemrva/design-system/mat-multi-select/src/onemrva-mat-multi-select.module.ts","../../../../projects/onemrva/design-system/mat-multi-select/onemrvapublic-design-system-mat-multi-select.ts"],"sourcesContent":["import {\n AfterContentChecked,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n forwardRef,\n HostBinding,\n inject,\n Input,\n OnDestroy,\n OnInit,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n FormControl,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { MatOption } from '@angular/material/core';\nimport {\n debounceTime,\n map,\n Observable,\n startWith,\n Subject,\n takeUntil,\n} from 'rxjs';\nimport { AsyncPipe, NgClass } from '@angular/common';\nimport { MatIcon } from '@angular/material/icon';\nimport { MatSelectModule } from '@angular/material/select';\n\nlet NEXT_ID = 0;\n\n@Component({\n selector: 'onemrva-mat-multi-select',\n templateUrl: 'onemrva-mat-multi-select.component.html',\n styleUrl: 'onemrva-mat-multi-select.component.scss',\n providers: [\n {\n provide: MatFormFieldControl,\n useExisting: OnemrvaMatMultiSelectComponent,\n multi: false,\n },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => OnemrvaMatMultiSelectComponent),\n multi: true,\n },\n ],\n imports: [\n NgClass,\n TranslatePipe,\n ReactiveFormsModule,\n MatSelectModule,\n AsyncPipe,\n MatIcon,\n ],\n standalone: true,\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class OnemrvaMatMultiSelectComponent\n extends MatFormFieldControl<any>\n implements OnInit, OnDestroy, AfterContentChecked\n{\n counter = 0;\n _values: any[] = [];\n public override stateChanges = new Subject<void>();\n\n @Input()\n multiple = true;\n\n @Input()\n formControl!: FormControl;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('attr.role')\n public role = 'select';\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('attr.aria-label')\n public label = '';\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('attr.aria-invalid')\n public invalid = false;\n\n @Input()\n showFilter = true;\n\n @Input()\n selectionToggle = true;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('attr.data-cy')\n public dataCy = `onemrva-mat-multi-select-${NEXT_ID++}`;\n\n searchFilter: FormControl = new FormControl<string>('');\n\n @ContentChildren(MatOption)\n matOptions: QueryList<MatOption> = new QueryList<MatOption>();\n matOptions$?: Observable<MatOption<any>[]>;\n onDestroy$: Subject<any> = new Subject<any>();\n\n @HostBinding('style.opacity')\n get opacity() {\n return this.disabled ? 0.25 : 1;\n }\n\n override focused = false;\n\n onFocus() {\n this.focused = true;\n this.stateChanges.next();\n }\n\n onBlur() {\n this.focused = false;\n this.stateChanges.next();\n }\n\n translate = inject(TranslateService);\n cd = inject(ChangeDetectorRef);\n\n constructor() {\n super();\n setTimeout(() => {\n this.focused = false;\n }, 3000);\n }\n\n // Function to call when the rating changes.\n onChange = (_values: any[]) => {\n //\n };\n\n // Function to call when the input is touched (when a star is clicked).\n onTouched = () => {\n //\n };\n\n // Allows Angular to update the model (rating).\n // Update the model and changes needed for the view here.\n writeValue(values: any[] | any | undefined | null): void {\n if (this.multiple) {\n this.counter = 0;\n if (Array.isArray(values)) this.counter = values.length;\n //else if (Array.isArray(this._values)) this.counter = this._values.length;\n }\n this._values = values;\n this.onChange(this._values);\n }\n\n // Allows Angular to register a function to call when the model (rating) changes.\n // Save the function as a property to call later here.\n registerOnChange(fn: (value: any[]) => void): void {\n this.onChange = fn;\n }\n\n // Allows Angular to register a function to call when the input has been touched.\n // Save the function as a property to call later here.\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n isAllSelected() {\n return this.counter === this.matOptions.length;\n }\n\n selectAll() {\n this._values = this.matOptions.map(option => {\n return option.value;\n });\n this.formControl.setValue(this._values);\n }\n\n isNoneSelected() {\n return this.counter === 0;\n }\n\n deselectAll(_$event: MouseEvent) {\n this._values = [];\n this.formControl.setValue(this._values);\n }\n\n onContainerClick(_event: MouseEvent): void {\n //\n }\n\n setDescribedByIds(_ids: string[]): void {\n //\n }\n\n ngOnDestroy(): void {\n this.onDestroy$.next('');\n this.onDestroy$.complete();\n }\n\n optionSize = 0;\n\n ngOnInit(): void {\n this.matOptions$ = this.searchFilter.valueChanges.pipe(\n debounceTime(200),\n startWith(''),\n map((value: string) => {\n this.optionSize = this.matOptions.length;\n if (this._values !== null) {\n this.counter = this._values.length;\n }\n if (value === '') {\n return this.matOptions.filter(_o => {\n return true;\n });\n }\n return this.matOptions.filter(option => {\n return option?._text?.nativeElement.innerHTML\n .toLowerCase()\n .includes(value.toLowerCase());\n });\n }),\n );\n this.formControl.valueChanges\n .pipe(takeUntil(this.onDestroy$))\n .subscribe(values => {\n this._values = values;\n this.counter = this._values.length;\n });\n }\n\n ngAfterContentChecked(): void {\n if (this.matOptions.length !== this.optionSize) {\n this.optionSize = this.matOptions.length;\n this.counter = 0;\n this.searchFilter.updateValueAndValidity({ emitEvent: true });\n }\n }\n}\n","<mat-select\n [multiple]=\"multiple\"\n [formControl]=\"formControl\"\n [attr.data-cy]=\"dataCy\"\n [attr.aria-label]=\"label\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n [placeholder]=\"'select.select.placeholder' | translate\"\n>\n @if (multiple && selectionToggle) {\n <div class=\"selection-choice text-right\">\n <a\n tabindex=\"1\"\n [ngClass]=\"{ 'mat-disabled': isAllSelected() }\"\n (click)=\"selectAll()\"\n >{{ 'select.select.all' | translate }}</a\n ><span class=\"separator\"> | </span>\n <a\n tabindex=\"2\"\n [ngClass]=\"{ 'mat-disabled': isNoneSelected() }\"\n (click)=\"deselectAll($event)\"\n >{{ 'select.deselect.all' | translate }}</a\n >\n </div>\n }\n <div class=\"option-list\">\n <!-- @if (showFilter) {\n <mat-option>\n <mat-select-search\n [formControl]=\"searchFilter\"\n ariaLabel=\"{{ 'select.search.filter' | translate }}\"\n noEntriesFoundLabel=\"{{ 'select.search.notFound' | translate }}\"\n placeholderLabel=\"{{ 'select.search.filter' | translate }}\"\n ></mat-select-search>\n </mat-option>\n } -->\n @for (matOption of matOptions$ | async; track matOption.value) {\n <ng-container>\n <mat-option\n [disabled]=\"matOption.disabled\"\n [value]=\"matOption.value\"\n [attr.data-cy]=\"matOption._getHostElement().dataset['cy']\"\n >\n {{ matOption._text?.nativeElement?.textContent }}\n </mat-option>\n </ng-container>\n }\n </div>\n</mat-select>\n@if (multiple && counter > 0) {\n <div class=\"mat-select-counter float-right position-absolute text-center\">\n <span class=\"text\">{{ counter }}</span\n ><mat-icon (click)=\"deselectAll($event)\">close</mat-icon>\n </div>\n}\n","import { NgModule } from '@angular/core';\nimport { OnemrvaMatMultiSelectComponent } from './onemrva-mat-multi-select.component';\n\n@NgModule({\n declarations: [],\n imports: [OnemrvaMatMultiSelectComponent],\n exports: [],\n})\nexport class OnemrvaMatMultiSelectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAkCA,IAAI,OAAO,GAAG,CAAC;AA6BT,MAAO,8BACX,SAAQ,mBAAwB,CAAA;AA0ChC,IAAA,IACI,OAAO,GAAA;QACT,OAAO,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC;;IAKjC,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;AACnB,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;;IAG1B,MAAM,GAAA;AACJ,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK;AACpB,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;;AAM1B,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QA5DT,IAAO,CAAA,OAAA,GAAG,CAAC;QACX,IAAO,CAAA,OAAA,GAAU,EAAE;AACH,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;QAGlD,IAAQ,CAAA,QAAA,GAAG,IAAI;;QAOR,IAAI,CAAA,IAAA,GAAG,QAAQ;;QAI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