@react-typed-forms/schemas 9.1.1 → 9.2.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/lib/components/ControlInput.d.ts +9 -0
- package/lib/components/DefaultDisplay.d.ts +9 -0
- package/lib/components/DefaultDisplayOnly.d.ts +11 -0
- package/lib/components/DefaultLayout.d.ts +9 -0
- package/lib/components/DefaultVisibility.d.ts +4 -0
- package/lib/components/RadioRenderer.d.ts +20 -0
- package/lib/components/SelectDataRenderer.d.ts +24 -0
- package/lib/controlRender.d.ts +1 -0
- package/lib/createDefaultRenderers.d.ts +67 -0
- package/lib/createFormRenderer.d.ts +3 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +577 -493
- package/lib/index.js.map +1 -1
- package/lib/renderers.d.ts +3 -115
- package/lib/types.d.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Control } from "@react-typed-forms/core";
|
|
3
|
+
export declare function ControlInput({ control, convert, ...props }: React.InputHTMLAttributes<HTMLInputElement> & {
|
|
4
|
+
control: Control<any>;
|
|
5
|
+
convert: InputConversion;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
type InputConversion = [string, (s: any) => any, (a: any) => string | number];
|
|
8
|
+
export declare function createInputConversion(ft: string): InputConversion;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DisplayRendererProps } from "../controlRender";
|
|
3
|
+
import { DisplayRendererRegistration } from "../renderers";
|
|
4
|
+
export interface DefaultDisplayRendererOptions {
|
|
5
|
+
textClassName?: string;
|
|
6
|
+
htmlClassName?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function createDefaultDisplayRenderer(options?: DefaultDisplayRendererOptions): DisplayRendererRegistration;
|
|
9
|
+
export declare function DefaultDisplay({ data, display, className, style, ...options }: DefaultDisplayRendererOptions & DisplayRendererProps): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Control } from "@react-typed-forms/core";
|
|
2
|
+
import { SchemaField, SchemaInterface } from "../types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
export declare function DefaultDisplayOnly({ control, className, emptyText, schemaInterface, field, style, }: {
|
|
5
|
+
control: Control<any>;
|
|
6
|
+
field: SchemaField;
|
|
7
|
+
schemaInterface: SchemaInterface;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
emptyText?: string | null;
|
|
11
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RenderedLayout } from "../controlRender";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface DefaultLayoutRendererOptions {
|
|
4
|
+
className?: string;
|
|
5
|
+
errorClass?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function DefaultLayout({ errorClass, layout: { controlEnd, controlStart, label, children, errorControl }, }: DefaultLayoutRendererOptions & {
|
|
8
|
+
layout: RenderedLayout;
|
|
9
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { VisibilityRendererProps } from "../controlRender";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export declare function createDefaultVisibilityRenderer(): import("../renderers").VisibilityRendererRegistration;
|
|
4
|
+
export declare function DefaultVisibility({ visibility, children, className, style, divRef, }: VisibilityRendererProps): React.JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Control } from "@react-typed-forms/core";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FieldOption } from "../types";
|
|
4
|
+
export interface RadioRendererOptions {
|
|
5
|
+
className?: string;
|
|
6
|
+
entryClass?: string;
|
|
7
|
+
radioClass?: string;
|
|
8
|
+
labelClass?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function createRadioRenderer(options?: RadioRendererOptions): import("../renderers").DataRendererRegistration;
|
|
11
|
+
export declare function RadioButtons({ control, options, labelClass, radioClass, readonly, entryClass, className, id, }: {
|
|
12
|
+
id?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
options?: FieldOption[] | null;
|
|
15
|
+
control: Control<any>;
|
|
16
|
+
entryClass?: string;
|
|
17
|
+
radioClass?: string;
|
|
18
|
+
labelClass?: string;
|
|
19
|
+
readonly?: boolean;
|
|
20
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Control } from "@react-typed-forms/core";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FieldOption } from "../types";
|
|
4
|
+
export interface SelectRendererOptions {
|
|
5
|
+
className?: string;
|
|
6
|
+
emptyText?: string;
|
|
7
|
+
requiredText?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function createSelectRenderer(options?: SelectRendererOptions): import("../renderers").DataRendererRegistration;
|
|
10
|
+
type SelectConversion = (a: any) => string | number;
|
|
11
|
+
export interface SelectDataRendererProps {
|
|
12
|
+
id?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
options: FieldOption[];
|
|
15
|
+
emptyText?: string;
|
|
16
|
+
requiredText?: string;
|
|
17
|
+
readonly: boolean;
|
|
18
|
+
required: boolean;
|
|
19
|
+
state: Control<any>;
|
|
20
|
+
convert: SelectConversion;
|
|
21
|
+
}
|
|
22
|
+
export declare function SelectDataRenderer({ state, options, className, convert, required, emptyText, requiredText, readonly, ...props }: SelectDataRendererProps): React.JSX.Element;
|
|
23
|
+
export declare function createSelectConversion(ft: string): SelectConversion;
|
|
24
|
+
export {};
|
package/lib/controlRender.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ export interface GroupRendererProps extends ParentRendererProps {
|
|
|
100
100
|
}
|
|
101
101
|
export interface DataRendererProps extends ParentRendererProps {
|
|
102
102
|
renderOptions: RenderOptions;
|
|
103
|
+
definition: DataControlDefinition;
|
|
103
104
|
field: SchemaField;
|
|
104
105
|
id: string;
|
|
105
106
|
control: Control<any>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DefaultDisplayRendererOptions } from "./components/DefaultDisplay";
|
|
2
|
+
import { DefaultLayoutRendererOptions } from "./components/DefaultLayout";
|
|
3
|
+
import { ActionRendererRegistration, AdornmentRendererRegistration, ArrayRendererRegistration, DataRendererRegistration, DefaultRenderers, GroupRendererRegistration, LabelRendererRegistration } from "./renderers";
|
|
4
|
+
import { CSSProperties, ReactElement, ReactNode } from "react";
|
|
5
|
+
import { FieldOption, GridRenderer } from "./types";
|
|
6
|
+
import { SelectRendererOptions } from "./components/SelectDataRenderer";
|
|
7
|
+
import { RadioRendererOptions } from "./components/RadioRenderer";
|
|
8
|
+
export interface DefaultRendererOptions {
|
|
9
|
+
data?: DefaultDataRendererOptions;
|
|
10
|
+
display?: DefaultDisplayRendererOptions;
|
|
11
|
+
action?: DefaultActionRendererOptions;
|
|
12
|
+
array?: DefaultArrayRendererOptions;
|
|
13
|
+
group?: DefaultGroupRendererOptions;
|
|
14
|
+
label?: DefaultLabelRendererOptions;
|
|
15
|
+
adornment?: DefaultAdornmentRendererOptions;
|
|
16
|
+
layout?: DefaultLayoutRendererOptions;
|
|
17
|
+
}
|
|
18
|
+
interface StyleProps {
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
interface DefaultActionRendererOptions {
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function createDefaultActionRenderer(options?: DefaultActionRendererOptions): ActionRendererRegistration;
|
|
26
|
+
interface DefaultArrayRendererOptions {
|
|
27
|
+
className?: string;
|
|
28
|
+
removableClass?: string;
|
|
29
|
+
childClass?: string;
|
|
30
|
+
removableChildClass?: string;
|
|
31
|
+
removeActionClass?: string;
|
|
32
|
+
addActionClass?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function createDefaultArrayRenderer(options?: DefaultArrayRendererOptions): ArrayRendererRegistration;
|
|
35
|
+
interface DefaultGroupRendererOptions {
|
|
36
|
+
className?: string;
|
|
37
|
+
standardClassName?: string;
|
|
38
|
+
gridStyles?: (columns: GridRenderer) => StyleProps;
|
|
39
|
+
gridClassName?: string;
|
|
40
|
+
defaultGridColumns?: number;
|
|
41
|
+
flexClassName?: string;
|
|
42
|
+
defaultFlexGap?: string;
|
|
43
|
+
}
|
|
44
|
+
export declare function createDefaultGroupRenderer(options?: DefaultGroupRendererOptions): GroupRendererRegistration;
|
|
45
|
+
export declare const DefaultBoolOptions: FieldOption[];
|
|
46
|
+
interface DefaultDataRendererOptions {
|
|
47
|
+
inputClass?: string;
|
|
48
|
+
displayOnlyClass?: string;
|
|
49
|
+
selectOptions?: SelectRendererOptions;
|
|
50
|
+
radioOptions?: RadioRendererOptions;
|
|
51
|
+
booleanOptions?: FieldOption[];
|
|
52
|
+
optionRenderer?: DataRendererRegistration;
|
|
53
|
+
}
|
|
54
|
+
export declare function createDefaultDataRenderer(options?: DefaultDataRendererOptions): DataRendererRegistration;
|
|
55
|
+
export interface DefaultAdornmentRendererOptions {
|
|
56
|
+
}
|
|
57
|
+
export declare function createDefaultAdornmentRenderer(options?: DefaultAdornmentRendererOptions): AdornmentRendererRegistration;
|
|
58
|
+
interface DefaultLabelRendererOptions {
|
|
59
|
+
className?: string;
|
|
60
|
+
groupLabelClass?: string;
|
|
61
|
+
controlLabelClass?: string;
|
|
62
|
+
requiredElement?: ReactNode;
|
|
63
|
+
labelContainer?: (children: ReactElement) => ReactElement;
|
|
64
|
+
}
|
|
65
|
+
export declare function createDefaultLabelRenderer(options?: DefaultLabelRendererOptions): LabelRendererRegistration;
|
|
66
|
+
export declare function createDefaultRenderers(options?: DefaultRendererOptions): DefaultRenderers;
|
|
67
|
+
export {};
|
package/lib/index.d.ts
CHANGED
|
@@ -8,3 +8,12 @@ export * from "./tailwind";
|
|
|
8
8
|
export * from "./validators";
|
|
9
9
|
export * from "./hooks";
|
|
10
10
|
export * from "./schemaInterface";
|
|
11
|
+
export * from "./createDefaultRenderers";
|
|
12
|
+
export * from "./createFormRenderer";
|
|
13
|
+
export * from "./components/DefaultDisplay";
|
|
14
|
+
export * from "./components/ControlInput";
|
|
15
|
+
export * from "./components/SelectDataRenderer";
|
|
16
|
+
export * from "./components/RadioRenderer";
|
|
17
|
+
export * from "./components/DefaultLayout";
|
|
18
|
+
export * from "./components/DefaultDisplayOnly";
|
|
19
|
+
export * from "./components/DefaultVisibility";
|