react-survey-builder 1.0.68 → 1.0.70
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/bundle.js +3 -3
- package/lib/form-fields.js +34 -132
- package/lib/form.js +33 -129
- package/lib/survey-elements/index.js +302 -250
- package/package.json +1 -1
package/lib/form-fields.js
CHANGED
@@ -13,7 +13,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
13
13
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
14
14
|
import React from 'react';
|
15
15
|
import ReactDOM from 'react-dom';
|
16
|
-
import SurveyElements, { Image, Checkboxes, Signature, Download, Camera, FileUpload, PhoneNumber, DatePicker, TextInput, EmailInput, NumberInput, TextArea } from './survey-elements';
|
16
|
+
import SurveyElements, { Image, Checkboxes, Signature, Download, Camera, FileUpload, PhoneNumber, DatePicker, TextInput, EmailInput, NumberInput, TextArea, Dropdown, Tags } from './survey-elements';
|
17
17
|
import { TwoColumnRow, ThreeColumnRow, MultiColumnRow } from './multi-column';
|
18
18
|
import FieldSet from './fieldset';
|
19
19
|
import CustomElement from './survey-elements/custom-element';
|
@@ -47,8 +47,6 @@ var ReactSurveyFormFields = function ReactSurveyFormFields(_ref) {
|
|
47
47
|
methods = _ref.methods,
|
48
48
|
_ref$print = _ref.print,
|
49
49
|
print = _ref$print === void 0 ? false : _ref$print;
|
50
|
-
if (!methods) return null;
|
51
|
-
|
52
50
|
//#region helper functions
|
53
51
|
|
54
52
|
var _convert = function _convert($dataAnswers) {
|
@@ -117,14 +115,16 @@ var ReactSurveyFormFields = function ReactSurveyFormFields(_ref) {
|
|
117
115
|
return defaultChecked;
|
118
116
|
};
|
119
117
|
var _getItemValue = function _getItemValue($dataItem, ref) {
|
118
|
+
var _ref$inputField;
|
120
119
|
var $item = {
|
121
120
|
element: $dataItem.element,
|
122
121
|
value: ''
|
123
122
|
};
|
123
|
+
var $formData = methods === null || methods === void 0 ? void 0 : methods.getValues();
|
124
124
|
if ($dataItem.element === 'Rating') {
|
125
125
|
$item.value = ref.inputField.current.state.rating;
|
126
126
|
} else if ($dataItem.element === 'Tags') {
|
127
|
-
$item.value =
|
127
|
+
$item.value = $formData[$dataItem.fieldName];
|
128
128
|
// } else if (item.element === 'DatePicker') {
|
129
129
|
// $item.value = ref.state.value;
|
130
130
|
} else if ($dataItem.element === 'Camera') {
|
@@ -133,11 +133,13 @@ var ReactSurveyFormFields = function ReactSurveyFormFields(_ref) {
|
|
133
133
|
$item.value = ref.state.fileUpload;
|
134
134
|
} else if ($dataItem.element === 'Signature') {
|
135
135
|
$item.value = ref.state.value;
|
136
|
-
} else if (ref && ref.inputField && ref.inputField.current) {
|
136
|
+
} else if (ref && ref !== null && ref !== void 0 && ref.inputField && ref !== null && ref !== void 0 && (_ref$inputField = ref.inputField) !== null && _ref$inputField !== void 0 && _ref$inputField.current) {
|
137
137
|
$item = ReactDOM.findDOMNode(ref.inputField.current);
|
138
138
|
if ($item && typeof $item.value === 'string') {
|
139
139
|
$item.value = $item.value.trim();
|
140
140
|
}
|
141
|
+
} else {
|
142
|
+
$item.value = $formData[$dataItem.fieldName];
|
141
143
|
}
|
142
144
|
return $item;
|
143
145
|
};
|
@@ -172,77 +174,17 @@ var ReactSurveyFormFields = function ReactSurveyFormFields(_ref) {
|
|
172
174
|
}
|
173
175
|
return incorrect;
|
174
176
|
};
|
175
|
-
var
|
176
|
-
var invalid = false;
|
177
|
-
if ($dataItem.required === true) {
|
178
|
-
var ref = inputs.current[$dataItem.fieldName];
|
179
|
-
if ($dataItem.element === 'Checkboxes' || $dataItem.element === 'RadioButtons') {
|
180
|
-
var checked_options = 0;
|
181
|
-
$dataItem.options.forEach(function (option) {
|
182
|
-
var $option = ReactDOM.findDOMNode(ref.options["child_ref_".concat(option.key)]);
|
183
|
-
if ($option.checked) {
|
184
|
-
checked_options += 1;
|
185
|
-
}
|
186
|
-
});
|
187
|
-
if (checked_options < 1) {
|
188
|
-
// errors.push(item.label + ' is required!');
|
189
|
-
invalid = true;
|
190
|
-
}
|
191
|
-
} else {
|
192
|
-
var $item = _getItemValue($dataItem, ref);
|
193
|
-
if ($dataItem.element === 'Rating') {
|
194
|
-
if ($item.value === 0) {
|
195
|
-
invalid = true;
|
196
|
-
}
|
197
|
-
} else if ($item.value === undefined || $item.value.length < 1) {
|
198
|
-
invalid = true;
|
199
|
-
}
|
200
|
-
}
|
201
|
-
}
|
202
|
-
return invalid;
|
203
|
-
};
|
204
|
-
var _collect = function _collect($dataItem) {
|
205
|
-
var itemData = {
|
206
|
-
id: $dataItem.id,
|
207
|
-
name: $dataItem.fieldName,
|
208
|
-
customName: $dataItem.customName || $dataItem.fieldName,
|
209
|
-
label: $dataItem.label !== null && $dataItem.label !== undefined && $dataItem.label !== '' ? $dataItem.label.trim() : ''
|
210
|
-
};
|
211
|
-
if (!itemData.name) return null;
|
212
|
-
var ref = inputs.current[$dataItem.fieldName];
|
213
|
-
if ($dataItem.element === 'Checkboxes') {
|
214
|
-
var checkedOptions = [];
|
215
|
-
$dataItem.options.forEach(function (option) {
|
216
|
-
var $option = ReactDOM.findDOMNode(ref.options["child_ref_".concat(option.key)]);
|
217
|
-
if ($option.checked) {
|
218
|
-
checkedOptions.push(option.value);
|
219
|
-
}
|
220
|
-
});
|
221
|
-
itemData.value = checkedOptions;
|
222
|
-
} else if ($dataItem.element === 'RadioButtons') {
|
223
|
-
$dataItem.options.forEach(function (option) {
|
224
|
-
var $option = ReactDOM.findDOMNode(ref.options["child_ref_".concat(option.key)]);
|
225
|
-
if ($option.checked) {
|
226
|
-
itemData.value = option.value;
|
227
|
-
}
|
228
|
-
});
|
229
|
-
} else if ($dataItem.element === 'Checkbox') {
|
230
|
-
if (!ref || !ref.inputField || !ref.inputField.current) {
|
231
|
-
itemData.value = false;
|
232
|
-
} else {
|
233
|
-
itemData.value = ref.inputField.current.checked;
|
234
|
-
}
|
235
|
-
} else {
|
236
|
-
if (!ref) return null;
|
237
|
-
itemData.value = _getItemValue($dataItem, ref).value;
|
238
|
-
}
|
239
|
-
itemData.required = $dataItem.required || false;
|
240
|
-
return itemData;
|
241
|
-
};
|
242
|
-
var _collectFormData = function _collectFormData($dataItems) {
|
177
|
+
var _collectFormData = function _collectFormData($dataItems, $formData) {
|
243
178
|
var formData = [];
|
244
179
|
$dataItems.forEach(function (item) {
|
245
|
-
var itemData =
|
180
|
+
var itemData = {
|
181
|
+
id: item.id,
|
182
|
+
name: item.fieldName,
|
183
|
+
customName: item.customName || item.fieldName,
|
184
|
+
label: item.label !== null && item.label !== undefined && item.label !== '' ? item.label.trim() : '',
|
185
|
+
value: $formData[item.fieldName],
|
186
|
+
required: item.required || false
|
187
|
+
};
|
246
188
|
if (itemData) {
|
247
189
|
formData.push(itemData);
|
248
190
|
}
|
@@ -263,7 +205,7 @@ var ReactSurveyFormFields = function ReactSurveyFormFields(_ref) {
|
|
263
205
|
// Only submit if there are no errors.
|
264
206
|
if (hasErrors === false) {
|
265
207
|
if (onSubmit) {
|
266
|
-
var $data = _collectFormData(items);
|
208
|
+
var $data = _collectFormData(items, $formData);
|
267
209
|
onSubmit({
|
268
210
|
formData: $formData,
|
269
211
|
answers: $data
|
@@ -278,7 +220,7 @@ var ReactSurveyFormFields = function ReactSurveyFormFields(_ref) {
|
|
278
220
|
// console.log('handleChange');
|
279
221
|
// Call submit function on change
|
280
222
|
if (onChange) {
|
281
|
-
var $data = _collectFormData(items);
|
223
|
+
var $data = _collectFormData(items, (methods === null || methods === void 0 ? void 0 : methods.getValues()) || []);
|
282
224
|
onChange($data);
|
283
225
|
}
|
284
226
|
};
|
@@ -319,6 +261,19 @@ var ReactSurveyFormFields = function ReactSurveyFormFields(_ref) {
|
|
319
261
|
}
|
320
262
|
return null;
|
321
263
|
};
|
264
|
+
var getStandardElement = function getStandardElement(item) {
|
265
|
+
if (!item) return null;
|
266
|
+
if (item.custom) {
|
267
|
+
return getCustomElement(item);
|
268
|
+
}
|
269
|
+
var Input = SurveyElements[item.element];
|
270
|
+
return /*#__PURE__*/React.createElement(Input, {
|
271
|
+
name: item.fieldName,
|
272
|
+
key: "form_".concat(item.id),
|
273
|
+
item: item,
|
274
|
+
value: _getDefaultValue(item)
|
275
|
+
});
|
276
|
+
};
|
322
277
|
var getInputElement = function getInputElement(item) {
|
323
278
|
if (!item) return null;
|
324
279
|
if (item.custom) {
|
@@ -482,73 +437,20 @@ var ReactSurveyFormFields = function ReactSurveyFormFields(_ref) {
|
|
482
437
|
item.disabled = (_ref7 = readOnly || item.readOnly) !== null && _ref7 !== void 0 ? _ref7 : false;
|
483
438
|
item.mutable = true;
|
484
439
|
switch (item.element) {
|
485
|
-
case 'Dropdown':
|
486
440
|
case 'RadioButtons':
|
487
441
|
case 'Rating':
|
488
|
-
case 'Tags':
|
489
442
|
case 'Range':
|
490
443
|
case 'Checkbox':
|
491
444
|
return getInputElement(item);
|
445
|
+
case 'Tags':
|
446
|
+
case 'Dropdown':
|
492
447
|
case 'TextInput':
|
493
|
-
return /*#__PURE__*/React.createElement(TextInput, {
|
494
|
-
name: item.fieldName,
|
495
|
-
ref: function ref(c) {
|
496
|
-
return inputs.current[item.fieldName] = c;
|
497
|
-
},
|
498
|
-
key: "form_".concat(item.id),
|
499
|
-
item: item,
|
500
|
-
value: _getDefaultValue(item)
|
501
|
-
});
|
502
448
|
case 'EmailInput':
|
503
|
-
return /*#__PURE__*/React.createElement(EmailInput, {
|
504
|
-
name: item.fieldName,
|
505
|
-
ref: function ref(c) {
|
506
|
-
return inputs.current[item.fieldName] = c;
|
507
|
-
},
|
508
|
-
key: "form_".concat(item.id),
|
509
|
-
item: item,
|
510
|
-
value: _getDefaultValue(item)
|
511
|
-
});
|
512
449
|
case 'NumberInput':
|
513
|
-
return /*#__PURE__*/React.createElement(NumberInput, {
|
514
|
-
name: item.fieldName,
|
515
|
-
ref: function ref(c) {
|
516
|
-
return inputs.current[item.fieldName] = c;
|
517
|
-
},
|
518
|
-
key: "form_".concat(item.id),
|
519
|
-
item: item,
|
520
|
-
value: _getDefaultValue(item)
|
521
|
-
});
|
522
450
|
case 'TextArea':
|
523
|
-
return /*#__PURE__*/React.createElement(TextArea, {
|
524
|
-
name: item.fieldName,
|
525
|
-
ref: function ref(c) {
|
526
|
-
return inputs.current[item.fieldName] = c;
|
527
|
-
},
|
528
|
-
key: "form_".concat(item.id),
|
529
|
-
item: item,
|
530
|
-
value: _getDefaultValue(item)
|
531
|
-
});
|
532
451
|
case 'PhoneNumber':
|
533
|
-
return /*#__PURE__*/React.createElement(PhoneNumber, {
|
534
|
-
name: item.fieldName,
|
535
|
-
ref: function ref(c) {
|
536
|
-
return inputs.current[item.fieldName] = c;
|
537
|
-
},
|
538
|
-
key: "form_".concat(item.id),
|
539
|
-
item: item,
|
540
|
-
value: _getDefaultValue(item)
|
541
|
-
});
|
542
452
|
case 'DatePicker':
|
543
|
-
return
|
544
|
-
name: item.fieldName,
|
545
|
-
ref: function ref(c) {
|
546
|
-
return inputs.current[item.fieldName] = c;
|
547
|
-
},
|
548
|
-
key: "form_".concat(item.id),
|
549
|
-
item: item,
|
550
|
-
value: _getDefaultValue(item)
|
551
|
-
});
|
453
|
+
return getStandardElement(item);
|
552
454
|
case 'CustomElement':
|
553
455
|
return getCustomElement(item);
|
554
456
|
case 'MultiColumnRow':
|
package/lib/form.js
CHANGED
@@ -125,14 +125,16 @@ var ReactSurvey = function ReactSurvey(_ref) {
|
|
125
125
|
return defaultChecked;
|
126
126
|
};
|
127
127
|
var _getItemValue = function _getItemValue($dataItem, ref) {
|
128
|
+
var _ref$inputField;
|
128
129
|
var $item = {
|
129
130
|
element: $dataItem.element,
|
130
131
|
value: ''
|
131
132
|
};
|
133
|
+
var $formData = methods === null || methods === void 0 ? void 0 : methods.getValues();
|
132
134
|
if ($dataItem.element === 'Rating') {
|
133
135
|
$item.value = ref.inputField.current.state.rating;
|
134
136
|
} else if ($dataItem.element === 'Tags') {
|
135
|
-
$item.value =
|
137
|
+
$item.value = $formData[$dataItem.fieldName];
|
136
138
|
// } else if (item.element === 'DatePicker') {
|
137
139
|
// $item.value = ref.state.value;
|
138
140
|
} else if ($dataItem.element === 'Camera') {
|
@@ -141,11 +143,13 @@ var ReactSurvey = function ReactSurvey(_ref) {
|
|
141
143
|
$item.value = ref.state.fileUpload;
|
142
144
|
} else if ($dataItem.element === 'Signature') {
|
143
145
|
$item.value = ref.state.value;
|
144
|
-
} else if (ref && ref.inputField && ref.inputField.current) {
|
146
|
+
} else if (ref && ref !== null && ref !== void 0 && ref.inputField && ref !== null && ref !== void 0 && (_ref$inputField = ref.inputField) !== null && _ref$inputField !== void 0 && _ref$inputField.current) {
|
145
147
|
$item = ReactDOM.findDOMNode(ref.inputField.current);
|
146
148
|
if ($item && typeof $item.value === 'string') {
|
147
149
|
$item.value = $item.value.trim();
|
148
150
|
}
|
151
|
+
} else {
|
152
|
+
$item.value = $formData[$dataItem.fieldName];
|
149
153
|
}
|
150
154
|
return $item;
|
151
155
|
};
|
@@ -180,77 +184,17 @@ var ReactSurvey = function ReactSurvey(_ref) {
|
|
180
184
|
}
|
181
185
|
return incorrect;
|
182
186
|
};
|
183
|
-
var
|
184
|
-
var invalid = false;
|
185
|
-
if ($dataItem.required === true) {
|
186
|
-
var ref = inputs.current[$dataItem.fieldName];
|
187
|
-
if ($dataItem.element === 'Checkboxes' || $dataItem.element === 'RadioButtons') {
|
188
|
-
var checked_options = 0;
|
189
|
-
$dataItem.options.forEach(function (option) {
|
190
|
-
var $option = ReactDOM.findDOMNode(ref.options["child_ref_".concat(option.key)]);
|
191
|
-
if ($option.checked) {
|
192
|
-
checked_options += 1;
|
193
|
-
}
|
194
|
-
});
|
195
|
-
if (checked_options < 1) {
|
196
|
-
// errors.push(item.label + ' is required!');
|
197
|
-
invalid = true;
|
198
|
-
}
|
199
|
-
} else {
|
200
|
-
var $item = _getItemValue($dataItem, ref);
|
201
|
-
if ($dataItem.element === 'Rating') {
|
202
|
-
if ($item.value === 0) {
|
203
|
-
invalid = true;
|
204
|
-
}
|
205
|
-
} else if ($item.value === undefined || $item.value.length < 1) {
|
206
|
-
invalid = true;
|
207
|
-
}
|
208
|
-
}
|
209
|
-
}
|
210
|
-
return invalid;
|
211
|
-
};
|
212
|
-
var _collect = function _collect($dataItem) {
|
213
|
-
var itemData = {
|
214
|
-
id: $dataItem.id,
|
215
|
-
name: $dataItem.fieldName,
|
216
|
-
customName: $dataItem.customName || $dataItem.fieldName,
|
217
|
-
label: $dataItem.label !== null && $dataItem.label !== undefined && $dataItem.label !== '' ? $dataItem.label.trim() : ''
|
218
|
-
};
|
219
|
-
if (!itemData.name) return null;
|
220
|
-
var ref = inputs.current[$dataItem.fieldName];
|
221
|
-
if ($dataItem.element === 'Checkboxes') {
|
222
|
-
var checkedOptions = [];
|
223
|
-
$dataItem.options.forEach(function (option) {
|
224
|
-
var $option = ReactDOM.findDOMNode(ref.options["child_ref_".concat(option.key)]);
|
225
|
-
if ($option.checked) {
|
226
|
-
checkedOptions.push(option.value);
|
227
|
-
}
|
228
|
-
});
|
229
|
-
itemData.value = checkedOptions;
|
230
|
-
} else if ($dataItem.element === 'RadioButtons') {
|
231
|
-
$dataItem.options.forEach(function (option) {
|
232
|
-
var $option = ReactDOM.findDOMNode(ref.options["child_ref_".concat(option.key)]);
|
233
|
-
if ($option.checked) {
|
234
|
-
itemData.value = option.value;
|
235
|
-
}
|
236
|
-
});
|
237
|
-
} else if ($dataItem.element === 'Checkbox') {
|
238
|
-
if (!ref || !ref.inputField || !ref.inputField.current) {
|
239
|
-
itemData.value = false;
|
240
|
-
} else {
|
241
|
-
itemData.value = ref.inputField.current.checked;
|
242
|
-
}
|
243
|
-
} else {
|
244
|
-
if (!ref) return null;
|
245
|
-
itemData.value = _getItemValue($dataItem, ref).value;
|
246
|
-
}
|
247
|
-
itemData.required = $dataItem.required || false;
|
248
|
-
return itemData;
|
249
|
-
};
|
250
|
-
var _collectFormData = function _collectFormData($dataItems) {
|
187
|
+
var _collectFormData = function _collectFormData($dataItems, $formData) {
|
251
188
|
var formData = [];
|
252
189
|
$dataItems.forEach(function (item) {
|
253
|
-
var itemData =
|
190
|
+
var itemData = {
|
191
|
+
id: item.id,
|
192
|
+
name: item.fieldName,
|
193
|
+
customName: item.customName || item.fieldName,
|
194
|
+
label: item.label !== null && item.label !== undefined && item.label !== '' ? item.label.trim() : '',
|
195
|
+
value: $formData[item.fieldName],
|
196
|
+
required: item.required || false
|
197
|
+
};
|
254
198
|
if (itemData) {
|
255
199
|
formData.push(itemData);
|
256
200
|
}
|
@@ -271,7 +215,7 @@ var ReactSurvey = function ReactSurvey(_ref) {
|
|
271
215
|
// Only submit if there are no errors.
|
272
216
|
if (hasErrors === false) {
|
273
217
|
if (onSubmit) {
|
274
|
-
var $data = _collectFormData(items);
|
218
|
+
var $data = _collectFormData(items, $formData);
|
275
219
|
onSubmit({
|
276
220
|
formData: $formData,
|
277
221
|
answers: $data
|
@@ -286,7 +230,7 @@ var ReactSurvey = function ReactSurvey(_ref) {
|
|
286
230
|
// console.log('handleChange');
|
287
231
|
// Call submit function on change
|
288
232
|
if (onChange) {
|
289
|
-
var $data = _collectFormData(items);
|
233
|
+
var $data = _collectFormData(items, (methods === null || methods === void 0 ? void 0 : methods.getValues()) || []);
|
290
234
|
onChange($data);
|
291
235
|
}
|
292
236
|
};
|
@@ -327,6 +271,19 @@ var ReactSurvey = function ReactSurvey(_ref) {
|
|
327
271
|
}
|
328
272
|
return null;
|
329
273
|
};
|
274
|
+
var getStandardElement = function getStandardElement(item) {
|
275
|
+
if (!item) return null;
|
276
|
+
if (item.custom) {
|
277
|
+
return getCustomElement(item);
|
278
|
+
}
|
279
|
+
var Input = SurveyElements[item.element];
|
280
|
+
return /*#__PURE__*/React.createElement(Input, {
|
281
|
+
name: item.fieldName,
|
282
|
+
key: "form_".concat(item.id),
|
283
|
+
item: item,
|
284
|
+
value: _getDefaultValue(item)
|
285
|
+
});
|
286
|
+
};
|
330
287
|
var getInputElement = function getInputElement(item) {
|
331
288
|
if (!item) return null;
|
332
289
|
if (item.custom) {
|
@@ -490,73 +447,20 @@ var ReactSurvey = function ReactSurvey(_ref) {
|
|
490
447
|
item.disabled = (_ref7 = readOnly || item.readOnly) !== null && _ref7 !== void 0 ? _ref7 : false;
|
491
448
|
item.mutable = true;
|
492
449
|
switch (item.element) {
|
493
|
-
case 'Dropdown':
|
494
450
|
case 'RadioButtons':
|
495
451
|
case 'Rating':
|
496
|
-
case 'Tags':
|
497
452
|
case 'Range':
|
498
453
|
case 'Checkbox':
|
499
454
|
return getInputElement(item);
|
455
|
+
case 'Tags':
|
456
|
+
case 'Dropdown':
|
500
457
|
case 'TextInput':
|
501
|
-
return /*#__PURE__*/React.createElement(TextInput, {
|
502
|
-
name: item.fieldName,
|
503
|
-
ref: function ref(c) {
|
504
|
-
return inputs.current[item.fieldName] = c;
|
505
|
-
},
|
506
|
-
key: "form_".concat(item.id),
|
507
|
-
item: item,
|
508
|
-
value: _getDefaultValue(item)
|
509
|
-
});
|
510
458
|
case 'EmailInput':
|
511
|
-
return /*#__PURE__*/React.createElement(EmailInput, {
|
512
|
-
name: item.fieldName,
|
513
|
-
ref: function ref(c) {
|
514
|
-
return inputs.current[item.fieldName] = c;
|
515
|
-
},
|
516
|
-
key: "form_".concat(item.id),
|
517
|
-
item: item,
|
518
|
-
value: _getDefaultValue(item)
|
519
|
-
});
|
520
459
|
case 'NumberInput':
|
521
|
-
return /*#__PURE__*/React.createElement(NumberInput, {
|
522
|
-
name: item.fieldName,
|
523
|
-
ref: function ref(c) {
|
524
|
-
return inputs.current[item.fieldName] = c;
|
525
|
-
},
|
526
|
-
key: "form_".concat(item.id),
|
527
|
-
item: item,
|
528
|
-
value: _getDefaultValue(item)
|
529
|
-
});
|
530
460
|
case 'TextArea':
|
531
|
-
return /*#__PURE__*/React.createElement(TextArea, {
|
532
|
-
name: item.fieldName,
|
533
|
-
ref: function ref(c) {
|
534
|
-
return inputs.current[item.fieldName] = c;
|
535
|
-
},
|
536
|
-
key: "form_".concat(item.id),
|
537
|
-
item: item,
|
538
|
-
value: _getDefaultValue(item)
|
539
|
-
});
|
540
461
|
case 'PhoneNumber':
|
541
|
-
return /*#__PURE__*/React.createElement(PhoneNumber, {
|
542
|
-
name: item.fieldName,
|
543
|
-
ref: function ref(c) {
|
544
|
-
return inputs.current[item.fieldName] = c;
|
545
|
-
},
|
546
|
-
key: "form_".concat(item.id),
|
547
|
-
item: item,
|
548
|
-
value: _getDefaultValue(item)
|
549
|
-
});
|
550
462
|
case 'DatePicker':
|
551
|
-
return
|
552
|
-
name: item.fieldName,
|
553
|
-
ref: function ref(c) {
|
554
|
-
return inputs.current[item.fieldName] = c;
|
555
|
-
},
|
556
|
-
key: "form_".concat(item.id),
|
557
|
-
item: item,
|
558
|
-
value: _getDefaultValue(item)
|
559
|
-
});
|
463
|
+
return getStandardElement(item);
|
560
464
|
case 'CustomElement':
|
561
465
|
return getCustomElement(item);
|
562
466
|
case 'MultiColumnRow':
|