@energinet/watt 2.0.0 → 2.0.2

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.
@@ -21,12 +21,9 @@
21
21
  [vater-stack] {
22
22
  align-items: center;
23
23
 
24
- &.vater-column > * {
25
- min-height: min-content;
26
- }
27
-
28
- &.vater-row > * {
29
- min-width: min-content;
24
+ & > * {
25
+ min-height: max-content;
26
+ min-width: max-content;
30
27
  }
31
28
  }
32
29
 
@@ -8,7 +8,7 @@ import * as i1 from "@angular/common";
8
8
  declare class WattDescriptionListComponent<T> {
9
9
  private ngClass;
10
10
  descriptionItems: import("@angular/core").Signal<readonly WattDescriptionListItemComponent<T>[]>;
11
- variant: import("@angular/core").InputSignal<"flow" | "stack">;
11
+ variant: import("@angular/core").InputSignal<"flow" | "stack" | "compact">;
12
12
  descriptionVariant: import("@angular/core").Signal<string>;
13
13
  groupsPerRow: import("@angular/core").InputSignal<number>;
14
14
  itemSeparators: import("@angular/core").InputSignal<boolean>;
@@ -178,19 +178,23 @@ class WattDataTableComponent {
178
178
  @if (
179
179
  enableEmptyState() && !table().loading && table().dataSource.filteredData.length === 0
180
180
  ) {
181
- <div class="watt-data-table--empty-state">
182
- <watt-empty-state
183
- [icon]="error() ? 'custom-power' : ready() ? emptyStateIcon() : 'custom-explore'"
184
- [title]="error() ? intl.errorTitle : ready() ? intl.emptyTitle : intl.defaultTitle"
185
- [message]="error() ? intl.errorText : ready() ? intl.emptyText : intl.defaultText"
186
- >
187
- @if (enableRetry()) {
188
- <watt-button variant="secondary" (click)="retry.emit()">{{
189
- intl.emptyRetry
190
- }}</watt-button>
191
- }
192
- </watt-empty-state>
193
- </div>
181
+ <vater-flex [autoSize]="autoSize()" fill="vertical">
182
+ <vater-stack scrollable justify="center">
183
+ <watt-empty-state
184
+ [icon]="error() ? 'custom-power' : ready() ? emptyStateIcon() : 'custom-explore'"
185
+ [title]="
186
+ error() ? intl.errorTitle : ready() ? intl.emptyTitle : intl.defaultTitle
187
+ "
188
+ [message]="error() ? intl.errorText : ready() ? intl.emptyText : intl.defaultText"
189
+ >
190
+ @if (enableRetry()) {
191
+ <watt-button variant="secondary" (click)="retry.emit()">{{
192
+ intl.emptyRetry
193
+ }}</watt-button>
194
+ }
195
+ </watt-empty-state>
196
+ </vater-stack>
197
+ </vater-flex>
194
198
  }
195
199
  </vater-flex>
196
200
  @if (enablePaginator()) {
@@ -202,7 +206,7 @@ class WattDataTableComponent {
202
206
  }
203
207
  </vater-flex>
204
208
  </watt-card>
205
- `, isInline: true, styles: [":root{--watt-data-table-empty-state-margin: auto}watt-data-table h3,watt-data-table h4{line-height:44px;min-height:44px;margin:0}watt-data-table watt-data-filters{min-height:44px}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--empty-state{margin-bottom:var(--watt-space-m);overflow:auto}.watt-data-table--empty-state>watt-empty-state{margin:var(--watt-data-table-empty-state-margin)}\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"], outputs: ["search"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }], encapsulation: i0.ViewEncapsulation.None });
209
+ `, 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"], outputs: ["search"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }], encapsulation: i0.ViewEncapsulation.None });
206
210
  }
207
211
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDataTableComponent, decorators: [{
208
212
  type: Component,
@@ -244,19 +248,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
244
248
  @if (
245
249
  enableEmptyState() && !table().loading && table().dataSource.filteredData.length === 0
246
250
  ) {
247
- <div class="watt-data-table--empty-state">
248
- <watt-empty-state
249
- [icon]="error() ? 'custom-power' : ready() ? emptyStateIcon() : 'custom-explore'"
250
- [title]="error() ? intl.errorTitle : ready() ? intl.emptyTitle : intl.defaultTitle"
251
- [message]="error() ? intl.errorText : ready() ? intl.emptyText : intl.defaultText"
252
- >
253
- @if (enableRetry()) {
254
- <watt-button variant="secondary" (click)="retry.emit()">{{
255
- intl.emptyRetry
256
- }}</watt-button>
257
- }
258
- </watt-empty-state>
259
- </div>
251
+ <vater-flex [autoSize]="autoSize()" fill="vertical">
252
+ <vater-stack scrollable justify="center">
253
+ <watt-empty-state
254
+ [icon]="error() ? 'custom-power' : ready() ? emptyStateIcon() : 'custom-explore'"
255
+ [title]="
256
+ error() ? intl.errorTitle : ready() ? intl.emptyTitle : intl.defaultTitle
257
+ "
258
+ [message]="error() ? intl.errorText : ready() ? intl.emptyText : intl.defaultText"
259
+ >
260
+ @if (enableRetry()) {
261
+ <watt-button variant="secondary" (click)="retry.emit()">{{
262
+ intl.emptyRetry
263
+ }}</watt-button>
264
+ }
265
+ </watt-empty-state>
266
+ </vater-stack>
267
+ </vater-flex>
260
268
  }
261
269
  </vater-flex>
262
270
  @if (enablePaginator()) {
@@ -268,7 +276,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
268
276
  }
269
277
  </vater-flex>
270
278
  </watt-card>
271
- `, styles: [":root{--watt-data-table-empty-state-margin: auto}watt-data-table h3,watt-data-table h4{line-height:44px;min-height:44px;margin:0}watt-data-table watt-data-filters{min-height:44px}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--empty-state{margin-bottom:var(--watt-space-m);overflow:auto}.watt-data-table--empty-state>watt-empty-state{margin:var(--watt-data-table-empty-state-margin)}\n"] }]
279
+ `, 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"] }]
272
280
  }] });
273
281
 
274
282
  //#region License
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-data.mjs","sources":["../../../libs/watt/package/data/watt-data-filters.component.ts","../../../libs/watt/package/data/watt-data-actions.component.ts","../../../libs/watt/package/data/watt-data-intl.service.ts","../../../libs/watt/package/data/watt-data-table.component.ts","../../../libs/watt/package/data/index.ts","../../../libs/watt/package/data/energinet-watt-data.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-data-filters',\n template: `<ng-content />`,\n})\nexport class WattDataFiltersComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-data-actions',\n template: `<ng-content />`,\n})\nexport class WattDataActionsComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattDataIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n search = 'Search';\n emptyTitle = 'No results found';\n emptyText = 'Try changing the search criteria.';\n emptyRetry = 'Retry';\n errorTitle = 'An unexpected error occured';\n errorText = 'Unfortunately, an error occurred while retrieving the necessary information.';\n defaultTitle = 'An unexpected error occured';\n defaultText = 'Unfortunately, an error occurred while retrieving the necessary information.';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Component,\n 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 :root {\n --watt-data-table-empty-state-margin: auto;\n }\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-data-filters {\n min-height: 44px;\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--empty-state {\n margin-bottom: var(--watt-space-m);\n overflow: auto;\n\n & > watt-empty-state {\n margin: var(--watt-data-table-empty-state-margin);\n }\n }\n `,\n ],\n template: `\n <watt-card vater fill=\"vertical\" [variant]=\"variant()\">\n <vater-flex autoSize fill=\"vertical\" gap=\"m\">\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\">{{ count() ?? table().dataSource.totalCount }}</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 [label]=\"searchLabel() ?? intl.search\" (search)=\"onSearch($event)\" />\n }\n <ng-content select=\"watt-data-actions\" />\n <ng-content select=\"watt-button\" />\n </vater-stack>\n <ng-content select=\"watt-data-filters\" />\n <vater-flex [autoSize]=\"autoSize()\" fill=\"vertical\">\n <ng-content select=\"watt-table\" />\n @if (\n enableEmptyState() && !table().loading && table().dataSource.filteredData.length === 0\n ) {\n <div class=\"watt-data-table--empty-state\">\n <watt-empty-state\n [icon]=\"error() ? 'custom-power' : ready() ? emptyStateIcon() : 'custom-explore'\"\n [title]=\"error() ? intl.errorTitle : ready() ? intl.emptyTitle : intl.defaultTitle\"\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 </div>\n }\n </vater-flex>\n @if (enablePaginator()) {\n <watt-paginator\n [for]=\"table().dataSource\"\n [length]=\"count() ?? 0\"\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 enableRetry = input(false);\n enableCount = input(true);\n enableEmptyState = input(true);\n queryTime = input<number>();\n searchLabel = input<string>();\n enablePaginator = input(true);\n count = input<number>();\n autoSize = input(false);\n variant = input<WATT_CARD_VARIANT>('elevation');\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","//#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 { WattDataFiltersComponent } from './watt-data-filters.component';\nexport { WattDataActionsComponent } from './watt-data-actions.component';\nexport { WattDataIntlService } from './watt-data-intl.service';\nexport { WattDataTableComponent } from './watt-data-table.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAOa,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,6EAFzB,CAAgB,cAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEf,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,QAAQ,EAAE,CAAgB,cAAA,CAAA;AAC3B,iBAAA;;;ACvBD;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAOa,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,6EAFzB,CAAgB,cAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEf,wBAAwB,EAAA,UAAA,EAAA,CA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,MAAA,EAAA,CAAA,MAAA,EAAA,SAAA,EAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FA6FV,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAxGlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAClB,OAAA,EAAA;wBACP,kBAAkB;wBAClB,oBAAoB;wBACpB,mBAAmB;wBACnB,qBAAqB;wBACrB,iBAAiB;wBACjB,uBAAuB;wBACvB,sBAAsB;wBACtB,mBAAmB;wBACnB,mBAAmB;qBACpB,EACc,aAAA,EAAA,iBAAiB,CAAC,IAAI,EAqC3B,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,ijBAAA,CAAA,EAAA;;;ACnJH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-data.mjs","sources":["../../../libs/watt/package/data/watt-data-filters.component.ts","../../../libs/watt/package/data/watt-data-actions.component.ts","../../../libs/watt/package/data/watt-data-intl.service.ts","../../../libs/watt/package/data/watt-data-table.component.ts","../../../libs/watt/package/data/index.ts","../../../libs/watt/package/data/energinet-watt-data.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-data-filters',\n template: `<ng-content />`,\n})\nexport class WattDataFiltersComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-data-actions',\n template: `<ng-content />`,\n})\nexport class WattDataActionsComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattDataIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n search = 'Search';\n emptyTitle = 'No results found';\n emptyText = 'Try changing the search criteria.';\n emptyRetry = 'Retry';\n errorTitle = 'An unexpected error occured';\n errorText = 'Unfortunately, an error occurred while retrieving the necessary information.';\n defaultTitle = 'An unexpected error occured';\n defaultText = 'Unfortunately, an error occurred while retrieving the necessary information.';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Component,\n 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 <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\">{{ count() ?? table().dataSource.totalCount }}</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 [label]=\"searchLabel() ?? intl.search\" (search)=\"onSearch($event)\" />\n }\n <ng-content select=\"watt-data-actions\" />\n <ng-content select=\"watt-button\" />\n </vater-stack>\n <ng-content select=\"watt-data-filters\" />\n <vater-flex [autoSize]=\"autoSize()\" fill=\"vertical\">\n <ng-content select=\"watt-table\" />\n @if (\n enableEmptyState() && !table().loading && 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 (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 enableRetry = input(false);\n enableCount = input(true);\n enableEmptyState = input(true);\n queryTime = input<number>();\n searchLabel = input<string>();\n enablePaginator = input(true);\n count = input<number>();\n autoSize = input(false);\n variant = input<WATT_CARD_VARIANT>('elevation');\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","//#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 { WattDataFiltersComponent } from './watt-data-filters.component';\nexport { WattDataActionsComponent } from './watt-data-actions.component';\nexport { WattDataIntlService } from './watt-data-intl.service';\nexport { WattDataTableComponent } from './watt-data-table.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAOa,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,6EAFzB,CAAgB,cAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEf,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QA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(item of descriptionItems(); track item) {
90
90
  <ng-container *ngTemplateOutlet="item.templateRef()" />
91
91
  }
92
- </dl>`, isInline: true, styles: ["watt-description-list{display:block}watt-description-list.watt-description-list-flow dl{display:grid;gap:var(--watt-space-ml);grid-template-columns:repeat(var(--watt-description-list-groups-per-row, 3),1fr)}watt-description-list.watt-description-list-flow dl dd{margin:0}watt-description-list.watt-description-list-flow dl .force-new-row{grid-column-start:1}watt-description-list.watt-description-list-stack dl{display:grid;gap:var(--watt-space-m);grid-template-columns:1fr}watt-description-list.watt-description-list-stack dl dd{margin:0;flex:1}watt-description-list.watt-description-list-stack dl dt{width:240px}watt-description-list.watt-description-list-stack dl div{display:flex;align-items:baseline}watt-description-list.watt-description-list-stack.item-separators dl div{border-bottom:1px solid var(--watt-color-neutral-grey-300);padding-bottom:var(--watt-space-m)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None });
92
+ </dl>`, isInline: true, styles: ["watt-description-list{display:block}watt-description-list.watt-description-list-flow dl{display:grid;gap:var(--watt-space-ml);grid-template-columns:repeat(var(--watt-description-list-groups-per-row, 3),1fr)}watt-description-list.watt-description-list-flow dl dd{margin:0}watt-description-list.watt-description-list-flow dl .force-new-row{grid-column-start:1}watt-description-list.watt-description-list-stack dl{display:grid;gap:var(--watt-space-m);grid-template-columns:1fr}watt-description-list.watt-description-list-stack dl dd{margin:0;flex:1}watt-description-list.watt-description-list-stack dl dt{width:240px}watt-description-list.watt-description-list-stack dl div{display:flex;align-items:baseline}watt-description-list.watt-description-list-stack.item-separators dl div{border-bottom:1px solid var(--watt-color-neutral-grey-300);padding-bottom:var(--watt-space-m)}watt-description-list.watt-description-list-compact dl{display:grid;gap:var(--watt-space-m) var(--watt-space-l);grid-template-columns:max-content max-content}watt-description-list.watt-description-list-compact dl dd{margin:0}watt-description-list.watt-description-list-compact dl div{display:contents}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None });
93
93
  }
94
94
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDescriptionListComponent, decorators: [{
95
95
  type: Component,
@@ -100,7 +100,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
100
100
  </dl>`, hostDirectives: [NgClass], host: {
101
101
  '[style.--watt-description-list-groups-per-row]': 'groupsPerRow()',
102
102
  '[class]': 'descriptionVariant()',
103
- }, styles: ["watt-description-list{display:block}watt-description-list.watt-description-list-flow dl{display:grid;gap:var(--watt-space-ml);grid-template-columns:repeat(var(--watt-description-list-groups-per-row, 3),1fr)}watt-description-list.watt-description-list-flow dl dd{margin:0}watt-description-list.watt-description-list-flow dl .force-new-row{grid-column-start:1}watt-description-list.watt-description-list-stack dl{display:grid;gap:var(--watt-space-m);grid-template-columns:1fr}watt-description-list.watt-description-list-stack dl dd{margin:0;flex:1}watt-description-list.watt-description-list-stack dl dt{width:240px}watt-description-list.watt-description-list-stack dl div{display:flex;align-items:baseline}watt-description-list.watt-description-list-stack.item-separators dl div{border-bottom:1px solid var(--watt-color-neutral-grey-300);padding-bottom:var(--watt-space-m)}\n"] }]
103
+ }, styles: ["watt-description-list{display:block}watt-description-list.watt-description-list-flow dl{display:grid;gap:var(--watt-space-ml);grid-template-columns:repeat(var(--watt-description-list-groups-per-row, 3),1fr)}watt-description-list.watt-description-list-flow dl dd{margin:0}watt-description-list.watt-description-list-flow dl .force-new-row{grid-column-start:1}watt-description-list.watt-description-list-stack dl{display:grid;gap:var(--watt-space-m);grid-template-columns:1fr}watt-description-list.watt-description-list-stack dl dd{margin:0;flex:1}watt-description-list.watt-description-list-stack dl dt{width:240px}watt-description-list.watt-description-list-stack dl div{display:flex;align-items:baseline}watt-description-list.watt-description-list-stack.item-separators dl div{border-bottom:1px solid var(--watt-color-neutral-grey-300);padding-bottom:var(--watt-space-m)}watt-description-list.watt-description-list-compact dl{display:grid;gap:var(--watt-space-m) var(--watt-space-l);grid-template-columns:max-content max-content}watt-description-list.watt-description-list-compact dl dd{margin:0}watt-description-list.watt-description-list-compact dl div{display:contents}\n"] }]
104
104
  }], ctorParameters: () => [] });
105
105
 
106
106
  //#region License
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-description-list.mjs","sources":["../../../libs/watt/package/description-list/watt-description-list-item.component.ts","../../../libs/watt/package/description-list/watt-description-list.component.ts","../../../libs/watt/package/description-list/index.ts","../../../libs/watt/package/description-list/energinet-watt-description-list.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { ChangeDetectionStrategy, Component, input, TemplateRef, viewChild } from '@angular/core';\nimport { NgClass } from '@angular/common';\n\n@Component({\n imports: [NgClass],\n selector: 'watt-description-list-item',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [NgClass],\n template: `<ng-template #templateRef\n ><div [ngClass]=\"{ 'force-new-row': forceNewRow() }\">\n <dt class=\"watt-label watt-on-light--high-emphasis\">{{ label() }}</dt>\n <dd class=\"watt-text-s\">{{ value() }}<ng-content /></dd></div\n ></ng-template>`,\n})\nexport class WattDescriptionListItemComponent<T> {\n templateRef = viewChild.required<TemplateRef<unknown | null>>('templateRef');\n label = input<string>('');\n value = input<T | null>(null);\n forceNewRow = input(false);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n contentChildren,\n effect,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { WattDescriptionListItemComponent } from './watt-description-list-item.component';\n/**\n * Usage:\n * `import { WattDescriptionListComponent } from '@energinet-datahub/watt/description-list';`\n */\n@Component({\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-description-list',\n styleUrls: ['./watt-description-list.component.scss'],\n imports: [NgTemplateOutlet],\n template: `<dl>\n @for (item of descriptionItems(); track item) {\n <ng-container *ngTemplateOutlet=\"item.templateRef()\" />\n }\n </dl>`,\n hostDirectives: [NgClass],\n host: {\n '[style.--watt-description-list-groups-per-row]': 'groupsPerRow()',\n '[class]': 'descriptionVariant()',\n },\n})\nclass WattDescriptionListComponent<T> {\n private ngClass = inject(NgClass);\n descriptionItems = contentChildren(WattDescriptionListItemComponent<T>);\n variant = input<'flow' | 'stack'>('flow');\n descriptionVariant = computed(() => `watt-description-list-${this.variant()}`);\n groupsPerRow = input<number>(3);\n itemSeparators = input(true);\n\n constructor() {\n effect(() => {\n this.ngClass.ngClass = {\n [`item-separators`]: this.itemSeparators(),\n };\n });\n }\n}\n\nexport { WattDescriptionListItemComponent, WattDescriptionListComponent };\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport {\n WattDescriptionListComponent,\n WattDescriptionListItemComponent,\n} from './watt-description-list.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,gCAAgC,CAAA;AAC3C,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAA8B,aAAa,CAAC;AAC5E,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC;AACzB,IAAA,KAAK,GAAG,KAAK,CAAW,IAAI,CAAC;AAC7B,IAAA,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC;uGAJf,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gCAAgC,EANjC,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EA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,EAAA,SAAA,GAAA,gCAAmC,CAAA,EAb5D,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,OAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;AAIJ,OAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,42BAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EALI,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAYtB,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBAhBjC,SAAS;oCACO,iBAAiB,CAAC,IAAI,EAC3B,QAAA,EAAA,uBAAuB,WAExB,CAAC,gBAAgB,CAAC,EACjB,QAAA,EAAA,CAAA;;;;QAIJ,EACU,cAAA,EAAA,CAAC,OAAO,CAAC,EACnB,IAAA,EAAA;AACJ,wBAAA,gDAAgD,EAAE,gBAAgB;AAClE,wBAAA,SAAS,EAAE,sBAAsB;AAClC,qBAAA,EAAA,MAAA,EAAA,CAAA,42BAAA,CAAA,EAAA;;;AChDH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-description-list.mjs","sources":["../../../libs/watt/package/description-list/watt-description-list-item.component.ts","../../../libs/watt/package/description-list/watt-description-list.component.ts","../../../libs/watt/package/description-list/index.ts","../../../libs/watt/package/description-list/energinet-watt-description-list.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { ChangeDetectionStrategy, Component, input, TemplateRef, viewChild } from '@angular/core';\nimport { NgClass } from '@angular/common';\n\n@Component({\n imports: [NgClass],\n selector: 'watt-description-list-item',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [NgClass],\n template: `<ng-template #templateRef\n ><div [ngClass]=\"{ 'force-new-row': forceNewRow() }\">\n <dt class=\"watt-label watt-on-light--high-emphasis\">{{ label() }}</dt>\n <dd class=\"watt-text-s\">{{ value() }}<ng-content /></dd></div\n ></ng-template>`,\n})\nexport class WattDescriptionListItemComponent<T> {\n templateRef = viewChild.required<TemplateRef<unknown | null>>('templateRef');\n label = input<string>('');\n value = input<T | null>(null);\n forceNewRow = input(false);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n contentChildren,\n effect,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { WattDescriptionListItemComponent } from './watt-description-list-item.component';\n/**\n * Usage:\n * `import { WattDescriptionListComponent } from '@energinet-datahub/watt/description-list';`\n */\n@Component({\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-description-list',\n styleUrls: ['./watt-description-list.component.scss'],\n imports: [NgTemplateOutlet],\n template: `<dl>\n @for (item of descriptionItems(); track item) {\n <ng-container *ngTemplateOutlet=\"item.templateRef()\" />\n }\n </dl>`,\n hostDirectives: [NgClass],\n host: {\n '[style.--watt-description-list-groups-per-row]': 'groupsPerRow()',\n '[class]': 'descriptionVariant()',\n },\n})\nclass WattDescriptionListComponent<T> {\n private ngClass = inject(NgClass);\n descriptionItems = contentChildren(WattDescriptionListItemComponent<T>);\n variant = input<'flow' | 'stack' | 'compact'>('flow');\n descriptionVariant = computed(() => `watt-description-list-${this.variant()}`);\n groupsPerRow = input<number>(3);\n itemSeparators = input(true);\n\n constructor() {\n effect(() => {\n this.ngClass.ngClass = {\n [`item-separators`]: this.itemSeparators(),\n };\n });\n }\n}\n\nexport { WattDescriptionListItemComponent, WattDescriptionListComponent };\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport {\n WattDescriptionListComponent,\n WattDescriptionListItemComponent,\n} from './watt-description-list.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,gCAAgC,CAAA;AAC3C,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAA8B,aAAa,CAAC;AAC5E,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC;AACzB,IAAA,KAAK,GAAG,KAAK,CAAW,IAAI,CAAC;AAC7B,IAAA,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC;uGAJf,gCAAgC,EAAA,IA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AA,EAAA,uBAAuB,WAExB,CAAC,gBAAgB,CAAC,EACjB,QAAA,EAAA,CAAA;;;;QAIJ,EACU,cAAA,EAAA,CAAC,OAAO,CAAC,EACnB,IAAA,EAAA;AACJ,wBAAA,gDAAgD,EAAE,gBAAgB;AAClE,wBAAA,SAAS,EAAE,sBAAsB;AAClC,qBAAA,EAAA,MAAA,EAAA,CAAA,ypCAAA,CAAA,EAAA;;;AChDH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
@@ -347,7 +347,7 @@ class WattDropdownComponent {
347
347
  });
348
348
  }
349
349
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
350
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattDropdownComponent, isStandalone: true, selector: "watt-dropdown", inputs: { hideSearch: "hideSearch", panelWidth: "panelWidth", getCustomTrigger: "getCustomTrigger", chipMode: "chipMode", disableSelectedMode: "disableSelectedMode", sortDirection: "sortDirection", options: "options", multiple: "multiple", showResetOption: "showResetOption", placeholder: "placeholder", label: "label", noOptionsFoundLabel: "noOptionsFoundLabel" }, host: { properties: { "attr.watt-field-disabled": "this.isDisabled", "class.watt-chip-mode": "this.chipModeClass" } }, viewQueries: [{ propertyName: "matSelect", first: true, predicate: ["matSelect"], descendants: true, static: 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<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 (toggle)=\"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 }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode,\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 @for (option of filteredOptions$ | push; track option) {\n <mat-option [value]=\"option.value\" [disabled]=\"option.disabled\">\n {{ option.displayValue }}\n </mat-option>\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", styles: ["watt-dropdown:not(.watt-chip-mode){width:100%}watt-dropdown{--watt-input-color: var(--watt-typography-text-color);--watt-input-placeholder-color: var(--watt-on-light-high-emphasis);display:block;width:auto;overflow:hidden}watt-dropdown watt-field label .watt-field-wrapper{padding:0;position:relative}watt-dropdown.watt-chip-mode.ng-dirty.ng-invalid .watt-field-wrapper watt-chip label{border:1px solid var(--watt-color-state-danger)}watt-dropdown.watt-chip-mode[disabled=true] watt-field label .watt-field-wrapper{background-color:transparent}watt-dropdown .mat-input-element{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color);caret-color:var(--watt-color-neutral-grey-900)!important;padding:0 12px}watt-dropdown .mat-mdc-select-arrow{color:var(--watt-dropdown-arrow-color, rgba(0, 0, 0, .54));border:none;width:auto;height:auto}watt-dropdown .mat-mdc-select-arrow:before{width:.6em;height:.6em;bottom:.2em;position:relative;display:inline-block;border-style:solid;border-width:0 0 .15em .15em;transform:rotate(315deg);border-color:var(--watt-color-primary);content:\"\"}watt-dropdown .mat-mdc-select-arrow svg{display:none}watt-dropdown .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;padding:0 var(--watt-space-m)}watt-dropdown .mat-mdc-select-value{color:var(--watt-color-neutral-black);padding-right:var(--watt-space-m)}watt-dropdown .mat-mdc-select.mat-mdc-select-invalid.ng-pristine .mat-mdc-select-arrow{color:currentColor}watt-dropdown .watt-chip-label{float:right;margin-left:var(--watt-space-s);background:var(--watt-color-neutral-white)}watt-dropdown .watt-field--chip .mat-mdc-select{visibility:hidden;position:absolute;width:100%}watt-dropdown .mat-mdc-select-placeholder{color:var(--watt-input-placeholder-color)}watt-dropdown watt-field label .watt-field-wrapper{background-color:transparent}.watt-dropdown-panel{--watt-input-color: var(--watt-typography-text-color);padding:0}.watt-dropdown-panel mat-option:nth-of-type(2){border-top:1px solid var(--watt-color-neutral-grey-300)}.watt-dropdown-panel .mat-select-search-inner-row .mat-select-search-input,.watt-dropdown-panel mat-option.contains-mat-select-search{height:48px}.watt-dropdown-panel:not(.watt-dropdown-panel-chip-mode){min-width:calc(100% + 2px)!important;margin-top:-36px;margin-left:-1px;min-height:48px}.watt-dropdown-panel .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{padding:0;margin:0 var(--watt-space-m)}.watt-dropdown-panel .mat-datepicker-content .mat-mdc-icon-button{--mat-mdc-button-persistent-ripple-color: transparent;--mat-mdc-button-ripple-color: transparent}.watt-dropdown-panel.watt-dropdown-panel-chip-mode{margin-top:4px}.watt-dropdown-panel.mat-mdc-select-search-panel{transform:scaleY(1)!important}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.contains-mat-select-search.mat-mdc-option-multiple{background-color:transparent}.watt-dropdown-panel ngx-mat-select-search .mat-select-search-inner-multiple .mat-select-search-inner-row{margin-left:5px}.watt-dropdown-panel ngx-mat-select-search .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{margin:0}.watt-dropdown-panel .mdc-list-item .mat-select-search-input,.watt-dropdown-panel .mat-mdc-option.mdc-list-item,.watt-dropdown-panel .mat-select-search-no-entries-found{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-option.mdc-list-item .mat-select-search-no-entries-found{padding:var(--watt-space-s)}.watt-dropdown-panel .mat-checkbox-frame,.watt-dropdown-panel .mat-mdc-checkbox{border-color:var(--watt-color-primary)}.watt-dropdown-panel :not(.mat-mdc-option-multiple) .mat-pseudo-checkbox{display:none}.watt-dropdown-panel .mat-pseudo-checkbox,.watt-dropdown-panel .mat-mdc-checkbox{color:var(--watt-color-primary)}.watt-dropdown-panel .mat-mdc-option{color:var(--watt-color-neutral-black);min-height:42px}.watt-dropdown-panel .mat-mdc-option[aria-disabled=true].contains-mat-select-search{margin-top:0;top:auto}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mat-mdc-option-active,.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mdc-list-item--selected.mat-mdc-option-active:not(.mat-mdc-option-multiple),.watt-dropdown-panel .mat-mdc-option:hover:not(.mat-mdc-option-disabled,.contains-mat-select-search),.watt-dropdown-panel .mat-mdc-option:focus:not(.mat-mdc-option-disabled){background-color:var(--watt-color-primary-light)}.watt-dropdown-panel .mat-mdc-option .mat-mdc-select-search-no-entries-found{text-align:center;padding:0}.watt-dropdown-panel .mat-mdc-option.mat-mdc-option-disabled{color:var(--watt-color-neutral-grey-400);cursor:not-allowed}.watt-dropdown-panel .mat-mdc-select-search-input:not(.mat-mdc-select-search-hidden){color:var(--watt-color-neutral-black)}.watt-dropdown-panel .mat-mdc-select-search-clear{background-color:var(--watt-color-neutral-white);color:var(--watt-color-neutral-grey-400)}.watt-dropdown-panel .mat-mdc-select-search-clear mat-icon{line-height:20px!important}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "pipe", type: RxPush, name: "push" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgxMatSelectSearchModule }, { kind: "component", type: i4.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "recreateValuesArray"], outputs: ["toggleAll"] }, { kind: "directive", type: i4.MatSelectSearchClearDirective, selector: "[ngxMatSelectSearchClear]" }, { kind: "component", type: WattMenuChipComponent, selector: "watt-menu-chip", inputs: ["opened", "disabled", "name", "value", "selected", "hasPopup"], outputs: ["toggle"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName"] }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }], encapsulation: i0.ViewEncapsulation.None });
350
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattDropdownComponent, isStandalone: true, selector: "watt-dropdown", inputs: { hideSearch: "hideSearch", panelWidth: "panelWidth", getCustomTrigger: "getCustomTrigger", chipMode: "chipMode", disableSelectedMode: "disableSelectedMode", sortDirection: "sortDirection", options: "options", multiple: "multiple", showResetOption: "showResetOption", placeholder: "placeholder", label: "label", noOptionsFoundLabel: "noOptionsFoundLabel" }, host: { properties: { "attr.watt-field-disabled": "this.isDisabled", "class.watt-chip-mode": "this.chipModeClass" } }, viewQueries: [{ propertyName: "matSelect", first: true, predicate: ["matSelect"], descendants: true, static: 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<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 (toggle)=\"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 }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode,\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 @for (option of filteredOptions$ | push; track option) {\n <mat-option [value]=\"option.value\" [disabled]=\"option.disabled\">\n {{ option.displayValue }}\n </mat-option>\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", styles: ["watt-dropdown:not(.watt-chip-mode){width:100%}watt-dropdown{--watt-input-color: var(--watt-typography-text-color);--watt-input-placeholder-color: var(--watt-on-light-high-emphasis);display:block;width:auto}watt-dropdown watt-field label .watt-field-wrapper{padding:0;position:relative}watt-dropdown.watt-chip-mode.ng-dirty.ng-invalid .watt-field-wrapper watt-chip label{border:1px solid var(--watt-color-state-danger)}watt-dropdown.watt-chip-mode[disabled=true] watt-field label .watt-field-wrapper{background-color:transparent}watt-dropdown .mat-input-element{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color);caret-color:var(--watt-color-neutral-grey-900)!important;padding:0 12px}watt-dropdown .mat-mdc-select-arrow{color:var(--watt-dropdown-arrow-color, rgba(0, 0, 0, .54));border:none;width:auto;height:auto}watt-dropdown .mat-mdc-select-arrow:before{width:.6em;height:.6em;bottom:.2em;position:relative;display:inline-block;border-style:solid;border-width:0 0 .15em .15em;transform:rotate(315deg);border-color:var(--watt-color-primary);content:\"\"}watt-dropdown .mat-mdc-select-arrow svg{display:none}watt-dropdown .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;padding:0 var(--watt-space-m)}watt-dropdown .mat-mdc-select-value{color:var(--watt-color-neutral-black);padding-right:var(--watt-space-m)}watt-dropdown .mat-mdc-select.mat-mdc-select-invalid.ng-pristine .mat-mdc-select-arrow{color:currentColor}watt-dropdown .watt-chip-label{float:right;margin-left:var(--watt-space-s);background:var(--watt-color-neutral-white)}watt-dropdown .watt-field--chip .mat-mdc-select{visibility:hidden;position:absolute;width:100%}watt-dropdown .mat-mdc-select-placeholder{color:var(--watt-input-placeholder-color)}watt-dropdown watt-field label .watt-field-wrapper{background-color:transparent}.watt-dropdown-panel{--watt-input-color: var(--watt-typography-text-color);padding:0}.watt-dropdown-panel mat-option:nth-of-type(2){border-top:1px solid var(--watt-color-neutral-grey-300)}.watt-dropdown-panel .mat-select-search-inner-row .mat-select-search-input,.watt-dropdown-panel mat-option.contains-mat-select-search{height:48px}.watt-dropdown-panel:not(.watt-dropdown-panel-chip-mode){min-width:calc(100% + 2px)!important;margin-top:-36px;margin-left:-1px;min-height:48px}.watt-dropdown-panel .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{padding:0;margin:0 var(--watt-space-m)}.watt-dropdown-panel .mat-datepicker-content .mat-mdc-icon-button{--mat-mdc-button-persistent-ripple-color: transparent;--mat-mdc-button-ripple-color: transparent}.watt-dropdown-panel.watt-dropdown-panel-chip-mode{margin-top:4px}.watt-dropdown-panel.mat-mdc-select-search-panel{transform:scaleY(1)!important}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.contains-mat-select-search.mat-mdc-option-multiple{background-color:transparent}.watt-dropdown-panel ngx-mat-select-search .mat-select-search-inner-multiple .mat-select-search-inner-row{margin-left:5px}.watt-dropdown-panel ngx-mat-select-search .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{margin:0}.watt-dropdown-panel .mdc-list-item .mat-select-search-input,.watt-dropdown-panel .mat-mdc-option.mdc-list-item,.watt-dropdown-panel .mat-select-search-no-entries-found{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-option.mdc-list-item .mat-select-search-no-entries-found{padding:var(--watt-space-s)}.watt-dropdown-panel .mat-checkbox-frame,.watt-dropdown-panel .mat-mdc-checkbox{border-color:var(--watt-color-primary)}.watt-dropdown-panel :not(.mat-mdc-option-multiple) .mat-pseudo-checkbox{display:none}.watt-dropdown-panel .mat-pseudo-checkbox,.watt-dropdown-panel .mat-mdc-checkbox{color:var(--watt-color-primary)}.watt-dropdown-panel .mat-mdc-option{color:var(--watt-color-neutral-black);min-height:42px}.watt-dropdown-panel .mat-mdc-option[aria-disabled=true].contains-mat-select-search{margin-top:0;top:auto}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mat-mdc-option-active,.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mdc-list-item--selected.mat-mdc-option-active:not(.mat-mdc-option-multiple),.watt-dropdown-panel .mat-mdc-option:hover:not(.mat-mdc-option-disabled,.contains-mat-select-search),.watt-dropdown-panel .mat-mdc-option:focus:not(.mat-mdc-option-disabled){background-color:var(--watt-color-primary-light)}.watt-dropdown-panel .mat-mdc-option .mat-mdc-select-search-no-entries-found{text-align:center;padding:0}.watt-dropdown-panel .mat-mdc-option.mat-mdc-option-disabled{color:var(--watt-color-neutral-grey-400);cursor:not-allowed}.watt-dropdown-panel .mat-mdc-select-search-input:not(.mat-mdc-select-search-hidden){color:var(--watt-color-neutral-black)}.watt-dropdown-panel .mat-mdc-select-search-clear{background-color:var(--watt-color-neutral-white);color:var(--watt-color-neutral-grey-400)}.watt-dropdown-panel .mat-mdc-select-search-clear mat-icon{line-height:20px!important}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "pipe", type: RxPush, name: "push" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgxMatSelectSearchModule }, { kind: "component", type: i4.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "recreateValuesArray"], outputs: ["toggleAll"] }, { kind: "directive", type: i4.MatSelectSearchClearDirective, selector: "[ngxMatSelectSearchClear]" }, { kind: "component", type: WattMenuChipComponent, selector: "watt-menu-chip", inputs: ["opened", "disabled", "name", "value", "selected", "hasPopup"], outputs: ["toggle"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName"] }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }], encapsulation: i0.ViewEncapsulation.None });
351
351
  }
352
352
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDropdownComponent, decorators: [{
353
353
  type: Component,
@@ -360,7 +360,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
360
360
  WattMenuChipComponent,
361
361
  WattFieldComponent,
362
362
  WattIconComponent,
363
- ], 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<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 (toggle)=\"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 }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode,\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 @for (option of filteredOptions$ | push; track option) {\n <mat-option [value]=\"option.value\" [disabled]=\"option.disabled\">\n {{ option.displayValue }}\n </mat-option>\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", styles: ["watt-dropdown:not(.watt-chip-mode){width:100%}watt-dropdown{--watt-input-color: var(--watt-typography-text-color);--watt-input-placeholder-color: var(--watt-on-light-high-emphasis);display:block;width:auto;overflow:hidden}watt-dropdown watt-field label .watt-field-wrapper{padding:0;position:relative}watt-dropdown.watt-chip-mode.ng-dirty.ng-invalid .watt-field-wrapper watt-chip label{border:1px solid var(--watt-color-state-danger)}watt-dropdown.watt-chip-mode[disabled=true] watt-field label .watt-field-wrapper{background-color:transparent}watt-dropdown .mat-input-element{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color);caret-color:var(--watt-color-neutral-grey-900)!important;padding:0 12px}watt-dropdown .mat-mdc-select-arrow{color:var(--watt-dropdown-arrow-color, rgba(0, 0, 0, .54));border:none;width:auto;height:auto}watt-dropdown .mat-mdc-select-arrow:before{width:.6em;height:.6em;bottom:.2em;position:relative;display:inline-block;border-style:solid;border-width:0 0 .15em .15em;transform:rotate(315deg);border-color:var(--watt-color-primary);content:\"\"}watt-dropdown .mat-mdc-select-arrow svg{display:none}watt-dropdown .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;padding:0 var(--watt-space-m)}watt-dropdown .mat-mdc-select-value{color:var(--watt-color-neutral-black);padding-right:var(--watt-space-m)}watt-dropdown .mat-mdc-select.mat-mdc-select-invalid.ng-pristine .mat-mdc-select-arrow{color:currentColor}watt-dropdown .watt-chip-label{float:right;margin-left:var(--watt-space-s);background:var(--watt-color-neutral-white)}watt-dropdown .watt-field--chip .mat-mdc-select{visibility:hidden;position:absolute;width:100%}watt-dropdown .mat-mdc-select-placeholder{color:var(--watt-input-placeholder-color)}watt-dropdown watt-field label .watt-field-wrapper{background-color:transparent}.watt-dropdown-panel{--watt-input-color: var(--watt-typography-text-color);padding:0}.watt-dropdown-panel mat-option:nth-of-type(2){border-top:1px solid var(--watt-color-neutral-grey-300)}.watt-dropdown-panel .mat-select-search-inner-row .mat-select-search-input,.watt-dropdown-panel mat-option.contains-mat-select-search{height:48px}.watt-dropdown-panel:not(.watt-dropdown-panel-chip-mode){min-width:calc(100% + 2px)!important;margin-top:-36px;margin-left:-1px;min-height:48px}.watt-dropdown-panel .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{padding:0;margin:0 var(--watt-space-m)}.watt-dropdown-panel .mat-datepicker-content .mat-mdc-icon-button{--mat-mdc-button-persistent-ripple-color: transparent;--mat-mdc-button-ripple-color: transparent}.watt-dropdown-panel.watt-dropdown-panel-chip-mode{margin-top:4px}.watt-dropdown-panel.mat-mdc-select-search-panel{transform:scaleY(1)!important}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.contains-mat-select-search.mat-mdc-option-multiple{background-color:transparent}.watt-dropdown-panel ngx-mat-select-search .mat-select-search-inner-multiple .mat-select-search-inner-row{margin-left:5px}.watt-dropdown-panel ngx-mat-select-search .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{margin:0}.watt-dropdown-panel .mdc-list-item .mat-select-search-input,.watt-dropdown-panel .mat-mdc-option.mdc-list-item,.watt-dropdown-panel .mat-select-search-no-entries-found{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-option.mdc-list-item .mat-select-search-no-entries-found{padding:var(--watt-space-s)}.watt-dropdown-panel .mat-checkbox-frame,.watt-dropdown-panel .mat-mdc-checkbox{border-color:var(--watt-color-primary)}.watt-dropdown-panel :not(.mat-mdc-option-multiple) .mat-pseudo-checkbox{display:none}.watt-dropdown-panel .mat-pseudo-checkbox,.watt-dropdown-panel .mat-mdc-checkbox{color:var(--watt-color-primary)}.watt-dropdown-panel .mat-mdc-option{color:var(--watt-color-neutral-black);min-height:42px}.watt-dropdown-panel .mat-mdc-option[aria-disabled=true].contains-mat-select-search{margin-top:0;top:auto}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mat-mdc-option-active,.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mdc-list-item--selected.mat-mdc-option-active:not(.mat-mdc-option-multiple),.watt-dropdown-panel .mat-mdc-option:hover:not(.mat-mdc-option-disabled,.contains-mat-select-search),.watt-dropdown-panel .mat-mdc-option:focus:not(.mat-mdc-option-disabled){background-color:var(--watt-color-primary-light)}.watt-dropdown-panel .mat-mdc-option .mat-mdc-select-search-no-entries-found{text-align:center;padding:0}.watt-dropdown-panel .mat-mdc-option.mat-mdc-option-disabled{color:var(--watt-color-neutral-grey-400);cursor:not-allowed}.watt-dropdown-panel .mat-mdc-select-search-input:not(.mat-mdc-select-search-hidden){color:var(--watt-color-neutral-black)}.watt-dropdown-panel .mat-mdc-select-search-clear{background-color:var(--watt-color-neutral-white);color:var(--watt-color-neutral-grey-400)}.watt-dropdown-panel .mat-mdc-select-search-clear mat-icon{line-height:20px!important}\n"] }]
363
+ ], 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<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 (toggle)=\"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 }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode,\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 @for (option of filteredOptions$ | push; track option) {\n <mat-option [value]=\"option.value\" [disabled]=\"option.disabled\">\n {{ option.displayValue }}\n </mat-option>\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", styles: ["watt-dropdown:not(.watt-chip-mode){width:100%}watt-dropdown{--watt-input-color: var(--watt-typography-text-color);--watt-input-placeholder-color: var(--watt-on-light-high-emphasis);display:block;width:auto}watt-dropdown watt-field label .watt-field-wrapper{padding:0;position:relative}watt-dropdown.watt-chip-mode.ng-dirty.ng-invalid .watt-field-wrapper watt-chip label{border:1px solid var(--watt-color-state-danger)}watt-dropdown.watt-chip-mode[disabled=true] watt-field label .watt-field-wrapper{background-color:transparent}watt-dropdown .mat-input-element{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color);caret-color:var(--watt-color-neutral-grey-900)!important;padding:0 12px}watt-dropdown .mat-mdc-select-arrow{color:var(--watt-dropdown-arrow-color, rgba(0, 0, 0, .54));border:none;width:auto;height:auto}watt-dropdown .mat-mdc-select-arrow:before{width:.6em;height:.6em;bottom:.2em;position:relative;display:inline-block;border-style:solid;border-width:0 0 .15em .15em;transform:rotate(315deg);border-color:var(--watt-color-primary);content:\"\"}watt-dropdown .mat-mdc-select-arrow svg{display:none}watt-dropdown .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;padding:0 var(--watt-space-m)}watt-dropdown .mat-mdc-select-value{color:var(--watt-color-neutral-black);padding-right:var(--watt-space-m)}watt-dropdown .mat-mdc-select.mat-mdc-select-invalid.ng-pristine .mat-mdc-select-arrow{color:currentColor}watt-dropdown .watt-chip-label{float:right;margin-left:var(--watt-space-s);background:var(--watt-color-neutral-white)}watt-dropdown .watt-field--chip .mat-mdc-select{visibility:hidden;position:absolute;width:100%}watt-dropdown .mat-mdc-select-placeholder{color:var(--watt-input-placeholder-color)}watt-dropdown watt-field label .watt-field-wrapper{background-color:transparent}.watt-dropdown-panel{--watt-input-color: var(--watt-typography-text-color);padding:0}.watt-dropdown-panel mat-option:nth-of-type(2){border-top:1px solid var(--watt-color-neutral-grey-300)}.watt-dropdown-panel .mat-select-search-inner-row .mat-select-search-input,.watt-dropdown-panel mat-option.contains-mat-select-search{height:48px}.watt-dropdown-panel:not(.watt-dropdown-panel-chip-mode){min-width:calc(100% + 2px)!important;margin-top:-36px;margin-left:-1px;min-height:48px}.watt-dropdown-panel .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{padding:0;margin:0 var(--watt-space-m)}.watt-dropdown-panel .mat-datepicker-content .mat-mdc-icon-button{--mat-mdc-button-persistent-ripple-color: transparent;--mat-mdc-button-ripple-color: transparent}.watt-dropdown-panel.watt-dropdown-panel-chip-mode{margin-top:4px}.watt-dropdown-panel.mat-mdc-select-search-panel{transform:scaleY(1)!important}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.contains-mat-select-search.mat-mdc-option-multiple{background-color:transparent}.watt-dropdown-panel ngx-mat-select-search .mat-select-search-inner-multiple .mat-select-search-inner-row{margin-left:5px}.watt-dropdown-panel ngx-mat-select-search .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{margin:0}.watt-dropdown-panel .mdc-list-item .mat-select-search-input,.watt-dropdown-panel .mat-mdc-option.mdc-list-item,.watt-dropdown-panel .mat-select-search-no-entries-found{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-option.mdc-list-item .mat-select-search-no-entries-found{padding:var(--watt-space-s)}.watt-dropdown-panel .mat-checkbox-frame,.watt-dropdown-panel .mat-mdc-checkbox{border-color:var(--watt-color-primary)}.watt-dropdown-panel :not(.mat-mdc-option-multiple) .mat-pseudo-checkbox{display:none}.watt-dropdown-panel .mat-pseudo-checkbox,.watt-dropdown-panel .mat-mdc-checkbox{color:var(--watt-color-primary)}.watt-dropdown-panel .mat-mdc-option{color:var(--watt-color-neutral-black);min-height:42px}.watt-dropdown-panel .mat-mdc-option[aria-disabled=true].contains-mat-select-search{margin-top:0;top:auto}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mat-mdc-option-active,.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mdc-list-item--selected.mat-mdc-option-active:not(.mat-mdc-option-multiple),.watt-dropdown-panel .mat-mdc-option:hover:not(.mat-mdc-option-disabled,.contains-mat-select-search),.watt-dropdown-panel .mat-mdc-option:focus:not(.mat-mdc-option-disabled){background-color:var(--watt-color-primary-light)}.watt-dropdown-panel .mat-mdc-option .mat-mdc-select-search-no-entries-found{text-align:center;padding:0}.watt-dropdown-panel .mat-mdc-option.mat-mdc-option-disabled{color:var(--watt-color-neutral-grey-400);cursor:not-allowed}.watt-dropdown-panel .mat-mdc-select-search-input:not(.mat-mdc-select-search-hidden){color:var(--watt-color-neutral-black)}.watt-dropdown-panel .mat-mdc-select-search-clear{background-color:var(--watt-color-neutral-white);color:var(--watt-color-neutral-grey-400)}.watt-dropdown-panel .mat-mdc-select-search-clear mat-icon{line-height:20px!important}\n"] }]
364
364
  }], ctorParameters: () => [], propDecorators: { isDisabled: [{
365
365
  type: HostBinding,
366
366
  args: ['attr.watt-field-disabled']
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-dropdown.mjs","sources":["../../../libs/watt/package/dropdown/watt-dropdown.component.ts","../../../libs/watt/package/dropdown/watt-dropdown.component.html","../../../libs/watt/package/dropdown/index.ts","../../../libs/watt/package/dropdown/energinet-watt-dropdown.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Component,\n DestroyRef,\n HostBinding,\n Input,\n OnInit,\n ViewChild,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport {\n AsyncValidatorFn,\n ControlValueAccessor,\n FormControl,\n NgControl,\n UntypedFormControl,\n ValidationErrors,\n ValidatorFn,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { NgClass } from '@angular/common';\nimport { RxPush } from '@rx-angular/template/push';\nimport { MatSelectModule, MatSelect } from '@angular/material/select';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { of, ReplaySubject, map, take, filter } from 'rxjs';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport type { WattDropdownOptions } from './watt-dropdown-option';\nimport type { WattDropdownValue } from './watt-dropdown-value';\nimport { WattMenuChipComponent } from '@energinet/watt/chip';\nimport { WattIconComponent } from '@energinet/watt/icon';\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 NgClass,\n MatSelectModule,\n RxPush,\n ReactiveFormsModule,\n NgxMatSelectSearchModule,\n WattMenuChipComponent,\n WattFieldComponent,\n WattIconComponent,\n ],\n})\nexport class WattDropdownComponent implements ControlValueAccessor, OnInit {\n private parentControlDirective = inject(NgControl, { host: true });\n /**\n * @ignore\n */\n private _destroyRef = inject(DestroyRef);\n /**\n * @ignore\n */\n parentControl: FormControl | null = null;\n /**\n * @ignore\n */\n private validateParent?: ValidatorFn;\n /**\n * @ignore\n */\n private validateParentAsync?: AsyncValidatorFn;\n\n /**\n * @ignore\n *\n */\n @HostBinding('attr.watt-field-disabled') isDisabled = false;\n\n /**\n * @ignore\n */\n matSelectControl = new FormControl<string | string[] | undefined | null>(null);\n\n /**\n * Control for the MatSelect filter keyword\n *\n * @ignore\n */\n filterControl = new UntypedFormControl();\n\n /**\n * List of options filtered by search keyword\n *\n * @ignore\n */\n filteredOptions$ = new ReplaySubject<WattDropdownOptions>(1);\n\n /**\n * @ignore\n */\n emDash = '—';\n\n /**\n * @ignore\n */\n isToggleAllChecked = false;\n\n /**\n * @ignore\n */\n isToggleAllIndeterminate = false;\n\n _options: WattDropdownOptions = [];\n\n /**\n * @ignore\n */\n get showTriggerValue(): boolean {\n return (this.multiple &&\n this.matSelectControl.value?.length === 1 &&\n this.matSelectControl.value[0] !== '') ||\n (!this.multiple && this.matSelect?.triggerValue)\n ? true\n : false;\n }\n\n /**\n * @ignore\n */\n get showChipLabel() {\n return this.multiple && this.matSelectControl.value && this.matSelectControl.value.length > 1\n ? true\n : false;\n }\n\n /**\n * @ignore\n */\n @ViewChild('matSelect', { static: true }) matSelect?: MatSelect;\n\n @Input() hideSearch = false;\n @Input() panelWidth: null | 'auto' = null;\n @Input() getCustomTrigger?: (value: string | string[]) => string;\n\n /**\n * Set the mode of the dropdown.\n */\n @Input() chipMode = false;\n @HostBinding('class.watt-chip-mode')\n get chipModeClass() {\n return this.chipMode;\n }\n\n @Input() disableSelectedMode = false;\n\n @Input()\n sortDirection: 'asc' | 'desc' | undefined = undefined;\n\n /**\n * Sets the options for the dropdown.\n */\n @Input()\n set options(options: WattDropdownOptions) {\n if (Array.isArray(options)) {\n let optionsCopy = [...options];\n\n if (this.sortDirection) {\n optionsCopy = this.sortOptions(optionsCopy);\n }\n\n this._options = optionsCopy;\n this.filteredOptions$.next(optionsCopy);\n }\n }\n get options(): WattDropdownOptions {\n return this._options;\n }\n\n /**\n * Sets support for selecting multiple dropdown options.\n */\n @Input() multiple = false;\n\n /**\n * Sets support for hiding the reset option in \"single\" select mode.\n */\n @Input() showResetOption = true;\n\n /**\n * Sets the placeholder for the dropdown.\n */\n @Input() placeholder = '';\n\n /**\n * Sets the label for the dropdown.\n */\n @Input() label = '';\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 @Input() noOptionsFoundLabel = '';\n\n constructor() {\n this.parentControlDirective.valueAccessor = this;\n }\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.listenForFilterFieldValueChanges();\n this.initializePropertiesFromParent();\n this.bindParentValidatorsToControl();\n this.bindControlToParent();\n }\n\n /**\n * @ignore\n */\n writeValue(value: WattDropdownValue): void {\n this.matSelectControl.setValue(value);\n }\n\n /**\n * @ignore\n */\n registerOnChange(onChangeFn: (value: WattDropdownValue) => void): void {\n this.changeParentValue = onChangeFn;\n }\n\n /**\n * @ignore\n */\n registerOnTouched(onTouchFn: () => void) {\n this.markParentControlAsTouched = onTouchFn;\n }\n\n /**\n * @ignore\n */\n setDisabledState(shouldDisable: boolean): void {\n this.isDisabled = shouldDisable;\n if (shouldDisable) {\n this.matSelectControl.disable();\n } else {\n this.matSelectControl.enable();\n }\n }\n\n /**\n * @ignore\n */\n onToggleAll(toggleAllState: boolean): void {\n this.filteredOptions$\n .pipe(\n take(1),\n map((options) => options.map((option) => option.value))\n )\n .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 /**\n * @ignore\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 /**\n * @ignore\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private changeParentValue = (value: WattDropdownValue): void => {\n // Intentionally left empty\n };\n\n /**\n * @ignore\n */\n private markParentControlAsTouched = (): void => {\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(): void {\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(): void {\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(): void {\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 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 /**\n * @ignore\n */\n private filterOptions() {\n if (!this._options) {\n return;\n }\n\n // get the search keyword\n let search = (this.filterControl.value as string).trim();\n\n if (search) {\n search = search.toLowerCase();\n } else {\n return this.filteredOptions$.next(this._options.slice());\n }\n\n // filter the options\n this.filteredOptions$.next(\n this._options.filter((option) => option.displayValue.toLowerCase().indexOf(search) > -1)\n );\n }\n\n /**\n * @ignore\n */\n private determineToggleAllCheckboxState(): void {\n this.filteredOptions$\n .pipe(\n take(1),\n filter((options) => options != null && options !== undefined),\n map((options) => options.map((option) => option.value))\n )\n .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 (toggle)=\"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 }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode,\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 @for (option of filteredOptions$ | push; track option) {\n <mat-option [value]=\"option.value\" [disabled]=\"option.disabled\">\n {{ option.displayValue }}\n </mat-option>\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","//#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 { WattDropdownComponent } from './watt-dropdown.component';\nexport { type WattDropdownOption, type WattDropdownOptions } from './watt-dropdown-option';\nexport { type WattDropdownValue } from './watt-dropdown-value';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAkDa,qBAAqB,CAAA;IACxB,sBAAsB,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAClE;;AAEG;AACK,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AACxC;;AAEG;IACH,aAAa,GAAuB,IAAI;AACxC;;AAEG;AACK,IAAA,cAAc;AACtB;;AAEG;AACK,IAAA,mBAAmB;AAE3B;;;AAGG;IACsC,UAAU,GAAG,KAAK;AAE3D;;AAEG;AACH,IAAA,gBAAgB,GAAG,IAAI,WAAW,CAAuC,IAAI,CAAC;AAE9E;;;;AAIG;AACH,IAAA,aAAa,GAAG,IAAI,kBAAkB,EAAE;AAExC;;;;AAIG;AACH,IAAA,gBAAgB,GAAG,IAAI,aAAa,CAAsB,CAAC,CAAC;AAE5D;;AAEG;IACH,MAAM,GAAG,GAAG;AAEZ;;AAEG;IACH,kBAAkB,GAAG,KAAK;AAE1B;;AAEG;IACH,wBAAwB,GAAG,KAAK;IAEhC,QAAQ,GAAwB,EAAE;AAElC;;AAEG;AACH,IAAA,IAAI,gBAAgB,GAAA;QAClB,OAAO,CAAC,IAAI,CAAC,QAAQ;AACnB,YAAA,IAAI,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sBAAlD,WAAW;uBAAC,0BAA0B;gBA8DG,SAAS,EAAA,CAAA;sBAAlD,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;gBAE/B,UAAU,EAAA,CAAA;sBAAlB;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBACQ,gBAAgB,EAAA,CAAA;sBAAxB;gBAKQ,QAAQ,EAAA,CAAA;sBAAhB;gBAEG,aAAa,EAAA,CAAA;sBADhB,WAAW;uBAAC,sBAAsB;gBAK1B,mBAAmB,EAAA,CAAA;sBAA3B;gBAGD,aAAa,EAAA,CAAA;sBADZ;gBAOG,OAAO,EAAA,CAAA;sBADV;gBAoBQ,QAAQ,EAAA,CAAA;sBAAhB;gBAKQ,eAAe,EAAA,CAAA;sBAAvB;gBAKQ,WAAW,EAAA,CAAA;sBAAnB;gBAKQ,KAAK,EAAA,CAAA;sBAAb;gBAOQ,mBAAmB,EAAA,CAAA;sBAA3B;;;AEzNH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-dropdown.mjs","sources":["../../../libs/watt/package/dropdown/watt-dropdown.component.ts","../../../libs/watt/package/dropdown/watt-dropdown.component.html","../../../libs/watt/package/dropdown/index.ts","../../../libs/watt/package/dropdown/energinet-watt-dropdown.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Component,\n DestroyRef,\n HostBinding,\n Input,\n OnInit,\n ViewChild,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport {\n AsyncValidatorFn,\n ControlValueAccessor,\n FormControl,\n NgControl,\n UntypedFormControl,\n ValidationErrors,\n ValidatorFn,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { NgClass } from '@angular/common';\nimport { RxPush } from '@rx-angular/template/push';\nimport { MatSelectModule, MatSelect } from '@angular/material/select';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { of, ReplaySubject, map, take, filter } from 'rxjs';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport type { WattDropdownOptions } from './watt-dropdown-option';\nimport type { WattDropdownValue } from './watt-dropdown-value';\nimport { WattMenuChipComponent } from '@energinet/watt/chip';\nimport { WattIconComponent } from '@energinet/watt/icon';\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 NgClass,\n MatSelectModule,\n RxPush,\n ReactiveFormsModule,\n NgxMatSelectSearchModule,\n WattMenuChipComponent,\n WattFieldComponent,\n WattIconComponent,\n ],\n})\nexport class WattDropdownComponent implements ControlValueAccessor, OnInit {\n private parentControlDirective = inject(NgControl, { host: true });\n /**\n * @ignore\n */\n private _destroyRef = inject(DestroyRef);\n /**\n * @ignore\n */\n parentControl: FormControl | null = null;\n /**\n * @ignore\n */\n private validateParent?: ValidatorFn;\n /**\n * @ignore\n */\n private validateParentAsync?: AsyncValidatorFn;\n\n /**\n * @ignore\n *\n */\n @HostBinding('attr.watt-field-disabled') isDisabled = false;\n\n /**\n * @ignore\n */\n matSelectControl = new FormControl<string | string[] | undefined | null>(null);\n\n /**\n * Control for the MatSelect filter keyword\n *\n * @ignore\n */\n filterControl = new UntypedFormControl();\n\n /**\n * List of options filtered by search keyword\n *\n * @ignore\n */\n filteredOptions$ = new ReplaySubject<WattDropdownOptions>(1);\n\n /**\n * @ignore\n */\n emDash = '—';\n\n /**\n * @ignore\n */\n isToggleAllChecked = false;\n\n /**\n * @ignore\n */\n isToggleAllIndeterminate = false;\n\n _options: WattDropdownOptions = [];\n\n /**\n * @ignore\n */\n get showTriggerValue(): boolean {\n return (this.multiple &&\n this.matSelectControl.value?.length === 1 &&\n this.matSelectControl.value[0] !== '') ||\n (!this.multiple && this.matSelect?.triggerValue)\n ? true\n : false;\n }\n\n /**\n * @ignore\n */\n get showChipLabel() {\n return this.multiple && this.matSelectControl.value && this.matSelectControl.value.length > 1\n ? true\n : false;\n }\n\n /**\n * @ignore\n */\n @ViewChild('matSelect', { static: true }) matSelect?: MatSelect;\n\n @Input() hideSearch = false;\n @Input() panelWidth: null | 'auto' = null;\n @Input() getCustomTrigger?: (value: string | string[]) => string;\n\n /**\n * Set the mode of the dropdown.\n */\n @Input() chipMode = false;\n @HostBinding('class.watt-chip-mode')\n get chipModeClass() {\n return this.chipMode;\n }\n\n @Input() disableSelectedMode = false;\n\n @Input()\n sortDirection: 'asc' | 'desc' | undefined = undefined;\n\n /**\n * Sets the options for the dropdown.\n */\n @Input()\n set options(options: WattDropdownOptions) {\n if (Array.isArray(options)) {\n let optionsCopy = [...options];\n\n if (this.sortDirection) {\n optionsCopy = this.sortOptions(optionsCopy);\n }\n\n this._options = optionsCopy;\n this.filteredOptions$.next(optionsCopy);\n }\n }\n get options(): WattDropdownOptions {\n return this._options;\n }\n\n /**\n * Sets support for selecting multiple dropdown options.\n */\n @Input() multiple = false;\n\n /**\n * Sets support for hiding the reset option in \"single\" select mode.\n */\n @Input() showResetOption = true;\n\n /**\n * Sets the placeholder for the dropdown.\n */\n @Input() placeholder = '';\n\n /**\n * Sets the label for the dropdown.\n */\n @Input() label = '';\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 @Input() noOptionsFoundLabel = '';\n\n constructor() {\n this.parentControlDirective.valueAccessor = this;\n }\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.listenForFilterFieldValueChanges();\n this.initializePropertiesFromParent();\n this.bindParentValidatorsToControl();\n this.bindControlToParent();\n }\n\n /**\n * @ignore\n */\n writeValue(value: WattDropdownValue): void {\n this.matSelectControl.setValue(value);\n }\n\n /**\n * @ignore\n */\n registerOnChange(onChangeFn: (value: WattDropdownValue) => void): void {\n this.changeParentValue = onChangeFn;\n }\n\n /**\n * @ignore\n */\n registerOnTouched(onTouchFn: () => void) {\n this.markParentControlAsTouched = onTouchFn;\n }\n\n /**\n * @ignore\n */\n setDisabledState(shouldDisable: boolean): void {\n this.isDisabled = shouldDisable;\n if (shouldDisable) {\n this.matSelectControl.disable();\n } else {\n this.matSelectControl.enable();\n }\n }\n\n /**\n * @ignore\n */\n onToggleAll(toggleAllState: boolean): void {\n this.filteredOptions$\n .pipe(\n take(1),\n map((options) => options.map((option) => option.value))\n )\n .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 /**\n * @ignore\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 /**\n * @ignore\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private changeParentValue = (value: WattDropdownValue): void => {\n // Intentionally left empty\n };\n\n /**\n * @ignore\n */\n private markParentControlAsTouched = (): void => {\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(): void {\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(): void {\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(): void {\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 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 /**\n * @ignore\n */\n private filterOptions() {\n if (!this._options) {\n return;\n }\n\n // get the search keyword\n let search = (this.filterControl.value as string).trim();\n\n if (search) {\n search = search.toLowerCase();\n } else {\n return this.filteredOptions$.next(this._options.slice());\n }\n\n // filter the options\n this.filteredOptions$.next(\n this._options.filter((option) => option.displayValue.toLowerCase().indexOf(search) > -1)\n );\n }\n\n /**\n * @ignore\n */\n private determineToggleAllCheckboxState(): void {\n this.filteredOptions$\n .pipe(\n take(1),\n filter((options) => options != null && options !== undefined),\n map((options) => options.map((option) => option.value))\n )\n .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 (toggle)=\"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 }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode,\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 @for (option of filteredOptions$ | push; track option) {\n <mat-option [value]=\"option.value\" [disabled]=\"option.disabled\">\n {{ option.displayValue }}\n </mat-option>\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","//#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 { WattDropdownComponent } from './watt-dropdown.component';\nexport { type WattDropdownOption, type WattDropdownOptions } from './watt-dropdown-option';\nexport { type WattDropdownValue } from './watt-dropdown-value';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAkDa,qBAAqB,CAAA;IACxB,sBAAsB,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAClE;;AAEG;AACK,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AACxC;;AAEG;IACH,aAAa,GAAuB,IAAI;AACxC;;AAEG;AACK,IAAA,cAAc;AACtB;;AAEG;AACK,IAAA,mBAAmB;AAE3B;;;AAGG;IACsC,UAAU,GAAG,KAAK;AAE3D;;AAEG;AACH,IAAA,gBAAgB,GAAG,IAAI,WAAW,CAAuC,IAAI,CAAC;AAE9E;;;;AAIG;AACH,IAAA,aAAa,GAAG,IAAI,kBAAkB,EAAE;AAExC;;;;AAIG;AACH,IAAA,gBAAgB,GAAG,IAAI,aAAa,CAAsB,CAAC,CAAC;AAE5D;;AAEG;IACH,MAAM,GAAG,GAAG;AAEZ;;AAEG;IACH,kBAAkB,GAAG,KAAK;AAE1B;;AAEG;IACH,wBAAwB,GAAG,KAAK;IAEhC,QAAQ,GAAwB,EAAE;AAElC;;AAEG;AACH,IAAA,IAAI,gBAAgB,GAAA;QAClB,OAAO,CAAC,IAAI,CAAC,QAAQ;AACnB,YAAA,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC;YACzC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE;aACpC,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,YAAY;AAC/C,cAAE;cACA,KAAK;;AAGX;;AAEG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AgB,EAAA,CAAA;sBAAxB;gBAKQ,QAAQ,EAAA,CAAA;sBAAhB;gBAEG,aAAa,EAAA,CAAA;sBADhB,WAAW;uBAAC,sBAAsB;gBAK1B,mBAAmB,EAAA,CAAA;sBAA3B;gBAGD,aAAa,EAAA,CAAA;sBADZ;gBAOG,OAAO,EAAA,CAAA;sBADV;gBAoBQ,QAAQ,EAAA,CAAA;sBAAhB;gBAKQ,eAAe,EAAA,CAAA;sBAAvB;gBAKQ,WAAW,EAAA,CAAA;sBAAnB;gBAKQ,KAAK,EAAA,CAAA;sBAAb;gBAOQ,mBAAmB,EAAA,CAAA;sBAA3B;;;AEzNH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
@@ -5,7 +5,7 @@ import { filter, switchMap, startWith, map, tap } from 'rxjs/operators';
5
5
  import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
6
  import { WattIconComponent } from '@energinet/watt/icon';
7
7
  import { WattTooltipDirective } from '@energinet/watt/tooltip';
8
- import { VaterStackComponent } from '@energinet/watt/vater';
8
+ import { VaterFlexComponent, VaterUtilityDirective } from '@energinet/watt/vater';
9
9
  import { WattRangeValidators } from '@energinet/watt/validators';
10
10
  import { Subject } from 'rxjs';
11
11
  import { NgTemplateOutlet } from '@angular/common';
@@ -138,8 +138,10 @@ class WattFieldComponent {
138
138
  }
139
139
  </span>
140
140
  }
141
- <vater-stack direction="row" gap="s">
141
+ <vater-flex direction="row" gap="s" align="center">
142
142
  <div
143
+ vater
144
+ fill="horizontal"
143
145
  #wrapper
144
146
  class="watt-field-wrapper"
145
147
  [class.watt-field--has-placeholder]="!!placeholder()"
@@ -154,7 +156,7 @@ class WattFieldComponent {
154
156
  <ng-content />
155
157
  </div>
156
158
  <ng-content select="watt-field-descriptor" />
157
- </vater-stack>
159
+ </vater-flex>
158
160
  <ng-content select="[popover]" />
159
161
  <ng-content select="watt-field-hint" />
160
162
  <ng-content select="watt-field-error" />
@@ -162,7 +164,7 @@ class WattFieldComponent {
162
164
  <watt-field-error>{{ intl.required }}</watt-field-error>
163
165
  }
164
166
  </ng-template>
165
- `, isInline: true, styles: ["[watt-field-disabled=true] watt-field .label,.watt-field--disabled .label{color:var(--watt-disabled-text-label-color)}[watt-field-disabled=true] .watt-field-wrapper,.watt-field--disabled .watt-field-wrapper{background-color:var(--watt-field-disabled-background-color)}watt-field watt-field-hint{display:block}watt-field watt-field-error,.ng-valid watt-field watt-field-error{display:none}form.ng-submitted .ng-invalid watt-field watt-field-hint,:not(form).ng-touched.ng-invalid watt-field watt-field-hint{display:none}form.ng-submitted .ng-invalid watt-field watt-field-error,:not(form).ng-touched.ng-invalid watt-field watt-field-error{display:block}form.ng-submitted .ng-invalid watt-field .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field .watt-field-wrapper{border-color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label,:not(form).ng-touched.ng-invalid watt-field .label{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label.required:after,:not(form).ng-touched.ng-invalid watt-field .label.required:after{color:var(--watt-color-state-danger)}.watt-field-wrapper input{width:100%;border:none;outline:none;background-color:transparent}.watt-field-placeholder{position:absolute;padding:1px 2px;pointer-events:none;white-space:nowrap}.watt-field--has-placeholder input,.watt-field-placeholder{font-family:Droid Sans Mono,monospace;letter-spacing:-.03em}.watt-field-filler{color:var(--watt-on-light-low-emphasis)}.watt-field-ghost{color:transparent}watt-field{--watt-text-color: var(--watt-on-light-high-emphasis);--watt-disabled-text-label-color: var(--watt-on-light-low-emphasis);--watt-field-disabled-background-color: var(--watt-color-neutral-grey-100);--watt-input-border-radius: 4px;--watt-border-color: var(--watt-on-light-low-emphasis);--watt-label-text-color: var(--watt-text-color);width:100%;display:block}watt-field:not(.watt-field--chip){min-height:93px}watt-field:not(.watt-field--chip).watt-field--unlabelled{min-height:66px}watt-field .label{min-height:27px;display:flex;align-items:center}watt-field .label watt-icon{margin-left:var(--watt-space-s)}watt-field .label watt-tooltip{max-width:250px}watt-field .label.required:after{content:\"*\";margin-left:var(--watt-space-s);color:var(--watt-color-primary)}watt-field label,watt-field .watt-label{color:var(--watt-label-text-color);display:block;width:100%}watt-field label .watt-field-wrapper,watt-field .watt-label .watt-field-wrapper{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;display:flex;position:relative;width:100%;padding-left:var(--watt-space-s);border-radius:var(--watt-input-border-radius);border:1px solid var(--watt-border-color);overflow:hidden;color:var(--watt-text-color);align-items:center;gap:var(--watt-space-m);background-color:var(--watt-color-neutral-white)}watt-field label .watt-field-wrapper:focus-within,watt-field .watt-label .watt-field-wrapper:focus-within{--watt-border-color: var(--watt-color-primary)}watt-field label watt-field-hint,watt-field label watt-field-error,watt-field .watt-label watt-field-hint,watt-field .watt-label watt-field-error{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-field label :not(.watt-field--chip) watt-field-hint,watt-field label :not(.watt-field--chip) watt-field-error,watt-field .watt-label :not(.watt-field--chip) watt-field-hint,watt-field .watt-label :not(.watt-field--chip) watt-field-error{padding-left:var(--watt-space-s)}watt-field.watt-field--chip .watt-field-wrapper{border:none;padding-left:0;margin-bottom:var(--watt-space-xs)}watt-field:not(.watt-field--chip) .watt-field-wrapper{min-height:46px}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "directive", type: WattTooltipDirective, selector: "[wattTooltip]", inputs: ["wattTooltip", "wattTooltipPosition", "wattTooltipVariant"], exportAs: ["wattTooltip"] }, { kind: "component", type: WattFieldErrorComponent, selector: "watt-field-error" }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
167
+ `, isInline: true, styles: ["[watt-field-disabled=true] watt-field .label,.watt-field--disabled .label{color:var(--watt-disabled-text-label-color)}[watt-field-disabled=true] .watt-field-wrapper,.watt-field--disabled .watt-field-wrapper{background-color:var(--watt-field-disabled-background-color)}watt-field watt-field-hint{display:block}watt-field watt-field-error,.ng-valid watt-field watt-field-error{display:none}form.ng-submitted .ng-invalid watt-field watt-field-hint,:not(form).ng-touched.ng-invalid watt-field watt-field-hint{display:none}form.ng-submitted .ng-invalid watt-field watt-field-error,:not(form).ng-touched.ng-invalid watt-field watt-field-error{display:block}form.ng-submitted .ng-invalid watt-field .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field .watt-field-wrapper{border-color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label,:not(form).ng-touched.ng-invalid watt-field .label{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field .label.required:after,:not(form).ng-touched.ng-invalid watt-field .label.required:after{color:var(--watt-color-state-danger)}.watt-field-wrapper input{width:100%;border:none;outline:none;background-color:transparent}.watt-field-placeholder{position:absolute;padding:1px 2px;pointer-events:none;white-space:nowrap}.watt-field--has-placeholder input,.watt-field-placeholder{font-family:Droid Sans Mono,monospace;letter-spacing:-.03em}.watt-field-filler{color:var(--watt-on-light-low-emphasis)}.watt-field-ghost{color:transparent}watt-field{--watt-text-color: var(--watt-on-light-high-emphasis);--watt-disabled-text-label-color: var(--watt-on-light-low-emphasis);--watt-field-disabled-background-color: var(--watt-color-neutral-grey-100);--watt-input-border-radius: 4px;--watt-border-color: var(--watt-on-light-low-emphasis);--watt-label-text-color: var(--watt-text-color);width:100%;display:block}watt-field:not(.watt-field--chip){min-height:93px}watt-field:not(.watt-field--chip).watt-field--unlabelled{min-height:66px}watt-field .label{min-height:27px;display:flex;align-items:center}watt-field .label watt-icon{margin-left:var(--watt-space-s)}watt-field .label watt-tooltip{max-width:250px}watt-field .label.required:after{content:\"*\";margin-left:var(--watt-space-s);color:var(--watt-color-primary)}watt-field label,watt-field .watt-label{color:var(--watt-label-text-color);display:block;width:100%}watt-field label .watt-field-wrapper,watt-field .watt-label .watt-field-wrapper{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;display:flex;position:relative;width:100%;padding-left:var(--watt-space-s);border-radius:var(--watt-input-border-radius);border:1px solid var(--watt-border-color);overflow:hidden;color:var(--watt-text-color);align-items:center;gap:var(--watt-space-m);background-color:var(--watt-color-neutral-white)}watt-field label .watt-field-wrapper:focus-within,watt-field .watt-label .watt-field-wrapper:focus-within{--watt-border-color: var(--watt-color-primary)}watt-field label watt-field-hint,watt-field label watt-field-error,watt-field .watt-label watt-field-hint,watt-field .watt-label watt-field-error{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-field label :not(.watt-field--chip) watt-field-hint,watt-field label :not(.watt-field--chip) watt-field-error,watt-field .watt-label :not(.watt-field--chip) watt-field-hint,watt-field .watt-label :not(.watt-field--chip) watt-field-error{padding-left:var(--watt-space-s)}watt-field.watt-field--chip .watt-field-wrapper{border:none;padding-left:0;margin-bottom:var(--watt-space-xs)}watt-field:not(.watt-field--chip) .watt-field-wrapper{min-height:46px}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "directive", type: WattTooltipDirective, selector: "[wattTooltip]", inputs: ["wattTooltip", "wattTooltipPosition", "wattTooltipVariant"], exportAs: ["wattTooltip"] }, { kind: "component", type: WattFieldErrorComponent, selector: "watt-field-error" }, { kind: "component", type: VaterFlexComponent, selector: "vater-flex, [vater-flex]", inputs: ["autoSize"] }, { kind: "directive", type: VaterUtilityDirective, selector: "[vater]", inputs: ["center", "fill", "inset", "scrollable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
166
168
  }
167
169
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattFieldComponent, decorators: [{
168
170
  type: Component,
@@ -171,7 +173,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
171
173
  WattIconComponent,
172
174
  WattTooltipDirective,
173
175
  WattFieldErrorComponent,
174
- VaterStackComponent,
176
+ VaterFlexComponent,
177
+ VaterUtilityDirective,
175
178
  ], template: `
176
179
  @if (chipMode()) {
177
180
  <span class="watt-label">
@@ -192,8 +195,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
192
195
  }
193
196
  </span>
194
197
  }
195
- <vater-stack direction="row" gap="s">
198
+ <vater-flex direction="row" gap="s" align="center">
196
199
  <div
200
+ vater
201
+ fill="horizontal"
197
202
  #wrapper
198
203
  class="watt-field-wrapper"
199
204
  [class.watt-field--has-placeholder]="!!placeholder()"
@@ -208,7 +213,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
208
213
  <ng-content />
209
214
  </div>
210
215
  <ng-content select="watt-field-descriptor" />
211
- </vater-stack>
216
+ </vater-flex>
212
217
  <ng-content select="[popover]" />
213
218
  <ng-content select="watt-field-hint" />
214
219
  <ng-content select="watt-field-error" />
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-field.mjs","sources":["../../../libs/watt/package/field/watt-field-intl.service.ts","../../../libs/watt/package/field/watt-field-error.component.ts","../../../libs/watt/package/field/watt-field.component.ts","../../../libs/watt/package/field/watt-field-hint.component.ts","../../../libs/watt/package/field/index.ts","../../../libs/watt/package/field/energinet-watt-field.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n required = 'Field is required';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-error {\n color: var(--watt-color-state-danger);\n }\n `,\n ],\n})\nexport class WattFieldErrorComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterStackComponent } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterStackComponent,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode()) {\n <span class=\"watt-label\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.for]=\"id()\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </label>\n }\n\n <ng-template #template>\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-stack direction=\"row\" gap=\"s\">\n <div\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-stack>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--chip]': 'chipMode()',\n '[class.watt-field--unlabelled]': 'unlabelled()',\n '[class.watt-field--disabled]': 'control()?.disabled',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n elementRef = inject<ElementRef>(ElementRef);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n\n value = signal('');\n filler = computed(() => this.placeholder().slice(this.value().length));\n ghost = computed(() => this.value().slice(0, this.placeholder().length));\n\n unlabelled = computed(() => !this.label());\n\n errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n\n // Used for text fields with autocomplete\n wrapper = viewChild<ElementRef>('wrapper');\n\n constructor() {\n const control$ = toObservable(this.control).pipe(filter((control) => control !== null));\n\n // Track value in order to update ghost and filler\n const value$ = control$.pipe(\n switchMap((control) =>\n control.valueChanges.pipe(\n startWith(control.value),\n map((value) => (value === null || value === undefined ? '' : value.toString())),\n tap((value) => this.value.set(value))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Track status in order to update required state and show errors\n const status$ = control$.pipe(\n switchMap((control) =>\n control.statusChanges.pipe(\n startWith(control.status),\n tap(() => this.isRequired.set(this.isRequiredControl(control))),\n tap(() => this.errors.set(control.errors))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Subscribe for side effects\n value$.subscribe();\n status$.subscribe();\n }\n\n isRequiredControl(control: FormControl) {\n const validators = [Validators.required, WattRangeValidators.required];\n return validators.some((validator) => control.hasValidator(validator));\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-field-hint',\n styles: [\n `\n :host {\n color: var(--watt-color-neutral-grey-700);\n }\n `,\n ],\n template: `<ng-content />`,\n})\nexport class WattFieldHintComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattFieldComponent } from './watt-field.component';\nexport { WattFieldErrorComponent } from './watt-field-error.component';\nexport { WattFieldHintComponent } from './watt-field-hint.component';\nexport { WattFieldIntlService } from './watt-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,oBAAoB,CAAA;AACtB,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,QAAQ,GAAG,mBAAmB;uGAFnB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA;;2FACnB,oBAAoB,EAA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A,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,2EAFvB,CAAgB,cAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA,CAAA;;2FAEf,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,YAQjB,CAAgB,cAAA,CAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA;;;AC7B5B;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-field.mjs","sources":["../../../libs/watt/package/field/watt-field-intl.service.ts","../../../libs/watt/package/field/watt-field-error.component.ts","../../../libs/watt/package/field/watt-field.component.ts","../../../libs/watt/package/field/watt-field-hint.component.ts","../../../libs/watt/package/field/index.ts","../../../libs/watt/package/field/energinet-watt-field.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n required = 'Field is required';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-error {\n color: var(--watt-color-state-danger);\n }\n `,\n ],\n})\nexport class WattFieldErrorComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterFlexComponent, VaterUtilityDirective } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterFlexComponent,\n VaterUtilityDirective,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode()) {\n <span class=\"watt-label\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.for]=\"id()\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </label>\n }\n\n <ng-template #template>\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-flex direction=\"row\" gap=\"s\" align=\"center\">\n <div\n vater\n fill=\"horizontal\"\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-flex>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--chip]': 'chipMode()',\n '[class.watt-field--unlabelled]': 'unlabelled()',\n '[class.watt-field--disabled]': 'control()?.disabled',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n elementRef = inject<ElementRef>(ElementRef);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n\n value = signal('');\n filler = computed(() => this.placeholder().slice(this.value().length));\n ghost = computed(() => this.value().slice(0, this.placeholder().length));\n\n unlabelled = computed(() => !this.label());\n\n errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n\n // Used for text fields with autocomplete\n wrapper = viewChild<ElementRef>('wrapper');\n\n constructor() {\n const control$ = toObservable(this.control).pipe(filter((control) => control !== null));\n\n // Track value in order to update ghost and filler\n const value$ = control$.pipe(\n switchMap((control) =>\n control.valueChanges.pipe(\n startWith(control.value),\n map((value) => (value === null || value === undefined ? '' : value.toString())),\n tap((value) => this.value.set(value))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Track status in order to update required state and show errors\n const status$ = control$.pipe(\n switchMap((control) =>\n control.statusChanges.pipe(\n startWith(control.status),\n tap(() => this.isRequired.set(this.isRequiredControl(control))),\n tap(() => this.errors.set(control.errors))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Subscribe for side effects\n value$.subscribe();\n status$.subscribe();\n }\n\n isRequiredControl(control: FormControl) {\n const validators = [Validators.required, WattRangeValidators.required];\n return validators.some((validator) => control.hasValidator(validator));\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-field-hint',\n styles: [\n `\n :host {\n color: var(--watt-color-neutral-grey-700);\n }\n `,\n ],\n template: `<ng-content />`,\n})\nexport class WattFieldHintComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattFieldComponent } from './watt-field.component';\nexport { WattFieldErrorComponent } from './watt-field-error.component';\nexport { WattFieldHintComponent } from './watt-field-hint.component';\nexport { WattFieldIntlService } from './watt-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,oBAAoB,CAAA;AACtB,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,QAAQ,GAAG,mBAAmB;uGAFnB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACrBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,uBAAuB,CAAA;uGAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA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BAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,2EAFvB,CAAgB,cAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA,CAAA;;2FAEf,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,YAQjB,CAAgB,cAAA,CAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA;;;AC7B5B;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@energinet/watt",
4
- "version": "2.0.0",
4
+ "version": "2.0.2",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  ".": {