@energinet/watt 4.3.2 → 4.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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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AM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,QAAA,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,CAA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AA,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;;AEjKxE;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
@@ -3,6 +3,8 @@ import * as i0 from '@angular/core';
3
3
  import { viewChild, input, Component } from '@angular/core';
4
4
  import { BehaviorSubject, skip, debounceTime } from 'rxjs';
5
5
  import { WattIconComponent } from '@energinet/watt/icon';
6
+ import { WattFieldComponent } from '@energinet/watt/field';
7
+ import { WattButtonComponent } from '@energinet/watt/button';
6
8
 
7
9
  //#region License
8
10
  /**
@@ -114,6 +116,85 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
114
116
  `, styles: [":host{height:44px}label{display:inline-block;width:100%;position:relative;text-transform:none;overflow:hidden;pointer-events:none}input{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;font-family:inherit;width:100%;height:44px;padding-left:var(--watt-space-l);padding-right:12px;border:1px solid var(--watt-on-light-low-emphasis);border-radius:4px;outline:0;opacity:0;transition-property:opacity}.wrapper{display:inline-flex;position:absolute;left:100%;width:100%;height:100%;transition-property:transform}.button{display:inline-flex;gap:var(--watt-space-xs);align-items:center;height:44px;padding:0 16px;color:var(--watt-color-primary);transform:translate(-100%);transition-property:transform;pointer-events:auto;cursor:pointer}.button:hover{color:var(--watt-color-primary-dark)}.text{opacity:1;transition-property:opacity}.clear{position:absolute;top:50%;right:var(--watt-space-s);padding:var(--watt-space-xs);border:none;border-radius:4px;background:none;color:var(--watt-color-primary);transform:translateY(-50%);cursor:pointer;pointer-events:auto}.clear:focus-visible{outline:2px solid var(--watt-color-primary)}input:placeholder-shown~.clear{display:none}input,.wrapper,.button,.text{transition-duration:.3s;transition-timing-function:cubic-bezier(.75,0,.25,1)}input{transition-timing-function:cubic-bezier(0,.5,0,1)}input:focus{border:1px solid var(--watt-color-primary)}input:not(:placeholder-shown),input:focus{pointer-events:auto;opacity:1;transition-timing-function:cubic-bezier(1,0,.5,0)}input:not(:placeholder-shown)+.wrapper,input:focus+.wrapper{transform:translate(-100%)}input:not(:placeholder-shown)+.wrapper .button,input:focus+.wrapper .button{pointer-events:none;transform:translate(-6px)}input:not(:placeholder-shown)+.wrapper .text,input:focus+.wrapper .text{opacity:0}\n"] }]
115
117
  }], propDecorators: { input: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], debounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceTime", required: false }] }], trim: [{ type: i0.Input, args: [{ isSignal: true, alias: "trim", required: false }] }], search: [{ type: i0.Output, args: ["search"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
116
118
 
119
+ //#region License
120
+ /**
121
+ * @license
122
+ * Copyright 2020 Energinet DataHub A/S
123
+ *
124
+ * Licensed under the Apache License, Version 2.0 (the "License2");
125
+ * you may not use this file except in compliance with the License.
126
+ * You may obtain a copy of the License at
127
+ *
128
+ * http://www.apache.org/licenses/LICENSE-2.0
129
+ *
130
+ * Unless required by applicable law or agreed to in writing, software
131
+ * distributed under the License is distributed on an "AS IS" BASIS,
132
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133
+ * See the License for the specific language governing permissions and
134
+ * limitations under the License.
135
+ */
136
+ //#endregion
137
+ class WattSimpleSearchComponent {
138
+ input = viewChild.required('input');
139
+ label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
140
+ debounceTime = input(300, ...(ngDevMode ? [{ debugName: "debounceTime" }] : []));
141
+ /**
142
+ * If true, trims whitespace from the search value before emitting.
143
+ */
144
+ trim = input(true, ...(ngDevMode ? [{ debugName: "trim" }] : []));
145
+ search$ = new BehaviorSubject('');
146
+ search = outputFromObservable(this.search$.pipe(skip(1), debounceTime(this.debounceTime())));
147
+ size = input('s', ...(ngDevMode ? [{ debugName: "size" }] : []));
148
+ /**
149
+ * Handles input event, optionally trimming the value.
150
+ */
151
+ onInput(value) {
152
+ const processed = this.trim() ? value.trim() : value;
153
+ this.search$.next(processed);
154
+ }
155
+ clear() {
156
+ const element = this.input().nativeElement;
157
+ if (element.value === '')
158
+ return;
159
+ element.value = '';
160
+ this.onInput(element.value);
161
+ }
162
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattSimpleSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
163
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.15", type: WattSimpleSearchComponent, isStandalone: true, selector: "watt-simple-search", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null }, trim: { classPropertyName: "trim", publicName: "trim", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { search: "search" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: `
164
+ <watt-field>
165
+ <watt-icon name="search" [size]="size()" />
166
+ <input
167
+ #input
168
+ type="text"
169
+ role="searchbox"
170
+ [placeholder]="label()"
171
+ (input)="onInput(input.value)"
172
+ />
173
+ <button class="clear" (click)="clear()">
174
+ <watt-icon name="close" [size]="size()" />
175
+ </button>
176
+ </watt-field>
177
+ `, isInline: true, styles: [":host{height:44px;min-height:44px}.clear{position:absolute;top:50%;right:var(--watt-space-s);padding:var(--watt-space-xs);border:none;border-radius:4px;background:none;color:var(--watt-color-primary);transform:translateY(-50%);cursor:pointer;pointer-events:auto}.clear:focus-visible{outline:2px solid var(--watt-color-primary)}input:placeholder-shown~.clear{display:none}\n"], dependencies: [{ kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }] });
178
+ }
179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattSimpleSearchComponent, decorators: [{
180
+ type: Component,
181
+ args: [{ imports: [WattIconComponent, WattFieldComponent, WattButtonComponent], selector: 'watt-simple-search', template: `
182
+ <watt-field>
183
+ <watt-icon name="search" [size]="size()" />
184
+ <input
185
+ #input
186
+ type="text"
187
+ role="searchbox"
188
+ [placeholder]="label()"
189
+ (input)="onInput(input.value)"
190
+ />
191
+ <button class="clear" (click)="clear()">
192
+ <watt-icon name="close" [size]="size()" />
193
+ </button>
194
+ </watt-field>
195
+ `, styles: [":host{height:44px;min-height:44px}.clear{position:absolute;top:50%;right:var(--watt-space-s);padding:var(--watt-space-xs);border:none;border-radius:4px;background:none;color:var(--watt-color-primary);transform:translateY(-50%);cursor:pointer;pointer-events:auto}.clear:focus-visible{outline:2px solid var(--watt-color-primary)}input:placeholder-shown~.clear{display:none}\n"] }]
196
+ }], propDecorators: { input: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], debounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceTime", required: false }] }], trim: [{ type: i0.Input, args: [{ isSignal: true, alias: "trim", required: false }] }], search: [{ type: i0.Output, args: ["search"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
197
+
117
198
  //#region License
118
199
  /**
119
200
  * @license
@@ -137,5 +218,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
137
218
  * Generated bundle index. Do not edit.
138
219
  */
139
220
 
140
- export { WattSearchComponent };
221
+ export { WattSearchComponent, WattSimpleSearchComponent };
141
222
  //# sourceMappingURL=energinet-watt-search.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-search.mjs","sources":["../../../libs/watt/package/search/watt-search.component.ts","../../../libs/watt/package/search/index.ts","../../../libs/watt/package/search/energinet-watt-search.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 { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { Component, ElementRef, input, viewChild } from '@angular/core';\n\nimport { BehaviorSubject, debounceTime, skip } from 'rxjs';\n\nimport { WattIconComponent, WattIconSize } from '@energinet/watt/icon';\n\n@Component({\n imports: [WattIconComponent],\n selector: 'watt-search',\n styleUrls: ['./watt-search.component.scss'],\n template: `\n <label>\n <input\n #input\n type=\"text\"\n role=\"searchbox\"\n [placeholder]=\"label()\"\n (input)=\"onInput(input.value)\"\n />\n <span class=\"wrapper\">\n <span class=\"button\">\n <watt-icon name=\"search\" [size]=\"size()\" aria-hidden=\"true\" />\n <span class=\"text\">{{ label() }}</span>\n </span>\n </span>\n <button class=\"clear\" (click)=\"clear()\">\n <watt-icon name=\"close\" [size]=\"size()\" />\n </button>\n </label>\n `,\n})\nexport class WattSearchComponent {\n /**\n * @ignore\n */\n input = viewChild.required<ElementRef<HTMLInputElement>>('input');\n\n /**\n * @ignore\n */\n label = input<string>('');\n\n /**\n * @ignore\n */\n debounceTime = input<number>(300);\n\n /**\n * If true, trims whitespace from the search value before emitting.\n */\n trim = input(true);\n\n /**\n * @ignore\n */\n search$ = new BehaviorSubject<string>('');\n\n /**\n * @ignore\n */\n search = outputFromObservable(this.search$.pipe(skip(1), debounceTime(this.debounceTime())));\n\n /**\n * @ignore\n */\n size = input<WattIconSize>('s');\n\n /**\n * Handles input event, optionally trimming the value.\n */\n onInput(value: string): void {\n const processed = this.trim() ? value.trim() : value;\n this.search$.next(processed);\n }\n\n /**\n * @ignore\n */\n clear(): void {\n const element = this.input().nativeElement;\n if (element.value === '') return;\n\n element.value = '';\n this.onInput(element.value);\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 { WattSearchComponent } from './watt-search.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAiCa,mBAAmB,CAAA;AAC9B;;AAEG;AACH,IAAA,KAAK,GAAG,SAAS,CAAC,QAAQ,CAA+B,OAAO,CAAC;AAEjE;;AAEG;AACH,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;AAEzB;;AAEG;AACH,IAAA,YAAY,GAAG,KAAK,CAAS,GAAG,wDAAC;AAEjC;;AAEG;AACH,IAAA,IAAI,GAAG,KAAK,CAAC,IAAI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AAA,EAAA;mEAMwD,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACtDlE;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-search.mjs","sources":["../../../libs/watt/package/search/watt-search.component.ts","../../../libs/watt/package/search/watt-simple-search.component.ts","../../../libs/watt/package/search/index.ts","../../../libs/watt/package/search/energinet-watt-search.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 { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { Component, ElementRef, input, viewChild } from '@angular/core';\n\nimport { BehaviorSubject, debounceTime, skip } from 'rxjs';\n\nimport { WattIconComponent, WattIconSize } from '@energinet/watt/icon';\n\n@Component({\n imports: [WattIconComponent],\n selector: 'watt-search',\n styleUrls: ['./watt-search.component.scss'],\n template: `\n <label>\n <input\n #input\n type=\"text\"\n role=\"searchbox\"\n [placeholder]=\"label()\"\n (input)=\"onInput(input.value)\"\n />\n <span class=\"wrapper\">\n <span class=\"button\">\n <watt-icon name=\"search\" [size]=\"size()\" aria-hidden=\"true\" />\n <span class=\"text\">{{ label() }}</span>\n </span>\n </span>\n <button class=\"clear\" (click)=\"clear()\">\n <watt-icon name=\"close\" [size]=\"size()\" />\n </button>\n </label>\n `,\n})\nexport class WattSearchComponent {\n /**\n * @ignore\n */\n input = viewChild.required<ElementRef<HTMLInputElement>>('input');\n\n /**\n * @ignore\n */\n label = input<string>('');\n\n /**\n * @ignore\n */\n debounceTime = input<number>(300);\n\n /**\n * If true, trims whitespace from the search value before emitting.\n */\n trim = input(true);\n\n /**\n * @ignore\n */\n search$ = new BehaviorSubject<string>('');\n\n /**\n * @ignore\n */\n search = outputFromObservable(this.search$.pipe(skip(1), debounceTime(this.debounceTime())));\n\n /**\n * @ignore\n */\n size = input<WattIconSize>('s');\n\n /**\n * Handles input event, optionally trimming the value.\n */\n onInput(value: string): void {\n const processed = this.trim() ? value.trim() : value;\n this.search$.next(processed);\n }\n\n /**\n * @ignore\n */\n clear(): void {\n const element = this.input().nativeElement;\n if (element.value === '') return;\n\n element.value = '';\n this.onInput(element.value);\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 { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { Component, ElementRef, input, viewChild } from '@angular/core';\n\nimport { BehaviorSubject, debounceTime, skip } from 'rxjs';\n\nimport { WattIconComponent, WattIconSize } from '@energinet/watt/icon';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\n@Component({\n imports: [WattIconComponent, WattFieldComponent, WattButtonComponent],\n selector: 'watt-simple-search',\n styles: `\n :host {\n height: 44px; /* Magix UX number (replace with variable) */\n min-height: 44px; /* Magix UX number (replace with variable) */\n }\n\n .clear {\n position: absolute;\n top: 50%;\n right: var(--watt-space-s);\n padding: var(--watt-space-xs);\n border: none;\n border-radius: 4px;\n background: none;\n color: var(--watt-color-primary);\n transform: translateY(-50%);\n cursor: pointer;\n pointer-events: auto;\n }\n\n .clear:focus-visible {\n outline: 2px solid var(--watt-color-primary);\n }\n\n input:placeholder-shown ~ .clear {\n display: none;\n }\n `,\n template: `\n <watt-field>\n <watt-icon name=\"search\" [size]=\"size()\" />\n <input\n #input\n type=\"text\"\n role=\"searchbox\"\n [placeholder]=\"label()\"\n (input)=\"onInput(input.value)\"\n />\n <button class=\"clear\" (click)=\"clear()\">\n <watt-icon name=\"close\" [size]=\"size()\" />\n </button>\n </watt-field>\n `,\n})\nexport class WattSimpleSearchComponent {\n input = viewChild.required<ElementRef<HTMLInputElement>>('input');\n label = input<string>('');\n debounceTime = input<number>(300);\n\n /**\n * If true, trims whitespace from the search value before emitting.\n */\n trim = input(true);\n search$ = new BehaviorSubject<string>('');\n search = outputFromObservable(this.search$.pipe(skip(1), debounceTime(this.debounceTime())));\n size = input<WattIconSize>('s');\n\n /**\n * Handles input event, optionally trimming the value.\n */\n onInput(value: string): void {\n const processed = this.trim() ? value.trim() : value;\n this.search$.next(processed);\n }\n\n clear(): void {\n const element = this.input().nativeElement;\n if (element.value === '') return;\n\n element.value = '';\n this.onInput(element.value);\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 { WattSearchComponent } from './watt-search.component';\nexport { WattSimpleSearchComponent } from './watt-simple-search.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAiCa,mBAAmB,CAAA;AAC9B;;AAEG;AACH,IAAA,KAAK,GAAG,SAAS,CAAC,QAAQ,CAA+B,OAAO,CAAC;AAEjE;;AAEG;AACH,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;AAEzB;;AAEG;AACH,IAAA,YAAY,GAAG,KAAK,CAAS,GAAG,wDAAC;AAEjC;;AAEG;AACH,IAAA,IAAI,GAAG,KAAK,CAAC,IAAI,gDAAC;AAElB;;AAEG;AACH,IAAA,OAAO,GAAG,IAAI,eAAe,CAAS,EAAE,CAAC;AAEzC;;AAEG;IACH,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,C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IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC3ElE;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { computed, effect, linkedSignal, afterRenderEffect, untracked, inject, TemplateRef, input, Directive, model, output, contentChildren, contentChild, viewChild, viewChildren, ViewEncapsulation, Component } from '@angular/core';
3
3
  import * as i3 from '@angular/material/table';
4
4
  import { MatTableDataSource, MatTableModule } from '@angular/material/table';
5
- import { NgTemplateOutlet, NgClass, KeyValuePipe } from '@angular/common';
5
+ import { NgTemplateOutlet, KeyValuePipe } from '@angular/common';
6
6
  import { outputFromObservable } from '@angular/core/rxjs-interop';
7
7
  import * as i1 from '@angular/forms';
8
8
  import { FormsModule } from '@angular/forms';
@@ -400,12 +400,11 @@ class WattTableComponent {
400
400
  */
401
401
  toggleSelection = (row) => this.selection.update((s) => (s.includes(row) ? s.filter((r) => r !== row) : s.concat(row)));
402
402
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
403
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattTableComponent, isStandalone: true, selector: "watt-table", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, displayedColumns: { classPropertyName: "displayedColumns", publicName: "displayedColumns", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, stickyFooter: { classPropertyName: "stickyFooter", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, resolveHeader: { classPropertyName: "resolveHeader", publicName: "resolveHeader", isSignal: true, isRequired: false, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null }, sortClear: { classPropertyName: "sortClear", publicName: "sortClear", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, suppressRowHoverHighlight: { classPropertyName: "suppressRowHoverHighlight", publicName: "suppressRowHoverHighlight", isSignal: true, isRequired: false, transformFunction: null }, activeRow: { classPropertyName: "activeRow", publicName: "activeRow", isSignal: true, isRequired: false, transformFunction: null }, activeRowComparator: { classPropertyName: "activeRowComparator", publicName: "activeRowComparator", isSignal: true, isRequired: false, transformFunction: null }, hideColumnHeaders: { classPropertyName: "hideColumnHeaders", publicName: "hideColumnHeaders", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", expanded: "expandedChange", rowClick: "rowClick", sortChange: "sortChange" }, host: { properties: { "class.watt-table-variant-zebra": "variant() === \"zebra\"", "style.--watt-table-grid-template-columns": "sizing().join(\" \")" } }, queries: [{ propertyName: "cells", predicate: (WattTableCellDirective), isSignal: true }, { propertyName: "toolbar", first: true, predicate: (WattTableToolbarDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "tableCellElements", predicate: ["td"], 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<table\n mat-table\n matSort\n role=\"treegrid\"\n [ngClass]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [ngClass]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n }\"\n ></tr>\n\n @if (toolbar()) {\n <tr mat-footer-row *matFooterRowDef=\"['spacer']\"></tr>\n }\n\n @if (hasFooter()) {\n <tr\n mat-footer-row\n [class.watt-table-hide-footer]=\"loading() || dataSource().filteredData.length === 0\"\n *matFooterRowDef=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-clickable-row>td:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i2.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i2.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i3.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i3.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i3.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "component", type: WattCheckboxComponent, selector: "watt-checkbox", inputs: ["required"] }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }], encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [NgTemplateOutlet]] });
403
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattTableComponent, isStandalone: true, selector: "watt-table", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, displayedColumns: { classPropertyName: "displayedColumns", publicName: "displayedColumns", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, stickyFooter: { classPropertyName: "stickyFooter", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, resolveHeader: { classPropertyName: "resolveHeader", publicName: "resolveHeader", isSignal: true, isRequired: false, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null }, sortClear: { classPropertyName: "sortClear", publicName: "sortClear", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, suppressRowHoverHighlight: { classPropertyName: "suppressRowHoverHighlight", publicName: "suppressRowHoverHighlight", isSignal: true, isRequired: false, transformFunction: null }, activeRow: { classPropertyName: "activeRow", publicName: "activeRow", isSignal: true, isRequired: false, transformFunction: null }, activeRowComparator: { classPropertyName: "activeRowComparator", publicName: "activeRowComparator", isSignal: true, isRequired: false, transformFunction: null }, hideColumnHeaders: { classPropertyName: "hideColumnHeaders", publicName: "hideColumnHeaders", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", expanded: "expandedChange", rowClick: "rowClick", sortChange: "sortChange" }, host: { properties: { "class.watt-table-variant-zebra": "variant() === \"zebra\"", "style.--watt-table-grid-template-columns": "sizing().join(\" \")" } }, queries: [{ propertyName: "cells", predicate: (WattTableCellDirective), isSignal: true }, { propertyName: "toolbar", first: true, predicate: (WattTableToolbarDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "tableCellElements", predicate: ["td"], 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<table\n mat-table\n matSort\n role=\"treegrid\"\n [class]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [class]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n }\"\n ></tr>\n\n @if (toolbar()) {\n <tr mat-footer-row *matFooterRowDef=\"['spacer']\"></tr>\n }\n\n @if (hasFooter()) {\n <tr\n mat-footer-row\n [class.watt-table-hide-footer]=\"loading() || dataSource().filteredData.length === 0\"\n *matFooterRowDef=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-clickable-row>td:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i2.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i2.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i3.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i3.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i3.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "component", type: WattCheckboxComponent, selector: "watt-checkbox", inputs: ["required"] }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }], encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [NgTemplateOutlet]] });
404
404
  }
405
405
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattTableComponent, decorators: [{
406
406
  type: Component,
407
407
  args: [{ imports: [
408
- NgClass,
409
408
  NgTemplateOutlet,
410
409
  KeyValuePipe,
411
410
  FormsModule,
@@ -416,7 +415,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
416
415
  ], encapsulation: ViewEncapsulation.None, selector: 'watt-table', host: {
417
416
  '[class.watt-table-variant-zebra]': 'variant() === "zebra"',
418
417
  '[style.--watt-table-grid-template-columns]': 'sizing().join(" ")',
419
- }, 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<table\n mat-table\n matSort\n role=\"treegrid\"\n [ngClass]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [ngClass]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n }\"\n ></tr>\n\n @if (toolbar()) {\n <tr mat-footer-row *matFooterRowDef=\"['spacer']\"></tr>\n }\n\n @if (hasFooter()) {\n <tr\n mat-footer-row\n [class.watt-table-hide-footer]=\"loading() || dataSource().filteredData.length === 0\"\n *matFooterRowDef=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-clickable-row>td:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"] }]
418
+ }, 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<table\n mat-table\n matSort\n role=\"treegrid\"\n [class]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [class]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n }\"\n ></tr>\n\n @if (toolbar()) {\n <tr mat-footer-row *matFooterRowDef=\"['spacer']\"></tr>\n }\n\n @if (hasFooter()) {\n <tr\n mat-footer-row\n [class.watt-table-hide-footer]=\"loading() || dataSource().filteredData.length === 0\"\n *matFooterRowDef=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-clickable-row>td:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"] }]
420
419
  }], ctorParameters: () => [], propDecorators: { dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], displayedColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayedColumns", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], stickyFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyFooter", required: false }] }], resolveHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "resolveHeader", required: false }] }], sortBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortBy", required: false }] }], sortDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDirection", required: false }] }], sortClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortClear", required: false }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], suppressRowHoverHighlight: [{ type: i0.Input, args: [{ isSignal: true, alias: "suppressRowHoverHighlight", required: false }] }], activeRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeRow", required: false }] }], activeRowComparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeRowComparator", required: false }] }], hideColumnHeaders: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideColumnHeaders", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }, { type: i0.Output, args: ["expandedChange"] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], cells: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => WattTableCellDirective), { isSignal: true }] }], toolbar: [{ type: i0.ContentChild, args: [i0.forwardRef(() => WattTableToolbarDirective), { isSignal: true }] }], sort: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatSort), { isSignal: true }] }], tableCellElements: [{ type: i0.ViewChildren, args: ['td', { isSignal: true }] }] } });
421
420
  const WATT_TABLE = [WattTableComponent, WattTableCellDirective, WattTableToolbarDirective];
422
421