<template>
  <input
    :id="id"
    :disabled="disabled"
    :type="type"
    min="0"
    max="999"
    :class="{ error: error }"
    :name="`input_${id}`"
    :required="required"
    :placeholder="placeholder"
    :value="value"
    @keyup.enter="$emit('setter', $event.target.value)"
    @input="
      $emit('setter', $event.target.value);
      $emit('removeError', id);
    "
    @focusout="$emit('out', $event.target.value)"
  />
</template>

<script>
export default {
  name: "InputMoney",
  props: {
    id: { type: String, required: true },
    type: { type: String, required: true },
    placeholder: { type: String, required: false },
    error: { type: Boolean, required: false, default: false },
    required: { type: Boolean, required: false, default: false },
    disabled: { type: Boolean, required: false, default: false },
    value: { type: [Number, String], required: false, default: null },
    label: { type: String, required: false, default: null },
  },
};
</script>
