@bigbinary/neeto-rules-frontend 2.5.0 → 2.5.2
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/README.md +4 -0
- package/dist/NeetoRules.js +3 -3
- package/dist/NeetoRulesForm.js +11 -7
- package/dist/NeetoRulesForm.js.map +1 -1
- package/dist/RulePreview.js +3 -3
- package/dist/cjs/CannedResponsesPane.js +21 -36
- package/dist/cjs/CannedResponsesPane.js.map +1 -1
- package/dist/cjs/NeetoRules.js +59 -83
- package/dist/cjs/NeetoRules.js.map +1 -1
- package/dist/cjs/NeetoRulesForm.js +401 -440
- package/dist/cjs/NeetoRulesForm.js.map +1 -1
- package/dist/cjs/RulePreview.js +41 -54
- package/dist/cjs/RulePreview.js.map +1 -1
- package/dist/cjs/constants.js +1 -3
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/hooks.js +1 -3
- package/dist/cjs/hooks.js.map +1 -1
- package/dist/cjs/index.js +5 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/{constants-67118957.js → constants-C0OOtVhT.js} +1 -1
- package/dist/{constants-67118957.js.map → constants-C0OOtVhT.js.map} +1 -1
- package/dist/{constants-7347bfc4.js → constants-CB5HRjxq.js} +1 -1
- package/dist/{constants-7347bfc4.js.map → constants-CB5HRjxq.js.map} +1 -1
- package/dist/constants.js +1 -1
- package/dist/hooks.js +1 -1
- package/dist/{constants-12c6ac46.js → index-9h4B7JZZ.js} +1 -1
- package/dist/index-9h4B7JZZ.js.map +1 -0
- package/dist/{constants-2f1113f8.js → index-DFwPrb81.js} +1 -1
- package/dist/index-DFwPrb81.js.map +1 -0
- package/dist/index.js +5 -5
- package/dist/{useCustomDataStore-51ceac06.js → useCustomDataStore-B1qHMIGJ.js} +1 -1
- package/dist/{useCustomDataStore-51ceac06.js.map → useCustomDataStore-B1qHMIGJ.js.map} +1 -1
- package/dist/{useCustomDataStore-c57f5581.js → useCustomDataStore-BEG8I__n.js} +1 -1
- package/dist/{useCustomDataStore-c57f5581.js.map → useCustomDataStore-BEG8I__n.js.map} +1 -1
- package/dist/{useUtilityStore-e4b36ba2.js → useUtilityStore-BGuo9bko.js} +1 -1
- package/dist/{useUtilityStore-e4b36ba2.js.map → useUtilityStore-BGuo9bko.js.map} +1 -1
- package/dist/{useUtilityStore-ee4f96f8.js → useUtilityStore-KjKihXb0.js} +1 -1
- package/dist/{useUtilityStore-ee4f96f8.js.map → useUtilityStore-KjKihXb0.js.map} +1 -1
- package/dist/{utils-cd8f199f.js → utils-BngEaPaz.js} +1 -1
- package/dist/{utils-cd8f199f.js.map → utils-BngEaPaz.js.map} +1 -1
- package/dist/{utils-866e8e3b.js → utils-CvS2p6ZS.js} +1 -1
- package/dist/{utils-866e8e3b.js.map → utils-CvS2p6ZS.js.map} +1 -1
- package/package.json +11 -11
- package/dist/constants-12c6ac46.js.map +0 -1
- package/dist/constants-2f1113f8.js.map +0 -1
|
@@ -29,7 +29,7 @@ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
|
29
29
|
var Label = require('@bigbinary/neetoui/Label');
|
|
30
30
|
var Select = require('@bigbinary/neetoui/Select');
|
|
31
31
|
var DatePicker = require('@bigbinary/neetoui/DatePicker');
|
|
32
|
-
var utils$1 = require('../utils-
|
|
32
|
+
var utils$1 = require('../utils-BngEaPaz.js');
|
|
33
33
|
var i18next = require('i18next');
|
|
34
34
|
var FormikEditor = require('@bigbinary/neeto-editor/FormikEditor');
|
|
35
35
|
var MultiEmailInput = require('@bigbinary/neetoui/formik/MultiEmailInput');
|
|
@@ -44,7 +44,7 @@ var Tag = require('@bigbinary/neetoui/Tag');
|
|
|
44
44
|
var reactSelect = require('react-select');
|
|
45
45
|
var yup = require('yup');
|
|
46
46
|
var utils$2 = require('@bigbinary/neeto-editor/utils');
|
|
47
|
-
var constants = require('../constants-
|
|
47
|
+
var constants = require('../constants-C0OOtVhT.js');
|
|
48
48
|
var Eye = require('@bigbinary/neeto-icons/Eye');
|
|
49
49
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
50
50
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
@@ -55,14 +55,11 @@ var Radio = require('@bigbinary/neetoui/formik/Radio');
|
|
|
55
55
|
var shallow = require('zustand/shallow');
|
|
56
56
|
var Help = require('@bigbinary/neeto-icons/Help');
|
|
57
57
|
var Switch = require('@bigbinary/neetoui/Switch');
|
|
58
|
-
var useCustomDataStore = require('../useCustomDataStore-
|
|
58
|
+
var useCustomDataStore = require('../useCustomDataStore-BEG8I__n.js');
|
|
59
59
|
var _typeof = require('@babel/runtime/helpers/typeof');
|
|
60
60
|
require('zustand');
|
|
61
61
|
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
function _interopNamespace(e) {
|
|
65
|
-
if (e && e.__esModule) return e;
|
|
62
|
+
function _interopNamespaceDefault(e) {
|
|
66
63
|
var n = Object.create(null);
|
|
67
64
|
if (e) {
|
|
68
65
|
Object.keys(e).forEach(function (k) {
|
|
@@ -75,51 +72,11 @@ function _interopNamespace(e) {
|
|
|
75
72
|
}
|
|
76
73
|
});
|
|
77
74
|
}
|
|
78
|
-
n
|
|
75
|
+
n.default = e;
|
|
79
76
|
return Object.freeze(n);
|
|
80
77
|
}
|
|
81
78
|
|
|
82
|
-
var
|
|
83
|
-
var _objectDestructuringEmpty__default = /*#__PURE__*/_interopDefaultLegacy(_objectDestructuringEmpty);
|
|
84
|
-
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
85
|
-
var Plus__default = /*#__PURE__*/_interopDefaultLegacy(Plus);
|
|
86
|
-
var Delete__default = /*#__PURE__*/_interopDefaultLegacy(Delete);
|
|
87
|
-
var Refresh__default = /*#__PURE__*/_interopDefaultLegacy(Refresh);
|
|
88
|
-
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
89
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
90
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
91
|
-
var Check__default = /*#__PURE__*/_interopDefaultLegacy(Check);
|
|
92
|
-
var Search__default = /*#__PURE__*/_interopDefaultLegacy(Search);
|
|
93
|
-
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
94
|
-
var Dropdown__default = /*#__PURE__*/_interopDefaultLegacy(Dropdown$1);
|
|
95
|
-
var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input$1);
|
|
96
|
-
var Pane__default = /*#__PURE__*/_interopDefaultLegacy(Pane);
|
|
97
|
-
var Textarea__default = /*#__PURE__*/_interopDefaultLegacy(Textarea);
|
|
98
|
-
var ActionBlock__default = /*#__PURE__*/_interopDefaultLegacy(ActionBlock);
|
|
99
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
100
|
-
var Label__default = /*#__PURE__*/_interopDefaultLegacy(Label);
|
|
101
|
-
var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
|
|
102
|
-
var DatePicker__default = /*#__PURE__*/_interopDefaultLegacy(DatePicker);
|
|
103
|
-
var FormikEditor__default = /*#__PURE__*/_interopDefaultLegacy(FormikEditor);
|
|
104
|
-
var MultiEmailInput__default = /*#__PURE__*/_interopDefaultLegacy(MultiEmailInput);
|
|
105
|
-
var Input__default$1 = /*#__PURE__*/_interopDefaultLegacy(Input$2);
|
|
106
|
-
var useHotkeys__default = /*#__PURE__*/_interopDefaultLegacy(useHotkeys);
|
|
107
|
-
var Close__default = /*#__PURE__*/_interopDefaultLegacy(Close);
|
|
108
|
-
var Checkbox__default = /*#__PURE__*/_interopDefaultLegacy(Checkbox);
|
|
109
|
-
var CreatableSelect__default = /*#__PURE__*/_interopDefaultLegacy(CreatableSelect);
|
|
110
|
-
var _toArray__default = /*#__PURE__*/_interopDefaultLegacy(_toArray);
|
|
111
|
-
var Tag__default = /*#__PURE__*/_interopDefaultLegacy(Tag);
|
|
112
|
-
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
113
|
-
var Eye__default = /*#__PURE__*/_interopDefaultLegacy(Eye);
|
|
114
|
-
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
115
|
-
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
116
|
-
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
|
117
|
-
var Popover__default = /*#__PURE__*/_interopDefaultLegacy(Popover);
|
|
118
|
-
var Select__default$1 = /*#__PURE__*/_interopDefaultLegacy(Select$1);
|
|
119
|
-
var Radio__default = /*#__PURE__*/_interopDefaultLegacy(Radio);
|
|
120
|
-
var Help__default = /*#__PURE__*/_interopDefaultLegacy(Help);
|
|
121
|
-
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
122
|
-
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
|
79
|
+
var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
|
|
123
80
|
|
|
124
81
|
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
125
82
|
|
|
@@ -132,7 +89,7 @@ var OptionsWrapper = function OptionsWrapper(_ref) {
|
|
|
132
89
|
maxHeight = _ref$maxHeight === void 0 ? "max-h-44" : _ref$maxHeight,
|
|
133
90
|
children = _ref.children;
|
|
134
91
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
135
|
-
className:
|
|
92
|
+
className: classNames(_defineProperty({}, "".concat(maxHeight, " overflow-y-auto"), hasScroll)),
|
|
136
93
|
children: children
|
|
137
94
|
});
|
|
138
95
|
};
|
|
@@ -165,14 +122,14 @@ var useOnButtonPressed = function useOnButtonPressed(ref, handler) {
|
|
|
165
122
|
var DEFAULT_LONG_TEXT_ROWS = 8;
|
|
166
123
|
|
|
167
124
|
function ownKeys$l(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; }
|
|
168
|
-
function _objectSpread$l(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$l(Object(t), !0).forEach(function (r) {
|
|
125
|
+
function _objectSpread$l(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$l(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$l(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
169
126
|
var PaneFooterBlock = function PaneFooterBlock(_ref) {
|
|
170
127
|
var setShowPane = _ref.setShowPane,
|
|
171
128
|
_ref$submitButtonProp = _ref.submitButtonProps,
|
|
172
129
|
submitButtonProps = _ref$submitButtonProp === void 0 ? {} : _ref$submitButtonProp,
|
|
173
130
|
_ref$cancelButtonProp = _ref.cancelButtonProps,
|
|
174
131
|
cancelButtonProps = _ref$cancelButtonProp === void 0 ? {} : _ref$cancelButtonProp;
|
|
175
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
132
|
+
return /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
|
|
176
133
|
cancelButtonProps: _objectSpread$l({
|
|
177
134
|
"data-cy": "cancel-button",
|
|
178
135
|
onClick: function onClick() {
|
|
@@ -202,7 +159,7 @@ var LongTextField = function LongTextField(_ref) {
|
|
|
202
159
|
errors = _useFormikContext.errors,
|
|
203
160
|
touched = _useFormikContext.touched;
|
|
204
161
|
var _useState = react.useState(false),
|
|
205
|
-
_useState2 =
|
|
162
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
206
163
|
showPane = _useState2[0],
|
|
207
164
|
setShowPane = _useState2[1];
|
|
208
165
|
var initialFocusRef = react.useRef(null);
|
|
@@ -214,17 +171,17 @@ var LongTextField = function LongTextField(_ref) {
|
|
|
214
171
|
var label = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.placeholder) || defaultLabel;
|
|
215
172
|
var rows = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.rows) || DEFAULT_LONG_TEXT_ROWS;
|
|
216
173
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
217
|
-
children: [separator && /*#__PURE__*/jsxRuntime.jsx(
|
|
174
|
+
children: [separator && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
218
175
|
className: "neeto-ui-text-gray-700",
|
|
219
176
|
"data-cy": "long-text-action-separator-text",
|
|
220
177
|
style: "h5",
|
|
221
178
|
weight: "normal",
|
|
222
179
|
children: separator
|
|
223
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
180
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
224
181
|
"data-cy": "long-text-action-button",
|
|
225
182
|
label: label.toLowerCase(),
|
|
226
183
|
style: "link",
|
|
227
|
-
className:
|
|
184
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
228
185
|
"neeto-ui-text-accent-800": showPane,
|
|
229
186
|
"neeto-ui-text-error-500": isValid
|
|
230
187
|
}),
|
|
@@ -233,30 +190,30 @@ var LongTextField = function LongTextField(_ref) {
|
|
|
233
190
|
return !prevState;
|
|
234
191
|
});
|
|
235
192
|
}
|
|
236
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
193
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Pane, {
|
|
237
194
|
initialFocusRef: initialFocusRef,
|
|
238
195
|
isOpen: showPane,
|
|
239
196
|
size: "large",
|
|
240
197
|
onClose: function onClose() {
|
|
241
198
|
return setShowPane(false);
|
|
242
199
|
},
|
|
243
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
244
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
200
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
|
|
201
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
245
202
|
className: "neeto-ui-text-gray-800",
|
|
246
203
|
"data-cy": "long-text-action-pane-header-title",
|
|
247
204
|
style: "h3",
|
|
248
205
|
weight: "semibold",
|
|
249
206
|
children: label
|
|
250
207
|
})
|
|
251
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
252
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
208
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
|
|
209
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Textarea, {
|
|
253
210
|
name: name,
|
|
254
211
|
rows: rows,
|
|
255
212
|
value: value,
|
|
256
213
|
required: true,
|
|
257
214
|
className: "w-full"
|
|
258
215
|
})
|
|
259
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
216
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
|
|
260
217
|
children: /*#__PURE__*/jsxRuntime.jsx(PaneFooterBlock, {
|
|
261
218
|
setShowPane: setShowPane
|
|
262
219
|
})
|
|
@@ -267,17 +224,17 @@ var LongTextField = function LongTextField(_ref) {
|
|
|
267
224
|
|
|
268
225
|
var _excluded$c = ["initialFocusRef", "name", "label"];
|
|
269
226
|
function ownKeys$k(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; }
|
|
270
|
-
function _objectSpread$k(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$k(Object(t), !0).forEach(function (r) {
|
|
227
|
+
function _objectSpread$k(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$k(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$k(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
271
228
|
var InputField$2 = function InputField(_ref) {
|
|
272
229
|
var initialFocusRef = _ref.initialFocusRef,
|
|
273
230
|
name = _ref.name,
|
|
274
231
|
label = _ref.label,
|
|
275
|
-
otherProps =
|
|
232
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$c);
|
|
276
233
|
var _useField = formik.useField(name),
|
|
277
|
-
_useField2 =
|
|
234
|
+
_useField2 = _slicedToArray(_useField, 2),
|
|
278
235
|
field = _useField2[0],
|
|
279
236
|
meta = _useField2[1];
|
|
280
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
237
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input$1, _objectSpread$k(_objectSpread$k({
|
|
281
238
|
label: label,
|
|
282
239
|
type: "text"
|
|
283
240
|
}, field), {}, {
|
|
@@ -332,7 +289,7 @@ var KeyValuePairsField = reactUtils.withT(function (_ref) {
|
|
|
332
289
|
var showDeleteButton = data.length > 1 || hasKeyOrValue(data[0]);
|
|
333
290
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
334
291
|
className: "space-y-3",
|
|
335
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
292
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
336
293
|
children: label
|
|
337
294
|
}), data.map(function (_, index) {
|
|
338
295
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -345,8 +302,8 @@ var KeyValuePairsField = reactUtils.withT(function (_ref) {
|
|
|
345
302
|
className: "w-3/5",
|
|
346
303
|
name: "".concat(name, ".").concat(index, ".value"),
|
|
347
304
|
placeholder: t("neetoRules.labels.value"),
|
|
348
|
-
suffix: showDeleteButton && /*#__PURE__*/jsxRuntime.jsx(
|
|
349
|
-
icon:
|
|
305
|
+
suffix: showDeleteButton && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
306
|
+
icon: Delete,
|
|
350
307
|
size: "small",
|
|
351
308
|
style: "text",
|
|
352
309
|
onClick: function onClick() {
|
|
@@ -359,7 +316,7 @@ var KeyValuePairsField = reactUtils.withT(function (_ref) {
|
|
|
359
316
|
})
|
|
360
317
|
})]
|
|
361
318
|
}, index);
|
|
362
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
319
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
363
320
|
label: t("neetoRules.labels.addKeyValuePair"),
|
|
364
321
|
style: "secondary",
|
|
365
322
|
onClick: function onClick() {
|
|
@@ -377,7 +334,7 @@ var SelectTemplateField = function SelectTemplateField(_ref) {
|
|
|
377
334
|
onChange = _ref.onChange,
|
|
378
335
|
initialFocusRef = _ref.initialFocusRef;
|
|
379
336
|
var _useStateWithDependen = reactUtils.useStateWithDependency(null, [selectedField]),
|
|
380
|
-
_useStateWithDependen2 =
|
|
337
|
+
_useStateWithDependen2 = _slicedToArray(_useStateWithDependen, 2),
|
|
381
338
|
selectedTemplate = _useStateWithDependen2[0],
|
|
382
339
|
setSelectedTemplate = _useStateWithDependen2[1];
|
|
383
340
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -390,7 +347,7 @@ var SelectTemplateField = function SelectTemplateField(_ref) {
|
|
|
390
347
|
}, templates);
|
|
391
348
|
onChange === null || onChange === void 0 ? void 0 : onChange(template);
|
|
392
349
|
};
|
|
393
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
350
|
+
return /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
394
351
|
isClearable: true,
|
|
395
352
|
isSearchable: true,
|
|
396
353
|
className: "mb-4",
|
|
@@ -416,7 +373,7 @@ var ApiFields = function ApiFields(_ref) {
|
|
|
416
373
|
touched = _useFormikContext.touched,
|
|
417
374
|
setFieldValue = _useFormikContext.setFieldValue;
|
|
418
375
|
var _useState = react.useState(false),
|
|
419
|
-
_useState2 =
|
|
376
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
420
377
|
showPane = _useState2[0],
|
|
421
378
|
setShowPane = _useState2[1];
|
|
422
379
|
var initialFocusRef = react.useRef(null);
|
|
@@ -435,17 +392,17 @@ var ApiFields = function ApiFields(_ref) {
|
|
|
435
392
|
setFieldValue("".concat(name, ".additionalData"), formatAdditionalData(template.additionalData));
|
|
436
393
|
};
|
|
437
394
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
438
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
395
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
439
396
|
className: "neeto-ui-text-gray-700",
|
|
440
397
|
"data-cy": "api-action-separator-text",
|
|
441
398
|
style: "h5",
|
|
442
399
|
weight: "normal",
|
|
443
400
|
children: separator
|
|
444
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
401
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
445
402
|
"data-cy": "api-action-button",
|
|
446
403
|
label: defaultLabel.toLowerCase(),
|
|
447
404
|
style: "link",
|
|
448
|
-
className:
|
|
405
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
449
406
|
"neeto-ui-text-accent-800": showPane,
|
|
450
407
|
"neeto-ui-text-error-500": isValid
|
|
451
408
|
}),
|
|
@@ -454,22 +411,22 @@ var ApiFields = function ApiFields(_ref) {
|
|
|
454
411
|
return !prevState;
|
|
455
412
|
});
|
|
456
413
|
}
|
|
457
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
414
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Pane, {
|
|
458
415
|
initialFocusRef: initialFocusRef,
|
|
459
416
|
isOpen: showPane,
|
|
460
417
|
size: "large",
|
|
461
418
|
onClose: function onClose() {
|
|
462
419
|
return setShowPane(false);
|
|
463
420
|
},
|
|
464
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
465
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
421
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
|
|
422
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
466
423
|
className: "neeto-ui-text-gray-800 cursor-pointer",
|
|
467
424
|
"data-cy": "api-action-pane-header-title",
|
|
468
425
|
style: "h3",
|
|
469
426
|
weight: "semibold",
|
|
470
427
|
children: defaultLabel
|
|
471
428
|
})
|
|
472
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
429
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
|
|
473
430
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
474
431
|
className: "w-full",
|
|
475
432
|
children: [isTemplateSelectionEnabled && /*#__PURE__*/jsxRuntime.jsx(SelectTemplateField, {
|
|
@@ -490,7 +447,7 @@ var ApiFields = function ApiFields(_ref) {
|
|
|
490
447
|
name: "".concat(name, ".additionalData")
|
|
491
448
|
})]
|
|
492
449
|
})
|
|
493
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
450
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
|
|
494
451
|
children: /*#__PURE__*/jsxRuntime.jsx(PaneFooterBlock, {
|
|
495
452
|
setShowPane: setShowPane
|
|
496
453
|
})
|
|
@@ -512,7 +469,7 @@ var CustomAction = function CustomAction(_ref) {
|
|
|
512
469
|
var _useTranslation = reactI18next.useTranslation(),
|
|
513
470
|
t = _useTranslation.t;
|
|
514
471
|
var _useState = react.useState(false),
|
|
515
|
-
_useState2 =
|
|
472
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
516
473
|
showPane = _useState2[0],
|
|
517
474
|
setShowPane = _useState2[1];
|
|
518
475
|
var initialFocusRef = react.useRef(null);
|
|
@@ -523,15 +480,15 @@ var CustomAction = function CustomAction(_ref) {
|
|
|
523
480
|
var separator = (selectedField === null || selectedField === void 0 ? void 0 : (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t("neetoRules.common.as");
|
|
524
481
|
var defaultLabel = selectedField === null || selectedField === void 0 ? void 0 : selectedField.placeholder;
|
|
525
482
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
526
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
483
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
527
484
|
className: "neeto-ui-text-gray-700",
|
|
528
485
|
style: "h5",
|
|
529
486
|
weight: "normal",
|
|
530
487
|
children: separator
|
|
531
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
488
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
532
489
|
label: defaultLabel.toLowerCase(),
|
|
533
490
|
style: "link",
|
|
534
|
-
className:
|
|
491
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
535
492
|
"neeto-ui-text-accent-800": showPane,
|
|
536
493
|
"neeto-ui-text-error-500": isValid
|
|
537
494
|
}),
|
|
@@ -540,26 +497,26 @@ var CustomAction = function CustomAction(_ref) {
|
|
|
540
497
|
return !prevState;
|
|
541
498
|
});
|
|
542
499
|
}
|
|
543
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
500
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Pane, {
|
|
544
501
|
initialFocusRef: initialFocusRef,
|
|
545
502
|
isOpen: showPane,
|
|
546
503
|
size: "large",
|
|
547
504
|
onClose: function onClose() {
|
|
548
505
|
return setShowPane(false);
|
|
549
506
|
},
|
|
550
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
551
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
507
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
|
|
508
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
552
509
|
className: "neeto-ui-text-gray-800 cursor-pointer",
|
|
553
510
|
style: "h3",
|
|
554
511
|
weight: "semibold",
|
|
555
512
|
children: defaultLabel
|
|
556
513
|
})
|
|
557
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
514
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
|
|
558
515
|
children: /*#__PURE__*/jsxRuntime.jsx(ActionComponent, {
|
|
559
516
|
action: action,
|
|
560
517
|
name: name
|
|
561
518
|
})
|
|
562
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
519
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
|
|
563
520
|
children: /*#__PURE__*/jsxRuntime.jsx(PaneFooterBlock, {
|
|
564
521
|
setShowPane: setShowPane
|
|
565
522
|
})
|
|
@@ -580,7 +537,7 @@ var DateField$1 = function DateField(_ref) {
|
|
|
580
537
|
touched = _useFormikContext.touched,
|
|
581
538
|
setTouched = _useFormikContext.setTouched;
|
|
582
539
|
var _useState = react.useState(false),
|
|
583
|
-
_useState2 =
|
|
540
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
584
541
|
showInput = _useState2[0],
|
|
585
542
|
setShowInput = _useState2[1];
|
|
586
543
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -590,14 +547,14 @@ var DateField$1 = function DateField(_ref) {
|
|
|
590
547
|
var separator = (selectedField === null || selectedField === void 0 ? void 0 : (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t("neetoRules.common.to");
|
|
591
548
|
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 ? void 0 : (_errors$actions$value = _errors$actions.value) === null || _errors$actions$value === void 0 ? void 0 : _errors$actions$value[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 ? void 0 : (_touched$actions$valu = _touched$actions.value) === null || _touched$actions$valu === void 0 ? void 0 : _touched$actions$valu[index]);
|
|
592
549
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
593
|
-
children: [!selectedField.hideSeparator && /*#__PURE__*/jsxRuntime.jsx(
|
|
550
|
+
children: [!selectedField.hideSeparator && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
594
551
|
className: "neeto-ui-text-gray-700",
|
|
595
552
|
"data-cy": "action-dropdown-seperator-text",
|
|
596
553
|
style: "h5",
|
|
597
554
|
weight: "normal",
|
|
598
555
|
children: separator
|
|
599
556
|
}), showInput ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
600
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
557
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DatePicker, {
|
|
601
558
|
autoFocus: true,
|
|
602
559
|
defaultValue: valueTerm,
|
|
603
560
|
name: "".concat(name, ".value"),
|
|
@@ -608,7 +565,7 @@ var DateField$1 = function DateField(_ref) {
|
|
|
608
565
|
// eslint-disable-next-line @bigbinary/neeto/use-standard-date-time-formats
|
|
609
566
|
date ? utils.dayjs(date).format("YYYY-MM-DD") : "");
|
|
610
567
|
}
|
|
611
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
568
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
612
569
|
className: "cursor-pointer",
|
|
613
570
|
onClick: function onClick() {
|
|
614
571
|
return setShowInput(function (prevState) {
|
|
@@ -616,10 +573,10 @@ var DateField$1 = function DateField(_ref) {
|
|
|
616
573
|
});
|
|
617
574
|
}
|
|
618
575
|
})]
|
|
619
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(
|
|
576
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
620
577
|
label: label,
|
|
621
578
|
style: "link",
|
|
622
|
-
className:
|
|
579
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
623
580
|
"neeto-ui-text-error-500": isValid
|
|
624
581
|
}),
|
|
625
582
|
onClick: function onClick() {
|
|
@@ -726,7 +683,7 @@ var getSlackChannelErrors = function getSlackChannelErrors(_ref2) {
|
|
|
726
683
|
message: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
727
684
|
i18nKey: "neetoRules.validations.slack.errorInIntegration",
|
|
728
685
|
components: {
|
|
729
|
-
button: /*#__PURE__*/jsxRuntime.jsx(
|
|
686
|
+
button: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
730
687
|
href: routeToSlackIntegration,
|
|
731
688
|
size: "small",
|
|
732
689
|
style: "link"
|
|
@@ -752,8 +709,8 @@ var getSlackChannelErrors = function getSlackChannelErrors(_ref2) {
|
|
|
752
709
|
};
|
|
753
710
|
};
|
|
754
711
|
|
|
755
|
-
var Menu$9 =
|
|
756
|
-
MenuItem$9 =
|
|
712
|
+
var Menu$9 = Dropdown$1.Menu,
|
|
713
|
+
MenuItem$9 = Dropdown$1.MenuItem;
|
|
757
714
|
var DropdownField$1 = function DropdownField(_ref) {
|
|
758
715
|
var _actions$value$index$, _actions$value$index, _errors$actions, _errors$actions$value, _touched$actions, _touched$actions$valu, _defaultSelectedOptio;
|
|
759
716
|
var dropdownOptions = _ref.dropdownOptions,
|
|
@@ -772,15 +729,15 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
772
729
|
var _useState = react.useState({
|
|
773
730
|
label: defaultLabel
|
|
774
731
|
}),
|
|
775
|
-
_useState2 =
|
|
732
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
776
733
|
defaultSelectedOption = _useState2[0],
|
|
777
734
|
setDefaultSelectedOption = _useState2[1];
|
|
778
735
|
var _useState3 = react.useState(false),
|
|
779
|
-
_useState4 =
|
|
736
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
780
737
|
isActive = _useState4[0],
|
|
781
738
|
setIsActive = _useState4[1];
|
|
782
739
|
var _useState5 = react.useState(""),
|
|
783
|
-
_useState6 =
|
|
740
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
784
741
|
searchTerm = _useState6[0],
|
|
785
742
|
setSearchTerm = _useState6[1];
|
|
786
743
|
var defaultValue = ((_actions$value$index$ = actions.value[index].metadata) === null || _actions$value$index$ === void 0 ? void 0 : _actions$value$index$.value) || ((_actions$value$index = actions.value[index]) === null || _actions$value$index === void 0 ? void 0 : _actions$value$index.value);
|
|
@@ -821,20 +778,20 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
821
778
|
findDefaultSelectedOption();
|
|
822
779
|
}, [defaultValue, dropdownOptions]);
|
|
823
780
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
824
|
-
children: [!selectedField.hideSeparator && /*#__PURE__*/jsxRuntime.jsx(
|
|
781
|
+
children: [!selectedField.hideSeparator && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
825
782
|
className: "neeto-ui-text-gray-700",
|
|
826
783
|
"data-cy": "action-dropdown-seperator-text",
|
|
827
784
|
style: "h5",
|
|
828
785
|
weight: "normal",
|
|
829
786
|
children: separator
|
|
830
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
787
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Dropdown$1, {
|
|
831
788
|
buttonStyle: "secondary",
|
|
832
789
|
className: "neeto-ui-bg-gray-100",
|
|
833
|
-
customTarget: /*#__PURE__*/jsxRuntime.jsx(
|
|
790
|
+
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
834
791
|
"data-cy": "action-dropdown-button",
|
|
835
792
|
label: defaultSelectedOption === null || defaultSelectedOption === void 0 ? void 0 : (_defaultSelectedOptio = defaultSelectedOption.label) === null || _defaultSelectedOptio === void 0 ? void 0 : _defaultSelectedOptio.toLowerCase(),
|
|
836
793
|
style: "link",
|
|
837
|
-
className:
|
|
794
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
838
795
|
"neeto-ui-text-accent-800": isActive,
|
|
839
796
|
"neeto-ui-text-error-500": isValueSelected
|
|
840
797
|
}),
|
|
@@ -848,12 +805,12 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
848
805
|
onClose: handleClose,
|
|
849
806
|
children: /*#__PURE__*/jsxRuntime.jsxs(Menu$9, {
|
|
850
807
|
className: "max-h-60 max-w-2xl p-3",
|
|
851
|
-
children: [dropdownOptions.length > MAXIMUM_OPTION_LENGTH$2 && /*#__PURE__*/jsxRuntime.jsx(
|
|
808
|
+
children: [dropdownOptions.length > MAXIMUM_OPTION_LENGTH$2 && /*#__PURE__*/jsxRuntime.jsx(Input$1, {
|
|
852
809
|
autoFocus: true,
|
|
853
810
|
className: "mb-1",
|
|
854
811
|
"data-cy": "search-text-field",
|
|
855
812
|
placeholder: t("neetoRules.common.search"),
|
|
856
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
813
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Search, {}),
|
|
857
814
|
value: searchTerm,
|
|
858
815
|
onChange: function onChange(e) {
|
|
859
816
|
return setSearchTerm(e.target.value);
|
|
@@ -866,10 +823,10 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
866
823
|
children: searchedOptions.map(function (option, idx) {
|
|
867
824
|
return /*#__PURE__*/jsxRuntime.jsx(MenuItem$9.Button, {
|
|
868
825
|
"data-cy": "".concat(utils.joinHyphenCase(option.label), "-menu-item"),
|
|
869
|
-
className:
|
|
826
|
+
className: classNames({
|
|
870
827
|
"neeto-ui-bg-gray-100": defaultSelectedOption.value === option.value
|
|
871
828
|
}),
|
|
872
|
-
suffix: defaultSelectedOption.value === option.value && /*#__PURE__*/jsxRuntime.jsx(
|
|
829
|
+
suffix: defaultSelectedOption.value === option.value && /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
873
830
|
className: "neeto-ui-text-primary-800"
|
|
874
831
|
}),
|
|
875
832
|
onClick: function onClick() {
|
|
@@ -889,7 +846,7 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
889
846
|
|
|
890
847
|
var _excluded$b = ["autoFocus", "name", "value", "label", "variables", "addons", "editorRef", "defaults"];
|
|
891
848
|
function ownKeys$j(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; }
|
|
892
|
-
function _objectSpread$j(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$j(Object(t), !0).forEach(function (r) {
|
|
849
|
+
function _objectSpread$j(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$j(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$j(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
893
850
|
var EditorAction = function EditorAction(_ref) {
|
|
894
851
|
var autoFocus = _ref.autoFocus,
|
|
895
852
|
name = _ref.name,
|
|
@@ -903,18 +860,18 @@ var EditorAction = function EditorAction(_ref) {
|
|
|
903
860
|
_ref$editorRef = _ref.editorRef,
|
|
904
861
|
editorRef = _ref$editorRef === void 0 ? null : _ref$editorRef,
|
|
905
862
|
defaults = _ref.defaults,
|
|
906
|
-
otherProps =
|
|
863
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$b);
|
|
907
864
|
var _useFormikContext = formik.useFormikContext(),
|
|
908
865
|
setFieldValue = _useFormikContext.setFieldValue;
|
|
909
866
|
var _useState = react.useState(value),
|
|
910
|
-
_useState2 =
|
|
867
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
911
868
|
editorData = _useState2[0],
|
|
912
869
|
setEditorData = _useState2[1];
|
|
913
870
|
var debouncedValue = reactUtils.useDebounce(editorData, 200);
|
|
914
871
|
react.useEffect(function () {
|
|
915
872
|
setFieldValue(name, editorData);
|
|
916
873
|
}, [debouncedValue]);
|
|
917
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
874
|
+
return /*#__PURE__*/jsxRuntime.jsx(FormikEditor, _objectSpread$j({
|
|
918
875
|
addons: addons,
|
|
919
876
|
autoFocus: autoFocus,
|
|
920
877
|
defaults: defaults,
|
|
@@ -941,7 +898,7 @@ var EmailIdFields = function EmailIdFields(_ref) {
|
|
|
941
898
|
var formattedEmails = buildEmailValues(emails);
|
|
942
899
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
943
900
|
className: "mb-4",
|
|
944
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
901
|
+
children: /*#__PURE__*/jsxRuntime.jsx(MultiEmailInput, {
|
|
945
902
|
name: name,
|
|
946
903
|
label: t("neetoRules.common.emailIds"),
|
|
947
904
|
placeholder: t("neetoRules.placeholders.emailField"),
|
|
@@ -974,7 +931,7 @@ var EmailFields = function EmailFields(_ref) {
|
|
|
974
931
|
touched = _useFormikContext.touched,
|
|
975
932
|
setFieldValue = _useFormikContext.setFieldValue;
|
|
976
933
|
var _useState = react.useState(false),
|
|
977
|
-
_useState2 =
|
|
934
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
978
935
|
showPane = _useState2[0],
|
|
979
936
|
setShowPane = _useState2[1];
|
|
980
937
|
var initialFocusRef = react.useRef(null);
|
|
@@ -1013,17 +970,17 @@ var EmailFields = function EmailFields(_ref) {
|
|
|
1013
970
|
}
|
|
1014
971
|
};
|
|
1015
972
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1016
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
973
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1017
974
|
className: "neeto-ui-text-gray-700",
|
|
1018
975
|
"data-cy": "action-email-seperator-text",
|
|
1019
976
|
style: "h5",
|
|
1020
977
|
weight: "normal",
|
|
1021
978
|
children: separator
|
|
1022
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
979
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1023
980
|
"data-cy": "email-action-button",
|
|
1024
981
|
label: defaultLabel.toLowerCase(),
|
|
1025
982
|
style: "link",
|
|
1026
|
-
className:
|
|
983
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
1027
984
|
"neeto-ui-text-accent-800": showPane,
|
|
1028
985
|
"neeto-ui-text-error-500": isValid
|
|
1029
986
|
}),
|
|
@@ -1032,22 +989,22 @@ var EmailFields = function EmailFields(_ref) {
|
|
|
1032
989
|
return !prevState;
|
|
1033
990
|
});
|
|
1034
991
|
}
|
|
1035
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
992
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Pane, {
|
|
1036
993
|
initialFocusRef: initialFocusRef,
|
|
1037
994
|
isOpen: showPane,
|
|
1038
995
|
size: "large",
|
|
1039
996
|
onClose: function onClose() {
|
|
1040
997
|
return setShowPane(false);
|
|
1041
998
|
},
|
|
1042
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1043
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
999
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
|
|
1000
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1044
1001
|
className: "neeto-ui-text-gray-800 cursor-pointer",
|
|
1045
1002
|
"data-cy": "email-action-pane-header-title",
|
|
1046
1003
|
style: "h3",
|
|
1047
1004
|
weight: "semibold",
|
|
1048
1005
|
children: defaultLabel
|
|
1049
1006
|
})
|
|
1050
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1007
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
|
|
1051
1008
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1052
1009
|
className: "w-full",
|
|
1053
1010
|
children: [isTemplateSelectionEnabled && /*#__PURE__*/jsxRuntime.jsx(SelectTemplateField, {
|
|
@@ -1074,7 +1031,7 @@ var EmailFields = function EmailFields(_ref) {
|
|
|
1074
1031
|
variables: selectedField === null || selectedField === void 0 ? void 0 : selectedField.variables
|
|
1075
1032
|
})]
|
|
1076
1033
|
})
|
|
1077
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1034
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
|
|
1078
1035
|
children: /*#__PURE__*/jsxRuntime.jsx(PaneFooterBlock, {
|
|
1079
1036
|
setShowPane: setShowPane,
|
|
1080
1037
|
submitButtonProps: {
|
|
@@ -1118,7 +1075,7 @@ var Input = function Input(_ref) {
|
|
|
1118
1075
|
errors = _useFormikContext.errors,
|
|
1119
1076
|
touched = _useFormikContext.touched;
|
|
1120
1077
|
var _useState = react.useState(false),
|
|
1121
|
-
_useState2 =
|
|
1078
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1122
1079
|
showInput = _useState2[0],
|
|
1123
1080
|
setShowInput = _useState2[1];
|
|
1124
1081
|
var inputRef = react.useRef(null);
|
|
@@ -1136,29 +1093,29 @@ var Input = function Input(_ref) {
|
|
|
1136
1093
|
setShowInput(false);
|
|
1137
1094
|
}, [action.name]);
|
|
1138
1095
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1139
|
-
children: [!selectedField.hideSeparator && /*#__PURE__*/jsxRuntime.jsx(
|
|
1096
|
+
children: [!selectedField.hideSeparator && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1140
1097
|
className: "neeto-ui-text-gray-700 mt-1",
|
|
1141
1098
|
"data-cy": "action-dropdown-seperator-text",
|
|
1142
1099
|
style: "h5",
|
|
1143
1100
|
weight: "normal",
|
|
1144
1101
|
children: separator
|
|
1145
|
-
}), showInput ? /*#__PURE__*/jsxRuntime.jsx(
|
|
1102
|
+
}), showInput ? /*#__PURE__*/jsxRuntime.jsx(Input$2, {
|
|
1146
1103
|
className: "my-auto",
|
|
1147
1104
|
name: "".concat(name, ".value"),
|
|
1148
1105
|
placeholder: t("neetoRules.placeholders.value"),
|
|
1149
1106
|
ref: inputRef,
|
|
1150
1107
|
size: "small",
|
|
1151
|
-
suffix: /*#__PURE__*/jsxRuntime.jsx(
|
|
1108
|
+
suffix: /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
1152
1109
|
onClick: function onClick() {
|
|
1153
1110
|
return setShowInput(function (prevState) {
|
|
1154
1111
|
return !prevState;
|
|
1155
1112
|
});
|
|
1156
1113
|
}
|
|
1157
1114
|
})
|
|
1158
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(
|
|
1115
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1159
1116
|
label: label,
|
|
1160
1117
|
style: "link",
|
|
1161
|
-
className:
|
|
1118
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
1162
1119
|
"neeto-ui-text-accent-500": isValid
|
|
1163
1120
|
}),
|
|
1164
1121
|
onClick: function onClick() {
|
|
@@ -1201,7 +1158,7 @@ var SHORTCUTS = {
|
|
|
1201
1158
|
|
|
1202
1159
|
var _excluded$a = ["value", "nullable", "className", "handleSubmit", "handleCancel"];
|
|
1203
1160
|
function ownKeys$i(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; }
|
|
1204
|
-
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), !0).forEach(function (r) {
|
|
1161
|
+
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1205
1162
|
var InlineInput = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
1206
1163
|
var _props$value = props.value,
|
|
1207
1164
|
value = _props$value === void 0 ? "" : _props$value,
|
|
@@ -1210,9 +1167,9 @@ var InlineInput = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
|
1210
1167
|
className = props.className,
|
|
1211
1168
|
handleSubmit = props.handleSubmit,
|
|
1212
1169
|
handleCancel = props.handleCancel,
|
|
1213
|
-
otherProps =
|
|
1170
|
+
otherProps = _objectWithoutProperties(props, _excluded$a);
|
|
1214
1171
|
var _useState = react.useState(""),
|
|
1215
|
-
_useState2 =
|
|
1172
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1216
1173
|
inputValue = _useState2[0],
|
|
1217
1174
|
setInputValue = _useState2[1];
|
|
1218
1175
|
var inputWrapperRef = react.useRef(null);
|
|
@@ -1227,19 +1184,19 @@ var InlineInput = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
|
1227
1184
|
useOnClickOutside(inputWrapperRef, function () {
|
|
1228
1185
|
return handleCancel(inputValue);
|
|
1229
1186
|
});
|
|
1230
|
-
var inputFieldEscapeHotkeyRef =
|
|
1187
|
+
var inputFieldEscapeHotkeyRef = useHotkeys(SHORTCUTS.cancel.sequence, handleCancel, {
|
|
1231
1188
|
mode: "scoped"
|
|
1232
1189
|
});
|
|
1233
|
-
var inputFieldEnterHotkeyRef =
|
|
1190
|
+
var inputFieldEnterHotkeyRef = useHotkeys(SHORTCUTS.submit.sequence, onSubmit, {
|
|
1234
1191
|
mode: "scoped"
|
|
1235
1192
|
});
|
|
1236
1193
|
react.useEffect(function () {
|
|
1237
1194
|
setInputValue(value);
|
|
1238
1195
|
}, [value]);
|
|
1239
1196
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1240
|
-
className:
|
|
1197
|
+
className: classNames("flex flex-grow", _defineProperty({}, className, className)),
|
|
1241
1198
|
ref: inputWrapperRef,
|
|
1242
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1199
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Input$1, _objectSpread$i(_objectSpread$i({
|
|
1243
1200
|
autoFocus: true,
|
|
1244
1201
|
className: "neeto-planner-inline-input",
|
|
1245
1202
|
"data-cy": "inline-input-field",
|
|
@@ -1253,17 +1210,17 @@ var InlineInput = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
|
1253
1210
|
}
|
|
1254
1211
|
}, otherProps), {}, {
|
|
1255
1212
|
suffix: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1256
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1213
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1257
1214
|
"data-cy": "inline-input-submit-button",
|
|
1258
1215
|
disabled: !isValidValue,
|
|
1259
|
-
icon:
|
|
1216
|
+
icon: Check,
|
|
1260
1217
|
style: "text",
|
|
1261
1218
|
tooltipProps: LIST_FIELD_TOOLTIP_PROPS.save,
|
|
1262
1219
|
onClick: onSubmit
|
|
1263
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1220
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1264
1221
|
ref: ref,
|
|
1265
1222
|
"data-cy": "inline-input-cancel-button",
|
|
1266
|
-
icon:
|
|
1223
|
+
icon: Close,
|
|
1267
1224
|
style: "text",
|
|
1268
1225
|
tooltipProps: LIST_FIELD_TOOLTIP_PROPS.cancel,
|
|
1269
1226
|
onClick: handleCancel
|
|
@@ -1287,11 +1244,11 @@ var ListField = function ListField(_ref) {
|
|
|
1287
1244
|
errors = _useFormikContext.errors,
|
|
1288
1245
|
touched = _useFormikContext.touched;
|
|
1289
1246
|
var _useState = react.useState(false),
|
|
1290
|
-
_useState2 =
|
|
1247
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1291
1248
|
isInputCardOpen = _useState2[0],
|
|
1292
1249
|
setIsInputCardOpen = _useState2[1];
|
|
1293
1250
|
var _useState3 = react.useState(false),
|
|
1294
|
-
_useState4 =
|
|
1251
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1295
1252
|
showPane = _useState4[0],
|
|
1296
1253
|
setShowPane = _useState4[1];
|
|
1297
1254
|
var initialFocusRef = react.useRef(null);
|
|
@@ -1301,17 +1258,17 @@ var ListField = function ListField(_ref) {
|
|
|
1301
1258
|
var isValid = errors.actions && ramda.isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 ? void 0 : (_errors$actions$value = _errors$actions.value) === null || _errors$actions$value === void 0 ? void 0 : _errors$actions$value[index]) && ramda.isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 ? void 0 : (_touched$actions$valu = _touched$actions.value) === null || _touched$actions$valu === void 0 ? void 0 : _touched$actions$valu[index]);
|
|
1302
1259
|
var separator = (selectedField === null || selectedField === void 0 ? void 0 : (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t("neetoRules.common.to");
|
|
1303
1260
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1304
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1261
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1305
1262
|
className: "neeto-ui-text-gray-700",
|
|
1306
1263
|
"data-cy": "list-action-separator-text",
|
|
1307
1264
|
style: "h5",
|
|
1308
1265
|
weight: "normal",
|
|
1309
1266
|
children: separator
|
|
1310
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1267
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1311
1268
|
"data-cy": "list-action-button",
|
|
1312
1269
|
label: t("neetoRules.form.list"),
|
|
1313
1270
|
style: "link",
|
|
1314
|
-
className:
|
|
1271
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
1315
1272
|
"neeto-ui-text-accent-800": showPane,
|
|
1316
1273
|
"neeto-ui-text-error-500": isValid
|
|
1317
1274
|
}),
|
|
@@ -1320,22 +1277,22 @@ var ListField = function ListField(_ref) {
|
|
|
1320
1277
|
return !prevState;
|
|
1321
1278
|
});
|
|
1322
1279
|
}
|
|
1323
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
1280
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Pane, {
|
|
1324
1281
|
initialFocusRef: initialFocusRef,
|
|
1325
1282
|
isOpen: showPane,
|
|
1326
1283
|
size: "large",
|
|
1327
1284
|
onClose: function onClose() {
|
|
1328
1285
|
return setShowPane(false);
|
|
1329
1286
|
},
|
|
1330
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1331
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1287
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
|
|
1288
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1332
1289
|
className: "neeto-ui-text-gray-800",
|
|
1333
1290
|
"data-cy": "list-action-pane-header-title",
|
|
1334
1291
|
style: "h3",
|
|
1335
1292
|
weight: "semibold",
|
|
1336
1293
|
children: t("neetoRules.form.list")
|
|
1337
1294
|
})
|
|
1338
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1295
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
|
|
1339
1296
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1340
1297
|
className: "mt-2 w-full space-y-2",
|
|
1341
1298
|
children: /*#__PURE__*/jsxRuntime.jsx(formik.FieldArray, {
|
|
@@ -1345,15 +1302,15 @@ var ListField = function ListField(_ref) {
|
|
|
1345
1302
|
children: [values.map(function (item, index) {
|
|
1346
1303
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1347
1304
|
className: "neeto-ui-bg-white flex flex-wrap justify-between border border-dashed px-2 py-1",
|
|
1348
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1305
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1349
1306
|
className: "w-4/5 overflow-x-auto",
|
|
1350
1307
|
"data-cy": "list-action-item-label",
|
|
1351
1308
|
style: "body2",
|
|
1352
1309
|
children: item
|
|
1353
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1310
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1354
1311
|
className: "flex-shrink-0",
|
|
1355
1312
|
"data-cy": "list-action-delete-item-button",
|
|
1356
|
-
icon:
|
|
1313
|
+
icon: Delete,
|
|
1357
1314
|
size: "small",
|
|
1358
1315
|
style: "text",
|
|
1359
1316
|
onClick: function onClick() {
|
|
@@ -1365,7 +1322,7 @@ var ListField = function ListField(_ref) {
|
|
|
1365
1322
|
name: name,
|
|
1366
1323
|
className: "w-full",
|
|
1367
1324
|
children: function children(message) {
|
|
1368
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
1325
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1369
1326
|
className: "neeto-ui-text-error-500 neeto-ui-text-gray-700",
|
|
1370
1327
|
"data-cy": "list-action-error-message",
|
|
1371
1328
|
style: "h5",
|
|
@@ -1380,9 +1337,9 @@ var ListField = function ListField(_ref) {
|
|
|
1380
1337
|
return arrayHelper.push(title);
|
|
1381
1338
|
},
|
|
1382
1339
|
ref: initialFocusRef
|
|
1383
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(
|
|
1340
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1384
1341
|
"data-cy": "list-action-add-item-button",
|
|
1385
|
-
icon:
|
|
1342
|
+
icon: Plus,
|
|
1386
1343
|
label: t("neetoRules.common.addItem"),
|
|
1387
1344
|
ref: initialFocusRef,
|
|
1388
1345
|
style: "text",
|
|
@@ -1394,7 +1351,7 @@ var ListField = function ListField(_ref) {
|
|
|
1394
1351
|
}
|
|
1395
1352
|
})
|
|
1396
1353
|
})
|
|
1397
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1354
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
|
|
1398
1355
|
children: /*#__PURE__*/jsxRuntime.jsx(PaneFooterBlock, {
|
|
1399
1356
|
setShowPane: setShowPane
|
|
1400
1357
|
})
|
|
@@ -1403,8 +1360,8 @@ var ListField = function ListField(_ref) {
|
|
|
1403
1360
|
});
|
|
1404
1361
|
};
|
|
1405
1362
|
|
|
1406
|
-
var Menu$8 =
|
|
1407
|
-
MenuItem$8 =
|
|
1363
|
+
var Menu$8 = Dropdown$1.Menu,
|
|
1364
|
+
MenuItem$8 = Dropdown$1.MenuItem;
|
|
1408
1365
|
var MultiSelect$1 = function MultiSelect(_ref) {
|
|
1409
1366
|
var _selectedField$placeh, _selectedField$separa, _errors$actions, _errors$actions$value, _touched$actions, _touched$actions$valu;
|
|
1410
1367
|
var _ref$values = _ref.values,
|
|
@@ -1420,11 +1377,11 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
1420
1377
|
setTouched = _useFormikContext.setTouched,
|
|
1421
1378
|
touched = _useFormikContext.touched;
|
|
1422
1379
|
var _useState = react.useState(null),
|
|
1423
|
-
_useState2 =
|
|
1380
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1424
1381
|
activeOption = _useState2[0],
|
|
1425
1382
|
setActiveOption = _useState2[1];
|
|
1426
1383
|
var _useState3 = react.useState(""),
|
|
1427
|
-
_useState4 =
|
|
1384
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1428
1385
|
searchTerm = _useState4[0],
|
|
1429
1386
|
setSearchTerm = _useState4[1];
|
|
1430
1387
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -1448,13 +1405,13 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
1448
1405
|
setSearchTerm("");
|
|
1449
1406
|
};
|
|
1450
1407
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1451
|
-
children: [!selectedField.hideSeparator && /*#__PURE__*/jsxRuntime.jsx(
|
|
1408
|
+
children: [!selectedField.hideSeparator && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1452
1409
|
className: "neeto-ui-text-gray-700",
|
|
1453
1410
|
"data-cy": "multi-select-action-separator-text",
|
|
1454
1411
|
style: "h5",
|
|
1455
1412
|
weight: "normal",
|
|
1456
1413
|
children: separator
|
|
1457
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1414
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Dropdown$1, {
|
|
1458
1415
|
buttonStyle: "secondary",
|
|
1459
1416
|
className: "neeto-ui-bg-gray-10",
|
|
1460
1417
|
closeOnSelect: false,
|
|
@@ -1464,7 +1421,7 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
1464
1421
|
children: selectedOptions.map(function (option, idx) {
|
|
1465
1422
|
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
1466
1423
|
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
1467
|
-
children: [!!idx && /*#__PURE__*/jsxRuntime.jsx(
|
|
1424
|
+
children: [!!idx && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1468
1425
|
className: "neeto-ui-text-gray-700",
|
|
1469
1426
|
style: "h5",
|
|
1470
1427
|
weight: "normal",
|
|
@@ -1474,11 +1431,11 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
1474
1431
|
children: t("neetoRules.common.and", {
|
|
1475
1432
|
what: ""
|
|
1476
1433
|
})
|
|
1477
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1434
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1478
1435
|
"data-cy": "multi-select-action-button",
|
|
1479
1436
|
label: option === null || option === void 0 ? void 0 : option.label.toLowerCase(),
|
|
1480
1437
|
style: "link",
|
|
1481
|
-
className:
|
|
1438
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
1482
1439
|
"neeto-ui-text-accent-800": activeOption === (option === null || option === void 0 ? void 0 : option.value)
|
|
1483
1440
|
}),
|
|
1484
1441
|
onClick: function onClick() {
|
|
@@ -1488,10 +1445,10 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
1488
1445
|
})]
|
|
1489
1446
|
}, idx);
|
|
1490
1447
|
})
|
|
1491
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(
|
|
1448
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1492
1449
|
label: defaultLabel,
|
|
1493
1450
|
style: "link",
|
|
1494
|
-
className:
|
|
1451
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
1495
1452
|
"neeto-ui-text-accent-800": activeOption === defaultLabel,
|
|
1496
1453
|
"neeto-ui-text-error-500": isValid
|
|
1497
1454
|
}),
|
|
@@ -1503,12 +1460,12 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
1503
1460
|
onClose: handleClose,
|
|
1504
1461
|
children: /*#__PURE__*/jsxRuntime.jsxs(Menu$8, {
|
|
1505
1462
|
className: "max-h-60 max-w-2xl p-3",
|
|
1506
|
-
children: [dropDownOptions.length > MAXIMUM_OPTION_LENGTH$2 && /*#__PURE__*/jsxRuntime.jsx(
|
|
1463
|
+
children: [dropDownOptions.length > MAXIMUM_OPTION_LENGTH$2 && /*#__PURE__*/jsxRuntime.jsx(Input$1, {
|
|
1507
1464
|
autoFocus: true,
|
|
1508
1465
|
className: "mb-1",
|
|
1509
1466
|
"data-cy": "search-text-field",
|
|
1510
1467
|
placeholder: t("neetoRules.common.search"),
|
|
1511
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
1468
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Search, {}),
|
|
1512
1469
|
value: searchTerm,
|
|
1513
1470
|
onChange: function onChange(e) {
|
|
1514
1471
|
return setSearchTerm(e.target.value);
|
|
@@ -1518,7 +1475,7 @@ var MultiSelect$1 = function MultiSelect(_ref) {
|
|
|
1518
1475
|
children: searchedOptions.map(function (option, idx) {
|
|
1519
1476
|
return /*#__PURE__*/jsxRuntime.jsx(MenuItem$8.Button, {
|
|
1520
1477
|
"data-cy": "".concat(utils.joinHyphenCase(option.label), "-menu-item"),
|
|
1521
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
1478
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Checkbox, {
|
|
1522
1479
|
checked: values.includes(option === null || option === void 0 ? void 0 : option.value),
|
|
1523
1480
|
"data-cy": "check-icon",
|
|
1524
1481
|
id: option === null || option === void 0 ? void 0 : option.value
|
|
@@ -1551,7 +1508,7 @@ var NoteField = function NoteField(_ref) {
|
|
|
1551
1508
|
errors = _useFormikContext.errors,
|
|
1552
1509
|
touched = _useFormikContext.touched;
|
|
1553
1510
|
var _useState = react.useState(false),
|
|
1554
|
-
_useState2 =
|
|
1511
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1555
1512
|
showPane = _useState2[0],
|
|
1556
1513
|
setShowPane = _useState2[1];
|
|
1557
1514
|
var initialFocusRef = react.useRef(null);
|
|
@@ -1563,17 +1520,17 @@ var NoteField = function NoteField(_ref) {
|
|
|
1563
1520
|
var variables = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.variables) || [];
|
|
1564
1521
|
var defaultLabel = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.placeholder) || t("neetoRules.form.note");
|
|
1565
1522
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1566
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1523
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1567
1524
|
className: "neeto-ui-text-gray-700",
|
|
1568
1525
|
"data-cy": "note-action-separator-text",
|
|
1569
1526
|
style: "h5",
|
|
1570
1527
|
weight: "normal",
|
|
1571
1528
|
children: separator
|
|
1572
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1529
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1573
1530
|
"data-cy": "note-action-button",
|
|
1574
1531
|
label: defaultLabel.toLowerCase(),
|
|
1575
1532
|
style: "link",
|
|
1576
|
-
className:
|
|
1533
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
1577
1534
|
"neeto-ui-text-accent-800": showPane,
|
|
1578
1535
|
"neeto-ui-text-error-500": isValid
|
|
1579
1536
|
}),
|
|
@@ -1582,28 +1539,28 @@ var NoteField = function NoteField(_ref) {
|
|
|
1582
1539
|
return !prevState;
|
|
1583
1540
|
});
|
|
1584
1541
|
}
|
|
1585
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
1542
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Pane, {
|
|
1586
1543
|
initialFocusRef: initialFocusRef,
|
|
1587
1544
|
isOpen: showPane,
|
|
1588
1545
|
size: "large",
|
|
1589
1546
|
onClose: function onClose() {
|
|
1590
1547
|
return setShowPane(false);
|
|
1591
1548
|
},
|
|
1592
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1593
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1549
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
|
|
1550
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1594
1551
|
className: "neeto-ui-text-gray-800",
|
|
1595
1552
|
"data-cy": "note-action-pane-header-title",
|
|
1596
1553
|
style: "h3",
|
|
1597
1554
|
weight: "semibold",
|
|
1598
1555
|
children: defaultLabel
|
|
1599
1556
|
})
|
|
1600
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1557
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
|
|
1601
1558
|
children: /*#__PURE__*/jsxRuntime.jsx(EditorAction, {
|
|
1602
1559
|
name: name,
|
|
1603
1560
|
value: value,
|
|
1604
1561
|
variables: variables
|
|
1605
1562
|
})
|
|
1606
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1563
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
|
|
1607
1564
|
children: /*#__PURE__*/jsxRuntime.jsx(PaneFooterBlock, {
|
|
1608
1565
|
setShowPane: setShowPane
|
|
1609
1566
|
})
|
|
@@ -1646,7 +1603,7 @@ var formatErrorMessage = function formatErrorMessage(error) {
|
|
|
1646
1603
|
|
|
1647
1604
|
var _excluded$9 = ["children"];
|
|
1648
1605
|
function ownKeys$h(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; }
|
|
1649
|
-
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), !0).forEach(function (r) {
|
|
1606
|
+
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1650
1607
|
var STYLES = {
|
|
1651
1608
|
border: {
|
|
1652
1609
|
"default": "1px solid rgb(var(--neeto-ui-gray-400))",
|
|
@@ -1659,15 +1616,15 @@ var STYLES = {
|
|
|
1659
1616
|
};
|
|
1660
1617
|
var MultiValueRemove = function MultiValueRemove(props) {
|
|
1661
1618
|
return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.MultiValueRemove, _objectSpread$h(_objectSpread$h({}, props), {}, {
|
|
1662
|
-
innerProps: _objectSpread$h(_objectSpread$h({}, props.innerProps), {},
|
|
1663
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1619
|
+
innerProps: _objectSpread$h(_objectSpread$h({}, props.innerProps), {}, _defineProperty({}, "data-cy", "".concat(dasherize(props.data.label), "-remove-icon"))),
|
|
1620
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Close, {
|
|
1664
1621
|
size: 16
|
|
1665
1622
|
})
|
|
1666
1623
|
}));
|
|
1667
1624
|
};
|
|
1668
1625
|
var ValueContainer = function ValueContainer(_ref) {
|
|
1669
1626
|
var children = _ref.children,
|
|
1670
|
-
props =
|
|
1627
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
1671
1628
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1672
1629
|
t = _useTranslation.t;
|
|
1673
1630
|
var getValue = props.getValue,
|
|
@@ -1675,13 +1632,13 @@ var ValueContainer = function ValueContainer(_ref) {
|
|
|
1675
1632
|
isFocused = _props$selectProps.isFocused,
|
|
1676
1633
|
visiblePhoneNumbersCount = _props$selectProps.visiblePhoneNumbersCount;
|
|
1677
1634
|
var value = getValue();
|
|
1678
|
-
var _children =
|
|
1635
|
+
var _children = _toArray(children),
|
|
1679
1636
|
firstChild = _children[0],
|
|
1680
1637
|
rest = _children.slice(1);
|
|
1681
1638
|
var shouldCollapse = !isFocused && value.length > visiblePhoneNumbersCount;
|
|
1682
1639
|
return /*#__PURE__*/jsxRuntime.jsxs(reactSelect.components.ValueContainer, _objectSpread$h(_objectSpread$h({}, props), {}, {
|
|
1683
|
-
innerProps: _objectSpread$h(_objectSpread$h({}, props.innerProps), {},
|
|
1684
|
-
children: [shouldCollapse ? firstChild.slice(0, visiblePhoneNumbersCount) : firstChild, shouldCollapse && /*#__PURE__*/jsxRuntime.jsx(
|
|
1640
|
+
innerProps: _objectSpread$h(_objectSpread$h({}, props.innerProps), {}, _defineProperty({}, "data-cy", "multi-phone-number-input-container")),
|
|
1641
|
+
children: [shouldCollapse ? firstChild.slice(0, visiblePhoneNumbersCount) : firstChild, shouldCollapse && /*#__PURE__*/jsxRuntime.jsx(Tag, {
|
|
1685
1642
|
style: "secondary",
|
|
1686
1643
|
label: t("neetoRules.labels.remainingItemsCount", {
|
|
1687
1644
|
count: value.length - visiblePhoneNumbersCount
|
|
@@ -1691,8 +1648,8 @@ var ValueContainer = function ValueContainer(_ref) {
|
|
|
1691
1648
|
};
|
|
1692
1649
|
var ClearIndicator = function ClearIndicator(props) {
|
|
1693
1650
|
return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.ClearIndicator, _objectSpread$h(_objectSpread$h({}, props), {}, {
|
|
1694
|
-
innerProps: _objectSpread$h(_objectSpread$h({}, props.innerProps), {},
|
|
1695
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1651
|
+
innerProps: _objectSpread$h(_objectSpread$h({}, props.innerProps), {}, _defineProperty({}, "data-cy", "clear-all-button")),
|
|
1652
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Close, {
|
|
1696
1653
|
className: "cursor-pointer",
|
|
1697
1654
|
size: 16
|
|
1698
1655
|
})
|
|
@@ -1724,7 +1681,7 @@ var CUSTOM_COMPONENTS = {
|
|
|
1724
1681
|
|
|
1725
1682
|
var _excluded$8 = ["value", "onChange", "error", "onBlur"];
|
|
1726
1683
|
function ownKeys$g(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; }
|
|
1727
|
-
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) {
|
|
1684
|
+
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1728
1685
|
var MultiPhoneNumberInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
1729
1686
|
var _ref$value = _ref.value,
|
|
1730
1687
|
value = _ref$value === void 0 ? [] : _ref$value,
|
|
@@ -1734,13 +1691,13 @@ var MultiPhoneNumberInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
|
1734
1691
|
error = _ref$error === void 0 ? "" : _ref$error,
|
|
1735
1692
|
_ref$onBlur = _ref.onBlur,
|
|
1736
1693
|
onBlur = _ref$onBlur === void 0 ? neetoCist.noop : _ref$onBlur,
|
|
1737
|
-
otherProps =
|
|
1694
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$8);
|
|
1738
1695
|
var _useState = react.useState(""),
|
|
1739
|
-
_useState2 =
|
|
1696
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1740
1697
|
inputValue = _useState2[0],
|
|
1741
1698
|
setInputValue = _useState2[1];
|
|
1742
1699
|
var _useState3 = react.useState(false),
|
|
1743
|
-
_useState4 =
|
|
1700
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1744
1701
|
isFocused = _useState4[0],
|
|
1745
1702
|
setIsFocused = _useState4[1];
|
|
1746
1703
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -1753,7 +1710,7 @@ var MultiPhoneNumberInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
|
1753
1710
|
var inputValues = inputValue.match(PHONE_NUMBER_SEPARATION_REGEX) || [];
|
|
1754
1711
|
var phoneNumberMatches = ramda.filter(ramda.test(FLEXIBLE_PHONE_NUMBER_REGEX), inputValues);
|
|
1755
1712
|
var phoneNumbers = phoneNumberMatches.map(formatPhoneNumberInputOptions);
|
|
1756
|
-
onChange(pruneDuplicates([].concat(
|
|
1713
|
+
onChange(pruneDuplicates([].concat(_toConsumableArray(value), _toConsumableArray(phoneNumbers))));
|
|
1757
1714
|
setInputValue("");
|
|
1758
1715
|
};
|
|
1759
1716
|
var handleKeyDown = function handleKeyDown(event) {
|
|
@@ -1766,7 +1723,7 @@ var MultiPhoneNumberInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
|
1766
1723
|
};
|
|
1767
1724
|
var onCreateOption = function onCreateOption(input) {
|
|
1768
1725
|
var phoneNumber = formatPhoneNumberInputOptions(input);
|
|
1769
|
-
onChange(pruneDuplicates([].concat(
|
|
1726
|
+
onChange(pruneDuplicates([].concat(_toConsumableArray(value), [phoneNumber])));
|
|
1770
1727
|
};
|
|
1771
1728
|
var handleBlur = function handleBlur(event) {
|
|
1772
1729
|
inputValue ? handlePhoneNumberChange() : onBlur(event);
|
|
@@ -1777,13 +1734,13 @@ var MultiPhoneNumberInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
|
1777
1734
|
className: "neeto-ui-input__wrapper neeto-ui-email-input__wrapper",
|
|
1778
1735
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1779
1736
|
className: "neeto-ui-email-input__label-wrapper",
|
|
1780
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1737
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
1781
1738
|
required: true,
|
|
1782
1739
|
className: "neeto-ui-email-input__label",
|
|
1783
1740
|
"data-cy": "".concat(dasherize(label), "-input-label"),
|
|
1784
1741
|
children: label
|
|
1785
1742
|
})
|
|
1786
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1743
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CreatableSelect, _objectSpread$g({
|
|
1787
1744
|
isMulti: true,
|
|
1788
1745
|
required: true,
|
|
1789
1746
|
classNamePrefix: "neeto-ui-react-select",
|
|
@@ -1791,7 +1748,7 @@ var MultiPhoneNumberInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
|
1791
1748
|
menuIsOpen: false,
|
|
1792
1749
|
placeholder: t("neetoRules.placeholders.phoneNumberField"),
|
|
1793
1750
|
visiblePhoneNumbersCount: 4,
|
|
1794
|
-
className:
|
|
1751
|
+
className: classNames("neeto-ui-react-select__container neeto-ui-react-select__container--medium neeto-ui-email-input__select", {
|
|
1795
1752
|
"neeto-ui-react-select__container--error": !!error
|
|
1796
1753
|
}),
|
|
1797
1754
|
styles: _objectSpread$g(_objectSpread$g({}, CUSTOM_STYLES), {}, {
|
|
@@ -1836,7 +1793,7 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
1836
1793
|
_ref$phoneNumbers = _ref.phoneNumbers,
|
|
1837
1794
|
phoneNumbers = _ref$phoneNumbers === void 0 ? [] : _ref$phoneNumbers;
|
|
1838
1795
|
var _useField = formik.useField(name),
|
|
1839
|
-
_useField2 =
|
|
1796
|
+
_useField2 = _slicedToArray(_useField, 3);
|
|
1840
1797
|
_useField2[0];
|
|
1841
1798
|
var meta = _useField2[1],
|
|
1842
1799
|
_useField2$ = _useField2[2],
|
|
@@ -1881,7 +1838,7 @@ var SmsFields = function SmsFields(_ref) {
|
|
|
1881
1838
|
touched = _useFormikContext.touched,
|
|
1882
1839
|
setFieldValue = _useFormikContext.setFieldValue;
|
|
1883
1840
|
var _useState = react.useState(false),
|
|
1884
|
-
_useState2 =
|
|
1841
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1885
1842
|
showPane = _useState2[0],
|
|
1886
1843
|
setShowPane = _useState2[1];
|
|
1887
1844
|
var initialFocusRef = react.useRef(null);
|
|
@@ -1911,17 +1868,17 @@ var SmsFields = function SmsFields(_ref) {
|
|
|
1911
1868
|
return field === "phoneNumbers" ? true : !showPhoneNumberInput;
|
|
1912
1869
|
};
|
|
1913
1870
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1914
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1871
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1915
1872
|
className: "neeto-ui-text-gray-700",
|
|
1916
1873
|
"data-cy": "sms-action-separator-text",
|
|
1917
1874
|
style: "h5",
|
|
1918
1875
|
weight: "normal",
|
|
1919
1876
|
children: separator
|
|
1920
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1877
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1921
1878
|
"data-cy": "sms-action-button",
|
|
1922
1879
|
label: defaultLabel.toLowerCase(),
|
|
1923
1880
|
style: "link",
|
|
1924
|
-
className:
|
|
1881
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
1925
1882
|
"neeto-ui-text-accent-800": showPane,
|
|
1926
1883
|
"neeto-ui-text-error-500": isValid
|
|
1927
1884
|
}),
|
|
@@ -1930,22 +1887,22 @@ var SmsFields = function SmsFields(_ref) {
|
|
|
1930
1887
|
return !prevState;
|
|
1931
1888
|
});
|
|
1932
1889
|
}
|
|
1933
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
1890
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Pane, {
|
|
1934
1891
|
initialFocusRef: initialFocusRef,
|
|
1935
1892
|
isOpen: showPane,
|
|
1936
1893
|
size: "large",
|
|
1937
1894
|
onClose: function onClose() {
|
|
1938
1895
|
return setShowPane(false);
|
|
1939
1896
|
},
|
|
1940
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1941
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1897
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
|
|
1898
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1942
1899
|
className: "neeto-ui-text-gray-800 cursor-pointer",
|
|
1943
1900
|
"data-cy": "sms-action-pane-header-title",
|
|
1944
1901
|
style: "h3",
|
|
1945
1902
|
weight: "semibold",
|
|
1946
1903
|
children: defaultLabel
|
|
1947
1904
|
})
|
|
1948
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1905
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
|
|
1949
1906
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1950
1907
|
className: "w-full",
|
|
1951
1908
|
children: [isTemplateSelectionEnabled && /*#__PURE__*/jsxRuntime.jsx(SelectTemplateField, {
|
|
@@ -1969,7 +1926,7 @@ var SmsFields = function SmsFields(_ref) {
|
|
|
1969
1926
|
variables: selectedField === null || selectedField === void 0 ? void 0 : selectedField.variables
|
|
1970
1927
|
})]
|
|
1971
1928
|
})
|
|
1972
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1929
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
|
|
1973
1930
|
children: /*#__PURE__*/jsxRuntime.jsx(PaneFooterBlock, {
|
|
1974
1931
|
setShowPane: setShowPane
|
|
1975
1932
|
})
|
|
@@ -2153,7 +2110,7 @@ var ActionSubItems = function ActionSubItems(_ref) {
|
|
|
2153
2110
|
var ActionSubItem = /*#__PURE__*/react.memo(ActionSubItems);
|
|
2154
2111
|
|
|
2155
2112
|
function ownKeys$f(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; }
|
|
2156
|
-
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) {
|
|
2113
|
+
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2157
2114
|
var getSchemaForStrings = function getSchemaForStrings(element) {
|
|
2158
2115
|
var label = element.label,
|
|
2159
2116
|
_element$componentPro = element.componentProps,
|
|
@@ -2430,7 +2387,7 @@ var getSchemaForElement = function getSchemaForElement(element, customData) {
|
|
|
2430
2387
|
var getValidationSchema = function getValidationSchema(data, customData) {
|
|
2431
2388
|
var fieldKeys = Object.keys(data);
|
|
2432
2389
|
var schema = fieldKeys.reduce(function (acc, key) {
|
|
2433
|
-
return _objectSpread$f(_objectSpread$f({}, acc), {},
|
|
2390
|
+
return _objectSpread$f(_objectSpread$f({}, acc), {}, _defineProperty({}, key, yup__namespace.object({
|
|
2434
2391
|
value: getSchemaForElement(data[key], customData)
|
|
2435
2392
|
})));
|
|
2436
2393
|
}, {});
|
|
@@ -2449,7 +2406,7 @@ var FIELD_TYPES = {
|
|
|
2449
2406
|
executionDelay: "execution-delay"
|
|
2450
2407
|
};
|
|
2451
2408
|
var MAXIMUM_OPTION_LENGTH$1 = 7;
|
|
2452
|
-
var VALIDATION_SCHEMA =
|
|
2409
|
+
var VALIDATION_SCHEMA = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FIELD_TYPES.text, getSchemaForStrings), FIELD_TYPES.longText, getSchemaForStrings), FIELD_TYPES.dropdown, getSchemaForStrings), FIELD_TYPES.radio, getSchemaForStrings), FIELD_TYPES.events, getEventsSchema), FIELD_TYPES.condition, getConditionsSchema), FIELD_TYPES.actions, getActionsSchema), FIELD_TYPES.multiSelect, getSchemaForArray), FIELD_TYPES.executionDelay, getSchemaForExecutionDelay);
|
|
2453
2410
|
var DECIMAL_NUMBER_REGEX = /^-?\d*\.?\d+$/;
|
|
2454
2411
|
var NUMBER_REGEX = /^-?\d+$/;
|
|
2455
2412
|
var POSITIVE_DECIMAL_NUMBER_REGEX = /^\d*\.?\d+$/;
|
|
@@ -2470,8 +2427,8 @@ var DEFAULT_INITIAL_VALUE = {
|
|
|
2470
2427
|
}
|
|
2471
2428
|
};
|
|
2472
2429
|
|
|
2473
|
-
var Menu$7 =
|
|
2474
|
-
MenuItem$7 =
|
|
2430
|
+
var Menu$7 = Dropdown$1.Menu,
|
|
2431
|
+
MenuItem$7 = Dropdown$1.MenuItem;
|
|
2475
2432
|
var ActionItem = function ActionItem(_ref) {
|
|
2476
2433
|
var _errors$actions, _errors$actions$value, _touched$actions, _touched$actions$valu, _selectedOption$label;
|
|
2477
2434
|
var name = _ref.name,
|
|
@@ -2487,15 +2444,15 @@ var ActionItem = function ActionItem(_ref) {
|
|
|
2487
2444
|
var _useState = react.useState({
|
|
2488
2445
|
label: t("neetoRules.form.doThis")
|
|
2489
2446
|
}),
|
|
2490
|
-
_useState2 =
|
|
2447
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2491
2448
|
selectedOption = _useState2[0],
|
|
2492
2449
|
setSelectedOption = _useState2[1];
|
|
2493
2450
|
var _useState3 = react.useState(false),
|
|
2494
|
-
_useState4 =
|
|
2451
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
2495
2452
|
isActive = _useState4[0],
|
|
2496
2453
|
setIsActive = _useState4[1];
|
|
2497
2454
|
var _useState5 = react.useState(""),
|
|
2498
|
-
_useState6 =
|
|
2455
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
2499
2456
|
searchTerm = _useState6[0],
|
|
2500
2457
|
setSearchTerm = _useState6[1];
|
|
2501
2458
|
var _useFormikContext = formik.useFormikContext(),
|
|
@@ -2558,7 +2515,7 @@ var ActionItem = function ActionItem(_ref) {
|
|
|
2558
2515
|
_ref3$disabledReason = _ref3.disabledReason,
|
|
2559
2516
|
disabledReason = _ref3$disabledReason === void 0 ? "" : _ref3$disabledReason;
|
|
2560
2517
|
var renderErrorCallout = function renderErrorCallout(message) {
|
|
2561
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
2518
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
2562
2519
|
className: "neeto-ui-text-white neeto-ui-bg-error-500 neeto-ui-rounded-sm -mx-4 w-full p-3",
|
|
2563
2520
|
style: "h5",
|
|
2564
2521
|
children: message
|
|
@@ -2580,20 +2537,20 @@ var ActionItem = function ActionItem(_ref) {
|
|
|
2580
2537
|
className: "flex max-w-2xl flex-wrap gap-x-1 gap-y-3",
|
|
2581
2538
|
children: [selectDropDownHasError && renderErrorCallout(selectDropDownErrorMessage), !isMessageToSlackAction && isDisabled && renderDisabledReason(), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2582
2539
|
className: "flex flex-wrap items-center gap-x-2 gap-y-3",
|
|
2583
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
2540
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
2584
2541
|
className: "neeto-ui-text-gray-700",
|
|
2585
2542
|
style: "h5",
|
|
2586
2543
|
weight: "normal",
|
|
2587
2544
|
children: label
|
|
2588
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
2545
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Dropdown$1, {
|
|
2589
2546
|
buttonStyle: "secondary",
|
|
2590
2547
|
className: "neeto-ui-bg-gray-100",
|
|
2591
2548
|
position: "bottom-start",
|
|
2592
|
-
customTarget: /*#__PURE__*/jsxRuntime.jsx(
|
|
2549
|
+
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2593
2550
|
"data-cy": "action-dropdown-button",
|
|
2594
2551
|
label: selectedOption === null || selectedOption === void 0 ? void 0 : (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
2595
2552
|
style: "link",
|
|
2596
|
-
className:
|
|
2553
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
2597
2554
|
"neeto-ui-text-accent-800": isActive,
|
|
2598
2555
|
"neeto-ui-text-error-500": isActionSelected
|
|
2599
2556
|
}),
|
|
@@ -2606,11 +2563,11 @@ var ActionItem = function ActionItem(_ref) {
|
|
|
2606
2563
|
onClose: handleClose,
|
|
2607
2564
|
children: /*#__PURE__*/jsxRuntime.jsxs(Menu$7, {
|
|
2608
2565
|
className: "max-h-60 max-w-2xl p-3",
|
|
2609
|
-
children: [actionOptions.length > MAXIMUM_OPTION_LENGTH$1 && /*#__PURE__*/jsxRuntime.jsx(
|
|
2566
|
+
children: [actionOptions.length > MAXIMUM_OPTION_LENGTH$1 && /*#__PURE__*/jsxRuntime.jsx(Input$1, {
|
|
2610
2567
|
autoFocus: true,
|
|
2611
2568
|
"data-cy": "search-text-field",
|
|
2612
2569
|
placeholder: t("neetoRules.common.search"),
|
|
2613
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
2570
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Search, {}),
|
|
2614
2571
|
value: searchTerm,
|
|
2615
2572
|
onChange: function onChange(e) {
|
|
2616
2573
|
return setSearchTerm(e.target.value);
|
|
@@ -2623,7 +2580,7 @@ var ActionItem = function ActionItem(_ref) {
|
|
|
2623
2580
|
children: searchedOptions.map(function (option, idx) {
|
|
2624
2581
|
return /*#__PURE__*/jsxRuntime.jsx(MenuItem$7.Button, {
|
|
2625
2582
|
"data-cy": "".concat(utils.joinHyphenCase(option.label), "-menu-item"),
|
|
2626
|
-
suffix: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value && /*#__PURE__*/jsxRuntime.jsx(
|
|
2583
|
+
suffix: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value && /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
2627
2584
|
className: "neeto-ui-text-primary-800"
|
|
2628
2585
|
}),
|
|
2629
2586
|
onClick: function onClick() {
|
|
@@ -2658,7 +2615,7 @@ var Card = function Card(_ref) {
|
|
|
2658
2615
|
var title = _ref.title,
|
|
2659
2616
|
children = _ref.children;
|
|
2660
2617
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2661
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
2618
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
2662
2619
|
className: "neeto-ui-text-gray-600",
|
|
2663
2620
|
"data-cy": "".concat(utils.joinHyphenCase(title), "-card-title"),
|
|
2664
2621
|
style: "h4",
|
|
@@ -2671,7 +2628,7 @@ var Card = function Card(_ref) {
|
|
|
2671
2628
|
};
|
|
2672
2629
|
|
|
2673
2630
|
function ownKeys$e(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; }
|
|
2674
|
-
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) {
|
|
2631
|
+
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2675
2632
|
var Actions = function Actions(_ref) {
|
|
2676
2633
|
var name = _ref.name,
|
|
2677
2634
|
label = _ref.label,
|
|
@@ -2697,7 +2654,7 @@ var Actions = function Actions(_ref) {
|
|
|
2697
2654
|
}, [actions]);
|
|
2698
2655
|
var handleRemoveAction = function handleRemoveAction(index, action, arrayHelpers) {
|
|
2699
2656
|
if (action.id) {
|
|
2700
|
-
setFieldValue("".concat(name, ".deleted"), [].concat(
|
|
2657
|
+
setFieldValue("".concat(name, ".deleted"), [].concat(_toConsumableArray(values[name].deleted || []), [_objectSpread$e(_objectSpread$e({}, action), {}, {
|
|
2701
2658
|
_destroy: true
|
|
2702
2659
|
})]));
|
|
2703
2660
|
}
|
|
@@ -2723,9 +2680,9 @@ var Actions = function Actions(_ref) {
|
|
|
2723
2680
|
parentName: name
|
|
2724
2681
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2725
2682
|
className: "-mx-1 flex flex-wrap",
|
|
2726
|
-
children: [handleSlackChannelRefresh && action.name === "message_to_slack" && /*#__PURE__*/jsxRuntime.jsx(
|
|
2683
|
+
children: [handleSlackChannelRefresh && action.name === "message_to_slack" && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2727
2684
|
"data-cy": "refresh-slack-button",
|
|
2728
|
-
icon:
|
|
2685
|
+
icon: Refresh,
|
|
2729
2686
|
size: 24,
|
|
2730
2687
|
style: "icon",
|
|
2731
2688
|
tooltipProps: {
|
|
@@ -2735,9 +2692,9 @@ var Actions = function Actions(_ref) {
|
|
|
2735
2692
|
onClick: function onClick() {
|
|
2736
2693
|
return handleSlackChannelRefresh();
|
|
2737
2694
|
}
|
|
2738
|
-
}), showButton && index === actions.length - 1 && /*#__PURE__*/jsxRuntime.jsx(
|
|
2695
|
+
}), showButton && index === actions.length - 1 && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2739
2696
|
"data-cy": "add-action-button",
|
|
2740
|
-
icon:
|
|
2697
|
+
icon: Plus,
|
|
2741
2698
|
size: 24,
|
|
2742
2699
|
style: "icon",
|
|
2743
2700
|
tooltipProps: {
|
|
@@ -2747,9 +2704,9 @@ var Actions = function Actions(_ref) {
|
|
|
2747
2704
|
onClick: function onClick() {
|
|
2748
2705
|
return arrayHelpers.push(DEFAULT_RULE_ACTION);
|
|
2749
2706
|
}
|
|
2750
|
-
}), actions.length > 1 && /*#__PURE__*/jsxRuntime.jsx(
|
|
2707
|
+
}), actions.length > 1 && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2751
2708
|
"data-cy": "delete-action-button-".concat(index),
|
|
2752
|
-
icon:
|
|
2709
|
+
icon: Delete,
|
|
2753
2710
|
size: 24,
|
|
2754
2711
|
style: "icon",
|
|
2755
2712
|
tooltipProps: {
|
|
@@ -2800,8 +2757,8 @@ var getAllOptions = function getAllOptions(options) {
|
|
|
2800
2757
|
}) : [];
|
|
2801
2758
|
};
|
|
2802
2759
|
|
|
2803
|
-
var Menu$6 =
|
|
2804
|
-
MenuItem$6 =
|
|
2760
|
+
var Menu$6 = Dropdown$1.Menu,
|
|
2761
|
+
MenuItem$6 = Dropdown$1.MenuItem;
|
|
2805
2762
|
var DropdownField = function DropdownField(_ref) {
|
|
2806
2763
|
var _selectedOption$label;
|
|
2807
2764
|
var index = _ref.index,
|
|
@@ -2815,15 +2772,15 @@ var DropdownField = function DropdownField(_ref) {
|
|
|
2815
2772
|
t = _useTranslation.t;
|
|
2816
2773
|
var defaultSelectedValue = fieldType === "field" ? conditions.value[index].field : conditions.value[index].verb;
|
|
2817
2774
|
var _useState = react.useState(neetoCist.toLabelAndValue(placeholder)),
|
|
2818
|
-
_useState2 =
|
|
2775
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2819
2776
|
selectedOption = _useState2[0],
|
|
2820
2777
|
setSelectedOption = _useState2[1];
|
|
2821
2778
|
var _useState3 = react.useState(false),
|
|
2822
|
-
_useState4 =
|
|
2779
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
2823
2780
|
isSelected = _useState4[0],
|
|
2824
2781
|
setIsSelected = _useState4[1];
|
|
2825
2782
|
var _useState5 = react.useState(""),
|
|
2826
|
-
_useState6 =
|
|
2783
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
2827
2784
|
searchTerm = _useState6[0],
|
|
2828
2785
|
setSearchTerm = _useState6[1];
|
|
2829
2786
|
var searchedOptions = getSearchedOptions$2(options, searchTerm);
|
|
@@ -2842,15 +2799,15 @@ var DropdownField = function DropdownField(_ref) {
|
|
|
2842
2799
|
react.useEffect(function () {
|
|
2843
2800
|
findDefaultOption();
|
|
2844
2801
|
}, [options, conditions]);
|
|
2845
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
2802
|
+
return /*#__PURE__*/jsxRuntime.jsx(Dropdown$1, {
|
|
2846
2803
|
buttonStyle: "secondary",
|
|
2847
2804
|
className: "neeto-ui-bg-gray-100",
|
|
2848
2805
|
position: "bottom-start",
|
|
2849
|
-
customTarget: /*#__PURE__*/jsxRuntime.jsx(
|
|
2806
|
+
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2850
2807
|
"data-cy": "condition-".concat(fieldType, "-dropdown-button"),
|
|
2851
2808
|
label: selectedOption === null || selectedOption === void 0 ? void 0 : (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
2852
2809
|
style: "link",
|
|
2853
|
-
className:
|
|
2810
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
2854
2811
|
"neeto-ui-text-accent-800": isSelected
|
|
2855
2812
|
}),
|
|
2856
2813
|
onClick: function onClick() {
|
|
@@ -2862,11 +2819,11 @@ var DropdownField = function DropdownField(_ref) {
|
|
|
2862
2819
|
onClose: handleClose,
|
|
2863
2820
|
children: /*#__PURE__*/jsxRuntime.jsxs(Menu$6, {
|
|
2864
2821
|
className: "max-h-60 max-w-2xl p-3",
|
|
2865
|
-
children: [options.length > constants.MAXIMUM_OPTION_LENGTH && /*#__PURE__*/jsxRuntime.jsx(
|
|
2822
|
+
children: [options.length > constants.MAXIMUM_OPTION_LENGTH && /*#__PURE__*/jsxRuntime.jsx(Input$1, {
|
|
2866
2823
|
autoFocus: true,
|
|
2867
2824
|
"data-cy": "search-text-field",
|
|
2868
2825
|
placeholder: t("neetoRules.common.search"),
|
|
2869
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
2826
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Search, {}),
|
|
2870
2827
|
value: searchTerm,
|
|
2871
2828
|
onChange: function onChange(e) {
|
|
2872
2829
|
return setSearchTerm(e.target.value);
|
|
@@ -2879,10 +2836,10 @@ var DropdownField = function DropdownField(_ref) {
|
|
|
2879
2836
|
children: searchedOptions.map(function (option, idx) {
|
|
2880
2837
|
return /*#__PURE__*/jsxRuntime.jsx(MenuItem$6.Button, {
|
|
2881
2838
|
"data-cy": "".concat(utils.joinHyphenCase(option.label), "-menu-item"),
|
|
2882
|
-
className:
|
|
2839
|
+
className: classNames({
|
|
2883
2840
|
"neeto-ui-bg-gray-100": selectedOption.value === option.value
|
|
2884
2841
|
}),
|
|
2885
|
-
suffix: selectedOption.value === option.value && /*#__PURE__*/jsxRuntime.jsx(
|
|
2842
|
+
suffix: selectedOption.value === option.value && /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
2886
2843
|
className: "neeto-ui-text-primary-800",
|
|
2887
2844
|
"data-cy": "check-icon"
|
|
2888
2845
|
}),
|
|
@@ -2901,8 +2858,8 @@ var DropdownField = function DropdownField(_ref) {
|
|
|
2901
2858
|
});
|
|
2902
2859
|
};
|
|
2903
2860
|
|
|
2904
|
-
var Menu$5 =
|
|
2905
|
-
MenuItem$5 =
|
|
2861
|
+
var Menu$5 = Dropdown$1.Menu,
|
|
2862
|
+
MenuItem$5 = Dropdown$1.MenuItem;
|
|
2906
2863
|
var Dropdown = function Dropdown(_ref) {
|
|
2907
2864
|
var _conditions$value$ind, _errors$conditions, _errors$conditions$va, _touched$conditions, _touched$conditions$v, _defaultSelectedOptio;
|
|
2908
2865
|
var name = _ref.name,
|
|
@@ -2920,15 +2877,15 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
2920
2877
|
var _useState = react.useState({
|
|
2921
2878
|
label: defaultLabel
|
|
2922
2879
|
}),
|
|
2923
|
-
_useState2 =
|
|
2880
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2924
2881
|
defaultSelectedOption = _useState2[0],
|
|
2925
2882
|
setDefaultSelectedOption = _useState2[1];
|
|
2926
2883
|
var _useState3 = react.useState(false),
|
|
2927
|
-
_useState4 =
|
|
2884
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
2928
2885
|
isActive = _useState4[0],
|
|
2929
2886
|
setIsActive = _useState4[1];
|
|
2930
2887
|
var _useState5 = react.useState(""),
|
|
2931
|
-
_useState6 =
|
|
2888
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
2932
2889
|
searchTerm = _useState6[0],
|
|
2933
2890
|
setSearchTerm = _useState6[1];
|
|
2934
2891
|
var defaultValue = (_conditions$value$ind = conditions.value[index].metadata) === null || _conditions$value$ind === void 0 ? void 0 : _conditions$value$ind.value;
|
|
@@ -2963,14 +2920,14 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
2963
2920
|
react.useEffect(function () {
|
|
2964
2921
|
findDefaultSelectedOption();
|
|
2965
2922
|
}, [options, conditions]);
|
|
2966
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
2923
|
+
return /*#__PURE__*/jsxRuntime.jsx(Dropdown$1, {
|
|
2967
2924
|
buttonStyle: "secondary",
|
|
2968
2925
|
className: "neeto-ui-bg-gray-100",
|
|
2969
|
-
customTarget: /*#__PURE__*/jsxRuntime.jsx(
|
|
2926
|
+
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2970
2927
|
"data-cy": "condition-value-dropdown-button",
|
|
2971
2928
|
label: defaultSelectedOption === null || defaultSelectedOption === void 0 ? void 0 : (_defaultSelectedOptio = defaultSelectedOption.label) === null || _defaultSelectedOptio === void 0 ? void 0 : _defaultSelectedOptio.toLowerCase(),
|
|
2972
2929
|
style: "link",
|
|
2973
|
-
className:
|
|
2930
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
2974
2931
|
"neeto-ui-text-accent-800": isActive,
|
|
2975
2932
|
"neeto-ui-text-error-500": isValueSelected
|
|
2976
2933
|
}),
|
|
@@ -2984,11 +2941,11 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
2984
2941
|
onClose: handleClose,
|
|
2985
2942
|
children: /*#__PURE__*/jsxRuntime.jsxs(Menu$5, {
|
|
2986
2943
|
className: "max-h-60 max-w-2xl p-3",
|
|
2987
|
-
children: [options.length > constants.MAXIMUM_OPTION_LENGTH && /*#__PURE__*/jsxRuntime.jsx(
|
|
2944
|
+
children: [options.length > constants.MAXIMUM_OPTION_LENGTH && /*#__PURE__*/jsxRuntime.jsx(Input$1, {
|
|
2988
2945
|
autoFocus: true,
|
|
2989
2946
|
"data-cy": "search-text-field",
|
|
2990
2947
|
placeholder: t("neetoRules.common.search"),
|
|
2991
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
2948
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Search, {}),
|
|
2992
2949
|
value: searchTerm,
|
|
2993
2950
|
onChange: function onChange(e) {
|
|
2994
2951
|
return setSearchTerm(e.target.value);
|
|
@@ -3001,10 +2958,10 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
3001
2958
|
children: searchedOptions.map(function (option, idx) {
|
|
3002
2959
|
return /*#__PURE__*/jsxRuntime.jsx(MenuItem$5.Button, {
|
|
3003
2960
|
"data-cy": "".concat(utils.joinHyphenCase(option.label), "-menu-item"),
|
|
3004
|
-
className:
|
|
2961
|
+
className: classNames({
|
|
3005
2962
|
"neeto-ui-bg-gray-100": (defaultSelectedOption === null || defaultSelectedOption === void 0 ? void 0 : defaultSelectedOption.value) === option.value
|
|
3006
2963
|
}),
|
|
3007
|
-
suffix: (defaultSelectedOption === null || defaultSelectedOption === void 0 ? void 0 : defaultSelectedOption.value) === option.value && /*#__PURE__*/jsxRuntime.jsx(
|
|
2964
|
+
suffix: (defaultSelectedOption === null || defaultSelectedOption === void 0 ? void 0 : defaultSelectedOption.value) === option.value && /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
3008
2965
|
className: "neeto-ui-text-primary-800"
|
|
3009
2966
|
}),
|
|
3010
2967
|
onClick: function onClick() {
|
|
@@ -3031,7 +2988,7 @@ var InputField$1 = function InputField(_ref) {
|
|
|
3031
2988
|
errors = _useFormikContext.errors,
|
|
3032
2989
|
touched = _useFormikContext.touched;
|
|
3033
2990
|
var _useState = react.useState(false),
|
|
3034
|
-
_useState2 =
|
|
2991
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3035
2992
|
showInput = _useState2[0],
|
|
3036
2993
|
setShowInput = _useState2[1];
|
|
3037
2994
|
var inputRef = react.useRef(null);
|
|
@@ -3047,12 +3004,12 @@ var InputField$1 = function InputField(_ref) {
|
|
|
3047
3004
|
react.useEffect(function () {
|
|
3048
3005
|
setShowInput(false);
|
|
3049
3006
|
}, [condition.verb]);
|
|
3050
|
-
return showInput ? /*#__PURE__*/jsxRuntime.jsx(
|
|
3007
|
+
return showInput ? /*#__PURE__*/jsxRuntime.jsx(Input$2, {
|
|
3051
3008
|
name: name,
|
|
3052
3009
|
placeholder: placeholder,
|
|
3053
3010
|
ref: inputRef,
|
|
3054
3011
|
size: "small",
|
|
3055
|
-
suffix: /*#__PURE__*/jsxRuntime.jsx(
|
|
3012
|
+
suffix: /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
3056
3013
|
className: "cursor-pointer",
|
|
3057
3014
|
onClick: function onClick() {
|
|
3058
3015
|
return setShowInput(function (prevState) {
|
|
@@ -3060,10 +3017,10 @@ var InputField$1 = function InputField(_ref) {
|
|
|
3060
3017
|
});
|
|
3061
3018
|
}
|
|
3062
3019
|
})
|
|
3063
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(
|
|
3020
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3064
3021
|
label: label,
|
|
3065
3022
|
style: "link",
|
|
3066
|
-
className:
|
|
3023
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
3067
3024
|
"neeto-ui-text-error-500": isValid
|
|
3068
3025
|
}),
|
|
3069
3026
|
onClick: function onClick() {
|
|
@@ -3074,8 +3031,8 @@ var InputField$1 = function InputField(_ref) {
|
|
|
3074
3031
|
});
|
|
3075
3032
|
};
|
|
3076
3033
|
|
|
3077
|
-
var Menu$4 =
|
|
3078
|
-
MenuItem$4 =
|
|
3034
|
+
var Menu$4 = Dropdown$1.Menu,
|
|
3035
|
+
MenuItem$4 = Dropdown$1.MenuItem;
|
|
3079
3036
|
var MultiSelect = function MultiSelect(_ref) {
|
|
3080
3037
|
var _conditions$value$ind, _conditions$value$ind2, _errors$conditions, _errors$conditions$va, _touched$conditions, _touched$conditions$v;
|
|
3081
3038
|
var name = _ref.name,
|
|
@@ -3088,11 +3045,11 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
3088
3045
|
touched = _useFormikContext.touched,
|
|
3089
3046
|
setTouched = _useFormikContext.setTouched;
|
|
3090
3047
|
var _useState = react.useState(null),
|
|
3091
|
-
_useState2 =
|
|
3048
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3092
3049
|
activeOption = _useState2[0],
|
|
3093
3050
|
setActiveOption = _useState2[1];
|
|
3094
3051
|
var _useState3 = react.useState(""),
|
|
3095
|
-
_useState4 =
|
|
3052
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3096
3053
|
searchTerm = _useState4[0],
|
|
3097
3054
|
setSearchTerm = _useState4[1];
|
|
3098
3055
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -3113,7 +3070,7 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
3113
3070
|
setActiveOption(null);
|
|
3114
3071
|
setSearchTerm("");
|
|
3115
3072
|
};
|
|
3116
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
3073
|
+
return /*#__PURE__*/jsxRuntime.jsx(Dropdown$1, {
|
|
3117
3074
|
buttonStyle: "secondary",
|
|
3118
3075
|
className: "neeto-ui-bg-gray-100",
|
|
3119
3076
|
closeOnSelect: false,
|
|
@@ -3123,16 +3080,16 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
3123
3080
|
children: options.map(function (option, idx) {
|
|
3124
3081
|
var _option$label;
|
|
3125
3082
|
return /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
|
|
3126
|
-
children: [!!idx && /*#__PURE__*/jsxRuntime.jsx(
|
|
3083
|
+
children: [!!idx && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
3127
3084
|
className: "neeto-ui-text-gray-700",
|
|
3128
3085
|
style: "h5",
|
|
3129
3086
|
weight: "normal",
|
|
3130
3087
|
children: t("neetoRules.common.or")
|
|
3131
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3088
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3132
3089
|
"data-cy": "condition-value-multi-select-field",
|
|
3133
3090
|
label: option === null || option === void 0 ? void 0 : (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.toLowerCase(),
|
|
3134
3091
|
style: "link",
|
|
3135
|
-
className:
|
|
3092
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
3136
3093
|
"neeto-ui-text-accent-800": activeOption === option.value
|
|
3137
3094
|
}),
|
|
3138
3095
|
onClick: function onClick() {
|
|
@@ -3142,11 +3099,11 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
3142
3099
|
})]
|
|
3143
3100
|
}, idx);
|
|
3144
3101
|
})
|
|
3145
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(
|
|
3102
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3146
3103
|
"data-cy": "condition-value-multi-select-field",
|
|
3147
3104
|
label: defaultLabel,
|
|
3148
3105
|
style: "link",
|
|
3149
|
-
className:
|
|
3106
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
3150
3107
|
"neeto-ui-text-accent-800": activeOption === defaultLabel,
|
|
3151
3108
|
"neeto-ui-text-error-500": isValid
|
|
3152
3109
|
}),
|
|
@@ -3158,12 +3115,12 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
3158
3115
|
onClose: handleClose,
|
|
3159
3116
|
children: /*#__PURE__*/jsxRuntime.jsxs(Menu$4, {
|
|
3160
3117
|
className: "max-h-60 max-w-2xl p-3",
|
|
3161
|
-
children: [dropDownOptions.length > constants.MAXIMUM_OPTION_LENGTH && /*#__PURE__*/jsxRuntime.jsx(
|
|
3118
|
+
children: [dropDownOptions.length > constants.MAXIMUM_OPTION_LENGTH && /*#__PURE__*/jsxRuntime.jsx(Input$1, {
|
|
3162
3119
|
autoFocus: true,
|
|
3163
3120
|
className: "mb-1",
|
|
3164
3121
|
"data-cy": "search-text-field",
|
|
3165
3122
|
placeholder: t("neetoRules.common.search"),
|
|
3166
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
3123
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Search, {}),
|
|
3167
3124
|
value: searchTerm,
|
|
3168
3125
|
onChange: function onChange(e) {
|
|
3169
3126
|
return setSearchTerm(e.target.value);
|
|
@@ -3173,7 +3130,7 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
3173
3130
|
children: searchedOptions.map(function (option, idx) {
|
|
3174
3131
|
return /*#__PURE__*/jsxRuntime.jsx(MenuItem$4.Button, {
|
|
3175
3132
|
"data-cy": "".concat(utils.joinHyphenCase(option.label), "-menu-item"),
|
|
3176
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
3133
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Checkbox, {
|
|
3177
3134
|
checked: selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.includes(option.value),
|
|
3178
3135
|
"data-cy": "check-icon",
|
|
3179
3136
|
id: option.value
|
|
@@ -3194,12 +3151,12 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
3194
3151
|
|
|
3195
3152
|
var _excluded$7 = ["name", "index"];
|
|
3196
3153
|
function ownKeys$d(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; }
|
|
3197
|
-
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) {
|
|
3154
|
+
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3198
3155
|
var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
3199
3156
|
var _conditions$value$ind, _conditions$value$ind2, _errors$conditions, _errors$conditions$va, _touched$conditions, _touched$conditions$v;
|
|
3200
3157
|
var name = _ref.name,
|
|
3201
3158
|
index = _ref.index,
|
|
3202
|
-
props =
|
|
3159
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
3203
3160
|
var _useTranslation = reactI18next.useTranslation(),
|
|
3204
3161
|
t = _useTranslation.t;
|
|
3205
3162
|
var _useFormikContext = formik.useFormikContext(),
|
|
@@ -3209,7 +3166,7 @@ var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
|
3209
3166
|
touched = _useFormikContext.touched,
|
|
3210
3167
|
setTouched = _useFormikContext.setTouched;
|
|
3211
3168
|
var _useState = react.useState(false),
|
|
3212
|
-
_useState2 =
|
|
3169
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3213
3170
|
showPane = _useState2[0],
|
|
3214
3171
|
setShowPane = _useState2[1];
|
|
3215
3172
|
var initialFocusRef = react.useRef(null);
|
|
@@ -3221,11 +3178,11 @@ var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
|
3221
3178
|
var defaultLabel = t("neetoRules.form.selectValues");
|
|
3222
3179
|
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0 ? void 0 : (_errors$conditions$va = _errors$conditions.value) === null || _errors$conditions$va === void 0 ? void 0 : _errors$conditions$va[index]) && ramda.isNotNil((_touched$conditions = touched.conditions) === null || _touched$conditions === void 0 ? void 0 : (_touched$conditions$v = _touched$conditions.value) === null || _touched$conditions$v === void 0 ? void 0 : _touched$conditions$v[index]);
|
|
3223
3180
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3224
|
-
children: [ramda.isEmpty(allOptions) && /*#__PURE__*/jsxRuntime.jsx(
|
|
3181
|
+
children: [ramda.isEmpty(allOptions) && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3225
3182
|
"data-cy": "condition-value-multi-select-create-button",
|
|
3226
3183
|
label: defaultLabel,
|
|
3227
3184
|
style: "link",
|
|
3228
|
-
className:
|
|
3185
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
3229
3186
|
"neeto-ui-text-error-500": isValid
|
|
3230
3187
|
}),
|
|
3231
3188
|
onClick: function onClick() {
|
|
@@ -3236,12 +3193,12 @@ var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
|
3236
3193
|
}
|
|
3237
3194
|
}), allOptions.map(function (option, idx) {
|
|
3238
3195
|
return /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
|
|
3239
|
-
children: [!!idx && /*#__PURE__*/jsxRuntime.jsx(
|
|
3196
|
+
children: [!!idx && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
3240
3197
|
className: "neeto-ui-text-gray-700",
|
|
3241
3198
|
style: "h5",
|
|
3242
3199
|
weight: "normal",
|
|
3243
3200
|
children: t("neetoRules.common.or")
|
|
3244
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3201
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3245
3202
|
className: "neeto-ui-text-gray-800 neeto-ui-font-semibold underline",
|
|
3246
3203
|
"data-cy": "condition-value-multi-select-create-button",
|
|
3247
3204
|
label: option.label,
|
|
@@ -3253,22 +3210,22 @@ var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
|
3253
3210
|
}
|
|
3254
3211
|
})]
|
|
3255
3212
|
}, idx);
|
|
3256
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
3213
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Pane, {
|
|
3257
3214
|
initialFocusRef: initialFocusRef,
|
|
3258
3215
|
isOpen: showPane,
|
|
3259
3216
|
size: "large",
|
|
3260
3217
|
onClose: function onClose() {
|
|
3261
3218
|
return setShowPane(false);
|
|
3262
3219
|
},
|
|
3263
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
3264
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
3220
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
|
|
3221
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
3265
3222
|
className: "neeto-ui-text-gray-700",
|
|
3266
3223
|
"data-cy": "multi-select-create-pane-header-title",
|
|
3267
3224
|
style: "h3",
|
|
3268
3225
|
children: t("neetoRules.labels.multipleValues")
|
|
3269
3226
|
})
|
|
3270
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3271
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
3227
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
|
|
3228
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Select, _objectSpread$d({
|
|
3272
3229
|
isMulti: true,
|
|
3273
3230
|
className: "mt-4 w-full",
|
|
3274
3231
|
"data-cy": "multi-select-create-container",
|
|
@@ -3281,7 +3238,7 @@ var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
|
3281
3238
|
}));
|
|
3282
3239
|
}
|
|
3283
3240
|
}, props))
|
|
3284
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3241
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
|
|
3285
3242
|
children: /*#__PURE__*/jsxRuntime.jsx(PaneFooterBlock, {
|
|
3286
3243
|
setShowPane: setShowPane
|
|
3287
3244
|
})
|
|
@@ -3304,7 +3261,7 @@ var DateField = function DateField(_ref) {
|
|
|
3304
3261
|
touched = _useFormikContext.touched,
|
|
3305
3262
|
setTouched = _useFormikContext.setTouched;
|
|
3306
3263
|
var _useState = react.useState(false),
|
|
3307
|
-
_useState2 =
|
|
3264
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3308
3265
|
showInput = _useState2[0],
|
|
3309
3266
|
setShowInput = _useState2[1];
|
|
3310
3267
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -3313,8 +3270,8 @@ var DateField = function DateField(_ref) {
|
|
|
3313
3270
|
var label = valueTerm || t("neetoRules.form.selectDate");
|
|
3314
3271
|
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0 ? void 0 : (_errors$conditions$va = _errors$conditions.value) === null || _errors$conditions$va === void 0 ? void 0 : _errors$conditions$va[index]) && ramda.isNotNil((_touched$conditions = touched.conditions) === null || _touched$conditions === void 0 ? void 0 : (_touched$conditions$v = _touched$conditions.value) === null || _touched$conditions$v === void 0 ? void 0 : _touched$conditions$v[index]);
|
|
3315
3272
|
var handleValidate = /*#__PURE__*/function () {
|
|
3316
|
-
var _ref2 =
|
|
3317
|
-
return
|
|
3273
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
3274
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
3318
3275
|
while (1) switch (_context.prev = _context.next) {
|
|
3319
3276
|
case 0:
|
|
3320
3277
|
_context.prev = 0;
|
|
@@ -3350,14 +3307,14 @@ var DateField = function DateField(_ref) {
|
|
|
3350
3307
|
};
|
|
3351
3308
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
3352
3309
|
children: showInput ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3353
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
3310
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DatePicker, {
|
|
3354
3311
|
autoFocus: true,
|
|
3355
3312
|
defaultValue: valueTerm,
|
|
3356
3313
|
name: "".concat(name, ".value"),
|
|
3357
3314
|
showTime: field.showTime,
|
|
3358
3315
|
type: "date",
|
|
3359
3316
|
onChange: handleOnChange
|
|
3360
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3317
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
3361
3318
|
className: "cursor-pointer",
|
|
3362
3319
|
onClick: function onClick() {
|
|
3363
3320
|
return setShowInput(function (prevState) {
|
|
@@ -3365,10 +3322,10 @@ var DateField = function DateField(_ref) {
|
|
|
3365
3322
|
});
|
|
3366
3323
|
}
|
|
3367
3324
|
})]
|
|
3368
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(
|
|
3325
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3369
3326
|
label: label,
|
|
3370
3327
|
style: "link",
|
|
3371
|
-
className:
|
|
3328
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
3372
3329
|
"neeto-ui-text-error-500": isValid
|
|
3373
3330
|
}),
|
|
3374
3331
|
onClick: function onClick() {
|
|
@@ -3493,14 +3450,14 @@ var ConditionItem = function ConditionItem(_ref) {
|
|
|
3493
3450
|
setFieldValue("".concat(name, ".metadata"), {});
|
|
3494
3451
|
};
|
|
3495
3452
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3496
|
-
children: [isWithEvents && !index && /*#__PURE__*/jsxRuntime.jsx(
|
|
3453
|
+
children: [isWithEvents && !index && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
3497
3454
|
className: "neeto-ui-text-gray-700",
|
|
3498
3455
|
style: "h5",
|
|
3499
3456
|
weight: "normal",
|
|
3500
3457
|
children: t("neetoRules.common.and", {
|
|
3501
3458
|
what: ""
|
|
3502
3459
|
})
|
|
3503
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3460
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
3504
3461
|
className: "neeto-ui-text-gray-700",
|
|
3505
3462
|
style: "h5",
|
|
3506
3463
|
weight: "normal",
|
|
@@ -3532,7 +3489,7 @@ var LogicOperator = function LogicOperator(_ref) {
|
|
|
3532
3489
|
var logicOperation = _ref.logicOperation,
|
|
3533
3490
|
handleGroupJoinType = _ref.handleGroupJoinType;
|
|
3534
3491
|
var logicOperationLabel = constants.OPERATOR_LABELS[logicOperation];
|
|
3535
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
3492
|
+
return /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3536
3493
|
className: "neeto-ui-text-gray-800 neeto-ui-font-semibold underline",
|
|
3537
3494
|
"data-cy": "logic-operator-button",
|
|
3538
3495
|
label: logicOperationLabel,
|
|
@@ -3544,7 +3501,7 @@ var LogicOperator = function LogicOperator(_ref) {
|
|
|
3544
3501
|
};
|
|
3545
3502
|
|
|
3546
3503
|
function ownKeys$c(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; }
|
|
3547
|
-
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) {
|
|
3504
|
+
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3548
3505
|
var Conditions = function Conditions(_ref) {
|
|
3549
3506
|
var _field$value;
|
|
3550
3507
|
var data = _ref.data,
|
|
@@ -3559,7 +3516,7 @@ var Conditions = function Conditions(_ref) {
|
|
|
3559
3516
|
_ref$allowEmpty = _ref.allowEmpty,
|
|
3560
3517
|
allowEmpty = _ref$allowEmpty === void 0 ? true : _ref$allowEmpty;
|
|
3561
3518
|
var _useField = formik.useField(name),
|
|
3562
|
-
_useField2 =
|
|
3519
|
+
_useField2 = _slicedToArray(_useField, 3),
|
|
3563
3520
|
field = _useField2[0],
|
|
3564
3521
|
setValue = _useField2[2].setValue;
|
|
3565
3522
|
var _useFormikContext = formik.useFormikContext(),
|
|
@@ -3582,7 +3539,7 @@ var Conditions = function Conditions(_ref) {
|
|
|
3582
3539
|
if (condition.id) {
|
|
3583
3540
|
var _field$value2;
|
|
3584
3541
|
setValue(_objectSpread$c(_objectSpread$c({}, field.value), {}, {
|
|
3585
|
-
deleted: [].concat(
|
|
3542
|
+
deleted: [].concat(_toConsumableArray(((_field$value2 = field.value) === null || _field$value2 === void 0 ? void 0 : _field$value2.deleted) || []), [_objectSpread$c(_objectSpread$c({}, condition), {}, {
|
|
3586
3543
|
_destroy: true
|
|
3587
3544
|
})])
|
|
3588
3545
|
}));
|
|
@@ -3620,9 +3577,9 @@ var Conditions = function Conditions(_ref) {
|
|
|
3620
3577
|
})]
|
|
3621
3578
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3622
3579
|
className: "flex",
|
|
3623
|
-
children: [index === conditions.length - 1 && /*#__PURE__*/jsxRuntime.jsx(
|
|
3580
|
+
children: [index === conditions.length - 1 && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3624
3581
|
"data-cy": "add-condition-button",
|
|
3625
|
-
icon:
|
|
3582
|
+
icon: Plus,
|
|
3626
3583
|
size: "small",
|
|
3627
3584
|
style: "text",
|
|
3628
3585
|
tooltipProps: {
|
|
@@ -3632,9 +3589,9 @@ var Conditions = function Conditions(_ref) {
|
|
|
3632
3589
|
onClick: function onClick() {
|
|
3633
3590
|
return handleAddCondition(arrayHelpers, condition.joinType);
|
|
3634
3591
|
}
|
|
3635
|
-
}), (allowEmpty || index !== 0) && /*#__PURE__*/jsxRuntime.jsx(
|
|
3592
|
+
}), (allowEmpty || index !== 0) && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3636
3593
|
"data-cy": "delete-condition-button-".concat(index),
|
|
3637
|
-
icon:
|
|
3594
|
+
icon: Delete,
|
|
3638
3595
|
size: "small",
|
|
3639
3596
|
style: "text",
|
|
3640
3597
|
tooltipProps: {
|
|
@@ -3647,7 +3604,7 @@ var Conditions = function Conditions(_ref) {
|
|
|
3647
3604
|
})]
|
|
3648
3605
|
})]
|
|
3649
3606
|
}, index);
|
|
3650
|
-
}), ramda.isEmpty(conditions) && /*#__PURE__*/jsxRuntime.jsx(
|
|
3607
|
+
}), ramda.isEmpty(conditions) && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3651
3608
|
className: "neeto-ui-text-gray-600 mr-auto",
|
|
3652
3609
|
"data-cy": "add-condition-button",
|
|
3653
3610
|
label: t("neetoRules.form.addCondition"),
|
|
@@ -3656,10 +3613,10 @@ var Conditions = function Conditions(_ref) {
|
|
|
3656
3613
|
return handleAddCondition(arrayHelpers, constants.OPERATORS.or);
|
|
3657
3614
|
}
|
|
3658
3615
|
}), isCallback && neetoCist.isNotEmpty(conditions) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3659
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
3616
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3660
3617
|
className: "mt-2",
|
|
3661
3618
|
"data-cy": "preview-callback-button",
|
|
3662
|
-
icon:
|
|
3619
|
+
icon: Eye,
|
|
3663
3620
|
label: t("neetoRules.common.preview"),
|
|
3664
3621
|
style: "secondary",
|
|
3665
3622
|
onClick: function onClick() {
|
|
@@ -3684,42 +3641,45 @@ var DEFAULT_DELAY = {
|
|
|
3684
3641
|
};
|
|
3685
3642
|
|
|
3686
3643
|
function ownKeys$b(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; }
|
|
3687
|
-
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) {
|
|
3644
|
+
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3688
3645
|
var AddDelay = function AddDelay(_ref) {
|
|
3689
|
-
var name = _ref.name
|
|
3646
|
+
var name = _ref.name,
|
|
3647
|
+
data = _ref.data;
|
|
3648
|
+
var _ref2 = data[name] || {},
|
|
3649
|
+
_ref2$defaultValue = _ref2.defaultValue,
|
|
3650
|
+
defaultValue = _ref2$defaultValue === void 0 ? DEFAULT_DELAY : _ref2$defaultValue;
|
|
3690
3651
|
var _useField = formik.useField("".concat(name, ".value")),
|
|
3691
|
-
_useField2 =
|
|
3652
|
+
_useField2 = _slicedToArray(_useField, 3),
|
|
3692
3653
|
value = _useField2[0].value;
|
|
3693
3654
|
_useField2[1];
|
|
3694
3655
|
var setValue = _useField2[2].setValue;
|
|
3695
3656
|
var _useState = react.useState(ramda.isEmpty(value)),
|
|
3696
|
-
_useState2 =
|
|
3657
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3697
3658
|
showAddDelayButton = _useState2[0],
|
|
3698
3659
|
setShowAddDelayButton = _useState2[1];
|
|
3699
3660
|
var addDelayButtonRef = react.useRef(null);
|
|
3700
3661
|
var _useTranslation = reactI18next.useTranslation(),
|
|
3701
3662
|
t = _useTranslation.t;
|
|
3702
3663
|
var handleDisplayAddDelayForm = function handleDisplayAddDelayForm() {
|
|
3703
|
-
var _value$value, _value$unit;
|
|
3704
3664
|
setShowAddDelayButton(false);
|
|
3705
3665
|
setValue({
|
|
3706
|
-
value:
|
|
3707
|
-
unit:
|
|
3666
|
+
value: defaultValue.value,
|
|
3667
|
+
unit: defaultValue.unit
|
|
3708
3668
|
});
|
|
3709
3669
|
};
|
|
3710
3670
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3711
3671
|
children: [showAddDelayButton && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3712
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
3713
|
-
icon:
|
|
3672
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3673
|
+
icon: Plus,
|
|
3714
3674
|
ref: addDelayButtonRef,
|
|
3715
3675
|
style: "secondary",
|
|
3716
3676
|
onClick: handleDisplayAddDelayForm
|
|
3717
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
3677
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Popover, {
|
|
3718
3678
|
reference: addDelayButtonRef,
|
|
3719
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
3679
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
3720
3680
|
style: "h4",
|
|
3721
3681
|
children: t("neetoRules.common.addDelay")
|
|
3722
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3682
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
3723
3683
|
lineHeight: "normal",
|
|
3724
3684
|
style: "body2",
|
|
3725
3685
|
children: t("neetoRules.helpText.addDelay")
|
|
@@ -3731,14 +3691,14 @@ var AddDelay = function AddDelay(_ref) {
|
|
|
3731
3691
|
className: "flex h-full w-full items-center justify-between",
|
|
3732
3692
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3733
3693
|
className: "flex items-center gap-x-2",
|
|
3734
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
3694
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
3735
3695
|
style: "body2",
|
|
3736
3696
|
children: t("neetoRules.form.delayExecutionBy")
|
|
3737
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3697
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Input$2, {
|
|
3738
3698
|
name: "".concat(name, ".value.value"),
|
|
3739
3699
|
placeholder: t("neetoRules.placeholders.enterDelay"),
|
|
3740
3700
|
type: "number"
|
|
3741
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3701
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Select$1, {
|
|
3742
3702
|
defaultValue: neetoCist.findBy({
|
|
3743
3703
|
value: value.unit
|
|
3744
3704
|
}, DELAY_UNIT_OPTIONS),
|
|
@@ -3751,8 +3711,8 @@ var AddDelay = function AddDelay(_ref) {
|
|
|
3751
3711
|
}));
|
|
3752
3712
|
}
|
|
3753
3713
|
})]
|
|
3754
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3755
|
-
icon:
|
|
3714
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3715
|
+
icon: Delete,
|
|
3756
3716
|
size: "small",
|
|
3757
3717
|
style: "text",
|
|
3758
3718
|
tooltipProps: {
|
|
@@ -3787,19 +3747,19 @@ var getDropdownOptions = function getDropdownOptions(eventNames, eventOptions) {
|
|
|
3787
3747
|
var _pipe = ramda.pipe(ramda.partition(function (option) {
|
|
3788
3748
|
return eventNames.includes(option.value);
|
|
3789
3749
|
}), function (_ref2) {
|
|
3790
|
-
var _ref3 =
|
|
3750
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
3791
3751
|
included = _ref3[0],
|
|
3792
3752
|
excluded = _ref3[1];
|
|
3793
3753
|
return [included, excluded];
|
|
3794
3754
|
})(eventOptions),
|
|
3795
|
-
_pipe2 =
|
|
3755
|
+
_pipe2 = _slicedToArray(_pipe, 2),
|
|
3796
3756
|
includedOptions = _pipe2[0],
|
|
3797
3757
|
excludedOptions = _pipe2[1];
|
|
3798
|
-
return [].concat(
|
|
3758
|
+
return [].concat(_toConsumableArray(includedOptions), _toConsumableArray(excludedOptions));
|
|
3799
3759
|
};
|
|
3800
3760
|
|
|
3801
|
-
var Menu$3 =
|
|
3802
|
-
MenuItem$3 =
|
|
3761
|
+
var Menu$3 = Dropdown$1.Menu,
|
|
3762
|
+
MenuItem$3 = Dropdown$1.MenuItem;
|
|
3803
3763
|
var Performer$1 = function Performer(_ref) {
|
|
3804
3764
|
var _selectedOption$label;
|
|
3805
3765
|
var name = _ref.name,
|
|
@@ -3819,15 +3779,15 @@ var Performer$1 = function Performer(_ref) {
|
|
|
3819
3779
|
label: t("neetoRules.placeholders.selectOption")
|
|
3820
3780
|
};
|
|
3821
3781
|
var _useState = react.useState(defaultLabel),
|
|
3822
|
-
_useState2 =
|
|
3782
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3823
3783
|
selectedOption = _useState2[0],
|
|
3824
3784
|
setSelectedOption = _useState2[1];
|
|
3825
3785
|
var _useState3 = react.useState(false),
|
|
3826
|
-
_useState4 =
|
|
3786
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3827
3787
|
isSelected = _useState4[0],
|
|
3828
3788
|
setIsSelected = _useState4[1];
|
|
3829
3789
|
var _useState5 = react.useState(""),
|
|
3830
|
-
_useState6 =
|
|
3790
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
3831
3791
|
searchTerm = _useState6[0],
|
|
3832
3792
|
setSearchTerm = _useState6[1];
|
|
3833
3793
|
var searchedOptions = getSearchedOptions$1(performerOptions, searchTerm);
|
|
@@ -3855,19 +3815,19 @@ var Performer$1 = function Performer(_ref) {
|
|
|
3855
3815
|
};
|
|
3856
3816
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3857
3817
|
className: "my-auto flex items-center gap-x-2 gap-y-3",
|
|
3858
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
3818
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
3859
3819
|
className: "neeto-ui-text-gray-700",
|
|
3860
3820
|
style: "h5",
|
|
3861
3821
|
weight: "normal",
|
|
3862
3822
|
children: t("neetoRules.common.by")
|
|
3863
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3823
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Dropdown$1, {
|
|
3864
3824
|
buttonStyle: "secondary",
|
|
3865
3825
|
className: "neeto-ui-bg-gray-100",
|
|
3866
|
-
customTarget: /*#__PURE__*/jsxRuntime.jsx(
|
|
3826
|
+
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
3867
3827
|
"data-cy": "event-performer-dropdown",
|
|
3868
3828
|
label: selectedOption === null || selectedOption === void 0 ? void 0 : (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
3869
3829
|
style: "link",
|
|
3870
|
-
className:
|
|
3830
|
+
className: classNames(" neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
3871
3831
|
"neeto-ui-text-accent-800": isSelected,
|
|
3872
3832
|
"neeto-ui-text-error-500": isValueSelected
|
|
3873
3833
|
}),
|
|
@@ -3880,12 +3840,12 @@ var Performer$1 = function Performer(_ref) {
|
|
|
3880
3840
|
onClose: handleClose,
|
|
3881
3841
|
children: /*#__PURE__*/jsxRuntime.jsxs(Menu$3, {
|
|
3882
3842
|
className: "max-h-60 max-w-2xl p-3",
|
|
3883
|
-
children: [performerOptions.length > MAXIMUM_OPTION_LENGTH && /*#__PURE__*/jsxRuntime.jsx(
|
|
3843
|
+
children: [performerOptions.length > MAXIMUM_OPTION_LENGTH && /*#__PURE__*/jsxRuntime.jsx(Input$1, {
|
|
3884
3844
|
autoFocus: true,
|
|
3885
3845
|
className: "mb-1",
|
|
3886
3846
|
"data-cy": "search-text-field",
|
|
3887
3847
|
placeholder: t("neetoRules.common.search"),
|
|
3888
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
3848
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Search, {}),
|
|
3889
3849
|
value: searchTerm,
|
|
3890
3850
|
onChange: function onChange(e) {
|
|
3891
3851
|
return setSearchTerm(e.target.value);
|
|
@@ -3899,10 +3859,10 @@ var Performer$1 = function Performer(_ref) {
|
|
|
3899
3859
|
return /*#__PURE__*/jsxRuntime.jsx(MenuItem$3.Button, {
|
|
3900
3860
|
"data-cy": "".concat(utils.joinHyphenCase(option.label), "-menu-item"),
|
|
3901
3861
|
isDisabled: isMenuDisabled,
|
|
3902
|
-
className:
|
|
3862
|
+
className: classNames({
|
|
3903
3863
|
"neeto-ui-bg-gray-100": selectedOption.value === option.value
|
|
3904
3864
|
}),
|
|
3905
|
-
suffix: selectedOption.value === option.value && /*#__PURE__*/jsxRuntime.jsx(
|
|
3865
|
+
suffix: selectedOption.value === option.value && /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
3906
3866
|
className: "neeto-ui-text-primary-800",
|
|
3907
3867
|
"data-cy": "check-icon"
|
|
3908
3868
|
}),
|
|
@@ -3922,9 +3882,9 @@ var Performer$1 = function Performer(_ref) {
|
|
|
3922
3882
|
};
|
|
3923
3883
|
|
|
3924
3884
|
function ownKeys$a(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; }
|
|
3925
|
-
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) {
|
|
3926
|
-
var Menu$2 =
|
|
3927
|
-
MenuItem$2 =
|
|
3885
|
+
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3886
|
+
var Menu$2 = Dropdown$1.Menu,
|
|
3887
|
+
MenuItem$2 = Dropdown$1.MenuItem;
|
|
3928
3888
|
var Events$1 = function Events(_ref) {
|
|
3929
3889
|
var name = _ref.name,
|
|
3930
3890
|
data = _ref.data,
|
|
@@ -3935,11 +3895,11 @@ var Events$1 = function Events(_ref) {
|
|
|
3935
3895
|
setFieldValue = _useFormikContext.setFieldValue,
|
|
3936
3896
|
errors = _useFormikContext.errors;
|
|
3937
3897
|
var _useState = react.useState(null),
|
|
3938
|
-
_useState2 =
|
|
3898
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3939
3899
|
activeOption = _useState2[0],
|
|
3940
3900
|
setActiveOption = _useState2[1];
|
|
3941
3901
|
var _useState3 = react.useState(""),
|
|
3942
|
-
_useState4 =
|
|
3902
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3943
3903
|
searchTerm = _useState4[0],
|
|
3944
3904
|
setSearchTerm = _useState4[1];
|
|
3945
3905
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -3959,7 +3919,7 @@ var Events$1 = function Events(_ref) {
|
|
|
3959
3919
|
var deletedEvents = ((_values$name = values[name]) === null || _values$name === void 0 ? void 0 : _values$name.deleted) || [];
|
|
3960
3920
|
for (var idx = 0; idx < events.length; idx++) {
|
|
3961
3921
|
if (events[idx].id) {
|
|
3962
|
-
deletedEvents = [].concat(
|
|
3922
|
+
deletedEvents = [].concat(_toConsumableArray(deletedEvents), [_objectSpread$a(_objectSpread$a({}, events[idx]), {}, {
|
|
3963
3923
|
_destroy: true
|
|
3964
3924
|
})]);
|
|
3965
3925
|
}
|
|
@@ -3986,7 +3946,7 @@ var Events$1 = function Events(_ref) {
|
|
|
3986
3946
|
}, events);
|
|
3987
3947
|
if (defaultEvent.id) {
|
|
3988
3948
|
var _values$name2;
|
|
3989
|
-
setFieldValue("".concat(name, ".deleted"), [].concat(
|
|
3949
|
+
setFieldValue("".concat(name, ".deleted"), [].concat(_toConsumableArray(((_values$name2 = values[name]) === null || _values$name2 === void 0 ? void 0 : _values$name2.deleted) || []), [_objectSpread$a(_objectSpread$a({}, defaultEvent), {}, {
|
|
3990
3950
|
_destroy: true
|
|
3991
3951
|
})]));
|
|
3992
3952
|
}
|
|
@@ -3999,13 +3959,13 @@ var Events$1 = function Events(_ref) {
|
|
|
3999
3959
|
}, events);
|
|
4000
3960
|
if (event && event.id) {
|
|
4001
3961
|
var _values$name3;
|
|
4002
|
-
setFieldValue("".concat(name, ".deleted"), [].concat(
|
|
3962
|
+
setFieldValue("".concat(name, ".deleted"), [].concat(_toConsumableArray(((_values$name3 = values[name]) === null || _values$name3 === void 0 ? void 0 : _values$name3.deleted) || []), [_objectSpread$a(_objectSpread$a({}, event), {}, {
|
|
4003
3963
|
_destroy: true
|
|
4004
3964
|
})]));
|
|
4005
3965
|
}
|
|
4006
3966
|
options = eventNames.includes(option.value) ? neetoCist.removeBy({
|
|
4007
3967
|
name: option.value
|
|
4008
|
-
}, options) : [].concat(
|
|
3968
|
+
}, options) : [].concat(_toConsumableArray(options), [{
|
|
4009
3969
|
name: option.value
|
|
4010
3970
|
}]);
|
|
4011
3971
|
onSelectEvent === null || onSelectEvent === void 0 ? void 0 : onSelectEvent(name, options);
|
|
@@ -4017,12 +3977,12 @@ var Events$1 = function Events(_ref) {
|
|
|
4017
3977
|
};
|
|
4018
3978
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4019
3979
|
className: "my-auto flex flex-wrap items-center gap-x-2 gap-y-3",
|
|
4020
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
3980
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
4021
3981
|
className: "neeto-ui-text-gray-700 my-auto",
|
|
4022
3982
|
style: "h5",
|
|
4023
3983
|
weight: "normal",
|
|
4024
3984
|
children: t("neetoRules.common.when")
|
|
4025
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3985
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Dropdown$1, {
|
|
4026
3986
|
buttonStyle: "secondary",
|
|
4027
3987
|
className: "neeto-ui-bg-gray-100",
|
|
4028
3988
|
closeOnSelect: false,
|
|
@@ -4033,16 +3993,16 @@ var Events$1 = function Events(_ref) {
|
|
|
4033
3993
|
var _event$label;
|
|
4034
3994
|
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
4035
3995
|
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
4036
|
-
children: [!!idx && /*#__PURE__*/jsxRuntime.jsx(
|
|
3996
|
+
children: [!!idx && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
4037
3997
|
className: "neeto-ui-text-gray-700",
|
|
4038
3998
|
style: "h5",
|
|
4039
3999
|
weight: "normal",
|
|
4040
4000
|
children: t("neetoRules.common.or")
|
|
4041
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
4001
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
4042
4002
|
"data-cy": "condition-value-multi-select-field",
|
|
4043
4003
|
label: event === null || event === void 0 ? void 0 : (_event$label = event.label) === null || _event$label === void 0 ? void 0 : _event$label.toLowerCase(),
|
|
4044
4004
|
style: "link",
|
|
4045
|
-
className:
|
|
4005
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
4046
4006
|
"neeto-ui-text-accent-800": activeOption === event.value
|
|
4047
4007
|
}),
|
|
4048
4008
|
onClick: function onClick() {
|
|
@@ -4051,11 +4011,11 @@ var Events$1 = function Events(_ref) {
|
|
|
4051
4011
|
})]
|
|
4052
4012
|
}, idx);
|
|
4053
4013
|
})
|
|
4054
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(
|
|
4014
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
4055
4015
|
"data-cy": "condition-value-multi-select-field",
|
|
4056
4016
|
label: defaultLabel,
|
|
4057
4017
|
style: "link",
|
|
4058
|
-
className:
|
|
4018
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
4059
4019
|
"neeto-ui-text-accent-800": activeOption === defaultLabel,
|
|
4060
4020
|
"neeto-ui-text-error-500": !isValid
|
|
4061
4021
|
}),
|
|
@@ -4066,12 +4026,12 @@ var Events$1 = function Events(_ref) {
|
|
|
4066
4026
|
onClose: handleClose,
|
|
4067
4027
|
children: /*#__PURE__*/jsxRuntime.jsxs(Menu$2, {
|
|
4068
4028
|
className: "max-h-60 max-w-2xl p-3",
|
|
4069
|
-
children: [dropdownOptions.length > MAXIMUM_OPTION_LENGTH && /*#__PURE__*/jsxRuntime.jsx(
|
|
4029
|
+
children: [dropdownOptions.length > MAXIMUM_OPTION_LENGTH && /*#__PURE__*/jsxRuntime.jsx(Input$1, {
|
|
4070
4030
|
autoFocus: true,
|
|
4071
4031
|
className: "mb-1",
|
|
4072
4032
|
"data-cy": "search-text-field",
|
|
4073
4033
|
placeholder: t("neetoRules.common.search"),
|
|
4074
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
4034
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Search, {}),
|
|
4075
4035
|
value: searchTerm,
|
|
4076
4036
|
onChange: function onChange(e) {
|
|
4077
4037
|
return setSearchTerm(e.target.value);
|
|
@@ -4081,7 +4041,7 @@ var Events$1 = function Events(_ref) {
|
|
|
4081
4041
|
children: searchedOptions.map(function (option, idx) {
|
|
4082
4042
|
return /*#__PURE__*/jsxRuntime.jsx(MenuItem$2.Button, {
|
|
4083
4043
|
"data-cy": "".concat(utils.joinHyphenCase(option.label), "-menu-item"),
|
|
4084
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
4044
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Checkbox, {
|
|
4085
4045
|
checked: eventNames === null || eventNames === void 0 ? void 0 : eventNames.includes(option.value),
|
|
4086
4046
|
"data-cy": "check-icon",
|
|
4087
4047
|
id: option.value
|
|
@@ -4107,7 +4067,7 @@ var Events$1 = function Events(_ref) {
|
|
|
4107
4067
|
|
|
4108
4068
|
var _excluded$6 = ["addButtonTooltipProps", "data", "label", "name", "performerName", "conditionsName", "onSelectEvent", "enableAddingDelay"];
|
|
4109
4069
|
function ownKeys$9(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; }
|
|
4110
|
-
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) {
|
|
4070
|
+
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4111
4071
|
var EventConditions = function EventConditions(_ref) {
|
|
4112
4072
|
var _ref$addButtonTooltip = _ref.addButtonTooltipProps,
|
|
4113
4073
|
addButtonTooltipProps = _ref$addButtonTooltip === void 0 ? {} : _ref$addButtonTooltip,
|
|
@@ -4119,7 +4079,7 @@ var EventConditions = function EventConditions(_ref) {
|
|
|
4119
4079
|
onSelectEvent = _ref.onSelectEvent,
|
|
4120
4080
|
_ref$enableAddingDela = _ref.enableAddingDelay,
|
|
4121
4081
|
enableAddingDelay = _ref$enableAddingDela === void 0 ? false : _ref$enableAddingDela,
|
|
4122
|
-
config =
|
|
4082
|
+
config = _objectWithoutProperties(_ref, _excluded$6);
|
|
4123
4083
|
var _useFormikContext = formik.useFormikContext(),
|
|
4124
4084
|
values = _useFormikContext.values,
|
|
4125
4085
|
setFieldValue = _useFormikContext.setFieldValue;
|
|
@@ -4155,7 +4115,7 @@ var EventConditions = function EventConditions(_ref) {
|
|
|
4155
4115
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4156
4116
|
className: "flex justify-between",
|
|
4157
4117
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4158
|
-
className:
|
|
4118
|
+
className: classNames("my-auto", {
|
|
4159
4119
|
"max-w-4xl": showAddButton
|
|
4160
4120
|
}),
|
|
4161
4121
|
children: /*#__PURE__*/jsxRuntime.jsx(Events$1, {
|
|
@@ -4164,13 +4124,13 @@ var EventConditions = function EventConditions(_ref) {
|
|
|
4164
4124
|
onSelectEvent: onSelectEvent,
|
|
4165
4125
|
performerName: performerName
|
|
4166
4126
|
})
|
|
4167
|
-
}), showAddButton && /*#__PURE__*/jsxRuntime.jsx(
|
|
4127
|
+
}), showAddButton && /*#__PURE__*/jsxRuntime.jsx(Tooltip, _objectSpread$9(_objectSpread$9({}, tooltipProps), {}, {
|
|
4168
4128
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4169
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
4129
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
4170
4130
|
"data-cy": "add-condition-button",
|
|
4171
4131
|
"data-test-id": "automation-rules-add-events-button",
|
|
4172
4132
|
disabled: isConditionsEmpty,
|
|
4173
|
-
icon:
|
|
4133
|
+
icon: Plus,
|
|
4174
4134
|
size: "small",
|
|
4175
4135
|
style: "text",
|
|
4176
4136
|
onClick: handleAddCondition
|
|
@@ -4186,6 +4146,7 @@ var EventConditions = function EventConditions(_ref) {
|
|
|
4186
4146
|
}, config))
|
|
4187
4147
|
})]
|
|
4188
4148
|
}), enableAddingDelay && /*#__PURE__*/jsxRuntime.jsx(AddDelay, {
|
|
4149
|
+
data: data,
|
|
4189
4150
|
name: "execution_delay"
|
|
4190
4151
|
})]
|
|
4191
4152
|
});
|
|
@@ -4206,9 +4167,9 @@ var getSearchedOptions = function getSearchedOptions(dropDownOptions, searchTerm
|
|
|
4206
4167
|
});
|
|
4207
4168
|
};
|
|
4208
4169
|
|
|
4209
|
-
var Menu$1 =
|
|
4210
|
-
MenuItem$1 =
|
|
4211
|
-
Divider =
|
|
4170
|
+
var Menu$1 = Dropdown$1.Menu,
|
|
4171
|
+
MenuItem$1 = Dropdown$1.MenuItem,
|
|
4172
|
+
Divider = Dropdown$1.Divider;
|
|
4212
4173
|
var EventItem = function EventItem(_ref) {
|
|
4213
4174
|
var name = _ref.name,
|
|
4214
4175
|
parentName = _ref.parentName,
|
|
@@ -4217,15 +4178,15 @@ var EventItem = function EventItem(_ref) {
|
|
|
4217
4178
|
removeEvent = _ref.removeEvent,
|
|
4218
4179
|
onSelectEvent = _ref.onSelectEvent;
|
|
4219
4180
|
var _useState = react.useState(t("neetoRules.form.thisHappens")),
|
|
4220
|
-
_useState2 =
|
|
4181
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4221
4182
|
selectedOption = _useState2[0],
|
|
4222
4183
|
setSelectedOption = _useState2[1];
|
|
4223
4184
|
var _useState3 = react.useState(false),
|
|
4224
|
-
_useState4 =
|
|
4185
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
4225
4186
|
isActive = _useState4[0],
|
|
4226
4187
|
setIsActive = _useState4[1];
|
|
4227
4188
|
var _useState5 = react.useState(""),
|
|
4228
|
-
_useState6 =
|
|
4189
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
4229
4190
|
searchTerm = _useState6[0],
|
|
4230
4191
|
setSearchTerm = _useState6[1];
|
|
4231
4192
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -4268,15 +4229,15 @@ var EventItem = function EventItem(_ref) {
|
|
|
4268
4229
|
};
|
|
4269
4230
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4270
4231
|
className: "my-auto flex flex-wrap",
|
|
4271
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
4232
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Dropdown$1, {
|
|
4272
4233
|
buttonStyle: "secondary",
|
|
4273
4234
|
className: "neeto-ui-bg-gray-100",
|
|
4274
4235
|
closeOnSelect: false,
|
|
4275
|
-
customTarget: /*#__PURE__*/jsxRuntime.jsx(
|
|
4236
|
+
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
4276
4237
|
"data-cy": "event-dropdown-button",
|
|
4277
4238
|
label: selectedOption.toLowerCase(),
|
|
4278
4239
|
style: "link",
|
|
4279
|
-
className:
|
|
4240
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
4280
4241
|
"neeto-ui-text-accent-800": isActive,
|
|
4281
4242
|
"neeto-ui-text-error-500": isValueSelected
|
|
4282
4243
|
}),
|
|
@@ -4289,11 +4250,11 @@ var EventItem = function EventItem(_ref) {
|
|
|
4289
4250
|
onClose: handleClose,
|
|
4290
4251
|
children: /*#__PURE__*/jsxRuntime.jsxs(Menu$1, {
|
|
4291
4252
|
className: "max-h-60 max-w-2xl p-3",
|
|
4292
|
-
children: [eventOptions.length > MAXIMUM_OPTION_LENGTH$1 && /*#__PURE__*/jsxRuntime.jsx(
|
|
4253
|
+
children: [eventOptions.length > MAXIMUM_OPTION_LENGTH$1 && /*#__PURE__*/jsxRuntime.jsx(Input$1, {
|
|
4293
4254
|
className: "mb-1",
|
|
4294
4255
|
"data-cy": "search-text-field",
|
|
4295
4256
|
placeholder: t("neetoRules.common.search"),
|
|
4296
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
4257
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Search, {}),
|
|
4297
4258
|
value: searchTerm,
|
|
4298
4259
|
onChange: function onChange(e) {
|
|
4299
4260
|
return setSearchTerm(e.target.value);
|
|
@@ -4323,8 +4284,8 @@ var EventItem = function EventItem(_ref) {
|
|
|
4323
4284
|
});
|
|
4324
4285
|
};
|
|
4325
4286
|
|
|
4326
|
-
var Menu =
|
|
4327
|
-
MenuItem =
|
|
4287
|
+
var Menu = Dropdown$1.Menu,
|
|
4288
|
+
MenuItem = Dropdown$1.MenuItem;
|
|
4328
4289
|
var Performer = function Performer(_ref) {
|
|
4329
4290
|
var _selectedOption$label;
|
|
4330
4291
|
var name = _ref.name,
|
|
@@ -4342,15 +4303,15 @@ var Performer = function Performer(_ref) {
|
|
|
4342
4303
|
label: t("neetoRules.placeholders.selectOption")
|
|
4343
4304
|
};
|
|
4344
4305
|
var _useState = react.useState(defaultLabel),
|
|
4345
|
-
_useState2 =
|
|
4306
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4346
4307
|
selectedOption = _useState2[0],
|
|
4347
4308
|
setSelectedOption = _useState2[1];
|
|
4348
4309
|
var _useState3 = react.useState(false),
|
|
4349
|
-
_useState4 =
|
|
4310
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
4350
4311
|
isSelected = _useState4[0],
|
|
4351
4312
|
setIsSelected = _useState4[1];
|
|
4352
4313
|
var _useState5 = react.useState(""),
|
|
4353
|
-
_useState6 =
|
|
4314
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
4354
4315
|
searchTerm = _useState6[0],
|
|
4355
4316
|
setSearchTerm = _useState6[1];
|
|
4356
4317
|
var searchedOptions = getSearchedOptions(performerOptions, searchTerm);
|
|
@@ -4378,20 +4339,20 @@ var Performer = function Performer(_ref) {
|
|
|
4378
4339
|
};
|
|
4379
4340
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4380
4341
|
className: "my-auto flex",
|
|
4381
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
4342
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
4382
4343
|
className: "neeto-ui-text-gray-700 mr-2",
|
|
4383
4344
|
style: "h5",
|
|
4384
4345
|
weight: "normal",
|
|
4385
4346
|
children: t("neetoRules.common.by")
|
|
4386
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
4347
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Dropdown$1, {
|
|
4387
4348
|
buttonStyle: "secondary",
|
|
4388
4349
|
className: "neeto-ui-bg-gray-100",
|
|
4389
4350
|
closeOnSelect: false,
|
|
4390
|
-
customTarget: /*#__PURE__*/jsxRuntime.jsx(
|
|
4351
|
+
customTarget: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
4391
4352
|
"data-cy": "event-performer-dropdown",
|
|
4392
4353
|
label: selectedOption === null || selectedOption === void 0 ? void 0 : (_selectedOption$label = selectedOption.label) === null || _selectedOption$label === void 0 ? void 0 : _selectedOption$label.toLowerCase(),
|
|
4393
4354
|
style: "link",
|
|
4394
|
-
className:
|
|
4355
|
+
className: classNames("neeto-ui-text-gray-800 neeto-ui-font-semibold underline", {
|
|
4395
4356
|
"neeto-ui-text-accent-800": isSelected,
|
|
4396
4357
|
"neeto-ui-text-error-500": isValueSelected
|
|
4397
4358
|
}),
|
|
@@ -4404,11 +4365,11 @@ var Performer = function Performer(_ref) {
|
|
|
4404
4365
|
onClose: handleClose,
|
|
4405
4366
|
children: /*#__PURE__*/jsxRuntime.jsxs(Menu, {
|
|
4406
4367
|
className: "max-h-60 max-w-2xl p-3",
|
|
4407
|
-
children: [performerOptions.length > MAXIMUM_OPTION_LENGTH$1 && /*#__PURE__*/jsxRuntime.jsx(
|
|
4368
|
+
children: [performerOptions.length > MAXIMUM_OPTION_LENGTH$1 && /*#__PURE__*/jsxRuntime.jsx(Input$1, {
|
|
4408
4369
|
className: "mb-1",
|
|
4409
4370
|
"data-cy": "search-text-field",
|
|
4410
4371
|
placeholder: t("neetoRules.common.search"),
|
|
4411
|
-
prefix: /*#__PURE__*/jsxRuntime.jsx(
|
|
4372
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx(Search, {}),
|
|
4412
4373
|
value: searchTerm,
|
|
4413
4374
|
onChange: function onChange(e) {
|
|
4414
4375
|
return setSearchTerm(e.target.value);
|
|
@@ -4418,10 +4379,10 @@ var Performer = function Performer(_ref) {
|
|
|
4418
4379
|
children: searchedOptions.map(function (option, idx) {
|
|
4419
4380
|
return /*#__PURE__*/jsxRuntime.jsx(MenuItem.Button, {
|
|
4420
4381
|
"data-cy": "".concat(utils.joinHyphenCase(option.label), "-menu-item"),
|
|
4421
|
-
className:
|
|
4382
|
+
className: classNames({
|
|
4422
4383
|
"neeto-ui-bg-gray-100": selectedOption.value === option.value
|
|
4423
4384
|
}),
|
|
4424
|
-
suffix: selectedOption.value === option.value && /*#__PURE__*/jsxRuntime.jsx(
|
|
4385
|
+
suffix: selectedOption.value === option.value && /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
4425
4386
|
className: "neeto-ui-text-primary-800",
|
|
4426
4387
|
"data-cy": "check-icon"
|
|
4427
4388
|
}),
|
|
@@ -4441,7 +4402,7 @@ var Performer = function Performer(_ref) {
|
|
|
4441
4402
|
};
|
|
4442
4403
|
|
|
4443
4404
|
function ownKeys$8(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; }
|
|
4444
|
-
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) {
|
|
4405
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4445
4406
|
var Events = function Events(_ref) {
|
|
4446
4407
|
var name = _ref.name,
|
|
4447
4408
|
label = _ref.label,
|
|
@@ -4461,7 +4422,7 @@ var Events = function Events(_ref) {
|
|
|
4461
4422
|
var _removeEvent = function removeEvent(index, event, arrayHelpers) {
|
|
4462
4423
|
if (event.id) {
|
|
4463
4424
|
var _values$name;
|
|
4464
|
-
setFieldValue("".concat(name, ".deleted"), [].concat(
|
|
4425
|
+
setFieldValue("".concat(name, ".deleted"), [].concat(_toConsumableArray(((_values$name = values[name]) === null || _values$name === void 0 ? void 0 : _values$name.deleted) || []), [_objectSpread$8(_objectSpread$8({}, event), {}, {
|
|
4465
4426
|
_destroy: true
|
|
4466
4427
|
})]));
|
|
4467
4428
|
}
|
|
@@ -4490,7 +4451,7 @@ var Events = function Events(_ref) {
|
|
|
4490
4451
|
} else if (defaultEvent && events.length > 1) {
|
|
4491
4452
|
if (defaultEvent.id) {
|
|
4492
4453
|
var _values$name2;
|
|
4493
|
-
setFieldValue("".concat(name, ".deleted"), [].concat(
|
|
4454
|
+
setFieldValue("".concat(name, ".deleted"), [].concat(_toConsumableArray(((_values$name2 = values[name]) === null || _values$name2 === void 0 ? void 0 : _values$name2.deleted) || []), [_objectSpread$8(_objectSpread$8({}, defaultEvent), {}, {
|
|
4494
4455
|
_destroy: true
|
|
4495
4456
|
})]));
|
|
4496
4457
|
}
|
|
@@ -4511,10 +4472,10 @@ var Events = function Events(_ref) {
|
|
|
4511
4472
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4512
4473
|
className: "flex justify-between",
|
|
4513
4474
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4514
|
-
className:
|
|
4475
|
+
className: classNames("flex flex-wrap gap-x-2 gap-y-2", {
|
|
4515
4476
|
"max-w-2xl": showAddButton
|
|
4516
4477
|
}),
|
|
4517
|
-
children: [showMessage && /*#__PURE__*/jsxRuntime.jsx(
|
|
4478
|
+
children: [showMessage && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
4518
4479
|
className: "my-auto",
|
|
4519
4480
|
component: "p",
|
|
4520
4481
|
"data-cy": "event-message-text",
|
|
@@ -4523,12 +4484,12 @@ var Events = function Events(_ref) {
|
|
|
4523
4484
|
}), !showMessage && events.map(function (event, index) {
|
|
4524
4485
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4525
4486
|
className: "flex flex-wrap gap-x-2",
|
|
4526
|
-
children: [!index && /*#__PURE__*/jsxRuntime.jsx(
|
|
4487
|
+
children: [!index && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
4527
4488
|
className: "neeto-ui-text-gray-700 my-auto",
|
|
4528
4489
|
style: "h5",
|
|
4529
4490
|
weight: "normal",
|
|
4530
4491
|
children: t("neetoRules.common.when")
|
|
4531
|
-
}), !!index && /*#__PURE__*/jsxRuntime.jsx(
|
|
4492
|
+
}), !!index && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
4532
4493
|
className: "neeto-ui-text-gray-700 my-auto",
|
|
4533
4494
|
style: "h5",
|
|
4534
4495
|
weight: "normal",
|
|
@@ -4549,10 +4510,10 @@ var Events = function Events(_ref) {
|
|
|
4549
4510
|
name: performerName
|
|
4550
4511
|
})]
|
|
4551
4512
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4552
|
-
children: [showAddButton && /*#__PURE__*/jsxRuntime.jsx(
|
|
4513
|
+
children: [showAddButton && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
4553
4514
|
"data-cy": "add-event-button",
|
|
4554
4515
|
"data-test-id": "automation-rules-add-events-button",
|
|
4555
|
-
icon:
|
|
4516
|
+
icon: Plus,
|
|
4556
4517
|
size: 32,
|
|
4557
4518
|
style: "icon",
|
|
4558
4519
|
tooltipProps: {
|
|
@@ -4562,9 +4523,9 @@ var Events = function Events(_ref) {
|
|
|
4562
4523
|
onClick: function onClick() {
|
|
4563
4524
|
return handleAddEvent(arrayHelpers);
|
|
4564
4525
|
}
|
|
4565
|
-
}), !showMessage && /*#__PURE__*/jsxRuntime.jsx(
|
|
4526
|
+
}), !showMessage && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
4566
4527
|
"data-cy": "delete-event-button",
|
|
4567
|
-
icon:
|
|
4528
|
+
icon: Delete,
|
|
4568
4529
|
size: 32,
|
|
4569
4530
|
style: "icon",
|
|
4570
4531
|
tooltipProps: {
|
|
@@ -4585,7 +4546,7 @@ var Events = function Events(_ref) {
|
|
|
4585
4546
|
var useDebouncedUpdate = function useDebouncedUpdate(value, setValue) {
|
|
4586
4547
|
var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 200;
|
|
4587
4548
|
var _useState = react.useState(value),
|
|
4588
|
-
_useState2 =
|
|
4549
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4589
4550
|
text = _useState2[0],
|
|
4590
4551
|
setText = _useState2[1];
|
|
4591
4552
|
var debouncedValue = reactUtils.useDebounce(text, duration);
|
|
@@ -4597,23 +4558,23 @@ var useDebouncedUpdate = function useDebouncedUpdate(value, setValue) {
|
|
|
4597
4558
|
|
|
4598
4559
|
var _excluded$5 = ["data", "name", "label"];
|
|
4599
4560
|
function ownKeys$7(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; }
|
|
4600
|
-
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) {
|
|
4561
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4601
4562
|
var InputField = function InputField(_ref) {
|
|
4602
4563
|
var data = _ref.data,
|
|
4603
4564
|
name = _ref.name,
|
|
4604
4565
|
label = _ref.label,
|
|
4605
|
-
componentProps =
|
|
4566
|
+
componentProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
4606
4567
|
var elementProps = data[name];
|
|
4607
4568
|
var _useField = formik.useField("".concat(name, ".value")),
|
|
4608
|
-
_useField2 =
|
|
4569
|
+
_useField2 = _slicedToArray(_useField, 3),
|
|
4609
4570
|
field = _useField2[0];
|
|
4610
4571
|
_useField2[1];
|
|
4611
4572
|
var setValue = _useField2[2].setValue;
|
|
4612
4573
|
var _useDebouncedUpdate = useDebouncedUpdate(field.value, setValue),
|
|
4613
|
-
_useDebouncedUpdate2 =
|
|
4574
|
+
_useDebouncedUpdate2 = _slicedToArray(_useDebouncedUpdate, 2),
|
|
4614
4575
|
text = _useDebouncedUpdate2[0],
|
|
4615
4576
|
setText = _useDebouncedUpdate2[1];
|
|
4616
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
4577
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input$2, _objectSpread$7(_objectSpread$7({
|
|
4617
4578
|
className: "mb-4",
|
|
4618
4579
|
label: label || (elementProps === null || elementProps === void 0 ? void 0 : elementProps.label)
|
|
4619
4580
|
}, field), {}, {
|
|
@@ -4626,19 +4587,19 @@ var InputField = function InputField(_ref) {
|
|
|
4626
4587
|
|
|
4627
4588
|
var _excluded$4 = ["data", "name", "label", "options", "onChange"];
|
|
4628
4589
|
function ownKeys$6(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; }
|
|
4629
|
-
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) {
|
|
4590
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4630
4591
|
var MultiSelectField = function MultiSelectField(_ref) {
|
|
4631
4592
|
var data = _ref.data,
|
|
4632
4593
|
name = _ref.name,
|
|
4633
4594
|
label = _ref.label,
|
|
4634
4595
|
options = _ref.options,
|
|
4635
4596
|
_onChange = _ref.onChange,
|
|
4636
|
-
componentProps =
|
|
4597
|
+
componentProps = _objectWithoutProperties(_ref, _excluded$4);
|
|
4637
4598
|
var _useField = formik.useField("".concat(name, ".value")),
|
|
4638
|
-
_useField2 =
|
|
4599
|
+
_useField2 = _slicedToArray(_useField, 3),
|
|
4639
4600
|
setValue = _useField2[2].setValue;
|
|
4640
4601
|
var elementProps = data[name];
|
|
4641
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
4602
|
+
return /*#__PURE__*/jsxRuntime.jsx(Select$1, _objectSpread$6({
|
|
4642
4603
|
isMulti: true,
|
|
4643
4604
|
label: label || (elementProps === null || elementProps === void 0 ? void 0 : elementProps.label),
|
|
4644
4605
|
name: "".concat(name, ".value"),
|
|
@@ -4652,28 +4613,28 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
4652
4613
|
|
|
4653
4614
|
var _excluded$3 = ["name", "label", "data", "options"];
|
|
4654
4615
|
function ownKeys$5(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; }
|
|
4655
|
-
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) {
|
|
4616
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4656
4617
|
var RadioField = function RadioField(_ref) {
|
|
4657
4618
|
var name = _ref.name,
|
|
4658
4619
|
label = _ref.label,
|
|
4659
4620
|
data = _ref.data,
|
|
4660
4621
|
options = _ref.options,
|
|
4661
|
-
componentProps =
|
|
4622
|
+
componentProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
4662
4623
|
var elementProps = data[name] || {};
|
|
4663
4624
|
var radioOptions = options || (elementProps === null || elementProps === void 0 ? void 0 : elementProps.options);
|
|
4664
4625
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4665
4626
|
className: "my-6",
|
|
4666
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
4627
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
4667
4628
|
className: "mb-4",
|
|
4668
4629
|
"data-cy": "radio-field-label",
|
|
4669
4630
|
children: label || (elementProps === null || elementProps === void 0 ? void 0 : elementProps.label)
|
|
4670
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
4631
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Radio, _objectSpread$5(_objectSpread$5({
|
|
4671
4632
|
name: "".concat(name, ".value")
|
|
4672
4633
|
}, componentProps), {}, {
|
|
4673
4634
|
children: radioOptions.map(function (_ref2, index) {
|
|
4674
4635
|
var label = _ref2.label,
|
|
4675
4636
|
value = _ref2.value;
|
|
4676
|
-
return /*#__PURE__*/react.createElement(
|
|
4637
|
+
return /*#__PURE__*/react.createElement(Radio.Item, {
|
|
4677
4638
|
label: label,
|
|
4678
4639
|
value: value,
|
|
4679
4640
|
key: index
|
|
@@ -4685,19 +4646,19 @@ var RadioField = function RadioField(_ref) {
|
|
|
4685
4646
|
|
|
4686
4647
|
var _excluded$2 = ["data", "name", "label", "options", "onChange"];
|
|
4687
4648
|
function ownKeys$4(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; }
|
|
4688
|
-
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) {
|
|
4649
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4689
4650
|
var SelectField = function SelectField(_ref) {
|
|
4690
4651
|
var data = _ref.data,
|
|
4691
4652
|
name = _ref.name,
|
|
4692
4653
|
label = _ref.label,
|
|
4693
4654
|
options = _ref.options,
|
|
4694
4655
|
_onChange = _ref.onChange,
|
|
4695
|
-
componentProps =
|
|
4656
|
+
componentProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
4696
4657
|
var _useField = formik.useField("".concat(name, ".value")),
|
|
4697
|
-
_useField2 =
|
|
4658
|
+
_useField2 = _slicedToArray(_useField, 3),
|
|
4698
4659
|
setValue = _useField2[2].setValue;
|
|
4699
4660
|
var elementProps = data[name];
|
|
4700
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
4661
|
+
return /*#__PURE__*/jsxRuntime.jsx(Select$1, _objectSpread$4({
|
|
4701
4662
|
label: label || (elementProps === null || elementProps === void 0 ? void 0 : elementProps.label),
|
|
4702
4663
|
name: "".concat(name, ".value"),
|
|
4703
4664
|
options: options || (elementProps === null || elementProps === void 0 ? void 0 : elementProps.options),
|
|
@@ -4710,23 +4671,23 @@ var SelectField = function SelectField(_ref) {
|
|
|
4710
4671
|
|
|
4711
4672
|
var _excluded$1 = ["data", "name", "label"];
|
|
4712
4673
|
function ownKeys$3(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; }
|
|
4713
|
-
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) {
|
|
4674
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4714
4675
|
var TextareaField = function TextareaField(_ref) {
|
|
4715
4676
|
var data = _ref.data,
|
|
4716
4677
|
name = _ref.name,
|
|
4717
4678
|
label = _ref.label,
|
|
4718
|
-
componentProps =
|
|
4679
|
+
componentProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
4719
4680
|
var elementProps = data[name];
|
|
4720
4681
|
var _useField = formik.useField("".concat(name, ".value")),
|
|
4721
|
-
_useField2 =
|
|
4682
|
+
_useField2 = _slicedToArray(_useField, 3),
|
|
4722
4683
|
field = _useField2[0];
|
|
4723
4684
|
_useField2[1];
|
|
4724
4685
|
var setValue = _useField2[2].setValue;
|
|
4725
4686
|
var _useDebouncedUpdate = useDebouncedUpdate(field.value, setValue),
|
|
4726
|
-
_useDebouncedUpdate2 =
|
|
4687
|
+
_useDebouncedUpdate2 = _slicedToArray(_useDebouncedUpdate, 2),
|
|
4727
4688
|
text = _useDebouncedUpdate2[0],
|
|
4728
4689
|
setText = _useDebouncedUpdate2[1];
|
|
4729
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
4690
|
+
return /*#__PURE__*/jsxRuntime.jsx(Textarea, _objectSpread$3(_objectSpread$3({
|
|
4730
4691
|
className: "mb-4",
|
|
4731
4692
|
label: label || (elementProps === null || elementProps === void 0 ? void 0 : elementProps.label),
|
|
4732
4693
|
rows: 4
|
|
@@ -4739,7 +4700,7 @@ var TextareaField = function TextareaField(_ref) {
|
|
|
4739
4700
|
};
|
|
4740
4701
|
|
|
4741
4702
|
function ownKeys$2(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; }
|
|
4742
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) {
|
|
4703
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4743
4704
|
var buildPayload = function buildPayload(data, values) {
|
|
4744
4705
|
return Object.keys(data).reduce(function (acc, key) {
|
|
4745
4706
|
var fieldValue = values[key].value;
|
|
@@ -4750,13 +4711,13 @@ var buildPayload = function buildPayload(data, values) {
|
|
|
4750
4711
|
fieldValue = (_fieldValue = fieldValue) === null || _fieldValue === void 0 ? void 0 : _fieldValue.map(function (conditionGroup) {
|
|
4751
4712
|
var _conditionGroup$condi;
|
|
4752
4713
|
return _objectSpread$2(_objectSpread$2({}, conditionGroup), {}, {
|
|
4753
|
-
conditions: [].concat(
|
|
4714
|
+
conditions: [].concat(_toConsumableArray(conditionGroup.conditions.value), _toConsumableArray(((_conditionGroup$condi = conditionGroup.conditions) === null || _conditionGroup$condi === void 0 ? void 0 : _conditionGroup$condi.deleted) || []))
|
|
4754
4715
|
});
|
|
4755
4716
|
});
|
|
4756
4717
|
}
|
|
4757
|
-
fieldValue = [].concat(
|
|
4718
|
+
fieldValue = [].concat(_toConsumableArray(fieldValue), _toConsumableArray(((_values$key = values[key]) === null || _values$key === void 0 ? void 0 : _values$key.deleted) || []));
|
|
4758
4719
|
}
|
|
4759
|
-
return _objectSpread$2(_objectSpread$2({}, acc), {},
|
|
4720
|
+
return _objectSpread$2(_objectSpread$2({}, acc), {}, _defineProperty({}, key, fieldValue));
|
|
4760
4721
|
}, {});
|
|
4761
4722
|
};
|
|
4762
4723
|
var formatData = function formatData(data) {
|
|
@@ -4768,7 +4729,7 @@ var formatData = function formatData(data) {
|
|
|
4768
4729
|
}
|
|
4769
4730
|
});
|
|
4770
4731
|
}) : data[key].value;
|
|
4771
|
-
return _objectSpread$2(_objectSpread$2({}, acc), {},
|
|
4732
|
+
return _objectSpread$2(_objectSpread$2({}, acc), {}, _defineProperty({}, key, {
|
|
4772
4733
|
value: value
|
|
4773
4734
|
}));
|
|
4774
4735
|
}, {});
|
|
@@ -4787,12 +4748,12 @@ var Status = function Status() {
|
|
|
4787
4748
|
var status = e.target.checked ? ENABLED : DISABLED;
|
|
4788
4749
|
setFieldValue("status.value", status);
|
|
4789
4750
|
};
|
|
4790
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
4751
|
+
return /*#__PURE__*/jsxRuntime.jsx(Switch, {
|
|
4791
4752
|
checked: defaultValue === ENABLED,
|
|
4792
4753
|
label: t("neetoRules.labels.active"),
|
|
4793
4754
|
labelProps: {
|
|
4794
4755
|
helpIconProps: {
|
|
4795
|
-
icon:
|
|
4756
|
+
icon: Help,
|
|
4796
4757
|
tooltipProps: {
|
|
4797
4758
|
content: status.value === ENABLED ? t("neetoRules.tooltips.rule.active") : t("neetoRules.tooltips.rule.inactive")
|
|
4798
4759
|
}
|
|
@@ -4811,7 +4772,7 @@ var _transformObjectToDotNotation = function transformObjectToDotNotation(obj) {
|
|
|
4811
4772
|
var value = obj[errorKey];
|
|
4812
4773
|
if (!value) return;
|
|
4813
4774
|
var nextKey = prefix ? "".concat(prefix, ".").concat(errorKey) : errorKey;
|
|
4814
|
-
if (
|
|
4775
|
+
if (_typeof(value) === "object") {
|
|
4815
4776
|
_transformObjectToDotNotation(value, nextKey, result);
|
|
4816
4777
|
} else {
|
|
4817
4778
|
result.push(nextKey);
|
|
@@ -4842,7 +4803,7 @@ var ScrollToErrorField = function ScrollToErrorField(_ref) {
|
|
|
4842
4803
|
if (!fieldErrorNames || (fieldErrorNames === null || fieldErrorNames === void 0 ? void 0 : fieldErrorNames.length) <= 0) return;
|
|
4843
4804
|
var errorFormElement = neetoCist.findBy({
|
|
4844
4805
|
name: fieldErrorNames
|
|
4845
|
-
},
|
|
4806
|
+
}, _toConsumableArray(formRef.current.elements));
|
|
4846
4807
|
errorFormElement === null || errorFormElement === void 0 ? void 0 : errorFormElement.scrollIntoView({
|
|
4847
4808
|
behavior: "smooth",
|
|
4848
4809
|
block: "center"
|
|
@@ -4854,7 +4815,7 @@ var ScrollToErrorField = function ScrollToErrorField(_ref) {
|
|
|
4854
4815
|
|
|
4855
4816
|
var _excluded = ["dirty", "values"];
|
|
4856
4817
|
function ownKeys$1(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; }
|
|
4857
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) {
|
|
4818
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4858
4819
|
var Form = function Form(_ref) {
|
|
4859
4820
|
var _ref$data = _ref.data,
|
|
4860
4821
|
data = _ref$data === void 0 ? {} : _ref$data,
|
|
@@ -4890,10 +4851,10 @@ var Form = function Form(_ref) {
|
|
|
4890
4851
|
children: function children(_ref2) {
|
|
4891
4852
|
var dirty = _ref2.dirty,
|
|
4892
4853
|
values = _ref2.values,
|
|
4893
|
-
fromikBag =
|
|
4854
|
+
fromikBag = _objectWithoutProperties(_ref2, _excluded);
|
|
4894
4855
|
return /*#__PURE__*/jsxRuntime.jsxs(formik.Form, {
|
|
4895
4856
|
ref: formRef,
|
|
4896
|
-
className:
|
|
4857
|
+
className: classNames(["w-full space-y-6 px-0 md:px-14 xl:px-24", className]),
|
|
4897
4858
|
children: [/*#__PURE__*/jsxRuntime.jsx(InputField, {
|
|
4898
4859
|
required: true,
|
|
4899
4860
|
data: initialValues,
|
|
@@ -4911,7 +4872,7 @@ var Form = function Form(_ref) {
|
|
|
4911
4872
|
formRef: formRef
|
|
4912
4873
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4913
4874
|
className: "py-4",
|
|
4914
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
4875
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
|
|
4915
4876
|
cancelButtonProps: {
|
|
4916
4877
|
onClick: handleCancel
|
|
4917
4878
|
},
|
|
@@ -4926,9 +4887,9 @@ var Form = function Form(_ref) {
|
|
|
4926
4887
|
};
|
|
4927
4888
|
|
|
4928
4889
|
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; }
|
|
4929
|
-
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) {
|
|
4890
|
+
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; }
|
|
4930
4891
|
var NeetoRulesForm = function NeetoRulesForm(_ref) {
|
|
4931
|
-
var rest = Object.assign({}, (
|
|
4892
|
+
var rest = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
4932
4893
|
return /*#__PURE__*/jsxRuntime.jsx(Form, _objectSpread({}, rest));
|
|
4933
4894
|
};
|
|
4934
4895
|
NeetoRulesForm.InputField = InputField;
|