@trackunit/filters-filter-bar 2.3.3 → 2.3.7
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 +45 -24
- package/index.esm.js +46 -25
- package/migrations/entry.js.map +1 -0
- package/package.json +12 -12
- package/src/lib/components/DefaultCheckboxFilter.d.ts +1 -1
- package/src/lib/components/DefaultFilterTypes.d.ts +6 -0
- package/src/lib/components/DynamicFilterList.d.ts +6 -1
- package/src/lib/types/FilterTypes.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -7,11 +7,11 @@ var reactFilterComponents = require('@trackunit/react-filter-components');
|
|
|
7
7
|
var reactComponents = require('@trackunit/react-components');
|
|
8
8
|
var reactCoreHooks = require('@trackunit/react-core-hooks');
|
|
9
9
|
var stringTs = require('string-ts');
|
|
10
|
+
var tailwindMerge = require('tailwind-merge');
|
|
10
11
|
var irisAppRuntimeCoreApi = require('@trackunit/iris-app-runtime-core-api');
|
|
11
12
|
var reactFormComponents = require('@trackunit/react-form-components');
|
|
12
13
|
var reactDateAndTimeComponents = require('@trackunit/react-date-and-time-components');
|
|
13
14
|
var sharedUtils = require('@trackunit/shared-utils');
|
|
14
|
-
var tailwindMerge = require('tailwind-merge');
|
|
15
15
|
var irisAppApi = require('@trackunit/iris-app-api');
|
|
16
16
|
var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
|
|
17
17
|
var dequal = require('dequal');
|
|
@@ -139,6 +139,7 @@ var defaultTranslations = {
|
|
|
139
139
|
"filtersBar.groups.INTEGRATION": "Integration",
|
|
140
140
|
"filtersBar.groups.MANAGEMENT": "Management",
|
|
141
141
|
"filtersBar.groups.METADATA": "Metadata",
|
|
142
|
+
"filtersBar.groups.METRICS": "Metrics",
|
|
142
143
|
"filtersBar.groups.MY_NETWORK": "My Network",
|
|
143
144
|
"filtersBar.groups.OPERATOR": "Operator",
|
|
144
145
|
"filtersBar.groups.OTHER": "Others",
|
|
@@ -490,19 +491,33 @@ const toggleFilterValue = (value) => {
|
|
|
490
491
|
};
|
|
491
492
|
|
|
492
493
|
const ITEM_HEIGHT = 28; //measured in DevTools on 03/10/2025
|
|
494
|
+
/**
|
|
495
|
+
* Filter rows are single-line checkboxes, so the skeleton drops the thumbnail and description slots
|
|
496
|
+
* it renders by default. The first page is already announced by `FilterHeader`/`FilterResults`, which
|
|
497
|
+
* is why only the pages fetched while scrolling get placeholder rows.
|
|
498
|
+
*/
|
|
499
|
+
const LOADING_INDICATOR = {
|
|
500
|
+
type: "skeleton",
|
|
501
|
+
hasThumbnail: false,
|
|
502
|
+
hasDescription: false,
|
|
503
|
+
initialLoadingCount: 0,
|
|
504
|
+
scrollLoadingCount: 3,
|
|
505
|
+
};
|
|
493
506
|
/**
|
|
494
507
|
* DynamicFilterList is a React component that displays a list of dynamic filters with options like CheckBoxes or Radio buttons.
|
|
495
508
|
*
|
|
496
509
|
* @returns {ReactElement} - Returns the DynamicFilterList component.
|
|
497
510
|
*/
|
|
498
|
-
const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked, count, showRequestMoreUseSearch = false, type = undefined, className, }) => {
|
|
511
|
+
const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked, count, showRequestMoreUseSearch = false, pagination, type = undefined, className, }) => {
|
|
499
512
|
const [t] = useTranslation();
|
|
500
|
-
const
|
|
501
|
-
const updatedRowCount = react.useMemo(() => (
|
|
513
|
+
const showSearchMoreHint = showRequestMoreUseSearch && pagination === undefined;
|
|
514
|
+
const updatedRowCount = react.useMemo(() => (showSearchMoreHint ? rowCount + 1 : rowCount), [rowCount, showSearchMoreHint]);
|
|
502
515
|
const list = reactComponents.useList({
|
|
503
516
|
count: updatedRowCount,
|
|
517
|
+
pagination,
|
|
518
|
+
loadingIndicator: LOADING_INDICATOR,
|
|
504
519
|
getItem: index => {
|
|
505
|
-
if (
|
|
520
|
+
if (showSearchMoreHint && index === rowCount) {
|
|
506
521
|
return { type: "search-more" };
|
|
507
522
|
}
|
|
508
523
|
return {
|
|
@@ -517,7 +532,7 @@ const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked
|
|
|
517
532
|
separator: "none",
|
|
518
533
|
estimateItemSize: () => ITEM_HEIGHT,
|
|
519
534
|
});
|
|
520
|
-
return (jsxRuntime.jsx(reactFilterComponents.FilterBody, {
|
|
535
|
+
return (jsxRuntime.jsx(reactFilterComponents.FilterBody, { className: "flex h-full min-h-0 flex-col overflow-hidden", children: jsxRuntime.jsx(reactComponents.List, { className: tailwindMerge.twMerge("min-h-0 max-w-sm flex-1 overflow-y-auto", className), ...list, children: ({ key, listItemProps, item }) => {
|
|
521
536
|
if (!item) {
|
|
522
537
|
return null;
|
|
523
538
|
}
|
|
@@ -580,7 +595,7 @@ const EmptyResults = ({ loading = false }) => {
|
|
|
580
595
|
*
|
|
581
596
|
* @param {DefaultFilterProps<string[]>} props - The properties required for the `DefaultCheckboxFilter` component.
|
|
582
597
|
*/
|
|
583
|
-
const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, loading, setValue, filterName, customSearch, showRequestMoreUseSearch = false, showUndefinedOptionWithCountAtBottom = true, }) => {
|
|
598
|
+
const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, loading, setValue, filterName, customSearch, showRequestMoreUseSearch = false, showUndefinedOptionWithCountAtBottom = true, pagination, }) => {
|
|
584
599
|
const { logEvent } = reactCoreHooks.useAnalytics(FilterEvents);
|
|
585
600
|
const { t } = useTranslation();
|
|
586
601
|
const handleSetValue = (value) => {
|
|
@@ -641,6 +656,12 @@ const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, lo
|
|
|
641
656
|
}
|
|
642
657
|
return null;
|
|
643
658
|
}, [results]);
|
|
659
|
+
/**
|
|
660
|
+
* Selects the options loaded so far, which for a paginated facet is the pages fetched up to now
|
|
661
|
+
* rather than every value the server could return. That is what this button has always done — it
|
|
662
|
+
* used to act on a single capped page — so scrolling in another page re-enables it for the
|
|
663
|
+
* options that just arrived.
|
|
664
|
+
*/
|
|
644
665
|
const hasSelectedAll = react.useMemo(() => {
|
|
645
666
|
const values = filterBarActions.getValuesByKey(filterDefinition.filterKey);
|
|
646
667
|
if (Array.isArray(values)) {
|
|
@@ -666,23 +687,23 @@ const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, lo
|
|
|
666
687
|
onChange: customSearch?.onChange ?? setSearchText,
|
|
667
688
|
onClear: customSearch?.onClear ?? (() => setSearchText("")),
|
|
668
689
|
count: undefinedCount ? filteredOptions.length - 1 : filteredOptions.length,
|
|
669
|
-
}, children: options.length >= 2 ? (jsxRuntime.jsx(reactComponents.Button, { className: "place-self-start", "data-testid": "selectAllButton", disabled: hasSelectedAll, onClick: handleSelectAll, size: "small", variant: "ghost", children: t("filtersBar.selectAll") })) : null }), jsxRuntime.jsx(FilterResults, { ignoreUndefined: undefinedCount !== null, loading: loading, results: results, children: res => (jsxRuntime.jsx(DynamicFilterList, { checked: index => {
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
690
|
+
}, children: options.length >= 2 ? (jsxRuntime.jsx(reactComponents.Button, { className: "place-self-start", "data-testid": "selectAllButton", disabled: hasSelectedAll, onClick: handleSelectAll, size: "small", variant: "ghost", children: t("filtersBar.selectAll") })) : null }), jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("grid max-h-[50dvh] min-h-0 overflow-hidden", undefinedCount ? "grid-rows-[minmax(0,1fr)_auto]" : "grid-rows-[minmax(0,1fr)]"), children: [jsxRuntime.jsx(FilterResults, { ignoreUndefined: undefinedCount !== null, loading: loading, results: results, children: res => (jsxRuntime.jsx(DynamicFilterList, { checked: index => {
|
|
691
|
+
return filterDefinition.type === "valueNameArray"
|
|
692
|
+
? filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, res[index]?.key || "")
|
|
693
|
+
: filterBarActions.arrayIncludesValue(filterDefinition.filterKey, res[index]?.key || "");
|
|
694
|
+
}, className: "mb-1 h-full", count: index => res[index]?.count, keyMapper: index => res[index]?.key || "", labelMapper: index => res[index]?.label || "", onChange: index => {
|
|
695
|
+
const result = res[index];
|
|
696
|
+
if (result) {
|
|
697
|
+
handleSetValue(result);
|
|
698
|
+
}
|
|
699
|
+
}, pagination: pagination, rowCount: undefinedCount ? res.length - 1 : res.length, showRequestMoreUseSearch: showRequestMoreUseSearch, type: "CheckBox" })) }), showUndefinedOptionWithCountAtBottom && undefinedCount ? (jsxRuntime.jsx("div", { className: "border-t border-neutral-200 py-1", children: jsxRuntime.jsx(reactFilterComponents.CheckBoxFilterItem, { checked: filterDefinition.type === "valueNameArray"
|
|
700
|
+
? filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, results[undefinedCount.index]?.key || "")
|
|
701
|
+
: filterBarActions.arrayIncludesValue(filterDefinition.filterKey, results[undefinedCount.index]?.key || ""), "data-testid": "dynamic-filter-check-box-undefined", itemCount: undefinedCount.count, label: results[undefinedCount.index]?.label, name: "dynamic-filter-check-box-undefined", onChange: () => {
|
|
702
|
+
const result = results[undefinedCount.index];
|
|
703
|
+
if (result) {
|
|
704
|
+
handleSetValue(result);
|
|
705
|
+
}
|
|
706
|
+
} }, "dynamic-filter-check-box-undefined") })) : null] })] }));
|
|
686
707
|
};
|
|
687
708
|
|
|
688
709
|
const formatToJustDate = (date) => {
|
package/index.esm.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
|
|
3
|
-
import { useMemo,
|
|
3
|
+
import { useMemo, useState, useEffect, useCallback, Fragment as Fragment$1, useRef } from 'react';
|
|
4
4
|
import { Filter, FilterBody, RadioFilterItem, CheckBoxFilterItem, FilterHeader as FilterHeader$1, FilterFooter } from '@trackunit/react-filter-components';
|
|
5
5
|
import { Button, Icon, useList, List, Text, useTextSearch, Card, CardBody, useViewportBreakpoints, Popover, PopoverTrigger, Tooltip, Badge, PopoverContent, IconButton, MenuList, useCustomEncoding, useSearchParamSync, useStorageKey, storageSerializer, useWatch } from '@trackunit/react-components';
|
|
6
6
|
import { useAnalytics, useCurrentUser } from '@trackunit/react-core-hooks';
|
|
7
7
|
import { capitalize } from 'string-ts';
|
|
8
|
+
import { twMerge } from 'tailwind-merge';
|
|
8
9
|
import { createEvent } from '@trackunit/iris-app-runtime-core-api';
|
|
9
10
|
import { Search, NumberField, RadioGroup } from '@trackunit/react-form-components';
|
|
10
11
|
import { DayRangePicker } from '@trackunit/react-date-and-time-components';
|
|
11
12
|
import { nonNullable, capitalize as capitalize$1, objectValues, truthy, objectKeys } from '@trackunit/shared-utils';
|
|
12
|
-
import { twMerge } from 'tailwind-merge';
|
|
13
13
|
import { customFieldFilterKey } from '@trackunit/iris-app-api';
|
|
14
14
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
15
15
|
import { dequal } from 'dequal';
|
|
@@ -137,6 +137,7 @@ var defaultTranslations = {
|
|
|
137
137
|
"filtersBar.groups.INTEGRATION": "Integration",
|
|
138
138
|
"filtersBar.groups.MANAGEMENT": "Management",
|
|
139
139
|
"filtersBar.groups.METADATA": "Metadata",
|
|
140
|
+
"filtersBar.groups.METRICS": "Metrics",
|
|
140
141
|
"filtersBar.groups.MY_NETWORK": "My Network",
|
|
141
142
|
"filtersBar.groups.OPERATOR": "Operator",
|
|
142
143
|
"filtersBar.groups.OTHER": "Others",
|
|
@@ -488,19 +489,33 @@ const toggleFilterValue = (value) => {
|
|
|
488
489
|
};
|
|
489
490
|
|
|
490
491
|
const ITEM_HEIGHT = 28; //measured in DevTools on 03/10/2025
|
|
492
|
+
/**
|
|
493
|
+
* Filter rows are single-line checkboxes, so the skeleton drops the thumbnail and description slots
|
|
494
|
+
* it renders by default. The first page is already announced by `FilterHeader`/`FilterResults`, which
|
|
495
|
+
* is why only the pages fetched while scrolling get placeholder rows.
|
|
496
|
+
*/
|
|
497
|
+
const LOADING_INDICATOR = {
|
|
498
|
+
type: "skeleton",
|
|
499
|
+
hasThumbnail: false,
|
|
500
|
+
hasDescription: false,
|
|
501
|
+
initialLoadingCount: 0,
|
|
502
|
+
scrollLoadingCount: 3,
|
|
503
|
+
};
|
|
491
504
|
/**
|
|
492
505
|
* DynamicFilterList is a React component that displays a list of dynamic filters with options like CheckBoxes or Radio buttons.
|
|
493
506
|
*
|
|
494
507
|
* @returns {ReactElement} - Returns the DynamicFilterList component.
|
|
495
508
|
*/
|
|
496
|
-
const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked, count, showRequestMoreUseSearch = false, type = undefined, className, }) => {
|
|
509
|
+
const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked, count, showRequestMoreUseSearch = false, pagination, type = undefined, className, }) => {
|
|
497
510
|
const [t] = useTranslation();
|
|
498
|
-
const
|
|
499
|
-
const updatedRowCount = useMemo(() => (
|
|
511
|
+
const showSearchMoreHint = showRequestMoreUseSearch && pagination === undefined;
|
|
512
|
+
const updatedRowCount = useMemo(() => (showSearchMoreHint ? rowCount + 1 : rowCount), [rowCount, showSearchMoreHint]);
|
|
500
513
|
const list = useList({
|
|
501
514
|
count: updatedRowCount,
|
|
515
|
+
pagination,
|
|
516
|
+
loadingIndicator: LOADING_INDICATOR,
|
|
502
517
|
getItem: index => {
|
|
503
|
-
if (
|
|
518
|
+
if (showSearchMoreHint && index === rowCount) {
|
|
504
519
|
return { type: "search-more" };
|
|
505
520
|
}
|
|
506
521
|
return {
|
|
@@ -515,7 +530,7 @@ const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked
|
|
|
515
530
|
separator: "none",
|
|
516
531
|
estimateItemSize: () => ITEM_HEIGHT,
|
|
517
532
|
});
|
|
518
|
-
return (jsx(FilterBody, {
|
|
533
|
+
return (jsx(FilterBody, { className: "flex h-full min-h-0 flex-col overflow-hidden", children: jsx(List, { className: twMerge("min-h-0 max-w-sm flex-1 overflow-y-auto", className), ...list, children: ({ key, listItemProps, item }) => {
|
|
519
534
|
if (!item) {
|
|
520
535
|
return null;
|
|
521
536
|
}
|
|
@@ -578,7 +593,7 @@ const EmptyResults = ({ loading = false }) => {
|
|
|
578
593
|
*
|
|
579
594
|
* @param {DefaultFilterProps<string[]>} props - The properties required for the `DefaultCheckboxFilter` component.
|
|
580
595
|
*/
|
|
581
|
-
const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, loading, setValue, filterName, customSearch, showRequestMoreUseSearch = false, showUndefinedOptionWithCountAtBottom = true, }) => {
|
|
596
|
+
const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, loading, setValue, filterName, customSearch, showRequestMoreUseSearch = false, showUndefinedOptionWithCountAtBottom = true, pagination, }) => {
|
|
582
597
|
const { logEvent } = useAnalytics(FilterEvents);
|
|
583
598
|
const { t } = useTranslation();
|
|
584
599
|
const handleSetValue = (value) => {
|
|
@@ -639,6 +654,12 @@ const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, lo
|
|
|
639
654
|
}
|
|
640
655
|
return null;
|
|
641
656
|
}, [results]);
|
|
657
|
+
/**
|
|
658
|
+
* Selects the options loaded so far, which for a paginated facet is the pages fetched up to now
|
|
659
|
+
* rather than every value the server could return. That is what this button has always done — it
|
|
660
|
+
* used to act on a single capped page — so scrolling in another page re-enables it for the
|
|
661
|
+
* options that just arrived.
|
|
662
|
+
*/
|
|
642
663
|
const hasSelectedAll = useMemo(() => {
|
|
643
664
|
const values = filterBarActions.getValuesByKey(filterDefinition.filterKey);
|
|
644
665
|
if (Array.isArray(values)) {
|
|
@@ -664,23 +685,23 @@ const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, lo
|
|
|
664
685
|
onChange: customSearch?.onChange ?? setSearchText,
|
|
665
686
|
onClear: customSearch?.onClear ?? (() => setSearchText("")),
|
|
666
687
|
count: undefinedCount ? filteredOptions.length - 1 : filteredOptions.length,
|
|
667
|
-
}, children: options.length >= 2 ? (jsx(Button, { className: "place-self-start", "data-testid": "selectAllButton", disabled: hasSelectedAll, onClick: handleSelectAll, size: "small", variant: "ghost", children: t("filtersBar.selectAll") })) : null }), jsx(FilterResults, { ignoreUndefined: undefinedCount !== null, loading: loading, results: results, children: res => (jsx(DynamicFilterList, { checked: index => {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
688
|
+
}, children: options.length >= 2 ? (jsx(Button, { className: "place-self-start", "data-testid": "selectAllButton", disabled: hasSelectedAll, onClick: handleSelectAll, size: "small", variant: "ghost", children: t("filtersBar.selectAll") })) : null }), jsxs("div", { className: twMerge("grid max-h-[50dvh] min-h-0 overflow-hidden", undefinedCount ? "grid-rows-[minmax(0,1fr)_auto]" : "grid-rows-[minmax(0,1fr)]"), children: [jsx(FilterResults, { ignoreUndefined: undefinedCount !== null, loading: loading, results: results, children: res => (jsx(DynamicFilterList, { checked: index => {
|
|
689
|
+
return filterDefinition.type === "valueNameArray"
|
|
690
|
+
? filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, res[index]?.key || "")
|
|
691
|
+
: filterBarActions.arrayIncludesValue(filterDefinition.filterKey, res[index]?.key || "");
|
|
692
|
+
}, className: "mb-1 h-full", count: index => res[index]?.count, keyMapper: index => res[index]?.key || "", labelMapper: index => res[index]?.label || "", onChange: index => {
|
|
693
|
+
const result = res[index];
|
|
694
|
+
if (result) {
|
|
695
|
+
handleSetValue(result);
|
|
696
|
+
}
|
|
697
|
+
}, pagination: pagination, rowCount: undefinedCount ? res.length - 1 : res.length, showRequestMoreUseSearch: showRequestMoreUseSearch, type: "CheckBox" })) }), showUndefinedOptionWithCountAtBottom && undefinedCount ? (jsx("div", { className: "border-t border-neutral-200 py-1", children: jsx(CheckBoxFilterItem, { checked: filterDefinition.type === "valueNameArray"
|
|
698
|
+
? filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, results[undefinedCount.index]?.key || "")
|
|
699
|
+
: filterBarActions.arrayIncludesValue(filterDefinition.filterKey, results[undefinedCount.index]?.key || ""), "data-testid": "dynamic-filter-check-box-undefined", itemCount: undefinedCount.count, label: results[undefinedCount.index]?.label, name: "dynamic-filter-check-box-undefined", onChange: () => {
|
|
700
|
+
const result = results[undefinedCount.index];
|
|
701
|
+
if (result) {
|
|
702
|
+
handleSetValue(result);
|
|
703
|
+
}
|
|
704
|
+
} }, "dynamic-filter-check-box-undefined") })) : null] })] }));
|
|
684
705
|
};
|
|
685
706
|
|
|
686
707
|
const formatToJustDate = (date) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/filters/filter-bar/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/filters-filter-bar",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.7",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"tailwind-merge": "^2.0.0",
|
|
12
12
|
"string-ts": "^2.0.0",
|
|
13
13
|
"zod": "^3.25.76",
|
|
14
|
-
"@trackunit/iris-app-api": "2.2.
|
|
15
|
-
"@trackunit/react-core-hooks": "1.19.
|
|
16
|
-
"@trackunit/react-filter-components": "2.3.
|
|
17
|
-
"@trackunit/react-date-and-time-components": "2.3.
|
|
18
|
-
"@trackunit/shared-utils": "1.15.
|
|
19
|
-
"@trackunit/react-form-components": "2.3.
|
|
20
|
-
"@trackunit/iris-app-runtime-core-api": "1.16.
|
|
21
|
-
"@trackunit/geo-json-utils": "1.14.
|
|
22
|
-
"@trackunit/i18n-library-translation": "2.2.
|
|
23
|
-
"@trackunit/css-class-variance-utilities": "1.13.
|
|
24
|
-
"@trackunit/react-components": "2.
|
|
14
|
+
"@trackunit/iris-app-api": "2.2.5",
|
|
15
|
+
"@trackunit/react-core-hooks": "1.19.5",
|
|
16
|
+
"@trackunit/react-filter-components": "2.3.7",
|
|
17
|
+
"@trackunit/react-date-and-time-components": "2.3.7",
|
|
18
|
+
"@trackunit/shared-utils": "1.15.93",
|
|
19
|
+
"@trackunit/react-form-components": "2.3.6",
|
|
20
|
+
"@trackunit/iris-app-runtime-core-api": "1.16.99",
|
|
21
|
+
"@trackunit/geo-json-utils": "1.14.93",
|
|
22
|
+
"@trackunit/i18n-library-translation": "2.2.5",
|
|
23
|
+
"@trackunit/css-class-variance-utilities": "1.13.90",
|
|
24
|
+
"@trackunit/react-components": "2.4.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@apollo/client": "^3.13.8",
|
|
@@ -7,5 +7,5 @@ type FilterDefinitionValue = Array<string> | Array<ValueName>;
|
|
|
7
7
|
*
|
|
8
8
|
* @param {DefaultFilterProps<string[]>} props - The properties required for the `DefaultCheckboxFilter` component.
|
|
9
9
|
*/
|
|
10
|
-
export declare const DefaultCheckboxFilter: <TFilterValue extends FilterDefinitionValue>({ filterDefinition, filterBarActions, options, loading, setValue, filterName, customSearch, showRequestMoreUseSearch, showUndefinedOptionWithCountAtBottom, }: DefaultFilterProps<TFilterValue>) => ReactElement;
|
|
10
|
+
export declare const DefaultCheckboxFilter: <TFilterValue extends FilterDefinitionValue>({ filterDefinition, filterBarActions, options, loading, setValue, filterName, customSearch, showRequestMoreUseSearch, showUndefinedOptionWithCountAtBottom, pagination, }: DefaultFilterProps<TFilterValue>) => ReactElement;
|
|
11
11
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RelayPagination } from "@trackunit/react-components";
|
|
1
2
|
import { ReactNode } from "react";
|
|
2
3
|
import { FilterName, FilterViewProps } from "../types/FilterTypes";
|
|
3
4
|
export interface FilterOption {
|
|
@@ -49,6 +50,11 @@ export interface DefaultFilterProps<TReturnType> extends FilterViewProps<TReturn
|
|
|
49
50
|
* A flag indicating whether the "Use search to refine results." option should be displayed.
|
|
50
51
|
*/
|
|
51
52
|
showRequestMoreUseSearch?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Relay-style pagination for server-side infinite scroll in the filter list.
|
|
55
|
+
* When set, additional pages load as the user scrolls (via `useList` / `List`).
|
|
56
|
+
*/
|
|
57
|
+
pagination?: RelayPagination;
|
|
52
58
|
/**
|
|
53
59
|
* A flag indicating whether the key "UNDEFINED" should be moved to bottom of the list always visible. Default is true
|
|
54
60
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RelayPagination } from "@trackunit/react-components";
|
|
1
2
|
import { ReactElement } from "react";
|
|
2
3
|
interface DynamicFilterListProps {
|
|
3
4
|
/**
|
|
@@ -46,6 +47,10 @@ interface DynamicFilterListProps {
|
|
|
46
47
|
* A flag indicating whether the "Use search to refine results." option should be displayed.
|
|
47
48
|
*/
|
|
48
49
|
showRequestMoreUseSearch?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Relay-style pagination for server-side infinite scroll.
|
|
52
|
+
*/
|
|
53
|
+
pagination?: RelayPagination;
|
|
49
54
|
/**
|
|
50
55
|
* A class name to apply to the filter list.
|
|
51
56
|
*/
|
|
@@ -56,5 +61,5 @@ interface DynamicFilterListProps {
|
|
|
56
61
|
*
|
|
57
62
|
* @returns {ReactElement} - Returns the DynamicFilterList component.
|
|
58
63
|
*/
|
|
59
|
-
export declare const DynamicFilterList: ({ rowCount, keyMapper, labelMapper, onChange, checked, count, showRequestMoreUseSearch, type, className, }: DynamicFilterListProps) => ReactElement;
|
|
64
|
+
export declare const DynamicFilterList: ({ rowCount, keyMapper, labelMapper, onChange, checked, count, showRequestMoreUseSearch, pagination, type, className, }: DynamicFilterListProps) => ReactElement;
|
|
60
65
|
export {};
|
|
@@ -47,7 +47,7 @@ export type FilterMapGetter = {
|
|
|
47
47
|
export type FilterName = string;
|
|
48
48
|
export type FilterBarDefinition = Record<FilterName, FilterDefinition>;
|
|
49
49
|
export type FilterTranslation = string;
|
|
50
|
-
export type FilterGroup = "METADATA" | "STATUS" | "SITES" | "CUSTOMERS" | "OTHER" | "CUSTOM_FIELDS" | "MY_NETWORK" | "DEVICE_HEALTH" | "DEVICE" | "ASSET" | "OPERATOR" | "SERVICE" | "RENTAL" | "INTEGRATION" | "CURRENT_LOCATION" | "MANAGEMENT";
|
|
50
|
+
export type FilterGroup = "METADATA" | "STATUS" | "SITES" | "CUSTOMERS" | "OTHER" | "CUSTOM_FIELDS" | "MY_NETWORK" | "DEVICE_HEALTH" | "DEVICE" | "ASSET" | "OPERATOR" | "SERVICE" | "RENTAL" | "INTEGRATION" | "CURRENT_LOCATION" | "MANAGEMENT" | "METRICS";
|
|
51
51
|
export interface AbstractFilterDefinition {
|
|
52
52
|
/**
|
|
53
53
|
* The unique key or identifier for the filter.
|