@onemrvapublic/design-system 18.1.3 → 18.2.0-develop.1
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/esm2022/layout/src/components/layout/layout.component.mjs +11 -4
- package/esm2022/mat-input-country/src/onemrva-mat-input-country.component.mjs +3 -3
- package/esm2022/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.mjs +3 -3
- package/esm2022/mat-input-phone/src/onemrva-mat-input-phone.component.mjs +3 -3
- package/esm2022/shared/index.mjs +13 -11
- package/esm2022/shared/src/lib/adapters/date.adapter.mjs +62 -0
- package/esm2022/shared/src/lib/adapters/index.mjs +2 -0
- package/esm2022/shared/src/lib/components/index.mjs +2 -0
- package/esm2022/shared/src/lib/constants/CDNUrlModeOptions.mjs +6 -0
- package/esm2022/shared/src/lib/constants/cdn.mjs +3 -0
- package/esm2022/shared/src/lib/constants/constants.mjs +6 -0
- package/esm2022/shared/src/lib/constants/date.format.mjs +12 -0
- package/esm2022/shared/src/lib/constants/index.mjs +5 -0
- package/esm2022/shared/src/lib/decorators/index.mjs +2 -0
- package/esm2022/shared/src/lib/helpers/index.mjs +2 -0
- package/esm2022/shared/src/lib/helpers/translation-helper.mjs +30 -0
- package/esm2022/shared/src/lib/loaders/index.mjs +3 -0
- package/esm2022/shared/src/lib/loaders/onemrva-translate-cdn-loader.mjs +15 -0
- package/esm2022/shared/src/lib/loaders/onemrva-translate-http-loader.mjs +30 -0
- package/esm2022/shared/src/lib/services/cdn.service.mjs +28 -68
- package/esm2022/shared/src/lib/services/country-cdn.service.mjs +72 -0
- package/esm2022/shared/src/lib/services/country-lookup.service.mjs +38 -0
- package/esm2022/shared/src/lib/services/index.mjs +3 -2
- package/esm2022/shared/src/lib/shared.datepicker.module.mjs +3 -3
- package/esm2022/shared/src/lib/validators/bank-account.validator.utils.mjs +45 -0
- package/esm2022/shared/src/lib/validators/index.mjs +3 -0
- package/fesm2022/onemrvapublic-design-system-layout.mjs +10 -3
- package/fesm2022/onemrvapublic-design-system-layout.mjs.map +1 -1
- package/fesm2022/onemrvapublic-design-system-mat-input-country.mjs +2 -2
- package/fesm2022/onemrvapublic-design-system-mat-input-country.mjs.map +1 -1
- package/fesm2022/onemrvapublic-design-system-mat-input-enterprise-number.mjs +2 -2
- package/fesm2022/onemrvapublic-design-system-mat-input-enterprise-number.mjs.map +1 -1
- package/fesm2022/onemrvapublic-design-system-mat-input-phone.mjs +2 -2
- package/fesm2022/onemrvapublic-design-system-mat-input-phone.mjs.map +1 -1
- package/fesm2022/onemrvapublic-design-system-shared.mjs +591 -490
- package/fesm2022/onemrvapublic-design-system-shared.mjs.map +1 -1
- package/layout/src/components/layout/layout.component.scss +1 -1
- package/mat-input-country/src/onemrva-mat-input-country.component.d.ts +2 -2
- package/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.d.ts +2 -2
- package/mat-input-phone/src/onemrva-mat-input-phone.component.d.ts +2 -2
- package/package.json +1 -1
- package/shared/index.d.ts +12 -10
- package/shared/src/lib/adapters/index.d.ts +1 -0
- package/shared/src/lib/components/index.d.ts +1 -0
- package/shared/src/lib/{constants.d.ts → constants/constants.d.ts} +1 -0
- package/shared/src/lib/constants/index.d.ts +4 -0
- package/shared/src/lib/decorators/index.d.ts +1 -0
- package/shared/src/lib/helpers/index.d.ts +1 -0
- package/shared/src/lib/helpers/translation-helper.d.ts +2 -0
- package/shared/src/lib/loaders/index.d.ts +2 -0
- package/shared/src/lib/loaders/onemrva-translate-cdn-loader.d.ts +14 -0
- package/shared/src/lib/loaders/onemrva-translate-http-loader.d.ts +14 -0
- package/shared/src/lib/services/cdn.service.d.ts +7 -86
- package/shared/src/lib/services/country-cdn.service.d.ts +89 -0
- package/shared/src/lib/services/{commonCountryLookup.service.d.ts → country-lookup.service.d.ts} +1 -1
- package/shared/src/lib/services/index.d.ts +2 -1
- package/shared/src/lib/validators/index.d.ts +2 -0
- package/esm2022/shared/src/lib/CDNUrlModeOptions.mjs +0 -6
- package/esm2022/shared/src/lib/OnemrvaDateAdapter.mjs +0 -62
- package/esm2022/shared/src/lib/constants.mjs +0 -5
- package/esm2022/shared/src/lib/date.format.mjs +0 -12
- package/esm2022/shared/src/lib/injectionTokens.mjs +0 -3
- package/esm2022/shared/src/lib/services/commonCountryLookup.service.mjs +0 -38
- package/esm2022/shared/src/lib/validators/bankAccountValidator.utils.mjs +0 -45
- /package/shared/src/lib/{OnemrvaDateAdapter.d.ts → adapters/date.adapter.d.ts} +0 -0
- /package/shared/src/lib/{CDNUrlModeOptions.d.ts → constants/CDNUrlModeOptions.d.ts} +0 -0
- /package/shared/src/lib/{injectionTokens.d.ts → constants/cdn.d.ts} +0 -0
- /package/shared/src/lib/{date.format.d.ts → constants/date.format.d.ts} +0 -0
- /package/shared/src/lib/validators/{bankAccountValidator.utils.d.ts → bank-account.validator.utils.d.ts} +0 -0
|
@@ -1,26 +1,321 @@
|
|
|
1
|
-
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
2
|
+
import { Injectable, Component, InjectionToken, Inject, Directive, HostListener, EventEmitter, Output, Input, HostBinding, Pipe, Optional, NgModule, APP_INITIALIZER } from '@angular/core';
|
|
3
|
+
import { NativeDateAdapter, MatNativeDateModule, MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
4
|
+
import { DateTime } from 'luxon';
|
|
5
|
+
import { Subject, takeUntil, merge, NEVER, take, tap, catchError, startWith, switchMap, shareReplay, filter, finalize, of, forkJoin, ReplaySubject, skip, distinctUntilChanged, map as map$1, combineLatestWith, from } from 'rxjs';
|
|
6
|
+
import * as i1 from '@ngx-translate/core';
|
|
7
|
+
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
6
8
|
import * as i2 from '@angular/material/icon';
|
|
7
9
|
import { MatIconModule } from '@angular/material/icon';
|
|
8
10
|
import * as i3 from '@angular/material/tooltip';
|
|
9
11
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
10
12
|
import * as i1$1 from '@angular/cdk/clipboard';
|
|
11
|
-
import {
|
|
12
|
-
import * as i1$2 from '@
|
|
13
|
-
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
14
|
-
import { LuxonDateModule } from '@angular/material-luxon-adapter';
|
|
15
|
-
import { Subject, takeUntil, of, ReplaySubject, skip, distinctUntilChanged, map, merge, NEVER, take, tap, catchError, startWith, switchMap, shareReplay, filter, finalize, combineLatestWith, from } from 'rxjs';
|
|
16
|
-
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
17
|
-
import { DateTime } from 'luxon';
|
|
18
|
-
import * as i1$3 from '@angular/common/http';
|
|
19
|
-
import { __decorate } from 'tslib';
|
|
20
|
-
import { startWith as startWith$1, map as map$1 } from 'rxjs/operators';
|
|
21
|
-
import * as i1$4 from '@angular/cdk/platform';
|
|
13
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
14
|
+
import * as i1$2 from '@angular/cdk/platform';
|
|
22
15
|
import { _isTestEnvironment } from '@angular/cdk/platform';
|
|
16
|
+
import { OnemrvaMatColor } from '@onemrvapublic/design-system/utils';
|
|
17
|
+
import * as i1$3 from '@angular/cdk/layout';
|
|
18
|
+
import { catchError as catchError$1, map, startWith as startWith$1 } from 'rxjs/operators';
|
|
19
|
+
import * as i1$4 from '@angular/common/http';
|
|
20
|
+
import { __decorate } from 'tslib';
|
|
23
21
|
import { countrySpecs, validateIBAN, electronicFormatIBAN, ValidationErrorsIBAN } from 'ibantools';
|
|
22
|
+
import { LuxonDateModule } from '@angular/material-luxon-adapter';
|
|
23
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
24
|
+
|
|
25
|
+
const ONEMRVA_FORMAT = {
|
|
26
|
+
parse: {
|
|
27
|
+
dateInput: 'LL',
|
|
28
|
+
},
|
|
29
|
+
display: {
|
|
30
|
+
dateInput: 'dd/MM/yyyy',
|
|
31
|
+
monthYearLabel: 'MMM yyyy',
|
|
32
|
+
dateA11yLabel: 'LL',
|
|
33
|
+
monthYearA11yLabel: 'MMMM yyyy',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
class OnemrvaDateAdapter extends NativeDateAdapter {
|
|
38
|
+
constructor(translateService) {
|
|
39
|
+
super();
|
|
40
|
+
this.translateService = translateService;
|
|
41
|
+
this.dateFormat = ONEMRVA_FORMAT.display.dateInput;
|
|
42
|
+
this.destroyNotifier$ = new Subject();
|
|
43
|
+
this.setLocale(this.translateService.currentLang);
|
|
44
|
+
this.translateService.onLangChange
|
|
45
|
+
.pipe(takeUntil(this.destroyNotifier$))
|
|
46
|
+
.subscribe(({ lang }) => {
|
|
47
|
+
this.setLocale(lang);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
format(date) {
|
|
51
|
+
const dt = DateTime.fromJSDate(date);
|
|
52
|
+
return dt.toFormat(this.dateFormat);
|
|
53
|
+
}
|
|
54
|
+
parse(value) {
|
|
55
|
+
if (value && typeof value === 'string') {
|
|
56
|
+
value = value.replace(/\D/g, '/');
|
|
57
|
+
}
|
|
58
|
+
if (value === null || value === '') {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const dt = DateTime.fromFormat(value, this.dateFormat, {
|
|
62
|
+
locale: this.locale,
|
|
63
|
+
});
|
|
64
|
+
if (dt.isValid) {
|
|
65
|
+
return dt.toJSDate();
|
|
66
|
+
}
|
|
67
|
+
const formats = ['ddMMyyyy', 'd/M/yyyy', 'dd/M/yyyy', 'd/MM/yyyy'];
|
|
68
|
+
for (const format of formats) {
|
|
69
|
+
const parsed = DateTime.fromFormat(value, format, {
|
|
70
|
+
locale: this.locale,
|
|
71
|
+
});
|
|
72
|
+
if (parsed.isValid) {
|
|
73
|
+
return parsed.toJSDate();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return this.invalid();
|
|
77
|
+
}
|
|
78
|
+
getFirstDayOfWeek() {
|
|
79
|
+
return 1;
|
|
80
|
+
}
|
|
81
|
+
ngOnDestroy() {
|
|
82
|
+
this.destroyNotifier$.next();
|
|
83
|
+
this.destroyNotifier$.complete();
|
|
84
|
+
}
|
|
85
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaDateAdapter, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
86
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaDateAdapter }); }
|
|
87
|
+
}
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaDateAdapter, decorators: [{
|
|
89
|
+
type: Injectable
|
|
90
|
+
}], ctorParameters: () => [{ type: i1.TranslateService }] });
|
|
91
|
+
|
|
92
|
+
class ClipboardIconComponent {
|
|
93
|
+
constructor(_elementRef, clipboardService) {
|
|
94
|
+
this._elementRef = _elementRef;
|
|
95
|
+
this.clipboardService = clipboardService;
|
|
96
|
+
}
|
|
97
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ClipboardIconComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.Clipboard }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
98
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.5", type: ClipboardIconComponent, isStandalone: true, selector: "lib-clipboard-icon", ngImport: i0, template: "<mat-icon [matTooltip]=\"'TEST'\">content_copy</mat-icon>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
|
|
99
|
+
}
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ClipboardIconComponent, decorators: [{
|
|
101
|
+
type: Component,
|
|
102
|
+
args: [{ selector: 'lib-clipboard-icon', standalone: true, imports: [MatIconModule, MatTooltipModule], template: "<mat-icon [matTooltip]=\"'TEST'\">content_copy</mat-icon>\n" }]
|
|
103
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.Clipboard }] });
|
|
104
|
+
|
|
105
|
+
var CDNUrlModeOptions;
|
|
106
|
+
(function (CDNUrlModeOptions) {
|
|
107
|
+
CDNUrlModeOptions["PROD"] = "production";
|
|
108
|
+
CDNUrlModeOptions["VAL"] = "validation";
|
|
109
|
+
})(CDNUrlModeOptions || (CDNUrlModeOptions = {}));
|
|
110
|
+
|
|
111
|
+
const CDN_URLS = {
|
|
112
|
+
prod: 'https://cdn.services.rvaonem.fgov.be',
|
|
113
|
+
val: 'https://cdn.servicesval.rvaonem.fgov.be',
|
|
114
|
+
};
|
|
115
|
+
const NISS_MASK = '000000/000-00';
|
|
116
|
+
|
|
117
|
+
const CDN_URL_MODE = new InjectionToken('This is cdn url that will be used (val/prod)');
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @license
|
|
121
|
+
* Copyright Google LLC All Rights Reserved.
|
|
122
|
+
*
|
|
123
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
124
|
+
* found in the LICENSE file at https://angular.io/license
|
|
125
|
+
*/
|
|
126
|
+
/** Container inside which all overlays will render. */
|
|
127
|
+
class WebComponentOverlayContainer {
|
|
128
|
+
constructor(document, _platform) {
|
|
129
|
+
this._platform = _platform;
|
|
130
|
+
this._containerElement = null;
|
|
131
|
+
this._document = document;
|
|
132
|
+
}
|
|
133
|
+
ngOnDestroy() {
|
|
134
|
+
this._containerElement?.remove();
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* This method returns the overlay container element. It will lazily
|
|
138
|
+
* create the element the first time it is called to facilitate using
|
|
139
|
+
* the container in non-browser environments.
|
|
140
|
+
* @returns the container element
|
|
141
|
+
*/
|
|
142
|
+
getContainerElement() {
|
|
143
|
+
if (this._containerElement === null) {
|
|
144
|
+
this._createContainer();
|
|
145
|
+
}
|
|
146
|
+
return this._containerElement;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Create the overlay container element, which is simply a div
|
|
150
|
+
* with the 'cdk-overlay-container' class on the document body.
|
|
151
|
+
*/
|
|
152
|
+
_createContainer() {
|
|
153
|
+
const containerClass = 'cdk-overlay-container';
|
|
154
|
+
// module or Angular starts tearing down the testing `NgModule`. See:
|
|
155
|
+
// https://github.com/angular/angular/issues/18831
|
|
156
|
+
if (this._platform.isBrowser || _isTestEnvironment()) {
|
|
157
|
+
const oppositePlatformContainers = this._document.querySelectorAll(`.${containerClass}[platform="server"], ` +
|
|
158
|
+
`.${containerClass}[platform="test"]`);
|
|
159
|
+
// Remove any old containers from the opposite platform.
|
|
160
|
+
// This can happen when transitioning from the server to the client.
|
|
161
|
+
for (let i = 0; i < oppositePlatformContainers.length; i++) {
|
|
162
|
+
oppositePlatformContainers[i].remove();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
const containerwrap = this._document.createElement('div');
|
|
166
|
+
containerwrap.classList.add('onemrva-theme');
|
|
167
|
+
const container = this._document.createElement('div');
|
|
168
|
+
container.classList.add(containerClass);
|
|
169
|
+
// A long time ago we kept adding new overlay containers whenever a new app was instantiated,
|
|
170
|
+
// but at some point we added logic which clears the duplicate ones in order to avoid leaks.
|
|
171
|
+
// The new logic was a little too aggressive since it was breaking some legitimate use cases.
|
|
172
|
+
// To mitigate the problem we made it so that only containers from a different platform are
|
|
173
|
+
// cleared, but the side-effect was that people started depending on the overly-aggressive
|
|
174
|
+
// logic to clean up their tests for them. Until we can introduce an overlay-specific testing
|
|
175
|
+
// module which does the cleanup, we try to detect that we're in a test environment and we
|
|
176
|
+
// always clear the container. See #17006.
|
|
177
|
+
if (_isTestEnvironment()) {
|
|
178
|
+
container.setAttribute('platform', 'test');
|
|
179
|
+
}
|
|
180
|
+
else if (!this._platform.isBrowser) {
|
|
181
|
+
container.setAttribute('platform', 'server');
|
|
182
|
+
}
|
|
183
|
+
containerwrap.appendChild(container);
|
|
184
|
+
this._document.body.appendChild(containerwrap);
|
|
185
|
+
this._containerElement = container;
|
|
186
|
+
}
|
|
187
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: WebComponentOverlayContainer, deps: [{ token: DOCUMENT }, { token: i1$2.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
188
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: WebComponentOverlayContainer, providedIn: 'root' }); }
|
|
189
|
+
}
|
|
190
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: WebComponentOverlayContainer, decorators: [{
|
|
191
|
+
type: Injectable,
|
|
192
|
+
args: [{ providedIn: 'root' }]
|
|
193
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
194
|
+
type: Inject,
|
|
195
|
+
args: [DOCUMENT]
|
|
196
|
+
}] }, { type: i1$2.Platform }] });
|
|
197
|
+
|
|
198
|
+
class DefaultStorage {
|
|
199
|
+
constructor() {
|
|
200
|
+
this.storage = new Map();
|
|
201
|
+
}
|
|
202
|
+
getItem(key) {
|
|
203
|
+
return this.storage.get(key);
|
|
204
|
+
}
|
|
205
|
+
setItem(key, item) {
|
|
206
|
+
this.storage.set(key, item);
|
|
207
|
+
}
|
|
208
|
+
deleteItem(key) {
|
|
209
|
+
this.storage.delete(key);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
class RequestTimes {
|
|
213
|
+
constructor() {
|
|
214
|
+
this.storage = new Map();
|
|
215
|
+
}
|
|
216
|
+
getItem(key) {
|
|
217
|
+
return this.storage.get(key);
|
|
218
|
+
}
|
|
219
|
+
setItem(key, item) {
|
|
220
|
+
this.storage.set(key, item);
|
|
221
|
+
}
|
|
222
|
+
deleteItem(key) {
|
|
223
|
+
this.storage.delete(key);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const HttpRequestCache = (optionsHandler) => {
|
|
227
|
+
return (target, methodName, descriptor) => {
|
|
228
|
+
if (!(descriptor?.value instanceof Function)) {
|
|
229
|
+
throw Error(`'@HttpRequestCache' can be applied only to the class method which returns an Observable`);
|
|
230
|
+
}
|
|
231
|
+
const cacheKeyPrefix = `${target.constructor.name}_${methodName}`;
|
|
232
|
+
const originalMethod = descriptor.value;
|
|
233
|
+
const working = {};
|
|
234
|
+
let subscribers = 0;
|
|
235
|
+
descriptor.value = function (...args) {
|
|
236
|
+
const options = optionsHandler?.call(this, this, ...args);
|
|
237
|
+
if (!options?.storage && !target._____storage_____) {
|
|
238
|
+
target._____storage_____ = new DefaultStorage();
|
|
239
|
+
}
|
|
240
|
+
if (options?.ttl && !target._____ttl_storage_____) {
|
|
241
|
+
target._____ttl_storage_____ = new RequestTimes();
|
|
242
|
+
}
|
|
243
|
+
const storage = options?.storage ?? target._____storage_____;
|
|
244
|
+
const key = `${cacheKeyPrefix}_${JSON.stringify(args)}`;
|
|
245
|
+
let ttl = undefined;
|
|
246
|
+
if (options?.ttl) {
|
|
247
|
+
ttl = target._____ttl_storage_____.getItem(key);
|
|
248
|
+
if (!ttl) {
|
|
249
|
+
ttl = {
|
|
250
|
+
requestTime: Date.now(),
|
|
251
|
+
subject: new Subject(),
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
else if (ttl.requestTime + options.ttl <= Date.now()) {
|
|
255
|
+
working[key] = true;
|
|
256
|
+
ttl.requestTime = Date.now();
|
|
257
|
+
ttl.subject.next();
|
|
258
|
+
}
|
|
259
|
+
target._____ttl_storage_____.setItem(key, ttl);
|
|
260
|
+
}
|
|
261
|
+
const refreshOn = merge(options?.refreshOn ?? NEVER, ttl?.subject ?? NEVER);
|
|
262
|
+
return storage.getItem(key).pipe(take(1), tap(value => {
|
|
263
|
+
subscribers++;
|
|
264
|
+
if (value === null)
|
|
265
|
+
throw '';
|
|
266
|
+
}), catchError(() => {
|
|
267
|
+
const observable = refreshOn.pipe(startWith(true), switchMap(() => originalMethod.apply(this, [...args])), tap(() => {
|
|
268
|
+
delete working[key];
|
|
269
|
+
}), shareReplay({
|
|
270
|
+
bufferSize: 1,
|
|
271
|
+
refCount: options?.refCount ?? false,
|
|
272
|
+
windowTime: options?.windowTime ?? Infinity,
|
|
273
|
+
}), filter(() => {
|
|
274
|
+
return !working[key];
|
|
275
|
+
}), finalize(() => {
|
|
276
|
+
subscribers--;
|
|
277
|
+
if (subscribers === 0 && options?.refCount) {
|
|
278
|
+
storage.deleteItem(key);
|
|
279
|
+
target._____ttl_storage_____?.deleteItem(key);
|
|
280
|
+
}
|
|
281
|
+
}));
|
|
282
|
+
storage.setItem(key, observable);
|
|
283
|
+
return observable;
|
|
284
|
+
}));
|
|
285
|
+
// let observable = storage.getItem(key);
|
|
286
|
+
//
|
|
287
|
+
// if (!observable) {
|
|
288
|
+
//
|
|
289
|
+
// observable = refreshOn.pipe(
|
|
290
|
+
// startWith(true),
|
|
291
|
+
// switchMap(() => originalMethod.apply(this, [...args])),
|
|
292
|
+
// tap(() => {
|
|
293
|
+
// delete working[key];
|
|
294
|
+
// }),
|
|
295
|
+
// shareReplay({
|
|
296
|
+
// bufferSize: 1,
|
|
297
|
+
// refCount: options?.refCount ?? false,
|
|
298
|
+
// windowTime: options?.windowTime ?? Infinity,
|
|
299
|
+
// }),
|
|
300
|
+
// filter(() => {
|
|
301
|
+
// return !working[key];
|
|
302
|
+
// }),
|
|
303
|
+
// finalize(() => {
|
|
304
|
+
// subscribers--;
|
|
305
|
+
// if (subscribers === 0 && options?.refCount) {
|
|
306
|
+
// storage.deleteItem(key);
|
|
307
|
+
// (target as any)._____ttl_storage_____?.deleteItem(key);
|
|
308
|
+
// }
|
|
309
|
+
// })
|
|
310
|
+
// );
|
|
311
|
+
// storage.setItem(key, observable);
|
|
312
|
+
// }
|
|
313
|
+
// subscribers++;
|
|
314
|
+
// return observable;
|
|
315
|
+
};
|
|
316
|
+
return descriptor;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
24
319
|
|
|
25
320
|
class DigitOnlyDirective {
|
|
26
321
|
constructor() { }
|
|
@@ -163,7 +458,7 @@ class IfWidthIsDirective {
|
|
|
163
458
|
}
|
|
164
459
|
});
|
|
165
460
|
}
|
|
166
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: IfWidthIsDirective, deps: [{ token: i1.BreakpointObserver }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
461
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: IfWidthIsDirective, deps: [{ token: i1$3.BreakpointObserver }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
167
462
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.5", type: IfWidthIsDirective, selector: "[ifWidthIs]", inputs: { ifWidthIs: "ifWidthIs" }, ngImport: i0 }); }
|
|
168
463
|
}
|
|
169
464
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: IfWidthIsDirective, decorators: [{
|
|
@@ -171,7 +466,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
|
|
|
171
466
|
args: [{
|
|
172
467
|
selector: '[ifWidthIs]',
|
|
173
468
|
}]
|
|
174
|
-
}], ctorParameters: () => [{ type: i1.BreakpointObserver }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }], propDecorators: { ifWidthIs: [{
|
|
469
|
+
}], ctorParameters: () => [{ type: i1$3.BreakpointObserver }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }], propDecorators: { ifWidthIs: [{
|
|
175
470
|
type: Input
|
|
176
471
|
}] } });
|
|
177
472
|
|
|
@@ -432,19 +727,6 @@ function isAllowed(rule, character) {
|
|
|
432
727
|
return false;
|
|
433
728
|
}
|
|
434
729
|
|
|
435
|
-
class ClipboardIconComponent {
|
|
436
|
-
constructor(_elementRef, clipboardService) {
|
|
437
|
-
this._elementRef = _elementRef;
|
|
438
|
-
this.clipboardService = clipboardService;
|
|
439
|
-
}
|
|
440
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ClipboardIconComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.Clipboard }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
441
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.5", type: ClipboardIconComponent, isStandalone: true, selector: "lib-clipboard-icon", ngImport: i0, template: "<mat-icon [matTooltip]=\"'TEST'\">content_copy</mat-icon>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
|
|
442
|
-
}
|
|
443
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ClipboardIconComponent, decorators: [{
|
|
444
|
-
type: Component,
|
|
445
|
-
args: [{ selector: 'lib-clipboard-icon', standalone: true, imports: [MatIconModule, MatTooltipModule], template: "<mat-icon [matTooltip]=\"'TEST'\">content_copy</mat-icon>\n" }]
|
|
446
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.Clipboard }] });
|
|
447
|
-
|
|
448
730
|
/**
|
|
449
731
|
* Conditionally adds component to the tree if screen width matches at least one size in input
|
|
450
732
|
*/
|
|
@@ -510,160 +792,78 @@ const directives = [
|
|
|
510
792
|
OnemrvaMaskDirective,
|
|
511
793
|
];
|
|
512
794
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
}
|
|
518
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaSharedModule, decorators: [{
|
|
519
|
-
type: NgModule,
|
|
520
|
-
args: [{
|
|
521
|
-
declarations: [...directives],
|
|
522
|
-
imports: [CommonModule],
|
|
523
|
-
exports: [...directives, CommonModule],
|
|
524
|
-
}]
|
|
525
|
-
}] });
|
|
526
|
-
|
|
527
|
-
const ONEMRVA_FORMAT = {
|
|
528
|
-
parse: {
|
|
529
|
-
dateInput: 'LL',
|
|
530
|
-
},
|
|
531
|
-
display: {
|
|
532
|
-
dateInput: 'dd/MM/yyyy',
|
|
533
|
-
monthYearLabel: 'MMM yyyy',
|
|
534
|
-
dateA11yLabel: 'LL',
|
|
535
|
-
monthYearA11yLabel: 'MMMM yyyy',
|
|
536
|
-
},
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
class OnemrvaDateAdapter extends NativeDateAdapter {
|
|
540
|
-
constructor(translateService) {
|
|
541
|
-
super();
|
|
542
|
-
this.translateService = translateService;
|
|
543
|
-
this.dateFormat = ONEMRVA_FORMAT.display.dateInput;
|
|
544
|
-
this.destroyNotifier$ = new Subject();
|
|
545
|
-
this.setLocale(this.translateService.currentLang);
|
|
546
|
-
this.translateService.onLangChange
|
|
547
|
-
.pipe(takeUntil(this.destroyNotifier$))
|
|
548
|
-
.subscribe(({ lang }) => {
|
|
549
|
-
this.setLocale(lang);
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
format(date) {
|
|
553
|
-
const dt = DateTime.fromJSDate(date);
|
|
554
|
-
return dt.toFormat(this.dateFormat);
|
|
555
|
-
}
|
|
556
|
-
parse(value) {
|
|
557
|
-
if (value && typeof value === 'string') {
|
|
558
|
-
value = value.replace(/\D/g, '/');
|
|
559
|
-
}
|
|
560
|
-
if (value === null || value === '') {
|
|
561
|
-
return null;
|
|
562
|
-
}
|
|
563
|
-
const dt = DateTime.fromFormat(value, this.dateFormat, {
|
|
564
|
-
locale: this.locale,
|
|
795
|
+
function setTranslationLanguage(translateService, languages = ['en', 'fr', 'nl', 'de'], default_language = 'en') {
|
|
796
|
+
return async () => {
|
|
797
|
+
translateService.onLangChange.subscribe(value => {
|
|
798
|
+
localStorage.setItem('language', value.lang);
|
|
565
799
|
});
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
800
|
+
translateService.addLangs(languages);
|
|
801
|
+
let language = localStorage.getItem('language');
|
|
802
|
+
if (language === null || languages.indexOf(language) < 0) {
|
|
803
|
+
// getting language from browser
|
|
804
|
+
if (languages.indexOf(navigator.language) >= 0) {
|
|
805
|
+
language = navigator.language;
|
|
806
|
+
}
|
|
807
|
+
else {
|
|
808
|
+
// getting language from one of the browser's languages
|
|
809
|
+
for (const lng of navigator.languages) {
|
|
810
|
+
if (languages.indexOf(lng) >= 0) {
|
|
811
|
+
language = lng;
|
|
812
|
+
break;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
// getting default language
|
|
816
|
+
if (language === null || languages.indexOf(language) < 0) {
|
|
817
|
+
language = default_language;
|
|
818
|
+
}
|
|
576
819
|
}
|
|
577
820
|
}
|
|
578
|
-
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
|
|
821
|
+
await translateService.use(language).toPromise();
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
class OnemrvaTranslateCDNLoader {
|
|
826
|
+
constructor(cdn, projects = [], prefix = '/i18n/', suffix = '.json') {
|
|
827
|
+
this.cdn = cdn;
|
|
828
|
+
this.projects = projects;
|
|
829
|
+
this.prefix = prefix;
|
|
830
|
+
this.suffix = suffix;
|
|
582
831
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
832
|
+
/**
|
|
833
|
+
* Gets the translations from the server
|
|
834
|
+
*/
|
|
835
|
+
getTranslation(lang) {
|
|
836
|
+
return this.cdn.getTranslations(this.projects, lang, this.prefix, this.suffix);
|
|
586
837
|
}
|
|
587
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaDateAdapter, deps: [{ token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
588
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaDateAdapter }); }
|
|
589
838
|
}
|
|
590
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaDateAdapter, decorators: [{
|
|
591
|
-
type: Injectable
|
|
592
|
-
}], ctorParameters: () => [{ type: i1$2.TranslateService }] });
|
|
593
839
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
},
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
provide: MAT_DATE_FORMATS,
|
|
621
|
-
useValue: ONEMRVA_FORMAT,
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
provide: APP_INITIALIZER,
|
|
625
|
-
useFactory: translateDatepicker,
|
|
626
|
-
deps: [TranslateService, (DateAdapter)],
|
|
627
|
-
multi: true,
|
|
628
|
-
},
|
|
629
|
-
], imports: [MatDatepickerModule,
|
|
630
|
-
TranslateModule,
|
|
631
|
-
MatNativeDateModule,
|
|
632
|
-
LuxonDateModule] }); }
|
|
840
|
+
class OnemrvaTranslateHttpLoader {
|
|
841
|
+
constructor(http, prefix = '/assets/i18n/', suffix = '.json', modules = []) {
|
|
842
|
+
this.http = http;
|
|
843
|
+
this.prefix = prefix;
|
|
844
|
+
this.suffix = suffix;
|
|
845
|
+
this.modules = modules;
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Gets the translations from the server
|
|
849
|
+
*/
|
|
850
|
+
getTranslation(lang) {
|
|
851
|
+
const observables = [
|
|
852
|
+
this.http
|
|
853
|
+
.get(`${this.prefix}${lang}${this.suffix}`)
|
|
854
|
+
.pipe(catchError$1(() => of(null))),
|
|
855
|
+
...this.modules.map(m => {
|
|
856
|
+
this.http
|
|
857
|
+
.get(`${this.prefix}${m}/${lang}${this.suffix}`)
|
|
858
|
+
.pipe(catchError$1(() => of(null)));
|
|
859
|
+
//console.log(`${this.prefix}${m}/${lang}${this.suffix}`);
|
|
860
|
+
}),
|
|
861
|
+
];
|
|
862
|
+
return forkJoin(observables).pipe(map(all => {
|
|
863
|
+
return all.filter(v => !!v).reduce((s, c) => ({ ...s, ...c }), {});
|
|
864
|
+
}));
|
|
865
|
+
}
|
|
633
866
|
}
|
|
634
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaDatepickerSharedModule, decorators: [{
|
|
635
|
-
type: NgModule,
|
|
636
|
-
args: [{
|
|
637
|
-
declarations: [],
|
|
638
|
-
imports: [
|
|
639
|
-
MatDatepickerModule,
|
|
640
|
-
TranslateModule,
|
|
641
|
-
MatNativeDateModule,
|
|
642
|
-
LuxonDateModule,
|
|
643
|
-
],
|
|
644
|
-
exports: [],
|
|
645
|
-
providers: [
|
|
646
|
-
{
|
|
647
|
-
provide: MAT_DATE_LOCALE,
|
|
648
|
-
useValue: 'fr',
|
|
649
|
-
},
|
|
650
|
-
{
|
|
651
|
-
provide: DateAdapter,
|
|
652
|
-
useClass: OnemrvaDateAdapter,
|
|
653
|
-
},
|
|
654
|
-
{
|
|
655
|
-
provide: MAT_DATE_FORMATS,
|
|
656
|
-
useValue: ONEMRVA_FORMAT,
|
|
657
|
-
},
|
|
658
|
-
{
|
|
659
|
-
provide: APP_INITIALIZER,
|
|
660
|
-
useFactory: translateDatepicker,
|
|
661
|
-
deps: [TranslateService, (DateAdapter)],
|
|
662
|
-
multi: true,
|
|
663
|
-
},
|
|
664
|
-
],
|
|
665
|
-
}]
|
|
666
|
-
}] });
|
|
667
867
|
|
|
668
868
|
class OnemrvaBcePipe {
|
|
669
869
|
transform(value) {
|
|
@@ -701,81 +901,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
|
|
|
701
901
|
}]
|
|
702
902
|
}] });
|
|
703
903
|
|
|
704
|
-
class OnemrvaValidators {
|
|
705
|
-
static bceValidator(required = false, control) {
|
|
706
|
-
if (control.value === null || control.value.trim() === '') {
|
|
707
|
-
return !required ? null : { bceNull: true };
|
|
708
|
-
}
|
|
709
|
-
const bceCandidate = control.value.trim().replace(/\/|\.|-/g, '');
|
|
710
|
-
if (bceCandidate.length !== 10)
|
|
711
|
-
return { bceLengthError: { value: bceCandidate } };
|
|
712
|
-
if (Number.isNaN(+bceCandidate))
|
|
713
|
-
return { bceNan: { value: bceCandidate } };
|
|
714
|
-
return null;
|
|
715
|
-
}
|
|
716
|
-
static bce(required = false) {
|
|
717
|
-
return (control) => {
|
|
718
|
-
return this.bceValidator(required, control);
|
|
719
|
-
};
|
|
720
|
-
}
|
|
721
|
-
static nissValidator(required = false, control) {
|
|
722
|
-
if (control.value === null || control.value.trim() === '') {
|
|
723
|
-
return !required ? null : { nissNull: true };
|
|
724
|
-
}
|
|
725
|
-
const nissCandidate = control.value.trim().replace(/\/|\.|-/g, '');
|
|
726
|
-
if (nissCandidate.length !== 11) {
|
|
727
|
-
return { nissLengthError: { value: nissCandidate } };
|
|
728
|
-
}
|
|
729
|
-
if (Number.isNaN(+nissCandidate)) {
|
|
730
|
-
return { nissNan: { value: nissCandidate } };
|
|
731
|
-
}
|
|
732
|
-
// Niss day and year are actual values, the month can be different according to the logic below
|
|
733
|
-
// [20-32] & [40-52] => foreigners & temporary NISS values
|
|
734
|
-
// it is not necessary to check for the actual date to be valid
|
|
735
|
-
const checksumValue = nissCandidate.substring(9);
|
|
736
|
-
const nissNumbersToCheck = nissCandidate.substring(0, 9);
|
|
737
|
-
const isValidChecksumYear1900 = 97 - (+nissNumbersToCheck % 97) === +checksumValue;
|
|
738
|
-
const isValidChecksumYear2000 = 97 - (+`2${nissNumbersToCheck}` % 97) === +checksumValue;
|
|
739
|
-
if (!isValidChecksumYear1900 && !isValidChecksumYear2000) {
|
|
740
|
-
return { nissCheckDigitError: { value: nissCandidate } };
|
|
741
|
-
}
|
|
742
|
-
/*
|
|
743
|
-
Below checks aren't really necessary but are here to exclude even more potential errors
|
|
744
|
-
We could still improve this to include february days & 30 day months + the real potential ranges
|
|
745
|
-
*/
|
|
746
|
-
const monthString = nissCandidate.substring(2, 4);
|
|
747
|
-
const month = parseInt(monthString) - 1;
|
|
748
|
-
const real_month = (parseInt(monthString) % 20) - 1;
|
|
749
|
-
if (real_month > 11 || month > 51) {
|
|
750
|
-
return { nissInvalidMonth: { value: nissCandidate } };
|
|
751
|
-
}
|
|
752
|
-
const day = +nissCandidate.substring(4, 6);
|
|
753
|
-
if (day > 31) {
|
|
754
|
-
return { nissInvalidDate: { value: nissCandidate } };
|
|
755
|
-
}
|
|
756
|
-
return null;
|
|
757
|
-
}
|
|
758
|
-
static niss(required = false) {
|
|
759
|
-
return (control) => {
|
|
760
|
-
return this.nissValidator(required, control);
|
|
761
|
-
};
|
|
762
|
-
}
|
|
763
|
-
static nissOrBce(required = false) {
|
|
764
|
-
return (control) => {
|
|
765
|
-
if (control.value === null || control.value.trim() === '')
|
|
766
|
-
return !required ? null : { nissNull: true };
|
|
767
|
-
const nissCandidate = control.value.trim().replace(/\/|\.|-/g, '');
|
|
768
|
-
if (control.value.length === 11) {
|
|
769
|
-
return this.nissValidator(required, control);
|
|
770
|
-
}
|
|
771
|
-
else if (control.value.length === 10) {
|
|
772
|
-
return this.bceValidator(required, control);
|
|
773
|
-
}
|
|
774
|
-
return { lengthError: { value: nissCandidate } };
|
|
775
|
-
};
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
|
|
779
904
|
class CommonCountryLookupService {
|
|
780
905
|
constructor(http) {
|
|
781
906
|
this.http = http;
|
|
@@ -795,12 +920,12 @@ class CommonCountryLookupService {
|
|
|
795
920
|
return this._countries$.pipe(skip(+refresh), distinctUntilChanged());
|
|
796
921
|
}
|
|
797
922
|
getCountryByCode(code) {
|
|
798
|
-
return this._countries$.pipe(map(countries => {
|
|
923
|
+
return this._countries$.pipe(map$1(countries => {
|
|
799
924
|
const country = countries.find(country => country.code === code);
|
|
800
925
|
return country || null;
|
|
801
926
|
}));
|
|
802
927
|
}
|
|
803
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: CommonCountryLookupService, deps: [{ token: i1$
|
|
928
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: CommonCountryLookupService, deps: [{ token: i1$4.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
804
929
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: CommonCountryLookupService, providedIn: 'root' }); }
|
|
805
930
|
}
|
|
806
931
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: CommonCountryLookupService, decorators: [{
|
|
@@ -808,142 +933,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
|
|
|
808
933
|
args: [{
|
|
809
934
|
providedIn: 'root',
|
|
810
935
|
}]
|
|
811
|
-
}], ctorParameters: () => [{ type: i1$
|
|
812
|
-
|
|
813
|
-
const CDN_URL_MODE = new InjectionToken('This is cdn url that will be used (val/prod)');
|
|
814
|
-
|
|
815
|
-
var CDNUrlModeOptions;
|
|
816
|
-
(function (CDNUrlModeOptions) {
|
|
817
|
-
CDNUrlModeOptions["PROD"] = "production";
|
|
818
|
-
CDNUrlModeOptions["VAL"] = "validation";
|
|
819
|
-
})(CDNUrlModeOptions || (CDNUrlModeOptions = {}));
|
|
820
|
-
|
|
821
|
-
const CDN_URLS = {
|
|
822
|
-
prod: 'https://cdn.services.rvaonem.fgov.be',
|
|
823
|
-
val: 'https://cdn.servicesval.rvaonem.fgov.be',
|
|
824
|
-
};
|
|
825
|
-
|
|
826
|
-
class DefaultStorage {
|
|
827
|
-
constructor() {
|
|
828
|
-
this.storage = new Map();
|
|
829
|
-
}
|
|
830
|
-
getItem(key) {
|
|
831
|
-
return this.storage.get(key);
|
|
832
|
-
}
|
|
833
|
-
setItem(key, item) {
|
|
834
|
-
this.storage.set(key, item);
|
|
835
|
-
}
|
|
836
|
-
deleteItem(key) {
|
|
837
|
-
this.storage.delete(key);
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
class RequestTimes {
|
|
841
|
-
constructor() {
|
|
842
|
-
this.storage = new Map();
|
|
843
|
-
}
|
|
844
|
-
getItem(key) {
|
|
845
|
-
return this.storage.get(key);
|
|
846
|
-
}
|
|
847
|
-
setItem(key, item) {
|
|
848
|
-
this.storage.set(key, item);
|
|
849
|
-
}
|
|
850
|
-
deleteItem(key) {
|
|
851
|
-
this.storage.delete(key);
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
const HttpRequestCache = (optionsHandler) => {
|
|
855
|
-
return (target, methodName, descriptor) => {
|
|
856
|
-
if (!(descriptor?.value instanceof Function)) {
|
|
857
|
-
throw Error(`'@HttpRequestCache' can be applied only to the class method which returns an Observable`);
|
|
858
|
-
}
|
|
859
|
-
const cacheKeyPrefix = `${target.constructor.name}_${methodName}`;
|
|
860
|
-
const originalMethod = descriptor.value;
|
|
861
|
-
const working = {};
|
|
862
|
-
let subscribers = 0;
|
|
863
|
-
descriptor.value = function (...args) {
|
|
864
|
-
const options = optionsHandler?.call(this, this, ...args);
|
|
865
|
-
if (!options?.storage && !target._____storage_____) {
|
|
866
|
-
target._____storage_____ = new DefaultStorage();
|
|
867
|
-
}
|
|
868
|
-
if (options?.ttl && !target._____ttl_storage_____) {
|
|
869
|
-
target._____ttl_storage_____ = new RequestTimes();
|
|
870
|
-
}
|
|
871
|
-
const storage = options?.storage ?? target._____storage_____;
|
|
872
|
-
const key = `${cacheKeyPrefix}_${JSON.stringify(args)}`;
|
|
873
|
-
let ttl = undefined;
|
|
874
|
-
if (options?.ttl) {
|
|
875
|
-
ttl = target._____ttl_storage_____.getItem(key);
|
|
876
|
-
if (!ttl) {
|
|
877
|
-
ttl = {
|
|
878
|
-
requestTime: Date.now(),
|
|
879
|
-
subject: new Subject(),
|
|
880
|
-
};
|
|
881
|
-
}
|
|
882
|
-
else if (ttl.requestTime + options.ttl <= Date.now()) {
|
|
883
|
-
working[key] = true;
|
|
884
|
-
ttl.requestTime = Date.now();
|
|
885
|
-
ttl.subject.next();
|
|
886
|
-
}
|
|
887
|
-
target._____ttl_storage_____.setItem(key, ttl);
|
|
888
|
-
}
|
|
889
|
-
const refreshOn = merge(options?.refreshOn ?? NEVER, ttl?.subject ?? NEVER);
|
|
890
|
-
return storage.getItem(key).pipe(take(1), tap(value => {
|
|
891
|
-
subscribers++;
|
|
892
|
-
if (value === null)
|
|
893
|
-
throw '';
|
|
894
|
-
}), catchError(() => {
|
|
895
|
-
const observable = refreshOn.pipe(startWith(true), switchMap(() => originalMethod.apply(this, [...args])), tap(() => {
|
|
896
|
-
delete working[key];
|
|
897
|
-
}), shareReplay({
|
|
898
|
-
bufferSize: 1,
|
|
899
|
-
refCount: options?.refCount ?? false,
|
|
900
|
-
windowTime: options?.windowTime ?? Infinity,
|
|
901
|
-
}), filter(() => {
|
|
902
|
-
return !working[key];
|
|
903
|
-
}), finalize(() => {
|
|
904
|
-
subscribers--;
|
|
905
|
-
if (subscribers === 0 && options?.refCount) {
|
|
906
|
-
storage.deleteItem(key);
|
|
907
|
-
target._____ttl_storage_____?.deleteItem(key);
|
|
908
|
-
}
|
|
909
|
-
}));
|
|
910
|
-
storage.setItem(key, observable);
|
|
911
|
-
return observable;
|
|
912
|
-
}));
|
|
913
|
-
// let observable = storage.getItem(key);
|
|
914
|
-
//
|
|
915
|
-
// if (!observable) {
|
|
916
|
-
//
|
|
917
|
-
// observable = refreshOn.pipe(
|
|
918
|
-
// startWith(true),
|
|
919
|
-
// switchMap(() => originalMethod.apply(this, [...args])),
|
|
920
|
-
// tap(() => {
|
|
921
|
-
// delete working[key];
|
|
922
|
-
// }),
|
|
923
|
-
// shareReplay({
|
|
924
|
-
// bufferSize: 1,
|
|
925
|
-
// refCount: options?.refCount ?? false,
|
|
926
|
-
// windowTime: options?.windowTime ?? Infinity,
|
|
927
|
-
// }),
|
|
928
|
-
// filter(() => {
|
|
929
|
-
// return !working[key];
|
|
930
|
-
// }),
|
|
931
|
-
// finalize(() => {
|
|
932
|
-
// subscribers--;
|
|
933
|
-
// if (subscribers === 0 && options?.refCount) {
|
|
934
|
-
// storage.deleteItem(key);
|
|
935
|
-
// (target as any)._____ttl_storage_____?.deleteItem(key);
|
|
936
|
-
// }
|
|
937
|
-
// })
|
|
938
|
-
// );
|
|
939
|
-
// storage.setItem(key, observable);
|
|
940
|
-
// }
|
|
941
|
-
// subscribers++;
|
|
942
|
-
// return observable;
|
|
943
|
-
};
|
|
944
|
-
return descriptor;
|
|
945
|
-
};
|
|
946
|
-
};
|
|
936
|
+
}], ctorParameters: () => [{ type: i1$4.HttpClient }] });
|
|
947
937
|
|
|
948
938
|
class CacheService {
|
|
949
939
|
constructor() { }
|
|
@@ -975,9 +965,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
|
|
|
975
965
|
}], ctorParameters: () => [] });
|
|
976
966
|
|
|
977
967
|
class OnemRvaCDNService {
|
|
978
|
-
constructor(cacheService,
|
|
968
|
+
constructor(cacheService, http, cdnUrlMode) {
|
|
979
969
|
this.cacheService = cacheService;
|
|
980
|
-
this.translateService = translateService;
|
|
981
970
|
this.http = http;
|
|
982
971
|
this.refresh$ = new Subject();
|
|
983
972
|
switch (cdnUrlMode) {
|
|
@@ -1003,8 +992,55 @@ class OnemRvaCDNService {
|
|
|
1003
992
|
fetch(endpoint) {
|
|
1004
993
|
return this.http.get(this.cdnUrl + endpoint);
|
|
1005
994
|
}
|
|
995
|
+
fetchNoCache(endpoint) {
|
|
996
|
+
return this.http.get(this.cdnUrl + endpoint);
|
|
997
|
+
}
|
|
998
|
+
getTranslations(projects, lang, prefix = '', suffix = '') {
|
|
999
|
+
const observables = [
|
|
1000
|
+
this.http
|
|
1001
|
+
.get(`${this.cdnUrl}${prefix}design-system/design-system/${lang}${suffix}`)
|
|
1002
|
+
.pipe(catchError$1(() => of({}))),
|
|
1003
|
+
...projects.map(m => {
|
|
1004
|
+
return this.http
|
|
1005
|
+
.get(`${this.cdnUrl}${prefix}${m}/${lang}${suffix}`)
|
|
1006
|
+
.pipe(catchError$1(() => {
|
|
1007
|
+
return of({});
|
|
1008
|
+
}));
|
|
1009
|
+
}),
|
|
1010
|
+
];
|
|
1011
|
+
return forkJoin(observables).pipe(map(all => {
|
|
1012
|
+
return all.filter(v => !!v).reduce((s, c) => ({ ...s, ...c }), {});
|
|
1013
|
+
}));
|
|
1014
|
+
}
|
|
1015
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemRvaCDNService, deps: [{ token: CacheService }, { token: i1$4.HttpClient }, { token: CDN_URL_MODE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1016
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemRvaCDNService, providedIn: 'root' }); }
|
|
1017
|
+
}
|
|
1018
|
+
__decorate([
|
|
1019
|
+
HttpRequestCache(cdnService => ({
|
|
1020
|
+
refreshOn: cdnService.refresh$,
|
|
1021
|
+
storage: cdnService.cacheService,
|
|
1022
|
+
ttl: 3600000,
|
|
1023
|
+
}))
|
|
1024
|
+
], OnemRvaCDNService.prototype, "fetch", null);
|
|
1025
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemRvaCDNService, decorators: [{
|
|
1026
|
+
type: Injectable,
|
|
1027
|
+
args: [{
|
|
1028
|
+
providedIn: 'root',
|
|
1029
|
+
}]
|
|
1030
|
+
}], ctorParameters: () => [{ type: CacheService }, { type: i1$4.HttpClient }, { type: CDNUrlModeOptions, decorators: [{
|
|
1031
|
+
type: Optional
|
|
1032
|
+
}, {
|
|
1033
|
+
type: Inject,
|
|
1034
|
+
args: [CDN_URL_MODE]
|
|
1035
|
+
}] }], propDecorators: { fetch: [] } });
|
|
1036
|
+
|
|
1037
|
+
class OnemRvaCDNCountryService {
|
|
1038
|
+
constructor(cdnService, translateService) {
|
|
1039
|
+
this.cdnService = cdnService;
|
|
1040
|
+
this.translateService = translateService;
|
|
1041
|
+
}
|
|
1006
1042
|
getCountries() {
|
|
1007
|
-
return this.fetch('/json/countries.json').pipe(combineLatestWith(from(this.translateService.onLangChange).pipe(startWith$1(this.translateService.currentLang))), map
|
|
1043
|
+
return this.cdnService.fetch('/json/countries.json').pipe(combineLatestWith(from(this.translateService.onLangChange).pipe(startWith$1(this.translateService.currentLang))), map(([response]) => {
|
|
1008
1044
|
return response
|
|
1009
1045
|
.slice()
|
|
1010
1046
|
.map(country => {
|
|
@@ -1024,7 +1060,7 @@ class OnemRvaCDNService {
|
|
|
1024
1060
|
}));
|
|
1025
1061
|
}
|
|
1026
1062
|
getCountriesByZone(zone) {
|
|
1027
|
-
return this.getCountries().pipe(map
|
|
1063
|
+
return this.getCountries().pipe(map(countries => {
|
|
1028
1064
|
return countries.filter(country => country.zone === zone);
|
|
1029
1065
|
}));
|
|
1030
1066
|
}
|
|
@@ -1038,128 +1074,106 @@ class OnemRvaCDNService {
|
|
|
1038
1074
|
return country.name;
|
|
1039
1075
|
}
|
|
1040
1076
|
findCountryFromCode(code) {
|
|
1041
|
-
return this.getCountries().pipe(map
|
|
1077
|
+
return this.getCountries().pipe(map(countries => {
|
|
1042
1078
|
return countries.find((country) => country.code.toLowerCase() === code.toLowerCase());
|
|
1043
1079
|
}));
|
|
1044
1080
|
}
|
|
1045
1081
|
findCountryFromVIESCode(code) {
|
|
1046
|
-
|
|
1047
|
-
return this.getCountriesByZone('EU').pipe(map$1(countries => {
|
|
1082
|
+
return this.getCountriesByZone('EU').pipe(map(countries => {
|
|
1048
1083
|
return countries.find((country) => country.pattern.substring(0, 2) === code.substring(0, 2));
|
|
1049
1084
|
}));
|
|
1050
1085
|
}
|
|
1051
1086
|
findCountryFromPrefix(number) {
|
|
1052
|
-
|
|
1053
|
-
return this.getCountries().pipe(map$1(countries => {
|
|
1087
|
+
return this.getCountries().pipe(map(countries => {
|
|
1054
1088
|
return countries.find((country) => {
|
|
1055
|
-
console.log('--------------------------------');
|
|
1056
|
-
console.log(country.dial_code);
|
|
1057
|
-
console.log(number.substring(0, country.dial_code.length));
|
|
1058
|
-
console.log('--------------------------------');
|
|
1059
1089
|
return (country.dial_code === number.substring(0, country.dial_code.length));
|
|
1060
1090
|
});
|
|
1061
1091
|
}));
|
|
1062
1092
|
}
|
|
1063
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type:
|
|
1064
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type:
|
|
1093
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemRvaCDNCountryService, deps: [{ token: OnemRvaCDNService }, { token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1094
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemRvaCDNCountryService, providedIn: 'root' }); }
|
|
1065
1095
|
}
|
|
1066
|
-
|
|
1067
|
-
HttpRequestCache(cdnService => ({
|
|
1068
|
-
refreshOn: cdnService.refresh$,
|
|
1069
|
-
storage: cdnService.cacheService,
|
|
1070
|
-
ttl: 3600000,
|
|
1071
|
-
}))
|
|
1072
|
-
], OnemRvaCDNService.prototype, "fetch", null);
|
|
1073
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemRvaCDNService, decorators: [{
|
|
1096
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemRvaCDNCountryService, decorators: [{
|
|
1074
1097
|
type: Injectable,
|
|
1075
1098
|
args: [{
|
|
1076
1099
|
providedIn: 'root',
|
|
1077
1100
|
}]
|
|
1078
|
-
}], ctorParameters: () => [{ type:
|
|
1079
|
-
type: Optional
|
|
1080
|
-
}, {
|
|
1081
|
-
type: Inject,
|
|
1082
|
-
args: [CDN_URL_MODE]
|
|
1083
|
-
}] }], propDecorators: { fetch: [] } });
|
|
1101
|
+
}], ctorParameters: () => [{ type: OnemRvaCDNService }, { type: i1.TranslateService }] });
|
|
1084
1102
|
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
this._containerElement = null;
|
|
1097
|
-
this._document = document;
|
|
1103
|
+
class OnemrvaValidators {
|
|
1104
|
+
static bceValidator(required = false, control) {
|
|
1105
|
+
if (control.value === null || control.value.trim() === '') {
|
|
1106
|
+
return !required ? null : { bceNull: true };
|
|
1107
|
+
}
|
|
1108
|
+
const bceCandidate = control.value.trim().replace(/\/|\.|-/g, '');
|
|
1109
|
+
if (bceCandidate.length !== 10)
|
|
1110
|
+
return { bceLengthError: { value: bceCandidate } };
|
|
1111
|
+
if (Number.isNaN(+bceCandidate))
|
|
1112
|
+
return { bceNan: { value: bceCandidate } };
|
|
1113
|
+
return null;
|
|
1098
1114
|
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1115
|
+
static bce(required = false) {
|
|
1116
|
+
return (control) => {
|
|
1117
|
+
return this.bceValidator(required, control);
|
|
1118
|
+
};
|
|
1101
1119
|
}
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
* the container in non-browser environments.
|
|
1106
|
-
* @returns the container element
|
|
1107
|
-
*/
|
|
1108
|
-
getContainerElement() {
|
|
1109
|
-
if (this._containerElement === null) {
|
|
1110
|
-
this._createContainer();
|
|
1120
|
+
static nissValidator(required = false, control) {
|
|
1121
|
+
if (control.value === null || control.value.trim() === '') {
|
|
1122
|
+
return !required ? null : { nissNull: true };
|
|
1111
1123
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
* Create the overlay container element, which is simply a div
|
|
1116
|
-
* with the 'cdk-overlay-container' class on the document body.
|
|
1117
|
-
*/
|
|
1118
|
-
_createContainer() {
|
|
1119
|
-
const containerClass = 'cdk-overlay-container';
|
|
1120
|
-
// module or Angular starts tearing down the testing `NgModule`. See:
|
|
1121
|
-
// https://github.com/angular/angular/issues/18831
|
|
1122
|
-
if (this._platform.isBrowser || _isTestEnvironment()) {
|
|
1123
|
-
const oppositePlatformContainers = this._document.querySelectorAll(`.${containerClass}[platform="server"], ` +
|
|
1124
|
-
`.${containerClass}[platform="test"]`);
|
|
1125
|
-
// Remove any old containers from the opposite platform.
|
|
1126
|
-
// This can happen when transitioning from the server to the client.
|
|
1127
|
-
for (let i = 0; i < oppositePlatformContainers.length; i++) {
|
|
1128
|
-
oppositePlatformContainers[i].remove();
|
|
1129
|
-
}
|
|
1124
|
+
const nissCandidate = control.value.trim().replace(/\/|\.|-/g, '');
|
|
1125
|
+
if (nissCandidate.length !== 11) {
|
|
1126
|
+
return { nissLengthError: { value: nissCandidate } };
|
|
1130
1127
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
const container = this._document.createElement('div');
|
|
1134
|
-
container.classList.add(containerClass);
|
|
1135
|
-
// A long time ago we kept adding new overlay containers whenever a new app was instantiated,
|
|
1136
|
-
// but at some point we added logic which clears the duplicate ones in order to avoid leaks.
|
|
1137
|
-
// The new logic was a little too aggressive since it was breaking some legitimate use cases.
|
|
1138
|
-
// To mitigate the problem we made it so that only containers from a different platform are
|
|
1139
|
-
// cleared, but the side-effect was that people started depending on the overly-aggressive
|
|
1140
|
-
// logic to clean up their tests for them. Until we can introduce an overlay-specific testing
|
|
1141
|
-
// module which does the cleanup, we try to detect that we're in a test environment and we
|
|
1142
|
-
// always clear the container. See #17006.
|
|
1143
|
-
if (_isTestEnvironment()) {
|
|
1144
|
-
container.setAttribute('platform', 'test');
|
|
1128
|
+
if (Number.isNaN(+nissCandidate)) {
|
|
1129
|
+
return { nissNan: { value: nissCandidate } };
|
|
1145
1130
|
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1131
|
+
// Niss day and year are actual values, the month can be different according to the logic below
|
|
1132
|
+
// [20-32] & [40-52] => foreigners & temporary NISS values
|
|
1133
|
+
// it is not necessary to check for the actual date to be valid
|
|
1134
|
+
const checksumValue = nissCandidate.substring(9);
|
|
1135
|
+
const nissNumbersToCheck = nissCandidate.substring(0, 9);
|
|
1136
|
+
const isValidChecksumYear1900 = 97 - (+nissNumbersToCheck % 97) === +checksumValue;
|
|
1137
|
+
const isValidChecksumYear2000 = 97 - (+`2${nissNumbersToCheck}` % 97) === +checksumValue;
|
|
1138
|
+
if (!isValidChecksumYear1900 && !isValidChecksumYear2000) {
|
|
1139
|
+
return { nissCheckDigitError: { value: nissCandidate } };
|
|
1148
1140
|
}
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1141
|
+
/*
|
|
1142
|
+
Below checks aren't really necessary but are here to exclude even more potential errors
|
|
1143
|
+
We could still improve this to include february days & 30 day months + the real potential ranges
|
|
1144
|
+
*/
|
|
1145
|
+
const monthString = nissCandidate.substring(2, 4);
|
|
1146
|
+
const month = parseInt(monthString) - 1;
|
|
1147
|
+
const real_month = (parseInt(monthString) % 20) - 1;
|
|
1148
|
+
if (real_month > 11 || month > 51) {
|
|
1149
|
+
return { nissInvalidMonth: { value: nissCandidate } };
|
|
1150
|
+
}
|
|
1151
|
+
const day = +nissCandidate.substring(4, 6);
|
|
1152
|
+
if (day > 31) {
|
|
1153
|
+
return { nissInvalidDate: { value: nissCandidate } };
|
|
1154
|
+
}
|
|
1155
|
+
return null;
|
|
1156
|
+
}
|
|
1157
|
+
static niss(required = false) {
|
|
1158
|
+
return (control) => {
|
|
1159
|
+
return this.nissValidator(required, control);
|
|
1160
|
+
};
|
|
1161
|
+
}
|
|
1162
|
+
static nissOrBce(required = false) {
|
|
1163
|
+
return (control) => {
|
|
1164
|
+
if (control.value === null || control.value.trim() === '')
|
|
1165
|
+
return !required ? null : { nissNull: true };
|
|
1166
|
+
const nissCandidate = control.value.trim().replace(/\/|\.|-/g, '');
|
|
1167
|
+
if (control.value.length === 11) {
|
|
1168
|
+
return this.nissValidator(required, control);
|
|
1169
|
+
}
|
|
1170
|
+
else if (control.value.length === 10) {
|
|
1171
|
+
return this.bceValidator(required, control);
|
|
1172
|
+
}
|
|
1173
|
+
return { lengthError: { value: nissCandidate } };
|
|
1174
|
+
};
|
|
1152
1175
|
}
|
|
1153
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: WebComponentOverlayContainer, deps: [{ token: DOCUMENT }, { token: i1$4.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1154
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: WebComponentOverlayContainer, providedIn: 'root' }); }
|
|
1155
1176
|
}
|
|
1156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: WebComponentOverlayContainer, decorators: [{
|
|
1157
|
-
type: Injectable,
|
|
1158
|
-
args: [{ providedIn: 'root' }]
|
|
1159
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1160
|
-
type: Inject,
|
|
1161
|
-
args: [DOCUMENT]
|
|
1162
|
-
}] }, { type: i1$4.Platform }] });
|
|
1163
1177
|
|
|
1164
1178
|
const IBAN_SUPPORTED_COUNTRIES = Object.keys(countrySpecs);
|
|
1165
1179
|
const internValidateIban = (iban = '') => {
|
|
@@ -1205,14 +1219,101 @@ const bankAccountValidator = () => {
|
|
|
1205
1219
|
};
|
|
1206
1220
|
};
|
|
1207
1221
|
|
|
1222
|
+
class OnemrvaSharedModule {
|
|
1223
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaSharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1224
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaSharedModule, declarations: [DigitOnlyDirective, MatRowClickableDirective, OnemRvaClipboardDirective, OnemRvaIconRightDirective, IfWidthIsDirective, OnemRvaColorDirective, OnemrvaMaskDirective], imports: [CommonModule], exports: [DigitOnlyDirective, MatRowClickableDirective, OnemRvaClipboardDirective, OnemRvaIconRightDirective, IfWidthIsDirective, OnemRvaColorDirective, OnemrvaMaskDirective, CommonModule] }); }
|
|
1225
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaSharedModule, imports: [CommonModule, CommonModule] }); }
|
|
1226
|
+
}
|
|
1227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaSharedModule, decorators: [{
|
|
1228
|
+
type: NgModule,
|
|
1229
|
+
args: [{
|
|
1230
|
+
declarations: [...directives],
|
|
1231
|
+
imports: [CommonModule],
|
|
1232
|
+
exports: [...directives, CommonModule],
|
|
1233
|
+
}]
|
|
1234
|
+
}] });
|
|
1235
|
+
|
|
1236
|
+
function translateDatepicker(translateService, adapter) {
|
|
1237
|
+
return () => {
|
|
1238
|
+
// For some cosmic reason, return translateService.onLangChange().asObservable()) + pipe(tap()) does not work
|
|
1239
|
+
translateService.onLangChange.subscribe(event => {
|
|
1240
|
+
adapter.setLocale(event.lang);
|
|
1241
|
+
});
|
|
1242
|
+
// But this works fine...
|
|
1243
|
+
return of('sin (a +- b) = sin a . cos b +- cos a . sin b');
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
class OnemrvaDatepickerSharedModule {
|
|
1247
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaDatepickerSharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1248
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaDatepickerSharedModule, imports: [MatDatepickerModule,
|
|
1249
|
+
TranslateModule,
|
|
1250
|
+
MatNativeDateModule,
|
|
1251
|
+
LuxonDateModule] }); }
|
|
1252
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaDatepickerSharedModule, providers: [
|
|
1253
|
+
{
|
|
1254
|
+
provide: MAT_DATE_LOCALE,
|
|
1255
|
+
useValue: 'fr',
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
provide: DateAdapter,
|
|
1259
|
+
useClass: OnemrvaDateAdapter,
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
provide: MAT_DATE_FORMATS,
|
|
1263
|
+
useValue: ONEMRVA_FORMAT,
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
provide: APP_INITIALIZER,
|
|
1267
|
+
useFactory: translateDatepicker,
|
|
1268
|
+
deps: [TranslateService, (DateAdapter)],
|
|
1269
|
+
multi: true,
|
|
1270
|
+
},
|
|
1271
|
+
], imports: [MatDatepickerModule,
|
|
1272
|
+
TranslateModule,
|
|
1273
|
+
MatNativeDateModule,
|
|
1274
|
+
LuxonDateModule] }); }
|
|
1275
|
+
}
|
|
1276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: OnemrvaDatepickerSharedModule, decorators: [{
|
|
1277
|
+
type: NgModule,
|
|
1278
|
+
args: [{
|
|
1279
|
+
declarations: [],
|
|
1280
|
+
imports: [
|
|
1281
|
+
MatDatepickerModule,
|
|
1282
|
+
TranslateModule,
|
|
1283
|
+
MatNativeDateModule,
|
|
1284
|
+
LuxonDateModule,
|
|
1285
|
+
],
|
|
1286
|
+
exports: [],
|
|
1287
|
+
providers: [
|
|
1288
|
+
{
|
|
1289
|
+
provide: MAT_DATE_LOCALE,
|
|
1290
|
+
useValue: 'fr',
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
provide: DateAdapter,
|
|
1294
|
+
useClass: OnemrvaDateAdapter,
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
provide: MAT_DATE_FORMATS,
|
|
1298
|
+
useValue: ONEMRVA_FORMAT,
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
provide: APP_INITIALIZER,
|
|
1302
|
+
useFactory: translateDatepicker,
|
|
1303
|
+
deps: [TranslateService, (DateAdapter)],
|
|
1304
|
+
multi: true,
|
|
1305
|
+
},
|
|
1306
|
+
],
|
|
1307
|
+
}]
|
|
1308
|
+
}] });
|
|
1309
|
+
|
|
1208
1310
|
/*
|
|
1209
1311
|
* Public API Surface of shared
|
|
1210
1312
|
*/
|
|
1211
|
-
const NISS_MASK = '000000/000-00';
|
|
1212
1313
|
|
|
1213
1314
|
/**
|
|
1214
1315
|
* Generated bundle index. Do not edit.
|
|
1215
1316
|
*/
|
|
1216
1317
|
|
|
1217
|
-
export { CommonCountryLookupService, DigitOnlyDirective, IBAN_SUPPORTED_COUNTRIES, IfWidthIsDirective, MatRowClickableDirective, NISS_MASK, ONEMRVA_FORMAT, OnemRvaCDNService, OnemRvaClipboardDirective, OnemRvaColorDirective, OnemRvaIconRightDirective, OnemrvaBcePipe, OnemrvaDateAdapter, OnemrvaDatepickerSharedModule, OnemrvaMaskDirective, OnemrvaNissPipe, OnemrvaSharedModule, OnemrvaValidators, WebComponentOverlayContainer, bankAccountValidator, directives };
|
|
1318
|
+
export { CDNUrlModeOptions, CDN_URLS, CDN_URL_MODE, ClipboardIconComponent, CommonCountryLookupService, DefaultStorage, DigitOnlyDirective, HttpRequestCache, IBAN_SUPPORTED_COUNTRIES, IfWidthIsDirective, MatRowClickableDirective, NISS_MASK, ONEMRVA_FORMAT, OnemRvaCDNCountryService, OnemRvaCDNService, OnemRvaClipboardDirective, OnemRvaColorDirective, OnemRvaIconRightDirective, OnemrvaBcePipe, OnemrvaDateAdapter, OnemrvaDatepickerSharedModule, OnemrvaMaskDirective, OnemrvaNissPipe, OnemrvaSharedModule, OnemrvaTranslateCDNLoader, OnemrvaTranslateHttpLoader, OnemrvaValidators, RequestTimes, WebComponentOverlayContainer, bankAccountValidator, directives, setTranslationLanguage };
|
|
1218
1319
|
//# sourceMappingURL=onemrvapublic-design-system-shared.mjs.map
|