@cas-smartdesign/tree 4.0.3

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree.mjs","sources":["../src/constants.ts","../src/node.ts","../src/checkbox-node.ts","../src/radio-button-node.ts","../src/tree-node.ts","../src/loading-indicator.ts","../src/utils.ts","../src/tree.ts"],"sourcesContent":["export const NODE_MARGIN_LEFT = 16;\nexport const NODE_HEIGHT = 35;\n","import { NodeType, NodeSelectionState } from \"./types\";\nimport { CheckboxNode } from \"./checkbox-node\";\nimport { RadioButtonNode } from \"./radio-button-node\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype NodeGetter = (path: string[]) => Node;\n\ninterface IParent {\n nodes: Node[];\n childCount: number;\n expanded: boolean;\n childrenType: NodeType;\n}\n\nabstract class Node implements IParent {\n public type: NodeType;\n public depth = 0;\n public selectionState: NodeSelectionState = \"unchecked\";\n public childCount: number;\n public expanded = false;\n public childrenType: NodeType;\n public parentSelectionAllowed = false;\n public lastLoadingChild = false;\n public loading = false;\n public disabled = false;\n public nodeGetter: NodeGetter;\n public getSiblings: () => Node[];\n\n private parent: string[] = [];\n\n constructor(\n public id: string,\n public text: string,\n public path: string[],\n public nodes: Node[],\n ) {\n if (path) {\n this.depth = path.length - 1;\n this.parent = path.slice(0, -1);\n } else {\n this.path = [id];\n }\n this.childCount = nodes ? nodes.length : 0;\n }\n\n public abstract toggle(): void;\n\n // updates this node, its parent and children recursively\n public abstract updateBranch(): void;\n\n // updates the selection state of this node according to the state of its children\n public abstract updateSelectionStateByChildren(): void;\n\n public updateSelectionStateOfChildren(): void {\n this.nodes.forEach((child) => {\n if (this.selectionState === \"checked\") {\n if (child.childrenType === \"radio\" || isRadioButtonNode(child)) {\n return;\n }\n child.selectionState = \"checked\";\n } else if (this.selectionState === \"unchecked\") {\n child.selectionState = \"unchecked\";\n }\n child.updateSelectionStateOfChildren();\n });\n }\n\n public updateParent(): Node {\n const parent = this.parentNode;\n\n if (parent) {\n if (!this.parentSelectionAllowed || this.selectionState !== \"unchecked\" || parent.disabled) {\n parent.updateSelectionStateByChildren();\n parent.updateParent();\n }\n }\n return parent;\n }\n\n public get parentNode(): Node | null {\n return this.parent.length ? this.nodeGetter(this.parent) : null;\n }\n\n public check(): void {\n if (this.selectionState !== \"checked\") {\n this.selectionState = \"checked\";\n this.updateBranch();\n }\n }\n\n public uncheck(): void {\n if (this.selectionState !== \"unchecked\") {\n this.selectionState = \"unchecked\";\n this.updateBranch();\n }\n }\n\n public hasRadioButtonDescendant(): boolean {\n if (this.childrenType === \"radio\") {\n return true;\n }\n\n for (const child of this.nodes) {\n const hasRadioButtonChildren = child.hasRadioButtonDescendant();\n if (hasRadioButtonChildren) {\n return true;\n }\n }\n }\n}\n\nconst isCheckboxNode = (node: Node): node is CheckboxNode => {\n return node?.type === \"checkbox\";\n};\n\nconst isRadioButtonNode = (node: Node): node is RadioButtonNode => {\n return node?.type === \"radio\";\n};\n\nexport { Node, isCheckboxNode, isRadioButtonNode };\nexport type { NodeGetter, IParent };\n","import { Node, isCheckboxNode } from \"./node\";\n\nclass CheckboxNode extends Node {\n constructor(id: string, text: string, path: string[], nodes: Node[]) {\n super(id, text, path, nodes);\n this.type = \"checkbox\";\n }\n\n public toggle(): void {\n if (this.selectionState === \"checked\") {\n this.selectionState = \"unchecked\";\n } else {\n this.selectionState = \"checked\";\n }\n this.updateBranch();\n }\n\n public updateBranch(): void {\n if (!this.parentSelectionAllowed || this.selectionState === \"unchecked\") {\n this.updateSelectionStateOfChildren();\n this.updateSelectionStateByChildren();\n }\n this.updateParent();\n }\n\n public updateSelectionStateByChildren(): void {\n if (this.nodes.length === 0) {\n return;\n }\n const checkStatus = this.nodes.map((child) => {\n return child.selectionState === \"checked\" || child.selectionState === \"indeterminate\";\n });\n const some = checkStatus.some(Boolean);\n if (this.parentSelectionAllowed) {\n this.selectionState = some ? \"checked\" : \"unchecked\";\n } else {\n const every = checkStatus.every(Boolean);\n const anyIndeterminate = this.nodes\n .map((child) => child.selectionState)\n .some((state) => state === \"indeterminate\");\n if (this.childrenType === \"radio\") {\n this.selectionState = some ? \"checked\" : \"unchecked\";\n } else if (anyIndeterminate) {\n this.selectionState = \"indeterminate\";\n } else if (every) {\n this.selectionState = \"checked\";\n } else if (some) {\n this.selectionState = \"indeterminate\";\n } else {\n this.selectionState = \"unchecked\";\n }\n }\n }\n\n private getFlattenedSubtree(nodes: Node[]): Node[] {\n return nodes.reduce<Node[]>((ack, curr) => {\n return ack.concat(\n isCheckboxNode(curr) && curr.childCount > 0 && curr.expanded\n ? [curr, ...this.getFlattenedSubtree(curr.nodes)]\n : curr,\n );\n }, []);\n }\n}\n\nexport { CheckboxNode };\n","import { Node } from \"./node\";\n\ntype RadioButtonNodeSelectionState = \"unchecked\" | \"checked\";\n\nclass RadioButtonNode extends Node {\n constructor(id: string, text: string, path: string[], nodes: Node[]) {\n super(id, text, path, nodes);\n this.type = \"radio\";\n }\n\n public toggle(): void {\n if (this.selectionState === \"checked\") {\n this.selectionState = \"unchecked\";\n } else {\n this.selectionState = \"checked\";\n this.clearSiblings();\n }\n this.updateBranch();\n }\n\n public check(): void {\n if (this.selectionState !== \"checked\") {\n this.selectionState = \"checked\";\n this.clearSiblings();\n this.updateBranch();\n }\n }\n\n public updateBranch(): void {\n if (this.selectionState === \"unchecked\") {\n this.updateSelectionStateOfChildren();\n }\n this.updateParent();\n }\n\n public updateParent(): Node {\n const parent = super.updateParent();\n if (parent instanceof RadioButtonNode) {\n parent.clearSiblings();\n }\n return parent;\n }\n\n public updateSelectionStateByChildren(): void {\n if (this.nodes.length === 0) {\n return;\n }\n const some = this.nodes.map((child) => child.selectionState === \"checked\").some(Boolean);\n if (some) {\n this.selectionState = \"checked\";\n } else {\n this.selectionState = \"unchecked\";\n }\n }\n\n private clearSiblings(): void {\n const siblings = this.getSiblings();\n siblings.forEach((sibling) => {\n sibling.uncheck();\n });\n }\n}\n\nexport { RadioButtonNode };\nexport type { RadioButtonNodeSelectionState };\n","import { LitElement, css, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport type { IExpansion, ISelection, NodeType } from \"./types\";\nimport { SDCheckbox } from \"@cas-smartdesign/checkbox\";\nimport { RadioButton } from \"@cas-smartdesign/radio-button-group\";\nimport { NODE_MARGIN_LEFT } from \"./constants\";\nimport { Node } from \"./node\";\nimport type { NodeSelectionState } from \"./types\";\nimport { CheckboxNode } from \"./checkbox-node\";\nimport { RadioButtonNode } from \"./radio-button-node\";\nimport style from \"./scss/node.scss?inline\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [TreeNode.ID]: TreeNode;\n }\n}\n\nexport interface CustomEventMap extends HTMLElementEventMap {\n selection: CustomEvent<ISelection>;\n expansion: CustomEvent<IExpansion>;\n}\n\nexport default interface TreeNode {\n addEventListener<K extends keyof CustomEventMap>(\n event: K,\n listener: ((this: this, ev: CustomEventMap[K]) => unknown) | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n addEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n removeEventListener<K extends keyof CustomEventMap>(\n type: K,\n listener: (this: this, ev: CustomEventMap[K]) => unknown,\n options?: boolean | EventListenerOptions,\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): void;\n dispatchEvent<EventType extends CustomEventMap[keyof CustomEventMap]>(event: EventType): boolean;\n}\n\nexport default class TreeNode extends LitElement {\n public static readonly ID = \"sd-tree-node\";\n @property({ type: String, reflect: true, attribute: true })\n public text = \"\";\n @property({ type: Boolean, reflect: true, attribute: true })\n public expanded = false;\n @property({ type: String, reflect: true, attribute: \"node-id\" })\n public nodeId: string;\n @property({ type: Number, reflect: true, attribute: \"child-count\" })\n public childCount = 0;\n @property({ type: Boolean, reflect: true, attribute: true })\n public focused = false;\n @property({ type: Boolean, reflect: true, attribute: true })\n public readonly = false;\n @property({ type: Number })\n public depth = 0;\n @property({ type: Array, attribute: false })\n public path: string[] = [];\n @property({ type: String, reflect: true, attribute: true })\n public type: NodeType = \"checkbox\";\n @property({ type: String, reflect: true, attribute: \"selection-state\" })\n public selectionState: NodeSelectionState = \"unchecked\";\n @property({ type: Boolean, reflect: true, attribute: true })\n public disabled = false;\n @property({ type: Boolean, reflect: true, attribute: true })\n public loading = false;\n\n static get styles() {\n return [\n css`\n ${unsafeCSS(style)}\n `,\n ];\n }\n\n public static ensureDefined = () => {\n RadioButton.ensureDefined();\n SDCheckbox.ensureDefined();\n if (!customElements.get(TreeNode.ID)) {\n customElements.define(TreeNode.ID, TreeNode);\n }\n };\n\n public render() {\n const hasChildren = this.childCount > 0 || this.children.length > 0;\n return html`\n <li class=\"node\" style=\"margin-left: ${this.depth * NODE_MARGIN_LEFT}px\">\n ${hasChildren\n ? html` <div class=\"expander ${this.expanded ? \"less\" : \"more\"}\" @click=\"${this.toggle}\"></div> `\n : html` <div class=\"placeholder\"></div> `}\n ${!this.readonly\n ? html`\n ${this.type === \"checkbox\"\n ? html`\n <sd-checkbox\n class=\"input\"\n tabIndex=\"-1\"\n label=\"${this.text}\"\n ?checked=\"${this.selectionState === \"checked\"}\"\n ?focused=\"${this.focused}\"\n ?disabled=\"${this.disabled}\"\n .indeterminate=\"${this.selectionState === \"indeterminate\"}\"\n @value-change=\"${this.onSelectionChange}\"\n oneline\n ></sd-checkbox>\n `\n : html`\n <sd-radio-button\n class=\"input\"\n tabIndex=\"-1\"\n label=\"${this.text}\"\n ?checked=\"${this.selectionState === \"checked\"}\"\n ?focused=\"${this.focused}\"\n ?disabled=\"${this.disabled}\"\n @click=\"${this.onSelectionChange}\"\n ></sd-radio-button>\n `}\n `\n : html` <div class=\"label\">${this.text}</div> `}\n ${hasChildren && this.expanded\n ? html`\n <ul>\n <slot></slot>\n </ul>\n `\n : \"\"}\n </li>\n `;\n }\n\n public toggle(): void {\n if (!this.loading) {\n this.expanded = !this.expanded;\n this.dispatchExpansionEvent();\n }\n }\n\n public expand(): void {\n if (!this.loading) {\n const hasChanged = !this.expanded;\n this.expanded = true;\n if (hasChanged) {\n this.dispatchExpansionEvent();\n }\n }\n }\n\n public collapse(): void {\n if (!this.loading) {\n const hasChanged = this.expanded;\n this.expanded = false;\n if (hasChanged) {\n this.dispatchExpansionEvent();\n }\n }\n }\n\n public getState(parentPath?: string[]): Node {\n const path = Array.isArray(parentPath) ? [...parentPath, this.nodeId] : [this.nodeId];\n const children = [...(this.children as HTMLCollectionOf<TreeNode>)].map((child) => child.getState(path));\n let node: Node;\n if (this.type === \"checkbox\") {\n node = new CheckboxNode(this.nodeId, this.text, path, children);\n } else {\n node = new RadioButtonNode(this.nodeId, this.text, path, children);\n }\n node.selectionState = this.selectionState;\n node.childrenType = children[0]?.type;\n node.expanded = this.expanded;\n node.disabled = this.disabled;\n return node;\n }\n\n private dispatchExpansionEvent(): void {\n this.dispatchEvent(\n new CustomEvent<IExpansion>(\"expansion\", {\n detail: { path: this.path, expanded: this.expanded },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private onSelectionChange = (): void => {\n if (!this.readonly) {\n if (this.type == \"checkbox\") {\n const checkbox = this.shadowRoot.querySelector(\".input\") as SDCheckbox;\n this.selectionState = checkbox.checked\n ? \"checked\"\n : checkbox.indeterminate\n ? \"indeterminate\"\n : \"unchecked\";\n } else {\n const radioButton = this.shadowRoot.querySelector(\".input\") as RadioButton;\n this.selectionState = radioButton.checked ? \"checked\" : \"unchecked\";\n }\n this.updateComplete.then(() => {\n this.dispatchEvent(\n new CustomEvent<ISelection>(\"selection\", {\n detail: {\n path: this.path,\n checked: this.selectionState === \"checked\",\n indeterminate: this.selectionState === \"indeterminate\",\n },\n bubbles: true,\n composed: true,\n }),\n );\n });\n }\n };\n}\n","import { LitElement, TemplateResult, html, unsafeCSS, css } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { NODE_MARGIN_LEFT } from \"./constants\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [LoadingIndicator.ID]: LoadingIndicator;\n }\n}\n\nimport style from \"./scss/loading-indicator.scss?inline\";\n\nexport default class LoadingIndicator extends LitElement {\n public static readonly ID = \"sd-tree-loading-indicator\";\n @property({ type: Boolean, reflect: true, attribute: true })\n public readonly = false;\n @property({ type: Number })\n public depth = 0;\n\n static get styles() {\n return [\n css`\n ${unsafeCSS(style)}\n `,\n ];\n }\n\n public static ensureDefined = () => {\n if (!customElements.get(LoadingIndicator.ID)) {\n customElements.define(LoadingIndicator.ID, LoadingIndicator);\n }\n };\n\n public render(): TemplateResult {\n return html`\n <li class=\"root\" style=\"margin-left: ${this.depth * NODE_MARGIN_LEFT}px;\">\n <div class=\"text\">\n <slot>Loading...</slot>\n </div>\n </li>\n `;\n }\n}\n","import { ScrollToAlignment, ILoadingNode } from \"./types\";\nimport { Node } from \"./node\";\n\nexport const flattenNodes = (arr: Node[], d = 1, depth = 0): Node[] => {\n return d > 0\n ? arr.reduce<Node[]>(\n (acc, val) =>\n acc.concat(\n val.childCount > 0 && val.expanded ? [val, ...flattenNodes(val.nodes, d - 1, depth + 1)] : val,\n ),\n [],\n )\n : arr.slice();\n};\n\nexport const findNodeByPath = (nodes: Node[], path: string[], depth = 0): Node => {\n if (!path) {\n return null;\n }\n const currentId = path[depth];\n const matchingNode = nodes.find((node) => node.id === currentId);\n if (path.length - 1 === depth) {\n return matchingNode;\n }\n if (matchingNode?.nodes.length > 0) {\n return findNodeByPath(matchingNode.nodes, path, depth + 1);\n } else {\n return null;\n }\n};\n\nexport const getOffsetForIndexAndAlignment = (\n index: number,\n alignment: ScrollToAlignment,\n scrollOffset: number,\n itemHeight: number,\n height: number,\n itemCount: number,\n): number => {\n const lastItemOffset = Math.max(0, itemCount * itemHeight);\n const maxOffset = Math.min(lastItemOffset, index * itemHeight);\n const minOffset = Math.max(0, index * itemHeight - height + itemHeight);\n\n switch (alignment) {\n case \"start\":\n return maxOffset;\n case \"end\":\n return minOffset;\n case \"center\": {\n const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);\n if (middleOffset < Math.ceil(height / 2)) {\n return 0;\n } else if (middleOffset > lastItemOffset + Math.floor(height / 2)) {\n return lastItemOffset;\n } else {\n return middleOffset;\n }\n }\n case \"auto\":\n default:\n if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {\n return scrollOffset;\n } else if (scrollOffset < minOffset) {\n return minOffset;\n } else {\n return maxOffset;\n }\n }\n};\n\nexport const isNode = (node: Node | ILoadingNode): node is Node => {\n return node && typeof node !== \"string\";\n};\n\nexport const findNode = (nodes: (Node | ILoadingNode)[], path: string[]): Node => {\n const node = nodes.find((node) => isNode(node) && JSON.stringify(node.path) === JSON.stringify(path));\n if (isNode(node)) {\n return node;\n }\n return null;\n};\n\nexport const findNodeIndex = (nodes: (string | ILoadingNode)[], path: string[]): number => {\n return nodes.findIndex((node) => typeof node === \"string\" && node === JSON.stringify(path));\n};\n\nexport const isFlattenedNode = (node: string | ILoadingNode): node is string => {\n return typeof node === \"string\";\n};\n","import { LitElement, html, unsafeCSS, PropertyValues, css, render, TemplateResult } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport TreeNode from \"./tree-node\";\nimport LoadingIndicator from \"./loading-indicator\";\nimport { IDataRequest, ScrollToAlignment, IExpansion, ISelection, ILoadingNode } from \"./types\";\nimport { getOffsetForIndexAndAlignment, flattenNodes, isFlattenedNode, findNodeIndex } from \"./utils\";\nimport { NODE_HEIGHT } from \"./constants\";\nimport { Node } from \"./node\";\nimport style from \"./scss/tree.scss?inline\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [Tree.ID]: Tree;\n }\n}\n\nexport interface CustomEventMap extends HTMLElementEventMap {\n \"data-request\": CustomEvent<IDataRequest>;\n selection: CustomEvent<ISelection>;\n expansion: CustomEvent<IExpansion>;\n}\n\ninterface Tree {\n addEventListener<K extends keyof CustomEventMap>(\n event: K,\n listener: ((this: this, ev: CustomEventMap[K]) => unknown) | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n addEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n removeEventListener<K extends keyof CustomEventMap>(\n type: K,\n listener: (this: this, ev: CustomEventMap[K]) => unknown,\n options?: boolean | EventListenerOptions,\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): void;\n dispatchEvent<EventType extends CustomEventMap[keyof CustomEventMap]>(event: EventType): boolean;\n}\n\nclass Tree extends LitElement {\n public static readonly ID = \"sd-tree\";\n public static ensureDefined = (): void => {\n TreeNode.ensureDefined();\n LoadingIndicator.ensureDefined();\n if (!customElements.get(Tree.ID)) {\n customElements.define(Tree.ID, Tree);\n }\n };\n public pageSize = 50;\n @property({ type: String })\n public loadingText = \"Loading...\";\n @property({ type: Boolean, reflect: true, attribute: \"parent-selection-allowed\" })\n public parentSelectionAllowed = false;\n @property({ type: Boolean, reflect: true, attribute: true })\n public readonly = false;\n private _resizeObserver: ResizeObserver;\n private _lastKnownHeight = 0;\n private _lastKnownScrollTop = 0;\n private _lastRenderedScrollTop = 0;\n private _visibleItemsNum = 0;\n\n private _firstVisibleIndex = 0;\n private _lastVisibleIndex = 0;\n private _firstRenderedIndex = 0;\n private _lastRenderedIndex = 0;\n\n private _focusIndex = -1;\n // contains the id of the loaded nodes and placeholders for nodes\n // which are currently loading\n private _flattenedNodes: (string | ILoadingNode)[] = [];\n private _rootItemsLoading = false;\n private _rootNodeCount = 0;\n private _loadedRootNodeCount = 0;\n // it's the sum of the loaded and the unloaded nodes at\n // any level in the tree\n private _allNodeCount = 0;\n\n private _nodeStates: Map<string, Node> = new Map();\n private _reusePreviousRenderData: boolean;\n\n @property({ type: Number })\n public get rootNodeCount(): number {\n return this._rootNodeCount;\n }\n\n public set rootNodeCount(count: number) {\n if (count === 0) {\n this._allNodeCount = 0;\n } else if (count > 0) {\n this._allNodeCount += count - this.rootNodeCount;\n }\n this._rootNodeCount = count;\n this.requestUpdate();\n }\n\n @property({ type: Number, attribute: \"focus-index\", reflect: true })\n public get focusIndex(): number {\n return this._focusIndex;\n }\n\n public set focusIndex(index: number) {\n if (index >= -1 && index < this._allNodeCount) {\n const oldValue = this._focusIndex;\n this._focusIndex = index;\n if (index <= this._firstVisibleIndex || this._lastVisibleIndex <= index) {\n this.scrollToNode(index);\n }\n if (oldValue != index) {\n this.requestUpdate(\"focusIndex\", oldValue);\n }\n }\n }\n\n constructor() {\n super();\n this._resizeObserver = new ResizeObserver(() => {\n if (this._lastKnownHeight !== this.offsetHeight) {\n this._lastKnownHeight = this.offsetHeight;\n this.requestUpdate();\n }\n });\n }\n\n public setNodes(nodes: Node[]) {\n this.stopLoadingIndicator();\n this.setLastLoadingChildren(nodes, this.rootNodeCount, nodes.length);\n nodes.forEach((node, ind) => {\n const siblings = [...nodes];\n siblings.splice(ind, 1);\n this.updateNodeMap(node, siblings);\n });\n this.updateCount(nodes);\n this._loadedRootNodeCount = nodes.length;\n this._flattenedNodes = flattenNodes(nodes, Infinity).map(this.getFlattenedNodeId);\n this.requestUpdate();\n }\n\n public addNodes(nodes: Node[], parentPath?: string[]): void {\n this.stopLoadingIndicator(parentPath);\n nodes.forEach((node, ind) => {\n const siblings = [...nodes];\n siblings.splice(ind, 1);\n this.updateNodeMap(node, siblings);\n });\n const parentNode = this.nodeGetter(parentPath);\n if (parentNode) {\n if (parentNode.expanded) {\n this._allNodeCount += nodes.length + this.getNodeCount(nodes);\n }\n } else {\n this._loadedRootNodeCount += nodes.length;\n }\n this.updateFlattenedNodes(nodes, parentPath);\n this.requestUpdate();\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this._resizeObserver.observe(this);\n }\n\n public disconnectedCallback(): void {\n super.disconnectedCallback();\n this._resizeObserver.disconnect();\n }\n\n static get styles() {\n return [\n css`\n ${unsafeCSS(style)}\n `,\n ];\n }\n\n public firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n this.addEventListener(\"scroll\", this.onScroll);\n this.addEventListener(\"keydown\", this.handleKeyDown);\n this.addEventListener(\"expansion\", this.handleNodeExpansion);\n this.addEventListener(\"selection\", this.handleNodeSelection);\n this.addEventListener(\"focus\", () => {\n if (this.focusIndex == -1) {\n this.focusIndex = this.normalizeIndex(0);\n }\n });\n if (this._nodeStates.size === 0) {\n if (this.children.length > 0) {\n this.syncState();\n } else {\n this.requestData();\n }\n }\n }\n\n public updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n this.updateNodes();\n if (changedProperties.has(\"parentSelectionAllowed\")) {\n this.updateParentSelectionAllowed();\n }\n }\n\n public render(): TemplateResult {\n this.updateRenderData();\n return html`\n <div class=\"root\" style=\"height: ${this._allNodeCount * NODE_HEIGHT}px\">\n <ul>\n <slot></slot>\n </ul>\n </div>\n `;\n }\n\n public scrollToNode(index: number, alignment: ScrollToAlignment = \"auto\"): void {\n this.scrollTop = getOffsetForIndexAndAlignment(\n this.normalizeIndex(index),\n alignment,\n this.scrollTop,\n NODE_HEIGHT,\n this.height,\n this._allNodeCount,\n );\n }\n\n private updateNodeMap(node: Node, siblings: Node[]): void {\n if (node) {\n node.nodeGetter = this.nodeGetter;\n node.getSiblings = (): Node[] => {\n return siblings;\n };\n this._nodeStates.set(JSON.stringify(node.path), node);\n node.nodes.forEach((child, ind) => {\n const siblings = [...node.nodes];\n siblings.splice(ind, 1);\n this.updateNodeMap(child, siblings);\n });\n }\n }\n\n private updateParentSelectionAllowed(): void {\n this._nodeStates.forEach((node) => {\n node.parentSelectionAllowed = this.parentSelectionAllowed;\n });\n }\n\n private updateNodes(): void {\n const nodesToRender = this._flattenedNodes.slice(this._firstRenderedIndex, this._lastRenderedIndex + 1);\n render(\n html`\n ${nodesToRender.map((node, ind) => {\n const virtualIndex = ind + this._firstRenderedIndex;\n const top = this.getTopPosition(virtualIndex);\n if (!isFlattenedNode(node)) {\n return html`\n <sd-tree-loading-indicator .depth=\"${node.depth}\" style=\"transform: translateY(${top}px)\"\n >${this.loadingText}</sd-tree-loading-indicator\n >\n `;\n }\n const data = this._nodeStates.get(node);\n const isFocused = virtualIndex === this.focusIndex;\n let isDisabled = data.disabled;\n if (!this.parentSelectionAllowed) {\n // when parent selection is not allowed and a node has radio button descendant\n // and such a node is selected then we wouldn't know which radio button descendant\n // should be selected that is why this node should be 'disabled'\n isDisabled = isDisabled || data.hasRadioButtonDescendant();\n }\n return html`\n <sd-tree-node\n text=\"${data.text}\"\n selection-state=\"${data.selectionState}\"\n .nodeId=\"${data.id}\"\n .depth=\"${data.depth}\"\n style=\"transform: translateY(${top}px);\"\n .path=\"${data.path}\"\n ?focused=\"${isFocused}\"\n ?readonly=\"${this.readonly}\"\n type=\"${data.type}\"\n ?expanded=\"${data.expanded}\"\n child-count=\"${data.childCount}\"\n ?disabled=\"${isDisabled}\"\n .loading=\"${data.loading}\"\n ></sd-tree-node>\n `;\n })}\n `,\n this,\n );\n }\n\n private getTopPosition(index: number): number {\n return index * NODE_HEIGHT;\n }\n\n private updateRenderData(): void {\n if (this._reusePreviousRenderData) {\n return;\n }\n this._lastRenderedScrollTop = this.scrollTop;\n this._visibleItemsNum = Math.min(Math.ceil(this.height / NODE_HEIGHT), this._allNodeCount);\n if (this._visibleItemsNum > 0) {\n this._firstVisibleIndex = this.normalizeIndex(Math.floor(this._lastRenderedScrollTop / NODE_HEIGHT));\n this._lastVisibleIndex = this.normalizeIndex(this._firstVisibleIndex + this._visibleItemsNum);\n\n this._firstRenderedIndex = this.normalizeIndex(this._firstVisibleIndex - 2);\n this._lastRenderedIndex = this.normalizeIndex(this._lastVisibleIndex + 2);\n\n for (const node of this._flattenedNodes.slice(this._firstRenderedIndex, this._lastRenderedIndex + 1)) {\n const data = isFlattenedNode(node) && this._nodeStates.get(node);\n if (data) {\n if (data.lastLoadingChild) {\n const parentNode = data.parentNode;\n if (parentNode) {\n if (this.needsFurtherData(parentNode)) {\n this.requestData(parentNode);\n break;\n }\n } else if (this._loadedRootNodeCount < this.rootNodeCount && !this._rootItemsLoading) {\n this.requestData();\n break;\n }\n } else if (this.needsFurtherData(data)) {\n this.requestData(data);\n break;\n }\n }\n }\n } else {\n this._firstVisibleIndex = 0;\n this._lastVisibleIndex = 0;\n this._firstRenderedIndex = 0;\n this._lastRenderedIndex = 0;\n }\n }\n\n private needsFurtherData(node: Node): boolean {\n return (\n node.expanded &&\n node.childCount > node.nodes.length &&\n this.nodeIndex(node.id) + node.nodes.length < this._lastRenderedIndex\n );\n }\n\n private nodeIndex(id: string): number {\n return this._flattenedNodes.findIndex((flatNode) => flatNode === id);\n }\n\n private normalizeIndex(index: number): number {\n return Math.max(0, Math.min(index, this._allNodeCount - 1));\n }\n\n private get height(): number {\n return this.offsetHeight;\n }\n\n private requestData(node?: Node): void {\n if (!node?.loading) {\n const path = node?.path;\n this.startLoadingIndicator(path);\n this.dispatchEvent(\n new CustomEvent<IDataRequest>(\"data-request\", {\n detail: { path },\n }),\n );\n }\n }\n\n private onScroll = (): void => {\n this._lastKnownScrollTop = this.scrollTop;\n const delta = this._lastRenderedScrollTop - this._lastKnownScrollTop;\n if (Math.abs(delta) >= NODE_HEIGHT) {\n this._lastRenderedScrollTop = this._lastKnownScrollTop;\n this.requestUpdate();\n }\n };\n\n private handleNodeExpansion = (event: CustomEvent<IExpansion>): void => {\n const { path, expanded } = event.detail;\n this.updateAfterExpansion(path, expanded);\n };\n\n private updateAfterExpansion(path: string[], expanded: boolean): void {\n const node = this._nodeStates.get(JSON.stringify(path));\n if (node) {\n node.expanded = expanded;\n const flattenedNodeIndex = findNodeIndex(this._flattenedNodes, path);\n const focusedNode = this._flattenedNodes[this.focusIndex];\n if (expanded) {\n const numberOfNodesAdded = this.addSubtree(node, flattenedNodeIndex + 1);\n const hasUnloadedChildren = node.childCount > node.nodes.length;\n const hasVisibleUnloadedChildren = flattenedNodeIndex + node.nodes.length < this._lastRenderedIndex;\n if (hasUnloadedChildren && hasVisibleUnloadedChildren) {\n this.requestData(node);\n }\n this._allNodeCount += numberOfNodesAdded;\n } else {\n const numberOfNodesRemoved = this.removeSubtree(flattenedNodeIndex);\n this._allNodeCount -= numberOfNodesRemoved;\n }\n if (focusedNode) {\n const newIndex = this._flattenedNodes.findIndex((flatNode) => flatNode == focusedNode);\n if (newIndex !== this.focusIndex) {\n this._focusIndex = newIndex;\n }\n }\n }\n this.requestUpdate();\n }\n\n private addSubtree(rootNode: Node, firstIndex: number): number {\n const flattenedSubtree = this.getFlattenedSubtree(rootNode.nodes);\n this._flattenedNodes.splice(firstIndex, 0, ...flattenedSubtree);\n return flattenedSubtree.length;\n }\n\n private getFlattenedSubtree(nodes: Node[]): string[] {\n return nodes.reduce<string[]>((ack, curr) => {\n return ack.concat(\n curr && curr.childCount > 0 && curr.expanded\n ? [JSON.stringify(curr.path), ...this.getFlattenedSubtree(curr.nodes)]\n : JSON.stringify(curr.path),\n );\n }, []);\n }\n\n private removeSubtree(rootNodeIndex: number): number {\n const nextNonDescendantIndex = this.getNextNonDescendantIndex(rootNodeIndex);\n let numberOfNodesToRemove = 0;\n if (nextNonDescendantIndex !== -1) {\n numberOfNodesToRemove = nextNonDescendantIndex - rootNodeIndex - 1;\n this._flattenedNodes.splice(rootNodeIndex + 1, numberOfNodesToRemove);\n } else {\n numberOfNodesToRemove = this._flattenedNodes.length - rootNodeIndex - 1;\n this._flattenedNodes.splice(rootNodeIndex + 1);\n }\n return numberOfNodesToRemove;\n }\n\n // Returns the index of the node which is the next node\n // in this._flattenedNodes after the descendants of the given node.\n // This is used for removing the descendans of a node from this._flattenedNodes\n // after collapsing it.\n private getNextNonDescendantIndex(index: number): number {\n const nodePath = this._flattenedNodes[index];\n const node = isFlattenedNode(nodePath) && this._nodeStates.get(nodePath);\n if (node) {\n for (let i = index + 1; i < this._flattenedNodes.length; i++) {\n const flatNodePath = this._flattenedNodes[i];\n const flatNode = isFlattenedNode(flatNodePath) && this._nodeStates.get(flatNodePath);\n if (flatNode && flatNode.path.length <= node.path.length) {\n return i;\n }\n }\n }\n return -1;\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n let shouldPrevent = true;\n switch (event.key) {\n case \"ArrowDown\": {\n this.focusIndex = this.normalizeIndex(this.focusIndex + 1);\n break;\n }\n case \"ArrowUp\": {\n this.focusIndex = this.normalizeIndex(this.focusIndex - 1);\n break;\n }\n case \"ArrowRight\": {\n const focusedNode = this.focusedNode;\n if (focusedNode) {\n if (focusedNode.childCount > 0 && !focusedNode.expanded) {\n const focusedNodeElement = this.querySelector(`[node-id='${focusedNode.id}']`) as TreeNode;\n if (focusedNodeElement) {\n focusedNodeElement.expand();\n }\n } else {\n this.focusIndex = this.normalizeIndex(this.focusIndex + 1);\n }\n }\n break;\n }\n case \"ArrowLeft\": {\n const focusedNode = this.focusedNode;\n if (focusedNode) {\n if (focusedNode.childCount > 0 && focusedNode.expanded) {\n const focusedNodeElement = this.querySelector(`[node-id='${focusedNode.id}']`) as TreeNode;\n if (focusedNodeElement) {\n focusedNodeElement.collapse();\n }\n } else {\n this.focusIndex = this.normalizeIndex(this.focusIndex - 1);\n }\n }\n break;\n }\n case \"Enter\": {\n const focusedNode = this.focusedNode;\n if (focusedNode) {\n this.toggleSelection(focusedNode.path);\n this.updateComplete.then(() => {\n this.dispatchEvent(\n new CustomEvent<ISelection>(\"selection\", {\n detail: {\n path: focusedNode.path,\n checked: focusedNode.selectionState === \"checked\",\n indeterminate: focusedNode.selectionState === \"indeterminate\",\n },\n bubbles: true,\n composed: true,\n }),\n );\n });\n }\n break;\n }\n default: {\n shouldPrevent = false;\n break;\n }\n }\n if (shouldPrevent) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n private handleNodeSelection = (event: CustomEvent<ISelection>): void => {\n if (event.target == this) {\n return;\n }\n this._reusePreviousRenderData = true;\n const { path } = event.detail;\n // focus index should be updated before focusing, otherwise automatic focus index setting may cause unexpected scrolling\n this.focusIndex = findNodeIndex(this._flattenedNodes, path);\n // when the selection is triggered by a click on a checkbox\n // the :active pseudo class is kept on the checkbox\n // even after scrolling and rerendering it with different data\n // to prevent this focusing the tree is needed\n this.focus();\n this.toggleSelection(path);\n this.updateComplete.then(() => {\n // Fixes 262528.\n // The render data may not be up-to-date due to the delta change detection in the scroll handler.\n // If we use another render data directly after the selection, then template fragments can change\n // without noticing the most recent value, causing the nodes to show invalid data on the UI.\n this._reusePreviousRenderData = false;\n });\n };\n\n private get focusedNode(): Node | undefined {\n const flattenedNode = this._flattenedNodes[this.focusIndex];\n return isFlattenedNode(flattenedNode) && this._nodeStates.get(flattenedNode);\n }\n\n private toggleSelection(path: string[]): void {\n const node = this.nodeGetter(path);\n node.toggle();\n this.requestUpdate();\n }\n\n private updateFlattenedNodes(subtree: Node[], parentPath: string[]): void {\n if (parentPath) {\n const parentIndex = findNodeIndex(this._flattenedNodes, parentPath);\n const parentId = this._flattenedNodes[parentIndex];\n if (isFlattenedNode(parentId)) {\n const parentNode = this._nodeStates.get(parentId);\n if (parentNode) {\n const startIndex = parentIndex + parentNode.nodes.length + 1;\n const parentDepth = parentNode.depth;\n const flattenedSubtree = flattenNodes(subtree, Infinity, parentDepth + 1).map(\n this.getFlattenedNodeId,\n );\n if (parentNode.expanded) {\n this._flattenedNodes.splice(startIndex, 0, ...flattenedSubtree);\n }\n parentNode.nodes = [...parentNode.nodes, ...subtree];\n parentNode.loading = false;\n this.updateLastLoadingChild(parentNode.nodes, flattenedSubtree);\n }\n }\n } else {\n const flattenedSubtree = flattenNodes(subtree, Infinity).map(this.getFlattenedNodeId);\n this.updateLastLoadingChild(this._flattenedNodes, flattenedSubtree);\n this._flattenedNodes = [...this._flattenedNodes, ...flattenedSubtree];\n }\n }\n\n private getFlattenedNodeId = (node: Node): string => {\n return JSON.stringify(node.path);\n };\n\n private updateLastLoadingChild(previousNodes: (string | ILoadingNode)[], newNodes: string[]): void {\n const previousLastNodeId = previousNodes[previousNodes.length - 1];\n const previousLastNode = isFlattenedNode(previousLastNodeId) && this._nodeStates.get(previousLastNodeId);\n const newLastNodeId = newNodes[newNodes.length - 1];\n const newLastNode = isFlattenedNode(newLastNodeId) && this._nodeStates.get(newLastNodeId);\n if (previousLastNode) {\n previousLastNode.lastLoadingChild = false;\n }\n if (newLastNode) {\n const parent = newLastNode.parentNode;\n const hasUnloadedSiblings =\n (parent && parent.childCount > parent.nodes.length) ||\n (!parent && this.rootNodeCount > this._loadedRootNodeCount);\n if (hasUnloadedSiblings) {\n newLastNode.lastLoadingChild = true;\n }\n }\n }\n\n private setLastLoadingChildren(nodes: Node[], count: number, loadedCount: number): void {\n if (loadedCount < count) {\n const lastNode = nodes[nodes.length - 1];\n if (lastNode) {\n lastNode.lastLoadingChild = true;\n }\n }\n nodes.forEach((node) => {\n this.setLastLoadingChildren(node.nodes, node.childCount, node.nodes.length);\n });\n }\n\n private startLoadingIndicator(loadingParentPath: string[]): void {\n if (loadingParentPath) {\n const node = this._nodeStates.get(JSON.stringify(loadingParentPath));\n if (node) {\n const flatNodeIndex = findNodeIndex(this._flattenedNodes, loadingParentPath);\n node.loading = true;\n this.addPlaceholders(flatNodeIndex, node);\n }\n } else {\n this._rootItemsLoading = true;\n this._flattenedNodes = [\n ...this._flattenedNodes,\n ...new Array(this.rootNodeCount - this._loadedRootNodeCount).fill({ depth: 0 }),\n ];\n }\n this.updateNodes();\n }\n\n private addPlaceholders(index: number, node: Node): void {\n const firstIndex = index + node.nodes.length + 1;\n const numOfPlaceholders = node.childCount - node.nodes.length;\n this._flattenedNodes.splice(\n firstIndex,\n 0,\n ...new Array(numOfPlaceholders).fill({\n depth: node.depth + 1,\n }),\n );\n }\n\n private stopLoadingIndicator(loadingParentPath?: string[]): void {\n if (loadingParentPath) {\n const node = this._nodeStates.get(JSON.stringify(loadingParentPath));\n if (node) {\n node.loading = false;\n if (node.expanded) {\n const flatNodeIndex = findNodeIndex(this._flattenedNodes, loadingParentPath);\n this.removePlaceHolders(flatNodeIndex, node);\n }\n }\n } else {\n this._rootItemsLoading = false;\n const firstLoaderIndex = this._flattenedNodes.findIndex((node) => !isFlattenedNode(node));\n this._flattenedNodes.splice(firstLoaderIndex);\n }\n }\n\n private removePlaceHolders(index: number, node: Node): void {\n const firstIndex = index + node.nodes.length + 1;\n const numOfPlaceholders = node.childCount - node.nodes.length;\n this._flattenedNodes.splice(firstIndex, numOfPlaceholders);\n }\n\n // this method is used to synchronize this.nodes property\n // to the declaratively created nodes\n private syncState(): void {\n const rootNodes = [...(this.children as HTMLCollectionOf<TreeNode>)];\n const state = rootNodes.map((node) => node.getState());\n this.addNodes(state);\n this.rootNodeCount = state.length;\n this.innerHTML = \"\";\n }\n\n private updateCount(nodes: Node[]): void {\n this._allNodeCount = nodes.length + this.getNodeCount(nodes);\n }\n\n private getNodeCount(nodes: Node[]): number {\n let n = 0;\n nodes.forEach((node) => {\n if (node.expanded) {\n n += node.childCount + this.getNodeCount(node.nodes);\n }\n });\n return n;\n }\n\n private nodeGetter = (path: string[]): Node | null => {\n return path ? this._nodeStates.get(JSON.stringify(path)) : null;\n };\n}\n\nTree.ensureDefined();\n\nexport { Tree };\nexport * from \"./node\";\nexport * from \"./checkbox-node\";\nexport * from \"./radio-button-node\";\nexport * from \"./types\";\nexport * from \"./utils\";\n"],"names":["NODE_MARGIN_LEFT","NODE_HEIGHT","Node","id","text","path","nodes","child","isRadioButtonNode","parent","isCheckboxNode","node","CheckboxNode","checkStatus","some","every","anyIndeterminate","state","ack","curr","RadioButtonNode","sibling","_TreeNode","_a","LitElement","checkbox","radioButton","css","unsafeCSS","style","hasChildren","html","hasChanged","parentPath","children","RadioButton","SDCheckbox","__decorateClass","property","TreeNode","_LoadingIndicator","LoadingIndicator","flattenNodes","arr","d","depth","acc","val","findNodeByPath","currentId","matchingNode","getOffsetForIndexAndAlignment","index","alignment","scrollOffset","itemHeight","height","itemCount","lastItemOffset","maxOffset","minOffset","middleOffset","isNode","findNode","findNodeIndex","isFlattenedNode","_Tree","delta","event","expanded","shouldPrevent","focusedNode","focusedNodeElement","count","oldValue","ind","siblings","parentNode","changedProperties","nodesToRender","render","virtualIndex","top","data","isFocused","isDisabled","flatNode","flattenedNodeIndex","numberOfNodesAdded","hasUnloadedChildren","hasVisibleUnloadedChildren","numberOfNodesRemoved","newIndex","rootNode","firstIndex","flattenedSubtree","rootNodeIndex","nextNonDescendantIndex","numberOfNodesToRemove","nodePath","flatNodePath","flattenedNode","subtree","parentIndex","parentId","startIndex","parentDepth","previousNodes","newNodes","previousLastNodeId","previousLastNode","newLastNodeId","newLastNode","loadedCount","lastNode","loadingParentPath","flatNodeIndex","numOfPlaceholders","firstLoaderIndex","n","Tree"],"mappings":";;;;AAAO,MAAMA,IAAmB,IACnBC,IAAc;ACa3B,MAAeC,EAAwB;AAAA,EAgBnC,YACWC,GACAC,GACAC,GACAC,GACT;AAJS,SAAA,KAAAH,GACA,KAAA,OAAAC,GACA,KAAA,OAAAC,GACA,KAAA,QAAAC,GAlBX,KAAO,QAAQ,GACf,KAAO,iBAAqC,aAE5C,KAAO,WAAW,IAElB,KAAO,yBAAyB,IAChC,KAAO,mBAAmB,IAC1B,KAAO,UAAU,IACjB,KAAO,WAAW,IAIlB,KAAQ,SAAmB,IAQnBD,KACK,KAAA,QAAQA,EAAK,SAAS,GAC3B,KAAK,SAASA,EAAK,MAAM,GAAG,EAAE,KAEzB,KAAA,OAAO,CAACF,CAAE,GAEd,KAAA,aAAaG,IAAQA,EAAM,SAAS;AAAA,EAC7C;AAAA,EAUO,iCAAuC;AACrC,SAAA,MAAM,QAAQ,CAACC,MAAU;AACtB,UAAA,KAAK,mBAAmB,WAAW;AACnC,YAAIA,EAAM,iBAAiB,WAAWC,EAAkBD,CAAK;AACzD;AAEJ,QAAAA,EAAM,iBAAiB;AAAA,MAAA;AAC3B,QAAW,KAAK,mBAAmB,gBAC/BA,EAAM,iBAAiB;AAE3B,MAAAA,EAAM,+BAA+B;AAAA,IAAA,CACxC;AAAA,EACL;AAAA,EAEO,eAAqB;AACxB,UAAME,IAAS,KAAK;AAEpB,WAAIA,MACI,C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B,EAAA;AAAA,EADVC,EAAS,EAAE,MAAM,QAAQ;AAAA,GAzCxB4B,EA0CS,WAAA,iBAAA,CAAA;AAeA7B,EAAA;AAAA,EADVC,EAAS,EAAE,MAAM,QAAQ,WAAW,eAAe,SAAS,IAAM;AAAA,GAxDjE4B,EAyDS,WAAA,cAAA,CAAA;AAzDf,IAAMsD,IAANtD;AA2pBAsD,EAAK,cAAc;"}
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
@@ -0,0 +1,192 @@
1
+ {
2
+ "@cypress/vite-dev-server@5.0.7": {
3
+ "licenses": "MIT",
4
+ "repository": "https://github.com/cypress-io/cypress",
5
+ "licenseUrl": "https://github.com/cypress-io/cypress/tree/develop/npm/vite-dev-server#readme"
6
+ },
7
+ "@rollup/plugin-node-resolve@15.2.3": {
8
+ "licenses": "MIT",
9
+ "repository": "https://github.com/rollup/plugins",
10
+ "licenseUrl": "https://github.com/rollup/plugins/raw/HEAD/LICENSE"
11
+ },
12
+ "@types/node@20.10.6": {
13
+ "licenses": "MIT",
14
+ "repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
15
+ "licenseUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/raw/HEAD/LICENSE"
16
+ },
17
+ "@types/postcss-prefix-selector@1.16.3": {
18
+ "licenses": "MIT",
19
+ "repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
20
+ "licenseUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/raw/HEAD/LICENSE"
21
+ },
22
+ "@typescript-eslint/eslint-plugin@6.17.0": {
23
+ "licenses": "MIT",
24
+ "repository": "https://github.com/typescript-eslint/typescript-eslint",
25
+ "licenseUrl": "https://github.com/typescript-eslint/typescript-eslint/raw/HEAD/LICENSE"
26
+ },
27
+ "@typescript-eslint/parser@6.17.0": {
28
+ "licenses": "BSD-2-Clause",
29
+ "repository": "https://github.com/typescript-eslint/typescript-eslint",
30
+ "licenseUrl": "https://github.com/typescript-eslint/typescript-eslint/raw/HEAD/LICENSE"
31
+ },
32
+ "@vitest/coverage-v8@1.1.1": {
33
+ "licenses": "MIT",
34
+ "repository": "https://github.com/vitest-dev/vitest",
35
+ "licenseUrl": "https://github.com/vitest-dev/vitest/raw/HEAD/LICENSE"
36
+ },
37
+ "@vitest/ui@1.1.1": {
38
+ "licenses": "MIT",
39
+ "repository": "https://github.com/vitest-dev/vitest",
40
+ "licenseUrl": "https://github.com/vitest-dev/vitest/raw/HEAD/LICENSE"
41
+ },
42
+ "axe-core@4.8.3": {
43
+ "licenses": "MPL-2.0",
44
+ "repository": "https://github.com/dequelabs/axe-core",
45
+ "licenseUrl": "https://github.com/dequelabs/axe-core/raw/HEAD/LICENSE"
46
+ },
47
+ "cypress-axe@1.5.0": {
48
+ "licenses": "MIT",
49
+ "repository": "https://github.com/component-driven/cypress-axe",
50
+ "licenseUrl": "https://github.com/component-driven/cypress-axe/raw/HEAD/License.md"
51
+ },
52
+ "cypress-real-events@1.13.0": {
53
+ "licenses": "MIT",
54
+ "repository": "https://github.com/dmtrKovalenko/cypress-real-events",
55
+ "licenseUrl": "https://github.com/dmtrKovalenko/cypress-real-events"
56
+ },
57
+ "cypress@13.6.2": {
58
+ "licenses": "MIT",
59
+ "repository": "https://github.com/cypress-io/cypress",
60
+ "licenseUrl": "https://cypress.io"
61
+ },
62
+ "esbuild@0.19.11": {
63
+ "licenses": "MIT",
64
+ "repository": "https://github.com/evanw/esbuild",
65
+ "licenseUrl": "https://github.com/evanw/esbuild/raw/HEAD/LICENSE.md"
66
+ },
67
+ "eslint-config-google@0.14.0": {
68
+ "licenses": "Apache-2.0",
69
+ "repository": "https://github.com/google/eslint-config-google",
70
+ "licenseUrl": "https://github.com/google/eslint-config-google/raw/HEAD/LICENSE"
71
+ },
72
+ "eslint-config-prettier@9.1.0": {
73
+ "licenses": "MIT",
74
+ "repository": "https://github.com/prettier/eslint-config-prettier",
75
+ "licenseUrl": "https://github.com/prettier/eslint-config-prettier/raw/HEAD/LICENSE"
76
+ },
77
+ "eslint@8.56.0": {
78
+ "licenses": "MIT",
79
+ "repository": "https://github.com/eslint/eslint",
80
+ "licenseUrl": "https://github.com/eslint/eslint/raw/HEAD/LICENSE"
81
+ },
82
+ "github-markdown-css@5.5.0": {
83
+ "licenses": "MIT",
84
+ "repository": "https://github.com/sindresorhus/github-markdown-css",
85
+ "licenseUrl": "https://github.com/sindresorhus/github-markdown-css/raw/HEAD/license"
86
+ },
87
+ "highlight.js@11.9.0": {
88
+ "licenses": "BSD-3-Clause",
89
+ "repository": "https://github.com/highlightjs/highlight.js",
90
+ "licenseUrl": "https://github.com/highlightjs/highlight.js/raw/HEAD/LICENSE"
91
+ },
92
+ "junit-report-builder@3.1.0": {
93
+ "licenses": "MIT",
94
+ "repository": "https://github.com/davidparsson/junit-report-builder",
95
+ "licenseUrl": "https://github.com/davidparsson/junit-report-builder/raw/HEAD/LICENSE"
96
+ },
97
+ "lint-staged@15.2.0": {
98
+ "licenses": "MIT",
99
+ "repository": "https://github.com/okonet/lint-staged",
100
+ "licenseUrl": "https://github.com/okonet/lint-staged/raw/HEAD/LICENSE"
101
+ },
102
+ "lit@2.8.0": {
103
+ "licenses": "BSD-3-Clause",
104
+ "repository": "https://github.com/lit/lit",
105
+ "licenseUrl": "https://github.com/lit/lit/raw/HEAD/LICENSE"
106
+ },
107
+ "marked@11.1.1": {
108
+ "licenses": "MIT",
109
+ "repository": "https://github.com/markedjs/marked",
110
+ "licenseUrl": "https://github.com/markedjs/marked/raw/HEAD/LICENSE.md"
111
+ },
112
+ "postcss-prefix-selector@1.16.0": {
113
+ "licenses": "MIT",
114
+ "repository": "https://github.com/RadValentin/postcss-prefix-selector",
115
+ "licenseUrl": "https://github.com/RadValentin/postcss-prefix-selector/raw/HEAD/LICENSE"
116
+ },
117
+ "postcss@8.4.32": {
118
+ "licenses": "MIT",
119
+ "repository": "https://github.com/postcss/postcss",
120
+ "licenseUrl": "https://github.com/postcss/postcss/raw/HEAD/LICENSE"
121
+ },
122
+ "prettier@3.1.1": {
123
+ "licenses": "MIT",
124
+ "repository": "https://github.com/prettier/prettier",
125
+ "licenseUrl": "https://github.com/prettier/prettier/raw/HEAD/LICENSE"
126
+ },
127
+ "resolve-pkg@2.0.0": {
128
+ "licenses": "MIT",
129
+ "repository": "https://github.com/sindresorhus/resolve-pkg",
130
+ "licenseUrl": "https://github.com/sindresorhus/resolve-pkg/raw/HEAD/license"
131
+ },
132
+ "sass@1.69.6": {
133
+ "licenses": "MIT",
134
+ "repository": "https://github.com/sass/dart-sass",
135
+ "licenseUrl": "https://github.com/sass/dart-sass/raw/HEAD/LICENSE"
136
+ },
137
+ "stylelint-config-recommended-scss@14.0.0": {
138
+ "licenses": "MIT",
139
+ "repository": "https://github.com/stylelint-scss/stylelint-config-recommended-scss",
140
+ "licenseUrl": "https://github.com/stylelint-scss/stylelint-config-recommended-scss/raw/HEAD/LICENSE"
141
+ },
142
+ "stylelint-config-standard@36.0.0": {
143
+ "licenses": "MIT",
144
+ "repository": "https://github.com/stylelint/stylelint-config-standard",
145
+ "licenseUrl": "https://github.com/stylelint/stylelint-config-standard/raw/HEAD/LICENSE"
146
+ },
147
+ "stylelint-scss@6.0.0": {
148
+ "licenses": "MIT",
149
+ "repository": "https://github.com/stylelint-scss/stylelint-scss",
150
+ "licenseUrl": "https://github.com/stylelint-scss/stylelint-scss/raw/HEAD/LICENSE"
151
+ },
152
+ "stylelint@16.1.0": {
153
+ "licenses": "MIT",
154
+ "repository": "https://github.com/stylelint/stylelint",
155
+ "licenseUrl": "https://github.com/stylelint/stylelint/raw/HEAD/LICENSE"
156
+ },
157
+ "tsup@8.0.1": {
158
+ "licenses": "MIT",
159
+ "repository": "https://github.com/egoist/tsup",
160
+ "licenseUrl": "https://github.com/egoist/tsup/raw/HEAD/LICENSE"
161
+ },
162
+ "turbo@1.11.2": {
163
+ "licenses": "MPL-2.0",
164
+ "repository": "https://github.com/vercel/turbo",
165
+ "licenseUrl": "https://github.com/vercel/turbo/raw/HEAD/LICENSE"
166
+ },
167
+ "typescript@5.3.3": {
168
+ "licenses": "Apache-2.0",
169
+ "repository": "https://github.com/Microsoft/TypeScript",
170
+ "licenseUrl": "https://github.com/Microsoft/TypeScript/raw/HEAD/LICENSE.txt"
171
+ },
172
+ "vite-tsconfig-paths@4.2.3": {
173
+ "licenses": "MIT",
174
+ "repository": "https://github.com/aleclarson/vite-tsconfig-paths",
175
+ "licenseUrl": "https://github.com/aleclarson/vite-tsconfig-paths/raw/HEAD/LICENSE"
176
+ },
177
+ "vite@5.0.10": {
178
+ "licenses": "MIT",
179
+ "repository": "https://github.com/vitejs/vite",
180
+ "licenseUrl": "https://github.com/vitejs/vite/raw/HEAD/LICENSE.md"
181
+ },
182
+ "vitest@1.1.1": {
183
+ "licenses": "MIT",
184
+ "repository": "https://github.com/vitest-dev/vitest",
185
+ "licenseUrl": "https://github.com/vitest-dev/vitest/raw/HEAD/LICENSE.md"
186
+ },
187
+ "yargs@17.7.2": {
188
+ "licenses": "MIT",
189
+ "repository": "https://github.com/yargs/yargs",
190
+ "licenseUrl": "https://github.com/yargs/yargs/raw/HEAD/LICENSE"
191
+ }
192
+ }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@cas-smartdesign/tree",
3
+ "version": "4.0.3",
4
+ "description": "",
5
+ "main": "dist/tree-with-externals.js",
6
+ "module": "dist/tree.mjs",
7
+ "license": "SEE LICENSE IN LICENSE",
8
+ "types": "dist/tree.d.ts",
9
+ "dependencies": {
10
+ "lit": "^2.8.0",
11
+ "@cas-smartdesign/checkbox": "^5.0.1",
12
+ "@cas-smartdesign/radio-button-group": "^4.0.1",
13
+ "@cas-smartdesign/styles": "^3.6.1"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "npm-third-party-licenses.json"
18
+ ],
19
+ "publishConfig": {
20
+ "registry": "https://registry.npmjs.org/",
21
+ "access": "public"
22
+ },
23
+ "devDependencies": {
24
+ "@vitest/coverage-v8": "^1.1.1",
25
+ "@vitest/ui": "^1.1.1",
26
+ "vitest": "^1.1.1",
27
+ "@cas-smartdesign/element-preview": "^0.2.1",
28
+ "@cas-smartdesign/license-generator": "^1.6.1"
29
+ },
30
+ "scripts": {
31
+ "version": "pnpm version",
32
+ "generate-declaration": "tsc -p tsconfig.types.json",
33
+ "build:no-license": "vite build && pnpm generate-declaration && vite build --mode documentation",
34
+ "build": "pnpm generate-license && pnpm build:no-license",
35
+ "watch": "vite build --watch",
36
+ "dev": "vite",
37
+ "generate-license": "sd-license-generator --r ../../",
38
+ "cypress:run": "pnpm cypress run --component --browser chrome",
39
+ "cypress:open": "pnpm cypress open --component",
40
+ "test": "vitest --coverage --run",
41
+ "test:watch": "vitest --coverage --ui",
42
+ "test:component": "pnpm cypress run --component --quiet --browser chrome"
43
+ }
44
+ }
package/readme.md ADDED
@@ -0,0 +1,111 @@
1
+ # @cas-smartdesign/tree
2
+
3
+ An element for visualizing tree data structure.
4
+
5
+ ## Attributes - Tree
6
+
7
+ - `focus-index`
8
+ - Defines the index of the focused node
9
+ - `parent-selection-allowed`
10
+ - Allows a parent node to have individual value, this means that in this mode if a parent node is selected its children are not selected automatically
11
+ - `readonly`
12
+ - Defines whether if the tree is in readonly mode
13
+ - In this mode the selection handling is disabled and the checkbox is not rendered
14
+
15
+ ## Properties - Tree
16
+
17
+ - `rootNodeCount` **_number (default=0)_**
18
+ - Defines the number of root nodes
19
+ - `nodes` **_INode[] (default=empty)_**
20
+ - The tree data
21
+ - `focusIndex` **_number (default=-1)_**
22
+ - Reflects the corresponding attribute
23
+ - `readonly` **_boolean (default=false)_**
24
+ - Reflects the corresponding attribute
25
+
26
+ ## Custom events - Tree
27
+
28
+ - `data-request`
29
+ - This event is dispatched for loading child nodes for the actively expanded node.
30
+
31
+ ## Public methods - Tree
32
+
33
+ - `addNodes`
34
+ - Used for adding either root or non-root nodes to patch the missing visible parts of the tree
35
+ - `setNodes`
36
+ - Used for overwriting all nodes in the tree
37
+ - If called frequently, this can have an impact on the performance
38
+
39
+ ## Attributes - TreeNode
40
+
41
+ - `text`
42
+ - Defines the text content of the node
43
+ - `expanded`
44
+ - Defines whether if the children of the node are visible
45
+ - `selection-state`
46
+ - Defines whether if the node is in `checked`, `unchecked` or `indeterminate` state
47
+ - The `indeterminate` state mean that only some, not all of it children are selected
48
+ - This state can only occur when parent selection is not allowed
49
+ - `node-id`
50
+ - Defines the id of the node
51
+ - `child-count`
52
+ - Defines the number of children of the node
53
+ - `focused`
54
+ - Defines whether if the node is focused
55
+ - `readonly`
56
+ - Defines whether if the node is in readonly mode
57
+ - `type`
58
+ - Defines the type of the node
59
+ - Possible value are: `checkbox`, `radio`
60
+ - `disabled`
61
+ - Defines whether if the input of the node is disabled
62
+
63
+ ## Properties - TreeNode
64
+
65
+ - `text`, `expanded`, `selectionState`, `nodeId`, `childCount`, `focused`, `readonly`, `type`, `disabled`
66
+ - Reflects the corresponding attribute
67
+ - `depth` **_number (default=0)_**
68
+ - Defines the number of level the node is on in the tree
69
+ - `path` **_string[] (default=empty)_**
70
+ - Defines the path by which the node is reachable
71
+ - This is used to identify the nodes as one node can be present multiple times under different parents
72
+
73
+ ## Custom events - TreeNode
74
+
75
+ - `expansion`
76
+ - This event is dispatched whenever a tree node is expanded / collapsed
77
+ - `selection`
78
+ - This event is dispatched whenever a tree node is selected
79
+
80
+ ## Custom CSS Properties - TreeNode
81
+
82
+ - `--sd-tree-readonly-focus-color`
83
+ - Defines the background color of a node if it's focused in readonly mode
84
+
85
+ ## Selection
86
+
87
+ ### Parent selection is allowed
88
+
89
+ - It is enabled by setting the `parent-selection-allowed` attribute on the tree to true
90
+ - When a node is selected, then:
91
+ - For each ancestor of the node, the following happens:
92
+ - the ancestor is selected
93
+ - if it is a radio button node then all its siblings are unselected
94
+ - When a node is unselected, then:
95
+ - For each ancestor of the node, until an enabled one is found, the ancestor is unselected
96
+
97
+ ### Parent selection is not allowed
98
+
99
+ - It is enabled by setting the `parent-selection-allowed` attribute on the tree to false or removing it
100
+ - When a node is selected, then:
101
+ - The selection state of all its ancestors are updated
102
+ - All its descendants are selected
103
+ - When a node is unselected, then:
104
+ - The selection state of all its ancestors are updated
105
+ - All its descendants are unselected
106
+ - When updating the selection state of a parent node
107
+ - If a node has all of its descendants selected, then it is selected
108
+ - If a node has only some of its descendants selected, then it is in indeterminate state
109
+ - If a node has none of its descendants selected, then it is unselected
110
+
111
+ ## Examples