@trackunit/filters-asset-filter-definitions 1.23.7 → 1.23.9

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
@@ -3362,21 +3362,22 @@ const useCustomerHierarchy = (customerSummary) => {
3362
3362
  *
3363
3363
  * @param props - Filter properties including data, state, and actions.
3364
3364
  * @param props.customerId - The ID of the customer that owns the customers shown in the filter bar.
3365
+ * @param props.hasCount - Whether the filter should display the count for matching items.
3365
3366
  * @returns {ReactElement} A customer ID filter component for rendering in the UI.
3366
3367
  */
3367
- const CustomerIdsFilterView = ({ customerId, ...props }) => {
3368
+ const CustomerIdsFilterView = ({ customerId, hasCount = true, ...props }) => {
3368
3369
  const { data, loading, searchText, setSearchText } = useCustomerData(props.filterState.values, customerId);
3369
3370
  const hierarchicalOptions = useCustomerHierarchy(data?.assetSummary?.customers?.summary);
3370
3371
  const valueNameArrayFilterDefinition = props.filterDefinition;
3371
3372
  return (jsxRuntime.jsx(filtersFilterBar.HierarchicalCheckboxFilter, { cascadeSelection: true, customSearch: {
3372
3373
  value: searchText,
3373
3374
  onChange: setSearchText,
3374
- }, filterBarActions: props.filterBarActions, filterDefinition: valueNameArrayFilterDefinition, filterState: props.filterState, loading: loading, options: hierarchicalOptions, setValue: props.setValue, showCount: props.hasCount, value: props.value }));
3375
+ }, filterBarActions: props.filterBarActions, filterDefinition: valueNameArrayFilterDefinition, filterState: props.filterState, loading: loading, options: hierarchicalOptions, setValue: props.setValue, showCount: hasCount, value: props.value }));
3375
3376
  };
3376
3377
  /**
3377
3378
  * Custom hook to create and configure a customer IDs filter definition.
3378
3379
  */
3379
- const useCustomerIdsFilter = ({ showInFilterBar, defaultValue, hasCount, persistValue, customerId } = {
3380
+ const useCustomerIdsFilter = ({ showInFilterBar, defaultValue, hasCount = true, persistValue, customerId } = {
3380
3381
  hasCount: true,
3381
3382
  }) => {
3382
3383
  const [t] = useTranslation();
@@ -3649,7 +3650,7 @@ const FleetHealthStatesFilter = (props) => {
3649
3650
  });
3650
3651
  props.setValue(() => [{ value: newValue, name: getLabel(newValue) }]);
3651
3652
  };
3652
- 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, { className: "m-1", limitSize: true, children: jsxRuntime.jsxs(reactFormComponents.RadioGroup, { id: "FleetHealthStates", onChange: e => handleChange(e.currentTarget.value), value: props.value?.[0]?.value ?? "", children: [jsxRuntime.jsx(reactFilterComponents.RadioFilterItem, { label: t("assetFilters.fleetHealthStates.open"), value: fleetDataHealthIssueState.OPEN }), jsxRuntime.jsx(reactFilterComponents.RadioFilterItem, { label: t("assetFilters.fleetHealthStates.resolved"), value: fleetDataHealthIssueState.RESOLVED }), jsxRuntime.jsx(reactFilterComponents.RadioFilterItem, { label: t("assetFilters.fleetHealthStates.all"), value: "" })] }) })] }));
3653
+ 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.jsxs(reactFormComponents.RadioGroup, { id: "FleetHealthStates", onChange: e => handleChange(e.currentTarget.value), value: props.value?.[0]?.value ?? "", children: [jsxRuntime.jsx(reactFilterComponents.RadioFilterItem, { label: t("assetFilters.fleetHealthStates.open"), value: fleetDataHealthIssueState.OPEN }), jsxRuntime.jsx(reactFilterComponents.RadioFilterItem, { label: t("assetFilters.fleetHealthStates.resolved"), value: fleetDataHealthIssueState.RESOLVED }), jsxRuntime.jsx(reactFilterComponents.RadioFilterItem, { label: t("assetFilters.fleetHealthStates.all"), value: "" })] }) })] }));
3653
3654
  };
3654
3655
 
3655
3656
  /**
@@ -3665,6 +3666,7 @@ const useFleetHealthStatesFilter = () => {
3665
3666
  filterKey: "fleetHealthStates",
3666
3667
  type: "valueNameArray",
3667
3668
  group: "DEVICE_HEALTH",
3669
+ showInFilterBar: () => false,
3668
3670
  defaultValue: [{ value: "", name: t("assetFilters.fleetHealthStates.all") }],
3669
3671
  title: t("assetFilters.fleetHealthStates"),
3670
3672
  valueAsText: (value) => {
package/index.esm.js CHANGED
@@ -3360,21 +3360,22 @@ const useCustomerHierarchy = (customerSummary) => {
3360
3360
  *
3361
3361
  * @param props - Filter properties including data, state, and actions.
3362
3362
  * @param props.customerId - The ID of the customer that owns the customers shown in the filter bar.
3363
+ * @param props.hasCount - Whether the filter should display the count for matching items.
3363
3364
  * @returns {ReactElement} A customer ID filter component for rendering in the UI.
3364
3365
  */
3365
- const CustomerIdsFilterView = ({ customerId, ...props }) => {
3366
+ const CustomerIdsFilterView = ({ customerId, hasCount = true, ...props }) => {
3366
3367
  const { data, loading, searchText, setSearchText } = useCustomerData(props.filterState.values, customerId);
3367
3368
  const hierarchicalOptions = useCustomerHierarchy(data?.assetSummary?.customers?.summary);
3368
3369
  const valueNameArrayFilterDefinition = props.filterDefinition;
3369
3370
  return (jsx(HierarchicalCheckboxFilter, { cascadeSelection: true, customSearch: {
3370
3371
  value: searchText,
3371
3372
  onChange: setSearchText,
3372
- }, filterBarActions: props.filterBarActions, filterDefinition: valueNameArrayFilterDefinition, filterState: props.filterState, loading: loading, options: hierarchicalOptions, setValue: props.setValue, showCount: props.hasCount, value: props.value }));
3373
+ }, filterBarActions: props.filterBarActions, filterDefinition: valueNameArrayFilterDefinition, filterState: props.filterState, loading: loading, options: hierarchicalOptions, setValue: props.setValue, showCount: hasCount, value: props.value }));
3373
3374
  };
3374
3375
  /**
3375
3376
  * Custom hook to create and configure a customer IDs filter definition.
3376
3377
  */
3377
- const useCustomerIdsFilter = ({ showInFilterBar, defaultValue, hasCount, persistValue, customerId } = {
3378
+ const useCustomerIdsFilter = ({ showInFilterBar, defaultValue, hasCount = true, persistValue, customerId } = {
3378
3379
  hasCount: true,
3379
3380
  }) => {
3380
3381
  const [t] = useTranslation();
@@ -3647,7 +3648,7 @@ const FleetHealthStatesFilter = (props) => {
3647
3648
  });
3648
3649
  props.setValue(() => [{ value: newValue, name: getLabel(newValue) }]);
3649
3650
  };
3650
- return (jsxs(Fragment, { children: [jsx(FilterHeader, { ...props.filterDefinition, ...props.filterBarActions, filterHasChanges: props.filterBarActions.appliedFilterKeys().includes(props.filterDefinition.filterKey) }), jsx(FilterBody, { className: "m-1", limitSize: true, children: jsxs(RadioGroup, { id: "FleetHealthStates", onChange: e => handleChange(e.currentTarget.value), value: props.value?.[0]?.value ?? "", children: [jsx(RadioFilterItem, { label: t("assetFilters.fleetHealthStates.open"), value: fleetDataHealthIssueState.OPEN }), jsx(RadioFilterItem, { label: t("assetFilters.fleetHealthStates.resolved"), value: fleetDataHealthIssueState.RESOLVED }), jsx(RadioFilterItem, { label: t("assetFilters.fleetHealthStates.all"), value: "" })] }) })] }));
3651
+ return (jsxs(Fragment, { children: [jsx(FilterHeader, { ...props.filterDefinition, ...props.filterBarActions, filterHasChanges: props.filterBarActions.appliedFilterKeys().includes(props.filterDefinition.filterKey) }), jsx(FilterBody, { limitSize: true, children: jsxs(RadioGroup, { id: "FleetHealthStates", onChange: e => handleChange(e.currentTarget.value), value: props.value?.[0]?.value ?? "", children: [jsx(RadioFilterItem, { label: t("assetFilters.fleetHealthStates.open"), value: fleetDataHealthIssueState.OPEN }), jsx(RadioFilterItem, { label: t("assetFilters.fleetHealthStates.resolved"), value: fleetDataHealthIssueState.RESOLVED }), jsx(RadioFilterItem, { label: t("assetFilters.fleetHealthStates.all"), value: "" })] }) })] }));
3651
3652
  };
3652
3653
 
3653
3654
  /**
@@ -3663,6 +3664,7 @@ const useFleetHealthStatesFilter = () => {
3663
3664
  filterKey: "fleetHealthStates",
3664
3665
  type: "valueNameArray",
3665
3666
  group: "DEVICE_HEALTH",
3667
+ showInFilterBar: () => false,
3666
3668
  defaultValue: [{ value: "", name: t("assetFilters.fleetHealthStates.all") }],
3667
3669
  title: t("assetFilters.fleetHealthStates"),
3668
3670
  valueAsText: (value) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/filters-asset-filter-definitions",
3
- "version": "1.23.7",
3
+ "version": "1.23.9",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -13,22 +13,22 @@
13
13
  "string-ts": "^2.0.0",
14
14
  "tailwind-merge": "^2.0.0",
15
15
  "@trackunit/iris-app-build-utilities": "1.13.11",
16
- "@trackunit/filters-filter-bar": "1.18.5",
17
- "@trackunit/react-core-hooks": "1.14.2",
18
- "@trackunit/react-filter-components": "1.17.4",
19
- "@trackunit/react-form-components": "1.18.3",
20
- "@trackunit/filters-graphql-hook": "1.21.5",
21
- "@trackunit/utilization-indicator": "1.17.3",
16
+ "@trackunit/filters-filter-bar": "1.18.6",
17
+ "@trackunit/react-core-hooks": "1.14.3",
18
+ "@trackunit/react-filter-components": "1.17.5",
19
+ "@trackunit/react-form-components": "1.18.4",
20
+ "@trackunit/filters-graphql-hook": "1.21.7",
21
+ "@trackunit/utilization-indicator": "1.17.4",
22
22
  "@trackunit/geo-json-utils": "1.11.78",
23
- "@trackunit/react-components": "1.20.3",
23
+ "@trackunit/react-components": "1.20.4",
24
24
  "@trackunit/shared-utils": "1.13.77",
25
- "@trackunit/translations-machine-type": "1.15.3",
26
- "@trackunit/criticality-indicator": "1.17.3",
25
+ "@trackunit/translations-machine-type": "1.15.4",
26
+ "@trackunit/criticality-indicator": "1.17.4",
27
27
  "@trackunit/iris-app-api": "1.15.9",
28
- "@trackunit/react-core-contexts-test": "1.14.2",
29
- "@trackunit/i18n-library-translation": "1.15.3",
28
+ "@trackunit/react-core-contexts-test": "1.14.3",
29
+ "@trackunit/i18n-library-translation": "1.15.4",
30
30
  "@trackunit/iris-app-runtime-core-api": "1.13.2",
31
- "@trackunit/react-graphql-hooks": "1.18.3"
31
+ "@trackunit/react-graphql-hooks": "1.18.4"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": "^19.0.0",
@@ -7,9 +7,10 @@ import { ReactElement } from "react";
7
7
  *
8
8
  * @param props - Filter properties including data, state, and actions.
9
9
  * @param props.customerId - The ID of the customer that owns the customers shown in the filter bar.
10
+ * @param props.hasCount - Whether the filter should display the count for matching items.
10
11
  * @returns {ReactElement} A customer ID filter component for rendering in the UI.
11
12
  */
12
- export declare const CustomerIdsFilterView: ({ customerId, ...props }: {
13
+ export declare const CustomerIdsFilterView: ({ customerId, hasCount, ...props }: {
13
14
  customerId?: string;
14
15
  } & FilterViewProps<Array<ValueName>>) => ReactElement;
15
16
  interface CustomerIdsFilterProps {