Skip to main content

Module fields

Module fields 

Source
Expand description

The form controls (a themed surface expands each into its recipe parts): Input/Textarea, Select (the combobox, its popup a LAYER), DatePicker and DateRangePicker (one calendar layer), TimePicker (a list layer), NumberField (steppers), ChipInput (chips + suggestions layer), FileUpload (drop zone + files), Checkbox/Switch, Radio, Slider and the Form that collects them. A field’s failed checks (after a refused submit) show under it as <field id>.error and put its parts in the invalid state.

Modules§

dates
Calendar arithmetic for the pickers (proleptic Gregorian, no clock).

Constants§

CHOICE_PICTURE_ASPECT
A ChoiceTiles picture’s width / height (plan-card.json tiles.pictureAspect).

Functions§

choice_toggle
A press on option value: single picks it; multiple toggles it in the list, kept in OPTION order. The new comma-joined value.
choice_values
The values a ChoiceTiles value picks: one for single, the comma-joined list for multiple (empty entries dropped).
clamp_number_value
The reference’s clamp: into [min, max], then Number(v.toFixed(p)).
decimals_of
The reference’s decimalsOf(step): the digits after the . of String(step).
format_bytes
format_bytes_with through the English formatter.
format_bytes_with
A byte count as the web shows it (Intl style: "unit", short): 1024 steps, at most one fraction digit, through Formatter::bytes (47.1 kB in the English fallback).
format_number_value
A NumberField’s value as it shows: Intl.NumberFormat("en", {minimum + maximumFractionDigits: precision}): the SHORTEST round-trip decimal rounded half away from zero (1.005 → 1.01, 2.5 → 3), grouped.
format_time
js_number_string
JavaScript’s String(n) (crate::json::number_to_string).
number_prop
A numeric NumberField prop the reference’s way (num): numbers and numeric strings; absent, null or "" = none.
number_step_precision
A NumberField’s step (step || 1) and precision (precision, else the step’s decimals), as the reference reads them.
parse_time
HH:mm → minutes since midnight.
to_fixed
JavaScript’s n.toFixed(p): the EXACT binary value rounded half away from zero ((2.5).toFixed(0) = 3, (1.005).toFixed(2) = 1.00).