@nanahoshi/mona-ui 0.30.0 → 0.32.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 (124) hide show
  1. package/date-range-picker/package.json +4 -0
  2. package/docs/api/button-group.md +1 -0
  3. package/docs/api/calendar.md +3 -2
  4. package/docs/api/color-gradient.md +1 -0
  5. package/docs/api/color-palette.md +1 -0
  6. package/docs/api/color-picker.md +1 -0
  7. package/docs/api/common.md +1 -1
  8. package/docs/api/date-input.md +1 -1
  9. package/docs/api/date-range-picker.md +137 -0
  10. package/docs/api/form-field.md +88 -0
  11. package/docs/api/i18n.md +84 -0
  12. package/docs/api/list.md +1 -1
  13. package/docs/api/locales.md +14 -14
  14. package/docs/api/popup.md +1 -1
  15. package/docs/api/segmented.md +1 -0
  16. package/docs/api/switch.md +1 -0
  17. package/docs/calendar.md +47 -3
  18. package/docs/date-picker.md +1 -1
  19. package/docs/date-range-picker.md +420 -0
  20. package/docs/dropdown-list.md +1 -1
  21. package/docs/form-field.md +425 -0
  22. package/docs/forms.md +13 -4
  23. package/docs/label.md +5 -5
  24. package/docs/numeric-textbox.md +1 -1
  25. package/docs/radio-button.md +2 -1
  26. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +15 -4
  27. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +25 -1
  28. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +171 -59
  29. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +5 -2
  30. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +29 -3
  31. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +25 -1
  32. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +31 -3
  33. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +15 -4
  34. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +16 -4
  35. package/fesm2022/nanahoshi-mona-ui-date-range-picker.mjs +1331 -0
  36. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +16 -4
  37. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +19 -7
  38. package/fesm2022/nanahoshi-mona-ui-editor.mjs +24 -4
  39. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -0
  40. package/fesm2022/nanahoshi-mona-ui-form-field.mjs +666 -0
  41. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +50 -0
  42. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +7 -1
  43. package/fesm2022/nanahoshi-mona-ui-internal.mjs +27 -2
  44. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +50 -0
  45. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +32 -0
  46. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +38 -0
  47. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +38 -0
  48. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +29 -0
  49. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +38 -0
  50. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +29 -0
  51. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +29 -0
  52. package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +44 -0
  53. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +38 -0
  54. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +44 -0
  55. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +32 -0
  56. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +29 -0
  57. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +29 -0
  58. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +19 -7
  59. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +14 -5
  60. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +6 -3
  61. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +15 -9
  62. package/fesm2022/nanahoshi-mona-ui-rating.mjs +6 -3
  63. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +25 -1
  64. package/fesm2022/nanahoshi-mona-ui-slider.mjs +8 -5
  65. package/fesm2022/nanahoshi-mona-ui-switch.mjs +25 -1
  66. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +6 -3
  67. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +15 -4
  68. package/form-field/package.json +4 -0
  69. package/i18n/catalogs/en-US.messages.json +29 -0
  70. package/llms.txt +5 -1
  71. package/locales/ar-sa/ar-sa.messages.json +29 -0
  72. package/locales/de-de/de-de.messages.json +29 -0
  73. package/locales/es-es/es-es.messages.json +29 -0
  74. package/locales/fr-fr/fr-fr.messages.json +29 -0
  75. package/locales/id-id/id-id.messages.json +29 -0
  76. package/locales/it-it/it-it.messages.json +29 -0
  77. package/locales/ja-jp/ja-jp.messages.json +29 -0
  78. package/locales/ko-kr/ko-kr.messages.json +29 -0
  79. package/locales/pl-pl/pl-pl.messages.json +29 -0
  80. package/locales/pt-br/pt-br.messages.json +29 -0
  81. package/locales/ru-ru/ru-ru.messages.json +29 -0
  82. package/locales/tr-tr/tr-tr.messages.json +29 -0
  83. package/locales/zh-cn/zh-cn.messages.json +29 -0
  84. package/locales/zh-tw/zh-tw.messages.json +29 -0
  85. package/package.json +9 -1
  86. package/types/nanahoshi-mona-ui-auto-complete.d.ts +2 -0
  87. package/types/nanahoshi-mona-ui-button-group.d.ts +11 -0
  88. package/types/nanahoshi-mona-ui-calendar.d.ts +66 -8
  89. package/types/nanahoshi-mona-ui-check-box.d.ts +1 -0
  90. package/types/nanahoshi-mona-ui-color-gradient.d.ts +11 -0
  91. package/types/nanahoshi-mona-ui-color-palette.d.ts +11 -0
  92. package/types/nanahoshi-mona-ui-color-picker.d.ts +11 -0
  93. package/types/nanahoshi-mona-ui-combo-box.d.ts +2 -0
  94. package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -0
  95. package/types/nanahoshi-mona-ui-date-range-picker.d.ts +462 -0
  96. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +2 -0
  97. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +2 -0
  98. package/types/nanahoshi-mona-ui-form-field.d.ts +173 -0
  99. package/types/nanahoshi-mona-ui-i18n.d.ts +68 -0
  100. package/types/nanahoshi-mona-ui-internal.d.ts +39 -4
  101. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +29 -0
  102. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +29 -0
  103. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +29 -0
  104. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +29 -0
  105. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +29 -0
  106. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +29 -0
  107. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +29 -0
  108. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +29 -0
  109. package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +29 -0
  110. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +29 -0
  111. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +29 -0
  112. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +29 -0
  113. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +29 -0
  114. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +29 -0
  115. package/types/nanahoshi-mona-ui-multi-select.d.ts +2 -0
  116. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -0
  117. package/types/nanahoshi-mona-ui-otp-input.d.ts +1 -0
  118. package/types/nanahoshi-mona-ui-radio-button.d.ts +2 -0
  119. package/types/nanahoshi-mona-ui-rating.d.ts +1 -0
  120. package/types/nanahoshi-mona-ui-segmented.d.ts +11 -0
  121. package/types/nanahoshi-mona-ui-slider.d.ts +1 -0
  122. package/types/nanahoshi-mona-ui-switch.d.ts +11 -0
  123. package/types/nanahoshi-mona-ui-text-box.d.ts +1 -0
  124. package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -0
@@ -0,0 +1,462 @@
1
+ import * as i0 from "@angular/core";
2
+ import { Signal, TemplateRef } from "@angular/core";
3
+ import { FormValueControl, ValidationError } from "@angular/forms/signals";
4
+ import { CalendarDecadeCellTemplateDirective, CalendarMonthCellTemplateDirective, CalendarYearCellTemplateDirective, FirstDayOfWeek } from "@nanahoshi/mona-ui/calendar";
5
+ import { PreventableEvent } from "@nanahoshi/mona-ui/common";
6
+ import { DateDisabledType, DatePopupVariantInput } from "@nanahoshi/mona-ui/date-input";
7
+ import * as i1 from "@nanahoshi/mona-ui/dropdowns";
8
+ import { DropdownPopupInput } from "@nanahoshi/mona-ui/dropdowns";
9
+ import { AttributeConfig, VariantInputs } from "@nanahoshi/mona-ui/internal";
10
+ import { ListSizeInputType } from "@nanahoshi/mona-ui/internal/list";
11
+ import { PopupCloseEvent } from "@nanahoshi/mona-ui/popup";
12
+ import { VariantProps } from "class-variance-authority";
13
+ import { MonaDateRangePickerMessages } from "@nanahoshi/mona-ui/i18n";
14
+ /**
15
+ * A span of days, from `start` to `end`, both included. Either end is `null` while it hasn't been entered; the date
16
+ * range picker's value is `null` when neither has.
17
+ */
18
+ interface DateRange {
19
+ readonly end: Date | null;
20
+ readonly start: Date | null;
21
+ }
22
+ /** The range a preset picks. Both ends are set, and the end may come before the start: they're put in order. */
23
+ interface DateRangePresetRange {
24
+ readonly end: Date;
25
+ readonly start: Date;
26
+ }
27
+ /**
28
+ * A quick range of your own, shown beside the calendar. Its range is worked out from today each time the popup opens,
29
+ * so a range such as "Next 14 days" stays current.
30
+ */
31
+ interface DateRangePreset {
32
+ /** The text of the preset's button. */
33
+ readonly label: string;
34
+ /**
35
+ * Works out the range.
36
+ * @param today Today's date, at the start of the day.
37
+ */
38
+ readonly range: (today: Date) => DateRangePresetRange;
39
+ }
40
+ /**
41
+ * A built-in quick range, named by the locale's messages. Weeks start on the picker's `firstDay`, or on the locale's
42
+ * first day of the week.
43
+ *
44
+ * - `today`, `yesterday`: that day alone.
45
+ * - `last7Days`, `last30Days`: the days up to and including today.
46
+ * - `thisWeek`, `thisMonth`, `thisYear`: the whole week, month or year today is in.
47
+ * - `lastWeek`, `lastMonth`, `lastYear`: the whole week, month or year before it.
48
+ */
49
+ type DateRangePresetKey = "last30Days" | "last7Days" | "lastMonth" | "lastWeek" | "lastYear" | "thisMonth" | "thisWeek" | "thisYear" | "today" | "yesterday";
50
+ declare const dateRangePickerBaseThemeVariants: (props?: ({
51
+ focused?: boolean | null | undefined;
52
+ rounded?: "full" | "large" | "medium" | "none" | "small" | null | undefined;
53
+ size?: "large" | "medium" | "small" | null | undefined;
54
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
55
+ type DateRangePickerBaseVariantProps = VariantProps<typeof dateRangePickerBaseThemeVariants>;
56
+ type DateRangePickerBaseVariantInput = VariantInputs<DateRangePickerBaseVariantProps>;
57
+ type DateRangePickerVariantProps = DateRangePickerBaseVariantProps;
58
+ type DateRangePickerVariantInput = Omit<DateRangePickerBaseVariantInput, "focused">;
59
+ /** A preset as the popup shows it. */
60
+ interface DateRangePresetItem {
61
+ /** Whether no day of the range can be picked: it's outside the limits, or an end is a disabled date. */
62
+ readonly disabled: boolean;
63
+ readonly label: string;
64
+ /** The range within the picker's limits, or `null` when none of it is. */
65
+ readonly range: DateRangePresetRange | null;
66
+ /** Whether the picker's value is this range. */
67
+ readonly selected: boolean;
68
+ }
69
+ /** One of a range's two inputs. */
70
+ type DateRangePart = "end" | "start";
71
+ interface TypedDateRangeInput {
72
+ /**
73
+ * Writes the text of both inputs to the value. Text that doesn't parse, a date outside the limits, or an end
74
+ * before the start leaves the value as it was and is reported through {@link errors}, and to the form field the
75
+ * picker is bound to. Empty text clears that end; the value is `null` when both are empty.
76
+ * @param part The input whose text was just entered. An end before the start is reported on it.
77
+ */
78
+ commit(part: DateRangePart): void;
79
+ /** Takes text typed into an input. Clearing the input commits at once, so the clear button empties that end. */
80
+ edit(part: DateRangePart, text: string): void;
81
+ /** Parse and limit errors of the last commit, of both inputs. They clear when the value changes. */
82
+ readonly errors: Signal<readonly ValidationError.WithoutFieldTree[]>;
83
+ /** The errors of the last commit that belong to each input. */
84
+ readonly partErrors: Signal<Readonly<Record<DateRangePart, readonly ValidationError.WithoutFieldTree[]>>>;
85
+ /** The text in each input: the formatted end, or what the user is typing. */
86
+ readonly text: Readonly<Record<DateRangePart, Signal<string>>>;
87
+ }
88
+ /**
89
+ * Picks a range of days: two inputs for its first and last day, typed in the locale's format, and a calendar popup
90
+ * that shows two months at a time.
91
+ */
92
+ export declare class DateRangePickerComponent implements FormValueControl<DateRange | null>, DropdownPopupInput, DateRangePickerVariantInput, DatePopupVariantInput {
93
+ #private;
94
+ protected readonly baseClass: import("@angular/core").Signal<string>;
95
+ protected readonly buttonClass: import("@angular/core").Signal<string>;
96
+ /** The value as the calendar takes it: both ends, or the start alone, which the next day picked ends. */
97
+ protected readonly calendarValue: import("@angular/core").Signal<Date[] | null>;
98
+ protected readonly decadeCellTemplate: import("@angular/core").Signal<CalendarDecadeCellTemplateDirective | undefined>;
99
+ protected readonly describedBy: import("@angular/core").Signal<string | null>;
100
+ protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
101
+ protected readonly effectiveFormat: import("@angular/core").Signal<string>;
102
+ protected readonly endInputId: string;
103
+ protected readonly endInvalid: import("@angular/core").Signal<boolean>;
104
+ protected readonly endSizerTexts: import("@angular/core").Signal<string[]>;
105
+ protected readonly expanded: import("@angular/core").Signal<boolean>;
106
+ protected readonly fieldClass: string;
107
+ /** Whether the range as a whole is invalid: marked so, or required and empty, once touched. */
108
+ protected readonly fieldInvalid: import("@angular/core").Signal<boolean>;
109
+ protected readonly inputAttributes: import("@angular/core").Signal<AttributeConfig>;
110
+ protected readonly inputClass = "tabular-nums";
111
+ /** The input takes no room of its own, so the hidden text beside it sets its width. */
112
+ protected readonly inputStyle = "flex: 1 1 0%; min-width: 0; width: 0";
113
+ protected readonly invalidState: import("@angular/core").Signal<boolean>;
114
+ protected readonly labelledBy: import("@angular/core").Signal<string | null>;
115
+ protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaDateRangePickerMessages>;
116
+ protected readonly monthCellTemplate: import("@angular/core").Signal<CalendarMonthCellTemplateDirective | undefined>;
117
+ protected readonly pickerPopupClass: import("@angular/core").Signal<string>;
118
+ protected readonly popupId: string;
119
+ protected readonly popupTemplate: import("@angular/core").Signal<TemplateRef<unknown>>;
120
+ protected readonly presetClass: import("@angular/core").Signal<string>;
121
+ protected readonly presetItems: import("@angular/core").Signal<readonly DateRangePresetItem[]>;
122
+ protected readonly presetListClass: string;
123
+ protected readonly separatorClass: string;
124
+ protected readonly sizerClass: import("@angular/core").Signal<string>;
125
+ protected readonly startInputId: string;
126
+ protected readonly startInvalid: import("@angular/core").Signal<boolean>;
127
+ protected readonly startSizerTexts: import("@angular/core").Signal<string[]>;
128
+ /** Set in the constructor, which runs after the `value` model it writes to exists. */
129
+ protected readonly typedInput: TypedDateRangeInput;
130
+ protected readonly yearCellTemplate: import("@angular/core").Signal<CalendarYearCellTemplateDirective | undefined>;
131
+ /**
132
+ * @description Id of an element that describes the range, such as a hint or an error message. It describes both
133
+ * inputs.
134
+ * @default ""
135
+ */
136
+ readonly ariaDescribedBy: import("@angular/core").InputSignal<string>;
137
+ /**
138
+ * @description Accessible name of the range, on the group that holds its two inputs. Prefer a visible label from a
139
+ * `mona-label` or a `mona-form-field`. Each input is named for its end, as in "Start date".
140
+ * @default ""
141
+ */
142
+ readonly ariaLabel: import("@angular/core").InputSignal<string>;
143
+ /**
144
+ * @description Id of the element that labels the range, on the group that holds its two inputs.
145
+ * @default ""
146
+ */
147
+ readonly ariaLabelledBy: import("@angular/core").InputSignal<string>;
148
+ /**
149
+ * @description Emits when the popup is about to close. This event is preventable.
150
+ */
151
+ readonly close: import("@angular/core").OutputEmitterRef<PopupCloseEvent<unknown>>;
152
+ /**
153
+ * @description Emits after the popup is closed.
154
+ */
155
+ readonly closed: import("@angular/core").OutputEmitterRef<void>;
156
+ /**
157
+ * @description Sets the disabled state of the date range picker.
158
+ * @default false
159
+ */
160
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
161
+ /**
162
+ * @description Days that can't be picked, as an iterable of dates or a predicate. Typing one is reported as a
163
+ * `disabledDate` error. A range may still span a disabled day.
164
+ */
165
+ readonly disabledDates: import("@angular/core").InputSignal<DateDisabledType>;
166
+ /**
167
+ * @description Placeholder of the end input.
168
+ * @default ""
169
+ */
170
+ readonly endPlaceholder: import("@angular/core").InputSignal<string>;
171
+ /**
172
+ * @description Sets the first day of the week. If not specified, derives from the active locale.
173
+ * @default null
174
+ */
175
+ readonly firstDay: import("@angular/core").InputSignal<FirstDayOfWeek | null>;
176
+ /**
177
+ * @description The date format of both inputs. If not specified, derives from the active locale. Typed text is
178
+ * also accepted with one-digit days and months and a two-digit year.
179
+ * @default null
180
+ */
181
+ readonly format: import("@angular/core").InputSignal<string | null>;
182
+ /**
183
+ * @description Marks the range as invalid. When bound to a signal form field via `[formField]`, this is written
184
+ * by the `FormField` directive.
185
+ * @default false
186
+ */
187
+ readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
188
+ /**
189
+ * @description The last day either end can be. A later typed date is reported as a `maxDate` error.
190
+ */
191
+ readonly maxDate: import("@angular/core").InputSignalWithTransform<Date | undefined, unknown>;
192
+ /**
193
+ * @description The first day either end can be. An earlier typed date is reported as a `minDate` error.
194
+ */
195
+ readonly minDate: import("@angular/core").InputSignalWithTransform<Date | undefined, unknown>;
196
+ /**
197
+ * @description How many months the calendar shows side by side. They wrap onto new rows on a narrow screen.
198
+ * @default 2
199
+ */
200
+ readonly months: import("@angular/core").InputSignalWithTransform<number, unknown>;
201
+ /**
202
+ * @description Emits when the popup is about to open. This event is preventable.
203
+ */
204
+ readonly open: import("@angular/core").OutputEmitterRef<PreventableEvent<Event>>;
205
+ /**
206
+ * @description Emits after the popup is opened.
207
+ */
208
+ readonly opened: import("@angular/core").OutputEmitterRef<void>;
209
+ /**
210
+ * @description Sets the class of the popup element.
211
+ * @default ""
212
+ */
213
+ readonly popupClass: import("@angular/core").InputSignal<string>;
214
+ /**
215
+ * @description Sets the height of the popup element. When empty, the popup fits the calendar.
216
+ * @default ""
217
+ */
218
+ readonly popupHeight: import("@angular/core").InputSignal<ListSizeInputType>;
219
+ /**
220
+ * @description Sets the width of the popup element. When empty, the popup fits the calendar.
221
+ * @default ""
222
+ */
223
+ readonly popupWidth: import("@angular/core").InputSignal<ListSizeInputType>;
224
+ /**
225
+ * @description Quick ranges shown beside the calendar, such as "Last 7 days". Give the key of a built-in range,
226
+ * named by the locale's messages, or a `DateRangePreset` with a label of its own. Picking one writes its range and
227
+ * closes the popup. A range is kept within `minDate` and `maxDate`; one with no day left in them, or with an end
228
+ * on a disabled date, is disabled.
229
+ * @default []
230
+ */
231
+ readonly presets: import("@angular/core").InputSignal<readonly (DateRangePreset | DateRangePresetKey)[]>;
232
+ /**
233
+ * @description Sets the readonly state of the date range picker.
234
+ * @default false
235
+ */
236
+ readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
237
+ /**
238
+ * @description When true, the inputs are read-only but the calendar button stays enabled.
239
+ * @default false
240
+ */
241
+ readonly readonlyInput: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
242
+ /**
243
+ * @description Marks the range as required, which an empty value doesn't meet. When bound to a signal form
244
+ * field via `[formField]`, this is written by the `FormField` directive.
245
+ * @default false
246
+ */
247
+ readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
248
+ /**
249
+ * @description Sets the border radius of the date range picker.
250
+ */
251
+ readonly rounded: import("@angular/core").InputSignal<"full" | "large" | "medium" | "none" | "small" | null | undefined>;
252
+ /**
253
+ * @description Shows a clear button in each input, which empties that end at once.
254
+ * @default false
255
+ */
256
+ readonly showClearButton: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
257
+ /**
258
+ * @description Sets the size of the date range picker.
259
+ */
260
+ readonly size: import("@angular/core").InputSignal<"large" | "medium" | "small" | null | undefined>;
261
+ /**
262
+ * @description Placeholder of the start input.
263
+ * @default ""
264
+ */
265
+ readonly startPlaceholder: import("@angular/core").InputSignal<string>;
266
+ /**
267
+ * @description Emitted when focus leaves the date range picker and its popup.
268
+ * The `FormField` directive listens to this to mark the field as touched.
269
+ */
270
+ readonly touch: import("@angular/core").OutputEmitterRef<void>;
271
+ /**
272
+ * @description Sets the touched state of the date range picker. When bound to a signal form field via
273
+ * `[formField]`, this is written by the `FormField` directive.
274
+ * @default false
275
+ */
276
+ readonly touched: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
277
+ /** @description Extra classes for the control's container. */
278
+ readonly userClass: import("@angular/core").InputSignal<string>;
279
+ /**
280
+ * @description Two-way bindable range. Typed text is written on Enter and when an input loses focus; text that
281
+ * isn't a valid date, or an end before the start, keeps the previous range and marks the field invalid. A range
282
+ * picked in the calendar is written once both ends are picked.
283
+ * @default null
284
+ */
285
+ readonly value: import("@angular/core").ModelSignal<DateRange | null>;
286
+ /**
287
+ * @description Enables the display of week numbers in the calendar.
288
+ * @default false
289
+ */
290
+ readonly weekNumber: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
291
+ constructor();
292
+ /**
293
+ * Focuses the start input and places the caret after its text. Read-only pickers take focus too.
294
+ * @param options Options passed to the native `focus()` call, such as `preventScroll`.
295
+ */
296
+ focus(options?: FocusOptions): void;
297
+ protected onCalendarButtonClick(): void;
298
+ protected onCalendarValueChange(dates: Date | Date[] | null): void;
299
+ protected onFocusIn(event: FocusEvent): void;
300
+ protected onFocusOut(event: FocusEvent): void;
301
+ protected onInputBlur(part: DateRangePart): void;
302
+ protected onInputFocus(part: DateRangePart): void;
303
+ protected onKeydown(event: KeyboardEvent): void;
304
+ protected onPresetClick(item: DateRangePresetItem): void;
305
+ protected onPresetKeydown(event: KeyboardEvent): void;
306
+ private closePopup;
307
+ private focusPart;
308
+ private openPopup;
309
+ private setCalendarKeyboardSubscription;
310
+ private setPopupCloseSubscription;
311
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateRangePickerComponent, never>;
312
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateRangePickerComponent, "mona-date-range-picker", never, {
313
+ "ariaDescribedBy": {
314
+ "alias": "aria-describedby";
315
+ "required": false;
316
+ "isSignal": true;
317
+ };
318
+ "ariaLabel": {
319
+ "alias": "aria-label";
320
+ "required": false;
321
+ "isSignal": true;
322
+ };
323
+ "ariaLabelledBy": {
324
+ "alias": "aria-labelledby";
325
+ "required": false;
326
+ "isSignal": true;
327
+ };
328
+ "disabled": {
329
+ "alias": "disabled";
330
+ "required": false;
331
+ "isSignal": true;
332
+ };
333
+ "disabledDates": {
334
+ "alias": "disabledDates";
335
+ "required": false;
336
+ "isSignal": true;
337
+ };
338
+ "endPlaceholder": {
339
+ "alias": "endPlaceholder";
340
+ "required": false;
341
+ "isSignal": true;
342
+ };
343
+ "firstDay": {
344
+ "alias": "firstDay";
345
+ "required": false;
346
+ "isSignal": true;
347
+ };
348
+ "format": {
349
+ "alias": "format";
350
+ "required": false;
351
+ "isSignal": true;
352
+ };
353
+ "invalid": {
354
+ "alias": "invalid";
355
+ "required": false;
356
+ "isSignal": true;
357
+ };
358
+ "maxDate": {
359
+ "alias": "maxDate";
360
+ "required": false;
361
+ "isSignal": true;
362
+ };
363
+ "minDate": {
364
+ "alias": "minDate";
365
+ "required": false;
366
+ "isSignal": true;
367
+ };
368
+ "months": {
369
+ "alias": "months";
370
+ "required": false;
371
+ "isSignal": true;
372
+ };
373
+ "popupClass": {
374
+ "alias": "popupClass";
375
+ "required": false;
376
+ "isSignal": true;
377
+ };
378
+ "popupHeight": {
379
+ "alias": "popupHeight";
380
+ "required": false;
381
+ "isSignal": true;
382
+ };
383
+ "popupWidth": {
384
+ "alias": "popupWidth";
385
+ "required": false;
386
+ "isSignal": true;
387
+ };
388
+ "presets": {
389
+ "alias": "presets";
390
+ "required": false;
391
+ "isSignal": true;
392
+ };
393
+ "readonly": {
394
+ "alias": "readonly";
395
+ "required": false;
396
+ "isSignal": true;
397
+ };
398
+ "readonlyInput": {
399
+ "alias": "readonlyInput";
400
+ "required": false;
401
+ "isSignal": true;
402
+ };
403
+ "required": {
404
+ "alias": "required";
405
+ "required": false;
406
+ "isSignal": true;
407
+ };
408
+ "rounded": {
409
+ "alias": "rounded";
410
+ "required": false;
411
+ "isSignal": true;
412
+ };
413
+ "showClearButton": {
414
+ "alias": "showClearButton";
415
+ "required": false;
416
+ "isSignal": true;
417
+ };
418
+ "size": {
419
+ "alias": "size";
420
+ "required": false;
421
+ "isSignal": true;
422
+ };
423
+ "startPlaceholder": {
424
+ "alias": "startPlaceholder";
425
+ "required": false;
426
+ "isSignal": true;
427
+ };
428
+ "touched": {
429
+ "alias": "touched";
430
+ "required": false;
431
+ "isSignal": true;
432
+ };
433
+ "userClass": {
434
+ "alias": "class";
435
+ "required": false;
436
+ "isSignal": true;
437
+ };
438
+ "value": {
439
+ "alias": "value";
440
+ "required": false;
441
+ "isSignal": true;
442
+ };
443
+ "weekNumber": {
444
+ "alias": "weekNumber";
445
+ "required": false;
446
+ "isSignal": true;
447
+ };
448
+ }, {
449
+ "close": "close";
450
+ "closed": "closed";
451
+ "open": "open";
452
+ "opened": "opened";
453
+ "touch": "touch";
454
+ "value": "valueChange";
455
+ }, ["decadeCellTemplate", "monthCellTemplate", "yearCellTemplate"], never, true, [{
456
+ directive: typeof i1.DropdownPopupHandlerDirective;
457
+ inputs: {};
458
+ outputs: {};
459
+ }]>;
460
+ }
461
+ export declare const DATE_RANGE_PICKER_DEFAULT_MESSAGES: MonaDateRangePickerMessages;
462
+ export type { DateRange, DateRangePickerVariantInput, DateRangePickerVariantProps, DateRangePreset, DateRangePresetKey, DateRangePresetRange };
@@ -18,6 +18,7 @@ export declare class DateTimePickerComponent implements FormValueControl<Date |
18
18
  protected readonly baseClass: import("@angular/core").Signal<string>;
19
19
  protected readonly dateTabId: string;
20
20
  protected readonly decadeCellTemplate: import("@angular/core").Signal<CalendarDecadeCellTemplateDirective | undefined>;
21
+ protected readonly describedBy: import("@angular/core").Signal<string | null>;
21
22
  protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
22
23
  protected readonly effectiveFormat: import("@angular/core").Signal<string>;
23
24
  protected readonly effectiveHourFormat: import("@angular/core").Signal<HourFormat>;
@@ -29,6 +30,7 @@ export declare class DateTimePickerComponent implements FormValueControl<Date |
29
30
  protected readonly inputAttributes: import("@angular/core").Signal<AttributeConfig>;
30
31
  protected readonly invalidState: import("@angular/core").Signal<boolean>;
31
32
  protected readonly isRtl: import("@angular/core").Signal<boolean>;
33
+ protected readonly labelledBy: import("@angular/core").Signal<string | null>;
32
34
  protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaDateTimePickerMessages>;
33
35
  protected readonly monthCellTemplate: import("@angular/core").Signal<CalendarMonthCellTemplateDirective | undefined>;
34
36
  protected readonly navigatedDate: import("@angular/core").WritableSignal<Date>;
@@ -35,6 +35,7 @@ export declare class DropdownListComponent<TData = unknown, TValue = TData> impl
35
35
  protected readonly affixClass: import("@angular/core").Signal<string>;
36
36
  protected readonly baseClass: import("@angular/core").Signal<string>;
37
37
  protected readonly clearButtonVisible: import("@angular/core").Signal<boolean>;
38
+ protected readonly describedBy: import("@angular/core").Signal<string | null>;
38
39
  protected readonly effectiveAriaLabel: import("@angular/core").Signal<string>;
39
40
  protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
40
41
  protected readonly expanded: import("@angular/core").Signal<boolean>;
@@ -44,6 +45,7 @@ export declare class DropdownListComponent<TData = unknown, TValue = TData> impl
44
45
  protected readonly invalidState: import("@angular/core").Signal<boolean>;
45
46
  protected readonly isEmpty: import("@angular/core").Signal<boolean>;
46
47
  protected readonly itemTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
48
+ protected readonly labelledBy: import("@angular/core").Signal<string | null>;
47
49
  protected readonly listId: string;
48
50
  protected readonly listPopupClass: import("@angular/core").Signal<string>;
49
51
  protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaDropdownListMessages>;
@@ -0,0 +1,173 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ElementRef, TemplateRef } from "@angular/core";
3
+ import { FormField, ValidationError } from "@angular/forms/signals";
4
+ /**
5
+ * The context of a `monaFormFieldErrorTemplate`, rendered once for each error the form field shows.
6
+ */
7
+ interface FormFieldErrorTemplateContext {
8
+ /** The message the form field would show: the validator's own, or the locale's message for the error's kind. */
9
+ readonly $implicit: string;
10
+ /** The validation error, or null for the text of the form field's `error` input. */
11
+ readonly error: ValidationError | null;
12
+ /** The same message as `$implicit`, for `let-message="message"`. */
13
+ readonly message: string;
14
+ }
15
+ /**
16
+ * Where a form field puts its label: above the control (`vertical`) or beside it (`horizontal`).
17
+ */
18
+ type FormFieldOrientation = "horizontal" | "vertical";
19
+ /**
20
+ * Puts a label, a hint and validation errors around one form control, and connects them to it.
21
+ */
22
+ export declare class FormFieldComponent {
23
+ #private;
24
+ protected readonly boundField: import("@angular/core").Signal<FormField<any> | undefined>;
25
+ protected readonly captionId: string;
26
+ protected readonly classes: import("@angular/core").Signal<string>;
27
+ protected readonly controlClasses: import("@angular/core").Signal<string>;
28
+ protected readonly controlRef: import("@angular/core").Signal<ElementRef<HTMLElement>>;
29
+ protected readonly describedBy: import("@angular/core").Signal<string | null>;
30
+ protected readonly errorClasses: import("@angular/core").Signal<string>;
31
+ protected readonly errorId: string;
32
+ protected readonly errorItemClasses: string;
33
+ protected readonly errorTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
34
+ protected readonly errors: import("@angular/core").Signal<readonly FormFieldErrorTemplateContext[]>;
35
+ protected readonly hintClasses: import("@angular/core").Signal<string>;
36
+ protected readonly hintId: string;
37
+ protected readonly hintShown: import("@angular/core").Signal<boolean>;
38
+ protected readonly hintTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
39
+ protected readonly labelClasses: import("@angular/core").Signal<string>;
40
+ protected readonly labelShown: import("@angular/core").Signal<boolean>;
41
+ protected readonly labelTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
42
+ protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaFormFieldMessages>;
43
+ protected readonly optionalClasses: string;
44
+ protected readonly requiredClasses: string;
45
+ protected readonly requiredShown: import("@angular/core").Signal<boolean>;
46
+ /**
47
+ * @description Text shown as an error, whether or not the control is touched, such as an error from a server. It
48
+ * comes before the errors of a bound signal form field. Set the control's own `invalid` and `touched` too, so it
49
+ * draws its error state.
50
+ * @default ""
51
+ */
52
+ readonly error: import("@angular/core").InputSignal<string>;
53
+ /**
54
+ * @description Help text shown below the control. It describes the control through `aria-describedby`. Ignored
55
+ * when `monaFormFieldHintTemplate` is provided.
56
+ * @default ""
57
+ */
58
+ readonly hint: import("@angular/core").InputSignal<string>;
59
+ /**
60
+ * @description The label shown above or beside the control. It names the control through `aria-labelledby`.
61
+ * Ignored when `monaFormFieldLabelTemplate` is provided.
62
+ * @default ""
63
+ */
64
+ readonly label: import("@angular/core").InputSignal<string>;
65
+ /**
66
+ * @description Whether to show optional-field text after the label.
67
+ * @default false
68
+ */
69
+ readonly optional: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
70
+ /**
71
+ * @description Text shown after the label when `optional` is set.
72
+ * @default the `formField.optional` message
73
+ */
74
+ readonly optionalText: import("@angular/core").InputSignal<string>;
75
+ /**
76
+ * @description Where the label goes: above the control, or beside it in a column set by the
77
+ * `--mona-form-field-label-width` custom property (10rem by default).
78
+ * @default "vertical"
79
+ */
80
+ readonly orientation: import("@angular/core").InputSignal<FormFieldOrientation>;
81
+ /**
82
+ * @description Shows the required marker after the label. A bound signal form field with a `required` rule shows it
83
+ * too. The marker is hidden from assistive technology, which reads the control's own required state.
84
+ * @default false
85
+ */
86
+ readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
87
+ /**
88
+ * @description Whether a required field shows its marker. Turn it off for a form that marks optional fields instead.
89
+ * @default true
90
+ */
91
+ readonly showRequiredMarker: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
92
+ /**
93
+ * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
94
+ * @default ""
95
+ */
96
+ readonly userClass: import("@angular/core").InputSignal<string>;
97
+ constructor();
98
+ protected onLabelClick(event: MouseEvent): void;
99
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldComponent, never>;
100
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldComponent, "mona-form-field", never, {
101
+ "error": {
102
+ "alias": "error";
103
+ "required": false;
104
+ "isSignal": true;
105
+ };
106
+ "hint": {
107
+ "alias": "hint";
108
+ "required": false;
109
+ "isSignal": true;
110
+ };
111
+ "label": {
112
+ "alias": "label";
113
+ "required": false;
114
+ "isSignal": true;
115
+ };
116
+ "optional": {
117
+ "alias": "optional";
118
+ "required": false;
119
+ "isSignal": true;
120
+ };
121
+ "optionalText": {
122
+ "alias": "optionalText";
123
+ "required": false;
124
+ "isSignal": true;
125
+ };
126
+ "orientation": {
127
+ "alias": "orientation";
128
+ "required": false;
129
+ "isSignal": true;
130
+ };
131
+ "required": {
132
+ "alias": "required";
133
+ "required": false;
134
+ "isSignal": true;
135
+ };
136
+ "showRequiredMarker": {
137
+ "alias": "showRequiredMarker";
138
+ "required": false;
139
+ "isSignal": true;
140
+ };
141
+ "userClass": {
142
+ "alias": "class";
143
+ "required": false;
144
+ "isSignal": true;
145
+ };
146
+ }, {}, ["boundField", "errorTemplate", "hintTemplate", "labelTemplate"], ["*"], true, never>;
147
+ }
148
+ /**
149
+ * Renders each error the form field shows, in place of its message. The context's `$implicit` is the message and
150
+ * `error` is the validation error, or null for the form field's `error` input.
151
+ */
152
+ export declare class FormFieldErrorTemplateDirective {
153
+ static ngTemplateContextGuard(_directive: FormFieldErrorTemplateDirective, _context: unknown): _context is FormFieldErrorTemplateContext;
154
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldErrorTemplateDirective, never>;
155
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FormFieldErrorTemplateDirective, "ng-template[monaFormFieldErrorTemplate]", never, {}, {}, never, never, true, never>;
156
+ }
157
+ /**
158
+ * Replaces the `hint` text with projected content, such as text with a link. It still describes the control. The
159
+ * template has no context variables.
160
+ */
161
+ export declare class FormFieldHintTemplateDirective {
162
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldHintTemplateDirective, never>;
163
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FormFieldHintTemplateDirective, "ng-template[monaFormFieldHintTemplate]", never, {}, {}, never, never, true, never>;
164
+ }
165
+ /**
166
+ * Replaces the `label` text with projected content. Its text names the control, so keep interactive elements out of
167
+ * it. The template has no context variables.
168
+ */
169
+ export declare class FormFieldLabelTemplateDirective {
170
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldLabelTemplateDirective, never>;
171
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FormFieldLabelTemplateDirective, "ng-template[monaFormFieldLabelTemplate]", never, {}, {}, never, never, true, never>;
172
+ }
173
+ export type { FormFieldErrorTemplateContext, FormFieldOrientation };