@nanahoshi/mona-ui 0.24.7 → 0.24.8
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-combo-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1 -1
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-vXXNWmEN.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DdyHnUIr.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-DDgNmgE0.mjs → nanahoshi-mona-ui-grid-grid-list.component-B6gq7Hu3.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-Dzf6Vbs_.mjs → nanahoshi-mona-ui-grid-grid-row.component-DdUY3I7P.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DAPNqnWV.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-DG8Bu4Dy.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-B9rmDLq8.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CVqpbMcb.mjs} +8 -8
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +40 -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 +28 -2
- 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 +25 -3
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +36 -3
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +25 -3
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +25 -3
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +25 -3
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +45 -3
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +25 -3
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +25 -3
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +25 -3
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +205 -140
- package/i18n/catalogs/en-US.messages.json +28 -6
- package/locales/ar-sa/ar-sa.messages.json +25 -3
- package/locales/de-de/de-de.messages.json +25 -3
- package/locales/es-es/es-es.messages.json +25 -3
- package/locales/fr-fr/fr-fr.messages.json +25 -3
- package/locales/id-id/id-id.messages.json +25 -3
- package/locales/it-it/it-it.messages.json +25 -3
- package/locales/ja-jp/ja-jp.messages.json +25 -3
- package/locales/ko-kr/ko-kr.messages.json +25 -3
- package/locales/pt-br/pt-br.messages.json +25 -3
- package/locales/ru-ru/ru-ru.messages.json +25 -3
- package/locales/tr-tr/tr-tr.messages.json +25 -3
- package/locales/zh-cn/zh-cn.messages.json +25 -3
- package/locales/zh-tw/zh-tw.messages.json +25 -3
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-i18n.d.ts +50 -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 +10 -2
- 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 +22 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +22 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +22 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +22 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +22 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +22 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +22 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +22 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +22 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +22 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +22 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +22 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +22 -0
- package/types/nanahoshi-mona-ui-tree-view.d.ts +84 -40
|
@@ -257,17 +257,29 @@
|
|
|
257
257
|
},
|
|
258
258
|
"list": {
|
|
259
259
|
"filterList": "筛选列表",
|
|
260
|
-
"
|
|
260
|
+
"loading": "正在加载",
|
|
261
|
+
"noData": "没有数据",
|
|
262
|
+
"pagerLabel": "{list}分页"
|
|
261
263
|
},
|
|
262
264
|
"listBox": {
|
|
263
265
|
"clearSelection": "清除选择",
|
|
266
|
+
"itemsMoved": "已移至第 {position} 位,共 {total} 位",
|
|
267
|
+
"itemsRemoved": "已移除 {count} 项",
|
|
268
|
+
"itemsTransferred": "已将 {count} 项移至{list}",
|
|
269
|
+
"itemsTransferredToOtherList": "已将 {count} 项移至另一列表",
|
|
264
270
|
"moveDown": "向下移动",
|
|
265
271
|
"moveUp": "向上移动",
|
|
266
272
|
"remove": "移除",
|
|
273
|
+
"selectionCleared": "已清除选择",
|
|
274
|
+
"toolbarLabel": "{list}操作",
|
|
267
275
|
"transferAllFrom": "从另一列表全部移入",
|
|
276
|
+
"transferAllFromList": "从{list}全部移入",
|
|
268
277
|
"transferAllTo": "全部移至另一列表",
|
|
278
|
+
"transferAllToList": "全部移至{list}",
|
|
269
279
|
"transferFrom": "从另一列表移入",
|
|
270
|
-
"
|
|
280
|
+
"transferFromList": "从{list}移入",
|
|
281
|
+
"transferTo": "移至另一列表",
|
|
282
|
+
"transferToList": "移至{list}"
|
|
271
283
|
},
|
|
272
284
|
"multiSelect": {
|
|
273
285
|
"clear": "清除",
|
|
@@ -378,7 +390,17 @@
|
|
|
378
390
|
"collapse": "折叠",
|
|
379
391
|
"expand": "展开",
|
|
380
392
|
"filter": "筛选",
|
|
381
|
-
"
|
|
393
|
+
"filterLabel": "筛选{tree}",
|
|
394
|
+
"filterTree": "筛选树",
|
|
395
|
+
"loadError": "无法加载{node}中的项目",
|
|
396
|
+
"loadingNode": "正在加载{node}",
|
|
397
|
+
"movedAfter": "已将 {node} 移到 {target} 之后",
|
|
398
|
+
"movedBefore": "已将 {node} 移到 {target} 之前",
|
|
399
|
+
"movedInto": "已将 {node} 移入 {target}",
|
|
400
|
+
"noData": "没有数据",
|
|
401
|
+
"noMatches": "没有匹配的项目",
|
|
402
|
+
"results": "{count} 个结果",
|
|
403
|
+
"retryLoading": "重试加载{node}"
|
|
382
404
|
},
|
|
383
405
|
"window": {
|
|
384
406
|
"close": "关闭",
|
|
@@ -257,17 +257,29 @@
|
|
|
257
257
|
},
|
|
258
258
|
"list": {
|
|
259
259
|
"filterList": "篩選清單",
|
|
260
|
-
"
|
|
260
|
+
"loading": "載入中",
|
|
261
|
+
"noData": "沒有資料",
|
|
262
|
+
"pagerLabel": "{list}分頁"
|
|
261
263
|
},
|
|
262
264
|
"listBox": {
|
|
263
265
|
"clearSelection": "清除選取",
|
|
266
|
+
"itemsMoved": "已移至第 {position} 位,共 {total} 位",
|
|
267
|
+
"itemsRemoved": "已移除 {count} 項",
|
|
268
|
+
"itemsTransferred": "已將 {count} 項移至{list}",
|
|
269
|
+
"itemsTransferredToOtherList": "已將 {count} 項移至另一清單",
|
|
264
270
|
"moveDown": "向下移動",
|
|
265
271
|
"moveUp": "向上移動",
|
|
266
272
|
"remove": "移除",
|
|
273
|
+
"selectionCleared": "已清除選取",
|
|
274
|
+
"toolbarLabel": "{list}操作",
|
|
267
275
|
"transferAllFrom": "從另一清單全部移入",
|
|
276
|
+
"transferAllFromList": "從{list}全部移入",
|
|
268
277
|
"transferAllTo": "全部移至另一清單",
|
|
278
|
+
"transferAllToList": "全部移至{list}",
|
|
269
279
|
"transferFrom": "從另一清單移入",
|
|
270
|
-
"
|
|
280
|
+
"transferFromList": "從{list}移入",
|
|
281
|
+
"transferTo": "移至另一清單",
|
|
282
|
+
"transferToList": "移至{list}"
|
|
271
283
|
},
|
|
272
284
|
"multiSelect": {
|
|
273
285
|
"clear": "清除",
|
|
@@ -378,7 +390,17 @@
|
|
|
378
390
|
"collapse": "摺疊",
|
|
379
391
|
"expand": "展開",
|
|
380
392
|
"filter": "篩選",
|
|
381
|
-
"
|
|
393
|
+
"filterLabel": "篩選{tree}",
|
|
394
|
+
"filterTree": "篩選樹狀檢視",
|
|
395
|
+
"loadError": "無法載入{node}中的項目",
|
|
396
|
+
"loadingNode": "正在載入{node}",
|
|
397
|
+
"movedAfter": "已將 {node} 移到 {target} 之後",
|
|
398
|
+
"movedBefore": "已將 {node} 移到 {target} 之前",
|
|
399
|
+
"movedInto": "已將 {node} 移入 {target}",
|
|
400
|
+
"noData": "沒有資料",
|
|
401
|
+
"noMatches": "沒有符合的項目",
|
|
402
|
+
"results": "{count} 個結果",
|
|
403
|
+
"retryLoading": "重試載入{node}"
|
|
382
404
|
},
|
|
383
405
|
"window": {
|
|
384
406
|
"close": "關閉",
|
package/package.json
CHANGED
|
@@ -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 {
|
|
@@ -451,8 +479,30 @@ type TimeSelectorMessages = MonaTimeSelectorMessages;
|
|
|
451
479
|
interface MonaTreeViewMessages {
|
|
452
480
|
readonly collapse: string;
|
|
453
481
|
readonly expand: string;
|
|
482
|
+
/** @deprecated No longer rendered; the filter input's name comes from {@link filterLabel}. */
|
|
454
483
|
readonly filter: string;
|
|
484
|
+
/** Accessible name of the filter input, from the tree view's name ("Filter Files"). */
|
|
485
|
+
filterLabel(tree: string): string;
|
|
486
|
+
/** Accessible name of the filter input when the tree view has no `aria-label`. */
|
|
455
487
|
readonly filterTree: string;
|
|
488
|
+
/** Announced, and read with the node, when a node's children couldn't be loaded. */
|
|
489
|
+
loadError(node: string): string;
|
|
490
|
+
/** Announced while a node's children take a while to load, and the expander's name meanwhile. */
|
|
491
|
+
loadingNode(node: string): string;
|
|
492
|
+
/** Announced when a keyboard move (Ctrl+Shift+Arrow) put a node after another node. */
|
|
493
|
+
movedAfter(node: string, target: string): string;
|
|
494
|
+
/** Announced when a keyboard move put a node before another node. */
|
|
495
|
+
movedBefore(node: string, target: string): string;
|
|
496
|
+
/** Announced when a keyboard move put a node inside another node, as its last child. */
|
|
497
|
+
movedInto(node: string, target: string): string;
|
|
498
|
+
/** Shown, and describes the tree, when the tree view has no data. */
|
|
499
|
+
readonly noData: string;
|
|
500
|
+
/** Shown, describes the tree and is announced, when no node matches the filter. */
|
|
501
|
+
readonly noMatches: string;
|
|
502
|
+
/** Announced after the user filters, with the number of nodes that match. */
|
|
503
|
+
results(count: number): string;
|
|
504
|
+
/** Name of the expander of a node whose children couldn't be loaded. */
|
|
505
|
+
retryLoading(node: string): string;
|
|
456
506
|
}
|
|
457
507
|
|
|
458
508
|
interface 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 };
|