Skip to content
bahtuiv0.6.0

<baht-number>

Numeric input. Emits null when cleared. min/max/step from field.

Basic

<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>
NameTypeDefaultDescription
fieldJSFieldDescriptorField spec: { order, type, key, label?, placeholder?, options?, … }
valueJSunknownnullControlled value. Re-feed on every baht-input
disabledbooleanfalseDisable the control
readonlybooleanfalseRead-only
requiredbooleanfalseShow required mark
show-optionalbooleanfalseAppend the localized "(optional)" marker to the label when not required (set by <baht-form show-optional>).
errorJSstring | nullnullValidation message to display
debouncenumber | undefined150 (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
EventdetailDescription
nameCustomEvent
baht-input{ key, value }Fired on every user edit