@trackunit/filters-filter-bar 0.0.59 → 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
|
/// <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
|
|
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
|
|
7
|
+
export declare const toggleFilterValue: <T extends string | number | object>(value: T) => (prev?: T[] | undefined) => T[];
|