@jsonui/core 0.7.1 → 0.7.3

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,12 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
- import { JsonUIComponentsType, JsonUIFunctions, JsonUIFunctionType } from 'utils/types';
2
+ import { JsonUIComponentsType, JsonUIComponentType, JsonUIFunctions, JsonUIFunctionType } from 'utils/types';
3
3
  interface NewStockType {
4
4
  components: JsonUIComponentsType;
5
5
  functions: JsonUIFunctions;
6
6
  }
7
7
  declare type InitType = (prop: NewStockType) => void;
8
8
  declare type RegisterFunctionType = (key: string, value: JsonUIFunctionType) => void;
9
- declare type RegisterComponentType = (key: string, value: ReactNode) => void;
9
+ declare type RegisterComponentType = (key: string, value: JsonUIComponentType) => void;
10
10
  declare type CallFunctionType = (name: string, attr?: any, props?: any, callerArgs?: any) => any;
11
11
  declare type GetComponentType = (componentName: string) => ReactNode;
12
12
  export default class Stock {
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import * as c from './constants';
3
3
  export declare type UIDefinition = any;
4
4
  export declare type Path = string;
@@ -36,8 +36,9 @@ export interface ReduxPath {
36
36
  type?: ReduxPathTypeEnum;
37
37
  jsonataDef?: string;
38
38
  }
39
+ export declare type JsonUIComponentType = React.FC<any> | typeof React.Component | ((prop: any) => number | null | undefined | string);
39
40
  export interface JsonUIComponentsType {
40
- [key: string]: ReactNode;
41
+ [key: string]: JsonUIComponentType;
41
42
  }
42
43
  export declare type JsonUIFunctionType = (attr: any, props: any, callerArgs: any, stock: any) => Promise<void> | void | any;
43
44
  export interface JsonUIFunctions {
package/dist/esm/index.js CHANGED
@@ -6711,7 +6711,7 @@ var ReduxPathTypeEnum;
6711
6711
  ReduxPathTypeEnum["TOUCH"] = "TOUCH";
6712
6712
  ReduxPathTypeEnum["NORMAL"] = "NORMAL";
6713
6713
  })(ReduxPathTypeEnum || (ReduxPathTypeEnum = {}));const getState = (state) => state === null || state === void 0 ? void 0 : state.root;
6714
- const getValue = (state, store, path) => jsonPointerGet(state[store], path) || null;
6714
+ const getValue = (state, store, path) => jsonPointerGet(state[store], path);
6715
6715
  const getStoreNameFromType = (store, type) =>
6716
6716
  // eslint-disable-next-line no-nested-ternary
6717
6717
  type === ReduxPathTypeEnum.ERROR ? `${store}${STORE_ERROR_POSTFIX}` : type === ReduxPathTypeEnum.TOUCH ? `${store}${STORE_TOUCH_POSTFIX}` : `${store}`;