@streamline-pulse/formkrafter-core 0.21.0 → 0.23.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/brick/brick.d.ts +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +108 -40
- package/dist/index.js.map +7 -5
- package/dist/review.d.ts +10 -0
- package/dist/utils/fields.d.ts +34 -0
- package/package.json +1 -1
package/dist/review.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** What a reviewer said about one field, keyed by the brick `key`. */
|
|
2
|
+
export interface FieldAnnotation {
|
|
3
|
+
/** The value must be corrected. */
|
|
4
|
+
incorrect?: boolean;
|
|
5
|
+
/** Free text shown to whoever corrects the field. */
|
|
6
|
+
comment?: string;
|
|
7
|
+
}
|
|
8
|
+
export type FieldAnnotations = Record<string, FieldAnnotation>;
|
|
9
|
+
/** Keys flagged as incorrect: the fields a correction step lets the applicant edit. */
|
|
10
|
+
export declare const flaggedKeys: (annotations: FieldAnnotations | undefined) => string[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SelectOption } from "./options";
|
|
2
|
+
import type { BrickSpec } from "./brick-spec";
|
|
3
|
+
import type { JSONSchemaType } from "../validators/json-schema-type";
|
|
4
|
+
/** One data-bearing brick of a spec, described independently of any renderer. */
|
|
5
|
+
export interface FieldDescriptor {
|
|
6
|
+
/** Data key (`configs.key`). */
|
|
7
|
+
key: string;
|
|
8
|
+
/** Spec path, as `iterateBricks` yields it (`"0.2.1"`). */
|
|
9
|
+
path: string;
|
|
10
|
+
/** Label resolved for the locale, falling back to the key. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Brick id (`text`, `select`, `data-grid`, ...). */
|
|
13
|
+
brick: string;
|
|
14
|
+
type: "input" | "collection";
|
|
15
|
+
dataType?: JSONSchemaType;
|
|
16
|
+
/** Several values among `options` (multi select, select boxes, tags). */
|
|
17
|
+
multiple: boolean;
|
|
18
|
+
required: boolean;
|
|
19
|
+
/** Static options only; remote, catalog and computed sources are not resolved here. */
|
|
20
|
+
options?: SelectOption[];
|
|
21
|
+
/** For a collection, the fields of one row. */
|
|
22
|
+
columns?: FieldDescriptor[];
|
|
23
|
+
}
|
|
24
|
+
export interface CollectFieldsOptions {
|
|
25
|
+
/** Keep keys starting with `_` (never part of the submitted data). Default false. */
|
|
26
|
+
includePrivate?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Lists the fields a form collects: every input and collection with a key,
|
|
30
|
+
* in document order, with the label, static options and requiredness a
|
|
31
|
+
* backend or an assistant needs to read or fill the data. Panels are
|
|
32
|
+
* flattened; a collection is one field whose `columns` describe a row.
|
|
33
|
+
*/
|
|
34
|
+
export declare const collectFields: (spec: BrickSpec | undefined, locale?: string, options?: CollectFieldsOptions) => FieldDescriptor[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamline-pulse/formkrafter-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.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",
|