@bigbinary/neeto-rules-frontend 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +870 -867
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +870 -868
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +70 -1
package/dist/index.cjs.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var reactRouterDom = require('react-router-dom');
|
|
7
|
+
var shallow = require('zustand/shallow');
|
|
7
8
|
var classNames = require('classnames');
|
|
8
9
|
var formik = require('formik');
|
|
9
10
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
@@ -11,13 +12,14 @@ var formik$1 = require('@bigbinary/neetoui/formik');
|
|
|
11
12
|
var i18next = require('i18next');
|
|
12
13
|
var yup = require('yup');
|
|
13
14
|
var neetoEditor = require('@bigbinary/neeto-editor');
|
|
15
|
+
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
16
|
+
var zustand = require('zustand');
|
|
14
17
|
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
15
18
|
var neetoui = require('@bigbinary/neetoui');
|
|
16
19
|
var reactI18next = require('react-i18next');
|
|
17
20
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
18
21
|
var ramda = require('ramda');
|
|
19
22
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
20
|
-
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
21
23
|
|
|
22
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
25
|
|
|
@@ -118,594 +120,214 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
118
120
|
return target;
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
} catch (error) {
|
|
126
|
-
reject(error);
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
if (info.done) {
|
|
130
|
-
resolve(value);
|
|
131
|
-
} else {
|
|
132
|
-
Promise.resolve(value).then(_next, _throw);
|
|
133
|
-
}
|
|
123
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
124
|
+
|
|
125
|
+
function getDefaultExportFromCjs (x) {
|
|
126
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
134
127
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
128
|
+
|
|
129
|
+
var propTypes = {exports: {}};
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the MIT license found in the
|
|
135
|
+
* LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
139
|
+
|
|
140
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the MIT license found in the
|
|
146
|
+
* LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
150
|
+
|
|
151
|
+
function emptyFunction() {}
|
|
152
|
+
function emptyFunctionWithReset() {}
|
|
153
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
154
|
+
|
|
155
|
+
var factoryWithThrowingShims = function() {
|
|
156
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
157
|
+
if (secret === ReactPropTypesSecret) {
|
|
158
|
+
// It is still safe when called from React.
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
var err = new Error(
|
|
162
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
163
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
164
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
165
|
+
);
|
|
166
|
+
err.name = 'Invariant Violation';
|
|
167
|
+
throw err;
|
|
168
|
+
} shim.isRequired = shim;
|
|
169
|
+
function getShim() {
|
|
170
|
+
return shim;
|
|
171
|
+
} // Important!
|
|
172
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
173
|
+
var ReactPropTypes = {
|
|
174
|
+
array: shim,
|
|
175
|
+
bigint: shim,
|
|
176
|
+
bool: shim,
|
|
177
|
+
func: shim,
|
|
178
|
+
number: shim,
|
|
179
|
+
object: shim,
|
|
180
|
+
string: shim,
|
|
181
|
+
symbol: shim,
|
|
182
|
+
|
|
183
|
+
any: shim,
|
|
184
|
+
arrayOf: getShim,
|
|
185
|
+
element: shim,
|
|
186
|
+
elementType: shim,
|
|
187
|
+
instanceOf: getShim,
|
|
188
|
+
node: shim,
|
|
189
|
+
objectOf: getShim,
|
|
190
|
+
oneOf: getShim,
|
|
191
|
+
oneOfType: getShim,
|
|
192
|
+
shape: getShim,
|
|
193
|
+
exact: getShim,
|
|
194
|
+
|
|
195
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
196
|
+
resetWarningCache: emptyFunction
|
|
149
197
|
};
|
|
198
|
+
|
|
199
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
200
|
+
|
|
201
|
+
return ReactPropTypes;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the MIT license found in the
|
|
208
|
+
* LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/
|
|
210
|
+
|
|
211
|
+
{
|
|
212
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
213
|
+
// http://fb.me/prop-types-in-prod
|
|
214
|
+
propTypes.exports = factoryWithThrowingShims();
|
|
150
215
|
}
|
|
151
216
|
|
|
152
|
-
var
|
|
217
|
+
var propTypesExports = propTypes.exports;
|
|
218
|
+
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
153
219
|
|
|
154
|
-
function
|
|
155
|
-
|
|
220
|
+
function _arrayLikeToArray(arr, len) {
|
|
221
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
222
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
223
|
+
return arr2;
|
|
156
224
|
}
|
|
157
225
|
|
|
158
|
-
|
|
226
|
+
function _arrayWithoutHoles(arr) {
|
|
227
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
228
|
+
}
|
|
159
229
|
|
|
160
|
-
|
|
230
|
+
function _iterableToArray(iter) {
|
|
231
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
232
|
+
}
|
|
161
233
|
|
|
162
|
-
|
|
234
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
235
|
+
if (!o) return;
|
|
236
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
237
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
238
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
239
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
240
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
241
|
+
}
|
|
163
242
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
243
|
+
function _nonIterableSpread() {
|
|
244
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
245
|
+
}
|
|
167
246
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
172
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
|
173
|
-
}
|
|
174
|
-
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
175
|
-
} (_typeof));
|
|
247
|
+
function _toConsumableArray(arr) {
|
|
248
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
249
|
+
}
|
|
176
250
|
|
|
177
|
-
var
|
|
251
|
+
var ACTION_TYPES = {
|
|
252
|
+
emailToIds: "emailToIds",
|
|
253
|
+
email: "email",
|
|
254
|
+
emailTo: "emailTo",
|
|
255
|
+
dropdown: "dropdown",
|
|
256
|
+
list: "list",
|
|
257
|
+
multiSelect: "multiSelect",
|
|
258
|
+
note: "note",
|
|
259
|
+
text: "text",
|
|
260
|
+
number: "number",
|
|
261
|
+
decimal: "decimal",
|
|
262
|
+
regex: "regex",
|
|
263
|
+
textarea: "textarea",
|
|
264
|
+
date: "date",
|
|
265
|
+
longText: "longText"
|
|
266
|
+
};
|
|
267
|
+
var LIST_FIELD_TOOLTIP_PROPS = {
|
|
268
|
+
save: {
|
|
269
|
+
content: i18next.t("neetoRules.buttons.save"),
|
|
270
|
+
position: "top",
|
|
271
|
+
delay: 300
|
|
272
|
+
},
|
|
273
|
+
cancel: {
|
|
274
|
+
content: i18next.t("neetoRules.buttons.cancel"),
|
|
275
|
+
position: "top",
|
|
276
|
+
delay: 300
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
var DEFAULT_RULE_ACTION = {
|
|
280
|
+
name: "",
|
|
281
|
+
metadata: {}
|
|
282
|
+
};
|
|
283
|
+
var EDITOR_ADDONS = ["code-block", "block-quote", "image-upload"];
|
|
284
|
+
var EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
285
|
+
var MAXIMUM_OPTION_LENGTH$3 = 7;
|
|
286
|
+
var ACTION_INPUT_TYPES = ["text", "number", "decimal", "regex"];
|
|
178
287
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return {
|
|
223
|
-
type: "normal",
|
|
224
|
-
arg: fn.call(obj, arg)
|
|
225
|
-
};
|
|
226
|
-
} catch (err) {
|
|
227
|
-
return {
|
|
228
|
-
type: "throw",
|
|
229
|
-
arg: err
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
exports.wrap = wrap;
|
|
234
|
-
var ContinueSentinel = {};
|
|
235
|
-
function Generator() {}
|
|
236
|
-
function GeneratorFunction() {}
|
|
237
|
-
function GeneratorFunctionPrototype() {}
|
|
238
|
-
var IteratorPrototype = {};
|
|
239
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
240
|
-
return this;
|
|
241
|
-
});
|
|
242
|
-
var getProto = Object.getPrototypeOf,
|
|
243
|
-
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
244
|
-
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
245
|
-
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
246
|
-
function defineIteratorMethods(prototype) {
|
|
247
|
-
["next", "throw", "return"].forEach(function (method) {
|
|
248
|
-
define(prototype, method, function (arg) {
|
|
249
|
-
return this._invoke(method, arg);
|
|
250
|
-
});
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
254
|
-
function invoke(method, arg, resolve, reject) {
|
|
255
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
256
|
-
if ("throw" !== record.type) {
|
|
257
|
-
var result = record.arg,
|
|
258
|
-
value = result.value;
|
|
259
|
-
return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
260
|
-
invoke("next", value, resolve, reject);
|
|
261
|
-
}, function (err) {
|
|
262
|
-
invoke("throw", err, resolve, reject);
|
|
263
|
-
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
264
|
-
result.value = unwrapped, resolve(result);
|
|
265
|
-
}, function (error) {
|
|
266
|
-
return invoke("throw", error, resolve, reject);
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
reject(record.arg);
|
|
270
|
-
}
|
|
271
|
-
var previousPromise;
|
|
272
|
-
defineProperty(this, "_invoke", {
|
|
273
|
-
value: function value(method, arg) {
|
|
274
|
-
function callInvokeWithMethodAndArg() {
|
|
275
|
-
return new PromiseImpl(function (resolve, reject) {
|
|
276
|
-
invoke(method, arg, resolve, reject);
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
284
|
-
var state = "suspendedStart";
|
|
285
|
-
return function (method, arg) {
|
|
286
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
287
|
-
if ("completed" === state) {
|
|
288
|
-
if ("throw" === method) throw arg;
|
|
289
|
-
return doneResult();
|
|
290
|
-
}
|
|
291
|
-
for (context.method = method, context.arg = arg;;) {
|
|
292
|
-
var delegate = context.delegate;
|
|
293
|
-
if (delegate) {
|
|
294
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
295
|
-
if (delegateResult) {
|
|
296
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
297
|
-
return delegateResult;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
301
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
302
|
-
context.dispatchException(context.arg);
|
|
303
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
304
|
-
state = "executing";
|
|
305
|
-
var record = tryCatch(innerFn, self, context);
|
|
306
|
-
if ("normal" === record.type) {
|
|
307
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
308
|
-
return {
|
|
309
|
-
value: record.arg,
|
|
310
|
-
done: context.done
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
318
|
-
var methodName = context.method,
|
|
319
|
-
method = delegate.iterator[methodName];
|
|
320
|
-
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
321
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
322
|
-
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
323
|
-
var info = record.arg;
|
|
324
|
-
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
325
|
-
}
|
|
326
|
-
function pushTryEntry(locs) {
|
|
327
|
-
var entry = {
|
|
328
|
-
tryLoc: locs[0]
|
|
329
|
-
};
|
|
330
|
-
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
331
|
-
}
|
|
332
|
-
function resetTryEntry(entry) {
|
|
333
|
-
var record = entry.completion || {};
|
|
334
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
335
|
-
}
|
|
336
|
-
function Context(tryLocsList) {
|
|
337
|
-
this.tryEntries = [{
|
|
338
|
-
tryLoc: "root"
|
|
339
|
-
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
340
|
-
}
|
|
341
|
-
function values(iterable) {
|
|
342
|
-
if (iterable) {
|
|
343
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
344
|
-
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
345
|
-
if ("function" == typeof iterable.next) return iterable;
|
|
346
|
-
if (!isNaN(iterable.length)) {
|
|
347
|
-
var i = -1,
|
|
348
|
-
next = function next() {
|
|
349
|
-
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
350
|
-
return next.value = undefined, next.done = !0, next;
|
|
351
|
-
};
|
|
352
|
-
return next.next = next;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
return {
|
|
356
|
-
next: doneResult
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
function doneResult() {
|
|
360
|
-
return {
|
|
361
|
-
value: undefined,
|
|
362
|
-
done: !0
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
366
|
-
value: GeneratorFunctionPrototype,
|
|
367
|
-
configurable: !0
|
|
368
|
-
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
369
|
-
value: GeneratorFunction,
|
|
370
|
-
configurable: !0
|
|
371
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
372
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
373
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
374
|
-
}, exports.mark = function (genFun) {
|
|
375
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
376
|
-
}, exports.awrap = function (arg) {
|
|
377
|
-
return {
|
|
378
|
-
__await: arg
|
|
379
|
-
};
|
|
380
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
381
|
-
return this;
|
|
382
|
-
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
383
|
-
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
384
|
-
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
385
|
-
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
386
|
-
return result.done ? result.value : iter.next();
|
|
387
|
-
});
|
|
388
|
-
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
389
|
-
return this;
|
|
390
|
-
}), define(Gp, "toString", function () {
|
|
391
|
-
return "[object Generator]";
|
|
392
|
-
}), exports.keys = function (val) {
|
|
393
|
-
var object = Object(val),
|
|
394
|
-
keys = [];
|
|
395
|
-
for (var key in object) keys.push(key);
|
|
396
|
-
return keys.reverse(), function next() {
|
|
397
|
-
for (; keys.length;) {
|
|
398
|
-
var key = keys.pop();
|
|
399
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
400
|
-
}
|
|
401
|
-
return next.done = !0, next;
|
|
402
|
-
};
|
|
403
|
-
}, exports.values = values, Context.prototype = {
|
|
404
|
-
constructor: Context,
|
|
405
|
-
reset: function reset(skipTempReset) {
|
|
406
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
407
|
-
},
|
|
408
|
-
stop: function stop() {
|
|
409
|
-
this.done = !0;
|
|
410
|
-
var rootRecord = this.tryEntries[0].completion;
|
|
411
|
-
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
412
|
-
return this.rval;
|
|
413
|
-
},
|
|
414
|
-
dispatchException: function dispatchException(exception) {
|
|
415
|
-
if (this.done) throw exception;
|
|
416
|
-
var context = this;
|
|
417
|
-
function handle(loc, caught) {
|
|
418
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
419
|
-
}
|
|
420
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
421
|
-
var entry = this.tryEntries[i],
|
|
422
|
-
record = entry.completion;
|
|
423
|
-
if ("root" === entry.tryLoc) return handle("end");
|
|
424
|
-
if (entry.tryLoc <= this.prev) {
|
|
425
|
-
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
426
|
-
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
427
|
-
if (hasCatch && hasFinally) {
|
|
428
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
429
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
430
|
-
} else if (hasCatch) {
|
|
431
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
432
|
-
} else {
|
|
433
|
-
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
434
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
},
|
|
439
|
-
abrupt: function abrupt(type, arg) {
|
|
440
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
441
|
-
var entry = this.tryEntries[i];
|
|
442
|
-
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
443
|
-
var finallyEntry = entry;
|
|
444
|
-
break;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
448
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
449
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
450
|
-
},
|
|
451
|
-
complete: function complete(record, afterLoc) {
|
|
452
|
-
if ("throw" === record.type) throw record.arg;
|
|
453
|
-
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
454
|
-
},
|
|
455
|
-
finish: function finish(finallyLoc) {
|
|
456
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
457
|
-
var entry = this.tryEntries[i];
|
|
458
|
-
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
"catch": function _catch(tryLoc) {
|
|
462
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
463
|
-
var entry = this.tryEntries[i];
|
|
464
|
-
if (entry.tryLoc === tryLoc) {
|
|
465
|
-
var record = entry.completion;
|
|
466
|
-
if ("throw" === record.type) {
|
|
467
|
-
var thrown = record.arg;
|
|
468
|
-
resetTryEntry(entry);
|
|
469
|
-
}
|
|
470
|
-
return thrown;
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
throw new Error("illegal catch attempt");
|
|
474
|
-
},
|
|
475
|
-
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
476
|
-
return this.delegate = {
|
|
477
|
-
iterator: values(iterable),
|
|
478
|
-
resultName: resultName,
|
|
479
|
-
nextLoc: nextLoc
|
|
480
|
-
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
481
|
-
}
|
|
482
|
-
}, exports;
|
|
483
|
-
}
|
|
484
|
-
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
485
|
-
} (regeneratorRuntime$1));
|
|
486
|
-
|
|
487
|
-
var regeneratorRuntimeExports = regeneratorRuntime$1.exports;
|
|
488
|
-
|
|
489
|
-
// TODO(Babel 8): Remove this file.
|
|
490
|
-
|
|
491
|
-
var runtime = regeneratorRuntimeExports();
|
|
492
|
-
var regenerator = runtime;
|
|
493
|
-
|
|
494
|
-
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
495
|
-
try {
|
|
496
|
-
regeneratorRuntime = runtime;
|
|
497
|
-
} catch (accidentalStrictMode) {
|
|
498
|
-
if (typeof globalThis === "object") {
|
|
499
|
-
globalThis.regeneratorRuntime = runtime;
|
|
500
|
-
} else {
|
|
501
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
|
|
506
|
-
|
|
507
|
-
var propTypes = {exports: {}};
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
511
|
-
*
|
|
512
|
-
* This source code is licensed under the MIT license found in the
|
|
513
|
-
* LICENSE file in the root directory of this source tree.
|
|
514
|
-
*/
|
|
515
|
-
|
|
516
|
-
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
517
|
-
|
|
518
|
-
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
519
|
-
|
|
520
|
-
/**
|
|
521
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
522
|
-
*
|
|
523
|
-
* This source code is licensed under the MIT license found in the
|
|
524
|
-
* LICENSE file in the root directory of this source tree.
|
|
525
|
-
*/
|
|
526
|
-
|
|
527
|
-
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
528
|
-
|
|
529
|
-
function emptyFunction() {}
|
|
530
|
-
function emptyFunctionWithReset() {}
|
|
531
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
532
|
-
|
|
533
|
-
var factoryWithThrowingShims = function() {
|
|
534
|
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
535
|
-
if (secret === ReactPropTypesSecret) {
|
|
536
|
-
// It is still safe when called from React.
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
var err = new Error(
|
|
540
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
541
|
-
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
542
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
543
|
-
);
|
|
544
|
-
err.name = 'Invariant Violation';
|
|
545
|
-
throw err;
|
|
546
|
-
} shim.isRequired = shim;
|
|
547
|
-
function getShim() {
|
|
548
|
-
return shim;
|
|
549
|
-
} // Important!
|
|
550
|
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
551
|
-
var ReactPropTypes = {
|
|
552
|
-
array: shim,
|
|
553
|
-
bigint: shim,
|
|
554
|
-
bool: shim,
|
|
555
|
-
func: shim,
|
|
556
|
-
number: shim,
|
|
557
|
-
object: shim,
|
|
558
|
-
string: shim,
|
|
559
|
-
symbol: shim,
|
|
560
|
-
|
|
561
|
-
any: shim,
|
|
562
|
-
arrayOf: getShim,
|
|
563
|
-
element: shim,
|
|
564
|
-
elementType: shim,
|
|
565
|
-
instanceOf: getShim,
|
|
566
|
-
node: shim,
|
|
567
|
-
objectOf: getShim,
|
|
568
|
-
oneOf: getShim,
|
|
569
|
-
oneOfType: getShim,
|
|
570
|
-
shape: getShim,
|
|
571
|
-
exact: getShim,
|
|
572
|
-
|
|
573
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
574
|
-
resetWarningCache: emptyFunction
|
|
575
|
-
};
|
|
576
|
-
|
|
577
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
578
|
-
|
|
579
|
-
return ReactPropTypes;
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
584
|
-
*
|
|
585
|
-
* This source code is licensed under the MIT license found in the
|
|
586
|
-
* LICENSE file in the root directory of this source tree.
|
|
587
|
-
*/
|
|
588
|
-
|
|
589
|
-
{
|
|
590
|
-
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
591
|
-
// http://fb.me/prop-types-in-prod
|
|
592
|
-
propTypes.exports = factoryWithThrowingShims();
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
var propTypesExports = propTypes.exports;
|
|
596
|
-
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
597
|
-
|
|
598
|
-
function _arrayLikeToArray(arr, len) {
|
|
599
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
600
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
601
|
-
return arr2;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
function _arrayWithoutHoles(arr) {
|
|
605
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
function _iterableToArray(iter) {
|
|
609
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
613
|
-
if (!o) return;
|
|
614
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
615
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
616
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
617
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
618
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
function _nonIterableSpread() {
|
|
622
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
function _toConsumableArray(arr) {
|
|
626
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
var ACTION_TYPES = {
|
|
630
|
-
emailToIds: "emailToIds",
|
|
631
|
-
email: "email",
|
|
632
|
-
emailTo: "emailTo",
|
|
633
|
-
dropdown: "dropdown",
|
|
634
|
-
list: "list",
|
|
635
|
-
multiSelect: "multiSelect",
|
|
636
|
-
note: "note",
|
|
637
|
-
text: "text",
|
|
638
|
-
number: "number",
|
|
639
|
-
decimal: "decimal",
|
|
640
|
-
regex: "regex",
|
|
641
|
-
textarea: "textarea",
|
|
642
|
-
date: "date",
|
|
643
|
-
longText: "longText"
|
|
644
|
-
};
|
|
645
|
-
var LIST_FIELD_TOOLTIP_PROPS = {
|
|
646
|
-
save: {
|
|
647
|
-
content: i18next.t("neetoRules.buttons.save"),
|
|
648
|
-
position: "top",
|
|
649
|
-
delay: 300
|
|
650
|
-
},
|
|
651
|
-
cancel: {
|
|
652
|
-
content: i18next.t("neetoRules.buttons.cancel"),
|
|
653
|
-
position: "top",
|
|
654
|
-
delay: 300
|
|
655
|
-
}
|
|
656
|
-
};
|
|
657
|
-
var DEFAULT_RULE_ACTION = {
|
|
658
|
-
name: "",
|
|
659
|
-
metadata: {}
|
|
660
|
-
};
|
|
661
|
-
var EDITOR_ADDONS = ["code-block", "block-quote", "image-upload"];
|
|
662
|
-
var EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
663
|
-
var MAXIMUM_OPTION_LENGTH$3 = 7;
|
|
664
|
-
var ACTION_INPUT_TYPES = ["text", "number", "decimal", "regex"];
|
|
665
|
-
|
|
666
|
-
var OPERATORS$1 = {
|
|
667
|
-
or: "or_operator",
|
|
668
|
-
and: "and_operator"
|
|
669
|
-
};
|
|
670
|
-
var OPERATOR_LABELS = {
|
|
671
|
-
or_operator: i18next.t("neetoRules.operators.or"),
|
|
672
|
-
and_operator: i18next.t("neetoRules.operators.and")
|
|
673
|
-
};
|
|
674
|
-
var VERB_LABELS = {
|
|
675
|
-
is: i18next.t("neetoRules.conditionVerbs.is"),
|
|
676
|
-
is_not: i18next.t("neetoRules.conditionVerbs.isNot"),
|
|
677
|
-
contains: i18next.t("neetoRules.conditionVerbs.contains"),
|
|
678
|
-
does_not_contain: i18next.t("neetoRules.conditionVerbs.doesNotContain"),
|
|
679
|
-
contains_any_of: i18next.t("neetoRules.conditionVerbs.containsAnyOf"),
|
|
680
|
-
contains_all_of: i18next.t("neetoRules.conditionVerbs.containsAllOf"),
|
|
681
|
-
contains_none_of: i18next.t("neetoRules.conditionVerbs.containsNoneOf"),
|
|
682
|
-
starts_with: i18next.t("neetoRules.conditionVerbs.startsWith"),
|
|
683
|
-
ends_with: i18next.t("neetoRules.conditionVerbs.endsWith"),
|
|
684
|
-
less_than: i18next.t("neetoRules.conditionVerbs.lessThan"),
|
|
685
|
-
greater_than: i18next.t("neetoRules.conditionVerbs.greaterThan"),
|
|
686
|
-
any_time: i18next.t("neetoRules.conditionVerbs.anyTime"),
|
|
687
|
-
during: i18next.t("neetoRules.conditionVerbs.during"),
|
|
688
|
-
not_during: i18next.t("neetoRules.conditionVerbs.notDuring"),
|
|
689
|
-
any_of: i18next.t("neetoRules.conditionVerbs.anyOf"),
|
|
690
|
-
none_of: i18next.t("neetoRules.conditionVerbs.noneOf"),
|
|
691
|
-
is_before: i18next.t("neetoRules.conditionVerbs.isBefore"),
|
|
692
|
-
is_after: i18next.t("neetoRules.conditionVerbs.isAfter")
|
|
693
|
-
};
|
|
694
|
-
var CONDITION_VALUE_TYPES = {
|
|
695
|
-
text: "text",
|
|
696
|
-
number: "number",
|
|
697
|
-
decimal: "decimal",
|
|
698
|
-
url: "url",
|
|
699
|
-
email: "email",
|
|
700
|
-
dropdown: "dropdown",
|
|
701
|
-
multiSelect: "multi-select",
|
|
702
|
-
multiSelectCreate: "multi-select-create",
|
|
703
|
-
date: "date",
|
|
704
|
-
regex: "regex",
|
|
705
|
-
textarea: "textarea"
|
|
706
|
-
};
|
|
707
|
-
var INPUT_FIELD_TYPES = ["email", "text", "number", "decimal", "url", "regex"];
|
|
708
|
-
var MAXIMUM_OPTION_LENGTH$2 = 7;
|
|
288
|
+
var OPERATORS$1 = {
|
|
289
|
+
or: "or_operator",
|
|
290
|
+
and: "and_operator"
|
|
291
|
+
};
|
|
292
|
+
var OPERATOR_LABELS = {
|
|
293
|
+
or_operator: i18next.t("neetoRules.operators.or"),
|
|
294
|
+
and_operator: i18next.t("neetoRules.operators.and")
|
|
295
|
+
};
|
|
296
|
+
var VERB_LABELS = {
|
|
297
|
+
is: i18next.t("neetoRules.conditionVerbs.is"),
|
|
298
|
+
is_not: i18next.t("neetoRules.conditionVerbs.isNot"),
|
|
299
|
+
contains: i18next.t("neetoRules.conditionVerbs.contains"),
|
|
300
|
+
does_not_contain: i18next.t("neetoRules.conditionVerbs.doesNotContain"),
|
|
301
|
+
contains_any_of: i18next.t("neetoRules.conditionVerbs.containsAnyOf"),
|
|
302
|
+
contains_all_of: i18next.t("neetoRules.conditionVerbs.containsAllOf"),
|
|
303
|
+
contains_none_of: i18next.t("neetoRules.conditionVerbs.containsNoneOf"),
|
|
304
|
+
starts_with: i18next.t("neetoRules.conditionVerbs.startsWith"),
|
|
305
|
+
ends_with: i18next.t("neetoRules.conditionVerbs.endsWith"),
|
|
306
|
+
less_than: i18next.t("neetoRules.conditionVerbs.lessThan"),
|
|
307
|
+
greater_than: i18next.t("neetoRules.conditionVerbs.greaterThan"),
|
|
308
|
+
any_time: i18next.t("neetoRules.conditionVerbs.anyTime"),
|
|
309
|
+
during: i18next.t("neetoRules.conditionVerbs.during"),
|
|
310
|
+
not_during: i18next.t("neetoRules.conditionVerbs.notDuring"),
|
|
311
|
+
any_of: i18next.t("neetoRules.conditionVerbs.anyOf"),
|
|
312
|
+
none_of: i18next.t("neetoRules.conditionVerbs.noneOf"),
|
|
313
|
+
is_before: i18next.t("neetoRules.conditionVerbs.isBefore"),
|
|
314
|
+
is_after: i18next.t("neetoRules.conditionVerbs.isAfter")
|
|
315
|
+
};
|
|
316
|
+
var CONDITION_VALUE_TYPES = {
|
|
317
|
+
text: "text",
|
|
318
|
+
number: "number",
|
|
319
|
+
decimal: "decimal",
|
|
320
|
+
url: "url",
|
|
321
|
+
email: "email",
|
|
322
|
+
dropdown: "dropdown",
|
|
323
|
+
multiSelect: "multi-select",
|
|
324
|
+
multiSelectCreate: "multi-select-create",
|
|
325
|
+
date: "date",
|
|
326
|
+
regex: "regex",
|
|
327
|
+
textarea: "textarea"
|
|
328
|
+
};
|
|
329
|
+
var INPUT_FIELD_TYPES = ["email", "text", "number", "decimal", "url", "regex"];
|
|
330
|
+
var MAXIMUM_OPTION_LENGTH$2 = 7;
|
|
709
331
|
|
|
710
332
|
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
711
333
|
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -825,7 +447,7 @@ var getConditionsSchema = function getConditionsSchema(element) {
|
|
|
825
447
|
}))
|
|
826
448
|
});
|
|
827
449
|
};
|
|
828
|
-
var getActionsSchema = function getActionsSchema(element) {
|
|
450
|
+
var getActionsSchema = function getActionsSchema(element, customData) {
|
|
829
451
|
var actionOptions = element.actionOptions,
|
|
830
452
|
_element$componentPro5 = element.componentProps,
|
|
831
453
|
componentProps = _element$componentPro5 === void 0 ? {} : _element$componentPro5;
|
|
@@ -890,7 +512,7 @@ var getActionsSchema = function getActionsSchema(element) {
|
|
|
890
512
|
value: yup__namespace.string().required(i18next.t("neetoRules.validations.required.body"))
|
|
891
513
|
});
|
|
892
514
|
} else if (selectedAction !== null && selectedAction !== void 0 && selectedAction.component) {
|
|
893
|
-
return selectedAction.validation;
|
|
515
|
+
return typeof selectedAction.validation === "function" ? selectedAction.validation(customData) : selectedAction.validation;
|
|
894
516
|
}
|
|
895
517
|
return schema;
|
|
896
518
|
})
|
|
@@ -908,14 +530,14 @@ var getSchemaForArray = function getSchemaForArray(element) {
|
|
|
908
530
|
then: yup__namespace.array().min(1, i18next.t("neetoRules.validations.atLeastOneValue")).required(i18next.t("neetoRules.validations.atLeastOneValue"))
|
|
909
531
|
});
|
|
910
532
|
};
|
|
911
|
-
var getSchemaForElement = function getSchemaForElement(element) {
|
|
912
|
-
return VALIDATION_SCHEMA[element.type](element);
|
|
533
|
+
var getSchemaForElement = function getSchemaForElement(element, customData) {
|
|
534
|
+
return VALIDATION_SCHEMA[element.type](element, customData);
|
|
913
535
|
};
|
|
914
|
-
var getValidationSchema = function getValidationSchema(data) {
|
|
536
|
+
var getValidationSchema = function getValidationSchema(data, customData) {
|
|
915
537
|
var fieldKeys = Object.keys(data);
|
|
916
538
|
var schema = fieldKeys.reduce(function (acc, key) {
|
|
917
539
|
return _objectSpread$6(_objectSpread$6({}, acc), {}, _defineProperty({}, key, yup__namespace.object({
|
|
918
|
-
value: getSchemaForElement(data[key])
|
|
540
|
+
value: getSchemaForElement(data[key], customData)
|
|
919
541
|
})));
|
|
920
542
|
}, {});
|
|
921
543
|
return yup__namespace.object(schema);
|
|
@@ -973,6 +595,14 @@ var formatData = function formatData(data) {
|
|
|
973
595
|
}, {});
|
|
974
596
|
};
|
|
975
597
|
|
|
598
|
+
/** @type {import("neetocommons/react-utils").ZustandStoreHook} */
|
|
599
|
+
var useCustomDataStore = zustand.create(reactUtils.withImmutableActions(function (set) {
|
|
600
|
+
return {
|
|
601
|
+
customData: {},
|
|
602
|
+
setCustomDataState: set
|
|
603
|
+
};
|
|
604
|
+
}));
|
|
605
|
+
|
|
976
606
|
var transformObjectToDotNotation = function transformObjectToDotNotation(obj) {
|
|
977
607
|
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
978
608
|
var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
@@ -1036,37 +666,29 @@ var NeetoRules$2 = function NeetoRules(_ref) {
|
|
|
1036
666
|
_ref$handleCancel = _ref.handleCancel,
|
|
1037
667
|
handleCancel = _ref$handleCancel === void 0 ? neetoCist.noop : _ref$handleCancel;
|
|
1038
668
|
var formRef = React.useRef(null);
|
|
1039
|
-
var submitForm =
|
|
1040
|
-
var
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
while (1) switch (_context.prev = _context.next) {
|
|
1044
|
-
case 0:
|
|
1045
|
-
payload = buildPayload(data, values);
|
|
1046
|
-
handleSubmit(payload, formikBag);
|
|
1047
|
-
case 2:
|
|
1048
|
-
case "end":
|
|
1049
|
-
return _context.stop();
|
|
1050
|
-
}
|
|
1051
|
-
}, _callee);
|
|
1052
|
-
}));
|
|
1053
|
-
return function submitForm(_x, _x2) {
|
|
1054
|
-
return _ref2.apply(this, arguments);
|
|
1055
|
-
};
|
|
1056
|
-
}();
|
|
669
|
+
var submitForm = function submitForm(values, formikBag) {
|
|
670
|
+
var payload = buildPayload(data, values);
|
|
671
|
+
handleSubmit(payload, formikBag);
|
|
672
|
+
};
|
|
1057
673
|
var initialValues = React.useMemo(function () {
|
|
1058
674
|
return formatData(data);
|
|
1059
675
|
}, [data]);
|
|
676
|
+
var _useCustomDataStore = useCustomDataStore(function (store) {
|
|
677
|
+
return {
|
|
678
|
+
customData: store["customData"]
|
|
679
|
+
};
|
|
680
|
+
}, shallow.shallow),
|
|
681
|
+
customData = _useCustomDataStore.customData;
|
|
1060
682
|
return /*#__PURE__*/React__default["default"].createElement(formik.Formik, {
|
|
1061
683
|
initialValues: initialValues,
|
|
1062
684
|
enableReinitialize: true,
|
|
1063
|
-
validationSchema: getValidationSchema(data),
|
|
685
|
+
validationSchema: getValidationSchema(data, customData),
|
|
1064
686
|
onSubmit: submitForm
|
|
1065
|
-
}, function (
|
|
1066
|
-
var isSubmitting =
|
|
1067
|
-
dirty =
|
|
1068
|
-
values =
|
|
1069
|
-
fromikBag = _objectWithoutProperties(
|
|
687
|
+
}, function (_ref2) {
|
|
688
|
+
var isSubmitting = _ref2.isSubmitting,
|
|
689
|
+
dirty = _ref2.dirty,
|
|
690
|
+
values = _ref2.values,
|
|
691
|
+
fromikBag = _objectWithoutProperties(_ref2, _excluded$9);
|
|
1070
692
|
return /*#__PURE__*/React__default["default"].createElement(formik.Form, {
|
|
1071
693
|
className: classNames__default["default"](["w-full space-y-6 px-24", className]),
|
|
1072
694
|
ref: formRef
|
|
@@ -1107,7 +729,7 @@ var Main = function Main(_ref) {
|
|
|
1107
729
|
|
|
1108
730
|
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}}
|
|
1109
731
|
|
|
1110
|
-
var css = ".neeto-filters-error-boundary{align-items:center;background-color
|
|
732
|
+
var css = ".neeto-filters-error-boundary{align-items:center;background-color:rgb(var(--neeto-ui-gray-100));border-radius:var(--neeto-ui-rounded-sm);display:flex;gap:16px;margin-bottom:12px;padding:8px 20px}.neeto-filters-error-boundary p{color:rgb(var(--neeto-ui-gray-800))}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9jb21wb25lbnRzL19lcnJvci1ib3VuZGFyeS5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3JjL3N0eWxlc2hlZXRzL21haW4uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw4QkFJRSxrQkFBQSxDQUdBLDhDQUFBLENBREEsd0NBQUEsQ0FIQSxZQUFBLENBRUEsUUFBQSxDQUhBLGtCQUFBLENBREEsZ0JDT0YsQ0RDRSxnQ0FDRSxtQ0NDSiIsInNvdXJjZXNDb250ZW50IjpbIi5uZWV0by1maWx0ZXJzLWVycm9yLWJvdW5kYXJ5IHtcbiAgcGFkZGluZzogOHB4IDIwcHg7XG4gIG1hcmdpbi1ib3R0b206IDEycHg7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGdhcDogMTZweDtcbiAgYm9yZGVyLXJhZGl1czogdmFyKC0tbmVldG8tdWktcm91bmRlZC1zbSk7XG4gIGJhY2tncm91bmQtY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTEwMCkpO1xuXG4gIHAge1xuICAgIGNvbG9yOiByZ2IodmFyKC0tbmVldG8tdWktZ3JheS04MDApKTtcbiAgfVxufVxuIiwiLm5lZXRvLWZpbHRlcnMtZXJyb3ItYm91bmRhcnkge1xuICBwYWRkaW5nOiA4cHggMjBweDtcbiAgbWFyZ2luLWJvdHRvbTogMTJweDtcbiAgZGlzcGxheTogZmxleDtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgZ2FwOiAxNnB4O1xuICBib3JkZXItcmFkaXVzOiB2YXIoLS1uZWV0by11aS1yb3VuZGVkLXNtKTtcbiAgYmFja2dyb3VuZC1jb2xvcjogcmdiKHZhcigtLW5lZXRvLXVpLWdyYXktMTAwKSk7XG59XG4ubmVldG8tZmlsdGVycy1lcnJvci1ib3VuZGFyeSBwIHtcbiAgY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTgwMCkpO1xufSJdfQ== */";
|
|
1111
733
|
n(css,{});
|
|
1112
734
|
|
|
1113
735
|
var NeetoRules$1 = function NeetoRules(_ref) {
|
|
@@ -3150,31 +2772,196 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
3150
2772
|
});
|
|
3151
2773
|
}
|
|
3152
2774
|
};
|
|
3153
|
-
React.useEffect(function () {
|
|
3154
|
-
findDefaultSelectedOption();
|
|
3155
|
-
}, [options, conditions]);
|
|
2775
|
+
React.useEffect(function () {
|
|
2776
|
+
findDefaultSelectedOption();
|
|
2777
|
+
}, [options, conditions]);
|
|
2778
|
+
return /*#__PURE__*/React__default["default"].createElement(neetoui.Dropdown, {
|
|
2779
|
+
buttonStyle: "secondary",
|
|
2780
|
+
className: "neeto-ui-bg-gray-100",
|
|
2781
|
+
customTarget: /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
2782
|
+
"data-cy": "condition-value-dropdown-button",
|
|
2783
|
+
style: "h5",
|
|
2784
|
+
weight: "semibold",
|
|
2785
|
+
className: classNames__default["default"]("hover:neeto-ui-text-primary-800 neeto-ui-text-gray-800 mt-1 cursor-pointer underline", {
|
|
2786
|
+
"neeto-ui-text-primary-800": isActive,
|
|
2787
|
+
"neeto-ui-text-error-500": isValueSelected
|
|
2788
|
+
}),
|
|
2789
|
+
onClick: function onClick() {
|
|
2790
|
+
setTouched(ramda.assocPath(["conditions", "value", index], true, touched));
|
|
2791
|
+
setIsActive(function (prevState) {
|
|
2792
|
+
return !prevState;
|
|
2793
|
+
});
|
|
2794
|
+
}
|
|
2795
|
+
}, defaultSelectedOption === null || defaultSelectedOption === void 0 || (_defaultSelectedOptio = defaultSelectedOption.label) === null || _defaultSelectedOptio === void 0 ? void 0 : _defaultSelectedOptio.toLowerCase()),
|
|
2796
|
+
onClose: handleClose
|
|
2797
|
+
}, /*#__PURE__*/React__default["default"].createElement(Menu$5, {
|
|
2798
|
+
className: "max-h-60 max-w-2xl p-3"
|
|
2799
|
+
}, options.length > MAXIMUM_OPTION_LENGTH$2 && /*#__PURE__*/React__default["default"].createElement(neetoui.Input, {
|
|
2800
|
+
autoFocus: true,
|
|
2801
|
+
className: "mb-1",
|
|
2802
|
+
"data-cy": "search-text-field",
|
|
2803
|
+
placeholder: i18next.t("neetoRules.common.search"),
|
|
2804
|
+
prefix: /*#__PURE__*/React__default["default"].createElement(neetoIcons.Search, null),
|
|
2805
|
+
value: searchTerm,
|
|
2806
|
+
onChange: function onChange(e) {
|
|
2807
|
+
return setSearchTerm(e.target.value);
|
|
2808
|
+
},
|
|
2809
|
+
onClick: function onClick(e) {
|
|
2810
|
+
return e.stopPropagation();
|
|
2811
|
+
}
|
|
2812
|
+
}), /*#__PURE__*/React__default["default"].createElement(OptionsWrapper, {
|
|
2813
|
+
hasScroll: options.length > MAXIMUM_OPTION_LENGTH$2
|
|
2814
|
+
}, searchedOptions.map(function (option, idx) {
|
|
2815
|
+
return /*#__PURE__*/React__default["default"].createElement(MenuItem$5.Button, {
|
|
2816
|
+
"data-cy": "".concat(utils.joinHyphenCase(option.label), "-menu-item"),
|
|
2817
|
+
key: idx,
|
|
2818
|
+
className: classNames__default["default"]({
|
|
2819
|
+
"neeto-ui-bg-gray-100": (defaultSelectedOption === null || defaultSelectedOption === void 0 ? void 0 : defaultSelectedOption.value) === option.value
|
|
2820
|
+
}),
|
|
2821
|
+
suffix: (defaultSelectedOption === null || defaultSelectedOption === void 0 ? void 0 : defaultSelectedOption.value) === option.value && /*#__PURE__*/React__default["default"].createElement(neetoIcons.Check, {
|
|
2822
|
+
className: "neeto-ui-text-primary-800"
|
|
2823
|
+
}),
|
|
2824
|
+
onClick: function onClick() {
|
|
2825
|
+
return handleSelectOption(option);
|
|
2826
|
+
}
|
|
2827
|
+
}, option.label);
|
|
2828
|
+
})), ramda.isEmpty(options) && /*#__PURE__*/React__default["default"].createElement(MenuItem$5.Button, {
|
|
2829
|
+
"data-cy": "no-options-menu-item"
|
|
2830
|
+
}, i18next.t("neetoRules.common.noOptions"))));
|
|
2831
|
+
};
|
|
2832
|
+
|
|
2833
|
+
var InputField$1 = function InputField(_ref) {
|
|
2834
|
+
var _condition$metadata, _errors$conditions, _touched$conditions;
|
|
2835
|
+
var name = _ref.name,
|
|
2836
|
+
index = _ref.index,
|
|
2837
|
+
placeholder = _ref.placeholder;
|
|
2838
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
2839
|
+
conditions = _useFormikContext.values.conditions,
|
|
2840
|
+
errors = _useFormikContext.errors,
|
|
2841
|
+
touched = _useFormikContext.touched;
|
|
2842
|
+
var _useState = React.useState(false),
|
|
2843
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2844
|
+
showInput = _useState2[0],
|
|
2845
|
+
setShowInput = _useState2[1];
|
|
2846
|
+
var inputRef = React.useRef(null);
|
|
2847
|
+
useCloseInputField(inputRef, showInput, function () {
|
|
2848
|
+
return setShowInput(false);
|
|
2849
|
+
});
|
|
2850
|
+
var condition = conditions.value[index];
|
|
2851
|
+
var valueTerm = (_condition$metadata = condition.metadata) === null || _condition$metadata === void 0 || (_condition$metadata = _condition$metadata.value) === null || _condition$metadata === void 0 ? void 0 : _condition$metadata.toString();
|
|
2852
|
+
var label = valueTerm && valueTerm !== null && valueTerm !== void 0 && valueTerm.trim().length ? valueTerm : i18next.t("neetoRules.form.addValue");
|
|
2853
|
+
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0 || (_errors$conditions = _errors$conditions.value) === null || _errors$conditions === void 0 ? void 0 : _errors$conditions[index]) && ramda.isNotNil((_touched$conditions = touched.conditions) === null || _touched$conditions === void 0 || (_touched$conditions = _touched$conditions.value) === null || _touched$conditions === void 0 ? void 0 : _touched$conditions[index]);
|
|
2854
|
+
React.useEffect(function () {
|
|
2855
|
+
setShowInput(false);
|
|
2856
|
+
}, [condition.verb]);
|
|
2857
|
+
return showInput ? /*#__PURE__*/React__default["default"].createElement(formik$1.Input, {
|
|
2858
|
+
name: name,
|
|
2859
|
+
placeholder: placeholder,
|
|
2860
|
+
ref: inputRef,
|
|
2861
|
+
size: "small",
|
|
2862
|
+
suffix: /*#__PURE__*/React__default["default"].createElement(neetoIcons.Check, {
|
|
2863
|
+
className: "cursor-pointer",
|
|
2864
|
+
onClick: function onClick() {
|
|
2865
|
+
return setShowInput(function (prevState) {
|
|
2866
|
+
return !prevState;
|
|
2867
|
+
});
|
|
2868
|
+
}
|
|
2869
|
+
})
|
|
2870
|
+
}) : /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
2871
|
+
style: "h5",
|
|
2872
|
+
weight: "semibold",
|
|
2873
|
+
className: classNames__default["default"]("neeto-ui-text-gray-800 hover:neeto-ui-text-primary-800 mt-1 cursor-pointer underline", {
|
|
2874
|
+
"neeto-ui-text-error-500": isValid
|
|
2875
|
+
}),
|
|
2876
|
+
onClick: function onClick() {
|
|
2877
|
+
return setShowInput(function (prevState) {
|
|
2878
|
+
return !prevState;
|
|
2879
|
+
});
|
|
2880
|
+
}
|
|
2881
|
+
}, label);
|
|
2882
|
+
};
|
|
2883
|
+
|
|
2884
|
+
var Menu$4 = neetoui.Dropdown.Menu,
|
|
2885
|
+
MenuItem$4 = neetoui.Dropdown.MenuItem;
|
|
2886
|
+
var MultiSelect = function MultiSelect(_ref) {
|
|
2887
|
+
var _conditions$value$ind, _errors$conditions, _touched$conditions;
|
|
2888
|
+
var name = _ref.name,
|
|
2889
|
+
dropDownOptions = _ref.dropDownOptions,
|
|
2890
|
+
index = _ref.index;
|
|
2891
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
2892
|
+
conditions = _useFormikContext.values.conditions,
|
|
2893
|
+
setFieldValue = _useFormikContext.setFieldValue,
|
|
2894
|
+
errors = _useFormikContext.errors,
|
|
2895
|
+
touched = _useFormikContext.touched,
|
|
2896
|
+
setTouched = _useFormikContext.setTouched;
|
|
2897
|
+
var _useState = React.useState(null),
|
|
2898
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2899
|
+
activeOption = _useState2[0],
|
|
2900
|
+
setActiveOption = _useState2[1];
|
|
2901
|
+
var _useState3 = React.useState(""),
|
|
2902
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
2903
|
+
searchTerm = _useState4[0],
|
|
2904
|
+
setSearchTerm = _useState4[1];
|
|
2905
|
+
var values = (_conditions$value$ind = conditions.value[index]) === null || _conditions$value$ind === void 0 || (_conditions$value$ind = _conditions$value$ind.metadata) === null || _conditions$value$ind === void 0 ? void 0 : _conditions$value$ind.values;
|
|
2906
|
+
var selectedOptions = values || [];
|
|
2907
|
+
var defaultLabel = i18next.t("neetoRules.form.selectValues");
|
|
2908
|
+
var options = dropDownOptions === null || dropDownOptions === void 0 ? void 0 : dropDownOptions.filter(function (option) {
|
|
2909
|
+
return selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.includes(option.value);
|
|
2910
|
+
});
|
|
2911
|
+
var searchedOptions = getSearchedOptions$2(dropDownOptions, searchTerm);
|
|
2912
|
+
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0 || (_errors$conditions = _errors$conditions.value) === null || _errors$conditions === void 0 ? void 0 : _errors$conditions[index]) && ramda.isNotNil((_touched$conditions = touched.conditions) === null || _touched$conditions === void 0 || (_touched$conditions = _touched$conditions.value) === null || _touched$conditions === void 0 ? void 0 : _touched$conditions[index]);
|
|
2913
|
+
var handleMultiSelectOption = function handleMultiSelectOption(value) {
|
|
2914
|
+
var options = selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.includes(value) ? ramda.without([value], selectedOptions) : ramda.append(value, selectedOptions);
|
|
2915
|
+
setFieldValue(name, options);
|
|
2916
|
+
};
|
|
2917
|
+
var handleClose = function handleClose() {
|
|
2918
|
+
setActiveOption(null);
|
|
2919
|
+
setSearchTerm("");
|
|
2920
|
+
};
|
|
3156
2921
|
return /*#__PURE__*/React__default["default"].createElement(neetoui.Dropdown, {
|
|
3157
2922
|
buttonStyle: "secondary",
|
|
3158
2923
|
className: "neeto-ui-bg-gray-100",
|
|
3159
|
-
|
|
3160
|
-
|
|
2924
|
+
closeOnSelect: false,
|
|
2925
|
+
position: "top-start",
|
|
2926
|
+
customTarget: neetoCist.isNotEmpty(options) ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2927
|
+
className: "flex flex-wrap gap-y-1"
|
|
2928
|
+
}, options.map(function (option, idx) {
|
|
2929
|
+
var _option$label;
|
|
2930
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
2931
|
+
key: idx
|
|
2932
|
+
}, !!idx && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
2933
|
+
className: "neeto-ui-text-gray-700 mr-1 mt-1",
|
|
2934
|
+
style: "h5",
|
|
2935
|
+
weight: "normal"
|
|
2936
|
+
}, i18next.t("neetoRules.common.or")), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
2937
|
+
"data-cy": "condition-value-multi-select-field",
|
|
2938
|
+
style: "h5",
|
|
2939
|
+
weight: "semibold",
|
|
2940
|
+
className: classNames__default["default"]("hover:neeto-ui-text-primary-800 neeto-ui-text-gray-800 mr-1 mt-1 cursor-pointer underline", {
|
|
2941
|
+
"neeto-ui-text-primary-800": activeOption === option.value
|
|
2942
|
+
}),
|
|
2943
|
+
onClick: function onClick() {
|
|
2944
|
+
setTouched(ramda.assocPath(["conditions", "value", index], true, touched));
|
|
2945
|
+
setActiveOption(activeOption ? null : option.value);
|
|
2946
|
+
}
|
|
2947
|
+
}, option === null || option === void 0 || (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.toLowerCase()));
|
|
2948
|
+
})) : /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
2949
|
+
"data-cy": "condition-value-multi-select-field",
|
|
3161
2950
|
style: "h5",
|
|
3162
2951
|
weight: "semibold",
|
|
3163
2952
|
className: classNames__default["default"]("hover:neeto-ui-text-primary-800 neeto-ui-text-gray-800 mt-1 cursor-pointer underline", {
|
|
3164
|
-
"neeto-ui-text-primary-800":
|
|
3165
|
-
"neeto-ui-text-error-500":
|
|
2953
|
+
"neeto-ui-text-primary-800": activeOption === defaultLabel,
|
|
2954
|
+
"neeto-ui-text-error-500": isValid
|
|
3166
2955
|
}),
|
|
3167
2956
|
onClick: function onClick() {
|
|
3168
2957
|
setTouched(ramda.assocPath(["conditions", "value", index], true, touched));
|
|
3169
|
-
|
|
3170
|
-
return !prevState;
|
|
3171
|
-
});
|
|
2958
|
+
setActiveOption(activeOption ? null : defaultLabel);
|
|
3172
2959
|
}
|
|
3173
|
-
},
|
|
2960
|
+
}, defaultLabel),
|
|
3174
2961
|
onClose: handleClose
|
|
3175
|
-
}, /*#__PURE__*/React__default["default"].createElement(Menu$
|
|
2962
|
+
}, /*#__PURE__*/React__default["default"].createElement(Menu$4, {
|
|
3176
2963
|
className: "max-h-60 max-w-2xl p-3"
|
|
3177
|
-
},
|
|
2964
|
+
}, dropDownOptions.length > MAXIMUM_OPTION_LENGTH$2 && /*#__PURE__*/React__default["default"].createElement(neetoui.Input, {
|
|
3178
2965
|
autoFocus: true,
|
|
3179
2966
|
className: "mb-1",
|
|
3180
2967
|
"data-cy": "search-text-field",
|
|
@@ -3183,286 +2970,501 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
3183
2970
|
value: searchTerm,
|
|
3184
2971
|
onChange: function onChange(e) {
|
|
3185
2972
|
return setSearchTerm(e.target.value);
|
|
3186
|
-
},
|
|
3187
|
-
onClick: function onClick(e) {
|
|
3188
|
-
return e.stopPropagation();
|
|
3189
2973
|
}
|
|
3190
2974
|
}), /*#__PURE__*/React__default["default"].createElement(OptionsWrapper, {
|
|
3191
|
-
hasScroll:
|
|
2975
|
+
hasScroll: dropDownOptions.length > MAXIMUM_OPTION_LENGTH$2
|
|
3192
2976
|
}, searchedOptions.map(function (option, idx) {
|
|
3193
|
-
return /*#__PURE__*/React__default["default"].createElement(MenuItem$
|
|
2977
|
+
return /*#__PURE__*/React__default["default"].createElement(MenuItem$4.Button, {
|
|
3194
2978
|
"data-cy": "".concat(utils.joinHyphenCase(option.label), "-menu-item"),
|
|
3195
2979
|
key: idx,
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
className: "neeto-ui-text-primary-800"
|
|
2980
|
+
prefix: /*#__PURE__*/React__default["default"].createElement(neetoui.Checkbox, {
|
|
2981
|
+
checked: selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.includes(option.value),
|
|
2982
|
+
"data-cy": "check-icon",
|
|
2983
|
+
id: option.value
|
|
3201
2984
|
}),
|
|
3202
2985
|
onClick: function onClick() {
|
|
3203
|
-
return
|
|
2986
|
+
return handleMultiSelectOption(option.value);
|
|
3204
2987
|
}
|
|
3205
2988
|
}, option.label);
|
|
3206
|
-
})), ramda.isEmpty(
|
|
2989
|
+
})), ramda.isEmpty(dropDownOptions) && /*#__PURE__*/React__default["default"].createElement(MenuItem$4.Button, {
|
|
3207
2990
|
"data-cy": "no-options-menu-item"
|
|
3208
2991
|
}, i18next.t("neetoRules.common.noOptions"))));
|
|
3209
2992
|
};
|
|
3210
2993
|
|
|
3211
|
-
var
|
|
3212
|
-
|
|
2994
|
+
var _excluded$6 = ["name", "index"];
|
|
2995
|
+
var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
2996
|
+
var _conditions$value$ind, _errors$conditions, _touched$conditions;
|
|
3213
2997
|
var name = _ref.name,
|
|
3214
2998
|
index = _ref.index,
|
|
3215
|
-
|
|
2999
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
3216
3000
|
var _useFormikContext = formik.useFormikContext(),
|
|
3217
3001
|
conditions = _useFormikContext.values.conditions,
|
|
3002
|
+
setFieldValue = _useFormikContext.setFieldValue,
|
|
3218
3003
|
errors = _useFormikContext.errors,
|
|
3219
|
-
touched = _useFormikContext.touched
|
|
3004
|
+
touched = _useFormikContext.touched,
|
|
3005
|
+
setTouched = _useFormikContext.setTouched;
|
|
3220
3006
|
var _useState = React.useState(false),
|
|
3221
3007
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
var
|
|
3225
|
-
|
|
3226
|
-
return
|
|
3008
|
+
showPane = _useState2[0],
|
|
3009
|
+
setShowPane = _useState2[1];
|
|
3010
|
+
var initialFocusRef = React.useRef(null);
|
|
3011
|
+
useOnButtonPressed(initialFocusRef, function () {
|
|
3012
|
+
return setShowPane(false);
|
|
3227
3013
|
});
|
|
3228
|
-
var
|
|
3229
|
-
var
|
|
3230
|
-
var
|
|
3014
|
+
var values = (_conditions$value$ind = conditions.value[index]) === null || _conditions$value$ind === void 0 || (_conditions$value$ind = _conditions$value$ind.metadata) === null || _conditions$value$ind === void 0 ? void 0 : _conditions$value$ind.values;
|
|
3015
|
+
var allOptions = getAllOptions(values);
|
|
3016
|
+
var defaultLabel = i18next.t("neetoRules.form.selectValues");
|
|
3231
3017
|
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0 || (_errors$conditions = _errors$conditions.value) === null || _errors$conditions === void 0 ? void 0 : _errors$conditions[index]) && ramda.isNotNil((_touched$conditions = touched.conditions) === null || _touched$conditions === void 0 || (_touched$conditions = _touched$conditions.value) === null || _touched$conditions === void 0 ? void 0 : _touched$conditions[index]);
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
}, [condition.verb]);
|
|
3235
|
-
return showInput ? /*#__PURE__*/React__default["default"].createElement(formik$1.Input, {
|
|
3236
|
-
name: name,
|
|
3237
|
-
placeholder: placeholder,
|
|
3238
|
-
ref: inputRef,
|
|
3239
|
-
size: "small",
|
|
3240
|
-
suffix: /*#__PURE__*/React__default["default"].createElement(neetoIcons.Check, {
|
|
3241
|
-
className: "cursor-pointer",
|
|
3242
|
-
onClick: function onClick() {
|
|
3243
|
-
return setShowInput(function (prevState) {
|
|
3244
|
-
return !prevState;
|
|
3245
|
-
});
|
|
3246
|
-
}
|
|
3247
|
-
})
|
|
3248
|
-
}) : /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
3018
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, ramda.isEmpty(allOptions) && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
3019
|
+
"data-cy": "condition-value-multi-select-create-button",
|
|
3249
3020
|
style: "h5",
|
|
3250
3021
|
weight: "semibold",
|
|
3251
|
-
className: classNames__default["default"]("neeto-ui-text-
|
|
3022
|
+
className: classNames__default["default"]("hover:neeto-ui-text-primary-800 neeto-ui-text-gray-800 mt-1 cursor-pointer underline", {
|
|
3252
3023
|
"neeto-ui-text-error-500": isValid
|
|
3253
3024
|
}),
|
|
3254
3025
|
onClick: function onClick() {
|
|
3255
|
-
|
|
3026
|
+
setTouched(ramda.assocPath(["conditions", "value", index], true, touched));
|
|
3027
|
+
setShowPane(function (prevState) {
|
|
3256
3028
|
return !prevState;
|
|
3257
3029
|
});
|
|
3258
3030
|
}
|
|
3259
|
-
},
|
|
3031
|
+
}, defaultLabel), allOptions.map(function (option, idx) {
|
|
3032
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
3033
|
+
key: idx
|
|
3034
|
+
}, !!idx && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
3035
|
+
className: "neeto-ui-text-gray-700 mt-1",
|
|
3036
|
+
style: "h5",
|
|
3037
|
+
weight: "normal"
|
|
3038
|
+
}, i18next.t("neetoRules.common.or")), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
3039
|
+
className: "hover:neeto-ui-text-primary-800 neeto-ui-text-gray-800 mt-1 cursor-pointer underline",
|
|
3040
|
+
"data-cy": "condition-value-multi-select-create-button",
|
|
3041
|
+
style: "h5",
|
|
3042
|
+
weight: "semibold",
|
|
3043
|
+
onClick: function onClick() {
|
|
3044
|
+
return setShowPane(function (prevState) {
|
|
3045
|
+
return !prevState;
|
|
3046
|
+
});
|
|
3047
|
+
}
|
|
3048
|
+
}, option.label));
|
|
3049
|
+
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane, {
|
|
3050
|
+
initialFocusRef: initialFocusRef,
|
|
3051
|
+
isOpen: showPane,
|
|
3052
|
+
size: "large",
|
|
3053
|
+
onClose: function onClose() {
|
|
3054
|
+
return setShowPane(false);
|
|
3055
|
+
}
|
|
3056
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Header, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
3057
|
+
className: "neeto-ui-text-gray-700",
|
|
3058
|
+
"data-cy": "multi-select-create-pane-header-title",
|
|
3059
|
+
style: "h3"
|
|
3060
|
+
}, i18next.t("neetoRules.labels.multipleValues"))), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Body, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Select, _extends({
|
|
3061
|
+
isMulti: true,
|
|
3062
|
+
className: "mt-4 w-full",
|
|
3063
|
+
"data-cy": "multi-select-create-container",
|
|
3064
|
+
defaultValue: allOptions,
|
|
3065
|
+
innerRef: initialFocusRef,
|
|
3066
|
+
label: i18next.t("neetoRules.labels.selectValues"),
|
|
3067
|
+
onChange: function onChange(options) {
|
|
3068
|
+
return setFieldValue(name, options.map(function (option) {
|
|
3069
|
+
return option.value;
|
|
3070
|
+
}));
|
|
3071
|
+
}
|
|
3072
|
+
}, props))), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Footer, {
|
|
3073
|
+
className: "flex items-center space-x-2"
|
|
3074
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
3075
|
+
"data-cy": "save-changes-button",
|
|
3076
|
+
label: i18next.t("neetoRules.common.saveChange"),
|
|
3077
|
+
onClick: function onClick() {
|
|
3078
|
+
return setShowPane(false);
|
|
3079
|
+
}
|
|
3080
|
+
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
3081
|
+
label: i18next.t("neetoRules.buttons.cancel"),
|
|
3082
|
+
style: "text",
|
|
3083
|
+
onClick: function onClick() {
|
|
3084
|
+
return setShowPane(false);
|
|
3085
|
+
}
|
|
3086
|
+
}))));
|
|
3260
3087
|
};
|
|
3261
3088
|
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
var
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
}
|
|
3089
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3090
|
+
try {
|
|
3091
|
+
var info = gen[key](arg);
|
|
3092
|
+
var value = info.value;
|
|
3093
|
+
} catch (error) {
|
|
3094
|
+
reject(error);
|
|
3095
|
+
return;
|
|
3096
|
+
}
|
|
3097
|
+
if (info.done) {
|
|
3098
|
+
resolve(value);
|
|
3099
|
+
} else {
|
|
3100
|
+
Promise.resolve(value).then(_next, _throw);
|
|
3101
|
+
}
|
|
3102
|
+
}
|
|
3103
|
+
function _asyncToGenerator(fn) {
|
|
3104
|
+
return function () {
|
|
3105
|
+
var self = this,
|
|
3106
|
+
args = arguments;
|
|
3107
|
+
return new Promise(function (resolve, reject) {
|
|
3108
|
+
var gen = fn.apply(self, args);
|
|
3109
|
+
function _next(value) {
|
|
3110
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
3111
|
+
}
|
|
3112
|
+
function _throw(err) {
|
|
3113
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
3114
|
+
}
|
|
3115
|
+
_next(undefined);
|
|
3116
|
+
});
|
|
3117
|
+
};
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
var regeneratorRuntime$1 = {exports: {}};
|
|
3121
|
+
|
|
3122
|
+
var _typeof = {exports: {}};
|
|
3123
|
+
|
|
3124
|
+
_typeof.exports;
|
|
3125
|
+
|
|
3126
|
+
(function (module) {
|
|
3127
|
+
function _typeof(obj) {
|
|
3128
|
+
"@babel/helpers - typeof";
|
|
3129
|
+
|
|
3130
|
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
3131
|
+
return typeof obj;
|
|
3132
|
+
} : function (obj) {
|
|
3133
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
3134
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
|
3135
|
+
}
|
|
3136
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3137
|
+
} (_typeof));
|
|
3138
|
+
|
|
3139
|
+
var _typeofExports = _typeof.exports;
|
|
3140
|
+
|
|
3141
|
+
regeneratorRuntime$1.exports;
|
|
3142
|
+
|
|
3143
|
+
(function (module) {
|
|
3144
|
+
var _typeof = _typeofExports["default"];
|
|
3145
|
+
function _regeneratorRuntime() {
|
|
3146
|
+
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
3147
|
+
return exports;
|
|
3148
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3149
|
+
var exports = {},
|
|
3150
|
+
Op = Object.prototype,
|
|
3151
|
+
hasOwn = Op.hasOwnProperty,
|
|
3152
|
+
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
|
3153
|
+
obj[key] = desc.value;
|
|
3154
|
+
},
|
|
3155
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
3156
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
3157
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
3158
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
3159
|
+
function define(obj, key, value) {
|
|
3160
|
+
return Object.defineProperty(obj, key, {
|
|
3161
|
+
value: value,
|
|
3162
|
+
enumerable: !0,
|
|
3163
|
+
configurable: !0,
|
|
3164
|
+
writable: !0
|
|
3165
|
+
}), obj[key];
|
|
3166
|
+
}
|
|
3167
|
+
try {
|
|
3168
|
+
define({}, "");
|
|
3169
|
+
} catch (err) {
|
|
3170
|
+
define = function define(obj, key, value) {
|
|
3171
|
+
return obj[key] = value;
|
|
3172
|
+
};
|
|
3173
|
+
}
|
|
3174
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
3175
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
3176
|
+
generator = Object.create(protoGenerator.prototype),
|
|
3177
|
+
context = new Context(tryLocsList || []);
|
|
3178
|
+
return defineProperty(generator, "_invoke", {
|
|
3179
|
+
value: makeInvokeMethod(innerFn, self, context)
|
|
3180
|
+
}), generator;
|
|
3181
|
+
}
|
|
3182
|
+
function tryCatch(fn, obj, arg) {
|
|
3183
|
+
try {
|
|
3184
|
+
return {
|
|
3185
|
+
type: "normal",
|
|
3186
|
+
arg: fn.call(obj, arg)
|
|
3187
|
+
};
|
|
3188
|
+
} catch (err) {
|
|
3189
|
+
return {
|
|
3190
|
+
type: "throw",
|
|
3191
|
+
arg: err
|
|
3192
|
+
};
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
exports.wrap = wrap;
|
|
3196
|
+
var ContinueSentinel = {};
|
|
3197
|
+
function Generator() {}
|
|
3198
|
+
function GeneratorFunction() {}
|
|
3199
|
+
function GeneratorFunctionPrototype() {}
|
|
3200
|
+
var IteratorPrototype = {};
|
|
3201
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
3202
|
+
return this;
|
|
3203
|
+
});
|
|
3204
|
+
var getProto = Object.getPrototypeOf,
|
|
3205
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
3206
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
3207
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
3208
|
+
function defineIteratorMethods(prototype) {
|
|
3209
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
3210
|
+
define(prototype, method, function (arg) {
|
|
3211
|
+
return this._invoke(method, arg);
|
|
3212
|
+
});
|
|
3213
|
+
});
|
|
3214
|
+
}
|
|
3215
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
3216
|
+
function invoke(method, arg, resolve, reject) {
|
|
3217
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
3218
|
+
if ("throw" !== record.type) {
|
|
3219
|
+
var result = record.arg,
|
|
3220
|
+
value = result.value;
|
|
3221
|
+
return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
3222
|
+
invoke("next", value, resolve, reject);
|
|
3223
|
+
}, function (err) {
|
|
3224
|
+
invoke("throw", err, resolve, reject);
|
|
3225
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
3226
|
+
result.value = unwrapped, resolve(result);
|
|
3227
|
+
}, function (error) {
|
|
3228
|
+
return invoke("throw", error, resolve, reject);
|
|
3229
|
+
});
|
|
3230
|
+
}
|
|
3231
|
+
reject(record.arg);
|
|
3232
|
+
}
|
|
3233
|
+
var previousPromise;
|
|
3234
|
+
defineProperty(this, "_invoke", {
|
|
3235
|
+
value: function value(method, arg) {
|
|
3236
|
+
function callInvokeWithMethodAndArg() {
|
|
3237
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
3238
|
+
invoke(method, arg, resolve, reject);
|
|
3239
|
+
});
|
|
3240
|
+
}
|
|
3241
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
3242
|
+
}
|
|
3243
|
+
});
|
|
3244
|
+
}
|
|
3245
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
3246
|
+
var state = "suspendedStart";
|
|
3247
|
+
return function (method, arg) {
|
|
3248
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
3249
|
+
if ("completed" === state) {
|
|
3250
|
+
if ("throw" === method) throw arg;
|
|
3251
|
+
return doneResult();
|
|
3252
|
+
}
|
|
3253
|
+
for (context.method = method, context.arg = arg;;) {
|
|
3254
|
+
var delegate = context.delegate;
|
|
3255
|
+
if (delegate) {
|
|
3256
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
3257
|
+
if (delegateResult) {
|
|
3258
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
3259
|
+
return delegateResult;
|
|
3260
|
+
}
|
|
3261
|
+
}
|
|
3262
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
3263
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
3264
|
+
context.dispatchException(context.arg);
|
|
3265
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
3266
|
+
state = "executing";
|
|
3267
|
+
var record = tryCatch(innerFn, self, context);
|
|
3268
|
+
if ("normal" === record.type) {
|
|
3269
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
3270
|
+
return {
|
|
3271
|
+
value: record.arg,
|
|
3272
|
+
done: context.done
|
|
3273
|
+
};
|
|
3274
|
+
}
|
|
3275
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
3276
|
+
}
|
|
3277
|
+
};
|
|
3278
|
+
}
|
|
3279
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
3280
|
+
var methodName = context.method,
|
|
3281
|
+
method = delegate.iterator[methodName];
|
|
3282
|
+
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
3283
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
3284
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
3285
|
+
var info = record.arg;
|
|
3286
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
3287
|
+
}
|
|
3288
|
+
function pushTryEntry(locs) {
|
|
3289
|
+
var entry = {
|
|
3290
|
+
tryLoc: locs[0]
|
|
3291
|
+
};
|
|
3292
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
3293
|
+
}
|
|
3294
|
+
function resetTryEntry(entry) {
|
|
3295
|
+
var record = entry.completion || {};
|
|
3296
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
3297
|
+
}
|
|
3298
|
+
function Context(tryLocsList) {
|
|
3299
|
+
this.tryEntries = [{
|
|
3300
|
+
tryLoc: "root"
|
|
3301
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
3302
|
+
}
|
|
3303
|
+
function values(iterable) {
|
|
3304
|
+
if (iterable) {
|
|
3305
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
3306
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
3307
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
3308
|
+
if (!isNaN(iterable.length)) {
|
|
3309
|
+
var i = -1,
|
|
3310
|
+
next = function next() {
|
|
3311
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
3312
|
+
return next.value = undefined, next.done = !0, next;
|
|
3313
|
+
};
|
|
3314
|
+
return next.next = next;
|
|
3315
|
+
}
|
|
3316
|
+
}
|
|
3317
|
+
return {
|
|
3318
|
+
next: doneResult
|
|
3319
|
+
};
|
|
3320
|
+
}
|
|
3321
|
+
function doneResult() {
|
|
3322
|
+
return {
|
|
3323
|
+
value: undefined,
|
|
3324
|
+
done: !0
|
|
3325
|
+
};
|
|
3326
|
+
}
|
|
3327
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
3328
|
+
value: GeneratorFunctionPrototype,
|
|
3329
|
+
configurable: !0
|
|
3330
|
+
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
3331
|
+
value: GeneratorFunction,
|
|
3332
|
+
configurable: !0
|
|
3333
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
3334
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
3335
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
3336
|
+
}, exports.mark = function (genFun) {
|
|
3337
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
3338
|
+
}, exports.awrap = function (arg) {
|
|
3339
|
+
return {
|
|
3340
|
+
__await: arg
|
|
3341
|
+
};
|
|
3342
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
3343
|
+
return this;
|
|
3344
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
3345
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
3346
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
3347
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
3348
|
+
return result.done ? result.value : iter.next();
|
|
3349
|
+
});
|
|
3350
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
3351
|
+
return this;
|
|
3352
|
+
}), define(Gp, "toString", function () {
|
|
3353
|
+
return "[object Generator]";
|
|
3354
|
+
}), exports.keys = function (val) {
|
|
3355
|
+
var object = Object(val),
|
|
3356
|
+
keys = [];
|
|
3357
|
+
for (var key in object) keys.push(key);
|
|
3358
|
+
return keys.reverse(), function next() {
|
|
3359
|
+
for (; keys.length;) {
|
|
3360
|
+
var key = keys.pop();
|
|
3361
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
3362
|
+
}
|
|
3363
|
+
return next.done = !0, next;
|
|
3364
|
+
};
|
|
3365
|
+
}, exports.values = values, Context.prototype = {
|
|
3366
|
+
constructor: Context,
|
|
3367
|
+
reset: function reset(skipTempReset) {
|
|
3368
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
3369
|
+
},
|
|
3370
|
+
stop: function stop() {
|
|
3371
|
+
this.done = !0;
|
|
3372
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
3373
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
3374
|
+
return this.rval;
|
|
3375
|
+
},
|
|
3376
|
+
dispatchException: function dispatchException(exception) {
|
|
3377
|
+
if (this.done) throw exception;
|
|
3378
|
+
var context = this;
|
|
3379
|
+
function handle(loc, caught) {
|
|
3380
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
3381
|
+
}
|
|
3382
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
3383
|
+
var entry = this.tryEntries[i],
|
|
3384
|
+
record = entry.completion;
|
|
3385
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
3386
|
+
if (entry.tryLoc <= this.prev) {
|
|
3387
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
3388
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
3389
|
+
if (hasCatch && hasFinally) {
|
|
3390
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
3391
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
3392
|
+
} else if (hasCatch) {
|
|
3393
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
3394
|
+
} else {
|
|
3395
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
3396
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
3397
|
+
}
|
|
3398
|
+
}
|
|
3399
|
+
}
|
|
3400
|
+
},
|
|
3401
|
+
abrupt: function abrupt(type, arg) {
|
|
3402
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
3403
|
+
var entry = this.tryEntries[i];
|
|
3404
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
3405
|
+
var finallyEntry = entry;
|
|
3406
|
+
break;
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3409
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
3410
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
3411
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
3412
|
+
},
|
|
3413
|
+
complete: function complete(record, afterLoc) {
|
|
3414
|
+
if ("throw" === record.type) throw record.arg;
|
|
3415
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
3416
|
+
},
|
|
3417
|
+
finish: function finish(finallyLoc) {
|
|
3418
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
3419
|
+
var entry = this.tryEntries[i];
|
|
3420
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
3421
|
+
}
|
|
3422
|
+
},
|
|
3423
|
+
"catch": function _catch(tryLoc) {
|
|
3424
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
3425
|
+
var entry = this.tryEntries[i];
|
|
3426
|
+
if (entry.tryLoc === tryLoc) {
|
|
3427
|
+
var record = entry.completion;
|
|
3428
|
+
if ("throw" === record.type) {
|
|
3429
|
+
var thrown = record.arg;
|
|
3430
|
+
resetTryEntry(entry);
|
|
3431
|
+
}
|
|
3432
|
+
return thrown;
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3435
|
+
throw new Error("illegal catch attempt");
|
|
3436
|
+
},
|
|
3437
|
+
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
3438
|
+
return this.delegate = {
|
|
3439
|
+
iterator: values(iterable),
|
|
3440
|
+
resultName: resultName,
|
|
3441
|
+
nextLoc: nextLoc
|
|
3442
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
3443
|
+
}
|
|
3444
|
+
}, exports;
|
|
3445
|
+
}
|
|
3446
|
+
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3447
|
+
} (regeneratorRuntime$1));
|
|
3448
|
+
|
|
3449
|
+
var regeneratorRuntimeExports = regeneratorRuntime$1.exports;
|
|
3371
3450
|
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
useOnButtonPressed(initialFocusRef, function () {
|
|
3390
|
-
return setShowPane(false);
|
|
3391
|
-
});
|
|
3392
|
-
var values = (_conditions$value$ind = conditions.value[index]) === null || _conditions$value$ind === void 0 || (_conditions$value$ind = _conditions$value$ind.metadata) === null || _conditions$value$ind === void 0 ? void 0 : _conditions$value$ind.values;
|
|
3393
|
-
var allOptions = getAllOptions(values);
|
|
3394
|
-
var defaultLabel = i18next.t("neetoRules.form.selectValues");
|
|
3395
|
-
var isValid = errors.conditions && ramda.isNotNil((_errors$conditions = errors.conditions) === null || _errors$conditions === void 0 || (_errors$conditions = _errors$conditions.value) === null || _errors$conditions === void 0 ? void 0 : _errors$conditions[index]) && ramda.isNotNil((_touched$conditions = touched.conditions) === null || _touched$conditions === void 0 || (_touched$conditions = _touched$conditions.value) === null || _touched$conditions === void 0 ? void 0 : _touched$conditions[index]);
|
|
3396
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, ramda.isEmpty(allOptions) && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
3397
|
-
"data-cy": "condition-value-multi-select-create-button",
|
|
3398
|
-
style: "h5",
|
|
3399
|
-
weight: "semibold",
|
|
3400
|
-
className: classNames__default["default"]("hover:neeto-ui-text-primary-800 neeto-ui-text-gray-800 mt-1 cursor-pointer underline", {
|
|
3401
|
-
"neeto-ui-text-error-500": isValid
|
|
3402
|
-
}),
|
|
3403
|
-
onClick: function onClick() {
|
|
3404
|
-
setTouched(ramda.assocPath(["conditions", "value", index], true, touched));
|
|
3405
|
-
setShowPane(function (prevState) {
|
|
3406
|
-
return !prevState;
|
|
3407
|
-
});
|
|
3408
|
-
}
|
|
3409
|
-
}, defaultLabel), allOptions.map(function (option, idx) {
|
|
3410
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
3411
|
-
key: idx
|
|
3412
|
-
}, !!idx && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
3413
|
-
className: "neeto-ui-text-gray-700 mt-1",
|
|
3414
|
-
style: "h5",
|
|
3415
|
-
weight: "normal"
|
|
3416
|
-
}, i18next.t("neetoRules.common.or")), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
3417
|
-
className: "hover:neeto-ui-text-primary-800 neeto-ui-text-gray-800 mt-1 cursor-pointer underline",
|
|
3418
|
-
"data-cy": "condition-value-multi-select-create-button",
|
|
3419
|
-
style: "h5",
|
|
3420
|
-
weight: "semibold",
|
|
3421
|
-
onClick: function onClick() {
|
|
3422
|
-
return setShowPane(function (prevState) {
|
|
3423
|
-
return !prevState;
|
|
3424
|
-
});
|
|
3425
|
-
}
|
|
3426
|
-
}, option.label));
|
|
3427
|
-
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane, {
|
|
3428
|
-
initialFocusRef: initialFocusRef,
|
|
3429
|
-
isOpen: showPane,
|
|
3430
|
-
size: "large",
|
|
3431
|
-
onClose: function onClose() {
|
|
3432
|
-
return setShowPane(false);
|
|
3433
|
-
}
|
|
3434
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Header, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
3435
|
-
className: "neeto-ui-text-gray-700",
|
|
3436
|
-
"data-cy": "multi-select-create-pane-header-title",
|
|
3437
|
-
style: "h3"
|
|
3438
|
-
}, i18next.t("neetoRules.labels.multipleValues"))), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Body, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Select, _extends({
|
|
3439
|
-
isMulti: true,
|
|
3440
|
-
className: "mt-4 w-full",
|
|
3441
|
-
"data-cy": "multi-select-create-container",
|
|
3442
|
-
defaultValue: allOptions,
|
|
3443
|
-
innerRef: initialFocusRef,
|
|
3444
|
-
label: i18next.t("neetoRules.labels.selectValues"),
|
|
3445
|
-
onChange: function onChange(options) {
|
|
3446
|
-
return setFieldValue(name, options.map(function (option) {
|
|
3447
|
-
return option.value;
|
|
3448
|
-
}));
|
|
3449
|
-
}
|
|
3450
|
-
}, props))), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Footer, {
|
|
3451
|
-
className: "flex items-center space-x-2"
|
|
3452
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
3453
|
-
"data-cy": "save-changes-button",
|
|
3454
|
-
label: i18next.t("neetoRules.common.saveChange"),
|
|
3455
|
-
onClick: function onClick() {
|
|
3456
|
-
return setShowPane(false);
|
|
3457
|
-
}
|
|
3458
|
-
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
3459
|
-
label: i18next.t("neetoRules.buttons.cancel"),
|
|
3460
|
-
style: "text",
|
|
3461
|
-
onClick: function onClick() {
|
|
3462
|
-
return setShowPane(false);
|
|
3463
|
-
}
|
|
3464
|
-
}))));
|
|
3465
|
-
};
|
|
3451
|
+
// TODO(Babel 8): Remove this file.
|
|
3452
|
+
|
|
3453
|
+
var runtime = regeneratorRuntimeExports();
|
|
3454
|
+
var regenerator = runtime;
|
|
3455
|
+
|
|
3456
|
+
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
3457
|
+
try {
|
|
3458
|
+
regeneratorRuntime = runtime;
|
|
3459
|
+
} catch (accidentalStrictMode) {
|
|
3460
|
+
if (typeof globalThis === "object") {
|
|
3461
|
+
globalThis.regeneratorRuntime = runtime;
|
|
3462
|
+
} else {
|
|
3463
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
|
|
3466
3468
|
|
|
3467
3469
|
var DateField = function DateField(_ref) {
|
|
3468
3470
|
var _conditions$value$ind, _errors$conditions, _touched$conditions;
|
|
@@ -4711,4 +4713,5 @@ NeetoRules.EventConditions = EventConditions;
|
|
|
4711
4713
|
exports.NeetoRulesForm = NeetoRules;
|
|
4712
4714
|
exports.RulePreview = RulePreview;
|
|
4713
4715
|
exports["default"] = NeetoRules$1;
|
|
4716
|
+
exports.useCustomDataStore = useCustomDataStore;
|
|
4714
4717
|
//# sourceMappingURL=index.cjs.js.map
|