@cfinnestad/react-form-builder 1.0.17 → 1.0.19

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.
@@ -145,6 +145,9 @@ export type FieldItem = NamedItem & {
145
145
  value?: string | number | string[] | boolean | File[];
146
146
  errorText?: string;
147
147
  };
148
+ export type Files = {
149
+ [key: string]: File[];
150
+ };
148
151
  export type OptionSubtype = FieldItem & {
149
152
  value?: string | string[];
150
153
  searchableOptionsName?: string;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from '@storybook/react';
3
+ import { FileSubtype } from "../../Items";
4
+ declare const meta: {
5
+ title: string;
6
+ component: ({ Items, SetItems, Options }: import("../../../Render/Render").RenderProps) => import("react").JSX.Element;
7
+ tags: string[];
8
+ argTypes: {
9
+ Items: FileSubtype[];
10
+ };
11
+ };
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+ export declare const Basic: Story;
15
+ export declare const HelperText: Story;
16
+ export declare const Required: Story;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { FileProps } from "../../Items";
3
+ export declare const FileEdit: ({ item, options, errorHandler }: FileProps) => React.JSX.Element;
4
+ export default FileEdit;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { FileProps } from '../../Items';
3
+ declare function FileST({ item, options }: FileProps): React.JSX.Element;
4
+ export default FileST;
@@ -0,0 +1,5 @@
1
+ import { Accept } from "react-dropzone";
2
+ export declare const FileTypes: Accept;
3
+ export declare const getFilesTypes: (types: string[] | undefined) => Accept | undefined;
4
+ export declare const isValidType: (type: string) => boolean;
5
+ export declare const getExtensions: (fileTypes: string[]) => string[];
@@ -0,0 +1,3 @@
1
+ import { FieldItem, Options } from "../../Items";
2
+ declare const FileValidate: (item: FieldItem, options: Options) => boolean;
3
+ export default FileValidate;
@@ -0,0 +1,3 @@
1
+ export { default as FileST } from './FileST';
2
+ export { default as FileEdit } from '../File/FileEdit';
3
+ export { default as FileValidate } from './FileValidate';
@@ -1,5 +1,5 @@
1
1
  import { Dispatch, SetStateAction, JSX } from 'react';
2
- import { AnyItem, Option, AllowedItems, AllowedSubtypes } from "../Items";
2
+ import { AnyItem, Option, AllowedItems, AllowedSubtypes, Files } from "../Items";
3
3
  import { ErrorType } from "../Errors/Errors";
4
4
  import { Theme } from "@mui/material/styles";
5
5
  import { SubmitButtonProps } from "../Items";
@@ -29,8 +29,8 @@ export type RenderOptions = {
29
29
  submitColors?: string[];
30
30
  };
31
31
  declare const Render: ({ Items, SetItems, Options }: RenderProps) => JSX.Element;
32
- export declare const RenderedObject: (items: AnyItem[]) => {};
33
- export declare const RenderedFlatObject: (items: AnyItem[]) => {};
34
- export declare const RenderedArray: (items: AnyItem[]) => {} | [];
35
- export declare const RenderedFlatArray: (items: AnyItem[]) => object[];
32
+ export declare const RenderedObject: (items: AnyItem[], files?: Files) => {};
33
+ export declare const RenderedFlatObject: (items: AnyItem[], files?: Files) => {};
34
+ export declare const RenderedArray: (items: AnyItem[], files?: Files) => {} | [];
35
+ export declare const RenderedFlatArray: (items: AnyItem[], files?: Files) => object[];
36
36
  export default Render;