@bolttech/form-engine-core 1.0.0-beta.10 → 1.0.0-beta.11

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
@@ -1,4 +1,4 @@
1
- import { Subject, Subscription, combineLatest, startWith, groupBy, mergeMap, debounceTime, filter, map, distinctUntilKeyChanged, distinctUntilChanged, skip } from 'rxjs';
1
+ import { Subject, Subscription, groupBy, mergeMap, debounceTime, filter, combineLatest, startWith, map, distinctUntilKeyChanged, distinctUntilChanged, skip } from 'rxjs';
2
2
  import creditCardType from 'credit-card-type';
3
3
  import { isNumber as isNumber$1, isFunction, cloneDeep, merge, isEqual, get, isNil, set } from 'lodash';
4
4
  import { getCurrencySymbol } from '@gaignoux/currency';
@@ -2567,7 +2567,6 @@ class FormField {
2567
2567
  * emissions to unsubscribed fields
2568
2568
  */
2569
2569
  initializeObservers() {
2570
- var _a;
2571
2570
  if (!this.valueSubject$ || this.valueSubject$.closed) {
2572
2571
  this.valueSubject$ = new SafeSubject(() => this.mounted);
2573
2572
  }
@@ -2589,13 +2588,6 @@ class FormField {
2589
2588
  if (!this.apiEventQueueSubject$ || this.apiEventQueueSubject$.closed) {
2590
2589
  this.apiEventQueueSubject$ = new SafeSubject(() => this.mounted);
2591
2590
  }
2592
- this.fieldState$ = combineLatest({
2593
- visibility: this.visibilitySubject$.pipe(startWith(this._visibility)),
2594
- props: this.propsSubject$.pipe(startWith(this._props)),
2595
- errors: this.errorSubject$.pipe(startWith(Object.assign({}, ((_a = this.mapper.events) === null || _a === void 0 ? void 0 : _a.setErrorMessage) && {
2596
- [this.mapper.events.setErrorMessage]: this.errorsString
2597
- })))
2598
- });
2599
2591
  !this.apiEventQueueSubject$.observed && this.apiEventQueueSubject$.pipe(groupBy(({
2600
2592
  event
2601
2593
  }) => event), mergeMap(group$ => group$.pipe(debounceTime(this.config.defaultAPIdebounceTimeMS))), filter(() => this.apiSubject$ && !this.apiSubject$.closed)).subscribe(payload => {
@@ -3112,7 +3104,14 @@ class FormField {
3112
3104
  * @returns {void}
3113
3105
  */
3114
3106
  subscribeState(callback) {
3115
- this.fieldStateSubscription$ = this.fieldState$.pipe(debounceTime(this.config.defaultStateRefreshTimeMS)).subscribe({
3107
+ var _a;
3108
+ this.fieldStateSubscription$ = combineLatest({
3109
+ visibility: this.visibilitySubject$.pipe(startWith(this.visibility)),
3110
+ props: this.propsSubject$.pipe(startWith(this.props)),
3111
+ errors: this.errorSubject$.pipe(startWith(Object.assign({}, ((_a = this.mapper.events) === null || _a === void 0 ? void 0 : _a.setErrorMessage) && {
3112
+ [this.mapper.events.setErrorMessage]: this.errorsString
3113
+ })))
3114
+ }).pipe(debounceTime(this.config.defaultStateRefreshTimeMS)).subscribe({
3116
3115
  next: callback
3117
3116
  });
3118
3117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine-core",
3
- "version": "1.0.0-beta.10",
3
+ "version": "1.0.0-beta.11",
4
4
  "module": "./index.esm.js",
5
5
  "type": "module",
6
6
  "main": "./index.esm.js",
@@ -1,4 +1,4 @@
1
- import { Observable, Subject, Subscription } from 'rxjs';
1
+ import { Subject, Subscription } from 'rxjs';
2
2
  import { TApiConfig, TApiEvent, TApiResponse, TErrorMessages, TFormatters, TMasks, TResetPathMethods, TResetValueMethods, TSchemaFormConfig, TValidations, TVisibility } from '../types/schema';
3
3
  import { IComponentSchema, IComponentSchemaAsFormField } from '../interfaces/schema';
4
4
  import { IState } from '../interfaces/state';
@@ -49,7 +49,6 @@ declare class FormField {
49
49
  apiEventQueueSubject$: SafeSubject<{
50
50
  event: TEvents;
51
51
  }>;
52
- fieldState$: Observable<IState>;
53
52
  fieldStateSubscription$: Subscription;
54
53
  templateSubject$: Subject<TTemplateEvent>;
55
54
  dataSubject$: Subject<{