@trackunit/filters-asset-filter-definitions 1.5.122 → 1.5.125

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
@@ -2709,13 +2709,14 @@ const CustomerIdsFilterView = (props) => {
2709
2709
  return (jsxRuntime.jsx(filtersFilterBar.HierarchicalCheckboxFilter, { cascadeSelection: true, customSearch: {
2710
2710
  value: searchText,
2711
2711
  onChange: setSearchText,
2712
- }, filterBarActions: props.filterBarActions, filterDefinition: valueNameArrayFilterDefinition, filterState: props.filterState, loading: loading, options: hierarchicalOptions, setValue: props.setValue, value: props.value }));
2712
+ }, filterBarActions: props.filterBarActions, filterDefinition: valueNameArrayFilterDefinition, filterState: props.filterState, loading: loading, options: hierarchicalOptions, setValue: props.setValue, showCount: props.hasCount, value: props.value }));
2713
2713
  };
2714
2714
  /**
2715
2715
  * Custom hook to create and configure a customer IDs filter definition.
2716
2716
  */
2717
- const useCustomerIdsFilter = ({ showInFilterBar, defaultValue } = {
2717
+ const useCustomerIdsFilter = ({ showInFilterBar, defaultValue, hasCount, persistValue } = {
2718
2718
  showInFilterBar: () => true,
2719
+ hasCount: true,
2719
2720
  }) => {
2720
2721
  const [t] = useTranslation();
2721
2722
  const result = react.useMemo(() => {
@@ -2726,9 +2727,10 @@ const useCustomerIdsFilter = ({ showInFilterBar, defaultValue } = {
2726
2727
  group: "CUSTOMERS",
2727
2728
  title: t("fleetlist.column.customerIds"),
2728
2729
  showInFilterBar,
2729
- component: props => jsxRuntime.jsx(CustomerIdsFilterView, { ...props }),
2730
+ persistValue,
2731
+ component: props => jsxRuntime.jsx(CustomerIdsFilterView, { ...props, hasCount: hasCount }),
2730
2732
  };
2731
- }, [showInFilterBar, defaultValue, t]);
2733
+ }, [showInFilterBar, defaultValue, t, hasCount, persistValue]);
2732
2734
  return result;
2733
2735
  };
2734
2736
 
@@ -2803,18 +2805,18 @@ const GroupIdsFilterView = (props) => {
2803
2805
  const options = react.useMemo(() => {
2804
2806
  const result = data?.assetSummary?.groups?.summary.map(edge => ({
2805
2807
  key: edge.group?.groupId || "unknown",
2806
- count: edge.count || 0,
2808
+ count: props.hasCount ? edge.count || 0 : undefined,
2807
2809
  label: edge.group?.name || "Unknown",
2808
2810
  })) ?? [];
2809
2811
  if (data?.assetSummary?.groups?.missing && data.assetSummary.groups.missing > 0) {
2810
2812
  result.push({
2811
2813
  key: "UNDEFINED",
2812
- count: data.assetSummary.groups.missing,
2814
+ count: props.hasCount ? data.assetSummary.groups.missing : undefined,
2813
2815
  label: "Missing group",
2814
2816
  });
2815
2817
  }
2816
2818
  return result;
2817
- }, [data?.assetSummary?.groups]);
2819
+ }, [data?.assetSummary?.groups, props.hasCount]);
2818
2820
  react.useEffect(() => {
2819
2821
  setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$6);
2820
2822
  }, [options]);
@@ -2825,7 +2827,7 @@ const GroupIdsFilterView = (props) => {
2825
2827
  *
2826
2828
  * @returns {ValueNameArrayFilterDefinition} GroupIds filter definition
2827
2829
  */
2828
- const useGroupIdsFilter = () => {
2830
+ const useGroupIdsFilter = ({ hasCount } = { hasCount: true }) => {
2829
2831
  const [t] = useTranslation();
2830
2832
  const result = react.useMemo(() => {
2831
2833
  return {
@@ -2833,9 +2835,9 @@ const useGroupIdsFilter = () => {
2833
2835
  type: "valueNameArray",
2834
2836
  group: "OTHER",
2835
2837
  title: t("fleetlist.column.groupIds"),
2836
- component: props => jsxRuntime.jsx(GroupIdsFilterView, { ...props }),
2838
+ component: props => jsxRuntime.jsx(GroupIdsFilterView, { ...props, hasCount: hasCount }),
2837
2839
  };
2838
- }, [t]);
2840
+ }, [t, hasCount]);
2839
2841
  return result;
2840
2842
  };
2841
2843
 
@@ -3560,11 +3562,11 @@ const SiteIdsFilterView = (props) => {
3560
3562
  const options = react.useMemo(() => {
3561
3563
  const result = data?.assetSummary?.sites?.summary.map(siteEdge => ({
3562
3564
  key: siteEdge.site?.siteId || "unknown",
3563
- count: siteEdge.count || 0,
3565
+ count: props.hasCount ? siteEdge.count || 0 : undefined,
3564
3566
  label: siteEdge.site?.name || "Unknown",
3565
3567
  })) ?? [];
3566
3568
  return result;
3567
- }, [data?.assetSummary?.sites?.summary]);
3569
+ }, [data?.assetSummary?.sites?.summary, props.hasCount]);
3568
3570
  react.useEffect(() => {
3569
3571
  setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$1);
3570
3572
  }, [options]);
@@ -3573,9 +3575,10 @@ const SiteIdsFilterView = (props) => {
3573
3575
  /**
3574
3576
  *
3575
3577
  */
3576
- const useSiteIdsFilter = ({ showInFilterBar, defaultValue, persistValue } = {
3578
+ const useSiteIdsFilter = ({ showInFilterBar, defaultValue, persistValue, hasCount } = {
3577
3579
  showInFilterBar: () => true,
3578
3580
  persistValue: true,
3581
+ hasCount: true,
3579
3582
  }) => {
3580
3583
  const [t] = useTranslation();
3581
3584
  const result = react.useMemo(() => {
@@ -3587,9 +3590,9 @@ const useSiteIdsFilter = ({ showInFilterBar, defaultValue, persistValue } = {
3587
3590
  title: t("fleetlist.column.siteIds"),
3588
3591
  showInFilterBar,
3589
3592
  persistValue,
3590
- component: props => jsxRuntime.jsx(SiteIdsFilterView, { ...props }),
3593
+ component: props => jsxRuntime.jsx(SiteIdsFilterView, { ...props, hasCount: hasCount }),
3591
3594
  };
3592
- }, [showInFilterBar, defaultValue, t, persistValue]);
3595
+ }, [showInFilterBar, defaultValue, t, persistValue, hasCount]);
3593
3596
  return result;
3594
3597
  };
3595
3598
 
package/index.esm.js CHANGED
@@ -2707,13 +2707,14 @@ const CustomerIdsFilterView = (props) => {
2707
2707
  return (jsx(HierarchicalCheckboxFilter, { cascadeSelection: true, customSearch: {
2708
2708
  value: searchText,
2709
2709
  onChange: setSearchText,
2710
- }, filterBarActions: props.filterBarActions, filterDefinition: valueNameArrayFilterDefinition, filterState: props.filterState, loading: loading, options: hierarchicalOptions, setValue: props.setValue, value: props.value }));
2710
+ }, filterBarActions: props.filterBarActions, filterDefinition: valueNameArrayFilterDefinition, filterState: props.filterState, loading: loading, options: hierarchicalOptions, setValue: props.setValue, showCount: props.hasCount, value: props.value }));
2711
2711
  };
2712
2712
  /**
2713
2713
  * Custom hook to create and configure a customer IDs filter definition.
2714
2714
  */
2715
- const useCustomerIdsFilter = ({ showInFilterBar, defaultValue } = {
2715
+ const useCustomerIdsFilter = ({ showInFilterBar, defaultValue, hasCount, persistValue } = {
2716
2716
  showInFilterBar: () => true,
2717
+ hasCount: true,
2717
2718
  }) => {
2718
2719
  const [t] = useTranslation();
2719
2720
  const result = useMemo(() => {
@@ -2724,9 +2725,10 @@ const useCustomerIdsFilter = ({ showInFilterBar, defaultValue } = {
2724
2725
  group: "CUSTOMERS",
2725
2726
  title: t("fleetlist.column.customerIds"),
2726
2727
  showInFilterBar,
2727
- component: props => jsx(CustomerIdsFilterView, { ...props }),
2728
+ persistValue,
2729
+ component: props => jsx(CustomerIdsFilterView, { ...props, hasCount: hasCount }),
2728
2730
  };
2729
- }, [showInFilterBar, defaultValue, t]);
2731
+ }, [showInFilterBar, defaultValue, t, hasCount, persistValue]);
2730
2732
  return result;
2731
2733
  };
2732
2734
 
@@ -2801,18 +2803,18 @@ const GroupIdsFilterView = (props) => {
2801
2803
  const options = useMemo(() => {
2802
2804
  const result = data?.assetSummary?.groups?.summary.map(edge => ({
2803
2805
  key: edge.group?.groupId || "unknown",
2804
- count: edge.count || 0,
2806
+ count: props.hasCount ? edge.count || 0 : undefined,
2805
2807
  label: edge.group?.name || "Unknown",
2806
2808
  })) ?? [];
2807
2809
  if (data?.assetSummary?.groups?.missing && data.assetSummary.groups.missing > 0) {
2808
2810
  result.push({
2809
2811
  key: "UNDEFINED",
2810
- count: data.assetSummary.groups.missing,
2812
+ count: props.hasCount ? data.assetSummary.groups.missing : undefined,
2811
2813
  label: "Missing group",
2812
2814
  });
2813
2815
  }
2814
2816
  return result;
2815
- }, [data?.assetSummary?.groups]);
2817
+ }, [data?.assetSummary?.groups, props.hasCount]);
2816
2818
  useEffect(() => {
2817
2819
  setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$6);
2818
2820
  }, [options]);
@@ -2823,7 +2825,7 @@ const GroupIdsFilterView = (props) => {
2823
2825
  *
2824
2826
  * @returns {ValueNameArrayFilterDefinition} GroupIds filter definition
2825
2827
  */
2826
- const useGroupIdsFilter = () => {
2828
+ const useGroupIdsFilter = ({ hasCount } = { hasCount: true }) => {
2827
2829
  const [t] = useTranslation();
2828
2830
  const result = useMemo(() => {
2829
2831
  return {
@@ -2831,9 +2833,9 @@ const useGroupIdsFilter = () => {
2831
2833
  type: "valueNameArray",
2832
2834
  group: "OTHER",
2833
2835
  title: t("fleetlist.column.groupIds"),
2834
- component: props => jsx(GroupIdsFilterView, { ...props }),
2836
+ component: props => jsx(GroupIdsFilterView, { ...props, hasCount: hasCount }),
2835
2837
  };
2836
- }, [t]);
2838
+ }, [t, hasCount]);
2837
2839
  return result;
2838
2840
  };
2839
2841
 
@@ -3558,11 +3560,11 @@ const SiteIdsFilterView = (props) => {
3558
3560
  const options = useMemo(() => {
3559
3561
  const result = data?.assetSummary?.sites?.summary.map(siteEdge => ({
3560
3562
  key: siteEdge.site?.siteId || "unknown",
3561
- count: siteEdge.count || 0,
3563
+ count: props.hasCount ? siteEdge.count || 0 : undefined,
3562
3564
  label: siteEdge.site?.name || "Unknown",
3563
3565
  })) ?? [];
3564
3566
  return result;
3565
- }, [data?.assetSummary?.sites?.summary]);
3567
+ }, [data?.assetSummary?.sites?.summary, props.hasCount]);
3566
3568
  useEffect(() => {
3567
3569
  setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$1);
3568
3570
  }, [options]);
@@ -3571,9 +3573,10 @@ const SiteIdsFilterView = (props) => {
3571
3573
  /**
3572
3574
  *
3573
3575
  */
3574
- const useSiteIdsFilter = ({ showInFilterBar, defaultValue, persistValue } = {
3576
+ const useSiteIdsFilter = ({ showInFilterBar, defaultValue, persistValue, hasCount } = {
3575
3577
  showInFilterBar: () => true,
3576
3578
  persistValue: true,
3579
+ hasCount: true,
3577
3580
  }) => {
3578
3581
  const [t] = useTranslation();
3579
3582
  const result = useMemo(() => {
@@ -3585,9 +3588,9 @@ const useSiteIdsFilter = ({ showInFilterBar, defaultValue, persistValue } = {
3585
3588
  title: t("fleetlist.column.siteIds"),
3586
3589
  showInFilterBar,
3587
3590
  persistValue,
3588
- component: props => jsx(SiteIdsFilterView, { ...props }),
3591
+ component: props => jsx(SiteIdsFilterView, { ...props, hasCount: hasCount }),
3589
3592
  };
3590
- }, [showInFilterBar, defaultValue, t, persistValue]);
3593
+ }, [showInFilterBar, defaultValue, t, persistValue, hasCount]);
3591
3594
  return result;
3592
3595
  };
3593
3596
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/filters-asset-filter-definitions",
3
- "version": "1.5.122",
3
+ "version": "1.5.125",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -17,23 +17,23 @@
17
17
  "@tanstack/react-router": "1.114.29",
18
18
  "string-ts": "^2.0.0",
19
19
  "tailwind-merge": "^2.0.0",
20
- "@trackunit/iris-app-build-utilities": "1.3.150",
21
- "@trackunit/filters-filter-bar": "1.3.242",
22
- "@trackunit/react-core-hooks": "1.3.156",
23
- "@trackunit/react-filter-components": "1.3.196",
24
- "@trackunit/react-form-components": "1.3.198",
25
- "@trackunit/filters-graphql-hook": "1.5.116",
26
- "@trackunit/utilization-indicator": "1.3.192",
27
- "@trackunit/geo-json-utils": "1.3.140",
28
- "@trackunit/react-components": "1.4.173",
29
- "@trackunit/shared-utils": "1.5.142",
30
- "@trackunit/translations-machine-type": "1.3.165",
31
- "@trackunit/criticality-indicator": "1.3.187",
32
- "@trackunit/iris-app-api": "1.3.150",
33
- "@trackunit/react-core-contexts-test": "1.3.157",
34
- "@trackunit/i18n-library-translation": "1.3.163",
35
- "@trackunit/react-core-contexts-api": "1.4.150",
36
- "@trackunit/react-test-setup": "1.0.32"
20
+ "@trackunit/iris-app-build-utilities": "1.3.152",
21
+ "@trackunit/filters-filter-bar": "1.3.245",
22
+ "@trackunit/react-core-hooks": "1.3.158",
23
+ "@trackunit/react-filter-components": "1.3.199",
24
+ "@trackunit/react-form-components": "1.3.200",
25
+ "@trackunit/filters-graphql-hook": "1.5.119",
26
+ "@trackunit/utilization-indicator": "1.3.194",
27
+ "@trackunit/geo-json-utils": "1.3.142",
28
+ "@trackunit/react-components": "1.4.175",
29
+ "@trackunit/shared-utils": "1.5.144",
30
+ "@trackunit/translations-machine-type": "1.3.167",
31
+ "@trackunit/criticality-indicator": "1.3.189",
32
+ "@trackunit/iris-app-api": "1.3.152",
33
+ "@trackunit/react-core-contexts-test": "1.3.159",
34
+ "@trackunit/i18n-library-translation": "1.3.165",
35
+ "@trackunit/react-core-contexts-api": "1.4.152",
36
+ "@trackunit/react-test-setup": "1.0.34"
37
37
  },
38
38
  "module": "./index.esm.js",
39
39
  "main": "./index.cjs.js",
@@ -12,9 +12,11 @@ export declare const CustomerIdsFilterView: (props: FilterViewProps<Array<ValueN
12
12
  interface CustomerIdsFilterProps {
13
13
  showInFilterBar: () => boolean;
14
14
  defaultValue?: Array<ValueName>;
15
+ hasCount?: boolean;
16
+ persistValue?: boolean;
15
17
  }
16
18
  /**
17
19
  * Custom hook to create and configure a customer IDs filter definition.
18
20
  */
19
- export declare const useCustomerIdsFilter: ({ showInFilterBar, defaultValue }?: CustomerIdsFilterProps) => ValueNameArrayFilterDefinition;
21
+ export declare const useCustomerIdsFilter: ({ showInFilterBar, defaultValue, hasCount, persistValue }?: CustomerIdsFilterProps) => ValueNameArrayFilterDefinition;
20
22
  export {};
@@ -8,9 +8,13 @@ import { ReactElement } from "react";
8
8
  * @returns {ReactElement} The GroupIdsFilterView component.
9
9
  */
10
10
  export declare const GroupIdsFilterView: (props: FilterViewProps<Array<ValueName>>) => ReactElement;
11
+ interface GroupsIdsFilterProps {
12
+ hasCount?: boolean;
13
+ }
11
14
  /**
12
15
  * GroupIds filter definition
13
16
  *
14
17
  * @returns {ValueNameArrayFilterDefinition} GroupIds filter definition
15
18
  */
16
- export declare const useGroupIdsFilter: () => ValueNameArrayFilterDefinition;
19
+ export declare const useGroupIdsFilter: ({ hasCount }?: GroupsIdsFilterProps) => ValueNameArrayFilterDefinition;
20
+ export {};
@@ -14,9 +14,10 @@ interface SiteIdsFilterProps {
14
14
  showInFilterBar: () => boolean;
15
15
  defaultValue?: Array<ValueName>;
16
16
  persistValue?: boolean;
17
+ hasCount?: boolean;
17
18
  }
18
19
  /**
19
20
  *
20
21
  */
21
- export declare const useSiteIdsFilter: ({ showInFilterBar, defaultValue, persistValue }?: SiteIdsFilterProps) => ValueNameArrayFilterDefinition;
22
+ export declare const useSiteIdsFilter: ({ showInFilterBar, defaultValue, persistValue, hasCount }?: SiteIdsFilterProps) => ValueNameArrayFilterDefinition;
22
23
  export {};
@@ -98,6 +98,11 @@ export type Scalars = {
98
98
  input: any;
99
99
  output: any;
100
100
  };
101
+ /** 24-hour clock time string in the format hh:mm:ss.sss or hh:mm:ss if partial seconds is zero */
102
+ LocalTime: {
103
+ input: any;
104
+ output: any;
105
+ };
101
106
  /** Javascript `Long`. Type represents a 64 bit integer. */
102
107
  Long: {
103
108
  input: any;