react-survey-builder 1.0.124 → 1.0.125

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.
@@ -54,129 +54,6 @@ import ID from '../UUID';
54
54
  import { isBooleanFalse, isBooleanTrue, isNotNullOrUndefined, replaceInText } from '../utils/objectUtils';
55
55
  import { Icon } from "@iconify/react";
56
56
  var SurveyElements = {};
57
-
58
- // const IconComponent = ({ iconImportString, ...props }) => {
59
- // try {
60
- // if (isNotNullOrUndefined(iconImportString) && iconImportString !== '') {
61
- // const [library, iconPath = 'fa', iconName = 'FaCircle'] = iconImportString.split('/');
62
- // const Icon = lazy(async () => {
63
- // let module = null;
64
- // if (library && iconPath && iconName) {
65
- // switch (iconPath) {
66
- // case 'ai':
67
- // module = await import(`react-icons/ai`);
68
- // break;
69
- // case 'bs':
70
- // module = await import(`react-icons/bs`);
71
- // break;
72
- // case 'bi':
73
- // module = await import(`react-icons/bi`);
74
- // break;
75
- // case 'ci':
76
- // module = await import(`react-icons/ci`);
77
- // break;
78
- // case 'cg':
79
- // module = await import(`react-icons/cg`);
80
- // break;
81
- // case 'di':
82
- // module = await import(`react-icons/di`);
83
- // break;
84
- // case 'fi':
85
- // module = await import(`react-icons/fi`);
86
- // break;
87
- // case 'fc':
88
- // module = await import(`react-icons/fc`);
89
- // break;
90
- // case 'fa':
91
- // module = await import(`react-icons/fa`);
92
- // break;
93
- // case 'fa6':
94
- // module = await import(`react-icons/fa6`);
95
- // break;
96
- // case 'gi':
97
- // module = await import(`react-icons/gi`);
98
- // break;
99
- // case 'go':
100
- // module = await import(`react-icons/go`);
101
- // break;
102
- // case 'gr':
103
- // module = await import(`react-icons/gr`);
104
- // break;
105
- // case 'hi':
106
- // module = await import(`react-icons/hi`);
107
- // break;
108
- // case 'hi2':
109
- // module = await import(`react-icons/hi2`);
110
- // break;
111
- // case 'im':
112
- // module = await import(`react-icons/im`);
113
- // break;
114
- // case 'lia':
115
- // module = await import(`react-icons/lia`);
116
- // break;
117
- // case 'io':
118
- // module = await import(`react-icons/io`);
119
- // break;
120
- // case 'io5':
121
- // module = await import(`react-icons/io5`);
122
- // break;
123
- // case 'lu':
124
- // module = await import(`react-icons/lu`);
125
- // break;
126
- // case 'md':
127
- // module = await import(`react-icons/md`);
128
- // break;
129
- // case 'pi':
130
- // module = await import(`react-icons/pi`);
131
- // break;
132
- // case 'rx':
133
- // module = await import(`react-icons/rx`);
134
- // break;
135
- // case 'ri':
136
- // module = await import(`react-icons/ri`);
137
- // break;
138
- // case 'si':
139
- // module = await import(`react-icons/si`);
140
- // break;
141
- // case 'sl':
142
- // module = await import(`react-icons/sl`);
143
- // break;
144
- // case 'tb':
145
- // module = await import(`react-icons/tb`);
146
- // break;
147
- // case 'tfi':
148
- // module = await import(`react-icons/tfi`);
149
- // break;
150
- // case 'ti':
151
- // module = await import(`react-icons/ti`);
152
- // break;
153
- // case 'vsc':
154
- // module = await import(`react-icons/vsc`);
155
- // break;
156
- // case 'wi':
157
- // module = await import(`react-icons/wi`);
158
- // break;
159
- // default:
160
- // module = await import(`react-icons/fa`);
161
- // }
162
- // return module.hasOwnProperty(iconName) ? { default: module[iconName] } : { default: () => {} };
163
- // }
164
- // return { default: () => {} };
165
- // });
166
-
167
- // return (
168
- // <Suspense fallback={<></>}>
169
- // {Icon && <Icon {...props} />}
170
- // </Suspense>
171
- // );
172
- // }
173
- // } catch (err) {
174
- // console.log(err);
175
- // }
176
-
177
- // return null;
178
- // };
179
-
180
57
  export var Header = function Header(props) {
181
58
  var _props$item;
182
59
  var classNames = 'static';
@@ -2036,15 +1913,15 @@ export var Checkboxes = /*#__PURE__*/function (_React$Component2) {
2036
1913
  props.disabled = 'disabled';
2037
1914
  }
2038
1915
  return /*#__PURE__*/React.createElement(Col, {
2039
- key: "container_".concat(name, "_").concat(option.value) + ID.uuid(),
1916
+ key: "container_".concat(name, "_").concat(option.value, "_").concat(index),
2040
1917
  xs: 12
2041
1918
  }, /*#__PURE__*/React.createElement(ToggleButton, _extends({
2042
1919
  type: "checkbox",
2043
1920
  label: option.text,
2044
1921
  variant: (_ref21 = (_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 && _ref21 !== void 0 ? _ref21 : "outline-light",
2045
1922
  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(props.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),
2046
- key: "preview_".concat(option.key) + ID.uuid(),
2047
- id: name + '-' + ID.uuid(),
1923
+ key: "preview_".concat(name, "_").concat(option.value, "_").concat(index, "_").concat(option.key),
1924
+ id: "".concat(name, "_").concat(option.value, "_").concat(index, "_").concat(option.key) + '-' + ID.uuid(),
2048
1925
  inputRef: function inputRef(c) {
2049
1926
  if (c && self.props.item.mutable) {
2050
1927
  self.options["child_ref_".concat(option.key)] = c;
@@ -2242,15 +2119,15 @@ export var RadioButtons = /*#__PURE__*/function (_React$Component4) {
2242
2119
  var checked = (self === null || self === void 0 || (_self$props18 = self.props) === null || _self$props18 === void 0 ? void 0 : _self$props18.value) === option.value;
2243
2120
  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);
2244
2121
  return /*#__PURE__*/React.createElement(Col, {
2245
- key: "container_".concat(name, "_").concat(option.value) + ID.uuid(),
2122
+ key: "container_".concat(name, "_").concat(option.value, "_").concat(index),
2246
2123
  xs: horizontal ? 6 : 12
2247
2124
  }, /*#__PURE__*/React.createElement(ToggleButton, {
2248
2125
  label: option.text,
2249
2126
  type: "radio",
2250
2127
  variant: (_ref25 = (_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 && _ref25 !== void 0 ? _ref25 : "outline-light",
2251
2128
  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),
2252
- key: "preview_".concat(option.key) + ID.uuid(),
2253
- id: name + '-' + ID.uuid(),
2129
+ key: "preview_".concat(name, "_").concat(option.value, "_").concat(index, "_").concat(option.key),
2130
+ id: "".concat(name, "_").concat(option.value, "_").concat(index, "_").concat(option.key) + '-' + ID.uuid(),
2254
2131
  inputRef: function inputRef(c) {
2255
2132
  if (c && self.props.item.mutable) {
2256
2133
  self.options["child_ref_".concat(option.key)] = c;
@@ -2410,15 +2287,15 @@ export var ButtonList = /*#__PURE__*/function (_React$Component5) {
2410
2287
  var checked = (self === null || self === void 0 || (_self$props47 = self.props) === null || _self$props47 === void 0 ? void 0 : _self$props47.value) === option.value;
2411
2288
  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);
2412
2289
  return /*#__PURE__*/React.createElement(Col, {
2413
- key: "container_".concat(name, "_").concat(option.value) + ID.uuid(),
2290
+ key: "container_".concat(name, "_").concat(option.value, "_").concat(index),
2414
2291
  xs: horizontal ? 6 : 12
2415
2292
  }, /*#__PURE__*/React.createElement(ToggleButton, {
2416
2293
  label: option.text,
2417
2294
  type: "radio",
2418
2295
  variant: (_ref27 = (_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 && _ref27 !== void 0 ? _ref27 : "outline-light",
2419
2296
  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),
2420
- key: "preview_".concat(option.key) + ID.uuid(),
2421
- id: name + '-' + ID.uuid(),
2297
+ key: "preview_".concat(name, "_").concat(option.value, "_").concat(index, "_").concat(option.key),
2298
+ id: "".concat(name, "_").concat(option.value, "_").concat(index, "_").concat(option.key) + '-' + ID.uuid(),
2422
2299
  inputRef: function inputRef(c) {
2423
2300
  if (c && self.props.item.mutable) {
2424
2301
  self.options["child_ref_".concat(option.key)] = c;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-survey-builder",
3
- "version": "1.0.124",
3
+ "version": "1.0.125",
4
4
  "description": "A complete survey builder for react.",
5
5
  "main": "lib/index.js",
6
6
  "types": "types/index.d.ts",