@ixfx/components 0.7.3 → 0.7.5

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.
Files changed (141) hide show
  1. package/bundle/index.d.ts +1355 -526
  2. package/bundle/index.d.ts.map +1 -1
  3. package/bundle/index.js +3277 -384
  4. package/bundle/index.js.map +1 -1
  5. package/dist/ac-text.d.ts +1 -1
  6. package/dist/ac-text.js +1 -1
  7. package/dist/{ac-token-TCLAZeVg.d.ts → ac-token--_vCHXWw.d.ts} +2 -2
  8. package/dist/{ac-token-TCLAZeVg.d.ts.map → ac-token--_vCHXWw.d.ts.map} +1 -1
  9. package/dist/ac-token.d.ts +1 -1
  10. package/dist/ac-token.js +2 -2
  11. package/dist/button.d.ts +1 -1
  12. package/dist/button.d.ts.map +1 -1
  13. package/dist/colour-picker.d.ts +1 -1
  14. package/dist/crumbs.d.ts +6 -2
  15. package/dist/crumbs.d.ts.map +1 -1
  16. package/dist/crumbs.js +13 -3
  17. package/dist/crumbs.js.map +1 -1
  18. package/dist/{data-grid-Db4QpnII.d.ts → data-grid-CtJ35v8L.d.ts} +59 -2
  19. package/dist/data-grid-CtJ35v8L.d.ts.map +1 -0
  20. package/dist/data-grid.d.ts +1 -1
  21. package/dist/data-grid.js +268 -14
  22. package/dist/data-grid.js.map +1 -1
  23. package/dist/detail-list-BS5dRDda.d.ts +175 -0
  24. package/dist/detail-list-BS5dRDda.d.ts.map +1 -0
  25. package/dist/detail-list.d.ts +3 -0
  26. package/dist/detail-list.js +1031 -0
  27. package/dist/detail-list.js.map +1 -0
  28. package/dist/grid-list-D-GbghSH.d.ts +321 -0
  29. package/dist/grid-list-D-GbghSH.d.ts.map +1 -0
  30. package/dist/grid-list.d.ts +3 -0
  31. package/dist/grid-list.js +994 -0
  32. package/dist/grid-list.js.map +1 -0
  33. package/dist/{grouped-item-lister-BWlC9S4e.d.ts → grouped-item-lister-fdZHVxFM.d.ts} +3 -3
  34. package/dist/{grouped-item-lister-BWlC9S4e.d.ts.map → grouped-item-lister-fdZHVxFM.d.ts.map} +1 -1
  35. package/dist/grouped-item-lister.d.ts +1 -1
  36. package/dist/{icon-DR_3rSyZ.d.ts → icon-CDGprSdE.d.ts} +2 -2
  37. package/dist/icon-CDGprSdE.d.ts.map +1 -0
  38. package/dist/icons.d.ts +2 -2
  39. package/dist/incr-search-DpbSJtgj.js +962 -0
  40. package/dist/incr-search-DpbSJtgj.js.map +1 -0
  41. package/dist/incr-search.d.ts +2 -2
  42. package/dist/incr-search.js +2 -3
  43. package/dist/{index-C59-JEPl.d.ts → index-9AhaHIT2.d.ts} +3 -3
  44. package/dist/{index-C59-JEPl.d.ts.map → index-9AhaHIT2.d.ts.map} +1 -1
  45. package/dist/index-CBS4z1v-.d.ts +365 -0
  46. package/dist/index-CBS4z1v-.d.ts.map +1 -0
  47. package/dist/{index-DsjpDksO.d.ts → index-CS9yM8L-.d.ts} +2 -2
  48. package/dist/{index-DsjpDksO.d.ts.map → index-CS9yM8L-.d.ts.map} +1 -1
  49. package/dist/{index-BUB5SICW.d.ts → index-CoqtMSd9.d.ts} +2 -2
  50. package/dist/{index-BUB5SICW.d.ts.map → index-CoqtMSd9.d.ts.map} +1 -1
  51. package/dist/{index-CJ5fshD3.d.ts → index-UvnoZUAo.d.ts} +2 -2
  52. package/dist/{index-CJ5fshD3.d.ts.map → index-UvnoZUAo.d.ts.map} +1 -1
  53. package/dist/{index-BOUaDIW-.d.ts → index-tq6f8007.d.ts} +2 -2
  54. package/dist/{index-BOUaDIW-.d.ts.map → index-tq6f8007.d.ts.map} +1 -1
  55. package/dist/index.d.ts +188 -243
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +376 -1004
  58. package/dist/index.js.map +1 -1
  59. package/dist/interaction-Cr13azbM.js +3 -0
  60. package/dist/{labelled-input-base-Dp_9KP0G.d.ts → labelled-input-base-DiTme1JO.d.ts} +2 -2
  61. package/dist/{labelled-input-base-Dp_9KP0G.d.ts.map → labelled-input-base-DiTme1JO.d.ts.map} +1 -1
  62. package/dist/labelled-radial-input.d.ts +2 -2
  63. package/dist/labelled-radial-input.d.ts.map +1 -1
  64. package/dist/labelled-range-input.d.ts +1 -1
  65. package/dist/labelled-slider-input.d.ts +1 -1
  66. package/dist/list-item-animation-DuiwgN3l.js +112 -0
  67. package/dist/list-item-animation-DuiwgN3l.js.map +1 -0
  68. package/dist/list-selection-controller-DTFI40li.js +264 -0
  69. package/dist/list-selection-controller-DTFI40li.js.map +1 -0
  70. package/dist/{list-selection-types-DSuRNWpx.d.ts → list-selection-types-B5ioL-dG.d.ts} +6 -1
  71. package/dist/list-selection-types-B5ioL-dG.d.ts.map +1 -0
  72. package/dist/{menu-DMzjkVnK.js → menu-Bg90Qr0B.js} +3 -3
  73. package/dist/{menu-DMzjkVnK.js.map → menu-Bg90Qr0B.js.map} +1 -1
  74. package/dist/{menu-item-D2S4i8u1.js → menu-item-Bx-Fs7jq.js} +3 -3
  75. package/dist/{menu-item-D2S4i8u1.js.map → menu-item-Bx-Fs7jq.js.map} +1 -1
  76. package/dist/{menu-item-ZmkXNjek.d.ts → menu-item-CZi9vy5O.d.ts} +2 -2
  77. package/dist/{menu-item-ZmkXNjek.d.ts.map → menu-item-CZi9vy5O.d.ts.map} +1 -1
  78. package/dist/menu.d.ts +2 -2
  79. package/dist/menu.js +2 -2
  80. package/dist/miller.d.ts +82 -4
  81. package/dist/miller.d.ts.map +1 -1
  82. package/dist/miller.js +329 -70
  83. package/dist/miller.js.map +1 -1
  84. package/dist/narrowed-text.js +3 -4
  85. package/dist/narrowed-text.js.map +1 -1
  86. package/dist/panel.d.ts +1 -1
  87. package/dist/plots.js +1 -1
  88. package/dist/select-horiz.js +2 -2
  89. package/dist/{split-layout-C5SYbDrq.d.ts → split-layout-JK3xWVX2.d.ts} +2 -2
  90. package/dist/{split-layout-C5SYbDrq.d.ts.map → split-layout-JK3xWVX2.d.ts.map} +1 -1
  91. package/dist/split-layout.d.ts +1 -1
  92. package/dist/{tab-list-DbMIL520.d.ts → tab-list-CGyPt07Z.d.ts} +2 -2
  93. package/dist/{tab-list-DbMIL520.d.ts.map → tab-list-CGyPt07Z.d.ts.map} +1 -1
  94. package/dist/tabs.d.ts +1 -1
  95. package/dist/{tickled-controller-Ds1DMyG7.d.ts → tickled-controller-Bn3YdQsM.d.ts} +12 -1
  96. package/dist/{tickled-controller-Ds1DMyG7.d.ts.map → tickled-controller-Bn3YdQsM.d.ts.map} +1 -1
  97. package/dist/{tickled-controller-h9GmJ_bU.js → tickled-controller-C66DgJHl.js} +16 -1
  98. package/dist/tickled-controller-C66DgJHl.js.map +1 -0
  99. package/dist/{titlebar-B23MrIbI.d.ts → titlebar-Bj5pfdw_.d.ts} +2 -2
  100. package/dist/{titlebar-B23MrIbI.d.ts.map → titlebar-Bj5pfdw_.d.ts.map} +1 -1
  101. package/dist/titlebar.d.ts +1 -1
  102. package/dist/{tree-Ch4W8qXQ.js → tree-DAii2A1g.js} +190 -29
  103. package/dist/tree-DAii2A1g.js.map +1 -0
  104. package/dist/{tree-component-BvV4muxx.d.ts → tree-component-F6qZ0Gdv.d.ts} +9 -1
  105. package/dist/{tree-component-BvV4muxx.d.ts.map → tree-component-F6qZ0Gdv.d.ts.map} +1 -1
  106. package/dist/tree.d.ts +28 -4
  107. package/dist/tree.d.ts.map +1 -1
  108. package/dist/tree.js +1 -1
  109. package/dist/vertical-list-DwtCPy1b.d.ts +143 -0
  110. package/dist/vertical-list-DwtCPy1b.d.ts.map +1 -0
  111. package/dist/vertical-list.d.ts +3 -121
  112. package/dist/vertical-list.js +642 -1
  113. package/dist/vertical-list.js.map +1 -0
  114. package/dist/{xy-axis-DWizs0bt.js → xy-axis-VrX8dmvS.js} +2 -2
  115. package/dist/{xy-axis-DWizs0bt.js.map → xy-axis-VrX8dmvS.js.map} +1 -1
  116. package/docs-user/README.md +1 -0
  117. package/docs-user/data-grid.md +70 -2
  118. package/docs-user/detail-list.md +39 -1
  119. package/docs-user/grid-list.md +298 -0
  120. package/docs-user/incr-search.md +12 -2
  121. package/docs-user/index.json +7 -2
  122. package/docs-user/llms.txt +1 -0
  123. package/docs-user/tree.md +35 -1
  124. package/docs-user/vertical-list.md +58 -2
  125. package/llms.txt +1 -0
  126. package/package.json +17 -2
  127. package/dist/data-grid-Db4QpnII.d.ts.map +0 -1
  128. package/dist/element-search-Y8SRfPGM.js +0 -185
  129. package/dist/element-search-Y8SRfPGM.js.map +0 -1
  130. package/dist/icon-DR_3rSyZ.d.ts.map +0 -1
  131. package/dist/incr-search-vCzuao-2.js +0 -137
  132. package/dist/incr-search-vCzuao-2.js.map +0 -1
  133. package/dist/index-Cu5i8zZY.d.ts +0 -160
  134. package/dist/index-Cu5i8zZY.d.ts.map +0 -1
  135. package/dist/interaction-D5XdKzbR.js +0 -2
  136. package/dist/list-selection-types-DSuRNWpx.d.ts.map +0 -1
  137. package/dist/tickled-controller-h9GmJ_bU.js.map +0 -1
  138. package/dist/tree-Ch4W8qXQ.js.map +0 -1
  139. package/dist/vertical-list-B4w_ksJk.js +0 -814
  140. package/dist/vertical-list-B4w_ksJk.js.map +0 -1
  141. package/dist/vertical-list.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-DAii2A1g.js","names":["#root","#loadChildren","#cache","#notify","#subscribers","#getAllNodes","#getFocusedIndex","#setFocusedIndex","#extendRangeSelection","#anchor","#toggleExpand","#toggleSelection","#abortPending","#ownedRegistry","#effectiveSearchModes","#unregisterSearchCommands","#diffVisibleNodes","#enteringKeys","#treeAnimReady","#renderedKeys","#leaving","#lastNodeByKey","#leavingAnimating","#matchesFilter","#clearSelectionInternal","#modelUnsubscribe","#runItemAnimations","#syncSearchCommands","#config","#canSelect","#dispatchSelect","#applyCheckedToggle","#applyExclusivity","#scrollKeyIntoView","#findNodePath","#pendingNode","#handleImplicitClick","#handleStandardClick","#handleManualClick","#handleExpandOnly","#getFlatIndexOf","#allDescendantsSelected","#pendingController","#invokeLoadChildren","#collapseSiblingsAtDepth","#findAncestorKeys","#findParent","#getVisibleNodes","#scrollTickledIntoView","#onKeyDown","#onDblClick","#renderNodes","#weaveLeaving","customElement","#detectIcons","#depthsWithIcons","#renderCheckbox","customElement","#root","#element","#options","#connectSignal","#childrenOf","#nodeToTree","#findTreePath","#toTreeNode","#identityToTreeNode"],"sources":["../src/common/tree-data-model.ts","../src/tree/tree-base.ts","../src/tree/tree-list.ts","../src/tree/tree-controller.ts"],"sourcesContent":["import type { LoadChildrenCallback, TreeItem, TreeNode } from './types.js';\nimport { collectDataResult } from './data-provider.js';\n\n// ---------------------------------------------------------------------------\n// Subscription event types (internal — not part of the public API)\n// ---------------------------------------------------------------------------\n\ntype InvalidateEvent = { type: `invalidate`; key: string };\ntype RootEvent = { type: `root`; root: TreeNode };\ntype ModelEvent = InvalidateEvent | RootEvent;\n\ntype ModelSubscriber = (event: ModelEvent) => void;\n\n// ---------------------------------------------------------------------------\n// Pure tree-mutation helpers (functional, produce new roots)\n// ---------------------------------------------------------------------------\n\n// function cloneNode(node: TreeNode): TreeNode {\n// if (node.children === undefined)\n// return { item: { ...node.item } };\n// return { item: { ...node.item }, children: node.children.map(cloneNode) };\n// }\n\nfunction findNode(root: TreeNode, key: string): TreeNode | undefined {\n if (root.item.key === key)\n return root;\n if (!root.children)\n return undefined;\n for (const child of root.children) {\n const found = findNode(child, key);\n if (found)\n return found;\n }\n return undefined;\n}\n\n/** Return a new root with the node at `key` replaced by `replacer(node)`. */\nfunction mapNode(root: TreeNode, key: string, replacer: (n: TreeNode) => TreeNode): TreeNode {\n if (root.item.key === key)\n return replacer(root);\n if (!root.children)\n return root;\n return { item: root.item, children: root.children.map(c => mapNode(c, key, replacer)) };\n}\n\n/** Return a new root with `newChild` appended to the children of the node at `parentKey`. */\nfunction addChildTo(root: TreeNode, parentKey: string, newChild: TreeNode): TreeNode {\n return mapNode(root, parentKey, parent => ({\n item: parent.item,\n children: [...(parent.children ?? []), newChild],\n }));\n}\n\n/** Return a new root with the node at `key` removed (along with all its descendants). */\nfunction removeNodeFrom(root: TreeNode, key: string): TreeNode {\n if (!root.children)\n return root;\n return {\n item: root.item,\n children: root.children\n .filter(c => c.item.key !== key)\n .map(c => removeNodeFrom(c, key)),\n };\n}\n\n/** Return a new root with the node at `key` moved to become a child of `newParentKey`. */\nfunction moveNodeTo(root: TreeNode, key: string, newParentKey: string): TreeNode {\n const target = findNode(root, key);\n if (!target)\n return root;\n const withoutTarget = removeNodeFrom(root, key);\n return addChildTo(withoutTarget, newParentKey, target);\n}\n\n// ---------------------------------------------------------------------------\n// TreeDataModelOptions\n// ---------------------------------------------------------------------------\n\nexport type TreeDataModelOptions = {\n /** The initial root node. Required. */\n root: TreeNode;\n /**\n * Optional callback for lazily loading children.\n * If omitted, nodes with `children === undefined` are treated as empty branches.\n */\n loadChildren?: LoadChildrenCallback;\n};\n\n// ---------------------------------------------------------------------------\n// TreeDataModel\n// ---------------------------------------------------------------------------\n\n/**\n * Manages tree data for tree-like components.\n *\n * Handles two concerns:\n * 1. **Lazy loading** — caches children fetched via `loadChildren` and can invalidate\n * specific branches so they are re-fetched on next expand.\n * 2. **Structural mutations** — convenience methods to add, remove, update, or move\n * nodes. Each mutation produces a new immutable root and notifies connected components.\n *\n * Assign an instance to a component's `model` property instead of setting `root`/`loadChildren`\n * directly. The same model instance can be shared across multiple components.\n *\n * @example\n * ```typescript\n * const model = new TreeDataModel({\n * root: { item: { key: 'root', label: 'Root' }, children: [] },\n * loadChildren: async (node, depth, signal) => fetchChildren(node.item.key),\n * });\n * myTreeList.model = model;\n * myMillerList.model = model;\n *\n * // Later — invalidate a branch to force a re-fetch on next expand:\n * model.invalidate('some-key');\n * ```\n */\nexport class TreeDataModel {\n #root: TreeNode;\n #loadChildren: LoadChildrenCallback | undefined;\n #cache = new Map<string, TreeNode[]>();\n #subscribers = new Set<ModelSubscriber>();\n\n constructor(options: TreeDataModelOptions) {\n this.#root = options.root;\n this.#loadChildren = options.loadChildren;\n }\n\n // ---------------------------------------------------------------------------\n // Root\n // ---------------------------------------------------------------------------\n\n /** The current immutable root snapshot. */\n get root(): TreeNode {\n return this.#root;\n }\n\n /**\n * Replace the entire root with a new immutable snapshot.\n * All cached children are cleared. Connected components re-render.\n */\n setRoot(root: TreeNode): void {\n this.#root = root;\n this.#cache.clear();\n this.#notify({ type: `root`, root });\n }\n\n // ---------------------------------------------------------------------------\n // Child loading\n // ---------------------------------------------------------------------------\n\n /**\n * Returns children for the given node.\n * If children are cached, they are returned immediately (as a resolved Promise).\n * Otherwise the `loadChildren` callback is invoked and the result is cached.\n * If no `loadChildren` is set and no cache entry exists, returns `[]`.\n *\n * Called by components internally — not typically called by application code.\n */\n async getChildren(node: TreeNode, depth: number, signal: AbortSignal): Promise<TreeNode[]> {\n const key = node.item.key;\n if (this.#cache.has(key)) {\n return this.#cache.get(key)!;\n }\n if (!this.#loadChildren) {\n return [];\n }\n const items = await collectDataResult(this.#loadChildren({ node, depth }, signal), signal);\n const children = [...items] as TreeNode[];\n if (!signal.aborted) {\n this.#cache.set(key, children);\n }\n return children;\n }\n\n // ---------------------------------------------------------------------------\n // Cache invalidation\n // ---------------------------------------------------------------------------\n\n /**\n * Clears the cached children for the node with the given key.\n * Connected components will collapse that node (if currently expanded), so that\n * the next expand triggers a fresh `loadChildren` call.\n */\n invalidate(key: string): void {\n this.#cache.delete(key);\n this.#notify({ type: `invalidate`, key });\n }\n\n // ---------------------------------------------------------------------------\n // Convenience mutators\n // ---------------------------------------------------------------------------\n\n /**\n * Adds `node` as a child of the node identified by `parentKey`.\n * Returns the new root (connected components are notified automatically).\n */\n addNode(parentKey: string, node: TreeNode): TreeNode {\n this.#root = addChildTo(this.#root, parentKey, node);\n this.#notify({ type: `root`, root: this.#root });\n return this.#root;\n }\n\n /**\n * Removes the node with the given key and all its descendants.\n * Returns the new root (connected components are notified automatically).\n */\n removeNode(key: string): TreeNode {\n this.#cache.delete(key);\n this.#root = removeNodeFrom(this.#root, key);\n this.#notify({ type: `root`, root: this.#root });\n return this.#root;\n }\n\n /**\n * Applies a partial update to the `item` of the node with the given key.\n * Returns the new root (connected components are notified automatically).\n */\n updateItem(key: string, patch: Partial<TreeItem>): TreeNode {\n this.#root = mapNode(this.#root, key, n => ({\n item: { ...n.item, ...patch },\n children: n.children,\n }));\n this.#notify({ type: `root`, root: this.#root });\n return this.#root;\n }\n\n /**\n * Moves the node with the given key to become a child of `newParentKey`.\n * Returns the new root (connected components are notified automatically).\n */\n moveNode(key: string, newParentKey: string): TreeNode {\n this.#root = moveNodeTo(this.#root, key, newParentKey);\n this.#notify({ type: `root`, root: this.#root });\n return this.#root;\n }\n\n // ---------------------------------------------------------------------------\n // Internal subscription (used by components — not part of the public API)\n // ---------------------------------------------------------------------------\n\n /**\n * Subscribe to model events. Returns an unsubscribe function.\n * Components call this when the `model` property is set, and unsubscribe when it is unset.\n *\n * @internal\n */\n _subscribe(callback: ModelSubscriber): () => void {\n this.#subscribers.add(callback);\n return () => this.#subscribers.delete(callback);\n }\n\n #notify(event: ModelEvent): void {\n for (const sub of this.#subscribers) {\n sub(event);\n }\n }\n}\n","/* eslint-disable ts/no-unsafe-declaration-merging */\nimport type { CommandRegistry } from '@clinth/ui-commands';\nimport type { PropertyValues, TemplateResult } from 'lit';\nimport type { TreeSearchHost } from '../common/searchable.js';\nimport type {\n TreeActivateDetail,\n TreeActivateEvent,\n TreeCollapseDetail,\n TreeCollapseEvent,\n TreeComponent,\n TreeComponentEventMap,\n TreeExpandDetail,\n TreeExpandEvent,\n TreeItemClickDetail,\n TreeItemClickEvent,\n TreeSelectDetail,\n TreeSelectEvent,\n TreeTickleDetail,\n TreeTickleEvent,\n} from '../common/tree-component.js';\nimport type { TreeDataModel } from '../common/tree-data-model.js';\nimport type {\n LoadChildrenCallback,\n TreeExclusivity,\n TreeFilterPredicate,\n TreeInteractionMode,\n TreeNode,\n TreeSelectionFilter,\n} from '../common/types.js';\nimport type { ListSearchMode } from '../incr-search/index.js';\nimport type { TreeConfig } from './types.js';\nimport { createCommandRegistry } from '@clinth/ui-commands';\nimport { css, html, LitElement, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { collectDataResult } from '../common/data-provider.js';\nimport {\n createTreeListSearchAdapter,\n LIST_SEARCH_MODES,\n ListSearchController,\n\n listSearchStyles,\n registerListSearchCommands,\n} from '../incr-search/index.js';\nimport { tickledItemStyles, tickledStyles } from '../interaction/index.js';\nimport { animateListItemIn, animateListItemOut } from '../interaction/list-item-animation.js';\nimport { TickledController } from '../interaction/tickled-controller.js';\nimport { themeFallbacks } from '../styles/fallbacks.js';\nimport { safeCustomElement as customElement } from '../util/custom-elements.js';\n\n/** Above this many rows entering / leaving at once, skip the animation entirely. */\nconst MAX_ANIMATED_ROWS = 50;\n\n@customElement(`ixfx-tree-base`)\nexport class TreeBaseElement extends LitElement implements TreeComponent, TreeSearchHost {\n @property({ type: Object })\n root: TreeNode | undefined;\n\n @property({ attribute: false })\n model: TreeDataModel | undefined;\n\n /** Callback to lazily load children for a node. Superseded by `model` when both are set. */\n @property({ attribute: false })\n loadChildren: LoadChildrenCallback | undefined;\n\n @property({ reflect: true, attribute: `exclusivity` })\n exclusivity: TreeExclusivity = `none`;\n\n @property({ reflect: true, attribute: `selection-filter` })\n selectionFilter: TreeSelectionFilter = `all`;\n\n /** Controls how pointer/keyboard gestures map to selection changes. Default: `'standard'`. */\n @property({ type: String, attribute: `interaction-mode` })\n interactionMode: TreeInteractionMode = `standard`;\n\n @property({ attribute: false })\n selectedNode: TreeNode | undefined;\n\n @state()\n protected _selectedNodes = new Set<TreeNode>();\n\n get selectedNodes(): ReadonlySet<TreeNode> {\n return this._selectedNodes;\n }\n\n @property({ attribute: false })\n filterPredicate: TreeFilterPredicate | undefined;\n\n @property({ type: Boolean, attribute: `disable-keyboard-navigation` })\n disableKeyboardNavigation = false;\n\n @property({ attribute: false })\n registry: CommandRegistry<unknown> | undefined = undefined;\n\n /**\n * Space-separated subset of `navigate select filter` — limits which\n * incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search\n * disabled. See `docs/infra-incremental.md`.\n */\n @property({ type: String, attribute: `search-modes`, reflect: true })\n searchModes: string | undefined;\n\n @state()\n protected _expandedKeys = new Set<string>();\n\n protected tickled = new TickledController<string>(this, {\n getItems: () => {\n const nodes = this.#getAllNodes();\n return nodes.map(({ node }) => ({ id: node.item.key, enabled: true }));\n },\n onStateChange: () => {\n this.setAttribute(`data-input-mode`, this.tickled.inputMode);\n },\n });\n\n @state()\n protected _focusedDepth = 0;\n\n /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */\n readonly search = new ListSearchController<{ node: TreeNode; depth: number }>(this, {\n adapter: createTreeListSearchAdapter(this, {\n labelSelector: `.tree-label`,\n highlightKey: `incr-search-highlight`,\n }),\n });\n\n #unregisterSearchCommands: (() => void) | undefined;\n\n #effectiveSearchModes(): ListSearchMode[] {\n const raw = this.searchModes?.trim();\n if (raw === undefined)\n return [...LIST_SEARCH_MODES];\n const requested = new Set(raw.split(/\\s+/));\n return LIST_SEARCH_MODES.filter(m => requested.has(m));\n }\n\n #syncSearchCommands(): void {\n if (!this.#ownedRegistry)\n return;\n this.search.setModes(this.#effectiveSearchModes());\n this.#unregisterSearchCommands?.();\n this.#unregisterSearchCommands = registerListSearchCommands(this.#ownedRegistry, this.search);\n }\n\n #pendingNode: TreeNode | undefined;\n #pendingController: AbortController | undefined;\n #modelUnsubscribe: (() => void) | undefined;\n // Range-select anchor: the flat-list index and node from which a Shift-range is measured.\n #anchor: { node: TreeNode; flatIndex: number; selectionSnapshot?: ReadonlySet<TreeNode> } | undefined;\n #ownedRegistry: CommandRegistry<unknown> | undefined;\n\n #config: TreeConfig = {\n indent: 20,\n };\n\n // --- Insertion / removal animation ---\n // The visible node list is diffed each update: rows that appear (a branch\n // expanded, a node added to the model) collapse in; rows that disappear (a\n // branch collapsed, a node removed) are kept as fading \"ghost\" rows until\n // their collapse-out finishes. All no-ops under `prefers-reduced-motion`.\n #renderedKeys: string[] = [];\n #lastNodeByKey = new Map<string, { node: TreeNode; depth: number }>();\n #enteringKeys = new Set<string>();\n #leaving = new Map<string, { node: TreeNode; depth: number }>();\n #leavingAnimating = new Set<string>();\n #treeAnimReady = false;\n\n override willUpdate(changedProps: PropertyValues) {\n super.willUpdate(changedProps);\n this.#diffVisibleNodes();\n }\n\n #diffVisibleNodes(): void {\n const nodes = this.root ? this.#getAllNodes() : [];\n const nowKeys = new Set(nodes.map(n => n.node.item.key));\n\n this.#enteringKeys.clear();\n if (this.#treeAnimReady && this.#renderedKeys.length > 0) {\n const prevSet = new Set(this.#renderedKeys);\n for (const { node } of nodes) {\n if (!prevSet.has(node.item.key))\n this.#enteringKeys.add(node.item.key);\n }\n if (this.#enteringKeys.size > MAX_ANIMATED_ROWS)\n this.#enteringKeys.clear();\n\n for (const key of this.#renderedKeys) {\n if (!nowKeys.has(key) && !this.#leaving.has(key)) {\n const last = this.#lastNodeByKey.get(key);\n if (last)\n this.#leaving.set(key, last);\n }\n }\n }\n // A ghost whose key is visible again (re-expanded fast) stops being a ghost.\n for (const key of [...this.#leaving.keys()]) {\n if (nowKeys.has(key)) {\n this.#leaving.delete(key);\n this.#leavingAnimating.delete(key);\n }\n }\n if (this.#leaving.size > MAX_ANIMATED_ROWS) {\n this.#leaving.clear();\n this.#leavingAnimating.clear();\n }\n }\n\n /** True while `node` is a fading ghost row (removed / collapsed, still animating out). */\n protected _isLeaving(node: TreeNode): boolean {\n return this.#leaving.has(node.item.key);\n }\n\n /**\n * True when `filterPredicate` is set and neither `node` nor any descendant\n * matches — the row should carry the `filtered` class (`display: none`).\n */\n protected _isFilteredOut(node: TreeNode, depth: number): boolean {\n return this.filterPredicate !== undefined && !this.#matchesFilter(node, depth);\n }\n\n /** Splice the fading ghost rows back into the visible list near where they were. */\n #weaveLeaving(nodes: Array<{ node: TreeNode; depth: number }>): Array<{ node: TreeNode; depth: number }> {\n if (this.#leaving.size === 0)\n return nodes;\n const result = [...nodes];\n const indexOfKey = (key: string): number => result.findIndex(e => e.node.item.key === key);\n for (const [key, entry] of this.#leaving) {\n const prevIdx = this.#renderedKeys.indexOf(key);\n let insertAt = result.length;\n for (let j = prevIdx + 1; j < this.#renderedKeys.length; j++) {\n const at = indexOfKey(this.#renderedKeys[j]);\n if (at !== -1) {\n insertAt = at;\n break;\n }\n }\n result.splice(insertAt, 0, entry);\n }\n return result;\n }\n\n #runItemAnimations(): void {\n if (this.#enteringKeys.size > 0) {\n for (const el of this.renderRoot.querySelectorAll<HTMLElement>(`.item`)) {\n const key = el.dataset.key;\n if (key !== undefined && this.#enteringKeys.has(key))\n animateListItemIn(el);\n }\n this.#enteringKeys.clear();\n }\n if (this.#leaving.size > 0) {\n for (const el of this.renderRoot.querySelectorAll<HTMLElement>(`.item.leaving`)) {\n const key = el.dataset.key;\n if (key === undefined || this.#leavingAnimating.has(key))\n continue;\n this.#leavingAnimating.add(key);\n void animateListItemOut(el).then(() => {\n this.#leaving.delete(key);\n this.#leavingAnimating.delete(key);\n this.requestUpdate();\n });\n }\n }\n const visible = this.root ? this.#getAllNodes() : [];\n this.#renderedKeys = visible.map(n => n.node.item.key);\n this.#lastNodeByKey.clear();\n for (const entry of visible)\n this.#lastNodeByKey.set(entry.node.item.key, entry);\n this.#treeAnimReady = true;\n }\n\n override updated(changedProps: PropertyValues) {\n if (changedProps.has(`root`) && this.root) {\n this.#abortPending();\n this._expandedKeys.clear();\n this.#clearSelectionInternal();\n this.tickled.clearTickled();\n this._focusedDepth = 0;\n }\n\n if (changedProps.has(`model`)) {\n this.#modelUnsubscribe?.();\n this.#modelUnsubscribe = undefined;\n const model = this.model;\n if (model) {\n this.root = model.root;\n this.#modelUnsubscribe = model._subscribe((event) => {\n if (event.type === `root`) {\n this.root = event.root;\n this.requestUpdate();\n } else if (event.type === `invalidate`) {\n // If the invalidated node is currently expanded, collapse it\n if (this._expandedKeys.has(event.key)) {\n this._expandedKeys.delete(event.key);\n this.requestUpdate();\n }\n }\n });\n }\n }\n\n if (changedProps.has(`interactionMode`)) {\n this.#anchor = undefined;\n this.clearSelection();\n }\n\n // When selectedNode is set externally, sync focus to match\n if (changedProps.has(`selectedNode`) && this.selectedNode) {\n const prev = changedProps.get(`selectedNode`) as TreeNode | undefined;\n if (prev !== this.selectedNode) {\n this.tickled.setTickled(this.selectedNode.item.key);\n }\n }\n\n this.#runItemAnimations();\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute(`data-input-mode`, `mouse`);\n const registry = this.#ownedRegistry = createCommandRegistry();\n registry.register({\n id: `select-all`,\n label: `Select All`,\n description: `Select all visible items`,\n execute: () => this.selectAll(),\n });\n registry.register({\n id: `deselect-all`,\n label: `Deselect All`,\n description: `Clear all selection`,\n execute: () => this.deselectAll(),\n });\n this.registry = registry;\n this.#syncSearchCommands();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.#modelUnsubscribe?.();\n this.#modelUnsubscribe = undefined;\n this.#unregisterSearchCommands?.();\n this.#unregisterSearchCommands = undefined;\n if (this.#ownedRegistry) {\n this.#ownedRegistry.unregister(`select-all`);\n this.#ownedRegistry.unregister(`deselect-all`);\n this.#ownedRegistry = undefined;\n this.registry = undefined;\n }\n }\n\n getConfig(): TreeConfig {\n return { ...this.#config };\n }\n\n setConfig(config: Partial<TreeConfig>) {\n this.#config = { ...this.#config, ...config };\n this.requestUpdate();\n }\n\n // --- Programmatic selection ---\n\n select(node: TreeNode): void {\n if (!this.#canSelect(node))\n return;\n const prev = new Set(this._selectedNodes);\n this._selectedNodes.clear();\n this._selectedNodes.add(node);\n this.selectedNode = node;\n this.#dispatchSelect(prev);\n this.requestUpdate();\n }\n\n deselect(node: TreeNode): void {\n if (!this._selectedNodes.has(node))\n return;\n const prev = new Set(this._selectedNodes);\n this._selectedNodes.delete(node);\n if (this.selectedNode === node) {\n this.selectedNode = [...this._selectedNodes].at(-1);\n }\n this.#dispatchSelect(prev);\n this.requestUpdate();\n }\n\n clearSelection(): void {\n if (this._selectedNodes.size === 0)\n return;\n const prev = new Set(this._selectedNodes);\n this.#clearSelectionInternal();\n this.#dispatchSelect(prev);\n this.requestUpdate();\n }\n\n selectAll(): void {\n const prev = new Set(this._selectedNodes);\n if (this.interactionMode === `checked`) {\n for (const { node } of this.#getAllNodes()) {\n if (!this.#canSelect(node))\n continue;\n this.#applyCheckedToggle(node, true);\n }\n } else {\n for (const { node } of this.#getAllNodes()) {\n if (!this.#canSelect(node))\n continue;\n this._selectedNodes.add(node);\n }\n this.selectedNode = [...this._selectedNodes].at(-1);\n }\n this.#dispatchSelect(prev);\n this.requestUpdate();\n }\n\n deselectAll(): void {\n const prev = new Set(this._selectedNodes);\n if (this.interactionMode === `checked`) {\n for (const { node } of this.#getAllNodes()) {\n if (!this.#canSelect(node))\n continue;\n this.#applyCheckedToggle(node, false);\n }\n } else {\n this.#clearSelectionInternal();\n }\n this.#dispatchSelect(prev);\n this.requestUpdate();\n }\n\n // --- Navigation ---\n\n navigateTo(keys: readonly string[]): boolean {\n if (!this.root?.children)\n return false;\n\n this.#abortPending();\n this.#clearSelectionInternal();\n this.tickled.clearTickled();\n this._focusedDepth = 0;\n\n let currentNode: TreeNode | undefined = this.root;\n\n for (const key of keys) {\n const children: TreeNode[] | undefined = currentNode?.children;\n if (!children)\n return false;\n\n const found: TreeNode | undefined = children.find(n => n.item.key === key);\n if (!found)\n return false;\n\n this.#applyExclusivity(found.item.key);\n this._expandedKeys.add(found.item.key);\n\n if (key === keys.at(-1)) {\n this.select(found);\n this.tickled.setTickled(found.item.key);\n }\n\n currentNode = found;\n }\n\n this.requestUpdate();\n this.#scrollKeyIntoView(keys.at(-1)!);\n return true;\n }\n\n navigateToNode(predicate: (node: TreeNode) => boolean): boolean {\n if (!this.root?.children)\n return false;\n const keyPath = this.#findNodePath(this.root.children, predicate);\n if (!keyPath)\n return false;\n return this.navigateTo(keyPath);\n }\n\n /** Expand ancestors + move the cursor to `key`, without touching the selection (search \"navigate\" mode). */\n revealKey(key: string): boolean {\n if (!this.root?.children)\n return false;\n const path = this.#findNodePath(this.root.children, n => n.item.key === key);\n if (!path)\n return false;\n for (let i = 0; i < path.length - 1; i++) {\n this.#applyExclusivity(path[i]);\n this._expandedKeys.add(path[i]);\n }\n this.tickled.setTickled(key);\n this.requestUpdate();\n void this.updateComplete.then(() => this.#scrollKeyIntoView(key));\n return true;\n }\n\n /** Replace the selection with `nodes` (subject to `selectionFilter`) — search \"select\" mode. */\n selectMany(nodes: Iterable<TreeNode>): void {\n const prev = new Set(this._selectedNodes);\n this._selectedNodes = new Set([...nodes].filter(n => this.#canSelect(n)));\n this.selectedNode = [...this._selectedNodes].at(-1);\n this.#dispatchSelect(prev);\n this.requestUpdate();\n }\n\n getNodes(): ReadonlyArray<{ node: TreeNode; depth: number }> {\n if (!this.root?.children)\n return [];\n const result: Array<{ node: TreeNode; depth: number }> = [];\n const visit = (node: TreeNode, depth: number) => {\n result.push({ node, depth });\n if (node.children) {\n for (const child of node.children) visit(child, depth + 1);\n }\n };\n for (const child of this.root.children) visit(child, 0);\n return result;\n }\n\n // --- Internal helpers ---\n\n #canSelect(node: TreeNode): boolean {\n if (this.selectionFilter === `none`)\n return false;\n if (this.selectionFilter === `leaf`)\n return node.item.isLeaf === true;\n if (this.selectionFilter === `branch`)\n return node.item.isLeaf === false || (node.children !== undefined && node.children.length > 0);\n return true;\n }\n\n #clearSelectionInternal(): void {\n this._selectedNodes.clear();\n this.selectedNode = undefined;\n }\n\n #dispatchSelect(previous: ReadonlySet<TreeNode>): void {\n const detail: TreeSelectDetail = {\n selected: new Set(this._selectedNodes),\n previous,\n };\n this.dispatchEvent(new CustomEvent<TreeSelectDetail>(`select`, {\n detail,\n bubbles: true,\n composed: true,\n }));\n }\n\n #findNodePath(\n nodes: TreeNode[],\n predicate: (node: TreeNode) => boolean,\n prefix: string[] = [],\n ): string[] | undefined {\n for (const node of nodes) {\n const path = [...prefix, node.item.key];\n if (predicate(node))\n return path;\n if (node.children?.length) {\n const result = this.#findNodePath(node.children, predicate, path);\n if (result)\n return result;\n }\n }\n return undefined;\n }\n\n protected renderNodeContent(node: TreeNode, depth: number): TemplateResult | typeof nothing {\n const isBranch = node.item.isLeaf !== true;\n const isExpanded = this._isExpanded(node, depth);\n return html`\n <span class=\"tree-caret\">\n ${isBranch ? html`<ixfx-icon class=\"caret-icon\" name=\"chevron-down\" .rotate=${isExpanded ? nothing : `-90deg`}></ixfx-icon>` : ``}\n </span>\n <span class=\"tree-label\">${node.item.label}</span>\n `;\n }\n\n protected _handleItemClick(node: TreeNode, depth: number, event?: MouseEvent) {\n if (this.#pendingNode && this._expandedKeys.has(this.#pendingNode.item.key)) {\n this.#abortPending();\n }\n\n this.tickled.handlePointerEnter(node.item.key);\n this._focusedDepth = depth;\n\n this.dispatchEvent(new CustomEvent<TreeItemClickDetail>(`item-click`, {\n detail: { node, depth },\n bubbles: true,\n composed: true,\n }));\n\n switch (this.interactionMode) {\n case `implicit`: this.#handleImplicitClick(node, depth); break;\n case `standard`: this.#handleStandardClick(node, depth, event); break;\n case `vscode`: this.#handleStandardClick(node, depth, event); break;\n case `manual`: this.#handleManualClick(node, depth, event); break;\n case `checked`: this.#handleExpandOnly(node, depth); break;\n }\n\n this.requestUpdate();\n }\n\n #handleImplicitClick(node: TreeNode, depth: number): void {\n if (this.#canSelect(node)) {\n const prev = new Set(this._selectedNodes);\n this._selectedNodes.clear();\n this._selectedNodes.add(node);\n this.selectedNode = node;\n if (!prev.has(node) || prev.size !== 1)\n this.#dispatchSelect(prev);\n }\n this.#toggleExpand(node, depth);\n }\n\n #handleStandardClick(node: TreeNode, depth: number, event?: MouseEvent): void {\n const isMeta = event ? (event.metaKey || event.ctrlKey) : false;\n const isShift = event ? event.shiftKey : false;\n\n if (isMeta) {\n if (this.#canSelect(node)) {\n const prev = new Set(this._selectedNodes);\n if (this._selectedNodes.has(node)) {\n this._selectedNodes.delete(node);\n if (this.selectedNode === node)\n this.selectedNode = [...this._selectedNodes].at(-1);\n } else {\n this._selectedNodes.add(node);\n this.selectedNode = node;\n this.#anchor = { node, flatIndex: this.#getFlatIndexOf(node) };\n }\n this.#dispatchSelect(prev);\n }\n return; // no expand on Ctrl+click\n }\n\n if (isShift && this.#anchor) {\n const visible = this.#getAllNodes();\n const anchorIdx = visible.findIndex(n => n.node === this.#anchor!.node);\n const targetIdx = visible.findIndex(n => n.node === node);\n if (anchorIdx >= 0 && targetIdx >= 0) {\n const prev = new Set(this._selectedNodes);\n const from = Math.min(anchorIdx, targetIdx);\n const to = Math.max(anchorIdx, targetIdx);\n const rangeNodes = visible.slice(from, to + 1)\n .map(n => n.node)\n .filter(n => this.#canSelect(n));\n this._selectedNodes = new Set(rangeNodes);\n this.selectedNode = node;\n this.#dispatchSelect(prev);\n }\n return; // no expand on Shift+click\n }\n\n // Plain click: select + toggle expand\n if (this.#canSelect(node)) {\n const prev = new Set(this._selectedNodes);\n this._selectedNodes.clear();\n this._selectedNodes.add(node);\n this.selectedNode = node;\n this.#anchor = { node, flatIndex: this.#getFlatIndexOf(node) };\n if (!prev.has(node) || prev.size !== 1)\n this.#dispatchSelect(prev);\n }\n this.#toggleExpand(node, depth);\n }\n\n #handleExpandOnly(node: TreeNode, depth: number): void {\n this.#toggleExpand(node, depth);\n }\n\n #handleManualClick(node: TreeNode, depth: number, event?: MouseEvent): void {\n const isMeta = event ? (event.metaKey || event.ctrlKey) : false;\n const isShift = event ? event.shiftKey : false;\n\n if (isMeta) {\n if (this.#canSelect(node)) {\n const prev = new Set(this._selectedNodes);\n if (this._selectedNodes.has(node)) {\n this._selectedNodes.delete(node);\n if (this.selectedNode === node)\n this.selectedNode = [...this._selectedNodes].at(-1);\n } else {\n this._selectedNodes.add(node);\n this.selectedNode = node;\n this.#anchor = { node, flatIndex: this.#getFlatIndexOf(node) };\n }\n this.#dispatchSelect(prev);\n }\n return; // no expand on Meta+click\n }\n\n if (isShift && this.#anchor) {\n const visible = this.#getAllNodes();\n const anchorIdx = visible.findIndex(n => n.node === this.#anchor!.node);\n const targetIdx = visible.findIndex(n => n.node === node);\n if (anchorIdx >= 0 && targetIdx >= 0) {\n const prev = new Set(this._selectedNodes);\n const from = Math.min(anchorIdx, targetIdx);\n const to = Math.max(anchorIdx, targetIdx);\n const rangeNodes = visible.slice(from, to + 1)\n .map(n => n.node)\n .filter(n => this.#canSelect(n));\n this._selectedNodes = new Set(rangeNodes);\n this.selectedNode = node;\n this.#dispatchSelect(prev);\n }\n return; // no expand on Shift+click\n }\n\n this.#toggleExpand(node, depth);\n }\n\n #toggleSelection(node: TreeNode, _depth: number): void {\n if (!this.#canSelect(node))\n return;\n const prev = new Set(this._selectedNodes);\n if (this._selectedNodes.has(node)) {\n this._selectedNodes.delete(node);\n if (this.selectedNode === node)\n this.selectedNode = [...this._selectedNodes].at(-1);\n } else {\n this._selectedNodes.add(node);\n this.selectedNode = node;\n this.#anchor = { node, flatIndex: this.#getFlatIndexOf(node) };\n }\n this.#dispatchSelect(prev);\n }\n\n protected _handleCheckboxClick(event: MouseEvent, node: TreeNode, _depth: number): void {\n event.stopPropagation();\n const prev = new Set(this._selectedNodes);\n const allSelected = this.#allDescendantsSelected(node);\n this.#applyCheckedToggle(node, !allSelected);\n if (this.selectedNode === undefined || !this._selectedNodes.has(this.selectedNode)) {\n this.selectedNode = [...this._selectedNodes].at(-1);\n }\n this.#dispatchSelect(prev);\n this.requestUpdate();\n }\n\n #toggleExpand(node: TreeNode, depth: number): void {\n const isExpanded = this._expandedKeys.has(node.item.key);\n if (isExpanded) {\n this._expandedKeys.delete(node.item.key);\n this.dispatchEvent(new CustomEvent<TreeCollapseDetail>(`collapse`, {\n detail: { node, depth },\n bubbles: true,\n composed: true,\n }));\n } else {\n if (node.children === undefined) {\n if (node.item.isLeaf !== false)\n return;\n const loader = this.model ?? (this.loadChildren ? this : undefined);\n if (loader) {\n this.#pendingNode = node;\n const controller = new AbortController();\n this.#pendingController = controller;\n this.#invokeLoadChildren(node, depth, controller).catch(() => {});\n }\n } else {\n this.#applyExclusivity(node.item.key);\n this._expandedKeys.add(node.item.key);\n this.dispatchEvent(new CustomEvent<TreeExpandDetail>(`expand`, {\n detail: { node, depth },\n bubbles: true,\n composed: true,\n }));\n }\n }\n }\n\n #allDescendantsSelected(node: TreeNode): boolean {\n if (!this._selectedNodes.has(node))\n return false;\n if (!node.children?.length)\n return true;\n return node.children.every(child => this.#allDescendantsSelected(child));\n }\n\n #applyCheckedToggle(node: TreeNode, selected: boolean): void {\n if (this.#canSelect(node)) {\n if (selected) {\n this._selectedNodes.add(node);\n } else {\n this._selectedNodes.delete(node);\n }\n }\n if (node.children) {\n for (const child of node.children) {\n this.#applyCheckedToggle(child, selected);\n }\n }\n }\n\n #getFlatIndexOf(node: TreeNode): number {\n return this.#getAllNodes().findIndex(n => n.node === node);\n }\n\n #extendRangeSelection(nodes: Array<{ node: TreeNode; depth: number }>, fromIdx: number, toIdx: number): void {\n // Set anchor at `fromIdx` if not already anchored\n if (!this.#anchor) {\n const anchorNode = nodes[fromIdx]?.node;\n if (anchorNode)\n this.#anchor = { node: anchorNode, flatIndex: fromIdx };\n }\n if (!this.#anchor)\n return;\n\n const anchorIdx = nodes.findIndex(n => n.node === this.#anchor!.node);\n if (anchorIdx < 0)\n return;\n\n const from = Math.min(anchorIdx, toIdx);\n const to = Math.max(anchorIdx, toIdx);\n\n if (this.interactionMode === `vscode`) {\n // On first Shift+arrow: snapshot current selection\n if (!this.#anchor.selectionSnapshot) {\n this.#anchor = { ...this.#anchor, selectionSnapshot: new Set(this._selectedNodes) };\n }\n const snap = this.#anchor.selectionSnapshot!;\n const rangeNodes = nodes.slice(from, to + 1).map(n => n.node).filter(n => this.#canSelect(n));\n // Toggle: items in snapshot stay toggled based on presence in snapshot\n const next = new Set(snap);\n for (const n of rangeNodes) {\n if (snap.has(n))\n next.delete(n);\n else next.add(n);\n }\n const prev = new Set(this._selectedNodes);\n this._selectedNodes = next;\n this.selectedNode = nodes[toIdx]?.node ?? this.selectedNode;\n this.#dispatchSelect(prev);\n } else {\n // standard: range replaces selection\n const prev = new Set(this._selectedNodes);\n const rangeNodes = nodes.slice(from, to + 1).map(n => n.node).filter(n => this.#canSelect(n));\n this._selectedNodes = new Set(rangeNodes);\n this.selectedNode = nodes[toIdx]?.node ?? this.selectedNode;\n this.#dispatchSelect(prev);\n }\n }\n\n async #invokeLoadChildren(node: TreeNode, depth: number, controller: AbortController): Promise<void> {\n try {\n let children: TreeNode[];\n if (this.model) {\n children = await this.model.getChildren(node, depth, controller.signal);\n } else {\n children = [...await collectDataResult(\n this.loadChildren!({ node, depth }, controller.signal),\n controller.signal,\n )];\n }\n if (controller.signal.aborted)\n return;\n node.children = children;\n this.#applyExclusivity(node.item.key);\n this._expandedKeys.add(node.item.key);\n this.#pendingNode = undefined;\n this.#pendingController = undefined;\n this.dispatchEvent(new CustomEvent<TreeExpandDetail>(`expand`, {\n detail: { node, depth },\n bubbles: true,\n composed: true,\n }));\n this.requestUpdate();\n } catch {\n if (controller.signal.aborted)\n return;\n node.children = [];\n this.#pendingNode = undefined;\n this.#pendingController = undefined;\n this.requestUpdate();\n }\n }\n\n protected _isSelected(node: TreeNode): boolean {\n return this._selectedNodes.has(node);\n }\n\n protected _isFocused(node: TreeNode): boolean {\n return this.tickled.isTickled(node.item.key);\n }\n\n protected _isExpanded(node: TreeNode, depth = 0): boolean {\n if (this._expandedKeys.has(node.item.key))\n return true;\n if (this.filterPredicate && node.children) {\n return node.children.some(child => this.#matchesFilter(child, depth + 1));\n }\n return false;\n }\n\n #matchesFilter(node: TreeNode, depth: number): boolean {\n if (!this.filterPredicate)\n return true;\n if (this.filterPredicate(node, depth))\n return true;\n return node.children?.some(child => this.#matchesFilter(child, depth + 1)) ?? false;\n }\n\n protected get _pendingNode(): TreeNode | undefined {\n return this.#pendingNode;\n }\n\n #scrollKeyIntoView(key: string) {\n requestAnimationFrame(() => {\n const el = this.shadowRoot?.querySelector(`[data-key=\"${CSS.escape(key)}\"]`) as HTMLElement | null;\n if (!el)\n return;\n const elRect = el.getBoundingClientRect();\n const hostRect = this.getBoundingClientRect();\n const relativeTop = elRect.top - hostRect.top;\n const relativeBottom = relativeTop + elRect.height;\n if (relativeTop < 0) {\n this.scrollTop += relativeTop;\n } else if (relativeBottom > this.clientHeight) {\n this.scrollTop += relativeBottom - this.clientHeight;\n }\n });\n }\n\n #abortPending() {\n if (this.#pendingController) {\n this.#pendingController.abort();\n this.#pendingController = undefined;\n this.#pendingNode = undefined;\n }\n }\n\n /** Apply exclusivity rules when a node is about to be expanded. */\n #applyExclusivity(expandKey: string): void {\n if (this.exclusivity === `none`)\n return;\n\n if (this.exclusivity === `depth`) {\n this.#collapseSiblingsAtDepth(expandKey);\n } else if (this.exclusivity === `global`) {\n // Collapse all expanded nodes except direct ancestors of the expanding node\n const ancestorKeys = this.#findAncestorKeys(expandKey);\n for (const key of [...this._expandedKeys]) {\n if (!ancestorKeys.has(key) && key !== expandKey) {\n this._expandedKeys.delete(key);\n }\n }\n }\n }\n\n #collapseSiblingsAtDepth(expandKey: string): void {\n if (!this.root)\n return;\n\n const parent = this.#findParent(this.root, expandKey);\n if (!parent?.children)\n return;\n\n for (const child of parent.children) {\n if (child.item.key !== expandKey && this._expandedKeys.has(child.item.key)) {\n this._expandedKeys.delete(child.item.key);\n }\n }\n }\n\n #findAncestorKeys(targetKey: string): Set<string> {\n const keys = new Set<string>();\n const walk = (node: TreeNode): boolean => {\n if (node.item.key === targetKey)\n return true;\n if (!node.children)\n return false;\n for (const child of node.children) {\n if (walk(child)) {\n keys.add(node.item.key);\n return true;\n }\n }\n return false;\n };\n if (this.root)\n walk(this.root);\n return keys;\n }\n\n #findParent(node: TreeNode, targetKey: string, parent: TreeNode | undefined = undefined): TreeNode | undefined {\n if (!node.children)\n return undefined;\n\n for (const child of node.children) {\n if (child.item.key === targetKey) {\n return parent ?? node;\n }\n const found = this.#findParent(child, targetKey, child);\n if (found)\n return found;\n }\n return undefined;\n }\n\n #getVisibleNodes(node: TreeNode, depth: number): Array<{ node: TreeNode; depth: number }> {\n const result: Array<{ node: TreeNode; depth: number }> = [];\n\n const visit = (n: TreeNode, d: number) => {\n result.push({ node: n, depth: d });\n // `_isExpanded` also returns true for branches that have a filter match\n // among their descendants, so filter-search reveals the matches rather\n // than just narrowing the collapsed top level.\n if (n.children && this._isExpanded(n, d)) {\n for (const child of n.children) {\n visit(child, d + 1);\n }\n }\n };\n\n if (node.children) {\n for (const child of node.children) {\n visit(child, depth + 1);\n }\n }\n\n return result;\n }\n\n #getAllNodes(): Array<{ node: TreeNode; depth: number }> {\n if (!this.root)\n return [];\n // Root itself is never rendered — start at -1 so its children are depth 0\n return this.#getVisibleNodes(this.root, -1);\n }\n\n #getFocusedIndex(): number {\n const nodes = this.#getAllNodes();\n const tickledKey = this.tickled.tickledId;\n if (!tickledKey)\n return 0;\n return nodes.findIndex(n => n.node.item.key === tickledKey);\n }\n\n #setFocusedIndex(index: number) {\n const nodes = this.#getAllNodes();\n if (index < 0 || index >= nodes.length)\n return;\n const { node, depth } = nodes[index];\n this.tickled.setTickled(node.item.key);\n this._focusedDepth = depth;\n // Emit tickle for keyboard cursor movement\n this.dispatchEvent(new CustomEvent<TreeTickleDetail>(`tickle`, {\n detail: { node, depth },\n bubbles: true,\n composed: true,\n }));\n this.requestUpdate();\n this.updateComplete.then(() => this.#scrollTickledIntoView());\n }\n\n #scrollTickledIntoView() {\n const tickledKey = this.tickled.tickledId;\n if (tickledKey === undefined)\n return;\n const item = this.shadowRoot?.querySelector(`[data-key=\"${tickledKey}\"]`);\n item?.scrollIntoView({ block: `nearest`, behavior: `smooth` });\n }\n\n #onKeyDown = (event: KeyboardEvent) => {\n if (this.search.isOpen)\n return;\n const nodes = this.#getAllNodes();\n if (nodes.length === 0)\n return;\n\n if ((event.ctrlKey || event.metaKey) && event.key === `a`) {\n event.preventDefault();\n this.selectAll();\n return;\n }\n\n // Switch to keyboard mode for any navigation key\n if ([`ArrowDown`, `ArrowUp`, `ArrowLeft`, `ArrowRight`, `Enter`, ` `].includes(event.key)) {\n this.tickled.setInputMode(`keyboard`);\n }\n\n const currentIdx = this.#getFocusedIndex();\n\n switch (event.key) {\n case `ArrowDown`: {\n event.preventDefault();\n const nextIdx = Math.min(currentIdx + 1, nodes.length - 1);\n if (this.interactionMode === `implicit`) {\n this.select(nodes[nextIdx].node);\n }\n this.#setFocusedIndex(nextIdx);\n if (event.shiftKey && (this.interactionMode === `standard` || this.interactionMode === `vscode`)) {\n this.#extendRangeSelection(nodes, currentIdx, nextIdx);\n } else if (this.interactionMode === `vscode`) {\n this.#anchor = undefined; // clear snapshot on plain navigation\n }\n this.requestUpdate();\n break;\n }\n case `ArrowUp`: {\n event.preventDefault();\n const prevIdx = Math.max(currentIdx - 1, 0);\n if (this.interactionMode === `implicit`) {\n this.select(nodes[prevIdx].node);\n }\n this.#setFocusedIndex(prevIdx);\n if (event.shiftKey && (this.interactionMode === `standard` || this.interactionMode === `vscode`)) {\n this.#extendRangeSelection(nodes, currentIdx, prevIdx);\n } else if (this.interactionMode === `vscode`) {\n this.#anchor = undefined; // clear snapshot on plain navigation\n }\n this.requestUpdate();\n break;\n }\n case `ArrowRight`: {\n event.preventDefault();\n const current = nodes[currentIdx];\n if (current && current.node.item.isLeaf !== true) {\n if (!this._expandedKeys.has(current.node.item.key)) {\n this.#toggleExpand(current.node, current.depth);\n } else if (currentIdx + 1 < nodes.length) {\n this.#setFocusedIndex(currentIdx + 1);\n }\n }\n this.requestUpdate();\n break;\n }\n case `ArrowLeft`: {\n event.preventDefault();\n const current = nodes[currentIdx];\n if (current && this._expandedKeys.has(current.node.item.key)) {\n this._expandedKeys.delete(current.node.item.key);\n this.dispatchEvent(new CustomEvent(`collapse`, {\n detail: { node: current.node, depth: current.depth },\n bubbles: true,\n composed: true,\n }));\n } else if (current.depth > 0) {\n const parentDepth = current.depth - 1;\n for (let i = currentIdx - 1; i >= 0; i--) {\n if (nodes[i].depth === parentDepth) {\n this.#setFocusedIndex(i);\n break;\n }\n }\n }\n this.requestUpdate();\n break;\n }\n case `Enter`: {\n event.preventDefault();\n const current = nodes[currentIdx];\n if (current) {\n if (this.interactionMode !== `manual` && this.interactionMode !== `checked`) {\n this.select(current.node);\n }\n this.dispatchEvent(new CustomEvent<TreeActivateDetail>(`activate`, {\n detail: { node: current.node, depth: current.depth },\n bubbles: true,\n composed: true,\n }));\n this.requestUpdate();\n }\n break;\n }\n case ` `: {\n event.preventDefault();\n const current = nodes[currentIdx];\n if (!current)\n break;\n\n if (this.interactionMode === `checked`) {\n this._handleCheckboxClick(new MouseEvent(`click`), current.node, current.depth);\n } else if (this.interactionMode === `standard` || this.interactionMode === `vscode` || this.interactionMode === `manual`) {\n this.#toggleSelection(current.node, current.depth);\n }\n break;\n }\n case `Escape`: {\n event.preventDefault();\n this.#abortPending();\n break;\n }\n }\n };\n\n protected renderLoadingIndicator(): TemplateResult | typeof nothing {\n return html`<span class=\"loading-spinner\"></span>`;\n }\n\n protected override render() {\n const nodes = this.#getAllNodes();\n\n return html`\n <div\n id=\"container\"\n data-input-mode=${this.tickled.inputMode}\n @keydown=${this.#onKeyDown}\n @dblclick=${this.#onDblClick}\n @pointerleave=${(e: PointerEvent) => this.tickled.handlePointerLeave(e)}\n tabindex=\"0\"\n >\n ${this.root ? this.#renderNodes(nodes) : nothing}\n </div>\n ${this.search.renderField()}\n `;\n }\n\n #onDblClick = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n const li = target.closest(`li`) as HTMLElement | null;\n if (!li)\n return;\n const key = li.dataset.key;\n if (!key)\n return;\n const nodes = this.#getAllNodes();\n const node = nodes.find(n => n.node.item.key === key);\n if (!node)\n return;\n this.dispatchEvent(new CustomEvent<TreeActivateDetail>(`activate`, {\n detail: { node: node.node, depth: node.depth },\n bubbles: true,\n composed: true,\n }));\n };\n\n #renderNodes(nodes: Array<{ node: TreeNode; depth: number }>) {\n if (nodes.length === 0 && this.#pendingNode && this.#leaving.size === 0) {\n return html`\n <div class=\"tree-loading\">\n ${this.renderLoadingIndicator()}\n </div>\n `;\n }\n\n // Keyed by node key so Lit never recycles a <li> across nodes — otherwise a\n // running leave animation (WAAPI, fill:forwards) would land on whatever node\n // reuses that <li> after the list shrinks, squashing it to 0 height.\n return html`\n <ul class=\"tree-list\" role=\"tree\">\n ${repeat(\n this.#weaveLeaving(nodes),\n ({ node }) => node.item.key,\n ({ node, depth }) => this._renderNode(node, depth),\n )}\n </ul>\n `;\n }\n\n protected _renderNode(node: TreeNode, depth: number): TemplateResult {\n const selected = this._isSelected(node);\n const tickled = this._isFocused(node);\n const isBranch = node.item.isLeaf !== true;\n const isExpanded = this._isExpanded(node, depth);\n const isPending = this.#pendingNode === node;\n const isFiltered = this._isFilteredOut(node, depth);\n const isLeaving = this._isLeaving(node);\n\n return html`\n <li\n class=\"item ${selected ? `selected` : ``} ${tickled ? `tickled` : ``} ${isBranch ? `branch` : `leaf`} ${isFiltered ? `filtered` : ``} ${isLeaving ? `leaving` : ``}\"\n role=\"treeitem\"\n aria-selected=${selected}\n aria-expanded=${isBranch ? isExpanded : nothing}\n aria-hidden=${isLeaving ? `true` : nothing}\n aria-level=${depth + 1}\n data-key=${node.item.key}\n style=${`--depth: ${depth}`}\n @click=${(e: MouseEvent) => this._handleItemClick(node, depth, e)}\n @pointerenter=${() => {\n this.tickled.handlePointerEnter(node.item.key);\n this.dispatchEvent(new CustomEvent<TreeTickleDetail>(`tickle`, {\n detail: { node, depth },\n bubbles: true,\n composed: true,\n }));\n }}\n >\n ${this.renderNodeContent(node, depth)}\n ${isPending ? this.renderLoadingIndicator() : nothing}\n </li>\n `;\n }\n\n static override styles = [\n themeFallbacks,\n tickledStyles,\n tickledItemStyles,\n listSearchStyles,\n css`\n :host {\n --tree-bg: var(--surface-3);\n --tree-text: var(--surface-3-text);\n --tree-muted-text: var(--surface-muted-text);\n --tree-indent: 1ch;\n --tree-item-height: 28px;\n --tree-caret-size: 10px;\n --tree-radius: var(--radius-s);\n\n position: relative;\n display: block;\n overflow: hidden;\n box-sizing: border-box;\n background: var(--tree-bg);\n color: var(--tree-text);\n }\n\n /* min-height (not height) so the tree still grows to its content when the\n host has no explicit height; when it does, this fills it and scrolls.\n The scroll lives here, not on :host, so the search popover (a sibling of\n #container, positioned against :host) stays put while the list scrolls. */\n #container {\n outline: none;\n min-height: 100%;\n max-height: 100%;\n overflow: auto;\n }\n\n .tree-list {\n list-style: none;\n margin: 0;\n padding: var(--space-xs);\n }\n\n .item {\n display: flex;\n align-items: center;\n height: var(--tree-item-height);\n padding-left: calc(var(--tree-indent) * var(--depth, 0));\n cursor: pointer;\n user-select: none;\n font-family: var(--font-family);\n font-size: var(--text-m);\n border-radius: var(--tree-radius);\n transition: background var(--transition, 0.15s ease-out);\n margin: 1px 0;\n }\n\n .tree-caret {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--tree-caret-size);\n height: var(--tree-caret-size);\n flex-shrink: 0;\n margin-right: var(--space-xs);\n }\n\n .caret-icon {\n width: var(--tree-caret-size);\n height: var(--tree-caret-size);\n color: var(--tree-muted-text);\n transition: transform var(--transition, 0.15s ease-out);\n }\n\n .item.selected .caret-icon {\n color: var(--accent-text);\n }\n\n .tree-label {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .tree-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--space-m);\n }\n\n .loading-spinner {\n width: 16px;\n height: 16px;\n border: 2px solid var(--surface-5);\n border-top-color: var(--accent);\n border-radius: 50%;\n animation: tree-spin 0.7s linear infinite;\n }\n\n @keyframes tree-spin {\n to { transform: rotate(360deg); }\n }\n\n .item.filtered {\n display: none;\n }\n\n /* Fading-out ghost row (see #runItemAnimations) — inert while it collapses. */\n .item.leaving {\n pointer-events: none;\n overflow: hidden;\n }\n\n ::highlight(incr-search-highlight) {\n background: var(--search-highlight-bg, var(--accent));\n color: var(--search-highlight-color, var(--accent-text, #fff));\n border-radius: 2px;\n padding: 0 1px;\n }\n `,\n ];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ixfx-tree-base': TreeBaseElement;\n }\n}\n\nexport interface TreeBaseElementEventMap extends TreeComponentEventMap {\n 'item-click': TreeItemClickEvent;\n 'expand': TreeExpandEvent;\n 'collapse': TreeCollapseEvent;\n 'select': TreeSelectEvent;\n 'tickle': TreeTickleEvent;\n 'activate': TreeActivateEvent;\n}\n\nexport interface TreeBaseElement {\n addEventListener: (<K extends keyof TreeBaseElementEventMap>(\n type: K,\n listener: (this: TreeBaseElement, event: TreeBaseElementEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions,\n ) => void) & ((\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ) => void);\n removeEventListener: (<K extends keyof TreeBaseElementEventMap>(\n type: K,\n listener: (this: TreeBaseElement, event: TreeBaseElementEventMap[K]) => void,\n options?: boolean | EventListenerOptions,\n ) => void) & ((\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ) => void);\n}\n","/* eslint-disable ts/no-unsafe-declaration-merging */\nimport type { TemplateResult } from 'lit';\nimport type { TreeBaseElementEventMap } from './tree-base.js';\nimport type { TreeNode } from './types.js';\nimport { css, html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { themeFallbacks } from '../styles/fallbacks.js';\nimport { safeCustomElement as customElement } from '../util/custom-elements.js';\nimport { TreeBaseElement } from './tree-base.js';\n\n/** Checkbox tri-state in `checked` interactionMode: a branch node is `indeterminate` when some but not all of its descendants are selected. */\nexport type TreeCheckboxState = `checked` | `unchecked` | `indeterminate`;\n\nfunction computeCheckboxState(node: TreeNode, selectedNodes: ReadonlySet<TreeNode>): TreeCheckboxState {\n if (node.item.isLeaf || !node.children?.length) {\n return selectedNodes.has(node) ? `checked` : `unchecked`;\n }\n const childStates = node.children.map(c => computeCheckboxState(c, selectedNodes));\n const allChecked = childStates.every(s => s === `checked`);\n const allUnchecked = childStates.every(s => s === `unchecked`);\n if (allChecked)\n return `checked`;\n if (allUnchecked)\n return `unchecked`;\n return `indeterminate`;\n}\n\n@customElement(`ixfx-tree-list`)\nexport class TreeListElement extends TreeBaseElement {\n /**\n * Optional renderer for the checkbox shown in `checked` interactionMode.\n * Receives the node's current tri-state (`checked` / `unchecked` / `indeterminate`,\n * the latter when some but not all descendants are selected) and returns a Lit\n * template.\n *\n * When set, the checkbox becomes a `<span role=\"checkbox\">` whose contents are\n * whatever this returns. When unset, a native `<input type=\"checkbox\">` is used.\n *\n * @example\n * list.checkboxRenderer = (state) => state === `unchecked`\n * ? html``\n * : html`<svg viewBox=\"0 0 16 16\" width=\"14\" height=\"14\"\n * fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\n * stroke-linecap=\"round\" stroke-linejoin=\"round\"\n * style=\"opacity:${state === `indeterminate` ? 0.35 : 0.6}\">\n * <polyline points=\"3,8 7,12 13,4\" />\n * </svg>`;\n */\n @property({ attribute: false })\n checkboxRenderer: ((state: TreeCheckboxState) => unknown) | undefined;\n\n #depthsWithIcons = new Set<number>();\n\n protected override render() {\n this.#detectIcons();\n return super.render();\n }\n\n #detectIcons() {\n this.#depthsWithIcons.clear();\n const visit = (node: TreeNode, depth: number) => {\n if (node.item.icon) {\n this.#depthsWithIcons.add(depth);\n }\n if (node.children) {\n for (const child of node.children) {\n visit(child, depth + 1);\n }\n }\n };\n if (this.root) {\n // Root itself is never rendered — start at -1 so its children are depth 0\n visit(this.root, -1);\n }\n }\n\n protected override renderNodeContent(node: TreeNode, depth: number): TemplateResult {\n const isBranch = node.item.isLeaf !== true;\n const isExpanded = this._isExpanded(node, depth);\n const icon = node.item.icon;\n const tooltip = node.item.tooltip;\n\n const caretAndLabel = html`\n <span class=\"tree-caret\">\n ${isBranch ? html`<ixfx-icon class=\"caret-icon\" name=\"chevron-down\" .rotate=${isExpanded ? nothing : `-90deg`}></ixfx-icon>` : ``}\n </span>\n ${icon ? html`<ixfx-icon class=\"tree-icon\" name=\"${icon}\"></ixfx-icon>` : nothing}\n <span class=\"tree-label\">\n ${node.item.label}\n ${tooltip ? html`<ixfx-tooltip class=\"tree-tooltip\" anchor=\"--tooltip-tree-${node.item.key}\" .value=${tooltip}></ixfx-tooltip>` : nothing}\n </span>\n `;\n\n if (this.interactionMode === `checked`) {\n const state = computeCheckboxState(node, this._selectedNodes);\n return html`${this.#renderCheckbox(node, depth, state)}${caretAndLabel}`;\n }\n\n return caretAndLabel;\n }\n\n #renderCheckbox(node: TreeNode, depth: number, state: TreeCheckboxState): TemplateResult {\n const onClick = (e: MouseEvent) => this._handleCheckboxClick(e, node, depth);\n\n if (this.checkboxRenderer) {\n const ariaChecked = state === `indeterminate` ? `mixed` : state === `checked` ? `true` : `false`;\n return html`\n <span\n class=\"tree-checkbox tree-checkbox-custom\"\n part=\"checkbox\"\n role=\"checkbox\"\n tabindex=\"-1\"\n aria-checked=${ariaChecked}\n aria-label=\"Select ${node.item.label}\"\n @click=${onClick}\n >${this.checkboxRenderer(state)}</span>`;\n }\n\n return html`\n <input\n type=\"checkbox\"\n class=\"tree-checkbox\"\n part=\"checkbox\"\n .checked=${state === `checked`}\n .indeterminate=${state === `indeterminate`}\n aria-label=\"Select ${node.item.label}\"\n @click=${onClick}\n />`;\n }\n\n protected override _renderNode(node: TreeNode, depth: number): TemplateResult {\n const selected = this._isSelected(node);\n const tickled = this._isFocused(node);\n const isBranch = node.item.isLeaf !== true;\n const isExpanded = this._isExpanded(node, depth);\n const isPending = this._pendingNode === node;\n const hasIconAtDepth = this.#depthsWithIcons.has(depth);\n const isLeaving = this._isLeaving(node);\n const isFiltered = this._isFilteredOut(node, depth);\n\n return html`\n <li\n class=\"item ${selected ? `selected` : ``} ${tickled ? `tickled` : ``} ${isBranch ? `branch` : `leaf`} ${hasIconAtDepth ? `has-icon-at-depth` : ``} ${isLeaving ? `leaving` : ``} ${isFiltered ? `filtered` : ``}\"\n data-key=${node.item.key}\n role=\"treeitem\"\n aria-selected=${selected}\n aria-expanded=${isBranch ? isExpanded : nothing}\n aria-hidden=${isLeaving ? `true` : nothing}\n aria-level=${depth + 1}\n style=${`--depth: ${depth}`}\n @click=${(e: MouseEvent) => this._handleItemClick(node, depth, e)}\n @pointerenter=${() => this.tickled.handlePointerEnter(node.item.key)}\n >\n ${this.renderNodeContent(node, depth)}\n ${isPending ? this.renderLoadingIndicator() : nothing}\n </li>\n `;\n }\n\n static override styles = [\n themeFallbacks,\n ...TreeBaseElement.styles,\n css`\n .tree-caret {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--tree-caret-size);\n height: var(--tree-caret-size);\n flex-shrink: 0;\n margin-right: var(--space-xs);\n }\n\n .caret-icon {\n width: var(--tree-caret-size);\n height: var(--tree-caret-size);\n color: var(--tree-muted-text);\n transition: transform var(--transition, 0.15s ease-out);\n }\n\n .item.selected .caret-icon {\n color: var(--accent-text);\n }\n\n .tree-icon {\n flex-shrink: 0;\n width: var(--icon-size, 1em);\n height: var(--icon-size, 1em);\n margin-right: var(--icon-spacing, 0.3em);\n }\n\n .item:not(.has-icon-at-depth) .tree-icon {\n display: none;\n }\n\n .item.has-icon-at-depth .tree-label {\n margin-left: var(--icon-size, 1em);\n }\n\n .tree-tooltip {\n position: absolute;\n anchor-name: --tooltip-tree;\n }\n\n .tree-checkbox {\n flex-shrink: 0;\n margin-right: var(--space-xs, 3px);\n cursor: pointer;\n accent-color: var(--accent);\n pointer-events: auto;\n }\n\n .tree-checkbox-custom {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n /* Reserves a click target even when the renderer returns empty content\n (e.g. the \"nothing when unchecked\" subtle style) — without an explicit\n size the empty span collapses to 0×0 and becomes unclickable. */\n width: var(--tree-checkbox-size, 14px);\n height: var(--tree-checkbox-size, 14px);\n }\n\n /* In checked mode the checkbox communicates selection state —\n suppress the row highlight so it doesn't double-signal */\n :host([interaction-mode=\"checked\"]) .item.selected {\n background: transparent;\n color: inherit;\n outline: none;\n }\n\n \n\n .tree-label {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n position: relative;\n }\n `,\n ];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ixfx-tree-list': TreeListElement;\n }\n}\n\nexport interface TreeListElement {\n addEventListener: (<K extends keyof TreeBaseElementEventMap>(\n type: K,\n listener: (this: TreeListElement, event: TreeBaseElementEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions,\n ) => void) & ((\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ) => void);\n}\n","import type { TraversableTree } from '@ixfx/collections';\nimport type { TreeBaseElement } from './tree-base.js';\nimport type { TreeItem, TreeNode } from './types.js';\n\nexport type TreeControllerOptions<T> = {\n valueToItem: (value: T, node: TraversableTree<T>) => TreeItem;\n};\n\nexport class TreeController<T> {\n #root: TraversableTree<T>;\n #element: TreeBaseElement;\n #options: TreeControllerOptions<T>;\n\n #nodeToTree = new WeakMap<TreeNode, TraversableTree<T>>();\n #identityToTreeNode = new Map<unknown, TraversableTree<T>>();\n\n #connectSignal: AbortController | undefined;\n\n constructor(\n root: TraversableTree<T>,\n element: TreeBaseElement,\n options: TreeControllerOptions<T>,\n ) {\n this.#root = root;\n this.#element = element;\n this.#options = options;\n }\n\n connect() {\n this.disconnect();\n this.#connectSignal = new AbortController();\n const { signal } = this.#connectSignal;\n\n const rootValue = this.#root.getValue();\n const rootItem = this.#options.valueToItem(rootValue, this.#root);\n const rootChildren = this.#childrenOf(this.#root);\n\n this.#element.root = { item: rootItem, children: rootChildren };\n\n this.#element.addEventListener(`expand`, (e: Event) => {\n const { node } = (e as CustomEvent<{ node: TreeNode }>).detail;\n const treeNode = this.#nodeToTree.get(node);\n if (!treeNode)\n return;\n node.children = this.#childrenOf(treeNode);\n this.#element.requestUpdate();\n }, { signal });\n\n this.#element.addEventListener(`collapse`, (_e: Event) => {\n }, { signal });\n }\n\n disconnect() {\n this.#connectSignal?.abort();\n this.#connectSignal = undefined;\n }\n\n navigateToValue(predicate: (value: T) => boolean): boolean {\n const treePath = this.#findTreePath(this.#root, predicate);\n if (!treePath)\n return false;\n\n let currentColumn = this.#element.root?.children ?? [];\n const keys: string[] = [];\n\n for (let i = 1; i < treePath.length; i++) {\n const treeNode = treePath[i];\n const key = this.#options.valueToItem(treeNode.getValue(), treeNode).key;\n keys.push(key);\n\n if (i < treePath.length - 1) {\n const node = currentColumn.find(n => n.item.key === key);\n if (!node)\n return false;\n\n if (node.children === undefined) {\n const mapped = this.#nodeToTree.get(node);\n if (mapped)\n node.children = this.#childrenOf(mapped);\n }\n currentColumn = node.children ?? [];\n }\n }\n\n return this.#element.navigateTo(keys);\n }\n\n #childrenOf(treeNode: TraversableTree<T>): TreeNode[] {\n return Array.from(treeNode.children(), child => this.#toTreeNode(child));\n }\n\n #toTreeNode(treeNode: TraversableTree<T>): TreeNode {\n const value = treeNode.getValue();\n const childList = [...treeNode.children()];\n const userItem = this.#options.valueToItem(value, treeNode);\n\n const isLeaf = userItem.isLeaf ?? childList.length === 0;\n\n const treeNodeMap: TreeNode = {\n item: { ...userItem, isLeaf },\n };\n\n this.#nodeToTree.set(treeNodeMap, treeNode);\n this.#identityToTreeNode.set(treeNode.getIdentity(), treeNode);\n return treeNodeMap;\n }\n\n #findTreePath(\n node: TraversableTree<T>,\n predicate: (value: T) => boolean,\n ancestors: Array<TraversableTree<T>> = [],\n ): Array<TraversableTree<T>> | undefined {\n const path = [...ancestors, node];\n if (predicate(node.getValue()))\n return path;\n for (const child of node.children()) {\n const result = this.#findTreePath(child, predicate, path);\n if (result)\n return result;\n }\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAuBA,SAAS,SAAS,MAAgB,KAAmC;CACnE,IAAI,KAAK,KAAK,QAAQ,KACpB,OAAO;CACT,IAAI,CAAC,KAAK,UACR,OAAO,KAAA;CACT,KAAK,MAAM,SAAS,KAAK,UAAU;EACjC,MAAM,QAAQ,SAAS,OAAO,GAAG;EACjC,IAAI,OACF,OAAO;CACX;AAEF;;AAGA,SAAS,QAAQ,MAAgB,KAAa,UAA+C;CAC3F,IAAI,KAA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SAAS,IAAG,UAAS,KAAKM,YAAY,KAAK,CAAC;CACzE;CAEA,YAAY,UAAwC;EAClD,MAAM,QAAQ,SAAS,SAAS;EAChC,MAAM,YAAY,CAAC,GAAG,SAAS,SAAS,CAAC;EACzC,MAAM,WAAW,KAAKL,SAAS,YAAY,OAAO,QAAQ;EAE1D,MAAM,SAAS,SAAS,UAAU,UAAU,WAAW;EAEvD,MAAM,cAAwB,EAC5B,MAAM;GAAE,GAAG;GAAU;EAAO,EAC9B;EAEA,KAAKG,YAAY,IAAI,aAAa,QAAQ;EAC1C,KAAKG,oBAAoB,IAAI,SAAS,YAAY,GAAG,QAAQ;EAC7D,OAAO;CACT;CAEA,cACE,MACA,WACA,YAAuC,CAAC,GACD;EACvC,MAAM,OAAO,CAAC,GAAG,WAAW,IAAI;EAChC,IAAI,UAAU,KAAK,SAAS,CAAC,GAC3B,OAAO;EACT,KAAK,MAAM,SAAS,KAAK,SAAS,GAAG;GACnC,MAAM,SAAS,KAAKF,cAAc,OAAO,WAAW,IAAI;GACxD,IAAI,QACF,OAAO;EACX;CAEF;AACF"}
@@ -249,6 +249,14 @@ interface TreeComponent extends EventTarget {
249
249
  * Returns `true` if a matching node was found.
250
250
  */
251
251
  navigateToNode: (predicate: (node: TreeNode) => boolean) => boolean;
252
+ /**
253
+ * Expand ancestors of the node with `key` and move the keyboard cursor to it,
254
+ * scrolling it into view — **without** changing the selection. Returns `true`
255
+ * if the node was found. Used by incremental-search "navigate" mode.
256
+ */
257
+ revealKey: (key: string) => boolean;
258
+ /** Replace the selection with `nodes` (subject to `selectionFilter`). Used by incremental-search "select" mode. */
259
+ selectMany: (nodes: Iterable<TreeNode>) => void;
252
260
  /**
253
261
  * Returns all nodes currently visible in the rendered output, in render order,
254
262
  * with their depth (0-based, root's children are depth 0).
@@ -272,4 +280,4 @@ interface TreeSearchHost extends TreeComponent {
272
280
  }
273
281
  //#endregion
274
282
  export { TreeDataModelOptions as _, TreeComponent as a, TreeExpandEvent as c, TreeSearchHost as d, TreeSelectDetail as f, TreeDataModel as g, TreeTickleEvent as h, TreeCollapseEvent as i, TreeItemClickDetail as l, TreeTickleDetail as m, TreeActivateEvent as n, TreeComponentEventMap as o, TreeSelectEvent as p, TreeCollapseDetail as r, TreeExpandDetail as s, TreeActivateDetail as t, TreeItemClickEvent as u };
275
- //# sourceMappingURL=tree-component-BvV4muxx.d.ts.map
283
+ //# sourceMappingURL=tree-component-F6qZ0Gdv.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tree-component-BvV4muxx.d.ts","names":[],"sources":["../src/common/tree-data-model.ts","../src/common/tree-component.ts"],"mappings":";;KAOK;EAAoB;EAAoB;;KACxC;EAAc;EAAc,MAAM;;KAClC,aAAa,kBAAkB;KAE/B,mBAAmB,OAAO;KAmEnB;;EAEV,MAAM;;;;;EAKN,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgCJ;;EAMC,YAAA,SAAS;;MAUjB,QAAQ;;;;;EAQZ,QAAQ,MAAM;;;;;;;;;EAkBR,YAAY,MAAM,UAAU,eAAe,QAAQ,cAAc,QAAQ;;;;;;EAyB/E,WAAW;;;;;EAaX,QAAQ,mBAAmB,MAAM,WAAW;;;;;EAU5C,WAAW,cAAc;;;;;EAWzB,WAAW,aAAa,OAAO,QAAQ,YAAY;;;;;EAanD,SAAS,aAAa,uBAAuB;;;;;;;EAgB7C,WAAW,UAAU;;;;;;;;KC/NX;;WAED,UAAU,YAAY;;WAEtB,UAAU,YAAY;;;;;;;KAQrB;WACD,MAAM;WACN;;;;;;KAOC;WACD,MAAM;WACN;;;;;;KAOC;WACD,MAAM;WACN;;;;;;KAOC;WACD,MAAM;WACN;;;;;;KAOC;WACD,MAAM;WACN;;KAIC,kBAAkB,YAAY;KAC9B,kBAAkB,YAAY;KAC9B,oBAAoB,YAAY;KAChC,qBAAqB,YAAY;KACjC,kBAAkB,YAAY;KAC9B,oBAAoB,YAAY;UAM3B;EACf,UAAU;EACV,UAAU;EACV,YAAY;EACZ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AY;KAC9B,oBAAoB,YAAY;KAChC,qBAAqB,YAAY;KACjC,kBAAkB,YAAY;KAC9B,oBAAoB,YAAY;UAM3B;EACf,UAAU;EACV,UAAU;EACV,YAAY;EACZ,cAAc;EACd,UAAU;EACV,YAAY;;;;;;;;;;;;;;;UAoBG,sBAAsB;;;;;;EAQrC,MAAM;;;;;;;EAQN,OAAO;;;;;;EAOP,cAAc;;;;;EAQd,cAAc;;;;;WAML,eAAe,YAAY;;;;;;EASpC,iBAAiB;;;;;;EASjB,iBAAiB;;;;;;EASjB,aAAa;;EAKb,SAAS,MAAM;;EAEf,WAAW,MAAM;;EAEjB;;;;;;EAMA;;EAEA;;;;;EAQA,aAAa;;;;;EAMb,iBAAiB,YAAY,MAAM;;;;;;EAOnC,YAAY;;EAGZ,aAAa,OAAO,SAAS;;;;;EAQ7B,gBAAgB;IAAgB,MAAM;IAAU;;;;;;;;;;;UAejC,uBAAuB;WAC7B,YAAY;WACZ,gBAAgB"}
package/dist/tree.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { a as TreeItem, i as TreeInteractionMode, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-Bc23SI94.js";
2
- import { _ as TreeDataModelOptions, a as TreeComponent, c as TreeExpandEvent, d as TreeSearchHost, f as TreeSelectDetail, g as TreeDataModel, h as TreeTickleEvent, i as TreeCollapseEvent, l as TreeItemClickDetail, m as TreeTickleDetail, n as TreeActivateEvent, o as TreeComponentEventMap, p as TreeSelectEvent, r as TreeCollapseDetail, s as TreeExpandDetail, t as TreeActivateDetail, u as TreeItemClickEvent } from "./tree-component-BvV4muxx.js";
3
- import { n as TickledController } from "./tickled-controller-Ds1DMyG7.js";
2
+ import { _ as TreeDataModelOptions, a as TreeComponent, c as TreeExpandEvent, d as TreeSearchHost, f as TreeSelectDetail, g as TreeDataModel, h as TreeTickleEvent, i as TreeCollapseEvent, l as TreeItemClickDetail, m as TreeTickleDetail, n as TreeActivateEvent, o as TreeComponentEventMap, p as TreeSelectEvent, r as TreeCollapseDetail, s as TreeExpandDetail, t as TreeActivateDetail, u as TreeItemClickEvent } from "./tree-component-F6qZ0Gdv.js";
3
+ import { y as ListSearchController } from "./index-CBS4z1v-.js";
4
+ import { n as TickledController } from "./tickled-controller-Bn3YdQsM.js";
4
5
  import { LitElement, PropertyValues, TemplateResult, nothing } from "lit";
5
6
  import { CommandRegistry } from "@clinth/ui-commands";
6
7
  import { TraversableTree } from "@ixfx/collections";
@@ -27,9 +28,28 @@ declare class TreeBaseElement extends LitElement implements TreeComponent, TreeS
27
28
  filterPredicate: TreeFilterPredicate | undefined;
28
29
  disableKeyboardNavigation: boolean;
29
30
  registry: CommandRegistry<unknown> | undefined;
31
+ /**
32
+ * Space-separated subset of `navigate select filter` — limits which
33
+ * incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search
34
+ * disabled. See `docs/infra-incremental.md`.
35
+ */
36
+ searchModes: string | undefined;
30
37
  protected _expandedKeys: Set<string>;
31
38
  protected tickled: TickledController<string>;
32
39
  protected _focusedDepth: number;
40
+ /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */
41
+ readonly search: ListSearchController<{
42
+ node: TreeNode;
43
+ depth: number;
44
+ }>;
45
+ willUpdate(changedProps: PropertyValues): void;
46
+ /** True while `node` is a fading ghost row (removed / collapsed, still animating out). */
47
+ protected _isLeaving(node: TreeNode): boolean;
48
+ /**
49
+ * True when `filterPredicate` is set and neither `node` nor any descendant
50
+ * matches — the row should carry the `filtered` class (`display: none`).
51
+ */
52
+ protected _isFilteredOut(node: TreeNode, depth: number): boolean;
33
53
  updated(changedProps: PropertyValues): void;
34
54
  connectedCallback(): void;
35
55
  disconnectedCallback(): void;
@@ -42,16 +62,20 @@ declare class TreeBaseElement extends LitElement implements TreeComponent, TreeS
42
62
  deselectAll(): void;
43
63
  navigateTo(keys: readonly string[]): boolean;
44
64
  navigateToNode(predicate: (node: TreeNode) => boolean): boolean;
65
+ /** Expand ancestors + move the cursor to `key`, without touching the selection (search "navigate" mode). */
66
+ revealKey(key: string): boolean;
67
+ /** Replace the selection with `nodes` (subject to `selectionFilter`) — search "select" mode. */
68
+ selectMany(nodes: Iterable<TreeNode>): void;
45
69
  getNodes(): ReadonlyArray<{
46
70
  node: TreeNode;
47
71
  depth: number;
48
72
  }>;
49
- protected renderNodeContent(node: TreeNode, _depth: number): TemplateResult | typeof nothing;
73
+ protected renderNodeContent(node: TreeNode, depth: number): TemplateResult | typeof nothing;
50
74
  protected _handleItemClick(node: TreeNode, depth: number, event?: MouseEvent): void;
51
75
  protected _handleCheckboxClick(event: MouseEvent, node: TreeNode, _depth: number): void;
52
76
  protected _isSelected(node: TreeNode): boolean;
53
77
  protected _isFocused(node: TreeNode): boolean;
54
- protected _isExpanded(node: TreeNode): boolean;
78
+ protected _isExpanded(node: TreeNode, depth?: number): boolean;
55
79
  protected get _pendingNode(): TreeNode | undefined;
56
80
  protected renderLoadingIndicator(): TemplateResult | typeof nothing;
57
81
  protected render(): TemplateResult<1>;
@@ -1 +1 @@
1
- {"version":3,"file":"tree.d.ts","names":[],"sources":["../src/tree/types.ts","../src/tree/tree-base.ts","../src/tree/tree-list.ts","../src/tree/tree-controller.ts"],"mappings":";;;;;;;;KAqCY;EACV;;;;cCEW,wBAAwB,sBAAsB,eAAe;;EAExE,MAAM;EAGN,OAAO;;EAIP,cAAc;EAGd,aAAa;EAGb,iBAAiB;;EAIjB,iBAAiB;EAGjB,cAAc;YAGJ,gBAAc,IAAA;MAEpB,iBAAiB,YAAY;EAKjC,iBAAiB;EAGjB;EAGA,UAAU;YAGA,eAAa;YAEb,SAAO;YAWP;EAaD,QAAQ,cAAc;EA4CtB;EAmBA;EAYT,aAAa;EAIb,UAAU,QAAQ,QAAQ;EAO1B,OAAO,MAAM;EAWb,SAAS,MAAM;EAYf;EASA;EAoBA;EAiBA,WAAW;EAoCX,eAAe,YAAY,MAAM;EASjC,YAAY;IAAgB,MAAM;IA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uBAAuB,gBAAgB,yBACrC,MAAM,GACN,WAAW,MAAM,iBAAiB,OAAO,wBAAwB,aACjE,oBAAoB,mCAEpB,cACA,UAAU,oCACV,oBAAoB;;;;;KCl5CZ;cAiBC,wBAAwB;;;;;;;;;;;;;;;;;;;;;EAqBnC,oBAAoB,OAAO;YAIR,UAAM;YAuBN,kBAAkB,MAAM,UAAU,gBAAgB;YAsDlD,YAAY,MAAM,UAAU,gBAAgB;SA6B/C,sBAAM;;QAqFhB;YACI;IACR,kBAAkB;;;UAIL;EACf,oBAAoB,gBAAgB,yBAClC,MAAM,GACN,WAAW,MAAM,iBAAiB,OAAO,wBAAwB,aACjE,oBAAoB,sCAEpB,cACA,UAAU,oCACV,oBAAoB;;;;KC9PZ,sBAAsB;EAChC,cAAc,OAAO,GAAG,MAAM,gBAAgB,OAAO;;cAG1C,eAAe;;EAWxB,YAAA,MAAM,gBAAgB,IACtB,SAAS,iBACT,SAAS,sBAAsB;EAOjC;EAwBA;EAKA,gBAAgB,YAAY,OAAO"}
package/dist/tree.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as TreeDataModel, n as TreeListElement, r as TreeBaseElement, t as TreeController } from "./tree-Ch4W8qXQ.js";
1
+ import { i as TreeDataModel, n as TreeListElement, r as TreeBaseElement, t as TreeController } from "./tree-DAii2A1g.js";
2
2
  export { TreeBaseElement, TreeController, TreeDataModel, TreeListElement };
@@ -0,0 +1,143 @@
1
+ import { y as ListSearchController } from "./index-CBS4z1v-.js";
2
+ import { i as ListInteractionMode, l as ListSelectionMode, r as ListElementEventMap } from "./list-selection-types-B5ioL-dG.js";
3
+ import { LitElement, PropertyValues } from "lit";
4
+ import { CommandId, CommandRegistry } from "@clinth/ui-commands";
5
+ //#region src/vertical-list/vertical-list.d.ts
6
+ interface CustomCheckboxOptions {
7
+ renderer: (checked: boolean) => unknown;
8
+ margin?: string;
9
+ width?: string;
10
+ }
11
+ interface AddItemOptions {
12
+ /**
13
+ * In `checked` interaction mode, adds the item without a checkbox column and
14
+ * without the ability to be checked/selected. Equivalent to setting the
15
+ * `not-checked` attribute on the item. Ignored outside `checked` mode.
16
+ */
17
+ notChecked?: boolean;
18
+ }
19
+ declare class VerticalListElement extends LitElement {
20
+ #private;
21
+ selectionMode: ListSelectionMode;
22
+ interactionMode: ListInteractionMode;
23
+ filterPredicate: ((el: Element) => boolean) | undefined;
24
+ /**
25
+ * Whether keyboard navigation wraps from last to first and vice versa.
26
+ * - 'stop' (default): navigation stops at the boundary
27
+ * - 'wrap': navigation wraps around
28
+ */
29
+ itemWrap: `stop` | `wrap`;
30
+ /**
31
+ * Optional renderer for the checkbox shown in `checked` interactionMode.
32
+ * Receives the current `checked` state and returns a Lit template result.
33
+ *
34
+ * When set, the per-row checkbox becomes a `<span role="checkbox">` whose
35
+ * contents are whatever this returns (rendered with `lit`'s `render()`).
36
+ * When unset, a native `<input type="checkbox">` is used.
37
+ *
38
+ * @example
39
+ * list.checkboxRenderer = (checked) => checked
40
+ * ? html`<svg viewBox="0 0 16 16" width="14" height="14"
41
+ * fill="none" stroke="currentColor" stroke-width="2"
42
+ * stroke-linecap="round" stroke-linejoin="round"
43
+ * style="opacity:0.5">
44
+ * <polyline points="3,8 7,12 13,4" />
45
+ * </svg>`
46
+ * : html``;
47
+ */
48
+ checkboxRenderer: ((checked: boolean) => unknown) | CustomCheckboxOptions | undefined;
49
+ /**
50
+ * Space-separated subset of `navigate select filter` — limits which
51
+ * incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search
52
+ * disabled. See `docs/infra-incremental.md`.
53
+ */
54
+ searchModes: string | undefined;
55
+ private readonly selection;
56
+ private tickled;
57
+ /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */
58
+ readonly search: ListSearchController<Element>;
59
+ /** Command registry carrying this list's `list.search.*` commands. */
60
+ get registry(): CommandRegistry<unknown> | undefined;
61
+ connectedCallback(): void;
62
+ disconnectedCallback(): void;
63
+ updated(changed: PropertyValues): void;
64
+ /** The most recently selected item, or `undefined` if nothing is selected. */
65
+ get selectedItem(): Element | undefined;
66
+ /** The full current selection set (read-only). */
67
+ get selectedItems(): ReadonlySet<Element>;
68
+ addItem(item: Element | string, options?: AddItemOptions): void;
69
+ /**
70
+ * Collapse + fade `item` out, then detach it. The rows below slide up to
71
+ * close the gap. Resolves once the element has actually been removed.
72
+ * Under `prefers-reduced-motion: reduce` it's removed immediately.
73
+ */
74
+ removeItem(item: Element): Promise<void>;
75
+ /** {@link removeItem} for several items at once. */
76
+ removeItems(items: Iterable<Element>): Promise<void>;
77
+ clearItems(): void;
78
+ /**
79
+ * Replace the entire item list in one call.
80
+ * Equivalent to `clearItems()` followed by `addItem()` for each element.
81
+ * Preserves `interactionMode` checkbox wrapping.
82
+ */
83
+ setItems(items: readonly Element[]): void;
84
+ /**
85
+ * Dispatch a command to this list — used by `ixfx-grouped-item-lister` to
86
+ * forward commands to all sub-components. Routes through the command registry
87
+ * (so `list.search.*` and any other registered commands work).
88
+ */
89
+ dispatch(commandId: CommandId, args?: Record<string, unknown>): void;
90
+ select(item: Element): void;
91
+ selectMany(items: Iterable<Element>): void;
92
+ deselect(item: Element): void;
93
+ clearSelection(): void;
94
+ selectAll(): void;
95
+ /** The selection as stable `data-key` / `data-value` strings. */
96
+ get selectedKeys(): ReadonlySet<string>;
97
+ /** The key of the item under the cursor, or `undefined`. */
98
+ get tickledKey(): string | undefined;
99
+ /** Replace the selection with the items carrying these keys (unknown keys ignored). */
100
+ selectKeys(keys: Iterable<string>): void;
101
+ /** Add items by key to the selection (multi-select modes only). */
102
+ addSelectedKeys(keys: Iterable<string>): void;
103
+ /** Remove items by key from the selection. */
104
+ removeSelectedKeys(keys: Iterable<string>): void;
105
+ /** Move the cursor to the item with this key and scroll it into view. */
106
+ focusKey(key: string): void;
107
+ selectedFilter(kind: `selected` | `checked` | `either`): Generator<Element>;
108
+ private _getVisibleItems;
109
+ private _isCheckable;
110
+ private _syncItemStates;
111
+ private _syncCheckboxes;
112
+ /**
113
+ * Native checkbox cell: a span that stretches to the row's full cross-axis
114
+ * (so the entire column height is a click target) with a real `<input>`
115
+ * centred inside. The span owns the click; the input is purely visual and
116
+ * has `pointer-events:none` so a single click produces one toggle.
117
+ */
118
+ private _createNativeCheckboxCell;
119
+ /**
120
+ * Custom checkbox cell: same shape as the native cell (a stretching span)
121
+ * so behaviour is identical. The renderer's content goes inside.
122
+ */
123
+ private _createCustomCheckbox;
124
+ private _findListItem;
125
+ private _dispatch;
126
+ private _onPointerOver;
127
+ private _onPointerLeave;
128
+ private _onKeyDown;
129
+ private _onClick;
130
+ private _onDblClick;
131
+ private _activateItem;
132
+ static styles: import("lit").CSSResult[];
133
+ render(): import("lit").TemplateResult<1>;
134
+ }
135
+ declare global {
136
+ interface HTMLElementTagNameMap {
137
+ 'ixfx-vertical-list': VerticalListElement;
138
+ }
139
+ interface HTMLElementEventMap extends ListElementEventMap {}
140
+ }
141
+ //#endregion
142
+ export { CustomCheckboxOptions as n, VerticalListElement as r, AddItemOptions as t };
143
+ //# sourceMappingURL=vertical-list-DwtCPy1b.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vertical-list-DwtCPy1b.d.ts","names":[],"sources":["../src/vertical-list/vertical-list.ts"],"mappings":";;;;;UA2CiB;EACf,WAAW;EACX;EACA;;UAGe;;;;;;EAMf;;cAMW,4BAA4B;;EAEvC,eAAe;EAGf,iBAAiB;EAGjB,mBAAmB,IAAI;;;;;;EAQvB;;;;;;;;;;;;;;;;;;;EAqBA,oBAAoB,gCAAgC;;;;;;EAQpD;mBAUiB;UAeT;;WAeC,QAAM,qBAAA;;MAYX,YAAY;EAoBP;EAmBA;EA4CA,QAAQ,SAAS;;MAmCtB,gBAAgB;;MAKhB,iBAAiB,YAAY;EAIjC,QAAQ,MAAM,kBAAkB,UAAU;;;;;;EAqB1C,WAAW,MAAM,UAAU;;EAW3B,YAAY,OAAO,SAAS,WAAW;EAIvC;;;;;;EAYA,SAAS,gBAAgB;;;;;;EAczB,SAAS,WAAW,WAAW,OAAO;EAItC,OAAO,MAAM;EAIb,WAAW,OAAO,SAAS;EAI3B,SAAS,MAAM;EAIf;EAIA;;MAQI,gBAAgB;;MAKhB;;EAMJ,WAAW,MAAM;;EAKjB,gBAAgB,MAAM;;EAKtB,mBAAmB,MAAM;;EAKzB,SAAS;EAkBP,eAAe,0CAA0C,UAAU;UAqB7D;UAgBA;UAOA;UAiBA;;;;;;;UA6FA;;;;;UAuBA;UAcA;UAYA;UAUA;UAMA;UAIA;UAwDA;UAQA;UAMA;SAUQ,sBAAM;EA+Hb,wBAAM;;QAYT;YACI;IACR,sBAAsB;;YAGd,4BAA4B"}
@@ -1,121 +1,3 @@
1
- import { a as ListItemClickDetail, c as ListSelectEvent, d as ListTickleEvent, i as ListInteractionMode, l as ListSelectionMode, n as ListActivateEvent, o as ListItemClickEvent, r as ListElementEventMap, s as ListSelectDetail, t as ListActivateDetail, u as ListTickleDetail } from "./list-selection-types-DSuRNWpx.js";
2
- import { LitElement, PropertyValues } from "lit";
3
- import { CommandId } from "@clinth/ui-commands";
4
- //#region src/vertical-list/vertical-list.d.ts
5
- interface CustomCheckboxOptions {
6
- renderer: (checked: boolean) => unknown;
7
- margin?: string;
8
- width?: string;
9
- }
10
- interface AddItemOptions {
11
- /**
12
- * In `checked` interaction mode, adds the item without a checkbox column and
13
- * without the ability to be checked/selected. Equivalent to setting the
14
- * `not-checked` attribute on the item. Ignored outside `checked` mode.
15
- */
16
- notChecked?: boolean;
17
- }
18
- declare class VerticalListElement extends LitElement {
19
- #private;
20
- selectionMode: ListSelectionMode;
21
- interactionMode: ListInteractionMode;
22
- filterPredicate: ((el: Element) => boolean) | undefined;
23
- /**
24
- * Whether keyboard navigation wraps from last to first and vice versa.
25
- * - 'stop' (default): navigation stops at the boundary
26
- * - 'wrap': navigation wraps around
27
- */
28
- itemWrap: `stop` | `wrap`;
29
- /**
30
- * Optional renderer for the checkbox shown in `checked` interactionMode.
31
- * Receives the current `checked` state and returns a Lit template result.
32
- *
33
- * When set, the per-row checkbox becomes a `<span role="checkbox">` whose
34
- * contents are whatever this returns (rendered with `lit`'s `render()`).
35
- * When unset, a native `<input type="checkbox">` is used.
36
- *
37
- * @example
38
- * list.checkboxRenderer = (checked) => checked
39
- * ? html`<svg viewBox="0 0 16 16" width="14" height="14"
40
- * fill="none" stroke="currentColor" stroke-width="2"
41
- * stroke-linecap="round" stroke-linejoin="round"
42
- * style="opacity:0.5">
43
- * <polyline points="3,8 7,12 13,4" />
44
- * </svg>`
45
- * : html``;
46
- */
47
- checkboxRenderer: ((checked: boolean) => unknown) | CustomCheckboxOptions | undefined;
48
- private _searchVisible;
49
- private _searchQuery;
50
- private _searchInputEl;
51
- private readonly selection;
52
- private tickled;
53
- connectedCallback(): void;
54
- disconnectedCallback(): void;
55
- firstUpdated(): void;
56
- updated(changed: PropertyValues): void;
57
- /** The most recently selected item, or `undefined` if nothing is selected. */
58
- get selectedItem(): Element | undefined;
59
- /** The full current selection set (read-only). */
60
- get selectedItems(): ReadonlySet<Element>;
61
- addItem(item: Element | string, options?: AddItemOptions): void;
62
- removeItem(item: Element): void;
63
- clearItems(): void;
64
- /**
65
- * Replace the entire item list in one call.
66
- * Equivalent to `clearItems()` followed by `addItem()` for each element.
67
- * Preserves `interactionMode` checkbox wrapping.
68
- */
69
- setItems(items: readonly Element[]): void;
70
- /**
71
- * Dispatch a command to this list. No-op by default.
72
- * Intended for use with `ixfx-grouped-item-lister`'s `dispatch()` method,
73
- * which forwards commands to all sub-components.
74
- */
75
- dispatch(_commandId: CommandId, _args?: Record<string, unknown>): void;
76
- select(item: Element): void;
77
- selectMany(items: Iterable<Element>): void;
78
- deselect(item: Element): void;
79
- clearSelection(): void;
80
- selectAll(): void;
81
- selectedFilter(kind: `selected` | `checked` | `either`): Generator<Element>;
82
- private _getVisibleItems;
83
- private _isCheckable;
84
- private _syncItemStates;
85
- private _syncCheckboxes;
86
- /**
87
- * Native checkbox cell: a span that stretches to the row's full cross-axis
88
- * (so the entire column height is a click target) with a real `<input>`
89
- * centred inside. The span owns the click; the input is purely visual and
90
- * has `pointer-events:none` so a single click produces one toggle.
91
- */
92
- private _createNativeCheckboxCell;
93
- /**
94
- * Custom checkbox cell: same shape as the native cell (a stretching span)
95
- * so behaviour is identical. The renderer's content goes inside.
96
- */
97
- private _createCustomCheckbox;
98
- private _findListItem;
99
- private _dispatch;
100
- private _openSearch;
101
- private _closeSearch;
102
- private _onPointerOver;
103
- private _onPointerLeave;
104
- private _onKeyDown;
105
- private _onClick;
106
- private _onDblClick;
107
- private _activateItem;
108
- private _onSearchInput;
109
- private _onSearchKeydown;
110
- static styles: import("lit").CSSResult[];
111
- render(): import("lit").TemplateResult<1>;
112
- }
113
- declare global {
114
- interface HTMLElementTagNameMap {
115
- 'ixfx-vertical-list': VerticalListElement;
116
- }
117
- interface HTMLElementEventMap extends ListElementEventMap {}
118
- }
119
- //#endregion
120
- export { AddItemOptions, CustomCheckboxOptions, type ListActivateDetail, type ListActivateEvent, type ListElementEventMap, type ListInteractionMode, type ListItemClickDetail, type ListItemClickEvent, type ListSelectDetail, type ListSelectEvent, type ListSelectionMode, type ListTickleDetail, type ListTickleEvent, VerticalListElement };
121
- //# sourceMappingURL=vertical-list.d.ts.map
1
+ import { a as ListItemClickDetail, c as ListSelectEvent, d as ListTickleEvent, i as ListInteractionMode, l as ListSelectionMode, n as ListActivateEvent, o as ListItemClickEvent, r as ListElementEventMap, s as ListSelectDetail, t as ListActivateDetail, u as ListTickleDetail } from "./list-selection-types-B5ioL-dG.js";
2
+ import { n as CustomCheckboxOptions, r as VerticalListElement, t as AddItemOptions } from "./vertical-list-DwtCPy1b.js";
3
+ export { AddItemOptions, CustomCheckboxOptions, type ListActivateDetail, type ListActivateEvent, type ListElementEventMap, type ListInteractionMode, type ListItemClickDetail, type ListItemClickEvent, type ListSelectDetail, type ListSelectEvent, type ListSelectionMode, type ListTickleDetail, type ListTickleEvent, VerticalListElement };