@nanahoshi/mona-ui 0.24.4 → 0.24.6

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 (80) hide show
  1. package/README.md +3 -0
  2. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +95 -70
  3. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +196 -137
  4. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +136 -89
  5. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +164 -3
  6. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +124 -140
  7. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +205 -202
  8. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +108 -56
  9. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +68 -59
  10. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3 -3
  11. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -1
  12. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-DLOPRuFv.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-CD_ODHpU.mjs} +2 -2
  13. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-Dw5U9H0a.mjs → nanahoshi-mona-ui-grid-grid-list.component-0jN7I1jo.mjs} +4 -4
  14. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-D1kyAzD8.mjs → nanahoshi-mona-ui-grid-grid-row.component-BI_iE7pl.mjs} +3 -3
  15. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-ECK1_smx.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-Sa1aAtJ-.mjs} +4 -4
  16. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-D4lUDbfx.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BvUM9nPt.mjs} +8 -8
  17. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  18. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +2 -1
  19. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +2 -2
  20. package/fesm2022/nanahoshi-mona-ui-internal.mjs +4 -2
  21. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +2 -1
  22. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +4 -1
  23. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +4 -1
  24. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +4 -1
  25. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +2 -1
  26. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +2 -1
  27. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +2 -1
  28. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +2 -1
  29. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +2 -1
  30. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +2 -1
  31. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +2 -1
  32. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +2 -1
  33. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +2 -1
  34. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +118 -66
  35. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +195 -122
  36. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1 -1
  37. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +149 -167
  38. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +182 -137
  39. package/i18n/catalogs/en-US.messages.json +2 -1
  40. package/locales/ar-sa/ar-sa.messages.json +2 -1
  41. package/locales/de-de/de-de.messages.json +2 -1
  42. package/locales/es-es/es-es.messages.json +2 -1
  43. package/locales/fr-fr/fr-fr.messages.json +2 -1
  44. package/locales/id-id/id-id.messages.json +2 -1
  45. package/locales/it-it/it-it.messages.json +2 -1
  46. package/locales/ja-jp/ja-jp.messages.json +2 -1
  47. package/locales/ko-kr/ko-kr.messages.json +2 -1
  48. package/locales/pt-br/pt-br.messages.json +2 -1
  49. package/locales/ru-ru/ru-ru.messages.json +2 -1
  50. package/locales/tr-tr/tr-tr.messages.json +2 -1
  51. package/locales/zh-cn/zh-cn.messages.json +2 -1
  52. package/locales/zh-tw/zh-tw.messages.json +2 -1
  53. package/package.json +2 -2
  54. package/types/nanahoshi-mona-ui-auto-complete.d.ts +34 -20
  55. package/types/nanahoshi-mona-ui-calendar.d.ts +30 -11
  56. package/types/nanahoshi-mona-ui-combo-box.d.ts +42 -23
  57. package/types/nanahoshi-mona-ui-date-input.d.ts +74 -3
  58. package/types/nanahoshi-mona-ui-date-picker.d.ts +61 -33
  59. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +79 -38
  60. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +29 -15
  61. package/types/nanahoshi-mona-ui-dropdowns.d.ts +30 -19
  62. package/types/nanahoshi-mona-ui-i18n.d.ts +1 -0
  63. package/types/nanahoshi-mona-ui-internal.d.ts +3 -1
  64. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +1 -0
  65. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +1 -0
  66. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +1 -0
  67. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +1 -0
  68. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +1 -0
  69. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +1 -0
  70. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +1 -0
  71. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +1 -0
  72. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +1 -0
  73. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +1 -0
  74. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +1 -0
  75. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +1 -0
  76. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +1 -0
  77. package/types/nanahoshi-mona-ui-multi-select.d.ts +45 -21
  78. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +57 -16
  79. package/types/nanahoshi-mona-ui-time-picker.d.ts +72 -42
  80. package/types/nanahoshi-mona-ui-time-selector.d.ts +78 -46
@@ -1,10 +1,10 @@
1
- import * as _nanahoshi_mona_ui_i18n from '@nanahoshi/mona-ui/i18n';
2
- import { MonaTimePickerMessages } from '@nanahoshi/mona-ui/i18n';
3
1
  import * as _angular_core from '@angular/core';
4
2
  import { Signal, TemplateRef } from '@angular/core';
3
+ import * as _nanahoshi_mona_ui_i18n from '@nanahoshi/mona-ui/i18n';
4
+ import { MonaTimePickerMessages } from '@nanahoshi/mona-ui/i18n';
5
5
  import { FormValueControl } from '@angular/forms/signals';
6
6
  import { PreventableEvent } from '@nanahoshi/mona-ui/common';
7
- import { HourFormat } from '@nanahoshi/mona-ui/date-input';
7
+ import { HourFormat, TypedDateInput } from '@nanahoshi/mona-ui/date-input';
8
8
  import { VariantInputs, AttributeConfig } from '@nanahoshi/mona-ui/internal';
9
9
  import { ListSizeInputType } from '@nanahoshi/mona-ui/internal/list';
10
10
  import { PopupCloseEvent } from '@nanahoshi/mona-ui/popup';
@@ -25,16 +25,33 @@ type TimePickerVariantInput = Omit<TimePickerBaseVariantInput, "focused">;
25
25
  declare class TimePickerComponent implements FormValueControl<Date | null>, TimePickerVariantInput {
26
26
  #private;
27
27
  protected readonly baseClass: Signal<string>;
28
- protected readonly currentDateString: _angular_core.WritableSignal<string>;
29
28
  protected readonly effectiveFormat: Signal<string>;
29
+ protected readonly effectiveHourFormat: Signal<HourFormat>;
30
30
  protected readonly expanded: Signal<boolean>;
31
31
  protected readonly inputAttributes: Signal<AttributeConfig>;
32
32
  protected readonly invalidState: Signal<boolean>;
33
33
  protected readonly messages: Signal<_nanahoshi_mona_ui_i18n.MonaTimePickerMessages>;
34
- protected readonly navigatedDate: _angular_core.WritableSignal<Date>;
35
34
  protected readonly pickerPopupClass: Signal<string>;
36
35
  protected readonly popupId: string;
37
36
  protected readonly timePopupTemplateRef: Signal<TemplateRef<unknown>>;
37
+ /** Set in the constructor, which runs after the `value` model it writes to exists. */
38
+ protected readonly typedInput: TypedDateInput;
39
+ /**
40
+ * @description Id of an element that describes the input, such as a hint or an error message.
41
+ * @default ""
42
+ */
43
+ readonly ariaDescribedBy: _angular_core.InputSignal<string>;
44
+ /**
45
+ * @description Accessible name of the input. Prefer a visible label, linked through {@link inputId} or
46
+ * {@link ariaLabelledBy}; the placeholder is not a label.
47
+ * @default ""
48
+ */
49
+ readonly ariaLabel: _angular_core.InputSignal<string>;
50
+ /**
51
+ * @description Id of the element that labels the input.
52
+ * @default ""
53
+ */
54
+ readonly ariaLabelledBy: _angular_core.InputSignal<string>;
38
55
  /**
39
56
  * @description Emits when the popup is about to close. This event is preventable.
40
57
  */
@@ -45,37 +62,48 @@ declare class TimePickerComponent implements FormValueControl<Date | null>, Time
45
62
  readonly closed: _angular_core.OutputEmitterRef<void>;
46
63
  /**
47
64
  * @description Sets the disabled state of the time picker.
65
+ * @default false
48
66
  */
49
- readonly disabled: _angular_core.InputSignal<boolean>;
67
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
50
68
  /**
51
- * @description Sets the format of the time picker. If not specified, derives from the active locale, hourFormat, and showSeconds.
69
+ * @description Sets the format of the time picker. If not specified, derives from the active locale, hourFormat,
70
+ * and showSeconds. Typed text is also accepted with one-digit hours, minutes and seconds.
52
71
  * @default null
53
72
  */
54
73
  readonly format: _angular_core.InputSignal<string | null>;
55
74
  /**
56
- * @description Sets the hour format of the time picker.
57
- * @default 24
75
+ * @description Sets the hour format of the time picker. When null, the active locale's clock is used: 12-hour for
76
+ * en-US, 24-hour for de-DE.
77
+ * @default null
58
78
  */
59
- readonly hourFormat: _angular_core.InputSignal<HourFormat>;
79
+ readonly hourFormat: _angular_core.InputSignal<HourFormat | null>;
60
80
  /**
61
81
  * @description Sets the hour step of the time picker.
62
82
  * @default 1
63
83
  */
64
84
  readonly hourStep: _angular_core.InputSignal<number>;
85
+ /**
86
+ * @description Id of the inner `<input>` element. Point a `<label for>` or `<mona-label for>` at it to label the
87
+ * time picker. A unique id is generated when it isn't set.
88
+ * @default generated
89
+ */
90
+ readonly inputId: _angular_core.InputSignal<string>;
65
91
  /**
66
92
  * @description Marks the time picker as invalid. When bound to a signal form field via `[formField]`,
67
93
  * this is written by the `FormField` directive.
68
94
  * @default false
69
95
  */
70
- readonly invalid: _angular_core.InputSignal<boolean>;
96
+ readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
71
97
  /**
72
- * @description Sets the maximum date of the time picker.
73
- * @default null
98
+ * @description Sets the latest time of the time picker. Only the time of day is compared; a later typed time is
99
+ * reported as a `maxDate` error.
100
+ * @default undefined
74
101
  */
75
102
  readonly max: _angular_core.InputSignalWithTransform<Date | undefined, unknown>;
76
103
  /**
77
- * @description Sets the minimum date of the time picker.
78
- * @default null
104
+ * @description Sets the earliest time of the time picker. Only the time of day is compared; an earlier typed time
105
+ * is reported as a `minDate` error.
106
+ * @default undefined
79
107
  */
80
108
  readonly min: _angular_core.InputSignalWithTransform<Date | undefined, unknown>;
81
109
  /**
@@ -101,30 +129,31 @@ declare class TimePickerComponent implements FormValueControl<Date | null>, Time
101
129
  */
102
130
  readonly popupClass: _angular_core.InputSignal<string>;
103
131
  /**
104
- * @description Sets the height of the popup element.
105
- * @default 200
132
+ * @description Sets the height of the popup element. When not set, the popup fits the time selector.
133
+ * @default undefined
106
134
  */
107
135
  readonly popupHeight: _angular_core.InputSignal<ListSizeInputType>;
108
136
  /**
109
- * @description Sets the width of the popup element.
110
- * @default null
137
+ * @description Sets the width of the popup element. When not set, the popup fits the time selector.
138
+ * @default undefined
111
139
  */
112
140
  readonly popupWidth: _angular_core.InputSignal<ListSizeInputType>;
113
141
  /**
114
142
  * @description Sets the readonly state of the time picker.
143
+ * @default false
115
144
  */
116
- readonly readonly: _angular_core.InputSignal<boolean>;
145
+ readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
117
146
  /**
118
147
  * @description When true, the input is readonly but the popup button remains enabled.
119
148
  * @default false
120
149
  */
121
- readonly readonlyInput: _angular_core.InputSignal<boolean>;
150
+ readonly readonlyInput: _angular_core.InputSignalWithTransform<boolean, unknown>;
122
151
  /**
123
152
  * @description Sets the required state of the time picker.
124
153
  * When bound to a signal form field via `[formField]`, this is written by the `FormField` directive.
125
154
  * @default false
126
155
  */
127
- readonly required: _angular_core.InputSignal<boolean>;
156
+ readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
128
157
  /**
129
158
  * @description Sets the border radius of the time picker.
130
159
  */
@@ -135,19 +164,21 @@ declare class TimePickerComponent implements FormValueControl<Date | null>, Time
135
164
  */
136
165
  readonly secondStep: _angular_core.InputSignal<number>;
137
166
  /**
138
- * @description Sets the visibility of the clear button.
167
+ * @description Sets the visibility of the clear button. Clearing empties the value at once.
168
+ * @default false
139
169
  */
140
- readonly showClearButton: _angular_core.InputSignal<boolean>;
170
+ readonly showClearButton: _angular_core.InputSignalWithTransform<boolean, unknown>;
141
171
  /**
142
172
  * @description Sets the visibility of the second selector.
173
+ * @default false
143
174
  */
144
- readonly showSeconds: _angular_core.InputSignal<boolean>;
175
+ readonly showSeconds: _angular_core.InputSignalWithTransform<boolean, unknown>;
145
176
  /**
146
177
  * @description Sets the size of the time picker.
147
178
  */
148
179
  readonly size: _angular_core.InputSignal<"large" | "medium" | "small" | null | undefined>;
149
180
  /**
150
- * @description Emitted when the time picker is interacted with via blur, selection, or clear.
181
+ * @description Emitted when focus leaves the time picker and its popup.
151
182
  * The `FormField` directive listens to this to mark the field as touched.
152
183
  */
153
184
  readonly touch: _angular_core.OutputEmitterRef<void>;
@@ -156,32 +187,31 @@ declare class TimePickerComponent implements FormValueControl<Date | null>, Time
156
187
  * this is written by the `FormField` directive.
157
188
  * @default false
158
189
  */
159
- readonly touched: _angular_core.InputSignal<boolean>;
190
+ readonly touched: _angular_core.InputSignalWithTransform<boolean, unknown>;
160
191
  readonly userClass: _angular_core.InputSignal<string>;
161
192
  /**
162
- * @description Two-way bindable current time value.
193
+ * @description Two-way bindable current time value. Typed text is written on Enter and when the input loses
194
+ * focus, on the current value's day (today when empty); text that isn't a valid time keeps the previous value
195
+ * and marks the field invalid.
163
196
  * @default null
164
197
  */
165
198
  readonly value: _angular_core.ModelSignal<Date | null>;
166
199
  constructor();
167
- focus(): void;
168
- protected onDateStringEdit(dateString: string): void;
169
- protected onTimeInputBlur(): void;
200
+ /**
201
+ * Focuses the input and places the caret after the text. Read-only pickers take focus too.
202
+ * @param options Options passed to the native `focus()` call, such as `preventScroll`.
203
+ */
204
+ focus(options?: FocusOptions): void;
205
+ protected onFocusIn(event: FocusEvent): void;
206
+ protected onFocusOut(event: FocusEvent): void;
207
+ protected onInputBlur(): void;
208
+ protected onKeydown(event: KeyboardEvent): void;
170
209
  protected onTimeInputButtonClick(): void;
171
210
  protected onTimeSelectorValueChange(date: Date | null): void;
172
- private dateStringEquals;
173
- private generateValidDateTime;
174
- private handleKeydown;
175
211
  private openPopup;
176
- private processTimeInput;
177
- private setCurrentDate;
178
- private setCurrentDateString;
179
- private setDateValues;
180
- private setKeyboardNavigation;
181
- private setSubscriptions;
182
- private updateCurrentDateString;
212
+ private setPopupCloseSubscription;
183
213
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TimePickerComponent, never>;
184
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<TimePickerComponent, "mona-time-picker", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "hourStep": { "alias": "hourStep"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "minuteStep": { "alias": "minuteStep"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "popupClass": { "alias": "popupClass"; "required": false; "isSignal": true; }; "popupHeight": { "alias": "popupHeight"; "required": false; "isSignal": true; }; "popupWidth": { "alias": "popupWidth"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "readonlyInput": { "alias": "readonlyInput"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "secondStep": { "alias": "secondStep"; "required": false; "isSignal": true; }; "showClearButton": { "alias": "showClearButton"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "close": "close"; "closed": "closed"; "open": "open"; "opened": "opened"; "touch": "touch"; "value": "valueChange"; }, never, never, true, [{ directive: typeof i1.DropdownPopupHandlerDirective; inputs: {}; outputs: {}; }]>;
214
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TimePickerComponent, "mona-time-picker", never, { "ariaDescribedBy": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "hourStep": { "alias": "hourStep"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "minuteStep": { "alias": "minuteStep"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "popupClass": { "alias": "popupClass"; "required": false; "isSignal": true; }; "popupHeight": { "alias": "popupHeight"; "required": false; "isSignal": true; }; "popupWidth": { "alias": "popupWidth"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "readonlyInput": { "alias": "readonlyInput"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "secondStep": { "alias": "secondStep"; "required": false; "isSignal": true; }; "showClearButton": { "alias": "showClearButton"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "close": "close"; "closed": "closed"; "open": "open"; "opened": "opened"; "touch": "touch"; "value": "valueChange"; }, never, never, true, [{ directive: typeof i1.DropdownPopupHandlerDirective; inputs: {}; outputs: {}; }]>;
185
215
  }
186
216
 
187
217
  declare const TIME_PICKER_DEFAULT_MESSAGES: MonaTimePickerMessages;
@@ -1,13 +1,11 @@
1
1
  import * as _mirei_ts_collections from '@mirei/ts-collections';
2
- import * as _nanahoshi_mona_ui_date_input from '@nanahoshi/mona-ui/date-input';
3
- import { Meridiem, HourFormat } from '@nanahoshi/mona-ui/date-input';
4
- import * as luxon from 'luxon';
5
- import { DateTime } from 'luxon';
6
2
  import * as _nanahoshi_mona_ui_i18n from '@nanahoshi/mona-ui/i18n';
7
3
  import { MonaTimeSelectorMessages } from '@nanahoshi/mona-ui/i18n';
8
4
  import * as _angular_core from '@angular/core';
9
- import { ElementRef } from '@angular/core';
5
+ import { Signal, ElementRef } from '@angular/core';
10
6
  import { FormValueControl } from '@angular/forms/signals';
7
+ import { HourFormat, TimeUnit, Meridiem } from '@nanahoshi/mona-ui/date-input';
8
+ import { DateTime } from 'luxon';
11
9
  import * as class_variance_authority_types from 'class-variance-authority/types';
12
10
  import { VariantProps } from 'class-variance-authority';
13
11
  import { VariantInputs } from '@nanahoshi/mona-ui/internal';
@@ -42,53 +40,72 @@ type TimeSelectorVariantInput = TimeSelectorBaseVariantInput & TimeSelectorHeade
42
40
 
43
41
  declare class TimeSelectorComponent implements FormValueControl<Date | null>, TimeSelectorVariantInput {
44
42
  #private;
45
- protected readonly isRtl: _angular_core.Signal<boolean>;
46
- protected readonly amMeridiemVisible: _angular_core.Signal<boolean>;
47
- protected readonly baseClass: _angular_core.Signal<string>;
48
- protected readonly computedPopupHeight: _angular_core.Signal<number>;
43
+ protected readonly amMeridiemVisible: Signal<boolean>;
44
+ protected readonly baseClass: Signal<string>;
45
+ protected readonly computedPopupHeight: Signal<number>;
46
+ /** The clock in use: the `hourFormat` input, or the locale's own when it isn't set. */
47
+ protected readonly effectiveHourFormat: Signal<HourFormat>;
49
48
  protected readonly focusedList: _angular_core.WritableSignal<TimeListType>;
50
- protected readonly footerClass: _angular_core.Signal<string>;
51
- protected readonly headerClass: _angular_core.Signal<string>;
52
- protected readonly hour: _angular_core.Signal<number>;
49
+ protected readonly footerClass: Signal<string>;
50
+ protected readonly headerClass: Signal<string>;
51
+ protected readonly hour: Signal<number>;
53
52
  protected readonly hourListId: string;
54
- protected readonly hourListRef: _angular_core.Signal<ElementRef<HTMLOListElement>>;
55
- protected readonly infoContainerClass: _angular_core.Signal<string>;
56
- protected readonly invalidState: _angular_core.Signal<boolean>;
57
- protected readonly listContainerClass: _angular_core.Signal<string>;
58
- protected readonly maxDate: _angular_core.Signal<DateTime<true> | DateTime<false> | null>;
53
+ protected readonly hourListRef: Signal<ElementRef<HTMLOListElement>>;
54
+ /** The hours shown and reachable with the keyboard: on the step, within min and max. */
55
+ protected readonly hourOptions: Signal<Iterable<TimeUnit>>;
56
+ protected readonly infoContainerClass: Signal<string>;
57
+ protected readonly invalidState: Signal<boolean>;
58
+ protected readonly isRtl: Signal<boolean>;
59
+ protected readonly listContainerClass: Signal<string>;
60
+ protected readonly maxDate: Signal<DateTime<true> | DateTime<false> | null>;
59
61
  protected readonly meridiem: _angular_core.WritableSignal<Meridiem>;
60
62
  protected readonly meridiemListId: string;
61
- protected readonly meridiemListRef: _angular_core.Signal<ElementRef<HTMLOListElement> | undefined>;
62
- protected readonly messages: _angular_core.Signal<_nanahoshi_mona_ui_i18n.MonaTimeSelectorMessages>;
63
- protected readonly minDate: _angular_core.Signal<DateTime<true> | DateTime<false> | null>;
64
- protected readonly minute: _angular_core.Signal<luxon.SecondNumbers>;
63
+ protected readonly meridiemListRef: Signal<ElementRef<HTMLOListElement> | undefined>;
64
+ protected readonly messages: Signal<_nanahoshi_mona_ui_i18n.MonaTimeSelectorMessages>;
65
+ protected readonly minDate: Signal<DateTime<true> | DateTime<false> | null>;
66
+ protected readonly minute: Signal<number>;
65
67
  protected readonly minuteListId: string;
66
- protected readonly minuteListRef: _angular_core.Signal<ElementRef<HTMLOListElement>>;
67
- protected readonly minutes: _angular_core.Signal<_mirei_ts_collections.ImmutableSet<_nanahoshi_mona_ui_date_input.TimeUnit>>;
68
- protected readonly navigatedDate: _angular_core.WritableSignal<DateTime<true>>;
69
- protected readonly navigatedDateText: _angular_core.Signal<string>;
70
- protected readonly pmMeridiemVisible: _angular_core.Signal<boolean>;
71
- protected readonly second: _angular_core.Signal<luxon.SecondNumbers>;
68
+ protected readonly minuteListRef: Signal<ElementRef<HTMLOListElement>>;
69
+ protected readonly minuteOptions: Signal<Iterable<TimeUnit>>;
70
+ protected readonly navigatedDate: _angular_core.WritableSignal<DateTime<boolean>>;
71
+ protected readonly navigatedDateText: Signal<string>;
72
+ protected readonly pmMeridiemVisible: Signal<boolean>;
73
+ protected readonly second: Signal<number>;
72
74
  protected readonly secondListId: string;
73
- protected readonly secondListRef: _angular_core.Signal<ElementRef<HTMLOListElement> | undefined>;
74
- protected readonly seconds: _angular_core.Signal<_mirei_ts_collections.ImmutableSet<_nanahoshi_mona_ui_date_input.TimeUnit>>;
75
- protected readonly viewHours: _angular_core.Signal<_mirei_ts_collections.ImmutableSet<_nanahoshi_mona_ui_date_input.TimeUnit>>;
75
+ protected readonly secondListRef: Signal<ElementRef<HTMLOListElement> | undefined>;
76
+ protected readonly secondOptions: Signal<Iterable<TimeUnit>>;
77
+ protected readonly viewHours: Signal<_mirei_ts_collections.ImmutableSet<TimeUnit>>;
76
78
  /**
77
79
  * @description Accessible label for the time selector group.
78
80
  * @default ""
79
81
  */
80
82
  readonly ariaLabel: _angular_core.InputSignal<string>;
81
- readonly disabled: _angular_core.InputSignal<boolean>;
82
- readonly focusOnMount: _angular_core.InputSignal<boolean>;
83
- readonly footer: _angular_core.InputSignal<boolean>;
84
- readonly hourFormat: _angular_core.InputSignal<HourFormat>;
83
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
84
+ /**
85
+ * @description Moves focus to the hour list when the selector first renders. The pickers set it for their popups;
86
+ * an inline selector leaves focus where it is, so the page doesn't jump to it on load.
87
+ * @default false
88
+ */
89
+ readonly focusOnMount: _angular_core.InputSignalWithTransform<boolean, unknown>;
90
+ /**
91
+ * @description Shows the Set button. Without it, every change of hour, minute, second or AM/PM made by the user
92
+ * is written to the value at once.
93
+ * @default true
94
+ */
95
+ readonly footer: _angular_core.InputSignalWithTransform<boolean, unknown>;
96
+ /**
97
+ * @description The clock to show: "12" with an AM/PM list, or "24". When not set, the active locale's own clock
98
+ * is used (12-hour for en-US, 24-hour for de-DE).
99
+ * @default null
100
+ */
101
+ readonly hourFormat: _angular_core.InputSignal<HourFormat | null>;
85
102
  readonly hourStep: _angular_core.InputSignal<number>;
86
103
  /**
87
104
  * @description Marks the time selector as invalid. When bound to a signal form field via `[formField]`,
88
105
  * this is written by the `FormField` directive.
89
106
  * @default false
90
107
  */
91
- readonly invalid: _angular_core.InputSignal<boolean>;
108
+ readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
92
109
  readonly max: _angular_core.InputSignalWithTransform<Date | undefined, unknown>;
93
110
  readonly min: _angular_core.InputSignalWithTransform<Date | undefined, unknown>;
94
111
  readonly minuteStep: _angular_core.InputSignal<number>;
@@ -96,20 +113,20 @@ declare class TimeSelectorComponent implements FormValueControl<Date | null>, Ti
96
113
  * @description Prevents value changes while preserving the component's visual state.
97
114
  * @default false
98
115
  */
99
- readonly readonly: _angular_core.InputSignal<boolean>;
116
+ readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
100
117
  /**
101
118
  * @description Sets whether the time selector is required. When bound to a signal form field via `[formField]`,
102
119
  * this is written by the `FormField` directive.
103
120
  * @default false
104
121
  */
105
- readonly required: _angular_core.InputSignal<boolean>;
122
+ readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
106
123
  readonly rounded: _angular_core.InputSignal<"small" | "medium" | "large" | "full" | "none" | null | undefined>;
107
124
  readonly secondStep: _angular_core.InputSignal<number>;
108
- readonly showSeconds: _angular_core.InputSignal<boolean>;
125
+ readonly showSeconds: _angular_core.InputSignalWithTransform<boolean, unknown>;
109
126
  readonly size: _angular_core.InputSignal<"small" | "medium" | "large" | null | undefined>;
110
127
  /**
111
- * @description Emitted when the time selector is interacted with via blur or value selection.
112
- * The `FormField` directive listens to this to mark the field as touched.
128
+ * @description Emitted when focus leaves the time selector, as a native input is touched on blur. Moving between
129
+ * its lists and buttons doesn't count. The `FormField` directive listens to this to mark the field as touched.
113
130
  */
114
131
  readonly touch: _angular_core.OutputEmitterRef<void>;
115
132
  /**
@@ -117,31 +134,46 @@ declare class TimeSelectorComponent implements FormValueControl<Date | null>, Ti
117
134
  * this is written by the `FormField` directive.
118
135
  * @default false
119
136
  */
120
- readonly touched: _angular_core.InputSignal<boolean>;
137
+ readonly touched: _angular_core.InputSignalWithTransform<boolean, unknown>;
121
138
  /**
122
- * @description Two-way bindable current time value.
139
+ * @description Two-way bindable current time value. It is written by the Set button and Enter, or, without a
140
+ * footer, by each change the user makes; never on its own.
123
141
  * @default null
124
142
  */
125
143
  readonly value: _angular_core.ModelSignal<Date | null>;
126
144
  constructor();
127
- focus(): void;
145
+ /**
146
+ * Moves focus to the active list.
147
+ * @param options passed to the native `focus()` call, for example `{ preventScroll: true }`.
148
+ */
149
+ focus(options?: FocusOptions): void;
150
+ /** The id of the active option, or null while the time isn't one of the options (between steps, say). */
151
+ protected activeOptionId(listId: string, options: Iterable<TimeUnit>, value: number): string | null;
128
152
  protected formatTwoDigit(value: number): string;
129
- protected onBlur(): void;
153
+ protected onFocusOut(event: FocusEvent): void;
130
154
  protected onHourChange(hour: number): void;
131
- protected onMeridiemClick(meridiem: "AM" | "PM"): void;
155
+ protected onMeridiemClick(meridiem: Meridiem): void;
132
156
  protected onMinuteChange(minute: number): void;
133
- protected onNowClick(_event: Event): void;
157
+ protected onNowClick(): void;
134
158
  protected onSecondChange(second: number): void;
135
159
  protected onSetTimeClick(): void;
160
+ /** Moves a time inside min and max, on the same day. */
161
+ private clampToRange;
136
162
  private dateValuesEqual;
137
163
  private focusList;
138
164
  private getListRef;
139
165
  private getNextList;
166
+ private getOptions;
140
167
  private handleKeydown;
141
168
  private initializeNavigatedDate;
169
+ /** The options of a list that pass the step and the min/max bounds for the time being edited. */
170
+ private limit;
171
+ /** Moves through the options of a list, so the keyboard reaches what the mouse can: steps within min and max. */
142
172
  private navigateItem;
173
+ private navigateTo;
143
174
  private navigateToEdge;
144
175
  private setDateValues;
176
+ private setUnit;
145
177
  private setupKeyboardNavigation;
146
178
  private updateValue;
147
179
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TimeSelectorComponent, never>;