@rokkit/forms 1.4.1 → 1.4.2
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/dist/lib/builder.svelte.js +19 -2
- package/dist/lib/validation.js +3 -0
- package/package.json +4 -3
|
@@ -653,7 +653,13 @@ export class FormBuilder {
|
|
|
653
653
|
* @private
|
|
654
654
|
*/
|
|
655
655
|
#buildStandardElement(element, fieldPath, scope, value) {
|
|
656
|
-
|
|
656
|
+
// `override` is authored on the LAYOUT element (documented in the README and
|
|
657
|
+
// docs/llms as the way to opt a field into the consumer's `child` snippet).
|
|
658
|
+
// getSchemaWithLayout folds unrecognised layout keys into `props`, so reading
|
|
659
|
+
// only `element.override` left it permanently false and the child snippet
|
|
660
|
+
// never rendered. Take it from either position, and keep it out of the props
|
|
661
|
+
// handed to the input component.
|
|
662
|
+
const { override: propsOverride, ...props } = element.props ?? {}
|
|
657
663
|
const type = this.#resolveInputType(props)
|
|
658
664
|
const finalProps = {
|
|
659
665
|
...props,
|
|
@@ -662,7 +668,13 @@ export class FormBuilder {
|
|
|
662
668
|
dirty: this.isFieldDirty(fieldPath)
|
|
663
669
|
}
|
|
664
670
|
this.#applyLookupState(fieldPath, finalProps)
|
|
665
|
-
return {
|
|
671
|
+
return {
|
|
672
|
+
scope,
|
|
673
|
+
type,
|
|
674
|
+
value,
|
|
675
|
+
override: element.override || propsOverride || false,
|
|
676
|
+
props: finalProps
|
|
677
|
+
}
|
|
666
678
|
}
|
|
667
679
|
|
|
668
680
|
/**
|
|
@@ -682,7 +694,12 @@ export class FormBuilder {
|
|
|
682
694
|
*/
|
|
683
695
|
#convertToFormElement(element, parentPath = '') {
|
|
684
696
|
const { key } = element
|
|
697
|
+
/* v8 ignore start -- unreachable: both call sites source elements from the
|
|
698
|
+
combined map, which #buildCombinedMap populates under `if (el.key)`, so a
|
|
699
|
+
keyless element never arrives here. `ignore next` does not fire on a
|
|
700
|
+
single-line `if (...) return`. */
|
|
685
701
|
if (!key) return null
|
|
702
|
+
/* v8 ignore stop */
|
|
686
703
|
|
|
687
704
|
const fieldPath = this.#resolveFieldPath(key, parentPath)
|
|
688
705
|
const scope = `#/${fieldPath}`
|
package/dist/lib/validation.js
CHANGED
|
@@ -182,7 +182,10 @@ export const patterns = {
|
|
|
182
182
|
* @returns {Object|null} Field schema
|
|
183
183
|
*/
|
|
184
184
|
function getFieldSchema(fieldPath, schema) {
|
|
185
|
+
/* v8 ignore start -- unreachable: the only caller is validateElement, reached
|
|
186
|
+
from validateAll, which already returns early on !schema.properties. */
|
|
185
187
|
if (!schema.properties) return null
|
|
188
|
+
/* v8 ignore stop */
|
|
186
189
|
|
|
187
190
|
const keys = fieldPath.split('/')
|
|
188
191
|
let current = schema.properties
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rokkit/forms",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Form building components for Rokkit applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"postpublish": "node ../../config/pack-repoint.mjs --restore && rm -f LICENSE",
|
|
19
19
|
"clean": "rm -rf dist",
|
|
20
20
|
"build": "svelte-package -i src -o dist",
|
|
21
|
-
"check": "svelte-check --tsconfig ./tsconfig.json"
|
|
21
|
+
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
22
|
+
"check:types": "tsc --noEmit"
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
24
25
|
"dist",
|
|
@@ -52,6 +53,6 @@
|
|
|
52
53
|
"@sveltejs/package": "^2.5.8",
|
|
53
54
|
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
54
55
|
"@types/ramda": "^0.31.1",
|
|
55
|
-
"svelte-check": "^4.
|
|
56
|
+
"svelte-check": "^4.7.6"
|
|
56
57
|
}
|
|
57
58
|
}
|