278 lines
11 KiB
JavaScript
278 lines
11 KiB
JavaScript
import { Kn as ref, Qn as toRef, U as computed, Vn as onScopeDispose, W as createBaseVNode, Yn as shallowRef, _n as watchEffect, ar as normalizeClass, er as toValue, et as createVNode, gn as watch, n as Transition, sr as normalizeStyle } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
|
|
import { _ as convertToUnit, c as getCurrentInstanceName, et as SUPPORTS_INTERSECTION, g as clamp, l as propsFactory, n as genericComponent } from "./defineComponent-DB6xIcDy.js";
|
|
import { t as makeComponentProps } from "./component-DdiwBe6i.js";
|
|
import { t as useRender } from "./useRender-fVtVsZgv.js";
|
|
import { r as useTextColor, t as useBackgroundColor } from "./color-B6vuQruj.js";
|
|
import { i as provideTheme, r as makeThemeProps } from "./theme-Cx5kFg0-.js";
|
|
import { n as useToggleScope, t as useProxiedModel } from "./proxiedModel-DSlSIQ0y.js";
|
|
import { i as useRtl } from "./locale-DDGMqzqb.js";
|
|
import { t as useResizeObserver } from "./resizeObserver-C12jWpYk.js";
|
|
import { t as makeTagProps } from "./tag-C_KkCPzB.js";
|
|
import { n as useRounded, t as makeRoundedProps } from "./rounded-BuPGKRa9.js";
|
|
import { n as useLocation, t as makeLocationProps } from "./location-BIKTnDF4.js";
|
|
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VProgressLinear/VProgressLinear.css";
|
|
//#region node_modules/vuetify/lib/composables/intersectionObserver.js
|
|
function useIntersectionObserver(callback, options) {
|
|
const intersectionRef = ref();
|
|
const isIntersecting = shallowRef(false);
|
|
if (SUPPORTS_INTERSECTION) {
|
|
const observer = new IntersectionObserver((entries) => {
|
|
callback?.(entries, observer);
|
|
isIntersecting.value = !!entries.find((entry) => entry.isIntersecting);
|
|
}, options);
|
|
onScopeDispose(() => {
|
|
observer.disconnect();
|
|
});
|
|
watch(intersectionRef, (newValue, oldValue) => {
|
|
if (oldValue) {
|
|
observer.unobserve(oldValue);
|
|
isIntersecting.value = false;
|
|
}
|
|
if (newValue) observer.observe(newValue);
|
|
}, { flush: "post" });
|
|
}
|
|
return {
|
|
intersectionRef,
|
|
isIntersecting
|
|
};
|
|
}
|
|
//#endregion
|
|
//#region node_modules/vuetify/lib/components/VProgressLinear/chunks.js
|
|
var makeChunksProps = propsFactory({
|
|
chunkCount: {
|
|
type: [Number, String],
|
|
default: null
|
|
},
|
|
chunkWidth: {
|
|
type: [Number, String],
|
|
default: null
|
|
},
|
|
chunkGap: {
|
|
type: [Number, String],
|
|
default: 4
|
|
}
|
|
}, "chunks");
|
|
function useChunks(props, containerWidth) {
|
|
const hasChunks = toRef(() => !!props.chunkCount || !!props.chunkWidth);
|
|
const chunkWidth = computed(() => {
|
|
const containerSize = toValue(containerWidth);
|
|
if (!containerSize) return 0;
|
|
if (!props.chunkCount) return Number(props.chunkWidth);
|
|
const count = Number(props.chunkCount);
|
|
return (containerSize - Number(props.chunkGap) * (count - 1)) / count;
|
|
});
|
|
const chunkGap = toRef(() => Number(props.chunkGap));
|
|
const chunksMaskStyles = computed(() => {
|
|
if (!hasChunks.value) return {};
|
|
const chunkGapPx = convertToUnit(chunkGap.value);
|
|
const chunkWidthPx = convertToUnit(chunkWidth.value);
|
|
return {
|
|
maskRepeat: "repeat-x",
|
|
maskImage: `linear-gradient(90deg, #000, #000 ${chunkWidthPx}, transparent ${chunkWidthPx}, transparent)`,
|
|
maskSize: `calc(${chunkWidthPx} + ${chunkGapPx}) 100%`
|
|
};
|
|
});
|
|
function snapValueToChunk(val) {
|
|
const containerSize = toValue(containerWidth);
|
|
if (!containerSize) return val;
|
|
const gapRelativeSize = 100 * chunkGap.value / containerSize;
|
|
const chunkRelativeSize = 100 * (chunkWidth.value + chunkGap.value) / containerSize;
|
|
return clamp(0, Math.floor((val + gapRelativeSize) / chunkRelativeSize) * chunkRelativeSize - gapRelativeSize / 2, 100);
|
|
}
|
|
return {
|
|
hasChunks,
|
|
chunksMaskStyles,
|
|
snapValueToChunk
|
|
};
|
|
}
|
|
//#endregion
|
|
//#region node_modules/vuetify/lib/components/VProgressLinear/VProgressLinear.js
|
|
var makeVProgressLinearProps = propsFactory({
|
|
absolute: Boolean,
|
|
active: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
bgColor: String,
|
|
bgOpacity: [Number, String],
|
|
bufferValue: {
|
|
type: [Number, String],
|
|
default: 0
|
|
},
|
|
bufferColor: String,
|
|
bufferOpacity: [Number, String],
|
|
clickable: Boolean,
|
|
color: String,
|
|
height: {
|
|
type: [Number, String],
|
|
default: 4
|
|
},
|
|
indeterminate: Boolean,
|
|
max: {
|
|
type: [Number, String],
|
|
default: 100
|
|
},
|
|
modelValue: {
|
|
type: [Number, String],
|
|
default: 0
|
|
},
|
|
opacity: [Number, String],
|
|
reverse: Boolean,
|
|
stream: Boolean,
|
|
striped: Boolean,
|
|
roundedBar: Boolean,
|
|
...makeChunksProps(),
|
|
...makeComponentProps(),
|
|
...makeLocationProps({ location: "top" }),
|
|
...makeRoundedProps(),
|
|
...makeTagProps(),
|
|
...makeThemeProps()
|
|
}, "VProgressLinear");
|
|
var VProgressLinear = genericComponent()({
|
|
name: "VProgressLinear",
|
|
props: makeVProgressLinearProps(),
|
|
emits: { "update:modelValue": (value) => true },
|
|
setup(props, { slots }) {
|
|
const root = ref();
|
|
const progress = useProxiedModel(props, "modelValue");
|
|
const { isRtl, rtlClasses } = useRtl();
|
|
const { themeClasses } = provideTheme(props);
|
|
const { locationStyles } = useLocation(props);
|
|
const { textColorClasses, textColorStyles } = useTextColor(() => props.color);
|
|
const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(() => props.bgColor || props.color);
|
|
const { backgroundColorClasses: bufferColorClasses, backgroundColorStyles: bufferColorStyles } = useBackgroundColor(() => props.bufferColor || props.bgColor || props.color);
|
|
const { backgroundColorClasses: barColorClasses, backgroundColorStyles: barColorStyles } = useBackgroundColor(() => props.color);
|
|
const { roundedClasses } = useRounded(props);
|
|
const { intersectionRef, isIntersecting } = useIntersectionObserver();
|
|
const max = computed(() => parseFloat(props.max));
|
|
const height = computed(() => parseFloat(props.height));
|
|
const normalizedBuffer = computed(() => clamp(parseFloat(props.bufferValue) / max.value * 100, 0, 100));
|
|
const normalizedValue = computed(() => clamp(parseFloat(progress.value) / max.value * 100, 0, 100));
|
|
const isReversed = computed(() => isRtl.value !== props.reverse);
|
|
const transition = computed(() => props.indeterminate ? "fade-transition" : "slide-x-transition");
|
|
const containerWidth = shallowRef(0);
|
|
const { hasChunks, chunksMaskStyles, snapValueToChunk } = useChunks(props, containerWidth);
|
|
useToggleScope(hasChunks, () => {
|
|
const { resizeRef } = useResizeObserver((entries) => containerWidth.value = entries[0].contentRect.width);
|
|
watchEffect(() => resizeRef.value = root.value);
|
|
});
|
|
const bufferWidth = computed(() => {
|
|
return hasChunks.value ? snapValueToChunk(normalizedBuffer.value) : normalizedBuffer.value;
|
|
});
|
|
const barWidth = computed(() => {
|
|
return hasChunks.value ? snapValueToChunk(normalizedValue.value) : normalizedValue.value;
|
|
});
|
|
function handleClick(e) {
|
|
if (!intersectionRef.value) return;
|
|
const { left, right, width } = intersectionRef.value.getBoundingClientRect();
|
|
const value = isReversed.value ? width - e.clientX + (right - width) : e.clientX - left;
|
|
progress.value = Math.round(value / width * max.value);
|
|
}
|
|
watchEffect(() => {
|
|
intersectionRef.value = root.value;
|
|
});
|
|
useRender(() => createVNode(props.tag, {
|
|
"ref": root,
|
|
"class": normalizeClass([
|
|
"v-progress-linear",
|
|
{
|
|
"v-progress-linear--absolute": props.absolute,
|
|
"v-progress-linear--active": props.active && isIntersecting.value,
|
|
"v-progress-linear--reverse": isReversed.value,
|
|
"v-progress-linear--rounded": props.rounded,
|
|
"v-progress-linear--rounded-bar": props.roundedBar,
|
|
"v-progress-linear--striped": props.striped,
|
|
"v-progress-linear--clickable": props.clickable
|
|
},
|
|
roundedClasses.value,
|
|
themeClasses.value,
|
|
rtlClasses.value,
|
|
props.class
|
|
]),
|
|
"style": normalizeStyle([
|
|
{
|
|
bottom: props.location === "bottom" ? 0 : void 0,
|
|
top: props.location === "top" ? 0 : void 0,
|
|
height: props.active ? convertToUnit(height.value) : 0,
|
|
"--v-progress-linear-height": convertToUnit(height.value),
|
|
...props.absolute ? locationStyles.value : {}
|
|
},
|
|
chunksMaskStyles.value,
|
|
props.style
|
|
]),
|
|
"role": "progressbar",
|
|
"aria-hidden": props.active ? "false" : "true",
|
|
"aria-valuemin": "0",
|
|
"aria-valuemax": props.max,
|
|
"aria-valuenow": props.indeterminate ? void 0 : Math.min(parseFloat(progress.value), max.value),
|
|
"onClick": props.clickable && handleClick
|
|
}, { default: () => [
|
|
props.stream && createBaseVNode("div", {
|
|
"key": "stream",
|
|
"class": normalizeClass(["v-progress-linear__stream", textColorClasses.value]),
|
|
"style": {
|
|
...textColorStyles.value,
|
|
[isReversed.value ? "left" : "right"]: convertToUnit(-height.value),
|
|
borderTop: `${convertToUnit(height.value / 2)} dotted`,
|
|
opacity: parseFloat(props.bufferOpacity),
|
|
top: `calc(50% - ${convertToUnit(height.value / 4)})`,
|
|
width: convertToUnit(100 - normalizedBuffer.value, "%"),
|
|
"--v-progress-linear-stream-to": convertToUnit(height.value * (isReversed.value ? 1 : -1))
|
|
}
|
|
}, null),
|
|
createBaseVNode("div", {
|
|
"class": normalizeClass(["v-progress-linear__background", backgroundColorClasses.value]),
|
|
"style": normalizeStyle([backgroundColorStyles.value, {
|
|
opacity: parseFloat(props.bgOpacity),
|
|
width: props.stream ? 0 : void 0
|
|
}])
|
|
}, null),
|
|
createBaseVNode("div", {
|
|
"class": normalizeClass(["v-progress-linear__buffer", bufferColorClasses.value]),
|
|
"style": normalizeStyle([bufferColorStyles.value, {
|
|
opacity: parseFloat(props.bufferOpacity),
|
|
width: convertToUnit(bufferWidth.value, "%")
|
|
}])
|
|
}, null),
|
|
createVNode(Transition, { "name": transition.value }, { default: () => [!props.indeterminate ? createBaseVNode("div", {
|
|
"class": normalizeClass(["v-progress-linear__determinate", barColorClasses.value]),
|
|
"style": normalizeStyle([barColorStyles.value, { width: convertToUnit(barWidth.value, "%") }])
|
|
}, null) : createBaseVNode("div", { "class": "v-progress-linear__indeterminate" }, [["long", "short"].map((bar) => createBaseVNode("div", {
|
|
"key": bar,
|
|
"class": normalizeClass([
|
|
"v-progress-linear__indeterminate",
|
|
bar,
|
|
barColorClasses.value
|
|
]),
|
|
"style": normalizeStyle(barColorStyles.value)
|
|
}, null))])] }),
|
|
slots.default && createBaseVNode("div", { "class": "v-progress-linear__content" }, [slots.default({
|
|
value: normalizedValue.value,
|
|
buffer: normalizedBuffer.value
|
|
})])
|
|
] }));
|
|
return {};
|
|
}
|
|
});
|
|
//#endregion
|
|
//#region node_modules/vuetify/lib/composables/loader.js
|
|
var makeLoaderProps = propsFactory({ loading: [Boolean, String] }, "loader");
|
|
function useLoader(props, name = getCurrentInstanceName()) {
|
|
return { loaderClasses: toRef(() => ({ [`${name}--loading`]: props.loading })) };
|
|
}
|
|
function LoaderSlot(props, { slots }) {
|
|
return createBaseVNode("div", { "class": normalizeClass(`${props.name}__loader`) }, [slots.default?.({
|
|
color: props.color,
|
|
isActive: props.active
|
|
}) || createVNode(VProgressLinear, {
|
|
"absolute": props.absolute,
|
|
"active": props.active,
|
|
"color": props.color,
|
|
"height": "2",
|
|
"indeterminate": true
|
|
}, null)]);
|
|
}
|
|
//#endregion
|
|
export { useIntersectionObserver as i, makeLoaderProps as n, useLoader as r, LoaderSlot as t };
|
|
|
|
//# sourceMappingURL=loader-CV4sMFhE.js.map
|