swoop-common 2.0.37 → 2.0.39
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { JsonSchema } from "@jsonforms/core";
|
|
2
|
-
import { FormBuilderSchema } from "../template/type";
|
|
3
2
|
import { JsonSchemaWithXType } from "../../types/jsonSchema";
|
|
4
3
|
export interface TemplateField {
|
|
5
4
|
name: string;
|
|
@@ -8,4 +7,159 @@ export interface TemplateField {
|
|
|
8
7
|
optionsRequired: boolean;
|
|
9
8
|
schema: JsonSchemaWithXType;
|
|
10
9
|
}
|
|
11
|
-
export declare const FORM_BUILDER_JSON_SCHEMA:
|
|
10
|
+
export declare const FORM_BUILDER_JSON_SCHEMA: {
|
|
11
|
+
$schema: string;
|
|
12
|
+
type: string;
|
|
13
|
+
properties: {
|
|
14
|
+
name: {
|
|
15
|
+
type: string;
|
|
16
|
+
minLength: number;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
fields: {
|
|
20
|
+
type: string;
|
|
21
|
+
items: {
|
|
22
|
+
$ref: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
required: string[];
|
|
27
|
+
$defs: {
|
|
28
|
+
topLevelFieldDefinition: {
|
|
29
|
+
type: string;
|
|
30
|
+
properties: {
|
|
31
|
+
fieldType: {
|
|
32
|
+
oneOf: {
|
|
33
|
+
const: string;
|
|
34
|
+
title: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
name: {
|
|
38
|
+
type: string;
|
|
39
|
+
minLength: number;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
description: {
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
required: {
|
|
46
|
+
type: string;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
49
|
+
existsFrom: {
|
|
50
|
+
type: string;
|
|
51
|
+
oneOf: {
|
|
52
|
+
title: string;
|
|
53
|
+
const: string;
|
|
54
|
+
}[];
|
|
55
|
+
};
|
|
56
|
+
editableIn: {
|
|
57
|
+
type: string;
|
|
58
|
+
uniqueItems: boolean;
|
|
59
|
+
minItmes: number;
|
|
60
|
+
items: {
|
|
61
|
+
type: string;
|
|
62
|
+
oneOf: {
|
|
63
|
+
title: string;
|
|
64
|
+
const: string;
|
|
65
|
+
}[];
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
required: string[];
|
|
70
|
+
dependencies: {
|
|
71
|
+
fieldType: {
|
|
72
|
+
oneOf: {
|
|
73
|
+
"x-type": string;
|
|
74
|
+
properties: {
|
|
75
|
+
required?: string[] | undefined;
|
|
76
|
+
fieldType: {
|
|
77
|
+
const: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
}[];
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
fieldDefinition: {
|
|
85
|
+
type: string;
|
|
86
|
+
properties: {
|
|
87
|
+
fieldType: {
|
|
88
|
+
oneOf: {
|
|
89
|
+
const: string;
|
|
90
|
+
title: string;
|
|
91
|
+
}[];
|
|
92
|
+
};
|
|
93
|
+
name: {
|
|
94
|
+
type: string;
|
|
95
|
+
minLength: number;
|
|
96
|
+
description: string;
|
|
97
|
+
};
|
|
98
|
+
description: {
|
|
99
|
+
type: string;
|
|
100
|
+
};
|
|
101
|
+
required: {
|
|
102
|
+
type: string;
|
|
103
|
+
default: boolean;
|
|
104
|
+
};
|
|
105
|
+
existsFrom: {
|
|
106
|
+
type: string;
|
|
107
|
+
oneOf: {
|
|
108
|
+
title: string;
|
|
109
|
+
const: string;
|
|
110
|
+
}[];
|
|
111
|
+
};
|
|
112
|
+
editableIn: {
|
|
113
|
+
type: string;
|
|
114
|
+
uniqueItems: boolean;
|
|
115
|
+
items: {
|
|
116
|
+
type: string;
|
|
117
|
+
oneOf: {
|
|
118
|
+
title: string;
|
|
119
|
+
const: string;
|
|
120
|
+
}[];
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
required: string[];
|
|
125
|
+
dependencies: {
|
|
126
|
+
fieldType: {
|
|
127
|
+
oneOf: {
|
|
128
|
+
"x-type": string;
|
|
129
|
+
properties: {
|
|
130
|
+
required?: string[] | undefined;
|
|
131
|
+
fieldType: {
|
|
132
|
+
const: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
}[];
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
arrayItemDefinition: {
|
|
140
|
+
type: string;
|
|
141
|
+
properties: {
|
|
142
|
+
fieldType: {
|
|
143
|
+
oneOf: {
|
|
144
|
+
const: string;
|
|
145
|
+
title: string;
|
|
146
|
+
}[];
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
required: string[];
|
|
150
|
+
dependencies: {
|
|
151
|
+
fieldType: {
|
|
152
|
+
oneOf: {
|
|
153
|
+
"x-type": string;
|
|
154
|
+
properties: {
|
|
155
|
+
required?: string[] | undefined;
|
|
156
|
+
fieldType: {
|
|
157
|
+
const: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
}[];
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
@@ -23,11 +23,41 @@ export const FORM_BUILDER_JSON_SCHEMA = {
|
|
|
23
23
|
},
|
|
24
24
|
fields: {
|
|
25
25
|
type: "array",
|
|
26
|
-
items: { $ref: "#/$defs/
|
|
26
|
+
items: { $ref: "#/$defs/topLevelFieldDefinition" },
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
required: ["name", "fields"],
|
|
30
30
|
$defs: {
|
|
31
|
+
topLevelFieldDefinition: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: Object.assign({ fieldType: {
|
|
34
|
+
oneOf: fieldsToConst
|
|
35
|
+
}, name: {
|
|
36
|
+
type: "string",
|
|
37
|
+
minLength: 1,
|
|
38
|
+
description: "Field name (used for both label and ID generation)",
|
|
39
|
+
}, description: { type: "string" }, required: { type: "boolean", default: false }, existsFrom: {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"oneOf": Object.keys(Stage).filter((k) => isNaN(+k)).map(s => ({ title: s, const: Stage[s] + "" }))
|
|
42
|
+
}, editableIn: {
|
|
43
|
+
type: "array",
|
|
44
|
+
uniqueItems: true,
|
|
45
|
+
minItmes: 1,
|
|
46
|
+
items: {
|
|
47
|
+
type: "string",
|
|
48
|
+
oneOf: Object.keys(Stage).filter((k) => isNaN(+k)).map(s => ({
|
|
49
|
+
title: s,
|
|
50
|
+
const: Stage[s] + ""
|
|
51
|
+
}))
|
|
52
|
+
}
|
|
53
|
+
} }, fieldsToOptionsRecord),
|
|
54
|
+
required: ["fieldType", "name", "existsFrom", "editableIn"],
|
|
55
|
+
dependencies: {
|
|
56
|
+
fieldType: {
|
|
57
|
+
oneOf: fieldsToTypeDef
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
31
61
|
fieldDefinition: {
|
|
32
62
|
type: "object",
|
|
33
63
|
properties: Object.assign({ fieldType: {
|