@qoretechnologies/reqraft 0.8.11 → 0.8.12-canary.20260609082134.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/design/FORM_ENGINE_COMPACT.md +135 -0
- package/dist/components/form/engine/FormEngine.d.ts +40 -2
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +433 -11
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/readFirst.d.ts +50 -0
- package/dist/components/form/engine/readFirst.d.ts.map +1 -0
- package/dist/components/form/engine/readFirst.js +174 -0
- package/dist/components/form/engine/readFirst.js.map +1 -0
- package/dist/helpers/common.d.ts.map +1 -1
- package/dist/helpers/common.js +21 -8
- package/dist/helpers/common.js.map +1 -1
- package/package.json +1 -1
- package/src/components/form/engine/FormEngine.stories.tsx +882 -8
- package/src/components/form/engine/FormEngine.tsx +787 -2
- package/src/components/form/engine/readFirst.ts +208 -0
- package/src/helpers/common.ts +18 -6
- package/storybook-static/122.5aa94755.iframe.bundle.js +1 -0
- package/storybook-static/227.c84ea265.iframe.bundle.js +1 -0
- package/storybook-static/266.56591e2d.iframe.bundle.js +95 -0
- package/storybook-static/266.56591e2d.iframe.bundle.js.LICENSE.txt +16 -0
- package/storybook-static/266.56591e2d.iframe.bundle.js.map +1 -0
- package/storybook-static/280.20fd006a.iframe.bundle.js +405 -0
- package/storybook-static/280.20fd006a.iframe.bundle.js.LICENSE.txt +145 -0
- package/storybook-static/280.20fd006a.iframe.bundle.js.map +1 -0
- package/storybook-static/364.9ae230ee.iframe.bundle.js +1 -0
- package/storybook-static/644.b37c323a.iframe.bundle.js +1 -0
- package/storybook-static/648.6384ef03.iframe.bundle.js +1 -0
- package/storybook-static/735.a09ba9c6.iframe.bundle.js +1 -0
- package/storybook-static/components-form-engine-FormEngine-stories.cf6666c4.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-array-ArrayAutoField-stories.8715e1fd.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-boolean-Boolean-stories.332a6cd4.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-color-Color-stories.0941f323.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-cron-Cron-stories.22f8fed8.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-date-Date-stories.b8eb9100.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-file-File-stories.f567bb7a.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-long-string-LongString-stories.3c8eea32.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-markdown-Markdown-stories.a6eca534.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-number-Number-stories.9b6e0900.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-object-Object-stories.89e744a5.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-radio-group-RadioGroup-stories.78cc8e26.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-rich-text-RichText-stories.831ea017.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-select-Select-stories.19ba2e17.iframe.bundle.js +1 -0
- package/storybook-static/components-form-fields-string-String-stories.d5ae74a8.iframe.bundle.js +1 -0
- package/storybook-static/components-log-Log-stories.47dfecd3.iframe.bundle.js +1 -0
- package/storybook-static/components-menu-Menu-stories.4bc9621d.iframe.bundle.js +1 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/hooks-useFetch-useFetch-stories.10004a22.iframe.bundle.js +1 -0
- package/storybook-static/hooks-useStorage-useStorage-stories.e777439a.iframe.bundle.js +1 -0
- package/storybook-static/hooks-useWebSocket-useWebsocket-stories.58c550e6.iframe.bundle.js +1 -0
- package/storybook-static/iframe.html +516 -0
- package/storybook-static/index.html +190 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/main.2b092d36.iframe.bundle.js +199 -0
- package/storybook-static/main.2b092d36.iframe.bundle.js.map +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/runtime~main.4993c645.iframe.bundle.js +1 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +333 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +40 -0
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +151 -0
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +394 -0
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js +361 -0
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/links-1/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/links-1/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/mock-esm-preset-11/manager-bundle.js +464 -0
- package/storybook-static/sb-addons/mock-esm-preset-11/manager-bundle.js.LEGAL.txt +35 -0
- package/storybook-static/sb-addons/storybook-12/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-12/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +1006 -0
- package/storybook-static/sb-manager/globals-runtime.js +54400 -0
- package/storybook-static/sb-manager/globals.js +48 -0
- package/storybook-static/sb-manager/runtime.js +12089 -0
- package/storybook-static/sb-preview/globals.js +33 -0
- package/storybook-static/sb-preview/runtime.js +9498 -0
- package/storybook-static/static/media/java-96x128.eead35f3.png +0 -0
- package/storybook-static/static/media/python-129x128.6540a4e1.png +0 -0
- package/storybook-static/static/media/qore-106x128.72595921.png +0 -0
- package/storybook-static/stores-currentUser-currentUser-stories.d3bd17cb.iframe.bundle.js +1 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# FormEngine — compact (read-first) mode
|
|
2
|
+
|
|
3
|
+
## What it is
|
|
4
|
+
|
|
5
|
+
`FormEngine` ([`src/components/form/engine/FormEngine.tsx`](../src/components/form/engine/FormEngine.tsx))
|
|
6
|
+
renders an options schema (`IQorusFormSchema`) as a form. It has two layouts:
|
|
7
|
+
|
|
8
|
+
- **Classic** (default) — every option's editor is expanded at once.
|
|
9
|
+
- **Compact (read-first)** — pass `compact` to render each option as a **row showing its current
|
|
10
|
+
value**; clicking a row expands the real editor inline, and a **Done** action collapses it again.
|
|
11
|
+
The form reads as a "configuration summary you drill into" rather than a wall of inputs.
|
|
12
|
+
|
|
13
|
+
Compact mode is purely presentational — editing flows through the **same** machinery as the classic
|
|
14
|
+
layout (templates, `on_change`, validation, dependents). Nothing about the schema, value shape, or
|
|
15
|
+
`onChange` contract changes.
|
|
16
|
+
|
|
17
|
+
## What `compact` adds
|
|
18
|
+
|
|
19
|
+
- **Read-first rows.** Each option shows a formatted summary of its value (`formatOptionValue`):
|
|
20
|
+
booleans as Yes/No, `allowed_values` as their display label, lists as joined item names, rich text
|
|
21
|
+
flattened to plain text, hashes as a generic "Set". Empty options show **Not set**, or
|
|
22
|
+
**Required — not set** (warning intent) when required.
|
|
23
|
+
- **Click to edit, Done to collapse.** Clicking a row mounts the real field (`renderOption`); the editor
|
|
24
|
+
is **not** mounted while collapsed. Multiple rows can be open at once.
|
|
25
|
+
- **Completion meter.** A single inline bar at the top — `N / M fields set` | track (fills remaining) |
|
|
26
|
+
`%` — matching the IDE's restyled completion strip.
|
|
27
|
+
- **Toolbar.** A search box (filter rows by label) plus a **Fields** dropdown (`ReqoreDropdown`,
|
|
28
|
+
edit-mode only) that consolidates the field-set actions: **Required only** (toggle), **Show field types**
|
|
29
|
+
(toggle — annotates each row with its type, e.g. `<string>`), **Select all** (add every optional field),
|
|
30
|
+
**Default fields** (drop user-added optionals + clear the filter, keeping required/preselected/loaded
|
|
31
|
+
values), **Revert all changes** (undo every edit back to the loaded values), and a searchable
|
|
32
|
+
**add-optional** list. Filters only affect which rows are listed — the completion meter still reflects the
|
|
33
|
+
full set. ("Edit code" is *not* here — that stays IDE-side.)
|
|
34
|
+
- **Revert.** A changed row shows a per-field hover **↺** that restores that field to its loaded value;
|
|
35
|
+
**Revert all changes** in the Fields menu restores the whole form. (Distinct from **Default fields**,
|
|
36
|
+
which resets to schema defaults + drops added optionals.)
|
|
37
|
+
- **Search spans hidden fields.** The top search matches *all* schema fields, not just the listed ones: a
|
|
38
|
+
match that is an optional field not yet in the form is surfaced as a dimmed **"Not in form — add"** row;
|
|
39
|
+
activating it adds the field and opens its editor.
|
|
40
|
+
- **Sticky-top toolbar.** The completion meter + search + Fields menu are wrapped in a `position: sticky;
|
|
41
|
+
top: 0` header (opaque background masks rows scrolling beneath), so filtering and adding optional fields
|
|
42
|
+
stay reachable while scrolling a long form. (Replaced an earlier bottom "Additional options" bar that, as
|
|
43
|
+
the last child of the scroll content, could never actually pin to the viewport.)
|
|
44
|
+
- **No horizontal overflow.** The row grid's value column is `minmax(0, 1fr)` and the value cell has
|
|
45
|
+
`min-width: 0`, so a long unbroken value (e.g. a URL) ellipsis-truncates (full value on hover via `title`)
|
|
46
|
+
instead of forcing a horizontal scrollbar.
|
|
47
|
+
- **Accessibility.** Read-first rows are real controls (`role="button"`, `tabIndex={0}`, Enter/Space
|
|
48
|
+
activate, visible focus ring), not just click handlers; the Done button and dropdowns are native buttons.
|
|
49
|
+
- **Grouping.** Rows are grouped by each option's raw `group` key into collapsible `ReqorePanel` sections,
|
|
50
|
+
each with a `✓ all set` / `⚠ N to resolve` badge (the catch-all `optional` group shows `N optional`
|
|
51
|
+
instead). Display per group (label / icon / subtitle / order) is
|
|
52
|
+
supplied by the consumer via the **`groups`** prop (the server sends only the bare group key — see
|
|
53
|
+
research below); anything omitted defaults to a title-cased key, no icon, and schema order. Ungrouped
|
|
54
|
+
required/preselected fields fall back to `general`, everything else to `optional`
|
|
55
|
+
(`getOptionGroup` / `getOptionGroupLabel`).
|
|
56
|
+
- **Dedicated layout.** Compact does **not** reuse the classic `ReqoreCollection` card-per-field layout —
|
|
57
|
+
it renders its own flat two-column rows (label | value | action, thin dividers) so it reads like the
|
|
58
|
+
IDE's restyled creator rather than a wall of cards. The classic always-expanded path is untouched.
|
|
59
|
+
|
|
60
|
+
Interface-specific chrome (status hero, value chips, "Edit code", the help Hint) is intentionally **not**
|
|
61
|
+
in the engine — a consumer wraps `FormEngine` and supplies that around it. The **server does not define
|
|
62
|
+
group display metadata** (only the bare `group` string per field; no label/icon/order), so each UI owns
|
|
63
|
+
it — hence the engine takes group display via the `groups` prop rather than hardcoding it.
|
|
64
|
+
|
|
65
|
+
## Where the logic lives
|
|
66
|
+
|
|
67
|
+
- [`readFirst.ts`](../src/components/form/engine/readFirst.ts) — pure, unit-tested helpers:
|
|
68
|
+
`formatOptionValue`, `getOptionGroup` (raw key), `getOptionGroupLabel` (key → display label, honouring
|
|
69
|
+
the `groups` prop), `getReadFirstCompletion`, `isOptionValueEmpty`.
|
|
70
|
+
- `FormEngine.tsx` — when `compact`, the component early-returns `renderCompact()` (the completion meter,
|
|
71
|
+
invalid-fields message, grouped flat rows via `renderCompactRow`, and the "more options" adder) instead
|
|
72
|
+
of the classic `ReqoreCollection`. Flat-row styling lives in module-level `styled-components`
|
|
73
|
+
(`StyledCompactWrap`, `StyledGroupBody`, `StyledEditCard`) with theme-derived colours. The classic path
|
|
74
|
+
is left exactly as it was.
|
|
75
|
+
|
|
76
|
+
## Usage
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
<FormEngine
|
|
80
|
+
name="my-form"
|
|
81
|
+
compact
|
|
82
|
+
options={schema}
|
|
83
|
+
value={value}
|
|
84
|
+
onChange={handleChange}
|
|
85
|
+
// optional: per-group display, keyed by the raw `group` string
|
|
86
|
+
groups={{
|
|
87
|
+
info: { label: 'Info', icon: 'IdCardLine', subtitle: 'Identity and core settings', sort: 0 },
|
|
88
|
+
scaling: { icon: 'BroadcastLine', sort: 1 },
|
|
89
|
+
}}
|
|
90
|
+
/>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Async schema (`optionsLoader`)
|
|
94
|
+
|
|
95
|
+
`FormEngine` normally renders a schema you hand it via `options`. `optionsLoader` lets the engine **fetch
|
|
96
|
+
the schema itself**, owning the loading / error / refetch lifecycle, while staying **transport-agnostic** —
|
|
97
|
+
the consumer supplies an async callback that resolves the schema however it likes (the engine never learns
|
|
98
|
+
about any backend). This is what lets a consumer converge an old "fetch-by-URL" form (e.g. the qorus-ide
|
|
99
|
+
`<Options url=…>` fork) onto the upstream engine without pushing app-specific fetch code into the library.
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
const loadSchema = useCallback(() => fetchSchemaSomehow(url), [url]); // memoise → refetch only on change
|
|
103
|
+
|
|
104
|
+
<FormEngine
|
|
105
|
+
name="protocol-options"
|
|
106
|
+
compact
|
|
107
|
+
value={value}
|
|
108
|
+
optionsLoader={loadSchema} // no `options` — the engine loads it
|
|
109
|
+
onChange={handleChange}
|
|
110
|
+
/>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
- While loading, the engine shows its skeleton; on rejection it renders the error message; on success it
|
|
114
|
+
renders the schema and fires `onOptionsLoaded`.
|
|
115
|
+
- The loader re-runs when its **identity changes**, so memoise it (`useCallback`) keyed on its inputs — a
|
|
116
|
+
fresh function every render would refetch on every render.
|
|
117
|
+
- Works in both compact and classic layouts. (Real consumer: qorus-ide's `useRemoteOptionsLoader` feeding
|
|
118
|
+
the Connection creator's protocol-specific options panel.)
|
|
119
|
+
|
|
120
|
+
## Tests
|
|
121
|
+
|
|
122
|
+
- **Unit:** [`__tests__/readFirst.test.ts`](../__tests__/readFirst.test.ts) — value formatting, grouping,
|
|
123
|
+
completion.
|
|
124
|
+
- **`optionsLoader`:** `CompactOptionsLoader` (async load → read-first rows + `onOptionsLoaded`),
|
|
125
|
+
`CompactOptionsLoaderError` (rejection → error message), and `OptionsLoader` (classic-layout parity).
|
|
126
|
+
- **Interaction:** the 17 `Compact*` stories in
|
|
127
|
+
[`FormEngine.stories.tsx`](../src/components/form/engine/FormEngine.stories.tsx), using the shared
|
|
128
|
+
`_tests*` helpers. They mirror the classic story matrix: read-first edit (`CompactReadFirstEditing`), the
|
|
129
|
+
Fields menu / search / search-hidden / overflow + sticky-top header, revert + show-types,
|
|
130
|
+
on_change/refetch + dependents,
|
|
131
|
+
and parity scenarios — field types, `required_groups`, `any` type, readonly-default-fix,
|
|
132
|
+
non-existent-filtered, the help dialog, and render stability.
|
|
133
|
+
|
|
134
|
+
Interface-specific chrome the IDE still wraps around the engine (Phase 3): the status hero, value chips
|
|
135
|
+
(e.g. the language logo), "Edit code", and the "Editing this form" Hint.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IReqoreCollectionProps } from '@qoretechnologies/reqore/dist/components/Collection';
|
|
2
2
|
import { IReqoreFormTemplates } from '@qoretechnologies/reqore/dist/components/Textarea';
|
|
3
|
+
import { IReqoreIconName } from '@qoretechnologies/reqore/dist/types/icons';
|
|
3
4
|
import { IQorusFormField, IQorusFormFieldMessage, IQorusFormFieldOnChangeMeta, IQorusFormOperator, IQorusFormOperatorsSchema, IQorusFormSchema, TQorusFlatForm, TQorusForm, TQorusFormFieldSchema, TQorusFormOperatorValue, TQorusType } from '@qoretechnologies/ts-toolkit';
|
|
4
5
|
import { IValidationResult } from '../../../helpers/validations';
|
|
5
6
|
import { ITemplateFieldProps } from '../fields/template/TemplateField';
|
|
@@ -41,9 +42,21 @@ export declare const flattenOptions: (options: TQorusForm) => TQorusFlatForm;
|
|
|
41
42
|
export declare const getTypeAndCanBeNull: (type: TQorusType | TQorusType[], allowed_values?: any[], operatorData?: TOperatorValue, operators?: IOperatorsSchema) => {
|
|
42
43
|
type: TQorusType;
|
|
43
44
|
defaultType: TQorusType;
|
|
44
|
-
defaultInternalType: "string" | "number" | "boolean" | "function" | "url" | "data" | "bool" | "int" | "float" | "list" | "hash" | "type" | "
|
|
45
|
+
defaultInternalType: "string" | "number" | "boolean" | "function" | "url" | "data" | "bool" | "int" | "float" | "list" | "hash" | "type" | "mapper" | "workflow" | "service" | "job" | "connection" | "constant" | "class" | "errors" | "fsm" | "group" | "mapper-code" | "queue" | "pipeline" | "sla" | "step" | "value-map" | "binary" | "date" | "email" | "long-string" | "enum" | "integer" | "range" | "free-list" | "rgbcolor" | "free-hash" | "null" | "nothing" | "richtext" | "data-provider" | "context" | "file" | "processor-mappings" | "code-editor";
|
|
45
46
|
canBeNull: boolean;
|
|
46
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Display metadata for a read-first group, keyed by the option's raw `group`
|
|
50
|
+
* string (e.g. `info`, `scaling`). The server only sends the bare group key, so
|
|
51
|
+
* the consumer supplies the label / icon / order here; anything omitted falls
|
|
52
|
+
* back to a title-cased key, no icon, and schema order.
|
|
53
|
+
*/
|
|
54
|
+
export interface IFormEngineGroup {
|
|
55
|
+
label?: string;
|
|
56
|
+
icon?: IReqoreIconName;
|
|
57
|
+
subtitle?: string;
|
|
58
|
+
sort?: number;
|
|
59
|
+
}
|
|
47
60
|
export interface IFormEngineProps extends Omit<IReqoreCollectionProps, 'onChange'> {
|
|
48
61
|
name: string;
|
|
49
62
|
uniqueName?: string;
|
|
@@ -62,9 +75,34 @@ export interface IFormEngineProps extends Omit<IReqoreCollectionProps, 'onChange
|
|
|
62
75
|
stringTemplates?: IReqoreFormTemplates;
|
|
63
76
|
templateFieldProps?: Partial<ITemplateFieldProps>;
|
|
64
77
|
showTypeToggle?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Render the form in **compact (read-first)** mode: each option is shown as a
|
|
80
|
+
* row with its current value, grouped by the option's `group`, with a
|
|
81
|
+
* completion meter at the top; clicking a row expands the real editor inline
|
|
82
|
+
* and a "Done" action collapses it again. The search box, sort, and outer
|
|
83
|
+
* label are hidden. Defaults to the classic always-expanded layout.
|
|
84
|
+
*/
|
|
65
85
|
compact?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Compact mode only: per-group display metadata (label / icon / subtitle /
|
|
88
|
+
* order), keyed by the option's raw `group` string. The server doesn't define
|
|
89
|
+
* group display info, so the consumer supplies it here.
|
|
90
|
+
*/
|
|
91
|
+
groups?: Record<string, IFormEngineGroup>;
|
|
92
|
+
/**
|
|
93
|
+
* Async schema source. When provided (and `options` is not), the engine calls
|
|
94
|
+
* this on mount and whenever the callback's identity changes, owns the
|
|
95
|
+
* loading / error / refetch lifecycle itself, and renders the loaded schema.
|
|
96
|
+
*
|
|
97
|
+
* The callback is **transport-agnostic**: the consumer fetches the schema
|
|
98
|
+
* however it likes (e.g. from a backend endpoint) and resolves it — the engine
|
|
99
|
+
* never learns about any specific data source. Memoize it (e.g. `useCallback`)
|
|
100
|
+
* keyed on its inputs, since a new identity triggers a refetch. On success
|
|
101
|
+
* `onOptionsLoaded` fires with the loaded schema; a rejection renders an error.
|
|
102
|
+
*/
|
|
103
|
+
optionsLoader?: () => Promise<IQorusFormSchema>;
|
|
66
104
|
onValidityChange?: (isValid: boolean, data: IFormValidityData) => void;
|
|
67
105
|
}
|
|
68
|
-
export declare const FormEngine: ({ name, uniqueName, value, onChange, onSingleOptionsChange, onDependableOptionChange, placeholder, noValueString, isValid, onOptionsLoaded, recordRequiresSearchOptions, readOnly, allowTemplates, templateFieldProps, showTypeToggle, compact, onValidityChange, ...rest }: IFormEngineProps) => import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
export declare const FormEngine: ({ name, uniqueName, value, onChange, onSingleOptionsChange, onDependableOptionChange, placeholder, noValueString, isValid, onOptionsLoaded, recordRequiresSearchOptions, readOnly, allowTemplates, templateFieldProps, showTypeToggle, compact, groups, optionsLoader, onValidityChange, ...rest }: IFormEngineProps) => import("react/jsx-runtime").JSX.Element;
|
|
69
107
|
export default FormEngine;
|
|
70
108
|
//# sourceMappingURL=FormEngine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormEngine.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/FormEngine.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormEngine.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/FormEngine.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAG7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;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