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UAAU,CAAE,GAAF,EAAsB;AAC9B,aAAO,CAAC,CAAC,KAAK,MAAP,IAAiB,KAAK,aAAL,CAAmB,GAAnB,CAAuB,GAAvB,CAAxB;AACD;;AAhNM,GAjIF;;AAoVP,EAAA,MAAM,CAAE,CAAF,EAAG;AACP,UAAM,QAAQ,GAA+B,KAAK,KAAL,CAAW,MAAX,GACzC,KAAK,KAAL,CAAW,GAAX,CAAe,aAAa,CAAC,OAAd,CAAsB,OAAtB,CAA8B,QAA9B,CAAuC,IAAvC,CAA4C,IAA5C,CAAf;AACF;AAF2C,MAGzC,KAAK,MAAL,CAAY,OAHhB,CADO,CAIkB;;AAEzB,WAAO,CAAC,CAAC,KAAD,EAAQ;AACd,MAAA,WAAW,EAAE,YADC;AAEd,MAAA,KAAK,EAAE;AACL,iCAAyB,KAAK,SADzB;AAEL,6BAAqB,KAAK,KAFrB;AAGL,WAAG,KAAK;AAHH;AAFO,KAAR,EAOL,QAPK,CAAR;AAQD;;AAlWM,CAJM,CAAf","sourcesContent":["// Styles\nimport './VTreeview.sass'\n\n// Types\nimport { VNode, VNodeChildrenArrayContents } from 'vue'\nimport { PropValidator } from 'vue/types/options'\n\n// Components\nimport VTreeviewNode, { VTreeviewNodeProps } from './VTreeviewNode'\n\n// Mixins\nimport Themeable from '../../mixins/themeable'\nimport { provide as RegistrableProvide } from '../../mixins/registrable'\n\n// Utils\nimport {\n arrayDiff,\n deepEqual,\n getObjectValueByPath,\n} from '../../util/helpers'\nimport mixins from '../../util/mixins'\nimport { consoleWarn } from '../../util/console'\nimport {\n filterTreeItems,\n FilterTreeItemFunction,\n filterTreeItem,\n} from './util/filterTreeItems'\n\ntype VTreeviewNodeInstance = InstanceType<typeof VTreeviewNode>\n\ntype NodeCache = Set<string | number>\ntype NodeArray = (string | number)[]\n\ntype NodeState = {\n parent: number | string | null\n children: (number | string)[]\n vnode: VTreeviewNodeInstance | null\n isActive: boolean\n isSelected: boolean\n isIndeterminate: boolean\n isOpen: boolean\n item: any\n}\n\nexport default mixins(\n RegistrableProvide('treeview'),\n Themeable\n /* @vue/component */\n).extend({\n name: 'v-treeview',\n\n provide (): object {\n return { treeview: this }\n },\n\n props: {\n active: {\n type: Array,\n default: () => ([]),\n } as PropValidator<NodeArray>,\n dense: Boolean,\n filter: Function as PropValidator<FilterTreeItemFunction>,\n hoverable: Boolean,\n items: {\n type: Array,\n default: () => ([]),\n } as PropValidator<any[]>,\n multipleActive: Boolean,\n open: {\n type: Array,\n default: () => ([]),\n } as PropValidator<NodeArray>,\n openAll: Boolean,\n returnObject: {\n type: Boolean,\n default: false, // TODO: Should be true in next major\n },\n search: String,\n selectionType: {\n type: String,\n default: 'leaf',\n validator: (v: string) => ['leaf', 'independent'].includes(v),\n } as PropValidator<'leaf' | 'independent'>,\n value: {\n type: Array,\n default: () => ([]),\n } as PropValidator<NodeArray>,\n ...VTreeviewNodeProps,\n },\n\n data: () => ({\n activeCache: new Set() as NodeCache,\n nodes: {} as Record<string | number, NodeState>,\n openCache: new Set() as NodeCache,\n selectedCache: new Set() as NodeCache,\n }),\n\n computed: {\n excludedItems (): Set<string | number> {\n const excluded = new Set<string|number>()\n\n if (!this.search) return excluded\n\n for (let i = 0; i < this.items.length; i++) {\n filterTreeItems(\n this.filter || filterTreeItem,\n this.items[i],\n this.search,\n this.itemKey,\n this.itemText,\n this.itemChildren,\n excluded\n )\n }\n\n return excluded\n },\n },\n\n watch: {\n items: {\n handler () {\n const oldKeys = Object.keys(this.nodes).map(k => getObjectValueByPath(this.nodes[k].item, this.itemKey))\n const newKeys = this.getKeys(this.items)\n const diff = arrayDiff(newKeys, oldKeys)\n\n // We only want to do stuff if items have changed\n if (!diff.length && newKeys.length < oldKeys.length) return\n\n // If nodes are removed we need to clear them from this.nodes\n diff.forEach(k => delete this.nodes[k])\n\n const oldSelectedCache = [...this.selectedCache]\n this.selectedCache = new Set()\n this.activeCache = new Set()\n this.openCache = new Set()\n this.buildTree(this.items)\n\n // Only emit selected if selection has changed\n // as a result of items changing. This fixes a\n // potential double emit when selecting a node\n // with dynamic children\n if (!deepEqual(oldSelectedCache, [...this.selectedCache])) this.emitSelected()\n },\n deep: true,\n },\n active (value: (string | number | any)[]) {\n this.handleNodeCacheWatcher(value, this.activeCache, this.updateActive, this.emitActive)\n },\n value (value: (string | number | any)[]) {\n this.handleNodeCacheWatcher(value, this.selectedCache, this.updateSelected, this.emitSelected)\n },\n open (value: (string | number | any)[]) {\n this.handleNodeCacheWatcher(value, this.openCache, this.updateOpen, this.emitOpen)\n },\n },\n\n created () {\n this.buildTree(this.items)\n this.value.forEach(key => this.updateSelected(key, true))\n this.active.forEach(key => this.updateActive(key, true))\n },\n\n mounted () {\n // Save the developer from themselves\n if (this.$slots.prepend || this.$slots.append) {\n consoleWarn('The prepend and append slots require a slot-scope attribute', this)\n }\n\n if (this.openAll) {\n this.updateAll(true)\n } else {\n this.open.forEach(key => this.updateOpen(key, true))\n this.emitOpen()\n }\n },\n\n methods: {\n /** @public */\n updateAll (value: boolean) {\n Object.keys(this.nodes).forEach(key => this.updateOpen(getObjectValueByPath(this.nodes[key].item, this.itemKey), value))\n this.emitOpen()\n },\n getKeys (items: any[], keys: any[] = []) {\n for (let i = 0; i < items.length; i++) {\n const key = getObjectValueByPath(items[i], this.itemKey)\n keys.push(key)\n const children = getObjectValueByPath(items[i], this.itemChildren)\n if (children) {\n keys.push(...this.getKeys(children))\n }\n }\n\n return keys\n },\n buildTree (items: any[], parent: (string | number | null) = null) {\n for (let i = 0; i < items.length; i++) {\n const item = items[i]\n const key = getObjectValueByPath(item, this.itemKey)\n const children = getObjectValueByPath(item, this.itemChildren, [])\n const oldNode = this.nodes.hasOwnProperty(key) ? this.nodes[key] : {\n isSelected: false, isIndeterminate: false, isActive: false, isOpen: false, vnode: null,\n } as NodeState\n\n const node: any = {\n vnode: oldNode.vnode,\n parent,\n children: children.map((c: any) => getObjectValueByPath(c, this.itemKey)),\n item,\n }\n\n this.buildTree(children, key)\n\n // This fixed bug with dynamic children resetting selected parent state\n if (!this.nodes.hasOwnProperty(key) && parent !== null && this.nodes.hasOwnProperty(parent)) {\n node.isSelected = this.nodes[parent].isSelected\n node.isIndeterminate = this.nodes[parent].isIndeterminate\n } else {\n node.isSelected = oldNode.isSelected\n node.isIndeterminate = oldNode.isIndeterminate\n }\n\n node.isActive = oldNode.isActive\n node.isOpen = oldNode.isOpen\n\n this.nodes[key] = !children.length ? node : this.calculateState(node, this.nodes)\n\n // Don't forget to rebuild cache\n if (this.nodes[key].isSelected) this.selectedCache.add(key)\n if (this.nodes[key].isActive) this.activeCache.add(key)\n if (this.nodes[key].isOpen) this.openCache.add(key)\n\n this.updateVnodeState(key)\n }\n },\n calculateState (node: NodeState, state: Record<string | number, NodeState>) {\n const counts = node.children.reduce((counts: number[], child: string | number) => {\n counts[0] += +Boolean(state[child].isSelected)\n counts[1] += +Boolean(state[child].isIndeterminate)\n return counts\n }, [0, 0])\n\n node.isSelected = !!node.children.length && counts[0] === node.children.length\n node.isIndeterminate = !node.isSelected && (counts[0] > 0 || counts[1] > 0)\n\n return node\n },\n emitOpen () {\n this.emitNodeCache('update:open', this.openCache)\n },\n emitSelected () {\n this.emitNodeCache('input', this.selectedCache)\n },\n emitActive () {\n this.emitNodeCache('update:active', this.activeCache)\n },\n emitNodeCache (event: string, cache: NodeCache) {\n this.$emit(event, this.returnObject ? [...cache].map(key => this.nodes[key].item) : [...cache])\n },\n handleNodeCacheWatcher (value: any[], cache: NodeCache, updateFn: Function, emitFn: Function) {\n value = this.returnObject ? value.map(v => getObjectValueByPath(v, this.itemKey)) : value\n const old = [...cache]\n if (deepEqual(old, value)) return\n\n old.forEach(key => updateFn(key, false))\n value.forEach(key => updateFn(key, true))\n\n emitFn()\n },\n getDescendants (key: string | number, descendants: NodeArray = []) {\n const children = this.nodes[key].children\n\n descendants.push(...children)\n\n for (let i = 0; i < children.length; i++) {\n descendants = this.getDescendants(children[i], descendants)\n }\n\n return descendants\n },\n getParents (key: string | number) {\n let parent = this.nodes[key].parent\n\n const parents = []\n while (parent !== null) {\n parents.push(parent)\n parent = this.nodes[parent].parent\n }\n\n return parents\n },\n register (node: VTreeviewNodeInstance) {\n const key = getObjectValueByPath(node.item, this.itemKey)\n this.nodes[key].vnode = node\n\n this.updateVnodeState(key)\n },\n unregister (node: VTreeviewNodeInstance) {\n const key = getObjectValueByPath(node.item, this.itemKey)\n if (this.nodes[key]) this.nodes[key].vnode = null\n },\n isParent (key: string | number) {\n return this.nodes[key].children && this.nodes[key].children.length\n },\n updateActive (key: string | number, isActive: boolean) {\n if (!this.nodes.hasOwnProperty(key)) return\n\n if (!this.multipleActive) {\n this.activeCache.forEach(active => {\n this.nodes[active].isActive = false\n this.updateVnodeState(active)\n this.activeCache.delete(active)\n })\n }\n\n const node = this.nodes[key]\n if (!node) return\n\n if (isActive) this.activeCache.add(key)\n else this.activeCache.delete(key)\n\n node.isActive = isActive\n\n this.updateVnodeState(key)\n },\n updateSelected (key: string | number, isSelected: boolean) {\n if (!this.nodes.hasOwnProperty(key)) return\n\n const changed = new Map()\n\n if (this.selectionType !== 'independent') {\n const descendants = [key, ...this.getDescendants(key)]\n descendants.forEach(descendant => {\n this.nodes[descendant].isSelected = isSelected\n this.nodes[descendant].isIndeterminate = false\n changed.set(descendant, isSelected)\n })\n\n const parents = this.getParents(key)\n parents.forEach(parent => {\n this.nodes[parent] = this.calculateState(this.nodes[parent], this.nodes)\n changed.set(parent, this.nodes[parent].isSelected)\n })\n } else {\n this.nodes[key].isSelected = isSelected\n this.nodes[key].isIndeterminate = false\n changed.set(key, isSelected)\n }\n\n for (const [key, value] of changed.entries()) {\n this.updateVnodeState(key)\n\n if (this.selectionType === 'leaf' && this.isParent(key)) continue\n\n value === true ? this.selectedCache.add(key) : this.selectedCache.delete(key)\n }\n },\n updateOpen (key: string | number, isOpen: boolean) {\n if (!this.nodes.hasOwnProperty(key)) return\n\n const node = this.nodes[key]\n const children = getObjectValueByPath(node.item, this.itemChildren)\n\n if (children && !children.length && node.vnode && !node.vnode.hasLoaded) {\n node.vnode.checkChildren().then(() => this.updateOpen(key, isOpen))\n } else if (children && children.length) {\n node.isOpen = isOpen\n\n node.isOpen ? this.openCache.add(key) : this.openCache.delete(key)\n\n this.updateVnodeState(key)\n }\n },\n updateVnodeState (key: string | number) {\n const node = this.nodes[key]\n\n if (node && node.vnode) {\n node.vnode.isSelected = node.isSelected\n node.vnode.isIndeterminate = node.isIndeterminate\n node.vnode.isActive = node.isActive\n node.vnode.isOpen = node.isOpen\n }\n },\n isExcluded (key: string | number) {\n return !!this.search && this.excludedItems.has(key)\n },\n },\n\n render (h): VNode {\n const children: VNodeChildrenArrayContents = this.items.length\n ? this.items.map(VTreeviewNode.options.methods.genChild.bind(this))\n /* istanbul ignore next */\n : this.$slots.default! // TODO: remove type annotation with TS 3.2\n\n return h('div', {\n staticClass: 'v-treeview',\n class: {\n 'v-treeview--hoverable': this.hoverable,\n 'v-treeview--dense': this.dense,\n ...this.themeClasses,\n },\n }, children)\n },\n})\n"],"sourceRoot":"","file":"VTreeview.js"} |