@trackunit/filters-asset-filter-definitions 1.11.34 → 1.11.36
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 +2 -3
- package/index.esm.js +4 -5
- package/package.json +19 -19
package/index.cjs.js
CHANGED
|
@@ -3854,8 +3854,7 @@ const MAX_RECENT_SEARCHES = 20;
|
|
|
3854
3854
|
const SearchFilterInline = ({ filterBarActions, filterState, filterDefinition, localStorageKey, className, dataTestId, }) => {
|
|
3855
3855
|
const { logEvent } = reactCoreHooks.useAnalytics(filtersFilterBar.FilterEvents);
|
|
3856
3856
|
const [t] = useTranslation();
|
|
3857
|
-
const searchElementRef =
|
|
3858
|
-
const geometry = reactComponents.useGeometry(searchElementRef);
|
|
3857
|
+
const { geometry, ref: searchElementRef } = reactComponents.useMeasure();
|
|
3859
3858
|
const filterValue = filterDefinition?.filterKey ? String(filterState.values[filterDefinition.filterKey]) : undefined;
|
|
3860
3859
|
const [searchString, setSearchString] = react.useState(filterValue ?? "");
|
|
3861
3860
|
const previousFilterValue = reactCoreHooks.usePrevious(filterValue);
|
|
@@ -3917,7 +3916,7 @@ const SearchFilterInline = ({ filterBarActions, filterState, filterDefinition, l
|
|
|
3917
3916
|
if (e.key === "Enter") {
|
|
3918
3917
|
e.preventDefault();
|
|
3919
3918
|
}
|
|
3920
|
-
}, ref: searchElementRef, value: searchString }) }) }), jsxRuntime.jsx(reactComponents.PopoverContent, { children: jsxRuntime.jsx("div", { style: { minWidth: geometry
|
|
3919
|
+
}, ref: searchElementRef, value: searchString }) }) }), jsxRuntime.jsx(reactComponents.PopoverContent, { children: jsxRuntime.jsx("div", { style: { minWidth: geometry?.width }, children: jsxRuntime.jsx(reactComponents.MenuList, { className: "overflow-hidden", children: recentSearches.length > 0 ? (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(reactFilterComponents.FilterBody, { className: "max-w-none p-1", limitSize: true, children: jsxRuntime.jsx("ul", { className: "grid h-full gap-0.5", children: recentSearches.map((option, index) => (jsxRuntime.jsx(reactComponents.MenuItem, { className: "max-h-fit overflow-hidden py-1", id: "free-text-search-filter-inline", label: option, onClick: () => {
|
|
3921
3920
|
apply({ value: option, wasPreviousSearch: true });
|
|
3922
3921
|
setRecentSearches(prev => {
|
|
3923
3922
|
const noDuplicatesRecent = prev.filter(recentSearch => recentSearch !== option);
|
package/index.esm.js
CHANGED
|
@@ -4,13 +4,13 @@ import { gql } from '@apollo/client';
|
|
|
4
4
|
import { DefaultCheckboxFilter, FilterEvents, FilterHeader, FilterResults, HierarchicalCheckboxFilter, DefaultRadioFilter } from '@trackunit/filters-filter-bar';
|
|
5
5
|
import { useActiveAssetFilters, useAssetQueryFilters } from '@trackunit/filters-graphql-hook';
|
|
6
6
|
import { useQuery } from '@trackunit/react-graphql-hooks';
|
|
7
|
-
import { useMemo, useState, useCallback, useEffect
|
|
7
|
+
import { useMemo, useState, useCallback, useEffect } from 'react';
|
|
8
8
|
import { useAnalytics, useLocalStorage, usePrevious, useCurrentUser } from '@trackunit/react-core-hooks';
|
|
9
9
|
import { FilterBody, RadioFilterItem } from '@trackunit/react-filter-components';
|
|
10
10
|
import { RadioGroup, RadioItem, Search } from '@trackunit/react-form-components';
|
|
11
11
|
import { ActivityIndicator } from '@trackunit/utilization-indicator';
|
|
12
12
|
import { geoJsonPolygonSchema, geoJsonPointSchema, geoJsonMultiPolygonSchema, geoJsonBboxSchema, getBboxFromGeoJsonPolygon, getPolygonFromBbox } from '@trackunit/geo-json-utils';
|
|
13
|
-
import { Tooltip, IconButton, Icon, Text, Button, useDebounce, MenuItem,
|
|
13
|
+
import { Tooltip, IconButton, Icon, Text, Button, useDebounce, MenuItem, useMeasure, Popover, PopoverTrigger, PopoverContent, MenuList } from '@trackunit/react-components';
|
|
14
14
|
import { titleCase, lowerCase } from 'string-ts';
|
|
15
15
|
import { z } from 'zod';
|
|
16
16
|
import { objectValues, hourIntervals, enumFromValue } from '@trackunit/shared-utils';
|
|
@@ -3852,8 +3852,7 @@ const MAX_RECENT_SEARCHES = 20;
|
|
|
3852
3852
|
const SearchFilterInline = ({ filterBarActions, filterState, filterDefinition, localStorageKey, className, dataTestId, }) => {
|
|
3853
3853
|
const { logEvent } = useAnalytics(FilterEvents);
|
|
3854
3854
|
const [t] = useTranslation();
|
|
3855
|
-
const searchElementRef =
|
|
3856
|
-
const geometry = useGeometry(searchElementRef);
|
|
3855
|
+
const { geometry, ref: searchElementRef } = useMeasure();
|
|
3857
3856
|
const filterValue = filterDefinition?.filterKey ? String(filterState.values[filterDefinition.filterKey]) : undefined;
|
|
3858
3857
|
const [searchString, setSearchString] = useState(filterValue ?? "");
|
|
3859
3858
|
const previousFilterValue = usePrevious(filterValue);
|
|
@@ -3915,7 +3914,7 @@ const SearchFilterInline = ({ filterBarActions, filterState, filterDefinition, l
|
|
|
3915
3914
|
if (e.key === "Enter") {
|
|
3916
3915
|
e.preventDefault();
|
|
3917
3916
|
}
|
|
3918
|
-
}, ref: searchElementRef, value: searchString }) }) }), jsx(PopoverContent, { children: jsx("div", { style: { minWidth: geometry
|
|
3917
|
+
}, ref: searchElementRef, value: searchString }) }) }), jsx(PopoverContent, { children: jsx("div", { style: { minWidth: geometry?.width }, children: jsx(MenuList, { className: "overflow-hidden", children: recentSearches.length > 0 ? (jsxs("div", { children: [jsx(FilterBody, { className: "max-w-none p-1", limitSize: true, children: jsx("ul", { className: "grid h-full gap-0.5", children: recentSearches.map((option, index) => (jsx(MenuItem, { className: "max-h-fit overflow-hidden py-1", id: "free-text-search-filter-inline", label: option, onClick: () => {
|
|
3919
3918
|
apply({ value: option, wasPreviousSearch: true });
|
|
3920
3919
|
setRecentSearches(prev => {
|
|
3921
3920
|
const noDuplicatesRecent = prev.filter(recentSearch => recentSearch !== option);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/filters-asset-filter-definitions",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.36",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -16,24 +16,24 @@
|
|
|
16
16
|
"jest-fetch-mock": "^3.0.3",
|
|
17
17
|
"string-ts": "^2.0.0",
|
|
18
18
|
"tailwind-merge": "^2.0.0",
|
|
19
|
-
"@trackunit/iris-app-build-utilities": "1.7.
|
|
20
|
-
"@trackunit/filters-filter-bar": "1.8.
|
|
21
|
-
"@trackunit/react-core-hooks": "1.7.
|
|
22
|
-
"@trackunit/react-filter-components": "1.7.
|
|
23
|
-
"@trackunit/react-form-components": "1.8.
|
|
24
|
-
"@trackunit/filters-graphql-hook": "1.11.
|
|
25
|
-
"@trackunit/utilization-indicator": "1.7.
|
|
26
|
-
"@trackunit/geo-json-utils": "1.7.
|
|
27
|
-
"@trackunit/react-components": "1.10.
|
|
28
|
-
"@trackunit/shared-utils": "1.9.
|
|
29
|
-
"@trackunit/translations-machine-type": "1.7.
|
|
30
|
-
"@trackunit/criticality-indicator": "1.7.
|
|
31
|
-
"@trackunit/iris-app-api": "1.7.
|
|
32
|
-
"@trackunit/react-core-contexts-test": "1.7.
|
|
33
|
-
"@trackunit/i18n-library-translation": "1.7.
|
|
34
|
-
"@trackunit/react-core-contexts-api": "1.8.
|
|
35
|
-
"@trackunit/react-test-setup": "1.4.
|
|
36
|
-
"@trackunit/react-graphql-hooks": "1.7.
|
|
19
|
+
"@trackunit/iris-app-build-utilities": "1.7.53",
|
|
20
|
+
"@trackunit/filters-filter-bar": "1.8.88",
|
|
21
|
+
"@trackunit/react-core-hooks": "1.7.60",
|
|
22
|
+
"@trackunit/react-filter-components": "1.7.86",
|
|
23
|
+
"@trackunit/react-form-components": "1.8.83",
|
|
24
|
+
"@trackunit/filters-graphql-hook": "1.11.31",
|
|
25
|
+
"@trackunit/utilization-indicator": "1.7.79",
|
|
26
|
+
"@trackunit/geo-json-utils": "1.7.51",
|
|
27
|
+
"@trackunit/react-components": "1.10.19",
|
|
28
|
+
"@trackunit/shared-utils": "1.9.51",
|
|
29
|
+
"@trackunit/translations-machine-type": "1.7.73",
|
|
30
|
+
"@trackunit/criticality-indicator": "1.7.79",
|
|
31
|
+
"@trackunit/iris-app-api": "1.7.53",
|
|
32
|
+
"@trackunit/react-core-contexts-test": "1.7.60",
|
|
33
|
+
"@trackunit/i18n-library-translation": "1.7.63",
|
|
34
|
+
"@trackunit/react-core-contexts-api": "1.8.56",
|
|
35
|
+
"@trackunit/react-test-setup": "1.4.51",
|
|
36
|
+
"@trackunit/react-graphql-hooks": "1.7.80"
|
|
37
37
|
},
|
|
38
38
|
"module": "./index.esm.js",
|
|
39
39
|
"main": "./index.cjs.js",
|