major server manager overhaul
This commit is contained in:
+226
@@ -0,0 +1,226 @@
|
||||
import {
|
||||
VSelectionControl,
|
||||
makeVSelectionControlProps
|
||||
} from "./chunk-KHWE4FHS.js";
|
||||
import {
|
||||
VInput,
|
||||
makeVInputProps,
|
||||
useFocus
|
||||
} from "./chunk-IK67YVHF.js";
|
||||
import {
|
||||
VScaleTransition
|
||||
} from "./chunk-B4JFJDWM.js";
|
||||
import {
|
||||
forwardRefs
|
||||
} from "./chunk-GUNW7S2L.js";
|
||||
import {
|
||||
VProgressCircular
|
||||
} from "./chunk-MH76ZJYE.js";
|
||||
import {
|
||||
LoaderSlot,
|
||||
useLoader
|
||||
} from "./chunk-UXZ55AO7.js";
|
||||
import {
|
||||
VIcon
|
||||
} from "./chunk-4XZHKYGH.js";
|
||||
import {
|
||||
VDefaultsProvider
|
||||
} from "./chunk-PAT7NP2Z.js";
|
||||
import {
|
||||
useProxiedModel
|
||||
} from "./chunk-KA77II4V.js";
|
||||
import {
|
||||
SUPPORTS_MATCH_MEDIA,
|
||||
filterInputAttrs,
|
||||
genericComponent,
|
||||
propsFactory,
|
||||
useRender
|
||||
} from "./chunk-LZ5T2ERG.js";
|
||||
import {
|
||||
Fragment,
|
||||
createBaseVNode,
|
||||
createVNode,
|
||||
mergeProps,
|
||||
normalizeClass,
|
||||
normalizeStyle,
|
||||
ref,
|
||||
toRef,
|
||||
useId
|
||||
} from "./chunk-2MKFL3BX.js";
|
||||
|
||||
// node_modules/vuetify/lib/components/VSwitch/VSwitch.js
|
||||
import "/home/david/gitea_repo/personal_development/ServerManagerWebApp/frontend/node_modules/vuetify/lib/components/VSwitch/VSwitch.css";
|
||||
var makeVSwitchProps = propsFactory({
|
||||
indeterminate: Boolean,
|
||||
inset: Boolean,
|
||||
flat: Boolean,
|
||||
loading: {
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
},
|
||||
...makeVInputProps(),
|
||||
...makeVSelectionControlProps()
|
||||
}, "VSwitch");
|
||||
var VSwitch = genericComponent()({
|
||||
name: "VSwitch",
|
||||
inheritAttrs: false,
|
||||
props: makeVSwitchProps(),
|
||||
emits: {
|
||||
"update:focused": (focused) => true,
|
||||
"update:modelValue": (value) => true,
|
||||
"update:indeterminate": (value) => true
|
||||
},
|
||||
setup(props, _ref) {
|
||||
let {
|
||||
attrs,
|
||||
slots
|
||||
} = _ref;
|
||||
const indeterminate = useProxiedModel(props, "indeterminate");
|
||||
const model = useProxiedModel(props, "modelValue");
|
||||
const {
|
||||
loaderClasses
|
||||
} = useLoader(props);
|
||||
const {
|
||||
isFocused,
|
||||
focus,
|
||||
blur
|
||||
} = useFocus(props);
|
||||
const control = ref();
|
||||
const inputRef = ref();
|
||||
const isForcedColorsModeActive = SUPPORTS_MATCH_MEDIA && window.matchMedia("(forced-colors: active)").matches;
|
||||
const loaderColor = toRef(() => {
|
||||
return typeof props.loading === "string" && props.loading !== "" ? props.loading : props.color;
|
||||
});
|
||||
const uid = useId();
|
||||
const id = toRef(() => props.id || `switch-${uid}`);
|
||||
function onChange() {
|
||||
if (indeterminate.value) {
|
||||
indeterminate.value = false;
|
||||
}
|
||||
}
|
||||
function onTrackClick(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
control.value?.input?.click();
|
||||
}
|
||||
useRender(() => {
|
||||
const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
|
||||
const inputProps = VInput.filterProps(props);
|
||||
const controlProps = VSelectionControl.filterProps(props);
|
||||
return createVNode(VInput, mergeProps({
|
||||
"ref": inputRef,
|
||||
"class": ["v-switch", {
|
||||
"v-switch--flat": props.flat
|
||||
}, {
|
||||
"v-switch--inset": props.inset
|
||||
}, {
|
||||
"v-switch--indeterminate": indeterminate.value
|
||||
}, loaderClasses.value, props.class]
|
||||
}, rootAttrs, inputProps, {
|
||||
"modelValue": model.value,
|
||||
"onUpdate:modelValue": ($event) => model.value = $event,
|
||||
"id": id.value,
|
||||
"focused": isFocused.value,
|
||||
"style": props.style
|
||||
}), {
|
||||
...slots,
|
||||
default: (_ref2) => {
|
||||
let {
|
||||
id: id2,
|
||||
messagesId,
|
||||
isDisabled,
|
||||
isReadonly,
|
||||
isValid
|
||||
} = _ref2;
|
||||
const slotProps = {
|
||||
model,
|
||||
isValid
|
||||
};
|
||||
return createVNode(VSelectionControl, mergeProps({
|
||||
"ref": control
|
||||
}, controlProps, {
|
||||
"modelValue": model.value,
|
||||
"onUpdate:modelValue": [($event) => model.value = $event, onChange],
|
||||
"id": id2.value,
|
||||
"aria-describedby": messagesId.value,
|
||||
"type": "checkbox",
|
||||
"aria-checked": indeterminate.value ? "mixed" : void 0,
|
||||
"disabled": isDisabled.value,
|
||||
"readonly": isReadonly.value,
|
||||
"onFocus": focus,
|
||||
"onBlur": blur
|
||||
}, controlAttrs), {
|
||||
...slots,
|
||||
default: (_ref3) => {
|
||||
let {
|
||||
backgroundColorClasses,
|
||||
backgroundColorStyles
|
||||
} = _ref3;
|
||||
return createBaseVNode("div", {
|
||||
"class": normalizeClass(["v-switch__track", !isForcedColorsModeActive ? backgroundColorClasses.value : void 0]),
|
||||
"style": normalizeStyle(backgroundColorStyles.value),
|
||||
"onClick": onTrackClick
|
||||
}, [slots["track-true"] && createBaseVNode("div", {
|
||||
"key": "prepend",
|
||||
"class": "v-switch__track-true"
|
||||
}, [slots["track-true"](slotProps)]), slots["track-false"] && createBaseVNode("div", {
|
||||
"key": "append",
|
||||
"class": "v-switch__track-false"
|
||||
}, [slots["track-false"](slotProps)])]);
|
||||
},
|
||||
input: (_ref4) => {
|
||||
let {
|
||||
inputNode,
|
||||
icon,
|
||||
backgroundColorClasses,
|
||||
backgroundColorStyles
|
||||
} = _ref4;
|
||||
return createBaseVNode(Fragment, null, [inputNode, createBaseVNode("div", {
|
||||
"class": normalizeClass(["v-switch__thumb", {
|
||||
"v-switch__thumb--filled": icon || props.loading
|
||||
}, props.inset || isForcedColorsModeActive ? void 0 : backgroundColorClasses.value]),
|
||||
"style": normalizeStyle(props.inset ? void 0 : backgroundColorStyles.value)
|
||||
}, [slots.thumb ? createVNode(VDefaultsProvider, {
|
||||
"defaults": {
|
||||
VIcon: {
|
||||
icon,
|
||||
size: "x-small"
|
||||
}
|
||||
}
|
||||
}, {
|
||||
default: () => [slots.thumb({
|
||||
...slotProps,
|
||||
icon
|
||||
})]
|
||||
}) : createVNode(VScaleTransition, null, {
|
||||
default: () => [!props.loading ? icon && createVNode(VIcon, {
|
||||
"key": String(icon),
|
||||
"icon": icon,
|
||||
"size": "x-small"
|
||||
}, null) : createVNode(LoaderSlot, {
|
||||
"name": "v-switch",
|
||||
"active": true,
|
||||
"color": isValid.value === false ? void 0 : loaderColor.value
|
||||
}, {
|
||||
default: (slotProps2) => slots.loader ? slots.loader(slotProps2) : createVNode(VProgressCircular, {
|
||||
"active": slotProps2.isActive,
|
||||
"color": slotProps2.color,
|
||||
"indeterminate": true,
|
||||
"size": "16",
|
||||
"width": "2"
|
||||
}, null)
|
||||
})]
|
||||
})])]);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
return forwardRefs({}, inputRef);
|
||||
}
|
||||
});
|
||||
|
||||
export {
|
||||
VSwitch
|
||||
};
|
||||
//# sourceMappingURL=chunk-L7BQJLEW.js.map
|
||||
Reference in New Issue
Block a user