@bolttech/form-engine 0.14.3 → 3.0.0-beta.2
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 +2 -1628
- package/index.esm.d.ts +1 -0
- package/index.esm.js +1683 -0
- package/package.json +15 -16
- package/src/components/AsFormField/AsFormField.d.ts +4 -0
- package/src/components/FieldWrapper/FieldWrapper.d.ts +4 -0
- package/src/components/Form/Form.d.ts +4 -0
- package/src/components/index.d.ts +2 -0
- package/src/context/FormGroupContext.d.ts +27 -0
- package/src/generators/formBuilder.d.ts +11 -0
- package/src/index.d.ts +3 -3
- package/src/types/index.d.ts +47 -0
- package/CHANGELOG.md +0 -529
- package/asFormField-3108e669.js +0 -2
- package/asFormField-3108e669.js.map +0 -1
- package/index.js +0 -2
- package/index.js.map +0 -1
- package/react.js +0 -2
- package/react.js.map +0 -1
- package/src/adapters/react/Field.d.ts +0 -4
- package/src/adapters/react/Form.d.ts +0 -5
- package/src/adapters/react/Submit.d.ts +0 -3
- package/src/adapters/react/asFormField.d.ts +0 -4
- package/src/adapters/react/context.d.ts +0 -5
- package/src/adapters/react/index.d.ts +0 -7
- package/src/adapters/react/types.d.ts +0 -326
- package/src/adapters/react/useForceUpdate.d.ts +0 -3
- package/src/adapters/react/useForm.d.ts +0 -12
- package/src/adapters/react/useFormGroup.d.ts +0 -3
- package/src/core/apis/formatters.d.ts +0 -16
- package/src/core/apis/index.d.ts +0 -4
- package/src/core/apis/masks.d.ts +0 -3
- package/src/core/apis/validations.d.ts +0 -11
- package/src/core/apis/varOps.d.ts +0 -4
- package/src/core/constants/events.d.ts +0 -32
- package/src/core/constants/index.d.ts +0 -5
- package/src/core/constants/observer.d.ts +0 -7
- package/src/core/events/ObserverError.d.ts +0 -7
- package/src/core/events/events.types.d.ts +0 -27
- package/src/core/events/index.d.ts +0 -2
- package/src/core/handlers/common/templating.d.ts +0 -2
- package/src/core/handlers/field/api.d.ts +0 -4
- package/src/core/handlers/field/blur.d.ts +0 -2
- package/src/core/handlers/field/change.d.ts +0 -2
- package/src/core/handlers/field/clearFields.d.ts +0 -4
- package/src/core/handlers/field/data.d.ts +0 -3
- package/src/core/handlers/field/filter.d.ts +0 -2
- package/src/core/handlers/field/focus.d.ts +0 -2
- package/src/core/handlers/field/formatters.d.ts +0 -4
- package/src/core/handlers/field/htmlEventParser.d.ts +0 -6
- package/src/core/handlers/field/keydown.d.ts +0 -2
- package/src/core/handlers/field/keyup.d.ts +0 -2
- package/src/core/handlers/field/masks.d.ts +0 -4
- package/src/core/handlers/field/mount.d.ts +0 -2
- package/src/core/handlers/field/validations.d.ts +0 -4
- package/src/core/handlers/field/visibilityConditions.d.ts +0 -4
- package/src/core/handlers/flows.d.ts +0 -47
- package/src/core/handlers/form/bindFields.d.ts +0 -3
- package/src/core/handlers/form/hooks.d.ts +0 -3
- package/src/core/handlers/form/steps.d.ts +0 -2
- package/src/core/handlers/form/templating.d.ts +0 -2
- package/src/core/handlers/form/validate.d.ts +0 -2
- package/src/core/handlers/form/visibilityConditions.d.ts +0 -4
- package/src/core/index.d.ts +0 -3
- package/src/core/managers/Base.d.ts +0 -19
- package/src/core/managers/Factory.d.ts +0 -52
- package/src/core/managers/Field.d.ts +0 -33
- package/src/core/managers/Form.d.ts +0 -28
- package/src/core/managers/Scope.d.ts +0 -12
- package/src/core/managers/index.d.ts +0 -1
- package/src/core/types/index.d.ts +0 -937
- package/src/core/utils/common.d.ts +0 -9
- package/src/core/utils/credit-card.d.ts +0 -16
- package/src/core/utils/index.d.ts +0 -6
- package/src/core/utils/object.d.ts +0 -27
- package/src/core/utils/string.d.ts +0 -3
- package/src/core/utils/value.d.ts +0 -2
- package/types.js +0 -2
- package/types.js.map +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { TSchema } from '@core';
|
|
2
|
-
import { TEventInformation } from '@core/events';
|
|
3
|
-
export declare const handler: ({ form, formEventDirectives, }: Pick<TEventInformation<unknown>, 'form' | 'formEventDirectives'>) => void;
|
|
4
|
-
export declare const events: (schema: TSchema) => string[];
|
package/src/core/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Observer } from '@core/events';
|
|
2
|
-
import { EFlowLogging, TEventPublishPayload } from '@core/events/events.types';
|
|
3
|
-
import { TEventsKeys } from '@core';
|
|
4
|
-
declare class Base {
|
|
5
|
-
#private;
|
|
6
|
-
subscriptions: {
|
|
7
|
-
[x in TEventsKeys]?: () => void;
|
|
8
|
-
};
|
|
9
|
-
debounceTime: number;
|
|
10
|
-
constructor(observer: Observer);
|
|
11
|
-
subscribe(event: TEventsKeys, cb: (...data: any) => void): void;
|
|
12
|
-
subscribeBulk(events: TEventsKeys[], cb: (...data: any) => void): void;
|
|
13
|
-
publish(events: TEventsKeys, data?: TEventPublishPayload): void;
|
|
14
|
-
publishFor(events: TEventsKeys): any;
|
|
15
|
-
debounce: (fn: any, debounceTime?: number) => Promise<unknown>;
|
|
16
|
-
logError(file: EFlowLogging, event: string, method: string, error: unknown): void;
|
|
17
|
-
logInfo(file: EFlowLogging, event: string, method: string, extraData?: unknown): void;
|
|
18
|
-
}
|
|
19
|
-
export default Base;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import Form from '@core/managers/Form';
|
|
2
|
-
import { IObservable, TEvents, TEventsKeys, TObservable, TSchema, TScope } from '@core/types';
|
|
3
|
-
import { EEVents } from '@core/constants';
|
|
4
|
-
import { TEventPublishPayload, TLoggingEvent } from '@core/events/events.types';
|
|
5
|
-
declare class Observer implements IObservable {
|
|
6
|
-
#private;
|
|
7
|
-
regexBasedEvents: Record<string, {
|
|
8
|
-
regex: RegExp;
|
|
9
|
-
handlers: TObservable[];
|
|
10
|
-
}>;
|
|
11
|
-
events: TEvents;
|
|
12
|
-
history: {
|
|
13
|
-
[key in EEVents]?: string;
|
|
14
|
-
};
|
|
15
|
-
namespace: string;
|
|
16
|
-
enableLogging: boolean;
|
|
17
|
-
constructor(namespace: string, enableLogging?: boolean);
|
|
18
|
-
runForRegexBasedEvent(eventName: any, cb: (event: TEventsKeys) => void): boolean;
|
|
19
|
-
handleRegexSubscription(eventName: any, handler: TObservable): void;
|
|
20
|
-
/**
|
|
21
|
-
* This function lets you subscribe to a given event and register one callback to be called when someone published in it
|
|
22
|
-
*
|
|
23
|
-
* The callback you redister will, return you the published data and one function to unregister your callback from that event
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
subscribe(eventName: TEventsKeys, handler: TObservable): () => void;
|
|
27
|
-
unsubscribe(eventName: TEventsKeys, handler: TObservable): void;
|
|
28
|
-
isAsyncFunction(fn: (...data: any) => any): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Allows to publish data to a given event name
|
|
31
|
-
*
|
|
32
|
-
* Will iterate the subscriptions and call their handlers.
|
|
33
|
-
*
|
|
34
|
-
* When calling the handler, will also inject the unsubscribe function
|
|
35
|
-
*
|
|
36
|
-
* This methods also accepts one regex and will find the matchin events and
|
|
37
|
-
* publish in them
|
|
38
|
-
*
|
|
39
|
-
*/
|
|
40
|
-
publish(eventName: TEventsKeys, data?: TEventPublishPayload): Promise<{}>;
|
|
41
|
-
publishForEvents(eventName: TEventsKeys, data: {}, events: TEvents): Promise<{}>;
|
|
42
|
-
logError(flow: Pick<TLoggingEvent, 'flow'>['flow'], event: string, method: string, error: unknown): void;
|
|
43
|
-
logInfo(flow: Pick<TLoggingEvent, 'flow'>['flow'], event: string, method: string, extraData?: any): void;
|
|
44
|
-
}
|
|
45
|
-
export declare const getFormInstance: (namespace?: string, opts?: {
|
|
46
|
-
schema?: TSchema;
|
|
47
|
-
initialScope?: TScope;
|
|
48
|
-
initialValues?: Record<string, any>;
|
|
49
|
-
newInstance?: boolean;
|
|
50
|
-
group?: string;
|
|
51
|
-
}) => Form, getGroupFormsIds: (group: string) => string[];
|
|
52
|
-
export { Observer };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as Events from '@core/events';
|
|
2
|
-
import { TComponent, TComponentPropsMapping, TErrors, TEventReducedSchema, TEventsKeys, TField } from '@core/types';
|
|
3
|
-
import Base from '@core/managers/Base';
|
|
4
|
-
import Scope from '@core/managers/Scope';
|
|
5
|
-
declare class Field extends Base {
|
|
6
|
-
#private;
|
|
7
|
-
scope: Scope;
|
|
8
|
-
constructor(observer: Events.Observer, component: TComponent, propsMapping: TComponentPropsMapping, scope: Scope);
|
|
9
|
-
get value(): any;
|
|
10
|
-
set value(value: any);
|
|
11
|
-
get component(): TComponent;
|
|
12
|
-
get componentProps(): Record<string, unknown>;
|
|
13
|
-
set componentProps(props: Record<string, unknown>);
|
|
14
|
-
get data(): TField;
|
|
15
|
-
set data(data: TField);
|
|
16
|
-
set visibility(visible: boolean);
|
|
17
|
-
get scopedComponent(): TComponent;
|
|
18
|
-
set scopedComponent(component: TComponent);
|
|
19
|
-
get errors(): TErrors;
|
|
20
|
-
set errors(errors: TErrors);
|
|
21
|
-
get props(): Record<string, unknown>;
|
|
22
|
-
get mappings(): TComponentPropsMapping;
|
|
23
|
-
getFieldErrorMessages(data?: TField): string[];
|
|
24
|
-
fieldHasError(errors?: TErrors): boolean;
|
|
25
|
-
fieldValidationsHaveError(setErrorMessages?: boolean, event?: TEventsKeys): boolean;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
Calculates and returns the version of the current scoped object for a given event
|
|
29
|
-
*/
|
|
30
|
-
eventReducedSchema(event: TEventsKeys): TEventReducedSchema;
|
|
31
|
-
rehydrate(customChecksum?: number | string | object): void;
|
|
32
|
-
}
|
|
33
|
-
export default Field;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import Field from '@core/managers/Field';
|
|
2
|
-
import Scope from '@core/managers/Scope';
|
|
3
|
-
import Base from '@core/managers/Base';
|
|
4
|
-
import * as Events from '@core/events';
|
|
5
|
-
import { TComponent, TFormValues, TSchema, TStepData, TComponentPropsMapping, TFormEventDirectives, TEventsKeys, TFields } from '@core/types';
|
|
6
|
-
declare class Form extends Base {
|
|
7
|
-
#private;
|
|
8
|
-
formData: TFormValues;
|
|
9
|
-
formId: string;
|
|
10
|
-
schema: TSchema;
|
|
11
|
-
scopedSchema: TSchema;
|
|
12
|
-
scope: Scope;
|
|
13
|
-
initialValues: Record<string, unknown>;
|
|
14
|
-
steps: Record<number, TFields>;
|
|
15
|
-
group: string;
|
|
16
|
-
constructor(formId: string, observer: Events.Observer, scope: Scope, schema: TSchema, opts: {
|
|
17
|
-
initialValues: Record<string, unknown>;
|
|
18
|
-
}, group: any);
|
|
19
|
-
get step(): TStepData;
|
|
20
|
-
set step(step: TStepData);
|
|
21
|
-
get fields(): TFields;
|
|
22
|
-
eventReducedSchema(event: TEventsKeys): TFormEventDirectives;
|
|
23
|
-
getFieldInstance(component: TComponent, propsMapping?: TComponentPropsMapping): Field;
|
|
24
|
-
rehydrate(): void;
|
|
25
|
-
destroyField(field: string): void;
|
|
26
|
-
}
|
|
27
|
-
export default Form;
|
|
28
|
-
export type { Form };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TScope, TSetGlobalScope } from '@core/types';
|
|
2
|
-
import { Observer } from '@core/events';
|
|
3
|
-
import Base from '@core/managers/Base';
|
|
4
|
-
declare class Scope extends Base {
|
|
5
|
-
#private;
|
|
6
|
-
constructor(observer: Observer);
|
|
7
|
-
get scope(): TScope;
|
|
8
|
-
getGlobalScope<T extends TScope>(namespace?: string, key?: string): T;
|
|
9
|
-
set initialScope(data: TScope);
|
|
10
|
-
set globalScope({ namespace, key, data }: TSetGlobalScope);
|
|
11
|
-
}
|
|
12
|
-
export default Scope;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getFormInstance, getGroupFormsIds } from '@core/managers/Factory';
|