react-form-builder-more-flexibility 1.0.55 → 1.0.58
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/README.md +154 -120
- package/dist/845.app.js +1 -0
- package/dist/app.css +1 -38
- package/dist/app.css.map +1 -1
- package/dist/app.js +2 -45
- package/dist/app.js.LICENSE.txt +85 -0
- package/lib/dynamic-option-list.js +8 -9
- package/lib/fieldset/FieldSet.js +1 -2
- package/lib/form-dynamic-edit.js +6 -7
- package/lib/form-elements/component-drag-handle.js +49 -74
- package/lib/form-elements/component-drag-layer.js +18 -17
- package/lib/form-elements/component-drag-preview.js +2 -11
- package/lib/form-elements/custom-element.js +7 -10
- package/lib/form-elements/date-picker.js +6 -8
- package/lib/form-elements/header-bar.js +8 -10
- package/lib/form-elements/index.js +137 -182
- package/lib/form-elements/star-rating.js +94 -85
- package/lib/form-elements-edit.js +26 -8
- package/lib/form-place-holder.js +6 -8
- package/lib/form-validator.js +6 -8
- package/lib/form.js +77 -77
- package/lib/functions/index.js +1 -2
- package/lib/index.js +7 -10
- package/lib/multi-column/MultiColumnRow.js +6 -8
- package/lib/multi-column/dustbin.js +59 -73
- package/lib/multi-column/grip.js +1 -1
- package/lib/preview.js +20 -20
- package/lib/sortable-element.js +167 -141
- package/lib/toolbar-draggable-item.js +41 -45
- package/lib/toolbar-group-item.js +1 -2
- package/lib/toolbar.js +12 -12
- package/package.json +22 -21
- package/types/index.d.ts +2 -0
- package/dist/1.app.js +0 -1
|
@@ -8,13 +8,12 @@ exports["default"] = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
14
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
18
17
|
var _isomorphicFetch = _interopRequireDefault(require("isomorphic-fetch"));
|
|
19
18
|
var _fileSaver = require("file-saver");
|
|
20
19
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -28,17 +27,16 @@ var _componentLabel = _interopRequireDefault(require("./component-label"));
|
|
|
28
27
|
var _myxss = _interopRequireDefault(require("./myxss"));
|
|
29
28
|
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; }
|
|
30
29
|
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; }
|
|
31
|
-
function
|
|
32
|
-
function _isNativeReflectConstruct() {
|
|
30
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
31
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable quote-props */ // eslint-disable-next-line max-classes-per-file
|
|
33
32
|
var FormElements = {};
|
|
34
33
|
var Header = /*#__PURE__*/function (_React$Component) {
|
|
35
|
-
(0, _inherits2["default"])(Header, _React$Component);
|
|
36
|
-
var _super = _createSuper(Header);
|
|
37
34
|
function Header() {
|
|
38
35
|
(0, _classCallCheck2["default"])(this, Header);
|
|
39
|
-
return
|
|
36
|
+
return _callSuper(this, Header, arguments);
|
|
40
37
|
}
|
|
41
|
-
(0,
|
|
38
|
+
(0, _inherits2["default"])(Header, _React$Component);
|
|
39
|
+
return (0, _createClass2["default"])(Header, [{
|
|
42
40
|
key: "render",
|
|
43
41
|
value: function render() {
|
|
44
42
|
// const headerClasses = `dynamic-input ${this.props.data.element}-input`;
|
|
@@ -64,16 +62,14 @@ var Header = /*#__PURE__*/function (_React$Component) {
|
|
|
64
62
|
}));
|
|
65
63
|
}
|
|
66
64
|
}]);
|
|
67
|
-
return Header;
|
|
68
65
|
}(_react["default"].Component);
|
|
69
66
|
var Paragraph = /*#__PURE__*/function (_React$Component2) {
|
|
70
|
-
(0, _inherits2["default"])(Paragraph, _React$Component2);
|
|
71
|
-
var _super2 = _createSuper(Paragraph);
|
|
72
67
|
function Paragraph() {
|
|
73
68
|
(0, _classCallCheck2["default"])(this, Paragraph);
|
|
74
|
-
return
|
|
69
|
+
return _callSuper(this, Paragraph, arguments);
|
|
75
70
|
}
|
|
76
|
-
(0,
|
|
71
|
+
(0, _inherits2["default"])(Paragraph, _React$Component2);
|
|
72
|
+
return (0, _createClass2["default"])(Paragraph, [{
|
|
77
73
|
key: "render",
|
|
78
74
|
value: function render() {
|
|
79
75
|
var classNames = 'static';
|
|
@@ -98,16 +94,14 @@ var Paragraph = /*#__PURE__*/function (_React$Component2) {
|
|
|
98
94
|
}));
|
|
99
95
|
}
|
|
100
96
|
}]);
|
|
101
|
-
return Paragraph;
|
|
102
97
|
}(_react["default"].Component);
|
|
103
98
|
var Label = /*#__PURE__*/function (_React$Component3) {
|
|
104
|
-
(0, _inherits2["default"])(Label, _React$Component3);
|
|
105
|
-
var _super3 = _createSuper(Label);
|
|
106
99
|
function Label() {
|
|
107
100
|
(0, _classCallCheck2["default"])(this, Label);
|
|
108
|
-
return
|
|
101
|
+
return _callSuper(this, Label, arguments);
|
|
109
102
|
}
|
|
110
|
-
(0,
|
|
103
|
+
(0, _inherits2["default"])(Label, _React$Component3);
|
|
104
|
+
return (0, _createClass2["default"])(Label, [{
|
|
111
105
|
key: "render",
|
|
112
106
|
value: function render() {
|
|
113
107
|
var classNames = 'static';
|
|
@@ -132,16 +126,14 @@ var Label = /*#__PURE__*/function (_React$Component3) {
|
|
|
132
126
|
}));
|
|
133
127
|
}
|
|
134
128
|
}]);
|
|
135
|
-
return Label;
|
|
136
129
|
}(_react["default"].Component);
|
|
137
130
|
var LineBreak = /*#__PURE__*/function (_React$Component4) {
|
|
138
|
-
(0, _inherits2["default"])(LineBreak, _React$Component4);
|
|
139
|
-
var _super4 = _createSuper(LineBreak);
|
|
140
131
|
function LineBreak() {
|
|
141
132
|
(0, _classCallCheck2["default"])(this, LineBreak);
|
|
142
|
-
return
|
|
133
|
+
return _callSuper(this, LineBreak, arguments);
|
|
143
134
|
}
|
|
144
|
-
(0,
|
|
135
|
+
(0, _inherits2["default"])(LineBreak, _React$Component4);
|
|
136
|
+
return (0, _createClass2["default"])(LineBreak, [{
|
|
145
137
|
key: "render",
|
|
146
138
|
value: function render() {
|
|
147
139
|
var baseClasses = 'SortableItem rfb-item';
|
|
@@ -154,19 +146,17 @@ var LineBreak = /*#__PURE__*/function (_React$Component4) {
|
|
|
154
146
|
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement("hr", null));
|
|
155
147
|
}
|
|
156
148
|
}]);
|
|
157
|
-
return LineBreak;
|
|
158
149
|
}(_react["default"].Component);
|
|
159
150
|
var TextInput = /*#__PURE__*/function (_React$Component5) {
|
|
160
|
-
(0, _inherits2["default"])(TextInput, _React$Component5);
|
|
161
|
-
var _super5 = _createSuper(TextInput);
|
|
162
151
|
function TextInput(props) {
|
|
163
152
|
var _this;
|
|
164
153
|
(0, _classCallCheck2["default"])(this, TextInput);
|
|
165
|
-
_this =
|
|
154
|
+
_this = _callSuper(this, TextInput, [props]);
|
|
166
155
|
_this.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
167
156
|
return _this;
|
|
168
157
|
}
|
|
169
|
-
(0,
|
|
158
|
+
(0, _inherits2["default"])(TextInput, _React$Component5);
|
|
159
|
+
return (0, _createClass2["default"])(TextInput, [{
|
|
170
160
|
key: "render",
|
|
171
161
|
value: function render() {
|
|
172
162
|
var props = {};
|
|
@@ -193,19 +183,17 @@ var TextInput = /*#__PURE__*/function (_React$Component5) {
|
|
|
193
183
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("input", props)));
|
|
194
184
|
}
|
|
195
185
|
}]);
|
|
196
|
-
return TextInput;
|
|
197
186
|
}(_react["default"].Component);
|
|
198
187
|
var EmailInput = /*#__PURE__*/function (_React$Component6) {
|
|
199
|
-
(0, _inherits2["default"])(EmailInput, _React$Component6);
|
|
200
|
-
var _super6 = _createSuper(EmailInput);
|
|
201
188
|
function EmailInput(props) {
|
|
202
189
|
var _this2;
|
|
203
190
|
(0, _classCallCheck2["default"])(this, EmailInput);
|
|
204
|
-
_this2 =
|
|
191
|
+
_this2 = _callSuper(this, EmailInput, [props]);
|
|
205
192
|
_this2.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
206
193
|
return _this2;
|
|
207
194
|
}
|
|
208
|
-
(0,
|
|
195
|
+
(0, _inherits2["default"])(EmailInput, _React$Component6);
|
|
196
|
+
return (0, _createClass2["default"])(EmailInput, [{
|
|
209
197
|
key: "render",
|
|
210
198
|
value: function render() {
|
|
211
199
|
var props = {};
|
|
@@ -232,19 +220,17 @@ var EmailInput = /*#__PURE__*/function (_React$Component6) {
|
|
|
232
220
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("input", props)));
|
|
233
221
|
}
|
|
234
222
|
}]);
|
|
235
|
-
return EmailInput;
|
|
236
223
|
}(_react["default"].Component);
|
|
237
224
|
var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
|
|
238
|
-
(0, _inherits2["default"])(PhoneNumber, _React$Component7);
|
|
239
|
-
var _super7 = _createSuper(PhoneNumber);
|
|
240
225
|
function PhoneNumber(props) {
|
|
241
226
|
var _this3;
|
|
242
227
|
(0, _classCallCheck2["default"])(this, PhoneNumber);
|
|
243
|
-
_this3 =
|
|
228
|
+
_this3 = _callSuper(this, PhoneNumber, [props]);
|
|
244
229
|
_this3.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
245
230
|
return _this3;
|
|
246
231
|
}
|
|
247
|
-
(0,
|
|
232
|
+
(0, _inherits2["default"])(PhoneNumber, _React$Component7);
|
|
233
|
+
return (0, _createClass2["default"])(PhoneNumber, [{
|
|
248
234
|
key: "render",
|
|
249
235
|
value: function render() {
|
|
250
236
|
var props = {};
|
|
@@ -271,19 +257,17 @@ var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
|
|
|
271
257
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("input", props)));
|
|
272
258
|
}
|
|
273
259
|
}]);
|
|
274
|
-
return PhoneNumber;
|
|
275
260
|
}(_react["default"].Component);
|
|
276
261
|
var NumberInput = /*#__PURE__*/function (_React$Component8) {
|
|
277
|
-
(0, _inherits2["default"])(NumberInput, _React$Component8);
|
|
278
|
-
var _super8 = _createSuper(NumberInput);
|
|
279
262
|
function NumberInput(props) {
|
|
280
263
|
var _this4;
|
|
281
264
|
(0, _classCallCheck2["default"])(this, NumberInput);
|
|
282
|
-
_this4 =
|
|
265
|
+
_this4 = _callSuper(this, NumberInput, [props]);
|
|
283
266
|
_this4.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
284
267
|
return _this4;
|
|
285
268
|
}
|
|
286
|
-
(0,
|
|
269
|
+
(0, _inherits2["default"])(NumberInput, _React$Component8);
|
|
270
|
+
return (0, _createClass2["default"])(NumberInput, [{
|
|
287
271
|
key: "render",
|
|
288
272
|
value: function render() {
|
|
289
273
|
var props = {};
|
|
@@ -310,19 +294,17 @@ var NumberInput = /*#__PURE__*/function (_React$Component8) {
|
|
|
310
294
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("input", props)));
|
|
311
295
|
}
|
|
312
296
|
}]);
|
|
313
|
-
return NumberInput;
|
|
314
297
|
}(_react["default"].Component);
|
|
315
298
|
var TextArea = /*#__PURE__*/function (_React$Component9) {
|
|
316
|
-
(0, _inherits2["default"])(TextArea, _React$Component9);
|
|
317
|
-
var _super9 = _createSuper(TextArea);
|
|
318
299
|
function TextArea(props) {
|
|
319
300
|
var _this5;
|
|
320
301
|
(0, _classCallCheck2["default"])(this, TextArea);
|
|
321
|
-
_this5 =
|
|
302
|
+
_this5 = _callSuper(this, TextArea, [props]);
|
|
322
303
|
_this5.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
323
304
|
return _this5;
|
|
324
305
|
}
|
|
325
|
-
(0,
|
|
306
|
+
(0, _inherits2["default"])(TextArea, _React$Component9);
|
|
307
|
+
return (0, _createClass2["default"])(TextArea, [{
|
|
326
308
|
key: "render",
|
|
327
309
|
value: function render() {
|
|
328
310
|
var props = {};
|
|
@@ -348,19 +330,17 @@ var TextArea = /*#__PURE__*/function (_React$Component9) {
|
|
|
348
330
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("textarea", props)));
|
|
349
331
|
}
|
|
350
332
|
}]);
|
|
351
|
-
return TextArea;
|
|
352
333
|
}(_react["default"].Component);
|
|
353
|
-
var Dropdown = /*#__PURE__*/function (_React$
|
|
354
|
-
(0, _inherits2["default"])(Dropdown, _React$Component10);
|
|
355
|
-
var _super10 = _createSuper(Dropdown);
|
|
334
|
+
var Dropdown = /*#__PURE__*/function (_React$Component0) {
|
|
356
335
|
function Dropdown(props) {
|
|
357
336
|
var _this6;
|
|
358
337
|
(0, _classCallCheck2["default"])(this, Dropdown);
|
|
359
|
-
_this6 =
|
|
338
|
+
_this6 = _callSuper(this, Dropdown, [props]);
|
|
360
339
|
_this6.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
361
340
|
return _this6;
|
|
362
341
|
}
|
|
363
|
-
(0,
|
|
342
|
+
(0, _inherits2["default"])(Dropdown, _React$Component0);
|
|
343
|
+
return (0, _createClass2["default"])(Dropdown, [{
|
|
364
344
|
key: "render",
|
|
365
345
|
value: function render() {
|
|
366
346
|
var props = {};
|
|
@@ -391,16 +371,13 @@ var Dropdown = /*#__PURE__*/function (_React$Component10) {
|
|
|
391
371
|
}))));
|
|
392
372
|
}
|
|
393
373
|
}]);
|
|
394
|
-
return Dropdown;
|
|
395
374
|
}(_react["default"].Component);
|
|
396
|
-
var Signature = /*#__PURE__*/function (_React$
|
|
397
|
-
(0, _inherits2["default"])(Signature, _React$Component11);
|
|
398
|
-
var _super11 = _createSuper(Signature);
|
|
375
|
+
var Signature = /*#__PURE__*/function (_React$Component1) {
|
|
399
376
|
function Signature(props) {
|
|
400
377
|
var _this7;
|
|
401
378
|
(0, _classCallCheck2["default"])(this, Signature);
|
|
402
|
-
_this7 =
|
|
403
|
-
(0, _defineProperty2["default"])(
|
|
379
|
+
_this7 = _callSuper(this, Signature, [props]);
|
|
380
|
+
(0, _defineProperty2["default"])(_this7, "clear", function () {
|
|
404
381
|
if (_this7.state.defaultValue) {
|
|
405
382
|
_this7.setState({
|
|
406
383
|
defaultValue: ''
|
|
@@ -416,7 +393,8 @@ var Signature = /*#__PURE__*/function (_React$Component11) {
|
|
|
416
393
|
_this7.canvas = /*#__PURE__*/_react["default"].createRef();
|
|
417
394
|
return _this7;
|
|
418
395
|
}
|
|
419
|
-
(0,
|
|
396
|
+
(0, _inherits2["default"])(Signature, _React$Component1);
|
|
397
|
+
return (0, _createClass2["default"])(Signature, [{
|
|
420
398
|
key: "render",
|
|
421
399
|
value: function render() {
|
|
422
400
|
var defaultValue = this.state.defaultValue;
|
|
@@ -458,17 +436,14 @@ var Signature = /*#__PURE__*/function (_React$Component11) {
|
|
|
458
436
|
}), /*#__PURE__*/_react["default"].createElement("input", props)));
|
|
459
437
|
}
|
|
460
438
|
}]);
|
|
461
|
-
return Signature;
|
|
462
439
|
}(_react["default"].Component);
|
|
463
|
-
var Tags = /*#__PURE__*/function (_React$
|
|
464
|
-
(0, _inherits2["default"])(Tags, _React$Component12);
|
|
465
|
-
var _super12 = _createSuper(Tags);
|
|
440
|
+
var Tags = /*#__PURE__*/function (_React$Component10) {
|
|
466
441
|
function Tags(props) {
|
|
467
442
|
var _this8;
|
|
468
443
|
(0, _classCallCheck2["default"])(this, Tags);
|
|
469
|
-
_this8 =
|
|
444
|
+
_this8 = _callSuper(this, Tags, [props]);
|
|
470
445
|
// state = { value: this.props.defaultValue !== undefined ? this.props.defaultValue.split(',') : [] };
|
|
471
|
-
(0, _defineProperty2["default"])(
|
|
446
|
+
(0, _defineProperty2["default"])(_this8, "handleChange", function (e) {
|
|
472
447
|
_this8.setState({
|
|
473
448
|
value: e || []
|
|
474
449
|
});
|
|
@@ -481,7 +456,8 @@ var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
|
481
456
|
};
|
|
482
457
|
return _this8;
|
|
483
458
|
}
|
|
484
|
-
(0,
|
|
459
|
+
(0, _inherits2["default"])(Tags, _React$Component10);
|
|
460
|
+
return (0, _createClass2["default"])(Tags, [{
|
|
485
461
|
key: "getDefaultValue",
|
|
486
462
|
value: function getDefaultValue(defaultValue, options) {
|
|
487
463
|
if (defaultValue) {
|
|
@@ -531,22 +507,20 @@ var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
|
531
507
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactSelect["default"], props)));
|
|
532
508
|
}
|
|
533
509
|
}]);
|
|
534
|
-
return Tags;
|
|
535
510
|
}(_react["default"].Component);
|
|
536
|
-
var Checkboxes = /*#__PURE__*/function (_React$
|
|
537
|
-
(0, _inherits2["default"])(Checkboxes, _React$Component13);
|
|
538
|
-
var _super13 = _createSuper(Checkboxes);
|
|
511
|
+
var Checkboxes = /*#__PURE__*/function (_React$Component11) {
|
|
539
512
|
function Checkboxes(props) {
|
|
540
513
|
var _this9;
|
|
541
514
|
(0, _classCallCheck2["default"])(this, Checkboxes);
|
|
542
|
-
_this9 =
|
|
515
|
+
_this9 = _callSuper(this, Checkboxes, [props]);
|
|
543
516
|
_this9.options = {};
|
|
544
517
|
return _this9;
|
|
545
518
|
}
|
|
546
|
-
(0,
|
|
519
|
+
(0, _inherits2["default"])(Checkboxes, _React$Component11);
|
|
520
|
+
return (0, _createClass2["default"])(Checkboxes, [{
|
|
547
521
|
key: "render",
|
|
548
522
|
value: function render() {
|
|
549
|
-
var
|
|
523
|
+
var _this0 = this;
|
|
550
524
|
var self = this;
|
|
551
525
|
var classNames = 'custom-control custom-checkbox';
|
|
552
526
|
if (this.props.data.inline) {
|
|
@@ -568,9 +542,9 @@ var Checkboxes = /*#__PURE__*/function (_React$Component13) {
|
|
|
568
542
|
props.type = 'checkbox';
|
|
569
543
|
props.value = option.value;
|
|
570
544
|
if (self.props.mutable) {
|
|
571
|
-
props.defaultChecked = self.props.defaultValue !== undefined && self.props.defaultValue.indexOf(option.key) > -1;
|
|
545
|
+
props.defaultChecked = self.props.defaultValue !== undefined && (self.props.defaultValue.indexOf(option.key) > -1 || self.props.defaultValue.indexOf(option.value) > -1);
|
|
572
546
|
}
|
|
573
|
-
if (
|
|
547
|
+
if (_this0.props.read_only) {
|
|
574
548
|
props.disabled = 'disabled';
|
|
575
549
|
}
|
|
576
550
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -591,29 +565,27 @@ var Checkboxes = /*#__PURE__*/function (_React$Component13) {
|
|
|
591
565
|
})));
|
|
592
566
|
}
|
|
593
567
|
}]);
|
|
594
|
-
return Checkboxes;
|
|
595
568
|
}(_react["default"].Component);
|
|
596
|
-
var Checkbox = /*#__PURE__*/function (_React$
|
|
597
|
-
(0, _inherits2["default"])(Checkbox, _React$Component14);
|
|
598
|
-
var _super14 = _createSuper(Checkbox);
|
|
569
|
+
var Checkbox = /*#__PURE__*/function (_React$Component12) {
|
|
599
570
|
function Checkbox(props) {
|
|
600
|
-
var
|
|
571
|
+
var _this1;
|
|
601
572
|
(0, _classCallCheck2["default"])(this, Checkbox);
|
|
602
|
-
|
|
603
|
-
(0, _defineProperty2["default"])(
|
|
604
|
-
if (
|
|
605
|
-
|
|
573
|
+
_this1 = _callSuper(this, Checkbox, [props]);
|
|
574
|
+
(0, _defineProperty2["default"])(_this1, "clickDetected", function () {
|
|
575
|
+
if (_this1.props.onCheckboxClick) {
|
|
576
|
+
_this1.props.onCheckboxClick(_this1.props.data); // Pass the field name or data to the parent component
|
|
606
577
|
}
|
|
607
578
|
});
|
|
608
|
-
(0, _defineProperty2["default"])(
|
|
609
|
-
if (
|
|
610
|
-
|
|
579
|
+
(0, _defineProperty2["default"])(_this1, "handleLabelClick", function () {
|
|
580
|
+
if (_this1.props.data && _this1.props.data.hasPopUp) {
|
|
581
|
+
_this1.clickDetected();
|
|
611
582
|
}
|
|
612
583
|
});
|
|
613
|
-
|
|
614
|
-
return
|
|
584
|
+
_this1.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
585
|
+
return _this1;
|
|
615
586
|
}
|
|
616
|
-
(0,
|
|
587
|
+
(0, _inherits2["default"])(Checkbox, _React$Component12);
|
|
588
|
+
return (0, _createClass2["default"])(Checkbox, [{
|
|
617
589
|
key: "render",
|
|
618
590
|
value: function render() {
|
|
619
591
|
var baseClasses = 'SortableItem rfb-item';
|
|
@@ -653,22 +625,20 @@ var Checkbox = /*#__PURE__*/function (_React$Component14) {
|
|
|
653
625
|
}))));
|
|
654
626
|
}
|
|
655
627
|
}]);
|
|
656
|
-
return Checkbox;
|
|
657
628
|
}(_react["default"].Component);
|
|
658
|
-
var RadioButtons = /*#__PURE__*/function (_React$
|
|
659
|
-
(0, _inherits2["default"])(RadioButtons, _React$Component15);
|
|
660
|
-
var _super15 = _createSuper(RadioButtons);
|
|
629
|
+
var RadioButtons = /*#__PURE__*/function (_React$Component13) {
|
|
661
630
|
function RadioButtons(props) {
|
|
662
|
-
var
|
|
631
|
+
var _this10;
|
|
663
632
|
(0, _classCallCheck2["default"])(this, RadioButtons);
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
return
|
|
633
|
+
_this10 = _callSuper(this, RadioButtons, [props]);
|
|
634
|
+
_this10.options = {};
|
|
635
|
+
return _this10;
|
|
667
636
|
}
|
|
668
|
-
(0,
|
|
637
|
+
(0, _inherits2["default"])(RadioButtons, _React$Component13);
|
|
638
|
+
return (0, _createClass2["default"])(RadioButtons, [{
|
|
669
639
|
key: "render",
|
|
670
640
|
value: function render() {
|
|
671
|
-
var
|
|
641
|
+
var _this11 = this;
|
|
672
642
|
var self = this;
|
|
673
643
|
var classNames = 'custom-control custom-radio';
|
|
674
644
|
if (this.props.data.inline) {
|
|
@@ -692,7 +662,7 @@ var RadioButtons = /*#__PURE__*/function (_React$Component15) {
|
|
|
692
662
|
if (self.props.mutable) {
|
|
693
663
|
props.defaultChecked = self.props.defaultValue !== undefined && (self.props.defaultValue.indexOf(option.key) > -1 || self.props.defaultValue.indexOf(option.value) > -1);
|
|
694
664
|
}
|
|
695
|
-
if (
|
|
665
|
+
if (_this11.props.read_only) {
|
|
696
666
|
props.disabled = 'disabled';
|
|
697
667
|
}
|
|
698
668
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -713,16 +683,14 @@ var RadioButtons = /*#__PURE__*/function (_React$Component15) {
|
|
|
713
683
|
})));
|
|
714
684
|
}
|
|
715
685
|
}]);
|
|
716
|
-
return RadioButtons;
|
|
717
686
|
}(_react["default"].Component);
|
|
718
|
-
var Image = /*#__PURE__*/function (_React$
|
|
719
|
-
(0, _inherits2["default"])(Image, _React$Component16);
|
|
720
|
-
var _super16 = _createSuper(Image);
|
|
687
|
+
var Image = /*#__PURE__*/function (_React$Component14) {
|
|
721
688
|
function Image() {
|
|
722
689
|
(0, _classCallCheck2["default"])(this, Image);
|
|
723
|
-
return
|
|
690
|
+
return _callSuper(this, Image, arguments);
|
|
724
691
|
}
|
|
725
|
-
(0,
|
|
692
|
+
(0, _inherits2["default"])(Image, _React$Component14);
|
|
693
|
+
return (0, _createClass2["default"])(Image, [{
|
|
726
694
|
key: "render",
|
|
727
695
|
value: function render() {
|
|
728
696
|
var style = this.props.data.center ? {
|
|
@@ -744,19 +712,17 @@ var Image = /*#__PURE__*/function (_React$Component16) {
|
|
|
744
712
|
}, "No Image"));
|
|
745
713
|
}
|
|
746
714
|
}]);
|
|
747
|
-
return Image;
|
|
748
715
|
}(_react["default"].Component);
|
|
749
|
-
var Rating = /*#__PURE__*/function (_React$
|
|
750
|
-
(0, _inherits2["default"])(Rating, _React$Component17);
|
|
751
|
-
var _super17 = _createSuper(Rating);
|
|
716
|
+
var Rating = /*#__PURE__*/function (_React$Component15) {
|
|
752
717
|
function Rating(props) {
|
|
753
|
-
var
|
|
718
|
+
var _this12;
|
|
754
719
|
(0, _classCallCheck2["default"])(this, Rating);
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
return
|
|
720
|
+
_this12 = _callSuper(this, Rating, [props]);
|
|
721
|
+
_this12.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
722
|
+
return _this12;
|
|
758
723
|
}
|
|
759
|
-
(0,
|
|
724
|
+
(0, _inherits2["default"])(Rating, _React$Component15);
|
|
725
|
+
return (0, _createClass2["default"])(Rating, [{
|
|
760
726
|
key: "render",
|
|
761
727
|
value: function render() {
|
|
762
728
|
var props = {};
|
|
@@ -780,16 +746,14 @@ var Rating = /*#__PURE__*/function (_React$Component17) {
|
|
|
780
746
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement(_starRating["default"], props)));
|
|
781
747
|
}
|
|
782
748
|
}]);
|
|
783
|
-
return Rating;
|
|
784
749
|
}(_react["default"].Component);
|
|
785
|
-
var HyperLink = /*#__PURE__*/function (_React$
|
|
786
|
-
(0, _inherits2["default"])(HyperLink, _React$Component18);
|
|
787
|
-
var _super18 = _createSuper(HyperLink);
|
|
750
|
+
var HyperLink = /*#__PURE__*/function (_React$Component16) {
|
|
788
751
|
function HyperLink() {
|
|
789
752
|
(0, _classCallCheck2["default"])(this, HyperLink);
|
|
790
|
-
return
|
|
753
|
+
return _callSuper(this, HyperLink, arguments);
|
|
791
754
|
}
|
|
792
|
-
(0,
|
|
755
|
+
(0, _inherits2["default"])(HyperLink, _React$Component16);
|
|
756
|
+
return (0, _createClass2["default"])(HyperLink, [{
|
|
793
757
|
key: "render",
|
|
794
758
|
value: function render() {
|
|
795
759
|
var baseClasses = 'SortableItem rfb-item';
|
|
@@ -812,16 +776,14 @@ var HyperLink = /*#__PURE__*/function (_React$Component18) {
|
|
|
812
776
|
}))));
|
|
813
777
|
}
|
|
814
778
|
}]);
|
|
815
|
-
return HyperLink;
|
|
816
779
|
}(_react["default"].Component);
|
|
817
|
-
var Download = /*#__PURE__*/function (_React$
|
|
818
|
-
(0, _inherits2["default"])(Download, _React$Component19);
|
|
819
|
-
var _super19 = _createSuper(Download);
|
|
780
|
+
var Download = /*#__PURE__*/function (_React$Component17) {
|
|
820
781
|
function Download() {
|
|
821
782
|
(0, _classCallCheck2["default"])(this, Download);
|
|
822
|
-
return
|
|
783
|
+
return _callSuper(this, Download, arguments);
|
|
823
784
|
}
|
|
824
|
-
(0,
|
|
785
|
+
(0, _inherits2["default"])(Download, _React$Component17);
|
|
786
|
+
return (0, _createClass2["default"])(Download, [{
|
|
825
787
|
key: "render",
|
|
826
788
|
value: function render() {
|
|
827
789
|
var baseClasses = 'SortableItem rfb-item';
|
|
@@ -838,17 +800,14 @@ var Download = /*#__PURE__*/function (_React$Component19) {
|
|
|
838
800
|
}, this.props.data.content)));
|
|
839
801
|
}
|
|
840
802
|
}]);
|
|
841
|
-
return Download;
|
|
842
803
|
}(_react["default"].Component);
|
|
843
|
-
var Camera = /*#__PURE__*/function (_React$
|
|
844
|
-
(0, _inherits2["default"])(Camera, _React$Component20);
|
|
845
|
-
var _super20 = _createSuper(Camera);
|
|
804
|
+
var Camera = /*#__PURE__*/function (_React$Component18) {
|
|
846
805
|
function Camera(props) {
|
|
847
|
-
var
|
|
806
|
+
var _this13;
|
|
848
807
|
(0, _classCallCheck2["default"])(this, Camera);
|
|
849
|
-
|
|
850
|
-
(0, _defineProperty2["default"])(
|
|
851
|
-
var self =
|
|
808
|
+
_this13 = _callSuper(this, Camera, [props]);
|
|
809
|
+
(0, _defineProperty2["default"])(_this13, "displayImage", function (e) {
|
|
810
|
+
var self = _this13;
|
|
852
811
|
var target = e.target;
|
|
853
812
|
if (target.files && target.files.length) {
|
|
854
813
|
self.setState({
|
|
@@ -857,19 +816,20 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
|
857
816
|
});
|
|
858
817
|
}
|
|
859
818
|
});
|
|
860
|
-
(0, _defineProperty2["default"])(
|
|
861
|
-
|
|
819
|
+
(0, _defineProperty2["default"])(_this13, "clearImage", function () {
|
|
820
|
+
_this13.setState({
|
|
862
821
|
img: null,
|
|
863
822
|
previewImg: null
|
|
864
823
|
});
|
|
865
824
|
});
|
|
866
|
-
|
|
825
|
+
_this13.state = {
|
|
867
826
|
img: null,
|
|
868
827
|
previewImg: null
|
|
869
828
|
};
|
|
870
|
-
return
|
|
829
|
+
return _this13;
|
|
871
830
|
}
|
|
872
|
-
(0,
|
|
831
|
+
(0, _inherits2["default"])(Camera, _React$Component18);
|
|
832
|
+
return (0, _createClass2["default"])(Camera, [{
|
|
873
833
|
key: "getImageSizeProps",
|
|
874
834
|
value: function getImageSizeProps(_ref) {
|
|
875
835
|
var width = _ref.width,
|
|
@@ -888,7 +848,7 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
|
888
848
|
}, {
|
|
889
849
|
key: "render",
|
|
890
850
|
value: function render() {
|
|
891
|
-
var
|
|
851
|
+
var _this14 = this;
|
|
892
852
|
var imageStyle = {
|
|
893
853
|
objectFit: 'scale-down',
|
|
894
854
|
objectPosition: this.props.data.center ? 'center' : 'left'
|
|
@@ -936,7 +896,7 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
|
936
896
|
className: "fas fa-camera"
|
|
937
897
|
}), " Upload Photo"), /*#__PURE__*/_react["default"].createElement("p", null, "Select an image from your computer or device."))), this.state.img && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
|
|
938
898
|
onLoad: function onLoad() {
|
|
939
|
-
return URL.revokeObjectURL(
|
|
899
|
+
return URL.revokeObjectURL(_this14.state.previewImg);
|
|
940
900
|
},
|
|
941
901
|
src: this.state.previewImg,
|
|
942
902
|
height: "100",
|
|
@@ -949,17 +909,14 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
|
949
909
|
}), " Clear Photo")))));
|
|
950
910
|
}
|
|
951
911
|
}]);
|
|
952
|
-
return Camera;
|
|
953
912
|
}(_react["default"].Component);
|
|
954
|
-
var FileUpload = /*#__PURE__*/function (_React$
|
|
955
|
-
(0, _inherits2["default"])(FileUpload, _React$Component21);
|
|
956
|
-
var _super21 = _createSuper(FileUpload);
|
|
913
|
+
var FileUpload = /*#__PURE__*/function (_React$Component19) {
|
|
957
914
|
function FileUpload(props) {
|
|
958
|
-
var
|
|
915
|
+
var _this15;
|
|
959
916
|
(0, _classCallCheck2["default"])(this, FileUpload);
|
|
960
|
-
|
|
961
|
-
(0, _defineProperty2["default"])(
|
|
962
|
-
var self =
|
|
917
|
+
_this15 = _callSuper(this, FileUpload, [props]);
|
|
918
|
+
(0, _defineProperty2["default"])(_this15, "displayFileUpload", function (e) {
|
|
919
|
+
var self = _this15;
|
|
963
920
|
var target = e.target;
|
|
964
921
|
var file;
|
|
965
922
|
if (target.files && target.files.length > 0) {
|
|
@@ -969,38 +926,38 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
|
969
926
|
});
|
|
970
927
|
}
|
|
971
928
|
});
|
|
972
|
-
(0, _defineProperty2["default"])(
|
|
973
|
-
|
|
929
|
+
(0, _defineProperty2["default"])(_this15, "clearFileUpload", function () {
|
|
930
|
+
_this15.setState({
|
|
974
931
|
fileUpload: null
|
|
975
932
|
});
|
|
976
933
|
});
|
|
977
|
-
(0, _defineProperty2["default"])(
|
|
978
|
-
var _ref2 = (0, _asyncToGenerator2["default"])(
|
|
934
|
+
(0, _defineProperty2["default"])(_this15, "saveFile", /*#__PURE__*/function () {
|
|
935
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(e) {
|
|
979
936
|
var sourceUrl, response, dispositionHeader, resBlob, blob, fileName, _fileName;
|
|
980
|
-
return _regenerator["default"].wrap(function
|
|
937
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
981
938
|
while (1) switch (_context.prev = _context.next) {
|
|
982
939
|
case 0:
|
|
983
940
|
e.preventDefault();
|
|
984
|
-
sourceUrl =
|
|
985
|
-
_context.next =
|
|
941
|
+
sourceUrl = _this15.props.defaultValue;
|
|
942
|
+
_context.next = 1;
|
|
986
943
|
return (0, _isomorphicFetch["default"])(sourceUrl, {
|
|
987
944
|
method: 'GET',
|
|
988
945
|
headers: {
|
|
989
|
-
Accept: 'application/json',
|
|
946
|
+
'Accept': 'application/json',
|
|
990
947
|
'Content-Type': 'application/json; charset=utf-8'
|
|
991
948
|
},
|
|
992
949
|
responseType: 'blob'
|
|
993
950
|
});
|
|
994
|
-
case
|
|
951
|
+
case 1:
|
|
995
952
|
response = _context.sent;
|
|
996
953
|
dispositionHeader = response.headers.get('Content-Disposition');
|
|
997
|
-
_context.next =
|
|
954
|
+
_context.next = 2;
|
|
998
955
|
return response.blob();
|
|
999
|
-
case
|
|
956
|
+
case 2:
|
|
1000
957
|
resBlob = _context.sent;
|
|
1001
958
|
// eslint-disable-next-line no-undef
|
|
1002
959
|
blob = new Blob([resBlob], {
|
|
1003
|
-
type:
|
|
960
|
+
type: _this15.props.data.fileType || response.headers.get('Content-Type')
|
|
1004
961
|
});
|
|
1005
962
|
if (dispositionHeader && dispositionHeader.indexOf(';filename=') > -1) {
|
|
1006
963
|
fileName = dispositionHeader.split(';filename=')[1];
|
|
@@ -1009,7 +966,7 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
|
1009
966
|
_fileName = sourceUrl.substring(sourceUrl.lastIndexOf('/') + 1);
|
|
1010
967
|
(0, _fileSaver.saveAs)(response.url, _fileName);
|
|
1011
968
|
}
|
|
1012
|
-
case
|
|
969
|
+
case 3:
|
|
1013
970
|
case "end":
|
|
1014
971
|
return _context.stop();
|
|
1015
972
|
}
|
|
@@ -1019,12 +976,13 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
|
1019
976
|
return _ref2.apply(this, arguments);
|
|
1020
977
|
};
|
|
1021
978
|
}());
|
|
1022
|
-
|
|
979
|
+
_this15.state = {
|
|
1023
980
|
fileUpload: null
|
|
1024
981
|
};
|
|
1025
|
-
return
|
|
982
|
+
return _this15;
|
|
1026
983
|
}
|
|
1027
|
-
(0,
|
|
984
|
+
(0, _inherits2["default"])(FileUpload, _React$Component19);
|
|
985
|
+
return (0, _createClass2["default"])(FileUpload, [{
|
|
1028
986
|
key: "render",
|
|
1029
987
|
value: function render() {
|
|
1030
988
|
var baseClasses = 'SortableItem rfb-item';
|
|
@@ -1081,28 +1039,26 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
|
1081
1039
|
}), " Clear File")))));
|
|
1082
1040
|
}
|
|
1083
1041
|
}]);
|
|
1084
|
-
return FileUpload;
|
|
1085
1042
|
}(_react["default"].Component);
|
|
1086
|
-
var Range = /*#__PURE__*/function (_React$
|
|
1087
|
-
(0, _inherits2["default"])(Range, _React$Component22);
|
|
1088
|
-
var _super22 = _createSuper(Range);
|
|
1043
|
+
var Range = /*#__PURE__*/function (_React$Component20) {
|
|
1089
1044
|
function Range(props) {
|
|
1090
|
-
var
|
|
1045
|
+
var _this16;
|
|
1091
1046
|
(0, _classCallCheck2["default"])(this, Range);
|
|
1092
|
-
|
|
1093
|
-
(0, _defineProperty2["default"])(
|
|
1047
|
+
_this16 = _callSuper(this, Range, [props]);
|
|
1048
|
+
(0, _defineProperty2["default"])(_this16, "changeValue", function (e) {
|
|
1094
1049
|
var target = e.target;
|
|
1095
|
-
|
|
1050
|
+
_this16.setState({
|
|
1096
1051
|
value: target.value
|
|
1097
1052
|
});
|
|
1098
1053
|
});
|
|
1099
|
-
|
|
1100
|
-
|
|
1054
|
+
_this16.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
1055
|
+
_this16.state = {
|
|
1101
1056
|
value: props.defaultValue !== undefined ? parseInt(props.defaultValue, 10) : parseInt(props.data.default_value, 10)
|
|
1102
1057
|
};
|
|
1103
|
-
return
|
|
1058
|
+
return _this16;
|
|
1104
1059
|
}
|
|
1105
|
-
(0,
|
|
1060
|
+
(0, _inherits2["default"])(Range, _React$Component20);
|
|
1061
|
+
return (0, _createClass2["default"])(Range, [{
|
|
1106
1062
|
key: "render",
|
|
1107
1063
|
value: function render() {
|
|
1108
1064
|
var props = {};
|
|
@@ -1176,7 +1132,6 @@ var Range = /*#__PURE__*/function (_React$Component22) {
|
|
|
1176
1132
|
}, _datalist)));
|
|
1177
1133
|
}
|
|
1178
1134
|
}]);
|
|
1179
|
-
return Range;
|
|
1180
1135
|
}(_react["default"].Component);
|
|
1181
1136
|
FormElements.Header = Header;
|
|
1182
1137
|
FormElements.Paragraph = Paragraph;
|