@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;
package/dist/index.d.ts CHANGED
@@ -159,6 +159,9 @@ type FieldItem = NamedItem & {
159
159
  value?: string | number | string[] | boolean | File[];
160
160
  errorText?: string;
161
161
  };
162
+ type Files = {
163
+ [key: string]: File[];
164
+ };
162
165
  type OptionSubtype = FieldItem & {
163
166
  value?: string | string[];
164
167
  searchableOptionsName?: string;
@@ -518,9 +521,9 @@ type RenderOptions = {
518
521
  submitColors?: string[];
519
522
  };
520
523
  declare const Render: ({ Items, SetItems, Options }: RenderProps) => JSX.Element;
521
- declare const RenderedObject: (items: AnyItem[]) => {};
522
- declare const RenderedFlatObject: (items: AnyItem[]) => {};
523
- declare const RenderedArray: (items: AnyItem[]) => {} | [];
524
- declare const RenderedFlatArray: (items: AnyItem[]) => object[];
524
+ declare const RenderedObject: (items: AnyItem[], files?: Files) => {};
525
+ declare const RenderedFlatObject: (items: AnyItem[], files?: Files) => {};
526
+ declare const RenderedArray: (items: AnyItem[], files?: Files) => {} | [];
527
+ declare const RenderedFlatArray: (items: AnyItem[], files?: Files) => object[];
525
528
 
526
- export { AllowedItems, AllowedSubtypes, AndFilter, AnyFieldType, AnyItem, AutocompleteProps, AutocompleteSubtype, AutocompleteType, BaseItem, BaseItemProps, BooleanProps, BooleanSubtype, BooleanType, BuildErrors, Builder, BuilderProps, BuilderUseOptions, CheckboxProps, CheckboxSubtype, CheckboxType, Clear, ComparisonFilter, DateProps, DateSubtype, DateType, EmailProps, EmailSubtype, EmailType, EqFilter, ErrorType, Errors, FieldFilter, FieldItem, FieldProps, FieldType, FileProps, FileSubtype, FileType, FilterType, GetNamedItem as GetItem, GroupItem, GroupProps, GroupType, GtFilter, GteFilter, HTMLItem, HTMLProps, HTMLType, HiddenItem, HiddenProps, HiddenType, InFilter, ItemProps, ItemType, LtFilter, LteFilter, MultiplesSubtype, NamedItem, NotFilter, NumberProps, NumberSubtype, NumberType, Option, OptionSubtype, Options, OrFilter, PhoneProps, PhoneSubtype, PhoneType, Preview, RadioProps, RadioSubtype, RadioType, Render, RenderOptions, RenderProps, RenderedArray, RenderedFlatArray, RenderedFlatObject, RenderedObject, Save, SelectProps, SelectSubtype, SelectType, UpdateItemInItems as SetItem, SubmitButtonElement, SubmitButtonProps, SubmitItem, SubmitProps, SubmitType, TextProps, TextSubtype, TextType, Transfer, ValidateFields, getSiblingItems, hasFiles, isAndFilter, isAutocomplete, isBoolean, isCheckbox, isComparisonFilter, isDate, isEmail, isEqFilter, isField, isFieldFilter, isFile, isGroup, isGtFilter, isGteFilter, isHidden, isHtml, isInFilter, isLtFilter, isLteFilter, isNamed, isNotFilter, isNumber, isOption, isOrFilter, isPhone, isRadio, isSelect, isSubmit, isText, validateNameChange };
529
+ export { AllowedItems, AllowedSubtypes, AndFilter, AnyFieldType, AnyItem, AutocompleteProps, AutocompleteSubtype, AutocompleteType, BaseItem, BaseItemProps, BooleanProps, BooleanSubtype, BooleanType, BuildErrors, Builder, BuilderProps, BuilderUseOptions, CheckboxProps, CheckboxSubtype, CheckboxType, Clear, ComparisonFilter, DateProps, DateSubtype, DateType, EmailProps, EmailSubtype, EmailType, EqFilter, ErrorType, Errors, FieldFilter, FieldItem, FieldProps, FieldType, FileProps, FileSubtype, FileType, Files, FilterType, GetNamedItem as GetItem, GroupItem, GroupProps, GroupType, GtFilter, GteFilter, HTMLItem, HTMLProps, HTMLType, HiddenItem, HiddenProps, HiddenType, InFilter, ItemProps, ItemType, LtFilter, LteFilter, MultiplesSubtype, NamedItem, NotFilter, NumberProps, NumberSubtype, NumberType, Option, OptionSubtype, Options, OrFilter, PhoneProps, PhoneSubtype, PhoneType, Preview, RadioProps, RadioSubtype, RadioType, Render, RenderOptions, RenderProps, RenderedArray, RenderedFlatArray, RenderedFlatObject, RenderedObject, Save, SelectProps, SelectSubtype, SelectType, UpdateItemInItems as SetItem, SubmitButtonElement, SubmitButtonProps, SubmitItem, SubmitProps, SubmitType, TextProps, TextSubtype, TextType, Transfer, ValidateFields, getSiblingItems, hasFiles, isAndFilter, isAutocomplete, isBoolean, isCheckbox, isComparisonFilter, isDate, isEmail, isEqFilter, isField, isFieldFilter, isFile, isGroup, isGtFilter, isGteFilter, isHidden, isHtml, isInFilter, isLtFilter, isLteFilter, isNamed, isNotFilter, isNumber, isOption, isOrFilter, isPhone, isRadio, isSelect, isSubmit, isText, validateNameChange };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfinnestad/react-form-builder",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "FormBuilder and FormRender Component library for building and gathering custom form data",
5
5
  "scripts": {
6
6
  "rollup": "rollup -c",