1 line
30 KiB
Plaintext
1 line
30 KiB
Plaintext
|
{"version":3,"file":"VTreeview.mjs","names":["VTreeviewNode","VTreeviewNodeProps","Themeable","provide","RegistrableProvide","arrayDiff","deepEqual","getObjectValueByPath","mixins","consoleWarn","filterTreeItems","filterTreeItem","extend","name","treeview","props","active","type","Array","default","dense","Boolean","disabled","filter","Function","hoverable","items","multipleActive","open","openAll","returnObject","search","String","value","data","level","activeCache","Set","nodes","openCache","selectedCache","computed","excludedItems","excluded","i","length","itemKey","itemText","itemChildren","watch","handler","oldKeys","Object","keys","map","k","item","newKeys","getKeys","diff","forEach","oldSelectedCache","buildTree","emitSelected","deep","handleNodeCacheWatcher","updateActive","emitActive","updateSelected","updateOpen","emitOpen","created","getValue","key","mounted","$slots","prepend","append","updateAll","methods","arguments","undefined","push","children","parent","oldNode","hasOwnProperty","isSelected","isIndeterminate","isActive","isOpen","vnode","node","c","selectionType","calculateState","add","updateVnodeState","state","counts","reduce","child","emitNodeCache","event","cache","$emit","updateFn","emitFn","v","old","getDescendants","descendants","getParents","parents","register","unregister","isParent","delete","isForced","changed","Map","descendant","itemDisabled","set","calculated","entries","hasLoaded","checkChildren","then","isExcluded","has","render","h","genChild","options","bind","staticClass","class","themeClasses"],"sources":["../../../src/components/VTreeview/VTreeview.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable */\n\n// Styles\nimport './VTreeview.sass'\n\n// Types\nimport { VNode, VNodeChildrenArrayContents, PropType } from 'vue'\nimport { PropValidator } from 'vue/types/options'\nimport { TreeviewItemFunction } from 'vuetify/types'\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 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 disabled: Boolean,\n filter: Function as PropType<TreeviewItemFunction>,\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 value: {\n type: Array,\n default: () => ([]),\n } as PropValidator<NodeArray>,\n ...VTreeviewNodeProps,\n },\n\n data: () => ({\n level: -1,\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 excl
|