@cfinnestad/react-form-builder 0.3.1 → 1.0.1

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,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: string;
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: string;
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: string;
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: string;
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: string;
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;
package/dist/index.d.ts CHANGED
@@ -158,7 +158,6 @@ type FieldItem = NamedItem & {
158
158
  errorText?: string;
159
159
  };
160
160
  type OptionSubtype = FieldItem & {
161
- label: string;
162
161
  value?: string | string[];
163
162
  searchableOptionsName?: string;
164
163
  options: Option[];
@@ -188,7 +187,7 @@ type AutocompleteSubtype = OptionSubtype & {
188
187
  noOptionsFound?: string;
189
188
  };
190
189
  type TextSubtype = FieldItem & {
191
- label: string;
190
+ label?: string;
192
191
  subtype: 'Text';
193
192
  value?: string;
194
193
  multiline?: boolean;
@@ -198,26 +197,26 @@ type TextSubtype = FieldItem & {
198
197
  maxLength?: number;
199
198
  };
200
199
  type EmailSubtype = FieldItem & {
201
- label: string;
200
+ label?: string;
202
201
  subtype: 'Email';
203
202
  value?: string;
204
203
  maxLength?: number;
205
204
  };
206
205
  type NumberSubtype = FieldItem & {
207
- label: string;
206
+ label?: string;
208
207
  subtype: 'Number';
209
208
  value?: number;
210
209
  min?: number;
211
210
  max?: number;
212
211
  };
213
212
  type PhoneSubtype = FieldItem & {
214
- label: string;
213
+ label?: string;
215
214
  subtype: 'Phone';
216
215
  value?: string;
217
216
  placeholder?: string;
218
217
  };
219
218
  type DateSubtype = FieldItem & {
220
- label: string;
219
+ label?: string;
221
220
  subtype: 'Date';
222
221
  value?: string;
223
222
  defaultToday?: boolean;
@@ -271,55 +270,55 @@ type FieldType = ItemType & {
271
270
  EditFC: (props: FieldProps) => JSX.Element;
272
271
  ValidateFC?: (item: FieldItem, options: Options) => boolean;
273
272
  };
274
- type SelectType = {
273
+ type SelectType = FieldType & {
275
274
  Subtype: SelectSubtype;
276
275
  SubtypeFC: (props: SelectProps) => JSX.Element;
277
276
  EditFC: (props: SelectProps) => JSX.Element;
278
277
  ValidateFC?: (item: SelectSubtype, options: Options) => boolean;
279
278
  };
280
- type RadioType = {
279
+ type RadioType = FieldType & {
281
280
  Subtype: RadioSubtype;
282
281
  SubtypeFC: (props: RadioProps) => JSX.Element;
283
282
  EditFC: (props: RadioProps) => JSX.Element;
284
283
  ValidateFC?: (item: RadioSubtype, options: Options) => boolean;
285
284
  };
286
- type CheckboxType = {
285
+ type CheckboxType = FieldType & {
287
286
  Subtype: CheckboxSubtype;
288
287
  SubtypeFC: (props: CheckboxProps) => JSX.Element;
289
288
  EditFC: (props: CheckboxProps) => JSX.Element;
290
289
  ValidateFC?: (item: CheckboxSubtype, options: Options) => boolean;
291
290
  };
292
- type TextType = {
291
+ type TextType = FieldType & {
293
292
  Subtype: TextSubtype;
294
293
  SubtypeFC: (props: TextProps) => JSX.Element;
295
294
  EditFC: (props: TextProps) => JSX.Element;
296
295
  ValidateFC?: (item: TextSubtype, options: Options) => boolean;
297
296
  };
298
- type EmailType = {
297
+ type EmailType = FieldType & {
299
298
  Subtype: EmailSubtype;
300
299
  SubtypeFC: (props: EmailProps) => JSX.Element;
301
300
  EditFC: (props: EmailProps) => JSX.Element;
302
301
  ValidateFC?: (item: EmailSubtype, options: Options) => boolean;
303
302
  };
304
- type NumberType = {
303
+ type NumberType = FieldType & {
305
304
  Subtype: NumberSubtype;
306
305
  SubtypeFC: (props: NumberProps) => JSX.Element;
307
306
  EditFC: (props: NumberProps) => JSX.Element;
308
307
  ValidateFC?: (item: NumberSubtype, options: Options) => boolean;
309
308
  };
310
- type DateType = {
309
+ type DateType = FieldType & {
311
310
  Subtype: DateSubtype;
312
311
  SubtypeFC: (props: DateProps) => JSX.Element;
313
312
  EditFC: (props: DateProps) => JSX.Element;
314
313
  ValidateFC?: (item: DateSubtype, options: Options) => boolean;
315
314
  };
316
- type BooleanType = {
315
+ type BooleanType = FieldType & {
317
316
  Subtype: BooleanSubtype;
318
317
  SubtypeFC: (props: BooleanProps) => JSX.Element;
319
318
  EditFC: (props: BooleanProps) => JSX.Element;
320
319
  ValidateFC?: (item: BooleanSubtype, options: Options) => boolean;
321
320
  };
322
- type AutocompleteType = {
321
+ type AutocompleteType = FieldType & {
323
322
  Subtype: AutocompleteSubtype;
324
323
  SubtypeFC: (props: AutocompleteProps) => JSX.Element;
325
324
  EditFC: (props: AutocompleteProps) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfinnestad/react-form-builder",
3
- "version": "0.3.1",
3
+ "version": "1.0.1",
4
4
  "description": "FormBuilder and FormRender Component library for building and gathering custom form data",
5
5
  "scripts": {
6
6
  "rollup": "rollup -c",