@univerjs/sheets-formula 0.23.0 → 0.24.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.
package/lib/cjs/index.js CHANGED
@@ -1899,7 +1899,7 @@ let UpdateDefinedNameController = class UpdateDefinedNameController extends _uni
1899
1899
  redos: [],
1900
1900
  undos: []
1901
1901
  };
1902
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
1902
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
1903
1903
  if (workbook == null) return {
1904
1904
  redos: [],
1905
1905
  undos: []
@@ -2121,7 +2121,7 @@ let UpdateFormulaController = class UpdateFormulaController extends _univerjs_co
2121
2121
  };
2122
2122
  }
2123
2123
  _getUpdateFormula(command) {
2124
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
2124
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
2125
2125
  if (!workbook) return {
2126
2126
  undos: [],
2127
2127
  redos: []
@@ -2310,7 +2310,7 @@ UpdateFormulaController = __decorate([
2310
2310
  //#endregion
2311
2311
  //#region package.json
2312
2312
  var name = "@univerjs/sheets-formula";
2313
- var version = "0.23.0";
2313
+ var version = "0.24.0";
2314
2314
 
2315
2315
  //#endregion
2316
2316
  //#region src/common/plugin-name.ts
@@ -15914,7 +15914,7 @@ let FormulaRefRangeService = class FormulaRefRangeService extends _univerjs_core
15914
15914
  }
15915
15915
  transformFormulaByEffectCommand(unitId, subUnitId, formula, params) {
15916
15916
  const sequenceNodes = this._lexerTreeBuilder.sequenceNodesBuilder(formula);
15917
- const currentUnit = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
15917
+ const currentUnit = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
15918
15918
  const currentSheet = currentUnit.getActiveSheet();
15919
15919
  const currentUnitId = currentUnit.getUnitId();
15920
15920
  const currentSheetId = currentSheet.getSheetId();
@@ -15948,7 +15948,7 @@ let FormulaRefRangeService = class FormulaRefRangeService extends _univerjs_core
15948
15948
  const sequenceNodes = this._lexerTreeBuilder.sequenceNodesBuilder(formula);
15949
15949
  const disposableCollection = new _univerjs_core.DisposableCollection();
15950
15950
  const handleChange = (params) => {
15951
- const currentUnit = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
15951
+ const currentUnit = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
15952
15952
  const currentSheet = currentUnit.getActiveSheet();
15953
15953
  const currentUnitId = currentUnit.getUnitId();
15954
15954
  const currentSheetId = currentSheet.getSheetId();
@@ -16049,7 +16049,11 @@ let FormulaRefRangeService = class FormulaRefRangeService extends _univerjs_core
16049
16049
  const offsetRow = currentStartRow - originStartRow;
16050
16050
  const offsetColumn = currentStartColumn - originStartColumn;
16051
16051
  for (const range of effectedRanges.ranges) {
16052
- const intersectedRange = ranges.map((r) => (0, _univerjs_core.getIntersectRange)(range, r)).filter(Boolean);
16052
+ const intersectedRange = [];
16053
+ for (const r of ranges) {
16054
+ const intersect = (0, _univerjs_core.getIntersectRange)(range, r);
16055
+ if (intersect) intersectedRange.push(intersect);
16056
+ }
16053
16057
  if (intersectedRange.length > 0) intersectedRanges.push(...intersectedRange);
16054
16058
  }
16055
16059
  if (intersectedRanges.length > 0) matchedEffectedRanges.push(intersectedRanges.map((range) => ({
package/lib/es/index.js CHANGED
@@ -1898,7 +1898,7 @@ let UpdateDefinedNameController = class UpdateDefinedNameController extends Disp
1898
1898
  redos: [],
1899
1899
  undos: []
1900
1900
  };
1901
- const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
1901
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
1902
1902
  if (workbook == null) return {
1903
1903
  redos: [],
1904
1904
  undos: []
@@ -2120,7 +2120,7 @@ let UpdateFormulaController = class UpdateFormulaController extends Disposable {
2120
2120
  };
2121
2121
  }
2122
2122
  _getUpdateFormula(command) {
2123
- const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
2123
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
2124
2124
  if (!workbook) return {
2125
2125
  undos: [],
2126
2126
  redos: []
@@ -2309,7 +2309,7 @@ UpdateFormulaController = __decorate([
2309
2309
  //#endregion
2310
2310
  //#region package.json
2311
2311
  var name = "@univerjs/sheets-formula";
2312
- var version = "0.23.0";
2312
+ var version = "0.24.0";
2313
2313
 
2314
2314
  //#endregion
2315
2315
  //#region src/common/plugin-name.ts
@@ -15913,7 +15913,7 @@ let FormulaRefRangeService = class FormulaRefRangeService extends Disposable {
15913
15913
  }
15914
15914
  transformFormulaByEffectCommand(unitId, subUnitId, formula, params) {
15915
15915
  const sequenceNodes = this._lexerTreeBuilder.sequenceNodesBuilder(formula);
15916
- const currentUnit = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
15916
+ const currentUnit = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
15917
15917
  const currentSheet = currentUnit.getActiveSheet();
15918
15918
  const currentUnitId = currentUnit.getUnitId();
15919
15919
  const currentSheetId = currentSheet.getSheetId();
@@ -15947,7 +15947,7 @@ let FormulaRefRangeService = class FormulaRefRangeService extends Disposable {
15947
15947
  const sequenceNodes = this._lexerTreeBuilder.sequenceNodesBuilder(formula);
15948
15948
  const disposableCollection = new DisposableCollection();
15949
15949
  const handleChange = (params) => {
15950
- const currentUnit = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
15950
+ const currentUnit = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
15951
15951
  const currentSheet = currentUnit.getActiveSheet();
15952
15952
  const currentUnitId = currentUnit.getUnitId();
15953
15953
  const currentSheetId = currentSheet.getSheetId();
@@ -16048,7 +16048,11 @@ let FormulaRefRangeService = class FormulaRefRangeService extends Disposable {
16048
16048
  const offsetRow = currentStartRow - originStartRow;
16049
16049
  const offsetColumn = currentStartColumn - originStartColumn;
16050
16050
  for (const range of effectedRanges.ranges) {
16051
- const intersectedRange = ranges.map((r) => getIntersectRange(range, r)).filter(Boolean);
16051
+ const intersectedRange = [];
16052
+ for (const r of ranges) {
16053
+ const intersect = getIntersectRange(range, r);
16054
+ if (intersect) intersectedRange.push(intersect);
16055
+ }
16052
16056
  if (intersectedRange.length > 0) intersectedRanges.push(...intersectedRange);
16053
16057
  }
16054
16058
  if (intersectedRanges.length > 0) matchedEffectedRanges.push(intersectedRanges.map((range) => ({
package/lib/index.js CHANGED
@@ -1898,7 +1898,7 @@ let UpdateDefinedNameController = class UpdateDefinedNameController extends Disp
1898
1898
  redos: [],
1899
1899
  undos: []
1900
1900
  };
1901
- const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
1901
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
1902
1902
  if (workbook == null) return {
1903
1903
  redos: [],
1904
1904
  undos: []
@@ -2120,7 +2120,7 @@ let UpdateFormulaController = class UpdateFormulaController extends Disposable {
2120
2120
  };
2121
2121
  }
2122
2122
  _getUpdateFormula(command) {
2123
- const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
2123
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
2124
2124
  if (!workbook) return {
2125
2125
  undos: [],
2126
2126
  redos: []
@@ -2309,7 +2309,7 @@ UpdateFormulaController = __decorate([
2309
2309
  //#endregion
2310
2310
  //#region package.json
2311
2311
  var name = "@univerjs/sheets-formula";
2312
- var version = "0.23.0";
2312
+ var version = "0.24.0";
2313
2313
 
2314
2314
  //#endregion
2315
2315
  //#region src/common/plugin-name.ts
@@ -15913,7 +15913,7 @@ let FormulaRefRangeService = class FormulaRefRangeService extends Disposable {
15913
15913
  }
15914
15914
  transformFormulaByEffectCommand(unitId, subUnitId, formula, params) {
15915
15915
  const sequenceNodes = this._lexerTreeBuilder.sequenceNodesBuilder(formula);
15916
- const currentUnit = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
15916
+ const currentUnit = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
15917
15917
  const currentSheet = currentUnit.getActiveSheet();
15918
15918
  const currentUnitId = currentUnit.getUnitId();
15919
15919
  const currentSheetId = currentSheet.getSheetId();
@@ -15947,7 +15947,7 @@ let FormulaRefRangeService = class FormulaRefRangeService extends Disposable {
15947
15947
  const sequenceNodes = this._lexerTreeBuilder.sequenceNodesBuilder(formula);
15948
15948
  const disposableCollection = new DisposableCollection();
15949
15949
  const handleChange = (params) => {
15950
- const currentUnit = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
15950
+ const currentUnit = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
15951
15951
  const currentSheet = currentUnit.getActiveSheet();
15952
15952
  const currentUnitId = currentUnit.getUnitId();
15953
15953
  const currentSheetId = currentSheet.getSheetId();
@@ -16048,7 +16048,11 @@ let FormulaRefRangeService = class FormulaRefRangeService extends Disposable {
16048
16048
  const offsetRow = currentStartRow - originStartRow;
16049
16049
  const offsetColumn = currentStartColumn - originStartColumn;
16050
16050
  for (const range of effectedRanges.ranges) {
16051
- const intersectedRange = ranges.map((r) => getIntersectRange(range, r)).filter(Boolean);
16051
+ const intersectedRange = [];
16052
+ for (const r of ranges) {
16053
+ const intersect = getIntersectRange(range, r);
16054
+ if (intersect) intersectedRange.push(intersect);
16055
+ }
16052
16056
  if (intersectedRange.length > 0) intersectedRanges.push(...intersectedRange);
16053
16057
  }
16054
16058
  if (intersectedRanges.length > 0) matchedEffectedRanges.push(intersectedRanges.map((range) => ({