@bolttech/form-engine-core 1.0.1-beta.3 → 1.0.2-beta.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/index.esm.js CHANGED
@@ -4213,6 +4213,7 @@ class FormGroup {
4213
4213
  this.dataSubject$ = new Subject();
4214
4214
  this.formValidSubject$ = new Subject();
4215
4215
  this.submitSubject$ = new Subject();
4216
+ this.mappers = entry === null || entry === void 0 ? void 0 : entry.mappers;
4216
4217
  }
4217
4218
  /**
4218
4219
  * Creates an empty form with given index
@@ -4358,9 +4359,8 @@ class FormGroup {
4358
4359
  formIndex
4359
4360
  }) => ids.includes(formIndex)), groupBy(({
4360
4361
  event,
4361
- formIndex,
4362
- fieldIndex
4363
- }) => `${event}.${formIndex}.${fieldIndex}`), mergeMap(group$ => group$.pipe(debounceTime(this.config.defaultStateRefreshTimeMS))), map(({
4362
+ formIndex
4363
+ }) => `${event}.${formIndex}`), mergeMap(group$ => group$.pipe(debounceTime(this.config.defaultStateRefreshTimeMS))), map(({
4364
4364
  fieldIndex,
4365
4365
  formIndex
4366
4366
  }) => ids.reduce((acc, curr) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine-core",
3
- "version": "1.0.1-beta.3",
3
+ "version": "1.0.2-beta.0",
4
4
  "module": "./index.esm.js",
5
5
  "type": "module",
6
6
  "main": "./index.esm.js",
@@ -8,6 +8,7 @@
8
8
  "@gaignoux/currency": "1.1.0",
9
9
  "credit-card-type": "10.0.1",
10
10
  "lodash": "4.17.21",
11
+ "react": "18.2.0",
11
12
  "rxjs": "7.8.1"
12
13
  },
13
14
  "peerDependencies": {}
@@ -7,16 +7,18 @@ import { TFormDataPayload, TFormGroupOnDataEventPayload, TFormGroupOnSubmitEvent
7
7
  /**
8
8
  * Represents a group that manages multiple forms.
9
9
  */
10
- declare class FormGroup {
10
+ declare class FormGroup<ComponentElementType> {
11
11
  forms: Map<string, TFormCore>;
12
12
  config: Required<TSchemaFormConfig>;
13
13
  dataSubject$: Subject<TFormDataPayload>;
14
14
  formValidSubject$: Subject<TFormValidationPayload>;
15
15
  submitSubject$: Subject<TFormSubmitPayload<unknown>>;
16
+ mappers?: TMapper<ComponentElementType>[];
16
17
  /**
17
18
  * Creates an instance of FormGroup.
18
19
  */
19
20
  constructor(entry?: {
21
+ mappers?: TMapper<ComponentElementType>[];
20
22
  config?: TSchemaFormConfig;
21
23
  });
22
24
  /**
@@ -104,5 +106,5 @@ declare class FormGroup {
104
106
  }): import("rxjs").Subscription;
105
107
  destroy: () => void;
106
108
  }
107
- type TFormGroup = FormGroup;
109
+ type TFormGroup<T> = FormGroup<T>;
108
110
  export { TFormGroup, FormGroup };
@@ -83,15 +83,16 @@ type TFormValidationPayload = {
83
83
  type TFieldValidationPayload = {
84
84
  fieldTrigger: string;
85
85
  };
86
+ type TFormDataValues<T> = {
87
+ formId: string;
88
+ formField: string;
89
+ values?: TFormValues<T>;
90
+ };
86
91
  /**
87
92
  * @type TFormGroupOnDataEventPayload
88
93
  * Form Group onData event emitted payload on callback function parameter
89
94
  */
90
- type TFormGroupOnDataEventPayload<T> = Record<string, {
91
- formId: string;
92
- formField: string;
93
- values?: TFormValues<T>;
94
- }>;
95
+ type TFormGroupOnDataEventPayload<T> = Record<string, TFormDataValues<T>>;
95
96
  /**
96
97
  * @type TFormGroupOnValidEventPayload
97
98
  * Form Group onValid event emitted payload on callback function parameter
@@ -105,4 +106,4 @@ type TFormGroupOnValidEventPayload = {
105
106
  * Form Group onSubmit event emitted payload on callback function parameter
106
107
  */
107
108
  type TFormGroupOnSubmitEventPayload<T> = Record<string, TFormValues<T> | undefined>;
108
- export { TEvents, TMutationEvents, TMutationEnum, TValueChangeEvent, TFieldEvent, TFormDataPayload, TFormSubmitPayload, TFormGroupOnDataEventPayload, TFormGroupOnValidEventPayload, TFormGroupOnSubmitEventPayload, TFormValidationPayload, TFieldValidationPayload, };
109
+ export { TEvents, TMutationEvents, TMutationEnum, TValueChangeEvent, TFieldEvent, TFormDataPayload, TFormDataValues, TFormSubmitPayload, TFormGroupOnDataEventPayload, TFormGroupOnValidEventPayload, TFormGroupOnSubmitEventPayload, TFormValidationPayload, TFieldValidationPayload, };