@trackunit/filters-asset-filter-definitions 1.3.37 → 1.3.43
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 +20 -20
- package/index.esm.js +20 -20
- package/package.json +17 -17
- package/src/shared/ClearItemButton.d.ts +3 -2
- package/src/shared/RecentSearchesFooter.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -1986,7 +1986,7 @@ const useActivityFilter = () => {
|
|
|
1986
1986
|
* A button to clear recent searches.
|
|
1987
1987
|
*
|
|
1988
1988
|
* @param {ClearItemButtonProps} props - The props for the ClearItemButton component
|
|
1989
|
-
* @returns {
|
|
1989
|
+
* @returns {ReactElement} ClearItemButton component
|
|
1990
1990
|
*/
|
|
1991
1991
|
const ClearItemButton = ({ onClick }) => {
|
|
1992
1992
|
const [t] = useTranslation();
|
|
@@ -1997,7 +1997,7 @@ const ClearItemButton = ({ onClick }) => {
|
|
|
1997
1997
|
* A footer component that displays a count of recent searches and a clear all button.
|
|
1998
1998
|
*
|
|
1999
1999
|
* @param {RecentSearchesFooterProps} props - The props for the ClearAllFooter component
|
|
2000
|
-
* @returns {
|
|
2000
|
+
* @returns {ReactElement} RecentSearchesFooter component
|
|
2001
2001
|
*/
|
|
2002
2002
|
const RecentSearchesFooter = ({ count, onClearAll }) => {
|
|
2003
2003
|
const [t] = useTranslation();
|
|
@@ -3071,25 +3071,25 @@ const SearchFilterInline = ({ filterBarActions, filterState, filterDefinition, l
|
|
|
3071
3071
|
});
|
|
3072
3072
|
filterDefinition?.filterKey && filterBarActions.setStringValue(filterDefinition.filterKey, value);
|
|
3073
3073
|
}, [filterDefinition?.filterKey, filterBarActions, logEvent, setRecentSearches]);
|
|
3074
|
-
return (jsxRuntime.jsxs(reactComponents.Popover, { activation: defaultActivation => ({ ...defaultActivation, keyboardHandlers: false }), dataTestId: dataTestId ? `${dataTestId}-popover` : undefined, placement: "bottom-start", children: [jsxRuntime.jsx(reactComponents.PopoverTrigger, { children: jsxRuntime.jsx(reactFormComponents.Search
|
|
3075
|
-
//TODO: [Buss] remove height restriction once baseinput sizes matches buttons
|
|
3076
|
-
, {
|
|
3074
|
+
return (jsxRuntime.jsxs(reactComponents.Popover, { activation: defaultActivation => ({ ...defaultActivation, keyboardHandlers: false }), dataTestId: dataTestId ? `${dataTestId}-popover` : undefined, placement: "bottom-start", children: [jsxRuntime.jsx(reactComponents.PopoverTrigger, { children: jsxRuntime.jsx("div", { "data-testid": "filters-menu-search-field-container", children: jsxRuntime.jsx(reactFormComponents.Search
|
|
3077
3075
|
//TODO: [Buss] remove height restriction once baseinput sizes matches buttons
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
e.
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3076
|
+
, {
|
|
3077
|
+
//TODO: [Buss] remove height restriction once baseinput sizes matches buttons
|
|
3078
|
+
className: tailwindMerge.twMerge(className, "h-7 min-w-32 max-w-72 shrink grow basis-32"), dataTestId: "filterbar-search", fieldSize: "small", onChange: e => {
|
|
3079
|
+
const parsedValue = zod.z.string().safeParse(e.target.value);
|
|
3080
|
+
parsedValue.success ? setSearchString(parsedValue.data) : setSearchString("");
|
|
3081
|
+
}, onClear: () => setSearchString(""), onKeyDown: e => {
|
|
3082
|
+
if (e.key === "Enter") {
|
|
3083
|
+
apply({ value: searchString });
|
|
3084
|
+
e.preventDefault();
|
|
3085
|
+
}
|
|
3086
|
+
},
|
|
3087
|
+
// Prevents submitting forms when pressing "Enter" in the input element
|
|
3088
|
+
onKeyUp: e => {
|
|
3089
|
+
if (e.key === "Enter") {
|
|
3090
|
+
e.preventDefault();
|
|
3091
|
+
}
|
|
3092
|
+
}, 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: () => {
|
|
3093
3093
|
apply({ value: option, wasPreviousSearch: true });
|
|
3094
3094
|
setRecentSearches(prev => {
|
|
3095
3095
|
const noDuplicatesRecent = prev.filter(recentSearch => recentSearch !== option);
|
package/index.esm.js
CHANGED
|
@@ -1984,7 +1984,7 @@ const useActivityFilter = () => {
|
|
|
1984
1984
|
* A button to clear recent searches.
|
|
1985
1985
|
*
|
|
1986
1986
|
* @param {ClearItemButtonProps} props - The props for the ClearItemButton component
|
|
1987
|
-
* @returns {
|
|
1987
|
+
* @returns {ReactElement} ClearItemButton component
|
|
1988
1988
|
*/
|
|
1989
1989
|
const ClearItemButton = ({ onClick }) => {
|
|
1990
1990
|
const [t] = useTranslation();
|
|
@@ -1995,7 +1995,7 @@ const ClearItemButton = ({ onClick }) => {
|
|
|
1995
1995
|
* A footer component that displays a count of recent searches and a clear all button.
|
|
1996
1996
|
*
|
|
1997
1997
|
* @param {RecentSearchesFooterProps} props - The props for the ClearAllFooter component
|
|
1998
|
-
* @returns {
|
|
1998
|
+
* @returns {ReactElement} RecentSearchesFooter component
|
|
1999
1999
|
*/
|
|
2000
2000
|
const RecentSearchesFooter = ({ count, onClearAll }) => {
|
|
2001
2001
|
const [t] = useTranslation();
|
|
@@ -3069,25 +3069,25 @@ const SearchFilterInline = ({ filterBarActions, filterState, filterDefinition, l
|
|
|
3069
3069
|
});
|
|
3070
3070
|
filterDefinition?.filterKey && filterBarActions.setStringValue(filterDefinition.filterKey, value);
|
|
3071
3071
|
}, [filterDefinition?.filterKey, filterBarActions, logEvent, setRecentSearches]);
|
|
3072
|
-
return (jsxs(Popover, { activation: defaultActivation => ({ ...defaultActivation, keyboardHandlers: false }), dataTestId: dataTestId ? `${dataTestId}-popover` : undefined, placement: "bottom-start", children: [jsx(PopoverTrigger, { children: jsx(Search
|
|
3073
|
-
//TODO: [Buss] remove height restriction once baseinput sizes matches buttons
|
|
3074
|
-
, {
|
|
3072
|
+
return (jsxs(Popover, { activation: defaultActivation => ({ ...defaultActivation, keyboardHandlers: false }), dataTestId: dataTestId ? `${dataTestId}-popover` : undefined, placement: "bottom-start", children: [jsx(PopoverTrigger, { children: jsx("div", { "data-testid": "filters-menu-search-field-container", children: jsx(Search
|
|
3075
3073
|
//TODO: [Buss] remove height restriction once baseinput sizes matches buttons
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
e.
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3074
|
+
, {
|
|
3075
|
+
//TODO: [Buss] remove height restriction once baseinput sizes matches buttons
|
|
3076
|
+
className: twMerge(className, "h-7 min-w-32 max-w-72 shrink grow basis-32"), dataTestId: "filterbar-search", fieldSize: "small", onChange: e => {
|
|
3077
|
+
const parsedValue = z.string().safeParse(e.target.value);
|
|
3078
|
+
parsedValue.success ? setSearchString(parsedValue.data) : setSearchString("");
|
|
3079
|
+
}, onClear: () => setSearchString(""), onKeyDown: e => {
|
|
3080
|
+
if (e.key === "Enter") {
|
|
3081
|
+
apply({ value: searchString });
|
|
3082
|
+
e.preventDefault();
|
|
3083
|
+
}
|
|
3084
|
+
},
|
|
3085
|
+
// Prevents submitting forms when pressing "Enter" in the input element
|
|
3086
|
+
onKeyUp: e => {
|
|
3087
|
+
if (e.key === "Enter") {
|
|
3088
|
+
e.preventDefault();
|
|
3089
|
+
}
|
|
3090
|
+
}, 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: () => {
|
|
3091
3091
|
apply({ value: option, wasPreviousSearch: true });
|
|
3092
3092
|
setRecentSearches(prev => {
|
|
3093
3093
|
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.3.
|
|
3
|
+
"version": "1.3.43",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@graphql-codegen/cli": "^5.0.3",
|
|
11
11
|
"@apollo/client": "3.10.4",
|
|
12
|
-
"react": "
|
|
12
|
+
"react": "19.0.0",
|
|
13
13
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
14
14
|
"graphql": "^16.10.0",
|
|
15
15
|
"zod": "3.22.4",
|
|
@@ -17,21 +17,21 @@
|
|
|
17
17
|
"@tanstack/react-router": "1.47.1",
|
|
18
18
|
"string-ts": "^2.0.0",
|
|
19
19
|
"tailwind-merge": "^2.0.0",
|
|
20
|
-
"@trackunit/iris-app-build-utilities": "1.3.
|
|
21
|
-
"@trackunit/filters-filter-bar": "1.3.
|
|
22
|
-
"@trackunit/react-core-hooks": "1.3.
|
|
23
|
-
"@trackunit/react-filter-components": "1.3.
|
|
24
|
-
"@trackunit/react-form-components": "1.3.
|
|
25
|
-
"@trackunit/filters-graphql-hook": "1.3.
|
|
26
|
-
"@trackunit/utilization-indicator": "1.3.
|
|
27
|
-
"@trackunit/geo-json-utils": "1.3.
|
|
28
|
-
"@trackunit/react-components": "1.4.
|
|
29
|
-
"@trackunit/shared-utils": "1.5.
|
|
30
|
-
"@trackunit/translations-machine-type": "1.3.
|
|
31
|
-
"@trackunit/criticality-indicator": "1.3.
|
|
32
|
-
"@trackunit/iris-app-api": "1.3.
|
|
33
|
-
"@trackunit/react-core-contexts-test": "1.3.
|
|
34
|
-
"@trackunit/i18n-library-translation": "1.3.
|
|
20
|
+
"@trackunit/iris-app-build-utilities": "1.3.27",
|
|
21
|
+
"@trackunit/filters-filter-bar": "1.3.39",
|
|
22
|
+
"@trackunit/react-core-hooks": "1.3.28",
|
|
23
|
+
"@trackunit/react-filter-components": "1.3.32",
|
|
24
|
+
"@trackunit/react-form-components": "1.3.32",
|
|
25
|
+
"@trackunit/filters-graphql-hook": "1.3.39",
|
|
26
|
+
"@trackunit/utilization-indicator": "1.3.28",
|
|
27
|
+
"@trackunit/geo-json-utils": "1.3.28",
|
|
28
|
+
"@trackunit/react-components": "1.4.27",
|
|
29
|
+
"@trackunit/shared-utils": "1.5.27",
|
|
30
|
+
"@trackunit/translations-machine-type": "1.3.29",
|
|
31
|
+
"@trackunit/criticality-indicator": "1.3.28",
|
|
32
|
+
"@trackunit/iris-app-api": "1.3.27",
|
|
33
|
+
"@trackunit/react-core-contexts-test": "1.3.28",
|
|
34
|
+
"@trackunit/i18n-library-translation": "1.3.28"
|
|
35
35
|
},
|
|
36
36
|
"module": "./index.esm.js",
|
|
37
37
|
"main": "./index.cjs.js",
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { MouseEvent } from "react";
|
|
1
2
|
type ClearItemButtonProps = {
|
|
2
|
-
onClick: (e:
|
|
3
|
+
onClick: (e: MouseEvent) => void;
|
|
3
4
|
};
|
|
4
5
|
/**
|
|
5
6
|
* A button to clear recent searches.
|
|
6
7
|
*
|
|
7
8
|
* @param {ClearItemButtonProps} props - The props for the ClearItemButton component
|
|
8
|
-
* @returns {
|
|
9
|
+
* @returns {ReactElement} ClearItemButton component
|
|
9
10
|
*/
|
|
10
11
|
export declare const ClearItemButton: ({ onClick }: ClearItemButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -6,7 +6,7 @@ type RecentSearchesFooterProps = {
|
|
|
6
6
|
* A footer component that displays a count of recent searches and a clear all button.
|
|
7
7
|
*
|
|
8
8
|
* @param {RecentSearchesFooterProps} props - The props for the ClearAllFooter component
|
|
9
|
-
* @returns {
|
|
9
|
+
* @returns {ReactElement} RecentSearchesFooter component
|
|
10
10
|
*/
|
|
11
11
|
export declare const RecentSearchesFooter: ({ count, onClearAll }: RecentSearchesFooterProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
12
|
export {};
|