formik-form-components 0.2.12 → 0.2.14

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/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { ReactElement, ReactNode, ElementType, SetStateAction } from 'react';
2
+ import React__default, { ReactElement, ReactNode, SyntheticEvent, ElementType, SetStateAction } from 'react';
3
3
  import { FormikValues, FormikConfig, FormikProps } from 'formik';
4
- import { SxProps, Theme, SelectProps as SelectProps$1, StandardTextFieldProps, SelectChangeEvent, RadioGroupProps, AutocompleteRenderInputParams, AutocompleteRenderOptionState, AutocompleteRenderGroupParams, CheckboxProps, ChipProps, AutocompleteProps, BoxProps } from '@mui/material';
4
+ import { SxProps, Theme, AutocompleteProps, AutocompleteChangeReason, AutocompleteChangeDetails, TextFieldProps, SelectChangeEvent, RadioGroupProps, AutocompleteRenderInputParams, AutocompleteRenderOptionState, AutocompleteRenderGroupParams, CheckboxProps, ChipProps, BoxProps } from '@mui/material';
5
5
  import { Theme as Theme$1 } from '@mui/material/styles';
6
6
  import { SelectProps, SelectChangeEvent as SelectChangeEvent$1 } from '@mui/material/Select';
7
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
8
8
  import { Dayjs } from 'dayjs';
9
9
  import { DatePickerProps } from '@mui/x-date-pickers/DatePicker';
10
- import { DropzoneOptions } from 'react-dropzone';
11
10
  import { IconifyIcon } from '@iconify/react';
11
+ import { DropzoneOptions } from 'react-dropzone';
12
12
 
13
13
  type PickerChangeHandlerContext = {
14
14
  validationError: string | null;
@@ -219,25 +219,28 @@ interface FormProps<T> extends FormikConfig<T> {
219
219
  }
220
220
  declare const Form: <T extends FormikValues>({ children, className, ...props }: FormProps<T>) => ReactElement;
221
221
 
222
- interface Props$5 extends Omit<SelectProps$1, 'name' | 'label' | 'value' | 'onChange' | 'variant'> {
222
+ interface Props$5 extends Omit<AutocompleteProps<string, true, boolean, false, 'div'>, 'renderInput' | 'onChange' | 'value' | 'multiple' | 'freeSolo'> {
223
223
  name: string;
224
224
  freeSolo?: boolean;
225
225
  label?: string;
226
226
  placeholder?: string;
227
227
  options: string[];
228
+ value?: string[];
229
+ onChange?: (event: SyntheticEvent, value: string[], reason: AutocompleteChangeReason, details?: AutocompleteChangeDetails<string>) => void;
228
230
  /** Variant of the input field */
229
- variant?: 'outlined' | 'filled' | 'standard';
231
+ variant?: "outlined" | "filled" | "standard";
230
232
  sx?: SxProps<Theme$1>;
231
233
  formControlSx?: SxProps<Theme$1>;
232
234
  textFieldSx?: SxProps<Theme$1>;
233
235
  chipSx?: SxProps<Theme$1>;
234
236
  errorSx?: SxProps<Theme$1>;
235
237
  }
236
- declare function AppAutoComplete({ placeholder, name, variant, label, options, sx, formControlSx, textFieldSx, chipSx, errorSx }: Props$5): React.JSX.Element;
238
+ declare function AppAutoComplete({ placeholder, name, variant, label, options, value: propValue, onChange: propOnChange, sx, formControlSx, textFieldSx, chipSx, errorSx, }: Props$5): React.JSX.Element;
237
239
 
238
240
  interface CheckboxOption {
239
241
  label: string;
240
242
  name: string;
243
+ value: string | boolean | number;
241
244
  disabled?: boolean;
242
245
  }
243
246
  interface Props$4 {
@@ -270,7 +273,7 @@ interface Props$4 {
270
273
  }
271
274
  declare const AppCheckBox: ({ name, option, label, required, disabled, row, sx, checkboxSx, labelSx, errorSx, containerSx, iconSx, checkedSx, ...rest }: Props$4) => react_jsx_runtime.JSX.Element;
272
275
 
273
- interface Props$3 extends Omit<StandardTextFieldProps, 'variant'> {
276
+ interface Props$3 extends Omit<TextFieldProps, 'variant'> {
274
277
  name: string;
275
278
  label: ReactNode;
276
279
  tagUser?: string;
@@ -489,7 +492,7 @@ interface Props$2 {
489
492
  placeholder?: string;
490
493
  required?: boolean;
491
494
  /** Variant of the input field */
492
- variant?: 'outlined' | 'filled' | 'standard';
495
+ variant?: "outlined" | "filled" | "standard";
493
496
  sx?: SxProps<Theme>;
494
497
  editorSx?: SxProps<Theme>;
495
498
  toolbarSx?: SxProps<Theme>;
@@ -784,6 +787,49 @@ interface AppSimpleUploadFileProps {
784
787
  }
785
788
  declare const AppSimpleUploadFile: React__default.FC<AppSimpleUploadFileProps>;
786
789
 
790
+ interface AppUploadFileProps {
791
+ name: string;
792
+ label?: string;
793
+ multiple?: boolean;
794
+ accept?: string;
795
+ maxFiles?: number;
796
+ maxSize?: number;
797
+ disabled?: boolean;
798
+ sx?: SxProps<Theme>;
799
+ dropZoneSx?: SxProps<Theme>;
800
+ previewSx?: SxProps<Theme>;
801
+ errorSx?: SxProps<Theme>;
802
+ helperTextSx?: SxProps<Theme>;
803
+ onDrop?: (acceptedFiles: File[]) => void;
804
+ onDelete?: () => void;
805
+ }
806
+ declare const AppUploadFile: ({ name, label, multiple, accept, maxFiles, maxSize, disabled, sx, dropZoneSx, previewSx, errorSx, helperTextSx, onDrop: externalOnDrop, onDelete: externalOnDelete, ...rest }: AppUploadFileProps) => react_jsx_runtime.JSX.Element;
807
+
808
+ interface SubmitButtonProps {
809
+ children: React__default.ReactNode;
810
+ loading?: boolean;
811
+ disabled?: boolean;
812
+ fullWidth?: boolean;
813
+ variant?: 'text' | 'outlined' | 'contained';
814
+ color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
815
+ size?: 'small' | 'medium' | 'large';
816
+ startIcon?: React__default.ReactNode;
817
+ endIcon?: React__default.ReactNode;
818
+ sx?: SxProps<Theme>;
819
+ buttonSx?: SxProps<Theme>;
820
+ loadingSx?: SxProps<Theme>;
821
+ disabledSx?: SxProps<Theme>;
822
+ [key: string]: any;
823
+ }
824
+ declare const SubmitButton: ({ children, loading, disabled, fullWidth, variant, color, size, startIcon, endIcon, sx, buttonSx, loadingSx, disabledSx, ...rest }: SubmitButtonProps) => React__default.JSX.Element;
825
+
826
+ type IconifyProps = IconifyIcon | string;
827
+
828
+ interface Props extends BoxProps {
829
+ icon: IconifyProps;
830
+ }
831
+ declare const Iconify: React$1.ForwardRefExoticComponent<Omit<Props, "ref"> & React$1.RefAttributes<SVGElement>>;
832
+
787
833
  interface FileItem extends File {
788
834
  id?: number | string;
789
835
  preview?: string;
@@ -819,41 +865,4 @@ interface UploadProps extends DropzoneOptions {
819
865
  onRemoveAll?: VoidFunction;
820
866
  }
821
867
 
822
- interface AppUploadFilePropTypes extends UploadProps {
823
- name: string;
824
- label?: string;
825
- sx?: SxProps<Theme>;
826
- uploadSx?: SxProps<Theme>;
827
- errorSx?: SxProps<Theme>;
828
- helperTextSx?: SxProps<Theme>;
829
- previewSx?: SxProps<Theme>;
830
- dropZoneSx?: SxProps<Theme>;
831
- }
832
- declare const AppUploadFile: ({ name, sx, uploadSx, errorSx, helperTextSx, previewSx, dropZoneSx, ...rest }: AppUploadFilePropTypes) => react_jsx_runtime.JSX.Element;
833
-
834
- interface SubmitButtonProps {
835
- children: React__default.ReactNode;
836
- loading?: boolean;
837
- disabled?: boolean;
838
- fullWidth?: boolean;
839
- variant?: 'text' | 'outlined' | 'contained';
840
- color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
841
- size?: 'small' | 'medium' | 'large';
842
- startIcon?: React__default.ReactNode;
843
- endIcon?: React__default.ReactNode;
844
- sx?: SxProps<Theme>;
845
- buttonSx?: SxProps<Theme>;
846
- loadingSx?: SxProps<Theme>;
847
- disabledSx?: SxProps<Theme>;
848
- [key: string]: any;
849
- }
850
- declare const SubmitButton: ({ children, loading, disabled, fullWidth, variant, color, size, startIcon, endIcon, sx, buttonSx, loadingSx, disabledSx, ...rest }: SubmitButtonProps) => React__default.JSX.Element;
851
-
852
- type IconifyProps = IconifyIcon | string;
853
-
854
- interface Props extends BoxProps {
855
- icon: IconifyProps;
856
- }
857
- declare const Iconify: React$1.ForwardRefExoticComponent<Omit<Props, "ref"> & React$1.RefAttributes<SVGElement>>;
858
-
859
868
  export { AppAutoComplete, AppAutoCompleter, AppCheckBox, AppDateAndTimePicker, AppDatePicker, AppFormErrorMessage, AppInputField, AppMultiSelector, AppPhoneNoInput, AppRadioGroup, AppRating, AppRichTextEditor, AppSearchableMultiSelector, AppSearchableSelectInput, AppSelectInput, AppSimpleUploadFile, AppSwitch, AppSwitchInput, AppTagsCreator, AppTextArea, AppUploadFile, Form, Iconify, IconifyProps, SubmitButton, UploadProps };