@energycap/components 0.40.1-ECAP-26841-date-input-features.20241125-1254 → 0.40.1-ECAP-26841-date-input-features.20241125-1709

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.
@@ -13,5 +13,5 @@ export declare class CalendarItemComponent implements OnChanges {
13
13
  ngOnChanges(): void;
14
14
  private isSelected;
15
15
  static ɵfac: i0.ɵɵFactoryDeclaration<CalendarItemComponent, never>;
16
- static ɵcmp: i0.ɵɵComponentDeclaration<CalendarItemComponent, "button[ec-calendar-item]", never, { "item": "item"; "activeDate": "activeDate"; "selection": "selection"; "view": "view"; }, {}, never, never, false, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<CalendarItemComponent, "button[ec-calendar-item]", never, { "item": "item"; "activeDate": "activeDate"; "selection": "selection"; "view": "view"; }, {}, never, ["*"], false, never>;
17
17
  }
@@ -6,9 +6,11 @@ import * as i0 from "@angular/core";
6
6
  export declare class CalendarComponent implements OnChanges, OnInit {
7
7
  private translateService;
8
8
  id: string;
9
- selectionModes: CalendarSelectionMode[];
10
9
  selection: CalendarSelection | null;
11
10
  selectionChange: EventEmitter<CalendarSelection | null>;
11
+ selectionModeOptions: CalendarSelectionMode[];
12
+ selectionMode: CalendarSelectionMode;
13
+ selectionModeChange: EventEmitter<CalendarSelectionMode>;
12
14
  minDate: Date;
13
15
  maxDate: Date;
14
16
  focusOutStart: EventEmitter<KeyboardEvent>;
@@ -34,8 +36,7 @@ export declare class CalendarComponent implements OnChanges, OnInit {
34
36
  calendarItemTrackByDate: (index: number, item: CalendarItem) => string;
35
37
  disablePreviousButton: boolean;
36
38
  disableNextButton: boolean;
37
- selectionModeOptions: MenuItem<CalendarSelectionMode>[];
38
- currentSelectionMode: CalendarSelectionMode;
39
+ selectionModeItems: MenuItem<CalendarSelectionMode>[];
39
40
  constructor(translateService: TranslateService);
40
41
  ngOnChanges(changes: SimpleChanges): void;
41
42
  ngOnInit(): void;
@@ -47,13 +48,19 @@ export declare class CalendarComponent implements OnChanges, OnInit {
47
48
  /** Switches the calendar to year view. */
48
49
  onYearClick(): void;
49
50
  private updateSelectionModes;
51
+ private onDaySelected;
52
+ private onMonthSelected;
53
+ private onQuarterSelected;
54
+ private onYearSelected;
55
+ private updateSelection;
50
56
  private drawCalendar;
51
57
  private getCalendarItems;
52
58
  private getDayViewItems;
53
59
  private getMonthViewItems;
60
+ private getQuarterViewItems;
54
61
  private getYearViewItems;
55
62
  /** Returns true if the date is within the current calendar view */
56
63
  private isDateInView;
57
64
  static ɵfac: i0.ɵɵFactoryDeclaration<CalendarComponent, never>;
58
- static ɵcmp: i0.ɵɵComponentDeclaration<CalendarComponent, "ec-calendar", never, { "id": "id"; "selectionModes": "selectionModes"; "selection": "selection"; "minDate": "minDate"; "maxDate": "maxDate"; }, { "selectionChange": "selectionChange"; "focusOutStart": "focusOutStart"; "focusOutEnd": "focusOutEnd"; }, never, never, false, never>;
65
+ static ɵcmp: i0.ɵɵComponentDeclaration<CalendarComponent, "ec-calendar", never, { "id": "id"; "selection": "selection"; "selectionModeOptions": "selectionModeOptions"; "selectionMode": "selectionMode"; "minDate": "minDate"; "maxDate": "maxDate"; }, { "selectionChange": "selectionChange"; "selectionModeChange": "selectionModeChange"; "focusOutStart": "focusOutStart"; "focusOutEnd": "focusOutEnd"; }, never, never, false, never>;
59
66
  }
@@ -2,7 +2,12 @@ export type CalendarItem = {
2
2
  label: string;
3
3
  date: Date;
4
4
  };
5
- export type CalendarSelection = Date | [Date, Date];
5
+ export type CalendarRange = {
6
+ start: Date;
7
+ end: Date;
8
+ };
9
+ export type CalendarSelection = Date | CalendarRange;
6
10
  export type CalendarSelectionMode = 'day' | 'last7days' | 'last28days' | 'month' | 'quarter' | 'year' | 'range';
7
- export type CalendarView = 'day' | 'month' | 'year';
11
+ export type CalendarView = 'day' | 'month' | 'quarter' | 'year';
8
12
  export declare function isCalendarSelectionSingleDate(selection?: CalendarSelection | null): selection is Date;
13
+ export declare function isCalendarSelectionRange(selection?: CalendarSelection | null): selection is CalendarRange;
@@ -21,7 +21,7 @@ export declare class DateInputComponent extends FormControlBase implements OnIni
21
21
  formModel: DateInputFormControl;
22
22
  minDate: Date;
23
23
  maxDate: Date;
24
- selectionModes: CalendarSelectionMode[];
24
+ selectionModeOptions: CalendarSelectionMode[];
25
25
  /** The internal textbox's form control. */
26
26
  textboxControl: FormControl<string | null>;
27
27
  /**
@@ -77,5 +77,5 @@ export declare class DateInputComponent extends FormControlBase implements OnIni
77
77
  /** Focuses the date input. */
78
78
  private focusInput;
79
79
  static ɵfac: i0.ɵɵFactoryDeclaration<DateInputComponent, never>;
80
- static ɵcmp: i0.ɵɵComponentDeclaration<DateInputComponent, "ec-date-input", never, { "id": "id"; "formModel": "formModel"; "minDate": "minDate"; "maxDate": "maxDate"; "selectionModes": "selectionModes"; }, {}, never, never, false, never>;
80
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateInputComponent, "ec-date-input", never, { "id": "id"; "formModel": "formModel"; "minDate": "minDate"; "maxDate": "maxDate"; "selectionModeOptions": "selectionModeOptions"; }, {}, never, never, false, never>;
81
81
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energycap/components",
3
- "version": "0.40.1-ECAP-26841-date-input-features.20241125-1254",
3
+ "version": "0.40.1-ECAP-26841-date-input-features.20241125-1709",
4
4
  "dependencies": {
5
5
  "tslib": "^2.0.0"
6
6
  },