@aemforms/af-core 0.22.167 → 0.22.169

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.
@@ -2045,6 +2045,11 @@ class Scriptable extends BaseNode {
2045
2045
  }
2046
2046
  return this._events[eName] || [];
2047
2047
  }
2048
+ getState(forRestore = false) {
2049
+ const state = super.getState(forRestore);
2050
+ state.events = state.events || {};
2051
+ return state;
2052
+ }
2048
2053
  applyUpdates(updates) {
2049
2054
  if (typeof updates === 'object') {
2050
2055
  if (updates !== null) {
@@ -8,6 +8,27 @@ declare abstract class Scriptable<T extends RulesJson> extends BaseNode<T> imple
8
8
  getRules(): import("./types/Json").Items<string>;
9
9
  private getCompiledRule;
10
10
  private getCompiledEvent;
11
+ getState(forRestore?: boolean): T & {
12
+ _dependents?: {
13
+ id: string;
14
+ propertyName: string | undefined;
15
+ }[] | undefined;
16
+ allowedComponents?: undefined;
17
+ columnClassNames?: undefined;
18
+ columnCount?: undefined;
19
+ gridClassNames?: undefined;
20
+ ':type': string;
21
+ repeatable?: boolean | undefined;
22
+ minOccur?: number | undefined;
23
+ maxOccur?: number | undefined;
24
+ properties: {
25
+ [key: string]: any;
26
+ };
27
+ index: number;
28
+ parent: undefined;
29
+ qualifiedName: any;
30
+ id: string;
31
+ };
11
32
  protected applyUpdates(updates: any): void;
12
33
  protected executeAllRules(context: any): void;
13
34
  private getExpressionScope;
@@ -8,6 +8,27 @@ declare abstract class Scriptable<T extends RulesJson> extends BaseNode<T> imple
8
8
  getRules(): import("./types/Json").Items<string>;
9
9
  private getCompiledRule;
10
10
  private getCompiledEvent;
11
+ getState(forRestore?: boolean): T & {
12
+ _dependents?: {
13
+ id: string;
14
+ propertyName: string | undefined;
15
+ }[] | undefined;
16
+ allowedComponents?: undefined;
17
+ columnClassNames?: undefined;
18
+ columnCount?: undefined;
19
+ gridClassNames?: undefined;
20
+ ':type': string;
21
+ repeatable?: boolean | undefined;
22
+ minOccur?: number | undefined;
23
+ maxOccur?: number | undefined;
24
+ properties: {
25
+ [key: string]: any;
26
+ };
27
+ index: number;
28
+ parent: undefined;
29
+ qualifiedName: any;
30
+ id: string;
31
+ };
11
32
  protected applyUpdates(updates: any): void;
12
33
  protected executeAllRules(context: any): void;
13
34
  private getExpressionScope;
package/lib/Scriptable.js CHANGED
@@ -81,6 +81,11 @@ class Scriptable extends BaseNode_1.BaseNode {
81
81
  }
82
82
  return this._events[eName] || [];
83
83
  }
84
+ getState(forRestore = false) {
85
+ const state = super.getState(forRestore);
86
+ state.events = state.events || {};
87
+ return state;
88
+ }
84
89
  applyUpdates(updates) {
85
90
  if (typeof updates === 'object') {
86
91
  if (updates !== null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aemforms/af-core",
3
- "version": "0.22.167",
3
+ "version": "0.22.169",
4
4
  "description": "Core Module for Forms Runtime",
5
5
  "author": "Adobe Systems",
6
6
  "license": "Adobe Proprietary",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@adobe/json-formula": "0.1.50",
40
- "@aemforms/af-formatters": "^0.22.167"
40
+ "@aemforms/af-formatters": "^0.22.169"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/preset-env": "^7.20.2",