@sebgroup/green-angular 8.1.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/sebgroup-green-angular-src-lib-accordion.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-lib-accordion.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-lib-badge.mjs +1 -1
- package/fesm2022/sebgroup-green-angular-src-lib-badge.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-lib-button.mjs +1 -1
- package/fesm2022/sebgroup-green-angular-src-lib-button.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-lib-cell-table.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-lib-cell-table.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-lib-in-page-wizard.mjs +7 -5
- package/fesm2022/sebgroup-green-angular-src-lib-in-page-wizard.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-lib-modal.mjs +14 -14
- package/fesm2022/sebgroup-green-angular-src-lib-modal.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-lib-pagination.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-lib-pagination.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-lib-slider.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-lib-slider.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-lib-sortable-list.mjs +10 -6
- package/fesm2022/sebgroup-green-angular-src-lib-sortable-list.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-alert.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-alert.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-breadcrumbs.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-breadcrumbs.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-button.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-button.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-card.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-card.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-checkbox.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-checkbox.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-datepicker.mjs +230 -211
- package/fesm2022/sebgroup-green-angular-src-v-angular-datepicker.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs +6 -6
- package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-info-circle.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-info-circle.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-input.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-input.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-modal.mjs +6 -6
- package/fesm2022/sebgroup-green-angular-src-v-angular-modal.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-pagination.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-pagination.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-radio.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-radio.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-table.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-table.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-tabs.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-tabs.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-textarea.mjs +2 -2
- package/fesm2022/sebgroup-green-angular-src-v-angular-textarea.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-v-angular.mjs +262 -243
- package/fesm2022/sebgroup-green-angular-v-angular.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular.mjs +40 -36
- package/fesm2022/sebgroup-green-angular.mjs.map +1 -1
- package/lib/button/button.component.d.ts +1 -1
- package/lib/in-page-wizard/in-page-wizard.module.d.ts +2 -1
- package/lib/sortable-list/sortable-list.component.d.ts +1 -0
- package/lib/sortable-list/sortable-list.module.d.ts +2 -1
- package/package.json +2 -2
- package/src/lib/button/button.component.d.ts +1 -1
- package/src/lib/in-page-wizard/in-page-wizard.module.d.ts +2 -1
- package/src/lib/sortable-list/sortable-list.component.d.ts +1 -0
- package/src/lib/sortable-list/sortable-list.module.d.ts +2 -1
- package/src/v-angular/datepicker/components/calendar/calendar.component.d.ts +1 -1
- package/src/v-angular/datepicker/components/date-input/date-input.component.d.ts +1 -1
- package/src/v-angular/datepicker/components/datepicker/datepicker.component.d.ts +1 -1
- package/src/v-angular/datepicker/date-control-value-accessor/date-control-value-accessor.component.d.ts +1 -1
- package/src/v-angular/datepicker/datepicker.utils.d.ts +7 -0
- package/v-angular/datepicker/components/calendar/calendar.component.d.ts +1 -1
- package/v-angular/datepicker/components/date-input/date-input.component.d.ts +1 -1
- package/v-angular/datepicker/components/datepicker/datepicker.component.d.ts +1 -1
- package/v-angular/datepicker/date-control-value-accessor/date-control-value-accessor.component.d.ts +1 -1
- package/v-angular/datepicker/datepicker.utils.d.ts +7 -0
|
@@ -2,14 +2,14 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { EventEmitter, ElementRef, TemplateRef, Output, Input, HostBinding, ViewChild, ContentChild, Self, Optional, Inject, Directive, Pipe, HostListener, ViewChildren, Component, Injectable, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import * as i2 from '@jsverse/transloco';
|
|
6
|
-
import { TRANSLOCO_SCOPE, TranslocoModule } from '@jsverse/transloco';
|
|
7
5
|
import { Subject, fromEvent } from 'rxjs';
|
|
8
6
|
import { takeUntil, debounceTime, map, distinctUntilChanged, startWith } from 'rxjs/operators';
|
|
9
|
-
import * as
|
|
10
|
-
import {
|
|
7
|
+
import * as i2 from '@jsverse/transloco';
|
|
8
|
+
import { TRANSLOCO_SCOPE, TranslocoModule } from '@jsverse/transloco';
|
|
11
9
|
import * as i1$1 from '@angular/common';
|
|
12
10
|
import { WeekDay, formatDate, CommonModule } from '@angular/common';
|
|
11
|
+
import * as i4 from '@sebgroup/green-angular/src/v-angular/input-mask';
|
|
12
|
+
import { createMask, NggvInputMaskModule } from '@sebgroup/green-angular/src/v-angular/input-mask';
|
|
13
13
|
import '@sebgroup/green-core/components/icon/icons/chevron-left.js';
|
|
14
14
|
import '@sebgroup/green-core/components/icon/icons/chevron-right.js';
|
|
15
15
|
import * as i3 from '@sebgroup/green-angular/src/lib/shared';
|
|
@@ -17,6 +17,220 @@ import { NggCoreWrapperModule } from '@sebgroup/green-angular/src/lib/shared';
|
|
|
17
17
|
import '@sebgroup/green-core/components/icon/icons/calendar.js';
|
|
18
18
|
import '@sebgroup/green-core/components/icon/icons/triangle-exclamation.js';
|
|
19
19
|
|
|
20
|
+
const weekdays = [
|
|
21
|
+
WeekDay.Monday,
|
|
22
|
+
WeekDay.Tuesday,
|
|
23
|
+
WeekDay.Wednesday,
|
|
24
|
+
WeekDay.Thursday,
|
|
25
|
+
WeekDay.Friday,
|
|
26
|
+
WeekDay.Saturday,
|
|
27
|
+
WeekDay.Sunday,
|
|
28
|
+
];
|
|
29
|
+
const sortWeekDays = (firstDayOfWeek) => {
|
|
30
|
+
const firstDayIndex = weekdays.indexOf(firstDayOfWeek);
|
|
31
|
+
const weekStart = weekdays.slice(firstDayIndex);
|
|
32
|
+
const weekEnd = weekdays.slice(0, firstDayIndex);
|
|
33
|
+
return weekStart.concat(weekEnd);
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Safely converts a value to a Date object, handling timezone issues.
|
|
37
|
+
* If the value is already a Date, returns it as-is.
|
|
38
|
+
* If it's a string in ISO format (YYYY-MM-DD), parses it in local timezone.
|
|
39
|
+
* Otherwise, uses standard Date constructor.
|
|
40
|
+
*/
|
|
41
|
+
const toLocalDate = (value) => {
|
|
42
|
+
// If already a Date object, use it directly to avoid timezone issues
|
|
43
|
+
if (value instanceof Date) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
// If string is in ISO format (YYYY-MM-DD), parse in local timezone
|
|
47
|
+
const dateMatch = String(value).match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
48
|
+
if (dateMatch) {
|
|
49
|
+
const [, year, month, day] = dateMatch;
|
|
50
|
+
return new Date(parseInt(year), parseInt(month) - 1, parseInt(day));
|
|
51
|
+
}
|
|
52
|
+
// Otherwise use standard Date constructor
|
|
53
|
+
return new Date(value);
|
|
54
|
+
};
|
|
55
|
+
/** Sets labels and sort weekday arrays based off of first day of week. */
|
|
56
|
+
const getSortedWeekDays = (firstDayOfWeek, startDate) => {
|
|
57
|
+
if (startDate === undefined)
|
|
58
|
+
startDate = new Date();
|
|
59
|
+
// sort weekdays according to firstDayOfWeek
|
|
60
|
+
const sortedWeekdays = sortWeekDays(firstDayOfWeek);
|
|
61
|
+
// get the date object for the first day of week
|
|
62
|
+
const startDayIndex = sortedWeekdays.indexOf(startDate.getDay());
|
|
63
|
+
const firstOfWeek = new Date(startDate);
|
|
64
|
+
firstOfWeek.setDate(startDate.getDate() - startDayIndex);
|
|
65
|
+
// map each day in array to a date object
|
|
66
|
+
return sortedWeekdays.map((_, offset) => {
|
|
67
|
+
// set appropriate date
|
|
68
|
+
const weekdayDate = new Date(firstOfWeek);
|
|
69
|
+
weekdayDate.setDate(weekdayDate.getDate() + offset);
|
|
70
|
+
// and return value
|
|
71
|
+
return weekdayDate;
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
/** Generate a matrix of dates used to visualize a calendar month. */
|
|
75
|
+
const generateDateMatrix = (month, year, minWeeks = 5, firstDayOfWeek) => {
|
|
76
|
+
// generate a new matrix with 5 or 6 rows (depending on number of days in that month)
|
|
77
|
+
const matrix = new Array(minWeeks);
|
|
78
|
+
matrix.fill([]);
|
|
79
|
+
const date = new Date(year, month, 1);
|
|
80
|
+
const firstDate = firstCalendarDate(date, firstDayOfWeek);
|
|
81
|
+
// for each week in that month
|
|
82
|
+
const dateMatrix = matrix.map((_, weekOffset) => {
|
|
83
|
+
const offset = weekOffset * 7;
|
|
84
|
+
// update the date with the offset for that week
|
|
85
|
+
const firstOfWeek = new Date(firstDate);
|
|
86
|
+
firstOfWeek.setDate(firstDate.getDate() + offset);
|
|
87
|
+
return getSortedWeekDays(firstDayOfWeek, firstOfWeek);
|
|
88
|
+
});
|
|
89
|
+
// check if another row needs to be added (if last dates of month are missing)
|
|
90
|
+
const lastAdded = dateMatrix.slice(-1)[0].slice(-1)[0];
|
|
91
|
+
const lastOfMonth = new Date(lastAdded);
|
|
92
|
+
lastOfMonth.setMonth(month + 1);
|
|
93
|
+
lastOfMonth.setDate(0);
|
|
94
|
+
if (isBefore(lastAdded, lastOfMonth)) {
|
|
95
|
+
// add another week row
|
|
96
|
+
const firstOfWeek = new Date(lastAdded);
|
|
97
|
+
firstOfWeek.setDate(lastAdded.getDate() + 1);
|
|
98
|
+
dateMatrix.push(getSortedWeekDays(firstDayOfWeek, firstOfWeek));
|
|
99
|
+
}
|
|
100
|
+
// return final datematrix
|
|
101
|
+
return dateMatrix;
|
|
102
|
+
};
|
|
103
|
+
/** Returns the first date used in the calendars first button. */
|
|
104
|
+
const firstCalendarDate = (date, firstDayOfWeek) => {
|
|
105
|
+
// sort weekdays according to firstDayOfWeek
|
|
106
|
+
const sortedWeekdays = sortWeekDays(firstDayOfWeek);
|
|
107
|
+
// set date to the first of month
|
|
108
|
+
const firstOfMonth = new Date(date);
|
|
109
|
+
firstOfMonth.setDate(1);
|
|
110
|
+
// get the offset
|
|
111
|
+
const offset = sortedWeekdays.indexOf(firstOfMonth.getDay());
|
|
112
|
+
const firstOfWeek = new Date(firstOfMonth);
|
|
113
|
+
// use offset to set date
|
|
114
|
+
firstOfWeek.setDate(1 - offset);
|
|
115
|
+
return firstOfWeek;
|
|
116
|
+
};
|
|
117
|
+
const getDayOffset = (from, to, firstDayOfWeek, direction) => {
|
|
118
|
+
const sortedWeekdays = sortWeekDays(firstDayOfWeek);
|
|
119
|
+
const fromIndex = sortedWeekdays.indexOf(from);
|
|
120
|
+
const toIndex = sortedWeekdays.indexOf(to);
|
|
121
|
+
const offset = toIndex - fromIndex;
|
|
122
|
+
if (direction === 'forward' && offset < 0)
|
|
123
|
+
return offset + 6;
|
|
124
|
+
if (direction === 'back' && offset > 0)
|
|
125
|
+
return offset - 6;
|
|
126
|
+
return offset;
|
|
127
|
+
};
|
|
128
|
+
/** Returns an array of Dates for each of month. */
|
|
129
|
+
const getMonthArray = () => {
|
|
130
|
+
const firstDayOfYear = new Date();
|
|
131
|
+
firstDayOfYear.setMonth(0);
|
|
132
|
+
firstDayOfYear.setDate(1);
|
|
133
|
+
// create a new array of length 12,
|
|
134
|
+
// and fill it with date objects of 1:st of january
|
|
135
|
+
const monthArray = new Array(12).fill(firstDayOfYear);
|
|
136
|
+
// map through the array,
|
|
137
|
+
// and create a new instance of the date,
|
|
138
|
+
// changing the month based on index (0 - 11)
|
|
139
|
+
return monthArray.map((d, index) => {
|
|
140
|
+
const date = new Date(d);
|
|
141
|
+
date.setMonth(index);
|
|
142
|
+
return date;
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
/** Returns an array of Dates for the current year and the next. */
|
|
146
|
+
const getYearArray = () => {
|
|
147
|
+
const currentYear = new Date();
|
|
148
|
+
currentYear.setMonth(0);
|
|
149
|
+
currentYear.setDate(1);
|
|
150
|
+
const nextYear = new Date(currentYear);
|
|
151
|
+
nextYear.setFullYear(currentYear.getFullYear() + 1);
|
|
152
|
+
return [currentYear, nextYear];
|
|
153
|
+
};
|
|
154
|
+
/** Returns true if the two dates have the same year, month and date values. */
|
|
155
|
+
const match = (a, b) => {
|
|
156
|
+
if (!a || !b)
|
|
157
|
+
return false;
|
|
158
|
+
if (a.getDate() !== b.getDate())
|
|
159
|
+
return false;
|
|
160
|
+
if (a.getMonth() !== b.getMonth())
|
|
161
|
+
return false;
|
|
162
|
+
if (a.getFullYear() !== b.getFullYear())
|
|
163
|
+
return false;
|
|
164
|
+
return true;
|
|
165
|
+
};
|
|
166
|
+
const afterClosingHours = (closingHours) => {
|
|
167
|
+
if (!closingHours)
|
|
168
|
+
return false;
|
|
169
|
+
return Date.now() >= closingHours.getTime();
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Checks if a date is before control date, regardless of time.
|
|
173
|
+
*
|
|
174
|
+
* @param date - comparison date
|
|
175
|
+
* @param controlDate - date to compare against
|
|
176
|
+
* @returns - true if the comparison date is before the control date
|
|
177
|
+
*/
|
|
178
|
+
const isBefore = (date, controlDate) => {
|
|
179
|
+
// if year values are dissimilar
|
|
180
|
+
if (date.getFullYear() !== controlDate.getFullYear()) {
|
|
181
|
+
return date.getFullYear() < controlDate.getFullYear();
|
|
182
|
+
}
|
|
183
|
+
// if month values are dissimilar
|
|
184
|
+
if (date.getMonth() !== controlDate.getMonth()) {
|
|
185
|
+
return date.getMonth() < controlDate.getMonth();
|
|
186
|
+
}
|
|
187
|
+
// if year and month are equal, check the date
|
|
188
|
+
return date.getDate() < controlDate.getDate();
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Checks if a date is after control date, regardless of time.
|
|
192
|
+
*
|
|
193
|
+
* @param date - comparison date
|
|
194
|
+
* @param controlDate - date to compare against
|
|
195
|
+
* @returns - true if the comparison date is before the control date
|
|
196
|
+
*/
|
|
197
|
+
const isAfter = (date, controlDate) => {
|
|
198
|
+
// if year values are dissimilar
|
|
199
|
+
if (date.getFullYear() !== controlDate.getFullYear()) {
|
|
200
|
+
return date.getFullYear() > controlDate.getFullYear();
|
|
201
|
+
}
|
|
202
|
+
// if month values are dissimilar
|
|
203
|
+
if (date.getMonth() !== controlDate.getMonth()) {
|
|
204
|
+
return date.getMonth() > controlDate.getMonth();
|
|
205
|
+
}
|
|
206
|
+
// if year and month are equal, check the date
|
|
207
|
+
return date.getDate() > controlDate.getDate();
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Checks if a value can be used to initiate a new Date object.
|
|
211
|
+
*
|
|
212
|
+
* @param value any value
|
|
213
|
+
* @returns - true if value can be coersed to a Date.
|
|
214
|
+
*/
|
|
215
|
+
const isValid = (value) => {
|
|
216
|
+
// if value is type of string and can be parsed to a Date
|
|
217
|
+
const date = value && typeof value === 'string' && !isNaN(Date.parse(value))
|
|
218
|
+
? new Date(value)
|
|
219
|
+
: null;
|
|
220
|
+
switch (true) {
|
|
221
|
+
// if date or value is a valid date object - return valid
|
|
222
|
+
case typeof value?.getMonth === 'function':
|
|
223
|
+
case typeof date?.getMonth === 'function':
|
|
224
|
+
return true;
|
|
225
|
+
// if date or value is not a valid date object - return invalid
|
|
226
|
+
case value == null:
|
|
227
|
+
case date?.toString() === 'Invalid Date':
|
|
228
|
+
return false;
|
|
229
|
+
default:
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
|
|
20
234
|
/**
|
|
21
235
|
* Helper function to generate InputmaskOptions by requested locale.
|
|
22
236
|
* @param locale - requested locale. If not given, it'll use the browsers locale
|
|
@@ -440,7 +654,7 @@ class DateControlValueAccessorComponent {
|
|
|
440
654
|
try {
|
|
441
655
|
// if value is type of string,
|
|
442
656
|
if (value && typeof value === 'string')
|
|
443
|
-
value =
|
|
657
|
+
value = toLocalDate(value);
|
|
444
658
|
switch (true) {
|
|
445
659
|
// remove instances where the value will not correctly be parsed to a date string
|
|
446
660
|
case value == null:
|
|
@@ -448,8 +662,7 @@ class DateControlValueAccessorComponent {
|
|
|
448
662
|
return null;
|
|
449
663
|
// if value-as-date is a valid date object, parse the value to YYYY-MM-DD format
|
|
450
664
|
case typeof value?.getMonth === 'function':
|
|
451
|
-
|
|
452
|
-
return date.toISOString().split('T')[0];
|
|
665
|
+
return new Intl.DateTimeFormat('sv-SE').format(value);
|
|
453
666
|
default:
|
|
454
667
|
return value;
|
|
455
668
|
}
|
|
@@ -710,200 +923,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
710
923
|
type: Output
|
|
711
924
|
}] } });
|
|
712
925
|
|
|
713
|
-
const weekdays = [
|
|
714
|
-
WeekDay.Monday,
|
|
715
|
-
WeekDay.Tuesday,
|
|
716
|
-
WeekDay.Wednesday,
|
|
717
|
-
WeekDay.Thursday,
|
|
718
|
-
WeekDay.Friday,
|
|
719
|
-
WeekDay.Saturday,
|
|
720
|
-
WeekDay.Sunday,
|
|
721
|
-
];
|
|
722
|
-
const sortWeekDays = (firstDayOfWeek) => {
|
|
723
|
-
const firstDayIndex = weekdays.indexOf(firstDayOfWeek);
|
|
724
|
-
const weekStart = weekdays.slice(firstDayIndex);
|
|
725
|
-
const weekEnd = weekdays.slice(0, firstDayIndex);
|
|
726
|
-
return weekStart.concat(weekEnd);
|
|
727
|
-
};
|
|
728
|
-
/** Sets labels and sort weekday arrays based off of first day of week. */
|
|
729
|
-
const getSortedWeekDays = (firstDayOfWeek, startDate) => {
|
|
730
|
-
if (startDate === undefined)
|
|
731
|
-
startDate = new Date();
|
|
732
|
-
// sort weekdays according to firstDayOfWeek
|
|
733
|
-
const sortedWeekdays = sortWeekDays(firstDayOfWeek);
|
|
734
|
-
// get the date object for the first day of week
|
|
735
|
-
const startDayIndex = sortedWeekdays.indexOf(startDate.getDay());
|
|
736
|
-
const firstOfWeek = new Date(startDate);
|
|
737
|
-
firstOfWeek.setDate(startDate.getDate() - startDayIndex);
|
|
738
|
-
// map each day in array to a date object
|
|
739
|
-
return sortedWeekdays.map((_, offset) => {
|
|
740
|
-
// set appropriate date
|
|
741
|
-
const weekdayDate = new Date(firstOfWeek);
|
|
742
|
-
weekdayDate.setDate(weekdayDate.getDate() + offset);
|
|
743
|
-
// and return value
|
|
744
|
-
return weekdayDate;
|
|
745
|
-
});
|
|
746
|
-
};
|
|
747
|
-
/** Generate a matrix of dates used to visualize a calendar month. */
|
|
748
|
-
const generateDateMatrix = (month, year, minWeeks = 5, firstDayOfWeek) => {
|
|
749
|
-
// generate a new matrix with 5 or 6 rows (depending on number of days in that month)
|
|
750
|
-
const matrix = new Array(minWeeks);
|
|
751
|
-
matrix.fill([]);
|
|
752
|
-
const date = new Date(year, month, 1);
|
|
753
|
-
const firstDate = firstCalendarDate(date, firstDayOfWeek);
|
|
754
|
-
// for each week in that month
|
|
755
|
-
const dateMatrix = matrix.map((_, weekOffset) => {
|
|
756
|
-
const offset = weekOffset * 7;
|
|
757
|
-
// update the date with the offset for that week
|
|
758
|
-
const firstOfWeek = new Date(firstDate);
|
|
759
|
-
firstOfWeek.setDate(firstDate.getDate() + offset);
|
|
760
|
-
return getSortedWeekDays(firstDayOfWeek, firstOfWeek);
|
|
761
|
-
});
|
|
762
|
-
// check if another row needs to be added (if last dates of month are missing)
|
|
763
|
-
const lastAdded = dateMatrix.slice(-1)[0].slice(-1)[0];
|
|
764
|
-
const lastOfMonth = new Date(lastAdded);
|
|
765
|
-
lastOfMonth.setMonth(month + 1);
|
|
766
|
-
lastOfMonth.setDate(0);
|
|
767
|
-
if (isBefore(lastAdded, lastOfMonth)) {
|
|
768
|
-
// add another week row
|
|
769
|
-
const firstOfWeek = new Date(lastAdded);
|
|
770
|
-
firstOfWeek.setDate(lastAdded.getDate() + 1);
|
|
771
|
-
dateMatrix.push(getSortedWeekDays(firstDayOfWeek, firstOfWeek));
|
|
772
|
-
}
|
|
773
|
-
// return final datematrix
|
|
774
|
-
return dateMatrix;
|
|
775
|
-
};
|
|
776
|
-
/** Returns the first date used in the calendars first button. */
|
|
777
|
-
const firstCalendarDate = (date, firstDayOfWeek) => {
|
|
778
|
-
// sort weekdays according to firstDayOfWeek
|
|
779
|
-
const sortedWeekdays = sortWeekDays(firstDayOfWeek);
|
|
780
|
-
// set date to the first of month
|
|
781
|
-
const firstOfMonth = new Date(date);
|
|
782
|
-
firstOfMonth.setDate(1);
|
|
783
|
-
// get the offset
|
|
784
|
-
const offset = sortedWeekdays.indexOf(firstOfMonth.getDay());
|
|
785
|
-
const firstOfWeek = new Date(firstOfMonth);
|
|
786
|
-
// use offset to set date
|
|
787
|
-
firstOfWeek.setDate(1 - offset);
|
|
788
|
-
return firstOfWeek;
|
|
789
|
-
};
|
|
790
|
-
const getDayOffset = (from, to, firstDayOfWeek, direction) => {
|
|
791
|
-
const sortedWeekdays = sortWeekDays(firstDayOfWeek);
|
|
792
|
-
const fromIndex = sortedWeekdays.indexOf(from);
|
|
793
|
-
const toIndex = sortedWeekdays.indexOf(to);
|
|
794
|
-
const offset = toIndex - fromIndex;
|
|
795
|
-
if (direction === 'forward' && offset < 0)
|
|
796
|
-
return offset + 6;
|
|
797
|
-
if (direction === 'back' && offset > 0)
|
|
798
|
-
return offset - 6;
|
|
799
|
-
return offset;
|
|
800
|
-
};
|
|
801
|
-
/** Returns an array of Dates for each of month. */
|
|
802
|
-
const getMonthArray = () => {
|
|
803
|
-
const firstDayOfYear = new Date();
|
|
804
|
-
firstDayOfYear.setMonth(0);
|
|
805
|
-
firstDayOfYear.setDate(1);
|
|
806
|
-
// create a new array of length 12,
|
|
807
|
-
// and fill it with date objects of 1:st of january
|
|
808
|
-
const monthArray = new Array(12).fill(firstDayOfYear);
|
|
809
|
-
// map through the array,
|
|
810
|
-
// and create a new instance of the date,
|
|
811
|
-
// changing the month based on index (0 - 11)
|
|
812
|
-
return monthArray.map((d, index) => {
|
|
813
|
-
const date = new Date(d);
|
|
814
|
-
date.setMonth(index);
|
|
815
|
-
return date;
|
|
816
|
-
});
|
|
817
|
-
};
|
|
818
|
-
/** Returns an array of Dates for the current year and the next. */
|
|
819
|
-
const getYearArray = () => {
|
|
820
|
-
const currentYear = new Date();
|
|
821
|
-
currentYear.setMonth(0);
|
|
822
|
-
currentYear.setDate(1);
|
|
823
|
-
const nextYear = new Date(currentYear);
|
|
824
|
-
nextYear.setFullYear(currentYear.getFullYear() + 1);
|
|
825
|
-
return [currentYear, nextYear];
|
|
826
|
-
};
|
|
827
|
-
/** Returns true if the two dates have the same year, month and date values. */
|
|
828
|
-
const match = (a, b) => {
|
|
829
|
-
if (!a || !b)
|
|
830
|
-
return false;
|
|
831
|
-
if (a.getDate() !== b.getDate())
|
|
832
|
-
return false;
|
|
833
|
-
if (a.getMonth() !== b.getMonth())
|
|
834
|
-
return false;
|
|
835
|
-
if (a.getFullYear() !== b.getFullYear())
|
|
836
|
-
return false;
|
|
837
|
-
return true;
|
|
838
|
-
};
|
|
839
|
-
const afterClosingHours = (closingHours) => {
|
|
840
|
-
if (!closingHours)
|
|
841
|
-
return false;
|
|
842
|
-
return Date.now() >= closingHours.getTime();
|
|
843
|
-
};
|
|
844
|
-
/**
|
|
845
|
-
* Checks if a date is before control date, regardless of time.
|
|
846
|
-
*
|
|
847
|
-
* @param date - comparison date
|
|
848
|
-
* @param controlDate - date to compare against
|
|
849
|
-
* @returns - true if the comparison date is before the control date
|
|
850
|
-
*/
|
|
851
|
-
const isBefore = (date, controlDate) => {
|
|
852
|
-
// if year values are dissimilar
|
|
853
|
-
if (date.getFullYear() !== controlDate.getFullYear()) {
|
|
854
|
-
return date.getFullYear() < controlDate.getFullYear();
|
|
855
|
-
}
|
|
856
|
-
// if month values are dissimilar
|
|
857
|
-
if (date.getMonth() !== controlDate.getMonth()) {
|
|
858
|
-
return date.getMonth() < controlDate.getMonth();
|
|
859
|
-
}
|
|
860
|
-
// if year and month are equal, check the date
|
|
861
|
-
return date.getDate() < controlDate.getDate();
|
|
862
|
-
};
|
|
863
|
-
/**
|
|
864
|
-
* Checks if a date is after control date, regardless of time.
|
|
865
|
-
*
|
|
866
|
-
* @param date - comparison date
|
|
867
|
-
* @param controlDate - date to compare against
|
|
868
|
-
* @returns - true if the comparison date is before the control date
|
|
869
|
-
*/
|
|
870
|
-
const isAfter = (date, controlDate) => {
|
|
871
|
-
// if year values are dissimilar
|
|
872
|
-
if (date.getFullYear() !== controlDate.getFullYear()) {
|
|
873
|
-
return date.getFullYear() > controlDate.getFullYear();
|
|
874
|
-
}
|
|
875
|
-
// if month values are dissimilar
|
|
876
|
-
if (date.getMonth() !== controlDate.getMonth()) {
|
|
877
|
-
return date.getMonth() > controlDate.getMonth();
|
|
878
|
-
}
|
|
879
|
-
// if year and month are equal, check the date
|
|
880
|
-
return date.getDate() > controlDate.getDate();
|
|
881
|
-
};
|
|
882
|
-
/**
|
|
883
|
-
* Checks if a value can be used to initiate a new Date object.
|
|
884
|
-
*
|
|
885
|
-
* @param value any value
|
|
886
|
-
* @returns - true if value can be coersed to a Date.
|
|
887
|
-
*/
|
|
888
|
-
const isValid = (value) => {
|
|
889
|
-
// if value is type of string and can be parsed to a Date
|
|
890
|
-
const date = value && typeof value === 'string' && !isNaN(Date.parse(value))
|
|
891
|
-
? new Date(value)
|
|
892
|
-
: null;
|
|
893
|
-
switch (true) {
|
|
894
|
-
// if date or value is a valid date object - return valid
|
|
895
|
-
case typeof value?.getMonth === 'function':
|
|
896
|
-
case typeof date?.getMonth === 'function':
|
|
897
|
-
return true;
|
|
898
|
-
// if date or value is not a valid date object - return invalid
|
|
899
|
-
case value == null:
|
|
900
|
-
case date?.toString() === 'Invalid Date':
|
|
901
|
-
return false;
|
|
902
|
-
default:
|
|
903
|
-
return false;
|
|
904
|
-
}
|
|
905
|
-
};
|
|
906
|
-
|
|
907
926
|
class CalendarDateDirective {
|
|
908
927
|
get nativeElement() {
|
|
909
928
|
return this.elementRef.nativeElement;
|
|
@@ -1061,7 +1080,7 @@ class CalendarComponent {
|
|
|
1061
1080
|
}
|
|
1062
1081
|
ngOnChanges(changes) {
|
|
1063
1082
|
if (changes.selected?.currentValue) {
|
|
1064
|
-
this.selected =
|
|
1083
|
+
this.selected = toLocalDate(changes.selected.currentValue);
|
|
1065
1084
|
}
|
|
1066
1085
|
if (changes.firstDayOfWeek?.currentValue) {
|
|
1067
1086
|
this.lastDayOfWeek = sortWeekDays(changes.firstDayOfWeek.currentValue).pop();
|
|
@@ -1184,11 +1203,11 @@ class CalendarComponent {
|
|
|
1184
1203
|
};
|
|
1185
1204
|
}
|
|
1186
1205
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1187
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: CalendarComponent, isStandalone: false, selector: "nggv-calendar", inputs: { year: "year", month: "month", selected: "selected", locale: "locale", minCalendarRows: "minCalendarRows", firstDayOfWeek: "firstDayOfWeek", type: "type", disableDates: "disableDates", disableWeekDays: "disableWeekDays", firstValid: "firstValid", lastValid: "lastValid", closingTime: "closingTime" }, outputs: { dateClick: "dateClick" }, host: { listeners: { "keydown": "keyNavigation($event)" } }, viewQueries: [{ propertyName: "dateButtonRefs", predicate: CalendarDateDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngFor=\"let weekRow of dateMatrix\">\n <div class=\"nggv-calendar-row\">\n <button\n *ngFor=\"let date of weekRow\"\n class=\"gds-button gds-button-alternative\"\n [attr.data-thook]=\"\n date | dateThook: (date | isDisabled: disableDateConfig)\n \"\n [attr.aria-label]=\"date\"\n [calendarDate]=\"date\"\n [notWithinMonth]=\"!(month === date?.getMonth())\"\n [selected]=\"date | matches: selected\"\n [disabled]=\"date | isDisabled: disableDateConfig\"\n (click)=\"clickDate(date)\"\n >\n {{ date | date: 'd' : undefined : locale }}\n </button>\n </div>\n</ng-container>\n", styles: [":host{
|
|
1206
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: CalendarComponent, isStandalone: false, selector: "nggv-calendar", inputs: { year: "year", month: "month", selected: "selected", locale: "locale", minCalendarRows: "minCalendarRows", firstDayOfWeek: "firstDayOfWeek", type: "type", disableDates: "disableDates", disableWeekDays: "disableWeekDays", firstValid: "firstValid", lastValid: "lastValid", closingTime: "closingTime" }, outputs: { dateClick: "dateClick" }, host: { listeners: { "keydown": "keyNavigation($event)" } }, viewQueries: [{ propertyName: "dateButtonRefs", predicate: CalendarDateDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngFor=\"let weekRow of dateMatrix\">\n <div class=\"nggv-calendar-row\">\n <button\n *ngFor=\"let date of weekRow\"\n class=\"gds-button gds-button-alternative\"\n [attr.data-thook]=\"\n date | dateThook: (date | isDisabled: disableDateConfig)\n \"\n [attr.aria-label]=\"date\"\n [calendarDate]=\"date\"\n [notWithinMonth]=\"!(month === date?.getMonth())\"\n [selected]=\"date | matches: selected\"\n [disabled]=\"date | isDisabled: disableDateConfig\"\n (click)=\"clickDate(date)\"\n >\n {{ date | date: 'd' : undefined : locale }}\n </button>\n </div>\n</ng-container>\n", styles: [":host{border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9}:host .nggv-calendar-row{display:flex;padding:2px;gap:1px}:host .nggv-calendar-row>*{line-height:2.5rem;padding:0;display:block;flex-grow:1;text-align:center;width:20%;color:#333}:host .nggv-calendar-row>*:disabled{border:0 solid transparent}:host .nggv-calendar-row>button{padding:.75rem 1rem;border-radius:.25rem;border:solid 1px var(--gds-sys-color-base-600);font-weight:500}:host .nggv-calendar-row>button:focus:not(:focus-visible){box-shadow:none;outline:0}:host .nggv-calendar-row>button:focus,:host .nggv-calendar-row>button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .nggv-calendar-row>button{min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center}@media(max-width:35.98em){:host .nggv-calendar-row>button{min-width:100%}}@media screen and (-ms-high-contrast:active){:host .nggv-calendar-row>button{border:2px solid currentcolor}}:host .nggv-calendar-row>button.small{min-height:2rem;height:2rem;padding:.4375rem .75rem;font-size:.875rem;line-height:1rem}:host .nggv-calendar-row>button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .nggv-calendar-row>button{width:15%;background:transparent;width:44px;height:44px;border-radius:4px;border:none;font-size:1rem;font-family:inherit}:host .nggv-calendar-row>button:not([disabled]):hover{background-color:#e9e9e9}:host .nggv-calendar-row>button:not([disabled]):focus{z-index:1;outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .nggv-calendar-row>button[disabled]{background-color:#eee;color:#adadad}:host .nggv-calendar-row>button.today{border:1px solid #333}:host .nggv-calendar-row>button.not-within-month:not([disabled]){color:#adadad;background-color:#f8f8f8}:host .nggv-calendar-row>button.not-within-month:not([disabled]):hover{background-color:#e9e9e9}:host .nggv-calendar-row>button.selected:not([disabled]){background-color:#1a1a1a;border-color:#1a1a1a;text-decoration:none;color:#fff}@media(max-width:35.98em){:host .nggv-calendar-row>button{min-width:initial}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: CalendarDateDirective, selector: "[calendarDate]", inputs: ["calendarDate", "selected", "notWithinMonth", "disabled"] }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }, { kind: "pipe", type: IsDisabledPipe, name: "isDisabled" }, { kind: "pipe", type: DateThookPipe, name: "dateThook" }, { kind: "pipe", type: MatchesPipe, name: "matches" }] }); }
|
|
1188
1207
|
}
|
|
1189
1208
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
1190
1209
|
type: Component,
|
|
1191
|
-
args: [{ selector: 'nggv-calendar', standalone: false, template: "<ng-container *ngFor=\"let weekRow of dateMatrix\">\n <div class=\"nggv-calendar-row\">\n <button\n *ngFor=\"let date of weekRow\"\n class=\"gds-button gds-button-alternative\"\n [attr.data-thook]=\"\n date | dateThook: (date | isDisabled: disableDateConfig)\n \"\n [attr.aria-label]=\"date\"\n [calendarDate]=\"date\"\n [notWithinMonth]=\"!(month === date?.getMonth())\"\n [selected]=\"date | matches: selected\"\n [disabled]=\"date | isDisabled: disableDateConfig\"\n (click)=\"clickDate(date)\"\n >\n {{ date | date: 'd' : undefined : locale }}\n </button>\n </div>\n</ng-container>\n", styles: [":host{
|
|
1210
|
+
args: [{ selector: 'nggv-calendar', standalone: false, template: "<ng-container *ngFor=\"let weekRow of dateMatrix\">\n <div class=\"nggv-calendar-row\">\n <button\n *ngFor=\"let date of weekRow\"\n class=\"gds-button gds-button-alternative\"\n [attr.data-thook]=\"\n date | dateThook: (date | isDisabled: disableDateConfig)\n \"\n [attr.aria-label]=\"date\"\n [calendarDate]=\"date\"\n [notWithinMonth]=\"!(month === date?.getMonth())\"\n [selected]=\"date | matches: selected\"\n [disabled]=\"date | isDisabled: disableDateConfig\"\n (click)=\"clickDate(date)\"\n >\n {{ date | date: 'd' : undefined : locale }}\n </button>\n </div>\n</ng-container>\n", styles: [":host{border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9}:host .nggv-calendar-row{display:flex;padding:2px;gap:1px}:host .nggv-calendar-row>*{line-height:2.5rem;padding:0;display:block;flex-grow:1;text-align:center;width:20%;color:#333}:host .nggv-calendar-row>*:disabled{border:0 solid transparent}:host .nggv-calendar-row>button{padding:.75rem 1rem;border-radius:.25rem;border:solid 1px var(--gds-sys-color-base-600);font-weight:500}:host .nggv-calendar-row>button:focus:not(:focus-visible){box-shadow:none;outline:0}:host .nggv-calendar-row>button:focus,:host .nggv-calendar-row>button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .nggv-calendar-row>button{min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center}@media(max-width:35.98em){:host .nggv-calendar-row>button{min-width:100%}}@media screen and (-ms-high-contrast:active){:host .nggv-calendar-row>button{border:2px solid currentcolor}}:host .nggv-calendar-row>button.small{min-height:2rem;height:2rem;padding:.4375rem .75rem;font-size:.875rem;line-height:1rem}:host .nggv-calendar-row>button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .nggv-calendar-row>button{width:15%;background:transparent;width:44px;height:44px;border-radius:4px;border:none;font-size:1rem;font-family:inherit}:host .nggv-calendar-row>button:not([disabled]):hover{background-color:#e9e9e9}:host .nggv-calendar-row>button:not([disabled]):focus{z-index:1;outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .nggv-calendar-row>button[disabled]{background-color:#eee;color:#adadad}:host .nggv-calendar-row>button.today{border:1px solid #333}:host .nggv-calendar-row>button.not-within-month:not([disabled]){color:#adadad;background-color:#f8f8f8}:host .nggv-calendar-row>button.not-within-month:not([disabled]):hover{background-color:#e9e9e9}:host .nggv-calendar-row>button.selected:not([disabled]){background-color:#1a1a1a;border-color:#1a1a1a;text-decoration:none;color:#fff}@media(max-width:35.98em){:host .nggv-calendar-row>button{min-width:initial}}\n"] }]
|
|
1192
1211
|
}], propDecorators: { dateClick: [{
|
|
1193
1212
|
type: Output
|
|
1194
1213
|
}], dateButtonRefs: [{
|
|
@@ -1362,11 +1381,11 @@ class CalendarControlComponent {
|
|
|
1362
1381
|
}));
|
|
1363
1382
|
}
|
|
1364
1383
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: CalendarControlComponent, deps: [{ token: i1.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1365
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: CalendarControlComponent, isStandalone: false, selector: "nggv-calendar-control", inputs: { activeCalendar: "activeCalendar", locale: "locale", type: "type" }, outputs: { calendarChange: "calendarChange" }, host: { listeners: { "keydown": "keyNavigation($event)" } }, usesOnChanges: true, ngImport: i0, template: "<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"previous-month\"\n class=\"nggv-prev-button\"\n (click)=\"viewPreviousMonth()\"\n>\n <gds-icon-chevron-left *nggCoreElement></gds-icon-chevron-left>\n</button>\n\n<ng-container [formGroup]=\"selectedCalendar\">\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-month\"\n formControlName=\"month\"\n >\n <option\n *ngFor=\"let month of monthArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"month.getMonth()\"\n >\n {{ month | date: 'MMMM' : undefined : locale }}\n </option>\n </select>\n\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-year\"\n formControlName=\"year\"\n >\n <option\n *ngFor=\"let year of yearArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"year.getFullYear()\"\n >\n {{ year | date: 'yyyy' : undefined : locale }}\n </option>\n </select>\n</ng-container>\n\n<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"next-month\"\n class=\"nggv-next-button\"\n (click)=\"viewNextMonth()\"\n>\n <gds-icon-chevron-right *nggCoreElement></gds-icon-chevron-right>\n</button>\n", styles: [":host{display:flex;padding:.25rem;justify-content:space-between;align-items:center;gap:.25rem}:host .nggv-calendar-select{
|
|
1384
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: CalendarControlComponent, isStandalone: false, selector: "nggv-calendar-control", inputs: { activeCalendar: "activeCalendar", locale: "locale", type: "type" }, outputs: { calendarChange: "calendarChange" }, host: { listeners: { "keydown": "keyNavigation($event)" } }, usesOnChanges: true, ngImport: i0, template: "<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"previous-month\"\n class=\"nggv-prev-button\"\n (click)=\"viewPreviousMonth()\"\n>\n <gds-icon-chevron-left *nggCoreElement></gds-icon-chevron-left>\n</button>\n\n<ng-container [formGroup]=\"selectedCalendar\">\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-month\"\n formControlName=\"month\"\n >\n <option\n *ngFor=\"let month of monthArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"month.getMonth()\"\n >\n {{ month | date: 'MMMM' : undefined : locale }}\n </option>\n </select>\n\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-year\"\n formControlName=\"year\"\n >\n <option\n *ngFor=\"let year of yearArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"year.getFullYear()\"\n >\n {{ year | date: 'yyyy' : undefined : locale }}\n </option>\n </select>\n</ng-container>\n\n<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"next-month\"\n class=\"nggv-next-button\"\n (click)=\"viewNextMonth()\"\n>\n <gds-icon-chevron-right *nggCoreElement></gds-icon-chevron-right>\n</button>\n", styles: [":host{--gds-sys-color-blue: #41b0ee;--gds-sys-color-dark-blue-1: #0092e1;--gds-sys-color-dark-blue-2: #007ac7;--gds-sys-color-green: #60cd18;--gds-sys-color-dark-green-1: #45b400;--gds-sys-color-dark-green-2: #308800;--gds-sys-color-yellow: #ffc500;--gds-sys-color-dark-yellow-1: #ffb400;--gds-sys-color-dark-yellow-2: #f8a000;--gds-sys-color-text-primary: #333333;--gds-sys-color-text-secondary: #ababab;--gds-sys-color-text-white: #ffffff;--gds-sys-color-text-black: #333333;--gds-sys-color-text-inverted: #ffffff;--gds-sys-color-text-link: #0062bc;--gds-sys-color-text-error: #9f000a;--gds-sys-color-text-disabled: #adadad;--gds-sys-color-red: #f03529;--gds-sys-color-dark-red-1: #d81a1a;--gds-sys-color-dark-red-2: #bb000c;--gds-sys-color-purple: #673ab6;--gds-sys-color-dark-purple-1: #4f2C99;--gds-sys-color-dark-purple-2: #3f2587;--gds-sys-color-white: #ffffff;--gds-sys-color-black: #000000;--gds-sys-color-background-primary: #ffffff;--gds-sys-color-background-secondary: #eeeeee;--gds-sys-color-base-100: #f8f8f8;--gds-sys-color-base-200: #e9e9e9;--gds-sys-color-base-300: #dedede;--gds-sys-color-base-400: #cecece;--gds-sys-color-base-500: #adadad;--gds-sys-color-base-600: #868686;--gds-sys-color-base-700: #494949;--gds-sys-color-base-800: #333333;--gds-sys-color-base-900: #1a1a1a;--gds-sys-color-hover-10: rgba(255, 255, 255, .1);--gds-sys-color-hover-20: rgba(255, 255, 255, .2);display:flex;padding:.25rem;justify-content:space-between;align-items:center;gap:.25rem}:host .nggv-calendar-select{padding:.75rem 1rem;border-radius:.25rem;border:solid 1px var(--gds-sys-color-base-600);--border-color: var(--gds-sys-color-base-600)}:host .nggv-calendar-select:focus:not(:focus-visible){box-shadow:none;outline:0}:host .nggv-calendar-select:focus,:host .nggv-calendar-select:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .nggv-calendar-select{appearance:auto;background:#fff;color:#333;display:block;flex:1;font-family:inherit;font-size:.875rem;font-weight:400;line-height:2rem;max-height:2rem;max-width:100%;min-height:2rem;padding-right:3rem;padding:0 .5em;text-overflow:ellipsis;white-space:nowrap;width:6rem}:host button.nggv-prev-button,:host button.nggv-next-button{background-color:transparent;border:0;cursor:pointer;font-family:inherit;padding:0;padding:.75rem 1rem;border-radius:.25rem;border:solid 1px var(--gds-sys-color-base-600);font-weight:500}:host button.nggv-prev-button:focus:not(:focus-visible),:host button.nggv-next-button:focus:not(:focus-visible){box-shadow:none;outline:0}:host button.nggv-prev-button:focus,:host button.nggv-prev-button:focus-visible,:host button.nggv-next-button:focus,:host button.nggv-next-button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host button.nggv-prev-button,:host button.nggv-next-button{min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center}@media(max-width:35.98em){:host button.nggv-prev-button,:host button.nggv-next-button{min-width:100%}}@media screen and (-ms-high-contrast:active){:host button.nggv-prev-button,:host button.nggv-next-button{border:2px solid currentcolor}}:host button.nggv-prev-button.small,:host button.nggv-next-button.small{min-height:2rem;height:2rem;padding:.4375rem .75rem;font-size:.875rem;line-height:1rem}:host button.nggv-prev-button.large,:host button.nggv-next-button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host button.nggv-prev-button,:host button.nggv-next-button{border:none;height:2rem;width:2rem;padding:0 .75em}@media(max-width:47.98em){:host button.nggv-prev-button,:host button.nggv-next-button{width:3em;height:3em}}:host button.nggv-prev-button:hover,:host button.nggv-next-button:hover{background-color:#e9e9e9}@media(max-width:35.98em){:host button.nggv-prev-button,:host button.nggv-next-button{min-width:initial}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.NggCoreElementDirective, selector: "[nggCoreElement]" }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }] }); }
|
|
1366
1385
|
}
|
|
1367
1386
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: CalendarControlComponent, decorators: [{
|
|
1368
1387
|
type: Component,
|
|
1369
|
-
args: [{ selector: 'nggv-calendar-control', standalone: false, template: "<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"previous-month\"\n class=\"nggv-prev-button\"\n (click)=\"viewPreviousMonth()\"\n>\n <gds-icon-chevron-left *nggCoreElement></gds-icon-chevron-left>\n</button>\n\n<ng-container [formGroup]=\"selectedCalendar\">\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-month\"\n formControlName=\"month\"\n >\n <option\n *ngFor=\"let month of monthArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"month.getMonth()\"\n >\n {{ month | date: 'MMMM' : undefined : locale }}\n </option>\n </select>\n\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-year\"\n formControlName=\"year\"\n >\n <option\n *ngFor=\"let year of yearArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"year.getFullYear()\"\n >\n {{ year | date: 'yyyy' : undefined : locale }}\n </option>\n </select>\n</ng-container>\n\n<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"next-month\"\n class=\"nggv-next-button\"\n (click)=\"viewNextMonth()\"\n>\n <gds-icon-chevron-right *nggCoreElement></gds-icon-chevron-right>\n</button>\n", styles: [":host{display:flex;padding:.25rem;justify-content:space-between;align-items:center;gap:.25rem}:host .nggv-calendar-select{
|
|
1388
|
+
args: [{ selector: 'nggv-calendar-control', standalone: false, template: "<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"previous-month\"\n class=\"nggv-prev-button\"\n (click)=\"viewPreviousMonth()\"\n>\n <gds-icon-chevron-left *nggCoreElement></gds-icon-chevron-left>\n</button>\n\n<ng-container [formGroup]=\"selectedCalendar\">\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-month\"\n formControlName=\"month\"\n >\n <option\n *ngFor=\"let month of monthArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"month.getMonth()\"\n >\n {{ month | date: 'MMMM' : undefined : locale }}\n </option>\n </select>\n\n <select\n class=\"nggv-calendar-select\"\n data-thook=\"select-year\"\n formControlName=\"year\"\n >\n <option\n *ngFor=\"let year of yearArray\"\n class=\"gds-field-dropdown__label\"\n tabindex=\"0\"\n [value]=\"year.getFullYear()\"\n >\n {{ year | date: 'yyyy' : undefined : locale }}\n </option>\n </select>\n</ng-container>\n\n<button\n *ngIf=\"type === 'normal'\"\n data-thook=\"next-month\"\n class=\"nggv-next-button\"\n (click)=\"viewNextMonth()\"\n>\n <gds-icon-chevron-right *nggCoreElement></gds-icon-chevron-right>\n</button>\n", styles: [":host{--gds-sys-color-blue: #41b0ee;--gds-sys-color-dark-blue-1: #0092e1;--gds-sys-color-dark-blue-2: #007ac7;--gds-sys-color-green: #60cd18;--gds-sys-color-dark-green-1: #45b400;--gds-sys-color-dark-green-2: #308800;--gds-sys-color-yellow: #ffc500;--gds-sys-color-dark-yellow-1: #ffb400;--gds-sys-color-dark-yellow-2: #f8a000;--gds-sys-color-text-primary: #333333;--gds-sys-color-text-secondary: #ababab;--gds-sys-color-text-white: #ffffff;--gds-sys-color-text-black: #333333;--gds-sys-color-text-inverted: #ffffff;--gds-sys-color-text-link: #0062bc;--gds-sys-color-text-error: #9f000a;--gds-sys-color-text-disabled: #adadad;--gds-sys-color-red: #f03529;--gds-sys-color-dark-red-1: #d81a1a;--gds-sys-color-dark-red-2: #bb000c;--gds-sys-color-purple: #673ab6;--gds-sys-color-dark-purple-1: #4f2C99;--gds-sys-color-dark-purple-2: #3f2587;--gds-sys-color-white: #ffffff;--gds-sys-color-black: #000000;--gds-sys-color-background-primary: #ffffff;--gds-sys-color-background-secondary: #eeeeee;--gds-sys-color-base-100: #f8f8f8;--gds-sys-color-base-200: #e9e9e9;--gds-sys-color-base-300: #dedede;--gds-sys-color-base-400: #cecece;--gds-sys-color-base-500: #adadad;--gds-sys-color-base-600: #868686;--gds-sys-color-base-700: #494949;--gds-sys-color-base-800: #333333;--gds-sys-color-base-900: #1a1a1a;--gds-sys-color-hover-10: rgba(255, 255, 255, .1);--gds-sys-color-hover-20: rgba(255, 255, 255, .2);display:flex;padding:.25rem;justify-content:space-between;align-items:center;gap:.25rem}:host .nggv-calendar-select{padding:.75rem 1rem;border-radius:.25rem;border:solid 1px var(--gds-sys-color-base-600);--border-color: var(--gds-sys-color-base-600)}:host .nggv-calendar-select:focus:not(:focus-visible){box-shadow:none;outline:0}:host .nggv-calendar-select:focus,:host .nggv-calendar-select:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .nggv-calendar-select{appearance:auto;background:#fff;color:#333;display:block;flex:1;font-family:inherit;font-size:.875rem;font-weight:400;line-height:2rem;max-height:2rem;max-width:100%;min-height:2rem;padding-right:3rem;padding:0 .5em;text-overflow:ellipsis;white-space:nowrap;width:6rem}:host button.nggv-prev-button,:host button.nggv-next-button{background-color:transparent;border:0;cursor:pointer;font-family:inherit;padding:0;padding:.75rem 1rem;border-radius:.25rem;border:solid 1px var(--gds-sys-color-base-600);font-weight:500}:host button.nggv-prev-button:focus:not(:focus-visible),:host button.nggv-next-button:focus:not(:focus-visible){box-shadow:none;outline:0}:host button.nggv-prev-button:focus,:host button.nggv-prev-button:focus-visible,:host button.nggv-next-button:focus,:host button.nggv-next-button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host button.nggv-prev-button,:host button.nggv-next-button{min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center}@media(max-width:35.98em){:host button.nggv-prev-button,:host button.nggv-next-button{min-width:100%}}@media screen and (-ms-high-contrast:active){:host button.nggv-prev-button,:host button.nggv-next-button{border:2px solid currentcolor}}:host button.nggv-prev-button.small,:host button.nggv-next-button.small{min-height:2rem;height:2rem;padding:.4375rem .75rem;font-size:.875rem;line-height:1rem}:host button.nggv-prev-button.large,:host button.nggv-next-button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host button.nggv-prev-button,:host button.nggv-next-button{border:none;height:2rem;width:2rem;padding:0 .75em}@media(max-width:47.98em){:host button.nggv-prev-button,:host button.nggv-next-button{width:3em;height:3em}}:host button.nggv-prev-button:hover,:host button.nggv-next-button:hover{background-color:#e9e9e9}@media(max-width:35.98em){:host button.nggv-prev-button,:host button.nggv-next-button{min-width:initial}}\n"] }]
|
|
1370
1389
|
}], ctorParameters: () => [{ type: i1.UntypedFormBuilder }], propDecorators: { calendarChange: [{
|
|
1371
1390
|
type: Output
|
|
1372
1391
|
}], activeCalendar: [{
|
|
@@ -1445,7 +1464,7 @@ class DatepickerComponent {
|
|
|
1445
1464
|
!!changes.selected.currentValue &&
|
|
1446
1465
|
!changes.selected.isFirstChange()) {
|
|
1447
1466
|
// set active calendar to match selected date
|
|
1448
|
-
const activeCalendar = new CalendarMonth(
|
|
1467
|
+
const activeCalendar = new CalendarMonth(toLocalDate(changes.selected.currentValue));
|
|
1449
1468
|
this.changeActiveCalendar(activeCalendar);
|
|
1450
1469
|
}
|
|
1451
1470
|
if (changes.disableDates && !changes.disableDates.isFirstChange()) {
|
|
@@ -1495,7 +1514,7 @@ class DatepickerComponent {
|
|
|
1495
1514
|
const withinSameMonth = (a, b) => a.getMonth() === b.getMonth() && a.getFullYear() === b.getFullYear();
|
|
1496
1515
|
// filter out disabled dates for current and adjacent months
|
|
1497
1516
|
return disableDates
|
|
1498
|
-
.map((d) =>
|
|
1517
|
+
.map((d) => toLocalDate(d))
|
|
1499
1518
|
.filter((d) => withinSameMonth(d, previousMonth) ||
|
|
1500
1519
|
withinSameMonth(d, targetMonth) ||
|
|
1501
1520
|
withinSameMonth(d, nextMonth));
|
|
@@ -1745,11 +1764,11 @@ class DateInputComponent extends DateControlValueAccessorComponent {
|
|
|
1745
1764
|
});
|
|
1746
1765
|
}
|
|
1747
1766
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: DateInputComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: TRANSLOCO_SCOPE, optional: true }, { token: i2.TranslocoService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1748
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: DateInputComponent, isStandalone: false, selector: "nggv-dateinput,nggv-input[type=date]", inputs: { thook: "thook", type: "type", readonly: "readonly", disableDates: "disableDates", disableWeekDays: "disableWeekDays", minRows: "minRows", firstValid: "firstValid", lastValid: "lastValid", closingTime: "closingTime", firstDayOfWeek: "firstDayOfWeek", closeCalendarOnEscape: "closeCalendarOnEscape", closeOnScroll: "closeOnScroll", size: "size", dynamicPosition: "dynamicPosition" }, host: { listeners: { "keydown": "keyListener($event)" }, properties: { "attr.data-thook": "this.thook", "class.small": "this.isSmall", "class.large": "this.isLarge" } }, viewQueries: [{ propertyName: "toggleButtonRef", first: true, predicate: ["toggleCalendarButton"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<!-- LABEL -->\n<ng-container *transloco=\"let t; read: scope\">\n <label\n [id]=\"id + '-label'\"\n class=\"gds-field-label hide-if-empty\"\n [attr.for]=\"id + '-input'\"\n >\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"gds-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n </label>\n\n <!-- DESCRIPTION -->\n <div\n class=\"gds-field-label--small description hide-if-empty\"\n *ngIf=\"description\"\n >\n {{ description }}\n </div>\n\n <!-- LOCKED INPUT -->\n <ng-container *ngIf=\"locked\">\n <ng-template\n *ngTemplateOutlet=\"\n lockedTpl || defaultLockedTpl;\n context: { $implicit: state }\n \"\n ></ng-template>\n <ng-template #defaultLockedTpl>\n <div\n [id]=\"id + '-input'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n {{ state | nggvInputMaskFormat: dateInputMask }}\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n\n <!-- INPUT WRAPPER -->\n <ng-container *ngIf=\"!locked\">\n <div\n class=\"field-wrap\"\n [class.nggv-field--error]=\"invalid\"\n *ngIf=\"showInput$ | async\"\n >\n <!-- INPUT FIELD -->\n <input\n #input\n [id]=\"id + '-input'\"\n class=\"nggv-field-date\"\n type=\"text\"\n autocomplete=\"off\"\n [attr.name]=\"name\"\n [attr.required]=\"required || null\"\n [disabled]=\"disabled\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [nggvInputMask]=\"dateInputMask\"\n [value]=\"state\"\n title=\"\"\n (change)=\"onValueChange($event.target)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n <button\n aria-label=\"toggle calendar\"\n #toggleCalendarButton\n class=\"nggv-button-date\"\n type=\"button\"\n data-thook=\"toggle-calendar-button\"\n (click)=\"toggleDatepicker()\"\n [disabled]=\"disabled\"\n >\n @if (size === 'small') {\n <gds-icon-calendar *nggCoreElement size=\"16px\"></gds-icon-calendar>\n }\n\n @if (size === 'large') {\n <gds-icon-calendar *nggCoreElement size=\"20px\"></gds-icon-calendar>\n }\n </button>\n </div>\n\n <!-- DATEPICKER -->\n <div class=\"nggv-datepicker\" *ngIf=\"shown\">\n <nggv-datepicker\n #input\n [type]=\"type\"\n [disableDates]=\"disableDates\"\n [disableWeekDays]=\"disableWeekDays\"\n [selected]=\"state\"\n [locale]=\"locale\"\n [minCalendarRows]=\"minRows\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [firstValid]=\"firstValid\"\n [lastValid]=\"lastValid\"\n [closingTime]=\"closingTime\"\n [dynamicPosition]=\"dynamicPosition\"\n [size]=\"size\"\n (ngvDateChange)=\"onDateChange($event)\"\n >\n <ng-content></ng-content>\n </nggv-datepicker>\n </div>\n\n <!-- ERRORS -->\n <ng-container\n *ngIf=\"\n invalid &&\n (error || ngControl?.invalid) &&\n (!errorList || !errorList.length)\n \"\n >\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n size=\"16px\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n *ngIf=\"error; else errorsRef\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n <ng-template #errorsRef>\n <span\n *ngIf=\"firstError as error\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </span>\n </label>\n </ng-container>\n <ng-container *ngFor=\"let error of errorList ?? []\">\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n *ngIf=\"invalid && error\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n size=\"16px\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n </span>\n </label>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [":host{display:block;position:relative}@media(max-width:47.98em){:host{min-width:100%}}:host .hide-if-empty:empty{display:none}:host .unset-state{padding-left:.5rem}:host .gds-field-label:is(label){margin-bottom:0}:host .gds-field-label.form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label.form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label.form-control:focus,:host .gds-field-label.form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label:not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label+input,:host .gds-field-label+textarea,fieldset :host .gds-field-label+div,:host .gds-field-label+button,:host .gds-field-label+.group-stepper,:host .gds-field-label+.stepper-wrapper,:host .gds-field-label+.group{margin-top:.5rem}:host .gds-field-label+.form-info{margin-bottom:.5rem}:host .gds-field-label{display:block}:host label+.field-wrap,:host label+.nggv-field--locked{margin-top:.5rem}:host .description{font-size:.875rem;margin-bottom:.5rem;line-height:1.25rem;width:100%}:host .gds-field-label--optional:is(label){margin-bottom:0}:host .gds-field-label--optional.form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label--optional.form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label--optional.form-control:focus,:host .gds-field-label--optional.form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label--optional:not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label--optional+input,:host .gds-field-label--optional+textarea,fieldset :host .gds-field-label--optional+div,:host .gds-field-label--optional+button,:host .gds-field-label--optional+.group-stepper,:host .gds-field-label--optional+.stepper-wrapper,:host .gds-field-label--optional+.group{margin-top:.5rem}:host .gds-field-label--optional+.form-info{margin-bottom:.5rem}:host .nggv-datepicker{margin-top:.25rem;position:absolute}:host .nggv-field--error{border-bottom:.125rem solid #9f000a!important}:host .nggv-field--error:focus,:host .nggv-field--error:active,:host .nggv-field--error:hover{border-bottom:.125rem solid #9f000a!important}:host .error-item{display:flex;gap:.5rem;color:#9f000a}:host .gds-field-notice{margin-top:.5rem;display:block;font-size:.875rem;line-height:1;font-weight:500}:host .field-wrap{border:1px solid #868686;border-radius:4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit}:host .field-wrap *,:host .field-wrap *:before,:host .field-wrap *:after{box-sizing:border-box}:host .field-wrap{height:2.625rem;display:flex}:host .field-wrap .nggv-button-date{--text-disabled-color: #adadad;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500}:host .field-wrap .nggv-button-date:focus:not(:focus-visible){box-shadow:none;outline:0}:host .field-wrap .nggv-button-date:focus,:host .field-wrap .nggv-button-date:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-button-date{min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center}@media(max-width:35.98em){:host .field-wrap .nggv-button-date{min-width:100%}}@media screen and (-ms-high-contrast:active){:host .field-wrap .nggv-button-date{border:2px solid currentcolor}}:host .field-wrap .nggv-button-date.small{min-height:2rem;padding:.4375rem .75rem;font-size:.875rem;line-height:1rem}:host .field-wrap .nggv-button-date.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .field-wrap .nggv-button-date{transition:border .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s}:host .field-wrap .nggv-button-date:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .field-wrap .nggv-button-date[aria-selected=true],:host .field-wrap .nggv-button-date:active,:host .field-wrap .nggv-button-date.active,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .field-wrap .nggv-button-date[aria-selected]:hover,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{opacity:.9}:host .field-wrap .nggv-button-date:focus-visible{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333!important}:host .field-wrap .nggv-button-date{border-color:#333;color:#333;--color: rgb(51, 51, 51)}:host .field-wrap .nggv-button-date:disabled,:host .field-wrap .nggv-button-date.disabled,:host .field-wrap .nggv-button-date[aria-disabled=true]{color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .field-wrap .nggv-button-date:disabled::placeholder,:host .field-wrap .nggv-button-date.disabled::placeholder,:host .field-wrap .nggv-button-date[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}@media(max-width:47.98em){:host .field-wrap .nggv-button-date{width:2.625rem;height:2.625rem}}:host .field-wrap .nggv-button-date{background-color:transparent;min-height:2.5rem;border:none;border-radius:3px;width:2.625rem;height:2.625rem;min-width:2.625rem;border-top-left-radius:0!important;border-bottom-left-radius:0!important;text-align:right}:host .field-wrap .nggv-button-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-button-date[disabled]{background-color:#f8f8f8!important;color:#adadad}@media(max-width:35.98em){:host .field-wrap .nggv-button-date{min-width:initial}}:host .field-wrap input[type=text]::-webkit-inner-spin-button,:host .field-wrap input[type=text]::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none;font-size:1rem;font-family:inherit}:host .field-wrap .nggv-field-date{border:1px solid #cecece;border-radius:4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit}:host .field-wrap .nggv-field-date *,:host .field-wrap .nggv-field-date *:before,:host .field-wrap .nggv-field-date *:after{box-sizing:border-box}:host .field-wrap .nggv-field-date:hover{border-color:#41b0ee}:host .field-wrap .nggv-field-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-field-date:active{border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]{background-color:#f8f8f8;border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]::placeholder{color:#cecece}:host .field-wrap .nggv-field-date{border:none;min-height:2.375rem;width:100%;border-bottom-right-radius:0;border-top-right-radius:0;padding-left:1rem}:host .field-wrap .nggv-field-date:not(:focus){border-right:none;padding-right:0}:host .field-wrap .nggv-field-date:focus{padding-right:0}:host.small .gds-field-label{font-size:.875rem;line-height:1rem}:host.small label+.field-wrap{margin-top:.25rem}:host.small .field-wrap{height:calc(2rem + 3px);min-height:calc(2rem + 3px)}:host.small .field-wrap .nggv-field-date{padding:.38rem .5rem;line-height:1rem;min-height:2rem;font-size:.875rem}:host.small .field-wrap .nggv-button-date{min-height:2rem;min-width:2rem;width:2rem;height:2rem;padding:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "directive", type: i4.NggvInputMaskDirective, selector: "[nggvInputMask]", inputs: ["nggvInputMask"] }, { kind: "directive", type: i3.NggCoreElementDirective, selector: "[nggCoreElement]" }, { kind: "component", type: DatepickerComponent, selector: "nggv-datepicker", inputs: ["firstDayOfWeek", "disableDates", "disableWeekDays", "minCalendarRows", "selected", "locale", "type", "firstValid", "lastValid", "closingTime", "dynamicPosition", "size"], outputs: ["ngvDateChange"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.InputMaskFormatPipe, name: "nggvInputMaskFormat" }] }); }
|
|
1767
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: DateInputComponent, isStandalone: false, selector: "nggv-dateinput,nggv-input[type=date]", inputs: { thook: "thook", type: "type", readonly: "readonly", disableDates: "disableDates", disableWeekDays: "disableWeekDays", minRows: "minRows", firstValid: "firstValid", lastValid: "lastValid", closingTime: "closingTime", firstDayOfWeek: "firstDayOfWeek", closeCalendarOnEscape: "closeCalendarOnEscape", closeOnScroll: "closeOnScroll", size: "size", dynamicPosition: "dynamicPosition" }, host: { listeners: { "keydown": "keyListener($event)" }, properties: { "attr.data-thook": "this.thook", "class.small": "this.isSmall", "class.large": "this.isLarge" } }, viewQueries: [{ propertyName: "toggleButtonRef", first: true, predicate: ["toggleCalendarButton"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<!-- LABEL -->\n<ng-container *transloco=\"let t; read: scope\">\n <label\n [id]=\"id + '-label'\"\n class=\"gds-field-label hide-if-empty\"\n [attr.for]=\"id + '-input'\"\n >\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"gds-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n </label>\n\n <!-- DESCRIPTION -->\n <div\n class=\"gds-field-label--small description hide-if-empty\"\n *ngIf=\"description\"\n >\n {{ description }}\n </div>\n\n <!-- LOCKED INPUT -->\n <ng-container *ngIf=\"locked\">\n <ng-template\n *ngTemplateOutlet=\"\n lockedTpl || defaultLockedTpl;\n context: { $implicit: state }\n \"\n ></ng-template>\n <ng-template #defaultLockedTpl>\n <div\n [id]=\"id + '-input'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n {{ state | nggvInputMaskFormat: dateInputMask }}\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n\n <!-- INPUT WRAPPER -->\n <ng-container *ngIf=\"!locked\">\n <div\n class=\"field-wrap\"\n [class.nggv-field--error]=\"invalid\"\n *ngIf=\"showInput$ | async\"\n >\n <!-- INPUT FIELD -->\n <input\n #input\n [id]=\"id + '-input'\"\n class=\"nggv-field-date\"\n type=\"text\"\n autocomplete=\"off\"\n [attr.name]=\"name\"\n [attr.required]=\"required || null\"\n [disabled]=\"disabled\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [nggvInputMask]=\"dateInputMask\"\n [value]=\"state\"\n title=\"\"\n (change)=\"onValueChange($event.target)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n <button\n aria-label=\"toggle calendar\"\n #toggleCalendarButton\n class=\"nggv-button-date\"\n type=\"button\"\n data-thook=\"toggle-calendar-button\"\n (click)=\"toggleDatepicker()\"\n [disabled]=\"disabled\"\n >\n @if (size === 'small') {\n <gds-icon-calendar *nggCoreElement size=\"16px\"></gds-icon-calendar>\n }\n\n @if (size === 'large') {\n <gds-icon-calendar *nggCoreElement size=\"20px\"></gds-icon-calendar>\n }\n </button>\n </div>\n\n <!-- DATEPICKER -->\n <div class=\"nggv-datepicker\" *ngIf=\"shown\">\n <nggv-datepicker\n #input\n [type]=\"type\"\n [disableDates]=\"disableDates\"\n [disableWeekDays]=\"disableWeekDays\"\n [selected]=\"state\"\n [locale]=\"locale\"\n [minCalendarRows]=\"minRows\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [firstValid]=\"firstValid\"\n [lastValid]=\"lastValid\"\n [closingTime]=\"closingTime\"\n [dynamicPosition]=\"dynamicPosition\"\n [size]=\"size\"\n (ngvDateChange)=\"onDateChange($event)\"\n >\n <ng-content></ng-content>\n </nggv-datepicker>\n </div>\n\n <!-- ERRORS -->\n <ng-container\n *ngIf=\"\n invalid &&\n (error || ngControl?.invalid) &&\n (!errorList || !errorList.length)\n \"\n >\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n size=\"16px\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n *ngIf=\"error; else errorsRef\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n <ng-template #errorsRef>\n <span\n *ngIf=\"firstError as error\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </span>\n </label>\n </ng-container>\n <ng-container *ngFor=\"let error of errorList ?? []\">\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n *ngIf=\"invalid && error\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n size=\"16px\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n </span>\n </label>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [":host{display:block;position:relative}@media(max-width:47.98em){:host{min-width:100%}}:host .hide-if-empty:empty{display:none}:host .unset-state{padding-left:.5rem}:host .gds-field-label:is(label){margin-bottom:0}:host .gds-field-label.gds-form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label.gds-form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label.gds-form-control:focus,:host .gds-field-label.gds-form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label:not(.gds-form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label+input,:host .gds-field-label+textarea,fieldset :host .gds-field-label+div,:host .gds-field-label+.gds-button,:host .gds-field-label+.gds-group-stepper,:host .gds-field-label+.gds-stepper-wrapper,:host .gds-field-label+.gds-group{margin-top:.5rem}:host .gds-field-label+.gds-form-info{margin-bottom:.5rem}:host .gds-field-label{display:block}:host label+.field-wrap,:host label+.nggv-field--locked{margin-top:.5rem}:host .description{font-size:.875rem;margin-bottom:.5rem;line-height:1.25rem;width:100%}:host .gds-field-label--optional:is(label){margin-bottom:0}:host .gds-field-label--optional.gds-form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label--optional.gds-form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label--optional.gds-form-control:focus,:host .gds-field-label--optional.gds-form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label--optional:not(.gds-form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label--optional+input,:host .gds-field-label--optional+textarea,fieldset :host .gds-field-label--optional+div,:host .gds-field-label--optional+.gds-button,:host .gds-field-label--optional+.gds-group-stepper,:host .gds-field-label--optional+.gds-stepper-wrapper,:host .gds-field-label--optional+.gds-group{margin-top:.5rem}:host .gds-field-label--optional+.gds-form-info{margin-bottom:.5rem}:host .nggv-datepicker{margin-top:.25rem;position:absolute}:host .nggv-field--error{border-bottom:.125rem solid #9f000a!important}:host .nggv-field--error:focus,:host .nggv-field--error:active,:host .nggv-field--error:hover{border-bottom:.125rem solid #9f000a!important}:host .error-item{display:flex;gap:.5rem;color:#9f000a}:host .gds-field-notice{margin-top:.5rem;display:block;font-size:.875rem;line-height:1;font-weight:500}:host .field-wrap{border:1px solid #868686;border-radius:4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit}:host .field-wrap *,:host .field-wrap *:before,:host .field-wrap *:after{box-sizing:border-box}:host .field-wrap{height:2.625rem;display:flex}:host .field-wrap .nggv-button-date{--text-disabled-color: #adadad;padding:.75rem 1rem;border-radius:.25rem;border:solid 1px var(--gds-sys-color-base-600);font-weight:500}:host .field-wrap .nggv-button-date:focus:not(:focus-visible){box-shadow:none;outline:0}:host .field-wrap .nggv-button-date:focus,:host .field-wrap .nggv-button-date:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-button-date{min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center}@media(max-width:35.98em){:host .field-wrap .nggv-button-date{min-width:100%}}@media screen and (-ms-high-contrast:active){:host .field-wrap .nggv-button-date{border:2px solid currentcolor}}:host .field-wrap .nggv-button-date.small{min-height:2rem;height:2rem;padding:.4375rem .75rem;font-size:.875rem;line-height:1rem}:host .field-wrap .nggv-button-date.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .field-wrap .nggv-button-date{transition:border var(--gds-sys-transition)}:host .field-wrap .nggv-button-date:not(:disabled,.disabled,[aria-disabled]):hover{background:var(--gds-sys-color-base-800);color:var(--gds-sys-color-text-white);--background: var(--gds-sys-color-base-800);--color: var(--gds-sys-color-text-white);border-color:var(--gds-sys-color-base-800)}:host .field-wrap .nggv-button-date[aria-selected=true],:host .field-wrap .nggv-button-date:active,:host .field-wrap .nggv-button-date.active,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{background:var(--gds-sys-color-base-800);color:var(--gds-sys-color-text-white);--background: $bg;--color: $color;border-color:var(--gds-sys-color-base-800)}:host .field-wrap .nggv-button-date[aria-selected]:hover,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{opacity:.9}:host .field-wrap .nggv-button-date{background-color:transparent;border-color:var(--gds-sys-color-base-800);color:var(--gds-sys-color-base-800);--color: var(--gds-sys-color-base-800)}:host .field-wrap .nggv-button-date:disabled,:host .field-wrap .nggv-button-date.disabled,:host .field-wrap .nggv-button-date[aria-disabled=true]{color:var(--gds-sys-color-text-disabled)!important;border-color:var(--gds-sys-color-text-disabled)!important;cursor:not-allowed}:host .field-wrap .nggv-button-date:disabled::placeholder,:host .field-wrap .nggv-button-date.disabled::placeholder,:host .field-wrap .nggv-button-date[aria-disabled=true]::placeholder{color:var(--gds-sys-color-text-disabled)}@media(max-width:47.98em){:host .field-wrap .nggv-button-date{width:2.625rem;height:2.625rem}}:host .field-wrap .nggv-button-date{background-color:transparent;min-height:2.5rem;border:none;border-radius:3px;width:2.625rem;height:2.625rem;min-width:2.625rem;border-top-left-radius:0!important;border-bottom-left-radius:0!important;text-align:right}:host .field-wrap .nggv-button-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-button-date[disabled]{background-color:#f8f8f8!important;color:#adadad}@media(max-width:35.98em){:host .field-wrap .nggv-button-date{min-width:initial}}:host .field-wrap input[type=text]::-webkit-inner-spin-button,:host .field-wrap input[type=text]::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none;font-size:1rem;font-family:inherit}:host .field-wrap .nggv-field-date{border:1px solid #cecece;border-radius:4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit}:host .field-wrap .nggv-field-date *,:host .field-wrap .nggv-field-date *:before,:host .field-wrap .nggv-field-date *:after{box-sizing:border-box}:host .field-wrap .nggv-field-date:hover{border-color:#41b0ee}:host .field-wrap .nggv-field-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-field-date:active{border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]{background-color:#f8f8f8;border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]::placeholder{color:#cecece}:host .field-wrap .nggv-field-date{border:none;min-height:2.375rem;width:100%;border-bottom-right-radius:0;border-top-right-radius:0;padding-left:1rem}:host .field-wrap .nggv-field-date:not(:focus){border-right:none;padding-right:0}:host .field-wrap .nggv-field-date:focus{padding-right:0}:host.small .gds-field-label{font-size:.875rem;line-height:1rem}:host.small label+.field-wrap{margin-top:.25rem}:host.small .field-wrap{height:calc(2rem + 3px);min-height:calc(2rem + 3px)}:host.small .field-wrap .nggv-field-date{padding:.38rem .5rem;line-height:1rem;min-height:2rem;font-size:.875rem}:host.small .field-wrap .nggv-button-date{min-height:2rem;min-width:2rem;width:2rem;height:2rem;padding:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "directive", type: i4.NggvInputMaskDirective, selector: "[nggvInputMask]", inputs: ["nggvInputMask"] }, { kind: "directive", type: i3.NggCoreElementDirective, selector: "[nggCoreElement]" }, { kind: "component", type: DatepickerComponent, selector: "nggv-datepicker", inputs: ["firstDayOfWeek", "disableDates", "disableWeekDays", "minCalendarRows", "selected", "locale", "type", "firstValid", "lastValid", "closingTime", "dynamicPosition", "size"], outputs: ["ngvDateChange"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.InputMaskFormatPipe, name: "nggvInputMaskFormat" }] }); }
|
|
1749
1768
|
}
|
|
1750
1769
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: DateInputComponent, decorators: [{
|
|
1751
1770
|
type: Component,
|
|
1752
|
-
args: [{ selector: 'nggv-dateinput,nggv-input[type=date]', standalone: false, template: "<!-- LABEL -->\n<ng-container *transloco=\"let t; read: scope\">\n <label\n [id]=\"id + '-label'\"\n class=\"gds-field-label hide-if-empty\"\n [attr.for]=\"id + '-input'\"\n >\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"gds-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n </label>\n\n <!-- DESCRIPTION -->\n <div\n class=\"gds-field-label--small description hide-if-empty\"\n *ngIf=\"description\"\n >\n {{ description }}\n </div>\n\n <!-- LOCKED INPUT -->\n <ng-container *ngIf=\"locked\">\n <ng-template\n *ngTemplateOutlet=\"\n lockedTpl || defaultLockedTpl;\n context: { $implicit: state }\n \"\n ></ng-template>\n <ng-template #defaultLockedTpl>\n <div\n [id]=\"id + '-input'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n {{ state | nggvInputMaskFormat: dateInputMask }}\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n\n <!-- INPUT WRAPPER -->\n <ng-container *ngIf=\"!locked\">\n <div\n class=\"field-wrap\"\n [class.nggv-field--error]=\"invalid\"\n *ngIf=\"showInput$ | async\"\n >\n <!-- INPUT FIELD -->\n <input\n #input\n [id]=\"id + '-input'\"\n class=\"nggv-field-date\"\n type=\"text\"\n autocomplete=\"off\"\n [attr.name]=\"name\"\n [attr.required]=\"required || null\"\n [disabled]=\"disabled\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [nggvInputMask]=\"dateInputMask\"\n [value]=\"state\"\n title=\"\"\n (change)=\"onValueChange($event.target)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n <button\n aria-label=\"toggle calendar\"\n #toggleCalendarButton\n class=\"nggv-button-date\"\n type=\"button\"\n data-thook=\"toggle-calendar-button\"\n (click)=\"toggleDatepicker()\"\n [disabled]=\"disabled\"\n >\n @if (size === 'small') {\n <gds-icon-calendar *nggCoreElement size=\"16px\"></gds-icon-calendar>\n }\n\n @if (size === 'large') {\n <gds-icon-calendar *nggCoreElement size=\"20px\"></gds-icon-calendar>\n }\n </button>\n </div>\n\n <!-- DATEPICKER -->\n <div class=\"nggv-datepicker\" *ngIf=\"shown\">\n <nggv-datepicker\n #input\n [type]=\"type\"\n [disableDates]=\"disableDates\"\n [disableWeekDays]=\"disableWeekDays\"\n [selected]=\"state\"\n [locale]=\"locale\"\n [minCalendarRows]=\"minRows\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [firstValid]=\"firstValid\"\n [lastValid]=\"lastValid\"\n [closingTime]=\"closingTime\"\n [dynamicPosition]=\"dynamicPosition\"\n [size]=\"size\"\n (ngvDateChange)=\"onDateChange($event)\"\n >\n <ng-content></ng-content>\n </nggv-datepicker>\n </div>\n\n <!-- ERRORS -->\n <ng-container\n *ngIf=\"\n invalid &&\n (error || ngControl?.invalid) &&\n (!errorList || !errorList.length)\n \"\n >\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n size=\"16px\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n *ngIf=\"error; else errorsRef\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n <ng-template #errorsRef>\n <span\n *ngIf=\"firstError as error\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </span>\n </label>\n </ng-container>\n <ng-container *ngFor=\"let error of errorList ?? []\">\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n *ngIf=\"invalid && error\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n size=\"16px\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n </span>\n </label>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [":host{display:block;position:relative}@media(max-width:47.98em){:host{min-width:100%}}:host .hide-if-empty:empty{display:none}:host .unset-state{padding-left:.5rem}:host .gds-field-label:is(label){margin-bottom:0}:host .gds-field-label.form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label.form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label.form-control:focus,:host .gds-field-label.form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label:not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label+input,:host .gds-field-label+textarea,fieldset :host .gds-field-label+div,:host .gds-field-label+button,:host .gds-field-label+.group-stepper,:host .gds-field-label+.stepper-wrapper,:host .gds-field-label+.group{margin-top:.5rem}:host .gds-field-label+.form-info{margin-bottom:.5rem}:host .gds-field-label{display:block}:host label+.field-wrap,:host label+.nggv-field--locked{margin-top:.5rem}:host .description{font-size:.875rem;margin-bottom:.5rem;line-height:1.25rem;width:100%}:host .gds-field-label--optional:is(label){margin-bottom:0}:host .gds-field-label--optional.form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label--optional.form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label--optional.form-control:focus,:host .gds-field-label--optional.form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label--optional:not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label--optional+input,:host .gds-field-label--optional+textarea,fieldset :host .gds-field-label--optional+div,:host .gds-field-label--optional+button,:host .gds-field-label--optional+.group-stepper,:host .gds-field-label--optional+.stepper-wrapper,:host .gds-field-label--optional+.group{margin-top:.5rem}:host .gds-field-label--optional+.form-info{margin-bottom:.5rem}:host .nggv-datepicker{margin-top:.25rem;position:absolute}:host .nggv-field--error{border-bottom:.125rem solid #9f000a!important}:host .nggv-field--error:focus,:host .nggv-field--error:active,:host .nggv-field--error:hover{border-bottom:.125rem solid #9f000a!important}:host .error-item{display:flex;gap:.5rem;color:#9f000a}:host .gds-field-notice{margin-top:.5rem;display:block;font-size:.875rem;line-height:1;font-weight:500}:host .field-wrap{border:1px solid #868686;border-radius:4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit}:host .field-wrap *,:host .field-wrap *:before,:host .field-wrap *:after{box-sizing:border-box}:host .field-wrap{height:2.625rem;display:flex}:host .field-wrap .nggv-button-date{--text-disabled-color: #adadad;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500}:host .field-wrap .nggv-button-date:focus:not(:focus-visible){box-shadow:none;outline:0}:host .field-wrap .nggv-button-date:focus,:host .field-wrap .nggv-button-date:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-button-date{min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center}@media(max-width:35.98em){:host .field-wrap .nggv-button-date{min-width:100%}}@media screen and (-ms-high-contrast:active){:host .field-wrap .nggv-button-date{border:2px solid currentcolor}}:host .field-wrap .nggv-button-date.small{min-height:2rem;padding:.4375rem .75rem;font-size:.875rem;line-height:1rem}:host .field-wrap .nggv-button-date.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .field-wrap .nggv-button-date{transition:border .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s}:host .field-wrap .nggv-button-date:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .field-wrap .nggv-button-date[aria-selected=true],:host .field-wrap .nggv-button-date:active,:host .field-wrap .nggv-button-date.active,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .field-wrap .nggv-button-date[aria-selected]:hover,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{opacity:.9}:host .field-wrap .nggv-button-date:focus-visible{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333!important}:host .field-wrap .nggv-button-date{border-color:#333;color:#333;--color: rgb(51, 51, 51)}:host .field-wrap .nggv-button-date:disabled,:host .field-wrap .nggv-button-date.disabled,:host .field-wrap .nggv-button-date[aria-disabled=true]{color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .field-wrap .nggv-button-date:disabled::placeholder,:host .field-wrap .nggv-button-date.disabled::placeholder,:host .field-wrap .nggv-button-date[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}@media(max-width:47.98em){:host .field-wrap .nggv-button-date{width:2.625rem;height:2.625rem}}:host .field-wrap .nggv-button-date{background-color:transparent;min-height:2.5rem;border:none;border-radius:3px;width:2.625rem;height:2.625rem;min-width:2.625rem;border-top-left-radius:0!important;border-bottom-left-radius:0!important;text-align:right}:host .field-wrap .nggv-button-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-button-date[disabled]{background-color:#f8f8f8!important;color:#adadad}@media(max-width:35.98em){:host .field-wrap .nggv-button-date{min-width:initial}}:host .field-wrap input[type=text]::-webkit-inner-spin-button,:host .field-wrap input[type=text]::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none;font-size:1rem;font-family:inherit}:host .field-wrap .nggv-field-date{border:1px solid #cecece;border-radius:4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit}:host .field-wrap .nggv-field-date *,:host .field-wrap .nggv-field-date *:before,:host .field-wrap .nggv-field-date *:after{box-sizing:border-box}:host .field-wrap .nggv-field-date:hover{border-color:#41b0ee}:host .field-wrap .nggv-field-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-field-date:active{border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]{background-color:#f8f8f8;border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]::placeholder{color:#cecece}:host .field-wrap .nggv-field-date{border:none;min-height:2.375rem;width:100%;border-bottom-right-radius:0;border-top-right-radius:0;padding-left:1rem}:host .field-wrap .nggv-field-date:not(:focus){border-right:none;padding-right:0}:host .field-wrap .nggv-field-date:focus{padding-right:0}:host.small .gds-field-label{font-size:.875rem;line-height:1rem}:host.small label+.field-wrap{margin-top:.25rem}:host.small .field-wrap{height:calc(2rem + 3px);min-height:calc(2rem + 3px)}:host.small .field-wrap .nggv-field-date{padding:.38rem .5rem;line-height:1rem;min-height:2rem;font-size:.875rem}:host.small .field-wrap .nggv-button-date{min-height:2rem;min-width:2rem;width:2rem;height:2rem;padding:0}\n"] }]
|
|
1771
|
+
args: [{ selector: 'nggv-dateinput,nggv-input[type=date]', standalone: false, template: "<!-- LABEL -->\n<ng-container *transloco=\"let t; read: scope\">\n <label\n [id]=\"id + '-label'\"\n class=\"gds-field-label hide-if-empty\"\n [attr.for]=\"id + '-input'\"\n >\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"gds-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n </label>\n\n <!-- DESCRIPTION -->\n <div\n class=\"gds-field-label--small description hide-if-empty\"\n *ngIf=\"description\"\n >\n {{ description }}\n </div>\n\n <!-- LOCKED INPUT -->\n <ng-container *ngIf=\"locked\">\n <ng-template\n *ngTemplateOutlet=\"\n lockedTpl || defaultLockedTpl;\n context: { $implicit: state }\n \"\n ></ng-template>\n <ng-template #defaultLockedTpl>\n <div\n [id]=\"id + '-input'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n {{ state | nggvInputMaskFormat: dateInputMask }}\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n\n <!-- INPUT WRAPPER -->\n <ng-container *ngIf=\"!locked\">\n <div\n class=\"field-wrap\"\n [class.nggv-field--error]=\"invalid\"\n *ngIf=\"showInput$ | async\"\n >\n <!-- INPUT FIELD -->\n <input\n #input\n [id]=\"id + '-input'\"\n class=\"nggv-field-date\"\n type=\"text\"\n autocomplete=\"off\"\n [attr.name]=\"name\"\n [attr.required]=\"required || null\"\n [disabled]=\"disabled\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [nggvInputMask]=\"dateInputMask\"\n [value]=\"state\"\n title=\"\"\n (change)=\"onValueChange($event.target)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n <button\n aria-label=\"toggle calendar\"\n #toggleCalendarButton\n class=\"nggv-button-date\"\n type=\"button\"\n data-thook=\"toggle-calendar-button\"\n (click)=\"toggleDatepicker()\"\n [disabled]=\"disabled\"\n >\n @if (size === 'small') {\n <gds-icon-calendar *nggCoreElement size=\"16px\"></gds-icon-calendar>\n }\n\n @if (size === 'large') {\n <gds-icon-calendar *nggCoreElement size=\"20px\"></gds-icon-calendar>\n }\n </button>\n </div>\n\n <!-- DATEPICKER -->\n <div class=\"nggv-datepicker\" *ngIf=\"shown\">\n <nggv-datepicker\n #input\n [type]=\"type\"\n [disableDates]=\"disableDates\"\n [disableWeekDays]=\"disableWeekDays\"\n [selected]=\"state\"\n [locale]=\"locale\"\n [minCalendarRows]=\"minRows\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [firstValid]=\"firstValid\"\n [lastValid]=\"lastValid\"\n [closingTime]=\"closingTime\"\n [dynamicPosition]=\"dynamicPosition\"\n [size]=\"size\"\n (ngvDateChange)=\"onDateChange($event)\"\n >\n <ng-content></ng-content>\n </nggv-datepicker>\n </div>\n\n <!-- ERRORS -->\n <ng-container\n *ngIf=\"\n invalid &&\n (error || ngControl?.invalid) &&\n (!errorList || !errorList.length)\n \"\n >\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n size=\"16px\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n *ngIf=\"error; else errorsRef\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n <ng-template #errorsRef>\n <span\n *ngIf=\"firstError as error\"\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </span>\n </label>\n </ng-container>\n <ng-container *ngFor=\"let error of errorList ?? []\">\n <label\n class=\"gds-field-notice gds-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n *ngIf=\"invalid && error\"\n >\n <span class=\"error-item\">\n <span class=\"error-item--icon\">\n <gds-icon-triangle-exclamation\n *nggCoreElement\n [solid]=\"true\"\n size=\"16px\"\n ></gds-icon-triangle-exclamation>\n </span>\n <span\n class=\"error-item--text\"\n [attr.data-thook]=\"thook + '-errorlabel'\"\n >{{ error }}</span\n >\n </span>\n </label>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [":host{display:block;position:relative}@media(max-width:47.98em){:host{min-width:100%}}:host .hide-if-empty:empty{display:none}:host .unset-state{padding-left:.5rem}:host .gds-field-label:is(label){margin-bottom:0}:host .gds-field-label.gds-form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label.gds-form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label.gds-form-control:focus,:host .gds-field-label.gds-form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label:not(.gds-form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label+input,:host .gds-field-label+textarea,fieldset :host .gds-field-label+div,:host .gds-field-label+.gds-button,:host .gds-field-label+.gds-group-stepper,:host .gds-field-label+.gds-stepper-wrapper,:host .gds-field-label+.gds-group{margin-top:.5rem}:host .gds-field-label+.gds-form-info{margin-bottom:.5rem}:host .gds-field-label{display:block}:host label+.field-wrap,:host label+.nggv-field--locked{margin-top:.5rem}:host .description{font-size:.875rem;margin-bottom:.5rem;line-height:1.25rem;width:100%}:host .gds-field-label--optional:is(label){margin-bottom:0}:host .gds-field-label--optional.gds-form-control{width:fit-content}@supports (-moz-appearance: none){:host .gds-field-label--optional.gds-form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host .gds-field-label--optional.gds-form-control:focus,:host .gds-field-label--optional.gds-form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host .gds-field-label--optional:not(.gds-form-control){font-weight:500;width:100%;line-height:1.25rem}:host .gds-field-label--optional+input,:host .gds-field-label--optional+textarea,fieldset :host .gds-field-label--optional+div,:host .gds-field-label--optional+.gds-button,:host .gds-field-label--optional+.gds-group-stepper,:host .gds-field-label--optional+.gds-stepper-wrapper,:host .gds-field-label--optional+.gds-group{margin-top:.5rem}:host .gds-field-label--optional+.gds-form-info{margin-bottom:.5rem}:host .nggv-datepicker{margin-top:.25rem;position:absolute}:host .nggv-field--error{border-bottom:.125rem solid #9f000a!important}:host .nggv-field--error:focus,:host .nggv-field--error:active,:host .nggv-field--error:hover{border-bottom:.125rem solid #9f000a!important}:host .error-item{display:flex;gap:.5rem;color:#9f000a}:host .gds-field-notice{margin-top:.5rem;display:block;font-size:.875rem;line-height:1;font-weight:500}:host .field-wrap{border:1px solid #868686;border-radius:4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit}:host .field-wrap *,:host .field-wrap *:before,:host .field-wrap *:after{box-sizing:border-box}:host .field-wrap{height:2.625rem;display:flex}:host .field-wrap .nggv-button-date{--text-disabled-color: #adadad;padding:.75rem 1rem;border-radius:.25rem;border:solid 1px var(--gds-sys-color-base-600);font-weight:500}:host .field-wrap .nggv-button-date:focus:not(:focus-visible){box-shadow:none;outline:0}:host .field-wrap .nggv-button-date:focus,:host .field-wrap .nggv-button-date:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-button-date{min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center}@media(max-width:35.98em){:host .field-wrap .nggv-button-date{min-width:100%}}@media screen and (-ms-high-contrast:active){:host .field-wrap .nggv-button-date{border:2px solid currentcolor}}:host .field-wrap .nggv-button-date.small{min-height:2rem;height:2rem;padding:.4375rem .75rem;font-size:.875rem;line-height:1rem}:host .field-wrap .nggv-button-date.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .field-wrap .nggv-button-date{transition:border var(--gds-sys-transition)}:host .field-wrap .nggv-button-date:not(:disabled,.disabled,[aria-disabled]):hover{background:var(--gds-sys-color-base-800);color:var(--gds-sys-color-text-white);--background: var(--gds-sys-color-base-800);--color: var(--gds-sys-color-text-white);border-color:var(--gds-sys-color-base-800)}:host .field-wrap .nggv-button-date[aria-selected=true],:host .field-wrap .nggv-button-date:active,:host .field-wrap .nggv-button-date.active,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{background:var(--gds-sys-color-base-800);color:var(--gds-sys-color-text-white);--background: $bg;--color: $color;border-color:var(--gds-sys-color-base-800)}:host .field-wrap .nggv-button-date[aria-selected]:hover,:host .field-wrap .nggv-button-date.active:hover,:host .field-wrap .nggv-button-date:active:hover{opacity:.9}:host .field-wrap .nggv-button-date{background-color:transparent;border-color:var(--gds-sys-color-base-800);color:var(--gds-sys-color-base-800);--color: var(--gds-sys-color-base-800)}:host .field-wrap .nggv-button-date:disabled,:host .field-wrap .nggv-button-date.disabled,:host .field-wrap .nggv-button-date[aria-disabled=true]{color:var(--gds-sys-color-text-disabled)!important;border-color:var(--gds-sys-color-text-disabled)!important;cursor:not-allowed}:host .field-wrap .nggv-button-date:disabled::placeholder,:host .field-wrap .nggv-button-date.disabled::placeholder,:host .field-wrap .nggv-button-date[aria-disabled=true]::placeholder{color:var(--gds-sys-color-text-disabled)}@media(max-width:47.98em){:host .field-wrap .nggv-button-date{width:2.625rem;height:2.625rem}}:host .field-wrap .nggv-button-date{background-color:transparent;min-height:2.5rem;border:none;border-radius:3px;width:2.625rem;height:2.625rem;min-width:2.625rem;border-top-left-radius:0!important;border-bottom-left-radius:0!important;text-align:right}:host .field-wrap .nggv-button-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-button-date[disabled]{background-color:#f8f8f8!important;color:#adadad}@media(max-width:35.98em){:host .field-wrap .nggv-button-date{min-width:initial}}:host .field-wrap input[type=text]::-webkit-inner-spin-button,:host .field-wrap input[type=text]::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none;font-size:1rem;font-family:inherit}:host .field-wrap .nggv-field-date{border:1px solid #cecece;border-radius:4px;outline:none;box-sizing:border-box;min-height:2.75rem;line-height:1.5;font-size:1rem;font-family:inherit}:host .field-wrap .nggv-field-date *,:host .field-wrap .nggv-field-date *:before,:host .field-wrap .nggv-field-date *:after{box-sizing:border-box}:host .field-wrap .nggv-field-date:hover{border-color:#41b0ee}:host .field-wrap .nggv-field-date:focus{outline-color:#1a1a1a;outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .field-wrap .nggv-field-date:active{border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]{background-color:#f8f8f8;border-color:#cecece}:host .field-wrap .nggv-field-date[disabled]::placeholder{color:#cecece}:host .field-wrap .nggv-field-date{border:none;min-height:2.375rem;width:100%;border-bottom-right-radius:0;border-top-right-radius:0;padding-left:1rem}:host .field-wrap .nggv-field-date:not(:focus){border-right:none;padding-right:0}:host .field-wrap .nggv-field-date:focus{padding-right:0}:host.small .gds-field-label{font-size:.875rem;line-height:1rem}:host.small label+.field-wrap{margin-top:.25rem}:host.small .field-wrap{height:calc(2rem + 3px);min-height:calc(2rem + 3px)}:host.small .field-wrap .nggv-field-date{padding:.38rem .5rem;line-height:1rem;min-height:2rem;font-size:.875rem}:host.small .field-wrap .nggv-button-date{min-height:2rem;min-width:2rem;width:2rem;height:2rem;padding:0}\n"] }]
|
|
1753
1772
|
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
1754
1773
|
type: Self
|
|
1755
1774
|
}, {
|
|
@@ -1860,5 +1879,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
1860
1879
|
* Generated bundle index. Do not edit.
|
|
1861
1880
|
*/
|
|
1862
1881
|
|
|
1863
|
-
export { CalendarComponent, CalendarControlComponent, CalendarDateDirective, CalendarMonth, DateControlValueAccessorComponent, DateInputComponent, DatepickerComponent, IsDisabledPipe, MatchesPipe, NggvDatepickerModule, afterClosingHours, firstCalendarDate, generateDateMatrix, getDayOffset, getFormatDateMask, getLocaleDateMask, getLocaleDateString, getMonthArray, getSortedWeekDays, getYearArray, isAfter, isBefore, isValid, match, setDateFormatCharacters, sortWeekDays };
|
|
1882
|
+
export { CalendarComponent, CalendarControlComponent, CalendarDateDirective, CalendarMonth, DateControlValueAccessorComponent, DateInputComponent, DatepickerComponent, IsDisabledPipe, MatchesPipe, NggvDatepickerModule, afterClosingHours, firstCalendarDate, generateDateMatrix, getDayOffset, getFormatDateMask, getLocaleDateMask, getLocaleDateString, getMonthArray, getSortedWeekDays, getYearArray, isAfter, isBefore, isValid, match, setDateFormatCharacters, sortWeekDays, toLocalDate };
|
|
1864
1883
|
//# sourceMappingURL=sebgroup-green-angular-src-v-angular-datepicker.mjs.map
|