@vuu-ui/vuu-filter-parser 3.3.9 → 3.3.10

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,5 +1,5 @@
1
1
  {
2
- "version": "3.3.9",
2
+ "version": "3.3.10",
3
3
  "main": "./src/index.js",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
@@ -12,14 +12,14 @@
12
12
  "type-defs": "node ../../scripts/build-type-defs.mjs"
13
13
  },
14
14
  "devDependencies": {
15
- "@vuu-ui/vuu-data-types": "3.3.9",
16
- "@vuu-ui/vuu-filter-types": "3.3.9",
17
- "@vuu-ui/vuu-table-types": "3.3.9"
15
+ "@vuu-ui/vuu-data-types": "3.3.10",
16
+ "@vuu-ui/vuu-filter-types": "3.3.10",
17
+ "@vuu-ui/vuu-table-types": "3.3.10"
18
18
  },
19
19
  "dependencies": {
20
20
  "@lezer/common": "^1.0.2",
21
21
  "@lezer/lr": "1.4.2",
22
- "@vuu-ui/vuu-utils": "3.3.9"
22
+ "@vuu-ui/vuu-utils": "3.3.10"
23
23
  },
24
24
  "files": [
25
25
  "README.md",
@@ -0,0 +1,2 @@
1
+ import { Filter } from "@vuu-ui/vuu-filter-types";
2
+ export declare const parseFilter: (filterQuery: string) => Filter;
@@ -0,0 +1,3 @@
1
+ import { Tree } from "@lezer/common";
2
+ import { Filter } from "@vuu-ui/vuu-filter-types";
3
+ export declare const walkTree: (tree: Tree, source: string) => Partial<Filter> | undefined;
@@ -0,0 +1,17 @@
1
+ import { DataSourceRowWithBigint } from "@vuu-ui/vuu-data-types";
2
+ import { Filter } from "@vuu-ui/vuu-filter-types";
3
+ import { ColumnMap } from "@vuu-ui/vuu-utils";
4
+ import { VuuDataRow } from "@vuu-ui/vuu-protocol-types";
5
+ import { DataRow } from "@vuu-ui/vuu-table-types";
6
+ export type FilterPredicate = (row: DataSourceRowWithBigint | VuuDataRow) => boolean;
7
+ export type DataRowFilterPredicate = (row: DataRow) => boolean;
8
+ export declare function getFilterPredicate(columnMap: ColumnMap, filterQuery: string): FilterPredicate;
9
+ export declare function getFilterPredicate(filterQuery: string): DataRowFilterPredicate;
10
+ /**
11
+ * Generates a filterPredicate that can be used to test a row against a filter
12
+ * Two row formats supported:
13
+ * - DataRow, used by Tables, when evaluatingn a Menu filter.
14
+ * - DataSourceRow, used by local data source, like ArrayDataSOurce
15
+ */
16
+ export declare function filterPredicate(columnMap: ColumnMap, filter: Filter): FilterPredicate;
17
+ export declare function filterPredicate(filter: Filter): DataRowFilterPredicate;
@@ -0,0 +1,2 @@
1
+ import { LRParser } from "@lezer/lr";
2
+ export declare const parser: LRParser;
@@ -0,0 +1 @@
1
+ export declare const Filter = 1, ColumnValueExpression = 2, Column = 3, Operator = 4, Eq = 5, NotEq = 6, Gt = 7, Lt = 8, Starts = 9, Ends = 10, Contains = 11, Number = 12, String = 13, True = 14, False = 15, ColumnSetExpression = 16, In = 17, LBrack = 18, Values = 19, Comma = 20, RBrack = 21, AndExpression = 22, And = 23, OrExpression = 24, Or = 25, ParenthesizedExpression = 26, As = 27, FilterName = 28;
@@ -0,0 +1,4 @@
1
+ export { parseFilter } from "./FilterParser";
2
+ export { parser } from "./generated/filter-parser";
3
+ export { walkTree } from "./FilterTreeWalker";
4
+ export * from "./filter-evaluation-utils";