@factorialco/rjsf-f0 2.6.0 → 3.1.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 +17 -1
- package/dist/rjsf-f0.cjs.js +18 -18
- package/dist/rjsf-f0.cjs.js.map +1 -1
- package/dist/rjsf-f0.es.js +1472 -1299
- package/dist/rjsf-f0.es.js.map +1 -1
- package/dist/src/assistant/assistant.test.d.ts +1 -0
- package/dist/src/assistant/index.d.ts +4 -0
- package/dist/src/assistant/launch-button.d.ts +11 -0
- package/dist/src/assistant/types.d.ts +21 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/pairing/index.d.ts +4 -0
- package/dist/src/pairing/pairing-table.d.ts +14 -0
- package/dist/src/pairing/pairing.test.d.ts +1 -0
- package/dist/src/pairing/types.d.ts +71 -0
- package/dist/src/theme.d.ts +8 -2
- package/dist/styles.css +105 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Use it inside an app that already runs f0 (the Factorial Code dashboard, the Fac
|
|
|
10
10
|
pnpm add @factorialco/rjsf-f0
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Peers you must already have: `react`, `react-dom`, `@rjsf/core` 6, `@rjsf/utils` 6 and `@factorialco/f0-react`
|
|
13
|
+
Peers you must already have: `react`, `react-dom`, `@rjsf/core` 6, `@rjsf/utils` 6 and `@factorialco/f0-react` 11.3.1 or later, up to 14 (the pairing table needs f0's `F0FormEditableTable`).
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
@@ -62,6 +62,8 @@ The host app must render f0's `F0Provider` above the form and import `@factorial
|
|
|
62
62
|
| `file` / `data-url` | f0-styled dropzone + file chips (see below) |
|
|
63
63
|
| submit, add/move/copy/remove | `F0Button` |
|
|
64
64
|
| `oauth` connect control | `F0Button` (see below) |
|
|
65
|
+
| `pairing` table | `F0FormEditableTable` (see below) |
|
|
66
|
+
| `launch-one` button | `F0Button` with the `Ai` icon (see below) |
|
|
65
67
|
| error summary | `F0Alert` |
|
|
66
68
|
| section title | `F0Heading` |
|
|
67
69
|
|
|
@@ -196,6 +198,20 @@ The toolbar is RJSF's, so it is the schema that decides what a row can do:
|
|
|
196
198
|
|
|
197
199
|
The Forms SDK's `"ui:widget": "oauth"` field opens the provider in a popup and reacts when the flow finishes; the widget logic ships in `@factorialco/fcode-react-forms`. This theme only contributes the control it draws, as `Theme.oauth.ConnectControl`: an `F0Button` (`default` while idle or waiting, `outline` with a check icon once connected) plus the flow's error message underneath. `FcodeJsonSchemaForm` finds it through `rjsfTheme.oauth`, the same way it finds `rjsfTheme.multistep`.
|
|
198
200
|
|
|
201
|
+
### Pairing tables
|
|
202
|
+
|
|
203
|
+
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
|
+
- 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
|
+
- an `F0FormEditableTable` with three columns: the Factorial record, a searchable select 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 a status tag: _Confirmed_, _Suggested_ or _Suggested by One_ (the reason as its tooltip), _No longer available_ or _Needs a choice_. A confirmed row One would pair differently stays _Confirmed_, with "One suggests X" as its hint and tooltip and a **Use** action that takes it. An explicit "not mapped" (`""` in the form) is a real option in the select. The record and status columns have fixed widths so the select keeps the rest. Each suggested row also gets an **Accept** action, and a row's validation error marks its select;
|
|
207
|
+
- a footer with an `F0Select` to add rows the in-use list left out, beside the app's in-use note.
|
|
208
|
+
|
|
209
|
+
f0's editable table re-renders every row on each edit. With a few hundred rows listed, an edit takes about a third of a second, so keep the default list short by marking the rows in use.
|
|
210
|
+
|
|
211
|
+
### Set up with One
|
|
212
|
+
|
|
213
|
+
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
|
+
|
|
199
215
|
### Not yet f0
|
|
200
216
|
|
|
201
217
|
- **`range`** renders as a number input rather than `F0Slider`.
|