@energinet/watt 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/badge/index.d.ts +17 -0
- package/badge/watt-badge.component.d.ts +15 -0
- package/breadcrumbs/index.d.ts +17 -0
- package/breadcrumbs/watt-breadcrumbs.component.d.ts +23 -0
- package/button/index.d.ts +17 -0
- package/button/watt-button.component.d.ts +20 -0
- package/card/index.d.ts +18 -0
- package/card/watt-card-title.component.d.ts +6 -0
- package/card/watt-card.component.d.ts +15 -0
- package/checkbox/index.d.ts +17 -0
- package/checkbox/watt-checkbox.component.d.ts +17 -0
- package/chip/index.d.ts +23 -0
- package/chip/watt-action-chip.component.d.ts +8 -0
- package/chip/watt-chip.component.d.ts +8 -0
- package/chip/watt-chip.directive.d.ts +16 -0
- package/chip/watt-date-chip.component.d.ts +29 -0
- package/chip/watt-date-range-chip.component.d.ts +50 -0
- package/chip/watt-filter-chip.component.d.ts +30 -0
- package/chip/watt-menu-chip.component.d.ts +30 -0
- package/clipboard/index.d.ts +18 -0
- package/clipboard/watt-clipboard-intl.service.d.ts +7 -0
- package/clipboard/watt-copy-to-clipboard.directive.d.ts +12 -0
- package/code/index.d.ts +18 -0
- package/code/watt-code.component.d.ts +32 -0
- package/code/watt-code.worker.token.d.ts +18 -0
- package/core/breakpoints/_breakpoints.import.scss +53 -0
- package/core/breakpoints/_include-media.scss +568 -0
- package/core/breakpoints/breakpoints-observer.d.ts +39 -0
- package/core/breakpoints/breakpoints.d.ts +29 -0
- package/core/breakpoints/index.d.ts +18 -0
- package/core/color/+storybook/storybook-colors-overview.component.scss +50 -0
- package/core/color/color-helper.service.d.ts +12 -0
- package/core/color/colors.d.ts +51 -0
- package/core/color/index.d.ts +18 -0
- package/core/date/dayjs.d.ts +22 -0
- package/core/date/index.d.ts +23 -0
- package/core/date/watt-danish-datetime.providers.d.ts +1 -0
- package/core/date/watt-date-adapter.d.ts +31 -0
- package/core/date/watt-date-range.d.ts +25 -0
- package/core/date/watt-date.pipe.d.ts +28 -0
- package/core/date/watt-format-date.d.ts +11 -0
- package/core/date/watt-locale.service.d.ts +13 -0
- package/core/styles/@energinet-datahub/watt/_index.scss +52 -0
- package/core/styles/@energinet-datahub/watt/_utils.scss +16 -0
- package/core/styles/@energinet-datahub/watt/theme/light-theme.scss +71 -0
- package/core/styles/@energinet-datahub/watt/theme/material-overwrites/datepicker.scss +69 -0
- package/core/styles/@energinet-datahub/watt/theme/material-overwrites/snack-bar.scss +26 -0
- package/core/styles/_box-sizing.scss +22 -0
- package/core/styles/_chips.scss +22 -0
- package/core/styles/_elevation.scss +18 -0
- package/core/styles/_hr.scss +20 -0
- package/core/styles/_table.scss +89 -0
- package/core/styles/_tokens.scss +134 -0
- package/core/styles/_tooltip.scss +64 -0
- package/core/styles/_variables.scss +106 -0
- package/core/styles/_vater.scss +69 -0
- package/core/styles/spacing/+storybook/storybook-spacing-overview.component.scss +25 -0
- package/core/styles/spacing/_baseline.scss +23 -0
- package/core/styles/spacing/_inline.scss +38 -0
- package/core/styles/spacing/_inset.scss +61 -0
- package/core/styles/spacing/_spacing.import.scss +113 -0
- package/core/styles/spacing/_stack.scss +38 -0
- package/core/styles/spacing/_variables.scss +14 -0
- package/core/styles/spacing/index.scss +18 -0
- package/core/styles/typography/+storybook/storybook-typography-overview.component.scss +78 -0
- package/core/styles/typography/_rem.scss +24 -0
- package/core/styles/typography/_typography.import.scss +195 -0
- package/core/styles/typography/index.scss +118 -0
- package/data/index.d.ts +20 -0
- package/data/watt-data-actions.component.d.ts +5 -0
- package/data/watt-data-filters.component.d.ts +5 -0
- package/data/watt-data-intl.service.d.ts +15 -0
- package/data/watt-data-table.component.d.ts +27 -0
- package/datetime-field/index.d.ts +17 -0
- package/datetime-field/watt-datetime-field.component.d.ts +39 -0
- package/description-list/index.d.ts +17 -0
- package/description-list/watt-description-list-item.component.d.ts +27 -0
- package/description-list/watt-description-list.component.d.ts +19 -0
- package/drawer/index.d.ts +21 -0
- package/drawer/watt-drawer-actions.component.d.ts +5 -0
- package/drawer/watt-drawer-content.component.d.ts +5 -0
- package/drawer/watt-drawer-heading.component.d.ts +5 -0
- package/drawer/watt-drawer-topbar.component.d.ts +5 -0
- package/drawer/watt-drawer.component.d.ts +61 -0
- package/dropdown/index.d.ts +19 -0
- package/dropdown/watt-dropdown-option.d.ts +22 -0
- package/dropdown/watt-dropdown-value.d.ts +17 -0
- package/dropdown/watt-dropdown.component.d.ts +195 -0
- package/empty-state/icons/explore.d.ts +5 -0
- package/empty-state/icons/no-results.d.ts +5 -0
- package/empty-state/icons/power.d.ts +5 -0
- package/empty-state/index.d.ts +20 -0
- package/empty-state/watt-empty-state.component.d.ts +16 -0
- package/expandable-card/index.d.ts +19 -0
- package/expandable-card/watt-expandable-card.component.d.ts +34 -0
- package/expansion/expansion.component.d.ts +18 -0
- package/expansion/index.d.ts +17 -0
- package/fesm2022/energinet-watt-badge.mjs +66 -0
- package/fesm2022/energinet-watt-badge.mjs.map +1 -0
- package/fesm2022/energinet-watt-breadcrumbs.mjs +116 -0
- package/fesm2022/energinet-watt-breadcrumbs.mjs.map +1 -0
- package/fesm2022/energinet-watt-button.mjs +120 -0
- package/fesm2022/energinet-watt-button.mjs.map +1 -0
- package/fesm2022/energinet-watt-card.mjs +117 -0
- package/fesm2022/energinet-watt-card.mjs.map +1 -0
- package/fesm2022/energinet-watt-checkbox.mjs +118 -0
- package/fesm2022/energinet-watt-checkbox.mjs.map +1 -0
- package/fesm2022/energinet-watt-chip.mjs +760 -0
- package/fesm2022/energinet-watt-chip.mjs.map +1 -0
- package/fesm2022/energinet-watt-clipboard.mjs +118 -0
- package/fesm2022/energinet-watt-clipboard.mjs.map +1 -0
- package/fesm2022/energinet-watt-code.mjs +119 -0
- package/fesm2022/energinet-watt-code.mjs.map +1 -0
- package/fesm2022/energinet-watt-core-breakpoints.mjs +100 -0
- package/fesm2022/energinet-watt-core-breakpoints.mjs.map +1 -0
- package/fesm2022/energinet-watt-core-color.mjs +127 -0
- package/fesm2022/energinet-watt-core-color.mjs.map +1 -0
- package/fesm2022/energinet-watt-core-date.mjs +260 -0
- package/fesm2022/energinet-watt-core-date.mjs.map +1 -0
- package/fesm2022/energinet-watt-data.mjs +286 -0
- package/fesm2022/energinet-watt-data.mjs.map +1 -0
- package/fesm2022/energinet-watt-datetime-field.mjs +233 -0
- package/fesm2022/energinet-watt-datetime-field.mjs.map +1 -0
- package/fesm2022/energinet-watt-description-list.mjs +130 -0
- package/fesm2022/energinet-watt-description-list.mjs.map +1 -0
- package/fesm2022/energinet-watt-drawer.mjs +271 -0
- package/fesm2022/energinet-watt-drawer.mjs.map +1 -0
- package/fesm2022/energinet-watt-dropdown.mjs +423 -0
- package/fesm2022/energinet-watt-dropdown.mjs.map +1 -0
- package/fesm2022/energinet-watt-empty-state.mjs +299 -0
- package/fesm2022/energinet-watt-empty-state.mjs.map +1 -0
- package/fesm2022/energinet-watt-expandable-card.mjs +151 -0
- package/fesm2022/energinet-watt-expandable-card.mjs.map +1 -0
- package/fesm2022/energinet-watt-expansion.mjs +78 -0
- package/fesm2022/energinet-watt-expansion.mjs.map +1 -0
- package/fesm2022/energinet-watt-field.mjs +249 -0
- package/fesm2022/energinet-watt-field.mjs.map +1 -0
- package/fesm2022/energinet-watt-icon-flags.mjs +376 -0
- package/fesm2022/energinet-watt-icon-flags.mjs.map +1 -0
- package/fesm2022/energinet-watt-icon.mjs +195 -0
- package/fesm2022/energinet-watt-icon.mjs.map +1 -0
- package/fesm2022/energinet-watt-modal.mjs +260 -0
- package/fesm2022/energinet-watt-modal.mjs.map +1 -0
- package/fesm2022/energinet-watt-paginator.mjs +164 -0
- package/fesm2022/energinet-watt-paginator.mjs.map +1 -0
- package/fesm2022/energinet-watt-phone-field.mjs +322 -0
- package/fesm2022/energinet-watt-phone-field.mjs.map +1 -0
- package/fesm2022/energinet-watt-picker-__shared.mjs +384 -0
- package/fesm2022/energinet-watt-picker-__shared.mjs.map +1 -0
- package/fesm2022/energinet-watt-picker-datepicker.mjs +430 -0
- package/fesm2022/energinet-watt-picker-datepicker.mjs.map +1 -0
- package/fesm2022/energinet-watt-picker-timepicker.mjs +394 -0
- package/fesm2022/energinet-watt-picker-timepicker.mjs.map +1 -0
- package/fesm2022/energinet-watt-progress-tracker.mjs +141 -0
- package/fesm2022/energinet-watt-progress-tracker.mjs.map +1 -0
- package/fesm2022/energinet-watt-query-params.mjs +95 -0
- package/fesm2022/energinet-watt-query-params.mjs.map +1 -0
- package/fesm2022/energinet-watt-radio.mjs +125 -0
- package/fesm2022/energinet-watt-radio.mjs.map +1 -0
- package/fesm2022/energinet-watt-search.mjs +126 -0
- package/fesm2022/energinet-watt-search.mjs.map +1 -0
- package/fesm2022/energinet-watt-shell.mjs +315 -0
- package/fesm2022/energinet-watt-shell.mjs.map +1 -0
- package/fesm2022/energinet-watt-slider.mjs +159 -0
- package/fesm2022/energinet-watt-slider.mjs.map +1 -0
- package/fesm2022/energinet-watt-spinner.mjs +72 -0
- package/fesm2022/energinet-watt-spinner.mjs.map +1 -0
- package/fesm2022/energinet-watt-stepper.mjs +185 -0
- package/fesm2022/energinet-watt-stepper.mjs.map +1 -0
- package/fesm2022/energinet-watt-table.mjs +423 -0
- package/fesm2022/energinet-watt-table.mjs.map +1 -0
- package/fesm2022/energinet-watt-tabs.mjs +254 -0
- package/fesm2022/energinet-watt-tabs.mjs.map +1 -0
- package/fesm2022/energinet-watt-text-field.mjs +316 -0
- package/fesm2022/energinet-watt-text-field.mjs.map +1 -0
- package/fesm2022/energinet-watt-textarea-field.mjs +136 -0
- package/fesm2022/energinet-watt-textarea-field.mjs.map +1 -0
- package/fesm2022/energinet-watt-toast.mjs +174 -0
- package/fesm2022/energinet-watt-toast.mjs.map +1 -0
- package/fesm2022/energinet-watt-tooltip.mjs +214 -0
- package/fesm2022/energinet-watt-tooltip.mjs.map +1 -0
- package/fesm2022/energinet-watt-utils-css.mjs +72 -0
- package/fesm2022/energinet-watt-utils-css.mjs.map +1 -0
- package/fesm2022/energinet-watt-utils-intersection-observer.mjs +83 -0
- package/fesm2022/energinet-watt-utils-intersection-observer.mjs.map +1 -0
- package/fesm2022/energinet-watt-utils-resize-observer.mjs +144 -0
- package/fesm2022/energinet-watt-utils-resize-observer.mjs.map +1 -0
- package/fesm2022/energinet-watt-validation-message.mjs +114 -0
- package/fesm2022/energinet-watt-validation-message.mjs.map +1 -0
- package/fesm2022/energinet-watt-validators.mjs +40 -0
- package/fesm2022/energinet-watt-validators.mjs.map +1 -0
- package/fesm2022/energinet-watt-vater.mjs +287 -0
- package/fesm2022/energinet-watt-vater.mjs.map +1 -0
- package/fesm2022/energinet-watt.mjs +47 -0
- package/fesm2022/energinet-watt.mjs.map +1 -0
- package/field/index.d.ts +20 -0
- package/field/watt-field-error.component.d.ts +5 -0
- package/field/watt-field-hint.component.d.ts +5 -0
- package/field/watt-field-intl.service.d.ts +8 -0
- package/field/watt-field.component.d.ts +42 -0
- package/icon/flags/index.d.ts +23 -0
- package/icon/flags/watt-flag-de.d.ts +5 -0
- package/icon/flags/watt-flag-dk.d.ts +5 -0
- package/icon/flags/watt-flag-fi.d.ts +5 -0
- package/icon/flags/watt-flag-no.d.ts +5 -0
- package/icon/flags/watt-flag-pl.d.ts +5 -0
- package/icon/flags/watt-flag-se.d.ts +5 -0
- package/icon/flags/watt-flag.d.ts +13 -0
- package/icon/icon.component.d.ts +20 -0
- package/icon/icons.d.ts +82 -0
- package/icon/index.d.ts +17 -0
- package/index.d.ts +33 -0
- package/modal/index.d.ts +18 -0
- package/modal/watt-modal.component.d.ts +86 -0
- package/modal/watt-modal.service.d.ts +62 -0
- package/package.json +237 -0
- package/paginator/index.d.ts +18 -0
- package/paginator/watt-paginator-intl.service.d.ts +14 -0
- package/paginator/watt-paginator.component.d.ts +53 -0
- package/phone-field/index.d.ts +18 -0
- package/phone-field/watt-phone-field-intl.service.d.ts +14 -0
- package/phone-field/watt-phone-field.component.d.ts +75 -0
- package/picker/__shared/index.d.ts +19 -0
- package/picker/__shared/placeholder-mask/watt-placeholder-mask.component.d.ts +34 -0
- package/picker/__shared/watt-picker-base.d.ts +201 -0
- package/picker/__shared/watt-picker-value.d.ts +18 -0
- package/picker/datepicker/index.d.ts +19 -0
- package/picker/datepicker/watt-datepicker-intl.service.d.ts +7 -0
- package/picker/datepicker/watt-datepicker.component.d.ts +149 -0
- package/picker/timepicker/index.d.ts +17 -0
- package/picker/timepicker/maskito-time-range-mask.d.ts +18 -0
- package/picker/timepicker/watt-timepicker.component.d.ts +132 -0
- package/progress-tracker/index.d.ts +20 -0
- package/progress-tracker/watt-progress-tracker-step.component.d.ts +10 -0
- package/progress-tracker/watt-progress-tracker.component.d.ts +5 -0
- package/query-params/index.d.ts +17 -0
- package/query-params/watt-query-params.directive.d.ts +27 -0
- package/radio/index.d.ts +17 -0
- package/radio/watt-radio.component.d.ts +24 -0
- package/search/index.d.ts +17 -0
- package/search/watt-search.component.d.ts +31 -0
- package/shell/index.d.ts +18 -0
- package/shell/nav-list/index.d.ts +18 -0
- package/shell/nav-list/watt-expand-on-active-link.directive.d.ts +26 -0
- package/shell/nav-list/watt-nav-list-item.component.d.ts +16 -0
- package/shell/nav-list/watt-nav-list.component.d.ts +12 -0
- package/shell/shell.component.d.ts +28 -0
- package/slider/index.d.ts +17 -0
- package/slider/watt-slider.component.d.ts +57 -0
- package/spinner/index.d.ts +17 -0
- package/spinner/watt-spinner.component.d.ts +15 -0
- package/stepper/index.d.ts +18 -0
- package/stepper/watt-stepper-step.component.d.ts +34 -0
- package/stepper/watt-stepper.component.d.ts +40 -0
- package/table/index.d.ts +18 -0
- package/table/watt-table-data-source.d.ts +37 -0
- package/table/watt-table.component.d.ts +239 -0
- package/tabs/index.d.ts +26 -0
- package/tabs/watt-link-tab.component.d.ts +7 -0
- package/tabs/watt-link-tabs.component.d.ts +7 -0
- package/tabs/watt-tab.component.d.ts +26 -0
- package/tabs/watt-tabs-action.component.d.ts +5 -0
- package/tabs/watt-tabs.component.d.ts +36 -0
- package/text-field/index.d.ts +17 -0
- package/text-field/watt-text-field.component.d.ts +77 -0
- package/textarea-field/index.d.ts +17 -0
- package/textarea-field/watt-textarea-field.component.d.ts +27 -0
- package/toast/index.d.ts +19 -0
- package/toast/watt-toast.component.d.ts +47 -0
- package/toast/watt-toast.service.d.ts +13 -0
- package/tooltip/index.d.ts +17 -0
- package/tooltip/watt-tooltip.component.d.ts +47 -0
- package/tooltip/watt-tooltip.directive.d.ts +31 -0
- package/utils/css/css-custom-properties.service.d.ts +10 -0
- package/utils/css/index.d.ts +17 -0
- package/utils/intersection-observer/index.d.ts +17 -0
- package/utils/intersection-observer/watt-intersection-observer.service.d.ts +21 -0
- package/utils/resize-observer/index.d.ts +18 -0
- package/utils/resize-observer/watt-resize-observer.directive.d.ts +35 -0
- package/utils/resize-observer/watt-resize-observer.service.d.ts +39 -0
- package/validation-message/index.d.ts +17 -0
- package/validation-message/watt-validation-message.component.d.ts +50 -0
- package/validators/index.d.ts +17 -0
- package/validators/watt-range.validators.d.ts +23 -0
- package/vater/index.d.ts +20 -0
- package/vater/types.d.ts +21 -0
- package/vater/vater-flex.component.d.ts +19 -0
- package/vater/vater-spacer.component.d.ts +5 -0
- package/vater/vater-stack.component.d.ts +14 -0
- package/vater/vater-utility.directive.d.ts +16 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"energinet-watt-progress-tracker.mjs","sources":["../../../libs/watt/package/progress-tracker/watt-progress-tracker.component.ts","../../../libs/watt/package/progress-tracker/watt-progress-tracker-step.component.ts","../../../libs/watt/package/progress-tracker/index.ts","../../../libs/watt/package/progress-tracker/energinet-watt-progress-tracker.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\nimport { VaterStackComponent } from '@energinet/watt/vater';\n\n@Component({\n imports: [VaterStackComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-progress-tracker',\n styles: [\n `\n watt-progress-tracker {\n display: block;\n }\n `,\n ],\n template: `<vater-stack direction=\"row\"><ng-content /></vater-stack>`,\n})\nexport class WattProgressTrackerComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\n\n@Component({\n imports: [WattIconComponent, WattSpinnerComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-progress-tracker-step',\n host: {\n '[attr.role]': 'current() ? \"status\" : \"presentation\"',\n '[attr.class]': 'class()',\n '[attr.aria-current]': 'ariaCurrent()',\n '[attr.aria-label]': 'label()',\n },\n styleUrl: './watt-progress-tracker-step.component.scss',\n template: `\n <div class=\"watt-progress-tracker-step-icon\">\n @switch (status()) {\n @case ('running') {\n <watt-spinner [diameter]=\"26\" [strokeWidth]=\"2\" />\n }\n @case ('skipped') {\n <watt-icon name=\"horizontalRule\" size=\"xs\" />\n }\n @case ('canceled') {\n <watt-icon name=\"close\" size=\"xs\" />\n }\n @case ('failed') {\n <watt-icon name=\"priorityHigh\" size=\"xs\" />\n }\n @case ('succeeded') {\n <watt-icon name=\"checkmark\" size=\"xs\" />\n }\n }\n </div>\n <div class=\"watt-progress-tracker-step-text\"><ng-content /></div>\n `,\n})\nexport class WattProgressTrackerStepComponent {\n status = input.required<\n 'pending' | 'running' | 'skipped' | 'canceled' | 'failed' | 'succeeded'\n >();\n label = input<string>();\n current = input(false);\n ariaCurrent = computed(() => (this.current() ? 'step' : false));\n class = computed(() => `watt-progress-tracker-step-${this.status()}`);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { WattProgressTrackerComponent } from './watt-progress-tracker.component';\nimport { WattProgressTrackerStepComponent } from './watt-progress-tracker-step.component';\n\nexport { WattProgressTrackerComponent } from './watt-progress-tracker.component';\nexport { WattProgressTrackerStepComponent } from './watt-progress-tracker-step.component';\n\nexport const WATT_PROGRESS_TRACKER = [\n WattProgressTrackerComponent,\n WattProgressTrackerStepComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAkBa,4BAA4B,CAAA;uGAA5B,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA5B,4B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A,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAkCtC,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAnC5C,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,mBACjC,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAC3B,4BAA4B,EAChC,IAAA,EAAA;AACJ,wBAAA,aAAa,EAAE,uCAAuC;AACtD,wBAAA,cAAc,EAAE,SAAS;AACzB,wBAAA,qBAAqB,EAAE,eAAe;AACtC,wBAAA,mBAAmB,EAAE,SAAS;qBAC/B,EAES,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;AAqBT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,0yFAAA,CAAA,EAAA;;;AC7DH;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAOa,MAAA,qBAAqB,GAAG;IACnC,4BAA4B;IAC5B,gCAAgC;;;AC1BlC;;AAEG;;;;"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, DestroyRef, Directive } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { FormGroupDirective } from '@angular/forms';
|
|
5
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
6
|
+
import qs from 'qs';
|
|
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
|
+
const filtersKey = 'filters';
|
|
27
|
+
class WattQueryParamsDirective {
|
|
28
|
+
formGroup = inject(FormGroupDirective);
|
|
29
|
+
destoryRef = inject(DestroyRef);
|
|
30
|
+
router = inject(Router);
|
|
31
|
+
route = inject(ActivatedRoute);
|
|
32
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
33
|
+
ngOnInit() {
|
|
34
|
+
this.formGroup.valueChanges
|
|
35
|
+
?.pipe(takeUntilDestroyed(this.destoryRef))
|
|
36
|
+
.subscribe((formValues) => {
|
|
37
|
+
const formValuesClone = structuredClone(formValues);
|
|
38
|
+
for (const key in formValuesClone) {
|
|
39
|
+
if (formValuesClone[key] === null || formValuesClone[key] === undefined) {
|
|
40
|
+
delete formValuesClone[key];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const hasSetProperties = Object.keys(formValuesClone).length > 0;
|
|
44
|
+
this.router.navigate([], {
|
|
45
|
+
replaceUrl: true,
|
|
46
|
+
relativeTo: this.route,
|
|
47
|
+
queryParams: { [filtersKey]: hasSetProperties ? qs.stringify(formValuesClone) : null },
|
|
48
|
+
queryParamsHandling: 'merge',
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
if (Object.keys(this.route.snapshot.queryParams).length > 0) {
|
|
52
|
+
const value = qs.parse(this.route.snapshot.queryParams[filtersKey] ?? '', {
|
|
53
|
+
// Needed because `qs` library has a default value of 20 elements
|
|
54
|
+
// after which arrays are parsed as objects
|
|
55
|
+
// See https://github.com/ljharb/qs?tab=readme-ov-file#parsing-arrays
|
|
56
|
+
arrayLimit: 200,
|
|
57
|
+
});
|
|
58
|
+
this.formGroup.control.patchValue(value);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattQueryParamsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
62
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: WattQueryParamsDirective, isStandalone: true, selector: "[formGroup][wattQueryParams]", ngImport: i0 });
|
|
63
|
+
}
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattQueryParamsDirective, decorators: [{
|
|
65
|
+
type: Directive,
|
|
66
|
+
args: [{
|
|
67
|
+
selector: '[formGroup][wattQueryParams]',
|
|
68
|
+
}]
|
|
69
|
+
}] });
|
|
70
|
+
|
|
71
|
+
//#region License
|
|
72
|
+
/**
|
|
73
|
+
* @license
|
|
74
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
75
|
+
*
|
|
76
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
77
|
+
* you may not use this file except in compliance with the License.
|
|
78
|
+
* You may obtain a copy of the License at
|
|
79
|
+
*
|
|
80
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
81
|
+
*
|
|
82
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
83
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
84
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
85
|
+
* See the License for the specific language governing permissions and
|
|
86
|
+
* limitations under the License.
|
|
87
|
+
*/
|
|
88
|
+
//#endregion
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Generated bundle index. Do not edit.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
export { WattQueryParamsDirective };
|
|
95
|
+
//# sourceMappingURL=energinet-watt-query-params.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"energinet-watt-query-params.mjs","sources":["../../../libs/watt/package/query-params/watt-query-params.directive.ts","../../../libs/watt/package/query-params/index.ts","../../../libs/watt/package/query-params/energinet-watt-query-params.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 { DestroyRef, Directive, OnInit, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormGroupDirective } from '@angular/forms';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport qs from 'qs';\n\nconst filtersKey = 'filters';\n\n@Directive({\n selector: '[formGroup][wattQueryParams]',\n})\nexport class WattQueryParamsDirective implements OnInit {\n private formGroup = inject(FormGroupDirective);\n private destoryRef = inject(DestroyRef);\n private router = inject(Router);\n private route = inject(ActivatedRoute);\n\n // eslint-disable-next-line sonarjs/cognitive-complexity\n ngOnInit(): void {\n this.formGroup.valueChanges\n ?.pipe(takeUntilDestroyed(this.destoryRef))\n .subscribe((formValues) => {\n const formValuesClone = structuredClone(formValues);\n\n for (const key in formValuesClone) {\n if (formValuesClone[key] === null || formValuesClone[key] === undefined) {\n delete formValuesClone[key];\n }\n }\n\n const hasSetProperties = Object.keys(formValuesClone).length > 0;\n\n this.router.navigate([], {\n replaceUrl: true,\n relativeTo: this.route,\n queryParams: { [filtersKey]: hasSetProperties ? qs.stringify(formValuesClone) : null },\n queryParamsHandling: 'merge',\n });\n });\n\n if (Object.keys(this.route.snapshot.queryParams).length > 0) {\n const value = qs.parse(this.route.snapshot.queryParams[filtersKey] ?? '', {\n // Needed because `qs` library has a default value of 20 elements\n // after which arrays are parsed as objects\n // See https://github.com/ljharb/qs?tab=readme-ov-file#parsing-arrays\n arrayLimit: 200,\n });\n\n this.formGroup.control.patchValue(value);\n }\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattQueryParamsDirective } from './watt-query-params.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAOA,MAAM,UAAU,GAAG,SAAS;MAKf,wBAAwB,CAAA;AAC3B,IAAA,SAAS,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACtC,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;;IAGtC,QAAQ,GAAA;QACN,IAAI,CAAC,SAAS,CAAC;cACX,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC;AACzC,aAAA,SAAS,CAAC,CAAC,UAAU,KAAI;AACxB,YAAA,MAAM,eAAe,GAAG,eAAe,CAAC,UAAU,CAAC;AAEnD,YAAA,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE;AACjC,gBAAA,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;AACvE,oBAAA,OAAO,eAAe,CAAC,GAAG,CAAC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import * as i0 from '@angular/core';
|
|
2
|
+
import { input, forwardRef, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
|
|
6
|
+
//#region License
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
//#endregion
|
|
24
|
+
class WattRadioComponent {
|
|
25
|
+
group = input.required();
|
|
26
|
+
value = input.required();
|
|
27
|
+
/** @ignore */
|
|
28
|
+
model;
|
|
29
|
+
/** @ignore */
|
|
30
|
+
isDisabled = false;
|
|
31
|
+
/** @ignore */
|
|
32
|
+
onChange = () => {
|
|
33
|
+
/* left blank intentionally */
|
|
34
|
+
};
|
|
35
|
+
/** @ignore */
|
|
36
|
+
onTouched = () => {
|
|
37
|
+
/* left blank intentionally */
|
|
38
|
+
};
|
|
39
|
+
/** @ignore */
|
|
40
|
+
writeValue(value) {
|
|
41
|
+
this.model = value;
|
|
42
|
+
}
|
|
43
|
+
/** @ignore */
|
|
44
|
+
registerOnChange(fn) {
|
|
45
|
+
this.onChange = fn;
|
|
46
|
+
}
|
|
47
|
+
/** @ignore */
|
|
48
|
+
registerOnTouched(fn) {
|
|
49
|
+
this.onTouched = fn;
|
|
50
|
+
}
|
|
51
|
+
/** @ignore */
|
|
52
|
+
setDisabledState(isDisabled) {
|
|
53
|
+
this.isDisabled = isDisabled;
|
|
54
|
+
}
|
|
55
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
56
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.1", type: WattRadioComponent, isStandalone: true, selector: "watt-radio", inputs: { group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.disabled": "isDisabled" } }, providers: [
|
|
57
|
+
{
|
|
58
|
+
provide: NG_VALUE_ACCESSOR,
|
|
59
|
+
useExisting: forwardRef(() => WattRadioComponent),
|
|
60
|
+
multi: true,
|
|
61
|
+
},
|
|
62
|
+
], ngImport: i0, template: `
|
|
63
|
+
<label class="watt-text-m">
|
|
64
|
+
<input
|
|
65
|
+
type="radio"
|
|
66
|
+
[name]="group()"
|
|
67
|
+
[value]="value()"
|
|
68
|
+
[(ngModel)]="model"
|
|
69
|
+
[disabled]="isDisabled"
|
|
70
|
+
(ngModelChange)="onChange($event)"
|
|
71
|
+
/>
|
|
72
|
+
<ng-content />
|
|
73
|
+
</label>
|
|
74
|
+
`, isInline: true, styles: [":root{--watt-radio-color: var(--watt-color-primary);--watt-disabled-radio-color: var(--watt-color-neutral-grey-300);--watt-radio-label-color: var(--watt-on-light-high-emphasis);--watt-disabled-radio-label-color: var(--watt-on-light-low-emphasis)}watt-radio label{display:flex;align-items:center;color:var(--watt-radio-label-color)}watt-radio label.disabled{cursor:not-allowed;color:var(--watt-radio-disabled-label-color)}watt-radio input[type=radio]{width:24px;height:24px;min-width:24px;min-height:24px;appearance:none;margin:0 var(--watt-space-s) 0 0;border:2px solid currentColor;border-radius:50%;color:var(--watt-radio-color);display:grid;place-content:center}watt-radio input[type=radio]:before{content:\"\";width:10px;height:10px;border-radius:50%;transform:scale(0);transition:.12s transform ease-in-out;box-shadow:inset 1em 1em var(--watt-radio-color)}watt-radio input[type=radio]:checked:before{transform:scale(1)}watt-radio.disabled{--watt-radio-label-color: var(--watt-disabled-radio-label-color);--watt-radio-color: var(--watt-disabled-radio-color)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { 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.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
75
|
+
}
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattRadioComponent, decorators: [{
|
|
77
|
+
type: Component,
|
|
78
|
+
args: [{ imports: [FormsModule], providers: [
|
|
79
|
+
{
|
|
80
|
+
provide: NG_VALUE_ACCESSOR,
|
|
81
|
+
useExisting: forwardRef(() => WattRadioComponent),
|
|
82
|
+
multi: true,
|
|
83
|
+
},
|
|
84
|
+
], selector: 'watt-radio', template: `
|
|
85
|
+
<label class="watt-text-m">
|
|
86
|
+
<input
|
|
87
|
+
type="radio"
|
|
88
|
+
[name]="group()"
|
|
89
|
+
[value]="value()"
|
|
90
|
+
[(ngModel)]="model"
|
|
91
|
+
[disabled]="isDisabled"
|
|
92
|
+
(ngModelChange)="onChange($event)"
|
|
93
|
+
/>
|
|
94
|
+
<ng-content />
|
|
95
|
+
</label>
|
|
96
|
+
`, encapsulation: ViewEncapsulation.None, host: {
|
|
97
|
+
'[class.disabled]': 'isDisabled',
|
|
98
|
+
}, styles: [":root{--watt-radio-color: var(--watt-color-primary);--watt-disabled-radio-color: var(--watt-color-neutral-grey-300);--watt-radio-label-color: var(--watt-on-light-high-emphasis);--watt-disabled-radio-label-color: var(--watt-on-light-low-emphasis)}watt-radio label{display:flex;align-items:center;color:var(--watt-radio-label-color)}watt-radio label.disabled{cursor:not-allowed;color:var(--watt-radio-disabled-label-color)}watt-radio input[type=radio]{width:24px;height:24px;min-width:24px;min-height:24px;appearance:none;margin:0 var(--watt-space-s) 0 0;border:2px solid currentColor;border-radius:50%;color:var(--watt-radio-color);display:grid;place-content:center}watt-radio input[type=radio]:before{content:\"\";width:10px;height:10px;border-radius:50%;transform:scale(0);transition:.12s transform ease-in-out;box-shadow:inset 1em 1em var(--watt-radio-color)}watt-radio input[type=radio]:checked:before{transform:scale(1)}watt-radio.disabled{--watt-radio-label-color: var(--watt-disabled-radio-label-color);--watt-radio-color: var(--watt-disabled-radio-color)}\n"] }]
|
|
99
|
+
}] });
|
|
100
|
+
|
|
101
|
+
//#region License
|
|
102
|
+
/**
|
|
103
|
+
* @license
|
|
104
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
105
|
+
*
|
|
106
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
107
|
+
* you may not use this file except in compliance with the License.
|
|
108
|
+
* You may obtain a copy of the License at
|
|
109
|
+
*
|
|
110
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
111
|
+
*
|
|
112
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
113
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
114
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
115
|
+
* See the License for the specific language governing permissions and
|
|
116
|
+
* limitations under the License.
|
|
117
|
+
*/
|
|
118
|
+
//#endregion
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Generated bundle index. Do not edit.
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
export { WattRadioComponent };
|
|
125
|
+
//# sourceMappingURL=energinet-watt-radio.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"energinet-watt-radio.mjs","sources":["../../../libs/watt/package/radio/watt-radio.component.ts","../../../libs/watt/package/radio/index.ts","../../../libs/watt/package/radio/energinet-watt-radio.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, forwardRef, ViewEncapsulation, input } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n imports: [FormsModule],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattRadioComponent),\n multi: true,\n },\n ],\n selector: 'watt-radio',\n styleUrls: ['./watt-radio.component.scss'],\n template: `\n <label class=\"watt-text-m\">\n <input\n type=\"radio\"\n [name]=\"group()\"\n [value]=\"value()\"\n [(ngModel)]=\"model\"\n [disabled]=\"isDisabled\"\n (ngModelChange)=\"onChange($event)\"\n />\n <ng-content />\n </label>\n `,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class.disabled]': 'isDisabled',\n },\n})\nexport class WattRadioComponent implements ControlValueAccessor {\n group = input.required<string>();\n value = input.required<string | boolean>();\n\n /** @ignore */\n model!: string;\n\n /** @ignore */\n isDisabled = false;\n\n /** @ignore */\n onChange: (value: string) => void = () => {\n /* left blank intentionally */\n };\n\n /** @ignore */\n onTouched: () => void = () => {\n /* left blank intentionally */\n };\n\n /** @ignore */\n writeValue(value: string): void {\n this.model = value;\n }\n\n /** @ignore */\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled = isDisabled;\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 { WattRadioComponent } from './watt-radio.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAiCa,kBAAkB,CAAA;AAC7B,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAU;AAChC,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAoB;;AAG1C,IAAA,KAAK;;IAGL,UAAU,GAAG,KAAK;;IAGlB,QAAQ,GAA4B,MAAK;;AAEzC,KAAC;;IAGD,SAAS,GAAe,MAAK;;AAE7B,KAAC;;AAGD,IAAA,UAAU,CAAC,KAAa,EAAA;AACtB,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;;;AAIpB,IAAA,gBAAgB,CAAC,EAA2B,EAAA;AAC1C,QAAA,IAAI,CAAC,QAAQ,GAAG,EAAE;;;AAIpB,IAAA,iBAAiB,CAAC,EAAc,EAAA;AAC9B,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'@angular/core';
|
|
3
|
+
import { viewChild, input, Component } from '@angular/core';
|
|
4
|
+
import { BehaviorSubject, skip, debounceTime } from 'rxjs';
|
|
5
|
+
import { WattIconComponent } from '@energinet/watt/icon';
|
|
6
|
+
|
|
7
|
+
//#region License
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
11
|
+
*
|
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
13
|
+
* you may not use this file except in compliance with the License.
|
|
14
|
+
* You may obtain a copy of the License at
|
|
15
|
+
*
|
|
16
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
* See the License for the specific language governing permissions and
|
|
22
|
+
* limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
//#endregion
|
|
25
|
+
class WattSearchComponent {
|
|
26
|
+
/**
|
|
27
|
+
* @ignore
|
|
28
|
+
*/
|
|
29
|
+
input = viewChild.required('input');
|
|
30
|
+
/**
|
|
31
|
+
* @ignore
|
|
32
|
+
*/
|
|
33
|
+
label = input('');
|
|
34
|
+
/**
|
|
35
|
+
* @ignore
|
|
36
|
+
*/
|
|
37
|
+
debounceTime = input(300);
|
|
38
|
+
/**
|
|
39
|
+
* @ignore
|
|
40
|
+
*/
|
|
41
|
+
search$ = new BehaviorSubject('');
|
|
42
|
+
/**
|
|
43
|
+
* @ignore
|
|
44
|
+
*/
|
|
45
|
+
search = outputFromObservable(this.search$.pipe(skip(1), debounceTime(this.debounceTime())));
|
|
46
|
+
/**
|
|
47
|
+
* @ignore
|
|
48
|
+
*/
|
|
49
|
+
clear() {
|
|
50
|
+
const element = this.input().nativeElement;
|
|
51
|
+
if (element.value === '')
|
|
52
|
+
return;
|
|
53
|
+
element.value = '';
|
|
54
|
+
this.search$.next(element.value);
|
|
55
|
+
}
|
|
56
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
57
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.1", type: WattSearchComponent, isStandalone: true, selector: "watt-search", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { search: "search" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
58
|
+
<label>
|
|
59
|
+
<input
|
|
60
|
+
#input
|
|
61
|
+
type="text"
|
|
62
|
+
role="searchbox"
|
|
63
|
+
[placeholder]="label()"
|
|
64
|
+
(input)="search$.next(input.value)"
|
|
65
|
+
/>
|
|
66
|
+
<span class="wrapper">
|
|
67
|
+
<span class="button">
|
|
68
|
+
<watt-icon name="search" size="s" aria-hidden="true" />
|
|
69
|
+
<span class="text">{{ label() }}</span>
|
|
70
|
+
</span>
|
|
71
|
+
</span>
|
|
72
|
+
<button class="clear" (click)="clear()">
|
|
73
|
+
<watt-icon name="close" size="s" />
|
|
74
|
+
</button>
|
|
75
|
+
</label>
|
|
76
|
+
`, isInline: true, styles: [":host{height:44px}label{display:inline-block;width:100%;position:relative;text-transform:none;overflow:hidden;pointer-events:none}input{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;font-family:inherit;width:100%;height:44px;padding-left:var(--watt-space-l);padding-right:12px;border:1px solid var(--watt-on-light-low-emphasis);border-radius:4px;outline:0;opacity:0;transition-property:opacity}.wrapper{display:inline-flex;position:absolute;left:100%;width:100%;height:100%;transition-property:transform}.button{display:inline-flex;gap:var(--watt-space-xs);align-items:center;height:44px;padding:0 16px;color:var(--watt-color-primary);transform:translate(-100%);transition-property:transform;pointer-events:auto;cursor:pointer}.button:hover{color:var(--watt-color-primary-dark)}.text{opacity:1;transition-property:opacity}.clear{position:absolute;top:50%;right:var(--watt-space-s);padding:var(--watt-space-xs);border:none;border-radius:4px;background:none;color:var(--watt-color-primary);transform:translateY(-50%);cursor:pointer;pointer-events:auto}.clear:focus-visible{outline:2px solid var(--watt-color-primary)}input:placeholder-shown~.clear{display:none}input,.wrapper,.button,.text{transition-duration:.3s;transition-timing-function:cubic-bezier(.75,0,.25,1)}input{transition-timing-function:cubic-bezier(0,.5,0,1)}input:focus{border:1px solid var(--watt-color-primary)}input:not(:placeholder-shown),input:focus{pointer-events:auto;opacity:1;transition-timing-function:cubic-bezier(1,0,.5,0)}input:not(:placeholder-shown)+.wrapper,input:focus+.wrapper{transform:translate(-100%)}input:not(:placeholder-shown)+.wrapper .button,input:focus+.wrapper .button{pointer-events:none;transform:translate(-6px)}input:not(:placeholder-shown)+.wrapper .text,input:focus+.wrapper .text{opacity:0}\n"], dependencies: [{ kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }] });
|
|
77
|
+
}
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattSearchComponent, decorators: [{
|
|
79
|
+
type: Component,
|
|
80
|
+
args: [{ imports: [WattIconComponent], selector: 'watt-search', template: `
|
|
81
|
+
<label>
|
|
82
|
+
<input
|
|
83
|
+
#input
|
|
84
|
+
type="text"
|
|
85
|
+
role="searchbox"
|
|
86
|
+
[placeholder]="label()"
|
|
87
|
+
(input)="search$.next(input.value)"
|
|
88
|
+
/>
|
|
89
|
+
<span class="wrapper">
|
|
90
|
+
<span class="button">
|
|
91
|
+
<watt-icon name="search" size="s" aria-hidden="true" />
|
|
92
|
+
<span class="text">{{ label() }}</span>
|
|
93
|
+
</span>
|
|
94
|
+
</span>
|
|
95
|
+
<button class="clear" (click)="clear()">
|
|
96
|
+
<watt-icon name="close" size="s" />
|
|
97
|
+
</button>
|
|
98
|
+
</label>
|
|
99
|
+
`, styles: [":host{height:44px}label{display:inline-block;width:100%;position:relative;text-transform:none;overflow:hidden;pointer-events:none}input{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;font-family:inherit;width:100%;height:44px;padding-left:var(--watt-space-l);padding-right:12px;border:1px solid var(--watt-on-light-low-emphasis);border-radius:4px;outline:0;opacity:0;transition-property:opacity}.wrapper{display:inline-flex;position:absolute;left:100%;width:100%;height:100%;transition-property:transform}.button{display:inline-flex;gap:var(--watt-space-xs);align-items:center;height:44px;padding:0 16px;color:var(--watt-color-primary);transform:translate(-100%);transition-property:transform;pointer-events:auto;cursor:pointer}.button:hover{color:var(--watt-color-primary-dark)}.text{opacity:1;transition-property:opacity}.clear{position:absolute;top:50%;right:var(--watt-space-s);padding:var(--watt-space-xs);border:none;border-radius:4px;background:none;color:var(--watt-color-primary);transform:translateY(-50%);cursor:pointer;pointer-events:auto}.clear:focus-visible{outline:2px solid var(--watt-color-primary)}input:placeholder-shown~.clear{display:none}input,.wrapper,.button,.text{transition-duration:.3s;transition-timing-function:cubic-bezier(.75,0,.25,1)}input{transition-timing-function:cubic-bezier(0,.5,0,1)}input:focus{border:1px solid var(--watt-color-primary)}input:not(:placeholder-shown),input:focus{pointer-events:auto;opacity:1;transition-timing-function:cubic-bezier(1,0,.5,0)}input:not(:placeholder-shown)+.wrapper,input:focus+.wrapper{transform:translate(-100%)}input:not(:placeholder-shown)+.wrapper .button,input:focus+.wrapper .button{pointer-events:none;transform:translate(-6px)}input:not(:placeholder-shown)+.wrapper .text,input:focus+.wrapper .text{opacity:0}\n"] }]
|
|
100
|
+
}] });
|
|
101
|
+
|
|
102
|
+
//#region License
|
|
103
|
+
/**
|
|
104
|
+
* @license
|
|
105
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
106
|
+
*
|
|
107
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
108
|
+
* you may not use this file except in compliance with the License.
|
|
109
|
+
* You may obtain a copy of the License at
|
|
110
|
+
*
|
|
111
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
112
|
+
*
|
|
113
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
114
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
115
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
116
|
+
* See the License for the specific language governing permissions and
|
|
117
|
+
* limitations under the License.
|
|
118
|
+
*/
|
|
119
|
+
//#endregion
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Generated bundle index. Do not edit.
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
export { WattSearchComponent };
|
|
126
|
+
//# sourceMappingURL=energinet-watt-search.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"energinet-watt-search.mjs","sources":["../../../libs/watt/package/search/watt-search.component.ts","../../../libs/watt/package/search/index.ts","../../../libs/watt/package/search/energinet-watt-search.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 { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { Component, ElementRef, input, viewChild } from '@angular/core';\n\nimport { BehaviorSubject, debounceTime, skip } from 'rxjs';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\n\n@Component({\n imports: [WattIconComponent],\n selector: 'watt-search',\n styleUrls: ['./watt-search.component.scss'],\n template: `\n <label>\n <input\n #input\n type=\"text\"\n role=\"searchbox\"\n [placeholder]=\"label()\"\n (input)=\"search$.next(input.value)\"\n />\n <span class=\"wrapper\">\n <span class=\"button\">\n <watt-icon name=\"search\" size=\"s\" aria-hidden=\"true\" />\n <span class=\"text\">{{ label() }}</span>\n </span>\n </span>\n <button class=\"clear\" (click)=\"clear()\">\n <watt-icon name=\"close\" size=\"s\" />\n </button>\n </label>\n `,\n})\nexport class WattSearchComponent {\n /**\n * @ignore\n */\n input = viewChild.required<ElementRef<HTMLInputElement>>('input');\n\n /**\n * @ignore\n */\n label = input<string>('');\n\n /**\n * @ignore\n */\n debounceTime = input<number>(300);\n\n /**\n * @ignore\n */\n search$ = new BehaviorSubject<string>('');\n\n /**\n * @ignore\n */\n search = outputFromObservable(this.search$.pipe(skip(1), debounceTime(this.debounceTime())));\n\n /**\n * @ignore\n */\n clear(): void {\n const element = this.input().nativeElement;\n if (element.value === '') return;\n\n element.value = '';\n\n this.search$.next(element.value);\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 { WattSearchComponent } from './watt-search.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAiCa,mBAAmB,CAAA;AAC9B;;AAEG;AACH,IAAA,KAAK,GAAG,SAAS,CAAC,QAAQ,CAA+B,OAAO,CAAC;AAEjE;;AAEG;AACH,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC;AAEzB;;AAEG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