@jsonui/react 0.4.3 → 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.
Files changed (30) hide show
  1. package/README.md +5 -9
  2. package/dist/cjs/index.js +18064 -173
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/ReduxProviders.d.ts +3 -12
  5. package/dist/cjs/types/stock/components/Button.d.ts +1 -1
  6. package/dist/cjs/types/stock/components/Fragment.d.ts +1 -5
  7. package/dist/cjs/types/stock/components/PrimitiveProp.d.ts +1 -4
  8. package/dist/cjs/types/stock/components/Text.d.ts +1 -1
  9. package/dist/cjs/types/stock/components/View.d.ts +1 -1
  10. package/dist/cjs/types/stock/components.d.ts +18 -0
  11. package/dist/cjs/types/stock/stockToRenderer.d.ts +20 -0
  12. package/dist/cjs/types/stories/PerformansTest1.stories.d.ts +5 -0
  13. package/dist/cjs/types/stories/PerformansTest2.stories.d.ts +5 -0
  14. package/dist/cjs/types/stories/Validation.stories.d.ts +12 -0
  15. package/dist/cjs/types/types.d.ts +5 -2
  16. package/dist/esm/index.js +18065 -174
  17. package/dist/esm/index.js.map +1 -1
  18. package/dist/esm/types/ReduxProviders.d.ts +3 -12
  19. package/dist/esm/types/stock/components/Button.d.ts +1 -1
  20. package/dist/esm/types/stock/components/Fragment.d.ts +1 -5
  21. package/dist/esm/types/stock/components/PrimitiveProp.d.ts +1 -4
  22. package/dist/esm/types/stock/components/Text.d.ts +1 -1
  23. package/dist/esm/types/stock/components/View.d.ts +1 -1
  24. package/dist/esm/types/stock/components.d.ts +18 -0
  25. package/dist/esm/types/stock/stockToRenderer.d.ts +20 -0
  26. package/dist/esm/types/stories/PerformansTest1.stories.d.ts +5 -0
  27. package/dist/esm/types/stories/PerformansTest2.stories.d.ts +5 -0
  28. package/dist/esm/types/stories/Validation.stories.d.ts +12 -0
  29. package/dist/esm/types/types.d.ts +5 -2
  30. package/package.json +3 -3
@@ -1,18 +1,9 @@
1
- /// <reference types="redux-persist/types/types" />
2
- import React, { ReactNode } from 'react';
3
- import { Store, AnyAction } from 'redux';
4
- import { Persistor } from 'redux-persist/es/types';
1
+ import { ReactNode } from 'react';
5
2
  import { DefaultValues } from 'types';
6
- declare type MyProps = {
3
+ interface MyProps {
7
4
  children: ReactNode;
8
5
  defaultValues?: DefaultValues;
9
6
  disabledPersist?: boolean;
10
- };
11
- declare class Providers extends React.Component<MyProps> {
12
- store: Store<any, AnyAction>;
13
- persistor: Persistor;
14
- disabledPersist: boolean;
15
- constructor(props: MyProps);
16
- render(): JSX.Element;
17
7
  }
8
+ declare const Providers: ({ children, defaultValues: root, disabledPersist }: MyProps) => JSX.Element;
18
9
  export default Providers;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare function Button(props: any): JSX.Element;
2
+ declare function Button({ children, type, ...props }: any): JSX.Element;
3
3
  export default Button;
@@ -1,6 +1,2 @@
1
- /// <reference types="react" />
2
- import { constants as c } from '@jsonui/core';
3
- declare const Fragment: ({ [c.V_CHILDREN_NAME]: props, ...a }: {
4
- [c.V_CHILDREN_NAME]: any;
5
- }) => JSX.Element;
1
+ declare const Fragment: ({ children }: any) => any;
6
2
  export default Fragment;
@@ -1,6 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { constants as c } from '@jsonui/core';
3
- declare function PrimitiveProp({ [c.V_CHILDREN_NAME]: children }: {
4
- [c.V_CHILDREN_NAME]: any;
5
- }): JSX.Element;
2
+ declare function PrimitiveProp({ children }: any): JSX.Element;
6
3
  export default PrimitiveProp;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare function Text({ value, [c.V_CHILDREN_NAME]: children, ...props }: any): JSX.Element;
2
+ declare function Text({ value, children, ...props }: any): JSX.Element;
3
3
  export default Text;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare function View({ [c.V_CHILDREN_NAME]: children, ...props }: any): JSX.Element;
2
+ declare function View(props: any): JSX.Element;
3
3
  export default View;
@@ -0,0 +1,18 @@
1
+ import Text from './components/Text';
2
+ import Button from './components/Button';
3
+ import Edit from './components/Edit';
4
+ import View from './components/View';
5
+ import Image from './components/Image';
6
+ import _Undefined from './components/Undefined';
7
+ import _PrimitiveProp from './components/PrimitiveProp';
8
+ declare const Components: {
9
+ View: typeof View;
10
+ _PrimitiveProp: typeof _PrimitiveProp;
11
+ _Undefined: typeof _Undefined;
12
+ Fragment: ({ children }: any) => any;
13
+ Image: typeof Image;
14
+ Text: typeof Text;
15
+ Button: typeof Button;
16
+ Edit: typeof Edit;
17
+ };
18
+ export default Components;
@@ -0,0 +1,20 @@
1
+ import { Stock } from '@jsonui/core';
2
+ export declare const getStock: (stockInit: any, model: any, Wrapper: any, reduxStore: any) => Stock;
3
+ declare const stock: {
4
+ components: {
5
+ View: typeof import("./components/View").default;
6
+ _PrimitiveProp: typeof import("./components/PrimitiveProp").default;
7
+ _Undefined: typeof import("./components/Undefined").default;
8
+ Fragment: ({ children }: any) => any;
9
+ Image: typeof import("./components/Image").default;
10
+ Text: typeof import("./components/Text").default;
11
+ Button: typeof import("./components/Button").default;
12
+ Edit: typeof import("./components/Edit").default;
13
+ };
14
+ functions: {
15
+ get: import("@jsonui/core").JsonUIFunctionType;
16
+ set: import("@jsonui/core").JsonUIFunctionType;
17
+ jsonata: import("@jsonui/core").JsonUIFunctionType;
18
+ };
19
+ };
20
+ export default stock;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+ declare const JsonUIStory: ComponentMeta<(props: import("../types").ViewerProps) => JSX.Element>;
4
+ export declare const InputTest: ComponentStory<any>;
5
+ export default JsonUIStory;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+ declare const JsonUIStory: ComponentMeta<(props: import("../types").ViewerProps) => JSX.Element>;
4
+ export declare const BoxTest: ComponentStory<any>;
5
+ export default JsonUIStory;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+ declare const JsonUIStory: ComponentMeta<(props: import("../types").ViewerProps) => JSX.Element>;
4
+ export declare const ValidationTest: ComponentStory<(props: import("../types").ViewerProps) => JSX.Element>;
5
+ export default JsonUIStory;
6
+ /**
7
+ * TODO:
8
+ * how is help submit to validate the whole form
9
+ * touch
10
+ * dirty
11
+ *
12
+ * */
@@ -1,3 +1,4 @@
1
+ import { JsonUIComponentsType, JsonUIFunctions } from '@jsonui/core';
1
2
  export declare type JSONPrimitive = string | number | boolean | null;
2
3
  export declare type JSONValue = JSONPrimitive | JSONObject | JSONArray;
3
4
  export declare type JSONObject = {
@@ -10,6 +11,7 @@ export interface ChangeDefaultValueFuncProp {
10
11
  value: JSONValue;
11
12
  }
12
13
  export declare type ChangeDefaultValueFunc = (arg: ChangeDefaultValueFuncProp) => void;
14
+ export declare type OnSubmitFunc = (arg: any) => void;
13
15
  export interface DefaultValues {
14
16
  [key: string]: JSONValue;
15
17
  }
@@ -17,7 +19,8 @@ export interface ViewerProps {
17
19
  model: any;
18
20
  defaultValues?: DefaultValues;
19
21
  id?: string;
20
- components?: any;
21
- functions?: any;
22
+ components?: JsonUIComponentsType;
23
+ functions?: JsonUIFunctions;
22
24
  disabledPersist?: boolean;
25
+ onSubmit?: OnSubmitFunc;
23
26
  }