@nanahoshi/mona-ui 0.37.0 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/docs/api/common.md +1 -1
  2. package/docs/api/date-picker.md +2 -0
  3. package/docs/api/date-range-picker.md +2 -0
  4. package/docs/api/datetime-picker.md +2 -0
  5. package/docs/api/dropdown-list.md +2 -0
  6. package/docs/api/dropdown-tree.md +81 -0
  7. package/docs/api/dropdowns.md +34 -8
  8. package/docs/api/i18n.md +33 -4
  9. package/docs/api/list.md +1 -1
  10. package/docs/api/locales.md +14 -14
  11. package/docs/api/multi-select-tree.md +75 -0
  12. package/docs/api/multi-select.md +3 -1
  13. package/docs/api/popup.md +1 -1
  14. package/docs/api/time-picker.md +2 -0
  15. package/docs/api/tree-view.md +2 -2
  16. package/docs/auto-complete.md +2 -0
  17. package/docs/combo-box.md +2 -0
  18. package/docs/date-picker.md +5 -1
  19. package/docs/date-range-picker.md +5 -1
  20. package/docs/datetime-picker.md +5 -1
  21. package/docs/dropdown-list.md +52 -0
  22. package/docs/dropdown-tree.md +427 -0
  23. package/docs/multi-select-tree.md +353 -0
  24. package/docs/multi-select.md +6 -0
  25. package/docs/time-picker.md +5 -1
  26. package/dropdown-tree/package.json +4 -0
  27. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2 -2
  28. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +36 -2
  29. package/fesm2022/nanahoshi-mona-ui-date-range-picker.mjs +37 -3
  30. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +52 -5
  31. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +40 -5
  32. package/fesm2022/nanahoshi-mona-ui-dropdown-tree.mjs +1061 -0
  33. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +730 -60
  34. package/fesm2022/nanahoshi-mona-ui-editor.mjs +8 -2
  35. package/fesm2022/nanahoshi-mona-ui-filter.mjs +4 -0
  36. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-S2iCn8TV.mjs → nanahoshi-mona-ui-grid-grid-list.component-BoSXXLKQ.mjs} +2 -2
  37. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-BUJvgihp.mjs → nanahoshi-mona-ui-grid-grid-row.component-Df2gfS0X.mjs} +3 -1
  38. 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
  39. package/fesm2022/nanahoshi-mona-ui-grid.mjs +8 -4
  40. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +13 -0
  41. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +80 -37
  42. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +7 -0
  43. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +7 -0
  44. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +7 -0
  45. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +7 -0
  46. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +7 -0
  47. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +7 -0
  48. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +7 -0
  49. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +7 -0
  50. package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +17 -0
  51. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +7 -0
  52. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +17 -0
  53. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +7 -0
  54. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +7 -0
  55. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +7 -0
  56. package/fesm2022/nanahoshi-mona-ui-multi-select-tree.mjs +1179 -0
  57. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +42 -7
  58. package/fesm2022/nanahoshi-mona-ui-pager.mjs +3 -1
  59. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +39 -4
  60. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -1
  61. package/i18n/catalogs/en-US.messages.json +9 -0
  62. package/llms.txt +6 -2
  63. package/locales/ar-sa/ar-sa.messages.json +9 -0
  64. package/locales/de-de/de-de.messages.json +9 -0
  65. package/locales/es-es/es-es.messages.json +9 -0
  66. package/locales/fr-fr/fr-fr.messages.json +9 -0
  67. package/locales/id-id/id-id.messages.json +9 -0
  68. package/locales/it-it/it-it.messages.json +9 -0
  69. package/locales/ja-jp/ja-jp.messages.json +9 -0
  70. package/locales/ko-kr/ko-kr.messages.json +9 -0
  71. package/locales/pl-pl/pl-pl.messages.json +9 -0
  72. package/locales/pt-br/pt-br.messages.json +9 -0
  73. package/locales/ru-ru/ru-ru.messages.json +9 -0
  74. package/locales/tr-tr/tr-tr.messages.json +9 -0
  75. package/locales/zh-cn/zh-cn.messages.json +9 -0
  76. package/locales/zh-tw/zh-tw.messages.json +9 -0
  77. package/multi-select-tree/package.json +4 -0
  78. package/package.json +9 -1
  79. package/types/nanahoshi-mona-ui-date-picker.d.ts +25 -1
  80. package/types/nanahoshi-mona-ui-date-range-picker.d.ts +26 -1
  81. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +34 -1
  82. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +33 -5
  83. package/types/nanahoshi-mona-ui-dropdown-tree.d.ts +414 -0
  84. package/types/nanahoshi-mona-ui-dropdowns.d.ts +218 -9
  85. package/types/nanahoshi-mona-ui-i18n.d.ts +12 -0
  86. package/types/nanahoshi-mona-ui-internal-tree.d.ts +36 -0
  87. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +9 -0
  88. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +9 -0
  89. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +9 -0
  90. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +9 -0
  91. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +9 -0
  92. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +9 -0
  93. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +9 -0
  94. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +9 -0
  95. package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +9 -0
  96. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +9 -0
  97. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +9 -0
  98. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +9 -0
  99. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +9 -0
  100. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +9 -0
  101. package/types/nanahoshi-mona-ui-multi-select-tree.d.ts +456 -0
  102. package/types/nanahoshi-mona-ui-multi-select.d.ts +43 -7
  103. package/types/nanahoshi-mona-ui-time-picker.d.ts +29 -2
@@ -1,14 +1,20 @@
1
1
  import * as i0 from "@angular/core";
2
- import { InjectionToken, InputSignal, OutputEmitterRef, Signal, TemplateRef } from "@angular/core";
2
+ import { ElementRef, InjectionToken, InputSignal, OutputEmitterRef, Signal, TemplateRef } from "@angular/core";
3
3
  import { Predicate, Selector } from "@mirei/ts-collections";
4
4
  import { GroupableOptions, ListItem, ListSizeInputType } from "@nanahoshi/mona-ui/internal/list";
5
5
  import { PopupCloseEvent, PopupRef, PopupSettings } from "@nanahoshi/mona-ui/popup";
6
6
  import { FilterChangeEvent, FilterableOptions, PreventableEvent, VirtualScrollOptions } from "@nanahoshi/mona-ui/common";
7
+ import { TreeService } from "@nanahoshi/mona-ui/internal/tree";
7
8
  import { ConnectionPositionPair } from "@angular/cdk/overlay";
8
9
  import { Subject } from "rxjs";
9
10
  import { VariantInputs } from "@nanahoshi/mona-ui/internal";
10
11
  import { VariantProps } from "class-variance-authority";
11
12
  import { MonaDropdownsMessages } from "@nanahoshi/mona-ui/i18n";
13
+ /**
14
+ * How a dropdown's popup adapts to a small screen: `"auto"` opens it as a sheet along the bottom of the screen when
15
+ * the screen is narrower than 640 pixels, and `"none"` always opens it under the field.
16
+ */
17
+ type AdaptiveMode = "auto" | "none";
12
18
  export type DropdownFieldSelectorType<TData, TResult = unknown> = string | Selector<TData, TResult> | null | undefined;
13
19
  export type DropdownFieldPredicateType<TData> = string | Predicate<TData> | null | undefined;
14
20
  export interface DropdownDataInput<TData> {
@@ -25,6 +31,10 @@ export declare const DROPDOWN_DATA_INPUT_TOKEN: InjectionToken<DropdownDataInput
25
31
  export declare const DropdownDataInputToken: InjectionToken<DropdownDataInput<unknown>>;
26
32
  /** @hidden Exported for Mona UI's other entry points; applications don't need it. */
27
33
  export interface DropdownPopupInput {
34
+ /** Whether the popup opens as a bottom sheet on a small screen. Dropdowns without the input never do. */
35
+ readonly adaptiveMode?: InputSignal<AdaptiveMode>;
36
+ /** The bottom sheet's title; the field's name when empty. */
37
+ readonly adaptiveTitle?: InputSignal<string>;
28
38
  readonly close: OutputEmitterRef<PopupCloseEvent>;
29
39
  readonly closed: OutputEmitterRef<void>;
30
40
  readonly disabled: Signal<boolean>;
@@ -37,6 +47,119 @@ export interface DropdownPopupInput {
37
47
  }
38
48
  /** @hidden Exported for Mona UI's other entry points; applications don't need it. */
39
49
  export declare const DROPDOWN_POPUP_INPUT_TOKEN: InjectionToken<DropdownPopupInput>;
50
+ /** What a dropdown passes to the bottom sheet its popup opens as. */
51
+ export interface DropdownSheetData {
52
+ /** The dropdown's popup template, shown below the sheet's header. */
53
+ readonly content: TemplateRef<unknown>;
54
+ /** The sheet's title: the dropdown's `adaptiveTitle`, or else its name. */
55
+ readonly title: Signal<string>;
56
+ }
57
+ /**
58
+ * The bottom sheet a dropdown's popup opens as on a small screen (`adaptiveMode="auto"`): a header with the field's
59
+ * name and a close button, over the dropdown's own popup.
60
+ *
61
+ * Focus is where the popup under the field keeps it: on the field or in the filter box for a list or a tree, and in
62
+ * the popup, a dialog, for a date or time picker. So the sheet's close button is for pointers; the keyboard closes the
63
+ * sheet with Escape, or Tab for a list or a tree.
64
+ * @hidden Exported for Mona UI's other entry points; applications don't need it.
65
+ */
66
+ export declare class DropdownSheetComponent {
67
+ #private;
68
+ protected readonly content: Signal<ElementRef<HTMLElement>>;
69
+ protected readonly data: DropdownSheetData;
70
+ protected readonly messages: Signal<import("@nanahoshi/mona-ui/i18n").MonaDropdownsMessages>;
71
+ protected readonly sheetClass: string;
72
+ protected closeSheet(): void;
73
+ /**
74
+ * Keeps focus where it is when the sheet's own parts are pressed: its handle, its title or its close button. The
75
+ * dropdown's popup handles presses on itself, as it does under the field: a list keeps focus on the field, and a
76
+ * calendar takes it.
77
+ */
78
+ protected onPointerDown(event: PointerEvent): void;
79
+ static ɵfac: i0.ɵɵFactoryDeclaration<DropdownSheetComponent, never>;
80
+ static ɵcmp: i0.ɵɵComponentDeclaration<DropdownSheetComponent, "mona-dropdown-sheet", never, {}, {}, never, never, true, never>;
81
+ }
82
+ /**
83
+ * The popup of a dropdown tree and a multi-select tree: an optional filter box, the tree, and the header, footer and
84
+ * "no data" templates. The tree doesn't take focus. Its field keeps it (or the filter box does), and points
85
+ * `aria-activedescendant` at the active node.
86
+ * @hidden Exported for Mona UI's other entry points; applications don't need it.
87
+ */
88
+ export declare class DropdownTreePopupComponent<T> {
89
+ #private;
90
+ protected readonly activeDescendant: import("@angular/core").Signal<string | null>;
91
+ protected readonly empty: import("@angular/core").Signal<boolean>;
92
+ protected readonly emptyText: import("@angular/core").Signal<string>;
93
+ protected readonly filterAriaLabel: import("@angular/core").Signal<string>;
94
+ protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaTreeViewMessages>;
95
+ protected readonly noDataId: import("@angular/core").Signal<string>;
96
+ protected readonly treeService: TreeService<T>;
97
+ /** The field's accessible name, which names the tree and its filter box. */
98
+ readonly ariaLabel: import("@angular/core").InputSignal<string>;
99
+ /** Ids of the elements that name the field, which name the tree too. */
100
+ readonly ariaLabelledBy: import("@angular/core").InputSignal<string>;
101
+ readonly footerTemplate: import("@angular/core").InputSignal<TemplateRef<unknown> | null | undefined>;
102
+ readonly headerTemplate: import("@angular/core").InputSignal<TemplateRef<unknown> | null | undefined>;
103
+ readonly itemTemplate: import("@angular/core").InputSignal<TemplateRef<unknown> | null | undefined>;
104
+ readonly noDataTemplate: import("@angular/core").InputSignal<TemplateRef<unknown> | null | undefined>;
105
+ /** Classes of the popup's surface. */
106
+ readonly popupClass: import("@angular/core").InputSignal<string>;
107
+ readonly size: import("@angular/core").InputSignal<"large" | "medium" | "small">;
108
+ /** The id of the tree, which the field's `aria-controls` points at. */
109
+ readonly treeId: import("@angular/core").InputSignal<string>;
110
+ constructor();
111
+ protected onFilterChange(event: FilterChangeEvent): void;
112
+ /** Keeps focus where it is (the field or the filter box) when a node or the popup's padding is pressed. */
113
+ protected onPointerDown(event: PointerEvent): void;
114
+ static ɵfac: i0.ɵɵFactoryDeclaration<DropdownTreePopupComponent<any>, never>;
115
+ static ɵcmp: i0.ɵɵComponentDeclaration<DropdownTreePopupComponent<any>, "mona-dropdown-tree-popup", never, {
116
+ "ariaLabel": {
117
+ "alias": "ariaLabel";
118
+ "required": false;
119
+ "isSignal": true;
120
+ };
121
+ "ariaLabelledBy": {
122
+ "alias": "ariaLabelledBy";
123
+ "required": false;
124
+ "isSignal": true;
125
+ };
126
+ "footerTemplate": {
127
+ "alias": "footerTemplate";
128
+ "required": false;
129
+ "isSignal": true;
130
+ };
131
+ "headerTemplate": {
132
+ "alias": "headerTemplate";
133
+ "required": false;
134
+ "isSignal": true;
135
+ };
136
+ "itemTemplate": {
137
+ "alias": "itemTemplate";
138
+ "required": false;
139
+ "isSignal": true;
140
+ };
141
+ "noDataTemplate": {
142
+ "alias": "noDataTemplate";
143
+ "required": false;
144
+ "isSignal": true;
145
+ };
146
+ "popupClass": {
147
+ "alias": "popupClass";
148
+ "required": false;
149
+ "isSignal": true;
150
+ };
151
+ "size": {
152
+ "alias": "size";
153
+ "required": false;
154
+ "isSignal": true;
155
+ };
156
+ "treeId": {
157
+ "alias": "treeId";
158
+ "required": true;
159
+ "isSignal": true;
160
+ };
161
+ }, {}, never, never, true, never>;
162
+ }
40
163
  export declare class DropdownFilterableDirective {
41
164
  #private;
42
165
  /** @description Current filter text used to narrow the visible options. */
@@ -57,7 +180,7 @@ export declare class DropdownFilterableDirective {
57
180
  readonly options: import("@angular/core").InputSignal<"" | Partial<FilterableOptions>>;
58
181
  constructor();
59
182
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownFilterableDirective, never>;
60
- static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownFilterableDirective, " mona-auto-complete[monaDropDownFilterable], mona-dropdown-list[monaDropDownFilterable], mona-combo-box[monaDropDownFilterable], mona-multi-select[monaDropDownFilterable] ", never, {
183
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownFilterableDirective, " mona-auto-complete[monaDropDownFilterable], mona-dropdown-list[monaDropDownFilterable], mona-combo-box[monaDropDownFilterable], mona-dropdown-tree[monaDropDownFilterable], mona-multi-select[monaDropDownFilterable], mona-multi-select-tree[monaDropDownFilterable] ", never, {
61
184
  "filter": {
62
185
  "alias": "filter";
63
186
  "required": false;
@@ -79,7 +202,7 @@ export declare class DropdownFilterableDirective {
79
202
  }
80
203
  export declare class DropdownFooterTemplateDirective {
81
204
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownFooterTemplateDirective, never>;
82
- static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownFooterTemplateDirective, " ng-template[monaDropDownFooterTemplate], ng-template[monaAutoCompleteFooterTemplate], ng-template[monaDropDownListFooterTemplate], ng-template[monaDropDownTreeFooterTemplate], ng-template[monaComboBoxFooterTemplate], ng-template[monaMultiSelectFooterTemplate] ", never, {}, {}, never, never, true, never>;
205
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownFooterTemplateDirective, " ng-template[monaDropDownFooterTemplate], ng-template[monaAutoCompleteFooterTemplate], ng-template[monaDropDownListFooterTemplate], ng-template[monaDropDownTreeFooterTemplate], ng-template[monaComboBoxFooterTemplate], ng-template[monaMultiSelectFooterTemplate], ng-template[monaMultiSelectTreeFooterTemplate] ", never, {}, {}, never, never, true, never>;
83
206
  }
84
207
  export declare class DropdownGroupHeaderTemplateDirective {
85
208
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownGroupHeaderTemplateDirective, never>;
@@ -111,15 +234,15 @@ export declare class DropdownGroupableDirective<TData> {
111
234
  }
112
235
  export declare class DropdownHeaderTemplateDirective {
113
236
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownHeaderTemplateDirective, never>;
114
- static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownHeaderTemplateDirective, " ng-template[monaDropDownHeaderTemplate], ng-template[monaAutoCompleteHeaderTemplate], ng-template[monaDropDownListHeaderTemplate], ng-template[monaDropDownTreeHeaderTemplate], ng-template[monaComboBoxHeaderTemplate], ng-template[monaMultiSelectHeaderTemplate] ", never, {}, {}, never, never, true, never>;
237
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownHeaderTemplateDirective, " ng-template[monaDropDownHeaderTemplate], ng-template[monaAutoCompleteHeaderTemplate], ng-template[monaDropDownListHeaderTemplate], ng-template[monaDropDownTreeHeaderTemplate], ng-template[monaComboBoxHeaderTemplate], ng-template[monaMultiSelectHeaderTemplate], ng-template[monaMultiSelectTreeHeaderTemplate] ", never, {}, {}, never, never, true, never>;
115
238
  }
116
239
  export declare class DropdownItemTemplateDirective {
117
240
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownItemTemplateDirective, never>;
118
- static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownItemTemplateDirective, " ng-template[monaDropDownItemTemplate], ng-template[monaAutoCompleteItemTemplate], ng-template[monaDropDownListItemTemplate], ng-template[monaComboBoxItemTemplate], ng-template[monaMultiSelectItemTemplate] ", never, {}, {}, never, never, true, never>;
241
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownItemTemplateDirective, " ng-template[monaDropDownItemTemplate], ng-template[monaAutoCompleteItemTemplate], ng-template[monaDropDownListItemTemplate], ng-template[monaDropDownTreeItemTemplate], ng-template[monaComboBoxItemTemplate], ng-template[monaMultiSelectItemTemplate], ng-template[monaMultiSelectTreeItemTemplate] ", never, {}, {}, never, never, true, never>;
119
242
  }
120
243
  export declare class DropdownNoDataTemplateDirective {
121
244
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownNoDataTemplateDirective, never>;
122
- static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownNoDataTemplateDirective, " ng-template[monaDropDownNoDataTemplate], ng-template[monaAutoCompleteNoDataTemplate], ng-template[monaDropDownListNoDataTemplate], ng-template[monaDropDownTreeNoDataTemplate], ng-template[monaComboBoxNoDataTemplate], ng-template[monaMultiSelectNoDataTemplate] ", never, {}, {}, never, never, true, never>;
245
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownNoDataTemplateDirective, " ng-template[monaDropDownNoDataTemplate], ng-template[monaAutoCompleteNoDataTemplate], ng-template[monaDropDownListNoDataTemplate], ng-template[monaDropDownTreeNoDataTemplate], ng-template[monaComboBoxNoDataTemplate], ng-template[monaMultiSelectNoDataTemplate], ng-template[monaMultiSelectTreeNoDataTemplate] ", never, {}, {}, never, never, true, never>;
123
246
  }
124
247
  export declare class DropdownVirtualScrollDirective {
125
248
  #private;
@@ -149,10 +272,30 @@ export declare class DropdownPopupHandlerDirective {
149
272
  #private;
150
273
  constructor();
151
274
  private closePopup;
275
+ private createPopup;
276
+ /**
277
+ * Opens the popup as a sheet along the bottom of the screen, with the field's name and a close button above the
278
+ * dropdown's popup content. Focus stays where it is, as with the popup under the field.
279
+ */
280
+ private createSheet;
281
+ /**
282
+ * Keeps the sheet on the bottom edge of what is visible. An on-screen keyboard (opened by the filter box) shrinks
283
+ * the visual viewport but not the layout viewport the overlay is placed in, so the sheet is lifted above it.
284
+ */
285
+ private followVisualViewport;
152
286
  private getMaxHeight;
153
287
  private getMinWidth;
288
+ /** An element's name as assistive technology reads it: `aria-labelledby` first, then `aria-label`, then `<label>`s. */
289
+ private nameOf;
154
290
  private openPopup;
291
+ /** Whether the popup opens as a bottom sheet: with `adaptiveMode="auto"`, on a small screen. */
292
+ private opensAsSheet;
155
293
  private setPopupCloseSubscriptions;
294
+ /**
295
+ * The bottom sheet's title: the host's `adaptiveTitle`, or else the field's name. A date or time picker names its
296
+ * input rather than itself, so the input's name is read when the host has none.
297
+ */
298
+ private sheetTitle;
156
299
  private togglePopup;
157
300
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownPopupHandlerDirective, never>;
158
301
  static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownPopupHandlerDirective, "[monaDropdownPopupHandler]", never, {}, {}, never, never, true, never>;
@@ -198,6 +341,36 @@ export declare class DropdownSuffixTemplateDirective {
198
341
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownSuffixTemplateDirective, never>;
199
342
  static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownSuffixTemplateDirective, "ng-template[monaDropdownSuffixTemplate]", never, {}, {}, never, never, true, never>;
200
343
  }
344
+ /**
345
+ * Opens and closes the popup of a dropdown tree or a multi-select tree, and moves through its tree.
346
+ *
347
+ * The field keeps focus, or the popup's filter box does, and the tree follows: the arrow keys, Home, End, `*` and
348
+ * typeahead move its active node the way they move a focused tree's. Enter and Space go to the component through
349
+ * `DropdownService.keydown$`, to select or check the active node.
350
+ *
351
+ * When the popup opens, the selected node (or the first checked one) becomes the active node, with its ancestors
352
+ * opened; without one, the first node does. As the filter changes, its first match does. Closing the popup clears
353
+ * the filter.
354
+ * @hidden Exported for Mona UI's other entry points; applications don't need it.
355
+ */
356
+ export declare class DropdownTreePopupHandlerDirective<T> {
357
+ #private;
358
+ constructor();
359
+ /** Makes the selected node, or else the first checked one, the active node, opening its ancestors to show it. */
360
+ private activateCurrentNode;
361
+ private closePopup;
362
+ /** Arrow keys and Enter pressed in the popup's filter box. */
363
+ private handleFilterKeydown;
364
+ private handleHostKeydown;
365
+ private navigate;
366
+ private setHostEvents;
367
+ static ɵfac: i0.ɵɵFactoryDeclaration<DropdownTreePopupHandlerDirective<any>, never>;
368
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownTreePopupHandlerDirective<any>, "[monaDropdownTreePopupHandler]", never, {}, {}, never, never, true, [{
369
+ directive: typeof DropdownPopupHandlerDirective;
370
+ inputs: {};
371
+ outputs: {};
372
+ }]>;
373
+ }
201
374
  /**
202
375
  * @hidden
203
376
  * The state one dropdown shares with its popup handlers and live region. Each dropdown provides its own; the date and
@@ -243,6 +416,11 @@ export declare class DropdownService {
243
416
  * The auto-complete sets it to `false`.
244
417
  */
245
418
  readonly restoreFocus: import("@angular/core").WritableSignal<boolean | "auto">;
419
+ /**
420
+ * Whether the open popup is a bottom sheet (`adaptiveMode="auto"` on a small screen). The dropdowns style their
421
+ * popup content for it. `false` while the popup is closed.
422
+ */
423
+ readonly sheet: import("@angular/core").WritableSignal<boolean>;
246
424
  /**
247
425
  * Opens the popup with the given settings when it is closed. Does nothing while the host is disabled or read-only,
248
426
  * or when the `open` event is prevented.
@@ -263,9 +441,40 @@ export declare class DropdownListService<TData = unknown> {
263
441
  }
264
442
  /** @hidden Exported for Mona UI's other entry points; applications don't need it. */
265
443
  export declare const dropdownPopupThemeVariants: (props?: ({
266
- rounded?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
267
- size?: "small" | "medium" | "large" | null | undefined;
444
+ rounded?: "none" | "large" | "medium" | "small" | "full" | null | undefined;
445
+ size?: "large" | "medium" | "small" | null | undefined;
268
446
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
269
447
  export type DropdownPopupVariantProps = VariantProps<typeof dropdownPopupThemeVariants>;
270
448
  export type DropdownPopupVariantInput = VariantInputs<DropdownPopupVariantProps>;
271
- export declare const DROPDOWNS_DEFAULT_MESSAGES: MonaDropdownsMessages;
449
+ /**
450
+ * The bottom sheet a dropdown's popup opens as on a small screen. Its rounded top edge faces the page; the bottom
451
+ * padding keeps the content above the home indicator. `overflow-clip`, not `hidden`, so content that takes focus
452
+ * during the slide-in can't scroll the sheet and cancel the animation.
453
+ * @hidden Exported for Mona UI's other entry points; applications don't need it.
454
+ */
455
+ export declare const dropdownSheetThemeVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
456
+ /**
457
+ * A dropdown's popup surface inside the bottom sheet: the sheet draws the border, corners and shadow, and sets the
458
+ * height, so the surface only fills it. Options and nodes are 44 pixels tall there, to be easy to tap.
459
+ * @hidden Exported for Mona UI's other entry points; applications don't need it.
460
+ */
461
+ export declare const dropdownSheetSurfaceClasses = "\n h-full max-h-none flex-1 rounded-none border-0 shadow-none text-base\n [&_[role=option]]:min-h-11 [&_mona-tree-node>div]:py-2.5\n";
462
+ /**
463
+ * A date or time picker's popup inside the bottom sheet: it fills the sheet, which draws the border, corners and
464
+ * shadow, and scrolls when it's taller, as several months can be.
465
+ *
466
+ * The calendar spans the sheet's width, and its days grow to 44 pixels, to be easy to tap, as far as eight columns
467
+ * (with week numbers) still fit the screen. It keeps the height of a six-week month (its padding, header and gap,
468
+ * then seven rows of days with the weekday names), so the sheet's top edge, and the buttons on it, stay put as the
469
+ * months change.
470
+ * @hidden Exported for Mona UI's other entry points; applications don't need it.
471
+ */
472
+ export declare const dropdownSheetPickerClasses = "\n h-full max-h-none min-h-0 w-full max-w-none flex-1 rounded-none border-0 shadow-none\n [--mona-calendar-cell-size:min(2.75rem,calc((100dvw_-_3rem)/8))]\n [&_mona-calendar]:w-full [&_mona-calendar]:shrink-0\n [&_mona-calendar]:min-h-[calc(4.5rem_+_7_*_var(--mona-calendar-cell-size))]\n";
473
+ /**
474
+ * Reads a dropdown field from an item: a property of it when the field is a name, or what the field returns when it
475
+ * is an accessor. Without a field, the item itself.
476
+ * @hidden Exported for Mona UI's other entry points; applications don't need it.
477
+ */
478
+ export declare function readDropdownField<TData>(item: TData, field: DropdownFieldPredicateType<TData> | DropdownFieldSelectorType<TData>): unknown;
479
+ export declare const DROPDOWNS_DEFAULT_MESSAGES: MonaDropdownsMessages;
480
+ export type { AdaptiveMode };
@@ -323,7 +323,12 @@ export type DialogMessages = MonaDialogMessages;
323
323
  export interface MonaDropdownListMessages {
324
324
  readonly clear: string;
325
325
  }
326
+ export interface MonaDropdownTreeMessages {
327
+ readonly clear: string;
328
+ }
326
329
  export interface MonaDropdownsMessages {
330
+ /** The button that closes a dropdown's popup when it opens as a bottom sheet on a small screen. */
331
+ readonly close: string;
327
332
  readonly itemPosition: (text: string, position: number, total: number) => string;
328
333
  readonly noResultsFound: string;
329
334
  readonly resultsAvailable: (count: number) => string;
@@ -758,6 +763,11 @@ export interface MonaMultiSelectMessages {
758
763
  /** The option at the top of the list that selects every item shown, or clears them when they're all selected. */
759
764
  readonly selectAll: string;
760
765
  }
766
+ export interface MonaMultiSelectTreeMessages {
767
+ readonly clear: string;
768
+ readonly itemsCount: (count: number) => string;
769
+ readonly removeMoreItems: (count: number) => string;
770
+ }
761
771
  export interface MonaNotificationMessages {
762
772
  readonly close: string;
763
773
  readonly error: string;
@@ -990,6 +1000,7 @@ export interface MonaLocaleMessages {
990
1000
  dateTimePicker: MonaDateTimePickerMessages;
991
1001
  dialog: MonaDialogMessages;
992
1002
  dropdownList: MonaDropdownListMessages;
1003
+ dropdownTree: MonaDropdownTreeMessages;
993
1004
  dropdowns: MonaDropdownsMessages;
994
1005
  editor: MonaEditorMessages;
995
1006
  fileUpload: MonaFileUploadMessages;
@@ -1001,6 +1012,7 @@ export interface MonaLocaleMessages {
1001
1012
  listBox: MonaListBoxMessages;
1002
1013
  maskedTextBox: MonaMaskedTextBoxMessages;
1003
1014
  multiSelect: MonaMultiSelectMessages;
1015
+ multiSelectTree: MonaMultiSelectTreeMessages;
1004
1016
  notification: MonaNotificationMessages;
1005
1017
  numericTextBox: MonaNumericTextBoxMessages;
1006
1018
  otpInput: MonaOtpInputMessages;
@@ -238,6 +238,8 @@ export declare class TreeService<T> {
238
238
  readonly blur$: Subject<FocusEvent>;
239
239
  readonly checkBy: import("@angular/core").WritableSignal<NodeKeySelector<T>>;
240
240
  readonly checkableOptions: import("@angular/core").WritableSignal<CheckableOptions>;
241
+ /** The keys of the checked nodes, whether the user checked them or they were set from code. */
242
+ readonly checkedKeys: import("@angular/core").Signal<ImmutableSet<unknown>>;
241
243
  /**
242
244
  * The checked keys after the user checks or unchecks a node. Keys set from code, and keys the tree derives on its
243
245
  * own (parents with `checkParents`, lazily loaded children of a checked node, ancestors after a move), aren't
@@ -320,6 +322,8 @@ export declare class TreeService<T> {
320
322
  * nodes, the node of the same data item (or, for flat data, of the same id).
321
323
  */
322
324
  findCounterpart(node: TreeNode<T>): TreeNode<T> | null;
325
+ /** The first node, in the tree's order, whose text matches the filter. `null` without a filter or a match. */
326
+ findFirstMatch(): TreeNode<T> | null;
323
327
  /**
324
328
  * Finds the next visible node whose text starts with `prefix` (case-insensitive), wrapping around. Used for
325
329
  * typeahead: a first character searches after the navigated node, and each further character keeps the
@@ -467,6 +471,11 @@ export declare class TreeComponent<T> {
467
471
  readonly ariaLabel: import("@angular/core").InputSignal<string>;
468
472
  readonly ariaLabelledBy: import("@angular/core").InputSignal<string>;
469
473
  readonly data: import("@angular/core").InputSignal<Iterable<T> | undefined>;
474
+ /**
475
+ * Whether the tree takes focus itself. A dropdown's popup tree doesn't: its field keeps focus, drives the tree
476
+ * through the `TreeService`, and points `aria-activedescendant` at the active node.
477
+ */
478
+ readonly focusable: import("@angular/core").InputSignal<boolean>;
470
479
  readonly nodeTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
471
480
  readonly treeService: TreeService<T>;
472
481
  constructor();
@@ -493,6 +502,8 @@ export declare class TreeComponent<T> {
493
502
  */
494
503
  private moveWithKeyboard;
495
504
  private notifyDropPositionChange;
505
+ /** Scrolls the node's row, not its open subtree, into view. "nearest" leaves a row that is already visible alone. */
506
+ private scrollNodeIntoView;
496
507
  private setFocusSubscription;
497
508
  private setKeydownSubscription;
498
509
  private setNodeDragHandlerSubscription;
@@ -520,6 +531,11 @@ export declare class TreeComponent<T> {
520
531
  "required": false;
521
532
  "isSignal": true;
522
533
  };
534
+ "focusable": {
535
+ "alias": "focusable";
536
+ "required": false;
537
+ "isSignal": true;
538
+ };
523
539
  }, {}, ["nodeTemplate"], never, true, never>;
524
540
  }
525
541
  export declare class TreeNodeTemplateDirective {
@@ -537,6 +553,26 @@ interface ChildrenLoadErrorEvent<T> {
537
553
  /** The node whose children failed to load. */
538
554
  readonly node: NodeItem<T>;
539
555
  }
556
+ export declare function getTreeNodeElementId(uid: string): string;
557
+ /** What {@link handleTreeNavigationKey} needs besides the key. */
558
+ export interface TreeNavigationKeyContext<T> {
559
+ /** Whether the tree is laid out right to left, which swaps the expand and collapse keys. */
560
+ readonly rtl: boolean;
561
+ readonly treeService: TreeService<T>;
562
+ /** Takes a typed character for typeahead. Space isn't passed: a tree uses it to check nodes. */
563
+ readonly typeahead: (key: string) => void;
564
+ }
565
+ /**
566
+ * Moves through a tree the way the WAI-ARIA tree pattern does: the arrow keys move the active node and open or close
567
+ * it, Home and End go to the first and last node, `*` opens the node's siblings, and printable characters go to
568
+ * typeahead. Space and Enter are left to the caller, which checks or selects with them. Keys with Ctrl, Alt or Meta
569
+ * are left alone.
570
+ *
571
+ * The tree uses it for its own keys, and a dropdown tree for the keys of its field, which keeps focus while its popup
572
+ * tree follows.
573
+ * @returns whether the key was handled, in which case its default action is prevented.
574
+ */
575
+ export declare function handleTreeNavigationKey<T>(event: KeyboardEvent, context: TreeNavigationKeyContext<T>): boolean;
540
576
  /**
541
577
  * Moves a node within a generic flat tree structure that uses parentId references.
542
578
  * @param treeData - The flat array of tree nodes.
@@ -213,7 +213,11 @@ export declare const MONA_AR_SA_LOCALE: {
213
213
  dropdownList: {
214
214
  clear: string;
215
215
  };
216
+ dropdownTree: {
217
+ clear: string;
218
+ };
216
219
  dropdowns: {
220
+ close: string;
217
221
  itemPosition: (text: string, position: number, total: number) => string;
218
222
  noResultsFound: string;
219
223
  resultsAvailable: (count: number) => string;
@@ -478,6 +482,11 @@ export declare const MONA_AR_SA_LOCALE: {
478
482
  removeMoreItems: (count: number) => string;
479
483
  selectAll: string;
480
484
  };
485
+ multiSelectTree: {
486
+ clear: string;
487
+ itemsCount: (count: number) => string;
488
+ removeMoreItems: (count: number) => string;
489
+ };
481
490
  notification: {
482
491
  close: string;
483
492
  error: string;
@@ -213,7 +213,11 @@ export declare const MONA_DE_DE_LOCALE: {
213
213
  dropdownList: {
214
214
  clear: string;
215
215
  };
216
+ dropdownTree: {
217
+ clear: string;
218
+ };
216
219
  dropdowns: {
220
+ close: string;
217
221
  itemPosition: (text: string, position: number, total: number) => string;
218
222
  noResultsFound: string;
219
223
  resultsAvailable: (count: number) => string;
@@ -478,6 +482,11 @@ export declare const MONA_DE_DE_LOCALE: {
478
482
  removeMoreItems: (count: number) => string;
479
483
  selectAll: string;
480
484
  };
485
+ multiSelectTree: {
486
+ clear: string;
487
+ itemsCount: (count: number) => string;
488
+ removeMoreItems: (count: number) => string;
489
+ };
481
490
  notification: {
482
491
  close: string;
483
492
  error: string;
@@ -213,7 +213,11 @@ export declare const MONA_ES_ES_LOCALE: {
213
213
  dropdownList: {
214
214
  clear: string;
215
215
  };
216
+ dropdownTree: {
217
+ clear: string;
218
+ };
216
219
  dropdowns: {
220
+ close: string;
217
221
  itemPosition: (text: string, position: number, total: number) => string;
218
222
  noResultsFound: string;
219
223
  resultsAvailable: (count: number) => string;
@@ -478,6 +482,11 @@ export declare const MONA_ES_ES_LOCALE: {
478
482
  removeMoreItems: (count: number) => string;
479
483
  selectAll: string;
480
484
  };
485
+ multiSelectTree: {
486
+ clear: string;
487
+ itemsCount: (count: number) => string;
488
+ removeMoreItems: (count: number) => string;
489
+ };
481
490
  notification: {
482
491
  close: string;
483
492
  error: string;
@@ -213,7 +213,11 @@ export declare const MONA_FR_FR_LOCALE: {
213
213
  dropdownList: {
214
214
  clear: string;
215
215
  };
216
+ dropdownTree: {
217
+ clear: string;
218
+ };
216
219
  dropdowns: {
220
+ close: string;
217
221
  itemPosition: (text: string, position: number, total: number) => string;
218
222
  noResultsFound: string;
219
223
  resultsAvailable: (count: number) => string;
@@ -478,6 +482,11 @@ export declare const MONA_FR_FR_LOCALE: {
478
482
  removeMoreItems: (count: number) => string;
479
483
  selectAll: string;
480
484
  };
485
+ multiSelectTree: {
486
+ clear: string;
487
+ itemsCount: (count: number) => string;
488
+ removeMoreItems: (count: number) => string;
489
+ };
481
490
  notification: {
482
491
  close: string;
483
492
  error: string;
@@ -213,7 +213,11 @@ export declare const MONA_ID_ID_LOCALE: {
213
213
  dropdownList: {
214
214
  clear: string;
215
215
  };
216
+ dropdownTree: {
217
+ clear: string;
218
+ };
216
219
  dropdowns: {
220
+ close: string;
217
221
  itemPosition: (text: string, position: number, total: number) => string;
218
222
  noResultsFound: string;
219
223
  resultsAvailable: (count: number) => string;
@@ -478,6 +482,11 @@ export declare const MONA_ID_ID_LOCALE: {
478
482
  removeMoreItems: (count: number) => string;
479
483
  selectAll: string;
480
484
  };
485
+ multiSelectTree: {
486
+ clear: string;
487
+ itemsCount: (count: number) => string;
488
+ removeMoreItems: (count: number) => string;
489
+ };
481
490
  notification: {
482
491
  close: string;
483
492
  error: string;
@@ -213,7 +213,11 @@ export declare const MONA_IT_IT_LOCALE: {
213
213
  dropdownList: {
214
214
  clear: string;
215
215
  };
216
+ dropdownTree: {
217
+ clear: string;
218
+ };
216
219
  dropdowns: {
220
+ close: string;
217
221
  itemPosition: (text: string, position: number, total: number) => string;
218
222
  noResultsFound: string;
219
223
  resultsAvailable: (count: number) => string;
@@ -478,6 +482,11 @@ export declare const MONA_IT_IT_LOCALE: {
478
482
  removeMoreItems: (count: number) => string;
479
483
  selectAll: string;
480
484
  };
485
+ multiSelectTree: {
486
+ clear: string;
487
+ itemsCount: (count: number) => string;
488
+ removeMoreItems: (count: number) => string;
489
+ };
481
490
  notification: {
482
491
  close: string;
483
492
  error: string;
@@ -213,7 +213,11 @@ export declare const MONA_JA_JP_LOCALE: {
213
213
  dropdownList: {
214
214
  clear: string;
215
215
  };
216
+ dropdownTree: {
217
+ clear: string;
218
+ };
216
219
  dropdowns: {
220
+ close: string;
217
221
  itemPosition: (text: string, position: number, total: number) => string;
218
222
  noResultsFound: string;
219
223
  resultsAvailable: (count: number) => string;
@@ -478,6 +482,11 @@ export declare const MONA_JA_JP_LOCALE: {
478
482
  removeMoreItems: (count: number) => string;
479
483
  selectAll: string;
480
484
  };
485
+ multiSelectTree: {
486
+ clear: string;
487
+ itemsCount: (count: number) => string;
488
+ removeMoreItems: (count: number) => string;
489
+ };
481
490
  notification: {
482
491
  close: string;
483
492
  error: string;
@@ -213,7 +213,11 @@ export declare const MONA_KO_KR_LOCALE: {
213
213
  dropdownList: {
214
214
  clear: string;
215
215
  };
216
+ dropdownTree: {
217
+ clear: string;
218
+ };
216
219
  dropdowns: {
220
+ close: string;
217
221
  itemPosition: (text: string, position: number, total: number) => string;
218
222
  noResultsFound: string;
219
223
  resultsAvailable: (count: number) => string;
@@ -478,6 +482,11 @@ export declare const MONA_KO_KR_LOCALE: {
478
482
  removeMoreItems: (count: number) => string;
479
483
  selectAll: string;
480
484
  };
485
+ multiSelectTree: {
486
+ clear: string;
487
+ itemsCount: (count: number) => string;
488
+ removeMoreItems: (count: number) => string;
489
+ };
481
490
  notification: {
482
491
  close: string;
483
492
  error: string;
@@ -213,7 +213,11 @@ export declare const MONA_PL_PL_LOCALE: {
213
213
  dropdownList: {
214
214
  clear: string;
215
215
  };
216
+ dropdownTree: {
217
+ clear: string;
218
+ };
216
219
  dropdowns: {
220
+ close: string;
217
221
  itemPosition: (text: string, position: number, total: number) => string;
218
222
  noResultsFound: string;
219
223
  resultsAvailable: (count: number) => string;
@@ -478,6 +482,11 @@ export declare const MONA_PL_PL_LOCALE: {
478
482
  removeMoreItems: (count: number) => string;
479
483
  selectAll: string;
480
484
  };
485
+ multiSelectTree: {
486
+ clear: string;
487
+ itemsCount: (count: number) => string;
488
+ removeMoreItems: (count: number) => string;
489
+ };
481
490
  notification: {
482
491
  close: string;
483
492
  error: string;