@aemforms/af-core 0.22.145 → 0.22.146

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.
@@ -1606,7 +1606,14 @@ class BaseNode {
1606
1606
  };
1607
1607
  }
1608
1608
  _addDependent(dependent, propertyName) {
1609
- if (this._dependents.find(({ node }) => node === dependent) === undefined) {
1609
+ const existingDependency = this._dependents.find(({ node, propertyName: existingProp }) => {
1610
+ let isExistingDependent = node === dependent;
1611
+ if (isExistingDependent && propertyName && propertyName.startsWith('properties.')) {
1612
+ isExistingDependent = existingProp === propertyName;
1613
+ }
1614
+ return isExistingDependent;
1615
+ });
1616
+ if (existingDependency === undefined) {
1610
1617
  const subscription = this.subscribe((change) => {
1611
1618
  const changes = change.payload.changes;
1612
1619
  const propsToLook = [...dynamicProps, 'items'];
@@ -2533,7 +2540,7 @@ class Container extends Scriptable {
2533
2540
  activeChild.activeChild = null;
2534
2541
  activeChild = temp;
2535
2542
  }
2536
- const change = propertyChange('activeChild', c, this._activeChild);
2543
+ const change = propertyChange('activeChild', c?.getState(), this._activeChild?.getState());
2537
2544
  this._activeChild = c;
2538
2545
  if (this.parent && c !== null) {
2539
2546
  this.parent.activeChild = this;
@@ -3554,7 +3561,7 @@ class FunctionRuntimeImpl {
3554
3561
  return '';
3555
3562
  }
3556
3563
  if (interpreter.globals.form?.properties?.queryParams?.[param]) {
3557
- return interpreter.globals.form.properties.queryParams[param];
3564
+ return interpreter.globals.form.properties.queryParams[param.toLowerCase()];
3558
3565
  }
3559
3566
  try {
3560
3567
  const urlParams = new URLSearchParams(window?.location?.search || '');
package/lib/BaseNode.js CHANGED
@@ -304,7 +304,14 @@ class BaseNode {
304
304
  };
305
305
  }
306
306
  _addDependent(dependent, propertyName) {
307
- if (this._dependents.find(({ node }) => node === dependent) === undefined) {
307
+ const existingDependency = this._dependents.find(({ node, propertyName: existingProp }) => {
308
+ let isExistingDependent = node === dependent;
309
+ if (isExistingDependent && propertyName && propertyName.startsWith('properties.')) {
310
+ isExistingDependent = existingProp === propertyName;
311
+ }
312
+ return isExistingDependent;
313
+ });
314
+ if (existingDependency === undefined) {
308
315
  const subscription = this.subscribe((change) => {
309
316
  const changes = change.payload.changes;
310
317
  const propsToLook = [...exports.dynamicProps, 'items'];
package/lib/Container.js CHANGED
@@ -422,6 +422,7 @@ class Container extends Scriptable_1.default {
422
422
  return this._activeChild;
423
423
  }
424
424
  set activeChild(c) {
425
+ var _a;
425
426
  if (c !== this._activeChild) {
426
427
  let activeChild = this._activeChild;
427
428
  while (activeChild instanceof Container) {
@@ -429,7 +430,7 @@ class Container extends Scriptable_1.default {
429
430
  activeChild.activeChild = null;
430
431
  activeChild = temp;
431
432
  }
432
- const change = (0, Events_1.propertyChange)('activeChild', c, this._activeChild);
433
+ const change = (0, Events_1.propertyChange)('activeChild', c === null || c === void 0 ? void 0 : c.getState(), (_a = this._activeChild) === null || _a === void 0 ? void 0 : _a.getState());
433
434
  this._activeChild = c;
434
435
  if (this.parent && c !== null) {
435
436
  this.parent.activeChild = this;
@@ -741,7 +741,7 @@ class FunctionRuntimeImpl {
741
741
  return '';
742
742
  }
743
743
  if ((_c = (_b = (_a = interpreter.globals.form) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.queryParams) === null || _c === void 0 ? void 0 : _c[param]) {
744
- return interpreter.globals.form.properties.queryParams[param];
744
+ return interpreter.globals.form.properties.queryParams[param.toLowerCase()];
745
745
  }
746
746
  try {
747
747
  const urlParams = new URLSearchParams(((_d = window === null || window === void 0 ? void 0 : window.location) === null || _d === void 0 ? void 0 : _d.search) || '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aemforms/af-core",
3
- "version": "0.22.145",
3
+ "version": "0.22.146",
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.145"
40
+ "@aemforms/af-formatters": "^0.22.146"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/preset-env": "^7.20.2",