@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,233 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, viewChild, input, output, signal, computed, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormControl, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { takeUntilDestroyed, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { MatCalendar } from '@angular/material/datepicker';
|
|
7
|
+
import { MaskitoDirective } from '@maskito/angular';
|
|
8
|
+
import { maskitoDateTimeOptionsGenerator } from '@maskito/kit';
|
|
9
|
+
import { map, share } from 'rxjs';
|
|
10
|
+
import { WattLocaleService, dayjs } from '@energinet/watt/core/date';
|
|
11
|
+
import { WattFieldComponent } from '@energinet/watt/field';
|
|
12
|
+
import { WattButtonComponent } from '@energinet/watt/button';
|
|
13
|
+
|
|
14
|
+
//#region License
|
|
15
|
+
/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
18
|
+
*
|
|
19
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
20
|
+
* you may not use this file except in compliance with the License.
|
|
21
|
+
* You may obtain a copy of the License at
|
|
22
|
+
*
|
|
23
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
26
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
27
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28
|
+
* See the License for the specific language governing permissions and
|
|
29
|
+
* limitations under the License.
|
|
30
|
+
*/
|
|
31
|
+
//#endregion
|
|
32
|
+
const DA_FILLER = 'dd-mm-åååå, tt:mm';
|
|
33
|
+
const EN_FILLER = 'dd-mm-yyyy, hh:mm';
|
|
34
|
+
const DATETIME_FORMAT = 'DD-MM-YYYY, HH:mm';
|
|
35
|
+
const PARTIAL_DATETIME_FORMAT = 'DD-MM-YYYY, ';
|
|
36
|
+
const DANISH_TIME_ZONE_IDENTIFIER = 'Europe/Copenhagen';
|
|
37
|
+
/* eslint-disable @angular-eslint/component-class-suffix */
|
|
38
|
+
class WattDateTimeField {
|
|
39
|
+
locale = inject(WattLocaleService);
|
|
40
|
+
// Popovers exists on an entirely different layer, meaning that for anchor positioning they
|
|
41
|
+
// look at the entire tree for the anchor name. This gives each field a unique anchor name.
|
|
42
|
+
static instance = 0;
|
|
43
|
+
instance = WattDateTimeField.instance++;
|
|
44
|
+
anchorName = `--watt-field-popover-anchor-${this.instance}`;
|
|
45
|
+
/** Converts date from outer FormControl to format of inner FormControl. */
|
|
46
|
+
modelToView = (value, format = DATETIME_FORMAT) => value ? dayjs(value).tz(DANISH_TIME_ZONE_IDENTIFIER).format(format) : '';
|
|
47
|
+
/** Converts value of inner FormControl to type of outer FormControl. */
|
|
48
|
+
viewToModel = (value) => {
|
|
49
|
+
const date = dayjs(value, DATETIME_FORMAT, true);
|
|
50
|
+
if (!date.isValid())
|
|
51
|
+
return null;
|
|
52
|
+
return this.inclusive() ? date.endOf('m').toDate() : date.toDate();
|
|
53
|
+
};
|
|
54
|
+
// Must unfortunately be queried in order to update `activeDate`
|
|
55
|
+
calendar = viewChild.required(MatCalendar);
|
|
56
|
+
// This inner FormControl is string only, but the outer FormControl is of type Date.
|
|
57
|
+
control = new FormControl('', { nonNullable: true });
|
|
58
|
+
// `registerOnChange` may subscribe to this component after it has been destroyed, thus
|
|
59
|
+
// triggering an NG0911 from the `takeUntilDestroyed` operator. By sharing the observable,
|
|
60
|
+
// the observable will already be closed and `subscribe` becomes a proper noop.
|
|
61
|
+
valueChanges = this.control.valueChanges.pipe(map(this.viewToModel), takeUntilDestroyed(), share());
|
|
62
|
+
/** Set the label text for `watt-field`. */
|
|
63
|
+
label = input('');
|
|
64
|
+
/** The minimum selectable date. */
|
|
65
|
+
min = input();
|
|
66
|
+
/** The maximum selectable date. */
|
|
67
|
+
max = input();
|
|
68
|
+
/** When true, seconds will be set to 59 and milliseconds to 999. Otherwise, both are 0. */
|
|
69
|
+
inclusive = input(false);
|
|
70
|
+
/** Emits when the selected date has changed. */
|
|
71
|
+
dateChange = outputFromObservable(this.valueChanges);
|
|
72
|
+
/** Emits when the field loses focus. */
|
|
73
|
+
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
74
|
+
blur = output();
|
|
75
|
+
selected = signal(null);
|
|
76
|
+
placeholder = computed(() => (this.locale.isDanish() ? DA_FILLER : EN_FILLER));
|
|
77
|
+
mask = computed(() => maskitoDateTimeOptionsGenerator({
|
|
78
|
+
min: this.min(),
|
|
79
|
+
max: this.max(),
|
|
80
|
+
dateMode: 'dd/mm/yyyy',
|
|
81
|
+
timeMode: 'HH:MM',
|
|
82
|
+
dateSeparator: '-',
|
|
83
|
+
timeStep: 1,
|
|
84
|
+
}));
|
|
85
|
+
handleBlur = (picker, event) => {
|
|
86
|
+
if (event.relatedTarget instanceof HTMLElement && picker.contains(event.relatedTarget)) {
|
|
87
|
+
const target = event.target; // safe type assertion
|
|
88
|
+
setTimeout(() => target.focus());
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
picker.hidePopover();
|
|
92
|
+
this.blur.emit(event);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
handleSelectedChange = (field, picker, date) => {
|
|
96
|
+
const prev = this.viewToModel(this.control.value);
|
|
97
|
+
// Only write the date part
|
|
98
|
+
field.value = prev
|
|
99
|
+
? this.modelToView(dayjs(date).set('h', prev.getHours()).set('m', prev.getMinutes()).toDate())
|
|
100
|
+
: this.modelToView(date, PARTIAL_DATETIME_FORMAT);
|
|
101
|
+
field.dispatchEvent(new Event('input', { bubbles: true }));
|
|
102
|
+
picker.hidePopover();
|
|
103
|
+
};
|
|
104
|
+
constructor() {
|
|
105
|
+
this.valueChanges.subscribe((value) => {
|
|
106
|
+
this.selected.set(value);
|
|
107
|
+
this.calendar().activeDate = value ?? new Date();
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// Implementation for ControlValueAccessor
|
|
111
|
+
writeValue = (value) => this.control.setValue(this.modelToView(value));
|
|
112
|
+
setDisabledState = (x) => (x ? this.control.disable() : this.control.enable());
|
|
113
|
+
registerOnTouched = (fn) => this.blur.subscribe(fn);
|
|
114
|
+
registerOnChange = (fn) => this.valueChanges.subscribe(fn);
|
|
115
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDateTimeField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
116
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.1", type: WattDateTimeField, isStandalone: true, selector: "watt-datetime-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, inclusive: { classPropertyName: "inclusive", publicName: "inclusive", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateChange: "dateChange", blur: "blur" }, providers: [
|
|
117
|
+
{
|
|
118
|
+
provide: NG_VALUE_ACCESSOR,
|
|
119
|
+
useExisting: forwardRef(() => WattDateTimeField),
|
|
120
|
+
multi: true,
|
|
121
|
+
},
|
|
122
|
+
], viewQueries: [{ propertyName: "calendar", first: true, predicate: MatCalendar, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
123
|
+
<watt-field
|
|
124
|
+
[label]="label()"
|
|
125
|
+
[control]="control"
|
|
126
|
+
[placeholder]="placeholder()"
|
|
127
|
+
[anchorName]="anchorName"
|
|
128
|
+
>
|
|
129
|
+
<input
|
|
130
|
+
#field
|
|
131
|
+
[formControl]="control"
|
|
132
|
+
[maskito]="mask()"
|
|
133
|
+
(focus)="picker.showPopover()"
|
|
134
|
+
(blur)="handleBlur(picker, $event)"
|
|
135
|
+
/>
|
|
136
|
+
<watt-button icon="date" variant="icon" (click)="field.focus()" />
|
|
137
|
+
<div
|
|
138
|
+
#picker
|
|
139
|
+
class="watt-elevation watt-datetime-field-picker"
|
|
140
|
+
popover="manual"
|
|
141
|
+
tabindex="0"
|
|
142
|
+
[style.position-anchor]="anchorName"
|
|
143
|
+
>
|
|
144
|
+
<mat-calendar
|
|
145
|
+
[startAt]="selected()"
|
|
146
|
+
[selected]="selected()"
|
|
147
|
+
[minDate]="min()"
|
|
148
|
+
[maxDate]="max()"
|
|
149
|
+
(selectedChange)="handleSelectedChange(field, picker, $event)"
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
<ng-content />
|
|
153
|
+
<ng-content select="watt-field-error" ngProjectAs="watt-field-error" />
|
|
154
|
+
<ng-content select="watt-field-hint" ngProjectAs="watt-field-hint" />
|
|
155
|
+
</watt-field>
|
|
156
|
+
`, isInline: true, styles: ["watt-datetime-field{display:block;width:100%}.watt-datetime-field-picker{position:fixed;position-area:bottom span-right;position-try-fallbacks:flip-block;width:296px;height:354px;inset:unset;margin:unset;border:0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"] }, { kind: "component", type: MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
157
|
+
}
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDateTimeField, decorators: [{
|
|
159
|
+
type: Component,
|
|
160
|
+
args: [{ selector: 'watt-datetime-field', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
161
|
+
{
|
|
162
|
+
provide: NG_VALUE_ACCESSOR,
|
|
163
|
+
useExisting: forwardRef(() => WattDateTimeField),
|
|
164
|
+
multi: true,
|
|
165
|
+
},
|
|
166
|
+
], imports: [
|
|
167
|
+
ReactiveFormsModule,
|
|
168
|
+
MaskitoDirective,
|
|
169
|
+
MatCalendar,
|
|
170
|
+
WattButtonComponent,
|
|
171
|
+
WattFieldComponent,
|
|
172
|
+
], template: `
|
|
173
|
+
<watt-field
|
|
174
|
+
[label]="label()"
|
|
175
|
+
[control]="control"
|
|
176
|
+
[placeholder]="placeholder()"
|
|
177
|
+
[anchorName]="anchorName"
|
|
178
|
+
>
|
|
179
|
+
<input
|
|
180
|
+
#field
|
|
181
|
+
[formControl]="control"
|
|
182
|
+
[maskito]="mask()"
|
|
183
|
+
(focus)="picker.showPopover()"
|
|
184
|
+
(blur)="handleBlur(picker, $event)"
|
|
185
|
+
/>
|
|
186
|
+
<watt-button icon="date" variant="icon" (click)="field.focus()" />
|
|
187
|
+
<div
|
|
188
|
+
#picker
|
|
189
|
+
class="watt-elevation watt-datetime-field-picker"
|
|
190
|
+
popover="manual"
|
|
191
|
+
tabindex="0"
|
|
192
|
+
[style.position-anchor]="anchorName"
|
|
193
|
+
>
|
|
194
|
+
<mat-calendar
|
|
195
|
+
[startAt]="selected()"
|
|
196
|
+
[selected]="selected()"
|
|
197
|
+
[minDate]="min()"
|
|
198
|
+
[maxDate]="max()"
|
|
199
|
+
(selectedChange)="handleSelectedChange(field, picker, $event)"
|
|
200
|
+
/>
|
|
201
|
+
</div>
|
|
202
|
+
<ng-content />
|
|
203
|
+
<ng-content select="watt-field-error" ngProjectAs="watt-field-error" />
|
|
204
|
+
<ng-content select="watt-field-hint" ngProjectAs="watt-field-hint" />
|
|
205
|
+
</watt-field>
|
|
206
|
+
`, styles: ["watt-datetime-field{display:block;width:100%}.watt-datetime-field-picker{position:fixed;position-area:bottom span-right;position-try-fallbacks:flip-block;width:296px;height:354px;inset:unset;margin:unset;border:0}\n"] }]
|
|
207
|
+
}], ctorParameters: () => [] });
|
|
208
|
+
|
|
209
|
+
//#region License
|
|
210
|
+
/**
|
|
211
|
+
* @license
|
|
212
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
213
|
+
*
|
|
214
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
215
|
+
* you may not use this file except in compliance with the License.
|
|
216
|
+
* You may obtain a copy of the License at
|
|
217
|
+
*
|
|
218
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
219
|
+
*
|
|
220
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
221
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
222
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
223
|
+
* See the License for the specific language governing permissions and
|
|
224
|
+
* limitations under the License.
|
|
225
|
+
*/
|
|
226
|
+
//#endregion
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Generated bundle index. Do not edit.
|
|
230
|
+
*/
|
|
231
|
+
|
|
232
|
+
export { WattDateTimeField };
|
|
233
|
+
//# sourceMappingURL=energinet-watt-datetime-field.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"energinet-watt-datetime-field.mjs","sources":["../../../libs/watt/package/datetime-field/watt-datetime-field.component.ts","../../../libs/watt/package/datetime-field/index.ts","../../../libs/watt/package/datetime-field/energinet-watt-datetime-field.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n forwardRef,\n inject,\n input,\n output,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { outputFromObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatCalendar } from '@angular/material/datepicker';\nimport { MaskitoDirective } from '@maskito/angular';\nimport { maskitoDateTimeOptionsGenerator } from '@maskito/kit';\nimport { map, share } from 'rxjs';\nimport { dayjs, WattLocaleService } from '@energinet/watt/core/date';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\nconst DA_FILLER = 'dd-mm-åååå, tt:mm';\nconst EN_FILLER = 'dd-mm-yyyy, hh:mm';\nconst DATETIME_FORMAT = 'DD-MM-YYYY, HH:mm';\nconst PARTIAL_DATETIME_FORMAT = 'DD-MM-YYYY, ';\nconst DANISH_TIME_ZONE_IDENTIFIER = 'Europe/Copenhagen';\n\n/* eslint-disable @angular-eslint/component-class-suffix */\n@Component({\n selector: 'watt-datetime-field',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattDateTimeField),\n multi: true,\n },\n ],\n imports: [\n ReactiveFormsModule,\n MaskitoDirective,\n MatCalendar,\n WattButtonComponent,\n WattFieldComponent,\n ],\n styles: [\n `\n watt-datetime-field {\n display: block;\n width: 100%;\n }\n\n .watt-datetime-field-picker {\n position: fixed;\n position-area: bottom span-right;\n position-try-fallbacks: flip-block;\n width: 296px;\n height: 354px;\n inset: unset;\n margin: unset;\n border: 0;\n }\n `,\n ],\n template: `\n <watt-field\n [label]=\"label()\"\n [control]=\"control\"\n [placeholder]=\"placeholder()\"\n [anchorName]=\"anchorName\"\n >\n <input\n #field\n [formControl]=\"control\"\n [maskito]=\"mask()\"\n (focus)=\"picker.showPopover()\"\n (blur)=\"handleBlur(picker, $event)\"\n />\n <watt-button icon=\"date\" variant=\"icon\" (click)=\"field.focus()\" />\n <div\n #picker\n class=\"watt-elevation watt-datetime-field-picker\"\n popover=\"manual\"\n tabindex=\"0\"\n [style.position-anchor]=\"anchorName\"\n >\n <mat-calendar\n [startAt]=\"selected()\"\n [selected]=\"selected()\"\n [minDate]=\"min()\"\n [maxDate]=\"max()\"\n (selectedChange)=\"handleSelectedChange(field, picker, $event)\"\n />\n </div>\n <ng-content />\n <ng-content select=\"watt-field-error\" ngProjectAs=\"watt-field-error\" />\n <ng-content select=\"watt-field-hint\" ngProjectAs=\"watt-field-hint\" />\n </watt-field>\n `,\n})\nexport class WattDateTimeField implements ControlValueAccessor {\n private locale = inject(WattLocaleService);\n\n // Popovers exists on an entirely different layer, meaning that for anchor positioning they\n // look at the entire tree for the anchor name. This gives each field a unique anchor name.\n private static instance = 0;\n private instance = WattDateTimeField.instance++;\n protected anchorName = `--watt-field-popover-anchor-${this.instance}`;\n\n /** Converts date from outer FormControl to format of inner FormControl. */\n protected modelToView = (value: Date | null, format = DATETIME_FORMAT) =>\n value ? dayjs(value).tz(DANISH_TIME_ZONE_IDENTIFIER).format(format) : '';\n\n /** Converts value of inner FormControl to type of outer FormControl. */\n protected viewToModel = (value: string) => {\n const date = dayjs(value, DATETIME_FORMAT, true);\n if (!date.isValid()) return null;\n return this.inclusive() ? date.endOf('m').toDate() : date.toDate();\n };\n\n // Must unfortunately be queried in order to update `activeDate`\n private calendar = viewChild.required<MatCalendar<Date>>(MatCalendar);\n\n // This inner FormControl is string only, but the outer FormControl is of type Date.\n protected control = new FormControl('', { nonNullable: true });\n\n // `registerOnChange` may subscribe to this component after it has been destroyed, thus\n // triggering an NG0911 from the `takeUntilDestroyed` operator. By sharing the observable,\n // the observable will already be closed and `subscribe` becomes a proper noop.\n private valueChanges = this.control.valueChanges.pipe(\n map(this.viewToModel),\n takeUntilDestroyed(),\n share()\n );\n\n /** Set the label text for `watt-field`. */\n label = input('');\n\n /** The minimum selectable date. */\n min = input<Date>();\n\n /** The maximum selectable date. */\n max = input<Date>();\n\n /** When true, seconds will be set to 59 and milliseconds to 999. Otherwise, both are 0. */\n inclusive = input(false);\n\n /** Emits when the selected date has changed. */\n dateChange = outputFromObservable(this.valueChanges);\n\n /** Emits when the field loses focus. */\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n\n protected selected = signal<Date | null>(null);\n protected placeholder = computed(() => (this.locale.isDanish() ? DA_FILLER : EN_FILLER));\n protected mask = computed(() =>\n maskitoDateTimeOptionsGenerator({\n min: this.min(),\n max: this.max(),\n dateMode: 'dd/mm/yyyy',\n timeMode: 'HH:MM',\n dateSeparator: '-',\n timeStep: 1,\n })\n );\n\n protected handleBlur = (picker: HTMLElement, event: FocusEvent) => {\n if (event.relatedTarget instanceof HTMLElement && picker.contains(event.relatedTarget)) {\n const target = event.target as HTMLInputElement; // safe type assertion\n setTimeout(() => target.focus());\n } else {\n picker.hidePopover();\n this.blur.emit(event);\n }\n };\n\n protected handleSelectedChange = (\n field: HTMLInputElement,\n picker: HTMLDivElement,\n date: Date\n ) => {\n const prev = this.viewToModel(this.control.value);\n\n // Only write the date part\n field.value = prev\n ? this.modelToView(dayjs(date).set('h', prev.getHours()).set('m', prev.getMinutes()).toDate())\n : this.modelToView(date, PARTIAL_DATETIME_FORMAT);\n\n field.dispatchEvent(new Event('input', { bubbles: true }));\n picker.hidePopover();\n };\n\n constructor() {\n this.valueChanges.subscribe((value) => {\n this.selected.set(value);\n this.calendar().activeDate = value ?? new Date();\n });\n }\n\n // Implementation for ControlValueAccessor\n writeValue = (value: Date | null) => this.control.setValue(this.modelToView(value));\n setDisabledState = (x: boolean) => (x ? this.control.disable() : this.control.enable());\n registerOnTouched = (fn: () => void) => this.blur.subscribe(fn);\n registerOnChange = (fn: (value: Date | null) => void) => this.valueChanges.subscribe(fn);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattDateTimeField } from './watt-datetime-field.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AA4BA,MAAM,SAAS,GAAG,mBAAmB;AACrC,MAAM,SAAS,GAAG,mBAAmB;AACrC,MAAM,eAAe,GAAG,mBAAmB;AAC3C,MAAM,uBAAuB,GAAG,cAAc;AAC9C,MAAM,2BAA2B,GAAG,mBAAmB;AAEvD;MA0Ea,iBAAiB,CAAA;AACpB,IAAA,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;;;AAIlC,IAAA,OAAO,QAAQ,GAAG,CAAC;AACnB,IAAA,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,EAAE;AACrC,IAAA,UAAU,GAAG,CAA+B,4BAAA,EAAA,IAAI,CAAC,QAAQ,EAAE;;AAG3D,IAAA,WAAW,GAAG,CAAC,KAAkB,EAAE,MAAM,GAAG,eAAe,KACnE,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,2BAA2B,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;;AAGhE,IAAA,WAAW,GAAG,CAAC,KAAa,KAAI;QACxC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,EAAE,eAAe,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CAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,mBAAmB,8HACnB,kBAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,OAAA,EAAA,IAAA,EAAA,UAAA,EAAA,SAAA,EAAA,aAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAyDT,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAzE7B,SAAS;+BACE,qBAAqB,EAAA,aAAA,EAChB,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,EACpC,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,uBAAuB,CAAC;AAChD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;qBACF,EACQ,OAAA,EAAA;wBACP,mBAAmB;wBACnB,gBAAgB;wBAChB,WAAW;wBACX,mBAAmB;wBACnB,kBAAkB;qBACnB,EAoBS,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,yNAAA,CAAA,EAAA;;;AC3HH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as i1 from '@angular/common';
|
|
2
|
+
import { NgClass, NgTemplateOutlet } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { viewChild, input, ChangeDetectionStrategy, Component, inject, contentChildren, computed, effect, ViewEncapsulation } from '@angular/core';
|
|
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 WattDescriptionListItemComponent {
|
|
25
|
+
templateRef = viewChild.required('templateRef');
|
|
26
|
+
label = input('');
|
|
27
|
+
value = input(null);
|
|
28
|
+
forceNewRow = input(false);
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDescriptionListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.1", type: WattDescriptionListItemComponent, isStandalone: true, selector: "watt-description-list-item", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, forceNewRow: { classPropertyName: "forceNewRow", publicName: "forceNewRow", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.NgClass }], ngImport: i0, template: `<ng-template #templateRef
|
|
31
|
+
><div [ngClass]="{ 'force-new-row': forceNewRow() }">
|
|
32
|
+
<dt class="watt-label watt-on-light--high-emphasis">{{ label() }}</dt>
|
|
33
|
+
<dd class="watt-text-s">{{ value() }}<ng-content /></dd></div
|
|
34
|
+
></ng-template>`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
35
|
+
}
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDescriptionListItemComponent, decorators: [{
|
|
37
|
+
type: Component,
|
|
38
|
+
args: [{
|
|
39
|
+
imports: [NgClass],
|
|
40
|
+
selector: 'watt-description-list-item',
|
|
41
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
42
|
+
hostDirectives: [NgClass],
|
|
43
|
+
template: `<ng-template #templateRef
|
|
44
|
+
><div [ngClass]="{ 'force-new-row': forceNewRow() }">
|
|
45
|
+
<dt class="watt-label watt-on-light--high-emphasis">{{ label() }}</dt>
|
|
46
|
+
<dd class="watt-text-s">{{ value() }}<ng-content /></dd></div
|
|
47
|
+
></ng-template>`,
|
|
48
|
+
}]
|
|
49
|
+
}] });
|
|
50
|
+
|
|
51
|
+
//#region License
|
|
52
|
+
/**
|
|
53
|
+
* @license
|
|
54
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
55
|
+
*
|
|
56
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
57
|
+
* you may not use this file except in compliance with the License.
|
|
58
|
+
* You may obtain a copy of the License at
|
|
59
|
+
*
|
|
60
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
61
|
+
*
|
|
62
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
63
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
64
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
65
|
+
* See the License for the specific language governing permissions and
|
|
66
|
+
* limitations under the License.
|
|
67
|
+
*/
|
|
68
|
+
//#endregion
|
|
69
|
+
/**
|
|
70
|
+
* Usage:
|
|
71
|
+
* `import { WattDescriptionListComponent } from '@energinet-datahub/watt/description-list';`
|
|
72
|
+
*/
|
|
73
|
+
class WattDescriptionListComponent {
|
|
74
|
+
ngClass = inject(NgClass);
|
|
75
|
+
descriptionItems = contentChildren((WattDescriptionListItemComponent));
|
|
76
|
+
variant = input('flow');
|
|
77
|
+
descriptionVariant = computed(() => `watt-description-list-${this.variant()}`);
|
|
78
|
+
groupsPerRow = input(3);
|
|
79
|
+
itemSeparators = input(true);
|
|
80
|
+
constructor() {
|
|
81
|
+
effect(() => {
|
|
82
|
+
this.ngClass.ngClass = {
|
|
83
|
+
[`item-separators`]: this.itemSeparators(),
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDescriptionListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
88
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: WattDescriptionListComponent, isStandalone: true, selector: "watt-description-list", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, groupsPerRow: { classPropertyName: "groupsPerRow", publicName: "groupsPerRow", isSignal: true, isRequired: false, transformFunction: null }, itemSeparators: { classPropertyName: "itemSeparators", publicName: "itemSeparators", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--watt-description-list-groups-per-row": "groupsPerRow()", "class": "descriptionVariant()" } }, queries: [{ propertyName: "descriptionItems", predicate: (WattDescriptionListItemComponent), isSignal: true }], hostDirectives: [{ directive: i1.NgClass }], ngImport: i0, template: `<dl>
|
|
89
|
+
@for (item of descriptionItems(); track item) {
|
|
90
|
+
<ng-container *ngTemplateOutlet="item.templateRef()" />
|
|
91
|
+
}
|
|
92
|
+
</dl>`, isInline: true, styles: ["watt-description-list{display:block}watt-description-list.watt-description-list-flow dl{display:grid;gap:var(--watt-space-ml);grid-template-columns:repeat(var(--watt-description-list-groups-per-row, 3),1fr)}watt-description-list.watt-description-list-flow dl dd{margin:0}watt-description-list.watt-description-list-flow dl .force-new-row{grid-column-start:1}watt-description-list.watt-description-list-stack dl{display:grid;gap:var(--watt-space-m);grid-template-columns:1fr}watt-description-list.watt-description-list-stack dl dd{margin:0;flex:1}watt-description-list.watt-description-list-stack dl dt{width:240px}watt-description-list.watt-description-list-stack dl div{display:flex;align-items:baseline}watt-description-list.watt-description-list-stack.item-separators dl div{border-bottom:1px solid var(--watt-color-neutral-grey-300);padding-bottom:var(--watt-space-m)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
93
|
+
}
|
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: WattDescriptionListComponent, decorators: [{
|
|
95
|
+
type: Component,
|
|
96
|
+
args: [{ encapsulation: ViewEncapsulation.None, selector: 'watt-description-list', imports: [NgTemplateOutlet], template: `<dl>
|
|
97
|
+
@for (item of descriptionItems(); track item) {
|
|
98
|
+
<ng-container *ngTemplateOutlet="item.templateRef()" />
|
|
99
|
+
}
|
|
100
|
+
</dl>`, hostDirectives: [NgClass], host: {
|
|
101
|
+
'[style.--watt-description-list-groups-per-row]': 'groupsPerRow()',
|
|
102
|
+
'[class]': 'descriptionVariant()',
|
|
103
|
+
}, styles: ["watt-description-list{display:block}watt-description-list.watt-description-list-flow dl{display:grid;gap:var(--watt-space-ml);grid-template-columns:repeat(var(--watt-description-list-groups-per-row, 3),1fr)}watt-description-list.watt-description-list-flow dl dd{margin:0}watt-description-list.watt-description-list-flow dl .force-new-row{grid-column-start:1}watt-description-list.watt-description-list-stack dl{display:grid;gap:var(--watt-space-m);grid-template-columns:1fr}watt-description-list.watt-description-list-stack dl dd{margin:0;flex:1}watt-description-list.watt-description-list-stack dl dt{width:240px}watt-description-list.watt-description-list-stack dl div{display:flex;align-items:baseline}watt-description-list.watt-description-list-stack.item-separators dl div{border-bottom:1px solid var(--watt-color-neutral-grey-300);padding-bottom:var(--watt-space-m)}\n"] }]
|
|
104
|
+
}], ctorParameters: () => [] });
|
|
105
|
+
|
|
106
|
+
//#region License
|
|
107
|
+
/**
|
|
108
|
+
* @license
|
|
109
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
110
|
+
*
|
|
111
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
112
|
+
* you may not use this file except in compliance with the License.
|
|
113
|
+
* You may obtain a copy of the License at
|
|
114
|
+
*
|
|
115
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
116
|
+
*
|
|
117
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
118
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
119
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
120
|
+
* See the License for the specific language governing permissions and
|
|
121
|
+
* limitations under the License.
|
|
122
|
+
*/
|
|
123
|
+
//#endregion
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Generated bundle index. Do not edit.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
export { WattDescriptionListComponent, WattDescriptionListItemComponent };
|
|
130
|
+
//# sourceMappingURL=energinet-watt-description-list.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"energinet-watt-description-list.mjs","sources":["../../../libs/watt/package/description-list/watt-description-list-item.component.ts","../../../libs/watt/package/description-list/watt-description-list.component.ts","../../../libs/watt/package/description-list/index.ts","../../../libs/watt/package/description-list/energinet-watt-description-list.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { ChangeDetectionStrategy, Component, input, TemplateRef, viewChild } from '@angular/core';\nimport { NgClass } from '@angular/common';\n\n@Component({\n imports: [NgClass],\n selector: 'watt-description-list-item',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [NgClass],\n template: `<ng-template #templateRef\n ><div [ngClass]=\"{ 'force-new-row': forceNewRow() }\">\n <dt class=\"watt-label watt-on-light--high-emphasis\">{{ label() }}</dt>\n <dd class=\"watt-text-s\">{{ value() }}<ng-content /></dd></div\n ></ng-template>`,\n})\nexport class WattDescriptionListItemComponent<T> {\n templateRef = viewChild.required<TemplateRef<unknown | null>>('templateRef');\n label = input<string>('');\n value = input<T | null>(null);\n forceNewRow = input(false);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n contentChildren,\n effect,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { WattDescriptionListItemComponent } from './watt-description-list-item.component';\n/**\n * Usage:\n * `import { WattDescriptionListComponent } from '@energinet-datahub/watt/description-list';`\n */\n@Component({\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-description-list',\n styleUrls: ['./watt-description-list.component.scss'],\n imports: [NgTemplateOutlet],\n template: `<dl>\n @for (item of descriptionItems(); track item) {\n <ng-container *ngTemplateOutlet=\"item.templateRef()\" />\n }\n </dl>`,\n hostDirectives: [NgClass],\n host: {\n '[style.--watt-description-list-groups-per-row]': 'groupsPerRow()',\n '[class]': 'descriptionVariant()',\n },\n})\nclass WattDescriptionListComponent<T> {\n private ngClass = inject(NgClass);\n descriptionItems = contentChildren(WattDescriptionListItemComponent<T>);\n variant = input<'flow' | 'stack'>('flow');\n descriptionVariant = computed(() => `watt-description-list-${this.variant()}`);\n groupsPerRow = input<number>(3);\n itemSeparators = input(true);\n\n constructor() {\n effect(() => {\n this.ngClass.ngClass = {\n [`item-separators`]: this.itemSeparators(),\n };\n });\n }\n}\n\nexport { WattDescriptionListItemComponent, WattDescriptionListComponent };\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport {\n WattDescriptionListComponent,\n WattDescriptionListItemComponent,\n} from './watt-description-list.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,gCAAgC,CAAA;AAC3C,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAA8B,aAAa,CAAC;AAC5E,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC;AACzB,IAAA,KAAK,GAAG,KAAK,CAAW,IAAI,CAAC;AAC7B,IAAA,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC;uGAJf,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,E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