@nanahoshi/mona-ui 0.27.1 → 0.27.2
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/docs/api/auto-complete.md +67 -0
- package/docs/api/avatar.md +31 -0
- package/docs/api/breadcrumb.md +74 -0
- package/docs/api/button-group.md +71 -0
- package/docs/api/button.md +84 -0
- package/docs/api/calendar.md +123 -0
- package/docs/api/card.md +97 -0
- package/docs/api/chart.md +4380 -0
- package/docs/api/check-box.md +70 -0
- package/docs/api/chip.md +55 -0
- package/docs/api/circular-progress-bar.md +71 -0
- package/docs/api/collapsible.md +71 -0
- package/docs/api/color-gradient.md +54 -0
- package/docs/api/color-palette.md +52 -0
- package/docs/api/color-picker.md +89 -0
- package/docs/api/combo-box.md +69 -0
- package/docs/api/command.md +282 -0
- package/docs/api/common.md +599 -0
- package/docs/api/contextmenu.md +239 -0
- package/docs/api/date-input.md +119 -0
- package/docs/api/date-picker.md +67 -0
- package/docs/api/datetime-picker.md +72 -0
- package/docs/api/dialog.md +291 -0
- package/docs/api/dropdown-button.md +248 -0
- package/docs/api/dropdown-list.md +72 -0
- package/docs/api/dropdowns.md +172 -0
- package/docs/api/editor.md +117 -0
- package/docs/api/expansion-panel.md +85 -0
- package/docs/api/fieldset.md +33 -0
- package/docs/api/filter.md +116 -0
- package/docs/api/grid.md +1445 -0
- package/docs/api/i18n.md +1699 -0
- package/docs/api/label.md +58 -0
- package/docs/api/list-box.md +301 -0
- package/docs/api/list-view.md +294 -0
- package/docs/api/list.md +119 -0
- package/docs/api/locales.md +134 -0
- package/docs/api/menubar.md +275 -0
- package/docs/api/multi-select.md +92 -0
- package/docs/api/notification.md +164 -0
- package/docs/api/numeric-text-box.md +130 -0
- package/docs/api/otp-input.md +100 -0
- package/docs/api/pager.md +371 -0
- package/docs/api/placeholder.md +18 -0
- package/docs/api/popover.md +170 -0
- package/docs/api/popup-menu.md +328 -0
- package/docs/api/popup.md +299 -0
- package/docs/api/progress-bar.md +79 -0
- package/docs/api/query.md +367 -0
- package/docs/api/radio-button.md +113 -0
- package/docs/api/rating.md +187 -0
- package/docs/api/scroll-view.md +93 -0
- package/docs/api/segmented.md +114 -0
- package/docs/api/sheet.md +65 -0
- package/docs/api/sidebar.md +583 -0
- package/docs/api/skeleton.md +26 -0
- package/docs/api/slider.md +173 -0
- package/docs/api/spinner.md +132 -0
- package/docs/api/split-button.md +261 -0
- package/docs/api/splitter.md +57 -0
- package/docs/api/stepper.md +148 -0
- package/docs/api/switch.md +78 -0
- package/docs/api/tabs.md +139 -0
- package/docs/api/text-area.md +20 -0
- package/docs/api/text-box.md +106 -0
- package/docs/api/theme.md +627 -0
- package/docs/api/time-picker.md +69 -0
- package/docs/api/time-selector.md +54 -0
- package/docs/api/tooltip.md +112 -0
- package/docs/api/tree-view.md +631 -0
- package/docs/api/window.md +245 -0
- package/docs/auto-complete.md +28 -329
- package/docs/avatar.md +4 -24
- package/docs/breadcrumb.md +10 -65
- package/docs/button-group.md +7 -60
- package/docs/button.md +8 -67
- package/docs/calendar.md +16 -121
- package/docs/card.md +16 -79
- package/docs/chart-bar.md +16 -234
- package/docs/chart-financial.md +10 -121
- package/docs/chart-funnel.md +13 -176
- package/docs/chart-heatmap.md +15 -131
- package/docs/chart-line-area.md +12 -137
- package/docs/chart-pie.md +17 -221
- package/docs/chart-radar.md +13 -129
- package/docs/chart-radial.md +13 -211
- package/docs/chart-scatter.md +6 -74
- package/docs/chart-treemap.md +14 -196
- package/docs/chart.md +154 -1892
- package/docs/checkbox.md +5 -61
- package/docs/chip.md +7 -42
- package/docs/circular-progress-bar.md +9 -61
- package/docs/collapsible.md +5 -87
- package/docs/color-gradient.md +8 -81
- package/docs/color-palette.md +7 -69
- package/docs/color-picker.md +9 -105
- package/docs/combo-box.md +28 -331
- package/docs/command.md +25 -236
- package/docs/contextmenu.md +15 -140
- package/docs/date-picker.md +7 -110
- package/docs/datetime-picker.md +7 -129
- package/docs/decimal-textbox.md +6 -69
- package/docs/dialog.md +23 -263
- package/docs/dropdown-button.md +15 -146
- package/docs/dropdown-list.md +29 -332
- package/docs/editor.md +8 -164
- package/docs/expansion-panel.md +7 -69
- package/docs/fieldset.md +5 -24
- package/docs/grid-columns.md +12 -92
- package/docs/grid-editing.md +29 -291
- package/docs/grid-grouping.md +11 -50
- package/docs/grid-rows.md +10 -74
- package/docs/grid-selection.md +7 -36
- package/docs/grid-server.md +8 -293
- package/docs/grid-sorting-filtering.md +10 -333
- package/docs/grid-state-export.md +17 -228
- package/docs/grid.md +23 -216
- package/docs/input.md +7 -19
- package/docs/label.md +8 -39
- package/docs/list-box.md +21 -253
- package/docs/list-view.md +25 -232
- package/docs/menubar.md +21 -167
- package/docs/multi-select.md +31 -350
- package/docs/notification.md +17 -116
- package/docs/numeric-textbox.md +9 -78
- package/docs/otp-input.md +9 -95
- package/docs/pager.md +19 -239
- package/docs/placeholder.md +5 -18
- package/docs/popover.md +13 -123
- package/docs/popup-menu.md +22 -243
- package/docs/popup.md +24 -248
- package/docs/progress-bar.md +10 -75
- package/docs/radio-button.md +8 -96
- package/docs/range-slider.md +9 -82
- package/docs/rating.md +15 -163
- package/docs/scroll-view.md +9 -86
- package/docs/segmented.md +8 -90
- package/docs/sheet.md +10 -74
- package/docs/sidebar-menus.md +20 -155
- package/docs/sidebar-state.md +16 -134
- package/docs/sidebar.md +18 -218
- package/docs/skeleton.md +5 -26
- package/docs/slider.md +9 -97
- package/docs/spinner.md +15 -95
- package/docs/split-button.md +21 -166
- package/docs/splitter.md +9 -56
- package/docs/stepper.md +13 -127
- package/docs/switch.md +8 -58
- package/docs/tabs.md +13 -111
- package/docs/textarea.md +4 -13
- package/docs/textbox.md +10 -77
- package/docs/time-picker.md +7 -112
- package/docs/tooltip-directive.md +12 -96
- package/docs/tooltip.md +12 -96
- package/docs/tree-view.md +42 -495
- package/docs/window.md +19 -230
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +1 -0
- package/fesm2022/nanahoshi-mona-ui-common.mjs +3 -0
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +13 -1
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +5 -0
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +9 -0
- package/llms.txt +74 -0
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-collapsible.d.ts +2 -0
- package/types/nanahoshi-mona-ui-common.d.ts +6 -0
- package/types/nanahoshi-mona-ui-date-input.d.ts +18 -1
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +6 -0
- package/types/nanahoshi-mona-ui-i18n.d.ts +12 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# `@nanahoshi/mona-ui/contextmenu`
|
|
2
|
+
|
|
3
|
+
Everything `@nanahoshi/mona-ui/contextmenu` exports.
|
|
4
|
+
|
|
5
|
+
**Guides:** [Context Menu](../contextmenu.md)
|
|
6
|
+
|
|
7
|
+
## `ContextMenuComponent`
|
|
8
|
+
|
|
9
|
+
Component.
|
|
10
|
+
|
|
11
|
+
**Selector:** `mona-contextmenu`
|
|
12
|
+
|
|
13
|
+
### Inputs
|
|
14
|
+
|
|
15
|
+
| Name | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `aria-label` | `string` | `""` | Accessible name for the menu. When empty, the menu is named by the target if it has an `id`. |
|
|
18
|
+
| `items` | `Iterable<PopupMenuItem>` | `[]` | The menu items to render. When provided, these take precedence over content-projected `mona-contextmenu-item` (and related) components. |
|
|
19
|
+
| `minWidth` | `string \| number` | — | Sets the minimum width of the context menu. This will be applied to the root menu and all submenus. |
|
|
20
|
+
| `rounded` | `"large" \| "medium" \| "none" \| "small"` | `"medium"` | Sets the rounded state of the context menu. |
|
|
21
|
+
| `size` | `"large" \| "medium" \| "small"` | `"medium"` | Sets the size of the context menu. |
|
|
22
|
+
| `target` (required) | `ElementRef<HTMLElement> \| HTMLElement` | — | The target element that will be used to trigger the context menu. It can change: the menu, its keyboard shortcuts and its ARIA attributes follow. `aria-haspopup`, `aria-expanded` and `aria-controls` are set only on targets whose role allows them (button, link, gridcell, menuitem, tab, treeitem), and are put back when the target changes or the menu is destroyed. |
|
|
23
|
+
| `width` | `string \| number` | — | Sets the width of the context menu. This will be applied to the root menu and all submenus. |
|
|
24
|
+
|
|
25
|
+
### Outputs
|
|
26
|
+
|
|
27
|
+
| Name | Type | Description |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `menuClick` | `PopupMenuItemClickEvent` | Emits when a menu item is clicked. |
|
|
30
|
+
|
|
31
|
+
## `ContextMenuCheckboxItemComponent`
|
|
32
|
+
|
|
33
|
+
Component.
|
|
34
|
+
|
|
35
|
+
**Selector:** `mona-contextmenu-checkbox-item`
|
|
36
|
+
**Extends:** `PopupMenuCheckboxItemComponent`
|
|
37
|
+
|
|
38
|
+
### Inputs
|
|
39
|
+
|
|
40
|
+
| Name | Type | Default | Description |
|
|
41
|
+
| --- | --- | --- | --- |
|
|
42
|
+
| `checked` (two-way) | `boolean` | `false` | The checked state of the menu item. Activating the item toggles it (unless its `menuClick` is prevented) and emits `checkedChange`, so it works with or without a two-way binding. |
|
|
43
|
+
| `disabled` | `boolean` | `false` | Sets the disabled state of the menu item. |
|
|
44
|
+
| `label` | `string` | `""` | The text of the menu item. |
|
|
45
|
+
| `value` | `unknown` | — | A value that identifies the item. It's the `value` of the item's `menuClick` events. |
|
|
46
|
+
|
|
47
|
+
### Outputs
|
|
48
|
+
|
|
49
|
+
| Name | Type | Description |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| `checkedChange` | `boolean` | Emitted when `checked` changes. |
|
|
52
|
+
| `menuClick` | `PopupMenuItemClickEvent` | The click event of the menu item. Emits when the menu item is selected by keyboard or mouse. |
|
|
53
|
+
|
|
54
|
+
### Inherited from `PopupMenuCheckboxItemComponent`
|
|
55
|
+
|
|
56
|
+
**Inputs**
|
|
57
|
+
|
|
58
|
+
| Name | Type | Default | Description |
|
|
59
|
+
| --- | --- | --- | --- |
|
|
60
|
+
| `checked` (two-way) | `boolean` | `false` | The checked state of the menu item. Activating the item toggles it (unless its `menuClick` is prevented) and emits `checkedChange`, so it works with or without a two-way binding. |
|
|
61
|
+
| `disabled` | `boolean` | `false` | Sets the disabled state of the menu item. |
|
|
62
|
+
| `label` | `string` | `""` | The text of the menu item. |
|
|
63
|
+
| `value` | `unknown` | — | A value that identifies the item. It's the `value` of the item's `menuClick` events. |
|
|
64
|
+
|
|
65
|
+
**Outputs**
|
|
66
|
+
|
|
67
|
+
| Name | Type | Description |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| `checkedChange` | `boolean` | Emitted when `checked` changes. |
|
|
70
|
+
| `menuClick` | `PopupMenuItemClickEvent` | The click event of the menu item. Emits when the menu item is selected by keyboard or mouse. |
|
|
71
|
+
|
|
72
|
+
## `ContextMenuItemComponent`
|
|
73
|
+
|
|
74
|
+
Component.
|
|
75
|
+
|
|
76
|
+
**Selector:** `mona-contextmenu-item`
|
|
77
|
+
**Extends:** `PopupMenuItemComponent`
|
|
78
|
+
|
|
79
|
+
### Inputs
|
|
80
|
+
|
|
81
|
+
| Name | Type | Default | Description |
|
|
82
|
+
| --- | --- | --- | --- |
|
|
83
|
+
| `disabled` | `boolean` | `false` | Sets the disabled state of the menu item. |
|
|
84
|
+
| `label` | `string` | `""` | The text of the menu item. |
|
|
85
|
+
| `value` | `unknown` | — | A value that identifies the item. It's the `value` of the item's `menuClick` events, so handlers don't depend on the label's text. |
|
|
86
|
+
|
|
87
|
+
### Outputs
|
|
88
|
+
|
|
89
|
+
| Name | Type | Description |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| `menuClick` | `PopupMenuItemClickEvent` | The click event of the menu item. Emits when the menu item is selected by keyboard or mouse. |
|
|
92
|
+
|
|
93
|
+
### Inherited from `PopupMenuItemComponent`
|
|
94
|
+
|
|
95
|
+
**Inputs**
|
|
96
|
+
|
|
97
|
+
| Name | Type | Default | Description |
|
|
98
|
+
| --- | --- | --- | --- |
|
|
99
|
+
| `disabled` | `boolean` | `false` | Sets the disabled state of the menu item. |
|
|
100
|
+
| `label` | `string` | `""` | The text of the menu item. |
|
|
101
|
+
| `value` | `unknown` | — | A value that identifies the item. It's the `value` of the item's `menuClick` events, so handlers don't depend on the label's text. |
|
|
102
|
+
|
|
103
|
+
**Outputs**
|
|
104
|
+
|
|
105
|
+
| Name | Type | Description |
|
|
106
|
+
| --- | --- | --- |
|
|
107
|
+
| `menuClick` | `PopupMenuItemClickEvent` | The click event of the menu item. Emits when the menu item is selected by keyboard or mouse. |
|
|
108
|
+
|
|
109
|
+
## `ContextMenuRadioItemComponent`
|
|
110
|
+
|
|
111
|
+
Component.
|
|
112
|
+
|
|
113
|
+
**Selector:** `mona-contextmenu-radio-item`
|
|
114
|
+
**Extends:** `PopupMenuRadioItemComponent`
|
|
115
|
+
|
|
116
|
+
### Inputs
|
|
117
|
+
|
|
118
|
+
| Name | Type | Default | Description |
|
|
119
|
+
| --- | --- | --- | --- |
|
|
120
|
+
| `disabled` | `boolean` | `false` | Sets the disabled state of the menu item. |
|
|
121
|
+
| `label` | `string` | `""` | The text of the menu item. |
|
|
122
|
+
| `value` (required) | `string` | — | The value of the radio item. |
|
|
123
|
+
|
|
124
|
+
### Outputs
|
|
125
|
+
|
|
126
|
+
| Name | Type | Description |
|
|
127
|
+
| --- | --- | --- |
|
|
128
|
+
| `menuClick` | `PopupMenuItemClickEvent` | The click event of the menu item. Emits when the menu item is selected by keyboard or mouse, before the radio group selects it. Preventing it keeps the group's value and the menu open. |
|
|
129
|
+
|
|
130
|
+
### Inherited from `PopupMenuRadioItemComponent`
|
|
131
|
+
|
|
132
|
+
**Inputs**
|
|
133
|
+
|
|
134
|
+
| Name | Type | Default | Description |
|
|
135
|
+
| --- | --- | --- | --- |
|
|
136
|
+
| `disabled` | `boolean` | `false` | Sets the disabled state of the menu item. |
|
|
137
|
+
| `label` | `string` | `""` | The text of the menu item. |
|
|
138
|
+
| `value` (required) | `string` | — | The value of the radio item. |
|
|
139
|
+
|
|
140
|
+
**Outputs**
|
|
141
|
+
|
|
142
|
+
| Name | Type | Description |
|
|
143
|
+
| --- | --- | --- |
|
|
144
|
+
| `menuClick` | `PopupMenuItemClickEvent` | The click event of the menu item. Emits when the menu item is selected by keyboard or mouse, before the radio group selects it. Preventing it keeps the group's value and the menu open. |
|
|
145
|
+
|
|
146
|
+
## `ContextMenuRadioGroupComponent`
|
|
147
|
+
|
|
148
|
+
Component.
|
|
149
|
+
|
|
150
|
+
**Selector:** `mona-contextmenu-radio-group`
|
|
151
|
+
**Extends:** `PopupMenuRadioGroupComponent`
|
|
152
|
+
|
|
153
|
+
### Inputs
|
|
154
|
+
|
|
155
|
+
| Name | Type | Default | Description |
|
|
156
|
+
| --- | --- | --- | --- |
|
|
157
|
+
| `title` | `string` | `""` | The title of the radio group. |
|
|
158
|
+
| `value` (two-way) | `string` | `""` | The value of the selected radio item. |
|
|
159
|
+
|
|
160
|
+
### Outputs
|
|
161
|
+
|
|
162
|
+
| Name | Type | Description |
|
|
163
|
+
| --- | --- | --- |
|
|
164
|
+
| `valueChange` | `string` | Emitted when `value` changes. |
|
|
165
|
+
|
|
166
|
+
### Inherited from `PopupMenuRadioGroupComponent`
|
|
167
|
+
|
|
168
|
+
**Inputs**
|
|
169
|
+
|
|
170
|
+
| Name | Type | Default | Description |
|
|
171
|
+
| --- | --- | --- | --- |
|
|
172
|
+
| `title` | `string` | `""` | The title of the radio group. |
|
|
173
|
+
| `value` (two-way) | `string` | `""` | The value of the selected radio item. |
|
|
174
|
+
|
|
175
|
+
**Outputs**
|
|
176
|
+
|
|
177
|
+
| Name | Type | Description |
|
|
178
|
+
| --- | --- | --- |
|
|
179
|
+
| `valueChange` | `string` | Emitted when `value` changes. |
|
|
180
|
+
|
|
181
|
+
## `ContextMenuGroupComponent`
|
|
182
|
+
|
|
183
|
+
Component.
|
|
184
|
+
|
|
185
|
+
**Selector:** `mona-contextmenu-group`
|
|
186
|
+
**Extends:** `PopupMenuGroupComponent`
|
|
187
|
+
|
|
188
|
+
### Inputs
|
|
189
|
+
|
|
190
|
+
| Name | Type | Default | Description |
|
|
191
|
+
| --- | --- | --- | --- |
|
|
192
|
+
| `title` | `string` | — | Sets the title of the menu group. |
|
|
193
|
+
|
|
194
|
+
### Inherited from `PopupMenuGroupComponent`
|
|
195
|
+
|
|
196
|
+
**Inputs**
|
|
197
|
+
|
|
198
|
+
| Name | Type | Default | Description |
|
|
199
|
+
| --- | --- | --- | --- |
|
|
200
|
+
| `title` | `string` | — | Sets the title of the menu group. |
|
|
201
|
+
|
|
202
|
+
## `ContextMenuSeparatorComponent`
|
|
203
|
+
|
|
204
|
+
Component.
|
|
205
|
+
|
|
206
|
+
Renders a horizontal visual divider between items.
|
|
207
|
+
|
|
208
|
+
**Selector:** `mona-contextmenu-separator`
|
|
209
|
+
**Extends:** `PopupMenuSeparatorComponent`
|
|
210
|
+
|
|
211
|
+
## `ContextMenuGroupTemplateDirective`
|
|
212
|
+
|
|
213
|
+
Directive.
|
|
214
|
+
|
|
215
|
+
Customizes a group header's content.
|
|
216
|
+
|
|
217
|
+
**Selector:** `ng-template[monaContextMenuGroupTemplate]`
|
|
218
|
+
**Extends:** `PopupMenuGroupTemplateDirective`
|
|
219
|
+
|
|
220
|
+
## `ContextMenuIconTemplateDirective`
|
|
221
|
+
|
|
222
|
+
Directive.
|
|
223
|
+
|
|
224
|
+
**Selector:** `ng-template[monaContextMenuIconTemplate]`
|
|
225
|
+
**Extends:** `PopupMenuIconTemplateDirective`
|
|
226
|
+
|
|
227
|
+
## `ContextMenuShortcutTemplateDirective`
|
|
228
|
+
|
|
229
|
+
Directive.
|
|
230
|
+
|
|
231
|
+
**Selector:** `ng-template[monaContextMenuShortcutTemplate]`
|
|
232
|
+
**Extends:** `PopupMenuShortcutTemplateDirective`
|
|
233
|
+
|
|
234
|
+
## `ContextMenuTextTemplateDirective`
|
|
235
|
+
|
|
236
|
+
Directive.
|
|
237
|
+
|
|
238
|
+
**Selector:** `ng-template[monaContextMenuTextTemplate]`
|
|
239
|
+
**Extends:** `PopupMenuTextTemplateDirective`
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# `@nanahoshi/mona-ui/date-input`
|
|
2
|
+
|
|
3
|
+
Everything `@nanahoshi/mona-ui/date-input` exports.
|
|
4
|
+
|
|
5
|
+
## `DateInputPrefixTemplateDirective`
|
|
6
|
+
|
|
7
|
+
Directive.
|
|
8
|
+
|
|
9
|
+
**Selector:** `ng-template[monaDateInputPrefixTemplate]`
|
|
10
|
+
|
|
11
|
+
## `checkTypedDate`
|
|
12
|
+
|
|
13
|
+
Function.
|
|
14
|
+
|
|
15
|
+
Checks a typed date against a picker's min, max and `disabledDates`, the same limits its popup applies.
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
function checkTypedDate(date: Date, constraints: TypedDateConstraints): ValidationError.WithoutFieldTree | null;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## `parseTypedDate`
|
|
22
|
+
|
|
23
|
+
Function.
|
|
24
|
+
|
|
25
|
+
Parses text typed into a picker. The input format is tried first, then the same format with one-digit months, days,
|
|
26
|
+
hours, minutes and seconds ("1/5/2025", "9:05"), then with a two-digit year ("1/5/25"). Two-digit years up to 60
|
|
27
|
+
read as 20xx, later ones as 19xx.
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
function parseTypedDate(text: string, format: string, localeId: string): DateTime | null;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## `typedDateParseError`
|
|
34
|
+
|
|
35
|
+
Function.
|
|
36
|
+
|
|
37
|
+
The error reported for text that doesn't parse.
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
function typedDateParseError(): TypedDateParseError;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## `DisabledDateError`
|
|
44
|
+
|
|
45
|
+
Interface.
|
|
46
|
+
|
|
47
|
+
The error a picker reports when the typed date is one of its `disabledDates`.
|
|
48
|
+
|
|
49
|
+
**Extends:** `ValidationError.WithoutFieldTree`
|
|
50
|
+
|
|
51
|
+
### Properties
|
|
52
|
+
|
|
53
|
+
| Name | Type |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `date` (read-only) | `Date` |
|
|
56
|
+
| `kind` (read-only) | `"disabledDate"` |
|
|
57
|
+
|
|
58
|
+
## `TypedDateConstraints`
|
|
59
|
+
|
|
60
|
+
Interface.
|
|
61
|
+
|
|
62
|
+
### Properties
|
|
63
|
+
|
|
64
|
+
| Name | Type |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| `disabledDates?` (read-only) | `DateDisabledType` |
|
|
67
|
+
| `max?` (read-only) | `Date \| null` |
|
|
68
|
+
| `min?` (read-only) | `Date \| null` |
|
|
69
|
+
| `unit` (read-only) | `TypedDateUnit` |
|
|
70
|
+
|
|
71
|
+
**Used by:** [`checkTypedDate`](date-input.md#checktypeddate)
|
|
72
|
+
|
|
73
|
+
## `TypedDateParseError`
|
|
74
|
+
|
|
75
|
+
Interface.
|
|
76
|
+
|
|
77
|
+
The error a picker reports when the typed text isn't a date in the input format.
|
|
78
|
+
|
|
79
|
+
**Extends:** `ValidationError.WithoutFieldTree`
|
|
80
|
+
|
|
81
|
+
### Properties
|
|
82
|
+
|
|
83
|
+
| Name | Type |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `kind` (read-only) | `"parse"` |
|
|
86
|
+
|
|
87
|
+
**Used by:** [`typedDateParseError`](date-input.md#typeddateparseerror)
|
|
88
|
+
|
|
89
|
+
## `DateDisabledType`
|
|
90
|
+
|
|
91
|
+
Type alias.
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
type DateDisabledType = Iterable<Date> | Predicate<Date> | null | undefined;
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Used by:** [`CalendarComponent`](calendar.md#calendarcomponent), [`DatePickerComponent`](date-picker.md#datepickercomponent), [`DateTimePickerComponent`](datetime-picker.md#datetimepickercomponent), [`TypedDateConstraints`](date-input.md#typeddateconstraints)
|
|
98
|
+
|
|
99
|
+
## `HourFormat`
|
|
100
|
+
|
|
101
|
+
Type alias.
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
type HourFormat = "12" | "24";
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Used by:** [`DateTimePickerComponent`](datetime-picker.md#datetimepickercomponent), [`TimePickerComponent`](time-picker.md#timepickercomponent), [`TimeSelectorComponent`](time-selector.md#timeselectorcomponent)
|
|
108
|
+
|
|
109
|
+
## `TypedDateUnit`
|
|
110
|
+
|
|
111
|
+
Type alias.
|
|
112
|
+
|
|
113
|
+
Which part of the typed value min, max and `disabledDates` apply to.
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
type TypedDateUnit = "date" | "datetime" | "time";
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Used by:** [`TypedDateConstraints`](date-input.md#typeddateconstraints)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# `@nanahoshi/mona-ui/date-picker`
|
|
2
|
+
|
|
3
|
+
Everything `@nanahoshi/mona-ui/date-picker` exports.
|
|
4
|
+
|
|
5
|
+
**Guides:** [Date Picker](../date-picker.md)
|
|
6
|
+
|
|
7
|
+
## `DatePickerComponent`
|
|
8
|
+
|
|
9
|
+
Component.
|
|
10
|
+
|
|
11
|
+
**Selector:** `mona-date-picker`
|
|
12
|
+
**Implements:** `FormValueControl<Date \| null>`
|
|
13
|
+
|
|
14
|
+
### Inputs
|
|
15
|
+
|
|
16
|
+
| Name | Type | Default | Description |
|
|
17
|
+
| --- | --- | --- | --- |
|
|
18
|
+
| `aria-describedby` | `string` | `""` | Id of an element that describes the input, such as a hint or an error message. |
|
|
19
|
+
| `aria-label` | `string` | `""` | Accessible name of the input. Prefer a visible label, linked through `inputId` or `aria-labelledby`; the placeholder is not a label. |
|
|
20
|
+
| `aria-labelledby` | `string` | `""` | Id of the element that labels the input. |
|
|
21
|
+
| `class` | `string` | `""` | Extra classes for the input's container. |
|
|
22
|
+
| `disabled` | `boolean` | `false` | Sets the disabled state of the date picker. |
|
|
23
|
+
| `disabledDates` | `DateDisabledType` | — | Sets the disabled dates of the date picker. Accepts either an iterable of Date objects or a predicate function. Typing a disabled date is reported as a `disabledDate` error instead of setting the value. |
|
|
24
|
+
| `firstDay` | `FirstDayOfWeek \| null` | `null` | Sets the first day of the week. If not specified, derives from the active locale. |
|
|
25
|
+
| `format` | `string \| null` | `null` | Sets the date format of the date picker. If not specified, derives from the active locale. Typed text is also accepted with one-digit days and months and a two-digit year. |
|
|
26
|
+
| `inputId` | `string` | `generated` | Id of the inner `<input>` element. Point a `<label for>` or `<mona-label for>` at it to label the date picker. A unique id is generated when it isn't set. |
|
|
27
|
+
| `invalid` | `boolean` | `false` | Marks the date picker as invalid. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
28
|
+
| `max` | `Date \| undefined` | `undefined` | Sets the maximum date of the date picker. A later typed date is reported as a `maxDate` error. |
|
|
29
|
+
| `min` | `Date \| undefined` | `undefined` | Sets the minimum date of the date picker. An earlier typed date is reported as a `minDate` error. |
|
|
30
|
+
| `placeholder` | `string` | `""` | Sets the placeholder of the date picker. |
|
|
31
|
+
| `popupClass` | `string` | `""` | Sets the class of the popup element. |
|
|
32
|
+
| `popupHeight` | `ListSizeInputType` | `""` | Sets the height of the popup element. When empty, the popup fits the calendar. |
|
|
33
|
+
| `popupWidth` | `ListSizeInputType` | `""` | Sets the width of the popup element. When empty, the popup fits the calendar. |
|
|
34
|
+
| `readonly` | `boolean` | `false` | Sets the readonly state of the date picker. |
|
|
35
|
+
| `readonlyInput` | `boolean` | `false` | When true, the input is readonly but the calendar button remains enabled. |
|
|
36
|
+
| `required` | `boolean` | `false` | Sets the required state of the date picker. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
37
|
+
| `rounded` | `"full" \| "large" \| "medium" \| "none" \| "small"` | `"medium"` | Sets the border radius of the date picker. |
|
|
38
|
+
| `showClearButton` | `boolean` | `false` | Sets the visibility of the clear button. Clearing empties the value at once. |
|
|
39
|
+
| `size` | `"large" \| "medium" \| "small"` | `"medium"` | Sets the size of the date picker. |
|
|
40
|
+
| `touched` | `boolean` | `false` | Sets the touched state of the date picker. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
41
|
+
| `value` (two-way) | `Date \| null` | `null` | Two-way bindable current date value. Typed text is written on Enter and when the input loses focus; text that isn't a valid date keeps the previous value and marks the field invalid. |
|
|
42
|
+
| `weekNumber` | `boolean` | `false` | Enables the display of week numbers in the calendar. |
|
|
43
|
+
|
|
44
|
+
### Outputs
|
|
45
|
+
|
|
46
|
+
| Name | Type | Description |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| `close` | `PopupCloseEvent<unknown>` | Emits when the popup is about to close. This event is preventable. |
|
|
49
|
+
| `closed` | `void` | Emits after the popup is closed. |
|
|
50
|
+
| `open` | `PreventableEvent<Event>` | Emits when the popup is about to open. This event is preventable. |
|
|
51
|
+
| `opened` | `void` | Emits after the popup is opened. |
|
|
52
|
+
| `touch` | `void` | Emitted when focus leaves the date picker and its popup. The `FormField` directive listens to this to mark the field as touched. |
|
|
53
|
+
| `valueChange` | `Date \| null` | Emitted when `value` changes. |
|
|
54
|
+
|
|
55
|
+
### Methods
|
|
56
|
+
|
|
57
|
+
| Signature | Description |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `focus(options?: FocusOptions): void` | Focuses the input and places the caret after the text. Read-only pickers take focus too. |
|
|
60
|
+
|
|
61
|
+
## `DATE_PICKER_DEFAULT_MESSAGES`
|
|
62
|
+
|
|
63
|
+
Constant.
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
const DATE_PICKER_DEFAULT_MESSAGES: MonaDatePickerMessages;
|
|
67
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# `@nanahoshi/mona-ui/datetime-picker`
|
|
2
|
+
|
|
3
|
+
Everything `@nanahoshi/mona-ui/datetime-picker` exports.
|
|
4
|
+
|
|
5
|
+
**Guides:** [Date Time Picker](../datetime-picker.md)
|
|
6
|
+
|
|
7
|
+
## `DateTimePickerComponent`
|
|
8
|
+
|
|
9
|
+
Component.
|
|
10
|
+
|
|
11
|
+
**Selector:** `mona-datetime-picker`
|
|
12
|
+
**Implements:** `FormValueControl<Date \| null>`
|
|
13
|
+
|
|
14
|
+
### Inputs
|
|
15
|
+
|
|
16
|
+
| Name | Type | Default | Description |
|
|
17
|
+
| --- | --- | --- | --- |
|
|
18
|
+
| `aria-describedby` | `string` | `""` | Id of an element that describes the input, such as a hint or an error message. |
|
|
19
|
+
| `aria-label` | `string` | `""` | Accessible name of the input. Prefer a visible label, linked through `inputId` or `aria-labelledby`; the placeholder is not a label. |
|
|
20
|
+
| `aria-labelledby` | `string` | `""` | Id of the element that labels the input. |
|
|
21
|
+
| `class` | `string` | `""` | Extra classes for the input's container. |
|
|
22
|
+
| `disabled` | `boolean` | `false` | Sets the disabled state of the date time picker. |
|
|
23
|
+
| `disabledDates` | `DateDisabledType` | — | Sets the disabled dates of the date time picker. Accepts either an iterable of Date objects or a predicate function. Typing a disabled date is reported as a `disabledDate` error instead of setting the value. |
|
|
24
|
+
| `firstDay` | `FirstDayOfWeek \| null` | `null` | Sets the first day of the week. If not specified, derives from the active locale. |
|
|
25
|
+
| `format` | `string \| null` | `null` | Sets the date format of the date time picker. If not specified, derives from the active locale, hourFormat, and showSeconds. Typed text is also accepted with one-digit parts and a two-digit year. |
|
|
26
|
+
| `hourFormat` | `HourFormat \| null` | `null` | Sets the hour format of the date time picker. When null, the active locale's clock is used: 12-hour for en-US, 24-hour for de-DE. |
|
|
27
|
+
| `hourStep` | `number` | `1` | Sets the hour step of the time picker. |
|
|
28
|
+
| `inputId` | `string` | `generated` | Id of the inner `<input>` element. Point a `<label for>` or `<mona-label for>` at it to label the date time picker. A unique id is generated when it isn't set. |
|
|
29
|
+
| `invalid` | `boolean` | `false` | Marks the date time picker as invalid. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
30
|
+
| `max` | `Date \| undefined` | `undefined` | Sets the maximum date of the date time picker. A later typed date is reported as a `maxDate` error. |
|
|
31
|
+
| `min` | `Date \| undefined` | `undefined` | Sets the minimum date of the date time picker. An earlier typed date is reported as a `minDate` error. |
|
|
32
|
+
| `minuteStep` | `number` | `1` | Sets the minute step of the time picker. |
|
|
33
|
+
| `placeholder` | `string` | `""` | Sets the placeholder of the date time picker. |
|
|
34
|
+
| `popupClass` | `string` | `""` | Sets the class of the popup element. |
|
|
35
|
+
| `popupHeight` | `ListSizeInputType` | `undefined` | Sets the height of the popup element. When not set, the popup fits its content. |
|
|
36
|
+
| `popupWidth` | `ListSizeInputType` | `undefined` | Sets the width of the popup element. When not set, the popup is at least as wide as the input. |
|
|
37
|
+
| `readonly` | `boolean` | `false` | Sets the readonly state of the date time picker. |
|
|
38
|
+
| `readonlyInput` | `boolean` | `false` | When true, the input is readonly but the popup button remains enabled. |
|
|
39
|
+
| `required` | `boolean` | `false` | Sets the required state of the date time picker. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
40
|
+
| `rounded` | `"full" \| "large" \| "medium" \| "none" \| "small"` | `"medium"` | Sets the border radius of the date time picker. |
|
|
41
|
+
| `secondStep` | `number` | `1` | Sets the second step of the time picker. |
|
|
42
|
+
| `showClearButton` | `boolean` | `false` | Sets the visibility of the clear button. Clearing empties the value at once. |
|
|
43
|
+
| `showSeconds` | `boolean` | `false` | Sets the visibility of the second selector. |
|
|
44
|
+
| `size` | `"large" \| "medium" \| "small"` | `"medium"` | Sets the size of the date time picker. |
|
|
45
|
+
| `touched` | `boolean` | `false` | Sets the touched state of the date time picker. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
|
|
46
|
+
| `value` (two-way) | `Date \| null` | `null` | Two-way bindable current date time value. Typed text is written on Enter and when the input loses focus; text that isn't a valid date and time keeps the previous value and marks the field invalid. |
|
|
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 time picker and its popup. The `FormField` directive listens to this to mark the field as touched. |
|
|
58
|
+
| `valueChange` | `Date \| null` | Emitted when `value` changes. |
|
|
59
|
+
|
|
60
|
+
### Methods
|
|
61
|
+
|
|
62
|
+
| Signature | Description |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| `focus(options?: FocusOptions): void` | Focuses the input and places the caret after the text. Read-only pickers take focus too. |
|
|
65
|
+
|
|
66
|
+
## `DATETIME_PICKER_DEFAULT_MESSAGES`
|
|
67
|
+
|
|
68
|
+
Constant.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
const DATETIME_PICKER_DEFAULT_MESSAGES: MonaDateTimePickerMessages;
|
|
72
|
+
```
|