react-survey-builder 1.0.106 → 1.0.108
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/bundle.js +14 -4
- package/dist/src_survey-elements-edit_jsx.bundle.js +2 -2
- package/lib/dynamic-option-list.js +60 -5
- package/lib/index.js +30 -0
- package/lib/survey-elements/index.js +479 -297
- package/lib/survey-elements-edit.js +139 -1
- package/lib/toolbar.js +72 -4
- package/lib/utils/objectUtils.js +8 -2
- package/package.json +1 -1
- package/types/index.d.ts +39 -26
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
var _excluded = ["iconImportString"],
|
2
3
|
_excluded2 = ["name", "onChange", "defaultValue", "style", "item"],
|
3
4
|
_excluded3 = ["name", "onChange", "defaultValue", "style", "item"],
|
4
5
|
_excluded4 = ["name", "onChange", "defaultValue", "style", "item"],
|
@@ -6,8 +7,8 @@ var _excluded = ["name", "onChange", "defaultValue", "style", "item"],
|
|
6
7
|
_excluded6 = ["name", "onChange", "defaultValue", "style", "item"],
|
7
8
|
_excluded7 = ["name", "onChange", "defaultValue", "style", "item"],
|
8
9
|
_excluded8 = ["name", "onChange", "defaultValue", "style", "item"],
|
9
|
-
_excluded9 = ["name", "onChange", "
|
10
|
-
|
10
|
+
_excluded9 = ["name", "onChange", "defaultValue", "style", "item"],
|
11
|
+
_excluded10 = ["name", "onChange", "value", "style", "item"];
|
11
12
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
12
13
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
13
14
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
@@ -22,13 +23,19 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
22
23
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
23
24
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
24
25
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
25
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
26
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
27
26
|
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; }
|
28
27
|
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) { _defineProperty(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; }
|
29
28
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
30
29
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
31
30
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
31
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
33
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
34
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
35
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
37
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
38
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
32
39
|
// eslint-disable-next-line max-classes-per-file
|
33
40
|
import fetch from 'isomorphic-fetch';
|
34
41
|
import { saveAs } from 'file-saver';
|
@@ -51,8 +58,29 @@ import { Controller, useFormContext } from 'react-hook-form';
|
|
51
58
|
import { IMask, IMaskInput } from 'react-imask';
|
52
59
|
import { isValidPhoneNumber } from 'libphonenumber-js';
|
53
60
|
import ID from '../UUID';
|
54
|
-
import { isBooleanTrue, replaceInText } from '../utils/objectUtils';
|
61
|
+
import { isBooleanFalse, isBooleanTrue, isNotNullOrUndefined, replaceInText } from '../utils/objectUtils';
|
55
62
|
var SurveyElements = {};
|
63
|
+
var IconComponent = function IconComponent(_ref) {
|
64
|
+
var iconImportString = _ref.iconImportString,
|
65
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
66
|
+
var _React$useState = React.useState(null),
|
67
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
68
|
+
Icon = _React$useState2[0],
|
69
|
+
setIcon = _React$useState2[1];
|
70
|
+
React.useEffect(function () {
|
71
|
+
// iconImportString - i.e. 'react-icons/fa/FaBeer'
|
72
|
+
if (isNotNullOrUndefined(iconImportString) && iconImportString !== '') {
|
73
|
+
var iconStringParts = iconImportString.split('/');
|
74
|
+
var iconName = iconStringParts[2];
|
75
|
+
if (isNotNullOrUndefined(iconName)) {
|
76
|
+
import(iconImportString).then(function (module) {
|
77
|
+
return setIcon(module[iconName]);
|
78
|
+
});
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}, [iconImportString]);
|
82
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, Icon && /*#__PURE__*/React.createElement(Icon, props));
|
83
|
+
};
|
56
84
|
export var Header = function Header(props) {
|
57
85
|
var _props$item;
|
58
86
|
var classNames = 'static';
|
@@ -158,14 +186,14 @@ export var LineBreak = function LineBreak(props) {
|
|
158
186
|
className: baseClasses
|
159
187
|
}, /*#__PURE__*/React.createElement(ComponentHeader, props), /*#__PURE__*/React.createElement("hr", null));
|
160
188
|
};
|
161
|
-
export var TextInput = function TextInput(
|
189
|
+
export var TextInput = function TextInput(_ref2) {
|
162
190
|
var _item$required, _item$disabled, _item$required2, _item$helpClassName2;
|
163
|
-
var name =
|
164
|
-
onChange =
|
165
|
-
defaultValue =
|
166
|
-
style =
|
167
|
-
item =
|
168
|
-
props = _objectWithoutProperties(
|
191
|
+
var name = _ref2.name,
|
192
|
+
onChange = _ref2.onChange,
|
193
|
+
defaultValue = _ref2.defaultValue,
|
194
|
+
style = _ref2.style,
|
195
|
+
item = _ref2.item,
|
196
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
169
197
|
var methods = useFormContext();
|
170
198
|
var onChangeHandler = function onChangeHandler(value) {
|
171
199
|
if (onChange !== undefined) {
|
@@ -194,19 +222,19 @@ export var TextInput = function TextInput(_ref) {
|
|
194
222
|
name: name,
|
195
223
|
rules: fieldRules
|
196
224
|
};
|
197
|
-
controllerProps.render = function (
|
198
|
-
var
|
199
|
-
_onChange =
|
200
|
-
onBlur =
|
201
|
-
value =
|
202
|
-
name =
|
203
|
-
ref =
|
204
|
-
|
205
|
-
invalid =
|
206
|
-
isTouched =
|
207
|
-
isDirty =
|
208
|
-
error =
|
209
|
-
formState =
|
225
|
+
controllerProps.render = function (_ref3) {
|
226
|
+
var _ref3$field = _ref3.field,
|
227
|
+
_onChange = _ref3$field.onChange,
|
228
|
+
onBlur = _ref3$field.onBlur,
|
229
|
+
value = _ref3$field.value,
|
230
|
+
name = _ref3$field.name,
|
231
|
+
ref = _ref3$field.ref,
|
232
|
+
_ref3$fieldState = _ref3.fieldState,
|
233
|
+
invalid = _ref3$fieldState.invalid,
|
234
|
+
isTouched = _ref3$fieldState.isTouched,
|
235
|
+
isDirty = _ref3$fieldState.isDirty,
|
236
|
+
error = _ref3$fieldState.error,
|
237
|
+
formState = _ref3.formState;
|
210
238
|
return /*#__PURE__*/React.createElement(Form.Control, _extends({
|
211
239
|
onBlur: onBlur,
|
212
240
|
onChange: function onChange(e) {
|
@@ -307,14 +335,14 @@ export var TextInput = function TextInput(_ref) {
|
|
307
335
|
name: name
|
308
336
|
})));
|
309
337
|
};
|
310
|
-
export var EmailInput = function EmailInput(
|
338
|
+
export var EmailInput = function EmailInput(_ref4) {
|
311
339
|
var _item$required4, _item$disabled3, _item$required5, _item$helpClassName4;
|
312
|
-
var name =
|
313
|
-
onChange =
|
314
|
-
defaultValue =
|
315
|
-
style =
|
316
|
-
item =
|
317
|
-
props = _objectWithoutProperties(
|
340
|
+
var name = _ref4.name,
|
341
|
+
onChange = _ref4.onChange,
|
342
|
+
defaultValue = _ref4.defaultValue,
|
343
|
+
style = _ref4.style,
|
344
|
+
item = _ref4.item,
|
345
|
+
props = _objectWithoutProperties(_ref4, _excluded3);
|
318
346
|
var methods = useFormContext();
|
319
347
|
var onChangeHandler = function onChangeHandler(value) {
|
320
348
|
if (onChange !== undefined) {
|
@@ -356,19 +384,19 @@ export var EmailInput = function EmailInput(_ref3) {
|
|
356
384
|
name: name,
|
357
385
|
rules: fieldRules
|
358
386
|
};
|
359
|
-
controllerProps.render = function (
|
360
|
-
var
|
361
|
-
_onChange2 =
|
362
|
-
onBlur =
|
363
|
-
value =
|
364
|
-
name =
|
365
|
-
ref =
|
366
|
-
|
367
|
-
invalid =
|
368
|
-
isTouched =
|
369
|
-
isDirty =
|
370
|
-
error =
|
371
|
-
formState =
|
387
|
+
controllerProps.render = function (_ref5) {
|
388
|
+
var _ref5$field = _ref5.field,
|
389
|
+
_onChange2 = _ref5$field.onChange,
|
390
|
+
onBlur = _ref5$field.onBlur,
|
391
|
+
value = _ref5$field.value,
|
392
|
+
name = _ref5$field.name,
|
393
|
+
ref = _ref5$field.ref,
|
394
|
+
_ref5$fieldState = _ref5.fieldState,
|
395
|
+
invalid = _ref5$fieldState.invalid,
|
396
|
+
isTouched = _ref5$fieldState.isTouched,
|
397
|
+
isDirty = _ref5$fieldState.isDirty,
|
398
|
+
error = _ref5$fieldState.error,
|
399
|
+
formState = _ref5.formState;
|
372
400
|
return /*#__PURE__*/React.createElement(Form.Control, _extends({
|
373
401
|
onBlur: onBlur,
|
374
402
|
onChange: function onChange(e) {
|
@@ -469,15 +497,15 @@ export var EmailInput = function EmailInput(_ref3) {
|
|
469
497
|
name: name
|
470
498
|
})));
|
471
499
|
};
|
472
|
-
export var PhoneNumber = function PhoneNumber(
|
500
|
+
export var PhoneNumber = function PhoneNumber(_ref6) {
|
473
501
|
var _item$required7, _item$disabled5, _item$required8, _item$helpClassName6;
|
474
|
-
var name =
|
475
|
-
onChange =
|
476
|
-
|
477
|
-
defaultValue =
|
478
|
-
style =
|
479
|
-
item =
|
480
|
-
props = _objectWithoutProperties(
|
502
|
+
var name = _ref6.name,
|
503
|
+
onChange = _ref6.onChange,
|
504
|
+
_ref6$defaultValue = _ref6.defaultValue,
|
505
|
+
defaultValue = _ref6$defaultValue === void 0 ? '' : _ref6$defaultValue,
|
506
|
+
style = _ref6.style,
|
507
|
+
item = _ref6.item,
|
508
|
+
props = _objectWithoutProperties(_ref6, _excluded4);
|
481
509
|
var methods = useFormContext();
|
482
510
|
var onChangeHandler = function onChangeHandler(value) {
|
483
511
|
if (onChange !== undefined) {
|
@@ -535,19 +563,19 @@ export var PhoneNumber = function PhoneNumber(_ref5) {
|
|
535
563
|
rules: fieldRules
|
536
564
|
};
|
537
565
|
if (IMaskInput !== undefined) {
|
538
|
-
controllerProps.render = function (
|
539
|
-
var
|
540
|
-
onChange =
|
541
|
-
onBlur =
|
542
|
-
value =
|
543
|
-
name =
|
544
|
-
ref =
|
545
|
-
|
546
|
-
invalid =
|
547
|
-
isTouched =
|
548
|
-
isDirty =
|
549
|
-
error =
|
550
|
-
formState =
|
566
|
+
controllerProps.render = function (_ref7) {
|
567
|
+
var _ref7$field = _ref7.field,
|
568
|
+
onChange = _ref7$field.onChange,
|
569
|
+
onBlur = _ref7$field.onBlur,
|
570
|
+
value = _ref7$field.value,
|
571
|
+
name = _ref7$field.name,
|
572
|
+
ref = _ref7$field.ref,
|
573
|
+
_ref7$fieldState = _ref7.fieldState,
|
574
|
+
invalid = _ref7$fieldState.invalid,
|
575
|
+
isTouched = _ref7$fieldState.isTouched,
|
576
|
+
isDirty = _ref7$fieldState.isDirty,
|
577
|
+
error = _ref7$fieldState.error,
|
578
|
+
formState = _ref7.formState;
|
551
579
|
return /*#__PURE__*/React.createElement(IMaskInput, _extends({
|
552
580
|
id: name + '-' + ID.uuid(),
|
553
581
|
className: "form-control",
|
@@ -581,19 +609,19 @@ export var PhoneNumber = function PhoneNumber(_ref5) {
|
|
581
609
|
}, inputProps));
|
582
610
|
};
|
583
611
|
} else {
|
584
|
-
controllerProps.render = function (
|
585
|
-
var
|
586
|
-
_onChange3 =
|
587
|
-
onBlur =
|
588
|
-
value =
|
589
|
-
name =
|
590
|
-
ref =
|
591
|
-
|
592
|
-
invalid =
|
593
|
-
isTouched =
|
594
|
-
isDirty =
|
595
|
-
error =
|
596
|
-
formState =
|
612
|
+
controllerProps.render = function (_ref8) {
|
613
|
+
var _ref8$field = _ref8.field,
|
614
|
+
_onChange3 = _ref8$field.onChange,
|
615
|
+
onBlur = _ref8$field.onBlur,
|
616
|
+
value = _ref8$field.value,
|
617
|
+
name = _ref8$field.name,
|
618
|
+
ref = _ref8$field.ref,
|
619
|
+
_ref8$fieldState = _ref8.fieldState,
|
620
|
+
invalid = _ref8$fieldState.invalid,
|
621
|
+
isTouched = _ref8$fieldState.isTouched,
|
622
|
+
isDirty = _ref8$fieldState.isDirty,
|
623
|
+
error = _ref8$fieldState.error,
|
624
|
+
formState = _ref8.formState;
|
597
625
|
return /*#__PURE__*/React.createElement(Form.Control, _extends({
|
598
626
|
onBlur: onBlur,
|
599
627
|
onChange: function onChange(e) {
|
@@ -693,14 +721,14 @@ export var PhoneNumber = function PhoneNumber(_ref5) {
|
|
693
721
|
name: name
|
694
722
|
})));
|
695
723
|
};
|
696
|
-
export var DatePicker = function DatePicker(
|
724
|
+
export var DatePicker = function DatePicker(_ref9) {
|
697
725
|
var _item$required10, _item$disabled7, _item$required11, _item$helpClassName8;
|
698
|
-
var name =
|
699
|
-
onChange =
|
700
|
-
defaultValue =
|
701
|
-
style =
|
702
|
-
item =
|
703
|
-
props = _objectWithoutProperties(
|
726
|
+
var name = _ref9.name,
|
727
|
+
onChange = _ref9.onChange,
|
728
|
+
defaultValue = _ref9.defaultValue,
|
729
|
+
style = _ref9.style,
|
730
|
+
item = _ref9.item,
|
731
|
+
props = _objectWithoutProperties(_ref9, _excluded5);
|
704
732
|
var methods = useFormContext();
|
705
733
|
var onChangeHandler = function onChangeHandler(value) {
|
706
734
|
if (onChange !== undefined) {
|
@@ -782,19 +810,19 @@ export var DatePicker = function DatePicker(_ref8) {
|
|
782
810
|
rules: fieldRules
|
783
811
|
};
|
784
812
|
if (IMaskInput !== undefined && IMask !== undefined) {
|
785
|
-
controllerProps.render = function (
|
786
|
-
var
|
787
|
-
onChange =
|
788
|
-
onBlur =
|
789
|
-
value =
|
790
|
-
name =
|
791
|
-
ref =
|
792
|
-
|
793
|
-
invalid =
|
794
|
-
isTouched =
|
795
|
-
isDirty =
|
796
|
-
error =
|
797
|
-
formState =
|
813
|
+
controllerProps.render = function (_ref10) {
|
814
|
+
var _ref10$field = _ref10.field,
|
815
|
+
onChange = _ref10$field.onChange,
|
816
|
+
onBlur = _ref10$field.onBlur,
|
817
|
+
value = _ref10$field.value,
|
818
|
+
name = _ref10$field.name,
|
819
|
+
ref = _ref10$field.ref,
|
820
|
+
_ref10$fieldState = _ref10.fieldState,
|
821
|
+
invalid = _ref10$fieldState.invalid,
|
822
|
+
isTouched = _ref10$fieldState.isTouched,
|
823
|
+
isDirty = _ref10$fieldState.isDirty,
|
824
|
+
error = _ref10$fieldState.error,
|
825
|
+
formState = _ref10.formState;
|
798
826
|
return /*#__PURE__*/React.createElement(IMaskInput, _extends({
|
799
827
|
id: name + '-' + ID.uuid(),
|
800
828
|
className: "form-control",
|
@@ -864,19 +892,19 @@ export var DatePicker = function DatePicker(_ref8) {
|
|
864
892
|
}, inputProps));
|
865
893
|
};
|
866
894
|
} else {
|
867
|
-
controllerProps.render = function (
|
868
|
-
var
|
869
|
-
_onChange4 =
|
870
|
-
onBlur =
|
871
|
-
value =
|
872
|
-
name =
|
873
|
-
ref =
|
874
|
-
|
875
|
-
invalid =
|
876
|
-
isTouched =
|
877
|
-
isDirty =
|
878
|
-
error =
|
879
|
-
formState =
|
895
|
+
controllerProps.render = function (_ref11) {
|
896
|
+
var _ref11$field = _ref11.field,
|
897
|
+
_onChange4 = _ref11$field.onChange,
|
898
|
+
onBlur = _ref11$field.onBlur,
|
899
|
+
value = _ref11$field.value,
|
900
|
+
name = _ref11$field.name,
|
901
|
+
ref = _ref11$field.ref,
|
902
|
+
_ref11$fieldState = _ref11.fieldState,
|
903
|
+
invalid = _ref11$fieldState.invalid,
|
904
|
+
isTouched = _ref11$fieldState.isTouched,
|
905
|
+
isDirty = _ref11$fieldState.isDirty,
|
906
|
+
error = _ref11$fieldState.error,
|
907
|
+
formState = _ref11.formState;
|
880
908
|
return /*#__PURE__*/React.createElement(Form.Control, _extends({
|
881
909
|
onBlur: onBlur,
|
882
910
|
onChange: function onChange(e) {
|
@@ -981,14 +1009,14 @@ export var DatePicker = function DatePicker(_ref8) {
|
|
981
1009
|
name: name
|
982
1010
|
})));
|
983
1011
|
};
|
984
|
-
export var NumberInput = function NumberInput(
|
1012
|
+
export var NumberInput = function NumberInput(_ref12) {
|
985
1013
|
var _item$required13, _item$disabled9, _item$required14, _item$helpClassName10;
|
986
|
-
var name =
|
987
|
-
onChange =
|
988
|
-
defaultValue =
|
989
|
-
style =
|
990
|
-
item =
|
991
|
-
props = _objectWithoutProperties(
|
1014
|
+
var name = _ref12.name,
|
1015
|
+
onChange = _ref12.onChange,
|
1016
|
+
defaultValue = _ref12.defaultValue,
|
1017
|
+
style = _ref12.style,
|
1018
|
+
item = _ref12.item,
|
1019
|
+
props = _objectWithoutProperties(_ref12, _excluded6);
|
992
1020
|
var methods = useFormContext();
|
993
1021
|
var onChangeHandler = function onChangeHandler(value) {
|
994
1022
|
if (onChange !== undefined) {
|
@@ -1017,19 +1045,19 @@ export var NumberInput = function NumberInput(_ref11) {
|
|
1017
1045
|
name: name,
|
1018
1046
|
rules: fieldRules
|
1019
1047
|
};
|
1020
|
-
controllerProps.render = function (
|
1021
|
-
var
|
1022
|
-
_onChange5 =
|
1023
|
-
onBlur =
|
1024
|
-
value =
|
1025
|
-
name =
|
1026
|
-
ref =
|
1027
|
-
|
1028
|
-
invalid =
|
1029
|
-
isTouched =
|
1030
|
-
isDirty =
|
1031
|
-
error =
|
1032
|
-
formState =
|
1048
|
+
controllerProps.render = function (_ref13) {
|
1049
|
+
var _ref13$field = _ref13.field,
|
1050
|
+
_onChange5 = _ref13$field.onChange,
|
1051
|
+
onBlur = _ref13$field.onBlur,
|
1052
|
+
value = _ref13$field.value,
|
1053
|
+
name = _ref13$field.name,
|
1054
|
+
ref = _ref13$field.ref,
|
1055
|
+
_ref13$fieldState = _ref13.fieldState,
|
1056
|
+
invalid = _ref13$fieldState.invalid,
|
1057
|
+
isTouched = _ref13$fieldState.isTouched,
|
1058
|
+
isDirty = _ref13$fieldState.isDirty,
|
1059
|
+
error = _ref13$fieldState.error,
|
1060
|
+
formState = _ref13.formState;
|
1033
1061
|
return /*#__PURE__*/React.createElement(Form.Control, _extends({
|
1034
1062
|
onBlur: onBlur,
|
1035
1063
|
onChange: function onChange(e) {
|
@@ -1130,14 +1158,14 @@ export var NumberInput = function NumberInput(_ref11) {
|
|
1130
1158
|
name: name
|
1131
1159
|
})));
|
1132
1160
|
};
|
1133
|
-
export var TextArea = function TextArea(
|
1161
|
+
export var TextArea = function TextArea(_ref14) {
|
1134
1162
|
var _item$rows, _item$required16, _item$disabled11, _item$required17, _item$helpClassName12;
|
1135
|
-
var name =
|
1136
|
-
onChange =
|
1137
|
-
defaultValue =
|
1138
|
-
style =
|
1139
|
-
item =
|
1140
|
-
props = _objectWithoutProperties(
|
1163
|
+
var name = _ref14.name,
|
1164
|
+
onChange = _ref14.onChange,
|
1165
|
+
defaultValue = _ref14.defaultValue,
|
1166
|
+
style = _ref14.style,
|
1167
|
+
item = _ref14.item,
|
1168
|
+
props = _objectWithoutProperties(_ref14, _excluded7);
|
1141
1169
|
var methods = useFormContext();
|
1142
1170
|
var onChangeHandler = function onChangeHandler(value) {
|
1143
1171
|
if (onChange !== undefined) {
|
@@ -1166,19 +1194,19 @@ export var TextArea = function TextArea(_ref13) {
|
|
1166
1194
|
name: name,
|
1167
1195
|
rules: fieldRules
|
1168
1196
|
};
|
1169
|
-
controllerProps.render = function (
|
1170
|
-
var
|
1171
|
-
_onChange6 =
|
1172
|
-
onBlur =
|
1173
|
-
value =
|
1174
|
-
name =
|
1175
|
-
ref =
|
1176
|
-
|
1177
|
-
invalid =
|
1178
|
-
isTouched =
|
1179
|
-
isDirty =
|
1180
|
-
error =
|
1181
|
-
formState =
|
1197
|
+
controllerProps.render = function (_ref15) {
|
1198
|
+
var _ref15$field = _ref15.field,
|
1199
|
+
_onChange6 = _ref15$field.onChange,
|
1200
|
+
onBlur = _ref15$field.onBlur,
|
1201
|
+
value = _ref15$field.value,
|
1202
|
+
name = _ref15$field.name,
|
1203
|
+
ref = _ref15$field.ref,
|
1204
|
+
_ref15$fieldState = _ref15.fieldState,
|
1205
|
+
invalid = _ref15$fieldState.invalid,
|
1206
|
+
isTouched = _ref15$fieldState.isTouched,
|
1207
|
+
isDirty = _ref15$fieldState.isDirty,
|
1208
|
+
error = _ref15$fieldState.error,
|
1209
|
+
formState = _ref15.formState;
|
1182
1210
|
return /*#__PURE__*/React.createElement(Form.Control, _extends({
|
1183
1211
|
onBlur: onBlur,
|
1184
1212
|
onChange: function onChange(e) {
|
@@ -1282,14 +1310,14 @@ export var TextArea = function TextArea(_ref13) {
|
|
1282
1310
|
name: name
|
1283
1311
|
})));
|
1284
1312
|
};
|
1285
|
-
export var Dropdown = function Dropdown(
|
1313
|
+
export var Dropdown = function Dropdown(_ref16) {
|
1286
1314
|
var _item$required19, _item$disabled13, _item$required20, _item$helpClassName14;
|
1287
|
-
var name =
|
1288
|
-
onChange =
|
1289
|
-
defaultValue =
|
1290
|
-
style =
|
1291
|
-
item =
|
1292
|
-
props = _objectWithoutProperties(
|
1315
|
+
var name = _ref16.name,
|
1316
|
+
onChange = _ref16.onChange,
|
1317
|
+
defaultValue = _ref16.defaultValue,
|
1318
|
+
style = _ref16.style,
|
1319
|
+
item = _ref16.item,
|
1320
|
+
props = _objectWithoutProperties(_ref16, _excluded8);
|
1293
1321
|
var methods = useFormContext();
|
1294
1322
|
var onChangeHandler = function onChangeHandler(value) {
|
1295
1323
|
if (onChange !== undefined) {
|
@@ -1318,19 +1346,19 @@ export var Dropdown = function Dropdown(_ref15) {
|
|
1318
1346
|
name: name,
|
1319
1347
|
rules: fieldRules
|
1320
1348
|
};
|
1321
|
-
controllerProps.render = function (
|
1322
|
-
var
|
1323
|
-
_onChange7 =
|
1324
|
-
onBlur =
|
1325
|
-
value =
|
1326
|
-
name =
|
1327
|
-
ref =
|
1328
|
-
|
1329
|
-
invalid =
|
1330
|
-
isTouched =
|
1331
|
-
isDirty =
|
1332
|
-
error =
|
1333
|
-
formState =
|
1349
|
+
controllerProps.render = function (_ref17) {
|
1350
|
+
var _ref17$field = _ref17.field,
|
1351
|
+
_onChange7 = _ref17$field.onChange,
|
1352
|
+
onBlur = _ref17$field.onBlur,
|
1353
|
+
value = _ref17$field.value,
|
1354
|
+
name = _ref17$field.name,
|
1355
|
+
ref = _ref17$field.ref,
|
1356
|
+
_ref17$fieldState = _ref17.fieldState,
|
1357
|
+
invalid = _ref17$fieldState.invalid,
|
1358
|
+
isTouched = _ref17$fieldState.isTouched,
|
1359
|
+
isDirty = _ref17$fieldState.isDirty,
|
1360
|
+
error = _ref17$fieldState.error,
|
1361
|
+
formState = _ref17.formState;
|
1334
1362
|
return /*#__PURE__*/React.createElement(Form.Select, _extends({
|
1335
1363
|
onBlur: onBlur,
|
1336
1364
|
onChange: function onChange(e) {
|
@@ -1647,14 +1675,14 @@ export var Signature = /*#__PURE__*/function (_React$Component) {
|
|
1647
1675
|
}
|
1648
1676
|
}]);
|
1649
1677
|
}(React.Component);
|
1650
|
-
export var Tags = function Tags(
|
1678
|
+
export var Tags = function Tags(_ref19) {
|
1651
1679
|
var _item$required22, _item$disabled15, _item$required23, _item$helpClassName16;
|
1652
|
-
var name =
|
1653
|
-
onChange =
|
1654
|
-
defaultValue =
|
1655
|
-
style =
|
1656
|
-
item =
|
1657
|
-
props = _objectWithoutProperties(
|
1680
|
+
var name = _ref19.name,
|
1681
|
+
onChange = _ref19.onChange,
|
1682
|
+
defaultValue = _ref19.defaultValue,
|
1683
|
+
style = _ref19.style,
|
1684
|
+
item = _ref19.item,
|
1685
|
+
props = _objectWithoutProperties(_ref19, _excluded9);
|
1658
1686
|
var methods = useFormContext();
|
1659
1687
|
var onChangeHandler = function onChangeHandler(value) {
|
1660
1688
|
if (onChange !== undefined) {
|
@@ -1700,19 +1728,19 @@ export var Tags = function Tags(_ref18) {
|
|
1700
1728
|
name: name,
|
1701
1729
|
rules: fieldRules
|
1702
1730
|
};
|
1703
|
-
controllerProps.render = function (
|
1704
|
-
var
|
1705
|
-
_onChange8 =
|
1706
|
-
onBlur =
|
1707
|
-
value =
|
1708
|
-
name =
|
1709
|
-
ref =
|
1710
|
-
|
1711
|
-
invalid =
|
1712
|
-
isTouched =
|
1713
|
-
isDirty =
|
1714
|
-
error =
|
1715
|
-
formState =
|
1731
|
+
controllerProps.render = function (_ref20) {
|
1732
|
+
var _ref20$field = _ref20.field,
|
1733
|
+
_onChange8 = _ref20$field.onChange,
|
1734
|
+
onBlur = _ref20$field.onBlur,
|
1735
|
+
value = _ref20$field.value,
|
1736
|
+
name = _ref20$field.name,
|
1737
|
+
ref = _ref20$field.ref,
|
1738
|
+
_ref20$fieldState = _ref20.fieldState,
|
1739
|
+
invalid = _ref20$fieldState.invalid,
|
1740
|
+
isTouched = _ref20$fieldState.isTouched,
|
1741
|
+
isDirty = _ref20$fieldState.isDirty,
|
1742
|
+
error = _ref20$fieldState.error,
|
1743
|
+
formState = _ref20.formState;
|
1716
1744
|
return /*#__PURE__*/React.createElement(Typeahead, _extends({
|
1717
1745
|
labelKey: function labelKey(option) {
|
1718
1746
|
return option.label;
|
@@ -1862,7 +1890,7 @@ export var Checkboxes = /*#__PURE__*/function (_React$Component2) {
|
|
1862
1890
|
return _createClass(Checkboxes, [{
|
1863
1891
|
key: "render",
|
1864
1892
|
value: function render() {
|
1865
|
-
var
|
1893
|
+
var _ref21,
|
1866
1894
|
_self$props$name,
|
1867
1895
|
_self$props,
|
1868
1896
|
_self$props2,
|
@@ -1871,7 +1899,7 @@ export var Checkboxes = /*#__PURE__*/function (_React$Component2) {
|
|
1871
1899
|
_this$props$item$help2,
|
1872
1900
|
_this$props$item2;
|
1873
1901
|
var self = this;
|
1874
|
-
var name = (
|
1902
|
+
var name = (_ref21 = (_self$props$name = self === null || self === void 0 || (_self$props = self.props) === null || _self$props === void 0 ? void 0 : _self$props.name) !== null && _self$props$name !== void 0 ? _self$props$name : self === null || self === void 0 || (_self$props2 = self.props) === null || _self$props2 === void 0 || (_self$props2 = _self$props2.item) === null || _self$props2 === void 0 ? void 0 : _self$props2.customName) !== null && _ref21 !== void 0 ? _ref21 : self === null || self === void 0 || (_self$props3 = self.props) === null || _self$props3 === void 0 || (_self$props3 = _self$props3.item) === null || _self$props3 === void 0 ? void 0 : _self$props3.fieldName;
|
1875
1903
|
var baseClasses = 'SortableItem rfb-item';
|
1876
1904
|
if (this.props.item.pageBreakBefore) {
|
1877
1905
|
baseClasses += ' alwaysbreak';
|
@@ -1899,8 +1927,10 @@ export var Checkboxes = /*#__PURE__*/function (_React$Component2) {
|
|
1899
1927
|
htmlFor: name
|
1900
1928
|
})), this.props.item.help ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Text, {
|
1901
1929
|
className: (_this$props$item$help2 = (_this$props$item2 = this.props.item) === null || _this$props$item2 === void 0 ? void 0 : _this$props$item2.helpClassName) !== null && _this$props$item$help2 !== void 0 ? _this$props$item$help2 : 'text-muted'
|
1902
|
-
}, this.props.item.help)) : null,
|
1903
|
-
|
1930
|
+
}, this.props.item.help)) : null, /*#__PURE__*/React.createElement(Row, {
|
1931
|
+
className: "g-3"
|
1932
|
+
}, this.props.item.options.map(function (option, index) {
|
1933
|
+
var _ref22, _self$props$item$bgCo, _self$props4, _self$props5, _self$props6, _self$props7, _self$props8, _self$props9, _self$props10, _self$props11, _self$props12, _self$props13;
|
1904
1934
|
var props = {};
|
1905
1935
|
props.name = "option_".concat(option.key);
|
1906
1936
|
props.value = option.value;
|
@@ -1909,10 +1939,14 @@ export var Checkboxes = /*#__PURE__*/function (_React$Component2) {
|
|
1909
1939
|
if (self.props.item.disabled) {
|
1910
1940
|
props.disabled = 'disabled';
|
1911
1941
|
}
|
1912
|
-
return /*#__PURE__*/React.createElement(
|
1942
|
+
return /*#__PURE__*/React.createElement(Col, {
|
1943
|
+
key: "container_".concat(name, "_").concat(option.value),
|
1944
|
+
xs: 12
|
1945
|
+
}, /*#__PURE__*/React.createElement(ToggleButton, _extends({
|
1913
1946
|
type: "checkbox",
|
1914
|
-
|
1915
|
-
|
1947
|
+
label: option.text,
|
1948
|
+
variant: (_ref22 = (_self$props$item$bgCo = (_self$props4 = self.props) === null || _self$props4 === void 0 || (_self$props4 = _self$props4.item) === null || _self$props4 === void 0 ? void 0 : _self$props4.bgColor) !== null && _self$props$item$bgCo !== void 0 ? _self$props$item$bgCo : (_self$props5 = self.props) === null || _self$props5 === void 0 ? void 0 : _self$props5.checkboxButtonClassName) !== null && _ref22 !== void 0 ? _ref22 : "outline-light",
|
1949
|
+
className: "btn-survey-builder-checkbox ".concat((_self$props6 = self.props) === null || _self$props6 === void 0 || (_self$props6 = _self$props6.item) === null || _self$props6 === void 0 ? void 0 : _self$props6.className, " ").concat(isBooleanTrue(checked) ? (_self$props7 = self.props) === null || _self$props7 === void 0 || (_self$props7 = _self$props7.item) === null || _self$props7 === void 0 ? void 0 : _self$props7.selectedClassName : (_self$props8 = self.props) === null || _self$props8 === void 0 || (_self$props8 = _self$props8.item) === null || _self$props8 === void 0 ? void 0 : _self$props8.unselectedClassName),
|
1916
1950
|
key: "preview_".concat(option.key),
|
1917
1951
|
id: name + '-' + ID.uuid(),
|
1918
1952
|
inputRef: function inputRef(c) {
|
@@ -1924,17 +1958,28 @@ export var Checkboxes = /*#__PURE__*/function (_React$Component2) {
|
|
1924
1958
|
self.onCheckboxChange(option.value, e);
|
1925
1959
|
}
|
1926
1960
|
}, props), /*#__PURE__*/React.createElement("div", {
|
1927
|
-
className: "d-flex align-items-center justify-content-
|
1928
|
-
},
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1961
|
+
className: "d-flex flex-row align-items-center justify-content-between"
|
1962
|
+
}, /*#__PURE__*/React.createElement("div", {
|
1963
|
+
className: "w-100 d-flex align-items-center justify-content-start text-survey-builder-checkbox"
|
1964
|
+
}, isBooleanFalse(props.checked) && /*#__PURE__*/React.createElement(RiCheckboxBlankLine, {
|
1965
|
+
size: 30,
|
1966
|
+
className: "me-3 flex-shrink-0 text-".concat((_self$props9 = self.props) === null || _self$props9 === void 0 || (_self$props9 = _self$props9.item) === null || _self$props9 === void 0 ? void 0 : _self$props9.unselectedColor)
|
1967
|
+
}), isBooleanTrue(props.checked) && /*#__PURE__*/React.createElement(RiCheckboxFill, {
|
1968
|
+
size: 30,
|
1969
|
+
className: "me-3 flex-shrink-0 text-".concat((_self$props10 = self.props) === null || _self$props10 === void 0 || (_self$props10 = _self$props10.item) === null || _self$props10 === void 0 ? void 0 : _self$props10.selectedColor)
|
1934
1970
|
}), /*#__PURE__*/React.createElement("div", {
|
1935
|
-
className: "
|
1936
|
-
},
|
1937
|
-
|
1971
|
+
className: "d-flex flex-column"
|
1972
|
+
}, /*#__PURE__*/React.createElement("div", {
|
1973
|
+
className: "text-".concat((_self$props11 = self.props) === null || _self$props11 === void 0 || (_self$props11 = _self$props11.item) === null || _self$props11 === void 0 ? void 0 : _self$props11.textColor, " ").concat((_self$props12 = self.props) === null || _self$props12 === void 0 || (_self$props12 = _self$props12.item) === null || _self$props12 === void 0 ? void 0 : _self$props12.fieldLabelClassName)
|
1974
|
+
}, option.text), isNotNullOrUndefined(option.description) && /*#__PURE__*/React.createElement("div", {
|
1975
|
+
className: "".concat((_self$props13 = self.props) === null || _self$props13 === void 0 || (_self$props13 = _self$props13.item) === null || _self$props13 === void 0 ? void 0 : _self$props13.fieldDescriptionClassName)
|
1976
|
+
}, option.description))), option.icon && /*#__PURE__*/React.createElement("div", {
|
1977
|
+
className: "text-center me-2"
|
1978
|
+
}, /*#__PURE__*/React.createElement(IconComponent, {
|
1979
|
+
iconImportString: option.icon,
|
1980
|
+
size: 50
|
1981
|
+
})))));
|
1982
|
+
})), /*#__PURE__*/React.createElement(ComponentErrorMessage, {
|
1938
1983
|
name: name
|
1939
1984
|
})));
|
1940
1985
|
}
|
@@ -1952,13 +1997,18 @@ export var Checkbox = /*#__PURE__*/function (_React$Component3) {
|
|
1952
1997
|
return _createClass(Checkbox, [{
|
1953
1998
|
key: "render",
|
1954
1999
|
value: function render() {
|
1955
|
-
var
|
2000
|
+
var _ref23,
|
1956
2001
|
_this$props$name,
|
1957
2002
|
_this$props,
|
1958
2003
|
_this$props2,
|
1959
2004
|
_this$props3,
|
1960
2005
|
_this6 = this,
|
1961
|
-
|
2006
|
+
_ref24,
|
2007
|
+
_this$props$item$bgCo,
|
2008
|
+
_this$props4,
|
2009
|
+
_this$props5,
|
2010
|
+
_self$props14,
|
2011
|
+
_self,
|
1962
2012
|
_this$props$item$help3,
|
1963
2013
|
_this$props$item3;
|
1964
2014
|
var baseClasses = 'SortableItem rfb-item';
|
@@ -1967,7 +2017,7 @@ export var Checkbox = /*#__PURE__*/function (_React$Component3) {
|
|
1967
2017
|
}
|
1968
2018
|
var props = {};
|
1969
2019
|
// eslint-disable-next-line no-undef
|
1970
|
-
props.name = (
|
2020
|
+
props.name = (_ref23 = (_this$props$name = this === null || this === void 0 || (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.name) !== null && _this$props$name !== void 0 ? _this$props$name : this === null || this === void 0 || (_this$props2 = this.props) === null || _this$props2 === void 0 || (_this$props2 = _this$props2.item) === null || _this$props2 === void 0 ? void 0 : _this$props2.customName) !== null && _ref23 !== void 0 ? _ref23 : this === null || this === void 0 || (_this$props3 = this.props) === null || _this$props3 === void 0 || (_this$props3 = _this$props3.item) === null || _this$props3 === void 0 ? void 0 : _this$props3.fieldName;
|
1971
2021
|
props.onChange = function (event) {
|
1972
2022
|
if (_this6.props.onChange) {
|
1973
2023
|
_this6.props.onChange(event.target.checked);
|
@@ -2010,8 +2060,8 @@ export var Checkbox = /*#__PURE__*/function (_React$Component3) {
|
|
2010
2060
|
className: "form-label"
|
2011
2061
|
}, this.props)), /*#__PURE__*/React.createElement(ToggleButton, _extends({
|
2012
2062
|
type: "checkbox",
|
2013
|
-
variant: (_this$props$
|
2014
|
-
className: "btn-survey-builder-checkbox w-100",
|
2063
|
+
variant: (_ref24 = (_this$props$item$bgCo = (_this$props4 = this.props) === null || _this$props4 === void 0 || (_this$props4 = _this$props4.item) === null || _this$props4 === void 0 ? void 0 : _this$props4.bgColor) !== null && _this$props$item$bgCo !== void 0 ? _this$props$item$bgCo : (_this$props5 = this.props) === null || _this$props5 === void 0 ? void 0 : _this$props5.checkboxButtonClassName) !== null && _ref24 !== void 0 ? _ref24 : "outline-light",
|
2064
|
+
className: "btn-survey-builder-checkbox w-100 ".concat((_self$props14 = self.props) === null || _self$props14 === void 0 || (_self$props14 = _self$props14.item) === null || _self$props14 === void 0 ? void 0 : _self$props14.className),
|
2015
2065
|
value: props.name,
|
2016
2066
|
id: props.name + '-' + ID.uuid()
|
2017
2067
|
}, props), /*#__PURE__*/React.createElement("div", {
|
@@ -2023,7 +2073,7 @@ export var Checkbox = /*#__PURE__*/function (_React$Component3) {
|
|
2023
2073
|
size: "40px",
|
2024
2074
|
className: "me-3 flex-shrink-0"
|
2025
2075
|
}), /*#__PURE__*/React.createElement("div", {
|
2026
|
-
className: "text-start"
|
2076
|
+
className: "text-start text-".concat((_self = self) === null || _self === void 0 || (_self = _self.props) === null || _self === void 0 || (_self = _self.item) === null || _self === void 0 ? void 0 : _self.textColor)
|
2027
2077
|
}, /*#__PURE__*/React.createElement("span", {
|
2028
2078
|
dangerouslySetInnerHTML: {
|
2029
2079
|
__html: this.props.item.boxLabel
|
@@ -2048,16 +2098,16 @@ export var RadioButtons = /*#__PURE__*/function (_React$Component4) {
|
|
2048
2098
|
return _createClass(RadioButtons, [{
|
2049
2099
|
key: "render",
|
2050
2100
|
value: function render() {
|
2051
|
-
var
|
2101
|
+
var _ref25,
|
2052
2102
|
_self$props$name2,
|
2053
|
-
_self$
|
2054
|
-
_self$
|
2055
|
-
_self$
|
2103
|
+
_self$props15,
|
2104
|
+
_self$props16,
|
2105
|
+
_self$props17,
|
2056
2106
|
_this8 = this,
|
2057
2107
|
_self$props$item$help,
|
2058
2108
|
_self$props$item;
|
2059
2109
|
var self = this;
|
2060
|
-
var name = (
|
2110
|
+
var name = (_ref25 = (_self$props$name2 = self === null || self === void 0 || (_self$props15 = self.props) === null || _self$props15 === void 0 ? void 0 : _self$props15.name) !== null && _self$props$name2 !== void 0 ? _self$props$name2 : self === null || self === void 0 || (_self$props16 = self.props) === null || _self$props16 === void 0 || (_self$props16 = _self$props16.item) === null || _self$props16 === void 0 ? void 0 : _self$props16.customName) !== null && _ref25 !== void 0 ? _ref25 : self === null || self === void 0 || (_self$props17 = self.props) === null || _self$props17 === void 0 || (_self$props17 = _self$props17.item) === null || _self$props17 === void 0 ? void 0 : _self$props17.fieldName;
|
2061
2111
|
var baseClasses = 'SortableItem rfb-item';
|
2062
2112
|
if (this.props.item.pageBreakBefore) {
|
2063
2113
|
baseClasses += ' alwaysbreak';
|
@@ -2085,14 +2135,21 @@ export var RadioButtons = /*#__PURE__*/function (_React$Component4) {
|
|
2085
2135
|
className: "form-group mb-3"
|
2086
2136
|
}, /*#__PURE__*/React.createElement(ComponentLabel, self.props), self.props.item.help ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Text, {
|
2087
2137
|
className: (_self$props$item$help = (_self$props$item = self.props.item) === null || _self$props$item === void 0 ? void 0 : _self$props$item.helpClassName) !== null && _self$props$item$help !== void 0 ? _self$props$item$help : 'text-muted'
|
2088
|
-
}, self.props.item.help)) : null,
|
2089
|
-
|
2138
|
+
}, self.props.item.help)) : null, /*#__PURE__*/React.createElement(Row, {
|
2139
|
+
className: "g-3"
|
2140
|
+
}, self.props.item.options.map(function (option, index) {
|
2141
|
+
var _self$props18, _self$props19, _ref26, _self$props$item$bgCo2, _self$props20, _self$props21, _self$props22, _self$props23, _self$props24, _self$props25, _self$props26, _self$props30, _self$props31, _self$props32, _self$props33, _self$props34, _self$props35, _self$props36, _self$props37, _self$props38, _self$props39, _self$props40, _self$props41, _self$props42, _self$props43;
|
2090
2142
|
// console.log('option', option);
|
2091
|
-
|
2143
|
+
var checked = (self === null || self === void 0 || (_self$props18 = self.props) === null || _self$props18 === void 0 ? void 0 : _self$props18.value) === option.value;
|
2144
|
+
var horizontal = isBooleanTrue((_self$props19 = self.props) === null || _self$props19 === void 0 || (_self$props19 = _self$props19.item) === null || _self$props19 === void 0 ? void 0 : _self$props19.inline);
|
2145
|
+
return /*#__PURE__*/React.createElement(Col, {
|
2146
|
+
key: "container_".concat(name, "_").concat(option.value),
|
2147
|
+
xs: horizontal ? 6 : 12
|
2148
|
+
}, /*#__PURE__*/React.createElement(ToggleButton, {
|
2092
2149
|
label: option.text,
|
2093
2150
|
type: "radio",
|
2094
|
-
variant: (_self$props$
|
2095
|
-
className: "btn-survey-builder-checkbox
|
2151
|
+
variant: (_ref26 = (_self$props$item$bgCo2 = (_self$props20 = self.props) === null || _self$props20 === void 0 || (_self$props20 = _self$props20.item) === null || _self$props20 === void 0 ? void 0 : _self$props20.bgColor) !== null && _self$props$item$bgCo2 !== void 0 ? _self$props$item$bgCo2 : (_self$props21 = self.props) === null || _self$props21 === void 0 ? void 0 : _self$props21.checkboxButtonClassName) !== null && _ref26 !== void 0 ? _ref26 : "outline-light",
|
2152
|
+
className: "btn-survey-builder-checkbox ".concat((_self$props22 = self.props) === null || _self$props22 === void 0 || (_self$props22 = _self$props22.item) === null || _self$props22 === void 0 ? void 0 : _self$props22.className, " ").concat(isBooleanTrue(checked) ? (_self$props23 = self.props) === null || _self$props23 === void 0 || (_self$props23 = _self$props23.item) === null || _self$props23 === void 0 ? void 0 : _self$props23.selectedClassName : (_self$props24 = self.props) === null || _self$props24 === void 0 || (_self$props24 = _self$props24.item) === null || _self$props24 === void 0 ? void 0 : _self$props24.unselectedClassName),
|
2096
2153
|
key: "preview_".concat(option.key),
|
2097
2154
|
id: name + '-' + ID.uuid(),
|
2098
2155
|
inputRef: function inputRef(c) {
|
@@ -2100,36 +2157,92 @@ export var RadioButtons = /*#__PURE__*/function (_React$Component4) {
|
|
2100
2157
|
self.options["child_ref_".concat(option.key)] = c;
|
2101
2158
|
}
|
2102
2159
|
},
|
2103
|
-
disabled: self === null || self === void 0 || (_self$
|
2160
|
+
disabled: self === null || self === void 0 || (_self$props25 = self.props) === null || _self$props25 === void 0 || (_self$props25 = _self$props25.item) === null || _self$props25 === void 0 ? void 0 : _self$props25.disabled,
|
2104
2161
|
name: name,
|
2105
2162
|
value: option.value,
|
2106
|
-
checked: (self === null || self === void 0 || (_self$
|
2163
|
+
checked: (self === null || self === void 0 || (_self$props26 = self.props) === null || _self$props26 === void 0 ? void 0 : _self$props26.value) === option.value,
|
2107
2164
|
onChange: function onChange(e) {
|
2108
|
-
var _self$
|
2165
|
+
var _self$props27, _self$props28, _self$props29;
|
2109
2166
|
// console.log('onChange', e.target.value);
|
2110
|
-
if ((self === null || self === void 0 || (_self$
|
2167
|
+
if ((self === null || self === void 0 || (_self$props27 = self.props) === null || _self$props27 === void 0 ? void 0 : _self$props27.onChange) !== undefined) {
|
2111
2168
|
self.props.onChange(e.target.value);
|
2112
2169
|
}
|
2113
|
-
if (isBooleanTrue(self === null || self === void 0 || (_self$
|
2170
|
+
if (isBooleanTrue(self === null || self === void 0 || (_self$props28 = self.props) === null || _self$props28 === void 0 || (_self$props28 = _self$props28.item) === null || _self$props28 === void 0 ? void 0 : _self$props28.submitOnSelection) && (self === null || self === void 0 || (_self$props29 = self.props) === null || _self$props29 === void 0 ? void 0 : _self$props29.onSelect) !== undefined) {
|
2114
2171
|
self.props.onSelect(e.target.value);
|
2115
2172
|
}
|
2116
2173
|
}
|
2174
|
+
}, isBooleanTrue(horizontal) ? /*#__PURE__*/React.createElement(React.Fragment, null, option.icon && /*#__PURE__*/React.createElement("div", {
|
2175
|
+
className: "text-center"
|
2176
|
+
}, /*#__PURE__*/React.createElement(IconComponent, {
|
2177
|
+
iconImportString: option.icon,
|
2178
|
+
size: 80
|
2179
|
+
})), option.image && /*#__PURE__*/React.createElement("div", {
|
2180
|
+
className: "text-center mx-auto d-block",
|
2181
|
+
style: {
|
2182
|
+
height: 100,
|
2183
|
+
width: 100
|
2184
|
+
}
|
2185
|
+
}, /*#__PURE__*/React.createElement(ImageComponent, {
|
2186
|
+
src: option.image,
|
2187
|
+
alt: option.text,
|
2188
|
+
style: {
|
2189
|
+
height: 100
|
2190
|
+
},
|
2191
|
+
className: "mx-auto d-block",
|
2192
|
+
loading: "lazy"
|
2193
|
+
})), /*#__PURE__*/React.createElement("div", {
|
2194
|
+
className: "d-flex flex-row align-items-center justify-content-between"
|
2117
2195
|
}, /*#__PURE__*/React.createElement("div", {
|
2118
|
-
className: "d-flex align-items-center justify-content-
|
2119
|
-
},
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2123
|
-
|
2124
|
-
className: "
|
2196
|
+
className: "w-100 d-flex align-items-center justify-content-center text-survey-builder-checkbox"
|
2197
|
+
}, /*#__PURE__*/React.createElement("div", {
|
2198
|
+
className: "d-flex flex-column"
|
2199
|
+
}, /*#__PURE__*/React.createElement("div", {
|
2200
|
+
className: "text-".concat(self === null || self === void 0 || (_self$props30 = self.props) === null || _self$props30 === void 0 || (_self$props30 = _self$props30.item) === null || _self$props30 === void 0 ? void 0 : _self$props30.textColor, " ").concat(self === null || self === void 0 || (_self$props31 = self.props) === null || _self$props31 === void 0 || (_self$props31 = _self$props31.item) === null || _self$props31 === void 0 ? void 0 : _self$props31.fieldLabelClassName, " text-center")
|
2201
|
+
}, option.text), isNotNullOrUndefined(option.description) && /*#__PURE__*/React.createElement("div", {
|
2202
|
+
className: "".concat(self === null || self === void 0 || (_self$props32 = self.props) === null || _self$props32 === void 0 || (_self$props32 = _self$props32.item) === null || _self$props32 === void 0 ? void 0 : _self$props32.fieldDescriptionClassName)
|
2203
|
+
}, option.description), /*#__PURE__*/React.createElement("div", null, isBooleanTrue(self === null || self === void 0 || (_self$props33 = self.props) === null || _self$props33 === void 0 || (_self$props33 = _self$props33.item) === null || _self$props33 === void 0 ? void 0 : _self$props33.showRadio) && isBooleanFalse(checked) && /*#__PURE__*/React.createElement(IoRadioButtonOff, {
|
2204
|
+
size: 30,
|
2205
|
+
className: "flex-shrink-0 text-".concat(self === null || self === void 0 || (_self$props34 = self.props) === null || _self$props34 === void 0 || (_self$props34 = _self$props34.item) === null || _self$props34 === void 0 ? void 0 : _self$props34.unselectedColor)
|
2206
|
+
}), isBooleanTrue(self === null || self === void 0 || (_self$props35 = self.props) === null || _self$props35 === void 0 || (_self$props35 = _self$props35.item) === null || _self$props35 === void 0 ? void 0 : _self$props35.showRadio) && isBooleanTrue(checked) && /*#__PURE__*/React.createElement(IoRadioButtonOn, {
|
2207
|
+
size: 30,
|
2208
|
+
className: "flex-shrink-0 text-".concat(self === null || self === void 0 || (_self$props36 = self.props) === null || _self$props36 === void 0 || (_self$props36 = _self$props36.item) === null || _self$props36 === void 0 ? void 0 : _self$props36.selectedColor)
|
2209
|
+
})))))) : /*#__PURE__*/React.createElement("div", {
|
2210
|
+
className: "d-flex flex-row align-items-center justify-content-between"
|
2211
|
+
}, /*#__PURE__*/React.createElement("div", {
|
2212
|
+
className: "w-100 d-flex align-items-center justify-content-start text-survey-builder-checkbox"
|
2213
|
+
}, isBooleanTrue(self === null || self === void 0 || (_self$props37 = self.props) === null || _self$props37 === void 0 || (_self$props37 = _self$props37.item) === null || _self$props37 === void 0 ? void 0 : _self$props37.showRadio) && isBooleanFalse(checked) && /*#__PURE__*/React.createElement(IoRadioButtonOff, {
|
2214
|
+
size: 30,
|
2215
|
+
className: "me-3 flex-shrink-0 text-".concat(self === null || self === void 0 || (_self$props38 = self.props) === null || _self$props38 === void 0 || (_self$props38 = _self$props38.item) === null || _self$props38 === void 0 ? void 0 : _self$props38.unselectedColor)
|
2216
|
+
}), isBooleanTrue(self === null || self === void 0 || (_self$props39 = self.props) === null || _self$props39 === void 0 || (_self$props39 = _self$props39.item) === null || _self$props39 === void 0 ? void 0 : _self$props39.showRadio) && isBooleanTrue(checked) && /*#__PURE__*/React.createElement(IoRadioButtonOn, {
|
2217
|
+
size: 30,
|
2218
|
+
className: "me-3 flex-shrink-0 text-".concat(self === null || self === void 0 || (_self$props40 = self.props) === null || _self$props40 === void 0 || (_self$props40 = _self$props40.item) === null || _self$props40 === void 0 ? void 0 : _self$props40.selectedColor)
|
2125
2219
|
}), /*#__PURE__*/React.createElement("div", {
|
2126
|
-
className: "
|
2127
|
-
}, /*#__PURE__*/React.createElement("
|
2128
|
-
|
2129
|
-
|
2220
|
+
className: "d-flex flex-column"
|
2221
|
+
}, /*#__PURE__*/React.createElement("div", {
|
2222
|
+
className: "text-".concat(self === null || self === void 0 || (_self$props41 = self.props) === null || _self$props41 === void 0 || (_self$props41 = _self$props41.item) === null || _self$props41 === void 0 ? void 0 : _self$props41.textColor, " ").concat(self === null || self === void 0 || (_self$props42 = self.props) === null || _self$props42 === void 0 || (_self$props42 = _self$props42.item) === null || _self$props42 === void 0 ? void 0 : _self$props42.fieldLabelClassName)
|
2223
|
+
}, option.text), isNotNullOrUndefined(option.description) && /*#__PURE__*/React.createElement("div", {
|
2224
|
+
className: "".concat(self === null || self === void 0 || (_self$props43 = self.props) === null || _self$props43 === void 0 || (_self$props43 = _self$props43.item) === null || _self$props43 === void 0 ? void 0 : _self$props43.fieldDescriptionClassName)
|
2225
|
+
}, option.description))), option.icon && /*#__PURE__*/React.createElement("div", {
|
2226
|
+
className: "text-center me-2"
|
2227
|
+
}, /*#__PURE__*/React.createElement(IconComponent, {
|
2228
|
+
iconImportString: option.icon,
|
2229
|
+
size: 50
|
2230
|
+
})), option.image && /*#__PURE__*/React.createElement("div", {
|
2231
|
+
className: "text-center me-2",
|
2232
|
+
style: {
|
2233
|
+
height: 40,
|
2234
|
+
width: 40
|
2130
2235
|
}
|
2131
|
-
}
|
2132
|
-
|
2236
|
+
}, /*#__PURE__*/React.createElement(ImageComponent, {
|
2237
|
+
src: option.image,
|
2238
|
+
alt: option.label,
|
2239
|
+
style: {
|
2240
|
+
height: 40
|
2241
|
+
},
|
2242
|
+
className: "mx-auto d-block",
|
2243
|
+
loading: "lazy"
|
2244
|
+
})))));
|
2245
|
+
})), /*#__PURE__*/React.createElement(ComponentErrorMessage, {
|
2133
2246
|
name: name
|
2134
2247
|
})));
|
2135
2248
|
}
|
@@ -2147,16 +2260,16 @@ export var ButtonList = /*#__PURE__*/function (_React$Component5) {
|
|
2147
2260
|
return _createClass(ButtonList, [{
|
2148
2261
|
key: "render",
|
2149
2262
|
value: function render() {
|
2150
|
-
var
|
2263
|
+
var _ref27,
|
2151
2264
|
_self$props$name3,
|
2152
|
-
_self$
|
2153
|
-
_self$
|
2154
|
-
_self$
|
2265
|
+
_self$props44,
|
2266
|
+
_self$props45,
|
2267
|
+
_self$props46,
|
2155
2268
|
_this10 = this,
|
2156
2269
|
_self$props$item$help2,
|
2157
2270
|
_self$props$item2;
|
2158
2271
|
var self = this;
|
2159
|
-
var name = (
|
2272
|
+
var name = (_ref27 = (_self$props$name3 = self === null || self === void 0 || (_self$props44 = self.props) === null || _self$props44 === void 0 ? void 0 : _self$props44.name) !== null && _self$props$name3 !== void 0 ? _self$props$name3 : self === null || self === void 0 || (_self$props45 = self.props) === null || _self$props45 === void 0 || (_self$props45 = _self$props45.item) === null || _self$props45 === void 0 ? void 0 : _self$props45.customName) !== null && _ref27 !== void 0 ? _ref27 : self === null || self === void 0 || (_self$props46 = self.props) === null || _self$props46 === void 0 || (_self$props46 = _self$props46.item) === null || _self$props46 === void 0 ? void 0 : _self$props46.fieldName;
|
2160
2273
|
var baseClasses = 'SortableItem rfb-item';
|
2161
2274
|
if (this.props.item.pageBreakBefore) {
|
2162
2275
|
baseClasses += ' alwaysbreak';
|
@@ -2184,14 +2297,21 @@ export var ButtonList = /*#__PURE__*/function (_React$Component5) {
|
|
2184
2297
|
className: "form-group mb-3"
|
2185
2298
|
}, /*#__PURE__*/React.createElement(ComponentLabel, self.props), self.props.item.help ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Text, {
|
2186
2299
|
className: (_self$props$item$help2 = (_self$props$item2 = self.props.item) === null || _self$props$item2 === void 0 ? void 0 : _self$props$item2.helpClassName) !== null && _self$props$item$help2 !== void 0 ? _self$props$item$help2 : 'text-muted'
|
2187
|
-
}, self.props.item.help)) : null,
|
2188
|
-
|
2300
|
+
}, self.props.item.help)) : null, /*#__PURE__*/React.createElement(Row, {
|
2301
|
+
className: "g-3"
|
2302
|
+
}, self.props.item.options.map(function (option, index) {
|
2303
|
+
var _self$props47, _self$props48, _ref28, _self$props$item$bgCo3, _self$props49, _self$props50, _self$props51, _self$props52, _self$props53, _self$props54, _self$props55, _self$props59, _self$props60, _self$props61, _self$props62, _self$props63, _self$props64, _self$props65, _self$props66, _self$props67, _self$props68, _self$props69, _self$props70, _self$props71, _self$props72;
|
2189
2304
|
// console.log('option', option);
|
2190
|
-
|
2305
|
+
var checked = (self === null || self === void 0 || (_self$props47 = self.props) === null || _self$props47 === void 0 ? void 0 : _self$props47.value) === option.value;
|
2306
|
+
var horizontal = isBooleanTrue((_self$props48 = self.props) === null || _self$props48 === void 0 || (_self$props48 = _self$props48.item) === null || _self$props48 === void 0 ? void 0 : _self$props48.inline);
|
2307
|
+
return /*#__PURE__*/React.createElement(Col, {
|
2308
|
+
key: "container_".concat(name, "_").concat(option.value),
|
2309
|
+
xs: horizontal ? 6 : 12
|
2310
|
+
}, /*#__PURE__*/React.createElement(ToggleButton, {
|
2191
2311
|
label: option.text,
|
2192
2312
|
type: "radio",
|
2193
|
-
variant: (_self$props$
|
2194
|
-
className: "btn-survey-builder-checkbox
|
2313
|
+
variant: (_ref28 = (_self$props$item$bgCo3 = (_self$props49 = self.props) === null || _self$props49 === void 0 || (_self$props49 = _self$props49.item) === null || _self$props49 === void 0 ? void 0 : _self$props49.bgColor) !== null && _self$props$item$bgCo3 !== void 0 ? _self$props$item$bgCo3 : (_self$props50 = self.props) === null || _self$props50 === void 0 ? void 0 : _self$props50.checkboxButtonClassName) !== null && _ref28 !== void 0 ? _ref28 : "outline-light",
|
2314
|
+
className: "btn-survey-builder-checkbox ".concat((_self$props51 = self.props) === null || _self$props51 === void 0 || (_self$props51 = _self$props51.item) === null || _self$props51 === void 0 ? void 0 : _self$props51.className, " ").concat(isBooleanTrue(checked) ? (_self$props52 = self.props) === null || _self$props52 === void 0 || (_self$props52 = _self$props52.item) === null || _self$props52 === void 0 ? void 0 : _self$props52.selectedClassName : (_self$props53 = self.props) === null || _self$props53 === void 0 || (_self$props53 = _self$props53.item) === null || _self$props53 === void 0 ? void 0 : _self$props53.unselectedClassName),
|
2195
2315
|
key: "preview_".concat(option.key),
|
2196
2316
|
id: name + '-' + ID.uuid(),
|
2197
2317
|
inputRef: function inputRef(c) {
|
@@ -2199,30 +2319,92 @@ export var ButtonList = /*#__PURE__*/function (_React$Component5) {
|
|
2199
2319
|
self.options["child_ref_".concat(option.key)] = c;
|
2200
2320
|
}
|
2201
2321
|
},
|
2202
|
-
disabled: self === null || self === void 0 || (_self$
|
2322
|
+
disabled: self === null || self === void 0 || (_self$props54 = self.props) === null || _self$props54 === void 0 || (_self$props54 = _self$props54.item) === null || _self$props54 === void 0 ? void 0 : _self$props54.disabled,
|
2203
2323
|
name: name,
|
2204
2324
|
value: option.value,
|
2205
|
-
checked: (self === null || self === void 0 || (_self$
|
2325
|
+
checked: (self === null || self === void 0 || (_self$props55 = self.props) === null || _self$props55 === void 0 ? void 0 : _self$props55.value) === option.value,
|
2206
2326
|
onChange: function onChange(e) {
|
2207
|
-
var _self$
|
2327
|
+
var _self$props56, _self$props57, _self$props58;
|
2208
2328
|
// console.log('onChange', e.target.value);
|
2209
|
-
if ((self === null || self === void 0 || (_self$
|
2329
|
+
if ((self === null || self === void 0 || (_self$props56 = self.props) === null || _self$props56 === void 0 ? void 0 : _self$props56.onChange) !== undefined) {
|
2210
2330
|
self.props.onChange(e.target.value);
|
2211
2331
|
}
|
2212
|
-
if (isBooleanTrue(self === null || self === void 0 || (_self$
|
2332
|
+
if (isBooleanTrue(self === null || self === void 0 || (_self$props57 = self.props) === null || _self$props57 === void 0 || (_self$props57 = _self$props57.item) === null || _self$props57 === void 0 ? void 0 : _self$props57.submitOnSelection) && (self === null || self === void 0 || (_self$props58 = self.props) === null || _self$props58 === void 0 ? void 0 : _self$props58.onSelect) !== undefined) {
|
2213
2333
|
self.props.onSelect(e.target.value);
|
2214
2334
|
}
|
2215
2335
|
}
|
2336
|
+
}, isBooleanTrue(horizontal) ? /*#__PURE__*/React.createElement(React.Fragment, null, option.icon && /*#__PURE__*/React.createElement("div", {
|
2337
|
+
className: "text-center"
|
2338
|
+
}, /*#__PURE__*/React.createElement(IconComponent, {
|
2339
|
+
iconImportString: option.icon,
|
2340
|
+
size: 80
|
2341
|
+
})), option.image && /*#__PURE__*/React.createElement("div", {
|
2342
|
+
className: "text-center mx-auto d-block",
|
2343
|
+
style: {
|
2344
|
+
height: 100,
|
2345
|
+
width: 100
|
2346
|
+
}
|
2347
|
+
}, /*#__PURE__*/React.createElement(ImageComponent, {
|
2348
|
+
src: option.image,
|
2349
|
+
alt: option.text,
|
2350
|
+
style: {
|
2351
|
+
height: 100
|
2352
|
+
},
|
2353
|
+
className: "mx-auto d-block",
|
2354
|
+
loading: "lazy"
|
2355
|
+
})), /*#__PURE__*/React.createElement("div", {
|
2356
|
+
className: "d-flex flex-row align-items-center justify-content-between"
|
2216
2357
|
}, /*#__PURE__*/React.createElement("div", {
|
2217
|
-
className: "d-flex align-items-center justify-content-
|
2358
|
+
className: "w-100 d-flex align-items-center justify-content-center text-survey-builder-checkbox"
|
2218
2359
|
}, /*#__PURE__*/React.createElement("div", {
|
2219
|
-
className: "
|
2220
|
-
}, /*#__PURE__*/React.createElement("
|
2221
|
-
|
2222
|
-
|
2360
|
+
className: "d-flex flex-column"
|
2361
|
+
}, /*#__PURE__*/React.createElement("div", {
|
2362
|
+
className: "text-".concat(self === null || self === void 0 || (_self$props59 = self.props) === null || _self$props59 === void 0 || (_self$props59 = _self$props59.item) === null || _self$props59 === void 0 ? void 0 : _self$props59.textColor, " ").concat(self === null || self === void 0 || (_self$props60 = self.props) === null || _self$props60 === void 0 || (_self$props60 = _self$props60.item) === null || _self$props60 === void 0 ? void 0 : _self$props60.fieldLabelClassName, " text-center")
|
2363
|
+
}, option.text), isNotNullOrUndefined(option.description) && /*#__PURE__*/React.createElement("div", {
|
2364
|
+
className: "".concat(self === null || self === void 0 || (_self$props61 = self.props) === null || _self$props61 === void 0 || (_self$props61 = _self$props61.item) === null || _self$props61 === void 0 ? void 0 : _self$props61.fieldDescriptionClassName)
|
2365
|
+
}, option.description), /*#__PURE__*/React.createElement("div", null, isBooleanTrue(self === null || self === void 0 || (_self$props62 = self.props) === null || _self$props62 === void 0 || (_self$props62 = _self$props62.item) === null || _self$props62 === void 0 ? void 0 : _self$props62.showRadio) && isBooleanFalse(checked) && /*#__PURE__*/React.createElement(IoRadioButtonOff, {
|
2366
|
+
size: 30,
|
2367
|
+
className: "flex-shrink-0 text-".concat(self === null || self === void 0 || (_self$props63 = self.props) === null || _self$props63 === void 0 || (_self$props63 = _self$props63.item) === null || _self$props63 === void 0 ? void 0 : _self$props63.unselectedColor)
|
2368
|
+
}), isBooleanTrue(self === null || self === void 0 || (_self$props64 = self.props) === null || _self$props64 === void 0 || (_self$props64 = _self$props64.item) === null || _self$props64 === void 0 ? void 0 : _self$props64.showRadio) && isBooleanTrue(checked) && /*#__PURE__*/React.createElement(IoRadioButtonOn, {
|
2369
|
+
size: 30,
|
2370
|
+
className: "flex-shrink-0 text-".concat(self === null || self === void 0 || (_self$props65 = self.props) === null || _self$props65 === void 0 || (_self$props65 = _self$props65.item) === null || _self$props65 === void 0 ? void 0 : _self$props65.selectedColor)
|
2371
|
+
})))))) : /*#__PURE__*/React.createElement("div", {
|
2372
|
+
className: "d-flex flex-row align-items-center justify-content-between"
|
2373
|
+
}, /*#__PURE__*/React.createElement("div", {
|
2374
|
+
className: "w-100 d-flex align-items-center justify-content-start text-survey-builder-checkbox"
|
2375
|
+
}, isBooleanTrue(self === null || self === void 0 || (_self$props66 = self.props) === null || _self$props66 === void 0 || (_self$props66 = _self$props66.item) === null || _self$props66 === void 0 ? void 0 : _self$props66.showRadio) && isBooleanFalse(checked) && /*#__PURE__*/React.createElement(IoRadioButtonOff, {
|
2376
|
+
size: 30,
|
2377
|
+
className: "me-3 flex-shrink-0 text-".concat(self === null || self === void 0 || (_self$props67 = self.props) === null || _self$props67 === void 0 || (_self$props67 = _self$props67.item) === null || _self$props67 === void 0 ? void 0 : _self$props67.unselectedColor)
|
2378
|
+
}), isBooleanTrue(self === null || self === void 0 || (_self$props68 = self.props) === null || _self$props68 === void 0 || (_self$props68 = _self$props68.item) === null || _self$props68 === void 0 ? void 0 : _self$props68.showRadio) && isBooleanTrue(checked) && /*#__PURE__*/React.createElement(IoRadioButtonOn, {
|
2379
|
+
size: 30,
|
2380
|
+
className: "me-3 flex-shrink-0 text-".concat(self === null || self === void 0 || (_self$props69 = self.props) === null || _self$props69 === void 0 || (_self$props69 = _self$props69.item) === null || _self$props69 === void 0 ? void 0 : _self$props69.selectedColor)
|
2381
|
+
}), /*#__PURE__*/React.createElement("div", {
|
2382
|
+
className: "d-flex flex-column"
|
2383
|
+
}, /*#__PURE__*/React.createElement("div", {
|
2384
|
+
className: "text-".concat(self === null || self === void 0 || (_self$props70 = self.props) === null || _self$props70 === void 0 || (_self$props70 = _self$props70.item) === null || _self$props70 === void 0 ? void 0 : _self$props70.textColor, " ").concat(self === null || self === void 0 || (_self$props71 = self.props) === null || _self$props71 === void 0 || (_self$props71 = _self$props71.item) === null || _self$props71 === void 0 ? void 0 : _self$props71.fieldLabelClassName)
|
2385
|
+
}, option.text), isNotNullOrUndefined(option.description) && /*#__PURE__*/React.createElement("div", {
|
2386
|
+
className: "".concat(self === null || self === void 0 || (_self$props72 = self.props) === null || _self$props72 === void 0 || (_self$props72 = _self$props72.item) === null || _self$props72 === void 0 ? void 0 : _self$props72.fieldDescriptionClassName)
|
2387
|
+
}, option.description))), option.icon && /*#__PURE__*/React.createElement("div", {
|
2388
|
+
className: "text-center me-2"
|
2389
|
+
}, /*#__PURE__*/React.createElement(IconComponent, {
|
2390
|
+
iconImportString: option.icon,
|
2391
|
+
size: 50
|
2392
|
+
})), option.image && /*#__PURE__*/React.createElement("div", {
|
2393
|
+
className: "text-center me-2",
|
2394
|
+
style: {
|
2395
|
+
height: 40,
|
2396
|
+
width: 40
|
2223
2397
|
}
|
2224
|
-
}
|
2225
|
-
|
2398
|
+
}, /*#__PURE__*/React.createElement(ImageComponent, {
|
2399
|
+
src: option.image,
|
2400
|
+
alt: option.label,
|
2401
|
+
style: {
|
2402
|
+
height: 40
|
2403
|
+
},
|
2404
|
+
className: "mx-auto d-block",
|
2405
|
+
loading: "lazy"
|
2406
|
+
})))));
|
2407
|
+
})), /*#__PURE__*/React.createElement(ComponentErrorMessage, {
|
2226
2408
|
name: name
|
2227
2409
|
})));
|
2228
2410
|
}
|
@@ -2247,14 +2429,14 @@ export var Image = function Image(props) {
|
|
2247
2429
|
className: "no-image"
|
2248
2430
|
}, "No Image"));
|
2249
2431
|
};
|
2250
|
-
export var Rating = function Rating(
|
2432
|
+
export var Rating = function Rating(_ref29) {
|
2251
2433
|
var _item$required25, _item$disabled17, _item$required26, _item$helpClassName18;
|
2252
|
-
var name =
|
2253
|
-
onChange =
|
2254
|
-
value =
|
2255
|
-
style =
|
2256
|
-
item =
|
2257
|
-
props = _objectWithoutProperties(
|
2434
|
+
var name = _ref29.name,
|
2435
|
+
onChange = _ref29.onChange,
|
2436
|
+
value = _ref29.value,
|
2437
|
+
style = _ref29.style,
|
2438
|
+
item = _ref29.item,
|
2439
|
+
props = _objectWithoutProperties(_ref29, _excluded10);
|
2258
2440
|
var methods = useFormContext();
|
2259
2441
|
var onChangeHandler = function onChangeHandler(value) {
|
2260
2442
|
if (onChange !== undefined) {
|
@@ -2276,23 +2458,23 @@ export var Rating = function Rating(_ref24) {
|
|
2276
2458
|
name: name,
|
2277
2459
|
rules: fieldRules
|
2278
2460
|
};
|
2279
|
-
controllerProps.render = function (
|
2280
|
-
var
|
2281
|
-
onChange =
|
2282
|
-
onBlur =
|
2283
|
-
value =
|
2284
|
-
name =
|
2285
|
-
ref =
|
2286
|
-
|
2287
|
-
invalid =
|
2288
|
-
isTouched =
|
2289
|
-
isDirty =
|
2290
|
-
error =
|
2291
|
-
formState =
|
2461
|
+
controllerProps.render = function (_ref30) {
|
2462
|
+
var _ref30$field = _ref30.field,
|
2463
|
+
onChange = _ref30$field.onChange,
|
2464
|
+
onBlur = _ref30$field.onBlur,
|
2465
|
+
value = _ref30$field.value,
|
2466
|
+
name = _ref30$field.name,
|
2467
|
+
ref = _ref30$field.ref,
|
2468
|
+
_ref30$fieldState = _ref30.fieldState,
|
2469
|
+
invalid = _ref30$fieldState.invalid,
|
2470
|
+
isTouched = _ref30$fieldState.isTouched,
|
2471
|
+
isDirty = _ref30$fieldState.isDirty,
|
2472
|
+
error = _ref30$fieldState.error,
|
2473
|
+
formState = _ref30.formState;
|
2292
2474
|
return /*#__PURE__*/React.createElement(StarRating, _extends({
|
2293
2475
|
onBlur: onBlur,
|
2294
|
-
onRatingClick: function onRatingClick(event,
|
2295
|
-
var rating =
|
2476
|
+
onRatingClick: function onRatingClick(event, _ref31) {
|
2477
|
+
var rating = _ref31.rating;
|
2296
2478
|
onChange(rating);
|
2297
2479
|
onChangeHandler(rating);
|
2298
2480
|
},
|
@@ -2334,8 +2516,8 @@ export var Rating = function Rating(_ref24) {
|
|
2334
2516
|
className: item === null || item === void 0 ? void 0 : item.labelClassName,
|
2335
2517
|
htmlFor: name
|
2336
2518
|
}), /*#__PURE__*/React.createElement(StarRating, _extends({
|
2337
|
-
onRatingClick: function onRatingClick(event,
|
2338
|
-
var rating =
|
2519
|
+
onRatingClick: function onRatingClick(event, _ref32) {
|
2520
|
+
var rating = _ref32.rating;
|
2339
2521
|
onChange(rating);
|
2340
2522
|
onChangeHandler(rating);
|
2341
2523
|
},
|
@@ -2444,9 +2626,9 @@ export var Camera = /*#__PURE__*/function (_React$Component6) {
|
|
2444
2626
|
_inherits(Camera, _React$Component6);
|
2445
2627
|
return _createClass(Camera, [{
|
2446
2628
|
key: "getImageSizeProps",
|
2447
|
-
value: function getImageSizeProps(
|
2448
|
-
var width =
|
2449
|
-
height =
|
2629
|
+
value: function getImageSizeProps(_ref33) {
|
2630
|
+
var width = _ref33.width,
|
2631
|
+
height = _ref33.height;
|
2450
2632
|
var imgProps = {
|
2451
2633
|
width: '100%'
|
2452
2634
|
};
|
@@ -2461,7 +2643,7 @@ export var Camera = /*#__PURE__*/function (_React$Component6) {
|
|
2461
2643
|
}, {
|
2462
2644
|
key: "render",
|
2463
2645
|
value: function render() {
|
2464
|
-
var _this$props$
|
2646
|
+
var _this$props$checkboxB, _this$props6, _this$props$item$help4, _this$props$item4;
|
2465
2647
|
var imageStyle = {
|
2466
2648
|
objectFit: 'scale-down',
|
2467
2649
|
objectPosition: this.props.item.center ? 'center' : 'left'
|
@@ -2519,7 +2701,7 @@ export var Camera = /*#__PURE__*/function (_React$Component6) {
|
|
2519
2701
|
}, props)), /*#__PURE__*/React.createElement("div", {
|
2520
2702
|
className: "image-upload-control d-grid gap-2 w-100"
|
2521
2703
|
}, /*#__PURE__*/React.createElement(Button, {
|
2522
|
-
variant: (_this$props$
|
2704
|
+
variant: (_this$props$checkboxB = (_this$props6 = this.props) === null || _this$props6 === void 0 ? void 0 : _this$props6.checkboxButtonClassName) !== null && _this$props$checkboxB !== void 0 ? _this$props$checkboxB : "outline-dark",
|
2523
2705
|
className: "d-flex align-items-center justify-content-between fw-bold",
|
2524
2706
|
size: "lg"
|
2525
2707
|
}, "Take Photo ", /*#__PURE__*/React.createElement(FaCamera, null)))), this.props.value && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
@@ -2566,7 +2748,7 @@ export var FileUpload = /*#__PURE__*/function (_React$Component7) {
|
|
2566
2748
|
}
|
2567
2749
|
});
|
2568
2750
|
_defineProperty(_this12, "saveFile", /*#__PURE__*/function () {
|
2569
|
-
var
|
2751
|
+
var _ref34 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
2570
2752
|
var sourceUrl, response, dispositionHeader, resBlob, blob, fileName, _fileName;
|
2571
2753
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
2572
2754
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -2607,7 +2789,7 @@ export var FileUpload = /*#__PURE__*/function (_React$Component7) {
|
|
2607
2789
|
}, _callee2);
|
2608
2790
|
}));
|
2609
2791
|
return function (_x) {
|
2610
|
-
return
|
2792
|
+
return _ref34.apply(this, arguments);
|
2611
2793
|
};
|
2612
2794
|
}());
|
2613
2795
|
_this12.inputField = /*#__PURE__*/React.createRef();
|