@nanahoshi/mona-ui 0.23.0 → 0.23.2
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-dropdown-list.mjs +1 -1
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component--nF_Q7Bd.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-CIMXz60d.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-S2qxwP2M.mjs → nanahoshi-mona-ui-grid-grid-list.component-CpeheGXU.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-Dwy8hCm7.mjs → nanahoshi-mona-ui-grid-grid-row.component-B_5ay_Nz.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DArxdAah.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-BzKywU5b.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-bduDEm-x.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-IewqeT4m.mjs} +8 -8
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +150 -90
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +47 -7
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +386 -180
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +266 -99
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +35 -32
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +13 -0
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +27 -1
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1 -1
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-i18n.d.ts +21 -4
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +35 -1
- package/types/nanahoshi-mona-ui-internal-list.d.ts +82 -16
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +50 -3
- package/types/nanahoshi-mona-ui-internal.d.ts +18 -4
- package/types/nanahoshi-mona-ui-locales.d.ts +13 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +5 -0
|
@@ -67,6 +67,11 @@ declare class TreeNode<T> {
|
|
|
67
67
|
readonly data: T;
|
|
68
68
|
readonly loading: _angular_core.WritableSignal<boolean>;
|
|
69
69
|
readonly uid: string;
|
|
70
|
+
/**
|
|
71
|
+
* Whether children from an asynchronous children selector have been loaded. Loaded children are cached,
|
|
72
|
+
* so collapsing and re-expanding the node does not request them again.
|
|
73
|
+
*/
|
|
74
|
+
childrenLoaded: boolean;
|
|
70
75
|
index: string;
|
|
71
76
|
parent: TreeNode<T> | null;
|
|
72
77
|
constructor(data: T);
|
|
@@ -269,6 +274,15 @@ declare class TreeService<T> {
|
|
|
269
274
|
static flatten<T>(nodes: Iterable<TreeNode<T>>): List<TreeNode<T>>;
|
|
270
275
|
clearFilter(): void;
|
|
271
276
|
detachNode(node: TreeNode<T>): void;
|
|
277
|
+
/**
|
|
278
|
+
* Expands every expandable, enabled sibling of a node (the `*` key of the WAI-ARIA tree pattern).
|
|
279
|
+
*/
|
|
280
|
+
expandSiblings(node: TreeNode<T>): void;
|
|
281
|
+
/**
|
|
282
|
+
* Finds the next visible node, after the navigated node and wrapping around, whose text starts with `prefix`
|
|
283
|
+
* (case-insensitive). Used for typeahead.
|
|
284
|
+
*/
|
|
285
|
+
findNodeByText(prefix: string): TreeNode<T> | null;
|
|
272
286
|
getNodeByUid(uid: string): TreeNode<T> | null;
|
|
273
287
|
getNodeElementId(uid: string): string;
|
|
274
288
|
getNodeText(node: TreeNode<T>): string;
|
|
@@ -283,7 +297,15 @@ declare class TreeService<T> {
|
|
|
283
297
|
isSelected(node: TreeNode<T>): boolean;
|
|
284
298
|
isTreeFiltered(): boolean;
|
|
285
299
|
isVisible(node: TreeNode<T>): boolean;
|
|
286
|
-
|
|
300
|
+
/**
|
|
301
|
+
* Loads the children of a node from an asynchronous children selector.
|
|
302
|
+
* Children are loaded once and cached; pass `reload` to request them again. A new load cancels a pending one.
|
|
303
|
+
*/
|
|
304
|
+
loadNodeChildren(node: TreeNode<T>, reload?: boolean): void;
|
|
305
|
+
/**
|
|
306
|
+
* Moves a node relative to a target node. Moving a node onto itself or into its own subtree is ignored,
|
|
307
|
+
* because it would detach the subtree and create a parent cycle.
|
|
308
|
+
*/
|
|
287
309
|
moveNode(sourceNode: TreeNode<T>, targetNode: TreeNode<T>, position: DropPosition): void;
|
|
288
310
|
navigate(direction: "next" | "previous" | "first" | "last"): TreeNode<T> | null;
|
|
289
311
|
notifySelectionChange(node: TreeNode<T>): void;
|
|
@@ -314,21 +336,40 @@ declare class TreeService<T> {
|
|
|
314
336
|
setSelectedDataItems(dataItems: Iterable<T>): void;
|
|
315
337
|
setSelectedKeys(keys: Iterable<any>): void;
|
|
316
338
|
setTextField(selector: string | Selector<T, string>): void;
|
|
339
|
+
/**
|
|
340
|
+
* Expands or collapses a node the way user interaction does: disabled nodes are left alone, children of an
|
|
341
|
+
* asynchronous children selector are loaded on first expand, and `nodeExpand$` is notified.
|
|
342
|
+
* @returns whether the expand state changed.
|
|
343
|
+
*/
|
|
344
|
+
toggleNodeExpand(node: TreeNode<T>, expanded: boolean): boolean;
|
|
317
345
|
getCheckKey(node: TreeNode<T>): any;
|
|
318
346
|
getDisableKey(node: TreeNode<T>): any;
|
|
319
347
|
private applyCheckedKeysToNodes;
|
|
320
348
|
private computeVisibleUids;
|
|
321
349
|
private createFlatNodes;
|
|
350
|
+
/**
|
|
351
|
+
* Builds tree nodes for hierarchical data, reusing the existing node of each data item so node state survives
|
|
352
|
+
* a data refresh. A data object that appears more than once gets a node of its own for every extra occurrence.
|
|
353
|
+
*/
|
|
322
354
|
private createHierarchicalNodes;
|
|
323
355
|
private createNodeDictionary;
|
|
324
356
|
private createNodes;
|
|
357
|
+
/**
|
|
358
|
+
* The derived check state of a parent: `true` when all of its check-state children are checked,
|
|
359
|
+
* or `null` when it has none (its own state then stands).
|
|
360
|
+
*/
|
|
361
|
+
private deriveParentChecked;
|
|
362
|
+
/**
|
|
363
|
+
* Children that determine a parent's derived check state: those with a checkbox and, unless
|
|
364
|
+
* `checkDisabledChildren` is set, only enabled ones, because the user cannot change disabled children.
|
|
365
|
+
*/
|
|
366
|
+
private getCheckStateChildren;
|
|
325
367
|
private getExpandKey;
|
|
326
368
|
private getChildNodes;
|
|
327
369
|
private getDataItemSelectKey;
|
|
328
370
|
private getParentNodes;
|
|
329
371
|
private getSelectKey;
|
|
330
372
|
private isAnyParentCollapsed;
|
|
331
|
-
private isAnyParentDisabled;
|
|
332
373
|
private isFiltered;
|
|
333
374
|
private loadCheckedKeysForChildren;
|
|
334
375
|
private moveNodeAfter;
|
|
@@ -360,6 +401,7 @@ declare class TreeComponent<T> {
|
|
|
360
401
|
private setKeydownSubscription;
|
|
361
402
|
private setNodeDragHandlerSubscription;
|
|
362
403
|
private setSubscriptions;
|
|
404
|
+
private setTypeaheadSubscription;
|
|
363
405
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeComponent<any>, never>;
|
|
364
406
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TreeComponent<any>, "mona-tree", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; }, {}, ["nodeTemplate"], never, true, never>;
|
|
365
407
|
}
|
|
@@ -378,6 +420,8 @@ declare const TREE_DEFAULT_MESSAGES: MonaTreeViewMessages;
|
|
|
378
420
|
* @param idKey - The property key used to uniquely identify each node (e.g., 'id').
|
|
379
421
|
* @param parentIdKey - The property key holding the parent node's id, or null for roots (e.g., 'parentId').
|
|
380
422
|
* @returns A new array representing the updated flat tree, with the moved node's parentIdKey updated.
|
|
423
|
+
* The array is returned unchanged when the position is "outside" or the target is the dragged node or one of its
|
|
424
|
+
* descendants, which would otherwise create a parent cycle.
|
|
381
425
|
*/
|
|
382
426
|
declare function moveFlatTreeNode<T extends Record<string, any>>(treeData: Iterable<T>, event: NodeDropEvent<T>, idKey: keyof T, parentIdKey: keyof T): T[];
|
|
383
427
|
|
|
@@ -387,7 +431,10 @@ declare function moveFlatTreeNode<T extends Record<string, any>>(treeData: Itera
|
|
|
387
431
|
* @param event - The drag-and-drop event payload.
|
|
388
432
|
* @param idKey - The property key used to identify nodes (e.g., 'id').
|
|
389
433
|
* @param childrenKey - The property key containing the nested items (e.g., 'items').
|
|
390
|
-
* @returns A new array representing the updated tree structure.
|
|
434
|
+
* @returns A new top-level array representing the updated tree structure.
|
|
435
|
+
* Nested children arrays are updated in place, so untouched data items keep their identity (and their tree state).
|
|
436
|
+
* The move is skipped, returning the tree unchanged, when the position is "outside", the target is missing,
|
|
437
|
+
* or the target is the dragged node or one of its descendants, so a node is never lost or made its own ancestor.
|
|
391
438
|
*/
|
|
392
439
|
declare function moveTreeNode<T extends Record<string, any>>(treeData: Iterable<T>, event: NodeDropEvent<T>, idKey: keyof T, childrenKey: keyof T): T[];
|
|
393
440
|
|
|
@@ -72,7 +72,8 @@ type Action<P = void, R = void> = (arg: P) => R;
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Generates a unique control ID for an element.
|
|
75
|
-
* The ID consists of
|
|
75
|
+
* The ID consists of the `mona-` prefix followed by a random hexadecimal string.
|
|
76
|
+
* It contains only characters that are safe in CSS selectors, so it can be used with `querySelector("#…")` unescaped.
|
|
76
77
|
* @param {number} [level=0] - The nesting level of the element. This increases the length of the generated ID.
|
|
77
78
|
* @param {number} [length=7] - The base length of the random part of the ID.
|
|
78
79
|
* @returns {string} A unique control ID string for use for elements.
|
|
@@ -99,12 +100,12 @@ declare const themeOverlaySurfaceClasses = "\n [background-color:var(--mona-e
|
|
|
99
100
|
declare const restoreOverlayScroll: (overlayRef: OverlayRef, element: HTMLElement) => void;
|
|
100
101
|
|
|
101
102
|
interface WindowStyleSettings {
|
|
103
|
+
left?: number;
|
|
102
104
|
maxHeight?: number;
|
|
103
105
|
maxWidth?: number;
|
|
104
106
|
minHeight?: number;
|
|
105
107
|
minWidth?: number;
|
|
106
108
|
top?: number;
|
|
107
|
-
left?: number;
|
|
108
109
|
windowClass?: string | string[];
|
|
109
110
|
}
|
|
110
111
|
declare const setWindowStyles: (element: HTMLElement, settings: WindowStyleSettings) => void;
|
|
@@ -136,8 +137,21 @@ declare enum NavigationKeys {
|
|
|
136
137
|
declare const NavigationKeysList: string[];
|
|
137
138
|
declare const isNavigationKey: (key: string) => boolean;
|
|
138
139
|
|
|
139
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Modifier state of a keyboard event. Typeahead is skipped while Ctrl, Meta or Alt is held,
|
|
142
|
+
* so shortcuts such as Ctrl+A or Cmd+C keep their default behavior.
|
|
143
|
+
*/
|
|
144
|
+
interface TypeaheadModifiers {
|
|
145
|
+
readonly altKey?: boolean;
|
|
146
|
+
readonly ctrlKey?: boolean;
|
|
147
|
+
readonly metaKey?: boolean;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Returns whether a `KeyboardEvent.key` value should feed typeahead.
|
|
151
|
+
* Any single letter or digit in any script counts, plus space, `-` and `_`.
|
|
152
|
+
*/
|
|
153
|
+
declare const isTypeaheadKey: (key: string, modifiers?: TypeaheadModifiers) => boolean;
|
|
140
154
|
declare const setupTypeahead: (typeaheadKey$: Observable<string>) => Observable<string>;
|
|
141
155
|
|
|
142
156
|
export { AttributeBinderDirective, NavigationKeys, NavigationKeysList, createElementControlId, focusElement, hex2rgba, hsla2hsva, hsva2rgba, isNavigationKey, isTypeaheadKey, isValidHex, isValidHsla, isValidRgb, restoreOverlayScroll, rgba2hex, rgba2hsla, rgba2hsva, rxFromResize, rxTimeout, setWindowStyles, setupTypeahead, string2Hsla, string2rgba, themeControlBackdropClasses, themeControlSurfaceClasses, themeOverlayBackdropClasses, themeOverlaySurfaceClasses, themeRaisedBackdropClasses, themeRaisedSurfaceClasses, toCssValue };
|
|
143
|
-
export type { Action, AttributeConfig, Channel, ColorScheme, HSL, HSLA, HSV, HSVA, HSVChannel, RGB, RGBA, RGBAChannel, RGBChannel, VariantInputs, WindowStyleSettings };
|
|
157
|
+
export type { Action, AttributeConfig, Channel, ColorScheme, HSL, HSLA, HSV, HSVA, HSVChannel, RGB, RGBA, RGBAChannel, RGBChannel, TypeaheadModifiers, VariantInputs, WindowStyleSettings };
|
|
@@ -239,6 +239,7 @@ declare const MONA_AR_SA_LOCALE: {
|
|
|
239
239
|
selectRow: (rowNumber: number) => string;
|
|
240
240
|
};
|
|
241
241
|
list: {
|
|
242
|
+
filterList: string;
|
|
242
243
|
noData: string;
|
|
243
244
|
};
|
|
244
245
|
listBox: {
|
|
@@ -616,6 +617,7 @@ declare const MONA_ES_ES_LOCALE: {
|
|
|
616
617
|
selectRow: (rowNumber: number) => string;
|
|
617
618
|
};
|
|
618
619
|
list: {
|
|
620
|
+
filterList: string;
|
|
619
621
|
noData: string;
|
|
620
622
|
};
|
|
621
623
|
listBox: {
|
|
@@ -993,6 +995,7 @@ declare const MONA_DE_DE_LOCALE: {
|
|
|
993
995
|
selectRow: (rowNumber: number) => string;
|
|
994
996
|
};
|
|
995
997
|
list: {
|
|
998
|
+
filterList: string;
|
|
996
999
|
noData: string;
|
|
997
1000
|
};
|
|
998
1001
|
listBox: {
|
|
@@ -1370,6 +1373,7 @@ declare const MONA_FR_FR_LOCALE: {
|
|
|
1370
1373
|
selectRow: (rowNumber: number) => string;
|
|
1371
1374
|
};
|
|
1372
1375
|
list: {
|
|
1376
|
+
filterList: string;
|
|
1373
1377
|
noData: string;
|
|
1374
1378
|
};
|
|
1375
1379
|
listBox: {
|
|
@@ -1747,6 +1751,7 @@ declare const MONA_IT_IT_LOCALE: {
|
|
|
1747
1751
|
selectRow: (rowNumber: number) => string;
|
|
1748
1752
|
};
|
|
1749
1753
|
list: {
|
|
1754
|
+
filterList: string;
|
|
1750
1755
|
noData: string;
|
|
1751
1756
|
};
|
|
1752
1757
|
listBox: {
|
|
@@ -2124,6 +2129,7 @@ declare const MONA_JA_JP_LOCALE: {
|
|
|
2124
2129
|
selectRow: (rowNumber: number) => string;
|
|
2125
2130
|
};
|
|
2126
2131
|
list: {
|
|
2132
|
+
filterList: string;
|
|
2127
2133
|
noData: string;
|
|
2128
2134
|
};
|
|
2129
2135
|
listBox: {
|
|
@@ -2501,6 +2507,7 @@ declare const MONA_KO_KR_LOCALE: {
|
|
|
2501
2507
|
selectRow: (rowNumber: number) => string;
|
|
2502
2508
|
};
|
|
2503
2509
|
list: {
|
|
2510
|
+
filterList: string;
|
|
2504
2511
|
noData: string;
|
|
2505
2512
|
};
|
|
2506
2513
|
listBox: {
|
|
@@ -2878,6 +2885,7 @@ declare const MONA_PT_BR_LOCALE: {
|
|
|
2878
2885
|
selectRow: (rowNumber: number) => string;
|
|
2879
2886
|
};
|
|
2880
2887
|
list: {
|
|
2888
|
+
filterList: string;
|
|
2881
2889
|
noData: string;
|
|
2882
2890
|
};
|
|
2883
2891
|
listBox: {
|
|
@@ -3255,6 +3263,7 @@ declare const MONA_ZH_CN_LOCALE: {
|
|
|
3255
3263
|
selectRow: (rowNumber: number) => string;
|
|
3256
3264
|
};
|
|
3257
3265
|
list: {
|
|
3266
|
+
filterList: string;
|
|
3258
3267
|
noData: string;
|
|
3259
3268
|
};
|
|
3260
3269
|
listBox: {
|
|
@@ -3632,6 +3641,7 @@ declare const MONA_ZH_TW_LOCALE: {
|
|
|
3632
3641
|
selectRow: (rowNumber: number) => string;
|
|
3633
3642
|
};
|
|
3634
3643
|
list: {
|
|
3644
|
+
filterList: string;
|
|
3635
3645
|
noData: string;
|
|
3636
3646
|
};
|
|
3637
3647
|
listBox: {
|
|
@@ -4009,6 +4019,7 @@ declare const MONA_TR_TR_LOCALE: {
|
|
|
4009
4019
|
selectRow: (rowNumber: number) => string;
|
|
4010
4020
|
};
|
|
4011
4021
|
list: {
|
|
4022
|
+
filterList: string;
|
|
4012
4023
|
noData: string;
|
|
4013
4024
|
};
|
|
4014
4025
|
listBox: {
|
|
@@ -4386,6 +4397,7 @@ declare const MONA_ID_ID_LOCALE: {
|
|
|
4386
4397
|
selectRow: (rowNumber: number) => string;
|
|
4387
4398
|
};
|
|
4388
4399
|
list: {
|
|
4400
|
+
filterList: string;
|
|
4389
4401
|
noData: string;
|
|
4390
4402
|
};
|
|
4391
4403
|
listBox: {
|
|
@@ -4763,6 +4775,7 @@ declare const MONA_RU_RU_LOCALE: {
|
|
|
4763
4775
|
selectRow: (rowNumber: number) => string;
|
|
4764
4776
|
};
|
|
4765
4777
|
list: {
|
|
4778
|
+
filterList: string;
|
|
4766
4779
|
noData: string;
|
|
4767
4780
|
};
|
|
4768
4781
|
listBox: {
|
|
@@ -146,6 +146,11 @@ declare class NumericTextBoxComponent implements NumericTextboxVariantInputs, Fo
|
|
|
146
146
|
private formatEditValue;
|
|
147
147
|
private formatValueForDisplay;
|
|
148
148
|
protected onPaste(event: ClipboardEvent): void;
|
|
149
|
+
/**
|
|
150
|
+
* The numpad decimal key types "." or "," depending on the keyboard layout, not the locale. Insert the
|
|
151
|
+
* locale's decimal separator instead, so a de-DE layout used with an en-US locale still types a decimal.
|
|
152
|
+
*/
|
|
153
|
+
private insertLocaleDecimal;
|
|
149
154
|
private parseValue;
|
|
150
155
|
private setBeforeInputSubscription;
|
|
151
156
|
private setInputFocusSubscription;
|