@aemforms/af-core 0.22.76 → 0.22.77

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.
@@ -1439,7 +1439,7 @@ class BaseNode {
1439
1439
  return [];
1440
1440
  }
1441
1441
  _bindToDataModel(contextualDataModel) {
1442
- if (this.id === '$form') {
1442
+ if (this.fieldType === 'form' || this.id === '$form') {
1443
1443
  this._data = contextualDataModel;
1444
1444
  return;
1445
1445
  }
@@ -3061,7 +3061,7 @@ class Form extends Container {
3061
3061
  };
3062
3062
  });
3063
3063
  const fieldChangedAction = new FieldChanged(changes, field);
3064
- this.dispatch(fieldChangedAction);
3064
+ this.notifyDependents(fieldChangedAction);
3065
3065
  }
3066
3066
  });
3067
3067
  }
@@ -3125,7 +3125,7 @@ class Form extends Container {
3125
3125
  return null;
3126
3126
  }
3127
3127
  get id() {
3128
- return '$form';
3128
+ return this._jsonModel.id || '$form';
3129
3129
  }
3130
3130
  get title() {
3131
3131
  return this._jsonModel.title || '';
@@ -95,7 +95,7 @@ declare class Checkbox extends Field {
95
95
  description?: string | undefined;
96
96
  rules?: import("./types").Items<string> | undefined;
97
97
  events?: import("./types").Items<string | string[] | undefined> | undefined;
98
- enumNames?: string[] | import("./types").EnumName[] | undefined;
98
+ enumNames?: string[] | undefined;
99
99
  enum?: any[] | undefined;
100
100
  accept?: string[] | undefined;
101
101
  enforceEnum?: boolean | undefined;
@@ -40,8 +40,8 @@ declare class Field extends Scriptable<FieldJson> implements FieldModel {
40
40
  get emptyValue(): "" | null | undefined;
41
41
  get enum(): any[] | undefined;
42
42
  set enum(e: any[] | undefined);
43
- get enumNames(): string[] | import("./types").EnumName[] | undefined;
44
- set enumNames(e: string[] | import("./types").EnumName[] | undefined);
43
+ get enumNames(): string[] | undefined;
44
+ set enumNames(e: string[] | undefined);
45
45
  get required(): boolean;
46
46
  set required(r: boolean);
47
47
  get maximum(): number | undefined;
@@ -163,7 +163,7 @@ declare class Field extends Scriptable<FieldJson> implements FieldModel {
163
163
  description?: string | undefined;
164
164
  rules?: import("./types").Items<string> | undefined;
165
165
  events?: import("./types").Items<string | string[] | undefined> | undefined;
166
- enumNames?: string[] | import("./types").EnumName[] | undefined;
166
+ enumNames?: string[] | undefined;
167
167
  enum?: any[] | undefined;
168
168
  accept?: string[] | undefined;
169
169
  enforceEnum?: boolean | undefined;
@@ -26,7 +26,7 @@ declare class Form extends Container<FormJson> implements FormModel {
26
26
  getState(forRestore?: boolean): {
27
27
  description?: string | undefined;
28
28
  } & import("./types/Json").RulesJson & {
29
- enumNames?: string[] | import("./types/Json").EnumName[] | undefined;
29
+ enumNames?: string[] | undefined;
30
30
  enum?: any[] | undefined;
31
31
  } & {
32
32
  accept?: string[] | undefined;
@@ -7,12 +7,8 @@ export type Label = {
7
7
  richText?: boolean;
8
8
  visible?: boolean;
9
9
  };
10
- export type EnumName = {
11
- value: string;
12
- richText?: boolean;
13
- };
14
10
  type TranslationConstraintsJson = {
15
- enumNames?: string[] | EnumName[];
11
+ enumNames?: string[];
16
12
  enum?: any[];
17
13
  };
18
14
  export type ConstraintsJson = TranslationConstraintsJson & {
package/lib/BaseNode.js CHANGED
@@ -336,7 +336,7 @@ class BaseNode {
336
336
  return [];
337
337
  }
338
338
  _bindToDataModel(contextualDataModel) {
339
- if (this.id === '$form') {
339
+ if (this.fieldType === 'form' || this.id === '$form') {
340
340
  this._data = contextualDataModel;
341
341
  return;
342
342
  }
package/lib/Checkbox.d.ts CHANGED
@@ -95,7 +95,7 @@ declare class Checkbox extends Field {
95
95
  description?: string | undefined;
96
96
  rules?: import("./types").Items<string> | undefined;
97
97
  events?: import("./types").Items<string | string[] | undefined> | undefined;
98
- enumNames?: string[] | import("./types").EnumName[] | undefined;
98
+ enumNames?: string[] | undefined;
99
99
  enum?: any[] | undefined;
100
100
  accept?: string[] | undefined;
101
101
  enforceEnum?: boolean | undefined;
package/lib/Field.d.ts CHANGED
@@ -40,8 +40,8 @@ declare class Field extends Scriptable<FieldJson> implements FieldModel {
40
40
  get emptyValue(): "" | null | undefined;
41
41
  get enum(): any[] | undefined;
42
42
  set enum(e: any[] | undefined);
43
- get enumNames(): string[] | import("./types").EnumName[] | undefined;
44
- set enumNames(e: string[] | import("./types").EnumName[] | undefined);
43
+ get enumNames(): string[] | undefined;
44
+ set enumNames(e: string[] | undefined);
45
45
  get required(): boolean;
46
46
  set required(r: boolean);
47
47
  get maximum(): number | undefined;
@@ -163,7 +163,7 @@ declare class Field extends Scriptable<FieldJson> implements FieldModel {
163
163
  description?: string | undefined;
164
164
  rules?: import("./types").Items<string> | undefined;
165
165
  events?: import("./types").Items<string | string[] | undefined> | undefined;
166
- enumNames?: string[] | import("./types").EnumName[] | undefined;
166
+ enumNames?: string[] | undefined;
167
167
  enum?: any[] | undefined;
168
168
  accept?: string[] | undefined;
169
169
  enforceEnum?: boolean | undefined;
package/lib/Form.d.ts CHANGED
@@ -26,7 +26,7 @@ declare class Form extends Container<FormJson> implements FormModel {
26
26
  getState(forRestore?: boolean): {
27
27
  description?: string | undefined;
28
28
  } & import("./types/Json").RulesJson & {
29
- enumNames?: string[] | import("./types/Json").EnumName[] | undefined;
29
+ enumNames?: string[] | undefined;
30
30
  enum?: any[] | undefined;
31
31
  } & {
32
32
  accept?: string[] | undefined;
package/lib/Form.js CHANGED
@@ -179,7 +179,7 @@ class Form extends Container_1.default {
179
179
  };
180
180
  });
181
181
  const fieldChangedAction = new Events_1.FieldChanged(changes, field);
182
- this.dispatch(fieldChangedAction);
182
+ this.notifyDependents(fieldChangedAction);
183
183
  }
184
184
  });
185
185
  }
@@ -244,7 +244,7 @@ class Form extends Container_1.default {
244
244
  return null;
245
245
  }
246
246
  get id() {
247
- return '$form';
247
+ return this._jsonModel.id || '$form';
248
248
  }
249
249
  get title() {
250
250
  return this._jsonModel.title || '';
@@ -7,12 +7,8 @@ export declare type Label = {
7
7
  richText?: boolean;
8
8
  visible?: boolean;
9
9
  };
10
- export declare type EnumName = {
11
- value: string;
12
- richText?: boolean;
13
- };
14
10
  declare type TranslationConstraintsJson = {
15
- enumNames?: string[] | EnumName[];
11
+ enumNames?: string[];
16
12
  enum?: any[];
17
13
  };
18
14
  export declare type ConstraintsJson = TranslationConstraintsJson & {
@@ -35,11 +35,6 @@ const addTranslationId = (input, additionalTranslationProps = []) => {
35
35
  exports.addTranslationId = addTranslationId;
36
36
  const _createTranslationId = (input, path, transProps) => {
37
37
  Object.entries(input).forEach(([key, value]) => {
38
- if (key === 'enumNames' && value instanceof Array) {
39
- value = value.map((x) => {
40
- return typeof x === 'string' ? x : x === null || x === void 0 ? void 0 : x.value;
41
- });
42
- }
43
38
  if (typeof value == 'object') {
44
39
  if (input instanceof Array) {
45
40
  if (value && 'name' in value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aemforms/af-core",
3
- "version": "0.22.76",
3
+ "version": "0.22.77",
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.76"
40
+ "@aemforms/af-formatters": "^0.22.77"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/preset-env": "^7.20.2",