@energinet/watt 4.3.2 → 4.3.3
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.
- package/description-list/index.d.ts +3 -6
- package/fesm2022/energinet-watt-description-list.mjs +11 -21
- package/fesm2022/energinet-watt-description-list.mjs.map +1 -1
- package/fesm2022/energinet-watt-dropdown.mjs +2 -4
- package/fesm2022/energinet-watt-dropdown.mjs.map +1 -1
- package/fesm2022/energinet-watt-field.mjs +1 -1
- package/fesm2022/energinet-watt-field.mjs.map +1 -1
- package/fesm2022/energinet-watt-modal.mjs +3 -4
- package/fesm2022/energinet-watt-modal.mjs.map +1 -1
- package/fesm2022/energinet-watt-table.mjs +3 -4
- package/fesm2022/energinet-watt-table.mjs.map +1 -1
- package/fesm2022/energinet-watt-utils-resize-observer.mjs +5 -7
- package/fesm2022/energinet-watt-utils-resize-observer.mjs.map +1 -1
- package/package.json +1 -1
- package/utils/resize-observer/index.d.ts +3 -20
|
@@ -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/watt-field-warning.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 effect,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterFlexComponent, VaterUtilityDirective } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterFlexComponent,\n VaterUtilityDirective,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode() || displayMode() !== 'box') {\n <span [attr.autofocus]=\"autoFocus() || null\" class=\"watt-label\" #wattLabel>\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.autofocus]=\"autoFocus() || null\" [attr.for]=\"id()\" #label>\n <ng-container *ngTemplateOutlet=\"template\" />\n </label>\n }\n\n <ng-template #template>\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-flex direction=\"row\" gap=\"s\" align=\"center\">\n <div\n vater\n fill=\"horizontal\"\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-flex>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--disabled]': 'control()?.disabled',\n '[class.watt-field--show-errors]': 'showErrors()',\n '[class]': 'className()',\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 /** @deprecated Use `displayMode` instead. */\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n displayMode = input<'box' | 'chip' | 'content'>('box');\n className = computed(() => `watt-field--${this.chipMode() ? 'chip' : this.displayMode()}`);\n\n /**\n * Whether the input should receive focus when the component is rendered.\n */\n autoFocus = input(false);\n\n /** @ignore */\n labelElement = viewChild<ElementRef<HTMLLabelElement>>('label');\n wattLabelElement = viewChild<ElementRef<HTMLSpanElement>>('wattLabel');\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 errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n showErrors = input(true);\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 effect(() => {\n if (this.autoFocus()) {\n if (this.chipMode()) {\n this.wattLabelElement()?.nativeElement.focus();\n } else {\n this.labelElement()?.nativeElement.focus();\n }\n }\n });\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\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-warning',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-warning {\n color: var(--watt-color-state-warning);\n }\n `,\n ],\n})\nexport class WattFieldWarningComponent {}\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 { WattFieldWarningComponent } from './watt-field-warning.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;wGAFnB,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,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA;;4FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACrBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,uBAAuB,CAAA;wGAAvB,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,SAAA,EAAA,IAAA,EAAA,uBAAuB,4EAVxB,CAAA,cAAA,CAAgB,EAAA,Q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+
{"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/watt-field-warning.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 effect,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterFlexComponent, VaterUtilityDirective } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterFlexComponent,\n VaterUtilityDirective,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode() || displayMode() !== 'box') {\n <span [attr.autofocus]=\"autoFocus() || null\" class=\"watt-label\" #wattLabel>\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.autofocus]=\"autoFocus() || null\" [attr.for]=\"id()\" #label>\n <ng-container *ngTemplateOutlet=\"template\" />\n </label>\n }\n\n <ng-template #template>\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-flex direction=\"row\" gap=\"s\" align=\"center\">\n <div\n vater\n fill=\"horizontal\"\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-flex>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--disabled]': 'control()?.disabled',\n '[class.watt-field--show-errors]': 'showErrors()',\n '[class]': 'className()',\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 /** @deprecated Use `displayMode` instead. */\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n displayMode = input<'box' | 'chip' | 'content'>('box');\n className = computed(() => `watt-field--${this.chipMode() ? 'chip' : this.displayMode()}`);\n\n /**\n * Whether the input should receive focus when the component is rendered.\n */\n autoFocus = input(false);\n\n /** @ignore */\n labelElement = viewChild<ElementRef<HTMLLabelElement>>('label');\n wattLabelElement = viewChild<ElementRef<HTMLSpanElement>>('wattLabel');\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 errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n showErrors = input(true);\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 effect(() => {\n if (this.autoFocus()) {\n if (this.chipMode()) {\n this.wattLabelElement()?.nativeElement.focus();\n } else {\n this.labelElement()?.nativeElement.focus();\n }\n }\n });\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\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-warning',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-warning {\n color: var(--watt-color-state-warning);\n }\n `,\n ],\n})\nexport class WattFieldWarningComponent {}\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 { WattFieldWarningComponent } from './watt-field-warning.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;wGAFnB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,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CAAA;AAAzB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,yBAAyB,8EAV1B,CAAA,cAAA,CAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,6DAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;4FAUf,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAZrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAAA,QAAA,EACpB,CAAA,cAAA,CAAgB,EAAA,aAAA,EACX,iBAAiB,CAAC,IAAI,EAAA,MAAA,EAAA,CAAA,6DAAA,CAAA,EAAA;;;ACvBvC;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, EventEmitter, Injectable, input, booleanAttribute, output, viewChild, signal, afterRenderEffect, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import { MAT_DIALOG_DATA, MatDialogRef, MatDialog } from '@angular/material/dialog';
|
|
5
5
|
import { WattResizeObserverDirective } from '@energinet/watt/utils/resize-observer';
|
|
6
6
|
import { WattButtonComponent } from '@energinet/watt/button';
|
|
@@ -170,18 +170,17 @@ class WattModalComponent {
|
|
|
170
170
|
this.scrollable.set(event.target.scrollHeight > event.target.clientHeight);
|
|
171
171
|
}
|
|
172
172
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
173
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattModalComponent, isStandalone: true, selector: "watt-modal", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingMessage: { classPropertyName: "loadingMessage", publicName: "loadingMessage", isSignal: true, isRequired: false, transformFunction: null }, disableClose: { classPropertyName: "disableClose", publicName: "disableClose", isSignal: true, isRequired: false, transformFunction: null }, hideCloseButton: { classPropertyName: "hideCloseButton", publicName: "hideCloseButton", isSignal: true, isRequired: false, transformFunction: null }, disableEscAndBackdropClose: { classPropertyName: "disableEscAndBackdropClose", publicName: "disableEscAndBackdropClose", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, restoreFocus: { classPropertyName: "restoreFocus", publicName: "restoreFocus", isSignal: true, isRequired: false, transformFunction: null }, titleIcon: { classPropertyName: "titleIcon", publicName: "titleIcon", isSignal: true, isRequired: false, transformFunction: null }, autoOpen: { classPropertyName: "autoOpen", publicName: "autoOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["modal"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<ng-template #modal>\n <div class=\"watt-modal\" [
|
|
173
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattModalComponent, isStandalone: true, selector: "watt-modal", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingMessage: { classPropertyName: "loadingMessage", publicName: "loadingMessage", isSignal: true, isRequired: false, transformFunction: null }, disableClose: { classPropertyName: "disableClose", publicName: "disableClose", isSignal: true, isRequired: false, transformFunction: null }, hideCloseButton: { classPropertyName: "hideCloseButton", publicName: "hideCloseButton", isSignal: true, isRequired: false, transformFunction: null }, disableEscAndBackdropClose: { classPropertyName: "disableEscAndBackdropClose", publicName: "disableEscAndBackdropClose", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, restoreFocus: { classPropertyName: "restoreFocus", publicName: "restoreFocus", isSignal: true, isRequired: false, transformFunction: null }, titleIcon: { classPropertyName: "titleIcon", publicName: "titleIcon", isSignal: true, isRequired: false, transformFunction: null }, autoOpen: { classPropertyName: "autoOpen", publicName: "autoOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["modal"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<ng-template #modal>\n <div class=\"watt-modal\" [class]=\"'watt-modal--' + size()\">\n @if (!disableClose() && !hideCloseButton()) {\n <watt-button\n variant=\"icon\"\n icon=\"close\"\n class=\"watt-modal-close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close(false)\"\n />\n }\n\n @if (!loading()) {\n <ng-content select=\"h2\">\n @if (title()) {\n <h2 class=\"watt-modal-title\" [class.watt-modal-title-icon]=\"titleIcon()\">\n @if (titleIcon()) {\n <watt-icon [name]=\"titleIcon()\" size=\"l\" />\n }\n {{ title() }}\n </h2>\n }\n </ng-content>\n }\n\n <div\n wattResizeObserver\n class=\"watt-modal-content\"\n [class.watt-modal-scrollable]=\"scrollable()\"\n (resize)=\"onResize($event)\"\n >\n <ng-content />\n </div>\n <ng-content select=\"watt-modal-actions\" />\n\n @if (loading()) {\n <div class=\"watt-modal__spinner\">\n <div>\n <watt-spinner />\n <p>{{ loadingMessage() }}</p>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n@if (dialogRef) {\n <ng-template [ngTemplateOutlet]=\"modal\" />\n}\n", styles: [":root{--watt-modal-width: 100vw;--watt-modal-min-height: auto;--watt-modal-height: calc(100vh - var(--watt-topbar-height, 0px));--watt-modal-content-padding: 0 var(--watt-space-ml)}.watt-modal{width:var(--watt-modal-width);max-width:100vw;height:var(--watt-modal-height);min-height:var(--watt-modal-min-height);max-height:100vh;position:relative;display:grid;padding:0;align-items:center;grid-template-columns:1fr auto;grid-template-rows:auto 1fr auto;grid-template-areas:\"title close\" \"content content\" \"actions actions\"}.watt-modal--small{--watt-modal-width: 320px;--watt-modal-height: auto}@media(min-width:600.02px){.watt-modal--small{--watt-modal-width: 520px}}.watt-modal--small .watt-modal-title{color:var(--watt-typography-headline-color);font-size:1rem;line-height:1.5rem;font-weight:600;text-transform:none;letter-spacing:0}@media(min-width:1280px){.watt-modal--small .watt-modal-title{font-size:1.25rem;line-height:1.75rem}}@media(min-width:720.02px){.watt-modal--medium{--watt-modal-width: 720px;--watt-modal-height: auto}}@media(min-width:786.02px){.watt-modal--large{--watt-modal-width: 786px;--watt-modal-height: auto}}@media(min-width:960.02px){.watt-modal--large{--watt-modal-width: 936px;--watt-modal-height: auto}}.watt-modal-panel{margin-top:var(--watt-topbar-height)}.watt-modal-panel .mat-mdc-dialog-container .mdc-dialog__surface{width:auto}.watt-modal-panel .watt-modal-close{grid-area:close;align-self:start;margin:var(--watt-space-s);color:var(--watt-color-primary)}.watt-modal-panel .watt-modal-title{grid-area:title;margin:var(--watt-space-s) var(--watt-space-ml);color:var(--watt-typography-text-color)}.watt-modal-panel .watt-modal-title.watt-modal-title-icon{display:flex;align-items:center;gap:var(--watt-space-s)}.watt-modal-panel .watt-modal-content{align-self:stretch;grid-area:content;overflow:auto;padding:var(--watt-modal-content-padding)}.watt-modal-panel .watt-modal-content .watt-modal-content--full-width{display:block;margin:0 calc(-1 * var(--watt-space-s)) 0 0}@media(min-width:720.02px){.watt-modal-panel .watt-modal-content .watt-modal-content--full-width{margin:0 calc(-1 * var(--watt-space-ml))}}.watt-modal-panel .watt-modal-scrollable{border:1px solid var(--watt-color-neutral-grey-300);border-left:none;border-right:none}.watt-modal-panel watt-modal-actions{grid-area:actions;display:flex;justify-content:flex-end;padding:var(--watt-space-ml);gap:var(--watt-space-m)}.watt-modal-panel .watt-modal__spinner{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;background:#fffc}.watt-modal-panel .watt-modal__spinner div{display:flex;align-items:center;justify-content:center;flex-wrap:wrap}.watt-modal-panel .watt-modal__spinner div p{margin-top:var(--watt-space-m);width:100%}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: WattResizeObserverDirective, selector: "[wattResizeObserver]", outputs: ["resize"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattSpinnerComponent, selector: "watt-spinner", inputs: ["diameter", "strokeWidth"] }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
174
174
|
}
|
|
175
175
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattModalComponent, decorators: [{
|
|
176
176
|
type: Component,
|
|
177
177
|
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, selector: 'watt-modal', imports: [
|
|
178
|
-
NgClass,
|
|
179
178
|
NgTemplateOutlet,
|
|
180
179
|
WattResizeObserverDirective,
|
|
181
180
|
WattButtonComponent,
|
|
182
181
|
WattSpinnerComponent,
|
|
183
182
|
WattIconComponent,
|
|
184
|
-
], template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<ng-template #modal>\n <div class=\"watt-modal\" [
|
|
183
|
+
], template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<ng-template #modal>\n <div class=\"watt-modal\" [class]=\"'watt-modal--' + size()\">\n @if (!disableClose() && !hideCloseButton()) {\n <watt-button\n variant=\"icon\"\n icon=\"close\"\n class=\"watt-modal-close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close(false)\"\n />\n }\n\n @if (!loading()) {\n <ng-content select=\"h2\">\n @if (title()) {\n <h2 class=\"watt-modal-title\" [class.watt-modal-title-icon]=\"titleIcon()\">\n @if (titleIcon()) {\n <watt-icon [name]=\"titleIcon()\" size=\"l\" />\n }\n {{ title() }}\n </h2>\n }\n </ng-content>\n }\n\n <div\n wattResizeObserver\n class=\"watt-modal-content\"\n [class.watt-modal-scrollable]=\"scrollable()\"\n (resize)=\"onResize($event)\"\n >\n <ng-content />\n </div>\n <ng-content select=\"watt-modal-actions\" />\n\n @if (loading()) {\n <div class=\"watt-modal__spinner\">\n <div>\n <watt-spinner />\n <p>{{ loadingMessage() }}</p>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n@if (dialogRef) {\n <ng-template [ngTemplateOutlet]=\"modal\" />\n}\n", styles: [":root{--watt-modal-width: 100vw;--watt-modal-min-height: auto;--watt-modal-height: calc(100vh - var(--watt-topbar-height, 0px));--watt-modal-content-padding: 0 var(--watt-space-ml)}.watt-modal{width:var(--watt-modal-width);max-width:100vw;height:var(--watt-modal-height);min-height:var(--watt-modal-min-height);max-height:100vh;position:relative;display:grid;padding:0;align-items:center;grid-template-columns:1fr auto;grid-template-rows:auto 1fr auto;grid-template-areas:\"title close\" \"content content\" \"actions actions\"}.watt-modal--small{--watt-modal-width: 320px;--watt-modal-height: auto}@media(min-width:600.02px){.watt-modal--small{--watt-modal-width: 520px}}.watt-modal--small .watt-modal-title{color:var(--watt-typography-headline-color);font-size:1rem;line-height:1.5rem;font-weight:600;text-transform:none;letter-spacing:0}@media(min-width:1280px){.watt-modal--small .watt-modal-title{font-size:1.25rem;line-height:1.75rem}}@media(min-width:720.02px){.watt-modal--medium{--watt-modal-width: 720px;--watt-modal-height: auto}}@media(min-width:786.02px){.watt-modal--large{--watt-modal-width: 786px;--watt-modal-height: auto}}@media(min-width:960.02px){.watt-modal--large{--watt-modal-width: 936px;--watt-modal-height: auto}}.watt-modal-panel{margin-top:var(--watt-topbar-height)}.watt-modal-panel .mat-mdc-dialog-container .mdc-dialog__surface{width:auto}.watt-modal-panel .watt-modal-close{grid-area:close;align-self:start;margin:var(--watt-space-s);color:var(--watt-color-primary)}.watt-modal-panel .watt-modal-title{grid-area:title;margin:var(--watt-space-s) var(--watt-space-ml);color:var(--watt-typography-text-color)}.watt-modal-panel .watt-modal-title.watt-modal-title-icon{display:flex;align-items:center;gap:var(--watt-space-s)}.watt-modal-panel .watt-modal-content{align-self:stretch;grid-area:content;overflow:auto;padding:var(--watt-modal-content-padding)}.watt-modal-panel .watt-modal-content .watt-modal-content--full-width{display:block;margin:0 calc(-1 * var(--watt-space-s)) 0 0}@media(min-width:720.02px){.watt-modal-panel .watt-modal-content .watt-modal-content--full-width{margin:0 calc(-1 * var(--watt-space-ml))}}.watt-modal-panel .watt-modal-scrollable{border:1px solid var(--watt-color-neutral-grey-300);border-left:none;border-right:none}.watt-modal-panel watt-modal-actions{grid-area:actions;display:flex;justify-content:flex-end;padding:var(--watt-space-ml);gap:var(--watt-space-m)}.watt-modal-panel .watt-modal__spinner{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;background:#fffc}.watt-modal-panel .watt-modal__spinner div{display:flex;align-items:center;justify-content:center;flex-wrap:wrap}.watt-modal-panel .watt-modal__spinner div p{margin-top:var(--watt-space-m);width:100%}\n"] }]
|
|
185
184
|
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], loadingMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingMessage", required: false }] }], disableClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableClose", required: false }] }], hideCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideCloseButton", required: false }] }], disableEscAndBackdropClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableEscAndBackdropClose", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], restoreFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "restoreFocus", required: false }] }], titleIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleIcon", required: false }] }], autoOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoOpen", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], modal: [{ type: i0.ViewChild, args: ['modal', { isSignal: true }] }] } });
|
|
186
185
|
/**
|
|
187
186
|
* Component for projecting buttons (actions) to the bottom of the modal.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-modal.mjs","sources":["../../../libs/watt/package/modal/watt-modal.service.ts","../../../libs/watt/package/modal/watt-modal.component.ts","../../../libs/watt/package/modal/watt-modal.component.html","../../../libs/watt/package/modal/index.ts","../../../libs/watt/package/modal/energinet-watt-modal.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 { ComponentType } from '@angular/cdk/portal';\nimport { EventEmitter, Injectable, Injector, TemplateRef, inject } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { map, take } from 'rxjs';\n\nexport interface WattModalConfig<T> {\n templateRef?: TemplateRef<unknown>;\n component?: ComponentType<WattTypedModal<T>>;\n data?: T;\n disableClose?: boolean;\n onClosed?: EventEmitter<boolean> | ((result: boolean) => void);\n minHeight?: string;\n panelClass?: string[];\n injector?: Injector;\n restoreFocus?: boolean;\n}\n\nexport abstract class WattTypedModal<T = void> {\n protected modalData: T = inject(MAT_DIALOG_DATA);\n protected dialogRef: MatDialogRef<WattTypedModal<T>> = inject(MatDialogRef);\n}\n\n@Injectable()\nexport class WattModalService {\n private readonly dialog = inject(MatDialog);\n private matDialogRef: MatDialogRef<unknown> | undefined;\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open = <T>(config: WattModalConfig<T>) => {\n const template = config.templateRef ?? config.component;\n\n if (!template) return;\n\n this.matDialogRef = this.openModal(template, config);\n\n this.matDialogRef\n .afterClosed()\n .pipe(map(Boolean), take(1))\n .subscribe((result) => {\n if (config?.onClosed instanceof EventEmitter) {\n config?.onClosed.emit(result);\n } else {\n config?.onClosed?.(result);\n }\n });\n\n if (config.minHeight) this.setMinHeight(config.minHeight);\n };\n\n /**\n * Opens the modal using the provided template and configuration.\n */\n private openModal<T>(\n template: TemplateRef<unknown> | ComponentType<WattTypedModal<T>>,\n config: WattModalConfig<T>\n ): MatDialogRef<unknown> {\n return this.dialog.open(template, {\n autoFocus: 'dialog',\n panelClass: [\n 'watt-modal-panel',\n ...(config.component ? ['watt-modal-panel--component'] : []),\n ...(config.panelClass ?? []),\n ],\n disableClose: config.disableClose ?? false,\n data: config.data,\n maxWidth: 'none',\n injector: config.injector,\n restoreFocus: config.restoreFocus === false ? false : true,\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.matDialogRef?.close(result);\n }\n\n private setMinHeight(minHeight: string) {\n setTimeout(() => {\n document\n ?.getElementById(this.matDialogRef?.id ?? '')\n ?.querySelector('.watt-modal')\n ?.setAttribute('style', `--watt-modal-min-height: ${minHeight}`);\n });\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n afterRenderEffect,\n booleanAttribute,\n inject,\n input,\n output,\n viewChild,\n signal,\n} from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { MatDialogRef } from '@angular/material/dialog';\n\nimport { WattResizeObserverDirective } from '@energinet/watt/utils/resize-observer';\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\n\nimport { WattModalService } from './watt-modal.service';\nimport { WattIcon, WattIconComponent } from '@energinet/watt/icon';\n\nexport type WattModalSize = 'small' | 'medium' | 'large';\n\n/**\n * Component for representing a binary decision in the form of\n * a modal window that appears in front of the entire content.\n *\n * Usage:\n * `import { WATT_MODAL } from '@energinet/watt/modal';`\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-modal',\n styleUrls: ['./watt-modal.component.scss'],\n templateUrl: './watt-modal.component.html',\n imports: [\n NgClass,\n NgTemplateOutlet,\n WattResizeObserverDirective,\n WattButtonComponent,\n WattSpinnerComponent,\n WattIconComponent,\n ],\n})\nexport class WattModalComponent {\n private modalService = inject(WattModalService);\n protected dialogRef = inject<MatDialogRef<unknown>>(MatDialogRef, { optional: true });\n\n /** Title to stay fixed to top of modal. */\n title = input('');\n\n size = input<WattModalSize>('medium');\n\n /** Whether the modal should show a loading state. */\n loading = input(false);\n\n /** Whether the modal should show a loading text for the loading state. */\n loadingMessage = input('');\n\n /** Disable ESC, close button and backdrop click as methods of closing. */\n disableClose = input(false);\n\n /** Whether to show the close button */\n hideCloseButton = input(false);\n\n /** Disable ESC, backdrop click as methods of closing. */\n disableEscAndBackdropClose = input(false);\n\n /** The aria-label for the close button. */\n closeLabel = input('Close');\n\n /** Classes added to the modal panel */\n panelClass = input<string[]>([]);\n\n minHeight = input('147px');\n\n /** Whether the dialog should restore focus to the previously-focused element, after it's closed. */\n restoreFocus = input(true);\n\n /** Icon displayed next to the modal title. */\n titleIcon = input<WattIcon | undefined>(undefined);\n\n /** Whether the modal should open automatically when rendered. */\n autoOpen = input(false, { transform: booleanAttribute });\n\n closed = output<boolean>();\n\n modal = viewChild<TemplateRef<Element>>('modal');\n\n scrollable = signal(false);\n\n constructor() {\n afterRenderEffect(() => {\n if (this.autoOpen()) {\n this.open();\n }\n });\n }\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open() {\n this.modalService.open({\n disableClose: this.disableEscAndBackdropClose() || this.disableClose(),\n templateRef: this.modal(),\n onClosed: (result: boolean) => this.closed.emit(result),\n minHeight: this.minHeight(),\n panelClass: this.panelClass(),\n restoreFocus: this.restoreFocus(),\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.modalService.close(result); // inline modal\n this.dialogRef?.close(result); // injected modal\n }\n\n /**\n * Called when the modal content element changes size.\n * @ignore\n */\n onResize(event: ResizeObserverEntry) {\n this.scrollable.set(event.target.scrollHeight > event.target.clientHeight);\n }\n}\n\n/**\n * Component for projecting buttons (actions) to the bottom of the modal.\n */\n@Component({\n selector: 'watt-modal-actions',\n template: '<ng-content />',\n})\nexport class WattModalActionsComponent {}\n\nexport const WATT_MODAL = [WattModalComponent, WattModalActionsComponent];\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<ng-template #modal>\n <div class=\"watt-modal\" [ngClass]=\"'watt-modal--' + size()\">\n @if (!disableClose() && !hideCloseButton()) {\n <watt-button\n variant=\"icon\"\n icon=\"close\"\n class=\"watt-modal-close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close(false)\"\n />\n }\n\n @if (!loading()) {\n <ng-content select=\"h2\">\n @if (title()) {\n <h2 class=\"watt-modal-title\" [ngClass]=\"{ 'watt-modal-title-icon': titleIcon() }\">\n @if (titleIcon()) {\n <watt-icon [name]=\"titleIcon()\" size=\"l\" />\n }\n {{ title() }}\n </h2>\n }\n </ng-content>\n }\n\n <div\n wattResizeObserver\n class=\"watt-modal-content\"\n [class.watt-modal-scrollable]=\"scrollable()\"\n (resize)=\"onResize($event)\"\n >\n <ng-content />\n </div>\n <ng-content select=\"watt-modal-actions\" />\n\n @if (loading()) {\n <div class=\"watt-modal__spinner\">\n <div>\n <watt-spinner />\n <p>{{ loadingMessage() }}</p>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n@if (dialogRef) {\n <ng-template [ngTemplateOutlet]=\"modal\" />\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 { WattModalComponent, WattModalActionsComponent, WATT_MODAL } from './watt-modal.component';\nexport { WattModalService, WattModalConfig, WattTypedModal } from './watt-modal.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAmCsB,cAAc,CAAA;AACxB,IAAA,SAAS,GAAM,MAAM,CAAC,eAAe,CAAC;AACtC,IAAA,SAAS,GAAoC,MAAM,CAAC,YAAY,CAAC;AAC5E;MAGY,gBAAgB,CAAA;AACV,IAAA,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AACnC,IAAA,YAAY;AAEpB;;;AAGG;AACH,IAAA,IAAI,GAAG,CAAI,MAA0B,KAAI;QACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,SAAS;AAEvD,QAAA,IAAI,CAAC,QAAQ;YAAE;QAEf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;AAEpD,QAAA,IAAI,CAAC;AACF,aAAA,WAAW;aACX,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1B,aAAA,SAAS,CAAC,CAAC,MAAM,KAAI;AACpB,YAAA,IAAI,MAAM,EAAE,QAAQ,YAAY,YAAY,EAAE;AAC5C,gBAAA,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;YAC/B;iBAAO;AACL,gBAAA,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;YAC5B;AACF,QAAA,CAAC,CAAC;QAEJ,IA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,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,yBAAyB,8EAF1B,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;4FAEf,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAJrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,QAAQ,EAAE,gBAAgB;AAC3B,iBAAA;;MAGY,UAAU,GAAG,CAAC,kBAAkB,EAAE,yBAAyB;;AElKxE;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-modal.mjs","sources":["../../../libs/watt/package/modal/watt-modal.service.ts","../../../libs/watt/package/modal/watt-modal.component.ts","../../../libs/watt/package/modal/watt-modal.component.html","../../../libs/watt/package/modal/index.ts","../../../libs/watt/package/modal/energinet-watt-modal.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 { ComponentType } from '@angular/cdk/portal';\nimport { EventEmitter, Injectable, Injector, TemplateRef, inject } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { map, take } from 'rxjs';\n\nexport interface WattModalConfig<T> {\n templateRef?: TemplateRef<unknown>;\n component?: ComponentType<WattTypedModal<T>>;\n data?: T;\n disableClose?: boolean;\n onClosed?: EventEmitter<boolean> | ((result: boolean) => void);\n minHeight?: string;\n panelClass?: string[];\n injector?: Injector;\n restoreFocus?: boolean;\n}\n\nexport abstract class WattTypedModal<T = void> {\n protected modalData: T = inject(MAT_DIALOG_DATA);\n protected dialogRef: MatDialogRef<WattTypedModal<T>> = inject(MatDialogRef);\n}\n\n@Injectable()\nexport class WattModalService {\n private readonly dialog = inject(MatDialog);\n private matDialogRef: MatDialogRef<unknown> | undefined;\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open = <T>(config: WattModalConfig<T>) => {\n const template = config.templateRef ?? config.component;\n\n if (!template) return;\n\n this.matDialogRef = this.openModal(template, config);\n\n this.matDialogRef\n .afterClosed()\n .pipe(map(Boolean), take(1))\n .subscribe((result) => {\n if (config?.onClosed instanceof EventEmitter) {\n config?.onClosed.emit(result);\n } else {\n config?.onClosed?.(result);\n }\n });\n\n if (config.minHeight) this.setMinHeight(config.minHeight);\n };\n\n /**\n * Opens the modal using the provided template and configuration.\n */\n private openModal<T>(\n template: TemplateRef<unknown> | ComponentType<WattTypedModal<T>>,\n config: WattModalConfig<T>\n ): MatDialogRef<unknown> {\n return this.dialog.open(template, {\n autoFocus: 'dialog',\n panelClass: [\n 'watt-modal-panel',\n ...(config.component ? ['watt-modal-panel--component'] : []),\n ...(config.panelClass ?? []),\n ],\n disableClose: config.disableClose ?? false,\n data: config.data,\n maxWidth: 'none',\n injector: config.injector,\n restoreFocus: config.restoreFocus === false ? false : true,\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.matDialogRef?.close(result);\n }\n\n private setMinHeight(minHeight: string) {\n setTimeout(() => {\n document\n ?.getElementById(this.matDialogRef?.id ?? '')\n ?.querySelector('.watt-modal')\n ?.setAttribute('style', `--watt-modal-min-height: ${minHeight}`);\n });\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n afterRenderEffect,\n booleanAttribute,\n inject,\n input,\n output,\n viewChild,\n signal,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { MatDialogRef } from '@angular/material/dialog';\n\nimport { WattResizeObserverDirective } from '@energinet/watt/utils/resize-observer';\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\n\nimport { WattModalService } from './watt-modal.service';\nimport { WattIcon, WattIconComponent } from '@energinet/watt/icon';\n\nexport type WattModalSize = 'small' | 'medium' | 'large';\n\n/**\n * Component for representing a binary decision in the form of\n * a modal window that appears in front of the entire content.\n *\n * Usage:\n * `import { WATT_MODAL } from '@energinet/watt/modal';`\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-modal',\n styleUrls: ['./watt-modal.component.scss'],\n templateUrl: './watt-modal.component.html',\n imports: [\n NgTemplateOutlet,\n WattResizeObserverDirective,\n WattButtonComponent,\n WattSpinnerComponent,\n WattIconComponent,\n ],\n})\nexport class WattModalComponent {\n private modalService = inject(WattModalService);\n protected dialogRef = inject<MatDialogRef<unknown>>(MatDialogRef, { optional: true });\n\n /** Title to stay fixed to top of modal. */\n title = input('');\n\n size = input<WattModalSize>('medium');\n\n /** Whether the modal should show a loading state. */\n loading = input(false);\n\n /** Whether the modal should show a loading text for the loading state. */\n loadingMessage = input('');\n\n /** Disable ESC, close button and backdrop click as methods of closing. */\n disableClose = input(false);\n\n /** Whether to show the close button */\n hideCloseButton = input(false);\n\n /** Disable ESC, backdrop click as methods of closing. */\n disableEscAndBackdropClose = input(false);\n\n /** The aria-label for the close button. */\n closeLabel = input('Close');\n\n /** Classes added to the modal panel */\n panelClass = input<string[]>([]);\n\n minHeight = input('147px');\n\n /** Whether the dialog should restore focus to the previously-focused element, after it's closed. */\n restoreFocus = input(true);\n\n /** Icon displayed next to the modal title. */\n titleIcon = input<WattIcon | undefined>(undefined);\n\n /** Whether the modal should open automatically when rendered. */\n autoOpen = input(false, { transform: booleanAttribute });\n\n closed = output<boolean>();\n\n modal = viewChild<TemplateRef<Element>>('modal');\n\n scrollable = signal(false);\n\n constructor() {\n afterRenderEffect(() => {\n if (this.autoOpen()) {\n this.open();\n }\n });\n }\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open() {\n this.modalService.open({\n disableClose: this.disableEscAndBackdropClose() || this.disableClose(),\n templateRef: this.modal(),\n onClosed: (result: boolean) => this.closed.emit(result),\n minHeight: this.minHeight(),\n panelClass: this.panelClass(),\n restoreFocus: this.restoreFocus(),\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.modalService.close(result); // inline modal\n this.dialogRef?.close(result); // injected modal\n }\n\n /**\n * Called when the modal content element changes size.\n * @ignore\n */\n onResize(event: ResizeObserverEntry) {\n this.scrollable.set(event.target.scrollHeight > event.target.clientHeight);\n }\n}\n\n/**\n * Component for projecting buttons (actions) to the bottom of the modal.\n */\n@Component({\n selector: 'watt-modal-actions',\n template: '<ng-content />',\n})\nexport class WattModalActionsComponent {}\n\nexport const WATT_MODAL = [WattModalComponent, WattModalActionsComponent];\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<ng-template #modal>\n <div class=\"watt-modal\" [class]=\"'watt-modal--' + size()\">\n @if (!disableClose() && !hideCloseButton()) {\n <watt-button\n variant=\"icon\"\n icon=\"close\"\n class=\"watt-modal-close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close(false)\"\n />\n }\n\n @if (!loading()) {\n <ng-content select=\"h2\">\n @if (title()) {\n <h2 class=\"watt-modal-title\" [class.watt-modal-title-icon]=\"titleIcon()\">\n @if (titleIcon()) {\n <watt-icon [name]=\"titleIcon()\" size=\"l\" />\n }\n {{ title() }}\n </h2>\n }\n </ng-content>\n }\n\n <div\n wattResizeObserver\n class=\"watt-modal-content\"\n [class.watt-modal-scrollable]=\"scrollable()\"\n (resize)=\"onResize($event)\"\n >\n <ng-content />\n </div>\n <ng-content select=\"watt-modal-actions\" />\n\n @if (loading()) {\n <div class=\"watt-modal__spinner\">\n <div>\n <watt-spinner />\n <p>{{ loadingMessage() }}</p>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n@if (dialogRef) {\n <ng-template [ngTemplateOutlet]=\"modal\" />\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 { WattModalComponent, WattModalActionsComponent, WATT_MODAL } from './watt-modal.component';\nexport { WattModalService, WattModalConfig, WattTypedModal } from './watt-modal.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;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ive, model, output, contentChildren, contentChild, viewChild, viewChildren, ViewEncapsulation, Component } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/material/table';
|
|
4
4
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
5
|
-
import { NgTemplateOutlet,
|
|
5
|
+
import { NgTemplateOutlet, KeyValuePipe } from '@angular/common';
|
|
6
6
|
import { outputFromObservable } from '@angular/core/rxjs-interop';
|
|
7
7
|
import * as i1 from '@angular/forms';
|
|
8
8
|
import { FormsModule } from '@angular/forms';
|
|
@@ -400,12 +400,11 @@ class WattTableComponent {
|
|
|
400
400
|
*/
|
|
401
401
|
toggleSelection = (row) => this.selection.update((s) => (s.includes(row) ? s.filter((r) => r !== row) : s.concat(row)));
|
|
402
402
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
403
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattTableComponent, isStandalone: true, selector: "watt-table", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, displayedColumns: { classPropertyName: "displayedColumns", publicName: "displayedColumns", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, stickyFooter: { classPropertyName: "stickyFooter", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, resolveHeader: { classPropertyName: "resolveHeader", publicName: "resolveHeader", isSignal: true, isRequired: false, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null }, sortClear: { classPropertyName: "sortClear", publicName: "sortClear", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, suppressRowHoverHighlight: { classPropertyName: "suppressRowHoverHighlight", publicName: "suppressRowHoverHighlight", isSignal: true, isRequired: false, transformFunction: null }, activeRow: { classPropertyName: "activeRow", publicName: "activeRow", isSignal: true, isRequired: false, transformFunction: null }, activeRowComparator: { classPropertyName: "activeRowComparator", publicName: "activeRowComparator", isSignal: true, isRequired: false, transformFunction: null }, hideColumnHeaders: { classPropertyName: "hideColumnHeaders", publicName: "hideColumnHeaders", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", expanded: "expandedChange", rowClick: "rowClick", sortChange: "sortChange" }, host: { properties: { "class.watt-table-variant-zebra": "variant() === \"zebra\"", "style.--watt-table-grid-template-columns": "sizing().join(\" \")" } }, queries: [{ propertyName: "cells", predicate: (WattTableCellDirective), isSignal: true }, { propertyName: "toolbar", first: true, predicate: (WattTableToolbarDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "tableCellElements", predicate: ["td"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<table\n mat-table\n matSort\n role=\"treegrid\"\n [ngClass]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [ngClass]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n }\"\n ></tr>\n\n @if (toolbar()) {\n <tr mat-footer-row *matFooterRowDef=\"['spacer']\"></tr>\n }\n\n @if (hasFooter()) {\n <tr\n mat-footer-row\n [class.watt-table-hide-footer]=\"loading() || dataSource().filteredData.length === 0\"\n *matFooterRowDef=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-clickable-row>td:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i2.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i2.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i3.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i3.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i3.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "component", type: WattCheckboxComponent, selector: "watt-checkbox", inputs: ["required"] }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }], encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [NgTemplateOutlet]] });
|
|
403
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattTableComponent, isStandalone: true, selector: "watt-table", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, displayedColumns: { classPropertyName: "displayedColumns", publicName: "displayedColumns", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, stickyFooter: { classPropertyName: "stickyFooter", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, resolveHeader: { classPropertyName: "resolveHeader", publicName: "resolveHeader", isSignal: true, isRequired: false, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null }, sortClear: { classPropertyName: "sortClear", publicName: "sortClear", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, suppressRowHoverHighlight: { classPropertyName: "suppressRowHoverHighlight", publicName: "suppressRowHoverHighlight", isSignal: true, isRequired: false, transformFunction: null }, activeRow: { classPropertyName: "activeRow", publicName: "activeRow", isSignal: true, isRequired: false, transformFunction: null }, activeRowComparator: { classPropertyName: "activeRowComparator", publicName: "activeRowComparator", isSignal: true, isRequired: false, transformFunction: null }, hideColumnHeaders: { classPropertyName: "hideColumnHeaders", publicName: "hideColumnHeaders", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", expanded: "expandedChange", rowClick: "rowClick", sortChange: "sortChange" }, host: { properties: { "class.watt-table-variant-zebra": "variant() === \"zebra\"", "style.--watt-table-grid-template-columns": "sizing().join(\" \")" } }, queries: [{ propertyName: "cells", predicate: (WattTableCellDirective), isSignal: true }, { propertyName: "toolbar", first: true, predicate: (WattTableToolbarDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "tableCellElements", predicate: ["td"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<table\n mat-table\n matSort\n role=\"treegrid\"\n [class]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [class]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n }\"\n ></tr>\n\n @if (toolbar()) {\n <tr mat-footer-row *matFooterRowDef=\"['spacer']\"></tr>\n }\n\n @if (hasFooter()) {\n <tr\n mat-footer-row\n [class.watt-table-hide-footer]=\"loading() || dataSource().filteredData.length === 0\"\n *matFooterRowDef=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-clickable-row>td:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i2.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i2.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i3.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i3.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i3.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "component", type: WattCheckboxComponent, selector: "watt-checkbox", inputs: ["required"] }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }], encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [NgTemplateOutlet]] });
|
|
404
404
|
}
|
|
405
405
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattTableComponent, decorators: [{
|
|
406
406
|
type: Component,
|
|
407
407
|
args: [{ imports: [
|
|
408
|
-
NgClass,
|
|
409
408
|
NgTemplateOutlet,
|
|
410
409
|
KeyValuePipe,
|
|
411
410
|
FormsModule,
|
|
@@ -416,7 +415,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
416
415
|
], encapsulation: ViewEncapsulation.None, selector: 'watt-table', host: {
|
|
417
416
|
'[class.watt-table-variant-zebra]': 'variant() === "zebra"',
|
|
418
417
|
'[style.--watt-table-grid-template-columns]': 'sizing().join(" ")',
|
|
419
|
-
}, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<table\n mat-table\n matSort\n role=\"treegrid\"\n [ngClass]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [ngClass]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n }\"\n ></tr>\n\n @if (toolbar()) {\n <tr mat-footer-row *matFooterRowDef=\"['spacer']\"></tr>\n }\n\n @if (hasFooter()) {\n <tr\n mat-footer-row\n [class.watt-table-hide-footer]=\"loading() || dataSource().filteredData.length === 0\"\n *matFooterRowDef=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-clickable-row>td:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"] }]
|
|
418
|
+
}, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<table\n mat-table\n matSort\n role=\"treegrid\"\n [class]=\"{ 'watt-table-has-selection': getSelectionState() !== false }\"\n [matSortActive]=\"sortBy()\"\n [matSortDirection]=\"sortDirection()\"\n [matSortDisableClear]=\"!sortClear()\"\n [dataSource]=\"dataSource()\"\n [attr.aria-label]=\"description()\"\n (matSortChange)=\"sortChange.emit($event)\"\n>\n @if (selectable()) {\n <ng-container [matColumnDef]=\"checkboxColumn\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"getSelectionState()\"\n (ngModelChange)=\"$event ? selection.set(dataSource().filteredData) : clearSelection()\"\n />\n </th>\n <td mat-cell *matCellDef=\"let row\" class=\"watt-table-checkbox-cell\">\n <watt-checkbox\n [ngModel]=\"selection().includes(row)\"\n (ngModelChange)=\"toggleSelection(row)\"\n (click)=\"$event.stopPropagation()\"\n />\n </td>\n </ng-container>\n }\n\n <ng-container [matColumnDef]=\"expandableColumn\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n (click)=\"onRowClick(row)\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n >\n <watt-icon name=\"right\" size=\"xs\" />\n </td>\n </ng-container>\n\n @for (column of columns() | keyvalue; track column.key) {\n <ng-container [matColumnDef]=\"column.key\" [stickyEnd]=\"column.value.stickyEnd?.()\">\n <th\n mat-header-cell\n *matHeaderCellDef\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{\n column.value.headerCellClass\n }}\"\n >\n @if (column.value.helperAction; as action) {\n <watt-icon name=\"help\" (click)=\"action()\" />\n }\n\n <div\n class=\"watt-table-header-cell\"\n mat-sort-header\n [arrowPosition]=\"column.value.align === 'right' ? 'before' : 'after'\"\n [disabled]=\"!column.value.accessor || column.value.sort === false\"\n >\n {{ getColumnHeader(column) }}\n @if (column.value.tooltip; as tooltip) {\n <watt-icon [title]=\"tooltip\" name=\"info\" state=\"default\" />\n }\n </div>\n </th>\n\n <td\n #td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [attr.data-key]=\"getRowKey(index, row)\"\n [attr.data-row-index]=\"index\"\n [class.watt-table-cell--expanded]=\"expanded().includes(row)\"\n [class.watt-table-cell--expandable]=\"column.value.expandable\"\n class=\"watt-table-align-{{ column.value.align ?? 'left' }} {{ column.value.dataCellClass }}\"\n (click)=\"!column.value.expandable && onRowClick(row)\"\n >\n @if (isExpandable()) {\n @defer (when !column.value.expandable || expanded().includes(row)) {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n } @else {\n @if (getColumnTemplate(column.value); as template) {\n <div class=\"watt-table-cell-wrapper\">\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row, index }\" />\n </div>\n } @else {\n {{ getColumnCell(column.value, row) }}\n }\n }\n </td>\n\n @if (hasFooter()) {\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"{{ column.value.footer?.class }} watt-table-align-{{\n column.value.align ?? 'left'\n }} \"\n >\n {{ column.value.footer?.value?.() }}\n </td>\n }\n </ng-container>\n }\n\n <ng-container matColumnDef=\"spacer\">\n <td class=\"watt-table-footer-spacer\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n @if (!hideColumnHeaders()) {\n <tr mat-header-row *matHeaderRowDef=\"renderedColumns()\"></tr>\n }\n <tr\n mat-row\n *matRowDef=\"let row; columns: renderedColumns()\"\n [attr.aria-selected]=\"row === activeRow()\"\n [class]=\"getRowClass(row)\"\n [class]=\"{\n 'watt-table-highlight-row': !disabled() && !suppressRowHoverHighlight(),\n 'watt-table-clickable-row': !disabled() && rowClick$.observed,\n 'watt-table-active-row': isActiveRow(row),\n }\"\n ></tr>\n\n @if (toolbar()) {\n <tr mat-footer-row *matFooterRowDef=\"['spacer']\"></tr>\n }\n\n @if (hasFooter()) {\n <tr\n mat-footer-row\n [class.watt-table-hide-footer]=\"loading() || dataSource().filteredData.length === 0\"\n *matFooterRowDef=\"renderedColumns(); sticky: stickyFooter()\"\n ></tr>\n }\n\n <ng-container *matNoDataRow>\n @if (loading()) {\n @for (i of [1, 2, 3]; track i) {\n <tr class=\"mat-mdc-row\">\n @for (_ of renderedColumns(); track _; let i = $index) {\n <td class=\"mat-mdc-cell\" [class.watt-table-loading-cell]=\"i > 0 || !selectable()\"></td>\n }\n </tr>\n }\n }\n </ng-container>\n</table>\n\n@if (toolbar(); as toolbar) {\n <div class=\"watt-table-toolbar\" role=\"toolbar\">\n <ng-container\n *ngTemplateOutlet=\"\n toolbar.templateRef;\n context: { $implicit: filterSelectionBy(dataSource().filteredData) }\n \"\n />\n </div>\n}\n", styles: ["watt-table{--mat-table-row-item-label-text-font: $primary-font-family;--mat-table-row-item-outline-color: var(--watt-color-neutral-grey-300);--mat-table-header-headline-font: $primary-font-family}watt-table,watt-table .mat-mdc-table{display:grid;position:relative;overflow:auto;min-height:44px}watt-table .mat-mdc-table{grid-template-columns:var(--watt-table-grid-template-columns);grid-auto-rows:max-content;max-height:100%;z-index:1}watt-table .mat-mdc-table thead,watt-table .mat-mdc-table tbody,watt-table .mat-mdc-table tfoot,watt-table .mat-mdc-table tr.mat-mdc-row,watt-table .mat-mdc-table tr.mat-mdc-header-row,watt-table .mat-mdc-table tr.mat-mdc-footer-row{display:contents}watt-table .mat-mdc-table tr.watt-table-hide-footer{display:none}watt-table .mat-mdc-table tr.mat-mdc-header-row{flex:0 0 auto}watt-table .mat-mdc-table th.mat-mdc-header-cell{color:var(--watt-typography-label-color);font-size:.875rem;line-height:1.25rem;font-weight:600;box-sizing:border-box;display:flex;position:sticky;top:0;padding:0 var(--watt-space-s);height:auto;background:var(--watt-color-primary-ultralight);box-shadow:0 -1px #0000001f inset;border:0;z-index:2!important;white-space:nowrap;-webkit-user-select:none;user-select:none}watt-table .mat-mdc-table td.mat-mdc-footer-cell,watt-table .mat-mdc-table td.mat-mdc-cell{display:flex;align-items:center;min-height:48px;padding:var(--watt-space-xs) var(--watt-space-m);line-height:18px}watt-table .mat-mdc-table td.mat-mdc-cell.watt-table-cell--expandable{padding:0}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){border-bottom:1px solid var(--watt-color-neutral-grey-300)}watt-table .mat-mdc-table td.mat-mdc-footer-cell:not(.watt-table-footer-spacer){font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;border-top:2px solid var(--watt-color-neutral-grey-300);background-color:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-clickable-row>td:not(.watt-table-cell--expandable),watt-table .mat-mdc-table tr:has(>.watt-table-cell--expandable)>td:not(.watt-table-cell--expandable){cursor:pointer;-webkit-user-select:text;user-select:text}watt-table .mat-mdc-table .watt-table-highlight-row:hover:not(.watt-table-active-row,:has(>.watt-table-cell--expandable:hover))>td{background:var(--watt-color-neutral-grey-100)}watt-table .mat-mdc-table .watt-table-active-row>td{background:var(--watt-color-secondary-ultralight)}watt-table .mat-mdc-table .mat-column-__expandableColumn__>watt-icon{transition:transform .2s}watt-table .mat-mdc-table .mat-column-__expandableColumn__.watt-table-cell--expanded>watt-icon{transform:rotate(90deg)}watt-table .mat-mdc-table .mat-sort-header-arrow{margin:0}watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-arrow{margin-right:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-arrow,watt-table .mat-mdc-table .watt-table-align-left .mat-sort-header-arrow{margin-left:var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-header-cell{padding:.75rem var(--watt-space-s)}watt-table .mat-mdc-table .watt-table-checkbox-cell{justify-content:center}watt-table .mat-mdc-table th.watt-table-checkbox-cell{display:flex;align-items:center}watt-table .mat-mdc-table .watt-table-align-center,watt-table .mat-mdc-table .watt-table-align-center .mat-sort-header-container{justify-content:center;text-align:center}watt-table .mat-mdc-table .watt-table-align-right,watt-table .mat-mdc-table .watt-table-align-right .mat-sort-header-container{justify-content:right;text-align:right}.watt-table-variant-zebra>table>tbody>tr:nth-child(2n):not(.watt-table-active-row)>td{background-color:var(--watt-color-neutral-grey-50)}watt-table .mat-mdc-table th.watt-table-cell--expandable{display:none}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable{position:relative;min-height:0;max-height:0;border-bottom-width:0;overflow:hidden;pointer-events:none;grid-column:1/-1;background:transparent;flex:1 1 auto;opacity:0;will-change:opacity;transition:opacity .2s cubic-bezier(.4,0,.2,1),overflow 0s .3s allow-discrete}watt-table .mat-mdc-table tr.mat-mdc-row td.mat-mdc-cell.watt-table-cell--expandable>.watt-table-cell-wrapper{position:absolute;top:0;width:100%}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded{height:auto;max-height:initial;opacity:1;border-bottom-width:1px;pointer-events:all;overflow:visible}watt-table .mat-mdc-table tr.mat-mdc-row td.watt-table-cell--expandable.watt-table-cell--expanded>.watt-table-cell-wrapper{position:relative}.watt-table-cell-wrapper{width:100%}.watt-table-footer-spacer{display:none;height:76px;border:0}.watt-table-has-selection .watt-table-footer-spacer{display:block}.watt-table-has-selection+.watt-table-toolbar{opacity:1;visibility:visible;transition:opacity .3s cubic-bezier(0,0,.2,1),visibility .5s}.watt-table-toolbar{position:absolute;bottom:var(--watt-space-m);left:50%;transform:translate(-50%);display:flex;align-items:center;padding:0 var(--watt-space-m);min-height:44px;border-radius:22px;color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);z-index:1;opacity:0;visibility:hidden;transition:none}.watt-table-toolbar .watt-button--disabled{opacity:.4;--watt-button-primary-disabled-color: #fff}.watt-table-loading-cell:before{content:\"\";flex:1;display:block;max-width:200px;height:var(--watt-space-m);border-radius:var(--watt-space-m);opacity:.75;animation:shine 2s infinite linear;background-color:var(--watt-color-neutral-grey-200);background-size:300px;background-position:-100px;background-image:linear-gradient(90deg,var(--watt-color-neutral-grey-300) 0px,var(--watt-color-neutral-grey-200) 40px,var(--watt-color-neutral-grey-300) 80px)}@keyframes shine{40%,to{background-position:200px}}\n"] }]
|
|
420
419
|
}], ctorParameters: () => [], propDecorators: { dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], displayedColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayedColumns", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], stickyFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyFooter", required: false }] }], resolveHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "resolveHeader", required: false }] }], sortBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortBy", required: false }] }], sortDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDirection", required: false }] }], sortClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortClear", required: false }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], suppressRowHoverHighlight: [{ type: i0.Input, args: [{ isSignal: true, alias: "suppressRowHoverHighlight", required: false }] }], activeRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeRow", required: false }] }], activeRowComparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeRowComparator", required: false }] }], hideColumnHeaders: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideColumnHeaders", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }, { type: i0.Output, args: ["expandedChange"] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], cells: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => WattTableCellDirective), { isSignal: true }] }], toolbar: [{ type: i0.ContentChild, args: [i0.forwardRef(() => WattTableToolbarDirective), { isSignal: true }] }], sort: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatSort), { isSignal: true }] }], tableCellElements: [{ type: i0.ViewChildren, args: ['td', { isSignal: true }] }] } });
|
|
421
420
|
const WATT_TABLE = [WattTableComponent, WattTableCellDirective, WattTableToolbarDirective];
|
|
422
421
|
|