<baht-currency>
Money input: plain digits while typing, thousands-separated on blur. Emits a plain number | null, same wire shape as <baht-number> (spec 01 §2).
Basic
Events (name)
<baht-currency></baht-currency>
<script>
const el = document.querySelector('baht-currency');
el.field = {
"order": 1,
"type": "currency",
"key": "amount",
"label": "Amount",
"placeholder": "0.00"
};
el.value = 13720.5;
</script>| Name | Type | Default | Description |
|---|---|---|---|
fieldJS | FieldDescriptor | — | Field spec: { order, type: 'currency', key, label?, placeholder?, … } |
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 — value is number | null, commas stripped |