@bigbinary/neeto-filters-frontend 3.1.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import React, { useState, useRef, useEffect, useTransition, useMemo } from 'react';
2
2
  import classnames from 'classnames';
3
3
  import i18next, { t as t$1 } from 'i18next';
4
- import { capitalize, removeBy, findBy, isNotEmpty, humanize, hyphenate, noop as noop$1, toLabelAndValue, replaceBy, isPresent, existsBy, isNotPresent, filterBy } from '@bigbinary/neeto-cist';
5
- import { useHotKeys, useMutationWithInvalidation, useQueryParams, useDebounce, withT } from '@bigbinary/neeto-commons-frontend/react-utils';
4
+ import { findBy, isNotEmpty, capitalize, removeBy, humanize, hyphenate, noop as noop$1, toLabelAndValue, replaceBy, isPresent, existsBy, isNotPresent, filterBy } from '@bigbinary/neeto-cist';
5
+ import { useMutationWithInvalidation, useQueryParams, useDebounce, withT } from '@bigbinary/neeto-commons-frontend/react-utils';
6
6
  import { getQueryParams, dateFormat, buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
7
7
  import { Tooltip, Typography, Dropdown as Dropdown$2, Button, Pane as Pane$1, Alert, Select, DatePicker, TimePicker, Input as Input$1, Accordion, Spinner } from '@bigbinary/neetoui';
8
- import { groupBy, anyPass, isNil, isEmpty, any, toLower, mergeLeft, identity, omit, mergeRight, toPairs, not, pluck, either, has, concat, equals, pick, modify, prop, isNotNil, append, last, mergeDeepRight } from 'ramda';
8
+ import { groupBy, anyPass, isNil, isEmpty, any, concat, omit, toLower, mergeLeft, identity, mergeRight, toPairs, not, pluck, either, has, equals, pick, modify, prop, isNotNil, append, last, mergeDeepRight } from 'ramda';
9
9
  import { useTranslation, Trans } from 'react-i18next';
10
10
  import { useHistory, useLocation } from 'react-router-dom';
11
+ import useHotkeys from '@bigbinary/neeto-hotkeys';
11
12
  import { Help, Close, MenuHorizontal, Down, Settings } from '@bigbinary/neeto-icons';
12
13
  import { Form, Input, ActionBlock } from '@bigbinary/neetoui/formik';
13
14
  import { useQuery } from 'react-query';
@@ -1035,12 +1036,12 @@ var Block = function Block(_ref) {
1035
1036
  var blockLength = label.length + ruleContent.length + filterValue.length;
1036
1037
  var toolTipDisabled = blockLength <= 50;
1037
1038
  var blockContent = !toolTipDisabled ? "".concat(filterValue.slice(0, 50 - blockLength), "...") : filterValue;
1038
- var deleteBlockHotKeyRef = useHotKeys(SHORTCUTS.deleteBlock.sequence, function () {
1039
+ var deleteBlockHotKeyRef = useHotkeys(SHORTCUTS.deleteBlock.sequence, function () {
1039
1040
  return handleDelete(key);
1040
1041
  }, {
1041
1042
  mode: "scoped"
1042
1043
  });
1043
- var openFilterPaneHotKeyRef = useHotKeys(SHORTCUTS.openFilterPane.sequence, function () {
1044
+ var openFilterPaneHotKeyRef = useHotkeys(SHORTCUTS.openFilterPane.sequence, function () {
1044
1045
  return setIsPaneOpen(key);
1045
1046
  }, {
1046
1047
  mode: "scoped"
@@ -1085,12 +1086,12 @@ var ChildBlock = function ChildBlock(_ref) {
1085
1086
  var childKey = _ref.childKey,
1086
1087
  setIsPaneOpen = _ref.setIsPaneOpen,
1087
1088
  handleDelete = _ref.handleDelete;
1088
- var deleteBlockHotKeyRef = useHotKeys(SHORTCUTS.deleteBlock.sequence, function () {
1089
+ var deleteBlockHotKeyRef = useHotkeys(SHORTCUTS.deleteBlock.sequence, function () {
1089
1090
  return handleDelete(childKey);
1090
1091
  }, {
1091
1092
  mode: "scoped"
1092
1093
  });
1093
- var openFilterPaneHotKeyRef = useHotKeys(SHORTCUTS.openFilterPane.sequence, function () {
1094
+ var openFilterPaneHotKeyRef = useHotkeys(SHORTCUTS.openFilterPane.sequence, function () {
1094
1095
  return setIsPaneOpen(childKey);
1095
1096
  }, {
1096
1097
  mode: "scoped"
@@ -1139,8 +1140,12 @@ var create = function create(payload) {
1139
1140
  };
1140
1141
  var update = function update(_ref) {
1141
1142
  var id = _ref.id,
1142
- payload = _ref.payload;
1143
- return axios.put("".concat(SEGMENTS_BASE_URL, "/").concat(id), payload);
1143
+ payload = _ref.payload,
1144
+ _ref$showToastr = _ref.showToastr,
1145
+ showToastr = _ref$showToastr === void 0 ? true : _ref$showToastr;
1146
+ return axios.put("".concat(SEGMENTS_BASE_URL, "/").concat(id), payload, {
1147
+ showToastr: showToastr
1148
+ });
1144
1149
  };
1145
1150
  var destroy = function destroy(id) {
1146
1151
  return axios["delete"]("".concat(SEGMENTS_BASE_URL, "/").concat(id));
@@ -2414,7 +2419,7 @@ var Slider = function Slider(_ref) {
2414
2419
  className = _ref$className === void 0 ? "" : _ref$className,
2415
2420
  children = _ref.children,
2416
2421
  otherProps = _objectWithoutProperties(_ref, _excluded$1);
2417
- useHotKeys(SHORTCUTS.closePane.sequence, onClose, {
2422
+ useHotkeys(SHORTCUTS.closePane.sequence, onClose, {
2418
2423
  mode: "global"
2419
2424
  });
2420
2425
  return /*#__PURE__*/React.createElement(Portal, {
@@ -3807,5 +3812,5 @@ var Segments = function Segments(_ref) {
3807
3812
  };
3808
3813
  var index = /*#__PURE__*/React.memo(Segments);
3809
3814
 
3810
- export { Bar, Filters, index as Segments, buildFilterColumnsFromFields, buildFiltersFromURL, buildSelectorsFromURL, useFetchSegments };
3815
+ export { Bar, Filters, index as Segments, buildFilterColumnsFromFields, buildFiltersFromURL, buildSelectorsFromURL, buildUrlFromFilters, buildUrlFromSegment, useDestroySegment, useFetchSegments, useUpdateSegment };
3811
3816
  //# sourceMappingURL=index.js.map