@vuetify/nightly 3.7.12-master.2025-02-13 → 3.7.12-master.2025-02-14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -208,7 +208,22 @@ export const useNested = props => {
208
208
  parents: parents.value,
209
209
  event
210
210
  });
211
- newActivated && (activated.value = newActivated);
211
+ if (newActivated.size !== activated.value.size) {
212
+ activated.value = newActivated;
213
+ } else {
214
+ for (const value of newActivated) {
215
+ if (!activated.value.has(value)) {
216
+ activated.value = newActivated;
217
+ return;
218
+ }
219
+ }
220
+ for (const value of activated.value) {
221
+ if (!newActivated.has(value)) {
222
+ activated.value = newActivated;
223
+ return;
224
+ }
225
+ }
226
+ }
212
227
  },
213
228
  children,
214
229
  parents,
@@ -1 +1 @@
1
- {"version":3,"file":"nested.mjs","names":["useProxiedModel","computed","inject","onBeforeMount","onBeforeUnmount","provide","ref","shallowRef","toRaw","toRef","independentActiveStrategy","independentSingleActiveStrategy","leafActiveStrategy","leafSingleActiveStrategy","listOpenStrategy","multipleOpenStrategy","singleOpenStrategy","classicSelectStrategy","independentSelectStrategy","independentSingleSelectStrategy","leafSelectStrategy","leafSingleSelectStrategy","consoleError","getCurrentInstance","getUid","propsFactory","VNestedSymbol","Symbol","for","emptyNested","id","root","register","unregister","parents","Map","children","open","openOnSelect","activate","select","activatable","selectable","opened","Set","activated","selected","selectedValues","getPath","makeNestedProps","Boolean","activeStrategy","String","Function","Object","selectStrategy","openStrategy","mandatory","useNested","props","isUnmounted","v","values","value","in","out","path","parent","unshift","get","vm","nodeIds","nested","arr","key","entries","push","parentId","isGroup","has","map","join","newPath","concat","add","set","delete","list","filter","child","event","emit","newOpened","newSelected","newActivated","useNestedItem","uidSymbol","computedId","undefined","item","e","isOpen","isActivated","isSelected","isIndeterminate","isLeaf","isGroupActivator","useNestedGroupActivator"],"sources":["../../../src/composables/nested/nested.ts"],"sourcesContent":["// Composables\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport {\n computed,\n inject,\n onBeforeMount,\n onBeforeUnmount,\n provide,\n ref,\n shallowRef,\n toRaw,\n toRef,\n} from 'vue'\nimport {\n independentActiveStrategy,\n independentSingleActiveStrategy,\n leafActiveStrategy,\n leafSingleActiveStrategy,\n} from './activeStrategies'\nimport { listOpenStrategy, multipleOpenStrategy, singleOpenStrategy } from './openStrategies'\nimport {\n classicSelectStrategy,\n independentSelectStrategy,\n independentSingleSelectStrategy,\n leafSelectStrategy,\n leafSingleSelectStrategy,\n} from './selectStrategies'\nimport { consoleError, getCurrentInstance, getUid, propsFactory } from '@/util'\n\n// Types\nimport type { InjectionKey, PropType, Ref } from 'vue'\nimport type { ActiveStrategy } from './activeStrategies'\nimport type { OpenStrategy } from './openStrategies'\nimport type { SelectStrategy } from './selectStrategies'\nimport type { EventProp } from '@/util'\n\nexport type ActiveStrategyProp =\n | 'single-leaf'\n | 'leaf'\n | 'independent'\n | 'single-independent'\n | ActiveStrategy\n | ((mandatory: boolean) => ActiveStrategy)\nexport type SelectStrategyProp =\n | 'single-leaf'\n | 'leaf'\n | 'independent'\n | 'single-independent'\n | 'classic'\n | SelectStrategy\n | ((mandatory: boolean) => SelectStrategy)\nexport type OpenStrategyProp = 'single' | 'multiple' | 'list' | OpenStrategy\n\nexport interface NestedProps {\n activatable: boolean\n selectable: boolean\n activeStrategy: ActiveStrategyProp | undefined\n selectStrategy: SelectStrategyProp | undefined\n openStrategy: OpenStrategyProp | undefined\n activated: any\n selected: any\n opened: any\n mandatory: boolean\n 'onUpdate:activated': EventProp<[any]> | undefined\n 'onUpdate:selected': EventProp<[any]> | undefined\n 'onUpdate:opened': EventProp<[any]> | undefined\n}\n\ntype NestedProvide = {\n id: Ref<unknown>\n isGroupActivator?: boolean\n root: {\n children: Ref<Map<unknown, unknown[]>>\n parents: Ref<Map<unknown, unknown>>\n activatable: Ref<boolean>\n selectable: Ref<boolean>\n opened: Ref<Set<unknown>>\n activated: Ref<Set<unknown>>\n selected: Ref<Map<unknown, 'on' | 'off' | 'indeterminate'>>\n selectedValues: Ref<unknown[]>\n register: (id: unknown, parentId: unknown, isGroup?: boolean) => void\n unregister: (id: unknown) => void\n open: (id: unknown, value: boolean, event?: Event) => void\n activate: (id: unknown, value: boolean, event?: Event) => void\n select: (id: unknown, value: boolean, event?: Event) => void\n openOnSelect: (id: unknown, value: boolean, event?: Event) => void\n getPath: (id: unknown) => unknown[]\n }\n}\n\nexport const VNestedSymbol: InjectionKey<NestedProvide> = Symbol.for('vuetify:nested')\n\nexport const emptyNested: NestedProvide = {\n id: shallowRef(),\n root: {\n register: () => null,\n unregister: () => null,\n parents: ref(new Map()),\n children: ref(new Map()),\n open: () => null,\n openOnSelect: () => null,\n activate: () => null,\n select: () => null,\n activatable: ref(false),\n selectable: ref(false),\n opened: ref(new Set()),\n activated: ref(new Set()),\n selected: ref(new Map()),\n selectedValues: ref([]),\n getPath: () => [],\n },\n}\n\nexport const makeNestedProps = propsFactory({\n activatable: Boolean,\n selectable: Boolean,\n activeStrategy: [String, Function, Object] as PropType<ActiveStrategyProp>,\n selectStrategy: [String, Function, Object] as PropType<SelectStrategyProp>,\n openStrategy: [String, Object] as PropType<OpenStrategyProp>,\n opened: null,\n activated: null,\n selected: null,\n mandatory: Boolean,\n}, 'nested')\n\nexport const useNested = (props: NestedProps) => {\n let isUnmounted = false\n const children = ref(new Map<unknown, unknown[]>())\n const parents = ref(new Map<unknown, unknown>())\n\n const opened = useProxiedModel(props, 'opened', props.opened, v => new Set(v), v => [...v.values()])\n\n const activeStrategy = computed(() => {\n if (typeof props.activeStrategy === 'object') return props.activeStrategy\n if (typeof props.activeStrategy === 'function') return props.activeStrategy(props.mandatory)\n\n switch (props.activeStrategy) {\n case 'leaf': return leafActiveStrategy(props.mandatory)\n case 'single-leaf': return leafSingleActiveStrategy(props.mandatory)\n case 'independent': return independentActiveStrategy(props.mandatory)\n case 'single-independent':\n default: return independentSingleActiveStrategy(props.mandatory)\n }\n })\n\n const selectStrategy = computed(() => {\n if (typeof props.selectStrategy === 'object') return props.selectStrategy\n if (typeof props.selectStrategy === 'function') return props.selectStrategy(props.mandatory)\n\n switch (props.selectStrategy) {\n case 'single-leaf': return leafSingleSelectStrategy(props.mandatory)\n case 'leaf': return leafSelectStrategy(props.mandatory)\n case 'independent': return independentSelectStrategy(props.mandatory)\n case 'single-independent': return independentSingleSelectStrategy(props.mandatory)\n case 'classic':\n default: return classicSelectStrategy(props.mandatory)\n }\n })\n\n const openStrategy = computed(() => {\n if (typeof props.openStrategy === 'object') return props.openStrategy\n\n switch (props.openStrategy) {\n case 'list': return listOpenStrategy\n case 'single': return singleOpenStrategy\n case 'multiple':\n default: return multipleOpenStrategy\n }\n })\n\n const activated = useProxiedModel(\n props,\n 'activated',\n props.activated,\n v => activeStrategy.value.in(v, children.value, parents.value),\n v => activeStrategy.value.out(v, children.value, parents.value),\n )\n const selected = useProxiedModel(\n props,\n 'selected',\n props.selected,\n v => selectStrategy.value.in(v, children.value, parents.value),\n v => selectStrategy.value.out(v, children.value, parents.value),\n )\n\n onBeforeUnmount(() => {\n isUnmounted = true\n })\n\n function getPath (id: unknown) {\n const path: unknown[] = []\n let parent: unknown = id\n\n while (parent != null) {\n path.unshift(parent)\n parent = parents.value.get(parent)\n }\n\n return path\n }\n\n const vm = getCurrentInstance('nested')\n\n const nodeIds = new Set<unknown>()\n\n const nested: NestedProvide = {\n id: shallowRef(),\n root: {\n opened,\n activatable: toRef(props, 'activatable'),\n selectable: toRef(props, 'selectable'),\n activated,\n selected,\n selectedValues: computed(() => {\n const arr = []\n\n for (const [key, value] of selected.value.entries()) {\n if (value === 'on') arr.push(key)\n }\n\n return arr\n }),\n register: (id, parentId, isGroup) => {\n if (nodeIds.has(id)) {\n const path = getPath(id).map(String).join(' -> ')\n const newPath = getPath(parentId).concat(id).map(String).join(' -> ')\n consoleError(`Multiple nodes with the same ID\\n\\t${path}\\n\\t${newPath}`)\n return\n } else {\n nodeIds.add(id)\n }\n\n parentId && id !== parentId && parents.value.set(id, parentId)\n\n isGroup && children.value.set(id, [])\n\n if (parentId != null) {\n children.value.set(parentId, [...children.value.get(parentId) || [], id])\n }\n },\n unregister: id => {\n if (isUnmounted) return\n\n nodeIds.delete(id)\n children.value.delete(id)\n const parent = parents.value.get(id)\n if (parent) {\n const list = children.value.get(parent) ?? []\n children.value.set(parent, list.filter(child => child !== id))\n }\n parents.value.delete(id)\n },\n open: (id, value, event) => {\n vm.emit('click:open', { id, value, path: getPath(id), event })\n\n const newOpened = openStrategy.value.open({\n id,\n value,\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n\n newOpened && (opened.value = newOpened)\n },\n openOnSelect: (id, value, event) => {\n const newOpened = openStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newOpened && (opened.value = newOpened)\n },\n select: (id, value, event) => {\n vm.emit('click:select', { id, value, path: getPath(id), event })\n\n const newSelected = selectStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newSelected && (selected.value = newSelected)\n\n nested.root.openOnSelect(id, value, event)\n },\n activate: (id, value, event) => {\n if (!props.activatable) {\n return nested.root.select(id, true, event)\n }\n\n vm.emit('click:activate', { id, value, path: getPath(id), event })\n\n const newActivated = activeStrategy.value.activate({\n id,\n value,\n activated: new Set(activated.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n\n newActivated && (activated.value = newActivated)\n },\n children,\n parents,\n getPath,\n },\n }\n\n provide(VNestedSymbol, nested)\n\n return nested.root\n}\n\nexport const useNestedItem = (id: Ref<unknown>, isGroup: boolean) => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n const uidSymbol = Symbol(getUid())\n const computedId = computed(() => id.value !== undefined ? id.value : uidSymbol)\n\n const item = {\n ...parent,\n id: computedId,\n open: (open: boolean, e: Event) => parent.root.open(computedId.value, open, e),\n openOnSelect: (open: boolean, e?: Event) => parent.root.openOnSelect(computedId.value, open, e),\n isOpen: computed(() => parent.root.opened.value.has(computedId.value)),\n parent: computed(() => parent.root.parents.value.get(computedId.value)),\n activate: (activated: boolean, e?: Event) => parent.root.activate(computedId.value, activated, e),\n isActivated: computed(() => parent.root.activated.value.has(toRaw(computedId.value))),\n select: (selected: boolean, e?: Event) => parent.root.select(computedId.value, selected, e),\n isSelected: computed(() => parent.root.selected.value.get(toRaw(computedId.value)) === 'on'),\n isIndeterminate: computed(() => parent.root.selected.value.get(toRaw(computedId.value)) === 'indeterminate'),\n isLeaf: computed(() => !parent.root.children.value.get(computedId.value)),\n isGroupActivator: parent.isGroupActivator,\n }\n\n onBeforeMount(() => {\n !parent.isGroupActivator && parent.root.register(computedId.value, parent.id.value, isGroup)\n })\n\n onBeforeUnmount(() => {\n !parent.isGroupActivator && parent.root.unregister(computedId.value)\n })\n\n isGroup && provide(VNestedSymbol, item)\n\n return item\n}\n\nexport const useNestedGroupActivator = () => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n provide(VNestedSymbol, { ...parent, isGroupActivator: true })\n}\n"],"mappings":"AAAA;AAAA,SACSA,eAAe,+BAExB;AACA,SACEC,QAAQ,EACRC,MAAM,EACNC,aAAa,EACbC,eAAe,EACfC,OAAO,EACPC,GAAG,EACHC,UAAU,EACVC,KAAK,EACLC,KAAK,QACA,KAAK;AAAA,SAEVC,yBAAyB,EACzBC,+BAA+B,EAC/BC,kBAAkB,EAClBC,wBAAwB;AAAA,SAEjBC,gBAAgB,EAAEC,oBAAoB,EAAEC,kBAAkB;AAAA,SAEjEC,qBAAqB,EACrBC,yBAAyB,EACzBC,+BAA+B,EAC/BC,kBAAkB,EAClBC,wBAAwB;AAAA,SAEjBC,YAAY,EAAEC,kBAAkB,EAAEC,MAAM,EAAEC,YAAY,gCAE/D;AA6DA,OAAO,MAAMC,aAA0C,GAAGC,MAAM,CAACC,GAAG,CAAC,gBAAgB,CAAC;AAEtF,OAAO,MAAMC,WAA0B,GAAG;E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ACgE,MAAM,CAACuC,gBAAgB,IAAIvC,MAAM,CAACpC,IAAI,CAACC,QAAQ,CAACiE,UAAU,CAAClC,KAAK,EAAEI,MAAM,CAACrC,EAAE,CAACiC,KAAK,EAAEe,OAAO,CAAC;EAC9F,CAAC,CAAC;EAEF1E,eAAe,CAAC,MAAM;IACpB,CAAC+D,MAAM,CAACuC,gBAAgB,IAAIvC,MAAM,CAACpC,IAAI,CAACE,UAAU,CAACgE,UAAU,CAAClC,KAAK,CAAC;EACtE,CAAC,CAAC;EAEFe,OAAO,IAAIzE,OAAO,CAACqB,aAAa,EAAEyE,IAAI,CAAC;EAEvC,OAAOA,IAAI;AACb,CAAC;AAED,OAAO,MAAMQ,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMxC,MAAM,GAAGjE,MAAM,CAACwB,aAAa,EAAEG,WAAW,CAAC;EAEjDxB,OAAO,CAACqB,aAAa,EAAE;IAAE,GAAGyC,MAAM;IAAEuC,gBAAgB,EAAE;EAAK,CAAC,CAAC;AAC/D,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"nested.mjs","names":["useProxiedModel","computed","inject","onBeforeMount","onBeforeUnmount","provide","ref","shallowRef","toRaw","toRef","independentActiveStrategy","independentSingleActiveStrategy","leafActiveStrategy","leafSingleActiveStrategy","listOpenStrategy","multipleOpenStrategy","singleOpenStrategy","classicSelectStrategy","independentSelectStrategy","independentSingleSelectStrategy","leafSelectStrategy","leafSingleSelectStrategy","consoleError","getCurrentInstance","getUid","propsFactory","VNestedSymbol","Symbol","for","emptyNested","id","root","register","unregister","parents","Map","children","open","openOnSelect","activate","select","activatable","selectable","opened","Set","activated","selected","selectedValues","getPath","makeNestedProps","Boolean","activeStrategy","String","Function","Object","selectStrategy","openStrategy","mandatory","useNested","props","isUnmounted","v","values","value","in","out","path","parent","unshift","get","vm","nodeIds","nested","arr","key","entries","push","parentId","isGroup","has","map","join","newPath","concat","add","set","delete","list","filter","child","event","emit","newOpened","newSelected","newActivated","size","useNestedItem","uidSymbol","computedId","undefined","item","e","isOpen","isActivated","isSelected","isIndeterminate","isLeaf","isGroupActivator","useNestedGroupActivator"],"sources":["../../../src/composables/nested/nested.ts"],"sourcesContent":["// Composables\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport {\n computed,\n inject,\n onBeforeMount,\n onBeforeUnmount,\n provide,\n ref,\n shallowRef,\n toRaw,\n toRef,\n} from 'vue'\nimport {\n independentActiveStrategy,\n independentSingleActiveStrategy,\n leafActiveStrategy,\n leafSingleActiveStrategy,\n} from './activeStrategies'\nimport { listOpenStrategy, multipleOpenStrategy, singleOpenStrategy } from './openStrategies'\nimport {\n classicSelectStrategy,\n independentSelectStrategy,\n independentSingleSelectStrategy,\n leafSelectStrategy,\n leafSingleSelectStrategy,\n} from './selectStrategies'\nimport { consoleError, getCurrentInstance, getUid, propsFactory } from '@/util'\n\n// Types\nimport type { InjectionKey, PropType, Ref } from 'vue'\nimport type { ActiveStrategy } from './activeStrategies'\nimport type { OpenStrategy } from './openStrategies'\nimport type { SelectStrategy } from './selectStrategies'\nimport type { EventProp } from '@/util'\n\nexport type ActiveStrategyProp =\n | 'single-leaf'\n | 'leaf'\n | 'independent'\n | 'single-independent'\n | ActiveStrategy\n | ((mandatory: boolean) => ActiveStrategy)\nexport type SelectStrategyProp =\n | 'single-leaf'\n | 'leaf'\n | 'independent'\n | 'single-independent'\n | 'classic'\n | SelectStrategy\n | ((mandatory: boolean) => SelectStrategy)\nexport type OpenStrategyProp = 'single' | 'multiple' | 'list' | OpenStrategy\n\nexport interface NestedProps {\n activatable: boolean\n selectable: boolean\n activeStrategy: ActiveStrategyProp | undefined\n selectStrategy: SelectStrategyProp | undefined\n openStrategy: OpenStrategyProp | undefined\n activated: any\n selected: any\n opened: any\n mandatory: boolean\n 'onUpdate:activated': EventProp<[any]> | undefined\n 'onUpdate:selected': EventProp<[any]> | undefined\n 'onUpdate:opened': EventProp<[any]> | undefined\n}\n\ntype NestedProvide = {\n id: Ref<unknown>\n isGroupActivator?: boolean\n root: {\n children: Ref<Map<unknown, unknown[]>>\n parents: Ref<Map<unknown, unknown>>\n activatable: Ref<boolean>\n selectable: Ref<boolean>\n opened: Ref<Set<unknown>>\n activated: Ref<Set<unknown>>\n selected: Ref<Map<unknown, 'on' | 'off' | 'indeterminate'>>\n selectedValues: Ref<unknown[]>\n register: (id: unknown, parentId: unknown, isGroup?: boolean) => void\n unregister: (id: unknown) => void\n open: (id: unknown, value: boolean, event?: Event) => void\n activate: (id: unknown, value: boolean, event?: Event) => void\n select: (id: unknown, value: boolean, event?: Event) => void\n openOnSelect: (id: unknown, value: boolean, event?: Event) => void\n getPath: (id: unknown) => unknown[]\n }\n}\n\nexport const VNestedSymbol: InjectionKey<NestedProvide> = Symbol.for('vuetify:nested')\n\nexport const emptyNested: NestedProvide = {\n id: shallowRef(),\n root: {\n register: () => null,\n unregister: () => null,\n parents: ref(new Map()),\n children: ref(new Map()),\n open: () => null,\n openOnSelect: () => null,\n activate: () => null,\n select: () => null,\n activatable: ref(false),\n selectable: ref(false),\n opened: ref(new Set()),\n activated: ref(new Set()),\n selected: ref(new Map()),\n selectedValues: ref([]),\n getPath: () => [],\n },\n}\n\nexport const makeNestedProps = propsFactory({\n activatable: Boolean,\n selectable: Boolean,\n activeStrategy: [String, Function, Object] as PropType<ActiveStrategyProp>,\n selectStrategy: [String, Function, Object] as PropType<SelectStrategyProp>,\n openStrategy: [String, Object] as PropType<OpenStrategyProp>,\n opened: null,\n activated: null,\n selected: null,\n mandatory: Boolean,\n}, 'nested')\n\nexport const useNested = (props: NestedProps) => {\n let isUnmounted = false\n const children = ref(new Map<unknown, unknown[]>())\n const parents = ref(new Map<unknown, unknown>())\n\n const opened = useProxiedModel(props, 'opened', props.opened, v => new Set(v), v => [...v.values()])\n\n const activeStrategy = computed(() => {\n if (typeof props.activeStrategy === 'object') return props.activeStrategy\n if (typeof props.activeStrategy === 'function') return props.activeStrategy(props.mandatory)\n\n switch (props.activeStrategy) {\n case 'leaf': return leafActiveStrategy(props.mandatory)\n case 'single-leaf': return leafSingleActiveStrategy(props.mandatory)\n case 'independent': return independentActiveStrategy(props.mandatory)\n case 'single-independent':\n default: return independentSingleActiveStrategy(props.mandatory)\n }\n })\n\n const selectStrategy = computed(() => {\n if (typeof props.selectStrategy === 'object') return props.selectStrategy\n if (typeof props.selectStrategy === 'function') return props.selectStrategy(props.mandatory)\n\n switch (props.selectStrategy) {\n case 'single-leaf': return leafSingleSelectStrategy(props.mandatory)\n case 'leaf': return leafSelectStrategy(props.mandatory)\n case 'independent': return independentSelectStrategy(props.mandatory)\n case 'single-independent': return independentSingleSelectStrategy(props.mandatory)\n case 'classic':\n default: return classicSelectStrategy(props.mandatory)\n }\n })\n\n const openStrategy = computed(() => {\n if (typeof props.openStrategy === 'object') return props.openStrategy\n\n switch (props.openStrategy) {\n case 'list': return listOpenStrategy\n case 'single': return singleOpenStrategy\n case 'multiple':\n default: return multipleOpenStrategy\n }\n })\n\n const activated = useProxiedModel(\n props,\n 'activated',\n props.activated,\n v => activeStrategy.value.in(v, children.value, parents.value),\n v => activeStrategy.value.out(v, children.value, parents.value),\n )\n const selected = useProxiedModel(\n props,\n 'selected',\n props.selected,\n v => selectStrategy.value.in(v, children.value, parents.value),\n v => selectStrategy.value.out(v, children.value, parents.value),\n )\n\n onBeforeUnmount(() => {\n isUnmounted = true\n })\n\n function getPath (id: unknown) {\n const path: unknown[] = []\n let parent: unknown = id\n\n while (parent != null) {\n path.unshift(parent)\n parent = parents.value.get(parent)\n }\n\n return path\n }\n\n const vm = getCurrentInstance('nested')\n\n const nodeIds = new Set<unknown>()\n\n const nested: NestedProvide = {\n id: shallowRef(),\n root: {\n opened,\n activatable: toRef(props, 'activatable'),\n selectable: toRef(props, 'selectable'),\n activated,\n selected,\n selectedValues: computed(() => {\n const arr = []\n\n for (const [key, value] of selected.value.entries()) {\n if (value === 'on') arr.push(key)\n }\n\n return arr\n }),\n register: (id, parentId, isGroup) => {\n if (nodeIds.has(id)) {\n const path = getPath(id).map(String).join(' -> ')\n const newPath = getPath(parentId).concat(id).map(String).join(' -> ')\n consoleError(`Multiple nodes with the same ID\\n\\t${path}\\n\\t${newPath}`)\n return\n } else {\n nodeIds.add(id)\n }\n\n parentId && id !== parentId && parents.value.set(id, parentId)\n\n isGroup && children.value.set(id, [])\n\n if (parentId != null) {\n children.value.set(parentId, [...children.value.get(parentId) || [], id])\n }\n },\n unregister: id => {\n if (isUnmounted) return\n\n nodeIds.delete(id)\n children.value.delete(id)\n const parent = parents.value.get(id)\n if (parent) {\n const list = children.value.get(parent) ?? []\n children.value.set(parent, list.filter(child => child !== id))\n }\n parents.value.delete(id)\n },\n open: (id, value, event) => {\n vm.emit('click:open', { id, value, path: getPath(id), event })\n\n const newOpened = openStrategy.value.open({\n id,\n value,\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n\n newOpened && (opened.value = newOpened)\n },\n openOnSelect: (id, value, event) => {\n const newOpened = openStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newOpened && (opened.value = newOpened)\n },\n select: (id, value, event) => {\n vm.emit('click:select', { id, value, path: getPath(id), event })\n\n const newSelected = selectStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newSelected && (selected.value = newSelected)\n\n nested.root.openOnSelect(id, value, event)\n },\n activate: (id, value, event) => {\n if (!props.activatable) {\n return nested.root.select(id, true, event)\n }\n\n vm.emit('click:activate', { id, value, path: getPath(id), event })\n\n const newActivated = activeStrategy.value.activate({\n id,\n value,\n activated: new Set(activated.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n\n if (newActivated.size !== activated.value.size) {\n activated.value = newActivated\n } else {\n for (const value of newActivated) {\n if (!activated.value.has(value)) {\n activated.value = newActivated\n return\n }\n }\n for (const value of activated.value) {\n if (!newActivated.has(value)) {\n activated.value = newActivated\n return\n }\n }\n }\n },\n children,\n parents,\n getPath,\n },\n }\n\n provide(VNestedSymbol, nested)\n\n return nested.root\n}\n\nexport const useNestedItem = (id: Ref<unknown>, isGroup: boolean) => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n const uidSymbol = Symbol(getUid())\n const computedId = computed(() => id.value !== undefined ? id.value : uidSymbol)\n\n const item = {\n ...parent,\n id: computedId,\n open: (open: boolean, e: Event) => parent.root.open(computedId.value, open, e),\n openOnSelect: (open: boolean, e?: Event) => parent.root.openOnSelect(computedId.value, open, e),\n isOpen: computed(() => parent.root.opened.value.has(computedId.value)),\n parent: computed(() => parent.root.parents.value.get(computedId.value)),\n activate: (activated: boolean, e?: Event) => parent.root.activate(computedId.value, activated, e),\n isActivated: computed(() => parent.root.activated.value.has(toRaw(computedId.value))),\n select: (selected: boolean, e?: Event) => parent.root.select(computedId.value, selected, e),\n isSelected: computed(() => parent.root.selected.value.get(toRaw(computedId.value)) === 'on'),\n isIndeterminate: computed(() => parent.root.selected.value.get(toRaw(computedId.value)) === 'indeterminate'),\n isLeaf: computed(() => !parent.root.children.value.get(computedId.value)),\n isGroupActivator: parent.isGroupActivator,\n }\n\n onBeforeMount(() => {\n !parent.isGroupActivator && parent.root.register(computedId.value, parent.id.value, isGroup)\n })\n\n onBeforeUnmount(() => {\n !parent.isGroupActivator && parent.root.unregister(computedId.value)\n })\n\n isGroup && provide(VNestedSymbol, item)\n\n return item\n}\n\nexport const useNestedGroupActivator = () => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n provide(VNestedSymbol, { ...parent, isGroupActivator: true })\n}\n"],"mappings":"AAAA;AAAA,SACSA,eAAe,+BAExB;AACA,SACEC,QAAQ,EACRC,MAAM,EACNC,aAAa,EACbC,eAAe,EACfC,OAAO,EACPC,GAAG,EACHC,UAAU,EACVC,KAAK,EACLC,KAAK,QACA,KAAK;AAAA,SAEVC,yBAAyB,EACzBC,+BAA+B,EAC/BC,kBAAkB,EAClBC,wBAAwB;AAAA,SAEjBC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MzC,MAAM,GAAGjE,MAAM,CAACwB,aAAa,EAAEG,WAAW,CAAC;EAEjDxB,OAAO,CAACqB,aAAa,EAAE;IAAE,GAAGyC,MAAM;IAAEwC,gBAAgB,EAAE;EAAK,CAAC,CAAC;AAC/D,CAAC","ignoreList":[]}
@@ -16,7 +16,7 @@ export const createVuetify = function () {
16
16
  ...options
17
17
  });
18
18
  };
19
- export const version = "3.7.12-master.2025-02-13";
19
+ export const version = "3.7.12-master.2025-02-14";
20
20
  createVuetify.version = version;
21
21
  export { blueprints, components, directives };
22
22
  export * from "./composables/index.mjs";
package/lib/framework.mjs CHANGED
@@ -97,7 +97,7 @@ export function createVuetify() {
97
97
  goTo
98
98
  };
99
99
  }
100
- export const version = "3.7.12-master.2025-02-13";
100
+ export const version = "3.7.12-master.2025-02-14";
101
101
  createVuetify.version = version;
102
102
 
103
103
  // Vue's inject() can only be used in setup
package/lib/index.d.mts CHANGED
@@ -487,48 +487,38 @@ declare module 'vue' {
487
487
  }
488
488
  export interface GlobalComponents {
489
489
  VApp: typeof import('vuetify/components')['VApp']
490
- VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
490
+ VAppBar: typeof import('vuetify/components')['VAppBar']
491
+ VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
492
+ VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
491
493
  VAlert: typeof import('vuetify/components')['VAlert']
492
494
  VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
493
- VAvatar: typeof import('vuetify/components')['VAvatar']
494
495
  VBadge: typeof import('vuetify/components')['VBadge']
495
- VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
496
- VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
496
+ VAvatar: typeof import('vuetify/components')['VAvatar']
497
497
  VBanner: typeof import('vuetify/components')['VBanner']
498
498
  VBannerActions: typeof import('vuetify/components')['VBannerActions']
499
499
  VBannerText: typeof import('vuetify/components')['VBannerText']
500
- VAppBar: typeof import('vuetify/components')['VAppBar']
501
- VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
502
- VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
503
- VBtn: typeof import('vuetify/components')['VBtn']
504
500
  VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
505
501
  VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
506
502
  VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
503
+ VBtn: typeof import('vuetify/components')['VBtn']
504
+ VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
507
505
  VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
506
+ VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
507
+ VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
508
508
  VCarousel: typeof import('vuetify/components')['VCarousel']
509
509
  VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
510
- VCheckbox: typeof import('vuetify/components')['VCheckbox']
511
- VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
510
+ VChip: typeof import('vuetify/components')['VChip']
512
511
  VCard: typeof import('vuetify/components')['VCard']
513
512
  VCardActions: typeof import('vuetify/components')['VCardActions']
514
513
  VCardItem: typeof import('vuetify/components')['VCardItem']
515
514
  VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
516
515
  VCardText: typeof import('vuetify/components')['VCardText']
517
516
  VCardTitle: typeof import('vuetify/components')['VCardTitle']
518
- VChip: typeof import('vuetify/components')['VChip']
519
- VChipGroup: typeof import('vuetify/components')['VChipGroup']
517
+ VCheckbox: typeof import('vuetify/components')['VCheckbox']
518
+ VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
520
519
  VColorPicker: typeof import('vuetify/components')['VColorPicker']
520
+ VChipGroup: typeof import('vuetify/components')['VChipGroup']
521
521
  VCode: typeof import('vuetify/components')['VCode']
522
- VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
523
- VCounter: typeof import('vuetify/components')['VCounter']
524
- VDatePicker: typeof import('vuetify/components')['VDatePicker']
525
- VDatePickerControls: typeof import('vuetify/components')['VDatePickerControls']
526
- VDatePickerHeader: typeof import('vuetify/components')['VDatePickerHeader']
527
- VDatePickerMonth: typeof import('vuetify/components')['VDatePickerMonth']
528
- VDatePickerMonths: typeof import('vuetify/components')['VDatePickerMonths']
529
- VDatePickerYears: typeof import('vuetify/components')['VDatePickerYears']
530
- VCombobox: typeof import('vuetify/components')['VCombobox']
531
- VEmptyState: typeof import('vuetify/components')['VEmptyState']
532
522
  VDataTable: typeof import('vuetify/components')['VDataTable']
533
523
  VDataTableHeaders: typeof import('vuetify/components')['VDataTableHeaders']
534
524
  VDataTableFooter: typeof import('vuetify/components')['VDataTableFooter']
@@ -536,29 +526,37 @@ declare module 'vue' {
536
526
  VDataTableRow: typeof import('vuetify/components')['VDataTableRow']
537
527
  VDataTableVirtual: typeof import('vuetify/components')['VDataTableVirtual']
538
528
  VDataTableServer: typeof import('vuetify/components')['VDataTableServer']
529
+ VCombobox: typeof import('vuetify/components')['VCombobox']
530
+ VCounter: typeof import('vuetify/components')['VCounter']
531
+ VEmptyState: typeof import('vuetify/components')['VEmptyState']
532
+ VDatePicker: typeof import('vuetify/components')['VDatePicker']
533
+ VDatePickerControls: typeof import('vuetify/components')['VDatePickerControls']
534
+ VDatePickerHeader: typeof import('vuetify/components')['VDatePickerHeader']
535
+ VDatePickerMonth: typeof import('vuetify/components')['VDatePickerMonth']
536
+ VDatePickerMonths: typeof import('vuetify/components')['VDatePickerMonths']
537
+ VDatePickerYears: typeof import('vuetify/components')['VDatePickerYears']
538
+ VDialog: typeof import('vuetify/components')['VDialog']
539
+ VDivider: typeof import('vuetify/components')['VDivider']
539
540
  VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
540
541
  VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
541
542
  VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
542
543
  VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
543
544
  VFab: typeof import('vuetify/components')['VFab']
545
+ VFileInput: typeof import('vuetify/components')['VFileInput']
544
546
  VFooter: typeof import('vuetify/components')['VFooter']
545
- VDialog: typeof import('vuetify/components')['VDialog']
546
- VDivider: typeof import('vuetify/components')['VDivider']
547
- VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
548
547
  VField: typeof import('vuetify/components')['VField']
549
548
  VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
550
- VFileInput: typeof import('vuetify/components')['VFileInput']
551
549
  VIcon: typeof import('vuetify/components')['VIcon']
552
550
  VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
553
551
  VSvgIcon: typeof import('vuetify/components')['VSvgIcon']
554
552
  VLigatureIcon: typeof import('vuetify/components')['VLigatureIcon']
555
553
  VClassIcon: typeof import('vuetify/components')['VClassIcon']
556
- VKbd: typeof import('vuetify/components')['VKbd']
557
- VImg: typeof import('vuetify/components')['VImg']
558
554
  VInput: typeof import('vuetify/components')['VInput']
559
- VLabel: typeof import('vuetify/components')['VLabel']
555
+ VImg: typeof import('vuetify/components')['VImg']
556
+ VKbd: typeof import('vuetify/components')['VKbd']
560
557
  VItemGroup: typeof import('vuetify/components')['VItemGroup']
561
558
  VItem: typeof import('vuetify/components')['VItem']
559
+ VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
562
560
  VList: typeof import('vuetify/components')['VList']
563
561
  VListGroup: typeof import('vuetify/components')['VListGroup']
564
562
  VListImg: typeof import('vuetify/components')['VListImg']
@@ -568,22 +566,22 @@ declare module 'vue' {
568
566
  VListItemSubtitle: typeof import('vuetify/components')['VListItemSubtitle']
569
567
  VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
570
568
  VListSubheader: typeof import('vuetify/components')['VListSubheader']
571
- VMessages: typeof import('vuetify/components')['VMessages']
572
- VMain: typeof import('vuetify/components')['VMain']
573
- VMenu: typeof import('vuetify/components')['VMenu']
574
569
  VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
575
- VPagination: typeof import('vuetify/components')['VPagination']
576
- VOverlay: typeof import('vuetify/components')['VOverlay']
570
+ VMenu: typeof import('vuetify/components')['VMenu']
571
+ VLabel: typeof import('vuetify/components')['VLabel']
572
+ VMain: typeof import('vuetify/components')['VMain']
573
+ VMessages: typeof import('vuetify/components')['VMessages']
577
574
  VOtpInput: typeof import('vuetify/components')['VOtpInput']
578
- VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
575
+ VOverlay: typeof import('vuetify/components')['VOverlay']
576
+ VPagination: typeof import('vuetify/components')['VPagination']
579
577
  VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
578
+ VRating: typeof import('vuetify/components')['VRating']
580
579
  VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
580
+ VSheet: typeof import('vuetify/components')['VSheet']
581
+ VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
582
+ VSlider: typeof import('vuetify/components')['VSlider']
581
583
  VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
582
- VRating: typeof import('vuetify/components')['VRating']
583
- VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
584
584
  VSelect: typeof import('vuetify/components')['VSelect']
585
- VSheet: typeof import('vuetify/components')['VSheet']
586
- VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
587
585
  VStepper: typeof import('vuetify/components')['VStepper']
588
586
  VStepperActions: typeof import('vuetify/components')['VStepperActions']
589
587
  VStepperHeader: typeof import('vuetify/components')['VStepperHeader']
@@ -593,36 +591,36 @@ declare module 'vue' {
593
591
  VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
594
592
  VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
595
593
  VSnackbar: typeof import('vuetify/components')['VSnackbar']
596
- VSlider: typeof import('vuetify/components')['VSlider']
594
+ VSwitch: typeof import('vuetify/components')['VSwitch']
595
+ VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
597
596
  VSystemBar: typeof import('vuetify/components')['VSystemBar']
598
597
  VTab: typeof import('vuetify/components')['VTab']
599
598
  VTabs: typeof import('vuetify/components')['VTabs']
600
599
  VTabsWindow: typeof import('vuetify/components')['VTabsWindow']
601
600
  VTabsWindowItem: typeof import('vuetify/components')['VTabsWindowItem']
602
601
  VTable: typeof import('vuetify/components')['VTable']
603
- VTextarea: typeof import('vuetify/components')['VTextarea']
604
- VSwitch: typeof import('vuetify/components')['VSwitch']
605
602
  VTextField: typeof import('vuetify/components')['VTextField']
603
+ VTextarea: typeof import('vuetify/components')['VTextarea']
606
604
  VTimeline: typeof import('vuetify/components')['VTimeline']
607
605
  VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
608
606
  VTooltip: typeof import('vuetify/components')['VTooltip']
609
- VWindow: typeof import('vuetify/components')['VWindow']
610
- VWindowItem: typeof import('vuetify/components')['VWindowItem']
611
607
  VToolbar: typeof import('vuetify/components')['VToolbar']
612
608
  VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
613
609
  VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
610
+ VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
611
+ VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
614
612
  VConfirmEdit: typeof import('vuetify/components')['VConfirmEdit']
615
613
  VDataIterator: typeof import('vuetify/components')['VDataIterator']
616
614
  VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
617
- VForm: typeof import('vuetify/components')['VForm']
618
615
  VContainer: typeof import('vuetify/components')['VContainer']
619
616
  VCol: typeof import('vuetify/components')['VCol']
620
617
  VRow: typeof import('vuetify/components')['VRow']
621
618
  VSpacer: typeof import('vuetify/components')['VSpacer']
619
+ VForm: typeof import('vuetify/components')['VForm']
622
620
  VHover: typeof import('vuetify/components')['VHover']
621
+ VLazy: typeof import('vuetify/components')['VLazy']
623
622
  VLayout: typeof import('vuetify/components')['VLayout']
624
623
  VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
625
- VLazy: typeof import('vuetify/components')['VLazy']
626
624
  VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
627
625
  VNoSsr: typeof import('vuetify/components')['VNoSsr']
628
626
  VParallax: typeof import('vuetify/components')['VParallax']
@@ -630,8 +628,8 @@ declare module 'vue' {
630
628
  VResponsive: typeof import('vuetify/components')['VResponsive']
631
629
  VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
632
630
  VSparkline: typeof import('vuetify/components')['VSparkline']
633
- VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
634
631
  VSpeedDial: typeof import('vuetify/components')['VSpeedDial']
632
+ VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
635
633
  VValidation: typeof import('vuetify/components')['VValidation']
636
634
  VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
637
635
  VFabTransition: typeof import('vuetify/components')['VFabTransition']
@@ -650,23 +648,25 @@ declare module 'vue' {
650
648
  VExpandTransition: typeof import('vuetify/components')['VExpandTransition']
651
649
  VExpandXTransition: typeof import('vuetify/components')['VExpandXTransition']
652
650
  VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
651
+ VWindow: typeof import('vuetify/components')['VWindow']
652
+ VWindowItem: typeof import('vuetify/components')['VWindowItem']
653
653
  VCalendar: typeof import('vuetify/labs/components')['VCalendar']
654
654
  VCalendarDay: typeof import('vuetify/labs/components')['VCalendarDay']
655
655
  VCalendarHeader: typeof import('vuetify/labs/components')['VCalendarHeader']
656
656
  VCalendarInterval: typeof import('vuetify/labs/components')['VCalendarInterval']
657
657
  VCalendarIntervalEvent: typeof import('vuetify/labs/components')['VCalendarIntervalEvent']
658
658
  VCalendarMonthDay: typeof import('vuetify/labs/components')['VCalendarMonthDay']
659
- VFileUpload: typeof import('vuetify/labs/components')['VFileUpload']
660
- VFileUploadItem: typeof import('vuetify/labs/components')['VFileUploadItem']
661
- VPicker: typeof import('vuetify/labs/components')['VPicker']
662
- VPickerTitle: typeof import('vuetify/labs/components')['VPickerTitle']
663
659
  VStepperVertical: typeof import('vuetify/labs/components')['VStepperVertical']
664
660
  VStepperVerticalItem: typeof import('vuetify/labs/components')['VStepperVerticalItem']
665
661
  VStepperVerticalActions: typeof import('vuetify/labs/components')['VStepperVerticalActions']
662
+ VFileUpload: typeof import('vuetify/labs/components')['VFileUpload']
663
+ VFileUploadItem: typeof import('vuetify/labs/components')['VFileUploadItem']
664
+ VNumberInput: typeof import('vuetify/labs/components')['VNumberInput']
666
665
  VTimePicker: typeof import('vuetify/labs/components')['VTimePicker']
667
666
  VTimePickerClock: typeof import('vuetify/labs/components')['VTimePickerClock']
668
667
  VTimePickerControls: typeof import('vuetify/labs/components')['VTimePickerControls']
669
- VNumberInput: typeof import('vuetify/labs/components')['VNumberInput']
668
+ VPicker: typeof import('vuetify/labs/components')['VPicker']
669
+ VPickerTitle: typeof import('vuetify/labs/components')['VPickerTitle']
670
670
  VTreeview: typeof import('vuetify/labs/components')['VTreeview']
671
671
  VTreeviewItem: typeof import('vuetify/labs/components')['VTreeviewItem']
672
672
  VTreeviewGroup: typeof import('vuetify/labs/components')['VTreeviewGroup']
@@ -27,7 +27,7 @@ export const makeVTreeviewProps = propsFactory({
27
27
  collapseIcon: '$treeviewCollapse',
28
28
  expandIcon: '$treeviewExpand',
29
29
  slim: true
30
- }), ['nav', 'openStrategy']),
30
+ }), ['itemType', 'nav', 'openStrategy']),
31
31
  modelValue: {
32
32
  type: Array,
33
33
  default: () => []
@@ -1 +1 @@
1
- {"version":3,"file":"VTreeview.mjs","names":["makeVTreeviewChildrenProps","VTreeviewChildren","makeVListProps","useListItems","VList","provideDefaults","makeFilterProps","useFilter","useProxiedModel","computed","provide","ref","toRaw","toRef","genericComponent","omit","propsFactory","useRender","VTreeviewSymbol","flatten","items","flat","arguments","length","undefined","item","push","children","makeVTreeviewProps","openAll","Boolean","search","String","filterKeys","collapseIcon","expandIcon","slim","modelValue","type","Array","default","VTreeview","name","props","emits","val","value","setup","_ref","slots","activeColor","baseColor","color","activated","model","_selected","selected","get","set","vListRef","opened","flatItems","filteredItems","visibleIds","getPath","Set","flatMap","itemVal","returnObject","raw","getChildren","map","id","arr","queue","slice","child","shift","ids","i","concat","VTreeviewGroup","VTreeviewItem","activeClass","density","disabled","lines","variant","listProps","filterProps","treeviewChildrenProps","_createVNode","_mergeProps","class","style","$event"],"sources":["../../../src/labs/VTreeview/VTreeview.tsx"],"sourcesContent":["// Components\nimport { makeVTreeviewChildrenProps, VTreeviewChildren } from './VTreeviewChildren'\nimport { makeVListProps, useListItems, VList } from '@/components/VList/VList'\n\n// Composables\nimport { provideDefaults } from '@/composables/defaults'\nimport { makeFilterProps, useFilter } from '@/composables/filter'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, provide, ref, toRaw, toRef } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport { VTreeviewSymbol } from './shared'\nimport type { InternalListItem } from '@/components/VList/VList'\nimport type { VListChildrenSlots } from '@/components/VList/VListChildren'\nimport type { ListItem } from '@/composables/list-items'\nimport type { GenericProps } from '@/util'\n\nfunction flatten (items: ListItem[], flat: ListItem[] = []) {\n for (const item of items) {\n flat.push(item)\n if (item.children) flatten(item.children, flat)\n }\n return flat\n}\n\nexport const makeVTreeviewProps = propsFactory({\n openAll: Boolean,\n search: String,\n\n ...makeFilterProps({ filterKeys: ['title'] }),\n ...makeVTreeviewChildrenProps(),\n ...omit(makeVListProps({\n collapseIcon: '$treeviewCollapse',\n expandIcon: '$treeviewExpand',\n slim: true,\n }), ['nav', 'openStrategy']),\n modelValue: {\n type: Array,\n default: () => ([]),\n },\n}, 'VTreeview')\n\nexport const VTreeview = genericComponent<new <T>(\n props: {\n items?: T[]\n },\n slots: VListChildrenSlots<T>\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VTreeview',\n\n props: makeVTreeviewProps(),\n\n emits: {\n 'update:opened': (val: unknown) => true,\n 'update:activated': (val: unknown) => true,\n 'update:selected': (val: unknown) => true,\n 'update:modelValue': (val: unknown) => true,\n 'click:open': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n 'click:select': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n },\n\n setup (props, { slots }) {\n const { items } = useListItems(props)\n const activeColor = toRef(props, 'activeColor')\n const baseColor = toRef(props, 'baseColor')\n const color = toRef(props, 'color')\n const activated = useProxiedModel(props, 'activated')\n const model = useProxiedModel(props, 'modelValue')\n const _selected = useProxiedModel(props, 'selected', props.modelValue)\n\n const selected = computed({\n get: () => _selected.value,\n set (val) {\n _selected.value = val\n model.value = val\n },\n })\n\n const vListRef = ref<VList>()\n\n const opened = computed(() => props.openAll ? openAll(items.value) : props.opened)\n const flatItems = computed(() => flatten(items.value))\n const search = toRef(props, 'search')\n const { filteredItems } = useFilter(props, flatItems, search)\n const visibleIds = computed(() => {\n if (!search.value) return null\n const getPath = vListRef.value?.getPath\n if (!getPath) return null\n return new Set(filteredItems.value.flatMap(item => {\n const itemVal = props.returnObject ? item.raw : item.props.value\n return [\n ...getPath(itemVal),\n ...getChildren(itemVal),\n ].map(toRaw)\n }))\n })\n\n function getChildren (id: unknown) {\n const arr: unknown[] = []\n const queue = ((vListRef.value?.children.get(id) ?? []).slice())\n while (queue.length) {\n const child = queue.shift()\n if (!child) continue\n arr.push(child)\n queue.push(...((vListRef.value?.children.get(child) ?? []).slice()))\n }\n return arr\n }\n\n function openAll (items: InternalListItem<any>[]) {\n let ids: any[] = []\n\n for (const i of items) {\n if (!i.children) continue\n\n ids.push(props.returnObject ? toRaw(i.raw) : i.value)\n\n if (i.children) {\n ids = ids.concat(openAll(i.children))\n }\n }\n\n return ids\n }\n\n provide(VTreeviewSymbol, { visibleIds })\n\n provideDefaults({\n VTreeviewGroup: {\n activeColor,\n baseColor,\n color,\n collapseIcon: toRef(props, 'collapseIcon'),\n expandIcon: toRef(props, 'expandIcon'),\n },\n VTreeviewItem: {\n activeClass: toRef(props, 'activeClass'),\n activeColor,\n baseColor,\n color,\n density: toRef(props, 'density'),\n disabled: toRef(props, 'disabled'),\n lines: toRef(props, 'lines'),\n variant: toRef(props, 'variant'),\n },\n })\n\n useRender(() => {\n const listProps = VList.filterProps(props)\n\n const treeviewChildrenProps = VTreeviewChildren.filterProps(props)\n\n return (\n <VList\n ref={ vListRef }\n { ...listProps }\n class={[\n 'v-treeview',\n props.class,\n ]}\n open-strategy=\"multiple\"\n style={ props.style }\n opened={ opened.value }\n v-model:activated={ activated.value }\n v-model:selected={ selected.value }\n >\n <VTreeviewChildren\n { ...treeviewChildrenProps }\n returnObject={ props.returnObject }\n items={ items.value }\n v-slots={ slots }\n ></VTreeviewChildren>\n </VList>\n )\n })\n\n return { }\n },\n})\n\nexport type VTreeview = InstanceType<typeof VTreeview>\n"],"mappings":";AAAA;AAAA,SACSA,0BAA0B,EAAEC,iBAAiB;AAAA,SAC7CC,cAAc,EAAEC,YAAY,EAAEC,KAAK,4CAE5C;AAAA,SACSC,eAAe;AAAA,SACfC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,OAAO,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACjDC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,gCAExD;AAAA,SACSC,eAAe;AAMxB,SAASC,OAAOA,CAAEC,KAAiB,EAAyB;EAAA,IAAvBC,IAAgB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EACxD,KAAK,MAAMG,IAAI,IAAIL,KAAK,EAAE;IACxBC,IAAI,CAACK,IAAI,CAACD,IAAI,CAAC;IACf,IAAIA,IAAI,CAACE,QAAQ,EAAER,OAAO,CAACM,IAAI,CAACE,QAAQ,EAAEN,IAAI,CAAC;EACjD;EACA,OAAOA,IAAI;AACb;AAEA,OAAO,MAAMO,kBAAkB,GAAGZ,YAAY,CAAC;EAC7Ca,OAAO,EAAEC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AAA,CAAA,MAAAmD,YAAA,CAAA1F,iBAAA,EAAA2F,WAAA,CAG1BF,qBAAqB;UAAA,gBACX/C,KAAK,CAACyB,YAAY;UAAA,SACzBhD,KAAK,CAAC0B;QAAK,IACTG,KAAK;MAAA;IAIvB,CAAC,CAAC;IAEF,OAAO,CAAE,CAAC;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"VTreeview.mjs","names":["makeVTreeviewChildrenProps","VTreeviewChildren","makeVListProps","useListItems","VList","provideDefaults","makeFilterProps","useFilter","useProxiedModel","computed","provide","ref","toRaw","toRef","genericComponent","omit","propsFactory","useRender","VTreeviewSymbol","flatten","items","flat","arguments","length","undefined","item","push","children","makeVTreeviewProps","openAll","Boolean","search","String","filterKeys","collapseIcon","expandIcon","slim","modelValue","type","Array","default","VTreeview","name","props","emits","val","value","setup","_ref","slots","activeColor","baseColor","color","activated","model","_selected","selected","get","set","vListRef","opened","flatItems","filteredItems","visibleIds","getPath","Set","flatMap","itemVal","returnObject","raw","getChildren","map","id","arr","queue","slice","child","shift","ids","i","concat","VTreeviewGroup","VTreeviewItem","activeClass","density","disabled","lines","variant","listProps","filterProps","treeviewChildrenProps","_createVNode","_mergeProps","class","style","$event"],"sources":["../../../src/labs/VTreeview/VTreeview.tsx"],"sourcesContent":["// Components\nimport { makeVTreeviewChildrenProps, VTreeviewChildren } from './VTreeviewChildren'\nimport { makeVListProps, useListItems, VList } from '@/components/VList/VList'\n\n// Composables\nimport { provideDefaults } from '@/composables/defaults'\nimport { makeFilterProps, useFilter } from '@/composables/filter'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, provide, ref, toRaw, toRef } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport { VTreeviewSymbol } from './shared'\nimport type { InternalListItem } from '@/components/VList/VList'\nimport type { VListChildrenSlots } from '@/components/VList/VListChildren'\nimport type { ListItem } from '@/composables/list-items'\nimport type { GenericProps } from '@/util'\n\nfunction flatten (items: ListItem[], flat: ListItem[] = []) {\n for (const item of items) {\n flat.push(item)\n if (item.children) flatten(item.children, flat)\n }\n return flat\n}\n\nexport const makeVTreeviewProps = propsFactory({\n openAll: Boolean,\n search: String,\n\n ...makeFilterProps({ filterKeys: ['title'] }),\n ...makeVTreeviewChildrenProps(),\n ...omit(makeVListProps({\n collapseIcon: '$treeviewCollapse',\n expandIcon: '$treeviewExpand',\n slim: true,\n }), ['itemType', 'nav', 'openStrategy']),\n modelValue: {\n type: Array,\n default: () => ([]),\n },\n}, 'VTreeview')\n\nexport const VTreeview = genericComponent<new <T>(\n props: {\n items?: T[]\n },\n slots: VListChildrenSlots<T>\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VTreeview',\n\n props: makeVTreeviewProps(),\n\n emits: {\n 'update:opened': (val: unknown) => true,\n 'update:activated': (val: unknown) => true,\n 'update:selected': (val: unknown) => true,\n 'update:modelValue': (val: unknown) => true,\n 'click:open': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n 'click:select': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n },\n\n setup (props, { slots }) {\n const { items } = useListItems(props)\n const activeColor = toRef(props, 'activeColor')\n const baseColor = toRef(props, 'baseColor')\n const color = toRef(props, 'color')\n const activated = useProxiedModel(props, 'activated')\n const model = useProxiedModel(props, 'modelValue')\n const _selected = useProxiedModel(props, 'selected', props.modelValue)\n\n const selected = computed({\n get: () => _selected.value,\n set (val) {\n _selected.value = val\n model.value = val\n },\n })\n\n const vListRef = ref<VList>()\n\n const opened = computed(() => props.openAll ? openAll(items.value) : props.opened)\n const flatItems = computed(() => flatten(items.value))\n const search = toRef(props, 'search')\n const { filteredItems } = useFilter(props, flatItems, search)\n const visibleIds = computed(() => {\n if (!search.value) return null\n const getPath = vListRef.value?.getPath\n if (!getPath) return null\n return new Set(filteredItems.value.flatMap(item => {\n const itemVal = props.returnObject ? item.raw : item.props.value\n return [\n ...getPath(itemVal),\n ...getChildren(itemVal),\n ].map(toRaw)\n }))\n })\n\n function getChildren (id: unknown) {\n const arr: unknown[] = []\n const queue = ((vListRef.value?.children.get(id) ?? []).slice())\n while (queue.length) {\n const child = queue.shift()\n if (!child) continue\n arr.push(child)\n queue.push(...((vListRef.value?.children.get(child) ?? []).slice()))\n }\n return arr\n }\n\n function openAll (items: InternalListItem<any>[]) {\n let ids: any[] = []\n\n for (const i of items) {\n if (!i.children) continue\n\n ids.push(props.returnObject ? toRaw(i.raw) : i.value)\n\n if (i.children) {\n ids = ids.concat(openAll(i.children))\n }\n }\n\n return ids\n }\n\n provide(VTreeviewSymbol, { visibleIds })\n\n provideDefaults({\n VTreeviewGroup: {\n activeColor,\n baseColor,\n color,\n collapseIcon: toRef(props, 'collapseIcon'),\n expandIcon: toRef(props, 'expandIcon'),\n },\n VTreeviewItem: {\n activeClass: toRef(props, 'activeClass'),\n activeColor,\n baseColor,\n color,\n density: toRef(props, 'density'),\n disabled: toRef(props, 'disabled'),\n lines: toRef(props, 'lines'),\n variant: toRef(props, 'variant'),\n },\n })\n\n useRender(() => {\n const listProps = VList.filterProps(props)\n\n const treeviewChildrenProps = VTreeviewChildren.filterProps(props)\n\n return (\n <VList\n ref={ vListRef }\n { ...listProps }\n class={[\n 'v-treeview',\n props.class,\n ]}\n open-strategy=\"multiple\"\n style={ props.style }\n opened={ opened.value }\n v-model:activated={ activated.value }\n v-model:selected={ selected.value }\n >\n <VTreeviewChildren\n { ...treeviewChildrenProps }\n returnObject={ props.returnObject }\n items={ items.value }\n v-slots={ slots }\n ></VTreeviewChildren>\n </VList>\n )\n })\n\n return { }\n },\n})\n\nexport type VTreeview = InstanceType<typeof VTreeview>\n"],"mappings":";AAAA;AAAA,SACSA,0BAA0B,EAAEC,iBAAiB;AAAA,SAC7CC,cAAc,EAAEC,YAAY,EAAEC,KAAK,4CAE5C;AAAA,SACSC,eAAe;AAAA,SACfC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,eAAe,8CAExB;AACA,SAASC,Q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IAEF1B,SAAS,CAAC,MAAM;MACd,MAAMuE,SAAS,GAAGpF,KAAK,CAACqF,WAAW,CAAC9C,KAAK,CAAC;MAE1C,MAAM+C,qBAAqB,GAAGzF,iBAAiB,CAACwF,WAAW,CAAC9C,KAAK,CAAC;MAElE,OAAAgD,YAAA,CAAAvF,KAAA,EAAAwF,WAAA;QAAA,OAEUjC;MAAQ,GACT6B,SAAS;QAAA,SACP,CACL,YAAY,EACZ7C,KAAK,CAACkD,KAAK,CACZ;QAAA;QAAA,SAEOlD,KAAK,CAACmD,KAAK;QAAA,UACVlC,MAAM,CAACd,KAAK;QAAA,aACDO,SAAS,CAACP,KAAK;QAAA,sBAAAiD,MAAA,IAAf1C,SAAS,CAACP,KAAK,GAAAiD,MAAA;QAAA,YAChBvC,QAAQ,CAACV,KAAK;QAAA,qBAAAiD,MAAA,IAAdvC,QAAQ,CAACV,KAAK,GAAAiD;MAAA;QAAAvD,OAAA,EAAAA,CAAA,MAAAmD,YAAA,CAAA1F,iBAAA,EAAA2F,WAAA,CAG1BF,qBAAqB;UAAA,gBACX/C,KAAK,CAACyB,YAAY;UAAA,SACzBhD,KAAK,CAAC0B;QAAK,IACTG,KAAK;MAAA;IAIvB,CAAC,CAAC;IAEF,OAAO,CAAE,CAAC;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,9 +1,8 @@
1
- import { mergeProps as _mergeProps, resolveDirective as _resolveDirective, Fragment as _Fragment, createVNode as _createVNode } from "vue";
1
+ import { mergeProps as _mergeProps, resolveDirective as _resolveDirective, createVNode as _createVNode, Fragment as _Fragment } from "vue";
2
2
  // Components
3
3
  import { VTreeviewGroup } from "./VTreeviewGroup.mjs";
4
4
  import { VTreeviewItem } from "./VTreeviewItem.mjs";
5
- import { VCheckboxBtn } from "../../components/VCheckbox/index.mjs";
6
- import { VDivider } from "../../components/VDivider/index.mjs"; // Composables
5
+ import { VCheckboxBtn } from "../../components/VCheckbox/index.mjs"; // Composables
7
6
  import { IconValue } from "../../composables/icons.mjs"; // Utilities
8
7
  import { computed, reactive, toRaw, withModifiers } from 'vue';
9
8
  import { genericComponent, propsFactory } from "../../util/index.mjs"; // Types
@@ -56,11 +55,6 @@ export const VTreeviewChildren = genericComponent()({
56
55
  }
57
56
  }
58
57
  return () => slots.default?.() ?? props.items?.map(item => {
59
- if (item.type === 'divider') {
60
- return slots.divider?.({
61
- props: item.props
62
- }) ?? _createVNode(VDivider, item.props, null);
63
- }
64
58
  const {
65
59
  children,
66
60
  props: itemProps
@@ -1 +1 @@
1
- {"version":3,"file":"VTreeviewChildren.mjs","names":["VTreeviewGroup","VTreeviewItem","VCheckboxBtn","VDivider","IconValue","computed","reactive","toRaw","withModifiers","genericComponent","propsFactory","makeVTreeviewChildrenProps","disabled","Boolean","loadChildren","Function","loadingIcon","type","String","default","items","Array","openOnClick","undefined","indeterminateIcon","falseIcon","trueIcon","returnObject","selectable","selectedColor","selectStrategy","Object","VTreeviewChildren","name","props","setup","_ref","slots","isLoading","Set","isClickOnOpen","checkChildren","item","length","children","add","value","raw","delete","selectItem","select","isSelected","map","divider","_createVNode","itemProps","loading","has","slotsWithItem","prepend","slotProps","_Fragment","includes","isIndeterminate","e","key","stopPropagation","internalItem","append","title","subtitle","treeviewGroupProps","filterProps","treeviewChildrenProps","_mergeProps","activator","_ref2","activatorProps","listItemProps","onToggleExpand","onClick"],"sources":["../../../src/labs/VTreeview/VTreeviewChildren.tsx"],"sourcesContent":["// Components\nimport { VTreeviewGroup } from './VTreeviewGroup'\nimport { VTreeviewItem } from './VTreeviewItem'\nimport { VCheckboxBtn } from '@/components/VCheckbox'\nimport { VDivider } from '@/components/VDivider'\n\n// Composables\nimport { IconValue } from '@/composables/icons'\n\n// Utilities\nimport { computed, reactive, toRaw, withModifiers } from 'vue'\nimport { genericComponent, propsFactory } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { InternalListItem } from '@/components/VList/VList'\nimport type { VListItemSlots } from '@/components/VList/VListItem'\nimport type { SelectStrategyProp } from '@/composables/nested/nested'\nimport type { GenericProps } from '@/util'\n\nexport type VTreeviewChildrenSlots<T> = {\n [K in keyof Omit<VListItemSlots, 'default'>]: VListItemSlots[K] & {\n item: T\n internalItem: InternalListItem<T>\n }\n} & {\n default: never\n item: {\n props: InternalListItem['props']\n item: T\n internalItem: InternalListItem<T>\n }\n divider: { props: InternalListItem['props'] }\n subheader: { props: InternalListItem['props'] }\n header: { props: InternalListItem['props'] }\n}\n\nexport const makeVTreeviewChildrenProps = propsFactory({\n disabled: Boolean,\n loadChildren: Function as PropType<(item: unknown) => Promise<void>>,\n loadingIcon: {\n type: String,\n default: '$loading',\n },\n items: Array as PropType<readonly InternalListItem[]>,\n openOnClick: {\n type: Boolean,\n default: undefined,\n },\n indeterminateIcon: {\n type: IconValue,\n default: '$checkboxIndeterminate',\n },\n falseIcon: IconValue,\n trueIcon: IconValue,\n returnObject: Boolean,\n selectable: Boolean,\n selectedColor: String,\n selectStrategy: [String, Function, Object] as PropType<SelectStrategyProp>,\n}, 'VTreeviewChildren')\n\nexport const VTreeviewChildren = genericComponent<new <T extends InternalListItem>(\n props: {\n items?: readonly T[]\n },\n slots: VTreeviewChildrenSlots<T>\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VTreeviewChildren',\n\n props: makeVTreeviewChildrenProps(),\n\n setup (props, { slots }) {\n const isLoading = reactive(new Set<unknown>())\n\n const isClickOnOpen = computed(() => !props.disabled && (props.openOnClick != null ? props.openOnClick : props.selectable))\n\n async function checkChildren (item: InternalListItem) {\n try {\n if (!props.items?.length || !props.loadChildren) return\n\n if (item?.children?.length === 0) {\n isLoading.add(item.value)\n await props.loadChildren(item.raw)\n }\n } finally {\n isLoading.delete(item.value)\n }\n }\n\n function selectItem (select: (value: boolean) => void, isSelected: boolean) {\n if (props.selectable) {\n select(!isSelected)\n }\n }\n\n return () => slots.default?.() ?? props.items?.map(item => {\n if (item.type === 'divider') {\n return slots.divider?.({ props: item.props }) ?? (\n <VDivider { ...item.props } />\n )\n }\n\n const { children, props: itemProps } = item\n const loading = isLoading.has(item.value)\n const slotsWithItem = {\n prepend: slotProps => (\n <>\n { props.selectable && (!children || (children && !['leaf', 'single-leaf'].includes(props.selectStrategy as string))) && (\n <div>\n <VCheckboxBtn\n key={ item.value }\n modelValue={ slotProps.isSelected }\n disabled={ props.disabled }\n loading={ loading }\n color={ props.selectedColor }\n indeterminate={ slotProps.isIndeterminate }\n indeterminateIcon={ props.indeterminateIcon }\n falseIcon={ props.falseIcon }\n trueIcon={ props.trueIcon }\n onClick={ withModifiers(() => selectItem(slotProps.select, slotProps.isSelected), ['stop']) }\n onKeydown={ (e: KeyboardEvent) => {\n if (!['Enter', 'Space'].includes(e.key)) return\n e.stopPropagation()\n selectItem(slotProps.select, slotProps.isSelected)\n }}\n />\n </div>\n )}\n\n { slots.prepend?.({ ...slotProps, item: item.raw, internalItem: item }) }\n </>\n ),\n append: slots.append ? slotProps => slots.append?.({ ...slotProps, item: item.raw, internalItem: item }) : undefined,\n title: slots.title ? slotProps => slots.title?.({ ...slotProps, item: item.raw, internalItem: item }) : undefined,\n subtitle: slots.subtitle ? slotProps => slots.subtitle?.({ ...slotProps, item: item.raw, internalItem: item }) : undefined,\n } satisfies VTreeviewItem['$props']['$children']\n\n const treeviewGroupProps = VTreeviewGroup.filterProps(itemProps)\n const treeviewChildrenProps = VTreeviewChildren.filterProps(props)\n\n return children ? (\n <VTreeviewGroup\n { ...treeviewGroupProps }\n value={ props.returnObject ? item.raw : treeviewGroupProps?.value }\n >\n {{\n activator: ({ props: activatorProps }) => {\n const listItemProps = {\n ...itemProps,\n ...activatorProps,\n value: itemProps?.value,\n onToggleExpand: [() => checkChildren(item), activatorProps.onClick] as any,\n onClick: isClickOnOpen.value ? [() => checkChildren(item), activatorProps.onClick] as any : undefined,\n }\n\n return (\n <VTreeviewItem\n { ...listItemProps }\n value={ props.returnObject ? item.raw : itemProps.value }\n loading={ loading }\n v-slots={ slotsWithItem }\n />\n )\n },\n default: () => (\n <VTreeviewChildren\n { ...treeviewChildrenProps }\n items={ children }\n returnObject={ props.returnObject }\n v-slots={ slots }\n />\n ),\n }}\n </VTreeviewGroup>\n ) : (\n slots.item?.({ props: itemProps, item: item.raw, internalItem: item }) ?? (\n <VTreeviewItem\n { ...itemProps }\n value={ props.returnObject ? toRaw(item.raw) : itemProps.value }\n v-slots={ slotsWithItem }\n />\n ))\n })\n },\n})\n"],"mappings":";AAAA;AAAA,SACSA,cAAc;AAAA,SACdC,aAAa;AAAA,SACbC,YAAY;AAAA,SACZC,QAAQ,+CAEjB;AAAA,SACSC,SAAS,uCAElB;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,aAAa,QAAQ,KAAK;AAAA,SACrDC,gBAAgB,EAAEC,YAAY,gCAEvC;AAwBA,OAAO,MAAMC,0BAA0B,GAAGD,YAAY,CAAC;EACrDE,QAAQ,EAAEC,OAAO;EACjBC,YAAY,EAAEC,QAAsD;EACpEC,WAAW,EAAE;IACXC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EACDC,KAAK,EAAEC,KAA8C;EACrDC,WAAW,EAAE;IACXL,IAAI,EAAEJ,OAAO;IACbM,OAAO,EAAEI;EACX,CAAC;EACDC,iBAAiB,EAAE;IACjBP,IAAI,EAAEb,SAAS;IACfe,OAAO,EAAE;EACX,CAAC;EACDM,SAAS,EAAErB,SAAS;EACpBsB,QAAQ,EAAEtB,SAAS;EACnBuB,YAAY,EAAEd,OAAO;EACrBe,UAAU,EAAEf,OAAO;EACnBgB,aAAa,EAAEX,MAAM;EACrBY,cAAc,EAAE,CAACZ,MAAM,EAAEH,QAAQ,EAAEgB,MAAM;AAC3C,CAAC,EAAE,mBAAmB,CAAC;AAEvB,OAAO,MAAMC,iBAAiB,GAAGvB,gBAAgB,CAKF,CAAC,CAAC;EAC/CwB,IAAI,EAAE,mBAAmB;EAEzBC,KAAK,EAAEvB,0BAA0B,CAAC,CAAC;EAEnCwB,KAAK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,GAAG,CAAC,MAAML,aAAa,CAACC,IAAI,CAAC,EAAEmC,cAAc,CAACG,OAAO,CAAC,GAAUzD;UAC9F,CAAC;UAED,OAAA+B,YAAA,CAAArD,aAAA,EAAAyE,WAAA,CAESI,aAAa;YAAA,SACV5C,KAAK,CAACP,YAAY,GAAGe,IAAI,CAACK,GAAG,GAAGQ,SAAS,CAACT,KAAK;YAAA,WAC7CU;UAAO,IACPE,aAAa;QAG7B,CAAC;QACDvC,OAAO,EAAEA,CAAA,KAAAmC,YAAA,CAAAtB,iBAAA,EAAA0C,WAAA,CAEAD,qBAAqB;UAAA,SAClB7B,QAAQ;UAAA,gBACDV,KAAK,CAACP;QAAY,IACvBU,KAAK;MAElB,KAILA,KAAK,CAACK,IAAI,GAAG;QAAER,KAAK,EAAEqB,SAAS;QAAEb,IAAI,EAAEA,IAAI,CAACK,GAAG;QAAEoB,YAAY,EAAEzB;MAAK,CAAC,CAAC,IAAAY,YAAA,CAAArD,aAAA,EAAAyE,WAAA,CAE7DnB,SAAS;QAAA,SACNrB,KAAK,CAACP,YAAY,GAAGpB,KAAK,CAACmC,IAAI,CAACK,GAAG,CAAC,GAAGQ,SAAS,CAACT;MAAK,IACpDY,aAAa,CAEzB;IACN,CAAC,CAAC;EACJ;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"VTreeviewChildren.mjs","names":["VTreeviewGroup","VTreeviewItem","VCheckboxBtn","IconValue","computed","reactive","toRaw","withModifiers","genericComponent","propsFactory","makeVTreeviewChildrenProps","disabled","Boolean","loadChildren","Function","loadingIcon","type","String","default","items","Array","openOnClick","undefined","indeterminateIcon","falseIcon","trueIcon","returnObject","selectable","selectedColor","selectStrategy","Object","VTreeviewChildren","name","props","setup","_ref","slots","isLoading","Set","isClickOnOpen","checkChildren","item","length","children","add","value","raw","delete","selectItem","select","isSelected","map","itemProps","loading","has","slotsWithItem","prepend","slotProps","_createVNode","_Fragment","includes","isIndeterminate","e","key","stopPropagation","internalItem","append","title","subtitle","treeviewGroupProps","filterProps","treeviewChildrenProps","_mergeProps","activator","_ref2","activatorProps","listItemProps","onToggleExpand","onClick"],"sources":["../../../src/labs/VTreeview/VTreeviewChildren.tsx"],"sourcesContent":["// Components\nimport { VTreeviewGroup } from './VTreeviewGroup'\nimport { VTreeviewItem } from './VTreeviewItem'\nimport { VCheckboxBtn } from '@/components/VCheckbox'\n\n// Composables\nimport { IconValue } from '@/composables/icons'\n\n// Utilities\nimport { computed, reactive, toRaw, withModifiers } from 'vue'\nimport { genericComponent, propsFactory } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { InternalListItem } from '@/components/VList/VList'\nimport type { VListItemSlots } from '@/components/VList/VListItem'\nimport type { SelectStrategyProp } from '@/composables/nested/nested'\nimport type { GenericProps } from '@/util'\n\nexport type VTreeviewChildrenSlots<T> = {\n [K in keyof Omit<VListItemSlots, 'default'>]: VListItemSlots[K] & {\n item: T\n internalItem: InternalListItem<T>\n }\n} & {\n default: never\n item: {\n props: InternalListItem['props']\n item: T\n internalItem: InternalListItem<T>\n }\n}\n\nexport const makeVTreeviewChildrenProps = propsFactory({\n disabled: Boolean,\n loadChildren: Function as PropType<(item: unknown) => Promise<void>>,\n loadingIcon: {\n type: String,\n default: '$loading',\n },\n items: Array as PropType<readonly InternalListItem[]>,\n openOnClick: {\n type: Boolean,\n default: undefined,\n },\n indeterminateIcon: {\n type: IconValue,\n default: '$checkboxIndeterminate',\n },\n falseIcon: IconValue,\n trueIcon: IconValue,\n returnObject: Boolean,\n selectable: Boolean,\n selectedColor: String,\n selectStrategy: [String, Function, Object] as PropType<SelectStrategyProp>,\n}, 'VTreeviewChildren')\n\nexport const VTreeviewChildren = genericComponent<new <T extends InternalListItem>(\n props: {\n items?: readonly T[]\n },\n slots: VTreeviewChildrenSlots<T>\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VTreeviewChildren',\n\n props: makeVTreeviewChildrenProps(),\n\n setup (props, { slots }) {\n const isLoading = reactive(new Set<unknown>())\n\n const isClickOnOpen = computed(() => !props.disabled && (props.openOnClick != null ? props.openOnClick : props.selectable))\n\n async function checkChildren (item: InternalListItem) {\n try {\n if (!props.items?.length || !props.loadChildren) return\n\n if (item?.children?.length === 0) {\n isLoading.add(item.value)\n await props.loadChildren(item.raw)\n }\n } finally {\n isLoading.delete(item.value)\n }\n }\n\n function selectItem (select: (value: boolean) => void, isSelected: boolean) {\n if (props.selectable) {\n select(!isSelected)\n }\n }\n\n return () => slots.default?.() ?? props.items?.map(item => {\n const { children, props: itemProps } = item\n const loading = isLoading.has(item.value)\n const slotsWithItem = {\n prepend: slotProps => (\n <>\n { props.selectable && (!children || (children && !['leaf', 'single-leaf'].includes(props.selectStrategy as string))) && (\n <div>\n <VCheckboxBtn\n key={ item.value }\n modelValue={ slotProps.isSelected }\n disabled={ props.disabled }\n loading={ loading }\n color={ props.selectedColor }\n indeterminate={ slotProps.isIndeterminate }\n indeterminateIcon={ props.indeterminateIcon }\n falseIcon={ props.falseIcon }\n trueIcon={ props.trueIcon }\n onClick={ withModifiers(() => selectItem(slotProps.select, slotProps.isSelected), ['stop']) }\n onKeydown={ (e: KeyboardEvent) => {\n if (!['Enter', 'Space'].includes(e.key)) return\n e.stopPropagation()\n selectItem(slotProps.select, slotProps.isSelected)\n }}\n />\n </div>\n )}\n\n { slots.prepend?.({ ...slotProps, item: item.raw, internalItem: item }) }\n </>\n ),\n append: slots.append ? slotProps => slots.append?.({ ...slotProps, item: item.raw, internalItem: item }) : undefined,\n title: slots.title ? slotProps => slots.title?.({ ...slotProps, item: item.raw, internalItem: item }) : undefined,\n subtitle: slots.subtitle ? slotProps => slots.subtitle?.({ ...slotProps, item: item.raw, internalItem: item }) : undefined,\n } satisfies VTreeviewItem['$props']['$children']\n\n const treeviewGroupProps = VTreeviewGroup.filterProps(itemProps)\n const treeviewChildrenProps = VTreeviewChildren.filterProps(props)\n\n return children ? (\n <VTreeviewGroup\n { ...treeviewGroupProps }\n value={ props.returnObject ? item.raw : treeviewGroupProps?.value }\n >\n {{\n activator: ({ props: activatorProps }) => {\n const listItemProps = {\n ...itemProps,\n ...activatorProps,\n value: itemProps?.value,\n onToggleExpand: [() => checkChildren(item), activatorProps.onClick] as any,\n onClick: isClickOnOpen.value ? [() => checkChildren(item), activatorProps.onClick] as any : undefined,\n }\n\n return (\n <VTreeviewItem\n { ...listItemProps }\n value={ props.returnObject ? item.raw : itemProps.value }\n loading={ loading }\n v-slots={ slotsWithItem }\n />\n )\n },\n default: () => (\n <VTreeviewChildren\n { ...treeviewChildrenProps }\n items={ children }\n returnObject={ props.returnObject }\n v-slots={ slots }\n />\n ),\n }}\n </VTreeviewGroup>\n ) : (\n slots.item?.({ props: itemProps, item: item.raw, internalItem: item }) ?? (\n <VTreeviewItem\n { ...itemProps }\n value={ props.returnObject ? toRaw(item.raw) : itemProps.value }\n v-slots={ slotsWithItem }\n />\n ))\n })\n },\n})\n"],"mappings":";AAAA;AAAA,SACSA,cAAc;AAAA,SACdC,aAAa;AAAA,SACbC,YAAY,gDAErB;AAAA,SACSC,SAAS,uCAElB;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,aAAa,QAAQ,KAAK;AAAA,SACrDC,gBAAgB,EAAEC,YAAY,gCAEvC;AAqBA,OAAO,MAAMC,0BAA0B,GAAGD,YAAY,CAAC;EACrDE,QAAQ,EAAEC,OAAO;EACjBC,YAAY,EAAEC,QAAsD;EACpEC,WAAW,EAAE;IACXC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EACDC,KAAK,EAAEC,KAA8C;EACrDC,WAAW,EAAE;IACXL,IAAI,EAAEJ,OAAO;IACbM,OAAO,EAAEI;EACX,CAAC;EACDC,iBAAiB,EAAE;IACjBP,IAAI,EAAEb,SAAS;IACfe,OAAO,EAAE;EACX,CAAC;EACDM,SAAS,EAAErB,SAAS;EACpBsB,QAAQ,EAAEtB,SAAS;EACnBuB,YAAY,EAAEd,OAAO;EACrBe,UAAU,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