@energinet/watt 1.2.1 → 1.2.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.
@@ -10,6 +10,7 @@ export declare class WattDataTableComponent {
10
10
  ready: import("@angular/core").InputSignal<boolean>;
11
11
  enableSearch: import("@angular/core").InputSignal<boolean>;
12
12
  enableRetry: import("@angular/core").InputSignal<boolean>;
13
+ enableCount: import("@angular/core").InputSignal<boolean>;
13
14
  queryTime: import("@angular/core").InputSignal<number | undefined>;
14
15
  searchLabel: import("@angular/core").InputSignal<string | undefined>;
15
16
  enablePaginator: import("@angular/core").InputSignal<boolean>;
@@ -23,5 +24,5 @@ export declare class WattDataTableComponent {
23
24
  reset: () => void | undefined;
24
25
  onSearch(value: string): void;
25
26
  static ɵfac: i0.ɵɵFactoryDeclaration<WattDataTableComponent, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<WattDataTableComponent, "watt-data-table", never, { "error": { "alias": "error"; "required": false; "isSignal": true; }; "ready": { "alias": "ready"; "required": false; "isSignal": true; }; "enableSearch": { "alias": "enableSearch"; "required": false; "isSignal": true; }; "enableRetry": { "alias": "enableRetry"; "required": false; "isSignal": true; }; "queryTime": { "alias": "queryTime"; "required": false; "isSignal": true; }; "searchLabel": { "alias": "searchLabel"; "required": false; "isSignal": true; }; "enablePaginator": { "alias": "enablePaginator"; "required": false; "isSignal": true; }; "count": { "alias": "count"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, { "clear": "clear"; "pageChanged": "pageChanged"; "retry": "retry"; }, ["table"], ["h3", "h4", "*", "watt-data-actions", "watt-button", "watt-data-filters", "watt-table"], true, never>;
27
+ static ɵcmp: i0.ɵɵComponentDeclaration<WattDataTableComponent, "watt-data-table", never, { "error": { "alias": "error"; "required": false; "isSignal": true; }; "ready": { "alias": "ready"; "required": false; "isSignal": true; }; "enableSearch": { "alias": "enableSearch"; "required": false; "isSignal": true; }; "enableRetry": { "alias": "enableRetry"; "required": false; "isSignal": true; }; "enableCount": { "alias": "enableCount"; "required": false; "isSignal": true; }; "queryTime": { "alias": "queryTime"; "required": false; "isSignal": true; }; "searchLabel": { "alias": "searchLabel"; "required": false; "isSignal": true; }; "enablePaginator": { "alias": "enablePaginator"; "required": false; "isSignal": true; }; "count": { "alias": "count"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, { "clear": "clear"; "pageChanged": "pageChanged"; "retry": "retry"; }, ["table"], ["h3", "h4", "*", "watt-data-actions", "watt-button", "watt-data-filters", "watt-table"], true, never>;
27
28
  }
@@ -129,6 +129,7 @@ class WattDataTableComponent {
129
129
  ready = input(true);
130
130
  enableSearch = input(true);
131
131
  enableRetry = input(false);
132
+ enableCount = input(true);
132
133
  queryTime = input();
133
134
  searchLabel = input();
134
135
  enablePaginator = input(true);
@@ -146,14 +147,16 @@ class WattDataTableComponent {
146
147
  this.clear.emit();
147
148
  }
148
149
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
149
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattDataTableComponent, isStandalone: true, selector: "watt-data-table", inputs: { error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, ready: { classPropertyName: "ready", publicName: "ready", isSignal: true, isRequired: false, transformFunction: null }, enableSearch: { classPropertyName: "enableSearch", publicName: "enableSearch", isSignal: true, isRequired: false, transformFunction: null }, enableRetry: { classPropertyName: "enableRetry", publicName: "enableRetry", isSignal: true, isRequired: false, transformFunction: null }, queryTime: { classPropertyName: "queryTime", publicName: "queryTime", isSignal: true, isRequired: false, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: false, transformFunction: null }, enablePaginator: { classPropertyName: "enablePaginator", publicName: "enablePaginator", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clear: "clear", pageChanged: "pageChanged", retry: "retry" }, queries: [{ propertyName: "table", first: true, predicate: (WattTableComponent), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "search", first: true, predicate: WattSearchComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
150
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattDataTableComponent, isStandalone: true, selector: "watt-data-table", inputs: { error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, ready: { classPropertyName: "ready", publicName: "ready", isSignal: true, isRequired: false, transformFunction: null }, enableSearch: { classPropertyName: "enableSearch", publicName: "enableSearch", isSignal: true, isRequired: false, transformFunction: null }, enableRetry: { classPropertyName: "enableRetry", publicName: "enableRetry", isSignal: true, isRequired: false, transformFunction: null }, enableCount: { classPropertyName: "enableCount", publicName: "enableCount", isSignal: true, isRequired: false, transformFunction: null }, queryTime: { classPropertyName: "queryTime", publicName: "queryTime", isSignal: true, isRequired: false, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: false, transformFunction: null }, enablePaginator: { classPropertyName: "enablePaginator", publicName: "enablePaginator", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clear: "clear", pageChanged: "pageChanged", retry: "retry" }, queries: [{ propertyName: "table", first: true, predicate: (WattTableComponent), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "search", first: true, predicate: WattSearchComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
150
151
  <watt-card vater fill="vertical" [variant]="variant()">
151
152
  <vater-flex fill="vertical" gap="m">
152
153
  <vater-stack direction="row" gap="m">
153
154
  <vater-stack direction="row" gap="s">
154
155
  <ng-content select="h3" />
155
156
  <ng-content select="h4" />
156
- <span class="watt-chip-label">{{ count() ?? table().dataSource.totalCount }}</span>
157
+ @if (enableCount()) {
158
+ <span class="watt-chip-label">{{ count() ?? table().dataSource.totalCount }}</span>
159
+ }
157
160
  @if (queryTime()) {
158
161
  <span class="watt-label">in {{ queryTime() }} ms</span>
159
162
  }
@@ -215,7 +218,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
215
218
  <vater-stack direction="row" gap="s">
216
219
  <ng-content select="h3" />
217
220
  <ng-content select="h4" />
218
- <span class="watt-chip-label">{{ count() ?? table().dataSource.totalCount }}</span>
221
+ @if (enableCount()) {
222
+ <span class="watt-chip-label">{{ count() ?? table().dataSource.totalCount }}</span>
223
+ }
219
224
  @if (queryTime()) {
220
225
  <span class="watt-label">in {{ queryTime() }} ms</span>
221
226
  }
@@ -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';\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 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 <span class=\"watt-chip-label\">{{ count() ?? table().dataSource.totalCount }}</span>\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 scrollable fill=\"vertical\">\n <ng-content select=\"watt-table\" />\n @if (!table().loading && table().dataSource.filteredData.length === 0) {\n <div class=\"watt-data-table--empty-state\">\n <watt-empty-state\n [icon]=\"error() ? 'custom-power' : ready() ? 'cancel' : '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 queryTime = input<number>();\n searchLabel = input<string>();\n enablePaginator = input(true);\n count = input<number>();\n variant = input<WATT_CARD_VARIANT>('elevation');\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,EA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,EAAA,WAAA,EAAA,KAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,mBAAmB,gHACnB,mBAAmB,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAyFV,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBApGlC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,ijBAAA,CAAA,EAAA;;;AC9IH;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';\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 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 scrollable fill=\"vertical\">\n <ng-content select=\"watt-table\" />\n @if (!table().loading && table().dataSource.filteredData.length === 0) {\n <div class=\"watt-data-table--empty-state\">\n <watt-empty-state\n [icon]=\"error() ? 'custom-power' : ready() ? 'cancel' : '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 queryTime = input<number>();\n searchLabel = input<string>();\n enablePaginator = input(true);\n count = input<number>();\n variant = input<WATT_CARD_VARIANT>('elevation');\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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59
59
  ><ng-content
60
- /></mat-slide-toggle>`, isInline: true, styles: ["watt-slide-toggle .mat-mdc-slide-toggle{--mat-switch-track-outline-color: var(--watt-on-light-low-emphasis);--mat-switch-selected-track-outline-color: var(--watt-on-light-low-emphasis);--mat-switch-unselected-handle-horizontal-margin: 0 8px;--mat-switch-unselected-pressed-handle-horizontal-margin: 0 8px;--mat-switch-selected-handle-horizontal-margin: 0 -8px;--mat-switch-selected-pressed-handle-horizontal-margin: 0 -8px;--mdc-switch-unselected-hover-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-pressed-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-focus-handle-color: var(--watt-on-light-low-emphasis);--mat-switch-selected-track-outline-width: 0px}watt-slide-toggle .mat-mdc-slide-toggle:focus-within{--mat-switch-track-outline-color: var(--watt-color-primary)}watt-slide-toggle .mat-mdc-slide-toggle * label{font-size:1rem;line-height:1.5rem;font-weight:400;text-transform:none;letter-spacing:0;padding-left:8px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__track{--mdc-switch-track-shape: 100px;--mdc-switch-track-height: 32px;--mdc-switch-unselected-track-color: white;--mdc-switch-unselected-hover-track-color: white;--mdc-switch-unselected-focus-track-color: white;--mdc-switch-unselected-pressed-track-color: white;--mdc-switch-selected-track-color: var(--watt-color-primary);--mdc-switch-selected-pressed-track-color: var(--watt-color-primary);--mdc-switch-selected-hover-track-color: var(--watt-color-primary);--mdc-switch-selected-focus-track-color: var(--watt-color-primary)}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch{--mdc-switch-track-width: 52px;--mdc-switch-handle-elevation-shadow: none}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle{--mdc-switch-handle-surface-color: var(--watt-on-light-low-emphasis);--mdc-switch-handle-width: 16px;--mdc-switch-handle-height: 16px;--mdc-switch-handle-shape: 24px;--mat-switch-unselected-handle-size: 16px;--mat-switch-pressed-handle-size: 16px;--mat-switch-selected-handle-size: 16px;--mat-switch-selected-pressed-handle-size: 16px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle,watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch--selected{--mdc-switch-handle-surface-color: white}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle,watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch--unselected:enabled:hover:not(:focus):not(:active){--mdc-switch-unselected-hover-handle-color: var(--watt-on-light-low-emphasis)}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle-track{--mdc-switch-handle-width: 16px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__ripple{display:none}\n"], dependencies: [{ kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
60
+ /></mat-slide-toggle>`, isInline: true, styles: ["watt-slide-toggle .mat-mdc-slide-toggle{--mat-switch-track-outline-color: var(--watt-on-light-low-emphasis);--mat-switch-selected-track-outline-color: var(--watt-on-light-low-emphasis);--mat-switch-unselected-handle-horizontal-margin: 0 8px;--mat-switch-unselected-pressed-handle-horizontal-margin: 0 8px;--mat-switch-selected-handle-horizontal-margin: 0 -8px;--mat-switch-selected-pressed-handle-horizontal-margin: 0 -8px;--mdc-switch-unselected-hover-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-pressed-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-focus-handle-color: var(--watt-on-light-low-emphasis);--mat-switch-selected-track-outline-width: 0px}watt-slide-toggle .mat-mdc-slide-toggle:focus-within{--mat-switch-track-outline-color: var(--watt-color-primary)}watt-slide-toggle .mat-mdc-slide-toggle * label{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;padding-left:8px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__track{--mdc-switch-track-shape: 100px;--mdc-switch-track-height: 32px;--mdc-switch-unselected-track-color: white;--mdc-switch-unselected-hover-track-color: white;--mdc-switch-unselected-focus-track-color: white;--mdc-switch-unselected-pressed-track-color: white;--mdc-switch-selected-track-color: var(--watt-color-primary);--mdc-switch-selected-pressed-track-color: var(--watt-color-primary);--mdc-switch-selected-hover-track-color: var(--watt-color-primary);--mdc-switch-selected-focus-track-color: var(--watt-color-primary)}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch{--mdc-switch-track-width: 52px;--mdc-switch-handle-elevation-shadow: none}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle{--mdc-switch-handle-surface-color: var(--watt-on-light-low-emphasis);--mdc-switch-handle-width: 16px;--mdc-switch-handle-height: 16px;--mdc-switch-handle-shape: 24px;--mat-switch-unselected-handle-size: 16px;--mat-switch-pressed-handle-size: 16px;--mat-switch-selected-handle-size: 16px;--mat-switch-selected-pressed-handle-size: 16px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle,watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch--selected{--mdc-switch-handle-surface-color: white}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle,watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch--unselected:enabled:hover:not(:focus):not(:active){--mdc-switch-unselected-hover-handle-color: var(--watt-on-light-low-emphasis)}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle-track{--mdc-switch-handle-width: 16px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__ripple{display:none}\n"], dependencies: [{ kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
61
61
  }
62
62
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattSlideToggleComponent, decorators: [{
63
63
  type: Component,
@@ -74,7 +74,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
74
74
  [disableRipple]="true"
75
75
  [hideIcon]="true"
76
76
  ><ng-content
77
- /></mat-slide-toggle>`, styles: ["watt-slide-toggle .mat-mdc-slide-toggle{--mat-switch-track-outline-color: var(--watt-on-light-low-emphasis);--mat-switch-selected-track-outline-color: var(--watt-on-light-low-emphasis);--mat-switch-unselected-handle-horizontal-margin: 0 8px;--mat-switch-unselected-pressed-handle-horizontal-margin: 0 8px;--mat-switch-selected-handle-horizontal-margin: 0 -8px;--mat-switch-selected-pressed-handle-horizontal-margin: 0 -8px;--mdc-switch-unselected-hover-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-pressed-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-focus-handle-color: var(--watt-on-light-low-emphasis);--mat-switch-selected-track-outline-width: 0px}watt-slide-toggle .mat-mdc-slide-toggle:focus-within{--mat-switch-track-outline-color: var(--watt-color-primary)}watt-slide-toggle .mat-mdc-slide-toggle * label{font-size:1rem;line-height:1.5rem;font-weight:400;text-transform:none;letter-spacing:0;padding-left:8px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__track{--mdc-switch-track-shape: 100px;--mdc-switch-track-height: 32px;--mdc-switch-unselected-track-color: white;--mdc-switch-unselected-hover-track-color: white;--mdc-switch-unselected-focus-track-color: white;--mdc-switch-unselected-pressed-track-color: white;--mdc-switch-selected-track-color: var(--watt-color-primary);--mdc-switch-selected-pressed-track-color: var(--watt-color-primary);--mdc-switch-selected-hover-track-color: var(--watt-color-primary);--mdc-switch-selected-focus-track-color: var(--watt-color-primary)}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch{--mdc-switch-track-width: 52px;--mdc-switch-handle-elevation-shadow: none}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle{--mdc-switch-handle-surface-color: var(--watt-on-light-low-emphasis);--mdc-switch-handle-width: 16px;--mdc-switch-handle-height: 16px;--mdc-switch-handle-shape: 24px;--mat-switch-unselected-handle-size: 16px;--mat-switch-pressed-handle-size: 16px;--mat-switch-selected-handle-size: 16px;--mat-switch-selected-pressed-handle-size: 16px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle,watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch--selected{--mdc-switch-handle-surface-color: white}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle,watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch--unselected:enabled:hover:not(:focus):not(:active){--mdc-switch-unselected-hover-handle-color: var(--watt-on-light-low-emphasis)}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle-track{--mdc-switch-handle-width: 16px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__ripple{display:none}\n"] }]
77
+ /></mat-slide-toggle>`, styles: ["watt-slide-toggle .mat-mdc-slide-toggle{--mat-switch-track-outline-color: var(--watt-on-light-low-emphasis);--mat-switch-selected-track-outline-color: var(--watt-on-light-low-emphasis);--mat-switch-unselected-handle-horizontal-margin: 0 8px;--mat-switch-unselected-pressed-handle-horizontal-margin: 0 8px;--mat-switch-selected-handle-horizontal-margin: 0 -8px;--mat-switch-selected-pressed-handle-horizontal-margin: 0 -8px;--mdc-switch-unselected-hover-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-pressed-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-handle-color: var(--watt-on-light-low-emphasis);--mdc-switch-unselected-focus-handle-color: var(--watt-on-light-low-emphasis);--mat-switch-selected-track-outline-width: 0px}watt-slide-toggle .mat-mdc-slide-toggle:focus-within{--mat-switch-track-outline-color: var(--watt-color-primary)}watt-slide-toggle .mat-mdc-slide-toggle * label{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;padding-left:8px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__track{--mdc-switch-track-shape: 100px;--mdc-switch-track-height: 32px;--mdc-switch-unselected-track-color: white;--mdc-switch-unselected-hover-track-color: white;--mdc-switch-unselected-focus-track-color: white;--mdc-switch-unselected-pressed-track-color: white;--mdc-switch-selected-track-color: var(--watt-color-primary);--mdc-switch-selected-pressed-track-color: var(--watt-color-primary);--mdc-switch-selected-hover-track-color: var(--watt-color-primary);--mdc-switch-selected-focus-track-color: var(--watt-color-primary)}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch{--mdc-switch-track-width: 52px;--mdc-switch-handle-elevation-shadow: none}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle{--mdc-switch-handle-surface-color: var(--watt-on-light-low-emphasis);--mdc-switch-handle-width: 16px;--mdc-switch-handle-height: 16px;--mdc-switch-handle-shape: 24px;--mat-switch-unselected-handle-size: 16px;--mat-switch-pressed-handle-size: 16px;--mat-switch-selected-handle-size: 16px;--mat-switch-selected-pressed-handle-size: 16px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle,watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch--selected{--mdc-switch-handle-surface-color: white}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle,watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch--unselected:enabled:hover:not(:focus):not(:active){--mdc-switch-unselected-hover-handle-color: var(--watt-on-light-low-emphasis)}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__handle-track{--mdc-switch-handle-width: 16px}watt-slide-toggle .mat-mdc-slide-toggle .mdc-switch__ripple{display:none}\n"] }]
78
78
  }] });
79
79
 
80
80
  //#region License
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-slide-toggle.mjs","sources":["../../../libs/watt/package/slide-toggle/watt-slide-toggle.component.ts","../../../libs/watt/package/slide-toggle/index.ts","../../../libs/watt/package/slide-toggle/energinet-watt-slide-toggle.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 { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';\nimport {\n inject,\n input,\n model,\n signal,\n Component,\n forwardRef,\n ElementRef,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n} from '@angular/core';\n\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\n\n/**\n * Slide toggle\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [MatSlideToggleModule, FormsModule],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattSlideToggleComponent),\n multi: true,\n },\n ],\n selector: 'watt-slide-toggle',\n styleUrls: ['./watt-slide-toggle.component.scss'],\n template: `<mat-slide-toggle\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [(ngModel)]=\"checked\"\n [disableRipple]=\"true\"\n [hideIcon]=\"true\"\n ><ng-content\n /></mat-slide-toggle>`,\n})\nexport class WattSlideToggleComponent implements ControlValueAccessor {\n private element = inject(ElementRef);\n\n checked = model(false);\n isDisabled = signal(false);\n required = input(false);\n\n writeValue(checked: boolean): void {\n this.checked.set(checked);\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.checked.subscribe(fn);\n }\n\n registerOnTouched(fn: (value: boolean) => void): void {\n this.element.nativeElement.addEventListener('focusout', fn);\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.isDisabled.set(isDisabled);\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 { WattSlideToggleComponent } from './watt-slide-toggle.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index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,uBAAuB,CAAC,MAAM,EAChC,aAAA,EAAA,iBAAiB,CAAC,IAAI,EAC5B,OAAA,EAAA,CAAC,oBAAoB,EAAE,WAAW,CAAC,EACjC,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,8BAA8B,CAAC;AACvD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,QAAA,EACS,mBAAmB,EAEnB,QAAA,EAAA,CAAA;;;;;;;AAOY,uBAAA,CAAA,EAAA,MAAA,EAAA,CAAA,kqFAAA,CAAA,EAAA;;;ACxDxB;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-slide-toggle.mjs","sources":["../../../libs/watt/package/slide-toggle/watt-slide-toggle.component.ts","../../../libs/watt/package/slide-toggle/index.ts","../../../libs/watt/package/slide-toggle/energinet-watt-slide-toggle.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 { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';\nimport {\n inject,\n input,\n model,\n signal,\n Component,\n forwardRef,\n ElementRef,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n} from '@angular/core';\n\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\n\n/**\n * Slide toggle\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [MatSlideToggleModule, FormsModule],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattSlideToggleComponent),\n multi: true,\n },\n ],\n selector: 'watt-slide-toggle',\n styleUrls: ['./watt-slide-toggle.component.scss'],\n template: `<mat-slide-toggle\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [(ngModel)]=\"checked\"\n [disableRipple]=\"true\"\n [hideIcon]=\"true\"\n ><ng-content\n /></mat-slide-toggle>`,\n})\nexport class WattSlideToggleComponent implements ControlValueAccessor {\n private element = inject(ElementRef);\n\n checked = model(false);\n isDisabled = signal(false);\n required = input(false);\n\n writeValue(checked: boolean): void {\n this.checked.set(checked);\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.checked.subscribe(fn);\n }\n\n registerOnTouched(fn: (value: boolean) => void): void {\n this.element.nativeElement.addEventListener('focusout', fn);\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.isDisabled.set(isDisabled);\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 { WattSlideToggleComponent } from './watt-slide-toggle.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAgBA;;AAEG;MAuBU,wBAAwB,CAAA;AAC3B,IAAA,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;AAEpC,IAAA,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC;AACtB,IAAA,UAAU,GAAG,MAAM,C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