@aemforms/af-core 0.22.42 → 0.22.43

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
@@ -198,7 +198,13 @@ class BaseNode {
198
198
  return this._jsonModel.dataRef;
199
199
  }
200
200
  get visible() {
201
- return this._jsonModel.visible;
201
+ var _a, _b;
202
+ if (((_a = this.parent) === null || _a === void 0 ? void 0 : _a.visible) !== undefined) {
203
+ return ((_b = this.parent) === null || _b === void 0 ? void 0 : _b.visible) ? this._jsonModel.visible : false;
204
+ }
205
+ else {
206
+ return this._jsonModel.visible;
207
+ }
202
208
  }
203
209
  set visible(v) {
204
210
  if (v !== this._jsonModel.visible) {
package/lib/Field.d.ts CHANGED
@@ -36,8 +36,8 @@ declare class Field extends Scriptable<FieldJson> implements FieldModel {
36
36
  get emptyValue(): "" | null | undefined;
37
37
  get enum(): any[] | undefined;
38
38
  set enum(e: any[] | undefined);
39
- get enumNames(): string[] | undefined;
40
- set enumNames(e: string[] | undefined);
39
+ get enumNames(): string[] | import("./types").EnumName[] | undefined;
40
+ set enumNames(e: string[] | import("./types").EnumName[] | undefined);
41
41
  get required(): boolean;
42
42
  set required(r: boolean);
43
43
  get maximum(): number | undefined;
@@ -158,7 +158,7 @@ declare class Field extends Scriptable<FieldJson> implements FieldModel {
158
158
  description?: string | undefined;
159
159
  rules: import("./types").Items<string> & {};
160
160
  events: import("./types").Items<string | string[] | undefined> & {};
161
- enumNames?: string[] | undefined;
161
+ enumNames?: string[] | import("./types").EnumName[] | undefined;
162
162
  enum?: any[] | undefined;
163
163
  accept?: string[] | undefined;
164
164
  enforceEnum?: boolean | undefined;
package/lib/Field.js CHANGED
@@ -612,6 +612,9 @@ class Field extends Scriptable_1.default {
612
612
  }
613
613
  }
614
614
  validate() {
615
+ if (this.visible === false) {
616
+ return [];
617
+ }
615
618
  const changes = this.evaluateConstraints();
616
619
  if (changes.valid) {
617
620
  this.triggerValidationEvent(changes);
package/lib/Form.d.ts CHANGED
@@ -22,7 +22,7 @@ declare class Form extends Container<FormJson> implements FormModel {
22
22
  getState(): {
23
23
  description?: string | undefined;
24
24
  } & import("./types/Json").RulesJson & {
25
- enumNames?: string[] | undefined;
25
+ enumNames?: string[] | import("./types/Json").EnumName[] | undefined;
26
26
  enum?: any[] | undefined;
27
27
  } & {
28
28
  accept?: string[] | undefined;
@@ -7,8 +7,12 @@ export declare type Label = {
7
7
  richText?: boolean;
8
8
  visible?: boolean;
9
9
  };
10
+ export declare type EnumName = {
11
+ value: string;
12
+ richText?: boolean;
13
+ };
10
14
  declare type TranslationConstraintsJson = {
11
- enumNames?: string[];
15
+ enumNames?: string[] | EnumName[];
12
16
  enum?: any[];
13
17
  };
14
18
  export declare type ConstraintsJson = TranslationConstraintsJson & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aemforms/af-core",
3
- "version": "0.22.42",
3
+ "version": "0.22.43",
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.42"
38
+ "@aemforms/af-formatters": "^0.22.43"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@babel/preset-env": "^7.20.2",