export default {
  props: {
    label: {
      type: String,
      default: "Label Required",
    },
    placeholder: {
      type: String,
      default: "Placeholder",
    },
    tooltip: {
      type: String,
      default: null,
    },
    focus: {
      type: Boolean,
      default: false,
    },
    errorText: {
      type: String,
      default: "",
    },
    error: {
      default: "",
    },
    success: {
      type: Boolean,
      default: false,
    },
    disabled: {
      type: Boolean,
      default: false,
    },
    info: {
      type: String,
      default: "",
    },
    icon: {
      type: String,
      default: "",
    },
    type: {
      type: String,
      default: "",
    },

    search: {
      type: Boolean,
      default: true,
    },
    value: {
      default: "",
    },
    modelValue: {
      default: null,
    },
    // type: {
    //   default: null,
    // },
  },
  computed: {
    states() {
      return {
        error: this.error,
        success: this.success,
        disabled: this.disabled,
      };
    },
    formProps() {
      return {
        class: {
          error: this.error,
          success: this.success,
          disabled: this.disabled,
        },
        info: this.info,
        label: this.label,
        tooltip: this.tooltip,
        error: this.error,
        disabled: this.disabled,
      };
    },
  },
  methods: {
    submit() {
      if (!this.disabled) {
        this.$emit("submit");
      }
    },
  },
};
