@nanahoshi/mona-ui 0.24.7 → 0.24.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +37 -9
- package/fesm2022/nanahoshi-mona-ui-button.mjs +8 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +4 -3
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +101 -47
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +339 -101
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +119 -69
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-vXXNWmEN.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DhKLnW06.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-DDgNmgE0.mjs → nanahoshi-mona-ui-grid-grid-list.component-voGbKOiB.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-Dzf6Vbs_.mjs → nanahoshi-mona-ui-grid-grid-row.component-HQ1Kv6R9.mjs} +2 -3
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DAPNqnWV.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-PNLJFcuH.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-B9rmDLq8.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BO19AVwC.mjs} +10 -10
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +44 -3
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +20 -4
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +335 -45
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +565 -197
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +465 -23
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +598 -208
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +193 -71
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +33 -3
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +33 -3
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +40 -3
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +33 -3
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +33 -3
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +49 -3
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +127 -133
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +473 -240
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +202 -90
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +609 -256
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +45 -10
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +102 -58
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +286 -443
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +205 -140
- package/fesm2022/nanahoshi-mona-ui-window.mjs +591 -310
- package/i18n/catalogs/en-US.messages.json +32 -6
- package/locales/ar-sa/ar-sa.messages.json +29 -3
- package/locales/de-de/de-de.messages.json +29 -3
- package/locales/es-es/es-es.messages.json +29 -3
- package/locales/fr-fr/fr-fr.messages.json +29 -3
- package/locales/id-id/id-id.messages.json +29 -3
- package/locales/it-it/it-it.messages.json +29 -3
- package/locales/ja-jp/ja-jp.messages.json +29 -3
- package/locales/ko-kr/ko-kr.messages.json +29 -3
- package/locales/pt-br/pt-br.messages.json +29 -3
- package/locales/ru-ru/ru-ru.messages.json +29 -3
- package/locales/tr-tr/tr-tr.messages.json +29 -3
- package/locales/zh-cn/zh-cn.messages.json +29 -3
- package/locales/zh-tw/zh-tw.messages.json +29 -3
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-button-group.d.ts +13 -3
- package/types/nanahoshi-mona-ui-button.d.ts +20 -3
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +5 -6
- package/types/nanahoshi-mona-ui-dialog.d.ts +131 -20
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +75 -56
- package/types/nanahoshi-mona-ui-i18n.d.ts +69 -0
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +14 -2
- package/types/nanahoshi-mona-ui-internal-list.d.ts +89 -10
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +155 -40
- package/types/nanahoshi-mona-ui-internal.d.ts +128 -16
- package/types/nanahoshi-mona-ui-list-box.d.ts +148 -47
- package/types/nanahoshi-mona-ui-list-view.d.ts +112 -21
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +26 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +26 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +65 -62
- package/types/nanahoshi-mona-ui-notification.d.ts +76 -16
- package/types/nanahoshi-mona-ui-popover.d.ts +44 -17
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +110 -32
- package/types/nanahoshi-mona-ui-popup.d.ts +2 -0
- package/types/nanahoshi-mona-ui-sheet.d.ts +16 -5
- package/types/nanahoshi-mona-ui-split-button.d.ts +29 -7
- package/types/nanahoshi-mona-ui-tooltip.d.ts +43 -20
- package/types/nanahoshi-mona-ui-tree-view.d.ts +84 -40
- package/types/nanahoshi-mona-ui-window.d.ts +103 -14
|
@@ -301,18 +301,46 @@ interface MonaGridMessages {
|
|
|
301
301
|
|
|
302
302
|
interface MonaListMessages {
|
|
303
303
|
readonly filterList: string;
|
|
304
|
+
/** Status text while a list view is loading. */
|
|
305
|
+
readonly loading: string;
|
|
304
306
|
readonly noData: string;
|
|
307
|
+
/** Accessible name of a list view's pager, from the list's name ("People pagination"). */
|
|
308
|
+
pagerLabel(list: string): string;
|
|
305
309
|
}
|
|
306
310
|
|
|
307
311
|
interface MonaListBoxMessages {
|
|
308
312
|
readonly clearSelection: string;
|
|
313
|
+
/** Announced after Move Up or Move Down, with the new position of the first moved item ("Moved to position 2 of 5"). */
|
|
314
|
+
itemsMoved(position: number, total: number): string;
|
|
315
|
+
/** Announced after Remove, with the number of items removed. */
|
|
316
|
+
itemsRemoved(count: number): string;
|
|
317
|
+
/** Announced after a transfer, with the number of items moved and the name of the list they moved to. */
|
|
318
|
+
itemsTransferred(count: number, list: string): string;
|
|
319
|
+
/** Announced after a transfer to a list box that has no accessible name. */
|
|
320
|
+
itemsTransferredToOtherList(count: number): string;
|
|
309
321
|
readonly moveDown: string;
|
|
310
322
|
readonly moveUp: string;
|
|
311
323
|
readonly remove: string;
|
|
324
|
+
/** Announced after Clear Selection. */
|
|
325
|
+
readonly selectionCleared: string;
|
|
326
|
+
/** Accessible name of the toolbar, from the list box's name ("Available foods actions"). */
|
|
327
|
+
toolbarLabel(list: string): string;
|
|
328
|
+
/** Label of Transfer All From when the connected list box has no accessible name. */
|
|
312
329
|
readonly transferAllFrom: string;
|
|
330
|
+
/** Label of Transfer All From, naming the connected list box. */
|
|
331
|
+
transferAllFromList(list: string): string;
|
|
332
|
+
/** Label of Transfer All To when the connected list box has no accessible name. */
|
|
313
333
|
readonly transferAllTo: string;
|
|
334
|
+
/** Label of Transfer All To, naming the connected list box. */
|
|
335
|
+
transferAllToList(list: string): string;
|
|
336
|
+
/** Label of Transfer From when the connected list box has no accessible name. */
|
|
314
337
|
readonly transferFrom: string;
|
|
338
|
+
/** Label of Transfer From, naming the connected list box. */
|
|
339
|
+
transferFromList(list: string): string;
|
|
340
|
+
/** Label of Transfer To when the connected list box has no accessible name. */
|
|
315
341
|
readonly transferTo: string;
|
|
342
|
+
/** Label of Transfer To, naming the connected list box. */
|
|
343
|
+
transferToList(list: string): string;
|
|
316
344
|
}
|
|
317
345
|
|
|
318
346
|
interface MonaMultiSelectMessages {
|
|
@@ -325,6 +353,8 @@ interface MonaNotificationMessages {
|
|
|
325
353
|
readonly close: string;
|
|
326
354
|
readonly error: string;
|
|
327
355
|
readonly info: string;
|
|
356
|
+
/** The name of the region that holds the notifications at one position. */
|
|
357
|
+
readonly region: string;
|
|
328
358
|
readonly success: string;
|
|
329
359
|
readonly warning: string;
|
|
330
360
|
}
|
|
@@ -399,7 +429,11 @@ interface MonaSpinnerMessages {
|
|
|
399
429
|
}
|
|
400
430
|
|
|
401
431
|
interface MonaSplitButtonMessages {
|
|
432
|
+
/** The arrow button's name when the main button has no `text` (it shows a template instead). */
|
|
402
433
|
readonly menuButtonAriaLabel: string;
|
|
434
|
+
/** The arrow button's name, from the main button's `text`. */
|
|
435
|
+
readonly menuButtonWithText: (text: string) => string;
|
|
436
|
+
/** @deprecated No longer rendered; the main button is named by its content or by `aria-label`. */
|
|
403
437
|
readonly splitButton: (text: string) => string;
|
|
404
438
|
}
|
|
405
439
|
|
|
@@ -451,8 +485,30 @@ type TimeSelectorMessages = MonaTimeSelectorMessages;
|
|
|
451
485
|
interface MonaTreeViewMessages {
|
|
452
486
|
readonly collapse: string;
|
|
453
487
|
readonly expand: string;
|
|
488
|
+
/** @deprecated No longer rendered; the filter input's name comes from {@link filterLabel}. */
|
|
454
489
|
readonly filter: string;
|
|
490
|
+
/** Accessible name of the filter input, from the tree view's name ("Filter Files"). */
|
|
491
|
+
filterLabel(tree: string): string;
|
|
492
|
+
/** Accessible name of the filter input when the tree view has no `aria-label`. */
|
|
455
493
|
readonly filterTree: string;
|
|
494
|
+
/** Announced, and read with the node, when a node's children couldn't be loaded. */
|
|
495
|
+
loadError(node: string): string;
|
|
496
|
+
/** Announced while a node's children take a while to load, and the expander's name meanwhile. */
|
|
497
|
+
loadingNode(node: string): string;
|
|
498
|
+
/** Announced when a keyboard move (Ctrl+Shift+Arrow) put a node after another node. */
|
|
499
|
+
movedAfter(node: string, target: string): string;
|
|
500
|
+
/** Announced when a keyboard move put a node before another node. */
|
|
501
|
+
movedBefore(node: string, target: string): string;
|
|
502
|
+
/** Announced when a keyboard move put a node inside another node, as its last child. */
|
|
503
|
+
movedInto(node: string, target: string): string;
|
|
504
|
+
/** Shown, and describes the tree, when the tree view has no data. */
|
|
505
|
+
readonly noData: string;
|
|
506
|
+
/** Shown, describes the tree and is announced, when no node matches the filter. */
|
|
507
|
+
readonly noMatches: string;
|
|
508
|
+
/** Announced after the user filters, with the number of nodes that match. */
|
|
509
|
+
results(count: number): string;
|
|
510
|
+
/** Name of the expander of a node whose children couldn't be loaded. */
|
|
511
|
+
retryLoading(node: string): string;
|
|
456
512
|
}
|
|
457
513
|
|
|
458
514
|
interface MonaWindowMessages {
|
|
@@ -460,15 +516,28 @@ interface MonaWindowMessages {
|
|
|
460
516
|
readonly closeWindow: string;
|
|
461
517
|
readonly maximize: string;
|
|
462
518
|
readonly minimize: string;
|
|
519
|
+
/** The title bar's name when the window can be both dragged and resized; it says which keys do each. */
|
|
520
|
+
readonly moveOrResizeWindow: string;
|
|
521
|
+
/** The title bar's name when the window can be dragged but not resized. */
|
|
463
522
|
readonly moveWindow: string;
|
|
523
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
464
524
|
readonly resizeBottom: string;
|
|
525
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
465
526
|
readonly resizeBottomLeft: string;
|
|
527
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
466
528
|
readonly resizeBottomRight: string;
|
|
529
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
467
530
|
readonly resizeLeft: string;
|
|
531
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
468
532
|
readonly resizeRight: string;
|
|
533
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
469
534
|
readonly resizeTop: string;
|
|
535
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
470
536
|
readonly resizeTopLeft: string;
|
|
537
|
+
/** @deprecated No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. */
|
|
471
538
|
readonly resizeTopRight: string;
|
|
539
|
+
/** The title bar's name when the window can be resized but not dragged. */
|
|
540
|
+
readonly resizeWindow: string;
|
|
472
541
|
readonly restore: string;
|
|
473
542
|
}
|
|
474
543
|
type WindowMessages = MonaWindowMessages;
|
|
@@ -13,10 +13,10 @@ declare class FilterInputComponent implements OnInit {
|
|
|
13
13
|
*/
|
|
14
14
|
protected readonly inputAttributes: _angular_core.Signal<{
|
|
15
15
|
"aria-label": string | null;
|
|
16
|
+
"aria-controls": string | null;
|
|
16
17
|
role?: undefined;
|
|
17
18
|
"aria-activedescendant"?: undefined;
|
|
18
19
|
"aria-autocomplete"?: undefined;
|
|
19
|
-
"aria-controls"?: undefined;
|
|
20
20
|
"aria-expanded"?: undefined;
|
|
21
21
|
} | {
|
|
22
22
|
role: string;
|
|
@@ -31,11 +31,23 @@ declare class FilterInputComponent implements OnInit {
|
|
|
31
31
|
* @default ""
|
|
32
32
|
*/
|
|
33
33
|
readonly activeDescendant: _angular_core.InputSignal<string | null>;
|
|
34
|
+
/**
|
|
35
|
+
* @description Id of the element this input filters, exposed as `aria-controls`. Unlike `controls`, the input
|
|
36
|
+
* stays a text box: focus moves to the filtered element to navigate it.
|
|
37
|
+
* @default ""
|
|
38
|
+
*/
|
|
39
|
+
readonly ariaControls: _angular_core.InputSignal<string>;
|
|
34
40
|
/**
|
|
35
41
|
* @description Accessible name of the input. The placeholder is not a reliable label, so set this whenever possible.
|
|
36
42
|
* @default ""
|
|
37
43
|
*/
|
|
38
44
|
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
45
|
+
/**
|
|
46
|
+
* @description Focuses the input when it renders, as a popup's filter does. Turn it off for an input that is part
|
|
47
|
+
* of the page, so it doesn't take focus on load.
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
readonly autoFocus: _angular_core.InputSignal<boolean>;
|
|
39
51
|
/**
|
|
40
52
|
* @description Id of the list this input filters. When set, the input is exposed as a combobox controlling it.
|
|
41
53
|
* @default ""
|
|
@@ -53,7 +65,7 @@ declare class FilterInputComponent implements OnInit {
|
|
|
53
65
|
ngOnInit(): void;
|
|
54
66
|
private setSubscriptions;
|
|
55
67
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FilterInputComponent, never>;
|
|
56
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FilterInputComponent, "mona-filter-input", never, { "activeDescendant": { "alias": "activeDescendant"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "controls": { "alias": "controls"; "required": false; "isSignal": true; }; "debounce": { "alias": "debounce"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "filterChange": "filterChange"; "inputBlur": "inputBlur"; "inputFocus": "inputFocus"; }, never, never, true, never>;
|
|
68
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FilterInputComponent, "mona-filter-input", never, { "activeDescendant": { "alias": "activeDescendant"; "required": false; "isSignal": true; }; "ariaControls": { "alias": "ariaControls"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; "controls": { "alias": "controls"; "required": false; "isSignal": true; }; "debounce": { "alias": "debounce"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "filterChange": "filterChange"; "inputBlur": "inputBlur"; "inputFocus": "inputFocus"; }, never, never, true, never>;
|
|
57
69
|
}
|
|
58
70
|
|
|
59
71
|
export { FilterInputComponent };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { OnInit, Signal, TemplateRef } from '@angular/core';
|
|
2
|
+
import { OnInit, Signal, TemplateRef, InjectionToken } from '@angular/core';
|
|
3
3
|
import * as _nanahoshi_mona_ui_i18n from '@nanahoshi/mona-ui/i18n';
|
|
4
4
|
import { MonaListMessages } from '@nanahoshi/mona-ui/i18n';
|
|
5
5
|
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
@@ -68,6 +68,12 @@ type GroupableOptions<T = unknown, R = unknown> = {
|
|
|
68
68
|
* If not specified, the group headers will be ordered in ascending order.
|
|
69
69
|
*/
|
|
70
70
|
headerOrder?: "asc" | "desc";
|
|
71
|
+
/**
|
|
72
|
+
* Text of a group's header, from the group's value (the first item's value when several values form one group,
|
|
73
|
+
* such as two `Date` objects for the same moment). Defaults to dates in the locale's medium date format,
|
|
74
|
+
* numbers in the locale's digits, and `String(value)` for everything else.
|
|
75
|
+
*/
|
|
76
|
+
headerText?: (value: unknown) => string;
|
|
71
77
|
} & OrderByOptions<T, R>;
|
|
72
78
|
|
|
73
79
|
type NavigationMode = "highlight" | "select";
|
|
@@ -117,13 +123,17 @@ declare class ListService<TData> {
|
|
|
117
123
|
readonly filterText: _angular_core.WritableSignal<string>;
|
|
118
124
|
readonly filterableOptions: _angular_core.WritableSignal<FilterableOptions>;
|
|
119
125
|
readonly focus$: Subject<void>;
|
|
126
|
+
/**
|
|
127
|
+
* The option that holds the list's Tab stop: the highlighted one, else the last selected one, else the first
|
|
128
|
+
* enabled one. Only shown items count, so a selection on another page doesn't take the Tab stop away.
|
|
129
|
+
*/
|
|
120
130
|
readonly focusableItem: _angular_core.Signal<ListItem<TData> | null>;
|
|
121
131
|
readonly groupBy: _angular_core.WritableSignal<ListKeySelector<TData>>;
|
|
122
132
|
/**
|
|
123
133
|
* Maps each option uid to the uid of the group header it is listed under.
|
|
124
134
|
*/
|
|
125
135
|
readonly groupHeaderUids: _angular_core.Signal<Map<string, string>>;
|
|
126
|
-
readonly groupableOptions: _angular_core.WritableSignal<GroupableOptions<TData,
|
|
136
|
+
readonly groupableOptions: _angular_core.WritableSignal<GroupableOptions<TData, unknown>>;
|
|
127
137
|
/**
|
|
128
138
|
* The highlighted (active) item. When the data changes, it is re-resolved to the item with the same `uid`,
|
|
129
139
|
* or cleared when that item is gone.
|
|
@@ -142,13 +152,18 @@ declare class ListService<TData> {
|
|
|
142
152
|
readonly navigatedItem$: Subject<ListItem<TData> | null>;
|
|
143
153
|
readonly pageState: _angular_core.WritableSignal<PageState>;
|
|
144
154
|
readonly pageableOptions: _angular_core.WritableSignal<PagerSettings>;
|
|
155
|
+
/**
|
|
156
|
+
* `"listbox"` for options to choose from; `"list"` for items that are only shown, as `listitem`s without
|
|
157
|
+
* selection state.
|
|
158
|
+
*/
|
|
159
|
+
readonly role: _angular_core.WritableSignal<"list" | "listbox">;
|
|
145
160
|
readonly scrollToItem$: ReplaySubject<{
|
|
146
161
|
item: ListItem<TData>;
|
|
147
162
|
focus: boolean;
|
|
148
163
|
}>;
|
|
149
164
|
readonly selectableOptions: _angular_core.WritableSignal<SelectableOptions>;
|
|
150
|
-
readonly selectedKeys: _angular_core.WritableSignal<ImmutableSet<
|
|
151
|
-
readonly selectedKeysChange$: Subject<
|
|
165
|
+
readonly selectedKeys: _angular_core.WritableSignal<ImmutableSet<unknown>>;
|
|
166
|
+
readonly selectedKeysChange$: Subject<unknown[]>;
|
|
152
167
|
readonly selectedListItems: _angular_core.Signal<ImmutableSet<ListItem<TData>>>;
|
|
153
168
|
readonly selectionChange$: Subject<ListItem<TData>>;
|
|
154
169
|
readonly textField: _angular_core.WritableSignal<string | Selector<TData, string>>;
|
|
@@ -162,7 +177,8 @@ declare class ListService<TData> {
|
|
|
162
177
|
clearHighlightedItem(): void;
|
|
163
178
|
clearSelections(): void;
|
|
164
179
|
/**
|
|
165
|
-
* Finds the next item whose text starts with the typeahead buffer, starting after the active item
|
|
180
|
+
* Finds the next item whose text starts with the typeahead buffer, starting after the active item; once the
|
|
181
|
+
* buffer holds more than one character, an active item that still matches stays.
|
|
166
182
|
* Group headers and disabled items are never matched.
|
|
167
183
|
*/
|
|
168
184
|
cycleThroughMatchedItems(buffer: string): ListItem<TData> | null;
|
|
@@ -178,7 +194,7 @@ declare class ListService<TData> {
|
|
|
178
194
|
*/
|
|
179
195
|
getDataItemValue(dataItem: TData): unknown;
|
|
180
196
|
getFilterDebounceDuration(): number;
|
|
181
|
-
getGroupField(item: ListItem<TData>):
|
|
197
|
+
getGroupField(item: ListItem<TData>): unknown;
|
|
182
198
|
/**
|
|
183
199
|
* Returns the uid of the group header an item is rendered under, or `null` when the list is not grouped.
|
|
184
200
|
*/
|
|
@@ -197,6 +213,10 @@ declare class ListService<TData> {
|
|
|
197
213
|
* otherwise the first item accepted by the filter operator. Group headers and disabled items are skipped.
|
|
198
214
|
*/
|
|
199
215
|
getMatchingFilteredItem(text: string): ListItem<TData> | null;
|
|
216
|
+
/**
|
|
217
|
+
* Whether a data item is disabled by `disabledBy`, whether or not it is in the list.
|
|
218
|
+
*/
|
|
219
|
+
isDataItemDisabled(dataItem: TData): boolean;
|
|
200
220
|
isDisabled(item: ListItem<TData>): boolean;
|
|
201
221
|
isFilteringEnabled(): boolean;
|
|
202
222
|
isHighlighted(item: ListItem<TData>): boolean;
|
|
@@ -216,7 +236,7 @@ declare class ListService<TData> {
|
|
|
216
236
|
setFilterPlaceholder(placeholder: string): void;
|
|
217
237
|
setFilterableOptions(options: Partial<FilterableOptions>): void;
|
|
218
238
|
setGroupBy(groupSelector: ListKeySelector<TData>): void;
|
|
219
|
-
setGroupableOptions(options: GroupableOptions<TData,
|
|
239
|
+
setGroupableOptions(options: GroupableOptions<TData, unknown>): void;
|
|
220
240
|
setNavigableOptions(options: Partial<NavigableOptions>): void;
|
|
221
241
|
setPageableOptions(settings: PagerSettings): void;
|
|
222
242
|
setSelectableOptions(options: Partial<SelectableOptions>): void;
|
|
@@ -248,6 +268,7 @@ declare class ListService<TData> {
|
|
|
248
268
|
declare class ListComponent<TData> implements OnInit {
|
|
249
269
|
#private;
|
|
250
270
|
private readonly filterInput;
|
|
271
|
+
private readonly filterInputElement;
|
|
251
272
|
/**
|
|
252
273
|
* Id of the highlighted option, used as `aria-activedescendant` by the filter input.
|
|
253
274
|
*/
|
|
@@ -257,10 +278,16 @@ declare class ListComponent<TData> implements OnInit {
|
|
|
257
278
|
* The `listId` input, or a generated id so the listbox can always be referenced by `aria-controls`.
|
|
258
279
|
*/
|
|
259
280
|
protected readonly effectiveListId: Signal<string>;
|
|
281
|
+
/** The empty list element covers the "No data" content and shows the focus ring when it has focus. */
|
|
282
|
+
protected readonly emptyListClasses: Signal<string>;
|
|
260
283
|
protected readonly footerTemplate: Signal<TemplateRef<any> | undefined>;
|
|
261
284
|
protected readonly groupHeaderClasses: Signal<string>;
|
|
262
285
|
protected readonly groupHeaderTemplate: Signal<TemplateRef<any> | undefined>;
|
|
263
286
|
protected readonly headerTemplate: Signal<TemplateRef<any> | undefined>;
|
|
287
|
+
/**
|
|
288
|
+
* The host takes the Tab stop when no option can: every option is disabled, or a virtual list's focusable option
|
|
289
|
+
* is scrolled out of the drawn rows. Focusing the host then moves focus to that option.
|
|
290
|
+
*/
|
|
264
291
|
protected readonly hostTabIndex: Signal<0 | -1>;
|
|
265
292
|
protected readonly innerListClasses: Signal<string>;
|
|
266
293
|
protected readonly itemTemplate: Signal<TemplateRef<any> | undefined>;
|
|
@@ -270,7 +297,17 @@ declare class ListComponent<TData> implements OnInit {
|
|
|
270
297
|
protected readonly listService: ListService<TData>;
|
|
271
298
|
protected readonly listWidth: Signal<ListSizeType>;
|
|
272
299
|
protected readonly messages: Signal<_nanahoshi_mona_ui_i18n.MonaListMessages>;
|
|
300
|
+
/** Id of the "No data" content, which describes an empty list. */
|
|
301
|
+
protected readonly noDataId: string;
|
|
273
302
|
protected readonly noDataTemplate: Signal<TemplateRef<any> | undefined>;
|
|
303
|
+
/**
|
|
304
|
+
* The shown items split at group headers: a section without a header holds ungrouped items.
|
|
305
|
+
*/
|
|
306
|
+
protected readonly viewSections: Signal<{
|
|
307
|
+
header: ListItem<TData> | null;
|
|
308
|
+
items: Array<ListItem<TData>>;
|
|
309
|
+
key: string;
|
|
310
|
+
}[]>;
|
|
274
311
|
protected readonly viewportHeight: Signal<ListSizeType>;
|
|
275
312
|
protected readonly virtualScrollViewport: Signal<CdkVirtualScrollViewport | undefined>;
|
|
276
313
|
/**
|
|
@@ -278,18 +315,38 @@ declare class ListComponent<TData> implements OnInit {
|
|
|
278
315
|
* @default ""
|
|
279
316
|
*/
|
|
280
317
|
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
318
|
+
/**
|
|
319
|
+
* @description Id of the element that names the list, as an alternative to `ariaLabel`.
|
|
320
|
+
* @default ""
|
|
321
|
+
*/
|
|
322
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string>;
|
|
323
|
+
/**
|
|
324
|
+
* @description Marks the list as loading (`aria-busy`).
|
|
325
|
+
* @default false
|
|
326
|
+
*/
|
|
327
|
+
readonly busy: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
281
328
|
readonly data: _angular_core.InputSignal<Iterable<TData> | null | undefined>;
|
|
282
329
|
readonly focusOnMount: _angular_core.InputSignal<boolean>;
|
|
283
330
|
readonly height: _angular_core.InputSignal<ListSizeInputType>;
|
|
331
|
+
/**
|
|
332
|
+
* @description Emitted when the user activates an enabled item by clicking it or pressing Enter on it, whether or
|
|
333
|
+
* not the list is selectable.
|
|
334
|
+
*/
|
|
335
|
+
readonly itemActivate: _angular_core.OutputEmitterRef<ListItem<TData>>;
|
|
284
336
|
readonly itemSelect: _angular_core.OutputEmitterRef<SelectionChangeEvent<TData>>;
|
|
285
337
|
readonly listClass: _angular_core.InputSignal<string>;
|
|
286
338
|
readonly listId: _angular_core.InputSignal<string>;
|
|
287
339
|
readonly listItemClass: _angular_core.InputSignal<string>;
|
|
288
340
|
readonly listItemStyle: _angular_core.InputSignal<Partial<CSSStyleDeclaration>>;
|
|
341
|
+
/**
|
|
342
|
+
* @description `"listbox"` for options to choose from, `"list"` for items that are only shown.
|
|
343
|
+
* @default "listbox"
|
|
344
|
+
*/
|
|
345
|
+
readonly listRole: _angular_core.InputSignal<"list" | "listbox">;
|
|
289
346
|
readonly listStyle: _angular_core.InputSignal<Partial<CSSStyleDeclaration>>;
|
|
290
347
|
readonly maxHeight: _angular_core.InputSignal<ListSizeInputType>;
|
|
291
348
|
readonly maxWidth: _angular_core.InputSignal<ListSizeInputType>;
|
|
292
|
-
readonly size: _angular_core.InputSignal<"
|
|
349
|
+
readonly size: _angular_core.InputSignal<"medium" | "large" | "small" | null | undefined>;
|
|
293
350
|
readonly textField: _angular_core.InputSignal<ListKeySelector<TData, string> | undefined>;
|
|
294
351
|
readonly width: _angular_core.InputSignal<ListSizeInputType>;
|
|
295
352
|
constructor();
|
|
@@ -298,6 +355,8 @@ declare class ListComponent<TData> implements OnInit {
|
|
|
298
355
|
protected onListItemClick(item: ListItem<TData>): void;
|
|
299
356
|
protected trackByUid(_: number, item: ListItem<TData>): string;
|
|
300
357
|
private cycleThroughMatchedItems;
|
|
358
|
+
/** Focuses the list element of an empty list, which names the list and is described by "No data". */
|
|
359
|
+
private focusEmptyList;
|
|
301
360
|
private focusToItem;
|
|
302
361
|
/**
|
|
303
362
|
* Handles multiple-selection shortcuts from the WAI-ARIA listbox pattern:
|
|
@@ -307,6 +366,18 @@ declare class ListComponent<TData> implements OnInit {
|
|
|
307
366
|
private handleMultipleSelectionKeys;
|
|
308
367
|
private handleNavigation;
|
|
309
368
|
private handlePageScroll;
|
|
369
|
+
/**
|
|
370
|
+
* Whether a key event is meant for the list: from the host, the list element, one of this list's own options or
|
|
371
|
+
* its filter input. Keys typed into controls in header, footer or item templates (or in a nested list) are left
|
|
372
|
+
* to those controls.
|
|
373
|
+
*/
|
|
374
|
+
private isListKeyTarget;
|
|
375
|
+
private rememberFocusedOption;
|
|
376
|
+
/**
|
|
377
|
+
* When the option that had focus is removed from the data, focus would fall to the page. Move it to the option
|
|
378
|
+
* now at the same position, or the last one.
|
|
379
|
+
*/
|
|
380
|
+
private restoreFocusAfterRemoval;
|
|
310
381
|
private scrollToItem;
|
|
311
382
|
private selectItem;
|
|
312
383
|
private setInitialSelectionOrFocus;
|
|
@@ -316,7 +387,7 @@ declare class ListComponent<TData> implements OnInit {
|
|
|
316
387
|
private setTypeaheadSubscription;
|
|
317
388
|
private toggleItem;
|
|
318
389
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListComponent<any>, never>;
|
|
319
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ListComponent<any>, "mona-list", never, { "ariaLabel": { "alias": "ariaLabel"; "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; }; "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; }; }, { "itemSelect": "itemSelect"; }, ["footerTemplate", "groupHeaderTemplate", "headerTemplate", "itemTemplate", "noDataTemplate"], never, true, never>;
|
|
390
|
+
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>;
|
|
320
391
|
}
|
|
321
392
|
|
|
322
393
|
declare class ListFooterTemplateDirective {
|
|
@@ -344,7 +415,15 @@ declare class ListNoDataTemplateDirective {
|
|
|
344
415
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ListNoDataTemplateDirective, "ng-template[monaListNoDataTemplate]", never, {}, {}, never, never, true, never>;
|
|
345
416
|
}
|
|
346
417
|
|
|
418
|
+
/**
|
|
419
|
+
* Lets a component that wraps a `mona-list-view` in its own template share its `ListService` with that list view.
|
|
420
|
+
* Provide it in `viewProviders` (`{ provide: LIST_VIEW_HOST_LIST_SERVICE, useExisting: ListService }`), so only the
|
|
421
|
+
* component's own list view sees it, never a list view placed in content the component projects or renders from a
|
|
422
|
+
* consumer's template. Without it, every list view has its own service.
|
|
423
|
+
*/
|
|
424
|
+
declare const LIST_VIEW_HOST_LIST_SERVICE: InjectionToken<ListService<unknown>>;
|
|
425
|
+
|
|
347
426
|
declare const LIST_DEFAULT_MESSAGES: MonaListMessages;
|
|
348
427
|
|
|
349
|
-
export { LIST_DEFAULT_MESSAGES, ListComponent, ListFooterTemplateDirective, ListGroupHeaderTemplateDirective, ListHeaderTemplateDirective, ListItem, ListItemTemplateDirective, ListNoDataTemplateDirective, ListService };
|
|
428
|
+
export { LIST_DEFAULT_MESSAGES, LIST_VIEW_HOST_LIST_SERVICE, ListComponent, ListFooterTemplateDirective, ListGroupHeaderTemplateDirective, ListHeaderTemplateDirective, ListItem, ListItemTemplateDirective, ListNoDataTemplateDirective, ListService };
|
|
350
429
|
export type { GroupableOptions, ListKeySelector, ListSizeInputType, NavigableOptions, NavigationDirection, NavigationMode, PagerSettings, SelectableOptions, SelectionChangeEvent };
|