@energinet/watt 1.7.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,26 +12,89 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
  @layer vater {
15
+ vater-flex > *,
16
+ [vater-flex] > * {
17
+ flex: 1 1 0;
18
+ }
19
+
20
+ vater-stack,
21
+ [vater-stack] {
22
+ align-items: center;
23
+
24
+ &.vater-column > * {
25
+ min-height: min-content;
26
+ }
27
+
28
+ &.vater-row > * {
29
+ min-width: min-content;
30
+ }
31
+ }
32
+
33
+ .vater-column {
34
+ flex-direction: column;
35
+
36
+ & > .vater-fill-both,
37
+ & > .vater-fill-vertical {
38
+ flex-basis: 100%;
39
+ }
40
+ }
41
+
42
+ .vater-row {
43
+ flex-direction: row;
44
+
45
+ & > .vater-fill-both,
46
+ & > .vater-fill-horizontal {
47
+ flex-basis: 100%;
48
+ }
49
+ }
50
+
15
51
  .vater-fill-horizontal {
16
- display: block;
17
52
  width: 100%;
18
53
  }
19
54
 
20
55
  .vater-fill-vertical {
21
- display: block;
22
56
  height: 100%;
23
57
  }
24
58
 
25
59
  .vater-fill-both {
26
- display: block;
27
60
  width: 100%;
28
61
  height: 100%;
29
62
  }
30
63
 
64
+ :not(vater-stack, vater-flex) {
65
+ &.vater-fill-vertical,
66
+ &.vater-fill-horizontal,
67
+ &.vater-fill-both {
68
+ display: block;
69
+ }
70
+ }
71
+
72
+ .vater-scrollable {
73
+ &.vater-column {
74
+ overflow-x: hidden;
75
+ overflow-y: auto;
76
+ min-width: min-content;
77
+ }
78
+
79
+ &.vater-row {
80
+ overflow-x: auto;
81
+ overflow-y: hidden;
82
+ min-height: min-content;
83
+ }
84
+
85
+ &:not(.vater-column, .vater-row) {
86
+ overflow: auto;
87
+ }
88
+ }
89
+
31
90
  .vater-center {
32
91
  margin: auto;
33
92
  }
34
93
 
94
+ .vater-wrap {
95
+ flex-wrap: wrap;
96
+ }
97
+
35
98
  .vater-inset-0 {
36
99
  position: absolute;
37
100
  inset: 0;
@@ -66,4 +129,136 @@
66
129
  position: absolute;
67
130
  inset: var(--watt-space-xl);
68
131
  }
132
+
133
+ .vater-offset-xs {
134
+ &.vater-column {
135
+ padding: var(--watt-space-xs) 0;
136
+ }
137
+
138
+ &.vater-row {
139
+ padding: 0 var(--watt-space-xs);
140
+ }
141
+ }
142
+
143
+ .vater-offset-s {
144
+ &.vater-column {
145
+ padding: var(--watt-space-s) 0;
146
+ }
147
+
148
+ &.vater-row {
149
+ padding: 0 var(--watt-space-s);
150
+ }
151
+ }
152
+
153
+ .vater-offset-m {
154
+ &.vater-column {
155
+ padding: var(--watt-space-m) 0;
156
+ }
157
+
158
+ &.vater-row {
159
+ padding: 0 var(--watt-space-m);
160
+ }
161
+ }
162
+
163
+ .vater-offset-ml {
164
+ &.vater-column {
165
+ padding: var(--watt-space-ml) 0;
166
+ }
167
+
168
+ &.vater-row {
169
+ padding: 0 var(--watt-space-ml);
170
+ }
171
+ }
172
+
173
+ .vater-offset-l {
174
+ &.vater-column {
175
+ padding: var(--watt-space-l) 0;
176
+ }
177
+
178
+ &.vater-row {
179
+ padding: 0 var(--watt-space-l);
180
+ }
181
+ }
182
+
183
+ .vater-offset-xl {
184
+ &.vater-column {
185
+ padding: var(--watt-space-xl) 0;
186
+ }
187
+
188
+ &.vater-row {
189
+ padding: 0 var(--watt-space-xl);
190
+ }
191
+ }
192
+
193
+ .vater-gap-xs {
194
+ gap: var(--watt-space-xs);
195
+ }
196
+
197
+ .vater-gap-s {
198
+ gap: var(--watt-space-s);
199
+ }
200
+
201
+ .vater-gap-m {
202
+ gap: var(--watt-space-m);
203
+ }
204
+
205
+ .vater-gap-ml {
206
+ gap: var(--watt-space-ml);
207
+ }
208
+
209
+ .vater-gap-l {
210
+ gap: var(--watt-space-l);
211
+ }
212
+
213
+ .vater-gap-xl {
214
+ gap: var(--watt-space-xl);
215
+ }
216
+
217
+ .vater-flex-auto > * {
218
+ flex: auto;
219
+ }
220
+
221
+ .vater-align-stretch {
222
+ align-items: stretch;
223
+ }
224
+
225
+ .vater-align-start {
226
+ align-items: flex-start;
227
+ }
228
+
229
+ .vater-align-end {
230
+ align-items: flex-end;
231
+ }
232
+
233
+ .vater-align-center {
234
+ align-items: center;
235
+ }
236
+
237
+ .vater-align-baseline {
238
+ align-items: baseline;
239
+ }
240
+
241
+ .vater-justify-start {
242
+ justify-content: flex-start;
243
+ }
244
+
245
+ .vater-justify-end {
246
+ justify-content: flex-end;
247
+ }
248
+
249
+ .vater-justify-center {
250
+ justify-content: center;
251
+ }
252
+
253
+ .vater-justify-space-between {
254
+ justify-content: space-between;
255
+ }
256
+
257
+ .vater-justify-space-around {
258
+ justify-content: space-around;
259
+ }
260
+
261
+ .vater-justify-space-evenly {
262
+ justify-content: space-evenly;
263
+ }
69
264
  }
@@ -16,6 +16,7 @@ export declare class WattDataTableComponent {
16
16
  searchLabel: import("@angular/core").InputSignal<string | undefined>;
17
17
  enablePaginator: import("@angular/core").InputSignal<boolean>;
18
18
  count: import("@angular/core").InputSignal<number | undefined>;
19
+ autoSize: import("@angular/core").InputSignal<boolean>;
19
20
  variant: import("@angular/core").InputSignal<WATT_CARD_VARIANT>;
20
21
  emptyStateIcon: import("@angular/core").InputSignal<"search" | "filter" | "plus" | "minus" | "edit" | "redo" | "undo" | "remove" | "removeForever" | "close" | "cancel" | "checkmark" | "user" | "settings" | "contentCopy" | "date" | "time" | "email" | "markEmailUnread" | "link" | "openInNew" | "monetization" | "payments" | "forwardMessage" | "menu" | "moreVertical" | "logout" | "login" | "help" | "alternateEmail" | "refresh" | "language" | "pendingActions" | "toggleOn" | "toggleOff" | "personCheck" | "left" | "right" | "up" | "down" | "arrowDropDown" | "arrowRightAlt" | "arrowLeftAlt" | "danger" | "warning" | "success" | "info" | "feedback" | "save" | "upload" | "download" | "fileDownload" | "print" | "preview" | "power" | "location" | "smartDisplay" | "windmill" | "solarPower" | "priorityHigh" | "notifications" | "notificationsUnread" | "horizontalRule" | "wrongLocation" | "heatPump" | "inventory" | "globe" | "calculate" | "bar_chart_4_bars" | "view_list" | "view_stream" | "construction" | "custom-power" | "custom-explore" | "custom-no-results">;
21
22
  clear: import("@angular/core").OutputEmitterRef<void>;
@@ -26,5 +27,5 @@ export declare class WattDataTableComponent {
26
27
  reset: () => void | undefined;
27
28
  onSearch(value: string): void;
28
29
  static ɵfac: i0.ɵɵFactoryDeclaration<WattDataTableComponent, never>;
29
- 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; }; "enableEmptyState": { "alias": "enableEmptyState"; "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; }; "emptyStateIcon": { "alias": "emptyStateIcon"; "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>;
30
+ 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; }; "enableEmptyState": { "alias": "enableEmptyState"; "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; }; "autoSize": { "alias": "autoSize"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "emptyStateIcon": { "alias": "emptyStateIcon"; "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>;
30
31
  }
@@ -77,7 +77,7 @@ class WattCodeComponent {
77
77
  <code class="watt-code-content" [innerHTML]="formattedCode()"></code>
78
78
  </pre>
79
79
  }
80
- `, isInline: true, styles: ["watt-tabs watt-code pre code.watt-code-content{padding:0}watt-code{display:block;overflow:auto}watt-code pre{display:flex;margin-top:0;margin-bottom:0;word-wrap:break-word}watt-code pre code{flex:1;line-height:1.8em;font-size:14px;min-height:100%;padding:1em 1.2em;text-wrap:balance}\n"], dependencies: [{ kind: "component", type: WattSpinnerComponent, selector: "watt-spinner", inputs: ["diameter", "strokeWidth"] }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]", inputs: ["align", "direction", "gap", "justify", "offset"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
80
+ `, isInline: true, styles: ["watt-tabs watt-code pre code.watt-code-content{padding:0}watt-code{display:block;overflow:auto}watt-code pre{display:flex;margin-top:0;margin-bottom:0;word-wrap:break-word}watt-code pre code{flex:1;line-height:1.8em;font-size:14px;min-height:100%;padding:1em 1.2em;text-wrap:balance}\n"], dependencies: [{ kind: "component", type: WattSpinnerComponent, selector: "watt-spinner", inputs: ["diameter", "strokeWidth"] }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
81
81
  }
82
82
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattCodeComponent, decorators: [{
83
83
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-code.mjs","sources":["../../../libs/watt/package/code/watt-code.worker.token.ts","../../../libs/watt/package/code/watt-code.component.ts","../../../libs/watt/package/code/index.ts","../../../libs/watt/package/code/energinet-watt-code.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 { InjectionToken } from '@angular/core';\n\nexport const WATT_CODE_HIGHLIGHT_WORKER_FACTORY = new InjectionToken<(() => Worker) | null>(\n 'WattCodeHighlightWorkerFactory',\n { factory: () => null }\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 ChangeDetectionStrategy,\n ViewEncapsulation,\n signal,\n input,\n OnDestroy,\n inject,\n effect,\n linkedSignal,\n} from '@angular/core';\n\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\nimport { VaterStackComponent } from '@energinet/watt/vater';\n\nimport { WATT_CODE_HIGHLIGHT_WORKER_FACTORY } from './watt-code.worker.token';\n\n@Component({\n selector: 'watt-code',\n template: `\n @if (loading()) {\n <vater-stack [fill]=\"'horizontal'\" [align]=\"'center'\"><watt-spinner /></vater-stack>\n } @else {\n <pre>\n <code class=\"watt-code-content\" [innerHTML]=\"formattedCode()\"></code>\n </pre>\n }\n `,\n styleUrls: ['./watt-code.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WattSpinnerComponent, VaterStackComponent],\n})\nexport class WattCodeComponent implements OnDestroy {\n private highlightWorkerFactory = inject(WATT_CODE_HIGHLIGHT_WORKER_FACTORY);\n private worker = this.highlightWorkerFactory?.();\n\n code = input.required<string | null | undefined>();\n\n /** @ignore */\n formattedCode = linkedSignal(() => this.code() ?? '');\n\n /** @ignore */\n loading = signal(false);\n\n /** @ignore */\n ngOnDestroy(): void {\n this.worker?.terminate();\n }\n\n constructor() {\n effect(() => {\n const code = this.code();\n if (!code) return;\n if (!this.worker) return;\n this.loading.set(true);\n this.worker.onmessage = (event) => {\n this.formattedCode.set(event.data);\n this.loading.set(false);\n };\n this.worker.postMessage(code);\n });\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattCodeComponent } from './watt-code.component';\nexport { WATT_CODE_HIGHLIGHT_WORKER_FACTORY } from './watt-code.worker.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"m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code.component.ts","../../../libs/watt/package/code/index.ts","../../../libs/watt/package/code/energinet-watt-code.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 { InjectionToken } from '@angular/core';\n\nexport const WATT_CODE_HIGHLIGHT_WORKER_FACTORY = new InjectionToken<(() => Worker) | null>(\n 'WattCodeHighlightWorkerFactory',\n { factory: () => null }\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 ChangeDetectionStrategy,\n ViewEncapsulation,\n signal,\n input,\n OnDestroy,\n inject,\n effect,\n linkedSignal,\n} from '@angular/core';\n\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\nimport { VaterStackComponent } from '@energinet/watt/vater';\n\nimport { WATT_CODE_HIGHLIGHT_WORKER_FACTORY } from './watt-code.worker.token';\n\n@Component({\n selector: 'watt-code',\n template: `\n @if (loading()) {\n <vater-stack [fill]=\"'horizontal'\" [align]=\"'center'\"><watt-spinner /></vater-stack>\n } @else {\n <pre>\n <code class=\"watt-code-content\" [innerHTML]=\"formattedCode()\"></code>\n </pre>\n }\n `,\n styleUrls: ['./watt-code.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WattSpinnerComponent, VaterStackComponent],\n})\nexport class WattCodeComponent implements OnDestroy {\n private highlightWorkerFactory = inject(WATT_CODE_HIGHLIGHT_WORKER_FACTORY);\n private worker = this.highlightWorkerFactory?.();\n\n code = input.required<string | null | undefined>();\n\n /** @ignore */\n formattedCode = linkedSignal(() => this.code() ?? '');\n\n /** @ignore */\n loading = signal(false);\n\n /** @ignore */\n ngOnDestroy(): void {\n this.worker?.terminate();\n }\n\n constructor() {\n effect(() => {\n const code = this.code();\n if (!code) return;\n if (!this.worker) return;\n this.loading.set(true);\n this.worker.onmessage = (event) => {\n this.formattedCode.set(event.data);\n this.loading.set(false);\n };\n this.worker.postMessage(code);\n });\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattCodeComponent } from './watt-code.component';\nexport { WATT_CODE_HIGHLIGHT_WORKER_FACTORY } from './watt-code.worker.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAGa,MAAA,kCAAkC,GAAG,IAAI,cAAc,CAClE,gCAAgC,EAChC,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE;;ACtBzB;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAkCa,iBAAiB,CAAA;AACpB,IAAA,sBAAsB,GAAG,MAAM,CAAC,kCAAkC,CAA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A,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;;;GAQT,EAIS,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,+RAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,oBAAoB,8FAAE,mBAAmB,EAAA,QAAA,EAAA,4BAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAExC,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAhB7B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EACX,QAAA,EAAA;;;;;;;;AAQT,EAAA,CAAA,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,OAAA,EAC5B,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,EAAA,MAAA,EAAA,CAAA,+RAAA,CAAA,EAAA;;;ACjDtD;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
@@ -135,6 +135,7 @@ class WattDataTableComponent {
135
135
  searchLabel = input();
136
136
  enablePaginator = input(true);
137
137
  count = input();
138
+ autoSize = input(false);
138
139
  variant = input('elevation');
139
140
  emptyStateIcon = input('cancel');
140
141
  clear = output();
@@ -149,9 +150,9 @@ class WattDataTableComponent {
149
150
  this.clear.emit();
150
151
  }
151
152
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
152
- 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 }, enableEmptyState: { classPropertyName: "enableEmptyState", publicName: "enableEmptyState", 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 }, emptyStateIcon: { classPropertyName: "emptyStateIcon", publicName: "emptyStateIcon", 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: `
153
+ 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 }, enableEmptyState: { classPropertyName: "enableEmptyState", publicName: "enableEmptyState", 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 }, autoSize: { classPropertyName: "autoSize", publicName: "autoSize", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, emptyStateIcon: { classPropertyName: "emptyStateIcon", publicName: "emptyStateIcon", 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: `
153
154
  <watt-card vater fill="vertical" [variant]="variant()">
154
- <vater-flex fill="vertical" gap="m">
155
+ <vater-flex autoSize fill="vertical" gap="m">
155
156
  <vater-stack direction="row" gap="m">
156
157
  <vater-stack direction="row" gap="s">
157
158
  <ng-content select="h3" />
@@ -172,7 +173,7 @@ class WattDataTableComponent {
172
173
  <ng-content select="watt-button" />
173
174
  </vater-stack>
174
175
  <ng-content select="watt-data-filters" />
175
- <vater-flex scrollable fill="vertical">
176
+ <vater-flex [autoSize]="autoSize()" fill="vertical">
176
177
  <ng-content select="watt-table" />
177
178
  @if (
178
179
  enableEmptyState() && !table().loading && table().dataSource.filteredData.length === 0
@@ -201,7 +202,7 @@ class WattDataTableComponent {
201
202
  }
202
203
  </vater-flex>
203
204
  </watt-card>
204
- `, 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: ["direction", "grow", "shrink", "basis", "gap", "justify", "wrap", "scrollable", "offset"] }, { kind: "component", type: VaterSpacerComponent, selector: "vater-spacer, [vater-spacer]" }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]", inputs: ["align", "direction", "gap", "justify", "offset"] }, { kind: "directive", type: VaterUtilityDirective, selector: "[vater]", inputs: ["fill", "inset", "center"] }, { 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 });
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 });
205
206
  }
206
207
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDataTableComponent, decorators: [{
207
208
  type: Component,
@@ -217,7 +218,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
217
218
  WattButtonComponent,
218
219
  ], encapsulation: ViewEncapsulation.None, template: `
219
220
  <watt-card vater fill="vertical" [variant]="variant()">
220
- <vater-flex fill="vertical" gap="m">
221
+ <vater-flex autoSize fill="vertical" gap="m">
221
222
  <vater-stack direction="row" gap="m">
222
223
  <vater-stack direction="row" gap="s">
223
224
  <ng-content select="h3" />
@@ -238,7 +239,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
238
239
  <ng-content select="watt-button" />
239
240
  </vater-stack>
240
241
  <ng-content select="watt-data-filters" />
241
- <vater-flex scrollable fill="vertical">
242
+ <vater-flex [autoSize]="autoSize()" fill="vertical">
242
243
  <ng-content select="watt-table" />
243
244
  @if (
244
245
  enableEmptyState() && !table().loading && table().dataSource.filteredData.length === 0
@@ -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 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 (\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 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,EA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EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,mBAAmB,gHACnB,mBAAmB,EAAA,QAAA,EAAA,aAAA,EAAA,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 :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,wBAA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AAA,EAAA,MAAA,EAAA,CAAA,ijBAAA,CAAA,EAAA;;;ACnJH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
@@ -199,7 +199,7 @@ class WattDropZone {
199
199
  </vater-stack>
200
200
  </span>
201
201
  </watt-field>
202
- `, isInline: true, styles: [".wrapper{display:block;min-height:184px}.dropzone{background:var(--watt-color-neutral-grey-200)}.dragOver{background:var(--watt-color-state-info-light)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]", inputs: ["align", "direction", "gap", "justify", "offset"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName"] }] });
202
+ `, isInline: true, styles: [".wrapper{display:block;min-height:184px}.dropzone{background:var(--watt-color-neutral-grey-200)}.dragOver{background:var(--watt-color-state-info-light)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]" }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName"] }] });
203
203
  }
204
204
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDropZone, decorators: [{
205
205
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-dropzone.mjs","sources":["../../../libs/watt/package/dropzone/watt-dropzone-intl.ts","../../../libs/watt/package/dropzone/watt-dropzone-validators.ts","../../../libs/watt/package/dropzone/watt-dropzone.ts","../../../libs/watt/package/dropzone/index.ts","../../../libs/watt/package/dropzone/energinet-watt-dropzone.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';\n\n@Injectable({ providedIn: 'root' })\nexport class WattDropZoneIntlService {\n prompt = 'Drop file here';\n promptMultiple = 'Drop files here';\n separator = 'or';\n button = 'Choose file';\n buttonMultiple = 'Choose files';\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 { Directive, inject } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\nimport { WattDropZone, MimeType } from './watt-dropzone';\n\n/**\n * Directive that validates the file type of provided files. This is automatically\n * applied to the `WattDropZone` component via `hostDirectives`.\n */\n@Directive({\n providers: [{ provide: NG_VALIDATORS, useExisting: FileTypeValidator, multi: true }],\n})\nexport class FileTypeValidator implements Validator {\n component = inject(WattDropZone, { host: true, self: true });\n validate(control: AbstractControl<File[] | null>): ValidationErrors | null {\n const accept = this.component.accept();\n return accept.length > 0 && control.value?.some((i) => !accept.includes(i.type as MimeType))\n ? { type: true }\n : null;\n }\n}\n\n/**\n * Directive validating that a single file is selected when `multiple` is false.\n * This is automatically applied to the `WattDropZone` component via `hostDirectives`.\n */\n@Directive({\n providers: [{ provide: NG_VALIDATORS, useExisting: MultipleFilesValidator, multi: true }],\n})\nexport class MultipleFilesValidator implements Validator {\n component = inject(WattDropZone, { host: true, self: true });\n validate(control: AbstractControl<File[] | null>): ValidationErrors | null {\n const multiple = this.component.multiple();\n return !multiple && control.value?.length !== 1 ? { multiple: true } : null;\n }\n}\n\n/** Validates that the file size is less than or equal to the specified maximum size. */\nexport const limitFiles =\n (limit: number) =>\n (control: AbstractControl<File[] | null>): ValidationErrors | null =>\n control.value?.length && control.value.length > limit ? { limit } : null;\n\n/** Validates that the file size is less than or equal to the specified maximum size. */\nexport const maxFileSize =\n (size: number) =>\n (control: AbstractControl<File[] | null>): ValidationErrors | null =>\n control.value?.some((file) => file.size > size) ? { size } : null;\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 booleanAttribute,\n forwardRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { VaterStackComponent, VaterUtilityDirective } from '@energinet/watt/vater';\nimport { WattDropZoneIntlService } from './watt-dropzone-intl';\nimport { FileTypeValidator, MultipleFilesValidator } from './watt-dropzone-validators';\n\n// Slightly better typing than just raw string\nexport type MimeType = `${string}/${string}`;\n\n@Component({\n imports: [\n ReactiveFormsModule,\n VaterStackComponent,\n VaterUtilityDirective,\n WattButtonComponent,\n WattFieldComponent,\n ],\n selector: 'watt-dropzone',\n hostDirectives: [FileTypeValidator, MultipleFilesValidator],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattDropZone),\n multi: true,\n },\n ],\n styles: `\n .wrapper {\n display: block;\n min-height: 184px; /* Magic UX number */\n }\n\n .dropzone {\n background: var(--watt-color-neutral-grey-200);\n }\n\n .dragOver {\n background: var(--watt-color-state-info-light);\n }\n `,\n template: `\n <watt-field [label]=\"label()\">\n <ng-content />\n <ng-content select=\"watt-field-error\" ngProjectAs=\"watt-field-error\" />\n <ng-content select=\"watt-field-hint\" ngProjectAs=\"watt-field-hint\" />\n <span class=\"wrapper\">\n <vater-stack\n inset=\"0\"\n class=\"dropzone\"\n [class.dragOver]=\"dragOver()\"\n (dragover)=\"handleDragOver($event)\"\n (drop)=\"handleDrop($event)\"\n (drop)=\"dragOver.set(false)\"\n (dragleave)=\"dragOver.set(false)\"\n >\n <vater-stack center gap=\"xs\">\n <input\n #input\n hidden\n type=\"file\"\n [multiple]=\"multiple()\"\n [accept]=\"accept().join(',')\"\n (change)=\"handleFiles(input.files)\"\n />\n <span>{{ multiple() ? intl.promptMultiple : intl.prompt }}</span>\n <span class=\"watt-on-light--medium-emphasis\">{{ intl.separator }}</span>\n <watt-button size=\"small\" variant=\"secondary\" (click)=\"input.click()\">\n {{ multiple() ? intl.buttonMultiple : intl.button }}\n </watt-button>\n </vater-stack>\n </vater-stack>\n </span>\n </watt-field>\n `,\n})\n// eslint-disable-next-line @angular-eslint/component-class-suffix\nexport class WattDropZone implements ControlValueAccessor {\n intl = inject(WattDropZoneIntlService);\n\n /** Whether the dropzone should accept multiple files. */\n multiple = input(false, { transform: booleanAttribute });\n\n /** Label for the dropzone. */\n label = input<string>();\n\n /** Comma-separated list of MIME types that the dropzone accepts. */\n accept = input([], { transform: (value: MimeType) => value.split(',') as MimeType[] });\n\n /** Emits when one or more files are selected. */\n selected = output<File[]>();\n\n // Tracks (valid) drag over state\n dragOver = signal(false);\n\n handleFiles(files: FileList | null) {\n if (!files) return;\n this.selected.emit(Array.from(files));\n }\n\n handleDrop(event: DragEvent) {\n if (!event.dataTransfer) return;\n if (!this.dragOver()) return;\n\n // Prevent opening the file in the browser\n event.preventDefault();\n\n this.handleFiles(event.dataTransfer.files);\n }\n\n handleDragOver(event: DragEvent) {\n if (!event.dataTransfer) return;\n\n // Ignore non-file items such as strings\n if (Array.from(event.dataTransfer.items).some((i) => i.kind !== 'file')) return;\n\n // Prevent opening the file in the browser\n event.preventDefault();\n\n this.dragOver.set(true);\n }\n\n // Implementation for ControlValueAccessor\n writeValue = () => {}; // eslint-disable-line @typescript-eslint/no-empty-function\n registerOnTouched = (fn: () => void) => this.selected.subscribe(fn);\n registerOnChange = (fn: (value: File[]) => void) => this.selected.subscribe(fn);\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 { WattDropZone } from './watt-dropzone';\nexport { WattDropZoneIntlService } from './watt-dropzone-intl';\nexport {\n FileTypeValidator,\n MultipleFilesValidator,\n maxFileSize,\n limitFiles,\n} from './watt-dropzone-validators';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.FileTypeValidator","i1.MultipleFilesValidator"],"mappings":";;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAIa,uBAAuB,CAAA;IAClC,MAAM,GAAG,gBAAgB;IACzB,cAAc,GAAG,iBAAiB;IAClC,SA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B;wBACrB,mBAAmB;wBACnB,kBAAkB;AACnB,qBAAA,EAAA,QAAA,EACS,eAAe,EACT,cAAA,EAAA,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,EAChD,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,kBAAkB,CAAC;AAC3C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;qBACF,EAeS,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,4JAAA,CAAA,EAAA;;;ACrGH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-dropzone.mjs","sources":["../../../libs/watt/package/dropzone/watt-dropzone-intl.ts","../../../libs/watt/package/dropzone/watt-dropzone-validators.ts","../../../libs/watt/package/dropzone/watt-dropzone.ts","../../../libs/watt/package/dropzone/index.ts","../../../libs/watt/package/dropzone/energinet-watt-dropzone.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';\n\n@Injectable({ providedIn: 'root' })\nexport class WattDropZoneIntlService {\n prompt = 'Drop file here';\n promptMultiple = 'Drop files here';\n separator = 'or';\n button = 'Choose file';\n buttonMultiple = 'Choose files';\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 { Directive, inject } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\nimport { WattDropZone, MimeType } from './watt-dropzone';\n\n/**\n * Directive that validates the file type of provided files. This is automatically\n * applied to the `WattDropZone` component via `hostDirectives`.\n */\n@Directive({\n providers: [{ provide: NG_VALIDATORS, useExisting: FileTypeValidator, multi: true }],\n})\nexport class FileTypeValidator implements Validator {\n component = inject(WattDropZone, { host: true, self: true });\n validate(control: AbstractControl<File[] | null>): ValidationErrors | null {\n const accept = this.component.accept();\n return accept.length > 0 && control.value?.some((i) => !accept.includes(i.type as MimeType))\n ? { type: true }\n : null;\n }\n}\n\n/**\n * Directive validating that a single file is selected when `multiple` is false.\n * This is automatically applied to the `WattDropZone` component via `hostDirectives`.\n */\n@Directive({\n providers: [{ provide: NG_VALIDATORS, useExisting: MultipleFilesValidator, multi: true }],\n})\nexport class MultipleFilesValidator implements Validator {\n component = inject(WattDropZone, { host: true, self: true });\n validate(control: AbstractControl<File[] | null>): ValidationErrors | null {\n const multiple = this.component.multiple();\n return !multiple && control.value?.length !== 1 ? { multiple: true } : null;\n }\n}\n\n/** Validates that the file size is less than or equal to the specified maximum size. */\nexport const limitFiles =\n (limit: number) =>\n (control: AbstractControl<File[] | null>): ValidationErrors | null =>\n control.value?.length && control.value.length > limit ? { limit } : null;\n\n/** Validates that the file size is less than or equal to the specified maximum size. */\nexport const maxFileSize =\n (size: number) =>\n (control: AbstractControl<File[] | null>): ValidationErrors | null =>\n control.value?.some((file) => file.size > size) ? { size } : null;\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 booleanAttribute,\n forwardRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { VaterStackComponent, VaterUtilityDirective } from '@energinet/watt/vater';\nimport { WattDropZoneIntlService } from './watt-dropzone-intl';\nimport { FileTypeValidator, MultipleFilesValidator } from './watt-dropzone-validators';\n\n// Slightly better typing than just raw string\nexport type MimeType = `${string}/${string}`;\n\n@Component({\n imports: [\n ReactiveFormsModule,\n VaterStackComponent,\n VaterUtilityDirective,\n WattButtonComponent,\n WattFieldComponent,\n ],\n selector: 'watt-dropzone',\n hostDirectives: [FileTypeValidator, MultipleFilesValidator],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattDropZone),\n multi: true,\n },\n ],\n styles: `\n .wrapper {\n display: block;\n min-height: 184px; /* Magic UX number */\n }\n\n .dropzone {\n background: var(--watt-color-neutral-grey-200);\n }\n\n .dragOver {\n background: var(--watt-color-state-info-light);\n }\n `,\n template: `\n <watt-field [label]=\"label()\">\n <ng-content />\n <ng-content select=\"watt-field-error\" ngProjectAs=\"watt-field-error\" />\n <ng-content select=\"watt-field-hint\" ngProjectAs=\"watt-field-hint\" />\n <span class=\"wrapper\">\n <vater-stack\n inset=\"0\"\n class=\"dropzone\"\n [class.dragOver]=\"dragOver()\"\n (dragover)=\"handleDragOver($event)\"\n (drop)=\"handleDrop($event)\"\n (drop)=\"dragOver.set(false)\"\n (dragleave)=\"dragOver.set(false)\"\n >\n <vater-stack center gap=\"xs\">\n <input\n #input\n hidden\n type=\"file\"\n [multiple]=\"multiple()\"\n [accept]=\"accept().join(',')\"\n (change)=\"handleFiles(input.files)\"\n />\n <span>{{ multiple() ? intl.promptMultiple : intl.prompt }}</span>\n <span class=\"watt-on-light--medium-emphasis\">{{ intl.separator }}</span>\n <watt-button size=\"small\" variant=\"secondary\" (click)=\"input.click()\">\n {{ multiple() ? intl.buttonMultiple : intl.button }}\n </watt-button>\n </vater-stack>\n </vater-stack>\n </span>\n </watt-field>\n `,\n})\n// eslint-disable-next-line @angular-eslint/component-class-suffix\nexport class WattDropZone implements ControlValueAccessor {\n intl = inject(WattDropZoneIntlService);\n\n /** Whether the dropzone should accept multiple files. */\n multiple = input(false, { transform: booleanAttribute });\n\n /** Label for the dropzone. */\n label = input<string>();\n\n /** Comma-separated list of MIME types that the dropzone accepts. */\n accept = input([], { transform: (value: MimeType) => value.split(',') as MimeType[] });\n\n /** Emits when one or more files are selected. */\n selected = output<File[]>();\n\n // Tracks (valid) drag over state\n dragOver = signal(false);\n\n handleFiles(files: FileList | null) {\n if (!files) return;\n this.selected.emit(Array.from(files));\n }\n\n handleDrop(event: DragEvent) {\n if (!event.dataTransfer) return;\n if (!this.dragOver()) return;\n\n // Prevent opening the file in the browser\n event.preventDefault();\n\n this.handleFiles(event.dataTransfer.files);\n }\n\n handleDragOver(event: DragEvent) {\n if (!event.dataTransfer) return;\n\n // Ignore non-file items such as strings\n if (Array.from(event.dataTransfer.items).some((i) => i.kind !== 'file')) return;\n\n // Prevent opening the file in the browser\n event.preventDefault();\n\n this.dragOver.set(true);\n }\n\n // Implementation for ControlValueAccessor\n writeValue = () => {}; // eslint-disable-line @typescript-eslint/no-empty-function\n registerOnTouched = (fn: () => void) => this.selected.subscribe(fn);\n registerOnChange = (fn: (value: File[]) => void) => this.selected.subscribe(fn);\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 { WattDropZone } from './watt-dropzone';\nexport { WattDropZoneIntlService } from './watt-dropzone-intl';\nexport {\n FileTypeValidator,\n MultipleFilesValidator,\n maxFileSize,\n limitFiles,\n} from './watt-dropzone-validators';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.FileTypeValidator","i1.MultipleFilesValidator"],"mappings":";;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAIa,uBAAuB,CAAA;IAClC,MAAM,GAAG,gBAAgB;IACzB,cAAc,GAAG,iBAAiB;IAClC,SAAS,GAAG,IAAI;IAChB,MAAM,GAAG,aAAa;IACtB,cAAc,GAAG,cAAc;uGALpB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cADV,MAAM,EAAA,CAAA;;2FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACpBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAKA;;;AAGG;MAIU,iBAAiB,CAAA;AAC5B,IAAA,SAAS,GAAG,MAAM,CAAC,YAAY,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EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,4JAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EA9DC,mBAAmB,EACnB,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,mBAAmB,EAEnB,QAAA,EAAA,4BAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,mBAAmB,sIACnB,kBAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,OAAA,EAAA,IAAA,EAAA,UAAA,EAAA,SAAA,EAAA,aAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FA6DT,YAAY,EAAA,UAAA,EAAA,CAAA;kBAnExB,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA;wBACP,mBAAmB;wBACnB,mBAAmB;wBACnB,qBAAqB;wBACrB,mBAAmB;wBACnB,kBAAkB;AACnB,qBAAA,EAAA,QAAA,EACS,eAAe,EACT,cAAA,EAAA,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,EAChD,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,kBAAkB,CAAC;AAC3C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;qBACF,EAeS,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,4JAAA,CAAA,EAAA;;;ACrGH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
@@ -162,7 +162,7 @@ class WattFieldComponent {
162
162
  <watt-field-error>{{ intl.required }}</watt-field-error>
163
163
  }
164
164
  </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]", inputs: ["align", "direction", "gap", "justify", "offset"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
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 });
166
166
  }
167
167
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattFieldComponent, decorators: [{
168
168
  type: Component,