@vuu-ui/vuu-filters 0.8.4-debug → 0.8.5-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.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@vuu-ui/vuu-filters",
3
- "version": "0.8.4-debug",
3
+ "version": "0.8.5-debug",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "dependencies": {
8
- "@vuu-ui/vuu-codemirror": "0.8.4-debug",
9
- "@vuu-ui/vuu-data-react": "0.8.4-debug",
10
- "@vuu-ui/vuu-data-types": "0.8.4-debug",
11
- "@vuu-ui/vuu-utils": "0.8.4-debug",
8
+ "@vuu-ui/vuu-codemirror": "0.8.5-debug",
9
+ "@vuu-ui/vuu-data-react": "0.8.5-debug",
10
+ "@vuu-ui/vuu-data-types": "0.8.5-debug",
11
+ "@vuu-ui/vuu-utils": "0.8.5-debug",
12
12
  "@salt-ds/core": "1.2.0",
13
13
  "@heswell/salt-lab": "1.0.0-alpha.2",
14
14
  "uuid": "9.0.0"
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import "./CloseButton.css";
3
+ type CloseButtonProps = {
4
+ classBase: string;
5
+ onClick: () => void;
6
+ };
7
+ export declare const CloseButton: ({ classBase, onClick }: CloseButtonProps) => JSX.Element;
8
+ export {};
@@ -0,0 +1,13 @@
1
+ import { HTMLAttributes } from "react";
2
+ import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
3
+ import { Filter, FilterClause as FilterClauseType } from "@vuu-ui/vuu-filter-types";
4
+ import { VuuTable } from "@vuu-ui/vuu-protocol-types";
5
+ import "./FilterClause.css";
6
+ export type FilterClauseProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange"> & {
7
+ table: VuuTable;
8
+ onChange: (filter?: Filter) => void;
9
+ onClose: () => void;
10
+ columns: ColumnDescriptor[];
11
+ defaultFilter?: FilterClauseType;
12
+ };
13
+ export declare const FilterClause: ({ table, onChange, onClose, columns, defaultFilter, ...htmlAttributes }: FilterClauseProps) => JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { HTMLAttributes, RefObject } from "react";
2
+ import { Filter, FilterClause } from "@vuu-ui/vuu-filter-types";
3
+ type NumericInputProps = HTMLAttributes<HTMLDivElement> & {
4
+ column: string;
5
+ operatorInputRef: RefObject<HTMLInputElement>;
6
+ onFilterChange: (filter?: Filter) => void;
7
+ defaultFilter?: FilterClause;
8
+ };
9
+ export declare const NumericInput: ({ column, operatorInputRef, onFilterChange, defaultFilter, className, }: NumericInputProps) => JSX.Element;
10
+ export {};
@@ -0,0 +1,12 @@
1
+ import { HTMLAttributes, RefObject } from "react";
2
+ import { Filter, FilterClause } from "@vuu-ui/vuu-filter-types";
3
+ import { VuuTable } from "@vuu-ui/vuu-protocol-types";
4
+ type TextInputProps = HTMLAttributes<HTMLDivElement> & {
5
+ table: VuuTable;
6
+ column: string;
7
+ operatorInputRef: RefObject<HTMLInputElement>;
8
+ onFilterChange: (filter?: Filter) => void;
9
+ defaultFilter?: FilterClause;
10
+ };
11
+ export declare const TextInput: ({ table, column, operatorInputRef, onFilterChange, defaultFilter, className, }: TextInputProps) => JSX.Element;
12
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./FilterClause";
@@ -1,5 +1,6 @@
1
1
  import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
2
2
  import { Filter, FilterClause, FilterCombinatorOp } from "@vuu-ui/vuu-filter-types";
3
+ import { NumericOperator } from "./operator-utils";
3
4
  export declare const AND = "and";
4
5
  export declare const EQUALS = "=";
5
6
  export declare const GREATER_THAN = ">";
@@ -37,4 +38,6 @@ export declare const overrideColName: (filter: Filter, column: string) => Filter
37
38
  export declare const filterIncludesColumn: (filter: Filter, column: ColumnDescriptor) => boolean;
38
39
  export declare const filterEquals: (f1?: Filter, f2?: Filter, strict?: boolean) => boolean;
39
40
  export declare const updateFilter: (filter: Filter | undefined, newFilter: Filter | undefined, mode: "add" | "replace") => Filter | undefined;
41
+ export declare const getTypeaheadFilter: (column: string, filterValues: string[], isStartsWithFilter?: boolean) => Filter | undefined;
42
+ export declare const getNumericFilter: (column: string, operator?: NumericOperator, value?: number) => Filter | undefined;
40
43
  export {};
package/types/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from "./column-filter";
2
1
  export * from "./filter-input";
3
2
  export * from "./filter-toolbar";
4
3
  export * from "./filter-utils";
@@ -0,0 +1,21 @@
1
+ export declare enum TextOperator {
2
+ EQUALS = "=",
3
+ NOT_EQUALS = "!=",
4
+ IN = "in",
5
+ STARTS_WITH = "startsWith",
6
+ ENDS_WITH = "endsWith"
7
+ }
8
+ export declare const TEXT_OPERATORS: TextOperator[];
9
+ export declare enum NumericOperator {
10
+ EQUALS = "=",
11
+ NOT_EQUALS = "!=",
12
+ GREATER_THAN = ">",
13
+ GREATER_THAN_OR_EQUAL_TO = ">=",
14
+ LESS_THAN = "<",
15
+ LESS_THAN_OR_EQUAL_TO = "<="
16
+ }
17
+ export declare const NUMERIC_OPERATORS: NumericOperator[];
18
+ export declare const isString: (value: unknown) => value is string;
19
+ export declare const isTextOperator: (value?: string) => value is TextOperator;
20
+ export declare const isNumber: (value: unknown) => value is number;
21
+ export declare const isNumericOperator: (value?: string) => value is NumericOperator;
@@ -1,11 +0,0 @@
1
- import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
2
- import { VuuTable } from "@vuu-ui/vuu-protocol-types";
3
- import { HTMLAttributes } from "react";
4
- import { DataSourceFilter } from "@vuu-ui/vuu-data-types";
5
- type FilterPanelProps = HTMLAttributes<HTMLDivElement> & {
6
- table: VuuTable;
7
- columns: ColumnDescriptor[];
8
- onFilterSubmit: (filter: DataSourceFilter) => void;
9
- };
10
- export declare const ColumnFilter: ({ className, table, columns, onFilterSubmit, ...htmlAttributes }: FilterPanelProps) => JSX.Element;
11
- export {};
@@ -1,3 +0,0 @@
1
- import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
2
- import { ListItemType } from "@heswell/salt-lab";
3
- export declare const ColumnListItem: ListItemType<ColumnDescriptor>;
@@ -1,14 +0,0 @@
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 {};
@@ -1,9 +0,0 @@
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 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;
@@ -1 +0,0 @@
1
- export * from "./ColumnFilter";
@@ -1,13 +0,0 @@
1
- import { DataSourceFilter } from "@vuu-ui/vuu-data-types";
2
- import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
3
- import { Filter } from "@vuu-ui/vuu-filter-types";
4
- import { IRange } from "./RangeFilter";
5
- export declare const useColumnFilterStore: (onFilterSubmit: (filter: DataSourceFilter) => void) => {
6
- clear: () => void;
7
- selectedColumnName: string;
8
- rangeValue: IRange;
9
- typeaheadValue: string[];
10
- onSelectedColumnChange: (column: ColumnDescriptor | null) => void;
11
- onRangeChange: (newValues: IRange, newFilter?: Filter) => void;
12
- onTypeaheadChange: (newValues: string[], newFilter?: Filter) => void;
13
- };