@univerjs/sheets-formula 0.25.0 → 1.0.0-alpha.0

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.
Files changed (91) hide show
  1. package/lib/cjs/en-US-B2EwEnJA.js +26 -0
  2. package/lib/cjs/en-US-Daqu9lkO.js +10582 -0
  3. package/lib/cjs/index.js +130 -87
  4. package/lib/cjs/locale/ar-SA.js +28 -10533
  5. package/lib/cjs/locale/ca-ES.js +26 -17
  6. package/lib/cjs/locale/de-DE.js +28 -10533
  7. package/lib/cjs/locale/en-US.js +27 -10532
  8. package/lib/cjs/locale/es-ES.js +26 -17
  9. package/lib/cjs/locale/fa-IR.js +58 -10563
  10. package/lib/cjs/locale/fr-FR.js +57 -10544
  11. package/lib/cjs/locale/id-ID.js +28 -10533
  12. package/lib/cjs/locale/it-IT.js +28 -10533
  13. package/lib/cjs/locale/ja-JP.js +26 -17
  14. package/lib/cjs/locale/ko-KR.js +26 -17
  15. package/lib/cjs/locale/pl-PL.js +28 -10533
  16. package/lib/cjs/locale/pt-BR.js +28 -10533
  17. package/lib/cjs/locale/ru-RU.js +41 -50
  18. package/lib/cjs/locale/sk-SK.js +26 -17
  19. package/lib/cjs/locale/vi-VN.js +26 -17
  20. package/lib/cjs/locale/zh-CN.js +26 -17
  21. package/lib/cjs/locale/zh-HK.js +28 -10533
  22. package/lib/cjs/locale/zh-TW.js +26 -17
  23. package/lib/en-US-CjsBUOZB.js +10498 -0
  24. package/lib/en-US-Kon3m8fM.js +20 -0
  25. package/lib/es/en-US-CjsBUOZB.js +10498 -0
  26. package/lib/es/en-US-Kon3m8fM.js +20 -0
  27. package/lib/es/index.js +130 -87
  28. package/lib/es/locale/ar-SA.js +28 -10532
  29. package/lib/es/locale/ca-ES.js +26 -17
  30. package/lib/es/locale/de-DE.js +28 -10532
  31. package/lib/es/locale/en-US.js +27 -10531
  32. package/lib/es/locale/es-ES.js +26 -17
  33. package/lib/es/locale/fa-IR.js +59 -10563
  34. package/lib/es/locale/fr-FR.js +58 -10544
  35. package/lib/es/locale/id-ID.js +28 -10532
  36. package/lib/es/locale/it-IT.js +28 -10532
  37. package/lib/es/locale/ja-JP.js +26 -17
  38. package/lib/es/locale/ko-KR.js +26 -17
  39. package/lib/es/locale/pl-PL.js +28 -10532
  40. package/lib/es/locale/pt-BR.js +28 -10532
  41. package/lib/es/locale/ru-RU.js +42 -50
  42. package/lib/es/locale/sk-SK.js +26 -17
  43. package/lib/es/locale/vi-VN.js +26 -17
  44. package/lib/es/locale/zh-CN.js +26 -17
  45. package/lib/es/locale/zh-HK.js +28 -10532
  46. package/lib/es/locale/zh-TW.js +26 -17
  47. package/lib/index.js +130 -87
  48. package/lib/locale/ar-SA.js +28 -10532
  49. package/lib/locale/ca-ES.js +26 -17
  50. package/lib/locale/de-DE.js +28 -10532
  51. package/lib/locale/en-US.js +27 -10531
  52. package/lib/locale/es-ES.js +26 -17
  53. package/lib/locale/fa-IR.js +59 -10563
  54. package/lib/locale/fr-FR.js +58 -10544
  55. package/lib/locale/id-ID.js +28 -10532
  56. package/lib/locale/it-IT.js +28 -10532
  57. package/lib/locale/ja-JP.js +26 -17
  58. package/lib/locale/ko-KR.js +26 -17
  59. package/lib/locale/pl-PL.js +28 -10532
  60. package/lib/locale/pt-BR.js +28 -10532
  61. package/lib/locale/ru-RU.js +42 -50
  62. package/lib/locale/sk-SK.js +26 -17
  63. package/lib/locale/vi-VN.js +26 -17
  64. package/lib/locale/zh-CN.js +26 -17
  65. package/lib/locale/zh-HK.js +28 -10532
  66. package/lib/locale/zh-TW.js +26 -17
  67. package/lib/types/controllers/array-formula-cell-interceptor.controller.d.ts +4 -2
  68. package/lib/types/index.d.ts +4 -3
  69. package/lib/types/locale/en-US.d.ts +7 -0
  70. package/lib/types/locale/types.d.ts +18 -0
  71. package/lib/umd/index.js +1 -1
  72. package/lib/umd/locale/ar-SA.js +1 -1
  73. package/lib/umd/locale/ca-ES.js +1 -1
  74. package/lib/umd/locale/de-DE.js +1 -1
  75. package/lib/umd/locale/en-US.js +1 -1
  76. package/lib/umd/locale/es-ES.js +1 -1
  77. package/lib/umd/locale/fa-IR.js +1 -1
  78. package/lib/umd/locale/fr-FR.js +1 -1
  79. package/lib/umd/locale/id-ID.js +1 -1
  80. package/lib/umd/locale/it-IT.js +1 -1
  81. package/lib/umd/locale/ja-JP.js +1 -1
  82. package/lib/umd/locale/ko-KR.js +1 -1
  83. package/lib/umd/locale/pl-PL.js +1 -1
  84. package/lib/umd/locale/pt-BR.js +1 -1
  85. package/lib/umd/locale/ru-RU.js +1 -1
  86. package/lib/umd/locale/sk-SK.js +1 -1
  87. package/lib/umd/locale/vi-VN.js +1 -1
  88. package/lib/umd/locale/zh-CN.js +1 -1
  89. package/lib/umd/locale/zh-HK.js +1 -1
  90. package/lib/umd/locale/zh-TW.js +1 -1
  91. package/package.json +9 -9
package/lib/cjs/index.js CHANGED
@@ -153,7 +153,7 @@ const PLUGIN_CONFIG_KEY_MOBILE = "sheets-formula.mobile.config";
153
153
  const configSymbolMobile = Symbol(PLUGIN_CONFIG_KEY_MOBILE);
154
154
 
155
155
  //#endregion
156
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateParam.js
156
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
157
157
  function __decorateParam(paramIndex, decorator) {
158
158
  return function(target, key) {
159
159
  decorator(target, key, paramIndex);
@@ -161,7 +161,7 @@ function __decorateParam(paramIndex, decorator) {
161
161
  }
162
162
 
163
163
  //#endregion
164
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
164
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
165
165
  function __decorate(decorators, target, key, desc) {
166
166
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
167
167
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -275,7 +275,7 @@ function getDataLength(copyDataPiece) {
275
275
  }
276
276
 
277
277
  //#endregion
278
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
278
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
279
279
  function _typeof(o) {
280
280
  "@babel/helpers - typeof";
281
281
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -286,7 +286,7 @@ function _typeof(o) {
286
286
  }
287
287
 
288
288
  //#endregion
289
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
289
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
290
290
  function toPrimitive(t, r) {
291
291
  if ("object" != _typeof(t) || !t) return t;
292
292
  var e = t[Symbol.toPrimitive];
@@ -299,14 +299,14 @@ function toPrimitive(t, r) {
299
299
  }
300
300
 
301
301
  //#endregion
302
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
302
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
303
303
  function toPropertyKey(t) {
304
304
  var i = toPrimitive(t, "string");
305
305
  return "symbol" == _typeof(i) ? i : i + "";
306
306
  }
307
307
 
308
308
  //#endregion
309
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
309
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
310
310
  function _defineProperty(e, r, t) {
311
311
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
312
312
  value: t,
@@ -1176,9 +1176,9 @@ function refRangeFormula(oldFormulaData, newFormulaData, formulaReferenceMovePar
1176
1176
  const targetUnitId = (_formulaReferenceMove = formulaReferenceMoveParam.targetUnitId) !== null && _formulaReferenceMove !== void 0 ? _formulaReferenceMove : fromUnitId;
1177
1177
  const targetSheetId = (_formulaReferenceMove2 = formulaReferenceMoveParam.targetSheetId) !== null && _formulaReferenceMove2 !== void 0 ? _formulaReferenceMove2 : fromSheetId;
1178
1178
  const isCrossSheet = fromUnitId !== targetUnitId || fromSheetId !== targetSheetId;
1179
- new Set([...Object.keys(oldFormulaData), ...Object.keys(newFormulaData)]).forEach((unitId) => {
1179
+ (/* @__PURE__ */ new Set([...Object.keys(oldFormulaData), ...Object.keys(newFormulaData)])).forEach((unitId) => {
1180
1180
  if (checkFormulaDataNull(oldFormulaData, unitId, fromSheetId)) return;
1181
- new Set([...Object.keys(oldFormulaData[unitId] || {}), ...Object.keys(newFormulaData[unitId] || {})]).forEach((currentSheetId) => {
1181
+ (/* @__PURE__ */ new Set([...Object.keys(oldFormulaData[unitId] || {}), ...Object.keys(newFormulaData[unitId] || {})])).forEach((currentSheetId) => {
1182
1182
  var _oldFormulaData$unitI, _newFormulaData$unitI;
1183
1183
  const currentOldFormulaData = (_oldFormulaData$unitI = oldFormulaData[unitId]) === null || _oldFormulaData$unitI === void 0 ? void 0 : _oldFormulaData$unitI[currentSheetId];
1184
1184
  const currentNewFormulaData = (_newFormulaData$unitI = newFormulaData[unitId]) === null || _newFormulaData$unitI === void 0 ? void 0 : _newFormulaData$unitI[currentSheetId];
@@ -2325,7 +2325,7 @@ let UpdateFormulaController = class UpdateFormulaController extends _univerjs_co
2325
2325
  this.disposeWithMe(this._commandService.beforeCommandExecuted((command, options) => {
2326
2326
  if (command.id === _univerjs_sheets.SetRangeValuesMutation.id) {
2327
2327
  const params = command.params;
2328
- if (options && options.onlyLocal === true || options && options.syncOnly === true || options && options.fromChangeset === true || params.trigger === _univerjs_sheets.SetStyleCommand.id || params.trigger === _univerjs_sheets.SetBorderCommand.id || params.trigger === _univerjs_sheets.ClearSelectionFormatCommand.id || params.trigger === _univerjs_sheets.SetRangeCustomMetadataCommand.id) return;
2328
+ if (shouldSkipFormulaUpdateForSetRangeValues(params, options)) return;
2329
2329
  this._handleSetRangeValuesMutation(params);
2330
2330
  }
2331
2331
  }));
@@ -2616,6 +2616,40 @@ UpdateFormulaController = __decorate([
2616
2616
  __decorateParam(6, _univerjs_core.IConfigService),
2617
2617
  __decorateParam(7, (0, _univerjs_core.Inject)(_univerjs_core.Injector))
2618
2618
  ], UpdateFormulaController);
2619
+ /**
2620
+ * Whether to skip the formula update when the setRangeValues mutation is executed.
2621
+ * The style-only cell value does not affect the formula calculation, so it can be skipped.
2622
+ */
2623
+ function shouldSkipFormulaUpdateForSetRangeValues(params, options) {
2624
+ if (options && (options.onlyLocal === true || options.syncOnly === true || options.fromChangeset === true)) return true;
2625
+ const { cellValue, trigger } = params;
2626
+ if (trigger && [
2627
+ _univerjs_sheets.SetStyleCommand.id,
2628
+ _univerjs_sheets.SetBorderCommand.id,
2629
+ _univerjs_sheets.ClearSelectionFormatCommand.id,
2630
+ _univerjs_sheets.SetRangeCustomMetadataCommand.id
2631
+ ].includes(trigger)) return true;
2632
+ if (!cellValue) return true;
2633
+ return isStyleOnlyCellValue(cellValue);
2634
+ }
2635
+ function isStyleOnlyCellValue(cellValue) {
2636
+ const matrix = new _univerjs_core.ObjectMatrix(cellValue);
2637
+ let hasCell = false;
2638
+ let styleOnly = true;
2639
+ matrix.forValue((_row, _col, cell) => {
2640
+ hasCell = true;
2641
+ if (!cell) {
2642
+ styleOnly = false;
2643
+ return false;
2644
+ }
2645
+ const keys = Object.keys(cell);
2646
+ if (keys.length !== 1 || keys[0] !== "s") {
2647
+ styleOnly = false;
2648
+ return false;
2649
+ }
2650
+ });
2651
+ return hasCell && styleOnly;
2652
+ }
2619
2653
  function tableReferenceContainsColumn(columnStruct, columnNames) {
2620
2654
  if (!(columnNames === null || columnNames === void 0 ? void 0 : columnNames.length) || columnStruct.length === 0) return false;
2621
2655
  const columnNameSet = new Set(columnNames);
@@ -2630,7 +2664,7 @@ function tableReferenceContainsColumn(columnStruct, columnNames) {
2630
2664
  //#endregion
2631
2665
  //#region package.json
2632
2666
  var name = "@univerjs/sheets-formula";
2633
- var version = "0.25.0";
2667
+ var version = "1.0.0-alpha.0";
2634
2668
 
2635
2669
  //#endregion
2636
2670
  //#region src/common/plugin-name.ts
@@ -2999,10 +3033,11 @@ ActiveDirtyController = __decorate([
2999
3033
  //#endregion
3000
3034
  //#region src/controllers/array-formula-cell-interceptor.controller.ts
3001
3035
  let ArrayFormulaCellInterceptorController = class ArrayFormulaCellInterceptorController extends _univerjs_core.Disposable {
3002
- constructor(_commandService, _configService, _sheetInterceptorService, _formulaDataModel, _lexerTreeBuilder, _functionService, _definedNamesService) {
3036
+ constructor(_commandService, _configService, _univerInstanceService, _sheetInterceptorService, _formulaDataModel, _lexerTreeBuilder, _functionService, _definedNamesService) {
3003
3037
  super();
3004
3038
  this._commandService = _commandService;
3005
3039
  this._configService = _configService;
3040
+ this._univerInstanceService = _univerInstanceService;
3006
3041
  this._sheetInterceptorService = _sheetInterceptorService;
3007
3042
  this._formulaDataModel = _formulaDataModel;
3008
3043
  this._lexerTreeBuilder = _lexerTreeBuilder;
@@ -3053,86 +3088,93 @@ let ArrayFormulaCellInterceptorController = class ArrayFormulaCellInterceptorCon
3053
3088
  _addPrefixToFunctionSnapshot() {
3054
3089
  const dataModel = this._formulaDataModel.getFormulaData();
3055
3090
  const cacheMap = /* @__PURE__ */ new Map();
3056
- Object.entries(dataModel).forEach(([unitId, subUnitData]) => {
3057
- subUnitData && Array.from(Object.entries(subUnitData)).forEach(([subUnitId, formulaDataItem]) => {
3058
- if (!formulaDataItem) return;
3059
- const cellValue = new _univerjs_core.ObjectMatrix();
3060
- new _univerjs_core.ObjectMatrix(formulaDataItem).forValue((row, col, value) => {
3061
- const functionText = value === null || value === void 0 ? void 0 : value.f;
3062
- if ((value === null || value === void 0 ? void 0 : value.x) != null || !functionText || functionText.length === 0) return;
3063
- if (cacheMap.has(functionText)) {
3064
- const cachedFormula = cacheMap.get(functionText);
3065
- cellValue.setValue(row, col, { xf: cachedFormula });
3066
- return;
3067
- }
3068
- const newFormula = this._lexerTreeBuilder.getNewFormulaWithPrefix(functionText, this._functionService.hasExecutor.bind(this._functionService));
3069
- if (newFormula) {
3070
- cellValue.setValue(row, col, { xf: newFormula });
3071
- cacheMap.set(functionText, newFormula);
3072
- }
3073
- });
3074
- this._commandService.executeCommand(_univerjs_sheets.SetRangeValuesMutation.id, {
3075
- unitId,
3076
- subUnitId,
3077
- cellValue: cellValue.getMatrix()
3078
- }, {
3079
- onlyLocal: true,
3080
- fromFormula: true
3081
- });
3091
+ this._forEachSheetSnapshotData(dataModel, (unitId, subUnitId, formulaDataItem) => {
3092
+ if (!formulaDataItem) return;
3093
+ const cellValue = new _univerjs_core.ObjectMatrix();
3094
+ new _univerjs_core.ObjectMatrix(formulaDataItem).forValue((row, col, value) => {
3095
+ const functionText = value === null || value === void 0 ? void 0 : value.f;
3096
+ if ((value === null || value === void 0 ? void 0 : value.x) != null || !functionText || functionText.length === 0) return;
3097
+ if (cacheMap.has(functionText)) {
3098
+ const cachedFormula = cacheMap.get(functionText);
3099
+ cellValue.setValue(row, col, { xf: cachedFormula });
3100
+ return;
3101
+ }
3102
+ const newFormula = this._lexerTreeBuilder.getNewFormulaWithPrefix(functionText, this._functionService.hasExecutor.bind(this._functionService));
3103
+ if (newFormula) {
3104
+ cellValue.setValue(row, col, { xf: newFormula });
3105
+ cacheMap.set(functionText, newFormula);
3106
+ }
3107
+ });
3108
+ this._commandService.executeCommand(_univerjs_sheets.SetRangeValuesMutation.id, {
3109
+ unitId,
3110
+ subUnitId,
3111
+ cellValue: cellValue.getMatrix()
3112
+ }, {
3113
+ onlyLocal: true,
3114
+ fromFormula: true
3082
3115
  });
3083
3116
  });
3084
3117
  cacheMap.clear();
3085
3118
  }
3119
+ _forEachSheetSnapshotData(snapshotData, iterator) {
3120
+ if (!snapshotData) return;
3121
+ const workbooks = this._univerInstanceService.getAllUnitsForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
3122
+ for (const workbook of workbooks) {
3123
+ const unitId = workbook.getUnitId();
3124
+ const subUnitData = snapshotData[unitId];
3125
+ if (!subUnitData) continue;
3126
+ for (const worksheet of workbook.getSheets()) {
3127
+ const subUnitId = worksheet.getSheetId();
3128
+ const data = subUnitData[subUnitId];
3129
+ if (data == null) continue;
3130
+ iterator(unitId, subUnitId, data);
3131
+ }
3132
+ }
3133
+ }
3086
3134
  _writeArrayFormulaToSnapshot(arrayFormulaRange, arrayFormulaCellData, arrayFormulaEmbedded) {
3087
- arrayFormulaRange && Object.entries(arrayFormulaRange).forEach(([unitId, subUnitData]) => {
3088
- subUnitData && Array.from(Object.entries(subUnitData)).forEach(([subUnitId, rangeData]) => {
3089
- const cellValue = new _univerjs_core.ObjectMatrix();
3090
- new _univerjs_core.ObjectMatrix(rangeData).forValue((row, col, value) => {
3091
- cellValue.setValue(row, col, { ref: (0, _univerjs_engine_formula.serializeRange)(value) });
3092
- });
3093
- this._commandService.executeCommand(_univerjs_sheets.SetRangeValuesMutation.id, {
3094
- unitId,
3095
- subUnitId,
3096
- cellValue: cellValue.getMatrix()
3097
- }, {
3098
- onlyLocal: true,
3099
- fromFormula: true
3100
- });
3135
+ this._forEachSheetSnapshotData(arrayFormulaRange, (unitId, subUnitId, rangeData) => {
3136
+ const cellValue = new _univerjs_core.ObjectMatrix();
3137
+ new _univerjs_core.ObjectMatrix(rangeData).forValue((row, col, value) => {
3138
+ cellValue.setValue(row, col, { ref: (0, _univerjs_engine_formula.serializeRange)(value) });
3139
+ });
3140
+ this._commandService.executeCommand(_univerjs_sheets.SetRangeValuesMutation.id, {
3141
+ unitId,
3142
+ subUnitId,
3143
+ cellValue: cellValue.getMatrix()
3144
+ }, {
3145
+ onlyLocal: true,
3146
+ fromFormula: true
3101
3147
  });
3102
3148
  });
3103
- arrayFormulaEmbedded && Object.entries(arrayFormulaEmbedded).forEach(([unitId, subUnitData]) => {
3104
- subUnitData && Array.from(Object.entries(subUnitData)).forEach(([subUnitId, rangeData]) => {
3105
- const cellValue = new _univerjs_core.ObjectMatrix();
3106
- new _univerjs_core.ObjectMatrix(rangeData).forValue((row, col) => {
3107
- var _arrayFormulaRange$un;
3108
- if (arrayFormulaRange === null || arrayFormulaRange === void 0 || (_arrayFormulaRange$un = arrayFormulaRange[unitId]) === null || _arrayFormulaRange$un === void 0 || (_arrayFormulaRange$un = _arrayFormulaRange$un[subUnitId]) === null || _arrayFormulaRange$un === void 0 || (_arrayFormulaRange$un = _arrayFormulaRange$un[row]) === null || _arrayFormulaRange$un === void 0 ? void 0 : _arrayFormulaRange$un[col]) return;
3109
- cellValue.setValue(row, col, { ref: (0, _univerjs_engine_formula.serializeRange)({
3110
- startRow: row,
3111
- endRow: row,
3112
- startColumn: col,
3113
- endColumn: col
3114
- }) });
3115
- });
3116
- this._commandService.executeCommand(_univerjs_sheets.SetRangeValuesMutation.id, {
3117
- unitId,
3118
- subUnitId,
3119
- cellValue: cellValue.getMatrix()
3120
- }, {
3121
- onlyLocal: true,
3122
- fromFormula: true
3123
- });
3149
+ this._forEachSheetSnapshotData(arrayFormulaEmbedded, (unitId, subUnitId, rangeData) => {
3150
+ const cellValue = new _univerjs_core.ObjectMatrix();
3151
+ new _univerjs_core.ObjectMatrix(rangeData).forValue((row, col) => {
3152
+ var _arrayFormulaRange$un;
3153
+ if (arrayFormulaRange === null || arrayFormulaRange === void 0 || (_arrayFormulaRange$un = arrayFormulaRange[unitId]) === null || _arrayFormulaRange$un === void 0 || (_arrayFormulaRange$un = _arrayFormulaRange$un[subUnitId]) === null || _arrayFormulaRange$un === void 0 || (_arrayFormulaRange$un = _arrayFormulaRange$un[row]) === null || _arrayFormulaRange$un === void 0 ? void 0 : _arrayFormulaRange$un[col]) return;
3154
+ cellValue.setValue(row, col, { ref: (0, _univerjs_engine_formula.serializeRange)({
3155
+ startRow: row,
3156
+ endRow: row,
3157
+ startColumn: col,
3158
+ endColumn: col
3159
+ }) });
3160
+ });
3161
+ this._commandService.executeCommand(_univerjs_sheets.SetRangeValuesMutation.id, {
3162
+ unitId,
3163
+ subUnitId,
3164
+ cellValue: cellValue.getMatrix()
3165
+ }, {
3166
+ onlyLocal: true,
3167
+ fromFormula: true
3124
3168
  });
3125
3169
  });
3126
- arrayFormulaCellData && Object.entries(arrayFormulaCellData).forEach(([unitId, subUnitData]) => {
3127
- subUnitData && Array.from(Object.entries(subUnitData)).forEach(([subUnitId, rowData]) => {
3128
- this._commandService.executeCommand(_univerjs_sheets.SetRangeValuesMutation.id, {
3129
- unitId,
3130
- subUnitId,
3131
- cellValue: rowData
3132
- }, {
3133
- onlyLocal: true,
3134
- fromFormula: true
3135
- });
3170
+ this._forEachSheetSnapshotData(arrayFormulaCellData, (unitId, subUnitId, rowData) => {
3171
+ this._commandService.executeCommand(_univerjs_sheets.SetRangeValuesMutation.id, {
3172
+ unitId,
3173
+ subUnitId,
3174
+ cellValue: rowData
3175
+ }, {
3176
+ onlyLocal: true,
3177
+ fromFormula: true
3136
3178
  });
3137
3179
  });
3138
3180
  }
@@ -3167,11 +3209,12 @@ let ArrayFormulaCellInterceptorController = class ArrayFormulaCellInterceptorCon
3167
3209
  ArrayFormulaCellInterceptorController = __decorate([
3168
3210
  __decorateParam(0, _univerjs_core.ICommandService),
3169
3211
  __decorateParam(1, _univerjs_core.IConfigService),
3170
- __decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetInterceptorService)),
3171
- __decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_engine_formula.FormulaDataModel)),
3172
- __decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_engine_formula.LexerTreeBuilder)),
3173
- __decorateParam(5, _univerjs_engine_formula.IFunctionService),
3174
- __decorateParam(6, _univerjs_engine_formula.IDefinedNamesService)
3212
+ __decorateParam(2, _univerjs_core.IUniverInstanceService),
3213
+ __decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetInterceptorService)),
3214
+ __decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_engine_formula.FormulaDataModel)),
3215
+ __decorateParam(5, (0, _univerjs_core.Inject)(_univerjs_engine_formula.LexerTreeBuilder)),
3216
+ __decorateParam(6, _univerjs_engine_formula.IFunctionService),
3217
+ __decorateParam(7, _univerjs_engine_formula.IDefinedNamesService)
3175
3218
  ], ArrayFormulaCellInterceptorController);
3176
3219
 
3177
3220
  //#endregion