@nanahoshi/mona-ui 0.27.2 → 0.28.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 (208) hide show
  1. package/docs/api/chart.md +2 -2
  2. package/docs/api/popup.md +1 -1
  3. package/docs/api/theme.md +2 -2
  4. package/docs/chart.md +14 -0
  5. package/docs/editor.md +2 -0
  6. package/docs/installation.md +147 -15
  7. package/docs/introduction.md +37 -15
  8. package/docs/theming-built-in-themes.md +67 -0
  9. package/docs/theming-custom-colors.md +274 -0
  10. package/docs/theming-custom-themes.md +168 -0
  11. package/docs/theming.md +164 -248
  12. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
  13. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
  14. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
  15. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
  16. package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
  17. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
  18. package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
  19. package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
  20. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
  21. package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
  22. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
  23. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
  24. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
  25. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
  26. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
  27. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
  28. package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
  29. package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
  30. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
  31. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
  32. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
  33. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
  34. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
  35. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
  36. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
  37. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
  38. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
  39. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
  40. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
  41. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
  42. package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
  43. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
  44. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
  45. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
  46. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
  47. package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
  48. package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
  49. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
  50. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
  51. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
  52. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
  53. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
  54. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
  55. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
  56. package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
  57. package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
  58. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
  59. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
  60. package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
  61. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
  62. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
  63. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
  64. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
  65. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
  66. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
  67. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
  68. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
  69. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
  70. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
  71. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
  72. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
  73. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
  74. package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
  75. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
  76. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
  77. package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
  78. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
  79. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
  80. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
  81. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
  82. package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
  83. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
  84. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
  85. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
  86. package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
  87. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
  88. package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
  89. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
  90. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
  91. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
  92. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
  93. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
  94. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
  95. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
  96. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
  97. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
  98. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
  99. package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
  100. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
  101. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
  102. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
  103. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
  104. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
  105. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
  106. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
  107. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
  108. package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
  109. package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
  110. package/llms.txt +6 -2
  111. package/package.json +62 -23
  112. package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
  113. package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
  114. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
  115. package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
  116. package/types/nanahoshi-mona-ui-button.d.ts +227 -166
  117. package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
  118. package/types/nanahoshi-mona-ui-card.d.ts +125 -111
  119. package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
  120. package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
  121. package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
  122. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
  123. package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
  124. package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
  125. package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
  126. package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
  127. package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
  128. package/types/nanahoshi-mona-ui-command.d.ts +279 -191
  129. package/types/nanahoshi-mona-ui-common.d.ts +354 -385
  130. package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
  131. package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
  132. package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
  133. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
  134. package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
  135. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
  136. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
  137. package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
  138. package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
  139. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
  140. package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
  141. package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
  142. package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
  143. package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
  144. package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
  145. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
  146. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
  147. package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
  148. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
  149. package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
  150. package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
  151. package/types/nanahoshi-mona-ui-label.d.ts +108 -78
  152. package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
  153. package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
  154. package/types/nanahoshi-mona-ui-list.d.ts +2 -1
  155. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
  156. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
  157. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
  158. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
  159. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
  160. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
  161. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
  162. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
  163. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
  164. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
  165. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
  166. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
  167. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
  168. package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
  169. package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
  170. package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
  171. package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
  172. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
  173. package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
  174. package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
  175. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
  176. package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
  177. package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
  178. package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
  179. package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
  180. package/types/nanahoshi-mona-ui-query.d.ts +82 -88
  181. package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
  182. package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
  183. package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
  184. package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
  185. package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
  186. package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
  187. package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
  188. package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
  189. package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
  190. package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
  191. package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
  192. package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
  193. package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
  194. package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
  195. package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
  196. package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
  197. package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
  198. package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
  199. package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
  200. package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
  201. package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
  202. package/types/nanahoshi-mona-ui-window.d.ts +494 -399
  203. package/types/nanahoshi-mona-ui.d.ts +1 -2
  204. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
  205. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
  206. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
  207. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
  208. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
@@ -1,444 +1,510 @@
1
- import * as _angular_core from '@angular/core';
2
- import { OnInit, Signal, TemplateRef, InjectionToken } from '@angular/core';
3
- import * as _nanahoshi_mona_ui_i18n from '@nanahoshi/mona-ui/i18n';
4
- import { MonaListMessages } from '@nanahoshi/mona-ui/i18n';
5
- import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
6
- import { FilterChangeEvent, FilterableOptions, VirtualScrollOptions } from '@nanahoshi/mona-ui/common';
7
- import { Selector, Predicate, ImmutableSet } from '@mirei/ts-collections';
8
- import { Subject, ReplaySubject } from 'rxjs';
9
-
1
+ import { CdkVirtualScrollViewport } from "@angular/cdk/scrolling";
2
+ import * as i0 from "@angular/core";
3
+ import { InjectionToken, OnInit, Signal, TemplateRef } from "@angular/core";
4
+ import { FilterChangeEvent, FilterableOptions, VirtualScrollOptions } from "@nanahoshi/mona-ui/common";
5
+ import { ImmutableSet, Predicate, Selector } from "@mirei/ts-collections";
6
+ import { ReplaySubject, Subject } from "rxjs";
7
+ import { MonaListMessages } from "@nanahoshi/mona-ui/i18n";
10
8
  interface ListItemOptions<T> {
11
- data: T;
12
- header?: string;
13
- /**
14
- * Marks the item as a group header. Defaults to `true` when a non-empty `header` is given.
15
- * Set it explicitly for groups whose key is empty, which still need a header row.
16
- */
17
- isHeader?: boolean;
18
- /**
19
- * Reuses an existing identifier, so an item rebuilt for refreshed data keeps its DOM id and tracking.
20
- * A new UUID is generated when omitted.
21
- */
22
- uid?: string;
9
+ data: T;
10
+ header?: string;
11
+ /**
12
+ * Marks the item as a group header. Defaults to `true` when a non-empty `header` is given.
13
+ * Set it explicitly for groups whose key is empty, which still need a header row.
14
+ */
15
+ isHeader?: boolean;
16
+ /**
17
+ * Reuses an existing identifier, so an item rebuilt for refreshed data keeps its DOM id and tracking.
18
+ * A new UUID is generated when omitted.
19
+ */
20
+ uid?: string;
23
21
  }
24
22
  /** An item of a list, wrapping its data item. */
25
- declare class ListItem<TData> {
26
- readonly data: TData;
27
- readonly header: string;
28
- readonly isHeader: boolean;
29
- readonly uid: string;
30
- constructor(options: ListItemOptions<TData>);
23
+ export declare class ListItem<TData> {
24
+ readonly data: TData;
25
+ readonly header: string;
26
+ readonly isHeader: boolean;
27
+ readonly uid: string;
28
+ constructor(options: ListItemOptions<TData>);
31
29
  }
32
-
33
- type ListKeySelector<T, K = unknown> = string | Selector<T, K> | null;
34
-
30
+ export type ListKeySelector<T, K = unknown> = string | Selector<T, K> | null;
35
31
  /** A CSS length, or nothing to leave it to the stylesheet. */
36
32
  type ListSizeType = string | null | undefined;
37
33
  type ListSizeInputType = ListSizeType | number;
38
-
39
34
  interface SelectionChangeEvent<T> {
40
- item: ListItem<T>;
41
- source: SelectionSource;
35
+ item: ListItem<T>;
36
+ source: SelectionSource;
42
37
  }
43
38
  type SelectionSource = {
44
- via: "mouse";
39
+ via: "mouse";
45
40
  } | {
46
- via: "keyboard";
47
- key: string;
41
+ via: "keyboard";
42
+ key: string;
48
43
  };
49
-
50
44
  /** How the items within each group are ordered. Leave both out to keep their order. */
51
- type OrderByOptions<T, R> = {
52
- orderBy?: never;
53
- orderByDirection?: never;
45
+ export type OrderByOptions<T, R> = {
46
+ orderBy?: never;
47
+ orderByDirection?: never;
54
48
  } | {
55
- /**
56
- * The field to order the items of per group. If not specified, the items of the group will not be ordered.
57
- */
58
- orderBy: string | Selector<T, R>;
59
- /**
60
- * The direction to order the items of per group.
61
- */
62
- orderByDirection?: "asc" | "desc";
49
+ /**
50
+ * The field to order the items of per group. If not specified, the items of the group will not be ordered.
51
+ */
52
+ orderBy: string | Selector<T, R>;
53
+ /**
54
+ * The direction to order the items of per group.
55
+ */
56
+ orderByDirection?: "asc" | "desc";
63
57
  };
64
- type GroupableOptions<T = unknown, R = unknown> = {
65
- /**
66
- * Whether to group the items. If not specified, the items will not be grouped.
67
- */
68
- enabled?: boolean;
69
- /**
70
- * The direction to order the group headers.
71
- * If not specified, the group headers will be ordered in ascending order.
72
- */
73
- headerOrder?: "asc" | "desc";
74
- /**
75
- * Text of a group's header, from the group's value (the first item's value when several values form one group,
76
- * such as two `Date` objects for the same moment). Defaults to dates in the locale's medium date format,
77
- * numbers in the locale's digits, and `String(value)` for everything else.
78
- */
79
- headerText?: (value: unknown) => string;
58
+ export type GroupableOptions<T = unknown, R = unknown> = {
59
+ /**
60
+ * Whether to group the items. If not specified, the items will not be grouped.
61
+ */
62
+ enabled?: boolean;
63
+ /**
64
+ * The direction to order the group headers.
65
+ * If not specified, the group headers will be ordered in ascending order.
66
+ */
67
+ headerOrder?: "asc" | "desc";
68
+ /**
69
+ * Text of a group's header, from the group's value (the first item's value when several values form one group,
70
+ * such as two `Date` objects for the same moment). Defaults to dates in the locale's medium date format,
71
+ * numbers in the locale's digits, and `String(value)` for everything else.
72
+ */
73
+ headerText?: (value: unknown) => string;
80
74
  } & OrderByOptions<T, R>;
81
-
82
75
  /** Whether arrow keys only highlight an item, or select it as well. */
83
- type NavigationMode = "highlight" | "select";
84
-
85
- interface NavigableOptions {
86
- /** Whether keyboard navigation is active. */
87
- enabled: boolean;
88
- /** Whether navigation only moves a visual highlight (`"highlight"`) or also changes selection (`"select"`). */
89
- mode: NavigationMode;
90
- /** Whether navigating past the last (or before the first) item cycles to the other end. */
91
- wrap: boolean;
76
+ export type NavigationMode = "highlight" | "select";
77
+ export interface NavigableOptions {
78
+ /** Whether keyboard navigation is active. */
79
+ enabled: boolean;
80
+ /** Whether navigation only moves a visual highlight (`"highlight"`) or also changes selection (`"select"`). */
81
+ mode: NavigationMode;
82
+ /** Whether navigating past the last (or before the first) item cycles to the other end. */
83
+ wrap: boolean;
92
84
  }
93
-
94
- type NavigationDirection = "next" | "previous" | "first" | "last" | "pageup" | "pagedown";
95
-
96
- interface PagerSettings {
97
- /** Whether the pager is active. */
98
- enabled: boolean;
99
- /** Whether first/last page buttons are shown. */
100
- firstLast: boolean;
101
- /** Number of items shown per page. */
102
- pageSize: number;
103
- /** Page size options shown in the pager, or `false`/`true` to hide/show a default set. */
104
- pageSizeValues: number[] | boolean;
105
- /** Whether previous/next page buttons are shown. */
106
- previousNext: boolean;
107
- /** Whether a page summary (e.g. "1-10 of 50") is shown. */
108
- showInfo: boolean;
109
- /** Whether pages are selected via numbered buttons or a page-number input. */
110
- type: "numeric" | "input";
111
- /** Number of numeric page buttons shown at once, when `type` is `"numeric"`. */
112
- visiblePages: number;
85
+ export type NavigationDirection = "next" | "previous" | "first" | "last" | "pageup" | "pagedown";
86
+ export interface PagerSettings {
87
+ /** Whether the pager is active. */
88
+ enabled: boolean;
89
+ /** Whether first/last page buttons are shown. */
90
+ firstLast: boolean;
91
+ /** Number of items shown per page. */
92
+ pageSize: number;
93
+ /** Page size options shown in the pager, or `false`/`true` to hide/show a default set. */
94
+ pageSizeValues: number[] | boolean;
95
+ /** Whether previous/next page buttons are shown. */
96
+ previousNext: boolean;
97
+ /** Whether a page summary (e.g. "1-10 of 50") is shown. */
98
+ showInfo: boolean;
99
+ /** Whether pages are selected via numbered buttons or a page-number input. */
100
+ type: "numeric" | "input";
101
+ /** Number of numeric page buttons shown at once, when `type` is `"numeric"`. */
102
+ visiblePages: number;
113
103
  }
114
-
115
104
  interface PageState {
116
- page: number;
117
- skip: number;
118
- take: number;
105
+ page: number;
106
+ skip: number;
107
+ take: number;
119
108
  }
120
-
121
- type SelectableOptions = {
122
- checkboxes?: boolean;
123
- enabled?: boolean;
124
- mode: "single";
125
- toggleable?: boolean;
109
+ export type SelectableOptions = {
110
+ checkboxes?: boolean;
111
+ enabled?: boolean;
112
+ mode: "single";
113
+ toggleable?: boolean;
126
114
  } | {
127
- checkboxes?: boolean;
128
- enabled?: boolean;
129
- mode: "multiple";
115
+ checkboxes?: boolean;
116
+ enabled?: boolean;
117
+ mode: "multiple";
130
118
  };
131
-
132
- declare class ListService<TData> {
133
- #private;
134
- readonly disabledBy: _angular_core.WritableSignal<string | Predicate<TData>>;
135
- readonly filterChange$: Subject<FilterChangeEvent>;
136
- readonly filterInputVisible: _angular_core.WritableSignal<boolean>;
137
- readonly filterPlaceholder: _angular_core.WritableSignal<string>;
138
- readonly filterText: _angular_core.WritableSignal<string>;
139
- readonly filterableOptions: _angular_core.WritableSignal<FilterableOptions>;
140
- readonly focus$: Subject<void>;
141
- /**
142
- * The option that holds the list's Tab stop: the highlighted one, else the last selected one, else the first
143
- * enabled one. Only shown items count, so a selection on another page doesn't take the Tab stop away.
144
- */
145
- readonly focusableItem: _angular_core.Signal<ListItem<TData> | null>;
146
- readonly groupBy: _angular_core.WritableSignal<ListKeySelector<TData>>;
147
- /**
148
- * Maps each option uid to the uid of the group header it is listed under.
149
- */
150
- readonly groupHeaderUids: _angular_core.Signal<Map<string, string>>;
151
- readonly groupableOptions: _angular_core.WritableSignal<GroupableOptions<TData, unknown>>;
152
- /**
153
- * The highlighted (active) item. When the data changes, it is re-resolved to the item with the same `uid`,
154
- * or cleared when that item is gone.
155
- */
156
- readonly highlightedItem: _angular_core.WritableSignal<ListItem<TData> | null>;
157
- readonly itemFocusOut$: Subject<ListItem<TData>>;
158
- /**
159
- * Position of each option among all filtered options (not only the current page), for `aria-posinset`
160
- * and `aria-setsize`.
161
- */
162
- readonly itemPositions: _angular_core.Signal<Map<string, {
163
- position: number;
164
- total: number;
165
- }>>;
166
- readonly navigableOptions: _angular_core.WritableSignal<NavigableOptions>;
167
- readonly navigatedItem$: Subject<ListItem<TData> | null>;
168
- readonly pageState: _angular_core.WritableSignal<PageState>;
169
- readonly pageableOptions: _angular_core.WritableSignal<PagerSettings>;
170
- /**
171
- * `"listbox"` for options to choose from; `"list"` for items that are only shown, as `listitem`s without
172
- * selection state.
173
- */
174
- readonly role: _angular_core.WritableSignal<"list" | "listbox">;
175
- readonly scrollToItem$: ReplaySubject<{
176
- item: ListItem<TData>;
177
- focus: boolean;
178
- }>;
179
- readonly selectableOptions: _angular_core.WritableSignal<SelectableOptions>;
180
- readonly selectedKeys: _angular_core.WritableSignal<ImmutableSet<unknown>>;
181
- readonly selectedKeysChange$: Subject<unknown[]>;
182
- readonly selectedListItems: _angular_core.Signal<ImmutableSet<ListItem<TData>>>;
183
- readonly selectionChange$: Subject<ListItem<TData>>;
184
- readonly textField: _angular_core.WritableSignal<string | Selector<TData, string>>;
185
- readonly valueField: _angular_core.WritableSignal<string | Selector<TData, unknown>>;
186
- /**
187
- * Visible items in display order: filtered, ordered and grouped (with header rows), but not paged.
188
- */
189
- readonly viewItems: _angular_core.Signal<ImmutableSet<ListItem<TData>>>;
190
- readonly virtualScrollOptions: _angular_core.WritableSignal<VirtualScrollOptions>;
191
- clearFilter(): void;
192
- clearHighlightedItem(): void;
193
- clearSelections(): void;
194
- /**
195
- * Finds the next item whose text starts with the typeahead buffer, starting after the active item; once the
196
- * buffer holds more than one character, an active item that still matches stays.
197
- * Group headers and disabled items are never matched.
198
- */
199
- cycleThroughMatchedItems(buffer: string): ListItem<TData> | null;
200
- deselectItems(item: Iterable<ListItem<TData>>): void;
201
- /**
202
- * Resolves the selection value of a data item through `valueField`.
203
- *
204
- * When no `valueField` is configured, the data item itself is the value.
205
- * When `valueField` is a string, the item property is read with a nullish fallback to the item.
206
- * When `valueField` is a function, its result is used as-is.
207
- *
208
- * Falsy results such as `0`, `false`, and `""` are valid values and do not fall back to the item.
209
- */
210
- getDataItemValue(dataItem: TData): unknown;
211
- getFilterDebounceDuration(): number;
212
- getGroupField(item: ListItem<TData>): unknown;
213
- /**
214
- * Returns the uid of the group header an item is rendered under, or `null` when the list is not grouped.
215
- */
216
- getGroupHeaderUid(item: ListItem<TData>): string | null;
217
- getItemPosition(item: ListItem<TData>): {
218
- position: number;
219
- total: number;
220
- } | null;
221
- /**
222
- * Resolves the display text of an item through `textField`.
223
- * Non-string field values (numbers, dates, …) are converted with `String()`, and nullish values become `""`.
224
- */
225
- getItemText(item: ListItem<TData>): string;
226
- /**
227
- * Finds the item that typed text should resolve to: an exact text match first (respecting `caseSensitive`),
228
- * otherwise the first item accepted by the filter operator. Group headers and disabled items are skipped.
229
- */
230
- getMatchingFilteredItem(text: string): ListItem<TData> | null;
231
- /**
232
- * Whether a data item is disabled by `disabledBy`, whether or not it is in the list.
233
- */
234
- isDataItemDisabled(dataItem: TData): boolean;
235
- isDisabled(item: ListItem<TData>): boolean;
236
- isFilteringEnabled(): boolean;
237
- isHighlighted(item: ListItem<TData>): boolean;
238
- isSelected(item: ListItem<TData>): boolean;
239
- navigate(direction: NavigationDirection, mode: NavigationMode, focus: boolean): ListItem<TData> | null;
240
- notifySelectionChange(item: ListItem<TData>): void;
241
- scrollToItem(item: ListItem<TData>, focus: boolean): void;
242
- /**
243
- * Selects every enabled item currently in view, keeping existing selections. Only applies in multiple mode.
244
- * @returns whether the selection changed.
245
- */
246
- selectAllItems(): boolean;
247
- selectItem(item: ListItem<TData>, scroll?: boolean, focus?: boolean): void;
248
- setData(data: Iterable<TData>): void;
249
- setDisabledBy(disabledBy: string | Predicate<TData>): void;
250
- setFilter(filter: string): void;
251
- setFilterPlaceholder(placeholder: string): void;
252
- setFilterableOptions(options: Partial<FilterableOptions>): void;
253
- setGroupBy(groupSelector: ListKeySelector<TData>): void;
254
- setGroupableOptions(options: GroupableOptions<TData, unknown>): void;
255
- setNavigableOptions(options: Partial<NavigableOptions>): void;
256
- setPageableOptions(settings: PagerSettings): void;
257
- setSelectableOptions(options: Partial<SelectableOptions>): void;
258
- setSelectedDataItems(dataItems: Iterable<TData>): void;
259
- setSelectedKeys(selectedKeys: Iterable<unknown>): void;
260
- setTextField(textField: string | Selector<TData, string>): void;
261
- setValueField(valueField: string | Selector<TData, unknown>): void;
262
- setVirtualScrollOptions(options: VirtualScrollOptions): void;
263
- private filterItem;
264
- /**
265
- * Returns the item when it is one of the navigable items, otherwise `null`.
266
- * An anchor that was filtered out or removed must not be navigated from.
267
- */
268
- private getItemInView;
269
- private getOrderKey;
270
- private getPreviousItemForNavigation;
271
- private getSelectionKey;
272
- private navigateFirstForSingleSelection;
273
- private navigateForMultipleSelection;
274
- private navigateForSingleSelection;
275
- private navigateLastForSingleSelection;
276
- private navigateNextForSingleSelection;
277
- private navigatePreviousForSingleSelection;
278
- private skipTakeWithGroups;
279
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListService<any>, never>;
280
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<ListService<any>>;
119
+ export declare class ListService<TData> {
120
+ #private;
121
+ readonly disabledBy: import("@angular/core").WritableSignal<string | Predicate<TData>>;
122
+ readonly filterChange$: Subject<FilterChangeEvent>;
123
+ readonly filterInputVisible: import("@angular/core").WritableSignal<boolean>;
124
+ readonly filterPlaceholder: import("@angular/core").WritableSignal<string>;
125
+ readonly filterText: import("@angular/core").WritableSignal<string>;
126
+ readonly filterableOptions: import("@angular/core").WritableSignal<FilterableOptions>;
127
+ readonly focus$: Subject<void>;
128
+ /**
129
+ * The option that holds the list's Tab stop: the highlighted one, else the last selected one, else the first
130
+ * enabled one. Only shown items count, so a selection on another page doesn't take the Tab stop away.
131
+ */
132
+ readonly focusableItem: import("@angular/core").Signal<ListItem<TData> | null>;
133
+ readonly groupBy: import("@angular/core").WritableSignal<ListKeySelector<TData>>;
134
+ /**
135
+ * Maps each option uid to the uid of the group header it is listed under.
136
+ */
137
+ readonly groupHeaderUids: import("@angular/core").Signal<Map<string, string>>;
138
+ readonly groupableOptions: import("@angular/core").WritableSignal<GroupableOptions<TData, unknown>>;
139
+ /**
140
+ * The highlighted (active) item. When the data changes, it is re-resolved to the item with the same `uid`,
141
+ * or cleared when that item is gone.
142
+ */
143
+ readonly highlightedItem: import("@angular/core").WritableSignal<ListItem<TData> | null>;
144
+ readonly itemFocusOut$: Subject<ListItem<TData>>;
145
+ /**
146
+ * Position of each option among all filtered options (not only the current page), for `aria-posinset`
147
+ * and `aria-setsize`.
148
+ */
149
+ readonly itemPositions: import("@angular/core").Signal<Map<string, {
150
+ position: number;
151
+ total: number;
152
+ }>>;
153
+ readonly navigableOptions: import("@angular/core").WritableSignal<NavigableOptions>;
154
+ readonly navigatedItem$: Subject<ListItem<TData> | null>;
155
+ readonly pageState: import("@angular/core").WritableSignal<PageState>;
156
+ readonly pageableOptions: import("@angular/core").WritableSignal<PagerSettings>;
157
+ /**
158
+ * `"listbox"` for options to choose from; `"list"` for items that are only shown, as `listitem`s without
159
+ * selection state.
160
+ */
161
+ readonly role: import("@angular/core").WritableSignal<"list" | "listbox">;
162
+ readonly scrollToItem$: ReplaySubject<{
163
+ item: ListItem<TData>;
164
+ focus: boolean;
165
+ }>;
166
+ readonly selectableOptions: import("@angular/core").WritableSignal<SelectableOptions>;
167
+ readonly selectedKeys: import("@angular/core").WritableSignal<ImmutableSet<unknown>>;
168
+ readonly selectedKeysChange$: Subject<unknown[]>;
169
+ readonly selectedListItems: import("@angular/core").Signal<ImmutableSet<ListItem<TData>>>;
170
+ readonly selectionChange$: Subject<ListItem<TData>>;
171
+ readonly textField: import("@angular/core").WritableSignal<string | Selector<TData, string>>;
172
+ readonly valueField: import("@angular/core").WritableSignal<string | Selector<TData, unknown>>;
173
+ /**
174
+ * Visible items in display order: filtered, ordered and grouped (with header rows), but not paged.
175
+ */
176
+ readonly viewItems: import("@angular/core").Signal<ImmutableSet<ListItem<TData>>>;
177
+ readonly virtualScrollOptions: import("@angular/core").WritableSignal<VirtualScrollOptions>;
178
+ clearFilter(): void;
179
+ clearHighlightedItem(): void;
180
+ clearSelections(): void;
181
+ /**
182
+ * Finds the next item whose text starts with the typeahead buffer, starting after the active item; once the
183
+ * buffer holds more than one character, an active item that still matches stays.
184
+ * Group headers and disabled items are never matched.
185
+ */
186
+ cycleThroughMatchedItems(buffer: string): ListItem<TData> | null;
187
+ deselectItems(item: Iterable<ListItem<TData>>): void;
188
+ /**
189
+ * Resolves the selection value of a data item through `valueField`.
190
+ *
191
+ * When no `valueField` is configured, the data item itself is the value.
192
+ * When `valueField` is a string, the item property is read with a nullish fallback to the item.
193
+ * When `valueField` is a function, its result is used as-is.
194
+ *
195
+ * Falsy results such as `0`, `false`, and `""` are valid values and do not fall back to the item.
196
+ */
197
+ getDataItemValue(dataItem: TData): unknown;
198
+ getFilterDebounceDuration(): number;
199
+ getGroupField(item: ListItem<TData>): unknown;
200
+ /**
201
+ * Returns the uid of the group header an item is rendered under, or `null` when the list is not grouped.
202
+ */
203
+ getGroupHeaderUid(item: ListItem<TData>): string | null;
204
+ getItemPosition(item: ListItem<TData>): {
205
+ position: number;
206
+ total: number;
207
+ } | null;
208
+ /**
209
+ * Resolves the display text of an item through `textField`.
210
+ * Non-string field values (numbers, dates, …) are converted with `String()`, and nullish values become `""`.
211
+ */
212
+ getItemText(item: ListItem<TData>): string;
213
+ /**
214
+ * Finds the item that typed text should resolve to: an exact text match first (respecting `caseSensitive`),
215
+ * otherwise the first item accepted by the filter operator. Group headers and disabled items are skipped.
216
+ */
217
+ getMatchingFilteredItem(text: string): ListItem<TData> | null;
218
+ /**
219
+ * Whether a data item is disabled by `disabledBy`, whether or not it is in the list.
220
+ */
221
+ isDataItemDisabled(dataItem: TData): boolean;
222
+ isDisabled(item: ListItem<TData>): boolean;
223
+ isFilteringEnabled(): boolean;
224
+ isHighlighted(item: ListItem<TData>): boolean;
225
+ isSelected(item: ListItem<TData>): boolean;
226
+ navigate(direction: NavigationDirection, mode: NavigationMode, focus: boolean): ListItem<TData> | null;
227
+ notifySelectionChange(item: ListItem<TData>): void;
228
+ scrollToItem(item: ListItem<TData>, focus: boolean): void;
229
+ /**
230
+ * Selects every enabled item currently in view, keeping existing selections. Only applies in multiple mode.
231
+ * @returns whether the selection changed.
232
+ */
233
+ selectAllItems(): boolean;
234
+ selectItem(item: ListItem<TData>, scroll?: boolean, focus?: boolean): void;
235
+ setData(data: Iterable<TData>): void;
236
+ setDisabledBy(disabledBy: string | Predicate<TData>): void;
237
+ setFilter(filter: string): void;
238
+ setFilterPlaceholder(placeholder: string): void;
239
+ setFilterableOptions(options: Partial<FilterableOptions>): void;
240
+ setGroupBy(groupSelector: ListKeySelector<TData>): void;
241
+ setGroupableOptions(options: GroupableOptions<TData, unknown>): void;
242
+ setNavigableOptions(options: Partial<NavigableOptions>): void;
243
+ setPageableOptions(settings: PagerSettings): void;
244
+ setSelectableOptions(options: Partial<SelectableOptions>): void;
245
+ setSelectedDataItems(dataItems: Iterable<TData>): void;
246
+ setSelectedKeys(selectedKeys: Iterable<unknown>): void;
247
+ setTextField(textField: string | Selector<TData, string>): void;
248
+ setValueField(valueField: string | Selector<TData, unknown>): void;
249
+ setVirtualScrollOptions(options: VirtualScrollOptions): void;
250
+ private filterItem;
251
+ /**
252
+ * Returns the item when it is one of the navigable items, otherwise `null`.
253
+ * An anchor that was filtered out or removed must not be navigated from.
254
+ */
255
+ private getItemInView;
256
+ private getOrderKey;
257
+ private getPreviousItemForNavigation;
258
+ private getSelectionKey;
259
+ private navigateFirstForSingleSelection;
260
+ private navigateForMultipleSelection;
261
+ private navigateForSingleSelection;
262
+ private navigateLastForSingleSelection;
263
+ private navigateNextForSingleSelection;
264
+ private navigatePreviousForSingleSelection;
265
+ private skipTakeWithGroups;
266
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListService<any>, never>;
267
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
281
268
  }
282
-
283
- declare class ListComponent<TData> implements OnInit {
284
- #private;
285
- private readonly filterInput;
286
- private readonly filterInputElement;
287
- /**
288
- * Id of the highlighted option, used as `aria-activedescendant` by the filter input.
289
- */
290
- protected readonly activeDescendant: Signal<string | null>;
291
- protected readonly classes: Signal<string>;
292
- /**
293
- * The `listId` input, or a generated id so the listbox can always be referenced by `aria-controls`.
294
- */
295
- protected readonly effectiveListId: Signal<string>;
296
- /** The empty list element covers the "No data" content and shows the focus ring when it has focus. */
297
- protected readonly emptyListClasses: Signal<string>;
298
- protected readonly footerTemplate: Signal<TemplateRef<any> | undefined>;
299
- protected readonly groupHeaderClasses: Signal<string>;
300
- protected readonly groupHeaderTemplate: Signal<TemplateRef<any> | undefined>;
301
- protected readonly headerTemplate: Signal<TemplateRef<any> | undefined>;
302
- /**
303
- * The host takes the Tab stop when no option can: every option is disabled, or a virtual list's focusable option
304
- * is scrolled out of the drawn rows. Focusing the host then moves focus to that option.
305
- */
306
- protected readonly hostTabIndex: Signal<0 | -1>;
307
- protected readonly innerListClasses: Signal<string>;
308
- protected readonly itemTemplate: Signal<TemplateRef<any> | undefined>;
309
- protected readonly listHeight: Signal<string | undefined>;
310
- protected readonly listMaxHeight: Signal<string | undefined>;
311
- protected readonly listMaxWidth: Signal<string | undefined>;
312
- protected readonly listService: ListService<TData>;
313
- protected readonly listWidth: Signal<ListSizeType>;
314
- protected readonly messages: Signal<_nanahoshi_mona_ui_i18n.MonaListMessages>;
315
- /** Id of the "No data" content, which describes an empty list. */
316
- protected readonly noDataId: string;
317
- protected readonly noDataTemplate: Signal<TemplateRef<any> | undefined>;
318
- /**
319
- * The shown items split at group headers: a section without a header holds ungrouped items.
320
- */
321
- protected readonly viewSections: Signal<{
322
- header: ListItem<TData> | null;
323
- items: Array<ListItem<TData>>;
324
- key: string;
325
- }[]>;
326
- protected readonly viewportHeight: Signal<ListSizeType>;
327
- protected readonly virtualScrollViewport: Signal<CdkVirtualScrollViewport | undefined>;
328
- /**
329
- * @description Accessible name for the list's `listbox` element. Describe what the list represents.
330
- * @default ""
331
- */
332
- readonly ariaLabel: _angular_core.InputSignal<string>;
333
- /**
334
- * @description Id of the element that names the list, as an alternative to `ariaLabel`.
335
- * @default ""
336
- */
337
- readonly ariaLabelledBy: _angular_core.InputSignal<string>;
338
- /**
339
- * @description Marks the list as loading (`aria-busy`).
340
- * @default false
341
- */
342
- readonly busy: _angular_core.InputSignalWithTransform<boolean, unknown>;
343
- readonly data: _angular_core.InputSignal<Iterable<TData> | null | undefined>;
344
- readonly focusOnMount: _angular_core.InputSignal<boolean>;
345
- readonly height: _angular_core.InputSignal<ListSizeInputType>;
346
- /**
347
- * @description Emitted when the user activates an enabled item by clicking it or pressing Enter on it, whether or
348
- * not the list is selectable.
349
- */
350
- readonly itemActivate: _angular_core.OutputEmitterRef<ListItem<TData>>;
351
- readonly itemSelect: _angular_core.OutputEmitterRef<SelectionChangeEvent<TData>>;
352
- readonly listClass: _angular_core.InputSignal<string>;
353
- readonly listId: _angular_core.InputSignal<string>;
354
- readonly listItemClass: _angular_core.InputSignal<string>;
355
- readonly listItemStyle: _angular_core.InputSignal<Partial<CSSStyleDeclaration>>;
356
- /**
357
- * @description `"listbox"` for options to choose from, `"list"` for items that are only shown.
358
- * @default "listbox"
359
- */
360
- readonly listRole: _angular_core.InputSignal<"list" | "listbox">;
361
- readonly listStyle: _angular_core.InputSignal<Partial<CSSStyleDeclaration>>;
362
- readonly maxHeight: _angular_core.InputSignal<ListSizeInputType>;
363
- readonly maxWidth: _angular_core.InputSignal<ListSizeInputType>;
364
- readonly size: _angular_core.InputSignal<"medium" | "large" | "small" | null | undefined>;
365
- readonly textField: _angular_core.InputSignal<ListKeySelector<TData, string> | undefined>;
366
- readonly width: _angular_core.InputSignal<ListSizeInputType>;
367
- constructor();
368
- ngOnInit(): void;
369
- protected onFilterChange(event: FilterChangeEvent): void;
370
- protected onListItemClick(item: ListItem<TData>): void;
371
- protected trackByUid(_: number, item: ListItem<TData>): string;
372
- private cycleThroughMatchedItems;
373
- /** Focuses the list element of an empty list, which names the list and is described by "No data". */
374
- private focusEmptyList;
375
- private focusToItem;
376
- /**
377
- * Handles multiple-selection shortcuts from the WAI-ARIA listbox pattern:
378
- * Space toggles the highlighted option and Ctrl/Cmd+A selects every enabled option.
379
- * @returns whether the event was handled.
380
- */
381
- private handleMultipleSelectionKeys;
382
- private handleNavigation;
383
- private handlePageScroll;
384
- /**
385
- * Whether a key event is meant for the list: from the host, the list element, one of this list's own options or
386
- * its filter input. Keys typed into controls in header, footer or item templates (or in a nested list) are left
387
- * to those controls.
388
- */
389
- private isListKeyTarget;
390
- private rememberFocusedOption;
391
- /**
392
- * When the option that had focus is removed from the data, focus would fall to the page. Move it to the option
393
- * now at the same position, or the last one.
394
- */
395
- private restoreFocusAfterRemoval;
396
- private scrollToItem;
397
- private selectItem;
398
- private setInitialSelectionOrFocus;
399
- private setKeyboardEvents;
400
- private setNavigationEvents;
401
- private setSubscriptions;
402
- private setTypeaheadSubscription;
403
- private toggleItem;
404
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListComponent<any>, never>;
405
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ListComponent<any>, "mona-list", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; "busy": { "alias": "busy"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "focusOnMount": { "alias": "focusOnMount"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "listClass": { "alias": "listClass"; "required": false; "isSignal": true; }; "listId": { "alias": "listId"; "required": false; "isSignal": true; }; "listItemClass": { "alias": "listItemClass"; "required": false; "isSignal": true; }; "listItemStyle": { "alias": "listItemStyle"; "required": false; "isSignal": true; }; "listRole": { "alias": "listRole"; "required": false; "isSignal": true; }; "listStyle": { "alias": "listStyle"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "textField": { "alias": "textField"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, { "itemActivate": "itemActivate"; "itemSelect": "itemSelect"; }, ["footerTemplate", "groupHeaderTemplate", "headerTemplate", "itemTemplate", "noDataTemplate"], never, true, never>;
269
+ export declare class ListComponent<TData> implements OnInit {
270
+ #private;
271
+ private readonly filterInput;
272
+ private readonly filterInputElement;
273
+ /**
274
+ * Id of the highlighted option, used as `aria-activedescendant` by the filter input.
275
+ */
276
+ protected readonly activeDescendant: Signal<string | null>;
277
+ protected readonly classes: Signal<string>;
278
+ /**
279
+ * The `listId` input, or a generated id so the listbox can always be referenced by `aria-controls`.
280
+ */
281
+ protected readonly effectiveListId: Signal<string>;
282
+ /** The empty list element covers the "No data" content and shows the focus ring when it has focus. */
283
+ protected readonly emptyListClasses: Signal<string>;
284
+ protected readonly footerTemplate: Signal<TemplateRef<any> | undefined>;
285
+ protected readonly groupHeaderClasses: Signal<string>;
286
+ protected readonly groupHeaderTemplate: Signal<TemplateRef<any> | undefined>;
287
+ protected readonly headerTemplate: Signal<TemplateRef<any> | undefined>;
288
+ /**
289
+ * The host takes the Tab stop when no option can: every option is disabled, or a virtual list's focusable option
290
+ * is scrolled out of the drawn rows. Focusing the host then moves focus to that option.
291
+ */
292
+ protected readonly hostTabIndex: Signal<0 | -1>;
293
+ protected readonly innerListClasses: Signal<string>;
294
+ protected readonly itemTemplate: Signal<TemplateRef<any> | undefined>;
295
+ protected readonly listHeight: Signal<string | undefined>;
296
+ protected readonly listMaxHeight: Signal<string | undefined>;
297
+ protected readonly listMaxWidth: Signal<string | undefined>;
298
+ protected readonly listService: ListService<TData>;
299
+ protected readonly listWidth: Signal<ListSizeType>;
300
+ protected readonly messages: Signal<import("@nanahoshi/mona-ui/i18n").MonaListMessages>;
301
+ /** Id of the "No data" content, which describes an empty list. */
302
+ protected readonly noDataId: string;
303
+ protected readonly noDataTemplate: Signal<TemplateRef<any> | undefined>;
304
+ /**
305
+ * The shown items split at group headers: a section without a header holds ungrouped items.
306
+ */
307
+ protected readonly viewSections: Signal<{
308
+ header: ListItem<TData> | null;
309
+ items: Array<ListItem<TData>>;
310
+ key: string;
311
+ }[]>;
312
+ protected readonly viewportHeight: Signal<ListSizeType>;
313
+ protected readonly virtualScrollViewport: Signal<CdkVirtualScrollViewport | undefined>;
314
+ /**
315
+ * @description Accessible name for the list's `listbox` element. Describe what the list represents.
316
+ * @default ""
317
+ */
318
+ readonly ariaLabel: import("@angular/core").InputSignal<string>;
319
+ /**
320
+ * @description Id of the element that names the list, as an alternative to `ariaLabel`.
321
+ * @default ""
322
+ */
323
+ readonly ariaLabelledBy: import("@angular/core").InputSignal<string>;
324
+ /**
325
+ * @description Marks the list as loading (`aria-busy`).
326
+ * @default false
327
+ */
328
+ readonly busy: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
329
+ readonly data: import("@angular/core").InputSignal<Iterable<TData> | null | undefined>;
330
+ readonly focusOnMount: import("@angular/core").InputSignal<boolean>;
331
+ readonly height: import("@angular/core").InputSignal<ListSizeInputType>;
332
+ /**
333
+ * @description Emitted when the user activates an enabled item by clicking it or pressing Enter on it, whether or
334
+ * not the list is selectable.
335
+ */
336
+ readonly itemActivate: import("@angular/core").OutputEmitterRef<ListItem<TData>>;
337
+ readonly itemSelect: import("@angular/core").OutputEmitterRef<SelectionChangeEvent<TData>>;
338
+ readonly listClass: import("@angular/core").InputSignal<string>;
339
+ readonly listId: import("@angular/core").InputSignal<string>;
340
+ readonly listItemClass: import("@angular/core").InputSignal<string>;
341
+ readonly listItemStyle: import("@angular/core").InputSignal<Partial<CSSStyleDeclaration>>;
342
+ /**
343
+ * @description `"listbox"` for options to choose from, `"list"` for items that are only shown.
344
+ * @default "listbox"
345
+ */
346
+ readonly listRole: import("@angular/core").InputSignal<"list" | "listbox">;
347
+ readonly listStyle: import("@angular/core").InputSignal<Partial<CSSStyleDeclaration>>;
348
+ readonly maxHeight: import("@angular/core").InputSignal<ListSizeInputType>;
349
+ readonly maxWidth: import("@angular/core").InputSignal<ListSizeInputType>;
350
+ readonly size: import("@angular/core").InputSignal<"medium" | "large" | "small" | null | undefined>;
351
+ readonly textField: import("@angular/core").InputSignal<ListKeySelector<TData, string> | undefined>;
352
+ readonly width: import("@angular/core").InputSignal<ListSizeInputType>;
353
+ constructor();
354
+ ngOnInit(): void;
355
+ protected onFilterChange(event: FilterChangeEvent): void;
356
+ protected onListItemClick(item: ListItem<TData>): void;
357
+ protected trackByUid(_: number, item: ListItem<TData>): string;
358
+ private cycleThroughMatchedItems;
359
+ /** Focuses the list element of an empty list, which names the list and is described by "No data". */
360
+ private focusEmptyList;
361
+ private focusToItem;
362
+ /**
363
+ * Handles multiple-selection shortcuts from the WAI-ARIA listbox pattern:
364
+ * Space toggles the highlighted option and Ctrl/Cmd+A selects every enabled option.
365
+ * @returns whether the event was handled.
366
+ */
367
+ private handleMultipleSelectionKeys;
368
+ private handleNavigation;
369
+ private handlePageScroll;
370
+ /**
371
+ * Whether a key event is meant for the list: from the host, the list element, one of this list's own options or
372
+ * its filter input. Keys typed into controls in header, footer or item templates (or in a nested list) are left
373
+ * to those controls.
374
+ */
375
+ private isListKeyTarget;
376
+ private rememberFocusedOption;
377
+ /**
378
+ * When the option that had focus is removed from the data, focus would fall to the page. Move it to the option
379
+ * now at the same position, or the last one.
380
+ */
381
+ private restoreFocusAfterRemoval;
382
+ private scrollToItem;
383
+ private selectItem;
384
+ private setInitialSelectionOrFocus;
385
+ private setKeyboardEvents;
386
+ private setNavigationEvents;
387
+ private setSubscriptions;
388
+ private setTypeaheadSubscription;
389
+ private toggleItem;
390
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListComponent<any>, never>;
391
+ static ɵcmp: i0.ɵɵComponentDeclaration<ListComponent<any>, "mona-list", never, {
392
+ "ariaLabel": {
393
+ "alias": "ariaLabel";
394
+ "required": false;
395
+ "isSignal": true;
396
+ };
397
+ "ariaLabelledBy": {
398
+ "alias": "ariaLabelledBy";
399
+ "required": false;
400
+ "isSignal": true;
401
+ };
402
+ "busy": {
403
+ "alias": "busy";
404
+ "required": false;
405
+ "isSignal": true;
406
+ };
407
+ "data": {
408
+ "alias": "data";
409
+ "required": false;
410
+ "isSignal": true;
411
+ };
412
+ "focusOnMount": {
413
+ "alias": "focusOnMount";
414
+ "required": false;
415
+ "isSignal": true;
416
+ };
417
+ "height": {
418
+ "alias": "height";
419
+ "required": false;
420
+ "isSignal": true;
421
+ };
422
+ "listClass": {
423
+ "alias": "listClass";
424
+ "required": false;
425
+ "isSignal": true;
426
+ };
427
+ "listId": {
428
+ "alias": "listId";
429
+ "required": false;
430
+ "isSignal": true;
431
+ };
432
+ "listItemClass": {
433
+ "alias": "listItemClass";
434
+ "required": false;
435
+ "isSignal": true;
436
+ };
437
+ "listItemStyle": {
438
+ "alias": "listItemStyle";
439
+ "required": false;
440
+ "isSignal": true;
441
+ };
442
+ "listRole": {
443
+ "alias": "listRole";
444
+ "required": false;
445
+ "isSignal": true;
446
+ };
447
+ "listStyle": {
448
+ "alias": "listStyle";
449
+ "required": false;
450
+ "isSignal": true;
451
+ };
452
+ "maxHeight": {
453
+ "alias": "maxHeight";
454
+ "required": false;
455
+ "isSignal": true;
456
+ };
457
+ "maxWidth": {
458
+ "alias": "maxWidth";
459
+ "required": false;
460
+ "isSignal": true;
461
+ };
462
+ "size": {
463
+ "alias": "size";
464
+ "required": false;
465
+ "isSignal": true;
466
+ };
467
+ "textField": {
468
+ "alias": "textField";
469
+ "required": false;
470
+ "isSignal": true;
471
+ };
472
+ "width": {
473
+ "alias": "width";
474
+ "required": false;
475
+ "isSignal": true;
476
+ };
477
+ }, {
478
+ "itemActivate": "itemActivate";
479
+ "itemSelect": "itemSelect";
480
+ }, ["footerTemplate", "groupHeaderTemplate", "headerTemplate", "itemTemplate", "noDataTemplate"], never, true, never>;
406
481
  }
407
-
408
- declare class ListFooterTemplateDirective {
409
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListFooterTemplateDirective, never>;
410
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ListFooterTemplateDirective, "ng-template[monaListFooterTemplate]", never, {}, {}, never, never, true, never>;
482
+ export declare class ListFooterTemplateDirective {
483
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListFooterTemplateDirective, never>;
484
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ListFooterTemplateDirective, "ng-template[monaListFooterTemplate]", never, {}, {}, never, never, true, never>;
411
485
  }
412
-
413
- declare class ListGroupHeaderTemplateDirective {
414
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListGroupHeaderTemplateDirective, never>;
415
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ListGroupHeaderTemplateDirective, "ng-template[monaListGroupHeaderTemplate]", never, {}, {}, never, never, true, never>;
486
+ export declare class ListGroupHeaderTemplateDirective {
487
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListGroupHeaderTemplateDirective, never>;
488
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ListGroupHeaderTemplateDirective, "ng-template[monaListGroupHeaderTemplate]", never, {}, {}, never, never, true, never>;
416
489
  }
417
-
418
- declare class ListHeaderTemplateDirective {
419
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListHeaderTemplateDirective, never>;
420
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ListHeaderTemplateDirective, "ng-template[monaListHeaderTemplate]", never, {}, {}, never, never, true, never>;
490
+ export declare class ListHeaderTemplateDirective {
491
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListHeaderTemplateDirective, never>;
492
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ListHeaderTemplateDirective, "ng-template[monaListHeaderTemplate]", never, {}, {}, never, never, true, never>;
421
493
  }
422
-
423
- declare class ListItemTemplateDirective {
424
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListItemTemplateDirective, never>;
425
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ListItemTemplateDirective, "ng-template[monaListItemTemplate]", never, {}, {}, never, never, true, never>;
494
+ export declare class ListItemTemplateDirective {
495
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListItemTemplateDirective, never>;
496
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ListItemTemplateDirective, "ng-template[monaListItemTemplate]", never, {}, {}, never, never, true, never>;
426
497
  }
427
-
428
- declare class ListNoDataTemplateDirective {
429
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListNoDataTemplateDirective, never>;
430
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ListNoDataTemplateDirective, "ng-template[monaListNoDataTemplate]", never, {}, {}, never, never, true, never>;
498
+ export declare class ListNoDataTemplateDirective {
499
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListNoDataTemplateDirective, never>;
500
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ListNoDataTemplateDirective, "ng-template[monaListNoDataTemplate]", never, {}, {}, never, never, true, never>;
431
501
  }
432
-
433
502
  /**
434
503
  * Lets a component that wraps a `mona-list-view` in its own template share its `ListService` with that list view.
435
504
  * Provide it in `viewProviders` (`{ provide: LIST_VIEW_HOST_LIST_SERVICE, useExisting: ListService }`), so only the
436
505
  * component's own list view sees it, never a list view placed in content the component projects or renders from a
437
506
  * consumer's template. Without it, every list view has its own service.
438
507
  */
439
- declare const LIST_VIEW_HOST_LIST_SERVICE: InjectionToken<ListService<unknown>>;
440
-
441
- declare const LIST_DEFAULT_MESSAGES: MonaListMessages;
442
-
443
- export { LIST_DEFAULT_MESSAGES, LIST_VIEW_HOST_LIST_SERVICE, ListComponent, ListFooterTemplateDirective, ListGroupHeaderTemplateDirective, ListHeaderTemplateDirective, ListItem, ListItemTemplateDirective, ListNoDataTemplateDirective, ListService };
444
- export type { GroupableOptions, ListKeySelector, ListSizeInputType, ListSizeType, NavigableOptions, NavigationDirection, NavigationMode, OrderByOptions, PagerSettings, SelectableOptions, SelectionChangeEvent };
508
+ export declare const LIST_VIEW_HOST_LIST_SERVICE: InjectionToken<ListService<unknown>>;
509
+ export declare const LIST_DEFAULT_MESSAGES: MonaListMessages;
510
+ export type { ListSizeInputType, ListSizeType, SelectionChangeEvent };