@bigbinary/neeto-filters-frontend 3.3.4 → 3.3.5
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 +895 -808
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +896 -809
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect, useMemo, useRef, useTransition } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useMemo, createElement, useRef, useTransition } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import i18next, { t as t$1 } from 'i18next';
|
|
4
4
|
import { findBy, isNotEmpty, capitalize, removeBy, toLabelAndValue, hyphenate, isNotPresent, noop, replaceBy, existsBy, _existsBy, isPresent, humanize, findById, filterBy } from '@bigbinary/neeto-cist';
|
|
@@ -21,6 +21,7 @@ import dayjs from 'dayjs';
|
|
|
21
21
|
import timezone from 'dayjs/plugin/timezone';
|
|
22
22
|
import utc from 'dayjs/plugin/utc';
|
|
23
23
|
import weekday from 'dayjs/plugin/weekday';
|
|
24
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
24
25
|
import DatePicker from '@bigbinary/neetoui/DatePicker';
|
|
25
26
|
import TimePickerInput from '@bigbinary/neetoui/TimePickerInput';
|
|
26
27
|
import Input from '@bigbinary/neetoui/Input';
|
|
@@ -111,21 +112,6 @@ function _toConsumableArray(arr) {
|
|
|
111
112
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
function _extends() {
|
|
115
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
116
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
117
|
-
var source = arguments[i];
|
|
118
|
-
for (var key in source) {
|
|
119
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
120
|
-
target[key] = source[key];
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return target;
|
|
125
|
-
};
|
|
126
|
-
return _extends.apply(this, arguments);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
115
|
function _arrayWithHoles(arr) {
|
|
130
116
|
if (Array.isArray(arr)) return arr;
|
|
131
117
|
}
|
|
@@ -329,14 +315,11 @@ var TREE_SELECT_RULES = [{
|
|
|
329
315
|
value: "is_unknown"
|
|
330
316
|
}];
|
|
331
317
|
var DEFAULT_HELP_ICON_PROPS = {
|
|
332
|
-
icon: Help
|
|
333
|
-
tooltipProps: {
|
|
334
|
-
position: "right"
|
|
335
|
-
}
|
|
318
|
+
icon: Help
|
|
336
319
|
};
|
|
337
320
|
|
|
338
|
-
function ownKeys$
|
|
339
|
-
function _objectSpread$
|
|
321
|
+
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; }
|
|
322
|
+
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; }
|
|
340
323
|
var groupByGroup = groupBy(function (_ref) {
|
|
341
324
|
var group = _ref.group;
|
|
342
325
|
return group || "individual";
|
|
@@ -664,7 +647,7 @@ var buildDatePayload = function buildDatePayload(value) {
|
|
|
664
647
|
var buildSingleDatePayload = function buildSingleDatePayload(filter) {
|
|
665
648
|
var value = filter.value;
|
|
666
649
|
var filterValue = Array.isArray(value) ? value.join(",") : value;
|
|
667
|
-
return _objectSpread$
|
|
650
|
+
return _objectSpread$e(_objectSpread$e({}, filter), {}, {
|
|
668
651
|
value: filterValue,
|
|
669
652
|
type: "date"
|
|
670
653
|
});
|
|
@@ -672,7 +655,7 @@ var buildSingleDatePayload = function buildSingleDatePayload(filter) {
|
|
|
672
655
|
var buildSingleTimePayload = function buildSingleTimePayload(filter) {
|
|
673
656
|
var value = filter.value;
|
|
674
657
|
var filterValue = Array.isArray(value) ? value.join(",") : value;
|
|
675
|
-
return _objectSpread$
|
|
658
|
+
return _objectSpread$e(_objectSpread$e({}, filter), {}, {
|
|
676
659
|
value: filterValue,
|
|
677
660
|
type: "time"
|
|
678
661
|
});
|
|
@@ -942,7 +925,7 @@ var buildFilterColumnsFromFields = function buildFilterColumnsFromFields(_ref22)
|
|
|
942
925
|
var id = field.id,
|
|
943
926
|
name = field.name,
|
|
944
927
|
kind = field.kind;
|
|
945
|
-
var column = _objectSpread$
|
|
928
|
+
var column = _objectSpread$e({
|
|
946
929
|
key: toLower(name),
|
|
947
930
|
node: "".concat(name, ":").concat(id),
|
|
948
931
|
label: capitalize(name),
|
|
@@ -966,7 +949,7 @@ var buildFilterColumnsFromFields = function buildFilterColumnsFromFields(_ref22)
|
|
|
966
949
|
};
|
|
967
950
|
var getColumnsWithStandardizedType = function getColumnsWithStandardizedType(columns) {
|
|
968
951
|
return columns.map(function (column) {
|
|
969
|
-
return _objectSpread$
|
|
952
|
+
return _objectSpread$e(_objectSpread$e({}, column), {}, {
|
|
970
953
|
type: standardizeColumnType(column.type)
|
|
971
954
|
});
|
|
972
955
|
});
|
|
@@ -1098,6 +1081,8 @@ var isRuleEmpty = function isRuleEmpty(rule) {
|
|
|
1098
1081
|
return equals(rule, "is_unknown");
|
|
1099
1082
|
};
|
|
1100
1083
|
|
|
1084
|
+
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; }
|
|
1085
|
+
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; }
|
|
1101
1086
|
var Boolean = function Boolean(_ref) {
|
|
1102
1087
|
var column = _ref.column,
|
|
1103
1088
|
filter = _ref.filter,
|
|
@@ -1133,29 +1118,32 @@ var Boolean = function Boolean(_ref) {
|
|
|
1133
1118
|
});
|
|
1134
1119
|
handleApplyFilter(updatedFilter);
|
|
1135
1120
|
};
|
|
1136
|
-
return /*#__PURE__*/
|
|
1137
|
-
className: "neeto-filters-pane-filter__item-wrapper"
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1121
|
+
return /*#__PURE__*/jsx("div", {
|
|
1122
|
+
className: "neeto-filters-pane-filter__item-wrapper",
|
|
1123
|
+
children: /*#__PURE__*/jsx(Select, _objectSpread$d(_objectSpread$d({
|
|
1124
|
+
autoFocus: autoFocus,
|
|
1125
|
+
label: label,
|
|
1126
|
+
options: options,
|
|
1127
|
+
value: value,
|
|
1128
|
+
isClearable: true
|
|
1129
|
+
}, isNotEmpty(helpIconProps) && {
|
|
1130
|
+
labelProps: {
|
|
1131
|
+
helpIconProps: buildHelpIconProps(helpIconProps)
|
|
1132
|
+
}
|
|
1133
|
+
}), {}, {
|
|
1134
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-filter"),
|
|
1135
|
+
strategy: "fixed",
|
|
1136
|
+
placeholder: t("neetoFilters.messages.selectOption", {
|
|
1137
|
+
resource: label
|
|
1138
|
+
}),
|
|
1139
|
+
onChange: handleChange
|
|
1140
|
+
}, otherProps))
|
|
1141
|
+
});
|
|
1156
1142
|
};
|
|
1157
1143
|
var Boolean$1 = /*#__PURE__*/React.memo(Boolean);
|
|
1158
1144
|
|
|
1145
|
+
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; }
|
|
1146
|
+
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; }
|
|
1159
1147
|
var Datetime = function Datetime(_ref) {
|
|
1160
1148
|
var column = _ref.column,
|
|
1161
1149
|
filter = _ref.filter,
|
|
@@ -1213,35 +1201,38 @@ var Datetime = function Datetime(_ref) {
|
|
|
1213
1201
|
useEffect(function () {
|
|
1214
1202
|
isNil(filter) && setSelectedRule({});
|
|
1215
1203
|
}, [filter]);
|
|
1216
|
-
return /*#__PURE__*/
|
|
1217
|
-
className: "neeto-filters-pane-filter__item-wrapper"
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1204
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1205
|
+
className: "neeto-filters-pane-filter__item-wrapper",
|
|
1206
|
+
children: [/*#__PURE__*/jsx(Select, _objectSpread$c(_objectSpread$c({
|
|
1207
|
+
autoFocus: autoFocus,
|
|
1208
|
+
label: label,
|
|
1209
|
+
isClearable: true,
|
|
1210
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-filter"),
|
|
1211
|
+
options: DATE_OPTIONS,
|
|
1212
|
+
strategy: "fixed",
|
|
1213
|
+
value: selectedRule,
|
|
1214
|
+
placeholder: t("neetoFilters.messages.selectResource", {
|
|
1215
|
+
resource: label
|
|
1216
|
+
})
|
|
1217
|
+
}, isNotEmpty(helpIconProps) && {
|
|
1218
|
+
labelProps: {
|
|
1219
|
+
helpIconProps: buildHelpIconProps(helpIconProps)
|
|
1220
|
+
}
|
|
1221
|
+
}), {}, {
|
|
1222
|
+
onChange: handleChange
|
|
1223
|
+
})), isDatePickerShown && /*#__PURE__*/jsx(DatePicker, _objectSpread$c({
|
|
1224
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-date-range"),
|
|
1225
|
+
getPopupContainer: prop("parentNode"),
|
|
1226
|
+
type: (selectedRule === null || selectedRule === void 0 ? void 0 : selectedRule.value) === "custom-date-range" ? "range" : "date",
|
|
1227
|
+
value: getDateValue(filter === null || filter === void 0 ? void 0 : filter.value, selectedRule),
|
|
1228
|
+
onChange: handleDateRangeChange
|
|
1229
|
+
}, otherProps))]
|
|
1230
|
+
});
|
|
1242
1231
|
};
|
|
1243
1232
|
var Datetime$1 = /*#__PURE__*/React.memo(Datetime);
|
|
1244
1233
|
|
|
1234
|
+
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; }
|
|
1235
|
+
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; }
|
|
1245
1236
|
var Dropdown = function Dropdown(_ref) {
|
|
1246
1237
|
var column = _ref.column,
|
|
1247
1238
|
filter = _ref.filter,
|
|
@@ -1323,36 +1314,39 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
1323
1314
|
if (!isEmpty(filters)) return;
|
|
1324
1315
|
isRuleEmpty(selectedRule.value) && setSelectedRule(dropdownRules[0]);
|
|
1325
1316
|
}, [filters]);
|
|
1326
|
-
return /*#__PURE__*/
|
|
1327
|
-
className: "neeto-filters-pane-filter__item-wrapper"
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1317
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1318
|
+
className: "neeto-filters-pane-filter__item-wrapper",
|
|
1319
|
+
children: [showRuleSelector && /*#__PURE__*/jsx(Select, {
|
|
1320
|
+
label: label,
|
|
1321
|
+
defaultValue: dropdownRules[0],
|
|
1322
|
+
options: dropdownRules,
|
|
1323
|
+
value: selectedRule,
|
|
1324
|
+
onChange: handleRuleChange
|
|
1325
|
+
}), !isRuleEmpty(selectedRule.value) && /*#__PURE__*/jsx(Select, _objectSpread$b(_objectSpread$b({
|
|
1326
|
+
autoFocus: autoFocus,
|
|
1327
|
+
options: options,
|
|
1328
|
+
value: value,
|
|
1329
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-filter"),
|
|
1330
|
+
isClearable: !defaultValue && isClearable,
|
|
1331
|
+
isMulti: isMulti(defaultType),
|
|
1332
|
+
label: !showRuleSelector && label,
|
|
1333
|
+
strategy: "fixed",
|
|
1334
|
+
placeholder: t("neetoFilters.messages.selectResource", {
|
|
1335
|
+
resource: label
|
|
1336
|
+
})
|
|
1337
|
+
}, isNotEmpty(helpIconProps) && {
|
|
1338
|
+
labelProps: {
|
|
1339
|
+
helpIconProps: buildHelpIconProps(helpIconProps)
|
|
1340
|
+
}
|
|
1341
|
+
}), {}, {
|
|
1342
|
+
onChange: handleChange
|
|
1343
|
+
}, otherProps))]
|
|
1344
|
+
});
|
|
1353
1345
|
};
|
|
1354
1346
|
var Dropdown$1 = /*#__PURE__*/React.memo(Dropdown);
|
|
1355
1347
|
|
|
1348
|
+
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; }
|
|
1349
|
+
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; }
|
|
1356
1350
|
var SingleDatetime = function SingleDatetime(_ref) {
|
|
1357
1351
|
var column = _ref.column,
|
|
1358
1352
|
filter = _ref.filter,
|
|
@@ -1418,31 +1412,34 @@ var SingleDatetime = function SingleDatetime(_ref) {
|
|
|
1418
1412
|
});
|
|
1419
1413
|
handleApplyFilter(updatedFilter);
|
|
1420
1414
|
};
|
|
1421
|
-
return /*#__PURE__*/
|
|
1422
|
-
className: "neeto-filters-pane-filter__item-wrapper"
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1415
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1416
|
+
className: "neeto-filters-pane-filter__item-wrapper",
|
|
1417
|
+
children: [/*#__PURE__*/jsx(Select, _objectSpread$a(_objectSpread$a({
|
|
1418
|
+
label: label,
|
|
1419
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-filter-rule"),
|
|
1420
|
+
defaultValue: SINGLE_DATE_OPTIONS[0],
|
|
1421
|
+
options: SINGLE_DATE_OPTIONS,
|
|
1422
|
+
strategy: "fixed",
|
|
1423
|
+
value: selectedRule
|
|
1424
|
+
}, isNotEmpty(helpIconProps) && {
|
|
1425
|
+
labelProps: {
|
|
1426
|
+
helpIconProps: buildHelpIconProps(helpIconProps)
|
|
1427
|
+
}
|
|
1428
|
+
}), {}, {
|
|
1429
|
+
onChange: handleRuleChange
|
|
1430
|
+
})), /*#__PURE__*/jsx(DatePicker, _objectSpread$a({
|
|
1431
|
+
autoFocus: autoFocus,
|
|
1432
|
+
value: value,
|
|
1433
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-filter"),
|
|
1434
|
+
getPopupContainer: prop("parentNode"),
|
|
1435
|
+
type: datePickerType,
|
|
1436
|
+
onChange: handleChange
|
|
1437
|
+
}, otherProps))]
|
|
1438
|
+
});
|
|
1444
1439
|
};
|
|
1445
1440
|
|
|
1441
|
+
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; }
|
|
1442
|
+
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; }
|
|
1446
1443
|
var SingleTime = function SingleTime(_ref) {
|
|
1447
1444
|
var column = _ref.column,
|
|
1448
1445
|
filter = _ref.filter,
|
|
@@ -1510,30 +1507,33 @@ var SingleTime = function SingleTime(_ref) {
|
|
|
1510
1507
|
handleApplyFilter(updatedFilter);
|
|
1511
1508
|
};
|
|
1512
1509
|
var formattedTime = formatTime(value, timePickerType);
|
|
1513
|
-
return /*#__PURE__*/
|
|
1514
|
-
className: "neeto-filters-pane-filter__item-wrapper"
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1510
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1511
|
+
className: "neeto-filters-pane-filter__item-wrapper",
|
|
1512
|
+
children: [/*#__PURE__*/jsx(Select, _objectSpread$9(_objectSpread$9({
|
|
1513
|
+
label: label,
|
|
1514
|
+
defaultValue: SINGLE_TIME_OPTIONS[0],
|
|
1515
|
+
options: SINGLE_TIME_OPTIONS,
|
|
1516
|
+
strategy: "fixed",
|
|
1517
|
+
value: selectedRule
|
|
1518
|
+
}, isNotEmpty(helpIconProps) && {
|
|
1519
|
+
labelProps: {
|
|
1520
|
+
helpIconProps: buildHelpIconProps(helpIconProps)
|
|
1521
|
+
}
|
|
1522
|
+
}), {}, {
|
|
1523
|
+
onChange: handleRuleChange
|
|
1524
|
+
})), /*#__PURE__*/jsx(TimePickerInput, _objectSpread$9({
|
|
1525
|
+
autoFocus: autoFocus,
|
|
1526
|
+
className: "w-full",
|
|
1527
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-filter"),
|
|
1528
|
+
type: timePickerType,
|
|
1529
|
+
value: formattedTime,
|
|
1530
|
+
onChange: handleChange
|
|
1531
|
+
}, otherProps))]
|
|
1532
|
+
});
|
|
1535
1533
|
};
|
|
1536
1534
|
|
|
1535
|
+
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; }
|
|
1536
|
+
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; }
|
|
1537
1537
|
var Text = function Text(_ref) {
|
|
1538
1538
|
var column = _ref.column,
|
|
1539
1539
|
filter = _ref.filter,
|
|
@@ -1606,41 +1606,44 @@ var Text = function Text(_ref) {
|
|
|
1606
1606
|
}
|
|
1607
1607
|
handleUpdateAndApplyFilter();
|
|
1608
1608
|
}, [debouncedInputValue]);
|
|
1609
|
-
return /*#__PURE__*/
|
|
1610
|
-
className: "neeto-filters-pane-filter__item-wrapper"
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1609
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1610
|
+
className: "neeto-filters-pane-filter__item-wrapper",
|
|
1611
|
+
children: [showRuleSelector && /*#__PURE__*/jsx(Select, _objectSpread$8({
|
|
1612
|
+
label: label,
|
|
1613
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-filter-rule"),
|
|
1614
|
+
defaultValue: ruleOptions[0],
|
|
1615
|
+
options: ruleOptions,
|
|
1616
|
+
strategy: "fixed",
|
|
1617
|
+
value: selectedRule,
|
|
1618
|
+
onChange: handleRuleChange
|
|
1619
|
+
}, isNotEmpty(helpIconProps) && {
|
|
1620
|
+
labelProps: {
|
|
1621
|
+
helpIconProps: buildHelpIconProps(helpIconProps)
|
|
1622
|
+
}
|
|
1623
|
+
})), /*#__PURE__*/jsx(Input, _objectSpread$8(_objectSpread$8({
|
|
1624
|
+
autoFocus: autoFocus,
|
|
1625
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-filter"),
|
|
1626
|
+
label: !showRuleSelector && label,
|
|
1627
|
+
type: inputType,
|
|
1628
|
+
value: inputValue
|
|
1629
|
+
}, isNotEmpty(helpIconProps) && {
|
|
1630
|
+
labelProps: {
|
|
1631
|
+
helpIconProps: buildHelpIconProps(helpIconProps)
|
|
1632
|
+
}
|
|
1633
|
+
}), {}, {
|
|
1634
|
+
placeholder: t("neetoFilters.messages.enterResource", {
|
|
1635
|
+
resource: label
|
|
1636
|
+
}),
|
|
1637
|
+
onChange: function onChange(event) {
|
|
1638
|
+
return setInputValue(event.target.value);
|
|
1639
|
+
},
|
|
1640
|
+
onKeyDown: handleKeydown
|
|
1641
|
+
}, otherProps))]
|
|
1642
|
+
});
|
|
1642
1643
|
};
|
|
1643
1644
|
|
|
1645
|
+
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; }
|
|
1646
|
+
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; }
|
|
1644
1647
|
var Time = function Time(_ref) {
|
|
1645
1648
|
var column = _ref.column,
|
|
1646
1649
|
filter = _ref.filter,
|
|
@@ -1692,35 +1695,38 @@ var Time = function Time(_ref) {
|
|
|
1692
1695
|
});
|
|
1693
1696
|
handleApplyFilter(updatedFilter);
|
|
1694
1697
|
};
|
|
1695
|
-
return /*#__PURE__*/
|
|
1696
|
-
className: "neeto-filters-pane-filter__item-wrapper"
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1698
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1699
|
+
className: "neeto-filters-pane-filter__item-wrapper",
|
|
1700
|
+
children: [/*#__PURE__*/jsx(Select, _objectSpread$7(_objectSpread$7({
|
|
1701
|
+
autoFocus: autoFocus,
|
|
1702
|
+
label: label,
|
|
1703
|
+
value: value,
|
|
1704
|
+
isClearable: true,
|
|
1705
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-filter"),
|
|
1706
|
+
options: TIME_OPTIONS,
|
|
1707
|
+
strategy: "fixed",
|
|
1708
|
+
placeholder: t("neetoFilters.messages.selectResource", {
|
|
1709
|
+
resource: label
|
|
1710
|
+
})
|
|
1711
|
+
}, isNotEmpty(helpIconProps) && {
|
|
1712
|
+
labelProps: {
|
|
1713
|
+
helpIconProps: buildHelpIconProps(helpIconProps)
|
|
1714
|
+
}
|
|
1715
|
+
}), {}, {
|
|
1716
|
+
onChange: handleChange
|
|
1717
|
+
})), isCustomTimeRangeShown && /*#__PURE__*/jsx(TimePickerInput, _objectSpread$7({
|
|
1718
|
+
className: "w-full",
|
|
1719
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-date-range"),
|
|
1720
|
+
type: "range",
|
|
1721
|
+
value: formatTime(filter.value, "range"),
|
|
1722
|
+
onChange: handleTimeRangeChange
|
|
1723
|
+
}, otherProps))]
|
|
1724
|
+
});
|
|
1721
1725
|
};
|
|
1722
1726
|
var Time$1 = /*#__PURE__*/React.memo(Time);
|
|
1723
1727
|
|
|
1728
|
+
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; }
|
|
1729
|
+
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; }
|
|
1724
1730
|
var TreeSelect = function TreeSelect(_ref) {
|
|
1725
1731
|
var _findBy;
|
|
1726
1732
|
var autoFocus = _ref.autoFocus,
|
|
@@ -1782,36 +1788,37 @@ var TreeSelect = function TreeSelect(_ref) {
|
|
|
1782
1788
|
});
|
|
1783
1789
|
return handleApplyFilter(updatedFilter);
|
|
1784
1790
|
};
|
|
1785
|
-
return /*#__PURE__*/
|
|
1786
|
-
className: "neeto-filters-pane-filter__item-wrapper"
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1791
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1792
|
+
className: "neeto-filters-pane-filter__item-wrapper",
|
|
1793
|
+
children: [showRuleSelector && /*#__PURE__*/jsx(Select, {
|
|
1794
|
+
label: label,
|
|
1795
|
+
defaultValue: TREE_SELECT_RULES[0],
|
|
1796
|
+
options: TREE_SELECT_RULES,
|
|
1797
|
+
value: selectedRule,
|
|
1798
|
+
onChange: handleRuleChange
|
|
1799
|
+
}), !isRuleEmpty(selectedRule.value) &&
|
|
1800
|
+
/*#__PURE__*/
|
|
1801
|
+
// eslint-disable-next-line @bigbinary/neeto/merge-spread-attributes
|
|
1802
|
+
jsx(NeetoUITreeSelect, _objectSpread$6(_objectSpread$6({
|
|
1803
|
+
autoFocus: autoFocus,
|
|
1804
|
+
multiple: true,
|
|
1805
|
+
showSearch: true,
|
|
1806
|
+
treeDataSimpleMode: true,
|
|
1807
|
+
allowClear: !defaultValue && isClearable,
|
|
1808
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-filter"),
|
|
1809
|
+
label: !showRuleSelector && label,
|
|
1810
|
+
treeData: options,
|
|
1811
|
+
value: selectedOption,
|
|
1812
|
+
placeholder: t("neetoFilters.messages.selectResource", {
|
|
1813
|
+
resource: label
|
|
1814
|
+
}),
|
|
1815
|
+
onChange: handleChange
|
|
1816
|
+
}, isNotEmpty(helpIconProps) && {
|
|
1817
|
+
labelProps: {
|
|
1818
|
+
helpIconProps: buildHelpIconProps(helpIconProps)
|
|
1819
|
+
}
|
|
1820
|
+
}), getOtherProps(column)))]
|
|
1821
|
+
});
|
|
1815
1822
|
};
|
|
1816
1823
|
var TreeSelect$1 = /*#__PURE__*/React.memo(TreeSelect);
|
|
1817
1824
|
|
|
@@ -1838,7 +1845,7 @@ var Item = function Item(_ref) {
|
|
|
1838
1845
|
}, updatedFilter, filters));
|
|
1839
1846
|
};
|
|
1840
1847
|
if (isText(defaultType) || isDigit(defaultType)) {
|
|
1841
|
-
return /*#__PURE__*/
|
|
1848
|
+
return /*#__PURE__*/jsx(Text, {
|
|
1842
1849
|
autoFocus: autoFocus,
|
|
1843
1850
|
column: column,
|
|
1844
1851
|
filter: filter,
|
|
@@ -1848,7 +1855,7 @@ var Item = function Item(_ref) {
|
|
|
1848
1855
|
});
|
|
1849
1856
|
}
|
|
1850
1857
|
if (isDate(defaultType)) {
|
|
1851
|
-
return /*#__PURE__*/
|
|
1858
|
+
return /*#__PURE__*/jsx(Datetime$1, {
|
|
1852
1859
|
autoFocus: autoFocus,
|
|
1853
1860
|
column: column,
|
|
1854
1861
|
filter: filter,
|
|
@@ -1856,7 +1863,7 @@ var Item = function Item(_ref) {
|
|
|
1856
1863
|
});
|
|
1857
1864
|
}
|
|
1858
1865
|
if (isTime(defaultType)) {
|
|
1859
|
-
return /*#__PURE__*/
|
|
1866
|
+
return /*#__PURE__*/jsx(Time$1, {
|
|
1860
1867
|
autoFocus: autoFocus,
|
|
1861
1868
|
column: column,
|
|
1862
1869
|
filter: filter,
|
|
@@ -1864,7 +1871,7 @@ var Item = function Item(_ref) {
|
|
|
1864
1871
|
});
|
|
1865
1872
|
}
|
|
1866
1873
|
if (isSingleDate(defaultType)) {
|
|
1867
|
-
return /*#__PURE__*/
|
|
1874
|
+
return /*#__PURE__*/jsx(SingleDatetime, {
|
|
1868
1875
|
autoFocus: autoFocus,
|
|
1869
1876
|
column: column,
|
|
1870
1877
|
filter: filter,
|
|
@@ -1873,7 +1880,7 @@ var Item = function Item(_ref) {
|
|
|
1873
1880
|
});
|
|
1874
1881
|
}
|
|
1875
1882
|
if (isSingleTime(defaultType)) {
|
|
1876
|
-
return /*#__PURE__*/
|
|
1883
|
+
return /*#__PURE__*/jsx(SingleTime, {
|
|
1877
1884
|
autoFocus: autoFocus,
|
|
1878
1885
|
column: column,
|
|
1879
1886
|
filter: filter,
|
|
@@ -1882,7 +1889,7 @@ var Item = function Item(_ref) {
|
|
|
1882
1889
|
});
|
|
1883
1890
|
}
|
|
1884
1891
|
if (isBoolean(defaultType) || isCheckbox(defaultType)) {
|
|
1885
|
-
return /*#__PURE__*/
|
|
1892
|
+
return /*#__PURE__*/jsx(Boolean$1, {
|
|
1886
1893
|
autoFocus: autoFocus,
|
|
1887
1894
|
column: column,
|
|
1888
1895
|
filter: filter,
|
|
@@ -1890,14 +1897,14 @@ var Item = function Item(_ref) {
|
|
|
1890
1897
|
});
|
|
1891
1898
|
}
|
|
1892
1899
|
if (isTreeSelect(defaultType)) {
|
|
1893
|
-
return /*#__PURE__*/
|
|
1900
|
+
return /*#__PURE__*/jsx(TreeSelect$1, {
|
|
1894
1901
|
autoFocus: autoFocus,
|
|
1895
1902
|
column: column,
|
|
1896
1903
|
filter: filter,
|
|
1897
1904
|
handleApplyFilter: handleApplyFilter
|
|
1898
1905
|
});
|
|
1899
1906
|
}
|
|
1900
|
-
return /*#__PURE__*/
|
|
1907
|
+
return /*#__PURE__*/jsx(Dropdown$1, {
|
|
1901
1908
|
autoFocus: autoFocus,
|
|
1902
1909
|
column: column,
|
|
1903
1910
|
filter: filter,
|
|
@@ -1936,58 +1943,63 @@ var AddFilter = function AddFilter(_ref) {
|
|
|
1936
1943
|
var disableAddButton = selectedColumn.step !== STEPS.ADD && isNotPresent((_findBy = findBy({
|
|
1937
1944
|
key: selectedColumn.column.key
|
|
1938
1945
|
}, filters)) === null || _findBy === void 0 ? void 0 : _findBy.value) || isEmpty(columns);
|
|
1939
|
-
return /*#__PURE__*/
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1946
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
1947
|
+
children: selectedColumn.step !== STEPS.ADD ? /*#__PURE__*/jsxs(Fragment, {
|
|
1948
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1949
|
+
className: "flex w-full gap-4",
|
|
1950
|
+
children: [selectedColumn.step === STEPS.COLUMN && /*#__PURE__*/jsx(Select, {
|
|
1951
|
+
isSearchable: true,
|
|
1952
|
+
label: t("neetoFilters.segments.newFilter"),
|
|
1953
|
+
optionRemapping: {
|
|
1954
|
+
label: "label",
|
|
1955
|
+
value: "key"
|
|
1956
|
+
},
|
|
1957
|
+
options: columns,
|
|
1958
|
+
placeholder: t("neetoFilters.segments.selectFilter"),
|
|
1959
|
+
onChange: function onChange(column) {
|
|
1960
|
+
return setSelectedColumn({
|
|
1961
|
+
step: STEPS.VALUE,
|
|
1962
|
+
column: column
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1965
|
+
}), selectedColumn.step === STEPS.VALUE && /*#__PURE__*/jsx(Item, {
|
|
1966
|
+
filters: filters,
|
|
1967
|
+
autoFocus: true,
|
|
1968
|
+
column: selectedColumn.column,
|
|
1969
|
+
onChange: handleChange
|
|
1970
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
1971
|
+
className: "mt-6 self-center",
|
|
1972
|
+
icon: Delete$1,
|
|
1973
|
+
style: "text",
|
|
1974
|
+
onClick: function onClick() {
|
|
1975
|
+
handleClearFilter(selectedColumn.column);
|
|
1976
|
+
setSelectedColumn(assoc("step", STEPS.ADD));
|
|
1977
|
+
}
|
|
1978
|
+
})]
|
|
1979
|
+
}), /*#__PURE__*/jsx(AddFilter, {
|
|
1980
|
+
filters: filters,
|
|
1981
|
+
handleChange: handleChange,
|
|
1982
|
+
handleClearFilter: handleClearFilter,
|
|
1983
|
+
columns: columns.filter(function (_ref2) {
|
|
1984
|
+
var key = _ref2.key;
|
|
1985
|
+
return !existsBy({
|
|
1986
|
+
key: key
|
|
1987
|
+
}, filters);
|
|
1988
|
+
}),
|
|
1989
|
+
disabled: disableAddButton
|
|
1990
|
+
})]
|
|
1991
|
+
}) : /*#__PURE__*/jsx(Button, {
|
|
1992
|
+
disabled: disabled,
|
|
1993
|
+
className: "self-start",
|
|
1994
|
+
icon: Plus,
|
|
1995
|
+
iconPosition: "left",
|
|
1996
|
+
label: t("neetoFilters.segments.addFilter"),
|
|
1997
|
+
style: "link",
|
|
1998
|
+
onClick: function onClick() {
|
|
1999
|
+
return setSelectedColumn(assoc("step", STEPS.COLUMN));
|
|
2000
|
+
}
|
|
2001
|
+
})
|
|
2002
|
+
});
|
|
1991
2003
|
};
|
|
1992
2004
|
|
|
1993
2005
|
var buildSegmentsValidationSchema = function buildSegmentsValidationSchema(defaultSegmentName) {
|
|
@@ -2002,8 +2014,8 @@ var buildSegmentsValidationSchema = function buildSegmentsValidationSchema(defau
|
|
|
2002
2014
|
});
|
|
2003
2015
|
};
|
|
2004
2016
|
|
|
2005
|
-
function ownKeys$
|
|
2006
|
-
function _objectSpread$
|
|
2017
|
+
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; }
|
|
2018
|
+
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; }
|
|
2007
2019
|
var SegmentForm = function SegmentForm(_ref) {
|
|
2008
2020
|
var _ref$isEdit = _ref.isEdit,
|
|
2009
2021
|
isEdit = _ref$isEdit === void 0 ? false : _ref$isEdit,
|
|
@@ -2031,7 +2043,7 @@ var SegmentForm = function SegmentForm(_ref) {
|
|
|
2031
2043
|
ungroupedColumns = _buildFilteredColumns3 === void 0 ? [] : _buildFilteredColumns3;
|
|
2032
2044
|
var handleChange = function handleChange(newFilters) {
|
|
2033
2045
|
var isClearAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
2034
|
-
var params = buildUrlFromFilters(_objectSpread$
|
|
2046
|
+
var params = buildUrlFromFilters(_objectSpread$5({
|
|
2035
2047
|
columns: columns,
|
|
2036
2048
|
filters: newFilters
|
|
2037
2049
|
}, isClearAll && {
|
|
@@ -2054,113 +2066,129 @@ var SegmentForm = function SegmentForm(_ref) {
|
|
|
2054
2066
|
setFieldValue("filters", formState);
|
|
2055
2067
|
handleChange(globalState);
|
|
2056
2068
|
};
|
|
2057
|
-
return /*#__PURE__*/
|
|
2069
|
+
return /*#__PURE__*/jsxs(Pane$1, {
|
|
2058
2070
|
isOpen: isOpen,
|
|
2059
2071
|
onClose: onClose,
|
|
2060
|
-
initialFocusRef: segmentFormInitialRef
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
values = _ref2.values,
|
|
2079
|
-
setFieldValue = _ref2.setFieldValue;
|
|
2080
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pane$1.Body, null, /*#__PURE__*/React.createElement(Input$1, {
|
|
2081
|
-
className: "w-full flex-grow-0",
|
|
2082
|
-
error: errors.name,
|
|
2083
|
-
label: t("neetoFilters.segments.name"),
|
|
2084
|
-
name: "name",
|
|
2085
|
-
placeholder: t("neetoFilters.segments.segmentName"),
|
|
2086
|
-
ref: segmentFormInitialRef
|
|
2087
|
-
}), /*#__PURE__*/React.createElement(Typography, {
|
|
2088
|
-
className: "mb-2 mt-4",
|
|
2089
|
-
style: "h4"
|
|
2090
|
-
}, t("neetoFilters.common.filters")), /*#__PURE__*/React.createElement("div", {
|
|
2091
|
-
className: "neeto-filters-pane-filter__body flex w-full flex-col gap-5"
|
|
2092
|
-
}, ungroupedColumns.filter(function (_ref3) {
|
|
2093
|
-
var key = _ref3.key;
|
|
2094
|
-
return _existsBy({
|
|
2095
|
-
key: key
|
|
2096
|
-
}, values.filters[0].conditions);
|
|
2097
|
-
}).map(function (column) {
|
|
2098
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
2099
|
-
className: "flex w-full gap-4",
|
|
2100
|
-
key: column.key
|
|
2101
|
-
}, /*#__PURE__*/React.createElement(Item, {
|
|
2102
|
-
column: column,
|
|
2103
|
-
filters: filters,
|
|
2104
|
-
autoFocus: column.key === isOpen,
|
|
2105
|
-
onChange: function onChange(filters) {
|
|
2106
|
-
setFieldValue("filters", [{
|
|
2107
|
-
conditions: filters
|
|
2108
|
-
}]);
|
|
2109
|
-
handleChange(filters);
|
|
2110
|
-
}
|
|
2111
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
2112
|
-
className: "mt-6 self-center",
|
|
2113
|
-
icon: Delete$1,
|
|
2114
|
-
style: "text",
|
|
2115
|
-
onClick: function onClick() {
|
|
2116
|
-
return handleClearFilter(column, values, setFieldValue);
|
|
2117
|
-
}
|
|
2118
|
-
}));
|
|
2119
|
-
}), isPresent(groupedColumns) && /*#__PURE__*/React.createElement(Accordion, null, groupedColumns.map(function (_ref4) {
|
|
2120
|
-
var group = _ref4.group,
|
|
2121
|
-
columns = _ref4.columns;
|
|
2122
|
-
return /*#__PURE__*/React.createElement(Accordion.Item, {
|
|
2123
|
-
className: "accordion_item",
|
|
2124
|
-
key: group,
|
|
2125
|
-
title: group
|
|
2126
|
-
}, columns.map(function (column) {
|
|
2127
|
-
return /*#__PURE__*/React.createElement(Item, {
|
|
2128
|
-
column: column,
|
|
2129
|
-
filters: filters,
|
|
2130
|
-
autoFocus: column.key === isOpen,
|
|
2131
|
-
key: column.key,
|
|
2132
|
-
onChange: handleChange
|
|
2133
|
-
});
|
|
2134
|
-
}));
|
|
2135
|
-
})), isEmpty([].concat(_toConsumableArray(groupedColumns), _toConsumableArray(ungroupedColumns))) && /*#__PURE__*/React.createElement(Typography, {
|
|
2136
|
-
style: "body2"
|
|
2137
|
-
}, t("neetoFilters.messages.noResourcesFound", {
|
|
2138
|
-
resources: t("neetoFilters.common.columns")
|
|
2139
|
-
})), customFilters, /*#__PURE__*/React.createElement(AddFilter, {
|
|
2140
|
-
filters: filters,
|
|
2141
|
-
handleChange: handleChange,
|
|
2142
|
-
columns: ungroupedColumns.filter(function (_ref5) {
|
|
2143
|
-
var key = _ref5.key;
|
|
2144
|
-
return !existsBy({
|
|
2145
|
-
key: key
|
|
2146
|
-
}, filters);
|
|
2147
|
-
}),
|
|
2148
|
-
handleClearFilter: function handleClearFilter(_ref6) {
|
|
2149
|
-
var key = _ref6.key;
|
|
2150
|
-
return handleChange(removeBy({
|
|
2151
|
-
key: key
|
|
2152
|
-
}, filters));
|
|
2153
|
-
}
|
|
2154
|
-
}))), /*#__PURE__*/React.createElement(Pane$1.Footer, null, /*#__PURE__*/React.createElement(ActionBlock, {
|
|
2155
|
-
isSubmitting: isSubmitting,
|
|
2156
|
-
cancelButtonProps: {
|
|
2157
|
-
onClick: onClose
|
|
2072
|
+
initialFocusRef: segmentFormInitialRef,
|
|
2073
|
+
children: [/*#__PURE__*/jsx(Pane$1.Header, {
|
|
2074
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
2075
|
+
style: "h2",
|
|
2076
|
+
weight: "semibold",
|
|
2077
|
+
children: isEdit ? t("neetoFilters.segments.editSegment") : t("neetoFilters.segments.addNewSegment")
|
|
2078
|
+
})
|
|
2079
|
+
}), /*#__PURE__*/jsx(Form, {
|
|
2080
|
+
className: "w-full",
|
|
2081
|
+
formProps: {
|
|
2082
|
+
noValidate: true
|
|
2083
|
+
},
|
|
2084
|
+
formikProps: {
|
|
2085
|
+
initialValues: initialValues,
|
|
2086
|
+
validateOnChange: true,
|
|
2087
|
+
validateOnBlur: true,
|
|
2088
|
+
validationSchema: buildSegmentsValidationSchema(defaultSegmentName),
|
|
2089
|
+
onSubmit: handleSubmit
|
|
2158
2090
|
},
|
|
2159
|
-
|
|
2160
|
-
|
|
2091
|
+
children: function children(_ref2) {
|
|
2092
|
+
var errors = _ref2.errors,
|
|
2093
|
+
values = _ref2.values,
|
|
2094
|
+
setFieldValue = _ref2.setFieldValue;
|
|
2095
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
2096
|
+
children: [/*#__PURE__*/jsxs(Pane$1.Body, {
|
|
2097
|
+
children: [/*#__PURE__*/jsx(Input$1, {
|
|
2098
|
+
className: "w-full flex-grow-0",
|
|
2099
|
+
error: errors.name,
|
|
2100
|
+
label: t("neetoFilters.segments.name"),
|
|
2101
|
+
name: "name",
|
|
2102
|
+
placeholder: t("neetoFilters.segments.segmentName"),
|
|
2103
|
+
ref: segmentFormInitialRef
|
|
2104
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
2105
|
+
className: "mb-2 mt-4",
|
|
2106
|
+
style: "h4",
|
|
2107
|
+
children: t("neetoFilters.common.filters")
|
|
2108
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
2109
|
+
className: "neeto-filters-pane-filter__body flex w-full flex-col gap-5",
|
|
2110
|
+
children: [ungroupedColumns.filter(function (_ref3) {
|
|
2111
|
+
var key = _ref3.key;
|
|
2112
|
+
return _existsBy({
|
|
2113
|
+
key: key
|
|
2114
|
+
}, values.filters[0].conditions);
|
|
2115
|
+
}).map(function (column) {
|
|
2116
|
+
return /*#__PURE__*/jsxs("div", {
|
|
2117
|
+
className: "flex w-full gap-4",
|
|
2118
|
+
children: [/*#__PURE__*/jsx(Item, {
|
|
2119
|
+
column: column,
|
|
2120
|
+
filters: filters,
|
|
2121
|
+
autoFocus: column.key === isOpen,
|
|
2122
|
+
onChange: function onChange(filters) {
|
|
2123
|
+
setFieldValue("filters", [{
|
|
2124
|
+
conditions: filters
|
|
2125
|
+
}]);
|
|
2126
|
+
handleChange(filters);
|
|
2127
|
+
}
|
|
2128
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
2129
|
+
className: "mt-6 self-center",
|
|
2130
|
+
icon: Delete$1,
|
|
2131
|
+
style: "text",
|
|
2132
|
+
onClick: function onClick() {
|
|
2133
|
+
return handleClearFilter(column, values, setFieldValue);
|
|
2134
|
+
}
|
|
2135
|
+
})]
|
|
2136
|
+
}, column.key);
|
|
2137
|
+
}), isPresent(groupedColumns) && /*#__PURE__*/jsx(Accordion, {
|
|
2138
|
+
children: groupedColumns.map(function (_ref4) {
|
|
2139
|
+
var group = _ref4.group,
|
|
2140
|
+
columns = _ref4.columns;
|
|
2141
|
+
return /*#__PURE__*/jsx(Accordion.Item, {
|
|
2142
|
+
className: "accordion_item",
|
|
2143
|
+
title: group,
|
|
2144
|
+
children: columns.map(function (column) {
|
|
2145
|
+
return /*#__PURE__*/createElement(Item, {
|
|
2146
|
+
column: column,
|
|
2147
|
+
filters: filters,
|
|
2148
|
+
autoFocus: column.key === isOpen,
|
|
2149
|
+
key: column.key,
|
|
2150
|
+
onChange: handleChange
|
|
2151
|
+
});
|
|
2152
|
+
})
|
|
2153
|
+
}, group);
|
|
2154
|
+
})
|
|
2155
|
+
}), isEmpty([].concat(_toConsumableArray(groupedColumns), _toConsumableArray(ungroupedColumns))) && /*#__PURE__*/jsx(Typography, {
|
|
2156
|
+
style: "body2",
|
|
2157
|
+
children: t("neetoFilters.messages.noResourcesFound", {
|
|
2158
|
+
resources: t("neetoFilters.common.columns")
|
|
2159
|
+
})
|
|
2160
|
+
}), customFilters, /*#__PURE__*/jsx(AddFilter, {
|
|
2161
|
+
filters: filters,
|
|
2162
|
+
handleChange: handleChange,
|
|
2163
|
+
columns: ungroupedColumns.filter(function (_ref5) {
|
|
2164
|
+
var key = _ref5.key;
|
|
2165
|
+
return !existsBy({
|
|
2166
|
+
key: key
|
|
2167
|
+
}, filters);
|
|
2168
|
+
}),
|
|
2169
|
+
handleClearFilter: function handleClearFilter(_ref6) {
|
|
2170
|
+
var key = _ref6.key;
|
|
2171
|
+
return handleChange(removeBy({
|
|
2172
|
+
key: key
|
|
2173
|
+
}, filters));
|
|
2174
|
+
}
|
|
2175
|
+
})]
|
|
2176
|
+
})]
|
|
2177
|
+
}), /*#__PURE__*/jsx(Pane$1.Footer, {
|
|
2178
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
2179
|
+
isSubmitting: isSubmitting,
|
|
2180
|
+
cancelButtonProps: {
|
|
2181
|
+
onClick: onClose
|
|
2182
|
+
},
|
|
2183
|
+
submitButtonProps: {
|
|
2184
|
+
disabled: isSubmitting || isEmpty(filters)
|
|
2185
|
+
}
|
|
2186
|
+
})
|
|
2187
|
+
})]
|
|
2188
|
+
});
|
|
2161
2189
|
}
|
|
2162
|
-
})
|
|
2163
|
-
})
|
|
2190
|
+
})]
|
|
2191
|
+
});
|
|
2164
2192
|
};
|
|
2165
2193
|
|
|
2166
2194
|
var QUERY_KEYS = {
|
|
@@ -2308,40 +2336,46 @@ var Block = function Block(_ref) {
|
|
|
2308
2336
|
}, {
|
|
2309
2337
|
mode: "scoped"
|
|
2310
2338
|
});
|
|
2311
|
-
return /*#__PURE__*/
|
|
2339
|
+
return /*#__PURE__*/jsx(Tooltip, {
|
|
2312
2340
|
content: filterValue,
|
|
2313
2341
|
disabled: toolTipDisabled,
|
|
2314
2342
|
position: "bottom",
|
|
2315
|
-
theme: "light"
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2343
|
+
theme: "light",
|
|
2344
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
2345
|
+
className: "neeto-filters-bar__block",
|
|
2346
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-block"),
|
|
2347
|
+
tabIndex: 0,
|
|
2348
|
+
ref: function ref(node) {
|
|
2349
|
+
deleteBlockHotKeyRef.current = node;
|
|
2350
|
+
openFilterPaneHotKeyRef.current = node;
|
|
2351
|
+
},
|
|
2352
|
+
onClick: function onClick() {
|
|
2353
|
+
return setIsPaneOpen(key);
|
|
2354
|
+
},
|
|
2355
|
+
children: [/*#__PURE__*/jsxs(Typography, {
|
|
2356
|
+
style: "body2",
|
|
2357
|
+
children: [label, ":"]
|
|
2358
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
2359
|
+
className: "neeto-ui-text-gray-600",
|
|
2360
|
+
style: "body2",
|
|
2361
|
+
children: ruleContent
|
|
2362
|
+
}), !isRuleEmpty(rule) && /*#__PURE__*/jsx(Typography, {
|
|
2363
|
+
style: "body2",
|
|
2364
|
+
children: blockContent
|
|
2365
|
+
}), !defaultValue && /*#__PURE__*/jsx("div", {
|
|
2366
|
+
className: "neeto-filters-bar__block-close",
|
|
2367
|
+
children: /*#__PURE__*/jsx(Close, {
|
|
2368
|
+
"data-cy": "neeto-filters-".concat(hyphenate(key), "-block-close-btn"),
|
|
2369
|
+
size: 16,
|
|
2370
|
+
strokeWidth: 2,
|
|
2371
|
+
onClick: function onClick(event) {
|
|
2372
|
+
event.stopPropagation();
|
|
2373
|
+
handleDelete(key);
|
|
2374
|
+
}
|
|
2375
|
+
})
|
|
2376
|
+
})]
|
|
2377
|
+
})
|
|
2378
|
+
});
|
|
2345
2379
|
};
|
|
2346
2380
|
|
|
2347
2381
|
var ChildBlock = function ChildBlock(_ref) {
|
|
@@ -2358,7 +2392,7 @@ var ChildBlock = function ChildBlock(_ref) {
|
|
|
2358
2392
|
}, {
|
|
2359
2393
|
mode: "scoped"
|
|
2360
2394
|
});
|
|
2361
|
-
return /*#__PURE__*/
|
|
2395
|
+
return /*#__PURE__*/jsxs("div", {
|
|
2362
2396
|
className: "neeto-filters-bar__block",
|
|
2363
2397
|
"data-cy": "neeto-filters-".concat(hyphenate(childKey), "-block"),
|
|
2364
2398
|
tabIndex: 0,
|
|
@@ -2368,21 +2402,24 @@ var ChildBlock = function ChildBlock(_ref) {
|
|
|
2368
2402
|
},
|
|
2369
2403
|
onClick: function onClick() {
|
|
2370
2404
|
return setIsPaneOpen(childKey);
|
|
2371
|
-
}
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2405
|
+
},
|
|
2406
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
2407
|
+
style: "body2",
|
|
2408
|
+
weight: "medium",
|
|
2409
|
+
children: childKey
|
|
2410
|
+
}), /*#__PURE__*/jsx("div", {
|
|
2411
|
+
className: "neeto-filters-bar__block-close",
|
|
2412
|
+
children: /*#__PURE__*/jsx(Close, {
|
|
2413
|
+
"data-cy": "neeto-filters-".concat(hyphenate(childKey), "-block-close-btn"),
|
|
2414
|
+
size: 16,
|
|
2415
|
+
strokeWidth: 2,
|
|
2416
|
+
onClick: function onClick(event) {
|
|
2417
|
+
event.stopPropagation();
|
|
2418
|
+
handleDelete(childKey);
|
|
2419
|
+
}
|
|
2420
|
+
})
|
|
2421
|
+
})]
|
|
2422
|
+
});
|
|
2386
2423
|
};
|
|
2387
2424
|
|
|
2388
2425
|
var FilterBar = function FilterBar(_ref) {
|
|
@@ -2429,47 +2466,50 @@ var FilterBar = function FilterBar(_ref) {
|
|
|
2429
2466
|
isClearable = _ref2.isClearable;
|
|
2430
2467
|
return defaultValue && !isClearable;
|
|
2431
2468
|
}) && !childrenFiltersApplied;
|
|
2432
|
-
return /*#__PURE__*/
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2469
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
2470
|
+
children: [nonHiddenFilters.map(function (filter) {
|
|
2471
|
+
var _filter$suffixCompone;
|
|
2472
|
+
return /*#__PURE__*/jsxs(React.Fragment, {
|
|
2473
|
+
children: [/*#__PURE__*/jsx(Block, {
|
|
2474
|
+
filter: filter,
|
|
2475
|
+
handleDelete: handleDelete,
|
|
2476
|
+
setIsPaneOpen: setIsPaneOpen
|
|
2477
|
+
}), (_filter$suffixCompone = filter.suffixComponent) === null || _filter$suffixCompone === void 0 ? void 0 : _filter$suffixCompone.call(filter), /*#__PURE__*/jsx("div", {
|
|
2478
|
+
className: "neeto-filters-bar--separator"
|
|
2479
|
+
})]
|
|
2480
|
+
}, filter.key);
|
|
2481
|
+
}), childrenKeys.filter(function (childKey) {
|
|
2482
|
+
return has(childKey, searchParams);
|
|
2483
|
+
}).map(function (childKey) {
|
|
2484
|
+
return /*#__PURE__*/jsxs(React.Fragment, {
|
|
2485
|
+
children: [/*#__PURE__*/jsx(ChildBlock, {
|
|
2486
|
+
childKey: childKey,
|
|
2487
|
+
handleDelete: handleDelete,
|
|
2488
|
+
setIsPaneOpen: setIsPaneOpen
|
|
2489
|
+
}), /*#__PURE__*/jsx("div", {
|
|
2490
|
+
className: "neeto-filters-bar--separator"
|
|
2491
|
+
})]
|
|
2492
|
+
}, childKey);
|
|
2493
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
2494
|
+
className: "flex items-center gap-x-2",
|
|
2495
|
+
children: [isPresent(entity) && !hasOnlyKeywordFilter(filters) && /*#__PURE__*/jsx(Button, {
|
|
2496
|
+
"data-cy": "save-segment-button",
|
|
2497
|
+
label: t("neetoFilters.segments.saveAsNewSegment"),
|
|
2498
|
+
style: "secondary",
|
|
2499
|
+
onClick: function onClick() {
|
|
2500
|
+
setIsPaneOpen(false);
|
|
2501
|
+
setIsSavePaneOpen({
|
|
2502
|
+
action: SEGMENT_ACTIONS$1.CREATE
|
|
2503
|
+
});
|
|
2504
|
+
}
|
|
2505
|
+
}), !hideClearButton && /*#__PURE__*/jsx(Button, {
|
|
2506
|
+
"data-cy": "neeto-filters-bar-clear-btn",
|
|
2507
|
+
label: t("neetoFilters.common.clearFilters"),
|
|
2508
|
+
style: "text",
|
|
2509
|
+
onClick: handleClearAll
|
|
2510
|
+
})]
|
|
2511
|
+
})]
|
|
2512
|
+
});
|
|
2473
2513
|
};
|
|
2474
2514
|
|
|
2475
2515
|
var fetch = function fetch(params) {
|
|
@@ -2509,8 +2549,8 @@ var segmentsApi = {
|
|
|
2509
2549
|
destroy: destroy
|
|
2510
2550
|
};
|
|
2511
2551
|
|
|
2512
|
-
function ownKeys$
|
|
2513
|
-
function _objectSpread$
|
|
2552
|
+
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; }
|
|
2553
|
+
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; }
|
|
2514
2554
|
var SEGMENTS_LIST = QUERY_KEYS.SEGMENTS_LIST;
|
|
2515
2555
|
var useFetchSegments = function useFetchSegments(_ref) {
|
|
2516
2556
|
var entity = _ref.entity,
|
|
@@ -2528,23 +2568,23 @@ var useFetchSegments = function useFetchSegments(_ref) {
|
|
|
2528
2568
|
}, options));
|
|
2529
2569
|
};
|
|
2530
2570
|
var useCreateSegment = function useCreateSegment(options) {
|
|
2531
|
-
return useMutationWithInvalidation(segmentsApi.create, _objectSpread$
|
|
2571
|
+
return useMutationWithInvalidation(segmentsApi.create, _objectSpread$4({
|
|
2532
2572
|
keysToInvalidate: [SEGMENTS_LIST]
|
|
2533
2573
|
}, options));
|
|
2534
2574
|
};
|
|
2535
2575
|
var useUpdateSegment = function useUpdateSegment(options) {
|
|
2536
|
-
return useMutationWithInvalidation(segmentsApi.update, _objectSpread$
|
|
2576
|
+
return useMutationWithInvalidation(segmentsApi.update, _objectSpread$4({
|
|
2537
2577
|
keysToInvalidate: [SEGMENTS_LIST]
|
|
2538
2578
|
}, options));
|
|
2539
2579
|
};
|
|
2540
2580
|
var useDestroySegment = function useDestroySegment(options) {
|
|
2541
|
-
return useMutationWithInvalidation(segmentsApi.destroy, _objectSpread$
|
|
2581
|
+
return useMutationWithInvalidation(segmentsApi.destroy, _objectSpread$4({
|
|
2542
2582
|
keysToInvalidate: [SEGMENTS_LIST]
|
|
2543
2583
|
}, options));
|
|
2544
2584
|
};
|
|
2545
2585
|
|
|
2546
|
-
function ownKeys$
|
|
2547
|
-
function _objectSpread$
|
|
2586
|
+
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; }
|
|
2587
|
+
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; }
|
|
2548
2588
|
var useSegment = function useSegment(_ref) {
|
|
2549
2589
|
var entity = _ref.entity,
|
|
2550
2590
|
keyword = _ref.keyword,
|
|
@@ -2574,7 +2614,7 @@ var useSegment = function useSegment(_ref) {
|
|
|
2574
2614
|
});
|
|
2575
2615
|
var keywordValue = searchParams[SEARCH_TERM_KEY] || "";
|
|
2576
2616
|
var isEdit = isSavePaneOpen.action === SEGMENT_ACTIONS$1.EDIT;
|
|
2577
|
-
var keywordFilter = _objectSpread$
|
|
2617
|
+
var keywordFilter = _objectSpread$3(_objectSpread$3({
|
|
2578
2618
|
type: "text",
|
|
2579
2619
|
rule: "contains",
|
|
2580
2620
|
label: t("neetoFilters.common.searchTerm")
|
|
@@ -2587,7 +2627,7 @@ var useSegment = function useSegment(_ref) {
|
|
|
2587
2627
|
hidden: true
|
|
2588
2628
|
}, filters);
|
|
2589
2629
|
var handleApplyFilters = function handleApplyFilters(newFilters, isClearAll) {
|
|
2590
|
-
var params = buildUrlFromFilters(_objectSpread$
|
|
2630
|
+
var params = buildUrlFromFilters(_objectSpread$3({
|
|
2591
2631
|
columns: columns,
|
|
2592
2632
|
filters: isKeywordFilterPresent(keywordFilter) && isNotEmpty(getSearchTermFromUrl()) ? [].concat(_toConsumableArray(newFilters), [keywordFilter]) : newFilters
|
|
2593
2633
|
}, isClearAll && {
|
|
@@ -2717,41 +2757,51 @@ var SegmentBar = function SegmentBar(_ref) {
|
|
|
2717
2757
|
handleApplyFilters(newFilters);
|
|
2718
2758
|
};
|
|
2719
2759
|
var changedFilters = deepCompare(segment.filters[0].conditions, filters);
|
|
2720
|
-
return /*#__PURE__*/
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2760
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
2761
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
2762
|
+
className: "neeto-ui-text-gray-600 mr-4 px-2",
|
|
2763
|
+
"data-cy": "neeto-filters-segment-name",
|
|
2764
|
+
style: "h4",
|
|
2765
|
+
children: segment.name
|
|
2766
|
+
}), isNotEmpty(changedFilters) && /*#__PURE__*/jsxs(Fragment, {
|
|
2767
|
+
children: [/*#__PURE__*/jsx(Dropdown$2, {
|
|
2768
|
+
buttonProps: {
|
|
2769
|
+
className: "mr-2"
|
|
2770
|
+
},
|
|
2771
|
+
buttonStyle: "secondary",
|
|
2772
|
+
label: t("neetoFilters.segments.updateSegment"),
|
|
2773
|
+
children: /*#__PURE__*/jsxs(Menu, {
|
|
2774
|
+
children: [/*#__PURE__*/jsx(MenuItem.Button, {
|
|
2775
|
+
onClick: function onClick() {
|
|
2776
|
+
return setIsSavePaneOpen({
|
|
2777
|
+
action: SEGMENT_ACTIONS$1.EDIT
|
|
2778
|
+
});
|
|
2779
|
+
},
|
|
2780
|
+
children: t("neetoFilters.segments.updateSegment")
|
|
2781
|
+
}), /*#__PURE__*/jsx(MenuItem.Button, {
|
|
2782
|
+
onClick: function onClick() {
|
|
2783
|
+
setIsPaneOpen(false);
|
|
2784
|
+
setIsSavePaneOpen({
|
|
2785
|
+
action: SEGMENT_ACTIONS$1.CREATE
|
|
2786
|
+
});
|
|
2787
|
+
},
|
|
2788
|
+
children: t("neetoFilters.segments.saveAsNewSegment")
|
|
2789
|
+
})]
|
|
2790
|
+
})
|
|
2791
|
+
}), changedFilters.map(function (filter) {
|
|
2792
|
+
var _filter$suffixCompone;
|
|
2793
|
+
return /*#__PURE__*/jsxs(React.Fragment, {
|
|
2794
|
+
children: [/*#__PURE__*/jsx(Block, {
|
|
2795
|
+
filter: filter,
|
|
2796
|
+
handleDelete: handleDelete,
|
|
2797
|
+
setIsPaneOpen: setIsPaneOpen
|
|
2798
|
+
}), (_filter$suffixCompone = filter.suffixComponent) === null || _filter$suffixCompone === void 0 ? void 0 : _filter$suffixCompone.call(filter), /*#__PURE__*/jsx("div", {
|
|
2799
|
+
className: "neeto-filters-bar--separator"
|
|
2800
|
+
})]
|
|
2801
|
+
}, filter.key);
|
|
2802
|
+
})]
|
|
2803
|
+
})]
|
|
2804
|
+
});
|
|
2755
2805
|
};
|
|
2756
2806
|
|
|
2757
2807
|
var Bar = function Bar(_ref) {
|
|
@@ -2796,44 +2846,47 @@ var Bar = function Bar(_ref) {
|
|
|
2796
2846
|
var cachedSegments = queryClient.getQueryData([QUERY_KEYS.SEGMENTS_LIST, entity, ""]) || DEFAULT_SEGMENTS_CACHE;
|
|
2797
2847
|
var segment = findById(segmentId, cachedSegments.segments);
|
|
2798
2848
|
if (isEmpty(nonHiddenFilters) && !childrenFiltersApplied) return null;
|
|
2799
|
-
return /*#__PURE__*/
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
name: "",
|
|
2827
|
-
filters: [{
|
|
2849
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
2850
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
2851
|
+
className: classnames("neeto-filters-bar", _defineProperty({}, className, className)),
|
|
2852
|
+
children: /*#__PURE__*/jsx(BarComponent, {
|
|
2853
|
+
childrenFiltersApplied: childrenFiltersApplied,
|
|
2854
|
+
childrenKeys: childrenKeys,
|
|
2855
|
+
entity: entity,
|
|
2856
|
+
filters: filters,
|
|
2857
|
+
handleApplyFilters: handleApplyFilters,
|
|
2858
|
+
keywordFilter: keywordFilter,
|
|
2859
|
+
nonHiddenFilters: nonHiddenFilters,
|
|
2860
|
+
setIsPaneOpen: setIsPaneOpen,
|
|
2861
|
+
setIsSavePaneOpen: setIsSavePaneOpen
|
|
2862
|
+
})
|
|
2863
|
+
}), /*#__PURE__*/jsx(SegmentForm, {
|
|
2864
|
+
childrenKeys: childrenKeys,
|
|
2865
|
+
columns: columns,
|
|
2866
|
+
customFilters: customFilters,
|
|
2867
|
+
defaultSegmentName: defaultSegmentName,
|
|
2868
|
+
filters: filters,
|
|
2869
|
+
handleSubmit: handleSubmit,
|
|
2870
|
+
isEdit: isEdit,
|
|
2871
|
+
isSubmitting: isSubmitting,
|
|
2872
|
+
keywordFilter: keywordFilter,
|
|
2873
|
+
segmentFormInitialRef: segmentFormInitialRef,
|
|
2874
|
+
isOpen: isPresent(isSavePaneOpen.action),
|
|
2875
|
+
initialValues: isEdit ? assoc("filters", [{
|
|
2828
2876
|
conditions: filters
|
|
2829
|
-
}]
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
}
|
|
2835
|
-
|
|
2836
|
-
|
|
2877
|
+
}], segment) : {
|
|
2878
|
+
name: "",
|
|
2879
|
+
filters: [{
|
|
2880
|
+
conditions: filters
|
|
2881
|
+
}]
|
|
2882
|
+
},
|
|
2883
|
+
onClose: function onClose() {
|
|
2884
|
+
return setIsSavePaneOpen({
|
|
2885
|
+
action: undefined
|
|
2886
|
+
});
|
|
2887
|
+
}
|
|
2888
|
+
})]
|
|
2889
|
+
});
|
|
2837
2890
|
};
|
|
2838
2891
|
|
|
2839
2892
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -2942,8 +2995,8 @@ var useFilters = function useFilters(_ref) {
|
|
|
2942
2995
|
};
|
|
2943
2996
|
|
|
2944
2997
|
var _excluded = ["isOpen", "onClose", "columns", "onChange", "isSearchable", "keyword", "onSelectorsChange", "childrenKeys", "children", "className"];
|
|
2945
|
-
function ownKeys$
|
|
2946
|
-
function _objectSpread$
|
|
2998
|
+
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; }
|
|
2999
|
+
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; }
|
|
2947
3000
|
var Pane = function Pane(_ref) {
|
|
2948
3001
|
var isOpen = _ref.isOpen,
|
|
2949
3002
|
onClose = _ref.onClose,
|
|
@@ -2978,7 +3031,7 @@ var Pane = function Pane(_ref) {
|
|
|
2978
3031
|
groupedColumns = _buildFilteredColumns2 === void 0 ? [] : _buildFilteredColumns2,
|
|
2979
3032
|
_buildFilteredColumns3 = _buildFilteredColumns.ungroupedColumns,
|
|
2980
3033
|
ungroupedColumns = _buildFilteredColumns3 === void 0 ? [] : _buildFilteredColumns3;
|
|
2981
|
-
var keywordFilter = _objectSpread$
|
|
3034
|
+
var keywordFilter = _objectSpread$2(_objectSpread$2({
|
|
2982
3035
|
type: "text",
|
|
2983
3036
|
rule: "contains",
|
|
2984
3037
|
label: t("neetoFilters.common.searchTerm")
|
|
@@ -2994,7 +3047,7 @@ var Pane = function Pane(_ref) {
|
|
|
2994
3047
|
});
|
|
2995
3048
|
var handleChange = function handleChange(newFilters) {
|
|
2996
3049
|
var isClearAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
2997
|
-
var params = buildUrlFromFilters(_objectSpread$
|
|
3050
|
+
var params = buildUrlFromFilters(_objectSpread$2({
|
|
2998
3051
|
columns: columns,
|
|
2999
3052
|
filters: isKeywordFilterPresent(keywordFilter) && isNotEmpty(getSearchTermFromUrl()) ? [].concat(_toConsumableArray(newFilters), [keywordFilter]) : newFilters
|
|
3000
3053
|
}, isClearAll && {
|
|
@@ -3032,76 +3085,84 @@ var Pane = function Pane(_ref) {
|
|
|
3032
3085
|
}) && !childrenKeys.some(function (key) {
|
|
3033
3086
|
return searchParams[key];
|
|
3034
3087
|
});
|
|
3035
|
-
return /*#__PURE__*/
|
|
3088
|
+
return /*#__PURE__*/jsxs(Pane$1, _objectSpread$2(_objectSpread$2({
|
|
3036
3089
|
isOpen: isOpen,
|
|
3037
3090
|
backdropClassName: "neeto-filters-pane-backdrop",
|
|
3038
3091
|
className: classnames("neeto-filters-pane-filter", _defineProperty({}, className, className)),
|
|
3039
3092
|
onClose: handleClose
|
|
3040
|
-
}, otherProps),
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3093
|
+
}, otherProps), {}, {
|
|
3094
|
+
children: [/*#__PURE__*/jsx(Pane$1.Header, {
|
|
3095
|
+
"data-cy": "neeto-filters-pane-header",
|
|
3096
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
3097
|
+
style: "h2",
|
|
3098
|
+
weight: "semibold",
|
|
3099
|
+
children: t("neetoFilters.common.filters")
|
|
3100
|
+
})
|
|
3101
|
+
}), /*#__PURE__*/jsxs(Pane$1.Body, {
|
|
3102
|
+
className: "neeto-filters-pane-filter__body neeto-ui-pt-2",
|
|
3103
|
+
children: [isSearchable && /*#__PURE__*/jsx(Search, {
|
|
3104
|
+
"data-cy": "neeto-filters-column-search",
|
|
3105
|
+
placeholder: t("neetoFilters.messages.searchResources", {
|
|
3106
|
+
resources: t("neetoFilters.common.filters")
|
|
3107
|
+
}),
|
|
3108
|
+
onSearch: function onSearch(value) {
|
|
3109
|
+
return setSearchTerm(value);
|
|
3110
|
+
}
|
|
3111
|
+
}), ungroupedColumns.map(function (column) {
|
|
3112
|
+
return /*#__PURE__*/createElement(Item, {
|
|
3113
|
+
column: column,
|
|
3114
|
+
filters: filters,
|
|
3115
|
+
autoFocus: column.key === isOpen,
|
|
3116
|
+
key: column.key,
|
|
3117
|
+
onChange: handleChange,
|
|
3118
|
+
onClose: handleClearTermAndClose
|
|
3119
|
+
});
|
|
3120
|
+
}), isPresent(groupedColumns) && /*#__PURE__*/jsx(Accordion, {
|
|
3121
|
+
defaultActiveKey: groupedColumns.findIndex(function (_ref4) {
|
|
3122
|
+
var columns = _ref4.columns;
|
|
3123
|
+
return existsBy({
|
|
3124
|
+
key: isOpen
|
|
3125
|
+
}, columns);
|
|
3126
|
+
}),
|
|
3127
|
+
children: groupedColumns.map(function (_ref5) {
|
|
3128
|
+
var group = _ref5.group,
|
|
3129
|
+
columns = _ref5.columns;
|
|
3130
|
+
return /*#__PURE__*/jsx(Accordion.Item, {
|
|
3131
|
+
className: "accordion_item",
|
|
3132
|
+
title: group,
|
|
3133
|
+
children: columns.map(function (column) {
|
|
3134
|
+
return /*#__PURE__*/createElement(Item, {
|
|
3135
|
+
column: column,
|
|
3136
|
+
filters: filters,
|
|
3137
|
+
autoFocus: column.key === isOpen,
|
|
3138
|
+
key: column.key,
|
|
3139
|
+
onChange: handleChange,
|
|
3140
|
+
onClose: handleClearTermAndClose
|
|
3141
|
+
});
|
|
3142
|
+
})
|
|
3143
|
+
}, group);
|
|
3144
|
+
})
|
|
3145
|
+
}), isEmpty(ungroupedColumns) && isEmpty(groupedColumns) && /*#__PURE__*/jsx(Typography, {
|
|
3146
|
+
style: "body2",
|
|
3147
|
+
children: t("neetoFilters.messages.noResourcesFound", {
|
|
3148
|
+
resources: t("neetoFilters.common.columns")
|
|
3149
|
+
})
|
|
3150
|
+
}), children]
|
|
3151
|
+
}), /*#__PURE__*/jsxs(Pane$1.Footer, {
|
|
3152
|
+
className: "gap-x-2",
|
|
3153
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
3154
|
+
"data-cy": "neeto-filters-done-btn",
|
|
3155
|
+
label: t("neetoFilters.common.done"),
|
|
3156
|
+
onClick: handleClearTermAndClose
|
|
3157
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
3158
|
+
"data-cy": "neeto-filters-clear-btn",
|
|
3159
|
+
disabled: isClearFiltersDisabled,
|
|
3160
|
+
label: t("neetoFilters.common.clearFilters"),
|
|
3161
|
+
style: "text",
|
|
3162
|
+
onClick: handleClearAll
|
|
3163
|
+
})]
|
|
3164
|
+
})]
|
|
3165
|
+
}));
|
|
3105
3166
|
};
|
|
3106
3167
|
|
|
3107
3168
|
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}}
|
|
@@ -3109,8 +3170,8 @@ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r
|
|
|
3109
3170
|
var css = ".neeto-filters-bar{align-items:center;display:flex;flex-wrap:wrap}.neeto-filters-bar__block{border-radius:var(--neeto-ui-rounded);display:flex;gap:4px;margin:4px 0;max-width:384px;overflow:hidden;padding:4px 8px;position:relative;transition:var(--neeto-ui-transition);white-space:nowrap}.neeto-filters-bar__block p:first-child{color:rgb(var(--neeto-ui-gray-700))}.neeto-filters-bar__block-close{background-image:linear-gradient(90deg,rgba(var(--neeto-ui-gray-200),.5) 0,rgba(var(--neeto-ui-gray-200),1) 25%);color:rgb(var(--neeto-ui-gray-800));opacity:0;padding:8px;position:absolute;right:0;top:0;transition:var(--neeto-ui-transition)}.neeto-filters-bar__block:active,.neeto-filters-bar__block:hover{background-color:rgb(var(--neeto-ui-gray-200));cursor:pointer}.neeto-filters-bar__block:active .neeto-filters-bar__block-close,.neeto-filters-bar__block:hover .neeto-filters-bar__block-close{border-radius:var(--neeto-ui-rounded);color:rgb(var(--neeto-ui-black));opacity:1}.neeto-filters-bar__block:focus{box-shadow:0 0 0 3px rgba(var(--neeto-ui-gray-800),15%);outline:none}.neeto-filters-bar--separator{align-self:stretch;border-left:1px solid rgb(var(--neeto-ui-gray-400));margin:12px 8px}.neeto-filters-pane-filter{overflow:visible;width:360px}.neeto-filters-pane-filter__body{align-items:stretch!important;gap:20px}.neeto-filters-pane-filter__body>*{flex-grow:0!important}.neeto-filters-pane-filter__body p{text-align:center}.neeto-filters-pane-filter__body .neeto-filters-pane-filter__item-wrapper{display:flex;flex:1;flex-direction:column;gap:8px}.neeto-filters-pane-filter__body .accordion_item .neeto-filters-pane-filter__item-wrapper{flex:1;margin-top:16px}.neeto-filters-pane-filter__body .accordion_item .neeto-filters-pane-filter__item-wrapper:first-of-type{margin-top:0}.neeto-filters-pane-filter__body .accordion_item:first-of-type .neeto-ui-accordion__item{padding-top:0}.neeto-filters-pane-filter__body .neeto-ui-accordion__wrapper--last-item{border-bottom:thin solid rgb(var(--neeto-ui-gray-300))}@media screen and (max-width:767px){.neeto-filters-pane-filter{width:100vw}}.neeto-filters-pane-backdrop{-webkit-backdrop-filter:blur(0)!important;backdrop-filter:blur(0)!important;background-color:rgba(var(--neeto-ui-gray-700),.2)}.neeto-filters-segment--active{border-color:rgb(var(--neeto-ui-primary-500))!important;box-shadow:0 0 0 1px rgb(var(--neeto-ui-primary-500))!important}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9jb21wb25lbnRzL19iYXIuc2NzcyIsImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9pbmRleC5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3JjL3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX2ZpbHRlcnMuc2NzcyIsImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9hYnN0cmFjdHMvX21peGlucy5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3JjL3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3NlZ21lbnRzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsbUJBR0Usa0JBQUEsQ0FGQSxZQUFBLENBQ0EsY0NFRixDRENFLDBCQUtFLHFDQUFBLENBSEEsWUFBQSxDQUVBLE9BQUEsQ0FHQSxZQUFBLENBQ0EsZUFBQSxDQUVBLGVBQUEsQ0FUQSxlQUFBLENBRUEsaUJBQUEsQ0FHQSxxQ0FBQSxDQUdBLGtCQ0VKLENEQ0ksd0NBQ0UsbUNDQ04sQ0RFSSxnQ0FRRSxnSEFBQSxDQUZBLG1DQUFBLENBREEsU0FBQSxDQURBLFdBQUEsQ0FIQSxpQk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WVuIGFuZCAobWluLXdpZHRoOiAxMjAwcHgpIHtcbiAgICAgIEBjb250ZW50O1xuICAgIH1cbiAgfSBAZWxzZSBpZiAkbWVkaWE9PXRhYi1taW4ge1xuICAgIEBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDEwMjRweCkge1xuICAgICAgQGNvbnRlbnQ7XG4gICAgfVxuICB9IEBlbHNlIGlmICRtZWRpYT09dGFiLW9ubHkge1xuICAgIEBtZWRpYSBzY3JlZW4gYW5kIChtaW4td2lkdGg6IDc2OHB4KSBhbmQgKG1heC13aWR0aDogMTAyM3B4KSB7XG4gICAgICBAY29udGVudDtcbiAgICB9XG4gIH0gQGVsc2UgaWYgJG1lZGlhPT1tb2Ige1xuICAgIEBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDc2N3B4KSB7XG4gICAgICBAY29udGVudDtcbiAgICB9XG4gIH0gQGVsc2UgaWYgJG1lZGlhPT14cy1tb2Ige1xuICAgIEBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDQ3OXB4KSB7XG4gICAgICBAY29udGVudDtcbiAgICB9XG4gIH1cbn1cbiIsIi5uZWV0by1maWx0ZXJzLXNlZ21lbnQtLWFjdGl2ZSB7XG4gIGJvcmRlci1jb2xvcjogcmdiKHZhcigtLW5lZXRvLXVpLXByaW1hcnktNTAwKSkgIWltcG9ydGFudDtcbiAgYm94LXNoYWRvdzogMCAwIDAgMXB4IHJnYih2YXIoLS1uZWV0by11aS1wcmltYXJ5LTUwMCkpICFpbXBvcnRhbnQ7XG59XG4iXX0= */";
|
|
3110
3171
|
n(css,{});
|
|
3111
3172
|
|
|
3112
|
-
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; }
|
|
3113
|
-
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; }
|
|
3173
|
+
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; }
|
|
3174
|
+
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; }
|
|
3114
3175
|
var Filters = withT(function (_ref) {
|
|
3115
3176
|
var t = _ref.t,
|
|
3116
3177
|
_ref$isOpen = _ref.isOpen,
|
|
@@ -3138,28 +3199,31 @@ var Filters = withT(function (_ref) {
|
|
|
3138
3199
|
} : _ref$keyword,
|
|
3139
3200
|
childrenKeys = _ref.childrenKeys,
|
|
3140
3201
|
children = _ref.children;
|
|
3141
|
-
return /*#__PURE__*/
|
|
3142
|
-
className: classnames(_defineProperty({}, className, className))
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3202
|
+
return /*#__PURE__*/jsxs("span", {
|
|
3203
|
+
className: classnames(_defineProperty({}, className, className)),
|
|
3204
|
+
children: [/*#__PURE__*/jsx(Button, _objectSpread$1({
|
|
3205
|
+
"data-cy": "neeto-filters-toggle-btn",
|
|
3206
|
+
label: t("neetoFilters.common.filter"),
|
|
3207
|
+
style: "secondary",
|
|
3208
|
+
onClick: function onClick() {
|
|
3209
|
+
return setIsOpen(true);
|
|
3210
|
+
}
|
|
3211
|
+
}, buttonProps)), /*#__PURE__*/jsx(Pane, _objectSpread$1(_objectSpread$1({
|
|
3212
|
+
onClose: function onClose() {
|
|
3213
|
+
return setIsOpen(false);
|
|
3214
|
+
}
|
|
3215
|
+
}, _objectSpread$1({
|
|
3216
|
+
childrenKeys: childrenKeys,
|
|
3217
|
+
columns: columns,
|
|
3218
|
+
isOpen: isOpen,
|
|
3219
|
+
isSearchable: isSearchable,
|
|
3220
|
+
keyword: keyword,
|
|
3221
|
+
onChange: onChange,
|
|
3222
|
+
onSelectorsChange: onSelectorsChange
|
|
3223
|
+
}, paneProps)), {}, {
|
|
3224
|
+
children: children
|
|
3225
|
+
}))]
|
|
3226
|
+
});
|
|
3163
3227
|
});
|
|
3164
3228
|
|
|
3165
3229
|
var ITEMS_MAX_COUNT = 20;
|
|
@@ -3200,13 +3264,13 @@ var Delete = function Delete(_ref) {
|
|
|
3200
3264
|
onSuccess: onClose
|
|
3201
3265
|
});
|
|
3202
3266
|
};
|
|
3203
|
-
return /*#__PURE__*/
|
|
3267
|
+
return /*#__PURE__*/jsx(Alert, {
|
|
3204
3268
|
isOpen: isOpen,
|
|
3205
3269
|
onClose: onClose,
|
|
3206
3270
|
isSubmitting: isDeleting,
|
|
3207
3271
|
submitButtonLabel: t("neetoFilters.common.delete"),
|
|
3208
3272
|
title: t("neetoFilters.segments.deleteAlertTitle"),
|
|
3209
|
-
message: /*#__PURE__*/
|
|
3273
|
+
message: /*#__PURE__*/jsx(Trans, {
|
|
3210
3274
|
i18nKey: "neetoFilters.segments.deleteAlertMessage",
|
|
3211
3275
|
values: {
|
|
3212
3276
|
entity: segment.name
|
|
@@ -3296,12 +3360,13 @@ var useSegments = function useSegments(_ref) {
|
|
|
3296
3360
|
setSegments(fetchedSegments);
|
|
3297
3361
|
}, [fetchedSegments]);
|
|
3298
3362
|
if (isLoading) {
|
|
3299
|
-
return /*#__PURE__*/
|
|
3363
|
+
return /*#__PURE__*/jsx(Spinner, {});
|
|
3300
3364
|
}
|
|
3301
3365
|
if (isEmpty(segments)) {
|
|
3302
|
-
return /*#__PURE__*/
|
|
3303
|
-
style: "body2"
|
|
3304
|
-
|
|
3366
|
+
return /*#__PURE__*/jsx(Typography, {
|
|
3367
|
+
style: "body2",
|
|
3368
|
+
children: t("neetoFilters.segments.noSegmentsFound")
|
|
3369
|
+
});
|
|
3305
3370
|
}
|
|
3306
3371
|
var handleUpdate = function handleUpdate(_ref4, _ref5) {
|
|
3307
3372
|
var name = _ref4.name;
|
|
@@ -3380,28 +3445,33 @@ var Segment = function Segment(_ref) {
|
|
|
3380
3445
|
});
|
|
3381
3446
|
}
|
|
3382
3447
|
}];
|
|
3383
|
-
return /*#__PURE__*/
|
|
3448
|
+
return /*#__PURE__*/jsxs("div", {
|
|
3384
3449
|
onClick: onClick,
|
|
3385
3450
|
"data-cy": "neeto-filters-segment-block-".concat(hyphenate(label)),
|
|
3386
3451
|
className: classnames("neeto-ui-border-gray-400 neeto-ui-bg-white hover:neeto-ui-bg-gray-200 neeto-ui-rounded-lg mb-2 flex h-10 cursor-pointer items-center gap-2 border p-3 transition-all duration-300 ease-in-out", {
|
|
3387
3452
|
"neeto-filters-segment--active": isActive
|
|
3388
|
-
})
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3453
|
+
}),
|
|
3454
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
3455
|
+
className: "flex flex-grow items-center gap-2 overflow-hidden",
|
|
3456
|
+
"data-cy": "new-element-field",
|
|
3457
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
3458
|
+
className: "truncate leading-snug",
|
|
3459
|
+
"data-cy": hyphenate(label),
|
|
3460
|
+
style: "body2",
|
|
3461
|
+
children: label
|
|
3462
|
+
})
|
|
3463
|
+
}), shouldShowDropdown && /*#__PURE__*/jsx(MoreDropdown, {
|
|
3464
|
+
menuItems: menuItems,
|
|
3465
|
+
dropdownButtonProps: {
|
|
3466
|
+
className: "min-h-0 flex-shrink-0",
|
|
3467
|
+
"data-cy": "".concat(hyphenate(label), "-more-dropdown")
|
|
3468
|
+
}
|
|
3469
|
+
})]
|
|
3470
|
+
});
|
|
3403
3471
|
};
|
|
3404
3472
|
|
|
3473
|
+
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; }
|
|
3474
|
+
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; }
|
|
3405
3475
|
var MenuBlocks = function MenuBlocks(_ref) {
|
|
3406
3476
|
var entity = _ref.entity,
|
|
3407
3477
|
segments = _ref.segments,
|
|
@@ -3419,63 +3489,74 @@ var MenuBlocks = function MenuBlocks(_ref) {
|
|
|
3419
3489
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3420
3490
|
showAll = _useState2[0],
|
|
3421
3491
|
setShowAll = _useState2[1];
|
|
3422
|
-
return /*#__PURE__*/
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
})
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3492
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
3493
|
+
children: [/*#__PURE__*/jsx(MenuBar.SubTitle, {
|
|
3494
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
3495
|
+
component: "h4",
|
|
3496
|
+
style: "h5",
|
|
3497
|
+
textTransform: "uppercase",
|
|
3498
|
+
weight: "bold",
|
|
3499
|
+
children: t("neetoFilters.common.segments")
|
|
3500
|
+
})
|
|
3501
|
+
}), segments.length > ITEMS_MAX_COUNT && /*#__PURE__*/jsx(Button, {
|
|
3502
|
+
icon: Down,
|
|
3503
|
+
style: "link",
|
|
3504
|
+
label: showAll ? t("neetoFilters.segments.showLess") : t("neetoFilters.segments.showMoreNumbers", {
|
|
3505
|
+
entity: segments.length - ITEMS_MAX_COUNT
|
|
3506
|
+
}),
|
|
3507
|
+
onClick: function onClick() {
|
|
3508
|
+
return setShowAll(function (open) {
|
|
3509
|
+
return !open;
|
|
3510
|
+
});
|
|
3511
|
+
}
|
|
3512
|
+
}), /*#__PURE__*/jsx(Segment, {
|
|
3513
|
+
isActive: isEmpty(appliedFilters),
|
|
3514
|
+
label: defaultSegmentName,
|
|
3515
|
+
onClick: clearAppliedFilters
|
|
3516
|
+
}), /*#__PURE__*/jsx(DragDropContext, {
|
|
3517
|
+
onDragEnd: handleSegmentsReorder,
|
|
3518
|
+
children: /*#__PURE__*/jsx(Droppable, {
|
|
3519
|
+
droppableId: "neeto-filters-segments-".concat(entity),
|
|
3520
|
+
children: function children(_ref2) {
|
|
3521
|
+
var innerRef = _ref2.innerRef,
|
|
3522
|
+
droppableProps = _ref2.droppableProps,
|
|
3523
|
+
placeholder = _ref2.placeholder;
|
|
3524
|
+
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
3525
|
+
ref: innerRef
|
|
3526
|
+
}, droppableProps), {}, {
|
|
3527
|
+
children: [segments.slice(0, showAll ? segments.length : ITEMS_MAX_COUNT).map(function (segment, index) {
|
|
3528
|
+
return /*#__PURE__*/createElement(Draggable, {
|
|
3529
|
+
index: index,
|
|
3530
|
+
draggableId: segment.id.toString(),
|
|
3531
|
+
isDragDisabled: isUpdating,
|
|
3532
|
+
key: segment.id.toString()
|
|
3533
|
+
}, function (_ref3) {
|
|
3534
|
+
var innerRef = _ref3.innerRef,
|
|
3535
|
+
draggableProps = _ref3.draggableProps,
|
|
3536
|
+
dragHandleProps = _ref3.dragHandleProps;
|
|
3537
|
+
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread(_objectSpread({
|
|
3538
|
+
ref: innerRef
|
|
3539
|
+
}, draggableProps), dragHandleProps), {}, {
|
|
3540
|
+
children: /*#__PURE__*/createElement(Segment, {
|
|
3541
|
+
segments: segments,
|
|
3542
|
+
setConfirmAction: setConfirmAction,
|
|
3543
|
+
shouldShowDropdown: true,
|
|
3544
|
+
id: segment.id,
|
|
3545
|
+
isActive: segment.id === segmentId,
|
|
3546
|
+
key: segment.id,
|
|
3547
|
+
label: segment.name,
|
|
3548
|
+
onClick: function onClick() {
|
|
3549
|
+
return handleSelectSegment(segment);
|
|
3550
|
+
}
|
|
3551
|
+
})
|
|
3552
|
+
}));
|
|
3553
|
+
});
|
|
3554
|
+
}), placeholder]
|
|
3555
|
+
}));
|
|
3556
|
+
}
|
|
3557
|
+
})
|
|
3558
|
+
})]
|
|
3559
|
+
});
|
|
3479
3560
|
};
|
|
3480
3561
|
var MenuBlocks$1 = /*#__PURE__*/React.memo(MenuBlocks);
|
|
3481
3562
|
|
|
@@ -3508,31 +3589,33 @@ var SidebarBlock = function SidebarBlock(_ref) {
|
|
|
3508
3589
|
}
|
|
3509
3590
|
}];
|
|
3510
3591
|
var dataCyPrefix = hyphenate(label);
|
|
3511
|
-
return /*#__PURE__*/
|
|
3592
|
+
return /*#__PURE__*/jsxs("button", {
|
|
3512
3593
|
onClick: onClick,
|
|
3513
3594
|
"data-cy": "".concat(dataCyPrefix, "-segment-link"),
|
|
3514
3595
|
className: classnames("neeto-molecules-sidebar-segment neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none mb-0 w-full py-1", {
|
|
3515
3596
|
active: isActive
|
|
3516
|
-
})
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3597
|
+
}),
|
|
3598
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
3599
|
+
className: "neeto-molecules-sidebar__link-sub-label neeto-molecules-sidebar-segment__label neeto-ui-flex-grow min-w-0",
|
|
3600
|
+
component: "span",
|
|
3601
|
+
"data-cy": "".concat(dataCyPrefix, "-sub-link-label"),
|
|
3602
|
+
style: "body2",
|
|
3603
|
+
children: label
|
|
3604
|
+
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
3605
|
+
menuItems: menuItems,
|
|
3606
|
+
dropdownButtonProps: {
|
|
3607
|
+
"data-testid": "segment-more-menu-".concat(dataCyPrefix),
|
|
3608
|
+
className: "flex-shrink-0",
|
|
3609
|
+
size: "small",
|
|
3610
|
+
style: "secondary"
|
|
3611
|
+
},
|
|
3612
|
+
dropdownProps: {
|
|
3613
|
+
position: "bottom-end",
|
|
3614
|
+
strategy: "fixed",
|
|
3615
|
+
autoWidth: true
|
|
3616
|
+
}
|
|
3617
|
+
})]
|
|
3618
|
+
});
|
|
3536
3619
|
};
|
|
3537
3620
|
|
|
3538
3621
|
var Segments = function Segments(_ref) {
|
|
@@ -3569,54 +3652,58 @@ var Segments = function Segments(_ref) {
|
|
|
3569
3652
|
handleUpdate = _useSegments.handleUpdate,
|
|
3570
3653
|
filters = _useSegments.filters,
|
|
3571
3654
|
appliedFilters = _useSegments.appliedFilters;
|
|
3572
|
-
return /*#__PURE__*/
|
|
3573
|
-
"data-testid": "neeto-filters-segments"
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
segments: segments,
|
|
3584
|
-
setConfirmAction: setConfirmAction
|
|
3585
|
-
}) : /*#__PURE__*/React.createElement(React.Fragment, null, isNotEmpty(segments) && /*#__PURE__*/React.createElement(Typography, {
|
|
3586
|
-
style: "body3",
|
|
3587
|
-
weight: "semibold",
|
|
3588
|
-
className: "neeto-molecules-sidebar-segments-header neeto-ui-text-transform-capitalize neeto-ui-text-gray-600 py-2 uppercase"
|
|
3589
|
-
}, t("neetoFilters.segments.segment", PLURAL)), segments.map(function (segment) {
|
|
3590
|
-
return /*#__PURE__*/React.createElement(SidebarBlock, {
|
|
3655
|
+
return /*#__PURE__*/jsxs("div", {
|
|
3656
|
+
"data-testid": "neeto-filters-segments",
|
|
3657
|
+
children: [isIndependent ? /*#__PURE__*/jsx(MenuBlocks$1, {
|
|
3658
|
+
appliedFilters: appliedFilters,
|
|
3659
|
+
clearAppliedFilters: clearAppliedFilters,
|
|
3660
|
+
defaultSegmentName: defaultSegmentName,
|
|
3661
|
+
entity: entity,
|
|
3662
|
+
handleSegmentsReorder: handleSegmentsReorder,
|
|
3663
|
+
handleSelectSegment: handleSelectSegment,
|
|
3664
|
+
isUpdating: isUpdating,
|
|
3665
|
+
segmentId: segmentId,
|
|
3591
3666
|
segments: segments,
|
|
3592
|
-
setConfirmAction: setConfirmAction
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
}
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3667
|
+
setConfirmAction: setConfirmAction
|
|
3668
|
+
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
3669
|
+
children: [isNotEmpty(segments) && /*#__PURE__*/jsx(Typography, {
|
|
3670
|
+
style: "body3",
|
|
3671
|
+
weight: "semibold",
|
|
3672
|
+
className: "neeto-molecules-sidebar-segments-header neeto-ui-text-transform-capitalize neeto-ui-text-gray-600 py-2 uppercase",
|
|
3673
|
+
children: t("neetoFilters.segments.segment", PLURAL)
|
|
3674
|
+
}), segments.map(function (segment) {
|
|
3675
|
+
return /*#__PURE__*/createElement(SidebarBlock, {
|
|
3676
|
+
segments: segments,
|
|
3677
|
+
setConfirmAction: setConfirmAction,
|
|
3678
|
+
id: segment.id,
|
|
3679
|
+
isActive: segment.id === segmentId,
|
|
3680
|
+
key: segment.id,
|
|
3681
|
+
label: segment.name,
|
|
3682
|
+
onClick: function onClick() {
|
|
3683
|
+
return handleSelectSegment(segment);
|
|
3684
|
+
}
|
|
3685
|
+
});
|
|
3686
|
+
})]
|
|
3687
|
+
}), /*#__PURE__*/jsx(SegmentForm, {
|
|
3688
|
+
childrenKeys: childrenKeys,
|
|
3689
|
+
columns: columns,
|
|
3690
|
+
customFilters: customFilters,
|
|
3691
|
+
defaultSegmentName: defaultSegmentName,
|
|
3692
|
+
filters: filters,
|
|
3693
|
+
onClose: onClose,
|
|
3694
|
+
segmentFormInitialRef: segmentFormInitialRef,
|
|
3695
|
+
isEdit: true,
|
|
3696
|
+
handleSubmit: handleUpdate,
|
|
3697
|
+
initialValues: selectedSegment,
|
|
3698
|
+
isOpen: isEditPaneOpen,
|
|
3699
|
+
isSubmitting: isUpdating
|
|
3700
|
+
}), /*#__PURE__*/jsx(Delete, {
|
|
3701
|
+
columns: columns,
|
|
3702
|
+
onClose: onClose,
|
|
3703
|
+
isOpen: isDeleteAlertOpen,
|
|
3704
|
+
segment: selectedSegment
|
|
3705
|
+
})]
|
|
3706
|
+
});
|
|
3620
3707
|
};
|
|
3621
3708
|
var index = /*#__PURE__*/React.memo(Segments);
|
|
3622
3709
|
|