react-form-builder-more-flexibility 1.0.55 → 1.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 _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); }; }
19
- 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; } }
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
@@ -32,14 +31,21 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
32
31
  * />
33
32
  */
34
33
  var StarRating = exports["default"] = /*#__PURE__*/function (_React$Component) {
35
- (0, _inherits2["default"])(StarRating, _React$Component);
36
- var _super = _createSuper(StarRating);
37
34
  function StarRating(props) {
38
35
  var _this;
39
36
  (0, _classCallCheck2["default"])(this, StarRating);
40
- _this = _super.call(this, props);
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 = exports["default"] = /*#__PURE__*/function (_React$Component) {
60
66
  * Gets the stars based on ratingAmount
61
67
  * @return {string} stars
62
68
  */
63
- (0, _createClass2["default"])(StarRating, [{
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 = exports["default"] = /*#__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
- this.root = _reactDom["default"].findDOMNode(this.rootNode);
94
- this.ratingContainer = _reactDom["default"].findDOMNode(this.node);
95
- }
96
- }, {
97
- key: "componentWillUnmount",
98
- value: function componentWillUnmount() {
99
- delete this.root;
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
- return e.pageX - this.root.getBoundingClientRect().left;
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 = exports["default"] = /*#__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 = exports["default"] = /*#__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.ratingContainer.offsetWidth;
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 = exports["default"] = /*#__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 = exports["default"] = /*#__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
- "stroke-width": "1",
170
+ strokeWidth: "1",
177
171
  fill: "none",
178
- "fill-rule": "evenodd"
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 = exports["default"] = /*#__PURE__*/function (_React$Component) {
192
186
  }, {
193
187
  key: "handleMouseMove",
194
188
  value: function handleMouseMove(e) {
195
- // get hover position
196
- var ratingEvent = this.getRatingEvent(e);
197
- this.updateRating(ratingEvent.width, ratingEvent.val);
198
- }
199
- }, {
200
- key: "updateRating",
201
- value: function updateRating(width, val) {
202
- this.setState({
203
- pos: width,
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
- if (nextProps !== this.props) {
211
- this.updateRating(this.getStarRatingPosition(nextProps.rating), nextProps.rating);
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 = exports["default"] = /*#__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: this.state.pos,
227
- rating: this.state.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,30 +268,22 @@ var StarRating = exports["default"] = /*#__PURE__*/function (_React$Component) {
245
268
  }, {
246
269
  key: "render",
247
270
  value: function render() {
248
- var _this2 = this;
249
- // let caption = null;
250
271
  var classes = (0, _classnames["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({
251
272
  'react-star-rating__root': true,
252
273
  'rating-disabled': this.props.disabled
253
274
  }, "react-star-rating__size--".concat(this.props.size), this.props.size), 'rating-editing', this.state.editing));
254
275
 
255
- // is there a caption?
256
- // if (this.props.caption) {
257
- // caption = (<span className="react-rating-caption">{this.props.caption}</span>);
258
- // }
259
-
260
276
  // are we editing this rating?
261
277
  var starRating;
262
- if (this.state.editing) {
278
+ var isEditable = !this.props.disabled && (this.state.editing || this.props.editing);
279
+ if (isEditable) {
263
280
  starRating = /*#__PURE__*/_react["default"].createElement("div", {
264
- ref: function ref(c) {
265
- return _this2.node = c;
266
- },
281
+ ref: this.ratingContainerNode,
267
282
  className: "rating-container rating-gly-star",
268
283
  "data-content": this.state.glyph,
269
- onMouseMove: this.handleMouseMove.bind(this),
270
- onMouseLeave: this.handleMouseLeave.bind(this),
271
- onClick: this.handleClick.bind(this)
284
+ onMouseMove: this.handleMouseMove,
285
+ onMouseLeave: this.handleMouseLeave,
286
+ onClick: this.handleClick
272
287
  }, /*#__PURE__*/_react["default"].createElement("div", {
273
288
  className: "rating-stars",
274
289
  "data-content": this.state.glyph,
@@ -278,9 +293,7 @@ var StarRating = exports["default"] = /*#__PURE__*/function (_React$Component) {
278
293
  }));
279
294
  } else {
280
295
  starRating = /*#__PURE__*/_react["default"].createElement("div", {
281
- ref: function ref(c) {
282
- return _this2.node = c;
283
- },
296
+ ref: this.ratingContainerNode,
284
297
  className: "rating-container rating-gly-star",
285
298
  "data-content": this.state.glyph
286
299
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -294,29 +307,25 @@ var StarRating = exports["default"] = /*#__PURE__*/function (_React$Component) {
294
307
  return /*#__PURE__*/_react["default"].createElement("span", {
295
308
  className: "react-star-rating"
296
309
  }, /*#__PURE__*/_react["default"].createElement("span", {
297
- ref: function ref(c) {
298
- return _this2.rootNode = c;
299
- },
310
+ ref: this.rootNode,
300
311
  style: {
301
- cursor: 'pointer'
312
+ cursor: isEditable ? 'pointer' : 'default'
302
313
  },
303
314
  className: classes
304
- }, starRating, /*#__PURE__*/_react["default"].createElement("input", (0, _defineProperty2["default"])({
315
+ }, starRating, /*#__PURE__*/_react["default"].createElement("input", {
305
316
  type: "hidden",
306
317
  name: this.props.name,
307
- value: this.state.ratingCache.rating,
318
+ value: this.state.rating || 0,
308
319
  style: {
309
- display: 'none !important'
320
+ display: 'none !important',
321
+ width: 65
310
322
  },
311
323
  min: this.min,
312
324
  max: this.max,
313
325
  readOnly: true
314
- }, "style", {
315
- width: 65
316
- }))));
326
+ })));
317
327
  }
318
328
  }]);
319
- return StarRating;
320
329
  }(_react["default"].Component);
321
330
  StarRating.propTypes = {
322
331
  name: _propTypes["default"].string.isRequired,
@@ -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 _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); }; }
23
- 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; } }
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: {
@@ -30,12 +30,10 @@ var toolbar = {
30
30
  }
31
31
  };
32
32
  var FormElementsEdit = exports["default"] = /*#__PURE__*/function (_React$Component) {
33
- (0, _inherits2["default"])(FormElementsEdit, _React$Component);
34
- var _super = _createSuper(FormElementsEdit);
35
33
  function FormElementsEdit(props) {
36
34
  var _this;
37
35
  (0, _classCallCheck2["default"])(this, FormElementsEdit);
38
- _this = _super.call(this, props);
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 = exports["default"] = /*#__PURE__*/function (_React$Compon
43
41
  };
44
42
  return _this;
45
43
  }
46
- (0, _createClass2["default"])(FormElementsEdit, [{
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;
@@ -583,6 +582,26 @@ var FormElementsEdit = exports["default"] = /*#__PURE__*/function (_React$Compon
583
582
  defaultValue: this.props.element.description,
584
583
  onBlur: this.updateElement.bind(this),
585
584
  onChange: this.editElementProp.bind(this, 'description', 'value')
585
+ })), this.state.element.element === 'TextInput' && /*#__PURE__*/_react["default"].createElement("div", {
586
+ className: "form-group"
587
+ }, /*#__PURE__*/_react["default"].createElement("label", {
588
+ className: "control-label"
589
+ }, "Validation Message:"), /*#__PURE__*/_react["default"].createElement("input", {
590
+ type: "text",
591
+ className: "form-control",
592
+ defaultValue: this.props.element.validationMessage || '',
593
+ onBlur: this.updateElement.bind(this),
594
+ onChange: this.editElementProp.bind(this, 'validationMessage', 'value')
595
+ })), this.state.element.element === 'TextInput' && /*#__PURE__*/_react["default"].createElement("div", {
596
+ className: "form-group"
597
+ }, /*#__PURE__*/_react["default"].createElement("label", {
598
+ className: "control-label"
599
+ }, "Validation Pattern (Regex):"), /*#__PURE__*/_react["default"].createElement("input", {
600
+ type: "text",
601
+ className: "form-control",
602
+ defaultValue: this.props.element.validationPattern || '',
603
+ onBlur: this.updateElement.bind(this),
604
+ onChange: this.editElementProp.bind(this, 'validationPattern', 'value')
586
605
  })), this.props.showCorrectColumn && this.props.element.canHaveAnswer && !this.props.element.hasOwnProperty('options') && /*#__PURE__*/_react["default"].createElement("div", {
587
606
  className: "form-group"
588
607
  }, /*#__PURE__*/_react["default"].createElement("label", {
@@ -635,7 +654,6 @@ var FormElementsEdit = exports["default"] = /*#__PURE__*/function (_React$Compon
635
654
  }));
636
655
  }
637
656
  }]);
638
- return FormElementsEdit;
639
657
  }(_react["default"].Component);
640
658
  FormElementsEdit.defaultProps = {
641
659
  className: 'edit-element-fields'
@@ -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 _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; } }
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 _super.apply(this, arguments);
23
+ return _callSuper(this, PlaceHolder, arguments);
26
24
  }
27
- (0, _createClass2["default"])(PlaceHolder, [{
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,7 +37,6 @@ 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
41
  var _default = exports["default"] = (0, _reactIntl.injectIntl)(PlaceHolder);
44
42
  PlaceHolder.propTypes = {
@@ -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 _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; } } /**
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({
@@ -36,18 +36,17 @@ var myxss = new _xss["default"].FilterXSS({
36
36
  }
37
37
  });
38
38
  var FormValidator = exports["default"] = /*#__PURE__*/function (_React$Component) {
39
- (0, _inherits2["default"])(FormValidator, _React$Component);
40
- var _super = _createSuper(FormValidator);
41
39
  function FormValidator(props) {
42
40
  var _this;
43
41
  (0, _classCallCheck2["default"])(this, FormValidator);
44
- _this = _super.call(this, props);
42
+ _this = _callSuper(this, FormValidator, [props]);
45
43
  _this.state = {
46
44
  errors: []
47
45
  };
48
46
  return _this;
49
47
  }
50
- (0, _createClass2["default"])(FormValidator, [{
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,5 +98,4 @@ var FormValidator = exports["default"] = /*#__PURE__*/function (_React$Component
99
98
  })))));
100
99
  }
101
100
  }]);
102
- return FormValidator;
103
101
  }(_react["default"].Component);