@energinet/watt 4.2.14 → 4.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ export type WattButtonVariant = (typeof WattButtonTypes)[number];
4
4
  export type WattButtonType = 'button' | 'reset' | 'submit';
5
5
  export type WattButtonSize = 'small' | 'medium';
6
6
  export declare class WattButtonComponent {
7
- icon: import("@angular/core").InputSignal<"search" | "filter" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "email" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | undefined>;
7
+ icon: import("@angular/core").InputSignal<"search" | "filter" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "email" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "send" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "attachFile" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | undefined>;
8
8
  variant: import("@angular/core").InputSignal<"primary" | "secondary" | "text" | "icon" | "selection">;
9
9
  size: import("@angular/core").InputSignal<WattButtonSize>;
10
10
  type: import("@angular/core").InputSignal<WattButtonType>;
@@ -1,7 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
2
  export declare class WattActionChipComponent {
3
3
  disabled: import("@angular/core").InputSignal<boolean>;
4
- icon: import("@angular/core").InputSignal<"search" | "filter" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "email" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on">;
4
+ icon: import("@angular/core").InputSignal<"search" | "filter" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "email" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "send" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "attachFile" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on">;
5
5
  action: import("@angular/core").OutputEmitterRef<void>;
6
6
  static ɵfac: i0.ɵɵFactoryDeclaration<WattActionChipComponent, never>;
7
7
  static ɵcmp: i0.ɵɵComponentDeclaration<WattActionChipComponent, "watt-action-chip", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": true; "isSignal": true; }; }, { "action": "action"; }, never, ["*"], true, never>;
@@ -21,7 +21,7 @@ export declare class WattDataTableComponent {
21
21
  count: import("@angular/core").InputSignal<number | undefined>;
22
22
  autoSize: import("@angular/core").InputSignal<boolean>;
23
23
  variant: import("@angular/core").InputSignal<WATT_CARD_VARIANT>;
24
- emptyStateIcon: import("@angular/core").InputSignal<"search" | "filter" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "email" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | "custom-power" | "custom-explore" | "custom-no-results">;
24
+ emptyStateIcon: import("@angular/core").InputSignal<"search" | "filter" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "email" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "send" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "attachFile" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | "custom-power" | "custom-explore" | "custom-no-results">;
25
25
  clear: import("@angular/core").OutputEmitterRef<void>;
26
26
  pageChanged: import("@angular/core").OutputEmitterRef<PageEvent>;
27
27
  retry: import("@angular/core").OutputEmitterRef<void>;
@@ -14,15 +14,15 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- export interface WattDropdownOption {
18
- value: string;
17
+ export interface WattDropdownOption<T = string> {
18
+ value: T;
19
19
  displayValue: string;
20
20
  disabled?: boolean;
21
21
  }
22
- export interface WattDropdownOptionGroup {
22
+ export interface WattDropdownOptionGroup<T = string> {
23
23
  label: string;
24
- options: WattDropdownOption[];
24
+ options: WattDropdownOption<T>[];
25
25
  disabled?: boolean;
26
26
  }
27
- export type WattDropdownOptions = WattDropdownOption[];
28
- export type WattDropdownGroupedOptions = WattDropdownOptionGroup[];
27
+ export type WattDropdownOptions<T = string> = WattDropdownOption<T>[];
28
+ export type WattDropdownGroupedOptions<T = string> = WattDropdownOptionGroup<T>[];
@@ -21,7 +21,7 @@ import { MatSelect } from '@angular/material/select';
21
21
  import type { WattDropdownValue } from './watt-dropdown-value';
22
22
  import type { WattDropdownOptions, WattDropdownGroupedOptions } from './watt-dropdown-option';
23
23
  import * as i0 from "@angular/core";
24
- export declare class WattDropdownComponent implements ControlValueAccessor, OnInit {
24
+ export declare class WattDropdownComponent<T = string> implements ControlValueAccessor, OnInit {
25
25
  private parentControlDirective;
26
26
  private destroyRef;
27
27
  private validateParent?;
@@ -63,7 +63,7 @@ export declare class WattDropdownComponent implements ControlValueAccessor, OnIn
63
63
  * Sets the options for the dropdown.
64
64
  * Can be a flat array of options or an array containing both options and option groups.
65
65
  */
66
- options: import("@angular/core").ModelSignal<WattDropdownOptions | WattDropdownGroupedOptions>;
66
+ options: import("@angular/core").ModelSignal<WattDropdownOptions<T> | WattDropdownGroupedOptions<T>>;
67
67
  /**
68
68
  * Sets support for selecting multiple dropdown options.
69
69
  */
@@ -128,6 +128,6 @@ export declare class WattDropdownComponent implements ControlValueAccessor, OnIn
128
128
  private filterOptions;
129
129
  private filterGroups;
130
130
  private determineToggleAllCheckboxState;
131
- static ɵfac: i0.ɵɵFactoryDeclaration<WattDropdownComponent, never>;
132
- static ɵcmp: i0.ɵɵComponentDeclaration<WattDropdownComponent, "watt-dropdown", never, { "hideSearch": { "alias": "hideSearch"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; "getCustomTrigger": { "alias": "getCustomTrigger"; "required": false; "isSignal": true; }; "chipMode": { "alias": "chipMode"; "required": false; "isSignal": true; }; "disableSelectedMode": { "alias": "disableSelectedMode"; "required": false; "isSignal": true; }; "sortDirection": { "alias": "sortDirection"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "showResetOption": { "alias": "showResetOption"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "noOptionsFoundLabel": { "alias": "noOptionsFoundLabel"; "required": false; "isSignal": true; }; }, { "options": "optionsChange"; }, never, ["*", "watt-field-hint", "watt-field-error"], true, never>;
131
+ static ɵfac: i0.ɵɵFactoryDeclaration<WattDropdownComponent<any>, never>;
132
+ static ɵcmp: i0.ɵɵComponentDeclaration<WattDropdownComponent<any>, "watt-dropdown", never, { "hideSearch": { "alias": "hideSearch"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; "getCustomTrigger": { "alias": "getCustomTrigger"; "required": false; "isSignal": true; }; "chipMode": { "alias": "chipMode"; "required": false; "isSignal": true; }; "disableSelectedMode": { "alias": "disableSelectedMode"; "required": false; "isSignal": true; }; "sortDirection": { "alias": "sortDirection"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "showResetOption": { "alias": "showResetOption"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "noOptionsFoundLabel": { "alias": "noOptionsFoundLabel"; "required": false; "isSignal": true; }; }, { "options": "optionsChange"; }, never, ["*", "watt-field-hint", "watt-field-error"], true, never>;
133
133
  }
@@ -5,7 +5,7 @@ import * as i0 from "@angular/core";
5
5
  * `import { WattEmptyStateComponent } from '@energinet/watt/empty-state';`
6
6
  */
7
7
  export declare class WattEmptyStateComponent {
8
- icon: import("@angular/core").InputSignal<"search" | "filter" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "email" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | "custom-power" | "custom-explore" | "custom-no-results" | undefined>;
8
+ icon: import("@angular/core").InputSignal<"search" | "filter" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "email" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "send" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "attachFile" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | "custom-power" | "custom-explore" | "custom-no-results" | undefined>;
9
9
  size: import("@angular/core").InputSignal<"small" | "large">;
10
10
  title: import("@angular/core").InputSignal<string>;
11
11
  message: import("@angular/core").InputSignal<string>;
@@ -123,7 +123,7 @@ export class WattDataTableComponent {
123
123
  }
124
124
  </vater-flex>
125
125
  </watt-card>
126
- `, isInline: true, styles: ["watt-data-table h3,watt-data-table h4{line-height:44px;min-height:44px;margin:0}watt-data-table watt-paginator{display:block;margin:calc(-1 * var(--watt-space-m)) -24px -24px}watt-data-table watt-table .mat-mdc-table tr.mdc-data-table__row:last-child .mat-mdc-cell{border-bottom:none}watt-data-table watt-empty-state{margin:var(--watt-space-xl) 0}\n"], dependencies: [{ kind: "component", type: VaterFlexComponent, selector: "vater-flex, [vater-flex]", inputs: ["autoSize"] }, { kind: "component", type: VaterSpacerComponent, selector: "vater-spacer, [vater-spacer]" }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]" }, { kind: "directive", type: VaterUtilityDirective, selector: "[vater]", inputs: ["center", "fill", "inset", "scrollable"] }, { kind: "component", type: WattCardComponent, selector: "watt-card", inputs: ["variant", "loading"] }, { kind: "component", type: WattEmptyStateComponent, selector: "watt-empty-state", inputs: ["icon", "size", "title", "message", "useHTML"] }, { kind: "component", type: WattPaginatorComponent, selector: "watt-paginator", inputs: ["length", "pageSizeOptions", "pageSize", "pageIndex", "for"], outputs: ["changed"] }, { kind: "component", type: WattSearchComponent, selector: "watt-search", inputs: ["label", "debounceTime", "trim", "size"], outputs: ["search"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }], encapsulation: i0.ViewEncapsulation.None });
126
+ `, isInline: true, styles: ["watt-data-table h3,watt-data-table h4{line-height:44px;min-height:44px;margin:0}watt-data-table watt-paginator{display:block;margin:calc(-1 * var(--watt-space-m))}watt-data-table watt-empty-state{margin:var(--watt-space-xl) 0}\n"], dependencies: [{ kind: "component", type: VaterFlexComponent, selector: "vater-flex, [vater-flex]", inputs: ["autoSize"] }, { kind: "component", type: VaterSpacerComponent, selector: "vater-spacer, [vater-spacer]" }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]" }, { kind: "directive", type: VaterUtilityDirective, selector: "[vater]", inputs: ["center", "fill", "inset", "scrollable"] }, { kind: "component", type: WattCardComponent, selector: "watt-card", inputs: ["variant", "loading"] }, { kind: "component", type: WattEmptyStateComponent, selector: "watt-empty-state", inputs: ["icon", "size", "title", "message", "useHTML"] }, { kind: "component", type: WattPaginatorComponent, selector: "watt-paginator", inputs: ["length", "pageSizeOptions", "pageSize", "pageIndex", "for"], outputs: ["changed"] }, { kind: "component", type: WattSearchComponent, selector: "watt-search", inputs: ["label", "debounceTime", "trim", "size"], outputs: ["search"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }], encapsulation: i0.ViewEncapsulation.None });
127
127
  }
128
128
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattDataTableComponent, decorators: [{
129
129
  type: Component,
@@ -204,6 +204,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
204
204
  }
205
205
  </vater-flex>
206
206
  </watt-card>
207
- `, styles: ["watt-data-table h3,watt-data-table h4{line-height:44px;min-height:44px;margin:0}watt-data-table watt-paginator{display:block;margin:calc(-1 * var(--watt-space-m)) -24px -24px}watt-data-table watt-table .mat-mdc-table tr.mdc-data-table__row:last-child .mat-mdc-cell{border-bottom:none}watt-data-table watt-empty-state{margin:var(--watt-space-xl) 0}\n"] }]
207
+ `, styles: ["watt-data-table h3,watt-data-table h4{line-height:44px;min-height:44px;margin:0}watt-data-table watt-paginator{display:block;margin:calc(-1 * var(--watt-space-m))}watt-data-table watt-empty-state{margin:var(--watt-space-xl) 0}\n"] }]
208
208
  }], propDecorators: { error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], ready: [{ type: i0.Input, args: [{ isSignal: true, alias: "ready", required: false }] }], enableSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSearch", required: false }] }], trimSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "trimSearch", required: false }] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], enableRetry: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableRetry", required: false }] }], enableCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCount", required: false }] }], enableEmptyState: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableEmptyState", required: false }] }], queryTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryTime", required: false }] }], searchLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLabel", required: false }] }], enablePaginator: [{ type: i0.Input, args: [{ isSignal: true, alias: "enablePaginator", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], autoSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoSize", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], emptyStateIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateIcon", required: false }] }], clear: [{ type: i0.Output, args: ["clear"] }], pageChanged: [{ type: i0.Output, args: ["pageChanged"] }], retry: [{ type: i0.Output, args: ["retry"] }], table: [{ type: i0.ContentChild, args: [i0.forwardRef(() => WattTableComponent), { ...{ descendants: true }, isSignal: true }] }], search: [{ type: i0.ViewChild, args: [i0.forwardRef(() => WattSearchComponent), { isSignal: true }] }] } });
209
209
  //# sourceMappingURL=watt-data-table.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"watt-data-table.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/data/watt-data-table.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;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wBACvB,sBAAsB;wBACtB,mBAAmB;wBACnB,mBAAmB;qBACpB,iBACc,iBAAiB,CAAC,IAAI,YAwB3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmET;qyDA4B6B,kBAA2B,QAAE,EAAE,WAAW,EAAE,IAAI,EAAE,kFAE7D,mBAAmB","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 Component,\n ViewEncapsulation,\n contentChild,\n inject,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { PageEvent } from '@angular/material/paginator';\n\nimport {\n VaterFlexComponent,\n VaterSpacerComponent,\n VaterStackComponent,\n VaterUtilityDirective,\n} from '@energinet/watt/vater';\nimport { WATT_CARD_VARIANT, WattCardComponent } from '@energinet/watt/card';\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattEmptyStateComponent } from '@energinet/watt/empty-state';\nimport { WattPaginatorComponent } from '@energinet/watt/paginator';\nimport { WattSearchComponent } from '@energinet/watt/search';\nimport { WattTableComponent } from '@energinet/watt/table';\nimport { WattIcon } from '@energinet/watt/icon';\n\nimport { WattDataIntlService } from './watt-data-intl.service';\n\n@Component({\n selector: 'watt-data-table',\n imports: [\n VaterFlexComponent,\n VaterSpacerComponent,\n VaterStackComponent,\n VaterUtilityDirective,\n WattCardComponent,\n WattEmptyStateComponent,\n WattPaginatorComponent,\n WattSearchComponent,\n WattButtonComponent,\n ],\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-data-table h3,\n watt-data-table h4 {\n line-height: 44px;\n min-height: 44px;\n margin: 0;\n }\n\n watt-data-table watt-paginator {\n display: block;\n margin: calc(-1 * var(--watt-space-m)) -24px -24px;\n }\n\n watt-data-table watt-table .mat-mdc-table tr.mdc-data-table__row:last-child .mat-mdc-cell {\n border-bottom: none;\n }\n\n watt-data-table watt-empty-state {\n margin: var(--watt-space-xl) 0;\n }\n `,\n ],\n template: `\n <watt-card vater fill=\"vertical\" [variant]=\"variant()\">\n <vater-flex autoSize fill=\"vertical\" gap=\"m\">\n @if (header()) {\n <vater-stack direction=\"row\" gap=\"m\">\n <vater-stack direction=\"row\" gap=\"s\">\n <ng-content select=\"h3\" />\n <ng-content select=\"h4\" />\n @if (enableCount()) {\n <span class=\"watt-chip-label\">\n {{ count() ?? table().dataSource().totalCount }}\n </span>\n }\n @if (queryTime()) {\n <span class=\"watt-label\">in {{ queryTime() }} ms</span>\n }\n </vater-stack>\n <ng-content />\n <vater-spacer />\n @if (enableSearch()) {\n <watt-search\n [label]=\"searchLabel() ?? intl.search\"\n [trim]=\"trimSearch()\"\n (search)=\"onSearch($event)\"\n />\n }\n <ng-content select=\"watt-data-actions\" />\n <ng-content select=\"watt-button\" />\n </vater-stack>\n }\n <ng-content select=\"watt-data-filters\" />\n <vater-flex [autoSize]=\"autoSize()\" fill=\"vertical\">\n <ng-content select=\"watt-table\" />\n @if (\n enableEmptyState() &&\n !table().loading() &&\n table().dataSource().filteredData.length === 0\n ) {\n <vater-flex [autoSize]=\"autoSize()\" fill=\"vertical\">\n <vater-stack scrollable justify=\"center\">\n <watt-empty-state\n [icon]=\"error() ? 'custom-power' : ready() ? emptyStateIcon() : 'custom-explore'\"\n [title]=\"\n error() ? intl.errorTitle : ready() ? intl.emptyTitle : intl.defaultTitle\n \"\n [message]=\"error() ? intl.errorText : ready() ? intl.emptyText : intl.defaultText\"\n >\n @if (enableRetry()) {\n <watt-button variant=\"secondary\" (click)=\"retry.emit()\">{{\n intl.emptyRetry\n }}</watt-button>\n }\n </watt-empty-state>\n </vater-stack>\n </vater-flex>\n }\n </vater-flex>\n @if (enablePaginator()) {\n <watt-paginator\n [for]=\"table().dataSource()\"\n [length]=\"count() ?? 0\"\n [pageSize]=\"pageSize()\"\n (changed)=\"pageChanged.emit($event)\"\n />\n }\n </vater-flex>\n </watt-card>\n `,\n})\nexport class WattDataTableComponent {\n intl = inject(WattDataIntlService);\n\n error = input<unknown>();\n ready = input(true);\n enableSearch = input(true);\n trimSearch = input(true);\n header = input(true);\n enableRetry = input(false);\n enableCount = input(true);\n enableEmptyState = input(true);\n queryTime = input<number>();\n searchLabel = input<string>();\n enablePaginator = input(true);\n pageSize = input<number>(50);\n count = input<number>();\n autoSize = input(false);\n variant = input<WATT_CARD_VARIANT>('solid');\n emptyStateIcon = input<WattIcon | 'custom-power' | 'custom-explore' | 'custom-no-results'>(\n 'cancel'\n );\n\n clear = output();\n pageChanged = output<PageEvent>();\n retry = output();\n\n table = contentChild.required(WattTableComponent<unknown>, { descendants: true });\n\n search = viewChild(WattSearchComponent);\n reset = () => this.search()?.clear();\n\n onSearch(value: string) {\n this.table().dataSource().filter = value;\n if (!value) this.clear.emit();\n }\n}\n"]}
1
+ {"version":3,"file":"watt-data-table.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/data/watt-data-table.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,KAAK,EACL,MAAM,EACN,SAAS,GACV,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAqB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAA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AAQ,CAAC,CAAA,kBAA2B,CAAA,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IAElF,MAAM,GAAG,SAAS,CAAC,mBAAmB,kDAAC,CAAC;IACxC,KAAK,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC;IAErC,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE,CAAC,MAAM,GAAG,KAAK,CAAC;QACzC,IAAI,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;wGAlCU,sBAAsB;4FAAtB,sBAAsB,8xEA0BH,CAAA,kBAA2B,CAAA,wGAEtC,mBAAmB,gEAjG5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmET,8SAjGC,kBAAkB,2FAClB,oBAAoB,yEACpB,mBAAmB,uEACnB,qBAAqB,uGACrB,iBAAiB,sFACjB,uBAAuB,sHACvB,sBAAsB,wJACtB,mBAAmB,gIACnB,mBAAmB;;4FA2FV,sBAAsB;kBAtGlC,SAAS;+BACE,iBAAiB,WAClB;wBACP,kBAAkB;wBAClB,oBAAoB;wBACpB,mBAAmB;wBACnB,qBAAqB;wBACrB,iBAAiB;wBACjB,uBAAuB;wBACvB,sBAAsB;wBACtB,mBAAmB;wBACnB,mBAAmB;qBACpB,iBACc,iBAAiB,CAAC,IAAI,YAoB3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmET;qyDA4B6B,kBAA2B,QAAE,EAAE,WAAW,EAAE,IAAI,EAAE,kFAE7D,mBAAmB","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 Component,\n ViewEncapsulation,\n contentChild,\n inject,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { PageEvent } from '@angular/material/paginator';\n\nimport {\n VaterFlexComponent,\n VaterSpacerComponent,\n VaterStackComponent,\n VaterUtilityDirective,\n} from '@energinet/watt/vater';\nimport { WATT_CARD_VARIANT, WattCardComponent } from '@energinet/watt/card';\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattEmptyStateComponent } from '@energinet/watt/empty-state';\nimport { WattPaginatorComponent } from '@energinet/watt/paginator';\nimport { WattSearchComponent } from '@energinet/watt/search';\nimport { WattTableComponent } from '@energinet/watt/table';\nimport { WattIcon } from '@energinet/watt/icon';\n\nimport { WattDataIntlService } from './watt-data-intl.service';\n\n@Component({\n selector: 'watt-data-table',\n imports: [\n VaterFlexComponent,\n VaterSpacerComponent,\n VaterStackComponent,\n VaterUtilityDirective,\n WattCardComponent,\n WattEmptyStateComponent,\n WattPaginatorComponent,\n WattSearchComponent,\n WattButtonComponent,\n ],\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-data-table h3,\n watt-data-table h4 {\n line-height: 44px;\n min-height: 44px;\n margin: 0;\n }\n\n watt-data-table watt-paginator {\n display: block;\n margin: calc(-1 * var(--watt-space-m));\n }\n\n watt-data-table watt-empty-state {\n margin: var(--watt-space-xl) 0;\n }\n `,\n ],\n template: `\n <watt-card vater fill=\"vertical\" [variant]=\"variant()\">\n <vater-flex autoSize fill=\"vertical\" gap=\"m\">\n @if (header()) {\n <vater-stack direction=\"row\" gap=\"m\">\n <vater-stack direction=\"row\" gap=\"s\">\n <ng-content select=\"h3\" />\n <ng-content select=\"h4\" />\n @if (enableCount()) {\n <span class=\"watt-chip-label\">\n {{ count() ?? table().dataSource().totalCount }}\n </span>\n }\n @if (queryTime()) {\n <span class=\"watt-label\">in {{ queryTime() }} ms</span>\n }\n </vater-stack>\n <ng-content />\n <vater-spacer />\n @if (enableSearch()) {\n <watt-search\n [label]=\"searchLabel() ?? intl.search\"\n [trim]=\"trimSearch()\"\n (search)=\"onSearch($event)\"\n />\n }\n <ng-content select=\"watt-data-actions\" />\n <ng-content select=\"watt-button\" />\n </vater-stack>\n }\n <ng-content select=\"watt-data-filters\" />\n <vater-flex [autoSize]=\"autoSize()\" fill=\"vertical\">\n <ng-content select=\"watt-table\" />\n @if (\n enableEmptyState() &&\n !table().loading() &&\n table().dataSource().filteredData.length === 0\n ) {\n <vater-flex [autoSize]=\"autoSize()\" fill=\"vertical\">\n <vater-stack scrollable justify=\"center\">\n <watt-empty-state\n [icon]=\"error() ? 'custom-power' : ready() ? emptyStateIcon() : 'custom-explore'\"\n [title]=\"\n error() ? intl.errorTitle : ready() ? intl.emptyTitle : intl.defaultTitle\n \"\n [message]=\"error() ? intl.errorText : ready() ? intl.emptyText : intl.defaultText\"\n >\n @if (enableRetry()) {\n <watt-button variant=\"secondary\" (click)=\"retry.emit()\">{{\n intl.emptyRetry\n }}</watt-button>\n }\n </watt-empty-state>\n </vater-stack>\n </vater-flex>\n }\n </vater-flex>\n @if (enablePaginator()) {\n <watt-paginator\n [for]=\"table().dataSource()\"\n [length]=\"count() ?? 0\"\n [pageSize]=\"pageSize()\"\n (changed)=\"pageChanged.emit($event)\"\n />\n }\n </vater-flex>\n </watt-card>\n `,\n})\nexport class WattDataTableComponent {\n intl = inject(WattDataIntlService);\n\n error = input<unknown>();\n ready = input(true);\n enableSearch = input(true);\n trimSearch = input(true);\n header = input(true);\n enableRetry = input(false);\n enableCount = input(true);\n enableEmptyState = input(true);\n queryTime = input<number>();\n searchLabel = input<string>();\n enablePaginator = input(true);\n pageSize = input<number>(50);\n count = input<number>();\n autoSize = input(false);\n variant = input<WATT_CARD_VARIANT>('solid');\n emptyStateIcon = input<WattIcon | 'custom-power' | 'custom-explore' | 'custom-no-results'>(\n 'cancel'\n );\n\n clear = output();\n pageChanged = output<PageEvent>();\n retry = output();\n\n table = contentChild.required(WattTableComponent<unknown>, { descendants: true });\n\n search = viewChild(WattSearchComponent);\n reset = () => this.search()?.clear();\n\n onSearch(value: string) {\n this.table().dataSource().filter = value;\n if (!value) this.clear.emit();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"watt-dropdown-option.js","sourceRoot":"","sources":["../../../../libs/watt/package/dropdown/watt-dropdown-option.ts"],"names":[],"mappings":"","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\nexport interface WattDropdownOption {\n value: string;\n displayValue: string;\n disabled?: boolean;\n}\n\nexport interface WattDropdownOptionGroup {\n label: string;\n options: WattDropdownOption[];\n disabled?: boolean;\n}\n\nexport type WattDropdownOptions = WattDropdownOption[];\nexport type WattDropdownGroupedOptions = WattDropdownOptionGroup[];\n"]}
1
+ {"version":3,"file":"watt-dropdown-option.js","sourceRoot":"","sources":["../../../../libs/watt/package/dropdown/watt-dropdown-option.ts"],"names":[],"mappings":"","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\nexport interface WattDropdownOption<T = string> {\n value: T;\n displayValue: string;\n disabled?: boolean;\n}\n\nexport interface WattDropdownOptionGroup<T = string> {\n label: string;\n options: WattDropdownOption<T>[];\n disabled?: boolean;\n}\n\nexport type WattDropdownOptions<T = string> = WattDropdownOption<T>[];\nexport type WattDropdownGroupedOptions<T = string> = WattDropdownOptionGroup<T>[];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"watt-dropdown.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/dropdown/watt-dropdown.component.ts","../../../../libs/watt/package/dropdown/watt-dropdown.component.html"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EAEN,MAAM,EACN,SAAS,EACT,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,SAAS,EAET,WAAW,EAGX,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAa,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,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,MAAM,GAAG,CAAC;wBAClC,uBAAuB,CAAC,MAAM,KAAK,eAAe,CAAC,MAAM,CAAC;YAC9D,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;wGAlXU,qBAAqB;4FAArB,qBAAqB,m/DCtFlC,kyHA8GA,ysKDvCI,OAAO,mFACP,eAAe,g1BACf,eAAe,8BACf,mBAAmB,yTACnB,wBAAwB,mvBAExB,iBAAiB,kGACjB,kBAAkB,yLAClB,qBAAqB,0JATrB,MAAM;;4FAgBG,qBAAqB;kBAtBjC,SAAS;+BACE,eAAe,iBAGV,iBAAiB,CAAC,IAAI,WAC5B;wBACP,MAAM;wBACN,OAAO;wBACP,eAAe;wBACf,eAAe;wBACf,mBAAmB;wBACnB,wBAAwB;wBAExB,iBAAiB;wBACjB,kBAAkB;wBAClB,qBAAqB;qBACtB,QACK;wBACJ,4BAA4B,EAAE,cAAc;wBAC5C,wBAAwB,EAAE,YAAY;qBACvC;iGA8DgC,WAAW","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 input,\n model,\n signal,\n effect,\n OnInit,\n inject,\n Component,\n viewChild,\n DestroyRef,\n ViewEncapsulation,\n computed,\n} from '@angular/core';\n\nimport {\n NgControl,\n ValidatorFn,\n FormControl,\n ValidationErrors,\n AsyncValidatorFn,\n UntypedFormControl,\n ReactiveFormsModule,\n ControlValueAccessor,\n} from '@angular/forms';\n\nimport { NgClass } from '@angular/common';\n\nimport { RxPush } from '@rx-angular/template/push';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { of, ReplaySubject, map, take, mergeWith } from 'rxjs';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { MatSelectModule, MatSelect } from '@angular/material/select';\nimport { MatOptionModule } from '@angular/material/core';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattMenuChipComponent } from '@energinet/watt/chip';\n\nimport type { WattDropdownValue } from './watt-dropdown-value';\nimport type {\n WattDropdownOptions,\n WattDropdownOptionGroup,\n WattDropdownGroupedOptions,\n} from './watt-dropdown-option';\n\n@Component({\n selector: 'watt-dropdown',\n templateUrl: './watt-dropdown.component.html',\n styleUrls: ['./watt-dropdown.component.scss'],\n encapsulation: ViewEncapsulation.None,\n imports: [\n RxPush,\n NgClass,\n MatSelectModule,\n MatOptionModule,\n ReactiveFormsModule,\n NgxMatSelectSearchModule,\n\n WattIconComponent,\n WattFieldComponent,\n WattMenuChipComponent,\n ],\n host: {\n '[attr.watt-field-disabled]': 'isDisabled()',\n '[class.watt-chip-mode]': 'chipMode()',\n },\n})\nexport class WattDropdownComponent implements ControlValueAccessor, OnInit {\n private parentControlDirective = inject(NgControl, { host: true });\n private destroyRef = inject(DestroyRef);\n private validateParent?: ValidatorFn;\n private validateParentAsync?: AsyncValidatorFn;\n private _options: WattDropdownOptions = [];\n private _groupedOptions: WattDropdownGroupedOptions = [];\n parentControl: FormControl | null = null;\n matSelectControl = new FormControl<string | string[] | undefined | null>(null);\n\n /**\n * Control for the MatSelect filter keyword\n */\n filterControl = new UntypedFormControl();\n\n /**\n * List of options filtered by search keyword\n */\n filteredOptions$ = new ReplaySubject<WattDropdownOptions>(1);\n\n /**\n * List of grouped options filtered by search keyword\n */\n filteredGroupedOptions$ = new ReplaySubject<WattDropdownGroupedOptions>(1);\n\n mergedFilteredOptions$ = this.filteredOptions$.pipe(\n mergeWith(this.filteredGroupedOptions$),\n take(1),\n map((options) => {\n if (this.hasGroups()) {\n return (options as WattDropdownGroupedOptions)\n .flatMap((group) => ('options' in group ? group.options : []))\n .map((option) => option.value);\n }\n\n return (options as WattDropdownOptions).map((option) => option.value);\n })\n );\n\n emDash = '—';\n isToggleAllChecked = false;\n isToggleAllIndeterminate = false;\n isDisabled = signal(false);\n\n get showTriggerValue(): boolean {\n const multiple = this.multiple();\n return (multiple &&\n this.matSelectControl.value?.length === 1 &&\n this.matSelectControl.value[0] !== '') ||\n (!multiple && this.matSelect()?.triggerValue)\n ? true\n : false;\n }\n\n get showChipLabel() {\n return this.multiple() && this.matSelectControl.value && this.matSelectControl.value.length > 1\n ? true\n : false;\n }\n\n matSelect = viewChild<MatSelect>('matSelect');\n hideSearch = input(false);\n panelWidth = input<null | 'auto'>(null);\n getCustomTrigger = input<(value: string | string[]) => string>();\n\n /**\n * Set the mode of the dropdown.\n */\n chipMode = input(false);\n disableSelectedMode = input(false);\n sortDirection = input<'asc' | 'desc'>();\n\n /**\n * Sets the options for the dropdown.\n * Can be a flat array of options or an array containing both options and option groups.\n */\n options = model<WattDropdownOptions | WattDropdownGroupedOptions>([]);\n\n /**\n * Sets support for selecting multiple dropdown options.\n */\n multiple = input(false);\n\n /**\n * Sets support for hiding the reset option in \"single\" select mode.\n */\n showResetOption = input(true);\n\n /**\n * Sets the placeholder for the dropdown.\n */\n placeholder = input('');\n\n /**\n * Sets the label for the dropdown.\n */\n label = input('');\n\n /**\n * Label to be shown when no options are found after filtering.\n *\n * Note: The label is visible in \"multiple\" mode only.\n */\n noOptionsFoundLabel = input('');\n\n hasGroups = computed(() => {\n const options = this.options() ?? [];\n return options.some(\n (option) => 'options' in option && Array.isArray((option as WattDropdownOptionGroup).options)\n );\n });\n\n constructor() {\n effect(() => {\n const options = this.options();\n if (Array.isArray(options)) {\n const optionsCopy = [...options];\n\n if (this.hasGroups()) {\n this.handleGroup(optionsCopy as WattDropdownGroupedOptions);\n } else {\n this.handleFlat(optionsCopy as WattDropdownOptions);\n }\n }\n });\n this.parentControlDirective.valueAccessor = this;\n }\n\n private handleFlat(optionsCopy: WattDropdownOptions) {\n if (this.sortDirection()) {\n optionsCopy = this.sortOptions(optionsCopy);\n }\n\n this._options = optionsCopy;\n this.filteredOptions$.next(this._options);\n }\n\n private handleGroup(optionsCopy: WattDropdownGroupedOptions) {\n this._groupedOptions = this.processGroupedOptions(optionsCopy);\n this.filteredGroupedOptions$.next(this._groupedOptions);\n }\n\n private processGroupedOptions(options: WattDropdownGroupedOptions): WattDropdownGroupedOptions {\n return options.map((group) => {\n if (this.sortDirection()) {\n group.options = this.sortOptions(group.options);\n }\n return group;\n });\n }\n\n ngOnInit() {\n this.listenForFilterFieldValueChanges();\n this.initializePropertiesFromParent();\n this.bindParentValidatorsToControl();\n this.bindControlToParent();\n }\n\n writeValue(value: WattDropdownValue) {\n this.matSelectControl.setValue(value);\n }\n\n registerOnChange(onChangeFn: (value: WattDropdownValue) => void) {\n this.changeParentValue = onChangeFn;\n }\n\n registerOnTouched(onTouchFn: () => void) {\n this.markParentControlAsTouched = onTouchFn;\n }\n\n setDisabledState(shouldDisable: boolean) {\n this.isDisabled.set(shouldDisable);\n if (shouldDisable) {\n this.matSelectControl.disable();\n } else {\n this.matSelectControl.enable();\n }\n }\n\n onToggleAll(toggleAllState: boolean) {\n this.mergedFilteredOptions$.subscribe((filteredOptions: string[]) => {\n const optionsToSelect = toggleAllState ? filteredOptions : [];\n this.matSelectControl.patchValue(optionsToSelect);\n });\n }\n\n public sortOptions(options: WattDropdownOptions): WattDropdownOptions {\n return [...options].sort((a, b) => {\n return this.sortDirection() === 'asc'\n ? a.displayValue.localeCompare(b.displayValue)\n : b.displayValue.localeCompare(a.displayValue);\n });\n }\n\n private listenForFilterFieldValueChanges() {\n this.filterControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.filterOptions();\n\n if (this.multiple()) {\n this.determineToggleAllCheckboxState();\n }\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private changeParentValue = (value: WattDropdownValue) => {\n // Intentionally left empty\n };\n\n private markParentControlAsTouched = () => {\n // Intentionally left empty\n };\n\n /**\n * @ignore\n *\n * Store the parent control, its validators and async validators in properties\n * of this component.\n */\n private initializePropertiesFromParent() {\n this.parentControl = this.parentControlDirective.control as UntypedFormControl;\n\n this.validateParent =\n (this.parentControl.validator && this.parentControl.validator.bind(this.parentControl)) ||\n (() => null);\n\n this.validateParentAsync =\n (this.parentControl.asyncValidator &&\n this.parentControl.asyncValidator.bind(this.parentControl)) ||\n (() => of(null));\n }\n\n /**\n * @ignore\n *\n * Inherit validators from parent form control.\n */\n private bindParentValidatorsToControl() {\n const validators = !this.matSelectControl.validator\n ? [this.validateParent]\n : Array.isArray(this.matSelectControl.validator)\n ? [...this.matSelectControl.validator, this.validateParent]\n : [this.matSelectControl.validator, this.validateParent];\n this.matSelectControl.setValidators(validators);\n\n const asyncValidators = !this.matSelectControl.asyncValidator\n ? [this.validateParentAsync]\n : Array.isArray(this.matSelectControl.asyncValidator)\n ? [...this.matSelectControl.asyncValidator, this.validateParentAsync]\n : [this.matSelectControl.asyncValidator, this.validateParentAsync];\n this.matSelectControl.setAsyncValidators(asyncValidators);\n\n this.matSelectControl.updateValueAndValidity();\n }\n\n /**\n * @ignore\n *\n * Emit values to the parent form control when our form control's value\n * changes.\n *\n * Reflect parent validation errors in our form control.\n */\n private bindControlToParent() {\n this.handleValueChange();\n this.handleStatusChange();\n }\n\n private handleStatusChange() {\n this.parentControl?.statusChanges\n .pipe(\n map(\n () =>\n ({\n ...this.parentControl?.errors,\n }) as ValidationErrors\n ),\n map((errors) => (Object.keys(errors).length > 0 ? errors : null)),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe((errors) => {\n this.matSelectControl.setErrors(errors);\n });\n }\n\n private handleValueChange() {\n this.matSelectControl.valueChanges\n .pipe(\n map((value) => (value === undefined ? null : value)),\n map((value: WattDropdownValue) => {\n if (Array.isArray(value) && value.length === 0) {\n return null;\n }\n\n return value;\n }),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe((value: WattDropdownValue) => {\n if (this.multiple()) {\n this.determineToggleAllCheckboxState();\n }\n\n this.markParentControlAsTouched();\n this.changeParentValue(value);\n });\n }\n\n private filterOptions() {\n if (!this._options) {\n return;\n }\n\n const search = (this.filterControl.value as string).trim().toLowerCase();\n\n if (!search) {\n this.filteredOptions$.next(this._options.slice());\n\n if (this.hasGroups()) {\n this.filteredGroupedOptions$.next(this._groupedOptions.slice());\n }\n return;\n }\n\n const filteredFlatOptions = this._options.filter(\n (option) => option.displayValue.toLowerCase().indexOf(search) > -1\n );\n\n this.filteredOptions$.next(filteredFlatOptions);\n\n if (this.hasGroups()) {\n this.filterGroups(search);\n }\n }\n\n private filterGroups(search: string) {\n const filteredGroups = this._groupedOptions\n .map((item) => {\n if (!('options' in item)) {\n return null;\n }\n const filteredGroupOptions = item.options.filter(\n (option) => option.displayValue.toLowerCase().indexOf(search) > -1\n );\n\n return filteredGroupOptions.length > 0 ? { ...item, options: filteredGroupOptions } : null;\n })\n .filter(Boolean) as WattDropdownGroupedOptions;\n\n this.filteredGroupedOptions$.next(filteredGroups);\n }\n\n private determineToggleAllCheckboxState() {\n this.mergedFilteredOptions$.subscribe((filteredOptions: string[]) => {\n const selectedOptions = this.matSelectControl.value;\n\n if (Array.isArray(selectedOptions)) {\n const selectedFilteredOptions = filteredOptions.filter((option) =>\n selectedOptions.includes(option)\n );\n\n this.isToggleAllIndeterminate =\n selectedFilteredOptions.length > 0 &&\n selectedFilteredOptions.length < filteredOptions.length;\n\n this.isToggleAllChecked =\n selectedFilteredOptions.length > 0 &&\n selectedFilteredOptions.length === filteredOptions.length;\n }\n });\n }\n}\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field\n [control]=\"parentControl\"\n [chipMode]=\"chipMode()\"\n [label]=\"label()\"\n (click)=\"matSelect.open()\"\n>\n @if (chipMode()) {\n <watt-menu-chip\n [opened]=\"matSelect.panelOpen\"\n (toggleChange)=\"matSelect.open()\"\n [selected]=\"!!matSelect?.triggerValue && !disableSelectedMode()\"\n [disabled]=\"matSelectControl.disabled\"\n >\n {{ placeholder() }}\n @if (showTriggerValue) {\n <span>\n @if (placeholder()) {\n :\n }\n {{ getCustomTrigger()?.(matSelect.value) ?? matSelect?.triggerValue }}\n </span>\n }\n @if (showChipLabel) {\n <span class=\"watt-chip-label\">{{ matSelectControl.value?.length }}</span>\n }\n </watt-menu-chip>\n }\n\n <mat-select\n [attr.aria-label]=\"label()\"\n [formControl]=\"matSelectControl\"\n [placeholder]=\"placeholder()\"\n #matSelect\n [panelWidth]=\"panelWidth()\"\n [multiple]=\"multiple()\"\n [ngClass]=\"{ chip: chipMode(), 'mat-mdc-select-multiple': multiple() }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode(),\n 'mat-mdc-select-panel-multiple': multiple(),\n }\"\n >\n <!-- We use this instead of ngIf, since it will trigger a NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. -->\n <mat-option [style.display]=\"!hideSearch() ? 'block' : 'none'\">\n <ngx-mat-select-search\n [formControl]=\"filterControl\"\n [placeholderLabel]=\"placeholder()\"\n closeIcon=\"close\"\n [showToggleAllCheckbox]=\"multiple()\"\n (toggleAll)=\"onToggleAll($event)\"\n [toggleAllCheckboxChecked]=\"isToggleAllChecked\"\n [toggleAllCheckboxIndeterminate]=\"isToggleAllIndeterminate\"\n [noEntriesFoundLabel]=\"noOptionsFoundLabel()\"\n >\n <watt-icon ngxMatSelectSearchClear name=\"close\" size=\"s\" />\n </ngx-mat-select-search>\n </mat-option>\n\n @if (!multiple() && showResetOption()) {\n <mat-option>{{ emDash }}</mat-option>\n }\n\n @if (hasGroups()) {\n @for (item of filteredGroupedOptions$ | push; track item) {\n @if (\"options\" in item) {\n <mat-optgroup [label]=\"item.label\" [disabled]=\"item.disabled\">\n @for (option of item.options; track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n </mat-optgroup>\n }\n }\n } @else {\n @for (option of filteredOptions$ | push; track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n }\n </mat-select>\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n</watt-field>\n"]}
1
+ {"version":3,"file":"watt-dropdown.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/dropdown/watt-dropdown.component.ts","../../../../libs/watt/package/dropdown/watt-dropdown.component.html"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EAEN,MAAM,EACN,SAAS,EACT,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,SAAS,EAET,WAAW,EAGX,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,EAAE,EAAE,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CAAC,MAAM,EAAE,EAAE,CAChE,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CACjC,CAAC;gBAEF,IAAI,CAAC,wBAAwB;oBAC3B,uBAAuB,CAAC,MAAM,GAAG,CAAC;wBAClC,uBAAuB,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;gBAE1D,IAAI,CAAC,kBAAkB;oBACrB,uBAAuB,CAAC,MAAM,GAAG,CAAC;wBAClC,uBAAuB,CAAC,MAAM,KAAK,eAAe,CAAC,MAAM,CAAC;YAC9D,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;wGAlXU,qBAAqB;4FAArB,qBAAqB,m/DCtFlC,kyHA8GA,ysKDvCI,OAAO,mFACP,eAAe,g1BACf,eAAe,8BACf,mBAAmB,yTACnB,wBAAwB,mvBAExB,iBAAiB,kGACjB,kBAAkB,yLAClB,qBAAqB,0JATrB,MAAM;;4FAgBG,qBAAqB;kBAtBjC,SAAS;+BACE,eAAe,iBAGV,iBAAiB,CAAC,IAAI,WAC5B;wBACP,MAAM;wBACN,OAAO;wBACP,eAAe;wBACf,eAAe;wBACf,mBAAmB;wBACnB,wBAAwB;wBAExB,iBAAiB;wBACjB,kBAAkB;wBAClB,qBAAqB;qBACtB,QACK;wBACJ,4BAA4B,EAAE,cAAc;wBAC5C,wBAAwB,EAAE,YAAY;qBACvC;iGA8DgC,WAAW","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 input,\n model,\n signal,\n effect,\n OnInit,\n inject,\n Component,\n viewChild,\n DestroyRef,\n ViewEncapsulation,\n computed,\n} from '@angular/core';\n\nimport {\n NgControl,\n ValidatorFn,\n FormControl,\n ValidationErrors,\n AsyncValidatorFn,\n UntypedFormControl,\n ReactiveFormsModule,\n ControlValueAccessor,\n} from '@angular/forms';\n\nimport { NgClass } from '@angular/common';\n\nimport { RxPush } from '@rx-angular/template/push';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { of, ReplaySubject, map, take, mergeWith } from 'rxjs';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { MatSelectModule, MatSelect } from '@angular/material/select';\nimport { MatOptionModule } from '@angular/material/core';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattMenuChipComponent } from '@energinet/watt/chip';\n\nimport type { WattDropdownValue } from './watt-dropdown-value';\nimport type {\n WattDropdownOptions,\n WattDropdownOptionGroup,\n WattDropdownGroupedOptions,\n} from './watt-dropdown-option';\n\n@Component({\n selector: 'watt-dropdown',\n templateUrl: './watt-dropdown.component.html',\n styleUrls: ['./watt-dropdown.component.scss'],\n encapsulation: ViewEncapsulation.None,\n imports: [\n RxPush,\n NgClass,\n MatSelectModule,\n MatOptionModule,\n ReactiveFormsModule,\n NgxMatSelectSearchModule,\n\n WattIconComponent,\n WattFieldComponent,\n WattMenuChipComponent,\n ],\n host: {\n '[attr.watt-field-disabled]': 'isDisabled()',\n '[class.watt-chip-mode]': 'chipMode()',\n },\n})\nexport class WattDropdownComponent<T = string> implements ControlValueAccessor, OnInit {\n private parentControlDirective = inject(NgControl, { host: true });\n private destroyRef = inject(DestroyRef);\n private validateParent?: ValidatorFn;\n private validateParentAsync?: AsyncValidatorFn;\n private _options: WattDropdownOptions = [];\n private _groupedOptions: WattDropdownGroupedOptions = [];\n parentControl: FormControl | null = null;\n matSelectControl = new FormControl<string | string[] | undefined | null>(null);\n\n /**\n * Control for the MatSelect filter keyword\n */\n filterControl = new UntypedFormControl();\n\n /**\n * List of options filtered by search keyword\n */\n filteredOptions$ = new ReplaySubject<WattDropdownOptions>(1);\n\n /**\n * List of grouped options filtered by search keyword\n */\n filteredGroupedOptions$ = new ReplaySubject<WattDropdownGroupedOptions>(1);\n\n mergedFilteredOptions$ = this.filteredOptions$.pipe(\n mergeWith(this.filteredGroupedOptions$),\n take(1),\n map((options) => {\n if (this.hasGroups()) {\n return (options as WattDropdownGroupedOptions)\n .flatMap((group) => ('options' in group ? group.options : []))\n .map((option) => option.value);\n }\n\n return (options as WattDropdownOptions).map((option) => option.value);\n })\n );\n\n emDash = '—';\n isToggleAllChecked = false;\n isToggleAllIndeterminate = false;\n isDisabled = signal(false);\n\n get showTriggerValue(): boolean {\n const multiple = this.multiple();\n return (multiple &&\n this.matSelectControl.value?.length === 1 &&\n this.matSelectControl.value[0] !== '') ||\n (!multiple && this.matSelect()?.triggerValue)\n ? true\n : false;\n }\n\n get showChipLabel() {\n return this.multiple() && this.matSelectControl.value && this.matSelectControl.value.length > 1\n ? true\n : false;\n }\n\n matSelect = viewChild<MatSelect>('matSelect');\n hideSearch = input(false);\n panelWidth = input<null | 'auto'>(null);\n getCustomTrigger = input<(value: string | string[]) => string>();\n\n /**\n * Set the mode of the dropdown.\n */\n chipMode = input(false);\n disableSelectedMode = input(false);\n sortDirection = input<'asc' | 'desc'>();\n\n /**\n * Sets the options for the dropdown.\n * Can be a flat array of options or an array containing both options and option groups.\n */\n options = model<WattDropdownOptions<T> | WattDropdownGroupedOptions<T>>([]);\n\n /**\n * Sets support for selecting multiple dropdown options.\n */\n multiple = input(false);\n\n /**\n * Sets support for hiding the reset option in \"single\" select mode.\n */\n showResetOption = input(true);\n\n /**\n * Sets the placeholder for the dropdown.\n */\n placeholder = input('');\n\n /**\n * Sets the label for the dropdown.\n */\n label = input('');\n\n /**\n * Label to be shown when no options are found after filtering.\n *\n * Note: The label is visible in \"multiple\" mode only.\n */\n noOptionsFoundLabel = input('');\n\n hasGroups = computed(() => {\n const options = this.options() ?? [];\n return options.some(\n (option) => 'options' in option && Array.isArray((option as WattDropdownOptionGroup).options)\n );\n });\n\n constructor() {\n effect(() => {\n const options = this.options();\n if (Array.isArray(options)) {\n const optionsCopy = [...options];\n\n if (this.hasGroups()) {\n this.handleGroup(optionsCopy as WattDropdownGroupedOptions);\n } else {\n this.handleFlat(optionsCopy as WattDropdownOptions);\n }\n }\n });\n this.parentControlDirective.valueAccessor = this;\n }\n\n private handleFlat(optionsCopy: WattDropdownOptions) {\n if (this.sortDirection()) {\n optionsCopy = this.sortOptions(optionsCopy);\n }\n\n this._options = optionsCopy;\n this.filteredOptions$.next(this._options);\n }\n\n private handleGroup(optionsCopy: WattDropdownGroupedOptions) {\n this._groupedOptions = this.processGroupedOptions(optionsCopy);\n this.filteredGroupedOptions$.next(this._groupedOptions);\n }\n\n private processGroupedOptions(options: WattDropdownGroupedOptions): WattDropdownGroupedOptions {\n return options.map((group) => {\n if (this.sortDirection()) {\n group.options = this.sortOptions(group.options);\n }\n return group;\n });\n }\n\n ngOnInit() {\n this.listenForFilterFieldValueChanges();\n this.initializePropertiesFromParent();\n this.bindParentValidatorsToControl();\n this.bindControlToParent();\n }\n\n writeValue(value: WattDropdownValue) {\n this.matSelectControl.setValue(value);\n }\n\n registerOnChange(onChangeFn: (value: WattDropdownValue) => void) {\n this.changeParentValue = onChangeFn;\n }\n\n registerOnTouched(onTouchFn: () => void) {\n this.markParentControlAsTouched = onTouchFn;\n }\n\n setDisabledState(shouldDisable: boolean) {\n this.isDisabled.set(shouldDisable);\n if (shouldDisable) {\n this.matSelectControl.disable();\n } else {\n this.matSelectControl.enable();\n }\n }\n\n onToggleAll(toggleAllState: boolean) {\n this.mergedFilteredOptions$.subscribe((filteredOptions: string[]) => {\n const optionsToSelect = toggleAllState ? filteredOptions : [];\n this.matSelectControl.patchValue(optionsToSelect);\n });\n }\n\n public sortOptions(options: WattDropdownOptions): WattDropdownOptions {\n return [...options].sort((a, b) => {\n return this.sortDirection() === 'asc'\n ? a.displayValue.localeCompare(b.displayValue)\n : b.displayValue.localeCompare(a.displayValue);\n });\n }\n\n private listenForFilterFieldValueChanges() {\n this.filterControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.filterOptions();\n\n if (this.multiple()) {\n this.determineToggleAllCheckboxState();\n }\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private changeParentValue = (value: WattDropdownValue) => {\n // Intentionally left empty\n };\n\n private markParentControlAsTouched = () => {\n // Intentionally left empty\n };\n\n /**\n * @ignore\n *\n * Store the parent control, its validators and async validators in properties\n * of this component.\n */\n private initializePropertiesFromParent() {\n this.parentControl = this.parentControlDirective.control as UntypedFormControl;\n\n this.validateParent =\n (this.parentControl.validator && this.parentControl.validator.bind(this.parentControl)) ||\n (() => null);\n\n this.validateParentAsync =\n (this.parentControl.asyncValidator &&\n this.parentControl.asyncValidator.bind(this.parentControl)) ||\n (() => of(null));\n }\n\n /**\n * @ignore\n *\n * Inherit validators from parent form control.\n */\n private bindParentValidatorsToControl() {\n const validators = !this.matSelectControl.validator\n ? [this.validateParent]\n : Array.isArray(this.matSelectControl.validator)\n ? [...this.matSelectControl.validator, this.validateParent]\n : [this.matSelectControl.validator, this.validateParent];\n this.matSelectControl.setValidators(validators);\n\n const asyncValidators = !this.matSelectControl.asyncValidator\n ? [this.validateParentAsync]\n : Array.isArray(this.matSelectControl.asyncValidator)\n ? [...this.matSelectControl.asyncValidator, this.validateParentAsync]\n : [this.matSelectControl.asyncValidator, this.validateParentAsync];\n this.matSelectControl.setAsyncValidators(asyncValidators);\n\n this.matSelectControl.updateValueAndValidity();\n }\n\n /**\n * @ignore\n *\n * Emit values to the parent form control when our form control's value\n * changes.\n *\n * Reflect parent validation errors in our form control.\n */\n private bindControlToParent() {\n this.handleValueChange();\n this.handleStatusChange();\n }\n\n private handleStatusChange() {\n this.parentControl?.statusChanges\n .pipe(\n map(\n () =>\n ({\n ...this.parentControl?.errors,\n }) as ValidationErrors\n ),\n map((errors) => (Object.keys(errors).length > 0 ? errors : null)),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe((errors) => {\n this.matSelectControl.setErrors(errors);\n });\n }\n\n private handleValueChange() {\n this.matSelectControl.valueChanges\n .pipe(\n map((value) => (value === undefined ? null : value)),\n map((value: WattDropdownValue) => {\n if (Array.isArray(value) && value.length === 0) {\n return null;\n }\n\n return value;\n }),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe((value: WattDropdownValue) => {\n if (this.multiple()) {\n this.determineToggleAllCheckboxState();\n }\n\n this.markParentControlAsTouched();\n this.changeParentValue(value);\n });\n }\n\n private filterOptions() {\n if (!this._options) {\n return;\n }\n\n const search = (this.filterControl.value as string).trim().toLowerCase();\n\n if (!search) {\n this.filteredOptions$.next(this._options.slice());\n\n if (this.hasGroups()) {\n this.filteredGroupedOptions$.next(this._groupedOptions.slice());\n }\n return;\n }\n\n const filteredFlatOptions = this._options.filter(\n (option) => option.displayValue.toLowerCase().indexOf(search) > -1\n );\n\n this.filteredOptions$.next(filteredFlatOptions);\n\n if (this.hasGroups()) {\n this.filterGroups(search);\n }\n }\n\n private filterGroups(search: string) {\n const filteredGroups = this._groupedOptions\n .map((item) => {\n if (!('options' in item)) {\n return null;\n }\n const filteredGroupOptions = item.options.filter(\n (option) => option.displayValue.toLowerCase().indexOf(search) > -1\n );\n\n return filteredGroupOptions.length > 0 ? { ...item, options: filteredGroupOptions } : null;\n })\n .filter(Boolean) as WattDropdownGroupedOptions;\n\n this.filteredGroupedOptions$.next(filteredGroups);\n }\n\n private determineToggleAllCheckboxState() {\n this.mergedFilteredOptions$.subscribe((filteredOptions: string[]) => {\n const selectedOptions = this.matSelectControl.value;\n\n if (Array.isArray(selectedOptions)) {\n const selectedFilteredOptions = filteredOptions.filter((option) =>\n selectedOptions.includes(option)\n );\n\n this.isToggleAllIndeterminate =\n selectedFilteredOptions.length > 0 &&\n selectedFilteredOptions.length < filteredOptions.length;\n\n this.isToggleAllChecked =\n selectedFilteredOptions.length > 0 &&\n selectedFilteredOptions.length === filteredOptions.length;\n }\n });\n }\n}\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field\n [control]=\"parentControl\"\n [chipMode]=\"chipMode()\"\n [label]=\"label()\"\n (click)=\"matSelect.open()\"\n>\n @if (chipMode()) {\n <watt-menu-chip\n [opened]=\"matSelect.panelOpen\"\n (toggleChange)=\"matSelect.open()\"\n [selected]=\"!!matSelect?.triggerValue && !disableSelectedMode()\"\n [disabled]=\"matSelectControl.disabled\"\n >\n {{ placeholder() }}\n @if (showTriggerValue) {\n <span>\n @if (placeholder()) {\n :\n }\n {{ getCustomTrigger()?.(matSelect.value) ?? matSelect?.triggerValue }}\n </span>\n }\n @if (showChipLabel) {\n <span class=\"watt-chip-label\">{{ matSelectControl.value?.length }}</span>\n }\n </watt-menu-chip>\n }\n\n <mat-select\n [attr.aria-label]=\"label()\"\n [formControl]=\"matSelectControl\"\n [placeholder]=\"placeholder()\"\n #matSelect\n [panelWidth]=\"panelWidth()\"\n [multiple]=\"multiple()\"\n [ngClass]=\"{ chip: chipMode(), 'mat-mdc-select-multiple': multiple() }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode(),\n 'mat-mdc-select-panel-multiple': multiple(),\n }\"\n >\n <!-- We use this instead of ngIf, since it will trigger a NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. -->\n <mat-option [style.display]=\"!hideSearch() ? 'block' : 'none'\">\n <ngx-mat-select-search\n [formControl]=\"filterControl\"\n [placeholderLabel]=\"placeholder()\"\n closeIcon=\"close\"\n [showToggleAllCheckbox]=\"multiple()\"\n (toggleAll)=\"onToggleAll($event)\"\n [toggleAllCheckboxChecked]=\"isToggleAllChecked\"\n [toggleAllCheckboxIndeterminate]=\"isToggleAllIndeterminate\"\n [noEntriesFoundLabel]=\"noOptionsFoundLabel()\"\n >\n <watt-icon ngxMatSelectSearchClear name=\"close\" size=\"s\" />\n </ngx-mat-select-search>\n </mat-option>\n\n @if (!multiple() && showResetOption()) {\n <mat-option>{{ emDash }}</mat-option>\n }\n\n @if (hasGroups()) {\n @for (item of filteredGroupedOptions$ | push; track item) {\n @if (\"options\" in item) {\n <mat-optgroup [label]=\"item.label\" [disabled]=\"item.disabled\">\n @for (option of item.options; track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n </mat-optgroup>\n }\n }\n } @else {\n @for (option of filteredOptions$ | push; track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n }\n </mat-select>\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n</watt-field>\n"]}
@@ -54,6 +54,7 @@ export const WattIconMap = {
54
54
  toggleOn: 'toggle_on',
55
55
  toggleOff: 'toggle_off',
56
56
  personCheck: 'person_check',
57
+ send: 'send',
57
58
  // Navigation
58
59
  left: 'navigate_before',
59
60
  right: 'navigate_next',
@@ -76,6 +77,7 @@ export const WattIconMap = {
76
77
  fileUpload: 'upload',
77
78
  print: 'print',
78
79
  preview: 'preview',
80
+ attachFile: 'attach_file',
79
81
  // Other
80
82
  power: 'power',
81
83
  location: 'location_on',
@@ -1 +1 @@
1
- {"version":3,"file":"icons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IAChC,YAAY,EAAE,gBAAgB;IAC9B,SAAS;IACT,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,gBAAgB;IACzB,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,QAAQ;IACR,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,cAAc;IACtB,QAAQ,EAAE,gBAAgB;IAC1B,YAAY,EAAE,UAAU;IACxB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,QAAQ;IACR,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,aAAa;IACvB,YAAY,EAAE,eAAe;IAC7B,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,eAAe;IAC7B,aAAa,EAAE,eAAe;IAC9B,mBAAmB,EAAE,sBAAsB;IAC3C,cAAc,EAAE,iBAAiB;IACjC,aAAa,EAAE,gBAAgB;IAC/B,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,gBAAgB,EAAE,kBAAkB;IACpC,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,eAAe;IAC9B,QAAQ,EAAE,UAAU;CACrB,CAAC","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\nexport const WattIconMap = {\n search: 'search',\n filter: 'filter_list',\n plus: 'add',\n minus: 'remove',\n edit: 'edit',\n redo: 'redo',\n undo: 'undo',\n remove: 'delete',\n removeForever: 'delete_forever',\n close: 'close',\n cancel: 'cancel',\n checkmark: 'check',\n user: 'account_circle',\n settings: 'settings',\n contentCopy: 'content_copy',\n date: 'calendar_today',\n time: 'schedule',\n email: 'email',\n markEmailUnread: 'mark_email_unread',\n link: 'link',\n openInNew: 'open_in_new',\n monetization: 'monetization_on',\n payments: 'payments',\n forwardMessage: 'forward_to_inbox',\n forward: 'forward',\n menu: 'menu',\n moreVertical: 'more_vert',\n logout: 'logout',\n login: 'lock_open',\n help: 'help',\n alternateEmail: 'alternate_email',\n refresh: 'refresh',\n language: 'language',\n pendingActions: 'pending_actions',\n toggleOn: 'toggle_on',\n toggleOff: 'toggle_off',\n personCheck: 'person_check',\n // Navigation\n left: 'navigate_before',\n right: 'navigate_next',\n up: 'expand_less',\n down: 'expand_more',\n arrowDropDown: 'arrow_drop_down',\n arrowRightAlt: 'arrow_right_alt',\n arrowLeftAlt: 'arrow_left_alt',\n // Alerts\n danger: 'dangerous',\n warning: 'report_problem',\n success: 'check_circle',\n info: 'info',\n feedback: 'feedback',\n // Files\n save: 'save_alt',\n upload: 'cloud_upload',\n download: 'cloud_download',\n fileDownload: 'download',\n fileUpload: 'upload',\n print: 'print',\n preview: 'preview',\n // Other\n power: 'power',\n location: 'location_on',\n smartDisplay: 'smart_display',\n windmill: 'energy',\n solarPower: 'solar_power',\n priorityHigh: 'priority_high',\n notifications: 'notifications',\n notificationsUnread: 'notifications_unread',\n horizontalRule: 'horizontal_rule',\n wrongLocation: 'wrong_location',\n heatPump: 'heat_pump',\n inventory: 'inventory',\n globe: 'globe',\n calculate: 'calculate',\n bar_chart_4_bars: 'bar_chart_4_bars',\n view_list: 'view_list',\n view_stream: 'view_stream',\n construction: 'construction',\n factory: 'factory',\n nest_eco_leaf: 'nest_eco_leaf',\n flash_on: 'flash_on',\n};\n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,aAAa,EAAE,iBAAiB;IAChC,aAAa,EAAE,iBAAiB;IAChC,YAAY,EAAE,gBAAgB;IAC9B,SAAS;IACT,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,gBAAgB;IACzB,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,QAAQ;IACR,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,cAAc;IACtB,QAAQ,EAAE,gBAAgB;IAC1B,YAAY,EAAE,UAAU;IACxB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,aAAa;IACzB,QAAQ;IACR,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,aAAa;IACvB,YAAY,EAAE,eAAe;IAC7B,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,eAAe;IAC7B,aAAa,EAAE,eAAe;IAC9B,mBAAmB,EAAE,sBAAsB;IAC3C,cAAc,EAAE,iBAAiB;IACjC,aAAa,EAAE,gBAAgB;IAC/B,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,gBAAgB,EAAE,kBAAkB;IACpC,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,eAAe;IAC9B,QAAQ,EAAE,UAAU;CACrB,CAAC","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\nexport const WattIconMap = {\n search: 'search',\n filter: 'filter_list',\n plus: 'add',\n minus: 'remove',\n edit: 'edit',\n redo: 'redo',\n undo: 'undo',\n remove: 'delete',\n removeForever: 'delete_forever',\n close: 'close',\n cancel: 'cancel',\n checkmark: 'check',\n user: 'account_circle',\n settings: 'settings',\n contentCopy: 'content_copy',\n date: 'calendar_today',\n time: 'schedule',\n email: 'email',\n markEmailUnread: 'mark_email_unread',\n link: 'link',\n openInNew: 'open_in_new',\n monetization: 'monetization_on',\n payments: 'payments',\n forwardMessage: 'forward_to_inbox',\n forward: 'forward',\n menu: 'menu',\n moreVertical: 'more_vert',\n logout: 'logout',\n login: 'lock_open',\n help: 'help',\n alternateEmail: 'alternate_email',\n refresh: 'refresh',\n language: 'language',\n pendingActions: 'pending_actions',\n toggleOn: 'toggle_on',\n toggleOff: 'toggle_off',\n personCheck: 'person_check',\n send: 'send',\n // Navigation\n left: 'navigate_before',\n right: 'navigate_next',\n up: 'expand_less',\n down: 'expand_more',\n arrowDropDown: 'arrow_drop_down',\n arrowRightAlt: 'arrow_right_alt',\n arrowLeftAlt: 'arrow_left_alt',\n // Alerts\n danger: 'dangerous',\n warning: 'report_problem',\n success: 'check_circle',\n info: 'info',\n feedback: 'feedback',\n // Files\n save: 'save_alt',\n upload: 'cloud_upload',\n download: 'cloud_download',\n fileDownload: 'download',\n fileUpload: 'upload',\n print: 'print',\n preview: 'preview',\n attachFile: 'attach_file',\n // Other\n power: 'power',\n location: 'location_on',\n smartDisplay: 'smart_display',\n windmill: 'energy',\n solarPower: 'solar_power',\n priorityHigh: 'priority_high',\n notifications: 'notifications',\n notificationsUnread: 'notifications_unread',\n horizontalRule: 'horizontal_rule',\n wrongLocation: 'wrong_location',\n heatPump: 'heat_pump',\n inventory: 'inventory',\n globe: 'globe',\n calculate: 'calculate',\n bar_chart_4_bars: 'bar_chart_4_bars',\n view_list: 'view_list',\n view_stream: 'view_stream',\n construction: 'construction',\n factory: 'factory',\n nest_eco_leaf: 'nest_eco_leaf',\n flash_on: 'flash_on',\n};\n"]}
@@ -84,7 +84,7 @@ export class WattPaginatorComponent {
84
84
  [showFirstLastButtons]="true"
85
85
  [attr.aria-label]="description()"
86
86
  />
87
- `, isInline: true, styles: [".cdk-overlay-pane div.mat-mdc-select-panel{--mat-select-panel-background-color: var(--watt-color-neutral-white);padding:0;font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){--mat-option-selected-state-layer-color: var(--watt-color-neutral-grey-300);color:var(--watt-color-primary)}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item:hover{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator{box-shadow:0 -1px 0 var(--watt-color-neutral-grey-300);z-index:100}watt-paginator .mat-mdc-paginator,watt-paginator .mat-mdc-paginator-page-size .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-paginator .mat-mdc-paginator{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator .mat-mdc-paginator .mdc-notched-outline{--mat-form-field-outlined-outline-width: 0;--mat-form-field-outlined-focus-outline-width: 0}watt-paginator .mat-mdc-paginator .mat-mdc-paginator-page-size-select{width:80px}watt-paginator .mat-mdc-select-arrow-wrapper{color:var(--watt-color-primary)}watt-paginator .mat-mdc-select-arrow-wrapper .mat-mdc-select-arrow{width:18px}watt-paginator .mat-mdc-paginator-container{justify-content:center;padding:var(--watt-space-m) var(--watt-space-ml)}watt-paginator .mat-mdc-paginator-range-actions{display:contents}watt-paginator .mat-mdc-paginator-range-label{margin:0 auto;-webkit-user-select:none;user-select:none}watt-paginator .mdc-icon-button{color:var(--watt-color-primary);--mat-icon-button-disabled-icon-color: var(--watt-color-neutral-grey-500);--mat-icon-button-icon-size: 28px;--mat-icon-button-state-layer-size: 28px;padding:0;margin-right:5px}watt-paginator .mat-mdc-select-value{padding-right:var(--watt-space-xs);text-align:right}watt-paginator .mat-mdc-select-arrow{color:var(--watt-color-primary)}watt-paginator .mat-mdc-form-field-flex{height:var(--watt-space-l);align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
87
+ `, isInline: true, styles: [".cdk-overlay-pane div.mat-mdc-select-panel{--mat-select-panel-background-color: var(--watt-color-neutral-white);padding:0;font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){--mat-option-selected-state-layer-color: var(--watt-color-neutral-grey-300);color:var(--watt-color-primary)}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item:hover{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator{box-shadow:0 -1px 0 var(--watt-color-neutral-grey-300);z-index:100}watt-paginator .mat-mdc-paginator,watt-paginator .mat-mdc-paginator-page-size .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-paginator .mat-mdc-paginator{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator .mat-mdc-paginator .mdc-notched-outline{--mat-form-field-outlined-outline-width: 0;--mat-form-field-outlined-focus-outline-width: 0}watt-paginator .mat-mdc-paginator .mat-mdc-paginator-page-size-select{width:80px}watt-paginator .mat-mdc-select-arrow-wrapper{color:var(--watt-color-primary)}watt-paginator .mat-mdc-select-arrow-wrapper .mat-mdc-select-arrow{width:18px}watt-paginator .mat-mdc-paginator-container{justify-content:center;padding:var(--watt-space-s) var(--watt-space-m)}watt-paginator .mat-mdc-paginator-range-actions{display:contents}watt-paginator .mat-mdc-paginator-range-label{margin:0 auto;-webkit-user-select:none;user-select:none}watt-paginator .mdc-icon-button{color:var(--watt-color-primary);--mat-icon-button-disabled-icon-color: var(--watt-color-neutral-grey-500);--mat-icon-button-icon-size: 28px;--mat-icon-button-state-layer-size: 28px;padding:0;margin-right:5px}watt-paginator .mat-mdc-select-value{padding-right:var(--watt-space-xs);text-align:right}watt-paginator .mat-mdc-select-arrow{color:var(--watt-color-primary)}watt-paginator .mat-mdc-form-field-flex{height:var(--watt-space-l);align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
88
88
  }
89
89
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattPaginatorComponent, decorators: [{
90
90
  type: Component,
@@ -99,6 +99,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
99
99
  [showFirstLastButtons]="true"
100
100
  [attr.aria-label]="description()"
101
101
  />
102
- `, styles: [".cdk-overlay-pane div.mat-mdc-select-panel{--mat-select-panel-background-color: var(--watt-color-neutral-white);padding:0;font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){--mat-option-selected-state-layer-color: var(--watt-color-neutral-grey-300);color:var(--watt-color-primary)}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item:hover{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator{box-shadow:0 -1px 0 var(--watt-color-neutral-grey-300);z-index:100}watt-paginator .mat-mdc-paginator,watt-paginator .mat-mdc-paginator-page-size .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-paginator .mat-mdc-paginator{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator .mat-mdc-paginator .mdc-notched-outline{--mat-form-field-outlined-outline-width: 0;--mat-form-field-outlined-focus-outline-width: 0}watt-paginator .mat-mdc-paginator .mat-mdc-paginator-page-size-select{width:80px}watt-paginator .mat-mdc-select-arrow-wrapper{color:var(--watt-color-primary)}watt-paginator .mat-mdc-select-arrow-wrapper .mat-mdc-select-arrow{width:18px}watt-paginator .mat-mdc-paginator-container{justify-content:center;padding:var(--watt-space-m) var(--watt-space-ml)}watt-paginator .mat-mdc-paginator-range-actions{display:contents}watt-paginator .mat-mdc-paginator-range-label{margin:0 auto;-webkit-user-select:none;user-select:none}watt-paginator .mdc-icon-button{color:var(--watt-color-primary);--mat-icon-button-disabled-icon-color: var(--watt-color-neutral-grey-500);--mat-icon-button-icon-size: 28px;--mat-icon-button-state-layer-size: 28px;padding:0;margin-right:5px}watt-paginator .mat-mdc-select-value{padding-right:var(--watt-space-xs);text-align:right}watt-paginator .mat-mdc-select-arrow{color:var(--watt-color-primary)}watt-paginator .mat-mdc-form-field-flex{height:var(--watt-space-l);align-items:center}\n"] }]
102
+ `, styles: [".cdk-overlay-pane div.mat-mdc-select-panel{--mat-select-panel-background-color: var(--watt-color-neutral-white);padding:0;font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){--mat-option-selected-state-layer-color: var(--watt-color-neutral-grey-300);color:var(--watt-color-primary)}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item:hover{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator{box-shadow:0 -1px 0 var(--watt-color-neutral-grey-300);z-index:100}watt-paginator .mat-mdc-paginator,watt-paginator .mat-mdc-paginator-page-size .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-paginator .mat-mdc-paginator{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator .mat-mdc-paginator .mdc-notched-outline{--mat-form-field-outlined-outline-width: 0;--mat-form-field-outlined-focus-outline-width: 0}watt-paginator .mat-mdc-paginator .mat-mdc-paginator-page-size-select{width:80px}watt-paginator .mat-mdc-select-arrow-wrapper{color:var(--watt-color-primary)}watt-paginator .mat-mdc-select-arrow-wrapper .mat-mdc-select-arrow{width:18px}watt-paginator .mat-mdc-paginator-container{justify-content:center;padding:var(--watt-space-s) var(--watt-space-m)}watt-paginator .mat-mdc-paginator-range-actions{display:contents}watt-paginator .mat-mdc-paginator-range-label{margin:0 auto;-webkit-user-select:none;user-select:none}watt-paginator .mdc-icon-button{color:var(--watt-color-primary);--mat-icon-button-disabled-icon-color: var(--watt-color-neutral-grey-500);--mat-icon-button-icon-size: 28px;--mat-icon-button-state-layer-size: 28px;padding:0;margin-right:5px}watt-paginator .mat-mdc-select-value{padding-right:var(--watt-space-xs);text-align:right}watt-paginator .mat-mdc-select-arrow{color:var(--watt-color-primary)}watt-paginator .mat-mdc-form-field-flex{height:var(--watt-space-l);align-items:center}\n"] }]
103
103
  }], propDecorators: { length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], pageIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageIndex", required: false }] }], for: [{ type: i0.Input, args: [{ isSignal: true, alias: "for", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }], instance: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatPaginator), { isSignal: true }] }] } });
104
104
  //# sourceMappingURL=watt-paginator.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"watt-paginator.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/paginator/watt-paginator.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,MAAM,EAEN,iBAAiB,EACjB,SAAS,EACT,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,GAEnB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;;;AAEtC;;;GAGG;AAoBH,MAAM,OAAO,sBAAsB;IACzB,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;IACxC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAEpD,MAAM,GAAG,KAAK,CAAC,CAAC,kDAAC,CAAC;IAClB,eAAe,GAAG,KAAK,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,2DAAC,CAAC;IAClD,QAAQ,GAAG,KAAK,CAAC,EAAE,oDAAC,CAAC;IACrB,SAAS,GAAG,KAAK,CAAC,CAAC,qDAAC,CAAC;IACrB,GAAG,GAAG,KAAK,yDAA2B,CAAC;IACvC,OAAO,GAAG,MAAM,EAAa,CAAC;IAC9B,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,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AI,CAAC,gBAAgB,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;IAC3D,CAAC;IAEO,aAAa,GAAG,CAAC,IAAY,EAAE,QAAgB,EAAE,MAAc,EAAE,EAAE;QACzE,IAAI,MAAM,IAAI,CAAC,IAAI,QAAQ,IAAI,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,EAAE,CAAC;QACvC,CAAC;QAED,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAE7B,MAAM,UAAU,GAAG,IAAI,GAAG,QAAQ,CAAC;QAEnC,2FAA2F;QAC3F,MAAM,QAAQ,GACZ,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,QAAQ,CAAC;QAExF,OAAO,GAAG,UAAU,GAAG,CAAC,MAAM,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,EAAE,CAAC;IACrE,CAAC,CAAC;wGA5DS,sBAAsB;4FAAtB,sBAAsB,yyBAUH,YAAY,gEAvBhC;;;;;;;;;;;GAWT,qoEAhBS,kBAAkB;;4FAkBjB,sBAAsB;kBAnBlC,SAAS;8BACC,CAAC,kBAAkB,CAAC,mBACZ,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,YAC3B,gBAAgB,YAEhB;;;;;;;;;;;GAWT;+mBAY6B,YAAY","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 ChangeDetectionStrategy,\n Component,\n inject,\n OnInit,\n ViewEncapsulation,\n viewChild,\n input,\n effect,\n output,\n computed,\n} from '@angular/core';\nimport {\n MatPaginator,\n MatPaginatorIntl,\n MatPaginatorModule,\n PageEvent,\n} from '@angular/material/paginator';\n\nimport { IWattTableDataSource } from '@energinet/watt/table';\nimport { WattPaginatorIntlService } from './watt-paginator-intl.service';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { map, startWith } from 'rxjs';\n\n/**\n * Usage:\n * `import { WattPaginatorComponent } from '@energinet/watt/paginator';`\n */\n@Component({\n imports: [MatPaginatorModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-paginator',\n styleUrls: ['./watt-paginator.component.scss'],\n template: `\n <mat-paginator\n class=\"watt-paginator\"\n (page)=\"changed.emit($event)\"\n [length]=\"length()\"\n [pageSize]=\"pageSize()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [pageIndex]=\"pageIndex()\"\n [showFirstLastButtons]=\"true\"\n [attr.aria-label]=\"description()\"\n />\n `,\n})\nexport class WattPaginatorComponent<T> implements OnInit {\n private intl = inject(WattPaginatorIntlService);\n private matPaginatorIntl = inject(MatPaginatorIntl);\n\n length = input(0);\n pageSizeOptions = input([50, 100, 150, 200, 250]);\n pageSize = input(50);\n pageIndex = input(0);\n for = input<IWattTableDataSource<T>>();\n changed = output<PageEvent>();\n instance = viewChild.required(MatPaginator);\n\n changes = toSignal(\n this.intl.changes.pipe(\n // Signals use referential equality to determine if a value has changed.\n // Therefore it is not possible to just map to the intl service directly\n // as the intl service relies on mutation for updating values.\n map(() => ({ ...this.intl })),\n startWith(this.intl)\n ),\n { requireSync: true }\n );\n\n description = computed(() => this.changes().description);\n\n updateDataSource = effect(() => {\n const dataSource = this.for();\n const instance = this.instance();\n if (!dataSource) return;\n dataSource.paginator = instance;\n });\n\n updateLabels = effect(() => {\n const changes = this.changes();\n this.matPaginatorIntl.itemsPerPageLabel = changes.itemsPerPage;\n this.matPaginatorIntl.nextPageLabel = changes.nextPage;\n this.matPaginatorIntl.previousPageLabel = changes.previousPage;\n this.matPaginatorIntl.firstPageLabel = changes.firstPage;\n this.matPaginatorIntl.lastPageLabel = changes.lastPage;\n this.matPaginatorIntl.changes.next();\n });\n\n ngOnInit() {\n this.matPaginatorIntl.getRangeLabel = this.getRangeLabel;\n }\n\n private getRangeLabel = (page: number, pageSize: number, length: number) => {\n if (length == 0 || pageSize == 0) {\n return `0 ${this.intl.of} ${length}`;\n }\n\n length = Math.max(length, 0);\n\n const startIndex = page * pageSize;\n\n // If the start index exceeds the list length, do not try and fix the end index to the end.\n const endIndex =\n startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;\n\n return `${startIndex + 1} – ${endIndex} ${this.intl.of} ${length}`;\n };\n}\n"]}
1
+ {"version":3,"file":"watt-paginator.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/paginator/watt-paginator.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,MAAM,EAEN,iBAAiB,EACjB,SAAS,EACT,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,GAEnB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;;;AAEtC;;;GAGG;AAoBH,MAAM,OAAO,sBAAsB;IACzB,IAAI,GAAG,MAAM,CAAC,wBAAwB,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AvBhC;;;;;;;;;;;GAWT,ooEAhBS,kBAAkB;;4FAkBjB,sBAAsB;kBAnBlC,SAAS;8BACC,CAAC,kBAAkB,CAAC,mBACZ,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,YAC3B,gBAAgB,YAEhB;;;;;;;;;;;GAWT;+mBAY6B,YAAY","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 ChangeDetectionStrategy,\n Component,\n inject,\n OnInit,\n ViewEncapsulation,\n viewChild,\n input,\n effect,\n output,\n computed,\n} from '@angular/core';\nimport {\n MatPaginator,\n MatPaginatorIntl,\n MatPaginatorModule,\n PageEvent,\n} from '@angular/material/paginator';\n\nimport { IWattTableDataSource } from '@energinet/watt/table';\nimport { WattPaginatorIntlService } from './watt-paginator-intl.service';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { map, startWith } from 'rxjs';\n\n/**\n * Usage:\n * `import { WattPaginatorComponent } from '@energinet/watt/paginator';`\n */\n@Component({\n imports: [MatPaginatorModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-paginator',\n styleUrls: ['./watt-paginator.component.scss'],\n template: `\n <mat-paginator\n class=\"watt-paginator\"\n (page)=\"changed.emit($event)\"\n [length]=\"length()\"\n [pageSize]=\"pageSize()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [pageIndex]=\"pageIndex()\"\n [showFirstLastButtons]=\"true\"\n [attr.aria-label]=\"description()\"\n />\n `,\n})\nexport class WattPaginatorComponent<T> implements OnInit {\n private intl = inject(WattPaginatorIntlService);\n private matPaginatorIntl = inject(MatPaginatorIntl);\n\n length = input(0);\n pageSizeOptions = input([50, 100, 150, 200, 250]);\n pageSize = input(50);\n pageIndex = input(0);\n for = input<IWattTableDataSource<T>>();\n changed = output<PageEvent>();\n instance = viewChild.required(MatPaginator);\n\n changes = toSignal(\n this.intl.changes.pipe(\n // Signals use referential equality to determine if a value has changed.\n // Therefore it is not possible to just map to the intl service directly\n // as the intl service relies on mutation for updating values.\n map(() => ({ ...this.intl })),\n startWith(this.intl)\n ),\n { requireSync: true }\n );\n\n description = computed(() => this.changes().description);\n\n updateDataSource = effect(() => {\n const dataSource = this.for();\n const instance = this.instance();\n if (!dataSource) return;\n dataSource.paginator = instance;\n });\n\n updateLabels = effect(() => {\n const changes = this.changes();\n this.matPaginatorIntl.itemsPerPageLabel = changes.itemsPerPage;\n this.matPaginatorIntl.nextPageLabel = changes.nextPage;\n this.matPaginatorIntl.previousPageLabel = changes.previousPage;\n this.matPaginatorIntl.firstPageLabel = changes.firstPage;\n this.matPaginatorIntl.lastPageLabel = changes.lastPage;\n this.matPaginatorIntl.changes.next();\n });\n\n ngOnInit() {\n this.matPaginatorIntl.getRangeLabel = this.getRangeLabel;\n }\n\n private getRangeLabel = (page: number, pageSize: number, length: number) => {\n if (length == 0 || pageSize == 0) {\n return `0 ${this.intl.of} ${length}`;\n }\n\n length = Math.max(length, 0);\n\n const startIndex = page * pageSize;\n\n // If the start index exceeds the list length, do not try and fix the end index to the end.\n const endIndex =\n startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;\n\n return `${startIndex + 1} – ${endIndex} ${this.intl.of} ${length}`;\n };\n}\n"]}
@@ -313,7 +313,7 @@ export class WattTableComponent {
313
313
  */
314
314
  toggleSelection = (row) => this.selection.update((s) => (s.includes(row) ? s.filter((r) => r !== row) : s.concat(row)));
315
315
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
316
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattTableComponent, isStandalone: true, selector: "watt-table", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, displayedColumns: { classPropertyName: "displayedColumns", publicName: "displayedColumns", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, stickyFooter: { classPropertyName: "stickyFooter", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, resolveHeader: { classPropertyName: "resolveHeader", publicName: "resolveHeader", isSignal: true, isRequired: false, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null }, sortClear: { classPropertyName: "sortClear", publicName: "sortClear", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, suppressRowHoverHighlight: { classPropertyName: "suppressRowHoverHighlight", publicName: "suppressRowHoverHighlight", isSignal: true, isRequired: false, transformFunction: null }, activeRow: { classPropertyName: "activeRow", publicName: "activeRow", isSignal: true, isRequired: false, transformFunction: null }, activeRowComparator: { classPropertyName: "activeRowComparator", publicName: "activeRowComparator", isSignal: true, isRequired: false, transformFunction: null }, hideColumnHeaders: { classPropertyName: "hideColumnHeaders", publicName: "hideColumnHeaders", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", expanded: "expandedChange", rowClick: "rowClick", sortChange: "sortChange" }, host: { properties: { "class.watt-table-variant-zebra": "variant() === \"zebra\"", "style.--watt-table-grid-template-columns": "sizing().join(\" \")" } }, queries: [{ propertyName: "cells", predicate: (WattTableCellDirective), isSignal: true }, { propertyName: "toolbar", first: true, predicate: (WattTableToolbarDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "tableCellElements", predicate: ["td"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<table\n mat-table\n matSort\n role=\"treegrid\"\n [ngClass]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [ngClass]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n '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=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer),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:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-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:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i2.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i2.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i3.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i3.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i3.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "component", type: WattCheckboxComponent, selector: "watt-checkbox", inputs: ["required"] }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }], encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [NgTemplateOutlet]] });
316
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattTableComponent, isStandalone: true, selector: "watt-table", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, displayedColumns: { classPropertyName: "displayedColumns", publicName: "displayedColumns", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, stickyFooter: { classPropertyName: "stickyFooter", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, resolveHeader: { classPropertyName: "resolveHeader", publicName: "resolveHeader", isSignal: true, isRequired: false, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null }, sortClear: { classPropertyName: "sortClear", publicName: "sortClear", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, suppressRowHoverHighlight: { classPropertyName: "suppressRowHoverHighlight", publicName: "suppressRowHoverHighlight", isSignal: true, isRequired: false, transformFunction: null }, activeRow: { classPropertyName: "activeRow", publicName: "activeRow", isSignal: true, isRequired: false, transformFunction: null }, activeRowComparator: { classPropertyName: "activeRowComparator", publicName: "activeRowComparator", isSignal: true, isRequired: false, transformFunction: null }, hideColumnHeaders: { classPropertyName: "hideColumnHeaders", publicName: "hideColumnHeaders", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", expanded: "expandedChange", rowClick: "rowClick", sortChange: "sortChange" }, host: { properties: { "class.watt-table-variant-zebra": "variant() === \"zebra\"", "style.--watt-table-grid-template-columns": "sizing().join(\" \")" } }, queries: [{ propertyName: "cells", predicate: (WattTableCellDirective), isSignal: true }, { propertyName: "toolbar", first: true, predicate: (WattTableToolbarDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "tableCellElements", predicate: ["td"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<table\n mat-table\n matSort\n role=\"treegrid\"\n [ngClass]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [ngClass]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n }\"\n ></tr>\n\n @if (toolbar()) {\n <tr mat-footer-row *matFooterRowDef=\"['spacer']\"></tr>\n }\n\n @if (hasFooter()) {\n <tr\n mat-footer-row\n [class.watt-table-hide-footer]=\"loading() || dataSource().filteredData.length === 0\"\n *matFooterRowDef=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-clickable-row>td:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i2.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i2.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i3.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i3.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i3.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "component", type: WattCheckboxComponent, selector: "watt-checkbox", inputs: ["required"] }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }], encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [NgTemplateOutlet]] });
317
317
  }
318
318
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattTableComponent, decorators: [{
319
319
  type: Component,
@@ -329,7 +329,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
329
329
  ], encapsulation: ViewEncapsulation.None, selector: 'watt-table', host: {
330
330
  '[class.watt-table-variant-zebra]': 'variant() === "zebra"',
331
331
  '[style.--watt-table-grid-template-columns]': 'sizing().join(" ")',
332
- }, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<table\n mat-table\n matSort\n role=\"treegrid\"\n [ngClass]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [ngClass]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n '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=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer),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:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-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:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"] }]
332
+ }, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<table\n mat-table\n matSort\n role=\"treegrid\"\n [ngClass]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [ngClass]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n }\"\n ></tr>\n\n @if (toolbar()) {\n <tr mat-footer-row *matFooterRowDef=\"['spacer']\"></tr>\n }\n\n @if (hasFooter()) {\n <tr\n mat-footer-row\n [class.watt-table-hide-footer]=\"loading() || dataSource().filteredData.length === 0\"\n *matFooterRowDef=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-clickable-row>td:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"] }]
333
333
  }], ctorParameters: () => [], propDecorators: { dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], displayedColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayedColumns", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], stickyFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyFooter", required: false }] }], resolveHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "resolveHeader", required: false }] }], sortBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortBy", required: false }] }], sortDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDirection", required: false }] }], sortClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortClear", required: false }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], suppressRowHoverHighlight: [{ type: i0.Input, args: [{ isSignal: true, alias: "suppressRowHoverHighlight", required: false }] }], activeRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeRow", required: false }] }], activeRowComparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeRowComparator", required: false }] }], hideColumnHeaders: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideColumnHeaders", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }, { type: i0.Output, args: ["expandedChange"] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], cells: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => WattTableCellDirective), { isSignal: true }] }], toolbar: [{ type: i0.ContentChild, args: [i0.forwardRef(() => WattTableToolbarDirective), { isSignal: true }] }], sort: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatSort), { isSignal: true }] }], tableCellElements: [{ type: i0.ViewChildren, args: ['td', { isSignal: true }] }] } });
334
334
  export const WATT_TABLE = [WattTableComponent, WattTableCellDirective, WattTableToolbarDirective];
335
335
  //# sourceMappingURL=watt-table.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"watt-table.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/table/watt-table.component.ts","../../../../libs/watt/package/table/watt-table.component.html"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EAAY,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,SAAS,EACT,MAAM,EAEN,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,EACN,WAAW,EACX,SAAS,EACT,YAAY,EACZ,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,aAAa,EAAuB,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,OAAO,E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YAAY,iGADZ,gBAAgB;;4FAiBP,kBAAkB;kBApB9B,SAAS;8BACC;wBACP,OAAO;wBACP,gBAAgB;wBAChB,YAAY;wBACZ,WAAW;wBACX,aAAa;wBACb,cAAc;wBACd,iBAAiB;wBACjB,qBAAqB;qBACtB,iBACc,iBAAiB,CAAC,IAAI,YAC3B,YAAY,QAGhB;wBACJ,kCAAkC,EAAE,uBAAuB;wBAC3D,4CAA4C,EAAE,oBAAoB;qBACnE;i6EA4IiC,sBAAyB,yFAC1B,yBAA4B,mFAClC,OAAO,+EAG2C,IAAI;AAiInF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,kBAAkB,EAAE,sBAAsB,EAAE,yBAAyB,CAAC,CAAC","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 { KeyValue, KeyValuePipe, NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n contentChild,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n TemplateRef,\n viewChild,\n viewChildren,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { Signal, TrackByFunction } from '@angular/core';\nimport { outputFromObservable } 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 { Subject } from 'rxjs';\n\nimport { WattCheckboxComponent } from '@energinet/watt/checkbox';\nimport { wattFormatDate } from '@energinet/watt/core/date';\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { IWattTableDataSource, WattTableDataSource } from './watt-table-data-source';\nimport { animateExpandableCells } from './watt-table-expand-animation';\n\n/** Class name for expandable cells. */\nexport const EXPANDABLE_CLASS = 'watt-table-cell--expandable';\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 * When `true`, the cell is replaced with an expandable arrow and the content is deferred.\n * Clicking on the arrow reveals the content below the current row.\n *\n * @remarks\n * It is recommended to provide a custom `trackBy` function when using `expandable`,\n * otherwise animations can be inaccurate when data is changed.\n */\n expandable?: boolean;\n\n /**\n * Tooltip text to show on hover of the header cell.\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 index: number;\n}\n\ninterface WattTableToolbarContext<T> {\n $implicit: T;\n}\n\n@Directive({\n selector: '[wattTableCell]',\n})\nexport class WattTableCellDirective<T> {\n templateRef = inject(TemplateRef<WattTableCellContext<T>>);\n\n /**\n * The WattTableColumn this template applies to.\n */\n readonly column = input.required<WattTableColumn<T>>({ alias: 'wattTableCell' });\n\n /**\n * Optional header text for the column.\n */\n readonly header = input<string>(undefined, { alias: 'wattTableCellHeader' });\n\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/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 encapsulation: ViewEncapsulation.None,\n selector: 'watt-table',\n styleUrls: ['./watt-table.component.scss'],\n templateUrl: './watt-table.component.html',\n host: {\n '[class.watt-table-variant-zebra]': 'variant() === \"zebra\"',\n '[style.--watt-table-grid-template-columns]': 'sizing().join(\" \")',\n },\n})\nexport class WattTableComponent<T> {\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 readonly dataSource = input.required<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 readonly columns = input<WattTableColumnDef<T>>({});\n\n /**\n * Used for hiding or reordering columns defined in the `columns` input.\n */\n readonly displayedColumns = input<string[]>();\n\n /**\n * Used for disabling the table. This will disable all user interaction\n */\n readonly disabled = input(false);\n\n /**\n * Provide a description of the table for visually impaired users.\n */\n readonly description = input('');\n\n /**\n * If set to `true`, the table will show a loading indicator\n * when there is no data.\n */\n readonly loading = input(false);\n\n /**\n * If true the footer will be sticky\n */\n readonly stickyFooter = input(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 readonly resolveHeader = input<(key: string) => string>();\n\n /**\n * Identifier for column that should be sorted initially.\n */\n readonly sortBy = input('');\n\n /**\n * The sort direction of the initially sorted column.\n */\n readonly sortDirection = input<SortDirection>('');\n\n /**\n * Whether to allow the user to clear the sort. Defaults to `true`.\n */\n readonly sortClear = input(true);\n\n /**\n * Optional function to determine CSS class(es) for each row.\n */\n readonly rowClass = input<(row: T) => string | string[]>();\n\n /**\n * Whether the table should include a checkbox column for row selection.\n */\n readonly selectable = input(false);\n\n /**\n * Sets the selected rows. Only applicable when selectable is `true`.\n */\n readonly selection = model<T[]>([]);\n\n /**\n * Set to true to disable row hover highlight.\n */\n readonly suppressRowHoverHighlight = input(false);\n\n /**\n * Highlights the currently active row.\n */\n readonly activeRow = input<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 readonly activeRowComparator = input<(currentRow: T, activeRow: T) => boolean>();\n\n /**\n * If set to `true`, the column headers will not be shown. Default is `false`.\n */\n readonly hideColumnHeaders = input(false);\n\n /**\n * Choose from a predefined set of display variants.\n */\n readonly variant = input<'zebra'>();\n\n /**\n * Array of rows that are currently expanded.\n */\n readonly expanded = model<T[]>([]);\n\n /**\n * Optional function for uniquely identifying rows.\n */\n readonly trackBy = input<TrackByFunction<T> | keyof T>();\n\n /**\n * @ignore\n * The `observed` boolean from the `Subject` is used to determine if a row is\n * clickable or not. This is available on `EventEmitter`, but not on `output`,\n * which is why this workaround is used.\n */\n protected rowClick$ = new Subject<T>();\n\n /**\n * Emits whenever a row is clicked.\n */\n readonly rowClick = outputFromObservable(this.rowClick$);\n\n /**\n * Event emitted when the user changes the active sort or sort direction.\n */\n readonly sortChange = output<Sort>();\n\n // Queries\n protected cells = contentChildren(WattTableCellDirective<T>);\n protected toolbar = contentChild(WattTableToolbarDirective<T>);\n protected sort = viewChild(MatSort);\n\n // Enables animation for expanding/collapsing cells\n protected tableCellElements = viewChildren<ElementRef<HTMLTableCellElement>>('td');\n protected animationEffect = animateExpandableCells(this.tableCellElements, this.expanded);\n\n // Selectable\n protected filterSelectionBy = (rows: T[]) => rows.filter((row) => this.selection().includes(row));\n protected getSelectionState = () => {\n const filteredData = this.dataSource().filteredData;\n const filteredSelection = this.filterSelectionBy(filteredData);\n if (!filteredSelection.length) return false;\n return filteredSelection.length === this.dataSource().filteredData.length ? true : null;\n };\n\n // Unique names for special columns\n protected checkboxColumn = '__checkboxColumn__';\n protected expandableColumn = '__expandableColumn__';\n\n protected hasFooter = computed(() => Object.values(this.columns()).some((c) => c.footer));\n protected isExpandable = computed(() => Object.values(this.columns()).some((c) => c.expandable));\n protected renderedColumns = computed(() => {\n const columns = this.displayedColumns() ?? Object.keys(this.columns());\n return [\n ...(this.selectable() ? [this.checkboxColumn] : []),\n ...columns.filter((key) => !this.columns()[key].expandable),\n ...(this.isExpandable() ? [this.expandableColumn] : []),\n ...columns.filter((key) => this.columns()[key].expandable),\n ];\n });\n\n protected sizing = computed(() => {\n const columns = this.columns();\n return this.renderedColumns()\n .filter((key) => !columns[key]?.expandable)\n .map((key) => {\n switch (key) {\n case this.checkboxColumn:\n return 'var(--watt-space-xl)';\n case this.expandableColumn:\n return 'min-content';\n default:\n return columns[key]?.size ?? 'auto';\n }\n });\n });\n\n /** Try to get cell data for a specific `column` and `row`. */\n private getCellData = (column: WattTableColumn<T>, row: T) => {\n if (column.cell) return column.cell(row);\n return !column.accessor\n ? ''\n : typeof column.accessor === 'function'\n ? column.accessor(row)\n : row[column.accessor];\n };\n\n protected getColumnTemplate = (column: WattTableColumn<T>) =>\n this.cells().find((item) => item.column() === column)?.templateRef;\n\n protected 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 protected getColumnCell = (column: WattTableColumn<T>, row: T) => {\n const cell = this.getCellData(column, row);\n if (cell === undefined || cell === null) return '—';\n if (cell instanceof Date) return wattFormatDate(cell);\n return cell;\n };\n\n protected getRowKey = (index: number, row: T) => {\n const trackBy = this.trackBy();\n if (typeof trackBy === 'string') return row[trackBy];\n if (typeof trackBy === 'function') return trackBy(index, row);\n return this.dataSource().data.indexOf(row);\n };\n\n protected isActiveRow = (row: T) => {\n const activeRow = this.activeRow();\n const activeRowComparator = this.activeRowComparator();\n if (!activeRow) return false;\n return activeRowComparator ? activeRowComparator(row, activeRow) : row === activeRow;\n };\n\n protected getRowClass = (row: T): string => {\n const rowClass = this.rowClass();\n if (!rowClass) return '';\n const result = rowClass(row);\n return Array.isArray(result) ? result.join(' ') : result;\n };\n\n protected onRowClick = (row: T) => {\n if (this.disabled() || window.getSelection()?.toString() !== '') return;\n if (this.isExpandable()) {\n this.expanded.update((rows) =>\n rows.includes(row) ? rows.filter((r) => r != row) : [...rows, row]\n );\n }\n\n this.rowClick$.next(row);\n };\n\n constructor() {\n effect(() => {\n const dataSource = this.dataSource();\n dataSource.sort = this.sort();\n if (!(dataSource instanceof WattTableDataSource)) return;\n dataSource.sortingDataAccessor = (row: T, sortHeaderId: string) => {\n const column = this.columns()[sortHeaderId];\n const value = this.getCellData(column, row);\n if (typeof value === 'string') return value.toLowerCase(); // case insensitive sorting\n if (value instanceof Date) return value.getTime();\n return value as number;\n };\n });\n }\n\n /**\n * Clears the selection, emitting `selectionChange` if `selection` was not empty.\n */\n clearSelection = () => this.selection.update((s) => (!s.length ? s : []));\n\n /**\n * Toggles the selection of a row.\n */\n toggleSelection = (row: T) =>\n this.selection.update((s) => (s.includes(row) ? s.filter((r) => r !== row) : s.concat(row)));\n}\n\nexport const WATT_TABLE = [WattTableComponent, WattTableCellDirective, WattTableToolbarDirective];\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': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [ngClass]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n '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=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n"]}
1
+ {"version":3,"file":"watt-table.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/table/watt-table.component.ts","../../../../libs/watt/package/table/watt-table.component.html"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EAAY,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,SAAS,EACT,MAAM,EAEN,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,EACN,WAAW,EACX,SAAS,EACT,YAAY,EACZ,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,aAAa,EAAuB,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAwB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;;;;;AAEvE,uCAAuC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,6BAA6B,CA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,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,kBAAkB,EAAE,sBAAsB,EAAE,yBAAyB,CAAC,CAAC","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 { KeyValue, KeyValuePipe, NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n contentChild,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n TemplateRef,\n viewChild,\n viewChildren,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { Signal, TrackByFunction } from '@angular/core';\nimport { outputFromObservable } 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 { Subject } from 'rxjs';\n\nimport { WattCheckboxComponent } from '@energinet/watt/checkbox';\nimport { wattFormatDate } from '@energinet/watt/core/date';\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { IWattTableDataSource, WattTableDataSource } from './watt-table-data-source';\nimport { animateExpandableCells } from './watt-table-expand-animation';\n\n/** Class name for expandable cells. */\nexport const EXPANDABLE_CLASS = 'watt-table-cell--expandable';\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 * When `true`, the cell is replaced with an expandable arrow and the content is deferred.\n * Clicking on the arrow reveals the content below the current row.\n *\n * @remarks\n * It is recommended to provide a custom `trackBy` function when using `expandable`,\n * otherwise animations can be inaccurate when data is changed.\n */\n expandable?: boolean;\n\n /**\n * Tooltip text to show on hover of the header cell.\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 index: number;\n}\n\ninterface WattTableToolbarContext<T> {\n $implicit: T;\n}\n\n@Directive({\n selector: '[wattTableCell]',\n})\nexport class WattTableCellDirective<T> {\n templateRef = inject(TemplateRef<WattTableCellContext<T>>);\n\n /**\n * The WattTableColumn this template applies to.\n */\n readonly column = input.required<WattTableColumn<T>>({ alias: 'wattTableCell' });\n\n /**\n * Optional header text for the column.\n */\n readonly header = input<string>(undefined, { alias: 'wattTableCellHeader' });\n\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/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 encapsulation: ViewEncapsulation.None,\n selector: 'watt-table',\n styleUrls: ['./watt-table.component.scss'],\n templateUrl: './watt-table.component.html',\n host: {\n '[class.watt-table-variant-zebra]': 'variant() === \"zebra\"',\n '[style.--watt-table-grid-template-columns]': 'sizing().join(\" \")',\n },\n})\nexport class WattTableComponent<T> {\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 readonly dataSource = input.required<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 readonly columns = input<WattTableColumnDef<T>>({});\n\n /**\n * Used for hiding or reordering columns defined in the `columns` input.\n */\n readonly displayedColumns = input<string[]>();\n\n /**\n * Used for disabling the table. This will disable all user interaction\n */\n readonly disabled = input(false);\n\n /**\n * Provide a description of the table for visually impaired users.\n */\n readonly description = input('');\n\n /**\n * If set to `true`, the table will show a loading indicator\n * when there is no data.\n */\n readonly loading = input(false);\n\n /**\n * If true the footer will be sticky\n */\n readonly stickyFooter = input(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 readonly resolveHeader = input<(key: string) => string>();\n\n /**\n * Identifier for column that should be sorted initially.\n */\n readonly sortBy = input('');\n\n /**\n * The sort direction of the initially sorted column.\n */\n readonly sortDirection = input<SortDirection>('');\n\n /**\n * Whether to allow the user to clear the sort. Defaults to `true`.\n */\n readonly sortClear = input(true);\n\n /**\n * Optional function to determine CSS class(es) for each row.\n */\n readonly rowClass = input<(row: T) => string | string[]>();\n\n /**\n * Whether the table should include a checkbox column for row selection.\n */\n readonly selectable = input(false);\n\n /**\n * Sets the selected rows. Only applicable when selectable is `true`.\n */\n readonly selection = model<T[]>([]);\n\n /**\n * Set to true to disable row hover highlight.\n */\n readonly suppressRowHoverHighlight = input(false);\n\n /**\n * Highlights the currently active row.\n */\n readonly activeRow = input<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 readonly activeRowComparator = input<(currentRow: T, activeRow: T) => boolean>();\n\n /**\n * If set to `true`, the column headers will not be shown. Default is `false`.\n */\n readonly hideColumnHeaders = input(false);\n\n /**\n * Choose from a predefined set of display variants.\n */\n readonly variant = input<'zebra'>();\n\n /**\n * Array of rows that are currently expanded.\n */\n readonly expanded = model<T[]>([]);\n\n /**\n * Optional function for uniquely identifying rows.\n */\n readonly trackBy = input<TrackByFunction<T> | keyof T>();\n\n /**\n * @ignore\n * The `observed` boolean from the `Subject` is used to determine if a row is\n * clickable or not. This is available on `EventEmitter`, but not on `output`,\n * which is why this workaround is used.\n */\n protected rowClick$ = new Subject<T>();\n\n /**\n * Emits whenever a row is clicked.\n */\n readonly rowClick = outputFromObservable(this.rowClick$);\n\n /**\n * Event emitted when the user changes the active sort or sort direction.\n */\n readonly sortChange = output<Sort>();\n\n // Queries\n protected cells = contentChildren(WattTableCellDirective<T>);\n protected toolbar = contentChild(WattTableToolbarDirective<T>);\n protected sort = viewChild(MatSort);\n\n // Enables animation for expanding/collapsing cells\n protected tableCellElements = viewChildren<ElementRef<HTMLTableCellElement>>('td');\n protected animationEffect = animateExpandableCells(this.tableCellElements, this.expanded);\n\n // Selectable\n protected filterSelectionBy = (rows: T[]) => rows.filter((row) => this.selection().includes(row));\n protected getSelectionState = () => {\n const filteredData = this.dataSource().filteredData;\n const filteredSelection = this.filterSelectionBy(filteredData);\n if (!filteredSelection.length) return false;\n return filteredSelection.length === this.dataSource().filteredData.length ? true : null;\n };\n\n // Unique names for special columns\n protected checkboxColumn = '__checkboxColumn__';\n protected expandableColumn = '__expandableColumn__';\n\n protected hasFooter = computed(() => Object.values(this.columns()).some((c) => c.footer));\n protected isExpandable = computed(() => Object.values(this.columns()).some((c) => c.expandable));\n protected renderedColumns = computed(() => {\n const columns = this.displayedColumns() ?? Object.keys(this.columns());\n return [\n ...(this.selectable() ? [this.checkboxColumn] : []),\n ...columns.filter((key) => !this.columns()[key].expandable),\n ...(this.isExpandable() ? [this.expandableColumn] : []),\n ...columns.filter((key) => this.columns()[key].expandable),\n ];\n });\n\n protected sizing = computed(() => {\n const columns = this.columns();\n return this.renderedColumns()\n .filter((key) => !columns[key]?.expandable)\n .map((key) => {\n switch (key) {\n case this.checkboxColumn:\n return 'var(--watt-space-xl)';\n case this.expandableColumn:\n return 'min-content';\n default:\n return columns[key]?.size ?? 'auto';\n }\n });\n });\n\n /** Try to get cell data for a specific `column` and `row`. */\n private getCellData = (column: WattTableColumn<T>, row: T) => {\n if (column.cell) return column.cell(row);\n return !column.accessor\n ? ''\n : typeof column.accessor === 'function'\n ? column.accessor(row)\n : row[column.accessor];\n };\n\n protected getColumnTemplate = (column: WattTableColumn<T>) =>\n this.cells().find((item) => item.column() === column)?.templateRef;\n\n protected 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 protected getColumnCell = (column: WattTableColumn<T>, row: T) => {\n const cell = this.getCellData(column, row);\n if (cell === undefined || cell === null) return '—';\n if (cell instanceof Date) return wattFormatDate(cell);\n return cell;\n };\n\n protected getRowKey = (index: number, row: T) => {\n const trackBy = this.trackBy();\n if (typeof trackBy === 'string') return row[trackBy];\n if (typeof trackBy === 'function') return trackBy(index, row);\n return this.dataSource().data.indexOf(row);\n };\n\n protected isActiveRow = (row: T) => {\n const activeRow = this.activeRow();\n const activeRowComparator = this.activeRowComparator();\n if (!activeRow) return false;\n return activeRowComparator ? activeRowComparator(row, activeRow) : row === activeRow;\n };\n\n protected getRowClass = (row: T): string => {\n const rowClass = this.rowClass();\n if (!rowClass) return '';\n const result = rowClass(row);\n return Array.isArray(result) ? result.join(' ') : result;\n };\n\n protected onRowClick = (row: T) => {\n if (this.disabled() || window.getSelection()?.toString() !== '') return;\n if (this.isExpandable()) {\n this.expanded.update((rows) =>\n rows.includes(row) ? rows.filter((r) => r != row) : [...rows, row]\n );\n }\n\n this.rowClick$.next(row);\n };\n\n constructor() {\n effect(() => {\n const dataSource = this.dataSource();\n dataSource.sort = this.sort();\n if (!(dataSource instanceof WattTableDataSource)) return;\n dataSource.sortingDataAccessor = (row: T, sortHeaderId: string) => {\n const column = this.columns()[sortHeaderId];\n const value = this.getCellData(column, row);\n if (typeof value === 'string') return value.toLowerCase(); // case insensitive sorting\n if (value instanceof Date) return value.getTime();\n return value as number;\n };\n });\n }\n\n /**\n * Clears the selection, emitting `selectionChange` if `selection` was not empty.\n */\n clearSelection = () => this.selection.update((s) => (!s.length ? s : []));\n\n /**\n * Toggles the selection of a row.\n */\n toggleSelection = (row: T) =>\n this.selection.update((s) => (s.includes(row) ? s.filter((r) => r !== row) : s.concat(row)));\n}\n\nexport const WATT_TABLE = [WattTableComponent, WattTableCellDirective, WattTableToolbarDirective];\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': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [ngClass]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n }\"\n ></tr>\n\n @if (toolbar()) {\n <tr mat-footer-row *matFooterRowDef=\"['spacer']\"></tr>\n }\n\n @if (hasFooter()) {\n <tr\n mat-footer-row\n [class.watt-table-hide-footer]=\"loading() || dataSource().filteredData.length === 0\"\n *matFooterRowDef=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n"]}
@@ -5,7 +5,7 @@ export type WattIconSize = 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
5
5
  export type WattIconState = 'default' | 'success' | 'danger' | 'warning' | 'info';
6
6
  export declare class WattIconComponent {
7
7
  /** Name of an icon within the font set. */
8
- name: import("@angular/core").InputSignal<"search" | "remove" | "edit" | "redo" | "undo" | "close" | "cancel" | "settings" | "email" | "link" | "payments" | "forward" | "menu" | "logout" | "help" | "refresh" | "language" | "info" | "feedback" | "download" | "upload" | "print" | "preview" | "power" | "notifications" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | "success" | "danger" | "warning" | "filter" | "plus" | "minus" | "removeForever" | "checkmark" | "user" | "contentCopy" | "date" | "time" | "markEmailUnread" | "openInNew" | "monetization" | "forwardMessage" | "moreVertical" | "login" | "alternateEmail" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "save" | "fileDownload" | "fileUpload" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | undefined>;
8
+ name: import("@angular/core").InputSignal<"search" | "remove" | "edit" | "redo" | "undo" | "close" | "cancel" | "settings" | "email" | "link" | "payments" | "forward" | "menu" | "logout" | "help" | "refresh" | "language" | "send" | "info" | "feedback" | "download" | "upload" | "print" | "preview" | "power" | "notifications" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | "success" | "danger" | "warning" | "filter" | "plus" | "minus" | "removeForever" | "checkmark" | "user" | "contentCopy" | "date" | "time" | "markEmailUnread" | "openInNew" | "monetization" | "forwardMessage" | "moreVertical" | "login" | "alternateEmail" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "save" | "fileDownload" | "fileUpload" | "attachFile" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | undefined>;
9
9
  /** Accessible label for the icon. */
10
10
  label: import("@angular/core").InputSignal<string | undefined>;
11
11
  /** Size of the icon. */
package/icon/icons.d.ts CHANGED
@@ -52,6 +52,7 @@ export declare const WattIconMap: {
52
52
  toggleOn: string;
53
53
  toggleOff: string;
54
54
  personCheck: string;
55
+ send: string;
55
56
  left: string;
56
57
  right: string;
57
58
  up: string;
@@ -71,6 +72,7 @@ export declare const WattIconMap: {
71
72
  fileUpload: string;
72
73
  print: string;
73
74
  preview: string;
75
+ attachFile: string;
74
76
  power: string;
75
77
  location: string;
76
78
  smartDisplay: string;
@@ -49,7 +49,7 @@ export declare class WattModalComponent {
49
49
  /** Whether the dialog should restore focus to the previously-focused element, after it's closed. */
50
50
  restoreFocus: import("@angular/core").InputSignal<boolean>;
51
51
  /** Icon displayed next to the modal title. */
52
- titleIcon: import("@angular/core").InputSignal<"filter" | "close" | "link" | "menu" | "search" | "time" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "email" | "markEmailUnread" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | undefined>;
52
+ titleIcon: import("@angular/core").InputSignal<"filter" | "close" | "link" | "menu" | "search" | "time" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "email" | "markEmailUnread" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "send" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "attachFile" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | undefined>;
53
53
  /** Whether the modal should open automatically when rendered. */
54
54
  autoOpen: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
55
55
  closed: import("@angular/core").OutputEmitterRef<boolean>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@energinet/watt",
4
- "version": "4.2.14",
4
+ "version": "4.2.15",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  ".": {
@@ -179,14 +179,14 @@
179
179
  "types": "./validators/index.d.ts",
180
180
  "default": "./fesm2022/energinet-watt-validators.mjs"
181
181
  },
182
- "./vater": {
183
- "types": "./vater/index.d.ts",
184
- "default": "./fesm2022/energinet-watt-vater.mjs"
185
- },
186
182
  "./year-field": {
187
183
  "types": "./year-field/index.d.ts",
188
184
  "default": "./fesm2022/energinet-watt-year-field.mjs"
189
185
  },
186
+ "./vater": {
187
+ "types": "./vater/index.d.ts",
188
+ "default": "./fesm2022/energinet-watt-vater.mjs"
189
+ },
190
190
  "./yearmonth-field": {
191
191
  "types": "./yearmonth-field/index.d.ts",
192
192
  "default": "./fesm2022/energinet-watt-yearmonth-field.mjs"
@@ -25,7 +25,7 @@ export declare class WattTextFieldComponent implements ControlValueAccessor, Aft
25
25
  placeholder: import("@angular/core").InputSignal<string>;
26
26
  label: import("@angular/core").InputSignal<string>;
27
27
  tooltip: import("@angular/core").InputSignal<string>;
28
- prefix: import("@angular/core").InputSignal<"email" | "filter" | "search" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | undefined>;
28
+ prefix: import("@angular/core").InputSignal<"email" | "filter" | "search" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "send" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "attachFile" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | undefined>;
29
29
  size: import("@angular/core").InputSignal<string | number | null>;
30
30
  maxLength: import("@angular/core").InputSignal<string | number | null>;
31
31
  formControl: import("@angular/core").InputSignal<FormControl<any>>;
@@ -29,7 +29,7 @@ export declare class WattValidationMessageComponent implements AfterViewInit {
29
29
  private elementRef;
30
30
  label: import("@angular/core").InputSignal<string>;
31
31
  message: import("@angular/core").InputSignal<string>;
32
- icon: import("@angular/core").InputSignal<"info" | "warning" | "success" | "danger" | "search" | "filter" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "email" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | undefined>;
32
+ icon: import("@angular/core").InputSignal<"info" | "warning" | "success" | "danger" | "search" | "filter" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "email" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "forward" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "send" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "fileUpload" | "print" | "preview" | "attachFile" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "factory" | "nest_eco_leaf" | "flash_on" | undefined>;
33
33
  type: import("@angular/core").InputSignal<WattValidationMessageType>;
34
34
  size: import("@angular/core").InputSignal<WattValidationMessageSize>;
35
35
  autoScrollIntoView: import("@angular/core").InputSignal<boolean>;