@jsonforms/core 3.3.0-beta.0 → 3.3.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/lib/Helpers.d.ts +5 -5
- package/lib/actions/actions.d.ts +198 -198
- package/lib/actions/index.d.ts +1 -1
- package/lib/configDefault.d.ts +6 -6
- package/lib/generators/Generate.d.ts +6 -6
- package/lib/generators/index.d.ts +3 -3
- package/lib/generators/schema.d.ts +8 -8
- package/lib/generators/uischema.d.ts +12 -12
- package/lib/i18n/arrayTranslations.d.ts +24 -24
- package/lib/i18n/combinatorTranslations.d.ts +14 -14
- package/lib/i18n/i18nTypes.d.ts +16 -16
- package/lib/i18n/i18nUtil.d.ts +28 -28
- package/lib/i18n/index.d.ts +4 -4
- package/lib/index.d.ts +11 -11
- package/lib/models/draft4.d.ts +198 -198
- package/lib/models/index.d.ts +5 -5
- package/lib/models/jsonSchema.d.ts +3 -3
- package/lib/models/jsonSchema4.d.ts +110 -110
- package/lib/models/jsonSchema7.d.ts +119 -119
- package/lib/models/uischema.d.ts +231 -231
- package/lib/reducers/cells.d.ts +11 -11
- package/lib/reducers/config.d.ts +3 -3
- package/lib/reducers/core.d.ts +26 -26
- package/lib/reducers/default-data.d.ts +10 -10
- package/lib/reducers/i18n.d.ts +8 -8
- package/lib/reducers/index.d.ts +10 -10
- package/lib/reducers/middleware.d.ts +6 -6
- package/lib/reducers/reducers.d.ts +29 -29
- package/lib/reducers/renderers.d.ts +10 -10
- package/lib/reducers/selectors.d.ts +15 -15
- package/lib/reducers/uischemas.d.ts +10 -10
- package/lib/store.d.ts +53 -53
- package/lib/testers/index.d.ts +1 -1
- package/lib/testers/testers.d.ts +220 -220
- package/lib/util/Formatted.d.ts +19 -19
- package/lib/util/array.d.ts +3 -3
- package/lib/util/cell.d.ts +78 -78
- package/lib/util/combinators.d.ts +9 -9
- package/lib/util/defaultDateFormat.d.ts +3 -3
- package/lib/util/ids.d.ts +3 -3
- package/lib/util/index.d.ts +16 -16
- package/lib/util/label.d.ts +21 -21
- package/lib/util/path.d.ts +38 -38
- package/lib/util/renderer.d.ts +429 -429
- package/lib/util/resolvers.d.ts +25 -25
- package/lib/util/runtime.d.ts +17 -17
- package/lib/util/schema.d.ts +10 -10
- package/lib/util/type.d.ts +174 -174
- package/lib/util/uischema.d.ts +18 -18
- package/lib/util/util.d.ts +57 -57
- package/lib/util/validator.d.ts +3 -3
- package/package.json +2 -2
package/lib/testers/testers.d.ts
CHANGED
|
@@ -1,220 +1,220 @@
|
|
|
1
|
-
import type { Categorization, ControlElement, JsonSchema, UISchemaElement } from '../models';
|
|
2
|
-
/**
|
|
3
|
-
* Constant that indicates that a tester is not capable of handling
|
|
4
|
-
* a combination of schema/data.
|
|
5
|
-
* @type {number}
|
|
6
|
-
*/
|
|
7
|
-
export declare const NOT_APPLICABLE = -1;
|
|
8
|
-
/**
|
|
9
|
-
* A tester is a function that receives an UI schema and a JSON schema and returns a boolean.
|
|
10
|
-
* The rootSchema is handed over as context. Can be used to resolve references.
|
|
11
|
-
*/
|
|
12
|
-
export type Tester = (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* A ranked tester associates a tester with a number.
|
|
15
|
-
*/
|
|
16
|
-
export type RankedTester = (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => number;
|
|
17
|
-
/**
|
|
18
|
-
* Additional context given to a tester in addition to UISchema and JsonSchema.
|
|
19
|
-
*/
|
|
20
|
-
export interface TesterContext {
|
|
21
|
-
/** The root JsonSchema of the form. Can be used to resolve references. */
|
|
22
|
-
rootSchema: JsonSchema;
|
|
23
|
-
/** The form wide configuration object given to JsonForms. */
|
|
24
|
-
config: any;
|
|
25
|
-
}
|
|
26
|
-
export declare const isControl: (uischema: any) => uischema is ControlElement;
|
|
27
|
-
/**
|
|
28
|
-
* Only applicable for Controls.
|
|
29
|
-
*
|
|
30
|
-
* This function checks whether the given UI schema is of type Control
|
|
31
|
-
* and if so, resolves the sub-schema referenced by the control and applies
|
|
32
|
-
* the given predicate
|
|
33
|
-
*
|
|
34
|
-
* @param {(JsonSchema) => boolean} predicate the predicate that should be
|
|
35
|
-
* applied to the resolved sub-schema
|
|
36
|
-
*/
|
|
37
|
-
export declare const schemaMatches: (predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean) => Tester;
|
|
38
|
-
export declare const schemaSubPathMatches: (subPath: string, predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean) => Tester;
|
|
39
|
-
/**
|
|
40
|
-
* Only applicable for Controls.
|
|
41
|
-
*
|
|
42
|
-
* This function checks whether the given UI schema is of type Control
|
|
43
|
-
* and if so, resolves the sub-schema referenced by the control and checks
|
|
44
|
-
* whether the type of the sub-schema matches the expected one.
|
|
45
|
-
*
|
|
46
|
-
* @param {string} expectedType the expected type of the resolved sub-schema
|
|
47
|
-
*/
|
|
48
|
-
export declare const schemaTypeIs: (expectedType: string) => Tester;
|
|
49
|
-
/**
|
|
50
|
-
* Only applicable for Controls.
|
|
51
|
-
*
|
|
52
|
-
* This function checks whether the given UI schema is of type Control
|
|
53
|
-
* and if so, resolves the sub-schema referenced by the control and checks
|
|
54
|
-
* whether the format of the sub-schema matches the expected one.
|
|
55
|
-
*
|
|
56
|
-
* @param {string} expectedFormat the expected format of the resolved sub-schema
|
|
57
|
-
*/
|
|
58
|
-
export declare const formatIs: (expectedFormat: string) => Tester;
|
|
59
|
-
/**
|
|
60
|
-
* Checks whether the given UI schema has the expected type.
|
|
61
|
-
*
|
|
62
|
-
* @param {string} expected the expected UI schema type
|
|
63
|
-
*/
|
|
64
|
-
export declare const uiTypeIs: (expected: string) => Tester;
|
|
65
|
-
/**
|
|
66
|
-
* Checks whether the given UI schema has an option with the given
|
|
67
|
-
* name and whether it has the expected value. If no options property
|
|
68
|
-
* is set, returns false.
|
|
69
|
-
*
|
|
70
|
-
* @param {string} optionName the name of the option to check
|
|
71
|
-
* @param {any} optionValue the expected value of the option
|
|
72
|
-
*/
|
|
73
|
-
export declare const optionIs: (optionName: string, optionValue: any) => Tester;
|
|
74
|
-
/**
|
|
75
|
-
* Checks whether the given UI schema has an option with the given
|
|
76
|
-
* name. If no options property is set, returns false.
|
|
77
|
-
*
|
|
78
|
-
* @param {string} optionName the name of the option to check
|
|
79
|
-
*/
|
|
80
|
-
export declare const hasOption: (optionName: string) => Tester;
|
|
81
|
-
/**
|
|
82
|
-
* Only applicable for Controls.
|
|
83
|
-
*
|
|
84
|
-
* Checks whether the scope of a control ends with the expected string.
|
|
85
|
-
*
|
|
86
|
-
* @param {string} expected the expected ending of the reference
|
|
87
|
-
*/
|
|
88
|
-
export declare const scopeEndsWith: (expected: string) => Tester;
|
|
89
|
-
/**
|
|
90
|
-
* Only applicable for Controls.
|
|
91
|
-
*
|
|
92
|
-
* Checks whether the last segment of the scope matches the expected string.
|
|
93
|
-
*
|
|
94
|
-
* @param {string} expected the expected ending of the reference
|
|
95
|
-
*/
|
|
96
|
-
export declare const scopeEndIs: (expected: string) => Tester;
|
|
97
|
-
/**
|
|
98
|
-
* A tester that allow composing other testers by && them.
|
|
99
|
-
*
|
|
100
|
-
* @param {Array<Tester>} testers the testers to be composed
|
|
101
|
-
*/
|
|
102
|
-
export declare const and: (...testers: Tester[]) => Tester;
|
|
103
|
-
/**
|
|
104
|
-
* A tester that allow composing other testers by || them.
|
|
105
|
-
*
|
|
106
|
-
* @param {Array<Tester>} testers the testers to be composed
|
|
107
|
-
*/
|
|
108
|
-
export declare const or: (...testers: Tester[]) => Tester;
|
|
109
|
-
/**
|
|
110
|
-
* Create a ranked tester that will associate a number with a given tester, if the
|
|
111
|
-
* latter returns true.
|
|
112
|
-
*
|
|
113
|
-
* @param {number} rank the rank to be returned in case the tester returns true
|
|
114
|
-
* @param {Tester} tester a tester
|
|
115
|
-
*/
|
|
116
|
-
export declare const rankWith: (rank: number, tester: Tester) => (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => number;
|
|
117
|
-
export declare const withIncreasedRank: (by: number, rankedTester: RankedTester) => (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => number;
|
|
118
|
-
/**
|
|
119
|
-
* Default tester for boolean.
|
|
120
|
-
* @type {RankedTester}
|
|
121
|
-
*/
|
|
122
|
-
export declare const isBooleanControl: Tester;
|
|
123
|
-
export declare const isObjectControl: Tester;
|
|
124
|
-
export declare const isAllOfControl: Tester;
|
|
125
|
-
export declare const isAnyOfControl: Tester;
|
|
126
|
-
export declare const isOneOfControl: Tester;
|
|
127
|
-
/**
|
|
128
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
129
|
-
* has an enum.
|
|
130
|
-
* @type {Tester}
|
|
131
|
-
*/
|
|
132
|
-
export declare const isEnumControl: Tester;
|
|
133
|
-
/**
|
|
134
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
135
|
-
* has an enum based on oneOf.
|
|
136
|
-
* @type {Tester}
|
|
137
|
-
*/
|
|
138
|
-
export declare const isOneOfEnumControl: Tester;
|
|
139
|
-
/**
|
|
140
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
141
|
-
* is of type integer
|
|
142
|
-
* @type {Tester}
|
|
143
|
-
*/
|
|
144
|
-
export declare const isIntegerControl: Tester;
|
|
145
|
-
/**
|
|
146
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
147
|
-
* is of type number
|
|
148
|
-
* @type {Tester}
|
|
149
|
-
*/
|
|
150
|
-
export declare const isNumberControl: Tester;
|
|
151
|
-
/**
|
|
152
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
153
|
-
* is of type string
|
|
154
|
-
* @type {Tester}
|
|
155
|
-
*/
|
|
156
|
-
export declare const isStringControl: Tester;
|
|
157
|
-
/**
|
|
158
|
-
* Tests whether the given UI schema is of type Control and if is has
|
|
159
|
-
* a 'multi' option.
|
|
160
|
-
* @type {Tester}
|
|
161
|
-
*/
|
|
162
|
-
export declare const isMultiLineControl: Tester;
|
|
163
|
-
/**
|
|
164
|
-
* Tests whether the given UI schema is of type Control and whether the schema
|
|
165
|
-
* or uischema options has a 'date' format.
|
|
166
|
-
* @type {Tester}
|
|
167
|
-
*/
|
|
168
|
-
export declare const isDateControl: Tester;
|
|
169
|
-
/**
|
|
170
|
-
* Tests whether the given UI schema is of type Control and whether the schema
|
|
171
|
-
* or the uischema options has a 'time' format.
|
|
172
|
-
* @type {Tester}
|
|
173
|
-
*/
|
|
174
|
-
export declare const isTimeControl: Tester;
|
|
175
|
-
/**
|
|
176
|
-
* Tests whether the given UI schema is of type Control and whether the schema
|
|
177
|
-
* or the uischema options has a 'date-time' format.
|
|
178
|
-
* @type {Tester}
|
|
179
|
-
*/
|
|
180
|
-
export declare const isDateTimeControl: Tester;
|
|
181
|
-
/**
|
|
182
|
-
* Tests whether the given schema is an array of objects.
|
|
183
|
-
* @type {Tester}
|
|
184
|
-
*/
|
|
185
|
-
export declare const isObjectArray: Tester;
|
|
186
|
-
/**
|
|
187
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
188
|
-
* is an array of objects.
|
|
189
|
-
* @type {Tester}
|
|
190
|
-
*/
|
|
191
|
-
export declare const isObjectArrayControl: Tester;
|
|
192
|
-
export declare const isObjectArrayWithNesting: (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => boolean;
|
|
193
|
-
/**
|
|
194
|
-
* Synonym for isObjectArrayControl
|
|
195
|
-
*/
|
|
196
|
-
export declare const isArrayObjectControl: Tester;
|
|
197
|
-
/**
|
|
198
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
199
|
-
* is an array of a primitive type.
|
|
200
|
-
* @type {Tester}
|
|
201
|
-
*/
|
|
202
|
-
export declare const isPrimitiveArrayControl: Tester;
|
|
203
|
-
/**
|
|
204
|
-
* Tests whether a given UI schema is of type Control,
|
|
205
|
-
* if the schema is of type number or integer and
|
|
206
|
-
* whether the schema defines a numerical range with a default value.
|
|
207
|
-
* @type {Tester}
|
|
208
|
-
*/
|
|
209
|
-
export declare const isRangeControl: Tester;
|
|
210
|
-
/**
|
|
211
|
-
* Tests whether the given UI schema is of type Control, if the schema
|
|
212
|
-
* is of type integer and has option format
|
|
213
|
-
* @type {Tester}
|
|
214
|
-
*/
|
|
215
|
-
export declare const isNumberFormatControl: Tester;
|
|
216
|
-
export declare const isCategorization: (category: UISchemaElement) => category is Categorization;
|
|
217
|
-
export declare const isCategory: (uischema: UISchemaElement) => boolean;
|
|
218
|
-
export declare const hasCategory: (categorization: Categorization) => boolean;
|
|
219
|
-
export declare const categorizationHasCategory: (uischema: UISchemaElement) => boolean;
|
|
220
|
-
export declare const not: (tester: Tester) => Tester;
|
|
1
|
+
import type { Categorization, ControlElement, JsonSchema, UISchemaElement } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* Constant that indicates that a tester is not capable of handling
|
|
4
|
+
* a combination of schema/data.
|
|
5
|
+
* @type {number}
|
|
6
|
+
*/
|
|
7
|
+
export declare const NOT_APPLICABLE = -1;
|
|
8
|
+
/**
|
|
9
|
+
* A tester is a function that receives an UI schema and a JSON schema and returns a boolean.
|
|
10
|
+
* The rootSchema is handed over as context. Can be used to resolve references.
|
|
11
|
+
*/
|
|
12
|
+
export type Tester = (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* A ranked tester associates a tester with a number.
|
|
15
|
+
*/
|
|
16
|
+
export type RankedTester = (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => number;
|
|
17
|
+
/**
|
|
18
|
+
* Additional context given to a tester in addition to UISchema and JsonSchema.
|
|
19
|
+
*/
|
|
20
|
+
export interface TesterContext {
|
|
21
|
+
/** The root JsonSchema of the form. Can be used to resolve references. */
|
|
22
|
+
rootSchema: JsonSchema;
|
|
23
|
+
/** The form wide configuration object given to JsonForms. */
|
|
24
|
+
config: any;
|
|
25
|
+
}
|
|
26
|
+
export declare const isControl: (uischema: any) => uischema is ControlElement;
|
|
27
|
+
/**
|
|
28
|
+
* Only applicable for Controls.
|
|
29
|
+
*
|
|
30
|
+
* This function checks whether the given UI schema is of type Control
|
|
31
|
+
* and if so, resolves the sub-schema referenced by the control and applies
|
|
32
|
+
* the given predicate
|
|
33
|
+
*
|
|
34
|
+
* @param {(JsonSchema) => boolean} predicate the predicate that should be
|
|
35
|
+
* applied to the resolved sub-schema
|
|
36
|
+
*/
|
|
37
|
+
export declare const schemaMatches: (predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean) => Tester;
|
|
38
|
+
export declare const schemaSubPathMatches: (subPath: string, predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean) => Tester;
|
|
39
|
+
/**
|
|
40
|
+
* Only applicable for Controls.
|
|
41
|
+
*
|
|
42
|
+
* This function checks whether the given UI schema is of type Control
|
|
43
|
+
* and if so, resolves the sub-schema referenced by the control and checks
|
|
44
|
+
* whether the type of the sub-schema matches the expected one.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} expectedType the expected type of the resolved sub-schema
|
|
47
|
+
*/
|
|
48
|
+
export declare const schemaTypeIs: (expectedType: string) => Tester;
|
|
49
|
+
/**
|
|
50
|
+
* Only applicable for Controls.
|
|
51
|
+
*
|
|
52
|
+
* This function checks whether the given UI schema is of type Control
|
|
53
|
+
* and if so, resolves the sub-schema referenced by the control and checks
|
|
54
|
+
* whether the format of the sub-schema matches the expected one.
|
|
55
|
+
*
|
|
56
|
+
* @param {string} expectedFormat the expected format of the resolved sub-schema
|
|
57
|
+
*/
|
|
58
|
+
export declare const formatIs: (expectedFormat: string) => Tester;
|
|
59
|
+
/**
|
|
60
|
+
* Checks whether the given UI schema has the expected type.
|
|
61
|
+
*
|
|
62
|
+
* @param {string} expected the expected UI schema type
|
|
63
|
+
*/
|
|
64
|
+
export declare const uiTypeIs: (expected: string) => Tester;
|
|
65
|
+
/**
|
|
66
|
+
* Checks whether the given UI schema has an option with the given
|
|
67
|
+
* name and whether it has the expected value. If no options property
|
|
68
|
+
* is set, returns false.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} optionName the name of the option to check
|
|
71
|
+
* @param {any} optionValue the expected value of the option
|
|
72
|
+
*/
|
|
73
|
+
export declare const optionIs: (optionName: string, optionValue: any) => Tester;
|
|
74
|
+
/**
|
|
75
|
+
* Checks whether the given UI schema has an option with the given
|
|
76
|
+
* name. If no options property is set, returns false.
|
|
77
|
+
*
|
|
78
|
+
* @param {string} optionName the name of the option to check
|
|
79
|
+
*/
|
|
80
|
+
export declare const hasOption: (optionName: string) => Tester;
|
|
81
|
+
/**
|
|
82
|
+
* Only applicable for Controls.
|
|
83
|
+
*
|
|
84
|
+
* Checks whether the scope of a control ends with the expected string.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} expected the expected ending of the reference
|
|
87
|
+
*/
|
|
88
|
+
export declare const scopeEndsWith: (expected: string) => Tester;
|
|
89
|
+
/**
|
|
90
|
+
* Only applicable for Controls.
|
|
91
|
+
*
|
|
92
|
+
* Checks whether the last segment of the scope matches the expected string.
|
|
93
|
+
*
|
|
94
|
+
* @param {string} expected the expected ending of the reference
|
|
95
|
+
*/
|
|
96
|
+
export declare const scopeEndIs: (expected: string) => Tester;
|
|
97
|
+
/**
|
|
98
|
+
* A tester that allow composing other testers by && them.
|
|
99
|
+
*
|
|
100
|
+
* @param {Array<Tester>} testers the testers to be composed
|
|
101
|
+
*/
|
|
102
|
+
export declare const and: (...testers: Tester[]) => Tester;
|
|
103
|
+
/**
|
|
104
|
+
* A tester that allow composing other testers by || them.
|
|
105
|
+
*
|
|
106
|
+
* @param {Array<Tester>} testers the testers to be composed
|
|
107
|
+
*/
|
|
108
|
+
export declare const or: (...testers: Tester[]) => Tester;
|
|
109
|
+
/**
|
|
110
|
+
* Create a ranked tester that will associate a number with a given tester, if the
|
|
111
|
+
* latter returns true.
|
|
112
|
+
*
|
|
113
|
+
* @param {number} rank the rank to be returned in case the tester returns true
|
|
114
|
+
* @param {Tester} tester a tester
|
|
115
|
+
*/
|
|
116
|
+
export declare const rankWith: (rank: number, tester: Tester) => (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => number;
|
|
117
|
+
export declare const withIncreasedRank: (by: number, rankedTester: RankedTester) => (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => number;
|
|
118
|
+
/**
|
|
119
|
+
* Default tester for boolean.
|
|
120
|
+
* @type {RankedTester}
|
|
121
|
+
*/
|
|
122
|
+
export declare const isBooleanControl: Tester;
|
|
123
|
+
export declare const isObjectControl: Tester;
|
|
124
|
+
export declare const isAllOfControl: Tester;
|
|
125
|
+
export declare const isAnyOfControl: Tester;
|
|
126
|
+
export declare const isOneOfControl: Tester;
|
|
127
|
+
/**
|
|
128
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
129
|
+
* has an enum.
|
|
130
|
+
* @type {Tester}
|
|
131
|
+
*/
|
|
132
|
+
export declare const isEnumControl: Tester;
|
|
133
|
+
/**
|
|
134
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
135
|
+
* has an enum based on oneOf.
|
|
136
|
+
* @type {Tester}
|
|
137
|
+
*/
|
|
138
|
+
export declare const isOneOfEnumControl: Tester;
|
|
139
|
+
/**
|
|
140
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
141
|
+
* is of type integer
|
|
142
|
+
* @type {Tester}
|
|
143
|
+
*/
|
|
144
|
+
export declare const isIntegerControl: Tester;
|
|
145
|
+
/**
|
|
146
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
147
|
+
* is of type number
|
|
148
|
+
* @type {Tester}
|
|
149
|
+
*/
|
|
150
|
+
export declare const isNumberControl: Tester;
|
|
151
|
+
/**
|
|
152
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
153
|
+
* is of type string
|
|
154
|
+
* @type {Tester}
|
|
155
|
+
*/
|
|
156
|
+
export declare const isStringControl: Tester;
|
|
157
|
+
/**
|
|
158
|
+
* Tests whether the given UI schema is of type Control and if is has
|
|
159
|
+
* a 'multi' option.
|
|
160
|
+
* @type {Tester}
|
|
161
|
+
*/
|
|
162
|
+
export declare const isMultiLineControl: Tester;
|
|
163
|
+
/**
|
|
164
|
+
* Tests whether the given UI schema is of type Control and whether the schema
|
|
165
|
+
* or uischema options has a 'date' format.
|
|
166
|
+
* @type {Tester}
|
|
167
|
+
*/
|
|
168
|
+
export declare const isDateControl: Tester;
|
|
169
|
+
/**
|
|
170
|
+
* Tests whether the given UI schema is of type Control and whether the schema
|
|
171
|
+
* or the uischema options has a 'time' format.
|
|
172
|
+
* @type {Tester}
|
|
173
|
+
*/
|
|
174
|
+
export declare const isTimeControl: Tester;
|
|
175
|
+
/**
|
|
176
|
+
* Tests whether the given UI schema is of type Control and whether the schema
|
|
177
|
+
* or the uischema options has a 'date-time' format.
|
|
178
|
+
* @type {Tester}
|
|
179
|
+
*/
|
|
180
|
+
export declare const isDateTimeControl: Tester;
|
|
181
|
+
/**
|
|
182
|
+
* Tests whether the given schema is an array of objects.
|
|
183
|
+
* @type {Tester}
|
|
184
|
+
*/
|
|
185
|
+
export declare const isObjectArray: Tester;
|
|
186
|
+
/**
|
|
187
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
188
|
+
* is an array of objects.
|
|
189
|
+
* @type {Tester}
|
|
190
|
+
*/
|
|
191
|
+
export declare const isObjectArrayControl: Tester;
|
|
192
|
+
export declare const isObjectArrayWithNesting: (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Synonym for isObjectArrayControl
|
|
195
|
+
*/
|
|
196
|
+
export declare const isArrayObjectControl: Tester;
|
|
197
|
+
/**
|
|
198
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
199
|
+
* is an array of a primitive type.
|
|
200
|
+
* @type {Tester}
|
|
201
|
+
*/
|
|
202
|
+
export declare const isPrimitiveArrayControl: Tester;
|
|
203
|
+
/**
|
|
204
|
+
* Tests whether a given UI schema is of type Control,
|
|
205
|
+
* if the schema is of type number or integer and
|
|
206
|
+
* whether the schema defines a numerical range with a default value.
|
|
207
|
+
* @type {Tester}
|
|
208
|
+
*/
|
|
209
|
+
export declare const isRangeControl: Tester;
|
|
210
|
+
/**
|
|
211
|
+
* Tests whether the given UI schema is of type Control, if the schema
|
|
212
|
+
* is of type integer and has option format
|
|
213
|
+
* @type {Tester}
|
|
214
|
+
*/
|
|
215
|
+
export declare const isNumberFormatControl: Tester;
|
|
216
|
+
export declare const isCategorization: (category: UISchemaElement) => category is Categorization;
|
|
217
|
+
export declare const isCategory: (uischema: UISchemaElement) => boolean;
|
|
218
|
+
export declare const hasCategory: (categorization: Categorization) => boolean;
|
|
219
|
+
export declare const categorizationHasCategory: (uischema: UISchemaElement) => boolean;
|
|
220
|
+
export declare const not: (tester: Tester) => Tester;
|
package/lib/util/Formatted.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interface for mapping a given type to a formatted string and back.
|
|
3
|
-
*/
|
|
4
|
-
export interface Formatted<A> {
|
|
5
|
-
/**
|
|
6
|
-
* Format the given value
|
|
7
|
-
*
|
|
8
|
-
* @param {A} value the value to be formatted
|
|
9
|
-
* @returns {string} the formatted string
|
|
10
|
-
*/
|
|
11
|
-
toFormatted(value: A): string;
|
|
12
|
-
/**
|
|
13
|
-
* Retrieve a value from a given string.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} formatted the format string from which to obtain a value
|
|
16
|
-
* @returns {A} the obtained value
|
|
17
|
-
*/
|
|
18
|
-
fromFormatted(formatted: string): A;
|
|
19
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Interface for mapping a given type to a formatted string and back.
|
|
3
|
+
*/
|
|
4
|
+
export interface Formatted<A> {
|
|
5
|
+
/**
|
|
6
|
+
* Format the given value
|
|
7
|
+
*
|
|
8
|
+
* @param {A} value the value to be formatted
|
|
9
|
+
* @returns {string} the formatted string
|
|
10
|
+
*/
|
|
11
|
+
toFormatted(value: A): string;
|
|
12
|
+
/**
|
|
13
|
+
* Retrieve a value from a given string.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} formatted the format string from which to obtain a value
|
|
16
|
+
* @returns {A} the obtained value
|
|
17
|
+
*/
|
|
18
|
+
fromFormatted(formatted: string): A;
|
|
19
|
+
}
|
package/lib/util/array.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const moveUp: (array: any[], toMove: number) => void;
|
|
2
|
-
declare const moveDown: (array: any[], toMove: number) => void;
|
|
3
|
-
export { moveUp, moveDown };
|
|
1
|
+
declare const moveUp: (array: any[], toMove: number) => void;
|
|
2
|
+
declare const moveDown: (array: any[], toMove: number) => void;
|
|
3
|
+
export { moveUp, moveDown };
|
package/lib/util/cell.d.ts
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import type { JsonFormsCellRendererRegistryEntry } from '../reducers';
|
|
2
|
-
import type { AnyAction, Dispatch } from './type';
|
|
3
|
-
import { DispatchPropsOfControl, OwnPropsOfControl, OwnPropsOfEnum, StatePropsOfScopedRenderer } from './renderer';
|
|
4
|
-
import type { JsonFormsState } from '../store';
|
|
5
|
-
import type { JsonSchema } from '../models';
|
|
6
|
-
export interface OwnPropsOfCell extends OwnPropsOfControl {
|
|
7
|
-
data?: any;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* State props of a cell.
|
|
11
|
-
*/
|
|
12
|
-
export interface StatePropsOfCell extends StatePropsOfScopedRenderer {
|
|
13
|
-
isValid: boolean;
|
|
14
|
-
rootSchema: JsonSchema;
|
|
15
|
-
}
|
|
16
|
-
export interface OwnPropsOfEnumCell extends OwnPropsOfCell, OwnPropsOfEnum {
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* State props of a cell for enum cell
|
|
20
|
-
*/
|
|
21
|
-
export interface StatePropsOfEnumCell extends StatePropsOfCell, OwnPropsOfEnum {
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Props of an enum cell.
|
|
25
|
-
*/
|
|
26
|
-
export interface EnumCellProps extends StatePropsOfEnumCell, DispatchPropsOfControl {
|
|
27
|
-
}
|
|
28
|
-
export type DispatchPropsOfCell = DispatchPropsOfControl;
|
|
29
|
-
/**
|
|
30
|
-
* Props of a cell.
|
|
31
|
-
*/
|
|
32
|
-
export interface CellProps extends StatePropsOfCell, DispatchPropsOfCell {
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Registers the given cell renderer when a JSON Forms store is created.
|
|
36
|
-
* @param {RankedTester} tester
|
|
37
|
-
* @param cell the cell to be registered
|
|
38
|
-
* @returns {any}
|
|
39
|
-
*/
|
|
40
|
-
export interface DispatchCellStateProps extends StatePropsOfCell {
|
|
41
|
-
cells?: JsonFormsCellRendererRegistryEntry[];
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Map state to cell props.
|
|
45
|
-
*
|
|
46
|
-
* @param state JSONForms state tree
|
|
47
|
-
* @param ownProps any own props
|
|
48
|
-
* @returns {StatePropsOfCell} state props of a cell
|
|
49
|
-
*/
|
|
50
|
-
export declare const mapStateToCellProps: (state: JsonFormsState, ownProps: OwnPropsOfCell) => StatePropsOfCell;
|
|
51
|
-
export declare const mapStateToDispatchCellProps: (state: JsonFormsState, ownProps: OwnPropsOfCell) => DispatchCellStateProps;
|
|
52
|
-
export interface DispatchCellProps extends DispatchCellStateProps {
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Default mapStateToCellProps for enum cell. Options is used for populating dropdown list
|
|
56
|
-
* @param state
|
|
57
|
-
* @param ownProps
|
|
58
|
-
* @returns {StatePropsOfEnumCell}
|
|
59
|
-
*/
|
|
60
|
-
export declare const defaultMapStateToEnumCellProps: (state: JsonFormsState, ownProps: OwnPropsOfEnumCell) => StatePropsOfEnumCell;
|
|
61
|
-
/**
|
|
62
|
-
* mapStateToOneOfEnumCellProps for one of enum cell. Options is used for populating dropdown list from oneOf
|
|
63
|
-
* @param state
|
|
64
|
-
* @param ownProps
|
|
65
|
-
* @returns {StatePropsOfEnumCell}
|
|
66
|
-
*/
|
|
67
|
-
export declare const mapStateToOneOfEnumCellProps: (state: JsonFormsState, ownProps: OwnPropsOfEnumCell) => StatePropsOfEnumCell;
|
|
68
|
-
/**
|
|
69
|
-
* Synonym for mapDispatchToControlProps.
|
|
70
|
-
*
|
|
71
|
-
* @type {(dispatch) => {handleChange(path, value): void}}
|
|
72
|
-
*/
|
|
73
|
-
export declare const mapDispatchToCellProps: (dispatch: Dispatch<AnyAction>) => DispatchPropsOfControl;
|
|
74
|
-
/**
|
|
75
|
-
* Default dispatch to control props which can be customized to set handleChange action
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
|
-
export declare const defaultMapDispatchToControlProps: (dispatch: Dispatch<AnyAction>, ownProps: any) => DispatchPropsOfControl;
|
|
1
|
+
import type { JsonFormsCellRendererRegistryEntry } from '../reducers';
|
|
2
|
+
import type { AnyAction, Dispatch } from './type';
|
|
3
|
+
import { DispatchPropsOfControl, OwnPropsOfControl, OwnPropsOfEnum, StatePropsOfScopedRenderer } from './renderer';
|
|
4
|
+
import type { JsonFormsState } from '../store';
|
|
5
|
+
import type { JsonSchema } from '../models';
|
|
6
|
+
export interface OwnPropsOfCell extends OwnPropsOfControl {
|
|
7
|
+
data?: any;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* State props of a cell.
|
|
11
|
+
*/
|
|
12
|
+
export interface StatePropsOfCell extends StatePropsOfScopedRenderer {
|
|
13
|
+
isValid: boolean;
|
|
14
|
+
rootSchema: JsonSchema;
|
|
15
|
+
}
|
|
16
|
+
export interface OwnPropsOfEnumCell extends OwnPropsOfCell, OwnPropsOfEnum {
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* State props of a cell for enum cell
|
|
20
|
+
*/
|
|
21
|
+
export interface StatePropsOfEnumCell extends StatePropsOfCell, OwnPropsOfEnum {
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Props of an enum cell.
|
|
25
|
+
*/
|
|
26
|
+
export interface EnumCellProps extends StatePropsOfEnumCell, DispatchPropsOfControl {
|
|
27
|
+
}
|
|
28
|
+
export type DispatchPropsOfCell = DispatchPropsOfControl;
|
|
29
|
+
/**
|
|
30
|
+
* Props of a cell.
|
|
31
|
+
*/
|
|
32
|
+
export interface CellProps extends StatePropsOfCell, DispatchPropsOfCell {
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Registers the given cell renderer when a JSON Forms store is created.
|
|
36
|
+
* @param {RankedTester} tester
|
|
37
|
+
* @param cell the cell to be registered
|
|
38
|
+
* @returns {any}
|
|
39
|
+
*/
|
|
40
|
+
export interface DispatchCellStateProps extends StatePropsOfCell {
|
|
41
|
+
cells?: JsonFormsCellRendererRegistryEntry[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Map state to cell props.
|
|
45
|
+
*
|
|
46
|
+
* @param state JSONForms state tree
|
|
47
|
+
* @param ownProps any own props
|
|
48
|
+
* @returns {StatePropsOfCell} state props of a cell
|
|
49
|
+
*/
|
|
50
|
+
export declare const mapStateToCellProps: (state: JsonFormsState, ownProps: OwnPropsOfCell) => StatePropsOfCell;
|
|
51
|
+
export declare const mapStateToDispatchCellProps: (state: JsonFormsState, ownProps: OwnPropsOfCell) => DispatchCellStateProps;
|
|
52
|
+
export interface DispatchCellProps extends DispatchCellStateProps {
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Default mapStateToCellProps for enum cell. Options is used for populating dropdown list
|
|
56
|
+
* @param state
|
|
57
|
+
* @param ownProps
|
|
58
|
+
* @returns {StatePropsOfEnumCell}
|
|
59
|
+
*/
|
|
60
|
+
export declare const defaultMapStateToEnumCellProps: (state: JsonFormsState, ownProps: OwnPropsOfEnumCell) => StatePropsOfEnumCell;
|
|
61
|
+
/**
|
|
62
|
+
* mapStateToOneOfEnumCellProps for one of enum cell. Options is used for populating dropdown list from oneOf
|
|
63
|
+
* @param state
|
|
64
|
+
* @param ownProps
|
|
65
|
+
* @returns {StatePropsOfEnumCell}
|
|
66
|
+
*/
|
|
67
|
+
export declare const mapStateToOneOfEnumCellProps: (state: JsonFormsState, ownProps: OwnPropsOfEnumCell) => StatePropsOfEnumCell;
|
|
68
|
+
/**
|
|
69
|
+
* Synonym for mapDispatchToControlProps.
|
|
70
|
+
*
|
|
71
|
+
* @type {(dispatch) => {handleChange(path, value): void}}
|
|
72
|
+
*/
|
|
73
|
+
export declare const mapDispatchToCellProps: (dispatch: Dispatch<AnyAction>) => DispatchPropsOfControl;
|
|
74
|
+
/**
|
|
75
|
+
* Default dispatch to control props which can be customized to set handleChange action
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
export declare const defaultMapDispatchToControlProps: (dispatch: Dispatch<AnyAction>, ownProps: any) => DispatchPropsOfControl;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ControlElement, JsonSchema, UISchemaElement } from '../models';
|
|
2
|
-
import { JsonFormsUISchemaRegistryEntry } from '../reducers';
|
|
3
|
-
export interface CombinatorSubSchemaRenderInfo {
|
|
4
|
-
schema: JsonSchema;
|
|
5
|
-
uischema: UISchemaElement;
|
|
6
|
-
label: string;
|
|
7
|
-
}
|
|
8
|
-
export type CombinatorKeyword = 'anyOf' | 'oneOf' | 'allOf';
|
|
9
|
-
export declare const createCombinatorRenderInfos: (combinatorSubSchemas: JsonSchema[], rootSchema: JsonSchema, keyword: CombinatorKeyword, control: ControlElement, path: string, uischemas: JsonFormsUISchemaRegistryEntry[]) => CombinatorSubSchemaRenderInfo[];
|
|
1
|
+
import type { ControlElement, JsonSchema, UISchemaElement } from '../models';
|
|
2
|
+
import { JsonFormsUISchemaRegistryEntry } from '../reducers';
|
|
3
|
+
export interface CombinatorSubSchemaRenderInfo {
|
|
4
|
+
schema: JsonSchema;
|
|
5
|
+
uischema: UISchemaElement;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export type CombinatorKeyword = 'anyOf' | 'oneOf' | 'allOf';
|
|
9
|
+
export declare const createCombinatorRenderInfos: (combinatorSubSchemas: JsonSchema[], rootSchema: JsonSchema, keyword: CombinatorKeyword, control: ControlElement, path: string, uischemas: JsonFormsUISchemaRegistryEntry[]) => CombinatorSubSchemaRenderInfo[];
|