@jsonui/core 0.4.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +729 -45
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/index.d.ts +1 -1
- package/dist/cjs/types/stock/Stock.d.ts +1 -4
- package/dist/cjs/types/stock/appRootFunctions.d.ts +1 -4
- package/dist/cjs/types/stock/functions.d.ts +2 -2
- package/dist/cjs/types/stock/validation.d.ts +7 -3
- package/dist/cjs/types/store/root/selectors.d.ts +4 -4
- package/dist/cjs/types/utils/constants.d.ts +2 -0
- package/dist/cjs/types/utils/types.d.ts +16 -3
- package/dist/cjs/types/utils/util.d.ts +5 -2
- package/dist/cjs/types/wrapper/wrapperUtil.d.ts +3 -6
- package/dist/esm/index.js +729 -45
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/types/stock/Stock.d.ts +1 -4
- package/dist/esm/types/stock/appRootFunctions.d.ts +1 -4
- package/dist/esm/types/stock/functions.d.ts +2 -2
- package/dist/esm/types/stock/validation.d.ts +7 -3
- package/dist/esm/types/store/root/selectors.d.ts +4 -4
- package/dist/esm/types/utils/constants.d.ts +2 -0
- package/dist/esm/types/utils/types.d.ts +16 -3
- package/dist/esm/types/utils/util.d.ts +5 -2
- package/dist/esm/types/wrapper/wrapperUtil.d.ts +3 -6
- package/dist/index.d.ts +45 -26
- package/package.json +4 -2
|
@@ -9,5 +9,5 @@ import stockFunctions from './stock/functions';
|
|
|
9
9
|
import persistConfig from './store/persistConfig';
|
|
10
10
|
import storeReducers from './store/reducers';
|
|
11
11
|
import appRootFunctions from './stock/appRootFunctions';
|
|
12
|
-
export * from './utils/types';
|
|
12
|
+
export type * from './utils/types';
|
|
13
13
|
export { Stock, I18n, wrapperUtil, util, constants, StockContext, PathModifierContext, appRootFunctions, compSelectorHook, stockFunctions, persistConfig, storeReducers, };
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { JsonUIFunctions, JsonUIFunctionType } from '
|
|
3
|
-
interface JsonUIComponentsType {
|
|
4
|
-
[key: string]: ReactNode;
|
|
5
|
-
}
|
|
2
|
+
import { JsonUIComponentsType, JsonUIFunctions, JsonUIFunctionType } from 'utils/types';
|
|
6
3
|
interface NewStockType {
|
|
7
4
|
components: JsonUIComponentsType;
|
|
8
5
|
functions: JsonUIFunctions;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export interface JsonUIFunctions {
|
|
3
|
-
[key: string]: JsonUIFunctionType;
|
|
4
|
-
}
|
|
1
|
+
import { JsonUIFunctions, JsonUIFunctionType } from 'utils/types';
|
|
5
2
|
export declare const deletePersistDataStore: JsonUIFunctionType;
|
|
6
3
|
declare const appRootFunctions: JsonUIFunctions;
|
|
7
4
|
export default appRootFunctions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { JsonUIFunctionType } from '
|
|
1
|
+
import { JsonUIFunctionType } from '../utils/types';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
getStateValue: JsonUIFunctionType;
|
|
4
3
|
get: JsonUIFunctionType;
|
|
5
4
|
set: JsonUIFunctionType;
|
|
5
|
+
jsonata: JsonUIFunctionType;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { ErrorObject } from 'ajv';
|
|
2
|
-
export declare const errorConverter: (errors: ErrorObject<string, Record<string, any>, unknown>[] | null | undefined) =>
|
|
3
|
-
export declare const validateJSON: (schema: any,
|
|
2
|
+
export declare const errorConverter: (errors: ErrorObject<string, Record<string, any>, unknown>[] | null | undefined) => any;
|
|
3
|
+
export declare const validateJSON: (schema: any, data: any) => {
|
|
4
|
+
valid: boolean;
|
|
5
|
+
error: any;
|
|
6
|
+
};
|
|
7
|
+
export declare const validateJSONAndStore: (schema: any, store: string, data: any) => {
|
|
4
8
|
store: string;
|
|
5
9
|
valid: boolean;
|
|
6
|
-
value:
|
|
10
|
+
value: any;
|
|
7
11
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PathModifiersType,
|
|
1
|
+
import { PathModifiersType, ReduxPath, ReduxPathTypeEnum } from '../../utils/types';
|
|
2
2
|
import { RootStateType } from './reducer';
|
|
3
3
|
export declare const getState: (state: any) => RootStateType;
|
|
4
4
|
export declare const getValue: (state: any, store: string, path: string) => any;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const compSelectorHook: (currentPaths: PathModifiersType, subscriberPaths:
|
|
5
|
+
export declare const getStoreNameFromType: (store: string, type?: ReduxPathTypeEnum | undefined) => string;
|
|
6
|
+
export declare const getStateValue: (globalState: any, { store, path, type, jsonataDef }: ReduxPath, currentPaths: PathModifiersType) => any;
|
|
7
|
+
export declare const compSelectorHook: (currentPaths: PathModifiersType, subscriberPaths: ReduxPath[]) => (state: any) => any[] | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const SEPARATOR = "/";
|
|
2
2
|
export declare const STORE_ERROR_POSTFIX = ".error";
|
|
3
|
+
export declare const STORE_TOUCH_POSTFIX = ".touch";
|
|
3
4
|
export declare const PATH_MODIFIERS_KEY = "$pathModifiers";
|
|
4
5
|
export declare const MODIFIER_KEY = "$modifier";
|
|
5
6
|
export declare const ACTION_KEY = "$action";
|
|
@@ -27,6 +28,7 @@ export declare const REDUX_PATHS = "$$reduxPaths";
|
|
|
27
28
|
export declare const V_CHILDREN_PREFIX = "$child";
|
|
28
29
|
export declare const PARENT_PROP_NAME = "__parentprop";
|
|
29
30
|
export declare const CURRENT_PATH_NAME = "__currentPaths";
|
|
31
|
+
export declare const REDUX_GET_SUBSCRIBERS_NAME = "__subscriberPaths";
|
|
30
32
|
export declare const UNDEFINED_COMP_NAME = "_Undefined";
|
|
31
33
|
export declare const PRIMITIVE_COMP_NAME = "_PrimitiveProp";
|
|
32
34
|
export declare const FRAGMENT_COMP_NAME = "Fragment";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import * as c from 'utils/constants';
|
|
3
3
|
export declare type UIDefinition = any;
|
|
4
4
|
export declare type Path = string;
|
|
@@ -25,8 +25,21 @@ export interface ValidationType {
|
|
|
25
25
|
path: string;
|
|
26
26
|
schema: any;
|
|
27
27
|
}
|
|
28
|
-
export
|
|
28
|
+
export declare enum ReduxPathTypeEnum {
|
|
29
|
+
ERROR = "ERROR",
|
|
30
|
+
TOUCH = "TOUCH",
|
|
31
|
+
NORMAL = "NORMAL"
|
|
32
|
+
}
|
|
33
|
+
export interface ReduxPath {
|
|
29
34
|
store?: string;
|
|
30
35
|
path?: string;
|
|
31
|
-
|
|
36
|
+
type?: ReduxPathTypeEnum;
|
|
37
|
+
jsonataDef?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface JsonUIComponentsType {
|
|
40
|
+
[key: string]: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
export declare type JsonUIFunctionType = (attr: any, props: any, callerArgs: any, stock: any) => Promise<void> | void | any;
|
|
43
|
+
export interface JsonUIFunctions {
|
|
44
|
+
[key: string]: JsonUIFunctionType;
|
|
32
45
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const findLastIndex: (arr: any[], func: any) => number;
|
|
2
2
|
export declare const drop: (arr: any[], n?: number) => any[];
|
|
3
3
|
export declare const isNumber: (a: any) => boolean;
|
|
4
|
+
export declare const jsonPointerFix: (path?: string | undefined) => string;
|
|
4
5
|
export declare const jsonPointerGet: (json: any, path?: string | undefined) => any;
|
|
5
6
|
export declare const jsonPointerSet: (json: any, path?: string | undefined, value?: any) => any;
|
|
6
7
|
export declare const pathArrayToPathString: (array: (string | number)[]) => string;
|
|
@@ -15,5 +16,7 @@ export declare const changeRelativePath: (path: string) => string;
|
|
|
15
16
|
*/
|
|
16
17
|
export declare function mergeDeep(target: any, ...sources: any): any;
|
|
17
18
|
export declare const collectObjMerge: (refConst: string, json: any) => {};
|
|
18
|
-
export declare const collectObjToArray: (refConst: string, json: any) => any[];
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const collectObjToArray: (refConst: string, json: any, flatten?: boolean) => any[];
|
|
20
|
+
export declare const isValidJson: (d: any) => boolean;
|
|
21
|
+
export declare const isPrimitiveValue: (value: any, emptyStringAllowed?: boolean) => boolean;
|
|
22
|
+
export declare const hasLeaf: (obj: any, emptyStringAllowed?: boolean) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as c from '../utils/constants';
|
|
3
3
|
import Stock from '../stock/Stock';
|
|
4
|
-
import { PathModifiersType, PropsType,
|
|
4
|
+
import { PathModifiersType, PropsType, ReduxPath, WrapperType } from '../utils/types';
|
|
5
5
|
interface OwnTraverse {
|
|
6
6
|
key: string;
|
|
7
7
|
value: PropsType;
|
|
@@ -11,13 +11,10 @@ interface OwnTraverse {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const getFilteredPath: ({ [c.PARENT_PROP_NAME]: parentComp, ...propsNew }: PropsType, func: (filterProps: OwnTraverse) => boolean) => OwnTraverse[];
|
|
13
13
|
export declare const actionBuilder: (props: PropsType, stock: InstanceType<typeof Stock>) => void;
|
|
14
|
-
export declare const calculatePropsFromModifier: (props: PropsType, stock: InstanceType<typeof Stock>) =>
|
|
14
|
+
export declare const calculatePropsFromModifier: (props: PropsType, stock: InstanceType<typeof Stock>) => ReduxPath[];
|
|
15
15
|
export declare const getCurrentPaths: (props: PropsType, pathModifier: PathModifiersType) => PathModifiersType;
|
|
16
16
|
export declare const normalisePrimitives: (props: PropsType, parentComp?: any) => any;
|
|
17
|
-
export declare const getRootWrapperProps: (props: PropsType, stock: InstanceType<typeof Stock>) =>
|
|
18
|
-
[x: string]: import("../utils/types").PropValue;
|
|
19
|
-
$pathModifiers?: PathModifiersType | undefined;
|
|
20
|
-
};
|
|
17
|
+
export declare const getRootWrapperProps: (props: PropsType, stock: InstanceType<typeof Stock>) => void;
|
|
21
18
|
export declare const isChildrenProp: (propName?: string | undefined) => boolean;
|
|
22
19
|
export declare const getParentProps: (props: PropsType) => PropsType;
|
|
23
20
|
export declare const getPropsChildrenFilter: ({ props, filter }: {
|