@energinet/watt 1.5.18 → 1.6.0

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.
@@ -315,6 +315,10 @@ class WattTableComponent {
315
315
  return column.value.helperAction;
316
316
  }
317
317
  /** @ignore */
318
+ _getColumnHeaderTooltip(column) {
319
+ return column.value.tooltip;
320
+ }
321
+ /** @ignore */
318
322
  _getColumnCell(column, row) {
319
323
  return column.value.cell?.(row) ?? this.getCellData(row, column.value);
320
324
  }
@@ -333,7 +337,7 @@ class WattTableComponent {
333
337
  this.rowClick.emit(row);
334
338
  }
335
339
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
336
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattTableComponent, isStandalone: true, selector: "watt-table", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: false, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: false, isRequired: false, transformFunction: null }, displayedColumns: { classPropertyName: "displayedColumns", publicName: "displayedColumns", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: false, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: false, isRequired: false, transformFunction: null }, stickyFooter: { classPropertyName: "stickyFooter", publicName: "stickyFooter", isSignal: false, isRequired: false, transformFunction: null }, resolveHeader: { classPropertyName: "resolveHeader", publicName: "resolveHeader", isSignal: false, isRequired: false, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: false, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: false, isRequired: false, transformFunction: null }, sortClear: { classPropertyName: "sortClear", publicName: "sortClear", isSignal: false, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: false, isRequired: false, transformFunction: null }, initialSelection: { classPropertyName: "initialSelection", publicName: "initialSelection", isSignal: true, isRequired: false, transformFunction: null }, suppressRowHoverHighlight: { classPropertyName: "suppressRowHoverHighlight", publicName: "suppressRowHoverHighlight", isSignal: false, isRequired: false, transformFunction: null }, activeRow: { classPropertyName: "activeRow", publicName: "activeRow", isSignal: false, isRequired: false, transformFunction: null }, activeRowComparator: { classPropertyName: "activeRowComparator", publicName: "activeRowComparator", isSignal: false, isRequired: false, transformFunction: null }, hideColumnHeaders: { classPropertyName: "hideColumnHeaders", publicName: "hideColumnHeaders", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange", rowClick: "rowClick", sortChange: "sortChange" }, providers: [WattDatePipe], queries: [{ propertyName: "_toolbar", first: true, predicate: WattTableToolbarDirective, descendants: true }, { propertyName: "_cells", predicate: WattTableCellDirective }], viewQueries: [{ propertyName: "_sort", first: true, predicate: MatSort, descendants: true }], usesOnChanges: 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': _filteredSelection.length > 0 }\"\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 [(ngModel)]=\"_columnSelection\" />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"_selectionModel.isSelected(row)\"\n (ngModelChange)=\"_selectionModel.toggle(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\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-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (_getColumnHelperAction(column); 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 </div>\n </th>\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n >\n @if (_getColumnTemplate(column.value); as template) {\n <div>\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row }\" />\n </div>\n } @else {\n {{ _getColumnCell(column, row) }}\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=\"_getColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: _getColumns()\"\n [attr.aria-selected]=\"row === activeRow\"\n (click)=\"_onRowClick(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 'watt-table-no-end-divider': hideColumnHeaders,\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=\"_getColumns(); 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 _getColumns(); 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) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"_toolbar.templateRef; context: { $implicit: _filteredSelection }\"\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;text-transform:uppercase;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:56px;padding:var(--watt-space-s) var(--watt-space-m)}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table tr.mdc-data-table__row:last-child .mat-mdc-cell{border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell{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-no-end-divider:last-child .mat-mdc-cell{border-bottom:0px solid var(--watt-color-neutral-grey-300)!important}watt-table .mat-mdc-table .watt-table-clickable-row td{cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row) 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-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}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}.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: "pipe", type: KeyValuePipe, name: "keyvalue" }, { 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: WattCheckboxComponent, selector: "watt-checkbox", inputs: ["required"] }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }], encapsulation: i0.ViewEncapsulation.None });
340
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattTableComponent, isStandalone: true, selector: "watt-table", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: false, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: false, isRequired: false, transformFunction: null }, displayedColumns: { classPropertyName: "displayedColumns", publicName: "displayedColumns", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: false, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: false, isRequired: false, transformFunction: null }, stickyFooter: { classPropertyName: "stickyFooter", publicName: "stickyFooter", isSignal: false, isRequired: false, transformFunction: null }, resolveHeader: { classPropertyName: "resolveHeader", publicName: "resolveHeader", isSignal: false, isRequired: false, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: false, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: false, isRequired: false, transformFunction: null }, sortClear: { classPropertyName: "sortClear", publicName: "sortClear", isSignal: false, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: false, isRequired: false, transformFunction: null }, initialSelection: { classPropertyName: "initialSelection", publicName: "initialSelection", isSignal: true, isRequired: false, transformFunction: null }, suppressRowHoverHighlight: { classPropertyName: "suppressRowHoverHighlight", publicName: "suppressRowHoverHighlight", isSignal: false, isRequired: false, transformFunction: null }, activeRow: { classPropertyName: "activeRow", publicName: "activeRow", isSignal: false, isRequired: false, transformFunction: null }, activeRowComparator: { classPropertyName: "activeRowComparator", publicName: "activeRowComparator", isSignal: false, isRequired: false, transformFunction: null }, hideColumnHeaders: { classPropertyName: "hideColumnHeaders", publicName: "hideColumnHeaders", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange", rowClick: "rowClick", sortChange: "sortChange" }, providers: [WattDatePipe], queries: [{ propertyName: "_toolbar", first: true, predicate: WattTableToolbarDirective, descendants: true }, { propertyName: "_cells", predicate: WattTableCellDirective }], viewQueries: [{ propertyName: "_sort", first: true, predicate: MatSort, descendants: true }], usesOnChanges: 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': _filteredSelection.length > 0 }\"\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 [(ngModel)]=\"_columnSelection\" />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"_selectionModel.isSelected(row)\"\n (ngModelChange)=\"_selectionModel.toggle(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\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-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (_getColumnHelperAction(column); 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 </div>\n @if (_getColumnHeaderTooltip(column); as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" />\n }\n </th>\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n >\n @if (_getColumnTemplate(column.value); as template) {\n <div>\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row }\" />\n </div>\n } @else {\n {{ _getColumnCell(column, row) }}\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=\"_getColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: _getColumns()\"\n [attr.aria-selected]=\"row === activeRow\"\n (click)=\"_onRowClick(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 'watt-table-no-end-divider': hideColumnHeaders,\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=\"_getColumns(); 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 _getColumns(); 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) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"_toolbar.templateRef; context: { $implicit: _filteredSelection }\"\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;text-transform:uppercase;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:56px;padding:var(--watt-space-s) var(--watt-space-m)}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table tr.mdc-data-table__row:last-child .mat-mdc-cell{border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell{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-no-end-divider:last-child .mat-mdc-cell{border-bottom:0px solid var(--watt-color-neutral-grey-300)!important}watt-table .mat-mdc-table .watt-table-clickable-row td{cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row) 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-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}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}.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: "pipe", type: KeyValuePipe, name: "keyvalue" }, { 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"] }], encapsulation: i0.ViewEncapsulation.None });
337
341
  }
338
342
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattTableComponent, decorators: [{
339
343
  type: Component,
@@ -344,9 +348,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
344
348
  FormsModule,
345
349
  MatSortModule,
346
350
  MatTableModule,
347
- WattCheckboxComponent,
348
351
  WattIconComponent,
349
- ], providers: [WattDatePipe], encapsulation: ViewEncapsulation.None, selector: 'watt-table', 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': _filteredSelection.length > 0 }\"\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 [(ngModel)]=\"_columnSelection\" />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"_selectionModel.isSelected(row)\"\n (ngModelChange)=\"_selectionModel.toggle(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\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-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (_getColumnHelperAction(column); 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 </div>\n </th>\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n >\n @if (_getColumnTemplate(column.value); as template) {\n <div>\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row }\" />\n </div>\n } @else {\n {{ _getColumnCell(column, row) }}\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=\"_getColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: _getColumns()\"\n [attr.aria-selected]=\"row === activeRow\"\n (click)=\"_onRowClick(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 'watt-table-no-end-divider': hideColumnHeaders,\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=\"_getColumns(); 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 _getColumns(); 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) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"_toolbar.templateRef; context: { $implicit: _filteredSelection }\"\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;text-transform:uppercase;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:56px;padding:var(--watt-space-s) var(--watt-space-m)}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table tr.mdc-data-table__row:last-child .mat-mdc-cell{border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell{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-no-end-divider:last-child .mat-mdc-cell{border-bottom:0px solid var(--watt-color-neutral-grey-300)!important}watt-table .mat-mdc-table .watt-table-clickable-row td{cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row) 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-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}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}.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"] }]
352
+ WattCheckboxComponent,
353
+ ], providers: [WattDatePipe], encapsulation: ViewEncapsulation.None, selector: 'watt-table', 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': _filteredSelection.length > 0 }\"\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 [(ngModel)]=\"_columnSelection\" />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"_selectionModel.isSelected(row)\"\n (ngModelChange)=\"_selectionModel.toggle(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\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-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (_getColumnHelperAction(column); 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 </div>\n @if (_getColumnHeaderTooltip(column); as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" />\n }\n </th>\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n >\n @if (_getColumnTemplate(column.value); as template) {\n <div>\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row }\" />\n </div>\n } @else {\n {{ _getColumnCell(column, row) }}\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=\"_getColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: _getColumns()\"\n [attr.aria-selected]=\"row === activeRow\"\n (click)=\"_onRowClick(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 'watt-table-no-end-divider': hideColumnHeaders,\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=\"_getColumns(); 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 _getColumns(); 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) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"_toolbar.templateRef; context: { $implicit: _filteredSelection }\"\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;text-transform:uppercase;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:56px;padding:var(--watt-space-s) var(--watt-space-m)}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table tr.mdc-data-table__row:last-child .mat-mdc-cell{border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell{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-no-end-divider:last-child .mat-mdc-cell{border-bottom:0px solid var(--watt-color-neutral-grey-300)!important}watt-table .mat-mdc-table .watt-table-clickable-row td{cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row) 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-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}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}.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"] }]
350
354
  }], ctorParameters: () => [], propDecorators: { dataSource: [{
351
355
  type: Input
352
356
  }], columns: [{
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-table.mjs","sources":["../../../libs/watt/package/table/watt-table-data-source.ts","../../../libs/watt/package/table/watt-table.component.ts","../../../libs/watt/package/table/watt-table.component.html","../../../libs/watt/package/table/index.ts","../../../libs/watt/package/table/energinet-watt-table.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 { DataSource } from '@angular/cdk/collections';\nimport { MatPaginator } from '@angular/material/paginator';\nimport { MatSort } from '@angular/material/sort';\nimport { MatTableDataSource } from '@angular/material/table';\n\nexport interface IWattTableDataSource<T> extends DataSource<T> {\n data: T[];\n filter: string;\n filteredData: T[];\n paginator: MatPaginator | null;\n sort: MatSort | null;\n totalCount: number;\n}\n\n/**\n * @see https://material.angular.io/components/table/api#MatTableDataSource\n */\nexport class WattTableDataSource<T>\n extends MatTableDataSource<T>\n implements IWattTableDataSource<T>\n{\n constructor(\n initialData?: T[],\n config: { disableClientSideSort: boolean } = { disableClientSideSort: false }\n ) {\n super(initialData);\n\n if (config.disableClientSideSort)\n this.sortData = (data: T[]): T[] => {\n return data;\n };\n }\n\n get totalCount() {\n return this.data.length;\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 { SelectionModel } from '@angular/cdk/collections';\nimport { KeyValue, KeyValuePipe, NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n AfterViewInit,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n effect,\n ElementRef,\n EventEmitter,\n inject,\n input,\n Input,\n OnChanges,\n Output,\n signal,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { QueryList, Signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormsModule } from '@angular/forms';\nimport { MatSort, MatSortModule, Sort, SortDirection } from '@angular/material/sort';\nimport { MatTableModule } from '@angular/material/table';\nimport { map } from 'rxjs';\n\nimport { WattCheckboxComponent } from '@energinet/watt/checkbox';\nimport { WattDatePipe } from '@energinet/watt/core/date';\nimport { WattIconComponent } from '@energinet/watt/icon';\n\nimport { IWattTableDataSource, WattTableDataSource } from './watt-table-data-source';\n\nexport interface WattTableColumn<T> {\n /**\n * The data that this column should be bound to, either as a property of `T`\n * or derived from each row of `T` using an accessor function. Use `null`\n * for columns that should not be associated with data, but note that this\n * will disable sorting and automatic cell population.\n */\n accessor: keyof T | ((row: T) => unknown) | null;\n\n /**\n * Resolve the header text to a static display value. This will prevent\n * the `resolveHeader` input function from being called for this column.\n */\n header?: string;\n\n /**\n * Callback for determining cell content when not using template. By default,\n * cell content is found using the `accessor` (unless it is `null`).\n */\n cell?: (row: T) => string;\n\n /**\n * Enable or disable sorting for this column. Defaults to `true`\n * unless `accessor` is `null`.\n */\n sort?: boolean;\n\n /**\n * Set the column size using grid sizing values. Defaults to `\"auto\"`.\n *\n * @remarks\n * Accepts all of the CSS grid track size keywords (such as `min-content`,\n * `max-content`, `minmax()`) as well as fractional (`fr`), percentage (`%`)\n * and length (`px`, `em`, etc) units.\n *\n * @see https://drafts.csswg.org/css-grid/#track-sizes\n */\n size?: string;\n\n /**\n * Horizontally align the contents of the column. Defaults to `\"left\"`.\n */\n align?: 'left' | 'right' | 'center';\n\n /**\n * Helper icon will be shown in the header cell, with an click event.\n */\n helperAction?: () => void;\n\n /**\n * CSS class to apply to the header cell element.\n */\n headerCellClass?: string;\n\n /**\n * CSS class to apply to the data cell element.\n */\n dataCellClass?: string;\n\n /**\n * Footer configuration for the column.\n */\n footer?: WattTableColumnFooter;\n\n /**\n * When set to `true`, the column remains visible when horizontally scrolling.\n */\n stickyEnd?: Signal<boolean>;\n}\n\n/**\n * Configuration for the footer cell of a column.\n */\nexport interface WattTableColumnFooter {\n /**\n * The value that will be displayed in the footer cell.\n */\n value?: Signal<string | number>;\n\n /**\n * CSS class to apply to the footer cell.\n */\n class?: string;\n}\n\n/**\n * Record for defining columns with keys used as column identifiers.\n */\nexport type WattTableColumnDef<T> = Record<string, WattTableColumn<T>>;\n\n// Used for strongly typing the structural directive\ninterface WattTableCellContext<T> {\n $implicit: T;\n}\n\ninterface WattTableToolbarContext<T> {\n $implicit: T;\n}\n\n@Directive({\n selector: '[wattTableCell]',\n})\nexport class WattTableCellDirective<T> {\n /** The WattTableColumn this template applies to. */\n @Input('wattTableCell') column!: WattTableColumn<T>;\n @Input('wattTableCellHeader') header?: string;\n templateRef = inject(TemplateRef<WattTableCellContext<T>>);\n static ngTemplateContextGuard<T>(\n _directive: WattTableCellDirective<T>,\n context: unknown\n ): context is WattTableCellContext<T> {\n return true;\n }\n}\n\n@Directive({\n selector: '[wattTableToolbar]',\n})\nexport class WattTableToolbarDirective<T> {\n templateRef = inject(TemplateRef<WattTableToolbarContext<T[]>>);\n static ngTemplateContextGuard<T>(\n _directive: WattTableToolbarDirective<T>,\n context: unknown\n ): context is WattTableToolbarContext<T[]> {\n return true;\n }\n}\n\n/**\n * Usage:\n * `import { WATT_TABLE } from '@energinet-datahub/watt/table';`\n */\n@Component({\n imports: [\n NgClass,\n NgTemplateOutlet,\n KeyValuePipe,\n FormsModule,\n MatSortModule,\n MatTableModule,\n WattCheckboxComponent,\n WattIconComponent,\n ],\n providers: [WattDatePipe],\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-table',\n styleUrls: ['./watt-table.component.scss'],\n templateUrl: './watt-table.component.html',\n})\nexport class WattTableComponent<T> implements OnChanges, AfterViewInit {\n /**\n * The table's source of data. Property should not be changed after\n * initialization, instead update the data on the instance itself.\n */\n @Input() dataSource!: IWattTableDataSource<T>;\n\n /**\n * Column definition record with keys representing the column identifiers\n * and values being the column configuration. The order of the columns\n * is determined by the property order, but can be overruled by the\n * `displayedColumns` input.\n */\n @Input() columns: WattTableColumnDef<T> = {};\n\n /**\n * Used for hiding or reordering columns defined in the `columns` input.\n */\n @Input() displayedColumns?: string[];\n\n /**\n * Used for disabling the table. This will disable all user interaction\n */\n @Input() disabled = false;\n\n /**\n * Provide a description of the table for visually impaired users.\n */\n @Input() description = '';\n\n /**\n * If set to `true`, the table will show a loading indicator\n * when there is no data.\n */\n @Input() loading = false;\n\n /**\n * If true the footer will be sticky\n */\n @Input() stickyFooter = false;\n\n /**\n * Optional callback for determining header text for columns that\n * do not have a static header text set in the column definition.\n * Useful for providing translations of column headers.\n */\n @Input()\n resolveHeader?: (key: string) => string;\n\n /**\n * Identifier for column that should be sorted initially.\n */\n @Input()\n sortBy = '';\n\n /**\n * The sort direction of the initially sorted column.\n */\n @Input()\n sortDirection: SortDirection = '';\n\n /**\n * Whether to allow the user to clear the sort. Defaults to `true`.\n */\n @Input()\n sortClear = true;\n\n /**\n * Whether the table should include a checkbox column for row selection.\n */\n @Input()\n selectable = false;\n\n /**\n * Sets the initially selected rows. Only works when selectable is `true`.\n */\n\n initialSelection = input<T[]>([]);\n\n /**\n * Set to true to disable row hover highlight.\n */\n @Input()\n suppressRowHoverHighlight = false;\n\n /**\n * Highlights the currently active row.\n */\n @Input()\n activeRow?: T;\n\n /**\n * Custom comparator function to determine if two rows are equal.\n *\n * @remarks\n * The default behavior for determining the active row is to compare\n * the two row objects using strict equality check. This is sufficient\n * as long as the instances remain the same, which may not be the case\n * if row data is recreated or rebuilt from serialization.\n */\n @Input()\n activeRowComparator?: (currentRow: T, activeRow: T) => boolean;\n\n /**\n * If set to `true`, the column headers will not be shown. Default is `false`.\n */\n @Input()\n hideColumnHeaders = false;\n\n /**\n * Emits whenever the selection updates. Only works when selectable is `true`.\n */\n @Output()\n selectionChange = new EventEmitter<T[]>();\n\n /**\n * Emits whenever a row is clicked.\n */\n @Output()\n rowClick = new EventEmitter<T>();\n\n /**\n * Event emitted when the user changes the active sort or sort direction.\n */\n @Output()\n sortChange = new EventEmitter<Sort>();\n\n /** @ignore */\n @ContentChildren(WattTableCellDirective)\n _cells!: QueryList<WattTableCellDirective<T>>;\n\n /** @ignore */\n @ContentChild(WattTableToolbarDirective)\n _toolbar?: WattTableToolbarDirective<T>;\n\n /** @ignore */\n @ViewChild(MatSort)\n _sort!: MatSort;\n\n /** @ignore */\n _selectionModel = new SelectionModel<T>(true, []);\n\n /** @ignore */\n _checkboxColumn = '__checkboxColumn__';\n\n /** @ignore */\n _element = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** @ignore */\n _datePipe = inject(WattDatePipe);\n\n /** @ignore */\n _hasFooter = signal(false);\n\n /** @ignore */\n private formatCellData(cell: unknown) {\n if (!cell) return '—';\n if (cell instanceof Date) return this._datePipe.transform(cell);\n return cell;\n }\n\n /** @ignore */\n private getCellData(row: T, column?: WattTableColumn<T>) {\n if (!column?.accessor) return null;\n const { accessor } = column;\n const cell = typeof accessor === 'function' ? accessor(row) : row[accessor];\n return this.formatCellData(cell);\n }\n\n /** @ignore */\n private checkHasFooter(): void {\n this._hasFooter.set(Object.values(this.columns).some((column) => !!column.footer));\n }\n\n constructor() {\n effect(() => {\n this._selectionModel.setSelection(...(this.initialSelection() ?? []));\n });\n this._selectionModel.changed\n .pipe(\n map(() => this._selectionModel.selected),\n takeUntilDestroyed()\n )\n .subscribe((selection) => this.selectionChange.emit(selection));\n }\n\n ngAfterViewInit() {\n if (this.dataSource === undefined) return;\n\n this.checkHasFooter();\n this.dataSource.sort = this._sort;\n if (this.dataSource instanceof WattTableDataSource === false) return;\n this.dataSource.sortingDataAccessor = (row: T, sortHeaderId: string) => {\n const sortColumn = this.columns[sortHeaderId];\n if (!sortColumn?.accessor) return '';\n\n // Access raw value for sorting, instead of applying default formatting.\n const { accessor } = sortColumn;\n const cell = typeof accessor === 'function' ? accessor(row) : row[accessor];\n\n // Make sorting by text case insensitive.\n if (typeof cell === 'string') return cell.toLowerCase();\n if (cell instanceof Date) return cell.getTime();\n return cell as number;\n };\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['columns'] || changes['displayedColumns'] || changes['selectable']) {\n const { displayedColumns } = this;\n\n if (this.columns === undefined) return;\n\n const sizing = Object.keys(this.columns)\n .filter((key) => !displayedColumns || displayedColumns.includes(key))\n .map((key) => this.columns[key].size)\n .map((size) => size ?? 'auto');\n\n if (this.selectable) {\n // Add space for extra checkbox column\n sizing.unshift('var(--watt-space-xl)');\n }\n\n this._element.nativeElement.style.setProperty(\n '--watt-table-grid-template-columns',\n sizing.join(' ')\n );\n\n this.checkHasFooter();\n }\n }\n\n /**\n * Clears the selection. Only works when selectable is `true`.\n */\n clearSelection() {\n if (this.selectable) {\n this._selectionModel.clear();\n }\n }\n\n /** @ignore */\n get _columnSelection() {\n if (this.dataSource.filteredData.length === 0) return false;\n return this.dataSource.filteredData.every((row) => this._selectionModel.isSelected(row));\n }\n\n /** @ignore */\n set _columnSelection(value) {\n if (value) {\n this._selectionModel.setSelection(...this.dataSource.filteredData);\n } else {\n this.clearSelection();\n }\n }\n\n get _filteredSelection() {\n return this._selectionModel.selected.filter((row) =>\n this.dataSource.filteredData.includes(row)\n );\n }\n\n /** @ignore */\n _getColumns() {\n if (this.columns === undefined) return [];\n const columns = this.displayedColumns ?? Object.keys(this.columns);\n return this.selectable ? [this._checkboxColumn, ...columns] : columns;\n }\n\n /** @ignore */\n _getColumnTemplate(column: WattTableColumn<T>) {\n return this._cells.find((item) => item.column === column)?.templateRef;\n }\n\n /** @ignore */\n _getColumnHeader(column: KeyValue<string, WattTableColumn<T>>) {\n if (typeof column.value.header === 'string') return column.value.header;\n const cell = this._cells.find((item) => item.column === column.value);\n return cell?.header ?? this.resolveHeader?.(column.key) ?? column.key;\n }\n\n /** @ignore */\n _getColumnHelperAction(column: KeyValue<string, WattTableColumn<T>>) {\n return column.value.helperAction;\n }\n\n /** @ignore */\n _getColumnCell(column: KeyValue<string, WattTableColumn<T>>, row: T) {\n return column.value.cell?.(row) ?? this.getCellData(row, column.value);\n }\n\n /** @ignore */\n _isActiveRow(row: T) {\n if (!this.activeRow) return false;\n return this.activeRowComparator\n ? this.activeRowComparator(row, this.activeRow)\n : row === this.activeRow;\n }\n\n /** @ignore */\n _onRowClick(row: T) {\n if (this.disabled || window.getSelection()?.toString() !== '') return;\n this.rowClick.emit(row);\n }\n}\n\n@Component({\n selector: 'watt-table-toolbar-spacer',\n template: '',\n styles: [\n `\n :host {\n width: var(--watt-space-xl);\n }\n `,\n ],\n})\nexport class WattTableToolbarSpacerComponent {}\n\nexport const WATT_TABLE = [\n WattTableComponent,\n WattTableCellDirective,\n WattTableToolbarDirective,\n WattTableToolbarSpacerComponent,\n];\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<table\n mat-table\n matSort\n role=\"treegrid\"\n [ngClass]=\"{ 'watt-table-has-selection': _filteredSelection.length > 0 }\"\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 [(ngModel)]=\"_columnSelection\" />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"_selectionModel.isSelected(row)\"\n (ngModelChange)=\"_selectionModel.toggle(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\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-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (_getColumnHelperAction(column); 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 </div>\n </th>\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n >\n @if (_getColumnTemplate(column.value); as template) {\n <div>\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row }\" />\n </div>\n } @else {\n {{ _getColumnCell(column, row) }}\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=\"_getColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: _getColumns()\"\n [attr.aria-selected]=\"row === activeRow\"\n (click)=\"_onRowClick(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 'watt-table-no-end-divider': hideColumnHeaders,\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=\"_getColumns(); 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 _getColumns(); 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) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"_toolbar.templateRef; context: { $implicit: _filteredSelection }\"\n />\n </div>\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 { IWattTableDataSource, WattTableDataSource } from './watt-table-data-source';\nexport {\n type WattTableColumn,\n type WattTableColumnDef,\n WattTableComponent,\n WattTableCellDirective,\n WattTableToolbarDirective,\n WattTableToolbarSpacerComponent,\n WATT_TABLE,\n} from './watt-table.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgCA;;AAEG;AACG,MAAO,mBACX,SAAQ,kBAAqB,CAAA;AAG7B,IAAA,WAAA,CACE,WAAiB,EACjB,MAAA,GAA6C,EAAE,qBAAqB,EAAE,KAAK,EAAE,EAAA;QAE7E,KAAK,CAAC,WAAW,CAAC;QAElB,IAAI,MAAM,CAAC,qBAAqB;AAC9B,YAAA,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAS,KAAS;AACjC,gBAAA,OAAO,IAAI;AACb,aAAC;;AAGL,IAAA,IAAI,UAAU,GAAA;AACZ,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM;;AAE1B;;ACtDD;AACA;;;;;;;;;;;;;;;AAeG;AACH;MA0Ia,sBAAsB,CAAA;;AAET,IAAA,M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;IAClB,sBAAsB;IACtB,yBAAyB;IACzB,+BAA+B;;;AE7gBjC;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-table.mjs","sources":["../../../libs/watt/package/table/watt-table-data-source.ts","../../../libs/watt/package/table/watt-table.component.ts","../../../libs/watt/package/table/watt-table.component.html","../../../libs/watt/package/table/index.ts","../../../libs/watt/package/table/energinet-watt-table.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 { DataSource } from '@angular/cdk/collections';\nimport { MatPaginator } from '@angular/material/paginator';\nimport { MatSort } from '@angular/material/sort';\nimport { MatTableDataSource } from '@angular/material/table';\n\nexport interface IWattTableDataSource<T> extends DataSource<T> {\n data: T[];\n filter: string;\n filteredData: T[];\n paginator: MatPaginator | null;\n sort: MatSort | null;\n totalCount: number;\n}\n\n/**\n * @see https://material.angular.io/components/table/api#MatTableDataSource\n */\nexport class WattTableDataSource<T>\n extends MatTableDataSource<T>\n implements IWattTableDataSource<T>\n{\n constructor(\n initialData?: T[],\n config: { disableClientSideSort: boolean } = { disableClientSideSort: false }\n ) {\n super(initialData);\n\n if (config.disableClientSideSort)\n this.sortData = (data: T[]): T[] => {\n return data;\n };\n }\n\n get totalCount() {\n return this.data.length;\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 { SelectionModel } from '@angular/cdk/collections';\nimport { KeyValue, KeyValuePipe, NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n AfterViewInit,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n effect,\n ElementRef,\n EventEmitter,\n inject,\n input,\n Input,\n OnChanges,\n Output,\n signal,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { QueryList, Signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormsModule } from '@angular/forms';\nimport { MatSort, MatSortModule, Sort, SortDirection } from '@angular/material/sort';\nimport { MatTableModule } from '@angular/material/table';\nimport { map } from 'rxjs';\n\nimport { WattCheckboxComponent } from '@energinet/watt/checkbox';\nimport { WattDatePipe } from '@energinet/watt/core/date';\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { IWattTableDataSource, WattTableDataSource } from './watt-table-data-source';\n\nexport interface WattTableColumn<T> {\n /**\n * The data that this column should be bound to, either as a property of `T`\n * or derived from each row of `T` using an accessor function. Use `null`\n * for columns that should not be associated with data, but note that this\n * will disable sorting and automatic cell population.\n */\n accessor: keyof T | ((row: T) => unknown) | null;\n\n /**\n * Resolve the header text to a static display value. This will prevent\n * the `resolveHeader` input function from being called for this column.\n */\n header?: string;\n\n /**\n * Callback for determining cell content when not using template. By default,\n * cell content is found using the `accessor` (unless it is `null`).\n */\n cell?: (row: T) => string;\n\n /**\n * Enable or disable sorting for this column. Defaults to `true`\n * unless `accessor` is `null`.\n */\n sort?: boolean;\n\n /**\n * Set the column size using grid sizing values. Defaults to `\"auto\"`.\n *\n * @remarks\n * Accepts all of the CSS grid track size keywords (such as `min-content`,\n * `max-content`, `minmax()`) as well as fractional (`fr`), percentage (`%`)\n * and length (`px`, `em`, etc) units.\n *\n * @see https://drafts.csswg.org/css-grid/#track-sizes\n */\n size?: string;\n\n /**\n * Horizontally align the contents of the column. Defaults to `\"left\"`.\n */\n align?: 'left' | 'right' | 'center';\n\n /**\n * Helper icon will be shown in the header cell, with an click event.\n */\n helperAction?: () => void;\n\n /**\n * CSS class to apply to the header cell element.\n */\n headerCellClass?: string;\n\n /**\n * CSS class to apply to the data cell element.\n */\n dataCellClass?: string;\n\n /**\n * Footer configuration for the column.\n */\n footer?: WattTableColumnFooter;\n\n /**\n * When set to `true`, the column remains visible when horizontally scrolling.\n */\n stickyEnd?: Signal<boolean>;\n\n tooltip?: string;\n}\n\n/**\n * Configuration for the footer cell of a column.\n */\nexport interface WattTableColumnFooter {\n /**\n * The value that will be displayed in the footer cell.\n */\n value?: Signal<string | number>;\n\n /**\n * CSS class to apply to the footer cell.\n */\n class?: string;\n}\n\n/**\n * Record for defining columns with keys used as column identifiers.\n */\nexport type WattTableColumnDef<T> = Record<string, WattTableColumn<T>>;\n\n// Used for strongly typing the structural directive\ninterface WattTableCellContext<T> {\n $implicit: T;\n}\n\ninterface WattTableToolbarContext<T> {\n $implicit: T;\n}\n\n@Directive({\n selector: '[wattTableCell]',\n})\nexport class WattTableCellDirective<T> {\n /** The WattTableColumn this template applies to. */\n @Input('wattTableCell') column!: WattTableColumn<T>;\n @Input('wattTableCellHeader') header?: string;\n templateRef = inject(TemplateRef<WattTableCellContext<T>>);\n static ngTemplateContextGuard<T>(\n _directive: WattTableCellDirective<T>,\n context: unknown\n ): context is WattTableCellContext<T> {\n return true;\n }\n}\n\n@Directive({\n selector: '[wattTableToolbar]',\n})\nexport class WattTableToolbarDirective<T> {\n templateRef = inject(TemplateRef<WattTableToolbarContext<T[]>>);\n static ngTemplateContextGuard<T>(\n _directive: WattTableToolbarDirective<T>,\n context: unknown\n ): context is WattTableToolbarContext<T[]> {\n return true;\n }\n}\n\n/**\n * Usage:\n * `import { WATT_TABLE } from '@energinet-datahub/watt/table';`\n */\n@Component({\n imports: [\n NgClass,\n NgTemplateOutlet,\n KeyValuePipe,\n FormsModule,\n MatSortModule,\n MatTableModule,\n WattIconComponent,\n WattCheckboxComponent,\n ],\n providers: [WattDatePipe],\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-table',\n styleUrls: ['./watt-table.component.scss'],\n templateUrl: './watt-table.component.html',\n})\nexport class WattTableComponent<T> implements OnChanges, AfterViewInit {\n /**\n * The table's source of data. Property should not be changed after\n * initialization, instead update the data on the instance itself.\n */\n @Input() dataSource!: IWattTableDataSource<T>;\n\n /**\n * Column definition record with keys representing the column identifiers\n * and values being the column configuration. The order of the columns\n * is determined by the property order, but can be overruled by the\n * `displayedColumns` input.\n */\n @Input() columns: WattTableColumnDef<T> = {};\n\n /**\n * Used for hiding or reordering columns defined in the `columns` input.\n */\n @Input() displayedColumns?: string[];\n\n /**\n * Used for disabling the table. This will disable all user interaction\n */\n @Input() disabled = false;\n\n /**\n * Provide a description of the table for visually impaired users.\n */\n @Input() description = '';\n\n /**\n * If set to `true`, the table will show a loading indicator\n * when there is no data.\n */\n @Input() loading = false;\n\n /**\n * If true the footer will be sticky\n */\n @Input() stickyFooter = false;\n\n /**\n * Optional callback for determining header text for columns that\n * do not have a static header text set in the column definition.\n * Useful for providing translations of column headers.\n */\n @Input()\n resolveHeader?: (key: string) => string;\n\n /**\n * Identifier for column that should be sorted initially.\n */\n @Input()\n sortBy = '';\n\n /**\n * The sort direction of the initially sorted column.\n */\n @Input()\n sortDirection: SortDirection = '';\n\n /**\n * Whether to allow the user to clear the sort. Defaults to `true`.\n */\n @Input()\n sortClear = true;\n\n /**\n * Whether the table should include a checkbox column for row selection.\n */\n @Input()\n selectable = false;\n\n /**\n * Sets the initially selected rows. Only works when selectable is `true`.\n */\n\n initialSelection = input<T[]>([]);\n\n /**\n * Set to true to disable row hover highlight.\n */\n @Input()\n suppressRowHoverHighlight = false;\n\n /**\n * Highlights the currently active row.\n */\n @Input()\n activeRow?: T;\n\n /**\n * Custom comparator function to determine if two rows are equal.\n *\n * @remarks\n * The default behavior for determining the active row is to compare\n * the two row objects using strict equality check. This is sufficient\n * as long as the instances remain the same, which may not be the case\n * if row data is recreated or rebuilt from serialization.\n */\n @Input()\n activeRowComparator?: (currentRow: T, activeRow: T) => boolean;\n\n /**\n * If set to `true`, the column headers will not be shown. Default is `false`.\n */\n @Input()\n hideColumnHeaders = false;\n\n /**\n * Emits whenever the selection updates. Only works when selectable is `true`.\n */\n @Output()\n selectionChange = new EventEmitter<T[]>();\n\n /**\n * Emits whenever a row is clicked.\n */\n @Output()\n rowClick = new EventEmitter<T>();\n\n /**\n * Event emitted when the user changes the active sort or sort direction.\n */\n @Output()\n sortChange = new EventEmitter<Sort>();\n\n /** @ignore */\n @ContentChildren(WattTableCellDirective)\n _cells!: QueryList<WattTableCellDirective<T>>;\n\n /** @ignore */\n @ContentChild(WattTableToolbarDirective)\n _toolbar?: WattTableToolbarDirective<T>;\n\n /** @ignore */\n @ViewChild(MatSort)\n _sort!: MatSort;\n\n /** @ignore */\n _selectionModel = new SelectionModel<T>(true, []);\n\n /** @ignore */\n _checkboxColumn = '__checkboxColumn__';\n\n /** @ignore */\n _element = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** @ignore */\n _datePipe = inject(WattDatePipe);\n\n /** @ignore */\n _hasFooter = signal(false);\n\n /** @ignore */\n private formatCellData(cell: unknown) {\n if (!cell) return '—';\n if (cell instanceof Date) return this._datePipe.transform(cell);\n return cell;\n }\n\n /** @ignore */\n private getCellData(row: T, column?: WattTableColumn<T>) {\n if (!column?.accessor) return null;\n const { accessor } = column;\n const cell = typeof accessor === 'function' ? accessor(row) : row[accessor];\n return this.formatCellData(cell);\n }\n\n /** @ignore */\n private checkHasFooter(): void {\n this._hasFooter.set(Object.values(this.columns).some((column) => !!column.footer));\n }\n\n constructor() {\n effect(() => {\n this._selectionModel.setSelection(...(this.initialSelection() ?? []));\n });\n this._selectionModel.changed\n .pipe(\n map(() => this._selectionModel.selected),\n takeUntilDestroyed()\n )\n .subscribe((selection) => this.selectionChange.emit(selection));\n }\n\n ngAfterViewInit() {\n if (this.dataSource === undefined) return;\n\n this.checkHasFooter();\n this.dataSource.sort = this._sort;\n if (this.dataSource instanceof WattTableDataSource === false) return;\n this.dataSource.sortingDataAccessor = (row: T, sortHeaderId: string) => {\n const sortColumn = this.columns[sortHeaderId];\n if (!sortColumn?.accessor) return '';\n\n // Access raw value for sorting, instead of applying default formatting.\n const { accessor } = sortColumn;\n const cell = typeof accessor === 'function' ? accessor(row) : row[accessor];\n\n // Make sorting by text case insensitive.\n if (typeof cell === 'string') return cell.toLowerCase();\n if (cell instanceof Date) return cell.getTime();\n return cell as number;\n };\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['columns'] || changes['displayedColumns'] || changes['selectable']) {\n const { displayedColumns } = this;\n\n if (this.columns === undefined) return;\n\n const sizing = Object.keys(this.columns)\n .filter((key) => !displayedColumns || displayedColumns.includes(key))\n .map((key) => this.columns[key].size)\n .map((size) => size ?? 'auto');\n\n if (this.selectable) {\n // Add space for extra checkbox column\n sizing.unshift('var(--watt-space-xl)');\n }\n\n this._element.nativeElement.style.setProperty(\n '--watt-table-grid-template-columns',\n sizing.join(' ')\n );\n\n this.checkHasFooter();\n }\n }\n\n /**\n * Clears the selection. Only works when selectable is `true`.\n */\n clearSelection() {\n if (this.selectable) {\n this._selectionModel.clear();\n }\n }\n\n /** @ignore */\n get _columnSelection() {\n if (this.dataSource.filteredData.length === 0) return false;\n return this.dataSource.filteredData.every((row) => this._selectionModel.isSelected(row));\n }\n\n /** @ignore */\n set _columnSelection(value) {\n if (value) {\n this._selectionModel.setSelection(...this.dataSource.filteredData);\n } else {\n this.clearSelection();\n }\n }\n\n get _filteredSelection() {\n return this._selectionModel.selected.filter((row) =>\n this.dataSource.filteredData.includes(row)\n );\n }\n\n /** @ignore */\n _getColumns() {\n if (this.columns === undefined) return [];\n const columns = this.displayedColumns ?? Object.keys(this.columns);\n return this.selectable ? [this._checkboxColumn, ...columns] : columns;\n }\n\n /** @ignore */\n _getColumnTemplate(column: WattTableColumn<T>) {\n return this._cells.find((item) => item.column === column)?.templateRef;\n }\n\n /** @ignore */\n _getColumnHeader(column: KeyValue<string, WattTableColumn<T>>) {\n if (typeof column.value.header === 'string') return column.value.header;\n const cell = this._cells.find((item) => item.column === column.value);\n return cell?.header ?? this.resolveHeader?.(column.key) ?? column.key;\n }\n\n /** @ignore */\n _getColumnHelperAction(column: KeyValue<string, WattTableColumn<T>>) {\n return column.value.helperAction;\n }\n\n /** @ignore */\n _getColumnHeaderTooltip(column: KeyValue<string, WattTableColumn<T>>) {\n return column.value.tooltip;\n }\n\n /** @ignore */\n _getColumnCell(column: KeyValue<string, WattTableColumn<T>>, row: T) {\n return column.value.cell?.(row) ?? this.getCellData(row, column.value);\n }\n\n /** @ignore */\n _isActiveRow(row: T) {\n if (!this.activeRow) return false;\n return this.activeRowComparator\n ? this.activeRowComparator(row, this.activeRow)\n : row === this.activeRow;\n }\n\n /** @ignore */\n _onRowClick(row: T) {\n if (this.disabled || window.getSelection()?.toString() !== '') return;\n this.rowClick.emit(row);\n }\n}\n\n@Component({\n selector: 'watt-table-toolbar-spacer',\n template: '',\n styles: [\n `\n :host {\n width: var(--watt-space-xl);\n }\n `,\n ],\n})\nexport class WattTableToolbarSpacerComponent {}\n\nexport const WATT_TABLE = [\n WattTableComponent,\n WattTableCellDirective,\n WattTableToolbarDirective,\n WattTableToolbarSpacerComponent,\n];\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<table\n mat-table\n matSort\n role=\"treegrid\"\n [ngClass]=\"{ 'watt-table-has-selection': _filteredSelection.length > 0 }\"\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 [(ngModel)]=\"_columnSelection\" />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"_selectionModel.isSelected(row)\"\n (ngModelChange)=\"_selectionModel.toggle(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\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-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (_getColumnHelperAction(column); 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 </div>\n @if (_getColumnHeaderTooltip(column); as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" />\n }\n </th>\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n >\n @if (_getColumnTemplate(column.value); as template) {\n <div>\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row }\" />\n </div>\n } @else {\n {{ _getColumnCell(column, row) }}\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=\"_getColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: _getColumns()\"\n [attr.aria-selected]=\"row === activeRow\"\n (click)=\"_onRowClick(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 'watt-table-no-end-divider': hideColumnHeaders,\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=\"_getColumns(); 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 _getColumns(); 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) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"_toolbar.templateRef; context: { $implicit: _filteredSelection }\"\n />\n </div>\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 { IWattTableDataSource, WattTableDataSource } from './watt-table-data-source';\nexport {\n type WattTableColumn,\n type WattTableColumnDef,\n WattTableComponent,\n WattTableCellDirective,\n WattTableToolbarDirective,\n WattTableToolbarSpacerComponent,\n WATT_TABLE,\n} from './watt-table.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgCA;;AAEG;AACG,MAAO,mBACX,SAAQ,kBAAqB,CAAA;AAG7B,IAAA,WAAA,CACE,WAAiB,EACjB,MAAA,GAA6C,EAAE,qBAAqB,EAAE,KAAK,EAAE,EAAA;QAE7E,KAAK,CAAC,WAAW,CAAC;QAElB,IAAI,MAAM,CAAC,qBAAqB;AAC9B,YAAA,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAS,KAAS;AACjC,gBAAA,OAAO,IAAI;AACb,aAAC;;AAGL,IAAA,IAAI,UAAU,GAAA;AACZ,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM;;AAE1B;;ACtDD;AACA;;;;;;;;;;;;;;;AAeG;AACH;MA2Ia,sBAAsB,CAAA;;AAET,IAAA,MAAM;AACA,IAAA,MAAM;AACpC,IAAA,WAAW,GAAG,MAAM,EAAC,WAAoC,EAAC;AAC1D,IAAA,OAAO,sBAAsB,CAC3B,UAAqC,EACrC,OAAgB,EAAA;AAEhB,QAAA,OAAO,IAAI;;uGATF,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,Q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/package/tooltip/watt-tooltip.directive.ts","../../../libs/watt/package/tooltip/index.ts","../../../libs/watt/package/tooltip/energinet-watt-tooltip.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n HostBinding,\n inject,\n Input,\n OnDestroy,\n Renderer2,\n ViewChild,\n} from '@angular/core';\nimport { createPopper, Instance } from '@popperjs/core';\nimport { Platform } from '@angular/cdk/platform';\n\nimport { wattTooltipPosition, wattTooltipVariant } from './watt-tooltip.directive';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { Subject, takeUntil } from 'rxjs';\n\ntype unlistenerFunction = () => void;\n\n@Component({\n template: `\n {{ text }}\n <div class=\"arrow\"></div>\n `,\n selector: 'watt-tooltip',\n styleUrls: ['./watt-tooltip.component.scss'],\n})\nexport class WattTooltipComponent implements AfterViewInit, OnDestroy {\n static nextId = 0;\n\n @Input() text!: string;\n @Input() target!: HTMLElement;\n @Input() position!: wattTooltipPosition;\n @Input() variant!: wattTooltipVariant;\n\n @ViewChild('arrow') arrow!: ElementRef<HTMLElement>;\n\n @HostBinding() id = `watt-tooltip-${WattTooltipComponent.nextId++}`; // used by aria-describedby\n @HostBinding('attr.role') role = 'tooltip';\n @HostBinding('class') get hostClass() {\n return `tooltip-${this.variant}`;\n }\n\n private element: HTMLElement = inject(ElementRef).nativeElement;\n private platform = inject(Platform);\n private renderer: Renderer2 = inject(Renderer2);\n private focusMonitor: FocusMonitor = inject(FocusMonitor);\n\n /** Emits when the component is destroyed. */\n private readonly destroyed = new Subject<void>();\n private listeners: unlistenerFunction[] = [];\n private showClass = 'show';\n\n private popper: Instance | null = null;\n\n ngAfterViewInit(): void {\n this.setupEventListeners();\n\n this.focusMonitor\n .monitor(this.target, true)\n .pipe(takeUntil(this.destroyed))\n .subscribe((origin) => {\n if (!origin) {\n this.hide();\n } else if (origin === 'keyboard') {\n this.show();\n }\n });\n }\n\n ngOnDestroy(): void {\n this.popper?.destroy();\n this.listeners.forEach((listener) => listener());\n this.destroyed.next();\n this.destroyed.complete();\n }\n\n private setupEventListeners(): void {\n // The mouse events shouldn't be bound on mobile devices, because they can prevent the\n // first tap from firing its click event or can cause the tooltip to open for clicks.\n if (this.platformSupportsMouseEvents()) {\n const mouseEnter = this.renderer.listen(this.target, 'mouseenter', this.show.bind(this));\n const mouseLeave = this.renderer.listen(this.target, 'mouseleave', this.hide.bind(this));\n const wheel = this.renderer.listen(this.target, 'wheel', this.hide.bind(this));\n this.listeners.push(mouseEnter, mouseLeave, wheel);\n } else {\n const touchStart = this.renderer.listen(this.target, 'touchstart', this.show.bind(this));\n const touchEnd = this.renderer.listen(this.target, 'touchend', this.hide.bind(this));\n const touchCancel = this.renderer.listen(this.target, 'touchcancel', this.hide.bind(this));\n this.listeners.push(touchStart, touchEnd, touchCancel);\n }\n }\n\n private show(): void {\n if (!this.popper) {\n this.popper = createPopper(this.target, this.element, {\n placement: this.position,\n });\n } else {\n this.popper.forceUpdate();\n }\n this.renderer.addClass(this.element, this.showClass);\n }\n\n private hide(): void {\n this.renderer.removeClass(this.element, this.showClass);\n }\n\n private platformSupportsMouseEvents() {\n return !this.platform.IOS && !this.platform.ANDROID;\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 Directive,\n ElementRef,\n inject,\n Input,\n OnChanges,\n SimpleChanges,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { WattTooltipComponent } from './watt-tooltip.component';\n\nexport type wattTooltipPosition =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right'\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end'\n | 'left';\n\nexport type wattTooltipVariant = 'dark' | 'light';\n\n@Directive({\n selector: '[wattTooltip]',\n exportAs: 'wattTooltip',\n})\nexport class WattTooltipDirective implements OnChanges {\n @Input('wattTooltip') text!: string;\n @Input('wattTooltipPosition') position: wattTooltipPosition = 'top';\n @Input('wattTooltipVariant') variant: wattTooltipVariant = 'dark';\n\n private element: HTMLElement = inject(ElementRef).nativeElement;\n private viewContainerRef = inject(ViewContainerRef);\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['text']) {\n this.createTooltipComponent();\n }\n }\n\n private createTooltipComponent() {\n const tooltip =\n this.viewContainerRef.createComponent<WattTooltipComponent>(WattTooltipComponent);\n tooltip.instance.text = this.text;\n tooltip.instance.target = this.element;\n tooltip.instance.position = this.position;\n tooltip.instance.variant = this.variant;\n\n this.element.setAttribute('aria-describedby', tooltip.instance.id);\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 { WattTooltipDirective, wattTooltipPosition } from './watt-tooltip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"version":3,"file":"energinet-watt-tooltip.mjs","sources":["../../../libs/watt/package/tooltip/watt-tooltip.component.ts","../../../libs/watt/package/tooltip/watt-tooltip.directive.ts","../../../libs/watt/package/tooltip/index.ts","../../../libs/watt/package/tooltip/energinet-watt-tooltip.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n HostBinding,\n inject,\n Input,\n OnDestroy,\n Renderer2,\n ViewChild,\n} from '@angular/core';\nimport { createPopper, Instance } from '@popperjs/core';\nimport { Platform } from '@angular/cdk/platform';\n\nimport { wattTooltipPosition, wattTooltipVariant } from './watt-tooltip.directive';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { Subject, takeUntil } from 'rxjs';\n\ntype unlistenerFunction = () => void;\n\n@Component({\n template: `\n {{ text }}\n <div class=\"arrow\"></div>\n `,\n selector: 'watt-tooltip',\n styleUrls: ['./watt-tooltip.component.scss'],\n})\nexport class WattTooltipComponent implements AfterViewInit, OnDestroy {\n static nextId = 0;\n\n @Input() text!: string;\n @Input() target!: HTMLElement;\n @Input() position!: wattTooltipPosition;\n @Input() variant!: wattTooltipVariant;\n\n @ViewChild('arrow') arrow!: ElementRef<HTMLElement>;\n\n @HostBinding() id = `watt-tooltip-${WattTooltipComponent.nextId++}`; // used by aria-describedby\n @HostBinding('attr.role') role = 'tooltip';\n @HostBinding('class') get hostClass() {\n return `tooltip-${this.variant}`;\n }\n\n private element: HTMLElement = inject(ElementRef).nativeElement;\n private platform = inject(Platform);\n private renderer: Renderer2 = inject(Renderer2);\n private focusMonitor: FocusMonitor = inject(FocusMonitor);\n\n /** Emits when the component is destroyed. */\n private readonly destroyed = new Subject<void>();\n private listeners: unlistenerFunction[] = [];\n private showClass = 'show';\n\n private popper: Instance | null = null;\n\n ngAfterViewInit(): void {\n this.setupEventListeners();\n\n this.focusMonitor\n .monitor(this.target, true)\n .pipe(takeUntil(this.destroyed))\n .subscribe((origin) => {\n if (!origin) {\n this.hide();\n } else if (origin === 'keyboard') {\n this.show();\n }\n });\n }\n\n ngOnDestroy(): void {\n this.popper?.destroy();\n this.listeners.forEach((listener) => listener());\n this.destroyed.next();\n this.destroyed.complete();\n }\n\n private setupEventListeners(): void {\n // The mouse events shouldn't be bound on mobile devices, because they can prevent the\n // first tap from firing its click event or can cause the tooltip to open for clicks.\n if (this.platformSupportsMouseEvents()) {\n const mouseEnter = this.renderer.listen(this.target, 'mouseenter', this.show.bind(this));\n const mouseLeave = this.renderer.listen(this.target, 'mouseleave', this.hide.bind(this));\n const wheel = this.renderer.listen(this.target, 'wheel', this.hide.bind(this));\n this.listeners.push(mouseEnter, mouseLeave, wheel);\n } else {\n const touchStart = this.renderer.listen(this.target, 'touchstart', this.show.bind(this));\n const touchEnd = this.renderer.listen(this.target, 'touchend', this.hide.bind(this));\n const touchCancel = this.renderer.listen(this.target, 'touchcancel', this.hide.bind(this));\n this.listeners.push(touchStart, touchEnd, touchCancel);\n }\n }\n\n private show(): void {\n if (!this.popper) {\n this.popper = createPopper(this.target, this.element, {\n placement: this.position,\n });\n } else {\n this.popper.forceUpdate();\n }\n this.renderer.addClass(this.element, this.showClass);\n }\n\n private hide(): void {\n this.renderer.removeClass(this.element, this.showClass);\n }\n\n private platformSupportsMouseEvents() {\n return !this.platform.IOS && !this.platform.ANDROID;\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 Directive,\n ElementRef,\n inject,\n Input,\n OnChanges,\n SimpleChanges,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { WattTooltipComponent } from './watt-tooltip.component';\n\nexport type wattTooltipPosition =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right'\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end'\n | 'left';\n\nexport type wattTooltipVariant = 'dark' | 'light';\n\n@Directive({\n selector: '[wattTooltip]',\n exportAs: 'wattTooltip',\n})\nexport class WattTooltipDirective implements OnChanges {\n @Input('wattTooltip') text!: string;\n @Input('wattTooltipPosition') position: wattTooltipPosition = 'top';\n @Input('wattTooltipVariant') variant: wattTooltipVariant = 'dark';\n\n private element: HTMLElement = inject(ElementRef).nativeElement;\n private viewContainerRef = inject(ViewContainerRef);\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['text']) {\n this.createTooltipComponent();\n }\n }\n\n private createTooltipComponent() {\n const tooltip =\n this.viewContainerRef.createComponent<WattTooltipComponent>(WattTooltipComponent);\n tooltip.instance.text = this.text;\n tooltip.instance.target = this.element;\n tooltip.instance.position = this.position;\n tooltip.instance.variant = this.variant;\n\n this.element.setAttribute('aria-describedby', tooltip.instance.id);\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 {\n WattTooltipDirective,\n wattTooltipPosition,\n wattTooltipVariant,\n} from './watt-tooltip.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MA6Ba,oBAAoB,CAAA;AAC/B,IAAA,OAAO,MAAM,GAAG,CAAC;AAER,IAAA,IAAI;AACJ,IAAA,MAAM;AACN,IAAA,QAAQ;AACR,IAAA,OAAO;AAEI,IAAA,KAAK;IAEV,EAAE,GAAG,gBAAgB,oBAAoB,CAAC,MAAM,EAAE,CAAA,CAAE,CAAC;IAC1C,IAAI,GAAG,SAAS;AAC1C,IAAA,IAA0B,SAAS,GAAA;AACjC,QAAA,OAAO,CAAW,QAAA,EAAA,IAAI,CAAC,OAAO,EAAE;;AAG1B,IAAA,OAAO,GAAgB,MAAM,CAAC,UAAU,CAAC,CAAC,aAAa;AACvD,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,QAAQ,GAAc,MAAM,CAAC,SAAS,CAAC;AACvC,IAAA,YAAY,GAAiB,MAAM,CAAC,YAAY,CAAC;;AAGxC,IAAA,SAAS,GAAG,IAAI,OAAO,EAAQ;IACxC,SAAS,GAAyB,EAAE;IACpC,SAAS,GAAG,MAAM;IAElB,MAAM,GAAoB,IAAI;IAEtC,eAAe,GAAA;QACb,IAAI,CAAC,mBAAmB,EAAE;AAE1B,QAAA,IAAI,CAAC;AACF,aAAA,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI;AACzB,aAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;AAC9B,aAAA,SAAS,CAAC,CAAC,MAAM,KAAI;YACpB,IAAI,CAAC,MAAM,EAAE;gBACX,IAAI,CAAC,IAAI,EAAE;;AACN,iBAAA,IAAI,MAAM,KAAK,UAAU,EAAE;gBAChC,IAA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sBAAnC,KAAK;uBAAC,oBAAoB;;;ACjD7B;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@energinet/watt",
4
- "version": "1.5.18",
4
+ "version": "1.6.0",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  ".": {
@@ -80,6 +80,7 @@ export interface WattTableColumn<T> {
80
80
  * When set to `true`, the column remains visible when horizontally scrolling.
81
81
  */
82
82
  stickyEnd?: Signal<boolean>;
83
+ tooltip?: string;
83
84
  }
84
85
  /**
85
86
  * Configuration for the footer cell of a column.
@@ -260,6 +261,8 @@ export declare class WattTableComponent<T> implements OnChanges, AfterViewInit {
260
261
  /** @ignore */
261
262
  _getColumnHelperAction(column: KeyValue<string, WattTableColumn<T>>): (() => void) | undefined;
262
263
  /** @ignore */
264
+ _getColumnHeaderTooltip(column: KeyValue<string, WattTableColumn<T>>): string | undefined;
265
+ /** @ignore */
263
266
  _getColumnCell(column: KeyValue<string, WattTableColumn<T>>, row: T): {} | null;
264
267
  /** @ignore */
265
268
  _isActiveRow(row: T): boolean;
@@ -14,4 +14,4 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- export { WattTooltipDirective, wattTooltipPosition } from './watt-tooltip.directive';
17
+ export { WattTooltipDirective, wattTooltipPosition, wattTooltipVariant, } from './watt-tooltip.directive';