@vuu-ui/vuu-data-local 4.0.0-alpha.8 → 4.0.0-beta.1

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,8 +1,7 @@
1
1
  {
2
- "version": "4.0.0-alpha.8",
2
+ "version": "4.0.0-beta.1",
3
3
  "main": "./src/index.js",
4
4
  "author": "heswell",
5
- "type": "module",
6
5
  "license": "Apache-2.0",
7
6
  "scripts": {
8
7
  "build:dev": "node ../../scripts/run-build.mjs",
@@ -11,14 +10,14 @@
11
10
  "type-defs": "node ../../scripts/build-type-defs.mjs"
12
11
  },
13
12
  "devDependencies": {
14
- "@vuu-ui/vuu-data-types": "4.0.0-alpha.8",
15
- "@vuu-ui/vuu-table-types": "4.0.0-alpha.8",
16
- "@vuu-ui/vuu-filter-types": "4.0.0-alpha.8",
17
- "@vuu-ui/vuu-protocol-types": "4.0.0-alpha.8"
13
+ "@vuu-ui/vuu-data-types": "4.0.0-beta.1",
14
+ "@vuu-ui/vuu-table-types": "4.0.0-beta.1",
15
+ "@vuu-ui/vuu-filter-types": "4.0.0-beta.1",
16
+ "@vuu-ui/vuu-protocol-types": "4.0.0-beta.1"
18
17
  },
19
18
  "dependencies": {
20
- "@vuu-ui/vuu-filter-parser": "4.0.0-alpha.8",
21
- "@vuu-ui/vuu-utils": "4.0.0-alpha.8"
19
+ "@vuu-ui/vuu-filter-parser": "4.0.0-beta.1",
20
+ "@vuu-ui/vuu-utils": "4.0.0-beta.1"
22
21
  },
23
22
  "sideEffects": false,
24
23
  "files": [
@@ -29,10 +28,12 @@
29
28
  "exports": {
30
29
  ".": {
31
30
  "import": "./src/index.js",
31
+ "default": "./src/index.js",
32
32
  "types": "./types/index.d.ts"
33
33
  }
34
34
  },
35
35
  "module": "./src/index.js",
36
36
  "name": "@vuu-ui/vuu-data-local",
37
+ "type": "module",
37
38
  "types": "types/index.d.ts"
38
39
  }
@@ -1,5 +1,5 @@
1
1
  import { filterPredicate, parseFilter } from "@vuu-ui/vuu-filter-parser";
2
- import { EventEmitter, KeySet, NULL_RANGE, Range, buildColumnMap, combineFilters, filterAsQuery, getAddedItems, hasBaseFilter, hasFilter, hasGroupBy, hasSort, isConfigChanged, isGroupByChanged, logger, metadataKeys, rangeNewItems, toSchemaColumn, uuid, vanillaConfig, withConfigDefaults } from "@vuu-ui/vuu-utils";
2
+ import { EventEmitter, KeySet, NULL_RANGE, Range, buildColumnMap, combineFilters, filterAsQuery, filterRequiresResolution, getAddedItems, getColumnsByName, getColumnsByNameForFilter, hasBaseFilter, hasFilter, hasGroupBy, hasSort, isConfigChanged, isGroupByChanged, logger, metadataKeys, rangeNewItems, toSchemaColumn, uuid, vanillaConfig, withConfigDefaults } from "@vuu-ui/vuu-utils";
3
3
  import { aggregateData } from "./aggregate-utils.js";
4
4
  import { buildDataToClientMap, toClientRow } from "./array-data-utils.js";
5
5
  import { collapseGroup, expandGroup, groupRows } from "./group-utils.js";
@@ -49,6 +49,7 @@ class ArrayDataSource extends EventEmitter {
49
49
  openTreeNodes = [];
50
50
  preserveScrollPositionAcrossConfigChange = false;
51
51
  #columnMap;
52
+ #filterColumnsByName;
52
53
  _config = vanillaConfig;
53
54
  #data;
54
55
  #freezeTimestamp = void 0;
@@ -68,6 +69,7 @@ class ArrayDataSource extends EventEmitter {
68
69
  super();
69
70
  if (!data || !columnDescriptors) throw Error("ArrayDataSource constructor called without data or without columnDescriptors");
70
71
  this.columnDescriptors = columnDescriptors;
72
+ this.#filterColumnsByName = getColumnsByName(columnDescriptors);
71
73
  this.dataMap = dataMap;
72
74
  this.key = keyColumn ? this.columnDescriptors.findIndex((col)=>col.name === keyColumn) : 0;
73
75
  this.rangeChangeRowset = rangeChangeRowset;
@@ -316,7 +318,8 @@ class ArrayDataSource extends EventEmitter {
316
318
  });
317
319
  }
318
320
  getFilterPredicate() {
319
- const { filterSpec: { filterStruct } } = combineFilters(this._config);
321
+ const { filterSpec: { filter, filterStruct: rawFilterStruct } } = combineFilters(this._config);
322
+ const filterStruct = rawFilterStruct && filter && filterRequiresResolution(rawFilterStruct, getColumnsByNameForFilter(this.tableSchema, this.#filterColumnsByName)) ? parseFilter(filter) : rawFilterStruct;
320
323
  if (filterStruct) {
321
324
  if (this.dataMap) {
322
325
  const { count: offset } = metadataKeys;
@@ -448,12 +451,12 @@ class ArrayDataSource extends EventEmitter {
448
451
  }
449
452
  indexOfRowWithKey = (key)=>this.#data.findIndex((row)=>row[KEY] === key);
450
453
  update = (row, columnName)=>{
451
- const keyValue = String(row[this.key]);
454
+ const keyValue = row[this.key];
452
455
  const dataColIndex = this.dataMap?.[columnName];
453
456
  return this.updateDataItem(keyValue, columnName, row[dataColIndex]);
454
457
  };
455
458
  updateRow = (row, _columnName)=>{
456
- const keyValue = String(row[this.key]);
459
+ const keyValue = row[this.key];
457
460
  const dataIndex = this.#data.findIndex((row)=>row[KEY] === keyValue);
458
461
  if (-1 !== dataIndex) {
459
462
  const dataSourceRow = toDataSourceRow(this.key)(row, dataIndex);
@@ -617,9 +620,15 @@ class ArrayDataSource extends EventEmitter {
617
620
  filterSpec: filter
618
621
  };
619
622
  }
620
- setFilter(filter) {
623
+ setFilter(filter, options) {
624
+ this.#filterColumnsByName = {
625
+ ...getColumnsByName(this.columnDescriptors),
626
+ ...options?.columnsByName
627
+ };
621
628
  const dataSourceFilter = {
622
- filter: filterAsQuery(filter),
629
+ filter: filterAsQuery(filter, {
630
+ columnsByName: getColumnsByNameForFilter(this.tableSchema, this.#filterColumnsByName)
631
+ }),
623
632
  filterStruct: filter
624
633
  };
625
634
  this.filter = dataSourceFilter;
@@ -1,39 +1,17 @@
1
1
  import { BaseDataSource, KeySet, NULL_RANGE, getParentRow, isSingleValueFilter, lastPathSegment, metadataKeys, missingAncestor, treeToDataSourceRows, uuid } from "@vuu-ui/vuu-utils";
2
2
  import { IconProvider } from "./IconProvider.js";
3
3
  import { parseFilter } from "@vuu-ui/vuu-filter-parser";
4
- const TREE_SCHEMA = {
5
- columns: [
6
- {
7
- name: "nodeData",
8
- serverDataType: "string"
9
- },
10
- {
11
- name: "Level 1",
12
- serverDataType: "string"
13
- },
14
- {
15
- name: "Level 2",
16
- serverDataType: "string"
17
- },
18
- {
19
- name: "Level 3",
20
- serverDataType: "string"
21
- },
22
- {
23
- name: "Level 4",
24
- serverDataType: "string"
25
- },
26
- {
27
- name: "Level 5",
28
- serverDataType: "string"
4
+ const treeSchema = (columns)=>({
5
+ columns: columns.map(({ name })=>({
6
+ name,
7
+ serverDataType: "string"
8
+ })),
9
+ key: "",
10
+ table: {
11
+ module: "",
12
+ table: ""
29
13
  }
30
- ],
31
- key: "",
32
- table: {
33
- module: "",
34
- table: ""
35
- }
36
- };
14
+ });
37
15
  const { COUNT: COUNT, DEPTH: DEPTH, IDX: IDX, IS_EXPANDED: IS_EXPANDED, IS_LEAF: IS_LEAF, KEY: KEY, SELECTED: SELECTED } = metadataKeys;
38
16
  const toClientRow = (row, keys)=>{
39
17
  const [rowIndex] = row;
@@ -61,6 +39,8 @@ class TreeDataSource extends BaseDataSource {
61
39
  if (!data) throw Error("TreeDataSource constructor called without data");
62
40
  this.#iconProvider = new IconProvider();
63
41
  [this.columnDescriptors, this.#data] = treeToDataSourceRows(data, this.#iconProvider);
42
+ this.expandedRows = getInitiallyExpandedKeys(data);
43
+ console.table(this.#data);
64
44
  if (this.columnDescriptors) {
65
45
  const columns = this.columnDescriptors.map((c)=>c.name);
66
46
  this._configWithVisualLink = {
@@ -92,7 +72,7 @@ class TreeDataSource extends BaseDataSource {
92
72
  groupBy: this._configWithVisualLink.groupBy,
93
73
  range: this.range,
94
74
  sort: this.sort,
95
- tableSchema: TREE_SCHEMA
75
+ tableSchema: treeSchema(this.columnDescriptors)
96
76
  });
97
77
  this.clientCallback({
98
78
  clientViewportId: this.viewport,
@@ -163,6 +143,7 @@ class TreeDataSource extends BaseDataSource {
163
143
  applySelectedKeyValues(keys, revealSelected = false) {
164
144
  keys.forEach((key)=>{
165
145
  const rowIdx = this.indexOfRowWithKey(key);
146
+ if (-1 === rowIdx) return;
166
147
  const row = this.#data[rowIdx];
167
148
  row[SELECTED] = 1;
168
149
  if (revealSelected && 1 !== row[DEPTH]) {
@@ -305,6 +286,14 @@ class TreeDataSource extends BaseDataSource {
305
286
  return this.visibleRows[rowIdx];
306
287
  }
307
288
  }
289
+ const getInitiallyExpandedKeys = (treeSourceNodes, keyBase = "$root", expandedKeys = new Set())=>{
290
+ for (const { childNodes, expanded, label } of treeSourceNodes){
291
+ const key = `${keyBase}|${label}`;
292
+ if (expanded) expandedKeys.add(key);
293
+ if (childNodes) getInitiallyExpandedKeys(childNodes, key, expandedKeys);
294
+ }
295
+ return expandedKeys;
296
+ };
308
297
  function getVisibleRows(rows, expandedKeys, filterset) {
309
298
  const visibleRows = [];
310
299
  const visibleRowIndex = {};
@@ -1,4 +1,4 @@
1
- import type { DataSourceBase, DataSourceConstructorProps, DataSourceEvents, DataSourceFilter, DataSourceRow, DataSourceRowWithBigint, DataSourceStatus, DataSourceSubscribeCallback, DataSourceSubscribeProps, TableSchema, WithBaseFilter, WithFullConfig } from "@vuu-ui/vuu-data-types";
1
+ import type { DataSourceBase, DataSourceConstructorProps, DataSourceEvents, DataSourceFilter, DataSourceRow, DataSourceRowWithBigint, DataSourceStatus, DataSourceSubscribeCallback, DataSourceSubscribeProps, SetFilterOptions, TableSchema, WithBaseFilter, WithFullConfig } from "@vuu-ui/vuu-data-types";
2
2
  import type { Filter } from "@vuu-ui/vuu-filter-types";
3
3
  import type { LinkDescriptorWithLabel, SelectRequest, VuuAggregation, VuuGroupBy, VuuMenu, VuuRowDataItemType, VuuRpcRequest, VuuRpcResponse, VuuSort } from "@vuu-ui/vuu-protocol-types";
4
4
  import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
@@ -93,7 +93,7 @@ export declare class ArrayDataSource extends EventEmitter<DataSourceEvents> impl
93
93
  set baseFilter(baseFilter: DataSourceFilter | undefined);
94
94
  get filter(): DataSourceFilter;
95
95
  set filter(filter: DataSourceFilter);
96
- setFilter(filter: Filter): void;
96
+ setFilter(filter: Filter, options?: SetFilterOptions): void;
97
97
  clearFilter(): void;
98
98
  get groupBy(): VuuGroupBy;
99
99
  set groupBy(groupBy: VuuGroupBy);
@@ -1,6 +1,6 @@
1
1
  import type { DataSourceRow } from "@vuu-ui/vuu-data-types";
2
2
  import type { VuuGroupBy, VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
3
- import { type ColumnMap } from "@vuu-ui/vuu-utils";
3
+ import { ColumnMap } from "@vuu-ui/vuu-utils";
4
4
  export type KeyList = number[];
5
5
  export type GroupMap = {
6
6
  [key: string]: GroupMap | KeyList;
@@ -1,6 +1,6 @@
1
1
  import type { DataSourceRowWithBigint } from "@vuu-ui/vuu-data-types";
2
2
  import type { VuuSort, VuuSortType } from "@vuu-ui/vuu-protocol-types";
3
- import type { ColumnMap } from "@vuu-ui/vuu-utils";
3
+ import { ColumnMap } from "@vuu-ui/vuu-utils";
4
4
  export type ColIndexSortDef = [number, VuuSortType];
5
5
  type SortCompareResult = 0 | 1 | -1;
6
6
  export type RowSortComparator = (item1: DataSourceRowWithBigint, item2: DataSourceRowWithBigint) => SortCompareResult;
@@ -1,7 +1,7 @@
1
1
  import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
2
  import type { LinkDescriptorWithLabel, VuuRange, VuuRpcResponse, VuuRpcRequest, SelectRequest } from "@vuu-ui/vuu-protocol-types";
3
3
  import type { DataSourceRow, DataSourceConstructorProps, DataSourceStatus, DataSourceSubscribeCallback, DataSourceSubscribeProps, MenuRpcResponse, DataSourceFilter, DataSourceBase } from "@vuu-ui/vuu-data-types";
4
- import { BaseDataSource, type TreeSourceNode } from "@vuu-ui/vuu-utils";
4
+ import { BaseDataSource, TreeSourceNode } from "@vuu-ui/vuu-utils";
5
5
  export interface TreeDataSourceConstructorProps extends Omit<DataSourceConstructorProps, "bufferSize" | "table"> {
6
6
  data: TreeSourceNode[];
7
7
  }
@@ -1,8 +0,0 @@
1
- import type { DataSourceRowWithBigint } from "@vuu-ui/vuu-data-types";
2
- import type { VuuAggregation, VuuGroupBy } from "@vuu-ui/vuu-protocol-types";
3
- import type { ColumnMap } from "@vuu-ui/vuu-utils";
4
- import type { GroupMap } from "./group-utils";
5
- export declare const count: (arr: unknown[]) => number;
6
- export declare const aggregateData: (aggregations: VuuAggregation[], targetData: readonly DataSourceRowWithBigint[], groupBy: VuuGroupBy, leafData: readonly DataSourceRowWithBigint[], columnMap: ColumnMap, groupMap: GroupMap) => {
7
- [key: string]: number;
8
- };
@@ -1,111 +0,0 @@
1
- import type { DataSourceBase, DataSourceConstructorProps, DataSourceEvents, DataSourceFilter, DataSourceRow, DataSourceRowWithBigint, DataSourceStatus, DataSourceSubscribeCallback, DataSourceSubscribeProps, TableSchema, WithBaseFilter, WithFullConfig } from "@vuu-ui/vuu-data-types";
2
- import type { Filter } from "@vuu-ui/vuu-filter-types";
3
- import type { LinkDescriptorWithLabel, SelectRequest, VuuAggregation, VuuGroupBy, VuuMenu, VuuRowDataItemType, VuuRpcRequest, VuuRpcResponse, VuuSort } from "@vuu-ui/vuu-protocol-types";
4
- import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
5
- import { type ColumnMap, EventEmitter, Range } from "@vuu-ui/vuu-utils";
6
- export interface ArrayDataSourceConstructorProps extends Omit<DataSourceConstructorProps, "bufferSize" | "table"> {
7
- columnDescriptors: readonly ColumnDescriptor[];
8
- data: Array<Array<bigint | VuuRowDataItemType>>;
9
- dataMap?: ColumnMap;
10
- keyColumn?: string;
11
- rangeChangeRowset?: "delta" | "full";
12
- }
13
- export declare class ArrayDataSource extends EventEmitter<DataSourceEvents> implements DataSourceBase<DataSourceRowWithBigint> {
14
- #private;
15
- protected clientCallback: DataSourceSubscribeCallback | undefined;
16
- protected columnDescriptors: readonly ColumnDescriptor[];
17
- /** sorted offsets of data within raw data, reflecting sort order
18
- * of columns specified by client.
19
- */
20
- private dataIndices;
21
- /** Map reflecting positions of data items in raw data */
22
- private dataMap;
23
- private groupMap;
24
- /** the index of key field within raw data row */
25
- private key;
26
- private lastRangeServed;
27
- private rangeChangeRowset;
28
- private openTreeNodes;
29
- private preserveScrollPositionAcrossConfigChange;
30
- protected _config: WithBaseFilter<WithFullConfig> & {
31
- visualLink?: LinkDescriptorWithLabel;
32
- };
33
- protected _menu: VuuMenu | undefined;
34
- protected selectedRows: Set<string>;
35
- protected index: Map<string, number>;
36
- tableSchema: TableSchema;
37
- viewport: string;
38
- protected processedData: DataSourceRowWithBigint[] | undefined;
39
- constructor({ aggregations, baseFilterSpec, columnDescriptors, data, dataMap, filterSpec, groupBy, keyColumn, rangeChangeRowset, sort, title, viewport, }: ArrayDataSourceConstructorProps);
40
- subscribe({ viewport, columns, aggregations, baseFilterSpec, range, sort, groupBy, filterSpec, }: DataSourceSubscribeProps, callback: DataSourceSubscribeCallback): Promise<void>;
41
- unsubscribe(): void;
42
- suspend(): void;
43
- resume(callback?: DataSourceSubscribeCallback): void;
44
- disable(): void;
45
- enable(): void;
46
- select(selectRequest: Omit<SelectRequest, "vpId">): void;
47
- private getRowKey;
48
- openTreeNode(keyOrIndex: string | number): void;
49
- closeTreeNode(keyOrIndex: string | number): void;
50
- get pageSize(): number;
51
- get links(): LinkDescriptorWithLabel[] | undefined;
52
- set links(links: LinkDescriptorWithLabel[] | undefined);
53
- get menu(): VuuMenu | undefined;
54
- get status(): DataSourceStatus;
55
- get data(): DataSourceRow<bigint | VuuRowDataItemType>[];
56
- get currentData(): DataSourceRow<bigint | VuuRowDataItemType>[];
57
- get table(): import("@vuu-ui/vuu-data-types").TableSchemaTable;
58
- get columns(): string[];
59
- set columns(columns: string[]);
60
- get config(): WithBaseFilter<WithFullConfig>;
61
- set config(config: WithBaseFilter<WithFullConfig>);
62
- private processNewColumns;
63
- private indexProcessedData;
64
- private getFilterPredicate;
65
- private applyConfig;
66
- get columnMap(): ColumnMap;
67
- get selectedRowsCount(): number;
68
- get size(): number;
69
- get maxRangeEnd(): number;
70
- get range(): Range;
71
- set range(range: Range);
72
- protected delete(row: VuuRowDataItemType[]): void;
73
- protected insert: (row: Array<bigint | VuuRowDataItemType>) => void;
74
- private insertIntoSortedData;
75
- private validateDataValue;
76
- protected updateDataItem: (keyValue: string, columnName: string, value: VuuRowDataItemType) => void;
77
- getRowByKey(key: string): DataSourceRow<bigint | VuuRowDataItemType> | undefined;
78
- getRowAtIndex(rowIndex: number): DataSourceRow<bigint | VuuRowDataItemType>;
79
- indexOfRowWithKey: (key: string) => number;
80
- protected update: (row: VuuRowDataItemType[], columnName: string) => void;
81
- protected updateRow: (row: Array<bigint | VuuRowDataItemType>, _columnName?: string) => void;
82
- protected handleDeleteFromTable: (key: string) => Promise<true | string>;
83
- private setRange;
84
- private constrainRangeToMaxRangeEnd;
85
- private get rangeWithBufferWithinMaxRangeEnd();
86
- sendSizeUpdateToClient(): void;
87
- sendRowsToClient(forceFullRefresh?: boolean, row?: DataSourceRowWithBigint): void;
88
- get aggregations(): VuuAggregation[];
89
- set aggregations(aggregations: VuuAggregation[]);
90
- get sort(): VuuSort;
91
- set sort(sort: VuuSort);
92
- get baseFilter(): DataSourceFilter | undefined;
93
- set baseFilter(baseFilter: DataSourceFilter | undefined);
94
- get filter(): DataSourceFilter;
95
- set filter(filter: DataSourceFilter);
96
- setFilter(filter: Filter): void;
97
- clearFilter(): void;
98
- get groupBy(): VuuGroupBy;
99
- set groupBy(groupBy: VuuGroupBy);
100
- get title(): string;
101
- set title(title: string);
102
- get _clientCallback(): DataSourceSubscribeCallback | undefined;
103
- createLink({ parentVpId, link: { fromColumn, toColumn }, }: LinkDescriptorWithLabel): void;
104
- removeLink(): void;
105
- remoteProcedureCall<T extends VuuRpcResponse = VuuRpcResponse>(): Promise<T>;
106
- menuRpcCall(rpcRequest: Omit<VuuRpcRequest, "vpId">): Promise<VuuRpcResponse>;
107
- freeze(): void;
108
- unfreeze(): void;
109
- get freezeTimestamp(): number | undefined;
110
- get isFrozen(): boolean;
111
- }
@@ -1,4 +0,0 @@
1
- import type { DataSourceRow, DataSourceRowWithBigint } from "@vuu-ui/vuu-data-types";
2
- import { ColumnMap, KeySet } from "@vuu-ui/vuu-utils";
3
- export declare const toClientRow: (row: DataSourceRowWithBigint, keys: KeySet, selectedRows: Set<string>, dataIndices?: number[]) => DataSourceRow;
4
- export declare const buildDataToClientMap: (columnMap: ColumnMap, dataMap?: ColumnMap) => number[] | undefined;
@@ -1,10 +0,0 @@
1
- import type { DataSourceRow } from "@vuu-ui/vuu-data-types";
2
- import type { VuuGroupBy, VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
3
- import { ColumnMap } from "@vuu-ui/vuu-utils";
4
- export type KeyList = number[];
5
- export type GroupMap = {
6
- [key: string]: GroupMap | KeyList;
7
- };
8
- export declare const collapseGroup: (key: string, groupedRows: readonly DataSourceRow<bigint | VuuRowDataItemType>[]) => DataSourceRow<bigint | VuuRowDataItemType>[];
9
- export declare const expandGroup: (keys: string[], sourceRows: readonly DataSourceRow<bigint | VuuRowDataItemType>[], groupBy: VuuGroupBy, columnMap: ColumnMap, groupMap: GroupMap, processedData: readonly DataSourceRow[]) => DataSourceRow[];
10
- export declare const groupRows: (rows: ReadonlyArray<Array<bigint | VuuRowDataItemType>>, groupBy: VuuGroupBy, columnMap: ColumnMap) => [DataSourceRow[], GroupMap];
@@ -1,10 +0,0 @@
1
- import type { DataSourceRowWithBigint } from "@vuu-ui/vuu-data-types";
2
- import type { VuuSort, VuuSortType } from "@vuu-ui/vuu-protocol-types";
3
- import { ColumnMap } from "@vuu-ui/vuu-utils";
4
- export type ColIndexSortDef = [number, VuuSortType];
5
- type SortCompareResult = 0 | 1 | -1;
6
- export type RowSortComparator = (item1: DataSourceRowWithBigint, item2: DataSourceRowWithBigint) => SortCompareResult;
7
- export declare const sortComparator: (sortDefs: ColIndexSortDef[]) => RowSortComparator;
8
- export declare const sortRows: (rows: readonly DataSourceRowWithBigint[], { sortDefs }: VuuSort, columnMap: ColumnMap) => DataSourceRowWithBigint[];
9
- export declare function binarySearch(items: DataSourceRowWithBigint[], item: DataSourceRowWithBigint, comparator: RowSortComparator): number;
10
- export {};
@@ -1,3 +0,0 @@
1
- export * from "./array-data-source/array-data-source";
2
- export * from "./json-data-source/JsonDataSource";
3
- export * from "./tree-data-source/TreeDataSource";
@@ -1,55 +0,0 @@
1
- import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
- import type { LinkDescriptorWithLabel, VuuGroupBy, VuuAggregation, VuuSort, VuuRpcResponse, VuuRpcRequest, SelectRequest } from "@vuu-ui/vuu-protocol-types";
3
- import type { DataSourceFilter, DataSourceRow, DataSourceConstructorProps, DataSourceEvents, DataSourceStatus, DataSourceSubscribeCallback, DataSourceSubscribeProps, WithFullConfig, MenuRpcResponse, DataSourceBase } from "@vuu-ui/vuu-data-types";
4
- import { EventEmitter, JsonData, Range } from "@vuu-ui/vuu-utils";
5
- export interface JsonDataSourceConstructorProps extends Omit<DataSourceConstructorProps, "bufferSize" | "table"> {
6
- data: JsonData;
7
- }
8
- export declare class JsonDataSource extends EventEmitter<DataSourceEvents> implements DataSourceBase {
9
- #private;
10
- columnDescriptors: ColumnDescriptor[];
11
- private clientCallback;
12
- private expandedRows;
13
- private visibleRows;
14
- rowCount: number | undefined;
15
- viewport: string;
16
- private keys;
17
- constructor({ aggregations, data, filterSpec, groupBy, sort, title, viewport, }: JsonDataSourceConstructorProps);
18
- subscribe({ viewport, columns, aggregations, range, sort, groupBy, filterSpec, }: DataSourceSubscribeProps, callback: DataSourceSubscribeCallback): Promise<void>;
19
- unsubscribe(): void;
20
- suspend(): this;
21
- resume(): this;
22
- disable(): this;
23
- enable(): this;
24
- set data(data: JsonData);
25
- select(selectRequest: Omit<SelectRequest, "vpId">): void;
26
- private getRowKey;
27
- openTreeNode(keyOrIndex: string | number): void;
28
- closeTreeNode(keyOrIndex: string | number, cascade?: boolean): void;
29
- get status(): DataSourceStatus;
30
- get config(): WithFullConfig;
31
- applyConfig(): import("@vuu-ui/vuu-utils").MaybeDataSourceConfigChanges;
32
- get selectedRowsCount(): number;
33
- get size(): number;
34
- get range(): Range;
35
- set range(range: Range);
36
- private sendRowsToClient;
37
- get columns(): string[];
38
- set columns(columns: string[]);
39
- get aggregations(): VuuAggregation[];
40
- set aggregations(aggregations: VuuAggregation[]);
41
- get sort(): VuuSort;
42
- set sort(sort: VuuSort);
43
- get filter(): DataSourceFilter;
44
- set filter(filter: DataSourceFilter);
45
- get groupBy(): VuuGroupBy;
46
- set groupBy(groupBy: VuuGroupBy);
47
- get title(): string;
48
- set title(title: string);
49
- createLink({ parentVpId, link: { fromColumn, toColumn }, }: LinkDescriptorWithLabel): void;
50
- removeLink(): void;
51
- remoteProcedureCall<T extends VuuRpcResponse = VuuRpcResponse>(): Promise<T>;
52
- menuRpcCall(rpcRequest: Omit<VuuRpcRequest, "vpId">): Promise<MenuRpcResponse | undefined>;
53
- getChildRows(rowKey: string): DataSourceRow[];
54
- getRowsAtDepth(depth: number, visibleOnly?: boolean): DataSourceRow[];
55
- }
@@ -1,6 +0,0 @@
1
- import { DataRow } from "@vuu-ui/vuu-table-types";
2
- export declare class IconProvider {
3
- #private;
4
- getIcon: (dataRow: DataRow) => string;
5
- setIcon(key: string, icon: string): void;
6
- }
@@ -1,51 +0,0 @@
1
- import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
- import type { LinkDescriptorWithLabel, VuuRange, VuuRpcResponse, VuuRpcRequest, SelectRequest } from "@vuu-ui/vuu-protocol-types";
3
- import type { DataSourceRow, DataSourceConstructorProps, DataSourceStatus, DataSourceSubscribeCallback, DataSourceSubscribeProps, MenuRpcResponse, DataSourceFilter, DataSourceBase } from "@vuu-ui/vuu-data-types";
4
- import { BaseDataSource, TreeSourceNode } from "@vuu-ui/vuu-utils";
5
- export interface TreeDataSourceConstructorProps extends Omit<DataSourceConstructorProps, "bufferSize" | "table"> {
6
- data: TreeSourceNode[];
7
- }
8
- export declare class TreeDataSource extends BaseDataSource implements DataSourceBase {
9
- #private;
10
- columnDescriptors: ColumnDescriptor[];
11
- private clientCallback;
12
- private expandedRows;
13
- private visibleRows;
14
- private visibleRowIndex;
15
- rowCount: number | undefined;
16
- private keys;
17
- constructor({ data, ...props }: TreeDataSourceConstructorProps);
18
- subscribe({ aggregations, columns, range, revealSelected, selectedKeyValues, viewport, }: DataSourceSubscribeProps, callback: DataSourceSubscribeCallback): Promise<void>;
19
- unsubscribe(): void;
20
- suspend(): this;
21
- resume(): this;
22
- disable(): this;
23
- enable(): this;
24
- set data(data: TreeSourceNode[]);
25
- get filter(): DataSourceFilter;
26
- set filter(filter: DataSourceFilter);
27
- private applyFilter;
28
- /**
29
- * used to apply an initial selection. These may not necessarily be
30
- * visible. If revealOnSelect is in force, expand nodes as necessary
31
- * to ensure selected nodes are visible
32
- */
33
- private applySelectedKeyValues;
34
- private indexOfRowWithKey;
35
- select(selectRequest: Omit<SelectRequest, "vpId">): void;
36
- private getRowKey;
37
- openTreeNode(keyOrIndex: string | number): void;
38
- closeTreeNode(keyOrIndex: string | number, cascade?: boolean): void;
39
- get status(): DataSourceStatus;
40
- get selectedRowsCount(): number;
41
- get size(): number;
42
- rangeRequest(range: VuuRange): void;
43
- private sendRowsToClient;
44
- createLink({ parentVpId, link: { fromColumn, toColumn }, }: LinkDescriptorWithLabel): void;
45
- removeLink(): void;
46
- remoteProcedureCall<T extends VuuRpcResponse = VuuRpcResponse>(): Promise<T>;
47
- menuRpcCall(rpcRequest: Omit<VuuRpcRequest, "vpId">): Promise<MenuRpcResponse | undefined>;
48
- getChildRows(rowKey: string): DataSourceRow[];
49
- getRowsAtDepth(depth: number, visibleOnly?: boolean): DataSourceRow[];
50
- getRowAtIndex(rowIdx: number): DataSourceRow;
51
- }