@jsonforms/core 3.1.0-alpha.0 → 3.1.0-alpha.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 (194) hide show
  1. package/lib/Helpers.d.ts +1 -1
  2. package/lib/actions/actions.d.ts +6 -5
  3. package/lib/generators/Generate.d.ts +1 -1
  4. package/lib/generators/schema.d.ts +1 -1
  5. package/lib/i18n/i18nTypes.d.ts +3 -2
  6. package/lib/i18n/i18nUtil.d.ts +2 -2
  7. package/lib/jsonforms-core.cjs.js +3 -3
  8. package/lib/jsonforms-core.cjs.js.map +1 -1
  9. package/lib/jsonforms-core.esm.js +2 -2
  10. package/lib/jsonforms-core.esm.js.map +1 -1
  11. package/lib/models/jsonSchema.d.ts +2 -2
  12. package/lib/models/uischema.d.ts +1 -1
  13. package/lib/reducers/cells.d.ts +2 -2
  14. package/lib/reducers/config.d.ts +1 -1
  15. package/lib/reducers/core.d.ts +3 -2
  16. package/lib/reducers/default-data.d.ts +1 -1
  17. package/lib/reducers/i18n.d.ts +1 -1
  18. package/lib/reducers/reducers.d.ts +4 -4
  19. package/lib/reducers/renderers.d.ts +2 -2
  20. package/lib/reducers/selectors.d.ts +6 -6
  21. package/lib/reducers/uischemas.d.ts +2 -2
  22. package/lib/store.d.ts +3 -3
  23. package/lib/testers/testers.d.ts +1 -1
  24. package/lib/util/cell.d.ts +3 -3
  25. package/lib/util/combinators.d.ts +1 -1
  26. package/lib/util/label.d.ts +1 -1
  27. package/lib/util/path.d.ts +6 -3
  28. package/lib/util/renderer.d.ts +5 -5
  29. package/lib/util/resolvers.d.ts +1 -1
  30. package/lib/util/runtime.d.ts +2 -2
  31. package/lib/util/util.d.ts +2 -2
  32. package/lib/util/validator.d.ts +1 -1
  33. package/package.json +7 -3
  34. package/src/Helpers.ts +1 -1
  35. package/src/actions/actions.ts +6 -5
  36. package/src/generators/Generate.ts +1 -1
  37. package/src/generators/schema.ts +1 -1
  38. package/src/i18n/i18nTypes.ts +3 -2
  39. package/src/i18n/i18nUtil.ts +2 -2
  40. package/src/models/jsonSchema.ts +2 -2
  41. package/src/models/uischema.ts +1 -1
  42. package/src/reducers/cells.ts +2 -2
  43. package/src/reducers/config.ts +1 -1
  44. package/src/reducers/core.ts +4 -3
  45. package/src/reducers/default-data.ts +1 -1
  46. package/src/reducers/i18n.ts +1 -1
  47. package/src/reducers/reducers.ts +4 -4
  48. package/src/reducers/renderers.ts +2 -2
  49. package/src/reducers/selectors.ts +6 -6
  50. package/src/reducers/uischemas.ts +2 -2
  51. package/src/store.ts +3 -3
  52. package/src/testers/testers.ts +2 -2
  53. package/src/util/cell.ts +3 -3
  54. package/src/util/combinators.ts +1 -1
  55. package/src/util/label.ts +1 -1
  56. package/src/util/path.ts +6 -3
  57. package/src/util/renderer.ts +5 -5
  58. package/src/util/resolvers.ts +2 -2
  59. package/src/util/runtime.ts +2 -2
  60. package/src/util/util.ts +2 -2
  61. package/src/util/validator.ts +1 -1
  62. package/.nycrc +0 -6
  63. package/docs/assets/css/main.css +0 -1
  64. package/docs/assets/images/icons.png +0 -0
  65. package/docs/assets/images/icons@2x.png +0 -0
  66. package/docs/assets/images/widgets.png +0 -0
  67. package/docs/assets/images/widgets@2x.png +0 -0
  68. package/docs/assets/js/main.js +0 -51
  69. package/docs/assets/js/search.json +0 -1
  70. package/docs/classes/gen.html +0 -406
  71. package/docs/enums/ruleeffect.html +0 -214
  72. package/docs/globals.html +0 -10568
  73. package/docs/index.html +0 -1297
  74. package/docs/interfaces/action.html +0 -166
  75. package/docs/interfaces/addcellrendereraction.html +0 -181
  76. package/docs/interfaces/addrendereraction.html +0 -181
  77. package/docs/interfaces/adduischemaaction.html +0 -181
  78. package/docs/interfaces/andcondition.html +0 -181
  79. package/docs/interfaces/anyaction.html +0 -189
  80. package/docs/interfaces/arraycontrolprops.html +0 -653
  81. package/docs/interfaces/arraylayoutprops.html +0 -648
  82. package/docs/interfaces/categorization.html +0 -281
  83. package/docs/interfaces/category.html +0 -279
  84. package/docs/interfaces/cellprops.html +0 -452
  85. package/docs/interfaces/combinatorrendererprops.html +0 -503
  86. package/docs/interfaces/combinatorsubschemarenderinfo.html +0 -181
  87. package/docs/interfaces/composablecondition.html +0 -193
  88. package/docs/interfaces/condition.html +0 -176
  89. package/docs/interfaces/controlelement.html +0 -280
  90. package/docs/interfaces/controlprops.html +0 -497
  91. package/docs/interfaces/controlstate.html +0 -184
  92. package/docs/interfaces/controlwithdetailprops.html +0 -501
  93. package/docs/interfaces/dispatchcellprops.html +0 -388
  94. package/docs/interfaces/dispatchcellstateprops.html +0 -408
  95. package/docs/interfaces/dispatchpropsofarraycontrol.html +0 -322
  96. package/docs/interfaces/dispatchpropsofcontrol.html +0 -204
  97. package/docs/interfaces/dispatchpropsofmultienumcontrol.html +0 -215
  98. package/docs/interfaces/enumcellprops.html +0 -467
  99. package/docs/interfaces/enumoption.html +0 -167
  100. package/docs/interfaces/formatted.html +0 -226
  101. package/docs/interfaces/grouplayout.html +0 -284
  102. package/docs/interfaces/horizontallayout.html +0 -234
  103. package/docs/interfaces/initaction.html +0 -209
  104. package/docs/interfaces/initactionoptions.html +0 -181
  105. package/docs/interfaces/internationalizable.html +0 -170
  106. package/docs/interfaces/jsonformscellrendererregistryentry.html +0 -167
  107. package/docs/interfaces/jsonformscore.html +0 -251
  108. package/docs/interfaces/jsonformsdefaultdataregistryentry.html +0 -167
  109. package/docs/interfaces/jsonformsextendedstate.html +0 -175
  110. package/docs/interfaces/jsonformsi18nstate.html +0 -181
  111. package/docs/interfaces/jsonformsprops.html +0 -321
  112. package/docs/interfaces/jsonformsrendererregistryentry.html +0 -167
  113. package/docs/interfaces/jsonformsstate.html +0 -170
  114. package/docs/interfaces/jsonformsstore.html +0 -376
  115. package/docs/interfaces/jsonformssubstates.html +0 -276
  116. package/docs/interfaces/jsonformsuischemaregistryentry.html +0 -167
  117. package/docs/interfaces/jsonschema4.html +0 -758
  118. package/docs/interfaces/jsonschema7.html +0 -884
  119. package/docs/interfaces/labelable.html +0 -184
  120. package/docs/interfaces/labeldescription.html +0 -184
  121. package/docs/interfaces/labeled.html +0 -182
  122. package/docs/interfaces/labelelement.html +0 -251
  123. package/docs/interfaces/labelprops.html +0 -339
  124. package/docs/interfaces/layout.html +0 -253
  125. package/docs/interfaces/layoutprops.html +0 -359
  126. package/docs/interfaces/leafcondition.html +0 -209
  127. package/docs/interfaces/orcondition.html +0 -181
  128. package/docs/interfaces/ownpropsofcell.html +0 -321
  129. package/docs/interfaces/ownpropsofcontrol.html +0 -305
  130. package/docs/interfaces/ownpropsofenum.html +0 -161
  131. package/docs/interfaces/ownpropsofenumcell.html +0 -335
  132. package/docs/interfaces/ownpropsofjsonformsrenderer.html +0 -296
  133. package/docs/interfaces/ownpropsoflabel.html +0 -286
  134. package/docs/interfaces/ownpropsoflayout.html +0 -305
  135. package/docs/interfaces/ownpropsofmasterlistitem.html +0 -289
  136. package/docs/interfaces/ownpropsofrenderer.html +0 -292
  137. package/docs/interfaces/referenceschemamap.html +0 -138
  138. package/docs/interfaces/registerdefaultdataaction.html +0 -181
  139. package/docs/interfaces/removecellrendereraction.html +0 -181
  140. package/docs/interfaces/removerendereraction.html +0 -181
  141. package/docs/interfaces/removeuischemaaction.html +0 -167
  142. package/docs/interfaces/rendererprops.html +0 -331
  143. package/docs/interfaces/rule.html +0 -185
  144. package/docs/interfaces/schemabasedcondition.html +0 -202
  145. package/docs/interfaces/scopable.html +0 -171
  146. package/docs/interfaces/scoped.html +0 -183
  147. package/docs/interfaces/setajvaction.html +0 -167
  148. package/docs/interfaces/setconfigaction.html +0 -167
  149. package/docs/interfaces/setlocaleaction.html +0 -167
  150. package/docs/interfaces/setschemaaction.html +0 -167
  151. package/docs/interfaces/settranslatoraction.html +0 -181
  152. package/docs/interfaces/setuischemaaction.html +0 -167
  153. package/docs/interfaces/setvalidationmodeaction.html +0 -167
  154. package/docs/interfaces/statepropsofarraycontrol.html +0 -474
  155. package/docs/interfaces/statepropsofarraylayout.html +0 -461
  156. package/docs/interfaces/statepropsofcell.html +0 -408
  157. package/docs/interfaces/statepropsofcombinator.html +0 -449
  158. package/docs/interfaces/statepropsofcontrol.html +0 -451
  159. package/docs/interfaces/statepropsofcontrolwithdetail.html +0 -463
  160. package/docs/interfaces/statepropsofenumcell.html +0 -422
  161. package/docs/interfaces/statepropsofjsonformsrenderer.html +0 -324
  162. package/docs/interfaces/statepropsoflabel.html +0 -343
  163. package/docs/interfaces/statepropsoflayout.html +0 -369
  164. package/docs/interfaces/statepropsofmasteritem.html +0 -309
  165. package/docs/interfaces/statepropsofrenderer.html +0 -331
  166. package/docs/interfaces/statepropsofscopedrenderer.html +0 -391
  167. package/docs/interfaces/store.html +0 -386
  168. package/docs/interfaces/testercontext.html +0 -184
  169. package/docs/interfaces/uischemaelement.html +0 -225
  170. package/docs/interfaces/unregisterdefaultdataaction.html +0 -167
  171. package/docs/interfaces/updateaction.html +0 -202
  172. package/docs/interfaces/updatecoreaction.html +0 -209
  173. package/docs/interfaces/updateerrorsaction.html +0 -167
  174. package/docs/interfaces/updatei18naction.html +0 -195
  175. package/docs/interfaces/verticallayout.html +0 -234
  176. package/docs/interfaces/withclassname.html +0 -153
  177. package/rollup.config.js +0 -44
  178. package/stats.html +0 -3279
  179. package/test/actions/actions.test.ts +0 -93
  180. package/test/generators/schema.test.ts +0 -224
  181. package/test/generators/uischema.test.ts +0 -576
  182. package/test/i18n/i18nUtil.test.ts +0 -88
  183. package/test/reducers/core.test.ts +0 -1682
  184. package/test/reducers/uischemas.test.ts +0 -173
  185. package/test/testers.test.ts +0 -948
  186. package/test/util/array.test.ts +0 -28
  187. package/test/util/cell.test.ts +0 -354
  188. package/test/util/derivetype.test.ts +0 -101
  189. package/test/util/label.test.ts +0 -364
  190. package/test/util/path.test.ts +0 -259
  191. package/test/util/renderer.test.ts +0 -1830
  192. package/test/util/resolvers.test.ts +0 -157
  193. package/test/util/runtime.test.ts +0 -779
  194. package/tsconfig.json +0 -13
@@ -1,3 +1,3 @@
1
- import { JsonSchema4 } from './jsonSchema4';
2
- import { JsonSchema7 } from './jsonSchema7';
1
+ import type { JsonSchema4 } from './jsonSchema4';
2
+ import type { JsonSchema7 } from './jsonSchema7';
3
3
  export declare type JsonSchema = JsonSchema4 | JsonSchema7;
@@ -1,4 +1,4 @@
1
- import { JsonSchema } from './jsonSchema';
1
+ import type { JsonSchema } from './jsonSchema';
2
2
  /**
3
3
  * Interface for describing an UI schema element that is referencing
4
4
  * a subschema. The value of the scope may be a JSON Pointer.
@@ -1,6 +1,6 @@
1
- import { RankedTester } from '../testers';
1
+ import type { RankedTester } from '../testers';
2
2
  import { AddCellRendererAction, RemoveCellRendererAction } from '../actions';
3
- import { Reducer } from '../util';
3
+ import type { Reducer } from '../util';
4
4
  declare type ValidCellReducerActions = AddCellRendererAction | RemoveCellRendererAction;
5
5
  export declare type JsonFormsCellRendererRegistryState = JsonFormsCellRendererRegistryEntry[];
6
6
  export interface JsonFormsCellRendererRegistryEntry {
@@ -1,3 +1,3 @@
1
1
  import { SetConfigAction } from '../actions';
2
- import { Reducer } from '../util';
2
+ import type { Reducer } from '../util';
3
3
  export declare const configReducer: Reducer<any, SetConfigAction>;
@@ -1,7 +1,8 @@
1
- import Ajv, { ErrorObject, ValidateFunction } from 'ajv';
1
+ import type Ajv from 'ajv';
2
+ import type { ErrorObject, ValidateFunction } from 'ajv';
2
3
  import { CoreActions } from '../actions';
3
4
  import { Reducer } from '../util';
4
- import { JsonSchema, UISchemaElement } from '../models';
5
+ import type { JsonSchema, UISchemaElement } from '../models';
5
6
  export declare const validate: (validator: ValidateFunction | undefined, data: any) => ErrorObject[];
6
7
  export declare type ValidationMode = 'ValidateAndShow' | 'ValidateAndHide' | 'NoValidation';
7
8
  export interface JsonFormsCore {
@@ -1,5 +1,5 @@
1
1
  import { RegisterDefaultDataAction, UnregisterDefaultDataAction } from '../actions';
2
- import { Reducer } from '../util';
2
+ import type { Reducer } from '../util';
3
3
  export interface JsonFormsDefaultDataRegistryEntry {
4
4
  schemaPath: string;
5
5
  data: any;
@@ -1,6 +1,6 @@
1
1
  import { JsonFormsI18nState } from '../i18n';
2
2
  import { I18nActions } from '../actions';
3
- import { Reducer } from '../util';
3
+ import type { Reducer } from '../util';
4
4
  export declare const defaultJsonFormsI18nState: Required<JsonFormsI18nState>;
5
5
  export declare const i18nReducer: Reducer<JsonFormsI18nState, I18nActions>;
6
6
  export declare const fetchLocale: (state?: JsonFormsI18nState) => string;
@@ -1,8 +1,8 @@
1
- import { ControlElement, UISchemaElement } from '../models';
2
- import { JsonFormsState } from '../store';
1
+ import type { ControlElement, UISchemaElement } from '../models';
2
+ import type { JsonFormsState } from '../store';
3
3
  import type { JsonFormsUISchemaRegistryEntry } from './uischemas';
4
- import { JsonSchema } from '../models/jsonSchema';
5
- import { ErrorTranslator, Translator } from '../i18n';
4
+ import type { JsonSchema } from '../models/jsonSchema';
5
+ import type { ErrorTranslator, Translator } from '../i18n';
6
6
  export declare const jsonFormsReducerConfig: {
7
7
  core: import("..").Reducer<import("./core").JsonFormsCore, import("..").CoreActions>;
8
8
  renderers: import("..").Reducer<import("./renderers").JsonFormsRendererRegistryEntry[], import("..").AddRendererAction | import("..").RemoveRendererAction>;
@@ -1,6 +1,6 @@
1
- import { RankedTester } from '../testers';
1
+ import type { RankedTester } from '../testers';
2
2
  import { AddRendererAction, RemoveRendererAction } from '../actions';
3
- import { Reducer } from '../util';
3
+ import type { Reducer } from '../util';
4
4
  export interface JsonFormsRendererRegistryEntry {
5
5
  tester: RankedTester;
6
6
  renderer: any;
@@ -1,10 +1,10 @@
1
- import Ajv from 'ajv';
2
- import { JsonFormsState } from '../store';
3
- import { JsonSchema, UISchemaElement } from '../models';
1
+ import type Ajv from 'ajv';
2
+ import type { JsonFormsState } from '../store';
3
+ import type { JsonSchema, UISchemaElement } from '../models';
4
4
  import { JsonFormsDefaultDataRegistryEntry } from './default-data';
5
- import { JsonFormsRendererRegistryEntry } from './renderers';
6
- import { JsonFormsCellRendererRegistryEntry } from './cells';
7
- import { JsonFormsUISchemaRegistryEntry } from './uischemas';
5
+ import type { JsonFormsRendererRegistryEntry } from './renderers';
6
+ import type { JsonFormsCellRendererRegistryEntry } from './cells';
7
+ import type { JsonFormsUISchemaRegistryEntry } from './uischemas';
8
8
  export declare const getData: (state: JsonFormsState) => any;
9
9
  export declare const getSchema: (state: JsonFormsState) => JsonSchema;
10
10
  export declare const getUiSchema: (state: JsonFormsState) => UISchemaElement;
@@ -1,6 +1,6 @@
1
1
  import { UISchemaActions } from '../actions';
2
- import { JsonSchema, UISchemaElement } from '../models';
3
- import { Reducer } from '../util';
2
+ import type { JsonSchema, UISchemaElement } from '../models';
3
+ import type { Reducer } from '../util';
4
4
  export declare type UISchemaTester = (schema: JsonSchema, schemaPath: string, path: string) => number;
5
5
  export interface JsonFormsUISchemaRegistryEntry {
6
6
  tester: UISchemaTester;
package/lib/store.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Store } from './util';
2
- import { JsonFormsCore, JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry, JsonFormsUISchemaRegistryEntry } from './reducers';
3
- import { JsonFormsI18nState } from './i18n';
1
+ import type { Store } from './util';
2
+ import type { JsonFormsCore, JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry, JsonFormsUISchemaRegistryEntry } from './reducers';
3
+ import type { JsonFormsI18nState } from './i18n';
4
4
  /**
5
5
  * JSONForms store.
6
6
  */
@@ -1,4 +1,4 @@
1
- import { Categorization, ControlElement, JsonSchema, UISchemaElement } from '../models';
1
+ import type { Categorization, ControlElement, JsonSchema, UISchemaElement } from '../models';
2
2
  /**
3
3
  * Constant that indicates that a tester is not capable of handling
4
4
  * a combination of schema/data.
@@ -1,8 +1,8 @@
1
1
  import type { JsonFormsCellRendererRegistryEntry } from '../reducers';
2
- import { AnyAction, Dispatch } from './type';
2
+ import type { AnyAction, Dispatch } from './type';
3
3
  import { DispatchPropsOfControl, OwnPropsOfControl, OwnPropsOfEnum, StatePropsOfScopedRenderer } from './renderer';
4
- import { JsonFormsState } from '../store';
5
- import { JsonSchema } from '../models';
4
+ import type { JsonFormsState } from '../store';
5
+ import type { JsonSchema } from '../models';
6
6
  export type { JsonFormsCellRendererRegistryEntry };
7
7
  export interface OwnPropsOfCell extends OwnPropsOfControl {
8
8
  data?: any;
@@ -1,4 +1,4 @@
1
- import { ControlElement, JsonSchema, UISchemaElement } from '../models';
1
+ import type { ControlElement, JsonSchema, UISchemaElement } from '../models';
2
2
  import { JsonFormsUISchemaRegistryEntry } from '../reducers';
3
3
  export interface CombinatorSubSchemaRenderInfo {
4
4
  schema: JsonSchema;
@@ -1,4 +1,4 @@
1
- import { ControlElement, JsonSchema, LabelDescription } from '../models';
1
+ import type { ControlElement, JsonSchema, LabelDescription } from '../models';
2
2
  export declare const createCleanLabel: (label: string) => string;
3
3
  /**
4
4
  * Return a label object based on the given control and schema element.
@@ -14,12 +14,15 @@ export { compose as composePaths };
14
14
  */
15
15
  export declare const toDataPathSegments: (schemaPath: string) => string[];
16
16
  /**
17
- * Remove all schema-specific keywords (e.g. 'properties') from a given path.
17
+ * Convert a schema path (i.e. JSON pointer) to a data path.
18
+ *
19
+ * Data paths can be used in field change event handlers like handleChange.
20
+ *
18
21
  * @example
19
- * toDataPath('#/properties/foo/properties/bar') === '#/foo/bar')
22
+ * toDataPath('#/properties/foo/properties/bar') === 'foo.bar')
20
23
  *
21
24
  * @param {string} schemaPath the schema path to be converted
22
- * @returns {string} the path without schema-specific keywords
25
+ * @returns {string} the data path
23
26
  */
24
27
  export declare const toDataPath: (schemaPath: string) => string;
25
28
  export declare const composeWithUi: (scopableUi: Scopable, path: string) => string;
@@ -1,12 +1,12 @@
1
1
  import { ControlElement, JsonSchema, LabelElement, UISchemaElement } from '../models';
2
2
  import { JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry } from '../reducers';
3
3
  import { JsonFormsUISchemaRegistryEntry } from '../reducers';
4
- import { RankedTester } from '../testers';
5
- import { CombinatorKeyword } from './combinators';
6
- import { AnyAction, Dispatch } from './type';
4
+ import type { RankedTester } from '../testers';
5
+ import type { CombinatorKeyword } from './combinators';
6
+ import type { AnyAction, Dispatch } from './type';
7
7
  import { CoreActions } from '../actions';
8
- import { ErrorObject } from 'ajv';
9
- import { JsonFormsState } from '../store';
8
+ import type { ErrorObject } from 'ajv';
9
+ import type { JsonFormsState } from '../store';
10
10
  import { Translator } from '../i18n';
11
11
  /**
12
12
  * Adds an asterisk to the given label string based
@@ -1,4 +1,4 @@
1
- import { JsonSchema } from '../models';
1
+ import type { JsonSchema } from '../models';
2
2
  /**
3
3
  * Map for storing refs and the respective schemas they are pointing to.
4
4
  */
@@ -1,6 +1,6 @@
1
1
  import { JsonSchema, UISchemaElement } from '../models';
2
- import Ajv from 'ajv';
3
- import { JsonFormsState } from '../store';
2
+ import type Ajv from 'ajv';
3
+ import type { JsonFormsState } from '../store';
4
4
  export declare const evalVisibility: (uischema: UISchemaElement, data: any, path: string, ajv: Ajv) => boolean;
5
5
  export declare const evalEnablement: (uischema: UISchemaElement, data: any, path: string, ajv: Ajv) => boolean;
6
6
  export declare const hasShowRule: (uischema: UISchemaElement) => boolean;
@@ -1,5 +1,5 @@
1
- import { JsonSchema, Scoped, UISchemaElement } from '..';
2
- import Ajv from 'ajv';
1
+ import type { JsonSchema, Scoped, UISchemaElement } from '..';
2
+ import type Ajv from 'ajv';
3
3
  /**
4
4
  * Escape the given string such that it can be used as a class name,
5
5
  * i.e. hashes and slashes will be replaced.
@@ -1,3 +1,3 @@
1
1
  import Ajv from 'ajv';
2
- import { Options } from 'ajv';
2
+ import type { Options } from 'ajv';
3
3
  export declare const createAjv: (options?: Options) => Ajv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonforms/core",
3
- "version": "3.1.0-alpha.0",
3
+ "version": "3.1.0-alpha.1",
4
4
  "description": "Core module of JSON Forms",
5
5
  "repository": "https://github.com/eclipsesource/jsonforms",
6
6
  "bugs": "https://github.com/eclipsesource/jsonforms/issues",
@@ -13,6 +13,10 @@
13
13
  "src": "src",
14
14
  "test": "test"
15
15
  },
16
+ "files": [
17
+ "lib",
18
+ "src"
19
+ ],
16
20
  "keywords": [
17
21
  "form",
18
22
  "forms",
@@ -78,7 +82,7 @@
78
82
  "redux": "^4.0.4",
79
83
  "redux-mock-store": "1.5.3",
80
84
  "rimraf": "^3.0.2",
81
- "rollup": "^2.7.3",
85
+ "rollup": "^2.78.0",
82
86
  "rollup-plugin-cleanup": "^3.2.1",
83
87
  "rollup-plugin-typescript2": "^0.31.1",
84
88
  "rollup-plugin-visualizer": "^5.4.1",
@@ -88,5 +92,5 @@
88
92
  "typedoc": "^0.19.2",
89
93
  "typescript": "4.2.3"
90
94
  },
91
- "gitHead": "91f351daa7b7ae4bb0f0dffd47f00bb6cf682ec1"
95
+ "gitHead": "386174994eabc41758450b8d551e1c859498a468"
92
96
  }
package/src/Helpers.ts CHANGED
@@ -24,7 +24,7 @@
24
24
  */
25
25
 
26
26
  import { convertToValidClassName, createLabelDescriptionFrom } from './util';
27
- import { ControlElement, JsonSchema, LabelDescription } from './models';
27
+ import type { ControlElement, JsonSchema, LabelDescription } from './models';
28
28
 
29
29
  export const Helpers: {
30
30
  createLabelDescriptionFrom(
@@ -23,13 +23,14 @@
23
23
  THE SOFTWARE.
24
24
  */
25
25
 
26
- import AJV, { ErrorObject } from 'ajv';
27
- import { JsonSchema, UISchemaElement } from '../models';
26
+ import type AJV from 'ajv';
27
+ import type { ErrorObject } from 'ajv';
28
+ import type { JsonSchema, UISchemaElement } from '../models';
28
29
  import { generateDefaultUISchema, generateJsonSchema } from '../generators';
29
30
 
30
- import { RankedTester } from '../testers';
31
- import { UISchemaTester, ValidationMode } from '../reducers';
32
- import { ErrorTranslator, Translator } from '../i18n';
31
+ import type { RankedTester } from '../testers';
32
+ import type { UISchemaTester, ValidationMode } from '../reducers';
33
+ import type { ErrorTranslator, Translator } from '../i18n';
33
34
 
34
35
  export const INIT: 'jsonforms/INIT' = 'jsonforms/INIT';
35
36
  export const UPDATE_CORE: 'jsonforms/UPDATE_CORE' = `jsonforms/UPDATE_CORE`;
@@ -25,7 +25,7 @@
25
25
 
26
26
  import { generateJsonSchema } from './schema';
27
27
  import { createControlElement, generateDefaultUISchema } from './uischema';
28
- import { ControlElement, JsonSchema, UISchemaElement } from '../';
28
+ import type { ControlElement, JsonSchema, UISchemaElement } from '../';
29
29
 
30
30
  export const Generate: {
31
31
  jsonSchema(instance: Object, options?: any): JsonSchema;
@@ -23,7 +23,7 @@
23
23
  THE SOFTWARE.
24
24
  */
25
25
 
26
- import { JsonSchema4 } from '../models';
26
+ import type { JsonSchema4 } from '../models';
27
27
 
28
28
  const ADDITIONAL_PROPERTIES = 'additionalProperties';
29
29
  const REQUIRED_PROPERTIES = 'required';
@@ -1,9 +1,10 @@
1
- import { ErrorObject } from 'ajv';
2
- import { JsonSchema, UISchemaElement } from '../models';
1
+ import type { ErrorObject } from 'ajv';
2
+ import type { JsonSchema, UISchemaElement } from '../models';
3
3
 
4
4
  export type Translator = {
5
5
  (id: string, defaultMessage: string, values?: any): string;
6
6
  (id: string, defaultMessage: undefined, values?: any): string | undefined;
7
+ (id: string, defaultMessage?: string, values?: any): string | undefined;
7
8
  }
8
9
 
9
10
  export type ErrorTranslator = (error: ErrorObject, translate: Translator, uischema?: UISchemaElement) => string;
@@ -1,8 +1,8 @@
1
- import { ErrorObject } from 'ajv';
1
+ import type { ErrorObject } from 'ajv';
2
2
  import { isInternationalized, Labelable, UISchemaElement } from '../models';
3
3
  import { getControlPath } from '../reducers';
4
4
  import { formatErrorMessage } from '../util';
5
- import { i18nJsonSchema, ErrorTranslator, Translator } from './i18nTypes';
5
+ import type { i18nJsonSchema, ErrorTranslator, Translator } from './i18nTypes';
6
6
 
7
7
  export const getI18nKeyPrefixBySchema = (
8
8
  schema: i18nJsonSchema | undefined,
@@ -23,7 +23,7 @@
23
23
  THE SOFTWARE.
24
24
  */
25
25
 
26
- import { JsonSchema4 } from './jsonSchema4';
27
- import { JsonSchema7 } from './jsonSchema7';
26
+ import type { JsonSchema4 } from './jsonSchema4';
27
+ import type { JsonSchema7 } from './jsonSchema7';
28
28
 
29
29
  export type JsonSchema = JsonSchema4 | JsonSchema7;
@@ -23,7 +23,7 @@
23
23
  THE SOFTWARE.
24
24
  */
25
25
 
26
- import { JsonSchema } from './jsonSchema';
26
+ import type { JsonSchema } from './jsonSchema';
27
27
 
28
28
  /**
29
29
  * Interface for describing an UI schema element that is referencing
@@ -23,14 +23,14 @@
23
23
  THE SOFTWARE.
24
24
  */
25
25
 
26
- import { RankedTester } from '../testers';
26
+ import type { RankedTester } from '../testers';
27
27
  import {
28
28
  ADD_CELL,
29
29
  AddCellRendererAction,
30
30
  REMOVE_CELL,
31
31
  RemoveCellRendererAction
32
32
  } from '../actions';
33
- import { Reducer } from '../util';
33
+ import type { Reducer } from '../util';
34
34
 
35
35
  type ValidCellReducerActions = AddCellRendererAction | RemoveCellRendererAction;
36
36
 
@@ -26,7 +26,7 @@
26
26
  import merge from 'lodash/merge';
27
27
  import { SET_CONFIG, SetConfigAction } from '../actions';
28
28
  import { configDefault } from '../configDefault';
29
- import { Reducer } from '../util';
29
+ import type { Reducer } from '../util';
30
30
 
31
31
  const applyDefaultConfiguration = (config: any = {}) =>
32
32
  merge({}, configDefault, config);
@@ -29,7 +29,8 @@ import get from 'lodash/get';
29
29
  import filter from 'lodash/filter';
30
30
  import isEqual from 'lodash/isEqual';
31
31
  import isFunction from 'lodash/isFunction';
32
- import Ajv, { ErrorObject, ValidateFunction } from 'ajv';
32
+ import type Ajv from 'ajv';
33
+ import type { ErrorObject, ValidateFunction } from 'ajv';
33
34
  import {
34
35
  CoreActions,
35
36
  INIT,
@@ -45,7 +46,7 @@ import {
45
46
  UpdateCoreAction
46
47
  } from '../actions';
47
48
  import { createAjv, Reducer } from '../util';
48
- import { JsonSchema, UISchemaElement } from '../models';
49
+ import type { JsonSchema, UISchemaElement } from '../models';
49
50
 
50
51
  export const validate = (validator: ValidateFunction | undefined, data: any): ErrorObject[] => {
51
52
  if (validator === undefined) {
@@ -424,4 +425,4 @@ const getErrorsAt = (
424
425
  export const errorAt = (instancePath: string, schema: JsonSchema) =>
425
426
  getErrorsAt(instancePath, schema, path => path === instancePath);
426
427
  export const subErrorsAt = (instancePath: string, schema: JsonSchema) =>
427
- getErrorsAt(instancePath, schema, path => path.startsWith(instancePath));
428
+ getErrorsAt(instancePath, schema, path => path.startsWith(instancePath + '.'));
@@ -29,7 +29,7 @@ import {
29
29
  REMOVE_DEFAULT_DATA,
30
30
  UnregisterDefaultDataAction
31
31
  } from '../actions';
32
- import { Reducer } from '../util';
32
+ import type { Reducer } from '../util';
33
33
 
34
34
  export interface JsonFormsDefaultDataRegistryEntry {
35
35
  schemaPath: string;
@@ -25,7 +25,7 @@
25
25
 
26
26
  import { defaultErrorTranslator, defaultTranslator, JsonFormsI18nState } from '../i18n';
27
27
  import { I18nActions, SET_LOCALE, SET_TRANSLATOR, UPDATE_I18N } from '../actions';
28
- import { Reducer } from '../util';
28
+ import type { Reducer } from '../util';
29
29
 
30
30
  export const defaultJsonFormsI18nState: Required<JsonFormsI18nState> = {
31
31
  locale: 'en',
@@ -23,7 +23,7 @@
23
23
  THE SOFTWARE.
24
24
  */
25
25
 
26
- import { ControlElement, UISchemaElement } from '../models';
26
+ import type { ControlElement, UISchemaElement } from '../models';
27
27
  import {
28
28
  coreReducer,
29
29
  errorAt,
@@ -31,7 +31,7 @@ import {
31
31
  } from './core';
32
32
  import { defaultDataReducer } from './default-data';
33
33
  import { rendererReducer } from './renderers';
34
- import { JsonFormsState } from '../store';
34
+ import type { JsonFormsState } from '../store';
35
35
  import type { JsonFormsUISchemaRegistryEntry } from './uischemas';
36
36
  import {
37
37
  findMatchingUISchema,
@@ -44,13 +44,13 @@ import {
44
44
  } from './i18n';
45
45
 
46
46
  import { Generate } from '../generators';
47
- import { JsonSchema } from '../models/jsonSchema';
47
+ import type { JsonSchema } from '../models/jsonSchema';
48
48
 
49
49
  import { cellReducer } from './cells';
50
50
  import { configReducer } from './config';
51
51
  import get from 'lodash/get';
52
52
  import { fetchTranslator } from '.';
53
- import { ErrorTranslator, Translator } from '../i18n';
53
+ import type { ErrorTranslator, Translator } from '../i18n';
54
54
 
55
55
  export const jsonFormsReducerConfig = {
56
56
  core: coreReducer,
@@ -23,14 +23,14 @@
23
23
  THE SOFTWARE.
24
24
  */
25
25
 
26
- import { RankedTester } from '../testers';
26
+ import type { RankedTester } from '../testers';
27
27
  import {
28
28
  ADD_RENDERER,
29
29
  AddRendererAction,
30
30
  REMOVE_RENDERER,
31
31
  RemoveRendererAction
32
32
  } from '../actions';
33
- import { Reducer } from '../util';
33
+ import type { Reducer } from '../util';
34
34
 
35
35
  export interface JsonFormsRendererRegistryEntry {
36
36
  tester: RankedTester;
@@ -24,9 +24,9 @@
24
24
  */
25
25
 
26
26
  import get from 'lodash/get';
27
- import Ajv from 'ajv';
28
- import { JsonFormsState } from '../store';
29
- import { JsonSchema, UISchemaElement } from '../models';
27
+ import type Ajv from 'ajv';
28
+ import type { JsonFormsState } from '../store';
29
+ import type { JsonSchema, UISchemaElement } from '../models';
30
30
  import {
31
31
  extractAjv,
32
32
  extractData,
@@ -37,9 +37,9 @@ import {
37
37
  extractDefaultData,
38
38
  JsonFormsDefaultDataRegistryEntry
39
39
  } from './default-data';
40
- import { JsonFormsRendererRegistryEntry } from './renderers';
41
- import { JsonFormsCellRendererRegistryEntry } from './cells';
42
- import { JsonFormsUISchemaRegistryEntry } from './uischemas';
40
+ import type { JsonFormsRendererRegistryEntry } from './renderers';
41
+ import type { JsonFormsCellRendererRegistryEntry } from './cells';
42
+ import type { JsonFormsUISchemaRegistryEntry } from './uischemas';
43
43
 
44
44
  export const getData = (state: JsonFormsState) =>
45
45
  extractData(get(state, 'jsonforms.core'));
@@ -27,8 +27,8 @@ import maxBy from 'lodash/maxBy';
27
27
  import remove from 'lodash/remove';
28
28
  import { ADD_UI_SCHEMA, REMOVE_UI_SCHEMA, UISchemaActions } from '../actions';
29
29
  import { NOT_APPLICABLE } from '../testers';
30
- import { JsonSchema, UISchemaElement } from '../models';
31
- import { Reducer } from '../util';
30
+ import type { JsonSchema, UISchemaElement } from '../models';
31
+ import type { Reducer } from '../util';
32
32
 
33
33
  export type UISchemaTester = (
34
34
  schema: JsonSchema,
package/src/store.ts CHANGED
@@ -23,14 +23,14 @@
23
23
  THE SOFTWARE.
24
24
  */
25
25
 
26
- import { Store } from './util';
27
- import {
26
+ import type { Store } from './util';
27
+ import type {
28
28
  JsonFormsCore,
29
29
  JsonFormsCellRendererRegistryEntry,
30
30
  JsonFormsRendererRegistryEntry,
31
31
  JsonFormsUISchemaRegistryEntry
32
32
  } from './reducers';
33
- import { JsonFormsI18nState } from './i18n';
33
+ import type { JsonFormsI18nState } from './i18n';
34
34
 
35
35
  /**
36
36
  * JSONForms store.
@@ -31,7 +31,7 @@ import isArray from 'lodash/isArray';
31
31
  import reduce from 'lodash/reduce';
32
32
  import toPairs from 'lodash/toPairs';
33
33
  import includes from 'lodash/includes';
34
- import {
34
+ import type {
35
35
  Categorization,
36
36
  ControlElement,
37
37
  JsonSchema,
@@ -466,7 +466,7 @@ export const isObjectArrayWithNesting = (
466
466
  if (val.$ref !== undefined) {
467
467
  return false;
468
468
  }
469
- if (val.anyOf || val.oneOf) {
469
+ if (val.anyOf || val.oneOf || val.allOf) {
470
470
  return true;
471
471
  }
472
472
  if (hasType(val, 'object')) {
package/src/util/cell.ts CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  getSchema,
35
35
  getTranslator,
36
36
  } from '../reducers';
37
- import { AnyAction, Dispatch } from './type';
37
+ import type { AnyAction, Dispatch } from './type';
38
38
  import {
39
39
  formatErrorMessage,
40
40
  Resolve,
@@ -53,8 +53,8 @@ import {
53
53
  OwnPropsOfEnum,
54
54
  StatePropsOfScopedRenderer,
55
55
  } from './renderer';
56
- import { JsonFormsState } from '../store';
57
- import { JsonSchema } from '../models';
56
+ import type { JsonFormsState } from '../store';
57
+ import type { JsonSchema } from '../models';
58
58
  import { getI18nKeyPrefix } from '../i18n';
59
59
 
60
60
  export type { JsonFormsCellRendererRegistryEntry };
@@ -23,7 +23,7 @@
23
23
  THE SOFTWARE.
24
24
  */
25
25
 
26
- import { ControlElement, JsonSchema, UISchemaElement } from '../models';
26
+ import type { ControlElement, JsonSchema, UISchemaElement } from '../models';
27
27
  import { findUISchema, JsonFormsUISchemaRegistryEntry } from '../reducers';
28
28
  import { Resolve } from './util';
29
29
 
package/src/util/label.ts CHANGED
@@ -25,7 +25,7 @@
25
25
 
26
26
  import startCase from 'lodash/startCase';
27
27
 
28
- import { ControlElement, JsonSchema, LabelDescription } from '../models';
28
+ import type { ControlElement, JsonSchema, LabelDescription } from '../models';
29
29
  import { decode } from './path';
30
30
 
31
31
  const deriveLabel = (
package/src/util/path.ts CHANGED
@@ -69,12 +69,15 @@ export const toDataPathSegments = (schemaPath: string): string[] => {
69
69
  };
70
70
 
71
71
  /**
72
- * Remove all schema-specific keywords (e.g. 'properties') from a given path.
72
+ * Convert a schema path (i.e. JSON pointer) to a data path.
73
+ *
74
+ * Data paths can be used in field change event handlers like handleChange.
75
+ *
73
76
  * @example
74
- * toDataPath('#/properties/foo/properties/bar') === '#/foo/bar')
77
+ * toDataPath('#/properties/foo/properties/bar') === 'foo.bar')
75
78
  *
76
79
  * @param {string} schemaPath the schema path to be converted
77
- * @returns {string} the path without schema-specific keywords
80
+ * @returns {string} the data path
78
81
  */
79
82
  export const toDataPath = (schemaPath: string): string => {
80
83
  return toDataPathSegments(schemaPath).join('.');