{"version":3,"file":"tree-store.mjs","names":[],"sources":["../../../../../../../packages/components/tree/src/model/tree-store.ts"],"sourcesContent":["import { nextTick } from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { NOOP, hasOwn, isObject, isPropAbsent } from '@element-plus/utils'\nimport Node from './node'\nimport { getNodeKey } from './util'\n\nimport type {\n  FilterNodeMethodFunction,\n  FilterValue,\n  LoadFunction,\n  TreeData,\n  TreeKey,\n  TreeNodeData,\n  TreeOptionProps,\n  TreeStoreNodesMap,\n  TreeStoreOptions,\n} from '../tree.type'\n\nexport default class TreeStore {\n  currentNode: Node | null\n  currentNodeKey: TreeKey | null\n  nodesMap: TreeStoreNodesMap\n  root!: Node\n  data!: TreeData\n  lazy = false\n  load?: LoadFunction\n  filterNodeMethod?: FilterNodeMethodFunction\n  key!: TreeKey\n  defaultCheckedKeys?: TreeKey[]\n  checkStrictly = false\n  defaultExpandedKeys?: TreeKey[]\n  autoExpandParent = false\n  defaultExpandAll = false\n  checkDescendants = false\n  props!: TreeOptionProps\n\n  constructor(options: TreeStoreOptions) {\n    this.currentNode = null\n    this.currentNodeKey = null\n\n    for (const option in options) {\n      if (hasOwn(options, option)) {\n        this[option] = options[option]\n      }\n    }\n\n    this.nodesMap = {}\n  }\n\n  initialize() {\n    this.root = new Node({\n      data: this.data,\n      store: this,\n    })\n    this.root.initialize()\n\n    if (this.lazy && this.load) {\n      const loadFn = this.load\n      loadFn(\n        this.root,\n        (data) => {\n          this.root.doCreateChildren(data)\n          this._initDefaultCheckedNodes()\n        },\n        NOOP\n      )\n    } else {\n      this._initDefaultCheckedNodes()\n    }\n  }\n\n  filter(value: FilterValue): void {\n    const filterNodeMethod = this.filterNodeMethod\n    const lazy = this.lazy\n    const traverse = async function (node: TreeStore | Node) {\n      const childNodes = (node as TreeStore).root\n        ? (node as TreeStore).root.childNodes\n        : (node as Node).childNodes\n\n      for (const [index, child] of childNodes.entries()) {\n        child.visible = !!filterNodeMethod?.call(\n          child,\n          value,\n          child.data,\n          child\n        )\n\n        if (index % 80 === 0 && index > 0) {\n          await nextTick()\n        }\n        await traverse(child)\n      }\n\n      if (!(node as Node).visible && childNodes.length) {\n        let allHidden = true\n        allHidden = !childNodes.some((child) => child.visible)\n\n        if ((node as TreeStore).root) {\n          ;(node as TreeStore).root.visible = allHidden === false\n        } else {\n          ;(node as Node).visible = allHidden === false\n        }\n      }\n      if (!value) return\n\n      if ((node as Node).visible && !(node as Node).isLeaf) {\n        if (!lazy || (node as Node).loaded) {\n          ;(node as Node).expand()\n        }\n      }\n    }\n\n    traverse(this)\n  }\n\n  setData(newVal: TreeData): void {\n    const instanceChanged = newVal !== this.root.data\n    if (instanceChanged) {\n      this.nodesMap = {}\n      this.root.setData(newVal)\n      this._initDefaultCheckedNodes()\n      this.setCurrentNodeKey(this.currentNodeKey)\n    } else {\n      this.root.updateChildren()\n    }\n  }\n\n  getNode(data: TreeKey | TreeNodeData | Node): Node {\n    if (data instanceof Node) return data\n    const key = isObject(data) ? getNodeKey(this.key, data) : data\n    return this.nodesMap[key] || null\n  }\n\n  insertBefore(\n    data: TreeNodeData,\n    refData: TreeKey | TreeNodeData | Node\n  ): void {\n    const refNode = this.getNode(refData)\n    refNode.parent?.insertBefore({ data }, refNode)\n  }\n\n  insertAfter(\n    data: TreeNodeData,\n    refData: TreeKey | TreeNodeData | Node\n  ): void {\n    const refNode = this.getNode(refData)\n    refNode.parent?.insertAfter({ data }, refNode)\n  }\n\n  remove(data: TreeNodeData | Node): void {\n    const node = this.getNode(data)\n\n    if (node && node.parent) {\n      if (node === this.currentNode) {\n        this.currentNode = null\n      }\n      node.parent.removeChild(node)\n    }\n  }\n\n  append(data: TreeNodeData, parentData: TreeNodeData | TreeKey | Node): void {\n    const parentNode = !isPropAbsent(parentData)\n      ? this.getNode(parentData)\n      : this.root\n\n    if (parentNode) {\n      parentNode.insertChild({ data })\n    }\n  }\n\n  _initDefaultCheckedNodes(): void {\n    const defaultCheckedKeys = this.defaultCheckedKeys || []\n    const nodesMap = this.nodesMap\n\n    defaultCheckedKeys.forEach((checkedKey) => {\n      const node = nodesMap[checkedKey]\n\n      if (node) {\n        node.setChecked(true, !this.checkStrictly)\n      }\n    })\n  }\n\n  _initDefaultCheckedNode(node: Node): void {\n    const defaultCheckedKeys = this.defaultCheckedKeys || []\n\n    if (!isNil(node.key) && defaultCheckedKeys.includes(node.key)) {\n      node.setChecked(true, !this.checkStrictly)\n    }\n  }\n\n  setDefaultCheckedKey(newVal: TreeKey[]): void {\n    if (newVal !== this.defaultCheckedKeys) {\n      this.defaultCheckedKeys = newVal\n      this._initDefaultCheckedNodes()\n    }\n  }\n\n  registerNode(node: Node): void {\n    const key = this.key\n    if (!node || !node.data) return\n\n    if (!key) {\n      this.nodesMap[node.id] = node\n    } else {\n      const nodeKey = node.key\n      if (!isNil(nodeKey)) this.nodesMap[nodeKey] = node\n    }\n  }\n\n  deregisterNode(node: Node): void {\n    const key = this.key\n    if (!key || !node || !node.data) return\n\n    node.childNodes.forEach((child) => {\n      this.deregisterNode(child)\n    })\n\n    delete this.nodesMap[node.key!]\n  }\n\n  getCheckedNodes(\n    leafOnly = false,\n    includeHalfChecked = false\n  ): TreeNodeData[] {\n    const checkedNodes: TreeNodeData[] = []\n    const traverse = function (node: TreeStore | Node) {\n      const childNodes = (node as TreeStore).root\n        ? (node as TreeStore).root.childNodes\n        : (node as Node).childNodes\n\n      childNodes.forEach((child) => {\n        if (\n          (child.checked || (includeHalfChecked && child.indeterminate)) &&\n          (!leafOnly || (leafOnly && child.isLeaf))\n        ) {\n          checkedNodes.push(child.data)\n        }\n\n        traverse(child)\n      })\n    }\n\n    traverse(this)\n\n    return checkedNodes\n  }\n\n  getCheckedKeys(leafOnly = false): TreeKey[] {\n    return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key])\n  }\n\n  getHalfCheckedNodes(): TreeNodeData[] {\n    const nodes: TreeNodeData[] = []\n    const traverse = function (node: TreeStore | Node) {\n      const childNodes = (node as TreeStore).root\n        ? (node as TreeStore).root.childNodes\n        : (node as Node).childNodes\n\n      childNodes.forEach((child) => {\n        if (child.indeterminate) {\n          nodes.push(child.data)\n        }\n\n        traverse(child)\n      })\n    }\n\n    traverse(this)\n\n    return nodes\n  }\n\n  getHalfCheckedKeys(): TreeKey[] {\n    return this.getHalfCheckedNodes().map((data) => (data || {})[this.key])\n  }\n\n  _getAllNodes(): Node[] {\n    const allNodes: Node[] = []\n    const nodesMap = this.nodesMap\n    for (const nodeKey in nodesMap) {\n      if (hasOwn(nodesMap, nodeKey)) {\n        allNodes.push(nodesMap[nodeKey])\n      }\n    }\n\n    return allNodes\n  }\n\n  updateChildren(key: TreeKey, data: TreeData): void {\n    const node = this.nodesMap[key]\n    if (!node) return\n    const childNodes = node.childNodes\n    for (let i = childNodes.length - 1; i >= 0; i--) {\n      const child = childNodes[i]\n      this.remove(child.data)\n    }\n    for (let i = 0, j = data.length; i < j; i++) {\n      const child = data[i]\n      this.append(child, node.data)\n    }\n  }\n\n  _setCheckedKeys(\n    key: TreeKey,\n    leafOnly = false,\n    checkedKeys: { [key: string]: boolean }\n  ) {\n    const allNodes = this._getAllNodes().sort((a, b) => a.level - b.level)\n    const cache: Record<TreeKey, boolean> = Object.create(null)\n    const keys = Object.keys(checkedKeys)\n    allNodes.forEach((node) => node.setChecked(false, false))\n    const cacheCheckedChild = (node: Node) => {\n      node.childNodes.forEach((child) => {\n        cache[child.data[key]] = true\n        if (child.childNodes?.length) {\n          cacheCheckedChild(child)\n        }\n      })\n    }\n    for (let i = 0, j = allNodes.length; i < j; i++) {\n      const node = allNodes[i]\n      const nodeKey: string = node.data[key].toString()\n      const checked = keys.includes(nodeKey)\n      if (!checked) {\n        if (node.checked && !cache[nodeKey]) {\n          node.setChecked(false, false)\n        }\n        continue\n      }\n\n      if (node.childNodes.length) {\n        cacheCheckedChild(node)\n      }\n\n      if (node.isLeaf || this.checkStrictly) {\n        node.setChecked(true, false)\n        continue\n      }\n      node.setChecked(true, true)\n\n      if (leafOnly) {\n        node.setChecked(false, false, true)\n        const traverse = function (node: Node): void {\n          const childNodes = node.childNodes\n          childNodes.forEach((child) => {\n            if (!child.isLeaf) {\n              child.setChecked(false, false, true)\n            }\n            traverse(child)\n          })\n          node.reInitChecked()\n        }\n        traverse(node)\n      }\n    }\n  }\n\n  setCheckedNodes(array: Node[], leafOnly = false): void {\n    const key = this.key\n    const checkedKeys: Record<TreeKey, boolean> = {}\n    array.forEach((item) => {\n      checkedKeys[((item || {}) as any)[key]] = true\n    })\n\n    this._setCheckedKeys(key, leafOnly, checkedKeys)\n  }\n\n  setCheckedKeys(keys: TreeKey[], leafOnly = false): void {\n    this.defaultCheckedKeys = keys\n    const key = this.key\n    const checkedKeys: Record<TreeKey, boolean> = {}\n    keys.forEach((key) => {\n      checkedKeys[key] = true\n    })\n\n    this._setCheckedKeys(key, leafOnly, checkedKeys)\n  }\n\n  setDefaultExpandedKeys(keys: TreeKey[]) {\n    keys = keys || []\n    this.defaultExpandedKeys = keys\n    keys.forEach((key) => {\n      const node = this.getNode(key)\n      if (node) node.expand(null, this.autoExpandParent)\n    })\n  }\n\n  setChecked(\n    data: TreeKey | TreeNodeData,\n    checked: boolean,\n    deep: boolean\n  ): void {\n    const node = this.getNode(data)\n\n    if (node) {\n      node.setChecked(!!checked, deep)\n    }\n  }\n\n  getCurrentNode() {\n    return this.currentNode\n  }\n\n  setCurrentNode(currentNode: Node): void {\n    const prevCurrentNode = this.currentNode\n    if (prevCurrentNode) {\n      prevCurrentNode.isCurrent = false\n    }\n    this.currentNode = currentNode\n    this.currentNode.isCurrent = true\n  }\n\n  setUserCurrentNode(node: Node, shouldAutoExpandParent = true): void {\n    const key = (node as any)[this.key]\n    const currNode = this.nodesMap[key]\n    this.setCurrentNode(currNode)\n    if (\n      shouldAutoExpandParent &&\n      this.currentNode &&\n      this.currentNode.level > 1\n    ) {\n      this.currentNode.parent?.expand(null, true)\n    }\n  }\n\n  setCurrentNodeKey(key: TreeKey | null, shouldAutoExpandParent = true): void {\n    this.currentNodeKey = key\n    if (isPropAbsent(key)) {\n      this.currentNode && (this.currentNode.isCurrent = false)\n      this.currentNode = null\n      return\n    }\n    const node = this.getNode(key)\n    if (node) {\n      this.setCurrentNode(node)\n      if (\n        shouldAutoExpandParent &&\n        this.currentNode &&\n        this.currentNode.level > 1\n      ) {\n        this.currentNode.parent?.expand(null, true)\n      }\n    }\n  }\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAqB,YAArB,MAA+B;CAkB7B,YAAY,SAA2B;cAZhC;uBAKS;0BAEG;0BACA;0BACA;AAIjB,OAAK,cAAc;AACnB,OAAK,iBAAiB;AAEtB,OAAK,MAAM,UAAU,QACnB,KAAI,OAAO,SAAS,OAAO,CACzB,MAAK,UAAU,QAAQ;AAI3B,OAAK,WAAW,EAAE;;CAGpB,aAAa;AACX,OAAK,OAAO,IAAI,KAAK;GACnB,MAAM,KAAK;GACX,OAAO;GACR,CAAC;AACF,OAAK,KAAK,YAAY;AAEtB,MAAI,KAAK,QAAQ,KAAK,MAAM;GAC1B,MAAM,SAAS,KAAK;AACpB,UACE,KAAK,OACJ,SAAS;AACR,SAAK,KAAK,iBAAiB,KAAK;AAChC,SAAK,0BAA0B;MAEjC,KACD;QAED,MAAK,0BAA0B;;CAInC,OAAO,OAA0B;EAC/B,MAAM,mBAAmB,KAAK;EAC9B,MAAM,OAAO,KAAK;EAClB,MAAM,WAAW,eAAgB,MAAwB;GACvD,MAAM,aAAc,KAAmB,OAClC,KAAmB,KAAK,aACxB,KAAc;AAEnB,QAAK,MAAM,CAAC,OAAO,UAAU,WAAW,SAAS,EAAE;AACjD,UAAM,UAAU,CAAC,CAAC,kBAAkB,KAClC,OACA,OACA,MAAM,MACN,MACD;AAED,QAAI,QAAQ,OAAO,KAAK,QAAQ,EAC9B,OAAM,UAAU;AAElB,UAAM,SAAS,MAAM;;AAGvB,OAAI,CAAE,KAAc,WAAW,WAAW,QAAQ;IAChD,IAAI,YAAY;AAChB,gBAAY,CAAC,WAAW,MAAM,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