shirkasoft-ui-components 1.3.14 → 1.4.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.
Files changed (90) hide show
  1. package/README.md +447 -67
  2. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs +7 -7
  3. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -1
  4. package/fesm2022/shirkasoft-ui-components-button.mjs +11 -11
  5. package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -1
  6. package/fesm2022/shirkasoft-ui-components-chart.mjs +6 -6
  7. package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -1
  8. package/fesm2022/shirkasoft-ui-components-config.mjs +914 -0
  9. package/fesm2022/shirkasoft-ui-components-config.mjs.map +1 -0
  10. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +8 -8
  11. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -1
  12. package/fesm2022/shirkasoft-ui-components-date-picker.mjs +901 -753
  13. package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
  14. package/fesm2022/shirkasoft-ui-components-fieldset.mjs +5 -5
  15. package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -1
  16. package/fesm2022/shirkasoft-ui-components-file-upload.mjs +16 -9
  17. package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -1
  18. package/fesm2022/shirkasoft-ui-components-icons.mjs +646 -0
  19. package/fesm2022/shirkasoft-ui-components-icons.mjs.map +1 -0
  20. package/fesm2022/shirkasoft-ui-components-knob.mjs +44 -17
  21. package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -1
  22. package/fesm2022/shirkasoft-ui-components-loading.mjs +16 -16
  23. package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -1
  24. package/fesm2022/shirkasoft-ui-components-modal.mjs +42 -31
  25. package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
  26. package/fesm2022/shirkasoft-ui-components-notification.mjs +8 -8
  27. package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -1
  28. package/fesm2022/shirkasoft-ui-components-price-input.mjs +79 -29
  29. package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
  30. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +7 -7
  31. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -1
  32. package/fesm2022/shirkasoft-ui-components-select.mjs +50 -23
  33. package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
  34. package/fesm2022/shirkasoft-ui-components-sidebar.mjs +6 -6
  35. package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -1
  36. package/fesm2022/shirkasoft-ui-components-skeleton.mjs +4 -4
  37. package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -1
  38. package/fesm2022/shirkasoft-ui-components-table.mjs +165 -111
  39. package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
  40. package/fesm2022/shirkasoft-ui-components-tabs.mjs +21 -23
  41. package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -1
  42. package/fesm2022/shirkasoft-ui-components-tag.mjs +9 -9
  43. package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -1
  44. package/fesm2022/shirkasoft-ui-components-text-field.mjs +63 -30
  45. package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -1
  46. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs +280 -0
  47. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs.map +1 -0
  48. package/fesm2022/shirkasoft-ui-components-theme.mjs +180 -0
  49. package/fesm2022/shirkasoft-ui-components-theme.mjs.map +1 -0
  50. package/fesm2022/shirkasoft-ui-components-timeline.mjs +10 -22
  51. package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -1
  52. package/fesm2022/shirkasoft-ui-components-toggle.mjs +60 -53
  53. package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -1
  54. package/fesm2022/shirkasoft-ui-components-tooltip.mjs +29 -11
  55. package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -1
  56. package/fesm2022/shirkasoft-ui-components-utils.mjs +22 -11
  57. package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -1
  58. package/fesm2022/shirkasoft-ui-components-wizard.mjs +9 -10
  59. package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -1
  60. package/package.json +33 -3
  61. package/src/baseline.css +2472 -0
  62. package/src/theme.css +15 -543
  63. package/src/themes/ocean.css +56 -0
  64. package/src/themes/sunset.css +55 -0
  65. package/src/themes/violet.css +25 -0
  66. package/src/tokens.css +612 -0
  67. package/types/shirkasoft-ui-components-button.d.ts +1 -1
  68. package/types/shirkasoft-ui-components-config.d.ts +368 -0
  69. package/types/shirkasoft-ui-components-confirm-dialog.d.ts +2 -1
  70. package/types/shirkasoft-ui-components-date-picker.d.ts +276 -224
  71. package/types/shirkasoft-ui-components-fieldset.d.ts +2 -1
  72. package/types/shirkasoft-ui-components-file-upload.d.ts +11 -5
  73. package/types/shirkasoft-ui-components-icons.d.ts +1422 -0
  74. package/types/shirkasoft-ui-components-knob.d.ts +28 -7
  75. package/types/shirkasoft-ui-components-modal.d.ts +11 -7
  76. package/types/shirkasoft-ui-components-notification.d.ts +2 -1
  77. package/types/shirkasoft-ui-components-price-input.d.ts +37 -9
  78. package/types/shirkasoft-ui-components-rail-sidebar.d.ts +3 -3
  79. package/types/shirkasoft-ui-components-select.d.ts +24 -8
  80. package/types/shirkasoft-ui-components-sidebar.d.ts +2 -1
  81. package/types/shirkasoft-ui-components-table.d.ts +91 -77
  82. package/types/shirkasoft-ui-components-tag.d.ts +1 -1
  83. package/types/shirkasoft-ui-components-text-field.d.ts +29 -13
  84. package/types/shirkasoft-ui-components-theme-picker.d.ts +83 -0
  85. package/types/shirkasoft-ui-components-theme.d.ts +88 -0
  86. package/types/shirkasoft-ui-components-timeline.d.ts +5 -4
  87. package/types/shirkasoft-ui-components-toggle.d.ts +20 -13
  88. package/types/shirkasoft-ui-components-tooltip.d.ts +6 -0
  89. package/types/shirkasoft-ui-components-utils.d.ts +16 -6
  90. package/types/shirkasoft-ui-components-wizard.d.ts +4 -3
@@ -1,21 +1,43 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { ControlValueAccessor, FormGroup, FormControl } from '@angular/forms';
3
+ import { FormValueControl } from '@angular/forms/signals';
4
+ import { ShkDateDisplayStyle } from 'shirkasoft-ui-components/config';
3
5
 
4
- /** Which granularity the picker edits: a day, a month or a year. */
6
+ /** Which granularity the picker edits: a day, a week, a month or a year. */
5
7
  type DatePickerView = 'date' | 'week' | 'month' | 'year';
6
- /** Which time selection mode the analog clock is in. */
8
+ /** @deprecated The analog clock was replaced by time columns; kept for compatibility. */
7
9
  type ClockMode = 'hours' | 'minutes';
10
+ /** One cell of the 6x7 day grid. */
11
+ interface CalendarCell {
12
+ /** ISO date (YYYY-MM-DD). */
13
+ iso: string;
14
+ /** Day of the month. */
15
+ day: number;
16
+ /** Whether the day belongs to the month being shown. */
17
+ inMonth: boolean;
18
+ }
19
+ /** A month rendered in the panel (one in single mode, two in range mode). */
20
+ interface CalendarMonth {
21
+ year: number;
22
+ month: number;
23
+ cells: CalendarCell[];
24
+ }
8
25
  /**
9
26
  * Shirkasoft UI Components.
10
27
  * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
11
28
  * Belongs to Shirkasoft.
12
29
  */
13
30
  /**
14
- * Date/time picker implemented as a ControlValueAccessor. Supports choosing a
15
- * day, month or year, optional time selection (with seconds/12-hour format),
16
- * min/max constraints and locale-aware labels.
31
+ * Date/time picker implemented as a ControlValueAccessor.
32
+ *
33
+ * - `view="date"` (default): opens straight on the day grid; ‹ › move month by
34
+ * month, clicking the title jumps to months/years, days of the neighbouring
35
+ * months are clickable, "Today" button and Cancel / Apply footer.
36
+ * - `[range]="true"`: two months side by side to pick a start and end date.
37
+ * - `view="week" | "month" | "year"`, `showTime`, `timeOnly`, `valueFormat`,
38
+ * min/max constraints and locale-aware labels.
17
39
  */
18
- declare class DatePickerComponent implements ControlValueAccessor {
40
+ declare class DatePickerComponent implements ControlValueAccessor, FormValueControl<string | null> {
19
41
  private elementRef;
20
42
  private cdr;
21
43
  private destroyRef;
@@ -25,8 +47,15 @@ declare class DatePickerComponent implements ControlValueAccessor {
25
47
  id: _angular_core.InputSignal<string>;
26
48
  /** Granularity of the picker ('date' | 'week' | 'month' | 'year'). */
27
49
  view: _angular_core.InputSignal<DatePickerView>;
28
- /** First day of the week (0=Sunday ... 6=Saturday), used by week view. */
29
- weekStart: _angular_core.InputSignal<number>;
50
+ /**
51
+ * First day of the week (0=Sunday ... 6=Saturday). When not set it uses the
52
+ * `dates.weekStart` option, else the locale: Sunday for 'en', Monday otherwise.
53
+ */
54
+ weekStart: _angular_core.InputSignal<number | null>;
55
+ /** Selects a date range (start + end) showing two months side by side. */
56
+ range: _angular_core.InputSignal<boolean>;
57
+ /** ISO dates (YYYY-MM-DD) marked with a dot under the day number. */
58
+ markedDates: _angular_core.InputSignal<string[]>;
30
59
  /** Label shown above the input. */
31
60
  label: _angular_core.InputSignal<string>;
32
61
  /** Placeholder of the input. */
@@ -49,14 +78,21 @@ declare class DatePickerComponent implements ControlValueAccessor {
49
78
  minValue: _angular_core.InputSignal<string>;
50
79
  /** Maximum allowed date (YYYY-MM-DD) or year/month string. */
51
80
  maxValue: _angular_core.InputSignal<string>;
52
- /** Locale used for month/day names and formatted labels. */
81
+ /** Locale for month/day names and labels. Empty = the `dates.locale` option ('es'). */
53
82
  locale: _angular_core.InputSignal<string>;
83
+ /**
84
+ * Date pattern for typing and for `displayStyle: 'format'` (e.g. 'dd/MM/yyyy',
85
+ * 'yyyy-MM-dd'). Empty = the `dates.format` option (automatic by locale).
86
+ */
87
+ dateFormat: _angular_core.InputSignal<string>;
88
+ /** How the selected date is shown. Unset = the `dates.displayStyle` option ('long'). */
89
+ displayStyle: _angular_core.InputSignal<ShkDateDisplayStyle | undefined>;
54
90
  /** Edits only the time portion of the value. */
55
91
  timeOnly: _angular_core.InputSignal<boolean>;
56
92
  /** Shows the time selectors alongside the date. */
57
93
  showTime: _angular_core.InputSignal<boolean>;
58
- /** Hour format: '12' or '24'. */
59
- hourFormat: _angular_core.InputSignal<"12" | "24">;
94
+ /** Hour format: '12' or '24'. Unset = the `dates.hourFormat` option ('24'). */
95
+ hourFormat: _angular_core.InputSignal<"12" | "24" | undefined>;
60
96
  /** Whether the seconds selector is shown. */
61
97
  showSeconds: _angular_core.InputSignal<boolean>;
62
98
  /** Step (in minutes) for the minute selector. */
@@ -65,9 +101,21 @@ declare class DatePickerComponent implements ControlValueAccessor {
65
101
  * Format of the value received from and emitted to the form control.
66
102
  * Tokens: YYYY, MM, DD, HH, mm, ss (e.g. 'DD-MM-YYYY', 'DD/MM/YYYY HH:mm').
67
103
  * Empty (default) keeps the ISO format ('YYYY-MM-DD', 'YYYY-MM', 'YYYY',
68
- * 'YYYY-MM-DDTHH:mm', 'HH:mm').
104
+ * 'YYYY-MM-DDTHH:mm', 'HH:mm'). In range mode it applies to each end.
69
105
  */
70
106
  valueFormat: _angular_core.InputSignal<string>;
107
+ /** Library-wide options (dates.*), used when the matching input is not set. */
108
+ private readonly config;
109
+ /** Locale actually used: `locale` input, else the `dates.locale` option. */
110
+ readonly effectiveLocale: _angular_core.Signal<string>;
111
+ /** Hour format actually used: `hourFormat` input, else the `dates.hourFormat` option. */
112
+ readonly effectiveHourFormat: _angular_core.Signal<"12" | "24">;
113
+ /** Date pattern actually used (input, option, or automatic by locale). */
114
+ private readonly effectiveDateFormat;
115
+ /** Field order and separator for typing dates, derived from the pattern. */
116
+ private readonly typedLayout;
117
+ /** Display style actually used. */
118
+ private readonly effectiveDisplayStyle;
71
119
  /** Overlay (backdrop + calendar), rendered in <body> while open (shkPortal). */
72
120
  private overlay;
73
121
  /** Field the calendar is anchored to. */
@@ -81,291 +129,295 @@ declare class DatePickerComponent implements ControlValueAccessor {
81
129
  } | null>;
82
130
  /** Whether the dropdown calendar is open. */
83
131
  isOpen: _angular_core.WritableSignal<boolean>;
84
- /** Year currently displayed in the calendar. */
132
+ /** Panel being shown right now (the user can jump from days to months/years). */
133
+ currentView: _angular_core.WritableSignal<DatePickerView>;
134
+ /** Year currently displayed (first month in range mode). */
85
135
  viewYear: _angular_core.WritableSignal<number>;
86
- /** Month currently displayed in the calendar (0-based). */
136
+ /** Month currently displayed, 0-based (first month in range mode). */
87
137
  viewMonth: _angular_core.WritableSignal<number>;
88
- /** Starting year of the decade shown in year view. */
138
+ /** First year of the 12-year page shown in year view. */
89
139
  viewDecade: _angular_core.WritableSignal<number>;
90
- /** Hour selected in the time selectors. */
140
+ /** Hour selected on the clock. */
91
141
  viewHour: _angular_core.WritableSignal<number>;
92
- /** Minute selected in the time selectors. */
142
+ /** Minute selected on the clock. */
93
143
  viewMinute: _angular_core.WritableSignal<number>;
94
- /** Second selected in the time selectors. */
144
+ /** Second selected in the seconds selector. */
95
145
  viewSecond: _angular_core.WritableSignal<number>;
96
- /** Meridiem selected in 12-hour format. */
97
- viewMeridiem: _angular_core.WritableSignal<"AM" | "PM">;
98
- /** Date part selected but not yet committed until the time is confirmed. */
99
- private pendingDate;
100
- /** Selected year during the selection flow (year -> month -> day). */
101
- selectedYearValue: _angular_core.WritableSignal<number | null>;
102
- /** Selected month during the selection flow. */
103
- selectedMonthValue: _angular_core.WritableSignal<number | null>;
104
- /** Analog clock mode: 'hours' or 'minutes'. */
105
- clockMode: _angular_core.WritableSignal<ClockMode>;
106
- /** Internal view state for drill-down navigation (separates from input `view`). */
107
- currentView: _angular_core.WritableSignal<DatePickerView>;
108
- /** Whether the user is typing in the input field. */
146
+ /** AM/PM of the hour being edited, derived from `viewHour`. */
147
+ viewMeridiem: _angular_core.Signal<"AM" | "PM">;
148
+ /** Date picked in the panel but not applied yet (single mode). */
149
+ pendingDate: _angular_core.WritableSignal<string | null>;
150
+ /** Range start picked in the panel but not applied yet. */
151
+ rangeStart: _angular_core.WritableSignal<string | null>;
152
+ /** Range end picked in the panel but not applied yet. */
153
+ rangeEnd: _angular_core.WritableSignal<string | null>;
154
+ /** Day under the mouse while choosing the range end (live preview). */
155
+ hoverDate: _angular_core.WritableSignal<string | null>;
156
+ /** Text edited in the small input(s) inside the panel. */
157
+ panelText: _angular_core.WritableSignal<string>;
158
+ rangeStartText: _angular_core.WritableSignal<string>;
159
+ rangeEndText: _angular_core.WritableSignal<string>;
160
+ /** Which panel input holds an unparseable date. */
161
+ panelTextError: _angular_core.WritableSignal<"single" | "start" | "end" | null>;
162
+ /** Whether the user is typing in the main input field. */
109
163
  isTyping: _angular_core.WritableSignal<boolean>;
110
164
  /** The raw text being typed by the user. */
111
165
  typedValue: _angular_core.WritableSignal<string>;
112
166
  /** Whether the typed value is valid. */
113
167
  typingValid: _angular_core.WritableSignal<boolean | null>;
114
- /** Underlying value (mirrors the reactive control). */
115
- private _value;
168
+ /** Value: ISO string, or "start|end" ISO pair in range mode. */
169
+ value: _angular_core.ModelSignal<string | null>;
170
+ /** Internal alias kept for the existing implementation. */
171
+ private get _value();
116
172
  /** Disabled state coming from the reactive form infrastructure. */
117
173
  private _disabledState;
118
- /** Whether status subscriptions have been attached to the control. */
119
174
  private subscribed;
120
175
  private valueSubscribed;
121
176
  /** Counter used to recompute the error helpers reactively. */
122
177
  private errorTracker;
123
178
  /** Whether an error was displayed at some point. */
124
179
  hadError: _angular_core.WritableSignal<boolean>;
125
- /** ControlValueAccessor callbacks. */
126
180
  private onChange;
127
181
  private onTouched;
128
- /** Current value of the picker. */
129
- value: _angular_core.Signal<string | null>;
130
182
  /** Whether the picker is disabled (input or reactive form). */
131
183
  isDisabled: _angular_core.Signal<boolean>;
132
- /** Resolves the control from `control` input or `formGroup`+`label`. */
184
+ /** Resolves the control from `control` input or `formGroup`+`controlName`. */
133
185
  actualControl: _angular_core.Signal<FormControl<any> | undefined>;
134
- /** Whether the bound control should show its error message. */
135
186
  shouldShowError: _angular_core.Signal<boolean | undefined>;
136
- /** Whether an error was fixed (invalid before, now valid and touched). */
137
187
  wasFixedError: _angular_core.Signal<boolean | undefined>;
138
- /** Validation error messages to display, custom or translated. */
139
188
  getErrorMessages: _angular_core.Signal<string[]>;
140
- /** Date part displayed in the calendar (pending date or committed value). */
189
+ /** Short UI texts in the picker's locale. */
190
+ texts: _angular_core.Signal<{
191
+ today: string;
192
+ now: string;
193
+ cancel: string;
194
+ apply: string;
195
+ hour: string;
196
+ minute: string;
197
+ second: string;
198
+ week: string;
199
+ open: string;
200
+ prevMonth: string;
201
+ nextMonth: string;
202
+ prevYear: string;
203
+ nextYear: string;
204
+ prevYears: string;
205
+ nextYears: string;
206
+ }>;
207
+ /** Today (ISO) and the current hour, refreshed every time the panel opens. */
208
+ todayISO: _angular_core.WritableSignal<string>;
209
+ currentHour: _angular_core.WritableSignal<number>;
210
+ /** Minute step actually used (1-30), shared by the column and "Now". */
211
+ private effectiveStep;
212
+ /** Whether the time columns are shown (not in range mode: a range has no time). */
213
+ showTimeColumns: _angular_core.Signal<boolean>;
214
+ /** Pending month change after clicking a neighbouring-month day (lets dblclick through). */
215
+ private outsideNavTimer;
216
+ /** Timestamp of the last wheel navigation (throttles trackpads). */
217
+ private lastWheelNav;
218
+ /** First day of the week actually used by the grids. */
219
+ firstDayOfWeek: _angular_core.Signal<number>;
220
+ /** Date the calendar highlights (pending selection or committed value). */
141
221
  displayedDate: _angular_core.Signal<string | null>;
142
- /** Human-readable label for the selected value in the input. */
222
+ /** Human-readable label for the selected value in the main input. */
143
223
  displayLabel: _angular_core.Signal<string>;
144
- /** Localized short month names for the year view. */
224
+ /** Localized short month names (Ene, Feb...). */
145
225
  monthNames: _angular_core.Signal<string[]>;
146
- /** Localized short weekday names for the calendar header. */
226
+ /** Localized long month names (Enero, Febrero...) for the headers. */
227
+ monthLongNames: _angular_core.Signal<string[]>;
228
+ /** Localized short weekday names, starting at `firstDayOfWeek`. */
147
229
  dayNames: _angular_core.Signal<string[]>;
148
- /** Number of days in the currently viewed month. */
149
- daysInMonth: _angular_core.Signal<number>;
150
- /** Weekday index (0=Sunday) of the first day of the viewed month. */
151
- firstDayOfMonth: _angular_core.Signal<number>;
152
- /** Calendar grid: nulls for leading blanks then the days of the month. */
153
- calendarDays: _angular_core.Signal<(number | null)[]>;
154
- /** Weeks of the viewed month (rows aligned to `weekStart`), for week view. */
230
+ /** Months rendered in the day view: one, or two consecutive in range mode. */
231
+ visibleMonths: _angular_core.Signal<CalendarMonth[]>;
232
+ /** Set of marked ISO dates for O(1) lookups in the grid. */
233
+ private markedSet;
234
+ /** Weeks of the viewed month (rows aligned to the first weekday), for week view. */
155
235
  monthWeeks: _angular_core.Signal<{
156
236
  index: number;
157
237
  start: Date;
158
238
  end: Date;
159
239
  range: string;
160
240
  }[]>;
161
- /** Localized range label for a week (e.g. '2 — 8 feb'). */
162
- formatWeekRange(start: Date, end: Date): string;
163
- /** Localized label for a week row ('Semana N' / 'Week N'). */
164
- weekLabel(index: number): string;
165
- /** Whether the prev navigation button is allowed by `minValue`. */
241
+ /** 12 years of the page shown in year view. */
242
+ decadeYears: _angular_core.Signal<number[]>;
243
+ /** Title of the header for the current view. */
244
+ headerTitle: _angular_core.Signal<string>;
245
+ /** Whether ‹ is allowed by `minValue`. */
166
246
  canGoPrev: _angular_core.Signal<boolean>;
167
- /** Whether the next navigation button is allowed by `maxValue`. */
247
+ /** Whether › is allowed by `maxValue`. */
168
248
  canGoNext: _angular_core.Signal<boolean>;
169
- /** Year of the displayed date, if any. */
170
- selectedYear: _angular_core.Signal<number | null>;
171
- /** Month index (0-based) of the displayed date, if any. */
172
- selectedMonth: _angular_core.Signal<number | null>;
173
- /** Day of the displayed date, if any (date view only). */
174
- selectedDay: _angular_core.Signal<number | null>;
175
- /** 12 years of the viewed decade for the year view. */
176
- decadeYears: _angular_core.Signal<number[]>;
177
- /** Angle (in degrees) of the analog clock hand based on current mode. */
178
- clockHandAngle: _angular_core.Signal<number>;
179
- /** Hours to display on the analog clock face (1-12). */
180
- clockHours: _angular_core.Signal<number[]>;
181
- /** Minutes to display on the analog clock face (0-55, step 5). */
182
- clockMinutes: _angular_core.Signal<number[]>;
183
- /** The input format string based on locale. */
184
- inputFormat: _angular_core.Signal<"MM/DD/YYYY" | "DD/MM/YYYY">;
185
- /** (Unused legacy placeholder) plain year list. */
186
- years: number[];
249
+ /** Whether the Cancel / Apply footer is shown. */
250
+ showFooter: _angular_core.Signal<boolean>;
251
+ /** Whether "Apply" has something to apply. */
252
+ canApply: _angular_core.Signal<boolean>;
253
+ /** Input format for typing (placeholder), from the date pattern: 'DD/MM/YYYY', 'YYYY-MM-DD'… */
254
+ inputFormat: _angular_core.Signal<string>;
187
255
  constructor();
188
- /** Closes the dropdown when clicking outside the component. */
189
256
  onDocumentClick(event: MouseEvent): void;
190
- /** Keeps the calendar next to its field when the page scrolls or resizes. */
191
257
  onViewportChange(): void;
192
- /**
193
- * Positions the panel right after Angular renders it. A bare
194
- * requestAnimationFrame can run before the render (e.g. with eventCoalescing),
195
- * find no panel and leave the calendar hidden forever.
196
- */
258
+ onEscape(): void;
197
259
  private schedulePosition;
198
- /**
199
- * Places the calendar right below the field; above it when there is no room
200
- * below, and always inside the viewport (8px margin).
201
- */
260
+ /** Places the calendar below the field (above if no room), inside the viewport. */
202
261
  private positionPanel;
203
- /** Closes the dropdown on Escape. */
204
- onEscape(): void;
205
262
  /** Opens/closes the dropdown, syncing the calendar to the current value. */
206
263
  toggle(): void;
207
- /** Aligns the calendar view signals with the current value (or today). */
208
- private syncViewToValue;
209
- /** Closes the dropdown, marks the control as touched and refreshes errors. */
264
+ /** Emitted on close/blur so Signal Forms can mark the field as touched. */
265
+ touch: _angular_core.OutputEmitterRef<void>;
266
+ /** Closes the dropdown (discarding unapplied changes) and marks as touched. */
210
267
  close(): void;
211
- /** Navigates the calendar to the previous year/month/decade. */
268
+ /** Aligns the calendar and the pending selection with the current value. */
269
+ private syncViewToValue;
270
+ /** ‹ : previous month (days/weeks), year (months) or 12 years (years). */
212
271
  prev(): void;
213
- /** Navigates the calendar to the next year/month/decade. */
272
+ /** › : next month (days/weeks), year (months) or 12 years (years). */
214
273
  next(): void;
215
- /** Selects a year - stores it and navigates to month selection. */
216
- selectYear(year: number): void;
217
- /** Selects a month - stores it and navigates to day selection. */
274
+ private shift;
275
+ /** Clicking the title zooms out: days → months → years. */
276
+ zoomOut(): void;
277
+ /** Whether the title can be clicked to zoom out. */
278
+ canZoomOut: _angular_core.Signal<boolean>;
279
+ /** Mouse wheel over the grid moves back/forward (quick browsing). */
280
+ onWheel(event: WheelEvent): void;
281
+ /** Keyboard shortcuts inside the panel: PageUp/PageDown change month. */
282
+ onPanelKeydown(event: KeyboardEvent): void;
283
+ /** "Today": jumps to today's month and, in single mode, picks today. */
284
+ goToday(): void;
285
+ /** Click on a day cell. */
286
+ selectDay(cell: CalendarCell): void;
287
+ private cancelOutsideNav;
288
+ /** Double click on a day: pick it and apply in one go. */
289
+ quickApply(cell: CalendarCell): void;
290
+ /** Hover on a day while choosing the range end (live band preview). */
291
+ onDayHover(cell: CalendarCell | null): void;
292
+ /** Selects a month in the month grid. */
218
293
  selectMonth(monthIndex: number): void;
219
- /** Selects a day - completes the date selection. */
220
- selectDay(day: number): void;
221
- /** Selects a week - emits its start date (YYYY-MM-DD). */
294
+ /** Selects a year in the year grid. */
295
+ selectYear(year: number): void;
296
+ /** Selects a week (emits its start date YYYY-MM-DD). */
222
297
  selectWeek(start: Date): void;
298
+ /** Commits what is picked in the panel (date, date+time, time or range). */
299
+ apply(): void;
300
+ /** Clears the value. */
301
+ clear(): void;
223
302
  private setValue;
224
- /** Confirms the selected time and commits the combined date+time value. */
225
- confirmTime(): void;
226
- /** Reads the hour selected in the time selector. */
227
- onHourChange(event: Event): void;
228
- /** Reads the minute selected in the time selector. */
229
- onMinuteChange(event: Event): void;
230
- /** Reads the second selected in the time selector. */
231
- onSecondChange(event: Event): void;
232
- /** Current meridiem ("AM"/"PM") for the 12-hour format. */
233
- meridiem(): 'AM' | 'PM';
234
- /** Reads the meridiem selected in the time selector. */
235
- onMeridiemChange(event: Event): void;
236
- /** Splits the date part from a full ISO "date" or "dateTtime" value. */
237
- private datePartOf;
238
- /** Formats a raw time string ("HH:mm[:ss]") using the configured format. */
239
- private formatTimeFromValue;
240
- /** Formats hour/minute/second according to hour format and seconds option. */
241
- private formatTime;
242
- /** Formats a Date as a YYYY-MM-DD ISO string. */
243
- private toISODate;
244
- /** Whether the given day matches the currently selected date. */
245
- isSelectedDay(day: number): boolean;
246
- /** Hours available in the time selector ('12' maps to 0..11 or 12..23). */
247
- hoursRange(): number[];
248
- /** Minutes available in the time selector, stepped by `minuteStep`. */
249
- minutesRange(): number[];
250
- /** Seconds available in the time selector (0..59). */
251
- secondsRange(): number[];
252
- /** Formats an hour for display in the selector (12-hour aware). */
253
- hourDisplay(hour: number): string;
254
- /** Pads a minute value with a leading zero. */
255
- minutesLabel(value: number): string;
256
- /** Returns the position (x, y) for a clock number at the given index (0-11). */
257
- getClockNumberPosition(index: number): {
258
- x: number;
259
- y: number;
260
- };
261
- /** Returns the position (x, y) for a minute marker at the given index (0-59). */
262
- getMinuteMarkerPosition(index: number): {
263
- x: number;
264
- y: number;
265
- rotation: number;
266
- };
267
- /** Handles click on the analog clock face. */
268
- onClockClick(event: MouseEvent, mode: 'hours' | 'minutes'): void;
269
- /** Switches the clock mode between hours and minutes. */
270
- toggleClockMode(): void;
271
- /** Whether the given hour number matches the current selection on the clock face. */
272
- isClockHourSelected(hour12: number): boolean;
273
- /** Whether the given minute value matches the current selection. */
274
- isClockMinuteSelected(minute: number): boolean;
275
- /** Formats the clock display time for the header above the clock. */
276
- clockDisplayTime(): string;
277
- /** Returns SVG line coordinates for a clock hand from center to angle. */
278
- clockHandLine(length?: number): {
279
- x2: number;
280
- y2: number;
281
- };
282
- /** Returns SVG text position for a clock number at the given index (0-11). */
283
- clockNumberPos(index: number): {
284
- x: number;
285
- y: number;
286
- };
287
- /** Returns SVG text position for a minute label at the given minute (0-55). */
288
- clockMinutePos(minute: number): {
289
- x: number;
290
- y: number;
291
- };
292
- /** Returns SVG line coordinates for a minute marker. */
293
- clockMinuteMarker(i: number): {
294
- x1: number;
295
- y1: number;
296
- x2: number;
297
- y2: number;
298
- };
299
- /** Drills down from year view to month view for the selected year. */
300
- drillDownToMonth(year: number): void;
301
- /** Drills down from month view to date view for the selected month. */
302
- drillDownToDate(monthIndex: number): void;
303
- /** Goes back one level in drill-down navigation. */
304
- drillUp(): void;
305
- /** Returns to the initial view (year selection). */
306
- drillToInitial(): void;
307
- /** Formats input placeholder based on locale. */
303
+ /** Commits the date typed in a panel input (Enter / blur). */
304
+ commitPanelText(which: 'single' | 'start' | 'end', event: Event): void;
305
+ isSelectedDate(iso: string): boolean;
306
+ /** Effective range end: the picked one or, while choosing, the hovered day. */
307
+ private effectiveEnd;
308
+ isInRange(iso: string): boolean;
309
+ isRangeStart(iso: string): boolean;
310
+ isRangeEnd(iso: string): boolean;
311
+ isTodayDate(iso: string): boolean;
312
+ isMarked(iso: string): boolean;
313
+ /** Whether a day falls outside minValue / maxValue. */
314
+ isDisabledDate(iso: string): boolean;
315
+ isSelectedMonth(monthIndex: number): boolean;
316
+ isCurrentMonth(monthIndex: number): boolean;
317
+ isSelectedYear(year: number): boolean;
318
+ isCurrentYear(year: number): boolean;
319
+ isSelectedWeek(start: Date): boolean;
320
+ isCurrentWeek(start: Date): boolean;
321
+ weekLabel(index: number): string;
322
+ /** Localized range label for a week (e.g. '2 — 8 feb'). */
323
+ formatWeekRange(start: Date, end: Date): string;
324
+ /** Hour options: 00-23, or 12,01..11 of the current half in 12-hour format. */
325
+ hourOptions: _angular_core.Signal<{
326
+ value: number;
327
+ label: string;
328
+ }[]>;
329
+ /** Minute options, stepped by `minuteStep`. */
330
+ minuteOptions: _angular_core.Signal<number[]>;
331
+ /** Second options (0-59). */
332
+ secondOptions: number[];
333
+ /** Time being edited, formatted for the time input. */
334
+ timeText: _angular_core.Signal<string>;
335
+ /** Whether the time typed in the panel could not be read. */
336
+ timeTextError: _angular_core.WritableSignal<boolean>;
337
+ /** Current hour, highlighted like "today" in the calendar. */
338
+ isCurrentHour(hour: number): boolean;
339
+ selectHour(hour: number): void;
340
+ selectMinute(minute: number): void;
341
+ selectSecond(second: number): void;
342
+ /** Switches the hour to AM or PM keeping its 1-12 position. */
343
+ setMeridiem(meridiem: 'AM' | 'PM'): void;
344
+ /** "Now": sets the current time (minutes rounded to `minuteStep`). */
345
+ setNow(): void;
346
+ /**
347
+ * Puts `date`'s time in the columns, minutes rounded to the step so the
348
+ * value is always one of the listed options.
349
+ */
350
+ private setNowTime;
351
+ /** Commits the time typed in the panel (Enter / blur). */
352
+ commitTimeText(event: Event): void;
353
+ /** Centers the selected item of every time column (after the next render). */
354
+ private scheduleTimeScroll;
355
+ pad2(value: number): string;
308
356
  inputPlaceholder(): string;
309
- /** Handles text input in the date field. */
310
357
  onInputText(event: Event): void;
311
- /** Handles focus on the input field. */
312
358
  onInputFocus(): void;
313
359
  /** Validates and commits the typed value on blur or Enter. */
314
360
  onInputBlur(): void;
315
- /** Cancels typing and reverts to the previous value. */
316
361
  cancelTyping(): void;
317
- /** Parses a typed date string according to the locale format. */
318
- private parseTypedDate;
319
- /** Parses time-only input. */
362
+ /** Current value written the way the user would type it. */
363
+ private typedFormOfValue;
364
+ private parseTypedValue;
365
+ /** Parses a typed date in the pattern's field order (or ISO "YYYY-MM-DD") into ISO. */
366
+ private parseDateText;
320
367
  private parseTimeOnly;
321
- /** Whether the given day is today's date. */
322
- isToday(day: number): boolean;
323
- /** ISO date (YYYY-MM-DD) of the week start containing the given date. */
324
- private weekStartISO;
325
- /** Whether the given week row contains the displayed/selected date. */
326
- isSelectedWeek(start: Date): boolean;
327
- /** Whether the given week row contains today's date. */
328
- isCurrentWeek(start: Date): boolean;
329
- /** Whether the given month matches the selected month and year. */
330
- isSelectedMonth(monthIndex: number): boolean;
331
- isCurrentMonth(monthIndex: number): boolean;
332
- isSelectedYear(year: number): boolean;
333
- isCurrentYear(year: number): boolean;
368
+ /** Builds the 6x7 grid of a month, including days of the neighbouring months. */
369
+ private buildMonth;
370
+ private startOfWeek;
371
+ private addDays;
372
+ private goToDate;
373
+ private decadeOf;
374
+ private setClockFrom;
375
+ /** "YYYY-MM-DD" → local Date at noon (DST-safe). */
376
+ private parseISO;
377
+ private datePartOf;
378
+ private toISODate;
379
+ /** ISO date → how the user types it, in the pattern's field order ("31/12/2026"). */
380
+ private formatTyped;
381
+ /** ISO date → label of a range end ("6 ene 2026", or the pattern with 'format'). */
382
+ private formatMedium;
383
+ /** ISO date → label of the selected day, per the display style. */
384
+ private formatDisplay;
385
+ private capitalize;
386
+ private formatTimeFromValue;
387
+ private formatTime;
388
+ private buildTime;
334
389
  writeValue(value: any): void;
335
390
  /**
336
- * Normalizes an incoming value to the internal ISO string format expected
337
- * for the current configuration:
338
- * - date/week: "YYYY-MM-DD" (or "YYYY-MM-DDTHH:mm[:ss]" with showTime)
339
- * - month: "YYYY-MM"
340
- * - year: "YYYY"
341
- * - timeOnly: "HH:mm[:ss]"
342
- *
343
- * Accepts ISO strings, `Date` objects, timestamps and day-first strings
344
- * ("DD-MM-YYYY", "DD/MM/YYYY", "DD.MM.YYYY"; month-first when locale is
345
- * 'en'). Values that cannot be interpreted are discarded (returns null)
346
- * instead of breaking the formatted label.
391
+ * Range values: `{ start, end }` or `[start, end]`, each end parsed like a
392
+ * single date. Stored internally as "startISO|endISO".
347
393
  */
348
- private normalizeValue;
349
- /** Matches the tokens supported by `valueFormat`. */
350
- private static readonly FORMAT_TOKENS;
394
+ private normalizeRange;
351
395
  /**
352
- * Parses a string using the `valueFormat` pattern and returns the internal
353
- * ISO value, or null if it does not match.
396
+ * Normalizes an incoming value to the internal ISO string:
397
+ * date/week "YYYY-MM-DD" (+ "THH:mm[:ss]" with showTime), month "YYYY-MM",
398
+ * year "YYYY", timeOnly "HH:mm[:ss]". Accepts ISO strings, Date objects,
399
+ * timestamps, `valueFormat` strings and day-first strings (month-first for 'en').
354
400
  */
401
+ private normalizeValue;
402
+ private static readonly FORMAT_TOKENS;
403
+ /** Minimum time between two wheel navigations. */
404
+ private static readonly WHEEL_THROTTLE_MS;
405
+ /** How long a neighbouring-month click waits for a possible double click. */
406
+ private static readonly DBLCLICK_DELAY_MS;
407
+ /** Parses a string with the `valueFormat` pattern into the internal ISO value. */
355
408
  private parseWithFormat;
356
- /** Converts the internal ISO value to the configured `valueFormat`. */
409
+ /** Converts the internal value to what the form control receives. */
357
410
  private toOutputValue;
411
+ /** Applies `valueFormat` to one internal ISO value. */
412
+ private formatOutput;
358
413
  /** Builds the internal value from a Date according to the configuration. */
359
414
  private fromDate;
360
- /** Formats "HH:mm[:ss]" honoring the showSeconds option. */
361
- private buildTime;
362
- /** Warns about an unparseable value and discards it. */
363
415
  private invalidValue;
364
416
  registerOnChange(fn: any): void;
365
417
  registerOnTouched(fn: any): void;
366
418
  setDisabledState(isDisabled: boolean): void;
367
419
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DatePickerComponent, never>;
368
- 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; }; "controlName": { "alias": "controlName"; "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; }; "valueFormat": { "alias": "valueFormat"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
420
+ 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; }; "range": { "alias": "range"; "required": false; "isSignal": true; }; "markedDates": { "alias": "markedDates"; "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; }; "controlName": { "alias": "controlName"; "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; }; "dateFormat": { "alias": "dateFormat"; "required": false; "isSignal": true; }; "displayStyle": { "alias": "displayStyle"; "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; }; "valueFormat": { "alias": "valueFormat"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "touch": "touch"; }, never, never, true, never>;
369
421
  }
370
422
 
371
423
  export { DatePickerComponent };