163 lines
4.4 KiB
JavaScript
163 lines
4.4 KiB
JavaScript
import {
|
|
VSelectionControl,
|
|
makeVSelectionControlProps
|
|
} from "./chunk-KHWE4FHS.js";
|
|
import {
|
|
VInput,
|
|
makeVInputProps,
|
|
useFocus
|
|
} from "./chunk-IK67YVHF.js";
|
|
import {
|
|
forwardRefs
|
|
} from "./chunk-GUNW7S2L.js";
|
|
import {
|
|
IconValue
|
|
} from "./chunk-OJDZBU5D.js";
|
|
import {
|
|
useProxiedModel
|
|
} from "./chunk-KA77II4V.js";
|
|
import {
|
|
filterInputAttrs,
|
|
genericComponent,
|
|
omit,
|
|
propsFactory,
|
|
useRender
|
|
} from "./chunk-LZ5T2ERG.js";
|
|
import {
|
|
createVNode,
|
|
mergeProps,
|
|
ref,
|
|
toRef,
|
|
useId
|
|
} from "./chunk-2MKFL3BX.js";
|
|
|
|
// node_modules/vuetify/lib/components/VCheckbox/VCheckbox.js
|
|
import "/home/david/gitea_repo/personal_development/ServerManagerWebApp/frontend/node_modules/vuetify/lib/components/VCheckbox/VCheckbox.css";
|
|
|
|
// node_modules/vuetify/lib/components/VCheckbox/VCheckboxBtn.js
|
|
var makeVCheckboxBtnProps = propsFactory({
|
|
indeterminate: Boolean,
|
|
indeterminateIcon: {
|
|
type: IconValue,
|
|
default: "$checkboxIndeterminate"
|
|
},
|
|
...makeVSelectionControlProps({
|
|
falseIcon: "$checkboxOff",
|
|
trueIcon: "$checkboxOn"
|
|
})
|
|
}, "VCheckboxBtn");
|
|
var VCheckboxBtn = genericComponent()({
|
|
name: "VCheckboxBtn",
|
|
props: makeVCheckboxBtnProps(),
|
|
emits: {
|
|
"update:modelValue": (value) => true,
|
|
"update:indeterminate": (value) => true
|
|
},
|
|
setup(props, _ref) {
|
|
let {
|
|
slots
|
|
} = _ref;
|
|
const indeterminate = useProxiedModel(props, "indeterminate");
|
|
const model = useProxiedModel(props, "modelValue");
|
|
function onChange(v) {
|
|
if (indeterminate.value) {
|
|
indeterminate.value = false;
|
|
}
|
|
}
|
|
const falseIcon = toRef(() => {
|
|
return indeterminate.value ? props.indeterminateIcon : props.falseIcon;
|
|
});
|
|
const trueIcon = toRef(() => {
|
|
return indeterminate.value ? props.indeterminateIcon : props.trueIcon;
|
|
});
|
|
useRender(() => {
|
|
const controlProps = omit(VSelectionControl.filterProps(props), ["modelValue"]);
|
|
return createVNode(VSelectionControl, mergeProps(controlProps, {
|
|
"modelValue": model.value,
|
|
"onUpdate:modelValue": [($event) => model.value = $event, onChange],
|
|
"class": ["v-checkbox-btn", props.class],
|
|
"style": props.style,
|
|
"type": "checkbox",
|
|
"falseIcon": falseIcon.value,
|
|
"trueIcon": trueIcon.value,
|
|
"aria-checked": indeterminate.value ? "mixed" : void 0
|
|
}), slots);
|
|
});
|
|
return {};
|
|
}
|
|
});
|
|
|
|
// node_modules/vuetify/lib/components/VCheckbox/VCheckbox.js
|
|
var makeVCheckboxProps = propsFactory({
|
|
...makeVInputProps(),
|
|
...omit(makeVCheckboxBtnProps(), ["inline"])
|
|
}, "VCheckbox");
|
|
var VCheckbox = genericComponent()({
|
|
name: "VCheckbox",
|
|
inheritAttrs: false,
|
|
props: makeVCheckboxProps(),
|
|
emits: {
|
|
"update:modelValue": (value) => true,
|
|
"update:focused": (focused) => true
|
|
},
|
|
setup(props, _ref) {
|
|
let {
|
|
attrs,
|
|
slots
|
|
} = _ref;
|
|
const model = useProxiedModel(props, "modelValue");
|
|
const {
|
|
isFocused,
|
|
focus,
|
|
blur
|
|
} = useFocus(props);
|
|
const inputRef = ref();
|
|
const uid = useId();
|
|
useRender(() => {
|
|
const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
|
|
const inputProps = VInput.filterProps(props);
|
|
const checkboxProps = VCheckboxBtn.filterProps(props);
|
|
return createVNode(VInput, mergeProps({
|
|
"ref": inputRef,
|
|
"class": ["v-checkbox", props.class]
|
|
}, rootAttrs, inputProps, {
|
|
"modelValue": model.value,
|
|
"onUpdate:modelValue": ($event) => model.value = $event,
|
|
"id": props.id || `checkbox-${uid}`,
|
|
"focused": isFocused.value,
|
|
"style": props.style
|
|
}), {
|
|
...slots,
|
|
default: (_ref2) => {
|
|
let {
|
|
id,
|
|
messagesId,
|
|
isDisabled,
|
|
isReadonly,
|
|
isValid
|
|
} = _ref2;
|
|
return createVNode(VCheckboxBtn, mergeProps(checkboxProps, {
|
|
"id": id.value,
|
|
"aria-describedby": messagesId.value,
|
|
"disabled": isDisabled.value,
|
|
"readonly": isReadonly.value
|
|
}, controlAttrs, {
|
|
"error": isValid.value === false,
|
|
"modelValue": model.value,
|
|
"onUpdate:modelValue": ($event) => model.value = $event,
|
|
"onFocus": focus,
|
|
"onBlur": blur
|
|
}), slots);
|
|
}
|
|
});
|
|
});
|
|
return forwardRefs({}, inputRef);
|
|
}
|
|
});
|
|
|
|
export {
|
|
VCheckboxBtn,
|
|
VCheckbox
|
|
};
|
|
//# sourceMappingURL=chunk-6HLLVLOR.js.map
|