@ixfx/components 0.15.5 → 0.16.1
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/bundle/index.d.ts +986 -49
- package/bundle/index.js +765 -729
- package/dist/ac-token.js +1 -1
- package/dist/crumb-navigation-BbqfmkYs.d.ts +147 -0
- package/dist/crumb-navigation-YnFVFqrx.js +1290 -0
- package/dist/crumbs.d.ts +2 -115
- package/dist/crumbs.js +1 -1179
- package/dist/{data-grid-C1sZX6n9.js → data-grid-Cqxuwgbb.js} +615 -210
- package/dist/{data-grid-D7qzmMMp.d.ts → data-grid-Csh5EJW9.d.ts} +55 -4
- package/dist/data-grid.d.ts +3 -3
- package/dist/data-grid.js +1 -1
- package/dist/{detail-list-q8bs67BM.js → detail-list-Bo5ze3SN.js} +234 -9
- package/dist/{detail-list-CKIKlszv.d.ts → detail-list-DSZ1DDor.d.ts} +48 -4
- package/dist/detail-list.d.ts +4 -4
- package/dist/detail-list.js +1 -1
- package/dist/{flat-list-DXMyDiSH.d.ts → flat-list-CT9kX3TQ.d.ts} +27 -4
- package/dist/flat-list.d.ts +2 -2
- package/dist/flat-list.js +123 -4
- package/dist/{grid-list-y6dWJYu3.js → grid-list-D0dJNVEF.js} +278 -76
- package/dist/{grid-list-0e7snW6t.d.ts → grid-list-DDLrWRxm.d.ts} +128 -22
- package/dist/grid-list.d.ts +3 -3
- package/dist/grid-list.js +1 -1
- package/dist/{incr-search-JIhwB49y.js → incr-search-CgbL-OlS.js} +140 -10
- package/dist/incr-search.d.ts +1 -1
- package/dist/incr-search.js +1 -1
- package/dist/index-9ttcdwlL.d.ts +71 -0
- package/dist/index-Bnm-kKGC.d.ts +475 -0
- package/dist/{index-KN2MW_xD.d.ts → index-CUErGhCg.d.ts} +31 -4
- package/dist/{index-DEVyVIn8.d.ts → index-D-lZNlHa.d.ts} +52 -6
- package/dist/index.d.ts +341 -21
- package/dist/index.js +2286 -884
- package/dist/{list-native-drag-controller-O2Nruqpi.d.ts → list-native-drag-controller-D_UrXipS.d.ts} +1 -1
- package/dist/{list-selection-controller-BeE70lbB.js → list-selection-controller-5L0Nj9tR.js} +87 -2
- package/dist/miller-DUqiUAWQ.js +2230 -0
- package/dist/miller.d.ts +4 -437
- package/dist/miller.js +1 -1815
- package/dist/narrowed-text.js +1 -1
- package/dist/pending-BGidHppL.js +91 -0
- package/dist/scroll-hover-guard-Cjw6179Q.js +35 -0
- package/dist/{split-layout-JK3xWVX2.d.ts → split-layout-CophkNeU.d.ts} +41 -3
- package/dist/{split-layout-Deoxy47d.js → split-layout-DTY4PJRp.js} +251 -19
- package/dist/split-layout.d.ts +1 -1
- package/dist/split-layout.js +1 -1
- package/dist/sunburst-tree.d.ts +2 -2
- package/dist/sunburst-tree.js +1 -1
- package/dist/{sunbursttree-list-yXwS-uEI.js → sunbursttree-list-B_M0YTEA.js} +299 -80
- package/dist/{sunbursttree-list--Z0uyh8O.d.ts → sunbursttree-list-DePuFYlU.d.ts} +40 -3
- package/dist/tree-CftHwtEb.js +146 -0
- package/dist/{tree-D8VxvR9u.js → tree-DAlgvaHB.js} +276 -48
- package/dist/{tree-component-C6UHO-w9.d.ts → tree-component-DgfkxmVY.d.ts} +19 -8
- package/dist/tree.d.ts +3 -3
- package/dist/tree.js +1 -1
- package/dist/types-LU1u0CB8.d.ts +87 -0
- package/dist/vertical-list-DyKPKGxK.js +1993 -0
- package/dist/{vertical-list-D8MksoTp.d.ts → vertical-list-SAx56U-l.d.ts} +31 -3
- package/dist/vertical-list.d.ts +3 -3
- package/dist/vertical-list.js +1 -1789
- package/dist/view-state-controller-BdyXWUUM.js +305 -0
- package/docs-user/README.md +2 -0
- package/docs-user/crumbs.md +27 -0
- package/docs-user/data-grid.md +79 -5
- package/docs-user/detail-list.md +69 -0
- package/docs-user/dock.md +63 -12
- package/docs-user/flat-list.md +27 -0
- package/docs-user/grid-list.md +69 -13
- package/docs-user/hyperbolic-tree.md +31 -4
- package/docs-user/icicle-tree.md +36 -0
- package/docs-user/index.json +12 -2
- package/docs-user/llms.txt +2 -0
- package/docs-user/miller.md +52 -21
- package/docs-user/multicol-list.md +50 -8
- package/docs-user/split-layout.md +45 -17
- package/docs-user/sunburst-tree.md +32 -2
- package/docs-user/tree.md +45 -6
- package/docs-user/treemap.md +32 -0
- package/docs-user/twosplit-layout.md +22 -0
- package/docs-user/user-catalog.md +1 -1
- package/docs-user/vertical-list.md +55 -7
- package/llms.txt +2 -0
- package/package.json +2 -2
package/dist/miller.d.ts
CHANGED
|
@@ -1,437 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as TreeItem,
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { LitElement, PropertyValues, TemplateResult, nothing } from "lit";
|
|
6
|
-
import { CommandRegistry } from "@clinth/ui-commands";
|
|
7
|
-
import { TraversableTree } from "@ixfx/collections";
|
|
8
|
-
//#region src/miller/types.d.ts
|
|
9
|
-
type MillerSelectionMode = `implicit` | `standard` | `manual` | `checked` | `vscode`;
|
|
10
|
-
type MillerConfig = {
|
|
11
|
-
columnWidths: Record<number, number>;
|
|
12
|
-
};
|
|
13
|
-
/** Detail for the `header-click` event fired when a column header is clicked. */
|
|
14
|
-
type MillerHeaderClickDetail = {
|
|
15
|
-
/** Zero-based column index whose header was clicked. */
|
|
16
|
-
depth: number;
|
|
17
|
-
/** The header text (label of the column's parent node). */
|
|
18
|
-
label: string;
|
|
19
|
-
/**
|
|
20
|
-
* Ancestry chain from the root node down to (and including) the node
|
|
21
|
-
* whose label is shown in this header.
|
|
22
|
-
* - depth 0 → [root]
|
|
23
|
-
* - depth 1 → [root, selectedAtDepth0]
|
|
24
|
-
* - depth d → [root, sel[0], …, sel[d-1]]
|
|
25
|
-
*/
|
|
26
|
-
path: Array<TreeNode>;
|
|
27
|
-
};
|
|
28
|
-
/** Detail for the `item-dblclick` event. */
|
|
29
|
-
type MillerItemDblClickDetail = {
|
|
30
|
-
node: TreeNode;
|
|
31
|
-
depth: number;
|
|
32
|
-
};
|
|
33
|
-
/** Detail for the `rebase` event fired when the view root changes. */
|
|
34
|
-
type MillerRebaseDetail = {
|
|
35
|
-
/** The new view root, or `undefined` when the view was restored to the full tree. */
|
|
36
|
-
viewRoot: TreeNode | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* Ancestry chain from the true root down to and including the new view root.
|
|
39
|
-
* Empty when the view shows the full tree.
|
|
40
|
-
*/
|
|
41
|
-
path: Array<TreeNode>;
|
|
42
|
-
};
|
|
43
|
-
/** Detail for the `item-rightclick` event. */
|
|
44
|
-
type MillerItemRightClickDetail = {
|
|
45
|
-
node: TreeNode;
|
|
46
|
-
depth: number;
|
|
47
|
-
mouseEvent: MouseEvent;
|
|
48
|
-
};
|
|
49
|
-
/** Detail for the `header-rightclick` event. */
|
|
50
|
-
type MillerHeaderRightClickDetail = {
|
|
51
|
-
depth: number;
|
|
52
|
-
label: string;
|
|
53
|
-
path: Array<TreeNode>;
|
|
54
|
-
mouseEvent: MouseEvent;
|
|
55
|
-
};
|
|
56
|
-
type MillerHeaderClickEvent = CustomEvent<MillerHeaderClickDetail>;
|
|
57
|
-
type MillerItemDblClickEvent = CustomEvent<MillerItemDblClickDetail>;
|
|
58
|
-
type MillerItemRightClickEvent = CustomEvent<MillerItemRightClickDetail>;
|
|
59
|
-
type MillerHeaderRightClickEvent = CustomEvent<MillerHeaderRightClickDetail>;
|
|
60
|
-
type MillerRebaseEvent = CustomEvent<MillerRebaseDetail>;
|
|
61
|
-
/**
|
|
62
|
-
* A snapshot of all display states for a single item in the miller columns.
|
|
63
|
-
*
|
|
64
|
-
* - `selected`: the item is part of the active selection.
|
|
65
|
-
* - `open`: the item is an ancestor of the current deepest column (it is on
|
|
66
|
-
* the currently open path, regardless of whether it is also selected).
|
|
67
|
-
* - `focused`: the keyboard cursor is currently on this item.
|
|
68
|
-
* - `isLeaf`: the item has no children and cannot be expanded.
|
|
69
|
-
*/
|
|
70
|
-
type MillerItemState = {
|
|
71
|
-
selected: boolean;
|
|
72
|
-
open: boolean;
|
|
73
|
-
focused: boolean;
|
|
74
|
-
isLeaf: boolean;
|
|
75
|
-
};
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/miller/miller-base.d.ts
|
|
78
|
-
/**
|
|
79
|
-
* Base class for Miller column components. Handles column lifecycle,
|
|
80
|
-
* column resizing, keyboard navigation, and selection modes.
|
|
81
|
-
*
|
|
82
|
-
* Subclasses must override `renderColumnContent`.
|
|
83
|
-
*
|
|
84
|
-
* ## Interaction modes (`interactionMode`)
|
|
85
|
-
*
|
|
86
|
-
* Controls how clicks map to selection changes. Default: `'standard'`.
|
|
87
|
-
*
|
|
88
|
-
* - `implicit`: Selection follows the cursor path (navigation mode).
|
|
89
|
-
* - `standard`: Single click selects; Shift+click range-selects within a column;
|
|
90
|
-
* Cmd/Ctrl+click toggles individual items.
|
|
91
|
-
* - `manual`: Component never modifies selection. Use `selectedKeys` / `setSelected`
|
|
92
|
-
* / `clearSelection` to drive state externally.
|
|
93
|
-
* - `checked`: Checkboxes on every item (rendered by subclass via `_isChecked` /
|
|
94
|
-
* `_handleCheckboxClick`). Clicking the item navigates/expands; clicking the
|
|
95
|
-
* checkbox toggles selection of the node and all loaded descendants.
|
|
96
|
-
*
|
|
97
|
-
* ## Events
|
|
98
|
-
* - `expand`: FYI event fired after a column opens. Detail: `{ node, depth }`
|
|
99
|
-
* - `collapse`: FYI event fired when a column closes. Detail: `{ node, depth }`
|
|
100
|
-
* - `header-click`: fired when a column header is clicked (requires `headers` attr).
|
|
101
|
-
* Detail: `{ depth, label, path: MillerNode[] }`
|
|
102
|
-
* - `activate`: fired when Enter is pressed on an item. Detail: `{ node, depth }`
|
|
103
|
-
* - `select`: fired when the selection set changes. Detail: `{ selected, previous }`
|
|
104
|
-
* - `item-click`: fired on any item click. Detail: `{ node, depth }`
|
|
105
|
-
* - `tickle`: fired when an item is hovered or keyboard cursor moves to it. Detail: `{ node, depth }`
|
|
106
|
-
*
|
|
107
|
-
* ## CSS variables
|
|
108
|
-
* - `--column-bg`: var(--surface-3)
|
|
109
|
-
* - `--column-header-bg`: var(--surface-2)
|
|
110
|
-
* - `--column-header-text`: var(--surface-muted-text)
|
|
111
|
-
* - `--column-separator`: var(--surface-5)
|
|
112
|
-
* - `--column-resize-handle`: var(--surface-5)
|
|
113
|
-
* - `--column-resize-handle-hover`: var(--accent)
|
|
114
|
-
* - `--column-resize-width`: 4px
|
|
115
|
-
* - `--item-hover-bg`: var(--item-bg-tickled)
|
|
116
|
-
* - `--item-selected-bg`: var(--item-bg-selected)
|
|
117
|
-
* - `--item-selected-text`: var(--item-text-selected)
|
|
118
|
-
*/
|
|
119
|
-
declare class MillerBaseElement extends LitElement implements TreeComponent, TreeSearchHost {
|
|
120
|
-
#private;
|
|
121
|
-
root: TreeNode | undefined;
|
|
122
|
-
model: TreeDataModel | undefined;
|
|
123
|
-
headers: boolean;
|
|
124
|
-
/**
|
|
125
|
-
* When true, the last (rightmost) column grows to fill any remaining
|
|
126
|
-
* horizontal space in the host. All other columns size to their content
|
|
127
|
-
* (`max-content`), unless the user has manually resized them.
|
|
128
|
-
*
|
|
129
|
-
* When the user clicks into an item in the stretched column and a new
|
|
130
|
-
* column opens, the previously-last column automatically transitions back
|
|
131
|
-
* to its content-based width and the new last column stretches instead.
|
|
132
|
-
* Explicit user-resized widths (via the resize handle) always win over
|
|
133
|
-
* stretching.
|
|
134
|
-
*/
|
|
135
|
-
stretchLastColumn: boolean;
|
|
136
|
-
/**
|
|
137
|
-
* Alternative node to use as the display root (Finder-style column-view
|
|
138
|
-
* rebase). When set, column 0 shows this node's children and all depths,
|
|
139
|
-
* headers, and key paths are relative to it. When `undefined` (default),
|
|
140
|
-
* the full `root` tree is shown.
|
|
141
|
-
*
|
|
142
|
-
* Prefer `rebaseTo()` / `rebaseUp()` over assigning this directly — they
|
|
143
|
-
* validate the target and report whether the view changed. Assigning a new
|
|
144
|
-
* `root` (or receiving one via `model`) silently clears the view root.
|
|
145
|
-
*/
|
|
146
|
-
viewRoot: TreeNode | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* Controls the column-level interaction pattern (how clicks map to column changes).
|
|
149
|
-
* This is distinct from `selectionFilter` (which restricts which node kinds are selectable).
|
|
150
|
-
* Default: `'standard'`.
|
|
151
|
-
*/
|
|
152
|
-
interactionMode: MillerSelectionMode;
|
|
153
|
-
selectionFilter: TreeSelectionFilter;
|
|
154
|
-
exclusivity: TreeExclusivity;
|
|
155
|
-
/**
|
|
156
|
-
* Callback to load children for a lazy node.
|
|
157
|
-
* Superseded by `model` when both are set.
|
|
158
|
-
* If not set and `model` is not set, clicking a lazy node opens an empty column.
|
|
159
|
-
*/
|
|
160
|
-
loadChildren: LoadChildrenCallback | undefined;
|
|
161
|
-
filterPredicate: TreeFilterPredicate | undefined;
|
|
162
|
-
/**
|
|
163
|
-
* Space-separated subset of `navigate select filter` — limits which
|
|
164
|
-
* incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search
|
|
165
|
-
* disabled. See `docs/infra-incremental.md`.
|
|
166
|
-
*/
|
|
167
|
-
searchModes: string | undefined;
|
|
168
|
-
protected _columns: TreeNode[][];
|
|
169
|
-
protected _loadingDepth: number | undefined;
|
|
170
|
-
protected _selectedByDepth: Map<number, TreeNode>;
|
|
171
|
-
protected _selectedKeys: Set<string>;
|
|
172
|
-
protected _selectedNodes: Set<TreeNode>;
|
|
173
|
-
/** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */
|
|
174
|
-
readonly search: ListSearchController<{
|
|
175
|
-
node: TreeNode;
|
|
176
|
-
depth: number;
|
|
177
|
-
}>;
|
|
178
|
-
/** Command registry carrying this component's `list.search.*` commands. */
|
|
179
|
-
get registry(): CommandRegistry<unknown> | undefined;
|
|
180
|
-
tickled: TickledController<string>;
|
|
181
|
-
updated(changedProps: PropertyValues): void;
|
|
182
|
-
connectedCallback(): void;
|
|
183
|
-
disconnectedCallback(): void;
|
|
184
|
-
getConfig(): MillerConfig;
|
|
185
|
-
setConfig(config: MillerConfig): void;
|
|
186
|
-
/** Read current selection as an immutable set of item keys. */
|
|
187
|
-
get selectedKeys(): ReadonlySet<string>;
|
|
188
|
-
/** Replace entire selection and trigger a re-render. */
|
|
189
|
-
set selectedKeys(keys: Iterable<string>);
|
|
190
|
-
/** The most recently selected node. */
|
|
191
|
-
get selectedNode(): TreeNode | undefined;
|
|
192
|
-
set selectedNode(node: TreeNode | undefined);
|
|
193
|
-
/** Full selection set (implements TreeComponent interface). */
|
|
194
|
-
get selectedNodes(): ReadonlySet<TreeNode>;
|
|
195
|
-
/** Add `node` to the selection (respects selectionFilter). Dispatches `select` event. */
|
|
196
|
-
select(node: TreeNode): void;
|
|
197
|
-
/** Remove `node` from the selection. Dispatches `select` event. */
|
|
198
|
-
deselect(node: TreeNode): void;
|
|
199
|
-
/**
|
|
200
|
-
* Clear all selection and trigger a re-render.
|
|
201
|
-
*/
|
|
202
|
-
clearSelection(): void;
|
|
203
|
-
/** Not implemented on miller-list. */
|
|
204
|
-
selectAll(): void;
|
|
205
|
-
/** Not implemented on miller-list. */
|
|
206
|
-
deselectAll(): void;
|
|
207
|
-
/**
|
|
208
|
-
* Select or deselect a single node by key.
|
|
209
|
-
* In `checked` interactionMode this also recursively selects/deselects all loaded descendants.
|
|
210
|
-
*/
|
|
211
|
-
setSelected(node: TreeNode, selected: boolean): void;
|
|
212
|
-
/**
|
|
213
|
-
* Return all MillerNodes whose key is in `_selectedKeys`, searching only
|
|
214
|
-
* the currently visible columns.
|
|
215
|
-
*/
|
|
216
|
-
getSelected(): TreeNode[];
|
|
217
|
-
/**
|
|
218
|
-
* Programmatically navigate to a node by key path, relative to the current
|
|
219
|
-
* view root (rebased or full tree).
|
|
220
|
-
*/
|
|
221
|
-
navigateTo(keys: readonly string[], options?: TreeNavigateOptions): boolean;
|
|
222
|
-
/**
|
|
223
|
-
* Re-sync the element with children arrays patched in place (see
|
|
224
|
-
* `MillerTreeController.sync()`): columns whose selected node was removed are
|
|
225
|
-
* closed, selection entries for removed nodes are dropped, then it re-renders.
|
|
226
|
-
*/
|
|
227
|
-
invalidateStructure(): void;
|
|
228
|
-
/**
|
|
229
|
-
* Programmatically navigate to the first node (breadth-first) matching a predicate.
|
|
230
|
-
*/
|
|
231
|
-
navigateToNode(predicate: (node: TreeNode) => boolean): boolean;
|
|
232
|
-
/** Open the columns down to `key` and move the cursor to it, without changing the selection (search "navigate" mode). */
|
|
233
|
-
revealKey(key: string): boolean;
|
|
234
|
-
/** Replace the selection with `nodes` (search "select" mode). */
|
|
235
|
-
selectMany(nodes: Iterable<TreeNode>): void;
|
|
236
|
-
getNodes(): ReadonlyArray<{
|
|
237
|
-
node: TreeNode;
|
|
238
|
-
depth: number;
|
|
239
|
-
}>;
|
|
240
|
-
/**
|
|
241
|
-
* Rebase the view to show `target`'s children in column 0 (Finder column-view
|
|
242
|
-
* behavior on double-click), keeping the full tree in `root`.
|
|
243
|
-
*
|
|
244
|
-
* - Pass a `MillerNode` (used as-is) or a key (looked up in the full tree).
|
|
245
|
-
* - Pass `undefined` to restore the full-tree view.
|
|
246
|
-
* - Rebasing to the true root is equivalent to restoring the full view.
|
|
247
|
-
* - Leaves are refused (returns `false`).
|
|
248
|
-
*
|
|
249
|
-
* Selection is cleared; all depths, headers, and key paths are relative to
|
|
250
|
-
* the new view root. Fires a `rebase` event when the view actually changes.
|
|
251
|
-
* Returns `false` when nothing changed (unknown key, leaf, or same view).
|
|
252
|
-
*/
|
|
253
|
-
rebaseTo(target: TreeNode | string | undefined): boolean;
|
|
254
|
-
/**
|
|
255
|
-
* Rebase one level up from the current view root (no-op at the full tree).
|
|
256
|
-
* Fires a `rebase` event when the view actually changes.
|
|
257
|
-
*/
|
|
258
|
-
rebaseUp(): boolean;
|
|
259
|
-
protected renderColumnContent(nodes: TreeNode[], depth: number): TemplateResult | typeof nothing;
|
|
260
|
-
protected _handleItemClick(node: TreeNode, depth: number, event?: MouseEvent): void;
|
|
261
|
-
/**
|
|
262
|
-
* Called by subclasses (in `checked` interactionMode) when a checkbox is clicked.
|
|
263
|
-
*/
|
|
264
|
-
protected _handleCheckboxClick(event: MouseEvent, node: TreeNode, _depth: number): void;
|
|
265
|
-
/**
|
|
266
|
-
* Called by subclasses when an item is double-clicked.
|
|
267
|
-
*/
|
|
268
|
-
protected _handleItemDblClick(node: TreeNode, depth: number, _event: MouseEvent): void;
|
|
269
|
-
/**
|
|
270
|
-
* Called by subclasses when an item is right-clicked.
|
|
271
|
-
*/
|
|
272
|
-
protected _handleItemRightClick(node: TreeNode, depth: number, event: MouseEvent): void;
|
|
273
|
-
/**
|
|
274
|
-
* Called by subclasses when a column header is right-clicked.
|
|
275
|
-
*/
|
|
276
|
-
protected _handleHeaderRightClick(event: MouseEvent, depth: number): void;
|
|
277
|
-
protected _isSelected(node: TreeNode, depth: number): boolean;
|
|
278
|
-
protected _isOpen(node: TreeNode, depth: number): boolean;
|
|
279
|
-
/**
|
|
280
|
-
* Return the display state for an item identified by key at a given depth.
|
|
281
|
-
*/
|
|
282
|
-
getItemState(key: string, depth: number): MillerItemState | undefined;
|
|
283
|
-
/**
|
|
284
|
-
* Override to provide a custom loading indicator.
|
|
285
|
-
*/
|
|
286
|
-
protected renderLoadingIndicator(): TemplateResult | typeof nothing;
|
|
287
|
-
protected render(): TemplateResult<1>;
|
|
288
|
-
protected _getFocusedIndex(depth: number): number;
|
|
289
|
-
protected _isFocused(node: TreeNode, depth: number): boolean;
|
|
290
|
-
/**
|
|
291
|
-
* Called by subclasses when pointer enters an item.
|
|
292
|
-
* Fires tickle event and switches to mouse mode.
|
|
293
|
-
*/
|
|
294
|
-
protected _handleItemPointerEnter(node: TreeNode, depth: number): void;
|
|
295
|
-
/**
|
|
296
|
-
* Called by subclasses when pointer leaves the column container.
|
|
297
|
-
*/
|
|
298
|
-
protected _handleColumnPointerLeave(): void;
|
|
299
|
-
static styles: import("lit").CSSResult[];
|
|
300
|
-
}
|
|
301
|
-
declare global {
|
|
302
|
-
interface HTMLElementTagNameMap {
|
|
303
|
-
'ixfx-miller-base': MillerBaseElement;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
interface MillerBaseElementEventMap extends TreeComponentEventMap {
|
|
307
|
-
'item-click': TreeItemClickEvent;
|
|
308
|
-
'expand': TreeExpandEvent;
|
|
309
|
-
'collapse': TreeCollapseEvent;
|
|
310
|
-
'select': TreeSelectEvent;
|
|
311
|
-
'tickle': TreeTickleEvent;
|
|
312
|
-
'activate': TreeActivateEvent;
|
|
313
|
-
'item-dblclick': CustomEvent<MillerItemDblClickDetail>;
|
|
314
|
-
'item-rightclick': CustomEvent<MillerItemRightClickDetail>;
|
|
315
|
-
'header-click': CustomEvent<MillerHeaderClickDetail>;
|
|
316
|
-
'header-rightclick': CustomEvent<MillerHeaderRightClickDetail>;
|
|
317
|
-
'rebase': CustomEvent<MillerRebaseDetail>;
|
|
318
|
-
}
|
|
319
|
-
interface MillerBaseElement {
|
|
320
|
-
addEventListener: (<K extends keyof MillerBaseElementEventMap>(type: K, listener: (this: MillerBaseElement, event: MillerBaseElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);
|
|
321
|
-
removeEventListener: (<K extends keyof MillerBaseElementEventMap>(type: K, listener: (this: MillerBaseElement, event: MillerBaseElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void);
|
|
322
|
-
}
|
|
323
|
-
//#endregion
|
|
324
|
-
//#region src/miller/miller-list.d.ts
|
|
325
|
-
/**
|
|
326
|
-
* Miller columns with a vertical list layout — items stack in rows like macOS Finder.
|
|
327
|
-
*
|
|
328
|
-
* Usage:
|
|
329
|
-
* ```html
|
|
330
|
-
* <ixfx-miller-list id="miller"></ixfx-miller-list>
|
|
331
|
-
* <script>
|
|
332
|
-
* const el = document.getElementById('miller');
|
|
333
|
-
* el.root = { item: { key: 'root', label: 'Root' }, children: [...] };
|
|
334
|
-
* el.addEventListener('expand', ({ detail }) => {
|
|
335
|
-
* detail.node.children = fetchChildren(detail.node.item.key);
|
|
336
|
-
* el.requestUpdate();
|
|
337
|
-
* });
|
|
338
|
-
* </script>
|
|
339
|
-
* ```
|
|
340
|
-
*/
|
|
341
|
-
declare class MillerListElement extends MillerBaseElement {
|
|
342
|
-
#private;
|
|
343
|
-
protected renderColumnContent(nodes: TreeNode[], depth: number): TemplateResult;
|
|
344
|
-
static styles: import("lit").CSSResult[];
|
|
345
|
-
}
|
|
346
|
-
declare global {
|
|
347
|
-
interface HTMLElementTagNameMap {
|
|
348
|
-
'ixfx-miller-list': MillerListElement;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
//#endregion
|
|
352
|
-
//#region src/miller/miller-tree-controller.d.ts
|
|
353
|
-
type MillerTreeControllerOptions<T> = {
|
|
354
|
-
/**
|
|
355
|
-
* Convert a tree node's value to a `MillerItem`.
|
|
356
|
-
* You must supply at minimum `key` and `label`.
|
|
357
|
-
* If `isLeaf` is omitted the controller infers it from whether the
|
|
358
|
-
* `TraversableTree` node has any children.
|
|
359
|
-
*/
|
|
360
|
-
valueToItem: (value: T, node: TraversableTree<T>) => TreeItem;
|
|
361
|
-
/**
|
|
362
|
-
* Children loader installed on the element by `connect()`. Defaults to a
|
|
363
|
-
* synchronous read from the source tree. `sync()` never touches it.
|
|
364
|
-
*/
|
|
365
|
-
loadChildren?: LoadChildrenCallback;
|
|
366
|
-
};
|
|
367
|
-
/**
|
|
368
|
-
* Bridges an `ixfx` `TraversableTree<T>` with an `ixfx-miller-*` component.
|
|
369
|
-
*
|
|
370
|
-
* Usage:
|
|
371
|
-
* ```ts
|
|
372
|
-
* import { Trees } from '@ixfx/collections';
|
|
373
|
-
* import { MillerTreeController } from 'ixfx-components/miller';
|
|
374
|
-
*
|
|
375
|
-
* const root = Trees.Mutable.createNode({ key: 'root', label: 'Root' });
|
|
376
|
-
* Trees.Mutable.addValue({ key: 'a', label: 'Alpha' }, root);
|
|
377
|
-
*
|
|
378
|
-
* const ctrl = new MillerTreeController(
|
|
379
|
-
* Trees.Mutable.asDynamicTraversable(root),
|
|
380
|
-
* document.querySelector('ixfx-miller-list'),
|
|
381
|
-
* { valueToItem: v => ({ key: v.key, label: v.label }) }
|
|
382
|
-
* );
|
|
383
|
-
* ctrl.connect();
|
|
384
|
-
* ```
|
|
385
|
-
*
|
|
386
|
-
* Children are populated lazily: the controller provides a `loadChildren`
|
|
387
|
-
* callback that synchronously reads from the underlying tree.
|
|
388
|
-
*
|
|
389
|
-
* Call `disconnect()` to remove all event listeners and release resources.
|
|
390
|
-
*/
|
|
391
|
-
declare class MillerTreeController<T> {
|
|
392
|
-
#private;
|
|
393
|
-
constructor(root: TraversableTree<T>, element: MillerBaseElement, options: MillerTreeControllerOptions<T>);
|
|
394
|
-
/**
|
|
395
|
-
* Wire up the controller: sets `element.root` and provides `loadChildren` callback.
|
|
396
|
-
* Safe to call again after `disconnect()`.
|
|
397
|
-
*/
|
|
398
|
-
connect(): void;
|
|
399
|
-
/** Remove all event listeners and release internal state. */
|
|
400
|
-
disconnect(): void;
|
|
401
|
-
/**
|
|
402
|
-
* Navigate the component to the first node (depth-first) in the ixfx tree
|
|
403
|
-
* whose value satisfies `predicate`.
|
|
404
|
-
*
|
|
405
|
-
* Any ancestor `MillerNode`s with unloaded children are populated
|
|
406
|
-
* synchronously before calling `element.navigateTo()`.
|
|
407
|
-
*
|
|
408
|
-
* Key paths are relative to the element's current view root: when the view
|
|
409
|
-
* is rebased, only matches at or below the view root can be reached.
|
|
410
|
-
*
|
|
411
|
-
* Returns `false` if no matching node is found.
|
|
412
|
-
*/
|
|
413
|
-
navigateToValue(predicate: (value: T) => boolean, options?: TreeNavigateOptions): boolean;
|
|
414
|
-
/**
|
|
415
|
-
* Navigate using item keys **relative to the element's current view root**
|
|
416
|
-
* (the real root when not rebased). Ancestors with unloaded children are
|
|
417
|
-
* populated first. Returns `false` if a key is missing.
|
|
418
|
-
*/
|
|
419
|
-
navigateToKeyPath(keys: readonly string[], options?: TreeNavigateOptions): boolean;
|
|
420
|
-
/**
|
|
421
|
-
* Navigate to the source node with this identity. Returns `false` when it is
|
|
422
|
-
* unknown or lies outside a rebased view (keys are relative to the view root).
|
|
423
|
-
*/
|
|
424
|
-
navigateToIdentity(identity: unknown, options?: TreeNavigateOptions): boolean;
|
|
425
|
-
/** The source node whose item key is `key`, if it has been materialised. */
|
|
426
|
-
lookupByKey(key: string): TraversableTree<T> | undefined;
|
|
427
|
-
/**
|
|
428
|
-
* Re-derive children for every already-materialised node from the source tree
|
|
429
|
-
* and patch them in place. Children arrays are mutated (not replaced) so open
|
|
430
|
-
* columns keep their references, and `MillerNode`s are reused by key so
|
|
431
|
-
* selection survives. A rebased `viewRoot` is reset only if its node was
|
|
432
|
-
* removed. `loadChildren` is left alone. Refreshes the element once.
|
|
433
|
-
*/
|
|
434
|
-
sync(): void;
|
|
435
|
-
}
|
|
436
|
-
//#endregion
|
|
437
|
-
export { type TreeActivateDetail as MillerActivateDetail, type TreeActivateEvent as MillerActivateEvent, MillerBaseElement, MillerBaseElementEventMap, type TreeCollapseDetail as MillerCollapseDetail, type TreeCollapseEvent as MillerCollapseEvent, MillerConfig, type TreeExpandDetail as MillerExpandDetail, type TreeExpandEvent as MillerExpandEvent, MillerHeaderClickDetail, MillerHeaderClickEvent, MillerHeaderRightClickDetail, MillerHeaderRightClickEvent, type TreeItem as MillerItem, type TreeItemClickDetail as MillerItemClickDetail, type TreeItemClickEvent as MillerItemClickEvent, MillerItemDblClickDetail, MillerItemDblClickEvent, MillerItemRightClickDetail, MillerItemRightClickEvent, MillerItemState, MillerListElement, type TreeNode as MillerNode, MillerRebaseDetail, MillerRebaseEvent, type TreeSelectDetail as MillerSelectDetail, type TreeSelectEvent as MillerSelectEvent, MillerSelectionMode, type TreeTickleDetail as MillerTickleDetail, type TreeTickleEvent as MillerTickleEvent, MillerTreeController, MillerTreeControllerOptions };
|
|
1
|
+
import { A as TreeTickleDetail, O as TreeSelectDetail, b as TreeItemClickDetail, i as TreeCollapseEvent, j as TreeTickleEvent, k as TreeSelectEvent, n as TreeActivateEvent, r as TreeCollapseDetail, t as TreeActivateDetail, v as TreeExpandDetail, x as TreeItemClickEvent, y as TreeExpandEvent } from "./tree-component-DgfkxmVY.js";
|
|
2
|
+
import { a as TreeItem, o as TreeNode } from "./types-Jky6oNAp.js";
|
|
3
|
+
import { _ as MillerRebaseEvent, a as MillerBaseElementEventMap, c as MillerHeaderClickEvent, d as MillerItemDblClickDetail, f as MillerItemDblClickEvent, g as MillerRebaseDetail, h as MillerItemState, i as MillerBaseElement, l as MillerHeaderRightClickDetail, m as MillerItemRightClickEvent, n as MillerTreeControllerOptions, o as MillerListViewState, p as MillerItemRightClickDetail, r as MillerListElement, s as MillerHeaderClickDetail, t as MillerTreeController, u as MillerHeaderRightClickEvent, v as MillerSelectionMode } from "./index-Bnm-kKGC.js";
|
|
4
|
+
export { type TreeActivateDetail as MillerActivateDetail, type TreeActivateEvent as MillerActivateEvent, MillerBaseElement, MillerBaseElementEventMap, type TreeCollapseDetail as MillerCollapseDetail, type TreeCollapseEvent as MillerCollapseEvent, type TreeExpandDetail as MillerExpandDetail, type TreeExpandEvent as MillerExpandEvent, MillerHeaderClickDetail, MillerHeaderClickEvent, MillerHeaderRightClickDetail, MillerHeaderRightClickEvent, type TreeItem as MillerItem, type TreeItemClickDetail as MillerItemClickDetail, type TreeItemClickEvent as MillerItemClickEvent, MillerItemDblClickDetail, MillerItemDblClickEvent, MillerItemRightClickDetail, MillerItemRightClickEvent, MillerItemState, MillerListElement, type MillerListViewState, type TreeNode as MillerNode, MillerRebaseDetail, MillerRebaseEvent, type TreeSelectDetail as MillerSelectDetail, type TreeSelectEvent as MillerSelectEvent, MillerSelectionMode, type TreeTickleDetail as MillerTickleDetail, type TreeTickleEvent as MillerTickleEvent, MillerTreeController, MillerTreeControllerOptions };
|