@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,15 +8,14 @@ exports["default"] = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
17
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
|
-
function
|
|
19
|
-
function _isNativeReflectConstruct() {
|
|
17
|
+
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)); }
|
|
18
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
19
|
/**
|
|
21
20
|
* @fileoverview react-star-rating
|
|
22
21
|
* @author @cameronjroe
|
|
@@ -31,15 +30,22 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
31
30
|
* onRatingClick={function} - a handler function that gets called onClick of the rating (optional)
|
|
32
31
|
* />
|
|
33
32
|
*/
|
|
34
|
-
var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
35
|
-
(0, _inherits2["default"])(StarRating, _React$Component);
|
|
36
|
-
var _super = _createSuper(StarRating);
|
|
33
|
+
var StarRating = exports["default"] = /*#__PURE__*/function (_React$Component) {
|
|
37
34
|
function StarRating(props) {
|
|
38
35
|
var _this;
|
|
39
36
|
(0, _classCallCheck2["default"])(this, StarRating);
|
|
40
|
-
_this =
|
|
37
|
+
_this = _callSuper(this, StarRating, [props]);
|
|
41
38
|
_this.min = 0;
|
|
42
39
|
_this.max = props.ratingAmount || 5;
|
|
40
|
+
|
|
41
|
+
// Pre-bind methods to avoid creating new functions on each render
|
|
42
|
+
_this.handleMouseLeave = _this.handleMouseLeave.bind(_this);
|
|
43
|
+
_this.handleMouseMove = _this.handleMouseMove.bind(_this);
|
|
44
|
+
_this.handleClick = _this.handleClick.bind(_this);
|
|
45
|
+
|
|
46
|
+
// Create refs properly
|
|
47
|
+
_this.rootNode = /*#__PURE__*/_react["default"].createRef();
|
|
48
|
+
_this.ratingContainerNode = /*#__PURE__*/_react["default"].createRef();
|
|
43
49
|
var ratingVal = props.rating;
|
|
44
50
|
var ratingCache = {
|
|
45
51
|
pos: ratingVal ? _this.getStarRatingPosition(ratingVal) : 0,
|
|
@@ -60,7 +66,8 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
|
60
66
|
* Gets the stars based on ratingAmount
|
|
61
67
|
* @return {string} stars
|
|
62
68
|
*/
|
|
63
|
-
(0,
|
|
69
|
+
(0, _inherits2["default"])(StarRating, _React$Component);
|
|
70
|
+
return (0, _createClass2["default"])(StarRating, [{
|
|
64
71
|
key: "getStars",
|
|
65
72
|
value: function getStars() {
|
|
66
73
|
var stars = '';
|
|
@@ -70,39 +77,24 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
|
70
77
|
}
|
|
71
78
|
return stars;
|
|
72
79
|
}
|
|
73
|
-
|
|
74
|
-
// componentWillMount() {
|
|
75
|
-
// this.min = 0;
|
|
76
|
-
// this.max = this.props.ratingAmount || 5;
|
|
77
|
-
// if (this.props.rating) {
|
|
78
|
-
// this.state.editing = this.props.editing || false;
|
|
79
|
-
// const ratingVal = this.props.rating;
|
|
80
|
-
// this.state.ratingCache.pos = this.getStarRatingPosition(ratingVal);
|
|
81
|
-
// this.state.ratingCache.rating = ratingVal;
|
|
82
|
-
|
|
83
|
-
// this.setState({
|
|
84
|
-
// ratingCache: this.state.ratingCache,
|
|
85
|
-
// rating: ratingVal,
|
|
86
|
-
// pos: this.getStarRatingPosition(ratingVal),
|
|
87
|
-
// });
|
|
88
|
-
// }
|
|
89
|
-
// }
|
|
90
80
|
}, {
|
|
91
81
|
key: "componentDidMount",
|
|
92
82
|
value: function componentDidMount() {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
delete this.ratingContainer;
|
|
83
|
+
// Initialize with proper values from props
|
|
84
|
+
if (this.props.rating) {
|
|
85
|
+
this.setState({
|
|
86
|
+
pos: this.getStarRatingPosition(this.props.rating),
|
|
87
|
+
rating: this.props.rating
|
|
88
|
+
});
|
|
89
|
+
}
|
|
101
90
|
}
|
|
91
|
+
|
|
92
|
+
// REMOVED componentWillUnmount as it wasn't doing anything useful
|
|
102
93
|
}, {
|
|
103
94
|
key: "getPosition",
|
|
104
95
|
value: function getPosition(e) {
|
|
105
|
-
|
|
96
|
+
if (!this.rootNode.current) return 0;
|
|
97
|
+
return e.pageX - this.rootNode.current.getBoundingClientRect().left;
|
|
106
98
|
}
|
|
107
99
|
}, {
|
|
108
100
|
key: "applyPrecision",
|
|
@@ -118,6 +110,7 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
|
118
110
|
}, {
|
|
119
111
|
key: "getWidthFromValue",
|
|
120
112
|
value: function getWidthFromValue(val) {
|
|
113
|
+
if (val === null || val === undefined || typeof val !== 'number') return 0;
|
|
121
114
|
var min = this.min;
|
|
122
115
|
var max = this.max;
|
|
123
116
|
if (val <= min || min === max) {
|
|
@@ -126,13 +119,15 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
|
126
119
|
if (val >= max) {
|
|
127
120
|
return 100;
|
|
128
121
|
}
|
|
129
|
-
return val / (max - min) * 100;
|
|
122
|
+
return (val - min) / (max - min) * 100;
|
|
130
123
|
}
|
|
131
124
|
}, {
|
|
132
125
|
key: "getValueFromPosition",
|
|
133
126
|
value: function getValueFromPosition(pos) {
|
|
127
|
+
if (!this.ratingContainerNode.current) return 0;
|
|
134
128
|
var precision = this.getDecimalPlaces(this.props.step);
|
|
135
|
-
var maxWidth = this.
|
|
129
|
+
var maxWidth = this.ratingContainerNode.current.offsetWidth;
|
|
130
|
+
if (!maxWidth) return 0;
|
|
136
131
|
var diff = this.max - this.min;
|
|
137
132
|
var factor = diff * pos / (maxWidth * this.props.step);
|
|
138
133
|
factor = Math.ceil(factor);
|
|
@@ -144,8 +139,7 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
|
144
139
|
key: "calculate",
|
|
145
140
|
value: function calculate(pos) {
|
|
146
141
|
var val = this.getValueFromPosition(pos);
|
|
147
|
-
var width = this.getWidthFromValue(val);
|
|
148
|
-
width += '%';
|
|
142
|
+
var width = "".concat(this.getWidthFromValue(val), "%");
|
|
149
143
|
return {
|
|
150
144
|
width: width,
|
|
151
145
|
val: val
|
|
@@ -173,9 +167,9 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
|
173
167
|
xmlns: "http://www.w3.org/2000/svg"
|
|
174
168
|
}, /*#__PURE__*/_react["default"].createElement("g", {
|
|
175
169
|
stroke: "none",
|
|
176
|
-
|
|
170
|
+
strokeWidth: "1",
|
|
177
171
|
fill: "none",
|
|
178
|
-
|
|
172
|
+
fillRule: "evenodd"
|
|
179
173
|
}, /*#__PURE__*/_react["default"].createElement("polygon", {
|
|
180
174
|
id: "star-flat",
|
|
181
175
|
points: "143 225 54.8322122 271.352549 71.6707613 173.176275 0.341522556 103.647451 98.9161061 89.3237254 143 0 187.083894 89.3237254 285.658477 103.647451 214.329239 173.176275 231.167788 271.352549 "
|
|
@@ -192,26 +186,46 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
|
192
186
|
}, {
|
|
193
187
|
key: "handleMouseMove",
|
|
194
188
|
value: function handleMouseMove(e) {
|
|
195
|
-
//
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
rating: val
|
|
205
|
-
});
|
|
189
|
+
// Only process if editing is enabled
|
|
190
|
+
if (!this.props.disabled && (this.state.editing || this.props.editing)) {
|
|
191
|
+
// get hover position
|
|
192
|
+
var ratingEvent = this.getRatingEvent(e);
|
|
193
|
+
this.setState({
|
|
194
|
+
pos: ratingEvent.width,
|
|
195
|
+
rating: ratingEvent.val
|
|
196
|
+
});
|
|
197
|
+
}
|
|
206
198
|
}
|
|
199
|
+
|
|
200
|
+
// REMOVED updateRating method which was causing issues
|
|
201
|
+
|
|
202
|
+
// Fixed shouldComponentUpdate to prevent infinite loops
|
|
207
203
|
}, {
|
|
208
204
|
key: "shouldComponentUpdate",
|
|
209
205
|
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
210
|
-
|
|
211
|
-
|
|
206
|
+
// Don't trigger a state update from this method!
|
|
207
|
+
if (nextProps.rating !== this.props.rating) {
|
|
212
208
|
return true;
|
|
213
209
|
}
|
|
214
|
-
return nextState.ratingCache.rating !== this.state.ratingCache.rating || nextState.rating !== this.state.rating;
|
|
210
|
+
return nextState.ratingCache.rating !== this.state.ratingCache.rating || nextState.rating !== this.state.rating || nextState.pos !== this.state.pos;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Handle rating changes in componentDidUpdate instead
|
|
214
|
+
}, {
|
|
215
|
+
key: "componentDidUpdate",
|
|
216
|
+
value: function componentDidUpdate(prevProps) {
|
|
217
|
+
// Only update if the rating prop changed
|
|
218
|
+
if (prevProps.rating !== this.props.rating && this.props.rating !== this.state.rating) {
|
|
219
|
+
// Update state without causing an infinite loop
|
|
220
|
+
this.setState({
|
|
221
|
+
pos: this.getStarRatingPosition(this.props.rating),
|
|
222
|
+
rating: this.props.rating,
|
|
223
|
+
ratingCache: {
|
|
224
|
+
pos: this.getStarRatingPosition(this.props.rating),
|
|
225
|
+
rating: this.props.rating
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
215
229
|
}
|
|
216
230
|
}, {
|
|
217
231
|
key: "handleClick",
|
|
@@ -222,15 +236,24 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
|
222
236
|
e.preventDefault();
|
|
223
237
|
return false;
|
|
224
238
|
}
|
|
239
|
+
|
|
240
|
+
// Get the current rating based on click position
|
|
241
|
+
var ratingEvent = this.getRatingEvent(e);
|
|
225
242
|
var ratingCache = {
|
|
226
|
-
pos:
|
|
227
|
-
rating:
|
|
243
|
+
pos: ratingEvent.width,
|
|
244
|
+
rating: ratingEvent.val,
|
|
228
245
|
caption: this.props.caption,
|
|
229
246
|
name: this.props.name
|
|
230
247
|
};
|
|
248
|
+
|
|
249
|
+
// Update the state with new values
|
|
231
250
|
this.setState({
|
|
232
|
-
ratingCache: ratingCache
|
|
251
|
+
ratingCache: ratingCache,
|
|
252
|
+
pos: ratingEvent.width,
|
|
253
|
+
rating: ratingEvent.val
|
|
233
254
|
});
|
|
255
|
+
|
|
256
|
+
// Call the callback with the new rating
|
|
234
257
|
this.props.onRatingClick(e, ratingCache);
|
|
235
258
|
return true;
|
|
236
259
|
}
|
|
@@ -245,31 +268,22 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
|
245
268
|
}, {
|
|
246
269
|
key: "render",
|
|
247
270
|
value: function render() {
|
|
248
|
-
var
|
|
249
|
-
_this2 = this;
|
|
250
|
-
// let caption = null;
|
|
251
|
-
var classes = (0, _classnames["default"])((_cx = {
|
|
271
|
+
var classes = (0, _classnames["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({
|
|
252
272
|
'react-star-rating__root': true,
|
|
253
273
|
'rating-disabled': this.props.disabled
|
|
254
|
-
},
|
|
255
|
-
|
|
256
|
-
// is there a caption?
|
|
257
|
-
// if (this.props.caption) {
|
|
258
|
-
// caption = (<span className="react-rating-caption">{this.props.caption}</span>);
|
|
259
|
-
// }
|
|
274
|
+
}, "react-star-rating__size--".concat(this.props.size), this.props.size), 'rating-editing', this.state.editing));
|
|
260
275
|
|
|
261
276
|
// are we editing this rating?
|
|
262
277
|
var starRating;
|
|
263
|
-
|
|
278
|
+
var isEditable = !this.props.disabled && (this.state.editing || this.props.editing);
|
|
279
|
+
if (isEditable) {
|
|
264
280
|
starRating = /*#__PURE__*/_react["default"].createElement("div", {
|
|
265
|
-
ref:
|
|
266
|
-
return _this2.node = c;
|
|
267
|
-
},
|
|
281
|
+
ref: this.ratingContainerNode,
|
|
268
282
|
className: "rating-container rating-gly-star",
|
|
269
283
|
"data-content": this.state.glyph,
|
|
270
|
-
onMouseMove: this.handleMouseMove
|
|
271
|
-
onMouseLeave: this.handleMouseLeave
|
|
272
|
-
onClick: this.handleClick
|
|
284
|
+
onMouseMove: this.handleMouseMove,
|
|
285
|
+
onMouseLeave: this.handleMouseLeave,
|
|
286
|
+
onClick: this.handleClick
|
|
273
287
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
274
288
|
className: "rating-stars",
|
|
275
289
|
"data-content": this.state.glyph,
|
|
@@ -279,9 +293,7 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
|
279
293
|
}));
|
|
280
294
|
} else {
|
|
281
295
|
starRating = /*#__PURE__*/_react["default"].createElement("div", {
|
|
282
|
-
ref:
|
|
283
|
-
return _this2.node = c;
|
|
284
|
-
},
|
|
296
|
+
ref: this.ratingContainerNode,
|
|
285
297
|
className: "rating-container rating-gly-star",
|
|
286
298
|
"data-content": this.state.glyph
|
|
287
299
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -295,31 +307,26 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
|
|
|
295
307
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
296
308
|
className: "react-star-rating"
|
|
297
309
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
298
|
-
ref:
|
|
299
|
-
return _this2.rootNode = c;
|
|
300
|
-
},
|
|
310
|
+
ref: this.rootNode,
|
|
301
311
|
style: {
|
|
302
|
-
cursor: 'pointer'
|
|
312
|
+
cursor: isEditable ? 'pointer' : 'default'
|
|
303
313
|
},
|
|
304
314
|
className: classes
|
|
305
|
-
}, starRating, /*#__PURE__*/_react["default"].createElement("input",
|
|
315
|
+
}, starRating, /*#__PURE__*/_react["default"].createElement("input", {
|
|
306
316
|
type: "hidden",
|
|
307
317
|
name: this.props.name,
|
|
308
|
-
value: this.state.
|
|
318
|
+
value: this.state.rating || 0,
|
|
309
319
|
style: {
|
|
310
|
-
display: 'none !important'
|
|
320
|
+
display: 'none !important',
|
|
321
|
+
width: 65
|
|
311
322
|
},
|
|
312
323
|
min: this.min,
|
|
313
324
|
max: this.max,
|
|
314
325
|
readOnly: true
|
|
315
|
-
}
|
|
316
|
-
width: 65
|
|
317
|
-
}))));
|
|
326
|
+
})));
|
|
318
327
|
}
|
|
319
328
|
}]);
|
|
320
|
-
return StarRating;
|
|
321
329
|
}(_react["default"].Component);
|
|
322
|
-
exports["default"] = StarRating;
|
|
323
330
|
StarRating.propTypes = {
|
|
324
331
|
name: _propTypes["default"].string.isRequired,
|
|
325
332
|
caption: _propTypes["default"].string,
|
|
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _reactTextareaAutosize = _interopRequireDefault(require("react-textarea-autosize"));
|
|
15
15
|
var _draftJs = require("draft-js");
|
|
@@ -19,8 +19,8 @@ var _dynamicOptionList = _interopRequireDefault(require("./dynamic-option-list")
|
|
|
19
19
|
var _requests = require("./stores/requests");
|
|
20
20
|
var _UUID = _interopRequireDefault(require("./UUID"));
|
|
21
21
|
var _IntlMessages = _interopRequireDefault(require("./language-provider/IntlMessages"));
|
|
22
|
-
function
|
|
23
|
-
function _isNativeReflectConstruct() {
|
|
22
|
+
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)); }
|
|
23
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
24
|
var toolbar = {
|
|
25
25
|
options: ['inline', 'list', 'textAlign', 'fontSize', 'link', 'history'],
|
|
26
26
|
inline: {
|
|
@@ -29,13 +29,11 @@ var toolbar = {
|
|
|
29
29
|
options: ['bold', 'italic', 'underline', 'superscript', 'subscript']
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
var FormElementsEdit = /*#__PURE__*/function (_React$Component) {
|
|
33
|
-
(0, _inherits2["default"])(FormElementsEdit, _React$Component);
|
|
34
|
-
var _super = _createSuper(FormElementsEdit);
|
|
32
|
+
var FormElementsEdit = exports["default"] = /*#__PURE__*/function (_React$Component) {
|
|
35
33
|
function FormElementsEdit(props) {
|
|
36
34
|
var _this;
|
|
37
35
|
(0, _classCallCheck2["default"])(this, FormElementsEdit);
|
|
38
|
-
_this =
|
|
36
|
+
_this = _callSuper(this, FormElementsEdit, [props]);
|
|
39
37
|
_this.state = {
|
|
40
38
|
element: _this.props.element,
|
|
41
39
|
data: _this.props.data,
|
|
@@ -43,7 +41,8 @@ var FormElementsEdit = /*#__PURE__*/function (_React$Component) {
|
|
|
43
41
|
};
|
|
44
42
|
return _this;
|
|
45
43
|
}
|
|
46
|
-
(0,
|
|
44
|
+
(0, _inherits2["default"])(FormElementsEdit, _React$Component);
|
|
45
|
+
return (0, _createClass2["default"])(FormElementsEdit, [{
|
|
47
46
|
key: "toggleRequired",
|
|
48
47
|
value: function toggleRequired() {
|
|
49
48
|
// const this_element = this.state.element;
|
|
@@ -732,9 +731,7 @@ var FormElementsEdit = /*#__PURE__*/function (_React$Component) {
|
|
|
732
731
|
}));
|
|
733
732
|
}
|
|
734
733
|
}]);
|
|
735
|
-
return FormElementsEdit;
|
|
736
734
|
}(_react["default"].Component);
|
|
737
|
-
exports["default"] = FormElementsEdit;
|
|
738
735
|
FormElementsEdit.defaultProps = {
|
|
739
736
|
className: 'edit-element-fields'
|
|
740
737
|
};
|
package/lib/form-place-holder.js
CHANGED
|
@@ -7,24 +7,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
var _reactIntl = require("react-intl");
|
|
16
|
-
function
|
|
17
|
-
function _isNativeReflectConstruct() {
|
|
16
|
+
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)); }
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
18
|
var PLACE_HOLDER = 'form-place-holder';
|
|
19
19
|
var PLACE_HOLDER_HIDDEN = 'form-place-holder-hidden';
|
|
20
20
|
var PlaceHolder = /*#__PURE__*/function (_React$Component) {
|
|
21
|
-
(0, _inherits2["default"])(PlaceHolder, _React$Component);
|
|
22
|
-
var _super = _createSuper(PlaceHolder);
|
|
23
21
|
function PlaceHolder() {
|
|
24
22
|
(0, _classCallCheck2["default"])(this, PlaceHolder);
|
|
25
|
-
return
|
|
23
|
+
return _callSuper(this, PlaceHolder, arguments);
|
|
26
24
|
}
|
|
27
|
-
(0,
|
|
25
|
+
(0, _inherits2["default"])(PlaceHolder, _React$Component);
|
|
26
|
+
return (0, _createClass2["default"])(PlaceHolder, [{
|
|
28
27
|
key: "render",
|
|
29
28
|
value: function render() {
|
|
30
29
|
var intl = this.props.intl;
|
|
@@ -38,10 +37,8 @@ var PlaceHolder = /*#__PURE__*/function (_React$Component) {
|
|
|
38
37
|
}, /*#__PURE__*/_react["default"].createElement("div", null, placeHolder));
|
|
39
38
|
}
|
|
40
39
|
}]);
|
|
41
|
-
return PlaceHolder;
|
|
42
40
|
}(_react["default"].Component);
|
|
43
|
-
var _default = (0, _reactIntl.injectIntl)(PlaceHolder);
|
|
44
|
-
exports["default"] = _default;
|
|
41
|
+
var _default = exports["default"] = (0, _reactIntl.injectIntl)(PlaceHolder);
|
|
45
42
|
PlaceHolder.propTypes = {
|
|
46
43
|
text: _propTypes["default"].string,
|
|
47
44
|
show: _propTypes["default"].bool
|
package/lib/form-validator.js
CHANGED
|
@@ -7,14 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _xss = _interopRequireDefault(require("xss"));
|
|
15
15
|
var _IntlMessages = _interopRequireDefault(require("./language-provider/IntlMessages"));
|
|
16
|
-
function
|
|
17
|
-
function _isNativeReflectConstruct() {
|
|
16
|
+
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)); }
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
18
18
|
* <FormValidator />
|
|
19
19
|
*/
|
|
20
20
|
var myxss = new _xss["default"].FilterXSS({
|
|
@@ -35,19 +35,18 @@ var myxss = new _xss["default"].FilterXSS({
|
|
|
35
35
|
span: ['style']
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
var FormValidator = /*#__PURE__*/function (_React$Component) {
|
|
39
|
-
(0, _inherits2["default"])(FormValidator, _React$Component);
|
|
40
|
-
var _super = _createSuper(FormValidator);
|
|
38
|
+
var FormValidator = exports["default"] = /*#__PURE__*/function (_React$Component) {
|
|
41
39
|
function FormValidator(props) {
|
|
42
40
|
var _this;
|
|
43
41
|
(0, _classCallCheck2["default"])(this, FormValidator);
|
|
44
|
-
_this =
|
|
42
|
+
_this = _callSuper(this, FormValidator, [props]);
|
|
45
43
|
_this.state = {
|
|
46
44
|
errors: []
|
|
47
45
|
};
|
|
48
46
|
return _this;
|
|
49
47
|
}
|
|
50
|
-
(0,
|
|
48
|
+
(0, _inherits2["default"])(FormValidator, _React$Component);
|
|
49
|
+
return (0, _createClass2["default"])(FormValidator, [{
|
|
51
50
|
key: "componentDidMount",
|
|
52
51
|
value: function componentDidMount() {
|
|
53
52
|
var _this2 = this;
|
|
@@ -99,6 +98,4 @@ var FormValidator = /*#__PURE__*/function (_React$Component) {
|
|
|
99
98
|
})))));
|
|
100
99
|
}
|
|
101
100
|
}]);
|
|
102
|
-
|
|
103
|
-
}(_react["default"].Component);
|
|
104
|
-
exports["default"] = FormValidator;
|
|
101
|
+
}(_react["default"].Component);
|