318 lines
11 KiB
JavaScript
318 lines
11 KiB
JavaScript
import { Cn as withDirectives, Dt as mergeProps, Ot as nextTick, Qn as toRef, U as computed, W as createBaseVNode, ar as normalizeClass, cr as toDisplayString, et as createVNode, gn as watch, sr as normalizeStyle } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
|
|
import { a as provideDefaults, 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 { i as provideTheme, r as makeThemeProps } from "./theme-Cx5kFg0-.js";
|
|
import { n as IconValue } from "./icons-k2ZLE_i8.js";
|
|
import { t as makeTagProps } from "./tag-C_KkCPzB.js";
|
|
import { t as VDefaultsProvider } from "./VDefaultsProvider-C09t4-My.js";
|
|
import { n as useDimension, t as makeDimensionProps } from "./dimensions-BDdmuRdK.js";
|
|
import { n as useRounded, t as makeRoundedProps } from "./rounded-BuPGKRa9.js";
|
|
import { n as useBorder, t as makeBorderProps } from "./border-jCmRyoxP.js";
|
|
import { n as useElevation, t as makeElevationProps } from "./elevation-B0TH2wU6.js";
|
|
import { n as useLocation, t as makeLocationProps } from "./location-BIKTnDF4.js";
|
|
import { n as useDensity, t as makeDensityProps } from "./density-CpKZ5PhP.js";
|
|
import { n as makeVariantProps, r as useVariant, t as genOverlays } from "./variant-CqXtG9Ih.js";
|
|
import { i as useGroupItem, n as makeGroupProps, r as useGroup, t as makeGroupItemProps } from "./group-Cm2viEWK.js";
|
|
import { n as makeSizeProps, r as useSize, t as VIcon } from "./VIcon-1CJH_3Uo.js";
|
|
import { n as makeLoaderProps, r as useLoader } from "./loader-CV4sMFhE.js";
|
|
import { t as VProgressCircular } from "./VProgressCircular-yKv2qs75.js";
|
|
import { n as usePosition, t as makePositionProps } from "./position-BCUsnxVO.js";
|
|
import { r as useLink, t as makeRouterProps } from "./router-D_jP4Uwb.js";
|
|
import { t as Ripple } from "./ripple-Z40rPDte.js";
|
|
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VBtn/VBtn.css";
|
|
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VBtnToggle/VBtnToggle.css";
|
|
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VBtnGroup/VBtnGroup.css";
|
|
//#region 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, { slots }) {
|
|
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);
|
|
});
|
|
}
|
|
});
|
|
//#endregion
|
|
//#region node_modules/vuetify/lib/components/VBtnToggle/VBtnToggle.js
|
|
var VBtnToggleSymbol = Symbol.for("vuetify:v-btn-toggle");
|
|
var makeVBtnToggleProps = propsFactory({
|
|
...makeVBtnGroupProps(),
|
|
...makeGroupProps()
|
|
}, "VBtnToggle");
|
|
genericComponent()({
|
|
name: "VBtnToggle",
|
|
props: makeVBtnToggleProps(),
|
|
emits: { "update:modelValue": (value) => true },
|
|
setup(props, { slots }) {
|
|
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: () => [slots.default?.({
|
|
isSelected,
|
|
next,
|
|
prev,
|
|
select,
|
|
selected
|
|
})] });
|
|
});
|
|
return {
|
|
next,
|
|
prev,
|
|
select
|
|
};
|
|
}
|
|
});
|
|
//#endregion
|
|
//#region node_modules/vuetify/lib/composables/selectLink.js
|
|
function useSelectLink(link, select) {
|
|
watch(() => link.isActive?.value, (isActive) => {
|
|
if (link.isLink.value && isActive != null && select) nextTick(() => {
|
|
select(isActive);
|
|
});
|
|
}, { immediate: true });
|
|
}
|
|
//#endregion
|
|
//#region 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,
|
|
spaced: String,
|
|
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, { attrs, slots }) {
|
|
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(() => {
|
|
if (props.active !== void 0) return props.active;
|
|
if (link.isRouterLink.value) return link.isActive?.value;
|
|
return group?.isSelected.value;
|
|
});
|
|
const color = toRef(() => isActive.value ? props.activeColor ?? props.color : props.color);
|
|
const { colorClasses, colorStyles, variantClasses } = useVariant(computed(() => {
|
|
return {
|
|
color: group?.isSelected.value && (!link.isLink.value || link.isActive?.value) || !group || link.isActive?.value ? color.value ?? props.baseColor : props.baseColor,
|
|
variant: props.variant
|
|
};
|
|
}));
|
|
const isDisabled = computed(() => 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) {
|
|
if (isDisabled.value || link.isLink.value && (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0 || attrs.target === "_blank")) return;
|
|
if (link.isRouterLink.value) link.navigate.value?.(e);
|
|
else group?.toggle();
|
|
}
|
|
useSelectLink(link, 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(link.linkProps, {
|
|
"type": Tag === "a" ? void 0 : "button",
|
|
"class": [
|
|
"v-btn",
|
|
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
|
|
},
|
|
props.spaced ? ["v-btn--spaced", `v-btn--spaced-${props.spaced}`] : [],
|
|
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 && Tag !== "a" || void 0,
|
|
"tabindex": props.loading || props.readonly ? -1 : void 0,
|
|
"onClick": onClick,
|
|
"value": valueAttr.value
|
|
}), { default: () => [
|
|
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: () => [slots.default?.() ?? 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"
|
|
}, [slots.loader?.() ?? createVNode(VProgressCircular, {
|
|
"color": typeof props.loading === "boolean" ? void 0 : props.loading,
|
|
"indeterminate": true,
|
|
"width": "2"
|
|
}, null)])
|
|
] }), [[
|
|
Ripple,
|
|
!isDisabled.value && props.ripple,
|
|
"",
|
|
{ center: !!props.icon }
|
|
]]);
|
|
});
|
|
return { group };
|
|
}
|
|
});
|
|
//#endregion
|
|
export { makeVBtnProps as n, VBtn as t };
|
|
|
|
//# sourceMappingURL=VBtn-BZzD9gwE.js.map
|