forked from jchomaz/Vulture
Tracking de l'application VApp (IHM du jeu)
This commit is contained in:
59
VApp/node_modules/vuetify/lib/components/VCheckbox/VCheckboxBtn.mjs
generated
vendored
Normal file
59
VApp/node_modules/vuetify/lib/components/VCheckbox/VCheckboxBtn.mjs
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { createVNode as _createVNode, mergeProps as _mergeProps, resolveDirective as _resolveDirective } from "vue";
|
||||
// Components
|
||||
import { makeVSelectionControlProps, VSelectionControl } from "../VSelectionControl/VSelectionControl.mjs"; // Composables
|
||||
import { IconValue } from "../../composables/icons.mjs";
|
||||
import { useProxiedModel } from "../../composables/proxiedModel.mjs"; // Utilities
|
||||
import { computed } from 'vue';
|
||||
import { genericComponent, omit, propsFactory, useRender } from "../../util/index.mjs"; // Types
|
||||
export const makeVCheckboxBtnProps = propsFactory({
|
||||
indeterminate: Boolean,
|
||||
indeterminateIcon: {
|
||||
type: IconValue,
|
||||
default: '$checkboxIndeterminate'
|
||||
},
|
||||
...makeVSelectionControlProps({
|
||||
falseIcon: '$checkboxOff',
|
||||
trueIcon: '$checkboxOn'
|
||||
})
|
||||
}, 'VCheckboxBtn');
|
||||
export const 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 = computed(() => {
|
||||
return indeterminate.value ? props.indeterminateIcon : props.falseIcon;
|
||||
});
|
||||
const trueIcon = computed(() => {
|
||||
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' : undefined
|
||||
}), slots);
|
||||
});
|
||||
return {};
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=VCheckboxBtn.mjs.map
|
||||
Reference in New Issue
Block a user