@opengov/form-renderer 0.0.1 → 0.0.6
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/dist/FormProvider.d.ts +19 -0
- package/dist/LayoutContext.d.ts +14 -0
- package/dist/fields/CalculatedNumber.d.ts +3 -0
- package/dist/fields/Checkbox.d.ts +3 -0
- package/dist/fields/DateInput.d.ts +3 -0
- package/dist/fields/FormFieldLabel.d.ts +8 -0
- package/dist/fields/NumberInput.d.ts +3 -0
- package/dist/fields/Select.d.ts +7 -0
- package/dist/fields/TextInput.d.ts +4 -0
- package/dist/fields/types.d.ts +8 -0
- package/dist/index.d.ts +10 -0
- package/dist/lib.js +8523 -1862
- package/dist/lib.umd.cjs +77 -40
- package/dist/stories/Compound.d.ts +0 -0
- package/dist/stories/FormRenderer.stories.d.ts +5 -12
- package/dist/stories/WithDefaultValues.d.ts +0 -0
- package/package.json +26 -7
- package/dist/src/index.d.ts +0 -1
- /package/dist/{src/index.test.d.ts → index.test.d.ts} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LayoutState } from './LayoutContext';
|
|
3
|
+
import { SxProps } from '@mui/material';
|
|
4
|
+
interface FormShellProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
onSubmit: (data: any) => void;
|
|
7
|
+
layout?: LayoutState;
|
|
8
|
+
sx?: SxProps;
|
|
9
|
+
}
|
|
10
|
+
export declare function FormShell({ children, onSubmit, layout, sx }: FormShellProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
interface FormProviderProps {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
onSubmit?: (data: any) => void;
|
|
14
|
+
layout?: LayoutState;
|
|
15
|
+
formOptions?: any;
|
|
16
|
+
sx?: SxProps;
|
|
17
|
+
}
|
|
18
|
+
declare function FormProvider({ children, onSubmit, layout, formOptions, sx }: FormProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default FormProvider;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
export interface LayoutState {
|
|
3
|
+
}
|
|
4
|
+
interface FormLayoutContextProps {
|
|
5
|
+
layout: LayoutState;
|
|
6
|
+
}
|
|
7
|
+
declare const FormLayoutContext: React.Context<FormLayoutContextProps | undefined>;
|
|
8
|
+
interface FormLayoutProviderProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
layout?: LayoutState;
|
|
11
|
+
}
|
|
12
|
+
export declare const FormLayoutProvider: React.FC<FormLayoutProviderProps>;
|
|
13
|
+
export declare const useFormLayout: () => LayoutState;
|
|
14
|
+
export default FormLayoutContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface FormFieldLabelProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
internal: boolean;
|
|
4
|
+
required: boolean;
|
|
5
|
+
helpText?: string;
|
|
6
|
+
}
|
|
7
|
+
export default function FormFieldLabel({ children, internal, required, helpText }: FormFieldLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GeneralInputProps } from './types';
|
|
2
|
+
export default function SelectInput({ name, label, options, sx, disabled, rules, ...rest }: GeneralInputProps & {
|
|
3
|
+
options: Array<{
|
|
4
|
+
displayValue: string;
|
|
5
|
+
key: string;
|
|
6
|
+
}>;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as Checkbox } from './fields/Checkbox';
|
|
2
|
+
import { default as DateInput } from './fields/DateInput';
|
|
3
|
+
import { default as TextInput } from './fields/TextInput';
|
|
4
|
+
import { default as NumberInput } from './fields/NumberInput';
|
|
5
|
+
import { default as CalculatedNumberInput } from './fields/CalculatedNumber';
|
|
6
|
+
import { default as Select } from './fields/Select';
|
|
7
|
+
import { default as FormFieldLabel } from './fields/FormFieldLabel';
|
|
8
|
+
import { default as FormProvider } from './FormProvider';
|
|
9
|
+
export { FormProvider, FormFieldLabel, Checkbox, DateInput, TextInput, NumberInput, CalculatedNumberInput, Select };
|
|
10
|
+
export default function FormRenderer(): import("react/jsx-runtime").JSX.Element;
|