@energinet/watt 4.3.1 → 4.3.2
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/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/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
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectorRef, input, output, signal, effect, untracked, ViewEncapsulation, Component, DestroyRef, ElementRef,
|
|
2
|
+
import { inject, ChangeDetectorRef, input, output, signal, effect, untracked, ViewEncapsulation, Component, DestroyRef, ElementRef, computed, Directive } from '@angular/core';
|
|
3
3
|
import { Maskito } from '@maskito/core';
|
|
4
4
|
import { NgControl } from '@angular/forms';
|
|
5
5
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
6
|
-
import { Subject } from 'rxjs';
|
|
7
6
|
|
|
8
7
|
//#region License
|
|
9
8
|
/**
|
|
@@ -34,8 +33,10 @@ class WattPlaceholderMaskComponent {
|
|
|
34
33
|
primaryGhost = signal('', ...(ngDevMode ? [{ debugName: "primaryGhost" }] : []));
|
|
35
34
|
primaryFiller = signal(null, ...(ngDevMode ? [{ debugName: "primaryFiller" }] : []));
|
|
36
35
|
maskEffect = effect((onCleanup) => {
|
|
37
|
-
const mask = this.mask();
|
|
38
36
|
const placeholder = this.placeholder();
|
|
37
|
+
if (!placeholder)
|
|
38
|
+
return;
|
|
39
|
+
const mask = this.mask();
|
|
39
40
|
const primaryMask = {
|
|
40
41
|
...mask,
|
|
41
42
|
preprocessors: [
|
|
@@ -99,18 +100,11 @@ class WattPickerBase {
|
|
|
99
100
|
static nextId = 0;
|
|
100
101
|
id;
|
|
101
102
|
initialValue = null;
|
|
102
|
-
focused = false;
|
|
103
|
+
focused = signal(false, ...(ngDevMode ? [{ debugName: "focused" }] : []));
|
|
103
104
|
controlType = 'mat-date-range-input'; // We keep the controlType of Material Date Range Input as is, to keep some styling.
|
|
104
|
-
stateChanges = new Subject();
|
|
105
105
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
106
106
|
userAriaDescribedBy = input(undefined, ...(ngDevMode ? [{ debugName: "userAriaDescribedBy", alias: 'aria-describedby' }] : [{ alias: 'aria-describedby' }]));
|
|
107
|
-
|
|
108
|
-
return this._placeholder;
|
|
109
|
-
}
|
|
110
|
-
set placeholder(value) {
|
|
111
|
-
this._placeholder = value;
|
|
112
|
-
this.stateChanges.next();
|
|
113
|
-
}
|
|
107
|
+
placeholder = signal('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
114
108
|
get value() {
|
|
115
109
|
if (this.ngControl?.valid) {
|
|
116
110
|
const { value: { start, end }, } = this.ngControl;
|
|
@@ -118,16 +112,16 @@ class WattPickerBase {
|
|
|
118
112
|
}
|
|
119
113
|
return null;
|
|
120
114
|
}
|
|
121
|
-
|
|
115
|
+
setValue(value) {
|
|
122
116
|
const input = this.input();
|
|
123
117
|
const startInput = this.startInput();
|
|
124
118
|
const endInput = this.endInput();
|
|
125
|
-
const inputNotToBeInTheDocument = !this.range ? !input : !startInput;
|
|
119
|
+
const inputNotToBeInTheDocument = !this.range() ? !input : !startInput;
|
|
126
120
|
if (inputNotToBeInTheDocument) {
|
|
127
121
|
this.initialValue = value;
|
|
128
122
|
return;
|
|
129
123
|
}
|
|
130
|
-
if (this.range) {
|
|
124
|
+
if (this.range()) {
|
|
131
125
|
if (!startInput || !endInput)
|
|
132
126
|
return;
|
|
133
127
|
this.setRangeValue(value, startInput.nativeElement, endInput.nativeElement);
|
|
@@ -137,33 +131,21 @@ class WattPickerBase {
|
|
|
137
131
|
return;
|
|
138
132
|
this.setSingleValue(value, input.nativeElement);
|
|
139
133
|
}
|
|
140
|
-
this.stateChanges.next();
|
|
141
|
-
}
|
|
142
|
-
set range(range) {
|
|
143
|
-
this._range = coerceBooleanProperty(range);
|
|
144
|
-
}
|
|
145
|
-
get range() {
|
|
146
|
-
return this._range;
|
|
147
134
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
set disabled(value) {
|
|
161
|
-
this._disabled = coerceBooleanProperty(value);
|
|
162
|
-
this.stateChanges.next();
|
|
163
|
-
}
|
|
164
|
-
_disabled = false;
|
|
135
|
+
range = input(false, ...(ngDevMode ? [{ debugName: "range", transform: coerceBooleanProperty }] : [{ transform: coerceBooleanProperty }]));
|
|
136
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required", transform: coerceBooleanProperty }] : [{ transform: coerceBooleanProperty }]));
|
|
137
|
+
disabledInput = input(false, ...(ngDevMode ? [{ debugName: "disabledInput",
|
|
138
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
139
|
+
alias: 'disabled',
|
|
140
|
+
transform: coerceBooleanProperty }] : [{
|
|
141
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
142
|
+
alias: 'disabled',
|
|
143
|
+
transform: coerceBooleanProperty,
|
|
144
|
+
}]));
|
|
145
|
+
disabledState = signal(false, ...(ngDevMode ? [{ debugName: "disabledState" }] : []));
|
|
146
|
+
disabled = computed(() => this.disabledInput() || this.disabledState(), ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
165
147
|
get empty() {
|
|
166
|
-
if (this.range) {
|
|
148
|
+
if (this.range()) {
|
|
167
149
|
return !this.ngControl?.value?.start && !this.ngControl?.value?.end;
|
|
168
150
|
}
|
|
169
151
|
else {
|
|
@@ -173,9 +155,9 @@ class WattPickerBase {
|
|
|
173
155
|
get errorState() {
|
|
174
156
|
return !!this.ngControl?.invalid && !!this.ngControl?.touched;
|
|
175
157
|
}
|
|
176
|
-
|
|
177
|
-
return this.focused || !this.empty;
|
|
178
|
-
}
|
|
158
|
+
shouldLabelFloat = computed(() => {
|
|
159
|
+
return this.focused() || !this.empty;
|
|
160
|
+
}, ...(ngDevMode ? [{ debugName: "shouldLabelFloat" }] : []));
|
|
179
161
|
/**
|
|
180
162
|
*
|
|
181
163
|
* @ignore
|
|
@@ -195,16 +177,13 @@ class WattPickerBase {
|
|
|
195
177
|
if (this.initialValue) {
|
|
196
178
|
this.writeValue(this.initialValue);
|
|
197
179
|
}
|
|
198
|
-
if (this.range) {
|
|
180
|
+
if (this.range()) {
|
|
199
181
|
this.initRangeInput();
|
|
200
182
|
}
|
|
201
183
|
else {
|
|
202
184
|
this.initSingleInput();
|
|
203
185
|
}
|
|
204
186
|
}
|
|
205
|
-
ngOnDestroy() {
|
|
206
|
-
this.stateChanges.complete();
|
|
207
|
-
}
|
|
208
187
|
setDescribedByIds(ids) {
|
|
209
188
|
this.elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));
|
|
210
189
|
}
|
|
@@ -212,7 +191,7 @@ class WattPickerBase {
|
|
|
212
191
|
// Intentionally left empty
|
|
213
192
|
}
|
|
214
193
|
writeValue(value) {
|
|
215
|
-
this.value
|
|
194
|
+
this.setValue(value);
|
|
216
195
|
}
|
|
217
196
|
registerOnChange(onChangeFn) {
|
|
218
197
|
this.changeParentValue = onChangeFn;
|
|
@@ -221,13 +200,12 @@ class WattPickerBase {
|
|
|
221
200
|
this.markParentControlAsTouched = onTouchFn;
|
|
222
201
|
}
|
|
223
202
|
setDisabledState(isDisabled) {
|
|
224
|
-
this.
|
|
203
|
+
this.disabledState.set(isDisabled);
|
|
225
204
|
this.changeDetectionRef.detectChanges();
|
|
226
205
|
}
|
|
227
206
|
onFocusIn() {
|
|
228
|
-
if (!this.focused) {
|
|
229
|
-
this.focused
|
|
230
|
-
this.stateChanges.next();
|
|
207
|
+
if (!this.focused()) {
|
|
208
|
+
this.focused.set(true);
|
|
231
209
|
}
|
|
232
210
|
}
|
|
233
211
|
onFocusOut(event) {
|
|
@@ -235,9 +213,8 @@ class WattPickerBase {
|
|
|
235
213
|
const overlay = id ? document.getElementById(id.value) : null;
|
|
236
214
|
const isChild = overlay?.contains(event.relatedTarget);
|
|
237
215
|
if (!this.elementRef.nativeElement.contains(event.relatedTarget) && !isChild) {
|
|
238
|
-
this.focused
|
|
216
|
+
this.focused.set(false);
|
|
239
217
|
this.markParentControlAsTouched();
|
|
240
|
-
this.stateChanges.next();
|
|
241
218
|
}
|
|
242
219
|
}
|
|
243
220
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -248,22 +225,16 @@ class WattPickerBase {
|
|
|
248
225
|
// Intentionally left empty
|
|
249
226
|
};
|
|
250
227
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattPickerBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
251
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.15", type: WattPickerBase, isStandalone: true, inputs: { userAriaDescribedBy: { classPropertyName: "userAriaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null },
|
|
228
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.15", type: WattPickerBase, isStandalone: true, inputs: { userAriaDescribedBy: { classPropertyName: "userAriaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.watt-field-disabled": "disabled()" } }, ngImport: i0 });
|
|
252
229
|
}
|
|
253
230
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattPickerBase, decorators: [{
|
|
254
|
-
type: Directive
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}], disabled: [{
|
|
262
|
-
type: HostBinding,
|
|
263
|
-
args: ['attr.watt-field-disabled']
|
|
264
|
-
}, {
|
|
265
|
-
type: Input
|
|
266
|
-
}] } });
|
|
231
|
+
type: Directive,
|
|
232
|
+
args: [{
|
|
233
|
+
host: {
|
|
234
|
+
'[attr.watt-field-disabled]': 'disabled()',
|
|
235
|
+
},
|
|
236
|
+
}]
|
|
237
|
+
}], ctorParameters: () => [{ type: undefined }], propDecorators: { userAriaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
267
238
|
|
|
268
239
|
//#region License
|
|
269
240
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-picker-__shared.mjs","sources":["../../../libs/watt/package/picker/__shared/placeholder-mask/watt-placeholder-mask.component.ts","../../../libs/watt/package/picker/__shared/placeholder-mask/watt-placeholder-mask.component.html","../../../libs/watt/package/picker/__shared/watt-picker-base.ts","../../../libs/watt/package/picker/__shared/index.ts","../../../libs/watt/package/picker/__shared/energinet-watt-picker-__shared.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 ChangeDetectorRef,\n Component,\n ViewEncapsulation,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport { Maskito, MaskitoOptions } from '@maskito/core';\n\n@Component({\n selector: 'watt-placeholder-mask',\n templateUrl: './watt-placeholder-mask.component.html',\n styleUrls: ['./watt-placeholder-mask.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class WattPlaceholderMaskComponent {\n cdr = inject(ChangeDetectorRef);\n primaryInputElement = input.required<HTMLInputElement>();\n secondaryInputElement = input<HTMLInputElement>();\n mask = input.required<MaskitoOptions>();\n placeholder = input.required<string>();\n maskApplied = output<string>();\n maskedInput = signal<Maskito | null>(null);\n primaryGhost = signal('');\n primaryFiller = signal<string | null>(null);\n\n maskEffect = effect((onCleanup) => {\n const mask = this.mask();\n const placeholder = this.placeholder();\n const primaryMask: MaskitoOptions = {\n ...mask,\n preprocessors: [\n ...(mask.preprocessors ?? []),\n (state) => {\n this.primaryGhost.set(state.elementState.value.slice(0, placeholder.length));\n this.primaryFiller.set(placeholder.slice(state.elementState.value.length));\n return state;\n },\n ],\n postprocessors: [\n (elementState) => {\n this.maskApplied.emit(elementState.value);\n return elementState;\n },\n ...(mask.postprocessors ?? []),\n ],\n };\n\n const maskedInput = new Maskito(this.primaryInputElement(), primaryMask);\n this.maskedInput.set(maskedInput);\n\n onCleanup(() => {\n maskedInput.destroy();\n this.maskedInput.set(null);\n });\n });\n\n inputEffect = effect(() => {\n const primaryInputElement = this.primaryInputElement();\n untracked(() => primaryInputElement.dispatchEvent(new InputEvent('input')));\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<span class=\"ghost\">{{ primaryGhost() }}</span>\n<span class=\"filler\">{{ primaryFiller() ?? placeholder() }}</span>\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Input,\n OnInit,\n Signal,\n inject,\n Directive,\n OnDestroy,\n ElementRef,\n DestroyRef,\n HostBinding,\n AfterViewInit,\n ChangeDetectorRef,\n input,\n} from '@angular/core';\n\nimport { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\n\nimport { Subject } from 'rxjs';\n\nimport { WattDateRange } from '@energinet/watt/core/date';\n\nimport { WattPickerValue } from './watt-picker-value';\n@Directive()\nexport abstract class WattPickerBase\n implements OnInit, AfterViewInit, OnDestroy, ControlValueAccessor\n{\n protected destroyRef = inject(DestroyRef);\n protected changeDetectionRef = inject(ChangeDetectorRef);\n protected ngControl = inject(NgControl, { optional: true });\n protected elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n abstract input: Signal<ElementRef<HTMLInputElement> | undefined>;\n abstract endInput: Signal<ElementRef<HTMLInputElement> | undefined>;\n abstract startInput: Signal<ElementRef<HTMLInputElement> | undefined>;\n\n static nextId = 0;\n\n id: string;\n\n initialValue: WattPickerValue = null;\n\n focused = false;\n\n controlType = 'mat-date-range-input'; // We keep the controlType of Material Date Range Input as is, to keep some styling.\n\n stateChanges = new Subject<void>();\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n userAriaDescribedBy = input<string>(undefined, { alias: 'aria-describedby' });\n\n get placeholder(): string {\n return this._placeholder;\n }\n\n set placeholder(value: string) {\n this._placeholder = value;\n this.stateChanges.next();\n }\n\n protected abstract _placeholder: string;\n\n @Input()\n get value(): WattDateRange | null {\n if (this.ngControl?.valid) {\n const {\n value: { start, end },\n } = this.ngControl;\n\n return { start, end };\n }\n\n return null;\n }\n\n set value(value: WattPickerValue) {\n const input = this.input();\n const startInput = this.startInput();\n const endInput = this.endInput();\n\n const inputNotToBeInTheDocument = !this.range ? !input : !startInput;\n\n if (inputNotToBeInTheDocument) {\n this.initialValue = value;\n return;\n }\n\n if (this.range) {\n if (!startInput || !endInput) return;\n this.setRangeValue(value as WattDateRange, startInput.nativeElement, endInput.nativeElement);\n } else {\n if (!input) return;\n this.setSingleValue(value as Exclude<WattPickerValue, WattDateRange>, input.nativeElement);\n }\n\n this.stateChanges.next();\n }\n\n @Input()\n set range(range: boolean) {\n this._range = coerceBooleanProperty(range);\n }\n get range(): boolean {\n return this._range;\n }\n\n private _range = false;\n\n @Input()\n get required(): boolean {\n return this._required;\n }\n\n set required(value: BooleanInput) {\n this._required = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n\n private _required = false;\n\n @HostBinding('attr.watt-field-disabled')\n @Input()\n get disabled(): boolean {\n return this._disabled;\n }\n\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n\n private _disabled = false;\n\n get empty() {\n if (this.range) {\n return !this.ngControl?.value?.start && !this.ngControl?.value?.end;\n } else {\n return this.ngControl?.value?.length === 0;\n }\n }\n\n get errorState(): boolean {\n return !!this.ngControl?.invalid && !!this.ngControl?.touched;\n }\n\n get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n\n /**\n *\n * @ignore\n */\n control: FormControl | null = null;\n\n constructor(id: string) {\n this.id = id;\n this.elementRef.nativeElement.setAttribute('id', id);\n\n if (this.ngControl != null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n ngOnInit(): void {\n this.control = this.ngControl?.control as FormControl;\n }\n\n ngAfterViewInit() {\n if (this.initialValue) {\n this.writeValue(this.initialValue);\n }\n\n if (this.range) {\n this.initRangeInput();\n } else {\n this.initSingleInput();\n }\n }\n\n ngOnDestroy(): void {\n this.stateChanges.complete();\n }\n\n protected abstract initRangeInput(): void;\n\n protected abstract initSingleInput(): void;\n\n protected abstract setSingleValue(\n value: Exclude<WattPickerValue, WattDateRange>,\n input: HTMLInputElement\n ): void;\n\n protected abstract setRangeValue(\n value: WattDateRange,\n startInput: HTMLInputElement,\n endInput: HTMLInputElement\n ): void;\n\n setDescribedByIds(ids: string[]) {\n this.elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));\n }\n\n onContainerClick() {\n // Intentionally left empty\n }\n\n writeValue(value: WattPickerValue): void {\n this.value = value;\n }\n\n registerOnChange(onChangeFn: (value: string | WattDateRange) => void): void {\n this.changeParentValue = onChangeFn;\n }\n\n registerOnTouched(onTouchFn: () => void) {\n this.markParentControlAsTouched = onTouchFn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.changeDetectionRef.detectChanges();\n }\n\n onFocusIn() {\n if (!this.focused) {\n this.focused = true;\n this.stateChanges.next();\n }\n }\n\n onFocusOut(event: FocusEvent) {\n const id = this.elementRef.nativeElement.attributes.getNamedItem('aria-owns');\n const overlay = id ? document.getElementById(id.value) : null;\n const isChild = overlay?.contains(event.relatedTarget as Element);\n\n if (!this.elementRef.nativeElement.contains(event.relatedTarget as Element) && !isChild) {\n this.focused = false;\n this.markParentControlAsTouched();\n this.stateChanges.next();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected changeParentValue = (value: string | WattDateRange): void => {\n // Intentionally left empty\n };\n\n protected markParentControlAsTouched = (): void => {\n // Intentionally left empty\n };\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattPlaceholderMaskComponent } from './placeholder-mask/watt-placeholder-mask.component';\nexport { WattPickerBase } from './watt-picker-base';\nexport { WattPickerValue } from './watt-picker-value';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAoBa,4BAA4B,CAAA;AACvC,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC/B,IAAA,mBAAmB,GAAG,KAAK,CAAC,QAAQ,8DAAoB;IACxD,qBAAqB,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,uBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAoB;AACjD,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAkB;AACvC,IAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,sDAAU;IACtC,WAAW,GAAG,MAAM,EAAU;AAC9B,IAAA,WAAW,GAAG,MAAM,CAAiB,IAAI,uDAAC;AAC1C,IAAA,YAAY,GAAG,MAAM,CAAC,EAAE,wDAAC;AACzB,IAAA,aAAa,GAAG,MAAM,CAAgB,IAAI,yDAAC;AAE3C,IAAA,UAAU,GAAG,MAAM,CAAC,CAAC,SAAS,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AA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,0BAAA,EAAA,eAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBADnC;;sBAuCE;;sBAoCA;;sBAUA;;sBAYA,WAAW;uBAAC,0BAA0B;;sBACtC;;;AC3IH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-picker-__shared.mjs","sources":["../../../libs/watt/package/picker/__shared/placeholder-mask/watt-placeholder-mask.component.ts","../../../libs/watt/package/picker/__shared/placeholder-mask/watt-placeholder-mask.component.html","../../../libs/watt/package/picker/__shared/watt-picker-base.ts","../../../libs/watt/package/picker/__shared/index.ts","../../../libs/watt/package/picker/__shared/energinet-watt-picker-__shared.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 ChangeDetectorRef,\n Component,\n ViewEncapsulation,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport { Maskito, MaskitoOptions } from '@maskito/core';\n\n@Component({\n selector: 'watt-placeholder-mask',\n templateUrl: './watt-placeholder-mask.component.html',\n styleUrls: ['./watt-placeholder-mask.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class WattPlaceholderMaskComponent {\n cdr = inject(ChangeDetectorRef);\n primaryInputElement = input.required<HTMLInputElement>();\n secondaryInputElement = input<HTMLInputElement>();\n mask = input.required<MaskitoOptions>();\n placeholder = input.required<string>();\n maskApplied = output<string>();\n maskedInput = signal<Maskito | null>(null);\n primaryGhost = signal('');\n primaryFiller = signal<string | null>(null);\n\n maskEffect = effect((onCleanup) => {\n const placeholder = this.placeholder();\n if (!placeholder) return;\n const mask = this.mask();\n const primaryMask: MaskitoOptions = {\n ...mask,\n preprocessors: [\n ...(mask.preprocessors ?? []),\n (state) => {\n this.primaryGhost.set(state.elementState.value.slice(0, placeholder.length));\n this.primaryFiller.set(placeholder.slice(state.elementState.value.length));\n return state;\n },\n ],\n postprocessors: [\n (elementState) => {\n this.maskApplied.emit(elementState.value);\n return elementState;\n },\n ...(mask.postprocessors ?? []),\n ],\n };\n\n const maskedInput = new Maskito(this.primaryInputElement(), primaryMask);\n this.maskedInput.set(maskedInput);\n\n onCleanup(() => {\n maskedInput.destroy();\n this.maskedInput.set(null);\n });\n });\n\n inputEffect = effect(() => {\n const primaryInputElement = this.primaryInputElement();\n untracked(() => primaryInputElement.dispatchEvent(new InputEvent('input')));\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<span class=\"ghost\">{{ primaryGhost() }}</span>\n<span class=\"filler\">{{ primaryFiller() ?? placeholder() }}</span>\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Signal,\n OnInit,\n inject,\n signal,\n Directive,\n ElementRef,\n DestroyRef,\n AfterViewInit,\n ChangeDetectorRef,\n input,\n computed,\n} from '@angular/core';\n\nimport { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\n\nimport { WattDateRange } from '@energinet/watt/core/date';\n\nimport { WattPickerValue } from './watt-picker-value';\n\n@Directive({\n host: {\n '[attr.watt-field-disabled]': 'disabled()',\n },\n})\nexport abstract class WattPickerBase implements OnInit, AfterViewInit, ControlValueAccessor {\n protected destroyRef = inject(DestroyRef);\n protected changeDetectionRef = inject(ChangeDetectorRef);\n protected ngControl = inject(NgControl, { optional: true });\n protected elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n abstract input: Signal<ElementRef<HTMLInputElement> | undefined>;\n abstract endInput: Signal<ElementRef<HTMLInputElement> | undefined>;\n abstract startInput: Signal<ElementRef<HTMLInputElement> | undefined>;\n\n static nextId = 0;\n\n id: string;\n\n initialValue: WattPickerValue = null;\n\n focused = signal(false);\n\n controlType = 'mat-date-range-input'; // We keep the controlType of Material Date Range Input as is, to keep some styling.\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n userAriaDescribedBy = input<string>(undefined, { alias: 'aria-describedby' });\n\n placeholder = signal('');\n\n get value(): WattDateRange | null {\n if (this.ngControl?.valid) {\n const {\n value: { start, end },\n } = this.ngControl;\n\n return { start, end };\n }\n\n return null;\n }\n\n protected setValue(value: WattPickerValue) {\n const input = this.input();\n const startInput = this.startInput();\n const endInput = this.endInput();\n\n const inputNotToBeInTheDocument = !this.range() ? !input : !startInput;\n\n if (inputNotToBeInTheDocument) {\n this.initialValue = value;\n return;\n }\n\n if (this.range()) {\n if (!startInput || !endInput) return;\n this.setRangeValue(value as WattDateRange, startInput.nativeElement, endInput.nativeElement);\n } else {\n if (!input) return;\n this.setSingleValue(value as Exclude<WattPickerValue, WattDateRange>, input.nativeElement);\n }\n }\n\n range = input<boolean, BooleanInput>(false, { transform: coerceBooleanProperty });\n\n required = input<boolean, BooleanInput>(false, { transform: coerceBooleanProperty });\n\n disabledInput = input<boolean, BooleanInput>(false, {\n // eslint-disable-next-line @angular-eslint/no-input-rename\n alias: 'disabled',\n transform: coerceBooleanProperty,\n });\n protected disabledState = signal(false);\n disabled = computed(() => this.disabledInput() || this.disabledState());\n\n get empty(): boolean {\n if (this.range()) {\n return !this.ngControl?.value?.start && !this.ngControl?.value?.end;\n } else {\n return this.ngControl?.value?.length === 0;\n }\n }\n\n get errorState(): boolean {\n return !!this.ngControl?.invalid && !!this.ngControl?.touched;\n }\n\n shouldLabelFloat = computed(() => {\n return this.focused() || !this.empty;\n });\n\n /**\n *\n * @ignore\n */\n control: FormControl | null = null;\n\n constructor(id: string) {\n this.id = id;\n this.elementRef.nativeElement.setAttribute('id', id);\n\n if (this.ngControl != null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n ngOnInit(): void {\n this.control = this.ngControl?.control as FormControl;\n }\n\n ngAfterViewInit(): void {\n if (this.initialValue) {\n this.writeValue(this.initialValue);\n }\n\n if (this.range()) {\n this.initRangeInput();\n } else {\n this.initSingleInput();\n }\n }\n\n protected abstract initRangeInput(): void;\n\n protected abstract initSingleInput(): void;\n\n protected abstract setSingleValue(\n value: Exclude<WattPickerValue, WattDateRange>,\n input: HTMLInputElement\n ): void;\n\n protected abstract setRangeValue(\n value: WattDateRange,\n startInput: HTMLInputElement,\n endInput: HTMLInputElement\n ): void;\n\n setDescribedByIds(ids: string[]) {\n this.elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));\n }\n\n onContainerClick() {\n // Intentionally left empty\n }\n\n writeValue(value: WattPickerValue): void {\n this.setValue(value);\n }\n\n registerOnChange(onChangeFn: (value: string | WattDateRange) => void): void {\n this.changeParentValue = onChangeFn;\n }\n\n registerOnTouched(onTouchFn: () => void) {\n this.markParentControlAsTouched = onTouchFn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabledState.set(isDisabled);\n this.changeDetectionRef.detectChanges();\n }\n\n onFocusIn() {\n if (!this.focused()) {\n this.focused.set(true);\n }\n }\n\n onFocusOut(event: FocusEvent) {\n const id = this.elementRef.nativeElement.attributes.getNamedItem('aria-owns');\n const overlay = id ? document.getElementById(id.value) : null;\n const isChild = overlay?.contains(event.relatedTarget as Element);\n\n if (!this.elementRef.nativeElement.contains(event.relatedTarget as Element) && !isChild) {\n this.focused.set(false);\n this.markParentControlAsTouched();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected changeParentValue = (value: string | WattDateRange): void => {\n // Intentionally left empty\n };\n\n protected markParentControlAsTouched = (): void => {\n // Intentionally left empty\n };\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattPlaceholderMaskComponent } from './placeholder-mask/watt-placeholder-mask.component';\nexport { WattPickerBase } from './watt-picker-base';\nexport { WattPickerValue } from './watt-picker-value';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAoBa,4BAA4B,CAAA;AACvC,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC/B,IAAA,mBAAmB,GAAG,KAAK,CAAC,QAAQ,8DAAoB;IACxD,qBAAqB,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,uBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAoB;AACjD,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAkB;AACvC,IAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,sDAAU;IACtC,WAAW,GAAG,MAAM,EAAU;AAC9B,IAAA,WAAW,GAAG,MAAM,CAAiB,IAAI,uDAAC;AAC1C,IAAA,YAAY,GAAG,MAAM,CAAC,EAAE,wDAAC;AACzB,IAAA,aAAa,GAAG,MAAM,CAAgB,IAAI,yDAAC;AAE3C,IAAA,UAAU,GAAG,MAAM,CAAC,CAAC,SAAS,KAAI;AAChC,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE;AACtC,QAAA,IAAI,CAAC,WAAW;YAAE;AAClB,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE;AACxB,QAAA,MAAM,WAAW,GAAmB;AA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A,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,0BAAA,EAAA,YAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBALnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,IAAI,EAAE;AACJ,wBAAA,4BAA4B,EAAE,YAAY;AAC3C,qBAAA;AACF,iBAAA;;;AC3CD;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -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,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxE,IAAA,aAAa,GAAG,MAAM,CAAC,iBAAiB,CAAC;AACzC,IAAA,MAAM,GAAG,MAAM,CAAuB,SAAS,CAAC;IAExD,GAAG,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,KAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAQ;IACnB,GAAG,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,KAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAQ;AACnB,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;AACzB,IAAA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;;;;;;;;;;;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,CAAC;AACxD,IAAA,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC9C,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxE,IAAA,aAAa,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAEjD,GAAG,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,KAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAQ;IACnB,GAAG,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,KAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAQ;AACnB,IAAA,KAAK,GAAG,KAAK,CAAS,E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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
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-picker-timepicker.mjs","sources":["../../../libs/watt/package/picker/timepicker/maskito-time-range-mask.ts","../../../libs/watt/package/picker/timepicker/watt-timepicker.component.ts","../../../libs/watt/package/picker/timepicker/watt-timepicker.component.html","../../../libs/watt/package/picker/timepicker/index.ts","../../../libs/watt/package/picker/timepicker/energinet-watt-picker-timepicker.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 { MASKITO_DEFAULT_OPTIONS, MaskitoOptions } from '@maskito/core';\nimport { ElementState } from '@maskito/core/src/lib/types';\n\nconst TIME_FIXED_CHARACTERS = [':', '.'];\n\nconst SEPARATOR = ' - ';\n\nexport function maskitoTimeRangeOptionsGenerator(): Required<MaskitoOptions> {\n return {\n ...MASKITO_DEFAULT_OPTIONS,\n mask: [\n ...Array.from('HH:MM').map((char) => (TIME_FIXED_CHARACTERS.includes(char) ? char : /\\d/)),\n ...Array.from(SEPARATOR),\n ...Array.from('HH:MM').map((char) => (TIME_FIXED_CHARACTERS.includes(char) ? char : /\\d/)),\n ],\n preprocessors: [\n ({ elementState, data }, actionType) => {\n if (actionType !== 'insert' || data.length > 1) {\n return {\n elementState,\n data,\n };\n }\n if (Number.parseInt(data) > 2 && isFirstHourSegment(elementState)) {\n return {\n elementState: {\n selection: elementState.selection,\n value: elementState.value + '0' + data,\n },\n data: '0' + data,\n };\n }\n if (\n Number.parseInt(data) > 5 &&\n (elementState.value.length === 3 || elementState.value.length === 10)\n ) {\n return {\n elementState: {\n selection: elementState.selection,\n value: elementState.value + '0' + data,\n },\n data: '0' + data,\n };\n }\n return {\n elementState,\n data,\n };\n },\n ],\n overwriteMode: 'replace',\n };\n}\nfunction isFirstHourSegment(elementState: ElementState) {\n if (elementState.value.length === 0) {\n return true;\n }\n if (elementState.value.endsWith(SEPARATOR)) {\n return elementState.value.length === 8;\n }\n if (elementState.value.endsWith(' -')) {\n return elementState.value.length === 7;\n }\n if (elementState.value.endsWith(' ')) {\n return elementState.value.length === 6;\n }\n return elementState.value.length === 5;\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 { OverlayModule } from '@angular/cdk/overlay';\nimport {\n ChangeDetectorRef,\n Component,\n DestroyRef,\n ElementRef,\n HostBinding,\n ViewEncapsulation,\n inject,\n input,\n viewChild,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { MatDatepickerModule } from '@angular/material/datepicker';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { Subject } from 'rxjs';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { maskitoTimeOptionsGenerator } from '@maskito/kit';\n\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattDateRange } from '@energinet/watt/core/date';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattSliderComponent, WattSliderValue } from '@energinet/watt/slider';\n\nimport { maskitoTimeRangeOptionsGenerator } from './maskito-time-range-mask';\nimport {\n WattPickerBase,\n WattPickerValue,\n WattPlaceholderMaskComponent,\n} from '@energinet/watt/picker/__shared';\n\n// Constants for working with time intervals\nconst minutesInADay = 24 * 60;\nconst quartersInADay = minutesInADay / 15;\n\n// Show slider initially as \"00:00 - 23:59\"\nconst initialSliderValue: WattSliderValue = { min: 0, max: minutesInADay - 1 };\n\n/** Converts string time format (HH:MM) to number of minutes. */\nfunction timeToMinutes(value: string): number {\n const [hours, minutes] = value.split(':');\n return Number(hours) * 60 + Number(minutes);\n}\n\n/** Converts number of minutes to string time format (HH:MM). */\nfunction minutesToTime(value: number): string {\n const hours = `${Math.floor(value / 60)}`;\n const minutes = `${value % 60}`;\n return `${hours.padStart(2, '0')}:${minutes.padStart(2, '0')}`;\n}\n/**\n * Usage:\n * `import { WattTimepickerComponent } from '@energinet/watt/timepicker';`\n *\n * IMPORTANT:\n * The styling is calculated based on our monospaced font.\n */\n@Component({\n selector: 'watt-timepicker',\n templateUrl: './watt-timepicker.component.html',\n styleUrls: ['./watt-timepicker.component.scss'],\n providers: [{ provide: MatFormFieldControl, useExisting: WattTimepickerComponent }],\n encapsulation: ViewEncapsulation.None,\n imports: [\n MatDatepickerModule,\n MatInputModule,\n OverlayModule,\n\n WattButtonComponent,\n WattSliderComponent,\n WattFieldComponent,\n WattPlaceholderMaskComponent,\n ],\n})\nexport class WattTimepickerComponent extends WattPickerBase {\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 label = input('');\n /**\n * Text to display on label for time range slider.\n */\n sliderLabel = input('');\n\n override input = viewChild<ElementRef<HTMLInputElement>>('timeInput');\n override startInput = viewChild<ElementRef<HTMLInputElement>>('startTimeInput');\n override endInput = viewChild<ElementRef<HTMLInputElement>>('endTimeInput');\n\n sliderId = `${this.id}-slider`;\n\n /**\n * Used for defining a relationship between the time picker and\n * the slider overlay (since the DOM hierarchy cannot be used).\n * @ignore\n */\n @HostBinding('attr.aria-owns')\n get ariaOwns() {\n // Only range input has slider\n return this.range && this.sliderOpen ? this.sliderId : undefined;\n }\n hoursMinutesPlaceholder = 'HH:MM';\n rangeSeparator = ' - ';\n rangePlaceholder =\n this.hoursMinutesPlaceholder + this.rangeSeparator + this.hoursMinutesPlaceholder;\n protected _placeholder = this.hoursMinutesPlaceholder;\n\n /**\n * Whether the slider is open.\n * @ignore\n */\n sliderOpen = false;\n\n sliderSteps = [...Array(quartersInADay).keys()].map((x) => x * 15).concat(minutesInADay - 1);\n\n sliderChange$ = new Subject<WattSliderValue>();\n\n get sliderValue(): WattSliderValue {\n if (this.value?.start && this.value?.end) {\n return {\n min: timeToMinutes(this.value.start),\n max: timeToMinutes(this.value.end),\n };\n }\n\n // Retain last slider value if input value is incomplete\n return initialSliderValue;\n }\n\n /**\n * Toggles the visibility of the slider overlay.\n * @ignore\n */\n toggleSlider() {\n this.sliderOpen = !this.sliderOpen;\n }\n\n /**\n * Override to automatically close the slider overlay on blur.\n * @ignore\n */\n override onFocusOut(event: FocusEvent) {\n super.onFocusOut(event);\n if (!this.focused) this.sliderOpen = false;\n }\n\n inputMask = maskitoTimeOptionsGenerator({ mode: 'HH:MM' });\n rangeInputMask = maskitoTimeRangeOptionsGenerator();\n override destroyRef = inject(DestroyRef);\n\n constructor() {\n super(`watt-timepicker-${WattTimepickerComponent.nextId++}`);\n }\n\n protected initSingleInput() {\n const input = this.input();\n if (this.initialValue && input) {\n (input.nativeElement as HTMLInputElement).value = this.initialValue as string;\n input.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n }\n\n inputChanged(value: string) {\n const time = value.slice(0, this.hoursMinutesPlaceholder.length);\n if (time.length === 0) {\n this.control?.setValue(null);\n return;\n }\n if (time.length !== this.hoursMinutesPlaceholder.length) {\n return;\n }\n this.control?.setValue(time);\n }\n\n rangeInputChanged(value: string) {\n const start = value.slice(0, this.hoursMinutesPlaceholder.length);\n if (start.length !== this.hoursMinutesPlaceholder.length) {\n this.control?.setValue({ start: '', end: '' });\n return;\n }\n if (value.length < this.rangePlaceholder.length) {\n this.control?.setValue({ start, end: '' });\n return;\n }\n let end = value.slice(this.hoursMinutesPlaceholder.length + this.rangeSeparator.length);\n if (timeToMinutes(end) > timeToMinutes(start)) {\n this.control?.setValue({ start, end });\n } else {\n end = minutesToTime(timeToMinutes(start) + 1);\n this.setRangeValueAndNotify(start, end);\n }\n }\n\n protected initRangeInput() {\n if (this.initialValue) {\n const { start, end } = this.initialValue as WattDateRange;\n this.setRangeValueAndNotify(start, end);\n } else {\n this.control?.setValue({ start: '', end: '' });\n }\n this.sliderChange$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((sliderValue) => {\n const start = minutesToTime(sliderValue.min);\n const end = minutesToTime(sliderValue.max);\n if (end > start) {\n this.setRangeValueAndNotify(start, end);\n }\n });\n }\n\n setRangeValueAndNotify(start: string, end: string | null) {\n this.control?.setValue({ start, end });\n const input = this.input();\n if (!input) return;\n (input.nativeElement as HTMLInputElement).value = start + this.rangeSeparator + end;\n input.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n protected setSingleValue(\n value: Exclude<WattPickerValue, WattDateRange>,\n input: HTMLInputElement\n ) {\n input.value = value ?? '';\n }\n\n protected setRangeValue(\n value: WattDateRange,\n startInput: HTMLInputElement,\n endInput: HTMLInputElement\n ) {\n const { start, end } = value;\n\n if (start) {\n startInput.value = start;\n }\n\n if (end) {\n endInput.value = end;\n }\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 [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","//#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 { WattTimepickerComponent } from './watt-timepicker.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAIA,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC;AAExC,MAAM,SAAS,GAAG,KAAK;SAEP,gCAAgC,GAAA;IAC9C,OAAO;AACL,QAAA,GAAG,uBAAuB;AAC1B,QAAA,IAAI,EAAE;AACJ,YAAA,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AAC1F,YAAA,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;AACxB,YAAA,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AAC3F,SAAA;AACD,QAAA,aAAa,EAAE;YACb,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,UAAU,KAAI;gBACrC,IAAI,U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epicker.mjs","sources":["../../../libs/watt/package/picker/timepicker/maskito-time-range-mask.ts","../../../libs/watt/package/picker/timepicker/watt-timepicker.component.ts","../../../libs/watt/package/picker/timepicker/watt-timepicker.component.html","../../../libs/watt/package/picker/timepicker/index.ts","../../../libs/watt/package/picker/timepicker/energinet-watt-picker-timepicker.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 { MASKITO_DEFAULT_OPTIONS, MaskitoOptions } from '@maskito/core';\nimport { ElementState } from '@maskito/core/src/lib/types';\n\nconst TIME_FIXED_CHARACTERS = [':', '.'];\n\nconst SEPARATOR = ' - ';\n\nexport function maskitoTimeRangeOptionsGenerator(): Required<MaskitoOptions> {\n return {\n ...MASKITO_DEFAULT_OPTIONS,\n mask: [\n ...Array.from('HH:MM').map((char) => (TIME_FIXED_CHARACTERS.includes(char) ? char : /\\d/)),\n ...Array.from(SEPARATOR),\n ...Array.from('HH:MM').map((char) => (TIME_FIXED_CHARACTERS.includes(char) ? char : /\\d/)),\n ],\n preprocessors: [\n ({ elementState, data }, actionType) => {\n if (actionType !== 'insert' || data.length > 1) {\n return {\n elementState,\n data,\n };\n }\n if (Number.parseInt(data) > 2 && isFirstHourSegment(elementState)) {\n return {\n elementState: {\n selection: elementState.selection,\n value: elementState.value + '0' + data,\n },\n data: '0' + data,\n };\n }\n if (\n Number.parseInt(data) > 5 &&\n (elementState.value.length === 3 || elementState.value.length === 10)\n ) {\n return {\n elementState: {\n selection: elementState.selection,\n value: elementState.value + '0' + data,\n },\n data: '0' + data,\n };\n }\n return {\n elementState,\n data,\n };\n },\n ],\n overwriteMode: 'replace',\n };\n}\nfunction isFirstHourSegment(elementState: ElementState) {\n if (elementState.value.length === 0) {\n return true;\n }\n if (elementState.value.endsWith(SEPARATOR)) {\n return elementState.value.length === 8;\n }\n if (elementState.value.endsWith(' -')) {\n return elementState.value.length === 7;\n }\n if (elementState.value.endsWith(' ')) {\n return elementState.value.length === 6;\n }\n return elementState.value.length === 5;\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 { OverlayModule } from '@angular/cdk/overlay';\nimport {\n ChangeDetectorRef,\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { MatDatepickerModule } from '@angular/material/datepicker';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { Subject } from 'rxjs';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { maskitoTimeOptionsGenerator } from '@maskito/kit';\n\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattDateRange } from '@energinet/watt/core/date';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattSliderComponent, WattSliderValue } from '@energinet/watt/slider';\n\nimport { maskitoTimeRangeOptionsGenerator } from './maskito-time-range-mask';\nimport {\n WattPickerBase,\n WattPickerValue,\n WattPlaceholderMaskComponent,\n} from '@energinet/watt/picker/__shared';\n\n// Constants for working with time intervals\nconst minutesInADay = 24 * 60;\nconst quartersInADay = minutesInADay / 15;\n\n// Show slider initially as \"00:00 - 23:59\"\nconst initialSliderValue: WattSliderValue = { min: 0, max: minutesInADay - 1 };\n\n/** Converts string time format (HH:MM) to number of minutes. */\nfunction timeToMinutes(value: string): number {\n const [hours, minutes] = value.split(':');\n return Number(hours) * 60 + Number(minutes);\n}\n\n/** Converts number of minutes to string time format (HH:MM). */\nfunction minutesToTime(value: number): string {\n const hours = `${Math.floor(value / 60)}`;\n const minutes = `${value % 60}`;\n return `${hours.padStart(2, '0')}:${minutes.padStart(2, '0')}`;\n}\n/**\n * Usage:\n * `import { WattTimepickerComponent } from '@energinet/watt/timepicker';`\n *\n * IMPORTANT:\n * The styling is calculated based on our monospaced font.\n */\n@Component({\n selector: 'watt-timepicker',\n templateUrl: './watt-timepicker.component.html',\n styleUrls: ['./watt-timepicker.component.scss'],\n providers: [{ provide: MatFormFieldControl, useExisting: WattTimepickerComponent }],\n encapsulation: ViewEncapsulation.None,\n host: {\n '[attr.aria-owns]': 'ariaOwns()',\n },\n imports: [\n MatDatepickerModule,\n MatInputModule,\n OverlayModule,\n\n WattButtonComponent,\n WattSliderComponent,\n WattFieldComponent,\n WattPlaceholderMaskComponent,\n ],\n})\nexport class WattTimepickerComponent extends WattPickerBase {\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 label = input('');\n /**\n * Text to display on label for time range slider.\n */\n sliderLabel = input('');\n\n override input = viewChild<ElementRef<HTMLInputElement>>('timeInput');\n override startInput = viewChild<ElementRef<HTMLInputElement>>('startTimeInput');\n override endInput = viewChild<ElementRef<HTMLInputElement>>('endTimeInput');\n\n sliderId = `${this.id}-slider`;\n\n /**\n * Used for defining a relationship between the time picker and\n * the slider overlay (since the DOM hierarchy cannot be used).\n * @ignore\n */\n ariaOwns = computed(() => {\n // Only range input has slider\n return this.range() && this.sliderOpen() ? this.sliderId : undefined;\n });\n\n hoursMinutesPlaceholder = 'HH:MM';\n rangeSeparator = ' - ';\n rangePlaceholder =\n this.hoursMinutesPlaceholder + this.rangeSeparator + this.hoursMinutesPlaceholder;\n /**\n * Whether the slider is open.\n * @ignore\n */\n sliderOpen = signal(false);\n\n sliderSteps = [...Array(quartersInADay).keys()].map((x) => x * 15).concat(minutesInADay - 1);\n\n sliderChange$ = new Subject<WattSliderValue>();\n\n get sliderValue(): WattSliderValue {\n const value = this.control?.value;\n if (value?.start && value?.end) {\n return {\n min: timeToMinutes(value.start),\n max: timeToMinutes(value.end),\n };\n }\n\n // Retain last slider value if input value is incomplete\n return initialSliderValue;\n }\n\n /**\n * Toggles the visibility of the slider overlay.\n * @ignore\n */\n toggleSlider() {\n this.sliderOpen.update((open) => !open);\n }\n\n /**\n * Override to automatically close the slider overlay on blur.\n * @ignore\n */\n override onFocusOut(event: FocusEvent) {\n super.onFocusOut(event);\n if (!this.focused()) this.sliderOpen.set(false);\n }\n\n inputMask = maskitoTimeOptionsGenerator({ mode: 'HH:MM' });\n rangeInputMask = maskitoTimeRangeOptionsGenerator();\n override destroyRef = inject(DestroyRef);\n\n constructor() {\n super(`watt-timepicker-${WattTimepickerComponent.nextId++}`);\n this.placeholder.set(this.hoursMinutesPlaceholder);\n }\n\n protected initSingleInput() {\n const input = this.input();\n if (this.initialValue && input) {\n (input.nativeElement as HTMLInputElement).value = this.initialValue as string;\n input.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n }\n\n inputChanged(value: string) {\n const time = value.slice(0, this.hoursMinutesPlaceholder.length);\n if (time.length === 0) {\n this.control?.setValue(null);\n return;\n }\n if (time.length !== this.hoursMinutesPlaceholder.length) {\n return;\n }\n this.control?.setValue(time);\n }\n\n rangeInputChanged(value: string) {\n const start = value.slice(0, this.hoursMinutesPlaceholder.length);\n if (start.length !== this.hoursMinutesPlaceholder.length) {\n this.control?.setValue({ start: '', end: '' });\n return;\n }\n if (value.length < this.rangePlaceholder.length) {\n this.control?.setValue({ start, end: '' });\n return;\n }\n let end = value.slice(this.hoursMinutesPlaceholder.length + this.rangeSeparator.length);\n if (timeToMinutes(end) > timeToMinutes(start)) {\n this.control?.setValue({ start, end });\n } else {\n end = minutesToTime(timeToMinutes(start) + 1);\n this.setRangeValueAndNotify(start, end);\n }\n }\n\n protected initRangeInput() {\n if (this.initialValue) {\n const { start, end } = this.initialValue as WattDateRange;\n this.setRangeValueAndNotify(start, end);\n } else {\n this.control?.setValue({ start: '', end: '' });\n }\n this.sliderChange$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((sliderValue) => {\n const start = minutesToTime(sliderValue.min);\n const end = minutesToTime(sliderValue.max);\n if (end > start) {\n this.setRangeValueAndNotify(start, end);\n }\n });\n }\n\n setRangeValueAndNotify(start: string, end: string | null) {\n this.control?.setValue({ start, end });\n const input = this.input();\n if (!input) return;\n (input.nativeElement as HTMLInputElement).value = start + this.rangeSeparator + end;\n input.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n protected setSingleValue(\n value: Exclude<WattPickerValue, WattDateRange>,\n input: HTMLInputElement\n ) {\n input.value = value ?? '';\n }\n\n protected setRangeValue(\n value: WattDateRange,\n startInput: HTMLInputElement,\n endInput: HTMLInputElement\n ) {\n const { start, end } = value;\n\n if (start) {\n startInput.value = start;\n }\n\n if (end) {\n endInput.value = end;\n }\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 [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","//#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 { WattTimepickerComponent } from './watt-timepicker.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAIA,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC;AAExC,MAAM,SAAS,GAAG,KAAK;SAEP,gCAAgC,GAAA;IAC9C,OAAO;AACL,QAAA,GAAG,uBAAuB;AAC1B,QAAA,IAAI,EAAE;AACJ,YAAA,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AAC1F,YAAA,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;AACxB,YAAA,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC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A,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAClB,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE7G5E;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ChangeDetectorRef, OnInit, AfterViewInit,
|
|
2
|
+
import { ChangeDetectorRef, OnInit, AfterViewInit, DestroyRef, ElementRef, Signal } from '@angular/core';
|
|
3
3
|
import { MaskitoOptions, Maskito } from '@maskito/core';
|
|
4
4
|
import { ControlValueAccessor, NgControl, FormControl } from '@angular/forms';
|
|
5
5
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
6
|
-
import { Subject } from 'rxjs';
|
|
7
6
|
import { WattDateRange } from '@energinet/watt/core/date';
|
|
8
7
|
|
|
9
8
|
declare class WattPlaceholderMaskComponent {
|
|
@@ -41,7 +40,7 @@ declare class WattPlaceholderMaskComponent {
|
|
|
41
40
|
|
|
42
41
|
type WattPickerValue = string | WattDateRange | null | undefined;
|
|
43
42
|
|
|
44
|
-
declare abstract class WattPickerBase implements OnInit, AfterViewInit,
|
|
43
|
+
declare abstract class WattPickerBase implements OnInit, AfterViewInit, ControlValueAccessor {
|
|
45
44
|
protected destroyRef: DestroyRef;
|
|
46
45
|
protected changeDetectionRef: ChangeDetectorRef;
|
|
47
46
|
protected ngControl: NgControl | null;
|
|
@@ -52,27 +51,20 @@ declare abstract class WattPickerBase implements OnInit, AfterViewInit, OnDestro
|
|
|
52
51
|
static nextId: number;
|
|
53
52
|
id: string;
|
|
54
53
|
initialValue: WattPickerValue;
|
|
55
|
-
focused: boolean
|
|
54
|
+
focused: _angular_core.WritableSignal<boolean>;
|
|
56
55
|
controlType: string;
|
|
57
|
-
stateChanges: Subject<void>;
|
|
58
56
|
userAriaDescribedBy: _angular_core.InputSignal<string | undefined>;
|
|
59
|
-
|
|
60
|
-
set placeholder(value: string);
|
|
61
|
-
protected abstract _placeholder: string;
|
|
57
|
+
placeholder: _angular_core.WritableSignal<string>;
|
|
62
58
|
get value(): WattDateRange | null;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
private _required;
|
|
70
|
-
get disabled(): boolean;
|
|
71
|
-
set disabled(value: BooleanInput);
|
|
72
|
-
private _disabled;
|
|
59
|
+
protected setValue(value: WattPickerValue): void;
|
|
60
|
+
range: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
61
|
+
required: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
62
|
+
disabledInput: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
63
|
+
protected disabledState: _angular_core.WritableSignal<boolean>;
|
|
64
|
+
disabled: Signal<boolean>;
|
|
73
65
|
get empty(): boolean;
|
|
74
66
|
get errorState(): boolean;
|
|
75
|
-
|
|
67
|
+
shouldLabelFloat: Signal<boolean>;
|
|
76
68
|
/**
|
|
77
69
|
*
|
|
78
70
|
* @ignore
|
|
@@ -81,7 +73,6 @@ declare abstract class WattPickerBase implements OnInit, AfterViewInit, OnDestro
|
|
|
81
73
|
constructor(id: string);
|
|
82
74
|
ngOnInit(): void;
|
|
83
75
|
ngAfterViewInit(): void;
|
|
84
|
-
ngOnDestroy(): void;
|
|
85
76
|
protected abstract initRangeInput(): void;
|
|
86
77
|
protected abstract initSingleInput(): void;
|
|
87
78
|
protected abstract setSingleValue(value: Exclude<WattPickerValue, WattDateRange>, input: HTMLInputElement): void;
|
|
@@ -97,7 +88,7 @@ declare abstract class WattPickerBase implements OnInit, AfterViewInit, OnDestro
|
|
|
97
88
|
protected changeParentValue: (value: string | WattDateRange) => void;
|
|
98
89
|
protected markParentControlAsTouched: () => void;
|
|
99
90
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WattPickerBase, never>;
|
|
100
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<WattPickerBase, never, never, { "userAriaDescribedBy": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "
|
|
91
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<WattPickerBase, never, never, { "userAriaDescribedBy": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "range": { "alias": "range"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
101
92
|
}
|
|
102
93
|
|
|
103
94
|
export { WattPickerBase, WattPlaceholderMaskComponent };
|
|
@@ -19,7 +19,6 @@ declare class WattDatepickerComponent extends WattPickerBase implements Validato
|
|
|
19
19
|
protected changeDetectionRef: ChangeDetectorRef;
|
|
20
20
|
protected ngControl: NgControl | null;
|
|
21
21
|
private localeService;
|
|
22
|
-
private locale;
|
|
23
22
|
max: _angular_core.InputSignal<Date | undefined>;
|
|
24
23
|
min: _angular_core.InputSignal<Date | undefined>;
|
|
25
24
|
label: _angular_core.InputSignal<string>;
|
|
@@ -36,12 +35,11 @@ declare class WattDatepickerComponent extends WattPickerBase implements Validato
|
|
|
36
35
|
input: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
37
36
|
endInput: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
38
37
|
startInput: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
39
|
-
protected _placeholder: string;
|
|
40
38
|
rangeSeparator: string;
|
|
41
|
-
rangePlaceholder: string
|
|
39
|
+
rangePlaceholder: _angular_core.WritableSignal<string>;
|
|
42
40
|
inputMask: _angular_core.Signal<Required<_maskito_core.MaskitoOptions>>;
|
|
43
41
|
rangeInputMask: _angular_core.Signal<Required<_maskito_core.MaskitoOptions>>;
|
|
44
|
-
getPlaceholderByLocale(locale: WattSupportedLocales)
|
|
42
|
+
getPlaceholderByLocale: (locale: WattSupportedLocales) => "dd-mm-åååå" | "dd-mm-yyyy";
|
|
45
43
|
getRangePlaceholder(): string;
|
|
46
44
|
isPrevDayButtonDisabled: _angular_core.WritableSignal<boolean>;
|
|
47
45
|
isNextDayButtonDisabled: _angular_core.WritableSignal<boolean>;
|
|
@@ -32,16 +32,15 @@ declare class WattTimepickerComponent extends WattPickerBase {
|
|
|
32
32
|
* the slider overlay (since the DOM hierarchy cannot be used).
|
|
33
33
|
* @ignore
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
ariaOwns: _angular_core.Signal<string | undefined>;
|
|
36
36
|
hoursMinutesPlaceholder: string;
|
|
37
37
|
rangeSeparator: string;
|
|
38
38
|
rangePlaceholder: string;
|
|
39
|
-
protected _placeholder: string;
|
|
40
39
|
/**
|
|
41
40
|
* Whether the slider is open.
|
|
42
41
|
* @ignore
|
|
43
42
|
*/
|
|
44
|
-
sliderOpen: boolean
|
|
43
|
+
sliderOpen: _angular_core.WritableSignal<boolean>;
|
|
45
44
|
sliderSteps: number[];
|
|
46
45
|
sliderChange$: Subject<WattSliderValue>;
|
|
47
46
|
get sliderValue(): WattSliderValue;
|