forked from mbraak/jqTree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tree.jquery.debug.js.map
1 lines (1 loc) · 271 KB
/
tree.jquery.debug.js.map
1
{"version":3,"file":"tree.jquery.debug.js","sources":["src/version.ts","src/position.ts","src/dragAndDropHandler/dragElement.ts","src/util.ts","src/dragAndDropHandler/iterateVisibleNodes.ts","src/dragAndDropHandler/generateHitAreas.ts","src/dragAndDropHandler/index.ts","src/elementsRenderer.ts","src/dataLoader.ts","src/keyHandler.ts","src/mouseUtils.ts","src/mouseHandler.ts","src/saveStateHandler.ts","src/scrollHandler/containerScrollParent.ts","src/scrollHandler/documentScrollParent.ts","src/scrollHandler/createScrollParent.ts","src/scrollHandler.ts","src/selectNodeHandler.ts","src/simple.widget.ts","src/nodeUtils.ts","src/node.ts","src/nodeElement/borderDropHint.ts","src/nodeElement/ghostDropHint.ts","src/nodeElement/index.ts","src/nodeElement/folderElement.ts","src/tree.jquery.ts"],"sourcesContent":["const version = \"1.8.2\";\n\nexport default version;\n","export enum Position {\n Before = 1,\n After,\n Inside,\n None,\n}\n\nconst positionNames: Record<string, Position> = {\n before: Position.Before,\n after: Position.After,\n inside: Position.Inside,\n none: Position.None,\n};\n\nexport const getPositionName = (position: Position): string => {\n for (const name in positionNames) {\n if (Object.prototype.hasOwnProperty.call(positionNames, name)) {\n if (positionNames[name] === position) {\n return name;\n }\n }\n }\n\n return \"\";\n};\n\nexport const getPosition = (name: string): Position | undefined =>\n positionNames[name];\n","interface DragElementParams {\n autoEscape: boolean;\n nodeName: string;\n offsetX: number;\n offsetY: number;\n treeElement: HTMLElement;\n}\n\nclass DragElement {\n private offsetX: number;\n private offsetY: number;\n private element: HTMLElement;\n\n constructor({\n autoEscape,\n nodeName,\n offsetX,\n offsetY,\n treeElement,\n }: DragElementParams) {\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n\n this.element = this.createElement(nodeName, autoEscape);\n\n treeElement.appendChild(this.element);\n }\n\n public move(pageX: number, pageY: number): void {\n this.element.style.left = `${pageX - this.offsetX}px`;\n this.element.style.top = `${pageY - this.offsetY}px`;\n }\n\n public remove(): void {\n this.element.remove();\n }\n\n private createElement(nodeName: string, autoEscape: boolean) {\n const element = document.createElement(\"span\");\n element.classList.add(\"jqtree-title\", \"jqtree-dragging\");\n\n if (autoEscape) {\n element.textContent = nodeName;\n } else {\n element.innerHTML = nodeName;\n }\n\n element.style.position = \"absolute\";\n\n return element;\n }\n}\n\nexport default DragElement;\n","export const isInt = (n: unknown): boolean =>\n typeof n === \"number\" && n % 1 === 0;\n\nexport const isFunction = (v: unknown): boolean => typeof v === \"function\";\n\nexport const getBoolString = (value: unknown): string =>\n value ? \"true\" : \"false\";\n\nexport const getOffsetTop = (element: HTMLElement) =>\n getElementPosition(element).top;\n\nexport const getElementPosition = (element: HTMLElement) => {\n const rect = element.getBoundingClientRect();\n\n return {\n left: rect.x + window.scrollX,\n top: rect.y + window.scrollY,\n };\n};\n","import { Node } from \"../node\";\n\ninterface Options {\n handleAfterOpenFolder: (node: Node, nextNode: Node | null) => void;\n handleClosedFolder: (\n node: Node,\n nextNode: Node | null,\n element: HTMLElement,\n ) => void;\n handleFirstNode: (node: Node) => void;\n handleNode: (\n node: Node,\n nextNode: Node | null,\n element: HTMLElement,\n ) => void;\n\n /*\n override\n return\n - true: continue iterating\n - false: stop iterating\n */\n handleOpenFolder: (node: Node, element: HTMLElement) => boolean;\n}\n\nconst iterateVisibleNodes = (\n tree: Node,\n {\n handleAfterOpenFolder,\n handleClosedFolder,\n handleFirstNode,\n handleNode,\n handleOpenFolder,\n }: Options,\n) => {\n let isFirstNode = true;\n\n const iterate = (node: Node, nextNode: Node | null): void => {\n let mustIterateInside =\n (node.is_open || !node.element) && node.hasChildren();\n\n let element: HTMLElement | null = null;\n\n // Is the element visible?\n if (node.element?.offsetParent) {\n element = node.element;\n\n if (isFirstNode) {\n handleFirstNode(node);\n isFirstNode = false;\n }\n\n if (!node.hasChildren()) {\n handleNode(node, nextNode, node.element);\n } else if (node.is_open) {\n if (!handleOpenFolder(node, node.element)) {\n mustIterateInside = false;\n }\n } else {\n handleClosedFolder(node, nextNode, element);\n }\n }\n\n if (mustIterateInside) {\n const childrenLength = node.children.length;\n node.children.forEach((_, i) => {\n const child = node.children[i];\n\n if (child) {\n if (i === childrenLength - 1) {\n iterate(child, null);\n } else {\n const nextChild = node.children[i + 1];\n\n if (nextChild) {\n iterate(child, nextChild);\n }\n }\n }\n });\n\n if (node.is_open && element) {\n handleAfterOpenFolder(node, nextNode);\n }\n }\n };\n\n iterate(tree, null);\n};\n\nexport default iterateVisibleNodes;\n","import { HitArea } from \"./types\";\nimport { Node } from \"../node\";\nimport { Position } from \"../position\";\nimport { getOffsetTop } from \"../util\";\nimport iterateVisibleNodes from \"./iterateVisibleNodes\";\n\ninterface HitPosition {\n top: number;\n node: Node;\n position: Position;\n}\n\nexport const generateHitPositions = (\n tree: Node,\n currentNode: Node,\n): HitPosition[] => {\n const hitPositions: HitPosition[] = [];\n let lastTop = 0;\n\n const addHitPosition = (node: Node, position: number, top: number) => {\n hitPositions.push({\n top,\n node,\n position,\n });\n lastTop = top;\n };\n\n const handleAfterOpenFolder = (node: Node, nextNode: Node | null) => {\n if (node === currentNode || nextNode === currentNode) {\n // Cannot move before or after current item\n addHitPosition(node, Position.None, lastTop);\n } else {\n addHitPosition(node, Position.After, lastTop);\n }\n };\n\n const handleClosedFolder = (\n node: Node,\n nextNode: Node | null,\n element: HTMLElement,\n ) => {\n const top = getOffsetTop(element);\n\n if (node === currentNode) {\n // Cannot move after current item\n addHitPosition(node, Position.None, top);\n } else {\n addHitPosition(node, Position.Inside, top);\n\n // Cannot move before current item\n if (nextNode !== currentNode) {\n addHitPosition(node, Position.After, top);\n }\n }\n };\n\n const handleFirstNode = (node: Node) => {\n if (node !== currentNode) {\n addHitPosition(node, Position.Before, getOffsetTop(node.element));\n }\n };\n\n const handleNode = (\n node: Node,\n nextNode: Node | null,\n element: HTMLElement,\n ) => {\n const top = getOffsetTop(element);\n\n if (node === currentNode) {\n // Cannot move inside current item\n addHitPosition(node, Position.None, top);\n } else {\n addHitPosition(node, Position.Inside, top);\n }\n\n if (nextNode === currentNode || node === currentNode) {\n // Cannot move before or after current item\n addHitPosition(node, Position.None, top);\n } else {\n addHitPosition(node, Position.After, top);\n }\n };\n\n const handleOpenFolder = (node: Node, element: HTMLElement) => {\n if (node === currentNode) {\n // Cannot move inside current item\n\n // Dnd over the current element is not possible: add a position with type None for the top and the bottom.\n const top = getOffsetTop(element);\n const height = element.clientHeight;\n addHitPosition(node, Position.None, top);\n\n if (height > 5) {\n // Subtract 5 pixels to allow more space for the next element.\n addHitPosition(node, Position.None, top + height - 5);\n }\n\n // Stop iterating\n return false;\n }\n\n // Cannot move before current item\n if (node.children[0] !== currentNode) {\n addHitPosition(node, Position.Inside, getOffsetTop(element));\n }\n\n // Continue iterating\n return true;\n };\n\n iterateVisibleNodes(tree, {\n handleAfterOpenFolder,\n handleClosedFolder,\n handleFirstNode,\n handleNode,\n handleOpenFolder,\n });\n\n return hitPositions;\n};\n\nexport const generateHitAreasForGroup = (\n hitAreas: HitArea[],\n positionsInGroup: HitPosition[],\n top: number,\n bottom: number,\n) => {\n // limit positions in group\n const positionCount = Math.min(positionsInGroup.length, 4);\n\n const areaHeight = Math.round((bottom - top) / positionCount);\n let areaTop = top;\n\n for (let i = 0; i < positionCount; i++) {\n const position = positionsInGroup[i] as HitPosition;\n\n if (position.position !== Position.None) {\n hitAreas.push({\n top: areaTop,\n bottom: areaTop + areaHeight,\n node: position.node,\n position: position.position,\n });\n }\n\n areaTop += areaHeight;\n }\n};\n\nexport const generateHitAreasFromPositions = (\n hitPositions: HitPosition[],\n treeBottom: number,\n): HitArea[] => {\n if (!hitPositions.length) {\n return [];\n }\n\n let previousTop = (hitPositions[0] as HitPosition).top;\n let group: HitPosition[] = [];\n const hitAreas: HitArea[] = [];\n\n for (const position of hitPositions) {\n if (position.top !== previousTop && group.length) {\n generateHitAreasForGroup(\n hitAreas,\n group,\n previousTop,\n position.top,\n );\n\n previousTop = position.top;\n group = [];\n }\n\n group.push(position);\n }\n\n generateHitAreasForGroup(hitAreas, group, previousTop, treeBottom);\n\n return hitAreas;\n};\n\nconst generateHitAreas = (tree: Node, currentNode: Node, treeBottom: number) =>\n generateHitAreasFromPositions(\n generateHitPositions(tree, currentNode),\n treeBottom,\n );\n\nexport default generateHitAreas;\n","import { Node } from \"../node\";\nimport { getPositionName, Position } from \"../position\";\nimport { DropHint, HitArea } from \"./types\";\nimport { PositionInfo } from \"../mouseUtils\";\nimport NodeElement from \"../nodeElement\";\nimport DragElement from \"./dragElement\";\nimport generateHitAreas from \"./generateHitAreas\";\nimport { getElementPosition } from \"../util\";\nimport {\n OnCanMove,\n OnCanMoveTo,\n OnIsMoveHandle,\n DragMethod,\n} from \"../jqtreeOptions\";\nimport {\n GetScrollLeft,\n GetTree,\n OpenNode,\n RefreshElements,\n TriggerEvent,\n} from \"../jqtreeMethodTypes\";\n\ninterface Dimensions {\n left: number;\n top: number;\n right: number;\n bottom: number;\n}\n\ntype GetNodeElement = (element: HTMLElement) => NodeElement | null;\ntype GetNodeElementForNode = (node: Node) => NodeElement;\n\ninterface DragAndDropHandlerParams {\n autoEscape?: boolean;\n getNodeElement: GetNodeElement;\n getNodeElementForNode: GetNodeElementForNode;\n getScrollLeft: GetScrollLeft;\n getTree: GetTree;\n onCanMove?: OnCanMove;\n onCanMoveTo?: OnCanMoveTo;\n onDragMove?: DragMethod;\n onDragStop?: DragMethod;\n onIsMoveHandle?: OnIsMoveHandle;\n openFolderDelay: number | false;\n openNode: OpenNode;\n refreshElements: RefreshElements;\n slide: boolean;\n treeElement: HTMLElement;\n triggerEvent: TriggerEvent;\n}\n\nexport class DragAndDropHandler {\n public hitAreas: HitArea[];\n public isDragging: boolean;\n public currentItem: NodeElement | null;\n public hoveredArea: HitArea | null;\n\n private autoEscape?: boolean;\n private dragElement: DragElement | null;\n private getNodeElement: GetNodeElement;\n private getNodeElementForNode: GetNodeElementForNode;\n private getScrollLeft: GetScrollLeft;\n private getTree: GetTree;\n private onCanMove?: OnCanMove;\n private onCanMoveTo?: OnCanMoveTo;\n private onDragMove?: DragMethod;\n private onDragStop?: DragMethod;\n private onIsMoveHandle?: OnIsMoveHandle;\n private openFolderDelay: number | false;\n private openFolderTimer: number | null;\n private openNode: OpenNode;\n private previousGhost: DropHint | null;\n private refreshElements: RefreshElements;\n private slide: boolean;\n private treeElement: HTMLElement;\n private triggerEvent: TriggerEvent;\n\n constructor({\n autoEscape,\n getNodeElement,\n getNodeElementForNode,\n getScrollLeft,\n getTree,\n onCanMove,\n onCanMoveTo,\n onDragMove,\n onDragStop,\n onIsMoveHandle,\n openNode,\n refreshElements,\n slide,\n treeElement,\n triggerEvent,\n }: DragAndDropHandlerParams) {\n this.autoEscape = autoEscape;\n this.getNodeElement = getNodeElement;\n this.getNodeElementForNode = getNodeElementForNode;\n this.getScrollLeft = getScrollLeft;\n this.getTree = getTree;\n this.onCanMove = onCanMove;\n this.onCanMoveTo = onCanMoveTo;\n this.onDragMove = onDragMove;\n this.onDragStop = onDragStop;\n this.onIsMoveHandle = onIsMoveHandle;\n this.openNode = openNode;\n this.refreshElements = refreshElements;\n this.slide = slide;\n this.treeElement = treeElement;\n this.triggerEvent = triggerEvent;\n\n this.hoveredArea = null;\n this.hitAreas = [];\n this.isDragging = false;\n this.currentItem = null;\n }\n\n public mouseCapture(positionInfo: PositionInfo): boolean | null {\n const element = positionInfo.target;\n\n if (!this.mustCaptureElement(element)) {\n return null;\n }\n\n if (this.onIsMoveHandle && !this.onIsMoveHandle(jQuery(element))) {\n return null;\n }\n\n let nodeElement = this.getNodeElement(element);\n\n if (nodeElement && this.onCanMove) {\n if (!this.onCanMove(nodeElement.node)) {\n nodeElement = null;\n }\n }\n\n this.currentItem = nodeElement;\n return this.currentItem != null;\n }\n\n public mouseStart(positionInfo: PositionInfo): boolean {\n if (!this.currentItem) {\n return false;\n }\n\n this.refresh();\n\n const { left, top } = getElementPosition(positionInfo.target);\n\n const node = this.currentItem.node;\n\n this.dragElement = new DragElement({\n autoEscape: this.autoEscape ?? true,\n nodeName: node.name,\n offsetX: positionInfo.pageX - left,\n offsetY: positionInfo.pageY - top,\n treeElement: this.treeElement,\n });\n\n this.isDragging = true;\n this.currentItem.element.classList.add(\"jqtree-moving\");\n\n return true;\n }\n\n public mouseDrag(positionInfo: PositionInfo): boolean {\n if (!this.currentItem || !this.dragElement) {\n return false;\n }\n\n this.dragElement.move(positionInfo.pageX, positionInfo.pageY);\n\n const area = this.findHoveredArea(\n positionInfo.pageX,\n positionInfo.pageY,\n );\n\n if (area && this.canMoveToArea(area)) {\n if (!area.node.isFolder()) {\n this.stopOpenFolderTimer();\n }\n\n if (this.hoveredArea !== area) {\n this.hoveredArea = area;\n\n // If this is a closed folder, start timer to open it\n if (this.mustOpenFolderTimer(area)) {\n this.startOpenFolderTimer(area.node);\n } else {\n this.stopOpenFolderTimer();\n }\n\n this.updateDropHint();\n }\n } else {\n this.removeDropHint();\n this.stopOpenFolderTimer();\n this.hoveredArea = area;\n }\n\n if (!area) {\n if (this.onDragMove) {\n this.onDragMove(\n this.currentItem.node,\n positionInfo.originalEvent,\n );\n }\n }\n\n return true;\n }\n\n public mouseStop(positionInfo: PositionInfo): boolean {\n this.moveItem(positionInfo);\n this.clear();\n this.removeHover();\n this.removeDropHint();\n this.removeHitAreas();\n\n const currentItem = this.currentItem;\n\n if (this.currentItem) {\n this.currentItem.element.classList.remove(\"jqtree-moving\");\n this.currentItem = null;\n }\n\n this.isDragging = false;\n\n if (!this.hoveredArea && currentItem) {\n if (this.onDragStop) {\n this.onDragStop(currentItem.node, positionInfo.originalEvent);\n }\n }\n\n return false;\n }\n\n public refresh(): void {\n this.removeHitAreas();\n\n if (this.currentItem) {\n this.generateHitAreas();\n\n this.currentItem = this.getNodeElementForNode(\n this.currentItem.node,\n );\n\n if (this.isDragging) {\n this.currentItem.element.classList.add(\"jqtree-moving\");\n }\n }\n }\n\n private generateHitAreas(): void {\n const tree = this.getTree();\n\n if (!this.currentItem || !tree) {\n this.hitAreas = [];\n } else {\n this.hitAreas = generateHitAreas(\n tree,\n this.currentItem.node,\n this.getTreeDimensions().bottom,\n );\n }\n }\n\n private mustCaptureElement(element: HTMLElement): boolean {\n const nodeName = element.nodeName;\n\n return (\n nodeName !== \"INPUT\" &&\n nodeName !== \"SELECT\" &&\n nodeName !== \"TEXTAREA\"\n );\n }\n\n private canMoveToArea(area: HitArea): boolean {\n if (!this.onCanMoveTo) {\n return true;\n }\n\n if (!this.currentItem) {\n return false;\n }\n\n const positionName = getPositionName(area.position);\n\n return this.onCanMoveTo(this.currentItem.node, area.node, positionName);\n }\n\n private removeHitAreas(): void {\n this.hitAreas = [];\n }\n\n private clear(): void {\n if (this.dragElement) {\n this.dragElement.remove();\n this.dragElement = null;\n }\n }\n\n private removeDropHint(): void {\n if (this.previousGhost) {\n this.previousGhost.remove();\n }\n }\n\n private removeHover(): void {\n this.hoveredArea = null;\n }\n\n private findHoveredArea(x: number, y: number): HitArea | null {\n const dimensions = this.getTreeDimensions();\n\n if (\n x < dimensions.left ||\n y < dimensions.top ||\n x > dimensions.right ||\n y > dimensions.bottom\n ) {\n return null;\n }\n\n let low = 0;\n let high = this.hitAreas.length;\n while (low < high) {\n const mid = (low + high) >> 1;\n const area = this.hitAreas[mid];\n\n if (!area) {\n return null;\n }\n\n if (y < area.top) {\n high = mid;\n } else if (y > area.bottom) {\n low = mid + 1;\n } else {\n return area;\n }\n }\n\n return null;\n }\n\n private mustOpenFolderTimer(area: HitArea): boolean {\n const node = area.node;\n\n return (\n node.isFolder() &&\n !node.is_open &&\n area.position === Position.Inside\n );\n }\n\n private updateDropHint(): void {\n if (!this.hoveredArea) {\n return;\n }\n\n // remove previous drop hint\n this.removeDropHint();\n\n // add new drop hint\n const nodeElement = this.getNodeElementForNode(this.hoveredArea.node);\n this.previousGhost = nodeElement.addDropHint(this.hoveredArea.position);\n }\n\n private startOpenFolderTimer(folder: Node): void {\n const openFolder = (): void => {\n this.openNode(folder, this.slide, () => {\n this.refresh();\n this.updateDropHint();\n });\n };\n\n this.stopOpenFolderTimer();\n\n const openFolderDelay = this.openFolderDelay;\n\n if (openFolderDelay !== false) {\n this.openFolderTimer = window.setTimeout(\n openFolder,\n openFolderDelay,\n );\n }\n }\n\n private stopOpenFolderTimer(): void {\n if (this.openFolderTimer) {\n clearTimeout(this.openFolderTimer);\n this.openFolderTimer = null;\n }\n }\n\n private moveItem(positionInfo: PositionInfo): void {\n if (\n this.currentItem &&\n this.hoveredArea &&\n this.hoveredArea.position !== Position.None &&\n this.canMoveToArea(this.hoveredArea)\n ) {\n const movedNode = this.currentItem.node;\n const targetNode = this.hoveredArea.node;\n const position = this.hoveredArea.position;\n const previousParent = movedNode.parent;\n\n if (position === Position.Inside) {\n this.hoveredArea.node.is_open = true;\n }\n\n const doMove = (): void => {\n const tree = this.getTree();\n\n if (tree) {\n tree.moveNode(movedNode, targetNode, position);\n\n this.treeElement.textContent = \"\";\n this.refreshElements(null);\n }\n };\n\n const event = this.triggerEvent(\"tree.move\", {\n move_info: {\n moved_node: movedNode,\n target_node: targetNode,\n position: getPositionName(position),\n previous_parent: previousParent,\n do_move: doMove,\n original_event: positionInfo.originalEvent,\n },\n });\n\n if (!event.isDefaultPrevented()) {\n doMove();\n }\n }\n }\n\n private getTreeDimensions(): Dimensions {\n // Return the dimensions of the tree. Add a margin to the bottom to allow\n // to drag-and-drop after the last element.\n const treePosition = getElementPosition(this.treeElement);\n const left = treePosition.left + this.getScrollLeft();\n const top = treePosition.top;\n\n return {\n left,\n top,\n right: left + this.treeElement.clientWidth,\n bottom: top + this.treeElement.clientHeight + 16,\n };\n }\n}\n","import { getBoolString } from \"./util\";\nimport { Node } from \"./node\";\nimport { IconElement, OnCreateLi } from \"./jqtreeOptions\";\nimport { GetTree, IsNodeSelected } from \"./jqtreeMethodTypes\";\n\ninterface ElementsRendererParams {\n autoEscape: boolean;\n buttonLeft: boolean;\n closedIcon?: IconElement;\n dragAndDrop: boolean;\n $element: JQuery<HTMLElement>;\n getTree: GetTree;\n isNodeSelected: IsNodeSelected;\n onCreateLi?: OnCreateLi;\n openedIcon?: IconElement;\n rtl?: boolean;\n showEmptyFolder: boolean;\n tabIndex?: number;\n}\n\nexport default class ElementsRenderer {\n public openedIconElement?: HTMLElement | Text;\n public closedIconElement?: HTMLElement | Text;\n private autoEscape: boolean;\n private buttonLeft: boolean;\n private dragAndDrop: boolean;\n private $element: JQuery<HTMLElement>;\n private getTree: GetTree;\n private isNodeSelected: IsNodeSelected;\n private onCreateLi?: OnCreateLi;\n private rtl?: boolean;\n private showEmptyFolder: boolean;\n private tabIndex?: number;\n\n constructor({\n autoEscape,\n buttonLeft,\n closedIcon,\n onCreateLi,\n dragAndDrop,\n $element,\n getTree,\n isNodeSelected,\n openedIcon,\n rtl,\n showEmptyFolder,\n tabIndex,\n }: ElementsRendererParams) {\n this.autoEscape = autoEscape;\n this.buttonLeft = buttonLeft;\n this.dragAndDrop = dragAndDrop;\n this.$element = $element;\n this.getTree = getTree;\n this.isNodeSelected = isNodeSelected;\n this.onCreateLi = onCreateLi;\n this.rtl = rtl;\n this.showEmptyFolder = showEmptyFolder;\n this.tabIndex = tabIndex;\n this.openedIconElement = this.createButtonElement(openedIcon || \"+\");\n this.closedIconElement = this.createButtonElement(closedIcon || \"-\");\n }\n\n public render(fromNode: Node | null): void {\n if (fromNode && fromNode.parent) {\n this.renderFromNode(fromNode);\n } else {\n this.renderFromRoot();\n }\n }\n\n public renderFromRoot(): void {\n this.$element.empty();\n\n const tree = this.getTree();\n\n if (this.$element[0] && tree) {\n this.createDomElements(this.$element[0], tree.children, true, 1);\n }\n }\n\n public renderFromNode(node: Node): void {\n // remember current li\n const $previousLi = jQuery(node.element);\n\n // create element\n const li = this.createLi(node, node.getLevel());\n this.attachNodeData(node, li);\n\n // add element to dom\n $previousLi.after(li);\n\n // remove previous li\n $previousLi.remove();\n\n // create children\n if (node.children) {\n this.createDomElements(\n li,\n node.children,\n false,\n node.getLevel() + 1,\n );\n }\n }\n\n private createDomElements(\n element: Element,\n children: Node[],\n isRootNode: boolean,\n level: number,\n ): void {\n const ul = this.createUl(isRootNode);\n element.appendChild(ul);\n\n for (const child of children) {\n const li = this.createLi(child, level);\n ul.appendChild(li);\n\n this.attachNodeData(child, li);\n\n if (child.hasChildren()) {\n this.createDomElements(li, child.children, false, level + 1);\n }\n }\n }\n\n private attachNodeData(node: Node, li: HTMLElement): void {\n node.element = li;\n jQuery(li).data(\"node\", node);\n }\n\n private createUl(isRootNode: boolean): HTMLUListElement {\n let classString;\n let role;\n\n if (!isRootNode) {\n classString = \"\";\n role = \"group\";\n } else {\n classString = \"jqtree-tree\";\n role = \"tree\";\n\n if (this.rtl) {\n classString += \" jqtree-rtl\";\n }\n }\n\n if (this.dragAndDrop) {\n classString += \" jqtree-dnd\";\n }\n\n const ul = document.createElement(\"ul\");\n ul.className = `jqtree_common ${classString}`;\n\n ul.setAttribute(\"role\", role);\n\n return ul;\n }\n\n private createLi(node: Node, level: number): HTMLLIElement {\n const isSelected = Boolean(this.isNodeSelected(node));\n\n const mustShowFolder =\n node.isFolder() || (node.isEmptyFolder && this.showEmptyFolder);\n\n const li = mustShowFolder\n ? this.createFolderLi(node, level, isSelected)\n : this.createNodeLi(node, level, isSelected);\n\n if (this.onCreateLi) {\n this.onCreateLi(node, jQuery(li), isSelected);\n }\n\n return li;\n }\n\n private setTreeItemAriaAttributes(\n element: HTMLElement,\n name: string,\n level: number,\n isSelected: boolean,\n ) {\n element.setAttribute(\"aria-label\", name);\n element.setAttribute(\"aria-level\", `${level}`);\n element.setAttribute(\"aria-selected\", getBoolString(isSelected));\n element.setAttribute(\"role\", \"treeitem\");\n }\n\n private createFolderLi(\n node: Node,\n level: number,\n isSelected: boolean,\n ): HTMLLIElement {\n const buttonClasses = this.getButtonClasses(node);\n const folderClasses = this.getFolderClasses(node, isSelected);\n\n const iconElement = node.is_open\n ? this.openedIconElement\n : this.closedIconElement;\n\n // li\n const li = document.createElement(\"li\");\n li.className = `jqtree_common ${folderClasses}`;\n li.setAttribute(\"role\", \"none\");\n\n // div\n const div = document.createElement(\"div\");\n div.className = \"jqtree-element jqtree_common\";\n div.setAttribute(\"role\", \"none\");\n\n li.appendChild(div);\n\n // button link\n const buttonLink = document.createElement(\"a\");\n buttonLink.className = buttonClasses;\n\n if (iconElement) {\n buttonLink.appendChild(iconElement.cloneNode(true));\n }\n\n if (this.buttonLeft) {\n div.appendChild(buttonLink);\n }\n\n // title span\n const titleSpan = this.createTitleSpan(\n node.name,\n isSelected,\n true,\n level,\n );\n titleSpan.setAttribute(\"aria-expanded\", getBoolString(node.is_open));\n div.appendChild(titleSpan);\n\n if (!this.buttonLeft) {\n div.appendChild(buttonLink);\n }\n\n return li;\n }\n\n private createNodeLi(\n node: Node,\n level: number,\n isSelected: boolean,\n ): HTMLLIElement {\n const liClasses = [\"jqtree_common\"];\n\n if (isSelected) {\n liClasses.push(\"jqtree-selected\");\n }\n\n const classString = liClasses.join(\" \");\n\n // li\n const li = document.createElement(\"li\");\n li.className = classString;\n li.setAttribute(\"role\", \"none\");\n\n // div\n const div = document.createElement(\"div\");\n div.className = \"jqtree-element jqtree_common\";\n div.setAttribute(\"role\", \"none\");\n\n li.appendChild(div);\n\n // title span\n const titleSpan = this.createTitleSpan(\n node.name,\n isSelected,\n false,\n level,\n );\n div.appendChild(titleSpan);\n\n return li;\n }\n\n private createTitleSpan(\n nodeName: string,\n isSelected: boolean,\n isFolder: boolean,\n level: number,\n ): HTMLSpanElement {\n const titleSpan = document.createElement(\"span\");\n\n let classes = \"jqtree-title jqtree_common\";\n\n if (isFolder) {\n classes += \" jqtree-title-folder\";\n }\n\n classes += ` jqtree-title-button-${this.buttonLeft ? \"left\" : \"right\"}`;\n\n titleSpan.className = classes;\n\n if (isSelected) {\n const tabIndex = this.tabIndex;\n\n if (tabIndex !== undefined) {\n titleSpan.setAttribute(\"tabindex\", `${tabIndex}`);\n }\n }\n\n this.setTreeItemAriaAttributes(titleSpan, nodeName, level, isSelected);\n\n if (this.autoEscape) {\n titleSpan.textContent = nodeName;\n } else {\n titleSpan.innerHTML = nodeName;\n }\n\n return titleSpan;\n }\n\n private getButtonClasses(node: Node): string {\n const classes = [\"jqtree-toggler\", \"jqtree_common\"];\n\n if (!node.is_open) {\n classes.push(\"jqtree-closed\");\n }\n\n if (this.buttonLeft) {\n classes.push(\"jqtree-toggler-left\");\n } else {\n classes.push(\"jqtree-toggler-right\");\n }\n\n return classes.join(\" \");\n }\n\n private getFolderClasses(node: Node, isSelected: boolean): string {\n const classes = [\"jqtree-folder\"];\n\n if (!node.is_open) {\n classes.push(\"jqtree-closed\");\n }\n\n if (isSelected) {\n classes.push(\"jqtree-selected\");\n }\n\n if (node.is_loading) {\n classes.push(\"jqtree-loading\");\n }\n\n return classes.join(\" \");\n }\n\n private createButtonElement(\n value: IconElement,\n ): HTMLElement | Text | undefined {\n if (typeof value === \"string\") {\n // convert value to html\n const div = document.createElement(\"div\");\n div.innerHTML = value;\n\n return document.createTextNode(div.innerHTML);\n } else if (value == null) {\n return undefined;\n } else if ((value as HTMLElement).nodeType) {\n return value as HTMLElement;\n } else {\n return jQuery(value)[0];\n }\n }\n}\n","import { Node } from \"./node\";\nimport { DataFilter, OnLoadFailed, OnLoading } from \"./jqtreeOptions\";\nimport { LoadData, TriggerEvent } from \"./jqtreeMethodTypes\";\n\nexport type HandleFinishedLoading = () => void;\n\ninterface DataLoaderParams {\n dataFilter?: DataFilter;\n loadData: LoadData;\n onLoadFailed?: OnLoadFailed;\n onLoading?: OnLoading;\n treeElement: HTMLElement;\n triggerEvent: TriggerEvent;\n}\n\nexport default class DataLoader {\n private dataFilter?: DataFilter;\n private loadData: LoadData;\n private onLoadFailed?: OnLoadFailed;\n private onLoading?: OnLoading;\n private treeElement: HTMLElement;\n private triggerEvent: TriggerEvent;\n\n constructor({\n dataFilter,\n loadData,\n onLoadFailed,\n onLoading,\n treeElement,\n triggerEvent,\n }: DataLoaderParams) {\n this.dataFilter = dataFilter;\n this.loadData = loadData;\n this.onLoadFailed = onLoadFailed;\n this.onLoading = onLoading;\n this.treeElement = treeElement;\n this.triggerEvent = triggerEvent;\n }\n\n public loadFromUrl(\n urlInfo: string | JQuery.AjaxSettings | null,\n parentNode: Node | null,\n onFinished: HandleFinishedLoading | null,\n ): void {\n if (!urlInfo) {\n return;\n }\n\n const element = this.getDomElement(parentNode);\n this.addLoadingClass(element);\n this.notifyLoading(true, parentNode, element);\n\n const stopLoading = (): void => {\n this.removeLoadingClass(element);\n this.notifyLoading(false, parentNode, element);\n };\n\n const handleSuccess = (data: string | NodeData[]): void => {\n stopLoading();\n this.loadData(this.parseData(data), parentNode);\n\n if (onFinished && typeof onFinished === \"function\") {\n onFinished();\n }\n };\n\n const handleError = (jqXHR: JQuery.jqXHR): void => {\n stopLoading();\n\n if (this.onLoadFailed) {\n this.onLoadFailed(jqXHR);\n }\n };\n\n this.submitRequest(urlInfo, handleSuccess, handleError);\n }\n\n private addLoadingClass(element: HTMLElement): void {\n element.classList.add(\"jqtree-loading\");\n }\n\n private removeLoadingClass(element: HTMLElement): void {\n element.classList.remove(\"jqtree-loading\");\n }\n\n private getDomElement(parentNode: Node | null): HTMLElement {\n if (parentNode) {\n return parentNode.element;\n } else {\n return this.treeElement;\n }\n }\n\n private notifyLoading(\n isLoading: boolean,\n node: Node | null,\n element: HTMLElement,\n ): void {\n const $el = jQuery(element);\n\n if (this.onLoading) {\n this.onLoading(isLoading, node, $el);\n }\n\n this.triggerEvent(\"tree.loading_data\", {\n isLoading,\n node,\n $el,\n });\n }\n\n private submitRequest(\n urlInfoInput: string | JQuery.AjaxSettings,\n handleSuccess: JQuery.Ajax.SuccessCallback<any>,\n handleError: JQuery.Ajax.ErrorCallback<any>,\n ): void {\n const urlInfo =\n typeof urlInfoInput === \"string\"\n ? { url: urlInfoInput }\n : urlInfoInput;\n\n const ajaxSettings: JQuery.AjaxSettings = {\n method: \"GET\",\n cache: false,\n dataType: \"json\",\n success: handleSuccess,\n error: handleError,\n ...urlInfo,\n };\n\n ajaxSettings.method = ajaxSettings.method?.toUpperCase() || \"GET\";\n\n void jQuery.ajax(ajaxSettings);\n }\n\n private parseData(data: string | NodeData[]): NodeData[] {\n const getParsedData = () => {\n if (typeof data === \"string\") {\n return JSON.parse(data) as NodeData[];\n } else {\n return data;\n }\n };\n\n const parsedData = getParsedData();\n\n if (this.dataFilter) {\n return this.dataFilter(parsedData);\n } else {\n return parsedData;\n }\n }\n}\n","import { Node } from \"./node\";\nimport {\n CloseNode,\n GetSelectedNode,\n IsFocusOnTree,\n OpenNode,\n SelectNode,\n} from \"./jqtreeMethodTypes\";\n\ntype KeyboardEventHandler = (event: KeyboardEvent) => boolean;\n\ninterface KeyHandlerParams {\n closeNode: CloseNode;\n getSelectedNode: GetSelectedNode;\n isFocusOnTree: IsFocusOnTree;\n keyboardSupport: boolean;\n openNode: OpenNode;\n selectNode: SelectNode;\n}\n\nexport default class KeyHandler {\n private closeNode: CloseNode;\n private getSelectedNode: GetSelectedNode;\n private handleKeyDownHandler?: KeyboardEventHandler;\n private isFocusOnTree: IsFocusOnTree;\n private keyboardSupport: boolean;\n private openNode: OpenNode;\n private originalSelectNode: SelectNode;\n\n constructor({\n closeNode,\n getSelectedNode,\n isFocusOnTree,\n keyboardSupport,\n openNode,\n selectNode,\n }: KeyHandlerParams) {\n this.closeNode = closeNode;\n this.getSelectedNode = getSelectedNode;\n this.isFocusOnTree = isFocusOnTree;\n this.keyboardSupport = keyboardSupport;\n this.openNode = openNode;\n this.originalSelectNode = selectNode;\n\n if (keyboardSupport) {\n this.handleKeyDownHandler = this.handleKeyDown.bind(this);\n\n document.addEventListener(\"keydown\", this.handleKeyDownHandler);\n }\n }\n\n public deinit(): void {\n if (this.handleKeyDownHandler) {\n document.removeEventListener(\"keydown\", this.handleKeyDownHandler);\n }\n }\n\n public moveDown(selectedNode: Node): boolean {\n return this.selectNode(selectedNode.getNextVisibleNode());\n }\n\n public moveUp(selectedNode: Node): boolean {\n return this.selectNode(selectedNode.getPreviousVisibleNode());\n }\n\n public moveRight(selectedNode: Node): boolean {\n if (!selectedNode.isFolder()) {\n return true;\n } else {\n // folder node\n if (selectedNode.is_open) {\n // Right moves to the first child of an open node\n return this.selectNode(selectedNode.getNextVisibleNode());\n } else {\n // Right expands a closed node\n this.openNode(selectedNode);\n return false;\n }\n }\n }\n\n public moveLeft(selectedNode: Node): boolean {\n if (selectedNode.isFolder() && selectedNode.is_open) {\n // Left on an open node closes the node\n this.closeNode(selectedNode);\n return false;\n } else {\n // Left on a closed or end node moves focus to the node's parent\n return this.selectNode(selectedNode.getParent());\n }\n }\n\n public selectNode(node: Node | null): boolean {\n if (!node) {\n return true;\n } else {\n this.originalSelectNode(node);\n\n return false;\n }\n }\n\n private handleKeyDown = (e: KeyboardEvent): boolean => {\n if (!this.canHandleKeyboard()) {\n return true;\n }\n\n const selectedNode = this.getSelectedNode();\n if (!selectedNode) {\n return true;\n }\n\n switch (e.key) {\n case \"ArrowDown\":\n return this.moveDown(selectedNode);\n\n case \"ArrowUp\":\n return this.moveUp(selectedNode);\n\n case \"ArrowRight\":\n return this.moveRight(selectedNode);\n\n case \"ArrowLeft\":\n return this.moveLeft(selectedNode);\n\n default:\n return true;\n }\n };\n\n private canHandleKeyboard(): boolean {\n return this.keyboardSupport && this.isFocusOnTree();\n }\n}\n","export interface PositionInfo {\n originalEvent: Event;\n pageX: number;\n pageY: number;\n target: HTMLElement;\n}\n\nexport const getPositionInfoFromMouseEvent = (e: MouseEvent): PositionInfo => ({\n originalEvent: e,\n pageX: e.pageX,\n pageY: e.pageY,\n target: e.target as HTMLElement,\n});\n\nexport const getPositionInfoFromTouch = (\n touch: Touch,\n e: TouchEvent,\n): PositionInfo => ({\n originalEvent: e,\n pageX: touch.pageX,\n pageY: touch.pageY,\n target: touch.target as HTMLElement,\n});\n","import {\n getPositionInfoFromMouseEvent,\n getPositionInfoFromTouch,\n PositionInfo,\n} from \"./mouseUtils\";\nimport { Node } from \"./node\";\nimport { TriggerEvent } from \"./jqtreeMethodTypes\";\n\ninterface ClickTarget {\n node: Node;\n type: \"button\" | \"label\";\n}\n\ntype GetNode = (element: HTMLElement) => null | Node;\n\ninterface MouseHandlerParams {\n element: HTMLElement;\n getMouseDelay: () => number;\n getNode: GetNode;\n onClickButton: (node: Node) => void;\n onClickTitle: (node: Node) => void;\n onMouseCapture: (positionInfo: PositionInfo) => boolean | null;\n onMouseDrag: (positionInfo: PositionInfo) => void;\n onMouseStart: (positionInfo: PositionInfo) => boolean;\n onMouseStop: (positionInfo: PositionInfo) => void;\n triggerEvent: TriggerEvent;\n useContextMenu: boolean;\n}\n\nclass MouseHandler {\n private element: HTMLElement;\n private getMouseDelay: () => number;\n private getNode: GetNode;\n private isMouseDelayMet: boolean;\n private isMouseStarted: boolean;\n private mouseDelayTimer: number | null;\n private mouseDownInfo: PositionInfo | null;\n private onClickButton: (node: Node) => void;\n private onClickTitle: (node: Node) => void;\n private onMouseCapture: (positionInfo: PositionInfo) => boolean | null;\n private onMouseDrag: (positionInfo: PositionInfo) => void;\n private onMouseStart: (positionInfo: PositionInfo) => boolean;\n private onMouseStop: (positionInfo: PositionInfo) => void;\n private triggerEvent: TriggerEvent;\n private useContextMenu: boolean;\n\n constructor({\n element,\n getMouseDelay,\n getNode,\n onClickButton,\n onClickTitle,\n onMouseCapture,\n onMouseDrag,\n onMouseStart,\n onMouseStop,\n triggerEvent,\n useContextMenu,\n }: MouseHandlerParams) {\n this.element = element;\n this.getMouseDelay = getMouseDelay;\n this.getNode = getNode;\n this.onClickButton = onClickButton;\n this.onClickTitle = onClickTitle;\n this.onMouseCapture = onMouseCapture;\n this.onMouseDrag = onMouseDrag;\n this.onMouseStart = onMouseStart;\n this.onMouseStop = onMouseStop;\n this.triggerEvent = triggerEvent;\n this.useContextMenu = useContextMenu;\n\n element.addEventListener(\"click\", this.handleClick);\n element.addEventListener(\"dblclick\", this.handleDblclick);\n element.addEventListener(\"mousedown\", this.mouseDown, {\n passive: false,\n });\n element.addEventListener(\"touchstart\", this.touchStart, {\n passive: false,\n });\n\n if (useContextMenu) {\n element.addEventListener(\"contextmenu\", this.handleContextmenu);\n }\n\n this.isMouseStarted = false;\n this.mouseDelayTimer = null;\n this.isMouseDelayMet = false;\n this.mouseDownInfo = null;\n }\n\n public deinit(): void {\n this.element.removeEventListener(\"click\", this.handleClick);\n this.element.removeEventListener(\"dblclick\", this.handleDblclick);\n\n if (this.useContextMenu) {\n this.element.removeEventListener(\n \"contextmenu\",\n this.handleContextmenu,\n );\n }\n\n this.element.removeEventListener(\"mousedown\", this.mouseDown);\n this.element.removeEventListener(\"touchstart\", this.touchStart);\n this.removeMouseMoveEventListeners();\n }\n\n private mouseDown = (e: MouseEvent): void => {\n // Left mouse button?\n if (e.button !== 0) {\n return;\n }\n\n const result = this.handleMouseDown(getPositionInfoFromMouseEvent(e));\n\n if (result && e.cancelable) {\n e.preventDefault();\n }\n };\n\n private handleMouseDown(positionInfo: PositionInfo): boolean {\n // We may have missed mouseup (out of window)\n if (this.isMouseStarted) {\n this.handleMouseUp(positionInfo);\n }\n\n this.mouseDownInfo = positionInfo;\n\n if (!this.onMouseCapture(positionInfo)) {\n return false;\n }\n\n this.handleStartMouse();\n\n return true;\n }\n\n private handleStartMouse(): void {\n document.addEventListener(\"mousemove\", this.mouseMove, {\n passive: false,\n });\n document.addEventListener(\"touchmove\", this.touchMove, {\n passive: false,\n });\n document.addEventListener(\"mouseup\", this.mouseUp, { passive: false });\n document.addEventListener(\"touchend\", this.touchEnd, {\n passive: false,\n });\n\n const mouseDelay = this.getMouseDelay();\n\n if (mouseDelay) {\n this.startMouseDelayTimer(mouseDelay);\n } else {\n this.isMouseDelayMet = true;\n }\n }\n\n private startMouseDelayTimer(mouseDelay: number): void {\n if (this.mouseDelayTimer) {\n clearTimeout(this.mouseDelayTimer);\n }\n\n this.mouseDelayTimer = window.setTimeout(() => {\n if (this.mouseDownInfo) {\n this.isMouseDelayMet = true;\n }\n }, mouseDelay);\n\n this.isMouseDelayMet = false;\n }\n\n private mouseMove = (e: MouseEvent): void => {\n this.handleMouseMove(e, getPositionInfoFromMouseEvent(e));\n };\n\n private handleMouseMove(\n e: MouseEvent | TouchEvent,\n positionInfo: PositionInfo,\n ): void {\n if (this.isMouseStarted) {\n this.onMouseDrag(positionInfo);\n\n if (e.cancelable) {\n e.preventDefault();\n }\n return;\n }\n\n if (!this.isMouseDelayMet) {\n return;\n }\n\n if (this.mouseDownInfo) {\n this.isMouseStarted =\n this.onMouseStart(this.mouseDownInfo) !== false;\n }\n\n if (this.isMouseStarted) {\n this.onMouseDrag(positionInfo);\n\n if (e.cancelable) {\n e.preventDefault();\n }\n } else {\n this.handleMouseUp(positionInfo);\n }\n }\n\n private mouseUp = (e: MouseEvent): void => {\n this.handleMouseUp(getPositionInfoFromMouseEvent(e));\n };\n\n private handleMouseUp(positionInfo: PositionInfo): void {\n this.removeMouseMoveEventListeners();\n this.isMouseDelayMet = false;\n this.mouseDownInfo = null;\n\n if (this.isMouseStarted) {\n this.isMouseStarted = false;\n this.onMouseStop(positionInfo);\n }\n }\n\n private removeMouseMoveEventListeners() {\n document.removeEventListener(\"mousemove\", this.mouseMove);\n document.removeEventListener(\"touchmove\", this.touchMove);\n document.removeEventListener(\"mouseup\", this.mouseUp);\n document.removeEventListener(\"touchend\", this.touchEnd);\n }\n\n private touchStart = (e: TouchEvent): void => {\n if (!e) {\n return;\n }\n\n if (e.touches.length > 1) {\n return;\n }\n\n const touch = e.touches[0];\n\n if (!touch) {\n return;\n }\n\n this.handleMouseDown(getPositionInfoFromTouch(touch, e));\n };\n\n private touchMove = (e: TouchEvent): void => {\n if (!e) {\n return;\n }\n\n if (e.touches.length > 1) {\n return;\n }\n\n const touch = e.touches[0];\n\n if (!touch) {\n return;\n }\n\n this.handleMouseMove(e, getPositionInfoFromTouch(touch, e));\n };\n\n private touchEnd = (e: TouchEvent): void => {\n if (!e) {\n return;\n }\n\n if (e.touches.length > 1) {\n return;\n }\n\n const touch = e.touches[0];\n\n if (!touch) {\n return;\n }\n\n this.handleMouseUp(getPositionInfoFromTouch(touch, e));\n };\n\n private handleClick = (e: MouseEvent): void => {\n if (!e.target) {\n return;\n }\n\n const clickTarget = this.getClickTarget(e.target as HTMLElement);\n\n if (!clickTarget) {\n return;\n }\n\n if (clickTarget.type === \"button\") {\n this.onClickButton(clickTarget.node);\n\n e.preventDefault();\n e.stopPropagation();\n } else if (clickTarget.type === \"label\") {\n const event = this.triggerEvent(\"tree.click\", {\n node: clickTarget.node,\n click_event: e,\n });\n\n if (!event.isDefaultPrevented()) {\n this.onClickTitle(clickTarget.node);\n }\n }\n };\n\n private handleDblclick = (e: MouseEvent): void => {\n if (!e.target) {\n return;\n }\n\n const clickTarget = this.getClickTarget(e.target as HTMLElement);\n\n if (clickTarget?.type === \"label\") {\n this.triggerEvent(\"tree.dblclick\", {\n node: clickTarget.node,\n click_event: e,\n });\n }\n };\n\n private handleContextmenu = (e: MouseEvent) => {\n if (!e.target) {\n return;\n }\n\n const div = (e.target as HTMLElement).closest<HTMLElement>(\n \"ul.jqtree-tree .jqtree-element\",\n );\n\n if (div) {\n const node = this.getNode(div);\n if (node) {\n e.preventDefault();\n e.stopPropagation();\n\n this.triggerEvent(\"tree.contextmenu\", {\n node,\n click_event: e,\n });\n return false;\n }\n }\n\n return null;\n };\n\n private getClickTarget(element: HTMLElement): ClickTarget | null {\n const button = element.closest<HTMLElement>(\".jqtree-toggler\");\n\n if (button) {\n const node = this.getNode(button);\n\n if (node) {\n return {\n type: \"button\",\n node,\n };\n }\n } else {\n const jqTreeElement =\n element.closest<HTMLElement>(\".jqtree-element\");\n\n if (jqTreeElement) {\n const node = this.getNode(jqTreeElement);\n if (node) {\n return {\n type: \"label\",\n node,\n };\n }\n }\n }\n\n return null;\n }\n}\n\nexport default MouseHandler;\n","import { isInt } from \"./util\";\nimport { Node } from \"./node\";\nimport { OnGetStateFromStorage, OnSetStateFromStorage } from \"./jqtreeOptions\";\nimport {\n AddToSelection,\n GetNodeById,\n GetSelectedNodes,\n GetTree,\n OpenNode,\n RefreshElements,\n RemoveFromSelection,\n} from \"./jqtreeMethodTypes\";\n\nexport interface SavedState {\n open_nodes: NodeId[];\n selected_node: NodeId[];\n}\n\ninterface SaveStateHandlerParams {\n addToSelection: AddToSelection;\n getNodeById: GetNodeById;\n getSelectedNodes: GetSelectedNodes;\n getTree: GetTree;\n onGetStateFromStorage?: OnGetStateFromStorage;\n onSetStateFromStorage?: OnSetStateFromStorage;\n openNode: OpenNode;\n refreshElements: RefreshElements;\n removeFromSelection: RemoveFromSelection;\n saveState: boolean | string;\n}\n\nexport default class SaveStateHandler {\n private addToSelection: AddToSelection;\n private getNodeById: GetNodeById;\n private getSelectedNodes: GetSelectedNodes;\n private getTree: GetTree;\n private onGetStateFromStorage?: OnGetStateFromStorage;\n private onSetStateFromStorage?: OnSetStateFromStorage;\n private openNode: OpenNode;\n private refreshElements: RefreshElements;\n private removeFromSelection: RemoveFromSelection;\n private saveStateOption: boolean | string;\n private _supportsLocalStorage: boolean | null;\n\n constructor({\n addToSelection,\n getNodeById,\n getSelectedNodes,\n getTree,\n onGetStateFromStorage,\n onSetStateFromStorage,\n openNode,\n refreshElements,\n removeFromSelection,\n saveState,\n }: SaveStateHandlerParams) {\n this.addToSelection = addToSelection;\n this.getNodeById = getNodeById;\n this.getSelectedNodes = getSelectedNodes;\n this.getTree = getTree;\n this.onGetStateFromStorage = onGetStateFromStorage;\n this.onSetStateFromStorage = onSetStateFromStorage;\n this.openNode = openNode;\n this.refreshElements = refreshElements;\n this.removeFromSelection = removeFromSelection;\n this.saveStateOption = saveState;\n }\n\n public saveState(): void {\n const state = JSON.stringify(this.getState());\n\n if (this.onSetStateFromStorage) {\n this.onSetStateFromStorage(state);\n } else if (this.supportsLocalStorage()) {\n localStorage.setItem(this.getKeyName(), state);\n }\n }\n\n public getStateFromStorage(): SavedState | null {\n const jsonData = this.loadFromStorage();\n\n if (jsonData) {\n return this.parseState(jsonData) as unknown as SavedState;\n } else {\n return null;\n }\n }\n\n public getState(): SavedState {\n const getOpenNodeIds = (): NodeId[] => {\n const openNodes: NodeId[] = [];\n\n this.getTree()?.iterate((node: Node) => {\n if (node.is_open && node.id && node.hasChildren()) {\n openNodes.push(node.id);\n }\n return true;\n });\n\n return openNodes;\n };\n\n const getSelectedNodeIds = (): NodeId[] => {\n const selectedNodeIds: NodeId[] = [];\n\n this.getSelectedNodes().forEach((node) => {\n if (node.id != null) {\n selectedNodeIds.push(node.id);\n }\n });\n\n return selectedNodeIds;\n };\n\n return {\n open_nodes: getOpenNodeIds(),\n selected_node: getSelectedNodeIds(),\n };\n }\n\n /*\n Set initial state\n Don't handle nodes that are loaded on demand\n\n result: must load on demand\n */\n public setInitialState(state: SavedState): boolean {\n if (!state) {\n return false;\n } else {\n let mustLoadOnDemand = false;\n\n if (state.open_nodes) {\n mustLoadOnDemand = this.openInitialNodes(state.open_nodes);\n }\n\n if (state.selected_node) {\n this.resetSelection();\n this.selectInitialNodes(state.selected_node);\n }\n\n return mustLoadOnDemand;\n }\n }\n\n public setInitialStateOnDemand(\n state: SavedState,\n cbFinished: () => void,\n ): void {\n let loadingCount = 0;\n let nodeIds = state.open_nodes;\n\n const openNodes = (): void => {\n const newNodesIds = [];\n\n for (const nodeId of nodeIds) {\n const node = this.getNodeById(nodeId);\n\n if (!node) {\n newNodesIds.push(nodeId);\n } else {\n if (!node.is_loading) {\n if (node.load_on_demand) {\n loadAndOpenNode(node);\n } else {\n this.openNode(node, false);\n }\n }\n }\n }\n\n nodeIds = newNodesIds;\n\n if (this.selectInitialNodes(state.selected_node)) {\n this.refreshElements(null);\n }\n\n if (loadingCount === 0) {\n cbFinished();\n }\n };\n\n const loadAndOpenNode = (node: Node): void => {\n loadingCount += 1;\n this.openNode(node, false, () => {\n loadingCount -= 1;\n openNodes();\n });\n };\n\n openNodes();\n }\n\n public getNodeIdToBeSelected(): NodeId | null {\n const state = this.getStateFromStorage();\n\n if (state?.selected_node) {\n return state.selected_node[0] || null;\n } else {\n return null;\n }\n }\n\n private parseState(jsonData: string): SavedState {\n const state = JSON.parse(jsonData) as Record<string, unknown>;\n\n // Check if selected_node is an int (instead of an array)\n if (state && state.selected_node && isInt(state.selected_node)) {\n // Convert to array\n state.selected_node = [state.selected_node];\n }\n\n return state as unknown as SavedState;\n }\n\n private loadFromStorage(): string | null {\n if (this.onGetStateFromStorage) {\n return this.onGetStateFromStorage();\n } else if (this.supportsLocalStorage()) {\n return localStorage.getItem(this.getKeyName());\n } else {\n return null;\n }\n }\n\n private openInitialNodes(nodeIds: NodeId[]): boolean {\n let mustLoadOnDemand = false;\n\n for (const nodeId of nodeIds) {\n const node = this.getNodeById(nodeId);\n\n if (node) {\n if (!node.load_on_demand) {\n node.is_open = true;\n } else {\n mustLoadOnDemand = true;\n }\n }\n }\n\n return mustLoadOnDemand;\n }\n\n private selectInitialNodes(nodeIds: NodeId[]): boolean {\n let selectCount = 0;\n\n for (const nodeId of nodeIds) {\n const node = this.getNodeById(nodeId);\n\n if (node) {\n selectCount += 1;\n\n this.addToSelection(node);\n }\n }\n\n return selectCount !== 0;\n }\n\n private resetSelection(): void {\n const selectedNodes = this.getSelectedNodes();\n\n selectedNodes.forEach((node) => {\n this.removeFromSelection(node);\n });\n }\n\n private getKeyName(): string {\n if (typeof this.saveStateOption === \"string\") {\n return this.saveStateOption;\n } else {\n return \"tree\";\n }\n }\n\n private supportsLocalStorage(): boolean {\n const testSupport = (): boolean => {\n // Is local storage supported?\n if (localStorage == null) {\n return false;\n } else {\n // Check if it's possible to store an item. Safari does not allow this in private browsing mode.\n try {\n const key = \"_storage_test\";\n sessionStorage.setItem(key, \"value\");\n sessionStorage.removeItem(key);\n } catch (error) {\n return false;\n }\n\n return true;\n }\n };\n\n if (this._supportsLocalStorage == null) {\n this._supportsLocalStorage = testSupport();\n }\n\n return this._supportsLocalStorage;\n }\n}\n","import type { ScrollParent } from \"./types\";\nimport { getElementPosition, getOffsetTop } from '../util'\n\ntype HorizontalScrollDirection = \"left\" | \"right\";\ntype VerticalScrollDirection = \"bottom\" | \"top\";\n\ninterface Params {\n container: HTMLElement;\n refreshHitAreas: () => void;\n}\n\nexport default class ContainerScrollParent implements ScrollParent {\n private container: HTMLElement;\n private horizontalScrollDirection?: HorizontalScrollDirection;\n private horizontalScrollTimeout?: number;\n private refreshHitAreas: () => void;\n private scrollParentBottom?: number;\n private scrollParentTop?: number;\n private verticalScrollTimeout?: number;\n private verticalScrollDirection?: VerticalScrollDirection;\n\n constructor({ container, refreshHitAreas }: Params) {\n this.container = container;\n this.refreshHitAreas = refreshHitAreas;\n }\n\n public checkHorizontalScrolling(pageX: number): void {\n const newHorizontalScrollDirection =\n this.getNewHorizontalScrollDirection(pageX);\n\n if (this.horizontalScrollDirection !== newHorizontalScrollDirection) {\n this.horizontalScrollDirection = newHorizontalScrollDirection;\n\n if (this.horizontalScrollTimeout != null) {\n window.clearTimeout(this.verticalScrollTimeout);\n }\n\n if (newHorizontalScrollDirection) {\n this.horizontalScrollTimeout = window.setTimeout(\n this.scrollHorizontally.bind(this),\n 40,\n );\n }\n }\n }\n\n public checkVerticalScrolling(pageY: number) {\n const newVerticalScrollDirection =\n this.getNewVerticalScrollDirection(pageY);\n\n if (this.verticalScrollDirection !== newVerticalScrollDirection) {\n this.verticalScrollDirection = newVerticalScrollDirection;\n\n if (this.verticalScrollTimeout != null) {\n window.clearTimeout(this.verticalScrollTimeout);\n this.verticalScrollTimeout = undefined;\n }\n\n if (newVerticalScrollDirection) {\n this.verticalScrollTimeout = window.setTimeout(\n this.scrollVertically.bind(this),\n 40,\n );\n }\n }\n }\n\n public getScrollLeft(): number {\n return this.container.scrollLeft;\n }\n\n public scrollToY(top: number): void {\n this.container.scrollTop = top;\n }\n\n public stopScrolling() {\n this.horizontalScrollDirection = undefined;\n this.verticalScrollDirection = undefined;\n this.scrollParentTop = undefined;\n this.scrollParentBottom = undefined;\n }\n\n private getNewHorizontalScrollDirection(\n pageX: number,\n ): HorizontalScrollDirection | undefined {\n const scrollParentOffset = getElementPosition(this.container);\n\n const rightEdge = scrollParentOffset.left + this.container.clientWidth;\n const leftEdge = scrollParentOffset.left;\n const isNearRightEdge = pageX > rightEdge - 20;\n const isNearLeftEdge = pageX < leftEdge + 20;\n\n if (isNearRightEdge) {\n return \"right\";\n } else if (isNearLeftEdge) {\n return \"left\";\n }\n\n return undefined;\n }\n\n private getNewVerticalScrollDirection(\n pageY: number,\n ): VerticalScrollDirection | undefined {\n if (pageY < this.getScrollParentTop()) {\n return \"top\";\n }\n\n if (pageY > this.getScrollParentBottom()) {\n return \"bottom\";\n }\n\n return undefined;\n }\n\n private scrollHorizontally() {\n if (!this.horizontalScrollDirection) {\n return;\n }\n\n const distance = this.horizontalScrollDirection === \"left\" ? -20 : 20;\n\n this.container.scrollBy({\n left: distance,\n top: 0,\n behavior: \"instant\",\n });\n\n this.refreshHitAreas();\n\n setTimeout(this.scrollHorizontally.bind(this), 40);\n }\n\n private scrollVertically() {\n if (!this.verticalScrollDirection) {\n return;\n }\n\n const distance = this.verticalScrollDirection === \"top\" ? -20 : 20;\n\n this.container.scrollBy({\n left: 0,\n top: distance,\n behavior: \"instant\",\n });\n\n this.refreshHitAreas();\n\n setTimeout(this.scrollVertically.bind(this), 40);\n }\n\n private getScrollParentTop() {\n if (this.scrollParentTop == null) {\n this.scrollParentTop = getOffsetTop(this.container)\n }\n\n return this.scrollParentTop;\n }\n\n private getScrollParentBottom() {\n if (this.scrollParentBottom == null) {\n this.scrollParentBottom = this.getScrollParentTop() + this.container.clientHeight;\n }\n\n return this.scrollParentBottom;\n }\n}\n","import type { ScrollParent } from \"./types\";\nimport { getOffsetTop } from '../util'\n\ntype HorizontalScrollDirection = \"left\" | \"right\";\ntype VerticalScrollDirection = \"bottom\" | \"top\";\n\ninterface Params {\n refreshHitAreas: () => void;\n treeElement: HTMLElement;\n}\n\nexport default class DocumentScrollParent implements ScrollParent {\n private documentScrollHeight?: number;\n private documentScrollWidth?: number;\n private horizontalScrollDirection?: HorizontalScrollDirection;\n private horizontalScrollTimeout?: number;\n private refreshHitAreas: () => void;\n private treeElement: HTMLElement;\n private verticalScrollDirection?: VerticalScrollDirection;\n private verticalScrollTimeout?: number;\n\n constructor({ refreshHitAreas, treeElement }: Params) {\n this.refreshHitAreas = refreshHitAreas;\n this.treeElement = treeElement;\n }\n\n public checkHorizontalScrolling(pageX: number): void {\n const newHorizontalScrollDirection =\n this.getNewHorizontalScrollDirection(pageX);\n\n if (this.horizontalScrollDirection !== newHorizontalScrollDirection) {\n this.horizontalScrollDirection = newHorizontalScrollDirection;\n\n if (this.horizontalScrollTimeout != null) {\n window.clearTimeout(this.horizontalScrollTimeout);\n }\n\n if (newHorizontalScrollDirection) {\n this.horizontalScrollTimeout = window.setTimeout(\n this.scrollHorizontally.bind(this),\n 40,\n );\n }\n }\n }\n\n public checkVerticalScrolling(pageY: number) {\n const newVerticalScrollDirection =\n this.getNewVerticalScrollDirection(pageY);\n\n if (this.verticalScrollDirection !== newVerticalScrollDirection) {\n this.verticalScrollDirection = newVerticalScrollDirection;\n\n if (this.verticalScrollTimeout != null) {\n window.clearTimeout(this.verticalScrollTimeout);\n this.verticalScrollTimeout = undefined;\n }\n\n if (newVerticalScrollDirection) {\n this.verticalScrollTimeout = window.setTimeout(\n this.scrollVertically.bind(this),\n 40,\n );\n }\n }\n }\n\n public getScrollLeft(): number {\n return document.documentElement.scrollLeft;\n }\n\n public scrollToY(top: number): void {\n const treeTop = getOffsetTop(this.treeElement);\n\n document.documentElement.scrollTop = top + treeTop;\n }\n\n public stopScrolling() {\n this.horizontalScrollDirection = undefined;\n this.verticalScrollDirection = undefined;\n this.documentScrollHeight = undefined;\n this.documentScrollWidth = undefined;\n }\n\n private getNewHorizontalScrollDirection(\n pageX: number,\n ): HorizontalScrollDirection | undefined {\n const scrollLeft = document.documentElement.scrollLeft;\n const windowWidth = window.innerWidth;\n\n const isNearRightEdge = pageX > windowWidth - 20;\n const isNearLeftEdge = pageX - scrollLeft < 20;\n\n if (isNearRightEdge && this.canScrollRight()) {\n return \"right\";\n }\n\n if (isNearLeftEdge) {\n return \"left\";\n }\n\n return undefined;\n }\n\n private canScrollRight() {\n const documentElement = document.documentElement;\n\n return (\n documentElement.scrollLeft + documentElement.clientWidth <\n this.getDocumentScrollWidth()\n );\n }\n\n private canScrollDown() {\n const documentElement = document.documentElement;\n\n return (\n documentElement.scrollTop + documentElement.clientHeight <\n this.getDocumentScrollHeight()\n );\n }\n\n private getDocumentScrollHeight() {\n // Store the original scroll height because the scroll height can increase when the drag element is moved beyond the scroll height.\n if (this.documentScrollHeight == null) {\n this.documentScrollHeight = document.documentElement.scrollHeight;\n }\n\n return this.documentScrollHeight;\n }\n\n private getDocumentScrollWidth() {\n // Store the original scroll width because the scroll width can increase when the drag element is moved beyond the scroll width.\n if (this.documentScrollWidth == null) {\n this.documentScrollWidth = document.documentElement.scrollWidth;\n }\n\n return this.documentScrollWidth;\n }\n\n private getNewVerticalScrollDirection(\n pageY: number,\n ): VerticalScrollDirection | undefined {\n const scrollTop = jQuery(document).scrollTop() || 0;\n const distanceTop = pageY - scrollTop;\n\n if (distanceTop < 20) {\n return \"top\";\n }\n\n const windowHeight = window.innerHeight;\n\n if (windowHeight - (pageY - scrollTop) < 20 && this.canScrollDown()) {\n return \"bottom\";\n }\n\n return undefined;\n }\n\n private scrollHorizontally() {\n if (!this.horizontalScrollDirection) {\n return;\n }\n\n const distance = this.horizontalScrollDirection === \"left\" ? -20 : 20;\n window.scrollBy({ left: distance, top: 0, behavior: \"instant\" });\n\n this.refreshHitAreas();\n\n setTimeout(this.scrollHorizontally.bind(this), 40);\n }\n\n private scrollVertically() {\n if (!this.verticalScrollDirection) {\n return;\n }\n\n const distance = this.verticalScrollDirection === \"top\" ? -20 : 20;\n window.scrollBy({ left: 0, top: distance, behavior: \"instant\" });\n\n this.refreshHitAreas();\n\n setTimeout(this.scrollVertically.bind(this), 40);\n }\n}\n","import type { ScrollParent } from \"./types\";\nimport ContainerScrollParent from \"./containerScrollParent\";\nimport DocumentScrollParent from \"./documentScrollParent\";\n\nconst isOverflow = (overflowValue: string) =>\n overflowValue === \"auto\" || overflowValue === \"scroll\";\n\nconst hasOverFlow = (element: HTMLElement): boolean => {\n const style = getComputedStyle(element);\n\n return isOverflow(style.overflowX) || isOverflow(style.overflowY);\n};\n\nconst getParentWithOverflow = (\n treeElement: HTMLElement,\n): HTMLElement | null => {\n if (hasOverFlow(treeElement)) {\n return treeElement;\n }\n\n let parent = treeElement.parentElement;\n\n while (parent) {\n if (hasOverFlow(parent)) {\n return parent;\n }\n\n parent = parent.parentElement;\n }\n\n return null;\n};\n\nconst createScrollParent = (\n treeElement: HTMLElement,\n refreshHitAreas: () => void,\n): ScrollParent => {\n const container = getParentWithOverflow(treeElement);\n\n if (container && container.tagName !== \"HTML\") {\n return new ContainerScrollParent({\n container,\n refreshHitAreas,\n });\n } else {\n return new DocumentScrollParent({ refreshHitAreas, treeElement });\n }\n};\n\nexport default createScrollParent;\n","import { PositionInfo } from \"./mouseUtils\";\nimport { ScrollParent } from \"./scrollHandler/types\";\nimport createScrollParent from \"./scrollHandler/createScrollParent\";\n\ninterface ScrollHandlerParams {\n refreshHitAreas: () => void;\n treeElement: HTMLElement;\n}\n\nexport default class ScrollHandler {\n private refreshHitAreas: () => void;\n private scrollParent?: ScrollParent;\n private treeElement: HTMLElement;\n\n constructor({ refreshHitAreas, treeElement }: ScrollHandlerParams) {\n this.refreshHitAreas = refreshHitAreas;\n this.scrollParent = undefined;\n this.treeElement = treeElement;\n }\n\n public checkScrolling(positionInfo: PositionInfo): void {\n this.checkVerticalScrolling(positionInfo);\n this.checkHorizontalScrolling(positionInfo);\n }\n\n public stopScrolling() {\n this.getScrollParent().stopScrolling();\n }\n\n public scrollToY(top: number): void {\n this.getScrollParent().scrollToY(top);\n }\n\n public getScrollLeft(): number {\n return this.getScrollParent().getScrollLeft();\n }\n\n private checkVerticalScrolling(positionInfo: PositionInfo): void {\n this.getScrollParent().checkVerticalScrolling(positionInfo.pageY);\n }\n\n private checkHorizontalScrolling(positionInfo: PositionInfo): void {\n this.getScrollParent().checkHorizontalScrolling(positionInfo.pageX);\n }\n\n private getScrollParent(): ScrollParent {\n if (!this.scrollParent) {\n this.scrollParent = createScrollParent(\n this.treeElement,\n this.refreshHitAreas,\n );\n }\n\n return this.scrollParent;\n }\n}\n","import { Node } from \"./node\";\nimport { GetNodeById } from \"./jqtreeMethodTypes\";\n\ninterface SelectNodeHandlerParameters {\n getNodeById: GetNodeById;\n}\n\nexport default class SelectNodeHandler {\n private getNodeById: GetNodeById;\n private selectedNodes: Set<NodeId>;\n private selectedSingleNode: Node | null;\n\n constructor({ getNodeById }: SelectNodeHandlerParameters) {\n this.getNodeById = getNodeById;\n this.selectedNodes = new Set<NodeId>();\n this.clear();\n }\n\n public getSelectedNode(): Node | false {\n const selectedNodes = this.getSelectedNodes();\n\n if (selectedNodes.length) {\n return selectedNodes[0] || false;\n } else {\n return false;\n }\n }\n\n public getSelectedNodes(): Node[] {\n if (this.selectedSingleNode) {\n return [this.selectedSingleNode];\n } else {\n const selectedNodes: Node[] = [];\n\n this.selectedNodes.forEach((id) => {\n const node = this.getNodeById(id);\n if (node) {\n selectedNodes.push(node);\n }\n });\n\n return selectedNodes;\n }\n }\n\n public getSelectedNodesUnder(parent: Node): Node[] {\n if (this.selectedSingleNode) {\n if (parent.isParentOf(this.selectedSingleNode)) {\n return [this.selectedSingleNode];\n } else {\n return [];\n }\n } else {\n const selectedNodes = [];\n\n for (const id in this.selectedNodes) {\n if (\n Object.prototype.hasOwnProperty.call(this.selectedNodes, id)\n ) {\n const node = this.getNodeById(id);\n if (node && parent.isParentOf(node)) {\n selectedNodes.push(node);\n }\n }\n }\n\n return selectedNodes;\n }\n }\n\n public isNodeSelected(node: Node): boolean {\n if (node.id != null) {\n return this.selectedNodes.has(node.id);\n } else if (this.selectedSingleNode) {\n return this.selectedSingleNode.element === node.element;\n } else {\n return false;\n }\n }\n\n public clear(): void {\n this.selectedNodes.clear();\n this.selectedSingleNode = null;\n }\n\n public removeFromSelection(node: Node, includeChildren = false): void {\n if (node.id == null) {\n if (\n this.selectedSingleNode &&\n node.element === this.selectedSingleNode.element\n ) {\n this.selectedSingleNode = null;\n }\n } else {\n this.selectedNodes.delete(node.id);\n\n if (includeChildren) {\n node.iterate(() => {\n if (node.id != null) {\n this.selectedNodes.delete(node.id);\n }\n return true;\n });\n }\n }\n }\n\n public addToSelection(node: Node): void {\n if (node.id != null) {\n this.selectedNodes.add(node.id);\n } else {\n this.selectedSingleNode = node;\n }\n }\n}\n","const register = (widgetClass: unknown, widgetName: string): void => {\n const getDataKey = (): string => `simple_widget_${widgetName}`;\n\n const getWidgetData = (\n el: HTMLElement,\n dataKey: string\n ): SimpleWidget<unknown> | null => {\n const widget = jQuery.data(el, dataKey) as unknown;\n\n if (widget && widget instanceof SimpleWidget) {\n return widget;\n } else {\n return null;\n }\n };\n\n const createWidget = ($el: JQuery, options: unknown): JQuery => {\n const dataKey = getDataKey();\n\n for (const el of $el.get()) {\n const existingWidget = getWidgetData(el, dataKey);\n\n if (!existingWidget) {\n const simpleWidgetClass = widgetClass as typeof SimpleWidget;\n const widget = new simpleWidgetClass(el, options);\n\n if (!jQuery.data(el, dataKey)) {\n jQuery.data(el, dataKey, widget);\n }\n\n // Call init after setting data, so we can call methods\n widget.init();\n }\n }\n\n return $el;\n };\n\n const destroyWidget = ($el: JQuery): void => {\n const dataKey = getDataKey();\n\n for (const el of $el.get()) {\n const widget = getWidgetData(el, dataKey);\n\n if (widget) {\n widget.destroy();\n }\n\n jQuery.removeData(el, dataKey);\n }\n };\n\n const callFunction = (\n $el: JQuery,\n functionName: string,\n args: unknown[]\n ): unknown => {\n let result = null;\n\n for (const el of $el.get()) {\n const widget = jQuery.data(el, getDataKey()) as unknown;\n\n if (widget && widget instanceof SimpleWidget) {\n const simpleWidget = widget as SimpleWidget<unknown>;\n const widgetFunction = simpleWidget[functionName];\n\n if (widgetFunction && typeof widgetFunction === \"function\") {\n result = widgetFunction.apply(widget, args) as unknown;\n }\n }\n }\n\n return result;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n (jQuery.fn as any)[widgetName] = function (\n this: JQuery,\n argument1: unknown,\n ...args: unknown[]\n ) {\n if (!argument1) {\n return createWidget(this, null);\n } else if (typeof argument1 === \"object\") {\n const options = argument1 as unknown;\n return createWidget(this, options);\n } else if (typeof argument1 === \"string\" && argument1[0] !== \"_\") {\n const functionName = argument1;\n\n if (functionName === \"destroy\") {\n return destroyWidget(this);\n } else if (functionName === \"get_widget_class\") {\n return widgetClass;\n } else {\n return callFunction(this, functionName, args);\n }\n } else {\n return undefined;\n }\n };\n};\n\nexport default class SimpleWidget<WidgetOptions> {\n public static register(widgetClass: unknown, widgetName: string): void {\n register(widgetClass, widgetName);\n }\n\n [key: string]: unknown;\n\n protected static defaults: unknown = {};\n\n public options: WidgetOptions;\n\n public $el: JQuery<HTMLElement>;\n\n constructor(el: HTMLElement, options: WidgetOptions) {\n this.$el = jQuery(el);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const defaults = (this.constructor as any)[\"defaults\"] as WidgetOptions;\n this.options = { ...defaults, ...options };\n }\n\n public destroy(): void {\n this.deinit();\n }\n\n public init(): void {\n //\n }\n\n public deinit(): void {\n //\n }\n}\n","interface NodeRecordWithChildren extends NodeRecord {\n children: NodeData[];\n}\n\nexport const isNodeRecordWithChildren = (\n data: NodeData,\n): data is NodeRecordWithChildren =>\n typeof data === \"object\" &&\n \"children\" in data &&\n data[\"children\"] instanceof Array;\n","import { isNodeRecordWithChildren } from \"./nodeUtils\";\nimport { Position } from \"./position\";\n\ntype IterateCallback = (node: Node, level: number) => boolean;\n\nexport class Node implements INode {\n public id?: NodeId;\n public name: string;\n public children: Node[];\n public parent: Node | null;\n public idMapping: Map<NodeId, Node>;\n public tree?: Node;\n public nodeClass?: typeof Node;\n public load_on_demand: boolean;\n public is_open: boolean;\n public element: HTMLElement;\n public is_loading: boolean;\n public isEmptyFolder: boolean;\n\n [key: string]: unknown;\n\n constructor(\n nodeData: NodeData | null = null,\n isRoot = false,\n nodeClass = Node,\n ) {\n this.name = \"\";\n this.load_on_demand = false;\n\n this.isEmptyFolder =\n nodeData != null &&\n isNodeRecordWithChildren(nodeData) &&\n nodeData.children.length === 0;\n\n this.setData(nodeData);\n\n this.children = [];\n this.parent = null;\n\n if (isRoot) {\n this.idMapping = new Map<NodeId, Node>();\n this.tree = this;\n this.nodeClass = nodeClass;\n }\n }\n\n /*\n Set the data of this node.\n\n setData(string): set the name of the node\n setData(object): set attributes of the node\n\n Examples:\n setData('node1')\n\n setData({ name: 'node1', id: 1});\n\n setData({ name: 'node2', id: 2, color: 'green'});\n\n * This is an internal function; it is not in the docs\n * Does not remove existing node values\n */\n public setData(o: NodeData | null): void {\n if (!o) {\n return;\n } else if (typeof o === \"string\") {\n this.name = o;\n } else if (typeof o === \"object\") {\n for (const key in o) {\n if (Object.prototype.hasOwnProperty.call(o, key)) {\n const value = o[key];\n\n if (key === \"label\" || key === \"name\") {\n // You can use the 'label' key instead of 'name'; this is a legacy feature\n if (typeof value === \"string\") {\n this.name = value;\n }\n } else if (key !== \"children\" && key !== \"parent\") {\n // You can't update the children or the parent using this function\n this[key] = value;\n }\n }\n }\n }\n }\n\n /*\n Create tree from data.\n\n Structure of data is:\n [\n {\n name: 'node1',\n children: [\n { name: 'child1' },\n { name: 'child2' }\n ]\n },\n {\n name: 'node2'\n }\n ]\n */\n public loadFromData(data: NodeData[]): Node {\n this.removeChildren();\n\n for (const childData of data) {\n const node = this.createNode(childData);\n this.addChild(node);\n\n if (isNodeRecordWithChildren(childData)) {\n node.loadFromData(childData.children);\n }\n }\n\n return this;\n }\n\n /*\n Add child.\n\n tree.addChild(\n new Node('child1')\n );\n */\n public addChild(node: Node): void {\n this.children.push(node);\n node.setParent(this);\n }\n\n /*\n Add child at position. Index starts at 0.\n\n tree.addChildAtPosition(\n new Node('abc'),\n 1\n );\n */\n public addChildAtPosition(node: Node, index: number): void {\n this.children.splice(index, 0, node);\n node.setParent(this);\n }\n\n /*\n Remove child. This also removes the children of the node.\n\n tree.removeChild(tree.children[0]);\n */\n public removeChild(node: Node): void {\n // remove children from the index\n node.removeChildren();\n\n this.doRemoveChild(node);\n }\n\n /*\n Get child index.\n\n var index = getChildIndex(node);\n */\n public getChildIndex(node: Node): number {\n return this.children.indexOf(node);\n }\n\n /*\n Does the tree have children?\n\n if (tree.hasChildren()) {\n //\n }\n */\n public hasChildren(): boolean {\n return this.children.length !== 0;\n }\n\n public isFolder(): boolean {\n return this.hasChildren() || this.load_on_demand;\n }\n\n /*\n Iterate over all the nodes in the tree.\n\n Calls callback with (node, level).\n\n The callback must return true to continue the iteration on current node.\n\n tree.iterate(\n function(node, level) {\n console.log(node.name);\n\n // stop iteration after level 2\n return (level <= 2);\n }\n );\n\n */\n public iterate(callback: IterateCallback): void {\n const _iterate = (node: Node, level: number): void => {\n if (node.children) {\n for (const child of node.children) {\n const result = callback(child, level);\n\n if (result && child.hasChildren()) {\n _iterate(child, level + 1);\n }\n }\n }\n };\n\n _iterate(this, 0);\n }\n\n /*\n Move node relative to another node.\n\n Argument position: Position.BEFORE, Position.AFTER or Position.Inside\n\n // move node1 after node2\n tree.moveNode(node1, node2, Position.AFTER);\n */\n public moveNode(\n movedNode: Node,\n targetNode: Node,\n position: Position,\n ): boolean {\n if (!movedNode.parent || movedNode.isParentOf(targetNode)) {\n // - Node is parent of target node\n // - Or, parent is empty\n return false;\n } else {\n movedNode.parent.doRemoveChild(movedNode);\n\n switch (position) {\n case Position.After: {\n if (targetNode.parent) {\n targetNode.parent.addChildAtPosition(\n movedNode,\n targetNode.parent.getChildIndex(targetNode) + 1,\n );\n return true;\n }\n return false;\n }\n\n case Position.Before: {\n if (targetNode.parent) {\n targetNode.parent.addChildAtPosition(\n movedNode,\n targetNode.parent.getChildIndex(targetNode),\n );\n return true;\n }\n return false;\n }\n\n case Position.Inside: {\n // move inside as first child\n targetNode.addChildAtPosition(movedNode, 0);\n return true;\n }\n\n default:\n return false;\n }\n }\n }\n\n /*\n Get the tree as data.\n */\n public getData(includeParent = false): NodeRecord[] {\n const getDataFromNodes = (nodes: Node[]): Record<string, unknown>[] => {\n return nodes.map((node) => {\n const tmpNode: Record<string, unknown> = {};\n\n for (const k in node) {\n if (\n [\n \"parent\",\n \"children\",\n \"element\",\n \"idMapping\",\n \"load_on_demand\",\n \"nodeClass\",\n \"tree\",\n \"isEmptyFolder\",\n ].indexOf(k) === -1 &&\n Object.prototype.hasOwnProperty.call(node, k)\n ) {\n const v = node[k];\n tmpNode[k] = v;\n }\n }\n\n if (node.hasChildren()) {\n tmpNode[\"children\"] = getDataFromNodes(node.children);\n }\n\n return tmpNode;\n });\n };\n\n if (includeParent) {\n return getDataFromNodes([this]);\n } else {\n return getDataFromNodes(this.children);\n }\n }\n\n public getNodeByName(name: string): Node | null {\n return this.getNodeByCallback((node: Node) => node.name === name);\n }\n\n public getNodeByNameMustExist(name: string): Node {\n const node = this.getNodeByCallback((n: Node) => n.name === name);\n\n if (!node) {\n throw `Node with name ${name} not found`;\n }\n\n return node;\n }\n\n public getNodeByCallback(callback: (node: Node) => boolean): Node | null {\n let result: Node | null = null;\n\n this.iterate((node: Node) => {\n if (result) {\n return false;\n } else if (callback(node)) {\n result = node;\n return false;\n } else {\n return true;\n }\n });\n\n return result;\n }\n\n public addAfter(nodeInfo: NodeData): Node | null {\n if (!this.parent) {\n return null;\n } else {\n const node = this.createNode(nodeInfo);\n\n const childIndex = this.parent.getChildIndex(this);\n this.parent.addChildAtPosition(node, childIndex + 1);\n\n node.loadChildrenFromData(nodeInfo);\n return node;\n }\n }\n\n public addBefore(nodeInfo: NodeData): Node | null {\n if (!this.parent) {\n return null;\n } else {\n const node = this.createNode(nodeInfo);\n\n const childIndex = this.parent.getChildIndex(this);\n this.parent.addChildAtPosition(node, childIndex);\n\n node.loadChildrenFromData(nodeInfo);\n return node;\n }\n }\n\n public addParent(nodeInfo: NodeData): Node | null {\n if (!this.parent) {\n return null;\n } else {\n const newParent = this.createNode(nodeInfo);\n\n if (this.tree) {\n newParent.setParent(this.tree);\n }\n const originalParent = this.parent;\n\n for (const child of originalParent.children) {\n newParent.addChild(child);\n }\n\n originalParent.children = [];\n originalParent.addChild(newParent);\n return newParent;\n }\n }\n\n public remove(): void {\n if (this.parent) {\n this.parent.removeChild(this);\n this.parent = null;\n }\n }\n\n public append(nodeInfo: NodeData): Node {\n const node = this.createNode(nodeInfo);\n this.addChild(node);\n\n node.loadChildrenFromData(nodeInfo);\n return node;\n }\n\n public prepend(nodeInfo: NodeData): Node {\n const node = this.createNode(nodeInfo);\n this.addChildAtPosition(node, 0);\n\n node.loadChildrenFromData(nodeInfo);\n return node;\n }\n\n public isParentOf(node: Node): boolean {\n let parent = node.parent;\n\n while (parent) {\n if (parent === this) {\n return true;\n }\n\n parent = parent.parent;\n }\n\n return false;\n }\n\n public getLevel(): number {\n let level = 0;\n let node: Node = this; // eslint-disable-line @typescript-eslint/no-this-alias\n\n while (node.parent) {\n level += 1;\n node = node.parent;\n }\n\n return level;\n }\n\n public getNodeById(nodeId: NodeId): Node | null {\n return this.idMapping.get(nodeId) || null;\n }\n\n public addNodeToIndex(node: Node): void {\n if (node.id != null) {\n this.idMapping.set(node.id, node);\n }\n }\n\n public removeNodeFromIndex(node: Node): void {\n if (node.id != null) {\n this.idMapping.delete(node.id);\n }\n }\n\n public removeChildren(): void {\n this.iterate((child: Node) => {\n this.tree?.removeNodeFromIndex(child);\n return true;\n });\n\n this.children = [];\n }\n\n public getPreviousSibling(): Node | null {\n if (!this.parent) {\n return null;\n } else {\n const previousIndex = this.parent.getChildIndex(this) - 1;\n if (previousIndex >= 0) {\n return this.parent.children[previousIndex] || null;\n } else {\n return null;\n }\n }\n }\n\n public getNextSibling(): Node | null {\n if (!this.parent) {\n return null;\n } else {\n const nextIndex = this.parent.getChildIndex(this) + 1;\n if (nextIndex < this.parent.children.length) {\n return this.parent.children[nextIndex] || null;\n } else {\n return null;\n }\n }\n }\n\n public getNodesByProperty(key: string, value: unknown): Node[] {\n return this.filter((node: Node) => node[key] === value);\n }\n\n public filter(f: (node: Node) => boolean): Node[] {\n const result: Node[] = [];\n\n this.iterate((node: Node) => {\n if (f(node)) {\n result.push(node);\n }\n\n return true;\n });\n\n return result;\n }\n\n public getNextNode(includeChildren = true): Node | null {\n if (includeChildren && this.hasChildren()) {\n return this.children[0] || null;\n } else if (!this.parent) {\n return null;\n } else {\n const nextSibling = this.getNextSibling();\n\n if (nextSibling) {\n return nextSibling;\n } else {\n return this.parent.getNextNode(false);\n }\n }\n }\n\n public getNextVisibleNode(): Node | null {\n if (this.hasChildren() && this.is_open) {\n // First child\n return this.children[0] || null;\n } else {\n if (!this.parent) {\n return null;\n } else {\n const nextSibling = this.getNextSibling();\n if (nextSibling) {\n // Next sibling\n return nextSibling;\n } else {\n // Next node of parent\n return this.parent.getNextNode(false);\n }\n }\n }\n }\n\n public getPreviousNode(): Node | null {\n if (!this.parent) {\n return null;\n } else {\n const previousSibling = this.getPreviousSibling();\n\n if (!previousSibling) {\n return this.getParent();\n } else if (previousSibling.hasChildren()) {\n return previousSibling.getLastChild();\n } else {\n return previousSibling;\n }\n }\n }\n\n public getPreviousVisibleNode(): Node | null {\n if (!this.parent) {\n return null;\n } else {\n const previousSibling = this.getPreviousSibling();\n\n if (!previousSibling) {\n return this.getParent();\n } else if (\n !previousSibling.hasChildren() ||\n !previousSibling.is_open\n ) {\n // Previous sibling\n return previousSibling;\n } else {\n // Last child of previous sibling\n return previousSibling.getLastChild();\n }\n }\n }\n\n public getParent(): Node | null {\n // Return parent except if it is the root node\n if (!this.parent) {\n return null;\n } else if (!this.parent.parent) {\n // Root node -> null\n return null;\n } else {\n return this.parent;\n }\n }\n\n public getLastChild(): Node | null {\n if (!this.hasChildren()) {\n return null;\n } else {\n const lastChild = this.children[this.children.length - 1];\n\n if (!lastChild) {\n return null;\n }\n\n if (!(lastChild.hasChildren() && lastChild.is_open)) {\n return lastChild;\n } else {\n return lastChild?.getLastChild();\n }\n }\n }\n\n // Init Node from data without making it the root of the tree\n public initFromData(data: NodeData): void {\n const addNode = (nodeData: NodeData): void => {\n this.setData(nodeData);\n\n if (\n isNodeRecordWithChildren(nodeData) &&\n nodeData.children.length\n ) {\n addChildren(nodeData.children);\n }\n };\n\n const addChildren = (childrenData: NodeData[]): void => {\n for (const child of childrenData) {\n const node = this.createNode();\n node.initFromData(child);\n this.addChild(node);\n }\n };\n\n addNode(data);\n }\n\n private setParent(parent: Node): void {\n this.parent = parent;\n this.tree = parent.tree;\n this.tree?.addNodeToIndex(this);\n }\n\n private doRemoveChild(node: Node): void {\n this.children.splice(this.getChildIndex(node), 1);\n this.tree?.removeNodeFromIndex(node);\n }\n\n private getNodeClass(): typeof Node {\n return this.nodeClass || this?.tree?.nodeClass || Node;\n }\n\n private createNode(nodeData?: NodeData): Node {\n const nodeClass = this.getNodeClass();\n return new nodeClass(nodeData);\n }\n\n // Load children data from nodeInfo if it has children\n private loadChildrenFromData(nodeInfo: NodeData) {\n if (isNodeRecordWithChildren(nodeInfo) && nodeInfo.children.length) {\n this.loadFromData(nodeInfo.children);\n }\n }\n}\n","import { DropHint } from \"../dragAndDropHandler/types\";\n\nclass BorderDropHint implements DropHint {\n private hint?: HTMLElement;\n\n constructor(element: HTMLElement, scrollLeft: number) {\n const div = element.querySelector(\":scope > .jqtree-element\");\n\n if (!div) {\n this.hint = undefined;\n return;\n }\n\n const width = Math.max(element.offsetWidth + scrollLeft - 4, 0);\n const height = Math.max(element.clientHeight - 4, 0);\n\n const hint = document.createElement(\"span\");\n hint.className = \"jqtree-border\";\n hint.style.width = `${width}px`;\n hint.style.height = `${height}px`;\n\n this.hint = hint;\n\n div.append(this.hint);\n }\n\n public remove(): void {\n this.hint?.remove();\n }\n}\n\nexport default BorderDropHint;\n","import { DropHint } from \"../dragAndDropHandler/types\";\n\nclass GhostDropHint implements DropHint {\n private element: HTMLElement;\n private ghost: HTMLElement;\n\n constructor(element: HTMLElement) {\n this.element = element;\n this.ghost = this.createGhostElement();\n\n this.element.after(this.ghost);\n this.ghost.classList.add(\"jqtree-inside\");\n }\n\n public remove(): void {\n this.ghost.remove();\n }\n\n private createGhostElement() {\n const ghost = document.createElement(\"li\");\n ghost.className = \"jqtree_common jqtree-ghost\";\n\n const circleSpan = document.createElement(\"span\");\n circleSpan.className = \"jqtree_common jqtree-circle\";\n ghost.append(circleSpan);\n\n const lineSpan = document.createElement(\"span\");\n lineSpan.className = \"jqtree_common jqtree-line\";\n ghost.append(lineSpan);\n\n return ghost;\n }\n}\n\nexport default GhostDropHint;\n","import { Node } from \"../node\";\nimport { Position } from \"../position\";\nimport { DropHint } from \"../dragAndDropHandler/types\";\nimport BorderDropHint from \"./borderDropHint\";\nimport GhostDropHint from \"./ghostDropHint\";\nimport { GetScrollLeft } from \"../jqtreeMethodTypes\";\n\nexport interface NodeElementParams {\n getScrollLeft: GetScrollLeft;\n node: Node;\n tabIndex?: number;\n $treeElement: JQuery<HTMLElement>;\n}\n\nclass NodeElement {\n public node: Node;\n public element: HTMLElement;\n private getScrollLeft: GetScrollLeft;\n private tabIndex?: number;\n private $treeElement: JQuery<HTMLElement>;\n\n constructor({\n getScrollLeft,\n node,\n tabIndex,\n $treeElement,\n }: NodeElementParams) {\n this.getScrollLeft = getScrollLeft;\n this.tabIndex = tabIndex;\n this.$treeElement = $treeElement;\n\n this.init(node);\n }\n\n public init(node: Node): void {\n this.node = node;\n\n if (!node.element) {\n const element = this.$treeElement.get(0);\n\n if (element) {\n node.element = element;\n }\n }\n\n if (node.element) {\n this.element = node.element;\n }\n }\n\n public addDropHint(position: number): DropHint {\n if (this.mustShowBorderDropHint(position)) {\n return new BorderDropHint(this.element, this.getScrollLeft());\n } else {\n return new GhostDropHint(this.element);\n }\n }\n\n public select(mustSetFocus: boolean): void {\n this.element.classList.add(\"jqtree-selected\");\n\n const titleSpan = this.getTitleSpan();\n const tabIndex = this.tabIndex;\n\n // Check for null or undefined\n if (tabIndex != null) {\n titleSpan.setAttribute(\"tabindex\", tabIndex.toString());\n }\n\n titleSpan.setAttribute(\"aria-selected\", \"true\");\n\n if (mustSetFocus) {\n titleSpan.focus();\n }\n }\n\n public deselect(): void {\n this.element.classList.remove(\"jqtree-selected\");\n\n const titleSpan = this.getTitleSpan();\n titleSpan.removeAttribute(\"tabindex\");\n titleSpan.setAttribute(\"aria-selected\", \"false\");\n\n titleSpan.blur();\n }\n\n protected getUl(): HTMLUListElement {\n return this.element.querySelector(\":scope > ul\") as HTMLUListElement;\n }\n\n protected getTitleSpan(): HTMLSpanElement {\n return this.element.querySelector(\n \":scope > .jqtree-element > span.jqtree-title\",\n ) as HTMLSpanElement;\n }\n\n protected mustShowBorderDropHint(position: Position): boolean {\n return position === Position.Inside;\n }\n}\n\nexport default NodeElement;\n","import { Position } from \"../position\";\nimport NodeElement, { NodeElementParams } from \"./index\";\nimport { OnFinishOpenNode, TriggerEvent } from \"../jqtreeMethodTypes\";\n\ninterface FolderElementParams extends NodeElementParams {\n closedIconElement?: HTMLElement | Text;\n openedIconElement?: HTMLElement | Text;\n triggerEvent: TriggerEvent;\n}\n\nclass FolderElement extends NodeElement {\n private closedIconElement?: HTMLElement | Text;\n private openedIconElement?: HTMLElement | Text;\n private triggerEvent: TriggerEvent;\n\n constructor({\n closedIconElement,\n getScrollLeft,\n node,\n openedIconElement,\n tabIndex,\n $treeElement,\n triggerEvent,\n }: FolderElementParams) {\n super({\n getScrollLeft,\n node,\n tabIndex,\n $treeElement,\n });\n\n this.closedIconElement = closedIconElement;\n this.openedIconElement = openedIconElement;\n this.triggerEvent = triggerEvent;\n }\n\n public open(\n onFinished: OnFinishOpenNode | undefined,\n slide = true,\n animationSpeed: JQuery.Duration = \"fast\",\n ): void {\n if (this.node.is_open) {\n return;\n }\n\n this.node.is_open = true;\n\n const button = this.getButton();\n button.classList.remove(\"jqtree-closed\");\n button.innerHTML = \"\";\n\n const openedIconElement = this.openedIconElement;\n\n if (openedIconElement) {\n const icon = openedIconElement.cloneNode(true);\n button.appendChild(icon);\n }\n\n const doOpen = (): void => {\n this.element.classList.remove(\"jqtree-closed\");\n\n const titleSpan = this.getTitleSpan();\n titleSpan.setAttribute(\"aria-expanded\", \"true\");\n\n if (onFinished) {\n onFinished(this.node);\n }\n\n this.triggerEvent(\"tree.open\", {\n node: this.node,\n });\n };\n\n if (slide) {\n jQuery(this.getUl()).slideDown(animationSpeed, doOpen);\n } else {\n jQuery(this.getUl()).show();\n doOpen();\n }\n }\n\n public close(\n slide = true,\n animationSpeed: JQuery.Duration | undefined = \"fast\",\n ): void {\n if (!this.node.is_open) {\n return;\n }\n\n this.node.is_open = false;\n\n const button = this.getButton();\n button.classList.add(\"jqtree-closed\");\n button.innerHTML = \"\";\n\n const closedIconElement = this.closedIconElement;\n\n if (closedIconElement) {\n const icon = closedIconElement.cloneNode(true);\n button.appendChild(icon);\n }\n\n const doClose = (): void => {\n this.element.classList.add(\"jqtree-closed\");\n\n const titleSpan = this.getTitleSpan();\n titleSpan.setAttribute(\"aria-expanded\", \"false\");\n\n this.triggerEvent(\"tree.close\", {\n node: this.node,\n });\n };\n\n if (slide) {\n jQuery(this.getUl()).slideUp(animationSpeed, doClose);\n } else {\n jQuery(this.getUl()).hide();\n doClose();\n }\n }\n\n protected mustShowBorderDropHint(position: Position): boolean {\n return !this.node.is_open && position === Position.Inside;\n }\n\n private getButton(): HTMLLinkElement {\n return this.element.querySelector(\n \":scope > .jqtree-element > a.jqtree-toggler\",\n ) as HTMLLinkElement;\n }\n}\n\nexport default FolderElement;\n","import __version__ from \"./version\";\nimport { DragAndDropHandler } from \"./dragAndDropHandler\";\nimport ElementsRenderer from \"./elementsRenderer\";\nimport DataLoader, { HandleFinishedLoading } from \"./dataLoader\";\nimport KeyHandler from \"./keyHandler\";\nimport MouseHandler from \"./mouseHandler\";\nimport { PositionInfo } from \"./mouseUtils\";\nimport SaveStateHandler, { SavedState } from \"./saveStateHandler\";\nimport ScrollHandler from \"./scrollHandler\";\nimport SelectNodeHandler from \"./selectNodeHandler\";\nimport SimpleWidget from \"./simple.widget\";\nimport { getOffsetTop, isFunction } from \"./util\";\nimport { Node } from \"./node\";\nimport { getPosition } from \"./position\";\nimport NodeElement from \"./nodeElement\";\nimport FolderElement from \"./nodeElement/folderElement\";\nimport { OnFinishOpenNode } from \"./jqtreeMethodTypes\";\nimport { JQTreeOptions } from \"./jqtreeOptions\";\n\ninterface SelectNodeOptions {\n mustToggle?: boolean;\n mustSetFocus?: boolean;\n}\n\nconst NODE_PARAM_IS_EMPTY = \"Node parameter is empty\";\nconst PARAM_IS_EMPTY = \"Parameter is empty: \";\n\nexport class JqTreeWidget extends SimpleWidget<JQTreeOptions> {\n protected static defaults: JQTreeOptions = {\n animationSpeed: \"fast\",\n autoEscape: true,\n autoOpen: false, // true / false / int (open n levels starting at 0)\n buttonLeft: true,\n // The symbol to use for a closed node - ► BLACK RIGHT-POINTING POINTER\n // http://www.fileformat.info/info/unicode/char/25ba/index.htm\n closedIcon: undefined,\n data: undefined,\n dataFilter: undefined,\n dataUrl: undefined,\n dragAndDrop: false,\n keyboardSupport: true,\n nodeClass: Node,\n onCanMove: undefined, // Can this node be moved?\n onCanMoveTo: undefined, // Can this node be moved to this position? function(moved_node, target_node, position)\n onCanSelectNode: undefined,\n onCreateLi: undefined,\n onDragMove: undefined,\n onDragStop: undefined,\n onGetStateFromStorage: undefined,\n onIsMoveHandle: undefined,\n onLoadFailed: undefined,\n onLoading: undefined,\n onSetStateFromStorage: undefined,\n openedIcon: \"▼\",\n openFolderDelay: 500, // The delay for opening a folder during drag and drop; the value is in milliseconds\n // The symbol to use for an open node - ▼ BLACK DOWN-POINTING TRIANGLE\n // http://www.fileformat.info/info/unicode/char/25bc/index.htm\n rtl: undefined, // right-to-left support; true / false (default)\n saveState: false, // true / false / string (cookie name)\n selectable: true,\n showEmptyFolder: false,\n slide: true, // must display slide animation?\n startDndDelay: 300, // The delay for starting dnd (in milliseconds)\n tabIndex: 0,\n useContextMenu: true,\n };\n\n private element: JQuery;\n private isInitialized: boolean;\n private tree: Node;\n\n private dataLoader: DataLoader;\n private dndHandler: DragAndDropHandler;\n private keyHandler: KeyHandler;\n private mouseHandler: MouseHandler;\n private renderer: ElementsRenderer;\n private saveStateHandler: SaveStateHandler;\n private scrollHandler: ScrollHandler;\n private selectNodeHandler: SelectNodeHandler;\n\n public toggle(node: Node, slideParam: null | boolean = null): JQuery {\n if (!node) {\n throw Error(NODE_PARAM_IS_EMPTY);\n }\n\n const slide = slideParam ?? this.options.slide;\n\n if (node.is_open) {\n this.closeNode(node, slide);\n } else {\n this.openNode(node, slide);\n }\n\n return this.element;\n }\n\n public getTree(): Node {\n return this.tree;\n }\n\n public selectNode(\n node: Node | null,\n optionsParam?: SelectNodeOptions,\n ): JQuery {\n this.doSelectNode(node, optionsParam);\n return this.element;\n }\n\n public getSelectedNode(): Node | false {\n return this.selectNodeHandler.getSelectedNode();\n }\n\n public toJson(): string {\n return JSON.stringify(this.tree.getData());\n }\n\n public loadData(data: NodeData[], parentNode: Node | null): JQuery {\n this.doLoadData(data, parentNode);\n return this.element;\n }\n\n /*\n signatures:\n - loadDataFromUrl(url, parent_node=null, on_finished=null)\n loadDataFromUrl('/my_data');\n loadDataFromUrl('/my_data', node1);\n loadDataFromUrl('/my_data', node1, function() { console.log('finished'); });\n loadDataFromUrl('/my_data', null, function() { console.log('finished'); });\n\n - loadDataFromUrl(parent_node=null, on_finished=null)\n loadDataFromUrl();\n loadDataFromUrl(node1);\n loadDataFromUrl(null, function() { console.log('finished'); });\n loadDataFromUrl(node1, function() { console.log('finished'); });\n */\n public loadDataFromUrl(\n param1: string | null | Node,\n param2?: Node | null | HandleFinishedLoading,\n param3?: HandleFinishedLoading,\n ): JQuery {\n if (typeof param1 === \"string\") {\n // first parameter is url\n this.doLoadDataFromUrl(\n param1,\n param2 as Node | null,\n param3 ?? null,\n );\n } else {\n // first parameter is not url\n this.doLoadDataFromUrl(\n null,\n param1,\n param2 as HandleFinishedLoading | null,\n );\n }\n\n return this.element;\n }\n\n public reload(onFinished: HandleFinishedLoading | null): JQuery {\n this.doLoadDataFromUrl(null, null, onFinished);\n return this.element;\n }\n\n public refresh(): JQuery {\n this.refreshElements(null);\n return this.element;\n }\n\n public getNodeById(nodeId: NodeId): Node | null {\n return this.tree.getNodeById(nodeId);\n }\n\n public getNodeByName(name: string): Node | null {\n return this.tree.getNodeByName(name);\n }\n\n public getNodeByNameMustExist(name: string): Node {\n return this.tree.getNodeByNameMustExist(name);\n }\n\n public getNodesByProperty(key: string, value: unknown): Node[] {\n return this.tree.getNodesByProperty(key, value);\n }\n\n public getNodeByHtmlElement(\n inputElement: HTMLElement | JQuery<HTMLElement>,\n ): Node | null {\n const element =\n inputElement instanceof HTMLElement\n ? inputElement\n : inputElement[0];\n\n if (!element) {\n return null;\n }\n\n return this.getNode(element);\n }\n\n public getNodeByCallback(callback: (node: Node) => boolean): Node | null {\n return this.tree.getNodeByCallback(callback);\n }\n\n public openNode(\n node: Node,\n param1?: boolean | OnFinishOpenNode,\n param2?: OnFinishOpenNode,\n ): JQuery {\n if (!node) {\n throw Error(NODE_PARAM_IS_EMPTY);\n }\n\n const parseParams = (): [boolean, OnFinishOpenNode | undefined] => {\n let onFinished: OnFinishOpenNode | null;\n let slide: boolean | null;\n\n if (isFunction(param1)) {\n onFinished = param1 as OnFinishOpenNode;\n slide = null;\n } else {\n slide = param1 as boolean;\n onFinished = param2 as OnFinishOpenNode;\n }\n\n if (slide == null) {\n slide = this.options.slide ?? false;\n }\n\n return [slide, onFinished];\n };\n\n const [slide, onFinished] = parseParams();\n\n this.openNodeInternal(node, slide, onFinished);\n return this.element;\n }\n\n public closeNode(node: Node, slideParam?: null | boolean): JQuery {\n if (!node) {\n throw Error(NODE_PARAM_IS_EMPTY);\n }\n\n const slide = slideParam ?? this.options.slide;\n\n if (node.isFolder() || node.isEmptyFolder) {\n this.createFolderElement(node).close(\n slide,\n this.options.animationSpeed,\n );\n\n this.saveState();\n }\n\n return this.element;\n }\n\n public isDragging(): boolean {\n return this.dndHandler.isDragging;\n }\n\n public refreshHitAreas(): JQuery {\n this.dndHandler.refresh();\n return this.element;\n }\n\n public addNodeAfter(\n newNodeInfo: NodeData,\n existingNode: Node,\n ): Node | null {\n const newNode = existingNode.addAfter(newNodeInfo);\n\n if (newNode) {\n this.refreshElements(existingNode.parent);\n }\n\n return newNode;\n }\n\n public addNodeBefore(\n newNodeInfo: NodeData,\n existingNode: Node,\n ): Node | null {\n if (!existingNode) {\n throw Error(PARAM_IS_EMPTY + \"existingNode\");\n }\n\n const newNode = existingNode.addBefore(newNodeInfo);\n\n if (newNode) {\n this.refreshElements(existingNode.parent);\n }\n\n return newNode;\n }\n\n public addParentNode(\n newNodeInfo: NodeData,\n existingNode: Node,\n ): Node | null {\n if (!existingNode) {\n throw Error(PARAM_IS_EMPTY + \"existingNode\");\n }\n\n const newNode = existingNode.addParent(newNodeInfo);\n\n if (newNode) {\n this.refreshElements(newNode.parent);\n }\n\n return newNode;\n }\n\n public removeNode(node: Node): JQuery {\n if (!node) {\n throw Error(NODE_PARAM_IS_EMPTY);\n }\n\n if (!node.parent) {\n throw Error(\"Node has no parent\");\n }\n\n this.selectNodeHandler.removeFromSelection(node, true); // including children\n\n const parent = node.parent;\n node.remove();\n this.refreshElements(parent);\n\n return this.element;\n }\n\n public appendNode(newNodeInfo: NodeData, parentNodeParam?: Node): Node {\n const parentNode = parentNodeParam || this.tree;\n\n const node = parentNode.append(newNodeInfo);\n\n this.refreshElements(parentNode);\n\n return node;\n }\n\n public prependNode(newNodeInfo: NodeData, parentNodeParam?: Node): Node {\n const parentNode = parentNodeParam ?? this.tree;\n\n const node = parentNode.prepend(newNodeInfo);\n\n this.refreshElements(parentNode);\n\n return node;\n }\n\n public updateNode(node: Node, data: NodeData): JQuery {\n if (!node) {\n throw Error(NODE_PARAM_IS_EMPTY);\n }\n\n const idIsChanged =\n typeof data === \"object\" && data.id && data.id !== node.id;\n\n if (idIsChanged) {\n this.tree.removeNodeFromIndex(node);\n }\n\n node.setData(data);\n\n if (idIsChanged) {\n this.tree.addNodeToIndex(node);\n }\n\n if (\n typeof data === \"object\" &&\n data[\"children\"] &&\n data[\"children\"] instanceof Array\n ) {\n node.removeChildren();\n\n if (data.children.length) {\n node.loadFromData(data.children as Node[]);\n }\n }\n\n this.refreshElements(node);\n\n return this.element;\n }\n\n private isSelectedNodeInSubtree(subtree: Node): boolean {\n const selectedNode = this.getSelectedNode();\n\n if (!selectedNode) {\n return false;\n } else {\n return subtree === selectedNode || subtree.isParentOf(selectedNode);\n }\n }\n\n public moveNode(node: Node, targetNode: Node, position: string): JQuery {\n if (!node) {\n throw Error(NODE_PARAM_IS_EMPTY);\n }\n\n if (!targetNode) {\n throw Error(PARAM_IS_EMPTY + \"targetNode\");\n }\n\n const positionIndex = getPosition(position);\n\n if (positionIndex !== undefined) {\n this.tree.moveNode(node, targetNode, positionIndex);\n this.refreshElements(null);\n }\n\n return this.element;\n }\n\n public getStateFromStorage(): SavedState | null {\n return this.saveStateHandler.getStateFromStorage();\n }\n\n public addToSelection(node: Node, mustSetFocus?: boolean): JQuery {\n if (!node) {\n throw Error(NODE_PARAM_IS_EMPTY);\n }\n\n this.selectNodeHandler.addToSelection(node);\n this.openParents(node);\n\n this.getNodeElementForNode(node).select(\n mustSetFocus === undefined ? true : mustSetFocus,\n );\n\n this.saveState();\n\n return this.element;\n }\n\n public getSelectedNodes(): Node[] {\n return this.selectNodeHandler.getSelectedNodes();\n }\n\n public isNodeSelected(node: Node): boolean {\n if (!node) {\n throw Error(NODE_PARAM_IS_EMPTY);\n }\n\n return this.selectNodeHandler.isNodeSelected(node);\n }\n\n public removeFromSelection(node: Node): JQuery {\n if (!node) {\n throw Error(NODE_PARAM_IS_EMPTY);\n }\n\n this.selectNodeHandler.removeFromSelection(node);\n\n this.getNodeElementForNode(node).deselect();\n this.saveState();\n\n return this.element;\n }\n\n public scrollToNode(node: Node): JQuery {\n if (!node) {\n throw Error(NODE_PARAM_IS_EMPTY);\n }\n\n const top =\n getOffsetTop(node.element) -\n getOffsetTop(this.$el.get(0) as HTMLElement);\n\n this.scrollHandler.scrollToY(top);\n\n return this.element;\n }\n\n public getState(): SavedState | null {\n return this.saveStateHandler.getState();\n }\n\n public setState(state: SavedState): JQuery {\n this.saveStateHandler.setInitialState(state);\n this.refreshElements(null);\n\n return this.element;\n }\n\n public setOption(option: string, value: unknown): JQuery {\n (this.options as unknown as Record<string, unknown>)[option] = value;\n return this.element;\n }\n\n public moveDown(): JQuery {\n const selectedNode = this.getSelectedNode();\n if (selectedNode) {\n this.keyHandler.moveDown(selectedNode);\n }\n\n return this.element;\n }\n\n public moveUp(): JQuery {\n const selectedNode = this.getSelectedNode();\n if (selectedNode) {\n this.keyHandler.moveUp(selectedNode);\n }\n\n return this.element;\n }\n\n public getVersion(): string {\n return __version__;\n }\n\n private openNodeInternal(\n node: Node,\n slide = true,\n onFinished?: OnFinishOpenNode,\n ): void {\n const doOpenNode = (\n _node: Node,\n _slide: boolean,\n _onFinished?: OnFinishOpenNode,\n ): void => {\n const folderElement = this.createFolderElement(_node);\n folderElement.open(\n _onFinished,\n _slide,\n this.options.animationSpeed,\n );\n };\n\n if (node.isFolder() || node.isEmptyFolder) {\n if (node.load_on_demand) {\n this.loadFolderOnDemand(node, slide, onFinished);\n } else {\n let parent = node.parent;\n\n while (parent) {\n // nb: do not open root element\n if (parent.parent) {\n doOpenNode(parent, false);\n }\n parent = parent.parent;\n }\n\n doOpenNode(node, slide, onFinished);\n this.saveState();\n }\n }\n }\n\n /*\n Redraw the tree or part of the tree.\n from_node: redraw this subtree\n */\n private refreshElements(fromNode: Node | null): void {\n const mustSetFocus = this.isFocusOnTree();\n const mustSelect = fromNode\n ? this.isSelectedNodeInSubtree(fromNode)\n : false;\n\n this.renderer.render(fromNode);\n\n if (mustSelect) {\n this.selectCurrentNode(mustSetFocus);\n }\n\n this.triggerEvent(\"tree.refresh\");\n }\n\n private getNodeElementForNode(node: Node): NodeElement {\n if (node.isFolder()) {\n return this.createFolderElement(node);\n } else {\n return this.createNodeElement(node);\n }\n }\n\n private getNodeElement(element: HTMLElement): NodeElement | null {\n const node = this.getNode(element);\n if (node) {\n return this.getNodeElementForNode(node);\n } else {\n return null;\n }\n }\n\n public init(): void {\n super.init();\n\n this.element = this.$el;\n this.isInitialized = false;\n\n this.options.rtl = this.getRtlOption();\n\n if (this.options.closedIcon == null) {\n this.options.closedIcon = this.getDefaultClosedIcon();\n }\n\n this.connectHandlers();\n\n this.initData();\n }\n\n public deinit(): void {\n this.element.empty();\n this.element.off();\n\n this.keyHandler.deinit();\n this.mouseHandler.deinit();\n\n this.tree = new Node({}, true);\n\n super.deinit();\n }\n\n private triggerEvent(\n eventName: string,\n values?: Record<string, unknown>,\n ): JQuery.Event {\n const event = jQuery.Event(eventName, values);\n this.element.trigger(event);\n return event;\n }\n\n private mouseCapture(positionInfo: PositionInfo): boolean | null {\n if (this.options.dragAndDrop) {\n return this.dndHandler.mouseCapture(positionInfo);\n } else {\n return false;\n }\n }\n\n private mouseStart(positionInfo: PositionInfo): boolean {\n if (this.options.dragAndDrop) {\n return this.dndHandler.mouseStart(positionInfo);\n } else {\n return false;\n }\n }\n\n private mouseDrag(positionInfo: PositionInfo): boolean {\n if (this.options.dragAndDrop) {\n const result = this.dndHandler.mouseDrag(positionInfo);\n\n this.scrollHandler.checkScrolling(positionInfo);\n return result;\n } else {\n return false;\n }\n }\n\n private mouseStop(positionInfo: PositionInfo): boolean {\n if (this.options.dragAndDrop) {\n this.scrollHandler.stopScrolling();\n return this.dndHandler.mouseStop(positionInfo);\n } else {\n return false;\n }\n }\n\n private initData(): void {\n if (this.options.data) {\n this.doLoadData(this.options.data, null);\n } else {\n const dataUrl = this.getDataUrlInfo(null);\n\n if (dataUrl) {\n this.doLoadDataFromUrl(null, null, null);\n } else {\n this.doLoadData([], null);\n }\n }\n }\n\n private getDataUrlInfo(node: Node | null): JQuery.AjaxSettings | null {\n const dataUrl =\n this.options.dataUrl || (this.element.data(\"url\") as string | null);\n\n const getUrlFromString = (url: string): JQuery.AjaxSettings => {\n const urlInfo: JQuery.AjaxSettings = { url };\n\n setUrlInfoData(urlInfo);\n\n return urlInfo;\n };\n\n const setUrlInfoData = (urlInfo: JQuery.AjaxSettings): void => {\n if (node?.id) {\n // Load on demand of a subtree; add node parameter\n const data = { node: node.id };\n urlInfo[\"data\"] = data;\n } else {\n // Add selected_node parameter\n const selectedNodeId = this.getNodeIdToBeSelected();\n if (selectedNodeId) {\n const data = { selected_node: selectedNodeId };\n urlInfo[\"data\"] = data;\n }\n }\n };\n\n if (typeof dataUrl === \"function\") {\n return dataUrl(node);\n } else if (typeof dataUrl === \"string\") {\n return getUrlFromString(dataUrl);\n } else if (dataUrl && typeof dataUrl === \"object\") {\n setUrlInfoData(dataUrl);\n return dataUrl;\n } else {\n return null;\n }\n }\n\n private getNodeIdToBeSelected(): NodeId | null {\n if (this.options.saveState) {\n return this.saveStateHandler.getNodeIdToBeSelected();\n } else {\n return null;\n }\n }\n\n private initTree(data: NodeData[]): void {\n const doInit = (): void => {\n if (!this.isInitialized) {\n this.isInitialized = true;\n this.triggerEvent(\"tree.init\");\n }\n };\n\n if (!this.options.nodeClass) {\n return;\n }\n\n this.tree = new this.options.nodeClass(\n null,\n true,\n this.options.nodeClass,\n );\n\n this.selectNodeHandler.clear();\n\n this.tree.loadFromData(data);\n\n const mustLoadOnDemand = this.setInitialState();\n\n this.refreshElements(null);\n\n if (!mustLoadOnDemand) {\n doInit();\n } else {\n // Load data on demand and then init the tree\n this.setInitialStateOnDemand(doInit);\n }\n }\n\n // Set initial state, either by restoring the state or auto-opening nodes\n // result: must load nodes on demand?\n private setInitialState(): boolean {\n const restoreState = (): [boolean, boolean] => {\n // result: is state restored, must load on demand?\n if (!this.options.saveState) {\n return [false, false];\n } else {\n const state = this.saveStateHandler.getStateFromStorage();\n\n if (!state) {\n return [false, false];\n } else {\n const mustLoadOnDemand =\n this.saveStateHandler.setInitialState(state);\n\n // return true: the state is restored\n return [true, mustLoadOnDemand];\n }\n }\n };\n\n const autoOpenNodes = (): boolean => {\n // result: must load on demand?\n if (this.options.autoOpen === false) {\n return false;\n }\n\n const maxLevel = this.getAutoOpenMaxLevel();\n let mustLoadOnDemand = false;\n\n this.tree.iterate((node: Node, level: number) => {\n if (node.load_on_demand) {\n mustLoadOnDemand = true;\n return false;\n } else if (!node.hasChildren()) {\n return false;\n } else {\n node.is_open = true;\n return level !== maxLevel;\n }\n });\n\n return mustLoadOnDemand;\n };\n\n let [isRestored, mustLoadOnDemand] = restoreState(); // eslint-disable-line prefer-const\n\n if (!isRestored) {\n mustLoadOnDemand = autoOpenNodes();\n }\n\n return mustLoadOnDemand;\n }\n\n // Set the initial state for nodes that are loaded on demand\n // Call cb_finished when done\n private setInitialStateOnDemand(cbFinished: () => void): void {\n const restoreState = (): boolean => {\n if (!this.options.saveState) {\n return false;\n } else {\n const state = this.saveStateHandler.getStateFromStorage();\n\n if (!state) {\n return false;\n } else {\n this.saveStateHandler.setInitialStateOnDemand(\n state,\n cbFinished,\n );\n\n return true;\n }\n }\n };\n\n const autoOpenNodes = (): void => {\n const maxLevel = this.getAutoOpenMaxLevel();\n let loadingCount = 0;\n\n const loadAndOpenNode = (node: Node): void => {\n loadingCount += 1;\n this.openNodeInternal(node, false, () => {\n loadingCount -= 1;\n openNodes();\n });\n };\n\n const openNodes = (): void => {\n this.tree.iterate((node: Node, level: number) => {\n if (node.load_on_demand) {\n if (!node.is_loading) {\n loadAndOpenNode(node);\n }\n\n return false;\n } else {\n this.openNodeInternal(node, false);\n\n return level !== maxLevel;\n }\n });\n\n if (loadingCount === 0) {\n cbFinished();\n }\n };\n\n openNodes();\n };\n\n if (!restoreState()) {\n autoOpenNodes();\n }\n }\n\n private getAutoOpenMaxLevel(): number {\n if (this.options.autoOpen === true) {\n return -1;\n } else if (typeof this.options.autoOpen === \"number\") {\n return this.options.autoOpen;\n } else if (typeof this.options.autoOpen === \"string\") {\n return parseInt(this.options.autoOpen, 10);\n } else {\n return 0;\n }\n }\n\n private getNode(element: HTMLElement): null | Node {\n const liElement = element.closest(\"li.jqtree_common\");\n\n if (liElement) {\n return jQuery(liElement).data(\"node\") as Node;\n } else {\n return null;\n }\n }\n\n private saveState(): void {\n if (this.options.saveState) {\n this.saveStateHandler.saveState();\n }\n }\n\n private selectCurrentNode(mustSetFocus: boolean): void {\n const node = this.getSelectedNode();\n if (node) {\n const nodeElement = this.getNodeElementForNode(node);\n if (nodeElement) {\n nodeElement.select(mustSetFocus);\n }\n }\n }\n\n private deselectCurrentNode(): void {\n const node = this.getSelectedNode();\n if (node) {\n this.removeFromSelection(node);\n }\n }\n\n private getDefaultClosedIcon(): string {\n if (this.options.rtl) {\n // triangle to the left\n return \"◀\";\n } else {\n // triangle to the right\n return \"►\";\n }\n }\n\n private getRtlOption(): boolean {\n if (this.options.rtl != null) {\n return this.options.rtl;\n } else {\n const dataRtl = this.element.data(\"rtl\") as unknown;\n\n if (\n dataRtl !== null &&\n dataRtl !== false &&\n dataRtl !== undefined\n ) {\n return true;\n } else {\n return false;\n }\n }\n }\n\n private doSelectNode(\n node: Node | null,\n optionsParam?: SelectNodeOptions,\n ): void {\n const saveState = (): void => {\n if (this.options.saveState) {\n this.saveStateHandler.saveState();\n }\n };\n\n if (!node) {\n // Called with empty node -> deselect current node\n this.deselectCurrentNode();\n saveState();\n return;\n }\n const defaultOptions = { mustSetFocus: true, mustToggle: true };\n const selectOptions = { ...defaultOptions, ...(optionsParam || {}) };\n\n const canSelect = (): boolean => {\n if (this.options.onCanSelectNode) {\n return (\n this.options.selectable === true &&\n this.options.onCanSelectNode(node)\n );\n } else {\n return this.options.selectable === true;\n }\n };\n\n if (!canSelect()) {\n return;\n }\n\n if (this.selectNodeHandler.isNodeSelected(node)) {\n if (selectOptions.mustToggle) {\n this.deselectCurrentNode();\n this.triggerEvent(\"tree.select\", {\n node: null,\n previous_node: node,\n });\n }\n } else {\n const deselectedNode = this.getSelectedNode() || null;\n this.deselectCurrentNode();\n this.addToSelection(node, selectOptions.mustSetFocus);\n\n this.triggerEvent(\"tree.select\", {\n node,\n deselected_node: deselectedNode,\n });\n this.openParents(node);\n }\n\n saveState();\n }\n\n private doLoadData(data: NodeData[] | null, parentNode: Node | null): void {\n if (data) {\n if (parentNode) {\n this.deselectNodes(parentNode);\n this.loadSubtree(data, parentNode);\n } else {\n this.initTree(data);\n }\n\n if (this.isDragging()) {\n this.dndHandler.refresh();\n }\n }\n\n this.triggerEvent(\"tree.load_data\", {\n tree_data: data,\n parent_node: parentNode,\n });\n }\n\n private deselectNodes(parentNode: Node): void {\n const selectedNodesUnderParent =\n this.selectNodeHandler.getSelectedNodesUnder(parentNode);\n for (const n of selectedNodesUnderParent) {\n this.selectNodeHandler.removeFromSelection(n);\n }\n }\n\n private loadSubtree(data: NodeData[], parentNode: Node): void {\n parentNode.loadFromData(data);\n\n parentNode.load_on_demand = false;\n parentNode.is_loading = false;\n\n this.refreshElements(parentNode);\n }\n\n private doLoadDataFromUrl(\n urlInfoParam: string | JQuery.AjaxSettings | null,\n parentNode: Node | null,\n onFinished: HandleFinishedLoading | null,\n ): void {\n const urlInfo = urlInfoParam || this.getDataUrlInfo(parentNode);\n\n this.dataLoader.loadFromUrl(urlInfo, parentNode, onFinished);\n }\n\n private loadFolderOnDemand(\n node: Node,\n slide = true,\n onFinished?: OnFinishOpenNode,\n ): void {\n node.is_loading = true;\n\n this.doLoadDataFromUrl(null, node, () => {\n this.openNodeInternal(node, slide, onFinished);\n });\n }\n\n private containsElement(element: HTMLElement): boolean {\n const node = this.getNode(element);\n\n return node != null && node.tree === this.tree;\n }\n\n private isFocusOnTree(): boolean {\n const activeElement = document.activeElement;\n\n return Boolean(\n activeElement &&\n activeElement.tagName === \"SPAN\" &&\n this.containsElement(activeElement as HTMLElement),\n );\n }\n\n private connectHandlers() {\n const {\n autoEscape,\n buttonLeft,\n closedIcon,\n dataFilter,\n dragAndDrop,\n keyboardSupport,\n onCanMove,\n onCanMoveTo,\n onCreateLi,\n onDragMove,\n onDragStop,\n onGetStateFromStorage,\n onIsMoveHandle,\n onLoadFailed,\n onLoading,\n onSetStateFromStorage,\n openedIcon,\n openFolderDelay,\n rtl,\n saveState,\n showEmptyFolder,\n slide,\n tabIndex,\n } = this.options;\n\n const closeNode = this.closeNode.bind(this);\n const getNodeElement = this.getNodeElement.bind(this);\n const getNodeElementForNode = this.getNodeElementForNode.bind(this);\n const getNodeById = this.getNodeById.bind(this);\n const getSelectedNode = this.getSelectedNode.bind(this);\n const getTree = this.getTree.bind(this);\n const isFocusOnTree = this.isFocusOnTree.bind(this);\n const loadData = this.loadData.bind(this);\n const openNode = this.openNodeInternal.bind(this);\n const refreshElements = this.refreshElements.bind(this);\n const refreshHitAreas = this.refreshHitAreas.bind(this);\n const selectNode = this.selectNode.bind(this);\n const $treeElement = this.element;\n const treeElement = this.element.get(0) as HTMLElement;\n const triggerEvent = this.triggerEvent.bind(this);\n\n const selectNodeHandler = new SelectNodeHandler({\n getNodeById,\n });\n\n const addToSelection =\n selectNodeHandler.addToSelection.bind(selectNodeHandler);\n const getSelectedNodes =\n selectNodeHandler.getSelectedNodes.bind(selectNodeHandler);\n const isNodeSelected =\n selectNodeHandler.isNodeSelected.bind(selectNodeHandler);\n const removeFromSelection =\n selectNodeHandler.removeFromSelection.bind(selectNodeHandler);\n const getMouseDelay = () => this.options.startDndDelay ?? 0;\n\n const dataLoader = new DataLoader({\n dataFilter,\n loadData,\n onLoadFailed,\n onLoading,\n treeElement,\n triggerEvent,\n });\n\n const saveStateHandler = new SaveStateHandler({\n addToSelection,\n getNodeById,\n getSelectedNodes,\n getTree,\n onGetStateFromStorage,\n onSetStateFromStorage,\n openNode,\n refreshElements,\n removeFromSelection,\n saveState,\n });\n\n const scrollHandler = new ScrollHandler({\n refreshHitAreas,\n treeElement,\n });\n\n const getScrollLeft = scrollHandler.getScrollLeft.bind(scrollHandler);\n\n const dndHandler = new DragAndDropHandler({\n autoEscape,\n getNodeElement,\n getNodeElementForNode,\n getScrollLeft,\n getTree,\n onCanMove,\n onCanMoveTo,\n onDragMove,\n onDragStop,\n onIsMoveHandle,\n openFolderDelay,\n openNode,\n refreshElements,\n slide,\n treeElement,\n triggerEvent,\n });\n\n const keyHandler = new KeyHandler({\n closeNode,\n getSelectedNode,\n isFocusOnTree,\n keyboardSupport,\n openNode,\n selectNode,\n });\n\n const renderer = new ElementsRenderer({\n autoEscape,\n buttonLeft,\n closedIcon,\n dragAndDrop,\n $element: $treeElement,\n getTree,\n isNodeSelected,\n onCreateLi,\n openedIcon,\n rtl,\n showEmptyFolder,\n tabIndex,\n });\n\n const getNode = this.getNode.bind(this);\n const onMouseCapture = this.mouseCapture.bind(this);\n const onMouseDrag = this.mouseDrag.bind(this);\n const onMouseStart = this.mouseStart.bind(this);\n const onMouseStop = this.mouseStop.bind(this);\n\n const mouseHandler = new MouseHandler({\n element: treeElement,\n getMouseDelay,\n getNode,\n onClickButton: this.toggle.bind(this),\n onClickTitle: this.doSelectNode.bind(this),\n onMouseCapture,\n onMouseDrag,\n onMouseStart,\n onMouseStop,\n triggerEvent,\n useContextMenu: this.options.useContextMenu,\n });\n\n this.dataLoader = dataLoader;\n this.dndHandler = dndHandler;\n this.keyHandler = keyHandler;\n this.mouseHandler = mouseHandler;\n this.renderer = renderer;\n this.saveStateHandler = saveStateHandler;\n this.scrollHandler = scrollHandler;\n this.selectNodeHandler = selectNodeHandler;\n }\n\n private createFolderElement(node: Node) {\n const closedIconElement = this.renderer.closedIconElement;\n const getScrollLeft = this.scrollHandler.getScrollLeft.bind(\n this.scrollHandler,\n );\n const openedIconElement = this.renderer.openedIconElement;\n const tabIndex = this.options.tabIndex;\n const $treeElement = this.element;\n const triggerEvent = this.triggerEvent.bind(this);\n\n return new FolderElement({\n closedIconElement,\n getScrollLeft,\n node,\n openedIconElement,\n tabIndex,\n $treeElement,\n triggerEvent,\n });\n }\n\n private createNodeElement(node: Node) {\n const getScrollLeft = this.scrollHandler.getScrollLeft.bind(\n this.scrollHandler,\n );\n const tabIndex = this.options.tabIndex;\n const $treeElement = this.element;\n\n return new NodeElement({\n getScrollLeft,\n node,\n tabIndex,\n $treeElement,\n });\n }\n\n private openParents(node: Node) {\n const parent = node.parent;\n\n if (parent && parent.parent && !parent.is_open) {\n this.openNode(parent, false);\n }\n }\n}\n\nSimpleWidget.register(JqTreeWidget, \"tree\");\n"],"names":["version","Position","positionNames","before","Before","after","After","inside","Inside","none","None","getPositionName","position","name","Object","prototype","hasOwnProperty","call","getPosition","DragElement","constructor","_ref","autoEscape","nodeName","offsetX","offsetY","treeElement","element","createElement","appendChild","move","pageX","pageY","style","left","top","remove","document","classList","add","textContent","innerHTML","isInt","n","isFunction","v","getBoolString","value","getOffsetTop","getElementPosition","rect","getBoundingClientRect","x","window","scrollX","y","scrollY","iterateVisibleNodes","tree","handleAfterOpenFolder","handleClosedFolder","handleFirstNode","handleNode","handleOpenFolder","isFirstNode","iterate","node","nextNode","mustIterateInside","is_open","hasChildren","offsetParent","childrenLength","children","length","forEach","_","i","child","nextChild","generateHitPositions","currentNode","hitPositions","lastTop","addHitPosition","push","height","clientHeight","generateHitAreasForGroup","hitAreas","positionsInGroup","bottom","positionCount","Math","min","areaHeight","round","areaTop","generateHitAreasFromPositions","treeBottom","previousTop","group","generateHitAreas","DragAndDropHandler","getNodeElement","getNodeElementForNode","getScrollLeft","getTree","onCanMove","onCanMoveTo","onDragMove","onDragStop","onIsMoveHandle","openNode","refreshElements","slide","triggerEvent","hoveredArea","isDragging","currentItem","mouseCapture","positionInfo","target","mustCaptureElement","jQuery","nodeElement","mouseStart","refresh","dragElement","mouseDrag","area","findHoveredArea","canMoveToArea","isFolder","stopOpenFolderTimer","mustOpenFolderTimer","startOpenFolderTimer","updateDropHint","removeDropHint","originalEvent","mouseStop","moveItem","clear","removeHover","removeHitAreas","getTreeDimensions","positionName","previousGhost","dimensions","right","low","high","mid","addDropHint","folder","openFolder","openFolderDelay","openFolderTimer","setTimeout","clearTimeout","movedNode","targetNode","previousParent","parent","doMove","moveNode","event","move_info","moved_node","target_node","previous_parent","do_move","original_event","isDefaultPrevented","treePosition","clientWidth","ElementsRenderer","buttonLeft","closedIcon","onCreateLi","dragAndDrop","$element","isNodeSelected","openedIcon","rtl","showEmptyFolder","tabIndex","openedIconElement","createButtonElement","closedIconElement","render","fromNode","renderFromNode","renderFromRoot","empty","createDomElements","$previousLi","li","createLi","getLevel","attachNodeData","isRootNode","level","ul","createUl","data","classString","role","className","setAttribute","isSelected","Boolean","mustShowFolder","isEmptyFolder","createFolderLi","createNodeLi","setTreeItemAriaAttributes","buttonClasses","getButtonClasses","folderClasses","getFolderClasses","iconElement","div","buttonLink","cloneNode","titleSpan","createTitleSpan","liClasses","join","classes","undefined","is_loading","createTextNode","nodeType","DataLoader","dataFilter","loadData","onLoadFailed","onLoading","loadFromUrl","urlInfo","parentNode","onFinished","getDomElement","addLoadingClass","notifyLoading","stopLoading","removeLoadingClass","handleSuccess","parseData","handleError","jqXHR","submitRequest","isLoading","$el","urlInfoInput","url","ajaxSettings","method","cache","dataType","success","error","toUpperCase","ajax","getParsedData","JSON","parse","parsedData","KeyHandler","closeNode","getSelectedNode","isFocusOnTree","keyboardSupport","selectNode","originalSelectNode","handleKeyDownHandler","handleKeyDown","bind","addEventListener","deinit","removeEventListener","moveDown","selectedNode","getNextVisibleNode","moveUp","getPreviousVisibleNode","moveRight","moveLeft","getParent","e","canHandleKeyboard","key","getPositionInfoFromMouseEvent","getPositionInfoFromTouch","touch","MouseHandler","getMouseDelay","getNode","onClickButton","onClickTitle","onMouseCapture","onMouseDrag","onMouseStart","onMouseStop","useContextMenu","handleClick","handleDblclick","mouseDown","passive","touchStart","handleContextmenu","isMouseStarted","mouseDelayTimer","isMouseDelayMet","mouseDownInfo","removeMouseMoveEventListeners","button","result","handleMouseDown","cancelable","preventDefault","handleMouseUp","handleStartMouse","mouseMove","touchMove","mouseUp","touchEnd","mouseDelay","startMouseDelayTimer","handleMouseMove","touches","clickTarget","getClickTarget","type","stopPropagation","click_event","closest","jqTreeElement","SaveStateHandler","addToSelection","getNodeById","getSelectedNodes","onGetStateFromStorage","onSetStateFromStorage","removeFromSelection","saveState","saveStateOption","state","stringify","getState","supportsLocalStorage","localStorage","setItem","getKeyName","getStateFromStorage","jsonData","loadFromStorage","parseState","getOpenNodeIds","openNodes","id","getSelectedNodeIds","selectedNodeIds","open_nodes","selected_node","setInitialState","mustLoadOnDemand","openInitialNodes","resetSelection","selectInitialNodes","setInitialStateOnDemand","cbFinished","loadingCount","nodeIds","newNodesIds","nodeId","load_on_demand","loadAndOpenNode","getNodeIdToBeSelected","getItem","selectCount","selectedNodes","testSupport","sessionStorage","removeItem","_supportsLocalStorage","ContainerScrollParent","container","refreshHitAreas","checkHorizontalScrolling","newHorizontalScrollDirection","getNewHorizontalScrollDirection","horizontalScrollDirection","horizontalScrollTimeout","verticalScrollTimeout","scrollHorizontally","checkVerticalScrolling","newVerticalScrollDirection","getNewVerticalScrollDirection","verticalScrollDirection","scrollVertically","scrollLeft","scrollToY","scrollTop","stopScrolling","scrollParentTop","scrollParentBottom","scrollParentOffset","rightEdge","leftEdge","isNearRightEdge","isNearLeftEdge","getScrollParentTop","getScrollParentBottom","distance","scrollBy","behavior","DocumentScrollParent","documentElement","treeTop","documentScrollHeight","documentScrollWidth","windowWidth","innerWidth","canScrollRight","getDocumentScrollWidth","canScrollDown","getDocumentScrollHeight","scrollHeight","scrollWidth","distanceTop","windowHeight","innerHeight","isOverflow","overflowValue","hasOverFlow","getComputedStyle","overflowX","overflowY","getParentWithOverflow","parentElement","createScrollParent","tagName","ScrollHandler","scrollParent","checkScrolling","getScrollParent","SelectNodeHandler","Set","selectedSingleNode","getSelectedNodesUnder","isParentOf","has","includeChildren","arguments","delete","register","widgetClass","widgetName","getDataKey","getWidgetData","el","dataKey","widget","SimpleWidget","createWidget","options","get","existingWidget","simpleWidgetClass","init","destroyWidget","destroy","removeData","callFunction","functionName","args","simpleWidget","widgetFunction","apply","fn","argument1","_len","Array","_key","defaults","isNodeRecordWithChildren","Node","nodeData","isRoot","nodeClass","setData","idMapping","Map","o","loadFromData","removeChildren","childData","createNode","addChild","setParent","addChildAtPosition","index","splice","removeChild","doRemoveChild","getChildIndex","indexOf","callback","_iterate","getData","includeParent","getDataFromNodes","nodes","map","tmpNode","k","getNodeByName","getNodeByCallback","getNodeByNameMustExist","addAfter","nodeInfo","childIndex","loadChildrenFromData","addBefore","addParent","newParent","originalParent","append","prepend","addNodeToIndex","set","removeNodeFromIndex","getPreviousSibling","previousIndex","getNextSibling","nextIndex","getNodesByProperty","filter","f","getNextNode","nextSibling","getPreviousNode","previousSibling","getLastChild","lastChild","initFromData","addNode","addChildren","childrenData","getNodeClass","BorderDropHint","querySelector","hint","width","max","offsetWidth","GhostDropHint","ghost","createGhostElement","circleSpan","lineSpan","NodeElement","$treeElement","mustShowBorderDropHint","select","mustSetFocus","getTitleSpan","toString","focus","deselect","removeAttribute","blur","getUl","FolderElement","open","animationSpeed","getButton","icon","doOpen","slideDown","show","close","doClose","slideUp","hide","NODE_PARAM_IS_EMPTY","PARAM_IS_EMPTY","JqTreeWidget","autoOpen","dataUrl","onCanSelectNode","selectable","startDndDelay","toggle","slideParam","Error","optionsParam","doSelectNode","selectNodeHandler","toJson","doLoadData","loadDataFromUrl","param1","param2","param3","doLoadDataFromUrl","reload","getNodeByHtmlElement","inputElement","HTMLElement","parseParams","openNodeInternal","createFolderElement","dndHandler","addNodeAfter","newNodeInfo","existingNode","newNode","addNodeBefore","addParentNode","removeNode","appendNode","parentNodeParam","prependNode","updateNode","idIsChanged","isSelectedNodeInSubtree","subtree","positionIndex","saveStateHandler","openParents","scrollToNode","scrollHandler","setState","setOption","option","keyHandler","getVersion","__version__","doOpenNode","_node","_slide","_onFinished","folderElement","loadFolderOnDemand","mustSelect","renderer","selectCurrentNode","createNodeElement","isInitialized","getRtlOption","getDefaultClosedIcon","connectHandlers","initData","off","mouseHandler","eventName","values","Event","trigger","getDataUrlInfo","getUrlFromString","setUrlInfoData","selectedNodeId","initTree","doInit","restoreState","autoOpenNodes","maxLevel","getAutoOpenMaxLevel","isRestored","parseInt","liElement","deselectCurrentNode","dataRtl","defaultOptions","mustToggle","selectOptions","canSelect","previous_node","deselectedNode","deselected_node","deselectNodes","loadSubtree","tree_data","parent_node","selectedNodesUnderParent","urlInfoParam","dataLoader","containsElement","activeElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAAA,MAAMA,OAAO,GAAG,OAAO;;ICAXC,IAAAA,QAAQ,0BAARA,QAAQ,EAAA;IAARA,EAAAA,QAAQ,CAARA,QAAQ,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAA,CAAA;IAARA,EAAAA,QAAQ,CAARA,QAAQ,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA,CAAA;IAARA,EAAAA,QAAQ,CAARA,QAAQ,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAA,CAAA;IAARA,EAAAA,QAAQ,CAARA,QAAQ,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAA,CAAA;IAAA,EAAA,OAARA,QAAQ,CAAA;IAAA,CAAA,CAAA,EAAA,CAAA,CAAA;IAOpB,MAAMC,aAAuC,GAAG;MAC5CC,MAAM,EAAEF,QAAQ,CAACG,MAAM;MACvBC,KAAK,EAAEJ,QAAQ,CAACK,KAAK;MACrBC,MAAM,EAAEN,QAAQ,CAACO,MAAM;MACvBC,IAAI,EAAER,QAAQ,CAACS,IAAAA;IACnB,CAAC,CAAA;IAEM,MAAMC,eAAe,GAAIC,QAAkB,IAAa;IAC3D,EAAA,KAAK,MAAMC,IAAI,IAAIX,aAAa,EAAE;IAC9B,IAAA,IAAIY,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACf,aAAa,EAAEW,IAAI,CAAC,EAAE;IAC3D,MAAA,IAAIX,aAAa,CAACW,IAAI,CAAC,KAAKD,QAA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