@opengov/form-renderer 0.2.16 → 0.2.18-rules-beta.1

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.
@@ -1,4 +1,2 @@
1
1
  import { GeneralInputProps } from '../types';
2
- export default function CheckboxInput({ name, label, sx, disabled, rules, readonly, ...rest }: GeneralInputProps & {
3
- readonly?: boolean;
4
- }): import("react/jsx-runtime").JSX.Element;
2
+ export default function CheckboxInput({ name, label, sx, disabled, rules, readonly, ...rest }: GeneralInputProps): import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,6 @@ import { DateConstraints, DateFormat } from '@opengov/form-utils';
3
3
  interface DateInputProps extends GeneralInputProps {
4
4
  constraints?: DateConstraints;
5
5
  dateFormat?: DateFormat;
6
- readonly?: boolean;
7
6
  }
8
7
  export declare const shouldDisableDate: (date: Date, constraints: DateConstraints) => boolean;
9
8
  declare function DateInput({ name, rules, sx, constraints, dateFormat, ...rest }: DateInputProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { GeneralInputProps } from '../types';
2
2
  import { DropdownOption } from '@opengov/form-utils';
3
- export default function DropdownInput({ name, label, options, sx, disabled, rules, readonly, }: GeneralInputProps & {
3
+ export interface DropdownInputProps extends GeneralInputProps {
4
4
  options?: DropdownOption[];
5
- readonly?: boolean;
6
- }): import("react/jsx-runtime").JSX.Element;
5
+ }
6
+ export default function DropdownInput({ name, label, options, sx, disabled, rules, readonly, }: DropdownInputProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
- export default function ErrorMessage({ error, id }: {
1
+ export default function ErrorMessage({ error, id, component, }: {
2
2
  error?: string;
3
3
  id?: string;
4
+ component?: 'span' | 'p';
4
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { TextFieldProps } from '@mui/material';
2
2
  import { GeneralInputProps } from '../types';
3
3
  export default function NumberInput(props: Omit<GeneralInputProps & TextFieldProps, 'type'> & {
4
- readonly?: boolean;
5
4
  decimalPlaces?: number;
6
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,5 @@ export type LabelWithChildrenProps = {
6
6
  dataTestId?: string;
7
7
  children: React.ReactNode;
8
8
  sx?: SxProps;
9
- isFormControl?: boolean;
10
9
  };
11
- export default function LabelWithChildren({ label, error, childId, dataTestId, sx, children, isFormControl, }: LabelWithChildrenProps): import("react/jsx-runtime").JSX.Element;
10
+ export default function LabelWithChildren({ label, error, childId, dataTestId, sx, children }: LabelWithChildrenProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,10 @@
1
- import { LabelWithChildrenProps } from './LabelWithChildren';
2
- export default function ReadOnlyField({ label, text, asHTML, sx, error, startAdornment, endAdornment, }: Omit<LabelWithChildrenProps, 'children' | 'childId'> & {
1
+ import { SxProps } from '@mui/material';
2
+ export default function ReadOnlyField({ label, text, asHTML, sx, error, startAdornment, endAdornment, }: {
3
+ label: string | JSX.Element;
3
4
  text?: string;
4
5
  asHTML?: boolean;
6
+ sx?: SxProps;
7
+ error?: string;
5
8
  startAdornment?: React.ReactNode;
6
9
  endAdornment?: React.ReactNode;
7
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,6 @@
1
1
  import { TextFieldProps } from '@mui/material';
2
2
  import { GeneralInputProps } from '../types';
3
- declare function TextInput({ name, label, rules, sx, readonly, maxLength, filter, ...rest }: GeneralInputProps & TextFieldProps & {
4
- readonly?: boolean;
3
+ export default function TextInput({ name, label, rules, sx, readonly, maxLength, filter, ...rest }: GeneralInputProps & TextFieldProps & {
5
4
  maxLength?: number;
6
5
  filter?: (value: string) => string;
7
6
  }): import("react/jsx-runtime").JSX.Element;
8
- export default TextInput;
@@ -1,9 +1,4 @@
1
- import { FieldTemplate, FieldTypes } from '@opengov/form-utils';
2
- export declare const defaultRules: (field: FieldTemplate) => {
3
- required: {
4
- value: boolean;
5
- message: string;
6
- };
7
- };
1
+ import { FieldTemplate, FieldTypes, FieldRules } from '@opengov/form-utils';
2
+ export declare const defaultRules: (field: FieldTemplate) => FieldRules;
8
3
  declare const defaultFieldTypes: FieldTypes[];
9
4
  export default defaultFieldTypes;
@@ -1,8 +1,10 @@
1
1
  import { SxProps } from '@mui/material';
2
+ import { FieldRules } from '@opengov/form-utils';
2
3
  export interface GeneralInputProps {
3
4
  name: string;
4
5
  label: string | JSX.Element;
5
6
  sx?: SxProps;
6
7
  disabled?: boolean;
7
- rules: any;
8
+ readonly?: boolean;
9
+ rules?: FieldRules;
8
10
  }