@vuu-ui/vuu-data-test 4.0.0-alpha.1 → 4.0.0-alpha.2
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": "4.0.0-alpha.
|
|
2
|
+
"version": "4.0.0-alpha.2",
|
|
3
3
|
"main": "./src/index.js",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "heswell",
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"type-defs": "node ../../scripts/build-type-defs.mjs"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@vuu-ui/vuu-data-editing": "4.0.0-alpha.
|
|
14
|
-
"@vuu-ui/vuu-data-local": "4.0.0-alpha.
|
|
15
|
-
"@vuu-ui/core": "4.0.0-alpha.
|
|
16
|
-
"@vuu-ui/vuu-utils": "4.0.0-alpha.
|
|
13
|
+
"@vuu-ui/vuu-data-editing": "4.0.0-alpha.2",
|
|
14
|
+
"@vuu-ui/vuu-data-local": "4.0.0-alpha.2",
|
|
15
|
+
"@vuu-ui/core": "4.0.0-alpha.2",
|
|
16
|
+
"@vuu-ui/vuu-utils": "4.0.0-alpha.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@vuu-ui/vuu-protocol-types": "4.0.0-alpha.
|
|
20
|
-
"@vuu-ui/vuu-data-types": "4.0.0-alpha.
|
|
21
|
-
"@vuu-ui/vuu-table-types": "4.0.0-alpha.
|
|
19
|
+
"@vuu-ui/vuu-protocol-types": "4.0.0-alpha.2",
|
|
20
|
+
"@vuu-ui/vuu-data-types": "4.0.0-alpha.2",
|
|
21
|
+
"@vuu-ui/vuu-table-types": "4.0.0-alpha.2"
|
|
22
22
|
},
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"files": [
|
|
@@ -132,8 +132,10 @@ class TickingArrayDataSource extends ArrayDataSource {
|
|
|
132
132
|
data: rowData
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
return response ?? {
|
|
136
|
+
type: "ERROR_RESULT",
|
|
137
|
+
errorMessage: "addRow failed"
|
|
138
|
+
};
|
|
137
139
|
};
|
|
138
140
|
deleteRow = async (key, mode = "hard")=>{
|
|
139
141
|
const response = await this.rpcRequest({
|
|
@@ -212,22 +212,16 @@ class VuuModule {
|
|
|
212
212
|
if (sessionTable) {
|
|
213
213
|
const { dataSource } = this.getSubscriptionByViewport(viewPortId);
|
|
214
214
|
const selectedRowIds = dataSource.getSelectedRowIds();
|
|
215
|
-
const deletedKeys = [];
|
|
216
215
|
if (selectedRowIds.length > 0) {
|
|
217
|
-
for (const key of selectedRowIds)
|
|
218
|
-
|
|
219
|
-
else sessionTable.delete(key);
|
|
220
|
-
deletedKeys.push(key);
|
|
221
|
-
}
|
|
216
|
+
for (const key of selectedRowIds)if ("soft" === mode) sessionTable.update(key, "vuuAction", "deleteRow");
|
|
217
|
+
else sessionTable.delete(key);
|
|
222
218
|
dataSource.select?.({
|
|
223
219
|
type: "DESELECT_ALL"
|
|
224
220
|
});
|
|
225
221
|
}
|
|
226
222
|
return {
|
|
227
223
|
type: "SUCCESS_RESULT",
|
|
228
|
-
data:
|
|
229
|
-
deletedKeys
|
|
230
|
-
}
|
|
224
|
+
data: void 0
|
|
231
225
|
};
|
|
232
226
|
}
|
|
233
227
|
return {
|
|
@@ -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, RpcResultError, RpcResultSuccess, VuuCreateVisualLink, VuuMenu, VuuRemoveVisualLink, VuuRowDataItemType, VuuRpcMenuRequest, VuuRpcMenuResponse, VuuRpcServiceRequest } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import type { LinkDescriptorWithLabel, RpcResult, 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>;
|
|
@@ -27,7 +27,7 @@ export declare class TickingArrayDataSource extends ArrayDataSource {
|
|
|
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
29
|
editCell(key: string, column: string, data: VuuRowDataItemType): Promise<RpcResultError | RpcResultSuccess>;
|
|
30
|
-
addRow: (rowData?: Record<string, VuuRowDataItemType>) => Promise<
|
|
30
|
+
addRow: (rowData?: Record<string, VuuRowDataItemType>) => Promise<RpcResult>;
|
|
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>;
|