@jsonui/core 0.3.0 → 0.4.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.
@@ -4,10 +4,10 @@ import * as constants from './utils/constants';
4
4
  import * as util from './utils/util';
5
5
  import I18n from './utils/I18n';
6
6
  import { StockContext, PathModifierContext } from './utils/contextHandler';
7
- import { genAllStateProps } from './store/root/selectors';
7
+ import { compSelectorHook } from './store/root/selectors';
8
8
  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
12
  export * from './utils/types';
13
- export { Stock, I18n, wrapperUtil, util, constants, StockContext, PathModifierContext, appRootFunctions, genAllStateProps, stockFunctions, persistConfig, storeReducers, };
13
+ export { Stock, I18n, wrapperUtil, util, constants, StockContext, PathModifierContext, appRootFunctions, compSelectorHook, stockFunctions, persistConfig, storeReducers, };
@@ -14,10 +14,10 @@ declare type CallFunctionType = (name: string, attr?: any, props?: any, callerAr
14
14
  declare type GetComponentType = (componentName: string) => ReactNode;
15
15
  export default class Stock {
16
16
  stock: NewStockType;
17
- Wrapper: ReactNode;
17
+ Wrapper: React.ElementType;
18
18
  reduxStore: any;
19
19
  validations: any;
20
- constructor(newStock: NewStockType, Wrapper: ReactNode, reduxStore: any);
20
+ constructor(newStock: NewStockType, Wrapper: React.ElementType, reduxStore: any);
21
21
  init: InitType;
22
22
  registerComponent: RegisterComponentType;
23
23
  registerFunction: RegisterFunctionType;
@@ -1,11 +1,7 @@
1
- import { PathModifiersType, PropsType } from '../../utils/types';
1
+ import { PathModifiersType, PropsType, ReduxPathType } 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 interface ReduxPathType {
6
- store: string;
7
- path: string;
8
- isError?: boolean;
9
- }
10
5
  export declare const getStateValue: (globalState: any, { store, path, isError }: ReduxPathType, currentPaths: PathModifiersType) => any;
11
6
  export declare const genAllStateProps: (globalState: any, props: PropsType) => PropsType;
7
+ export declare const compSelectorHook: (currentPaths: PathModifiersType, subscriberPaths: ReduxPathType[]) => (state: any) => any[] | undefined;
@@ -10,6 +10,8 @@ export declare const REF_LOCALES = "$locales";
10
10
  export declare const REF_VALIDATES = "$validations";
11
11
  export declare const STYLE_WEB_NAME = "styleWeb";
12
12
  export declare const STYLE_RN_NAME = "styleRN";
13
+ export declare const REDUX_GET_FUNCTION = "get";
14
+ export declare const REDUX_SET_FUNCTION = "set";
13
15
  export declare const REDUX_FUNCTIONS: string[];
14
16
  export declare const PATHNAME = "path";
15
17
  export declare const SIMPLE_DATA_TYPES: string[];
@@ -21,3 +23,9 @@ export declare const LIST_PAGE = "$page";
21
23
  export declare const LIST_ITEM_PER_PAGE = "$itemPerPage";
22
24
  export declare const LIST_LENGTH = "$listLength";
23
25
  export declare const LIST_ITEM_PER_PAGE_DEFAULT = 10;
26
+ export declare const REDUX_PATHS = "$$reduxPaths";
27
+ export declare const V_CHILDREN_PREFIX = "$child";
28
+ export declare const PARENT_PROP_NAME = "__parentprop";
29
+ export declare const CURRENT_PATH_NAME = "__currentPaths";
30
+ export declare const PRIMITIVE_COMP_NAME = "_PrimitiveProp";
31
+ export declare const FRAGMENT_COMP_NAME = "Fragment";
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import Stock from 'stock/Stock';
3
- export declare const StockContext: import("react").Context<typeof Stock | null>;
3
+ export declare const StockContext: import("react").Context<Stock | null>;
4
4
  export declare const PathModifierContext: import("react").Context<{}>;
@@ -25,3 +25,8 @@ export interface ValidationType {
25
25
  path: string;
26
26
  schema: any;
27
27
  }
28
+ export interface ReduxPathType {
29
+ store?: string;
30
+ path?: string;
31
+ isError?: boolean;
32
+ }
@@ -1,15 +1,31 @@
1
1
  /// <reference types="react" />
2
+ import * as c from '../utils/constants';
2
3
  import Stock from '../stock/Stock';
3
- import { PathModifiersType, PropsType, WrapperType } from '../utils/types';
4
+ import { PathModifiersType, PropsType, ReduxPathType, WrapperType } from '../utils/types';
5
+ interface OwnTraverse {
6
+ key: string;
7
+ value: PropsType;
8
+ path: string[];
9
+ parent: PropsType;
10
+ level: number;
11
+ }
12
+ export declare const getFilteredPath: ({ [c.PARENT_PROP_NAME]: parentComp, ...propsNew }: PropsType, func: (filterProps: OwnTraverse) => boolean) => OwnTraverse[];
4
13
  export declare const actionBuilder: (props: PropsType, stock: InstanceType<typeof Stock>) => void;
5
- export declare const modifierBuilder: (props: PropsType, stock: InstanceType<typeof Stock>) => void;
6
- export declare const pathModifierBuilder: (props: PropsType, pathModifier: PathModifiersType) => {
7
- currentPaths: PathModifiersType;
8
- } | undefined;
9
- export declare const getWrapperProps: (props: PropsType, parentComp?: any) => any;
14
+ export declare const calculatePropsFromModifier: (props: PropsType, stock: InstanceType<typeof Stock>) => ReduxPathType[];
15
+ export declare const getCurrentPaths: (props: PropsType, pathModifier: PathModifiersType) => PathModifiersType;
16
+ export declare const normalisePrimitives: (props: PropsType, parentComp?: any) => any;
10
17
  export declare const getRootWrapperProps: (props: PropsType, stock: InstanceType<typeof Stock>) => {
11
18
  [x: string]: import("../utils/types").PropValue;
12
19
  $pathModifiers?: PathModifiersType | undefined;
13
20
  };
21
+ export declare const isChildrenProps: (propName?: string | undefined) => boolean;
22
+ export declare const getParentProps: (props: PropsType) => PropsType;
23
+ export declare const getPropsChildrenFilter: ({ props, filter }: {
24
+ props: PropsType;
25
+ filter: 'onlyChildren' | 'withoutChildren';
26
+ }) => PropsType;
14
27
  export declare const getChildrensForRoot: (props: PropsType, children: any, Wrapper: WrapperType) => JSX.Element | JSX.Element[] | undefined;
15
28
  export declare const generateChildren: (props: PropsType, { Wrapper }: InstanceType<typeof Stock>) => import("../utils/types").PropValue | JSX.Element;
29
+ export declare const generateNewChildren: (props: PropsType, { Wrapper }: InstanceType<typeof Stock>) => JSX.Element | JSX.Element[] | undefined;
30
+ export declare const removeTechnicalProps: (changeableProps: any) => any;
31
+ export {};
@@ -0,0 +1 @@
1
+ export {};