<script setup lang="ts">
import type { KbxFieldState } from '@kbx/contracts'
import KbxNumberField from './KbxNumberField.vue'
withDefaults(defineProps<{modelValue?:number|null;label:string;required?:boolean;readonly?:boolean;disabled?:boolean;error?:string;warning?:string;helpText?:string;state?:KbxFieldState;precision?:number;currency?:string;allowNegative?:boolean;zeroAllowed?:boolean}>(),{precision:0,currency:'원',allowNegative:false,zeroAllowed:true,state:'default'})
const emit=defineEmits<{ 'update:modelValue':[number|null] }>()
</script>
<template><KbxNumberField :model-value="modelValue" :label="label" :required="required" :readonly="readonly" :disabled="disabled" :error="error" :warning="warning" :help-text="helpText" :state="state" :precision="precision" :min="allowNegative?undefined:(zeroAllowed?0:Number.MIN_VALUE)" :suffix="currency" @update:model-value="emit('update:modelValue',$event)" /></template>
