react-form-builder-more-flexibility 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/1.app.js +1 -1
- package/dist/app.js +11 -12
- package/lib/UUID.js +17 -23
- package/lib/dynamic-option-list.js +7 -25
- package/lib/form-dynamic-edit.js +17 -36
- package/lib/form-elements/component-drag-handle.js +4 -27
- package/lib/form-elements/component-drag-layer.js +4 -20
- package/lib/form-elements/component-drag-preview.js +7 -20
- package/lib/form-elements/component-header.js +0 -6
- package/lib/form-elements/component-label.js +0 -7
- package/lib/form-elements/custom-element.js +2 -30
- package/lib/form-elements/date-picker.js +14 -49
- package/lib/form-elements/header-bar.js +3 -16
- package/lib/form-elements/index.js +45 -303
- package/lib/form-elements/myxss.js +0 -3
- package/lib/form-elements/star-rating.js +10 -36
- package/lib/form-elements-edit.js +9 -46
- package/lib/form-place-holder.js +2 -20
- package/lib/form-validator.js +3 -20
- package/lib/form.js +19 -109
- package/lib/functions/index.js +0 -18
- package/lib/index.js +3 -32
- package/lib/language-provider/IntlMessages.js +0 -6
- package/lib/language-provider/entries/en-us.js +0 -6
- package/lib/language-provider/entries/vi-vn.js +0 -6
- package/lib/language-provider/index.js +0 -4
- package/lib/multi-column/MultiColumnRow.js +18 -56
- package/lib/multi-column/dustbin.js +21 -49
- package/lib/multi-column/grip.js +4 -12
- package/lib/multi-column/index.js +0 -1
- package/lib/preview.js +32 -98
- package/lib/sortable-element.js +29 -50
- package/lib/sortable-form-elements.js +22 -29
- package/lib/stores/registry.js +1 -9
- package/lib/stores/requests.js +0 -5
- package/lib/stores/store.js +11 -25
- package/lib/toolbar-draggable-item.js +6 -23
- package/lib/toolbar-group-item.js +6 -16
- package/lib/toolbar.js +10 -68
- package/package.json +1 -1
|
@@ -1,94 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
-
|
|
16
11
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
-
|
|
20
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
|
-
|
|
22
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
|
-
|
|
24
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
25
|
-
|
|
26
16
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
27
|
-
|
|
28
17
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
29
|
-
|
|
30
18
|
var _isomorphicFetch = _interopRequireDefault(require("isomorphic-fetch"));
|
|
31
|
-
|
|
32
19
|
var _fileSaver = require("file-saver");
|
|
33
|
-
|
|
34
20
|
var _react = _interopRequireDefault(require("react"));
|
|
35
|
-
|
|
36
21
|
var _reactSelect = _interopRequireDefault(require("react-select"));
|
|
37
|
-
|
|
38
22
|
var _reactSignatureCanvas = _interopRequireDefault(require("react-signature-canvas"));
|
|
39
|
-
|
|
40
23
|
var _reactBootstrapSlider = _interopRequireDefault(require("react-bootstrap-slider"));
|
|
41
|
-
|
|
42
24
|
var _starRating = _interopRequireDefault(require("./star-rating"));
|
|
43
|
-
|
|
44
25
|
var _datePicker = _interopRequireDefault(require("./date-picker"));
|
|
45
|
-
|
|
46
26
|
var _componentHeader = _interopRequireDefault(require("./component-header"));
|
|
47
|
-
|
|
48
27
|
var _componentLabel = _interopRequireDefault(require("./component-label"));
|
|
49
|
-
|
|
50
28
|
var _myxss = _interopRequireDefault(require("./myxss"));
|
|
51
|
-
|
|
52
29
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
53
|
-
|
|
54
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
55
|
-
|
|
56
31
|
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); }; }
|
|
57
|
-
|
|
58
|
-
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; } }
|
|
59
|
-
|
|
32
|
+
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; } } // eslint-disable-next-line max-classes-per-file
|
|
60
33
|
var FormElements = {};
|
|
61
|
-
|
|
62
34
|
var Header = /*#__PURE__*/function (_React$Component) {
|
|
63
35
|
(0, _inherits2["default"])(Header, _React$Component);
|
|
64
|
-
|
|
65
36
|
var _super = _createSuper(Header);
|
|
66
|
-
|
|
67
37
|
function Header() {
|
|
68
38
|
(0, _classCallCheck2["default"])(this, Header);
|
|
69
39
|
return _super.apply(this, arguments);
|
|
70
40
|
}
|
|
71
|
-
|
|
72
41
|
(0, _createClass2["default"])(Header, [{
|
|
73
42
|
key: "render",
|
|
74
43
|
value: function render() {
|
|
75
44
|
// const headerClasses = `dynamic-input ${this.props.data.element}-input`;
|
|
76
45
|
var classNames = 'static';
|
|
77
|
-
|
|
78
46
|
if (this.props.data.bold) {
|
|
79
47
|
classNames += ' bold';
|
|
80
48
|
}
|
|
81
|
-
|
|
82
49
|
if (this.props.data.italic) {
|
|
83
50
|
classNames += ' italic';
|
|
84
51
|
}
|
|
85
|
-
|
|
86
52
|
var baseClasses = 'SortableItem rfb-item';
|
|
87
|
-
|
|
88
53
|
if (this.props.data.pageBreakBefore) {
|
|
89
54
|
baseClasses += ' alwaysbreak';
|
|
90
55
|
}
|
|
91
|
-
|
|
92
56
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
93
57
|
style: _objectSpread({}, this.props.style),
|
|
94
58
|
className: baseClasses
|
|
@@ -102,36 +66,27 @@ var Header = /*#__PURE__*/function (_React$Component) {
|
|
|
102
66
|
}]);
|
|
103
67
|
return Header;
|
|
104
68
|
}(_react["default"].Component);
|
|
105
|
-
|
|
106
69
|
var Paragraph = /*#__PURE__*/function (_React$Component2) {
|
|
107
70
|
(0, _inherits2["default"])(Paragraph, _React$Component2);
|
|
108
|
-
|
|
109
71
|
var _super2 = _createSuper(Paragraph);
|
|
110
|
-
|
|
111
72
|
function Paragraph() {
|
|
112
73
|
(0, _classCallCheck2["default"])(this, Paragraph);
|
|
113
74
|
return _super2.apply(this, arguments);
|
|
114
75
|
}
|
|
115
|
-
|
|
116
76
|
(0, _createClass2["default"])(Paragraph, [{
|
|
117
77
|
key: "render",
|
|
118
78
|
value: function render() {
|
|
119
79
|
var classNames = 'static';
|
|
120
|
-
|
|
121
80
|
if (this.props.data.bold) {
|
|
122
81
|
classNames += ' bold';
|
|
123
82
|
}
|
|
124
|
-
|
|
125
83
|
if (this.props.data.italic) {
|
|
126
84
|
classNames += ' italic';
|
|
127
85
|
}
|
|
128
|
-
|
|
129
86
|
var baseClasses = 'SortableItem rfb-item';
|
|
130
|
-
|
|
131
87
|
if (this.props.data.pageBreakBefore) {
|
|
132
88
|
baseClasses += ' alwaysbreak';
|
|
133
89
|
}
|
|
134
|
-
|
|
135
90
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
136
91
|
style: _objectSpread({}, this.props.style),
|
|
137
92
|
className: baseClasses
|
|
@@ -145,36 +100,27 @@ var Paragraph = /*#__PURE__*/function (_React$Component2) {
|
|
|
145
100
|
}]);
|
|
146
101
|
return Paragraph;
|
|
147
102
|
}(_react["default"].Component);
|
|
148
|
-
|
|
149
103
|
var Label = /*#__PURE__*/function (_React$Component3) {
|
|
150
104
|
(0, _inherits2["default"])(Label, _React$Component3);
|
|
151
|
-
|
|
152
105
|
var _super3 = _createSuper(Label);
|
|
153
|
-
|
|
154
106
|
function Label() {
|
|
155
107
|
(0, _classCallCheck2["default"])(this, Label);
|
|
156
108
|
return _super3.apply(this, arguments);
|
|
157
109
|
}
|
|
158
|
-
|
|
159
110
|
(0, _createClass2["default"])(Label, [{
|
|
160
111
|
key: "render",
|
|
161
112
|
value: function render() {
|
|
162
113
|
var classNames = 'static';
|
|
163
|
-
|
|
164
114
|
if (this.props.data.bold) {
|
|
165
115
|
classNames += ' bold';
|
|
166
116
|
}
|
|
167
|
-
|
|
168
117
|
if (this.props.data.italic) {
|
|
169
118
|
classNames += ' italic';
|
|
170
119
|
}
|
|
171
|
-
|
|
172
120
|
var baseClasses = 'SortableItem rfb-item';
|
|
173
|
-
|
|
174
121
|
if (this.props.data.pageBreakBefore) {
|
|
175
122
|
baseClasses += ' alwaysbreak';
|
|
176
123
|
}
|
|
177
|
-
|
|
178
124
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
179
125
|
style: _objectSpread({}, this.props.style),
|
|
180
126
|
className: baseClasses
|
|
@@ -188,26 +134,20 @@ var Label = /*#__PURE__*/function (_React$Component3) {
|
|
|
188
134
|
}]);
|
|
189
135
|
return Label;
|
|
190
136
|
}(_react["default"].Component);
|
|
191
|
-
|
|
192
137
|
var LineBreak = /*#__PURE__*/function (_React$Component4) {
|
|
193
138
|
(0, _inherits2["default"])(LineBreak, _React$Component4);
|
|
194
|
-
|
|
195
139
|
var _super4 = _createSuper(LineBreak);
|
|
196
|
-
|
|
197
140
|
function LineBreak() {
|
|
198
141
|
(0, _classCallCheck2["default"])(this, LineBreak);
|
|
199
142
|
return _super4.apply(this, arguments);
|
|
200
143
|
}
|
|
201
|
-
|
|
202
144
|
(0, _createClass2["default"])(LineBreak, [{
|
|
203
145
|
key: "render",
|
|
204
146
|
value: function render() {
|
|
205
147
|
var baseClasses = 'SortableItem rfb-item';
|
|
206
|
-
|
|
207
148
|
if (this.props.data.pageBreakBefore) {
|
|
208
149
|
baseClasses += ' alwaysbreak';
|
|
209
150
|
}
|
|
210
|
-
|
|
211
151
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
212
152
|
style: _objectSpread({}, this.props.style),
|
|
213
153
|
className: baseClasses
|
|
@@ -216,21 +156,16 @@ var LineBreak = /*#__PURE__*/function (_React$Component4) {
|
|
|
216
156
|
}]);
|
|
217
157
|
return LineBreak;
|
|
218
158
|
}(_react["default"].Component);
|
|
219
|
-
|
|
220
159
|
var TextInput = /*#__PURE__*/function (_React$Component5) {
|
|
221
160
|
(0, _inherits2["default"])(TextInput, _React$Component5);
|
|
222
|
-
|
|
223
161
|
var _super5 = _createSuper(TextInput);
|
|
224
|
-
|
|
225
162
|
function TextInput(props) {
|
|
226
163
|
var _this;
|
|
227
|
-
|
|
228
164
|
(0, _classCallCheck2["default"])(this, TextInput);
|
|
229
165
|
_this = _super5.call(this, props);
|
|
230
166
|
_this.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
231
167
|
return _this;
|
|
232
168
|
}
|
|
233
|
-
|
|
234
169
|
(0, _createClass2["default"])(TextInput, [{
|
|
235
170
|
key: "render",
|
|
236
171
|
value: function render() {
|
|
@@ -239,22 +174,17 @@ var TextInput = /*#__PURE__*/function (_React$Component5) {
|
|
|
239
174
|
props.className = 'form-control';
|
|
240
175
|
props.name = this.props.data.field_name;
|
|
241
176
|
props.placeholder = this.props.data.placeholder;
|
|
242
|
-
|
|
243
177
|
if (this.props.mutable) {
|
|
244
178
|
props.defaultValue = this.props.defaultValue;
|
|
245
179
|
props.ref = this.inputField;
|
|
246
180
|
}
|
|
247
|
-
|
|
248
181
|
var baseClasses = 'SortableItem rfb-item';
|
|
249
|
-
|
|
250
182
|
if (this.props.data.pageBreakBefore) {
|
|
251
183
|
baseClasses += ' alwaysbreak';
|
|
252
184
|
}
|
|
253
|
-
|
|
254
185
|
if (this.props.read_only) {
|
|
255
186
|
props.disabled = 'disabled';
|
|
256
187
|
}
|
|
257
|
-
|
|
258
188
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
259
189
|
style: _objectSpread({}, this.props.style),
|
|
260
190
|
className: baseClasses
|
|
@@ -265,21 +195,16 @@ var TextInput = /*#__PURE__*/function (_React$Component5) {
|
|
|
265
195
|
}]);
|
|
266
196
|
return TextInput;
|
|
267
197
|
}(_react["default"].Component);
|
|
268
|
-
|
|
269
198
|
var EmailInput = /*#__PURE__*/function (_React$Component6) {
|
|
270
199
|
(0, _inherits2["default"])(EmailInput, _React$Component6);
|
|
271
|
-
|
|
272
200
|
var _super6 = _createSuper(EmailInput);
|
|
273
|
-
|
|
274
201
|
function EmailInput(props) {
|
|
275
202
|
var _this2;
|
|
276
|
-
|
|
277
203
|
(0, _classCallCheck2["default"])(this, EmailInput);
|
|
278
204
|
_this2 = _super6.call(this, props);
|
|
279
205
|
_this2.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
280
206
|
return _this2;
|
|
281
207
|
}
|
|
282
|
-
|
|
283
208
|
(0, _createClass2["default"])(EmailInput, [{
|
|
284
209
|
key: "render",
|
|
285
210
|
value: function render() {
|
|
@@ -288,22 +213,17 @@ var EmailInput = /*#__PURE__*/function (_React$Component6) {
|
|
|
288
213
|
props.className = 'form-control';
|
|
289
214
|
props.name = this.props.data.field_name;
|
|
290
215
|
props.placeholder = this.props.data.placeholder;
|
|
291
|
-
|
|
292
216
|
if (this.props.mutable) {
|
|
293
217
|
props.defaultValue = this.props.defaultValue;
|
|
294
218
|
props.ref = this.inputField;
|
|
295
219
|
}
|
|
296
|
-
|
|
297
220
|
var baseClasses = 'SortableItem rfb-item';
|
|
298
|
-
|
|
299
221
|
if (this.props.data.pageBreakBefore) {
|
|
300
222
|
baseClasses += ' alwaysbreak';
|
|
301
223
|
}
|
|
302
|
-
|
|
303
224
|
if (this.props.read_only) {
|
|
304
225
|
props.disabled = 'disabled';
|
|
305
226
|
}
|
|
306
|
-
|
|
307
227
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
308
228
|
style: _objectSpread({}, this.props.style),
|
|
309
229
|
className: baseClasses
|
|
@@ -314,21 +234,16 @@ var EmailInput = /*#__PURE__*/function (_React$Component6) {
|
|
|
314
234
|
}]);
|
|
315
235
|
return EmailInput;
|
|
316
236
|
}(_react["default"].Component);
|
|
317
|
-
|
|
318
237
|
var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
|
|
319
238
|
(0, _inherits2["default"])(PhoneNumber, _React$Component7);
|
|
320
|
-
|
|
321
239
|
var _super7 = _createSuper(PhoneNumber);
|
|
322
|
-
|
|
323
240
|
function PhoneNumber(props) {
|
|
324
241
|
var _this3;
|
|
325
|
-
|
|
326
242
|
(0, _classCallCheck2["default"])(this, PhoneNumber);
|
|
327
243
|
_this3 = _super7.call(this, props);
|
|
328
244
|
_this3.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
329
245
|
return _this3;
|
|
330
246
|
}
|
|
331
|
-
|
|
332
247
|
(0, _createClass2["default"])(PhoneNumber, [{
|
|
333
248
|
key: "render",
|
|
334
249
|
value: function render() {
|
|
@@ -337,22 +252,17 @@ var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
|
|
|
337
252
|
props.className = 'form-control';
|
|
338
253
|
props.name = this.props.data.field_name;
|
|
339
254
|
props.placeholder = this.props.data.placeholder;
|
|
340
|
-
|
|
341
255
|
if (this.props.mutable) {
|
|
342
256
|
props.defaultValue = this.props.defaultValue;
|
|
343
257
|
props.ref = this.inputField;
|
|
344
258
|
}
|
|
345
|
-
|
|
346
259
|
var baseClasses = 'SortableItem rfb-item';
|
|
347
|
-
|
|
348
260
|
if (this.props.data.pageBreakBefore) {
|
|
349
261
|
baseClasses += ' alwaysbreak';
|
|
350
262
|
}
|
|
351
|
-
|
|
352
263
|
if (this.props.read_only) {
|
|
353
264
|
props.disabled = 'disabled';
|
|
354
265
|
}
|
|
355
|
-
|
|
356
266
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
357
267
|
style: _objectSpread({}, this.props.style),
|
|
358
268
|
className: baseClasses
|
|
@@ -363,21 +273,16 @@ var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
|
|
|
363
273
|
}]);
|
|
364
274
|
return PhoneNumber;
|
|
365
275
|
}(_react["default"].Component);
|
|
366
|
-
|
|
367
276
|
var NumberInput = /*#__PURE__*/function (_React$Component8) {
|
|
368
277
|
(0, _inherits2["default"])(NumberInput, _React$Component8);
|
|
369
|
-
|
|
370
278
|
var _super8 = _createSuper(NumberInput);
|
|
371
|
-
|
|
372
279
|
function NumberInput(props) {
|
|
373
280
|
var _this4;
|
|
374
|
-
|
|
375
281
|
(0, _classCallCheck2["default"])(this, NumberInput);
|
|
376
282
|
_this4 = _super8.call(this, props);
|
|
377
283
|
_this4.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
378
284
|
return _this4;
|
|
379
285
|
}
|
|
380
|
-
|
|
381
286
|
(0, _createClass2["default"])(NumberInput, [{
|
|
382
287
|
key: "render",
|
|
383
288
|
value: function render() {
|
|
@@ -386,22 +291,17 @@ var NumberInput = /*#__PURE__*/function (_React$Component8) {
|
|
|
386
291
|
props.className = 'form-control';
|
|
387
292
|
props.name = this.props.data.field_name;
|
|
388
293
|
props.placeholder = this.props.data.placeholder;
|
|
389
|
-
|
|
390
294
|
if (this.props.mutable) {
|
|
391
295
|
props.defaultValue = this.props.defaultValue;
|
|
392
296
|
props.ref = this.inputField;
|
|
393
297
|
}
|
|
394
|
-
|
|
395
298
|
if (this.props.read_only) {
|
|
396
299
|
props.disabled = 'disabled';
|
|
397
300
|
}
|
|
398
|
-
|
|
399
301
|
var baseClasses = 'SortableItem rfb-item';
|
|
400
|
-
|
|
401
302
|
if (this.props.data.pageBreakBefore) {
|
|
402
303
|
baseClasses += ' alwaysbreak';
|
|
403
304
|
}
|
|
404
|
-
|
|
405
305
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
406
306
|
style: _objectSpread({}, this.props.style),
|
|
407
307
|
className: baseClasses
|
|
@@ -412,21 +312,16 @@ var NumberInput = /*#__PURE__*/function (_React$Component8) {
|
|
|
412
312
|
}]);
|
|
413
313
|
return NumberInput;
|
|
414
314
|
}(_react["default"].Component);
|
|
415
|
-
|
|
416
315
|
var TextArea = /*#__PURE__*/function (_React$Component9) {
|
|
417
316
|
(0, _inherits2["default"])(TextArea, _React$Component9);
|
|
418
|
-
|
|
419
317
|
var _super9 = _createSuper(TextArea);
|
|
420
|
-
|
|
421
318
|
function TextArea(props) {
|
|
422
319
|
var _this5;
|
|
423
|
-
|
|
424
320
|
(0, _classCallCheck2["default"])(this, TextArea);
|
|
425
321
|
_this5 = _super9.call(this, props);
|
|
426
322
|
_this5.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
427
323
|
return _this5;
|
|
428
324
|
}
|
|
429
|
-
|
|
430
325
|
(0, _createClass2["default"])(TextArea, [{
|
|
431
326
|
key: "render",
|
|
432
327
|
value: function render() {
|
|
@@ -434,22 +329,17 @@ var TextArea = /*#__PURE__*/function (_React$Component9) {
|
|
|
434
329
|
props.className = 'form-control';
|
|
435
330
|
props.name = this.props.data.field_name;
|
|
436
331
|
props.placeholder = this.props.data.placeholder;
|
|
437
|
-
|
|
438
332
|
if (this.props.read_only) {
|
|
439
333
|
props.disabled = 'disabled';
|
|
440
334
|
}
|
|
441
|
-
|
|
442
335
|
if (this.props.mutable) {
|
|
443
336
|
props.defaultValue = this.props.defaultValue;
|
|
444
337
|
props.ref = this.inputField;
|
|
445
338
|
}
|
|
446
|
-
|
|
447
339
|
var baseClasses = 'SortableItem rfb-item';
|
|
448
|
-
|
|
449
340
|
if (this.props.data.pageBreakBefore) {
|
|
450
341
|
baseClasses += ' alwaysbreak';
|
|
451
342
|
}
|
|
452
|
-
|
|
453
343
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
454
344
|
style: _objectSpread({}, this.props.style),
|
|
455
345
|
className: baseClasses
|
|
@@ -460,43 +350,33 @@ var TextArea = /*#__PURE__*/function (_React$Component9) {
|
|
|
460
350
|
}]);
|
|
461
351
|
return TextArea;
|
|
462
352
|
}(_react["default"].Component);
|
|
463
|
-
|
|
464
353
|
var Dropdown = /*#__PURE__*/function (_React$Component10) {
|
|
465
354
|
(0, _inherits2["default"])(Dropdown, _React$Component10);
|
|
466
|
-
|
|
467
355
|
var _super10 = _createSuper(Dropdown);
|
|
468
|
-
|
|
469
356
|
function Dropdown(props) {
|
|
470
357
|
var _this6;
|
|
471
|
-
|
|
472
358
|
(0, _classCallCheck2["default"])(this, Dropdown);
|
|
473
359
|
_this6 = _super10.call(this, props);
|
|
474
360
|
_this6.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
475
361
|
return _this6;
|
|
476
362
|
}
|
|
477
|
-
|
|
478
363
|
(0, _createClass2["default"])(Dropdown, [{
|
|
479
364
|
key: "render",
|
|
480
365
|
value: function render() {
|
|
481
366
|
var props = {};
|
|
482
367
|
props.className = 'form-control';
|
|
483
368
|
props.name = this.props.data.field_name;
|
|
484
|
-
|
|
485
369
|
if (this.props.mutable) {
|
|
486
370
|
props.defaultValue = this.props.defaultValue;
|
|
487
371
|
props.ref = this.inputField;
|
|
488
372
|
}
|
|
489
|
-
|
|
490
373
|
if (this.props.read_only) {
|
|
491
374
|
props.disabled = 'disabled';
|
|
492
375
|
}
|
|
493
|
-
|
|
494
376
|
var baseClasses = 'SortableItem rfb-item';
|
|
495
|
-
|
|
496
377
|
if (this.props.data.pageBreakBefore) {
|
|
497
378
|
baseClasses += ' alwaysbreak';
|
|
498
379
|
}
|
|
499
|
-
|
|
500
380
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
501
381
|
style: _objectSpread({}, this.props.style),
|
|
502
382
|
className: baseClasses
|
|
@@ -513,15 +393,11 @@ var Dropdown = /*#__PURE__*/function (_React$Component10) {
|
|
|
513
393
|
}]);
|
|
514
394
|
return Dropdown;
|
|
515
395
|
}(_react["default"].Component);
|
|
516
|
-
|
|
517
396
|
var Signature = /*#__PURE__*/function (_React$Component11) {
|
|
518
397
|
(0, _inherits2["default"])(Signature, _React$Component11);
|
|
519
|
-
|
|
520
398
|
var _super11 = _createSuper(Signature);
|
|
521
|
-
|
|
522
399
|
function Signature(props) {
|
|
523
400
|
var _this7;
|
|
524
|
-
|
|
525
401
|
(0, _classCallCheck2["default"])(this, Signature);
|
|
526
402
|
_this7 = _super11.call(this, props);
|
|
527
403
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this7), "clear", function () {
|
|
@@ -540,7 +416,6 @@ var Signature = /*#__PURE__*/function (_React$Component11) {
|
|
|
540
416
|
_this7.canvas = /*#__PURE__*/_react["default"].createRef();
|
|
541
417
|
return _this7;
|
|
542
418
|
}
|
|
543
|
-
|
|
544
419
|
(0, _createClass2["default"])(Signature, [{
|
|
545
420
|
key: "render",
|
|
546
421
|
value: function render() {
|
|
@@ -549,32 +424,25 @@ var Signature = /*#__PURE__*/function (_React$Component11) {
|
|
|
549
424
|
var props = {};
|
|
550
425
|
props.type = 'hidden';
|
|
551
426
|
props.name = this.props.data.field_name;
|
|
552
|
-
|
|
553
427
|
if (this.props.mutable) {
|
|
554
428
|
props.defaultValue = defaultValue;
|
|
555
429
|
props.ref = this.inputField;
|
|
556
430
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
431
|
+
var pad_props = {};
|
|
432
|
+
// umd requires canvasProps={{ width: 400, height: 150 }}
|
|
560
433
|
if (this.props.mutable) {
|
|
561
434
|
pad_props.defaultValue = defaultValue;
|
|
562
435
|
pad_props.ref = this.canvas;
|
|
563
436
|
canClear = !this.props.read_only;
|
|
564
437
|
}
|
|
565
|
-
|
|
566
438
|
var baseClasses = 'SortableItem rfb-item';
|
|
567
|
-
|
|
568
439
|
if (this.props.data.pageBreakBefore) {
|
|
569
440
|
baseClasses += ' alwaysbreak';
|
|
570
441
|
}
|
|
571
|
-
|
|
572
442
|
var sourceDataURL;
|
|
573
|
-
|
|
574
443
|
if (defaultValue && defaultValue.length > 0) {
|
|
575
444
|
sourceDataURL = "data:image/png;base64,".concat(defaultValue);
|
|
576
445
|
}
|
|
577
|
-
|
|
578
446
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
579
447
|
style: _objectSpread({}, this.props.style),
|
|
580
448
|
className: baseClasses
|
|
@@ -591,17 +459,14 @@ var Signature = /*#__PURE__*/function (_React$Component11) {
|
|
|
591
459
|
}]);
|
|
592
460
|
return Signature;
|
|
593
461
|
}(_react["default"].Component);
|
|
594
|
-
|
|
595
462
|
var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
596
463
|
(0, _inherits2["default"])(Tags, _React$Component12);
|
|
597
|
-
|
|
598
464
|
var _super12 = _createSuper(Tags);
|
|
599
|
-
|
|
600
465
|
function Tags(props) {
|
|
601
466
|
var _this8;
|
|
602
|
-
|
|
603
467
|
(0, _classCallCheck2["default"])(this, Tags);
|
|
604
468
|
_this8 = _super12.call(this, props);
|
|
469
|
+
// state = { value: this.props.defaultValue !== undefined ? this.props.defaultValue.split(',') : [] };
|
|
605
470
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this8), "handleChange", function (e) {
|
|
606
471
|
_this8.setState({
|
|
607
472
|
value: e || []
|
|
@@ -609,13 +474,12 @@ var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
|
609
474
|
});
|
|
610
475
|
_this8.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
611
476
|
var defaultValue = props.defaultValue,
|
|
612
|
-
|
|
477
|
+
data = props.data;
|
|
613
478
|
_this8.state = {
|
|
614
479
|
value: _this8.getDefaultValue(defaultValue, data.options)
|
|
615
480
|
};
|
|
616
481
|
return _this8;
|
|
617
482
|
}
|
|
618
|
-
|
|
619
483
|
(0, _createClass2["default"])(Tags, [{
|
|
620
484
|
key: "getDefaultValue",
|
|
621
485
|
value: function getDefaultValue(defaultValue, options) {
|
|
@@ -628,15 +492,12 @@ var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
|
628
492
|
return vals.indexOf(x.value) > -1;
|
|
629
493
|
});
|
|
630
494
|
}
|
|
631
|
-
|
|
632
495
|
return options.filter(function (x) {
|
|
633
496
|
return defaultValue.indexOf(x.value) > -1;
|
|
634
497
|
});
|
|
635
498
|
}
|
|
636
|
-
|
|
637
499
|
return [];
|
|
638
|
-
}
|
|
639
|
-
|
|
500
|
+
}
|
|
640
501
|
}, {
|
|
641
502
|
key: "render",
|
|
642
503
|
value: function render() {
|
|
@@ -649,24 +510,18 @@ var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
|
649
510
|
props.name = this.props.data.field_name;
|
|
650
511
|
props.onChange = this.handleChange;
|
|
651
512
|
props.options = options;
|
|
652
|
-
|
|
653
513
|
if (!this.props.mutable) {
|
|
654
514
|
props.value = options[0].text;
|
|
655
515
|
} // to show a sample of what tags looks like
|
|
656
|
-
|
|
657
|
-
|
|
658
516
|
if (this.props.mutable) {
|
|
659
517
|
props.isDisabled = this.props.read_only;
|
|
660
518
|
props.value = this.state.value;
|
|
661
519
|
props.ref = this.inputField;
|
|
662
520
|
}
|
|
663
|
-
|
|
664
521
|
var baseClasses = 'SortableItem rfb-item';
|
|
665
|
-
|
|
666
522
|
if (this.props.data.pageBreakBefore) {
|
|
667
523
|
baseClasses += ' alwaysbreak';
|
|
668
524
|
}
|
|
669
|
-
|
|
670
525
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
671
526
|
style: _objectSpread({}, this.props.style),
|
|
672
527
|
className: baseClasses
|
|
@@ -677,39 +532,29 @@ var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
|
677
532
|
}]);
|
|
678
533
|
return Tags;
|
|
679
534
|
}(_react["default"].Component);
|
|
680
|
-
|
|
681
535
|
var Checkboxes = /*#__PURE__*/function (_React$Component13) {
|
|
682
536
|
(0, _inherits2["default"])(Checkboxes, _React$Component13);
|
|
683
|
-
|
|
684
537
|
var _super13 = _createSuper(Checkboxes);
|
|
685
|
-
|
|
686
538
|
function Checkboxes(props) {
|
|
687
539
|
var _this9;
|
|
688
|
-
|
|
689
540
|
(0, _classCallCheck2["default"])(this, Checkboxes);
|
|
690
541
|
_this9 = _super13.call(this, props);
|
|
691
542
|
_this9.options = {};
|
|
692
543
|
return _this9;
|
|
693
544
|
}
|
|
694
|
-
|
|
695
545
|
(0, _createClass2["default"])(Checkboxes, [{
|
|
696
546
|
key: "render",
|
|
697
547
|
value: function render() {
|
|
698
548
|
var _this10 = this;
|
|
699
|
-
|
|
700
549
|
var self = this;
|
|
701
550
|
var classNames = 'custom-control custom-checkbox';
|
|
702
|
-
|
|
703
551
|
if (this.props.data.inline) {
|
|
704
552
|
classNames += ' option-inline';
|
|
705
553
|
}
|
|
706
|
-
|
|
707
554
|
var baseClasses = 'SortableItem rfb-item';
|
|
708
|
-
|
|
709
555
|
if (this.props.data.pageBreakBefore) {
|
|
710
556
|
baseClasses += ' alwaysbreak';
|
|
711
557
|
}
|
|
712
|
-
|
|
713
558
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
714
559
|
style: _objectSpread({}, this.props.style),
|
|
715
560
|
className: baseClasses
|
|
@@ -723,15 +568,12 @@ var Checkboxes = /*#__PURE__*/function (_React$Component13) {
|
|
|
723
568
|
props.name = "option_".concat(option.key);
|
|
724
569
|
props.type = 'checkbox';
|
|
725
570
|
props.value = option.value;
|
|
726
|
-
|
|
727
571
|
if (self.props.mutable) {
|
|
728
572
|
props.defaultChecked = self.props.defaultValue !== undefined && self.props.defaultValue.indexOf(option.key) > -1;
|
|
729
573
|
}
|
|
730
|
-
|
|
731
574
|
if (_this10.props.read_only) {
|
|
732
575
|
props.disabled = 'disabled';
|
|
733
576
|
}
|
|
734
|
-
|
|
735
577
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
736
578
|
className: classNames,
|
|
737
579
|
key: this_key
|
|
@@ -752,46 +594,37 @@ var Checkboxes = /*#__PURE__*/function (_React$Component13) {
|
|
|
752
594
|
}]);
|
|
753
595
|
return Checkboxes;
|
|
754
596
|
}(_react["default"].Component);
|
|
755
|
-
|
|
756
597
|
var Checkbox = /*#__PURE__*/function (_React$Component14) {
|
|
757
598
|
(0, _inherits2["default"])(Checkbox, _React$Component14);
|
|
758
|
-
|
|
759
599
|
var _super14 = _createSuper(Checkbox);
|
|
760
|
-
|
|
761
600
|
function Checkbox(props) {
|
|
762
601
|
var _this11;
|
|
763
|
-
|
|
764
602
|
(0, _classCallCheck2["default"])(this, Checkbox);
|
|
765
603
|
_this11 = _super14.call(this, props);
|
|
766
604
|
_this11.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
767
605
|
return _this11;
|
|
768
606
|
}
|
|
769
|
-
|
|
770
607
|
(0, _createClass2["default"])(Checkbox, [{
|
|
771
608
|
key: "render",
|
|
772
609
|
value: function render() {
|
|
773
|
-
var classNames = 'custom-control custom-checkbox';
|
|
610
|
+
var classNames = 'custom-control custom-checkbox';
|
|
611
|
+
// if (this.props.data.inline) { classNames += ' option-inline'; }
|
|
774
612
|
|
|
775
613
|
var baseClasses = 'SortableItem rfb-item';
|
|
776
|
-
|
|
777
614
|
if (this.props.data.pageBreakBefore) {
|
|
778
615
|
baseClasses += ' alwaysbreak';
|
|
779
616
|
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
617
|
+
var props = {};
|
|
618
|
+
// eslint-disable-next-line no-undef
|
|
783
619
|
props.name = this.props.data.field_name;
|
|
784
620
|
props.type = 'checkbox';
|
|
785
621
|
props.defaultChecked = this.props.data.defaultChecked;
|
|
786
|
-
|
|
787
622
|
if (this.props.mutable) {
|
|
788
623
|
props.ref = this.inputField;
|
|
789
624
|
}
|
|
790
|
-
|
|
791
625
|
if (this.props.read_only) {
|
|
792
626
|
props.disabled = 'disabled';
|
|
793
627
|
}
|
|
794
|
-
|
|
795
628
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
796
629
|
style: _objectSpread({}, this.props.style),
|
|
797
630
|
className: baseClasses
|
|
@@ -812,39 +645,29 @@ var Checkbox = /*#__PURE__*/function (_React$Component14) {
|
|
|
812
645
|
}]);
|
|
813
646
|
return Checkbox;
|
|
814
647
|
}(_react["default"].Component);
|
|
815
|
-
|
|
816
648
|
var RadioButtons = /*#__PURE__*/function (_React$Component15) {
|
|
817
649
|
(0, _inherits2["default"])(RadioButtons, _React$Component15);
|
|
818
|
-
|
|
819
650
|
var _super15 = _createSuper(RadioButtons);
|
|
820
|
-
|
|
821
651
|
function RadioButtons(props) {
|
|
822
652
|
var _this12;
|
|
823
|
-
|
|
824
653
|
(0, _classCallCheck2["default"])(this, RadioButtons);
|
|
825
654
|
_this12 = _super15.call(this, props);
|
|
826
655
|
_this12.options = {};
|
|
827
656
|
return _this12;
|
|
828
657
|
}
|
|
829
|
-
|
|
830
658
|
(0, _createClass2["default"])(RadioButtons, [{
|
|
831
659
|
key: "render",
|
|
832
660
|
value: function render() {
|
|
833
661
|
var _this13 = this;
|
|
834
|
-
|
|
835
662
|
var self = this;
|
|
836
663
|
var classNames = 'custom-control custom-radio';
|
|
837
|
-
|
|
838
664
|
if (this.props.data.inline) {
|
|
839
665
|
classNames += ' option-inline';
|
|
840
666
|
}
|
|
841
|
-
|
|
842
667
|
var baseClasses = 'SortableItem rfb-item';
|
|
843
|
-
|
|
844
668
|
if (this.props.data.pageBreakBefore) {
|
|
845
669
|
baseClasses += ' alwaysbreak';
|
|
846
670
|
}
|
|
847
|
-
|
|
848
671
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
849
672
|
style: _objectSpread({}, this.props.style),
|
|
850
673
|
className: baseClasses
|
|
@@ -858,15 +681,12 @@ var RadioButtons = /*#__PURE__*/function (_React$Component15) {
|
|
|
858
681
|
props.name = self.props.data.field_name;
|
|
859
682
|
props.type = 'radio';
|
|
860
683
|
props.value = option.value;
|
|
861
|
-
|
|
862
684
|
if (self.props.mutable) {
|
|
863
685
|
props.defaultChecked = self.props.defaultValue !== undefined && (self.props.defaultValue.indexOf(option.key) > -1 || self.props.defaultValue.indexOf(option.value) > -1);
|
|
864
686
|
}
|
|
865
|
-
|
|
866
687
|
if (_this13.props.read_only) {
|
|
867
688
|
props.disabled = 'disabled';
|
|
868
689
|
}
|
|
869
|
-
|
|
870
690
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
871
691
|
className: classNames,
|
|
872
692
|
key: this_key
|
|
@@ -887,17 +707,13 @@ var RadioButtons = /*#__PURE__*/function (_React$Component15) {
|
|
|
887
707
|
}]);
|
|
888
708
|
return RadioButtons;
|
|
889
709
|
}(_react["default"].Component);
|
|
890
|
-
|
|
891
710
|
var Image = /*#__PURE__*/function (_React$Component16) {
|
|
892
711
|
(0, _inherits2["default"])(Image, _React$Component16);
|
|
893
|
-
|
|
894
712
|
var _super16 = _createSuper(Image);
|
|
895
|
-
|
|
896
713
|
function Image() {
|
|
897
714
|
(0, _classCallCheck2["default"])(this, Image);
|
|
898
715
|
return _super16.apply(this, arguments);
|
|
899
716
|
}
|
|
900
|
-
|
|
901
717
|
(0, _createClass2["default"])(Image, [{
|
|
902
718
|
key: "render",
|
|
903
719
|
value: function render() {
|
|
@@ -905,11 +721,9 @@ var Image = /*#__PURE__*/function (_React$Component16) {
|
|
|
905
721
|
textAlign: 'center'
|
|
906
722
|
} : null;
|
|
907
723
|
var baseClasses = 'SortableItem rfb-item';
|
|
908
|
-
|
|
909
724
|
if (this.props.data.pageBreakBefore) {
|
|
910
725
|
baseClasses += ' alwaysbreak';
|
|
911
726
|
}
|
|
912
|
-
|
|
913
727
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
914
728
|
style: _objectSpread(_objectSpread({}, this.props.style), style),
|
|
915
729
|
className: baseClasses
|
|
@@ -924,41 +738,32 @@ var Image = /*#__PURE__*/function (_React$Component16) {
|
|
|
924
738
|
}]);
|
|
925
739
|
return Image;
|
|
926
740
|
}(_react["default"].Component);
|
|
927
|
-
|
|
928
741
|
var Rating = /*#__PURE__*/function (_React$Component17) {
|
|
929
742
|
(0, _inherits2["default"])(Rating, _React$Component17);
|
|
930
|
-
|
|
931
743
|
var _super17 = _createSuper(Rating);
|
|
932
|
-
|
|
933
744
|
function Rating(props) {
|
|
934
745
|
var _this14;
|
|
935
|
-
|
|
936
746
|
(0, _classCallCheck2["default"])(this, Rating);
|
|
937
747
|
_this14 = _super17.call(this, props);
|
|
938
748
|
_this14.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
939
749
|
return _this14;
|
|
940
750
|
}
|
|
941
|
-
|
|
942
751
|
(0, _createClass2["default"])(Rating, [{
|
|
943
752
|
key: "render",
|
|
944
753
|
value: function render() {
|
|
945
754
|
var props = {};
|
|
946
755
|
props.name = this.props.data.field_name;
|
|
947
756
|
props.ratingAmount = 5;
|
|
948
|
-
|
|
949
757
|
if (this.props.mutable) {
|
|
950
758
|
props.rating = this.props.defaultValue !== undefined ? parseFloat(this.props.defaultValue, 10) : 0;
|
|
951
759
|
props.editing = true;
|
|
952
760
|
props.disabled = this.props.read_only;
|
|
953
761
|
props.ref = this.inputField;
|
|
954
762
|
}
|
|
955
|
-
|
|
956
763
|
var baseClasses = 'SortableItem rfb-item';
|
|
957
|
-
|
|
958
764
|
if (this.props.data.pageBreakBefore) {
|
|
959
765
|
baseClasses += ' alwaysbreak';
|
|
960
766
|
}
|
|
961
|
-
|
|
962
767
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
963
768
|
style: _objectSpread({}, this.props.style),
|
|
964
769
|
className: baseClasses
|
|
@@ -969,26 +774,20 @@ var Rating = /*#__PURE__*/function (_React$Component17) {
|
|
|
969
774
|
}]);
|
|
970
775
|
return Rating;
|
|
971
776
|
}(_react["default"].Component);
|
|
972
|
-
|
|
973
777
|
var HyperLink = /*#__PURE__*/function (_React$Component18) {
|
|
974
778
|
(0, _inherits2["default"])(HyperLink, _React$Component18);
|
|
975
|
-
|
|
976
779
|
var _super18 = _createSuper(HyperLink);
|
|
977
|
-
|
|
978
780
|
function HyperLink() {
|
|
979
781
|
(0, _classCallCheck2["default"])(this, HyperLink);
|
|
980
782
|
return _super18.apply(this, arguments);
|
|
981
783
|
}
|
|
982
|
-
|
|
983
784
|
(0, _createClass2["default"])(HyperLink, [{
|
|
984
785
|
key: "render",
|
|
985
786
|
value: function render() {
|
|
986
787
|
var baseClasses = 'SortableItem rfb-item';
|
|
987
|
-
|
|
988
788
|
if (this.props.data.pageBreakBefore) {
|
|
989
789
|
baseClasses += ' alwaysbreak';
|
|
990
790
|
}
|
|
991
|
-
|
|
992
791
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
993
792
|
style: _objectSpread({}, this.props.style),
|
|
994
793
|
className: baseClasses
|
|
@@ -1002,26 +801,20 @@ var HyperLink = /*#__PURE__*/function (_React$Component18) {
|
|
|
1002
801
|
}]);
|
|
1003
802
|
return HyperLink;
|
|
1004
803
|
}(_react["default"].Component);
|
|
1005
|
-
|
|
1006
804
|
var Download = /*#__PURE__*/function (_React$Component19) {
|
|
1007
805
|
(0, _inherits2["default"])(Download, _React$Component19);
|
|
1008
|
-
|
|
1009
806
|
var _super19 = _createSuper(Download);
|
|
1010
|
-
|
|
1011
807
|
function Download() {
|
|
1012
808
|
(0, _classCallCheck2["default"])(this, Download);
|
|
1013
809
|
return _super19.apply(this, arguments);
|
|
1014
810
|
}
|
|
1015
|
-
|
|
1016
811
|
(0, _createClass2["default"])(Download, [{
|
|
1017
812
|
key: "render",
|
|
1018
813
|
value: function render() {
|
|
1019
814
|
var baseClasses = 'SortableItem rfb-item';
|
|
1020
|
-
|
|
1021
815
|
if (this.props.data.pageBreakBefore) {
|
|
1022
816
|
baseClasses += ' alwaysbreak';
|
|
1023
817
|
}
|
|
1024
|
-
|
|
1025
818
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
1026
819
|
style: _objectSpread({}, this.props.style),
|
|
1027
820
|
className: baseClasses
|
|
@@ -1034,21 +827,16 @@ var Download = /*#__PURE__*/function (_React$Component19) {
|
|
|
1034
827
|
}]);
|
|
1035
828
|
return Download;
|
|
1036
829
|
}(_react["default"].Component);
|
|
1037
|
-
|
|
1038
830
|
var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
1039
831
|
(0, _inherits2["default"])(Camera, _React$Component20);
|
|
1040
|
-
|
|
1041
832
|
var _super20 = _createSuper(Camera);
|
|
1042
|
-
|
|
1043
833
|
function Camera(props) {
|
|
1044
834
|
var _this15;
|
|
1045
|
-
|
|
1046
835
|
(0, _classCallCheck2["default"])(this, Camera);
|
|
1047
836
|
_this15 = _super20.call(this, props);
|
|
1048
837
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this15), "displayImage", function (e) {
|
|
1049
838
|
var self = (0, _assertThisInitialized2["default"])(_this15);
|
|
1050
839
|
var target = e.target;
|
|
1051
|
-
|
|
1052
840
|
if (target.files && target.files.length) {
|
|
1053
841
|
self.setState({
|
|
1054
842
|
img: target.files[0],
|
|
@@ -1068,31 +856,26 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
|
1068
856
|
};
|
|
1069
857
|
return _this15;
|
|
1070
858
|
}
|
|
1071
|
-
|
|
1072
859
|
(0, _createClass2["default"])(Camera, [{
|
|
1073
860
|
key: "getImageSizeProps",
|
|
1074
861
|
value: function getImageSizeProps(_ref) {
|
|
1075
862
|
var width = _ref.width,
|
|
1076
|
-
|
|
863
|
+
height = _ref.height;
|
|
1077
864
|
var imgProps = {
|
|
1078
865
|
width: '100%'
|
|
1079
866
|
};
|
|
1080
|
-
|
|
1081
867
|
if (width) {
|
|
1082
868
|
imgProps.width = width < window.innerWidth ? width : 0.9 * window.innerWidth;
|
|
1083
869
|
}
|
|
1084
|
-
|
|
1085
870
|
if (height) {
|
|
1086
871
|
imgProps.height = height;
|
|
1087
872
|
}
|
|
1088
|
-
|
|
1089
873
|
return imgProps;
|
|
1090
874
|
}
|
|
1091
875
|
}, {
|
|
1092
876
|
key: "render",
|
|
1093
877
|
value: function render() {
|
|
1094
878
|
var _this16 = this;
|
|
1095
|
-
|
|
1096
879
|
var imageStyle = {
|
|
1097
880
|
objectFit: 'scale-down',
|
|
1098
881
|
objectPosition: this.props.data.center ? 'center' : 'left'
|
|
@@ -1102,13 +885,10 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
|
1102
885
|
var fileInputStyle = this.state.img ? {
|
|
1103
886
|
display: 'none'
|
|
1104
887
|
} : null;
|
|
1105
|
-
|
|
1106
888
|
if (this.props.data.pageBreakBefore) {
|
|
1107
889
|
baseClasses += ' alwaysbreak';
|
|
1108
890
|
}
|
|
1109
|
-
|
|
1110
891
|
var sourceDataURL;
|
|
1111
|
-
|
|
1112
892
|
if (this.props.read_only === true && this.props.defaultValue && this.props.defaultValue.length > 0) {
|
|
1113
893
|
if (this.props.defaultValue.indexOf(name > -1)) {
|
|
1114
894
|
sourceDataURL = this.props.defaultValue;
|
|
@@ -1116,7 +896,6 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
|
1116
896
|
sourceDataURL = "data:image/png;base64,".concat(this.props.defaultValue);
|
|
1117
897
|
}
|
|
1118
898
|
}
|
|
1119
|
-
|
|
1120
899
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
1121
900
|
style: _objectSpread({}, this.props.style),
|
|
1122
901
|
className: baseClasses
|
|
@@ -1159,22 +938,17 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
|
1159
938
|
}]);
|
|
1160
939
|
return Camera;
|
|
1161
940
|
}(_react["default"].Component);
|
|
1162
|
-
|
|
1163
941
|
var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
1164
942
|
(0, _inherits2["default"])(FileUpload, _React$Component21);
|
|
1165
|
-
|
|
1166
943
|
var _super21 = _createSuper(FileUpload);
|
|
1167
|
-
|
|
1168
944
|
function FileUpload(props) {
|
|
1169
945
|
var _this17;
|
|
1170
|
-
|
|
1171
946
|
(0, _classCallCheck2["default"])(this, FileUpload);
|
|
1172
947
|
_this17 = _super21.call(this, props);
|
|
1173
948
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this17), "displayFileUpload", function (e) {
|
|
1174
949
|
var self = (0, _assertThisInitialized2["default"])(_this17);
|
|
1175
950
|
var target = e.target;
|
|
1176
951
|
var file;
|
|
1177
|
-
|
|
1178
952
|
if (target.files && target.files.length > 0) {
|
|
1179
953
|
file = target.files[0];
|
|
1180
954
|
self.setState({
|
|
@@ -1190,52 +964,44 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
|
1190
964
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this17), "saveFile", /*#__PURE__*/function () {
|
|
1191
965
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(e) {
|
|
1192
966
|
var sourceUrl, response, dispositionHeader, resBlob, blob, fileName, _fileName;
|
|
1193
|
-
|
|
1194
967
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
1195
|
-
while (1) {
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
case 11:
|
|
1232
|
-
case "end":
|
|
1233
|
-
return _context.stop();
|
|
1234
|
-
}
|
|
968
|
+
while (1) switch (_context.prev = _context.next) {
|
|
969
|
+
case 0:
|
|
970
|
+
e.preventDefault();
|
|
971
|
+
sourceUrl = _this17.props.defaultValue;
|
|
972
|
+
_context.next = 4;
|
|
973
|
+
return (0, _isomorphicFetch["default"])(sourceUrl, {
|
|
974
|
+
method: 'GET',
|
|
975
|
+
headers: {
|
|
976
|
+
Accept: 'application/json',
|
|
977
|
+
'Content-Type': 'application/json; charset=utf-8'
|
|
978
|
+
},
|
|
979
|
+
responseType: 'blob'
|
|
980
|
+
});
|
|
981
|
+
case 4:
|
|
982
|
+
response = _context.sent;
|
|
983
|
+
dispositionHeader = response.headers.get('Content-Disposition');
|
|
984
|
+
_context.next = 8;
|
|
985
|
+
return response.blob();
|
|
986
|
+
case 8:
|
|
987
|
+
resBlob = _context.sent;
|
|
988
|
+
// eslint-disable-next-line no-undef
|
|
989
|
+
blob = new Blob([resBlob], {
|
|
990
|
+
type: _this17.props.data.fileType || response.headers.get('Content-Type')
|
|
991
|
+
});
|
|
992
|
+
if (dispositionHeader && dispositionHeader.indexOf(';filename=') > -1) {
|
|
993
|
+
fileName = dispositionHeader.split(';filename=')[1];
|
|
994
|
+
(0, _fileSaver.saveAs)(blob, fileName);
|
|
995
|
+
} else {
|
|
996
|
+
_fileName = sourceUrl.substring(sourceUrl.lastIndexOf('/') + 1);
|
|
997
|
+
(0, _fileSaver.saveAs)(response.url, _fileName);
|
|
998
|
+
}
|
|
999
|
+
case 11:
|
|
1000
|
+
case "end":
|
|
1001
|
+
return _context.stop();
|
|
1235
1002
|
}
|
|
1236
1003
|
}, _callee);
|
|
1237
1004
|
}));
|
|
1238
|
-
|
|
1239
1005
|
return function (_x) {
|
|
1240
1006
|
return _ref2.apply(this, arguments);
|
|
1241
1007
|
};
|
|
@@ -1245,7 +1011,6 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
|
1245
1011
|
};
|
|
1246
1012
|
return _this17;
|
|
1247
1013
|
}
|
|
1248
|
-
|
|
1249
1014
|
(0, _createClass2["default"])(FileUpload, [{
|
|
1250
1015
|
key: "render",
|
|
1251
1016
|
value: function render() {
|
|
@@ -1254,11 +1019,9 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
|
1254
1019
|
var fileInputStyle = this.state.fileUpload ? {
|
|
1255
1020
|
display: 'none'
|
|
1256
1021
|
} : null;
|
|
1257
|
-
|
|
1258
1022
|
if (this.props.data.pageBreakBefore) {
|
|
1259
1023
|
baseClasses += ' alwaysbreak';
|
|
1260
1024
|
}
|
|
1261
|
-
|
|
1262
1025
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
1263
1026
|
style: _objectSpread({}, this.props.style),
|
|
1264
1027
|
className: baseClasses
|
|
@@ -1307,20 +1070,15 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
|
1307
1070
|
}]);
|
|
1308
1071
|
return FileUpload;
|
|
1309
1072
|
}(_react["default"].Component);
|
|
1310
|
-
|
|
1311
1073
|
var Range = /*#__PURE__*/function (_React$Component22) {
|
|
1312
1074
|
(0, _inherits2["default"])(Range, _React$Component22);
|
|
1313
|
-
|
|
1314
1075
|
var _super22 = _createSuper(Range);
|
|
1315
|
-
|
|
1316
1076
|
function Range(props) {
|
|
1317
1077
|
var _this18;
|
|
1318
|
-
|
|
1319
1078
|
(0, _classCallCheck2["default"])(this, Range);
|
|
1320
1079
|
_this18 = _super22.call(this, props);
|
|
1321
1080
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this18), "changeValue", function (e) {
|
|
1322
1081
|
var target = e.target;
|
|
1323
|
-
|
|
1324
1082
|
_this18.setState({
|
|
1325
1083
|
value: target.value
|
|
1326
1084
|
});
|
|
@@ -1331,7 +1089,6 @@ var Range = /*#__PURE__*/function (_React$Component22) {
|
|
|
1331
1089
|
};
|
|
1332
1090
|
return _this18;
|
|
1333
1091
|
}
|
|
1334
|
-
|
|
1335
1092
|
(0, _createClass2["default"])(Range, [{
|
|
1336
1093
|
key: "render",
|
|
1337
1094
|
value: function render() {
|
|
@@ -1344,58 +1101,44 @@ var Range = /*#__PURE__*/function (_React$Component22) {
|
|
|
1344
1101
|
props.step = this.props.data.step;
|
|
1345
1102
|
props.value = this.state.value;
|
|
1346
1103
|
props.change = this.changeValue;
|
|
1347
|
-
|
|
1348
1104
|
if (this.props.mutable) {
|
|
1349
1105
|
props.ref = this.inputField;
|
|
1350
1106
|
}
|
|
1351
|
-
|
|
1352
1107
|
var datalist = [];
|
|
1353
|
-
|
|
1354
1108
|
for (var i = parseInt(props.min, 10); i <= parseInt(props.max, 10); i += parseInt(props.step, 10)) {
|
|
1355
1109
|
datalist.push(i);
|
|
1356
1110
|
}
|
|
1357
|
-
|
|
1358
1111
|
var oneBig = 100 / (datalist.length - 1);
|
|
1359
|
-
|
|
1360
1112
|
var _datalist = datalist.map(function (d, idx) {
|
|
1361
1113
|
return /*#__PURE__*/_react["default"].createElement("option", {
|
|
1362
1114
|
key: "".concat(props.list, "_").concat(idx)
|
|
1363
1115
|
}, d);
|
|
1364
1116
|
});
|
|
1365
|
-
|
|
1366
1117
|
var visible_marks = datalist.map(function (d, idx) {
|
|
1367
1118
|
var option_props = {};
|
|
1368
1119
|
var w = oneBig;
|
|
1369
|
-
|
|
1370
1120
|
if (idx === 0 || idx === datalist.length - 1) {
|
|
1371
1121
|
w = oneBig / 2;
|
|
1372
1122
|
}
|
|
1373
|
-
|
|
1374
1123
|
option_props.key = "".concat(props.list, "_label_").concat(idx);
|
|
1375
1124
|
option_props.style = {
|
|
1376
1125
|
width: "".concat(w, "%")
|
|
1377
1126
|
};
|
|
1378
|
-
|
|
1379
1127
|
if (idx === datalist.length - 1) {
|
|
1380
1128
|
option_props.style = {
|
|
1381
1129
|
width: "".concat(w, "%"),
|
|
1382
1130
|
textAlign: 'right'
|
|
1383
1131
|
};
|
|
1384
1132
|
}
|
|
1385
|
-
|
|
1386
1133
|
return /*#__PURE__*/_react["default"].createElement("label", option_props, d);
|
|
1387
1134
|
});
|
|
1388
|
-
|
|
1389
1135
|
if (this.props.read_only) {
|
|
1390
1136
|
props.disabled = 'disabled';
|
|
1391
1137
|
}
|
|
1392
|
-
|
|
1393
1138
|
var baseClasses = 'SortableItem rfb-item';
|
|
1394
|
-
|
|
1395
1139
|
if (this.props.data.pageBreakBefore) {
|
|
1396
1140
|
baseClasses += ' alwaysbreak';
|
|
1397
1141
|
}
|
|
1398
|
-
|
|
1399
1142
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
1400
1143
|
style: _objectSpread({}, this.props.style),
|
|
1401
1144
|
className: baseClasses
|
|
@@ -1422,7 +1165,6 @@ var Range = /*#__PURE__*/function (_React$Component22) {
|
|
|
1422
1165
|
}]);
|
|
1423
1166
|
return Range;
|
|
1424
1167
|
}(_react["default"].Component);
|
|
1425
|
-
|
|
1426
1168
|
FormElements.Header = Header;
|
|
1427
1169
|
FormElements.Paragraph = Paragraph;
|
|
1428
1170
|
FormElements.Label = Label;
|