@energinet/watt 4.3.1 → 4.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/description-list/index.d.ts +3 -6
- package/fesm2022/energinet-watt-description-list.mjs +11 -21
- package/fesm2022/energinet-watt-description-list.mjs.map +1 -1
- package/fesm2022/energinet-watt-dropdown.mjs +2 -4
- package/fesm2022/energinet-watt-dropdown.mjs.map +1 -1
- package/fesm2022/energinet-watt-field.mjs +1 -1
- package/fesm2022/energinet-watt-field.mjs.map +1 -1
- package/fesm2022/energinet-watt-modal.mjs +3 -4
- package/fesm2022/energinet-watt-modal.mjs.map +1 -1
- package/fesm2022/energinet-watt-picker-__shared.mjs +39 -68
- package/fesm2022/energinet-watt-picker-__shared.mjs.map +1 -1
- package/fesm2022/energinet-watt-picker-datepicker.mjs +13 -17
- package/fesm2022/energinet-watt-picker-datepicker.mjs.map +1 -1
- package/fesm2022/energinet-watt-picker-timepicker.mjs +19 -19
- package/fesm2022/energinet-watt-picker-timepicker.mjs.map +1 -1
- package/fesm2022/energinet-watt-table.mjs +3 -4
- package/fesm2022/energinet-watt-table.mjs.map +1 -1
- package/fesm2022/energinet-watt-utils-resize-observer.mjs +5 -7
- package/fesm2022/energinet-watt-utils-resize-observer.mjs.map +1 -1
- package/package.json +1 -1
- package/picker/__shared/index.d.ts +12 -21
- package/picker/datepicker/index.d.ts +2 -4
- package/picker/timepicker/index.d.ts +2 -3
- package/utils/resize-observer/index.d.ts +3 -20
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, ChangeDetectorRef,
|
|
2
|
+
import { inject, ElementRef, ChangeDetectorRef, input, booleanAttribute, viewChild, signal, computed, linkedSignal, effect, ViewEncapsulation, Component, Injectable } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/material/input';
|
|
4
4
|
import { MatInputModule } from '@angular/material/input';
|
|
5
5
|
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
@@ -44,7 +44,6 @@ class WattDatepickerComponent extends WattPickerBase {
|
|
|
44
44
|
changeDetectionRef = inject(ChangeDetectorRef);
|
|
45
45
|
ngControl = inject(NgControl, { optional: true, self: true });
|
|
46
46
|
localeService = inject(WattLocaleService);
|
|
47
|
-
locale = inject(LOCALE_ID);
|
|
48
47
|
max = input(...(ngDevMode ? [undefined, { debugName: "max" }] : []));
|
|
49
48
|
min = input(...(ngDevMode ? [undefined, { debugName: "min" }] : []));
|
|
50
49
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
@@ -61,9 +60,8 @@ class WattDatepickerComponent extends WattPickerBase {
|
|
|
61
60
|
input = viewChild('dateInput', ...(ngDevMode ? [{ debugName: "input" }] : []));
|
|
62
61
|
endInput = viewChild('endDateInput', ...(ngDevMode ? [{ debugName: "endInput" }] : []));
|
|
63
62
|
startInput = viewChild('startDateInput', ...(ngDevMode ? [{ debugName: "startInput" }] : []));
|
|
64
|
-
_placeholder = this.getPlaceholderByLocale(this.locale);
|
|
65
63
|
rangeSeparator = ' - ';
|
|
66
|
-
rangePlaceholder =
|
|
64
|
+
rangePlaceholder = signal('', ...(ngDevMode ? [{ debugName: "rangePlaceholder" }] : []));
|
|
67
65
|
inputMask = computed(() => maskitoDateOptionsGenerator({
|
|
68
66
|
mode: 'dd/mm/yyyy',
|
|
69
67
|
separator: '-',
|
|
@@ -76,11 +74,9 @@ class WattDatepickerComponent extends WattPickerBase {
|
|
|
76
74
|
max: this.max(),
|
|
77
75
|
min: this.min(),
|
|
78
76
|
}), ...(ngDevMode ? [{ debugName: "rangeInputMask" }] : []));
|
|
79
|
-
getPlaceholderByLocale(locale)
|
|
80
|
-
return locale === 'da' ? 'dd-mm-åååå' : 'dd-mm-yyyy';
|
|
81
|
-
}
|
|
77
|
+
getPlaceholderByLocale = (locale) => locale === 'da' ? 'dd-mm-åååå' : 'dd-mm-yyyy';
|
|
82
78
|
getRangePlaceholder() {
|
|
83
|
-
return this.placeholder + this.rangeSeparator + this.placeholder;
|
|
79
|
+
return this.placeholder() + this.rangeSeparator + this.placeholder();
|
|
84
80
|
}
|
|
85
81
|
isPrevDayButtonDisabled = linkedSignal(() => this.isPrevDayBeforeOrEqualToMinDate(), ...(ngDevMode ? [{ debugName: "isPrevDayButtonDisabled" }] : []));
|
|
86
82
|
isNextDayButtonDisabled = linkedSignal(() => this.isNextDayAfterOrEqualToMaxDate(), ...(ngDevMode ? [{ debugName: "isNextDayButtonDisabled" }] : []));
|
|
@@ -88,8 +84,8 @@ class WattDatepickerComponent extends WattPickerBase {
|
|
|
88
84
|
super(`watt-datepicker-${WattDatepickerComponent.nextId++}`);
|
|
89
85
|
effect(() => {
|
|
90
86
|
const locale = this.localeService.locale();
|
|
91
|
-
this.placeholder
|
|
92
|
-
this.rangePlaceholder
|
|
87
|
+
this.placeholder.set(this.getPlaceholderByLocale(locale));
|
|
88
|
+
this.rangePlaceholder.set(this.getRangePlaceholder());
|
|
93
89
|
});
|
|
94
90
|
effect(() => {
|
|
95
91
|
this.rangeMonthOnlyMode();
|
|
@@ -119,12 +115,12 @@ class WattDatepickerComponent extends WattPickerBase {
|
|
|
119
115
|
}
|
|
120
116
|
}
|
|
121
117
|
inputChanged(value) {
|
|
122
|
-
const dateString = value.slice(0, this.placeholder.length);
|
|
118
|
+
const dateString = value.slice(0, this.placeholder().length);
|
|
123
119
|
if (dateString.length === 0) {
|
|
124
120
|
this.control?.setValue(null);
|
|
125
121
|
return;
|
|
126
122
|
}
|
|
127
|
-
if (dateString.length !== this.placeholder.length) {
|
|
123
|
+
if (dateString.length !== this.placeholder().length) {
|
|
128
124
|
return;
|
|
129
125
|
}
|
|
130
126
|
const date = this.parseDateShortFormat(dateString);
|
|
@@ -173,16 +169,16 @@ class WattDatepickerComponent extends WattPickerBase {
|
|
|
173
169
|
actualInput.nativeElement.dispatchEvent(new InputEvent('input'));
|
|
174
170
|
}
|
|
175
171
|
rangeInputChanged(value) {
|
|
176
|
-
const startDateString = value.slice(0, this.placeholder.length);
|
|
172
|
+
const startDateString = value.slice(0, this.placeholder().length);
|
|
177
173
|
if (startDateString.length === 0) {
|
|
178
174
|
this.control?.setValue(null);
|
|
179
175
|
return;
|
|
180
176
|
}
|
|
181
|
-
if (startDateString.length !== this.placeholder.length) {
|
|
177
|
+
if (startDateString.length !== this.placeholder().length) {
|
|
182
178
|
return;
|
|
183
179
|
}
|
|
184
180
|
const start = this.parseDateShortFormat(startDateString);
|
|
185
|
-
const endDateString = value.slice(this.placeholder.length + this.rangeSeparator.length);
|
|
181
|
+
const endDateString = value.slice(this.placeholder().length + this.rangeSeparator.length);
|
|
186
182
|
let end = this.setEndDateToDanishTimeZone(endDateString);
|
|
187
183
|
if (end !== null) {
|
|
188
184
|
end = this.setToEndOfDay(end);
|
|
@@ -290,7 +286,7 @@ class WattDatepickerComponent extends WattPickerBase {
|
|
|
290
286
|
return maybeDateInDanishTimeZone;
|
|
291
287
|
}
|
|
292
288
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattDatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
293
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattDatepickerComponent, isStandalone: true, selector: "watt-datepicker", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, rangeMonthOnlyMode: { classPropertyName: "rangeMonthOnlyMode", publicName: "rangeMonthOnlyMode", isSignal: true, isRequired: false, transformFunction: null }, startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, dateClass: { classPropertyName: "dateClass", publicName: "dateClass", isSignal: true, isRequired: false, transformFunction: null }, canStepThroughDays: { classPropertyName: "canStepThroughDays", publicName: "canStepThroughDays", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: WattDatepickerComponent }], viewQueries: [{ propertyName: "matEndDate", first: true, predicate: MatEndDate, descendants: true, isSignal: true }, { propertyName: "matStartDate", first: true, predicate: MatStartDate, descendants: true, isSignal: true }, { propertyName: "matDateRangeInput", first: true, predicate: MatDateRangeInput, descendants: true, isSignal: true }, { propertyName: "matDatepickerInput", first: true, predicate: MatDatepickerInput, descendants: true, isSignal: true }, { propertyName: "matDateRangePicker", first: true, predicate: MatDateRangePicker, descendants: true, isSignal: true }, { propertyName: "actualInput", first: true, predicate: ["actualInput"], descendants: true, isSignal: true }, { propertyName: "input", first: true, predicate: ["dateInput"], descendants: true, isSignal: true }, { propertyName: "endInput", first: true, predicate: ["endDateInput"], descendants: true, isSignal: true }, { propertyName: "startInput", first: true, predicate: ["startDateInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field [control]=\"control\" [label]=\"label()\">\n @if (range) {\n <mat-date-range-input\n [disabled]=\"disabled\"\n [rangePicker]=\"rangeDatepicker\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <input\n inert\n aria-label=\"start-date-input\"\n matStartDate\n #startDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n\n <input\n inert\n aria-label=\"end-date-input\"\n matEndDate\n #endDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n </mat-date-range-input>\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"rangeInputMask()\"\n [placeholder]=\"rangePlaceholder\"\n (maskApplied)=\"rangeInputChanged($event)\"\n />\n\n <watt-button\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled\"\n [attr.aria-pressed]=\"false\"\n (click)=\"rangeDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-date-range-picker\n [panelClass]=\"rangeMonthOnlyMode() ? 'watt-datepicker-range__panel--month-only' : ''\"\n [startView]=\"rangeMonthOnlyMode() ? 'multi-year' : 'month'\"\n [startAt]=\"startAt()\"\n (monthSelected)=\"onMonthSelected($event)\"\n (closed)=\"rangePickerClosed()\"\n #rangeDatepicker\n />\n } @else {\n <input\n inert\n matInput\n tabindex=\"-1\"\n aria-label=\"date-input\"\n #dateInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n [disabled]=\"disabled\"\n [min]=\"min()\"\n [max]=\"max()\"\n [matDatepicker]=\"singleDatepicker\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"inputMask()\"\n [placeholder]=\"placeholder\"\n (maskApplied)=\"inputChanged($event)\"\n />\n\n <watt-button\n wattSuffix\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled\"\n (click)=\"singleDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-datepicker\n #singleDatepicker\n panelClass=\"watt-datepicker-single__panel\"\n [dateClass]=\"dateClass()\"\n [startAt]=\"startAt()\"\n (closed)=\"datepickerClosed()\"\n />\n }\n\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n <ng-content ngProjectAs=\"watt-field-warning\" select=\"watt-field-warning\" />\n</watt-field>\n\n@if (!range && canStepThroughDays()) {\n <span\n class=\"watt-datepicker-single__step-through\"\n [class.watt-datepicker-single__has-label]=\"!!label()\"\n >\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevDay()\"\n [disabled]=\"disabled || isPrevDayButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextDay()\"\n [disabled]=\"disabled || isNextDayButtonDisabled()\"\n />\n </span>\n}\n", styles: ["watt-datepicker{display:flex;align-items:center;width:100%}watt-datepicker watt-button[variant=icon]{margin-left:auto}watt-datepicker watt-button[variant=icon] .watt-button--icon{height:42px}watt-datepicker mat-datepicker,watt-datepicker mat-date-range-picker{display:none}watt-datepicker input.mat-date-range-input-inner,watt-datepicker input.mat-mdc-input-element,watt-datepicker .mat-date-range-input-mirror,watt-datepicker input.mask-input{font-family:Droid Sans Mono,monospace}watt-datepicker input.mat-date-range-input-inner,watt-datepicker input.mat-mdc-input-element,watt-datepicker input.mask-input{border:none;caret-color:var(--watt-color-neutral-black);letter-spacing:-.03em;-webkit-background-clip:text;-moz-background-clip:text;background-clip:text;color:transparent}watt-datepicker input.mask-input{color:#000}watt-datepicker input.mask-input{position:absolute;min-width:100%;padding:2px 1px}watt-datepicker input.mask-input:focus-visible{outline:none}watt-datepicker .mat-date-range-input-container{align-items:initial}watt-datepicker .mat-date-range-input-start-wrapper,watt-datepicker .mat-date-range-input-end-wrapper{max-width:calc(50% - var(--watt-space-s));overflow:visible;position:relative}watt-datepicker .mat-date-range-input-separator{display:flex;align-items:center}watt-datepicker .mat-date-range-input-separator-hidden,watt-datepicker .mat-date-range-input-separator{opacity:0!important}watt-datepicker .mat-date-range-input-inner::-webkit-input-placeholder{color:var(--watt-color-neutral-grey-500)!important;-webkit-text-fill-color:var(--watt-color-neutral-grey-500)}watt-datepicker watt-button .mat-button{background:transparent}watt-datepicker:has(.watt-datepicker-single__step-through){align-items:flex-start}watt-datepicker:has(.watt-datepicker-single__step-through) .watt-datepicker-single__step-through{display:flex;margin-top:1px}watt-datepicker:has(.watt-datepicker-single__has-label) .watt-datepicker-single__step-through{margin-top:28px}.watt-datepicker-range__panel--month-only .mat-calendar-period-button{pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i2.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i2.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i2.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i2.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattPlaceholderMaskComponent, selector: "watt-placeholder-mask", inputs: ["primaryInputElement", "secondaryInputElement", "mask", "placeholder"], outputs: ["maskApplied"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
289
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattDatepickerComponent, isStandalone: true, selector: "watt-datepicker", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, rangeMonthOnlyMode: { classPropertyName: "rangeMonthOnlyMode", publicName: "rangeMonthOnlyMode", isSignal: true, isRequired: false, transformFunction: null }, startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, dateClass: { classPropertyName: "dateClass", publicName: "dateClass", isSignal: true, isRequired: false, transformFunction: null }, canStepThroughDays: { classPropertyName: "canStepThroughDays", publicName: "canStepThroughDays", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: WattDatepickerComponent }], viewQueries: [{ propertyName: "matEndDate", first: true, predicate: MatEndDate, descendants: true, isSignal: true }, { propertyName: "matStartDate", first: true, predicate: MatStartDate, descendants: true, isSignal: true }, { propertyName: "matDateRangeInput", first: true, predicate: MatDateRangeInput, descendants: true, isSignal: true }, { propertyName: "matDatepickerInput", first: true, predicate: MatDatepickerInput, descendants: true, isSignal: true }, { propertyName: "matDateRangePicker", first: true, predicate: MatDateRangePicker, descendants: true, isSignal: true }, { propertyName: "actualInput", first: true, predicate: ["actualInput"], descendants: true, isSignal: true }, { propertyName: "input", first: true, predicate: ["dateInput"], descendants: true, isSignal: true }, { propertyName: "endInput", first: true, predicate: ["endDateInput"], descendants: true, isSignal: true }, { propertyName: "startInput", first: true, predicate: ["startDateInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field [control]=\"control\" [label]=\"label()\">\n @if (range()) {\n <mat-date-range-input\n [disabled]=\"disabled()\"\n [rangePicker]=\"rangeDatepicker\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <input\n inert\n aria-label=\"start-date-input\"\n matStartDate\n #startDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n\n <input\n inert\n aria-label=\"end-date-input\"\n matEndDate\n #endDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n </mat-date-range-input>\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"rangeInputMask()\"\n [placeholder]=\"rangePlaceholder()\"\n (maskApplied)=\"rangeInputChanged($event)\"\n />\n\n <watt-button\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"false\"\n (click)=\"rangeDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-date-range-picker\n [panelClass]=\"rangeMonthOnlyMode() ? 'watt-datepicker-range__panel--month-only' : ''\"\n [startView]=\"rangeMonthOnlyMode() ? 'multi-year' : 'month'\"\n [startAt]=\"startAt()\"\n (monthSelected)=\"onMonthSelected($event)\"\n (closed)=\"rangePickerClosed()\"\n #rangeDatepicker\n />\n } @else {\n <input\n inert\n matInput\n tabindex=\"-1\"\n aria-label=\"date-input\"\n #dateInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n [disabled]=\"disabled()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [matDatepicker]=\"singleDatepicker\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"inputMask()\"\n [placeholder]=\"placeholder()\"\n (maskApplied)=\"inputChanged($event)\"\n />\n\n <watt-button\n wattSuffix\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled()\"\n (click)=\"singleDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-datepicker\n #singleDatepicker\n panelClass=\"watt-datepicker-single__panel\"\n [dateClass]=\"dateClass()\"\n [startAt]=\"startAt()\"\n (closed)=\"datepickerClosed()\"\n />\n }\n\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n <ng-content ngProjectAs=\"watt-field-warning\" select=\"watt-field-warning\" />\n</watt-field>\n\n@if (!range() && canStepThroughDays()) {\n <span\n class=\"watt-datepicker-single__step-through\"\n [class.watt-datepicker-single__has-label]=\"!!label()\"\n >\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevDay()\"\n [disabled]=\"disabled() || isPrevDayButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextDay()\"\n [disabled]=\"disabled() || isNextDayButtonDisabled()\"\n />\n </span>\n}\n", styles: ["watt-datepicker{display:flex;align-items:center;width:100%}watt-datepicker watt-button[variant=icon]{margin-left:auto}watt-datepicker watt-button[variant=icon] .watt-button--icon{height:42px}watt-datepicker mat-datepicker,watt-datepicker mat-date-range-picker{display:none}watt-datepicker input.mat-date-range-input-inner,watt-datepicker input.mat-mdc-input-element,watt-datepicker .mat-date-range-input-mirror,watt-datepicker input.mask-input{font-family:Droid Sans Mono,monospace}watt-datepicker input.mat-date-range-input-inner,watt-datepicker input.mat-mdc-input-element,watt-datepicker input.mask-input{border:none;caret-color:var(--watt-color-neutral-black);letter-spacing:-.03em;-webkit-background-clip:text;-moz-background-clip:text;background-clip:text;color:transparent}watt-datepicker input.mask-input{color:#000}watt-datepicker input.mask-input{position:absolute;min-width:100%;padding:2px 1px}watt-datepicker input.mask-input:focus-visible{outline:none}watt-datepicker .mat-date-range-input-container{align-items:initial}watt-datepicker .mat-date-range-input-start-wrapper,watt-datepicker .mat-date-range-input-end-wrapper{max-width:calc(50% - var(--watt-space-s));overflow:visible;position:relative}watt-datepicker .mat-date-range-input-separator{display:flex;align-items:center}watt-datepicker .mat-date-range-input-separator-hidden,watt-datepicker .mat-date-range-input-separator{opacity:0!important}watt-datepicker .mat-date-range-input-inner::-webkit-input-placeholder{color:var(--watt-color-neutral-grey-500)!important;-webkit-text-fill-color:var(--watt-color-neutral-grey-500)}watt-datepicker watt-button .mat-button{background:transparent}watt-datepicker:has(.watt-datepicker-single__step-through){align-items:flex-start}watt-datepicker:has(.watt-datepicker-single__step-through) .watt-datepicker-single__step-through{display:flex;margin-top:1px}watt-datepicker:has(.watt-datepicker-single__has-label) .watt-datepicker-single__step-through{margin-top:28px}.watt-datepicker-range__panel--month-only .mat-calendar-period-button{pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i2.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i2.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i2.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i2.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattPlaceholderMaskComponent, selector: "watt-placeholder-mask", inputs: ["primaryInputElement", "secondaryInputElement", "mask", "placeholder"], outputs: ["maskApplied"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
294
290
|
}
|
|
295
291
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattDatepickerComponent, decorators: [{
|
|
296
292
|
type: Component,
|
|
@@ -300,7 +296,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
300
296
|
WattFieldComponent,
|
|
301
297
|
WattButtonComponent,
|
|
302
298
|
WattPlaceholderMaskComponent,
|
|
303
|
-
], template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field [control]=\"control\" [label]=\"label()\">\n @if (range) {\n <mat-date-range-input\n [disabled]=\"disabled\"\n [rangePicker]=\"rangeDatepicker\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <input\n inert\n aria-label=\"start-date-input\"\n matStartDate\n #startDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n\n <input\n inert\n aria-label=\"end-date-input\"\n matEndDate\n #endDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n </mat-date-range-input>\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"rangeInputMask()\"\n [placeholder]=\"rangePlaceholder\"\n (maskApplied)=\"rangeInputChanged($event)\"\n />\n\n <watt-button\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled\"\n [attr.aria-pressed]=\"false\"\n (click)=\"rangeDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-date-range-picker\n [panelClass]=\"rangeMonthOnlyMode() ? 'watt-datepicker-range__panel--month-only' : ''\"\n [startView]=\"rangeMonthOnlyMode() ? 'multi-year' : 'month'\"\n [startAt]=\"startAt()\"\n (monthSelected)=\"onMonthSelected($event)\"\n (closed)=\"rangePickerClosed()\"\n #rangeDatepicker\n />\n } @else {\n <input\n inert\n matInput\n tabindex=\"-1\"\n aria-label=\"date-input\"\n #dateInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n [disabled]=\"disabled\"\n [min]=\"min()\"\n [max]=\"max()\"\n [matDatepicker]=\"singleDatepicker\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"inputMask()\"\n [placeholder]=\"placeholder\"\n (maskApplied)=\"inputChanged($event)\"\n />\n\n <watt-button\n wattSuffix\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled\"\n (click)=\"singleDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-datepicker\n #singleDatepicker\n panelClass=\"watt-datepicker-single__panel\"\n [dateClass]=\"dateClass()\"\n [startAt]=\"startAt()\"\n (closed)=\"datepickerClosed()\"\n />\n }\n\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n <ng-content ngProjectAs=\"watt-field-warning\" select=\"watt-field-warning\" />\n</watt-field>\n\n@if (!range && canStepThroughDays()) {\n <span\n class=\"watt-datepicker-single__step-through\"\n [class.watt-datepicker-single__has-label]=\"!!label()\"\n >\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevDay()\"\n [disabled]=\"disabled || isPrevDayButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextDay()\"\n [disabled]=\"disabled || isNextDayButtonDisabled()\"\n />\n </span>\n}\n", styles: ["watt-datepicker{display:flex;align-items:center;width:100%}watt-datepicker watt-button[variant=icon]{margin-left:auto}watt-datepicker watt-button[variant=icon] .watt-button--icon{height:42px}watt-datepicker mat-datepicker,watt-datepicker mat-date-range-picker{display:none}watt-datepicker input.mat-date-range-input-inner,watt-datepicker input.mat-mdc-input-element,watt-datepicker .mat-date-range-input-mirror,watt-datepicker input.mask-input{font-family:Droid Sans Mono,monospace}watt-datepicker input.mat-date-range-input-inner,watt-datepicker input.mat-mdc-input-element,watt-datepicker input.mask-input{border:none;caret-color:var(--watt-color-neutral-black);letter-spacing:-.03em;-webkit-background-clip:text;-moz-background-clip:text;background-clip:text;color:transparent}watt-datepicker input.mask-input{color:#000}watt-datepicker input.mask-input{position:absolute;min-width:100%;padding:2px 1px}watt-datepicker input.mask-input:focus-visible{outline:none}watt-datepicker .mat-date-range-input-container{align-items:initial}watt-datepicker .mat-date-range-input-start-wrapper,watt-datepicker .mat-date-range-input-end-wrapper{max-width:calc(50% - var(--watt-space-s));overflow:visible;position:relative}watt-datepicker .mat-date-range-input-separator{display:flex;align-items:center}watt-datepicker .mat-date-range-input-separator-hidden,watt-datepicker .mat-date-range-input-separator{opacity:0!important}watt-datepicker .mat-date-range-input-inner::-webkit-input-placeholder{color:var(--watt-color-neutral-grey-500)!important;-webkit-text-fill-color:var(--watt-color-neutral-grey-500)}watt-datepicker watt-button .mat-button{background:transparent}watt-datepicker:has(.watt-datepicker-single__step-through){align-items:flex-start}watt-datepicker:has(.watt-datepicker-single__step-through) .watt-datepicker-single__step-through{display:flex;margin-top:1px}watt-datepicker:has(.watt-datepicker-single__has-label) .watt-datepicker-single__step-through{margin-top:28px}.watt-datepicker-range__panel--month-only .mat-calendar-period-button{pointer-events:none}\n"] }]
|
|
299
|
+
], template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field [control]=\"control\" [label]=\"label()\">\n @if (range()) {\n <mat-date-range-input\n [disabled]=\"disabled()\"\n [rangePicker]=\"rangeDatepicker\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <input\n inert\n aria-label=\"start-date-input\"\n matStartDate\n #startDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n\n <input\n inert\n aria-label=\"end-date-input\"\n matEndDate\n #endDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n </mat-date-range-input>\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"rangeInputMask()\"\n [placeholder]=\"rangePlaceholder()\"\n (maskApplied)=\"rangeInputChanged($event)\"\n />\n\n <watt-button\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"false\"\n (click)=\"rangeDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-date-range-picker\n [panelClass]=\"rangeMonthOnlyMode() ? 'watt-datepicker-range__panel--month-only' : ''\"\n [startView]=\"rangeMonthOnlyMode() ? 'multi-year' : 'month'\"\n [startAt]=\"startAt()\"\n (monthSelected)=\"onMonthSelected($event)\"\n (closed)=\"rangePickerClosed()\"\n #rangeDatepicker\n />\n } @else {\n <input\n inert\n matInput\n tabindex=\"-1\"\n aria-label=\"date-input\"\n #dateInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n [disabled]=\"disabled()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [matDatepicker]=\"singleDatepicker\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"inputMask()\"\n [placeholder]=\"placeholder()\"\n (maskApplied)=\"inputChanged($event)\"\n />\n\n <watt-button\n wattSuffix\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled()\"\n (click)=\"singleDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-datepicker\n #singleDatepicker\n panelClass=\"watt-datepicker-single__panel\"\n [dateClass]=\"dateClass()\"\n [startAt]=\"startAt()\"\n (closed)=\"datepickerClosed()\"\n />\n }\n\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n <ng-content ngProjectAs=\"watt-field-warning\" select=\"watt-field-warning\" />\n</watt-field>\n\n@if (!range() && canStepThroughDays()) {\n <span\n class=\"watt-datepicker-single__step-through\"\n [class.watt-datepicker-single__has-label]=\"!!label()\"\n >\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevDay()\"\n [disabled]=\"disabled() || isPrevDayButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextDay()\"\n [disabled]=\"disabled() || isNextDayButtonDisabled()\"\n />\n </span>\n}\n", styles: ["watt-datepicker{display:flex;align-items:center;width:100%}watt-datepicker watt-button[variant=icon]{margin-left:auto}watt-datepicker watt-button[variant=icon] .watt-button--icon{height:42px}watt-datepicker mat-datepicker,watt-datepicker mat-date-range-picker{display:none}watt-datepicker input.mat-date-range-input-inner,watt-datepicker input.mat-mdc-input-element,watt-datepicker .mat-date-range-input-mirror,watt-datepicker input.mask-input{font-family:Droid Sans Mono,monospace}watt-datepicker input.mat-date-range-input-inner,watt-datepicker input.mat-mdc-input-element,watt-datepicker input.mask-input{border:none;caret-color:var(--watt-color-neutral-black);letter-spacing:-.03em;-webkit-background-clip:text;-moz-background-clip:text;background-clip:text;color:transparent}watt-datepicker input.mask-input{color:#000}watt-datepicker input.mask-input{position:absolute;min-width:100%;padding:2px 1px}watt-datepicker input.mask-input:focus-visible{outline:none}watt-datepicker .mat-date-range-input-container{align-items:initial}watt-datepicker .mat-date-range-input-start-wrapper,watt-datepicker .mat-date-range-input-end-wrapper{max-width:calc(50% - var(--watt-space-s));overflow:visible;position:relative}watt-datepicker .mat-date-range-input-separator{display:flex;align-items:center}watt-datepicker .mat-date-range-input-separator-hidden,watt-datepicker .mat-date-range-input-separator{opacity:0!important}watt-datepicker .mat-date-range-input-inner::-webkit-input-placeholder{color:var(--watt-color-neutral-grey-500)!important;-webkit-text-fill-color:var(--watt-color-neutral-grey-500)}watt-datepicker watt-button .mat-button{background:transparent}watt-datepicker:has(.watt-datepicker-single__step-through){align-items:flex-start}watt-datepicker:has(.watt-datepicker-single__step-through) .watt-datepicker-single__step-through{display:flex;margin-top:1px}watt-datepicker:has(.watt-datepicker-single__has-label) .watt-datepicker-single__step-through{margin-top:28px}.watt-datepicker-range__panel--month-only .mat-calendar-period-button{pointer-events:none}\n"] }]
|
|
304
300
|
}], ctorParameters: () => [], propDecorators: { max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], rangeMonthOnlyMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeMonthOnlyMode", required: false }] }], startAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "startAt", required: false }] }], dateClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateClass", required: false }] }], canStepThroughDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "canStepThroughDays", required: false }] }], matEndDate: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatEndDate), { isSignal: true }] }], matStartDate: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatStartDate), { isSignal: true }] }], matDateRangeInput: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatDateRangeInput), { isSignal: true }] }], matDatepickerInput: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatDatepickerInput), { isSignal: true }] }], matDateRangePicker: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatDateRangePicker), { isSignal: true }] }], actualInput: [{ type: i0.ViewChild, args: ['actualInput', { isSignal: true }] }], input: [{ type: i0.ViewChild, args: ['dateInput', { isSignal: true }] }], endInput: [{ type: i0.ViewChild, args: ['endDateInput', { isSignal: true }] }], startInput: [{ type: i0.ViewChild, args: ['startDateInput', { isSignal: true }] }] } });
|
|
305
301
|
|
|
306
302
|
//#region License
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-picker-datepicker.mjs","sources":["../../../libs/watt/package/picker/datepicker/watt-datepicker.component.ts","../../../libs/watt/package/picker/datepicker/watt-datepicker.component.html","../../../libs/watt/package/picker/datepicker/watt-datepicker-intl.service.ts","../../../libs/watt/package/picker/datepicker/index.ts","../../../libs/watt/package/picker/datepicker/energinet-watt-picker-datepicker.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 input,\n effect,\n inject,\n computed,\n Component,\n LOCALE_ID,\n viewChild,\n ElementRef,\n linkedSignal,\n AfterViewInit,\n booleanAttribute,\n ChangeDetectorRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { MatInputModule } from '@angular/material/input';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { AbstractControl, NgControl, Validator } from '@angular/forms';\n\nimport {\n MatEndDate,\n MatStartDate,\n MatDateRangeInput,\n MatDateRangePicker,\n MatDatepickerInput,\n MatDatepickerModule,\n MatCalendarCellClassFunction,\n} from '@angular/material/datepicker';\n\nimport { maskitoDateOptionsGenerator, maskitoDateRangeOptionsGenerator } from '@maskito/kit';\n\nimport {\n dayjs,\n WattRange,\n WattDateRange,\n WattLocaleService,\n WattSupportedLocales,\n} from '@energinet/watt/core/date';\n\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\nimport {\n WattPickerBase,\n WattPickerValue,\n WattPlaceholderMaskComponent,\n} from '@energinet/watt/picker/__shared';\n\nconst dateShortFormat = 'DD-MM-YYYY';\nexport const danishTimeZoneIdentifier = 'Europe/Copenhagen';\n\n/**\n * Usage:\n * `import { WattDatepickerComponent } from '@energinet/watt/datepicker';`\n *\n * IMPORTANT:\n * The styling is calculated based on our monospaced font.\n */\n@Component({\n selector: 'watt-datepicker',\n templateUrl: './watt-datepicker.component.html',\n styleUrls: ['./watt-datepicker.component.scss'],\n providers: [{ provide: MatFormFieldControl, useExisting: WattDatepickerComponent }],\n encapsulation: ViewEncapsulation.None,\n imports: [\n MatInputModule,\n MatDatepickerModule,\n\n WattFieldComponent,\n WattButtonComponent,\n WattPlaceholderMaskComponent,\n ],\n})\nexport class WattDatepickerComponent extends WattPickerBase implements Validator, AfterViewInit {\n protected override elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n protected override changeDetectionRef = inject(ChangeDetectorRef);\n protected override ngControl = inject(NgControl, { optional: true, self: true });\n private localeService = inject(WattLocaleService);\n private locale = inject<WattSupportedLocales>(LOCALE_ID);\n\n max = input<Date>();\n min = input<Date>();\n label = input<string>('');\n rangeMonthOnlyMode = input(false);\n startAt = input<Date | null>(null);\n dateClass = input<MatCalendarCellClassFunction<Date>>(() => '');\n canStepThroughDays = input(false, { transform: booleanAttribute });\n\n matEndDate = viewChild<MatEndDate<Date | null>>(MatEndDate);\n matStartDate = viewChild<MatStartDate<Date | null>>(MatStartDate);\n matDateRangeInput = viewChild<MatDateRangeInput<Date | null>>(MatDateRangeInput);\n matDatepickerInput = viewChild<MatDatepickerInput<Date | null>>(MatDatepickerInput);\n matDateRangePicker = viewChild<MatDateRangePicker<Date | null>>(MatDateRangePicker);\n\n actualInput = viewChild<ElementRef<HTMLInputElement>>('actualInput');\n override input = viewChild<ElementRef<HTMLInputElement>>('dateInput');\n override endInput = viewChild<ElementRef<HTMLInputElement>>('endDateInput');\n override startInput = viewChild<ElementRef<HTMLInputElement>>('startDateInput');\n\n protected _placeholder = this.getPlaceholderByLocale(this.locale);\n\n rangeSeparator = ' - ';\n\n rangePlaceholder = this.getRangePlaceholder();\n\n inputMask = computed(() =>\n maskitoDateOptionsGenerator({\n mode: 'dd/mm/yyyy',\n separator: '-',\n max: this.max(),\n min: this.min(),\n })\n );\n\n rangeInputMask = computed(() =>\n maskitoDateRangeOptionsGenerator({\n mode: 'dd/mm/yyyy',\n dateSeparator: '-',\n max: this.max(),\n min: this.min(),\n })\n );\n\n getPlaceholderByLocale(locale: WattSupportedLocales): string {\n return locale === 'da' ? 'dd-mm-åååå' : 'dd-mm-yyyy';\n }\n\n getRangePlaceholder(): string {\n return this.placeholder + this.rangeSeparator + this.placeholder;\n }\n\n isPrevDayButtonDisabled = linkedSignal(() => this.isPrevDayBeforeOrEqualToMinDate());\n isNextDayButtonDisabled = linkedSignal(() => this.isNextDayAfterOrEqualToMaxDate());\n\n constructor() {\n super(`watt-datepicker-${WattDatepickerComponent.nextId++}`);\n\n effect(() => {\n const locale = this.localeService.locale();\n this.placeholder = this.getPlaceholderByLocale(locale);\n this.rangePlaceholder = this.getRangePlaceholder();\n });\n\n effect(() => {\n this.rangeMonthOnlyMode();\n this.ngControl?.control?.updateValueAndValidity();\n });\n }\n\n override ngAfterViewInit() {\n super.ngAfterViewInit();\n\n this.ngControl?.control?.addValidators(this.validate);\n }\n\n validate = ({ value }: AbstractControl<WattRange<string>>) => {\n if (!value?.end || !value?.start) return null;\n if (!this.rangeMonthOnlyMode()) return null;\n const start = dayjs(value.start);\n const end = dayjs(value.end);\n return start.isSame(start.startOf('month')) && end.isSame(start.endOf('month'))\n ? null\n : { monthOnly: true };\n };\n\n protected initSingleInput() {\n const matDatepickerInput = this.matDatepickerInput();\n if (this.initialValue && matDatepickerInput) {\n matDatepickerInput.value = this.initialValue;\n this.datepickerClosed();\n }\n }\n\n inputChanged(value: string) {\n const dateString = value.slice(0, this.placeholder.length);\n\n if (dateString.length === 0) {\n this.control?.setValue(null);\n return;\n }\n\n if (dateString.length !== this.placeholder.length) {\n return;\n }\n\n const date = this.parseDateShortFormat(dateString);\n this.control?.setValue(this.formatDateFromViewToModel(date));\n }\n\n datepickerClosed() {\n const matDatepickerInput = this.matDatepickerInput();\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n if (matDatepickerInput && matDatepickerInput.value) {\n this.control?.setValue(matDatepickerInput.value);\n\n actualInput.nativeElement.value = this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDatepickerInput.value)\n );\n } else {\n actualInput.nativeElement.value = '';\n this.control?.setValue(null);\n }\n\n this.isPrevDayButtonDisabled.set(this.isPrevDayBeforeOrEqualToMinDate());\n this.isNextDayButtonDisabled.set(this.isNextDayAfterOrEqualToMaxDate());\n\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n onMonthSelected(date: Date) {\n const matDateRangePicker = this.matDateRangePicker();\n if (matDateRangePicker && this.rangeMonthOnlyMode() && date) {\n matDateRangePicker.select(dayjs(date).startOf('month').toDate());\n matDateRangePicker.select(dayjs(date).endOf('month').toDate());\n matDateRangePicker.close();\n }\n }\n\n protected initRangeInput() {\n const matStartDate = this.matStartDate();\n const matEndDate = this.matEndDate();\n\n if (this.initialValue && matStartDate && matEndDate) {\n matStartDate.value = (this.initialValue as WattDateRange).start;\n matEndDate.value = (this.initialValue as WattDateRange).end;\n this.rangePickerClosed();\n }\n }\n\n clearRangePicker() {\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n this.control?.setValue(null);\n actualInput.nativeElement.value = '';\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n rangeInputChanged(value: string) {\n const startDateString = value.slice(0, this.placeholder.length);\n\n if (startDateString.length === 0) {\n this.control?.setValue(null);\n return;\n }\n\n if (startDateString.length !== this.placeholder.length) {\n return;\n }\n\n const start = this.parseDateShortFormat(startDateString);\n const endDateString = value.slice(this.placeholder.length + this.rangeSeparator.length);\n let end = this.setEndDateToDanishTimeZone(endDateString);\n\n if (end !== null) {\n end = this.setToEndOfDay(end);\n this.control?.setValue({ start, end });\n }\n }\n\n rangePickerClosed() {\n const matDateRangeInput = this.matDateRangeInput();\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n if (matDateRangeInput?.value?.start && matDateRangeInput?.value?.end) {\n actualInput.nativeElement.value =\n this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDateRangeInput.value?.start)\n ) +\n '-' +\n this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDateRangeInput.value.end)\n );\n\n this.control?.setValue({\n start: this.formatDateFromViewToModel(matDateRangeInput.value.start),\n end: this.formatDateFromViewToModel(matDateRangeInput.value.end),\n });\n } else {\n actualInput.nativeElement.value = '';\n this.control?.setValue(null);\n }\n\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n protected setSingleValue(\n value: Exclude<WattPickerValue, WattDateRange>,\n input: HTMLInputElement\n ) {\n const matDatepickerInput = this.matDatepickerInput();\n if (matDatepickerInput) {\n this.setValueToInput(value, input, matDatepickerInput);\n }\n }\n\n protected setRangeValue(\n value: WattDateRange | null,\n startInput: HTMLInputElement,\n endInput: HTMLInputElement\n ) {\n const { start, end } = value ?? {};\n\n const matStartDate = this.matStartDate();\n const matEndDate = this.matEndDate();\n\n if (!matStartDate || !matEndDate) return;\n\n this.setValueToInput(start, startInput, matStartDate);\n this.setValueToInput(end, endInput, matEndDate);\n }\n\n prevDay() {\n this.changeDay(-1);\n }\n\n nextDay() {\n this.changeDay(1);\n }\n\n private changeDay(value: number) {\n const currentDate = this.matDatepickerInput()?.value;\n\n if (currentDate) {\n const newDate = dayjs(currentDate).add(value, 'day').toISOString();\n const newDateFormatted = this.formatDateTimeFromModelToView(newDate);\n\n this.inputChanged(newDateFormatted);\n this.datepickerClosed();\n }\n }\n\n private isPrevDayBeforeOrEqualToMinDate() {\n const min = this.min();\n const selectedDate = this.matDatepickerInput()?.value;\n\n if (!min || !selectedDate) return false;\n\n const isBefore = dayjs(selectedDate).isBefore(min, 'day');\n const isSame = dayjs(selectedDate).isSame(min, 'day');\n\n return isSame || isBefore;\n }\n\n private isNextDayAfterOrEqualToMaxDate() {\n const max = this.max();\n const selectedDate = this.matDatepickerInput()?.value;\n\n if (!max || !selectedDate) return false;\n\n const isAfter = dayjs(selectedDate).isAfter(max, 'day');\n const isSame = dayjs(selectedDate).isSame(max, 'day');\n\n return isSame || isAfter;\n }\n\n private parseDateShortFormat(value: string): Date {\n return dayjs(value, dateShortFormat).toDate();\n }\n\n private setValueToInput<D extends { value: Date | null }>(\n value: string | null | undefined,\n nativeInput: HTMLInputElement,\n matDateInput: D\n ): void {\n nativeInput.value = value ? this.formatDateTimeFromModelToView(value) : '';\n matDateInput.value = value ? dayjs(value).utc().toDate() : null;\n }\n\n /**\n * @ignore\n * Formats Date to full ISO 8601 format (e.g. `2022-08-31T22:00:00.000Z`)\n */\n private formatDateFromViewToModel(value: Date): string {\n return dayjs(value).utc().toISOString();\n }\n\n private formatDateTimeFromModelToView(value: string): string {\n return dayjs(value).tz(danishTimeZoneIdentifier).format(dateShortFormat);\n }\n\n private toDanishTimeZone(value: Date): Date {\n return dayjs(value.toISOString()).tz(danishTimeZoneIdentifier).toDate();\n }\n\n private setToEndOfDay(value: Date): Date {\n return dayjs(value).endOf('day').toDate();\n }\n\n private setEndDateToDanishTimeZone(value: string): Date | null {\n const dateBasedOnShortFormat = this.parseDateShortFormat(value);\n\n let maybeDateInDanishTimeZone: Date | null = null;\n\n if (dayjs(dateBasedOnShortFormat).isValid()) {\n maybeDateInDanishTimeZone = this.toDanishTimeZone(dateBasedOnShortFormat);\n }\n\n return maybeDateInDanishTimeZone;\n }\n}\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field [control]=\"control\" [label]=\"label()\">\n @if (range) {\n <mat-date-range-input\n [disabled]=\"disabled\"\n [rangePicker]=\"rangeDatepicker\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <input\n inert\n aria-label=\"start-date-input\"\n matStartDate\n #startDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n\n <input\n inert\n aria-label=\"end-date-input\"\n matEndDate\n #endDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n </mat-date-range-input>\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"rangeInputMask()\"\n [placeholder]=\"rangePlaceholder\"\n (maskApplied)=\"rangeInputChanged($event)\"\n />\n\n <watt-button\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled\"\n [attr.aria-pressed]=\"false\"\n (click)=\"rangeDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-date-range-picker\n [panelClass]=\"rangeMonthOnlyMode() ? 'watt-datepicker-range__panel--month-only' : ''\"\n [startView]=\"rangeMonthOnlyMode() ? 'multi-year' : 'month'\"\n [startAt]=\"startAt()\"\n (monthSelected)=\"onMonthSelected($event)\"\n (closed)=\"rangePickerClosed()\"\n #rangeDatepicker\n />\n } @else {\n <input\n inert\n matInput\n tabindex=\"-1\"\n aria-label=\"date-input\"\n #dateInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n [disabled]=\"disabled\"\n [min]=\"min()\"\n [max]=\"max()\"\n [matDatepicker]=\"singleDatepicker\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"inputMask()\"\n [placeholder]=\"placeholder\"\n (maskApplied)=\"inputChanged($event)\"\n />\n\n <watt-button\n wattSuffix\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled\"\n (click)=\"singleDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-datepicker\n #singleDatepicker\n panelClass=\"watt-datepicker-single__panel\"\n [dateClass]=\"dateClass()\"\n [startAt]=\"startAt()\"\n (closed)=\"datepickerClosed()\"\n />\n }\n\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n <ng-content ngProjectAs=\"watt-field-warning\" select=\"watt-field-warning\" />\n</watt-field>\n\n@if (!range && canStepThroughDays()) {\n <span\n class=\"watt-datepicker-single__step-through\"\n [class.watt-datepicker-single__has-label]=\"!!label()\"\n >\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevDay()\"\n [disabled]=\"disabled || isPrevDayButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextDay()\"\n [disabled]=\"disabled || isNextDayButtonDisabled()\"\n />\n </span>\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 { Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class WattDatepickerIntlService {\n clear = 'Clear';\n select = 'OK';\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 { WattDatepickerComponent } from './watt-datepicker.component';\nexport { danishTimeZoneIdentifier } from './watt-datepicker.component';\nexport { WattDatepickerIntlService } from './watt-datepicker-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAkDA,MAAM,eAAe,GAAG,YAAY;AAC7B,MAAM,wBAAwB,GAAG;AAExC;;;;;;AAMG;AAgBG,MAAO,uBAAwB,SAAQ,cAAc,CAAA;AACtC,IAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,IAAA,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC9C,IAAA,S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EAAA,CAAA;;AEpHhF;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAIa,yBAAyB,CAAA;IACpC,KAAK,GAAG,OAAO;IACf,MAAM,GAAG,IAAI;wGAFF,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA;;4FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACpBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-picker-datepicker.mjs","sources":["../../../libs/watt/package/picker/datepicker/watt-datepicker.component.ts","../../../libs/watt/package/picker/datepicker/watt-datepicker.component.html","../../../libs/watt/package/picker/datepicker/watt-datepicker-intl.service.ts","../../../libs/watt/package/picker/datepicker/index.ts","../../../libs/watt/package/picker/datepicker/energinet-watt-picker-datepicker.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 input,\n signal,\n effect,\n inject,\n computed,\n Component,\n viewChild,\n ElementRef,\n linkedSignal,\n AfterViewInit,\n booleanAttribute,\n ChangeDetectorRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { MatInputModule } from '@angular/material/input';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { AbstractControl, NgControl, Validator } from '@angular/forms';\n\nimport {\n MatEndDate,\n MatStartDate,\n MatDateRangeInput,\n MatDateRangePicker,\n MatDatepickerInput,\n MatDatepickerModule,\n MatCalendarCellClassFunction,\n} from '@angular/material/datepicker';\n\nimport { maskitoDateOptionsGenerator, maskitoDateRangeOptionsGenerator } from '@maskito/kit';\n\nimport {\n dayjs,\n WattRange,\n WattDateRange,\n WattLocaleService,\n WattSupportedLocales,\n} from '@energinet/watt/core/date';\n\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\nimport {\n WattPickerBase,\n WattPickerValue,\n WattPlaceholderMaskComponent,\n} from '@energinet/watt/picker/__shared';\n\nconst dateShortFormat = 'DD-MM-YYYY';\nexport const danishTimeZoneIdentifier = 'Europe/Copenhagen';\n\n/**\n * Usage:\n * `import { WattDatepickerComponent } from '@energinet/watt/datepicker';`\n *\n * IMPORTANT:\n * The styling is calculated based on our monospaced font.\n */\n@Component({\n selector: 'watt-datepicker',\n templateUrl: './watt-datepicker.component.html',\n styleUrls: ['./watt-datepicker.component.scss'],\n providers: [{ provide: MatFormFieldControl, useExisting: WattDatepickerComponent }],\n encapsulation: ViewEncapsulation.None,\n imports: [\n MatInputModule,\n MatDatepickerModule,\n\n WattFieldComponent,\n WattButtonComponent,\n WattPlaceholderMaskComponent,\n ],\n})\nexport class WattDatepickerComponent extends WattPickerBase implements Validator, AfterViewInit {\n protected override elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n protected override changeDetectionRef = inject(ChangeDetectorRef);\n protected override ngControl = inject(NgControl, { optional: true, self: true });\n private localeService = inject(WattLocaleService);\n\n max = input<Date>();\n min = input<Date>();\n label = input<string>('');\n rangeMonthOnlyMode = input(false);\n startAt = input<Date | null>(null);\n dateClass = input<MatCalendarCellClassFunction<Date>>(() => '');\n canStepThroughDays = input(false, { transform: booleanAttribute });\n\n matEndDate = viewChild<MatEndDate<Date | null>>(MatEndDate);\n matStartDate = viewChild<MatStartDate<Date | null>>(MatStartDate);\n matDateRangeInput = viewChild<MatDateRangeInput<Date | null>>(MatDateRangeInput);\n matDatepickerInput = viewChild<MatDatepickerInput<Date | null>>(MatDatepickerInput);\n matDateRangePicker = viewChild<MatDateRangePicker<Date | null>>(MatDateRangePicker);\n\n actualInput = viewChild<ElementRef<HTMLInputElement>>('actualInput');\n override input = viewChild<ElementRef<HTMLInputElement>>('dateInput');\n override endInput = viewChild<ElementRef<HTMLInputElement>>('endDateInput');\n override startInput = viewChild<ElementRef<HTMLInputElement>>('startDateInput');\n\n rangeSeparator = ' - ';\n\n rangePlaceholder = signal('');\n\n inputMask = computed(() =>\n maskitoDateOptionsGenerator({\n mode: 'dd/mm/yyyy',\n separator: '-',\n max: this.max(),\n min: this.min(),\n })\n );\n\n rangeInputMask = computed(() =>\n maskitoDateRangeOptionsGenerator({\n mode: 'dd/mm/yyyy',\n dateSeparator: '-',\n max: this.max(),\n min: this.min(),\n })\n );\n\n getPlaceholderByLocale = (locale: WattSupportedLocales) =>\n locale === 'da' ? 'dd-mm-åååå' : 'dd-mm-yyyy';\n\n getRangePlaceholder(): string {\n return this.placeholder() + this.rangeSeparator + this.placeholder();\n }\n\n isPrevDayButtonDisabled = linkedSignal(() => this.isPrevDayBeforeOrEqualToMinDate());\n isNextDayButtonDisabled = linkedSignal(() => this.isNextDayAfterOrEqualToMaxDate());\n\n constructor() {\n super(`watt-datepicker-${WattDatepickerComponent.nextId++}`);\n\n effect(() => {\n const locale = this.localeService.locale();\n this.placeholder.set(this.getPlaceholderByLocale(locale));\n this.rangePlaceholder.set(this.getRangePlaceholder());\n });\n\n effect(() => {\n this.rangeMonthOnlyMode();\n this.ngControl?.control?.updateValueAndValidity();\n });\n }\n\n override ngAfterViewInit(): void {\n super.ngAfterViewInit();\n this.ngControl?.control?.addValidators(this.validate);\n }\n\n validate = ({ value }: AbstractControl<WattRange<string>>) => {\n if (!value?.end || !value?.start) return null;\n if (!this.rangeMonthOnlyMode()) return null;\n const start = dayjs(value.start);\n const end = dayjs(value.end);\n return start.isSame(start.startOf('month')) && end.isSame(start.endOf('month'))\n ? null\n : { monthOnly: true };\n };\n\n protected initSingleInput() {\n const matDatepickerInput = this.matDatepickerInput();\n if (this.initialValue && matDatepickerInput) {\n matDatepickerInput.value = this.initialValue;\n this.datepickerClosed();\n }\n }\n\n inputChanged(value: string) {\n const dateString = value.slice(0, this.placeholder().length);\n\n if (dateString.length === 0) {\n this.control?.setValue(null);\n return;\n }\n\n if (dateString.length !== this.placeholder().length) {\n return;\n }\n\n const date = this.parseDateShortFormat(dateString);\n this.control?.setValue(this.formatDateFromViewToModel(date));\n }\n\n datepickerClosed() {\n const matDatepickerInput = this.matDatepickerInput();\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n if (matDatepickerInput && matDatepickerInput.value) {\n this.control?.setValue(matDatepickerInput.value);\n\n actualInput.nativeElement.value = this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDatepickerInput.value)\n );\n } else {\n actualInput.nativeElement.value = '';\n this.control?.setValue(null);\n }\n\n this.isPrevDayButtonDisabled.set(this.isPrevDayBeforeOrEqualToMinDate());\n this.isNextDayButtonDisabled.set(this.isNextDayAfterOrEqualToMaxDate());\n\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n onMonthSelected(date: Date) {\n const matDateRangePicker = this.matDateRangePicker();\n if (matDateRangePicker && this.rangeMonthOnlyMode() && date) {\n matDateRangePicker.select(dayjs(date).startOf('month').toDate());\n matDateRangePicker.select(dayjs(date).endOf('month').toDate());\n matDateRangePicker.close();\n }\n }\n\n protected initRangeInput() {\n const matStartDate = this.matStartDate();\n const matEndDate = this.matEndDate();\n\n if (this.initialValue && matStartDate && matEndDate) {\n matStartDate.value = (this.initialValue as WattDateRange).start;\n matEndDate.value = (this.initialValue as WattDateRange).end;\n this.rangePickerClosed();\n }\n }\n\n clearRangePicker() {\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n this.control?.setValue(null);\n actualInput.nativeElement.value = '';\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n rangeInputChanged(value: string) {\n const startDateString = value.slice(0, this.placeholder().length);\n\n if (startDateString.length === 0) {\n this.control?.setValue(null);\n return;\n }\n\n if (startDateString.length !== this.placeholder().length) {\n return;\n }\n\n const start = this.parseDateShortFormat(startDateString);\n const endDateString = value.slice(this.placeholder().length + this.rangeSeparator.length);\n let end = this.setEndDateToDanishTimeZone(endDateString);\n\n if (end !== null) {\n end = this.setToEndOfDay(end);\n this.control?.setValue({ start, end });\n }\n }\n\n rangePickerClosed() {\n const matDateRangeInput = this.matDateRangeInput();\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n if (matDateRangeInput?.value?.start && matDateRangeInput?.value?.end) {\n actualInput.nativeElement.value =\n this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDateRangeInput.value?.start)\n ) +\n '-' +\n this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDateRangeInput.value.end)\n );\n\n this.control?.setValue({\n start: this.formatDateFromViewToModel(matDateRangeInput.value.start),\n end: this.formatDateFromViewToModel(matDateRangeInput.value.end),\n });\n } else {\n actualInput.nativeElement.value = '';\n this.control?.setValue(null);\n }\n\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n protected setSingleValue(\n value: Exclude<WattPickerValue, WattDateRange>,\n input: HTMLInputElement\n ) {\n const matDatepickerInput = this.matDatepickerInput();\n if (matDatepickerInput) {\n this.setValueToInput(value, input, matDatepickerInput);\n }\n }\n\n protected setRangeValue(\n value: WattDateRange | null,\n startInput: HTMLInputElement,\n endInput: HTMLInputElement\n ) {\n const { start, end } = value ?? {};\n\n const matStartDate = this.matStartDate();\n const matEndDate = this.matEndDate();\n\n if (!matStartDate || !matEndDate) return;\n\n this.setValueToInput(start, startInput, matStartDate);\n this.setValueToInput(end, endInput, matEndDate);\n }\n\n prevDay() {\n this.changeDay(-1);\n }\n\n nextDay() {\n this.changeDay(1);\n }\n\n private changeDay(value: number) {\n const currentDate = this.matDatepickerInput()?.value;\n\n if (currentDate) {\n const newDate = dayjs(currentDate).add(value, 'day').toISOString();\n const newDateFormatted = this.formatDateTimeFromModelToView(newDate);\n\n this.inputChanged(newDateFormatted);\n this.datepickerClosed();\n }\n }\n\n private isPrevDayBeforeOrEqualToMinDate() {\n const min = this.min();\n const selectedDate = this.matDatepickerInput()?.value;\n\n if (!min || !selectedDate) return false;\n\n const isBefore = dayjs(selectedDate).isBefore(min, 'day');\n const isSame = dayjs(selectedDate).isSame(min, 'day');\n\n return isSame || isBefore;\n }\n\n private isNextDayAfterOrEqualToMaxDate() {\n const max = this.max();\n const selectedDate = this.matDatepickerInput()?.value;\n\n if (!max || !selectedDate) return false;\n\n const isAfter = dayjs(selectedDate).isAfter(max, 'day');\n const isSame = dayjs(selectedDate).isSame(max, 'day');\n\n return isSame || isAfter;\n }\n\n private parseDateShortFormat(value: string): Date {\n return dayjs(value, dateShortFormat).toDate();\n }\n\n private setValueToInput<D extends { value: Date | null }>(\n value: string | null | undefined,\n nativeInput: HTMLInputElement,\n matDateInput: D\n ): void {\n nativeInput.value = value ? this.formatDateTimeFromModelToView(value) : '';\n matDateInput.value = value ? dayjs(value).utc().toDate() : null;\n }\n\n /**\n * @ignore\n * Formats Date to full ISO 8601 format (e.g. `2022-08-31T22:00:00.000Z`)\n */\n private formatDateFromViewToModel(value: Date): string {\n return dayjs(value).utc().toISOString();\n }\n\n private formatDateTimeFromModelToView(value: string): string {\n return dayjs(value).tz(danishTimeZoneIdentifier).format(dateShortFormat);\n }\n\n private toDanishTimeZone(value: Date): Date {\n return dayjs(value.toISOString()).tz(danishTimeZoneIdentifier).toDate();\n }\n\n private setToEndOfDay(value: Date): Date {\n return dayjs(value).endOf('day').toDate();\n }\n\n private setEndDateToDanishTimeZone(value: string): Date | null {\n const dateBasedOnShortFormat = this.parseDateShortFormat(value);\n\n let maybeDateInDanishTimeZone: Date | null = null;\n\n if (dayjs(dateBasedOnShortFormat).isValid()) {\n maybeDateInDanishTimeZone = this.toDanishTimeZone(dateBasedOnShortFormat);\n }\n\n return maybeDateInDanishTimeZone;\n }\n}\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field [control]=\"control\" [label]=\"label()\">\n @if (range()) {\n <mat-date-range-input\n [disabled]=\"disabled()\"\n [rangePicker]=\"rangeDatepicker\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <input\n inert\n aria-label=\"start-date-input\"\n matStartDate\n #startDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n\n <input\n inert\n aria-label=\"end-date-input\"\n matEndDate\n #endDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n </mat-date-range-input>\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"rangeInputMask()\"\n [placeholder]=\"rangePlaceholder()\"\n (maskApplied)=\"rangeInputChanged($event)\"\n />\n\n <watt-button\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"false\"\n (click)=\"rangeDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-date-range-picker\n [panelClass]=\"rangeMonthOnlyMode() ? 'watt-datepicker-range__panel--month-only' : ''\"\n [startView]=\"rangeMonthOnlyMode() ? 'multi-year' : 'month'\"\n [startAt]=\"startAt()\"\n (monthSelected)=\"onMonthSelected($event)\"\n (closed)=\"rangePickerClosed()\"\n #rangeDatepicker\n />\n } @else {\n <input\n inert\n matInput\n tabindex=\"-1\"\n aria-label=\"date-input\"\n #dateInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n [disabled]=\"disabled()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [matDatepicker]=\"singleDatepicker\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"inputMask()\"\n [placeholder]=\"placeholder()\"\n (maskApplied)=\"inputChanged($event)\"\n />\n\n <watt-button\n wattSuffix\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled()\"\n (click)=\"singleDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-datepicker\n #singleDatepicker\n panelClass=\"watt-datepicker-single__panel\"\n [dateClass]=\"dateClass()\"\n [startAt]=\"startAt()\"\n (closed)=\"datepickerClosed()\"\n />\n }\n\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n <ng-content ngProjectAs=\"watt-field-warning\" select=\"watt-field-warning\" />\n</watt-field>\n\n@if (!range() && canStepThroughDays()) {\n <span\n class=\"watt-datepicker-single__step-through\"\n [class.watt-datepicker-single__has-label]=\"!!label()\"\n >\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevDay()\"\n [disabled]=\"disabled() || isPrevDayButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextDay()\"\n [disabled]=\"disabled() || isNextDayButtonDisabled()\"\n />\n </span>\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 { Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class WattDatepickerIntlService {\n clear = 'Clear';\n select = 'OK';\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 { WattDatepickerComponent } from './watt-datepicker.component';\nexport { danishTimeZoneIdentifier } from './watt-datepicker.component';\nexport { WattDatepickerIntlService } from './watt-datepicker-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAkDA,MAAM,eAAe,GAAG,YAAY;AAC7B,MAAM,wBAAwB,GAAG;AAExC;;;;;;AAMG;AAgBG,MAAO,uBAAwB,SAAQ,cAAc,CAAA;AACtC,IAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CA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,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnHhF;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAIa,yBAAyB,CAAA;IACpC,KAAK,GAAG,OAAO;IACf,MAAM,GAAG,IAAI;wGAFF,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA;;4FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACpBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i3 from '@angular/cdk/overlay';
|
|
2
2
|
import { OverlayModule } from '@angular/cdk/overlay';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, ElementRef, ChangeDetectorRef, input, viewChild,
|
|
4
|
+
import { inject, ElementRef, ChangeDetectorRef, input, viewChild, computed, signal, DestroyRef, ViewEncapsulation, Component } from '@angular/core';
|
|
5
5
|
import { NgControl } from '@angular/forms';
|
|
6
6
|
import * as i1 from '@angular/material/datepicker';
|
|
7
7
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
@@ -156,26 +156,26 @@ class WattTimepickerComponent extends WattPickerBase {
|
|
|
156
156
|
* the slider overlay (since the DOM hierarchy cannot be used).
|
|
157
157
|
* @ignore
|
|
158
158
|
*/
|
|
159
|
-
|
|
159
|
+
ariaOwns = computed(() => {
|
|
160
160
|
// Only range input has slider
|
|
161
|
-
return this.range && this.sliderOpen ? this.sliderId : undefined;
|
|
162
|
-
}
|
|
161
|
+
return this.range() && this.sliderOpen() ? this.sliderId : undefined;
|
|
162
|
+
}, ...(ngDevMode ? [{ debugName: "ariaOwns" }] : []));
|
|
163
163
|
hoursMinutesPlaceholder = 'HH:MM';
|
|
164
164
|
rangeSeparator = ' - ';
|
|
165
165
|
rangePlaceholder = this.hoursMinutesPlaceholder + this.rangeSeparator + this.hoursMinutesPlaceholder;
|
|
166
|
-
_placeholder = this.hoursMinutesPlaceholder;
|
|
167
166
|
/**
|
|
168
167
|
* Whether the slider is open.
|
|
169
168
|
* @ignore
|
|
170
169
|
*/
|
|
171
|
-
sliderOpen = false;
|
|
170
|
+
sliderOpen = signal(false, ...(ngDevMode ? [{ debugName: "sliderOpen" }] : []));
|
|
172
171
|
sliderSteps = [...Array(quartersInADay).keys()].map((x) => x * 15).concat(minutesInADay - 1);
|
|
173
172
|
sliderChange$ = new Subject();
|
|
174
173
|
get sliderValue() {
|
|
175
|
-
|
|
174
|
+
const value = this.control?.value;
|
|
175
|
+
if (value?.start && value?.end) {
|
|
176
176
|
return {
|
|
177
|
-
min: timeToMinutes(
|
|
178
|
-
max: timeToMinutes(
|
|
177
|
+
min: timeToMinutes(value.start),
|
|
178
|
+
max: timeToMinutes(value.end),
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
181
|
// Retain last slider value if input value is incomplete
|
|
@@ -186,7 +186,7 @@ class WattTimepickerComponent extends WattPickerBase {
|
|
|
186
186
|
* @ignore
|
|
187
187
|
*/
|
|
188
188
|
toggleSlider() {
|
|
189
|
-
this.sliderOpen
|
|
189
|
+
this.sliderOpen.update((open) => !open);
|
|
190
190
|
}
|
|
191
191
|
/**
|
|
192
192
|
* Override to automatically close the slider overlay on blur.
|
|
@@ -194,14 +194,15 @@ class WattTimepickerComponent extends WattPickerBase {
|
|
|
194
194
|
*/
|
|
195
195
|
onFocusOut(event) {
|
|
196
196
|
super.onFocusOut(event);
|
|
197
|
-
if (!this.focused)
|
|
198
|
-
this.sliderOpen
|
|
197
|
+
if (!this.focused())
|
|
198
|
+
this.sliderOpen.set(false);
|
|
199
199
|
}
|
|
200
200
|
inputMask = maskitoTimeOptionsGenerator({ mode: 'HH:MM' });
|
|
201
201
|
rangeInputMask = maskitoTimeRangeOptionsGenerator();
|
|
202
202
|
destroyRef = inject(DestroyRef);
|
|
203
203
|
constructor() {
|
|
204
204
|
super(`watt-timepicker-${WattTimepickerComponent.nextId++}`);
|
|
205
|
+
this.placeholder.set(this.hoursMinutesPlaceholder);
|
|
205
206
|
}
|
|
206
207
|
initSingleInput() {
|
|
207
208
|
const input = this.input();
|
|
@@ -277,11 +278,13 @@ class WattTimepickerComponent extends WattPickerBase {
|
|
|
277
278
|
}
|
|
278
279
|
}
|
|
279
280
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattTimepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
280
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattTimepickerComponent, isStandalone: true, selector: "watt-timepicker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, sliderLabel: { classPropertyName: "sliderLabel", publicName: "sliderLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-owns": "
|
|
281
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattTimepickerComponent, isStandalone: true, selector: "watt-timepicker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, sliderLabel: { classPropertyName: "sliderLabel", publicName: "sliderLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-owns": "ariaOwns()" } }, providers: [{ provide: MatFormFieldControl, useExisting: WattTimepickerComponent }], viewQueries: [{ propertyName: "input", first: true, predicate: ["timeInput"], descendants: true, isSignal: true }, { propertyName: "startInput", first: true, predicate: ["startTimeInput"], descendants: true, isSignal: true }, { propertyName: "endInput", first: true, predicate: ["endTimeInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field [id]=\"id\" [control]=\"control\" [label]=\"label()\">\n @if (!range()) {\n <input\n inert\n matInput\n aria-label=\"time-input\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [disabled]=\"disabled()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n <input #timeInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"timeInput\"\n [mask]=\"inputMask\"\n [placeholder]=\"hoursMinutesPlaceholder\"\n (maskApplied)=\"inputChanged($event)\"\n />\n } @else {\n <mat-date-range-input\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n [disabled]=\"disabled()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <input\n inert\n aria-label=\"start-time-input\"\n matStartDate\n #startTimeInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n <input\n inert\n aria-label=\"end-time-input\"\n matEndDate\n #endTimeInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n </mat-date-range-input>\n <input #timeInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"timeInput\"\n [mask]=\"rangeInputMask\"\n [placeholder]=\"rangePlaceholder\"\n (maskApplied)=\"rangeInputChanged($event)\"\n />\n\n <watt-button\n variant=\"icon\"\n icon=\"time\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"sliderOpen()\"\n (click)=\"toggleSlider()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"sliderOpen()\"\n [cdkConnectedOverlayOffsetY]=\"12\"\n >\n <div\n [id]=\"sliderId\"\n role=\"dialog\"\n class=\"watt-timepicker-slider\"\n tabindex=\"-1\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <span class=\"watt-label\">{{ sliderLabel() }}</span>\n <watt-slider\n [min]=\"sliderSteps[0]\"\n [max]=\"sliderSteps[sliderSteps.length - 1]\"\n [step]=\"1\"\n [value]=\"sliderValue\"\n (valueChange)=\"sliderChange$.next($event)\"\n />\n </div>\n </ng-template>\n }\n\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n</watt-field>\n", styles: ["watt-timepicker{display:flex;align-items:center;width:100%}watt-timepicker watt-button[variant=icon]{margin-left:auto}watt-timepicker watt-button[variant=icon] .watt-button--icon{height:42px}watt-timepicker mat-datepicker,watt-timepicker mat-date-range-picker{display:none}watt-timepicker input.mat-date-range-input-inner,watt-timepicker input.mat-mdc-input-element,watt-timepicker .mat-date-range-input-mirror,watt-timepicker input.mask-input{font-family:Droid Sans Mono,monospace}watt-timepicker input.mat-date-range-input-inner,watt-timepicker input.mat-mdc-input-element,watt-timepicker input.mask-input{border:none;caret-color:var(--watt-color-neutral-black);letter-spacing:-.03em;-webkit-background-clip:text;-moz-background-clip:text;background-clip:text;color:transparent}watt-timepicker input.mask-input{color:#000}watt-timepicker input.mask-input{position:absolute;min-width:100%;padding:2px 1px}watt-timepicker input.mask-input:focus-visible{outline:none}watt-timepicker .mat-date-range-input-container{align-items:initial}watt-timepicker .mat-date-range-input-start-wrapper,watt-timepicker .mat-date-range-input-end-wrapper{max-width:calc(50% - var(--watt-space-s));overflow:visible;position:relative}watt-timepicker .mat-date-range-input-separator{display:flex;align-items:center}watt-timepicker .mat-date-range-input-separator-hidden,watt-timepicker .mat-date-range-input-separator{opacity:0!important}watt-timepicker .mat-date-range-input-inner::-webkit-input-placeholder{color:var(--watt-color-neutral-grey-500)!important;-webkit-text-fill-color:var(--watt-color-neutral-grey-500)}.watt-timepicker-slider{width:340px;padding:var(--watt-space-s) 12px var(--watt-space-m);background:var(--watt-color-neutral-white);box-shadow:0 1px 6px #0b3c5d1f,0 4px 18px 3px #2e323414;border-radius:3px}\n"], dependencies: [{ kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i1.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i1.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i1.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i3.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i3.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattSliderComponent, selector: "watt-slider", inputs: ["min", "max", "step", "value"], outputs: ["valueChange"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }, { kind: "component", type: WattPlaceholderMaskComponent, selector: "watt-placeholder-mask", inputs: ["primaryInputElement", "secondaryInputElement", "mask", "placeholder"], outputs: ["maskApplied"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
281
282
|
}
|
|
282
283
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattTimepickerComponent, decorators: [{
|
|
283
284
|
type: Component,
|
|
284
|
-
args: [{ selector: 'watt-timepicker', providers: [{ provide: MatFormFieldControl, useExisting: WattTimepickerComponent }], encapsulation: ViewEncapsulation.None,
|
|
285
|
+
args: [{ selector: 'watt-timepicker', providers: [{ provide: MatFormFieldControl, useExisting: WattTimepickerComponent }], encapsulation: ViewEncapsulation.None, host: {
|
|
286
|
+
'[attr.aria-owns]': 'ariaOwns()',
|
|
287
|
+
}, imports: [
|
|
285
288
|
MatDatepickerModule,
|
|
286
289
|
MatInputModule,
|
|
287
290
|
OverlayModule,
|
|
@@ -289,11 +292,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
289
292
|
WattSliderComponent,
|
|
290
293
|
WattFieldComponent,
|
|
291
294
|
WattPlaceholderMaskComponent,
|
|
292
|
-
], template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field [id]=\"id\" [control]=\"control\" [label]=\"label()\">\n @if (!range) {\n <input\n inert\n matInput\n aria-label=\"time-input\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [disabled]=\"disabled\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n <input #timeInput class=\"mask-input\" [disabled]=\"disabled\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"timeInput\"\n [mask]=\"inputMask\"\n [placeholder]=\"hoursMinutesPlaceholder\"\n (maskApplied)=\"inputChanged($event)\"\n />\n } @else {\n <mat-date-range-input\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n [disabled]=\"disabled\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <input\n inert\n aria-label=\"start-time-input\"\n matStartDate\n #startTimeInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n <input\n inert\n aria-label=\"end-time-input\"\n matEndDate\n #endTimeInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n </mat-date-range-input>\n <input #timeInput class=\"mask-input\" [disabled]=\"disabled\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"timeInput\"\n [mask]=\"rangeInputMask\"\n [placeholder]=\"rangePlaceholder\"\n (maskApplied)=\"rangeInputChanged($event)\"\n />\n\n <watt-button\n variant=\"icon\"\n icon=\"time\"\n [disabled]=\"disabled\"\n [attr.aria-pressed]=\"sliderOpen\"\n (click)=\"toggleSlider()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"sliderOpen\"\n [cdkConnectedOverlayOffsetY]=\"12\"\n >\n <div\n [id]=\"sliderId\"\n role=\"dialog\"\n class=\"watt-timepicker-slider\"\n tabindex=\"-1\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <span class=\"watt-label\">{{ sliderLabel() }}</span>\n <watt-slider\n [min]=\"sliderSteps[0]\"\n [max]=\"sliderSteps[sliderSteps.length - 1]\"\n [step]=\"1\"\n [value]=\"sliderValue\"\n (valueChange)=\"sliderChange$.next($event)\"\n />\n </div>\n </ng-template>\n }\n\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n</watt-field>\n", styles: ["watt-timepicker{display:flex;align-items:center;width:100%}watt-timepicker watt-button[variant=icon]{margin-left:auto}watt-timepicker watt-button[variant=icon] .watt-button--icon{height:42px}watt-timepicker mat-datepicker,watt-timepicker mat-date-range-picker{display:none}watt-timepicker input.mat-date-range-input-inner,watt-timepicker input.mat-mdc-input-element,watt-timepicker .mat-date-range-input-mirror,watt-timepicker input.mask-input{font-family:Droid Sans Mono,monospace}watt-timepicker input.mat-date-range-input-inner,watt-timepicker input.mat-mdc-input-element,watt-timepicker input.mask-input{border:none;caret-color:var(--watt-color-neutral-black);letter-spacing:-.03em;-webkit-background-clip:text;-moz-background-clip:text;background-clip:text;color:transparent}watt-timepicker input.mask-input{color:#000}watt-timepicker input.mask-input{position:absolute;min-width:100%;padding:2px 1px}watt-timepicker input.mask-input:focus-visible{outline:none}watt-timepicker .mat-date-range-input-container{align-items:initial}watt-timepicker .mat-date-range-input-start-wrapper,watt-timepicker .mat-date-range-input-end-wrapper{max-width:calc(50% - var(--watt-space-s));overflow:visible;position:relative}watt-timepicker .mat-date-range-input-separator{display:flex;align-items:center}watt-timepicker .mat-date-range-input-separator-hidden,watt-timepicker .mat-date-range-input-separator{opacity:0!important}watt-timepicker .mat-date-range-input-inner::-webkit-input-placeholder{color:var(--watt-color-neutral-grey-500)!important;-webkit-text-fill-color:var(--watt-color-neutral-grey-500)}.watt-timepicker-slider{width:340px;padding:var(--watt-space-s) 12px var(--watt-space-m);background:var(--watt-color-neutral-white);box-shadow:0 1px 6px #0b3c5d1f,0 4px 18px 3px #2e323414;border-radius:3px}\n"] }]
|
|
293
|
-
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], sliderLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "sliderLabel", required: false }] }], input: [{ type: i0.ViewChild, args: ['timeInput', { isSignal: true }] }], startInput: [{ type: i0.ViewChild, args: ['startTimeInput', { isSignal: true }] }], endInput: [{ type: i0.ViewChild, args: ['endTimeInput', { isSignal: true }] }]
|
|
294
|
-
type: HostBinding,
|
|
295
|
-
args: ['attr.aria-owns']
|
|
296
|
-
}] } });
|
|
295
|
+
], template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field [id]=\"id\" [control]=\"control\" [label]=\"label()\">\n @if (!range()) {\n <input\n inert\n matInput\n aria-label=\"time-input\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [disabled]=\"disabled()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n <input #timeInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"timeInput\"\n [mask]=\"inputMask\"\n [placeholder]=\"hoursMinutesPlaceholder\"\n (maskApplied)=\"inputChanged($event)\"\n />\n } @else {\n <mat-date-range-input\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n [disabled]=\"disabled()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <input\n inert\n aria-label=\"start-time-input\"\n matStartDate\n #startTimeInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n <input\n inert\n aria-label=\"end-time-input\"\n matEndDate\n #endTimeInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n />\n </mat-date-range-input>\n <input #timeInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"timeInput\"\n [mask]=\"rangeInputMask\"\n [placeholder]=\"rangePlaceholder\"\n (maskApplied)=\"rangeInputChanged($event)\"\n />\n\n <watt-button\n variant=\"icon\"\n icon=\"time\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"sliderOpen()\"\n (click)=\"toggleSlider()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"sliderOpen()\"\n [cdkConnectedOverlayOffsetY]=\"12\"\n >\n <div\n [id]=\"sliderId\"\n role=\"dialog\"\n class=\"watt-timepicker-slider\"\n tabindex=\"-1\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <span class=\"watt-label\">{{ sliderLabel() }}</span>\n <watt-slider\n [min]=\"sliderSteps[0]\"\n [max]=\"sliderSteps[sliderSteps.length - 1]\"\n [step]=\"1\"\n [value]=\"sliderValue\"\n (valueChange)=\"sliderChange$.next($event)\"\n />\n </div>\n </ng-template>\n }\n\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n</watt-field>\n", styles: ["watt-timepicker{display:flex;align-items:center;width:100%}watt-timepicker watt-button[variant=icon]{margin-left:auto}watt-timepicker watt-button[variant=icon] .watt-button--icon{height:42px}watt-timepicker mat-datepicker,watt-timepicker mat-date-range-picker{display:none}watt-timepicker input.mat-date-range-input-inner,watt-timepicker input.mat-mdc-input-element,watt-timepicker .mat-date-range-input-mirror,watt-timepicker input.mask-input{font-family:Droid Sans Mono,monospace}watt-timepicker input.mat-date-range-input-inner,watt-timepicker input.mat-mdc-input-element,watt-timepicker input.mask-input{border:none;caret-color:var(--watt-color-neutral-black);letter-spacing:-.03em;-webkit-background-clip:text;-moz-background-clip:text;background-clip:text;color:transparent}watt-timepicker input.mask-input{color:#000}watt-timepicker input.mask-input{position:absolute;min-width:100%;padding:2px 1px}watt-timepicker input.mask-input:focus-visible{outline:none}watt-timepicker .mat-date-range-input-container{align-items:initial}watt-timepicker .mat-date-range-input-start-wrapper,watt-timepicker .mat-date-range-input-end-wrapper{max-width:calc(50% - var(--watt-space-s));overflow:visible;position:relative}watt-timepicker .mat-date-range-input-separator{display:flex;align-items:center}watt-timepicker .mat-date-range-input-separator-hidden,watt-timepicker .mat-date-range-input-separator{opacity:0!important}watt-timepicker .mat-date-range-input-inner::-webkit-input-placeholder{color:var(--watt-color-neutral-grey-500)!important;-webkit-text-fill-color:var(--watt-color-neutral-grey-500)}.watt-timepicker-slider{width:340px;padding:var(--watt-space-s) 12px var(--watt-space-m);background:var(--watt-color-neutral-white);box-shadow:0 1px 6px #0b3c5d1f,0 4px 18px 3px #2e323414;border-radius:3px}\n"] }]
|
|
296
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], sliderLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "sliderLabel", required: false }] }], input: [{ type: i0.ViewChild, args: ['timeInput', { isSignal: true }] }], startInput: [{ type: i0.ViewChild, args: ['startTimeInput', { isSignal: true }] }], endInput: [{ type: i0.ViewChild, args: ['endTimeInput', { isSignal: true }] }] } });
|
|
297
297
|
|
|
298
298
|
//#region License
|
|
299
299
|
/**
|