@aemforms/af-core 0.22.165 → 0.22.167

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.
@@ -1840,6 +1840,12 @@ class BaseNode {
1840
1840
  }
1841
1841
  if (_data) {
1842
1842
  if (!this.isContainer && _parent !== NullDataValue && _data !== NullDataValue) {
1843
+ if (_data.$isDataGroup && _data.$_fields.length > 0) {
1844
+ console.error(`Data binding conflict: non-container field "${this._jsonModel.name || this.id}" ` +
1845
+ `with dataRef "${dataRef}" points to a DataGroup already bound by a container. ` +
1846
+ 'This would destroy existing child data. The data of this field will not be exported.');
1847
+ return this._data;
1848
+ }
1843
1849
  _data = _data?.$convertToDataValue();
1844
1850
  _parent.$addDataNode(_key, _data, true);
1845
1851
  }
@@ -2005,6 +2011,9 @@ class Scriptable extends BaseNode {
2005
2011
  getCompiledEvent(eName) {
2006
2012
  if (!(eName in this._events)) {
2007
2013
  let eString = this._jsonModel.events?.[eName];
2014
+ if (eName === 'custom:setProperty' && typeof eString === 'undefined') {
2015
+ eString = ['$event.payload'];
2016
+ }
2008
2017
  if (typeof eString === 'string' && eString.length > 0) {
2009
2018
  eString = [eString];
2010
2019
  }
@@ -2778,7 +2787,15 @@ class EventNode {
2778
2787
  return that !== null && that !== undefined && this._node == that._node && this._event.type == that._event.type;
2779
2788
  }
2780
2789
  toString() {
2781
- return this._node.id + '__' + this.event.type;
2790
+ const base = this._node.id + '__' + this._event.type;
2791
+ if (this._event.type === 'change' && this._event.payload?.changes) {
2792
+ const sig = this._event.payload.changes
2793
+ .map((c) => c.propertyName)
2794
+ .sort()
2795
+ .join(',');
2796
+ return base + '__' + sig;
2797
+ }
2798
+ return base;
2782
2799
  }
2783
2800
  valueOf() {
2784
2801
  return this.toString();
package/lib/BaseNode.js CHANGED
@@ -491,6 +491,12 @@ class BaseNode {
491
491
  }
492
492
  if (_data) {
493
493
  if (!this.isContainer && _parent !== EmptyDataValue_1.default && _data !== EmptyDataValue_1.default) {
494
+ if (_data.$isDataGroup && _data.$_fields.length > 0) {
495
+ console.error(`Data binding conflict: non-container field "${this._jsonModel.name || this.id}" ` +
496
+ `with dataRef "${dataRef}" points to a DataGroup already bound by a container. ` +
497
+ 'This would destroy existing child data. The data of this field will not be exported.');
498
+ return this._data;
499
+ }
494
500
  _data = _data === null || _data === void 0 ? void 0 : _data.$convertToDataValue();
495
501
  _parent.$addDataNode(_key, _data, true);
496
502
  }
package/lib/Scriptable.js CHANGED
@@ -47,6 +47,9 @@ class Scriptable extends BaseNode_1.BaseNode {
47
47
  var _a;
48
48
  if (!(eName in this._events)) {
49
49
  let eString = (_a = this._jsonModel.events) === null || _a === void 0 ? void 0 : _a[eName];
50
+ if (eName === 'custom:setProperty' && typeof eString === 'undefined') {
51
+ eString = ['$event.payload'];
52
+ }
50
53
  if (typeof eString === 'string' && eString.length > 0) {
51
54
  eString = [eString];
52
55
  }
@@ -16,7 +16,16 @@ class EventNode {
16
16
  return that !== null && that !== undefined && this._node == that._node && this._event.type == that._event.type;
17
17
  }
18
18
  toString() {
19
- return this._node.id + '__' + this.event.type;
19
+ var _a;
20
+ const base = this._node.id + '__' + this._event.type;
21
+ if (this._event.type === 'change' && ((_a = this._event.payload) === null || _a === void 0 ? void 0 : _a.changes)) {
22
+ const sig = this._event.payload.changes
23
+ .map((c) => c.propertyName)
24
+ .sort()
25
+ .join(',');
26
+ return base + '__' + sig;
27
+ }
28
+ return base;
20
29
  }
21
30
  valueOf() {
22
31
  return this.toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aemforms/af-core",
3
- "version": "0.22.165",
3
+ "version": "0.22.167",
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.165"
40
+ "@aemforms/af-formatters": "^0.22.167"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/preset-env": "^7.20.2",