@cfinnestad/react-form-builder 1.0.42 → 1.0.45

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.
Files changed (84) hide show
  1. package/dist/cjs/index.js +2 -2
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/Old/Button.d.ts +28 -28
  4. package/dist/cjs/types/Old/Header.d.ts +12 -12
  5. package/dist/cjs/types/Old/Page.d.ts +3 -3
  6. package/dist/cjs/types/Old/Page.stories.d.ts +13 -13
  7. package/dist/cjs/types/components/Items/Items.d.ts +5 -0
  8. package/dist/cjs/types/components/Items/SetItem.d.ts +3 -3
  9. package/dist/cjs/types/components/Items/ShowItems.d.ts +10 -10
  10. package/dist/cjs/types/components/Items/Subtypes/Boolean/BooleanField.d.ts +4 -4
  11. package/dist/cjs/types/components/Items/Subtypes/Checkbox/CheckboxField.d.ts +4 -4
  12. package/dist/cjs/types/components/Items/Subtypes/Email/Email.d.ts +4 -4
  13. package/dist/cjs/types/components/Items/Subtypes/Radio/RadioField.d.ts +4 -4
  14. package/dist/cjs/types/components/Items/Subtypes/Select/Select.d.ts +4 -4
  15. package/dist/cjs/types/components/Items/Subtypes/Text/Text.d.ts +4 -4
  16. package/dist/cjs/types/components/Render/Render.d.ts +2 -1
  17. package/dist/cjs/types/components/Template/Template.d.ts +9 -9
  18. package/dist/cjs/types/components/Template/index.d.ts +1 -1
  19. package/dist/cjs/types/components/UpdateItem/UpdateItem.d.ts +9 -9
  20. package/dist/cjs/types/components/UpdateItem/index.d.ts +1 -1
  21. package/dist/cjs/types/src/components/Actions/Actions.d.ts +10 -10
  22. package/dist/cjs/types/src/components/Actions/Clear/Clear.d.ts +3 -3
  23. package/dist/cjs/types/src/components/Actions/Save/Save.d.ts +3 -3
  24. package/dist/cjs/types/src/components/Actions/Transfer/Transfer.d.ts +3 -3
  25. package/dist/cjs/types/src/components/Builder/Builder.d.ts +22 -22
  26. package/dist/cjs/types/src/components/Builder/Builder.stories.d.ts +22 -22
  27. package/dist/cjs/types/src/components/Builder/index.d.ts +1 -1
  28. package/dist/cjs/types/src/components/Items/DefaultItems.d.ts +7 -7
  29. package/dist/cjs/types/src/components/Items/Field/Field.d.ts +4 -4
  30. package/dist/cjs/types/src/components/Items/Group/Group.d.ts +3 -3
  31. package/dist/cjs/types/src/components/Items/Hidden/Hidden.d.ts +3 -3
  32. package/dist/cjs/types/src/components/Items/Html/Html.d.ts +3 -3
  33. package/dist/cjs/types/src/components/Items/Items.d.ts +141 -141
  34. package/dist/cjs/types/src/components/Items/SetItem.d.ts +3 -3
  35. package/dist/cjs/types/src/components/Items/ShowItems.d.ts +6 -6
  36. package/dist/cjs/types/src/components/Items/ShowTypes.d.ts +6 -6
  37. package/dist/cjs/types/src/components/Items/Subtypes/DefaultSubTypes.d.ts +6 -6
  38. package/dist/cjs/types/src/components/Items/Subtypes/Text/Text.d.ts +4 -4
  39. package/dist/cjs/types/src/components/UpdateItem/UpdateItem.d.ts +9 -9
  40. package/dist/cjs/types/src/components/index.d.ts +1 -1
  41. package/dist/cjs/types/src/index.d.ts +1 -1
  42. package/dist/esm/index.js +3 -3
  43. package/dist/esm/index.js.map +1 -1
  44. package/dist/esm/types/Old/Button.d.ts +28 -28
  45. package/dist/esm/types/Old/Header.d.ts +12 -12
  46. package/dist/esm/types/Old/Page.d.ts +3 -3
  47. package/dist/esm/types/Old/Page.stories.d.ts +13 -13
  48. package/dist/esm/types/components/Items/Items.d.ts +5 -0
  49. package/dist/esm/types/components/Items/SetItem.d.ts +3 -3
  50. package/dist/esm/types/components/Items/ShowItems.d.ts +10 -10
  51. package/dist/esm/types/components/Items/Subtypes/Boolean/BooleanField.d.ts +4 -4
  52. package/dist/esm/types/components/Items/Subtypes/Checkbox/CheckboxField.d.ts +4 -4
  53. package/dist/esm/types/components/Items/Subtypes/Email/Email.d.ts +4 -4
  54. package/dist/esm/types/components/Items/Subtypes/Radio/RadioField.d.ts +4 -4
  55. package/dist/esm/types/components/Items/Subtypes/Select/Select.d.ts +4 -4
  56. package/dist/esm/types/components/Items/Subtypes/Text/Text.d.ts +4 -4
  57. package/dist/esm/types/components/Render/Render.d.ts +2 -1
  58. package/dist/esm/types/components/Template/Template.d.ts +9 -9
  59. package/dist/esm/types/components/Template/index.d.ts +1 -1
  60. package/dist/esm/types/components/UpdateItem/UpdateItem.d.ts +9 -9
  61. package/dist/esm/types/components/UpdateItem/index.d.ts +1 -1
  62. package/dist/esm/types/src/components/Actions/Actions.d.ts +10 -10
  63. package/dist/esm/types/src/components/Actions/Clear/Clear.d.ts +3 -3
  64. package/dist/esm/types/src/components/Actions/Save/Save.d.ts +3 -3
  65. package/dist/esm/types/src/components/Actions/Transfer/Transfer.d.ts +3 -3
  66. package/dist/esm/types/src/components/Builder/Builder.d.ts +22 -22
  67. package/dist/esm/types/src/components/Builder/Builder.stories.d.ts +22 -22
  68. package/dist/esm/types/src/components/Builder/index.d.ts +1 -1
  69. package/dist/esm/types/src/components/Items/DefaultItems.d.ts +7 -7
  70. package/dist/esm/types/src/components/Items/Field/Field.d.ts +4 -4
  71. package/dist/esm/types/src/components/Items/Group/Group.d.ts +3 -3
  72. package/dist/esm/types/src/components/Items/Hidden/Hidden.d.ts +3 -3
  73. package/dist/esm/types/src/components/Items/Html/Html.d.ts +3 -3
  74. package/dist/esm/types/src/components/Items/Items.d.ts +141 -141
  75. package/dist/esm/types/src/components/Items/SetItem.d.ts +3 -3
  76. package/dist/esm/types/src/components/Items/ShowItems.d.ts +6 -6
  77. package/dist/esm/types/src/components/Items/ShowTypes.d.ts +6 -6
  78. package/dist/esm/types/src/components/Items/Subtypes/DefaultSubTypes.d.ts +6 -6
  79. package/dist/esm/types/src/components/Items/Subtypes/Text/Text.d.ts +4 -4
  80. package/dist/esm/types/src/components/UpdateItem/UpdateItem.d.ts +9 -9
  81. package/dist/esm/types/src/components/index.d.ts +1 -1
  82. package/dist/esm/types/src/index.d.ts +1 -1
  83. package/dist/index.d.ts +7 -1
  84. package/package.json +106 -106
@@ -1,141 +1,141 @@
1
- import { Dispatch, SetStateAction } from "react";
2
- import { Options } from "../Builder/Builder";
3
- import { AllowedSubtypes } from "./Subtypes/DefaultSubTypes";
4
- export declare const validateItem: (Item: object, index: number) => string[];
5
- export type BaseItem = {
6
- id: string;
7
- type: string;
8
- filter?: GroupFilter;
9
- ClassName?: string;
10
- custom?: {
11
- [key: string]: any;
12
- };
13
- };
14
- export type Filter = {
15
- fieldName: string;
16
- comparison: '=' | '!=' | '>' | '>=' | '<' | '<=' | 'in' | 'not in';
17
- value: string | number | boolean | string[];
18
- };
19
- export type GroupFilter = {
20
- type: 'and' | 'or' | 'not' | 'xor';
21
- filters: (GroupFilter | Filter)[];
22
- };
23
- export type NamedItem = BaseItem & {
24
- name: string;
25
- };
26
- export type Option = {
27
- checked: boolean;
28
- startChecked: boolean;
29
- fieldName: string;
30
- value: string;
31
- };
32
- export type HiddenItem = NamedItem & {
33
- type: 'Hidden';
34
- value: string;
35
- };
36
- export type HTMLItem = BaseItem & {
37
- type: 'HTML';
38
- content: string;
39
- };
40
- export type GroupItem = NamedItem & {
41
- type: 'Group';
42
- label: string;
43
- columns: number;
44
- Items: AnyItem[];
45
- };
46
- export type FieldItem = NamedItem & {
47
- required: boolean;
48
- label: string;
49
- deprecated: boolean;
50
- placeholder?: string;
51
- subtype: AnySubtype;
52
- };
53
- export type FieldSubType = {
54
- subtype: string;
55
- value?: string | number | boolean | string[];
56
- custom?: {
57
- [key: string]: any;
58
- };
59
- };
60
- export type OptionSubtype = FieldSubType & {
61
- value?: string | string[];
62
- options: Option[];
63
- };
64
- export type SelectSubtype = OptionSubtype & {
65
- subtype: 'Select';
66
- value?: string | string[];
67
- multiples: boolean;
68
- };
69
- export type RadioSubtype = OptionSubtype & {
70
- subtype: 'Radio';
71
- value?: string;
72
- inLine?: boolean;
73
- };
74
- export type CheckboxSubtype = OptionSubtype & {
75
- subtype: 'Checkbox';
76
- inLine?: boolean;
77
- };
78
- export type TextSubtype = FieldSubType & {
79
- subtype: 'Text';
80
- value?: string;
81
- multiline?: boolean;
82
- minLength?: number;
83
- maxLength?: number;
84
- };
85
- export type EmailSubtype = FieldSubType & {
86
- subtype: 'Email';
87
- value?: string;
88
- maxLength?: number;
89
- };
90
- export type NumberSubtype = FieldSubType & {
91
- subtype: 'Number';
92
- value?: number;
93
- min?: number;
94
- max?: number;
95
- };
96
- export type DateSubtype = FieldSubType & {
97
- subtype: 'Date';
98
- value?: string;
99
- minDate?: string;
100
- minDateOffsetDays?: number;
101
- maxDate?: string;
102
- maxDateOffsetDays?: number;
103
- };
104
- export type BooleanSubtype = FieldSubType & {
105
- subtype: 'Boolean';
106
- value: boolean;
107
- };
108
- export type AnyItem = BaseItem | FieldItem | GroupItem | HTMLItem | HiddenItem;
109
- export type AnySubtype = FieldSubType | SelectSubtype | RadioSubtype | CheckboxSubtype | TextSubtype | EmailSubtype | NumberSubtype | DateSubtype;
110
- export type ItemType = {
111
- Item: AnyItem;
112
- ItemFC: (props: any) => JSX.Element;
113
- EditFC: (props: any) => JSX.Element;
114
- };
115
- export type FieldType = {
116
- Subtype: AnySubtype;
117
- SubtypeFC: (props: any) => JSX.Element;
118
- EditFC: (props: any) => JSX.Element;
119
- };
120
- export type BaseItemProps = {
121
- Item: AnyItem;
122
- Items: AnyItem[];
123
- ItemFC: (props: any) => JSX.Element;
124
- IsBuild?: boolean;
125
- SetItems: Dispatch<SetStateAction<AnyItem[]>>;
126
- Options: Options;
127
- AllowedSubtypes: AllowedSubtypes;
128
- };
129
- export type FieldProps = BaseItemProps & {
130
- Item: FieldItem;
131
- };
132
- export type GroupProps = BaseItemProps & {
133
- Item: GroupItem;
134
- };
135
- export type HTMLProps = BaseItemProps & {
136
- Item: HTMLItem;
137
- };
138
- export type HiddenProps = BaseItemProps & {
139
- Item: HiddenItem;
140
- };
141
- export type ItemProps = BaseItemProps | FieldProps | GroupProps | HiddenProps | HTMLProps;
1
+ import { Dispatch, SetStateAction } from "react";
2
+ import { Options } from "../Builder/Builder";
3
+ import { AllowedSubtypes } from "./Subtypes/DefaultSubTypes";
4
+ export declare const validateItem: (Item: object, index: number) => string[];
5
+ export type BaseItem = {
6
+ id: string;
7
+ type: string;
8
+ filter?: GroupFilter;
9
+ ClassName?: string;
10
+ custom?: {
11
+ [key: string]: any;
12
+ };
13
+ };
14
+ export type Filter = {
15
+ fieldName: string;
16
+ comparison: '=' | '!=' | '>' | '>=' | '<' | '<=' | 'in' | 'not in';
17
+ value: string | number | boolean | string[];
18
+ };
19
+ export type GroupFilter = {
20
+ type: 'and' | 'or' | 'not' | 'xor';
21
+ filters: (GroupFilter | Filter)[];
22
+ };
23
+ export type NamedItem = BaseItem & {
24
+ name: string;
25
+ };
26
+ export type Option = {
27
+ checked: boolean;
28
+ startChecked: boolean;
29
+ fieldName: string;
30
+ value: string;
31
+ };
32
+ export type HiddenItem = NamedItem & {
33
+ type: 'Hidden';
34
+ value: string;
35
+ };
36
+ export type HTMLItem = BaseItem & {
37
+ type: 'HTML';
38
+ content: string;
39
+ };
40
+ export type GroupItem = NamedItem & {
41
+ type: 'Group';
42
+ label: string;
43
+ columns: number;
44
+ Items: AnyItem[];
45
+ };
46
+ export type FieldItem = NamedItem & {
47
+ required: boolean;
48
+ label: string;
49
+ deprecated: boolean;
50
+ placeholder?: string;
51
+ subtype: AnySubtype;
52
+ };
53
+ export type FieldSubType = {
54
+ subtype: string;
55
+ value?: string | number | boolean | string[];
56
+ custom?: {
57
+ [key: string]: any;
58
+ };
59
+ };
60
+ export type OptionSubtype = FieldSubType & {
61
+ value?: string | string[];
62
+ options: Option[];
63
+ };
64
+ export type SelectSubtype = OptionSubtype & {
65
+ subtype: 'Select';
66
+ value?: string | string[];
67
+ multiples: boolean;
68
+ };
69
+ export type RadioSubtype = OptionSubtype & {
70
+ subtype: 'Radio';
71
+ value?: string;
72
+ inLine?: boolean;
73
+ };
74
+ export type CheckboxSubtype = OptionSubtype & {
75
+ subtype: 'Checkbox';
76
+ inLine?: boolean;
77
+ };
78
+ export type TextSubtype = FieldSubType & {
79
+ subtype: 'Text';
80
+ value?: string;
81
+ multiline?: boolean;
82
+ minLength?: number;
83
+ maxLength?: number;
84
+ };
85
+ export type EmailSubtype = FieldSubType & {
86
+ subtype: 'Email';
87
+ value?: string;
88
+ maxLength?: number;
89
+ };
90
+ export type NumberSubtype = FieldSubType & {
91
+ subtype: 'Number';
92
+ value?: number;
93
+ min?: number;
94
+ max?: number;
95
+ };
96
+ export type DateSubtype = FieldSubType & {
97
+ subtype: 'Date';
98
+ value?: string;
99
+ minDate?: string;
100
+ minDateOffsetDays?: number;
101
+ maxDate?: string;
102
+ maxDateOffsetDays?: number;
103
+ };
104
+ export type BooleanSubtype = FieldSubType & {
105
+ subtype: 'Boolean';
106
+ value: boolean;
107
+ };
108
+ export type AnyItem = BaseItem | FieldItem | GroupItem | HTMLItem | HiddenItem;
109
+ export type AnySubtype = FieldSubType | SelectSubtype | RadioSubtype | CheckboxSubtype | TextSubtype | EmailSubtype | NumberSubtype | DateSubtype;
110
+ export type ItemType = {
111
+ Item: AnyItem;
112
+ ItemFC: (props: any) => JSX.Element;
113
+ EditFC: (props: any) => JSX.Element;
114
+ };
115
+ export type FieldType = {
116
+ Subtype: AnySubtype;
117
+ SubtypeFC: (props: any) => JSX.Element;
118
+ EditFC: (props: any) => JSX.Element;
119
+ };
120
+ export type BaseItemProps = {
121
+ Item: AnyItem;
122
+ Items: AnyItem[];
123
+ ItemFC: (props: any) => JSX.Element;
124
+ IsBuild?: boolean;
125
+ SetItems: Dispatch<SetStateAction<AnyItem[]>>;
126
+ Options: Options;
127
+ AllowedSubtypes: AllowedSubtypes;
128
+ };
129
+ export type FieldProps = BaseItemProps & {
130
+ Item: FieldItem;
131
+ };
132
+ export type GroupProps = BaseItemProps & {
133
+ Item: GroupItem;
134
+ };
135
+ export type HTMLProps = BaseItemProps & {
136
+ Item: HTMLItem;
137
+ };
138
+ export type HiddenProps = BaseItemProps & {
139
+ Item: HiddenItem;
140
+ };
141
+ export type ItemProps = BaseItemProps | FieldProps | GroupProps | HiddenProps | HTMLProps;
@@ -1,3 +1,3 @@
1
- import { AnyItem } from "./Items";
2
- declare const SetItem: (Item: AnyItem, Items: AnyItem[]) => AnyItem[];
3
- export default SetItem;
1
+ import { AnyItem } from "./Items";
2
+ declare const SetItem: (Item: AnyItem, Items: AnyItem[]) => AnyItem[];
3
+ export default SetItem;
@@ -1,6 +1,6 @@
1
- import { ItemProps } from "./Items";
2
- type ShowItemsProps = {
3
- ItemPropsArray: ItemProps[];
4
- };
5
- declare const ShowItems: ({ ItemPropsArray }: ShowItemsProps) => JSX.Element;
6
- export default ShowItems;
1
+ import { ItemProps } from "./Items";
2
+ type ShowItemsProps = {
3
+ ItemPropsArray: ItemProps[];
4
+ };
5
+ declare const ShowItems: ({ ItemPropsArray }: ShowItemsProps) => JSX.Element;
6
+ export default ShowItems;
@@ -1,6 +1,6 @@
1
- import { AllowedItems } from "./DefaultItems";
2
- interface ShowTypesProps {
3
- AllowedItems: AllowedItems;
4
- }
5
- declare const ShowTypes: ({ AllowedItems }: ShowTypesProps) => JSX.Element;
6
- export default ShowTypes;
1
+ import { AllowedItems } from "./DefaultItems";
2
+ interface ShowTypesProps {
3
+ AllowedItems: AllowedItems;
4
+ }
5
+ declare const ShowTypes: ({ AllowedItems }: ShowTypesProps) => JSX.Element;
6
+ export default ShowTypes;
@@ -1,6 +1,6 @@
1
- import { FieldType } from "../Items";
2
- export type AllowedSubtypes = {
3
- [key: string]: FieldType;
4
- };
5
- declare const DefaultSubtypes: () => AllowedSubtypes;
6
- export default DefaultSubtypes;
1
+ import { FieldType } from "../Items";
2
+ export type AllowedSubtypes = {
3
+ [key: string]: FieldType;
4
+ };
5
+ declare const DefaultSubtypes: () => AllowedSubtypes;
6
+ export default DefaultSubtypes;
@@ -1,4 +1,4 @@
1
- import { FieldProps } from "../../Items";
2
- export declare const edit: ({ Item, Items, SetItems }: FieldProps) => JSX.Element;
3
- declare const Text: ({ Item, Items, SetItems, Options }: FieldProps) => JSX.Element;
4
- export default Text;
1
+ import { FieldProps } from "../../Items";
2
+ export declare const edit: ({ Item, Items, SetItems }: FieldProps) => JSX.Element;
3
+ declare const Text: ({ Item, Items, SetItems, Options }: FieldProps) => JSX.Element;
4
+ export default Text;
@@ -1,9 +1,9 @@
1
- import { Dispatch, SetStateAction } from "react";
2
- import { AnyItem } from "../Items/Items";
3
- type UpdateItemProps = {
4
- Item: AnyItem;
5
- Items: AnyItem[];
6
- SetItems: Dispatch<SetStateAction<AnyItem[]>>;
7
- };
8
- declare const UpdateItem: ({ Item, Items, SetItems }: UpdateItemProps) => void;
9
- export default UpdateItem;
1
+ import { Dispatch, SetStateAction } from "react";
2
+ import { AnyItem } from "../Items/Items";
3
+ type UpdateItemProps = {
4
+ Item: AnyItem;
5
+ Items: AnyItem[];
6
+ SetItems: Dispatch<SetStateAction<AnyItem[]>>;
7
+ };
8
+ declare const UpdateItem: ({ Item, Items, SetItems }: UpdateItemProps) => void;
9
+ export default UpdateItem;
@@ -1 +1 @@
1
- export { default as Builder } from './Builder';
1
+ export { default as Builder } from './Builder';
@@ -1 +1 @@
1
- export * from './components';
1
+ export * from './components';