@jsonforms/core 3.2.0-beta.0 → 3.2.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.
@@ -1,3 +1,3 @@
1
1
  import type { JsonSchema4 } from './jsonSchema4';
2
2
  import type { JsonSchema7 } from './jsonSchema7';
3
- export declare type JsonSchema = JsonSchema4 | JsonSchema7;
3
+ export type JsonSchema = JsonSchema4 | JsonSchema7;
@@ -1,8 +1,8 @@
1
1
  import type { RankedTester } from '../testers';
2
2
  import { AddCellRendererAction, RemoveCellRendererAction } from '../actions';
3
3
  import type { Reducer } from '../util';
4
- declare type ValidCellReducerActions = AddCellRendererAction | RemoveCellRendererAction;
5
- export declare type JsonFormsCellRendererRegistryState = JsonFormsCellRendererRegistryEntry[];
4
+ type ValidCellReducerActions = AddCellRendererAction | RemoveCellRendererAction;
5
+ export type JsonFormsCellRendererRegistryState = JsonFormsCellRendererRegistryEntry[];
6
6
  export interface JsonFormsCellRendererRegistryEntry {
7
7
  tester: RankedTester;
8
8
  cell: any;
@@ -4,7 +4,7 @@ import { CoreActions } from '../actions';
4
4
  import { Reducer } from '../util';
5
5
  import type { JsonSchema, UISchemaElement } from '../models';
6
6
  export declare const validate: (validator: ValidateFunction | undefined, data: any) => ErrorObject[];
7
- export declare type ValidationMode = 'ValidateAndShow' | 'ValidateAndHide' | 'NoValidation';
7
+ export type ValidationMode = 'ValidateAndShow' | 'ValidateAndHide' | 'NoValidation';
8
8
  export interface JsonFormsCore {
9
9
  data: any;
10
10
  schema: JsonSchema;
@@ -4,7 +4,7 @@ export interface JsonFormsDefaultDataRegistryEntry {
4
4
  schemaPath: string;
5
5
  data: any;
6
6
  }
7
- declare type ValidDefaultDataActions = RegisterDefaultDataAction | UnregisterDefaultDataAction;
7
+ type ValidDefaultDataActions = RegisterDefaultDataAction | UnregisterDefaultDataAction;
8
8
  export declare const defaultDataReducer: Reducer<JsonFormsDefaultDataRegistryEntry[], ValidDefaultDataActions>;
9
9
  export declare const extractDefaultData: (state: JsonFormsDefaultDataRegistryEntry[]) => JsonFormsDefaultDataRegistryEntry[];
10
10
  export {};
@@ -7,3 +7,4 @@ export * from './reducers';
7
7
  export * from './renderers';
8
8
  export * from './selectors';
9
9
  export * from './uischemas';
10
+ export * from './middleware';
@@ -0,0 +1,6 @@
1
+ import { CoreActions } from '../actions';
2
+ import { JsonFormsCore } from './core';
3
+ export interface Middleware {
4
+ (state: JsonFormsCore, action: CoreActions, defaultReducer: (state: JsonFormsCore, action: CoreActions) => JsonFormsCore): JsonFormsCore;
5
+ }
6
+ export declare const defaultMiddleware: Middleware;
@@ -5,6 +5,6 @@ export interface JsonFormsRendererRegistryEntry {
5
5
  tester: RankedTester;
6
6
  renderer: any;
7
7
  }
8
- declare type ValidRendererReducerActions = AddRendererAction | RemoveRendererAction;
8
+ type ValidRendererReducerActions = AddRendererAction | RemoveRendererAction;
9
9
  export declare const rendererReducer: Reducer<JsonFormsRendererRegistryEntry[], ValidRendererReducerActions>;
10
10
  export {};
@@ -1,7 +1,7 @@
1
1
  import { UISchemaActions } from '../actions';
2
2
  import type { JsonSchema, UISchemaElement } from '../models';
3
3
  import type { Reducer } from '../util';
4
- export declare type UISchemaTester = (schema: JsonSchema, schemaPath: string, path: string) => number;
4
+ export type UISchemaTester = (schema: JsonSchema, schemaPath: string, path: string) => number;
5
5
  export interface JsonFormsUISchemaRegistryEntry {
6
6
  tester: UISchemaTester;
7
7
  uischema: UISchemaElement;
@@ -9,11 +9,11 @@ export declare const NOT_APPLICABLE = -1;
9
9
  * A tester is a function that receives an UI schema and a JSON schema and returns a boolean.
10
10
  * The rootSchema is handed over as context. Can be used to resolve references.
11
11
  */
12
- export declare type Tester = (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => boolean;
12
+ export type Tester = (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => boolean;
13
13
  /**
14
14
  * A ranked tester associates a tester with a number.
15
15
  */
16
- export declare type RankedTester = (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => number;
16
+ export type RankedTester = (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => number;
17
17
  /**
18
18
  * Additional context given to a tester in addition to UISchema and JsonSchema.
19
19
  */
@@ -25,7 +25,7 @@ export interface StatePropsOfEnumCell extends StatePropsOfCell, OwnPropsOfEnum {
25
25
  */
26
26
  export interface EnumCellProps extends StatePropsOfEnumCell, DispatchPropsOfControl {
27
27
  }
28
- export declare type DispatchPropsOfCell = DispatchPropsOfControl;
28
+ export type DispatchPropsOfCell = DispatchPropsOfControl;
29
29
  /**
30
30
  * Props of a cell.
31
31
  */
@@ -5,5 +5,5 @@ export interface CombinatorSubSchemaRenderInfo {
5
5
  uischema: UISchemaElement;
6
6
  label: string;
7
7
  }
8
- export declare type CombinatorKeyword = 'anyOf' | 'oneOf' | 'allOf';
8
+ export type CombinatorKeyword = 'anyOf' | 'oneOf' | 'allOf';
9
9
  export declare const createCombinatorRenderInfos: (combinatorSubSchemas: JsonSchema[], rootSchema: JsonSchema, keyword: CombinatorKeyword, control: ControlElement, path: string, uischemas: JsonFormsUISchemaRegistryEntry[]) => CombinatorSubSchemaRenderInfo[];
@@ -0,0 +1,3 @@
1
+ export declare const defaultDateFormat = "YYYY-MM-DD";
2
+ export declare const defaultTimeFormat = "HH:mm:ss";
3
+ export declare const defaultDateTimeFormat = "YYYY-MM-DDTHH:mm:ss.sssZ";
@@ -13,3 +13,4 @@ export * from './type';
13
13
  export * from './uischema';
14
14
  export * from './util';
15
15
  export * from './validator';
16
+ export * from './defaultDateFormat';
@@ -357,7 +357,7 @@ export declare const layoutDefaultProps: {
357
357
  * @returns {StatePropsOfLayout}
358
358
  */
359
359
  export declare const mapStateToLayoutProps: (state: JsonFormsState, ownProps: OwnPropsOfLayout) => LayoutProps;
360
- export declare type RefResolver = (schema: JsonSchema) => Promise<JsonSchema>;
360
+ export type RefResolver = (schema: JsonSchema) => Promise<JsonSchema>;
361
361
  export interface OwnPropsOfJsonFormsRenderer extends OwnPropsOfRenderer {
362
362
  }
363
363
  export interface StatePropsOfJsonFormsRenderer extends OwnPropsOfJsonFormsRenderer {
@@ -31,7 +31,7 @@ export interface AnyAction extends Action {
31
31
  * @template A The type of things (actions or otherwise) which may be
32
32
  * dispatched.
33
33
  */
34
- export declare type Dispatch<A extends Action = AnyAction> = <T extends A>(action: T) => T;
34
+ export type Dispatch<A extends Action = AnyAction> = <T extends A>(action: T) => T;
35
35
  /**
36
36
  * A store is an object that holds the application's state tree.
37
37
  * There should only be a single store in a Redux app, as the composition
@@ -122,7 +122,7 @@ export interface Store<S = any, A extends Action = AnyAction> {
122
122
  * For more information, see the observable proposal:
123
123
  * https://github.com/tc39/proposal-observable
124
124
  */
125
- export declare type Observable<T> = {
125
+ export type Observable<T> = {
126
126
  /**
127
127
  * The minimal observable subscription method.
128
128
  * @param {Object} observer Any object that can be used as an observer.
@@ -140,7 +140,7 @@ export declare type Observable<T> = {
140
140
  * An Observer is used to receive data from an Observable, and is supplied as
141
141
  * an argument to subscribe.
142
142
  */
143
- export declare type Observer<T> = {
143
+ export type Observer<T> = {
144
144
  next?(value: T): void;
145
145
  };
146
146
  /**
@@ -167,8 +167,8 @@ export declare type Observer<T> = {
167
167
  * @template S The type of state consumed and produced by this reducer.
168
168
  * @template A The type of actions the reducer can potentially respond to.
169
169
  */
170
- export declare type Reducer<S = any, A extends Action = AnyAction> = (state: S | undefined, action: A) => S;
170
+ export type Reducer<S = any, A extends Action = AnyAction> = (state: S | undefined, action: A) => S;
171
171
  /**
172
172
  * Function to remove listener added by `Store.subscribe()`.
173
173
  */
174
- export declare type Unsubscribe = () => void;
174
+ export type Unsubscribe = () => void;
@@ -1,5 +1,5 @@
1
1
  import { UISchemaElement } from '../models';
2
- export declare type IterateCallback = (uischema: UISchemaElement) => void;
2
+ export type IterateCallback = (uischema: UISchemaElement) => void;
3
3
  export declare const setReadonly: (uischema: UISchemaElement) => void;
4
4
  export declare const unsetReadonly: (uischema: UISchemaElement) => void;
5
5
  export declare const iterateSchema: (uischema: UISchemaElement, toApply: IterateCallback) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonforms/core",
3
- "version": "3.2.0-beta.0",
3
+ "version": "3.2.0-beta.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",
@@ -86,8 +86,8 @@
86
86
  "source-map-support": "0.5.16",
87
87
  "ts-node": "^10.4.0",
88
88
  "tslib": "^2.5.0",
89
- "typedoc": "~0.21.9",
90
- "typescript": "4.2.3"
89
+ "typedoc": "~0.25.3",
90
+ "typescript": "~4.9.5"
91
91
  },
92
92
  "scripts": {
93
93
  "build": "rollup -c rollup.config.js",
@@ -97,6 +97,6 @@
97
97
  "report": "nyc report --reporter=html",
98
98
  "test": "ava",
99
99
  "test-cov": "rimraf -rf .nyc_output && nyc ava",
100
- "doc": "typedoc --name 'JSON Forms Core' --excludeExternals --theme ../../typedoc-jsonforms --out docs src"
100
+ "doc": "typedoc --name 'JSON Forms Core' --excludeExternals --out docs src"
101
101
  }
102
102
  }
@@ -191,6 +191,8 @@ const generateUISchema = (
191
191
  /* falls through */
192
192
  case 'integer':
193
193
  /* falls through */
194
+ case 'null':
195
+ /* falls through */
194
196
  case 'boolean': {
195
197
  const controlObject: ControlElement = createControlElement(currentRef);
196
198
  schemaElements.push(controlObject);
@@ -32,3 +32,4 @@ export * from './reducers';
32
32
  export * from './renderers';
33
33
  export * from './selectors';
34
34
  export * from './uischemas';
35
+ export * from './middleware';
@@ -0,0 +1,36 @@
1
+ /*
2
+ The MIT License
3
+
4
+ Copyright (c) 2023 EclipseSource Munich
5
+ https://github.com/eclipsesource/jsonforms
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+ import { CoreActions } from '../actions';
26
+ import { JsonFormsCore } from './core';
27
+
28
+ export interface Middleware {
29
+ (
30
+ state: JsonFormsCore,
31
+ action: CoreActions,
32
+ defaultReducer: (state: JsonFormsCore, action: CoreActions) => JsonFormsCore
33
+ ): JsonFormsCore;
34
+ }
35
+ export const defaultMiddleware: Middleware = (state, action, defaultReducer) =>
36
+ defaultReducer(state, action);
@@ -0,0 +1,28 @@
1
+ /*
2
+ The MIT License
3
+
4
+ Copyright (c) 2023-2023 EclipseSource Munich
5
+ https://github.com/eclipsesource/jsonforms
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+
26
+ export const defaultDateFormat = 'YYYY-MM-DD';
27
+ export const defaultTimeFormat = 'HH:mm:ss';
28
+ export const defaultDateTimeFormat = 'YYYY-MM-DDTHH:mm:ss.sssZ';
package/src/util/index.ts CHANGED
@@ -38,3 +38,4 @@ export * from './type';
38
38
  export * from './uischema';
39
39
  export * from './util';
40
40
  export * from './validator';
41
+ export * from './defaultDateFormat';