extended-dynamic-forms 0.1.20 → 0.1.22
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 +60 -4
- package/dist/ExtendedForm.d.ts +4 -0
- package/dist/WizardForm.d.ts +26 -0
- package/dist/components/arrays/ArrayFieldItemTemplate.d.ts +3 -0
- package/dist/components/arrays/ArrayFieldTemplate.d.ts +3 -0
- package/dist/components/arrays/index.d.ts +2 -0
- package/dist/components/fields/AddressField.d.ts +3 -0
- package/dist/components/fields/CurrencyField.d.ts +4 -0
- package/dist/components/fields/PhoneField.d.ts +4 -0
- package/dist/components/index.d.ts +24 -0
- package/dist/components/templates/FieldTemplate.d.ts +4 -0
- package/dist/components/templates/SubmitButton.d.ts +4 -0
- package/dist/components/templates/index.d.ts +2 -0
- package/dist/conditionals/ConditionalActions.d.ts +13 -0
- package/dist/conditionals/ConditionalContext.d.ts +32 -0
- package/dist/conditionals/DynamicArrayConditionalEngine.d.ts +77 -0
- package/dist/conditionals/SimpleConditionalEngine.d.ts +41 -0
- package/dist/conditionals/SmartJsonRulesTransformer.d.ts +10 -0
- package/dist/conditionals/index.d.ts +7 -0
- package/dist/conditionals/v2/createConditionalEngineHook.d.ts +3 -0
- package/dist/conditionals/v2/engines/schemaEngineConfig.d.ts +4 -0
- package/dist/conditionals/v2/engines/uiEngineConfig.d.ts +4 -0
- package/dist/conditionals/v2/engines/validationEngineConfig.d.ts +13 -0
- package/dist/conditionals/v2/hooks/useConditionalSchema.d.ts +4 -0
- package/dist/conditionals/v2/hooks/useConditionalUi.d.ts +4 -0
- package/dist/conditionals/v2/hooks/useConditionalValidation.d.ts +4 -0
- package/dist/conditionals/v2/index.d.ts +10 -0
- package/dist/conditionals/v2/migration.d.ts +76 -0
- package/dist/conditionals/v2/types.d.ts +37 -0
- package/dist/conditionals/v2/utils/dynamicArrayItems.d.ts +59 -0
- package/dist/conditionals/v2/utils/jsonPatch.d.ts +9 -0
- package/dist/events/FormEventContext.d.ts +19 -0
- package/dist/events/FormEventHub.d.ts +27 -0
- package/dist/events/FormEventManager.d.ts +10 -0
- package/dist/events/index.d.ts +4 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useFormDevTools.d.ts +48 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.es.js +20325 -0
- package/dist/index.umd.js +172 -0
- package/dist/layouts/index.d.ts +2 -0
- package/dist/layouts/wizard/ProgressIndicator.d.ts +10 -0
- package/dist/layouts/wizard/StepNavigation.d.ts +11 -0
- package/dist/layouts/wizard/WizardLayout.d.ts +31 -0
- package/dist/layouts/wizard/WizardNavigation.d.ts +16 -0
- package/dist/layouts/wizard/WizardObjectFieldTemplate.d.ts +4 -0
- package/dist/layouts/wizard/WizardSectionTemplate.d.ts +11 -0
- package/dist/layouts/wizard/index.d.ts +7 -0
- package/dist/types/index.d.ts +88 -0
- package/dist/utils/formDataUtils.d.ts +22 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/schemaUtils.d.ts +24 -0
- package/dist/utils/validationUtils.d.ts +26 -0
- package/dist/vanilla-entry.d.ts +208 -0
- package/dist/widgets/date/DateWidget.d.ts +4 -0
- package/dist/widgets/enhanced/EnhancedWidgets.d.ts +36 -0
- package/dist/widgets/file/FileWidget.d.ts +4 -0
- package/dist/widgets/index.d.ts +33 -0
- package/dist/widgets/input/ColorWidget.d.ts +4 -0
- package/dist/widgets/input/RangeWidget.d.ts +4 -0
- package/dist/widgets/input/RatingWidget.d.ts +4 -0
- package/package.json +2 -2
- package/dist/extended-dynamic-forms.standalone.js +0 -882
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { FormEventHub } from './FormEventHub';
|
|
3
|
+
|
|
4
|
+
export interface FormEventContextType {
|
|
5
|
+
eventHub: FormEventHub;
|
|
6
|
+
formData?: any;
|
|
7
|
+
}
|
|
8
|
+
export interface FormEventProviderProps {
|
|
9
|
+
eventHub: FormEventHub;
|
|
10
|
+
formData?: any;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare const FormEventProvider: React.FC<FormEventProviderProps>;
|
|
14
|
+
export declare const useFormEventHub: () => FormEventContextType;
|
|
15
|
+
export declare const useFieldEventHandlers: (fieldId: string, schema?: any, fieldPath?: string[]) => {
|
|
16
|
+
onFocus: (value: any) => Promise<void>;
|
|
17
|
+
onBlur: (value: any) => Promise<void>;
|
|
18
|
+
onChange: (value: any) => Promise<void>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FormEventHandlers, FieldEventHandlers, WebhookConfig } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare class FormEventHub {
|
|
4
|
+
private formHandlers;
|
|
5
|
+
private fieldHandlers;
|
|
6
|
+
private webhooks;
|
|
7
|
+
private debounceTimers;
|
|
8
|
+
private webhookQueue;
|
|
9
|
+
private isProcessingQueue;
|
|
10
|
+
constructor(formHandlers: FormEventHandlers, fieldHandlers?: FieldEventHandlers, webhooks?: WebhookConfig[]);
|
|
11
|
+
handleBeforeSubmit(data: any): Promise<any>;
|
|
12
|
+
handleAfterSubmit(data: any): Promise<void>;
|
|
13
|
+
handleBeforeValidation(data: any): Promise<any>;
|
|
14
|
+
handleAfterValidation(data: any, errors: any): Promise<void>;
|
|
15
|
+
handleFieldEvent(eventType: 'focus' | 'blur' | 'change', fieldId: string, fieldValue: any, schema?: any, formData?: any, fieldPath?: string[]): Promise<void>;
|
|
16
|
+
private processWebhooks;
|
|
17
|
+
private debounceWebhook;
|
|
18
|
+
private queueWebhook;
|
|
19
|
+
private processWebhookQueue;
|
|
20
|
+
private callWebhook;
|
|
21
|
+
createFieldEventHandlers(fieldId: string, schema?: any, formData?: any, fieldPath?: string[]): {
|
|
22
|
+
onFocus: (value: any) => Promise<void>;
|
|
23
|
+
onBlur: (value: any) => Promise<void>;
|
|
24
|
+
onChange: (value: any) => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
cleanup(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FormEventHandlers } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare class FormEventManager {
|
|
4
|
+
private handlers;
|
|
5
|
+
constructor(handlers: FormEventHandlers);
|
|
6
|
+
handleBeforeSubmit(data: any): Promise<any>;
|
|
7
|
+
handleAfterSubmit(data: any): Promise<void>;
|
|
8
|
+
handleBeforeValidation(data: any): Promise<any>;
|
|
9
|
+
handleAfterValidation(data: any, errors: any): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { FormEventManager } from './FormEventManager';
|
|
2
|
+
export { FormEventHub } from './FormEventHub';
|
|
3
|
+
export { FormEventProvider, useFormEventHub, useFieldEventHandlers, } from './FormEventContext';
|
|
4
|
+
export type { FormEventHandlers, FieldEventHandlers, FormFieldEvent, WebhookConfig, } from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useFormDevTools';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Rule, UiEffect, SchemaEffect, ValidationEffect } from '../conditionals/v2/types';
|
|
2
|
+
|
|
3
|
+
export interface DevToolsOptions {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
logToConsole?: boolean;
|
|
6
|
+
captureHistory?: boolean;
|
|
7
|
+
historySize?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface RuleEvaluation {
|
|
10
|
+
ruleName: string;
|
|
11
|
+
pillar: 'UI' | 'Schema' | 'Validation';
|
|
12
|
+
active: boolean;
|
|
13
|
+
error?: string;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
}
|
|
16
|
+
export interface DevToolsHistory {
|
|
17
|
+
formData: any;
|
|
18
|
+
evaluations: RuleEvaluation[];
|
|
19
|
+
timestamp: number;
|
|
20
|
+
}
|
|
21
|
+
export interface DevToolsOutput {
|
|
22
|
+
evaluations: RuleEvaluation[];
|
|
23
|
+
history: DevToolsHistory[];
|
|
24
|
+
activeRules: {
|
|
25
|
+
ui: string[];
|
|
26
|
+
schema: string[];
|
|
27
|
+
validation: string[];
|
|
28
|
+
};
|
|
29
|
+
hasErrors: boolean;
|
|
30
|
+
errors: RuleEvaluation[];
|
|
31
|
+
summary: {
|
|
32
|
+
totalRules: number;
|
|
33
|
+
activeCount: number;
|
|
34
|
+
errorCount: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Debugging hook for the Three Pillars conditional system.
|
|
39
|
+
* Provides visibility into which rules are active and any errors that occur.
|
|
40
|
+
*
|
|
41
|
+
* @param formData - Current form data
|
|
42
|
+
* @param uiRules - UI pillar rules
|
|
43
|
+
* @param schemaRules - Schema pillar rules
|
|
44
|
+
* @param validationRules - Validation pillar rules
|
|
45
|
+
* @param options - DevTools configuration options
|
|
46
|
+
* @returns DevToolsOutput with evaluation results and debugging information
|
|
47
|
+
*/
|
|
48
|
+
export declare function useFormDevTools(formData: any, uiRules?: Rule<UiEffect>[], schemaRules?: Rule<SchemaEffect>[], validationRules?: Rule<ValidationEffect>[], options?: DevToolsOptions): DevToolsOutput;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
export * from './components';
|
|
3
|
+
export * from './widgets';
|
|
4
|
+
export * from './layouts';
|
|
5
|
+
export * from './events';
|
|
6
|
+
export * from './conditionals';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export * from './utils';
|
|
9
|
+
export * from './hooks';
|
|
10
|
+
export type { FormProps, IChangeEvent } from '@rjsf/core';
|
|
11
|
+
export type { RJSFSchema, UiSchema, WidgetProps, FieldProps, ArrayFieldTemplateProps, ObjectFieldTemplateProps, FieldTemplateProps, ErrorSchema, RJSFValidationError, } from '@rjsf/utils';
|
|
12
|
+
export { default as validator } from '@rjsf/validator-ajv8';
|
|
13
|
+
export { ExtendedForm } from './ExtendedForm';
|
|
14
|
+
export { WizardForm } from './WizardForm';
|
|
15
|
+
export type { WizardFormProps, WizardStep } from './WizardForm';
|