* 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>
47 lines
1.2 KiB
Vue
47 lines
1.2 KiB
Vue
<!-- Used as Text, Small Text & Long Text Control -->
|
|
<script setup>
|
|
import { useSlots, computed } from "vue";
|
|
|
|
const props = defineProps(["df", "value", "read_only", "modelValue"]);
|
|
let emit = defineEmits(["update:modelValue"]);
|
|
let slots = useSlots();
|
|
|
|
let height = computed(() => {
|
|
if (props.df.fieldtype == "Small Text") {
|
|
return "150px";
|
|
}
|
|
return "300px";
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div class="control" :class="{ editable: slots.label }">
|
|
<!-- label -->
|
|
<div v-if="slots.label" class="field-controls">
|
|
<slot name="label" />
|
|
<slot name="actions" />
|
|
</div>
|
|
<div v-else class="control-label label">{{ __(df.label) }}</div>
|
|
|
|
<!-- textarea input -->
|
|
<textarea
|
|
v-if="slots.label"
|
|
:style="{ height: height, maxHeight: df.max_height ?? '' }"
|
|
class="form-control"
|
|
type="text"
|
|
readonly
|
|
/>
|
|
<textarea
|
|
v-else
|
|
:style="{ height: height, maxHeight: df.max_height ?? '' }"
|
|
class="form-control"
|
|
type="text"
|
|
:value="value"
|
|
:disabled="read_only || df.read_only"
|
|
@input="(event) => $emit('update:modelValue', event.target.value)"
|
|
/>
|
|
|
|
<!-- description -->
|
|
<div v-if="df.description" class="mt-2 description" v-html="df.description"></div>
|
|
</div>
|
|
</template>
|