graphand-react
Advanced tools
Comparing version 0.4.20-beta to 0.4.21-beta
@@ -1,2 +0,1 @@ | ||
import { GraphandField, GraphandModel } from "graphand-js"; | ||
import React from "react"; | ||
@@ -25,12 +24,3 @@ import { GraphandFormOptions } from "../lib/renderForm"; | ||
export declare type GraphandFormTemplate = JSX.Element | string | React.FunctionComponent<GraphandFormTemplateParams> | React.ComponentClass<GraphandFormTemplateParams, any>; | ||
export declare type GraphandFormInputProps = GraphandFormTemplateParamsBase & { | ||
value: any; | ||
onChange: (value: any) => void; | ||
options: any; | ||
slug: string; | ||
field: GraphandField; | ||
inputRef: any; | ||
model: typeof GraphandModel; | ||
}; | ||
declare const GraphandForm: React.FunctionComponent<GraphandFormOptions>; | ||
export default GraphandForm; |
import GraphandForm from "./components/GraphandForm"; | ||
import { GraphandFormInputProps, GraphandFormTemplateParams, GraphandFormTemplate } from "./components/GraphandForm"; | ||
import { GraphandFormTemplateParams, GraphandFormTemplate } from "./components/GraphandForm"; | ||
import InfiniteList from "./components/InfiniteList"; | ||
@@ -10,2 +10,2 @@ import PromiseSuspense from "./components/PromiseSuspense"; | ||
export default GraphandPluginReact; | ||
export { GraphandPluginReact, PromiseSuspense, InfiniteList, GraphandForm, useList, GraphandFormInputProps, GraphandFormTemplateParams, GraphandFormTemplate, GraphandFormOptions, InputComponentProps, ViewComponentProps, }; | ||
export { GraphandPluginReact, PromiseSuspense, InfiniteList, GraphandForm, useList, GraphandFormTemplateParams, GraphandFormTemplate, GraphandFormOptions, InputComponentProps, ViewComponentProps, }; |
@@ -1,6 +0,6 @@ | ||
import { GraphandModel, GraphandPlugin, GraphandField } from "graphand-js"; | ||
import { GraphandModel, GraphandPlugin, GraphandField, DataFieldTypes, GraphandValidationError } from "graphand-js"; | ||
import React from "react"; | ||
import { GraphandFormOptions } from "./lib/renderForm"; | ||
import { SuspenseDefinition } from "./lib/suspense"; | ||
export declare type InputComponentProps = { | ||
declare type GraphandReactItemBaseProps<T extends any> = { | ||
field: GraphandField; | ||
@@ -10,11 +10,12 @@ options: any; | ||
slug: string; | ||
value: any; | ||
value: T; | ||
}; | ||
export declare type ViewComponentProps = { | ||
field: GraphandField; | ||
options: any; | ||
item: GraphandModel; | ||
slug: string; | ||
value: any; | ||
export declare type InputComponentProps<T extends any = any> = GraphandReactItemBaseProps<T> & { | ||
errors: GraphandValidationError[]; | ||
onChange: (v: T) => void; | ||
id: string; | ||
inputRef: React.MutableRefObject<any>; | ||
model: typeof GraphandModel; | ||
}; | ||
export declare type ViewComponentProps<T extends any = any> = GraphandReactItemBaseProps<T> & {}; | ||
declare module "graphand-js" { | ||
@@ -43,4 +44,4 @@ class GraphandModel { | ||
class GraphandField { | ||
static InputComponent?: React.Component<InputComponentProps, any> | React.FunctionComponent<InputComponentProps>; | ||
static ViewComponent?: React.Component<InputComponentProps, any> | React.FunctionComponent<InputComponentProps>; | ||
static InputComponent?: React.FunctionComponent<InputComponentProps> | React.Component<InputComponentProps, any>; | ||
static ViewComponent?: React.FunctionComponent<InputComponentProps> | React.Component<InputComponentProps, any>; | ||
parseFormSubmit: any; | ||
@@ -52,3 +53,8 @@ renderInput: any; | ||
export declare type GraphandPluginReactOpts = { | ||
fields: any; | ||
fields: { | ||
[fieldType in DataFieldTypes]?: { | ||
input?: React.FunctionComponent<InputComponentProps> | React.ComponentClass<InputComponentProps, any>; | ||
view?: React.FunctionComponent<ViewComponentProps> | React.ComponentClass<ViewComponentProps, any>; | ||
}; | ||
}; | ||
}; | ||
@@ -55,0 +61,0 @@ declare class GraphandPluginReact extends GraphandPlugin<GraphandPluginReactOpts> { |
{ | ||
"name": "graphand-react", | ||
"version": "0.4.20-beta", | ||
"version": "0.4.21-beta", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/pierrecabriere/graphand-react", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
556119
5
2308