extended-dynamic-forms 0.4.2 → 0.5.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 +30 -4
- package/dist/components/RJSF611ErrorStateAdapter.d.ts +20 -0
- package/dist/components/arrays/ArrayFieldItemTemplate.d.ts +2 -2
- package/dist/components/fields/TextChangeScope.d.ts +3 -4
- package/dist/components/index.d.ts +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +32392 -34585
- package/dist/index.umd.js +1635 -1674
- package/dist/utils/debounce.d.ts +5 -0
- package/package.json +6 -6
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
|
|
22
|
-
you do not need a sibling RJSF checkout.
|
|
21
|
+
versions aligned. EDF 0.5.0 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.
|
|
@@ -118,9 +120,12 @@ export default function RegistrationForm() {
|
|
|
118
120
|
}
|
|
119
121
|
```
|
|
120
122
|
|
|
121
|
-
Conditions use flat answer paths without the `STEP_` prefix.
|
|
123
|
+
Conditions use flat answer paths without the `STEP_` prefix. One-step forms take
|
|
124
|
+
flat initial answers only. With two or more configured steps, initial answers may
|
|
122
125
|
be flat or nested under step keys; explicit nested snapshots take precedence.
|
|
123
|
-
Use distinct answer keys across steps when working with flat data.
|
|
126
|
+
Use distinct answer keys across steps when working with flat data. See the
|
|
127
|
+
[0.5.0 migration guide](docs/migration-0.5.md#d13-one-step-wizards-use-the-shared-step-runtime)
|
|
128
|
+
for the one-step payload contract and the configured-step boundary.
|
|
124
129
|
|
|
125
130
|
Step visibility rules use `x-edf:stepRules`. Hidden steps are skipped in navigation
|
|
126
131
|
and excluded from structured submissions unless `includeHiddenStepsInSubmit` is
|
|
@@ -304,6 +309,27 @@ Custom widgets can import `useFieldEventHandlers` from the root package alongsid
|
|
|
304
309
|
other event exports. Call the RJSF `onChange` to update the answer and the field
|
|
305
310
|
event handler to participate in EDF events.
|
|
306
311
|
|
|
312
|
+
### RJSF 6.11 native integration in 0.5.0
|
|
313
|
+
|
|
314
|
+
For native hosts that register EDF's `TelephoneWidget` on their own RJSF 6.11
|
|
315
|
+
`Form`, wrap that Form in the exported `RJSF611ErrorStateAdapter`, inside
|
|
316
|
+
`FormEventProvider`. It preserves the native ref and real change notifications
|
|
317
|
+
while clearing only widget-owned stale feedback. `ExtendedForm` and Wizard steps
|
|
318
|
+
install this boundary internally. Earlier beta-based consumers remain unchanged
|
|
319
|
+
until they explicitly adopt 0.5.0.
|
|
320
|
+
See [Telephone integration](docs/custom-widgets-configuration.md#rjsf-611-native-error-state-compatibility-050)
|
|
321
|
+
for the native example and the version-specific boundary.
|
|
322
|
+
|
|
323
|
+
Unwrapped native 6.11 hosts retain upstream stale Telephone feedback; migrate to
|
|
324
|
+
the wrapper before adoption. Non-live forms do not acquire schema-only errors
|
|
325
|
+
from the adapter before Submit. Existing post-submit feedback can still clear
|
|
326
|
+
when corrected.
|
|
327
|
+
|
|
328
|
+
`ExtendedForm` defaults `experimental_defaultFormStateBehavior.requiredBooleanDefault`
|
|
329
|
+
to `'skip'`: an unanswered required boolean stays absent. An explicit host value
|
|
330
|
+
(for example `'populateFalse'`) overrides that default. Authored boolean defaults
|
|
331
|
+
are preserved.
|
|
332
|
+
|
|
307
333
|
## Known limitations
|
|
308
334
|
|
|
309
335
|
- CommonJS `require` is unsupported; use ESM imports. NodeNext declaration
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { 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
|
+
export interface RJSF611ErrorStateAdapterProps {
|
|
10
|
+
children: React.ReactElement<FormProps>;
|
|
11
|
+
/** Same constraints as the child's customValidate, without lifecycle notifications. */
|
|
12
|
+
customValidate?: FormProps['customValidate'];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* RJSF 6.11 compatibility boundary for EDF widget-owned errors in native Forms.
|
|
16
|
+
* Keeps its error list/tree consistent without changing RJSF or liveValidate.
|
|
17
|
+
* Reproduction: T6/out/evidence/upstream-only-error-reset.{tsx,log}.
|
|
18
|
+
*/
|
|
19
|
+
export declare function RJSF611ErrorStateAdapter({ children, customValidate }: RJSF611ErrorStateAdapterProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArrayFieldItemTemplateProps } from '@rjsf/utils';
|
|
2
2
|
|
|
3
|
-
export declare const ArrayFieldItemTemplate: (props:
|
|
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
|
-
|
|
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
|
|
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 {};
|
|
@@ -19,11 +19,11 @@ export declare const customTemplates: {
|
|
|
19
19
|
FieldTemplate: React.FC<import('@rjsf/utils').FieldTemplateProps>;
|
|
20
20
|
ObjectFieldTemplate: React.FC<import('@rjsf/utils').ObjectFieldTemplateProps>;
|
|
21
21
|
ArrayFieldTemplate: (props: import('@rjsf/utils').ArrayFieldTemplateProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
ArrayFieldItemTemplate: (props: import('@rjsf/utils').
|
|
22
|
+
ArrayFieldItemTemplate: (props: import('@rjsf/utils').ArrayFieldItemTemplateProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
WizardObjectFieldTemplate: React.FC<import('@rjsf/utils').ObjectFieldTemplateProps>;
|
|
24
24
|
WizardSectionTemplate: React.FC<import('../layouts/wizard/WizardSectionTemplate').WizardSectionTemplateProps>;
|
|
25
25
|
ButtonTemplates: {
|
|
26
|
-
SubmitButton: React.FC<import('@rjsf/utils').SubmitButtonProps
|
|
26
|
+
SubmitButton: React.FC<import('@rjsf/utils').SubmitButtonProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
export { AddressField, PhoneField, CurrencyField, LayoutGridField, FieldTemplate, ArrayFieldTemplate, ArrayFieldItemTemplate, WizardObjectFieldTemplate, WizardSectionTemplate, SubmitButton, };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,3 +13,5 @@ export { default as validator } from '@rjsf/validator-ajv8';
|
|
|
13
13
|
export { ExtendedForm } from './ExtendedForm';
|
|
14
14
|
export { WizardForm } from './WizardForm';
|
|
15
15
|
export type { WizardFormProps, WizardStep } from './WizardForm';
|
|
16
|
+
export { RJSF611ErrorStateAdapter } from './components/RJSF611ErrorStateAdapter';
|
|
17
|
+
export type { RJSF611ErrorStateAdapterProps } from './components/RJSF611ErrorStateAdapter';
|