You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 lines
33 KiB

{"ast":null,"code":"import { defineComponent, ref, computed, provide, reactive, watch, onBeforeUpdate, onMounted, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, renderList, createBlock, withCtx, renderSlot } from 'vue';\nimport { isEqual, flattenDeep, cloneDeep } from 'lodash-unified';\nimport ElCascaderMenu from './menu.mjs';\nimport Store from './store.mjs';\nimport Node from './node.mjs';\nimport { CommonProps, useCascaderConfig } from './config.mjs';\nimport { sortByOriginalOrder, checkNode, getMenuIndex } from './utils.mjs';\nimport { CASCADER_PANEL_INJECTION_KEY } from './types.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport { unique, castArray } from '../../../utils/arrays.mjs';\nimport { scrollIntoView } from '../../../utils/dom/scroll.mjs';\nimport { focusNode, getSibling } from '../../../utils/dom/aria.mjs';\nimport { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { isEmpty } from '../../../utils/types.mjs';\nimport { isClient } from '@vueuse/core';\nimport { EVENT_CODE } from '../../../constants/aria.mjs';\nconst _sfc_main = defineComponent({\n name: \"ElCascaderPanel\",\n components: {\n ElCascaderMenu\n },\n props: {\n ...CommonProps,\n border: {\n type: Boolean,\n default: true\n },\n renderLabel: Function\n },\n emits: [UPDATE_MODEL_EVENT, CHANGE_EVENT, \"close\", \"expand-change\"],\n setup(props, {\n emit,\n slots\n }) {\n let manualChecked = false;\n const ns = useNamespace(\"cascader\");\n const config = useCascaderConfig(props);\n let store = null;\n const initialLoaded = ref(true);\n const menuList = ref([]);\n const checkedValue = ref(null);\n const menus = ref([]);\n const expandingNode = ref(null);\n const checkedNodes = ref([]);\n const isHoverMenu = computed(() => config.value.expandTrigger === \"hover\");\n const renderLabelFn = computed(() => props.renderLabel || slots.default);\n const initStore = () => {\n const {\n options\n } = props;\n const cfg = config.value;\n manualChecked = false;\n store = new Store(options, cfg);\n menus.value = [store.getNodes()];\n if (cfg.lazy && isEmpty(props.options)) {\n initialLoaded.value = false;\n lazyLoad(void 0, list => {\n if (list) {\n store = new Store(list, cfg);\n menus.value = [store.getNodes()];\n }\n initialLoaded.value = true;\n syncCheckedValue(false, true);\n });\n } else {\n syncCheckedValue(false, true);\n }\n };\n const lazyLoad = (node, cb) => {\n const cfg = config.value;\n node = node || new Node({}, cfg, void 0, true);\n node.loading = true;\n const resolve = dataList => {\n const _node = node;\n const parent = _node.root ? null : _node;\n dataList && (store == null ? void 0 : store.appendNodes(dataList, parent));\n _node.loading = false;\n _node.loaded = true;\n _node.childrenData = _node.childrenData || [];\n cb && cb(dataList);\n };\n cfg.lazyLoad(node, resolve);\n };\n const expandNode = (node, silent) => {\n var _a;\n const {\n level\n } = node;\n const newMenus = menus.value.slice(0, level);\n let newExpandingNode;\n if (node.isLeaf) {\n newExpandingNode = node.pathNodes[level - 2];\n } else {\n newExpandingNode = node;\n newMenus.push(node.children);\n }\n if (((_a = expandingNode.value) == null ? void 0 : _a.uid) !== (newExpandingNode == null ? void 0 : newExpandingNode.uid)) {\n expandingNode.value = node;\n menus.value = newMenus;\n !silent && emit(\"expand-change\", (node == null ? void 0 : node.pathValues) || []);\n }\n };\n const handleCheckChange = (node, checked, emitClose = true) => {\n const {\n checkStrictly,\n multiple\n } = config.value;\n const oldNode = checkedNodes.value[0];\n manualChecked = true;\n !multiple && (oldNode == null ? void 0 : oldNode.doCheck(false));\n node.doCheck(checked);\n calculateCheckedValue();\n emitClose && !multiple && !checkStrictly && emit(\"close\");\n !emitClose && !multiple && !checkStrictly && expandParentNode(node);\n };\n const expandParentNode = node => {\n if (!node) return;\n node = node.parent;\n expandParentNode(node);\n node && expandNode(node);\n };\n const getFlattedNodes = leafOnly => {\n return store == null ? void 0 : store.getFlattedNodes(leafOnly);\n };\n const getCheckedNodes = leafOnly => {\n var _a;\n return (_a = getFlattedNodes(leafOnly)) == null ? void 0 : _a.filter(node => node.checked !== false);\n };\n const clearCheckedNodes = () => {\n checkedNodes.value.forEach(node => node.doCheck(false));\n calculateCheckedValue();\n menus.value = menus.value.slice(0, 1);\n expandingNode.value = null;\n emit(\"expand-change\", []);\n };\n const calculateCheckedValue = () => {\n var _a;\n const {\n checkStrictly,\n multiple\n } = config.value;\n const oldNodes = checkedNodes.value;\n const newNodes = getCheckedNodes(!checkStrictly);\n const nodes = sortByOriginalOrder(oldNodes, newNodes);\n const values = nodes.map(node => node.valueByOption);\n checkedNodes.value = nodes;\n checkedValue.value = multiple ? values : (_a = values[0]) != null ? _a : null;\n };\n const syncCheckedValue = (loaded = false, forced = false) => {\n const {\n modelValue\n } = props;\n const {\n lazy,\n multiple,\n checkStrictly\n } = config.value;\n const leafOnly = !checkStrictly;\n if (!initialLoaded.value || manualChecked || !forced && isEqual(modelValue, checkedValue.value)) return;\n if (lazy && !loaded) {\n const values = unique(flattenDeep(castArray(modelValue)));\n const nodes = values.map(val => store == null ? void 0 : store.getNodeByValue(val)).filter(node => !!node && !node.loaded && !node.loading);\n if (nodes.length) {\n nodes.forEach(node => {\n lazyLoad(node, () => syncCheckedValue(false, forced));\n });\n } else {\n syncCheckedValue(true, forced);\n }\n } else {\n const values = multiple ? castArray(modelValue) : [modelValue];\n const nodes = unique(values.map(val => store == null ? void 0 : store.getNodeByValue(val, leafOnly)));\n syncMenuState(nodes, forced);\n checkedValue.value = cloneDeep(modelValue);\n }\n };\n const syncMenuState = (newCheckedNodes, reserveExpandingState = true) => {\n const {\n checkStrictly\n } = config.value;\n const oldNodes = checkedNodes.value;\n const newNodes = newCheckedNodes.filter(node => !!node && (checkStrictly || node.isLeaf));\n const oldExpandingNode = store == null ? void 0 : store.getSameNode(expandingNode.value);\n const newExpandingNode = reserveExpandingState && oldExpandingNode || newNodes[0];\n if (newExpandingNode) {\n newExpandingNode.pathNodes.forEach(node => expandNode(node, true));\n } else {\n expandingNode.value = null;\n }\n oldNodes.forEach(node => node.doCheck(false));\n reactive(newNodes).forEach(node => node.doCheck(true));\n checkedNodes.value = newNodes;\n nextTick(scrollToExpandingNode);\n };\n const scrollToExpandingNode = () => {\n if (!isClient) return;\n menuList.value.forEach(menu => {\n const menuElement = menu == null ? void 0 : menu.$el;\n if (menuElement) {\n const container = menuElement.querySelector(`.${ns.namespace.value}-scrollbar__wrap`);\n const activeNode = menuElement.querySelector(`.${ns.b(\"node\")}.${ns.is(\"active\")}`) || menuElement.querySelector(`.${ns.b(\"node\")}.in-active-path`);\n scrollIntoView(container, activeNode);\n }\n });\n };\n const handleKeyDown = e => {\n const target = e.target;\n const {\n code\n } = e;\n switch (code) {\n case EVENT_CODE.up:\n case EVENT_CODE.down:\n {\n e.preventDefault();\n const distance = code === EVENT_CODE.up ? -1 : 1;\n focusNode(getSibling(target, distance, `.${ns.b(\"node\")}[tabindex=\"-1\"]`));\n break;\n }\n case EVENT_CODE.left:\n {\n e.preventDefault();\n const preMenu = menuList.value[getMenuIndex(target) - 1];\n const expandedNode = preMenu == null ? void 0 : preMenu.$el.querySelector(`.${ns.b(\"node\")}[aria-expanded=\"true\"]`);\n focusNode(expandedNode);\n break;\n }\n case EVENT_CODE.right:\n {\n e.preventDefault();\n const nextMenu = menuList.value[getMenuIndex(target) + 1];\n const firstNode = nextMenu == null ? void 0 : nextMenu.$el.querySelector(`.${ns.b(\"node\")}[tabindex=\"-1\"]`);\n focusNode(firstNode);\n break;\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n checkNode(target);\n break;\n }\n };\n provide(CASCADER_PANEL_INJECTION_KEY, reactive({\n config,\n expandingNode,\n checkedNodes,\n isHoverMenu,\n initialLoaded,\n renderLabelFn,\n lazyLoad,\n expandNode,\n handleCheckChange\n }));\n watch([config, () => props.options], initStore, {\n deep: true,\n immediate: true\n });\n watch(() => props.modelValue, () => {\n manualChecked = false;\n syncCheckedValue();\n }, {\n deep: true\n });\n watch(() => checkedValue.value, val => {\n if (!isEqual(val, props.modelValue)) {\n emit(UPDATE_MODEL_EVENT, val);\n emit(CHANGE_EVENT, val);\n }\n });\n onBeforeUpdate(() => menuList.value = []);\n onMounted(() => !isEmpty(props.modelValue) && syncCheckedValue());\n return {\n ns,\n menuList,\n menus,\n checkedNodes,\n handleKeyDown,\n handleCheckChange,\n getFlattedNodes,\n getCheckedNodes,\n clearCheckedNodes,\n calculateCheckedValue,\n scrollToExpandingNode\n };\n }\n});\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_el_cascader_menu = resolveComponent(\"el-cascader-menu\");\n return openBlock(), createElementBlock(\"div\", {\n class: normalizeClass([_ctx.ns.b(\"panel\"), _ctx.ns.is(\"bordered\", _ctx.border)]),\n onKeydown: _ctx.handleKeyDown\n }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menus, (menu, index) => {\n return openBlock(), createBlock(_component_el_cascader_menu, {\n key: index,\n ref_for: true,\n ref: item => _ctx.menuList[index] = item,\n index,\n nodes: [...menu]\n }, {\n empty: withCtx(() => [renderSlot(_ctx.$slots, \"empty\")]),\n _: 2\n }, 1032, [\"index\", \"nodes\"]);\n }), 128))], 42, [\"onKeydown\"]);\n}\nvar CascaderPanel = /* @__PURE__ */_export_sfc(_sfc_main, [[\"render\", _sfc_render], [\"__file\", \"index.vue\"]]);\nexport { CascaderPanel as default };","map":{"version":3,"names":["_sfc_main","defineComponent","name","components","ElCascaderMenu","props","CommonProps","border","type","Boolean","default","renderLabel","Function","emits","UPDATE_MODEL_EVENT","CHANGE_EVENT","setup","emit","slots","manualChecked","ns","useNamespace","config","useCascaderConfig","store","initialLoaded","ref","menuList","checkedValue","menus","expandingNode","checkedNodes","isHoverMenu","computed","value","expandTrigger","renderLabelFn","initStore","options","cfg","Store","getNodes","lazy","isEmpty","lazyLoad","list","syncCheckedValue","node","cb","Node","loading","resolve","dataList","_node","parent","root","appendNodes","loaded","childrenData","expandNode","silent","_a","level","newMenus","slice","newExpandingNode","isLeaf","pathNodes","push","children","uid","pathValues","handleCheckChange","checked","emitClose","checkStrictly","multiple","oldNode","doCheck","calculateCheckedValue","expandParentNode","getFlattedNodes","leafOnly","getCheckedNodes","filter","clearCheckedNodes","forEach","oldNodes","newNodes","nodes","sortByOriginalOrder","values","map","valueByOption","forced","modelValue","isEqual","unique","flattenDeep","castArray","val","getNodeByValue","length","syncMenuState","cloneDeep","newCheckedNodes","reserveExpandingState","oldExpandingNode","getSameNode","reactive","nextTick","scrollToExpandingNode","isClient","menu","menuElement","$el","container","querySelector","namespace","activeNode","b","is","scrollIntoView","handleKeyDown","e","target","code","EVENT_CODE","up","down","preventDefault","distance","focusNode","getSibling","left","preMenu","getMenuIndex","expandedNode","right","nextMenu","firstNode","enter","numpadEnter","checkNode","provide","CASCADER_PANEL_INJECTION_KEY","watch","deep","immediate","onBeforeUpdate","onMounted","_sfc_render","_ctx","_cache","$props","$setup","$data","$options","_component_el_cascader_menu","resolveComponent","openBlock","createElementBlock","class","normalizeClass","onKeydown","Fragment","renderList","index","createBlock","key","ref_for","item","empty","withCtx","renderSlot","$slots","_","CascaderPanel","_export_sfc"],"sources":["../../../../../../packages/components/cascader-panel/src/index.vue"],"sourcesContent":["<template>\n <div\n :class=\"[ns.b('panel'), ns.is('bordered', border)]\"\n @keydown=\"handleKeyDown\"\n >\n <el-cascader-menu\n v-for=\"(menu, index) in menus\"\n :key=\"index\"\n :ref=\"(item) => (menuList[index] = item)\"\n :index=\"index\"\n :nodes=\"[...menu]\"\n >\n <template #empty>\n <slot name=\"empty\" />\n </template>\n </el-cascader-menu>\n </div>\n</template>\n\n<script lang=\"ts\">\n// @ts-nocheck\nimport {\n computed,\n defineComponent,\n nextTick,\n onBeforeUpdate,\n onMounted,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue'\nimport { cloneDeep, flattenDeep, isEqual } from 'lodash-unified'\nimport {\n castArray,\n focusNode,\n getSibling,\n isClient,\n isEmpty,\n scrollIntoView,\n unique,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport ElCascaderMenu from './menu.vue'\nimport Store from './store'\nimport Node from './node'\nimport { CommonProps, useCascaderConfig } from './config'\nimport { checkNode, getMenuIndex, sortByOriginalOrder } from './utils'\nimport { CASCADER_PANEL_INJECTION_KEY } from './types'\n\nimport type { PropType } from 'vue'\nimport type { Nullable } from '@element-plus/utils'\nimport type {\n default as CascaderNode,\n CascaderNodeValue,\n CascaderOption,\n CascaderValue,\n RenderLabel,\n} from './node'\n\nimport type { ElCascaderPanelContext } from './types'\n\nexport default defineComponent({\n name: 'ElCascaderPanel',\n\n components: {\n ElCascaderMenu,\n },\n\n props: {\n ...CommonProps,\n border: {\n type: Boolean,\n default: true,\n },\n renderLabel: Function as PropType<RenderLabel>,\n },\n\n emits: [UPDATE_MODEL_EVENT, CHANGE_EVENT, 'close', 'expand-change'],\n\n setup(props, { emit, slots }) {\n // for interrupt sync check status in lazy mode\n let manualChecked = false\n\n const ns = useNamespace('cascader')\n const config = useCascaderConfig(props)\n\n let store: Nullable<Store> = null\n const initialLoaded = ref(true)\n const menuList = ref<any[]>([])\n const checkedValue = ref<Nullable<CascaderValue>>(null)\n const menus = ref<CascaderNode[][]>([])\n const expandingNode = ref<Nullable<CascaderNode>>(null)\n const checkedNodes = ref<CascaderNode[]>([])\n\n const isHoverMenu = computed(() => config.value.expandTrigger === 'hover')\n const renderLabelFn = computed(() => props.renderLabel || slots.default)\n\n const initStore = () => {\n const { options } = props\n const cfg = config.value\n\n manualChecked = false\n store = new Store(options, cfg)\n menus.value = [store.getNodes()]\n\n if (cfg.lazy && isEmpty(props.options)) {\n initialLoaded.value = false\n lazyLoad(undefined, (list) => {\n if (list) {\n store = new Store(list, cfg)\n menus.value = [store.getNodes()]\n }\n initialLoaded.value = true\n syncCheckedValue(false, true)\n })\n } else {\n syncCheckedValue(false, true)\n }\n }\n\n const lazyLoad: ElCascaderPanelContext['lazyLoad'] = (node, cb) => {\n const cfg = config.value\n node! = node || new Node({}, cfg, undefined, true)\n node.loading = true\n\n const resolve = (dataList: CascaderOption[]) => {\n const _node = node as Node\n const parent = _node.root ? null : _node\n dataList && store?.appendNodes(dataList, parent as any)\n _node.loading = false\n _node.loaded = true\n _node.childrenData = _node.childrenData || []\n cb && cb(dataList)\n }\n\n cfg.lazyLoad(node, resolve as any)\n }\n\n const expandNode: ElCascaderPanelContext['expandNode'] = (node, silent) => {\n const { level } = node\n const newMenus = menus.value.slice(0, level)\n let newExpandingNode: Nullable<CascaderNode>\n\n if (node.isLeaf) {\n newExpandingNode = node.pathNodes[level - 2]\n } else {\n newExpandingNode = node\n newMenus.push(node.children)\n }\n\n if (expandingNode.value?.uid !== newExpandingNode?.uid) {\n expandingNode.value = node\n menus.value = newMenus\n !silent && emit('expand-change', node?.pathValues || [])\n }\n }\n\n const handleCheckChange: ElCascaderPanelContext['handleCheckChange'] = (\n node,\n checked,\n emitClose = true\n ) => {\n const { checkStrictly, multiple } = config.value\n const oldNode = checkedNodes.value[0]\n manualChecked = true\n\n !multiple && oldNode?.doCheck(false)\n node.doCheck(checked)\n calculateCheckedValue()\n emitClose && !multiple && !checkStrictly && emit('close')\n !emitClose && !multiple && !checkStrictly && expandParentNode(node)\n }\n\n const expandParentNode = (node) => {\n if (!node) return\n node = node.parent\n expandParentNode(node)\n node && expandNode(node)\n }\n\n const getFlattedNodes = (leafOnly: boolean) => {\n return store?.getFlattedNodes(leafOnly)\n }\n\n const getCheckedNodes = (leafOnly: boolean) => {\n return getFlattedNodes(leafOnly)?.filter((node) => node.checked !== false)\n }\n\n const clearCheckedNodes = () => {\n checkedNodes.value.forEach((node) => node.doCheck(false))\n calculateCheckedValue()\n menus.value = menus.value.slice(0, 1)\n expandingNode.value = null\n emit('expand-change', [])\n }\n\n const calculateCheckedValue = () => {\n const { checkStrictly, multiple } = config.value\n const oldNodes = checkedNodes.value\n const newNodes = getCheckedNodes(!checkStrictly)!\n // ensure the original order\n const nodes = sortByOriginalOrder(oldNodes, newNodes)\n const values = nodes.map((node) => node.valueByOption)\n checkedNodes.value = nodes\n checkedValue.value = multiple ? values : values[0] ?? null\n }\n\n const syncCheckedValue = (loaded = false, forced = false) => {\n const { modelValue } = props\n const { lazy, multiple, checkStrictly } = config.value\n const leafOnly = !checkStrictly\n\n if (\n !initialLoaded.value ||\n manualChecked ||\n (!forced && isEqual(modelValue, checkedValue.value))\n )\n return\n\n if (lazy && !loaded) {\n const values: CascaderNodeValue[] = unique(\n flattenDeep(castArray(modelValue))\n )\n const nodes = values\n .map((val) => store?.getNodeByValue(val))\n .filter((node) => !!node && !node.loaded && !node.loading) as Node[]\n\n if (nodes.length) {\n nodes.forEach((node) => {\n lazyLoad(node, () => syncCheckedValue(false, forced))\n })\n } else {\n syncCheckedValue(true, forced)\n }\n } else {\n const values = multiple ? castArray(modelValue) : [modelValue]\n const nodes = unique(\n values.map((val) => store?.getNodeByValue(val, leafOnly))\n ) as Node[]\n syncMenuState(nodes, forced)\n checkedValue.value = cloneDeep(modelValue)\n }\n }\n\n const syncMenuState = (\n newCheckedNodes: CascaderNode[],\n reserveExpandingState = true\n ) => {\n const { checkStrictly } = config.value\n const oldNodes = checkedNodes.value\n const newNodes = newCheckedNodes.filter(\n (node) => !!node && (checkStrictly || node.isLeaf)\n )\n const oldExpandingNode = store?.getSameNode(expandingNode.value!)\n const newExpandingNode =\n (reserveExpandingState && oldExpandingNode) || newNodes[0]\n\n if (newExpandingNode) {\n newExpandingNode.pathNodes.forEach((node) => expandNode(node, true))\n } else {\n expandingNode.value = null\n }\n\n oldNodes.forEach((node) => node.doCheck(false))\n reactive(newNodes).forEach((node) => node.doCheck(true))\n checkedNodes.value = newNodes\n nextTick(scrollToExpandingNode)\n }\n\n const scrollToExpandingNode = () => {\n if (!isClient) return\n\n menuList.value.forEach((menu) => {\n const menuElement = menu?.$el\n if (menuElement) {\n const container = menuElement.querySelector(\n `.${ns.namespace.value}-scrollbar__wrap`\n )\n const activeNode =\n menuElement.querySelector(`.${ns.b('node')}.${ns.is('active')}`) ||\n menuElement.querySelector(`.${ns.b('node')}.in-active-path`)\n scrollIntoView(container, activeNode)\n }\n })\n }\n\n const handleKeyDown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement\n const { code } = e\n\n switch (code) {\n case EVENT_CODE.up:\n case EVENT_CODE.down: {\n e.preventDefault()\n const distance = code === EVENT_CODE.up ? -1 : 1\n focusNode(\n getSibling(target, distance, `.${ns.b('node')}[tabindex=\"-1\"]`)\n )\n break\n }\n case EVENT_CODE.left: {\n e.preventDefault()\n const preMenu = menuList.value[getMenuIndex(target) - 1]\n const expandedNode = preMenu?.$el.querySelector(\n `.${ns.b('node')}[aria-expanded=\"true\"]`\n )\n focusNode(expandedNode)\n break\n }\n case EVENT_CODE.right: {\n e.preventDefault()\n const nextMenu = menuList.value[getMenuIndex(target) + 1]\n const firstNode = nextMenu?.$el.querySelector(\n `.${ns.b('node')}[tabindex=\"-1\"]`\n )\n focusNode(firstNode)\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n checkNode(target)\n break\n }\n }\n\n provide(\n CASCADER_PANEL_INJECTION_KEY,\n reactive({\n config,\n expandingNode,\n checkedNodes,\n isHoverMenu,\n initialLoaded,\n renderLabelFn,\n lazyLoad,\n expandNode,\n handleCheckChange,\n })\n )\n\n watch([config, () => props.options], initStore, {\n deep: true,\n immediate: true,\n })\n\n watch(\n () => props.modelValue,\n () => {\n manualChecked = false\n syncCheckedValue()\n },\n {\n deep: true,\n }\n )\n\n watch(\n () => checkedValue.value,\n (val) => {\n if (!isEqual(val, props.modelValue)) {\n emit(UPDATE_MODEL_EVENT, val)\n emit(CHANGE_EVENT, val)\n }\n }\n )\n\n onBeforeUpdate(() => (menuList.value = []))\n\n onMounted(() => !isEmpty(props.modelValue) && syncCheckedValue())\n\n return {\n ns,\n menuList,\n menus,\n checkedNodes,\n handleKeyDown,\n handleCheckChange,\n getFlattedNodes,\n /**\n * @description get an array of currently selected node,(leafOnly) whether only return the leaf checked nodes, default is `false`\n */\n getCheckedNodes,\n /**\n * @description clear checked nodes\n */\n clearCheckedNodes,\n calculateCheckedValue,\n scrollToExpandingNode,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;AAoEA,MAAKA,SAAA,GAAaC,eAAa;EAC7BC,IAAM;EAENC,UAAY;IACVC;EAAA,CACF;EAEAC,KAAO;IACL,GAAGC,WAAA;IACHC,MAAQ;MACNC,IAAM,EAAAC,OAAA;MACNC,OAAS;IAAA,CACX;IACAC,WAAa,EAAAC;EAAA,CACf;EAEAC,KAAO,GAACC,kBAAoB,EAAAC,YAAA,EAAc,SAAS,eAAe;EAElEC,KAAMA,CAAAX,KAAA,EAAO;IAAEY,IAAA;IAAMC;EAAA,CAAS;IAE5B,IAAIC,aAAgB;IAEd,MAAAC,EAAA,GAAKC,YAAA,CAAa,UAAU;IAC5B,MAAAC,MAAA,GAASC,iBAAA,CAAkBlB,KAAK;IAEtC,IAAImB,KAAyB;IACvB,MAAAC,aAAA,GAAgBC,GAAA,CAAI,IAAI;IACxB,MAAAC,QAAA,GAAWD,GAAW,GAAE;IACxB,MAAAE,YAAA,GAAeF,GAAA,CAA6B,IAAI;IAChD,MAAAG,KAAA,GAAQH,GAAsB,GAAE;IAChC,MAAAI,aAAA,GAAgBJ,GAAA,CAA4B,IAAI;IAChD,MAAAK,YAAA,GAAeL,GAAoB,GAAE;IAE3C,MAAMM,WAAA,GAAcC,QAAS,OAAMX,MAAO,CAAAY,KAAA,CAAMC,aAAA,KAAkB,OAAO;IACzE,MAAMC,aAAA,GAAgBH,QAAS,OAAM5B,KAAM,CAAAM,WAAA,IAAeO,KAAA,CAAMR,OAAO;IAEvE,MAAM2B,SAAA,GAAYA,CAAA,KAAM;MAChB;QAAEC;MAAA,CAAY,GAAAjC,KAAA;MACpB,MAAMkC,GAAA,GAAMjB,MAAO,CAAAY,KAAA;MAEHf,aAAA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