@vuu-ui/vuu-data-test 3.3.11 → 4.0.0-alpha.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 +9 -7
- package/src/Table.js +3 -0
- package/src/TickingArrayDataSource.js +2 -4
- package/src/core/module/VuuModule.js +9 -3
- package/src/local-datasource-provider/LocalDatasourceProvider.js +8 -3
- package/types/TickingArrayDataSource.d.ts +3 -3
- package/types/basket/BasketModule.d.ts +9 -9
- package/types/basket/reference-data/prices.d.ts +1 -1
- package/types/local-datasource-provider/LocalDatasourceProvider.d.ts +2 -2
- package/types/simul/reference-data/instruments-extended.d.ts +1 -1
- package/types/simul/reference-data/instruments.d.ts +1 -1
- package/types/simul/reference-data/orders.d.ts +1 -1
- package/types/simul/reference-data/parent-child-orders.d.ts +2 -2
- package/types/simul/reference-data/prices.d.ts +1 -1
- package/types/vuu-row-generator.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "4.0.0-alpha.1",
|
|
3
3
|
"main": "./src/index.js",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"author": "heswell",
|
|
5
6
|
"license": "Apache-2.0",
|
|
6
7
|
"scripts": {
|
|
@@ -9,13 +10,15 @@
|
|
|
9
10
|
"type-defs": "node ../../scripts/build-type-defs.mjs"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
12
|
-
"@vuu-ui/vuu-data-
|
|
13
|
-
"@vuu-ui/vuu-
|
|
13
|
+
"@vuu-ui/vuu-data-editing": "4.0.0-alpha.1",
|
|
14
|
+
"@vuu-ui/vuu-data-local": "4.0.0-alpha.1",
|
|
15
|
+
"@vuu-ui/core": "4.0.0-alpha.1",
|
|
16
|
+
"@vuu-ui/vuu-utils": "4.0.0-alpha.1"
|
|
14
17
|
},
|
|
15
18
|
"devDependencies": {
|
|
16
|
-
"@vuu-ui/vuu-protocol-types": "
|
|
17
|
-
"@vuu-ui/vuu-data-types": "
|
|
18
|
-
"@vuu-ui/vuu-table-types": "
|
|
19
|
+
"@vuu-ui/vuu-protocol-types": "4.0.0-alpha.1",
|
|
20
|
+
"@vuu-ui/vuu-data-types": "4.0.0-alpha.1",
|
|
21
|
+
"@vuu-ui/vuu-table-types": "4.0.0-alpha.1"
|
|
19
22
|
},
|
|
20
23
|
"sideEffects": false,
|
|
21
24
|
"files": [
|
|
@@ -31,6 +34,5 @@
|
|
|
31
34
|
},
|
|
32
35
|
"module": "./src/index.js",
|
|
33
36
|
"name": "@vuu-ui/vuu-data-test",
|
|
34
|
-
"type": "module",
|
|
35
37
|
"types": "types/index.d.ts"
|
|
36
38
|
}
|
package/src/Table.js
CHANGED
|
@@ -47,6 +47,9 @@ class Table extends EventEmitter {
|
|
|
47
47
|
}
|
|
48
48
|
insert(row, emitEvent = true) {
|
|
49
49
|
const index = this.#data.length;
|
|
50
|
+
const createdTime = Date.now();
|
|
51
|
+
row[this.#dataMap.vuuUpdatedTimestamp] = createdTime;
|
|
52
|
+
row[this.#dataMap.vuuCreatedTimestamp] = createdTime;
|
|
50
53
|
this.#data.push(row);
|
|
51
54
|
const key = row[this.#indexOfKey];
|
|
52
55
|
this.#index.set(key, index);
|
|
@@ -132,10 +132,8 @@ class TickingArrayDataSource extends ArrayDataSource {
|
|
|
132
132
|
data: rowData
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
errorMessage: "addRow failed"
|
|
138
|
-
};
|
|
135
|
+
if (isRpcSuccess(response)) return true;
|
|
136
|
+
return response?.errorMessage ?? "addRow failed";
|
|
139
137
|
};
|
|
140
138
|
deleteRow = async (key, mode = "hard")=>{
|
|
141
139
|
const response = await this.rpcRequest({
|
|
@@ -212,16 +212,22 @@ class VuuModule {
|
|
|
212
212
|
if (sessionTable) {
|
|
213
213
|
const { dataSource } = this.getSubscriptionByViewport(viewPortId);
|
|
214
214
|
const selectedRowIds = dataSource.getSelectedRowIds();
|
|
215
|
+
const deletedKeys = [];
|
|
215
216
|
if (selectedRowIds.length > 0) {
|
|
216
|
-
for (const key of selectedRowIds)
|
|
217
|
-
|
|
217
|
+
for (const key of selectedRowIds){
|
|
218
|
+
if ("soft" === mode) sessionTable.update(key, "vuuAction", "deleteRow");
|
|
219
|
+
else sessionTable.delete(key);
|
|
220
|
+
deletedKeys.push(key);
|
|
221
|
+
}
|
|
218
222
|
dataSource.select?.({
|
|
219
223
|
type: "DESELECT_ALL"
|
|
220
224
|
});
|
|
221
225
|
}
|
|
222
226
|
return {
|
|
223
227
|
type: "SUCCESS_RESULT",
|
|
224
|
-
data:
|
|
228
|
+
data: {
|
|
229
|
+
deletedKeys
|
|
230
|
+
}
|
|
225
231
|
};
|
|
226
232
|
}
|
|
227
233
|
return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { DataProvider } from "@vuu-ui/
|
|
2
|
+
import { DataProvider } from "@vuu-ui/core";
|
|
3
|
+
import { DataProvider as vuu_utils_DataProvider } from "@vuu-ui/vuu-utils";
|
|
3
4
|
import ModuleContainer from "../core/module/ModuleContainer.js";
|
|
4
5
|
import TableContainer from "../core/table/TableContainer.js";
|
|
5
6
|
const serverAPI = {
|
|
@@ -37,9 +38,13 @@ class VuuDataSource {
|
|
|
37
38
|
return module.createDataSource(table.table, viewport, config);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
const LocalDataSourceProvider = ({ children })=>/*#__PURE__*/ jsx(
|
|
41
|
+
const LocalDataSourceProvider = ({ children })=>/*#__PURE__*/ jsx(vuu_utils_DataProvider, {
|
|
41
42
|
VuuDataSource: VuuDataSource,
|
|
42
43
|
getServerAPI: getServerAPI,
|
|
43
|
-
children:
|
|
44
|
+
children: /*#__PURE__*/ jsx(DataProvider, {
|
|
45
|
+
VuuDataSource: VuuDataSource,
|
|
46
|
+
getServerAPI: getServerAPI,
|
|
47
|
+
children: children
|
|
48
|
+
})
|
|
44
49
|
});
|
|
45
50
|
export { LocalDataSourceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArrayDataSource, type ArrayDataSourceConstructorProps } from "@vuu-ui/vuu-data-local";
|
|
2
2
|
import type { DataSourceBase, DataSource, DataSourceRowWithBigint, DataSourceSubscribeCallback, DataSourceSubscribeProps, DataSourceVisualLinkCreatedMessage, DeleteRowMode, CopyOption, EditSessionMode, SessionDataSourceOverrides, SessionType } from "@vuu-ui/vuu-data-types";
|
|
3
|
-
import type { LinkDescriptorWithLabel,
|
|
3
|
+
import type { LinkDescriptorWithLabel, RpcResultError, RpcResultSuccess, VuuCreateVisualLink, VuuMenu, VuuRemoveVisualLink, VuuRowDataItemType, VuuRpcMenuRequest, VuuRpcMenuResponse, VuuRpcServiceRequest } from "@vuu-ui/vuu-protocol-types";
|
|
4
4
|
import type { IVuuModule, RpcMenuService, RpcService } from "./core/module/VuuModule";
|
|
5
5
|
import type { Table } from "./Table";
|
|
6
6
|
export type VisualLinkHandler = (message: VuuCreateVisualLink | VuuRemoveVisualLink) => Promise<DataSourceVisualLinkCreatedMessage | void>;
|
|
@@ -26,8 +26,8 @@ export declare class TickingArrayDataSource extends ArrayDataSource {
|
|
|
26
26
|
isSessionDataSourceOf(dataSource: DataSource): boolean;
|
|
27
27
|
createSessionDataSource(copyOption: CopyOption, sessionType?: SessionType, overrides?: SessionDataSourceOverrides): Promise<DataSourceBase<DataSourceRowWithBigint> | undefined>;
|
|
28
28
|
beginEditSession(editSessionMode?: EditSessionMode, overrides?: SessionDataSourceOverrides): Promise<DataSourceBase<DataSourceRowWithBigint> | undefined>;
|
|
29
|
-
editCell(key: string, column: string, data: VuuRowDataItemType): Promise<
|
|
30
|
-
addRow: (rowData?: Record<string, VuuRowDataItemType>) => Promise<
|
|
29
|
+
editCell(key: string, column: string, data: VuuRowDataItemType): Promise<RpcResultError | RpcResultSuccess>;
|
|
30
|
+
addRow: (rowData?: Record<string, VuuRowDataItemType>) => Promise<true | string>;
|
|
31
31
|
deleteRow: (key: string, mode?: DeleteRowMode) => Promise<true | string>;
|
|
32
32
|
deleteSelectedRows: (mode?: DeleteRowMode) => Promise<RpcResultSuccess | RpcResultError>;
|
|
33
33
|
undoRowChange: (key: string) => Promise<RpcResultSuccess | RpcResultError>;
|
|
@@ -14,6 +14,10 @@ export declare class BasketModule extends VuuModule<BasketsTableName> {
|
|
|
14
14
|
get menus(): Record<BasketsTableName, VuuMenu | undefined>;
|
|
15
15
|
get schemas(): Readonly<Record<BasketsTableName, Readonly<import("@vuu-ui/vuu-data-types").TableSchema>>>;
|
|
16
16
|
get services(): {
|
|
17
|
+
algoType: undefined;
|
|
18
|
+
basketTradingConstituent: undefined;
|
|
19
|
+
basketConstituent: undefined;
|
|
20
|
+
priceStrategyType: undefined;
|
|
17
21
|
basket: {
|
|
18
22
|
rpcName: string;
|
|
19
23
|
service: ServiceHandler;
|
|
@@ -26,25 +30,21 @@ export declare class BasketModule extends VuuModule<BasketsTableName> {
|
|
|
26
30
|
rpcName: string;
|
|
27
31
|
service: ServiceHandler;
|
|
28
32
|
}[];
|
|
29
|
-
algoType: undefined;
|
|
30
|
-
basketTradingConstituent: undefined;
|
|
31
|
-
basketConstituent: undefined;
|
|
32
|
-
priceStrategyType: undefined;
|
|
33
33
|
};
|
|
34
34
|
get menuServices(): Record<BasketsTableName, RpcMenuService[] | undefined> | undefined;
|
|
35
35
|
get tables(): Record<BasketsTableName, Table>;
|
|
36
36
|
get visualLinks(): {
|
|
37
|
-
basketConstituent: {
|
|
38
|
-
fromColumn: string;
|
|
39
|
-
toColumn: string;
|
|
40
|
-
toTable: string;
|
|
41
|
-
}[];
|
|
42
37
|
algoType: undefined;
|
|
43
38
|
basket: undefined;
|
|
44
39
|
basketTrading: undefined;
|
|
45
40
|
basketTradingConstituent: undefined;
|
|
46
41
|
basketTradingConstituentJoin: undefined;
|
|
47
42
|
priceStrategyType: undefined;
|
|
43
|
+
basketConstituent: {
|
|
44
|
+
fromColumn: string;
|
|
45
|
+
toColumn: string;
|
|
46
|
+
toTable: string;
|
|
47
|
+
}[];
|
|
48
48
|
};
|
|
49
49
|
private createTradingBasket;
|
|
50
50
|
private createNewBasket;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const instrumentsExtendedTable: import("
|
|
1
|
+
export declare const instrumentsExtendedTable: import("../..").Table;
|
|
@@ -31,5 +31,5 @@ export declare const InstrumentColumnMap: {
|
|
|
31
31
|
};
|
|
32
32
|
declare const instrumentsData: InstrumentsDataRow[];
|
|
33
33
|
export declare const getRic: (defaultRic: string) => string;
|
|
34
|
-
export declare const instrumentsTable: import("
|
|
34
|
+
export declare const instrumentsTable: import("../..").Table;
|
|
35
35
|
export { instrumentsData };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const parentOrdersTable: import("
|
|
2
|
-
export declare const childOrdersTable: import("
|
|
1
|
+
export declare const parentOrdersTable: import("../..").Table;
|
|
2
|
+
export declare const childOrdersTable: import("../..").Table;
|
|
3
3
|
export declare function startGeneratingNewOrders(): void;
|
|
4
4
|
export declare function stopGeneratingNewOrders(): void;
|
|
@@ -30,5 +30,5 @@ declare const bid: number, bidSize: number, ask: number, askSize: number;
|
|
|
30
30
|
declare const lastUpdate: number;
|
|
31
31
|
declare const created: number;
|
|
32
32
|
declare const pricesData: Array<PricesDataRow>;
|
|
33
|
-
export declare const pricesTable: import("
|
|
33
|
+
export declare const pricesTable: import("../..").Table;
|
|
34
34
|
export { pricesData };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
2
2
|
import type { VuuRowDataItemType, VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
-
import { UpdateGenerator } from "./rowUpdates";
|
|
3
|
+
import type { UpdateGenerator } from "./rowUpdates";
|
|
4
4
|
type GenerateRowFunc = (index: number) => VuuRowDataItemType[];
|
|
5
5
|
export type RowGeneratorFactory = (columns: string[]) => GenerateRowFunc;
|
|
6
6
|
export type ColumnGeneratorFn = (columns?: number | string[], columnConfig?: {
|