@bigbinary/neeto-filters-frontend 3.3.5 → 4.0.0

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,11 +1,11 @@
1
1
  import React, { useState, useEffect, useMemo, createElement, useRef, useTransition } from 'react';
2
+ import { useQuery, useQueryClient } from '@tanstack/react-query';
2
3
  import classnames from 'classnames';
3
4
  import i18next, { t as t$1 } from 'i18next';
4
5
  import { findBy, isNotEmpty, capitalize, removeBy, toLabelAndValue, hyphenate, isNotPresent, noop, replaceBy, existsBy, _existsBy, isPresent, humanize, findById, filterBy } from '@bigbinary/neeto-cist';
5
6
  import { useDebounce, useQueryParams, useMutationWithInvalidation, withT } from '@bigbinary/neeto-commons-frontend/react-utils';
6
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';
7
- import { useQuery, useQueryClient } from 'react-query';
8
- import { Help, Delete as Delete$1, Plus, Close, Down } from '@bigbinary/neeto-icons';
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
27
  import TimePickerInput from '@bigbinary/neetoui/TimePickerInput';
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
 
@@ -2557,29 +2561,31 @@ var useFetchSegments = function useFetchSegments(_ref) {
2557
2561
  _ref$searchTerm = _ref.searchTerm,
2558
2562
  searchTerm = _ref$searchTerm === void 0 ? "" : _ref$searchTerm;
2559
2563
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2560
- return useQuery([SEGMENTS_LIST, entity, searchTerm], function () {
2561
- return segmentsApi.fetch({
2562
- entity: entity,
2563
- searchTerm: searchTerm
2564
- });
2565
- }, mergeRight({
2566
- staleTime: SEGMENTS_STALE_TIME,
2567
- select: prop("segments")
2564
+ return useQuery(_objectSpread$4({
2565
+ queryKey: [SEGMENTS_LIST, entity, searchTerm],
2566
+ queryFn: function queryFn() {
2567
+ return segmentsApi.fetch({
2568
+ entity: entity,
2569
+ searchTerm: searchTerm
2570
+ });
2571
+ },
2572
+ select: prop("segments"),
2573
+ staleTime: SEGMENTS_STALE_TIME
2568
2574
  }, options));
2569
2575
  };
2570
2576
  var useCreateSegment = function useCreateSegment(options) {
2571
2577
  return useMutationWithInvalidation(segmentsApi.create, _objectSpread$4({
2572
- keysToInvalidate: [SEGMENTS_LIST]
2578
+ keysToInvalidate: [[SEGMENTS_LIST]]
2573
2579
  }, options));
2574
2580
  };
2575
2581
  var useUpdateSegment = function useUpdateSegment(options) {
2576
2582
  return useMutationWithInvalidation(segmentsApi.update, _objectSpread$4({
2577
- keysToInvalidate: [SEGMENTS_LIST]
2583
+ keysToInvalidate: [[SEGMENTS_LIST]]
2578
2584
  }, options));
2579
2585
  };
2580
2586
  var useDestroySegment = function useDestroySegment(options) {
2581
2587
  return useMutationWithInvalidation(segmentsApi.destroy, _objectSpread$4({
2582
- keysToInvalidate: [SEGMENTS_LIST]
2588
+ keysToInvalidate: [[SEGMENTS_LIST]]
2583
2589
  }, options));
2584
2590
  };
2585
2591
 
@@ -2604,10 +2610,10 @@ var useSegment = function useSegment(_ref) {
2604
2610
  setIsSavePaneOpen = _useState2[1];
2605
2611
  var _useCreateSegment = useCreateSegment(),
2606
2612
  createSegment = _useCreateSegment.mutate,
2607
- isCreating = _useCreateSegment.isLoading;
2613
+ isCreating = _useCreateSegment.isPending;
2608
2614
  var _useUpdateSegment = useUpdateSegment(),
2609
2615
  updateSegment = _useUpdateSegment.mutate,
2610
- isUpdating = _useUpdateSegment.isLoading;
2616
+ isUpdating = _useUpdateSegment.isPending;
2611
2617
  var isSubmitting = isCreating || isUpdating;
2612
2618
  var searchParams = useQueryParams({
2613
2619
  toCamelCase: false
@@ -3247,7 +3253,7 @@ var Delete = function Delete(_ref) {
3247
3253
  segmentId = _getQueryParams.segmentId;
3248
3254
  var _useDestroySegment = useDestroySegment(),
3249
3255
  deleteSegment = _useDestroySegment.mutate,
3250
- isDeleting = _useDestroySegment.isLoading;
3256
+ isDeleting = _useDestroySegment.isPending;
3251
3257
  var handleClearAll = function handleClearAll() {
3252
3258
  var params = buildUrlFromFilters({
3253
3259
  columns: columns,
@@ -3308,7 +3314,7 @@ var useSegments = function useSegments(_ref) {
3308
3314
  setSegments = _useState2[1];
3309
3315
  var _useUpdateSegment = useUpdateSegment(),
3310
3316
  updateSegment = _useUpdateSegment.mutate,
3311
- isUpdating = _useUpdateSegment.isLoading;
3317
+ isUpdating = _useUpdateSegment.isPending;
3312
3318
  var _useState3 = useState({
3313
3319
  action: "",
3314
3320
  segment: undefined