* Update AttachControl.vue * Update ButtonControl.vue * Update CheckControl.vue * Update CodeControl.vue * Update DataControl.vue * Update ImageControl.vue * Update LinkControl.vue * Update RatingControl.vue * Update SelectControl.vue * Update SignatureControl.vue * Update TableControl.vue * Update TextControl.vue * Update TextEditorControl.vue * Update Section.vue * Update Column.vue * Update Tabs.vue * Update Field.vue * Update Sidebar.vue * Update AddFieldButton.vue * Update AddFieldButton.vue * Update Section.vue * Update WorkflowBuilder.vue * Update Autocomplete.vue * Update EditableInput.vue * Update AttachControl.vue * Update ButtonControl.vue * Update CheckControl.vue * Update CodeControl.vue * Update DataControl.vue * Update ImageControl.vue * Update LinkControl.vue * Update RatingControl.vue * Update SelectControl.vue * Update SignatureControl.vue * Update TextControl.vue * Update TextEditorControl.vue * Update Field.vue * Update EditableInput.vue * Update TableControl.vue * Update Column.vue * fix: variable in translatable string * fix: add context for row number label * fix: translate labels in workflow builder * style: formatting --------- Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com> Co-authored-by: Ankush Menat <ankush@frappe.io>
51 lines
1.1 KiB
Vue
51 lines
1.1 KiB
Vue
<script setup>
|
|
import { useSlots } from "vue";
|
|
|
|
const props = defineProps(["df", "value", "read_only"]);
|
|
let slots = useSlots();
|
|
</script>
|
|
|
|
<template>
|
|
<div class="control frappe-control checkbox" :class="{ editable: slots.label }">
|
|
<!-- checkbox -->
|
|
<label v-if="slots.label" class="field-controls">
|
|
<div class="checkbox">
|
|
<input type="checkbox" disabled />
|
|
<slot name="label" />
|
|
</div>
|
|
<slot name="actions" />
|
|
</label>
|
|
<label v-else>
|
|
<input
|
|
type="checkbox"
|
|
:checked="value"
|
|
:disabled="read_only"
|
|
@change="(event) => $emit('update:modelValue', event.target.checked)"
|
|
/>
|
|
<span class="label-area" :class="{ reqd: df.reqd }">{{ __(df.label) }}</span>
|
|
</label>
|
|
|
|
<!-- description -->
|
|
<div v-if="df.description" class="mt-2 description" v-html="df.description"></div>
|
|
</div>
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
label,
|
|
input {
|
|
margin-bottom: 0 !important;
|
|
cursor: pointer;
|
|
}
|
|
|
|
label .checkbox {
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
input {
|
|
background-color: var(--fg-color);
|
|
box-shadow: none;
|
|
border: 1px solid var(--gray-400);
|
|
pointer-events: none;
|
|
}
|
|
}
|
|
</style>
|