@goldenpine/react-form-builder2 0.18.4-patch.1 → 0.20.3-build.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +154 -121
- 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 -71
- package/dist/app.js.LICENSE.txt +66 -0
- package/lib/ItemTypes.js +2 -3
- package/lib/UUID.js +1 -3
- package/lib/dynamic-option-list.js +10 -12
- package/lib/fieldset/FieldSet.js +3 -4
- package/lib/form-dynamic-edit.js +17 -21
- package/lib/form-elements/component-drag-handle.js +49 -75
- package/lib/form-elements/component-drag-layer.js +18 -18
- package/lib/form-elements/component-drag-preview.js +5 -15
- package/lib/form-elements/component-header.js +1 -2
- package/lib/form-elements/component-label.js +1 -2
- package/lib/form-elements/custom-element.js +10 -14
- package/lib/form-elements/date-picker.js +11 -16
- package/lib/form-elements/header-bar.js +10 -13
- package/lib/form-elements/index.js +152 -199
- package/lib/form-elements/myxss.js +1 -2
- package/lib/form-elements/star-rating.js +97 -90
- package/lib/form-elements-edit.js +7 -10
- package/lib/form-place-holder.js +7 -10
- package/lib/form-validator.js +8 -11
- package/lib/form.js +25 -30
- package/lib/functions/index.js +3 -6
- package/lib/index.js +9 -14
- package/lib/language-provider/IntlMessages.js +2 -3
- package/lib/language-provider/entries/en-us.js +3 -4
- package/lib/language-provider/entries/fa-ir.js +3 -4
- package/lib/language-provider/entries/it-it.js +3 -4
- package/lib/language-provider/entries/vi-vn.js +3 -4
- package/lib/language-provider/index.js +2 -4
- package/lib/multi-column/MultiColumnRow.js +12 -17
- package/lib/multi-column/dustbin.js +59 -74
- package/lib/multi-column/grip.js +2 -3
- package/lib/preview.js +17 -21
- package/lib/sortable-element.js +169 -143
- package/lib/sortable-form-elements.js +1 -2
- package/lib/stores/store.js +1 -2
- package/lib/toolbar-draggable-item.js +41 -46
- package/lib/toolbar-group-item.js +2 -4
- package/lib/toolbar.js +15 -19
- package/package.json +21 -28
- 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"));
|
|
@@ -26,19 +25,18 @@ var _datePicker = _interopRequireDefault(require("./date-picker"));
|
|
|
26
25
|
var _componentHeader = _interopRequireDefault(require("./component-header"));
|
|
27
26
|
var _componentLabel = _interopRequireDefault(require("./component-label"));
|
|
28
27
|
var _myxss = _interopRequireDefault(require("./myxss"));
|
|
29
|
-
function ownKeys(
|
|
30
|
-
function _objectSpread(
|
|
31
|
-
function
|
|
32
|
-
function _isNativeReflectConstruct() {
|
|
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; }
|
|
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; }
|
|
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 = {};
|
|
@@ -192,19 +182,17 @@ var TextInput = /*#__PURE__*/function (_React$Component5) {
|
|
|
192
182
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("input", props)));
|
|
193
183
|
}
|
|
194
184
|
}]);
|
|
195
|
-
return TextInput;
|
|
196
185
|
}(_react["default"].Component);
|
|
197
186
|
var EmailInput = /*#__PURE__*/function (_React$Component6) {
|
|
198
|
-
(0, _inherits2["default"])(EmailInput, _React$Component6);
|
|
199
|
-
var _super6 = _createSuper(EmailInput);
|
|
200
187
|
function EmailInput(props) {
|
|
201
188
|
var _this2;
|
|
202
189
|
(0, _classCallCheck2["default"])(this, EmailInput);
|
|
203
|
-
_this2 =
|
|
190
|
+
_this2 = _callSuper(this, EmailInput, [props]);
|
|
204
191
|
_this2.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
205
192
|
return _this2;
|
|
206
193
|
}
|
|
207
|
-
(0,
|
|
194
|
+
(0, _inherits2["default"])(EmailInput, _React$Component6);
|
|
195
|
+
return (0, _createClass2["default"])(EmailInput, [{
|
|
208
196
|
key: "render",
|
|
209
197
|
value: function render() {
|
|
210
198
|
var props = {};
|
|
@@ -230,19 +218,17 @@ var EmailInput = /*#__PURE__*/function (_React$Component6) {
|
|
|
230
218
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("input", props)));
|
|
231
219
|
}
|
|
232
220
|
}]);
|
|
233
|
-
return EmailInput;
|
|
234
221
|
}(_react["default"].Component);
|
|
235
222
|
var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
|
|
236
|
-
(0, _inherits2["default"])(PhoneNumber, _React$Component7);
|
|
237
|
-
var _super7 = _createSuper(PhoneNumber);
|
|
238
223
|
function PhoneNumber(props) {
|
|
239
224
|
var _this3;
|
|
240
225
|
(0, _classCallCheck2["default"])(this, PhoneNumber);
|
|
241
|
-
_this3 =
|
|
226
|
+
_this3 = _callSuper(this, PhoneNumber, [props]);
|
|
242
227
|
_this3.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
243
228
|
return _this3;
|
|
244
229
|
}
|
|
245
|
-
(0,
|
|
230
|
+
(0, _inherits2["default"])(PhoneNumber, _React$Component7);
|
|
231
|
+
return (0, _createClass2["default"])(PhoneNumber, [{
|
|
246
232
|
key: "render",
|
|
247
233
|
value: function render() {
|
|
248
234
|
var props = {};
|
|
@@ -268,19 +254,17 @@ var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
|
|
|
268
254
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("input", props)));
|
|
269
255
|
}
|
|
270
256
|
}]);
|
|
271
|
-
return PhoneNumber;
|
|
272
257
|
}(_react["default"].Component);
|
|
273
258
|
var NumberInput = /*#__PURE__*/function (_React$Component8) {
|
|
274
|
-
(0, _inherits2["default"])(NumberInput, _React$Component8);
|
|
275
|
-
var _super8 = _createSuper(NumberInput);
|
|
276
259
|
function NumberInput(props) {
|
|
277
260
|
var _this4;
|
|
278
261
|
(0, _classCallCheck2["default"])(this, NumberInput);
|
|
279
|
-
_this4 =
|
|
262
|
+
_this4 = _callSuper(this, NumberInput, [props]);
|
|
280
263
|
_this4.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
281
264
|
return _this4;
|
|
282
265
|
}
|
|
283
|
-
(0,
|
|
266
|
+
(0, _inherits2["default"])(NumberInput, _React$Component8);
|
|
267
|
+
return (0, _createClass2["default"])(NumberInput, [{
|
|
284
268
|
key: "render",
|
|
285
269
|
value: function render() {
|
|
286
270
|
var props = {};
|
|
@@ -306,19 +290,17 @@ var NumberInput = /*#__PURE__*/function (_React$Component8) {
|
|
|
306
290
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("input", props)));
|
|
307
291
|
}
|
|
308
292
|
}]);
|
|
309
|
-
return NumberInput;
|
|
310
293
|
}(_react["default"].Component);
|
|
311
294
|
var TextArea = /*#__PURE__*/function (_React$Component9) {
|
|
312
|
-
(0, _inherits2["default"])(TextArea, _React$Component9);
|
|
313
|
-
var _super9 = _createSuper(TextArea);
|
|
314
295
|
function TextArea(props) {
|
|
315
296
|
var _this5;
|
|
316
297
|
(0, _classCallCheck2["default"])(this, TextArea);
|
|
317
|
-
_this5 =
|
|
298
|
+
_this5 = _callSuper(this, TextArea, [props]);
|
|
318
299
|
_this5.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
319
300
|
return _this5;
|
|
320
301
|
}
|
|
321
|
-
(0,
|
|
302
|
+
(0, _inherits2["default"])(TextArea, _React$Component9);
|
|
303
|
+
return (0, _createClass2["default"])(TextArea, [{
|
|
322
304
|
key: "render",
|
|
323
305
|
value: function render() {
|
|
324
306
|
var props = {};
|
|
@@ -343,19 +325,17 @@ var TextArea = /*#__PURE__*/function (_React$Component9) {
|
|
|
343
325
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("textarea", props)));
|
|
344
326
|
}
|
|
345
327
|
}]);
|
|
346
|
-
return TextArea;
|
|
347
328
|
}(_react["default"].Component);
|
|
348
|
-
var Dropdown = /*#__PURE__*/function (_React$
|
|
349
|
-
(0, _inherits2["default"])(Dropdown, _React$Component10);
|
|
350
|
-
var _super10 = _createSuper(Dropdown);
|
|
329
|
+
var Dropdown = /*#__PURE__*/function (_React$Component0) {
|
|
351
330
|
function Dropdown(props) {
|
|
352
331
|
var _this6;
|
|
353
332
|
(0, _classCallCheck2["default"])(this, Dropdown);
|
|
354
|
-
_this6 =
|
|
333
|
+
_this6 = _callSuper(this, Dropdown, [props]);
|
|
355
334
|
_this6.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
356
335
|
return _this6;
|
|
357
336
|
}
|
|
358
|
-
(0,
|
|
337
|
+
(0, _inherits2["default"])(Dropdown, _React$Component0);
|
|
338
|
+
return (0, _createClass2["default"])(Dropdown, [{
|
|
359
339
|
key: "render",
|
|
360
340
|
value: function render() {
|
|
361
341
|
var props = {};
|
|
@@ -386,16 +366,13 @@ var Dropdown = /*#__PURE__*/function (_React$Component10) {
|
|
|
386
366
|
}))));
|
|
387
367
|
}
|
|
388
368
|
}]);
|
|
389
|
-
return Dropdown;
|
|
390
369
|
}(_react["default"].Component);
|
|
391
|
-
var Signature = /*#__PURE__*/function (_React$
|
|
392
|
-
(0, _inherits2["default"])(Signature, _React$Component11);
|
|
393
|
-
var _super11 = _createSuper(Signature);
|
|
370
|
+
var Signature = /*#__PURE__*/function (_React$Component1) {
|
|
394
371
|
function Signature(props) {
|
|
395
372
|
var _this7;
|
|
396
373
|
(0, _classCallCheck2["default"])(this, Signature);
|
|
397
|
-
_this7 =
|
|
398
|
-
(0, _defineProperty2["default"])(
|
|
374
|
+
_this7 = _callSuper(this, Signature, [props]);
|
|
375
|
+
(0, _defineProperty2["default"])(_this7, "clear", function () {
|
|
399
376
|
if (_this7.state.defaultValue) {
|
|
400
377
|
_this7.setState({
|
|
401
378
|
defaultValue: ''
|
|
@@ -411,7 +388,8 @@ var Signature = /*#__PURE__*/function (_React$Component11) {
|
|
|
411
388
|
_this7.canvas = /*#__PURE__*/_react["default"].createRef();
|
|
412
389
|
return _this7;
|
|
413
390
|
}
|
|
414
|
-
(0,
|
|
391
|
+
(0, _inherits2["default"])(Signature, _React$Component1);
|
|
392
|
+
return (0, _createClass2["default"])(Signature, [{
|
|
415
393
|
key: "render",
|
|
416
394
|
value: function render() {
|
|
417
395
|
var defaultValue = this.state.defaultValue;
|
|
@@ -453,16 +431,14 @@ var Signature = /*#__PURE__*/function (_React$Component11) {
|
|
|
453
431
|
}), /*#__PURE__*/_react["default"].createElement("input", props)));
|
|
454
432
|
}
|
|
455
433
|
}]);
|
|
456
|
-
return Signature;
|
|
457
434
|
}(_react["default"].Component);
|
|
458
|
-
var Tags = /*#__PURE__*/function (_React$
|
|
459
|
-
(0, _inherits2["default"])(Tags, _React$Component12);
|
|
460
|
-
var _super12 = _createSuper(Tags);
|
|
435
|
+
var Tags = /*#__PURE__*/function (_React$Component10) {
|
|
461
436
|
function Tags(props) {
|
|
462
437
|
var _this8;
|
|
463
438
|
(0, _classCallCheck2["default"])(this, Tags);
|
|
464
|
-
_this8 =
|
|
465
|
-
|
|
439
|
+
_this8 = _callSuper(this, Tags, [props]);
|
|
440
|
+
// state = { value: this.props.defaultValue !== undefined ? this.props.defaultValue.split(',') : [] };
|
|
441
|
+
(0, _defineProperty2["default"])(_this8, "handleChange", function (e) {
|
|
466
442
|
_this8.setState({
|
|
467
443
|
value: e || []
|
|
468
444
|
});
|
|
@@ -475,7 +451,8 @@ var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
|
475
451
|
};
|
|
476
452
|
return _this8;
|
|
477
453
|
}
|
|
478
|
-
(0,
|
|
454
|
+
(0, _inherits2["default"])(Tags, _React$Component10);
|
|
455
|
+
return (0, _createClass2["default"])(Tags, [{
|
|
479
456
|
key: "getDefaultValue",
|
|
480
457
|
value: function getDefaultValue(defaultValue, options) {
|
|
481
458
|
if (defaultValue) {
|
|
@@ -493,8 +470,6 @@ var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
|
493
470
|
}
|
|
494
471
|
return [];
|
|
495
472
|
}
|
|
496
|
-
|
|
497
|
-
// state = { value: this.props.defaultValue !== undefined ? this.props.defaultValue.split(',') : [] };
|
|
498
473
|
}, {
|
|
499
474
|
key: "render",
|
|
500
475
|
value: function render() {
|
|
@@ -527,22 +502,20 @@ var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
|
527
502
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactSelect["default"], props)));
|
|
528
503
|
}
|
|
529
504
|
}]);
|
|
530
|
-
return Tags;
|
|
531
505
|
}(_react["default"].Component);
|
|
532
|
-
var Checkboxes = /*#__PURE__*/function (_React$
|
|
533
|
-
(0, _inherits2["default"])(Checkboxes, _React$Component13);
|
|
534
|
-
var _super13 = _createSuper(Checkboxes);
|
|
506
|
+
var Checkboxes = /*#__PURE__*/function (_React$Component11) {
|
|
535
507
|
function Checkboxes(props) {
|
|
536
508
|
var _this9;
|
|
537
509
|
(0, _classCallCheck2["default"])(this, Checkboxes);
|
|
538
|
-
_this9 =
|
|
510
|
+
_this9 = _callSuper(this, Checkboxes, [props]);
|
|
539
511
|
_this9.options = {};
|
|
540
512
|
return _this9;
|
|
541
513
|
}
|
|
542
|
-
(0,
|
|
514
|
+
(0, _inherits2["default"])(Checkboxes, _React$Component11);
|
|
515
|
+
return (0, _createClass2["default"])(Checkboxes, [{
|
|
543
516
|
key: "render",
|
|
544
517
|
value: function render() {
|
|
545
|
-
var
|
|
518
|
+
var _this0 = this;
|
|
546
519
|
var self = this;
|
|
547
520
|
var classNames = 'custom-control custom-checkbox';
|
|
548
521
|
if (this.props.data.inline) {
|
|
@@ -566,7 +539,7 @@ var Checkboxes = /*#__PURE__*/function (_React$Component13) {
|
|
|
566
539
|
if (self.props.mutable) {
|
|
567
540
|
props.defaultChecked = self.props.defaultValue !== undefined && (self.props.defaultValue.indexOf(option.key) > -1 || self.props.defaultValue.indexOf(option.value) > -1);
|
|
568
541
|
}
|
|
569
|
-
if (
|
|
542
|
+
if (_this0.props.read_only) {
|
|
570
543
|
props.disabled = 'disabled';
|
|
571
544
|
}
|
|
572
545
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -587,22 +560,20 @@ var Checkboxes = /*#__PURE__*/function (_React$Component13) {
|
|
|
587
560
|
})));
|
|
588
561
|
}
|
|
589
562
|
}]);
|
|
590
|
-
return Checkboxes;
|
|
591
563
|
}(_react["default"].Component);
|
|
592
|
-
var RadioButtons = /*#__PURE__*/function (_React$
|
|
593
|
-
(0, _inherits2["default"])(RadioButtons, _React$Component14);
|
|
594
|
-
var _super14 = _createSuper(RadioButtons);
|
|
564
|
+
var RadioButtons = /*#__PURE__*/function (_React$Component12) {
|
|
595
565
|
function RadioButtons(props) {
|
|
596
|
-
var
|
|
566
|
+
var _this1;
|
|
597
567
|
(0, _classCallCheck2["default"])(this, RadioButtons);
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
return
|
|
568
|
+
_this1 = _callSuper(this, RadioButtons, [props]);
|
|
569
|
+
_this1.options = {};
|
|
570
|
+
return _this1;
|
|
601
571
|
}
|
|
602
|
-
(0,
|
|
572
|
+
(0, _inherits2["default"])(RadioButtons, _React$Component12);
|
|
573
|
+
return (0, _createClass2["default"])(RadioButtons, [{
|
|
603
574
|
key: "render",
|
|
604
575
|
value: function render() {
|
|
605
|
-
var
|
|
576
|
+
var _this10 = this;
|
|
606
577
|
var self = this;
|
|
607
578
|
var classNames = 'custom-control custom-radio';
|
|
608
579
|
if (this.props.data.inline) {
|
|
@@ -626,7 +597,7 @@ var RadioButtons = /*#__PURE__*/function (_React$Component14) {
|
|
|
626
597
|
if (self.props.mutable) {
|
|
627
598
|
props.defaultChecked = self.props.defaultValue !== undefined && (self.props.defaultValue.indexOf(option.key) > -1 || self.props.defaultValue.indexOf(option.value) > -1);
|
|
628
599
|
}
|
|
629
|
-
if (
|
|
600
|
+
if (_this10.props.read_only) {
|
|
630
601
|
props.disabled = 'disabled';
|
|
631
602
|
}
|
|
632
603
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -647,16 +618,14 @@ var RadioButtons = /*#__PURE__*/function (_React$Component14) {
|
|
|
647
618
|
})));
|
|
648
619
|
}
|
|
649
620
|
}]);
|
|
650
|
-
return RadioButtons;
|
|
651
621
|
}(_react["default"].Component);
|
|
652
|
-
var Image = /*#__PURE__*/function (_React$
|
|
653
|
-
(0, _inherits2["default"])(Image, _React$Component15);
|
|
654
|
-
var _super15 = _createSuper(Image);
|
|
622
|
+
var Image = /*#__PURE__*/function (_React$Component13) {
|
|
655
623
|
function Image() {
|
|
656
624
|
(0, _classCallCheck2["default"])(this, Image);
|
|
657
|
-
return
|
|
625
|
+
return _callSuper(this, Image, arguments);
|
|
658
626
|
}
|
|
659
|
-
(0,
|
|
627
|
+
(0, _inherits2["default"])(Image, _React$Component13);
|
|
628
|
+
return (0, _createClass2["default"])(Image, [{
|
|
660
629
|
key: "render",
|
|
661
630
|
value: function render() {
|
|
662
631
|
var style = this.props.data.center ? {
|
|
@@ -678,19 +647,17 @@ var Image = /*#__PURE__*/function (_React$Component15) {
|
|
|
678
647
|
}, "No Image"));
|
|
679
648
|
}
|
|
680
649
|
}]);
|
|
681
|
-
return Image;
|
|
682
650
|
}(_react["default"].Component);
|
|
683
|
-
var Rating = /*#__PURE__*/function (_React$
|
|
684
|
-
(0, _inherits2["default"])(Rating, _React$Component16);
|
|
685
|
-
var _super16 = _createSuper(Rating);
|
|
651
|
+
var Rating = /*#__PURE__*/function (_React$Component14) {
|
|
686
652
|
function Rating(props) {
|
|
687
|
-
var
|
|
653
|
+
var _this11;
|
|
688
654
|
(0, _classCallCheck2["default"])(this, Rating);
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
return
|
|
655
|
+
_this11 = _callSuper(this, Rating, [props]);
|
|
656
|
+
_this11.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
657
|
+
return _this11;
|
|
692
658
|
}
|
|
693
|
-
(0,
|
|
659
|
+
(0, _inherits2["default"])(Rating, _React$Component14);
|
|
660
|
+
return (0, _createClass2["default"])(Rating, [{
|
|
694
661
|
key: "render",
|
|
695
662
|
value: function render() {
|
|
696
663
|
var props = {};
|
|
@@ -714,16 +681,14 @@ var Rating = /*#__PURE__*/function (_React$Component16) {
|
|
|
714
681
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement(_starRating["default"], props)));
|
|
715
682
|
}
|
|
716
683
|
}]);
|
|
717
|
-
return Rating;
|
|
718
684
|
}(_react["default"].Component);
|
|
719
|
-
var HyperLink = /*#__PURE__*/function (_React$
|
|
720
|
-
(0, _inherits2["default"])(HyperLink, _React$Component17);
|
|
721
|
-
var _super17 = _createSuper(HyperLink);
|
|
685
|
+
var HyperLink = /*#__PURE__*/function (_React$Component15) {
|
|
722
686
|
function HyperLink() {
|
|
723
687
|
(0, _classCallCheck2["default"])(this, HyperLink);
|
|
724
|
-
return
|
|
688
|
+
return _callSuper(this, HyperLink, arguments);
|
|
725
689
|
}
|
|
726
|
-
(0,
|
|
690
|
+
(0, _inherits2["default"])(HyperLink, _React$Component15);
|
|
691
|
+
return (0, _createClass2["default"])(HyperLink, [{
|
|
727
692
|
key: "render",
|
|
728
693
|
value: function render() {
|
|
729
694
|
var baseClasses = 'SortableItem rfb-item';
|
|
@@ -746,16 +711,14 @@ var HyperLink = /*#__PURE__*/function (_React$Component17) {
|
|
|
746
711
|
}))));
|
|
747
712
|
}
|
|
748
713
|
}]);
|
|
749
|
-
return HyperLink;
|
|
750
714
|
}(_react["default"].Component);
|
|
751
|
-
var Download = /*#__PURE__*/function (_React$
|
|
752
|
-
(0, _inherits2["default"])(Download, _React$Component18);
|
|
753
|
-
var _super18 = _createSuper(Download);
|
|
715
|
+
var Download = /*#__PURE__*/function (_React$Component16) {
|
|
754
716
|
function Download() {
|
|
755
717
|
(0, _classCallCheck2["default"])(this, Download);
|
|
756
|
-
return
|
|
718
|
+
return _callSuper(this, Download, arguments);
|
|
757
719
|
}
|
|
758
|
-
(0,
|
|
720
|
+
(0, _inherits2["default"])(Download, _React$Component16);
|
|
721
|
+
return (0, _createClass2["default"])(Download, [{
|
|
759
722
|
key: "render",
|
|
760
723
|
value: function render() {
|
|
761
724
|
var baseClasses = 'SortableItem rfb-item';
|
|
@@ -772,17 +735,14 @@ var Download = /*#__PURE__*/function (_React$Component18) {
|
|
|
772
735
|
}, this.props.data.content)));
|
|
773
736
|
}
|
|
774
737
|
}]);
|
|
775
|
-
return Download;
|
|
776
738
|
}(_react["default"].Component);
|
|
777
|
-
var Camera = /*#__PURE__*/function (_React$
|
|
778
|
-
(0, _inherits2["default"])(Camera, _React$Component19);
|
|
779
|
-
var _super19 = _createSuper(Camera);
|
|
739
|
+
var Camera = /*#__PURE__*/function (_React$Component17) {
|
|
780
740
|
function Camera(props) {
|
|
781
|
-
var
|
|
741
|
+
var _this12;
|
|
782
742
|
(0, _classCallCheck2["default"])(this, Camera);
|
|
783
|
-
|
|
784
|
-
(0, _defineProperty2["default"])(
|
|
785
|
-
var self =
|
|
743
|
+
_this12 = _callSuper(this, Camera, [props]);
|
|
744
|
+
(0, _defineProperty2["default"])(_this12, "displayImage", function (e) {
|
|
745
|
+
var self = _this12;
|
|
786
746
|
var target = e.target;
|
|
787
747
|
if (target.files && target.files.length) {
|
|
788
748
|
self.setState({
|
|
@@ -791,19 +751,20 @@ var Camera = /*#__PURE__*/function (_React$Component19) {
|
|
|
791
751
|
});
|
|
792
752
|
}
|
|
793
753
|
});
|
|
794
|
-
(0, _defineProperty2["default"])(
|
|
795
|
-
|
|
754
|
+
(0, _defineProperty2["default"])(_this12, "clearImage", function () {
|
|
755
|
+
_this12.setState({
|
|
796
756
|
img: null,
|
|
797
757
|
previewImg: null
|
|
798
758
|
});
|
|
799
759
|
});
|
|
800
|
-
|
|
760
|
+
_this12.state = {
|
|
801
761
|
img: null,
|
|
802
762
|
previewImg: null
|
|
803
763
|
};
|
|
804
|
-
return
|
|
764
|
+
return _this12;
|
|
805
765
|
}
|
|
806
|
-
(0,
|
|
766
|
+
(0, _inherits2["default"])(Camera, _React$Component17);
|
|
767
|
+
return (0, _createClass2["default"])(Camera, [{
|
|
807
768
|
key: "getImageSizeProps",
|
|
808
769
|
value: function getImageSizeProps(_ref) {
|
|
809
770
|
var width = _ref.width,
|
|
@@ -822,7 +783,7 @@ var Camera = /*#__PURE__*/function (_React$Component19) {
|
|
|
822
783
|
}, {
|
|
823
784
|
key: "render",
|
|
824
785
|
value: function render() {
|
|
825
|
-
var
|
|
786
|
+
var _this13 = this;
|
|
826
787
|
var imageStyle = {
|
|
827
788
|
objectFit: 'scale-down',
|
|
828
789
|
objectPosition: this.props.data.center ? 'center' : 'left'
|
|
@@ -872,7 +833,7 @@ var Camera = /*#__PURE__*/function (_React$Component19) {
|
|
|
872
833
|
className: "fas fa-camera"
|
|
873
834
|
}), " ", this.props.data.label_after_camera_icon), /*#__PURE__*/_react["default"].createElement("p", null, this.props.data.message_under_camera_icon))), this.state.img && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
|
|
874
835
|
onLoad: function onLoad() {
|
|
875
|
-
return URL.revokeObjectURL(
|
|
836
|
+
return URL.revokeObjectURL(_this13.state.previewImg);
|
|
876
837
|
},
|
|
877
838
|
src: this.state.previewImg,
|
|
878
839
|
height: "100",
|
|
@@ -885,17 +846,14 @@ var Camera = /*#__PURE__*/function (_React$Component19) {
|
|
|
885
846
|
}), " ", this.props.data.label_after_photo_clear_icon)))));
|
|
886
847
|
}
|
|
887
848
|
}]);
|
|
888
|
-
return Camera;
|
|
889
849
|
}(_react["default"].Component);
|
|
890
|
-
var FileUpload = /*#__PURE__*/function (_React$
|
|
891
|
-
(0, _inherits2["default"])(FileUpload, _React$Component20);
|
|
892
|
-
var _super20 = _createSuper(FileUpload);
|
|
850
|
+
var FileUpload = /*#__PURE__*/function (_React$Component18) {
|
|
893
851
|
function FileUpload(props) {
|
|
894
|
-
var
|
|
852
|
+
var _this14;
|
|
895
853
|
(0, _classCallCheck2["default"])(this, FileUpload);
|
|
896
|
-
|
|
897
|
-
(0, _defineProperty2["default"])(
|
|
898
|
-
var self =
|
|
854
|
+
_this14 = _callSuper(this, FileUpload, [props]);
|
|
855
|
+
(0, _defineProperty2["default"])(_this14, "displayFileUpload", function (e) {
|
|
856
|
+
var self = _this14;
|
|
899
857
|
var target = e.target;
|
|
900
858
|
var file;
|
|
901
859
|
if (target.files && target.files.length > 0) {
|
|
@@ -905,51 +863,49 @@ var FileUpload = /*#__PURE__*/function (_React$Component20) {
|
|
|
905
863
|
});
|
|
906
864
|
}
|
|
907
865
|
});
|
|
908
|
-
(0, _defineProperty2["default"])(
|
|
909
|
-
|
|
866
|
+
(0, _defineProperty2["default"])(_this14, "clearFileUpload", function () {
|
|
867
|
+
_this14.setState({
|
|
910
868
|
fileUpload: null
|
|
911
869
|
});
|
|
912
870
|
});
|
|
913
|
-
(0, _defineProperty2["default"])(
|
|
871
|
+
(0, _defineProperty2["default"])(_this14, "saveFile", /*#__PURE__*/function () {
|
|
914
872
|
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(e) {
|
|
915
873
|
var sourceUrl, response, dispositionHeader, resBlob, blob, fileName, _fileName;
|
|
916
|
-
return _regenerator["default"].wrap(function
|
|
917
|
-
while (1) {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
return _context.stop();
|
|
952
|
-
}
|
|
874
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
875
|
+
while (1) switch (_context.prev = _context.next) {
|
|
876
|
+
case 0:
|
|
877
|
+
e.preventDefault();
|
|
878
|
+
sourceUrl = _this14.props.defaultValue;
|
|
879
|
+
_context.next = 1;
|
|
880
|
+
return (0, _isomorphicFetch["default"])(sourceUrl, {
|
|
881
|
+
method: 'GET',
|
|
882
|
+
headers: {
|
|
883
|
+
'Accept': 'application/json',
|
|
884
|
+
'Content-Type': 'application/json; charset=utf-8'
|
|
885
|
+
},
|
|
886
|
+
responseType: 'blob'
|
|
887
|
+
});
|
|
888
|
+
case 1:
|
|
889
|
+
response = _context.sent;
|
|
890
|
+
dispositionHeader = response.headers.get('Content-Disposition');
|
|
891
|
+
_context.next = 2;
|
|
892
|
+
return response.blob();
|
|
893
|
+
case 2:
|
|
894
|
+
resBlob = _context.sent;
|
|
895
|
+
// eslint-disable-next-line no-undef
|
|
896
|
+
blob = new Blob([resBlob], {
|
|
897
|
+
type: _this14.props.data.fileType || response.headers.get('Content-Type')
|
|
898
|
+
});
|
|
899
|
+
if (dispositionHeader && dispositionHeader.indexOf(';filename=') > -1) {
|
|
900
|
+
fileName = dispositionHeader.split(';filename=')[1];
|
|
901
|
+
(0, _fileSaver.saveAs)(blob, fileName);
|
|
902
|
+
} else {
|
|
903
|
+
_fileName = sourceUrl.substring(sourceUrl.lastIndexOf('/') + 1);
|
|
904
|
+
(0, _fileSaver.saveAs)(response.url, _fileName);
|
|
905
|
+
}
|
|
906
|
+
case 3:
|
|
907
|
+
case "end":
|
|
908
|
+
return _context.stop();
|
|
953
909
|
}
|
|
954
910
|
}, _callee);
|
|
955
911
|
}));
|
|
@@ -957,12 +913,13 @@ var FileUpload = /*#__PURE__*/function (_React$Component20) {
|
|
|
957
913
|
return _ref2.apply(this, arguments);
|
|
958
914
|
};
|
|
959
915
|
}());
|
|
960
|
-
|
|
916
|
+
_this14.state = {
|
|
961
917
|
fileUpload: null
|
|
962
918
|
};
|
|
963
|
-
return
|
|
919
|
+
return _this14;
|
|
964
920
|
}
|
|
965
|
-
(0,
|
|
921
|
+
(0, _inherits2["default"])(FileUpload, _React$Component18);
|
|
922
|
+
return (0, _createClass2["default"])(FileUpload, [{
|
|
966
923
|
key: "render",
|
|
967
924
|
value: function render() {
|
|
968
925
|
var baseClasses = 'SortableItem rfb-item';
|
|
@@ -1021,28 +978,26 @@ var FileUpload = /*#__PURE__*/function (_React$Component20) {
|
|
|
1021
978
|
}), " ", this.props.data.label_after_file_clear_icon)))));
|
|
1022
979
|
}
|
|
1023
980
|
}]);
|
|
1024
|
-
return FileUpload;
|
|
1025
981
|
}(_react["default"].Component);
|
|
1026
|
-
var Range = /*#__PURE__*/function (_React$
|
|
1027
|
-
(0, _inherits2["default"])(Range, _React$Component21);
|
|
1028
|
-
var _super21 = _createSuper(Range);
|
|
982
|
+
var Range = /*#__PURE__*/function (_React$Component19) {
|
|
1029
983
|
function Range(props) {
|
|
1030
|
-
var
|
|
984
|
+
var _this15;
|
|
1031
985
|
(0, _classCallCheck2["default"])(this, Range);
|
|
1032
|
-
|
|
1033
|
-
(0, _defineProperty2["default"])(
|
|
986
|
+
_this15 = _callSuper(this, Range, [props]);
|
|
987
|
+
(0, _defineProperty2["default"])(_this15, "changeValue", function (e) {
|
|
1034
988
|
var target = e.target;
|
|
1035
|
-
|
|
989
|
+
_this15.setState({
|
|
1036
990
|
value: target.value
|
|
1037
991
|
});
|
|
1038
992
|
});
|
|
1039
|
-
|
|
1040
|
-
|
|
993
|
+
_this15.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
994
|
+
_this15.state = {
|
|
1041
995
|
value: props.defaultValue !== undefined ? parseInt(props.defaultValue, 10) : parseInt(props.data.default_value, 10)
|
|
1042
996
|
};
|
|
1043
|
-
return
|
|
997
|
+
return _this15;
|
|
1044
998
|
}
|
|
1045
|
-
(0,
|
|
999
|
+
(0, _inherits2["default"])(Range, _React$Component19);
|
|
1000
|
+
return (0, _createClass2["default"])(Range, [{
|
|
1046
1001
|
key: "render",
|
|
1047
1002
|
value: function render() {
|
|
1048
1003
|
var props = {};
|
|
@@ -1116,7 +1071,6 @@ var Range = /*#__PURE__*/function (_React$Component21) {
|
|
|
1116
1071
|
}, _datalist)));
|
|
1117
1072
|
}
|
|
1118
1073
|
}]);
|
|
1119
|
-
return Range;
|
|
1120
1074
|
}(_react["default"].Component);
|
|
1121
1075
|
FormElements.Header = Header;
|
|
1122
1076
|
FormElements.Paragraph = Paragraph;
|
|
@@ -1140,5 +1094,4 @@ FormElements.Download = Download;
|
|
|
1140
1094
|
FormElements.Camera = Camera;
|
|
1141
1095
|
FormElements.FileUpload = FileUpload;
|
|
1142
1096
|
FormElements.Range = Range;
|
|
1143
|
-
var _default = FormElements;
|
|
1144
|
-
exports["default"] = _default;
|
|
1097
|
+
var _default = exports["default"] = FormElements;
|