@vuu-ui/vuu-data-test 3.5.10 → 3.5.11

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.5.10",
2
+ "version": "3.5.11",
3
3
  "main": "./src/index.js",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
@@ -9,13 +9,13 @@
9
9
  "type-defs": "node ../../scripts/build-type-defs.mjs"
10
10
  },
11
11
  "dependencies": {
12
- "@vuu-ui/vuu-data-local": "3.5.10",
13
- "@vuu-ui/vuu-utils": "3.5.10"
12
+ "@vuu-ui/vuu-data-local": "3.5.11",
13
+ "@vuu-ui/vuu-utils": "3.5.11"
14
14
  },
15
15
  "devDependencies": {
16
- "@vuu-ui/vuu-protocol-types": "3.5.10",
17
- "@vuu-ui/vuu-data-types": "3.5.10",
18
- "@vuu-ui/vuu-table-types": "3.5.10"
16
+ "@vuu-ui/vuu-protocol-types": "3.5.11",
17
+ "@vuu-ui/vuu-data-types": "3.5.11",
18
+ "@vuu-ui/vuu-table-types": "3.5.11"
19
19
  },
20
20
  "sideEffects": false,
21
21
  "files": [
@@ -171,13 +171,18 @@ class VuuModule {
171
171
  if (sessionTable) return sessionTable;
172
172
  if (throwIfNotFound) throw Error(`getSessionTable: no session table with name ${sessionTableName}`);
173
173
  }
174
+ #softDeleteSessionRow(sessionTable, key) {
175
+ const row = sessionTable.findByKey(key);
176
+ if (row && "addRow" === row[sessionTable.map.vuuAction]) sessionTable.delete(key);
177
+ else sessionTable.update(key, "vuuAction", "deleteRow");
178
+ }
174
179
  deleteRow = async (rpcRequest)=>{
175
180
  if ("VIEWPORT_CONTEXT" === rpcRequest.context.type) {
176
181
  const { viewPortId } = rpcRequest.context;
177
182
  const { key, mode = "hard" } = rpcRequest.params;
178
183
  const sessionTable = this.getSessionTable(viewPortId, false);
179
184
  if (sessionTable) {
180
- if ("soft" === mode) sessionTable.update(key, "vuuAction", "deleteRow");
185
+ if ("soft" === mode) this.#softDeleteSessionRow(sessionTable, key);
181
186
  else sessionTable.delete(key);
182
187
  return {
183
188
  type: "SUCCESS_RESULT",
@@ -213,7 +218,7 @@ class VuuModule {
213
218
  const { dataSource } = this.getSubscriptionByViewport(viewPortId);
214
219
  const selectedRowIds = dataSource.getSelectedRowIds();
215
220
  if (selectedRowIds.length > 0) {
216
- for (const key of selectedRowIds)if ("soft" === mode) sessionTable.update(key, "vuuAction", "deleteRow");
221
+ for (const key of selectedRowIds)if ("soft" === mode) this.#softDeleteSessionRow(sessionTable, key);
217
222
  else sessionTable.delete(key);
218
223
  dataSource.select?.({
219
224
  type: "DESELECT_ALL"
@@ -221,7 +226,9 @@ class VuuModule {
221
226
  }
222
227
  return {
223
228
  type: "SUCCESS_RESULT",
224
- data: void 0
229
+ data: {
230
+ deletedKeys: selectedRowIds
231
+ }
225
232
  };
226
233
  }
227
234
  return {