@vuu-ui/vuu-data-local 0.13.3 → 0.13.4
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 +10 -13
- package/types/array-data-source/aggregate-utils.d.ts +0 -8
- package/types/array-data-source/array-data-source.d.ts +0 -94
- package/types/array-data-source/array-data-utils.d.ts +0 -4
- package/types/array-data-source/group-utils.d.ts +0 -10
- package/types/array-data-source/sort-utils.d.ts +0 -4
- package/types/index.d.ts +0 -3
- package/types/json-data-source/JsonDataSource.d.ts +0 -56
- package/types/tree-data-source/IconProvider.d.ts +0 -6
- package/types/tree-data-source/TreeDataSource.d.ts +0 -52
package/package.json
CHANGED
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.13.
|
|
2
|
+
"version": "0.13.4",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"devDependencies": {
|
|
6
|
-
"@vuu-ui/vuu-data-types": "0.13.
|
|
7
|
-
"@vuu-ui/vuu-table-types": "0.13.
|
|
8
|
-
"@vuu-ui/vuu-filter-types": "0.13.
|
|
9
|
-
"@vuu-ui/vuu-protocol-types": "0.13.
|
|
6
|
+
"@vuu-ui/vuu-data-types": "0.13.4",
|
|
7
|
+
"@vuu-ui/vuu-table-types": "0.13.4",
|
|
8
|
+
"@vuu-ui/vuu-filter-types": "0.13.4",
|
|
9
|
+
"@vuu-ui/vuu-protocol-types": "0.13.4"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@vuu-ui/vuu-filter-parser": "0.13.
|
|
13
|
-
"@vuu-ui/vuu-utils": "0.13.
|
|
12
|
+
"@vuu-ui/vuu-filter-parser": "0.13.4",
|
|
13
|
+
"@vuu-ui/vuu-utils": "0.13.4"
|
|
14
14
|
},
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"files": [
|
|
17
17
|
"README.md",
|
|
18
18
|
"esm",
|
|
19
|
-
"cjs"
|
|
20
|
-
"/types"
|
|
19
|
+
"cjs"
|
|
21
20
|
],
|
|
22
21
|
"exports": {
|
|
23
22
|
".": {
|
|
24
23
|
"require": "./cjs/index.js",
|
|
25
|
-
"import": "./esm/index.js"
|
|
26
|
-
"types": "./types/index.d.ts"
|
|
24
|
+
"import": "./esm/index.js"
|
|
27
25
|
}
|
|
28
26
|
},
|
|
29
27
|
"main": "cjs/index.js",
|
|
30
28
|
"module": "esm/index.js",
|
|
31
29
|
"name": "@vuu-ui/vuu-data-local",
|
|
32
|
-
"type": "module"
|
|
33
|
-
"types": "types/index.d.ts"
|
|
30
|
+
"type": "module"
|
|
34
31
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { DataSourceRow } 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 DataSourceRow[], groupBy: VuuGroupBy, leafData: readonly DataSourceRow[], columnMap: ColumnMap, groupMap: GroupMap) => {
|
|
7
|
-
[key: string]: number;
|
|
8
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { DataSource, DataSourceConfig, DataSourceConstructorProps, DataSourceEvents, DataSourceFilter, DataSourceRow, DataSourceStatus, Selection, DataSourceSubscribeCallback, DataSourceSubscribeProps, TableSchema, WithBaseFilter, WithFullConfig } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import type { LinkDescriptorWithLabel, VuuAggregation, VuuGroupBy, VuuMenu, VuuRowDataItemType, VuuRpcRequest, VuuRpcResponse, VuuSort } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
-
import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
4
|
-
import { ColumnMap, DataSourceConfigChanges, EventEmitter, Range } from "@vuu-ui/vuu-utils";
|
|
5
|
-
export interface ArrayDataSourceConstructorProps extends Omit<DataSourceConstructorProps, "bufferSize" | "table"> {
|
|
6
|
-
columnDescriptors: ColumnDescriptor[];
|
|
7
|
-
data: Array<VuuRowDataItemType[]>;
|
|
8
|
-
dataMap?: ColumnMap;
|
|
9
|
-
keyColumn?: string;
|
|
10
|
-
rangeChangeRowset?: "delta" | "full";
|
|
11
|
-
}
|
|
12
|
-
export declare class ArrayDataSource extends EventEmitter<DataSourceEvents> implements DataSource {
|
|
13
|
-
#private;
|
|
14
|
-
private clientCallback;
|
|
15
|
-
private columnDescriptors;
|
|
16
|
-
/** sorted offsets of data within raw data, reflecting sort order
|
|
17
|
-
* of columns specified by client.
|
|
18
|
-
*/
|
|
19
|
-
private dataIndices;
|
|
20
|
-
/** Map reflecting positions of data items in raw data */
|
|
21
|
-
private dataMap;
|
|
22
|
-
private groupMap;
|
|
23
|
-
/** the index of key field within raw data row */
|
|
24
|
-
private key;
|
|
25
|
-
private lastRangeServed;
|
|
26
|
-
private rangeChangeRowset;
|
|
27
|
-
private openTreeNodes;
|
|
28
|
-
protected _config: WithBaseFilter<WithFullConfig> & {
|
|
29
|
-
visualLink?: LinkDescriptorWithLabel;
|
|
30
|
-
};
|
|
31
|
-
protected _menu: VuuMenu | undefined;
|
|
32
|
-
protected selectedRows: Selection;
|
|
33
|
-
tableSchema: TableSchema;
|
|
34
|
-
viewport: string;
|
|
35
|
-
protected processedData: DataSourceRow[] | undefined;
|
|
36
|
-
constructor({ aggregations, baseFilterSpec, columnDescriptors, data, dataMap, filterSpec, groupBy, keyColumn, rangeChangeRowset, sort, title, viewport, }: ArrayDataSourceConstructorProps);
|
|
37
|
-
subscribe({ viewport, columns, aggregations, baseFilterSpec, range, selectedIndexValues, selectedKeyValues, sort, groupBy, filterSpec, }: DataSourceSubscribeProps, callback: DataSourceSubscribeCallback): Promise<void>;
|
|
38
|
-
unsubscribe(): void;
|
|
39
|
-
suspend(): void;
|
|
40
|
-
resume(callback?: DataSourceSubscribeCallback): void;
|
|
41
|
-
disable(): void;
|
|
42
|
-
enable(): void;
|
|
43
|
-
select(selected: Selection): void;
|
|
44
|
-
private getRowKey;
|
|
45
|
-
openTreeNode(keyOrIndex: string | number): void;
|
|
46
|
-
closeTreeNode(keyOrIndex: string | number): void;
|
|
47
|
-
get pageSize(): number;
|
|
48
|
-
get links(): LinkDescriptorWithLabel[] | undefined;
|
|
49
|
-
set links(links: LinkDescriptorWithLabel[] | undefined);
|
|
50
|
-
get menu(): VuuMenu | undefined;
|
|
51
|
-
get status(): DataSourceStatus;
|
|
52
|
-
get data(): DataSourceRow[];
|
|
53
|
-
get currentData(): DataSourceRow[];
|
|
54
|
-
get table(): import("@vuu-ui/vuu-data-types").TableSchemaTable;
|
|
55
|
-
get config(): WithBaseFilter<WithFullConfig>;
|
|
56
|
-
set config(config: WithBaseFilter<WithFullConfig>);
|
|
57
|
-
applyConfig(config: WithBaseFilter<DataSourceConfig>, preserveExistingConfigAttributes?: boolean): DataSourceConfigChanges | undefined;
|
|
58
|
-
get columnMap(): ColumnMap;
|
|
59
|
-
get selectedRowsCount(): number;
|
|
60
|
-
get size(): number;
|
|
61
|
-
get range(): Range;
|
|
62
|
-
set range(range: Range);
|
|
63
|
-
getRowAtIndex(rowIndex: number): DataSourceRow | undefined;
|
|
64
|
-
protected delete(row: VuuRowDataItemType[]): void;
|
|
65
|
-
protected insert: (row: VuuRowDataItemType[]) => void;
|
|
66
|
-
private validateDataValue;
|
|
67
|
-
protected updateDataItem: (keyValue: string, columnName: string, value: VuuRowDataItemType) => void;
|
|
68
|
-
private indexOfRowWithKey;
|
|
69
|
-
protected update: (row: VuuRowDataItemType[], columnName: string) => void;
|
|
70
|
-
protected updateRow: (row: VuuRowDataItemType[]) => void;
|
|
71
|
-
private setRange;
|
|
72
|
-
sendRowsToClient(forceFullRefresh?: boolean, row?: DataSourceRow): void;
|
|
73
|
-
get columns(): string[];
|
|
74
|
-
set columns(columns: string[]);
|
|
75
|
-
get aggregations(): VuuAggregation[];
|
|
76
|
-
set aggregations(aggregations: VuuAggregation[]);
|
|
77
|
-
get sort(): VuuSort;
|
|
78
|
-
set sort(sort: VuuSort);
|
|
79
|
-
get baseFilter(): DataSourceFilter | undefined;
|
|
80
|
-
set baseFilter(baseFilter: DataSourceFilter | undefined);
|
|
81
|
-
get filter(): DataSourceFilter;
|
|
82
|
-
set filter(filter: DataSourceFilter);
|
|
83
|
-
get groupBy(): VuuGroupBy;
|
|
84
|
-
set groupBy(groupBy: VuuGroupBy);
|
|
85
|
-
get title(): string;
|
|
86
|
-
set title(title: string);
|
|
87
|
-
get _clientCallback(): DataSourceSubscribeCallback | undefined;
|
|
88
|
-
createLink({ parentVpId, link: { fromColumn, toColumn }, }: LinkDescriptorWithLabel): void;
|
|
89
|
-
removeLink(): void;
|
|
90
|
-
applyEdit(rowKey: string, columnName: string, value: VuuRowDataItemType): Promise<true>;
|
|
91
|
-
remoteProcedureCall<T extends VuuRpcResponse = VuuRpcResponse>(): Promise<T>;
|
|
92
|
-
menuRpcCall(rpcRequest: Omit<VuuRpcRequest, "vpId">): Promise<VuuRpcResponse>;
|
|
93
|
-
private convertKeysToIndexValues;
|
|
94
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DataSourceRow, Selection } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import { ColumnMap, KeySet } from "@vuu-ui/vuu-utils";
|
|
3
|
-
export declare const toClientRow: (row: DataSourceRow, keys: KeySet, selection: Selection, 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 } 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[]) => DataSourceRow[];
|
|
9
|
-
export declare const expandGroup: (keys: string[], sourceRows: readonly DataSourceRow[], groupBy: VuuGroupBy, columnMap: ColumnMap, groupMap: GroupMap, processedData: readonly DataSourceRow[]) => DataSourceRow[];
|
|
10
|
-
export declare const groupRows: (rows: readonly DataSourceRow[], groupBy: VuuGroupBy, columnMap: ColumnMap) => [DataSourceRow[], GroupMap];
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import type { VuuSort } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
-
import { ColumnMap } from "@vuu-ui/vuu-utils";
|
|
4
|
-
export declare const sortRows: (rows: readonly DataSourceRow[], { sortDefs }: VuuSort, columnMap: ColumnMap) => DataSourceRow[];
|
package/types/index.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
2
|
-
import type { LinkDescriptorWithLabel, VuuGroupBy, VuuAggregation, VuuSort, VuuRowDataItemType, VuuRpcResponse, VuuRpcRequest } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
-
import type { DataSourceFilter, DataSourceRow, DataSource, DataSourceConstructorProps, DataSourceEvents, DataSourceStatus, DataSourceSubscribeCallback, DataSourceSubscribeProps, WithFullConfig, Selection, MenuRpcResponse, VuuUIMessageInRPCEditReject, VuuUIMessageInRPCEditResponse } 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 DataSource {
|
|
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(selected: Selection): 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 | VuuUIMessageInRPCEditReject | VuuUIMessageInRPCEditResponse | undefined>;
|
|
53
|
-
applyEdit(rowKey: string, columnName: string, value: VuuRowDataItemType): Promise<true>;
|
|
54
|
-
getChildRows(rowKey: string): DataSourceRow[];
|
|
55
|
-
getRowsAtDepth(depth: number, visibleOnly?: boolean): DataSourceRow[];
|
|
56
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
2
|
-
import type { LinkDescriptorWithLabel, VuuRange, VuuRowDataItemType, VuuRpcResponse, VuuRpcRequest } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
-
import type { DataSourceRow, DataSourceConstructorProps, DataSourceStatus, DataSourceSubscribeCallback, DataSourceSubscribeProps, Selection, MenuRpcResponse, VuuUIMessageInRPCEditReject, VuuUIMessageInRPCEditResponse, DataSourceFilter } 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 {
|
|
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(selected: Selection): 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 | VuuUIMessageInRPCEditReject | VuuUIMessageInRPCEditResponse | undefined>;
|
|
48
|
-
applyEdit(rowKey: string, columnName: string, value: VuuRowDataItemType): Promise<true>;
|
|
49
|
-
getChildRows(rowKey: string): DataSourceRow[];
|
|
50
|
-
getRowsAtDepth(depth: number, visibleOnly?: boolean): DataSourceRow[];
|
|
51
|
-
getRowAtIndex(rowIdx: number): DataSourceRow;
|
|
52
|
-
}
|