<template>
  <b-field
    :class="column ? `column ${columnSize} mb-0 pb-0` : ''"
    :label="label || 'Módulo'"
  >
    <b-input
      icon="store"
      placeholder="Nombre del módulo"
      type="text"
      :disabled="disabled"
      @keyup.enter.native="ejecutar()"
      v-model="modulo"
      rounded
    />
  </b-field>
</template>

<script>
export default {
  props: {
    column: { type: Boolean, required: false, default: false },
    disabled: { type: Boolean, required: false, default: false },
    ejecutar: {
      typeof: Function,
      required: false,
      default: () => function () {},
    },
    columnSize: { typeof: String, required: false, default: '' },
    moduloPadre: { typeof: String, required: true, default: '' },
    label: { typeof: String, required: false, default: '' },
  },
  data: () => {
    return { modulo: '' }
  },
  watch: {
    modulo() {
      this.$emit('modulo', this.modulo)
    },
    moduloPadre() {
      this.modulo = this.moduloPadre
    },
  },
}
</script>

<style scoped></style>
