@onemrvapublic/design-system 18.2.21-develop.2 → 18.2.21-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.
Files changed (24) hide show
  1. package/esm2022/layout/src/components/layout-route/layout-route.component.mjs +1 -3
  2. package/esm2022/mat-input-birthplace/src/onemrva-mat-input-birthplace.component.mjs +27 -15
  3. package/esm2022/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.mjs +7 -6
  4. package/esm2022/shared/index.mjs +2 -1
  5. package/esm2022/shared/src/lib/constants/constants.mjs +2 -1
  6. package/esm2022/shared/src/lib/services/country-lookup.service.mjs +11 -6
  7. package/esm2022/shared/src/lib/tokens/index.mjs +2 -0
  8. package/esm2022/shared/src/lib/tokens/lookup.token.mjs +7 -0
  9. package/fesm2022/onemrvapublic-design-system-layout.mjs +0 -2
  10. package/fesm2022/onemrvapublic-design-system-layout.mjs.map +1 -1
  11. package/fesm2022/onemrvapublic-design-system-mat-input-birthplace.mjs +25 -13
  12. package/fesm2022/onemrvapublic-design-system-mat-input-birthplace.mjs.map +1 -1
  13. package/fesm2022/onemrvapublic-design-system-mat-input-enterprise-number.mjs +6 -5
  14. package/fesm2022/onemrvapublic-design-system-mat-input-enterprise-number.mjs.map +1 -1
  15. package/fesm2022/onemrvapublic-design-system-shared.mjs +15 -5
  16. package/fesm2022/onemrvapublic-design-system-shared.mjs.map +1 -1
  17. package/mat-input-birthplace/src/onemrva-mat-input-birthplace.component.d.ts +4 -4
  18. package/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.d.ts +0 -1
  19. package/package.json +7 -7
  20. package/shared/index.d.ts +1 -0
  21. package/shared/src/lib/constants/constants.d.ts +1 -0
  22. package/shared/src/lib/services/country-lookup.service.d.ts +2 -2
  23. package/shared/src/lib/tokens/index.d.ts +1 -0
  24. package/shared/src/lib/tokens/lookup.token.d.ts +2 -0
@@ -12,7 +12,6 @@ import * as i5 from '@angular/material/select';
12
12
  import { MatSelectModule } from '@angular/material/select';
13
13
  import * as i8 from '@ngx-translate/core';
14
14
  import { TranslateModule } from '@ngx-translate/core';
15
- import { NgxMaskDirective } from 'ngx-mask';
16
15
  import { Subject, debounceTime, startWith, combineLatestWith, map, takeUntil, zip } from 'rxjs';
17
16
  import * as i9 from '@onemrvapublic/design-system/mat-select-search';
18
17
  import { MatSelectSearchModule } from '@onemrvapublic/design-system/mat-select-search';
@@ -98,10 +97,13 @@ class OnemrvaMatInputEnterpriseNumberComponent {
98
97
  if (countryFromCode) {
99
98
  this.getCountry.next(countryFromCode);
100
99
  number = countryFromCode.pattern.substring(0, 2) + number;
101
- this.formatEnterpriseNumber(countryFromCode);
100
+ //this.formatEnterpriseNumber(countryFromCode); /// done twice ?
102
101
  }
103
102
  this.number.setValue(number, { emitEvent: false });
104
103
  this.formatEnterpriseNumber(countryFromCode);
104
+ setTimeout(() => {
105
+ this.numberInput.nativeElement.focus();
106
+ }, 100);
105
107
  });
106
108
  });
107
109
  }
@@ -140,7 +142,7 @@ class OnemrvaMatInputEnterpriseNumberComponent {
140
142
  return 'input.vies.unknown.error';
141
143
  }
142
144
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OnemrvaMatInputEnterpriseNumberComponent, deps: [{ token: i1.OnemRvaCDNCountryService }], target: i0.ɵɵFactoryTarget.Component }); }
143
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: OnemrvaMatInputEnterpriseNumberComponent, isStandalone: true, selector: "onemrva-mat-input-enterprise-number", inputs: { readonly: "readonly", enterpriseNumber: "enterpriseNumber", label: "label", noEntriesFoundLabel: "noEntriesFoundLabel", placeholderLabel: "placeholderLabel", defaultCountry: "defaultCountry", searchAriaLabel: "searchAriaLabel", hint: "hint" }, outputs: { getCountry: "getCountry" }, viewQueries: [{ propertyName: "numberInput", first: true, predicate: ["numberInput"], descendants: true }], ngImport: i0, template: "<ng-container>\n <mat-form-field class=\"onemrva-input-enterprise-number\">\n <mat-label>{{ label }}</mat-label>\n <input\n (click)=\"handleClick($event)\"\n type=\"text\"\n matInput\n #numberInput\n placeholder=\"\"\n [formControl]=\"enterpriseNumber\"\n class=\"onemrva-text-enterprise-number\"\n [mask]=\"mask$ | async\"\n />\n <mat-select\n matTextPrefix\n class=\"onemrva-phone-number-select\"\n [formControl]=\"countryCode\"\n >\n <mat-select-trigger>\n <flag-icon [countryCode]=\"countryCode.getRawValue()\" />\n </mat-select-trigger>\n\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\n <mat-option\n *ngFor=\"let country of filteredCountries$ | async\"\n [value]=\"country.code\"\n >\n <flag-icon [countryCode]=\"country.code\" />&nbsp;&nbsp;{{ country.name }}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint !== ''\">{{ hint }}</mat-hint>\n <mat-error *ngIf=\"number.invalid\">{{ errors() | translate }}</mat-error>\n </mat-form-field>\n</ng-container>\n", styles: [".onemrva-input-enterprise-number mat-select{padding:0 0 0 8px}.onemrva-input-enterprise-number mat-select .mat-mdc-select-placeholder{width:1em!important;display:block!important}.onemrva-input-enterprise-number mat-select .mat-mdc-select-placeholder:before{width:1em!important;height:1em!important;background:#eee!important;visibility:visible!important;margin:10px 0!important}.onemrva-input-enterprise-number mat-select .mat-mdc-select-value{padding-right:8px}.onemrva-input-enterprise-number .onemrva-text-enterprise-number{padding-left:12px!important;vertical-align:middle}.onemrva-input-enterprise-number .mat-mdc-form-field-text-prefix mat-select{line-height:14px!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i5.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i8.TranslatePipe, name: "translate" }, { kind: "component", type: FlagIconComponent, selector: "flag-icon", inputs: ["countryCode", "mode", "width"] }, { kind: "directive", type: NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "showTemplate", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { kind: "ngmodule", type: MatSelectSearchModule }, { kind: "component", type: i9.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"] }], encapsulation: i0.ViewEncapsulation.None }); }
145
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: OnemrvaMatInputEnterpriseNumberComponent, isStandalone: true, selector: "onemrva-mat-input-enterprise-number", inputs: { readonly: "readonly", enterpriseNumber: "enterpriseNumber", label: "label", noEntriesFoundLabel: "noEntriesFoundLabel", placeholderLabel: "placeholderLabel", defaultCountry: "defaultCountry", searchAriaLabel: "searchAriaLabel", hint: "hint" }, outputs: { getCountry: "getCountry" }, viewQueries: [{ propertyName: "numberInput", first: true, predicate: ["numberInput"], descendants: true }], ngImport: i0, template: "<ng-container>\n <mat-form-field class=\"onemrva-input-enterprise-number\">\n <mat-label>{{ label }}</mat-label>\n <input\n (click)=\"handleClick($event)\"\n type=\"text\"\n matInput\n #numberInput\n placeholder=\"\"\n [formControl]=\"enterpriseNumber\"\n class=\"onemrva-text-enterprise-number\"\n />\n <mat-select\n matTextPrefix\n class=\"onemrva-phone-number-select\"\n [formControl]=\"countryCode\"\n >\n <mat-select-trigger>\n <flag-icon [countryCode]=\"countryCode.getRawValue()\" />\n </mat-select-trigger>\n\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\n <mat-option\n *ngFor=\"let country of filteredCountries$ | async\"\n [value]=\"country.code\"\n >\n <flag-icon [countryCode]=\"country.code\" />&nbsp;&nbsp;{{ country.name }}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint !== ''\">{{ hint }}</mat-hint>\n <mat-error *ngIf=\"number.invalid\">{{ errors() | translate }}</mat-error>\n </mat-form-field>\n</ng-container>\n", styles: [".onemrva-input-enterprise-number mat-select{padding:0 0 0 8px}.onemrva-input-enterprise-number mat-select .mat-mdc-select-placeholder{width:1em!important;display:block!important}.onemrva-input-enterprise-number mat-select .mat-mdc-select-placeholder:before{width:1em!important;height:1em!important;background:#eee!important;visibility:visible!important;margin:10px 0!important}.onemrva-input-enterprise-number mat-select .mat-mdc-select-value{padding-right:8px}.onemrva-input-enterprise-number .onemrva-text-enterprise-number{padding-left:12px!important;vertical-align:middle}.onemrva-input-enterprise-number .mat-mdc-form-field-text-prefix mat-select{line-height:14px!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i5.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i8.TranslatePipe, name: "translate" }, { kind: "component", type: FlagIconComponent, selector: "flag-icon", inputs: ["countryCode", "mode", "width"] }, { kind: "ngmodule", type: MatSelectSearchModule }, { kind: "component", type: i9.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"] }], encapsulation: i0.ViewEncapsulation.None }); }
144
146
  }
145
147
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OnemrvaMatInputEnterpriseNumberComponent, decorators: [{
146
148
  type: Component,
@@ -152,9 +154,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
152
154
  ReactiveFormsModule,
153
155
  TranslateModule,
154
156
  FlagIconComponent,
155
- NgxMaskDirective,
156
157
  MatSelectSearchModule,
157
- ], encapsulation: ViewEncapsulation.None, template: "<ng-container>\n <mat-form-field class=\"onemrva-input-enterprise-number\">\n <mat-label>{{ label }}</mat-label>\n <input\n (click)=\"handleClick($event)\"\n type=\"text\"\n matInput\n #numberInput\n placeholder=\"\"\n [formControl]=\"enterpriseNumber\"\n class=\"onemrva-text-enterprise-number\"\n [mask]=\"mask$ | async\"\n />\n <mat-select\n matTextPrefix\n class=\"onemrva-phone-number-select\"\n [formControl]=\"countryCode\"\n >\n <mat-select-trigger>\n <flag-icon [countryCode]=\"countryCode.getRawValue()\" />\n </mat-select-trigger>\n\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\n <mat-option\n *ngFor=\"let country of filteredCountries$ | async\"\n [value]=\"country.code\"\n >\n <flag-icon [countryCode]=\"country.code\" />&nbsp;&nbsp;{{ country.name }}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint !== ''\">{{ hint }}</mat-hint>\n <mat-error *ngIf=\"number.invalid\">{{ errors() | translate }}</mat-error>\n </mat-form-field>\n</ng-container>\n", styles: [".onemrva-input-enterprise-number mat-select{padding:0 0 0 8px}.onemrva-input-enterprise-number mat-select .mat-mdc-select-placeholder{width:1em!important;display:block!important}.onemrva-input-enterprise-number mat-select .mat-mdc-select-placeholder:before{width:1em!important;height:1em!important;background:#eee!important;visibility:visible!important;margin:10px 0!important}.onemrva-input-enterprise-number mat-select .mat-mdc-select-value{padding-right:8px}.onemrva-input-enterprise-number .onemrva-text-enterprise-number{padding-left:12px!important;vertical-align:middle}.onemrva-input-enterprise-number .mat-mdc-form-field-text-prefix mat-select{line-height:14px!important}\n"] }]
158
+ ], encapsulation: ViewEncapsulation.None, template: "<ng-container>\n <mat-form-field class=\"onemrva-input-enterprise-number\">\n <mat-label>{{ label }}</mat-label>\n <input\n (click)=\"handleClick($event)\"\n type=\"text\"\n matInput\n #numberInput\n placeholder=\"\"\n [formControl]=\"enterpriseNumber\"\n class=\"onemrva-text-enterprise-number\"\n />\n <mat-select\n matTextPrefix\n class=\"onemrva-phone-number-select\"\n [formControl]=\"countryCode\"\n >\n <mat-select-trigger>\n <flag-icon [countryCode]=\"countryCode.getRawValue()\" />\n </mat-select-trigger>\n\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\n <mat-option\n *ngFor=\"let country of filteredCountries$ | async\"\n [value]=\"country.code\"\n >\n <flag-icon [countryCode]=\"country.code\" />&nbsp;&nbsp;{{ country.name }}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint !== ''\">{{ hint }}</mat-hint>\n <mat-error *ngIf=\"number.invalid\">{{ errors() | translate }}</mat-error>\n </mat-form-field>\n</ng-container>\n", styles: [".onemrva-input-enterprise-number mat-select{padding:0 0 0 8px}.onemrva-input-enterprise-number mat-select .mat-mdc-select-placeholder{width:1em!important;display:block!important}.onemrva-input-enterprise-number mat-select .mat-mdc-select-placeholder:before{width:1em!important;height:1em!important;background:#eee!important;visibility:visible!important;margin:10px 0!important}.onemrva-input-enterprise-number mat-select .mat-mdc-select-value{padding-right:8px}.onemrva-input-enterprise-number .onemrva-text-enterprise-number{padding-left:12px!important;vertical-align:middle}.onemrva-input-enterprise-number .mat-mdc-form-field-text-prefix mat-select{line-height:14px!important}\n"] }]
158
159
  }], ctorParameters: () => [{ type: i1.OnemRvaCDNCountryService }], propDecorators: { readonly: [{
159
160
  type: Input
160
161
  }], enterpriseNumber: [{
@@ -1 +1 @@
1
- {"version":3,"file":"onemrvapublic-design-system-mat-input-enterprise-number.mjs","sources":["../../../../projects/onemrva/design-system/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.ts","../../../../projects/onemrva/design-system/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.html","../../../../projects/onemrva/design-system/mat-input-enterprise-number/index.ts","../../../../projects/onemrva/design-system/mat-input-enterprise-number/onemrvapublic-design-system-mat-input-enterprise-number.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { FormControl, ReactiveFormsModule, Validators } 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 { NgxMaskDirective } from 'ngx-mask';\nimport {\n combineLatestWith,\n debounceTime,\n map,\n Observable,\n startWith,\n Subject,\n takeUntil,\n zip,\n} from 'rxjs';\nimport { MatSelectSearchModule } from '@onemrvapublic/design-system/mat-select-search';\nimport {\n OnemRvaCDNCountryService,\n OnemrvaMaterialCountry,\n} from '@onemrvapublic/design-system/shared';\nimport { FlagIconComponent } from '@onemrvapublic/design-system/flag-icon';\n\n@Component({\n selector: 'onemrva-mat-input-enterprise-number',\n styleUrls: ['onemrva-mat-input-enterprise-number.component.scss'],\n templateUrl: 'onemrva-mat-input-enterprise-number.component.html',\n standalone: true,\n imports: [\n CommonModule,\n MatInputModule,\n MatFormFieldModule,\n MatSelectModule,\n ReactiveFormsModule,\n TranslateModule,\n FlagIconComponent,\n NgxMaskDirective,\n MatSelectSearchModule,\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OnemrvaMatInputEnterpriseNumberComponent\n implements OnInit, OnDestroy\n{\n @Input()\n readonly = false;\n\n @Input() enterpriseNumber!: FormControl;\n @Input() label = 'VIES';\n @Input() noEntriesFoundLabel = 'Not found';\n @Input() placeholderLabel = 'Search';\n @Input() defaultCountry = 'BE';\n @Input() searchAriaLabel = '';\n @Input() hint = '';\n @Output() getCountry = new EventEmitter<any>();\n @ViewChild('numberInput') numberInput!: ElementRef;\n\n countryCode: FormControl = new FormControl('');\n\n public filterCtrl: FormControl<string | null> = new FormControl<string>('');\n\n destroyNotifier$ = new Subject<void>();\n\n mask$!: Observable<string | undefined>;\n\n public countries$: Observable<OnemrvaMaterialCountry[]> =\n this.cdn.getCountriesByZone('EU');\n public filteredCountries$: Observable<OnemrvaMaterialCountry[]>;\n\n constructor(private cdn: OnemRvaCDNCountryService) {\n this.filteredCountries$ = this.filterCtrl.valueChanges.pipe(\n debounceTime(400),\n startWith(''),\n combineLatestWith(this.countries$),\n map(([search, countries]) => {\n return countries.filter((country: OnemrvaMaterialCountry) => {\n if (!search || search === '') return countries;\n if (country.name === undefined) return false;\n return country.name.toLowerCase().indexOf(search.toLowerCase()) > -1;\n });\n }),\n );\n }\n\n get number(): FormControl {\n return this.enterpriseNumber as FormControl;\n }\n\n private setCode(country: OnemrvaMaterialCountry | null) {\n this.clearValidators();\n if (country) {\n this.countryCode.setValue(country.code);\n this.formatEnterpriseNumber(country);\n }\n }\n\n ngOnInit(): void {\n this.number.valueChanges\n .pipe(\n startWith(this.number.getRawValue()),\n takeUntil(this.destroyNotifier$),\n )\n .subscribe(number => {\n if (number === '0') {\n this.cdn\n .findCountryFromCode(this.defaultCountry)\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(country => {\n if (country) {\n number = country.pattern.substring(0, 2) + number;\n this.number.setValue(number, { emitEvent: false });\n this.countryCode.setValue(country.code);\n } else {\n this.countryCode.setValue('');\n }\n });\n } else {\n if (number.length > 1) {\n this.cdn\n .findCountryFromVIESCode(number)\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(country => {\n if (country) {\n this.countryCode.setValue(country.code);\n }\n });\n }\n }\n });\n\n this.countryCode.valueChanges\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(value => {\n let number = this.number.getRawValue();\n zip(\n this.cdn.findCountryFromVIESCode(number),\n this.cdn.findCountryFromCode(value),\n ).subscribe(([countryFromVies, countryFromCode]) => {\n if (countryFromVies) {\n number = number.replace(\n countryFromVies.pattern.substring(0, 2),\n '',\n );\n }\n if (countryFromCode) {\n this.getCountry.next(countryFromCode);\n number = countryFromCode.pattern.substring(0, 2) + number;\n this.formatEnterpriseNumber(countryFromCode);\n }\n this.number.setValue(number, { emitEvent: false });\n this.formatEnterpriseNumber(countryFromCode);\n });\n });\n }\n\n private clearValidators() {\n let required = false;\n if (this.number.hasValidator(Validators.required)) {\n required = true;\n }\n this.number.clearValidators();\n if (required) {\n this.number.addValidators(Validators.required);\n }\n }\n\n private formatEnterpriseNumber(country: OnemrvaMaterialCountry | undefined) {\n this.clearValidators();\n if (this.countryCode.getRawValue() !== '' && country) {\n this.enterpriseNumber.addValidators(\n Validators.pattern(new RegExp(country.pattern)),\n );\n }\n }\n\n ngOnDestroy() {\n this.destroyNotifier$.next();\n this.destroyNotifier$.complete();\n }\n\n handleClick(e: any) {\n e.stopPropagation();\n }\n\n errors() {\n for (const k in this.number.errors) {\n if (k === 'required') {\n return 'input.vies.required';\n } else {\n return 'input.vies.invalid';\n }\n }\n return 'input.vies.unknown.error';\n }\n}\n","<ng-container>\n <mat-form-field class=\"onemrva-input-enterprise-number\">\n <mat-label>{{ label }}</mat-label>\n <input\n (click)=\"handleClick($event)\"\n type=\"text\"\n matInput\n #numberInput\n placeholder=\"\"\n [formControl]=\"enterpriseNumber\"\n class=\"onemrva-text-enterprise-number\"\n [mask]=\"mask$ | async\"\n />\n <mat-select\n matTextPrefix\n class=\"onemrva-phone-number-select\"\n [formControl]=\"countryCode\"\n >\n <mat-select-trigger>\n <flag-icon [countryCode]=\"countryCode.getRawValue()\" />\n </mat-select-trigger>\n\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\n <mat-option\n *ngFor=\"let country of filteredCountries$ | async\"\n [value]=\"country.code\"\n >\n <flag-icon [countryCode]=\"country.code\" />&nbsp;&nbsp;{{ country.name }}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint !== ''\">{{ hint }}</mat-hint>\n <mat-error *ngIf=\"number.invalid\">{{ errors() | translate }}</mat-error>\n </mat-form-field>\n</ng-container>\n","/*\n * Public API Surface of mat-bank-account-input\n */\n\nexport * from './src/onemrva-mat-input-enterprise-number.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAqDa,wCAAwC,CAAA;AA4BnD,IAAA,WAAA,CAAoB,GAA6B,EAAA;QAA7B,IAAG,CAAA,GAAA,GAAH,GAAG,CAA0B;QAxBjD,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;QAGR,IAAK,CAAA,KAAA,GAAG,MAAM,CAAC;QACf,IAAmB,CAAA,mBAAA,GAAG,WAAW,CAAC;QAClC,IAAgB,CAAA,gBAAA,GAAG,QAAQ,CAAC;QAC5B,IAAc,CAAA,cAAA,GAAG,IAAI,CAAC;QACtB,IAAe,CAAA,eAAA,GAAG,EAAE,CAAC;QACrB,IAAI,CAAA,IAAA,GAAG,EAAE,CAAC;AACT,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,YAAY,EAAO,CAAC;AAG/C,QAAA,IAAA,CAAA,WAAW,GAAgB,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;AAExC,QAAA,IAAA,CAAA,UAAU,GAA+B,IAAI,WAAW,CAAS,EAAE,CAAC,CAAC;AAE5E,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,OAAO,EAAQ,CAAC;QAIhC,IAAU,CAAA,UAAA,GACf,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAIlC,QAAA,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzD,YAAY,CAAC,GAAG,CAAC,EACjB,SAAS,CAAC,EAAE,CAAC,EACb,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,EAClC,GAAG,CAAC,CAAC,C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G,cAAc,EAAA,CAAA;sBAAtB,KAAK;gBACG,eAAe,EAAA,CAAA;sBAAvB,KAAK;gBACG,IAAI,EAAA,CAAA;sBAAZ,KAAK;gBACI,UAAU,EAAA,CAAA;sBAAnB,MAAM;gBACmB,WAAW,EAAA,CAAA;sBAApC,SAAS;uBAAC,aAAa,CAAA;;;AEnE1B;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"onemrvapublic-design-system-mat-input-enterprise-number.mjs","sources":["../../../../projects/onemrva/design-system/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.ts","../../../../projects/onemrva/design-system/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.html","../../../../projects/onemrva/design-system/mat-input-enterprise-number/index.ts","../../../../projects/onemrva/design-system/mat-input-enterprise-number/onemrvapublic-design-system-mat-input-enterprise-number.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { FormControl, ReactiveFormsModule, Validators } 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 combineLatestWith,\n debounceTime,\n map,\n Observable,\n startWith,\n Subject,\n takeUntil,\n zip,\n} from 'rxjs';\nimport { MatSelectSearchModule } from '@onemrvapublic/design-system/mat-select-search';\nimport {\n OnemRvaCDNCountryService,\n OnemrvaMaterialCountry,\n} from '@onemrvapublic/design-system/shared';\nimport { FlagIconComponent } from '@onemrvapublic/design-system/flag-icon';\n\n@Component({\n selector: 'onemrva-mat-input-enterprise-number',\n styleUrls: ['onemrva-mat-input-enterprise-number.component.scss'],\n templateUrl: 'onemrva-mat-input-enterprise-number.component.html',\n standalone: true,\n imports: [\n CommonModule,\n MatInputModule,\n MatFormFieldModule,\n MatSelectModule,\n ReactiveFormsModule,\n TranslateModule,\n FlagIconComponent,\n MatSelectSearchModule,\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class OnemrvaMatInputEnterpriseNumberComponent\n implements OnInit, OnDestroy\n{\n @Input()\n readonly = false;\n\n @Input() enterpriseNumber!: FormControl;\n @Input() label = 'VIES';\n @Input() noEntriesFoundLabel = 'Not found';\n @Input() placeholderLabel = 'Search';\n @Input() defaultCountry = 'BE';\n @Input() searchAriaLabel = '';\n @Input() hint = '';\n @Output() getCountry = new EventEmitter<any>();\n @ViewChild('numberInput') numberInput!: ElementRef;\n\n countryCode: FormControl = new FormControl('');\n\n public filterCtrl: FormControl<string | null> = new FormControl<string>('');\n\n destroyNotifier$ = new Subject<void>();\n\n public countries$: Observable<OnemrvaMaterialCountry[]> =\n this.cdn.getCountriesByZone('EU');\n public filteredCountries$: Observable<OnemrvaMaterialCountry[]>;\n\n constructor(private cdn: OnemRvaCDNCountryService) {\n this.filteredCountries$ = this.filterCtrl.valueChanges.pipe(\n debounceTime(400),\n startWith(''),\n combineLatestWith(this.countries$),\n map(([search, countries]) => {\n return countries.filter((country: OnemrvaMaterialCountry) => {\n if (!search || search === '') return countries;\n if (country.name === undefined) return false;\n return country.name.toLowerCase().indexOf(search.toLowerCase()) > -1;\n });\n }),\n );\n }\n\n get number(): FormControl {\n return this.enterpriseNumber as FormControl;\n }\n\n private setCode(country: OnemrvaMaterialCountry | null) {\n this.clearValidators();\n if (country) {\n this.countryCode.setValue(country.code);\n this.formatEnterpriseNumber(country);\n }\n }\n\n ngOnInit(): void {\n this.number.valueChanges\n .pipe(\n startWith(this.number.getRawValue()),\n takeUntil(this.destroyNotifier$),\n )\n .subscribe(number => {\n if (number === '0') {\n this.cdn\n .findCountryFromCode(this.defaultCountry)\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(country => {\n if (country) {\n number = country.pattern.substring(0, 2) + number;\n this.number.setValue(number, { emitEvent: false });\n this.countryCode.setValue(country.code);\n } else {\n this.countryCode.setValue('');\n }\n });\n } else {\n if (number.length > 1) {\n this.cdn\n .findCountryFromVIESCode(number)\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(country => {\n if (country) {\n this.countryCode.setValue(country.code);\n }\n });\n }\n }\n });\n\n this.countryCode.valueChanges\n .pipe(takeUntil(this.destroyNotifier$))\n .subscribe(value => {\n let number = this.number.getRawValue();\n zip(\n this.cdn.findCountryFromVIESCode(number),\n this.cdn.findCountryFromCode(value),\n ).subscribe(([countryFromVies, countryFromCode]) => {\n if (countryFromVies) {\n number = number.replace(\n countryFromVies.pattern.substring(0, 2),\n '',\n );\n }\n if (countryFromCode) {\n this.getCountry.next(countryFromCode);\n number = countryFromCode.pattern.substring(0, 2) + number;\n //this.formatEnterpriseNumber(countryFromCode); /// done twice ?\n }\n this.number.setValue(number, { emitEvent: false });\n this.formatEnterpriseNumber(countryFromCode);\n setTimeout(() => {\n this.numberInput.nativeElement.focus();\n }, 100);\n });\n });\n }\n\n private clearValidators() {\n let required = false;\n if (this.number.hasValidator(Validators.required)) {\n required = true;\n }\n this.number.clearValidators();\n if (required) {\n this.number.addValidators(Validators.required);\n }\n }\n\n private formatEnterpriseNumber(country: OnemrvaMaterialCountry | undefined) {\n this.clearValidators();\n if (this.countryCode.getRawValue() !== '' && country) {\n this.enterpriseNumber.addValidators(\n Validators.pattern(new RegExp(country.pattern)),\n );\n }\n }\n\n ngOnDestroy() {\n this.destroyNotifier$.next();\n this.destroyNotifier$.complete();\n }\n\n handleClick(e: any) {\n e.stopPropagation();\n }\n\n errors() {\n for (const k in this.number.errors) {\n if (k === 'required') {\n return 'input.vies.required';\n } else {\n return 'input.vies.invalid';\n }\n }\n return 'input.vies.unknown.error';\n }\n}\n","<ng-container>\n <mat-form-field class=\"onemrva-input-enterprise-number\">\n <mat-label>{{ label }}</mat-label>\n <input\n (click)=\"handleClick($event)\"\n type=\"text\"\n matInput\n #numberInput\n placeholder=\"\"\n [formControl]=\"enterpriseNumber\"\n class=\"onemrva-text-enterprise-number\"\n />\n <mat-select\n matTextPrefix\n class=\"onemrva-phone-number-select\"\n [formControl]=\"countryCode\"\n >\n <mat-select-trigger>\n <flag-icon [countryCode]=\"countryCode.getRawValue()\" />\n </mat-select-trigger>\n\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\n <mat-option\n *ngFor=\"let country of filteredCountries$ | async\"\n [value]=\"country.code\"\n >\n <flag-icon [countryCode]=\"country.code\" />&nbsp;&nbsp;{{ country.name }}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint !== ''\">{{ hint }}</mat-hint>\n <mat-error *ngIf=\"number.invalid\">{{ errors() | translate }}</mat-error>\n </mat-form-field>\n</ng-container>\n","/*\n * Public API Surface of mat-bank-account-input\n */\n\nexport * from './src/onemrva-mat-input-enterprise-number.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;MAmDa,wCAAwC,CAAA;AA0BnD,IAAA,WAAA,CAAoB,GAA6B,EAAA;QAA7B,IAAG,CAAA,GAAA,GAAH,GAAG,CAA0B;QAtBjD,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;QAGR,IAAK,CAAA,KAAA,GAAG,MAAM,CAAC;QACf,IAAmB,CAAA,mBAAA,GAAG,WAAW,CAAC;QAClC,IAAgB,CAAA,gBAAA,GAAG,QAAQ,CAAC;QAC5B,IAAc,CAAA,cAAA,GAAG,IAAI,CAAC;QACtB,IAAe,CAAA,eAAA,GAAG,EAAE,CAAC;QACrB,IAAI,CAAA,IAAA,GAAG,EAAE,CAAC;AACT,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,YAAY,EAAO,CAAC;AAG/C,QAAA,IAAA,CAAA,WAAW,GAAgB,IAAI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ApC,SAAS;uBAAC,aAAa,CAAA;;;AEjE1B;;AAEG;;ACFH;;AAEG;;;;"}
@@ -44,6 +44,7 @@ const CDN_URLS = {
44
44
  val: 'https://cdn.servicesval.rvaonem.fgov.be',
45
45
  };
46
46
  const NISS_MASK = '000000/000-00';
47
+ const LOOKUP_COUNTRY_URL = 'https://services/lookupwpptservice/rest/lookup/getLookups?class=be.fgov.onerva.lookup.wppt.persistence.model.common.Country';
47
48
 
48
49
  const parseNativeDateFormats = [
49
50
  'ddMMyyyy',
@@ -950,12 +951,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
950
951
  }]
951
952
  }] });
952
953
 
954
+ const LOOKUP_COUNTRY_SERVICE_URL = new InjectionToken('LOOKUP_COUNTRY_SERVICE_URL', {
955
+ providedIn: 'root',
956
+ factory: () => LOOKUP_COUNTRY_URL,
957
+ });
958
+
953
959
  class CommonCountryLookupService {
954
- constructor(http) {
960
+ constructor(http, commonCountryServiceURL) {
955
961
  this.http = http;
956
- this.commonCountryServiceURL = 'http://services/lookupwpptservice/rest/lookup/getLookups?class=be.fgov.onerva.lookup.wppt.persistence.model.common.Country';
962
+ this.commonCountryServiceURL = commonCountryServiceURL;
957
963
  this._countries$ = new ReplaySubject(1);
958
964
  this._customersInitialized = false;
965
+ console.log(this.commonCountryServiceURL);
959
966
  }
960
967
  getCountries(refresh = false) {
961
968
  if (refresh || !this._customersInitialized) {
@@ -974,7 +981,7 @@ class CommonCountryLookupService {
974
981
  return country || null;
975
982
  }));
976
983
  }
977
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CommonCountryLookupService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
984
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CommonCountryLookupService, deps: [{ token: i1$3.HttpClient }, { token: LOOKUP_COUNTRY_SERVICE_URL }], target: i0.ɵɵFactoryTarget.Injectable }); }
978
985
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CommonCountryLookupService, providedIn: 'root' }); }
979
986
  }
980
987
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CommonCountryLookupService, decorators: [{
@@ -982,7 +989,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
982
989
  args: [{
983
990
  providedIn: 'root',
984
991
  }]
985
- }], ctorParameters: () => [{ type: i1$3.HttpClient }] });
992
+ }], ctorParameters: () => [{ type: i1$3.HttpClient }, { type: undefined, decorators: [{
993
+ type: Inject,
994
+ args: [LOOKUP_COUNTRY_SERVICE_URL]
995
+ }] }] });
986
996
 
987
997
  class CacheService {
988
998
  setItem(key, item) {
@@ -1745,5 +1755,5 @@ function onemrvaDateLuxonYearMonthProvider() {
1745
1755
  * Generated bundle index. Do not edit.
1746
1756
  */
1747
1757
 
1748
- export { CDNUrlModeOptions, CDN_URLS, CDN_URL_MODE, ClipboardIconComponent, CommonCountryLookupService, DefaultStorage, DigitOnlyDirective, HttpRequestCache, IBAN_SUPPORTED_COUNTRIES, IfWidthIsDirective, MatRowClickableDirective, NISS_MASK, ONEMRVA_MAT_LUXON_DATE_FORMATS, ONEMRVA_MAT_LUXON_YEAR_MONTH_FORMATS, ONEMRVA_MAT_NATIVE_DATE_FORMAT, ONEMRVA_MAT_NATIVE_YEAR_MONTH_FORMAT, OnemRvaCDNCountryService, OnemRvaCDNMimeService, OnemRvaCDNService, OnemRvaClipboardDirective, OnemRvaColorDirective, OnemRvaIconRightDirective, OnemrvaBcePipe, OnemrvaLuxonDateAdapter, OnemrvaMaskDirective, OnemrvaNativeDateAdapter, OnemrvaNissPipe, OnemrvaSharedModule, OnemrvaTranslateCDNLoader, OnemrvaTranslateHttpLoader, OnemrvaValidators, RequestTimes, WebComponentOverlayContainer, bankAccountValidator, directives, onemrvaDateLuxonProvider, onemrvaDateLuxonYearMonthProvider, onemrvaDateNativeProvider, onemrvaDateNativeYearMonthProvider, setTranslationLanguage, setTranslationLanguageFromWO };
1758
+ export { CDNUrlModeOptions, CDN_URLS, CDN_URL_MODE, ClipboardIconComponent, CommonCountryLookupService, DefaultStorage, DigitOnlyDirective, HttpRequestCache, IBAN_SUPPORTED_COUNTRIES, IfWidthIsDirective, LOOKUP_COUNTRY_SERVICE_URL, LOOKUP_COUNTRY_URL, MatRowClickableDirective, NISS_MASK, ONEMRVA_MAT_LUXON_DATE_FORMATS, ONEMRVA_MAT_LUXON_YEAR_MONTH_FORMATS, ONEMRVA_MAT_NATIVE_DATE_FORMAT, ONEMRVA_MAT_NATIVE_YEAR_MONTH_FORMAT, OnemRvaCDNCountryService, OnemRvaCDNMimeService, OnemRvaCDNService, OnemRvaClipboardDirective, OnemRvaColorDirective, OnemRvaIconRightDirective, OnemrvaBcePipe, OnemrvaLuxonDateAdapter, OnemrvaMaskDirective, OnemrvaNativeDateAdapter, OnemrvaNissPipe, OnemrvaSharedModule, OnemrvaTranslateCDNLoader, OnemrvaTranslateHttpLoader, OnemrvaValidators, RequestTimes, WebComponentOverlayContainer, bankAccountValidator, directives, onemrvaDateLuxonProvider, onemrvaDateLuxonYearMonthProvider, onemrvaDateNativeProvider, onemrvaDateNativeYearMonthProvider, setTranslationLanguage, setTranslationLanguageFromWO };
1749
1759
  //# sourceMappingURL=onemrvapublic-design-system-shared.mjs.map