@vuu-ui/vuu-filters 0.7.0 → 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.
- package/cjs/index.js +2045 -1
- package/cjs/index.js.map +4 -4
- package/esm/index.js +2079 -1
- package/esm/index.js.map +4 -4
- package/index.css +56 -1
- package/index.css.map +1 -1
- package/package.json +4 -4
- package/types/column-filter/ColumnFilter.d.ts +11 -0
- package/types/column-filter/ColumnListItem.d.ts +3 -0
- package/types/column-filter/RangeFilter.d.ts +14 -0
- package/types/column-filter/TypeaheadFilter.d.ts +9 -0
- package/types/column-filter/index.d.ts +1 -0
- package/types/column-filter/useColumnFilterStore.d.ts +12 -0
- package/types/column-filter/utils.d.ts +4 -0
- package/types/filter-input/useFilterSuggestionProvider.d.ts +3 -1
- package/types/filter-utils.d.ts +2 -1
- package/types/index.d.ts +1 -0
package/index.css
CHANGED
|
@@ -1,2 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
/* src/filter-input/FilterInput.css */
|
|
2
|
+
.salt-theme {
|
|
3
|
+
--vuuFilterEditor-lineHeight: 28px;
|
|
4
|
+
}
|
|
5
|
+
.salt-density-high {
|
|
6
|
+
--vuuFilterEditor-buttonWidth: 20px;
|
|
7
|
+
--vuuFilterEditor-height: 22px;
|
|
8
|
+
--vuuFilterEditor-lineHeight: 20px;
|
|
9
|
+
}
|
|
10
|
+
.vuuFilterInput {
|
|
11
|
+
--vuuFilterEditor-background: var(--salt-container-primary-background);
|
|
12
|
+
--vuuFilterEditor-color: var(--salt-text-primary-foreground);
|
|
13
|
+
--vuuFilterEditor-fontFamily: var(--salt-typography-fontFamily);
|
|
14
|
+
--vuuFilterEditor-fontSize: var(--salt-text-fontSize);
|
|
15
|
+
--vuuFilterEditor-cursorColor: var(--salt-text-secondary-foreground);
|
|
16
|
+
--vuuFilterEditor-selectionBackground: var(--salt-text-background-selected);
|
|
17
|
+
--vuuFilterEditor-tooltipBackground: var(--salt-container-primary-background);
|
|
18
|
+
--vuuFilterEditor-tooltipBorder: var(--tooltip-status-borderColor) var(--salt-container-borderWidth) var(--salt-container-borderStyle);
|
|
19
|
+
--vuuFilterEditor-tooltipElevation: var(--salt-overlayable-shadow-popout);
|
|
20
|
+
--vuuFilterEditor-suggestion-selectedBackground: var(--salt-selectable-background-selected);
|
|
21
|
+
--vuuFilterEditor-suggestion-selectedColor: var(--vuuFilterEditor-color);
|
|
22
|
+
--vuuFilterEditor-suggestion-height: 24px;
|
|
23
|
+
--vuuFilterEditor-variableColor: blue;
|
|
24
|
+
align-items: center;
|
|
25
|
+
border-color: var(--salt-container-secondary-borderColor);
|
|
26
|
+
border-style: solid none;
|
|
27
|
+
border-width: 1px;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
display: flex;
|
|
30
|
+
height: var(--vuuFilterEditor-height, 30px);
|
|
31
|
+
}
|
|
32
|
+
.vuuFilterInput-Editor {
|
|
33
|
+
flex: 1 1 auto;
|
|
34
|
+
height: 100%;
|
|
35
|
+
}
|
|
36
|
+
.vuuFilterInput-FilterButton,
|
|
37
|
+
.vuuFilterInput-ClearButton {
|
|
38
|
+
--vuu-icon-size: 12px;
|
|
39
|
+
--saltButton-width: var(--vuuFilterEditor-buttonWidth, 28px);
|
|
40
|
+
}
|
|
41
|
+
.vuuIllustration {
|
|
42
|
+
--vuuFilterEditor-suggestion-selectedBackground:var(--salt-container-secondary-background);
|
|
43
|
+
background: var(--salt-container-secondary-background);
|
|
44
|
+
color: var(--salt-text-secondary-foreground);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* src/filter-toolbar/FilterToolbar.css */
|
|
48
|
+
.vuuFilterDropdown,
|
|
49
|
+
.vuuFilterSwitch {
|
|
50
|
+
--saltToolbarField-marginTop: 0;
|
|
51
|
+
height: 100%;
|
|
52
|
+
}
|
|
53
|
+
.vuuFilterDropdown.saltFormField-focused:before {
|
|
54
|
+
top: 2px !important;
|
|
55
|
+
bottom: 2px !important;
|
|
56
|
+
}
|
|
2
57
|
/*# sourceMappingURL=index.css.map */
|
package/index.css.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/vuu-filters/src/filter-input/FilterInput.css", "../../../packages/vuu-filters/src/filter-toolbar/FilterToolbar.css"],
|
|
4
4
|
"sourcesContent": ["\n.salt-theme {\n --vuuFilterEditor-lineHeight: 28px;\n}\n\n.salt-density-high {\n --vuuFilterEditor-buttonWidth: 20px;\n --vuuFilterEditor-height: 22px;\n --vuuFilterEditor-lineHeight: 20px;\n}\n\n.vuuFilterInput {\n --vuuFilterEditor-background: var(--salt-container-primary-background);\n --vuuFilterEditor-color: var(--salt-text-primary-foreground);\n --vuuFilterEditor-fontFamily: var(--salt-typography-fontFamily);\n --vuuFilterEditor-fontSize: var(--salt-text-fontSize);\n --vuuFilterEditor-cursorColor: var(--salt-text-secondary-foreground);\n --vuuFilterEditor-selectionBackground: var(--salt-text-background-selected);\n --vuuFilterEditor-tooltipBackground: var(--salt-container-primary-background);\n --vuuFilterEditor-tooltipBorder: var(--tooltip-status-borderColor) var(--salt-container-borderWidth) var(--salt-container-borderStyle); \n --vuuFilterEditor-tooltipElevation: var(--salt-overlayable-shadow-popout);\n --vuuFilterEditor-suggestion-selectedBackground: var(--salt-selectable-background-selected);\n --vuuFilterEditor-suggestion-selectedColor: var(--vuuFilterEditor-color);\n --vuuFilterEditor-suggestion-height: 24px;\n --vuuFilterEditor-variableColor: blue;\n\n align-items: center;\n border-color: var(--salt-container-secondary-borderColor);\n border-style: solid none;\n border-width: 1px;\n box-sizing: border-box;\n display: flex;\n height: var(--vuuFilterEditor-height, 30px);\n}\n\n.vuuFilterInput-Editor {\n flex: 1 1 auto;\n height: 100%;\n}\n\n.vuuFilterInput-FilterButton,\n.vuuFilterInput-ClearButton {\n --vuu-icon-size: 12px;\n --saltButton-width: var(--vuuFilterEditor-buttonWidth, 28px);\n}\n\n.vuuIllustration {\n --vuuFilterEditor-suggestion-selectedBackground:var(--salt-container-secondary-background);\n background: var(--salt-container-secondary-background);\n color: var(--salt-text-secondary-foreground);\n}\n\n\n", ".vuuFilterDropdown,\n.vuuFilterSwitch {\n --saltToolbarField-marginTop: 0;\n\n height: 100%;\n}\n\n.vuuFilterDropdown.saltFormField-focused:before {\n top: 2px !important;\n bottom: 2px !important;\n}"],
|
|
5
|
-
"mappings": "AACA
|
|
5
|
+
"mappings": ";AACA;AACI;AAAA;AAGJ;AACI;AACA;AACA;AAAA;AAGJ;AACI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGJ;AACI;AACA;AAAA;AAGJ;AAAA;AAEI;AACA;AAAA;AAGJ;AACI;AACA;AACA;AAAA;;;ACjDJ;AAAA;AAEI;AAEA;AAAA;AAGJ;AACI;AACA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuu-ui/vuu-filters",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1-debug",
|
|
4
4
|
"author": "heswell",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@vuu-ui/vuu-codemirror": "0.7.
|
|
9
|
-
"@vuu-ui/vuu-data": "0.7.
|
|
10
|
-
"@vuu-ui/vuu-utils": "0.7.
|
|
8
|
+
"@vuu-ui/vuu-codemirror": "0.7.1-debug",
|
|
9
|
+
"@vuu-ui/vuu-data": "0.7.1-debug",
|
|
10
|
+
"@vuu-ui/vuu-utils": "0.7.1-debug",
|
|
11
11
|
"@salt-ds/core": "1.2.0",
|
|
12
12
|
"@heswell/salt-lab": "1.0.0-alpha.2"
|
|
13
13
|
},
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
|
|
2
|
+
import { Filter } from "@vuu-ui/vuu-filter-types";
|
|
3
|
+
import { VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
4
|
+
import { HTMLAttributes } from "react";
|
|
5
|
+
type FilterPanelProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
table: VuuTable;
|
|
7
|
+
columns: ColumnDescriptor[];
|
|
8
|
+
onFilterSubmit: (filterQuery: string, filter?: Filter) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const ColumnFilter: ({ className, table, columns, onFilterSubmit, ...htmlAttributes }: FilterPanelProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -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;
|
package/types/filter-utils.d.ts
CHANGED
|
@@ -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:
|
|
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