@jarenjs/forms 0.34.2 → 0.43.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.
- package/README.md +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/rules.d.ts +2 -2
- package/package.json +5 -5
- package/src/index.js +3 -1
- package/src/rules.js +2 -2
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Framework-agnostic form generation for JSON Schema. Turns a schema into a render
|
|
|
6
6
|
2. **Cross field, every keystroke** — visibility, enablement, computed values, and preemptive assertions expressed as [Jaren JSON Query](../json/docs/QUERY-FORMAT.md) documents in an `x-form` annotation, compiled once per model by [`@jarenjs/json`](../json) and evaluated per keystroke as cheap closures.
|
|
7
7
|
3. **Authoritative, on submit** — the complete compiled schema validation with [`@jarenjs/validate`](../validate), which owns `required` combinations, `dependentSchemas`, `if/then/else`, `unevaluatedProperties`, and (via the `$query` keyword) the very same cross-field rules.
|
|
8
8
|
|
|
9
|
-
No DOM, no framework: render the model with React, Vue, vanilla JS or anything else. Forms never
|
|
9
|
+
No DOM, no framework: render the model with React, Vue, vanilla JS or anything else. Forms never runs the validator — apps wire the authoritative layer themselves; the only thing it imports from `@jarenjs/validate` is the pure same-document `$ref`/`$anchor` resolution in `@jarenjs/validate/normalize`. See it in action in the [Jaren playground](https://jklarenbeek.github.io/jarenjs/#/playground).
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* primitives, and the `x-form` rules (rules.js) add cross-field behavior -
|
|
7
7
|
* visibility, enablement, computed values, preemptive assertions - as
|
|
8
8
|
* compiled Jaren JSON Queries, before the complete compiled schema
|
|
9
|
-
* validation runs (app-wired; forms never
|
|
9
|
+
* validation runs (app-wired; forms never RUNS the validator — its one
|
|
10
|
+
* import from that package is the pure same-document ref resolution in
|
|
11
|
+
* `@jarenjs/validate/normalize`). The
|
|
10
12
|
* data helpers keep form values in plain JSON semantics, addressed by
|
|
11
13
|
* JSON pointer through the @jarenjs/json compiled pointer engine.
|
|
12
14
|
*/
|
package/dist/types/rules.d.ts
CHANGED
|
@@ -74,8 +74,8 @@ export type CompiledRules = {
|
|
|
74
74
|
* document. `options.compileTypeTest` passes through to the query
|
|
75
75
|
* compiler, so rules may use `$valid`/`$assert`/`$as` with a
|
|
76
76
|
* caller-supplied type-test compiler (the validator package's `query`
|
|
77
|
-
* module exports `createTypeTestCompiler()`; forms itself never
|
|
78
|
-
* the validator).
|
|
77
|
+
* module exports `createTypeTestCompiler()`; forms itself never runs
|
|
78
|
+
* the validator, and imports only its pure `normalize` helpers).
|
|
79
79
|
* Without the hook, a schema-using rule surfaces the engine's JQ0008.
|
|
80
80
|
*
|
|
81
81
|
* @param {import('./model.js').FormField} model - Root field from buildFormModel
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jarenjs/forms",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.43.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"types": "./dist/types/index.d.ts",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"prepack": "npm run build:types"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@jarenjs/core": "^0.
|
|
51
|
-
"@jarenjs/formats": "^0.
|
|
52
|
-
"@jarenjs/json": "^0.
|
|
53
|
-
"@jarenjs/validate": "^0.
|
|
50
|
+
"@jarenjs/core": "^0.43.1",
|
|
51
|
+
"@jarenjs/formats": "^0.43.1",
|
|
52
|
+
"@jarenjs/json": "^0.43.1",
|
|
53
|
+
"@jarenjs/validate": "^0.43.1"
|
|
54
54
|
}
|
|
55
55
|
}
|
package/src/index.js
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
* primitives, and the `x-form` rules (rules.js) add cross-field behavior -
|
|
9
9
|
* visibility, enablement, computed values, preemptive assertions - as
|
|
10
10
|
* compiled Jaren JSON Queries, before the complete compiled schema
|
|
11
|
-
* validation runs (app-wired; forms never
|
|
11
|
+
* validation runs (app-wired; forms never RUNS the validator — its one
|
|
12
|
+
* import from that package is the pure same-document ref resolution in
|
|
13
|
+
* `@jarenjs/validate/normalize`). The
|
|
12
14
|
* data helpers keep form values in plain JSON semantics, addressed by
|
|
13
15
|
* JSON pointer through the @jarenjs/json compiled pointer engine.
|
|
14
16
|
*/
|
package/src/rules.js
CHANGED
|
@@ -181,8 +181,8 @@ function compileRuleMessageSpec(raw, fieldPointer) {
|
|
|
181
181
|
* document. `options.compileTypeTest` passes through to the query
|
|
182
182
|
* compiler, so rules may use `$valid`/`$assert`/`$as` with a
|
|
183
183
|
* caller-supplied type-test compiler (the validator package's `query`
|
|
184
|
-
* module exports `createTypeTestCompiler()`; forms itself never
|
|
185
|
-
* the validator).
|
|
184
|
+
* module exports `createTypeTestCompiler()`; forms itself never runs
|
|
185
|
+
* the validator, and imports only its pure `normalize` helpers).
|
|
186
186
|
* Without the hook, a schema-using rule surfaces the engine's JQ0008.
|
|
187
187
|
*
|
|
188
188
|
* @param {import('./model.js').FormField} model - Root field from buildFormModel
|