@cfinnestad/react-form-builder 1.0.0 → 1.0.2
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/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Items/Items.d.ts +21 -22
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Items/Items.d.ts +21 -22
- package/dist/index.d.ts +21 -22
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ export type Options = {
|
|
|
20
20
|
SetItem: Dispatch<SetStateAction<AnyItem>>;
|
|
21
21
|
setItems: Dispatch<SetStateAction<AnyItem[]>>;
|
|
22
22
|
setModal?: Dispatch<SetStateAction<boolean>>;
|
|
23
|
-
Mode?:
|
|
23
|
+
Mode?: string;
|
|
24
24
|
getError: (error: string, item: AnyItem) => string | undefined;
|
|
25
25
|
searchableOptions?: {
|
|
26
26
|
[key: string]: (input?: string) => Promise<Option[]> | Option[];
|
|
@@ -48,32 +48,32 @@ export type FilterType = {
|
|
|
48
48
|
export type FieldFilter = FilterType & {
|
|
49
49
|
comparison: '=' | '>' | '>=' | '<' | '<=' | 'in';
|
|
50
50
|
fieldId: string;
|
|
51
|
-
value
|
|
51
|
+
value: string | number | boolean | undefined | (string | number | boolean | undefined)[];
|
|
52
52
|
};
|
|
53
53
|
export declare const isFieldFilter: (filter: FilterType) => filter is FieldFilter;
|
|
54
54
|
export type EqFilter = FieldFilter & {
|
|
55
55
|
comparison: '=';
|
|
56
|
-
value
|
|
56
|
+
value: string | number | boolean | undefined;
|
|
57
57
|
};
|
|
58
58
|
export declare const isEqFilter: (filter: FilterType) => filter is EqFilter;
|
|
59
59
|
export type GtFilter = FieldFilter & {
|
|
60
60
|
comparison: '>';
|
|
61
|
-
value
|
|
61
|
+
value: string | number | boolean | undefined;
|
|
62
62
|
};
|
|
63
63
|
export declare const isGtFilter: (filter: FilterType) => filter is GtFilter;
|
|
64
64
|
export type GteFilter = FieldFilter & {
|
|
65
65
|
comparison: '>=';
|
|
66
|
-
value
|
|
66
|
+
value: string | number | boolean | undefined;
|
|
67
67
|
};
|
|
68
68
|
export declare const isGteFilter: (filter: FilterType) => filter is GteFilter;
|
|
69
69
|
export type LtFilter = FieldFilter & {
|
|
70
70
|
comparison: '<';
|
|
71
|
-
value
|
|
71
|
+
value: string | number | boolean | undefined;
|
|
72
72
|
};
|
|
73
73
|
export declare const isLtFilter: (filter: FilterType) => filter is LtFilter;
|
|
74
74
|
export type LteFilter = FieldFilter & {
|
|
75
75
|
comparison: '<=';
|
|
76
|
-
value
|
|
76
|
+
value: string | number | boolean | undefined;
|
|
77
77
|
};
|
|
78
78
|
export declare const isLteFilter: (filter: FilterType) => filter is LteFilter;
|
|
79
79
|
export type InFilter = FieldFilter & {
|
|
@@ -145,7 +145,6 @@ export type FieldItem = NamedItem & {
|
|
|
145
145
|
errorText?: string;
|
|
146
146
|
};
|
|
147
147
|
export type OptionSubtype = FieldItem & {
|
|
148
|
-
label: string;
|
|
149
148
|
value?: string | string[];
|
|
150
149
|
searchableOptionsName?: string;
|
|
151
150
|
options: Option[];
|
|
@@ -175,7 +174,7 @@ export type AutocompleteSubtype = OptionSubtype & {
|
|
|
175
174
|
noOptionsFound?: string;
|
|
176
175
|
};
|
|
177
176
|
export type TextSubtype = FieldItem & {
|
|
178
|
-
label
|
|
177
|
+
label?: string;
|
|
179
178
|
subtype: 'Text';
|
|
180
179
|
value?: string;
|
|
181
180
|
multiline?: boolean;
|
|
@@ -185,26 +184,26 @@ export type TextSubtype = FieldItem & {
|
|
|
185
184
|
maxLength?: number;
|
|
186
185
|
};
|
|
187
186
|
export type EmailSubtype = FieldItem & {
|
|
188
|
-
label
|
|
187
|
+
label?: string;
|
|
189
188
|
subtype: 'Email';
|
|
190
189
|
value?: string;
|
|
191
190
|
maxLength?: number;
|
|
192
191
|
};
|
|
193
192
|
export type NumberSubtype = FieldItem & {
|
|
194
|
-
label
|
|
193
|
+
label?: string;
|
|
195
194
|
subtype: 'Number';
|
|
196
195
|
value?: number;
|
|
197
196
|
min?: number;
|
|
198
197
|
max?: number;
|
|
199
198
|
};
|
|
200
199
|
export type PhoneSubtype = FieldItem & {
|
|
201
|
-
label
|
|
200
|
+
label?: string;
|
|
202
201
|
subtype: 'Phone';
|
|
203
202
|
value?: string;
|
|
204
203
|
placeholder?: string;
|
|
205
204
|
};
|
|
206
205
|
export type DateSubtype = FieldItem & {
|
|
207
|
-
label
|
|
206
|
+
label?: string;
|
|
208
207
|
subtype: 'Date';
|
|
209
208
|
value?: string;
|
|
210
209
|
defaultToday?: boolean;
|
|
@@ -258,55 +257,55 @@ export type FieldType = ItemType & {
|
|
|
258
257
|
EditFC: (props: FieldProps) => JSX.Element;
|
|
259
258
|
ValidateFC?: (item: FieldItem, options: Options) => boolean;
|
|
260
259
|
};
|
|
261
|
-
export type SelectType = {
|
|
260
|
+
export type SelectType = FieldType & {
|
|
262
261
|
Subtype: SelectSubtype;
|
|
263
262
|
SubtypeFC: (props: SelectProps) => JSX.Element;
|
|
264
263
|
EditFC: (props: SelectProps) => JSX.Element;
|
|
265
264
|
ValidateFC?: (item: SelectSubtype, options: Options) => boolean;
|
|
266
265
|
};
|
|
267
|
-
export type RadioType = {
|
|
266
|
+
export type RadioType = FieldType & {
|
|
268
267
|
Subtype: RadioSubtype;
|
|
269
268
|
SubtypeFC: (props: RadioProps) => JSX.Element;
|
|
270
269
|
EditFC: (props: RadioProps) => JSX.Element;
|
|
271
270
|
ValidateFC?: (item: RadioSubtype, options: Options) => boolean;
|
|
272
271
|
};
|
|
273
|
-
export type CheckboxType = {
|
|
272
|
+
export type CheckboxType = FieldType & {
|
|
274
273
|
Subtype: CheckboxSubtype;
|
|
275
274
|
SubtypeFC: (props: CheckboxProps) => JSX.Element;
|
|
276
275
|
EditFC: (props: CheckboxProps) => JSX.Element;
|
|
277
276
|
ValidateFC?: (item: CheckboxSubtype, options: Options) => boolean;
|
|
278
277
|
};
|
|
279
|
-
export type TextType = {
|
|
278
|
+
export type TextType = FieldType & {
|
|
280
279
|
Subtype: TextSubtype;
|
|
281
280
|
SubtypeFC: (props: TextProps) => JSX.Element;
|
|
282
281
|
EditFC: (props: TextProps) => JSX.Element;
|
|
283
282
|
ValidateFC?: (item: TextSubtype, options: Options) => boolean;
|
|
284
283
|
};
|
|
285
|
-
export type EmailType = {
|
|
284
|
+
export type EmailType = FieldType & {
|
|
286
285
|
Subtype: EmailSubtype;
|
|
287
286
|
SubtypeFC: (props: EmailProps) => JSX.Element;
|
|
288
287
|
EditFC: (props: EmailProps) => JSX.Element;
|
|
289
288
|
ValidateFC?: (item: EmailSubtype, options: Options) => boolean;
|
|
290
289
|
};
|
|
291
|
-
export type NumberType = {
|
|
290
|
+
export type NumberType = FieldType & {
|
|
292
291
|
Subtype: NumberSubtype;
|
|
293
292
|
SubtypeFC: (props: NumberProps) => JSX.Element;
|
|
294
293
|
EditFC: (props: NumberProps) => JSX.Element;
|
|
295
294
|
ValidateFC?: (item: NumberSubtype, options: Options) => boolean;
|
|
296
295
|
};
|
|
297
|
-
export type DateType = {
|
|
296
|
+
export type DateType = FieldType & {
|
|
298
297
|
Subtype: DateSubtype;
|
|
299
298
|
SubtypeFC: (props: DateProps) => JSX.Element;
|
|
300
299
|
EditFC: (props: DateProps) => JSX.Element;
|
|
301
300
|
ValidateFC?: (item: DateSubtype, options: Options) => boolean;
|
|
302
301
|
};
|
|
303
|
-
export type BooleanType = {
|
|
302
|
+
export type BooleanType = FieldType & {
|
|
304
303
|
Subtype: BooleanSubtype;
|
|
305
304
|
SubtypeFC: (props: BooleanProps) => JSX.Element;
|
|
306
305
|
EditFC: (props: BooleanProps) => JSX.Element;
|
|
307
306
|
ValidateFC?: (item: BooleanSubtype, options: Options) => boolean;
|
|
308
307
|
};
|
|
309
|
-
export type AutocompleteType = {
|
|
308
|
+
export type AutocompleteType = FieldType & {
|
|
310
309
|
Subtype: AutocompleteSubtype;
|
|
311
310
|
SubtypeFC: (props: AutocompleteProps) => JSX.Element;
|
|
312
311
|
EditFC: (props: AutocompleteProps) => JSX.Element;
|