@ixfx/components 0.13.5 → 0.13.7
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 +65 -5
- package/bundle/index.js +237 -237
- package/dist/crumbs.d.ts +1 -1
- package/dist/{data-grid-BtBZt8M1.d.ts → data-grid-D7RxYISt.d.ts} +2 -2
- package/dist/data-grid.d.ts +2 -2
- package/dist/{detail-list-u2rWnAXQ.d.ts → detail-list-w32XZEgH.d.ts} +3 -3
- package/dist/detail-list.d.ts +3 -3
- package/dist/{flat-list-DNnTQ65v.d.ts → flat-list-CkRIZCuR.d.ts} +2 -2
- package/dist/flat-list.d.ts +1 -1
- package/dist/{grid-list-BLnV9oZE.d.ts → grid-list-DUvhSoT2.d.ts} +3 -3
- package/dist/grid-list.d.ts +2 -2
- package/dist/incr-search.d.ts +1 -1
- package/dist/{index-CCC0G1nO.d.ts → index-BG8E13J5.d.ts} +18 -5
- package/dist/{index-BYIRgv49.d.ts → index-CO6m-YC0.d.ts} +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.js +8 -1
- package/dist/{list-native-drag-controller-ChIi3eK5.d.ts → list-native-drag-controller-CvXN3NB7.d.ts} +1 -1
- package/dist/miller.d.ts +36 -4
- package/dist/miller.js +183 -39
- package/dist/{tree-Df00opxv.js → tree-BjrfaX7d.js} +140 -42
- package/dist/{tree-component-Cj8V3uar.d.ts → tree-component-Tslymyyl.d.ts} +14 -1
- package/dist/tree.d.ts +3 -3
- package/dist/tree.js +1 -1
- package/dist/{vertical-list-m7GJtXwv.d.ts → vertical-list-B1Fq06xr.d.ts} +2 -2
- package/dist/vertical-list.d.ts +2 -2
- package/docs-user/index.json +2 -2
- package/docs-user/miller.md +21 -1
- package/docs-user/tree.md +4 -2
- package/package.json +1 -1
package/docs-user/index.json
CHANGED
package/docs-user/miller.md
CHANGED
|
@@ -54,7 +54,11 @@ Inherited from theme:
|
|
|
54
54
|
// Navigate to a node by key path (root-to-target keys, excluding root itself).
|
|
55
55
|
// Only works with already-loaded children — returns false if any node along
|
|
56
56
|
// the path has unloaded children or if a key is not found.
|
|
57
|
-
navigateTo(keys: readonly string[]): boolean
|
|
57
|
+
navigateTo(keys: readonly string[], options?: { reveal?: 'edge' | 'center-if-hidden'; silent?: boolean }): boolean
|
|
58
|
+
|
|
59
|
+
// Re-sync after children arrays were patched in place (used by MillerTreeController.sync()):
|
|
60
|
+
// closes columns whose selected node was removed, then re-renders.
|
|
61
|
+
invalidateStructure(): void
|
|
58
62
|
|
|
59
63
|
// Navigate to the first loaded node (breadth-first) matching a predicate.
|
|
60
64
|
// Returns false if no match is found in the currently loaded tree.
|
|
@@ -398,11 +402,27 @@ type MillerTreeControllerOptions<T> = {
|
|
|
398
402
|
// key and label are required. If isLeaf is omitted, it is inferred
|
|
399
403
|
// from whether the TraversableTree node has any children.
|
|
400
404
|
valueToItem: (value: T, node: TraversableTree<T>) => MillerItem;
|
|
405
|
+
// Installed as element.loadChildren by connect(). Defaults to a synchronous
|
|
406
|
+
// read from the source tree. sync() never touches it.
|
|
407
|
+
loadChildren?: LoadChildrenCallback;
|
|
401
408
|
};
|
|
402
409
|
```
|
|
403
410
|
|
|
404
411
|
### Methods
|
|
405
412
|
|
|
413
|
+
```typescript
|
|
414
|
+
// Re-derive children of already-loaded nodes from the source tree and patch them
|
|
415
|
+
// in place (arrays mutated, MillerNodes reused by key). viewRoot is reset only if
|
|
416
|
+
// its node was removed. Refreshes the element once.
|
|
417
|
+
sync(): void
|
|
418
|
+
|
|
419
|
+
// Lookups that avoid searching the source tree. Key paths are RELATIVE TO THE
|
|
420
|
+
// VIEW ROOT; identities outside a rebased view return false.
|
|
421
|
+
lookupByKey(key: string): TraversableTree<T> | undefined
|
|
422
|
+
navigateToKeyPath(keys: readonly string[], options?: TreeNavigateOptions): boolean
|
|
423
|
+
navigateToIdentity(identity: unknown, options?: TreeNavigateOptions): boolean
|
|
424
|
+
```
|
|
425
|
+
|
|
406
426
|
```typescript
|
|
407
427
|
// Wire up the controller — sets element.root and provides loadChildren callback.
|
|
408
428
|
// Safe to call again after disconnect().
|
package/docs-user/tree.md
CHANGED
|
@@ -46,6 +46,8 @@ type TreeNode = {
|
|
|
46
46
|
|
|
47
47
|
`TreeNode` is **immutable** — structural changes always produce a new root. Never mutate a node in place; use `TreeDataModel` convenience methods or replace `root` directly.
|
|
48
48
|
|
|
49
|
+
**Incremental updates.** `TreeController.sync()` re-derives children of already-materialised nodes from the source tree and patches them in place (nodes are reused by key, so expansion and selection survive). `navigateToKeyPath(keys)`, `navigateToIdentity(id)` and `lookupByKey(key)` resolve targets without searching the source tree.
|
|
50
|
+
|
|
49
51
|
**Escape hatch for in-place edits.** The component itself fills in `node.children` when lazy-loading, and `TreeController` does the same. If you must edit `node.children` or `node.item` (e.g. an icon) in place, call `el.invalidateStructure()` afterwards. It drops the cached whole-tree indexes (parent map, icon depths, filter matches, checkbox states) and re-renders. Visible rows are re-derived on every update, so ordinary expand / collapse never needs it.
|
|
50
52
|
|
|
51
53
|
---
|
|
@@ -248,7 +250,7 @@ they do without windowing and cover rows that are not rendered:
|
|
|
248
250
|
is never missing.
|
|
249
251
|
- **Incremental search**: `navigate`, `select` and `filter` modes search the whole tree.
|
|
250
252
|
Match highlights are repainted as the window moves.
|
|
251
|
-
- **`navigateTo` / `revealKey`**: expand ancestors and scroll to the row.
|
|
253
|
+
- **`navigateTo` / `revealKey`**: expand ancestors and scroll to the row. `navigateTo(keys, { reveal: 'center-if-hidden' })` centres the row only when it is off screen (arithmetic, no DOM measuring); `{ silent: true }` suppresses the `select` event. Otherwise `select` detail carries `origin: 'user' | 'programmatic'`.
|
|
252
254
|
- **Drag and drop**: drop targets are computed from the layout, so auto-scroll while dragging works.
|
|
253
255
|
- **Sticky headers**: found by arithmetic, with no per-row measuring.
|
|
254
256
|
|
|
@@ -817,7 +819,7 @@ interface TreeComponent extends EventTarget {
|
|
|
817
819
|
select(node: TreeNode): void;
|
|
818
820
|
deselect(node: TreeNode): void;
|
|
819
821
|
clearSelection(): void;
|
|
820
|
-
navigateTo(keys: readonly string[]): boolean;
|
|
822
|
+
navigateTo(keys: readonly string[], options?: { reveal?: 'edge' | 'center-if-hidden'; silent?: boolean }): boolean;
|
|
821
823
|
navigateToNode(predicate: (node: TreeNode) => boolean): boolean;
|
|
822
824
|
getNodes(): ReadonlyArray<{ node: TreeNode; depth: number }>;
|
|
823
825
|
}
|