@factorialco/rjsf-f0 3.3.1 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -64,6 +64,7 @@ The host app must render f0's `F0Provider` above the form and import `@factorial
64
64
  | `oauth` connect control | `F0Button` (see below) |
65
65
  | `pairing` table | a table of `F0Select`, `F0TagStatus` (see below) |
66
66
  | `launch-one` button | `F0Button` with the `Ai` icon (see below) |
67
+ | `table` | `F0FormEditableTable` (see below) |
67
68
  | error summary | `F0Alert` |
68
69
  | section title | `F0Heading` |
69
70
 
@@ -212,6 +213,21 @@ An edit re-renders only the rows it changes, and a free-text row hands what is t
212
213
 
213
214
  The Forms SDK's `"ui:field": "launch-one"` hands filling the form to an assistant. The SDK fills the button's texts in and calls the host; this theme only draws the button, as `Theme.assistant.LaunchButton`: an outline `F0Button` with the `Ai` icon. `FcodeJsonSchemaForm` finds it through `rjsfTheme.assistant`. With `"collapse": true` (and a `section`) the SDK draws the button inside that section and gives it a `toggle` prop, drawn beside it as a link with a `ChevronDown` / `ChevronUp` icon ("Show the full form" / "Hide"); the SDK hides the fields and keeps the state.
214
215
 
216
+ ### Tables
217
+
218
+ The Forms SDK's `"ui:field": "table"` draws a section as one table whose columns, rows and cells all come from the schema: an object gives one fixed row per property, an array gives a list of rows the user adds to and removes from. Parsing, the rows and the submitted values are handled in `@factorialco/fcode-react-forms`. This theme contributes only the drawing, as `Theme.table.Table`, which `FcodeJsonSchemaForm` finds through `rjsfTheme.table`. It is an `F0FormEditableTable` with:
219
+
220
+ - one column per schema column, after a leading column with each fixed row's title when the section asks for one (`rowHeader`). A column every row requires is marked with `*`;
221
+ - each cell drawn by its own kind, so two rows can hold different kinds under the same header: a text input (`text`, `email`, `url` or `tel`), a number input with its units, a date picker, a searchable select, a multiselect, a status tag for a badge (`neutral`, `info`, `positive`, `warning`, `critical`) and plain text for a read-only value. A cell the row has no property for is left empty. A cell's validation error marks that cell, and a cell's hint sits behind an info icon;
222
+ - an `F0Checkbox` in the header of the yes/no column the section selects as a whole, as f0's own selectable tables have: checked when every row is selected, a dash when only some are (a click then selects the rest), empty when none is;
223
+ - the table's own **Add row**, remove and drag-to-reorder controls, each shown only when the SDK allows it.
224
+
225
+ Three things to know. f0's editable table has no yes/no cell, so a `boolean` is a two-choice select (the `yes` / `no` labels). Text and number cells report their value when they lose the focus, not on every keystroke. And f0 takes a text cell's input type and a number cell's decimals and range once per column, so they come from the first cell of that kind in the column; only the units are read per cell.
226
+
227
+ The select-all checkbox is handed to the editable table as that column's `label`. f0 types a header as text but renders whatever it is given; if a later f0 stops doing so, the checkbox has to move out of the header.
228
+
229
+ Like the pairing table, it re-renders every row on each edit, so it suits tens of rows, not thousands.
230
+
215
231
  ### Not yet f0
216
232
 
217
233
  - **`range`** renders as a number input rather than `F0Slider`.