@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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-icon.mjs","sources":["../../../libs/watt/package/icon/icons.ts","../../../libs/watt/package/icon/icon.component.ts","../../../libs/watt/package/icon/index.ts","../../../libs/watt/package/icon/energinet-watt-icon.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\nexport const WattIconMap = {\n search: 'search',\n filter: 'filter_list',\n plus: 'add',\n minus: 'remove',\n edit: 'edit',\n redo: 'redo',\n undo: 'undo',\n remove: 'delete',\n removeForever: 'delete_forever',\n close: 'close',\n cancel: 'cancel',\n checkmark: 'check',\n user: 'account_circle',\n settings: 'settings',\n contentCopy: 'content_copy',\n date: 'calendar_today',\n time: 'schedule',\n email: 'email',\n markEmailUnread: 'mark_email_unread',\n link: 'link',\n openInNew: 'open_in_new',\n monetization: 'monetization_on',\n payments: 'payments',\n forwardMessage: 'forward_to_inbox',\n menu: 'menu',\n moreVertical: 'more_vert',\n logout: 'logout',\n login: 'lock_open',\n help: 'help',\n alternateEmail: 'alternate_email',\n refresh: 'refresh',\n language: 'language',\n pendingActions: 'pending_actions',\n toggleOn: 'toggle_on',\n toggleOff: 'toggle_off',\n personCheck: 'person_check',\n // Navigation\n left: 'navigate_before',\n right: 'navigate_next',\n up: 'expand_less',\n down: 'expand_more',\n arrowDropDown: 'arrow_drop_down',\n arrowRightAlt: 'arrow_right_alt',\n arrowLeftAlt: 'arrow_left_alt',\n // Alerts\n danger: 'dangerous',\n warning: 'report_problem',\n success: 'check_circle',\n info: 'info',\n feedback: 'feedback',\n // Files\n save: 'save_alt',\n upload: 'cloud_upload',\n download: 'cloud_download',\n fileDownload: 'download',\n print: 'print',\n preview: 'preview',\n // Other\n power: 'power',\n location: 'location_on',\n smartDisplay: 'smart_display',\n windmill: 'energy',\n solarPower: 'solar_power',\n priorityHigh: 'priority_high',\n notifications: 'notifications',\n notificationsUnread: 'notifications_unread',\n horizontalRule: 'horizontal_rule',\n wrongLocation: 'wrong_location',\n heatPump: 'heat_pump',\n inventory: 'inventory',\n globe: 'globe',\n calculate: 'calculate',\n bar_chart_4_bars: 'bar_chart_4_bars',\n view_list: 'view_list',\n view_stream: 'view_stream',\n construction: 'construction',\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 ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\nimport { MatIcon } from '@angular/material/icon';\nimport { WattIconMap } from './icons';\n\nexport type WattIcon = keyof typeof WattIconMap;\nexport type WattIconSize = 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\nexport type WattIconState = 'default' | 'success' | 'danger' | 'warning' | 'info';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classNames()' },\n imports: [MatIcon],\n selector: 'watt-icon',\n styleUrls: ['./icon.component.scss'],\n template: `\n @if (icon()) {\n <mat-icon aria-hidden=\"false\" [attr.aria-label]=\"label()\" fontSet=\"material-symbols-sharp\">\n {{ icon() }}\n </mat-icon>\n } @else {\n <div class=\"watt-custom-icon\">\n <ng-content />\n </div>\n }\n `,\n})\nexport class WattIconComponent {\n /** Name of an icon within the font set. */\n name = input<WattIcon>();\n\n /** Accessible label for the icon. */\n label = input<string>();\n\n /** Size of the icon. */\n size = input<WattIconSize>('m');\n\n /** Color the icon to match a chosen state. */\n state = input<WattIconState>();\n\n icon = computed(() => {\n const name = this.name();\n if (!name) return null;\n return WattIconMap[name];\n });\n\n computedState = computed(() => {\n const name = this.name();\n const state = this.state();\n if (state) return state;\n switch (name) {\n case 'success':\n case 'danger':\n case 'warning':\n case 'info':\n return name;\n default:\n return 'default';\n }\n });\n\n classNames = computed(() => `icon-size-${this.size()} icon-state-${this.computedState()}`);\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 { WattIconComponent, WattIcon, WattIconSize, WattIconState } from './icon.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AAC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AAA,EACR,WAAW,EAAA,QAAA,EAEX;;;;;;;;;;AAUT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,kiEAAA,CAAA,EAAA;;;ACjDH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
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, NgModule, TemplateRef, inject } from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialog,\n MatDialogModule,\n MatDialogRef,\n} 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\n@NgModule({\n imports: [MatDialogModule],\n providers: [WattModalService],\n})\nexport class WattModalModule {}\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 EventEmitter,\n Input,\n Output,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n afterRenderEffect,\n booleanAttribute,\n inject,\n input,\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 { WattModalModule, 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-datahub/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 WattModalModule,\n WattIconComponent,\n ],\n})\nexport class WattModalComponent {\n private modalService = inject(WattModalService);\n protected dialogRef = inject<MatDialogRef<unknown>>(MatDialogRef, { optional: true });\n /** Title to stay fixed to top of modal. */\n @Input() title = '';\n\n @Input() size: WattModalSize = 'medium';\n\n /** Whether the modal should show a loading state. */\n @Input() loading = false;\n\n /** Whether the modal should show a loading text for the loading state. */\n @Input() loadingMessage = '';\n\n /** Disable ESC, close button and backdrop click as methods of closing. */\n @Input() disableClose = false;\n\n /** Whether to show the close button */\n @Input() hideCloseButton = false;\n\n /** Disable ESC, backdrop click as methods of closing. */\n @Input() disableEscAndBackdropClose = false;\n\n /** The aria-label for the close button. */\n @Input() closeLabel = 'Close';\n\n /** Classes added to the modal panel */\n @Input() panelClass: string[] = [];\n\n @Input() minHeight = '147px';\n\n /** Whether the dialog should restore focus to the previously-focused element, after it's closed. */\n @Input() restoreFocus = true;\n\n /** Icon displayed next to the modal title. */\n @Input() titleIcon?: WattIcon;\n\n /** Whether the modal should open automatically when rendered. */\n autoOpen = input(false, { transform: booleanAttribute });\n\n /**\n * When modal is closed, emits `true` if it was \"accepted\",\n * otherwise emits `false`.\n * @ignore\n */\n @Output() closed = new EventEmitter<boolean>();\n\n /** @ignore */\n @ViewChild('modal') modal!: TemplateRef<Element>;\n\n /** @ignore */\n scrollable = 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: this.closed,\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 = 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 @if (title && loading === false) {\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 <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":";;;;;;;;;;MAwCsB,cAAc,CAAA;AAC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A,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,8EAF1B,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEf,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;;AE1KxE;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, input, output, viewChild, computed, effect, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/material/paginator';
|
|
4
|
-
import { MatPaginatorIntl, MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
5
|
-
import { Subject, map, startWith } from 'rxjs';
|
|
6
|
-
import { toSignal } from '@angular/core/rxjs-interop';
|
|
7
|
-
|
|
8
|
-
//#region License
|
|
9
|
-
/**
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
12
|
-
*
|
|
13
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
14
|
-
* you may not use this file except in compliance with the License.
|
|
15
|
-
* You may obtain a copy of the License at
|
|
16
|
-
*
|
|
17
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
-
*
|
|
19
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
-
* See the License for the specific language governing permissions and
|
|
23
|
-
* limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
//#endregion
|
|
26
|
-
class WattPaginatorIntlService {
|
|
27
|
-
changes = new Subject();
|
|
28
|
-
description = 'Select page';
|
|
29
|
-
itemsPerPage = 'Results per page';
|
|
30
|
-
nextPage = 'Next page';
|
|
31
|
-
previousPage = 'Previous page';
|
|
32
|
-
firstPage = 'First page';
|
|
33
|
-
lastPage = 'Last page';
|
|
34
|
-
of = 'of';
|
|
35
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPaginatorIntlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
36
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPaginatorIntlService, providedIn: 'root' });
|
|
37
|
-
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPaginatorIntlService, decorators: [{
|
|
39
|
-
type: Injectable,
|
|
40
|
-
args: [{ providedIn: 'root' }]
|
|
41
|
-
}] });
|
|
42
|
-
|
|
43
|
-
//#region License
|
|
44
|
-
/**
|
|
45
|
-
* @license
|
|
46
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
47
|
-
*
|
|
48
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
49
|
-
* you may not use this file except in compliance with the License.
|
|
50
|
-
* You may obtain a copy of the License at
|
|
51
|
-
*
|
|
52
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
53
|
-
*
|
|
54
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
55
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
56
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
57
|
-
* See the License for the specific language governing permissions and
|
|
58
|
-
* limitations under the License.
|
|
59
|
-
*/
|
|
60
|
-
//#endregion
|
|
61
|
-
/**
|
|
62
|
-
* Usage:
|
|
63
|
-
* `import { WattPaginatorComponent } from '@energinet-datahub/watt/paginator';`
|
|
64
|
-
*/
|
|
65
|
-
class WattPaginatorComponent {
|
|
66
|
-
intl = inject(WattPaginatorIntlService);
|
|
67
|
-
matPaginatorIntl = inject(MatPaginatorIntl);
|
|
68
|
-
length = input(0);
|
|
69
|
-
pageSizeOptions = input([50, 100, 150, 200, 250]);
|
|
70
|
-
pageSize = input(50);
|
|
71
|
-
pageIndex = input(0);
|
|
72
|
-
for = input();
|
|
73
|
-
changed = output();
|
|
74
|
-
instance = viewChild.required(MatPaginator);
|
|
75
|
-
changes = toSignal(this.intl.changes.pipe(
|
|
76
|
-
// Signals use referential equality to determine if a value has changed.
|
|
77
|
-
// Therefore it is not possible to just map to the intl service directly
|
|
78
|
-
// as the intl service relies on mutation for updating values.
|
|
79
|
-
map(() => ({ ...this.intl })), startWith(this.intl)), { requireSync: true });
|
|
80
|
-
description = computed(() => this.changes().description);
|
|
81
|
-
updateDataSource = effect(() => {
|
|
82
|
-
const dataSource = this.for();
|
|
83
|
-
const instance = this.instance();
|
|
84
|
-
if (!dataSource)
|
|
85
|
-
return;
|
|
86
|
-
dataSource.paginator = instance;
|
|
87
|
-
});
|
|
88
|
-
updateLabels = effect(() => {
|
|
89
|
-
const changes = this.changes();
|
|
90
|
-
this.matPaginatorIntl.itemsPerPageLabel = changes.itemsPerPage;
|
|
91
|
-
this.matPaginatorIntl.nextPageLabel = changes.nextPage;
|
|
92
|
-
this.matPaginatorIntl.previousPageLabel = changes.previousPage;
|
|
93
|
-
this.matPaginatorIntl.firstPageLabel = changes.firstPage;
|
|
94
|
-
this.matPaginatorIntl.lastPageLabel = changes.lastPage;
|
|
95
|
-
this.matPaginatorIntl.changes.next();
|
|
96
|
-
});
|
|
97
|
-
ngOnInit() {
|
|
98
|
-
this.matPaginatorIntl.getRangeLabel = this.getRangeLabel;
|
|
99
|
-
}
|
|
100
|
-
getRangeLabel = (page, pageSize, length) => {
|
|
101
|
-
if (length == 0 || pageSize == 0) {
|
|
102
|
-
return `0 ${this.intl.of} ${length}`;
|
|
103
|
-
}
|
|
104
|
-
length = Math.max(length, 0);
|
|
105
|
-
const startIndex = page * pageSize;
|
|
106
|
-
// If the start index exceeds the list length, do not try and fix the end index to the end.
|
|
107
|
-
const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
|
|
108
|
-
return `${startIndex + 1} – ${endIndex} ${this.intl.of} ${length}`;
|
|
109
|
-
};
|
|
110
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
111
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.1", type: WattPaginatorComponent, isStandalone: true, selector: "watt-paginator", inputs: { length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageIndex: { classPropertyName: "pageIndex", publicName: "pageIndex", isSignal: true, isRequired: false, transformFunction: null }, for: { classPropertyName: "for", publicName: "for", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, viewQueries: [{ propertyName: "instance", first: true, predicate: MatPaginator, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
112
|
-
<mat-paginator
|
|
113
|
-
class="watt-paginator"
|
|
114
|
-
(page)="changed.emit($event)"
|
|
115
|
-
[length]="length()"
|
|
116
|
-
[pageSize]="pageSize()"
|
|
117
|
-
[pageSizeOptions]="pageSizeOptions()"
|
|
118
|
-
[pageIndex]="pageIndex()"
|
|
119
|
-
[showFirstLastButtons]="true"
|
|
120
|
-
[attr.aria-label]="description()"
|
|
121
|
-
/>
|
|
122
|
-
`, isInline: true, styles: [".cdk-overlay-pane div.mat-mdc-select-panel{--mat-select-panel-background-color: white;padding:0;font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){--mat-option-selected-state-layer-color: var(--watt-color-neutral-grey-300);color:var(--watt-color-primary)}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item:hover{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator{box-shadow:0 -1px 0 var(--watt-color-neutral-grey-300);z-index:100}watt-paginator .mat-mdc-paginator,watt-paginator .mat-mdc-paginator-page-size .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-paginator .mat-mdc-paginator{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator .mat-mdc-paginator .mdc-notched-outline{--mdc-outlined-text-field-outline-width: 0;--mdc-outlined-text-field-focus-outline-width: 0}watt-paginator .mat-mdc-paginator .mat-mdc-paginator-page-size-select{width:80px}watt-paginator .mat-mdc-select-arrow-wrapper{color:var(--watt-color-primary)}watt-paginator .mat-mdc-select-arrow-wrapper .mat-mdc-select-arrow{width:18px}watt-paginator .mat-mdc-paginator-container{justify-content:center;padding:var(--watt-space-m) var(--watt-space-ml)}watt-paginator .mat-mdc-paginator-range-actions{display:contents}watt-paginator .mat-mdc-paginator-range-label{margin:0 auto;-webkit-user-select:none;user-select:none}watt-paginator .mdc-icon-button{color:var(--watt-color-primary);--mdc-icon-button-disabled-icon-color: var(--watt-color-neutral-grey-500);--mdc-icon-button-icon-size: 28px;--mdc-icon-button-state-layer-size: 28px;padding:0;margin-right:5px}watt-paginator .mat-mdc-select-value{padding-right:var(--watt-space-xs);text-align:right}watt-paginator .mat-mdc-select-arrow{color:var(--watt-color-primary)}watt-paginator .mat-mdc-form-field-flex{height:var(--watt-space-l);align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
123
|
-
}
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPaginatorComponent, decorators: [{
|
|
125
|
-
type: Component,
|
|
126
|
-
args: [{ imports: [MatPaginatorModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, selector: 'watt-paginator', template: `
|
|
127
|
-
<mat-paginator
|
|
128
|
-
class="watt-paginator"
|
|
129
|
-
(page)="changed.emit($event)"
|
|
130
|
-
[length]="length()"
|
|
131
|
-
[pageSize]="pageSize()"
|
|
132
|
-
[pageSizeOptions]="pageSizeOptions()"
|
|
133
|
-
[pageIndex]="pageIndex()"
|
|
134
|
-
[showFirstLastButtons]="true"
|
|
135
|
-
[attr.aria-label]="description()"
|
|
136
|
-
/>
|
|
137
|
-
`, styles: [".cdk-overlay-pane div.mat-mdc-select-panel{--mat-select-panel-background-color: white;padding:0;font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){--mat-option-selected-state-layer-color: var(--watt-color-neutral-grey-300);color:var(--watt-color-primary)}.mat-mdc-select-panel .mat-mdc-option.mdc-list-item:hover{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator{box-shadow:0 -1px 0 var(--watt-color-neutral-grey-300);z-index:100}watt-paginator .mat-mdc-paginator,watt-paginator .mat-mdc-paginator-page-size .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-paginator .mat-mdc-paginator{--mat-option-hover-state-layer-color: var(--watt-color-neutral-grey-100)}watt-paginator .mat-mdc-paginator .mdc-notched-outline{--mdc-outlined-text-field-outline-width: 0;--mdc-outlined-text-field-focus-outline-width: 0}watt-paginator .mat-mdc-paginator .mat-mdc-paginator-page-size-select{width:80px}watt-paginator .mat-mdc-select-arrow-wrapper{color:var(--watt-color-primary)}watt-paginator .mat-mdc-select-arrow-wrapper .mat-mdc-select-arrow{width:18px}watt-paginator .mat-mdc-paginator-container{justify-content:center;padding:var(--watt-space-m) var(--watt-space-ml)}watt-paginator .mat-mdc-paginator-range-actions{display:contents}watt-paginator .mat-mdc-paginator-range-label{margin:0 auto;-webkit-user-select:none;user-select:none}watt-paginator .mdc-icon-button{color:var(--watt-color-primary);--mdc-icon-button-disabled-icon-color: var(--watt-color-neutral-grey-500);--mdc-icon-button-icon-size: 28px;--mdc-icon-button-state-layer-size: 28px;padding:0;margin-right:5px}watt-paginator .mat-mdc-select-value{padding-right:var(--watt-space-xs);text-align:right}watt-paginator .mat-mdc-select-arrow{color:var(--watt-color-primary)}watt-paginator .mat-mdc-form-field-flex{height:var(--watt-space-l);align-items:center}\n"] }]
|
|
138
|
-
}] });
|
|
139
|
-
|
|
140
|
-
//#region License
|
|
141
|
-
/**
|
|
142
|
-
* @license
|
|
143
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
144
|
-
*
|
|
145
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
146
|
-
* you may not use this file except in compliance with the License.
|
|
147
|
-
* You may obtain a copy of the License at
|
|
148
|
-
*
|
|
149
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
150
|
-
*
|
|
151
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
152
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
153
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
154
|
-
* See the License for the specific language governing permissions and
|
|
155
|
-
* limitations under the License.
|
|
156
|
-
*/
|
|
157
|
-
//#endregion
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Generated bundle index. Do not edit.
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
export { WattPaginatorComponent, WattPaginatorIntlService };
|
|
164
|
-
//# sourceMappingURL=energinet-watt-paginator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-paginator.mjs","sources":["../../../libs/watt/package/paginator/watt-paginator-intl.service.ts","../../../libs/watt/package/paginator/watt-paginator.component.ts","../../../libs/watt/package/paginator/index.ts","../../../libs/watt/package/paginator/energinet-watt-paginator.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 WattPaginatorIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n description = 'Select page';\n itemsPerPage = 'Results per page';\n nextPage = 'Next page';\n previousPage = 'Previous page';\n firstPage = 'First page';\n lastPage = 'Last page';\n of = 'of';\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 inject,\n OnInit,\n ViewEncapsulation,\n viewChild,\n input,\n effect,\n output,\n computed,\n} from '@angular/core';\nimport {\n MatPaginator,\n MatPaginatorIntl,\n MatPaginatorModule,\n PageEvent,\n} from '@angular/material/paginator';\n\nimport { IWattTableDataSource } from '@energinet/watt/table';\nimport { WattPaginatorIntlService } from './watt-paginator-intl.service';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { map, startWith } from 'rxjs';\n\n/**\n * Usage:\n * `import { WattPaginatorComponent } from '@energinet-datahub/watt/paginator';`\n */\n@Component({\n imports: [MatPaginatorModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-paginator',\n styleUrls: ['./watt-paginator.component.scss'],\n template: `\n <mat-paginator\n class=\"watt-paginator\"\n (page)=\"changed.emit($event)\"\n [length]=\"length()\"\n [pageSize]=\"pageSize()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [pageIndex]=\"pageIndex()\"\n [showFirstLastButtons]=\"true\"\n [attr.aria-label]=\"description()\"\n />\n `,\n})\nexport class WattPaginatorComponent<T> implements OnInit {\n private intl = inject(WattPaginatorIntlService);\n private matPaginatorIntl = inject(MatPaginatorIntl);\n\n length = input(0);\n pageSizeOptions = input([50, 100, 150, 200, 250]);\n pageSize = input(50);\n pageIndex = input(0);\n for = input<IWattTableDataSource<T>>();\n changed = output<PageEvent>();\n instance = viewChild.required(MatPaginator);\n\n changes = toSignal(\n this.intl.changes.pipe(\n // Signals use referential equality to determine if a value has changed.\n // Therefore it is not possible to just map to the intl service directly\n // as the intl service relies on mutation for updating values.\n map(() => ({ ...this.intl })),\n startWith(this.intl)\n ),\n { requireSync: true }\n );\n\n description = computed(() => this.changes().description);\n\n updateDataSource = effect(() => {\n const dataSource = this.for();\n const instance = this.instance();\n if (!dataSource) return;\n dataSource.paginator = instance;\n });\n\n updateLabels = effect(() => {\n const changes = this.changes();\n this.matPaginatorIntl.itemsPerPageLabel = changes.itemsPerPage;\n this.matPaginatorIntl.nextPageLabel = changes.nextPage;\n this.matPaginatorIntl.previousPageLabel = changes.previousPage;\n this.matPaginatorIntl.firstPageLabel = changes.firstPage;\n this.matPaginatorIntl.lastPageLabel = changes.lastPage;\n this.matPaginatorIntl.changes.next();\n });\n\n ngOnInit() {\n this.matPaginatorIntl.getRangeLabel = this.getRangeLabel;\n }\n\n private getRangeLabel = (page: number, pageSize: number, length: number) => {\n if (length == 0 || pageSize == 0) {\n return `0 ${this.intl.of} ${length}`;\n }\n\n length = Math.max(length, 0);\n\n const startIndex = page * pageSize;\n\n // If the start index exceeds the list length, do not try and fix the end index to the end.\n const endIndex =\n startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;\n\n return `${startIndex + 1} – ${endIndex} ${this.intl.of} ${length}`;\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 { WattPaginatorComponent } from './watt-paginator.component';\nexport { WattPaginatorIntlService } from './watt-paginator-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,wBAAwB,CAAA;AAC1B,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ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B;;;;;;;;;;;AAWT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,oiEAAA,CAAA,EAAA;;;AC/DH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, input, signal, inject, untracked, forwardRef, ViewChild, HostBinding, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/forms';
|
|
4
|
-
import { ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
-
import { MaskitoDirective } from '@maskito/angular';
|
|
6
|
-
import * as i2 from '@angular/material/select';
|
|
7
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
8
|
-
import { MASKITO_DEFAULT_OPTIONS, maskitoTransform } from '@maskito/core';
|
|
9
|
-
import { maskitoPhoneOptionsGenerator } from '@maskito/phone';
|
|
10
|
-
import { isValidPhoneNumber } from 'libphonenumber-js';
|
|
11
|
-
import phoneMetadata from 'libphonenumber-js/min/metadata';
|
|
12
|
-
import { WattFlagComponent } from '@energinet/watt/icon/flags';
|
|
13
|
-
import { WattFieldComponent, WattFieldErrorComponent } from '@energinet/watt/field';
|
|
14
|
-
import { Subject } from 'rxjs';
|
|
15
|
-
import * as i3 from '@angular/material/core';
|
|
16
|
-
|
|
17
|
-
//#region License
|
|
18
|
-
/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
21
|
-
*
|
|
22
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
23
|
-
* you may not use this file except in compliance with the License.
|
|
24
|
-
* You may obtain a copy of the License at
|
|
25
|
-
*
|
|
26
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
27
|
-
*
|
|
28
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
29
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
30
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
31
|
-
* See the License for the specific language governing permissions and
|
|
32
|
-
* limitations under the License.
|
|
33
|
-
*/
|
|
34
|
-
//#endregion
|
|
35
|
-
class WattPhoneFieldIntlService {
|
|
36
|
-
changes = new Subject();
|
|
37
|
-
invalidPhoneNumber = 'Invalid phone number';
|
|
38
|
-
DK = 'Denmark';
|
|
39
|
-
DE = 'Germany';
|
|
40
|
-
FI = 'Finland';
|
|
41
|
-
NO = 'Norway';
|
|
42
|
-
SE = 'Sweden';
|
|
43
|
-
PL = 'Poland';
|
|
44
|
-
NL = 'Netherlands';
|
|
45
|
-
CH = 'Switzerland';
|
|
46
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPhoneFieldIntlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
47
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPhoneFieldIntlService, providedIn: 'root' });
|
|
48
|
-
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPhoneFieldIntlService, decorators: [{
|
|
50
|
-
type: Injectable,
|
|
51
|
-
args: [{ providedIn: 'root' }]
|
|
52
|
-
}] });
|
|
53
|
-
|
|
54
|
-
//#region License
|
|
55
|
-
/**
|
|
56
|
-
* @license
|
|
57
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
58
|
-
*
|
|
59
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
60
|
-
* you may not use this file except in compliance with the License.
|
|
61
|
-
* You may obtain a copy of the License at
|
|
62
|
-
*
|
|
63
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
64
|
-
*
|
|
65
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
66
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
67
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
68
|
-
* See the License for the specific language governing permissions and
|
|
69
|
-
* limitations under the License.
|
|
70
|
-
*/
|
|
71
|
-
//#endregion
|
|
72
|
-
function phoneValidator(countryCode) {
|
|
73
|
-
return (control) => {
|
|
74
|
-
if (!control.value)
|
|
75
|
-
return null;
|
|
76
|
-
const valid = isValidPhoneNumber(control.value, countryCode);
|
|
77
|
-
return valid ? null : { invalidPhone: true };
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
class WattPhoneFieldComponent {
|
|
81
|
-
/** @ignore */
|
|
82
|
-
countries = [
|
|
83
|
-
{ countryIsoCode: 'DK', phoneExtension: '+45' },
|
|
84
|
-
{ countryIsoCode: 'SE', phoneExtension: '+46' },
|
|
85
|
-
{ countryIsoCode: 'NO', phoneExtension: '+47' },
|
|
86
|
-
{ countryIsoCode: 'DE', phoneExtension: '+49' },
|
|
87
|
-
{ countryIsoCode: 'FI', phoneExtension: '+358' },
|
|
88
|
-
{ countryIsoCode: 'PL', phoneExtension: '+48' },
|
|
89
|
-
{ countryIsoCode: 'NL', phoneExtension: '+31' },
|
|
90
|
-
{ countryIsoCode: 'CH', phoneExtension: '+41' },
|
|
91
|
-
];
|
|
92
|
-
formControl = input.required();
|
|
93
|
-
label = input();
|
|
94
|
-
/** @ignore */
|
|
95
|
-
chosenCountry = signal(this.countries[0]);
|
|
96
|
-
/** @ignore */
|
|
97
|
-
mask = MASKITO_DEFAULT_OPTIONS;
|
|
98
|
-
/** @ignore */
|
|
99
|
-
intl = inject(WattPhoneFieldIntlService);
|
|
100
|
-
/** @ignore */
|
|
101
|
-
isDisabled = false;
|
|
102
|
-
/** @ignore */
|
|
103
|
-
value = null;
|
|
104
|
-
/** @ignore */
|
|
105
|
-
phoneNumberInput;
|
|
106
|
-
/** @ignore */
|
|
107
|
-
ngOnInit() {
|
|
108
|
-
this.setup();
|
|
109
|
-
}
|
|
110
|
-
/** @ignore */
|
|
111
|
-
writeValue(value) {
|
|
112
|
-
if (value) {
|
|
113
|
-
const country = this.countries.find((country) => value.startsWith(country.phoneExtension));
|
|
114
|
-
if (country) {
|
|
115
|
-
// Exclude Signal from being tracked
|
|
116
|
-
// in case the parent component sets the value inside an `effect`.
|
|
117
|
-
// Without this, updating the Signal internaly triggers the parrent `effect` to re-run.
|
|
118
|
-
// Note: Revisit once v19 is released because the `effect` API has changed
|
|
119
|
-
// significantly and this might not be necessary anymore
|
|
120
|
-
untracked(() => {
|
|
121
|
-
this.setCountry(country);
|
|
122
|
-
});
|
|
123
|
-
value = maskitoTransform(value, this.mask);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
this.value = value;
|
|
127
|
-
}
|
|
128
|
-
/** @ignore */
|
|
129
|
-
onChange = () => {
|
|
130
|
-
/* noop function */
|
|
131
|
-
};
|
|
132
|
-
/** @ignore */
|
|
133
|
-
onTouched = () => {
|
|
134
|
-
/* noop function */
|
|
135
|
-
};
|
|
136
|
-
/** @ignore */
|
|
137
|
-
registerOnChange(fn) {
|
|
138
|
-
this.onChange = fn;
|
|
139
|
-
}
|
|
140
|
-
/** @ignore */
|
|
141
|
-
registerOnTouched(fn) {
|
|
142
|
-
this.onTouched = fn;
|
|
143
|
-
}
|
|
144
|
-
/** @ignore */
|
|
145
|
-
setDisabledState(isDisabled) {
|
|
146
|
-
this.isDisabled = isDisabled;
|
|
147
|
-
}
|
|
148
|
-
/** @ignore */
|
|
149
|
-
selectedContry({ value }) {
|
|
150
|
-
const country = this.countries.find((contry) => contry.countryIsoCode === value);
|
|
151
|
-
if (!country) {
|
|
152
|
-
throw new Error('Prefix not found');
|
|
153
|
-
}
|
|
154
|
-
this.setCountry(country);
|
|
155
|
-
this.formControl().reset();
|
|
156
|
-
setTimeout(() => {
|
|
157
|
-
this.phoneNumberInput.nativeElement.focus();
|
|
158
|
-
}, 100);
|
|
159
|
-
}
|
|
160
|
-
/** @ignore */
|
|
161
|
-
setCountry(country) {
|
|
162
|
-
this.chosenCountry.set(country);
|
|
163
|
-
this.setup();
|
|
164
|
-
}
|
|
165
|
-
/** @ignore */
|
|
166
|
-
onChanged(event) {
|
|
167
|
-
const value = event.target?.value;
|
|
168
|
-
this.onChange(value);
|
|
169
|
-
}
|
|
170
|
-
/** @ignore */
|
|
171
|
-
generatePhoneOptions() {
|
|
172
|
-
const phoneOptions = maskitoPhoneOptionsGenerator({
|
|
173
|
-
countryIsoCode: this.chosenCountry().countryIsoCode,
|
|
174
|
-
metadata: phoneMetadata,
|
|
175
|
-
separator: ' ',
|
|
176
|
-
});
|
|
177
|
-
this.mask = phoneOptions;
|
|
178
|
-
}
|
|
179
|
-
/** @ignore */
|
|
180
|
-
setup() {
|
|
181
|
-
this.generatePhoneOptions();
|
|
182
|
-
this.setValidator();
|
|
183
|
-
}
|
|
184
|
-
/** @ignore */
|
|
185
|
-
setValidator() {
|
|
186
|
-
const countryCode = this.chosenCountry().countryIsoCode;
|
|
187
|
-
this.formControl().addValidators(phoneValidator(countryCode));
|
|
188
|
-
}
|
|
189
|
-
/** @ignore */
|
|
190
|
-
getCountryName(countryIsoCode) {
|
|
191
|
-
return this.intl[countryIsoCode];
|
|
192
|
-
}
|
|
193
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPhoneFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
194
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattPhoneFieldComponent, isStandalone: true, selector: "watt-phone-field", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.watt-field-disabled": "this.isDisabled" } }, providers: [
|
|
195
|
-
{
|
|
196
|
-
provide: NG_VALUE_ACCESSOR,
|
|
197
|
-
useExisting: forwardRef(() => WattPhoneFieldComponent),
|
|
198
|
-
multi: true,
|
|
199
|
-
},
|
|
200
|
-
], viewQueries: [{ propertyName: "phoneNumberInput", first: true, predicate: ["phoneNumberInput"], descendants: true }], ngImport: i0, template: `
|
|
201
|
-
<watt-field [label]="label()" [control]="formControl()">
|
|
202
|
-
<div class="watt-phone-field__prefix-container">
|
|
203
|
-
<mat-select
|
|
204
|
-
panelWidth=""
|
|
205
|
-
panelClass="watt-phone-field__select"
|
|
206
|
-
[hideSingleSelectionIndicator]="true"
|
|
207
|
-
[value]="chosenCountry().countryIsoCode"
|
|
208
|
-
(selectionChange)="selectedContry($event)"
|
|
209
|
-
>
|
|
210
|
-
<mat-select-trigger>
|
|
211
|
-
<watt-flag [country]="chosenCountry().countryIsoCode" />
|
|
212
|
-
</mat-select-trigger>
|
|
213
|
-
@for (contry of countries; track contry; let index = $index) {
|
|
214
|
-
<mat-option value="{{ contry.countryIsoCode }}">
|
|
215
|
-
<watt-flag [country]="contry.countryIsoCode" />
|
|
216
|
-
<div>{{ getCountryName(contry.countryIsoCode) }}</div>
|
|
217
|
-
</mat-option>
|
|
218
|
-
}
|
|
219
|
-
</mat-select>
|
|
220
|
-
<input
|
|
221
|
-
[attr.aria-label]="label()"
|
|
222
|
-
autocomplete="tel"
|
|
223
|
-
inputmode="tel"
|
|
224
|
-
[value]="value"
|
|
225
|
-
[formControl]="formControl()"
|
|
226
|
-
(blur)="onTouched()"
|
|
227
|
-
(input)="onChanged($event)"
|
|
228
|
-
[maskito]="mask"
|
|
229
|
-
#phoneNumberInput
|
|
230
|
-
/>
|
|
231
|
-
</div>
|
|
232
|
-
<ng-content ngProjectAs="watt-field-hint" select="watt-field-hint" />
|
|
233
|
-
<ng-content ngProjectAs="watt-field-error" select="watt-field-error" />
|
|
234
|
-
@if (formControl().hasError('invalidPhone')) {
|
|
235
|
-
<watt-field-error> {{ intl.invalidPhoneNumber }} </watt-field-error>
|
|
236
|
-
}
|
|
237
|
-
</watt-field>
|
|
238
|
-
`, isInline: true, styles: [".watt-phone-field__select.mat-mdc-select-panel{--mat-option-label-text-size: 14px;overflow-y:scroll}.watt-phone-field__select.mat-mdc-select-panel watt-icon{margin-right:var(--watt-space-s)}.watt-phone-field__select.mat-mdc-select-panel watt-icon .mat-icon{margin-right:0}.watt-phone-field__select.mat-mdc-select-panel .mat-mdc-option.mdc-list-item .mdc-list-item__primary-text{display:flex;width:100%;align-items:center;gap:var(--watt-space-xs)}watt-phone-field{display:block}watt-phone-field .watt-phone-field__prefix-container{width:100%;display:flex;align-items:center;gap:var(--watt-space-xs)}watt-phone-field input{width:100%;border:none}watt-phone-field input:focus-visible,watt-phone-field input:focus-within{border:none;outline:none}watt-phone-field .mat-mdc-select{width:auto;height:24px}watt-phone-field .mat-mdc-select .mat-mdc-select-arrow-wrapper{width:24px;justify-content:center}\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: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i2.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName"] }, { kind: "component", type: WattFieldErrorComponent, selector: "watt-field-error" }, { kind: "component", type: WattFlagComponent, selector: "watt-flag", inputs: ["country", "label", "size"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
239
|
-
}
|
|
240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattPhoneFieldComponent, decorators: [{
|
|
241
|
-
type: Component,
|
|
242
|
-
args: [{ selector: 'watt-phone-field', encapsulation: ViewEncapsulation.None, imports: [
|
|
243
|
-
ReactiveFormsModule,
|
|
244
|
-
MatSelectModule,
|
|
245
|
-
MaskitoDirective,
|
|
246
|
-
WattFieldComponent,
|
|
247
|
-
WattFieldErrorComponent,
|
|
248
|
-
WattFlagComponent,
|
|
249
|
-
], providers: [
|
|
250
|
-
{
|
|
251
|
-
provide: NG_VALUE_ACCESSOR,
|
|
252
|
-
useExisting: forwardRef(() => WattPhoneFieldComponent),
|
|
253
|
-
multi: true,
|
|
254
|
-
},
|
|
255
|
-
], template: `
|
|
256
|
-
<watt-field [label]="label()" [control]="formControl()">
|
|
257
|
-
<div class="watt-phone-field__prefix-container">
|
|
258
|
-
<mat-select
|
|
259
|
-
panelWidth=""
|
|
260
|
-
panelClass="watt-phone-field__select"
|
|
261
|
-
[hideSingleSelectionIndicator]="true"
|
|
262
|
-
[value]="chosenCountry().countryIsoCode"
|
|
263
|
-
(selectionChange)="selectedContry($event)"
|
|
264
|
-
>
|
|
265
|
-
<mat-select-trigger>
|
|
266
|
-
<watt-flag [country]="chosenCountry().countryIsoCode" />
|
|
267
|
-
</mat-select-trigger>
|
|
268
|
-
@for (contry of countries; track contry; let index = $index) {
|
|
269
|
-
<mat-option value="{{ contry.countryIsoCode }}">
|
|
270
|
-
<watt-flag [country]="contry.countryIsoCode" />
|
|
271
|
-
<div>{{ getCountryName(contry.countryIsoCode) }}</div>
|
|
272
|
-
</mat-option>
|
|
273
|
-
}
|
|
274
|
-
</mat-select>
|
|
275
|
-
<input
|
|
276
|
-
[attr.aria-label]="label()"
|
|
277
|
-
autocomplete="tel"
|
|
278
|
-
inputmode="tel"
|
|
279
|
-
[value]="value"
|
|
280
|
-
[formControl]="formControl()"
|
|
281
|
-
(blur)="onTouched()"
|
|
282
|
-
(input)="onChanged($event)"
|
|
283
|
-
[maskito]="mask"
|
|
284
|
-
#phoneNumberInput
|
|
285
|
-
/>
|
|
286
|
-
</div>
|
|
287
|
-
<ng-content ngProjectAs="watt-field-hint" select="watt-field-hint" />
|
|
288
|
-
<ng-content ngProjectAs="watt-field-error" select="watt-field-error" />
|
|
289
|
-
@if (formControl().hasError('invalidPhone')) {
|
|
290
|
-
<watt-field-error> {{ intl.invalidPhoneNumber }} </watt-field-error>
|
|
291
|
-
}
|
|
292
|
-
</watt-field>
|
|
293
|
-
`, styles: [".watt-phone-field__select.mat-mdc-select-panel{--mat-option-label-text-size: 14px;overflow-y:scroll}.watt-phone-field__select.mat-mdc-select-panel watt-icon{margin-right:var(--watt-space-s)}.watt-phone-field__select.mat-mdc-select-panel watt-icon .mat-icon{margin-right:0}.watt-phone-field__select.mat-mdc-select-panel .mat-mdc-option.mdc-list-item .mdc-list-item__primary-text{display:flex;width:100%;align-items:center;gap:var(--watt-space-xs)}watt-phone-field{display:block}watt-phone-field .watt-phone-field__prefix-container{width:100%;display:flex;align-items:center;gap:var(--watt-space-xs)}watt-phone-field input{width:100%;border:none}watt-phone-field input:focus-visible,watt-phone-field input:focus-within{border:none;outline:none}watt-phone-field .mat-mdc-select{width:auto;height:24px}watt-phone-field .mat-mdc-select .mat-mdc-select-arrow-wrapper{width:24px;justify-content:center}\n"] }]
|
|
294
|
-
}], propDecorators: { isDisabled: [{
|
|
295
|
-
type: HostBinding,
|
|
296
|
-
args: ['attr.watt-field-disabled']
|
|
297
|
-
}], phoneNumberInput: [{
|
|
298
|
-
type: ViewChild,
|
|
299
|
-
args: ['phoneNumberInput']
|
|
300
|
-
}] } });
|
|
301
|
-
|
|
302
|
-
//#region License
|
|
303
|
-
/**
|
|
304
|
-
* @license
|
|
305
|
-
* Copyright 2020 Energinet DataHub A/S
|
|
306
|
-
*
|
|
307
|
-
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
308
|
-
* you may not use this file except in compliance with the License.
|
|
309
|
-
* You may obtain a copy of the License at
|
|
310
|
-
*
|
|
311
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
312
|
-
*
|
|
313
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
314
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
315
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
316
|
-
* See the License for the specific language governing permissions and
|
|
317
|
-
* limitations under the License.
|
|
318
|
-
*/
|
|
319
|
-
//#endregion
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Generated bundle index. Do not edit.
|
|
323
|
-
*/
|
|
324
|
-
|
|
325
|
-
export { WattPhoneFieldComponent, WattPhoneFieldIntlService };
|
|
326
|
-
//# sourceMappingURL=energinet-watt-phone-field.mjs.map
|