@energinet/watt 1.7.1 → 2.0.1

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.
@@ -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,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,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC5D,IAAA,QAAQ,CAAC,OAAuC,EAAA;QAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;QACtC,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAgB,CAAC;AACzF,cAAE,EAAE,IAAI,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A,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;;;;"}
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,U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;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-field.mjs","sources":["../../../libs/watt/package/field/watt-field-intl.service.ts","../../../libs/watt/package/field/watt-field-error.component.ts","../../../libs/watt/package/field/watt-field.component.ts","../../../libs/watt/package/field/watt-field-hint.component.ts","../../../libs/watt/package/field/index.ts","../../../libs/watt/package/field/energinet-watt-field.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n required = 'Field is required';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-error {\n color: var(--watt-color-state-danger);\n }\n `,\n ],\n})\nexport class WattFieldErrorComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterStackComponent } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterStackComponent,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode()) {\n <span class=\"watt-label\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.for]=\"id()\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </label>\n }\n\n <ng-template #template>\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-stack direction=\"row\" gap=\"s\">\n <div\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-stack>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--chip]': 'chipMode()',\n '[class.watt-field--unlabelled]': 'unlabelled()',\n '[class.watt-field--disabled]': 'control()?.disabled',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n elementRef = inject<ElementRef>(ElementRef);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n\n value = signal('');\n filler = computed(() => this.placeholder().slice(this.value().length));\n ghost = computed(() => this.value().slice(0, this.placeholder().length));\n\n unlabelled = computed(() => !this.label());\n\n errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n\n // Used for text fields with autocomplete\n wrapper = viewChild<ElementRef>('wrapper');\n\n constructor() {\n const control$ = toObservable(this.control).pipe(filter((control) => control !== null));\n\n // Track value in order to update ghost and filler\n const value$ = control$.pipe(\n switchMap((control) =>\n control.valueChanges.pipe(\n startWith(control.value),\n map((value) => (value === null || value === undefined ? '' : value.toString())),\n tap((value) => this.value.set(value))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Track status in order to update required state and show errors\n const status$ = control$.pipe(\n switchMap((control) =>\n control.statusChanges.pipe(\n startWith(control.status),\n tap(() => this.isRequired.set(this.isRequiredControl(control))),\n tap(() => this.errors.set(control.errors))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Subscribe for side effects\n value$.subscribe();\n status$.subscribe();\n }\n\n isRequiredControl(control: FormControl) {\n const validators = [Validators.required, WattRangeValidators.required];\n return validators.some((validator) => control.hasValidator(validator));\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-field-hint',\n styles: [\n `\n :host {\n color: var(--watt-color-neutral-grey-700);\n }\n `,\n ],\n template: `<ng-content />`,\n})\nexport class WattFieldHintComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattFieldComponent } from './watt-field.component';\nexport { WattFieldErrorComponent } from './watt-field-error.component';\nexport { WattFieldHintComponent } from './watt-field-hint.component';\nexport { WattFieldIntlService } from './watt-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,oBAAoB,CAAA;AACtB,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,QAAQ,GAAG,mBAAmB;uGAFnB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACrBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,uBAAuB,CAAA;uGAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,4EAVxB,CAAgB,cAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,0DAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAUf,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAZnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAA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sources":["../../../libs/watt/package/field/watt-field-intl.service.ts","../../../libs/watt/package/field/watt-field-error.component.ts","../../../libs/watt/package/field/watt-field.component.ts","../../../libs/watt/package/field/watt-field-hint.component.ts","../../../libs/watt/package/field/index.ts","../../../libs/watt/package/field/energinet-watt-field.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n required = 'Field is required';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-error {\n color: var(--watt-color-state-danger);\n }\n `,\n ],\n})\nexport class WattFieldErrorComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterStackComponent } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterStackComponent,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode()) {\n <span class=\"watt-label\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.for]=\"id()\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </label>\n }\n\n <ng-template #template>\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-stack direction=\"row\" gap=\"s\">\n <div\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-stack>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--chip]': 'chipMode()',\n '[class.watt-field--unlabelled]': 'unlabelled()',\n '[class.watt-field--disabled]': 'control()?.disabled',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n elementRef = inject<ElementRef>(ElementRef);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n\n value = signal('');\n filler = computed(() => this.placeholder().slice(this.value().length));\n ghost = computed(() => this.value().slice(0, this.placeholder().length));\n\n unlabelled = computed(() => !this.label());\n\n errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n\n // Used for text fields with autocomplete\n wrapper = viewChild<ElementRef>('wrapper');\n\n constructor() {\n const control$ = toObservable(this.control).pipe(filter((control) => control !== null));\n\n // Track value in order to update ghost and filler\n const value$ = control$.pipe(\n switchMap((control) =>\n control.valueChanges.pipe(\n startWith(control.value),\n map((value) => (value === null || value === undefined ? '' : value.toString())),\n tap((value) => this.value.set(value))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Track status in order to update required state and show errors\n const status$ = control$.pipe(\n switchMap((control) =>\n control.statusChanges.pipe(\n startWith(control.status),\n tap(() => this.isRequired.set(this.isRequiredControl(control))),\n tap(() => this.errors.set(control.errors))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Subscribe for side effects\n value$.subscribe();\n status$.subscribe();\n }\n\n isRequiredControl(control: FormControl) {\n const validators = [Validators.required, WattRangeValidators.required];\n return validators.some((validator) => control.hasValidator(validator));\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-field-hint',\n styles: [\n `\n :host {\n color: var(--watt-color-neutral-grey-700);\n }\n `,\n ],\n template: `<ng-content />`,\n})\nexport class WattFieldHintComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattFieldComponent } from './watt-field.component';\nexport { WattFieldErrorComponent } from './watt-field-error.component';\nexport { WattFieldHintComponent } from './watt-field-hint.component';\nexport { WattFieldIntlService } from './watt-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,oBAAoB,CAAA;AACtB,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,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EACK,IAAA,EAAA;AACJ,wBAAA,0BAA0B,EAAE,YAAY;AACxC,wBAAA,gCAAgC,EAAE,cAAc;AAChD,wBAAA,8BAA8B,EAAE,qBAAqB;AACtD,qBAAA,EAAA,MAAA,EAAA,CAAA,uoHAAA,CAAA,EAAA;;;ACvGH;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAca,sBAAsB,CAAA;uGAAtB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,2EAFvB,CAAgB,cAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA,CAAA;;2FAEf,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,YAQjB,CAAgB,cAAA,CAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA;;;AC7B5B;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
@@ -24,7 +24,7 @@ import { WattSpinnerComponent } from '@energinet/watt/spinner';
24
24
  //#endregion
25
25
  class WattProgressTrackerComponent {
26
26
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattProgressTrackerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
27
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: WattProgressTrackerComponent, isStandalone: true, selector: "watt-progress-tracker", ngImport: i0, template: `<vater-stack direction="row"><ng-content /></vater-stack>`, isInline: true, styles: ["watt-progress-tracker{display:block}\n"], dependencies: [{ kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]", inputs: ["align", "direction", "gap", "justify", "offset"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
27
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: WattProgressTrackerComponent, isStandalone: true, selector: "watt-progress-tracker", ngImport: i0, template: `<vater-stack direction="row"><ng-content /></vater-stack>`, isInline: true, styles: ["watt-progress-tracker{display:block}\n"], dependencies: [{ kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
28
28
  }
29
29
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattProgressTrackerComponent, decorators: [{
30
30
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-progress-tracker.mjs","sources":["../../../libs/watt/package/progress-tracker/watt-progress-tracker.component.ts","../../../libs/watt/package/progress-tracker/watt-progress-tracker-step.component.ts","../../../libs/watt/package/progress-tracker/index.ts","../../../libs/watt/package/progress-tracker/energinet-watt-progress-tracker.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\nimport { VaterStackComponent } from '@energinet/watt/vater';\n\n@Component({\n imports: [VaterStackComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-progress-tracker',\n styles: [\n `\n watt-progress-tracker {\n display: block;\n }\n `,\n ],\n template: `<vater-stack direction=\"row\"><ng-content /></vater-stack>`,\n})\nexport class WattProgressTrackerComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\n\n@Component({\n imports: [WattIconComponent, WattSpinnerComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-progress-tracker-step',\n host: {\n '[attr.role]': 'current() ? \"status\" : \"presentation\"',\n '[attr.class]': 'class()',\n '[attr.aria-current]': 'ariaCurrent()',\n '[attr.aria-label]': 'label()',\n },\n styleUrl: './watt-progress-tracker-step.component.scss',\n template: `\n <div class=\"watt-progress-tracker-step-icon\">\n @switch (status()) {\n @case ('running') {\n <watt-spinner [diameter]=\"26\" [strokeWidth]=\"2\" />\n }\n @case ('skipped') {\n <watt-icon name=\"horizontalRule\" size=\"xs\" />\n }\n @case ('canceled') {\n <watt-icon name=\"close\" size=\"xs\" />\n }\n @case ('failed') {\n <watt-icon name=\"priorityHigh\" size=\"xs\" />\n }\n @case ('succeeded') {\n <watt-icon name=\"checkmark\" size=\"xs\" />\n }\n }\n </div>\n <div class=\"watt-progress-tracker-step-text\"><ng-content /></div>\n `,\n})\nexport class WattProgressTrackerStepComponent {\n status = input.required<\n 'pending' | 'running' | 'skipped' | 'canceled' | 'failed' | 'succeeded'\n >();\n label = input<string>();\n current = input(false);\n ariaCurrent = computed(() => (this.current() ? 'step' : false));\n class = computed(() => `watt-progress-tracker-step-${this.status()}`);\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 { WattProgressTrackerComponent } from './watt-progress-tracker.component';\nimport { WattProgressTrackerStepComponent } from './watt-progress-tracker-step.component';\n\nexport { WattProgressTrackerComponent } from './watt-progress-tracker.component';\nexport { WattProgressTrackerStepComponent } from './watt-progress-tracker-step.component';\n\nexport const WATT_PROGRESS_TRACKER = [\n WattProgressTrackerComponent,\n WattProgressTrackerStepComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAkBa,4BAA4B,CAAA;uGAA5B,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA5B,4BAA4B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAF7B,CAA2D,yDAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,wCAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAX3D,mBAAmB,EAAA,QAAA,EAAA,4BAAA,EAA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,EAAA;AACJ,wBAAA,aAAa,EAAE,uCAAuC;AACtD,wBAAA,cAAc,EAAE,SAAS;AACzB,wBAAA,qBAAqB,EAAE,eAAe;AACtC,wBAAA,mBAAmB,EAAE,SAAS;qBAC/B,EAES,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;AAqBT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,0yFAAA,CAAA,EAAA;;;AC7DH;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAOa,MAAA,qBAAqB,GAAG;IACnC,4BAA4B;IAC5B,gCAAgC;;;AC1BlC;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-progress-tracker.mjs","sources":["../../../libs/watt/package/progress-tracker/watt-progress-tracker.component.ts","../../../libs/watt/package/progress-tracker/watt-progress-tracker-step.component.ts","../../../libs/watt/package/progress-tracker/index.ts","../../../libs/watt/package/progress-tracker/energinet-watt-progress-tracker.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\nimport { VaterStackComponent } from '@energinet/watt/vater';\n\n@Component({\n imports: [VaterStackComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-progress-tracker',\n styles: [\n `\n watt-progress-tracker {\n display: block;\n }\n `,\n ],\n template: `<vater-stack direction=\"row\"><ng-content /></vater-stack>`,\n})\nexport class WattProgressTrackerComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\n\n@Component({\n imports: [WattIconComponent, WattSpinnerComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-progress-tracker-step',\n host: {\n '[attr.role]': 'current() ? \"status\" : \"presentation\"',\n '[attr.class]': 'class()',\n '[attr.aria-current]': 'ariaCurrent()',\n '[attr.aria-label]': 'label()',\n },\n styleUrl: './watt-progress-tracker-step.component.scss',\n template: `\n <div class=\"watt-progress-tracker-step-icon\">\n @switch (status()) {\n @case ('running') {\n <watt-spinner [diameter]=\"26\" [strokeWidth]=\"2\" />\n }\n @case ('skipped') {\n <watt-icon name=\"horizontalRule\" size=\"xs\" />\n }\n @case ('canceled') {\n <watt-icon name=\"close\" size=\"xs\" />\n }\n @case ('failed') {\n <watt-icon name=\"priorityHigh\" size=\"xs\" />\n }\n @case ('succeeded') {\n <watt-icon name=\"checkmark\" size=\"xs\" />\n }\n }\n </div>\n <div class=\"watt-progress-tracker-step-text\"><ng-content /></div>\n `,\n})\nexport class WattProgressTrackerStepComponent {\n status = input.required<\n 'pending' | 'running' | 'skipped' | 'canceled' | 'failed' | 'succeeded'\n >();\n label = input<string>();\n current = input(false);\n ariaCurrent = computed(() => (this.current() ? 'step' : false));\n class = computed(() => `watt-progress-tracker-step-${this.status()}`);\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 { WattProgressTrackerComponent } from './watt-progress-tracker.component';\nimport { WattProgressTrackerStepComponent } from './watt-progress-tracker-step.component';\n\nexport { WattProgressTrackerComponent } from './watt-progress-tracker.component';\nexport { WattProgressTrackerStepComponent } from './watt-progress-tracker-step.component';\n\nexport const WATT_PROGRESS_TRACKER = [\n WattProgressTrackerComponent,\n WattProgressTrackerStepComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAkBa,4BAA4B,CAAA;uGAA5B,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA5B,4BAA4B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAF7B,CAA2D,yDAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,wCAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAX3D,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;;2FAalB,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBAdxC,SAAS;A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H;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAOa,MAAA,qBAAqB,GAAG;IACnC,4BAA4B;IAC5B,gCAAgC;;;AC1BlC;;AAEG;;;;"}
@@ -60,7 +60,7 @@ class WattLinkTabsComponent {
60
60
  tabElements = contentChildren(WattLinkTabComponent);
61
61
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattLinkTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
62
62
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattLinkTabsComponent, isStandalone: true, selector: "watt-link-tabs", queries: [{ propertyName: "tabElements", predicate: WattLinkTabComponent, isSignal: true }], ngImport: i0, template: `
63
- <vater-flex direction="column" fill="vertical">
63
+ <vater-flex autoSize fill="vertical">
64
64
  <nav
65
65
  mat-tab-nav-bar
66
66
  [disableRipple]="true"
@@ -77,12 +77,12 @@ class WattLinkTabsComponent {
77
77
 
78
78
  <mat-tab-nav-panel #tabPanel><router-outlet /></mat-tab-nav-panel>
79
79
  </vater-flex>
80
- `, isInline: true, styles: ["@use \"@energinet-datahub/watt/utils\" as watt;watt-link-tabs .mat-mdc-tab-header{box-shadow:var(--watt-bottom-box-shadow);background-color:var(--watt-color-neutral-white)}watt-link-tabs .mat-mdc-tab-nav-panel{display:block;position:relative;height:100%}watt-link-tabs .mat-mdc-tab-links,watt-link-tabs .mat-focus-indicator.mat-mdc-tab-link.active .mdc-tab__text-label{color:var(--mat-tab-header-active-label-text-color)}watt-link-tabs .mat-mdc-tab-labels,watt-link-tabs .mat-mdc-tab-links{padding-left:var(--watt-space-ml)}watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link{min-width:120px;opacity:1}:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link) .mdc-tab__content{@include watt.typography-watt-button;color:var(--watt-on-light-medium-emphasis)}:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-active,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link.active{border-bottom:2px solid var(--watt-color-primary)}:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab:hover,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link:hover{border-bottom:2px solid var(--watt-color-primary)}:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-active,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link.active,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab:hover,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link:hover{color:var(--watt-on-light-medium-emphasis)}:is(:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-active,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link.active,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab:hover,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link:hover) .mdc-tab__content{color:var(--watt-color-primary)}\n"], dependencies: [{ kind: "ngmodule", type: MatTabsModule }, { kind: "component", type: i1.MatTabNav, selector: "[mat-tab-nav-bar]", inputs: ["fitInkBarToContent", "mat-stretch-tabs", "animationDuration", "backgroundColor", "disableRipple", "color", "tabPanel"], exportAs: ["matTabNavBar", "matTabNav"] }, { kind: "component", type: i1.MatTabNavPanel, selector: "mat-tab-nav-panel", inputs: ["id"], exportAs: ["matTabNavPanel"] }, { kind: "component", type: i1.MatTabLink, selector: "[mat-tab-link], [matTabLink]", inputs: ["active", "disabled", "disableRipple", "tabIndex", "id"], exportAs: ["matTabLink"] }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: VaterFlexComponent, selector: "vater-flex, [vater-flex]", inputs: ["direction", "grow", "shrink", "basis", "gap", "justify", "wrap", "scrollable", "offset"] }], encapsulation: i0.ViewEncapsulation.None });
80
+ `, isInline: true, styles: ["@use \"@energinet-datahub/watt/utils\" as watt;watt-link-tabs .mat-mdc-tab-header{box-shadow:var(--watt-bottom-box-shadow);background-color:var(--watt-color-neutral-white)}watt-link-tabs .mat-mdc-tab-nav-panel{display:block;position:relative;height:100%}watt-link-tabs .mat-mdc-tab-links,watt-link-tabs .mat-focus-indicator.mat-mdc-tab-link.active .mdc-tab__text-label{color:var(--mat-tab-header-active-label-text-color)}watt-link-tabs .mat-mdc-tab-labels,watt-link-tabs .mat-mdc-tab-links{padding-left:var(--watt-space-ml)}watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link{min-width:120px;opacity:1}:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link) .mdc-tab__content{@include watt.typography-watt-button;color:var(--watt-on-light-medium-emphasis)}:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-active,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link.active{border-bottom:2px solid var(--watt-color-primary)}:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab:hover,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link:hover{border-bottom:2px solid var(--watt-color-primary)}:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-active,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link.active,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab:hover,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link:hover{color:var(--watt-on-light-medium-emphasis)}:is(:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-active,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link.active,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab:hover,:is(watt-link-tabs .mat-mdc-tab,watt-link-tabs .mat-mdc-tab-link).mat-mdc-tab-link:hover) .mdc-tab__content{color:var(--watt-color-primary)}\n"], dependencies: [{ kind: "ngmodule", type: MatTabsModule }, { kind: "component", type: i1.MatTabNav, selector: "[mat-tab-nav-bar]", inputs: ["fitInkBarToContent", "mat-stretch-tabs", "animationDuration", "backgroundColor", "disableRipple", "color", "tabPanel"], exportAs: ["matTabNavBar", "matTabNav"] }, { kind: "component", type: i1.MatTabNavPanel, selector: "mat-tab-nav-panel", inputs: ["id"], exportAs: ["matTabNavPanel"] }, { kind: "component", type: i1.MatTabLink, selector: "[mat-tab-link], [matTabLink]", inputs: ["active", "disabled", "disableRipple", "tabIndex", "id"], exportAs: ["matTabLink"] }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: VaterFlexComponent, selector: "vater-flex, [vater-flex]", inputs: ["autoSize"] }], encapsulation: i0.ViewEncapsulation.None });
81
81
  }
82
82
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattLinkTabsComponent, decorators: [{
83
83
  type: Component,
84
84
  args: [{ selector: 'watt-link-tabs', encapsulation: ViewEncapsulation.None, imports: [MatTabsModule, RouterOutlet, RouterLink, RouterLinkActive, VaterFlexComponent], template: `
85
- <vater-flex direction="column" fill="vertical">
85
+ <vater-flex autoSize fill="vertical">
86
86
  <nav
87
87
  mat-tab-nav-bar
88
88
  [disableRipple]="true"
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-tabs.mjs","sources":["../../../libs/watt/package/tabs/watt-link-tab.component.ts","../../../libs/watt/package/tabs/watt-link-tabs.component.ts","../../../libs/watt/package/tabs/watt-tab.component.ts","../../../libs/watt/package/tabs/watt-tabs-action.component.ts","../../../libs/watt/package/tabs/watt-tabs.component.ts","../../../libs/watt/package/tabs/watt-tabs.component.html","../../../libs/watt/package/tabs/index.ts","../../../libs/watt/package/tabs/energinet-watt-tabs.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, input } from '@angular/core';\n\n@Component({\n selector: 'watt-link-tab',\n template: ``,\n})\nexport class WattLinkTabComponent {\n label = input.required<string>();\n link = input.required<string>();\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation, contentChildren } from '@angular/core';\nimport { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';\nimport { MatTabsModule } from '@angular/material/tabs';\n\nimport { VaterFlexComponent } from '@energinet/watt/vater';\nimport { WattLinkTabComponent } from './watt-link-tab.component';\n\n@Component({\n selector: 'watt-link-tabs',\n encapsulation: ViewEncapsulation.None,\n imports: [MatTabsModule, RouterOutlet, RouterLink, RouterLinkActive, VaterFlexComponent],\n styles: `\n @use '@energinet-datahub/watt/utils' as watt;\n\n watt-link-tabs {\n .mat-mdc-tab-header {\n box-shadow: var(--watt-bottom-box-shadow);\n background-color: var(--watt-color-neutral-white);\n }\n\n .mat-mdc-tab-nav-panel {\n display: block;\n position: relative;\n height: 100%;\n }\n\n .mat-mdc-tab-links,\n .mat-focus-indicator.mat-mdc-tab-link.active .mdc-tab__text-label {\n color: var(--mat-tab-header-active-label-text-color);\n }\n\n .mat-mdc-tab-labels,\n .mat-mdc-tab-links {\n padding-left: var(--watt-space-ml);\n }\n\n .mat-mdc-tab,\n .mat-mdc-tab-link {\n min-width: 120px;\n opacity: 1;\n\n .mdc-tab__content {\n @include watt.typography-watt-button;\n color: var(--watt-on-light-medium-emphasis);\n }\n\n &.mat-mdc-tab-active,\n &.mat-mdc-tab-link.active {\n border-bottom: 2px solid var(--watt-color-primary);\n }\n\n &.mat-mdc-tab:hover,\n &.mat-mdc-tab-link:hover {\n border-bottom: 2px solid var(--watt-color-primary);\n }\n\n &.mat-mdc-tab-active,\n &.mat-mdc-tab-link.active,\n &.mat-mdc-tab:hover,\n &.mat-mdc-tab-link:hover {\n color: var(--watt-on-light-medium-emphasis);\n\n .mdc-tab__content {\n color: var(--watt-color-primary);\n }\n }\n }\n }\n `,\n template: `\n <vater-flex direction=\"column\" fill=\"vertical\">\n <nav\n mat-tab-nav-bar\n [disableRipple]=\"true\"\n animationDuration=\"0ms\"\n [mat-stretch-tabs]=\"false\"\n [tabPanel]=\"tabPanel\"\n >\n @for (tab of tabElements(); track tab) {\n <a mat-tab-link [routerLink]=\"tab.link()\" routerLinkActive=\"active\">\n {{ tab.label() }}\n </a>\n }\n </nav>\n\n <mat-tab-nav-panel #tabPanel><router-outlet /></mat-tab-nav-panel>\n </vater-flex>\n `,\n})\nexport class WattLinkTabsComponent {\n tabElements = contentChildren(WattLinkTabComponent);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, TemplateRef, input, output, viewChild } from '@angular/core';\n\n@Component({\n selector: 'watt-tab',\n template: `<ng-template>\n <ng-content />\n </ng-template>`,\n})\nexport class WattTabComponent {\n templateRef = viewChild.required<TemplateRef<unknown>>(TemplateRef);\n label = input<string>('');\n changed = output<void>();\n\n emitChange() {\n this.changed.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\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-tabs-action',\n template: `<ng-content />`,\n})\nexport class WattTabsActionComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n AfterViewInit,\n ViewEncapsulation,\n inject,\n HostBinding,\n contentChild,\n viewChild,\n input,\n contentChildren,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { MatTabGroup, MatTabsModule } from '@angular/material/tabs';\n\nimport { WattTabComponent } from './watt-tab.component';\nimport { WattTabsActionComponent } from './watt-tabs-action.component';\n\n@Component({\n selector: 'watt-tabs',\n styleUrls: ['./watt-tabs.component.scss'],\n templateUrl: './watt-tabs.component.html',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.Default,\n imports: [NgTemplateOutlet, MatTabsModule],\n})\nexport class WattTabsComponent implements AfterViewInit {\n private readonly cdr = inject(ChangeDetectorRef);\n\n variant = input<string>();\n\n @HostBinding('class')\n get hostClass() {\n return this.variant() ? `watt-tabs-${this.variant()}` : '';\n }\n\n tabElements = contentChildren(WattTabComponent);\n activeTabIndex = 0;\n\n tabGroup = viewChild.required(MatTabGroup);\n\n actionsTab = contentChild(WattTabsActionComponent);\n\n ngAfterViewInit() {\n this.cdr.detectChanges();\n }\n\n emitSelectedTabChange(selectedIndex: number) {\n this.activeTabIndex = selectedIndex;\n const currentTab = this.tabElements().find((tab, index) => index === selectedIndex);\n currentTab?.emitChange();\n }\n\n setSelectedIndex(index: number) {\n this.tabGroup().selectedIndex = index;\n }\n\n triggerChange() {\n this.emitSelectedTabChange(this.activeTabIndex);\n }\n}\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<mat-tab-group\n [mat-stretch-tabs]=\"false\"\n dynamicHeight\n animationDuration=\"0ms\"\n [disableRipple]=\"true\"\n (selectedIndexChange)=\"emitSelectedTabChange($event)\"\n>\n @for (tab of tabElements(); track tab) {\n <mat-tab [label]=\"tab.label()\">\n <ng-container *ngTemplateOutlet=\"tab.templateRef()\" />\n </mat-tab>\n }\n\n @if (actionsTab()) {\n <mat-tab labelClass=\"watt-tabs-action\" [disabled]=\"true\">\n <ng-template mat-tab-label>\n <ng-content />\n </ng-template>\n </mat-tab>\n }\n</mat-tab-group>\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 { WattLinkTabComponent } from './watt-link-tab.component';\nimport { WattLinkTabsComponent } from './watt-link-tabs.component';\n\nimport { WattTabComponent } from './watt-tab.component';\nimport { WattTabsActionComponent } from './watt-tabs-action.component';\nimport { WattTabsComponent } from './watt-tabs.component';\n\nexport { WattTabComponent } from './watt-tab.component';\nexport { WattTabsActionComponent } from './watt-tabs-action.component';\nexport { WattTabsComponent } from './watt-tabs.component';\n\nexport { WattLinkTabComponent } from './watt-link-tab.component';\nexport { WattLinkTabsComponent } from './watt-link-tabs.component';\n\nexport const WATT_TABS = [WattTabsComponent, WattTabComponent, WattTabsActionComponent];\nexport const WATT_LINK_TABS = [WattLinkTabsComponent, WattLinkTabComponent];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAOa,oBAAoB,CAAA;AAC/B,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAU;AAChC,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,EAAU;uGAFpB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,gUAFrB,CAAE,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAED,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE,CAAE,CAAA;AACb,iBAAA;;;ACvBD;AACA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,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,OAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAE9B,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAR7B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EAGN,aAAA,EAAA,iBAAiB,CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,OAAO,EACvC,OAAA,EAAA,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,gpCAAA,EAAA,MAAA,EAAA,CAAA,syHAAA,CAAA,EAAA;8BAQtC,SAAS,EAAA,CAAA;sBADZ,WAAW;uBAAC,OAAO;;;AElDtB;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAea,MAAA,SAAS,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,uBAAuB;MACzE,cAAc,GAAG,CAAC,qBAAqB,EAAE,oBAAoB;;ACjC1E;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-tabs.mjs","sources":["../../../libs/watt/package/tabs/watt-link-tab.component.ts","../../../libs/watt/package/tabs/watt-link-tabs.component.ts","../../../libs/watt/package/tabs/watt-tab.component.ts","../../../libs/watt/package/tabs/watt-tabs-action.component.ts","../../../libs/watt/package/tabs/watt-tabs.component.ts","../../../libs/watt/package/tabs/watt-tabs.component.html","../../../libs/watt/package/tabs/index.ts","../../../libs/watt/package/tabs/energinet-watt-tabs.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, input } from '@angular/core';\n\n@Component({\n selector: 'watt-link-tab',\n template: ``,\n})\nexport class WattLinkTabComponent {\n label = input.required<string>();\n link = input.required<string>();\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation, contentChildren } from '@angular/core';\nimport { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';\nimport { MatTabsModule } from '@angular/material/tabs';\n\nimport { VaterFlexComponent } from '@energinet/watt/vater';\nimport { WattLinkTabComponent } from './watt-link-tab.component';\n\n@Component({\n selector: 'watt-link-tabs',\n encapsulation: ViewEncapsulation.None,\n imports: [MatTabsModule, RouterOutlet, RouterLink, RouterLinkActive, VaterFlexComponent],\n styles: `\n @use '@energinet-datahub/watt/utils' as watt;\n\n watt-link-tabs {\n .mat-mdc-tab-header {\n box-shadow: var(--watt-bottom-box-shadow);\n background-color: var(--watt-color-neutral-white);\n }\n\n .mat-mdc-tab-nav-panel {\n display: block;\n position: relative;\n height: 100%;\n }\n\n .mat-mdc-tab-links,\n .mat-focus-indicator.mat-mdc-tab-link.active .mdc-tab__text-label {\n color: var(--mat-tab-header-active-label-text-color);\n }\n\n .mat-mdc-tab-labels,\n .mat-mdc-tab-links {\n padding-left: var(--watt-space-ml);\n }\n\n .mat-mdc-tab,\n .mat-mdc-tab-link {\n min-width: 120px;\n opacity: 1;\n\n .mdc-tab__content {\n @include watt.typography-watt-button;\n color: var(--watt-on-light-medium-emphasis);\n }\n\n &.mat-mdc-tab-active,\n &.mat-mdc-tab-link.active {\n border-bottom: 2px solid var(--watt-color-primary);\n }\n\n &.mat-mdc-tab:hover,\n &.mat-mdc-tab-link:hover {\n border-bottom: 2px solid var(--watt-color-primary);\n }\n\n &.mat-mdc-tab-active,\n &.mat-mdc-tab-link.active,\n &.mat-mdc-tab:hover,\n &.mat-mdc-tab-link:hover {\n color: var(--watt-on-light-medium-emphasis);\n\n .mdc-tab__content {\n color: var(--watt-color-primary);\n }\n }\n }\n }\n `,\n template: `\n <vater-flex autoSize fill=\"vertical\">\n <nav\n mat-tab-nav-bar\n [disableRipple]=\"true\"\n animationDuration=\"0ms\"\n [mat-stretch-tabs]=\"false\"\n [tabPanel]=\"tabPanel\"\n >\n @for (tab of tabElements(); track tab) {\n <a mat-tab-link [routerLink]=\"tab.link()\" routerLinkActive=\"active\">\n {{ tab.label() }}\n </a>\n }\n </nav>\n\n <mat-tab-nav-panel #tabPanel><router-outlet /></mat-tab-nav-panel>\n </vater-flex>\n `,\n})\nexport class WattLinkTabsComponent {\n tabElements = contentChildren(WattLinkTabComponent);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, TemplateRef, input, output, viewChild } from '@angular/core';\n\n@Component({\n selector: 'watt-tab',\n template: `<ng-template>\n <ng-content />\n </ng-template>`,\n})\nexport class WattTabComponent {\n templateRef = viewChild.required<TemplateRef<unknown>>(TemplateRef);\n label = input<string>('');\n changed = output<void>();\n\n emitChange() {\n this.changed.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\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-tabs-action',\n template: `<ng-content />`,\n})\nexport class WattTabsActionComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n AfterViewInit,\n ViewEncapsulation,\n inject,\n HostBinding,\n contentChild,\n viewChild,\n input,\n contentChildren,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { MatTabGroup, MatTabsModule } from '@angular/material/tabs';\n\nimport { WattTabComponent } from './watt-tab.component';\nimport { WattTabsActionComponent } from './watt-tabs-action.component';\n\n@Component({\n selector: 'watt-tabs',\n styleUrls: ['./watt-tabs.component.scss'],\n templateUrl: './watt-tabs.component.html',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.Default,\n imports: [NgTemplateOutlet, MatTabsModule],\n})\nexport class WattTabsComponent implements AfterViewInit {\n private readonly cdr = inject(ChangeDetectorRef);\n\n variant = input<string>();\n\n @HostBinding('class')\n get hostClass() {\n return this.variant() ? `watt-tabs-${this.variant()}` : '';\n }\n\n tabElements = contentChildren(WattTabComponent);\n activeTabIndex = 0;\n\n tabGroup = viewChild.required(MatTabGroup);\n\n actionsTab = contentChild(WattTabsActionComponent);\n\n ngAfterViewInit() {\n this.cdr.detectChanges();\n }\n\n emitSelectedTabChange(selectedIndex: number) {\n this.activeTabIndex = selectedIndex;\n const currentTab = this.tabElements().find((tab, index) => index === selectedIndex);\n currentTab?.emitChange();\n }\n\n setSelectedIndex(index: number) {\n this.tabGroup().selectedIndex = index;\n }\n\n triggerChange() {\n this.emitSelectedTabChange(this.activeTabIndex);\n }\n}\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<mat-tab-group\n [mat-stretch-tabs]=\"false\"\n dynamicHeight\n animationDuration=\"0ms\"\n [disableRipple]=\"true\"\n (selectedIndexChange)=\"emitSelectedTabChange($event)\"\n>\n @for (tab of tabElements(); track tab) {\n <mat-tab [label]=\"tab.label()\">\n <ng-container *ngTemplateOutlet=\"tab.templateRef()\" />\n </mat-tab>\n }\n\n @if (actionsTab()) {\n <mat-tab labelClass=\"watt-tabs-action\" [disabled]=\"true\">\n <ng-template mat-tab-label>\n <ng-content />\n </ng-template>\n </mat-tab>\n }\n</mat-tab-group>\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 { WattLinkTabComponent } from './watt-link-tab.component';\nimport { WattLinkTabsComponent } from './watt-link-tabs.component';\n\nimport { WattTabComponent } from './watt-tab.component';\nimport { WattTabsActionComponent } from './watt-tabs-action.component';\nimport { WattTabsComponent } from './watt-tabs.component';\n\nexport { WattTabComponent } from './watt-tab.component';\nexport { WattTabsActionComponent } from './watt-tabs-action.component';\nexport { WattTabsComponent } from './watt-tabs.component';\n\nexport { WattLinkTabComponent } from './watt-link-tab.component';\nexport { WattLinkTabsComponent } from './watt-link-tabs.component';\n\nexport const WATT_TABS = [WattTabsComponent, WattTabComponent, WattTabsActionComponent];\nexport const WATT_LINK_TABS = [WattLinkTabsComponent, WattLinkTabComponent];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAOa,oBAAoB,CAAA;AAC/B,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAU;AAChC,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,EAAU;uGAFpB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,gUAFrB,CAAE,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAED,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE,CAAE,CAAA;AACb,iBAAA;;;ACvBD;A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