@trackunit/filters-filter-bar 1.18.1 → 1.18.2
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 +4 -4
- package/index.esm.js +4 -4
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -350,7 +350,7 @@ const FilterComponent = ({ filter, filterBarActions, filterState, readOnly = fal
|
|
|
350
350
|
const values = filterBarActions.getValuesByKey(filter.filterKey);
|
|
351
351
|
const valuesLength = values !== undefined && Array.isArray(values) ? values.length : undefined;
|
|
352
352
|
const getFilterText = () => {
|
|
353
|
-
if (values === undefined) {
|
|
353
|
+
if (values === undefined || values === null) {
|
|
354
354
|
return undefined;
|
|
355
355
|
}
|
|
356
356
|
if (filter.valueAsText) {
|
|
@@ -362,7 +362,7 @@ const FilterComponent = ({ filter, filterBarActions, filterState, readOnly = fal
|
|
|
362
362
|
else if (filter.type === "valueName") {
|
|
363
363
|
return values.name;
|
|
364
364
|
}
|
|
365
|
-
return values
|
|
365
|
+
return values.toString();
|
|
366
366
|
};
|
|
367
367
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
368
368
|
const setValue = (callback) => {
|
|
@@ -973,7 +973,7 @@ const CustomFieldsHiddenGroup = ({ appliedCustomFields, filterBarConfig, onClick
|
|
|
973
973
|
* @returns {ReactElement} The rendered TooltipValues component.
|
|
974
974
|
*/
|
|
975
975
|
const TooltipValues = ({ values }) => {
|
|
976
|
-
if (values === undefined) {
|
|
976
|
+
if (values === undefined || values === null) {
|
|
977
977
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
978
978
|
}
|
|
979
979
|
// Array of objects ValueName[]
|
|
@@ -1023,7 +1023,7 @@ const SingleFilterTooltipLabel = ({ filterBarConfig, filter, filterKey, }) => {
|
|
|
1023
1023
|
const title = react.useMemo(() => filterBarConfig.getFilterTitle(filterKey), [filterBarConfig, filterKey]);
|
|
1024
1024
|
const values = react.useMemo(() => filterBarConfig.getValuesByKey(filterKey), [filterBarConfig, filterKey]);
|
|
1025
1025
|
const displayValues = react.useMemo(() => {
|
|
1026
|
-
if (filter?.valueAsText) {
|
|
1026
|
+
if (values !== undefined && values !== null && filter?.valueAsText) {
|
|
1027
1027
|
return filter.valueAsText(values);
|
|
1028
1028
|
}
|
|
1029
1029
|
return values;
|
package/index.esm.js
CHANGED
|
@@ -348,7 +348,7 @@ const FilterComponent = ({ filter, filterBarActions, filterState, readOnly = fal
|
|
|
348
348
|
const values = filterBarActions.getValuesByKey(filter.filterKey);
|
|
349
349
|
const valuesLength = values !== undefined && Array.isArray(values) ? values.length : undefined;
|
|
350
350
|
const getFilterText = () => {
|
|
351
|
-
if (values === undefined) {
|
|
351
|
+
if (values === undefined || values === null) {
|
|
352
352
|
return undefined;
|
|
353
353
|
}
|
|
354
354
|
if (filter.valueAsText) {
|
|
@@ -360,7 +360,7 @@ const FilterComponent = ({ filter, filterBarActions, filterState, readOnly = fal
|
|
|
360
360
|
else if (filter.type === "valueName") {
|
|
361
361
|
return values.name;
|
|
362
362
|
}
|
|
363
|
-
return values
|
|
363
|
+
return values.toString();
|
|
364
364
|
};
|
|
365
365
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
366
366
|
const setValue = (callback) => {
|
|
@@ -971,7 +971,7 @@ const CustomFieldsHiddenGroup = ({ appliedCustomFields, filterBarConfig, onClick
|
|
|
971
971
|
* @returns {ReactElement} The rendered TooltipValues component.
|
|
972
972
|
*/
|
|
973
973
|
const TooltipValues = ({ values }) => {
|
|
974
|
-
if (values === undefined) {
|
|
974
|
+
if (values === undefined || values === null) {
|
|
975
975
|
return jsx(Fragment, {});
|
|
976
976
|
}
|
|
977
977
|
// Array of objects ValueName[]
|
|
@@ -1021,7 +1021,7 @@ const SingleFilterTooltipLabel = ({ filterBarConfig, filter, filterKey, }) => {
|
|
|
1021
1021
|
const title = useMemo(() => filterBarConfig.getFilterTitle(filterKey), [filterBarConfig, filterKey]);
|
|
1022
1022
|
const values = useMemo(() => filterBarConfig.getValuesByKey(filterKey), [filterBarConfig, filterKey]);
|
|
1023
1023
|
const displayValues = useMemo(() => {
|
|
1024
|
-
if (filter?.valueAsText) {
|
|
1024
|
+
if (values !== undefined && values !== null && filter?.valueAsText) {
|
|
1025
1025
|
return filter.valueAsText(values);
|
|
1026
1026
|
}
|
|
1027
1027
|
return values;
|