@jsonforms/core 3.0.0-alpha.1 → 3.0.0-beta.1

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 (228) hide show
  1. package/docs/assets/js/search.json +1 -1
  2. package/docs/globals.html +822 -405
  3. package/docs/index.html +69 -36
  4. package/docs/interfaces/addcellrendereraction.html +3 -3
  5. package/docs/interfaces/addrendereraction.html +3 -3
  6. package/docs/interfaces/adduischemaaction.html +3 -3
  7. package/docs/interfaces/arraycontrolprops.html +21 -21
  8. package/docs/interfaces/arraylayoutprops.html +21 -21
  9. package/docs/interfaces/cellprops.html +14 -14
  10. package/docs/interfaces/combinatorrendererprops.html +13 -13
  11. package/docs/interfaces/controlprops.html +16 -16
  12. package/docs/interfaces/controlstate.html +2 -2
  13. package/docs/interfaces/controlwithdetailprops.html +17 -17
  14. package/docs/interfaces/dispatchcellprops.html +13 -13
  15. package/docs/interfaces/dispatchcellstateprops.html +13 -13
  16. package/docs/interfaces/dispatchpropsofarraycontrol.html +4 -4
  17. package/docs/interfaces/dispatchpropsofcontrol.html +1 -1
  18. package/docs/interfaces/dispatchpropsofmultienumcontrol.html +2 -2
  19. package/docs/interfaces/enumcellprops.html +15 -15
  20. package/docs/interfaces/enumoption.html +2 -2
  21. package/docs/interfaces/initaction.html +6 -6
  22. package/docs/interfaces/initactionoptions.html +3 -3
  23. package/docs/interfaces/jsonformscore.html +7 -7
  24. package/docs/interfaces/{jsonformslocalestate.html → jsonformsi18nstate.html} +20 -20
  25. package/docs/interfaces/jsonformsprops.html +9 -9
  26. package/docs/interfaces/jsonformssubstates.html +11 -1
  27. package/docs/interfaces/layoutprops.html +10 -10
  28. package/docs/interfaces/ownpropsofcell.html +10 -10
  29. package/docs/interfaces/ownpropsofcontrol.html +9 -9
  30. package/docs/interfaces/ownpropsofenum.html +1 -1
  31. package/docs/interfaces/ownpropsofenumcell.html +11 -11
  32. package/docs/interfaces/ownpropsofjsonformsrenderer.html +8 -8
  33. package/docs/interfaces/ownpropsoflayout.html +9 -9
  34. package/docs/interfaces/ownpropsofmasterlistitem.html +6 -6
  35. package/docs/interfaces/ownpropsofrenderer.html +8 -8
  36. package/docs/interfaces/registerdefaultdataaction.html +3 -3
  37. package/docs/interfaces/removecellrendereraction.html +3 -3
  38. package/docs/interfaces/removerendereraction.html +3 -3
  39. package/docs/interfaces/removeuischemaaction.html +2 -2
  40. package/docs/interfaces/rendererprops.html +9 -9
  41. package/docs/interfaces/setajvaction.html +3 -3
  42. package/docs/interfaces/setconfigaction.html +2 -2
  43. package/docs/interfaces/setlocaleaction.html +3 -3
  44. package/docs/interfaces/setschemaaction.html +2 -2
  45. package/docs/interfaces/{setlocalizedschemasaction.html → settranslatoraction.html} +29 -15
  46. package/docs/interfaces/setuischemaaction.html +2 -2
  47. package/docs/interfaces/setvalidationmodeaction.html +2 -2
  48. package/docs/interfaces/statepropsofarraycontrol.html +17 -17
  49. package/docs/interfaces/statepropsofarraylayout.html +17 -17
  50. package/docs/interfaces/statepropsofcell.html +13 -13
  51. package/docs/interfaces/statepropsofcombinator.html +12 -12
  52. package/docs/interfaces/statepropsofcontrol.html +15 -15
  53. package/docs/interfaces/statepropsofcontrolwithdetail.html +16 -16
  54. package/docs/interfaces/statepropsofenumcell.html +14 -14
  55. package/docs/interfaces/statepropsofjsonformsrenderer.html +9 -9
  56. package/docs/interfaces/statepropsoflayout.html +10 -10
  57. package/docs/interfaces/statepropsofmasteritem.html +7 -7
  58. package/docs/interfaces/statepropsofrenderer.html +9 -9
  59. package/docs/interfaces/statepropsofscopedrenderer.html +12 -12
  60. package/docs/interfaces/unregisterdefaultdataaction.html +2 -2
  61. package/docs/interfaces/updateaction.html +3 -3
  62. package/docs/interfaces/updatecoreaction.html +6 -6
  63. package/docs/interfaces/updateerrorsaction.html +2 -2
  64. package/docs/interfaces/{setlocalizeduischemasaction.html → updatei18naction.html} +43 -15
  65. package/docs/interfaces/withclassname.html +1 -1
  66. package/lib/Helpers.d.ts +5 -5
  67. package/lib/actions/actions.d.ts +181 -177
  68. package/lib/actions/index.d.ts +1 -1
  69. package/lib/configDefault.d.ts +6 -6
  70. package/lib/generators/Generate.d.ts +6 -6
  71. package/lib/generators/index.d.ts +3 -3
  72. package/lib/generators/schema.d.ts +8 -8
  73. package/lib/generators/uischema.d.ts +12 -12
  74. package/lib/i18n/i18nTypes.d.ts +15 -0
  75. package/lib/i18n/i18nUtil.d.ts +18 -0
  76. package/lib/i18n/index.d.ts +2 -0
  77. package/lib/index.d.ts +11 -10
  78. package/lib/jsonforms-core.cjs.js +2445 -0
  79. package/lib/jsonforms-core.cjs.js.map +1 -0
  80. package/lib/jsonforms-core.esm.js +2164 -0
  81. package/lib/jsonforms-core.esm.js.map +1 -0
  82. package/lib/models/draft4.d.ts +198 -198
  83. package/lib/models/index.d.ts +5 -5
  84. package/lib/models/jsonSchema.d.ts +3 -3
  85. package/lib/models/jsonSchema4.d.ts +110 -110
  86. package/lib/models/jsonSchema7.d.ts +119 -119
  87. package/lib/models/uischema.d.ts +201 -201
  88. package/lib/reducers/cells.d.ts +11 -11
  89. package/lib/reducers/config.d.ts +3 -3
  90. package/lib/reducers/core.d.ts +24 -23
  91. package/lib/reducers/default-data.d.ts +10 -10
  92. package/lib/reducers/i18n.d.ts +8 -11
  93. package/lib/reducers/index.d.ts +9 -9
  94. package/lib/reducers/reducers.d.ts +29 -36
  95. package/lib/reducers/renderers.d.ts +10 -10
  96. package/lib/reducers/selectors.d.ts +15 -15
  97. package/lib/reducers/uischemas.d.ts +10 -10
  98. package/lib/store.d.ts +53 -52
  99. package/lib/testers/index.d.ts +1 -1
  100. package/lib/testers/testers.d.ts +203 -203
  101. package/lib/util/Formatted.d.ts +19 -19
  102. package/lib/util/array.d.ts +3 -3
  103. package/lib/util/cell.d.ts +79 -79
  104. package/lib/util/combinators.d.ts +10 -10
  105. package/lib/util/ids.d.ts +3 -3
  106. package/lib/util/index.d.ts +15 -15
  107. package/lib/util/label.d.ts +9 -9
  108. package/lib/util/path.d.ts +25 -25
  109. package/lib/util/renderer.d.ts +398 -387
  110. package/lib/util/resolvers.d.ts +25 -25
  111. package/lib/util/runtime.d.ts +18 -19
  112. package/lib/util/schema.d.ts +1 -1
  113. package/lib/util/type.d.ts +174 -174
  114. package/lib/util/uischema.d.ts +5 -5
  115. package/lib/util/util.d.ts +31 -31
  116. package/lib/util/validator.d.ts +3 -2
  117. package/package.json +18 -14
  118. package/rollup.config.js +44 -0
  119. package/src/actions/actions.ts +46 -36
  120. package/src/i18n/i18nTypes.ts +17 -0
  121. package/src/i18n/i18nUtil.ts +105 -0
  122. package/src/i18n/index.ts +2 -0
  123. package/src/index.ts +1 -0
  124. package/src/reducers/core.ts +70 -48
  125. package/src/reducers/i18n.ts +41 -35
  126. package/src/reducers/reducers.ts +10 -29
  127. package/src/reducers/selectors.ts +1 -1
  128. package/src/store.ts +4 -4
  129. package/src/util/cell.ts +26 -6
  130. package/src/util/renderer.ts +127 -38
  131. package/src/util/runtime.ts +1 -1
  132. package/src/util/util.ts +1 -1
  133. package/src/util/validator.ts +5 -9
  134. package/stats.html +3279 -0
  135. package/{lib/reducers/cells.js → test/i18n/i18nUtil.test.ts} +25 -17
  136. package/test/reducers/core.test.ts +31 -44
  137. package/test/util/cell.test.ts +2 -2
  138. package/test/util/renderer.test.ts +488 -35
  139. package/lib/Helpers.js +0 -32
  140. package/lib/Helpers.js.map +0 -1
  141. package/lib/actions/actions.js +0 -149
  142. package/lib/actions/actions.js.map +0 -1
  143. package/lib/actions/index.js +0 -29
  144. package/lib/actions/index.js.map +0 -1
  145. package/lib/configDefault.js +0 -47
  146. package/lib/configDefault.js.map +0 -1
  147. package/lib/generators/Generate.js +0 -34
  148. package/lib/generators/Generate.js.map +0 -1
  149. package/lib/generators/index.js +0 -31
  150. package/lib/generators/index.js.map +0 -1
  151. package/lib/generators/schema.js +0 -152
  152. package/lib/generators/schema.js.map +0 -1
  153. package/lib/generators/uischema.js +0 -166
  154. package/lib/generators/uischema.js.map +0 -1
  155. package/lib/index.js +0 -37
  156. package/lib/index.js.map +0 -1
  157. package/lib/jsonforms-core.js +0 -19
  158. package/lib/jsonforms-core.js.map +0 -1
  159. package/lib/models/draft4.js +0 -173
  160. package/lib/models/draft4.js.map +0 -1
  161. package/lib/models/index.js +0 -30
  162. package/lib/models/index.js.map +0 -1
  163. package/lib/models/jsonSchema.js +0 -27
  164. package/lib/models/jsonSchema.js.map +0 -1
  165. package/lib/models/jsonSchema4.js +0 -30
  166. package/lib/models/jsonSchema4.js.map +0 -1
  167. package/lib/models/jsonSchema7.js +0 -30
  168. package/lib/models/jsonSchema7.js.map +0 -1
  169. package/lib/models/uischema.js +0 -55
  170. package/lib/models/uischema.js.map +0 -1
  171. package/lib/reducers/cells.js.map +0 -1
  172. package/lib/reducers/config.js +0 -44
  173. package/lib/reducers/config.js.map +0 -1
  174. package/lib/reducers/core.js +0 -259
  175. package/lib/reducers/core.js.map +0 -1
  176. package/lib/reducers/default-data.js +0 -42
  177. package/lib/reducers/default-data.js.map +0 -1
  178. package/lib/reducers/i18n.js +0 -65
  179. package/lib/reducers/i18n.js.map +0 -1
  180. package/lib/reducers/index.js +0 -37
  181. package/lib/reducers/index.js.map +0 -1
  182. package/lib/reducers/reducers.js +0 -99
  183. package/lib/reducers/reducers.js.map +0 -1
  184. package/lib/reducers/renderers.js +0 -41
  185. package/lib/reducers/renderers.js.map +0 -1
  186. package/lib/reducers/selectors.js +0 -47
  187. package/lib/reducers/selectors.js.map +0 -1
  188. package/lib/reducers/uischemas.js +0 -57
  189. package/lib/reducers/uischemas.js.map +0 -1
  190. package/lib/store.js +0 -27
  191. package/lib/store.js.map +0 -1
  192. package/lib/testers/index.js +0 -29
  193. package/lib/testers/index.js.map +0 -1
  194. package/lib/testers/testers.js +0 -401
  195. package/lib/testers/testers.js.map +0 -1
  196. package/lib/util/Formatted.js +0 -27
  197. package/lib/util/Formatted.js.map +0 -1
  198. package/lib/util/array.js +0 -43
  199. package/lib/util/array.js.map +0 -1
  200. package/lib/util/cell.js +0 -133
  201. package/lib/util/cell.js.map +0 -1
  202. package/lib/util/combinators.js +0 -56
  203. package/lib/util/combinators.js.map +0 -1
  204. package/lib/util/ids.js +0 -50
  205. package/lib/util/ids.js.map +0 -1
  206. package/lib/util/index.js +0 -41
  207. package/lib/util/index.js.map +0 -1
  208. package/lib/util/label.js +0 -70
  209. package/lib/util/label.js.map +0 -1
  210. package/lib/util/path.js +0 -85
  211. package/lib/util/path.js.map +0 -1
  212. package/lib/util/renderer.js +0 -451
  213. package/lib/util/renderer.js.map +0 -1
  214. package/lib/util/resolvers.js +0 -165
  215. package/lib/util/resolvers.js.map +0 -1
  216. package/lib/util/runtime.js +0 -159
  217. package/lib/util/runtime.js.map +0 -1
  218. package/lib/util/schema.js +0 -40
  219. package/lib/util/schema.js.map +0 -1
  220. package/lib/util/type.js +0 -27
  221. package/lib/util/type.js.map +0 -1
  222. package/lib/util/uischema.js +0 -52
  223. package/lib/util/uischema.js.map +0 -1
  224. package/lib/util/util.js +0 -107
  225. package/lib/util/util.js.map +0 -1
  226. package/lib/util/validator.js +0 -36
  227. package/lib/util/validator.js.map +0 -1
  228. package/webpack.build.js +0 -13
@@ -1,203 +1,203 @@
1
- import { 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
- */
11
- export declare type Tester = (uischema: UISchemaElement, schema: JsonSchema) => boolean;
12
- /**
13
- * A ranked tester associates a tester with a number.
14
- */
15
- export declare type RankedTester = (uischema: UISchemaElement, schema: JsonSchema) => number;
16
- export declare const isControl: (uischema: any) => uischema is ControlElement;
17
- /**
18
- * Only applicable for Controls.
19
- *
20
- * This function checks whether the given UI schema is of type Control
21
- * and if so, resolves the sub-schema referenced by the control and applies
22
- * the given predicate
23
- *
24
- * @param {(JsonSchema) => boolean} predicate the predicate that should be
25
- * applied to the resolved sub-schema
26
- */
27
- export declare const schemaMatches: (predicate: (schema: JsonSchema) => boolean) => Tester;
28
- export declare const schemaSubPathMatches: (subPath: string, predicate: (schema: JsonSchema) => boolean) => Tester;
29
- /**
30
- * Only applicable for Controls.
31
- *
32
- * This function checks whether the given UI schema is of type Control
33
- * and if so, resolves the sub-schema referenced by the control and checks
34
- * whether the type of the sub-schema matches the expected one.
35
- *
36
- * @param {string} expectedType the expected type of the resolved sub-schema
37
- */
38
- export declare const schemaTypeIs: (expectedType: string) => 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 format of the sub-schema matches the expected one.
45
- *
46
- * @param {string} expectedFormat the expected format of the resolved sub-schema
47
- */
48
- export declare const formatIs: (expectedFormat: string) => Tester;
49
- /**
50
- * Checks whether the given UI schema has the expected type.
51
- *
52
- * @param {string} expected the expected UI schema type
53
- */
54
- export declare const uiTypeIs: (expected: string) => Tester;
55
- /**
56
- * Checks whether the given UI schema has an option with the given
57
- * name and whether it has the expected value. If no options property
58
- * is set, returns false.
59
- *
60
- * @param {string} optionName the name of the option to check
61
- * @param {any} optionValue the expected value of the option
62
- */
63
- export declare const optionIs: (optionName: string, optionValue: any) => Tester;
64
- /**
65
- * Only applicable for Controls.
66
- *
67
- * Checks whether the scope of a control ends with the expected string.
68
- *
69
- * @param {string} expected the expected ending of the reference
70
- */
71
- export declare const scopeEndsWith: (expected: string) => Tester;
72
- /**
73
- * Only applicable for Controls.
74
- *
75
- * Checks whether the last segment of the scope matches the expected string.
76
- *
77
- * @param {string} expected the expected ending of the reference
78
- */
79
- export declare const scopeEndIs: (expected: string) => Tester;
80
- /**
81
- * A tester that allow composing other testers by && them.
82
- *
83
- * @param {Array<Tester>} testers the testers to be composed
84
- */
85
- export declare const and: (...testers: Tester[]) => Tester;
86
- /**
87
- * A tester that allow composing other testers by || them.
88
- *
89
- * @param {Array<Tester>} testers the testers to be composed
90
- */
91
- export declare const or: (...testers: Tester[]) => Tester;
92
- /**
93
- * Create a ranked tester that will associate a number with a given tester, if the
94
- * latter returns true.
95
- *
96
- * @param {number} rank the rank to be returned in case the tester returns true
97
- * @param {Tester} tester a tester
98
- */
99
- export declare const rankWith: (rank: number, tester: Tester) => (uischema: UISchemaElement, schema: JsonSchema) => number;
100
- export declare const withIncreasedRank: (by: number, rankedTester: RankedTester) => (uischema: UISchemaElement, schema: JsonSchema) => number;
101
- /**
102
- * Default tester for boolean.
103
- * @type {RankedTester}
104
- */
105
- export declare const isBooleanControl: Tester;
106
- export declare const isObjectControl: Tester;
107
- export declare const isAllOfControl: Tester;
108
- export declare const isAnyOfControl: Tester;
109
- export declare const isOneOfControl: Tester;
110
- /**
111
- * Tests whether the given UI schema is of type Control and if the schema
112
- * has an enum.
113
- * @type {Tester}
114
- */
115
- export declare const isEnumControl: Tester;
116
- /**
117
- * Tests whether the given UI schema is of type Control and if the schema
118
- * has an enum based on oneOf.
119
- * @type {Tester}
120
- */
121
- export declare const isOneOfEnumControl: Tester;
122
- /**
123
- * Tests whether the given UI schema is of type Control and if the schema
124
- * is of type integer
125
- * @type {Tester}
126
- */
127
- export declare const isIntegerControl: Tester;
128
- /**
129
- * Tests whether the given UI schema is of type Control and if the schema
130
- * is of type number
131
- * @type {Tester}
132
- */
133
- export declare const isNumberControl: Tester;
134
- /**
135
- * Tests whether the given UI schema is of type Control and if the schema
136
- * is of type string
137
- * @type {Tester}
138
- */
139
- export declare const isStringControl: Tester;
140
- /**
141
- * Tests whether the given UI schema is of type Control and if is has
142
- * a 'multi' option.
143
- * @type {Tester}
144
- */
145
- export declare const isMultiLineControl: Tester;
146
- /**
147
- * Tests whether the given UI schema is of type Control and whether the schema
148
- * or uischema options has a 'date' format.
149
- * @type {Tester}
150
- */
151
- export declare const isDateControl: Tester;
152
- /**
153
- * Tests whether the given UI schema is of type Control and whether the schema
154
- * or the uischema options has a 'time' format.
155
- * @type {Tester}
156
- */
157
- export declare const isTimeControl: Tester;
158
- /**
159
- * Tests whether the given UI schema is of type Control and whether the schema
160
- * or the uischema options has a 'date-time' format.
161
- * @type {Tester}
162
- */
163
- export declare const isDateTimeControl: Tester;
164
- /**
165
- * Tests whether the given schema is an array of objects.
166
- * @type {Tester}
167
- */
168
- export declare const isObjectArray: Tester;
169
- /**
170
- * Tests whether the given UI schema is of type Control and if the schema
171
- * is an array of objects.
172
- * @type {Tester}
173
- */
174
- export declare const isObjectArrayControl: Tester;
175
- export declare const isObjectArrayWithNesting: (uischema: UISchemaElement, schema: JsonSchema) => boolean;
176
- /**
177
- * Synonym for isObjectArrayControl
178
- */
179
- export declare const isArrayObjectControl: Tester;
180
- /**
181
- * Tests whether the given UI schema is of type Control and if the schema
182
- * is an array of a primitive type.
183
- * @type {Tester}
184
- */
185
- export declare const isPrimitiveArrayControl: Tester;
186
- /**
187
- * Tests whether a given UI schema is of type Control,
188
- * if the schema is of type number or integer and
189
- * whether the schema defines a numerical range with a default value.
190
- * @type {Tester}
191
- */
192
- export declare const isRangeControl: Tester;
193
- /**
194
- * Tests whether the given UI schema is of type Control, if the schema
195
- * is of type string and has option format
196
- * @type {Tester}
197
- */
198
- export declare const isNumberFormatControl: Tester;
199
- export declare const isCategorization: (category: UISchemaElement) => category is Categorization;
200
- export declare const isCategory: (uischema: UISchemaElement) => boolean;
201
- export declare const hasCategory: (categorization: Categorization) => boolean;
202
- export declare const categorizationHasCategory: (uischema: UISchemaElement) => boolean;
203
- export declare const not: (tester: Tester) => Tester;
1
+ import { 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
+ */
11
+ export declare type Tester = (uischema: UISchemaElement, schema: JsonSchema) => boolean;
12
+ /**
13
+ * A ranked tester associates a tester with a number.
14
+ */
15
+ export declare type RankedTester = (uischema: UISchemaElement, schema: JsonSchema) => number;
16
+ export declare const isControl: (uischema: any) => uischema is ControlElement;
17
+ /**
18
+ * Only applicable for Controls.
19
+ *
20
+ * This function checks whether the given UI schema is of type Control
21
+ * and if so, resolves the sub-schema referenced by the control and applies
22
+ * the given predicate
23
+ *
24
+ * @param {(JsonSchema) => boolean} predicate the predicate that should be
25
+ * applied to the resolved sub-schema
26
+ */
27
+ export declare const schemaMatches: (predicate: (schema: JsonSchema) => boolean) => Tester;
28
+ export declare const schemaSubPathMatches: (subPath: string, predicate: (schema: JsonSchema) => boolean) => Tester;
29
+ /**
30
+ * Only applicable for Controls.
31
+ *
32
+ * This function checks whether the given UI schema is of type Control
33
+ * and if so, resolves the sub-schema referenced by the control and checks
34
+ * whether the type of the sub-schema matches the expected one.
35
+ *
36
+ * @param {string} expectedType the expected type of the resolved sub-schema
37
+ */
38
+ export declare const schemaTypeIs: (expectedType: string) => 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 format of the sub-schema matches the expected one.
45
+ *
46
+ * @param {string} expectedFormat the expected format of the resolved sub-schema
47
+ */
48
+ export declare const formatIs: (expectedFormat: string) => Tester;
49
+ /**
50
+ * Checks whether the given UI schema has the expected type.
51
+ *
52
+ * @param {string} expected the expected UI schema type
53
+ */
54
+ export declare const uiTypeIs: (expected: string) => Tester;
55
+ /**
56
+ * Checks whether the given UI schema has an option with the given
57
+ * name and whether it has the expected value. If no options property
58
+ * is set, returns false.
59
+ *
60
+ * @param {string} optionName the name of the option to check
61
+ * @param {any} optionValue the expected value of the option
62
+ */
63
+ export declare const optionIs: (optionName: string, optionValue: any) => Tester;
64
+ /**
65
+ * Only applicable for Controls.
66
+ *
67
+ * Checks whether the scope of a control ends with the expected string.
68
+ *
69
+ * @param {string} expected the expected ending of the reference
70
+ */
71
+ export declare const scopeEndsWith: (expected: string) => Tester;
72
+ /**
73
+ * Only applicable for Controls.
74
+ *
75
+ * Checks whether the last segment of the scope matches the expected string.
76
+ *
77
+ * @param {string} expected the expected ending of the reference
78
+ */
79
+ export declare const scopeEndIs: (expected: string) => Tester;
80
+ /**
81
+ * A tester that allow composing other testers by && them.
82
+ *
83
+ * @param {Array<Tester>} testers the testers to be composed
84
+ */
85
+ export declare const and: (...testers: Tester[]) => Tester;
86
+ /**
87
+ * A tester that allow composing other testers by || them.
88
+ *
89
+ * @param {Array<Tester>} testers the testers to be composed
90
+ */
91
+ export declare const or: (...testers: Tester[]) => Tester;
92
+ /**
93
+ * Create a ranked tester that will associate a number with a given tester, if the
94
+ * latter returns true.
95
+ *
96
+ * @param {number} rank the rank to be returned in case the tester returns true
97
+ * @param {Tester} tester a tester
98
+ */
99
+ export declare const rankWith: (rank: number, tester: Tester) => (uischema: UISchemaElement, schema: JsonSchema) => number;
100
+ export declare const withIncreasedRank: (by: number, rankedTester: RankedTester) => (uischema: UISchemaElement, schema: JsonSchema) => number;
101
+ /**
102
+ * Default tester for boolean.
103
+ * @type {RankedTester}
104
+ */
105
+ export declare const isBooleanControl: Tester;
106
+ export declare const isObjectControl: Tester;
107
+ export declare const isAllOfControl: Tester;
108
+ export declare const isAnyOfControl: Tester;
109
+ export declare const isOneOfControl: Tester;
110
+ /**
111
+ * Tests whether the given UI schema is of type Control and if the schema
112
+ * has an enum.
113
+ * @type {Tester}
114
+ */
115
+ export declare const isEnumControl: Tester;
116
+ /**
117
+ * Tests whether the given UI schema is of type Control and if the schema
118
+ * has an enum based on oneOf.
119
+ * @type {Tester}
120
+ */
121
+ export declare const isOneOfEnumControl: Tester;
122
+ /**
123
+ * Tests whether the given UI schema is of type Control and if the schema
124
+ * is of type integer
125
+ * @type {Tester}
126
+ */
127
+ export declare const isIntegerControl: Tester;
128
+ /**
129
+ * Tests whether the given UI schema is of type Control and if the schema
130
+ * is of type number
131
+ * @type {Tester}
132
+ */
133
+ export declare const isNumberControl: Tester;
134
+ /**
135
+ * Tests whether the given UI schema is of type Control and if the schema
136
+ * is of type string
137
+ * @type {Tester}
138
+ */
139
+ export declare const isStringControl: Tester;
140
+ /**
141
+ * Tests whether the given UI schema is of type Control and if is has
142
+ * a 'multi' option.
143
+ * @type {Tester}
144
+ */
145
+ export declare const isMultiLineControl: Tester;
146
+ /**
147
+ * Tests whether the given UI schema is of type Control and whether the schema
148
+ * or uischema options has a 'date' format.
149
+ * @type {Tester}
150
+ */
151
+ export declare const isDateControl: Tester;
152
+ /**
153
+ * Tests whether the given UI schema is of type Control and whether the schema
154
+ * or the uischema options has a 'time' format.
155
+ * @type {Tester}
156
+ */
157
+ export declare const isTimeControl: Tester;
158
+ /**
159
+ * Tests whether the given UI schema is of type Control and whether the schema
160
+ * or the uischema options has a 'date-time' format.
161
+ * @type {Tester}
162
+ */
163
+ export declare const isDateTimeControl: Tester;
164
+ /**
165
+ * Tests whether the given schema is an array of objects.
166
+ * @type {Tester}
167
+ */
168
+ export declare const isObjectArray: Tester;
169
+ /**
170
+ * Tests whether the given UI schema is of type Control and if the schema
171
+ * is an array of objects.
172
+ * @type {Tester}
173
+ */
174
+ export declare const isObjectArrayControl: Tester;
175
+ export declare const isObjectArrayWithNesting: (uischema: UISchemaElement, schema: JsonSchema) => boolean;
176
+ /**
177
+ * Synonym for isObjectArrayControl
178
+ */
179
+ export declare const isArrayObjectControl: Tester;
180
+ /**
181
+ * Tests whether the given UI schema is of type Control and if the schema
182
+ * is an array of a primitive type.
183
+ * @type {Tester}
184
+ */
185
+ export declare const isPrimitiveArrayControl: Tester;
186
+ /**
187
+ * Tests whether a given UI schema is of type Control,
188
+ * if the schema is of type number or integer and
189
+ * whether the schema defines a numerical range with a default value.
190
+ * @type {Tester}
191
+ */
192
+ export declare const isRangeControl: Tester;
193
+ /**
194
+ * Tests whether the given UI schema is of type Control, if the schema
195
+ * is of type string and has option format
196
+ * @type {Tester}
197
+ */
198
+ export declare const isNumberFormatControl: Tester;
199
+ export declare const isCategorization: (category: UISchemaElement) => category is Categorization;
200
+ export declare const isCategory: (uischema: UISchemaElement) => boolean;
201
+ export declare const hasCategory: (categorization: Categorization) => boolean;
202
+ export declare const categorizationHasCategory: (uischema: UISchemaElement) => boolean;
203
+ export declare const not: (tester: Tester) => Tester;
@@ -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
+ }
@@ -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 };
@@ -1,79 +1,79 @@
1
- import { JsonFormsCellRendererRegistryEntry } from '../reducers';
2
- import { AnyAction, Dispatch } from './type';
3
- import { DispatchPropsOfControl, OwnPropsOfControl, OwnPropsOfEnum, StatePropsOfScopedRenderer } from './renderer';
4
- import { JsonFormsState } from '../store';
5
- import { JsonSchema } from '../models';
6
- export { JsonFormsCellRendererRegistryEntry };
7
- export interface OwnPropsOfCell extends OwnPropsOfControl {
8
- data?: any;
9
- }
10
- /**
11
- * State props of a cell.
12
- */
13
- export interface StatePropsOfCell extends StatePropsOfScopedRenderer {
14
- isValid: boolean;
15
- rootSchema: JsonSchema;
16
- }
17
- export interface OwnPropsOfEnumCell extends OwnPropsOfCell, OwnPropsOfEnum {
18
- }
19
- /**
20
- * State props of a cell for enum cell
21
- */
22
- export interface StatePropsOfEnumCell extends StatePropsOfCell, OwnPropsOfEnum {
23
- }
24
- /**
25
- * Props of an enum cell.
26
- */
27
- export interface EnumCellProps extends StatePropsOfEnumCell, DispatchPropsOfControl {
28
- }
29
- export declare type DispatchPropsOfCell = DispatchPropsOfControl;
30
- /**
31
- * Props of a cell.
32
- */
33
- export interface CellProps extends StatePropsOfCell, DispatchPropsOfCell {
34
- }
35
- /**
36
- * Registers the given cell renderer when a JSON Forms store is created.
37
- * @param {RankedTester} tester
38
- * @param cell the cell to be registered
39
- * @returns {any}
40
- */
41
- export interface DispatchCellStateProps extends StatePropsOfCell {
42
- cells?: JsonFormsCellRendererRegistryEntry[];
43
- }
44
- /**
45
- * Map state to cell props.
46
- *
47
- * @param state JSONForms state tree
48
- * @param ownProps any own props
49
- * @returns {StatePropsOfCell} state props of a cell
50
- */
51
- export declare const mapStateToCellProps: (state: JsonFormsState, ownProps: OwnPropsOfCell) => StatePropsOfCell;
52
- export declare const mapStateToDispatchCellProps: (state: JsonFormsState, ownProps: OwnPropsOfCell) => DispatchCellStateProps;
53
- export interface DispatchCellProps extends DispatchCellStateProps {
54
- }
55
- /**
56
- * Default mapStateToCellProps for enum cell. Options is used for populating dropdown list
57
- * @param state
58
- * @param ownProps
59
- * @returns {StatePropsOfEnumCell}
60
- */
61
- export declare const defaultMapStateToEnumCellProps: (state: JsonFormsState, ownProps: OwnPropsOfEnumCell) => StatePropsOfEnumCell;
62
- /**
63
- * mapStateToOneOfEnumCellProps for one of enum cell. Options is used for populating dropdown list from oneOf
64
- * @param state
65
- * @param ownProps
66
- * @returns {StatePropsOfEnumCell}
67
- */
68
- export declare const mapStateToOneOfEnumCellProps: (state: JsonFormsState, ownProps: OwnPropsOfEnumCell) => StatePropsOfEnumCell;
69
- /**
70
- * Synonym for mapDispatchToControlProps.
71
- *
72
- * @type {(dispatch) => {handleChange(path, value): void}}
73
- */
74
- export declare const mapDispatchToCellProps: (dispatch: Dispatch<AnyAction>) => DispatchPropsOfControl;
75
- /**
76
- * Default dispatch to control props which can be customized to set handleChange action
77
- *
78
- */
79
- export declare const defaultMapDispatchToControlProps: (dispatch: Dispatch<AnyAction>, ownProps: any) => DispatchPropsOfControl;
1
+ import type { JsonFormsCellRendererRegistryEntry } from '../reducers';
2
+ import { AnyAction, Dispatch } from './type';
3
+ import { DispatchPropsOfControl, OwnPropsOfControl, OwnPropsOfEnum, StatePropsOfScopedRenderer } from './renderer';
4
+ import { JsonFormsState } from '../store';
5
+ import { JsonSchema } from '../models';
6
+ export type { JsonFormsCellRendererRegistryEntry };
7
+ export interface OwnPropsOfCell extends OwnPropsOfControl {
8
+ data?: any;
9
+ }
10
+ /**
11
+ * State props of a cell.
12
+ */
13
+ export interface StatePropsOfCell extends StatePropsOfScopedRenderer {
14
+ isValid: boolean;
15
+ rootSchema: JsonSchema;
16
+ }
17
+ export interface OwnPropsOfEnumCell extends OwnPropsOfCell, OwnPropsOfEnum {
18
+ }
19
+ /**
20
+ * State props of a cell for enum cell
21
+ */
22
+ export interface StatePropsOfEnumCell extends StatePropsOfCell, OwnPropsOfEnum {
23
+ }
24
+ /**
25
+ * Props of an enum cell.
26
+ */
27
+ export interface EnumCellProps extends StatePropsOfEnumCell, DispatchPropsOfControl {
28
+ }
29
+ export declare type DispatchPropsOfCell = DispatchPropsOfControl;
30
+ /**
31
+ * Props of a cell.
32
+ */
33
+ export interface CellProps extends StatePropsOfCell, DispatchPropsOfCell {
34
+ }
35
+ /**
36
+ * Registers the given cell renderer when a JSON Forms store is created.
37
+ * @param {RankedTester} tester
38
+ * @param cell the cell to be registered
39
+ * @returns {any}
40
+ */
41
+ export interface DispatchCellStateProps extends StatePropsOfCell {
42
+ cells?: JsonFormsCellRendererRegistryEntry[];
43
+ }
44
+ /**
45
+ * Map state to cell props.
46
+ *
47
+ * @param state JSONForms state tree
48
+ * @param ownProps any own props
49
+ * @returns {StatePropsOfCell} state props of a cell
50
+ */
51
+ export declare const mapStateToCellProps: (state: JsonFormsState, ownProps: OwnPropsOfCell) => StatePropsOfCell;
52
+ export declare const mapStateToDispatchCellProps: (state: JsonFormsState, ownProps: OwnPropsOfCell) => DispatchCellStateProps;
53
+ export interface DispatchCellProps extends DispatchCellStateProps {
54
+ }
55
+ /**
56
+ * Default mapStateToCellProps for enum cell. Options is used for populating dropdown list
57
+ * @param state
58
+ * @param ownProps
59
+ * @returns {StatePropsOfEnumCell}
60
+ */
61
+ export declare const defaultMapStateToEnumCellProps: (state: JsonFormsState, ownProps: OwnPropsOfEnumCell) => StatePropsOfEnumCell;
62
+ /**
63
+ * mapStateToOneOfEnumCellProps for one of enum cell. Options is used for populating dropdown list from oneOf
64
+ * @param state
65
+ * @param ownProps
66
+ * @returns {StatePropsOfEnumCell}
67
+ */
68
+ export declare const mapStateToOneOfEnumCellProps: (state: JsonFormsState, ownProps: OwnPropsOfEnumCell) => StatePropsOfEnumCell;
69
+ /**
70
+ * Synonym for mapDispatchToControlProps.
71
+ *
72
+ * @type {(dispatch) => {handleChange(path, value): void}}
73
+ */
74
+ export declare const mapDispatchToCellProps: (dispatch: Dispatch<AnyAction>) => DispatchPropsOfControl;
75
+ /**
76
+ * Default dispatch to control props which can be customized to set handleChange action
77
+ *
78
+ */
79
+ export declare const defaultMapDispatchToControlProps: (dispatch: Dispatch<AnyAction>, ownProps: any) => DispatchPropsOfControl;
@@ -1,10 +1,10 @@
1
- import { 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 declare type CombinatorKeyword = 'anyOf' | 'oneOf' | 'allOf';
9
- export declare const resolveSubSchemas: (schema: JsonSchema, rootSchema: JsonSchema, keyword: CombinatorKeyword) => JsonSchema;
10
- export declare const createCombinatorRenderInfos: (combinatorSubSchemas: JsonSchema[], rootSchema: JsonSchema, keyword: CombinatorKeyword, control: ControlElement, path: string, uischemas: JsonFormsUISchemaRegistryEntry[]) => CombinatorSubSchemaRenderInfo[];
1
+ import { 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 declare type CombinatorKeyword = 'anyOf' | 'oneOf' | 'allOf';
9
+ export declare const resolveSubSchemas: (schema: JsonSchema, rootSchema: JsonSchema, keyword: CombinatorKeyword) => JsonSchema;
10
+ export declare const createCombinatorRenderInfos: (combinatorSubSchemas: JsonSchema[], rootSchema: JsonSchema, keyword: CombinatorKeyword, control: ControlElement, path: string, uischemas: JsonFormsUISchemaRegistryEntry[]) => CombinatorSubSchemaRenderInfo[];
package/lib/util/ids.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare const createId: (proposedId: string) => string;
2
- export declare const removeId: (id: string) => boolean;
3
- export declare const clearAllIds: () => void;
1
+ export declare const createId: (proposedId: string) => string;
2
+ export declare const removeId: (id: string) => boolean;
3
+ export declare const clearAllIds: () => void;