react-survey-builder 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/LICENSE +7 -0
- package/README.md +236 -0
- package/dist/967.index.js +1 -0
- package/dist/app.css +1 -0
- package/dist/app.css.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +46 -0
- package/lib/ItemTypes.js +10 -0
- package/lib/UUID.js +65 -0
- package/lib/dynamic-option-list.js +188 -0
- package/lib/fieldset/FieldSet.js +118 -0
- package/lib/fieldset/index.js +13 -0
- package/lib/form.js +604 -0
- package/lib/functions/index.js +45 -0
- package/lib/index.js +139 -0
- package/lib/language-provider/IntlMessages.js +15 -0
- package/lib/language-provider/entries/en-us.js +16 -0
- package/lib/language-provider/entries/it-it.js +16 -0
- package/lib/language-provider/entries/vi-vn.js +16 -0
- package/lib/language-provider/index.js +32 -0
- package/lib/language-provider/locales/en-us.json +97 -0
- package/lib/language-provider/locales/it-it.json +92 -0
- package/lib/language-provider/locales/vi-vn.json +82 -0
- package/lib/multi-column/MultiColumnRow.js +134 -0
- package/lib/multi-column/dustbin.js +152 -0
- package/lib/multi-column/grip.js +51 -0
- package/lib/multi-column/index.js +24 -0
- package/lib/preview.js +388 -0
- package/lib/sortable-element.js +177 -0
- package/lib/sortable-form-elements.js +67 -0
- package/lib/stores/registry.js +42 -0
- package/lib/stores/requests.js +31 -0
- package/lib/stores/store.js +138 -0
- package/lib/survey-dynamic-edit.js +54 -0
- package/lib/survey-elements/component-drag-handle.js +90 -0
- package/lib/survey-elements/component-drag-layer.js +68 -0
- package/lib/survey-elements/component-drag-preview.js +57 -0
- package/lib/survey-elements/component-header.js +29 -0
- package/lib/survey-elements/component-label.js +26 -0
- package/lib/survey-elements/custom-element.js +70 -0
- package/lib/survey-elements/date-picker.js +278 -0
- package/lib/survey-elements/header-bar.js +54 -0
- package/lib/survey-elements/index.js +1196 -0
- package/lib/survey-elements/myxss.js +29 -0
- package/lib/survey-elements/star-rating.js +335 -0
- package/lib/survey-elements-edit.js +613 -0
- package/lib/survey-place-holder.js +51 -0
- package/lib/survey-validator.js +103 -0
- package/lib/toolbar-draggable-item.js +59 -0
- package/lib/toolbar-group-item.js +39 -0
- package/lib/toolbar.js +680 -0
- package/lib/utils/custom-date-picker.js +93 -0
- package/package.json +114 -0
- package/types/index.d.ts +180 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
/*
|
2
|
+
object-assign
|
3
|
+
(c) Sindre Sorhus
|
4
|
+
@license MIT
|
5
|
+
*/
|
6
|
+
|
7
|
+
/*!
|
8
|
+
Copyright (c) 2018 Jed Watson.
|
9
|
+
Licensed under the MIT License (MIT), see
|
10
|
+
http://jedwatson.github.io/classnames
|
11
|
+
*/
|
12
|
+
|
13
|
+
/*!
|
14
|
+
Copyright (c) 2017 Jed Watson.
|
15
|
+
Licensed under the MIT License (MIT), see
|
16
|
+
http://jedwatson.github.io/classnames
|
17
|
+
*/
|
18
|
+
|
19
|
+
/*!
|
20
|
+
* Signature Pad v2.3.2
|
21
|
+
* https://github.com/szimek/signature_pad
|
22
|
+
*
|
23
|
+
* Copyright 2017 Szymon Nowak
|
24
|
+
* Released under the MIT license
|
25
|
+
*
|
26
|
+
* The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from:
|
27
|
+
* http://corner.squareup.com/2012/07/smoother-signatures.html
|
28
|
+
*
|
29
|
+
* Implementation of interpolation using cubic Bézier curves is taken from:
|
30
|
+
* http://benknowscode.wordpress.com/2012/09/14/path-interpolation-using-cubic-bezier-and-control-point-estimation-in-javascript
|
31
|
+
*
|
32
|
+
* Algorithm for approximated length of a Bézier curve is taken from:
|
33
|
+
* http://www.lemoda.net/maths/bezier-length/index.html
|
34
|
+
*
|
35
|
+
*/
|
36
|
+
|
37
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
38
|
+
|
39
|
+
/** @license React v16.13.1
|
40
|
+
* react-is.production.min.js
|
41
|
+
*
|
42
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
43
|
+
*
|
44
|
+
* This source code is licensed under the MIT license found in the
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
46
|
+
*/
|
package/lib/ItemTypes.js
ADDED
package/lib/UUID.js
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
/* eslint-disable */
|
4
|
+
// Private array of chars to use
|
5
|
+
var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
6
|
+
var ID = {};
|
7
|
+
ID.uuid = function (len, radix) {
|
8
|
+
var chars = CHARS,
|
9
|
+
uuid = [],
|
10
|
+
i;
|
11
|
+
radix = radix || chars.length;
|
12
|
+
if (len) {
|
13
|
+
// Compact form
|
14
|
+
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
|
15
|
+
} else {
|
16
|
+
// rfc4122, version 4 form
|
17
|
+
var r;
|
18
|
+
|
19
|
+
// rfc4122 requires these characters
|
20
|
+
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
|
21
|
+
uuid[14] = '4';
|
22
|
+
|
23
|
+
// Fill in random data. At i==19 set the high bits of clock sequence as
|
24
|
+
// per rfc4122, sec. 4.1.5
|
25
|
+
for (i = 0; i < 36; i++) {
|
26
|
+
if (!uuid[i]) {
|
27
|
+
r = 0 | Math.random() * 16;
|
28
|
+
uuid[i] = chars[i == 19 ? r & 0x3 | 0x8 : r];
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
return uuid.join('');
|
33
|
+
};
|
34
|
+
|
35
|
+
// A more performant, but slightly bulkier, RFC4122v4 solution. We boost performance
|
36
|
+
// by minimizing calls to random()
|
37
|
+
ID.uuidFast = function () {
|
38
|
+
var chars = CHARS,
|
39
|
+
uuid = new Array(36),
|
40
|
+
rnd = 0,
|
41
|
+
r;
|
42
|
+
for (var i = 0; i < 36; i++) {
|
43
|
+
if (i == 8 || i == 13 || i == 18 || i == 23) {
|
44
|
+
uuid[i] = '-';
|
45
|
+
} else if (i == 14) {
|
46
|
+
uuid[i] = '4';
|
47
|
+
} else {
|
48
|
+
if (rnd <= 0x02) rnd = 0x2000000 + Math.random() * 0x1000000 | 0;
|
49
|
+
r = rnd & 0xf;
|
50
|
+
rnd = rnd >> 4;
|
51
|
+
uuid[i] = chars[i == 19 ? r & 0x3 | 0x8 : r];
|
52
|
+
}
|
53
|
+
}
|
54
|
+
return uuid.join('');
|
55
|
+
};
|
56
|
+
|
57
|
+
// A more compact, but less performant, RFC4122v4 solution:
|
58
|
+
ID.uuidCompact = function () {
|
59
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
60
|
+
var r = Math.random() * 16 | 0,
|
61
|
+
v = c == 'x' ? r : r & 0x3 | 0x8;
|
62
|
+
return v.toString(16);
|
63
|
+
});
|
64
|
+
};
|
65
|
+
module.exports = ID;
|
@@ -0,0 +1,188 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports["default"] = void 0;
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
10
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
11
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
12
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
13
|
+
var _react = _interopRequireDefault(require("react"));
|
14
|
+
var _UUID = _interopRequireDefault(require("./UUID"));
|
15
|
+
var _IntlMessages = _interopRequireDefault(require("./language-provider/IntlMessages"));
|
16
|
+
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); }; }
|
17
|
+
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; } } /**
|
18
|
+
* <DynamicOptionList />
|
19
|
+
*/
|
20
|
+
var DynamicOptionList = exports["default"] = /*#__PURE__*/function (_React$Component) {
|
21
|
+
(0, _inherits2["default"])(DynamicOptionList, _React$Component);
|
22
|
+
var _super = _createSuper(DynamicOptionList);
|
23
|
+
function DynamicOptionList(props) {
|
24
|
+
var _this;
|
25
|
+
(0, _classCallCheck2["default"])(this, DynamicOptionList);
|
26
|
+
_this = _super.call(this, props);
|
27
|
+
_this.state = {
|
28
|
+
element: _this.props.element,
|
29
|
+
data: _this.props.data,
|
30
|
+
dirty: false
|
31
|
+
};
|
32
|
+
return _this;
|
33
|
+
}
|
34
|
+
(0, _createClass2["default"])(DynamicOptionList, [{
|
35
|
+
key: "_setValue",
|
36
|
+
value: function _setValue(text) {
|
37
|
+
return text.replace(/[^A-Z0-9]+/ig, '_').toLowerCase();
|
38
|
+
}
|
39
|
+
}, {
|
40
|
+
key: "editOption",
|
41
|
+
value: function editOption(option_index, e) {
|
42
|
+
var this_element = this.state.element;
|
43
|
+
var val = this_element.options[option_index].value !== this._setValue(this_element.options[option_index].text) ? this_element.options[option_index].value : this._setValue(e.target.value);
|
44
|
+
this_element.options[option_index].text = e.target.value;
|
45
|
+
this_element.options[option_index].value = val;
|
46
|
+
this.setState({
|
47
|
+
element: this_element,
|
48
|
+
dirty: true
|
49
|
+
});
|
50
|
+
}
|
51
|
+
}, {
|
52
|
+
key: "editValue",
|
53
|
+
value: function editValue(option_index, e) {
|
54
|
+
var this_element = this.state.element;
|
55
|
+
var val = e.target.value === '' ? this._setValue(this_element.options[option_index].text) : e.target.value;
|
56
|
+
this_element.options[option_index].value = val;
|
57
|
+
this.setState({
|
58
|
+
element: this_element,
|
59
|
+
dirty: true
|
60
|
+
});
|
61
|
+
}
|
62
|
+
|
63
|
+
// eslint-disable-next-line no-unused-vars
|
64
|
+
}, {
|
65
|
+
key: "editOptionCorrect",
|
66
|
+
value: function editOptionCorrect(option_index, e) {
|
67
|
+
var this_element = this.state.element;
|
68
|
+
if (this_element.options[option_index].hasOwnProperty('correct')) {
|
69
|
+
delete this_element.options[option_index].correct;
|
70
|
+
} else {
|
71
|
+
this_element.options[option_index].correct = true;
|
72
|
+
}
|
73
|
+
this.setState({
|
74
|
+
element: this_element
|
75
|
+
});
|
76
|
+
this.props.updateElement.call(this.props.preview, this_element);
|
77
|
+
}
|
78
|
+
}, {
|
79
|
+
key: "updateOption",
|
80
|
+
value: function updateOption() {
|
81
|
+
var this_element = this.state.element;
|
82
|
+
// to prevent ajax calls with no change
|
83
|
+
if (this.state.dirty) {
|
84
|
+
this.props.updateElement.call(this.props.preview, this_element);
|
85
|
+
this.setState({
|
86
|
+
dirty: false
|
87
|
+
});
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}, {
|
91
|
+
key: "addOption",
|
92
|
+
value: function addOption(index) {
|
93
|
+
var this_element = this.state.element;
|
94
|
+
this_element.options.splice(index + 1, 0, {
|
95
|
+
value: '',
|
96
|
+
text: '',
|
97
|
+
key: _UUID["default"].uuid()
|
98
|
+
});
|
99
|
+
this.props.updateElement.call(this.props.preview, this_element);
|
100
|
+
}
|
101
|
+
}, {
|
102
|
+
key: "removeOption",
|
103
|
+
value: function removeOption(index) {
|
104
|
+
var this_element = this.state.element;
|
105
|
+
this_element.options.splice(index, 1);
|
106
|
+
this.props.updateElement.call(this.props.preview, this_element);
|
107
|
+
}
|
108
|
+
}, {
|
109
|
+
key: "render",
|
110
|
+
value: function render() {
|
111
|
+
var _this2 = this;
|
112
|
+
if (this.state.dirty) {
|
113
|
+
this.state.element.dirty = true;
|
114
|
+
}
|
115
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
116
|
+
className: "dynamic-option-list"
|
117
|
+
}, /*#__PURE__*/_react["default"].createElement("ul", null, /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("div", {
|
118
|
+
className: "row"
|
119
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
120
|
+
className: "col-sm-6"
|
121
|
+
}, /*#__PURE__*/_react["default"].createElement("b", null, /*#__PURE__*/_react["default"].createElement(_IntlMessages["default"], {
|
122
|
+
id: "options"
|
123
|
+
}))), this.props.canHaveOptionValue && /*#__PURE__*/_react["default"].createElement("div", {
|
124
|
+
className: "col-sm-2"
|
125
|
+
}, /*#__PURE__*/_react["default"].createElement("b", null, /*#__PURE__*/_react["default"].createElement(_IntlMessages["default"], {
|
126
|
+
id: "value"
|
127
|
+
}))), this.props.canHaveOptionValue && this.props.canHaveOptionCorrect && /*#__PURE__*/_react["default"].createElement("div", {
|
128
|
+
className: "col-sm-4"
|
129
|
+
}, /*#__PURE__*/_react["default"].createElement("b", null, /*#__PURE__*/_react["default"].createElement(_IntlMessages["default"], {
|
130
|
+
id: "correct"
|
131
|
+
}))))), this.props.element.options.map(function (option, index) {
|
132
|
+
var this_key = "edit_".concat(option.key);
|
133
|
+
var val = option.value !== _this2._setValue(option.text) ? option.value : '';
|
134
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
135
|
+
className: "clearfix",
|
136
|
+
key: this_key
|
137
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
138
|
+
className: "row"
|
139
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
140
|
+
className: "col-sm-6"
|
141
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
142
|
+
tabIndex: index + 1,
|
143
|
+
className: "form-control",
|
144
|
+
style: {
|
145
|
+
width: '100%'
|
146
|
+
},
|
147
|
+
type: "text",
|
148
|
+
name: "text_".concat(index),
|
149
|
+
placeholder: "Option text",
|
150
|
+
value: option.text,
|
151
|
+
onBlur: _this2.updateOption.bind(_this2),
|
152
|
+
onChange: _this2.editOption.bind(_this2, index)
|
153
|
+
})), _this2.props.canHaveOptionValue && /*#__PURE__*/_react["default"].createElement("div", {
|
154
|
+
className: "col-sm-2"
|
155
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
156
|
+
className: "form-control",
|
157
|
+
type: "text",
|
158
|
+
name: "value_".concat(index),
|
159
|
+
value: val,
|
160
|
+
onChange: _this2.editValue.bind(_this2, index)
|
161
|
+
})), _this2.props.canHaveOptionValue && _this2.props.canHaveOptionCorrect && /*#__PURE__*/_react["default"].createElement("div", {
|
162
|
+
className: "col-sm-1"
|
163
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
164
|
+
className: "form-control",
|
165
|
+
type: "checkbox",
|
166
|
+
value: "1",
|
167
|
+
onChange: _this2.editOptionCorrect.bind(_this2, index),
|
168
|
+
checked: option.hasOwnProperty('correct')
|
169
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
170
|
+
className: "col-sm-3"
|
171
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
172
|
+
className: "dynamic-options-actions-buttons"
|
173
|
+
}, /*#__PURE__*/_react["default"].createElement("button", {
|
174
|
+
onClick: _this2.addOption.bind(_this2, index),
|
175
|
+
className: "btn btn-success"
|
176
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
177
|
+
className: "fas fa-plus-circle"
|
178
|
+
})), index > 0 && /*#__PURE__*/_react["default"].createElement("button", {
|
179
|
+
onClick: _this2.removeOption.bind(_this2, index),
|
180
|
+
className: "btn btn-danger"
|
181
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
182
|
+
className: "fas fa-minus-circle"
|
183
|
+
}))))));
|
184
|
+
})));
|
185
|
+
}
|
186
|
+
}]);
|
187
|
+
return DynamicOptionList;
|
188
|
+
}(_react["default"].Component);
|
@@ -0,0 +1,118 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports["default"] = FieldSetBase;
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
13
|
+
var _componentHeader = _interopRequireDefault(require("../survey-elements/component-header"));
|
14
|
+
var _componentLabel = _interopRequireDefault(require("../survey-elements/component-label"));
|
15
|
+
var _dustbin = _interopRequireDefault(require("../multi-column/dustbin"));
|
16
|
+
var _ItemTypes = _interopRequireDefault(require("../ItemTypes"));
|
17
|
+
var _excluded = ["data", "class_name"];
|
18
|
+
/* eslint-disable camelcase */
|
19
|
+
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; }
|
20
|
+
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; }
|
21
|
+
var accepts = [_ItemTypes["default"].BOX, _ItemTypes["default"].CARD];
|
22
|
+
function FieldSetBase(props) {
|
23
|
+
var _React$useState = _react["default"].useState({}),
|
24
|
+
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
25
|
+
childData = _React$useState2[0],
|
26
|
+
setChildData = _React$useState2[1];
|
27
|
+
var _React$useState3 = _react["default"].useState(null),
|
28
|
+
_React$useState4 = (0, _slicedToArray2["default"])(_React$useState3, 2),
|
29
|
+
childItems = _React$useState4[0],
|
30
|
+
setChildItems = _React$useState4[1];
|
31
|
+
_react["default"].useEffect(function () {
|
32
|
+
var data = props.data,
|
33
|
+
class_name = props.class_name,
|
34
|
+
rest = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
35
|
+
setChildData(data);
|
36
|
+
var count = 1;
|
37
|
+
createChild(count, data);
|
38
|
+
}, [props]);
|
39
|
+
var addNewChild = function addNewChild() {
|
40
|
+
var data = props.data;
|
41
|
+
var colCount = data.childItems.length + 1;
|
42
|
+
var oldChilds = data.childItems;
|
43
|
+
data.childItems = Array.from({
|
44
|
+
length: colCount
|
45
|
+
}, function (v, i) {
|
46
|
+
return oldChilds[i] ? oldChilds[i] : null;
|
47
|
+
});
|
48
|
+
setChildItems(data.childItems);
|
49
|
+
};
|
50
|
+
var _onDropSuccess = function onDropSuccess(droppedIndex) {
|
51
|
+
var totalChild = childItems ? childItems.length : 0;
|
52
|
+
var isLastChild = totalChild === droppedIndex + 1;
|
53
|
+
if (isLastChild) {
|
54
|
+
addNewChild();
|
55
|
+
}
|
56
|
+
};
|
57
|
+
var createChild = function createChild(count, data) {
|
58
|
+
var colCount = count;
|
59
|
+
var className = data.class_name || "col-md-12";
|
60
|
+
if (!data.childItems) {
|
61
|
+
// eslint-disable-next-line no-param-reassign
|
62
|
+
data.childItems = Array.from({
|
63
|
+
length: colCount
|
64
|
+
}, function (v, i) {
|
65
|
+
return null;
|
66
|
+
});
|
67
|
+
data.isContainer = true;
|
68
|
+
}
|
69
|
+
setChildItems(data.childItems);
|
70
|
+
};
|
71
|
+
var controls = props.controls,
|
72
|
+
editModeOn = props.editModeOn,
|
73
|
+
getDataById = props.getDataById,
|
74
|
+
setAsChild = props.setAsChild,
|
75
|
+
removeChild = props.removeChild,
|
76
|
+
seq = props.seq,
|
77
|
+
className = props.className,
|
78
|
+
index = props.index;
|
79
|
+
var pageBreakBefore = childData.pageBreakBefore;
|
80
|
+
var baseClasses = "SortableItem rfb-item";
|
81
|
+
if (pageBreakBefore) {
|
82
|
+
baseClasses += " alwaysbreak";
|
83
|
+
}
|
84
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
85
|
+
style: _objectSpread({}, props.style),
|
86
|
+
className: baseClasses
|
87
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], (0, _extends2["default"])({}, props, {
|
88
|
+
isFieldSet: true
|
89
|
+
})), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], props), /*#__PURE__*/_react["default"].createElement("div", {
|
90
|
+
className: "row"
|
91
|
+
}, childItems === null || childItems === void 0 ? void 0 : childItems.map(function (x, i) {
|
92
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
93
|
+
key: "".concat(i, "_").concat(x || "_"),
|
94
|
+
className: "col-md-12"
|
95
|
+
}, controls ? controls[i] : /*#__PURE__*/_react["default"].createElement(_dustbin["default"], {
|
96
|
+
style: {
|
97
|
+
width: "100%"
|
98
|
+
},
|
99
|
+
data: childData,
|
100
|
+
accepts: accepts,
|
101
|
+
items: childItems,
|
102
|
+
key: i,
|
103
|
+
col: i,
|
104
|
+
onDropSuccess: function onDropSuccess() {
|
105
|
+
return _onDropSuccess(i);
|
106
|
+
},
|
107
|
+
parentIndex: index,
|
108
|
+
editModeOn: editModeOn,
|
109
|
+
_onDestroy: function _onDestroy() {
|
110
|
+
return removeChild(childData, i);
|
111
|
+
},
|
112
|
+
getDataById: getDataById,
|
113
|
+
setAsChild: setAsChild,
|
114
|
+
seq: seq,
|
115
|
+
rowNo: i
|
116
|
+
}));
|
117
|
+
}))));
|
118
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
Object.defineProperty(exports, "FieldSet", {
|
8
|
+
enumerable: true,
|
9
|
+
get: function get() {
|
10
|
+
return _FieldSet["default"];
|
11
|
+
}
|
12
|
+
});
|
13
|
+
var _FieldSet = _interopRequireDefault(require("./FieldSet"));
|