Files
2026-01-09 19:24:41 +00:00

138 lines
3.6 KiB
JavaScript

import {
VDialogTransition
} from "./chunk-B4JFJDWM.js";
import {
VOverlay,
makeVOverlayProps
} from "./chunk-CL6G3ICF.js";
import {
useScopeId
} from "./chunk-BVUPSGRF.js";
import {
forwardRefs
} from "./chunk-GUNW7S2L.js";
import {
VDefaultsProvider
} from "./chunk-PAT7NP2Z.js";
import {
useProxiedModel
} from "./chunk-KA77II4V.js";
import {
genericComponent,
omit,
propsFactory,
useRender
} from "./chunk-LZ5T2ERG.js";
import {
createVNode,
mergeProps,
nextTick,
ref,
watch
} from "./chunk-2MKFL3BX.js";
// node_modules/vuetify/lib/components/VDialog/VDialog.js
import "/home/david/gitea_repo/personal_development/ServerManagerWebApp/frontend/node_modules/vuetify/lib/components/VDialog/VDialog.css";
var makeVDialogProps = propsFactory({
fullscreen: Boolean,
scrollable: Boolean,
...omit(makeVOverlayProps({
captureFocus: true,
origin: "center center",
scrollStrategy: "block",
transition: {
component: VDialogTransition
},
zIndex: 2400,
retainFocus: true
}), ["disableInitialFocus"])
}, "VDialog");
var VDialog = genericComponent()({
name: "VDialog",
props: makeVDialogProps(),
emits: {
"update:modelValue": (value) => true,
afterEnter: () => true,
afterLeave: () => true
},
setup(props, _ref) {
let {
emit,
slots
} = _ref;
const isActive = useProxiedModel(props, "modelValue");
const {
scopeId
} = useScopeId();
const overlay = ref();
function onAfterEnter() {
emit("afterEnter");
if ((props.scrim || props.retainFocus) && overlay.value?.contentEl && !overlay.value.contentEl.contains(document.activeElement)) {
overlay.value.contentEl.focus({
preventScroll: true
});
}
}
function onAfterLeave() {
emit("afterLeave");
}
watch(isActive, async (val) => {
if (!val) {
await nextTick();
overlay.value.activatorEl?.focus({
preventScroll: true
});
}
});
useRender(() => {
const overlayProps = VOverlay.filterProps(props);
const activatorProps = mergeProps({
"aria-haspopup": "dialog"
}, props.activatorProps);
const contentProps = mergeProps({
tabindex: -1
}, props.contentProps);
return createVNode(VOverlay, mergeProps({
"ref": overlay,
"class": ["v-dialog", {
"v-dialog--fullscreen": props.fullscreen,
"v-dialog--scrollable": props.scrollable
}, props.class],
"style": props.style
}, overlayProps, {
"modelValue": isActive.value,
"onUpdate:modelValue": ($event) => isActive.value = $event,
"aria-modal": "true",
"activatorProps": activatorProps,
"contentProps": contentProps,
"height": !props.fullscreen ? props.height : void 0,
"width": !props.fullscreen ? props.width : void 0,
"maxHeight": !props.fullscreen ? props.maxHeight : void 0,
"maxWidth": !props.fullscreen ? props.maxWidth : void 0,
"role": "dialog",
"onAfterEnter": onAfterEnter,
"onAfterLeave": onAfterLeave
}, scopeId), {
activator: slots.activator,
default: function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return createVNode(VDefaultsProvider, {
"root": "VDialog"
}, {
default: () => [slots.default?.(...args)]
});
}
});
});
return forwardRefs({}, overlay);
}
});
export {
makeVDialogProps,
VDialog
};
//# sourceMappingURL=chunk-RWSHRKUK.js.map