@streamline-pulse/formkrafter-core 0.33.0 → 0.34.0
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/index.d.ts +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +4 -4
- package/dist/utils/brick-spec.d.ts +8 -0
- package/dist/utils/lint-spec.d.ts +1 -1
- package/package.json +1 -1
- package/schema/form-spec.schema.json +9 -0
|
@@ -5,6 +5,13 @@ import type { Rule } from "../rules/rule.js";
|
|
|
5
5
|
import type { BrickType } from "./brick-type.js";
|
|
6
6
|
import type { BrickBaseConfigs } from "./common-brick-props.js";
|
|
7
7
|
import type { BrickStyles } from "../utils/brick-styles.js";
|
|
8
|
+
/** Where a brick sits in its row: `columns` on a row, `span` on one of its children. */
|
|
9
|
+
export interface BrickLayout {
|
|
10
|
+
/** On a row: the number of equal columns, so a lone field keeps its share instead of the whole width. */
|
|
11
|
+
columns?: number;
|
|
12
|
+
/** On a child of a row: how many of the row's columns it takes (1 by default). */
|
|
13
|
+
span?: number;
|
|
14
|
+
}
|
|
8
15
|
export interface BrickSpec {
|
|
9
16
|
type: BrickType;
|
|
10
17
|
dataType?: JSONSchemaType;
|
|
@@ -20,6 +27,7 @@ export interface BrickSpec {
|
|
|
20
27
|
configsForm?: BrickSpec;
|
|
21
28
|
configs?: BrickBaseConfigs & Record<string, unknown>;
|
|
22
29
|
styles?: BrickStyles<string>;
|
|
30
|
+
layout?: BrickLayout;
|
|
23
31
|
children?: BrickSpec[];
|
|
24
32
|
}
|
|
25
33
|
export declare function iterateBricks(spec?: BrickSpec, path?: string): Generator<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BrickSpec } from "./brick-spec.js";
|
|
2
|
-
export type SpecIssueCode = "validations-without-data-type" | "input-without-key" | "duplicate-key" | "collection-without-children";
|
|
2
|
+
export type SpecIssueCode = "validations-without-data-type" | "input-without-key" | "duplicate-key" | "collection-without-children" | "content-in-row";
|
|
3
3
|
export interface SpecIssue {
|
|
4
4
|
code: SpecIssueCode;
|
|
5
5
|
path: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamline-pulse/formkrafter-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Framework-agnostic core for FormKrafter: form specs, RFC 6902 ops with undo/redo, Ajv validation, sandboxed rules engine and injectable services",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -68,6 +68,15 @@
|
|
|
68
68
|
"description": "Style tokens applied to the brick, as CSS-like key/value pairs.",
|
|
69
69
|
"additionalProperties": true
|
|
70
70
|
},
|
|
71
|
+
"layout": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"description": "Placement in a row: \"columns\" on the row itself (equal columns, a lone field keeps its share), \"span\" on one of its children (how many columns it takes). A row still stacks on narrow screens.",
|
|
74
|
+
"properties": {
|
|
75
|
+
"columns": { "type": "integer", "minimum": 1, "maximum": 12 },
|
|
76
|
+
"span": { "type": "integer", "minimum": 1, "maximum": 12 }
|
|
77
|
+
},
|
|
78
|
+
"additionalProperties": false
|
|
79
|
+
},
|
|
71
80
|
"children": {
|
|
72
81
|
"type": "array",
|
|
73
82
|
"items": { "$ref": "#/$defs/brick" },
|