@vuu-ui/vuu-filters 0.7.0-debug → 0.7.1-debug

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.
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { Filter } from "@vuu-ui/vuu-filter-types";
3
+ import { TypeaheadParams } from "@vuu-ui/vuu-protocol-types";
4
+ export type IRange = {
5
+ start?: number;
6
+ end?: number;
7
+ };
8
+ type RangeFilterProps = {
9
+ defaultTypeaheadParams: TypeaheadParams;
10
+ filterValues: IRange | undefined;
11
+ onChange: (newValues: IRange, filter?: Filter) => void;
12
+ };
13
+ export declare const RangeFilter: ({ defaultTypeaheadParams, filterValues, onChange, }: RangeFilterProps) => JSX.Element;
14
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { TypeaheadParams } from "@vuu-ui/vuu-protocol-types";
3
+ import { Filter } from "@vuu-ui/vuu-filter-types";
4
+ export type TypeaheadFilterProps = {
5
+ defaultTypeaheadParams: TypeaheadParams;
6
+ onChange: (newValues: string[], filter?: Filter) => void;
7
+ filterValues?: string[];
8
+ };
9
+ export declare const TypeaheadFilter: ({ defaultTypeaheadParams, filterValues, onChange: onFilterChange, }: TypeaheadFilterProps) => JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./ColumnFilter";
@@ -0,0 +1,12 @@
1
+ import { Filter } from "@vuu-ui/vuu-filter-types";
2
+ import { IRange } from "./RangeFilter";
3
+ import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
4
+ export declare const useColumnFilterStore: (onFilterSubmit: (filterQuery: string, filter?: Filter) => void) => {
5
+ clear: () => void;
6
+ selectedColumnName: string;
7
+ rangeValue: IRange;
8
+ typeaheadValue: string[];
9
+ onSelectedColumnChange: (column: ColumnDescriptor | null) => void;
10
+ onRangeChange: (newValues: IRange, newFilter?: Filter) => void;
11
+ onTypeaheadChange: (newValues: string[], newFilter?: Filter) => void;
12
+ };
@@ -0,0 +1,4 @@
1
+ import { Filter } from "@vuu-ui/vuu-filter-types";
2
+ export declare const isStartsWithValue: (value: string) => boolean;
3
+ export declare const getTypeaheadFilter: (column: string, filterValues: string[], isStartsWithFilter?: boolean) => Filter | undefined;
4
+ export declare const getRangeFilter: (column: string, startValue?: number, endValue?: number) => Filter | undefined;
@@ -1,3 +1,4 @@
1
+ import { SuggestionFetcher } from "@vuu-ui/vuu-data";
1
2
  import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
2
3
  import { IFilterSuggestionProvider } from "@vuu-ui/vuu-filters";
3
4
  import { VuuTable } from "@vuu-ui/vuu-protocol-types";
@@ -10,5 +11,6 @@ export interface SuggestionProviderHookProps {
10
11
  namedFilters?: Map<string, string>;
11
12
  saveOptions?: FilterSaveOptions;
12
13
  table: VuuTable;
14
+ typeaheadHook?: () => SuggestionFetcher;
13
15
  }
14
- export declare const useFilterSuggestionProvider: ({ columns, namedFilters, saveOptions, table, }: SuggestionProviderHookProps) => IFilterSuggestionProvider;
16
+ export declare const useFilterSuggestionProvider: ({ columns, namedFilters, saveOptions, table, typeaheadHook: useTypeahead, }: SuggestionProviderHookProps) => IFilterSuggestionProvider;
@@ -1,3 +1,4 @@
1
+ import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
1
2
  import { KeyedColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
2
3
  import { Filter, FilterClause, FilterCombinatorOp } from "@vuu-ui/vuu-filter-types";
3
4
  export declare const AND = "and";
@@ -36,7 +37,7 @@ export declare const removeFilter: (sourceFilter: Filter, filterToRemove: Filter
36
37
  } | null;
37
38
  export declare const splitFilterOnColumn: (filter: Filter | null, columnName: string) => [Filter | null, Filter | null];
38
39
  export declare const overrideColName: (filter: Filter, column: string) => Filter;
39
- export declare const filterIncludesColumn: (filter: Filter, column: KeyedColumnDescriptor) => boolean;
40
+ export declare const filterIncludesColumn: (filter: Filter, column: ColumnDescriptor) => boolean;
40
41
  export declare const filterEquals: (f1?: Filter, f2?: Filter, strict?: boolean) => boolean;
41
42
  export declare const updateFilter: (filter: Filter | undefined, newFilter: Filter | undefined, mode: "add" | "replace") => Filter | undefined;
42
43
  export {};
package/types/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./column-filter";
1
2
  export * from "./filter-input";
2
3
  export * from "./filter-toolbar";
3
4
  export * from "./filter-evaluation-utils";