extended-dynamic-forms 0.4.2 → 0.5.1

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
@@ -18,8 +18,10 @@ npm install 'react@^18.0.0' 'react-dom@^18.0.0' 'antd@^5.24.0' 'dayjs@^1.11.13'
18
18
  ```
19
19
 
20
20
  React and React DOM 19 are also supported by the peer ranges. Keep their major
21
- versions aligned. RJSF and the AJV validator are included in the library bundle;
22
- you do not need a sibling RJSF checkout.
21
+ versions aligned. EDF 0.5.1 bundles RJSF 6.11.0 and the AJV validator;
22
+ you do not need a sibling RJSF checkout. Before upgrading, read the
23
+ [0.5.0 migration guide](docs/migration-0.5.md), including the breaking host-template,
24
+ cleared-value and one-step Wizard contracts.
23
25
 
24
26
  Use ESM imports and include the exported stylesheet. TypeScript declarations are
25
27
  provided; use an ESNext/Bundler-compatible module configuration.
@@ -32,6 +34,109 @@ provided; use an ESNext/Bundler-compatible module configuration.
32
34
  - Per-field options, custom widgets, fields, templates and grid layouts.
33
35
  - Field focus, blur and change events, submission hooks and webhook configuration.
34
36
 
37
+ ## Empty values: null contract
38
+
39
+ Clearing Text, Textarea, Email, URL or Telephone emits `null` by default.
40
+ An explicit own `ui:options.emptyValue` overrides this default, including `""` and `undefined`.
41
+ Password, Number (including String Mode), Date, Time and DateTime retain their
42
+ existing clear values.
43
+
44
+ In both `ExtendedForm` and `WizardForm`, AJV validates a copy with null object
45
+ properties omitted, for every schema type. Optional nulls therefore behave like
46
+ absent answers for content constraints, enums, combinators and dependencies.
47
+ Validation-only schema resolution uses that same null-omitted copy before
48
+ expanding dependencies and conditionals. Clearing an optional answer cannot
49
+ activate a presence-based requirement for another field. Live answers, dynamic
50
+ item UI and submission payloads retain the original null.
51
+ Required null properties fail with AJV's normal required error. This applies
52
+ deeply to nested objects and object properties inside array items. Primitive
53
+ array slots are never removed or normalized: their schema must explicitly
54
+ accept null. Host custom validation still receives real null answers and may
55
+ reject them. Null does not refill a schema default.
56
+
57
+ Null survives submission callbacks, Wizard step data and webhook envelopes for
58
+ visible, enabled fields. Hidden or disabled nulls are absent, while their valued
59
+ answers are retained. Receivers must distinguish null (“answered, then cleared”)
60
+ from absence (which can also mean an inactive null). Explicit overrides and other
61
+ widgets retain their own empty-value semantics. The existing envelope shapes do not
62
+ change: ExtendedForm submit envelopes contain the RJSF event under `formData`;
63
+ one-step Wizard submit envelopes contain flat answers, and multi-step Wizard
64
+ submit envelopes contain step data.
65
+
66
+ EDF's null acceptance policy belongs to its validator, not its widgets.
67
+ Native hosts using EDF widgets in their own `@rjsf/core` Form must pass EDF's
68
+ exported `nullContractValidator` to get the same acceptance policy with existing
69
+ string-only schemas. The existing `validator` export remains plain AJV.
70
+ With plain RJSF/AJV, widgets still emit null and a string-only schema rejects it.
71
+ Declaring `type: ["string", "null"]` suffices for simple optional string constraints,
72
+ but does not bypass enums, dependencies or combinators, or make required nulls
73
+ missing. Use `nullContractValidator` for the full contract and keep required
74
+ fields in the parent schema's `required` array. No Formstudio marker is needed.
75
+
76
+ ## Submitted data: hidden and disabled fields
77
+
78
+ `ExtendedForm` and `WizardForm` send valued answers unchanged, including hidden
79
+ and disabled fields. Read-only fields also remain answers. The submit callback
80
+ and `afterSubmit` receive optional `meta` alongside `formData` only when at least
81
+ one flag list is non-empty. When emitted, both arrays are present:
82
+ `{ hiddenFields: string[], disabledFields: string[] }`. Unflagged callbacks keep
83
+ their existing shape. The exported `SubmissionMeta` type describes this property.
84
+
85
+ Paths are RFC 6901 JSON Pointers relative to the delivered answers, including
86
+ array indices (`/address/street`, `/items/0/note`). Indices refer to the delivered
87
+ array after inactive-null omission; dynamic UI still evaluates original indices.
88
+ Structured Wizard pointers include the step key. A hidden object is listed once,
89
+ not once per descendant. An inactive object root uses the whole-document pointer `""`.
90
+ Only paths with delivered values are flagged. `hiddenFields` lists effectively
91
+ hidden fields addressed by visibility-capable conditional rule effects, including
92
+ declarative `ui:dynamicItems` rule patches and base-hidden Show targets whose rules
93
+ have not shown them. Only `ui:widget`, `ui:options`, or whole-UI replacements
94
+ establish visibility provenance; only whole-UI replacements cover descendants.
95
+ Static hidden fields that no visibility-capable rule addresses, such as IDs and
96
+ prefills, are sent without a hidden flag.
97
+ `disabledFields` includes static and rule-set disabled fields. A field may occur
98
+ in both lists. Rule order still determines effective state at submit time.
99
+
100
+ Hidden or disabled null values are absent; visible optional null values remain
101
+ null under the empty-value contract. Live answers are not cleared, so re-showing
102
+ a field restores its value. Dynamic item UI receives actual answers and context.
103
+ Traversal follows RJSF-resolved references, `allOf`, schema dependencies and
104
+ additional-property metadata. Declared fields use their own UI; pattern-only
105
+ keys use `uiSchema.additionalProperties`, matching RJSF. Wizard's flat traversal
106
+ is step-scoped, so an inactive step root cannot remove another step's answers.
107
+
108
+ Hidden and disabled fields remain exempt from validation and Wizard navigation
109
+ requirements. Their values are sent as entered, even when invalid. The
110
+ validation-only schema removes inactive names from `required`, array-form
111
+ `dependencies` and `dependentRequired`, and exempts field constraints, including
112
+ matching pattern constraints. Field-scoped custom and host errors are excluded.
113
+ Active fields retain validation; the authored schema remains unchanged. Leaf
114
+ validation schemas are not resolved as rendering schemas: conditional content
115
+ constraints still distinguish an explicit empty string from a supplied value,
116
+ and corrected pattern configurations resume validation without losing answers.
117
+ Array-level `minItems`, `maxItems` and `uniqueItems` validate the live array.
118
+
119
+ `beforeSubmit` receives all valued answers in the component's existing hook shape
120
+ (after inactive nulls are removed). Its returned answers are delivered as returned:
121
+ there is no second filter. Metadata is captured from field state at submit and
122
+ restricted to returned paths; it never removes answers or re-adds keys removed
123
+ by the host. After `beforeSubmit` reorders or removes array items, flags are
124
+ restricted by path, not item identity, so an index can refer to a different item.
125
+
126
+ Submit webhook envelopes carry `meta` as a fixed root key only when a flag list
127
+ is non-empty. Otherwise their existing bytes and component-specific `formData`
128
+ wrappers are unchanged. `body` cannot supply or override `meta`.
129
+ `formDataFields` still selects top-level answers; metadata is restricted to that
130
+ selection, using flat answer pointers for Wizard's selected webhooks.
131
+ Change, focus, blur, stepChange and validationError events carry unfiltered
132
+ answer snapshots and no metadata. Their existing `fieldValue` semantics remain.
133
+ Standalone `FormEventHub` callers remain responsible for their own field state.
134
+
135
+ `includeHiddenStepsInSubmit` retains its existing structured Wizard membership
136
+ policy. Fields belonging to hidden steps are not flagged by this mechanism.
137
+ The flat answer view retains its existing all-step contract. Use structured
138
+ Wizard answers when whole-step exclusion is required.
139
+
35
140
  ## Basic usage
36
141
 
37
142
  ```tsx
@@ -73,6 +178,10 @@ EDF supplies its widgets and validator by default. Override the RJSF `widgets`,
73
178
  `customWidgets`, `validator` and commonly used RJSF types are exported from
74
179
  `extended-dynamic-forms`; no private subpath import is needed.
75
180
 
181
+ Both `ExtendedForm` and `WizardForm` accept an omitted `formData` prop. It uses a
182
+ stable empty initial value, and edited answers persist across host re-renders.
183
+ Pass `formData` when your host needs to supply answers explicitly.
184
+
76
185
  ## Multi-step forms
77
186
 
78
187
  `WizardForm` detects steps from root properties beginning with `STEP_`. Define at
@@ -118,13 +227,16 @@ export default function RegistrationForm() {
118
227
  }
119
228
  ```
120
229
 
121
- Conditions use flat answer paths without the `STEP_` prefix. Initial answers may
230
+ Conditions use flat answer paths without the `STEP_` prefix. One-step forms take
231
+ flat initial answers only. With two or more configured steps, initial answers may
122
232
  be flat or nested under step keys; explicit nested snapshots take precedence.
123
- Use distinct answer keys across steps when working with flat data.
233
+ Use distinct answer keys across steps when working with flat data. See the
234
+ [0.5.0 migration guide](docs/migration-0.5.md#d13-one-step-wizards-use-the-shared-step-runtime)
235
+ for the one-step payload contract and the configured-step boundary.
124
236
 
125
237
  Step visibility rules use `x-edf:stepRules`. Hidden steps are skipped in navigation
126
238
  and excluded from structured submissions unless `includeHiddenStepsInSubmit` is
127
- true; `flatFormData` retains the all-step context. `onStepChange` reports the
239
+ true; `flatFormData` retains the all-step context after inactive-null omission. `onStepChange` reports the
128
240
  visible-step index; `onStepChangeDetailed` also includes the original index as
129
241
  `allStepsIndex`. The last visible step can submit, and final submission validates
130
242
  all visible steps, including an earlier step newly revealed by a later answer.
@@ -140,7 +252,32 @@ errors by default; hiding the error list does not bypass validation.
140
252
 
141
253
  `LayoutGridField` is included for step layouts. Configure `ui:field` as
142
254
  `LayoutGridField` and use `ui:layoutGrid` with Ant Design's 24-column spans and
143
- gutters. Custom fields and templates remain overridable.
255
+ gutters. Grouped objects display their own title and description once before
256
+ their members, using the registered templates. UI titles and descriptions
257
+ override schema metadata; empty UI values hide that heading, and
258
+ `ui:options.label: false` hides both. Custom fields and templates remain
259
+ overridable.
260
+
261
+ ### Form headings and step descriptions
262
+
263
+ Root `uiSchema['ui:options'].label` defaults to `true`. Set it to `false` to hide
264
+ the form title and description together on one-step and multi-step forms; field
265
+ labels are unaffected. An empty root `ui:title` or `ui:description` hides only
266
+ that heading.
267
+
268
+ The `WizardForm` prop `showStepDescription` defaults to `true`. Multi-step forms
269
+ show one active-step description inside the form, above the fields, even when
270
+ progress is hidden. Set it to `false` to hide that description. It is a component
271
+ prop, not a persisted uiSchema option, so hosts such as Formstudio must pass it
272
+ explicitly. One-step forms show no step description.
273
+
274
+ ```tsx
275
+ <WizardForm
276
+ schema={schema}
277
+ uiSchema={{ 'ui:options': { label: false } }}
278
+ showStepDescription={false}
279
+ />
280
+ ```
144
281
 
145
282
  ## Conditional logic
146
283
 
@@ -173,6 +310,46 @@ UI rules belong in `uiSchema['x-edf:rules']`; schema rules belong in
173
310
  per-item JsonLogic. Conditional requiredness changes validation, not just a
174
311
  visual required marker.
175
312
 
313
+ ### Rule order
314
+
315
+ Rules in each conditional engine run in ascending numeric `order`. Use a finite
316
+ number; negative values and zero are valid. Equal orders retain their array
317
+ order. Rules without `order` run **after every explicitly ordered rule**, keeping
318
+ their own array order. Evaluation does not reorder the caller's array.
319
+
320
+ Only matching rules apply effects. Effects run sequentially, so a later effect
321
+ on the same property wins: hide followed by show reveals a field, and a later
322
+ widget replacement replaces the earlier widget. Effects within one rule also
323
+ retain their array order. A false condition does not apply an automatic inverse;
324
+ authors that need an inverse must supply another rule.
325
+
326
+ This contract applies separately to the UI, schema, and validation engines.
327
+ Schema effects determine both rendered constraints and submission validation.
328
+ The code-only `useConditionalValidation` hook preserves the same rule order;
329
+ `createCustomValidate` then runs the selected validation callbacks in sequence.
330
+ Callbacks that add errors accumulate them; an earlier error is not automatically
331
+ removed unless a later callback explicitly changes it.
332
+
333
+ `ExtendedForm` applies embedded schema and UI rules with this ordering.
334
+ `WizardForm` applies it independently for each step, including navigation and
335
+ final validation. A step's rule list is its local rules followed by inherited
336
+ root rules, then sorted by `order`; root rules therefore follow local rules when
337
+ their orders tie or both omit `order`. Rule paths are relative to the step.
338
+
339
+ For example, these UI rules reveal `answer` as a textarea even though the hide
340
+ rule appears last in the array:
341
+
342
+ ```json
343
+ {
344
+ "x-edf:rules": [
345
+ { "name": "Show", "order": 20, "condition": true,
346
+ "effect": [{ "op": "replace", "path": "/answer/ui:widget", "value": "textarea" }] },
347
+ { "name": "Hide", "order": 10, "condition": true,
348
+ "effect": [{ "op": "replace", "path": "/answer/ui:widget", "value": "hidden" }] }
349
+ ]
350
+ }
351
+ ```
352
+
176
353
  ## Widgets and options
177
354
 
178
355
  Select a registered widget using `ui:widget`. The same registered key can also
@@ -245,19 +422,47 @@ Choice presenter-specific Ant Design options use `choiceConfig.antd`, such as
245
422
 
246
423
  ### Empty answers
247
424
 
248
- The built-in Text widget emits `undefined` when cleared by default. Object
249
- properties are omitted when serialized to JSON, including properties in array
250
- items; callbacks may still contain undefined-valued own properties. Array rows
251
- are not deleted or compacted. An explicit `emptyValue`, including `""` or `null`,
252
- is an override and must satisfy the schema. Password, Textarea and other widget
253
- empty defaults are not globally changed. Custom fields/widgets control their
254
- own child-change behavior.
425
+ The five text widgets follow the [null contract](#empty-values-null-contract)
426
+ above. Widgets that still emit `undefined` omit those object properties during
427
+ JSON serialization, including properties in array items; callbacks may retain
428
+ undefined-valued own properties. Clearing an array row does not delete or compact it;
429
+ hidden or disabled null items are omitted at submit and the array compacts, while
430
+ valued hidden items are kept. See “Indices refer to the delivered array” in
431
+ [Submitted data: hidden and disabled fields](#submitted-data-hidden-and-disabled-fields).
432
+ Explicit `emptyValue` overrides retain their configured value and validation
433
+ behavior, including optional-null acceptance. Custom fields/widgets control
434
+ their own child-change behavior.
255
435
 
256
436
  Stored/default answers are not rewritten on load. Turning off interaction
257
437
  feedback does not disable Submit or Wizard Next validation. Change callbacks
258
438
  can contain incomplete or invalid drafts; only accepted submissions should be
259
439
  stored as completed responses.
260
440
 
441
+ ### Conditional validation feedback
442
+
443
+ `ExtendedForm` and every `WizardForm` step fold an AJV `if` error for a failed
444
+ `then` or `else` branch when a specific, non-wrapper error has the same property
445
+ path. Wrappers remain visible when no specific error exists at their path,
446
+ even when several conditional rules fail there. Field feedback and the error
447
+ list use the same transformed errors; schemas and submitted answers are unchanged.
448
+
449
+ Both components accept `transformErrors(errors, uiSchema)`. EDF folds first,
450
+ then calls the host transform. Wizard navigation and final validation use the
451
+ same order as the step renderer. Hosts should not depend on redundant wrapper
452
+ errors reaching their callback.
453
+
454
+ ### Configuration errors and email feedback
455
+
456
+ Configuration failures carry `name: 'edf:configuration'`, including errors from
457
+ the exported `nullContractValidator`. This marker is the supported way for hosts
458
+ to recognise configuration failures. Host `transformErrors` callbacks should
459
+ preserve `name` when copying or replacing error objects so Wizard retains its
460
+ configuration-error feedback path.
461
+
462
+ Email fields in `ExtendedForm` and `WizardForm` now honour `ui:hideError` for
463
+ schema and custom validation messages. Widget-local blur feedback when no
464
+ schema or custom errors exist is unchanged.
465
+
261
466
  ### Date and time answers
262
467
 
263
468
  | Widget/schema | Accepted answer |
@@ -304,6 +509,83 @@ Custom widgets can import `useFieldEventHandlers` from the root package alongsid
304
509
  other event exports. Call the RJSF `onChange` to update the answer and the field
305
510
  event handler to participate in EDF events.
306
511
 
512
+ Both components send webhooks through `FormEventHub`, using a single JSON envelope
513
+ with `eventType`, `timestamp`, `source` and `formData`. Subscriptions support
514
+ `focus`, `blur`, `change`, `submit`, `validationError` and wizard `stepChange`.
515
+ Field events also carry `fieldId`, `fieldValue` and `fieldPath`; step events carry
516
+ `fromStep` and `toStep`; validation events carry `errors`.
517
+
518
+ ```tsx
519
+ import type { JsonValue, WebhookConfig } from 'extended-dynamic-forms';
520
+
521
+ const metadata: Record<string, JsonValue> = {
522
+ tenant: 'operations',
523
+ correlation: null,
524
+ label: '{{literal text}}',
525
+ };
526
+ const webhooks: WebhookConfig[] = [{
527
+ url: 'https://example.com/events?channel=forms#receiver',
528
+ events: ['change', 'submit'],
529
+ body: metadata,
530
+ query: [{ key: 'tag', value: 'customer care' }, { key: 'tag', value: '' }],
531
+ formDataFields: ['contact', 'consent'],
532
+ }];
533
+ ```
534
+
535
+ - `body` adds fixed extra root properties once. Its recursive `JsonValue` type
536
+ accepts JSON primitives, objects, arrays and null. There is no templating or
537
+ script execution: `{{...}}` remains literal text. Reserved keys are always
538
+ ignored, even when absent from the event: `eventType`, `timestamp`, `source`,
539
+ `formData`, `fieldId`, `fieldValue`, `fieldPath`, `fromStep`, `toStep`, `errors` and `meta`.
540
+ - `query` appends URL-encoded string pairs in order. Existing query values,
541
+ duplicate keys and empty values are retained; the fragment remains last.
542
+ An absent or empty list leaves the URL byte-for-byte unchanged.
543
+ - `formDataFields` selects literal own top-level answer keys for this webhook only.
544
+ It does not interpret paths, wildcards or renames. An absent list keeps existing
545
+ full-data delivery; an empty list sends `{}`. Missing keys stay absent. Selected
546
+ JSON values retain their complete nested structure and nulls. Null or missing
547
+ answer data stays as it is. Submit selection uses ExtendedForm's inner answers
548
+ and WizardForm's accepted flat answer view, not their compatibility wrappers.
549
+ Other events select from their answer data. Unselected payloads and callbacks
550
+ retain their existing component-specific shapes.
551
+
552
+ Native `FormEventHub` callers may supply `handleAfterSubmit(data, { formData: answers })`
553
+ when their canonical submit data is wrapped. Omitting the second argument selects
554
+ from `data` as before; an explicit null or undefined snapshot stays null or missing.
555
+ The snapshot travels with that event through deferred delivery and retries.
556
+
557
+ These options apply to every subscribed event without changing methods, headers,
558
+ debouncing, retries, timeouts or subscriptions. With all three absent, the URL and
559
+ serialized request body remain byte-identical to existing delivery. They do not
560
+ mutate the shared event, another webhook's payload or host/lifecycle callback data.
561
+ **Answer selection is not a redaction control:** it filters only `formData`, not
562
+ `fieldValue`, `errors`, query values or authored body properties. Hosts must apply
563
+ their own disclosure policy before configuring a destination.
564
+
565
+ These EDF options do not interpret Formstudio's legacy `request_body` or
566
+ `form_data_fields` storage.
567
+
568
+ ### RJSF 6.11 native integration in 0.5.0
569
+
570
+ For native hosts that register EDF's `TelephoneWidget` on their own RJSF 6.11
571
+ `Form`, wrap that Form in the exported `RJSF611ErrorStateAdapter`, inside
572
+ `FormEventProvider`. It preserves the native ref and real change notifications
573
+ while clearing only widget-owned stale feedback. `ExtendedForm` and Wizard steps
574
+ install this boundary internally. Earlier beta-based consumers remain unchanged
575
+ until they explicitly adopt 0.5.0.
576
+ See [Telephone integration](docs/custom-widgets-configuration.md#rjsf-611-native-error-state-compatibility-050)
577
+ for the native example and the version-specific boundary.
578
+
579
+ Unwrapped native 6.11 hosts retain upstream stale Telephone feedback; migrate to
580
+ the wrapper before adoption. Non-live forms do not acquire schema-only errors
581
+ from the adapter before Submit. Existing post-submit feedback can still clear
582
+ when corrected.
583
+
584
+ `ExtendedForm` defaults `experimental_defaultFormStateBehavior.requiredBooleanDefault`
585
+ to `'skip'`: an unanswered required boolean stays absent. An explicit host value
586
+ (for example `'populateFalse'`) overrides that default. Authored boolean defaults
587
+ are preserved.
588
+
307
589
  ## Known limitations
308
590
 
309
591
  - CommonJS `require` is unsupported; use ESM imports. NodeNext declaration
@@ -1,4 +1,5 @@
1
1
  import { WebhookConfig } from './types';
2
+ import { ErrorTransformer } from '@rjsf/utils';
2
3
 
3
4
  export interface WizardStep {
4
5
  id: string;
@@ -35,6 +36,7 @@ export interface WizardFormProps {
35
36
  submitButtonText?: string;
36
37
  liveValidate?: boolean;
37
38
  showErrorList?: boolean;
39
+ transformErrors?: ErrorTransformer;
38
40
  onWebhookStart?: (webhook: WebhookConfig, event: any) => void;
39
41
  onWebhookComplete?: (webhook: WebhookConfig, event: any, response: any) => void;
40
42
  onWebhookError?: (webhook: WebhookConfig, event: any, error: Error) => void;
@@ -44,4 +46,4 @@ export interface WizardFormProps {
44
46
  enableDynamicBinding?: boolean;
45
47
  includeHiddenStepsInSubmit?: boolean;
46
48
  }
47
- export declare function WizardForm({ schema, uiSchema, webhooks, formData: initialFormData, onSubmit, onStepChange, onFieldFocus, onFieldBlur, onFieldChange, onLiveChange, showProgressBar, showStepDescription, submitButtonText, liveValidate, showErrorList, onWebhookStart, onWebhookComplete, onWebhookError, widgets, fields, templates, enableDynamicBinding, onStepChangeDetailed, onStepAutoAdvance, includeHiddenStepsInSubmit, }: WizardFormProps): import("react/jsx-runtime").JSX.Element;
49
+ export declare function WizardForm({ schema, uiSchema, webhooks, formData: initialFormData, onSubmit, onStepChange, onFieldFocus, onFieldBlur, onFieldChange, onLiveChange, showProgressBar, showStepDescription, submitButtonText, liveValidate, showErrorList, transformErrors, onWebhookStart, onWebhookComplete, onWebhookError, widgets, fields, templates, enableDynamicBinding, onStepChangeDetailed, onStepAutoAdvance, includeHiddenStepsInSubmit, }: WizardFormProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { default as React } from 'react';
2
+ import { default as Form, FormProps } from '@rjsf/core';
3
+
4
+ type ErrorOwner = {
5
+ setError: (id: string, message: string) => void;
6
+ remove: (id: string) => void;
7
+ };
8
+ export declare const useRJSF611WidgetErrorOwner: () => ErrorOwner | undefined;
9
+ /** Internal Wizard snapshot; ordinary validation belongs in RJSF state, not extraErrors. */
10
+ export declare const WizardValidationContext: React.Context<{
11
+ validation: Pick<Form["state"], "errors" | "errorSchema">;
12
+ reveal: boolean;
13
+ } | undefined>;
14
+ export interface RJSF611ErrorStateAdapterProps {
15
+ children: React.ReactElement<FormProps>;
16
+ /** Same constraints as the child's customValidate, without lifecycle notifications. */
17
+ customValidate?: FormProps['customValidate'];
18
+ }
19
+ /**
20
+ * RJSF 6.11 compatibility boundary for EDF widget-owned errors in native Forms.
21
+ * Keeps its error list/tree consistent without changing RJSF or liveValidate.
22
+ * Reproduction: T6/out/evidence/upstream-only-error-reset.{tsx,log}.
23
+ */
24
+ export declare function RJSF611ErrorStateAdapter({ children, customValidate }: RJSF611ErrorStateAdapterProps): import("react/jsx-runtime").JSX.Element;
25
+ export {};
@@ -1,3 +1,3 @@
1
- import { ArrayFieldItemTemplateType } from '@rjsf/utils';
1
+ import { ArrayFieldItemTemplateProps } from '@rjsf/utils';
2
2
 
3
- export declare const ArrayFieldItemTemplate: (props: ArrayFieldItemTemplateType) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const ArrayFieldItemTemplate: (props: ArrayFieldItemTemplateProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,9 +3,8 @@ import { FieldProps } from '@rjsf/utils';
3
3
  type Path = (string | number)[];
4
4
  export type TextChangeScope = {
5
5
  parent?: TextChangeScope;
6
- key: string | number;
6
+ path: Path;
7
7
  name: string;
8
- index?: number;
9
8
  live: boolean;
10
9
  widgets: Set<object>;
11
10
  children: Set<TextChangeScope>;
@@ -17,12 +16,12 @@ export declare const TextChangeContext: import('react').Context<{
17
16
  scope: TextChangeScope;
18
17
  onChange: FieldProps["onChange"];
19
18
  } | undefined>;
20
- /** Public callbacks, not DOM ids or answer equality, identify same-field delegation. */
19
+ /** Public paths and callbacks, not DOM ids or answer equality, identify same-field delegation. */
21
20
  export declare function useTextChangeScope(props: FieldProps, item?: boolean): TextChangeScope;
22
21
  /** Presence belongs to this committed field scope, never a form-wide widget-id set. */
23
22
  export declare function useTextChangeRegistration(name: string, emptyValue: unknown): void;
24
23
  /** The actual originating leaf must match the complete public path to this boundary. */
25
24
  export declare function textChangeTargets(origin: TextChangeScope | undefined, boundary: TextChangeScope, path: Path): boolean;
26
25
  /** Preserve origin only during matching synchronous public callback forwarding. */
27
- export declare function useTextChangeCallback(onChange: FieldProps['onChange'], scope: TextChangeScope, calls: TextChangeCalls): (newValue: any, path?: (number | string)[], es?: import('@rjsf/utils').ErrorSchema<any> | undefined, id?: string) => void;
26
+ export declare function useTextChangeCallback(onChange: FieldProps['onChange'], scope: TextChangeScope, calls: TextChangeCalls): (newValue: any, path: import('@rjsf/utils').FieldPathList, es?: import('@rjsf/utils').ErrorSchema<any> | undefined, id?: string) => void;
28
27
  export {};
@@ -7,6 +7,7 @@ import { ArrayFieldTemplate, ArrayFieldItemTemplate } from './arrays';
7
7
  import { WizardObjectFieldTemplate, WizardSectionTemplate } from '../layouts/wizard';
8
8
  import { SubmitButton } from './templates/SubmitButton';
9
9
  import { FieldTemplate } from './templates/FieldTemplate';
10
+ import { FieldErrorTemplate } from './templates/FieldErrorTemplate';
10
11
  import { FieldProps } from '@rjsf/utils';
11
12
 
12
13
  export declare const customFields: {
@@ -17,13 +18,14 @@ export declare const customFields: {
17
18
  };
18
19
  export declare const customTemplates: {
19
20
  FieldTemplate: React.FC<import('@rjsf/utils').FieldTemplateProps>;
21
+ FieldErrorTemplate: typeof FieldErrorTemplate;
20
22
  ObjectFieldTemplate: React.FC<import('@rjsf/utils').ObjectFieldTemplateProps>;
21
23
  ArrayFieldTemplate: (props: import('@rjsf/utils').ArrayFieldTemplateProps) => import("react/jsx-runtime").JSX.Element;
22
- ArrayFieldItemTemplate: (props: import('@rjsf/utils').ArrayFieldItemTemplateType) => import("react/jsx-runtime").JSX.Element;
24
+ ArrayFieldItemTemplate: (props: import('@rjsf/utils').ArrayFieldItemTemplateProps) => import("react/jsx-runtime").JSX.Element;
23
25
  WizardObjectFieldTemplate: React.FC<import('@rjsf/utils').ObjectFieldTemplateProps>;
24
26
  WizardSectionTemplate: React.FC<import('../layouts/wizard/WizardSectionTemplate').WizardSectionTemplateProps>;
25
27
  ButtonTemplates: {
26
- SubmitButton: React.FC<import('@rjsf/utils').SubmitButtonProps>;
28
+ SubmitButton: React.FC<import('@rjsf/utils').SubmitButtonProps<any, import('@rjsf/utils').RJSFSchema, any>>;
27
29
  };
28
30
  };
29
31
  export { AddressField, PhoneField, CurrencyField, LayoutGridField, FieldTemplate, ArrayFieldTemplate, ArrayFieldItemTemplate, WizardObjectFieldTemplate, WizardSectionTemplate, SubmitButton, };
@@ -0,0 +1,3 @@
1
+ import { FieldErrorProps } from '@rjsf/utils';
2
+
3
+ export declare function FieldErrorTemplate({ errors, fieldPathId }: FieldErrorProps): import("react/jsx-runtime").JSX.Element | null;
@@ -52,6 +52,7 @@ export type DynamicItemsConfig = {
52
52
  base?: UiSchema;
53
53
  rules: DynamicItemsRule[];
54
54
  };
55
+ export declare const dynamicItemsRulePatches: WeakMap<ArrayItemsFunction, Partial<UiSchema>[]>;
55
56
  /**
56
57
  * Compile a declarative JSON config into an ArrayItemsFunction
57
58
  * - Supports single-rule shorthand and multi-rule configs
@@ -1,4 +1,4 @@
1
- import { FormEventHandlers, FieldEventHandlers, WebhookConfig } from '../types';
1
+ import { FormEventHandlers, FieldEventHandlers, WebhookConfig, SubmissionMeta } from '../types';
2
2
 
3
3
  export declare class FormEventHub {
4
4
  private formHandlers;
@@ -20,7 +20,10 @@ export declare class FormEventHub {
20
20
  onWebhookError?: (webhook: WebhookConfig, event: any, error: Error) => void;
21
21
  }): void;
22
22
  handleBeforeSubmit(data: any): Promise<any>;
23
- handleAfterSubmit(data: any): Promise<void>;
23
+ handleAfterSubmit(data: unknown, answerSnapshot?: {
24
+ formData: unknown;
25
+ meta?: SubmissionMeta;
26
+ }, meta?: SubmissionMeta, fullAnswers?: unknown): Promise<void>;
24
27
  handleBeforeValidation(data: any): Promise<any>;
25
28
  handleAfterValidation(validationErrors: any, formData: any): Promise<void>;
26
29
  handleStepChange(fromStep: number, toStep: number, formData: any): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -10,6 +10,9 @@ export * from './hooks';
10
10
  export type { FormProps, IChangeEvent } from '@rjsf/core';
11
11
  export type { RJSFSchema, UiSchema, WidgetProps, FieldProps, ArrayFieldTemplateProps, ObjectFieldTemplateProps, FieldTemplateProps, ErrorSchema, RJSFValidationError, } from '@rjsf/utils';
12
12
  export { default as validator } from '@rjsf/validator-ajv8';
13
+ export { nullContractValidator } from './utils/nullContractValidator';
13
14
  export { ExtendedForm } from './ExtendedForm';
14
15
  export { WizardForm } from './WizardForm';
15
16
  export type { WizardFormProps, WizardStep } from './WizardForm';
17
+ export { RJSF611ErrorStateAdapter } from './components/RJSF611ErrorStateAdapter';
18
+ export type { RJSF611ErrorStateAdapterProps } from './components/RJSF611ErrorStateAdapter';