@nanahoshi/mona-ui 0.38.0 → 0.39.1
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/date-picker.md +2 -0
- package/docs/api/date-range-picker.md +2 -0
- package/docs/api/datetime-picker.md +2 -0
- package/docs/api/dropdowns.md +1 -1
- package/docs/api/time-picker.md +2 -0
- package/docs/api/time-selector.md +1 -1
- package/docs/date-picker.md +5 -1
- package/docs/date-range-picker.md +5 -1
- package/docs/datetime-picker.md +7 -2
- package/docs/time-picker.md +8 -1
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +36 -2
- package/fesm2022/nanahoshi-mona-ui-date-range-picker.mjs +37 -3
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +52 -5
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +39 -10
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +2 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-S2iCn8TV.mjs → nanahoshi-mona-ui-grid-grid-list.component-BoSXXLKQ.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-BUJvgihp.mjs → nanahoshi-mona-ui-grid-grid-row.component-Df2gfS0X.mjs} +3 -1
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-Wndy-_Bt.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-xjrcCXXF.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +6 -4
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +39 -4
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +13 -28
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-date-picker.d.ts +25 -1
- package/types/nanahoshi-mona-ui-date-range-picker.d.ts +26 -1
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +34 -1
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +25 -6
- package/types/nanahoshi-mona-ui-time-picker.d.ts +29 -2
- package/types/nanahoshi-mona-ui-time-selector.d.ts +3 -1
package/docs/api/date-picker.md
CHANGED
|
@@ -15,6 +15,8 @@ Component.
|
|
|
15
15
|
|
|
16
16
|
| Name | Type | Default | Description |
|
|
17
17
|
| --- | --- | --- | --- |
|
|
18
|
+
| `adaptiveMode` | `AdaptiveMode` | `"none"` | Opens the popup as a sheet along the bottom of the screen on a small screen (narrower than 640 pixels) with `"auto"`, so it's easy to reach with a thumb. With `"none"`, it always opens under the field. |
|
|
19
|
+
| `adaptiveTitle` | `string` | `""` | Title of the bottom sheet the popup opens as with `adaptiveMode="auto"`. When empty, the sheet shows the field's name. |
|
|
18
20
|
| `aria-describedby` | `string` | `""` | Id of an element that describes the input, such as a hint or an error message. |
|
|
19
21
|
| `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
22
|
| `aria-labelledby` | `string` | `""` | Id of the element that labels the input. |
|
|
@@ -18,6 +18,8 @@ that shows two months at a time.
|
|
|
18
18
|
|
|
19
19
|
| Name | Type | Default | Description |
|
|
20
20
|
| --- | --- | --- | --- |
|
|
21
|
+
| `adaptiveMode` | `AdaptiveMode` | `"none"` | Opens the popup as a sheet along the bottom of the screen on a small screen (narrower than 640 pixels) with `"auto"`, so it's easy to reach with a thumb. With `"none"`, it always opens under the field. |
|
|
22
|
+
| `adaptiveTitle` | `string` | `""` | Title of the bottom sheet the popup opens as with `adaptiveMode="auto"`. When empty, the sheet shows the field's name. |
|
|
21
23
|
| `aria-describedby` | `string` | `""` | Id of an element that describes the range, such as a hint or an error message. It describes both inputs. |
|
|
22
24
|
| `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
25
|
| `aria-labelledby` | `string` | `""` | Id of the element that labels the range, on the group that holds its two inputs. |
|
|
@@ -15,6 +15,8 @@ Component.
|
|
|
15
15
|
|
|
16
16
|
| Name | Type | Default | Description |
|
|
17
17
|
| --- | --- | --- | --- |
|
|
18
|
+
| `adaptiveMode` | `AdaptiveMode` | `"none"` | Opens the popup as a sheet along the bottom of the screen on a small screen (narrower than 640 pixels) with `"auto"`, so it's easy to reach with a thumb. With `"none"`, it always opens under the field. |
|
|
19
|
+
| `adaptiveTitle` | `string` | `""` | Title of the bottom sheet the popup opens as with `adaptiveMode="auto"`. When empty, the sheet shows the field's name. |
|
|
18
20
|
| `aria-describedby` | `string` | `""` | Id of an element that describes the input, such as a hint or an error message. |
|
|
19
21
|
| `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
22
|
| `aria-labelledby` | `string` | `""` | Id of the element that labels the input. |
|
package/docs/api/dropdowns.md
CHANGED
|
@@ -175,7 +175,7 @@ the screen is narrower than 640 pixels, and `"none"` always opens it under the f
|
|
|
175
175
|
type AdaptiveMode = "auto" | "none";
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
-
**Used by:** [`DropdownListComponent`](dropdown-list.md#dropdownlistcomponent), [`DropdownTreeComponent`](dropdown-tree.md#dropdowntreecomponent), [`MultiSelectComponent`](multi-select.md#multiselectcomponent), [`MultiSelectTreeComponent`](multi-select-tree.md#multiselecttreecomponent)
|
|
178
|
+
**Used by:** [`DatePickerComponent`](date-picker.md#datepickercomponent), [`DateRangePickerComponent`](date-range-picker.md#daterangepickercomponent), [`DateTimePickerComponent`](datetime-picker.md#datetimepickercomponent), [`DropdownListComponent`](dropdown-list.md#dropdownlistcomponent), [`DropdownTreeComponent`](dropdown-tree.md#dropdowntreecomponent), [`MultiSelectComponent`](multi-select.md#multiselectcomponent), [`MultiSelectTreeComponent`](multi-select-tree.md#multiselecttreecomponent), [`TimePickerComponent`](time-picker.md#timepickercomponent)
|
|
179
179
|
|
|
180
180
|
## `DropdownFieldPredicateType`
|
|
181
181
|
|
package/docs/api/time-picker.md
CHANGED
|
@@ -15,6 +15,8 @@ Component.
|
|
|
15
15
|
|
|
16
16
|
| Name | Type | Default | Description |
|
|
17
17
|
| --- | --- | --- | --- |
|
|
18
|
+
| `adaptiveMode` | `AdaptiveMode` | `"none"` | Opens the popup as a sheet along the bottom of the screen on a small screen (narrower than 640 pixels) with `"auto"`, so it's easy to reach with a thumb. With `"none"`, it always opens under the field. |
|
|
19
|
+
| `adaptiveTitle` | `string` | `""` | Title of the bottom sheet the popup opens as with `adaptiveMode="auto"`. When empty, the sheet shows the field's name. |
|
|
18
20
|
| `aria-describedby` | `string` | `""` | Id of an element that describes the input, such as a hint or an error message. |
|
|
19
21
|
| `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
22
|
| `aria-labelledby` | `string` | `""` | Id of the element that labels the input. |
|
|
@@ -43,7 +43,7 @@ Component.
|
|
|
43
43
|
|
|
44
44
|
| Signature | Description |
|
|
45
45
|
| --- | --- |
|
|
46
|
-
| `focus(options?: FocusOptions): void` | Moves focus to the
|
|
46
|
+
| `focus(options?: FocusOptions): void` | Moves focus to the list that had it last, the hour list at first. |
|
|
47
47
|
|
|
48
48
|
## `TIME_SELECTOR_DEFAULT_MESSAGES`
|
|
49
49
|
|
package/docs/date-picker.md
CHANGED
|
@@ -70,6 +70,10 @@ Typed text is written to `value` on `Enter` and when the input loses focus. Text
|
|
|
70
70
|
|
|
71
71
|
Choosing a day in the calendar sets `value` and closes the popup. Days before `min`, after `max`, or in `disabledDates` can't be chosen. `disabledDates` takes an iterable of dates or a predicate.
|
|
72
72
|
|
|
73
|
+
### On a phone
|
|
74
|
+
|
|
75
|
+
With `adaptiveMode="auto"`, on a screen narrower than 640 pixels, the calendar opens as a sheet along the bottom of the screen, over a dimmed page, as described for the [dropdown list](dropdown-list.md#the-bottom-sheet). The sheet has the field's name, or `adaptiveTitle`, and a close button. The calendar spans the sheet, and its days grow to as much as 44 pixels, to be easy to tap. It keeps the height of a six-week month, so its arrows stay put from month to month. Focus moves into the calendar, as it does in the popup under the field, and goes back to the input when the sheet closes. To see it, set `adaptiveMode` to `auto` in the playground and narrow the window.
|
|
76
|
+
|
|
73
77
|
### Disabled and read-only
|
|
74
78
|
|
|
75
79
|
`disabled` and `readonly` keep the popup from opening. `readonlyInput` blocks typing but keeps the calendar button working, so the date can only be picked.
|
|
@@ -145,4 +149,4 @@ Everything below is imported from `@nanahoshi/mona-ui/date-picker`. Each name li
|
|
|
145
149
|
| --- | --- |
|
|
146
150
|
| [`DATE_PICKER_DEFAULT_MESSAGES`](api/date-picker.md#date-picker-default-messages) | Constant |
|
|
147
151
|
|
|
148
|
-
**Related types:** [`DateDisabledType`](api/date-input.md#datedisabledtype), [`FirstDayOfWeek`](api/calendar.md#firstdayofweek), [`ListSizeInputType`](api/list.md#listsizeinputtype), [`ListSizeType`](api/list.md#listsizetype), [`MonaDatePickerMessages`](api/i18n.md#monadatepickermessages), [`PopupCloseEvent`](api/popup.md#popupcloseevent), [`PreventableEvent`](api/common.md#preventableevent)
|
|
152
|
+
**Related types:** [`AdaptiveMode`](api/dropdowns.md#adaptivemode), [`DateDisabledType`](api/date-input.md#datedisabledtype), [`FirstDayOfWeek`](api/calendar.md#firstdayofweek), [`ListSizeInputType`](api/list.md#listsizeinputtype), [`ListSizeType`](api/list.md#listsizetype), [`MonaDatePickerMessages`](api/i18n.md#monadatepickermessages), [`PopupCloseEvent`](api/popup.md#popupcloseevent), [`PreventableEvent`](api/common.md#preventableevent)
|
|
@@ -327,6 +327,10 @@ Picking a quick range writes it and closes the popup. A range is kept within `mi
|
|
|
327
327
|
|
|
328
328
|
On a phone the quick ranges sit above the calendar, in rows.
|
|
329
329
|
|
|
330
|
+
### On a phone
|
|
331
|
+
|
|
332
|
+
With `adaptiveMode="auto"`, on a screen narrower than 640 pixels, the popup opens as a sheet along the bottom of the screen, over a dimmed page, as described for the [dropdown list](dropdown-list.md#the-bottom-sheet). The sheet has the field's name, or `adaptiveTitle`, and a close button. The quick ranges sit above the calendar and are 44 pixels tall, the months are below each other, and their days grow to as much as 44 pixels, to be easy to tap. The sheet scrolls when the months are taller than it. Focus moves into the calendar, as it does in the popup under the field.
|
|
333
|
+
|
|
330
334
|
### Disabled and read-only
|
|
331
335
|
|
|
332
336
|
`disabled` and `readonly` keep the popup from opening. `readonlyInput` blocks typing in both inputs but keeps the calendar button working, so the range can only be picked.
|
|
@@ -413,4 +417,4 @@ Everything below is imported from `@nanahoshi/mona-ui/date-range-picker`. Each n
|
|
|
413
417
|
| [`DateRangePresetRange`](api/date-range-picker.md#daterangepresetrange) | Interface | The range a preset picks. |
|
|
414
418
|
| [`DateRangePresetKey`](api/date-range-picker.md#daterangepresetkey) | Type alias | A built-in quick range, named by the locale's messages. |
|
|
415
419
|
|
|
416
|
-
**Related types:** [`DateDisabledType`](api/date-input.md#datedisabledtype), [`FirstDayOfWeek`](api/calendar.md#firstdayofweek), [`ListSizeInputType`](api/list.md#listsizeinputtype), [`ListSizeType`](api/list.md#listsizetype), [`MonaDateRangePickerMessages`](api/i18n.md#monadaterangepickermessages), [`PopupCloseEvent`](api/popup.md#popupcloseevent), [`PreventableEvent`](api/common.md#preventableevent)
|
|
420
|
+
**Related types:** [`AdaptiveMode`](api/dropdowns.md#adaptivemode), [`DateDisabledType`](api/date-input.md#datedisabledtype), [`FirstDayOfWeek`](api/calendar.md#firstdayofweek), [`ListSizeInputType`](api/list.md#listsizeinputtype), [`ListSizeType`](api/list.md#listsizetype), [`MonaDateRangePickerMessages`](api/i18n.md#monadaterangepickermessages), [`PopupCloseEvent`](api/popup.md#popupcloseevent), [`PreventableEvent`](api/common.md#preventableevent)
|
package/docs/datetime-picker.md
CHANGED
|
@@ -75,6 +75,10 @@ The popup opens on the Date tab. Choosing a day keeps the time already chosen an
|
|
|
75
75
|
|
|
76
76
|
A chosen date and time before `min` or after `max` is moved to that limit. On the day of `min` or `max`, the time lists are limited too. Each time the popup closes, it goes back to the Date tab and to the current value.
|
|
77
77
|
|
|
78
|
+
### On a phone
|
|
79
|
+
|
|
80
|
+
With `adaptiveMode="auto"`, on a screen narrower than 640 pixels, the popup opens as a sheet along the bottom of the screen, over a dimmed page, as described for the [dropdown list](dropdown-list.md#the-bottom-sheet). The sheet has the field's name, or `adaptiveTitle`, and a close button. The calendar's days grow to as much as 44 pixels, and the time lists use the large size, to be easy to tap. The sheet keeps the height the Date tab opened with, so the tabs stay put when the Time tab shows. Focus moves into the popup, as it does under the field.
|
|
81
|
+
|
|
78
82
|
### Disabled and read-only
|
|
79
83
|
|
|
80
84
|
`disabled` and `readonly` keep the popup from opening. `readonlyInput` blocks typing but keeps the popup button working, so the value can only be picked.
|
|
@@ -141,9 +145,10 @@ The popup button has `tabindex="-1"`, so the picker is one Tab stop. Keyboard us
|
|
|
141
145
|
| `Alt+ArrowRight` / `Alt+ArrowLeft` | Input, calendar or time selector | Shows the Time or Date view (swapped in right-to-left layouts) |
|
|
142
146
|
| `ArrowRight` / `ArrowLeft`, `Home` / `End` | Tabs | Selects and focuses the Date or Time tab (arrows swapped in right-to-left layouts) |
|
|
143
147
|
| `Enter` | Input | Writes the typed text to `value` |
|
|
148
|
+
| `Tab` / `Shift+Tab` | Time view | Moves through the Now button, each time selector list and the Set and Cancel buttons, then back to the Time tab |
|
|
144
149
|
| `Enter` | Time selector | Sets the chosen date and time and closes the popup |
|
|
145
150
|
|
|
146
|
-
Inside the panel, the calendar's and the time selector's own keyboard maps apply. Closing the popup returns focus to the input, unless the user moved focus elsewhere.
|
|
151
|
+
Inside the panel, the calendar's and the time selector's own keyboard maps apply. Each list in the time selector is a Tab stop, so keyboard users can reach every list that scrolls, and the arrow keys act on the list that has focus; the [Time Picker](time-picker.md) page lists its keys. Closing the popup returns focus to the input, unless the user moved focus elsewhere.
|
|
147
152
|
|
|
148
153
|
## API
|
|
149
154
|
|
|
@@ -159,4 +164,4 @@ Everything below is imported from `@nanahoshi/mona-ui/datetime-picker`. Each nam
|
|
|
159
164
|
| --- | --- |
|
|
160
165
|
| [`DATETIME_PICKER_DEFAULT_MESSAGES`](api/datetime-picker.md#datetime-picker-default-messages) | Constant |
|
|
161
166
|
|
|
162
|
-
**Related types:** [`DateDisabledType`](api/date-input.md#datedisabledtype), [`FirstDayOfWeek`](api/calendar.md#firstdayofweek), [`HourFormat`](api/date-input.md#hourformat), [`ListSizeInputType`](api/list.md#listsizeinputtype), [`ListSizeType`](api/list.md#listsizetype), [`MonaDateTimePickerMessages`](api/i18n.md#monadatetimepickermessages), [`PopupCloseEvent`](api/popup.md#popupcloseevent), [`PreventableEvent`](api/common.md#preventableevent)
|
|
167
|
+
**Related types:** [`AdaptiveMode`](api/dropdowns.md#adaptivemode), [`DateDisabledType`](api/date-input.md#datedisabledtype), [`FirstDayOfWeek`](api/calendar.md#firstdayofweek), [`HourFormat`](api/date-input.md#hourformat), [`ListSizeInputType`](api/list.md#listsizeinputtype), [`ListSizeType`](api/list.md#listsizetype), [`MonaDateTimePickerMessages`](api/i18n.md#monadatetimepickermessages), [`PopupCloseEvent`](api/popup.md#popupcloseevent), [`PreventableEvent`](api/common.md#preventableevent)
|
package/docs/time-picker.md
CHANGED
|
@@ -63,6 +63,10 @@ Typed text is written to `value` on `Enter` and when the input loses focus, on t
|
|
|
63
63
|
|
|
64
64
|
The popup holds a `mona-time-selector`. Choosing items in its lists moves the shown time; the **Set** button, `Enter` or `Space` writes it to `value` and closes the popup. The **Now** button moves the lists to the current time. A time outside `min` and `max` is moved inside them when it is set.
|
|
65
65
|
|
|
66
|
+
### On a phone
|
|
67
|
+
|
|
68
|
+
With `adaptiveMode="auto"`, on a screen narrower than 640 pixels, the time lists open as a sheet along the bottom of the screen, over a dimmed page, as described for the [dropdown list](dropdown-list.md#the-bottom-sheet). The sheet has the field's name, or `adaptiveTitle`, and a close button, and its lists use the large size, to be easy to scroll and tap. Focus moves into the lists, as it does in the popup under the field, and goes back to the input when the sheet closes.
|
|
69
|
+
|
|
66
70
|
### Disabled and read-only
|
|
67
71
|
|
|
68
72
|
`disabled` and `readonly` keep the popup from opening. `readonlyInput` blocks typing but keeps the popup button working, so the time can only be picked.
|
|
@@ -112,6 +116,8 @@ The input is a `role="combobox"` with `aria-haspopup="dialog"`, `aria-autocomple
|
|
|
112
116
|
|
|
113
117
|
The popup button has `tabindex="-1"`, so the picker is one Tab stop. Keyboard users open the popup with `Alt+ArrowDown`.
|
|
114
118
|
|
|
119
|
+
Inside the popup, each list in the time selector is a listbox of its own and a Tab stop, as each part of a native time input is, so keyboard users can reach every list that scrolls. `Tab` moves from the Now button through the Hours, Minutes, Seconds and AM/PM lists to the Set button. The arrow keys act on the list that has focus, whether `Tab`, a click or `ArrowLeft` / `ArrowRight` put it there.
|
|
120
|
+
|
|
115
121
|
**Consumer responsibilities**
|
|
116
122
|
|
|
117
123
|
- Label the picker. Point a `<label for>` or `<mona-label for>` at `inputId`, or set `aria-labelledby` or `aria-label`. The placeholder is not a label.
|
|
@@ -125,6 +131,7 @@ The popup button has `tabindex="-1"`, so the picker is one Tab stop. Keyboard us
|
|
|
125
131
|
| `Alt+ArrowUp` | Input | Closes the popup |
|
|
126
132
|
| `Escape` | Input or popup | Closes the popup |
|
|
127
133
|
| `Enter` | Input | Writes the typed text to `value` |
|
|
134
|
+
| `Tab` / `Shift+Tab` | Popup | Moves through the Now button, each time selector list and the Set button, wrapping around at the ends |
|
|
128
135
|
| `ArrowUp` / `ArrowDown` | Time selector list | Moves to the previous or next item |
|
|
129
136
|
| `ArrowLeft` / `ArrowRight` | Time selector list | Moves to the list on that side, also in right-to-left layouts, wrapping around at the ends |
|
|
130
137
|
| `Home` / `End` | Time selector list | Moves to the first or last item |
|
|
@@ -146,4 +153,4 @@ Everything below is imported from `@nanahoshi/mona-ui/time-picker`. Each name li
|
|
|
146
153
|
| --- | --- |
|
|
147
154
|
| [`TIME_PICKER_DEFAULT_MESSAGES`](api/time-picker.md#time-picker-default-messages) | Constant |
|
|
148
155
|
|
|
149
|
-
**Related types:** [`HourFormat`](api/date-input.md#hourformat), [`ListSizeInputType`](api/list.md#listsizeinputtype), [`ListSizeType`](api/list.md#listsizetype), [`MonaTimePickerMessages`](api/i18n.md#monatimepickermessages), [`PopupCloseEvent`](api/popup.md#popupcloseevent), [`PreventableEvent`](api/common.md#preventableevent)
|
|
156
|
+
**Related types:** [`AdaptiveMode`](api/dropdowns.md#adaptivemode), [`HourFormat`](api/date-input.md#hourformat), [`ListSizeInputType`](api/list.md#listsizeinputtype), [`ListSizeType`](api/list.md#listsizetype), [`MonaTimePickerMessages`](api/i18n.md#monatimepickermessages), [`PopupCloseEvent`](api/popup.md#popupcloseevent), [`PreventableEvent`](api/common.md#preventableevent)
|
|
@@ -1973,7 +1973,7 @@ var CalendarComponent = class CalendarComponent {
|
|
|
1973
1973
|
}
|
|
1974
1974
|
],
|
|
1975
1975
|
ngImport: i0,
|
|
1976
|
-
template: "<div [class]=\"headerClass()\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled() || todayUnavailable()\"\n (click)=\"onTodayButtonClick()\"\n [attr.aria-label]=\"todayButtonLabel()\">\n <span>{{ messages().today }}</span>\n </button>\n @switch (calendarView()) {\n @case (\"month\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onViewChangeClick('year')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span\n class=\"font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n >{{ headerMonthYear() }}</span\n >\n </button>\n }\n @case (\"year\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onViewChangeClick('decade')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span\n class=\"font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n >{{ headerYear() }}</span\n >\n </button>\n }\n @case (\"decade\") {\n <!-- The decade is the top view, so its heading isn't a button. It names the grid with the locale's\n wording of the range, and shows the digits. -->\n <span\n class=\"inline-flex h-9 items-center px-4 text-sm font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n ><span aria-hidden=\"true\">{{ formatInteger(decadeStart()) }} - {{ formatInteger(decadeEnd()) }}</span\n ><span class=\"sr-only\">{{ viewSwitchButtonLabel() }}</span></span\n >\n }\n }\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onNavigationClick('prev')\"\n [attr.aria-label]=\"prevButtonLabel()\">\n <svg lucideChevronLeft class=\"rtl:rotate-180\"></svg>\n </button>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onNavigationClick('next')\"\n [attr.aria-label]=\"nextButtonLabel()\">\n <svg lucideChevronRight class=\"rtl:rotate-180\"></svg>\n </button>\n</div>\n\n<div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">{{ ariaLabel() }}</div>\n\n@if (calendarView() === \"month\") {\n @let columnCount = weekNumber() ? 8 : 7;\n @let multipleMonths = monthGrids().length > 1;\n <div [class]=\"monthViewClass\">\n @for (grid of monthGrids(); track grid.key) {\n <div class=\"flex flex-col\">\n @if (multipleMonths) {\n <div [class]=\"monthCaptionClass\" [id]=\"grid.captionId\">{{ grid.caption }}</div>\n }\n <div\n role=\"grid\"\n class=\"flex flex-col gap-0.5\"\n [attr.aria-labelledby]=\"multipleMonths ? grid.captionId : gridId + '-heading'\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() || null\"\n (pointerleave)=\"onMonthGridPointerLeave()\">\n <div\n role=\"row\"\n [class]=\"monthGridHeaderClass()\"\n [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n <!-- Week numbers are visual only: every day is already named by its full date. -->\n <div aria-hidden=\"true\"></div>\n }\n @for (day of weekdays(); track day.full) {\n <div role=\"columnheader\">\n <span aria-hidden=\"true\">{{ day.display }}</span>\n <span class=\"sr-only\">{{ day.full }}</span>\n </div>\n }\n </div>\n @for (week of grid.weeks; track week.key) {\n <div\n role=\"row\"\n [class]=\"monthGridClass()\"\n [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n <div aria-hidden=\"true\">{{ formatInteger(week.weekNumber) }}</div>\n }\n <!-- Track by time: the months are rebuilt with new Date objects on every navigation. -->\n @for (entry of week.days; track entry ? entry.key.getTime() : -$index - 1) {\n @if (entry) {\n <div\n (dayPointerEnter)=\"onDayPointerEnter($event)\"\n (daySelect)=\"onDayClick($event.date, $event.event)\"\n monaMonthDay\n [disabled]=\"effectiveDisabled()\"\n [isDayUnavailable]=\"isDayUnavailable()\"\n [monthBounds]=\"grid.bounds\"\n [navigatedDate]=\"navigatedDate()\"\n [rangeEnds]=\"rangeEnds()\"\n [rangePreviewKeys]=\"rangePreviewKeys()\"\n [rounded]=\"rounded()\"\n [selectedKeys]=\"selectedKeys()\"\n [today]=\"today()\"\n [entry]=\"entry\">\n @if (monthCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"monthCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: entry.value,\n date: entry.key\n }\"></ng-container>\n } @else {\n <span>{{ formatInteger(entry.value) }}</span>\n }\n </div>\n } @else {\n <!-- A day of the month before or after, shown in its own month instead. -->\n <div role=\"gridcell\"></div>\n }\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n} @else if (calendarView() === \"year\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of yearViewMonths(); track $index) {\n <div role=\"row\" [class]=\"yearGridClass()\">\n @for (monthItem of row; track monthItem) {\n <div\n (click)=\"!effectiveDisabled() && onMonthClick(monthItem[0])\"\n monaYearMonth\n [disabled]=\"effectiveDisabled()\"\n [month]=\"monthItem[0]\"\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (yearCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"yearCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: monthItem[0], text: monthItem[1] }\">\n </ng-container>\n } @else {\n <span>{{ monthItem[1] }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else if (calendarView() === \"decade\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of decadeYears(); track $index) {\n <div role=\"row\" [class]=\"decadeGridClass()\">\n @for (year of row; track year) {\n <div\n (click)=\"!effectiveDisabled() && onYearClick(year)\"\n monaDecadeYear\n [disabled]=\"effectiveDisabled()\"\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [year]=\"year\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (decadeCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"decadeCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: year }\">\n </ng-container>\n } @else {\n <span>{{ formatInteger(year) }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n",
|
|
1976
|
+
template: "<div [class]=\"headerClass()\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled() || todayUnavailable()\"\n (click)=\"onTodayButtonClick()\"\n [attr.aria-label]=\"todayButtonLabel()\">\n <span>{{ messages().today }}</span>\n </button>\n @switch (calendarView()) {\n @case (\"month\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onViewChangeClick('year')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span\n class=\"font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n >{{ headerMonthYear() }}</span\n >\n </button>\n }\n @case (\"year\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onViewChangeClick('decade')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span\n class=\"font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n >{{ headerYear() }}</span\n >\n </button>\n }\n @case (\"decade\") {\n <!-- The decade is the top view, so its heading isn't a button. It names the grid with the locale's\n wording of the range, and shows the digits. -->\n <span\n class=\"inline-flex h-9 items-center px-4 text-sm font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n ><span aria-hidden=\"true\">{{ formatInteger(decadeStart()) }} - {{ formatInteger(decadeEnd()) }}</span\n ><span class=\"sr-only\">{{ viewSwitchButtonLabel() }}</span></span\n >\n }\n }\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onNavigationClick('prev')\"\n [attr.aria-label]=\"prevButtonLabel()\">\n <svg lucideChevronLeft class=\"rtl:rotate-180\"></svg>\n </button>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onNavigationClick('next')\"\n [attr.aria-label]=\"nextButtonLabel()\">\n <svg lucideChevronRight class=\"rtl:rotate-180\"></svg>\n </button>\n</div>\n\n<div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">{{ ariaLabel() }}</div>\n\n@if (calendarView() === \"month\") {\n @let columnCount = weekNumber() ? 8 : 7;\n @let multipleMonths = monthGrids().length > 1;\n <div [class]=\"monthViewClass\">\n @for (grid of monthGrids(); track grid.key) {\n <div class=\"flex flex-col\">\n @if (multipleMonths) {\n <div [class]=\"monthCaptionClass\" [id]=\"grid.captionId\">{{ grid.caption }}</div>\n }\n <div\n role=\"grid\"\n class=\"flex flex-col gap-0.5\"\n [attr.aria-labelledby]=\"multipleMonths ? grid.captionId : gridId + '-heading'\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() || null\"\n (pointerleave)=\"onMonthGridPointerLeave()\">\n <div\n role=\"row\"\n [class]=\"monthGridHeaderClass()\"\n [style.grid-template-columns]=\"`repeat(${columnCount}, var(--mona-calendar-cell-size, 32px))`\">\n @if (weekNumber()) {\n <!-- Week numbers are visual only: every day is already named by its full date. -->\n <div aria-hidden=\"true\"></div>\n }\n @for (day of weekdays(); track day.full) {\n <div role=\"columnheader\">\n <span aria-hidden=\"true\">{{ day.display }}</span>\n <span class=\"sr-only\">{{ day.full }}</span>\n </div>\n }\n </div>\n @for (week of grid.weeks; track week.key) {\n <div\n role=\"row\"\n [class]=\"monthGridClass()\"\n [style.grid-template-columns]=\"`repeat(${columnCount}, var(--mona-calendar-cell-size, 32px))`\">\n @if (weekNumber()) {\n <div aria-hidden=\"true\">{{ formatInteger(week.weekNumber) }}</div>\n }\n <!-- Track by time: the months are rebuilt with new Date objects on every navigation. -->\n @for (entry of week.days; track entry ? entry.key.getTime() : -$index - 1) {\n @if (entry) {\n <div\n (dayPointerEnter)=\"onDayPointerEnter($event)\"\n (daySelect)=\"onDayClick($event.date, $event.event)\"\n monaMonthDay\n [disabled]=\"effectiveDisabled()\"\n [isDayUnavailable]=\"isDayUnavailable()\"\n [monthBounds]=\"grid.bounds\"\n [navigatedDate]=\"navigatedDate()\"\n [rangeEnds]=\"rangeEnds()\"\n [rangePreviewKeys]=\"rangePreviewKeys()\"\n [rounded]=\"rounded()\"\n [selectedKeys]=\"selectedKeys()\"\n [today]=\"today()\"\n [entry]=\"entry\">\n @if (monthCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"monthCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: entry.value,\n date: entry.key\n }\"></ng-container>\n } @else {\n <span>{{ formatInteger(entry.value) }}</span>\n }\n </div>\n } @else {\n <!-- A day of the month before or after, shown in its own month instead. -->\n <div role=\"gridcell\"></div>\n }\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n} @else if (calendarView() === \"year\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of yearViewMonths(); track $index) {\n <div role=\"row\" [class]=\"yearGridClass()\">\n @for (monthItem of row; track monthItem) {\n <div\n (click)=\"!effectiveDisabled() && onMonthClick(monthItem[0])\"\n monaYearMonth\n [disabled]=\"effectiveDisabled()\"\n [month]=\"monthItem[0]\"\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (yearCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"yearCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: monthItem[0], text: monthItem[1] }\">\n </ng-container>\n } @else {\n <span>{{ monthItem[1] }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else if (calendarView() === \"decade\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of decadeYears(); track $index) {\n <div role=\"row\" [class]=\"decadeGridClass()\">\n @for (year of row; track year) {\n <div\n (click)=\"!effectiveDisabled() && onYearClick(year)\"\n monaDecadeYear\n [disabled]=\"effectiveDisabled()\"\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [year]=\"year\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (decadeCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"decadeCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: year }\">\n </ng-container>\n } @else {\n <span>{{ formatInteger(year) }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n",
|
|
1977
1977
|
dependencies: [
|
|
1978
1978
|
{
|
|
1979
1979
|
kind: "directive",
|
|
@@ -2089,7 +2089,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2089
2089
|
"(focusin)": "refreshToday()",
|
|
2090
2090
|
"(focusout)": "onFocusOut($event)"
|
|
2091
2091
|
},
|
|
2092
|
-
template: "<div [class]=\"headerClass()\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled() || todayUnavailable()\"\n (click)=\"onTodayButtonClick()\"\n [attr.aria-label]=\"todayButtonLabel()\">\n <span>{{ messages().today }}</span>\n </button>\n @switch (calendarView()) {\n @case (\"month\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onViewChangeClick('year')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span\n class=\"font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n >{{ headerMonthYear() }}</span\n >\n </button>\n }\n @case (\"year\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onViewChangeClick('decade')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span\n class=\"font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n >{{ headerYear() }}</span\n >\n </button>\n }\n @case (\"decade\") {\n <!-- The decade is the top view, so its heading isn't a button. It names the grid with the locale's\n wording of the range, and shows the digits. -->\n <span\n class=\"inline-flex h-9 items-center px-4 text-sm font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n ><span aria-hidden=\"true\">{{ formatInteger(decadeStart()) }} - {{ formatInteger(decadeEnd()) }}</span\n ><span class=\"sr-only\">{{ viewSwitchButtonLabel() }}</span></span\n >\n }\n }\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onNavigationClick('prev')\"\n [attr.aria-label]=\"prevButtonLabel()\">\n <svg lucideChevronLeft class=\"rtl:rotate-180\"></svg>\n </button>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onNavigationClick('next')\"\n [attr.aria-label]=\"nextButtonLabel()\">\n <svg lucideChevronRight class=\"rtl:rotate-180\"></svg>\n </button>\n</div>\n\n<div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">{{ ariaLabel() }}</div>\n\n@if (calendarView() === \"month\") {\n @let columnCount = weekNumber() ? 8 : 7;\n @let multipleMonths = monthGrids().length > 1;\n <div [class]=\"monthViewClass\">\n @for (grid of monthGrids(); track grid.key) {\n <div class=\"flex flex-col\">\n @if (multipleMonths) {\n <div [class]=\"monthCaptionClass\" [id]=\"grid.captionId\">{{ grid.caption }}</div>\n }\n <div\n role=\"grid\"\n class=\"flex flex-col gap-0.5\"\n [attr.aria-labelledby]=\"multipleMonths ? grid.captionId : gridId + '-heading'\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() || null\"\n (pointerleave)=\"onMonthGridPointerLeave()\">\n <div\n role=\"row\"\n [class]=\"monthGridHeaderClass()\"\n [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n <!-- Week numbers are visual only: every day is already named by its full date. -->\n <div aria-hidden=\"true\"></div>\n }\n @for (day of weekdays(); track day.full) {\n <div role=\"columnheader\">\n <span aria-hidden=\"true\">{{ day.display }}</span>\n <span class=\"sr-only\">{{ day.full }}</span>\n </div>\n }\n </div>\n @for (week of grid.weeks; track week.key) {\n <div\n role=\"row\"\n [class]=\"monthGridClass()\"\n [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n <div aria-hidden=\"true\">{{ formatInteger(week.weekNumber) }}</div>\n }\n <!-- Track by time: the months are rebuilt with new Date objects on every navigation. -->\n @for (entry of week.days; track entry ? entry.key.getTime() : -$index - 1) {\n @if (entry) {\n <div\n (dayPointerEnter)=\"onDayPointerEnter($event)\"\n (daySelect)=\"onDayClick($event.date, $event.event)\"\n monaMonthDay\n [disabled]=\"effectiveDisabled()\"\n [isDayUnavailable]=\"isDayUnavailable()\"\n [monthBounds]=\"grid.bounds\"\n [navigatedDate]=\"navigatedDate()\"\n [rangeEnds]=\"rangeEnds()\"\n [rangePreviewKeys]=\"rangePreviewKeys()\"\n [rounded]=\"rounded()\"\n [selectedKeys]=\"selectedKeys()\"\n [today]=\"today()\"\n [entry]=\"entry\">\n @if (monthCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"monthCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: entry.value,\n date: entry.key\n }\"></ng-container>\n } @else {\n <span>{{ formatInteger(entry.value) }}</span>\n }\n </div>\n } @else {\n <!-- A day of the month before or after, shown in its own month instead. -->\n <div role=\"gridcell\"></div>\n }\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n} @else if (calendarView() === \"year\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of yearViewMonths(); track $index) {\n <div role=\"row\" [class]=\"yearGridClass()\">\n @for (monthItem of row; track monthItem) {\n <div\n (click)=\"!effectiveDisabled() && onMonthClick(monthItem[0])\"\n monaYearMonth\n [disabled]=\"effectiveDisabled()\"\n [month]=\"monthItem[0]\"\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (yearCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"yearCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: monthItem[0], text: monthItem[1] }\">\n </ng-container>\n } @else {\n <span>{{ monthItem[1] }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else if (calendarView() === \"decade\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of decadeYears(); track $index) {\n <div role=\"row\" [class]=\"decadeGridClass()\">\n @for (year of row; track year) {\n <div\n (click)=\"!effectiveDisabled() && onYearClick(year)\"\n monaDecadeYear\n [disabled]=\"effectiveDisabled()\"\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [year]=\"year\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (decadeCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"decadeCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: year }\">\n </ng-container>\n } @else {\n <span>{{ formatInteger(year) }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n"
|
|
2092
|
+
template: "<div [class]=\"headerClass()\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled() || todayUnavailable()\"\n (click)=\"onTodayButtonClick()\"\n [attr.aria-label]=\"todayButtonLabel()\">\n <span>{{ messages().today }}</span>\n </button>\n @switch (calendarView()) {\n @case (\"month\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onViewChangeClick('year')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span\n class=\"font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n >{{ headerMonthYear() }}</span\n >\n </button>\n }\n @case (\"year\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onViewChangeClick('decade')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span\n class=\"font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n >{{ headerYear() }}</span\n >\n </button>\n }\n @case (\"decade\") {\n <!-- The decade is the top view, so its heading isn't a button. It names the grid with the locale's\n wording of the range, and shows the digits. -->\n <span\n class=\"inline-flex h-9 items-center px-4 text-sm font-semibold text-[var(--mona-primary-text-color,var(--color-primary))]\"\n [id]=\"gridId + '-heading'\"\n ><span aria-hidden=\"true\">{{ formatInteger(decadeStart()) }} - {{ formatInteger(decadeEnd()) }}</span\n ><span class=\"sr-only\">{{ viewSwitchButtonLabel() }}</span></span\n >\n }\n }\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onNavigationClick('prev')\"\n [attr.aria-label]=\"prevButtonLabel()\">\n <svg lucideChevronLeft class=\"rtl:rotate-180\"></svg>\n </button>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onNavigationClick('next')\"\n [attr.aria-label]=\"nextButtonLabel()\">\n <svg lucideChevronRight class=\"rtl:rotate-180\"></svg>\n </button>\n</div>\n\n<div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">{{ ariaLabel() }}</div>\n\n@if (calendarView() === \"month\") {\n @let columnCount = weekNumber() ? 8 : 7;\n @let multipleMonths = monthGrids().length > 1;\n <div [class]=\"monthViewClass\">\n @for (grid of monthGrids(); track grid.key) {\n <div class=\"flex flex-col\">\n @if (multipleMonths) {\n <div [class]=\"monthCaptionClass\" [id]=\"grid.captionId\">{{ grid.caption }}</div>\n }\n <div\n role=\"grid\"\n class=\"flex flex-col gap-0.5\"\n [attr.aria-labelledby]=\"multipleMonths ? grid.captionId : gridId + '-heading'\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() || null\"\n (pointerleave)=\"onMonthGridPointerLeave()\">\n <div\n role=\"row\"\n [class]=\"monthGridHeaderClass()\"\n [style.grid-template-columns]=\"`repeat(${columnCount}, var(--mona-calendar-cell-size, 32px))`\">\n @if (weekNumber()) {\n <!-- Week numbers are visual only: every day is already named by its full date. -->\n <div aria-hidden=\"true\"></div>\n }\n @for (day of weekdays(); track day.full) {\n <div role=\"columnheader\">\n <span aria-hidden=\"true\">{{ day.display }}</span>\n <span class=\"sr-only\">{{ day.full }}</span>\n </div>\n }\n </div>\n @for (week of grid.weeks; track week.key) {\n <div\n role=\"row\"\n [class]=\"monthGridClass()\"\n [style.grid-template-columns]=\"`repeat(${columnCount}, var(--mona-calendar-cell-size, 32px))`\">\n @if (weekNumber()) {\n <div aria-hidden=\"true\">{{ formatInteger(week.weekNumber) }}</div>\n }\n <!-- Track by time: the months are rebuilt with new Date objects on every navigation. -->\n @for (entry of week.days; track entry ? entry.key.getTime() : -$index - 1) {\n @if (entry) {\n <div\n (dayPointerEnter)=\"onDayPointerEnter($event)\"\n (daySelect)=\"onDayClick($event.date, $event.event)\"\n monaMonthDay\n [disabled]=\"effectiveDisabled()\"\n [isDayUnavailable]=\"isDayUnavailable()\"\n [monthBounds]=\"grid.bounds\"\n [navigatedDate]=\"navigatedDate()\"\n [rangeEnds]=\"rangeEnds()\"\n [rangePreviewKeys]=\"rangePreviewKeys()\"\n [rounded]=\"rounded()\"\n [selectedKeys]=\"selectedKeys()\"\n [today]=\"today()\"\n [entry]=\"entry\">\n @if (monthCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"monthCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: entry.value,\n date: entry.key\n }\"></ng-container>\n } @else {\n <span>{{ formatInteger(entry.value) }}</span>\n }\n </div>\n } @else {\n <!-- A day of the month before or after, shown in its own month instead. -->\n <div role=\"gridcell\"></div>\n }\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n} @else if (calendarView() === \"year\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of yearViewMonths(); track $index) {\n <div role=\"row\" [class]=\"yearGridClass()\">\n @for (monthItem of row; track monthItem) {\n <div\n (click)=\"!effectiveDisabled() && onMonthClick(monthItem[0])\"\n monaYearMonth\n [disabled]=\"effectiveDisabled()\"\n [month]=\"monthItem[0]\"\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (yearCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"yearCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: monthItem[0], text: monthItem[1] }\">\n </ng-container>\n } @else {\n <span>{{ monthItem[1] }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else if (calendarView() === \"decade\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of decadeYears(); track $index) {\n <div role=\"row\" [class]=\"decadeGridClass()\">\n @for (year of row; track year) {\n <div\n (click)=\"!effectiveDisabled() && onYearClick(year)\"\n monaDecadeYear\n [disabled]=\"effectiveDisabled()\"\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [year]=\"year\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (decadeCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"decadeCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: year }\">\n </ng-container>\n } @else {\n <span>{{ formatInteger(year) }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n"
|
|
2093
2093
|
}]
|
|
2094
2094
|
}],
|
|
2095
2095
|
ctorParameters: () => [],
|
|
@@ -8,7 +8,7 @@ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
|
|
|
8
8
|
import { CalendarComponent, CalendarDecadeCellTemplateDirective, CalendarMonthCellTemplateDirective, CalendarYearCellTemplateDirective } from "@nanahoshi/mona-ui/calendar";
|
|
9
9
|
import { CalendarService, DateInputPrefixTemplateDirective, createTypedDateInput, datePopupThemeVariants } from "@nanahoshi/mona-ui/date-input";
|
|
10
10
|
import * as i1 from "@nanahoshi/mona-ui/dropdowns";
|
|
11
|
-
import { DROPDOWN_POPUP_INPUT_TOKEN, DropdownPopupHandlerDirective, DropdownService } from "@nanahoshi/mona-ui/dropdowns";
|
|
11
|
+
import { DROPDOWN_POPUP_INPUT_TOKEN, DropdownPopupHandlerDirective, DropdownService, dropdownSheetPickerClasses } from "@nanahoshi/mona-ui/dropdowns";
|
|
12
12
|
import { MonaI18nService, getLocaleDateInputFormat } from "@nanahoshi/mona-ui/i18n";
|
|
13
13
|
import { FIELD_ASSOCIATION_BOUNDARY, createElementControlId, injectEffectiveDisabled, injectLabelAssociation, themeControlSurfaceClasses } from "@nanahoshi/mona-ui/internal";
|
|
14
14
|
import { TextBoxComponent, TextBoxPrefixTemplateDirective, TextBoxSuffixTemplateDirective } from "@nanahoshi/mona-ui/text-box";
|
|
@@ -129,7 +129,8 @@ var DatePickerComponent = class DatePickerComponent {
|
|
|
129
129
|
rounded,
|
|
130
130
|
size
|
|
131
131
|
});
|
|
132
|
-
|
|
132
|
+
const sheetClass = this.sheet() ? dropdownSheetPickerClasses : "";
|
|
133
|
+
return twMerge(variantClass, sheetClass, userClass);
|
|
133
134
|
}, ...ngDevMode ? [{ debugName: "pickerPopupClass" }] : /* istanbul ignore next */ []);
|
|
134
135
|
this.popupId = createElementControlId();
|
|
135
136
|
this.popupTemplate = viewChild.required("popupTemplate", ...ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []);
|
|
@@ -137,7 +138,10 @@ var DatePickerComponent = class DatePickerComponent {
|
|
|
137
138
|
...ngDevMode ? { debugName: "prefixTemplate" } : /* istanbul ignore next */ {},
|
|
138
139
|
read: TemplateRef
|
|
139
140
|
});
|
|
141
|
+
this.sheet = this.#dropdownService.sheet.asReadonly();
|
|
140
142
|
this.yearCellTemplate = contentChild(CalendarYearCellTemplateDirective, ...ngDevMode ? [{ debugName: "yearCellTemplate" }] : /* istanbul ignore next */ []);
|
|
143
|
+
this.adaptiveMode = input("none", ...ngDevMode ? [{ debugName: "adaptiveMode" }] : /* istanbul ignore next */ []);
|
|
144
|
+
this.adaptiveTitle = input("", ...ngDevMode ? [{ debugName: "adaptiveTitle" }] : /* istanbul ignore next */ []);
|
|
141
145
|
this.ariaDescribedBy = input("", {
|
|
142
146
|
...ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {},
|
|
143
147
|
alias: "aria-describedby"
|
|
@@ -325,6 +329,20 @@ var DatePickerComponent = class DatePickerComponent {
|
|
|
325
329
|
isStandalone: true,
|
|
326
330
|
selector: "mona-date-picker",
|
|
327
331
|
inputs: {
|
|
332
|
+
adaptiveMode: {
|
|
333
|
+
classPropertyName: "adaptiveMode",
|
|
334
|
+
publicName: "adaptiveMode",
|
|
335
|
+
isSignal: true,
|
|
336
|
+
isRequired: false,
|
|
337
|
+
transformFunction: null
|
|
338
|
+
},
|
|
339
|
+
adaptiveTitle: {
|
|
340
|
+
classPropertyName: "adaptiveTitle",
|
|
341
|
+
publicName: "adaptiveTitle",
|
|
342
|
+
isSignal: true,
|
|
343
|
+
isRequired: false,
|
|
344
|
+
transformFunction: null
|
|
345
|
+
},
|
|
328
346
|
ariaDescribedBy: {
|
|
329
347
|
classPropertyName: "ariaDescribedBy",
|
|
330
348
|
publicName: "aria-describedby",
|
|
@@ -787,6 +805,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
787
805
|
type: i0.ContentChild,
|
|
788
806
|
args: [i0.forwardRef(() => CalendarYearCellTemplateDirective), { isSignal: true }]
|
|
789
807
|
}],
|
|
808
|
+
adaptiveMode: [{
|
|
809
|
+
type: i0.Input,
|
|
810
|
+
args: [{
|
|
811
|
+
isSignal: true,
|
|
812
|
+
alias: "adaptiveMode",
|
|
813
|
+
required: false
|
|
814
|
+
}]
|
|
815
|
+
}],
|
|
816
|
+
adaptiveTitle: [{
|
|
817
|
+
type: i0.Input,
|
|
818
|
+
args: [{
|
|
819
|
+
isSignal: true,
|
|
820
|
+
alias: "adaptiveTitle",
|
|
821
|
+
required: false
|
|
822
|
+
}]
|
|
823
|
+
}],
|
|
790
824
|
ariaDescribedBy: [{
|
|
791
825
|
type: i0.Input,
|
|
792
826
|
args: [{
|
|
@@ -8,7 +8,7 @@ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
|
|
|
8
8
|
import { CalendarComponent, CalendarDecadeCellTemplateDirective, CalendarMonthCellTemplateDirective, CalendarYearCellTemplateDirective } from "@nanahoshi/mona-ui/calendar";
|
|
9
9
|
import { CalendarService, checkTypedDate, datePopupThemeVariants, isDateDisabled, parseTypedDate, typedDateParseError } from "@nanahoshi/mona-ui/date-input";
|
|
10
10
|
import * as i1 from "@nanahoshi/mona-ui/dropdowns";
|
|
11
|
-
import { DROPDOWN_POPUP_INPUT_TOKEN, DropdownPopupHandlerDirective, DropdownService } from "@nanahoshi/mona-ui/dropdowns";
|
|
11
|
+
import { DROPDOWN_POPUP_INPUT_TOKEN, DropdownPopupHandlerDirective, DropdownService, dropdownSheetPickerClasses } from "@nanahoshi/mona-ui/dropdowns";
|
|
12
12
|
import { MonaI18nService, formatNumber, getLocaleDateInputFormat, getLocaleFirstDayOfWeek, gregorianDateTime } from "@nanahoshi/mona-ui/i18n";
|
|
13
13
|
import { FIELD_ASSOCIATION_BOUNDARY, createElementControlId, injectEffectiveDisabled, injectLabelAssociation, themeControlSurfaceClasses } from "@nanahoshi/mona-ui/internal";
|
|
14
14
|
import { TextBoxComponent } from "@nanahoshi/mona-ui/text-box";
|
|
@@ -389,11 +389,12 @@ var DateRangePickerComponent = class DateRangePickerComponent {
|
|
|
389
389
|
rounded: this.rounded(),
|
|
390
390
|
size: this.size()
|
|
391
391
|
});
|
|
392
|
-
|
|
392
|
+
const sheetClass = this.sheet() ? dropdownSheetPickerClasses : "";
|
|
393
|
+
return twMerge(variantClass, dateRangePickerPopupThemeVariants(), sheetClass, this.popupClass());
|
|
393
394
|
}, ...ngDevMode ? [{ debugName: "pickerPopupClass" }] : /* istanbul ignore next */ []);
|
|
394
395
|
this.popupId = createElementControlId();
|
|
395
396
|
this.popupTemplate = viewChild.required("popupTemplate", ...ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []);
|
|
396
|
-
this.presetClass = computed(() => dateRangePickerPresetThemeVariants({ size: this.size() }), ...ngDevMode ? [{ debugName: "presetClass" }] : /* istanbul ignore next */ []);
|
|
397
|
+
this.presetClass = computed(() => twMerge(dateRangePickerPresetThemeVariants({ size: this.size() }), this.sheet() ? "h-11" : ""), ...ngDevMode ? [{ debugName: "presetClass" }] : /* istanbul ignore next */ []);
|
|
397
398
|
this.presetItems = computed(() => {
|
|
398
399
|
const presets = this.presets();
|
|
399
400
|
if (presets.length === 0) return [];
|
|
@@ -409,11 +410,14 @@ var DateRangePickerComponent = class DateRangePickerComponent {
|
|
|
409
410
|
}, ...ngDevMode ? [{ debugName: "presetItems" }] : /* istanbul ignore next */ []);
|
|
410
411
|
this.presetListClass = dateRangePickerPresetListThemeVariants();
|
|
411
412
|
this.separatorClass = dateRangePickerSeparatorThemeVariants();
|
|
413
|
+
this.sheet = this.#dropdownService.sheet.asReadonly();
|
|
412
414
|
this.sizerClass = computed(() => dateRangePickerSizerThemeVariants({ clearButton: this.showClearButton() }), ...ngDevMode ? [{ debugName: "sizerClass" }] : /* istanbul ignore next */ []);
|
|
413
415
|
this.startInputId = createElementControlId();
|
|
414
416
|
this.startInvalid = computed(() => this.typedInput.partErrors().start.length > 0 || this.fieldInvalid(), ...ngDevMode ? [{ debugName: "startInvalid" }] : /* istanbul ignore next */ []);
|
|
415
417
|
this.startSizerTexts = computed(() => sizerTexts(this.#sampleTexts(), this.startPlaceholder()), ...ngDevMode ? [{ debugName: "startSizerTexts" }] : /* istanbul ignore next */ []);
|
|
416
418
|
this.yearCellTemplate = contentChild(CalendarYearCellTemplateDirective, ...ngDevMode ? [{ debugName: "yearCellTemplate" }] : /* istanbul ignore next */ []);
|
|
419
|
+
this.adaptiveMode = input("none", ...ngDevMode ? [{ debugName: "adaptiveMode" }] : /* istanbul ignore next */ []);
|
|
420
|
+
this.adaptiveTitle = input("", ...ngDevMode ? [{ debugName: "adaptiveTitle" }] : /* istanbul ignore next */ []);
|
|
417
421
|
this.ariaDescribedBy = input("", {
|
|
418
422
|
...ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {},
|
|
419
423
|
alias: "aria-describedby"
|
|
@@ -634,6 +638,20 @@ var DateRangePickerComponent = class DateRangePickerComponent {
|
|
|
634
638
|
isStandalone: true,
|
|
635
639
|
selector: "mona-date-range-picker",
|
|
636
640
|
inputs: {
|
|
641
|
+
adaptiveMode: {
|
|
642
|
+
classPropertyName: "adaptiveMode",
|
|
643
|
+
publicName: "adaptiveMode",
|
|
644
|
+
isSignal: true,
|
|
645
|
+
isRequired: false,
|
|
646
|
+
transformFunction: null
|
|
647
|
+
},
|
|
648
|
+
adaptiveTitle: {
|
|
649
|
+
classPropertyName: "adaptiveTitle",
|
|
650
|
+
publicName: "adaptiveTitle",
|
|
651
|
+
isSignal: true,
|
|
652
|
+
isRequired: false,
|
|
653
|
+
transformFunction: null
|
|
654
|
+
},
|
|
637
655
|
ariaDescribedBy: {
|
|
638
656
|
classPropertyName: "ariaDescribedBy",
|
|
639
657
|
publicName: "aria-describedby",
|
|
@@ -1085,6 +1103,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1085
1103
|
type: i0.ContentChild,
|
|
1086
1104
|
args: [i0.forwardRef(() => CalendarYearCellTemplateDirective), { isSignal: true }]
|
|
1087
1105
|
}],
|
|
1106
|
+
adaptiveMode: [{
|
|
1107
|
+
type: i0.Input,
|
|
1108
|
+
args: [{
|
|
1109
|
+
isSignal: true,
|
|
1110
|
+
alias: "adaptiveMode",
|
|
1111
|
+
required: false
|
|
1112
|
+
}]
|
|
1113
|
+
}],
|
|
1114
|
+
adaptiveTitle: [{
|
|
1115
|
+
type: i0.Input,
|
|
1116
|
+
args: [{
|
|
1117
|
+
isSignal: true,
|
|
1118
|
+
alias: "adaptiveTitle",
|
|
1119
|
+
required: false
|
|
1120
|
+
}]
|
|
1121
|
+
}],
|
|
1088
1122
|
ariaDescribedBy: [{
|
|
1089
1123
|
type: i0.Input,
|
|
1090
1124
|
args: [{
|