@aemforms/af-core 0.22.62 → 0.22.64

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.
@@ -17,6 +17,7 @@ declare abstract class Container<T extends ContainerJson & RulesJson> extends Sc
17
17
  get maxItems(): number;
18
18
  set maxItems(m: number);
19
19
  get minItems(): number;
20
+ set minItems(m: number);
20
21
  hasDynamicItems(): boolean;
21
22
  get isContainer(): boolean;
22
23
  private _activeChild;
package/lib/Container.js CHANGED
@@ -54,6 +54,19 @@ class Container extends Scriptable_1.default {
54
54
  get minItems() {
55
55
  return this._jsonModel.minItems;
56
56
  }
57
+ set minItems(m) {
58
+ this._jsonModel.minItems = m;
59
+ const itemsLength = this._children.length;
60
+ const difference = itemsLength - m;
61
+ const items2Add = Math.abs(difference);
62
+ if (difference < 0) {
63
+ const elems = [];
64
+ for (let i = 0; i < items2Add; i++) {
65
+ elems.push(this._addChild(this._itemTemplate, null, true));
66
+ }
67
+ this.notifyDependents((0, Events_1.propertyChange)('items', elems, null));
68
+ }
69
+ }
57
70
  hasDynamicItems() {
58
71
  return this._itemTemplate != null;
59
72
  }
package/lib/Field.js CHANGED
@@ -477,8 +477,9 @@ class Field extends Scriptable_1.default {
477
477
  };
478
478
  }
479
479
  checkValidationExpression() {
480
- if (typeof this._jsonModel.validationExpression === 'string') {
481
- return this.executeExpression(this._jsonModel.validationExpression);
480
+ const validationExp = this._jsonModel.validationExpression;
481
+ if (typeof validationExp === 'string' && validationExp.length !== 0) {
482
+ return this.executeExpression(validationExp);
482
483
  }
483
484
  return true;
484
485
  }
package/lib/Form.d.ts CHANGED
@@ -19,6 +19,7 @@ declare class Form extends Container<FormJson> implements FormModel {
19
19
  get action(): string | undefined;
20
20
  importData(dataModel: any): void;
21
21
  exportData(): any;
22
+ resolveQualifiedName(qualifiedName: string): FieldModel | FieldsetModel | null;
22
23
  exportSubmitMetaData(): SubmitMetaData;
23
24
  setFocus(field: BaseModel): void;
24
25
  getState(): {
package/lib/Form.js CHANGED
@@ -47,6 +47,15 @@ class Form extends Container_1.default {
47
47
  var _a;
48
48
  return (_a = this.getDataNode()) === null || _a === void 0 ? void 0 : _a.$value;
49
49
  }
50
+ resolveQualifiedName(qualifiedName) {
51
+ let foundFormElement = null;
52
+ this.visit(formElement => {
53
+ if (formElement.qualifiedName === qualifiedName) {
54
+ foundFormElement = formElement;
55
+ }
56
+ });
57
+ return foundFormElement;
58
+ }
50
59
  exportSubmitMetaData() {
51
60
  let submitMetaInstance = null;
52
61
  const captchaInfoObj = {};
@@ -109,6 +109,7 @@ export interface FormModel extends ContainerModel, WithState<FormJson> {
109
109
  getUniqueId(): string;
110
110
  getEventQueue(): EventQueue;
111
111
  visit(callBack: (field: FieldModel | FieldsetModel) => void): void;
112
+ resolveQualifiedName(qualifiedName: string): FieldModel | FieldsetModel | null;
112
113
  fieldAdded(field: FieldModel | FieldsetModel): void;
113
114
  }
114
115
  export interface IFormFieldFactory {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aemforms/af-core",
3
- "version": "0.22.62",
3
+ "version": "0.22.64",
4
4
  "description": "Core Module for Forms Runtime",
5
5
  "author": "Adobe Systems",
6
6
  "license": "Adobe Proprietary",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@adobe/json-formula": "0.1.50",
38
- "@aemforms/af-formatters": "^0.22.62"
38
+ "@aemforms/af-formatters": "^0.22.64"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@babel/preset-env": "^7.20.2",