<script setup>
import Checkbox from "primevue/checkbox";

const props = defineProps({
  modelValue: { type: Boolean, default: false },
  disabled: { type: Boolean, default: false },
  readonly: { type: Boolean, default: false },
  indeterminate: { type: Boolean, default: false },
  inputId: { type: String, default: undefined },
  class: { type: [String, Object, Array], default: "" },
});

defineOptions({ inheritAttrs: false });

const emit = defineEmits(["update:modelValue", "change", "focus", "blur"]);
</script>

<template>
  <Checkbox
    v-bind="$attrs"
    binary
    :input-id="inputId"
    :model-value="modelValue"
    :disabled="disabled"
    :readonly="readonly"
    :indeterminate="indeterminate"
    :class="['base-success-checkbox shrink-0 self-center', props.class]"
    @update:model-value="emit('update:modelValue', $event)"
    @change="emit('change', $event)"
    @focus="emit('focus', $event)"
    @blur="emit('blur', $event)"
  />
</template>
