@aemforms/af-core 0.22.1 → 0.22.4

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/lib/BaseNode.js CHANGED
@@ -109,6 +109,10 @@ class BaseNode {
109
109
  //look for property
110
110
  if (prop.startsWith('$')) {
111
111
  prop = prop.substr(1);
112
+ if (prop === 'parent') {
113
+ return this[prop].getRuleNode();
114
+ }
115
+ //@ts-ignore
112
116
  //@todo: create a list of properties that are allowed
113
117
  //@ts-ignore
114
118
  // return only non functional properties in this object
package/lib/Container.js CHANGED
@@ -199,7 +199,7 @@ class Container extends Scriptable_1.default {
199
199
  */
200
200
  removeItem(action) {
201
201
  if (action.type === 'removeItem' && this._itemTemplate != null) {
202
- const index = action.payload || this._children.length - 1;
202
+ const index = typeof action.payload === 'number' ? action.payload : this._children.length - 1;
203
203
  const state = this._children[index].getState();
204
204
  //@ts-ignore
205
205
  if (this._children.length > this._jsonModel.minItems) {
package/lib/Fieldset.d.ts CHANGED
@@ -29,4 +29,6 @@ export declare class Fieldset extends Container<FieldsetJson> implements Fieldse
29
29
  get items(): (FieldModel | FieldsetModel)[];
30
30
  get value(): null;
31
31
  get fieldType(): string;
32
+ get enabled(): boolean | undefined;
33
+ set enabled(e: boolean | undefined);
32
34
  }
package/lib/Fieldset.js CHANGED
@@ -99,5 +99,11 @@ class Fieldset extends Container_1.default {
99
99
  get fieldType() {
100
100
  return 'panel';
101
101
  }
102
+ get enabled() {
103
+ return this._jsonModel.enabled;
104
+ }
105
+ set enabled(e) {
106
+ this._setProperty('enabled', e);
107
+ }
102
108
  }
103
109
  exports.Fieldset = Fieldset;
package/lib/types/Json.js CHANGED
@@ -9,7 +9,10 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.constraintProps = exports.translationProps = void 0;
11
11
  /** Constant for all properties which can be translated based on `adaptive form specification` */
12
- exports.translationProps = ['description', 'placeholder', 'enum', 'enumNames', 'label.value'];
12
+ exports.translationProps = ['description', 'placeholder', 'enum', 'enumNames', 'label.value', 'constraintMessages.accept',
13
+ 'constraintMessages.enum', 'constraintMessages.exclusiveMinimum', 'constraintMessages.exclusiveMaximum', 'constraintMessages.format', 'constraintMessages.maxFileSize', 'constraintMessages.maxLength',
14
+ 'constraintMessages.maximum', 'constraintMessages.maxItems', 'constraintMessages.minLength', 'constraintMessages.minimum', 'constraintMessages.minItems', 'constraintMessages.pattern', 'constraintMessages.required',
15
+ 'constraintMessages.step', 'constraintMessages.type', 'constraintMessages.validationExpression'];
13
16
  /** Constant for all properties which are constraints based on `adaptive form specification` */
14
17
  exports.constraintProps = ['accept', 'enum', 'exclusiveMinimum', 'exclusiveMaximum',
15
18
  'format', 'maxFileSize', 'maxLength', 'maximum', 'maxItems',
@@ -59,7 +59,15 @@ exports.addTranslationId = addTranslationId;
59
59
  const _createTranslationId = (input, path, transProps) => {
60
60
  Object.entries(input).forEach(([key, value]) => {
61
61
  if (typeof value == 'object') {
62
- _createTranslationId(value, ((key === 'items') ? path : `${path === '' ? path : path + exports.TRANSLATION_TOKEN}${key}${exports.TRANSLATION_TOKEN}${Math.floor(Math.random() * 10000) + 1}`), transProps);
62
+ if (input instanceof Array) {
63
+ if (value && 'name' in value) {
64
+ // @ts-ignore
65
+ _createTranslationId(value, `${path === '' ? path : path + exports.TRANSLATION_TOKEN}${value.name}`, transProps);
66
+ }
67
+ }
68
+ else {
69
+ _createTranslationId(value, ((key === 'items') ? path : `${path === '' ? path : path + exports.TRANSLATION_TOKEN}${key}`), transProps);
70
+ }
63
71
  }
64
72
  else {
65
73
  // set it only if either of type or fieldType properties is present
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aemforms/af-core",
3
- "version": "0.22.1",
3
+ "version": "0.22.4",
4
4
  "description": "Core Module for Forms Runtime",
5
5
  "author": "Adobe Systems",
6
6
  "license": "Adobe Proprietary",