<script setup>
import { computed, ref } from "vue";
import { useErrorMessage } from "./useErrorMessage";
import { useRequiredLabel } from "./useRequiredLabel";
const props = defineProps({
  context: Object
});
const error = ref(false);
const errorMessage = ref("");
useErrorMessage(props.context.node, error, errorMessage);
const label = useRequiredLabel(props.context);
const value = computed({
  get: () => props.context.value,
  set: (val) => props.context.node.input(val)
});
</script>

<template>
    <l-input-xlsx v-model="value" :label="label" v-bind="context.attrs" :error="error" :type="context.inputType"
        :error-message="errorMessage">
        <slot></slot>
    </l-input-xlsx>
</template>
