Files
music-admin/.output/server/chunks/build/VList-C7tHrCmP.mjs
poptong 83b162d2bd
Some checks failed
🚀 Deploy - Demo / deployment (push) Has been cancelled
🔧 웹훅 URL을 HTTPS로 수정
- 웹훅 URL을 https://admin.youtooplay.com/webhook로 변경
- Nginx 리버스 프록시 설정 파일 추가
- 배포 가이드 업데이트
2025-10-01 01:47:51 +09:00

1504 lines
44 KiB
JavaScript

import { toRef, computed, shallowRef, ref, createVNode, watch, withDirectives, mergeProps, Fragment, resolveDirective, provide, inject, toRaw, vShow } from 'vue';
import { V as VExpandTransition } from './index-BNHdF426.mjs';
import { g as genericComponent, aD as createSimpleFunctional, p as propsFactory, F as provideTheme, a0 as useBackgroundColor, ag as useBorder, ai as useDensity, f as useDimension, aj as useElevation, ak as useRounded, G as provideDefaults, a as useRender, af as Ripple, an as useLink, ah as useVariant, aU as deprecate, ao as genOverlays, v as VAvatar, s as VIcon, y as VDefaultsProvider, J as makeVariantProps, K as makeThemeProps, L as makeTagProps, N as makeRoundedProps, O as makeElevationProps, k as makeDimensionProps, P as makeDensityProps, m as makeComponentProps, Q as makeBorderProps, a2 as EventProp, I as IconValue, n as useProxiedModel, e as getCurrentInstance, aV as focusChild, ap as makeRouterProps, a5 as getUid, U as deepEqual, T as consoleError, at as useTextColor, aT as defineComponent, aA as MaybeTransition, a3 as getPropertyFromItem, r as omit, w as wrapInArray } from './server.mjs';
import { u as useSsrBoot } from './ssrBoot-BtvJZs44.mjs';
import { V as VDivider } from './VDivider-C0e0b_O5.mjs';
const ListKey = Symbol.for("vuetify:list");
function createList() {
const parent = inject(ListKey, {
hasPrepend: shallowRef(false),
updateHasPrepend: () => null
});
const data = {
hasPrepend: shallowRef(false),
updateHasPrepend: (value) => {
if (value) data.hasPrepend.value = value;
}
};
provide(ListKey, data);
return parent;
}
function useList() {
return inject(ListKey, null);
}
const independentActiveStrategy = (mandatory) => {
const strategy = {
activate: (_ref) => {
let {
id,
value,
activated
} = _ref;
id = toRaw(id);
if (mandatory && !value && activated.size === 1 && activated.has(id)) return activated;
if (value) {
activated.add(id);
} else {
activated.delete(id);
}
return activated;
},
in: (v, children, parents) => {
let set = /* @__PURE__ */ new Set();
if (v != null) {
for (const id of wrapInArray(v)) {
set = strategy.activate({
id,
value: true,
activated: new Set(set),
children,
parents
});
}
}
return set;
},
out: (v) => {
return Array.from(v);
}
};
return strategy;
};
const independentSingleActiveStrategy = (mandatory) => {
const parentStrategy = independentActiveStrategy(mandatory);
const strategy = {
activate: (_ref2) => {
let {
activated,
id,
...rest
} = _ref2;
id = toRaw(id);
const singleSelected = activated.has(id) ? /* @__PURE__ */ new Set([id]) : /* @__PURE__ */ new Set();
return parentStrategy.activate({
...rest,
id,
activated: singleSelected
});
},
in: (v, children, parents) => {
let set = /* @__PURE__ */ new Set();
if (v != null) {
const arr = wrapInArray(v);
if (arr.length) {
set = parentStrategy.in(arr.slice(0, 1), children, parents);
}
}
return set;
},
out: (v, children, parents) => {
return parentStrategy.out(v, children, parents);
}
};
return strategy;
};
const leafActiveStrategy = (mandatory) => {
const parentStrategy = independentActiveStrategy(mandatory);
const strategy = {
activate: (_ref3) => {
let {
id,
activated,
children,
...rest
} = _ref3;
id = toRaw(id);
if (children.has(id)) return activated;
return parentStrategy.activate({
id,
activated,
children,
...rest
});
},
in: parentStrategy.in,
out: parentStrategy.out
};
return strategy;
};
const leafSingleActiveStrategy = (mandatory) => {
const parentStrategy = independentSingleActiveStrategy(mandatory);
const strategy = {
activate: (_ref4) => {
let {
id,
activated,
children,
...rest
} = _ref4;
id = toRaw(id);
if (children.has(id)) return activated;
return parentStrategy.activate({
id,
activated,
children,
...rest
});
},
in: parentStrategy.in,
out: parentStrategy.out
};
return strategy;
};
const singleOpenStrategy = {
open: (_ref) => {
let {
id,
value,
opened,
parents
} = _ref;
if (value) {
const newOpened = /* @__PURE__ */ new Set();
newOpened.add(id);
let parent = parents.get(id);
while (parent != null) {
newOpened.add(parent);
parent = parents.get(parent);
}
return newOpened;
} else {
opened.delete(id);
return opened;
}
},
select: () => null
};
const multipleOpenStrategy = {
open: (_ref2) => {
let {
id,
value,
opened,
parents
} = _ref2;
if (value) {
let parent = parents.get(id);
opened.add(id);
while (parent != null && parent !== id) {
opened.add(parent);
parent = parents.get(parent);
}
return opened;
} else {
opened.delete(id);
}
return opened;
},
select: () => null
};
const listOpenStrategy = {
open: multipleOpenStrategy.open,
select: (_ref3) => {
let {
id,
value,
opened,
parents
} = _ref3;
if (!value) return opened;
const path = [];
let parent = parents.get(id);
while (parent != null) {
path.push(parent);
parent = parents.get(parent);
}
return new Set(path);
}
};
const independentSelectStrategy = (mandatory) => {
const strategy = {
select: (_ref) => {
let {
id,
value,
selected
} = _ref;
id = toRaw(id);
if (mandatory && !value) {
const on = Array.from(selected.entries()).reduce((arr, _ref2) => {
let [key, value2] = _ref2;
if (value2 === "on") arr.push(key);
return arr;
}, []);
if (on.length === 1 && on[0] === id) return selected;
}
selected.set(id, value ? "on" : "off");
return selected;
},
in: (v, children, parents) => {
let map = /* @__PURE__ */ new Map();
for (const id of v || []) {
map = strategy.select({
id,
value: true,
selected: new Map(map),
children,
parents
});
}
return map;
},
out: (v) => {
const arr = [];
for (const [key, value] of v.entries()) {
if (value === "on") arr.push(key);
}
return arr;
}
};
return strategy;
};
const independentSingleSelectStrategy = (mandatory) => {
const parentStrategy = independentSelectStrategy(mandatory);
const strategy = {
select: (_ref3) => {
let {
selected,
id,
...rest
} = _ref3;
id = toRaw(id);
const singleSelected = selected.has(id) ? /* @__PURE__ */ new Map([[id, selected.get(id)]]) : /* @__PURE__ */ new Map();
return parentStrategy.select({
...rest,
id,
selected: singleSelected
});
},
in: (v, children, parents) => {
let map = /* @__PURE__ */ new Map();
if (v == null ? void 0 : v.length) {
map = parentStrategy.in(v.slice(0, 1), children, parents);
}
return map;
},
out: (v, children, parents) => {
return parentStrategy.out(v, children, parents);
}
};
return strategy;
};
const leafSelectStrategy = (mandatory) => {
const parentStrategy = independentSelectStrategy(mandatory);
const strategy = {
select: (_ref4) => {
let {
id,
selected,
children,
...rest
} = _ref4;
id = toRaw(id);
if (children.has(id)) return selected;
return parentStrategy.select({
id,
selected,
children,
...rest
});
},
in: parentStrategy.in,
out: parentStrategy.out
};
return strategy;
};
const leafSingleSelectStrategy = (mandatory) => {
const parentStrategy = independentSingleSelectStrategy(mandatory);
const strategy = {
select: (_ref5) => {
let {
id,
selected,
children,
...rest
} = _ref5;
id = toRaw(id);
if (children.has(id)) return selected;
return parentStrategy.select({
id,
selected,
children,
...rest
});
},
in: parentStrategy.in,
out: parentStrategy.out
};
return strategy;
};
const classicSelectStrategy = (mandatory) => {
const strategy = {
select: (_ref6) => {
let {
id,
value,
selected,
children,
parents
} = _ref6;
id = toRaw(id);
const original = new Map(selected);
const items = [id];
while (items.length) {
const item = items.shift();
selected.set(toRaw(item), value ? "on" : "off");
if (children.has(item)) {
items.push(...children.get(item));
}
}
let parent = toRaw(parents.get(id));
while (parent) {
const childrenIds = children.get(parent);
const everySelected = childrenIds.every((cid) => selected.get(toRaw(cid)) === "on");
const noneSelected = childrenIds.every((cid) => !selected.has(toRaw(cid)) || selected.get(toRaw(cid)) === "off");
selected.set(parent, everySelected ? "on" : noneSelected ? "off" : "indeterminate");
parent = toRaw(parents.get(parent));
}
if (mandatory && !value) {
const on = Array.from(selected.entries()).reduce((arr, _ref7) => {
let [key, value2] = _ref7;
if (value2 === "on") arr.push(key);
return arr;
}, []);
if (on.length === 0) return original;
}
return selected;
},
in: (v, children, parents) => {
let map = /* @__PURE__ */ new Map();
for (const id of v || []) {
map = strategy.select({
id,
value: true,
selected: new Map(map),
children,
parents
});
}
return map;
},
out: (v, children) => {
const arr = [];
for (const [key, value] of v.entries()) {
if (value === "on" && !children.has(key)) arr.push(key);
}
return arr;
}
};
return strategy;
};
const VNestedSymbol = Symbol.for("vuetify:nested");
const emptyNested = {
id: shallowRef(),
root: {
register: () => null,
unregister: () => null,
parents: ref(/* @__PURE__ */ new Map()),
children: ref(/* @__PURE__ */ new Map()),
open: () => null,
openOnSelect: () => null,
activate: () => null,
select: () => null,
activatable: ref(false),
selectable: ref(false),
opened: ref(/* @__PURE__ */ new Set()),
activated: ref(/* @__PURE__ */ new Set()),
selected: ref(/* @__PURE__ */ new Map()),
selectedValues: ref([]),
getPath: () => []
}
};
const makeNestedProps = propsFactory({
activatable: Boolean,
selectable: Boolean,
activeStrategy: [String, Function, Object],
selectStrategy: [String, Function, Object],
openStrategy: [String, Object],
opened: null,
activated: null,
selected: null,
mandatory: Boolean
}, "nested");
const useNested = (props) => {
const children = ref(/* @__PURE__ */ new Map());
const parents = ref(/* @__PURE__ */ new Map());
const opened = useProxiedModel(props, "opened", props.opened, (v) => new Set(v), (v) => [...v.values()]);
const activeStrategy = computed(() => {
if (typeof props.activeStrategy === "object") return props.activeStrategy;
if (typeof props.activeStrategy === "function") return props.activeStrategy(props.mandatory);
switch (props.activeStrategy) {
case "leaf":
return leafActiveStrategy(props.mandatory);
case "single-leaf":
return leafSingleActiveStrategy(props.mandatory);
case "independent":
return independentActiveStrategy(props.mandatory);
case "single-independent":
default:
return independentSingleActiveStrategy(props.mandatory);
}
});
const selectStrategy = computed(() => {
if (typeof props.selectStrategy === "object") return props.selectStrategy;
if (typeof props.selectStrategy === "function") return props.selectStrategy(props.mandatory);
switch (props.selectStrategy) {
case "single-leaf":
return leafSingleSelectStrategy(props.mandatory);
case "leaf":
return leafSelectStrategy(props.mandatory);
case "independent":
return independentSelectStrategy(props.mandatory);
case "single-independent":
return independentSingleSelectStrategy(props.mandatory);
case "classic":
default:
return classicSelectStrategy(props.mandatory);
}
});
const openStrategy = computed(() => {
if (typeof props.openStrategy === "object") return props.openStrategy;
switch (props.openStrategy) {
case "list":
return listOpenStrategy;
case "single":
return singleOpenStrategy;
case "multiple":
default:
return multipleOpenStrategy;
}
});
const activated = useProxiedModel(props, "activated", props.activated, (v) => activeStrategy.value.in(v, children.value, parents.value), (v) => activeStrategy.value.out(v, children.value, parents.value));
const selected = useProxiedModel(props, "selected", props.selected, (v) => selectStrategy.value.in(v, children.value, parents.value), (v) => selectStrategy.value.out(v, children.value, parents.value));
function getPath(id) {
const path = [];
let parent = id;
while (parent != null) {
path.unshift(parent);
parent = parents.value.get(parent);
}
return path;
}
const vm = getCurrentInstance("nested");
const nodeIds = /* @__PURE__ */ new Set();
const nested = {
id: shallowRef(),
root: {
opened,
activatable: toRef(props, "activatable"),
selectable: toRef(props, "selectable"),
activated,
selected,
selectedValues: computed(() => {
const arr = [];
for (const [key, value] of selected.value.entries()) {
if (value === "on") arr.push(key);
}
return arr;
}),
register: (id, parentId, isGroup) => {
if (nodeIds.has(id)) {
const path = getPath(id).map(String).join(" -> ");
const newPath = getPath(parentId).concat(id).map(String).join(" -> ");
consoleError(`Multiple nodes with the same ID
${path}
${newPath}`);
return;
} else {
nodeIds.add(id);
}
parentId && id !== parentId && parents.value.set(id, parentId);
isGroup && children.value.set(id, []);
if (parentId != null) {
children.value.set(parentId, [...children.value.get(parentId) || [], id]);
}
},
unregister: (id) => {
var _a;
nodeIds.delete(id);
children.value.delete(id);
const parent = parents.value.get(id);
if (parent) {
const list = (_a = children.value.get(parent)) != null ? _a : [];
children.value.set(parent, list.filter((child) => child !== id));
}
parents.value.delete(id);
},
open: (id, value, event) => {
vm.emit("click:open", {
id,
value,
path: getPath(id),
event
});
const newOpened = openStrategy.value.open({
id,
value,
opened: new Set(opened.value),
children: children.value,
parents: parents.value,
event
});
newOpened && (opened.value = newOpened);
},
openOnSelect: (id, value, event) => {
const newOpened = openStrategy.value.select({
id,
value,
selected: new Map(selected.value),
opened: new Set(opened.value),
children: children.value,
parents: parents.value,
event
});
newOpened && (opened.value = newOpened);
},
select: (id, value, event) => {
vm.emit("click:select", {
id,
value,
path: getPath(id),
event
});
const newSelected = selectStrategy.value.select({
id,
value,
selected: new Map(selected.value),
children: children.value,
parents: parents.value,
event
});
newSelected && (selected.value = newSelected);
nested.root.openOnSelect(id, value, event);
},
activate: (id, value, event) => {
if (!props.activatable) {
return nested.root.select(id, true, event);
}
vm.emit("click:activate", {
id,
value,
path: getPath(id),
event
});
const newActivated = activeStrategy.value.activate({
id,
value,
activated: new Set(activated.value),
children: children.value,
parents: parents.value,
event
});
newActivated && (activated.value = newActivated);
},
children,
parents,
getPath
}
};
provide(VNestedSymbol, nested);
return nested.root;
};
const useNestedItem = (id, isGroup) => {
const parent = inject(VNestedSymbol, emptyNested);
const uidSymbol = Symbol(getUid());
const computedId = computed(() => id.value !== void 0 ? id.value : uidSymbol);
const item = {
...parent,
id: computedId,
open: (open, e) => parent.root.open(computedId.value, open, e),
openOnSelect: (open, e) => parent.root.openOnSelect(computedId.value, open, e),
isOpen: computed(() => parent.root.opened.value.has(computedId.value)),
parent: computed(() => parent.root.parents.value.get(computedId.value)),
activate: (activated, e) => parent.root.activate(computedId.value, activated, e),
isActivated: computed(() => parent.root.activated.value.has(toRaw(computedId.value))),
select: (selected, e) => parent.root.select(computedId.value, selected, e),
isSelected: computed(() => parent.root.selected.value.get(toRaw(computedId.value)) === "on"),
isIndeterminate: computed(() => parent.root.selected.value.get(computedId.value) === "indeterminate"),
isLeaf: computed(() => !parent.root.children.value.get(computedId.value)),
isGroupActivator: parent.isGroupActivator
};
!parent.isGroupActivator && parent.root.register(computedId.value, parent.id.value, isGroup);
isGroup && provide(VNestedSymbol, item);
return item;
};
const useNestedGroupActivator = () => {
const parent = inject(VNestedSymbol, emptyNested);
provide(VNestedSymbol, {
...parent,
isGroupActivator: true
});
};
const VListGroupActivator = defineComponent({
name: "VListGroupActivator",
setup(_, _ref) {
let {
slots
} = _ref;
useNestedGroupActivator();
return () => {
var _a;
return (_a = slots.default) == null ? void 0 : _a.call(slots);
};
}
});
const makeVListGroupProps = propsFactory({
/* @deprecated */
activeColor: String,
baseColor: String,
color: String,
collapseIcon: {
type: IconValue,
default: "$collapse"
},
expandIcon: {
type: IconValue,
default: "$expand"
},
prependIcon: IconValue,
appendIcon: IconValue,
fluid: Boolean,
subgroup: Boolean,
title: String,
value: null,
...makeComponentProps(),
...makeTagProps()
}, "VListGroup");
const VListGroup = genericComponent()({
name: "VListGroup",
props: makeVListGroupProps(),
setup(props, _ref2) {
let {
slots
} = _ref2;
const {
isOpen,
open,
id: _id
} = useNestedItem(toRef(props, "value"), true);
const id = computed(() => `v-list-group--id-${String(_id.value)}`);
const list = useList();
const {
isBooted
} = useSsrBoot();
function onClick(e) {
e.stopPropagation();
open(!isOpen.value, e);
}
const activatorProps = computed(() => ({
onClick,
class: "v-list-group__header",
id: id.value
}));
const toggleIcon = computed(() => isOpen.value ? props.collapseIcon : props.expandIcon);
const activatorDefaults = computed(() => ({
VListItem: {
active: isOpen.value,
activeColor: props.activeColor,
baseColor: props.baseColor,
color: props.color,
prependIcon: props.prependIcon || props.subgroup && toggleIcon.value,
appendIcon: props.appendIcon || !props.subgroup && toggleIcon.value,
title: props.title,
value: props.value
}
}));
useRender(() => createVNode(props.tag, {
"class": ["v-list-group", {
"v-list-group--prepend": list == null ? void 0 : list.hasPrepend.value,
"v-list-group--fluid": props.fluid,
"v-list-group--subgroup": props.subgroup,
"v-list-group--open": isOpen.value
}, props.class],
"style": props.style
}, {
default: () => [slots.activator && createVNode(VDefaultsProvider, {
"defaults": activatorDefaults.value
}, {
default: () => [createVNode(VListGroupActivator, null, {
default: () => [slots.activator({
props: activatorProps.value,
isOpen: isOpen.value
})]
})]
}), createVNode(MaybeTransition, {
"transition": {
component: VExpandTransition
},
"disabled": !isBooted.value
}, {
default: () => {
var _a;
return [withDirectives(createVNode("div", {
"class": "v-list-group__items",
"role": "group",
"aria-labelledby": id.value
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), [[vShow, isOpen.value]])];
}
})]
}));
return {
isOpen
};
}
});
const makeVListItemSubtitleProps = propsFactory({
opacity: [Number, String],
...makeComponentProps(),
...makeTagProps()
}, "VListItemSubtitle");
const VListItemSubtitle = genericComponent()({
name: "VListItemSubtitle",
props: makeVListItemSubtitleProps(),
setup(props, _ref) {
let {
slots
} = _ref;
useRender(() => createVNode(props.tag, {
"class": ["v-list-item-subtitle", props.class],
"style": [{
"--v-list-item-subtitle-opacity": props.opacity
}, props.style]
}, slots));
return {};
}
});
const VListItemTitle = createSimpleFunctional("v-list-item-title");
const makeVListItemProps = propsFactory({
active: {
type: Boolean,
default: void 0
},
activeClass: String,
/* @deprecated */
activeColor: String,
appendAvatar: String,
appendIcon: IconValue,
baseColor: String,
disabled: Boolean,
lines: [Boolean, String],
link: {
type: Boolean,
default: void 0
},
nav: Boolean,
prependAvatar: String,
prependIcon: IconValue,
ripple: {
type: [Boolean, Object],
default: true
},
slim: Boolean,
subtitle: [String, Number],
title: [String, Number],
value: null,
onClick: EventProp(),
onClickOnce: EventProp(),
...makeBorderProps(),
...makeComponentProps(),
...makeDensityProps(),
...makeDimensionProps(),
...makeElevationProps(),
...makeRoundedProps(),
...makeRouterProps(),
...makeTagProps(),
...makeThemeProps(),
...makeVariantProps({
variant: "text"
})
}, "VListItem");
const VListItem = genericComponent()({
name: "VListItem",
directives: {
Ripple
},
props: makeVListItemProps(),
emits: {
click: (e) => true
},
setup(props, _ref) {
let {
attrs,
slots,
emit
} = _ref;
const link = useLink(props, attrs);
const id = computed(() => props.value === void 0 ? link.href.value : props.value);
const {
activate,
isActivated,
select,
isOpen,
isSelected,
isIndeterminate,
isGroupActivator,
root,
parent,
openOnSelect,
id: uid
} = useNestedItem(id, false);
const list = useList();
const isActive = computed(() => {
var _a;
return props.active !== false && (props.active || ((_a = link.isActive) == null ? void 0 : _a.value) || (root.activatable.value ? isActivated.value : isSelected.value));
});
const isLink = computed(() => props.link !== false && link.isLink.value);
const isSelectable = computed(() => !!list && (root.selectable.value || root.activatable.value || props.value != null));
const isClickable = computed(() => !props.disabled && props.link !== false && (props.link || link.isClickable.value || isSelectable.value));
const roundedProps = computed(() => props.rounded || props.nav);
const color = computed(() => {
var _a;
return (_a = props.color) != null ? _a : props.activeColor;
});
const variantProps = computed(() => {
var _a;
return {
color: isActive.value ? (_a = color.value) != null ? _a : props.baseColor : props.baseColor,
variant: props.variant
};
});
watch(() => {
var _a;
return (_a = link.isActive) == null ? void 0 : _a.value;
}, (val) => {
if (val && parent.value != null) {
root.open(parent.value, true);
}
if (val) {
openOnSelect(val);
}
}, {
immediate: true
});
const {
themeClasses
} = provideTheme(props);
const {
borderClasses
} = useBorder(props);
const {
colorClasses,
colorStyles,
variantClasses
} = useVariant(variantProps);
const {
densityClasses
} = useDensity(props);
const {
dimensionStyles
} = useDimension(props);
const {
elevationClasses
} = useElevation(props);
const {
roundedClasses
} = useRounded(roundedProps);
const lineClasses = computed(() => props.lines ? `v-list-item--${props.lines}-line` : void 0);
const slotProps = computed(() => ({
isActive: isActive.value,
select,
isOpen: isOpen.value,
isSelected: isSelected.value,
isIndeterminate: isIndeterminate.value
}));
function onClick(e) {
var _a;
emit("click", e);
if (!isClickable.value) return;
(_a = link.navigate) == null ? void 0 : _a.call(link, e);
if (isGroupActivator) return;
if (root.activatable.value) {
activate(!isActivated.value, e);
} else if (root.selectable.value) {
select(!isSelected.value, e);
} else if (props.value != null) {
select(!isSelected.value, e);
}
}
function onKeyDown(e) {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
e.target.dispatchEvent(new MouseEvent("click", e));
}
}
useRender(() => {
const Tag = isLink.value ? "a" : props.tag;
const hasTitle = slots.title || props.title != null;
const hasSubtitle = slots.subtitle || props.subtitle != null;
const hasAppendMedia = !!(props.appendAvatar || props.appendIcon);
const hasAppend = !!(hasAppendMedia || slots.append);
const hasPrependMedia = !!(props.prependAvatar || props.prependIcon);
const hasPrepend = !!(hasPrependMedia || slots.prepend);
list == null ? void 0 : list.updateHasPrepend(hasPrepend);
if (props.activeColor) {
deprecate("active-color", ["color", "base-color"]);
}
return withDirectives(createVNode(Tag, mergeProps({
"class": ["v-list-item", {
"v-list-item--active": isActive.value,
"v-list-item--disabled": props.disabled,
"v-list-item--link": isClickable.value,
"v-list-item--nav": props.nav,
"v-list-item--prepend": !hasPrepend && (list == null ? void 0 : list.hasPrepend.value),
"v-list-item--slim": props.slim,
[`${props.activeClass}`]: props.activeClass && isActive.value
}, themeClasses.value, borderClasses.value, colorClasses.value, densityClasses.value, elevationClasses.value, lineClasses.value, roundedClasses.value, variantClasses.value, props.class],
"style": [colorStyles.value, dimensionStyles.value, props.style],
"tabindex": isClickable.value ? list ? -2 : 0 : void 0,
"aria-selected": isSelectable.value ? root.activatable.value ? isActivated.value : root.selectable.value ? isSelected.value : isActive.value : void 0,
"onClick": onClick,
"onKeydown": isClickable.value && !isLink.value && onKeyDown
}, link.linkProps), {
default: () => {
var _a;
return [genOverlays(isClickable.value || isActive.value, "v-list-item"), hasPrepend && createVNode("div", {
"key": "prepend",
"class": "v-list-item__prepend"
}, [!slots.prepend ? createVNode(Fragment, null, [props.prependAvatar && createVNode(VAvatar, {
"key": "prepend-avatar",
"density": props.density,
"image": props.prependAvatar
}, null), props.prependIcon && createVNode(VIcon, {
"key": "prepend-icon",
"density": props.density,
"icon": props.prependIcon
}, null)]) : createVNode(VDefaultsProvider, {
"key": "prepend-defaults",
"disabled": !hasPrependMedia,
"defaults": {
VAvatar: {
density: props.density,
image: props.prependAvatar
},
VIcon: {
density: props.density,
icon: props.prependIcon
},
VListItemAction: {
start: true
}
}
}, {
default: () => {
var _a2;
return [(_a2 = slots.prepend) == null ? void 0 : _a2.call(slots, slotProps.value)];
}
}), createVNode("div", {
"class": "v-list-item__spacer"
}, null)]), createVNode("div", {
"class": "v-list-item__content",
"data-no-activator": ""
}, [hasTitle && createVNode(VListItemTitle, {
"key": "title"
}, {
default: () => {
var _a3;
var _a2;
return [(_a3 = (_a2 = slots.title) == null ? void 0 : _a2.call(slots, {
title: props.title
})) != null ? _a3 : props.title];
}
}), hasSubtitle && createVNode(VListItemSubtitle, {
"key": "subtitle"
}, {
default: () => {
var _a3;
var _a2;
return [(_a3 = (_a2 = slots.subtitle) == null ? void 0 : _a2.call(slots, {
subtitle: props.subtitle
})) != null ? _a3 : props.subtitle];
}
}), (_a = slots.default) == null ? void 0 : _a.call(slots, slotProps.value)]), hasAppend && createVNode("div", {
"key": "append",
"class": "v-list-item__append"
}, [!slots.append ? createVNode(Fragment, null, [props.appendIcon && createVNode(VIcon, {
"key": "append-icon",
"density": props.density,
"icon": props.appendIcon
}, null), props.appendAvatar && createVNode(VAvatar, {
"key": "append-avatar",
"density": props.density,
"image": props.appendAvatar
}, null)]) : createVNode(VDefaultsProvider, {
"key": "append-defaults",
"disabled": !hasAppendMedia,
"defaults": {
VAvatar: {
density: props.density,
image: props.appendAvatar
},
VIcon: {
density: props.density,
icon: props.appendIcon
},
VListItemAction: {
end: true
}
}
}, {
default: () => {
var _a2;
return [(_a2 = slots.append) == null ? void 0 : _a2.call(slots, slotProps.value)];
}
}), createVNode("div", {
"class": "v-list-item__spacer"
}, null)])];
}
}), [[resolveDirective("ripple"), isClickable.value && props.ripple]]);
});
return {
activate,
isActivated,
isGroupActivator,
isSelected,
list,
select,
root,
id: uid
};
}
});
const makeVListSubheaderProps = propsFactory({
color: String,
inset: Boolean,
sticky: Boolean,
title: String,
...makeComponentProps(),
...makeTagProps()
}, "VListSubheader");
const VListSubheader = genericComponent()({
name: "VListSubheader",
props: makeVListSubheaderProps(),
setup(props, _ref) {
let {
slots
} = _ref;
const {
textColorClasses,
textColorStyles
} = useTextColor(toRef(props, "color"));
useRender(() => {
const hasText = !!(slots.default || props.title);
return createVNode(props.tag, {
"class": ["v-list-subheader", {
"v-list-subheader--inset": props.inset,
"v-list-subheader--sticky": props.sticky
}, textColorClasses.value, props.class],
"style": [{
textColorStyles
}, props.style]
}, {
default: () => {
var _a2;
var _a;
return [hasText && createVNode("div", {
"class": "v-list-subheader__text"
}, [(_a2 = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _a2 : props.title])];
}
});
});
return {};
}
});
const makeVListChildrenProps = propsFactory({
items: Array,
returnObject: Boolean
}, "VListChildren");
const VListChildren = genericComponent()({
name: "VListChildren",
props: makeVListChildrenProps(),
setup(props, _ref) {
let {
slots
} = _ref;
createList();
return () => {
var _a2;
var _a, _b;
return (_a2 = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _a2 : (_b = props.items) == null ? void 0 : _b.map((_ref2) => {
var _a3, _b3;
var _a22, _b2;
let {
children,
props: itemProps,
type,
raw: item
} = _ref2;
if (type === "divider") {
return (_a3 = (_a22 = slots.divider) == null ? void 0 : _a22.call(slots, {
props: itemProps
})) != null ? _a3 : createVNode(VDivider, itemProps, null);
}
if (type === "subheader") {
return (_b3 = (_b2 = slots.subheader) == null ? void 0 : _b2.call(slots, {
props: itemProps
})) != null ? _b3 : createVNode(VListSubheader, itemProps, null);
}
const slotsWithItem = {
subtitle: slots.subtitle ? (slotProps) => {
var _a32;
return (_a32 = slots.subtitle) == null ? void 0 : _a32.call(slots, {
...slotProps,
item
});
} : void 0,
prepend: slots.prepend ? (slotProps) => {
var _a32;
return (_a32 = slots.prepend) == null ? void 0 : _a32.call(slots, {
...slotProps,
item
});
} : void 0,
append: slots.append ? (slotProps) => {
var _a32;
return (_a32 = slots.append) == null ? void 0 : _a32.call(slots, {
...slotProps,
item
});
} : void 0,
title: slots.title ? (slotProps) => {
var _a32;
return (_a32 = slots.title) == null ? void 0 : _a32.call(slots, {
...slotProps,
item
});
} : void 0
};
const listGroupProps = VListGroup.filterProps(itemProps);
return children ? createVNode(VListGroup, mergeProps({
"value": itemProps == null ? void 0 : itemProps.value
}, listGroupProps), {
activator: (_ref3) => {
let {
props: activatorProps
} = _ref3;
const listItemProps = {
...itemProps,
...activatorProps,
value: props.returnObject ? item : itemProps.value
};
return slots.header ? slots.header({
props: listItemProps
}) : createVNode(VListItem, listItemProps, slotsWithItem);
},
default: () => createVNode(VListChildren, {
"items": children,
"returnObject": props.returnObject
}, slots)
}) : slots.item ? slots.item({
props: itemProps
}) : createVNode(VListItem, mergeProps(itemProps, {
"value": props.returnObject ? item : itemProps.value
}), slotsWithItem);
});
};
}
});
const makeItemsProps = propsFactory({
items: {
type: Array,
default: () => []
},
itemTitle: {
type: [String, Array, Function],
default: "title"
},
itemValue: {
type: [String, Array, Function],
default: "value"
},
itemChildren: {
type: [Boolean, String, Array, Function],
default: "children"
},
itemProps: {
type: [Boolean, String, Array, Function],
default: "props"
},
returnObject: Boolean,
valueComparator: {
type: Function,
default: deepEqual
}
}, "list-items");
function transformItem$1(props, item) {
var _a;
const title = getPropertyFromItem(item, props.itemTitle, item);
const value = getPropertyFromItem(item, props.itemValue, title);
const children = getPropertyFromItem(item, props.itemChildren);
const itemProps = props.itemProps === true ? typeof item === "object" && item != null && !Array.isArray(item) ? "children" in item ? omit(item, ["children"]) : item : void 0 : getPropertyFromItem(item, props.itemProps);
const _props = {
title,
value,
...itemProps
};
return {
title: String((_a = _props.title) != null ? _a : ""),
value: _props.value,
props: _props,
children: Array.isArray(children) ? transformItems$1(props, children) : void 0,
raw: item
};
}
function transformItems$1(props, items) {
const array = [];
for (const item of items) {
array.push(transformItem$1(props, item));
}
return array;
}
function useItems(props) {
const items = computed(() => transformItems$1(props, props.items));
const hasNullItem = computed(() => items.value.some((item) => item.value === null));
function transformIn(value) {
if (!hasNullItem.value) {
value = value.filter((v) => v !== null);
}
return value.map((v) => {
if (props.returnObject && typeof v === "string") {
return transformItem$1(props, v);
}
return items.value.find((item) => props.valueComparator(v, item.value)) || transformItem$1(props, v);
});
}
function transformOut(value) {
return props.returnObject ? value.map((_ref) => {
let {
raw
} = _ref;
return raw;
}) : value.map((_ref2) => {
let {
value: value2
} = _ref2;
return value2;
});
}
return {
items,
transformIn,
transformOut
};
}
function isPrimitive(value) {
return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
}
function transformItem(props, item) {
const type = getPropertyFromItem(item, props.itemType, "item");
const title = isPrimitive(item) ? item : getPropertyFromItem(item, props.itemTitle);
const value = getPropertyFromItem(item, props.itemValue, void 0);
const children = getPropertyFromItem(item, props.itemChildren);
const itemProps = props.itemProps === true ? omit(item, ["children"]) : getPropertyFromItem(item, props.itemProps);
const _props = {
title,
value,
...itemProps
};
return {
type,
title: _props.title,
value: _props.value,
props: _props,
children: type === "item" && children ? transformItems(props, children) : void 0,
raw: item
};
}
function transformItems(props, items) {
const array = [];
for (const item of items) {
array.push(transformItem(props, item));
}
return array;
}
function useListItems(props) {
const items = computed(() => transformItems(props, props.items));
return {
items
};
}
const makeVListProps = propsFactory({
baseColor: String,
/* @deprecated */
activeColor: String,
activeClass: String,
bgColor: String,
disabled: Boolean,
expandIcon: IconValue,
collapseIcon: IconValue,
lines: {
type: [Boolean, String],
default: "one"
},
slim: Boolean,
nav: Boolean,
"onClick:open": EventProp(),
"onClick:select": EventProp(),
"onUpdate:opened": EventProp(),
...makeNestedProps({
selectStrategy: "single-leaf",
openStrategy: "list"
}),
...makeBorderProps(),
...makeComponentProps(),
...makeDensityProps(),
...makeDimensionProps(),
...makeElevationProps(),
itemType: {
type: String,
default: "type"
},
...makeItemsProps(),
...makeRoundedProps(),
...makeTagProps(),
...makeThemeProps(),
...makeVariantProps({
variant: "text"
})
}, "VList");
const VList = genericComponent()({
name: "VList",
props: makeVListProps(),
emits: {
"update:selected": (value) => true,
"update:activated": (value) => true,
"update:opened": (value) => true,
"click:open": (value) => true,
"click:activate": (value) => true,
"click:select": (value) => true
},
setup(props, _ref) {
let {
slots
} = _ref;
const {
items
} = useListItems(props);
const {
themeClasses
} = provideTheme(props);
const {
backgroundColorClasses,
backgroundColorStyles
} = useBackgroundColor(toRef(props, "bgColor"));
const {
borderClasses
} = useBorder(props);
const {
densityClasses
} = useDensity(props);
const {
dimensionStyles
} = useDimension(props);
const {
elevationClasses
} = useElevation(props);
const {
roundedClasses
} = useRounded(props);
const {
children,
open,
parents,
select,
getPath
} = useNested(props);
const lineClasses = computed(() => props.lines ? `v-list--${props.lines}-line` : void 0);
const activeColor = toRef(props, "activeColor");
const baseColor = toRef(props, "baseColor");
const color = toRef(props, "color");
createList();
provideDefaults({
VListGroup: {
activeColor,
baseColor,
color,
expandIcon: toRef(props, "expandIcon"),
collapseIcon: toRef(props, "collapseIcon")
},
VListItem: {
activeClass: toRef(props, "activeClass"),
activeColor,
baseColor,
color,
density: toRef(props, "density"),
disabled: toRef(props, "disabled"),
lines: toRef(props, "lines"),
nav: toRef(props, "nav"),
slim: toRef(props, "slim"),
variant: toRef(props, "variant")
}
});
const isFocused = shallowRef(false);
const contentRef = ref();
function onFocusin(e) {
isFocused.value = true;
}
function onFocusout(e) {
isFocused.value = false;
}
function onFocus(e) {
var _a;
if (!isFocused.value && !(e.relatedTarget && ((_a = contentRef.value) == null ? void 0 : _a.contains(e.relatedTarget)))) focus();
}
function onKeydown(e) {
const target = e.target;
if (!contentRef.value || ["INPUT", "TEXTAREA"].includes(target.tagName)) return;
if (e.key === "ArrowDown") {
focus("next");
} else if (e.key === "ArrowUp") {
focus("prev");
} else if (e.key === "Home") {
focus("first");
} else if (e.key === "End") {
focus("last");
} else {
return;
}
e.preventDefault();
}
function onMousedown(e) {
isFocused.value = true;
}
function focus(location) {
if (contentRef.value) {
return focusChild(contentRef.value, location);
}
}
useRender(() => {
return createVNode(props.tag, {
"ref": contentRef,
"class": ["v-list", {
"v-list--disabled": props.disabled,
"v-list--nav": props.nav,
"v-list--slim": props.slim
}, themeClasses.value, backgroundColorClasses.value, borderClasses.value, densityClasses.value, elevationClasses.value, lineClasses.value, roundedClasses.value, props.class],
"style": [backgroundColorStyles.value, dimensionStyles.value, props.style],
"tabindex": props.disabled || isFocused.value ? -1 : 0,
"role": "listbox",
"aria-activedescendant": void 0,
"onFocusin": onFocusin,
"onFocusout": onFocusout,
"onFocus": onFocus,
"onKeydown": onKeydown,
"onMousedown": onMousedown
}, {
default: () => [createVNode(VListChildren, {
"items": items.value,
"returnObject": props.returnObject
}, slots)]
});
});
return {
open,
select,
focus,
children,
parents,
getPath
};
}
});
export { VList as V, VListItem as a, VListItemTitle as b, VListItemSubtitle as c, makeItemsProps as m, useItems as u };