@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.
- package/date-range-picker/package.json +4 -0
- package/docs/api/button-group.md +1 -0
- package/docs/api/calendar.md +3 -2
- package/docs/api/color-gradient.md +1 -0
- package/docs/api/color-palette.md +1 -0
- package/docs/api/color-picker.md +1 -0
- package/docs/api/common.md +1 -1
- package/docs/api/date-input.md +1 -1
- package/docs/api/date-range-picker.md +137 -0
- package/docs/api/form-field.md +88 -0
- package/docs/api/i18n.md +84 -0
- package/docs/api/list.md +1 -1
- package/docs/api/locales.md +14 -14
- package/docs/api/popup.md +1 -1
- package/docs/api/segmented.md +1 -0
- package/docs/api/switch.md +1 -0
- package/docs/calendar.md +47 -3
- package/docs/date-picker.md +1 -1
- package/docs/date-range-picker.md +420 -0
- package/docs/dropdown-list.md +1 -1
- package/docs/form-field.md +425 -0
- package/docs/forms.md +13 -4
- package/docs/label.md +5 -5
- package/docs/numeric-textbox.md +1 -1
- package/docs/radio-button.md +2 -1
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +15 -4
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +25 -1
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +171 -59
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +5 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +25 -1
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +31 -3
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +15 -4
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +16 -4
- package/fesm2022/nanahoshi-mona-ui-date-range-picker.mjs +1331 -0
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +16 -4
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +19 -7
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +24 -4
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -0
- package/fesm2022/nanahoshi-mona-ui-form-field.mjs +666 -0
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +50 -0
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +7 -1
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +27 -2
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +50 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +32 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +38 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +38 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +38 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +44 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +38 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +44 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +32 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +19 -7
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +14 -5
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +6 -3
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +15 -9
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +6 -3
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +25 -1
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +8 -5
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +25 -1
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +6 -3
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +15 -4
- package/form-field/package.json +4 -0
- package/i18n/catalogs/en-US.messages.json +29 -0
- package/llms.txt +5 -1
- package/locales/ar-sa/ar-sa.messages.json +29 -0
- package/locales/de-de/de-de.messages.json +29 -0
- package/locales/es-es/es-es.messages.json +29 -0
- package/locales/fr-fr/fr-fr.messages.json +29 -0
- package/locales/id-id/id-id.messages.json +29 -0
- package/locales/it-it/it-it.messages.json +29 -0
- package/locales/ja-jp/ja-jp.messages.json +29 -0
- package/locales/ko-kr/ko-kr.messages.json +29 -0
- package/locales/pl-pl/pl-pl.messages.json +29 -0
- package/locales/pt-br/pt-br.messages.json +29 -0
- package/locales/ru-ru/ru-ru.messages.json +29 -0
- package/locales/tr-tr/tr-tr.messages.json +29 -0
- package/locales/zh-cn/zh-cn.messages.json +29 -0
- package/locales/zh-tw/zh-tw.messages.json +29 -0
- package/package.json +9 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +2 -0
- package/types/nanahoshi-mona-ui-button-group.d.ts +11 -0
- package/types/nanahoshi-mona-ui-calendar.d.ts +66 -8
- package/types/nanahoshi-mona-ui-check-box.d.ts +1 -0
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +11 -0
- package/types/nanahoshi-mona-ui-color-palette.d.ts +11 -0
- package/types/nanahoshi-mona-ui-color-picker.d.ts +11 -0
- package/types/nanahoshi-mona-ui-combo-box.d.ts +2 -0
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -0
- package/types/nanahoshi-mona-ui-date-range-picker.d.ts +462 -0
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +2 -0
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +2 -0
- package/types/nanahoshi-mona-ui-form-field.d.ts +173 -0
- package/types/nanahoshi-mona-ui-i18n.d.ts +68 -0
- package/types/nanahoshi-mona-ui-internal.d.ts +39 -4
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +29 -0
- package/types/nanahoshi-mona-ui-multi-select.d.ts +2 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -0
- package/types/nanahoshi-mona-ui-otp-input.d.ts +1 -0
- package/types/nanahoshi-mona-ui-radio-button.d.ts +2 -0
- package/types/nanahoshi-mona-ui-rating.d.ts +1 -0
- package/types/nanahoshi-mona-ui-segmented.d.ts +11 -0
- package/types/nanahoshi-mona-ui-slider.d.ts +1 -0
- package/types/nanahoshi-mona-ui-switch.d.ts +11 -0
- package/types/nanahoshi-mona-ui-text-box.d.ts +1 -0
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -0
package/docs/api/button-group.md
CHANGED
|
@@ -17,6 +17,7 @@ Component.
|
|
|
17
17
|
| Name | Type | Default | Description |
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
19
|
| `allowEmpty` | `boolean` | `true` | When `false` and `selection` is `"single"`, a selected button stays selected until another one takes over: the active button can't be deselected, and clearing every `selected` brings it back. It doesn't choose a first button, and a `value` of `null` still clears the group, so a form can reset it. Has no effect in `"multiple"` mode. |
|
|
20
|
+
| `aria-describedby` | `string` | `""` | Id of an element that describes the button group, such as a hint or an error message. |
|
|
20
21
|
| `aria-label` | `string \| undefined` | `undefined` | Accessible name for the host element. Override when multiple button groups appear on the same page so screen reader users can distinguish them. |
|
|
21
22
|
| `aria-labelledby` | `string` | `""` | Id of the element that names the group. |
|
|
22
23
|
| `class` | `string` | `""` | Additional CSS classes merged onto the host element via `tailwind-merge`. |
|
package/docs/api/calendar.md
CHANGED
|
@@ -23,12 +23,13 @@ Component.
|
|
|
23
23
|
| `invalid` | `boolean` | `false` | Marks the calendar as invalid. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
24
24
|
| `maxDate` | `Date \| null` | — | Sets the maximum date that can be selected. |
|
|
25
25
|
| `minDate` | `Date \| null` | — | Sets the minimum date that can be selected. |
|
|
26
|
+
| `months` | `number` | `1` | How many months the month view shows side by side, from 1 to 12. They wrap onto new rows when the calendar is narrow. With more than one, each month has a caption, the days of the months around it are left blank, and the previous and next buttons move the view by one month. |
|
|
26
27
|
| `readonly` | `boolean` | `false` | Sets the readonly state of the calendar. |
|
|
27
28
|
| `required` | `boolean` | `false` | Sets whether the calendar is required. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
28
29
|
| `rounded` | `"full" \| "large" \| "medium" \| "none" \| "small"` | `"medium"` | Sets the border radius of the calendar. |
|
|
29
30
|
| `selection` | `CalendarSelection` | `"single"` | Sets the selection mode of the calendar. |
|
|
30
31
|
| `touched` | `boolean` | `false` | Sets the touched state of the calendar. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
31
|
-
| `value` (two-way) | `Date \| Date[] \| null` | `null` | The current value of the calendar: a `Date` in single selection, the selected dates in multiple selection, and `[start, end]` in range selection. A range is written once both ends are picked. |
|
|
32
|
+
| `value` (two-way) | `Date \| Date[] \| null` | `null` | The current value of the calendar: a `Date` in single selection, the selected dates in multiple selection, and `[start, end]` in range selection. A range is written once both ends are picked. In range selection, a value with one date is a range's start: the next day picked ends the range. |
|
|
32
33
|
| `weekNumber` | `boolean` | `false` | Enables the display of week numbers in the calendar. |
|
|
33
34
|
|
|
34
35
|
### Outputs
|
|
@@ -120,4 +121,4 @@ Type alias.
|
|
|
120
121
|
type FirstDayOfWeek = | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday";
|
|
121
122
|
```
|
|
122
123
|
|
|
123
|
-
**Used by:** [`CalendarComponent`](calendar.md#calendarcomponent), [`DatePickerComponent`](date-picker.md#datepickercomponent), [`DateTimePickerComponent`](datetime-picker.md#datetimepickercomponent)
|
|
124
|
+
**Used by:** [`CalendarComponent`](calendar.md#calendarcomponent), [`DatePickerComponent`](date-picker.md#datepickercomponent), [`DateRangePickerComponent`](date-range-picker.md#daterangepickercomponent), [`DateTimePickerComponent`](datetime-picker.md#datetimepickercomponent)
|
|
@@ -15,6 +15,7 @@ Component.
|
|
|
15
15
|
|
|
16
16
|
| Name | Type | Default | Description |
|
|
17
17
|
| --- | --- | --- | --- |
|
|
18
|
+
| `aria-describedby` | `string` | `""` | Id of an element that describes the color gradient, such as a hint or an error message. |
|
|
18
19
|
| `aria-label` | `string` | `""` | Accessible name of the group of controls. |
|
|
19
20
|
| `aria-labelledby` | `string` | `""` | Id of the element that names the group of controls. |
|
|
20
21
|
| `disabled` | `boolean` | `false` | Sets the disabled state of the color gradient. |
|
|
@@ -15,6 +15,7 @@ Component.
|
|
|
15
15
|
|
|
16
16
|
| Name | Type | Default | Description |
|
|
17
17
|
| --- | --- | --- | --- |
|
|
18
|
+
| `aria-describedby` | `string` | `""` | Id of an element that describes the color palette, such as a hint or an error message. |
|
|
18
19
|
| `aria-label` | `string` | `""` | Accessible label for the color palette grid. |
|
|
19
20
|
| `aria-labelledby` | `string` | `""` | Id of the element that names the color palette grid. |
|
|
20
21
|
| `clearable` | `boolean` | `true` | Whether activating the selected tile clears the value. A required palette never clears. |
|
package/docs/api/color-picker.md
CHANGED
|
@@ -15,6 +15,7 @@ Component.
|
|
|
15
15
|
|
|
16
16
|
| Name | Type | Default | Description |
|
|
17
17
|
| --- | --- | --- | --- |
|
|
18
|
+
| `aria-describedby` | `string` | `""` | Id of an element that describes the color picker, such as a hint or an error message. |
|
|
18
19
|
| `aria-label` | `string` | `""` | Accessible label for the color picker combobox. |
|
|
19
20
|
| `aria-labelledby` | `string` | `""` | Id of the element that names the color picker. |
|
|
20
21
|
| `closeOnSelect` | `boolean` | `true` | Whether to close the color picker when a color is selected. Only applies when the view is set to "palette". |
|
package/docs/api/common.md
CHANGED
|
@@ -101,7 +101,7 @@ Class.
|
|
|
101
101
|
| `isDefaultPrevented(): boolean` | Whether `preventDefault()` was called. |
|
|
102
102
|
| `preventDefault(): void` | Cancels what the event announces, such as opening or closing a popup, or closing a dialog. |
|
|
103
103
|
|
|
104
|
-
**Used by:** [`AutoCompleteComponent`](auto-complete.md#autocompletecomponent), [`CellEditEvent`](grid.md#celleditevent), [`ColumnReorderEvent`](grid.md#columnreorderevent), [`ColumnSortEvent`](grid.md#columnsortevent), [`ComboBoxComponent`](combo-box.md#comboboxcomponent), [`DatePickerComponent`](date-picker.md#datepickercomponent), [`DateTimePickerComponent`](datetime-picker.md#datetimepickercomponent), [`DialogActionEvent`](dialog.md#dialogactionevent), [`DropdownListComponent`](dropdown-list.md#dropdownlistcomponent), [`FilterChangeEvent`](common.md#filterchangeevent), [`GridAddEvent`](grid.md#gridaddevent), [`GridCancelEvent`](grid.md#gridcancelevent), [`GridEditEvent`](grid.md#grideditevent), [`GridRemoveEvent`](grid.md#gridremoveevent), [`GridSaveEvent`](grid.md#gridsaveevent), [`ListBoxClearEvent`](list-box.md#listboxclearevent), [`ListBoxMoveEvent`](list-box.md#listboxmoveevent), [`ListBoxRemoveEvent`](list-box.md#listboxremoveevent), [`ListBoxTransferEvent`](list-box.md#listboxtransferevent), [`MultiSelectComponent`](multi-select.md#multiselectcomponent), [`NodeCheckEvent`](tree-view.md#nodecheckevent), [`NodeClickEvent`](tree-view.md#nodeclickevent), [`NodeSelectEvent`](tree-view.md#nodeselectevent), [`PageSizeChangeEvent`](pager.md#pagesizechangeevent), [`PopoverHideEvent`](popover.md#popoverhideevent), [`PopoverShowEvent`](popover.md#popovershowevent), [`PopupCloseEvent`](popup.md#popupcloseevent), [`PopupMenuCloseEvent`](popup-menu.md#popupmenucloseevent), [`PopupMenuItemClickEvent`](popup-menu.md#popupmenuitemclickevent), [`RowEditEvent`](grid.md#roweditevent), [`RowReorderEvent`](grid.md#rowreorderevent), [`StepSelectEvent`](stepper.md#stepselectevent), [`TabCloseEvent`](tabs.md#tabcloseevent), [`TabSelectEvent`](tabs.md#tabselectevent), [`TimePickerComponent`](time-picker.md#timepickercomponent)
|
|
104
|
+
**Used by:** [`AutoCompleteComponent`](auto-complete.md#autocompletecomponent), [`CellEditEvent`](grid.md#celleditevent), [`ColumnReorderEvent`](grid.md#columnreorderevent), [`ColumnSortEvent`](grid.md#columnsortevent), [`ComboBoxComponent`](combo-box.md#comboboxcomponent), [`DatePickerComponent`](date-picker.md#datepickercomponent), [`DateRangePickerComponent`](date-range-picker.md#daterangepickercomponent), [`DateTimePickerComponent`](datetime-picker.md#datetimepickercomponent), [`DialogActionEvent`](dialog.md#dialogactionevent), [`DropdownListComponent`](dropdown-list.md#dropdownlistcomponent), [`FilterChangeEvent`](common.md#filterchangeevent), [`GridAddEvent`](grid.md#gridaddevent), [`GridCancelEvent`](grid.md#gridcancelevent), [`GridEditEvent`](grid.md#grideditevent), [`GridRemoveEvent`](grid.md#gridremoveevent), [`GridSaveEvent`](grid.md#gridsaveevent), [`ListBoxClearEvent`](list-box.md#listboxclearevent), [`ListBoxMoveEvent`](list-box.md#listboxmoveevent), [`ListBoxRemoveEvent`](list-box.md#listboxremoveevent), [`ListBoxTransferEvent`](list-box.md#listboxtransferevent), [`MultiSelectComponent`](multi-select.md#multiselectcomponent), [`NodeCheckEvent`](tree-view.md#nodecheckevent), [`NodeClickEvent`](tree-view.md#nodeclickevent), [`NodeSelectEvent`](tree-view.md#nodeselectevent), [`PageSizeChangeEvent`](pager.md#pagesizechangeevent), [`PopoverHideEvent`](popover.md#popoverhideevent), [`PopoverShowEvent`](popover.md#popovershowevent), [`PopupCloseEvent`](popup.md#popupcloseevent), [`PopupMenuCloseEvent`](popup-menu.md#popupmenucloseevent), [`PopupMenuItemClickEvent`](popup-menu.md#popupmenuitemclickevent), [`RowEditEvent`](grid.md#roweditevent), [`RowReorderEvent`](grid.md#rowreorderevent), [`StepSelectEvent`](stepper.md#stepselectevent), [`TabCloseEvent`](tabs.md#tabcloseevent), [`TabSelectEvent`](tabs.md#tabselectevent), [`TimePickerComponent`](time-picker.md#timepickercomponent)
|
|
105
105
|
|
|
106
106
|
## `FilterChangeEvent`
|
|
107
107
|
|
package/docs/api/date-input.md
CHANGED
|
@@ -94,7 +94,7 @@ Type alias.
|
|
|
94
94
|
type DateDisabledType = Iterable<Date> | Predicate<Date> | null | undefined;
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
**Used by:** [`CalendarComponent`](calendar.md#calendarcomponent), [`DatePickerComponent`](date-picker.md#datepickercomponent), [`DateTimePickerComponent`](datetime-picker.md#datetimepickercomponent), [`TypedDateConstraints`](date-input.md#typeddateconstraints)
|
|
97
|
+
**Used by:** [`CalendarComponent`](calendar.md#calendarcomponent), [`DatePickerComponent`](date-picker.md#datepickercomponent), [`DateRangePickerComponent`](date-range-picker.md#daterangepickercomponent), [`DateTimePickerComponent`](datetime-picker.md#datetimepickercomponent), [`TypedDateConstraints`](date-input.md#typeddateconstraints)
|
|
98
98
|
|
|
99
99
|
## `HourFormat`
|
|
100
100
|
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# `@nanahoshi/mona-ui/date-range-picker`
|
|
2
|
+
|
|
3
|
+
Everything `@nanahoshi/mona-ui/date-range-picker` exports.
|
|
4
|
+
|
|
5
|
+
**Guides:** [Date Range Picker](../date-range-picker.md)
|
|
6
|
+
|
|
7
|
+
## `DateRangePickerComponent`
|
|
8
|
+
|
|
9
|
+
Component.
|
|
10
|
+
|
|
11
|
+
Picks a range of days: two inputs for its first and last day, typed in the locale's format, and a calendar popup
|
|
12
|
+
that shows two months at a time.
|
|
13
|
+
|
|
14
|
+
**Selector:** `mona-date-range-picker`
|
|
15
|
+
**Implements:** `FormValueControl<DateRange \| null>`
|
|
16
|
+
|
|
17
|
+
### Inputs
|
|
18
|
+
|
|
19
|
+
| Name | Type | Default | Description |
|
|
20
|
+
| --- | --- | --- | --- |
|
|
21
|
+
| `aria-describedby` | `string` | `""` | Id of an element that describes the range, such as a hint or an error message. It describes both inputs. |
|
|
22
|
+
| `aria-label` | `string` | `""` | Accessible name of the range, on the group that holds its two inputs. Prefer a visible label from a `mona-label` or a `mona-form-field`. Each input is named for its end, as in "Start date". |
|
|
23
|
+
| `aria-labelledby` | `string` | `""` | Id of the element that labels the range, on the group that holds its two inputs. |
|
|
24
|
+
| `class` | `string` | `""` | Extra classes for the control's container. |
|
|
25
|
+
| `disabled` | `boolean` | `false` | Sets the disabled state of the date range picker. |
|
|
26
|
+
| `disabledDates` | `DateDisabledType` | — | Days that can't be picked, as an iterable of dates or a predicate. Typing one is reported as a `disabledDate` error. A range may still span a disabled day. |
|
|
27
|
+
| `endPlaceholder` | `string` | `""` | Placeholder of the end input. |
|
|
28
|
+
| `firstDay` | `FirstDayOfWeek \| null` | `null` | Sets the first day of the week. If not specified, derives from the active locale. |
|
|
29
|
+
| `format` | `string \| null` | `null` | The date format of both inputs. If not specified, derives from the active locale. Typed text is also accepted with one-digit days and months and a two-digit year. |
|
|
30
|
+
| `invalid` | `boolean` | `false` | Marks the range as invalid. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
31
|
+
| `maxDate` | `Date \| undefined` | `undefined` | The last day either end can be. A later typed date is reported as a `maxDate` error. |
|
|
32
|
+
| `minDate` | `Date \| undefined` | `undefined` | The first day either end can be. An earlier typed date is reported as a `minDate` error. |
|
|
33
|
+
| `months` | `number` | `2` | How many months the calendar shows side by side. They wrap onto new rows on a narrow screen. |
|
|
34
|
+
| `popupClass` | `string` | `""` | Sets the class of the popup element. |
|
|
35
|
+
| `popupHeight` | `ListSizeInputType` | `""` | Sets the height of the popup element. When empty, the popup fits the calendar. |
|
|
36
|
+
| `popupWidth` | `ListSizeInputType` | `""` | Sets the width of the popup element. When empty, the popup fits the calendar. |
|
|
37
|
+
| `presets` | `readonly (DateRangePreset \| DateRangePresetKey)[]` | `[]` | Quick ranges shown beside the calendar, such as "Last 7 days". Give the key of a built-in range, named by the locale's messages, or a `DateRangePreset` with a label of its own. Picking one writes its range and closes the popup. A range is kept within `minDate` and `maxDate`; one with no day left in them, or with an end on a disabled date, is disabled. |
|
|
38
|
+
| `readonly` | `boolean` | `false` | Sets the readonly state of the date range picker. |
|
|
39
|
+
| `readonlyInput` | `boolean` | `false` | When true, the inputs are read-only but the calendar button stays enabled. |
|
|
40
|
+
| `required` | `boolean` | `false` | Marks the range as required, which an empty value doesn't meet. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
41
|
+
| `rounded` | `"full" \| "large" \| "medium" \| "none" \| "small"` | `"medium"` | Sets the border radius of the date range picker. |
|
|
42
|
+
| `showClearButton` | `boolean` | `false` | Shows a clear button in each input, which empties that end at once. |
|
|
43
|
+
| `size` | `"large" \| "medium" \| "small"` | `"medium"` | Sets the size of the date range picker. |
|
|
44
|
+
| `startPlaceholder` | `string` | `""` | Placeholder of the start input. |
|
|
45
|
+
| `touched` | `boolean` | `false` | Sets the touched state of the date range picker. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
46
|
+
| `value` (two-way) | `DateRange \| null` | `null` | Two-way bindable range. Typed text is written on Enter and when an input loses focus; text that isn't a valid date, or an end before the start, keeps the previous range and marks the field invalid. A range picked in the calendar is written once both ends are picked. |
|
|
47
|
+
| `weekNumber` | `boolean` | `false` | Enables the display of week numbers in the calendar. |
|
|
48
|
+
|
|
49
|
+
### Outputs
|
|
50
|
+
|
|
51
|
+
| Name | Type | Description |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| `close` | `PopupCloseEvent<unknown>` | Emits when the popup is about to close. This event is preventable. |
|
|
54
|
+
| `closed` | `void` | Emits after the popup is closed. |
|
|
55
|
+
| `open` | `PreventableEvent<Event>` | Emits when the popup is about to open. This event is preventable. |
|
|
56
|
+
| `opened` | `void` | Emits after the popup is opened. |
|
|
57
|
+
| `touch` | `void` | Emitted when focus leaves the date range picker and its popup. The `FormField` directive listens to this to mark the field as touched. |
|
|
58
|
+
| `valueChange` | `DateRange \| null` | Emitted when `value` changes. |
|
|
59
|
+
|
|
60
|
+
### Methods
|
|
61
|
+
|
|
62
|
+
| Signature | Description |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| `focus(options?: FocusOptions): void` | Focuses the start input and places the caret after its text. Read-only pickers take focus too. |
|
|
65
|
+
|
|
66
|
+
## `DATE_RANGE_PICKER_DEFAULT_MESSAGES`
|
|
67
|
+
|
|
68
|
+
Constant.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
const DATE_RANGE_PICKER_DEFAULT_MESSAGES: MonaDateRangePickerMessages;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## `DateRange`
|
|
75
|
+
|
|
76
|
+
Interface.
|
|
77
|
+
|
|
78
|
+
A span of days, from `start` to `end`, both included. Either end is `null` while it hasn't been entered; the date
|
|
79
|
+
range picker's value is `null` when neither has.
|
|
80
|
+
|
|
81
|
+
### Properties
|
|
82
|
+
|
|
83
|
+
| Name | Type |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `end` (read-only) | `Date \| null` |
|
|
86
|
+
| `start` (read-only) | `Date \| null` |
|
|
87
|
+
|
|
88
|
+
**Used by:** [`DateRangePickerComponent`](date-range-picker.md#daterangepickercomponent)
|
|
89
|
+
|
|
90
|
+
## `DateRangePreset`
|
|
91
|
+
|
|
92
|
+
Interface.
|
|
93
|
+
|
|
94
|
+
A quick range of your own, shown beside the calendar. Its range is worked out from today each time the popup opens,
|
|
95
|
+
so a range such as "Next 14 days" stays current.
|
|
96
|
+
|
|
97
|
+
### Properties
|
|
98
|
+
|
|
99
|
+
| Name | Type | Description |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| `label` (read-only) | `string` | The text of the preset's button. |
|
|
102
|
+
| `range` (read-only) | `(today: Date) => DateRangePresetRange` | Works out the range. |
|
|
103
|
+
|
|
104
|
+
**Used by:** [`DateRangePickerComponent`](date-range-picker.md#daterangepickercomponent)
|
|
105
|
+
|
|
106
|
+
## `DateRangePresetRange`
|
|
107
|
+
|
|
108
|
+
Interface.
|
|
109
|
+
|
|
110
|
+
The range a preset picks. Both ends are set, and the end may come before the start: they're put in order.
|
|
111
|
+
|
|
112
|
+
### Properties
|
|
113
|
+
|
|
114
|
+
| Name | Type |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| `end` (read-only) | `Date` |
|
|
117
|
+
| `start` (read-only) | `Date` |
|
|
118
|
+
|
|
119
|
+
**Used by:** [`DateRangePreset`](date-range-picker.md#daterangepreset)
|
|
120
|
+
|
|
121
|
+
## `DateRangePresetKey`
|
|
122
|
+
|
|
123
|
+
Type alias.
|
|
124
|
+
|
|
125
|
+
A built-in quick range, named by the locale's messages. Weeks start on the picker's `firstDay`, or on the locale's
|
|
126
|
+
first day of the week.
|
|
127
|
+
|
|
128
|
+
- `today`, `yesterday`: that day alone.
|
|
129
|
+
- `last7Days`, `last30Days`: the days up to and including today.
|
|
130
|
+
- `thisWeek`, `thisMonth`, `thisYear`: the whole week, month or year today is in.
|
|
131
|
+
- `lastWeek`, `lastMonth`, `lastYear`: the whole week, month or year before it.
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
type DateRangePresetKey = | "last30Days" | "last7Days" | "lastMonth" | "lastWeek" | "lastYear" | "thisMonth" | "thisWeek" | "thisYear" | "today" | "yesterday";
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Used by:** [`DateRangePickerComponent`](date-range-picker.md#daterangepickercomponent)
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# `@nanahoshi/mona-ui/form-field`
|
|
2
|
+
|
|
3
|
+
Everything `@nanahoshi/mona-ui/form-field` exports.
|
|
4
|
+
|
|
5
|
+
**Guides:** [Form Field](../form-field.md)
|
|
6
|
+
|
|
7
|
+
## `FormFieldComponent`
|
|
8
|
+
|
|
9
|
+
Component.
|
|
10
|
+
|
|
11
|
+
Puts a label, a hint and validation errors around one form control, and connects them to it.
|
|
12
|
+
|
|
13
|
+
**Selector:** `mona-form-field`
|
|
14
|
+
|
|
15
|
+
### Inputs
|
|
16
|
+
|
|
17
|
+
| Name | Type | Default | Description |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| `class` | `string` | `""` | Additional CSS classes merged onto the host element via `tailwind-merge`. |
|
|
20
|
+
| `error` | `string` | `""` | Text shown as an error, whether or not the control is touched, such as an error from a server. It comes before the errors of a bound signal form field. Set the control's own `invalid` and `touched` too, so it draws its error state. |
|
|
21
|
+
| `hint` | `string` | `""` | Help text shown below the control. It describes the control through `aria-describedby`. Ignored when `monaFormFieldHintTemplate` is provided. |
|
|
22
|
+
| `label` | `string` | `""` | The label shown above or beside the control. It names the control through `aria-labelledby`. Ignored when `monaFormFieldLabelTemplate` is provided. |
|
|
23
|
+
| `optional` | `boolean` | `false` | Whether to show optional-field text after the label. |
|
|
24
|
+
| `optionalText` | `string` | `""` | Text shown after the label when `optional` is set. |
|
|
25
|
+
| `orientation` | `FormFieldOrientation` | `"vertical"` | Where the label goes: above the control, or beside it in a column set by the `--mona-form-field-label-width` custom property (10rem by default). |
|
|
26
|
+
| `required` | `boolean` | `false` | Shows the required marker after the label. A bound signal form field with a `required` rule shows it too. The marker is hidden from assistive technology, which reads the control's own required state. |
|
|
27
|
+
| `showRequiredMarker` | `boolean` | `true` | Whether a required field shows its marker. Turn it off for a form that marks optional fields instead. |
|
|
28
|
+
|
|
29
|
+
## `FormFieldErrorTemplateDirective`
|
|
30
|
+
|
|
31
|
+
Directive.
|
|
32
|
+
|
|
33
|
+
Renders each error the form field shows, in place of its message. The context's `$implicit` is the message and
|
|
34
|
+
`error` is the validation error, or null for the form field's `error` input.
|
|
35
|
+
|
|
36
|
+
**Selector:** `ng-template[monaFormFieldErrorTemplate]`
|
|
37
|
+
|
|
38
|
+
### Template context
|
|
39
|
+
|
|
40
|
+
| Name | Type | Description |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| `$implicit` | `string` | The message the form field would show: the validator's own, or the locale's message for the error's kind. |
|
|
43
|
+
| `error` | `ValidationError \| null` | The validation error, or null for the text of the form field's `error` input. |
|
|
44
|
+
| `message` | `string` | The same message as `$implicit`, for `let-message="message"`. |
|
|
45
|
+
|
|
46
|
+
## `FormFieldHintTemplateDirective`
|
|
47
|
+
|
|
48
|
+
Directive.
|
|
49
|
+
|
|
50
|
+
Replaces the `hint` text with projected content, such as text with a link. It still describes the control. The
|
|
51
|
+
template has no context variables.
|
|
52
|
+
|
|
53
|
+
**Selector:** `ng-template[monaFormFieldHintTemplate]`
|
|
54
|
+
|
|
55
|
+
## `FormFieldLabelTemplateDirective`
|
|
56
|
+
|
|
57
|
+
Directive.
|
|
58
|
+
|
|
59
|
+
Replaces the `label` text with projected content. Its text names the control, so keep interactive elements out of
|
|
60
|
+
it. The template has no context variables.
|
|
61
|
+
|
|
62
|
+
**Selector:** `ng-template[monaFormFieldLabelTemplate]`
|
|
63
|
+
|
|
64
|
+
## `FormFieldErrorTemplateContext`
|
|
65
|
+
|
|
66
|
+
Interface.
|
|
67
|
+
|
|
68
|
+
The context of a `monaFormFieldErrorTemplate`, rendered once for each error the form field shows.
|
|
69
|
+
|
|
70
|
+
### Properties
|
|
71
|
+
|
|
72
|
+
| Name | Type | Description |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| `$implicit` (read-only) | `string` | The message the form field would show: the validator's own, or the locale's message for the error's kind. |
|
|
75
|
+
| `error` (read-only) | `ValidationError \| null` | The validation error, or null for the text of the form field's `error` input. |
|
|
76
|
+
| `message` (read-only) | `string` | The same message as `$implicit`, for `let-message="message"`. |
|
|
77
|
+
|
|
78
|
+
## `FormFieldOrientation`
|
|
79
|
+
|
|
80
|
+
Type alias.
|
|
81
|
+
|
|
82
|
+
Where a form field puts its label: above the control (`vertical`) or beside it (`horizontal`).
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
type FormFieldOrientation = "horizontal" | "vertical";
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Used by:** [`FormFieldComponent`](form-field.md#formfieldcomponent)
|
package/docs/api/i18n.md
CHANGED
|
@@ -50,6 +50,18 @@ Converts a locale id to a canonical BCP 47 tag. Ids that are empty or not valid
|
|
|
50
50
|
function canonicalizeLocaleId(localeId: string | null | undefined): string;
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
## `formatGregorianDateRangeToLocaleString`
|
|
54
|
+
|
|
55
|
+
Function.
|
|
56
|
+
|
|
57
|
+
Formats the span between two dates in the Gregorian calendar, with the locale's own range pattern: the parts both
|
|
58
|
+
dates share are written once, as in "November – December 2026" or "Nov 3 – 9, 2026".
|
|
59
|
+
Without `Intl.DateTimeFormat.prototype.formatRange`, the two dates are joined with an en dash.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
function formatGregorianDateRangeToLocaleString(start: Date, end: Date, localeId: string, options: Intl.DateTimeFormatOptions): string;
|
|
63
|
+
```
|
|
64
|
+
|
|
53
65
|
## `formatGregorianDateToLocaleString`
|
|
54
66
|
|
|
55
67
|
Function.
|
|
@@ -559,6 +571,36 @@ Interface.
|
|
|
559
571
|
|
|
560
572
|
**Used by:** [`MonaLocaleMessages`](i18n.md#monalocalemessages), [`TREE_VIEW_DEFAULT_MESSAGES`](tree-view.md#tree-view-default-messages)
|
|
561
573
|
|
|
574
|
+
## `MonaFormFieldMessages`
|
|
575
|
+
|
|
576
|
+
Interface.
|
|
577
|
+
|
|
578
|
+
The form field's optional marker and the error messages it shows for the built-in signal forms validators. A
|
|
579
|
+
validator's own `message` wins over these.
|
|
580
|
+
|
|
581
|
+
### Properties
|
|
582
|
+
|
|
583
|
+
| Name | Type | Description |
|
|
584
|
+
| --- | --- | --- |
|
|
585
|
+
| `email` (read-only) | `string` | For an `email` error. |
|
|
586
|
+
| `invalid` (read-only) | `string` | For an error of a kind without a message of its own, such as a custom validator's or a parse error. |
|
|
587
|
+
| `optional` (read-only) | `string` | Shown after the label of a field marked `optional`. |
|
|
588
|
+
| `pattern` (read-only) | `string` | For a `pattern` error. |
|
|
589
|
+
| `required` (read-only) | `string` | For a `required` error. |
|
|
590
|
+
|
|
591
|
+
### Methods
|
|
592
|
+
|
|
593
|
+
| Signature | Description |
|
|
594
|
+
| --- | --- |
|
|
595
|
+
| `max(max: number): string` | For a `max` error. |
|
|
596
|
+
| `maxDate(maxDate: string): string` | For a `maxDate` error, with the date formatted in the locale. |
|
|
597
|
+
| `maxLength(maxLength: number): string` | For a `maxLength` error. |
|
|
598
|
+
| `min(min: number): string` | For a `min` error. |
|
|
599
|
+
| `minDate(minDate: string): string` | For a `minDate` error, with the date formatted in the locale. |
|
|
600
|
+
| `minLength(minLength: number): string` | For a `minLength` error. |
|
|
601
|
+
|
|
602
|
+
**Used by:** [`MonaLocaleMessages`](i18n.md#monalocalemessages)
|
|
603
|
+
|
|
562
604
|
## `MonaChipMessages`
|
|
563
605
|
|
|
564
606
|
Interface.
|
|
@@ -571,6 +613,38 @@ Interface.
|
|
|
571
613
|
|
|
572
614
|
**Used by:** [`MonaLocaleMessages`](i18n.md#monalocalemessages)
|
|
573
615
|
|
|
616
|
+
## `MonaDateRangePickerMessages`
|
|
617
|
+
|
|
618
|
+
Interface.
|
|
619
|
+
|
|
620
|
+
The date range picker's popup name, its calendar button, the names of its two inputs, and its quick ranges.
|
|
621
|
+
|
|
622
|
+
### Properties
|
|
623
|
+
|
|
624
|
+
| Name | Type | Description |
|
|
625
|
+
| --- | --- | --- |
|
|
626
|
+
| `dateRangePicker` (read-only) | `string` | The name of the popup that holds the calendar. |
|
|
627
|
+
| `end` (read-only) | `string` | The name of the input for the range's last day. |
|
|
628
|
+
| `lastMonth` (read-only) | `string` | The `lastMonth` quick range. |
|
|
629
|
+
| `lastWeek` (read-only) | `string` | The `lastWeek` quick range. |
|
|
630
|
+
| `lastYear` (read-only) | `string` | The `lastYear` quick range. |
|
|
631
|
+
| `openCalendar` (read-only) | `string` | The name of the button that opens the calendar. |
|
|
632
|
+
| `presets` (read-only) | `string` | The name of the group of quick ranges beside the calendar. |
|
|
633
|
+
| `start` (read-only) | `string` | The name of the input for the range's first day. |
|
|
634
|
+
| `thisMonth` (read-only) | `string` | The `thisMonth` quick range. |
|
|
635
|
+
| `thisWeek` (read-only) | `string` | The `thisWeek` quick range. |
|
|
636
|
+
| `thisYear` (read-only) | `string` | The `thisYear` quick range. |
|
|
637
|
+
| `today` (read-only) | `string` | The `today` quick range. |
|
|
638
|
+
| `yesterday` (read-only) | `string` | The `yesterday` quick range. |
|
|
639
|
+
|
|
640
|
+
### Methods
|
|
641
|
+
|
|
642
|
+
| Signature | Description |
|
|
643
|
+
| --- | --- |
|
|
644
|
+
| `lastDays(count: number): string` | The `last7Days` and `last30Days` quick ranges: the days up to and including today. |
|
|
645
|
+
|
|
646
|
+
**Used by:** [`DATE_RANGE_PICKER_DEFAULT_MESSAGES`](date-range-picker.md#date-range-picker-default-messages), [`DateRangePickerMessages`](i18n.md#daterangepickermessages), [`MonaLocaleMessages`](i18n.md#monalocalemessages)
|
|
647
|
+
|
|
574
648
|
## `MonaListMessages`
|
|
575
649
|
|
|
576
650
|
Interface.
|
|
@@ -1156,12 +1230,14 @@ Interface.
|
|
|
1156
1230
|
| `comboBox` | `MonaComboBoxMessages` |
|
|
1157
1231
|
| `command` | `MonaCommandMessages` |
|
|
1158
1232
|
| `datePicker` | `MonaDatePickerMessages` |
|
|
1233
|
+
| `dateRangePicker` | `MonaDateRangePickerMessages` |
|
|
1159
1234
|
| `dateTimePicker` | `MonaDateTimePickerMessages` |
|
|
1160
1235
|
| `dialog` | `MonaDialogMessages` |
|
|
1161
1236
|
| `dropdownList` | `MonaDropdownListMessages` |
|
|
1162
1237
|
| `dropdowns` | `MonaDropdownsMessages` |
|
|
1163
1238
|
| `editor` | `MonaEditorMessages` |
|
|
1164
1239
|
| `filter` | `MonaFilterMessages` |
|
|
1240
|
+
| `formField` | `MonaFormFieldMessages` |
|
|
1165
1241
|
| `grid` | `MonaGridMessages` |
|
|
1166
1242
|
| `label` | `MonaLabelMessages` |
|
|
1167
1243
|
| `list` | `MonaListMessages` |
|
|
@@ -1577,6 +1653,14 @@ Type alias.
|
|
|
1577
1653
|
type DatePickerMessages = MonaDatePickerMessages;
|
|
1578
1654
|
```
|
|
1579
1655
|
|
|
1656
|
+
## `DateRangePickerMessages`
|
|
1657
|
+
|
|
1658
|
+
Type alias.
|
|
1659
|
+
|
|
1660
|
+
```typescript
|
|
1661
|
+
type DateRangePickerMessages = MonaDateRangePickerMessages;
|
|
1662
|
+
```
|
|
1663
|
+
|
|
1580
1664
|
## `DateTimePickerMessages`
|
|
1581
1665
|
|
|
1582
1666
|
Type alias.
|
package/docs/api/list.md
CHANGED
|
@@ -70,7 +70,7 @@ Type alias.
|
|
|
70
70
|
type ListSizeInputType = ListSizeType | number;
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
**Used by:** [`AutoCompleteComponent`](auto-complete.md#autocompletecomponent), [`ComboBoxComponent`](combo-box.md#comboboxcomponent), [`DatePickerComponent`](date-picker.md#datepickercomponent), [`DateTimePickerComponent`](datetime-picker.md#datetimepickercomponent), [`DropdownListComponent`](dropdown-list.md#dropdownlistcomponent), [`MultiSelectComponent`](multi-select.md#multiselectcomponent), [`TimePickerComponent`](time-picker.md#timepickercomponent)
|
|
73
|
+
**Used by:** [`AutoCompleteComponent`](auto-complete.md#autocompletecomponent), [`ComboBoxComponent`](combo-box.md#comboboxcomponent), [`DatePickerComponent`](date-picker.md#datepickercomponent), [`DateRangePickerComponent`](date-range-picker.md#daterangepickercomponent), [`DateTimePickerComponent`](datetime-picker.md#datetimepickercomponent), [`DropdownListComponent`](dropdown-list.md#dropdownlistcomponent), [`MultiSelectComponent`](multi-select.md#multiselectcomponent), [`TimePickerComponent`](time-picker.md#timepickercomponent)
|
|
74
74
|
|
|
75
75
|
## `ListSizeType`
|
|
76
76
|
|