@energinet/watt 1.5.3 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/energinet-watt-icon-flags.mjs +50 -1
- package/fesm2022/energinet-watt-icon-flags.mjs.map +1 -1
- package/fesm2022/energinet-watt-modal.mjs +8 -2
- package/fesm2022/energinet-watt-modal.mjs.map +1 -1
- package/fesm2022/energinet-watt-phone-field.mjs +2 -0
- package/fesm2022/energinet-watt-phone-field.mjs.map +1 -1
- package/icon/flags/watt-flag-nl.d.ts +5 -0
- package/modal/watt-modal.component.d.ts +4 -1
- package/package.json +1 -1
- package/phone-field/watt-phone-field-intl.service.d.ts +1 -0
|
@@ -258,6 +258,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
258
258
|
}]
|
|
259
259
|
}] });
|
|
260
260
|
|
|
261
|
+
//#region License
|
|
262
|
+
/**
|
|
263
|
+
* @license
|
|
264
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
265
|
+
*
|
|
266
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
267
|
+
* you may not use this file except in compliance with the License.
|
|
268
|
+
* You may obtain a copy of the License at
|
|
269
|
+
*
|
|
270
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
271
|
+
*
|
|
272
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
273
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
274
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
275
|
+
* See the License for the specific language governing permissions and
|
|
276
|
+
* limitations under the License.
|
|
277
|
+
*/
|
|
278
|
+
//#endregion
|
|
279
|
+
class WattFlagNetherlandsComponent {
|
|
280
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattFlagNetherlandsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
281
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: WattFlagNetherlandsComponent, isStandalone: true, selector: "watt-flag-nl", ngImport: i0, template: `
|
|
282
|
+
<svg viewBox="0 0 640 480">
|
|
283
|
+
<path fill="#21468b" d="M0 0h640v480H0z" />
|
|
284
|
+
<path fill="#fff" d="M0 160h640v160H0z" />
|
|
285
|
+
<path fill="#ae1c28" d="M0 320h640v160H0z" />
|
|
286
|
+
</svg>
|
|
287
|
+
`, isInline: true });
|
|
288
|
+
}
|
|
289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattFlagNetherlandsComponent, decorators: [{
|
|
290
|
+
type: Component,
|
|
291
|
+
args: [{
|
|
292
|
+
selector: 'watt-flag-nl',
|
|
293
|
+
template: `
|
|
294
|
+
<svg viewBox="0 0 640 480">
|
|
295
|
+
<path fill="#21468b" d="M0 0h640v480H0z" />
|
|
296
|
+
<path fill="#fff" d="M0 160h640v160H0z" />
|
|
297
|
+
<path fill="#ae1c28" d="M0 320h640v160H0z" />
|
|
298
|
+
</svg>
|
|
299
|
+
`,
|
|
300
|
+
}]
|
|
301
|
+
}] });
|
|
302
|
+
|
|
261
303
|
//#region License
|
|
262
304
|
/**
|
|
263
305
|
* @license
|
|
@@ -305,9 +347,12 @@ class WattFlagComponent {
|
|
|
305
347
|
@case ('SE') {
|
|
306
348
|
<watt-flag-se />
|
|
307
349
|
}
|
|
350
|
+
@case ('NL') {
|
|
351
|
+
<watt-flag-nl />
|
|
352
|
+
}
|
|
308
353
|
}
|
|
309
354
|
</watt-icon>
|
|
310
|
-
`, isInline: true, dependencies: [{ kind: "component", type: WattFlagDenmarkComponent, selector: "watt-flag-dk" }, { kind: "component", type: WattFlagFinlandComponent, selector: "watt-flag-fi" }, { kind: "component", type: WattFlagGermanyComponent, selector: "watt-flag-de" }, { kind: "component", type: WattFlagNorwayComponent, selector: "watt-flag-no" }, { kind: "component", type: WattFlagPolandComponent, selector: "watt-flag-pl" }, { kind: "component", type: WattFlagSwedenComponent, selector: "watt-flag-se" }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }] });
|
|
355
|
+
`, isInline: true, dependencies: [{ kind: "component", type: WattFlagDenmarkComponent, selector: "watt-flag-dk" }, { kind: "component", type: WattFlagFinlandComponent, selector: "watt-flag-fi" }, { kind: "component", type: WattFlagGermanyComponent, selector: "watt-flag-de" }, { kind: "component", type: WattFlagNorwayComponent, selector: "watt-flag-no" }, { kind: "component", type: WattFlagPolandComponent, selector: "watt-flag-pl" }, { kind: "component", type: WattFlagSwedenComponent, selector: "watt-flag-se" }, { kind: "component", type: WattFlagNetherlandsComponent, selector: "watt-flag-nl" }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }] });
|
|
311
356
|
}
|
|
312
357
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattFlagComponent, decorators: [{
|
|
313
358
|
type: Component,
|
|
@@ -320,6 +365,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
320
365
|
WattFlagNorwayComponent,
|
|
321
366
|
WattFlagPolandComponent,
|
|
322
367
|
WattFlagSwedenComponent,
|
|
368
|
+
WattFlagNetherlandsComponent,
|
|
323
369
|
WattIconComponent,
|
|
324
370
|
],
|
|
325
371
|
template: `
|
|
@@ -343,6 +389,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
343
389
|
@case ('SE') {
|
|
344
390
|
<watt-flag-se />
|
|
345
391
|
}
|
|
392
|
+
@case ('NL') {
|
|
393
|
+
<watt-flag-nl />
|
|
394
|
+
}
|
|
346
395
|
}
|
|
347
396
|
</watt-icon>
|
|
348
397
|
`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-icon-flags.mjs","sources":["../../../libs/watt/package/icon/flags/watt-flag-dk.ts","../../../libs/watt/package/icon/flags/watt-flag-fi.ts","../../../libs/watt/package/icon/flags/watt-flag-de.ts","../../../libs/watt/package/icon/flags/watt-flag-no.ts","../../../libs/watt/package/icon/flags/watt-flag-pl.ts","../../../libs/watt/package/icon/flags/watt-flag-se.ts","../../../libs/watt/package/icon/flags/watt-flag.ts","../../../libs/watt/package/icon/flags/index.ts","../../../libs/watt/package/icon/flags/energinet-watt-icon-flags.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-dk',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#c8102e\" d=\"M0 0h640.1v480H0z\" />\n <path fill=\"#fff\" d=\"M205.7 0h68.6v480h-68.6z\" />\n <path fill=\"#fff\" d=\"M0 205.7h640.1v68.6H0z\" />\n </svg>\n `,\n})\nexport class WattFlagDenmarkComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-fi',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#fff\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#002f6c\" d=\"M0 174.5h640v131H0z\" />\n <path fill=\"#002f6c\" d=\"M175.5 0h130.9v480h-131z\" />\n </svg>\n `,\n})\nexport class WattFlagFinlandComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-de',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#ffce00\" d=\"M0 320h640v160H0z\" />\n <path fill=\"#000001\" d=\"M0 0h640v160H0z\" />\n <path fill=\"red\" d=\"M0 160h640v160H0z\" />\n </svg>\n `,\n})\nexport class WattFlagGermanyComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-no',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#ed2939\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#fff\" d=\"M180 0h120v480H180z\" />\n <path fill=\"#fff\" d=\"M0 180h640v120H0z\" />\n <path fill=\"#002664\" d=\"M210 0h60v480h-60z\" />\n <path fill=\"#002664\" d=\"M0 210h640v60H0z\" />\n </svg>\n `,\n})\nexport class WattFlagNorwayComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-pl',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <g fill-rule=\"evenodd\">\n <path fill=\"#fff\" d=\"M640 480H0V0h640z\" />\n <path fill=\"#dc143c\" d=\"M640 480H0V240h640z\" />\n </g>\n </svg>\n `,\n})\nexport class WattFlagPolandComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-se',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#005293\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#fecb00\" d=\"M176 0v192H0v96h176v192h96V288h368v-96H272V0z\" />\n </svg>\n `,\n})\nexport class WattFlagSwedenComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, input } from '@angular/core';\nimport { CountryCode } from 'libphonenumber-js';\nimport { WattIconComponent, WattIconSize } from '@energinet/watt/icon';\nimport { WattFlagDenmarkComponent } from './watt-flag-dk';\nimport { WattFlagFinlandComponent } from './watt-flag-fi';\nimport { WattFlagGermanyComponent } from './watt-flag-de';\nimport { WattFlagNorwayComponent } from './watt-flag-no';\nimport { WattFlagPolandComponent } from './watt-flag-pl';\nimport { WattFlagSwedenComponent } from './watt-flag-se';\n\n@Component({\n selector: 'watt-flag',\n imports: [\n WattFlagDenmarkComponent,\n WattFlagFinlandComponent,\n WattFlagGermanyComponent,\n WattFlagNorwayComponent,\n WattFlagPolandComponent,\n WattFlagSwedenComponent,\n WattIconComponent,\n ],\n template: `\n <watt-icon [size]=\"size()\" [label]=\"label()\">\n @switch (country()) {\n @case ('DK') {\n <watt-flag-dk />\n }\n @case ('DE') {\n <watt-flag-de />\n }\n @case ('FI') {\n <watt-flag-fi />\n }\n @case ('NO') {\n <watt-flag-no />\n }\n @case ('PL') {\n <watt-flag-pl />\n }\n @case ('SE') {\n <watt-flag-se />\n }\n }\n </watt-icon>\n `,\n})\nexport class WattFlagComponent {\n /** Country code of the flag. */\n country = input.required<CountryCode>();\n\n /** Accessible label for the icon. */\n label = input<string>();\n\n /** Size of the icon. */\n size = input<WattIconSize>('m');\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattFlagComponent } from './watt-flag';\nexport { WattFlagDenmarkComponent } from './watt-flag-dk';\nexport { WattFlagFinlandComponent } from './watt-flag-fi';\nexport { WattFlagGermanyComponent } from './watt-flag-de';\nexport { WattFlagNorwayComponent } from './watt-flag-no';\nexport { WattFlagPolandComponent } from './watt-flag-pl';\nexport { WattFlagSwedenComponent } from './watt-flag-se';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAaa,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,EARzB,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;AAMT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEU,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAVpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE;;;;;;AAMT,EAAA,CAAA;AACF,iBAAA;;;AC7BD;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAaa,wBAAwB,CAAA;uGAAxB,wB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Q,EAAE,WAAW;AACrB,oBAAA,OAAO,EAAE;wBACP,wBAAwB;wBACxB,wBAAwB;wBACxB,wBAAwB;wBACxB,uBAAuB;wBACvB,uBAAuB;wBACvB,uBAAuB;wBACvB,iBAAiB;AAClB,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;AAuBT,EAAA,CAAA;AACF,iBAAA;;;AC/DD;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-icon-flags.mjs","sources":["../../../libs/watt/package/icon/flags/watt-flag-dk.ts","../../../libs/watt/package/icon/flags/watt-flag-fi.ts","../../../libs/watt/package/icon/flags/watt-flag-de.ts","../../../libs/watt/package/icon/flags/watt-flag-no.ts","../../../libs/watt/package/icon/flags/watt-flag-pl.ts","../../../libs/watt/package/icon/flags/watt-flag-se.ts","../../../libs/watt/package/icon/flags/watt-flag-nl.ts","../../../libs/watt/package/icon/flags/watt-flag.ts","../../../libs/watt/package/icon/flags/index.ts","../../../libs/watt/package/icon/flags/energinet-watt-icon-flags.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-dk',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#c8102e\" d=\"M0 0h640.1v480H0z\" />\n <path fill=\"#fff\" d=\"M205.7 0h68.6v480h-68.6z\" />\n <path fill=\"#fff\" d=\"M0 205.7h640.1v68.6H0z\" />\n </svg>\n `,\n})\nexport class WattFlagDenmarkComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-fi',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#fff\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#002f6c\" d=\"M0 174.5h640v131H0z\" />\n <path fill=\"#002f6c\" d=\"M175.5 0h130.9v480h-131z\" />\n </svg>\n `,\n})\nexport class WattFlagFinlandComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-de',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#ffce00\" d=\"M0 320h640v160H0z\" />\n <path fill=\"#000001\" d=\"M0 0h640v160H0z\" />\n <path fill=\"red\" d=\"M0 160h640v160H0z\" />\n </svg>\n `,\n})\nexport class WattFlagGermanyComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-no',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#ed2939\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#fff\" d=\"M180 0h120v480H180z\" />\n <path fill=\"#fff\" d=\"M0 180h640v120H0z\" />\n <path fill=\"#002664\" d=\"M210 0h60v480h-60z\" />\n <path fill=\"#002664\" d=\"M0 210h640v60H0z\" />\n </svg>\n `,\n})\nexport class WattFlagNorwayComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-pl',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <g fill-rule=\"evenodd\">\n <path fill=\"#fff\" d=\"M640 480H0V0h640z\" />\n <path fill=\"#dc143c\" d=\"M640 480H0V240h640z\" />\n </g>\n </svg>\n `,\n})\nexport class WattFlagPolandComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-se',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#005293\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#fecb00\" d=\"M176 0v192H0v96h176v192h96V288h368v-96H272V0z\" />\n </svg>\n `,\n})\nexport class WattFlagSwedenComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-nl',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#21468b\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#fff\" d=\"M0 160h640v160H0z\" />\n <path fill=\"#ae1c28\" d=\"M0 320h640v160H0z\" />\n </svg>\n `,\n})\nexport class WattFlagNetherlandsComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, input } from '@angular/core';\nimport { CountryCode } from 'libphonenumber-js';\n\nimport { WattIconComponent, WattIconSize } from '@energinet/watt/icon';\n\nimport { WattFlagDenmarkComponent } from './watt-flag-dk';\nimport { WattFlagFinlandComponent } from './watt-flag-fi';\nimport { WattFlagGermanyComponent } from './watt-flag-de';\nimport { WattFlagNorwayComponent } from './watt-flag-no';\nimport { WattFlagPolandComponent } from './watt-flag-pl';\nimport { WattFlagSwedenComponent } from './watt-flag-se';\nimport { WattFlagNetherlandsComponent } from './watt-flag-nl';\n\n@Component({\n selector: 'watt-flag',\n imports: [\n WattFlagDenmarkComponent,\n WattFlagFinlandComponent,\n WattFlagGermanyComponent,\n WattFlagNorwayComponent,\n WattFlagPolandComponent,\n WattFlagSwedenComponent,\n WattFlagNetherlandsComponent,\n WattIconComponent,\n ],\n template: `\n <watt-icon [size]=\"size()\" [label]=\"label()\">\n @switch (country()) {\n @case ('DK') {\n <watt-flag-dk />\n }\n @case ('DE') {\n <watt-flag-de />\n }\n @case ('FI') {\n <watt-flag-fi />\n }\n @case ('NO') {\n <watt-flag-no />\n }\n @case ('PL') {\n <watt-flag-pl />\n }\n @case ('SE') {\n <watt-flag-se />\n }\n @case ('NL') {\n <watt-flag-nl />\n }\n }\n </watt-icon>\n `,\n})\nexport class WattFlagComponent {\n /** Country code of the flag. */\n country = input.required<CountryCode>();\n\n /** Accessible label for the icon. */\n label = input<string>();\n\n /** Size of the icon. */\n size = input<WattIconSize>('m');\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattFlagComponent } from './watt-flag';\nexport { WattFlagDenmarkComponent } from './watt-flag-dk';\nexport { WattFlagFinlandComponent } from './watt-flag-fi';\nexport { WattFlagGermanyComponent } from './watt-flag-de';\nexport { WattFlagNorwayComponent } from './watt-flag-no';\nexport { WattFlagPolandComponent } from './watt-flag-pl';\nexport { WattFlagSwedenComponent } from './watt-flag-se';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAaa,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,EARzB,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;AAMT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEU,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAVpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE;;;;;;AAMT,EAAA,CAAA;AACF,iBAAA;;;AC7BD;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAaa,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,E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,uBAAuB,EACvB,QAAA,EAAA,cAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,uBAAuB,EACvB,QAAA,EAAA,cAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,4BAA4B,yDAC5B,iBAAiB,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FA8BR,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAxC7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,OAAO,EAAE;wBACP,wBAAwB;wBACxB,wBAAwB;wBACxB,wBAAwB;wBACxB,uBAAuB;wBACvB,uBAAuB;wBACvB,uBAAuB;wBACvB,4BAA4B;wBAC5B,iBAAiB;AAClB,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BT,EAAA,CAAA;AACF,iBAAA;;;ACtED;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -6,6 +6,7 @@ import { WattResizeObserverDirective } from '@energinet/watt/utils/resize-observ
|
|
|
6
6
|
import { WattButtonComponent } from '@energinet/watt/button';
|
|
7
7
|
import { WattSpinnerComponent } from '@energinet/watt/spinner';
|
|
8
8
|
import { map, take } from 'rxjs';
|
|
9
|
+
import { WattIconComponent } from '@energinet/watt/icon';
|
|
9
10
|
|
|
10
11
|
class WattTypedModal {
|
|
11
12
|
modalData = inject(MAT_DIALOG_DATA);
|
|
@@ -137,6 +138,8 @@ class WattModalComponent {
|
|
|
137
138
|
minHeight = '147px';
|
|
138
139
|
/** Whether the dialog should restore focus to the previously-focused element, after it's closed. */
|
|
139
140
|
restoreFocus = true;
|
|
141
|
+
/** Icon displayed next to the modal title. */
|
|
142
|
+
titleIcon;
|
|
140
143
|
/**
|
|
141
144
|
* When modal is closed, emits `true` if it was "accepted",
|
|
142
145
|
* otherwise emits `false`.
|
|
@@ -177,7 +180,7 @@ class WattModalComponent {
|
|
|
177
180
|
this.scrollable = event.target.scrollHeight > event.target.clientHeight;
|
|
178
181
|
}
|
|
179
182
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
180
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattModalComponent, isStandalone: true, selector: "watt-modal", inputs: { title: "title", size: "size", loading: "loading", loadingMessage: "loadingMessage", disableClose: "disableClose", hideCloseButton: "hideCloseButton", disableEscAndBackdropClose: "disableEscAndBackdropClose", closeLabel: "closeLabel", panelClass: "panelClass", minHeight: "minHeight", restoreFocus: "restoreFocus" }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["modal"], descendants: true }], ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<ng-template #modal>\n <div class=\"watt-modal\" [ngClass]=\"'watt-modal--' + size\">\n @if (!disableClose && !hideCloseButton) {\n <watt-button\n variant=\"icon\"\n icon=\"close\"\n class=\"watt-modal-close\"\n [attr.aria-label]=\"closeLabel\"\n (click)=\"close(false)\"\n />\n }\n @if (title && loading === false) {\n <h2 class=\"watt-modal-title\"
|
|
183
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattModalComponent, isStandalone: true, selector: "watt-modal", inputs: { title: "title", size: "size", loading: "loading", loadingMessage: "loadingMessage", disableClose: "disableClose", hideCloseButton: "hideCloseButton", disableEscAndBackdropClose: "disableEscAndBackdropClose", closeLabel: "closeLabel", panelClass: "panelClass", minHeight: "minHeight", restoreFocus: "restoreFocus", titleIcon: "titleIcon" }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["modal"], descendants: true }], ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<ng-template #modal>\n <div class=\"watt-modal\" [ngClass]=\"'watt-modal--' + size\">\n @if (!disableClose && !hideCloseButton) {\n <watt-button\n variant=\"icon\"\n icon=\"close\"\n class=\"watt-modal-close\"\n [attr.aria-label]=\"closeLabel\"\n (click)=\"close(false)\"\n />\n }\n @if (title && loading === false) {\n <h2 class=\"watt-modal-title\" [ngClass]=\"{ 'watt-modal-title-icon': titleIcon }\">\n @if (titleIcon) {\n <watt-icon [name]=\"titleIcon\" [size]=\"'l'\" />\n }\n {{ title }}\n </h2>\n }\n <div\n wattResizeObserver\n class=\"watt-modal-content\"\n [class.watt-modal-scrollable]=\"scrollable\"\n (resize)=\"onResize($event)\"\n >\n <ng-content />\n </div>\n <ng-content select=\"watt-modal-actions\" />\n\n @if (loading) {\n <div class=\"watt-modal__spinner\">\n <div>\n <watt-spinner />\n <p>{{ loadingMessage }}</p>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n@if (dialogRef) {\n <ng-template [ngTemplateOutlet]=\"modal\" />\n}\n", styles: [":root{--watt-modal-width: 100vw;--watt-modal-min-height: auto;--watt-modal-height: calc(100vh - var(--watt-topbar-height, 0px));--watt-modal-content-padding: 0 var(--watt-space-ml)}.watt-modal{width:var(--watt-modal-width);max-width:100vw;height:var(--watt-modal-height);min-height:var(--watt-modal-min-height);max-height:100vh;position:relative;display:grid;padding:0;align-items:center;grid-template-columns:1fr auto;grid-template-rows:auto 1fr auto;grid-template-areas:\"title close\" \"content content\" \"actions actions\"}.watt-modal--small{--watt-modal-width: 320px;--watt-modal-height: auto}@media (min-width: 600.02px){.watt-modal--small{--watt-modal-width: 520px}}.watt-modal--small .watt-modal-title{color:var(--watt-typography-headline-color);font-size:1rem;line-height:1.5rem;font-weight:600;text-transform:none;letter-spacing:0}@media (min-width: 1280px){.watt-modal--small .watt-modal-title{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 720.02px){.watt-modal--medium{--watt-modal-width: 720px;--watt-modal-height: auto}}@media (min-width: 786.02px){.watt-modal--large{--watt-modal-width: 786px;--watt-modal-height: auto}}@media (min-width: 960.02px){.watt-modal--large{--watt-modal-width: 936px;--watt-modal-height: auto}}.watt-modal-panel{margin-top:var(--watt-topbar-height)}.watt-modal-panel .mat-mdc-dialog-container .mdc-dialog__surface{width:auto}.watt-modal-panel .watt-modal-close{grid-area:close;align-self:start;margin:var(--watt-space-s);color:var(--watt-color-primary)}.watt-modal-panel .watt-modal-title{grid-area:title;margin:var(--watt-space-s) var(--watt-space-ml);color:var(--watt-typography-text-color)}.watt-modal-panel .watt-modal-title.watt-modal-title-icon{display:flex;align-items:center;gap:var(--watt-space-s)}.watt-modal-panel .watt-modal-content{align-self:stretch;grid-area:content;overflow:auto;padding:var(--watt-modal-content-padding)}.watt-modal-panel .watt-modal-content .watt-modal-content--full-width{display:block;margin:0 calc(-1 * var(--watt-space-s)) 0 0}@media (min-width: 720.02px){.watt-modal-panel .watt-modal-content .watt-modal-content--full-width{margin:0 calc(-1 * var(--watt-space-ml))}}.watt-modal-panel .watt-modal-scrollable{border:1px solid var(--watt-color-neutral-grey-300);border-left:none;border-right:none}.watt-modal-panel watt-modal-actions{grid-area:actions;display:flex;justify-content:flex-end;padding:var(--watt-space-ml);gap:var(--watt-space-m)}.watt-modal-panel .watt-modal__spinner{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;background:#fffc}.watt-modal-panel .watt-modal__spinner div{display:flex;align-items:center;justify-content:center;flex-wrap:wrap}.watt-modal-panel .watt-modal__spinner div p{margin-top:var(--watt-space-m);width:100%}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: WattResizeObserverDirective, selector: "[wattResizeObserver]", outputs: ["resize"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattSpinnerComponent, selector: "watt-spinner", inputs: ["diameter", "strokeWidth"] }, { kind: "ngmodule", type: WattModalModule }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
181
184
|
}
|
|
182
185
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattModalComponent, decorators: [{
|
|
183
186
|
type: Component,
|
|
@@ -188,7 +191,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
188
191
|
WattButtonComponent,
|
|
189
192
|
WattSpinnerComponent,
|
|
190
193
|
WattModalModule,
|
|
191
|
-
|
|
194
|
+
WattIconComponent,
|
|
195
|
+
], template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<ng-template #modal>\n <div class=\"watt-modal\" [ngClass]=\"'watt-modal--' + size\">\n @if (!disableClose && !hideCloseButton) {\n <watt-button\n variant=\"icon\"\n icon=\"close\"\n class=\"watt-modal-close\"\n [attr.aria-label]=\"closeLabel\"\n (click)=\"close(false)\"\n />\n }\n @if (title && loading === false) {\n <h2 class=\"watt-modal-title\" [ngClass]=\"{ 'watt-modal-title-icon': titleIcon }\">\n @if (titleIcon) {\n <watt-icon [name]=\"titleIcon\" [size]=\"'l'\" />\n }\n {{ title }}\n </h2>\n }\n <div\n wattResizeObserver\n class=\"watt-modal-content\"\n [class.watt-modal-scrollable]=\"scrollable\"\n (resize)=\"onResize($event)\"\n >\n <ng-content />\n </div>\n <ng-content select=\"watt-modal-actions\" />\n\n @if (loading) {\n <div class=\"watt-modal__spinner\">\n <div>\n <watt-spinner />\n <p>{{ loadingMessage }}</p>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n@if (dialogRef) {\n <ng-template [ngTemplateOutlet]=\"modal\" />\n}\n", styles: [":root{--watt-modal-width: 100vw;--watt-modal-min-height: auto;--watt-modal-height: calc(100vh - var(--watt-topbar-height, 0px));--watt-modal-content-padding: 0 var(--watt-space-ml)}.watt-modal{width:var(--watt-modal-width);max-width:100vw;height:var(--watt-modal-height);min-height:var(--watt-modal-min-height);max-height:100vh;position:relative;display:grid;padding:0;align-items:center;grid-template-columns:1fr auto;grid-template-rows:auto 1fr auto;grid-template-areas:\"title close\" \"content content\" \"actions actions\"}.watt-modal--small{--watt-modal-width: 320px;--watt-modal-height: auto}@media (min-width: 600.02px){.watt-modal--small{--watt-modal-width: 520px}}.watt-modal--small .watt-modal-title{color:var(--watt-typography-headline-color);font-size:1rem;line-height:1.5rem;font-weight:600;text-transform:none;letter-spacing:0}@media (min-width: 1280px){.watt-modal--small .watt-modal-title{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 720.02px){.watt-modal--medium{--watt-modal-width: 720px;--watt-modal-height: auto}}@media (min-width: 786.02px){.watt-modal--large{--watt-modal-width: 786px;--watt-modal-height: auto}}@media (min-width: 960.02px){.watt-modal--large{--watt-modal-width: 936px;--watt-modal-height: auto}}.watt-modal-panel{margin-top:var(--watt-topbar-height)}.watt-modal-panel .mat-mdc-dialog-container .mdc-dialog__surface{width:auto}.watt-modal-panel .watt-modal-close{grid-area:close;align-self:start;margin:var(--watt-space-s);color:var(--watt-color-primary)}.watt-modal-panel .watt-modal-title{grid-area:title;margin:var(--watt-space-s) var(--watt-space-ml);color:var(--watt-typography-text-color)}.watt-modal-panel .watt-modal-title.watt-modal-title-icon{display:flex;align-items:center;gap:var(--watt-space-s)}.watt-modal-panel .watt-modal-content{align-self:stretch;grid-area:content;overflow:auto;padding:var(--watt-modal-content-padding)}.watt-modal-panel .watt-modal-content .watt-modal-content--full-width{display:block;margin:0 calc(-1 * var(--watt-space-s)) 0 0}@media (min-width: 720.02px){.watt-modal-panel .watt-modal-content .watt-modal-content--full-width{margin:0 calc(-1 * var(--watt-space-ml))}}.watt-modal-panel .watt-modal-scrollable{border:1px solid var(--watt-color-neutral-grey-300);border-left:none;border-right:none}.watt-modal-panel watt-modal-actions{grid-area:actions;display:flex;justify-content:flex-end;padding:var(--watt-space-ml);gap:var(--watt-space-m)}.watt-modal-panel .watt-modal__spinner{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;background:#fffc}.watt-modal-panel .watt-modal__spinner div{display:flex;align-items:center;justify-content:center;flex-wrap:wrap}.watt-modal-panel .watt-modal__spinner div p{margin-top:var(--watt-space-m);width:100%}\n"] }]
|
|
192
196
|
}], propDecorators: { title: [{
|
|
193
197
|
type: Input
|
|
194
198
|
}], size: [{
|
|
@@ -211,6 +215,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
211
215
|
type: Input
|
|
212
216
|
}], restoreFocus: [{
|
|
213
217
|
type: Input
|
|
218
|
+
}], titleIcon: [{
|
|
219
|
+
type: Input
|
|
214
220
|
}], closed: [{
|
|
215
221
|
type: Output
|
|
216
222
|
}], modal: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-modal.mjs","sources":["../../../libs/watt/package/modal/watt-modal.service.ts","../../../libs/watt/package/modal/watt-modal.component.ts","../../../libs/watt/package/modal/watt-modal.component.html","../../../libs/watt/package/modal/index.ts","../../../libs/watt/package/modal/energinet-watt-modal.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { ComponentType } from '@angular/cdk/portal';\nimport { EventEmitter, Injectable, Injector, NgModule, TemplateRef, inject } from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialog,\n MatDialogModule,\n MatDialogRef,\n} from '@angular/material/dialog';\nimport { map, take } from 'rxjs';\n\nexport interface WattModalConfig<T> {\n templateRef?: TemplateRef<unknown>;\n component?: ComponentType<WattTypedModal<T>>;\n data?: T;\n disableClose?: boolean;\n onClosed?: EventEmitter<boolean> | ((result: boolean) => void);\n minHeight?: string;\n panelClass?: string[];\n injector?: Injector;\n restoreFocus?: boolean;\n}\n\nexport abstract class WattTypedModal<T = void> {\n protected modalData: T = inject(MAT_DIALOG_DATA);\n protected dialogRef: MatDialogRef<WattTypedModal<T>> = inject(MatDialogRef);\n}\n\n@Injectable()\nexport class WattModalService {\n private readonly dialog = inject(MatDialog);\n private matDialogRef: MatDialogRef<unknown> | undefined;\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open = <T>(config: WattModalConfig<T>) => {\n const template = config.templateRef ?? config.component;\n\n if (!template) return;\n\n this.matDialogRef = this.openModal(template, config);\n\n this.matDialogRef\n .afterClosed()\n .pipe(map(Boolean), take(1))\n .subscribe((result) => {\n if (config?.onClosed instanceof EventEmitter) {\n config?.onClosed.emit(result);\n } else {\n config?.onClosed?.(result);\n }\n });\n\n if (config.minHeight) this.setMinHeight(config.minHeight);\n };\n\n /**\n * Opens the modal using the provided template and configuration.\n */\n private openModal<T>(\n template: TemplateRef<unknown> | ComponentType<WattTypedModal<T>>,\n config: WattModalConfig<T>\n ): MatDialogRef<unknown> {\n return this.dialog.open(template, {\n autoFocus: 'dialog',\n panelClass: [\n 'watt-modal-panel',\n ...(config.component ? ['watt-modal-panel--component'] : []),\n ...(config.panelClass ?? []),\n ],\n disableClose: config.disableClose ?? false,\n data: config.data,\n maxWidth: 'none',\n injector: config.injector,\n restoreFocus: config.restoreFocus === false ? false : true,\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.matDialogRef?.close(result);\n }\n\n private setMinHeight(minHeight: string) {\n setTimeout(() => {\n document\n ?.getElementById(this.matDialogRef?.id ?? '')\n ?.querySelector('.watt-modal')\n ?.setAttribute('style', `--watt-modal-min-height: ${minHeight}`);\n });\n }\n}\n\n@NgModule({\n imports: [MatDialogModule],\n providers: [WattModalService],\n})\nexport class WattModalModule {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { MatDialogRef } from '@angular/material/dialog';\n\nimport { WattResizeObserverDirective } from '@energinet/watt/utils/resize-observer';\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\n\nimport { WattModalModule, WattModalService } from './watt-modal.service';\n\nexport type WattModalSize = 'small' | 'medium' | 'large';\n\n/**\n * Component for representing a binary decision in the form of\n * a modal window that appears in front of the entire content.\n *\n * Usage:\n * `import { WATT_MODAL } from '@energinet-datahub/watt/modal';`\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-modal',\n styleUrls: ['./watt-modal.component.scss'],\n templateUrl: './watt-modal.component.html',\n imports: [\n NgClass,\n NgTemplateOutlet,\n WattResizeObserverDirective,\n WattButtonComponent,\n WattSpinnerComponent,\n WattModalModule,\n ],\n})\nexport class WattModalComponent {\n private modalService = inject(WattModalService);\n protected dialogRef = inject<MatDialogRef<unknown>>(MatDialogRef, { optional: true });\n /** Title to stay fixed to top of modal. */\n @Input() title = '';\n\n @Input() size: WattModalSize = 'medium';\n\n /** Whether the modal should show a loading state. */\n @Input() loading = false;\n\n /** Whether the modal should show a loading text for the loading state. */\n @Input() loadingMessage = '';\n\n /** Disable ESC, close button and backdrop click as methods of closing. */\n @Input() disableClose = false;\n\n /** Whether to show the close button */\n @Input() hideCloseButton = false;\n\n /** Disable ESC, backdrop click as methods of closing. */\n @Input() disableEscAndBackdropClose = false;\n\n /** The aria-label for the close button. */\n @Input() closeLabel = 'Close';\n\n /** Classes added to the modal panel */\n @Input() panelClass: string[] = [];\n\n @Input() minHeight = '147px';\n\n /** Whether the dialog should restore focus to the previously-focused element, after it's closed. */\n @Input() restoreFocus = true;\n\n /**\n * When modal is closed, emits `true` if it was \"accepted\",\n * otherwise emits `false`.\n * @ignore\n */\n @Output() closed = new EventEmitter<boolean>();\n\n /** @ignore */\n @ViewChild('modal') modal!: TemplateRef<Element>;\n\n /** @ignore */\n scrollable = false;\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open() {\n this.modalService.open({\n disableClose: this.disableEscAndBackdropClose || this.disableClose,\n templateRef: this.modal,\n onClosed: this.closed,\n minHeight: this.minHeight,\n panelClass: this.panelClass,\n restoreFocus: this.restoreFocus,\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.modalService.close(result); // inline modal\n this.dialogRef?.close(result); // injected modal\n }\n\n /**\n * Called when the modal content element changes size.\n * @ignore\n */\n onResize(event: ResizeObserverEntry) {\n this.scrollable = event.target.scrollHeight > event.target.clientHeight;\n }\n}\n\n/**\n * Component for projecting buttons (actions) to the bottom of the modal.\n */\n@Component({\n selector: 'watt-modal-actions',\n template: '<ng-content />',\n})\nexport class WattModalActionsComponent {}\n\nexport const WATT_MODAL = [WattModalComponent, WattModalActionsComponent];\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<ng-template #modal>\n <div class=\"watt-modal\" [ngClass]=\"'watt-modal--' + size\">\n @if (!disableClose && !hideCloseButton) {\n <watt-button\n variant=\"icon\"\n icon=\"close\"\n class=\"watt-modal-close\"\n [attr.aria-label]=\"closeLabel\"\n (click)=\"close(false)\"\n />\n }\n @if (title && loading === false) {\n <h2 class=\"watt-modal-title\">{{ title }}</h2>\n }\n <div\n wattResizeObserver\n class=\"watt-modal-content\"\n [class.watt-modal-scrollable]=\"scrollable\"\n (resize)=\"onResize($event)\"\n >\n <ng-content />\n </div>\n <ng-content select=\"watt-modal-actions\" />\n\n @if (loading) {\n <div class=\"watt-modal__spinner\">\n <div>\n <watt-spinner />\n <p>{{ loadingMessage }}</p>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n@if (dialogRef) {\n <ng-template [ngTemplateOutlet]=\"modal\" />\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattModalComponent, WattModalActionsComponent, WATT_MODAL } from './watt-modal.component';\nexport { WattModalService, WattModalConfig, WattTypedModal } from './watt-modal.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAwCsB,cAAc,CAAA;AACxB,IAAA,SAAS,GAAM,MAAM,CAAC,eAAe,CAAC;AACtC,IAAA,SAAS,GAAoC,MAAM,CAAC,YAAY,CAAC;AAC5E;MAGY,gBAAgB,CAAA;AACV,IAAA,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AACnC,IAAA,YAAY;AAEpB;;;AAGG;AACH,IAAA,IAAI,GAAG,CAAI,MAA0B,KAAI;QACvC,MAAM,QAAQ,GAAG,MAAM,CAA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sBAAxB,SAAS;uBAAC,OAAO;;AAsCpB;;AAEG;MAKU,yBAAyB,CAAA;uGAAzB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,8EAF1B,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEf,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAJrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,QAAQ,EAAE,gBAAgB;AAC3B,iBAAA;;MAGY,UAAU,GAAG,CAAC,kBAAkB,EAAE,yBAAyB;;AEvJxE;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-modal.mjs","sources":["../../../libs/watt/package/modal/watt-modal.service.ts","../../../libs/watt/package/modal/watt-modal.component.ts","../../../libs/watt/package/modal/watt-modal.component.html","../../../libs/watt/package/modal/index.ts","../../../libs/watt/package/modal/energinet-watt-modal.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { ComponentType } from '@angular/cdk/portal';\nimport { EventEmitter, Injectable, Injector, NgModule, TemplateRef, inject } from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialog,\n MatDialogModule,\n MatDialogRef,\n} from '@angular/material/dialog';\nimport { map, take } from 'rxjs';\n\nexport interface WattModalConfig<T> {\n templateRef?: TemplateRef<unknown>;\n component?: ComponentType<WattTypedModal<T>>;\n data?: T;\n disableClose?: boolean;\n onClosed?: EventEmitter<boolean> | ((result: boolean) => void);\n minHeight?: string;\n panelClass?: string[];\n injector?: Injector;\n restoreFocus?: boolean;\n}\n\nexport abstract class WattTypedModal<T = void> {\n protected modalData: T = inject(MAT_DIALOG_DATA);\n protected dialogRef: MatDialogRef<WattTypedModal<T>> = inject(MatDialogRef);\n}\n\n@Injectable()\nexport class WattModalService {\n private readonly dialog = inject(MatDialog);\n private matDialogRef: MatDialogRef<unknown> | undefined;\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open = <T>(config: WattModalConfig<T>) => {\n const template = config.templateRef ?? config.component;\n\n if (!template) return;\n\n this.matDialogRef = this.openModal(template, config);\n\n this.matDialogRef\n .afterClosed()\n .pipe(map(Boolean), take(1))\n .subscribe((result) => {\n if (config?.onClosed instanceof EventEmitter) {\n config?.onClosed.emit(result);\n } else {\n config?.onClosed?.(result);\n }\n });\n\n if (config.minHeight) this.setMinHeight(config.minHeight);\n };\n\n /**\n * Opens the modal using the provided template and configuration.\n */\n private openModal<T>(\n template: TemplateRef<unknown> | ComponentType<WattTypedModal<T>>,\n config: WattModalConfig<T>\n ): MatDialogRef<unknown> {\n return this.dialog.open(template, {\n autoFocus: 'dialog',\n panelClass: [\n 'watt-modal-panel',\n ...(config.component ? ['watt-modal-panel--component'] : []),\n ...(config.panelClass ?? []),\n ],\n disableClose: config.disableClose ?? false,\n data: config.data,\n maxWidth: 'none',\n injector: config.injector,\n restoreFocus: config.restoreFocus === false ? false : true,\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.matDialogRef?.close(result);\n }\n\n private setMinHeight(minHeight: string) {\n setTimeout(() => {\n document\n ?.getElementById(this.matDialogRef?.id ?? '')\n ?.querySelector('.watt-modal')\n ?.setAttribute('style', `--watt-modal-min-height: ${minHeight}`);\n });\n }\n}\n\n@NgModule({\n imports: [MatDialogModule],\n providers: [WattModalService],\n})\nexport class WattModalModule {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { MatDialogRef } from '@angular/material/dialog';\n\nimport { WattResizeObserverDirective } from '@energinet/watt/utils/resize-observer';\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\n\nimport { WattModalModule, WattModalService } from './watt-modal.service';\nimport { WattIcon, WattIconComponent } from '@energinet/watt/icon';\n\nexport type WattModalSize = 'small' | 'medium' | 'large';\n\n/**\n * Component for representing a binary decision in the form of\n * a modal window that appears in front of the entire content.\n *\n * Usage:\n * `import { WATT_MODAL } from '@energinet-datahub/watt/modal';`\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-modal',\n styleUrls: ['./watt-modal.component.scss'],\n templateUrl: './watt-modal.component.html',\n imports: [\n NgClass,\n NgTemplateOutlet,\n WattResizeObserverDirective,\n WattButtonComponent,\n WattSpinnerComponent,\n WattModalModule,\n WattIconComponent,\n ],\n})\nexport class WattModalComponent {\n private modalService = inject(WattModalService);\n protected dialogRef = inject<MatDialogRef<unknown>>(MatDialogRef, { optional: true });\n /** Title to stay fixed to top of modal. */\n @Input() title = '';\n\n @Input() size: WattModalSize = 'medium';\n\n /** Whether the modal should show a loading state. */\n @Input() loading = false;\n\n /** Whether the modal should show a loading text for the loading state. */\n @Input() loadingMessage = '';\n\n /** Disable ESC, close button and backdrop click as methods of closing. */\n @Input() disableClose = false;\n\n /** Whether to show the close button */\n @Input() hideCloseButton = false;\n\n /** Disable ESC, backdrop click as methods of closing. */\n @Input() disableEscAndBackdropClose = false;\n\n /** The aria-label for the close button. */\n @Input() closeLabel = 'Close';\n\n /** Classes added to the modal panel */\n @Input() panelClass: string[] = [];\n\n @Input() minHeight = '147px';\n\n /** Whether the dialog should restore focus to the previously-focused element, after it's closed. */\n @Input() restoreFocus = true;\n\n /** Icon displayed next to the modal title. */\n @Input() titleIcon?: WattIcon;\n\n /**\n * When modal is closed, emits `true` if it was \"accepted\",\n * otherwise emits `false`.\n * @ignore\n */\n @Output() closed = new EventEmitter<boolean>();\n\n /** @ignore */\n @ViewChild('modal') modal!: TemplateRef<Element>;\n\n /** @ignore */\n scrollable = false;\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open() {\n this.modalService.open({\n disableClose: this.disableEscAndBackdropClose || this.disableClose,\n templateRef: this.modal,\n onClosed: this.closed,\n minHeight: this.minHeight,\n panelClass: this.panelClass,\n restoreFocus: this.restoreFocus,\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.modalService.close(result); // inline modal\n this.dialogRef?.close(result); // injected modal\n }\n\n /**\n * Called when the modal content element changes size.\n * @ignore\n */\n onResize(event: ResizeObserverEntry) {\n this.scrollable = event.target.scrollHeight > event.target.clientHeight;\n }\n}\n\n/**\n * Component for projecting buttons (actions) to the bottom of the modal.\n */\n@Component({\n selector: 'watt-modal-actions',\n template: '<ng-content />',\n})\nexport class WattModalActionsComponent {}\n\nexport const WATT_MODAL = [WattModalComponent, WattModalActionsComponent];\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<ng-template #modal>\n <div class=\"watt-modal\" [ngClass]=\"'watt-modal--' + size\">\n @if (!disableClose && !hideCloseButton) {\n <watt-button\n variant=\"icon\"\n icon=\"close\"\n class=\"watt-modal-close\"\n [attr.aria-label]=\"closeLabel\"\n (click)=\"close(false)\"\n />\n }\n @if (title && loading === false) {\n <h2 class=\"watt-modal-title\" [ngClass]=\"{ 'watt-modal-title-icon': titleIcon }\">\n @if (titleIcon) {\n <watt-icon [name]=\"titleIcon\" [size]=\"'l'\" />\n }\n {{ title }}\n </h2>\n }\n <div\n wattResizeObserver\n class=\"watt-modal-content\"\n [class.watt-modal-scrollable]=\"scrollable\"\n (resize)=\"onResize($event)\"\n >\n <ng-content />\n </div>\n <ng-content select=\"watt-modal-actions\" />\n\n @if (loading) {\n <div class=\"watt-modal__spinner\">\n <div>\n <watt-spinner />\n <p>{{ loadingMessage }}</p>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n@if (dialogRef) {\n <ng-template [ngTemplateOutlet]=\"modal\" />\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattModalComponent, WattModalActionsComponent, WATT_MODAL } from './watt-modal.component';\nexport { WattModalService, WattModalConfig, WattTypedModal } from './watt-modal.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAwCsB,cAAc,CAAA;AACxB,IAAA,SAAS,GAAM,MAAM,CAAC,eAAe,CAAC;AACtC,IAAA,SAAS,GAAoC,MAAM,CAAC,YAAY,CAAC;AAC5E;MAGY,gBAAgB,CAAA;AACV,IAAA,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AACnC,IAAA,YAAY;AAEpB;;;AAGG;AACH,IAAA,IAAI,GAAG,CAAI,MAA0B,KAAI;QACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,SAAS;AAEvD,QAAA,IAAI,CAAC,QAAQ;YAAE;QAEf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;AAEpD,QAAA,IAAI,CAAC;AACF,aAAA,WAAW;aACX,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1B,aAAA,SAAS,CAAC,CAAC,MAAM,KAAI;AACpB,YAAA,IAAI,MAAM,EAAE,QAAQ,YAAY,YAAY,EAAE;AAC5C,gBAAA,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;;iBACxB;AACL,gBAAA,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;;AAE9B,SAAC,CAAC;QAEJ,IAAI,MAAM,CAAC,SAAS;AAAE,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC;AAC3D,KAAC;AAED;;AAEG;IACK,SAAS,CACf,QAAiE,EACjE,MAA0B,EAAA;A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AAE,oBAAoB;AAC9B,oBAAA,QAAQ,EAAE,gBAAgB;AAC3B,iBAAA;;MAGY,UAAU,GAAG,CAAC,kBAAkB,EAAE,yBAAyB;;AE5JxE;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -41,6 +41,7 @@ class WattPhoneFieldIntlService {
|
|
|
41
41
|
NO = 'Norway';
|
|
42
42
|
SE = 'Sweden';
|
|
43
43
|
PL = 'Poland';
|
|
44
|
+
NL = 'Netherlands';
|
|
44
45
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPhoneFieldIntlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
45
46
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPhoneFieldIntlService, providedIn: 'root' });
|
|
46
47
|
}
|
|
@@ -84,6 +85,7 @@ class WattPhoneFieldComponent {
|
|
|
84
85
|
{ countryIsoCode: 'DE', phoneExtension: '+49' },
|
|
85
86
|
{ countryIsoCode: 'FI', phoneExtension: '+358' },
|
|
86
87
|
{ countryIsoCode: 'PL', phoneExtension: '+48' },
|
|
88
|
+
{ countryIsoCode: 'NL', phoneExtension: '+31' },
|
|
87
89
|
];
|
|
88
90
|
formControl = input.required();
|
|
89
91
|
label = input();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-phone-field.mjs","sources":["../../../libs/watt/package/phone-field/watt-phone-field-intl.service.ts","../../../libs/watt/package/phone-field/watt-phone-field.component.ts","../../../libs/watt/package/phone-field/index.ts","../../../libs/watt/package/phone-field/energinet-watt-phone-field.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattPhoneFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n invalidPhoneNumber = 'Invalid phone number';\n DK = 'Denmark';\n DE = 'Germany';\n FI = 'Finland';\n NO = 'Norway';\n SE = 'Sweden';\n PL = 'Poland';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Component,\n ElementRef,\n HostBinding,\n OnInit,\n ViewChild,\n ViewEncapsulation,\n forwardRef,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n ValidationErrors,\n ValidatorFn,\n} from '@angular/forms';\nimport { MaskitoDirective } from '@maskito/angular';\nimport { MatSelectChange, MatSelectModule } from '@angular/material/select';\nimport { MASKITO_DEFAULT_OPTIONS, maskitoTransform } from '@maskito/core';\nimport { maskitoPhoneOptionsGenerator } from '@maskito/phone';\nimport { isValidPhoneNumber, type CountryCode } from 'libphonenumber-js';\nimport phoneMetadata from 'libphonenumber-js/min/metadata';\n\nimport { WattFlagComponent } from '@energinet/watt/icon/flags';\nimport { WattFieldComponent, WattFieldErrorComponent } from '@energinet/watt/field';\n\nimport { WattPhoneFieldIntlService } from './watt-phone-field-intl.service';\n\ntype Contry = {\n countryIsoCode: CountryCode;\n phoneExtension: string;\n};\n\nfunction phoneValidator(countryCode: CountryCode): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!control.value) return null;\n const valid = isValidPhoneNumber(control.value, countryCode);\n\n return valid ? null : { invalidPhone: true };\n };\n}\n\n@Component({\n selector: 'watt-phone-field',\n encapsulation: ViewEncapsulation.None,\n imports: [\n ReactiveFormsModule,\n MatSelectModule,\n MaskitoDirective,\n WattFieldComponent,\n WattFieldErrorComponent,\n WattFlagComponent,\n ],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattPhoneFieldComponent),\n multi: true,\n },\n ],\n template: `\n <watt-field [label]=\"label()\" [control]=\"formControl()\">\n <div class=\"watt-phone-field__prefix-container\">\n <mat-select\n panelWidth=\"\"\n panelClass=\"watt-phone-field__select\"\n [hideSingleSelectionIndicator]=\"true\"\n [value]=\"chosenCountry().countryIsoCode\"\n (selectionChange)=\"selectedContry($event)\"\n >\n <mat-select-trigger>\n <watt-flag [country]=\"chosenCountry().countryIsoCode\" />\n </mat-select-trigger>\n @for (contry of countries; track contry; let index = $index) {\n <mat-option value=\"{{ contry.countryIsoCode }}\">\n <watt-flag [country]=\"contry.countryIsoCode\" />\n <div>{{ getCountryName(contry.countryIsoCode) }}</div>\n </mat-option>\n }\n </mat-select>\n <input\n [attr.aria-label]=\"label()\"\n autocomplete=\"tel\"\n inputmode=\"tel\"\n [value]=\"value\"\n [formControl]=\"formControl()\"\n (blur)=\"onTouched()\"\n (input)=\"onChanged($event)\"\n [maskito]=\"mask\"\n #phoneNumberInput\n />\n </div>\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n @if (formControl().hasError('invalidPhone')) {\n <watt-field-error> {{ intl.invalidPhoneNumber }} </watt-field-error>\n }\n </watt-field>\n `,\n styleUrl: './watt-phone-field.component.scss',\n})\nexport class WattPhoneFieldComponent implements ControlValueAccessor, OnInit {\n /** @ignore */\n readonly countries: Contry[] = [\n { countryIsoCode: 'DK', phoneExtension: '+45' },\n { countryIsoCode: 'SE', phoneExtension: '+46' },\n { countryIsoCode: 'NO', phoneExtension: '+47' },\n { countryIsoCode: 'DE', phoneExtension: '+49' },\n { countryIsoCode: 'FI', phoneExtension: '+358' },\n { countryIsoCode: 'PL', phoneExtension: '+48' },\n ];\n\n formControl = input.required<FormControl>();\n label = input<string>();\n\n /** @ignore */\n chosenCountry = signal<Contry>(this.countries[0]);\n\n /** @ignore */\n mask = MASKITO_DEFAULT_OPTIONS;\n\n /** @ignore */\n intl = inject(WattPhoneFieldIntlService);\n\n /** @ignore */\n @HostBinding('attr.watt-field-disabled')\n isDisabled = false;\n\n /** @ignore */\n value: string | null = null;\n\n /** @ignore */\n @ViewChild('phoneNumberInput') phoneNumberInput!: ElementRef<HTMLInputElement>;\n\n /** @ignore */\n ngOnInit(): void {\n this.setup();\n }\n\n /** @ignore */\n writeValue(value: string): void {\n if (value) {\n const country = this.countries.find((country) => value.startsWith(country.phoneExtension));\n\n if (country) {\n // Exclude Signal from being tracked\n // in case the parent component sets the value inside an `effect`.\n // Without this, updating the Signal internaly triggers the parrent `effect` to re-run.\n // Note: Revisit once v19 is released because the `effect` API has changed\n // significantly and this might not be necessary anymore\n untracked(() => {\n this.setCountry(country);\n });\n\n value = maskitoTransform(value, this.mask);\n }\n }\n\n this.value = value;\n }\n\n /** @ignore */\n onChange: (value: string) => void = () => {\n /* noop function */\n };\n\n /** @ignore */\n onTouched: () => void = () => {\n /* noop function */\n };\n\n /** @ignore */\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled = isDisabled;\n }\n\n /** @ignore */\n selectedContry({ value }: MatSelectChange) {\n const country = this.countries.find((contry) => contry.countryIsoCode === value);\n\n if (!country) {\n throw new Error('Prefix not found');\n }\n\n this.setCountry(country);\n this.formControl().reset();\n\n setTimeout(() => {\n this.phoneNumberInput.nativeElement.focus();\n }, 100);\n }\n\n /** @ignore */\n setCountry(country: Contry) {\n this.chosenCountry.set(country);\n this.setup();\n }\n\n /** @ignore */\n onChanged(event: Event): void {\n const value = (event.target as HTMLSelectElement)?.value;\n this.onChange(value);\n }\n\n /** @ignore */\n private generatePhoneOptions(): void {\n const phoneOptions = maskitoPhoneOptionsGenerator({\n countryIsoCode: this.chosenCountry().countryIsoCode,\n metadata: phoneMetadata,\n separator: ' ',\n });\n\n this.mask = phoneOptions;\n }\n\n /** @ignore */\n private setup(): void {\n this.generatePhoneOptions();\n this.setValidator();\n }\n\n /** @ignore */\n private setValidator() {\n const countryCode = this.chosenCountry().countryIsoCode;\n this.formControl().addValidators(phoneValidator(countryCode));\n }\n\n /** @ignore */\n getCountryName(countryIsoCode: CountryCode) {\n return this.intl[countryIsoCode as keyof WattPhoneFieldIntlService];\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattPhoneFieldComponent } from './watt-phone-field.component';\nexport { WattPhoneFieldIntlService } from './watt-phone-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,yBAAyB,C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;AAsCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,m4BAAA,CAAA,EAAA;8BA4BD,UAAU,EAAA,CAAA;sBADT,WAAW;uBAAC,0BAA0B;gBAOR,gBAAgB,EAAA,CAAA;sBAA9C,SAAS;uBAAC,kBAAkB;;;AC5J/B;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-phone-field.mjs","sources":["../../../libs/watt/package/phone-field/watt-phone-field-intl.service.ts","../../../libs/watt/package/phone-field/watt-phone-field.component.ts","../../../libs/watt/package/phone-field/index.ts","../../../libs/watt/package/phone-field/energinet-watt-phone-field.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattPhoneFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n invalidPhoneNumber = 'Invalid phone number';\n DK = 'Denmark';\n DE = 'Germany';\n FI = 'Finland';\n NO = 'Norway';\n SE = 'Sweden';\n PL = 'Poland';\n NL = 'Netherlands';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Component,\n ElementRef,\n HostBinding,\n OnInit,\n ViewChild,\n ViewEncapsulation,\n forwardRef,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n ValidationErrors,\n ValidatorFn,\n} from '@angular/forms';\nimport { MaskitoDirective } from '@maskito/angular';\nimport { MatSelectChange, MatSelectModule } from '@angular/material/select';\nimport { MASKITO_DEFAULT_OPTIONS, maskitoTransform } from '@maskito/core';\nimport { maskitoPhoneOptionsGenerator } from '@maskito/phone';\nimport { isValidPhoneNumber, type CountryCode } from 'libphonenumber-js';\nimport phoneMetadata from 'libphonenumber-js/min/metadata';\n\nimport { WattFlagComponent } from '@energinet/watt/icon/flags';\nimport { WattFieldComponent, WattFieldErrorComponent } from '@energinet/watt/field';\n\nimport { WattPhoneFieldIntlService } from './watt-phone-field-intl.service';\n\ntype Contry = {\n countryIsoCode: CountryCode;\n phoneExtension: string;\n};\n\nfunction phoneValidator(countryCode: CountryCode): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!control.value) return null;\n const valid = isValidPhoneNumber(control.value, countryCode);\n\n return valid ? null : { invalidPhone: true };\n };\n}\n\n@Component({\n selector: 'watt-phone-field',\n encapsulation: ViewEncapsulation.None,\n imports: [\n ReactiveFormsModule,\n MatSelectModule,\n MaskitoDirective,\n WattFieldComponent,\n WattFieldErrorComponent,\n WattFlagComponent,\n ],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattPhoneFieldComponent),\n multi: true,\n },\n ],\n template: `\n <watt-field [label]=\"label()\" [control]=\"formControl()\">\n <div class=\"watt-phone-field__prefix-container\">\n <mat-select\n panelWidth=\"\"\n panelClass=\"watt-phone-field__select\"\n [hideSingleSelectionIndicator]=\"true\"\n [value]=\"chosenCountry().countryIsoCode\"\n (selectionChange)=\"selectedContry($event)\"\n >\n <mat-select-trigger>\n <watt-flag [country]=\"chosenCountry().countryIsoCode\" />\n </mat-select-trigger>\n @for (contry of countries; track contry; let index = $index) {\n <mat-option value=\"{{ contry.countryIsoCode }}\">\n <watt-flag [country]=\"contry.countryIsoCode\" />\n <div>{{ getCountryName(contry.countryIsoCode) }}</div>\n </mat-option>\n }\n </mat-select>\n <input\n [attr.aria-label]=\"label()\"\n autocomplete=\"tel\"\n inputmode=\"tel\"\n [value]=\"value\"\n [formControl]=\"formControl()\"\n (blur)=\"onTouched()\"\n (input)=\"onChanged($event)\"\n [maskito]=\"mask\"\n #phoneNumberInput\n />\n </div>\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n @if (formControl().hasError('invalidPhone')) {\n <watt-field-error> {{ intl.invalidPhoneNumber }} </watt-field-error>\n }\n </watt-field>\n `,\n styleUrl: './watt-phone-field.component.scss',\n})\nexport class WattPhoneFieldComponent implements ControlValueAccessor, OnInit {\n /** @ignore */\n readonly countries: Contry[] = [\n { countryIsoCode: 'DK', phoneExtension: '+45' },\n { countryIsoCode: 'SE', phoneExtension: '+46' },\n { countryIsoCode: 'NO', phoneExtension: '+47' },\n { countryIsoCode: 'DE', phoneExtension: '+49' },\n { countryIsoCode: 'FI', phoneExtension: '+358' },\n { countryIsoCode: 'PL', phoneExtension: '+48' },\n { countryIsoCode: 'NL', phoneExtension: '+31' },\n ];\n\n formControl = input.required<FormControl>();\n label = input<string>();\n\n /** @ignore */\n chosenCountry = signal<Contry>(this.countries[0]);\n\n /** @ignore */\n mask = MASKITO_DEFAULT_OPTIONS;\n\n /** @ignore */\n intl = inject(WattPhoneFieldIntlService);\n\n /** @ignore */\n @HostBinding('attr.watt-field-disabled')\n isDisabled = false;\n\n /** @ignore */\n value: string | null = null;\n\n /** @ignore */\n @ViewChild('phoneNumberInput') phoneNumberInput!: ElementRef<HTMLInputElement>;\n\n /** @ignore */\n ngOnInit(): void {\n this.setup();\n }\n\n /** @ignore */\n writeValue(value: string): void {\n if (value) {\n const country = this.countries.find((country) => value.startsWith(country.phoneExtension));\n\n if (country) {\n // Exclude Signal from being tracked\n // in case the parent component sets the value inside an `effect`.\n // Without this, updating the Signal internaly triggers the parrent `effect` to re-run.\n // Note: Revisit once v19 is released because the `effect` API has changed\n // significantly and this might not be necessary anymore\n untracked(() => {\n this.setCountry(country);\n });\n\n value = maskitoTransform(value, this.mask);\n }\n }\n\n this.value = value;\n }\n\n /** @ignore */\n onChange: (value: string) => void = () => {\n /* noop function */\n };\n\n /** @ignore */\n onTouched: () => void = () => {\n /* noop function */\n };\n\n /** @ignore */\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled = isDisabled;\n }\n\n /** @ignore */\n selectedContry({ value }: MatSelectChange) {\n const country = this.countries.find((contry) => contry.countryIsoCode === value);\n\n if (!country) {\n throw new Error('Prefix not found');\n }\n\n this.setCountry(country);\n this.formControl().reset();\n\n setTimeout(() => {\n this.phoneNumberInput.nativeElement.focus();\n }, 100);\n }\n\n /** @ignore */\n setCountry(country: Contry) {\n this.chosenCountry.set(country);\n this.setup();\n }\n\n /** @ignore */\n onChanged(event: Event): void {\n const value = (event.target as HTMLSelectElement)?.value;\n this.onChange(value);\n }\n\n /** @ignore */\n private generatePhoneOptions(): void {\n const phoneOptions = maskitoPhoneOptionsGenerator({\n countryIsoCode: this.chosenCountry().countryIsoCode,\n metadata: phoneMetadata,\n separator: ' ',\n });\n\n this.mask = phoneOptions;\n }\n\n /** @ignore */\n private setup(): void {\n this.generatePhoneOptions();\n this.setValidator();\n }\n\n /** @ignore */\n private setValidator() {\n const countryCode = this.chosenCountry().countryIsoCode;\n this.formControl().addValidators(phoneValidator(countryCode));\n }\n\n /** @ignore */\n getCountryName(countryIsoCode: CountryCode) {\n return this.intl[countryIsoCode as keyof WattPhoneFieldIntlService];\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattPhoneFieldComponent } from './watt-phone-field.component';\nexport { WattPhoneFieldIntlService } from './watt-phone-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,yBAAyB,CAAA;AAC3B,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,kBAAkB,GAAG,sBAAsB;IAC3C,EAAE,GAAG,SAAS;IACd,EAAE,GAAG,SAAS;IACd,EAAE,GAAG,SAAS;IACd,EAAE,GAAG,QAAQ;IACb,EAAE,GAAG,QAAQ;IACb,EAAE,GAAG,QAAQ;IACb,EAAE,GAAG,aAAa;uGATP,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,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,QAAA,EAAA,kBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACvB,iBAAiB,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAkDR,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBA3DnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EACb,aAAA,EAAA,iBAAiB,CAAC,IAAI,EAC5B,OAAA,EAAA;wBACP,mBAAmB;wBACnB,eAAe;wBACf,gBAAgB;wBAChB,kBAAkB;wBAClB,uBAAuB;wBACvB,iBAAiB;qBAClB,EACU,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,6BAA6B,CAAC;AACtD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;qBACF,EACS,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,m4BAAA,CAAA,EAAA;8BA6BD,UAAU,EAAA,CAAA;sBADT,WAAW;uBAAC,0BAA0B;gBAOR,gBAAgB,EAAA,CAAA;sBAA9C,SAAS;uBAAC,kBAAkB;;;AC7J/B;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class WattFlagNetherlandsComponent {
|
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WattFlagNetherlandsComponent, never>;
|
|
4
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<WattFlagNetherlandsComponent, "watt-flag-nl", never, {}, {}, never, never, true, never>;
|
|
5
|
+
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { EventEmitter, TemplateRef } from '@angular/core';
|
|
18
18
|
import { MatDialogRef } from '@angular/material/dialog';
|
|
19
|
+
import { WattIcon } from '@energinet/watt/icon';
|
|
19
20
|
import * as i0 from "@angular/core";
|
|
20
21
|
export type WattModalSize = 'small' | 'medium' | 'large';
|
|
21
22
|
/**
|
|
@@ -48,6 +49,8 @@ export declare class WattModalComponent {
|
|
|
48
49
|
minHeight: string;
|
|
49
50
|
/** Whether the dialog should restore focus to the previously-focused element, after it's closed. */
|
|
50
51
|
restoreFocus: boolean;
|
|
52
|
+
/** Icon displayed next to the modal title. */
|
|
53
|
+
titleIcon?: WattIcon;
|
|
51
54
|
/**
|
|
52
55
|
* When modal is closed, emits `true` if it was "accepted",
|
|
53
56
|
* otherwise emits `false`.
|
|
@@ -74,7 +77,7 @@ export declare class WattModalComponent {
|
|
|
74
77
|
*/
|
|
75
78
|
onResize(event: ResizeObserverEntry): void;
|
|
76
79
|
static ɵfac: i0.ɵɵFactoryDeclaration<WattModalComponent, never>;
|
|
77
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<WattModalComponent, "watt-modal", never, { "title": { "alias": "title"; "required": false; }; "size": { "alias": "size"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingMessage": { "alias": "loadingMessage"; "required": false; }; "disableClose": { "alias": "disableClose"; "required": false; }; "hideCloseButton": { "alias": "hideCloseButton"; "required": false; }; "disableEscAndBackdropClose": { "alias": "disableEscAndBackdropClose"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; "panelClass": { "alias": "panelClass"; "required": false; }; "minHeight": { "alias": "minHeight"; "required": false; }; "restoreFocus": { "alias": "restoreFocus"; "required": false; }; }, { "closed": "closed"; }, never, ["*", "watt-modal-actions"], true, never>;
|
|
80
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<WattModalComponent, "watt-modal", never, { "title": { "alias": "title"; "required": false; }; "size": { "alias": "size"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingMessage": { "alias": "loadingMessage"; "required": false; }; "disableClose": { "alias": "disableClose"; "required": false; }; "hideCloseButton": { "alias": "hideCloseButton"; "required": false; }; "disableEscAndBackdropClose": { "alias": "disableEscAndBackdropClose"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; "panelClass": { "alias": "panelClass"; "required": false; }; "minHeight": { "alias": "minHeight"; "required": false; }; "restoreFocus": { "alias": "restoreFocus"; "required": false; }; "titleIcon": { "alias": "titleIcon"; "required": false; }; }, { "closed": "closed"; }, never, ["*", "watt-modal-actions"], true, never>;
|
|
78
81
|
}
|
|
79
82
|
/**
|
|
80
83
|
* Component for projecting buttons (actions) to the bottom of the modal.
|
package/package.json
CHANGED