@trackunit/filters-filter-bar 1.18.5 → 1.18.6
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 +6 -5
- package/index.esm.js +6 -5
- package/package.json +7 -7
package/index.cjs.js
CHANGED
|
@@ -495,7 +495,7 @@ const ITEM_HEIGHT = 28; //measured in DevTools on 03/10/2025
|
|
|
495
495
|
*
|
|
496
496
|
* @returns {ReactElement} - Returns the DynamicFilterList component.
|
|
497
497
|
*/
|
|
498
|
-
const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked, count, showRequestMoreUseSearch = false, type, className, }) => {
|
|
498
|
+
const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked, count, showRequestMoreUseSearch = false, type = undefined, className, }) => {
|
|
499
499
|
const [t] = useTranslation();
|
|
500
500
|
const parentRef = react.useRef(null);
|
|
501
501
|
const updatedRowCount = react.useMemo(() => (showRequestMoreUseSearch ? rowCount + 1 : rowCount), [rowCount, showRequestMoreUseSearch]);
|
|
@@ -532,13 +532,14 @@ const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked
|
|
|
532
532
|
*
|
|
533
533
|
* @returns {ReactElement} - Returns the FilterHeader component.
|
|
534
534
|
*/
|
|
535
|
-
const FilterHeader = ({ filterKey, title, searchEnabled, searchProps, filterHasChanges, resetIndividualFilterToInitialState, onResetFilter, loading = false, className, "data-testid": dataTestId, hideHeader = false, children, }) => {
|
|
535
|
+
const FilterHeader = ({ filterKey, title, searchEnabled = false, searchProps, filterHasChanges, resetIndividualFilterToInitialState, onResetFilter, loading = false, className, "data-testid": dataTestId, hideHeader = false, children, }) => {
|
|
536
536
|
const [t] = useTranslation();
|
|
537
537
|
const handleResetFilter = () => {
|
|
538
538
|
resetIndividualFilterToInitialState(filterKey);
|
|
539
539
|
onResetFilter?.();
|
|
540
540
|
};
|
|
541
|
-
|
|
541
|
+
const searchComponent = searchEnabled && searchProps !== undefined ? (jsxRuntime.jsx(FilterHeaderSearchComponent, { filterKey: filterKey, searchProps: searchProps })) : undefined;
|
|
542
|
+
return (jsxRuntime.jsx(reactFilterComponents.FilterHeader, { className: className, "data-testid": dataTestId ?? `${filterKey}-filter-header`, loading: loading, onReset: handleResetFilter, resetLabel: t("filtersBar.resetFilter"), searchComponent: searchComponent, showReset: filterHasChanges, title: hideHeader ? undefined : title, children: children }));
|
|
542
543
|
};
|
|
543
544
|
/**
|
|
544
545
|
* FilterHeaderSearchComponent renders a search input for the FilterHeader component.
|
|
@@ -560,7 +561,7 @@ const FilterHeaderSearchComponent = ({ searchProps, filterKey, }) => {
|
|
|
560
561
|
* shows no results if length or array is 0
|
|
561
562
|
* otherwise it calls children as a render prop
|
|
562
563
|
*/
|
|
563
|
-
const FilterResults = ({ results, ignoreUndefined, loading, children, }) => {
|
|
564
|
+
const FilterResults = ({ results, ignoreUndefined = false, loading, children, }) => {
|
|
564
565
|
if (!results) {
|
|
565
566
|
return null;
|
|
566
567
|
}
|
|
@@ -569,7 +570,7 @@ const FilterResults = ({ results, ignoreUndefined, loading, children, }) => {
|
|
|
569
570
|
}
|
|
570
571
|
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: children(results) });
|
|
571
572
|
};
|
|
572
|
-
const EmptyResults = ({ loading }) => {
|
|
573
|
+
const EmptyResults = ({ loading = false }) => {
|
|
573
574
|
const [t] = useTranslation();
|
|
574
575
|
return (jsxRuntime.jsx("div", { className: "grid h-20 w-[280px] place-content-center pl-2 pr-2", "data-testid": "empty-filter-results", children: jsxRuntime.jsx(reactComponents.Text, { align: "center", className: "w-full break-words", italicize: true, subtle: true, children: loading ? t("filtersBar.loading") : t("filtersBar.emptyResults") }) }));
|
|
575
576
|
};
|
package/index.esm.js
CHANGED
|
@@ -493,7 +493,7 @@ const ITEM_HEIGHT = 28; //measured in DevTools on 03/10/2025
|
|
|
493
493
|
*
|
|
494
494
|
* @returns {ReactElement} - Returns the DynamicFilterList component.
|
|
495
495
|
*/
|
|
496
|
-
const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked, count, showRequestMoreUseSearch = false, type, className, }) => {
|
|
496
|
+
const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked, count, showRequestMoreUseSearch = false, type = undefined, className, }) => {
|
|
497
497
|
const [t] = useTranslation();
|
|
498
498
|
const parentRef = useRef(null);
|
|
499
499
|
const updatedRowCount = useMemo(() => (showRequestMoreUseSearch ? rowCount + 1 : rowCount), [rowCount, showRequestMoreUseSearch]);
|
|
@@ -530,13 +530,14 @@ const DynamicFilterList = ({ rowCount, keyMapper, labelMapper, onChange, checked
|
|
|
530
530
|
*
|
|
531
531
|
* @returns {ReactElement} - Returns the FilterHeader component.
|
|
532
532
|
*/
|
|
533
|
-
const FilterHeader = ({ filterKey, title, searchEnabled, searchProps, filterHasChanges, resetIndividualFilterToInitialState, onResetFilter, loading = false, className, "data-testid": dataTestId, hideHeader = false, children, }) => {
|
|
533
|
+
const FilterHeader = ({ filterKey, title, searchEnabled = false, searchProps, filterHasChanges, resetIndividualFilterToInitialState, onResetFilter, loading = false, className, "data-testid": dataTestId, hideHeader = false, children, }) => {
|
|
534
534
|
const [t] = useTranslation();
|
|
535
535
|
const handleResetFilter = () => {
|
|
536
536
|
resetIndividualFilterToInitialState(filterKey);
|
|
537
537
|
onResetFilter?.();
|
|
538
538
|
};
|
|
539
|
-
|
|
539
|
+
const searchComponent = searchEnabled && searchProps !== undefined ? (jsx(FilterHeaderSearchComponent, { filterKey: filterKey, searchProps: searchProps })) : undefined;
|
|
540
|
+
return (jsx(FilterHeader$1, { className: className, "data-testid": dataTestId ?? `${filterKey}-filter-header`, loading: loading, onReset: handleResetFilter, resetLabel: t("filtersBar.resetFilter"), searchComponent: searchComponent, showReset: filterHasChanges, title: hideHeader ? undefined : title, children: children }));
|
|
540
541
|
};
|
|
541
542
|
/**
|
|
542
543
|
* FilterHeaderSearchComponent renders a search input for the FilterHeader component.
|
|
@@ -558,7 +559,7 @@ const FilterHeaderSearchComponent = ({ searchProps, filterKey, }) => {
|
|
|
558
559
|
* shows no results if length or array is 0
|
|
559
560
|
* otherwise it calls children as a render prop
|
|
560
561
|
*/
|
|
561
|
-
const FilterResults = ({ results, ignoreUndefined, loading, children, }) => {
|
|
562
|
+
const FilterResults = ({ results, ignoreUndefined = false, loading, children, }) => {
|
|
562
563
|
if (!results) {
|
|
563
564
|
return null;
|
|
564
565
|
}
|
|
@@ -567,7 +568,7 @@ const FilterResults = ({ results, ignoreUndefined, loading, children, }) => {
|
|
|
567
568
|
}
|
|
568
569
|
return jsx(Fragment, { children: children(results) });
|
|
569
570
|
};
|
|
570
|
-
const EmptyResults = ({ loading }) => {
|
|
571
|
+
const EmptyResults = ({ loading = false }) => {
|
|
571
572
|
const [t] = useTranslation();
|
|
572
573
|
return (jsx("div", { className: "grid h-20 w-[280px] place-content-center pl-2 pr-2", "data-testid": "empty-filter-results", children: jsx(Text, { align: "center", className: "w-full break-words", italicize: true, subtle: true, children: loading ? t("filtersBar.loading") : t("filtersBar.emptyResults") }) }));
|
|
573
574
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/filters-filter-bar",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.6",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"string-ts": "^2.0.0",
|
|
13
13
|
"zod": "^3.23.8",
|
|
14
14
|
"@trackunit/iris-app-api": "1.15.9",
|
|
15
|
-
"@trackunit/react-core-hooks": "1.14.
|
|
16
|
-
"@trackunit/react-filter-components": "1.17.
|
|
17
|
-
"@trackunit/react-date-and-time-components": "1.20.
|
|
15
|
+
"@trackunit/react-core-hooks": "1.14.3",
|
|
16
|
+
"@trackunit/react-filter-components": "1.17.5",
|
|
17
|
+
"@trackunit/react-date-and-time-components": "1.20.5",
|
|
18
18
|
"@trackunit/shared-utils": "1.13.77",
|
|
19
|
-
"@trackunit/react-form-components": "1.18.
|
|
19
|
+
"@trackunit/react-form-components": "1.18.4",
|
|
20
20
|
"@trackunit/iris-app-runtime-core-api": "1.13.2",
|
|
21
21
|
"@trackunit/geo-json-utils": "1.11.78",
|
|
22
|
-
"@trackunit/i18n-library-translation": "1.15.
|
|
22
|
+
"@trackunit/i18n-library-translation": "1.15.4",
|
|
23
23
|
"@trackunit/css-class-variance-utilities": "1.11.77",
|
|
24
|
-
"@trackunit/react-components": "1.20.
|
|
24
|
+
"@trackunit/react-components": "1.20.4"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^19.0.0",
|