@bolttech/form-engine-core 0.0.1-beta.9 → 0.0.2-beta.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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine-core",
3
- "version": "0.0.1-beta.9",
3
+ "version": "0.0.2-beta.01",
4
4
  "module": "./index.esm.js",
5
5
  "type": "module",
6
6
  "main": "./index.esm.js",
7
7
  "dependencies": {
8
8
  "@gaignoux/currency": "1.1.0",
9
- "credit-card-type": "10.0.0",
9
+ "credit-card-type": "10.0.1",
10
10
  "lodash": "4.17.21",
11
11
  "rxjs": "7.8.1"
12
12
  },
@@ -1,3 +1,8 @@
1
1
  declare const DEFAULT_API_DEBOUNCE_TIME = 1000;
2
2
  declare const DEFAULT_STATE_REFRESH_TIME = 100;
3
- export { DEFAULT_API_DEBOUNCE_TIME, DEFAULT_STATE_REFRESH_TIME };
3
+ declare const TEMPLATE_REGEX_STRING_CONCATENATION_DETECTOR: RegExp;
4
+ declare const TEMPLATE_REGEX_DELIMITATOR: RegExp;
5
+ declare const TEMPLATE_REGEX_OPERATOR_SPLITTER: RegExp;
6
+ declare const TEMPLATE_REGEX_OPERATOR_MATCHER: RegExp;
7
+ declare const TEMPLATE_AVALIABLE_SCOPES: readonly ["fields", "iVars"];
8
+ export { DEFAULT_API_DEBOUNCE_TIME, DEFAULT_STATE_REFRESH_TIME, TEMPLATE_REGEX_STRING_CONCATENATION_DETECTOR, TEMPLATE_REGEX_DELIMITATOR, TEMPLATE_REGEX_OPERATOR_SPLITTER, TEMPLATE_REGEX_OPERATOR_MATCHER, TEMPLATE_AVALIABLE_SCOPES, };
@@ -0,0 +1,11 @@
1
+ import { Subject } from 'rxjs';
2
+ /**
3
+ * Custom RXJS Subject to gracefully handle errors on unsubscribed Subjects
4
+ * that were unmounted due to adapter external handling such as visibility
5
+ */
6
+ declare class SafeSubject<T> extends Subject<T> {
7
+ private isMounted;
8
+ constructor(isMounted: () => boolean);
9
+ next(value: T): void;
10
+ }
11
+ export { SafeSubject };
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ import { TEMPLATE_AVALIABLE_SCOPES } from '../constants/constants';
2
3
  import { TSubscribedTemplates } from '../types/template';
3
4
  import { OutgoingHttpHeaders } from 'http2';
4
5
  /**
@@ -32,6 +33,7 @@ declare function makeRequest(method: string, url: string, headers?: OutgoingHttp
32
33
  * ```
33
34
  */
34
35
  declare function extractFieldKeys(expression: string): {
36
+ originScopeKeys: (typeof TEMPLATE_AVALIABLE_SCOPES)[number][];
35
37
  originFieldKeys: string[];
36
38
  originPropertyKeys: string[];
37
39
  };
@@ -60,27 +62,5 @@ declare function extractFieldKeys(expression: string): {
60
62
  * // expressions will contain an array of objects with origin expressions, field keys, and destination paths.
61
63
  * ```
62
64
  */
63
- declare function traverseObject(obj: any, path?: string): TSubscribedTemplates[];
64
- /**
65
- * Encapsulates in a given object, at a given path the provided value
66
- *
67
- * @example
68
- * ORIGINAL object
69
- *
70
- * encapsulateIn({maintain: 'spread_me'}, 'a.b.c','test')
71
- *
72
- * RESULT
73
- *
74
- * {
75
- * maintain: 'spread_me',
76
- * c: 'test
77
- * }
78
- * }
79
- *
80
- * @param origin - The original object where the new value will be appended
81
- * @param path - The path at which the new value will be placed
82
- * @param value - The new value
83
- * @returns One new object with the new value at the provided path merged with the given object
84
- */
85
- declare const encapsulateIn: (origin: Record<string, unknown>, path: string, value: unknown) => Record<string, unknown>;
86
- export { makeRequest, traverseObject, extractFieldKeys, encapsulateIn };
65
+ declare function traverseObject(element: any, path?: string): TSubscribedTemplates[];
66
+ export { makeRequest, traverseObject, extractFieldKeys };
@@ -0,0 +1,27 @@
1
+ import { TSchemaValidation, TValidationMethods } from '../types/schema';
2
+ import { TValidationHandler } from '../types/utility';
3
+ /**
4
+ * @internal
5
+ * Handles the validation of a given value based on specified validation methods and rules.
6
+ *
7
+ * @param {string | number | boolean | unknown} value - The value to be validated.
8
+ * @param {TSchemaValidation} validations - The schema validations to be applied.
9
+ * @param {TValidationHandler} methods - The validation handler methods.
10
+ * @param {keyof TValidationMethods} key - The specific key of the validation method to be used.
11
+ * @returns {boolean} - Returns true if the value passes the validation, otherwise false.
12
+ *
13
+ * @example
14
+ * const value = 'example@example.com';
15
+ * const validations = {
16
+ * required: true,
17
+ * customName: { email: true }
18
+ * };
19
+ * const methods = {
20
+ * email: (value) => /\S+@\S+\.\S+/.test(value)
21
+ * };
22
+ * const key = 'required';
23
+ *
24
+ * const isValid = handleValidation(value, validations, methods, key);
25
+ * console.log(isValid); // Output: true
26
+ */
27
+ export default function handleValidation(value: string | number | boolean | unknown, validations: TSchemaValidation, methods: TValidationHandler, key: keyof TValidationMethods): boolean;
@@ -1,4 +1,5 @@
1
- import { TApiEvent, TErrorMessages, TEvent, TFormatters, TMasks, TProps, TResetValueMethods, TSchemaFormConfig, TValidationMethods, TVisibility } from '../types/schema';
1
+ import { TMapper } from '../types/mapper';
2
+ import { TApiEvent, TFormatters, TMasks, TProps, TResetValueMethods, TSchemaFormConfig, TValidations, TVisibility } from '../types/schema';
2
3
  /**
3
4
  * @interface IComponentSchema
4
5
  * Represents the schema for a component within a form.
@@ -7,10 +8,9 @@ import { TApiEvent, TErrorMessages, TEvent, TFormatters, TMasks, TProps, TResetV
7
8
  * @property {TProps} props - The properties of the component.
8
9
  * @property {string} name - The name of the component.
9
10
  * @property {string} nameToSubmit - The name of the field when submit values (optional).
10
- * @property {TEvent<TValidationMethods>} [validations] - The validation methods for the component.
11
+ * @property {TValidations} [validations] - The validation methods for the component.
11
12
  * @property {TVisibility[]} [visibilityConditions] - The visibility conditions for the component.
12
13
  * @property {TResetValueMethods[]} [resetValues] - The reset value methods for the component.
13
- * @property {TErrorMessages} [errorMessages] - The error messages for the component.
14
14
  * @property {TApiEvent} [api] - The API configuration for the component.
15
15
  * @property {TFormatters} [formatters] - The formatters for the component.
16
16
  * @property {TMasks} [masks] - The masks for the component.
@@ -23,10 +23,25 @@ import { TApiEvent, TErrorMessages, TEvent, TFormatters, TMasks, TProps, TResetV
23
23
  * props: { type: 'text', placeholder: 'Enter your name' },
24
24
  * name: 'name',
25
25
  * nameToSubmit: 'applicant.firstName',
26
- * validations: { config: { required: true }, events: [{ eventName: 'ON_FIELD_BLUR' }] },
26
+ * validations: {
27
+ * methods: {
28
+ * required: true,
29
+ * regex: '^([0-9]+)*$',
30
+ * max: 5,
31
+ * },
32
+ * eventMessages: {
33
+ * ON_FIELD_MOUNT: ['required'],
34
+ * ON_FIELD_CHANGE: ['regex', 'required'],
35
+ * ON_FIELD_BLUR: ['max', 'required'],
36
+ * },
37
+ * messages: {
38
+ * default: 'This field is required',
39
+ * regex: 'Only numbers are available.',
40
+ * max: 'Max of 5',
41
+ * },
42
+ * },
27
43
  * visibilityConditions: [{ conditions: { field: 'age', value: 18 } }],
28
44
  * resetValues: [{ field: 'age', resetTo: '' }],
29
- * errorMessages: { required: 'This field is required.' },
30
45
  * api: { defaultConfig: { config: { method: 'POST', url: 'https://api.example.com/submit' }, events: [{ eventName: 'ON_FORM_SUBMIT' }] } },
31
46
  * formatters: { capitalize: true },
32
47
  * masks: { currency: { align: 'left', decimal: '.', precision: 2, prefix: '$', thousands: ',' } },
@@ -39,15 +54,19 @@ interface IComponentSchema {
39
54
  props?: TProps;
40
55
  name: string;
41
56
  nameToSubmit?: string;
42
- validations?: TEvent<TValidationMethods>;
57
+ validations?: TValidations;
43
58
  api?: TApiEvent;
44
59
  visibilityConditions?: TVisibility[];
45
60
  resetValues?: TResetValueMethods[];
46
- errorMessages?: TErrorMessages;
47
61
  formatters?: TFormatters;
48
62
  masks?: TMasks;
49
63
  children?: IComponentSchema[];
50
64
  }
65
+ interface IComponentSchemaAsFormField<T> extends IComponentSchema {
66
+ mapper?: TMapper<T>;
67
+ order?: number;
68
+ children?: IComponentSchemaAsFormField<T>[];
69
+ }
51
70
  /**
52
71
  * @interface IFormSchema
53
72
  * Represents the schema for a form.
@@ -83,4 +102,4 @@ interface IFormSchema {
83
102
  iVars?: Record<string, unknown>;
84
103
  components?: IComponentSchema[];
85
104
  }
86
- export { IFormSchema, IComponentSchema };
105
+ export { IFormSchema, IComponentSchema, IComponentSchemaAsFormField };
@@ -1,9 +1,11 @@
1
1
  import { Observable, Subject, Subscription } from 'rxjs';
2
- import { TApiConfig, TApiEvent, TApiResponse, TErrorMessages, TEvent, TFormatters, TMasks, TResetValueMethods, TSchemaFormConfig, TValidationMethods, TVisibility } from '../types/schema';
3
- import { IComponentSchema } from '../interfaces/schema';
2
+ import { TApiConfig, TApiEvent, TApiResponse, TErrorMessages, TFormatters, TMasks, TResetValueMethods, TSchemaFormConfig, TValidations, TVisibility } from '../types/schema';
3
+ import { IComponentSchema, IComponentSchemaAsFormField } from '../interfaces/schema';
4
4
  import { IState } from '../interfaces/state';
5
- import { TEvents, TFieldEvent, TMutationEvents, TValueChangeEvent } from '../types/event';
5
+ import { TEvents, TFieldEvent, TValueChangeEvent } from '../types/event';
6
6
  import { TMapper } from '../types/mapper';
7
+ import { SafeSubject } from '../helpers/SafeSubject';
8
+ import { TTemplateEvent } from '../types/template';
7
9
  /**
8
10
  * Represents a form field with observables for managing form state, validations, and API requests.
9
11
  */
@@ -13,8 +15,8 @@ declare class FormField {
13
15
  component: string;
14
16
  path?: string;
15
17
  children?: string[];
16
- originalSchema: IComponentSchema;
17
- validations?: TEvent<TValidationMethods>;
18
+ originalSchema: IComponentSchemaAsFormField<unknown>;
19
+ validations?: TValidations;
18
20
  visibilityConditions?: TVisibility[];
19
21
  resetValues?: TResetValueMethods[];
20
22
  errorMessages?: TErrorMessages;
@@ -35,21 +37,20 @@ declare class FormField {
35
37
  private _errors;
36
38
  private _api;
37
39
  private _valid;
38
- propsSubject$: Subject<Record<string, unknown>>;
39
- errorSubject$: Subject<Record<string, unknown>>;
40
- valueSubject$: Subject<Record<string, unknown>>;
41
- visibilitySubject$: Subject<boolean>;
42
- apiSubject$: Subject<TApiResponse>;
40
+ private _mounted;
41
+ propsSubject$: SafeSubject<Record<string, unknown>>;
42
+ errorSubject$: SafeSubject<Record<string, unknown>>;
43
+ valueSubject$: SafeSubject<Record<string, unknown>>;
44
+ valueSubscription$: Subscription;
45
+ visibilitySubject$: SafeSubject<boolean>;
46
+ apiSubject$: SafeSubject<TApiResponse>;
43
47
  fieldEventSubject$: Subject<TFieldEvent>;
44
- apiEventQueueSubject$: Subject<{
48
+ apiEventQueueSubject$: SafeSubject<{
45
49
  event: TEvents;
46
50
  }>;
47
51
  fieldState$: Observable<IState>;
48
52
  fieldStateSubscription$: Subscription;
49
- templateSubject$: Subject<{
50
- key: string;
51
- event: TMutationEvents;
52
- }>;
53
+ templateSubject$: Subject<TTemplateEvent>;
53
54
  dataSubject$: Subject<{
54
55
  key: string;
55
56
  event: TEvents;
@@ -90,10 +91,7 @@ declare class FormField {
90
91
  key: string;
91
92
  }) => void;
92
93
  initialValue?: unknown;
93
- templateSubject$: Subject<{
94
- key: string;
95
- event: TMutationEvents;
96
- }>;
94
+ templateSubject$: Subject<TTemplateEvent>;
97
95
  fieldEventSubject$: Subject<TFieldEvent>;
98
96
  dataSubject$: Subject<{
99
97
  key: string;
@@ -219,10 +217,6 @@ declare class FormField {
219
217
  setFieldValidity({ event }: {
220
218
  event: TEvents;
221
219
  }): void;
222
- /**
223
- * WIP expensive function to get updated field validity on each event
224
- */
225
- updateValidityFlag(): void;
226
220
  /**
227
221
  * Formats the field value using the specified formatters, if available.
228
222
  *
@@ -1,11 +1,12 @@
1
1
  import { IFormField } from './field';
2
2
  import { Subject, Subscription } from 'rxjs';
3
- import { IComponentSchema, IFormSchema } from '../interfaces/schema';
3
+ import { IComponentSchema, IComponentSchemaAsFormField, IFormSchema } from '../interfaces/schema';
4
4
  import { TSchemaFormConfig } from '../types/schema';
5
- import { TSubscribedTemplates } from '../types/template';
5
+ import { TSubscribedTemplates, TTemplateEvent } from '../types/template';
6
6
  import { TEvents, TFieldEvent, TMutationEvents } from '../types/event';
7
7
  import { TFormEntry, TFormValues } from '../types/form';
8
8
  import { TMapper } from '../types/mapper';
9
+ import { TEMPLATE_AVALIABLE_SCOPES } from '../constants/constants';
9
10
  /**
10
11
  * Represents the core logic for managing a form, including field management, validation, and submission.
11
12
  */
@@ -14,23 +15,20 @@ declare class FormCore {
14
15
  fields: Map<string, IFormField>;
15
16
  initialValues?: Record<string, unknown>;
16
17
  private _iVars;
17
- templateSubject$: Subject<{
18
- key: string;
19
- event: TMutationEvents;
20
- }>;
21
- submitSubject$: Subject<TFormValues<Record<string, unknown>>>;
18
+ templateSubject$: Subject<TTemplateEvent>;
19
+ templateSubscription$: Subscription;
20
+ submitSubject$: Subject<TFormValues<any>>;
21
+ mountSubject$: Subject<TFormValues<any>>;
22
22
  fieldEventSubject$: Subject<TFieldEvent>;
23
23
  dataSubject$: Subject<{
24
24
  key: string;
25
25
  event: TEvents;
26
26
  }>;
27
- dataCallbackSubscription$: Subscription;
28
27
  subscribedTemplates: TSubscribedTemplates[];
29
28
  action?: string;
30
29
  method?: string;
31
30
  config: Required<TSchemaFormConfig>;
32
- mappers?: TMapper<unknown>[];
33
- onSubmit?: (data: TFormValues<Record<string, unknown>>) => void;
31
+ mappers: Map<string, TMapper<unknown>>;
34
32
  /**
35
33
  * Creates an instance of FormCore.
36
34
  *
@@ -40,7 +38,6 @@ declare class FormCore {
40
38
  * @param {string} [entry.action] - The action attribute of the form.
41
39
  * @param {string} [entry.method] - The method attribute of the form.
42
40
  * @param {IFormSchema.iVars} [entry.iVars] - The internal variables of the form.
43
- * @param {(data: TFormValues) => void} [entry.onSubmit] - A callback function to handle form submission.
44
41
  * @param {((payload: {field: string;data: TFormValues;}) => void) | undefined} [entry.onData] - A callback function to handle data emission.
45
42
  */
46
43
  constructor(entry: TFormEntry & Omit<IFormSchema, 'components'>);
@@ -66,14 +63,6 @@ declare class FormCore {
66
63
  * Subscribes to templates for dynamic updates.
67
64
  */
68
65
  subscribeTemplates(): void;
69
- /**
70
- *
71
- * @param {(payload: { field: string; data: TFormValues }) => void} callback callback function to call on data
72
- */
73
- subscribeData(callback: (payload: {
74
- field: string;
75
- data: TFormValues<Record<string, unknown>>;
76
- }) => void): void;
77
66
  /**
78
67
  * Gets the value of a property from a field.
79
68
  *
@@ -83,7 +72,8 @@ declare class FormCore {
83
72
  * @param {string[]} options.path - The path to the property if it's nested.
84
73
  * @returns {unknown | undefined} The value of the property, or undefined if the field doesn't exist.
85
74
  */
86
- getValue({ key, property, path, }: {
75
+ getValue({ scope, key, property, path, }: {
76
+ scope: (typeof TEMPLATE_AVALIABLE_SCOPES)[number];
87
77
  key: string;
88
78
  property: string;
89
79
  path: string[];
@@ -103,7 +93,7 @@ declare class FormCore {
103
93
  key: string;
104
94
  property: string;
105
95
  path: string[];
106
- originKey: string;
96
+ originKey?: string;
107
97
  value: unknown;
108
98
  event: TMutationEvents;
109
99
  }): void;
@@ -113,7 +103,7 @@ declare class FormCore {
113
103
  * @param {string} expression - The expression containing parameters.
114
104
  * @returns {string[]} An array of extracted parameters.
115
105
  */
116
- extractParams(expression: string): string[];
106
+ extractParams(expression: string): unknown[];
117
107
  /**
118
108
  * Replaces expressions marked by ${...} in the expression string with the provided values.
119
109
  *
@@ -121,7 +111,7 @@ declare class FormCore {
121
111
  * @param {string[]} values - The values to be inserted into the marked expressions.
122
112
  * @returns {string} The expression string with the replacements made.
123
113
  */
124
- replaceExpression(expression: string, values: string[]): string;
114
+ replaceExpression(expression: string, values: unknown[]): string;
125
115
  /**
126
116
  * Checks if an expression string contains string concatenation within a marked expression.
127
117
  *
@@ -136,10 +126,7 @@ declare class FormCore {
136
126
  * @param {string} options.key - The key of the field triggering the update.
137
127
  * @param {TMutationEvents} options.event - Internal event descriptor to handle templating.
138
128
  */
139
- refreshTemplates({ key, event }: {
140
- key: string;
141
- event: TMutationEvents;
142
- }): void;
129
+ refreshTemplates({ key, event }: TTemplateEvent): void;
143
130
  /**
144
131
  * Validates and collects the names of form fields in the provided schema structure.
145
132
  *
@@ -150,6 +137,15 @@ declare class FormCore {
150
137
  * @private
151
138
  */
152
139
  private static checkIndexes;
140
+ /**
141
+ * @internal
142
+ * Update field visibility accordingly.
143
+ *
144
+ * @param {string} field - Field name to be updated.
145
+ * @param {boolean} hasError - Condition to be used as visibility.
146
+ * @param {boolean|undefined} showOnlyIfTrue - Flag to be considered when update field visibility. If it's true, then considered error, if it's false, always considered the opposite.
147
+ */
148
+ private setFieldVisibility;
153
149
  /**
154
150
  * Validates visibility conditions for a given event and updates field visibility accordingly.
155
151
  *
@@ -161,6 +157,14 @@ declare class FormCore {
161
157
  event: TEvents;
162
158
  key: string;
163
159
  }): void;
160
+ /**
161
+ * @internal
162
+ * Update field value and emit change and cleared event.
163
+ *
164
+ * @param {string} key - Field name to be updated.
165
+ * @param {unknown} value - Value to be inserted into field.
166
+ */
167
+ private setResetFieldValue;
164
168
  /**
165
169
  * Resets field values based on reset conditions defined in the schema.
166
170
  *
@@ -176,6 +180,7 @@ declare class FormCore {
176
180
  * Adds a field onto the form instance regardless there is a schema or not
177
181
  *
178
182
  * @param fieldSchema
183
+ * @param mapperElement
179
184
  */
180
185
  addField({ fieldSchema, mapperElement, }: {
181
186
  fieldSchema: IComponentSchema;
@@ -190,13 +195,13 @@ declare class FormCore {
190
195
  * @param {IComponentSchema[]} [struct] - The schema structure to serialize.
191
196
  * @param {string} [path] - The path of the parent component.
192
197
  */
193
- serializeStructure(struct?: IComponentSchema[], path?: string): void;
198
+ serializeStructure(struct?: IComponentSchemaAsFormField<unknown>[], path?: string): void;
194
199
  /**
195
200
  * Refreshes form fields based on changes in the schema structure.
196
201
  *
197
202
  * @param {IComponentSchema[]} struct - The updated schema structure.
198
203
  */
199
- refreshFields(struct: IComponentSchema[]): void;
204
+ refreshFields(struct: IComponentSchemaAsFormField<unknown>[]): void;
200
205
  /**
201
206
  * Gets a form field by its key.
202
207
  *
@@ -216,14 +221,28 @@ declare class FormCore {
216
221
  *
217
222
  * @returns {TFormValues} The current form values.
218
223
  */
219
- getFormValues(): TFormValues<Record<string, unknown>>;
224
+ getFormValues<T>(): TFormValues<T>;
220
225
  subscribeFieldEvent({ callback, }: {
221
226
  callback: (payload: TFieldEvent) => void;
222
227
  }): Subscription;
228
+ subscribeOnMount<T>(callback: (payload: TFormValues<T>) => void): Subscription;
229
+ /**
230
+ *
231
+ * @param {(payload: { field: string; data: TFormValues }) => void} callback callback function to call on data
232
+ */
233
+ subscribeData<T>(callback: (payload: {
234
+ field: string;
235
+ data: TFormValues<T>;
236
+ }) => void): Subscription;
237
+ subscribeOnSubmit<T>(callback: (payload: TFormValues<T>) => void): Subscription;
238
+ /**
239
+ * Submits the form by triggering form field events and invoking the onSubmit callback.
240
+ */
241
+ mounted<T>(): void;
223
242
  /**
224
243
  * Submits the form by triggering form field events and invoking the onSubmit callback.
225
244
  */
226
- submit(): void;
245
+ submit<T>(): void;
227
246
  destroy(): void;
228
247
  }
229
248
  type TFormCore = FormCore;
@@ -79,7 +79,15 @@ declare class FormGroup {
79
79
  * @param {string[]} indexes form indexes to be submitted
80
80
  * @returns
81
81
  */
82
- submitMultipleFormsByIndex<T>(indexes: string[]): TFormValues<T>;
82
+ submitMultipleFormsByIndex<T>(indexes: string[], callback?: (payload: TFormValues<T>) => void): void;
83
+ onDataSubscription<T>({ ids, callback, }: {
84
+ ids: string[];
85
+ callback: (payload: Record<string, {
86
+ formId: string;
87
+ formField: string;
88
+ values?: TFormValues<T>;
89
+ }>) => void;
90
+ }): import("rxjs").Subscription;
83
91
  }
84
92
  type TFormGroup = FormGroup;
85
93
  export { TFormGroup, FormGroup };
@@ -8,7 +8,7 @@ import { IFormField } from '../managers';
8
8
  * const event: TEvents = 'ON_FIELD_CHANGE';
9
9
  * ```
10
10
  */
11
- type TEvents = 'ON_FIELD_MOUNT' | 'ON_FIELD_CHANGE' | 'ON_FIELD_BLUR' | 'ON_FIELD_FOCUS' | 'ON_FIELD_CLICK' | 'ON_FIELD_KEYUP' | 'ON_FIELD_KEYDOWN' | 'ON_FORM_SUBMIT' | 'ON_API_FIELD_RESPONSE';
11
+ type TEvents = 'ON_FIELD_MOUNT' | 'ON_FIELD_CHANGE' | 'ON_FIELD_BLUR' | 'ON_FIELD_FOCUS' | 'ON_FIELD_CLICK' | 'ON_FIELD_KEYUP' | 'ON_FIELD_KEYDOWN' | 'ON_FIELD_CLEARED' | 'ON_FORM_SUBMIT' | 'ON_FORM_MOUNT' | 'ON_API_FIELD_RESPONSE';
12
12
  /**
13
13
  * @type TMutationEvents
14
14
  * Represents the different types of events that can occur internally that triggers templating.
@@ -46,4 +46,4 @@ type TFieldEvent = {
46
46
  fieldName: string;
47
47
  fieldInstance?: IFormField;
48
48
  };
49
- export { TEvents, TMutationEvents, TMutationEnum, TValueChangeEvent, TFieldEvent };
49
+ export { TEvents, TMutationEvents, TMutationEnum, TValueChangeEvent, TFieldEvent, };
@@ -41,11 +41,6 @@ type TFormValues<T> = {
41
41
  */
42
42
  type TFormEntry = Omit<IFormSchema, 'components'> & {
43
43
  schema?: IFormSchema;
44
- onSubmit?: <T>(data: TFormValues<T>) => void;
45
- onData?: <T>(payload: {
46
- field: string;
47
- data: TFormValues<T>;
48
- }) => void;
49
44
  mappers?: TMapper<unknown>[];
50
45
  };
51
46
  export { TFormValues, TFormEntry };