1806 lines
53 KiB
JavaScript
1806 lines
53 KiB
JavaScript
import "./chunk-QIPKHCUH.js";
|
|
import {
|
|
useDisplay
|
|
} from "./chunk-ACMZNI3W.js";
|
|
import {
|
|
VuetifyLayoutKey,
|
|
useLayout
|
|
} from "./chunk-CTAMZJJN.js";
|
|
import {
|
|
VDefaultsProvider,
|
|
VProgressLinear,
|
|
genOverlays,
|
|
makeLocationProps,
|
|
makePositionProps,
|
|
makeRoundedProps,
|
|
makeVariantProps,
|
|
useBackButton,
|
|
usePosition,
|
|
useRounded,
|
|
useRouter,
|
|
useVariant
|
|
} from "./chunk-2NYZXKZU.js";
|
|
import {
|
|
makeDimensionProps,
|
|
useDimension
|
|
} from "./chunk-4E7YEL5Q.js";
|
|
import "./chunk-P6FAB7CJ.js";
|
|
import {
|
|
useProxiedModel,
|
|
useRtl,
|
|
useToggleScope
|
|
} from "./chunk-QN4ZFON4.js";
|
|
import {
|
|
useBackgroundColor
|
|
} from "./chunk-NW4NIPSU.js";
|
|
import "./chunk-JH5IUXR2.js";
|
|
import {
|
|
makeThemeProps,
|
|
provideTheme
|
|
} from "./chunk-ILOYNRQG.js";
|
|
import {
|
|
Box,
|
|
CircularBuffer,
|
|
IN_BROWSER,
|
|
animate,
|
|
attachedRoot,
|
|
bindProps,
|
|
clamp,
|
|
consoleError,
|
|
convertToUnit,
|
|
deepEqual,
|
|
defer,
|
|
destructComputed,
|
|
flipAlign,
|
|
flipCorner,
|
|
flipSide,
|
|
genericComponent,
|
|
getAxis,
|
|
getCurrentInstance,
|
|
getElementBox,
|
|
getOverflow,
|
|
getScrollParent,
|
|
getScrollParents,
|
|
getTargetBox,
|
|
hasScrollbar,
|
|
isFixedPosition,
|
|
isObject,
|
|
makeComponentProps,
|
|
matchesSelector,
|
|
nullifyTransforms,
|
|
omit,
|
|
onlyDefinedProps,
|
|
parseAnchor,
|
|
propsFactory,
|
|
refElement,
|
|
standardEasing,
|
|
templateRef,
|
|
unbindProps,
|
|
useRender
|
|
} from "./chunk-ADPJOAU6.js";
|
|
import {
|
|
Fragment,
|
|
Teleport,
|
|
Transition,
|
|
TransitionGroup,
|
|
computed,
|
|
createBaseVNode,
|
|
createVNode,
|
|
effectScope,
|
|
h,
|
|
inject,
|
|
mergeProps,
|
|
nextTick,
|
|
onBeforeUnmount,
|
|
onMounted,
|
|
onScopeDispose,
|
|
provide,
|
|
reactive,
|
|
readonly,
|
|
ref,
|
|
shallowRef,
|
|
toRaw,
|
|
toRef,
|
|
toValue,
|
|
vShow,
|
|
warn,
|
|
watch,
|
|
watchEffect,
|
|
withDirectives
|
|
} from "./chunk-FIAHBV72.js";
|
|
import "./chunk-DC5AMYBS.js";
|
|
|
|
// node_modules/vuetify/lib/components/VSnackbar/VSnackbar.js
|
|
import "/Users/JasonJFraser/Desktop/apps/cmms/frontend/node_modules/vuetify/lib/components/VSnackbar/VSnackbar.css";
|
|
|
|
// node_modules/vuetify/lib/components/VOverlay/VOverlay.js
|
|
import "/Users/JasonJFraser/Desktop/apps/cmms/frontend/node_modules/vuetify/lib/components/VOverlay/VOverlay.css";
|
|
|
|
// node_modules/vuetify/lib/components/VOverlay/util/point.js
|
|
function elementToViewport(point, offset) {
|
|
return {
|
|
x: point.x + offset.x,
|
|
y: point.y + offset.y
|
|
};
|
|
}
|
|
function getOffset(a, b) {
|
|
return {
|
|
x: a.x - b.x,
|
|
y: a.y - b.y
|
|
};
|
|
}
|
|
function anchorToPoint(anchor, box) {
|
|
if (anchor.side === "top" || anchor.side === "bottom") {
|
|
const {
|
|
side,
|
|
align
|
|
} = anchor;
|
|
const x = align === "left" ? 0 : align === "center" ? box.width / 2 : align === "right" ? box.width : align;
|
|
const y = side === "top" ? 0 : side === "bottom" ? box.height : side;
|
|
return elementToViewport({
|
|
x,
|
|
y
|
|
}, box);
|
|
} else if (anchor.side === "left" || anchor.side === "right") {
|
|
const {
|
|
side,
|
|
align
|
|
} = anchor;
|
|
const x = side === "left" ? 0 : side === "right" ? box.width : side;
|
|
const y = align === "top" ? 0 : align === "center" ? box.height / 2 : align === "bottom" ? box.height : align;
|
|
return elementToViewport({
|
|
x,
|
|
y
|
|
}, box);
|
|
}
|
|
return elementToViewport({
|
|
x: box.width / 2,
|
|
y: box.height / 2
|
|
}, box);
|
|
}
|
|
|
|
// node_modules/vuetify/lib/components/VOverlay/locationStrategies.js
|
|
var locationStrategies = {
|
|
static: staticLocationStrategy,
|
|
// specific viewport position, usually centered
|
|
connected: connectedLocationStrategy
|
|
// connected to a certain element
|
|
};
|
|
var makeLocationStrategyProps = propsFactory({
|
|
locationStrategy: {
|
|
type: [String, Function],
|
|
default: "static",
|
|
validator: (val) => typeof val === "function" || val in locationStrategies
|
|
},
|
|
location: {
|
|
type: String,
|
|
default: "bottom"
|
|
},
|
|
origin: {
|
|
type: String,
|
|
default: "auto"
|
|
},
|
|
offset: [Number, String, Array]
|
|
}, "VOverlay-location-strategies");
|
|
function useLocationStrategies(props, data) {
|
|
const contentStyles = ref({});
|
|
const updateLocation = ref();
|
|
if (IN_BROWSER) {
|
|
useToggleScope(() => !!(data.isActive.value && props.locationStrategy), (reset) => {
|
|
var _a, _b;
|
|
watch(() => props.locationStrategy, reset);
|
|
onScopeDispose(() => {
|
|
window.removeEventListener("resize", onResize);
|
|
visualViewport == null ? void 0 : visualViewport.removeEventListener("resize", onVisualResize);
|
|
visualViewport == null ? void 0 : visualViewport.removeEventListener("scroll", onVisualScroll);
|
|
updateLocation.value = void 0;
|
|
});
|
|
window.addEventListener("resize", onResize, {
|
|
passive: true
|
|
});
|
|
visualViewport == null ? void 0 : visualViewport.addEventListener("resize", onVisualResize, {
|
|
passive: true
|
|
});
|
|
visualViewport == null ? void 0 : visualViewport.addEventListener("scroll", onVisualScroll, {
|
|
passive: true
|
|
});
|
|
if (typeof props.locationStrategy === "function") {
|
|
updateLocation.value = (_a = props.locationStrategy(data, props, contentStyles)) == null ? void 0 : _a.updateLocation;
|
|
} else {
|
|
updateLocation.value = (_b = locationStrategies[props.locationStrategy](data, props, contentStyles)) == null ? void 0 : _b.updateLocation;
|
|
}
|
|
});
|
|
}
|
|
function onResize(e) {
|
|
var _a;
|
|
(_a = updateLocation.value) == null ? void 0 : _a.call(updateLocation, e);
|
|
}
|
|
function onVisualResize(e) {
|
|
var _a;
|
|
(_a = updateLocation.value) == null ? void 0 : _a.call(updateLocation, e);
|
|
}
|
|
function onVisualScroll(e) {
|
|
var _a;
|
|
(_a = updateLocation.value) == null ? void 0 : _a.call(updateLocation, e);
|
|
}
|
|
return {
|
|
contentStyles,
|
|
updateLocation
|
|
};
|
|
}
|
|
function staticLocationStrategy() {
|
|
}
|
|
function getIntrinsicSize(el, isRtl) {
|
|
const contentBox = nullifyTransforms(el);
|
|
if (isRtl) {
|
|
contentBox.x += parseFloat(el.style.right || 0);
|
|
} else {
|
|
contentBox.x -= parseFloat(el.style.left || 0);
|
|
}
|
|
contentBox.y -= parseFloat(el.style.top || 0);
|
|
return contentBox;
|
|
}
|
|
function connectedLocationStrategy(data, props, contentStyles) {
|
|
const activatorFixed = Array.isArray(data.target.value) || isFixedPosition(data.target.value);
|
|
if (activatorFixed) {
|
|
Object.assign(contentStyles.value, {
|
|
position: "fixed",
|
|
top: 0,
|
|
[data.isRtl.value ? "right" : "left"]: 0
|
|
});
|
|
}
|
|
const {
|
|
preferredAnchor,
|
|
preferredOrigin
|
|
} = destructComputed(() => {
|
|
const parsedAnchor = parseAnchor(props.location, data.isRtl.value);
|
|
const parsedOrigin = props.origin === "overlap" ? parsedAnchor : props.origin === "auto" ? flipSide(parsedAnchor) : parseAnchor(props.origin, data.isRtl.value);
|
|
if (parsedAnchor.side === parsedOrigin.side && parsedAnchor.align === flipAlign(parsedOrigin).align) {
|
|
return {
|
|
preferredAnchor: flipCorner(parsedAnchor),
|
|
preferredOrigin: flipCorner(parsedOrigin)
|
|
};
|
|
} else {
|
|
return {
|
|
preferredAnchor: parsedAnchor,
|
|
preferredOrigin: parsedOrigin
|
|
};
|
|
}
|
|
});
|
|
const [minWidth, minHeight, maxWidth, maxHeight] = ["minWidth", "minHeight", "maxWidth", "maxHeight"].map((key) => {
|
|
return computed(() => {
|
|
const val = parseFloat(props[key]);
|
|
return isNaN(val) ? Infinity : val;
|
|
});
|
|
});
|
|
const offset = computed(() => {
|
|
if (Array.isArray(props.offset)) {
|
|
return props.offset;
|
|
}
|
|
if (typeof props.offset === "string") {
|
|
const offset2 = props.offset.split(" ").map(parseFloat);
|
|
if (offset2.length < 2) offset2.push(0);
|
|
return offset2;
|
|
}
|
|
return typeof props.offset === "number" ? [props.offset, 0] : [0, 0];
|
|
});
|
|
let observe = false;
|
|
let lastFrame = -1;
|
|
const flipped = new CircularBuffer(4);
|
|
const observer = new ResizeObserver(() => {
|
|
if (!observe) return;
|
|
requestAnimationFrame((newTime) => {
|
|
if (newTime !== lastFrame) flipped.clear();
|
|
requestAnimationFrame((newNewTime) => {
|
|
lastFrame = newNewTime;
|
|
});
|
|
});
|
|
if (flipped.isFull) {
|
|
const values = flipped.values();
|
|
if (deepEqual(values.at(-1), values.at(-3)) && !deepEqual(values.at(-1), values.at(-2))) {
|
|
return;
|
|
}
|
|
}
|
|
const result = updateLocation();
|
|
if (result) flipped.push(result.flipped);
|
|
});
|
|
let targetBox = new Box({
|
|
x: 0,
|
|
y: 0,
|
|
width: 0,
|
|
height: 0
|
|
});
|
|
watch(data.target, (newTarget, oldTarget) => {
|
|
if (oldTarget && !Array.isArray(oldTarget)) observer.unobserve(oldTarget);
|
|
if (!Array.isArray(newTarget)) {
|
|
if (newTarget) observer.observe(newTarget);
|
|
} else if (!deepEqual(newTarget, oldTarget)) {
|
|
updateLocation();
|
|
}
|
|
}, {
|
|
immediate: true
|
|
});
|
|
watch(data.contentEl, (newContentEl, oldContentEl) => {
|
|
if (oldContentEl) observer.unobserve(oldContentEl);
|
|
if (newContentEl) observer.observe(newContentEl);
|
|
}, {
|
|
immediate: true
|
|
});
|
|
onScopeDispose(() => {
|
|
observer.disconnect();
|
|
});
|
|
function updateLocation() {
|
|
observe = false;
|
|
requestAnimationFrame(() => observe = true);
|
|
if (!data.target.value || !data.contentEl.value) return;
|
|
if (Array.isArray(data.target.value) || data.target.value.offsetParent || data.target.value.getClientRects().length) {
|
|
targetBox = getTargetBox(data.target.value);
|
|
}
|
|
const contentBox = getIntrinsicSize(data.contentEl.value, data.isRtl.value);
|
|
const scrollParents = getScrollParents(data.contentEl.value);
|
|
const viewportMargin = 12;
|
|
if (!scrollParents.length) {
|
|
scrollParents.push(document.documentElement);
|
|
if (!(data.contentEl.value.style.top && data.contentEl.value.style.left)) {
|
|
contentBox.x -= parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-x") || 0);
|
|
contentBox.y -= parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-y") || 0);
|
|
}
|
|
}
|
|
const viewport = scrollParents.reduce((box, el) => {
|
|
const scrollBox = getElementBox(el);
|
|
if (box) {
|
|
return new Box({
|
|
x: Math.max(box.left, scrollBox.left),
|
|
y: Math.max(box.top, scrollBox.top),
|
|
width: Math.min(box.right, scrollBox.right) - Math.max(box.left, scrollBox.left),
|
|
height: Math.min(box.bottom, scrollBox.bottom) - Math.max(box.top, scrollBox.top)
|
|
});
|
|
}
|
|
return scrollBox;
|
|
}, void 0);
|
|
viewport.x += viewportMargin;
|
|
viewport.y += viewportMargin;
|
|
viewport.width -= viewportMargin * 2;
|
|
viewport.height -= viewportMargin * 2;
|
|
let placement = {
|
|
anchor: preferredAnchor.value,
|
|
origin: preferredOrigin.value
|
|
};
|
|
function checkOverflow(_placement) {
|
|
const box = new Box(contentBox);
|
|
const targetPoint = anchorToPoint(_placement.anchor, targetBox);
|
|
const contentPoint = anchorToPoint(_placement.origin, box);
|
|
let {
|
|
x: x2,
|
|
y: y2
|
|
} = getOffset(targetPoint, contentPoint);
|
|
switch (_placement.anchor.side) {
|
|
case "top":
|
|
y2 -= offset.value[0];
|
|
break;
|
|
case "bottom":
|
|
y2 += offset.value[0];
|
|
break;
|
|
case "left":
|
|
x2 -= offset.value[0];
|
|
break;
|
|
case "right":
|
|
x2 += offset.value[0];
|
|
break;
|
|
}
|
|
switch (_placement.anchor.align) {
|
|
case "top":
|
|
y2 -= offset.value[1];
|
|
break;
|
|
case "bottom":
|
|
y2 += offset.value[1];
|
|
break;
|
|
case "left":
|
|
x2 -= offset.value[1];
|
|
break;
|
|
case "right":
|
|
x2 += offset.value[1];
|
|
break;
|
|
}
|
|
box.x += x2;
|
|
box.y += y2;
|
|
box.width = Math.min(box.width, maxWidth.value);
|
|
box.height = Math.min(box.height, maxHeight.value);
|
|
const overflows = getOverflow(box, viewport);
|
|
return {
|
|
overflows,
|
|
x: x2,
|
|
y: y2
|
|
};
|
|
}
|
|
let x = 0;
|
|
let y = 0;
|
|
const available = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
const flipped2 = {
|
|
x: false,
|
|
y: false
|
|
};
|
|
let resets = -1;
|
|
while (true) {
|
|
if (resets++ > 10) {
|
|
consoleError("Infinite loop detected in connectedLocationStrategy");
|
|
break;
|
|
}
|
|
const {
|
|
x: _x,
|
|
y: _y,
|
|
overflows
|
|
} = checkOverflow(placement);
|
|
x += _x;
|
|
y += _y;
|
|
contentBox.x += _x;
|
|
contentBox.y += _y;
|
|
{
|
|
const axis2 = getAxis(placement.anchor);
|
|
const hasOverflowX = overflows.x.before || overflows.x.after;
|
|
const hasOverflowY = overflows.y.before || overflows.y.after;
|
|
let reset = false;
|
|
["x", "y"].forEach((key) => {
|
|
if (key === "x" && hasOverflowX && !flipped2.x || key === "y" && hasOverflowY && !flipped2.y) {
|
|
const newPlacement = {
|
|
anchor: {
|
|
...placement.anchor
|
|
},
|
|
origin: {
|
|
...placement.origin
|
|
}
|
|
};
|
|
const flip = key === "x" ? axis2 === "y" ? flipAlign : flipSide : axis2 === "y" ? flipSide : flipAlign;
|
|
newPlacement.anchor = flip(newPlacement.anchor);
|
|
newPlacement.origin = flip(newPlacement.origin);
|
|
const {
|
|
overflows: newOverflows
|
|
} = checkOverflow(newPlacement);
|
|
if (newOverflows[key].before <= overflows[key].before && newOverflows[key].after <= overflows[key].after || newOverflows[key].before + newOverflows[key].after < (overflows[key].before + overflows[key].after) / 2) {
|
|
placement = newPlacement;
|
|
reset = flipped2[key] = true;
|
|
}
|
|
}
|
|
});
|
|
if (reset) continue;
|
|
}
|
|
if (overflows.x.before) {
|
|
x += overflows.x.before;
|
|
contentBox.x += overflows.x.before;
|
|
}
|
|
if (overflows.x.after) {
|
|
x -= overflows.x.after;
|
|
contentBox.x -= overflows.x.after;
|
|
}
|
|
if (overflows.y.before) {
|
|
y += overflows.y.before;
|
|
contentBox.y += overflows.y.before;
|
|
}
|
|
if (overflows.y.after) {
|
|
y -= overflows.y.after;
|
|
contentBox.y -= overflows.y.after;
|
|
}
|
|
{
|
|
const overflows2 = getOverflow(contentBox, viewport);
|
|
available.x = viewport.width - overflows2.x.before - overflows2.x.after;
|
|
available.y = viewport.height - overflows2.y.before - overflows2.y.after;
|
|
x += overflows2.x.before;
|
|
contentBox.x += overflows2.x.before;
|
|
y += overflows2.y.before;
|
|
contentBox.y += overflows2.y.before;
|
|
}
|
|
break;
|
|
}
|
|
const axis = getAxis(placement.anchor);
|
|
Object.assign(contentStyles.value, {
|
|
"--v-overlay-anchor-origin": `${placement.anchor.side} ${placement.anchor.align}`,
|
|
transformOrigin: `${placement.origin.side} ${placement.origin.align}`,
|
|
// transform: `translate(${pixelRound(x)}px, ${pixelRound(y)}px)`,
|
|
top: convertToUnit(pixelRound(y)),
|
|
left: data.isRtl.value ? void 0 : convertToUnit(pixelRound(x)),
|
|
right: data.isRtl.value ? convertToUnit(pixelRound(-x)) : void 0,
|
|
minWidth: convertToUnit(axis === "y" ? Math.min(minWidth.value, targetBox.width) : minWidth.value),
|
|
maxWidth: convertToUnit(pixelCeil(clamp(available.x, minWidth.value === Infinity ? 0 : minWidth.value, maxWidth.value))),
|
|
maxHeight: convertToUnit(pixelCeil(clamp(available.y, minHeight.value === Infinity ? 0 : minHeight.value, maxHeight.value)))
|
|
});
|
|
return {
|
|
available,
|
|
contentBox,
|
|
flipped: flipped2
|
|
};
|
|
}
|
|
watch(() => [preferredAnchor.value, preferredOrigin.value, props.offset, props.minWidth, props.minHeight, props.maxWidth, props.maxHeight], () => updateLocation());
|
|
nextTick(() => {
|
|
const result = updateLocation();
|
|
if (!result) return;
|
|
const {
|
|
available,
|
|
contentBox
|
|
} = result;
|
|
if (contentBox.height > available.y) {
|
|
requestAnimationFrame(() => {
|
|
updateLocation();
|
|
requestAnimationFrame(() => {
|
|
updateLocation();
|
|
});
|
|
});
|
|
}
|
|
});
|
|
return {
|
|
updateLocation
|
|
};
|
|
}
|
|
function pixelRound(val) {
|
|
return Math.round(val * devicePixelRatio) / devicePixelRatio;
|
|
}
|
|
function pixelCeil(val) {
|
|
return Math.ceil(val * devicePixelRatio) / devicePixelRatio;
|
|
}
|
|
|
|
// node_modules/vuetify/lib/components/VOverlay/requestNewFrame.js
|
|
var clean = true;
|
|
var frames = [];
|
|
function requestNewFrame(cb) {
|
|
if (!clean || frames.length) {
|
|
frames.push(cb);
|
|
run();
|
|
} else {
|
|
clean = false;
|
|
cb();
|
|
run();
|
|
}
|
|
}
|
|
var raf = -1;
|
|
function run() {
|
|
cancelAnimationFrame(raf);
|
|
raf = requestAnimationFrame(() => {
|
|
const frame = frames.shift();
|
|
if (frame) frame();
|
|
if (frames.length) run();
|
|
else clean = true;
|
|
});
|
|
}
|
|
|
|
// node_modules/vuetify/lib/components/VOverlay/scrollStrategies.js
|
|
var scrollStrategies = {
|
|
none: null,
|
|
close: closeScrollStrategy,
|
|
block: blockScrollStrategy,
|
|
reposition: repositionScrollStrategy
|
|
};
|
|
var makeScrollStrategyProps = propsFactory({
|
|
scrollStrategy: {
|
|
type: [String, Function],
|
|
default: "block",
|
|
validator: (val) => typeof val === "function" || val in scrollStrategies
|
|
}
|
|
}, "VOverlay-scroll-strategies");
|
|
function useScrollStrategies(props, data) {
|
|
if (!IN_BROWSER) return;
|
|
let scope;
|
|
watchEffect(async () => {
|
|
scope == null ? void 0 : scope.stop();
|
|
if (!(data.isActive.value && props.scrollStrategy)) return;
|
|
scope = effectScope();
|
|
await new Promise((resolve) => setTimeout(resolve));
|
|
scope.active && scope.run(() => {
|
|
var _a;
|
|
if (typeof props.scrollStrategy === "function") {
|
|
props.scrollStrategy(data, props, scope);
|
|
} else {
|
|
(_a = scrollStrategies[props.scrollStrategy]) == null ? void 0 : _a.call(scrollStrategies, data, props, scope);
|
|
}
|
|
});
|
|
});
|
|
onScopeDispose(() => {
|
|
scope == null ? void 0 : scope.stop();
|
|
});
|
|
}
|
|
function closeScrollStrategy(data) {
|
|
function onScroll(e) {
|
|
data.isActive.value = false;
|
|
}
|
|
bindScroll(data.target.value ?? data.contentEl.value, onScroll);
|
|
}
|
|
function blockScrollStrategy(data, props) {
|
|
var _a;
|
|
const offsetParent = (_a = data.root.value) == null ? void 0 : _a.offsetParent;
|
|
const target = Array.isArray(data.target.value) ? document.elementFromPoint(...data.target.value) : data.target.value;
|
|
const scrollElements = [.../* @__PURE__ */ new Set([...getScrollParents(target, props.contained ? offsetParent : void 0), ...getScrollParents(data.contentEl.value, props.contained ? offsetParent : void 0)])].filter((el) => !el.classList.contains("v-overlay-scroll-blocked"));
|
|
const scrollbarWidth = window.innerWidth - document.documentElement.offsetWidth;
|
|
const scrollableParent = ((el) => hasScrollbar(el) && el)(offsetParent || document.documentElement);
|
|
if (scrollableParent) {
|
|
data.root.value.classList.add("v-overlay--scroll-blocked");
|
|
}
|
|
scrollElements.forEach((el, i) => {
|
|
el.style.setProperty("--v-body-scroll-x", convertToUnit(-el.scrollLeft));
|
|
el.style.setProperty("--v-body-scroll-y", convertToUnit(-el.scrollTop));
|
|
if (el !== document.documentElement) {
|
|
el.style.setProperty("--v-scrollbar-offset", convertToUnit(scrollbarWidth));
|
|
}
|
|
el.classList.add("v-overlay-scroll-blocked");
|
|
});
|
|
onScopeDispose(() => {
|
|
scrollElements.forEach((el, i) => {
|
|
const x = parseFloat(el.style.getPropertyValue("--v-body-scroll-x"));
|
|
const y = parseFloat(el.style.getPropertyValue("--v-body-scroll-y"));
|
|
const scrollBehavior = el.style.scrollBehavior;
|
|
el.style.scrollBehavior = "auto";
|
|
el.style.removeProperty("--v-body-scroll-x");
|
|
el.style.removeProperty("--v-body-scroll-y");
|
|
el.style.removeProperty("--v-scrollbar-offset");
|
|
el.classList.remove("v-overlay-scroll-blocked");
|
|
el.scrollLeft = -x;
|
|
el.scrollTop = -y;
|
|
el.style.scrollBehavior = scrollBehavior;
|
|
});
|
|
if (scrollableParent) {
|
|
data.root.value.classList.remove("v-overlay--scroll-blocked");
|
|
}
|
|
});
|
|
}
|
|
function repositionScrollStrategy(data, props, scope) {
|
|
let slow = false;
|
|
let raf2 = -1;
|
|
let ric = -1;
|
|
function update(e) {
|
|
requestNewFrame(() => {
|
|
var _a, _b;
|
|
const start = performance.now();
|
|
(_b = (_a = data.updateLocation).value) == null ? void 0 : _b.call(_a, e);
|
|
const time = performance.now() - start;
|
|
slow = time / (1e3 / 60) > 2;
|
|
});
|
|
}
|
|
ric = (typeof requestIdleCallback === "undefined" ? (cb) => cb() : requestIdleCallback)(() => {
|
|
scope.run(() => {
|
|
bindScroll(data.target.value ?? data.contentEl.value, (e) => {
|
|
if (slow) {
|
|
cancelAnimationFrame(raf2);
|
|
raf2 = requestAnimationFrame(() => {
|
|
raf2 = requestAnimationFrame(() => {
|
|
update(e);
|
|
});
|
|
});
|
|
} else {
|
|
update(e);
|
|
}
|
|
});
|
|
});
|
|
});
|
|
onScopeDispose(() => {
|
|
typeof cancelIdleCallback !== "undefined" && cancelIdleCallback(ric);
|
|
cancelAnimationFrame(raf2);
|
|
});
|
|
}
|
|
function bindScroll(target, onScroll) {
|
|
const el = Array.isArray(target) ? document.elementFromPoint(...target) : target;
|
|
const scrollElements = [document, ...getScrollParents(el)];
|
|
scrollElements.forEach((el2) => {
|
|
el2.addEventListener("scroll", onScroll, {
|
|
passive: true
|
|
});
|
|
});
|
|
onScopeDispose(() => {
|
|
scrollElements.forEach((el2) => {
|
|
el2.removeEventListener("scroll", onScroll);
|
|
});
|
|
});
|
|
}
|
|
|
|
// node_modules/vuetify/lib/components/VMenu/shared.js
|
|
var VMenuSymbol = Symbol.for("vuetify:v-menu");
|
|
|
|
// node_modules/vuetify/lib/composables/delay.js
|
|
var makeDelayProps = propsFactory({
|
|
closeDelay: [Number, String],
|
|
openDelay: [Number, String]
|
|
}, "delay");
|
|
function useDelay(props, cb) {
|
|
let clearDelay = () => {
|
|
};
|
|
function runDelay(isOpening) {
|
|
clearDelay == null ? void 0 : clearDelay();
|
|
const delay = Number(isOpening ? props.openDelay : props.closeDelay);
|
|
return new Promise((resolve) => {
|
|
clearDelay = defer(delay, () => {
|
|
cb == null ? void 0 : cb(isOpening);
|
|
resolve(isOpening);
|
|
});
|
|
});
|
|
}
|
|
function runOpenDelay() {
|
|
return runDelay(true);
|
|
}
|
|
function runCloseDelay() {
|
|
return runDelay(false);
|
|
}
|
|
return {
|
|
clearDelay,
|
|
runOpenDelay,
|
|
runCloseDelay
|
|
};
|
|
}
|
|
|
|
// node_modules/vuetify/lib/components/VOverlay/useActivator.js
|
|
var makeActivatorProps = propsFactory({
|
|
target: [String, Object],
|
|
activator: [String, Object],
|
|
activatorProps: {
|
|
type: Object,
|
|
default: () => ({})
|
|
},
|
|
openOnClick: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
openOnHover: Boolean,
|
|
openOnFocus: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
closeOnContentClick: Boolean,
|
|
...makeDelayProps()
|
|
}, "VOverlay-activator");
|
|
function useActivator(props, _ref) {
|
|
let {
|
|
isActive,
|
|
isTop,
|
|
contentEl
|
|
} = _ref;
|
|
const vm = getCurrentInstance("useActivator");
|
|
const activatorEl = ref();
|
|
let isHovered = false;
|
|
let isFocused = false;
|
|
let firstEnter = true;
|
|
const openOnFocus = computed(() => props.openOnFocus || props.openOnFocus == null && props.openOnHover);
|
|
const openOnClick = computed(() => props.openOnClick || props.openOnClick == null && !props.openOnHover && !openOnFocus.value);
|
|
const {
|
|
runOpenDelay,
|
|
runCloseDelay
|
|
} = useDelay(props, (value) => {
|
|
if (value === (props.openOnHover && isHovered || openOnFocus.value && isFocused) && !(props.openOnHover && isActive.value && !isTop.value)) {
|
|
if (isActive.value !== value) {
|
|
firstEnter = true;
|
|
}
|
|
isActive.value = value;
|
|
}
|
|
});
|
|
const cursorTarget = ref();
|
|
const availableEvents = {
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
activatorEl.value = e.currentTarget || e.target;
|
|
if (!isActive.value) {
|
|
cursorTarget.value = [e.clientX, e.clientY];
|
|
}
|
|
isActive.value = !isActive.value;
|
|
},
|
|
onMouseenter: (e) => {
|
|
var _a;
|
|
if ((_a = e.sourceCapabilities) == null ? void 0 : _a.firesTouchEvents) return;
|
|
isHovered = true;
|
|
activatorEl.value = e.currentTarget || e.target;
|
|
runOpenDelay();
|
|
},
|
|
onMouseleave: (e) => {
|
|
isHovered = false;
|
|
runCloseDelay();
|
|
},
|
|
onFocus: (e) => {
|
|
if (matchesSelector(e.target, ":focus-visible") === false) return;
|
|
isFocused = true;
|
|
e.stopPropagation();
|
|
activatorEl.value = e.currentTarget || e.target;
|
|
runOpenDelay();
|
|
},
|
|
onBlur: (e) => {
|
|
isFocused = false;
|
|
e.stopPropagation();
|
|
runCloseDelay();
|
|
}
|
|
};
|
|
const activatorEvents = computed(() => {
|
|
const events = {};
|
|
if (openOnClick.value) {
|
|
events.onClick = availableEvents.onClick;
|
|
}
|
|
if (props.openOnHover) {
|
|
events.onMouseenter = availableEvents.onMouseenter;
|
|
events.onMouseleave = availableEvents.onMouseleave;
|
|
}
|
|
if (openOnFocus.value) {
|
|
events.onFocus = availableEvents.onFocus;
|
|
events.onBlur = availableEvents.onBlur;
|
|
}
|
|
return events;
|
|
});
|
|
const contentEvents = computed(() => {
|
|
const events = {};
|
|
if (props.openOnHover) {
|
|
events.onMouseenter = () => {
|
|
isHovered = true;
|
|
runOpenDelay();
|
|
};
|
|
events.onMouseleave = () => {
|
|
isHovered = false;
|
|
runCloseDelay();
|
|
};
|
|
}
|
|
if (openOnFocus.value) {
|
|
events.onFocusin = () => {
|
|
isFocused = true;
|
|
runOpenDelay();
|
|
};
|
|
events.onFocusout = () => {
|
|
isFocused = false;
|
|
runCloseDelay();
|
|
};
|
|
}
|
|
if (props.closeOnContentClick) {
|
|
const menu = inject(VMenuSymbol, null);
|
|
events.onClick = () => {
|
|
isActive.value = false;
|
|
menu == null ? void 0 : menu.closeParents();
|
|
};
|
|
}
|
|
return events;
|
|
});
|
|
const scrimEvents = computed(() => {
|
|
const events = {};
|
|
if (props.openOnHover) {
|
|
events.onMouseenter = () => {
|
|
if (firstEnter) {
|
|
isHovered = true;
|
|
firstEnter = false;
|
|
runOpenDelay();
|
|
}
|
|
};
|
|
events.onMouseleave = () => {
|
|
isHovered = false;
|
|
runCloseDelay();
|
|
};
|
|
}
|
|
return events;
|
|
});
|
|
watch(isTop, (val) => {
|
|
var _a;
|
|
if (val && (props.openOnHover && !isHovered && (!openOnFocus.value || !isFocused) || openOnFocus.value && !isFocused && (!props.openOnHover || !isHovered)) && !((_a = contentEl.value) == null ? void 0 : _a.contains(document.activeElement))) {
|
|
isActive.value = false;
|
|
}
|
|
});
|
|
watch(isActive, (val) => {
|
|
if (!val) {
|
|
setTimeout(() => {
|
|
cursorTarget.value = void 0;
|
|
});
|
|
}
|
|
}, {
|
|
flush: "post"
|
|
});
|
|
const activatorRef = templateRef();
|
|
watchEffect(() => {
|
|
if (!activatorRef.value) return;
|
|
nextTick(() => {
|
|
activatorEl.value = activatorRef.el;
|
|
});
|
|
});
|
|
const targetRef = templateRef();
|
|
const target = computed(() => {
|
|
if (props.target === "cursor" && cursorTarget.value) return cursorTarget.value;
|
|
if (targetRef.value) return targetRef.el;
|
|
return getTarget(props.target, vm) || activatorEl.value;
|
|
});
|
|
const targetEl = computed(() => {
|
|
return Array.isArray(target.value) ? void 0 : target.value;
|
|
});
|
|
let scope;
|
|
watch(() => !!props.activator, (val) => {
|
|
if (val && IN_BROWSER) {
|
|
scope = effectScope();
|
|
scope.run(() => {
|
|
_useActivator(props, vm, {
|
|
activatorEl,
|
|
activatorEvents
|
|
});
|
|
});
|
|
} else if (scope) {
|
|
scope.stop();
|
|
}
|
|
}, {
|
|
flush: "post",
|
|
immediate: true
|
|
});
|
|
onScopeDispose(() => {
|
|
scope == null ? void 0 : scope.stop();
|
|
});
|
|
return {
|
|
activatorEl,
|
|
activatorRef,
|
|
target,
|
|
targetEl,
|
|
targetRef,
|
|
activatorEvents,
|
|
contentEvents,
|
|
scrimEvents
|
|
};
|
|
}
|
|
function _useActivator(props, vm, _ref2) {
|
|
let {
|
|
activatorEl,
|
|
activatorEvents
|
|
} = _ref2;
|
|
watch(() => props.activator, (val, oldVal) => {
|
|
if (oldVal && val !== oldVal) {
|
|
const activator = getActivator(oldVal);
|
|
activator && unbindActivatorProps(activator);
|
|
}
|
|
if (val) {
|
|
nextTick(() => bindActivatorProps());
|
|
}
|
|
}, {
|
|
immediate: true
|
|
});
|
|
watch(() => props.activatorProps, () => {
|
|
bindActivatorProps();
|
|
});
|
|
onScopeDispose(() => {
|
|
unbindActivatorProps();
|
|
});
|
|
function bindActivatorProps() {
|
|
let el = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getActivator();
|
|
let _props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : props.activatorProps;
|
|
if (!el) return;
|
|
bindProps(el, mergeProps(activatorEvents.value, _props));
|
|
}
|
|
function unbindActivatorProps() {
|
|
let el = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getActivator();
|
|
let _props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : props.activatorProps;
|
|
if (!el) return;
|
|
unbindProps(el, mergeProps(activatorEvents.value, _props));
|
|
}
|
|
function getActivator() {
|
|
let selector = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : props.activator;
|
|
const activator = getTarget(selector, vm);
|
|
activatorEl.value = (activator == null ? void 0 : activator.nodeType) === Node.ELEMENT_NODE ? activator : void 0;
|
|
return activatorEl.value;
|
|
}
|
|
}
|
|
function getTarget(selector, vm) {
|
|
var _a, _b;
|
|
if (!selector) return;
|
|
let target;
|
|
if (selector === "parent") {
|
|
let el = (_b = (_a = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a.$el) == null ? void 0 : _b.parentNode;
|
|
while (el == null ? void 0 : el.hasAttribute("data-no-activator")) {
|
|
el = el.parentNode;
|
|
}
|
|
target = el;
|
|
} else if (typeof selector === "string") {
|
|
target = document.querySelector(selector);
|
|
} else if ("$el" in selector) {
|
|
target = selector.$el;
|
|
} else {
|
|
target = selector;
|
|
}
|
|
return target;
|
|
}
|
|
|
|
// node_modules/vuetify/lib/composables/hydration.js
|
|
function useHydration() {
|
|
if (!IN_BROWSER) return shallowRef(false);
|
|
const {
|
|
ssr
|
|
} = useDisplay();
|
|
if (ssr) {
|
|
const isMounted = shallowRef(false);
|
|
onMounted(() => {
|
|
isMounted.value = true;
|
|
});
|
|
return isMounted;
|
|
} else {
|
|
return shallowRef(true);
|
|
}
|
|
}
|
|
|
|
// node_modules/vuetify/lib/composables/lazy.js
|
|
var makeLazyProps = propsFactory({
|
|
eager: Boolean
|
|
}, "lazy");
|
|
function useLazy(props, active) {
|
|
const isBooted = shallowRef(false);
|
|
const hasContent = toRef(() => isBooted.value || props.eager || active.value);
|
|
watch(active, () => isBooted.value = true);
|
|
function onAfterLeave() {
|
|
if (!props.eager) isBooted.value = false;
|
|
}
|
|
return {
|
|
isBooted,
|
|
hasContent,
|
|
onAfterLeave
|
|
};
|
|
}
|
|
|
|
// node_modules/vuetify/lib/composables/scopeId.js
|
|
function useScopeId() {
|
|
const vm = getCurrentInstance("useScopeId");
|
|
const scopeId = vm.vnode.scopeId;
|
|
return {
|
|
scopeId: scopeId ? {
|
|
[scopeId]: ""
|
|
} : void 0
|
|
};
|
|
}
|
|
|
|
// node_modules/vuetify/lib/composables/stack.js
|
|
var StackSymbol = Symbol.for("vuetify:stack");
|
|
var globalStack = reactive([]);
|
|
function useStack(isActive, zIndex, disableGlobalStack) {
|
|
const vm = getCurrentInstance("useStack");
|
|
const createStackEntry = !disableGlobalStack;
|
|
const parent = inject(StackSymbol, void 0);
|
|
const stack = reactive({
|
|
activeChildren: /* @__PURE__ */ new Set()
|
|
});
|
|
provide(StackSymbol, stack);
|
|
const _zIndex = shallowRef(Number(toValue(zIndex)));
|
|
useToggleScope(isActive, () => {
|
|
var _a;
|
|
const lastZIndex = (_a = globalStack.at(-1)) == null ? void 0 : _a[1];
|
|
_zIndex.value = lastZIndex ? lastZIndex + 10 : Number(toValue(zIndex));
|
|
if (createStackEntry) {
|
|
globalStack.push([vm.uid, _zIndex.value]);
|
|
}
|
|
parent == null ? void 0 : parent.activeChildren.add(vm.uid);
|
|
onScopeDispose(() => {
|
|
if (createStackEntry) {
|
|
const idx = toRaw(globalStack).findIndex((v) => v[0] === vm.uid);
|
|
globalStack.splice(idx, 1);
|
|
}
|
|
parent == null ? void 0 : parent.activeChildren.delete(vm.uid);
|
|
});
|
|
});
|
|
const globalTop = shallowRef(true);
|
|
if (createStackEntry) {
|
|
watchEffect(() => {
|
|
var _a;
|
|
const _isTop = ((_a = globalStack.at(-1)) == null ? void 0 : _a[0]) === vm.uid;
|
|
setTimeout(() => globalTop.value = _isTop);
|
|
});
|
|
}
|
|
const localTop = toRef(() => !stack.activeChildren.size);
|
|
return {
|
|
globalTop: readonly(globalTop),
|
|
localTop,
|
|
stackStyles: toRef(() => ({
|
|
zIndex: _zIndex.value
|
|
}))
|
|
};
|
|
}
|
|
|
|
// node_modules/vuetify/lib/composables/teleport.js
|
|
function useTeleport(target) {
|
|
const teleportTarget = computed(() => {
|
|
const _target = target();
|
|
if (_target === true || !IN_BROWSER) return void 0;
|
|
const targetElement = _target === false ? document.body : typeof _target === "string" ? document.querySelector(_target) : _target;
|
|
if (targetElement == null) {
|
|
warn(`Unable to locate target ${_target}`);
|
|
return void 0;
|
|
}
|
|
let container = [...targetElement.children].find((el) => el.matches(".v-overlay-container"));
|
|
if (!container) {
|
|
container = document.createElement("div");
|
|
container.className = "v-overlay-container";
|
|
targetElement.appendChild(container);
|
|
}
|
|
return container;
|
|
});
|
|
return {
|
|
teleportTarget
|
|
};
|
|
}
|
|
|
|
// node_modules/vuetify/lib/composables/transition.js
|
|
var makeTransitionProps = propsFactory({
|
|
transition: {
|
|
type: null,
|
|
default: "fade-transition",
|
|
validator: (val) => val !== true
|
|
}
|
|
}, "transition");
|
|
var MaybeTransition = (props, _ref) => {
|
|
let {
|
|
slots
|
|
} = _ref;
|
|
const {
|
|
transition,
|
|
disabled,
|
|
group,
|
|
...rest
|
|
} = props;
|
|
const {
|
|
component = group ? TransitionGroup : Transition,
|
|
...customProps
|
|
} = isObject(transition) ? transition : {};
|
|
let transitionProps;
|
|
if (isObject(transition)) {
|
|
transitionProps = mergeProps(customProps, onlyDefinedProps({
|
|
disabled,
|
|
group
|
|
}), rest);
|
|
} else {
|
|
transitionProps = mergeProps({
|
|
name: disabled || !transition ? "" : transition
|
|
}, rest);
|
|
}
|
|
return h(component, transitionProps, slots);
|
|
};
|
|
|
|
// node_modules/vuetify/lib/directives/click-outside/index.js
|
|
function defaultConditional() {
|
|
return true;
|
|
}
|
|
function checkEvent(e, el, binding) {
|
|
if (!e || checkIsActive(e, binding) === false) return false;
|
|
const root = attachedRoot(el);
|
|
if (typeof ShadowRoot !== "undefined" && root instanceof ShadowRoot && root.host === e.target) return false;
|
|
const elements = (typeof binding.value === "object" && binding.value.include || (() => []))();
|
|
elements.push(el);
|
|
return !elements.some((el2) => el2 == null ? void 0 : el2.contains(e.target));
|
|
}
|
|
function checkIsActive(e, binding) {
|
|
const isActive = typeof binding.value === "object" && binding.value.closeConditional || defaultConditional;
|
|
return isActive(e);
|
|
}
|
|
function directive(e, el, binding) {
|
|
const handler = typeof binding.value === "function" ? binding.value : binding.value.handler;
|
|
e.shadowTarget = e.target;
|
|
el._clickOutside.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(() => {
|
|
checkIsActive(e, binding) && handler && handler(e);
|
|
}, 0);
|
|
}
|
|
function handleShadow(el, callback) {
|
|
const root = attachedRoot(el);
|
|
callback(document);
|
|
if (typeof ShadowRoot !== "undefined" && root instanceof ShadowRoot) {
|
|
callback(root);
|
|
}
|
|
}
|
|
var ClickOutside = {
|
|
// [data-app] may not be found
|
|
// if using bind, inserted makes
|
|
// sure that the root element is
|
|
// available, iOS does not support
|
|
// clicks on body
|
|
mounted(el, binding) {
|
|
const onClick = (e) => directive(e, el, binding);
|
|
const onMousedown = (e) => {
|
|
el._clickOutside.lastMousedownWasOutside = checkEvent(e, el, binding);
|
|
};
|
|
handleShadow(el, (app) => {
|
|
app.addEventListener("click", onClick, true);
|
|
app.addEventListener("mousedown", onMousedown, true);
|
|
});
|
|
if (!el._clickOutside) {
|
|
el._clickOutside = {
|
|
lastMousedownWasOutside: false
|
|
};
|
|
}
|
|
el._clickOutside[binding.instance.$.uid] = {
|
|
onClick,
|
|
onMousedown
|
|
};
|
|
},
|
|
beforeUnmount(el, binding) {
|
|
if (!el._clickOutside) return;
|
|
handleShadow(el, (app) => {
|
|
var _a;
|
|
if (!app || !((_a = el._clickOutside) == null ? void 0 : _a[binding.instance.$.uid])) return;
|
|
const {
|
|
onClick,
|
|
onMousedown
|
|
} = el._clickOutside[binding.instance.$.uid];
|
|
app.removeEventListener("click", onClick, true);
|
|
app.removeEventListener("mousedown", onMousedown, true);
|
|
});
|
|
delete el._clickOutside[binding.instance.$.uid];
|
|
}
|
|
};
|
|
var click_outside_default = ClickOutside;
|
|
|
|
// node_modules/vuetify/lib/components/VOverlay/VOverlay.js
|
|
function Scrim(props) {
|
|
const {
|
|
modelValue,
|
|
color,
|
|
...rest
|
|
} = props;
|
|
return createVNode(Transition, {
|
|
"name": "fade-transition",
|
|
"appear": true
|
|
}, {
|
|
default: () => [props.modelValue && createBaseVNode("div", mergeProps({
|
|
"class": ["v-overlay__scrim", props.color.backgroundColorClasses.value],
|
|
"style": props.color.backgroundColorStyles.value
|
|
}, rest), null)]
|
|
});
|
|
}
|
|
var makeVOverlayProps = propsFactory({
|
|
absolute: Boolean,
|
|
attach: [Boolean, String, Object],
|
|
closeOnBack: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
contained: Boolean,
|
|
contentClass: null,
|
|
contentProps: null,
|
|
disabled: Boolean,
|
|
opacity: [Number, String],
|
|
noClickAnimation: Boolean,
|
|
modelValue: Boolean,
|
|
persistent: Boolean,
|
|
scrim: {
|
|
type: [Boolean, String],
|
|
default: true
|
|
},
|
|
zIndex: {
|
|
type: [Number, String],
|
|
default: 2e3
|
|
},
|
|
...makeActivatorProps(),
|
|
...makeComponentProps(),
|
|
...makeDimensionProps(),
|
|
...makeLazyProps(),
|
|
...makeLocationStrategyProps(),
|
|
...makeScrollStrategyProps(),
|
|
...makeThemeProps(),
|
|
...makeTransitionProps()
|
|
}, "VOverlay");
|
|
var VOverlay = genericComponent()({
|
|
name: "VOverlay",
|
|
directives: {
|
|
vClickOutside: click_outside_default
|
|
},
|
|
inheritAttrs: false,
|
|
props: {
|
|
_disableGlobalStack: Boolean,
|
|
...makeVOverlayProps()
|
|
},
|
|
emits: {
|
|
"click:outside": (e) => true,
|
|
"update:modelValue": (value) => true,
|
|
keydown: (e) => true,
|
|
afterEnter: () => true,
|
|
afterLeave: () => true
|
|
},
|
|
setup(props, _ref) {
|
|
let {
|
|
slots,
|
|
attrs,
|
|
emit
|
|
} = _ref;
|
|
const vm = getCurrentInstance("VOverlay");
|
|
const root = ref();
|
|
const scrimEl = ref();
|
|
const contentEl = ref();
|
|
const model = useProxiedModel(props, "modelValue");
|
|
const isActive = computed({
|
|
get: () => model.value,
|
|
set: (v) => {
|
|
if (!(v && props.disabled)) model.value = v;
|
|
}
|
|
});
|
|
const {
|
|
themeClasses
|
|
} = provideTheme(props);
|
|
const {
|
|
rtlClasses,
|
|
isRtl
|
|
} = useRtl();
|
|
const {
|
|
hasContent,
|
|
onAfterLeave: _onAfterLeave
|
|
} = useLazy(props, isActive);
|
|
const scrimColor = useBackgroundColor(() => {
|
|
return typeof props.scrim === "string" ? props.scrim : null;
|
|
});
|
|
const {
|
|
globalTop,
|
|
localTop,
|
|
stackStyles
|
|
} = useStack(isActive, () => props.zIndex, props._disableGlobalStack);
|
|
const {
|
|
activatorEl,
|
|
activatorRef,
|
|
target,
|
|
targetEl,
|
|
targetRef,
|
|
activatorEvents,
|
|
contentEvents,
|
|
scrimEvents
|
|
} = useActivator(props, {
|
|
isActive,
|
|
isTop: localTop,
|
|
contentEl
|
|
});
|
|
const {
|
|
teleportTarget
|
|
} = useTeleport(() => {
|
|
var _a, _b, _c;
|
|
const target2 = props.attach || props.contained;
|
|
if (target2) return target2;
|
|
const rootNode = ((_a = activatorEl == null ? void 0 : activatorEl.value) == null ? void 0 : _a.getRootNode()) || ((_c = (_b = vm.proxy) == null ? void 0 : _b.$el) == null ? void 0 : _c.getRootNode());
|
|
if (rootNode instanceof ShadowRoot) return rootNode;
|
|
return false;
|
|
});
|
|
const {
|
|
dimensionStyles
|
|
} = useDimension(props);
|
|
const isMounted = useHydration();
|
|
const {
|
|
scopeId
|
|
} = useScopeId();
|
|
watch(() => props.disabled, (v) => {
|
|
if (v) isActive.value = false;
|
|
});
|
|
const {
|
|
contentStyles,
|
|
updateLocation
|
|
} = useLocationStrategies(props, {
|
|
isRtl,
|
|
contentEl,
|
|
target,
|
|
isActive
|
|
});
|
|
useScrollStrategies(props, {
|
|
root,
|
|
contentEl,
|
|
targetEl,
|
|
target,
|
|
isActive,
|
|
updateLocation
|
|
});
|
|
function onClickOutside(e) {
|
|
emit("click:outside", e);
|
|
if (!props.persistent) isActive.value = false;
|
|
else animateClick();
|
|
}
|
|
function closeConditional(e) {
|
|
return isActive.value && globalTop.value && // If using scrim, only close if clicking on it rather than anything opened on top
|
|
(!props.scrim || e.target === scrimEl.value || e instanceof MouseEvent && e.shadowTarget === scrimEl.value);
|
|
}
|
|
IN_BROWSER && watch(isActive, (val) => {
|
|
if (val) {
|
|
window.addEventListener("keydown", onKeydown);
|
|
} else {
|
|
window.removeEventListener("keydown", onKeydown);
|
|
}
|
|
}, {
|
|
immediate: true
|
|
});
|
|
onBeforeUnmount(() => {
|
|
if (!IN_BROWSER) return;
|
|
window.removeEventListener("keydown", onKeydown);
|
|
});
|
|
function onKeydown(e) {
|
|
var _a, _b, _c;
|
|
if (e.key === "Escape" && globalTop.value) {
|
|
if (!((_a = contentEl.value) == null ? void 0 : _a.contains(document.activeElement))) {
|
|
emit("keydown", e);
|
|
}
|
|
if (!props.persistent) {
|
|
isActive.value = false;
|
|
if ((_b = contentEl.value) == null ? void 0 : _b.contains(document.activeElement)) {
|
|
(_c = activatorEl.value) == null ? void 0 : _c.focus();
|
|
}
|
|
} else animateClick();
|
|
}
|
|
}
|
|
function onKeydownSelf(e) {
|
|
if (e.key === "Escape" && !globalTop.value) return;
|
|
emit("keydown", e);
|
|
}
|
|
const router = useRouter();
|
|
useToggleScope(() => props.closeOnBack, () => {
|
|
useBackButton(router, (next) => {
|
|
if (globalTop.value && isActive.value) {
|
|
next(false);
|
|
if (!props.persistent) isActive.value = false;
|
|
else animateClick();
|
|
} else {
|
|
next();
|
|
}
|
|
});
|
|
});
|
|
const top = ref();
|
|
watch(() => isActive.value && (props.absolute || props.contained) && teleportTarget.value == null, (val) => {
|
|
if (val) {
|
|
const scrollParent = getScrollParent(root.value);
|
|
if (scrollParent && scrollParent !== document.scrollingElement) {
|
|
top.value = scrollParent.scrollTop;
|
|
}
|
|
}
|
|
});
|
|
function animateClick() {
|
|
if (props.noClickAnimation) return;
|
|
contentEl.value && animate(contentEl.value, [{
|
|
transformOrigin: "center"
|
|
}, {
|
|
transform: "scale(1.03)"
|
|
}, {
|
|
transformOrigin: "center"
|
|
}], {
|
|
duration: 150,
|
|
easing: standardEasing
|
|
});
|
|
}
|
|
function onAfterEnter() {
|
|
emit("afterEnter");
|
|
}
|
|
function onAfterLeave() {
|
|
_onAfterLeave();
|
|
emit("afterLeave");
|
|
}
|
|
useRender(() => {
|
|
var _a;
|
|
return createBaseVNode(Fragment, null, [(_a = slots.activator) == null ? void 0 : _a.call(slots, {
|
|
isActive: isActive.value,
|
|
targetRef,
|
|
props: mergeProps({
|
|
ref: activatorRef
|
|
}, activatorEvents.value, props.activatorProps)
|
|
}), isMounted.value && hasContent.value && createVNode(Teleport, {
|
|
"disabled": !teleportTarget.value,
|
|
"to": teleportTarget.value
|
|
}, {
|
|
default: () => [createBaseVNode("div", mergeProps({
|
|
"class": ["v-overlay", {
|
|
"v-overlay--absolute": props.absolute || props.contained,
|
|
"v-overlay--active": isActive.value,
|
|
"v-overlay--contained": props.contained
|
|
}, themeClasses.value, rtlClasses.value, props.class],
|
|
"style": [stackStyles.value, {
|
|
"--v-overlay-opacity": props.opacity,
|
|
top: convertToUnit(top.value)
|
|
}, props.style],
|
|
"ref": root,
|
|
"onKeydown": onKeydownSelf
|
|
}, scopeId, attrs), [createVNode(Scrim, mergeProps({
|
|
"color": scrimColor,
|
|
"modelValue": isActive.value && !!props.scrim,
|
|
"ref": scrimEl
|
|
}, scrimEvents.value), null), createVNode(MaybeTransition, {
|
|
"appear": true,
|
|
"persisted": true,
|
|
"transition": props.transition,
|
|
"target": target.value,
|
|
"onAfterEnter": onAfterEnter,
|
|
"onAfterLeave": onAfterLeave
|
|
}, {
|
|
default: () => {
|
|
var _a2;
|
|
return [withDirectives(createBaseVNode("div", mergeProps({
|
|
"ref": contentEl,
|
|
"class": ["v-overlay__content", props.contentClass],
|
|
"style": [dimensionStyles.value, contentStyles.value]
|
|
}, contentEvents.value, props.contentProps), [(_a2 = slots.default) == null ? void 0 : _a2.call(slots, {
|
|
isActive
|
|
})]), [[vShow, isActive.value], [click_outside_default, {
|
|
handler: onClickOutside,
|
|
closeConditional,
|
|
include: () => [activatorEl.value]
|
|
}]])];
|
|
}
|
|
})])]
|
|
})]);
|
|
});
|
|
return {
|
|
activatorEl,
|
|
scrimEl,
|
|
target,
|
|
animateClick,
|
|
contentEl,
|
|
globalTop,
|
|
localTop,
|
|
updateLocation
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/vuetify/lib/composables/forwardRefs.js
|
|
var Refs = Symbol("Forwarded refs");
|
|
function getDescriptor(obj, key) {
|
|
let currentObj = obj;
|
|
while (currentObj) {
|
|
const descriptor = Reflect.getOwnPropertyDescriptor(currentObj, key);
|
|
if (descriptor) return descriptor;
|
|
currentObj = Object.getPrototypeOf(currentObj);
|
|
}
|
|
return void 0;
|
|
}
|
|
function forwardRefs(target) {
|
|
for (var _len = arguments.length, refs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
refs[_key - 1] = arguments[_key];
|
|
}
|
|
target[Refs] = refs;
|
|
return new Proxy(target, {
|
|
get(target2, key) {
|
|
if (Reflect.has(target2, key)) {
|
|
return Reflect.get(target2, key);
|
|
}
|
|
if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return;
|
|
for (const ref2 of refs) {
|
|
if (ref2.value && Reflect.has(ref2.value, key)) {
|
|
const val = Reflect.get(ref2.value, key);
|
|
return typeof val === "function" ? val.bind(ref2.value) : val;
|
|
}
|
|
}
|
|
},
|
|
has(target2, key) {
|
|
if (Reflect.has(target2, key)) {
|
|
return true;
|
|
}
|
|
if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return false;
|
|
for (const ref2 of refs) {
|
|
if (ref2.value && Reflect.has(ref2.value, key)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
},
|
|
set(target2, key, value) {
|
|
if (Reflect.has(target2, key)) {
|
|
return Reflect.set(target2, key, value);
|
|
}
|
|
if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return false;
|
|
for (const ref2 of refs) {
|
|
if (ref2.value && Reflect.has(ref2.value, key)) {
|
|
return Reflect.set(ref2.value, key, value);
|
|
}
|
|
}
|
|
return false;
|
|
},
|
|
getOwnPropertyDescriptor(target2, key) {
|
|
var _a;
|
|
const descriptor = Reflect.getOwnPropertyDescriptor(target2, key);
|
|
if (descriptor) return descriptor;
|
|
if (typeof key === "symbol" || key.startsWith("$") || key.startsWith("__")) return;
|
|
for (const ref2 of refs) {
|
|
if (!ref2.value) continue;
|
|
const descriptor2 = getDescriptor(ref2.value, key) ?? ("_" in ref2.value ? getDescriptor((_a = ref2.value._) == null ? void 0 : _a.setupState, key) : void 0);
|
|
if (descriptor2) return descriptor2;
|
|
}
|
|
for (const ref2 of refs) {
|
|
const childRefs = ref2.value && ref2.value[Refs];
|
|
if (!childRefs) continue;
|
|
const queue = childRefs.slice();
|
|
while (queue.length) {
|
|
const ref3 = queue.shift();
|
|
const descriptor2 = getDescriptor(ref3.value, key);
|
|
if (descriptor2) return descriptor2;
|
|
const childRefs2 = ref3.value && ref3.value[Refs];
|
|
if (childRefs2) queue.push(...childRefs2);
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
});
|
|
}
|
|
|
|
// node_modules/vuetify/lib/components/VSnackbar/VSnackbar.js
|
|
function useCountdown(milliseconds) {
|
|
const time = shallowRef(milliseconds());
|
|
let timer = -1;
|
|
function clear() {
|
|
clearInterval(timer);
|
|
}
|
|
function reset() {
|
|
clear();
|
|
nextTick(() => time.value = milliseconds());
|
|
}
|
|
function start(el) {
|
|
const style = el ? getComputedStyle(el) : {
|
|
transitionDuration: 0.2
|
|
};
|
|
const interval = parseFloat(style.transitionDuration) * 1e3 || 200;
|
|
clear();
|
|
if (time.value <= 0) return;
|
|
const startTime = performance.now();
|
|
timer = window.setInterval(() => {
|
|
const elapsed = performance.now() - startTime + interval;
|
|
time.value = Math.max(milliseconds() - elapsed, 0);
|
|
if (time.value <= 0) clear();
|
|
}, interval);
|
|
}
|
|
onScopeDispose(clear);
|
|
return {
|
|
clear,
|
|
time,
|
|
start,
|
|
reset
|
|
};
|
|
}
|
|
var makeVSnackbarProps = propsFactory({
|
|
multiLine: Boolean,
|
|
text: String,
|
|
timer: [Boolean, String],
|
|
timeout: {
|
|
type: [Number, String],
|
|
default: 5e3
|
|
},
|
|
vertical: Boolean,
|
|
...makeLocationProps({
|
|
location: "bottom"
|
|
}),
|
|
...makePositionProps(),
|
|
...makeRoundedProps(),
|
|
...makeVariantProps(),
|
|
...makeThemeProps(),
|
|
...omit(makeVOverlayProps({
|
|
transition: "v-snackbar-transition"
|
|
}), ["persistent", "noClickAnimation", "scrim", "scrollStrategy"])
|
|
}, "VSnackbar");
|
|
var VSnackbar = genericComponent()({
|
|
name: "VSnackbar",
|
|
props: makeVSnackbarProps(),
|
|
emits: {
|
|
"update:modelValue": (v) => true
|
|
},
|
|
setup(props, _ref) {
|
|
let {
|
|
slots
|
|
} = _ref;
|
|
const isActive = useProxiedModel(props, "modelValue");
|
|
const {
|
|
positionClasses
|
|
} = usePosition(props);
|
|
const {
|
|
scopeId
|
|
} = useScopeId();
|
|
const {
|
|
themeClasses
|
|
} = provideTheme(props);
|
|
const {
|
|
colorClasses,
|
|
colorStyles,
|
|
variantClasses
|
|
} = useVariant(props);
|
|
const {
|
|
roundedClasses
|
|
} = useRounded(props);
|
|
const countdown = useCountdown(() => Number(props.timeout));
|
|
const overlay = ref();
|
|
const timerRef = ref();
|
|
const isHovering = shallowRef(false);
|
|
const startY = shallowRef(0);
|
|
const mainStyles = ref();
|
|
const hasLayout = inject(VuetifyLayoutKey, void 0);
|
|
useToggleScope(() => !!hasLayout, () => {
|
|
const layout = useLayout();
|
|
watchEffect(() => {
|
|
mainStyles.value = layout.mainStyles.value;
|
|
});
|
|
});
|
|
watch(isActive, startTimeout);
|
|
watch(() => props.timeout, startTimeout);
|
|
onMounted(() => {
|
|
if (isActive.value) startTimeout();
|
|
});
|
|
let activeTimeout = -1;
|
|
function startTimeout() {
|
|
countdown.reset();
|
|
window.clearTimeout(activeTimeout);
|
|
const timeout = Number(props.timeout);
|
|
if (!isActive.value || timeout === -1) return;
|
|
const element = refElement(timerRef.value);
|
|
countdown.start(element);
|
|
activeTimeout = window.setTimeout(() => {
|
|
isActive.value = false;
|
|
}, timeout);
|
|
}
|
|
function clearTimeout() {
|
|
countdown.reset();
|
|
window.clearTimeout(activeTimeout);
|
|
}
|
|
function onPointerenter() {
|
|
isHovering.value = true;
|
|
clearTimeout();
|
|
}
|
|
function onPointerleave() {
|
|
isHovering.value = false;
|
|
startTimeout();
|
|
}
|
|
function onTouchstart(event) {
|
|
startY.value = event.touches[0].clientY;
|
|
}
|
|
function onTouchend(event) {
|
|
if (Math.abs(startY.value - event.changedTouches[0].clientY) > 50) {
|
|
isActive.value = false;
|
|
}
|
|
}
|
|
function onAfterLeave() {
|
|
if (isHovering.value) onPointerleave();
|
|
}
|
|
const locationClasses = computed(() => {
|
|
return props.location.split(" ").reduce((acc, loc) => {
|
|
acc[`v-snackbar--${loc}`] = true;
|
|
return acc;
|
|
}, {});
|
|
});
|
|
useRender(() => {
|
|
const overlayProps = VOverlay.filterProps(props);
|
|
const hasContent = !!(slots.default || slots.text || props.text);
|
|
return createVNode(VOverlay, mergeProps({
|
|
"ref": overlay,
|
|
"class": ["v-snackbar", {
|
|
"v-snackbar--active": isActive.value,
|
|
"v-snackbar--multi-line": props.multiLine && !props.vertical,
|
|
"v-snackbar--timer": !!props.timer,
|
|
"v-snackbar--vertical": props.vertical
|
|
}, locationClasses.value, positionClasses.value, props.class],
|
|
"style": [mainStyles.value, props.style]
|
|
}, overlayProps, {
|
|
"modelValue": isActive.value,
|
|
"onUpdate:modelValue": ($event) => isActive.value = $event,
|
|
"contentProps": mergeProps({
|
|
class: ["v-snackbar__wrapper", themeClasses.value, colorClasses.value, roundedClasses.value, variantClasses.value],
|
|
style: [colorStyles.value],
|
|
onPointerenter,
|
|
onPointerleave
|
|
}, overlayProps.contentProps),
|
|
"persistent": true,
|
|
"noClickAnimation": true,
|
|
"scrim": false,
|
|
"scrollStrategy": "none",
|
|
"_disableGlobalStack": true,
|
|
"onTouchstartPassive": onTouchstart,
|
|
"onTouchend": onTouchend,
|
|
"onAfterLeave": onAfterLeave
|
|
}, scopeId), {
|
|
default: () => {
|
|
var _a, _b;
|
|
return [genOverlays(false, "v-snackbar"), props.timer && !isHovering.value && createBaseVNode("div", {
|
|
"key": "timer",
|
|
"class": "v-snackbar__timer"
|
|
}, [createVNode(VProgressLinear, {
|
|
"ref": timerRef,
|
|
"color": typeof props.timer === "string" ? props.timer : "info",
|
|
"max": props.timeout,
|
|
"modelValue": countdown.time.value
|
|
}, null)]), hasContent && createBaseVNode("div", {
|
|
"key": "content",
|
|
"class": "v-snackbar__content",
|
|
"role": "status",
|
|
"aria-live": "polite"
|
|
}, [((_a = slots.text) == null ? void 0 : _a.call(slots)) ?? props.text, (_b = slots.default) == null ? void 0 : _b.call(slots)]), slots.actions && createVNode(VDefaultsProvider, {
|
|
"defaults": {
|
|
VBtn: {
|
|
variant: "text",
|
|
ripple: false,
|
|
slim: true
|
|
}
|
|
}
|
|
}, {
|
|
default: () => [createBaseVNode("div", {
|
|
"class": "v-snackbar__actions"
|
|
}, [slots.actions({
|
|
isActive
|
|
})])]
|
|
})];
|
|
},
|
|
activator: slots.activator
|
|
});
|
|
});
|
|
return forwardRefs({}, overlay);
|
|
}
|
|
});
|
|
export {
|
|
VSnackbar
|
|
};
|
|
//# sourceMappingURL=vuetify_components_VSnackbar.js.map
|