@opengov/form-renderer 0.0.39 → 0.0.41-config-beta.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.
@@ -0,0 +1,13 @@
1
+ import { GeneralInputProps } from '../types';
2
+ import { FieldTemplate, FieldConfiguration } from '../../renderer/types';
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;
@@ -0,0 +1,3 @@
1
+ import { TypeConfig } from '../../renderer/types';
2
+ declare const calculatedNumberConfiguration: TypeConfig;
3
+ export default calculatedNumberConfiguration;
@@ -1,3 +1,4 @@
1
1
  import { GeneralInputProps } from '../types';
2
- declare function CheckboxInput({ name, label, sx, disabled, rules, ...rest }: GeneralInputProps): import("react/jsx-runtime").JSX.Element;
3
- export default CheckboxInput;
2
+ export default function CheckboxInput({ name, label, sx, disabled, rules, ...rest }: GeneralInputProps & {
3
+ readonly?: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { TypeConfig } from '../../renderer/types';
2
+ declare const checkboxConfiguration: TypeConfig;
3
+ export default checkboxConfiguration;
@@ -0,0 +1,3 @@
1
+ import { TypeConfig, DateConfiguration } from '../../renderer/types';
2
+ declare const dateConfiguration: TypeConfig<DateConfiguration>;
3
+ export default dateConfiguration;
@@ -3,7 +3,8 @@ import { DateConstraints, DateFormat } from '../../renderer/types';
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;
@@ -0,0 +1,8 @@
1
+ import { GeneralInputProps } from '../types';
2
+ export default function DropdownInput({ name, label, options, sx, disabled, rules, readonly, }: GeneralInputProps & {
3
+ options?: Array<{
4
+ displayValue: string;
5
+ key: string;
6
+ }>;
7
+ readonly?: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { TypeConfig } from '../../renderer/types';
2
+ declare const dropdownConfiguration: TypeConfig;
3
+ export default dropdownConfiguration;
@@ -7,6 +7,7 @@ interface FormFieldLabelProps {
7
7
  readonly?: boolean;
8
8
  deleted?: boolean;
9
9
  formula?: string;
10
+ isSection?: boolean;
10
11
  }
11
- export default function FormFieldLabel({ children, internal, required, helpText, isCalculated, readonly, deleted, formula, }: FormFieldLabelProps): import("react/jsx-runtime").JSX.Element;
12
+ export default function FormFieldLabel({ children, internal, required, helpText, isCalculated, readonly, deleted, formula, isSection, }: FormFieldLabelProps): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -1,4 +1,5 @@
1
1
  import { SxProps } from '@mui/material';
2
+ import { DateFormat } from '../../renderer/types';
2
3
  interface NonEditableProps {
3
4
  name: string;
4
5
  type: string;
@@ -6,6 +7,11 @@ interface NonEditableProps {
6
7
  asHTML?: boolean;
7
8
  sx?: SxProps;
8
9
  rules?: any;
10
+ options?: {
11
+ key: string;
12
+ displayValue: string;
13
+ }[];
14
+ dateFormat?: DateFormat;
9
15
  }
10
- export default function NonEditable({ name, type, label, asHTML, sx, rules }: 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;
11
17
  export {};
@@ -0,0 +1,3 @@
1
+ import { TypeConfig, NumberConfiguration } from '../../renderer/types';
2
+ declare const numberConfiguration: TypeConfig<NumberConfiguration>;
3
+ export default numberConfiguration;
@@ -0,0 +1,5 @@
1
+ import { TextFieldProps } from '@mui/material';
2
+ import { GeneralInputProps } from '../types';
3
+ export default function NumberInput(props: Omit<GeneralInputProps & TextFieldProps, 'type'> & {
4
+ readonly?: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { TypeConfig, TextConfiguration } from '../../renderer/types';
2
+ declare const textConfiguration: TypeConfig<TextConfiguration>;
3
+ export default textConfiguration;
@@ -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 { FieldRenders, FieldTemplate } from '../renderer/types';
1
+ import { FieldTemplate, FieldTypes } from '../renderer/types';
2
2
  export declare const defaultRules: (field: FieldTemplate) => {
3
3
  required: {
4
- value: boolean | undefined;
4
+ value: boolean;
5
5
  message: string;
6
6
  };
7
7
  };
8
- declare const defaultFields: FieldRenders;
9
- export default defaultFields;
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
- import { default as Checkbox } from './fields/Checkbox/Checkbox';
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';
2
+ import { default as CheckboxInput } from './fields/Checkbox/Checkbox';
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
+ 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 defaultFields, defaultRules } from './fields/defaultFields';
12
- export { FormProvider, Renderer, FormFieldLabel, Checkbox, DateInput, TextInput, NumberInput, CalculatedNumberInput, Select, NonEditableField, defaultFields, defaultRules, };
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;