@trackunit/filters-filter-bar 0.0.13 → 0.0.15
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 +2 -1
- package/index.esm.js +2 -1
- package/package.json +11 -11
- package/src/lib/hooks/useFilterBar.d.ts +5 -2
- package/src/lib/types/FilterTypes.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -349,7 +349,7 @@ const reduceFilterText = (input) => {
|
|
|
349
349
|
const Filter = ({ filter, filterBarActions, filterState }) => {
|
|
350
350
|
const values = filterBarActions.getValuesByKey(filter.filterKey);
|
|
351
351
|
const filterText = () => {
|
|
352
|
-
if (values
|
|
352
|
+
if (values) {
|
|
353
353
|
if (filter.valueAsText) {
|
|
354
354
|
return reduceFilterText(filter.valueAsText(values));
|
|
355
355
|
}
|
|
@@ -18788,6 +18788,7 @@ const useFilterBar = ({ name, onValuesChange, filterBarDefinition, initialState,
|
|
|
18788
18788
|
},
|
|
18789
18789
|
};
|
|
18790
18790
|
}, [filterBarConfig]);
|
|
18791
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
18791
18792
|
const filterMapActions = React.useMemo(() => {
|
|
18792
18793
|
// Reset an individual filter to its initial state
|
|
18793
18794
|
const resetIndividualFilterToInitialState = (key) => {
|
package/index.esm.js
CHANGED
|
@@ -341,7 +341,7 @@ const reduceFilterText = (input) => {
|
|
|
341
341
|
const Filter = ({ filter, filterBarActions, filterState }) => {
|
|
342
342
|
const values = filterBarActions.getValuesByKey(filter.filterKey);
|
|
343
343
|
const filterText = () => {
|
|
344
|
-
if (values
|
|
344
|
+
if (values) {
|
|
345
345
|
if (filter.valueAsText) {
|
|
346
346
|
return reduceFilterText(filter.valueAsText(values));
|
|
347
347
|
}
|
|
@@ -18780,6 +18780,7 @@ const useFilterBar = ({ name, onValuesChange, filterBarDefinition, initialState,
|
|
|
18780
18780
|
},
|
|
18781
18781
|
};
|
|
18782
18782
|
}, [filterBarConfig]);
|
|
18783
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
18783
18784
|
const filterMapActions = useMemo(() => {
|
|
18784
18785
|
// Reset an individual filter to its initial state
|
|
18785
18786
|
const resetIndividualFilterToInitialState = (key) => {
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/filters-filter-bar",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18.x"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@trackunit/i18n-library-translation": "0.0.
|
|
11
|
-
"@trackunit/iris-app-api": "0.0.
|
|
12
|
-
"@trackunit/iris-app-runtime-core-api": "0.3.
|
|
13
|
-
"@trackunit/react-components": "0.1.
|
|
14
|
-
"@trackunit/react-core-contexts-api": "0.2.
|
|
15
|
-
"@trackunit/react-core-contexts-test": "0.1.
|
|
16
|
-
"@trackunit/react-core-hooks": "0.2.
|
|
17
|
-
"@trackunit/react-filter-components": "0.0.
|
|
18
|
-
"@trackunit/react-form-components": "0.0.
|
|
19
|
-
"@trackunit/shared-utils": "0.0.
|
|
10
|
+
"@trackunit/i18n-library-translation": "0.0.86",
|
|
11
|
+
"@trackunit/iris-app-api": "0.0.124",
|
|
12
|
+
"@trackunit/iris-app-runtime-core-api": "0.3.77",
|
|
13
|
+
"@trackunit/react-components": "0.1.172",
|
|
14
|
+
"@trackunit/react-core-contexts-api": "0.2.63",
|
|
15
|
+
"@trackunit/react-core-contexts-test": "0.1.119",
|
|
16
|
+
"@trackunit/react-core-hooks": "0.2.104",
|
|
17
|
+
"@trackunit/react-filter-components": "0.0.227",
|
|
18
|
+
"@trackunit/react-form-components": "0.0.168",
|
|
19
|
+
"@trackunit/shared-utils": "0.0.11",
|
|
20
20
|
"dequal": "2.0.3",
|
|
21
21
|
"lodash": "4.17.21",
|
|
22
22
|
"react": "18.2.0",
|
|
@@ -34,10 +34,13 @@ export declare const useFilterBar: <TFilterBarDefinition extends FilterBarDefini
|
|
|
34
34
|
isFilterIncludedByKey(key: string): boolean;
|
|
35
35
|
updateStarredFilters: (filterkey: string) => void;
|
|
36
36
|
toggleArrayValue: (key: string, value: string) => void;
|
|
37
|
+
setStringValue: (key: string, value: string) => void;
|
|
37
38
|
/**
|
|
38
|
-
*
|
|
39
|
+
* Custom hook for managing a filter bar's state and actions.
|
|
40
|
+
*
|
|
41
|
+
* @template TFilterBarDefinition - A generic type for the filter bar definition.
|
|
42
|
+
* @returns {object} An object containing filter bar configuration and actions.
|
|
39
43
|
*/
|
|
40
|
-
setStringValue: (key: string, value: string) => void;
|
|
41
44
|
setArrayValue: (key: string, value: string[]) => void;
|
|
42
45
|
setBoundingBox: (boundingBox: BoundingBox) => void;
|
|
43
46
|
setNumberValue: (key: string, value: NumberValue) => void;
|
|
@@ -14,6 +14,7 @@ export type Coordinate = {
|
|
|
14
14
|
longitude: number;
|
|
15
15
|
};
|
|
16
16
|
export type BoundingBox = {
|
|
17
|
+
/** The coordinates for the North/West values of the bounding box. */
|
|
17
18
|
nw: Coordinate;
|
|
18
19
|
/** The coordinates for the South/East values of the bounding box. */
|
|
19
20
|
se: Coordinate;
|