@bigbinary/neeto-filters-frontend 3.4.0-beta1 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +29 -36
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +17 -29
- package/dist/index.js.map +1 -1
- package/package.json +16 -14
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import i18next, { t as t$1 } from 'i18next';
|
|
|
5
5
|
import { findBy, isNotEmpty, capitalize, removeBy, toLabelAndValue, hyphenate, isNotPresent, noop, replaceBy, existsBy, _existsBy, isPresent, humanize, findById, filterBy } from '@bigbinary/neeto-cist';
|
|
6
6
|
import { useDebounce, useQueryParams, useMutationWithInvalidation, withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
7
7
|
import { groupBy, anyPass, isNil, isEmpty, any, concat, omit, mergeLeft, toLower, identity, mergeRight, toPairs, pluck, either, not, has, equals, pick, last, modify, append, mergeDeepRight, prop, assoc, reject, sortBy, project } from 'ramda';
|
|
8
|
-
import
|
|
8
|
+
import Delete$1 from '@bigbinary/neeto-icons/Delete';
|
|
9
9
|
import Accordion from '@bigbinary/neetoui/Accordion';
|
|
10
10
|
import Button from '@bigbinary/neetoui/Button';
|
|
11
11
|
import Pane$1 from '@bigbinary/neetoui/Pane';
|
|
@@ -21,14 +21,17 @@ 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 Help from '@bigbinary/neeto-icons/Help';
|
|
24
25
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
25
26
|
import DatePicker from '@bigbinary/neetoui/DatePicker';
|
|
26
|
-
import
|
|
27
|
+
import TimePicker from '@bigbinary/neetoui/TimePicker';
|
|
27
28
|
import Input from '@bigbinary/neetoui/Input';
|
|
28
29
|
import NeetoUITreeSelect from '@bigbinary/neetoui/TreeSelect';
|
|
30
|
+
import Plus from '@bigbinary/neeto-icons/Plus';
|
|
29
31
|
import * as yup from 'yup';
|
|
30
32
|
import { useHistory as useHistory$1, useLocation } from 'react-router-dom';
|
|
31
33
|
import useHotkeys from '@bigbinary/neeto-hotkeys';
|
|
34
|
+
import Close from '@bigbinary/neeto-icons/Close';
|
|
32
35
|
import Tooltip from '@bigbinary/neetoui/Tooltip';
|
|
33
36
|
import axios from 'axios';
|
|
34
37
|
import Dropdown$2 from '@bigbinary/neetoui/Dropdown';
|
|
@@ -37,6 +40,7 @@ import { PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
|
|
|
37
40
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
38
41
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
39
42
|
import { DragDropContext, Droppable, Draggable } from '@hello-pangea/dnd';
|
|
43
|
+
import Down from '@bigbinary/neeto-icons/Down';
|
|
40
44
|
import MenuBar from '@bigbinary/neeto-molecules/MenuBar';
|
|
41
45
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
42
46
|
|
|
@@ -315,11 +319,9 @@ var TREE_SELECT_RULES = [{
|
|
|
315
319
|
value: "is_unknown"
|
|
316
320
|
}];
|
|
317
321
|
var DEFAULT_HELP_ICON_PROPS = {
|
|
318
|
-
icon: Help
|
|
319
|
-
tooltipProps: {
|
|
320
|
-
position: "right"
|
|
321
|
-
}
|
|
322
|
+
icon: Help
|
|
322
323
|
};
|
|
324
|
+
var TIME_FORMAT = "h:mm A";
|
|
323
325
|
|
|
324
326
|
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; }
|
|
325
327
|
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; }
|
|
@@ -960,9 +962,6 @@ var getColumnsWithStandardizedType = function getColumnsWithStandardizedType(col
|
|
|
960
962
|
var isKeywordFilterPresent = function isKeywordFilterPresent(keyworFilter) {
|
|
961
963
|
return not(isEmpty(keyworFilter.node));
|
|
962
964
|
};
|
|
963
|
-
var isNilOrEmpty = function isNilOrEmpty(param) {
|
|
964
|
-
return isNil(param) || isEmpty(param);
|
|
965
|
-
};
|
|
966
965
|
|
|
967
966
|
var buildDropdownValue = function buildDropdownValue(_ref) {
|
|
968
967
|
var defaultType = _ref.defaultType,
|
|
@@ -1068,18 +1067,6 @@ var areCustomTimeRangeValuesNotValid = function areCustomTimeRangeValuesNotValid
|
|
|
1068
1067
|
return time.isValid();
|
|
1069
1068
|
});
|
|
1070
1069
|
};
|
|
1071
|
-
|
|
1072
|
-
// eslint-disable-next-line @bigbinary/neeto/use-standard-date-time-formats
|
|
1073
|
-
var formatSingleTime = function formatSingleTime(time) {
|
|
1074
|
-
return dayjs(time).format("HH:mm:ss");
|
|
1075
|
-
};
|
|
1076
|
-
var formatTime = function formatTime(value, timePickerType) {
|
|
1077
|
-
if (isNilOrEmpty(value)) return null;
|
|
1078
|
-
if (timePickerType === "range") {
|
|
1079
|
-
return value.map(formatSingleTime);
|
|
1080
|
-
}
|
|
1081
|
-
return formatSingleTime(value);
|
|
1082
|
-
};
|
|
1083
1070
|
var isRuleEmpty = function isRuleEmpty(rule) {
|
|
1084
1071
|
return equals(rule, "is_unknown");
|
|
1085
1072
|
};
|
|
@@ -1509,7 +1496,6 @@ var SingleTime = function SingleTime(_ref) {
|
|
|
1509
1496
|
});
|
|
1510
1497
|
handleApplyFilter(updatedFilter);
|
|
1511
1498
|
};
|
|
1512
|
-
var formattedTime = formatTime(value, timePickerType);
|
|
1513
1499
|
return /*#__PURE__*/jsxs("div", {
|
|
1514
1500
|
className: "neeto-filters-pane-filter__item-wrapper",
|
|
1515
1501
|
children: [/*#__PURE__*/jsx(Select, _objectSpread$9(_objectSpread$9({
|
|
@@ -1524,12 +1510,13 @@ var SingleTime = function SingleTime(_ref) {
|
|
|
1524
1510
|
}
|
|
1525
1511
|
}), {}, {
|
|
1526
1512
|
onChange: handleRuleChange
|
|
1527
|
-
})), /*#__PURE__*/jsx(
|
|
1513
|
+
})), /*#__PURE__*/jsx(TimePicker, _objectSpread$9({
|
|
1528
1514
|
autoFocus: autoFocus,
|
|
1515
|
+
value: value,
|
|
1529
1516
|
className: "w-full",
|
|
1530
1517
|
"data-cy": "neeto-filters-".concat(hyphenate(key), "-filter"),
|
|
1518
|
+
format: TIME_FORMAT,
|
|
1531
1519
|
type: timePickerType,
|
|
1532
|
-
value: formattedTime,
|
|
1533
1520
|
onChange: handleChange
|
|
1534
1521
|
}, otherProps))]
|
|
1535
1522
|
});
|
|
@@ -1717,11 +1704,12 @@ var Time = function Time(_ref) {
|
|
|
1717
1704
|
}
|
|
1718
1705
|
}), {}, {
|
|
1719
1706
|
onChange: handleChange
|
|
1720
|
-
})), isCustomTimeRangeShown && /*#__PURE__*/jsx(
|
|
1707
|
+
})), isCustomTimeRangeShown && /*#__PURE__*/jsx(TimePicker, _objectSpread$7({
|
|
1721
1708
|
className: "w-full",
|
|
1722
1709
|
"data-cy": "neeto-filters-".concat(hyphenate(key), "-date-range"),
|
|
1710
|
+
format: TIME_FORMAT,
|
|
1723
1711
|
type: "range",
|
|
1724
|
-
value:
|
|
1712
|
+
value: filter.value,
|
|
1725
1713
|
onChange: handleTimeRangeChange
|
|
1726
1714
|
}, otherProps))]
|
|
1727
1715
|
});
|
|
@@ -2574,17 +2562,17 @@ var useFetchSegments = function useFetchSegments(_ref) {
|
|
|
2574
2562
|
};
|
|
2575
2563
|
var useCreateSegment = function useCreateSegment(options) {
|
|
2576
2564
|
return useMutationWithInvalidation(segmentsApi.create, _objectSpread$4({
|
|
2577
|
-
keysToInvalidate: [SEGMENTS_LIST]
|
|
2565
|
+
keysToInvalidate: [[SEGMENTS_LIST]]
|
|
2578
2566
|
}, options));
|
|
2579
2567
|
};
|
|
2580
2568
|
var useUpdateSegment = function useUpdateSegment(options) {
|
|
2581
2569
|
return useMutationWithInvalidation(segmentsApi.update, _objectSpread$4({
|
|
2582
|
-
keysToInvalidate: [SEGMENTS_LIST]
|
|
2570
|
+
keysToInvalidate: [[SEGMENTS_LIST]]
|
|
2583
2571
|
}, options));
|
|
2584
2572
|
};
|
|
2585
2573
|
var useDestroySegment = function useDestroySegment(options) {
|
|
2586
2574
|
return useMutationWithInvalidation(segmentsApi.destroy, _objectSpread$4({
|
|
2587
|
-
keysToInvalidate: [SEGMENTS_LIST]
|
|
2575
|
+
keysToInvalidate: [[SEGMENTS_LIST]]
|
|
2588
2576
|
}, options));
|
|
2589
2577
|
};
|
|
2590
2578
|
|