@energinet/watt 1.5.13 → 1.5.15
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-field.mjs +34 -7
- package/fesm2022/energinet-watt-field.mjs.map +1 -1
- package/fesm2022/energinet-watt-icon-flags.mjs +58 -1
- package/fesm2022/energinet-watt-icon-flags.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-ch.d.ts +5 -0
- package/package.json +1 -1
- package/phone-field/watt-phone-field-intl.service.d.ts +1 -0
|
@@ -8,6 +8,7 @@ import { WattTooltipDirective } from '@energinet/watt/tooltip';
|
|
|
8
8
|
import { VaterStackComponent } from '@energinet/watt/vater';
|
|
9
9
|
import { WattRangeValidators } from '@energinet/watt/validators';
|
|
10
10
|
import { Subject } from 'rxjs';
|
|
11
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
11
12
|
|
|
12
13
|
//#region License
|
|
13
14
|
/**
|
|
@@ -117,7 +118,17 @@ class WattFieldComponent {
|
|
|
117
118
|
}
|
|
118
119
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
119
120
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattFieldComponent, isStandalone: true, selector: "watt-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, chipMode: { classPropertyName: "chipMode", publicName: "chipMode", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, anchorName: { classPropertyName: "anchorName", publicName: "anchorName", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.watt-field--chip": "chipMode()", "class.watt-field--unlabelled": "unlabelled()", "class.watt-field--disabled": "control()?.disabled" } }, viewQueries: [{ propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
120
|
-
|
|
121
|
+
@if (chipMode()) {
|
|
122
|
+
<span class="watt-label">
|
|
123
|
+
<ng-container *ngTemplateOutlet="template" />
|
|
124
|
+
</span>
|
|
125
|
+
} @else {
|
|
126
|
+
<label [attr.for]="id()">
|
|
127
|
+
<ng-container *ngTemplateOutlet="template" />
|
|
128
|
+
</label>
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
<ng-template #template>
|
|
121
132
|
@if (label()) {
|
|
122
133
|
<span class="label" [class.required]="isRequired()">
|
|
123
134
|
{{ label() }}
|
|
@@ -149,13 +160,29 @@ class WattFieldComponent {
|
|
|
149
160
|
@if (isEmpty()) {
|
|
150
161
|
<watt-field-error>{{ intl.required }}</watt-field-error>
|
|
151
162
|
}
|
|
152
|
-
</
|
|
153
|
-
`, isInline: true, styles: ["[watt-field-disabled=true] watt-field .label,.watt-field--disabled .label{color:var(--watt-disabled-text-label-color)}[watt-field-disabled=true] .watt-field-wrapper,.watt-field--disabled .watt-field-wrapper{background-color:var(--watt-field-disabled-background-color)}watt-field watt-field-hint{display:block}watt-field watt-field-error,.ng-valid watt-field watt-field-error{display:none}form.ng-submitted .ng-invalid watt-field watt-field-hint,:not(form).ng-touched.ng-invalid watt-field watt-field-hint{display:none}form.ng-submitted .ng-invalid watt-field watt-field-error,:not(form).ng-touched.ng-invalid watt-field watt-field-error{display:block}form.ng-submitted .ng-invalid watt-field .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field .watt-field-wrapper{border-color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label,:not(form).ng-touched.ng-invalid watt-field .label{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label.required:after,:not(form).ng-touched.ng-invalid watt-field .label.required:after{color:var(--watt-color-state-danger)}.watt-field-wrapper input{width:100%;border:none;outline:none;background-color:transparent}.watt-field-placeholder{position:absolute;padding:1px 2px;pointer-events:none;white-space:nowrap}.watt-field--has-placeholder input,.watt-field-placeholder{font-family:Droid Sans Mono,monospace;letter-spacing:-.03em}.watt-field-filler{color:var(--watt-on-light-low-emphasis)}.watt-field-ghost{color:transparent}watt-field{--watt-text-color: var(--watt-on-light-high-emphasis);--watt-disabled-text-label-color: var(--watt-on-light-low-emphasis);--watt-field-disabled-background-color: var(--watt-color-neutral-grey-100);--watt-input-border-radius: 4px;--watt-border-color: var(--watt-on-light-low-emphasis);--watt-label-text-color: var(--watt-text-color);width:100%;display:block}watt-field:not(.watt-field--chip){min-height:93px}watt-field:not(.watt-field--chip).watt-field--unlabelled{min-height:66px}watt-field
|
|
163
|
+
</ng-template>
|
|
164
|
+
`, isInline: true, styles: ["[watt-field-disabled=true] watt-field .label,.watt-field--disabled .label{color:var(--watt-disabled-text-label-color)}[watt-field-disabled=true] .watt-field-wrapper,.watt-field--disabled .watt-field-wrapper{background-color:var(--watt-field-disabled-background-color)}watt-field watt-field-hint{display:block}watt-field watt-field-error,.ng-valid watt-field watt-field-error{display:none}form.ng-submitted .ng-invalid watt-field watt-field-hint,:not(form).ng-touched.ng-invalid watt-field watt-field-hint{display:none}form.ng-submitted .ng-invalid watt-field watt-field-error,:not(form).ng-touched.ng-invalid watt-field watt-field-error{display:block}form.ng-submitted .ng-invalid watt-field .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field .watt-field-wrapper{border-color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label,:not(form).ng-touched.ng-invalid watt-field .label{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label.required:after,:not(form).ng-touched.ng-invalid watt-field .label.required:after{color:var(--watt-color-state-danger)}.watt-field-wrapper input{width:100%;border:none;outline:none;background-color:transparent}.watt-field-placeholder{position:absolute;padding:1px 2px;pointer-events:none;white-space:nowrap}.watt-field--has-placeholder input,.watt-field-placeholder{font-family:Droid Sans Mono,monospace;letter-spacing:-.03em}.watt-field-filler{color:var(--watt-on-light-low-emphasis)}.watt-field-ghost{color:transparent}watt-field{--watt-text-color: var(--watt-on-light-high-emphasis);--watt-disabled-text-label-color: var(--watt-on-light-low-emphasis);--watt-field-disabled-background-color: var(--watt-color-neutral-grey-100);--watt-input-border-radius: 4px;--watt-border-color: var(--watt-on-light-low-emphasis);--watt-label-text-color: var(--watt-text-color);width:100%;display:block}watt-field:not(.watt-field--chip){min-height:93px}watt-field:not(.watt-field--chip).watt-field--unlabelled{min-height:66px}watt-field .label{min-height:27px;display:flex;align-items:center}watt-field .label watt-icon{margin-left:var(--watt-space-s)}watt-field .label watt-tooltip{max-width:250px}watt-field .label.required:after{content:\"*\";margin-left:var(--watt-space-s);color:var(--watt-color-primary)}watt-field label,watt-field .watt-label{color:var(--watt-label-text-color);display:block;width:100%}watt-field label .watt-field-wrapper,watt-field .watt-label .watt-field-wrapper{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;display:flex;position:relative;width:100%;padding-left:var(--watt-space-s);border-radius:var(--watt-input-border-radius);border:1px solid var(--watt-border-color);overflow:hidden;color:var(--watt-text-color);align-items:center;gap:var(--watt-space-m);background-color:var(--watt-color-neutral-white)}watt-field label .watt-field-wrapper:focus-within,watt-field .watt-label .watt-field-wrapper:focus-within{--watt-border-color: var(--watt-color-primary)}watt-field label watt-field-hint,watt-field label watt-field-error,watt-field .watt-label watt-field-hint,watt-field .watt-label watt-field-error{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-field label :not(.watt-field--chip) watt-field-hint,watt-field label :not(.watt-field--chip) watt-field-error,watt-field .watt-label :not(.watt-field--chip) watt-field-hint,watt-field .watt-label :not(.watt-field--chip) watt-field-error{padding-left:var(--watt-space-s)}watt-field.watt-field--chip .watt-field-wrapper{border:none;padding-left:0;margin-bottom:var(--watt-space-xs)}watt-field:not(.watt-field--chip) .watt-field-wrapper{min-height:46px}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "directive", type: WattTooltipDirective, selector: "[wattTooltip]", inputs: ["wattTooltip", "wattTooltipPosition", "wattTooltipVariant"], exportAs: ["wattTooltip"] }, { kind: "component", type: WattFieldErrorComponent, selector: "watt-field-error" }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]", inputs: ["align", "direction", "gap", "justify", "offset"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
154
165
|
}
|
|
155
166
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattFieldComponent, decorators: [{
|
|
156
167
|
type: Component,
|
|
157
|
-
args: [{ selector: 'watt-field', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
|
|
158
|
-
|
|
168
|
+
args: [{ selector: 'watt-field', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
|
|
169
|
+
NgTemplateOutlet,
|
|
170
|
+
WattIconComponent,
|
|
171
|
+
WattTooltipDirective,
|
|
172
|
+
WattFieldErrorComponent,
|
|
173
|
+
VaterStackComponent,
|
|
174
|
+
], template: `
|
|
175
|
+
@if (chipMode()) {
|
|
176
|
+
<span class="watt-label">
|
|
177
|
+
<ng-container *ngTemplateOutlet="template" />
|
|
178
|
+
</span>
|
|
179
|
+
} @else {
|
|
180
|
+
<label [attr.for]="id()">
|
|
181
|
+
<ng-container *ngTemplateOutlet="template" />
|
|
182
|
+
</label>
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
<ng-template #template>
|
|
159
186
|
@if (label()) {
|
|
160
187
|
<span class="label" [class.required]="isRequired()">
|
|
161
188
|
{{ label() }}
|
|
@@ -187,12 +214,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
187
214
|
@if (isEmpty()) {
|
|
188
215
|
<watt-field-error>{{ intl.required }}</watt-field-error>
|
|
189
216
|
}
|
|
190
|
-
</
|
|
217
|
+
</ng-template>
|
|
191
218
|
`, host: {
|
|
192
219
|
'[class.watt-field--chip]': 'chipMode()',
|
|
193
220
|
'[class.watt-field--unlabelled]': 'unlabelled()',
|
|
194
221
|
'[class.watt-field--disabled]': 'control()?.disabled',
|
|
195
|
-
}, styles: ["[watt-field-disabled=true] watt-field .label,.watt-field--disabled .label{color:var(--watt-disabled-text-label-color)}[watt-field-disabled=true] .watt-field-wrapper,.watt-field--disabled .watt-field-wrapper{background-color:var(--watt-field-disabled-background-color)}watt-field watt-field-hint{display:block}watt-field watt-field-error,.ng-valid watt-field watt-field-error{display:none}form.ng-submitted .ng-invalid watt-field watt-field-hint,:not(form).ng-touched.ng-invalid watt-field watt-field-hint{display:none}form.ng-submitted .ng-invalid watt-field watt-field-error,:not(form).ng-touched.ng-invalid watt-field watt-field-error{display:block}form.ng-submitted .ng-invalid watt-field .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field .watt-field-wrapper{border-color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label,:not(form).ng-touched.ng-invalid watt-field .label{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label.required:after,:not(form).ng-touched.ng-invalid watt-field .label.required:after{color:var(--watt-color-state-danger)}.watt-field-wrapper input{width:100%;border:none;outline:none;background-color:transparent}.watt-field-placeholder{position:absolute;padding:1px 2px;pointer-events:none;white-space:nowrap}.watt-field--has-placeholder input,.watt-field-placeholder{font-family:Droid Sans Mono,monospace;letter-spacing:-.03em}.watt-field-filler{color:var(--watt-on-light-low-emphasis)}.watt-field-ghost{color:transparent}watt-field{--watt-text-color: var(--watt-on-light-high-emphasis);--watt-disabled-text-label-color: var(--watt-on-light-low-emphasis);--watt-field-disabled-background-color: var(--watt-color-neutral-grey-100);--watt-input-border-radius: 4px;--watt-border-color: var(--watt-on-light-low-emphasis);--watt-label-text-color: var(--watt-text-color);width:100%;display:block}watt-field:not(.watt-field--chip){min-height:93px}watt-field:not(.watt-field--chip).watt-field--unlabelled{min-height:66px}watt-field
|
|
222
|
+
}, styles: ["[watt-field-disabled=true] watt-field .label,.watt-field--disabled .label{color:var(--watt-disabled-text-label-color)}[watt-field-disabled=true] .watt-field-wrapper,.watt-field--disabled .watt-field-wrapper{background-color:var(--watt-field-disabled-background-color)}watt-field watt-field-hint{display:block}watt-field watt-field-error,.ng-valid watt-field watt-field-error{display:none}form.ng-submitted .ng-invalid watt-field watt-field-hint,:not(form).ng-touched.ng-invalid watt-field watt-field-hint{display:none}form.ng-submitted .ng-invalid watt-field watt-field-error,:not(form).ng-touched.ng-invalid watt-field watt-field-error{display:block}form.ng-submitted .ng-invalid watt-field .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field .watt-field-wrapper{border-color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label,:not(form).ng-touched.ng-invalid watt-field .label{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label.required:after,:not(form).ng-touched.ng-invalid watt-field .label.required:after{color:var(--watt-color-state-danger)}.watt-field-wrapper input{width:100%;border:none;outline:none;background-color:transparent}.watt-field-placeholder{position:absolute;padding:1px 2px;pointer-events:none;white-space:nowrap}.watt-field--has-placeholder input,.watt-field-placeholder{font-family:Droid Sans Mono,monospace;letter-spacing:-.03em}.watt-field-filler{color:var(--watt-on-light-low-emphasis)}.watt-field-ghost{color:transparent}watt-field{--watt-text-color: var(--watt-on-light-high-emphasis);--watt-disabled-text-label-color: var(--watt-on-light-low-emphasis);--watt-field-disabled-background-color: var(--watt-color-neutral-grey-100);--watt-input-border-radius: 4px;--watt-border-color: var(--watt-on-light-low-emphasis);--watt-label-text-color: var(--watt-text-color);width:100%;display:block}watt-field:not(.watt-field--chip){min-height:93px}watt-field:not(.watt-field--chip).watt-field--unlabelled{min-height:66px}watt-field .label{min-height:27px;display:flex;align-items:center}watt-field .label watt-icon{margin-left:var(--watt-space-s)}watt-field .label watt-tooltip{max-width:250px}watt-field .label.required:after{content:\"*\";margin-left:var(--watt-space-s);color:var(--watt-color-primary)}watt-field label,watt-field .watt-label{color:var(--watt-label-text-color);display:block;width:100%}watt-field label .watt-field-wrapper,watt-field .watt-label .watt-field-wrapper{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;display:flex;position:relative;width:100%;padding-left:var(--watt-space-s);border-radius:var(--watt-input-border-radius);border:1px solid var(--watt-border-color);overflow:hidden;color:var(--watt-text-color);align-items:center;gap:var(--watt-space-m);background-color:var(--watt-color-neutral-white)}watt-field label .watt-field-wrapper:focus-within,watt-field .watt-label .watt-field-wrapper:focus-within{--watt-border-color: var(--watt-color-primary)}watt-field label watt-field-hint,watt-field label watt-field-error,watt-field .watt-label watt-field-hint,watt-field .watt-label watt-field-error{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-field label :not(.watt-field--chip) watt-field-hint,watt-field label :not(.watt-field--chip) watt-field-error,watt-field .watt-label :not(.watt-field--chip) watt-field-hint,watt-field .watt-label :not(.watt-field--chip) watt-field-error{padding-left:var(--watt-space-s)}watt-field.watt-field--chip .watt-field-wrapper{border:none;padding-left:0;margin-bottom:var(--watt-space-xs)}watt-field:not(.watt-field--chip) .watt-field-wrapper{min-height:46px}\n"] }]
|
|
196
223
|
}], ctorParameters: () => [] });
|
|
197
224
|
|
|
198
225
|
//#region License
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-field.mjs","sources":["../../../libs/watt/package/field/watt-field-intl.service.ts","../../../libs/watt/package/field/watt-field-error.component.ts","../../../libs/watt/package/field/watt-field.component.ts","../../../libs/watt/package/field/watt-field-hint.component.ts","../../../libs/watt/package/field/index.ts","../../../libs/watt/package/field/energinet-watt-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 WattFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n required = 'Field is required';\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 { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-error {\n color: var(--watt-color-state-danger);\n }\n `,\n ],\n})\nexport class WattFieldErrorComponent {}\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 ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterStackComponent } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WattIconComponent, WattTooltipDirective, WattFieldErrorComponent, VaterStackComponent],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n <label [attr.for]=\"id()\">\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-stack direction=\"row\" gap=\"s\">\n <div\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-stack>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </label>\n `,\n host: {\n '[class.watt-field--chip]': 'chipMode()',\n '[class.watt-field--unlabelled]': 'unlabelled()',\n '[class.watt-field--disabled]': 'control()?.disabled',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n\n value = signal('');\n filler = computed(() => this.placeholder().slice(this.value().length));\n ghost = computed(() => this.value().slice(0, this.placeholder().length));\n\n unlabelled = computed(() => !this.label());\n\n errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n\n // Used for text fields with autocomplete\n wrapper = viewChild.required<ElementRef>('wrapper');\n\n constructor() {\n const control$ = toObservable(this.control).pipe(filter((control) => control !== null));\n\n // Track value in order to update ghost and filler\n const value$ = control$.pipe(\n switchMap((control) =>\n control.valueChanges.pipe(\n startWith(control.value),\n map((value) => (value === null || value === undefined ? '' : value.toString())),\n tap((value) => this.value.set(value))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Track status in order to update required state and show errors\n const status$ = control$.pipe(\n switchMap((control) =>\n control.statusChanges.pipe(\n startWith(control.status),\n tap(() => this.isRequired.set(this.isRequiredControl(control))),\n tap(() => this.errors.set(control.errors))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Subscribe for side effects\n value$.subscribe();\n status$.subscribe();\n }\n\n isRequiredControl(control: FormControl) {\n const validators = [Validators.required, WattRangeValidators.required];\n return validators.some((validator) => control.hasValidator(validator));\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\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-field-hint',\n styles: [\n `\n :host {\n color: var(--watt-color-neutral-grey-700);\n }\n `,\n ],\n template: `<ng-content />`,\n})\nexport class WattFieldHintComponent {}\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 { WattFieldComponent } from './watt-field.component';\nexport { WattFieldErrorComponent } from './watt-field-error.component';\nexport { WattFieldHintComponent } from './watt-field-hint.component';\nexport { WattFieldIntlService } from './watt-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,oBAAoB,CAAA;AACtB,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,QAAQ,GAAG,mBAAmB;uGAFnB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA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,EAAA,CAAA,+2GAAA,CAAA,EAAA;;;ACtFH;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAca,sBAAsB,CAAA;uGAAtB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,2EAFvB,CAAgB,cAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA,CAAA;;2FAEf,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,YAQjB,CAAgB,cAAA,CAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA;;;AC7B5B;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-field.mjs","sources":["../../../libs/watt/package/field/watt-field-intl.service.ts","../../../libs/watt/package/field/watt-field-error.component.ts","../../../libs/watt/package/field/watt-field.component.ts","../../../libs/watt/package/field/watt-field-hint.component.ts","../../../libs/watt/package/field/index.ts","../../../libs/watt/package/field/energinet-watt-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 WattFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n required = 'Field is required';\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 { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-error {\n color: var(--watt-color-state-danger);\n }\n `,\n ],\n})\nexport class WattFieldErrorComponent {}\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 ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterStackComponent } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterStackComponent,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode()) {\n <span class=\"watt-label\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.for]=\"id()\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </label>\n }\n\n <ng-template #template>\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-stack direction=\"row\" gap=\"s\">\n <div\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-stack>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--chip]': 'chipMode()',\n '[class.watt-field--unlabelled]': 'unlabelled()',\n '[class.watt-field--disabled]': 'control()?.disabled',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n\n value = signal('');\n filler = computed(() => this.placeholder().slice(this.value().length));\n ghost = computed(() => this.value().slice(0, this.placeholder().length));\n\n unlabelled = computed(() => !this.label());\n\n errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n\n // Used for text fields with autocomplete\n wrapper = viewChild.required<ElementRef>('wrapper');\n\n constructor() {\n const control$ = toObservable(this.control).pipe(filter((control) => control !== null));\n\n // Track value in order to update ghost and filler\n const value$ = control$.pipe(\n switchMap((control) =>\n control.valueChanges.pipe(\n startWith(control.value),\n map((value) => (value === null || value === undefined ? '' : value.toString())),\n tap((value) => this.value.set(value))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Track status in order to update required state and show errors\n const status$ = control$.pipe(\n switchMap((control) =>\n control.statusChanges.pipe(\n startWith(control.status),\n tap(() => this.isRequired.set(this.isRequiredControl(control))),\n tap(() => this.errors.set(control.errors))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Subscribe for side effects\n value$.subscribe();\n status$.subscribe();\n }\n\n isRequiredControl(control: FormControl) {\n const validators = [Validators.required, WattRangeValidators.required];\n return validators.some((validator) => control.hasValidator(validator));\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\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-field-hint',\n styles: [\n `\n :host {\n color: var(--watt-color-neutral-grey-700);\n }\n `,\n ],\n template: `<ng-content />`,\n})\nexport class WattFieldHintComponent {}\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 { WattFieldComponent } from './watt-field.component';\nexport { WattFieldErrorComponent } from './watt-field-error.component';\nexport { WattFieldHintComponent } from './watt-field-hint.component';\nexport { WattFieldIntlService } from './watt-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,oBAAoB,CAAA;AACtB,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,QAAQ,GAAG,mBAAmB;uGAFnB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACrBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,uBAAuB,CAAA;uGAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,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CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA,CAAA;;2FAEf,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,YAQjB,CAAgB,cAAA,CAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA;;;AC7B5B;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -300,6 +300,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
300
300
|
}]
|
|
301
301
|
}] });
|
|
302
302
|
|
|
303
|
+
//#region License
|
|
304
|
+
/**
|
|
305
|
+
* @license
|
|
306
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
307
|
+
*
|
|
308
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
309
|
+
* you may not use this file except in compliance with the License.
|
|
310
|
+
* You may obtain a copy of the License at
|
|
311
|
+
*
|
|
312
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
313
|
+
*
|
|
314
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
315
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
316
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
317
|
+
* See the License for the specific language governing permissions and
|
|
318
|
+
* limitations under the License.
|
|
319
|
+
*/
|
|
320
|
+
//#endregion
|
|
321
|
+
class WattFlagSwitzerlandComponent {
|
|
322
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattFlagSwitzerlandComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
323
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: WattFlagSwitzerlandComponent, isStandalone: true, selector: "watt-flag-ch", ngImport: i0, template: `
|
|
324
|
+
<svg viewBox="0 0 640 480">
|
|
325
|
+
<g fill="#ff0000">
|
|
326
|
+
<path d="M0 0h640v480H0z" />
|
|
327
|
+
</g>
|
|
328
|
+
<g fill="#ffffff">
|
|
329
|
+
<path d="M170 195h300v90H170z" />
|
|
330
|
+
<path d="M275 90h90v300h-90z" />
|
|
331
|
+
</g>
|
|
332
|
+
</svg>
|
|
333
|
+
`, isInline: true });
|
|
334
|
+
}
|
|
335
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattFlagSwitzerlandComponent, decorators: [{
|
|
336
|
+
type: Component,
|
|
337
|
+
args: [{
|
|
338
|
+
selector: 'watt-flag-ch',
|
|
339
|
+
template: `
|
|
340
|
+
<svg viewBox="0 0 640 480">
|
|
341
|
+
<g fill="#ff0000">
|
|
342
|
+
<path d="M0 0h640v480H0z" />
|
|
343
|
+
</g>
|
|
344
|
+
<g fill="#ffffff">
|
|
345
|
+
<path d="M170 195h300v90H170z" />
|
|
346
|
+
<path d="M275 90h90v300h-90z" />
|
|
347
|
+
</g>
|
|
348
|
+
</svg>
|
|
349
|
+
`,
|
|
350
|
+
}]
|
|
351
|
+
}] });
|
|
352
|
+
|
|
303
353
|
//#region License
|
|
304
354
|
/**
|
|
305
355
|
* @license
|
|
@@ -350,9 +400,12 @@ class WattFlagComponent {
|
|
|
350
400
|
@case ('NL') {
|
|
351
401
|
<watt-flag-nl />
|
|
352
402
|
}
|
|
403
|
+
@case ('CH') {
|
|
404
|
+
<watt-flag-ch />
|
|
405
|
+
}
|
|
353
406
|
}
|
|
354
407
|
</watt-icon>
|
|
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"] }] });
|
|
408
|
+
`, 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: WattFlagSwitzerlandComponent, selector: "watt-flag-ch" }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }] });
|
|
356
409
|
}
|
|
357
410
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattFlagComponent, decorators: [{
|
|
358
411
|
type: Component,
|
|
@@ -366,6 +419,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
366
419
|
WattFlagPolandComponent,
|
|
367
420
|
WattFlagSwedenComponent,
|
|
368
421
|
WattFlagNetherlandsComponent,
|
|
422
|
+
WattFlagSwitzerlandComponent,
|
|
369
423
|
WattIconComponent,
|
|
370
424
|
],
|
|
371
425
|
template: `
|
|
@@ -392,6 +446,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
392
446
|
@case ('NL') {
|
|
393
447
|
<watt-flag-nl />
|
|
394
448
|
}
|
|
449
|
+
@case ('CH') {
|
|
450
|
+
<watt-flag-ch />
|
|
451
|
+
}
|
|
395
452
|
}
|
|
396
453
|
</watt-icon>
|
|
397
454
|
`,
|
|
@@ -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-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 {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,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;;;;"}
|
|
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-ch.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 } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-ch',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <g fill=\"#ff0000\">\n <path d=\"M0 0h640v480H0z\" />\n </g>\n <g fill=\"#ffffff\">\n <path d=\"M170 195h300v90H170z\" />\n <path d=\"M275 90h90v300h-90z\" />\n </g>\n </svg>\n `,\n})\nexport class WattFlagSwitzerlandComponent {}\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';\nimport { WattFlagSwitzerlandComponent } from './watt-flag-ch';\n\n@Component({\n selector: 'watt-flag',\n imports: [\n WattFlagDenmarkComponent,\n WattFlagFinlandComponent,\n WattFlagGermanyComponent,\n WattFlagNorwayComponent,\n WattFlagPolandComponent,\n WattFlagSwedenComponent,\n WattFlagNetherlandsComponent,\n WattFlagSwitzerlandComponent,\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 @case ('CH') {\n <watt-flag-ch />\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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';
|
|
45
|
+
CH = 'Switzerland';
|
|
45
46
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPhoneFieldIntlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
46
47
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPhoneFieldIntlService, providedIn: 'root' });
|
|
47
48
|
}
|
|
@@ -86,6 +87,7 @@ class WattPhoneFieldComponent {
|
|
|
86
87
|
{ countryIsoCode: 'FI', phoneExtension: '+358' },
|
|
87
88
|
{ countryIsoCode: 'PL', phoneExtension: '+48' },
|
|
88
89
|
{ countryIsoCode: 'NL', phoneExtension: '+31' },
|
|
90
|
+
{ countryIsoCode: 'CH', phoneExtension: '+41' },
|
|
89
91
|
];
|
|
90
92
|
formControl = input.required();
|
|
91
93
|
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 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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,SAAS;uBAAC,kBAAkB;;;AC7J/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 CH = 'Switzerland';\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 { countryIsoCode: 'CH', phoneExtension: '+41' },\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;IAClB,EAAE,GAAG,aAAa;uGAVP,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,UAAU,EAAE,MAAM,EAAE;;;ACrBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAwCA,SAAS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,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;8BA8BD,UAAU,EAAA,CAAA;sBADT,WAAW;uBAAC,0BAA0B;gBAOR,gBAAgB,EAAA,CAAA;sBAA9C,SAAS;uBAAC,kBAAkB;;;AC9J/B;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class WattFlagSwitzerlandComponent {
|
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WattFlagSwitzerlandComponent, never>;
|
|
4
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<WattFlagSwitzerlandComponent, "watt-flag-ch", never, {}, {}, never, never, true, never>;
|
|
5
|
+
}
|
package/package.json
CHANGED