@bigbinary/neeto-form-frontend 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +165 -144
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +166 -145
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as React$2 from 'react';
|
|
|
3
3
|
import React__default, { useState, createElement, useRef, useEffect, forwardRef, useImperativeHandle, Fragment as Fragment$1, useReducer, useCallback, useMemo, createContext, useContext, useLayoutEffect } from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { useFormikContext, useField, FieldArray, Form as Form$3, Formik, Field, FastField } from 'formik';
|
|
6
|
-
import { filterNonNull, noop as noop$1, findBy, toLabelAndValue, isPresent as isPresent$1, truncate, slugify, filterBy, removeBy, isNotPresent, isNotEmpty, findById, notEqualsDeep } from '@bigbinary/neeto-cist';
|
|
6
|
+
import { filterNonNull, noop as noop$1, findBy, toLabelAndValue, isPresent as isPresent$1, truncate, slugify, filterBy, hyphenate, removeBy, isNotPresent, isNotEmpty, findById, notEqualsDeep } from '@bigbinary/neeto-cist';
|
|
7
7
|
import { buildUrl, showThumbsUpToastr, withEventTargetValue, getQueryParams, dateFormat } from '@bigbinary/neeto-commons-frontend/utils';
|
|
8
8
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
9
9
|
import { assoc, mergeLeft, compose, isEmpty, trim, useWith, path, split, isNotNil, either, isNil, values, equals, modify, prop, range, includes, __, reduce, reject, keys, pick, omit, pluck, without, difference, pipe as pipe$1, last, not, toLower, map, clamp as clamp$2, identity, filter as filter$1 } from 'ramda';
|
|
@@ -389,7 +389,7 @@ var RATING_VALUES = {
|
|
|
389
389
|
}
|
|
390
390
|
};
|
|
391
391
|
var SCHEMA_LESS_QUESTION_KINDS = [QUESTION_KIND.PARAGRAPH.value];
|
|
392
|
-
var RATING_OPTIONS = [{
|
|
392
|
+
var RATING_OPTIONS$1 = [{
|
|
393
393
|
icon: SvgHappyFace,
|
|
394
394
|
modifier: "happy",
|
|
395
395
|
value: RATING_VALUES.GOOD.value
|
|
@@ -906,6 +906,121 @@ var useBuildFormState = function useBuildFormState() {
|
|
|
906
906
|
return useBuildFormStore(prop("formState"));
|
|
907
907
|
};
|
|
908
908
|
|
|
909
|
+
var _excluded$c = ["size", "color"],
|
|
910
|
+
_excluded2 = ["size", "color"],
|
|
911
|
+
_excluded3 = ["size", "color"],
|
|
912
|
+
_excluded4 = ["size", "color"];
|
|
913
|
+
function ownKeys$y(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; }
|
|
914
|
+
function _objectSpread$y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$y(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
915
|
+
var BadSmiley = function BadSmiley(props) {
|
|
916
|
+
var size = props.size,
|
|
917
|
+
color = props.color,
|
|
918
|
+
other = _objectWithoutProperties$1(props, _excluded$c);
|
|
919
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$y(_objectSpread$y({
|
|
920
|
+
fill: "none",
|
|
921
|
+
height: size,
|
|
922
|
+
viewBox: "0 0 48 48",
|
|
923
|
+
width: size
|
|
924
|
+
}, other), {}, {
|
|
925
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
926
|
+
d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24c13.234 0 24-10.767 24-24S37.234 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.082 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
|
|
927
|
+
fill: color
|
|
928
|
+
}), /*#__PURE__*/jsx("path", {
|
|
929
|
+
d: "M18.783 19.826a3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.131 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13zm-4.174 0c0-.575.468-1.044 1.043-1.044s1.044.469 1.044 1.044c0 .575-.469 1.043-1.044 1.043a1.045 1.045 0 01-1.043-1.043zm17.739-3.13a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.173a1.045 1.045 0 010-2.087 1.045 1.045 0 010 2.087zM24 29.218a13.677 13.677 0 00-10.168 4.52 1.043 1.043 0 101.553 1.394A11.587 11.587 0 0124 31.305c3.3 0 6.44 1.394 8.614 3.826a1.045 1.045 0 001.473.082 1.044 1.044 0 00.082-1.473c-2.57-2.874-6.277-4.523-10.169-4.523z",
|
|
930
|
+
fill: color
|
|
931
|
+
})]
|
|
932
|
+
}));
|
|
933
|
+
};
|
|
934
|
+
BadSmiley.defaultProps = {
|
|
935
|
+
color: "currentColor",
|
|
936
|
+
size: 24,
|
|
937
|
+
strokeWidth: "1.5"
|
|
938
|
+
};
|
|
939
|
+
var OkaySmiley = function OkaySmiley(props) {
|
|
940
|
+
var size = props.size,
|
|
941
|
+
color = props.color,
|
|
942
|
+
other = _objectWithoutProperties$1(props, _excluded2);
|
|
943
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$y(_objectSpread$y({
|
|
944
|
+
fill: "none",
|
|
945
|
+
height: size,
|
|
946
|
+
viewBox: "0 0 48 48",
|
|
947
|
+
width: size
|
|
948
|
+
}, other), {}, {
|
|
949
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
950
|
+
d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24 24-10.767 24-24S37.233 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.084 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
|
|
951
|
+
fill: color
|
|
952
|
+
}), /*#__PURE__*/jsx("path", {
|
|
953
|
+
d: "M15.652 22.956a3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13zm0-4.174c.575 0 1.044.469 1.044 1.044 0 .575-.469 1.043-1.044 1.043a1.045 1.045 0 01-1.043-1.043c0-.575.468-1.044 1.043-1.044zm16.696-2.086a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.173a1.045 1.045 0 01-1.044-1.043c0-.575.469-1.044 1.044-1.044a1.044 1.044 0 010 2.087zm2.087 8.349h-20.87a1.044 1.044 0 000 2.086h20.87a1.044 1.044 0 000-2.086z",
|
|
954
|
+
fill: color
|
|
955
|
+
})]
|
|
956
|
+
}));
|
|
957
|
+
};
|
|
958
|
+
OkaySmiley.defaultProps = {
|
|
959
|
+
color: "currentColor",
|
|
960
|
+
size: 24,
|
|
961
|
+
strokeWidth: "1.5"
|
|
962
|
+
};
|
|
963
|
+
var GoodSmiley = function GoodSmiley(props) {
|
|
964
|
+
var size = props.size,
|
|
965
|
+
color = props.color,
|
|
966
|
+
other = _objectWithoutProperties$1(props, _excluded3);
|
|
967
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$y(_objectSpread$y({
|
|
968
|
+
fill: "none",
|
|
969
|
+
height: size,
|
|
970
|
+
viewBox: "0 0 48 48",
|
|
971
|
+
width: size
|
|
972
|
+
}, other), {}, {
|
|
973
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
974
|
+
d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24 24-10.767 24-24S37.233 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.084 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
|
|
975
|
+
fill: color
|
|
976
|
+
}), /*#__PURE__*/jsx("path", {
|
|
977
|
+
d: "M18.783 19.826a3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.131 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13zm-4.174 0a1.044 1.044 0 012.087 0c0 .575-.469 1.044-1.044 1.044a1.045 1.045 0 01-1.043-1.044zm17.739-3.13a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.174a1.045 1.045 0 01-1.044-1.044 1.044 1.044 0 111.044 1.044zm.265 8.695c-2.175 2.432-5.314 3.826-8.613 3.826a11.59 11.59 0 01-8.615-3.827 1.043 1.043 0 10-1.553 1.394A13.677 13.677 0 0024 35.478c3.892 0 7.599-1.648 10.17-4.521a1.043 1.043 0 10-1.557-1.392z",
|
|
978
|
+
fill: color
|
|
979
|
+
})]
|
|
980
|
+
}));
|
|
981
|
+
};
|
|
982
|
+
GoodSmiley.defaultProps = {
|
|
983
|
+
color: "currentColor",
|
|
984
|
+
size: 24,
|
|
985
|
+
strokeWidth: "1.5"
|
|
986
|
+
};
|
|
987
|
+
var Drag = function Drag(props) {
|
|
988
|
+
var size = props.size,
|
|
989
|
+
color = props.color,
|
|
990
|
+
other = _objectWithoutProperties$1(props, _excluded4);
|
|
991
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread$y(_objectSpread$y({
|
|
992
|
+
fill: "none",
|
|
993
|
+
height: size,
|
|
994
|
+
viewBox: "0 0 24 24",
|
|
995
|
+
width: size
|
|
996
|
+
}, other), {}, {
|
|
997
|
+
children: [/*#__PURE__*/jsx("g", {
|
|
998
|
+
clipPath: "url(#clip0_6290_43)",
|
|
999
|
+
fill: color,
|
|
1000
|
+
stroke: color,
|
|
1001
|
+
strokeLinecap: "round",
|
|
1002
|
+
strokeLinejoin: "round",
|
|
1003
|
+
strokeWidth: "1.5",
|
|
1004
|
+
children: /*#__PURE__*/jsx("path", {
|
|
1005
|
+
d: "M8 12a1 1 0 102 0 1 1 0 00-2 0zM8 18a1 1 0 102 0 1 1 0 00-2 0zM8 6a1 1 0 102 0 1 1 0 00-2 0zM14 12a1 1 0 102 0 1 1 0 00-2 0zM14 18a1 1 0 102 0 1 1 0 00-2 0zM14 6a1 1 0 102 0 1 1 0 00-2 0z"
|
|
1006
|
+
})
|
|
1007
|
+
}), /*#__PURE__*/jsx("defs", {
|
|
1008
|
+
children: /*#__PURE__*/jsx("clipPath", {
|
|
1009
|
+
id: "clip0_6290_43",
|
|
1010
|
+
children: /*#__PURE__*/jsx("path", {
|
|
1011
|
+
d: "M0 0H24V24H0z",
|
|
1012
|
+
fill: color
|
|
1013
|
+
})
|
|
1014
|
+
})
|
|
1015
|
+
})]
|
|
1016
|
+
}));
|
|
1017
|
+
};
|
|
1018
|
+
Drag.defaultProps = {
|
|
1019
|
+
color: "currentColor",
|
|
1020
|
+
size: 24,
|
|
1021
|
+
strokeWidth: "1.5"
|
|
1022
|
+
};
|
|
1023
|
+
|
|
909
1024
|
var getActiveQuestionKindDetails = function getActiveQuestionKindDetails(_ref) {
|
|
910
1025
|
var allQuestionKinds = _ref.allQuestionKinds,
|
|
911
1026
|
item = _ref.item;
|
|
@@ -962,6 +1077,19 @@ var FILE_GROUPS = [{
|
|
|
962
1077
|
label: t$3("neetoForm.fileTypes.audioVideo"),
|
|
963
1078
|
name: FILE_TYPES.AUDIO_VIDEO
|
|
964
1079
|
}];
|
|
1080
|
+
var RATING_OPTIONS = [{
|
|
1081
|
+
icon: GoodSmiley,
|
|
1082
|
+
name: "highestRatingLabel",
|
|
1083
|
+
color: "#00ba88"
|
|
1084
|
+
}, {
|
|
1085
|
+
icon: OkaySmiley,
|
|
1086
|
+
name: "averageRatingLabel",
|
|
1087
|
+
color: "#f3cd82"
|
|
1088
|
+
}, {
|
|
1089
|
+
icon: BadSmiley,
|
|
1090
|
+
name: "lowestRatingLabel",
|
|
1091
|
+
color: "#f56a58"
|
|
1092
|
+
}];
|
|
965
1093
|
|
|
966
1094
|
var NAME$1 = QUESTION_TYPES.NAME,
|
|
967
1095
|
PHONE$1 = QUESTION_TYPES.PHONE,
|
|
@@ -1320,121 +1448,6 @@ var Overview = function Overview(_ref) {
|
|
|
1320
1448
|
});
|
|
1321
1449
|
};
|
|
1322
1450
|
|
|
1323
|
-
var _excluded$c = ["size", "color"],
|
|
1324
|
-
_excluded2 = ["size", "color"],
|
|
1325
|
-
_excluded3 = ["size", "color"],
|
|
1326
|
-
_excluded4 = ["size", "color"];
|
|
1327
|
-
function ownKeys$y(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; }
|
|
1328
|
-
function _objectSpread$y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$y(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1329
|
-
var BadSmiley = function BadSmiley(props) {
|
|
1330
|
-
var size = props.size,
|
|
1331
|
-
color = props.color,
|
|
1332
|
-
other = _objectWithoutProperties$1(props, _excluded$c);
|
|
1333
|
-
return /*#__PURE__*/jsxs("svg", _objectSpread$y(_objectSpread$y({
|
|
1334
|
-
fill: "none",
|
|
1335
|
-
height: size,
|
|
1336
|
-
viewBox: "0 0 48 48",
|
|
1337
|
-
width: size
|
|
1338
|
-
}, other), {}, {
|
|
1339
|
-
children: [/*#__PURE__*/jsx("path", {
|
|
1340
|
-
d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24c13.234 0 24-10.767 24-24S37.234 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.082 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
|
|
1341
|
-
fill: color
|
|
1342
|
-
}), /*#__PURE__*/jsx("path", {
|
|
1343
|
-
d: "M18.783 19.826a3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.131 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13zm-4.174 0c0-.575.468-1.044 1.043-1.044s1.044.469 1.044 1.044c0 .575-.469 1.043-1.044 1.043a1.045 1.045 0 01-1.043-1.043zm17.739-3.13a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.173a1.045 1.045 0 010-2.087 1.045 1.045 0 010 2.087zM24 29.218a13.677 13.677 0 00-10.168 4.52 1.043 1.043 0 101.553 1.394A11.587 11.587 0 0124 31.305c3.3 0 6.44 1.394 8.614 3.826a1.045 1.045 0 001.473.082 1.044 1.044 0 00.082-1.473c-2.57-2.874-6.277-4.523-10.169-4.523z",
|
|
1344
|
-
fill: color
|
|
1345
|
-
})]
|
|
1346
|
-
}));
|
|
1347
|
-
};
|
|
1348
|
-
BadSmiley.defaultProps = {
|
|
1349
|
-
color: "currentColor",
|
|
1350
|
-
size: 24,
|
|
1351
|
-
strokeWidth: "1.5"
|
|
1352
|
-
};
|
|
1353
|
-
var OkaySmiley = function OkaySmiley(props) {
|
|
1354
|
-
var size = props.size,
|
|
1355
|
-
color = props.color,
|
|
1356
|
-
other = _objectWithoutProperties$1(props, _excluded2);
|
|
1357
|
-
return /*#__PURE__*/jsxs("svg", _objectSpread$y(_objectSpread$y({
|
|
1358
|
-
fill: "none",
|
|
1359
|
-
height: size,
|
|
1360
|
-
viewBox: "0 0 48 48",
|
|
1361
|
-
width: size
|
|
1362
|
-
}, other), {}, {
|
|
1363
|
-
children: [/*#__PURE__*/jsx("path", {
|
|
1364
|
-
d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24 24-10.767 24-24S37.233 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.084 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
|
|
1365
|
-
fill: color
|
|
1366
|
-
}), /*#__PURE__*/jsx("path", {
|
|
1367
|
-
d: "M15.652 22.956a3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13zm0-4.174c.575 0 1.044.469 1.044 1.044 0 .575-.469 1.043-1.044 1.043a1.045 1.045 0 01-1.043-1.043c0-.575.468-1.044 1.043-1.044zm16.696-2.086a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.173a1.045 1.045 0 01-1.044-1.043c0-.575.469-1.044 1.044-1.044a1.044 1.044 0 010 2.087zm2.087 8.349h-20.87a1.044 1.044 0 000 2.086h20.87a1.044 1.044 0 000-2.086z",
|
|
1368
|
-
fill: color
|
|
1369
|
-
})]
|
|
1370
|
-
}));
|
|
1371
|
-
};
|
|
1372
|
-
OkaySmiley.defaultProps = {
|
|
1373
|
-
color: "currentColor",
|
|
1374
|
-
size: 24,
|
|
1375
|
-
strokeWidth: "1.5"
|
|
1376
|
-
};
|
|
1377
|
-
var GoodSmiley = function GoodSmiley(props) {
|
|
1378
|
-
var size = props.size,
|
|
1379
|
-
color = props.color,
|
|
1380
|
-
other = _objectWithoutProperties$1(props, _excluded3);
|
|
1381
|
-
return /*#__PURE__*/jsxs("svg", _objectSpread$y(_objectSpread$y({
|
|
1382
|
-
fill: "none",
|
|
1383
|
-
height: size,
|
|
1384
|
-
viewBox: "0 0 48 48",
|
|
1385
|
-
width: size
|
|
1386
|
-
}, other), {}, {
|
|
1387
|
-
children: [/*#__PURE__*/jsx("path", {
|
|
1388
|
-
d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24 24-10.767 24-24S37.233 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.084 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
|
|
1389
|
-
fill: color
|
|
1390
|
-
}), /*#__PURE__*/jsx("path", {
|
|
1391
|
-
d: "M18.783 19.826a3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.131 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13zm-4.174 0a1.044 1.044 0 012.087 0c0 .575-.469 1.044-1.044 1.044a1.045 1.045 0 01-1.043-1.044zm17.739-3.13a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.174a1.045 1.045 0 01-1.044-1.044 1.044 1.044 0 111.044 1.044zm.265 8.695c-2.175 2.432-5.314 3.826-8.613 3.826a11.59 11.59 0 01-8.615-3.827 1.043 1.043 0 10-1.553 1.394A13.677 13.677 0 0024 35.478c3.892 0 7.599-1.648 10.17-4.521a1.043 1.043 0 10-1.557-1.392z",
|
|
1392
|
-
fill: color
|
|
1393
|
-
})]
|
|
1394
|
-
}));
|
|
1395
|
-
};
|
|
1396
|
-
GoodSmiley.defaultProps = {
|
|
1397
|
-
color: "currentColor",
|
|
1398
|
-
size: 24,
|
|
1399
|
-
strokeWidth: "1.5"
|
|
1400
|
-
};
|
|
1401
|
-
var Drag = function Drag(props) {
|
|
1402
|
-
var size = props.size,
|
|
1403
|
-
color = props.color,
|
|
1404
|
-
other = _objectWithoutProperties$1(props, _excluded4);
|
|
1405
|
-
return /*#__PURE__*/jsxs("svg", _objectSpread$y(_objectSpread$y({
|
|
1406
|
-
fill: "none",
|
|
1407
|
-
height: size,
|
|
1408
|
-
viewBox: "0 0 24 24",
|
|
1409
|
-
width: size
|
|
1410
|
-
}, other), {}, {
|
|
1411
|
-
children: [/*#__PURE__*/jsx("g", {
|
|
1412
|
-
clipPath: "url(#clip0_6290_43)",
|
|
1413
|
-
fill: color,
|
|
1414
|
-
stroke: color,
|
|
1415
|
-
strokeLinecap: "round",
|
|
1416
|
-
strokeLinejoin: "round",
|
|
1417
|
-
strokeWidth: "1.5",
|
|
1418
|
-
children: /*#__PURE__*/jsx("path", {
|
|
1419
|
-
d: "M8 12a1 1 0 102 0 1 1 0 00-2 0zM8 18a1 1 0 102 0 1 1 0 00-2 0zM8 6a1 1 0 102 0 1 1 0 00-2 0zM14 12a1 1 0 102 0 1 1 0 00-2 0zM14 18a1 1 0 102 0 1 1 0 00-2 0zM14 6a1 1 0 102 0 1 1 0 00-2 0z"
|
|
1420
|
-
})
|
|
1421
|
-
}), /*#__PURE__*/jsx("defs", {
|
|
1422
|
-
children: /*#__PURE__*/jsx("clipPath", {
|
|
1423
|
-
id: "clip0_6290_43",
|
|
1424
|
-
children: /*#__PURE__*/jsx("path", {
|
|
1425
|
-
d: "M0 0H24V24H0z",
|
|
1426
|
-
fill: color
|
|
1427
|
-
})
|
|
1428
|
-
})
|
|
1429
|
-
})]
|
|
1430
|
-
}));
|
|
1431
|
-
};
|
|
1432
|
-
Drag.defaultProps = {
|
|
1433
|
-
color: "currentColor",
|
|
1434
|
-
size: 24,
|
|
1435
|
-
strokeWidth: "1.5"
|
|
1436
|
-
};
|
|
1437
|
-
|
|
1438
1451
|
var validateEditorContent = function validateEditorContent(editorRef) {
|
|
1439
1452
|
return function () {
|
|
1440
1453
|
var _editorRef$current;
|
|
@@ -2080,19 +2093,28 @@ var Form$1 = function Form(_ref) {
|
|
|
2080
2093
|
var shouldShowPlaceholder = includes(kind, QUESTIONS_WITH_PLACEHOLDERS);
|
|
2081
2094
|
var hasAdditionalData = includes(kind, QUESTIONS_WITH_ADDITIONAL_DATA);
|
|
2082
2095
|
var shouldShowFieldCode = enableFieldCode && !includes(kind, QUESTIONS_WITHOUT_FIELD_CODE);
|
|
2083
|
-
var handleKindChange = function handleKindChange(
|
|
2084
|
-
var
|
|
2085
|
-
|
|
2096
|
+
var handleKindChange = function handleKindChange(option) {
|
|
2097
|
+
var data = buildQuestionData(option);
|
|
2098
|
+
updateFormState(data);
|
|
2099
|
+
};
|
|
2100
|
+
var buildQuestionData = function buildQuestionData(option) {
|
|
2101
|
+
if (isNil(option)) {
|
|
2102
|
+
return INITIAL_VALUES;
|
|
2103
|
+
}
|
|
2104
|
+
var label = option.label,
|
|
2105
|
+
value = option.value;
|
|
2086
2106
|
var kind = extractKindFromOption(value);
|
|
2087
2107
|
var questionKind = getQuestionKind(availableQuestionKinds, {
|
|
2088
2108
|
type: kind,
|
|
2089
2109
|
label: label
|
|
2090
2110
|
});
|
|
2091
|
-
|
|
2111
|
+
return createFieldData({
|
|
2092
2112
|
kind: questionKind,
|
|
2093
2113
|
isRequired: isRequired,
|
|
2094
2114
|
questions: questions
|
|
2095
2115
|
});
|
|
2116
|
+
};
|
|
2117
|
+
var updateFormState = function updateFormState(data) {
|
|
2096
2118
|
setValues(data);
|
|
2097
2119
|
setErrors({});
|
|
2098
2120
|
setTouched({});
|
|
@@ -2340,6 +2362,7 @@ var FileGroup = function FileGroup(_ref) {
|
|
|
2340
2362
|
checked: checked,
|
|
2341
2363
|
label: label,
|
|
2342
2364
|
name: name,
|
|
2365
|
+
"data-cy": "neeto-form-engine-file-type-".concat(name),
|
|
2343
2366
|
id: name,
|
|
2344
2367
|
onChange: handleAllowedFileTypesChange
|
|
2345
2368
|
});
|
|
@@ -2518,6 +2541,7 @@ var Options = function Options(_ref) {
|
|
|
2518
2541
|
var _option$id;
|
|
2519
2542
|
return !option._destroy && /*#__PURE__*/jsxs("div", {
|
|
2520
2543
|
className: "flex items-start gap-1",
|
|
2544
|
+
"data-cy": "neeto-form-engine-option-".concat(index),
|
|
2521
2545
|
children: [/*#__PURE__*/jsx(InputWithMaxLength, {
|
|
2522
2546
|
required: true,
|
|
2523
2547
|
disabled: freezeOptions,
|
|
@@ -2546,6 +2570,7 @@ var Options = function Options(_ref) {
|
|
|
2546
2570
|
}), !freezeOptions && /*#__PURE__*/jsx("div", {
|
|
2547
2571
|
className: "mt-3 w-full",
|
|
2548
2572
|
children: /*#__PURE__*/jsx(Button$1, {
|
|
2573
|
+
"data-cy": "neeto-form-engine-add-option-button",
|
|
2549
2574
|
icon: Plus,
|
|
2550
2575
|
iconPosition: "left",
|
|
2551
2576
|
size: "small",
|
|
@@ -2574,30 +2599,22 @@ var Rating$2 = function Rating() {
|
|
|
2574
2599
|
className: "flex flex-col",
|
|
2575
2600
|
children: /*#__PURE__*/jsx("div", {
|
|
2576
2601
|
className: "w-full",
|
|
2577
|
-
children: /*#__PURE__*/
|
|
2602
|
+
children: /*#__PURE__*/jsx("div", {
|
|
2578
2603
|
className: "flex gap-6",
|
|
2579
|
-
children:
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
}), /*#__PURE__*/jsxs(RatingItem, {
|
|
2594
|
-
children: [/*#__PURE__*/jsx(BadSmiley, {
|
|
2595
|
-
color: "#f56a58",
|
|
2596
|
-
size: 48
|
|
2597
|
-
}), /*#__PURE__*/jsx(InputWithMaxLength, {
|
|
2598
|
-
name: "lowestRatingLabel"
|
|
2599
|
-
})]
|
|
2600
|
-
})]
|
|
2604
|
+
children: RATING_OPTIONS.map(function (_ref2) {
|
|
2605
|
+
var Icon = _ref2.icon,
|
|
2606
|
+
name = _ref2.name,
|
|
2607
|
+
color = _ref2.color;
|
|
2608
|
+
return /*#__PURE__*/jsxs(RatingItem, {
|
|
2609
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
2610
|
+
color: color,
|
|
2611
|
+
size: 48
|
|
2612
|
+
}), /*#__PURE__*/jsx(InputWithMaxLength, {
|
|
2613
|
+
name: name,
|
|
2614
|
+
"data-cy": "neeto-form-engine-".concat(hyphenate(name))
|
|
2615
|
+
})]
|
|
2616
|
+
}, name);
|
|
2617
|
+
})
|
|
2601
2618
|
})
|
|
2602
2619
|
})
|
|
2603
2620
|
});
|
|
@@ -2618,6 +2635,7 @@ var StarRating$2 = function StarRating() {
|
|
|
2618
2635
|
className: "flex space-x-4",
|
|
2619
2636
|
children: [/*#__PURE__*/jsx(Select, {
|
|
2620
2637
|
className: "w-1/2",
|
|
2638
|
+
"data-cy": "neeto-form-engine-star-rating-min-value",
|
|
2621
2639
|
label: t("neetoForm.common.start"),
|
|
2622
2640
|
name: "minValue",
|
|
2623
2641
|
options: STAR_RATING_MIN_VALUE_OPTIONS,
|
|
@@ -2626,6 +2644,7 @@ var StarRating$2 = function StarRating() {
|
|
|
2626
2644
|
}
|
|
2627
2645
|
}), /*#__PURE__*/jsx(Select, {
|
|
2628
2646
|
className: "w-1/2",
|
|
2647
|
+
"data-cy": "neeto-form-engine-star-rating-max-value",
|
|
2629
2648
|
label: t("neetoForm.common.end"),
|
|
2630
2649
|
name: "maxValue",
|
|
2631
2650
|
options: STAR_RATING_MAX_VALUE_OPTIONS,
|
|
@@ -2643,6 +2662,7 @@ var StarRating$2 = function StarRating() {
|
|
|
2643
2662
|
IconType = _ref2[1];
|
|
2644
2663
|
var isActive = name === iconType;
|
|
2645
2664
|
return /*#__PURE__*/jsx("div", {
|
|
2665
|
+
"data-cy": "neeto-form-engine-rating-icon-".concat(name),
|
|
2646
2666
|
className: classnames("flex h-10 w-10 items-center justify-center gap-2", "neeto-ui-border-gray-800 neeto-ui-rounded-full cursor-pointer border", "transition-all duration-300 ease-in-out", {
|
|
2647
2667
|
"neeto-ui-text-gray-800 neeto-ui-bg-gray-200": !isActive,
|
|
2648
2668
|
"neeto-ui-text-white neeto-ui-bg-gray-800": isActive
|
|
@@ -2752,6 +2772,7 @@ var AddQuestion = withT(function (_ref) {
|
|
|
2752
2772
|
content: (disabledAddButtonTooltipProps === null || disabledAddButtonTooltipProps === void 0 ? void 0 : disabledAddButtonTooltipProps.content) || t("neetoForm.questions.common.primaryPanel.noQuestionLeft"),
|
|
2753
2773
|
children: /*#__PURE__*/jsx("span", {
|
|
2754
2774
|
children: /*#__PURE__*/jsx(Button$1, {
|
|
2775
|
+
"data-cy": "neeto-form-engine-add-question",
|
|
2755
2776
|
disabled: isDisabled,
|
|
2756
2777
|
icon: Plus,
|
|
2757
2778
|
iconPosition: "left",
|
|
@@ -13581,7 +13602,7 @@ var Rating = function Rating(_ref) {
|
|
|
13581
13602
|
};
|
|
13582
13603
|
var render = function render() {
|
|
13583
13604
|
var labels = [highestRatingLabel, averageRatingLabel, lowestRatingLabel];
|
|
13584
|
-
return RATING_OPTIONS.map(function (_ref2, index) {
|
|
13605
|
+
return RATING_OPTIONS$1.map(function (_ref2, index) {
|
|
13585
13606
|
var Icon = _ref2.icon,
|
|
13586
13607
|
modifier = _ref2.modifier,
|
|
13587
13608
|
rating = _ref2.value;
|