1133 lines
34 KiB
JavaScript
1133 lines
34 KiB
JavaScript
import {
|
|
VDefaultsProvider,
|
|
genOverlays,
|
|
makeLocationProps,
|
|
makePositionProps,
|
|
makeRoundedProps,
|
|
makeRouterProps,
|
|
makeVariantProps,
|
|
useIntersectionObserver,
|
|
useLink,
|
|
useLocation,
|
|
usePosition,
|
|
useRounded,
|
|
useVariant
|
|
} from "./chunk-2NYZXKZU.js";
|
|
import {
|
|
makeDimensionProps,
|
|
useDimension
|
|
} from "./chunk-4E7YEL5Q.js";
|
|
import {
|
|
useResizeObserver
|
|
} from "./chunk-P6FAB7CJ.js";
|
|
import {
|
|
useProxiedModel
|
|
} from "./chunk-QN4ZFON4.js";
|
|
import {
|
|
VIcon,
|
|
makeSizeProps,
|
|
useSize
|
|
} from "./chunk-QWPWQWFR.js";
|
|
import {
|
|
useTextColor
|
|
} from "./chunk-NW4NIPSU.js";
|
|
import {
|
|
makeTagProps
|
|
} from "./chunk-JH5IUXR2.js";
|
|
import {
|
|
IconValue
|
|
} from "./chunk-2NYYH3MH.js";
|
|
import {
|
|
makeThemeProps,
|
|
provideTheme
|
|
} from "./chunk-ILOYNRQG.js";
|
|
import {
|
|
clamp,
|
|
consoleWarn,
|
|
convertToUnit,
|
|
deepEqual,
|
|
findChildrenWithProvide,
|
|
genericComponent,
|
|
getCurrentInstance,
|
|
getCurrentInstanceName,
|
|
isObject,
|
|
makeComponentProps,
|
|
propsFactory,
|
|
provideDefaults,
|
|
useRender,
|
|
wrapInArray
|
|
} from "./chunk-ADPJOAU6.js";
|
|
import {
|
|
computed,
|
|
createBaseVNode,
|
|
createVNode,
|
|
inject,
|
|
isRef,
|
|
mergeProps,
|
|
nextTick,
|
|
normalizeClass,
|
|
normalizeStyle,
|
|
onBeforeUnmount,
|
|
onMounted,
|
|
onUpdated,
|
|
provide,
|
|
reactive,
|
|
ref,
|
|
toDisplayString,
|
|
toRef,
|
|
unref,
|
|
useId,
|
|
watch,
|
|
watchEffect,
|
|
withDirectives
|
|
} from "./chunk-FIAHBV72.js";
|
|
import "./chunk-DC5AMYBS.js";
|
|
|
|
// node_modules/vuetify/lib/components/VBtn/VBtn.js
|
|
import "/Users/JasonJFraser/Desktop/apps/cmms/frontend/node_modules/vuetify/lib/components/VBtn/VBtn.css";
|
|
|
|
// node_modules/vuetify/lib/components/VBtnToggle/VBtnToggle.js
|
|
import "/Users/JasonJFraser/Desktop/apps/cmms/frontend/node_modules/vuetify/lib/components/VBtnToggle/VBtnToggle.css";
|
|
|
|
// node_modules/vuetify/lib/components/VBtnGroup/VBtnGroup.js
|
|
import "/Users/JasonJFraser/Desktop/apps/cmms/frontend/node_modules/vuetify/lib/components/VBtnGroup/VBtnGroup.css";
|
|
|
|
// node_modules/vuetify/lib/composables/border.js
|
|
var makeBorderProps = propsFactory({
|
|
border: [Boolean, Number, String]
|
|
}, "border");
|
|
function useBorder(props) {
|
|
let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
|
|
const borderClasses = computed(() => {
|
|
const border = props.border;
|
|
if (border === true || border === "") {
|
|
return `${name}--border`;
|
|
} else if (typeof border === "string" || border === 0) {
|
|
return String(border).split(" ").map((v) => `border-${v}`);
|
|
}
|
|
return [];
|
|
});
|
|
return {
|
|
borderClasses
|
|
};
|
|
}
|
|
|
|
// node_modules/vuetify/lib/composables/density.js
|
|
var allowedDensities = [null, "default", "comfortable", "compact"];
|
|
var makeDensityProps = propsFactory({
|
|
density: {
|
|
type: String,
|
|
default: "default",
|
|
validator: (v) => allowedDensities.includes(v)
|
|
}
|
|
}, "density");
|
|
function useDensity(props) {
|
|
let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
|
|
const densityClasses = toRef(() => {
|
|
return `${name}--density-${props.density}`;
|
|
});
|
|
return {
|
|
densityClasses
|
|
};
|
|
}
|
|
|
|
// node_modules/vuetify/lib/composables/elevation.js
|
|
var makeElevationProps = propsFactory({
|
|
elevation: {
|
|
type: [Number, String],
|
|
validator(v) {
|
|
const value = parseInt(v);
|
|
return !isNaN(value) && value >= 0 && // Material Design has a maximum elevation of 24
|
|
// https://material.io/design/environment/elevation.html#default-elevations
|
|
value <= 24;
|
|
}
|
|
}
|
|
}, "elevation");
|
|
function useElevation(props) {
|
|
const elevationClasses = toRef(() => {
|
|
const elevation = isRef(props) ? props.value : props.elevation;
|
|
if (elevation == null) return [];
|
|
return [`elevation-${elevation}`];
|
|
});
|
|
return {
|
|
elevationClasses
|
|
};
|
|
}
|
|
|
|
// node_modules/vuetify/lib/components/VBtnGroup/VBtnGroup.js
|
|
var makeVBtnGroupProps = propsFactory({
|
|
baseColor: String,
|
|
divided: Boolean,
|
|
direction: {
|
|
type: String,
|
|
default: "horizontal"
|
|
},
|
|
...makeBorderProps(),
|
|
...makeComponentProps(),
|
|
...makeDensityProps(),
|
|
...makeElevationProps(),
|
|
...makeRoundedProps(),
|
|
...makeTagProps(),
|
|
...makeThemeProps(),
|
|
...makeVariantProps()
|
|
}, "VBtnGroup");
|
|
var VBtnGroup = genericComponent()({
|
|
name: "VBtnGroup",
|
|
props: makeVBtnGroupProps(),
|
|
setup(props, _ref) {
|
|
let {
|
|
slots
|
|
} = _ref;
|
|
const {
|
|
themeClasses
|
|
} = provideTheme(props);
|
|
const {
|
|
densityClasses
|
|
} = useDensity(props);
|
|
const {
|
|
borderClasses
|
|
} = useBorder(props);
|
|
const {
|
|
elevationClasses
|
|
} = useElevation(props);
|
|
const {
|
|
roundedClasses
|
|
} = useRounded(props);
|
|
provideDefaults({
|
|
VBtn: {
|
|
height: toRef(() => props.direction === "horizontal" ? "auto" : null),
|
|
baseColor: toRef(() => props.baseColor),
|
|
color: toRef(() => props.color),
|
|
density: toRef(() => props.density),
|
|
flat: true,
|
|
variant: toRef(() => props.variant)
|
|
}
|
|
});
|
|
useRender(() => {
|
|
return createVNode(props.tag, {
|
|
"class": normalizeClass(["v-btn-group", `v-btn-group--${props.direction}`, {
|
|
"v-btn-group--divided": props.divided
|
|
}, themeClasses.value, borderClasses.value, densityClasses.value, elevationClasses.value, roundedClasses.value, props.class]),
|
|
"style": normalizeStyle(props.style)
|
|
}, slots);
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/vuetify/lib/composables/group.js
|
|
var makeGroupProps = propsFactory({
|
|
modelValue: {
|
|
type: null,
|
|
default: void 0
|
|
},
|
|
multiple: Boolean,
|
|
mandatory: [Boolean, String],
|
|
max: Number,
|
|
selectedClass: String,
|
|
disabled: Boolean
|
|
}, "group");
|
|
var makeGroupItemProps = propsFactory({
|
|
value: null,
|
|
disabled: Boolean,
|
|
selectedClass: String
|
|
}, "group-item");
|
|
function useGroupItem(props, injectKey) {
|
|
let required = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
|
|
const vm = getCurrentInstance("useGroupItem");
|
|
if (!vm) {
|
|
throw new Error("[Vuetify] useGroupItem composable must be used inside a component setup function");
|
|
}
|
|
const id = useId();
|
|
provide(Symbol.for(`${injectKey.description}:id`), id);
|
|
const group = inject(injectKey, null);
|
|
if (!group) {
|
|
if (!required) return group;
|
|
throw new Error(`[Vuetify] Could not find useGroup injection with symbol ${injectKey.description}`);
|
|
}
|
|
const value = toRef(() => props.value);
|
|
const disabled = computed(() => !!(group.disabled.value || props.disabled));
|
|
group.register({
|
|
id,
|
|
value,
|
|
disabled
|
|
}, vm);
|
|
onBeforeUnmount(() => {
|
|
group.unregister(id);
|
|
});
|
|
const isSelected = computed(() => {
|
|
return group.isSelected(id);
|
|
});
|
|
const isFirst = computed(() => {
|
|
return group.items.value[0].id === id;
|
|
});
|
|
const isLast = computed(() => {
|
|
return group.items.value[group.items.value.length - 1].id === id;
|
|
});
|
|
const selectedClass = computed(() => isSelected.value && [group.selectedClass.value, props.selectedClass]);
|
|
watch(isSelected, (value2) => {
|
|
vm.emit("group:selected", {
|
|
value: value2
|
|
});
|
|
}, {
|
|
flush: "sync"
|
|
});
|
|
return {
|
|
id,
|
|
isSelected,
|
|
isFirst,
|
|
isLast,
|
|
toggle: () => group.select(id, !isSelected.value),
|
|
select: (value2) => group.select(id, value2),
|
|
selectedClass,
|
|
value,
|
|
disabled,
|
|
group
|
|
};
|
|
}
|
|
function useGroup(props, injectKey) {
|
|
let isUnmounted = false;
|
|
const items = reactive([]);
|
|
const selected = useProxiedModel(props, "modelValue", [], (v) => {
|
|
if (v == null) return [];
|
|
return getIds(items, wrapInArray(v));
|
|
}, (v) => {
|
|
const arr = getValues(items, v);
|
|
return props.multiple ? arr : arr[0];
|
|
});
|
|
const groupVm = getCurrentInstance("useGroup");
|
|
function register(item, vm) {
|
|
const unwrapped = item;
|
|
const key = Symbol.for(`${injectKey.description}:id`);
|
|
const children = findChildrenWithProvide(key, groupVm == null ? void 0 : groupVm.vnode);
|
|
const index = children.indexOf(vm);
|
|
if (unref(unwrapped.value) == null) {
|
|
unwrapped.value = index;
|
|
unwrapped.useIndexAsValue = true;
|
|
}
|
|
if (index > -1) {
|
|
items.splice(index, 0, unwrapped);
|
|
} else {
|
|
items.push(unwrapped);
|
|
}
|
|
}
|
|
function unregister(id) {
|
|
if (isUnmounted) return;
|
|
forceMandatoryValue();
|
|
const index = items.findIndex((item) => item.id === id);
|
|
items.splice(index, 1);
|
|
}
|
|
function forceMandatoryValue() {
|
|
const item = items.find((item2) => !item2.disabled);
|
|
if (item && props.mandatory === "force" && !selected.value.length) {
|
|
selected.value = [item.id];
|
|
}
|
|
}
|
|
onMounted(() => {
|
|
forceMandatoryValue();
|
|
});
|
|
onBeforeUnmount(() => {
|
|
isUnmounted = true;
|
|
});
|
|
onUpdated(() => {
|
|
for (let i = 0; i < items.length; i++) {
|
|
if (items[i].useIndexAsValue) {
|
|
items[i].value = i;
|
|
}
|
|
}
|
|
});
|
|
function select(id, value) {
|
|
const item = items.find((item2) => item2.id === id);
|
|
if (value && (item == null ? void 0 : item.disabled)) return;
|
|
if (props.multiple) {
|
|
const internalValue = selected.value.slice();
|
|
const index = internalValue.findIndex((v) => v === id);
|
|
const isSelected = ~index;
|
|
value = value ?? !isSelected;
|
|
if (isSelected && props.mandatory && internalValue.length <= 1) return;
|
|
if (!isSelected && props.max != null && internalValue.length + 1 > props.max) return;
|
|
if (index < 0 && value) internalValue.push(id);
|
|
else if (index >= 0 && !value) internalValue.splice(index, 1);
|
|
selected.value = internalValue;
|
|
} else {
|
|
const isSelected = selected.value.includes(id);
|
|
if (props.mandatory && isSelected) return;
|
|
if (!isSelected && !value) return;
|
|
selected.value = value ?? !isSelected ? [id] : [];
|
|
}
|
|
}
|
|
function step(offset) {
|
|
if (props.multiple) consoleWarn('This method is not supported when using "multiple" prop');
|
|
if (!selected.value.length) {
|
|
const item = items.find((item2) => !item2.disabled);
|
|
item && (selected.value = [item.id]);
|
|
} else {
|
|
const currentId = selected.value[0];
|
|
const currentIndex = items.findIndex((i) => i.id === currentId);
|
|
let newIndex = (currentIndex + offset) % items.length;
|
|
let newItem = items[newIndex];
|
|
while (newItem.disabled && newIndex !== currentIndex) {
|
|
newIndex = (newIndex + offset) % items.length;
|
|
newItem = items[newIndex];
|
|
}
|
|
if (newItem.disabled) return;
|
|
selected.value = [items[newIndex].id];
|
|
}
|
|
}
|
|
const state = {
|
|
register,
|
|
unregister,
|
|
selected,
|
|
select,
|
|
disabled: toRef(() => props.disabled),
|
|
prev: () => step(items.length - 1),
|
|
next: () => step(1),
|
|
isSelected: (id) => selected.value.includes(id),
|
|
selectedClass: toRef(() => props.selectedClass),
|
|
items: toRef(() => items),
|
|
getItemIndex: (value) => getItemIndex(items, value)
|
|
};
|
|
provide(injectKey, state);
|
|
return state;
|
|
}
|
|
function getItemIndex(items, value) {
|
|
const ids = getIds(items, [value]);
|
|
if (!ids.length) return -1;
|
|
return items.findIndex((item) => item.id === ids[0]);
|
|
}
|
|
function getIds(items, modelValue) {
|
|
const ids = [];
|
|
modelValue.forEach((value) => {
|
|
const item = items.find((item2) => deepEqual(value, item2.value));
|
|
const itemByIndex = items[value];
|
|
if ((item == null ? void 0 : item.value) != null) {
|
|
ids.push(item.id);
|
|
} else if (itemByIndex == null ? void 0 : itemByIndex.useIndexAsValue) {
|
|
ids.push(itemByIndex.id);
|
|
}
|
|
});
|
|
return ids;
|
|
}
|
|
function getValues(items, ids) {
|
|
const values = [];
|
|
ids.forEach((id) => {
|
|
const itemIndex = items.findIndex((item) => item.id === id);
|
|
if (~itemIndex) {
|
|
const item = items[itemIndex];
|
|
values.push(item.value != null ? item.value : itemIndex);
|
|
}
|
|
});
|
|
return values;
|
|
}
|
|
|
|
// node_modules/vuetify/lib/components/VBtnToggle/VBtnToggle.js
|
|
var VBtnToggleSymbol = Symbol.for("vuetify:v-btn-toggle");
|
|
var makeVBtnToggleProps = propsFactory({
|
|
...makeVBtnGroupProps(),
|
|
...makeGroupProps()
|
|
}, "VBtnToggle");
|
|
var VBtnToggle = genericComponent()({
|
|
name: "VBtnToggle",
|
|
props: makeVBtnToggleProps(),
|
|
emits: {
|
|
"update:modelValue": (value) => true
|
|
},
|
|
setup(props, _ref) {
|
|
let {
|
|
slots
|
|
} = _ref;
|
|
const {
|
|
isSelected,
|
|
next,
|
|
prev,
|
|
select,
|
|
selected
|
|
} = useGroup(props, VBtnToggleSymbol);
|
|
useRender(() => {
|
|
const btnGroupProps = VBtnGroup.filterProps(props);
|
|
return createVNode(VBtnGroup, mergeProps({
|
|
"class": ["v-btn-toggle", props.class]
|
|
}, btnGroupProps, {
|
|
"style": props.style
|
|
}), {
|
|
default: () => {
|
|
var _a;
|
|
return [(_a = slots.default) == null ? void 0 : _a.call(slots, {
|
|
isSelected,
|
|
next,
|
|
prev,
|
|
select,
|
|
selected
|
|
})];
|
|
}
|
|
});
|
|
});
|
|
return {
|
|
next,
|
|
prev,
|
|
select
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/vuetify/lib/components/VProgressCircular/VProgressCircular.js
|
|
import "/Users/JasonJFraser/Desktop/apps/cmms/frontend/node_modules/vuetify/lib/components/VProgressCircular/VProgressCircular.css";
|
|
var makeVProgressCircularProps = propsFactory({
|
|
bgColor: String,
|
|
color: String,
|
|
indeterminate: [Boolean, String],
|
|
modelValue: {
|
|
type: [Number, String],
|
|
default: 0
|
|
},
|
|
rotate: {
|
|
type: [Number, String],
|
|
default: 0
|
|
},
|
|
width: {
|
|
type: [Number, String],
|
|
default: 4
|
|
},
|
|
...makeComponentProps(),
|
|
...makeSizeProps(),
|
|
...makeTagProps({
|
|
tag: "div"
|
|
}),
|
|
...makeThemeProps()
|
|
}, "VProgressCircular");
|
|
var VProgressCircular = genericComponent()({
|
|
name: "VProgressCircular",
|
|
props: makeVProgressCircularProps(),
|
|
setup(props, _ref) {
|
|
let {
|
|
slots
|
|
} = _ref;
|
|
const MAGIC_RADIUS_CONSTANT = 20;
|
|
const CIRCUMFERENCE = 2 * Math.PI * MAGIC_RADIUS_CONSTANT;
|
|
const root = ref();
|
|
const {
|
|
themeClasses
|
|
} = provideTheme(props);
|
|
const {
|
|
sizeClasses,
|
|
sizeStyles
|
|
} = useSize(props);
|
|
const {
|
|
textColorClasses,
|
|
textColorStyles
|
|
} = useTextColor(() => props.color);
|
|
const {
|
|
textColorClasses: underlayColorClasses,
|
|
textColorStyles: underlayColorStyles
|
|
} = useTextColor(() => props.bgColor);
|
|
const {
|
|
intersectionRef,
|
|
isIntersecting
|
|
} = useIntersectionObserver();
|
|
const {
|
|
resizeRef,
|
|
contentRect
|
|
} = useResizeObserver();
|
|
const normalizedValue = toRef(() => clamp(parseFloat(props.modelValue), 0, 100));
|
|
const width = toRef(() => Number(props.width));
|
|
const size = toRef(() => {
|
|
return sizeStyles.value ? Number(props.size) : contentRect.value ? contentRect.value.width : Math.max(width.value, 32);
|
|
});
|
|
const diameter = toRef(() => MAGIC_RADIUS_CONSTANT / (1 - width.value / size.value) * 2);
|
|
const strokeWidth = toRef(() => width.value / size.value * diameter.value);
|
|
const strokeDashOffset = toRef(() => convertToUnit((100 - normalizedValue.value) / 100 * CIRCUMFERENCE));
|
|
watchEffect(() => {
|
|
intersectionRef.value = root.value;
|
|
resizeRef.value = root.value;
|
|
});
|
|
useRender(() => createVNode(props.tag, {
|
|
"ref": root,
|
|
"class": normalizeClass(["v-progress-circular", {
|
|
"v-progress-circular--indeterminate": !!props.indeterminate,
|
|
"v-progress-circular--visible": isIntersecting.value,
|
|
"v-progress-circular--disable-shrink": props.indeterminate === "disable-shrink"
|
|
}, themeClasses.value, sizeClasses.value, textColorClasses.value, props.class]),
|
|
"style": normalizeStyle([sizeStyles.value, textColorStyles.value, props.style]),
|
|
"role": "progressbar",
|
|
"aria-valuemin": "0",
|
|
"aria-valuemax": "100",
|
|
"aria-valuenow": props.indeterminate ? void 0 : normalizedValue.value
|
|
}, {
|
|
default: () => [createBaseVNode("svg", {
|
|
"style": {
|
|
transform: `rotate(calc(-90deg + ${Number(props.rotate)}deg))`
|
|
},
|
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
"viewBox": `0 0 ${diameter.value} ${diameter.value}`
|
|
}, [createBaseVNode("circle", {
|
|
"class": normalizeClass(["v-progress-circular__underlay", underlayColorClasses.value]),
|
|
"style": normalizeStyle(underlayColorStyles.value),
|
|
"fill": "transparent",
|
|
"cx": "50%",
|
|
"cy": "50%",
|
|
"r": MAGIC_RADIUS_CONSTANT,
|
|
"stroke-width": strokeWidth.value,
|
|
"stroke-dasharray": CIRCUMFERENCE,
|
|
"stroke-dashoffset": 0
|
|
}, null), createBaseVNode("circle", {
|
|
"class": "v-progress-circular__overlay",
|
|
"fill": "transparent",
|
|
"cx": "50%",
|
|
"cy": "50%",
|
|
"r": MAGIC_RADIUS_CONSTANT,
|
|
"stroke-width": strokeWidth.value,
|
|
"stroke-dasharray": CIRCUMFERENCE,
|
|
"stroke-dashoffset": strokeDashOffset.value
|
|
}, null)]), slots.default && createBaseVNode("div", {
|
|
"class": "v-progress-circular__content"
|
|
}, [slots.default({
|
|
value: normalizedValue.value
|
|
})])]
|
|
}));
|
|
return {};
|
|
}
|
|
});
|
|
|
|
// node_modules/vuetify/lib/composables/loader.js
|
|
var makeLoaderProps = propsFactory({
|
|
loading: [Boolean, String]
|
|
}, "loader");
|
|
function useLoader(props) {
|
|
let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : getCurrentInstanceName();
|
|
const loaderClasses = toRef(() => ({
|
|
[`${name}--loading`]: props.loading
|
|
}));
|
|
return {
|
|
loaderClasses
|
|
};
|
|
}
|
|
|
|
// node_modules/vuetify/lib/composables/selectLink.js
|
|
function useSelectLink(link, select) {
|
|
watch(() => {
|
|
var _a;
|
|
return (_a = link.isActive) == null ? void 0 : _a.value;
|
|
}, (isActive) => {
|
|
if (link.isLink.value && isActive != null && select) {
|
|
nextTick(() => {
|
|
select(isActive);
|
|
});
|
|
}
|
|
}, {
|
|
immediate: true
|
|
});
|
|
}
|
|
|
|
// node_modules/vuetify/lib/directives/ripple/index.js
|
|
import "/Users/JasonJFraser/Desktop/apps/cmms/frontend/node_modules/vuetify/lib/directives/ripple/VRipple.css";
|
|
var stopSymbol = Symbol("rippleStop");
|
|
var DELAY_RIPPLE = 80;
|
|
function transform(el, value) {
|
|
el.style.transform = value;
|
|
el.style.webkitTransform = value;
|
|
}
|
|
function isTouchEvent(e) {
|
|
return e.constructor.name === "TouchEvent";
|
|
}
|
|
function isKeyboardEvent(e) {
|
|
return e.constructor.name === "KeyboardEvent";
|
|
}
|
|
var calculate = function(e, el) {
|
|
var _a;
|
|
let value = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
let localX = 0;
|
|
let localY = 0;
|
|
if (!isKeyboardEvent(e)) {
|
|
const offset = el.getBoundingClientRect();
|
|
const target = isTouchEvent(e) ? e.touches[e.touches.length - 1] : e;
|
|
localX = target.clientX - offset.left;
|
|
localY = target.clientY - offset.top;
|
|
}
|
|
let radius = 0;
|
|
let scale = 0.3;
|
|
if ((_a = el._ripple) == null ? void 0 : _a.circle) {
|
|
scale = 0.15;
|
|
radius = el.clientWidth / 2;
|
|
radius = value.center ? radius : radius + Math.sqrt((localX - radius) ** 2 + (localY - radius) ** 2) / 4;
|
|
} else {
|
|
radius = Math.sqrt(el.clientWidth ** 2 + el.clientHeight ** 2) / 2;
|
|
}
|
|
const centerX = `${(el.clientWidth - radius * 2) / 2}px`;
|
|
const centerY = `${(el.clientHeight - radius * 2) / 2}px`;
|
|
const x = value.center ? centerX : `${localX - radius}px`;
|
|
const y = value.center ? centerY : `${localY - radius}px`;
|
|
return {
|
|
radius,
|
|
scale,
|
|
x,
|
|
y,
|
|
centerX,
|
|
centerY
|
|
};
|
|
};
|
|
var ripples = {
|
|
/* eslint-disable max-statements */
|
|
show(e, el) {
|
|
var _a;
|
|
let value = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
if (!((_a = el == null ? void 0 : el._ripple) == null ? void 0 : _a.enabled)) {
|
|
return;
|
|
}
|
|
const container = document.createElement("span");
|
|
const animation = document.createElement("span");
|
|
container.appendChild(animation);
|
|
container.className = "v-ripple__container";
|
|
if (value.class) {
|
|
container.className += ` ${value.class}`;
|
|
}
|
|
const {
|
|
radius,
|
|
scale,
|
|
x,
|
|
y,
|
|
centerX,
|
|
centerY
|
|
} = calculate(e, el, value);
|
|
const size = `${radius * 2}px`;
|
|
animation.className = "v-ripple__animation";
|
|
animation.style.width = size;
|
|
animation.style.height = size;
|
|
el.appendChild(container);
|
|
const computed2 = window.getComputedStyle(el);
|
|
if (computed2 && computed2.position === "static") {
|
|
el.style.position = "relative";
|
|
el.dataset.previousPosition = "static";
|
|
}
|
|
animation.classList.add("v-ripple__animation--enter");
|
|
animation.classList.add("v-ripple__animation--visible");
|
|
transform(animation, `translate(${x}, ${y}) scale3d(${scale},${scale},${scale})`);
|
|
animation.dataset.activated = String(performance.now());
|
|
requestAnimationFrame(() => {
|
|
requestAnimationFrame(() => {
|
|
animation.classList.remove("v-ripple__animation--enter");
|
|
animation.classList.add("v-ripple__animation--in");
|
|
transform(animation, `translate(${centerX}, ${centerY}) scale3d(1,1,1)`);
|
|
});
|
|
});
|
|
},
|
|
hide(el) {
|
|
var _a;
|
|
if (!((_a = el == null ? void 0 : el._ripple) == null ? void 0 : _a.enabled)) return;
|
|
const ripples2 = el.getElementsByClassName("v-ripple__animation");
|
|
if (ripples2.length === 0) return;
|
|
const animation = Array.from(ripples2).findLast((ripple) => !ripple.dataset.isHiding);
|
|
if (!animation) return;
|
|
else animation.dataset.isHiding = "true";
|
|
const diff = performance.now() - Number(animation.dataset.activated);
|
|
const delay = Math.max(250 - diff, 0);
|
|
setTimeout(() => {
|
|
animation.classList.remove("v-ripple__animation--in");
|
|
animation.classList.add("v-ripple__animation--out");
|
|
setTimeout(() => {
|
|
var _a2;
|
|
const ripples3 = el.getElementsByClassName("v-ripple__animation");
|
|
if (ripples3.length === 1 && el.dataset.previousPosition) {
|
|
el.style.position = el.dataset.previousPosition;
|
|
delete el.dataset.previousPosition;
|
|
}
|
|
if (((_a2 = animation.parentNode) == null ? void 0 : _a2.parentNode) === el) el.removeChild(animation.parentNode);
|
|
}, 300);
|
|
}, delay);
|
|
}
|
|
};
|
|
function isRippleEnabled(value) {
|
|
return typeof value === "undefined" || !!value;
|
|
}
|
|
function rippleShow(e) {
|
|
const value = {};
|
|
const element = e.currentTarget;
|
|
if (!(element == null ? void 0 : element._ripple) || element._ripple.touched || e[stopSymbol]) return;
|
|
e[stopSymbol] = true;
|
|
if (isTouchEvent(e)) {
|
|
element._ripple.touched = true;
|
|
element._ripple.isTouch = true;
|
|
} else {
|
|
if (element._ripple.isTouch) return;
|
|
}
|
|
value.center = element._ripple.centered || isKeyboardEvent(e);
|
|
if (element._ripple.class) {
|
|
value.class = element._ripple.class;
|
|
}
|
|
if (isTouchEvent(e)) {
|
|
if (element._ripple.showTimerCommit) return;
|
|
element._ripple.showTimerCommit = () => {
|
|
ripples.show(e, element, value);
|
|
};
|
|
element._ripple.showTimer = window.setTimeout(() => {
|
|
var _a;
|
|
if ((_a = element == null ? void 0 : element._ripple) == null ? void 0 : _a.showTimerCommit) {
|
|
element._ripple.showTimerCommit();
|
|
element._ripple.showTimerCommit = null;
|
|
}
|
|
}, DELAY_RIPPLE);
|
|
} else {
|
|
ripples.show(e, element, value);
|
|
}
|
|
}
|
|
function rippleStop(e) {
|
|
e[stopSymbol] = true;
|
|
}
|
|
function rippleHide(e) {
|
|
const element = e.currentTarget;
|
|
if (!(element == null ? void 0 : element._ripple)) return;
|
|
window.clearTimeout(element._ripple.showTimer);
|
|
if (e.type === "touchend" && element._ripple.showTimerCommit) {
|
|
element._ripple.showTimerCommit();
|
|
element._ripple.showTimerCommit = null;
|
|
element._ripple.showTimer = window.setTimeout(() => {
|
|
rippleHide(e);
|
|
});
|
|
return;
|
|
}
|
|
window.setTimeout(() => {
|
|
if (element._ripple) {
|
|
element._ripple.touched = false;
|
|
}
|
|
});
|
|
ripples.hide(element);
|
|
}
|
|
function rippleCancelShow(e) {
|
|
const element = e.currentTarget;
|
|
if (!(element == null ? void 0 : element._ripple)) return;
|
|
if (element._ripple.showTimerCommit) {
|
|
element._ripple.showTimerCommit = null;
|
|
}
|
|
window.clearTimeout(element._ripple.showTimer);
|
|
}
|
|
var keyboardRipple = false;
|
|
function keyboardRippleShow(e, keys) {
|
|
if (!keyboardRipple && keys.includes(e.key)) {
|
|
keyboardRipple = true;
|
|
rippleShow(e);
|
|
}
|
|
}
|
|
function keyboardRippleHide(e) {
|
|
keyboardRipple = false;
|
|
rippleHide(e);
|
|
}
|
|
function focusRippleHide(e) {
|
|
if (keyboardRipple) {
|
|
keyboardRipple = false;
|
|
rippleHide(e);
|
|
}
|
|
}
|
|
function updateRipple(el, binding, wasEnabled) {
|
|
const {
|
|
value,
|
|
modifiers
|
|
} = binding;
|
|
const enabled = isRippleEnabled(value);
|
|
if (!enabled) {
|
|
ripples.hide(el);
|
|
}
|
|
el._ripple = el._ripple ?? {};
|
|
el._ripple.enabled = enabled;
|
|
el._ripple.centered = modifiers.center;
|
|
el._ripple.circle = modifiers.circle;
|
|
const bindingValue = isObject(value) ? value : {};
|
|
if (bindingValue.class) {
|
|
el._ripple.class = bindingValue.class;
|
|
}
|
|
const allowedKeys = bindingValue.keys ?? ["Enter", "Space"];
|
|
el._ripple.keyDownHandler = (e) => keyboardRippleShow(e, allowedKeys);
|
|
if (enabled && !wasEnabled) {
|
|
if (modifiers.stop) {
|
|
el.addEventListener("touchstart", rippleStop, {
|
|
passive: true
|
|
});
|
|
el.addEventListener("mousedown", rippleStop);
|
|
return;
|
|
}
|
|
el.addEventListener("touchstart", rippleShow, {
|
|
passive: true
|
|
});
|
|
el.addEventListener("touchend", rippleHide, {
|
|
passive: true
|
|
});
|
|
el.addEventListener("touchmove", rippleCancelShow, {
|
|
passive: true
|
|
});
|
|
el.addEventListener("touchcancel", rippleHide);
|
|
el.addEventListener("mousedown", rippleShow);
|
|
el.addEventListener("mouseup", rippleHide);
|
|
el.addEventListener("mouseleave", rippleHide);
|
|
el.addEventListener("keydown", (e) => keyboardRippleShow(e, allowedKeys));
|
|
el.addEventListener("keyup", keyboardRippleHide);
|
|
el.addEventListener("blur", focusRippleHide);
|
|
el.addEventListener("dragstart", rippleHide, {
|
|
passive: true
|
|
});
|
|
} else if (!enabled && wasEnabled) {
|
|
removeListeners(el);
|
|
}
|
|
}
|
|
function removeListeners(el) {
|
|
var _a;
|
|
el.removeEventListener("mousedown", rippleShow);
|
|
el.removeEventListener("touchstart", rippleShow);
|
|
el.removeEventListener("touchend", rippleHide);
|
|
el.removeEventListener("touchmove", rippleCancelShow);
|
|
el.removeEventListener("touchcancel", rippleHide);
|
|
el.removeEventListener("mouseup", rippleHide);
|
|
el.removeEventListener("mouseleave", rippleHide);
|
|
if ((_a = el._ripple) == null ? void 0 : _a.keyDownHandler) {
|
|
el.removeEventListener("keydown", el._ripple.keyDownHandler);
|
|
}
|
|
el.removeEventListener("keyup", keyboardRippleHide);
|
|
el.removeEventListener("dragstart", rippleHide);
|
|
el.removeEventListener("blur", focusRippleHide);
|
|
}
|
|
function mounted(el, binding) {
|
|
updateRipple(el, binding, false);
|
|
}
|
|
function unmounted(el) {
|
|
removeListeners(el);
|
|
delete el._ripple;
|
|
}
|
|
function updated(el, binding) {
|
|
if (binding.value === binding.oldValue) {
|
|
return;
|
|
}
|
|
const wasEnabled = isRippleEnabled(binding.oldValue);
|
|
updateRipple(el, binding, wasEnabled);
|
|
}
|
|
var Ripple = {
|
|
mounted,
|
|
unmounted,
|
|
updated
|
|
};
|
|
var ripple_default = Ripple;
|
|
|
|
// node_modules/vuetify/lib/components/VBtn/VBtn.js
|
|
var makeVBtnProps = propsFactory({
|
|
active: {
|
|
type: Boolean,
|
|
default: void 0
|
|
},
|
|
activeColor: String,
|
|
baseColor: String,
|
|
symbol: {
|
|
type: null,
|
|
default: VBtnToggleSymbol
|
|
},
|
|
flat: Boolean,
|
|
icon: [Boolean, String, Function, Object],
|
|
prependIcon: IconValue,
|
|
appendIcon: IconValue,
|
|
block: Boolean,
|
|
readonly: Boolean,
|
|
slim: Boolean,
|
|
stacked: Boolean,
|
|
ripple: {
|
|
type: [Boolean, Object],
|
|
default: true
|
|
},
|
|
text: {
|
|
type: [String, Number, Boolean],
|
|
default: void 0
|
|
},
|
|
...makeBorderProps(),
|
|
...makeComponentProps(),
|
|
...makeDensityProps(),
|
|
...makeDimensionProps(),
|
|
...makeElevationProps(),
|
|
...makeGroupItemProps(),
|
|
...makeLoaderProps(),
|
|
...makeLocationProps(),
|
|
...makePositionProps(),
|
|
...makeRoundedProps(),
|
|
...makeRouterProps(),
|
|
...makeSizeProps(),
|
|
...makeTagProps({
|
|
tag: "button"
|
|
}),
|
|
...makeThemeProps(),
|
|
...makeVariantProps({
|
|
variant: "elevated"
|
|
})
|
|
}, "VBtn");
|
|
var VBtn = genericComponent()({
|
|
name: "VBtn",
|
|
props: makeVBtnProps(),
|
|
emits: {
|
|
"group:selected": (val) => true
|
|
},
|
|
setup(props, _ref) {
|
|
let {
|
|
attrs,
|
|
slots
|
|
} = _ref;
|
|
const {
|
|
themeClasses
|
|
} = provideTheme(props);
|
|
const {
|
|
borderClasses
|
|
} = useBorder(props);
|
|
const {
|
|
densityClasses
|
|
} = useDensity(props);
|
|
const {
|
|
dimensionStyles
|
|
} = useDimension(props);
|
|
const {
|
|
elevationClasses
|
|
} = useElevation(props);
|
|
const {
|
|
loaderClasses
|
|
} = useLoader(props);
|
|
const {
|
|
locationStyles
|
|
} = useLocation(props);
|
|
const {
|
|
positionClasses
|
|
} = usePosition(props);
|
|
const {
|
|
roundedClasses
|
|
} = useRounded(props);
|
|
const {
|
|
sizeClasses,
|
|
sizeStyles
|
|
} = useSize(props);
|
|
const group = useGroupItem(props, props.symbol, false);
|
|
const link = useLink(props, attrs);
|
|
const isActive = computed(() => {
|
|
var _a;
|
|
if (props.active !== void 0) {
|
|
return props.active;
|
|
}
|
|
if (link.isLink.value) {
|
|
return (_a = link.isActive) == null ? void 0 : _a.value;
|
|
}
|
|
return group == null ? void 0 : group.isSelected.value;
|
|
});
|
|
const color = toRef(() => isActive.value ? props.activeColor ?? props.color : props.color);
|
|
const variantProps = computed(() => {
|
|
var _a, _b;
|
|
const showColor = (group == null ? void 0 : group.isSelected.value) && (!link.isLink.value || ((_a = link.isActive) == null ? void 0 : _a.value)) || !group || ((_b = link.isActive) == null ? void 0 : _b.value);
|
|
return {
|
|
color: showColor ? color.value ?? props.baseColor : props.baseColor,
|
|
variant: props.variant
|
|
};
|
|
});
|
|
const {
|
|
colorClasses,
|
|
colorStyles,
|
|
variantClasses
|
|
} = useVariant(variantProps);
|
|
const isDisabled = computed(() => (group == null ? void 0 : group.disabled.value) || props.disabled);
|
|
const isElevated = toRef(() => {
|
|
return props.variant === "elevated" && !(props.disabled || props.flat || props.border);
|
|
});
|
|
const valueAttr = computed(() => {
|
|
if (props.value === void 0 || typeof props.value === "symbol") return void 0;
|
|
return Object(props.value) === props.value ? JSON.stringify(props.value, null, 0) : props.value;
|
|
});
|
|
function onClick(e) {
|
|
var _a;
|
|
if (isDisabled.value || link.isLink.value && (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0 || attrs.target === "_blank")) return;
|
|
(_a = link.navigate) == null ? void 0 : _a.call(link, e);
|
|
group == null ? void 0 : group.toggle();
|
|
}
|
|
useSelectLink(link, group == null ? void 0 : group.select);
|
|
useRender(() => {
|
|
const Tag = link.isLink.value ? "a" : props.tag;
|
|
const hasPrepend = !!(props.prependIcon || slots.prepend);
|
|
const hasAppend = !!(props.appendIcon || slots.append);
|
|
const hasIcon = !!(props.icon && props.icon !== true);
|
|
return withDirectives(createVNode(Tag, mergeProps({
|
|
"type": Tag === "a" ? void 0 : "button",
|
|
"class": ["v-btn", group == null ? void 0 : group.selectedClass.value, {
|
|
"v-btn--active": isActive.value,
|
|
"v-btn--block": props.block,
|
|
"v-btn--disabled": isDisabled.value,
|
|
"v-btn--elevated": isElevated.value,
|
|
"v-btn--flat": props.flat,
|
|
"v-btn--icon": !!props.icon,
|
|
"v-btn--loading": props.loading,
|
|
"v-btn--readonly": props.readonly,
|
|
"v-btn--slim": props.slim,
|
|
"v-btn--stacked": props.stacked
|
|
}, themeClasses.value, borderClasses.value, colorClasses.value, densityClasses.value, elevationClasses.value, loaderClasses.value, positionClasses.value, roundedClasses.value, sizeClasses.value, variantClasses.value, props.class],
|
|
"style": [colorStyles.value, dimensionStyles.value, locationStyles.value, sizeStyles.value, props.style],
|
|
"aria-busy": props.loading ? true : void 0,
|
|
"disabled": isDisabled.value || void 0,
|
|
"tabindex": props.loading || props.readonly ? -1 : void 0,
|
|
"onClick": onClick,
|
|
"value": valueAttr.value
|
|
}, link.linkProps), {
|
|
default: () => {
|
|
var _a;
|
|
return [genOverlays(true, "v-btn"), !props.icon && hasPrepend && createBaseVNode("span", {
|
|
"key": "prepend",
|
|
"class": "v-btn__prepend"
|
|
}, [!slots.prepend ? createVNode(VIcon, {
|
|
"key": "prepend-icon",
|
|
"icon": props.prependIcon
|
|
}, null) : createVNode(VDefaultsProvider, {
|
|
"key": "prepend-defaults",
|
|
"disabled": !props.prependIcon,
|
|
"defaults": {
|
|
VIcon: {
|
|
icon: props.prependIcon
|
|
}
|
|
}
|
|
}, slots.prepend)]), createBaseVNode("span", {
|
|
"class": "v-btn__content",
|
|
"data-no-activator": ""
|
|
}, [!slots.default && hasIcon ? createVNode(VIcon, {
|
|
"key": "content-icon",
|
|
"icon": props.icon
|
|
}, null) : createVNode(VDefaultsProvider, {
|
|
"key": "content-defaults",
|
|
"disabled": !hasIcon,
|
|
"defaults": {
|
|
VIcon: {
|
|
icon: props.icon
|
|
}
|
|
}
|
|
}, {
|
|
default: () => {
|
|
var _a2;
|
|
return [((_a2 = slots.default) == null ? void 0 : _a2.call(slots)) ?? toDisplayString(props.text)];
|
|
}
|
|
})]), !props.icon && hasAppend && createBaseVNode("span", {
|
|
"key": "append",
|
|
"class": "v-btn__append"
|
|
}, [!slots.append ? createVNode(VIcon, {
|
|
"key": "append-icon",
|
|
"icon": props.appendIcon
|
|
}, null) : createVNode(VDefaultsProvider, {
|
|
"key": "append-defaults",
|
|
"disabled": !props.appendIcon,
|
|
"defaults": {
|
|
VIcon: {
|
|
icon: props.appendIcon
|
|
}
|
|
}
|
|
}, slots.append)]), !!props.loading && createBaseVNode("span", {
|
|
"key": "loader",
|
|
"class": "v-btn__loader"
|
|
}, [((_a = slots.loader) == null ? void 0 : _a.call(slots)) ?? createVNode(VProgressCircular, {
|
|
"color": typeof props.loading === "boolean" ? void 0 : props.loading,
|
|
"indeterminate": true,
|
|
"width": "2"
|
|
}, null)])];
|
|
}
|
|
}), [[ripple_default, !isDisabled.value && props.ripple, "", {
|
|
center: !!props.icon
|
|
}]]);
|
|
});
|
|
return {
|
|
group
|
|
};
|
|
}
|
|
});
|
|
export {
|
|
VBtn
|
|
};
|
|
//# sourceMappingURL=vuetify_components_VBtn.js.map
|