@fileverse-dev/fortune-core 1.2.90-ydoc-6 → 1.2.90-ydoc-8

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/es/api/cell.js CHANGED
@@ -55,7 +55,6 @@ export function setCellValue(ctx, row, column, value, cellInput, options, callAf
55
55
  if (options === void 0) {
56
56
  options = {};
57
57
  }
58
- var afterUpdateCellCalledInInternal = false;
59
58
  if (!_.isNumber(row) || !_.isNumber(column)) {
60
59
  throw new Error("row or column cannot be null or undefined");
61
60
  }
@@ -1,3 +1,13 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
6
+ }
7
+ return t;
8
+ };
9
+ return __assign.apply(this, arguments);
10
+ };
1
11
  import _ from "lodash";
2
12
  import { v4 as uuidv4 } from "uuid";
3
13
  import { initSheetData } from "../api/sheet";
@@ -19,7 +29,7 @@ export function storeSheetParamALL(ctx) {
19
29
  ctx.luckysheetfile[index].config = ctx.config;
20
30
  }
21
31
  export function changeSheet(ctx, id, isPivotInitial, isNewSheet, isCopySheet) {
22
- var _a, _b;
32
+ var _a, _b, _c, _d;
23
33
  if (id === ctx.currentSheetId) {
24
34
  return;
25
35
  }
@@ -35,10 +45,7 @@ export function changeSheet(ctx, id, isPivotInitial, isNewSheet, isCopySheet) {
35
45
  ctx.luckysheetcurrentisPivotTable = false;
36
46
  }
37
47
  if (ctx.hooks.afterActivateSheet) {
38
- setTimeout(function () {
39
- var _a, _b;
40
- (_b = (_a = ctx.hooks).afterActivateSheet) === null || _b === void 0 ? void 0 : _b.call(_a, id);
41
- });
48
+ (_d = (_c = ctx.hooks).afterActivateSheet) === null || _d === void 0 ? void 0 : _d.call(_c, id);
42
49
  }
43
50
  }
44
51
  export function addSheet(ctx, settings, newSheetID, isPivotTable, sheetName, sheetData) {
@@ -86,11 +93,8 @@ export function addSheet(ctx, settings, newSheetID, isPivotTable, sheetName, she
86
93
  return;
87
94
  }
88
95
  ctx.luckysheetfile.push(sheetconfig);
89
- if (!newSheetID) {
90
- changeSheet(ctx, id, isPivotTable, true);
91
- }
92
96
  if (ctx.hooks.afterAddSheet) {
93
- (_d = (_c = ctx.hooks).afterAddSheet) === null || _d === void 0 ? void 0 : _d.call(_c, sheetconfig);
97
+ (_d = (_c = ctx.hooks).afterAddSheet) === null || _d === void 0 ? void 0 : _d.call(_c, __assign({}, sheetconfig));
94
98
  }
95
99
  }
96
100
  export function deleteSheet(ctx, id) {
package/lib/api/cell.js CHANGED
@@ -66,7 +66,6 @@ function setCellValue(ctx, row, column, value, cellInput, options, callAfterUpda
66
66
  if (options === void 0) {
67
67
  options = {};
68
68
  }
69
- var afterUpdateCellCalledInInternal = false;
70
69
  if (!_lodash.default.isNumber(row) || !_lodash.default.isNumber(column)) {
71
70
  throw new Error("row or column cannot be null or undefined");
72
71
  }
@@ -16,6 +16,16 @@ var _sheet = require("../api/sheet");
16
16
  var _locale = require("../locale");
17
17
  var _utils = require("../utils");
18
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ var __assign = void 0 && (void 0).__assign || function () {
20
+ __assign = Object.assign || function (t) {
21
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
22
+ s = arguments[i];
23
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
24
+ }
25
+ return t;
26
+ };
27
+ return __assign.apply(this, arguments);
28
+ };
19
29
  function storeSheetParam(ctx) {
20
30
  var index = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
21
31
  if (index == null) return;
@@ -32,7 +42,7 @@ function storeSheetParamALL(ctx) {
32
42
  ctx.luckysheetfile[index].config = ctx.config;
33
43
  }
34
44
  function changeSheet(ctx, id, isPivotInitial, isNewSheet, isCopySheet) {
35
- var _a, _b;
45
+ var _a, _b, _c, _d;
36
46
  if (id === ctx.currentSheetId) {
37
47
  return;
38
48
  }
@@ -48,10 +58,7 @@ function changeSheet(ctx, id, isPivotInitial, isNewSheet, isCopySheet) {
48
58
  ctx.luckysheetcurrentisPivotTable = false;
49
59
  }
50
60
  if (ctx.hooks.afterActivateSheet) {
51
- setTimeout(function () {
52
- var _a, _b;
53
- (_b = (_a = ctx.hooks).afterActivateSheet) === null || _b === void 0 ? void 0 : _b.call(_a, id);
54
- });
61
+ (_d = (_c = ctx.hooks).afterActivateSheet) === null || _d === void 0 ? void 0 : _d.call(_c, id);
55
62
  }
56
63
  }
57
64
  function addSheet(ctx, settings, newSheetID, isPivotTable, sheetName, sheetData) {
@@ -99,11 +106,8 @@ function addSheet(ctx, settings, newSheetID, isPivotTable, sheetName, sheetData)
99
106
  return;
100
107
  }
101
108
  ctx.luckysheetfile.push(sheetconfig);
102
- if (!newSheetID) {
103
- changeSheet(ctx, id, isPivotTable, true);
104
- }
105
109
  if (ctx.hooks.afterAddSheet) {
106
- (_d = (_c = ctx.hooks).afterAddSheet) === null || _d === void 0 ? void 0 : _d.call(_c, sheetconfig);
110
+ (_d = (_c = ctx.hooks).afterAddSheet) === null || _d === void 0 ? void 0 : _d.call(_c, __assign({}, sheetconfig));
107
111
  }
108
112
  }
109
113
  function deleteSheet(ctx, id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.2.90-ydoc-6",
3
+ "version": "1.2.90-ydoc-8",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",