@remoteoss/json-schema-form 0.1.1-dev.20230615153439 → 0.1.1-dev.20230616083258
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.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/standalone.js +785 -357
- package/json-schema-form.d.ts +48 -1
- package/package.json +1 -1
package/json-schema-form.d.ts
CHANGED
|
@@ -1 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Shorthand to lookup for keys with `x-jsf-*` preffix.
|
|
3
|
+
*/
|
|
4
|
+
export function pickXKey(node: Object, key: 'presentation' | 'error-message'): Object | undefined;
|
|
5
|
+
|
|
6
|
+
type JSConfig = {
|
|
7
|
+
initialValues?: Record<string, unknown>;
|
|
8
|
+
strictInputType?: boolean;
|
|
9
|
+
customProperties?: {
|
|
10
|
+
description: Function | string;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
inputTypes?: {
|
|
14
|
+
errorMessage: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type Fields = Record<string, unknown>[]; // TODO: We don't know what type we have here, we need to investigate
|
|
19
|
+
|
|
20
|
+
type $TsFixMe = any;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns the Yup schema structure of given fields.
|
|
24
|
+
* These fields must be the same from
|
|
25
|
+
* const { fields } = createHeadlessForm()
|
|
26
|
+
*/
|
|
27
|
+
export function buildCompleteYupSchema(fields: Fields, config: JSConfig): $TsFixMe; // TODO: We don't what yup returns here, we'll fix it later
|
|
28
|
+
|
|
29
|
+
type HeadlessFormOutput =
|
|
30
|
+
| {
|
|
31
|
+
fields: Fields;
|
|
32
|
+
handleValidation: Function;
|
|
33
|
+
isError: boolean;
|
|
34
|
+
error?: undefined;
|
|
35
|
+
}
|
|
36
|
+
| {
|
|
37
|
+
fields: never[];
|
|
38
|
+
isError: boolean;
|
|
39
|
+
error: any;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Generates the Headless form based on the provided JSON schema
|
|
44
|
+
*/
|
|
45
|
+
export function createHeadlessForm(
|
|
46
|
+
jsonSchema: Record<string, unknown>,
|
|
47
|
+
customConfig: JSConfig = {}
|
|
48
|
+
): HeadlessFormOutput;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remoteoss/json-schema-form",
|
|
3
|
-
"version": "0.1.1-dev.
|
|
3
|
+
"version": "0.1.1-dev.20230616083258",
|
|
4
4
|
"description": "Headless UI form powered by JSON Schemas",
|
|
5
5
|
"author": "Remote.com <engineering@remote.com> (https://remote.com/)",
|
|
6
6
|
"license": "MIT",
|