<baht-number>
Numeric input. Emits null when cleared. min/max/step from field.
Basic
Events (name)
<baht-number></baht-number>
<script>
const el = document.querySelector('baht-number');
el.field = {
"order": 1,
"type": "number",
"key": "qty",
"label": "Quantity",
"min": 0,
"max": 99,
"step": 1
};
el.value = 1;
</script>| Name | Type | Default | Description |
|---|---|---|---|
fieldJS | FieldDescriptor | — | Field spec: { order, type, key, label?, placeholder?, options?, … } |
valueJS | unknown | null | Controlled value. Re-feed on every baht-input |
disabled | boolean | false | Disable the control |
readonly | boolean | false | Read-only |
required | boolean | false | Show required mark |
show-optional | boolean | false | Append the localized "(optional)" marker to the label when not required (set by <baht-form show-optional>). |
errorJS | string | null | null | Validation message to display |
debounce | number | undefined | 150 (BahtFieldBase.defaultDebounce) | Quiet time (ms) before typing reaches the host as baht-input. Blur flushes at once. 0 = every keystroke. <baht-form options.inputDebounce> sets it form-wide |
Events
Section titled “Events”| Event | detail | Description |
|---|---|---|
name | CustomEvent | |
baht-input | { key, value } | Fired on every user edit |