import { QInput } from './QInput-a81d9a9f.js';
import { computed, ref, watch, openBlock, createBlock, createSlots, withCtx, renderSlot, unref } from './__federation_expose_Modules-a9c6a6fc.js';

const _sfc_main = {
  __name: 'DefaultTextField',
  props: {
    label: {
      type: String,
      default: undefined
    },
    placeholder: {
      type: String,
      default: ""
    },
    modelValue: {
      type: String,
      default: ""
    },
    rules: {
      type: Array,
      default: () => []
    }
  },
  emits: ["update:modelValue"],
  setup(__props, {
    expose,
    emit
  }) {
    const props = __props;
    const label = computed(() => props.label);
    const localValue = ref(props.modelValue);
    watch(localValue, value => {
      emit("update:modelValue", value);
    });
    const inputRef = ref(null);
    function validate() {
      inputRef.value.validate();
    }
    expose({
      validate
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(QInput, {
        ref_key: "inputRef",
        ref: inputRef,
        modelValue: localValue.value,
        "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => localValue.value = $event),
        label: unref(label),
        rules: props.rules,
        placeholder: props.placeholder,
        "lazy-rules": "",
        outlined: "",
        dense: ""
      }, createSlots({
        append: withCtx(() => [renderSlot(_ctx.$slots, "append")]),
        _: 2
      }, [!!_ctx.$slots.prepend ? {
        name: "prepend",
        fn: withCtx(() => [renderSlot(_ctx.$slots, "prepend")]),
        key: "0"
      } : undefined]), 1032, ["modelValue", "label", "rules", "placeholder"]);
    };
  }
};

export { _sfc_main };
