@astroapps/forms-core 1.2.0 → 1.2.1

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.
@@ -21,4 +21,4 @@ export declare const lengthValidator: ValidatorEval<LengthValidator>;
21
21
  export declare const dateValidator: ValidatorEval<DateValidator>;
22
22
  export declare const defaultValidators: Record<string, ValidatorEval<any>>;
23
23
  export declare function createValidators(def: ControlDefinition, context: ValidationEvalContext): void;
24
- export declare function setupValidation(controlImpl: Control<FormContextOptions>, definition: ControlDefinition, dataNode: Control<SchemaDataNode | undefined>, schemaInterface: SchemaInterface, parent: SchemaDataNode, formNode: FormNode, runAsync: (af: () => void) => void): void;
24
+ export declare function setupValidation(controlImpl: Control<FormContextOptions>, definition: ControlDefinition, dataNode: Control<SchemaDataNode | undefined>, schemaInterface: SchemaInterface, parent: SchemaDataNode, formNode: FormNode, hidden: Control<boolean>, runAsync: (af: () => void) => void): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astroapps/forms-core",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.cjs",
package/src/formState.ts CHANGED
@@ -397,6 +397,7 @@ export function createFormState(
397
397
  schemaInterface,
398
398
  parent,
399
399
  formNode,
400
+ hidden,
400
401
  runAsync,
401
402
  );
402
403
 
package/src/validators.ts CHANGED
@@ -6,7 +6,11 @@ import {
6
6
  SchemaValidator,
7
7
  ValidatorType,
8
8
  } from "./schemaValidator";
9
- import { ControlDefinition, isDataControl } from "./controlDefinition";
9
+ import {
10
+ ControlDefinition,
11
+ DataControlDefinition,
12
+ isDataControl,
13
+ } from "./controlDefinition";
10
14
  import { SchemaDataNode } from "./schemaDataNode";
11
15
  import {
12
16
  Control,
@@ -171,11 +175,12 @@ export function setupValidation(
171
175
  schemaInterface: SchemaInterface,
172
176
  parent: SchemaDataNode,
173
177
  formNode: FormNode,
178
+ hidden: Control<boolean>,
174
179
  runAsync: (af: () => void) => void,
175
180
  ) {
176
181
  const validationEnabled = createScopedComputed(
177
182
  controlImpl,
178
- () => !definition.hidden,
183
+ () => !hidden.value,
179
184
  );
180
185
  const validatorsScope = createCleanupScope();
181
186
  createEffect(