shirkasoft-ui-components 1.3.6 → 1.3.8

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.
@@ -2,7 +2,7 @@ import * as _angular_core from '@angular/core';
2
2
  import { ControlValueAccessor, FormGroup, FormControl } from '@angular/forms';
3
3
 
4
4
  /** Which granularity the picker edits: a day, a month or a year. */
5
- type DatePickerView = 'date' | 'month' | 'year';
5
+ type DatePickerView = 'date' | 'week' | 'month' | 'year';
6
6
  /** Which time selection mode the analog clock is in. */
7
7
  type ClockMode = 'hours' | 'minutes';
8
8
  /**
@@ -22,8 +22,10 @@ declare class DatePickerComponent implements ControlValueAccessor {
22
22
  private transloco;
23
23
  /** HTML id for the input (for label/for pairing). */
24
24
  id: _angular_core.InputSignal<string>;
25
- /** Granularity of the picker ('date' | 'month' | 'year'). */
25
+ /** Granularity of the picker ('date' | 'week' | 'month' | 'year'). */
26
26
  view: _angular_core.InputSignal<DatePickerView>;
27
+ /** First day of the week (0=Sunday ... 6=Saturday), used by week view. */
28
+ weekStart: _angular_core.InputSignal<number>;
27
29
  /** Label shown above the input. */
28
30
  label: _angular_core.InputSignal<string>;
29
31
  /** Placeholder of the input. */
@@ -74,6 +76,10 @@ declare class DatePickerComponent implements ControlValueAccessor {
74
76
  viewMeridiem: _angular_core.WritableSignal<"AM" | "PM">;
75
77
  /** Date part selected but not yet committed until the time is confirmed. */
76
78
  private pendingDate;
79
+ /** Selected year during the selection flow (year -> month -> day). */
80
+ selectedYearValue: _angular_core.WritableSignal<number | null>;
81
+ /** Selected month during the selection flow. */
82
+ selectedMonthValue: _angular_core.WritableSignal<number | null>;
77
83
  /** Analog clock mode: 'hours' or 'minutes'. */
78
84
  clockMode: _angular_core.WritableSignal<ClockMode>;
79
85
  /** Internal view state for drill-down navigation (separates from input `view`). */
@@ -124,6 +130,17 @@ declare class DatePickerComponent implements ControlValueAccessor {
124
130
  firstDayOfMonth: _angular_core.Signal<number>;
125
131
  /** Calendar grid: nulls for leading blanks then the days of the month. */
126
132
  calendarDays: _angular_core.Signal<(number | null)[]>;
133
+ /** Weeks of the viewed month (rows aligned to `weekStart`), for week view. */
134
+ monthWeeks: _angular_core.Signal<{
135
+ index: number;
136
+ start: Date;
137
+ end: Date;
138
+ range: string;
139
+ }[]>;
140
+ /** Localized range label for a week (e.g. '2 — 8 feb'). */
141
+ formatWeekRange(start: Date, end: Date): string;
142
+ /** Localized label for a week row ('Semana N' / 'Week N'). */
143
+ weekLabel(index: number): string;
127
144
  /** Whether the prev navigation button is allowed by `minValue`. */
128
145
  canGoPrev: _angular_core.Signal<boolean>;
129
146
  /** Whether the next navigation button is allowed by `maxValue`. */
@@ -144,8 +161,6 @@ declare class DatePickerComponent implements ControlValueAccessor {
144
161
  clockMinutes: _angular_core.Signal<number[]>;
145
162
  /** The input format string based on locale. */
146
163
  inputFormat: _angular_core.Signal<"MM/DD/YYYY" | "DD/MM/YYYY">;
147
- /** Whether the drill-down navigation is active (view differs from input). */
148
- isDrilledDown: _angular_core.Signal<boolean>;
149
164
  /** (Unused legacy placeholder) plain year list. */
150
165
  years: number[];
151
166
  constructor();
@@ -163,13 +178,14 @@ declare class DatePickerComponent implements ControlValueAccessor {
163
178
  prev(): void;
164
179
  /** Navigates the calendar to the next year/month/decade. */
165
180
  next(): void;
166
- /** Selects a day of the month (pending if time is shown). */
167
- selectDay(day: number): void;
168
- /** Selects a month of the year (pending if time is shown). */
169
- selectMonth(monthIndex: number): void;
170
- /** Selects a year (pending if time is shown). */
181
+ /** Selects a year - stores it and navigates to month selection. */
171
182
  selectYear(year: number): void;
172
- /** Commits a value, updates the component, the control and the outputs. */
183
+ /** Selects a month - stores it and navigates to day selection. */
184
+ selectMonth(monthIndex: number): void;
185
+ /** Selects a day - completes the date selection. */
186
+ selectDay(day: number): void;
187
+ /** Selects a week - emits its start date (YYYY-MM-DD). */
188
+ selectWeek(start: Date): void;
173
189
  private setValue;
174
190
  /** Confirms the selected time and commits the combined date+time value. */
175
191
  confirmTime(): void;
@@ -246,17 +262,13 @@ declare class DatePickerComponent implements ControlValueAccessor {
246
262
  x2: number;
247
263
  y2: number;
248
264
  };
249
- /** Switches the drill-down view to months (from date view). */
250
- drillToMonths(): void;
251
- /** Switches the drill-down view to years (from month view). */
252
- drillToYears(): void;
253
265
  /** Drills down from year view to month view for the selected year. */
254
266
  drillDownToMonth(year: number): void;
255
267
  /** Drills down from month view to date view for the selected month. */
256
268
  drillDownToDate(monthIndex: number): void;
257
269
  /** Goes back one level in drill-down navigation. */
258
270
  drillUp(): void;
259
- /** Returns to the initial view from any drill-down level. */
271
+ /** Returns to the initial view (year selection). */
260
272
  drillToInitial(): void;
261
273
  /** Formats input placeholder based on locale. */
262
274
  inputPlaceholder(): string;
@@ -274,6 +286,12 @@ declare class DatePickerComponent implements ControlValueAccessor {
274
286
  private parseTimeOnly;
275
287
  /** Whether the given day is today's date. */
276
288
  isToday(day: number): boolean;
289
+ /** ISO date (YYYY-MM-DD) of the week start containing the given date. */
290
+ private weekStartISO;
291
+ /** Whether the given week row contains the displayed/selected date. */
292
+ isSelectedWeek(start: Date): boolean;
293
+ /** Whether the given week row contains today's date. */
294
+ isCurrentWeek(start: Date): boolean;
277
295
  /** Whether the given month matches the selected month and year. */
278
296
  isSelectedMonth(monthIndex: number): boolean;
279
297
  isCurrentMonth(monthIndex: number): boolean;
@@ -284,7 +302,7 @@ declare class DatePickerComponent implements ControlValueAccessor {
284
302
  registerOnTouched(fn: any): void;
285
303
  setDisabledState(isDisabled: boolean): void;
286
304
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DatePickerComponent, never>;
287
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatePickerComponent, "shk-date-picker", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "formGroup": { "alias": "formGroup"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "errorMessages": { "alias": "errorMessages"; "required": false; "isSignal": true; }; "minValue": { "alias": "minValue"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "timeOnly": { "alias": "timeOnly"; "required": false; "isSignal": true; }; "showTime": { "alias": "showTime"; "required": false; "isSignal": true; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "minuteStep": { "alias": "minuteStep"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
305
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatePickerComponent, "shk-date-picker", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "weekStart": { "alias": "weekStart"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "formGroup": { "alias": "formGroup"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "errorMessages": { "alias": "errorMessages"; "required": false; "isSignal": true; }; "minValue": { "alias": "minValue"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "timeOnly": { "alias": "timeOnly"; "required": false; "isSignal": true; }; "showTime": { "alias": "showTime"; "required": false; "isSignal": true; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "minuteStep": { "alias": "minuteStep"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
288
306
  }
289
307
 
290
308
  export { DatePickerComponent };