88 lines
3.3 KiB
JavaScript
88 lines
3.3 KiB
JavaScript
import { Dt as mergeProps, Kn as ref, Ot as nextTick, et as createVNode, gn as watch } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
|
|
import { q as omit, r as genericComponent, u as propsFactory } from "./defineComponent-D5UWd5Vb.js";
|
|
import { n as makeVOverlayProps, t as VOverlay } from "./VOverlay-BntBXXGT.js";
|
|
import { t as useRender } from "./useRender-DB_YiTtB.js";
|
|
import { t as useProxiedModel } from "./proxiedModel-BOZtsMxA.js";
|
|
import { t as VDefaultsProvider } from "./VDefaultsProvider-C3Dl0By9.js";
|
|
import { _ as VDialogTransition } from "./transitions-llwxsiay.js";
|
|
import { t as useScopeId } from "./scopeId-BbFYJclW.js";
|
|
import { t as forwardRefs } from "./forwardRefs-C50LZ3ti.js";
|
|
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VDialog/VDialog.css";
|
|
//#region node_modules/vuetify/lib/components/VDialog/VDialog.js
|
|
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, { emit, slots }) {
|
|
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: (...args) => createVNode(VDefaultsProvider, { "root": "VDialog" }, { default: () => [slots.default?.(...args)] })
|
|
});
|
|
});
|
|
return forwardRefs({}, overlay);
|
|
}
|
|
});
|
|
//#endregion
|
|
export { VDialog };
|
|
|
|
//# sourceMappingURL=vuetify_components_VDialog.js.map
|