@factorialco/rjsf-f0 3.3.0 → 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
 
@@ -203,15 +204,30 @@ The Forms SDK's `"ui:widget": "oauth"` field opens the provider in a popup and r
203
204
  The Forms SDK's `"ui:field": "pairing"` turns an object whose properties pair Factorial records with another system's (accounts, tax codes, wage types…) into one reviewable table. The rows, their suggestions, the in-use filter and the submitted values are all handled in `@factorialco/fcode-react-forms`. This theme contributes only the drawing, as `Theme.pairing.Table`, which `FcodeJsonSchemaForm` finds through `rjsfTheme.pairing`. The table has:
204
205
 
205
206
  - a header with the counts, an **Accept N suggestions** `F0Button` shown while any suggestion is pending, and the **Needs a choice (N)** filter (an `F0Button`, outlined while off and filled while on);
206
- - a table with three columns: the Factorial record, a searchable `F0Select` of the other system's records (a suggested row shows the suggestion as its value, marked by a blue lightbulb hint carrying the app's reason, or by the `Ai` icon when One suggested it; clearing it dismisses the suggestion), and the status: an `F0TagStatus` reading _Confirmed_, _Suggested_ or _Suggested by One_ (the reason as its tooltip), _No longer available_ or _Needs a choice_. A suggested row has its **Accept** button right beside that tag, in the status column: the action only exists for those rows, so there is no actions column. A confirmed row One would pair differently stays _Confirmed_, with "One suggests X" as its hint and tooltip and a **Use** button in the same place. An explicit "not mapped" (`""` in the form) is a real option in the select. A free-text row (`freeText`: a row with no choices in a section with `ui:options.freeText: true`) gets an `F0TextInput` instead of the select, showing a pending suggestion the same way; blanking it clears the row. Each select is named after its row's record, and a row's validation error shows under its select. The table takes the width it is given: the record's name wraps instead of being cut, the select keeps at least 14rem, and when one row shows a hint every row keeps that room so the selects line up. Below 40rem it scrolls sideways inside its border;
207
+ - a table with three columns: the Factorial record, a searchable `F0Select` of the other system's records (a suggested row shows the suggestion as its value, marked by a blue lightbulb hint carrying the app's reason, or by the `Ai` icon when One suggested it; clearing it dismisses the suggestion), and the status: an `F0TagStatus` reading _Confirmed_, _Suggested_ or _Suggested by One_ (the reason as its tooltip), _No longer available_ or _Needs a choice_. A suggested row has its **Accept** button right beside that tag, in the status column: the action only exists for those rows, so there is no actions column. A confirmed row One would pair differently stays _Confirmed_, with "One suggests X" as its hint and tooltip and a **Use** button in the same place. An explicit "not mapped" (`""` in the form) is a real option in the select. A free-text row (`freeText`: a row with no choices in a section with `ui:options.freeText: true`) gets an `F0TextInput` instead of the select, showing a pending suggestion the same way; blanking it clears the row. Each select is named after its row's record, and a row's validation error shows under its select. The hint takes keyboard focus and is named by its reason (by the status when the suggestion gives none), and the tag carries its tooltip's text for screen readers. The table takes the width it is given: the record's name wraps instead of being cut, the select keeps at least 14rem, and when one row shows a hint every row keeps that room so the selects line up. Below 40rem it scrolls sideways inside its border;
207
208
  - a footer with an `F0Select` to add rows the in-use list left out, beside the app's in-use note.
208
209
 
209
- Every row re-renders on each edit, so keep the default list short by marking the rows in use.
210
+ An edit re-renders only the rows it changes, and a free-text row hands what is typed to the form after a short pause, on blur, on Enter or right before the form submits, so typing stays quick in a long chart. While a free-text row's text differs from its suggestion, its **Accept** (or **Use**) is hidden: typing replaces the suggestion. Marking the rows in use still keeps the default list short.
210
211
 
211
212
  ### Set up with One
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`.