@opengov/form-renderer 0.0.41 → 0.0.43
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/fields/CalculatedNumber/CalculatedNumber.d.ts +13 -0
- package/dist/fields/CalculatedNumber/CalculatedNumberConfig.d.ts +3 -0
- package/dist/fields/Checkbox/Checkbox.d.ts +3 -1
- package/dist/fields/Checkbox/CheckboxConfig.d.ts +3 -0
- package/dist/fields/DateInput/DateConfig.d.ts +3 -0
- package/dist/fields/DateInput/DateInput.d.ts +3 -2
- package/dist/fields/Dropdown/Dropdown.d.ts +4 -5
- package/dist/fields/Dropdown/DropdownConfig.d.ts +3 -0
- package/dist/fields/NonEditableField/NonEditableField.d.ts +3 -1
- package/dist/fields/Number/NumberConfig.d.ts +3 -0
- package/dist/fields/Number/NumberInput.d.ts +5 -0
- package/dist/fields/Text/TextConfig.d.ts +3 -0
- package/dist/fields/Text/TextInput.d.ts +6 -0
- package/dist/fields/defaultFields.d.ts +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/lib.js +7724 -7686
- package/dist/lib.umd.cjs +74 -74
- package/dist/renderer/FormProvider.d.ts +3 -4
- package/dist/renderer/context/FormRendererContext.d.ts +93 -9
- package/dist/renderer/index.d.ts +1 -1
- package/dist/renderer/types.d.ts +3 -84
- package/dist/stories/basicTemplate.d.ts +1 -1
- package/dist/stories/complexTemplate.d.ts +1 -1
- package/dist/utils/TestWrapper.d.ts +1 -1
- package/package.json +2 -1
- package/dist/fields/CalculatedNumber.d.ts +0 -7
- package/dist/fields/NumberInput.d.ts +0 -3
- package/dist/fields/TextInput.d.ts +0 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GeneralInputProps } from '../types';
|
|
2
|
+
import { FieldTemplate, FieldConfiguration } from '@opengov/form-utils';
|
|
3
|
+
export declare function CalculatedNumberInput({ name, label, sx }: GeneralInputProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function CalculationWithFormula({ template, readonly }: {
|
|
5
|
+
template: FieldTemplate;
|
|
6
|
+
readonly?: boolean;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default function CalculatedNumber({ template, disabled, readonly, }: {
|
|
9
|
+
template: FieldTemplate;
|
|
10
|
+
config: FieldConfiguration;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { GeneralInputProps } from '../types';
|
|
2
|
-
export default function CheckboxInput({ name, label, sx, disabled, rules, ...rest }: GeneralInputProps
|
|
2
|
+
export default function CheckboxInput({ name, label, sx, disabled, rules, ...rest }: GeneralInputProps & {
|
|
3
|
+
readonly?: boolean;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { GeneralInputProps } from '../types';
|
|
2
|
-
import { DateConstraints, DateFormat } from '
|
|
2
|
+
import { DateConstraints, DateFormat } from '@opengov/form-utils';
|
|
3
3
|
interface DateInputProps extends GeneralInputProps {
|
|
4
4
|
constraints?: DateConstraints;
|
|
5
5
|
dateFormat?: DateFormat;
|
|
6
|
+
readonly?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const shouldDisableDate: (date: Date, constraints: DateConstraints) => boolean;
|
|
8
|
-
declare function DateInput({ name, rules, sx, constraints, ...rest }: DateInputProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function DateInput({ name, rules, sx, constraints, dateFormat, ...rest }: DateInputProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export default DateInput;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GeneralInputProps } from '../types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}>;
|
|
2
|
+
import { DropdownOption } from '@opengov/form-utils';
|
|
3
|
+
export default function DropdownInput({ name, label, options, sx, disabled, rules, readonly, }: GeneralInputProps & {
|
|
4
|
+
options?: DropdownOption[];
|
|
5
|
+
readonly?: boolean;
|
|
7
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SxProps } from '@mui/material';
|
|
2
|
+
import { DateFormat } from '@opengov/form-utils';
|
|
2
3
|
interface NonEditableProps {
|
|
3
4
|
name: string;
|
|
4
5
|
type: string;
|
|
@@ -10,6 +11,7 @@ interface NonEditableProps {
|
|
|
10
11
|
key: string;
|
|
11
12
|
displayValue: string;
|
|
12
13
|
}[];
|
|
14
|
+
dateFormat?: DateFormat;
|
|
13
15
|
}
|
|
14
|
-
export default function NonEditable({ name, type, label, asHTML, sx, rules, options }: NonEditableProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default function NonEditable({ name, type, label, asHTML, sx, rules, options, dateFormat, }: NonEditableProps): import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TextFieldProps } from '@mui/material';
|
|
2
|
+
import { GeneralInputProps } from '../types';
|
|
3
|
+
declare function TextInput({ name, label, rules, sx, ...rest }: GeneralInputProps & TextFieldProps & {
|
|
4
|
+
readonly?: boolean;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default TextInput;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldTemplate, FieldTypes } from '@opengov/form-utils';
|
|
2
2
|
export declare const defaultRules: (field: FieldTemplate) => {
|
|
3
3
|
required: {
|
|
4
4
|
value: boolean;
|
|
5
5
|
message: string;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
8
|
+
declare const defaultFieldTypes: FieldTypes[];
|
|
9
|
+
export default defaultFieldTypes;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { default as DateInput } from './fields/DateInput/DateInput';
|
|
2
2
|
import { default as CheckboxInput } from './fields/Checkbox/Checkbox';
|
|
3
|
-
import { default as TextInput } from './fields/TextInput';
|
|
4
|
-
import { default as NumberInput } from './fields/NumberInput';
|
|
5
|
-
import { default as
|
|
3
|
+
import { default as TextInput } from './fields/Text/TextInput';
|
|
4
|
+
import { default as NumberInput } from './fields/Number/NumberInput';
|
|
5
|
+
import { default as CalculatedNumber } from './fields/CalculatedNumber/CalculatedNumber';
|
|
6
6
|
import { default as DropdownInput } from './fields/Dropdown/Dropdown';
|
|
7
7
|
import { default as NonEditableField } from './fields/NonEditableField/NonEditableField';
|
|
8
8
|
import { default as FormFieldLabel } from './fields/FormFieldLabel';
|
|
9
9
|
import { default as FormProvider } from './renderer/FormProvider';
|
|
10
10
|
import { default as FormRenderer, Renderer } from './renderer';
|
|
11
|
-
import { default as
|
|
12
|
-
export { FormProvider, Renderer, FormFieldLabel, CheckboxInput, DateInput, TextInput, NumberInput,
|
|
11
|
+
import { default as defaultFieldTypes, defaultRules } from './fields/defaultFields';
|
|
12
|
+
export { FormProvider, Renderer, FormFieldLabel, CheckboxInput, DateInput, TextInput, NumberInput, CalculatedNumber, DropdownInput, NonEditableField, defaultFieldTypes, defaultRules, };
|
|
13
13
|
export default FormRenderer;
|