@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
@@ -0,0 +1,20 @@
1
+ //#region src/locale/function-list/univer/en-US.ts
2
+ /**
3
+ * Copyright 2023-present DreamNum Co., Ltd.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ const locale = {};
18
+
19
+ //#endregion
20
+ export { locale as t };
package/lib/es/index.js CHANGED
@@ -152,7 +152,7 @@ const PLUGIN_CONFIG_KEY_MOBILE = "sheets-formula.mobile.config";
152
152
  const configSymbolMobile = Symbol(PLUGIN_CONFIG_KEY_MOBILE);
153
153
 
154
154
  //#endregion
155
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateParam.js
155
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
156
156
  function __decorateParam(paramIndex, decorator) {
157
157
  return function(target, key) {
158
158
  decorator(target, key, paramIndex);
@@ -160,7 +160,7 @@ function __decorateParam(paramIndex, decorator) {
160
160
  }
161
161
 
162
162
  //#endregion
163
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
163
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
164
164
  function __decorate(decorators, target, key, desc) {
165
165
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
166
166
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -274,7 +274,7 @@ function getDataLength(copyDataPiece) {
274
274
  }
275
275
 
276
276
  //#endregion
277
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
277
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
278
278
  function _typeof(o) {
279
279
  "@babel/helpers - typeof";
280
280
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -285,7 +285,7 @@ function _typeof(o) {
285
285
  }
286
286
 
287
287
  //#endregion
288
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
288
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
289
289
  function toPrimitive(t, r) {
290
290
  if ("object" != _typeof(t) || !t) return t;
291
291
  var e = t[Symbol.toPrimitive];
@@ -298,14 +298,14 @@ function toPrimitive(t, r) {
298
298
  }
299
299
 
300
300
  //#endregion
301
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
301
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
302
302
  function toPropertyKey(t) {
303
303
  var i = toPrimitive(t, "string");
304
304
  return "symbol" == _typeof(i) ? i : i + "";
305
305
  }
306
306
 
307
307
  //#endregion
308
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
308
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
309
309
  function _defineProperty(e, r, t) {
310
310
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
311
311
  value: t,
@@ -1175,9 +1175,9 @@ function refRangeFormula(oldFormulaData, newFormulaData, formulaReferenceMovePar
1175
1175
  const targetUnitId = (_formulaReferenceMove = formulaReferenceMoveParam.targetUnitId) !== null && _formulaReferenceMove !== void 0 ? _formulaReferenceMove : fromUnitId;
1176
1176
  const targetSheetId = (_formulaReferenceMove2 = formulaReferenceMoveParam.targetSheetId) !== null && _formulaReferenceMove2 !== void 0 ? _formulaReferenceMove2 : fromSheetId;
1177
1177
  const isCrossSheet = fromUnitId !== targetUnitId || fromSheetId !== targetSheetId;
1178
- new Set([...Object.keys(oldFormulaData), ...Object.keys(newFormulaData)]).forEach((unitId) => {
1178
+ (/* @__PURE__ */ new Set([...Object.keys(oldFormulaData), ...Object.keys(newFormulaData)])).forEach((unitId) => {
1179
1179
  if (checkFormulaDataNull(oldFormulaData, unitId, fromSheetId)) return;
1180
- new Set([...Object.keys(oldFormulaData[unitId] || {}), ...Object.keys(newFormulaData[unitId] || {})]).forEach((currentSheetId) => {
1180
+ (/* @__PURE__ */ new Set([...Object.keys(oldFormulaData[unitId] || {}), ...Object.keys(newFormulaData[unitId] || {})])).forEach((currentSheetId) => {
1181
1181
  var _oldFormulaData$unitI, _newFormulaData$unitI;
1182
1182
  const currentOldFormulaData = (_oldFormulaData$unitI = oldFormulaData[unitId]) === null || _oldFormulaData$unitI === void 0 ? void 0 : _oldFormulaData$unitI[currentSheetId];
1183
1183
  const currentNewFormulaData = (_newFormulaData$unitI = newFormulaData[unitId]) === null || _newFormulaData$unitI === void 0 ? void 0 : _newFormulaData$unitI[currentSheetId];
@@ -2324,7 +2324,7 @@ let UpdateFormulaController = class UpdateFormulaController extends Disposable {
2324
2324
  this.disposeWithMe(this._commandService.beforeCommandExecuted((command, options) => {
2325
2325
  if (command.id === SetRangeValuesMutation.id) {
2326
2326
  const params = command.params;
2327
- if (options && options.onlyLocal === true || options && options.syncOnly === true || options && options.fromChangeset === true || params.trigger === SetStyleCommand.id || params.trigger === SetBorderCommand.id || params.trigger === ClearSelectionFormatCommand.id || params.trigger === SetRangeCustomMetadataCommand.id) return;
2327
+ if (shouldSkipFormulaUpdateForSetRangeValues(params, options)) return;
2328
2328
  this._handleSetRangeValuesMutation(params);
2329
2329
  }
2330
2330
  }));
@@ -2615,6 +2615,40 @@ UpdateFormulaController = __decorate([
2615
2615
  __decorateParam(6, IConfigService),
2616
2616
  __decorateParam(7, Inject(Injector))
2617
2617
  ], UpdateFormulaController);
2618
+ /**
2619
+ * Whether to skip the formula update when the setRangeValues mutation is executed.
2620
+ * The style-only cell value does not affect the formula calculation, so it can be skipped.
2621
+ */
2622
+ function shouldSkipFormulaUpdateForSetRangeValues(params, options) {
2623
+ if (options && (options.onlyLocal === true || options.syncOnly === true || options.fromChangeset === true)) return true;
2624
+ const { cellValue, trigger } = params;
2625
+ if (trigger && [
2626
+ SetStyleCommand.id,
2627
+ SetBorderCommand.id,
2628
+ ClearSelectionFormatCommand.id,
2629
+ SetRangeCustomMetadataCommand.id
2630
+ ].includes(trigger)) return true;
2631
+ if (!cellValue) return true;
2632
+ return isStyleOnlyCellValue(cellValue);
2633
+ }
2634
+ function isStyleOnlyCellValue(cellValue) {
2635
+ const matrix = new ObjectMatrix(cellValue);
2636
+ let hasCell = false;
2637
+ let styleOnly = true;
2638
+ matrix.forValue((_row, _col, cell) => {
2639
+ hasCell = true;
2640
+ if (!cell) {
2641
+ styleOnly = false;
2642
+ return false;
2643
+ }
2644
+ const keys = Object.keys(cell);
2645
+ if (keys.length !== 1 || keys[0] !== "s") {
2646
+ styleOnly = false;
2647
+ return false;
2648
+ }
2649
+ });
2650
+ return hasCell && styleOnly;
2651
+ }
2618
2652
  function tableReferenceContainsColumn(columnStruct, columnNames) {
2619
2653
  if (!(columnNames === null || columnNames === void 0 ? void 0 : columnNames.length) || columnStruct.length === 0) return false;
2620
2654
  const columnNameSet = new Set(columnNames);
@@ -2629,7 +2663,7 @@ function tableReferenceContainsColumn(columnStruct, columnNames) {
2629
2663
  //#endregion
2630
2664
  //#region package.json
2631
2665
  var name = "@univerjs/sheets-formula";
2632
- var version = "0.25.0";
2666
+ var version = "1.0.0-alpha.0";
2633
2667
 
2634
2668
  //#endregion
2635
2669
  //#region src/common/plugin-name.ts
@@ -2998,10 +3032,11 @@ ActiveDirtyController = __decorate([
2998
3032
  //#endregion
2999
3033
  //#region src/controllers/array-formula-cell-interceptor.controller.ts
3000
3034
  let ArrayFormulaCellInterceptorController = class ArrayFormulaCellInterceptorController extends Disposable {
3001
- constructor(_commandService, _configService, _sheetInterceptorService, _formulaDataModel, _lexerTreeBuilder, _functionService, _definedNamesService) {
3035
+ constructor(_commandService, _configService, _univerInstanceService, _sheetInterceptorService, _formulaDataModel, _lexerTreeBuilder, _functionService, _definedNamesService) {
3002
3036
  super();
3003
3037
  this._commandService = _commandService;
3004
3038
  this._configService = _configService;
3039
+ this._univerInstanceService = _univerInstanceService;
3005
3040
  this._sheetInterceptorService = _sheetInterceptorService;
3006
3041
  this._formulaDataModel = _formulaDataModel;
3007
3042
  this._lexerTreeBuilder = _lexerTreeBuilder;
@@ -3052,86 +3087,93 @@ let ArrayFormulaCellInterceptorController = class ArrayFormulaCellInterceptorCon
3052
3087
  _addPrefixToFunctionSnapshot() {
3053
3088
  const dataModel = this._formulaDataModel.getFormulaData();
3054
3089
  const cacheMap = /* @__PURE__ */ new Map();
3055
- Object.entries(dataModel).forEach(([unitId, subUnitData]) => {
3056
- subUnitData && Array.from(Object.entries(subUnitData)).forEach(([subUnitId, formulaDataItem]) => {
3057
- if (!formulaDataItem) return;
3058
- const cellValue = new ObjectMatrix();
3059
- new ObjectMatrix(formulaDataItem).forValue((row, col, value) => {
3060
- const functionText = value === null || value === void 0 ? void 0 : value.f;
3061
- if ((value === null || value === void 0 ? void 0 : value.x) != null || !functionText || functionText.length === 0) return;
3062
- if (cacheMap.has(functionText)) {
3063
- const cachedFormula = cacheMap.get(functionText);
3064
- cellValue.setValue(row, col, { xf: cachedFormula });
3065
- return;
3066
- }
3067
- const newFormula = this._lexerTreeBuilder.getNewFormulaWithPrefix(functionText, this._functionService.hasExecutor.bind(this._functionService));
3068
- if (newFormula) {
3069
- cellValue.setValue(row, col, { xf: newFormula });
3070
- cacheMap.set(functionText, newFormula);
3071
- }
3072
- });
3073
- this._commandService.executeCommand(SetRangeValuesMutation.id, {
3074
- unitId,
3075
- subUnitId,
3076
- cellValue: cellValue.getMatrix()
3077
- }, {
3078
- onlyLocal: true,
3079
- fromFormula: true
3080
- });
3090
+ this._forEachSheetSnapshotData(dataModel, (unitId, subUnitId, formulaDataItem) => {
3091
+ if (!formulaDataItem) return;
3092
+ const cellValue = new ObjectMatrix();
3093
+ new ObjectMatrix(formulaDataItem).forValue((row, col, value) => {
3094
+ const functionText = value === null || value === void 0 ? void 0 : value.f;
3095
+ if ((value === null || value === void 0 ? void 0 : value.x) != null || !functionText || functionText.length === 0) return;
3096
+ if (cacheMap.has(functionText)) {
3097
+ const cachedFormula = cacheMap.get(functionText);
3098
+ cellValue.setValue(row, col, { xf: cachedFormula });
3099
+ return;
3100
+ }
3101
+ const newFormula = this._lexerTreeBuilder.getNewFormulaWithPrefix(functionText, this._functionService.hasExecutor.bind(this._functionService));
3102
+ if (newFormula) {
3103
+ cellValue.setValue(row, col, { xf: newFormula });
3104
+ cacheMap.set(functionText, newFormula);
3105
+ }
3106
+ });
3107
+ this._commandService.executeCommand(SetRangeValuesMutation.id, {
3108
+ unitId,
3109
+ subUnitId,
3110
+ cellValue: cellValue.getMatrix()
3111
+ }, {
3112
+ onlyLocal: true,
3113
+ fromFormula: true
3081
3114
  });
3082
3115
  });
3083
3116
  cacheMap.clear();
3084
3117
  }
3118
+ _forEachSheetSnapshotData(snapshotData, iterator) {
3119
+ if (!snapshotData) return;
3120
+ const workbooks = this._univerInstanceService.getAllUnitsForType(UniverInstanceType.UNIVER_SHEET);
3121
+ for (const workbook of workbooks) {
3122
+ const unitId = workbook.getUnitId();
3123
+ const subUnitData = snapshotData[unitId];
3124
+ if (!subUnitData) continue;
3125
+ for (const worksheet of workbook.getSheets()) {
3126
+ const subUnitId = worksheet.getSheetId();
3127
+ const data = subUnitData[subUnitId];
3128
+ if (data == null) continue;
3129
+ iterator(unitId, subUnitId, data);
3130
+ }
3131
+ }
3132
+ }
3085
3133
  _writeArrayFormulaToSnapshot(arrayFormulaRange, arrayFormulaCellData, arrayFormulaEmbedded) {
3086
- arrayFormulaRange && Object.entries(arrayFormulaRange).forEach(([unitId, subUnitData]) => {
3087
- subUnitData && Array.from(Object.entries(subUnitData)).forEach(([subUnitId, rangeData]) => {
3088
- const cellValue = new ObjectMatrix();
3089
- new ObjectMatrix(rangeData).forValue((row, col, value) => {
3090
- cellValue.setValue(row, col, { ref: serializeRange(value) });
3091
- });
3092
- this._commandService.executeCommand(SetRangeValuesMutation.id, {
3093
- unitId,
3094
- subUnitId,
3095
- cellValue: cellValue.getMatrix()
3096
- }, {
3097
- onlyLocal: true,
3098
- fromFormula: true
3099
- });
3134
+ this._forEachSheetSnapshotData(arrayFormulaRange, (unitId, subUnitId, rangeData) => {
3135
+ const cellValue = new ObjectMatrix();
3136
+ new ObjectMatrix(rangeData).forValue((row, col, value) => {
3137
+ cellValue.setValue(row, col, { ref: serializeRange(value) });
3138
+ });
3139
+ this._commandService.executeCommand(SetRangeValuesMutation.id, {
3140
+ unitId,
3141
+ subUnitId,
3142
+ cellValue: cellValue.getMatrix()
3143
+ }, {
3144
+ onlyLocal: true,
3145
+ fromFormula: true
3100
3146
  });
3101
3147
  });
3102
- arrayFormulaEmbedded && Object.entries(arrayFormulaEmbedded).forEach(([unitId, subUnitData]) => {
3103
- subUnitData && Array.from(Object.entries(subUnitData)).forEach(([subUnitId, rangeData]) => {
3104
- const cellValue = new ObjectMatrix();
3105
- new ObjectMatrix(rangeData).forValue((row, col) => {
3106
- var _arrayFormulaRange$un;
3107
- 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;
3108
- cellValue.setValue(row, col, { ref: serializeRange({
3109
- startRow: row,
3110
- endRow: row,
3111
- startColumn: col,
3112
- endColumn: col
3113
- }) });
3114
- });
3115
- this._commandService.executeCommand(SetRangeValuesMutation.id, {
3116
- unitId,
3117
- subUnitId,
3118
- cellValue: cellValue.getMatrix()
3119
- }, {
3120
- onlyLocal: true,
3121
- fromFormula: true
3122
- });
3148
+ this._forEachSheetSnapshotData(arrayFormulaEmbedded, (unitId, subUnitId, rangeData) => {
3149
+ const cellValue = new ObjectMatrix();
3150
+ new ObjectMatrix(rangeData).forValue((row, col) => {
3151
+ var _arrayFormulaRange$un;
3152
+ 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;
3153
+ cellValue.setValue(row, col, { ref: serializeRange({
3154
+ startRow: row,
3155
+ endRow: row,
3156
+ startColumn: col,
3157
+ endColumn: col
3158
+ }) });
3159
+ });
3160
+ this._commandService.executeCommand(SetRangeValuesMutation.id, {
3161
+ unitId,
3162
+ subUnitId,
3163
+ cellValue: cellValue.getMatrix()
3164
+ }, {
3165
+ onlyLocal: true,
3166
+ fromFormula: true
3123
3167
  });
3124
3168
  });
3125
- arrayFormulaCellData && Object.entries(arrayFormulaCellData).forEach(([unitId, subUnitData]) => {
3126
- subUnitData && Array.from(Object.entries(subUnitData)).forEach(([subUnitId, rowData]) => {
3127
- this._commandService.executeCommand(SetRangeValuesMutation.id, {
3128
- unitId,
3129
- subUnitId,
3130
- cellValue: rowData
3131
- }, {
3132
- onlyLocal: true,
3133
- fromFormula: true
3134
- });
3169
+ this._forEachSheetSnapshotData(arrayFormulaCellData, (unitId, subUnitId, rowData) => {
3170
+ this._commandService.executeCommand(SetRangeValuesMutation.id, {
3171
+ unitId,
3172
+ subUnitId,
3173
+ cellValue: rowData
3174
+ }, {
3175
+ onlyLocal: true,
3176
+ fromFormula: true
3135
3177
  });
3136
3178
  });
3137
3179
  }
@@ -3166,11 +3208,12 @@ let ArrayFormulaCellInterceptorController = class ArrayFormulaCellInterceptorCon
3166
3208
  ArrayFormulaCellInterceptorController = __decorate([
3167
3209
  __decorateParam(0, ICommandService),
3168
3210
  __decorateParam(1, IConfigService),
3169
- __decorateParam(2, Inject(SheetInterceptorService)),
3170
- __decorateParam(3, Inject(FormulaDataModel)),
3171
- __decorateParam(4, Inject(LexerTreeBuilder)),
3172
- __decorateParam(5, IFunctionService),
3173
- __decorateParam(6, IDefinedNamesService)
3211
+ __decorateParam(2, IUniverInstanceService),
3212
+ __decorateParam(3, Inject(SheetInterceptorService)),
3213
+ __decorateParam(4, Inject(FormulaDataModel)),
3214
+ __decorateParam(5, Inject(LexerTreeBuilder)),
3215
+ __decorateParam(6, IFunctionService),
3216
+ __decorateParam(7, IDefinedNamesService)
3174
3217
  ], ArrayFormulaCellInterceptorController);
3175
3218
 
3176
3219
  //#endregion