@energinet/watt 2.0.13 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/badge/energinet-watt-badge.d.ts +5 -0
- package/breadcrumbs/energinet-watt-breadcrumbs.d.ts +5 -0
- package/button/energinet-watt-button.d.ts +5 -0
- package/card/energinet-watt-card.d.ts +5 -0
- package/checkbox/energinet-watt-checkbox.d.ts +5 -0
- package/chip/energinet-watt-chip.d.ts +5 -0
- package/clipboard/energinet-watt-clipboard.d.ts +5 -0
- package/code/energinet-watt-code.d.ts +5 -0
- package/core/breakpoints/breakpoints-observer.d.ts +1 -19
- package/core/breakpoints/energinet-watt-core-breakpoints.d.ts +5 -0
- package/core/color/color-helper.service.d.ts +2 -4
- package/core/color/energinet-watt-core-color.d.ts +5 -0
- package/core/date/energinet-watt-core-date.d.ts +5 -0
- package/core/date/watt-locale.service.d.ts +1 -3
- package/data/energinet-watt-data.d.ts +5 -0
- package/datetime-field/energinet-watt-datetime-field.d.ts +5 -0
- package/description-list/energinet-watt-description-list.d.ts +5 -0
- package/drawer/energinet-watt-drawer.d.ts +5 -0
- package/dropdown/energinet-watt-dropdown.d.ts +5 -0
- package/dropzone/energinet-watt-dropzone.d.ts +5 -0
- package/empty-state/energinet-watt-empty-state.d.ts +5 -0
- package/energinet-watt.d.ts +5 -0
- package/esm2022/badge/energinet-watt-badge.js +5 -0
- package/esm2022/badge/index.js +20 -0
- package/{fesm2022/energinet-watt-badge.mjs → esm2022/badge/watt-badge.component.js} +7 -33
- package/esm2022/breadcrumbs/energinet-watt-breadcrumbs.js +5 -0
- package/esm2022/breadcrumbs/index.js +20 -0
- package/esm2022/breadcrumbs/watt-breadcrumbs.component.js +90 -0
- package/esm2022/button/energinet-watt-button.js +5 -0
- package/esm2022/button/index.js +20 -0
- package/{fesm2022/energinet-watt-button.mjs → esm2022/button/watt-button.component.js} +14 -40
- package/esm2022/card/energinet-watt-card.js +5 -0
- package/esm2022/card/index.js +21 -0
- package/esm2022/card/watt-card-title.component.js +33 -0
- package/esm2022/card/watt-card.component.js +61 -0
- package/esm2022/checkbox/energinet-watt-checkbox.js +5 -0
- package/esm2022/checkbox/index.js +20 -0
- package/{fesm2022/energinet-watt-checkbox.mjs → esm2022/checkbox/watt-checkbox.component.js} +9 -35
- package/esm2022/chip/energinet-watt-chip.js +5 -0
- package/esm2022/chip/index.js +26 -0
- package/esm2022/chip/watt-action-chip.component.js +68 -0
- package/esm2022/chip/watt-chip.component.js +55 -0
- package/esm2022/chip/watt-chip.directive.js +92 -0
- package/esm2022/chip/watt-date-chip.component.js +118 -0
- package/esm2022/chip/watt-date-range-chip.component.js +240 -0
- package/esm2022/chip/watt-filter-chip.component.js +94 -0
- package/esm2022/chip/watt-menu-chip.component.js +95 -0
- package/esm2022/clipboard/energinet-watt-clipboard.js +5 -0
- package/esm2022/clipboard/index.js +21 -0
- package/esm2022/clipboard/watt-clipboard-intl.service.js +31 -0
- package/esm2022/clipboard/watt-copy-to-clipboard.directive.js +64 -0
- package/esm2022/code/energinet-watt-code.js +5 -0
- package/esm2022/code/index.js +21 -0
- package/esm2022/code/watt-code.component.js +74 -0
- package/esm2022/code/watt-code.worker.token.js +21 -0
- package/esm2022/core/breakpoints/breakpoints-observer.js +41 -0
- package/esm2022/core/breakpoints/breakpoints.js +31 -0
- package/esm2022/core/breakpoints/energinet-watt-core-breakpoints.js +5 -0
- package/esm2022/core/breakpoints/index.js +21 -0
- package/esm2022/core/color/color-helper.service.js +41 -0
- package/esm2022/core/color/colors.js +58 -0
- package/esm2022/core/color/energinet-watt-core-color.js +5 -0
- package/esm2022/core/color/index.js +21 -0
- package/esm2022/core/date/dayjs.js +34 -0
- package/esm2022/core/date/energinet-watt-core-date.js +5 -0
- package/esm2022/core/date/index.js +25 -0
- package/esm2022/core/date/watt-danish-datetime.providers.js +31 -0
- package/esm2022/core/date/watt-date-adapter.js +43 -0
- package/esm2022/core/date/watt-date-range.js +2 -0
- package/esm2022/core/date/watt-date.pipe.js +38 -0
- package/esm2022/core/date/watt-format-date.js +50 -0
- package/esm2022/core/date/watt-locale.service.js +48 -0
- package/esm2022/data/energinet-watt-data.js +5 -0
- package/esm2022/data/index.js +23 -0
- package/esm2022/data/watt-data-actions.component.js +32 -0
- package/esm2022/data/watt-data-filters.component.js +32 -0
- package/esm2022/data/watt-data-intl.service.js +39 -0
- package/{fesm2022/energinet-watt-data.mjs → esm2022/data/watt-data-table.component.js} +15 -137
- package/esm2022/datetime-field/energinet-watt-datetime-field.js +5 -0
- package/esm2022/datetime-field/index.js +20 -0
- package/esm2022/datetime-field/watt-datetime-field.component.js +207 -0
- package/esm2022/description-list/energinet-watt-description-list.js +5 -0
- package/esm2022/description-list/index.js +20 -0
- package/esm2022/description-list/watt-description-list-item.component.js +49 -0
- package/{fesm2022/energinet-watt-description-list.mjs → esm2022/description-list/watt-description-list.component.js} +10 -79
- package/esm2022/drawer/energinet-watt-drawer.js +5 -0
- package/esm2022/drawer/index.js +24 -0
- package/esm2022/drawer/watt-drawer-actions.component.js +29 -0
- package/esm2022/drawer/watt-drawer-content.component.js +29 -0
- package/esm2022/drawer/watt-drawer-heading.component.js +29 -0
- package/esm2022/drawer/watt-drawer-topbar.component.js +29 -0
- package/esm2022/drawer/watt-drawer.component.js +177 -0
- package/esm2022/dropdown/energinet-watt-dropdown.js +5 -0
- package/esm2022/dropdown/index.js +20 -0
- package/esm2022/dropdown/watt-dropdown-option.js +2 -0
- package/esm2022/dropdown/watt-dropdown-value.js +2 -0
- package/esm2022/dropdown/watt-dropdown.component.js +396 -0
- package/esm2022/dropzone/energinet-watt-dropzone.js +5 -0
- package/esm2022/dropzone/index.js +22 -0
- package/esm2022/dropzone/watt-dropzone-intl.js +35 -0
- package/esm2022/dropzone/watt-dropzone-validators.js +67 -0
- package/esm2022/dropzone/watt-dropzone.js +179 -0
- package/esm2022/empty-state/energinet-watt-empty-state.js +5 -0
- package/esm2022/empty-state/icons/explore.js +54 -0
- package/esm2022/empty-state/icons/no-results.js +62 -0
- package/esm2022/empty-state/icons/power.js +46 -0
- package/esm2022/empty-state/index.js +23 -0
- package/esm2022/empty-state/watt-empty-state.component.js +120 -0
- package/esm2022/energinet-watt.js +5 -0
- package/esm2022/expandable-card/energinet-watt-expandable-card.js +5 -0
- package/esm2022/expandable-card/index.js +26 -0
- package/{fesm2022/energinet-watt-expandable-card.mjs → esm2022/expandable-card/watt-expandable-card.component.js} +18 -49
- package/esm2022/expansion/energinet-watt-expansion.js +5 -0
- package/{fesm2022/energinet-watt-expansion.mjs → esm2022/expansion/expansion.component.js} +10 -36
- package/esm2022/expansion/index.js +20 -0
- package/esm2022/field/energinet-watt-field.js +5 -0
- package/esm2022/field/index.js +23 -0
- package/esm2022/field/watt-field-error.component.js +29 -0
- package/esm2022/field/watt-field-hint.component.js +29 -0
- package/esm2022/field/watt-field-intl.service.js +32 -0
- package/{fesm2022/energinet-watt-field.mjs → esm2022/field/watt-field.component.js} +17 -125
- package/esm2022/icon/energinet-watt-icon.js +5 -0
- package/esm2022/icon/flags/energinet-watt-icon-flags.js +5 -0
- package/esm2022/icon/flags/index.js +26 -0
- package/esm2022/icon/flags/watt-flag-ch.js +52 -0
- package/esm2022/icon/flags/watt-flag-de.js +44 -0
- package/esm2022/icon/flags/watt-flag-dk.js +44 -0
- package/esm2022/icon/flags/watt-flag-fi.js +44 -0
- package/esm2022/icon/flags/watt-flag-nl.js +44 -0
- package/esm2022/icon/flags/watt-flag-no.js +48 -0
- package/esm2022/icon/flags/watt-flag-pl.js +46 -0
- package/esm2022/icon/flags/watt-flag-se.js +42 -0
- package/esm2022/icon/flags/watt-flag.js +116 -0
- package/{fesm2022/energinet-watt-icon.mjs → esm2022/icon/icon.component.js} +9 -131
- package/esm2022/icon/icons.js +97 -0
- package/esm2022/icon/index.js +20 -0
- package/esm2022/index.js +25 -0
- package/esm2022/modal/energinet-watt-modal.js +5 -0
- package/esm2022/modal/index.js +21 -0
- package/{fesm2022/energinet-watt-modal.mjs → esm2022/modal/watt-modal.component.js} +19 -127
- package/esm2022/modal/watt-modal.service.js +86 -0
- package/esm2022/paginator/energinet-watt-paginator.js +5 -0
- package/esm2022/paginator/index.js +21 -0
- package/esm2022/paginator/watt-paginator-intl.service.js +38 -0
- package/esm2022/paginator/watt-paginator.component.js +104 -0
- package/esm2022/phone-field/energinet-watt-phone-field.js +5 -0
- package/esm2022/phone-field/index.js +21 -0
- package/esm2022/phone-field/watt-phone-field-intl.service.js +40 -0
- package/esm2022/phone-field/watt-phone-field.component.js +262 -0
- package/esm2022/picker/__shared/energinet-watt-picker-__shared.js +5 -0
- package/esm2022/picker/__shared/index.js +21 -0
- package/esm2022/picker/__shared/placeholder-mask/watt-placeholder-mask.component.js +71 -0
- package/esm2022/picker/__shared/watt-picker-base.js +292 -0
- package/esm2022/picker/__shared/watt-picker-value.js +2 -0
- package/esm2022/picker/datepicker/energinet-watt-picker-datepicker.js +5 -0
- package/esm2022/picker/datepicker/index.js +22 -0
- package/esm2022/picker/datepicker/watt-datepicker-intl.service.js +31 -0
- package/esm2022/picker/datepicker/watt-datepicker.component.js +422 -0
- package/esm2022/picker/timepicker/energinet-watt-picker-timepicker.js +5 -0
- package/esm2022/picker/timepicker/index.js +20 -0
- package/esm2022/picker/timepicker/maskito-time-range-mask.js +81 -0
- package/esm2022/picker/timepicker/watt-timepicker.component.js +288 -0
- package/esm2022/progress-tracker/energinet-watt-progress-tracker.js +5 -0
- package/esm2022/progress-tracker/index.js +27 -0
- package/{fesm2022/energinet-watt-progress-tracker.mjs → esm2022/progress-tracker/watt-progress-tracker-step.component.js} +9 -67
- package/esm2022/progress-tracker/watt-progress-tracker.component.js +30 -0
- package/esm2022/query-params/energinet-watt-query-params.js +5 -0
- package/esm2022/query-params/index.js +20 -0
- package/esm2022/query-params/watt-query-params.directive.js +91 -0
- package/esm2022/radio/energinet-watt-radio.js +5 -0
- package/esm2022/radio/index.js +20 -0
- package/{fesm2022/energinet-watt-radio.mjs → esm2022/radio/watt-radio.component.js} +9 -35
- package/esm2022/search/energinet-watt-search.js +5 -0
- package/esm2022/search/index.js +20 -0
- package/{fesm2022/energinet-watt-search.mjs → esm2022/search/watt-search.component.js} +10 -36
- package/esm2022/segmented-buttons/energinet-watt-segmented-buttons.js +5 -0
- package/esm2022/segmented-buttons/index.js +21 -0
- package/esm2022/segmented-buttons/watt-segmented-button.component.js +38 -0
- package/esm2022/segmented-buttons/watt-segmented-buttons.component.js +88 -0
- package/esm2022/shell/energinet-watt-shell.js +5 -0
- package/esm2022/shell/index.js +21 -0
- package/esm2022/shell/nav-list/index.js +21 -0
- package/esm2022/shell/nav-list/watt-expand-on-active-link.directive.js +45 -0
- package/esm2022/shell/nav-list/watt-nav-list-item.component.js +84 -0
- package/esm2022/shell/nav-list/watt-nav-list.component.js +81 -0
- package/esm2022/shell/shell.component.js +75 -0
- package/esm2022/slide-toggle/energinet-watt-slide-toggle.js +5 -0
- package/esm2022/slide-toggle/index.js +20 -0
- package/esm2022/slide-toggle/watt-slide-toggle.component.js +78 -0
- package/esm2022/slider/energinet-watt-slider.js +5 -0
- package/esm2022/slider/index.js +20 -0
- package/esm2022/slider/watt-slider.component.js +133 -0
- package/esm2022/spinner/energinet-watt-spinner.js +5 -0
- package/esm2022/spinner/index.js +20 -0
- package/esm2022/spinner/watt-spinner.component.js +46 -0
- package/esm2022/stepper/energinet-watt-stepper.js +5 -0
- package/esm2022/stepper/index.js +21 -0
- package/esm2022/stepper/watt-stepper-step.component.js +52 -0
- package/{fesm2022/energinet-watt-stepper.mjs → esm2022/stepper/watt-stepper.component.js} +18 -91
- package/esm2022/table/energinet-watt-table.js +5 -0
- package/esm2022/table/index.js +21 -0
- package/esm2022/table/watt-table-data-source.js +17 -0
- package/esm2022/table/watt-table.component.js +400 -0
- package/esm2022/tabs/energinet-watt-tabs.js +5 -0
- package/esm2022/tabs/index.js +31 -0
- package/esm2022/tabs/watt-link-tab.component.js +34 -0
- package/esm2022/tabs/watt-link-tabs.component.js +71 -0
- package/esm2022/tabs/watt-tab.component.js +42 -0
- package/esm2022/tabs/watt-tabs-action.component.js +32 -0
- package/esm2022/tabs/watt-tabs.component.js +60 -0
- package/esm2022/text-field/energinet-watt-text-field.js +5 -0
- package/esm2022/text-field/index.js +20 -0
- package/esm2022/text-field/watt-text-field.component.js +289 -0
- package/esm2022/textarea-field/energinet-watt-textarea-field.js +5 -0
- package/esm2022/textarea-field/index.js +20 -0
- package/esm2022/textarea-field/watt-textarea-field.component.js +110 -0
- package/esm2022/toast/energinet-watt-toast.js +5 -0
- package/esm2022/toast/index.js +21 -0
- package/esm2022/toast/watt-toast.component.js +97 -0
- package/esm2022/toast/watt-toast.service.js +51 -0
- package/esm2022/tooltip/energinet-watt-tooltip.js +5 -0
- package/esm2022/tooltip/index.js +20 -0
- package/esm2022/tooltip/watt-tooltip.component.js +131 -0
- package/esm2022/tooltip/watt-tooltip.directive.js +60 -0
- package/esm2022/utils/css/css-custom-properties.service.js +39 -0
- package/esm2022/utils/css/energinet-watt-utils-css.js +5 -0
- package/esm2022/utils/css/index.js +20 -0
- package/esm2022/utils/intersection-observer/energinet-watt-utils-intersection-observer.js +5 -0
- package/esm2022/utils/intersection-observer/index.js +20 -0
- package/esm2022/utils/intersection-observer/watt-intersection-observer.service.js +57 -0
- package/esm2022/utils/resize-observer/energinet-watt-utils-resize-observer.js +5 -0
- package/esm2022/utils/resize-observer/index.js +21 -0
- package/esm2022/utils/resize-observer/watt-resize-observer.directive.js +53 -0
- package/esm2022/utils/resize-observer/watt-resize-observer.service.js +67 -0
- package/esm2022/validation-message/energinet-watt-validation-message.js +5 -0
- package/esm2022/validation-message/index.js +20 -0
- package/{fesm2022/energinet-watt-validation-message.mjs → esm2022/validation-message/watt-validation-message.component.js} +8 -34
- package/esm2022/validators/energinet-watt-validators.js +5 -0
- package/esm2022/validators/index.js +20 -0
- package/esm2022/validators/watt-range.validators.js +23 -0
- package/esm2022/vater/energinet-watt-vater.js +5 -0
- package/esm2022/vater/index.js +24 -0
- package/esm2022/vater/types.js +20 -0
- package/esm2022/vater/vater-flex.component.js +49 -0
- package/esm2022/vater/vater-layout.directive.js +65 -0
- package/esm2022/vater/vater-spacer.component.js +29 -0
- package/esm2022/vater/vater-stack.component.js +42 -0
- package/esm2022/vater/vater-utility.directive.js +53 -0
- package/esm2022/year-field/energinet-watt-year-field.js +5 -0
- package/esm2022/year-field/index.js +20 -0
- package/esm2022/year-field/watt-year-field.component.js +256 -0
- package/esm2022/yearmonth-field/energinet-watt-yearmonth-field.js +5 -0
- package/esm2022/yearmonth-field/index.js +21 -0
- package/esm2022/yearmonth-field/watt-yearmonth-field.component.js +258 -0
- package/esm2022/yearmonth-field/year-month.js +42 -0
- package/expandable-card/energinet-watt-expandable-card.d.ts +5 -0
- package/expansion/energinet-watt-expansion.d.ts +5 -0
- package/field/energinet-watt-field.d.ts +5 -0
- package/icon/energinet-watt-icon.d.ts +5 -0
- package/icon/flags/energinet-watt-icon-flags.d.ts +5 -0
- package/modal/energinet-watt-modal.d.ts +5 -0
- package/package.json +117 -117
- package/paginator/energinet-watt-paginator.d.ts +5 -0
- package/phone-field/energinet-watt-phone-field.d.ts +5 -0
- package/picker/__shared/energinet-watt-picker-__shared.d.ts +5 -0
- package/picker/__shared/watt-picker-base.d.ts +4 -1
- package/picker/datepicker/energinet-watt-picker-datepicker.d.ts +5 -0
- package/picker/timepicker/energinet-watt-picker-timepicker.d.ts +5 -0
- package/progress-tracker/energinet-watt-progress-tracker.d.ts +5 -0
- package/query-params/energinet-watt-query-params.d.ts +5 -0
- package/radio/energinet-watt-radio.d.ts +5 -0
- package/search/energinet-watt-search.d.ts +5 -0
- package/segmented-buttons/energinet-watt-segmented-buttons.d.ts +5 -0
- package/shell/energinet-watt-shell.d.ts +5 -0
- package/slide-toggle/energinet-watt-slide-toggle.d.ts +5 -0
- package/slider/energinet-watt-slider.d.ts +5 -0
- package/spinner/energinet-watt-spinner.d.ts +5 -0
- package/stepper/energinet-watt-stepper.d.ts +5 -0
- package/table/energinet-watt-table.d.ts +5 -0
- package/tabs/energinet-watt-tabs.d.ts +5 -0
- package/text-field/energinet-watt-text-field.d.ts +5 -0
- package/textarea-field/energinet-watt-textarea-field.d.ts +5 -0
- package/toast/energinet-watt-toast.d.ts +5 -0
- package/toast/watt-toast.service.d.ts +2 -3
- package/tooltip/energinet-watt-tooltip.d.ts +5 -0
- package/utils/css/css-custom-properties.service.d.ts +1 -2
- package/utils/css/energinet-watt-utils-css.d.ts +5 -0
- package/utils/intersection-observer/energinet-watt-utils-intersection-observer.d.ts +5 -0
- package/utils/resize-observer/energinet-watt-utils-resize-observer.d.ts +5 -0
- package/utils/resize-observer/watt-resize-observer.service.d.ts +2 -19
- package/validation-message/energinet-watt-validation-message.d.ts +5 -0
- package/validators/energinet-watt-validators.d.ts +5 -0
- package/vater/energinet-watt-vater.d.ts +5 -0
- package/year-field/energinet-watt-year-field.d.ts +5 -0
- package/yearmonth-field/energinet-watt-yearmonth-field.d.ts +5 -0
- package/fesm2022/energinet-watt-badge.mjs.map +0 -1
- package/fesm2022/energinet-watt-breadcrumbs.mjs +0 -116
- package/fesm2022/energinet-watt-breadcrumbs.mjs.map +0 -1
- package/fesm2022/energinet-watt-button.mjs.map +0 -1
- package/fesm2022/energinet-watt-card.mjs +0 -117
- package/fesm2022/energinet-watt-card.mjs.map +0 -1
- package/fesm2022/energinet-watt-checkbox.mjs.map +0 -1
- package/fesm2022/energinet-watt-chip.mjs +0 -760
- package/fesm2022/energinet-watt-chip.mjs.map +0 -1
- package/fesm2022/energinet-watt-clipboard.mjs +0 -118
- package/fesm2022/energinet-watt-clipboard.mjs.map +0 -1
- package/fesm2022/energinet-watt-code.mjs +0 -119
- package/fesm2022/energinet-watt-code.mjs.map +0 -1
- package/fesm2022/energinet-watt-core-breakpoints.mjs +0 -100
- package/fesm2022/energinet-watt-core-breakpoints.mjs.map +0 -1
- package/fesm2022/energinet-watt-core-color.mjs +0 -127
- package/fesm2022/energinet-watt-core-color.mjs.map +0 -1
- package/fesm2022/energinet-watt-core-date.mjs +0 -260
- package/fesm2022/energinet-watt-core-date.mjs.map +0 -1
- package/fesm2022/energinet-watt-data.mjs.map +0 -1
- package/fesm2022/energinet-watt-datetime-field.mjs +0 -233
- package/fesm2022/energinet-watt-datetime-field.mjs.map +0 -1
- package/fesm2022/energinet-watt-description-list.mjs.map +0 -1
- package/fesm2022/energinet-watt-drawer.mjs +0 -307
- package/fesm2022/energinet-watt-drawer.mjs.map +0 -1
- package/fesm2022/energinet-watt-dropdown.mjs +0 -423
- package/fesm2022/energinet-watt-dropdown.mjs.map +0 -1
- package/fesm2022/energinet-watt-dropzone.mjs +0 -298
- package/fesm2022/energinet-watt-dropzone.mjs.map +0 -1
- package/fesm2022/energinet-watt-empty-state.mjs +0 -299
- package/fesm2022/energinet-watt-empty-state.mjs.map +0 -1
- package/fesm2022/energinet-watt-expandable-card.mjs.map +0 -1
- package/fesm2022/energinet-watt-expansion.mjs.map +0 -1
- package/fesm2022/energinet-watt-field.mjs.map +0 -1
- package/fesm2022/energinet-watt-icon-flags.mjs +0 -482
- package/fesm2022/energinet-watt-icon-flags.mjs.map +0 -1
- package/fesm2022/energinet-watt-icon.mjs.map +0 -1
- package/fesm2022/energinet-watt-modal.mjs.map +0 -1
- package/fesm2022/energinet-watt-paginator.mjs +0 -164
- package/fesm2022/energinet-watt-paginator.mjs.map +0 -1
- package/fesm2022/energinet-watt-phone-field.mjs +0 -326
- package/fesm2022/energinet-watt-phone-field.mjs.map +0 -1
- package/fesm2022/energinet-watt-picker-__shared.mjs +0 -384
- package/fesm2022/energinet-watt-picker-__shared.mjs.map +0 -1
- package/fesm2022/energinet-watt-picker-datepicker.mjs +0 -477
- package/fesm2022/energinet-watt-picker-datepicker.mjs.map +0 -1
- package/fesm2022/energinet-watt-picker-timepicker.mjs +0 -394
- package/fesm2022/energinet-watt-picker-timepicker.mjs.map +0 -1
- package/fesm2022/energinet-watt-progress-tracker.mjs.map +0 -1
- package/fesm2022/energinet-watt-query-params.mjs +0 -117
- package/fesm2022/energinet-watt-query-params.mjs.map +0 -1
- package/fesm2022/energinet-watt-radio.mjs.map +0 -1
- package/fesm2022/energinet-watt-search.mjs.map +0 -1
- package/fesm2022/energinet-watt-segmented-buttons.mjs +0 -149
- package/fesm2022/energinet-watt-segmented-buttons.mjs.map +0 -1
- package/fesm2022/energinet-watt-shell.mjs +0 -315
- package/fesm2022/energinet-watt-shell.mjs.map +0 -1
- package/fesm2022/energinet-watt-slide-toggle.mjs +0 -104
- package/fesm2022/energinet-watt-slide-toggle.mjs.map +0 -1
- package/fesm2022/energinet-watt-slider.mjs +0 -159
- package/fesm2022/energinet-watt-slider.mjs.map +0 -1
- package/fesm2022/energinet-watt-spinner.mjs +0 -72
- package/fesm2022/energinet-watt-spinner.mjs.map +0 -1
- package/fesm2022/energinet-watt-stepper.mjs.map +0 -1
- package/fesm2022/energinet-watt-table.mjs +0 -441
- package/fesm2022/energinet-watt-table.mjs.map +0 -1
- package/fesm2022/energinet-watt-tabs.mjs +0 -254
- package/fesm2022/energinet-watt-tabs.mjs.map +0 -1
- package/fesm2022/energinet-watt-text-field.mjs +0 -316
- package/fesm2022/energinet-watt-text-field.mjs.map +0 -1
- package/fesm2022/energinet-watt-textarea-field.mjs +0 -136
- package/fesm2022/energinet-watt-textarea-field.mjs.map +0 -1
- package/fesm2022/energinet-watt-toast.mjs +0 -174
- package/fesm2022/energinet-watt-toast.mjs.map +0 -1
- package/fesm2022/energinet-watt-tooltip.mjs +0 -214
- package/fesm2022/energinet-watt-tooltip.mjs.map +0 -1
- package/fesm2022/energinet-watt-utils-css.mjs +0 -72
- package/fesm2022/energinet-watt-utils-css.mjs.map +0 -1
- package/fesm2022/energinet-watt-utils-intersection-observer.mjs +0 -83
- package/fesm2022/energinet-watt-utils-intersection-observer.mjs.map +0 -1
- package/fesm2022/energinet-watt-utils-resize-observer.mjs +0 -144
- package/fesm2022/energinet-watt-utils-resize-observer.mjs.map +0 -1
- package/fesm2022/energinet-watt-validation-message.mjs.map +0 -1
- package/fesm2022/energinet-watt-validators.mjs +0 -49
- package/fesm2022/energinet-watt-validators.mjs.map +0 -1
- package/fesm2022/energinet-watt-vater.mjs +0 -248
- package/fesm2022/energinet-watt-vater.mjs.map +0 -1
- package/fesm2022/energinet-watt-year-field.mjs +0 -282
- package/fesm2022/energinet-watt-year-field.mjs.map +0 -1
- package/fesm2022/energinet-watt-yearmonth-field.mjs +0 -324
- package/fesm2022/energinet-watt-yearmonth-field.mjs.map +0 -1
- package/fesm2022/energinet-watt.mjs +0 -31
- package/fesm2022/energinet-watt.mjs.map +0 -1
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
export { default as dayjs } from 'dayjs';
|
|
3
|
-
import utc from 'dayjs/plugin/utc';
|
|
4
|
-
import timezone from 'dayjs/plugin/timezone';
|
|
5
|
-
import duration from 'dayjs/plugin/duration';
|
|
6
|
-
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
7
|
-
import * as i1 from '@angular/material/core';
|
|
8
|
-
import { NativeDateAdapter, MAT_DATE_LOCALE, DateAdapter, MAT_NATIVE_DATE_FORMATS, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
9
|
-
import * as i0 from '@angular/core';
|
|
10
|
-
import { makeEnvironmentProviders, Pipe, signal, inject, LOCALE_ID, computed, Injectable } from '@angular/core';
|
|
11
|
-
|
|
12
|
-
//#region License
|
|
13
|
-
/**
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
16
|
-
*
|
|
17
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
18
|
-
* you may not use this file except in compliance with the License.
|
|
19
|
-
* You may obtain a copy of the License at
|
|
20
|
-
*
|
|
21
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
-
*
|
|
23
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
-
* See the License for the specific language governing permissions and
|
|
27
|
-
* limitations under the License.
|
|
28
|
-
*/
|
|
29
|
-
//#endregion
|
|
30
|
-
dayjs.extend(utc);
|
|
31
|
-
dayjs.extend(timezone);
|
|
32
|
-
dayjs.extend(duration);
|
|
33
|
-
dayjs.extend(customParseFormat);
|
|
34
|
-
|
|
35
|
-
//#region License
|
|
36
|
-
/**
|
|
37
|
-
* @license
|
|
38
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
39
|
-
*
|
|
40
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
41
|
-
* you may not use this file except in compliance with the License.
|
|
42
|
-
* You may obtain a copy of the License at
|
|
43
|
-
*
|
|
44
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
45
|
-
*
|
|
46
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
47
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
48
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
49
|
-
* See the License for the specific language governing permissions and
|
|
50
|
-
* limitations under the License.
|
|
51
|
-
*/
|
|
52
|
-
//#endregion
|
|
53
|
-
const danishLocale = 'da';
|
|
54
|
-
class WattDateAdapter extends NativeDateAdapter {
|
|
55
|
-
setActiveLocale(language) {
|
|
56
|
-
this.setLocale(language === danishLocale ? danishLocale : 'en-GB');
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* This is necessary to remove the dots from the date (ordinals) for danish locale in the calendar view.
|
|
60
|
-
* due to `Intl.DateTimeFormat`
|
|
61
|
-
*/
|
|
62
|
-
getDateNames() {
|
|
63
|
-
const dateNames = super.getDateNames();
|
|
64
|
-
return this.locale === danishLocale
|
|
65
|
-
? dateNames.map((dateName) => dateName.replace(/\./g, ''))
|
|
66
|
-
: dateNames;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Our week starts on Monday
|
|
70
|
-
* @returns 0 for Sunday, 1 for Monday, etc.
|
|
71
|
-
*/
|
|
72
|
-
getFirstDayOfWeek() {
|
|
73
|
-
return 1;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
//#region License
|
|
78
|
-
/**
|
|
79
|
-
* @license
|
|
80
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
81
|
-
*
|
|
82
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
83
|
-
* you may not use this file except in compliance with the License.
|
|
84
|
-
* You may obtain a copy of the License at
|
|
85
|
-
*
|
|
86
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
87
|
-
*
|
|
88
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
89
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
90
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
91
|
-
* See the License for the specific language governing permissions and
|
|
92
|
-
* limitations under the License.
|
|
93
|
-
*/
|
|
94
|
-
//#endregion
|
|
95
|
-
const danishDatetimeProviders = makeEnvironmentProviders([
|
|
96
|
-
{ provide: MAT_DATE_LOCALE, useValue: 'da' },
|
|
97
|
-
{
|
|
98
|
-
provide: DateAdapter,
|
|
99
|
-
useClass: WattDateAdapter,
|
|
100
|
-
deps: [MAT_DATE_LOCALE],
|
|
101
|
-
},
|
|
102
|
-
{ provide: MAT_DATE_FORMATS, useValue: MAT_NATIVE_DATE_FORMATS },
|
|
103
|
-
]);
|
|
104
|
-
|
|
105
|
-
//#region License
|
|
106
|
-
/**
|
|
107
|
-
* @license
|
|
108
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
109
|
-
*
|
|
110
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
111
|
-
* you may not use this file except in compliance with the License.
|
|
112
|
-
* You may obtain a copy of the License at
|
|
113
|
-
*
|
|
114
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
115
|
-
*
|
|
116
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
117
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
118
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
119
|
-
* See the License for the specific language governing permissions and
|
|
120
|
-
* limitations under the License.
|
|
121
|
-
*/
|
|
122
|
-
//#endregion
|
|
123
|
-
const formatStrings = {
|
|
124
|
-
monthYear: 'MMMM YYYY',
|
|
125
|
-
short: 'DD-MM-YYYY',
|
|
126
|
-
shortAbbr: 'DD. MMM YYYY',
|
|
127
|
-
long: 'DD-MM-YYYY HH:mm',
|
|
128
|
-
longAbbr: 'DD. MMM YYYY HH:mm',
|
|
129
|
-
time: 'HH:mm',
|
|
130
|
-
longAbbrWithSeconds: 'DD-MMM YYYY HH:mm:ss',
|
|
131
|
-
};
|
|
132
|
-
function wattFormatDate(input, format = 'short', timeZone = 'Europe/Copenhagen') {
|
|
133
|
-
if (!input)
|
|
134
|
-
return null;
|
|
135
|
-
if (input instanceof Date || typeof input === 'string') {
|
|
136
|
-
return dayjs(input).tz(timeZone).format(formatStrings[format]);
|
|
137
|
-
}
|
|
138
|
-
else if (typeof input === 'number') {
|
|
139
|
-
return dayjs(new Date(input)).tz(timeZone).format(formatStrings[format]);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
return transformRange(input, format);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
function transformRange(input, format) {
|
|
146
|
-
if (dayjs(input.start).isSame(dayjs(input.end), 'day') || input.end === null) {
|
|
147
|
-
return wattFormatDate(input.start, format);
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
return `${wattFormatDate(input.start, format)} ― ${wattFormatDate(input.end, format)}`;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
//#region License
|
|
155
|
-
/**
|
|
156
|
-
* @license
|
|
157
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
158
|
-
*
|
|
159
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
160
|
-
* you may not use this file except in compliance with the License.
|
|
161
|
-
* You may obtain a copy of the License at
|
|
162
|
-
*
|
|
163
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
164
|
-
*
|
|
165
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
166
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
167
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
168
|
-
* See the License for the specific language governing permissions and
|
|
169
|
-
* limitations under the License.
|
|
170
|
-
*/
|
|
171
|
-
//#endregion
|
|
172
|
-
class WattDatePipe {
|
|
173
|
-
/**
|
|
174
|
-
* @param input WattDateRange or string in ISO 8601 format or unix timestamp number
|
|
175
|
-
*/
|
|
176
|
-
transform(input, format = 'short', timeZone = 'Europe/Copenhagen') {
|
|
177
|
-
return wattFormatDate(input, format, timeZone);
|
|
178
|
-
}
|
|
179
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
180
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: WattDatePipe, isStandalone: true, name: "wattDate" });
|
|
181
|
-
}
|
|
182
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDatePipe, decorators: [{
|
|
183
|
-
type: Pipe,
|
|
184
|
-
args: [{
|
|
185
|
-
name: 'wattDate',
|
|
186
|
-
}]
|
|
187
|
-
}] });
|
|
188
|
-
|
|
189
|
-
//#region License
|
|
190
|
-
/**
|
|
191
|
-
* @license
|
|
192
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
193
|
-
*
|
|
194
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
195
|
-
* you may not use this file except in compliance with the License.
|
|
196
|
-
* You may obtain a copy of the License at
|
|
197
|
-
*
|
|
198
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
199
|
-
*
|
|
200
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
201
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
202
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
203
|
-
* See the License for the specific language governing permissions and
|
|
204
|
-
* limitations under the License.
|
|
205
|
-
*/
|
|
206
|
-
//#endregion
|
|
207
|
-
class WattLocaleService {
|
|
208
|
-
dateAdapter;
|
|
209
|
-
locale = signal(inject(LOCALE_ID));
|
|
210
|
-
isDanish = computed(() => this.locale() == 'da');
|
|
211
|
-
isEnglish = computed(() => this.locale() == 'en');
|
|
212
|
-
constructor(dateAdapter) {
|
|
213
|
-
this.dateAdapter = dateAdapter;
|
|
214
|
-
}
|
|
215
|
-
async setActiveLocale(locale) {
|
|
216
|
-
if (locale === 'da') {
|
|
217
|
-
await import('dayjs/locale/da');
|
|
218
|
-
}
|
|
219
|
-
if (locale === 'en') {
|
|
220
|
-
await import('dayjs/locale/en');
|
|
221
|
-
}
|
|
222
|
-
dayjs.locale(locale);
|
|
223
|
-
this.dateAdapter.setActiveLocale(locale);
|
|
224
|
-
this.locale.set(locale);
|
|
225
|
-
}
|
|
226
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattLocaleService, deps: [{ token: i1.DateAdapter }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
227
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattLocaleService, providedIn: 'root' });
|
|
228
|
-
}
|
|
229
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattLocaleService, decorators: [{
|
|
230
|
-
type: Injectable,
|
|
231
|
-
args: [{
|
|
232
|
-
providedIn: 'root',
|
|
233
|
-
}]
|
|
234
|
-
}], ctorParameters: () => [{ type: i1.DateAdapter }] });
|
|
235
|
-
|
|
236
|
-
//#region License
|
|
237
|
-
/**
|
|
238
|
-
* @license
|
|
239
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
240
|
-
*
|
|
241
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
242
|
-
* you may not use this file except in compliance with the License.
|
|
243
|
-
* You may obtain a copy of the License at
|
|
244
|
-
*
|
|
245
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
246
|
-
*
|
|
247
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
248
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
249
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
250
|
-
* See the License for the specific language governing permissions and
|
|
251
|
-
* limitations under the License.
|
|
252
|
-
*/
|
|
253
|
-
//#endregion
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Generated bundle index. Do not edit.
|
|
257
|
-
*/
|
|
258
|
-
|
|
259
|
-
export { WattDateAdapter, WattDatePipe, WattLocaleService, danishDatetimeProviders, wattFormatDate };
|
|
260
|
-
//# sourceMappingURL=energinet-watt-core-date.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-core-date.mjs","sources":["../../../libs/watt/package/core/date/dayjs.ts","../../../libs/watt/package/core/date/watt-date-adapter.ts","../../../libs/watt/package/core/date/watt-danish-datetime.providers.ts","../../../libs/watt/package/core/date/watt-format-date.ts","../../../libs/watt/package/core/date/watt-date.pipe.ts","../../../libs/watt/package/core/date/watt-locale.service.ts","../../../libs/watt/package/core/date/index.ts","../../../libs/watt/package/core/date/energinet-watt-core-date.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 dayjs from 'dayjs'; // eslint-disable-line no-restricted-imports\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\nimport duration from 'dayjs/plugin/duration';\nimport 'dayjs/plugin/customParseFormat';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\n\n// Required for the packaging process to register these modules as \"side effectful\"\nimport 'dayjs/plugin/utc';\nimport 'dayjs/plugin/timezone';\nimport 'dayjs/plugin/duration';\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(duration);\ndayjs.extend(customParseFormat);\n\nexport { dayjs };\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 { NativeDateAdapter } from '@angular/material/core';\n\nexport type WattSupportedLocales = 'da' | 'en';\nconst danishLocale = 'da';\n\nexport class WattDateAdapter extends NativeDateAdapter {\n setActiveLocale(language: WattSupportedLocales): void {\n this.setLocale(language === danishLocale ? danishLocale : 'en-GB');\n }\n\n /**\n * This is necessary to remove the dots from the date (ordinals) for danish locale in the calendar view.\n * due to `Intl.DateTimeFormat`\n */\n override getDateNames(): string[] {\n const dateNames = super.getDateNames();\n\n return this.locale === danishLocale\n ? dateNames.map((dateName) => dateName.replace(/\\./g, ''))\n : dateNames;\n }\n\n /**\n * Our week starts on Monday\n * @returns 0 for Sunday, 1 for Monday, etc.\n */\n override getFirstDayOfWeek(): number {\n return 1;\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 DateAdapter,\n MAT_DATE_FORMATS,\n MAT_DATE_LOCALE,\n MAT_NATIVE_DATE_FORMATS,\n} from '@angular/material/core';\nimport { makeEnvironmentProviders } from '@angular/core';\n\nimport { WattDateAdapter } from './watt-date-adapter';\n\nexport const danishDatetimeProviders = makeEnvironmentProviders([\n { provide: MAT_DATE_LOCALE, useValue: 'da' },\n {\n provide: DateAdapter,\n useClass: WattDateAdapter,\n deps: [MAT_DATE_LOCALE],\n },\n { provide: MAT_DATE_FORMATS, useValue: MAT_NATIVE_DATE_FORMATS },\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 { dayjs } from './dayjs';\nimport { WattRange } from './watt-date-range';\n\nexport const formatStrings = {\n monthYear: 'MMMM YYYY',\n short: 'DD-MM-YYYY',\n shortAbbr: 'DD. MMM YYYY',\n long: 'DD-MM-YYYY HH:mm',\n longAbbr: 'DD. MMM YYYY HH:mm',\n time: 'HH:mm',\n longAbbrWithSeconds: 'DD-MMM YYYY HH:mm:ss',\n};\n\nexport function wattFormatDate(\n input?: WattRange<Date> | WattRange<string> | Date | string | number | null,\n format: keyof typeof formatStrings = 'short',\n timeZone = 'Europe/Copenhagen'\n): string | null {\n if (!input) return null;\n\n if (input instanceof Date || typeof input === 'string') {\n return dayjs(input).tz(timeZone).format(formatStrings[format]);\n } else if (typeof input === 'number') {\n return dayjs(new Date(input)).tz(timeZone).format(formatStrings[format]);\n } else {\n return transformRange(input, format);\n }\n}\n\nfunction transformRange(\n input: WattRange<Date | string>,\n format: keyof typeof formatStrings\n): string | null {\n if (dayjs(input.start).isSame(dayjs(input.end), 'day') || input.end === null) {\n return wattFormatDate(input.start, format);\n } else {\n return `${wattFormatDate(input.start, format)} ― ${wattFormatDate(input.end, format)}`;\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 { Pipe, PipeTransform } from '@angular/core';\n\nimport { WattRange } from './watt-date-range';\nimport { formatStrings, wattFormatDate } from './watt-format-date';\n\n@Pipe({\n name: 'wattDate',\n})\nexport class WattDatePipe implements PipeTransform {\n /**\n * @param input WattDateRange or string in ISO 8601 format or unix timestamp number\n */\n transform(\n input?: WattRange<Date> | WattRange<string> | Date | string | number | null,\n format: keyof typeof formatStrings = 'short',\n timeZone = 'Europe/Copenhagen'\n ): string | null {\n return wattFormatDate(input, format, timeZone);\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 { computed, inject, Injectable, LOCALE_ID, signal } from '@angular/core';\nimport { DateAdapter } from '@angular/material/core';\n\nimport { WattDateAdapter, WattSupportedLocales } from './watt-date-adapter';\nimport { dayjs } from './dayjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class WattLocaleService {\n locale = signal(inject<WattSupportedLocales>(LOCALE_ID));\n isDanish = computed(() => this.locale() == 'da');\n isEnglish = computed(() => this.locale() == 'en');\n\n constructor(private dateAdapter: DateAdapter<unknown>) {}\n\n async setActiveLocale(locale: WattSupportedLocales): Promise<void> {\n if (locale === 'da') {\n await import('dayjs/locale/da');\n }\n\n if (locale === 'en') {\n await import('dayjs/locale/en');\n }\n\n dayjs.locale(locale);\n (this.dateAdapter as WattDateAdapter).setActiveLocale(locale);\n this.locale.set(locale);\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { dayjs } from './dayjs';\nexport { danishDatetimeProviders } from './watt-danish-datetime.providers';\nexport { WattDateAdapter, WattSupportedLocales } from './watt-date-adapter';\nexport { type WattRange, type WattDateRange } from './watt-date-range';\nexport { WattDatePipe } from './watt-date.pipe';\nexport { wattFormatDate } from './watt-format-date';\nexport { WattLocaleService } from './watt-locale.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAaA,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;AACjB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AACtB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AACtB,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC;;ACjC/B;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAIA,MAAM,YAAY,GAAG,IAAI;AAEnB,MAAO,eAAgB,SAAQ,iBAAiB,CAAA;AACpD,IAAA,eAAe,CAAC,QAA8B,EAAA;AAC5C,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,KAAK,YAAY,GAAG,YAAY,GAAG,OAAO,CAAC;;AAGpE;;;AAGG;IACM,YAAY,GAAA;AACnB,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,EAAE;AAEtC,QAAA,OAAO,IAAI,CAAC,MAAM,KAAK;AACrB,cAAE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;cACvD,SAAS;;AAGf;;;AAGG;IACM,iBAAiB,GAAA;AACxB,QAAA,OAAO,CAAC;;AAEX;;AC/CD;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAWO,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAC9D,IAAA,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE;AAC5C,IAAA;AACE,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,CAAC,eAAe,CAAC;AACxB,KAAA;AACD,IAAA,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,uB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AK,CAAC,MAAM,CAAC,MAAM,CAAC;AACnB,QAAA,IAAI,CAAC,WAA+B,CAAC,eAAe,CAAC,MAAM,CAAC;AAC7D,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;;uGAlBd,iBAAiB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,cAFhB,MAAM,EAAA,CAAA;;2FAEP,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAH7B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AC1BD;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-data.mjs","sources":["../../../libs/watt/package/data/watt-data-filters.component.ts","../../../libs/watt/package/data/watt-data-actions.component.ts","../../../libs/watt/package/data/watt-data-intl.service.ts","../../../libs/watt/package/data/watt-data-table.component.ts","../../../libs/watt/package/data/index.ts","../../../libs/watt/package/data/energinet-watt-data.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-data-filters',\n template: `<ng-content />`,\n})\nexport class WattDataFiltersComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-data-actions',\n template: `<ng-content />`,\n})\nexport class WattDataActionsComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattDataIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n search = 'Search';\n emptyTitle = 'No results found';\n emptyText = 'Try changing the search criteria.';\n emptyRetry = 'Retry';\n errorTitle = 'An unexpected error occured';\n errorText = 'Unfortunately, an error occurred while retrieving the necessary information.';\n defaultTitle = 'An unexpected error occured';\n defaultText = 'Unfortunately, an error occurred while retrieving the necessary information.';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Component,\n ViewEncapsulation,\n contentChild,\n inject,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { PageEvent } from '@angular/material/paginator';\n\nimport {\n VaterFlexComponent,\n VaterSpacerComponent,\n VaterStackComponent,\n VaterUtilityDirective,\n} from '@energinet/watt/vater';\nimport { WATT_CARD_VARIANT, WattCardComponent } from '@energinet/watt/card';\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattEmptyStateComponent } from '@energinet/watt/empty-state';\nimport { WattPaginatorComponent } from '@energinet/watt/paginator';\nimport { WattSearchComponent } from '@energinet/watt/search';\nimport { WattTableComponent } from '@energinet/watt/table';\nimport { WattIcon } from '@energinet/watt/icon';\n\nimport { WattDataIntlService } from './watt-data-intl.service';\n\n@Component({\n selector: 'watt-data-table',\n imports: [\n VaterFlexComponent,\n VaterSpacerComponent,\n VaterStackComponent,\n VaterUtilityDirective,\n WattCardComponent,\n WattEmptyStateComponent,\n WattPaginatorComponent,\n WattSearchComponent,\n WattButtonComponent,\n ],\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-data-table h3,\n watt-data-table h4 {\n line-height: 44px;\n min-height: 44px;\n margin: 0;\n }\n\n watt-data-table watt-paginator {\n display: block;\n margin: calc(-1 * var(--watt-space-m)) -24px -24px;\n }\n\n watt-data-table watt-table .mat-mdc-table tr.mdc-data-table__row:last-child .mat-mdc-cell {\n border-bottom: none;\n }\n\n watt-data-table watt-empty-state {\n margin: var(--watt-space-xl) 0;\n }\n `,\n ],\n template: `\n <watt-card vater fill=\"vertical\" [variant]=\"variant()\">\n <vater-flex autoSize fill=\"vertical\" gap=\"m\">\n <vater-stack direction=\"row\" gap=\"m\">\n <vater-stack direction=\"row\" gap=\"s\">\n <ng-content select=\"h3\" />\n <ng-content select=\"h4\" />\n @if (enableCount()) {\n <span class=\"watt-chip-label\">{{ count() ?? table().dataSource.totalCount }}</span>\n }\n @if (queryTime()) {\n <span class=\"watt-label\">in {{ queryTime() }} ms</span>\n }\n </vater-stack>\n <ng-content />\n <vater-spacer />\n @if (enableSearch()) {\n <watt-search [label]=\"searchLabel() ?? intl.search\" (search)=\"onSearch($event)\" />\n }\n <ng-content select=\"watt-data-actions\" />\n <ng-content select=\"watt-button\" />\n </vater-stack>\n <ng-content select=\"watt-data-filters\" />\n <vater-flex [autoSize]=\"autoSize()\" fill=\"vertical\">\n <ng-content select=\"watt-table\" />\n @if (\n enableEmptyState() && !table().loading && table().dataSource.filteredData.length === 0\n ) {\n <vater-flex [autoSize]=\"autoSize()\" fill=\"vertical\">\n <vater-stack scrollable justify=\"center\">\n <watt-empty-state\n [icon]=\"error() ? 'custom-power' : ready() ? emptyStateIcon() : 'custom-explore'\"\n [title]=\"\n error() ? intl.errorTitle : ready() ? intl.emptyTitle : intl.defaultTitle\n \"\n [message]=\"error() ? intl.errorText : ready() ? intl.emptyText : intl.defaultText\"\n >\n @if (enableRetry()) {\n <watt-button variant=\"secondary\" (click)=\"retry.emit()\">{{\n intl.emptyRetry\n }}</watt-button>\n }\n </watt-empty-state>\n </vater-stack>\n </vater-flex>\n }\n </vater-flex>\n @if (enablePaginator()) {\n <watt-paginator\n [for]=\"table().dataSource\"\n [length]=\"count() ?? 0\"\n (changed)=\"pageChanged.emit($event)\"\n />\n }\n </vater-flex>\n </watt-card>\n `,\n})\nexport class WattDataTableComponent {\n intl = inject(WattDataIntlService);\n\n error = input<unknown>();\n ready = input(true);\n enableSearch = input(true);\n enableRetry = input(false);\n enableCount = input(true);\n enableEmptyState = input(true);\n queryTime = input<number>();\n searchLabel = input<string>();\n enablePaginator = input(true);\n count = input<number>();\n autoSize = input(false);\n variant = input<WATT_CARD_VARIANT>('elevation');\n emptyStateIcon = input<WattIcon | 'custom-power' | 'custom-explore' | 'custom-no-results'>(\n 'cancel'\n );\n\n clear = output();\n pageChanged = output<PageEvent>();\n retry = output();\n\n table = contentChild.required(WattTableComponent<unknown>, { descendants: true });\n\n search = viewChild(WattSearchComponent);\n reset = () => this.search()?.clear();\n\n onSearch(value: string) {\n this.table().dataSource.filter = value;\n if (!value) this.clear.emit();\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattDataFiltersComponent } from './watt-data-filters.component';\nexport { WattDataActionsComponent } from './watt-data-actions.component';\nexport { WattDataIntlService } from './watt-data-intl.service';\nexport { WattDataTableComponent } from './watt-data-table.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAOa,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,6EAFzB,CAAA,cAAA,CAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEf,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,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
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, viewChild, input, output, signal, computed, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/forms';
|
|
4
|
-
import { FormControl, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
-
import { takeUntilDestroyed, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
6
|
-
import { MatCalendar } from '@angular/material/datepicker';
|
|
7
|
-
import { MaskitoDirective } from '@maskito/angular';
|
|
8
|
-
import { maskitoDateTimeOptionsGenerator } from '@maskito/kit';
|
|
9
|
-
import { map, share } from 'rxjs';
|
|
10
|
-
import { WattLocaleService, dayjs } from '@energinet/watt/core/date';
|
|
11
|
-
import { WattFieldComponent } from '@energinet/watt/field';
|
|
12
|
-
import { WattButtonComponent } from '@energinet/watt/button';
|
|
13
|
-
|
|
14
|
-
//#region License
|
|
15
|
-
/**
|
|
16
|
-
* @license
|
|
17
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
18
|
-
*
|
|
19
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
20
|
-
* you may not use this file except in compliance with the License.
|
|
21
|
-
* You may obtain a copy of the License at
|
|
22
|
-
*
|
|
23
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
-
*
|
|
25
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
26
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
27
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28
|
-
* See the License for the specific language governing permissions and
|
|
29
|
-
* limitations under the License.
|
|
30
|
-
*/
|
|
31
|
-
//#endregion
|
|
32
|
-
const DA_FILLER = 'dd-mm-åååå, tt:mm';
|
|
33
|
-
const EN_FILLER = 'dd-mm-yyyy, hh:mm';
|
|
34
|
-
const DATETIME_FORMAT = 'DD-MM-YYYY, HH:mm';
|
|
35
|
-
const PARTIAL_DATETIME_FORMAT = 'DD-MM-YYYY, ';
|
|
36
|
-
const DANISH_TIME_ZONE_IDENTIFIER = 'Europe/Copenhagen';
|
|
37
|
-
/* eslint-disable @angular-eslint/component-class-suffix */
|
|
38
|
-
class WattDateTimeField {
|
|
39
|
-
locale = inject(WattLocaleService);
|
|
40
|
-
// Popovers exists on an entirely different layer, meaning that for anchor positioning they
|
|
41
|
-
// look at the entire tree for the anchor name. This gives each field a unique anchor name.
|
|
42
|
-
static instance = 0;
|
|
43
|
-
instance = WattDateTimeField.instance++;
|
|
44
|
-
anchorName = `--watt-datetime-field-popover-anchor-${this.instance}`;
|
|
45
|
-
/** Converts date from outer FormControl to format of inner FormControl. */
|
|
46
|
-
modelToView = (value, format = DATETIME_FORMAT) => value ? dayjs(value).tz(DANISH_TIME_ZONE_IDENTIFIER).format(format) : '';
|
|
47
|
-
/** Converts value of inner FormControl to type of outer FormControl. */
|
|
48
|
-
viewToModel = (value) => {
|
|
49
|
-
const date = dayjs(value, DATETIME_FORMAT, true);
|
|
50
|
-
if (!date.isValid())
|
|
51
|
-
return null;
|
|
52
|
-
return this.inclusive() ? date.endOf('m').toDate() : date.toDate();
|
|
53
|
-
};
|
|
54
|
-
// Must unfortunately be queried in order to update `activeDate`
|
|
55
|
-
calendar = viewChild.required(MatCalendar);
|
|
56
|
-
// This inner FormControl is string only, but the outer FormControl is of type Date.
|
|
57
|
-
control = new FormControl('', { nonNullable: true });
|
|
58
|
-
// `registerOnChange` may subscribe to this component after it has been destroyed, thus
|
|
59
|
-
// triggering an NG0911 from the `takeUntilDestroyed` operator. By sharing the observable,
|
|
60
|
-
// the observable will already be closed and `subscribe` becomes a proper noop.
|
|
61
|
-
valueChanges = this.control.valueChanges.pipe(map(this.viewToModel), takeUntilDestroyed(), share());
|
|
62
|
-
/** Set the label text for `watt-field`. */
|
|
63
|
-
label = input('');
|
|
64
|
-
/** The minimum selectable date. */
|
|
65
|
-
min = input();
|
|
66
|
-
/** The maximum selectable date. */
|
|
67
|
-
max = input();
|
|
68
|
-
/** When true, seconds will be set to 59 and milliseconds to 999. Otherwise, both are 0. */
|
|
69
|
-
inclusive = input(false);
|
|
70
|
-
/** Emits when the selected date has changed. */
|
|
71
|
-
dateChange = outputFromObservable(this.valueChanges);
|
|
72
|
-
/** Emits when the field loses focus. */
|
|
73
|
-
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
74
|
-
blur = output();
|
|
75
|
-
selected = signal(null);
|
|
76
|
-
placeholder = computed(() => (this.locale.isDanish() ? DA_FILLER : EN_FILLER));
|
|
77
|
-
mask = computed(() => maskitoDateTimeOptionsGenerator({
|
|
78
|
-
min: this.min(),
|
|
79
|
-
max: this.max(),
|
|
80
|
-
dateMode: 'dd/mm/yyyy',
|
|
81
|
-
timeMode: 'HH:MM',
|
|
82
|
-
dateSeparator: '-',
|
|
83
|
-
timeStep: 1,
|
|
84
|
-
}));
|
|
85
|
-
handleBlur = (picker, event) => {
|
|
86
|
-
if (event.relatedTarget instanceof HTMLElement && picker.contains(event.relatedTarget)) {
|
|
87
|
-
const target = event.target; // safe type assertion
|
|
88
|
-
setTimeout(() => target.focus()); // keep focus on input element while using the picker
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
picker.hidePopover();
|
|
92
|
-
this.blur.emit(event);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
handleSelectedChange = (field, picker, date) => {
|
|
96
|
-
const prev = this.viewToModel(this.control.value);
|
|
97
|
-
// Only write the date part
|
|
98
|
-
field.value = prev
|
|
99
|
-
? this.modelToView(dayjs(date).set('h', prev.getHours()).set('m', prev.getMinutes()).toDate())
|
|
100
|
-
: this.modelToView(date, PARTIAL_DATETIME_FORMAT);
|
|
101
|
-
field.dispatchEvent(new Event('input', { bubbles: true }));
|
|
102
|
-
picker.hidePopover();
|
|
103
|
-
};
|
|
104
|
-
constructor() {
|
|
105
|
-
this.valueChanges.subscribe((value) => {
|
|
106
|
-
this.selected.set(value);
|
|
107
|
-
this.calendar().activeDate = value ?? new Date();
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
// Implementation for ControlValueAccessor
|
|
111
|
-
writeValue = (value) => this.control.setValue(this.modelToView(value));
|
|
112
|
-
setDisabledState = (x) => (x ? this.control.disable() : this.control.enable());
|
|
113
|
-
registerOnTouched = (fn) => this.blur.subscribe(fn);
|
|
114
|
-
registerOnChange = (fn) => this.valueChanges.subscribe(fn);
|
|
115
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDateTimeField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
116
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.1", type: WattDateTimeField, isStandalone: true, selector: "watt-datetime-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, inclusive: { classPropertyName: "inclusive", publicName: "inclusive", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateChange: "dateChange", blur: "blur" }, providers: [
|
|
117
|
-
{
|
|
118
|
-
provide: NG_VALUE_ACCESSOR,
|
|
119
|
-
useExisting: forwardRef(() => WattDateTimeField),
|
|
120
|
-
multi: true,
|
|
121
|
-
},
|
|
122
|
-
], viewQueries: [{ propertyName: "calendar", first: true, predicate: MatCalendar, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
123
|
-
<watt-field
|
|
124
|
-
[label]="label()"
|
|
125
|
-
[control]="control"
|
|
126
|
-
[placeholder]="placeholder()"
|
|
127
|
-
[anchorName]="anchorName"
|
|
128
|
-
>
|
|
129
|
-
<input
|
|
130
|
-
#field
|
|
131
|
-
[formControl]="control"
|
|
132
|
-
[maskito]="mask()"
|
|
133
|
-
(focus)="picker.showPopover()"
|
|
134
|
-
(blur)="handleBlur(picker, $event)"
|
|
135
|
-
/>
|
|
136
|
-
<watt-button icon="date" variant="icon" (click)="field.focus()" />
|
|
137
|
-
<div
|
|
138
|
-
#picker
|
|
139
|
-
class="watt-elevation watt-datetime-field-picker"
|
|
140
|
-
popover="manual"
|
|
141
|
-
tabindex="0"
|
|
142
|
-
[style.position-anchor]="anchorName"
|
|
143
|
-
>
|
|
144
|
-
<mat-calendar
|
|
145
|
-
[startAt]="selected()"
|
|
146
|
-
[selected]="selected()"
|
|
147
|
-
[minDate]="min()"
|
|
148
|
-
[maxDate]="max()"
|
|
149
|
-
(selectedChange)="handleSelectedChange(field, picker, $event)"
|
|
150
|
-
/>
|
|
151
|
-
</div>
|
|
152
|
-
<ng-content />
|
|
153
|
-
<ng-content select="watt-field-error" ngProjectAs="watt-field-error" />
|
|
154
|
-
<ng-content select="watt-field-hint" ngProjectAs="watt-field-hint" />
|
|
155
|
-
</watt-field>
|
|
156
|
-
`, isInline: true, styles: ["watt-datetime-field{display:block;width:100%}.watt-datetime-field-picker{position:fixed;position-area:bottom span-right;position-try-fallbacks:flip-block;width:296px;height:354px;inset:unset;margin:unset;border:0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"] }, { kind: "component", type: MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
157
|
-
}
|
|
158
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDateTimeField, decorators: [{
|
|
159
|
-
type: Component,
|
|
160
|
-
args: [{ selector: 'watt-datetime-field', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
161
|
-
{
|
|
162
|
-
provide: NG_VALUE_ACCESSOR,
|
|
163
|
-
useExisting: forwardRef(() => WattDateTimeField),
|
|
164
|
-
multi: true,
|
|
165
|
-
},
|
|
166
|
-
], imports: [
|
|
167
|
-
ReactiveFormsModule,
|
|
168
|
-
MaskitoDirective,
|
|
169
|
-
MatCalendar,
|
|
170
|
-
WattButtonComponent,
|
|
171
|
-
WattFieldComponent,
|
|
172
|
-
], template: `
|
|
173
|
-
<watt-field
|
|
174
|
-
[label]="label()"
|
|
175
|
-
[control]="control"
|
|
176
|
-
[placeholder]="placeholder()"
|
|
177
|
-
[anchorName]="anchorName"
|
|
178
|
-
>
|
|
179
|
-
<input
|
|
180
|
-
#field
|
|
181
|
-
[formControl]="control"
|
|
182
|
-
[maskito]="mask()"
|
|
183
|
-
(focus)="picker.showPopover()"
|
|
184
|
-
(blur)="handleBlur(picker, $event)"
|
|
185
|
-
/>
|
|
186
|
-
<watt-button icon="date" variant="icon" (click)="field.focus()" />
|
|
187
|
-
<div
|
|
188
|
-
#picker
|
|
189
|
-
class="watt-elevation watt-datetime-field-picker"
|
|
190
|
-
popover="manual"
|
|
191
|
-
tabindex="0"
|
|
192
|
-
[style.position-anchor]="anchorName"
|
|
193
|
-
>
|
|
194
|
-
<mat-calendar
|
|
195
|
-
[startAt]="selected()"
|
|
196
|
-
[selected]="selected()"
|
|
197
|
-
[minDate]="min()"
|
|
198
|
-
[maxDate]="max()"
|
|
199
|
-
(selectedChange)="handleSelectedChange(field, picker, $event)"
|
|
200
|
-
/>
|
|
201
|
-
</div>
|
|
202
|
-
<ng-content />
|
|
203
|
-
<ng-content select="watt-field-error" ngProjectAs="watt-field-error" />
|
|
204
|
-
<ng-content select="watt-field-hint" ngProjectAs="watt-field-hint" />
|
|
205
|
-
</watt-field>
|
|
206
|
-
`, styles: ["watt-datetime-field{display:block;width:100%}.watt-datetime-field-picker{position:fixed;position-area:bottom span-right;position-try-fallbacks:flip-block;width:296px;height:354px;inset:unset;margin:unset;border:0}\n"] }]
|
|
207
|
-
}], ctorParameters: () => [] });
|
|
208
|
-
|
|
209
|
-
//#region License
|
|
210
|
-
/**
|
|
211
|
-
* @license
|
|
212
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
213
|
-
*
|
|
214
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
215
|
-
* you may not use this file except in compliance with the License.
|
|
216
|
-
* You may obtain a copy of the License at
|
|
217
|
-
*
|
|
218
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
219
|
-
*
|
|
220
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
221
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
222
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
223
|
-
* See the License for the specific language governing permissions and
|
|
224
|
-
* limitations under the License.
|
|
225
|
-
*/
|
|
226
|
-
//#endregion
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Generated bundle index. Do not edit.
|
|
230
|
-
*/
|
|
231
|
-
|
|
232
|
-
export { WattDateTimeField };
|
|
233
|
-
//# sourceMappingURL=energinet-watt-datetime-field.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-datetime-field.mjs","sources":["../../../libs/watt/package/datetime-field/watt-datetime-field.component.ts","../../../libs/watt/package/datetime-field/index.ts","../../../libs/watt/package/datetime-field/energinet-watt-datetime-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 {\n ChangeDetectionStrategy,\n Component,\n computed,\n forwardRef,\n inject,\n input,\n output,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { outputFromObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatCalendar } from '@angular/material/datepicker';\nimport { MaskitoDirective } from '@maskito/angular';\nimport { maskitoDateTimeOptionsGenerator } from '@maskito/kit';\nimport { map, share } from 'rxjs';\nimport { dayjs, WattLocaleService } from '@energinet/watt/core/date';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\nconst DA_FILLER = 'dd-mm-åååå, tt:mm';\nconst EN_FILLER = 'dd-mm-yyyy, hh:mm';\nconst DATETIME_FORMAT = 'DD-MM-YYYY, HH:mm';\nconst PARTIAL_DATETIME_FORMAT = 'DD-MM-YYYY, ';\nconst DANISH_TIME_ZONE_IDENTIFIER = 'Europe/Copenhagen';\n\n/* eslint-disable @angular-eslint/component-class-suffix */\n@Component({\n selector: 'watt-datetime-field',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattDateTimeField),\n multi: true,\n },\n ],\n imports: [\n ReactiveFormsModule,\n MaskitoDirective,\n MatCalendar,\n WattButtonComponent,\n WattFieldComponent,\n ],\n styles: [\n `\n watt-datetime-field {\n display: block;\n width: 100%;\n }\n\n .watt-datetime-field-picker {\n position: fixed;\n position-area: bottom span-right;\n position-try-fallbacks: flip-block;\n width: 296px;\n height: 354px;\n inset: unset;\n margin: unset;\n border: 0;\n }\n `,\n ],\n template: `\n <watt-field\n [label]=\"label()\"\n [control]=\"control\"\n [placeholder]=\"placeholder()\"\n [anchorName]=\"anchorName\"\n >\n <input\n #field\n [formControl]=\"control\"\n [maskito]=\"mask()\"\n (focus)=\"picker.showPopover()\"\n (blur)=\"handleBlur(picker, $event)\"\n />\n <watt-button icon=\"date\" variant=\"icon\" (click)=\"field.focus()\" />\n <div\n #picker\n class=\"watt-elevation watt-datetime-field-picker\"\n popover=\"manual\"\n tabindex=\"0\"\n [style.position-anchor]=\"anchorName\"\n >\n <mat-calendar\n [startAt]=\"selected()\"\n [selected]=\"selected()\"\n [minDate]=\"min()\"\n [maxDate]=\"max()\"\n (selectedChange)=\"handleSelectedChange(field, picker, $event)\"\n />\n </div>\n <ng-content />\n <ng-content select=\"watt-field-error\" ngProjectAs=\"watt-field-error\" />\n <ng-content select=\"watt-field-hint\" ngProjectAs=\"watt-field-hint\" />\n </watt-field>\n `,\n})\nexport class WattDateTimeField implements ControlValueAccessor {\n private locale = inject(WattLocaleService);\n\n // Popovers exists on an entirely different layer, meaning that for anchor positioning they\n // look at the entire tree for the anchor name. This gives each field a unique anchor name.\n private static instance = 0;\n private instance = WattDateTimeField.instance++;\n protected anchorName = `--watt-datetime-field-popover-anchor-${this.instance}`;\n\n /** Converts date from outer FormControl to format of inner FormControl. */\n protected modelToView = (value: Date | null, format = DATETIME_FORMAT) =>\n value ? dayjs(value).tz(DANISH_TIME_ZONE_IDENTIFIER).format(format) : '';\n\n /** Converts value of inner FormControl to type of outer FormControl. */\n protected viewToModel = (value: string) => {\n const date = dayjs(value, DATETIME_FORMAT, true);\n if (!date.isValid()) return null;\n return this.inclusive() ? date.endOf('m').toDate() : date.toDate();\n };\n\n // Must unfortunately be queried in order to update `activeDate`\n private calendar = viewChild.required<MatCalendar<Date>>(MatCalendar);\n\n // This inner FormControl is string only, but the outer FormControl is of type Date.\n protected control = new FormControl('', { nonNullable: true });\n\n // `registerOnChange` may subscribe to this component after it has been destroyed, thus\n // triggering an NG0911 from the `takeUntilDestroyed` operator. By sharing the observable,\n // the observable will already be closed and `subscribe` becomes a proper noop.\n private valueChanges = this.control.valueChanges.pipe(\n map(this.viewToModel),\n takeUntilDestroyed(),\n share()\n );\n\n /** Set the label text for `watt-field`. */\n label = input('');\n\n /** The minimum selectable date. */\n min = input<Date>();\n\n /** The maximum selectable date. */\n max = input<Date>();\n\n /** When true, seconds will be set to 59 and milliseconds to 999. Otherwise, both are 0. */\n inclusive = input(false);\n\n /** Emits when the selected date has changed. */\n dateChange = outputFromObservable(this.valueChanges);\n\n /** Emits when the field loses focus. */\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n\n protected selected = signal<Date | null>(null);\n protected placeholder = computed(() => (this.locale.isDanish() ? DA_FILLER : EN_FILLER));\n protected mask = computed(() =>\n maskitoDateTimeOptionsGenerator({\n min: this.min(),\n max: this.max(),\n dateMode: 'dd/mm/yyyy',\n timeMode: 'HH:MM',\n dateSeparator: '-',\n timeStep: 1,\n })\n );\n\n protected handleBlur = (picker: HTMLElement, event: FocusEvent) => {\n if (event.relatedTarget instanceof HTMLElement && picker.contains(event.relatedTarget)) {\n const target = event.target as HTMLInputElement; // safe type assertion\n setTimeout(() => target.focus()); // keep focus on input element while using the picker\n } else {\n picker.hidePopover();\n this.blur.emit(event);\n }\n };\n\n protected handleSelectedChange = (\n field: HTMLInputElement,\n picker: HTMLDivElement,\n date: Date\n ) => {\n const prev = this.viewToModel(this.control.value);\n\n // Only write the date part\n field.value = prev\n ? this.modelToView(dayjs(date).set('h', prev.getHours()).set('m', prev.getMinutes()).toDate())\n : this.modelToView(date, PARTIAL_DATETIME_FORMAT);\n\n field.dispatchEvent(new Event('input', { bubbles: true }));\n picker.hidePopover();\n };\n\n constructor() {\n this.valueChanges.subscribe((value) => {\n this.selected.set(value);\n this.calendar().activeDate = value ?? new Date();\n });\n }\n\n // Implementation for ControlValueAccessor\n writeValue = (value: Date | null) => this.control.setValue(this.modelToView(value));\n setDisabledState = (x: boolean) => (x ? this.control.disable() : this.control.enable());\n registerOnTouched = (fn: () => void) => this.blur.subscribe(fn);\n registerOnChange = (fn: (value: Date | null) => void) => this.valueChanges.subscribe(fn);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattDateTimeField } from './watt-datetime-field.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AA4BA,MAAM,SAAS,GAAG,mBAAmB;AACrC,MAAM,SAAS,GAAG,mBAAmB;AACrC,MAAM,eAAe,GAAG,mBAAmB;AAC3C,MAAM,uBAAuB,GAAG,cAAc;AAC9C,MAAM,2BAA2B,GAAG,mBAAmB;AAEvD;MA0Ea,iBAAiB,CAAA;AACpB,IAAA,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;;;AA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;;;;;;;;;;;;;;;;;;;;;AAkCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,yNAAA,CAAA,EAAA;;;AC3HH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-description-list.mjs","sources":["../../../libs/watt/package/description-list/watt-description-list-item.component.ts","../../../libs/watt/package/description-list/watt-description-list.component.ts","../../../libs/watt/package/description-list/index.ts","../../../libs/watt/package/description-list/energinet-watt-description-list.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { ChangeDetectionStrategy, Component, input, TemplateRef, viewChild } from '@angular/core';\nimport { NgClass } from '@angular/common';\n\n@Component({\n imports: [NgClass],\n selector: 'watt-description-list-item',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [NgClass],\n template: `<ng-template #templateRef\n ><div [ngClass]=\"{ 'force-new-row': forceNewRow() }\">\n <dt class=\"watt-label watt-on-light--high-emphasis\">{{ label() }}</dt>\n <dd class=\"watt-text-s\">{{ value() }}<ng-content /></dd></div\n ></ng-template>`,\n})\nexport class WattDescriptionListItemComponent<T> {\n templateRef = viewChild.required<TemplateRef<unknown | null>>('templateRef');\n label = input<string>('');\n value = input<T | null>(null);\n forceNewRow = input(false);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n contentChildren,\n effect,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { WattDescriptionListItemComponent } from './watt-description-list-item.component';\n/**\n * Usage:\n * `import { WattDescriptionListComponent } from '@energinet-datahub/watt/description-list';`\n */\n@Component({\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-description-list',\n styleUrls: ['./watt-description-list.component.scss'],\n imports: [NgTemplateOutlet],\n template: `<dl>\n @for (item of descriptionItems(); track item) {\n <ng-container *ngTemplateOutlet=\"item.templateRef()\" />\n }\n </dl>`,\n hostDirectives: [NgClass],\n host: {\n '[style.--watt-description-list-groups-per-row]': 'groupsPerRow()',\n '[class]': 'descriptionVariant()',\n },\n})\nclass WattDescriptionListComponent<T> {\n private ngClass = inject(NgClass);\n descriptionItems = contentChildren(WattDescriptionListItemComponent<T>);\n variant = input<'flow' | 'stack' | 'compact'>('flow');\n descriptionVariant = computed(() => `watt-description-list-${this.variant()}`);\n groupsPerRow = input<number>(3);\n itemSeparators = input(true);\n\n constructor() {\n effect(() => {\n this.ngClass.ngClass = {\n [`item-separators`]: this.itemSeparators(),\n };\n });\n }\n}\n\nexport { WattDescriptionListItemComponent, WattDescriptionListComponent };\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport {\n WattDescriptionListComponent,\n WattDescriptionListItemComponent,\n} from './watt-description-list.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,gCAAgC,CAAA;AAC3C,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAA8B,aAAa,CAAC;AAC5E,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC;AACzB,IAAA,KAAK,GAAG,KAAK,CAAW,IAAI,CAAC;AAC7B,IAAA,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC;uGAJf,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gCAAgC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,WAAA,EAAA,CAAA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