@aemforms/af-core 0.22.125 → 0.22.126
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/esm/afb-runtime.js +24 -19
- package/lib/BaseNode.js +23 -18
- package/package.json +2 -2
package/esm/afb-runtime.js
CHANGED
|
@@ -1584,26 +1584,31 @@ class BaseNode {
|
|
|
1584
1584
|
_data = NullDataValue;
|
|
1585
1585
|
}
|
|
1586
1586
|
else if (dataRef !== undefined && !this.repeatable) {
|
|
1587
|
-
|
|
1588
|
-
this._tokens
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
else if (this._tokens[0].type === TOK_REPEATABLE) {
|
|
1595
|
-
let repeatRoot = this.parent;
|
|
1596
|
-
while (!repeatRoot.repeatable && repeatRoot !== this.form) {
|
|
1597
|
-
repeatRoot = repeatRoot.parent;
|
|
1587
|
+
try {
|
|
1588
|
+
if (this._tokens.length === 0) {
|
|
1589
|
+
this._tokens = tokenize(dataRef);
|
|
1590
|
+
}
|
|
1591
|
+
let searchData = contextualDataModel;
|
|
1592
|
+
if (this._tokens[0].type === TOK_GLOBAL) {
|
|
1593
|
+
searchData = this.form.getDataNode();
|
|
1598
1594
|
}
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1595
|
+
else if (this._tokens[0].type === TOK_REPEATABLE) {
|
|
1596
|
+
let repeatRoot = this.parent;
|
|
1597
|
+
while (!repeatRoot.repeatable && repeatRoot !== this.form) {
|
|
1598
|
+
repeatRoot = repeatRoot.parent;
|
|
1599
|
+
}
|
|
1600
|
+
searchData = repeatRoot.getDataNode();
|
|
1601
|
+
}
|
|
1602
|
+
if (typeof searchData !== 'undefined') {
|
|
1603
|
+
const name = this._tokens[this._tokens.length - 1].value;
|
|
1604
|
+
const create = this.defaultDataModel(name);
|
|
1605
|
+
_data = resolveData(searchData, this._tokens, create);
|
|
1606
|
+
_parent = resolveData(searchData, this._tokens.slice(0, -1));
|
|
1607
|
+
_key = name;
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
catch (error) {
|
|
1611
|
+
console.error(`Error parsing dataRef "${dataRef}" for field "${this.id}". The data of this field will not be exported.`);
|
|
1607
1612
|
}
|
|
1608
1613
|
}
|
|
1609
1614
|
else {
|
package/lib/BaseNode.js
CHANGED
|
@@ -380,26 +380,31 @@ class BaseNode {
|
|
|
380
380
|
_data = EmptyDataValue_1.default;
|
|
381
381
|
}
|
|
382
382
|
else if (dataRef !== undefined && !this.repeatable) {
|
|
383
|
-
|
|
384
|
-
this._tokens
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
repeatRoot
|
|
383
|
+
try {
|
|
384
|
+
if (this._tokens.length === 0) {
|
|
385
|
+
this._tokens = (0, DataRefParser_1.tokenize)(dataRef);
|
|
386
|
+
}
|
|
387
|
+
let searchData = contextualDataModel;
|
|
388
|
+
if (this._tokens[0].type === DataRefParser_1.TOK_GLOBAL) {
|
|
389
|
+
searchData = this.form.getDataNode();
|
|
390
|
+
}
|
|
391
|
+
else if (this._tokens[0].type === DataRefParser_1.TOK_REPEATABLE) {
|
|
392
|
+
let repeatRoot = this.parent;
|
|
393
|
+
while (!repeatRoot.repeatable && repeatRoot !== this.form) {
|
|
394
|
+
repeatRoot = repeatRoot.parent;
|
|
395
|
+
}
|
|
396
|
+
searchData = repeatRoot.getDataNode();
|
|
397
|
+
}
|
|
398
|
+
if (typeof searchData !== 'undefined') {
|
|
399
|
+
const name = this._tokens[this._tokens.length - 1].value;
|
|
400
|
+
const create = this.defaultDataModel(name);
|
|
401
|
+
_data = (0, DataRefParser_1.resolveData)(searchData, this._tokens, create);
|
|
402
|
+
_parent = (0, DataRefParser_1.resolveData)(searchData, this._tokens.slice(0, -1));
|
|
403
|
+
_key = name;
|
|
394
404
|
}
|
|
395
|
-
searchData = repeatRoot.getDataNode();
|
|
396
405
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
const create = this.defaultDataModel(name);
|
|
400
|
-
_data = (0, DataRefParser_1.resolveData)(searchData, this._tokens, create);
|
|
401
|
-
_parent = (0, DataRefParser_1.resolveData)(searchData, this._tokens.slice(0, -1));
|
|
402
|
-
_key = name;
|
|
406
|
+
catch (error) {
|
|
407
|
+
console.error(`Error parsing dataRef "${dataRef}" for field "${this.id}". The data of this field will not be exported.`);
|
|
403
408
|
}
|
|
404
409
|
}
|
|
405
410
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aemforms/af-core",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.126",
|
|
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.
|
|
40
|
+
"@aemforms/af-formatters": "^0.22.126"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@babel/preset-env": "^7.20.2",
|