@bolttech/form-engine-core 0.0.1-beta.39 → 0.0.1-beta.40

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
@@ -730,7 +730,7 @@ const custom = (value, masks) => {
730
730
  if (!masks.custom || !value) return value;
731
731
  let mask = '';
732
732
  let index = 0;
733
- let convertedValue = value.replace(/[^\w\s]/gi, '');
733
+ const convertedValue = value.replace(/[^\w\s]/gi, '');
734
734
  for (let i = 0; i < masks.custom.length; i++) {
735
735
  if (masks.custom[i] === '#') {
736
736
  if (index < convertedValue.length) {
@@ -2964,7 +2964,7 @@ class FormField {
2964
2964
  */
2965
2965
  destroyField() {
2966
2966
  this._mounted = false;
2967
- this.valueSubject$.unsubscribe();
2967
+ this.valueSubscription$.unsubscribe();
2968
2968
  this.visibilitySubject$.unsubscribe();
2969
2969
  this.fieldStateSubscription$.unsubscribe();
2970
2970
  this.propsSubject$.unsubscribe();
@@ -2990,7 +2990,7 @@ class FormField {
2990
2990
  * @returns {void}
2991
2991
  */
2992
2992
  subscribeValue(callback) {
2993
- this.valueSubject$.subscribe({
2993
+ this.valueSubscription$ = this.valueSubject$.subscribe({
2994
2994
  next: callback
2995
2995
  });
2996
2996
  }
@@ -3037,7 +3037,7 @@ class FormCore {
3037
3037
  this.subscribedTemplates = [];
3038
3038
  this.schema && this.serializeStructure(this.schema.components);
3039
3039
  this.schema && this.subscribeTemplates();
3040
- this.templateSubject$.subscribe(this.refreshTemplates.bind(this));
3040
+ this.templateSubscription = this.templateSubject$.subscribe(this.refreshTemplates.bind(this));
3041
3041
  this.templateSubject$.next({
3042
3042
  key: IVARPROPNAME,
3043
3043
  event: 'ON_IVARS'
@@ -3673,7 +3673,7 @@ class FormCore {
3673
3673
  }
3674
3674
  destroy() {
3675
3675
  this.submitSubject$.unsubscribe();
3676
- this.templateSubject$.unsubscribe();
3676
+ this.templateSubscription.unsubscribe();
3677
3677
  this.fieldEventSubject$.unsubscribe();
3678
3678
  this.dataSubject$.unsubscribe();
3679
3679
  this.fields.forEach(field => field.destroyField());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine-core",
3
- "version": "0.0.1-beta.39",
3
+ "version": "0.0.1-beta.40",
4
4
  "module": "./index.esm.js",
5
5
  "type": "module",
6
6
  "main": "./index.esm.js",
@@ -40,6 +40,7 @@ declare class FormField {
40
40
  propsSubject$: SafeSubject<Record<string, unknown>>;
41
41
  errorSubject$: SafeSubject<Record<string, unknown>>;
42
42
  valueSubject$: SafeSubject<Record<string, unknown>>;
43
+ valueSubscription$: Subscription;
43
44
  visibilitySubject$: SafeSubject<boolean>;
44
45
  apiSubject$: SafeSubject<TApiResponse>;
45
46
  fieldEventSubject$: Subject<TFieldEvent>;
@@ -18,6 +18,7 @@ declare class FormCore {
18
18
  key: string;
19
19
  event: TMutationEvents;
20
20
  }>;
21
+ templateSubscription: Subscription;
21
22
  submitSubject$: Subject<TFormValues<any>>;
22
23
  mountSubject$: Subject<TFormValues<any>>;
23
24
  fieldEventSubject$: Subject<TFieldEvent>;