@bigbinary/neeto-form-frontend 2.2.0-beta1 → 2.2.0-beta2

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 CHANGED
@@ -37,12 +37,13 @@ var Form$2 = require('@bigbinary/neetoui/formik/Form');
37
37
  var Select = require('@bigbinary/neetoui/formik/Select');
38
38
  var Textarea = require('@bigbinary/neetoui/formik/Textarea');
39
39
  var Switch = require('@bigbinary/neetoui/formik/Switch');
40
- var neetoIcons = require('@bigbinary/neeto-icons');
41
40
  var Button$1 = require('@bigbinary/neetoui/Button');
41
+ var Accordion = require('@bigbinary/neetoui/Accordion');
42
42
  var Input = require('@bigbinary/neetoui/formik/Input');
43
43
  var yup = require('yup');
44
44
  var Checkbox$1 = require('@bigbinary/neetoui/formik/Checkbox');
45
45
  var Checkbox = require('@bigbinary/neetoui/Checkbox');
46
+ var neetoIcons = require('@bigbinary/neeto-icons');
46
47
  var Label = require('@bigbinary/neetoui/Label');
47
48
  var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
48
49
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
@@ -109,6 +110,7 @@ var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
109
110
  var Textarea__default = /*#__PURE__*/_interopDefaultLegacy(Textarea);
110
111
  var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
111
112
  var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button$1);
113
+ var Accordion__default = /*#__PURE__*/_interopDefaultLegacy(Accordion);
112
114
  var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input);
113
115
  var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
114
116
  var Checkbox__default$1 = /*#__PURE__*/_interopDefaultLegacy(Checkbox$1);
@@ -458,7 +460,7 @@ var RATING_VALUES = {
458
460
  }
459
461
  };
460
462
  var SCHEMA_LESS_QUESTION_KINDS = [QUESTION_KIND.PARAGRAPH.value];
461
- var RATING_OPTIONS = [{
463
+ var RATING_OPTIONS$1 = [{
462
464
  icon: SvgHappyFace,
463
465
  modifier: "happy",
464
466
  value: RATING_VALUES.GOOD.value
@@ -1020,6 +1022,121 @@ var useBuildFormState = function useBuildFormState() {
1020
1022
  return useBuildFormStore(ramda.prop("formState"));
1021
1023
  };
1022
1024
 
1025
+ var _excluded$c = ["size", "color"],
1026
+ _excluded2 = ["size", "color"],
1027
+ _excluded3 = ["size", "color"],
1028
+ _excluded4 = ["size", "color"];
1029
+ 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; }
1030
+ 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__default["default"](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; }
1031
+ var BadSmiley = function BadSmiley(props) {
1032
+ var size = props.size,
1033
+ color = props.color,
1034
+ other = _objectWithoutProperties__default["default"](props, _excluded$c);
1035
+ return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$y(_objectSpread$y({
1036
+ fill: "none",
1037
+ height: size,
1038
+ viewBox: "0 0 48 48",
1039
+ width: size
1040
+ }, other), {}, {
1041
+ children: [/*#__PURE__*/jsxRuntime.jsx("path", {
1042
+ 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",
1043
+ fill: color
1044
+ }), /*#__PURE__*/jsxRuntime.jsx("path", {
1045
+ 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",
1046
+ fill: color
1047
+ })]
1048
+ }));
1049
+ };
1050
+ BadSmiley.defaultProps = {
1051
+ color: "currentColor",
1052
+ size: 24,
1053
+ strokeWidth: "1.5"
1054
+ };
1055
+ var OkaySmiley = function OkaySmiley(props) {
1056
+ var size = props.size,
1057
+ color = props.color,
1058
+ other = _objectWithoutProperties__default["default"](props, _excluded2);
1059
+ return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$y(_objectSpread$y({
1060
+ fill: "none",
1061
+ height: size,
1062
+ viewBox: "0 0 48 48",
1063
+ width: size
1064
+ }, other), {}, {
1065
+ children: [/*#__PURE__*/jsxRuntime.jsx("path", {
1066
+ 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",
1067
+ fill: color
1068
+ }), /*#__PURE__*/jsxRuntime.jsx("path", {
1069
+ 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",
1070
+ fill: color
1071
+ })]
1072
+ }));
1073
+ };
1074
+ OkaySmiley.defaultProps = {
1075
+ color: "currentColor",
1076
+ size: 24,
1077
+ strokeWidth: "1.5"
1078
+ };
1079
+ var GoodSmiley = function GoodSmiley(props) {
1080
+ var size = props.size,
1081
+ color = props.color,
1082
+ other = _objectWithoutProperties__default["default"](props, _excluded3);
1083
+ return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$y(_objectSpread$y({
1084
+ fill: "none",
1085
+ height: size,
1086
+ viewBox: "0 0 48 48",
1087
+ width: size
1088
+ }, other), {}, {
1089
+ children: [/*#__PURE__*/jsxRuntime.jsx("path", {
1090
+ 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",
1091
+ fill: color
1092
+ }), /*#__PURE__*/jsxRuntime.jsx("path", {
1093
+ 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",
1094
+ fill: color
1095
+ })]
1096
+ }));
1097
+ };
1098
+ GoodSmiley.defaultProps = {
1099
+ color: "currentColor",
1100
+ size: 24,
1101
+ strokeWidth: "1.5"
1102
+ };
1103
+ var Drag = function Drag(props) {
1104
+ var size = props.size,
1105
+ color = props.color,
1106
+ other = _objectWithoutProperties__default["default"](props, _excluded4);
1107
+ return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$y(_objectSpread$y({
1108
+ fill: "none",
1109
+ height: size,
1110
+ viewBox: "0 0 24 24",
1111
+ width: size
1112
+ }, other), {}, {
1113
+ children: [/*#__PURE__*/jsxRuntime.jsx("g", {
1114
+ clipPath: "url(#clip0_6290_43)",
1115
+ fill: color,
1116
+ stroke: color,
1117
+ strokeLinecap: "round",
1118
+ strokeLinejoin: "round",
1119
+ strokeWidth: "1.5",
1120
+ children: /*#__PURE__*/jsxRuntime.jsx("path", {
1121
+ 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"
1122
+ })
1123
+ }), /*#__PURE__*/jsxRuntime.jsx("defs", {
1124
+ children: /*#__PURE__*/jsxRuntime.jsx("clipPath", {
1125
+ id: "clip0_6290_43",
1126
+ children: /*#__PURE__*/jsxRuntime.jsx("path", {
1127
+ d: "M0 0H24V24H0z",
1128
+ fill: color
1129
+ })
1130
+ })
1131
+ })]
1132
+ }));
1133
+ };
1134
+ Drag.defaultProps = {
1135
+ color: "currentColor",
1136
+ size: 24,
1137
+ strokeWidth: "1.5"
1138
+ };
1139
+
1023
1140
  var getActiveQuestionKindDetails = function getActiveQuestionKindDetails(_ref) {
1024
1141
  var allQuestionKinds = _ref.allQuestionKinds,
1025
1142
  item = _ref.item;
@@ -1076,6 +1193,19 @@ var FILE_GROUPS = [{
1076
1193
  label: i18next.t("neetoForm.fileTypes.audioVideo"),
1077
1194
  name: FILE_TYPES.AUDIO_VIDEO
1078
1195
  }];
1196
+ var RATING_OPTIONS = [{
1197
+ icon: GoodSmiley,
1198
+ name: "highestRatingLabel",
1199
+ color: "#00ba88"
1200
+ }, {
1201
+ icon: OkaySmiley,
1202
+ name: "averageRatingLabel",
1203
+ color: "#f3cd82"
1204
+ }, {
1205
+ icon: BadSmiley,
1206
+ name: "lowestRatingLabel",
1207
+ color: "#f56a58"
1208
+ }];
1079
1209
 
1080
1210
  var NAME$1 = QUESTION_TYPES.NAME,
1081
1211
  PHONE$1 = QUESTION_TYPES.PHONE,
@@ -1434,121 +1564,6 @@ var Overview = function Overview(_ref) {
1434
1564
  });
1435
1565
  };
1436
1566
 
1437
- var _excluded$c = ["size", "color"],
1438
- _excluded2 = ["size", "color"],
1439
- _excluded3 = ["size", "color"],
1440
- _excluded4 = ["size", "color"];
1441
- 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; }
1442
- 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__default["default"](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; }
1443
- var BadSmiley = function BadSmiley(props) {
1444
- var size = props.size,
1445
- color = props.color,
1446
- other = _objectWithoutProperties__default["default"](props, _excluded$c);
1447
- return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$y(_objectSpread$y({
1448
- fill: "none",
1449
- height: size,
1450
- viewBox: "0 0 48 48",
1451
- width: size
1452
- }, other), {}, {
1453
- children: [/*#__PURE__*/jsxRuntime.jsx("path", {
1454
- 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",
1455
- fill: color
1456
- }), /*#__PURE__*/jsxRuntime.jsx("path", {
1457
- 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",
1458
- fill: color
1459
- })]
1460
- }));
1461
- };
1462
- BadSmiley.defaultProps = {
1463
- color: "currentColor",
1464
- size: 24,
1465
- strokeWidth: "1.5"
1466
- };
1467
- var OkaySmiley = function OkaySmiley(props) {
1468
- var size = props.size,
1469
- color = props.color,
1470
- other = _objectWithoutProperties__default["default"](props, _excluded2);
1471
- return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$y(_objectSpread$y({
1472
- fill: "none",
1473
- height: size,
1474
- viewBox: "0 0 48 48",
1475
- width: size
1476
- }, other), {}, {
1477
- children: [/*#__PURE__*/jsxRuntime.jsx("path", {
1478
- 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",
1479
- fill: color
1480
- }), /*#__PURE__*/jsxRuntime.jsx("path", {
1481
- 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",
1482
- fill: color
1483
- })]
1484
- }));
1485
- };
1486
- OkaySmiley.defaultProps = {
1487
- color: "currentColor",
1488
- size: 24,
1489
- strokeWidth: "1.5"
1490
- };
1491
- var GoodSmiley = function GoodSmiley(props) {
1492
- var size = props.size,
1493
- color = props.color,
1494
- other = _objectWithoutProperties__default["default"](props, _excluded3);
1495
- return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$y(_objectSpread$y({
1496
- fill: "none",
1497
- height: size,
1498
- viewBox: "0 0 48 48",
1499
- width: size
1500
- }, other), {}, {
1501
- children: [/*#__PURE__*/jsxRuntime.jsx("path", {
1502
- 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",
1503
- fill: color
1504
- }), /*#__PURE__*/jsxRuntime.jsx("path", {
1505
- 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",
1506
- fill: color
1507
- })]
1508
- }));
1509
- };
1510
- GoodSmiley.defaultProps = {
1511
- color: "currentColor",
1512
- size: 24,
1513
- strokeWidth: "1.5"
1514
- };
1515
- var Drag = function Drag(props) {
1516
- var size = props.size,
1517
- color = props.color,
1518
- other = _objectWithoutProperties__default["default"](props, _excluded4);
1519
- return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$y(_objectSpread$y({
1520
- fill: "none",
1521
- height: size,
1522
- viewBox: "0 0 24 24",
1523
- width: size
1524
- }, other), {}, {
1525
- children: [/*#__PURE__*/jsxRuntime.jsx("g", {
1526
- clipPath: "url(#clip0_6290_43)",
1527
- fill: color,
1528
- stroke: color,
1529
- strokeLinecap: "round",
1530
- strokeLinejoin: "round",
1531
- strokeWidth: "1.5",
1532
- children: /*#__PURE__*/jsxRuntime.jsx("path", {
1533
- 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"
1534
- })
1535
- }), /*#__PURE__*/jsxRuntime.jsx("defs", {
1536
- children: /*#__PURE__*/jsxRuntime.jsx("clipPath", {
1537
- id: "clip0_6290_43",
1538
- children: /*#__PURE__*/jsxRuntime.jsx("path", {
1539
- d: "M0 0H24V24H0z",
1540
- fill: color
1541
- })
1542
- })
1543
- })]
1544
- }));
1545
- };
1546
- Drag.defaultProps = {
1547
- color: "currentColor",
1548
- size: 24,
1549
- strokeWidth: "1.5"
1550
- };
1551
-
1552
1567
  var validateEditorContent = function validateEditorContent(editorRef) {
1553
1568
  return function () {
1554
1569
  var _editorRef$current;
@@ -2129,31 +2144,27 @@ var InputWithMaxLength = function InputWithMaxLength(_ref) {
2129
2144
 
2130
2145
  var FieldCode = reactUtils.withT(function (_ref) {
2131
2146
  var t = _ref.t;
2132
- return /*#__PURE__*/jsxRuntime.jsx("div", {
2133
- children: /*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
2134
- required: true,
2135
- label: t("neetoForm.questions.common.questionFields.field.fieldCode"),
2136
- name: "fieldCode",
2137
- helpText: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
2138
- i18nKey: "neetoForm.questions.common.questionFields.field.fieldCodeHelpDescription",
2139
- components: {
2140
- Link: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
2141
- className: "text-xs",
2142
- href: FIELD_CODE_DOC,
2143
- style: "link",
2144
- target: "_blank"
2145
- })
2146
- }
2147
- }),
2148
- labelProps: {
2149
- helpIconProps: {
2150
- icon: neetoIcons.Info,
2151
- className: "cursor-pointer",
2152
- onClick: function onClick() {
2153
- return window.open(FIELD_CODE_DOC, "_blank");
2147
+ return /*#__PURE__*/jsxRuntime.jsx(Accordion__default["default"], {
2148
+ className: "neeto-form-nano-advanced-properties-accordion",
2149
+ "data-cy": "advanced-properties-card",
2150
+ children: /*#__PURE__*/jsxRuntime.jsx(Accordion__default["default"].Item, {
2151
+ title: t("neetoForm.common.advancedProperties"),
2152
+ children: /*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
2153
+ required: true,
2154
+ label: t("neetoForm.questions.common.questionFields.field.fieldCode"),
2155
+ name: "fieldCode",
2156
+ helpText: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
2157
+ i18nKey: "neetoForm.questions.common.questionFields.field.fieldCodeHelpDescription",
2158
+ components: {
2159
+ Link: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
2160
+ className: "text-xs",
2161
+ href: FIELD_CODE_DOC,
2162
+ style: "link",
2163
+ target: "_blank"
2164
+ })
2154
2165
  }
2155
- }
2156
- }
2166
+ })
2167
+ })
2157
2168
  })
2158
2169
  });
2159
2170
  });
@@ -2196,19 +2207,28 @@ var Form$1 = function Form(_ref) {
2196
2207
  var shouldShowPlaceholder = ramda.includes(kind, QUESTIONS_WITH_PLACEHOLDERS);
2197
2208
  var hasAdditionalData = ramda.includes(kind, QUESTIONS_WITH_ADDITIONAL_DATA);
2198
2209
  var shouldShowFieldCode = enableFieldCode && !ramda.includes(kind, QUESTIONS_WITHOUT_FIELD_CODE);
2199
- var handleKindChange = function handleKindChange(_ref3) {
2200
- var label = _ref3.label,
2201
- value = _ref3.value;
2210
+ var handleKindChange = function handleKindChange(option) {
2211
+ var data = buildQuestionData(option);
2212
+ updateFormState(data);
2213
+ };
2214
+ var buildQuestionData = function buildQuestionData(option) {
2215
+ if (ramda.isNil(option)) {
2216
+ return INITIAL_VALUES;
2217
+ }
2218
+ var label = option.label,
2219
+ value = option.value;
2202
2220
  var kind = extractKindFromOption(value);
2203
2221
  var questionKind = getQuestionKind(availableQuestionKinds, {
2204
2222
  type: kind,
2205
2223
  label: label
2206
2224
  });
2207
- var data = createFieldData({
2225
+ return createFieldData({
2208
2226
  kind: questionKind,
2209
2227
  isRequired: isRequired,
2210
2228
  questions: questions
2211
2229
  });
2230
+ };
2231
+ var updateFormState = function updateFormState(data) {
2212
2232
  setValues(data);
2213
2233
  setErrors({});
2214
2234
  setTouched({});
@@ -2249,11 +2269,7 @@ var Form$1 = function Form(_ref) {
2249
2269
  dataCy: "settings-card",
2250
2270
  title: t("neetoForm.common.settings"),
2251
2271
  children: /*#__PURE__*/jsxRuntime.jsx(RequiredSwitch, {})
2252
- }), shouldShowFieldCode && /*#__PURE__*/jsxRuntime.jsx(Block, {
2253
- dataCy: "advanced-properties-card",
2254
- title: t("neetoForm.common.advancedProperties"),
2255
- children: /*#__PURE__*/jsxRuntime.jsx(FieldCode, {})
2256
- })]
2272
+ }), shouldShowFieldCode && /*#__PURE__*/jsxRuntime.jsx(FieldCode, {})]
2257
2273
  })]
2258
2274
  })
2259
2275
  });
@@ -2456,6 +2472,7 @@ var FileGroup = function FileGroup(_ref) {
2456
2472
  checked: checked,
2457
2473
  label: label,
2458
2474
  name: name,
2475
+ "data-cy": "neeto-form-engine-file-type-".concat(name),
2459
2476
  id: name,
2460
2477
  onChange: handleAllowedFileTypesChange
2461
2478
  });
@@ -2634,6 +2651,7 @@ var Options = function Options(_ref) {
2634
2651
  var _option$id;
2635
2652
  return !option._destroy && /*#__PURE__*/jsxRuntime.jsxs("div", {
2636
2653
  className: "flex items-start gap-1",
2654
+ "data-cy": "neeto-form-engine-option-".concat(index),
2637
2655
  children: [/*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
2638
2656
  required: true,
2639
2657
  disabled: freezeOptions,
@@ -2662,6 +2680,7 @@ var Options = function Options(_ref) {
2662
2680
  }), !freezeOptions && /*#__PURE__*/jsxRuntime.jsx("div", {
2663
2681
  className: "mt-3 w-full",
2664
2682
  children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
2683
+ "data-cy": "neeto-form-engine-add-option-button",
2665
2684
  icon: neetoIcons.Plus,
2666
2685
  iconPosition: "left",
2667
2686
  size: "small",
@@ -2690,30 +2709,22 @@ var Rating$2 = function Rating() {
2690
2709
  className: "flex flex-col",
2691
2710
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
2692
2711
  className: "w-full",
2693
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
2712
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
2694
2713
  className: "flex gap-6",
2695
- children: [/*#__PURE__*/jsxRuntime.jsxs(RatingItem, {
2696
- children: [/*#__PURE__*/jsxRuntime.jsx(GoodSmiley, {
2697
- color: "#00ba88",
2698
- size: 48
2699
- }), /*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
2700
- name: "highestRatingLabel"
2701
- })]
2702
- }), /*#__PURE__*/jsxRuntime.jsxs(RatingItem, {
2703
- children: [/*#__PURE__*/jsxRuntime.jsx(OkaySmiley, {
2704
- color: "#f3cd82",
2705
- size: 48
2706
- }), /*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
2707
- name: "averageRatingLabel"
2708
- })]
2709
- }), /*#__PURE__*/jsxRuntime.jsxs(RatingItem, {
2710
- children: [/*#__PURE__*/jsxRuntime.jsx(BadSmiley, {
2711
- color: "#f56a58",
2712
- size: 48
2713
- }), /*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
2714
- name: "lowestRatingLabel"
2715
- })]
2716
- })]
2714
+ children: RATING_OPTIONS.map(function (_ref2) {
2715
+ var Icon = _ref2.icon,
2716
+ name = _ref2.name,
2717
+ color = _ref2.color;
2718
+ return /*#__PURE__*/jsxRuntime.jsxs(RatingItem, {
2719
+ children: [/*#__PURE__*/jsxRuntime.jsx(Icon, {
2720
+ color: color,
2721
+ size: 48
2722
+ }), /*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
2723
+ name: name,
2724
+ "data-cy": "neeto-form-engine-".concat(neetoCist.hyphenate(name))
2725
+ })]
2726
+ }, name);
2727
+ })
2717
2728
  })
2718
2729
  })
2719
2730
  });
@@ -2734,6 +2745,7 @@ var StarRating$2 = function StarRating() {
2734
2745
  className: "flex space-x-4",
2735
2746
  children: [/*#__PURE__*/jsxRuntime.jsx(Select__default["default"], {
2736
2747
  className: "w-1/2",
2748
+ "data-cy": "neeto-form-engine-star-rating-min-value",
2737
2749
  label: t("neetoForm.common.start"),
2738
2750
  name: "minValue",
2739
2751
  options: STAR_RATING_MIN_VALUE_OPTIONS,
@@ -2742,6 +2754,7 @@ var StarRating$2 = function StarRating() {
2742
2754
  }
2743
2755
  }), /*#__PURE__*/jsxRuntime.jsx(Select__default["default"], {
2744
2756
  className: "w-1/2",
2757
+ "data-cy": "neeto-form-engine-star-rating-max-value",
2745
2758
  label: t("neetoForm.common.end"),
2746
2759
  name: "maxValue",
2747
2760
  options: STAR_RATING_MAX_VALUE_OPTIONS,
@@ -2759,6 +2772,7 @@ var StarRating$2 = function StarRating() {
2759
2772
  IconType = _ref2[1];
2760
2773
  var isActive = name === iconType;
2761
2774
  return /*#__PURE__*/jsxRuntime.jsx("div", {
2775
+ "data-cy": "neeto-form-engine-rating-icon-".concat(name),
2762
2776
  className: classnames__default["default"]("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", {
2763
2777
  "neeto-ui-text-gray-800 neeto-ui-bg-gray-200": !isActive,
2764
2778
  "neeto-ui-text-white neeto-ui-bg-gray-800": isActive
@@ -2868,6 +2882,7 @@ var AddQuestion = reactUtils.withT(function (_ref) {
2868
2882
  content: (disabledAddButtonTooltipProps === null || disabledAddButtonTooltipProps === void 0 ? void 0 : disabledAddButtonTooltipProps.content) || t("neetoForm.questions.common.primaryPanel.noQuestionLeft"),
2869
2883
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
2870
2884
  children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
2885
+ "data-cy": "neeto-form-engine-add-question",
2871
2886
  disabled: isDisabled,
2872
2887
  icon: neetoIcons.Plus,
2873
2888
  iconPosition: "left",
@@ -3193,7 +3208,9 @@ var BuildForm = function BuildForm(_ref) {
3193
3208
  questions = _ref2.questions,
3194
3209
  isQuestionsLoading = _ref2.isQuestionsLoading;
3195
3210
  React$2.useEffect(function () {
3196
- onUpdate === null || onUpdate === void 0 || onUpdate(data);
3211
+ if (data) {
3212
+ onUpdate === null || onUpdate === void 0 || onUpdate(data);
3213
+ }
3197
3214
  }, [data]);
3198
3215
  if (isLoading || showLoader && isQuestionsLoading) {
3199
3216
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -13542,6 +13559,7 @@ var Choices = function Choices(_ref) {
13542
13559
  var Component = isCheckBox ? Checkbox__default["default"] : Radio__default["default"].Item;
13543
13560
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
13544
13561
  className: "neeto-form-engine-choices__wrapper",
13562
+ "data-cy": "".concat(neetoCist.hyphenate(label), "-select-container-wrapper"),
13545
13563
  children: [/*#__PURE__*/jsxRuntime.jsx("label", {
13546
13564
  className: "neeto-form-engine-label",
13547
13565
  children: label
@@ -13697,7 +13715,7 @@ var Rating = function Rating(_ref) {
13697
13715
  };
13698
13716
  var render = function render() {
13699
13717
  var labels = [highestRatingLabel, averageRatingLabel, lowestRatingLabel];
13700
- return RATING_OPTIONS.map(function (_ref2, index) {
13718
+ return RATING_OPTIONS$1.map(function (_ref2, index) {
13701
13719
  var Icon = _ref2.icon,
13702
13720
  modifier = _ref2.modifier,
13703
13721
  rating = _ref2.value;