@trackunit/filters-asset-filter-definitions 0.0.575 → 0.0.577
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/index.cjs.js +3 -3
- package/index.esm.js +2 -2
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -1724,7 +1724,7 @@ const AreaView = (props) => {
|
|
|
1724
1724
|
const [t] = useTranslation();
|
|
1725
1725
|
const [searchString, setSearchString] = react.useState("");
|
|
1726
1726
|
const { logEvent } = reactCoreHooks.useAnalytics(filtersFilterBar.FilterEvents);
|
|
1727
|
-
const [recentAreas, setRecentAreas] =
|
|
1727
|
+
const [recentAreas, setRecentAreas] = reactCoreHooks.useLocalStorage({
|
|
1728
1728
|
defaultState: [],
|
|
1729
1729
|
key: "area-filter-recent-searches",
|
|
1730
1730
|
schema: zod.z.array(areaFilterInternalSchema),
|
|
@@ -2650,7 +2650,7 @@ const SearchFilterInline = ({ filterBarActions, filterState, filterDefinition, l
|
|
|
2650
2650
|
const geometry = reactComponents.useGeometry(searchElementRef);
|
|
2651
2651
|
const filterValue = (filterDefinition === null || filterDefinition === void 0 ? void 0 : filterDefinition.filterKey) ? String(filterState.values[filterDefinition.filterKey]) : undefined;
|
|
2652
2652
|
const [searchString, setSearchString] = react.useState(filterValue !== null && filterValue !== void 0 ? filterValue : "");
|
|
2653
|
-
const previousFilterValue =
|
|
2653
|
+
const previousFilterValue = reactCoreHooks.usePrevious(filterValue);
|
|
2654
2654
|
reactComponents.useDebounce(searchString, 500, "both", debouncedSearchString => {
|
|
2655
2655
|
if (filterValue === debouncedSearchString) {
|
|
2656
2656
|
return;
|
|
@@ -2664,7 +2664,7 @@ const SearchFilterInline = ({ filterBarActions, filterState, filterDefinition, l
|
|
|
2664
2664
|
}
|
|
2665
2665
|
filterValue !== undefined && setSearchString(filterValue);
|
|
2666
2666
|
}, [filterValue, previousFilterValue, searchString]);
|
|
2667
|
-
const [recentSearches, setRecentSearches] =
|
|
2667
|
+
const [recentSearches, setRecentSearches] = reactCoreHooks.useLocalStorage({
|
|
2668
2668
|
defaultState: [],
|
|
2669
2669
|
key: `${localStorageKey}-${filterDefinition === null || filterDefinition === void 0 ? void 0 : filterDefinition.filterKey}-free-text-filter-recent-searches`,
|
|
2670
2670
|
schema: zod.z.array(zod.z.string()),
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
|
|
3
3
|
import { FilterEvents, FilterHeader, DefaultCheckboxFilter, FilterResults, DefaultRadioFilter } from '@trackunit/filters-filter-bar';
|
|
4
|
-
import { useCurrentUser, useAnalytics, useErrorHandler } from '@trackunit/react-core-hooks';
|
|
4
|
+
import { useCurrentUser, useAnalytics, useLocalStorage, usePrevious, useErrorHandler } from '@trackunit/react-core-hooks';
|
|
5
5
|
import { FilterBody, RadioFilterItem } from '@trackunit/react-filter-components';
|
|
6
6
|
import { RadioGroup, RadioItem, Search } from '@trackunit/react-form-components';
|
|
7
7
|
import { useMemo, useState, useCallback, useRef, useEffect } from 'react';
|
|
@@ -9,7 +9,7 @@ import { useQuery } from '@apollo/client';
|
|
|
9
9
|
import { useActiveAssetFilters, useAssetQueryFilters } from '@trackunit/filters-graphql-hook';
|
|
10
10
|
import { ActivityIndicator } from '@trackunit/utilization-indicator';
|
|
11
11
|
import { geoJsonPolygonSchema, geoJsonPointSchema, geoJsonBboxSchema, getBboxFromGeoJsonPolygon, getPolygonFromBbox, getGeoJsonPolygonFromBoundingBox } from '@trackunit/geo-json-utils';
|
|
12
|
-
import { Tooltip, IconButton, Icon, Text, Button,
|
|
12
|
+
import { Tooltip, IconButton, Icon, Text, Button, useDebounce, useGeometry, Popover, PopoverTrigger, PopoverContent, MenuList, MenuItem } from '@trackunit/react-components';
|
|
13
13
|
import { nonNullable, objectValues, hourIntervals, enumFromValue, objectKeys } from '@trackunit/shared-utils';
|
|
14
14
|
import { titleCase, lowerCase } from 'string-ts';
|
|
15
15
|
import { z } from 'zod';
|