@trackunit/filters-asset-filter-definitions 2.25.22 → 2.26.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/index.cjs.js CHANGED
@@ -22,6 +22,7 @@ var criticalityIndicator = require('@trackunit/criticality-indicator');
22
22
  var dateAndTimeUtils = require('@trackunit/date-and-time-utils');
23
23
  var reactDateAndTimeHooks = require('@trackunit/react-date-and-time-hooks');
24
24
  var translationsDevice = require('@trackunit/translations-device');
25
+ var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
25
26
  var tailwindMerge = require('tailwind-merge');
26
27
  var irisAppApi = require('@trackunit/iris-app-api');
27
28
 
@@ -4805,6 +4806,7 @@ const placeSchema = areaFilterInternalSchema.extend({
4805
4806
  * @param {FilterViewProps<AreaFilterGeoJsonGeometry>} props - The props for the component.
4806
4807
  * @returns {ReactElement} The rendered AreaView component.
4807
4808
  */
4809
+ // eslint-disable-next-line @trackunit/require-component-prop-contracts -- renders a fragment (header + body) with no DOM root to attach these props to; fix in GLU-2699
4808
4810
  const AreaView = (props) => {
4809
4811
  const [t] = useTranslation();
4810
4812
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(filtersFilterBar.FilterHeader, { ...props.filterDefinition, ...props.filterBarActions, filterHasChanges: props.filterBarActions.appliedFilterKeys().includes(props.filterDefinition.filterKey) }), jsxRuntime.jsx(reactFilterComponents.FilterBody, { limitSize: true, children: jsxRuntime.jsx("p", { className: "p-2", children: `${t("assetFilters.boundingBoxFilter.value")}` }) })] }));
@@ -4988,6 +4990,7 @@ const usePlacesSearch = ({ localStorageKey = SHARED_LOCATIONS_LOCAL_STORAGE_KEY,
4988
4990
  * filter definition, state, and actions.
4989
4991
  * @returns {ReactElement} A component rendering the Asset IDs filter view.
4990
4992
  */
4993
+ // eslint-disable-next-line @trackunit/require-component-prop-contracts -- renders a fragment (header + body) with no DOM root to attach these props to; fix in GLU-2699
4991
4994
  const AssetIdsFiltersView = (props) => {
4992
4995
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(filtersFilterBar.FilterHeader, { ...props.filterDefinition, ...props.filterBarActions, filterHasChanges: props.filterBarActions.appliedFilterKeys().includes(props.filterDefinition.filterKey) }), jsxRuntime.jsx("span", {})] }));
4993
4996
  };
@@ -7194,12 +7197,12 @@ const ClearItemButton = ({ onClick }) => {
7194
7197
  * @param {RecentSearchesFooterProps} props - The props for the ClearAllFooter component
7195
7198
  * @returns {ReactElement} RecentSearchesFooter component
7196
7199
  */
7197
- const RecentSearchesFooter = ({ count, onClickClearAll }) => {
7200
+ const RecentSearchesFooter = ({ count, onClickClearAll, className, "data-testid": dataTestId, style, ref, }) => {
7198
7201
  const [t] = useTranslation();
7199
7202
  if (count === 0) {
7200
7203
  return null;
7201
7204
  }
7202
- return (jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between gap-x-2 border-t-2 border-neutral-300 px-2 py-0.5", children: [jsxRuntime.jsx(reactComponents.Text, { className: "py-0.5", size: "small", subtle: true, children: t("filters.shared.recentSearches") }), count > 1 ? (jsxRuntime.jsx(reactComponents.Button, { onClick: onClickClearAll, size: "small", variant: "ghost", children: t("filters.shared.clearAll") })) : null] }));
7205
+ return (jsxRuntime.jsxs("div", { className: cssClassVarianceUtilities.cx("flex items-baseline justify-between gap-x-2 border-t-2 border-neutral-300 px-2 py-0.5", className), "data-testid": dataTestId, ref: ref, style: style, children: [jsxRuntime.jsx(reactComponents.Text, { className: "py-0.5", size: "small", subtle: true, children: t("filters.shared.recentSearches") }), count > 1 ? (jsxRuntime.jsx(reactComponents.Button, { onClick: onClickClearAll, size: "small", variant: "ghost", children: t("filters.shared.clearAll") })) : null] }));
7203
7206
  };
7204
7207
 
7205
7208
  const MAX_RECENT_SEARCHES$1 = 20;
@@ -7231,6 +7234,7 @@ const useFreeTextRecentSearches = ({ recentSearches, setRecentSearches, }) => {
7231
7234
  * @param {FreeTextRecentSearchesFilterViewProps<FilterBarDefinition>} props - The props for the component.
7232
7235
  * @returns {Element} The rendered component.
7233
7236
  */
7237
+ // eslint-disable-next-line @trackunit/require-component-prop-contracts -- renders a fragment (header + body) with no DOM root to attach these props to; fix in GLU-2699
7234
7238
  const FreeTextRecentSearchesFilterView = ({ filterBarActions, filterState, filterDefinition, localStorageKey, searchPlaceholder, }) => {
7235
7239
  const [t] = useTranslation();
7236
7240
  const filterValue = filterDefinition?.filterKey ? String(filterState.values[filterDefinition.filterKey]) : undefined;
@@ -7852,6 +7856,7 @@ const MAX_RECENT_SEARCHES = 20;
7852
7856
  /**
7853
7857
  *
7854
7858
  */
7859
+ // eslint-disable-next-line @trackunit/require-component-prop-contracts -- renders a Popover with no single DOM root to attach these props to; fix in GLU-2699
7855
7860
  const SearchFilterInline = ({ filterBarActions, filterState, filterDefinition, localStorageKey, className, "data-testid": dataTestId, }) => {
7856
7861
  const { logEvent } = reactCoreHooks.useAnalytics(filtersFilterBar.FilterEvents);
7857
7862
  const [t] = useTranslation();
package/index.esm.js CHANGED
@@ -20,6 +20,7 @@ import { CriticalityIndicator } from '@trackunit/criticality-indicator';
20
20
  import { parseCalendarDate, toDateUtil } from '@trackunit/date-and-time-utils';
21
21
  import { useDateAndTime, useTimezone } from '@trackunit/react-date-and-time-hooks';
22
22
  import { useDeviceTypeTranslations } from '@trackunit/translations-device';
23
+ import { cx } from '@trackunit/css-class-variance-utilities';
23
24
  import { twMerge } from 'tailwind-merge';
24
25
  import { accountScope } from '@trackunit/iris-app-api';
25
26
 
@@ -4803,6 +4804,7 @@ const placeSchema = areaFilterInternalSchema.extend({
4803
4804
  * @param {FilterViewProps<AreaFilterGeoJsonGeometry>} props - The props for the component.
4804
4805
  * @returns {ReactElement} The rendered AreaView component.
4805
4806
  */
4807
+ // eslint-disable-next-line @trackunit/require-component-prop-contracts -- renders a fragment (header + body) with no DOM root to attach these props to; fix in GLU-2699
4806
4808
  const AreaView = (props) => {
4807
4809
  const [t] = useTranslation();
4808
4810
  return (jsxs(Fragment, { children: [jsx(FilterHeader, { ...props.filterDefinition, ...props.filterBarActions, filterHasChanges: props.filterBarActions.appliedFilterKeys().includes(props.filterDefinition.filterKey) }), jsx(FilterBody, { limitSize: true, children: jsx("p", { className: "p-2", children: `${t("assetFilters.boundingBoxFilter.value")}` }) })] }));
@@ -4986,6 +4988,7 @@ const usePlacesSearch = ({ localStorageKey = SHARED_LOCATIONS_LOCAL_STORAGE_KEY,
4986
4988
  * filter definition, state, and actions.
4987
4989
  * @returns {ReactElement} A component rendering the Asset IDs filter view.
4988
4990
  */
4991
+ // eslint-disable-next-line @trackunit/require-component-prop-contracts -- renders a fragment (header + body) with no DOM root to attach these props to; fix in GLU-2699
4989
4992
  const AssetIdsFiltersView = (props) => {
4990
4993
  return (jsxs(Fragment, { children: [jsx(FilterHeader, { ...props.filterDefinition, ...props.filterBarActions, filterHasChanges: props.filterBarActions.appliedFilterKeys().includes(props.filterDefinition.filterKey) }), jsx("span", {})] }));
4991
4994
  };
@@ -7192,12 +7195,12 @@ const ClearItemButton = ({ onClick }) => {
7192
7195
  * @param {RecentSearchesFooterProps} props - The props for the ClearAllFooter component
7193
7196
  * @returns {ReactElement} RecentSearchesFooter component
7194
7197
  */
7195
- const RecentSearchesFooter = ({ count, onClickClearAll }) => {
7198
+ const RecentSearchesFooter = ({ count, onClickClearAll, className, "data-testid": dataTestId, style, ref, }) => {
7196
7199
  const [t] = useTranslation();
7197
7200
  if (count === 0) {
7198
7201
  return null;
7199
7202
  }
7200
- return (jsxs("div", { className: "flex items-baseline justify-between gap-x-2 border-t-2 border-neutral-300 px-2 py-0.5", children: [jsx(Text, { className: "py-0.5", size: "small", subtle: true, children: t("filters.shared.recentSearches") }), count > 1 ? (jsx(Button, { onClick: onClickClearAll, size: "small", variant: "ghost", children: t("filters.shared.clearAll") })) : null] }));
7203
+ return (jsxs("div", { className: cx("flex items-baseline justify-between gap-x-2 border-t-2 border-neutral-300 px-2 py-0.5", className), "data-testid": dataTestId, ref: ref, style: style, children: [jsx(Text, { className: "py-0.5", size: "small", subtle: true, children: t("filters.shared.recentSearches") }), count > 1 ? (jsx(Button, { onClick: onClickClearAll, size: "small", variant: "ghost", children: t("filters.shared.clearAll") })) : null] }));
7201
7204
  };
7202
7205
 
7203
7206
  const MAX_RECENT_SEARCHES$1 = 20;
@@ -7229,6 +7232,7 @@ const useFreeTextRecentSearches = ({ recentSearches, setRecentSearches, }) => {
7229
7232
  * @param {FreeTextRecentSearchesFilterViewProps<FilterBarDefinition>} props - The props for the component.
7230
7233
  * @returns {Element} The rendered component.
7231
7234
  */
7235
+ // eslint-disable-next-line @trackunit/require-component-prop-contracts -- renders a fragment (header + body) with no DOM root to attach these props to; fix in GLU-2699
7232
7236
  const FreeTextRecentSearchesFilterView = ({ filterBarActions, filterState, filterDefinition, localStorageKey, searchPlaceholder, }) => {
7233
7237
  const [t] = useTranslation();
7234
7238
  const filterValue = filterDefinition?.filterKey ? String(filterState.values[filterDefinition.filterKey]) : undefined;
@@ -7850,6 +7854,7 @@ const MAX_RECENT_SEARCHES = 20;
7850
7854
  /**
7851
7855
  *
7852
7856
  */
7857
+ // eslint-disable-next-line @trackunit/require-component-prop-contracts -- renders a Popover with no single DOM root to attach these props to; fix in GLU-2699
7853
7858
  const SearchFilterInline = ({ filterBarActions, filterState, filterDefinition, localStorageKey, className, "data-testid": dataTestId, }) => {
7854
7859
  const { logEvent } = useAnalytics(FilterEvents);
7855
7860
  const [t] = useTranslation();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/filters-asset-filter-definitions",
3
- "version": "2.25.22",
3
+ "version": "2.26.0",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -12,26 +12,27 @@
12
12
  "zod": "^3.25.76",
13
13
  "string-ts": "^2.0.0",
14
14
  "tailwind-merge": "^2.0.0",
15
- "@trackunit/iris-app-build-utilities": "2.7.10",
16
- "@trackunit/date-and-time-utils": "1.17.9",
17
- "@trackunit/filters-filter-bar": "2.10.17",
18
- "@trackunit/react-core-hooks": "1.25.10",
19
- "@trackunit/react-date-and-time-hooks": "2.10.15",
20
- "@trackunit/react-filter-components": "2.10.16",
21
- "@trackunit/react-form-components": "2.10.16",
22
- "@trackunit/filters-graphql-hook": "2.24.19",
23
- "@trackunit/utilization-indicator": "2.10.15",
24
- "@trackunit/geo-json-utils": "1.18.9",
25
- "@trackunit/react-components": "3.8.9",
26
- "@trackunit/shared-utils": "1.19.9",
27
- "@trackunit/translations-machine-type": "2.8.13",
28
- "@trackunit/criticality-indicator": "2.10.15",
29
- "@trackunit/iris-app-api": "2.9.9",
30
- "@trackunit/react-core-contexts-test": "1.22.10",
31
- "@trackunit/i18n-library-translation": "2.8.10",
32
- "@trackunit/iris-app-runtime-core-api": "1.21.9",
33
- "@trackunit/react-graphql-hooks": "2.10.15",
34
- "@trackunit/translations-device": "1.23.18"
15
+ "@trackunit/iris-app-build-utilities": "2.8.0",
16
+ "@trackunit/css-class-variance-utilities": "2.4.0",
17
+ "@trackunit/date-and-time-utils": "1.18.0",
18
+ "@trackunit/filters-filter-bar": "2.11.0",
19
+ "@trackunit/react-core-hooks": "1.26.0",
20
+ "@trackunit/react-date-and-time-hooks": "2.11.0",
21
+ "@trackunit/react-filter-components": "2.11.0",
22
+ "@trackunit/react-form-components": "2.11.0",
23
+ "@trackunit/filters-graphql-hook": "2.25.0",
24
+ "@trackunit/utilization-indicator": "2.11.0",
25
+ "@trackunit/geo-json-utils": "1.19.0",
26
+ "@trackunit/react-components": "3.9.0",
27
+ "@trackunit/shared-utils": "1.20.0",
28
+ "@trackunit/translations-machine-type": "2.9.0",
29
+ "@trackunit/criticality-indicator": "2.11.0",
30
+ "@trackunit/iris-app-api": "2.10.0",
31
+ "@trackunit/react-core-contexts-test": "1.23.0",
32
+ "@trackunit/i18n-library-translation": "2.9.0",
33
+ "@trackunit/iris-app-runtime-core-api": "1.22.0",
34
+ "@trackunit/react-graphql-hooks": "2.11.0",
35
+ "@trackunit/translations-device": "1.24.0"
35
36
  },
36
37
  "peerDependencies": {
37
38
  "@apollo/client": "^3.13.8",
@@ -1,5 +1,6 @@
1
+ import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
1
2
  import { MouseEventHandler } from "react";
2
- type RecentSearchesFooterProps = {
3
+ type RecentSearchesFooterProps = CommonProps & Styleable & Refable<HTMLDivElement> & {
3
4
  onClickClearAll: MouseEventHandler<HTMLElement>;
4
5
  count: number;
5
6
  };
@@ -9,5 +10,5 @@ type RecentSearchesFooterProps = {
9
10
  * @param {RecentSearchesFooterProps} props - The props for the ClearAllFooter component
10
11
  * @returns {ReactElement} RecentSearchesFooter component
11
12
  */
12
- export declare const RecentSearchesFooter: ({ count, onClickClearAll }: RecentSearchesFooterProps) => import("react").JSX.Element | null;
13
+ export declare const RecentSearchesFooter: ({ count, onClickClearAll, className, "data-testid": dataTestId, style, ref, }: RecentSearchesFooterProps) => import("react").JSX.Element | null;
13
14
  export {};