@fileverse-dev/fortune-react 1.2.38 → 1.2.39

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.
@@ -311,15 +311,18 @@ export var useColumnDragAndDrop = function useColumnDragAndDrop(containerRef, se
311
311
  }
312
312
  });
313
313
  (_d = window === null || window === void 0 ? void 0 : window.updateDataBlockCalcFunctionAfterRowDrag) === null || _d === void 0 ? void 0 : _d.call(window, sourceIndex_1, targetIndex, "column", context.currentSheetId);
314
- var selData = api.getSelection(context) || [];
315
- var sel = __spreadArray([], selData, true);
316
- if (sel && sel[0]) {
317
- sel[0].column = [targetIndex, targetIndex];
318
- }
319
- setContext(function (draftCtx) {
320
- api.setSelection(draftCtx, sel, {
321
- id: context.currentSheetId
322
- });
314
+ });
315
+ var targetIndex = finalInsertionIndex_1;
316
+ if (targetIndex > sourceIndex_1) targetIndex -= 1;
317
+ var selData = api.getSelection(context) || [];
318
+ var sel_1 = __spreadArray([], selData, true);
319
+ if (sel_1 && sel_1[0]) {
320
+ sel_1[0].column = [targetIndex, targetIndex];
321
+ }
322
+ setContext(function (draftCtx) {
323
+ console.log("after update", sel_1);
324
+ api.setSelection(draftCtx, sel_1, {
325
+ id: context.currentSheetId
323
326
  });
324
327
  });
325
328
  }
@@ -319,15 +319,18 @@ var useColumnDragAndDrop = exports.useColumnDragAndDrop = function useColumnDrag
319
319
  }
320
320
  });
321
321
  (_d = window === null || window === void 0 ? void 0 : window.updateDataBlockCalcFunctionAfterRowDrag) === null || _d === void 0 ? void 0 : _d.call(window, sourceIndex_1, targetIndex, "column", context.currentSheetId);
322
- var selData = _fortuneCore.api.getSelection(context) || [];
323
- var sel = __spreadArray([], selData, true);
324
- if (sel && sel[0]) {
325
- sel[0].column = [targetIndex, targetIndex];
326
- }
327
- setContext(function (draftCtx) {
328
- _fortuneCore.api.setSelection(draftCtx, sel, {
329
- id: context.currentSheetId
330
- });
322
+ });
323
+ var targetIndex = finalInsertionIndex_1;
324
+ if (targetIndex > sourceIndex_1) targetIndex -= 1;
325
+ var selData = _fortuneCore.api.getSelection(context) || [];
326
+ var sel_1 = __spreadArray([], selData, true);
327
+ if (sel_1 && sel_1[0]) {
328
+ sel_1[0].column = [targetIndex, targetIndex];
329
+ }
330
+ setContext(function (draftCtx) {
331
+ console.log("after update", sel_1);
332
+ _fortuneCore.api.setSelection(draftCtx, sel_1, {
333
+ id: context.currentSheetId
331
334
  });
332
335
  });
333
336
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.2.38",
3
+ "version": "1.2.39",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "module": "es/index.js",
@@ -16,7 +16,7 @@
16
16
  "tsc": "tsc"
17
17
  },
18
18
  "dependencies": {
19
- "@fileverse-dev/fortune-core": "1.2.38",
19
+ "@fileverse-dev/fortune-core": "1.2.39",
20
20
  "@fileverse/ui": "^4.1.7-patch-40",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",