@energinet/watt 4.3.1 → 4.3.3

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.
@@ -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/watt-field-warning.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 effect,\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 { VaterFlexComponent, VaterUtilityDirective } 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 VaterFlexComponent,\n VaterUtilityDirective,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode() || displayMode() !== 'box') {\n <span [attr.autofocus]=\"autoFocus() || null\" class=\"watt-label\" #wattLabel>\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.autofocus]=\"autoFocus() || null\" [attr.for]=\"id()\" #label>\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-flex direction=\"row\" gap=\"s\" align=\"center\">\n <div\n vater\n fill=\"horizontal\"\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-flex>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--disabled]': 'control()?.disabled',\n '[class.watt-field--show-errors]': 'showErrors()',\n '[class]': 'className()',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n elementRef = inject<ElementRef>(ElementRef);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n /** @deprecated Use `displayMode` instead. */\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n displayMode = input<'box' | 'chip' | 'content'>('box');\n className = computed(() => `watt-field--${this.chipMode() ? 'chip' : this.displayMode()}`);\n\n /**\n * Whether the input should receive focus when the component is rendered.\n */\n autoFocus = input(false);\n\n /** @ignore */\n labelElement = viewChild<ElementRef<HTMLLabelElement>>('label');\n wattLabelElement = viewChild<ElementRef<HTMLSpanElement>>('wattLabel');\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 errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n showErrors = input(true);\n\n // Used for text fields with autocomplete\n wrapper = viewChild<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 effect(() => {\n if (this.autoFocus()) {\n if (this.chipMode()) {\n this.wattLabelElement()?.nativeElement.focus();\n } else {\n this.labelElement()?.nativeElement.focus();\n }\n }\n });\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\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-warning',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-warning {\n color: var(--watt-color-state-warning);\n }\n `,\n ],\n})\nexport class WattFieldWarningComponent {}\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 { WattFieldWarningComponent } from './watt-field-warning.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,QAA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AAeG;AACH;MAea,yBAAyB,CAAA;wGAAzB,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,SAAA,EAAA,IAAA,EAAA,yBAAyB,8EAV1B,CAAA,cAAA,CAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,6DAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;4FAUf,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAZrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAAA,QAAA,EACpB,CAAA,cAAA,CAAgB,EAAA,aAAA,EACX,iBAAiB,CAAC,IAAI,EAAA,MAAA,EAAA,CAAA,6DAAA,CAAA,EAAA;;;ACvBvC;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/watt-field-warning.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 effect,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\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 { VaterFlexComponent, VaterUtilityDirective } 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: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterFlexComponent,\n VaterUtilityDirective,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode() || displayMode() !== 'box') {\n <span [attr.autofocus]=\"autoFocus() || null\" class=\"watt-label\" #wattLabel>\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.autofocus]=\"autoFocus() || null\" [attr.for]=\"id()\" #label>\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-flex direction=\"row\" gap=\"s\" align=\"center\">\n <div\n vater\n fill=\"horizontal\"\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-flex>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--disabled]': 'control()?.disabled',\n '[class.watt-field--show-errors]': 'showErrors()',\n '[class]': 'className()',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n elementRef = inject<ElementRef>(ElementRef);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n /** @deprecated Use `displayMode` instead. */\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n displayMode = input<'box' | 'chip' | 'content'>('box');\n className = computed(() => `watt-field--${this.chipMode() ? 'chip' : this.displayMode()}`);\n\n /**\n * Whether the input should receive focus when the component is rendered.\n */\n autoFocus = input(false);\n\n /** @ignore */\n labelElement = viewChild<ElementRef<HTMLLabelElement>>('label');\n wattLabelElement = viewChild<ElementRef<HTMLSpanElement>>('wattLabel');\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 errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n showErrors = input(true);\n\n // Used for text fields with autocomplete\n wrapper = viewChild<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 effect(() => {\n if (this.autoFocus()) {\n if (this.chipMode()) {\n this.wattLabelElement()?.nativeElement.focus();\n } else {\n this.labelElement()?.nativeElement.focus();\n }\n }\n });\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\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-warning',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-warning {\n color: var(--watt-color-state-warning);\n }\n `,\n ],\n})\nexport class WattFieldWarningComponent {}\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 { WattFieldWarningComponent } from './watt-field-warning.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;wGAFnB,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,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA;;4FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACrBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,uBAAuB,CAAA;wGAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAA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BvC;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, EventEmitter, Injectable, input, booleanAttribute, output, viewChild, signal, afterRenderEffect, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { NgClass, NgTemplateOutlet } from '@angular/common';
3
+ import { NgTemplateOutlet } from '@angular/common';
4
4
  import { MAT_DIALOG_DATA, MatDialogRef, MatDialog } from '@angular/material/dialog';
5
5
  import { WattResizeObserverDirective } from '@energinet/watt/utils/resize-observer';
6
6
  import { WattButtonComponent } from '@energinet/watt/button';
@@ -170,18 +170,17 @@ class WattModalComponent {
170
170
  this.scrollable.set(event.target.scrollHeight > event.target.clientHeight);
171
171
  }
172
172
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
173
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattModalComponent, isStandalone: true, selector: "watt-modal", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingMessage: { classPropertyName: "loadingMessage", publicName: "loadingMessage", isSignal: true, isRequired: false, transformFunction: null }, disableClose: { classPropertyName: "disableClose", publicName: "disableClose", isSignal: true, isRequired: false, transformFunction: null }, hideCloseButton: { classPropertyName: "hideCloseButton", publicName: "hideCloseButton", isSignal: true, isRequired: false, transformFunction: null }, disableEscAndBackdropClose: { classPropertyName: "disableEscAndBackdropClose", publicName: "disableEscAndBackdropClose", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, restoreFocus: { classPropertyName: "restoreFocus", publicName: "restoreFocus", isSignal: true, isRequired: false, transformFunction: null }, titleIcon: { classPropertyName: "titleIcon", publicName: "titleIcon", isSignal: true, isRequired: false, transformFunction: null }, autoOpen: { classPropertyName: "autoOpen", publicName: "autoOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["modal"], descendants: true, isSignal: 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\n @if (!loading()) {\n <ng-content select=\"h2\">\n @if (title()) {\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 </ng-content>\n }\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", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattSpinnerComponent, selector: "watt-spinner", inputs: ["diameter", "strokeWidth"] }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
173
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattModalComponent, isStandalone: true, selector: "watt-modal", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingMessage: { classPropertyName: "loadingMessage", publicName: "loadingMessage", isSignal: true, isRequired: false, transformFunction: null }, disableClose: { classPropertyName: "disableClose", publicName: "disableClose", isSignal: true, isRequired: false, transformFunction: null }, hideCloseButton: { classPropertyName: "hideCloseButton", publicName: "hideCloseButton", isSignal: true, isRequired: false, transformFunction: null }, disableEscAndBackdropClose: { classPropertyName: "disableEscAndBackdropClose", publicName: "disableEscAndBackdropClose", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, restoreFocus: { classPropertyName: "restoreFocus", publicName: "restoreFocus", isSignal: true, isRequired: false, transformFunction: null }, titleIcon: { classPropertyName: "titleIcon", publicName: "titleIcon", isSignal: true, isRequired: false, transformFunction: null }, autoOpen: { classPropertyName: "autoOpen", publicName: "autoOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["modal"], descendants: true, isSignal: 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\" [class]=\"'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\n @if (!loading()) {\n <ng-content select=\"h2\">\n @if (title()) {\n <h2 class=\"watt-modal-title\" [class.watt-modal-title-icon]=\"titleIcon()\">\n @if (titleIcon()) {\n <watt-icon [name]=\"titleIcon()\" size=\"l\" />\n }\n {{ title() }}\n </h2>\n }\n </ng-content>\n }\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: 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", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattSpinnerComponent, selector: "watt-spinner", inputs: ["diameter", "strokeWidth"] }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
174
174
  }
175
175
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattModalComponent, decorators: [{
176
176
  type: Component,
177
177
  args: [{ changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, selector: 'watt-modal', imports: [
178
- NgClass,
179
178
  NgTemplateOutlet,
180
179
  WattResizeObserverDirective,
181
180
  WattButtonComponent,
182
181
  WattSpinnerComponent,
183
182
  WattIconComponent,
184
- ], 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\n @if (!loading()) {\n <ng-content select=\"h2\">\n @if (title()) {\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 </ng-content>\n }\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"] }]
183
+ ], 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\" [class]=\"'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\n @if (!loading()) {\n <ng-content select=\"h2\">\n @if (title()) {\n <h2 class=\"watt-modal-title\" [class.watt-modal-title-icon]=\"titleIcon()\">\n @if (titleIcon()) {\n <watt-icon [name]=\"titleIcon()\" size=\"l\" />\n }\n {{ title() }}\n </h2>\n }\n </ng-content>\n }\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"] }]
185
184
  }], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], loadingMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingMessage", required: false }] }], disableClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableClose", required: false }] }], hideCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideCloseButton", required: false }] }], disableEscAndBackdropClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableEscAndBackdropClose", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], restoreFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "restoreFocus", required: false }] }], titleIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleIcon", required: false }] }], autoOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoOpen", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], modal: [{ type: i0.ViewChild, args: ['modal', { isSignal: true }] }] } });
186
185
  /**
187
186
  * Component for projecting buttons (actions) to the bottom of the 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, TemplateRef, inject } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialog, MatDialogRef } 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","//#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 TemplateRef,\n ViewEncapsulation,\n afterRenderEffect,\n booleanAttribute,\n inject,\n input,\n output,\n viewChild,\n signal,\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 { 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/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 WattIconComponent,\n ],\n})\nexport class WattModalComponent {\n private modalService = inject(WattModalService);\n protected dialogRef = inject<MatDialogRef<unknown>>(MatDialogRef, { optional: true });\n\n /** Title to stay fixed to top of modal. */\n title = input('');\n\n size = input<WattModalSize>('medium');\n\n /** Whether the modal should show a loading state. */\n loading = input(false);\n\n /** Whether the modal should show a loading text for the loading state. */\n loadingMessage = input('');\n\n /** Disable ESC, close button and backdrop click as methods of closing. */\n disableClose = input(false);\n\n /** Whether to show the close button */\n hideCloseButton = input(false);\n\n /** Disable ESC, backdrop click as methods of closing. */\n disableEscAndBackdropClose = input(false);\n\n /** The aria-label for the close button. */\n closeLabel = input('Close');\n\n /** Classes added to the modal panel */\n panelClass = input<string[]>([]);\n\n minHeight = input('147px');\n\n /** Whether the dialog should restore focus to the previously-focused element, after it's closed. */\n restoreFocus = input(true);\n\n /** Icon displayed next to the modal title. */\n titleIcon = input<WattIcon | undefined>(undefined);\n\n /** Whether the modal should open automatically when rendered. */\n autoOpen = input(false, { transform: booleanAttribute });\n\n closed = output<boolean>();\n\n modal = viewChild<TemplateRef<Element>>('modal');\n\n scrollable = signal(false);\n\n constructor() {\n afterRenderEffect(() => {\n if (this.autoOpen()) {\n this.open();\n }\n });\n }\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: (result: boolean) => this.closed.emit(result),\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.set(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\n @if (!loading()) {\n <ng-content select=\"h2\">\n @if (title()) {\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 </ng-content>\n }\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":";;;;;;;;;;MAmCsB,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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AAA,EAC3B,YAAY,EAAA,OAAA,EAGb;wBACP,OAAO;wBACP,gBAAgB;wBAChB,2BAA2B;wBAC3B,mBAAmB;wBACnB,oBAAoB;wBACpB,iBAAiB;AAClB,qBAAA,EAAA,QAAA,EAAA,y0DAAA,EAAA,MAAA,EAAA,CAAA,6sFAAA,CAAA,EAAA;w7CA6CuC,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;AA6CjD;;AAEG;MAKU,yBAAyB,CAAA;wGAAzB,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,SAAA,EAAA,IAAA,EAAA,yBAAyB,8EAF1B,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;4FAEf,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;;AElKxE;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, TemplateRef, inject } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialog, MatDialogRef } 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","//#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 TemplateRef,\n ViewEncapsulation,\n afterRenderEffect,\n booleanAttribute,\n inject,\n input,\n output,\n viewChild,\n signal,\n} from '@angular/core';\nimport { 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 { 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/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 NgTemplateOutlet,\n WattResizeObserverDirective,\n WattButtonComponent,\n WattSpinnerComponent,\n WattIconComponent,\n ],\n})\nexport class WattModalComponent {\n private modalService = inject(WattModalService);\n protected dialogRef = inject<MatDialogRef<unknown>>(MatDialogRef, { optional: true });\n\n /** Title to stay fixed to top of modal. */\n title = input('');\n\n size = input<WattModalSize>('medium');\n\n /** Whether the modal should show a loading state. */\n loading = input(false);\n\n /** Whether the modal should show a loading text for the loading state. */\n loadingMessage = input('');\n\n /** Disable ESC, close button and backdrop click as methods of closing. */\n disableClose = input(false);\n\n /** Whether to show the close button */\n hideCloseButton = input(false);\n\n /** Disable ESC, backdrop click as methods of closing. */\n disableEscAndBackdropClose = input(false);\n\n /** The aria-label for the close button. */\n closeLabel = input('Close');\n\n /** Classes added to the modal panel */\n panelClass = input<string[]>([]);\n\n minHeight = input('147px');\n\n /** Whether the dialog should restore focus to the previously-focused element, after it's closed. */\n restoreFocus = input(true);\n\n /** Icon displayed next to the modal title. */\n titleIcon = input<WattIcon | undefined>(undefined);\n\n /** Whether the modal should open automatically when rendered. */\n autoOpen = input(false, { transform: booleanAttribute });\n\n closed = output<boolean>();\n\n modal = viewChild<TemplateRef<Element>>('modal');\n\n scrollable = signal(false);\n\n constructor() {\n afterRenderEffect(() => {\n if (this.autoOpen()) {\n this.open();\n }\n });\n }\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: (result: boolean) => this.closed.emit(result),\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.set(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\" [class]=\"'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\n @if (!loading()) {\n <ng-content select=\"h2\">\n @if (title()) {\n <h2 class=\"watt-modal-title\" [class.watt-modal-title-icon]=\"titleIcon()\">\n @if (titleIcon()) {\n <watt-icon [name]=\"titleIcon()\" size=\"l\" />\n }\n {{ title() }}\n </h2>\n }\n </ng-content>\n }\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":";;;;;;;;;;MAmCsB,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;YAC/B;iBAAO;AACL,gBA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A,EAAA,IAAA,EAAA,yBAAyB,8EAF1B,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;4FAEf,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;;AEjKxE;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
@@ -1,9 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ChangeDetectorRef, input, output, signal, effect, untracked, ViewEncapsulation, Component, DestroyRef, ElementRef, HostBinding, Input, Directive } from '@angular/core';
2
+ import { inject, ChangeDetectorRef, input, output, signal, effect, untracked, ViewEncapsulation, Component, DestroyRef, ElementRef, computed, Directive } from '@angular/core';
3
3
  import { Maskito } from '@maskito/core';
4
4
  import { NgControl } from '@angular/forms';
5
5
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
6
- import { Subject } from 'rxjs';
7
6
 
8
7
  //#region License
9
8
  /**
@@ -34,8 +33,10 @@ class WattPlaceholderMaskComponent {
34
33
  primaryGhost = signal('', ...(ngDevMode ? [{ debugName: "primaryGhost" }] : []));
35
34
  primaryFiller = signal(null, ...(ngDevMode ? [{ debugName: "primaryFiller" }] : []));
36
35
  maskEffect = effect((onCleanup) => {
37
- const mask = this.mask();
38
36
  const placeholder = this.placeholder();
37
+ if (!placeholder)
38
+ return;
39
+ const mask = this.mask();
39
40
  const primaryMask = {
40
41
  ...mask,
41
42
  preprocessors: [
@@ -99,18 +100,11 @@ class WattPickerBase {
99
100
  static nextId = 0;
100
101
  id;
101
102
  initialValue = null;
102
- focused = false;
103
+ focused = signal(false, ...(ngDevMode ? [{ debugName: "focused" }] : []));
103
104
  controlType = 'mat-date-range-input'; // We keep the controlType of Material Date Range Input as is, to keep some styling.
104
- stateChanges = new Subject();
105
105
  // eslint-disable-next-line @angular-eslint/no-input-rename
106
106
  userAriaDescribedBy = input(undefined, ...(ngDevMode ? [{ debugName: "userAriaDescribedBy", alias: 'aria-describedby' }] : [{ alias: 'aria-describedby' }]));
107
- get placeholder() {
108
- return this._placeholder;
109
- }
110
- set placeholder(value) {
111
- this._placeholder = value;
112
- this.stateChanges.next();
113
- }
107
+ placeholder = signal('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
114
108
  get value() {
115
109
  if (this.ngControl?.valid) {
116
110
  const { value: { start, end }, } = this.ngControl;
@@ -118,16 +112,16 @@ class WattPickerBase {
118
112
  }
119
113
  return null;
120
114
  }
121
- set value(value) {
115
+ setValue(value) {
122
116
  const input = this.input();
123
117
  const startInput = this.startInput();
124
118
  const endInput = this.endInput();
125
- const inputNotToBeInTheDocument = !this.range ? !input : !startInput;
119
+ const inputNotToBeInTheDocument = !this.range() ? !input : !startInput;
126
120
  if (inputNotToBeInTheDocument) {
127
121
  this.initialValue = value;
128
122
  return;
129
123
  }
130
- if (this.range) {
124
+ if (this.range()) {
131
125
  if (!startInput || !endInput)
132
126
  return;
133
127
  this.setRangeValue(value, startInput.nativeElement, endInput.nativeElement);
@@ -137,33 +131,21 @@ class WattPickerBase {
137
131
  return;
138
132
  this.setSingleValue(value, input.nativeElement);
139
133
  }
140
- this.stateChanges.next();
141
- }
142
- set range(range) {
143
- this._range = coerceBooleanProperty(range);
144
- }
145
- get range() {
146
- return this._range;
147
134
  }
148
- _range = false;
149
- get required() {
150
- return this._required;
151
- }
152
- set required(value) {
153
- this._required = coerceBooleanProperty(value);
154
- this.stateChanges.next();
155
- }
156
- _required = false;
157
- get disabled() {
158
- return this._disabled;
159
- }
160
- set disabled(value) {
161
- this._disabled = coerceBooleanProperty(value);
162
- this.stateChanges.next();
163
- }
164
- _disabled = false;
135
+ range = input(false, ...(ngDevMode ? [{ debugName: "range", transform: coerceBooleanProperty }] : [{ transform: coerceBooleanProperty }]));
136
+ required = input(false, ...(ngDevMode ? [{ debugName: "required", transform: coerceBooleanProperty }] : [{ transform: coerceBooleanProperty }]));
137
+ disabledInput = input(false, ...(ngDevMode ? [{ debugName: "disabledInput",
138
+ // eslint-disable-next-line @angular-eslint/no-input-rename
139
+ alias: 'disabled',
140
+ transform: coerceBooleanProperty }] : [{
141
+ // eslint-disable-next-line @angular-eslint/no-input-rename
142
+ alias: 'disabled',
143
+ transform: coerceBooleanProperty,
144
+ }]));
145
+ disabledState = signal(false, ...(ngDevMode ? [{ debugName: "disabledState" }] : []));
146
+ disabled = computed(() => this.disabledInput() || this.disabledState(), ...(ngDevMode ? [{ debugName: "disabled" }] : []));
165
147
  get empty() {
166
- if (this.range) {
148
+ if (this.range()) {
167
149
  return !this.ngControl?.value?.start && !this.ngControl?.value?.end;
168
150
  }
169
151
  else {
@@ -173,9 +155,9 @@ class WattPickerBase {
173
155
  get errorState() {
174
156
  return !!this.ngControl?.invalid && !!this.ngControl?.touched;
175
157
  }
176
- get shouldLabelFloat() {
177
- return this.focused || !this.empty;
178
- }
158
+ shouldLabelFloat = computed(() => {
159
+ return this.focused() || !this.empty;
160
+ }, ...(ngDevMode ? [{ debugName: "shouldLabelFloat" }] : []));
179
161
  /**
180
162
  *
181
163
  * @ignore
@@ -195,16 +177,13 @@ class WattPickerBase {
195
177
  if (this.initialValue) {
196
178
  this.writeValue(this.initialValue);
197
179
  }
198
- if (this.range) {
180
+ if (this.range()) {
199
181
  this.initRangeInput();
200
182
  }
201
183
  else {
202
184
  this.initSingleInput();
203
185
  }
204
186
  }
205
- ngOnDestroy() {
206
- this.stateChanges.complete();
207
- }
208
187
  setDescribedByIds(ids) {
209
188
  this.elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));
210
189
  }
@@ -212,7 +191,7 @@ class WattPickerBase {
212
191
  // Intentionally left empty
213
192
  }
214
193
  writeValue(value) {
215
- this.value = value;
194
+ this.setValue(value);
216
195
  }
217
196
  registerOnChange(onChangeFn) {
218
197
  this.changeParentValue = onChangeFn;
@@ -221,13 +200,12 @@ class WattPickerBase {
221
200
  this.markParentControlAsTouched = onTouchFn;
222
201
  }
223
202
  setDisabledState(isDisabled) {
224
- this.disabled = isDisabled;
203
+ this.disabledState.set(isDisabled);
225
204
  this.changeDetectionRef.detectChanges();
226
205
  }
227
206
  onFocusIn() {
228
- if (!this.focused) {
229
- this.focused = true;
230
- this.stateChanges.next();
207
+ if (!this.focused()) {
208
+ this.focused.set(true);
231
209
  }
232
210
  }
233
211
  onFocusOut(event) {
@@ -235,9 +213,8 @@ class WattPickerBase {
235
213
  const overlay = id ? document.getElementById(id.value) : null;
236
214
  const isChild = overlay?.contains(event.relatedTarget);
237
215
  if (!this.elementRef.nativeElement.contains(event.relatedTarget) && !isChild) {
238
- this.focused = false;
216
+ this.focused.set(false);
239
217
  this.markParentControlAsTouched();
240
- this.stateChanges.next();
241
218
  }
242
219
  }
243
220
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -248,22 +225,16 @@ class WattPickerBase {
248
225
  // Intentionally left empty
249
226
  };
250
227
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattPickerBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
251
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.15", type: WattPickerBase, isStandalone: true, inputs: { userAriaDescribedBy: { classPropertyName: "userAriaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null } }, host: { properties: { "attr.watt-field-disabled": "this.disabled" } }, ngImport: i0 });
228
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.15", type: WattPickerBase, isStandalone: true, inputs: { userAriaDescribedBy: { classPropertyName: "userAriaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.watt-field-disabled": "disabled()" } }, ngImport: i0 });
252
229
  }
253
230
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattPickerBase, decorators: [{
254
- type: Directive
255
- }], ctorParameters: () => [{ type: undefined }], propDecorators: { userAriaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], value: [{
256
- type: Input
257
- }], range: [{
258
- type: Input
259
- }], required: [{
260
- type: Input
261
- }], disabled: [{
262
- type: HostBinding,
263
- args: ['attr.watt-field-disabled']
264
- }, {
265
- type: Input
266
- }] } });
231
+ type: Directive,
232
+ args: [{
233
+ host: {
234
+ '[attr.watt-field-disabled]': 'disabled()',
235
+ },
236
+ }]
237
+ }], ctorParameters: () => [{ type: undefined }], propDecorators: { userAriaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
267
238
 
268
239
  //#region License
269
240
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-picker-__shared.mjs","sources":["../../../libs/watt/package/picker/__shared/placeholder-mask/watt-placeholder-mask.component.ts","../../../libs/watt/package/picker/__shared/placeholder-mask/watt-placeholder-mask.component.html","../../../libs/watt/package/picker/__shared/watt-picker-base.ts","../../../libs/watt/package/picker/__shared/index.ts","../../../libs/watt/package/picker/__shared/energinet-watt-picker-__shared.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 {\n ChangeDetectorRef,\n Component,\n ViewEncapsulation,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport { Maskito, MaskitoOptions } from '@maskito/core';\n\n@Component({\n selector: 'watt-placeholder-mask',\n templateUrl: './watt-placeholder-mask.component.html',\n styleUrls: ['./watt-placeholder-mask.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class WattPlaceholderMaskComponent {\n cdr = inject(ChangeDetectorRef);\n primaryInputElement = input.required<HTMLInputElement>();\n secondaryInputElement = input<HTMLInputElement>();\n mask = input.required<MaskitoOptions>();\n placeholder = input.required<string>();\n maskApplied = output<string>();\n maskedInput = signal<Maskito | null>(null);\n primaryGhost = signal('');\n primaryFiller = signal<string | null>(null);\n\n maskEffect = effect((onCleanup) => {\n const mask = this.mask();\n const placeholder = this.placeholder();\n const primaryMask: MaskitoOptions = {\n ...mask,\n preprocessors: [\n ...(mask.preprocessors ?? []),\n (state) => {\n this.primaryGhost.set(state.elementState.value.slice(0, placeholder.length));\n this.primaryFiller.set(placeholder.slice(state.elementState.value.length));\n return state;\n },\n ],\n postprocessors: [\n (elementState) => {\n this.maskApplied.emit(elementState.value);\n return elementState;\n },\n ...(mask.postprocessors ?? []),\n ],\n };\n\n const maskedInput = new Maskito(this.primaryInputElement(), primaryMask);\n this.maskedInput.set(maskedInput);\n\n onCleanup(() => {\n maskedInput.destroy();\n this.maskedInput.set(null);\n });\n });\n\n inputEffect = effect(() => {\n const primaryInputElement = this.primaryInputElement();\n untracked(() => primaryInputElement.dispatchEvent(new InputEvent('input')));\n });\n}\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<span class=\"ghost\">{{ primaryGhost() }}</span>\n<span class=\"filler\">{{ primaryFiller() ?? placeholder() }}</span>\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 Input,\n OnInit,\n Signal,\n inject,\n Directive,\n OnDestroy,\n ElementRef,\n DestroyRef,\n HostBinding,\n AfterViewInit,\n ChangeDetectorRef,\n input,\n} from '@angular/core';\n\nimport { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\n\nimport { Subject } from 'rxjs';\n\nimport { WattDateRange } from '@energinet/watt/core/date';\n\nimport { WattPickerValue } from './watt-picker-value';\n@Directive()\nexport abstract class WattPickerBase\n implements OnInit, AfterViewInit, OnDestroy, ControlValueAccessor\n{\n protected destroyRef = inject(DestroyRef);\n protected changeDetectionRef = inject(ChangeDetectorRef);\n protected ngControl = inject(NgControl, { optional: true });\n protected elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n abstract input: Signal<ElementRef<HTMLInputElement> | undefined>;\n abstract endInput: Signal<ElementRef<HTMLInputElement> | undefined>;\n abstract startInput: Signal<ElementRef<HTMLInputElement> | undefined>;\n\n static nextId = 0;\n\n id: string;\n\n initialValue: WattPickerValue = null;\n\n focused = false;\n\n controlType = 'mat-date-range-input'; // We keep the controlType of Material Date Range Input as is, to keep some styling.\n\n stateChanges = new Subject<void>();\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n userAriaDescribedBy = input<string>(undefined, { alias: 'aria-describedby' });\n\n get placeholder(): string {\n return this._placeholder;\n }\n\n set placeholder(value: string) {\n this._placeholder = value;\n this.stateChanges.next();\n }\n\n protected abstract _placeholder: string;\n\n @Input()\n get value(): WattDateRange | null {\n if (this.ngControl?.valid) {\n const {\n value: { start, end },\n } = this.ngControl;\n\n return { start, end };\n }\n\n return null;\n }\n\n set value(value: WattPickerValue) {\n const input = this.input();\n const startInput = this.startInput();\n const endInput = this.endInput();\n\n const inputNotToBeInTheDocument = !this.range ? !input : !startInput;\n\n if (inputNotToBeInTheDocument) {\n this.initialValue = value;\n return;\n }\n\n if (this.range) {\n if (!startInput || !endInput) return;\n this.setRangeValue(value as WattDateRange, startInput.nativeElement, endInput.nativeElement);\n } else {\n if (!input) return;\n this.setSingleValue(value as Exclude<WattPickerValue, WattDateRange>, input.nativeElement);\n }\n\n this.stateChanges.next();\n }\n\n @Input()\n set range(range: boolean) {\n this._range = coerceBooleanProperty(range);\n }\n get range(): boolean {\n return this._range;\n }\n\n private _range = false;\n\n @Input()\n get required(): boolean {\n return this._required;\n }\n\n set required(value: BooleanInput) {\n this._required = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n\n private _required = false;\n\n @HostBinding('attr.watt-field-disabled')\n @Input()\n get disabled(): boolean {\n return this._disabled;\n }\n\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n\n private _disabled = false;\n\n get empty() {\n if (this.range) {\n return !this.ngControl?.value?.start && !this.ngControl?.value?.end;\n } else {\n return this.ngControl?.value?.length === 0;\n }\n }\n\n get errorState(): boolean {\n return !!this.ngControl?.invalid && !!this.ngControl?.touched;\n }\n\n get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n\n /**\n *\n * @ignore\n */\n control: FormControl | null = null;\n\n constructor(id: string) {\n this.id = id;\n this.elementRef.nativeElement.setAttribute('id', id);\n\n if (this.ngControl != null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n ngOnInit(): void {\n this.control = this.ngControl?.control as FormControl;\n }\n\n ngAfterViewInit() {\n if (this.initialValue) {\n this.writeValue(this.initialValue);\n }\n\n if (this.range) {\n this.initRangeInput();\n } else {\n this.initSingleInput();\n }\n }\n\n ngOnDestroy(): void {\n this.stateChanges.complete();\n }\n\n protected abstract initRangeInput(): void;\n\n protected abstract initSingleInput(): void;\n\n protected abstract setSingleValue(\n value: Exclude<WattPickerValue, WattDateRange>,\n input: HTMLInputElement\n ): void;\n\n protected abstract setRangeValue(\n value: WattDateRange,\n startInput: HTMLInputElement,\n endInput: HTMLInputElement\n ): void;\n\n setDescribedByIds(ids: string[]) {\n this.elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));\n }\n\n onContainerClick() {\n // Intentionally left empty\n }\n\n writeValue(value: WattPickerValue): void {\n this.value = value;\n }\n\n registerOnChange(onChangeFn: (value: string | WattDateRange) => void): void {\n this.changeParentValue = onChangeFn;\n }\n\n registerOnTouched(onTouchFn: () => void) {\n this.markParentControlAsTouched = onTouchFn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.changeDetectionRef.detectChanges();\n }\n\n onFocusIn() {\n if (!this.focused) {\n this.focused = true;\n this.stateChanges.next();\n }\n }\n\n onFocusOut(event: FocusEvent) {\n const id = this.elementRef.nativeElement.attributes.getNamedItem('aria-owns');\n const overlay = id ? document.getElementById(id.value) : null;\n const isChild = overlay?.contains(event.relatedTarget as Element);\n\n if (!this.elementRef.nativeElement.contains(event.relatedTarget as Element) && !isChild) {\n this.focused = false;\n this.markParentControlAsTouched();\n this.stateChanges.next();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected changeParentValue = (value: string | WattDateRange): void => {\n // Intentionally left empty\n };\n\n protected markParentControlAsTouched = (): void => {\n // Intentionally left empty\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 { WattPlaceholderMaskComponent } from './placeholder-mask/watt-placeholder-mask.component';\nexport { WattPickerBase } from './watt-picker-base';\nexport { WattPickerValue } from './watt-picker-value';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAoBa,4BAA4B,CAAA;AACvC,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC/B,IAAA,mBAAmB,GAAG,KAAK,CAAC,QAAQ,8DAAoB;IACxD,qBAAqB,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,uBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAoB;AACjD,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAkB;AACvC,IAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,sDAAU;IACtC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mask.component.ts","../../../libs/watt/package/picker/__shared/placeholder-mask/watt-placeholder-mask.component.html","../../../libs/watt/package/picker/__shared/watt-picker-base.ts","../../../libs/watt/package/picker/__shared/index.ts","../../../libs/watt/package/picker/__shared/energinet-watt-picker-__shared.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 {\n ChangeDetectorRef,\n Component,\n ViewEncapsulation,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport { Maskito, MaskitoOptions } from '@maskito/core';\n\n@Component({\n selector: 'watt-placeholder-mask',\n templateUrl: './watt-placeholder-mask.component.html',\n styleUrls: ['./watt-placeholder-mask.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class WattPlaceholderMaskComponent {\n cdr = inject(ChangeDetectorRef);\n primaryInputElement = input.required<HTMLInputElement>();\n secondaryInputElement = input<HTMLInputElement>();\n mask = input.required<MaskitoOptions>();\n placeholder = input.required<string>();\n maskApplied = output<string>();\n maskedInput = signal<Maskito | null>(null);\n primaryGhost = signal('');\n primaryFiller = signal<string | null>(null);\n\n maskEffect = effect((onCleanup) => {\n const placeholder = this.placeholder();\n if (!placeholder) return;\n const mask = this.mask();\n const primaryMask: MaskitoOptions = {\n ...mask,\n preprocessors: [\n ...(mask.preprocessors ?? []),\n (state) => {\n this.primaryGhost.set(state.elementState.value.slice(0, placeholder.length));\n this.primaryFiller.set(placeholder.slice(state.elementState.value.length));\n return state;\n },\n ],\n postprocessors: [\n (elementState) => {\n this.maskApplied.emit(elementState.value);\n return elementState;\n },\n ...(mask.postprocessors ?? []),\n ],\n };\n\n const maskedInput = new Maskito(this.primaryInputElement(), primaryMask);\n this.maskedInput.set(maskedInput);\n\n onCleanup(() => {\n maskedInput.destroy();\n this.maskedInput.set(null);\n });\n });\n\n inputEffect = effect(() => {\n const primaryInputElement = this.primaryInputElement();\n untracked(() => primaryInputElement.dispatchEvent(new InputEvent('input')));\n });\n}\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<span class=\"ghost\">{{ primaryGhost() }}</span>\n<span class=\"filler\">{{ primaryFiller() ?? placeholder() }}</span>\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 Signal,\n OnInit,\n inject,\n signal,\n Directive,\n ElementRef,\n DestroyRef,\n AfterViewInit,\n ChangeDetectorRef,\n input,\n computed,\n} from '@angular/core';\n\nimport { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\n\nimport { WattDateRange } from '@energinet/watt/core/date';\n\nimport { WattPickerValue } from './watt-picker-value';\n\n@Directive({\n host: {\n '[attr.watt-field-disabled]': 'disabled()',\n },\n})\nexport abstract class WattPickerBase implements OnInit, AfterViewInit, ControlValueAccessor {\n protected destroyRef = inject(DestroyRef);\n protected changeDetectionRef = inject(ChangeDetectorRef);\n protected ngControl = inject(NgControl, { optional: true });\n protected elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n abstract input: Signal<ElementRef<HTMLInputElement> | undefined>;\n abstract endInput: Signal<ElementRef<HTMLInputElement> | undefined>;\n abstract startInput: Signal<ElementRef<HTMLInputElement> | undefined>;\n\n static nextId = 0;\n\n id: string;\n\n initialValue: WattPickerValue = null;\n\n focused = signal(false);\n\n controlType = 'mat-date-range-input'; // We keep the controlType of Material Date Range Input as is, to keep some styling.\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n userAriaDescribedBy = input<string>(undefined, { alias: 'aria-describedby' });\n\n placeholder = signal('');\n\n get value(): WattDateRange | null {\n if (this.ngControl?.valid) {\n const {\n value: { start, end },\n } = this.ngControl;\n\n return { start, end };\n }\n\n return null;\n }\n\n protected setValue(value: WattPickerValue) {\n const input = this.input();\n const startInput = this.startInput();\n const endInput = this.endInput();\n\n const inputNotToBeInTheDocument = !this.range() ? !input : !startInput;\n\n if (inputNotToBeInTheDocument) {\n this.initialValue = value;\n return;\n }\n\n if (this.range()) {\n if (!startInput || !endInput) return;\n this.setRangeValue(value as WattDateRange, startInput.nativeElement, endInput.nativeElement);\n } else {\n if (!input) return;\n this.setSingleValue(value as Exclude<WattPickerValue, WattDateRange>, input.nativeElement);\n }\n }\n\n range = input<boolean, BooleanInput>(false, { transform: coerceBooleanProperty });\n\n required = input<boolean, BooleanInput>(false, { transform: coerceBooleanProperty });\n\n disabledInput = input<boolean, BooleanInput>(false, {\n // eslint-disable-next-line @angular-eslint/no-input-rename\n alias: 'disabled',\n transform: coerceBooleanProperty,\n });\n protected disabledState = signal(false);\n disabled = computed(() => this.disabledInput() || this.disabledState());\n\n get empty(): boolean {\n if (this.range()) {\n return !this.ngControl?.value?.start && !this.ngControl?.value?.end;\n } else {\n return this.ngControl?.value?.length === 0;\n }\n }\n\n get errorState(): boolean {\n return !!this.ngControl?.invalid && !!this.ngControl?.touched;\n }\n\n shouldLabelFloat = computed(() => {\n return this.focused() || !this.empty;\n });\n\n /**\n *\n * @ignore\n */\n control: FormControl | null = null;\n\n constructor(id: string) {\n this.id = id;\n this.elementRef.nativeElement.setAttribute('id', id);\n\n if (this.ngControl != null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n ngOnInit(): void {\n this.control = this.ngControl?.control as FormControl;\n }\n\n ngAfterViewInit(): void {\n if (this.initialValue) {\n this.writeValue(this.initialValue);\n }\n\n if (this.range()) {\n this.initRangeInput();\n } else {\n this.initSingleInput();\n }\n }\n\n protected abstract initRangeInput(): void;\n\n protected abstract initSingleInput(): void;\n\n protected abstract setSingleValue(\n value: Exclude<WattPickerValue, WattDateRange>,\n input: HTMLInputElement\n ): void;\n\n protected abstract setRangeValue(\n value: WattDateRange,\n startInput: HTMLInputElement,\n endInput: HTMLInputElement\n ): void;\n\n setDescribedByIds(ids: string[]) {\n this.elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));\n }\n\n onContainerClick() {\n // Intentionally left empty\n }\n\n writeValue(value: WattPickerValue): void {\n this.setValue(value);\n }\n\n registerOnChange(onChangeFn: (value: string | WattDateRange) => void): void {\n this.changeParentValue = onChangeFn;\n }\n\n registerOnTouched(onTouchFn: () => void) {\n this.markParentControlAsTouched = onTouchFn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabledState.set(isDisabled);\n this.changeDetectionRef.detectChanges();\n }\n\n onFocusIn() {\n if (!this.focused()) {\n this.focused.set(true);\n }\n }\n\n onFocusOut(event: FocusEvent) {\n const id = this.elementRef.nativeElement.attributes.getNamedItem('aria-owns');\n const overlay = id ? document.getElementById(id.value) : null;\n const isChild = overlay?.contains(event.relatedTarget as Element);\n\n if (!this.elementRef.nativeElement.contains(event.relatedTarget as Element) && !isChild) {\n this.focused.set(false);\n this.markParentControlAsTouched();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected changeParentValue = (value: string | WattDateRange): void => {\n // Intentionally left empty\n };\n\n protected markParentControlAsTouched = (): void => {\n // Intentionally left empty\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 { WattPlaceholderMaskComponent } from './placeholder-mask/watt-placeholder-mask.component';\nexport { WattPickerBase } from './watt-picker-base';\nexport { WattPickerValue } from './watt-picker-value';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAoBa,4BAA4B,CAAA;AACvC,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC/B,IAAA,mBAAmB,GAAG,KAAK,CAAC,QAAQ,8DAAoB;IACxD,qBAAqB,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,uBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAoB;AACjD,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAkB;AACvC,IAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,sDAAU;IACtC,WAAW,GAAG,MAAM,EAAU;AAC9B,IAAA,WAAW,GAAG,MAAM,CAAiB,IAAI,uDAAC;AAC1C,IAAA,YAAY,GAAG,MAAM,CAAC,EAAE,wDAAC;AACzB,IAAA,aAAa,GAAG,MAAM,CAAgB,IAAI,yDAAC;AAE3C,IAAA,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