@trackunit/filters-filter-bar 0.0.58 → 0.0.62

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
@@ -344,7 +344,7 @@ const reduceFilterText = (input) => {
344
344
  *
345
345
  * @returns {JSX.Element} - Returns the Filter component.
346
346
  */
347
- const Filter = ({ filter, filterBarActions, filterState }) => {
347
+ const Filter = ({ filter, filterBarActions, filterState, }) => {
348
348
  const values = filterBarActions.getValuesByKey(filter.filterKey);
349
349
  const filterText = () => {
350
350
  if (values) {
package/index.esm.js CHANGED
@@ -340,7 +340,7 @@ const reduceFilterText = (input) => {
340
340
  *
341
341
  * @returns {JSX.Element} - Returns the Filter component.
342
342
  */
343
- const Filter = ({ filter, filterBarActions, filterState }) => {
343
+ const Filter = ({ filter, filterBarActions, filterState, }) => {
344
344
  const values = filterBarActions.getValuesByKey(filter.filterKey);
345
345
  const filterText = () => {
346
346
  if (values) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/filters-filter-bar",
3
- "version": "0.0.58",
3
+ "version": "0.0.62",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -13,13 +13,13 @@
13
13
  "@trackunit/react-filter-components": "*",
14
14
  "react": "^18.2.0",
15
15
  "@trackunit/react-form-components": "*",
16
- "react-router-dom": "6.11.2",
16
+ "react-router-dom": "6.18.0",
17
17
  "react-virtual": "^2.10.4",
18
18
  "dequal": "^2.0.3",
19
- "@trackunit/react-core-contexts-api": "*",
20
19
  "lodash": "4.17.21",
21
- "@trackunit/i18n-library-translation": "*",
22
- "jest-fetch-mock": "^3.0.3"
20
+ "jest-fetch-mock": "^3.0.3",
21
+ "@trackunit/react-core-contexts-api": "*",
22
+ "@trackunit/i18n-library-translation": "*"
23
23
  },
24
24
  "module": "./index.esm.js",
25
25
  "main": "./index.cjs.js"
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { FilterDefinition, FilterMapActions, FilterMapGetter, FilterState } from "../types/FilterTypes";
3
- interface FilterProps {
2
+ import { FilterBarDefinition, FilterDefinition, FilterMapActions, FilterMapGetter, FilterState } from "../types/FilterTypes";
3
+ interface FilterProps<T extends FilterBarDefinition> {
4
4
  /**
5
5
  * The definition of the filter.
6
6
  */
@@ -8,7 +8,7 @@ interface FilterProps {
8
8
  /**
9
9
  * The state of the filter.
10
10
  */
11
- filterState: FilterState<{}>;
11
+ filterState: FilterState<T>;
12
12
  /**
13
13
  * Actions and getters for the filter bar.
14
14
  */
@@ -19,5 +19,5 @@ interface FilterProps {
19
19
  *
20
20
  * @returns {JSX.Element} - Returns the Filter component.
21
21
  */
22
- export declare const Filter: ({ filter, filterBarActions, filterState }: FilterProps) => JSX.Element;
22
+ export declare const Filter: <T extends FilterBarDefinition>({ filter, filterBarActions, filterState, }: FilterProps<T>) => JSX.Element;
23
23
  export {};
@@ -22,5 +22,5 @@ interface VirtualizedListProps<T> {
22
22
  * @template T - The type of data items in the list.
23
23
  * @returns {JSX.Element} - Returns the virtualized list component.
24
24
  */
25
- export declare const VirtualizedList: <T extends {}>({ parentRef, count, children }: VirtualizedListProps<T>) => JSX.Element;
25
+ export declare const VirtualizedList: <T>({ parentRef, count, children }: VirtualizedListProps<T>) => JSX.Element;
26
26
  export {};
@@ -4,4 +4,4 @@
4
4
  * @template T - The type of the filter values.
5
5
  * @returns {(prev?: T[]) => T[]} A function that takes an optional previous array of filter values
6
6
  */
7
- export declare const toggleFilterValue: <T extends Object>(value: T) => (prev?: T[] | undefined) => T[];
7
+ export declare const toggleFilterValue: <T extends string | number | object>(value: T) => (prev?: T[] | undefined) => T[];