@norwegian/core-components 6.50.0 → 6.50.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/esm2022/lib/components/datepicker/index.mjs +1 -2
  2. package/esm2022/lib/components/datepicker-combo-new/datepicker-combo-new.component.mjs +371 -0
  3. package/esm2022/lib/components/datepicker-combo-new/datepicker-combo-new.module.mjs +31 -0
  4. package/esm2022/lib/components/datepicker-combo-new/index.mjs +3 -0
  5. package/esm2022/lib/components/datepicker-new/calendar-new/calendar-date.model.mjs +2 -0
  6. package/esm2022/lib/components/datepicker-new/calendar-new/calendar-new.component.mjs +594 -0
  7. package/esm2022/lib/components/datepicker-new/calendar-new/enums/week-start.enum.mjs +6 -0
  8. package/esm2022/lib/components/datepicker-new/calendar-new/models/day.model.mjs +2 -0
  9. package/esm2022/lib/components/datepicker-new/calendar-new/models/select-option.model.mjs +2 -0
  10. package/esm2022/lib/components/datepicker-new/calendar-new/models/week.model.mjs +2 -0
  11. package/esm2022/lib/components/datepicker-new/datepicker-new.component.mjs +571 -0
  12. package/esm2022/lib/components/datepicker-new/datepicker-new.module.mjs +55 -0
  13. package/esm2022/lib/components/datepicker-new/index.mjs +5 -0
  14. package/esm2022/lib/components/datepicker-new/services/calendar.service.mjs +215 -0
  15. package/esm2022/lib/components/index.mjs +3 -1
  16. package/fesm2022/norwegian-core-components.mjs +1790 -11
  17. package/fesm2022/norwegian-core-components.mjs.map +1 -1
  18. package/lib/components/datepicker/index.d.ts +0 -1
  19. package/lib/components/datepicker-combo-new/datepicker-combo-new.component.d.ts +294 -0
  20. package/lib/components/datepicker-combo-new/datepicker-combo-new.module.d.ts +10 -0
  21. package/lib/components/datepicker-combo-new/index.d.ts +2 -0
  22. package/lib/components/datepicker-new/calendar-new/calendar-date.model.d.ts +5 -0
  23. package/lib/components/datepicker-new/calendar-new/calendar-new.component.d.ts +159 -0
  24. package/lib/components/datepicker-new/calendar-new/enums/week-start.enum.d.ts +4 -0
  25. package/lib/components/datepicker-new/calendar-new/models/day.model.d.ts +10 -0
  26. package/lib/components/datepicker-new/calendar-new/models/select-option.model.d.ts +4 -0
  27. package/lib/components/datepicker-new/calendar-new/models/week.model.d.ts +5 -0
  28. package/lib/components/datepicker-new/datepicker-new.component.d.ts +272 -0
  29. package/lib/components/datepicker-new/datepicker-new.module.d.ts +16 -0
  30. package/lib/components/datepicker-new/index.d.ts +4 -0
  31. package/lib/components/datepicker-new/services/calendar.service.d.ts +27 -0
  32. package/lib/components/index.d.ts +2 -0
  33. package/package.json +1 -1
@@ -0,0 +1,272 @@
1
+ /**
2
+ * @license
3
+ * Copyright Norwegian Air Shuttle. All Rights Reserved.
4
+ */
5
+ import { DatePipe } from '@angular/common';
6
+ import { ElementRef, EventEmitter, OnInit } from '@angular/core';
7
+ import { FormGroup } from '@angular/forms';
8
+ import { CalendarNewComponent } from './calendar-new/calendar-new.component';
9
+ import { SelectOptionModel } from './calendar-new/models/select-option.model';
10
+ import { NasComponentBase } from '../../core/base/nas-component.base';
11
+ import { ClassModel } from '../../core/models/class.model';
12
+ import { UtcDate } from '../../core/models/utc-date.model';
13
+ import { DateHelper } from '../../core/services/date/date-helper.service';
14
+ import { SelectComponent } from '../select/select.component';
15
+ import * as i0 from "@angular/core";
16
+ /**
17
+ * @description
18
+ * Norwegian Date Picker Component | New design | Beta
19
+ */
20
+ export declare class DatepickerNewComponent extends NasComponentBase implements OnInit {
21
+ private datePipe;
22
+ private dateService;
23
+ timeOptions: Array<SelectOptionModel>;
24
+ model: string;
25
+ show: boolean;
26
+ selectedTimeOption: SelectOptionModel;
27
+ showTimes: boolean;
28
+ get showBackdrop(): boolean;
29
+ set showBackdrop(value: boolean);
30
+ input: ElementRef;
31
+ calendar: CalendarNewComponent;
32
+ datePickerContent: ElementRef;
33
+ timeSelector: SelectComponent;
34
+ time: SelectComponent;
35
+ /**
36
+ * @property Input
37
+ * @description
38
+ * Adds 'aria-label' to the backdrops.
39
+ */
40
+ ariaLabelBackdrop: string;
41
+ /**
42
+ * @property Input
43
+ * @description
44
+ * A boolean value when set will disable showing the backdrop on popup open
45
+ */
46
+ disableBackdrop: boolean;
47
+ /**
48
+ * @property Input
49
+ * @description
50
+ * Label for no available flights.
51
+ */
52
+ noAvailableFlightsLabel: string;
53
+ /**
54
+ * @property Input
55
+ * @description
56
+ * Label for available flights.
57
+ */
58
+ availableFlightsLabel: string;
59
+ /**
60
+ * @property Input
61
+ * @description
62
+ * Disable possibility to select dates in the past.
63
+ */
64
+ disablePastSelection: boolean;
65
+ /**
66
+ * @property Input
67
+ * @description
68
+ * The lowest date allowed.
69
+ */
70
+ get lowerLimitDate(): UtcDate;
71
+ set lowerLimitDate(date: UtcDate);
72
+ /**
73
+ * @property Input
74
+ * @description
75
+ * Sets the datepicker in availability mode where available dates can be added.
76
+ */
77
+ availability: boolean;
78
+ /**
79
+ * @property Input
80
+ * @description
81
+ * An array with all the available (selectable) dates of the month.
82
+ */
83
+ availableDates: Array<UtcDate>;
84
+ /**
85
+ * @property Input
86
+ * @description
87
+ * boolean value to disable or enable the input of the date picker.
88
+ */
89
+ get disabled(): boolean;
90
+ set disabled(value: boolean);
91
+ /**
92
+ * @property Input
93
+ * @description
94
+ * A place holder string for the input for date picker.
95
+ */
96
+ placeholder: string;
97
+ /**
98
+ * @property Input
99
+ * @description
100
+ * this will set the required attribute on the input so suer has to date-picker the date.
101
+ */
102
+ required: boolean;
103
+ /**
104
+ * @property Input
105
+ * @description
106
+ * Is used to indicate the IDs of the elements that describe the date picker input.
107
+ */
108
+ ariaDescribedby: string;
109
+ /**
110
+ * @property Input
111
+ * @description
112
+ * Aria label for input that enables date-picker popup once clicked. For accessibility web standards.
113
+ */
114
+ ariaLabel: string;
115
+ /**
116
+ * @property Input
117
+ * @description
118
+ * The display format of the date when user has selected the date and it is being shown in the input box for the date picker.
119
+ * Please look at the angular Date pipe for valid formats and variations.
120
+ */
121
+ dateDisplayFormat: string;
122
+ /**
123
+ * @property Input
124
+ * @description
125
+ * The time display format.
126
+ */
127
+ timeDisplayFormat: string;
128
+ /**
129
+ * @property Input
130
+ * @description
131
+ * A locale code for the locale format rules to use. When not supplied, uses the value of LOCALE_ID, which is en-US by default.
132
+ * This requires that registerLocaleData is called with the respective locale.
133
+ */
134
+ locale: string;
135
+ /**
136
+ * @property Input
137
+ * @description
138
+ * A modifier to remove the padding and margins around the element.
139
+ */
140
+ compact: boolean;
141
+ /**
142
+ * @property Input
143
+ * @description
144
+ * Adds the parent's form group.
145
+ * It requires that the consumer included ReactiveFormsModule in it's module.
146
+ * It is requiered to be filled if nasFormControlName added.
147
+ */
148
+ nasFormGroup: FormGroup;
149
+ /**
150
+ * @property Input
151
+ * @description
152
+ * Sets a formControlName directive to the input.
153
+ * It requires that the consumer included ReactiveFormsModule in it's module.
154
+ * It requiers that the nasFormGroup input is filled.
155
+ */
156
+ nasFormControlName: string;
157
+ /**
158
+ * @property Input
159
+ * @description
160
+ * An array of times to be added in the time selector.
161
+ */
162
+ get times(): Array<UtcDate>;
163
+ set times(times: Array<UtcDate>);
164
+ /**
165
+ * @property Input
166
+ * @description
167
+ * The calendar is open or closed.
168
+ */
169
+ get open(): boolean;
170
+ set open(open: boolean);
171
+ /**
172
+ * @property Input
173
+ * @description
174
+ * Set selected month.
175
+ */
176
+ get selectedMonth(): UtcDate;
177
+ set selectedMonth(month: UtcDate);
178
+ /**
179
+ * @property Input
180
+ * @description
181
+ * Gets or sets the selected Date in the date picker. Setting this date will highlight the date in the date picker
182
+ * and user can change it by clicking from any other enabled dates
183
+ * or by navigating betrween months and selecting from different available month.
184
+ */
185
+ get selectedDate(): UtcDate;
186
+ set selectedDate(date: UtcDate);
187
+ /**
188
+ * @property Input
189
+ * @description
190
+ * Sets the selected time in the time selector.
191
+ */
192
+ get selectedTime(): UtcDate;
193
+ set selectedTime(time: UtcDate);
194
+ /**
195
+ * @property Input
196
+ * @description
197
+ * ARIA label for the previous month button in the calendar.
198
+ */
199
+ ariaLabelPreviousMonth: string;
200
+ /**
201
+ * @property Input
202
+ * @description
203
+ * ARIA label for the next month button in the calendar.
204
+ */
205
+ ariaLabelNextMonth: string;
206
+ /**
207
+ * @property Output
208
+ * @description
209
+ * Date selected by the user by clicking in date-picker date-box.
210
+ */
211
+ selectedDateChange: EventEmitter<UtcDate>;
212
+ /**
213
+ * @property Output
214
+ * @description
215
+ * Month selected by the user by clicking in drop down for month selection or month navigation buttons.
216
+ */
217
+ selectedMonthChange: EventEmitter<UtcDate>;
218
+ /**
219
+ * @property Output
220
+ * @description
221
+ * The calendar is open or closed.
222
+ */
223
+ openChange: EventEmitter<boolean>;
224
+ /**
225
+ * @property Output
226
+ * @description
227
+ * When a user has actively changed the date.
228
+ */
229
+ focusOnNextChange: EventEmitter<KeyboardEvent | MouseEvent>;
230
+ /**
231
+ * @property Output
232
+ * @description
233
+ * When a user has pressed shift + tab to go to previous control.
234
+ */
235
+ focusOnPreviousChange: EventEmitter<KeyboardEvent | MouseEvent>;
236
+ get activeDate(): UtcDate;
237
+ set activeDate(date: UtcDate);
238
+ private openCalendarTimeout;
239
+ private activeDateTimeout;
240
+ private selectedDateValue;
241
+ private openValue;
242
+ private activeDateValue;
243
+ private timesValue;
244
+ private selectedTimeValue;
245
+ private selectedMonthValue;
246
+ private disabledValue;
247
+ private forceNotOpenCalendar;
248
+ private lowerLimitDateValue;
249
+ constructor(datePipe: DatePipe, dateService: DateHelper);
250
+ ngOnInit(): void;
251
+ onInputKeydownShiftTab(event: KeyboardEvent): void;
252
+ onCalendarKeyDown(event: KeyboardEvent): void;
253
+ onTimeSelectorKeydown(event: KeyboardEvent): void;
254
+ setFocusOnTimeSelectorOrNext(event: KeyboardEvent | MouseEvent): void;
255
+ onMonthChange(currentMonth: UtcDate): void;
256
+ onMouseDownDatepicker(): void;
257
+ openCalendar(): void;
258
+ onTimeSelected(option: SelectOptionModel): void;
259
+ onTimeSelectorClick(): void;
260
+ getMainClass(): Array<ClassModel>;
261
+ getLabelClass(): ClassModel;
262
+ closeCalendar(): void;
263
+ selectDate(event: KeyboardEvent): void;
264
+ private isActiveElementMonthButtons;
265
+ private setFocusOnActiveDateAsync;
266
+ private isModelValid;
267
+ private allDays;
268
+ private someValidDaysEqualsSelectedDay;
269
+ private date;
270
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatepickerNewComponent, never>;
271
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatepickerNewComponent, "nas-datepicker-new", never, { "ariaLabelBackdrop": { "alias": "ariaLabelBackdrop"; "required": false; }; "disableBackdrop": { "alias": "disableBackdrop"; "required": false; }; "noAvailableFlightsLabel": { "alias": "noAvailableFlightsLabel"; "required": false; }; "availableFlightsLabel": { "alias": "availableFlightsLabel"; "required": false; }; "disablePastSelection": { "alias": "disablePastSelection"; "required": false; }; "lowerLimitDate": { "alias": "lowerLimitDate"; "required": false; }; "availability": { "alias": "availability"; "required": false; }; "availableDates": { "alias": "availableDates"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "required": { "alias": "required"; "required": false; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "dateDisplayFormat": { "alias": "dateDisplayFormat"; "required": false; }; "timeDisplayFormat": { "alias": "timeDisplayFormat"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "compact": { "alias": "compact"; "required": false; }; "nasFormGroup": { "alias": "nasFormGroup"; "required": false; }; "nasFormControlName": { "alias": "nasFormControlName"; "required": false; }; "times": { "alias": "times"; "required": false; }; "open": { "alias": "open"; "required": false; }; "selectedMonth": { "alias": "selectedMonth"; "required": false; }; "selectedDate": { "alias": "selectedDate"; "required": false; }; "selectedTime": { "alias": "selectedTime"; "required": false; }; "ariaLabelPreviousMonth": { "alias": "ariaLabelPreviousMonth"; "required": false; }; "ariaLabelNextMonth": { "alias": "ariaLabelNextMonth"; "required": false; }; }, { "selectedDateChange": "selectedDateChange"; "selectedMonthChange": "selectedMonthChange"; "openChange": "openChange"; "focusOnNextChange": "focusOnNextChange"; "focusOnPreviousChange": "focusOnPreviousChange"; }, never, ["*"], false, never>;
272
+ }
@@ -0,0 +1,16 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./datepicker-new.component";
3
+ import * as i2 from "./calendar-new/calendar-new.component";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "../cover/cover.module";
6
+ import * as i5 from "../select/select.module";
7
+ import * as i6 from "../icon/icon.module";
8
+ import * as i7 from "../../core/directives/nas-class/nas-class.module";
9
+ import * as i8 from "@angular/forms";
10
+ import * as i9 from "../spinner/spinner.module";
11
+ import * as i10 from "../backdrop/backdrop.module";
12
+ export declare class DatepickerNewModule {
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatepickerNewModule, never>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DatepickerNewModule, [typeof i1.DatepickerNewComponent, typeof i2.CalendarNewComponent], [typeof i3.CommonModule, typeof i4.CoverModule, typeof i5.SelectModule, typeof i6.IconModule, typeof i7.NasClassModule, typeof i8.FormsModule, typeof i9.SpinnerModule, typeof i8.ReactiveFormsModule, typeof i10.BackdropModule], [typeof i1.DatepickerNewComponent, typeof i2.CalendarNewComponent]>;
15
+ static ɵinj: i0.ɵɵInjectorDeclaration<DatepickerNewModule>;
16
+ }
@@ -0,0 +1,4 @@
1
+ export * from './datepicker-new.component';
2
+ export * from './calendar-new/calendar-new.component';
3
+ export * from './datepicker-new.module';
4
+ export * from './calendar-new/calendar-date.model';
@@ -0,0 +1,27 @@
1
+ import { DatePipe } from '@angular/common';
2
+ import { UtcDate } from '../../../core/models/utc-date.model';
3
+ import { DateHelper } from '../../../core/services/date/date-helper.service';
4
+ import { SelectOptionModel } from '../../select/models/select-option.model';
5
+ import { WeekStart } from '../calendar-new/enums/week-start.enum';
6
+ import { DayModel } from '../calendar-new/models/day.model';
7
+ import { WeekModel } from '../calendar-new/models/week.model';
8
+ import * as i0 from "@angular/core";
9
+ export declare class CalendarService {
10
+ private datePipe;
11
+ private dateService;
12
+ constructor(datePipe: DatePipe, dateService: DateHelper);
13
+ getMonthNames(locale?: string): Array<string>;
14
+ getWeekdays(weekStart: WeekStart, locale?: string): Array<string>;
15
+ updateAvailableDaysWithSelectedDate(availableDays: Array<DayModel>, selectedDate: UtcDate): void;
16
+ setActiveDate(date: UtcDate, weeks: Array<WeekModel>): void;
17
+ getDays(weeks: Array<WeekModel>): Array<DayModel>;
18
+ getWeeks(availableDays: Array<DayModel>, weekStart: WeekStart): Array<WeekModel>;
19
+ getCurrentMonth(date?: UtcDate): UtcDate;
20
+ getMonthsSelectOptions(disablePastSelection: boolean, maxMonthIndex: number, monthNames: Array<string>): Array<SelectOptionModel>;
21
+ getSelectedMonth(months: Array<SelectOptionModel>, currentMonth: UtcDate): SelectOptionModel;
22
+ getAvailableDays(currentMonth: UtcDate, availableDates: Array<UtcDate>, availability: boolean, disablePastSelection: boolean, lowerLimitDate: UtcDate, activeDate: UtcDate, selectedDate: UtcDate): Array<DayModel>;
23
+ private isAvailable;
24
+ private getMonday;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<CalendarService, never>;
26
+ static ɵprov: i0.ɵɵInjectableDeclaration<CalendarService>;
27
+ }
@@ -35,7 +35,9 @@ export * from './journey-availability/index';
35
35
  export * from './chip/index';
36
36
  export * from './tab-group/index';
37
37
  export * from './datepicker/index';
38
+ export * from './datepicker-new/index';
38
39
  export * from './datepicker-combo/index';
40
+ export * from './datepicker-combo-new/index';
39
41
  export * from './phone-number/index';
40
42
  export * from './autocomplete/index';
41
43
  export * from './trip-summary/index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norwegian/core-components",
3
- "version": "6.50.0",
3
+ "version": "6.50.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=16.0.0 < 19.0.0",
6
6
  "@angular/core": ">=16.0.0 < 19.0.0"