@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.
Files changed (52) hide show
  1. package/lib/Helpers.d.ts +5 -5
  2. package/lib/actions/actions.d.ts +198 -198
  3. package/lib/actions/index.d.ts +1 -1
  4. package/lib/configDefault.d.ts +6 -6
  5. package/lib/generators/Generate.d.ts +6 -6
  6. package/lib/generators/index.d.ts +3 -3
  7. package/lib/generators/schema.d.ts +8 -8
  8. package/lib/generators/uischema.d.ts +12 -12
  9. package/lib/i18n/arrayTranslations.d.ts +24 -24
  10. package/lib/i18n/combinatorTranslations.d.ts +14 -14
  11. package/lib/i18n/i18nTypes.d.ts +16 -16
  12. package/lib/i18n/i18nUtil.d.ts +28 -28
  13. package/lib/i18n/index.d.ts +4 -4
  14. package/lib/index.d.ts +11 -11
  15. package/lib/models/draft4.d.ts +198 -198
  16. package/lib/models/index.d.ts +5 -5
  17. package/lib/models/jsonSchema.d.ts +3 -3
  18. package/lib/models/jsonSchema4.d.ts +110 -110
  19. package/lib/models/jsonSchema7.d.ts +119 -119
  20. package/lib/models/uischema.d.ts +231 -231
  21. package/lib/reducers/cells.d.ts +11 -11
  22. package/lib/reducers/config.d.ts +3 -3
  23. package/lib/reducers/core.d.ts +26 -26
  24. package/lib/reducers/default-data.d.ts +10 -10
  25. package/lib/reducers/i18n.d.ts +8 -8
  26. package/lib/reducers/index.d.ts +10 -10
  27. package/lib/reducers/middleware.d.ts +6 -6
  28. package/lib/reducers/reducers.d.ts +29 -29
  29. package/lib/reducers/renderers.d.ts +10 -10
  30. package/lib/reducers/selectors.d.ts +15 -15
  31. package/lib/reducers/uischemas.d.ts +10 -10
  32. package/lib/store.d.ts +53 -53
  33. package/lib/testers/index.d.ts +1 -1
  34. package/lib/testers/testers.d.ts +220 -220
  35. package/lib/util/Formatted.d.ts +19 -19
  36. package/lib/util/array.d.ts +3 -3
  37. package/lib/util/cell.d.ts +78 -78
  38. package/lib/util/combinators.d.ts +9 -9
  39. package/lib/util/defaultDateFormat.d.ts +3 -3
  40. package/lib/util/ids.d.ts +3 -3
  41. package/lib/util/index.d.ts +16 -16
  42. package/lib/util/label.d.ts +21 -21
  43. package/lib/util/path.d.ts +38 -38
  44. package/lib/util/renderer.d.ts +429 -429
  45. package/lib/util/resolvers.d.ts +25 -25
  46. package/lib/util/runtime.d.ts +17 -17
  47. package/lib/util/schema.d.ts +10 -10
  48. package/lib/util/type.d.ts +174 -174
  49. package/lib/util/uischema.d.ts +18 -18
  50. package/lib/util/util.d.ts +57 -57
  51. package/lib/util/validator.d.ts +3 -3
  52. package/package.json +2 -2
@@ -1,429 +1,429 @@
1
- import { ControlElement, JsonSchema, LabelElement, UISchemaElement } from '../models';
2
- import type { JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry, JsonFormsUISchemaRegistryEntry } from '../reducers';
3
- import type { RankedTester } from '../testers';
4
- import type { CombinatorKeyword } from './combinators';
5
- import type { AnyAction, Dispatch } from './type';
6
- import { CoreActions } from '../actions';
7
- import type { ErrorObject } from 'ajv';
8
- import type { JsonFormsState } from '../store';
9
- import { Translator, CombinatorTranslations } from '../i18n';
10
- import { ArrayTranslations } from '../i18n/arrayTranslations';
11
- /**
12
- * Adds an asterisk to the given label string based
13
- * on the required parameter.
14
- *
15
- * @param {string | undefined} label the label string
16
- * @param {boolean} required whether the label belongs to a control which is required
17
- * @param {boolean} hideRequiredAsterisk applied UI Schema option
18
- * @returns {string} the label string
19
- */
20
- export declare const computeLabel: (label: string | undefined, required: boolean, hideRequiredAsterisk: boolean) => string;
21
- /**
22
- * Indicates whether to mark a field as required.
23
- *
24
- * @param {boolean} required whether the label belongs to a control which is required
25
- * @param {boolean} hideRequiredAsterisk applied UI Schema option
26
- * @returns {boolean} should the field be marked as required
27
- */
28
- export declare const showAsRequired: (required: boolean, hideRequiredAsterisk: boolean) => boolean;
29
- /**
30
- * Create a default value based on the given schema.
31
- * @param schema the schema for which to create a default value.
32
- * @returns {any}
33
- */
34
- export declare const createDefaultValue: (schema: JsonSchema, rootSchema: JsonSchema) => any;
35
- /**
36
- * Returns the default value defined in the given schema.
37
- * @param schema the schema for which to create a default value.
38
- * @returns {any}
39
- */
40
- export declare const extractDefaults: (schema: JsonSchema, rootSchema: JsonSchema) => any;
41
- /**
42
- * Whether an element's description should be hidden.
43
- *
44
- * @param visible whether an element is visible
45
- * @param description the element's description
46
- * @param isFocused whether the element is focused
47
- *
48
- * @returns {boolean} true, if the description is to be hidden, false otherwise
49
- */
50
- export declare const isDescriptionHidden: (visible: boolean, description: string | undefined, isFocused: boolean, showUnfocusedDescription: boolean) => boolean;
51
- export interface WithClassname {
52
- className?: string;
53
- }
54
- export interface EnumOption {
55
- label: string;
56
- value: any;
57
- }
58
- export declare const enumToEnumOptionMapper: (e: any, t?: Translator, i18nKey?: string) => EnumOption;
59
- export declare const oneOfToEnumOptionMapper: (e: any, t?: Translator, fallbackI18nKey?: string) => EnumOption;
60
- export interface OwnPropsOfRenderer {
61
- /**
62
- * The UI schema to be rendered.
63
- */
64
- uischema?: UISchemaElement;
65
- /**
66
- * The JSON schema that describes the data.
67
- */
68
- schema?: JsonSchema;
69
- /**
70
- * Whether the rendered element should be enabled.
71
- */
72
- enabled?: boolean;
73
- /**
74
- * Whether the rendered element should be visible.
75
- */
76
- visible?: boolean;
77
- /**
78
- * Optional instance path. Necessary when the actual data
79
- * path can not be inferred via the UI schema element as
80
- * it is the case with nested controls.
81
- */
82
- path?: string;
83
- renderers?: JsonFormsRendererRegistryEntry[];
84
- cells?: JsonFormsCellRendererRegistryEntry[];
85
- uischemas?: JsonFormsUISchemaRegistryEntry[];
86
- }
87
- export interface OwnPropsOfControl extends OwnPropsOfRenderer {
88
- id?: string;
89
- uischema?: ControlElement;
90
- }
91
- export interface OwnPropsOfLabel extends OwnPropsOfRenderer {
92
- uischema?: LabelElement;
93
- }
94
- export interface OwnPropsOfEnum {
95
- options?: EnumOption[];
96
- }
97
- export interface OwnPropsOfLayout extends OwnPropsOfRenderer {
98
- direction?: 'row' | 'column';
99
- }
100
- /**
101
- * State-based props of a {@link Renderer}.
102
- */
103
- export interface StatePropsOfRenderer {
104
- /**
105
- * Any configuration options for the element.
106
- */
107
- config?: any;
108
- /**
109
- * The UI schema to be rendered.
110
- */
111
- uischema: UISchemaElement;
112
- /**
113
- * The JSON schema that describes the data.
114
- */
115
- schema: JsonSchema;
116
- /**
117
- * The data to be rendered.
118
- */
119
- data?: any;
120
- /**
121
- * Whether the rendered element should be enabled.
122
- */
123
- enabled: boolean;
124
- /**
125
- * Whether the rendered element should be visible.
126
- */
127
- visible: boolean;
128
- /**
129
- * Instance path the data is written to, in case of a control.
130
- */
131
- path: string;
132
- /**
133
- * All available renderers.
134
- */
135
- renderers?: JsonFormsRendererRegistryEntry[];
136
- /**
137
- * All available cell renderers.
138
- */
139
- cells?: JsonFormsCellRendererRegistryEntry[];
140
- }
141
- /**
142
- * State-based properties for UI schema elements that have a scope.
143
- */
144
- export interface StatePropsOfScopedRenderer extends StatePropsOfRenderer {
145
- uischema: ControlElement;
146
- /**
147
- * Any validation errors that are caused by the data to be rendered.
148
- */
149
- errors: string;
150
- /**
151
- * The data to be rendered.
152
- */
153
- data: any;
154
- /**
155
- * The root schema as returned by the store.
156
- */
157
- rootSchema: JsonSchema;
158
- /**
159
- * A unique ID that should be used for rendering the scoped UI schema element.
160
- */
161
- id: string;
162
- }
163
- /**
164
- * Props of a {@link Renderer}.
165
- */
166
- export interface RendererProps extends StatePropsOfRenderer {
167
- }
168
- /**
169
- * State-based props of a Control
170
- */
171
- export interface StatePropsOfControl extends StatePropsOfScopedRenderer {
172
- cells?: {
173
- tester: RankedTester;
174
- cell: any;
175
- }[];
176
- /**
177
- * The label for the rendered element.
178
- */
179
- label: string;
180
- /**
181
- * Description of input cell
182
- */
183
- description?: string;
184
- /**
185
- * Whether the rendered data is required.
186
- */
187
- required?: boolean;
188
- i18nKeyPrefix?: string;
189
- }
190
- /**
191
- * Dispatch-based props of a Control.
192
- */
193
- export interface DispatchPropsOfControl {
194
- /**
195
- * Update handler that emits a data change
196
- *
197
- * @param {string} path the path to the data to be updated
198
- * @param {any} value the new value that should be written to the given path
199
- */
200
- handleChange(path: string, value: any): void;
201
- }
202
- /**
203
- * Props of a Control.
204
- */
205
- export interface ControlProps extends StatePropsOfControl, DispatchPropsOfControl {
206
- }
207
- /**
208
- * State props of a layout;
209
- */
210
- export interface StatePropsOfLayout extends StatePropsOfRenderer {
211
- /**
212
- * Direction for the layout to flow
213
- */
214
- direction: 'row' | 'column';
215
- label?: string;
216
- }
217
- export interface LayoutProps extends StatePropsOfLayout {
218
- }
219
- /**
220
- * The state of a control.
221
- */
222
- export interface ControlState {
223
- /**
224
- * The current value.
225
- */
226
- value: any;
227
- /**
228
- * Whether the control is focused.
229
- */
230
- isFocused: boolean;
231
- }
232
- /**
233
- * Map state to control props.
234
- * @param state the store's state
235
- * @param ownProps any own props
236
- * @returns {StatePropsOfControl} state props for a control
237
- */
238
- export declare const mapStateToControlProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfControl;
239
- /**
240
- *
241
- * Map dispatch to control props.
242
- *
243
- * @param dispatch the store's dispatch method
244
- * @returns {DispatchPropsOfControl} dispatch props for a control
245
- */
246
- export declare const mapDispatchToControlProps: (dispatch: Dispatch<AnyAction>) => DispatchPropsOfControl;
247
- /**
248
- * Default mapStateToCellProps for enum control. Options is used for populating dropdown list
249
- * @param state
250
- * @param ownProps
251
- * @returns {StatePropsOfControl & OwnPropsOfEnum}
252
- */
253
- export declare const mapStateToEnumControlProps: (state: JsonFormsState, ownProps: OwnPropsOfControl & OwnPropsOfEnum) => StatePropsOfControl & OwnPropsOfEnum;
254
- /**
255
- * Default mapStateToCellProps for enum control based on oneOf. Options is used for populating dropdown list
256
- * @param state
257
- * @param ownProps
258
- * @returns {StatePropsOfControl & OwnPropsOfEnum}
259
- */
260
- export declare const mapStateToOneOfEnumControlProps: (state: JsonFormsState, ownProps: OwnPropsOfControl & OwnPropsOfEnum) => StatePropsOfControl & OwnPropsOfEnum;
261
- /**
262
- * Default mapStateToCellProps for multi enum control. Options is used for populating dropdown list
263
- * @param state
264
- * @param ownProps
265
- * @returns {StatePropsOfControl & OwnPropsOfEnum}
266
- */
267
- export declare const mapStateToMultiEnumControlProps: (state: JsonFormsState, ownProps: OwnPropsOfControl & OwnPropsOfEnum) => StatePropsOfControl & OwnPropsOfEnum;
268
- /**
269
- * Map state to control props.
270
- * @param state the store's state
271
- * @param ownProps any own props
272
- * @returns {StatePropsOfControl} state props for a control
273
- */
274
- export declare const mapStateToMasterListItemProps: (state: JsonFormsState, ownProps: OwnPropsOfMasterListItem) => StatePropsOfMasterItem;
275
- /**
276
- * State-based props of a table control.
277
- */
278
- export interface StatePropsOfControlWithDetail extends StatePropsOfControl {
279
- uischemas?: JsonFormsUISchemaRegistryEntry[];
280
- renderers?: JsonFormsRendererRegistryEntry[];
281
- cells?: JsonFormsCellRendererRegistryEntry[];
282
- }
283
- export interface OwnPropsOfMasterListItem {
284
- index: number;
285
- selected: boolean;
286
- path: string;
287
- enabled: boolean;
288
- schema: JsonSchema;
289
- uischema: UISchemaElement;
290
- childLabelProp?: string;
291
- handleSelect(index: number): () => void;
292
- removeItem(path: string, value: number): () => void;
293
- translations: ArrayTranslations;
294
- }
295
- export interface StatePropsOfMasterItem extends OwnPropsOfMasterListItem {
296
- childLabel: string;
297
- }
298
- /**
299
- * Map state to control with detail props
300
- *
301
- * @param state the store's state
302
- * @param ownProps any element's own props
303
- * @returns {StatePropsOfArrayControl} state props for a table control
304
- */
305
- export declare const mapStateToControlWithDetailProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfControlWithDetail;
306
- export interface ControlWithDetailProps extends StatePropsOfControlWithDetail, DispatchPropsOfControl {
307
- }
308
- /**
309
- * State-based props of a table control.
310
- */
311
- export interface StatePropsOfArrayControl extends StatePropsOfControlWithDetail {
312
- translations: ArrayTranslations;
313
- childErrors?: ErrorObject[];
314
- }
315
- /**
316
- * Map state to table props
317
- *
318
- * @param state the store's state
319
- * @param ownProps any element's own props
320
- * @returns {StatePropsOfArrayControl} state props for a table control
321
- */
322
- export declare const mapStateToArrayControlProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfArrayControl;
323
- /**
324
- * Dispatch props of a table control
325
- */
326
- export interface DispatchPropsOfArrayControl {
327
- addItem(path: string, value: any): () => void;
328
- removeItems?(path: string, toDelete: number[]): () => void;
329
- moveUp?(path: string, toMove: number): () => void;
330
- moveDown?(path: string, toMove: number): () => void;
331
- }
332
- /**
333
- * Maps state to dispatch properties of an array control.
334
- *
335
- * @param dispatch the store's dispatch method
336
- * @returns {DispatchPropsOfArrayControl} dispatch props of an array control
337
- */
338
- export declare const mapDispatchToArrayControlProps: (dispatch: Dispatch<CoreActions>) => DispatchPropsOfArrayControl;
339
- export interface DispatchPropsOfMultiEnumControl {
340
- addItem: (path: string, value: any) => void;
341
- removeItem?: (path: string, toDelete: any) => void;
342
- }
343
- export declare const mapDispatchToMultiEnumProps: (dispatch: Dispatch<CoreActions>) => DispatchPropsOfMultiEnumControl;
344
- /**
345
- * Props of an array control.
346
- */
347
- export interface ArrayControlProps extends StatePropsOfArrayControl, DispatchPropsOfArrayControl {
348
- }
349
- export declare const layoutDefaultProps: {
350
- visible: boolean;
351
- enabled: boolean;
352
- path: string;
353
- direction: 'row' | 'column';
354
- };
355
- /**
356
- * Map state to layout props.
357
- * @param state JSONForms state tree
358
- * @param ownProps any own props
359
- * @returns {StatePropsOfLayout}
360
- */
361
- export declare const mapStateToLayoutProps: (state: JsonFormsState, ownProps: OwnPropsOfLayout) => LayoutProps;
362
- export type RefResolver = (schema: JsonSchema) => Promise<JsonSchema>;
363
- export interface OwnPropsOfJsonFormsRenderer extends OwnPropsOfRenderer {
364
- }
365
- export interface StatePropsOfJsonFormsRenderer extends OwnPropsOfJsonFormsRenderer {
366
- rootSchema: JsonSchema;
367
- config: any;
368
- }
369
- export interface JsonFormsProps extends StatePropsOfJsonFormsRenderer {
370
- }
371
- export declare const mapStateToJsonFormsRendererProps: (state: JsonFormsState, ownProps: OwnPropsOfJsonFormsRenderer) => StatePropsOfJsonFormsRenderer;
372
- export declare const controlDefaultProps: {
373
- errors: string[];
374
- visible: boolean;
375
- enabled: boolean;
376
- path: string;
377
- direction: 'row' | 'column';
378
- };
379
- export interface StatePropsOfCombinator extends StatePropsOfControl {
380
- rootSchema: JsonSchema;
381
- path: string;
382
- id: string;
383
- indexOfFittingSchema: number;
384
- uischemas: JsonFormsUISchemaRegistryEntry[];
385
- data: any;
386
- translations: CombinatorTranslations;
387
- }
388
- export declare const mapStateToCombinatorRendererProps: (state: JsonFormsState, ownProps: OwnPropsOfControl, keyword: CombinatorKeyword) => StatePropsOfCombinator;
389
- export interface CombinatorRendererProps extends StatePropsOfCombinator, DispatchPropsOfControl {
390
- }
391
- /**
392
- * Map state to all of renderer props.
393
- * @param state the store's state
394
- * @param ownProps any own props
395
- * @returns {StatePropsOfCombinator} state props for a combinator
396
- */
397
- export declare const mapStateToAllOfProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfCombinator;
398
- export declare const mapStateToAnyOfProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfCombinator;
399
- export declare const mapStateToOneOfProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfCombinator;
400
- export interface StatePropsOfArrayLayout extends StatePropsOfControlWithDetail {
401
- data: number;
402
- translations: ArrayTranslations;
403
- minItems?: number;
404
- }
405
- /**
406
- * Map state to table props
407
- *
408
- * @param state the store's state
409
- * @param ownProps any element's own props
410
- * @returns {StatePropsOfArrayControl} state props for a table control
411
- */
412
- export declare const mapStateToArrayLayoutProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfArrayLayout;
413
- /**
414
- * Props of an array control.
415
- */
416
- export interface ArrayLayoutProps extends StatePropsOfArrayLayout, DispatchPropsOfArrayControl {
417
- }
418
- export interface StatePropsOfLabel extends StatePropsOfRenderer {
419
- text?: string;
420
- }
421
- export interface LabelProps extends StatePropsOfLabel {
422
- }
423
- export declare const mapStateToLabelProps: (state: JsonFormsState, props: OwnPropsOfLabel) => {
424
- text: string;
425
- visible: boolean;
426
- config: any;
427
- renderers: JsonFormsRendererRegistryEntry[];
428
- cells: JsonFormsCellRendererRegistryEntry[];
429
- };
1
+ import { ControlElement, JsonSchema, LabelElement, UISchemaElement } from '../models';
2
+ import type { JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry, JsonFormsUISchemaRegistryEntry } from '../reducers';
3
+ import type { RankedTester } from '../testers';
4
+ import type { CombinatorKeyword } from './combinators';
5
+ import type { AnyAction, Dispatch } from './type';
6
+ import { CoreActions } from '../actions';
7
+ import type { ErrorObject } from 'ajv';
8
+ import type { JsonFormsState } from '../store';
9
+ import { Translator, CombinatorTranslations } from '../i18n';
10
+ import { ArrayTranslations } from '../i18n/arrayTranslations';
11
+ /**
12
+ * Adds an asterisk to the given label string based
13
+ * on the required parameter.
14
+ *
15
+ * @param {string | undefined} label the label string
16
+ * @param {boolean} required whether the label belongs to a control which is required
17
+ * @param {boolean} hideRequiredAsterisk applied UI Schema option
18
+ * @returns {string} the label string
19
+ */
20
+ export declare const computeLabel: (label: string | undefined, required: boolean, hideRequiredAsterisk: boolean) => string;
21
+ /**
22
+ * Indicates whether to mark a field as required.
23
+ *
24
+ * @param {boolean} required whether the label belongs to a control which is required
25
+ * @param {boolean} hideRequiredAsterisk applied UI Schema option
26
+ * @returns {boolean} should the field be marked as required
27
+ */
28
+ export declare const showAsRequired: (required: boolean, hideRequiredAsterisk: boolean) => boolean;
29
+ /**
30
+ * Create a default value based on the given schema.
31
+ * @param schema the schema for which to create a default value.
32
+ * @returns {any}
33
+ */
34
+ export declare const createDefaultValue: (schema: JsonSchema, rootSchema: JsonSchema) => any;
35
+ /**
36
+ * Returns the default value defined in the given schema.
37
+ * @param schema the schema for which to create a default value.
38
+ * @returns {any}
39
+ */
40
+ export declare const extractDefaults: (schema: JsonSchema, rootSchema: JsonSchema) => any;
41
+ /**
42
+ * Whether an element's description should be hidden.
43
+ *
44
+ * @param visible whether an element is visible
45
+ * @param description the element's description
46
+ * @param isFocused whether the element is focused
47
+ *
48
+ * @returns {boolean} true, if the description is to be hidden, false otherwise
49
+ */
50
+ export declare const isDescriptionHidden: (visible: boolean, description: string | undefined, isFocused: boolean, showUnfocusedDescription: boolean) => boolean;
51
+ export interface WithClassname {
52
+ className?: string;
53
+ }
54
+ export interface EnumOption {
55
+ label: string;
56
+ value: any;
57
+ }
58
+ export declare const enumToEnumOptionMapper: (e: any, t?: Translator, i18nKey?: string) => EnumOption;
59
+ export declare const oneOfToEnumOptionMapper: (e: any, t?: Translator, fallbackI18nKey?: string) => EnumOption;
60
+ export interface OwnPropsOfRenderer {
61
+ /**
62
+ * The UI schema to be rendered.
63
+ */
64
+ uischema?: UISchemaElement;
65
+ /**
66
+ * The JSON schema that describes the data.
67
+ */
68
+ schema?: JsonSchema;
69
+ /**
70
+ * Whether the rendered element should be enabled.
71
+ */
72
+ enabled?: boolean;
73
+ /**
74
+ * Whether the rendered element should be visible.
75
+ */
76
+ visible?: boolean;
77
+ /**
78
+ * Optional instance path. Necessary when the actual data
79
+ * path can not be inferred via the UI schema element as
80
+ * it is the case with nested controls.
81
+ */
82
+ path?: string;
83
+ renderers?: JsonFormsRendererRegistryEntry[];
84
+ cells?: JsonFormsCellRendererRegistryEntry[];
85
+ uischemas?: JsonFormsUISchemaRegistryEntry[];
86
+ }
87
+ export interface OwnPropsOfControl extends OwnPropsOfRenderer {
88
+ id?: string;
89
+ uischema?: ControlElement;
90
+ }
91
+ export interface OwnPropsOfLabel extends OwnPropsOfRenderer {
92
+ uischema?: LabelElement;
93
+ }
94
+ export interface OwnPropsOfEnum {
95
+ options?: EnumOption[];
96
+ }
97
+ export interface OwnPropsOfLayout extends OwnPropsOfRenderer {
98
+ direction?: 'row' | 'column';
99
+ }
100
+ /**
101
+ * State-based props of a {@link Renderer}.
102
+ */
103
+ export interface StatePropsOfRenderer {
104
+ /**
105
+ * Any configuration options for the element.
106
+ */
107
+ config?: any;
108
+ /**
109
+ * The UI schema to be rendered.
110
+ */
111
+ uischema: UISchemaElement;
112
+ /**
113
+ * The JSON schema that describes the data.
114
+ */
115
+ schema: JsonSchema;
116
+ /**
117
+ * The data to be rendered.
118
+ */
119
+ data?: any;
120
+ /**
121
+ * Whether the rendered element should be enabled.
122
+ */
123
+ enabled: boolean;
124
+ /**
125
+ * Whether the rendered element should be visible.
126
+ */
127
+ visible: boolean;
128
+ /**
129
+ * Instance path the data is written to, in case of a control.
130
+ */
131
+ path: string;
132
+ /**
133
+ * All available renderers.
134
+ */
135
+ renderers?: JsonFormsRendererRegistryEntry[];
136
+ /**
137
+ * All available cell renderers.
138
+ */
139
+ cells?: JsonFormsCellRendererRegistryEntry[];
140
+ }
141
+ /**
142
+ * State-based properties for UI schema elements that have a scope.
143
+ */
144
+ export interface StatePropsOfScopedRenderer extends StatePropsOfRenderer {
145
+ uischema: ControlElement;
146
+ /**
147
+ * Any validation errors that are caused by the data to be rendered.
148
+ */
149
+ errors: string;
150
+ /**
151
+ * The data to be rendered.
152
+ */
153
+ data: any;
154
+ /**
155
+ * The root schema as returned by the store.
156
+ */
157
+ rootSchema: JsonSchema;
158
+ /**
159
+ * A unique ID that should be used for rendering the scoped UI schema element.
160
+ */
161
+ id: string;
162
+ }
163
+ /**
164
+ * Props of a {@link Renderer}.
165
+ */
166
+ export interface RendererProps extends StatePropsOfRenderer {
167
+ }
168
+ /**
169
+ * State-based props of a Control
170
+ */
171
+ export interface StatePropsOfControl extends StatePropsOfScopedRenderer {
172
+ cells?: {
173
+ tester: RankedTester;
174
+ cell: any;
175
+ }[];
176
+ /**
177
+ * The label for the rendered element.
178
+ */
179
+ label: string;
180
+ /**
181
+ * Description of input cell
182
+ */
183
+ description?: string;
184
+ /**
185
+ * Whether the rendered data is required.
186
+ */
187
+ required?: boolean;
188
+ i18nKeyPrefix?: string;
189
+ }
190
+ /**
191
+ * Dispatch-based props of a Control.
192
+ */
193
+ export interface DispatchPropsOfControl {
194
+ /**
195
+ * Update handler that emits a data change
196
+ *
197
+ * @param {string} path the path to the data to be updated
198
+ * @param {any} value the new value that should be written to the given path
199
+ */
200
+ handleChange(path: string, value: any): void;
201
+ }
202
+ /**
203
+ * Props of a Control.
204
+ */
205
+ export interface ControlProps extends StatePropsOfControl, DispatchPropsOfControl {
206
+ }
207
+ /**
208
+ * State props of a layout;
209
+ */
210
+ export interface StatePropsOfLayout extends StatePropsOfRenderer {
211
+ /**
212
+ * Direction for the layout to flow
213
+ */
214
+ direction: 'row' | 'column';
215
+ label?: string;
216
+ }
217
+ export interface LayoutProps extends StatePropsOfLayout {
218
+ }
219
+ /**
220
+ * The state of a control.
221
+ */
222
+ export interface ControlState {
223
+ /**
224
+ * The current value.
225
+ */
226
+ value: any;
227
+ /**
228
+ * Whether the control is focused.
229
+ */
230
+ isFocused: boolean;
231
+ }
232
+ /**
233
+ * Map state to control props.
234
+ * @param state the store's state
235
+ * @param ownProps any own props
236
+ * @returns {StatePropsOfControl} state props for a control
237
+ */
238
+ export declare const mapStateToControlProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfControl;
239
+ /**
240
+ *
241
+ * Map dispatch to control props.
242
+ *
243
+ * @param dispatch the store's dispatch method
244
+ * @returns {DispatchPropsOfControl} dispatch props for a control
245
+ */
246
+ export declare const mapDispatchToControlProps: (dispatch: Dispatch<AnyAction>) => DispatchPropsOfControl;
247
+ /**
248
+ * Default mapStateToCellProps for enum control. Options is used for populating dropdown list
249
+ * @param state
250
+ * @param ownProps
251
+ * @returns {StatePropsOfControl & OwnPropsOfEnum}
252
+ */
253
+ export declare const mapStateToEnumControlProps: (state: JsonFormsState, ownProps: OwnPropsOfControl & OwnPropsOfEnum) => StatePropsOfControl & OwnPropsOfEnum;
254
+ /**
255
+ * Default mapStateToCellProps for enum control based on oneOf. Options is used for populating dropdown list
256
+ * @param state
257
+ * @param ownProps
258
+ * @returns {StatePropsOfControl & OwnPropsOfEnum}
259
+ */
260
+ export declare const mapStateToOneOfEnumControlProps: (state: JsonFormsState, ownProps: OwnPropsOfControl & OwnPropsOfEnum) => StatePropsOfControl & OwnPropsOfEnum;
261
+ /**
262
+ * Default mapStateToCellProps for multi enum control. Options is used for populating dropdown list
263
+ * @param state
264
+ * @param ownProps
265
+ * @returns {StatePropsOfControl & OwnPropsOfEnum}
266
+ */
267
+ export declare const mapStateToMultiEnumControlProps: (state: JsonFormsState, ownProps: OwnPropsOfControl & OwnPropsOfEnum) => StatePropsOfControl & OwnPropsOfEnum;
268
+ /**
269
+ * Map state to control props.
270
+ * @param state the store's state
271
+ * @param ownProps any own props
272
+ * @returns {StatePropsOfControl} state props for a control
273
+ */
274
+ export declare const mapStateToMasterListItemProps: (state: JsonFormsState, ownProps: OwnPropsOfMasterListItem) => StatePropsOfMasterItem;
275
+ /**
276
+ * State-based props of a table control.
277
+ */
278
+ export interface StatePropsOfControlWithDetail extends StatePropsOfControl {
279
+ uischemas?: JsonFormsUISchemaRegistryEntry[];
280
+ renderers?: JsonFormsRendererRegistryEntry[];
281
+ cells?: JsonFormsCellRendererRegistryEntry[];
282
+ }
283
+ export interface OwnPropsOfMasterListItem {
284
+ index: number;
285
+ selected: boolean;
286
+ path: string;
287
+ enabled: boolean;
288
+ schema: JsonSchema;
289
+ uischema: UISchemaElement;
290
+ childLabelProp?: string;
291
+ handleSelect(index: number): () => void;
292
+ removeItem(path: string, value: number): () => void;
293
+ translations: ArrayTranslations;
294
+ }
295
+ export interface StatePropsOfMasterItem extends OwnPropsOfMasterListItem {
296
+ childLabel: string;
297
+ }
298
+ /**
299
+ * Map state to control with detail props
300
+ *
301
+ * @param state the store's state
302
+ * @param ownProps any element's own props
303
+ * @returns {StatePropsOfArrayControl} state props for a table control
304
+ */
305
+ export declare const mapStateToControlWithDetailProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfControlWithDetail;
306
+ export interface ControlWithDetailProps extends StatePropsOfControlWithDetail, DispatchPropsOfControl {
307
+ }
308
+ /**
309
+ * State-based props of a table control.
310
+ */
311
+ export interface StatePropsOfArrayControl extends StatePropsOfControlWithDetail {
312
+ translations: ArrayTranslations;
313
+ childErrors?: ErrorObject[];
314
+ }
315
+ /**
316
+ * Map state to table props
317
+ *
318
+ * @param state the store's state
319
+ * @param ownProps any element's own props
320
+ * @returns {StatePropsOfArrayControl} state props for a table control
321
+ */
322
+ export declare const mapStateToArrayControlProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfArrayControl;
323
+ /**
324
+ * Dispatch props of a table control
325
+ */
326
+ export interface DispatchPropsOfArrayControl {
327
+ addItem(path: string, value: any): () => void;
328
+ removeItems?(path: string, toDelete: number[]): () => void;
329
+ moveUp?(path: string, toMove: number): () => void;
330
+ moveDown?(path: string, toMove: number): () => void;
331
+ }
332
+ /**
333
+ * Maps state to dispatch properties of an array control.
334
+ *
335
+ * @param dispatch the store's dispatch method
336
+ * @returns {DispatchPropsOfArrayControl} dispatch props of an array control
337
+ */
338
+ export declare const mapDispatchToArrayControlProps: (dispatch: Dispatch<CoreActions>) => DispatchPropsOfArrayControl;
339
+ export interface DispatchPropsOfMultiEnumControl {
340
+ addItem: (path: string, value: any) => void;
341
+ removeItem?: (path: string, toDelete: any) => void;
342
+ }
343
+ export declare const mapDispatchToMultiEnumProps: (dispatch: Dispatch<CoreActions>) => DispatchPropsOfMultiEnumControl;
344
+ /**
345
+ * Props of an array control.
346
+ */
347
+ export interface ArrayControlProps extends StatePropsOfArrayControl, DispatchPropsOfArrayControl {
348
+ }
349
+ export declare const layoutDefaultProps: {
350
+ visible: boolean;
351
+ enabled: boolean;
352
+ path: string;
353
+ direction: 'row' | 'column';
354
+ };
355
+ /**
356
+ * Map state to layout props.
357
+ * @param state JSONForms state tree
358
+ * @param ownProps any own props
359
+ * @returns {StatePropsOfLayout}
360
+ */
361
+ export declare const mapStateToLayoutProps: (state: JsonFormsState, ownProps: OwnPropsOfLayout) => LayoutProps;
362
+ export type RefResolver = (schema: JsonSchema) => Promise<JsonSchema>;
363
+ export interface OwnPropsOfJsonFormsRenderer extends OwnPropsOfRenderer {
364
+ }
365
+ export interface StatePropsOfJsonFormsRenderer extends OwnPropsOfJsonFormsRenderer {
366
+ rootSchema: JsonSchema;
367
+ config: any;
368
+ }
369
+ export interface JsonFormsProps extends StatePropsOfJsonFormsRenderer {
370
+ }
371
+ export declare const mapStateToJsonFormsRendererProps: (state: JsonFormsState, ownProps: OwnPropsOfJsonFormsRenderer) => StatePropsOfJsonFormsRenderer;
372
+ export declare const controlDefaultProps: {
373
+ errors: string[];
374
+ visible: boolean;
375
+ enabled: boolean;
376
+ path: string;
377
+ direction: 'row' | 'column';
378
+ };
379
+ export interface StatePropsOfCombinator extends StatePropsOfControl {
380
+ rootSchema: JsonSchema;
381
+ path: string;
382
+ id: string;
383
+ indexOfFittingSchema: number;
384
+ uischemas: JsonFormsUISchemaRegistryEntry[];
385
+ data: any;
386
+ translations: CombinatorTranslations;
387
+ }
388
+ export declare const mapStateToCombinatorRendererProps: (state: JsonFormsState, ownProps: OwnPropsOfControl, keyword: CombinatorKeyword) => StatePropsOfCombinator;
389
+ export interface CombinatorRendererProps extends StatePropsOfCombinator, DispatchPropsOfControl {
390
+ }
391
+ /**
392
+ * Map state to all of renderer props.
393
+ * @param state the store's state
394
+ * @param ownProps any own props
395
+ * @returns {StatePropsOfCombinator} state props for a combinator
396
+ */
397
+ export declare const mapStateToAllOfProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfCombinator;
398
+ export declare const mapStateToAnyOfProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfCombinator;
399
+ export declare const mapStateToOneOfProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfCombinator;
400
+ export interface StatePropsOfArrayLayout extends StatePropsOfControlWithDetail {
401
+ data: number;
402
+ translations: ArrayTranslations;
403
+ minItems?: number;
404
+ }
405
+ /**
406
+ * Map state to table props
407
+ *
408
+ * @param state the store's state
409
+ * @param ownProps any element's own props
410
+ * @returns {StatePropsOfArrayControl} state props for a table control
411
+ */
412
+ export declare const mapStateToArrayLayoutProps: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfArrayLayout;
413
+ /**
414
+ * Props of an array control.
415
+ */
416
+ export interface ArrayLayoutProps extends StatePropsOfArrayLayout, DispatchPropsOfArrayControl {
417
+ }
418
+ export interface StatePropsOfLabel extends StatePropsOfRenderer {
419
+ text?: string;
420
+ }
421
+ export interface LabelProps extends StatePropsOfLabel {
422
+ }
423
+ export declare const mapStateToLabelProps: (state: JsonFormsState, props: OwnPropsOfLabel) => {
424
+ text: string;
425
+ visible: boolean;
426
+ config: any;
427
+ renderers: JsonFormsRendererRegistryEntry[];
428
+ cells: JsonFormsCellRendererRegistryEntry[];
429
+ };