mis-crystal-design-system 18.2.13 → 18.2.15

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.
@@ -12,7 +12,7 @@ export declare class TzDatepickerDirective implements OnInit {
12
12
  selectedDate: import("@angular/core").InputSignal<string>;
13
13
  datesDisabled: import("@angular/core").InputSignal<string[]>;
14
14
  dateMessages: import("@angular/core").InputSignal<IDatePickerToastText[]>;
15
- positionX: import("@angular/core").InputSignal<"center" | "start" | "end">;
15
+ positionX: import("@angular/core").InputSignal<"start" | "center" | "end">;
16
16
  positionY: import("@angular/core").InputSignal<"center" | "top" | "bottom">;
17
17
  offsetX: import("@angular/core").InputSignal<number>;
18
18
  offsetY: import("@angular/core").InputSignal<number>;
@@ -49,6 +49,7 @@ export declare class TzDpContainerComponent implements OnInit {
49
49
  currentMonth: import("@angular/core").Signal<ICurrentMonth>;
50
50
  currentYearNumber: import("@angular/core").Signal<number>;
51
51
  currentMonthDates: import("@angular/core").Signal<ICurrentMonthDates[]>;
52
+ currentMonthWeeks: import("@angular/core").Signal<ICurrentMonthDates[][]>;
52
53
  isPreviousMonthDisabled: import("@angular/core").Signal<boolean>;
53
54
  isNextMonthDisabled: import("@angular/core").Signal<boolean>;
54
55
  localSelectedDate: import("@angular/core").Signal<ICurrentMonthDates>;
@@ -1,5 +1,6 @@
1
1
  /** @format */
2
2
  import { InjectionToken } from "@angular/core";
3
+ import type { IDayOption } from "./models/drp-config.model";
3
4
  export declare const CONTAINER_DATA: InjectionToken<{}>;
4
5
  export declare const DATE_FORMAT = "DD-MM-YYYY";
5
6
  export declare const ISO_DATE_FORMAT = "YYYY-MM-DD";
@@ -30,3 +31,6 @@ export declare const SELECTION_MODE: {
30
31
  readonly WEEKLY: "weekly";
31
32
  };
32
33
  export type SelectionMode = (typeof SELECTION_MODE)[keyof typeof SELECTION_MODE];
34
+ /** Default caption shown before the day chips. */
35
+ export declare const DEFAULT_DAY_SELECTION_LABEL = "Include Days:";
36
+ export declare const DEFAULT_DAY_OPTIONS: IDayOption[];
@@ -8,11 +8,22 @@ export interface IDatePickerConfig {
8
8
  ranges?: RangeItem[];
9
9
  enableTime?: boolean;
10
10
  selectionMode?: SelectionMode;
11
+ showDaySelection?: boolean;
12
+ /** Chips to render, in display order. Defaults to DEFAULT_DAY_OPTIONS. */
13
+ dayOptions?: IDayOption[];
14
+ /** Disables Apply until at least one day is selected. */
15
+ daySelectionRequired?: boolean;
16
+ /** Caption before the chips. Defaults to "Include Days:". */
17
+ daySelectionLabel?: string;
11
18
  }
12
19
  export interface RangeItem {
13
20
  label: string;
14
21
  value: [Date, Date];
15
22
  }
23
+ export interface IDayOption {
24
+ label: string;
25
+ value: number;
26
+ }
16
27
  export interface IDatePickerData {
17
28
  dates: ISelectedDatesConfig;
18
29
  dpConfig: Partial<IDatePickerConfig>;
@@ -47,4 +58,6 @@ export interface ISelectedDatesConfig {
47
58
  startDate: string | null;
48
59
  endDate: string | null;
49
60
  selectedRangeLabel?: string;
61
+ /** Selected day values, in dayOptions order. Also used to pre-select. */
62
+ selectedDays?: number[];
50
63
  }
@@ -1,5 +1,6 @@
1
1
  export { TzDrpContainerComponent } from "./tz-drp-container/tz-drp-container.component";
2
2
  export { DateRangepickerModuleV2 } from "./daterangepicker.module";
3
3
  export { TzDaterangepickerDirective } from "./tz-daterangepicker.directive";
4
- export { IDatePickerConfig, IDatePickerToastText } from "./models/drp-config.model";
4
+ export { IDatePickerConfig, IDatePickerToastText, IDayOption, ISelectedDatesConfig, RangeItem } from "./models/drp-config.model";
5
5
  export { SELECTION_MODE, type SelectionMode } from "./daterangepicker-constants";
6
+ export { DEFAULT_DAY_OPTIONS, DEFAULT_DAY_SELECTION_LABEL } from "./daterangepicker-constants";
@@ -1,6 +1,6 @@
1
1
  import { OnInit, Renderer2, DestroyRef } from "@angular/core";
2
2
  import { type DateRangePane, type MonthNavDirection } from "../daterangepicker-constants";
3
- import { ICurrentMonth, ICurrentMonthDates, IDatePickerData, IWeekDay, ISelectedDatesConfig, RangeItem } from "../models/drp-config.model";
3
+ import { ICurrentMonth, ICurrentMonthDates, IDatePickerData, IDayOption, IWeekDay, ISelectedDatesConfig, RangeItem } from "../models/drp-config.model";
4
4
  import { ToastService } from "mis-crystal-design-system/toast";
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class TzDrpContainerComponent implements OnInit {
@@ -44,6 +44,7 @@ export declare class TzDrpContainerComponent implements OnInit {
44
44
  private readonly isDatesValidSignal;
45
45
  private readonly selectedItemLabelSignal;
46
46
  private readonly hoveredWeekStartSignal;
47
+ private readonly selectedDaysSignal;
47
48
  readonly startHourSignal: import("@angular/core").WritableSignal<number>;
48
49
  readonly startMinuteSignal: import("@angular/core").WritableSignal<number>;
49
50
  readonly startAmPmSignal: import("@angular/core").WritableSignal<string>;
@@ -67,11 +68,24 @@ export declare class TzDrpContainerComponent implements OnInit {
67
68
  selectedItemLabel: import("@angular/core").Signal<string>;
68
69
  isWeeklyMode: import("@angular/core").Signal<boolean>;
69
70
  enableDateTabbing: import("@angular/core").Signal<boolean>;
71
+ /** Chips to render, normalised from dpConfig.dayOptions. */
72
+ readonly dayOptions: import("@angular/core").Signal<IDayOption[]>;
73
+ /** Renders only when explicitly enabled and chips exist. */
74
+ readonly showDaySelection: import("@angular/core").Signal<boolean>;
75
+ readonly daySelectionLabel: import("@angular/core").Signal<string>;
76
+ readonly isDaySelectionRequired: import("@angular/core").Signal<boolean>;
77
+ readonly selectedDays: import("@angular/core").Signal<number[]>;
78
+ readonly isDaySelectionValid: import("@angular/core").Signal<boolean>;
79
+ /** Apply needs a complete range and, when mandated, at least one day. */
80
+ readonly canApply: import("@angular/core").Signal<boolean>;
81
+ readonly showDaySelectionHint: import("@angular/core").Signal<boolean>;
82
+ readonly daySelectionGroupAriaLabel: import("@angular/core").Signal<string>;
70
83
  readonly anchorIndexLeft: import("@angular/core").Signal<number>;
71
84
  readonly anchorIndexRight: import("@angular/core").Signal<number>;
72
85
  readonly prevMonthAriaLabel: import("@angular/core").Signal<string>;
73
86
  readonly nextMonthAriaLabel: import("@angular/core").Signal<string>;
74
87
  readonly applyButtonAriaLabel: import("@angular/core").Signal<string>;
88
+ private readonly selectedDayLabels;
75
89
  currentMonthDates: import("@angular/core").Signal<ICurrentMonthDates[]>;
76
90
  nextMonthDates: import("@angular/core").Signal<ICurrentMonthDates[]>;
77
91
  startHour: import("@angular/core").Signal<number>;
@@ -115,6 +129,14 @@ export declare class TzDrpContainerComponent implements OnInit {
115
129
  selectDay(from: DateRangePane, day: ICurrentMonthDates): void;
116
130
  selectRange(item: RangeItem): void;
117
131
  resetRange(): void;
132
+ /** Drops unknown values, de-duplicates and re-orders to match dayOptions. */
133
+ private sanitizeSelectedDays;
134
+ isDaySelected(option: IDayOption): boolean;
135
+ toggleDay(option: IDayOption): void;
136
+ trackDayOption(_index: number, option: IDayOption): number;
137
+ dayChipAriaLabel(option: IDayOption): string;
138
+ /** Attaches selectedDays only when the strip is active. */
139
+ private buildApplyPayload;
118
140
  applyDates(): void;
119
141
  cancelDatePicker(): void;
120
142
  onStartHourInput(): void;