react-survey-builder 1.0.41 → 1.0.43
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/225.index.js +1 -0
- package/dist/997.index.js +1 -0
- package/dist/index.js +1 -1
- package/lib/dynamic-option-list.js +6 -15
- package/lib/fieldset/index.js +124 -6
- package/lib/form-fields.js +10 -35
- package/lib/form.js +10 -35
- package/lib/index.js +3 -20
- package/lib/multi-column/MultiColumnRow.js +2 -2
- package/lib/multi-column/dustbin.js +3 -3
- package/lib/multi-column/grip.js +2 -2
- package/lib/preview.js +13 -14
- package/lib/sortable-form-elements.js +33 -33
- package/lib/survey-elements/component-drag-handle.js +7 -10
- package/lib/survey-elements/component-drag-layer.js +7 -10
- package/lib/survey-elements/component-drag-preview.js +1 -1
- package/lib/survey-elements/component-error-message.js +0 -1
- package/lib/survey-elements/index.js +34 -26
- package/lib/survey-elements-edit.js +39 -147
- package/lib/survey-place-holder.js +3 -7
- package/lib/survey-validator.js +2 -7
- package/lib/toolbar-draggable-item.js +3 -5
- package/lib/toolbar-group-item.js +12 -19
- package/lib/toolbar.js +95 -246
- package/package.json +5 -6
- package/dist/320.index.js +0 -1
- package/dist/57.index.js +0 -1
- package/lib/fieldset/FieldSet.js +0 -129
- package/lib/language-provider/IntlMessages.js +0 -15
- package/lib/language-provider/entries/en-us.js +0 -16
- package/lib/language-provider/index.js +0 -18
- package/lib/language-provider/locales/en-us.json +0 -103
- package/lib/utils/custom-date-picker.js +0 -93
package/lib/toolbar.js
CHANGED
@@ -13,10 +13,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
16
|
-
var _reactIntl = require("react-intl");
|
17
16
|
var _toolbarDraggableItem = _interopRequireDefault(require("./toolbar-draggable-item"));
|
18
17
|
var _toolbarGroupItem = _interopRequireDefault(require("./toolbar-group-item"));
|
19
|
-
var _UUID = _interopRequireDefault(require("./UUID"));
|
20
18
|
var _store = _interopRequireDefault(require("./stores/store"));
|
21
19
|
var _functions = require("./functions");
|
22
20
|
var _fa = require("react-icons/fa");
|
@@ -24,15 +22,8 @@ var _pi = require("react-icons/pi");
|
|
24
22
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
25
23
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
26
24
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
27
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
28
|
-
|
29
|
-
*/
|
30
|
-
// function isDefaultItem(item) {
|
31
|
-
// const keys = Object.keys(item);
|
32
|
-
// return keys.filter(x => x !== 'element' && x !== 'key' && x !== 'groupName').length === 0;
|
33
|
-
// }
|
34
|
-
|
35
|
-
function buildItems(items, defaultItems) {
|
25
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
26
|
+
var buildItems = function buildItems(items, defaultItems) {
|
36
27
|
if (!items) {
|
37
28
|
return defaultItems;
|
38
29
|
}
|
@@ -54,8 +45,8 @@ function buildItems(items, defaultItems) {
|
|
54
45
|
}
|
55
46
|
return found || x;
|
56
47
|
});
|
57
|
-
}
|
58
|
-
function buildGroupItems(allItems) {
|
48
|
+
};
|
49
|
+
var buildGroupItems = function buildGroupItems(allItems) {
|
59
50
|
var items = allItems.filter(function (x) {
|
60
51
|
return !x.groupName;
|
61
52
|
});
|
@@ -75,7 +66,7 @@ function buildGroupItems(allItems) {
|
|
75
66
|
grouped: grouped,
|
76
67
|
groupKeys: groupKeys
|
77
68
|
};
|
78
|
-
}
|
69
|
+
};
|
79
70
|
var Toolbar = /*#__PURE__*/function (_React$Component) {
|
80
71
|
(0, _inherits2["default"])(Toolbar, _React$Component);
|
81
72
|
var _super = _createSuper(Toolbar);
|
@@ -91,8 +82,7 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
91
82
|
onCreate: _this.create
|
92
83
|
});
|
93
84
|
});
|
94
|
-
var
|
95
|
-
var items = buildItems(props.items, _this._defaultItems(intl));
|
85
|
+
var items = buildItems(props.items, _this._defaultItems());
|
96
86
|
_this.state = {
|
97
87
|
items: items
|
98
88
|
};
|
@@ -111,63 +101,41 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
111
101
|
}
|
112
102
|
}, {
|
113
103
|
key: "_defaultItems",
|
114
|
-
value: function _defaultItems(
|
104
|
+
value: function _defaultItems() {
|
115
105
|
return [{
|
116
106
|
key: 'Header',
|
117
|
-
name:
|
118
|
-
id: 'header-text'
|
119
|
-
}),
|
107
|
+
name: "Header Text",
|
120
108
|
icon: _fa.FaHeading,
|
121
109
|
"static": true,
|
122
|
-
content:
|
123
|
-
id: 'place-holder-text'
|
124
|
-
})
|
110
|
+
content: "Text..."
|
125
111
|
}, {
|
126
112
|
key: 'Label',
|
127
|
-
name:
|
128
|
-
id: 'label'
|
129
|
-
}),
|
113
|
+
name: "Label",
|
130
114
|
"static": true,
|
131
115
|
icon: _fa.FaFont,
|
132
|
-
content:
|
133
|
-
id: 'place-holder-text'
|
134
|
-
})
|
116
|
+
content: "Text..."
|
135
117
|
}, {
|
136
118
|
key: 'Paragraph',
|
137
|
-
name:
|
138
|
-
id: 'paragraph'
|
139
|
-
}),
|
119
|
+
name: "Paragraph",
|
140
120
|
"static": true,
|
141
121
|
icon: _fa.FaParagraph,
|
142
|
-
content:
|
143
|
-
id: 'place-holder-text'
|
144
|
-
})
|
122
|
+
content: "Text..."
|
145
123
|
}, {
|
146
124
|
key: 'ContentBody',
|
147
|
-
name:
|
148
|
-
id: 'content-body'
|
149
|
-
}),
|
125
|
+
name: "Static Content",
|
150
126
|
"static": true,
|
151
127
|
icon: _pi.PiFileHtml,
|
152
|
-
content:
|
153
|
-
id: 'place-holder-text'
|
154
|
-
})
|
128
|
+
content: "Text..."
|
155
129
|
}, {
|
156
130
|
key: 'LineBreak',
|
157
|
-
name:
|
158
|
-
id: 'line-break'
|
159
|
-
}),
|
131
|
+
name: "Line Break",
|
160
132
|
"static": true,
|
161
133
|
icon: _fa.FaArrowsAltH
|
162
134
|
}, {
|
163
135
|
key: 'Dropdown',
|
164
|
-
name:
|
165
|
-
id: 'dropdown'
|
166
|
-
}),
|
136
|
+
name: "Dropdown",
|
167
137
|
icon: _fa.FaCaretSquareDown,
|
168
|
-
label:
|
169
|
-
id: 'place-holder-label'
|
170
|
-
}),
|
138
|
+
label: "Label",
|
171
139
|
fieldName: 'dropdown_',
|
172
140
|
canHaveHelp: true,
|
173
141
|
options: [],
|
@@ -176,13 +144,9 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
176
144
|
answerType: 'ARRAY'
|
177
145
|
}, {
|
178
146
|
key: 'Tags',
|
179
|
-
name:
|
180
|
-
id: 'tags'
|
181
|
-
}),
|
147
|
+
name: "Tags",
|
182
148
|
icon: _fa.FaTags,
|
183
|
-
label:
|
184
|
-
id: 'place-holder-label'
|
185
|
-
}),
|
149
|
+
label: "Label",
|
186
150
|
fieldName: 'tags_',
|
187
151
|
canHaveHelp: true,
|
188
152
|
options: [],
|
@@ -191,26 +155,18 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
191
155
|
answerType: 'ARRAY'
|
192
156
|
}, {
|
193
157
|
key: 'Checkboxes',
|
194
|
-
name:
|
195
|
-
id: 'checkboxes'
|
196
|
-
}),
|
158
|
+
name: "Checkboxes",
|
197
159
|
icon: _fa.FaCheckSquare,
|
198
|
-
label:
|
199
|
-
id: 'place-holder-label'
|
200
|
-
}),
|
160
|
+
label: "Label",
|
201
161
|
fieldName: 'checkboxes_',
|
202
162
|
canHaveHelp: true,
|
203
163
|
options: [],
|
204
164
|
answerType: 'ARRAY'
|
205
165
|
}, {
|
206
166
|
key: 'Checkbox',
|
207
|
-
name:
|
208
|
-
id: 'checkbox'
|
209
|
-
}),
|
167
|
+
name: "Checkbox",
|
210
168
|
icon: _fa.FaCheckSquare,
|
211
|
-
label:
|
212
|
-
id: 'place-holder-label'
|
213
|
-
}),
|
169
|
+
label: "Label",
|
214
170
|
fieldName: 'checkbox_',
|
215
171
|
canHaveHelp: true,
|
216
172
|
boxLabel: 'Pick me',
|
@@ -219,57 +175,37 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
219
175
|
hideLabel: true
|
220
176
|
}, {
|
221
177
|
key: 'RadioButtons',
|
222
|
-
name:
|
223
|
-
id: 'multiple-choice'
|
224
|
-
}),
|
178
|
+
name: "Radio Buttons",
|
225
179
|
icon: _fa.FaRegDotCircle,
|
226
|
-
label:
|
227
|
-
id: 'place-holder-label'
|
228
|
-
}),
|
180
|
+
label: "Label",
|
229
181
|
fieldName: 'radiobuttons_',
|
230
182
|
canHaveHelp: true,
|
231
183
|
options: [],
|
232
184
|
answerType: 'STRING'
|
233
185
|
}, {
|
234
186
|
key: 'TextInput',
|
235
|
-
name:
|
236
|
-
|
237
|
-
}),
|
238
|
-
label: intl.formatMessage({
|
239
|
-
id: 'place-holder-label'
|
240
|
-
}),
|
187
|
+
name: "Text Input",
|
188
|
+
label: "Label",
|
241
189
|
icon: _fa.FaFont,
|
242
190
|
fieldName: 'text_input_',
|
243
191
|
canHaveHelp: true,
|
244
|
-
placeholder:
|
245
|
-
id: 'place-holder-label'
|
246
|
-
}),
|
192
|
+
placeholder: "Label",
|
247
193
|
canHaveLabelLocation: true,
|
248
194
|
answerType: 'STRING'
|
249
195
|
}, {
|
250
196
|
key: 'EmailInput',
|
251
|
-
name:
|
252
|
-
|
253
|
-
}),
|
254
|
-
label: intl.formatMessage({
|
255
|
-
id: 'place-holder-email'
|
256
|
-
}),
|
197
|
+
name: "Email Input",
|
198
|
+
label: "Email Address",
|
257
199
|
icon: _fa.FaEnvelope,
|
258
200
|
fieldName: 'email_input_',
|
259
201
|
canHaveHelp: true,
|
260
|
-
placeholder:
|
261
|
-
id: 'place-holder-email'
|
262
|
-
}),
|
202
|
+
placeholder: "Email Address",
|
263
203
|
canHaveLabelLocation: true,
|
264
204
|
answerType: 'STRING'
|
265
205
|
}, {
|
266
206
|
key: 'PhoneNumber',
|
267
|
-
name:
|
268
|
-
|
269
|
-
}),
|
270
|
-
label: intl.formatMessage({
|
271
|
-
id: 'place-holder-phone-number'
|
272
|
-
}),
|
207
|
+
name: "Phone Number",
|
208
|
+
label: "Phone Number",
|
273
209
|
icon: _fa.FaPhone,
|
274
210
|
fieldName: 'phone_input_',
|
275
211
|
canHaveHelp: true,
|
@@ -280,25 +216,17 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
280
216
|
canDefaultToday: true,
|
281
217
|
canReadOnly: true,
|
282
218
|
dateFormat: 'MM/DD/YYYY',
|
283
|
-
name:
|
284
|
-
id: 'date'
|
285
|
-
}),
|
219
|
+
name: "Date",
|
286
220
|
icon: _fa.FaRegCalendarAlt,
|
287
|
-
label:
|
288
|
-
id: 'place-holder-label'
|
289
|
-
}),
|
221
|
+
label: "Label",
|
290
222
|
fieldName: 'date_picker_',
|
291
223
|
canHaveHelp: true,
|
292
224
|
canHaveLabelLocation: true,
|
293
225
|
answerType: 'STRING'
|
294
226
|
}, {
|
295
227
|
key: 'TextArea',
|
296
|
-
name:
|
297
|
-
|
298
|
-
}),
|
299
|
-
label: intl.formatMessage({
|
300
|
-
id: 'place-holder-label'
|
301
|
-
}),
|
228
|
+
name: "Multi-line Input",
|
229
|
+
label: "Label",
|
302
230
|
icon: _fa.FaTextHeight,
|
303
231
|
fieldName: 'text_area_',
|
304
232
|
canHaveHelp: true,
|
@@ -306,12 +234,8 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
306
234
|
answerType: 'STRING'
|
307
235
|
}, {
|
308
236
|
key: 'NumberInput',
|
309
|
-
name:
|
310
|
-
|
311
|
-
}),
|
312
|
-
label: intl.formatMessage({
|
313
|
-
id: 'place-holder-label'
|
314
|
-
}),
|
237
|
+
name: "Numerical Input",
|
238
|
+
label: "Label",
|
315
239
|
icon: _fa.FaPlus,
|
316
240
|
fieldName: 'number_input_',
|
317
241
|
canHaveHelp: true,
|
@@ -322,89 +246,59 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
322
246
|
answerType: 'NUMBER'
|
323
247
|
}, {
|
324
248
|
key: 'Rating',
|
325
|
-
name:
|
326
|
-
|
327
|
-
}),
|
328
|
-
label: intl.formatMessage({
|
329
|
-
id: 'place-holder-label'
|
330
|
-
}),
|
249
|
+
name: "Rating",
|
250
|
+
label: "Label",
|
331
251
|
icon: _fa.FaStar,
|
332
252
|
fieldName: 'rating_',
|
333
253
|
canHaveHelp: true,
|
334
254
|
answerType: 'NUMBER'
|
335
255
|
}, {
|
336
256
|
key: 'Range',
|
337
|
-
name:
|
338
|
-
id: 'range'
|
339
|
-
}),
|
257
|
+
name: "Range",
|
340
258
|
icon: _fa.FaSlidersH,
|
341
|
-
label:
|
342
|
-
id: 'place-holder-label'
|
343
|
-
}),
|
259
|
+
label: "Label",
|
344
260
|
fieldName: 'range_',
|
345
261
|
step: 1,
|
346
262
|
defaultValue: 3,
|
347
263
|
minValue: 1,
|
348
264
|
maxValue: 5,
|
349
|
-
minLabel:
|
350
|
-
|
351
|
-
}),
|
352
|
-
maxLabel: intl.formatMessage({
|
353
|
-
id: 'difficult'
|
354
|
-
}),
|
265
|
+
minLabel: "Easy",
|
266
|
+
maxLabel: "Difficult",
|
355
267
|
canHaveHelp: true,
|
356
268
|
answerType: 'NUMBER'
|
357
269
|
}, {
|
358
270
|
key: 'Signature',
|
359
271
|
canReadOnly: true,
|
360
|
-
name:
|
361
|
-
id: 'signature'
|
362
|
-
}),
|
272
|
+
name: "Signature",
|
363
273
|
icon: _fa.FaPenSquare,
|
364
|
-
label:
|
365
|
-
id: 'signature'
|
366
|
-
}),
|
274
|
+
label: "Signature",
|
367
275
|
fieldName: 'signature_',
|
368
276
|
canHaveHelp: true,
|
369
277
|
answerType: 'IMAGE'
|
370
278
|
}, {
|
371
279
|
key: 'Camera',
|
372
|
-
name:
|
373
|
-
id: 'camera'
|
374
|
-
}),
|
280
|
+
name: "Camera",
|
375
281
|
icon: _fa.FaCamera,
|
376
|
-
label:
|
377
|
-
id: 'place-holder-label'
|
378
|
-
}),
|
282
|
+
label: "Label",
|
379
283
|
fieldName: 'camera_',
|
380
284
|
answerType: 'IMAGE'
|
381
285
|
}, {
|
382
286
|
key: 'FileUpload',
|
383
|
-
name:
|
384
|
-
id: 'file-upload'
|
385
|
-
}),
|
287
|
+
name: "File Upload",
|
386
288
|
icon: _fa.FaFile,
|
387
|
-
label:
|
388
|
-
id: 'place-holder-label'
|
389
|
-
}),
|
289
|
+
label: "Label",
|
390
290
|
fieldName: 'file_upload_',
|
391
291
|
answerType: 'FILE'
|
392
292
|
}, {
|
393
293
|
key: 'FieldSet',
|
394
|
-
name:
|
395
|
-
|
396
|
-
}),
|
397
|
-
label: intl.formatMessage({
|
398
|
-
id: 'fieldset'
|
399
|
-
}),
|
294
|
+
name: "Fieldset",
|
295
|
+
label: "Fieldset",
|
400
296
|
icon: _fa.FaBars,
|
401
297
|
fieldName: 'fieldset-element',
|
402
298
|
"static": true
|
403
299
|
}, {
|
404
300
|
key: 'Image',
|
405
|
-
name:
|
406
|
-
id: 'image'
|
407
|
-
}),
|
301
|
+
name: "Image",
|
408
302
|
label: '',
|
409
303
|
icon: _fa.FaRegImage,
|
410
304
|
fieldName: 'image_',
|
@@ -412,42 +306,30 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
412
306
|
"static": true
|
413
307
|
}, {
|
414
308
|
key: 'HyperLink',
|
415
|
-
name:
|
416
|
-
id: 'website'
|
417
|
-
}),
|
309
|
+
name: "Hyperlink",
|
418
310
|
icon: _fa.FaLink,
|
419
|
-
content:
|
420
|
-
id: 'place-holder-website-link'
|
421
|
-
}),
|
311
|
+
content: "Website Link...",
|
422
312
|
href: 'http://www.example.com',
|
423
313
|
"static": true
|
424
314
|
}, {
|
425
315
|
key: 'Download',
|
426
|
-
name:
|
427
|
-
id: 'file-attachment'
|
428
|
-
}),
|
316
|
+
name: "File Attachment",
|
429
317
|
icon: _fa.FaFile,
|
430
|
-
content:
|
431
|
-
id: 'place-holder-file-name'
|
432
|
-
}),
|
318
|
+
content: "File name...",
|
433
319
|
fieldName: 'download_',
|
434
320
|
filePath: '',
|
435
321
|
href: '',
|
436
322
|
"static": true
|
437
323
|
}, {
|
438
324
|
key: 'TwoColumnRow',
|
439
|
-
name:
|
440
|
-
id: 'two-columns-row'
|
441
|
-
}),
|
325
|
+
name: "Two Column Row",
|
442
326
|
label: '',
|
443
327
|
icon: _fa.FaColumns,
|
444
328
|
fieldName: 'two_col_row_',
|
445
329
|
"static": true
|
446
330
|
}, {
|
447
331
|
key: 'ThreeColumnRow',
|
448
|
-
name:
|
449
|
-
id: 'three-columns-row'
|
450
|
-
}),
|
332
|
+
name: "Three Columns Row",
|
451
333
|
label: '',
|
452
334
|
icon: _fa.FaColumns,
|
453
335
|
fieldName: 'three_col_row_',
|
@@ -455,9 +337,7 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
455
337
|
}, {
|
456
338
|
key: 'FourColumnRow',
|
457
339
|
element: 'MultiColumnRow',
|
458
|
-
name:
|
459
|
-
id: 'four-columns-row'
|
460
|
-
}),
|
340
|
+
name: "Four Columns Row",
|
461
341
|
label: '',
|
462
342
|
icon: _fa.FaColumns,
|
463
343
|
fieldName: 'four_col_row_',
|
@@ -467,9 +347,7 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
467
347
|
}, {
|
468
348
|
key: 'FiveColumnRow',
|
469
349
|
element: 'MultiColumnRow',
|
470
|
-
name:
|
471
|
-
id: 'five-columns-row'
|
472
|
-
}),
|
350
|
+
name: "Five Columns Row",
|
473
351
|
label: '',
|
474
352
|
icon: _fa.FaColumns,
|
475
353
|
fieldName: 'five_col_row_',
|
@@ -479,9 +357,7 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
479
357
|
}, {
|
480
358
|
key: 'SixColumnRow',
|
481
359
|
element: 'MultiColumnRow',
|
482
|
-
name:
|
483
|
-
id: 'six-columns-row'
|
484
|
-
}),
|
360
|
+
name: "Six Columns Row",
|
485
361
|
label: '',
|
486
362
|
icon: _fa.FaColumns,
|
487
363
|
fieldName: 'six_col_row_',
|
@@ -506,10 +382,9 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
506
382
|
key: "create",
|
507
383
|
value: function create(item) {
|
508
384
|
var _item$static;
|
509
|
-
var intl = this.props.intl;
|
510
385
|
var element = item.element || item.key;
|
511
386
|
var elementOptions = this.addCustomOptions(item, {
|
512
|
-
id:
|
387
|
+
id: (0, _functions.generateUUID)(),
|
513
388
|
element: element,
|
514
389
|
text: item.name,
|
515
390
|
"static": (_item$static = item["static"]) !== null && _item$static !== void 0 ? _item$static : false
|
@@ -626,7 +501,7 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
626
501
|
elementOptions.defaultValue = item.defaultValue;
|
627
502
|
}
|
628
503
|
if (item.fieldName) {
|
629
|
-
elementOptions.fieldName = item.fieldName +
|
504
|
+
elementOptions.fieldName = item.fieldName + (0, _functions.generateUUID)();
|
630
505
|
}
|
631
506
|
if (!item["static"]) {
|
632
507
|
var _item$customName;
|
@@ -639,11 +514,11 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
639
514
|
if (item.options.length > 0) {
|
640
515
|
elementOptions.options = item.options.map(function (x) {
|
641
516
|
return _objectSpread(_objectSpread({}, x), {}, {
|
642
|
-
key: "custom_option_".concat(
|
517
|
+
key: "custom_option_".concat((0, _functions.generateUUID)())
|
643
518
|
});
|
644
519
|
});
|
645
520
|
} else {
|
646
|
-
elementOptions.options = Toolbar._defaultItemOptions(elementOptions.element
|
521
|
+
elementOptions.options = Toolbar._defaultItemOptions(elementOptions.element);
|
647
522
|
}
|
648
523
|
}
|
649
524
|
return elementOptions;
|
@@ -664,9 +539,7 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
664
539
|
groupKeys = _buildGroupItems.groupKeys;
|
665
540
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
666
541
|
className: "react-survey-builder-toolbar"
|
667
|
-
}, /*#__PURE__*/_react["default"].createElement("h4", null, this.
|
668
|
-
id: 'toolbox'
|
669
|
-
})), /*#__PURE__*/_react["default"].createElement("ul", null, items.map(this.renderItem), groupKeys.map(function (k) {
|
542
|
+
}, /*#__PURE__*/_react["default"].createElement("h4", null, "Survey Blocks Toolbox"), /*#__PURE__*/_react["default"].createElement("ul", null, items.map(this.renderItem), groupKeys.map(function (k) {
|
670
543
|
return /*#__PURE__*/_react["default"].createElement(_toolbarGroupItem["default"], {
|
671
544
|
key: k,
|
672
545
|
name: k,
|
@@ -677,87 +550,63 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
677
550
|
}
|
678
551
|
}], [{
|
679
552
|
key: "_defaultItemOptions",
|
680
|
-
value: function _defaultItemOptions(element
|
553
|
+
value: function _defaultItemOptions(element) {
|
681
554
|
switch (element) {
|
682
555
|
case 'Dropdown':
|
683
556
|
return [{
|
684
557
|
value: 'place_holder_option_1',
|
685
|
-
text:
|
686
|
-
|
687
|
-
}),
|
688
|
-
key: "dropdown_option_".concat(_UUID["default"].uuid())
|
558
|
+
text: "Place holder option 1",
|
559
|
+
key: "dropdown_option_".concat((0, _functions.generateUUID)())
|
689
560
|
}, {
|
690
561
|
value: 'place_holder_option_2',
|
691
|
-
text:
|
692
|
-
|
693
|
-
}),
|
694
|
-
key: "dropdown_option_".concat(_UUID["default"].uuid())
|
562
|
+
text: "Place holder option 2",
|
563
|
+
key: "dropdown_option_".concat((0, _functions.generateUUID)())
|
695
564
|
}, {
|
696
565
|
value: 'place_holder_option_3',
|
697
|
-
text:
|
698
|
-
|
699
|
-
}),
|
700
|
-
key: "dropdown_option_".concat(_UUID["default"].uuid())
|
566
|
+
text: "Place holder option 3",
|
567
|
+
key: "dropdown_option_".concat((0, _functions.generateUUID)())
|
701
568
|
}];
|
702
569
|
case 'Tags':
|
703
570
|
return [{
|
704
571
|
value: 'place_holder_tag_1',
|
705
|
-
text:
|
706
|
-
|
707
|
-
}),
|
708
|
-
key: "tags_option_".concat(_UUID["default"].uuid())
|
572
|
+
text: "Place holder option 1",
|
573
|
+
key: "tags_option_".concat((0, _functions.generateUUID)())
|
709
574
|
}, {
|
710
575
|
value: 'place_holder_tag_2',
|
711
|
-
text:
|
712
|
-
|
713
|
-
}),
|
714
|
-
key: "tags_option_".concat(_UUID["default"].uuid())
|
576
|
+
text: "Place holder option 2",
|
577
|
+
key: "tags_option_".concat((0, _functions.generateUUID)())
|
715
578
|
}, {
|
716
579
|
value: 'place_holder_tag_3',
|
717
|
-
text:
|
718
|
-
|
719
|
-
}),
|
720
|
-
key: "tags_option_".concat(_UUID["default"].uuid())
|
580
|
+
text: "Place holder option 3",
|
581
|
+
key: "tags_option_".concat((0, _functions.generateUUID)())
|
721
582
|
}];
|
722
583
|
case 'Checkboxes':
|
723
584
|
return [{
|
724
585
|
value: 'place_holder_option_1',
|
725
|
-
text:
|
726
|
-
|
727
|
-
}),
|
728
|
-
key: "checkboxes_option_".concat(_UUID["default"].uuid())
|
586
|
+
text: "Place holder option 1",
|
587
|
+
key: "checkboxes_option_".concat((0, _functions.generateUUID)())
|
729
588
|
}, {
|
730
589
|
value: 'place_holder_option_2',
|
731
|
-
text:
|
732
|
-
|
733
|
-
}),
|
734
|
-
key: "checkboxes_option_".concat(_UUID["default"].uuid())
|
590
|
+
text: "Place holder option 2",
|
591
|
+
key: "checkboxes_option_".concat((0, _functions.generateUUID)())
|
735
592
|
}, {
|
736
593
|
value: 'place_holder_option_3',
|
737
|
-
text:
|
738
|
-
|
739
|
-
}),
|
740
|
-
key: "checkboxes_option_".concat(_UUID["default"].uuid())
|
594
|
+
text: "Place holder option 3",
|
595
|
+
key: "checkboxes_option_".concat((0, _functions.generateUUID)())
|
741
596
|
}];
|
742
597
|
case 'RadioButtons':
|
743
598
|
return [{
|
744
599
|
value: 'place_holder_option_1',
|
745
|
-
text:
|
746
|
-
|
747
|
-
}),
|
748
|
-
key: "radiobuttons_option_".concat(_UUID["default"].uuid())
|
600
|
+
text: "Place holder option 1",
|
601
|
+
key: "radiobuttons_option_".concat((0, _functions.generateUUID)())
|
749
602
|
}, {
|
750
603
|
value: 'place_holder_option_2',
|
751
|
-
text:
|
752
|
-
|
753
|
-
}),
|
754
|
-
key: "radiobuttons_option_".concat(_UUID["default"].uuid())
|
604
|
+
text: "Place holder option 2",
|
605
|
+
key: "radiobuttons_option_".concat((0, _functions.generateUUID)())
|
755
606
|
}, {
|
756
607
|
value: 'place_holder_option_3',
|
757
|
-
text:
|
758
|
-
|
759
|
-
}),
|
760
|
-
key: "radiobuttons_option_".concat(_UUID["default"].uuid())
|
608
|
+
text: "Place holder option 3",
|
609
|
+
key: "radiobuttons_option_".concat((0, _functions.generateUUID)())
|
761
610
|
}];
|
762
611
|
default:
|
763
612
|
return [];
|
@@ -766,4 +615,4 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
|
|
766
615
|
}]);
|
767
616
|
return Toolbar;
|
768
617
|
}(_react["default"].Component);
|
769
|
-
var _default = exports["default"] =
|
618
|
+
var _default = exports["default"] = Toolbar;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-survey-builder",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.43",
|
4
4
|
"description": "A complete survey builder for react.",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"types": "types/index.d.ts",
|
@@ -44,15 +44,17 @@
|
|
44
44
|
"moment": "^2.30.1",
|
45
45
|
"moment-timezone": "^0.5.44",
|
46
46
|
"prop-types": "^15.7.2",
|
47
|
+
"react": "^18.2.0",
|
48
|
+
"react-bootstrap": "^2.10.2",
|
47
49
|
"react-bootstrap-range-slider": "^3.0.8",
|
48
50
|
"react-bootstrap-typeahead": "^6.3.2",
|
49
51
|
"react-dnd": "^11.1.3",
|
50
52
|
"react-dnd-html5-backend": "^11.1.3",
|
53
|
+
"react-dom": "^18.2.0",
|
51
54
|
"react-draft-wysiwyg": "^1.15.0",
|
52
55
|
"react-hook-form": "^7.45.4",
|
53
56
|
"react-icons": "^5.0.1",
|
54
|
-
"react-imask": "^7.
|
55
|
-
"react-intl": "^5.24.3",
|
57
|
+
"react-imask": "^7.6.0",
|
56
58
|
"react-phone-number-input": "^3.3.9",
|
57
59
|
"react-signature-canvas": "^1.0.3",
|
58
60
|
"react-simple-wysiwyg": "^3.0.2",
|
@@ -87,9 +89,6 @@
|
|
87
89
|
"eslint-plugin-react": "^7.22.0",
|
88
90
|
"express": "^4.17.1",
|
89
91
|
"multer": "^1.4.2",
|
90
|
-
"react": "^18.2.0",
|
91
|
-
"react-bootstrap": "^2.10.2",
|
92
|
-
"react-dom": "^18.2.0",
|
93
92
|
"rimraf": "^3.0.2",
|
94
93
|
"sass": "^1.69.7",
|
95
94
|
"sass-loader": "^14.0.0",
|