@univerjs/sheets-formula 0.3.0 → 0.4.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 (155) hide show
  1. package/lib/cjs/index.js +1 -11
  2. package/lib/es/index.js +2698 -5285
  3. package/lib/types/common/plugin-name.d.ts +1 -1
  4. package/lib/types/controllers/active-dirty.controller.d.ts +2 -3
  5. package/lib/types/controllers/{array-formula-display.controller.d.ts → array-formula-cell-interceptor.controller.d.ts} +3 -4
  6. package/lib/types/controllers/config.schema.d.ts +1 -7
  7. package/lib/types/controllers/formula.controller.d.ts +5 -0
  8. package/lib/types/controllers/trigger-calculation.controller.d.ts +13 -8
  9. package/lib/types/controllers/update-defined-name.controller.d.ts +14 -0
  10. package/lib/types/controllers/update-formula.controller.d.ts +11 -52
  11. package/lib/types/controllers/utils/ref-range-formula.d.ts +8 -2
  12. package/lib/types/controllers/utils/ref-range-move.d.ts +22 -0
  13. package/lib/types/controllers/utils/ref-range-param.d.ts +3 -0
  14. package/lib/types/index.d.ts +9 -16
  15. package/lib/types/services/description.service.d.ts +1 -1
  16. package/lib/types/sheets-formula.plugin.d.ts +22 -0
  17. package/lib/umd/index.js +1 -11
  18. package/package.json +20 -35
  19. package/lib/index.css +0 -1
  20. package/lib/locale/en-US.json +0 -10987
  21. package/lib/locale/ru-RU.json +0 -10938
  22. package/lib/locale/vi-VN.json +0 -9511
  23. package/lib/locale/zh-CN.json +0 -10987
  24. package/lib/locale/zh-TW.json +0 -10987
  25. package/lib/types/commands/commands/formula-clipboard.command.d.ts +0 -2
  26. package/lib/types/commands/operations/__tests__/create-command-test-bed.d.ts +0 -13
  27. package/lib/types/commands/operations/editor-formula.operation.d.ts +0 -11
  28. package/lib/types/commands/operations/help-function.operation.d.ts +0 -2
  29. package/lib/types/commands/operations/insert-function.operation.d.ts +0 -19
  30. package/lib/types/commands/operations/more-functions.operation.d.ts +0 -2
  31. package/lib/types/commands/operations/reference-absolute.operation.d.ts +0 -2
  32. package/lib/types/commands/operations/search-function.operation.d.ts +0 -2
  33. package/lib/types/controllers/__tests__/create-command-test-bed.d.ts +0 -7
  34. package/lib/types/controllers/__tests__/formula-auto-fill.controller.spec.d.ts +0 -16
  35. package/lib/types/controllers/__tests__/formula-clipboard.controller.spec.d.ts +0 -16
  36. package/lib/types/controllers/__tests__/update-formula.controller.spec.d.ts +0 -16
  37. package/lib/types/controllers/formula-alert-render.controller.d.ts +0 -15
  38. package/lib/types/controllers/formula-auto-fill.controller.d.ts +0 -11
  39. package/lib/types/controllers/formula-clipboard.controller.d.ts +0 -25
  40. package/lib/types/controllers/formula-editor-show.controller.d.ts +0 -28
  41. package/lib/types/controllers/formula-render.controller.d.ts +0 -7
  42. package/lib/types/controllers/formula-ui.controller.d.ts +0 -19
  43. package/lib/types/controllers/menu.d.ts +0 -5
  44. package/lib/types/controllers/menu.schema.d.ts +0 -2
  45. package/lib/types/controllers/prompt.controller.d.ts +0 -170
  46. package/lib/types/controllers/shortcuts/prompt.shortcut.d.ts +0 -9
  47. package/lib/types/formula-ui-plugin.d.ts +0 -36
  48. package/lib/types/locale/en-US.d.ts +0 -9983
  49. package/lib/types/locale/function-list/array/en-US.d.ts +0 -17
  50. package/lib/types/locale/function-list/array/ja-JP.d.ts +0 -17
  51. package/lib/types/locale/function-list/array/ru-RU.d.ts +0 -2
  52. package/lib/types/locale/function-list/array/vi-VN.d.ts +0 -17
  53. package/lib/types/locale/function-list/array/zh-CN.d.ts +0 -17
  54. package/lib/types/locale/function-list/array/zh-TW.d.ts +0 -17
  55. package/lib/types/locale/function-list/compatibility/en-US.d.ts +0 -762
  56. package/lib/types/locale/function-list/compatibility/ja-JP.d.ts +0 -762
  57. package/lib/types/locale/function-list/compatibility/ru-RU.d.ts +0 -2
  58. package/lib/types/locale/function-list/compatibility/vi-VN.d.ts +0 -762
  59. package/lib/types/locale/function-list/compatibility/zh-CN.d.ts +0 -762
  60. package/lib/types/locale/function-list/compatibility/zh-TW.d.ts +0 -762
  61. package/lib/types/locale/function-list/cube/en-US.d.ts +0 -144
  62. package/lib/types/locale/function-list/cube/ja-JP.d.ts +0 -144
  63. package/lib/types/locale/function-list/cube/ru-RU.d.ts +0 -144
  64. package/lib/types/locale/function-list/cube/vi-VN.d.ts +0 -144
  65. package/lib/types/locale/function-list/cube/zh-CN.d.ts +0 -144
  66. package/lib/types/locale/function-list/cube/zh-TW.d.ts +0 -144
  67. package/lib/types/locale/function-list/database/en-US.d.ts +0 -234
  68. package/lib/types/locale/function-list/database/ja-JP.d.ts +0 -234
  69. package/lib/types/locale/function-list/database/ru-RU.d.ts +0 -234
  70. package/lib/types/locale/function-list/database/vi-VN.d.ts +0 -234
  71. package/lib/types/locale/function-list/database/zh-CN.d.ts +0 -234
  72. package/lib/types/locale/function-list/database/zh-TW.d.ts +0 -234
  73. package/lib/types/locale/function-list/date/en-US.d.ts +0 -458
  74. package/lib/types/locale/function-list/date/ja-JP.d.ts +0 -458
  75. package/lib/types/locale/function-list/date/ru-RU.d.ts +0 -2
  76. package/lib/types/locale/function-list/date/vi-VN.d.ts +0 -458
  77. package/lib/types/locale/function-list/date/zh-CN.d.ts +0 -458
  78. package/lib/types/locale/function-list/date/zh-TW.d.ts +0 -458
  79. package/lib/types/locale/function-list/engineering/en-US.d.ts +0 -894
  80. package/lib/types/locale/function-list/engineering/ja-JP.d.ts +0 -894
  81. package/lib/types/locale/function-list/engineering/ru-RU.d.ts +0 -2
  82. package/lib/types/locale/function-list/engineering/vi-VN.d.ts +0 -894
  83. package/lib/types/locale/function-list/engineering/zh-CN.d.ts +0 -894
  84. package/lib/types/locale/function-list/engineering/zh-TW.d.ts +0 -894
  85. package/lib/types/locale/function-list/financial/en-US.d.ts +0 -1608
  86. package/lib/types/locale/function-list/financial/ja-JP.d.ts +0 -1608
  87. package/lib/types/locale/function-list/financial/ru-RU.d.ts +0 -2
  88. package/lib/types/locale/function-list/financial/vi-VN.d.ts +0 -1608
  89. package/lib/types/locale/function-list/financial/zh-CN.d.ts +0 -1608
  90. package/lib/types/locale/function-list/financial/zh-TW.d.ts +0 -1608
  91. package/lib/types/locale/function-list/information/en-US.d.ts +0 -327
  92. package/lib/types/locale/function-list/information/ja-JP.d.ts +0 -327
  93. package/lib/types/locale/function-list/information/ru-RU.d.ts +0 -2
  94. package/lib/types/locale/function-list/information/vi-VN.d.ts +0 -255
  95. package/lib/types/locale/function-list/information/zh-CN.d.ts +0 -327
  96. package/lib/types/locale/function-list/information/zh-TW.d.ts +0 -327
  97. package/lib/types/locale/function-list/logical/en-US.d.ts +0 -390
  98. package/lib/types/locale/function-list/logical/ja-JP.d.ts +0 -390
  99. package/lib/types/locale/function-list/logical/ru-RU.d.ts +0 -2
  100. package/lib/types/locale/function-list/logical/vi-VN.d.ts +0 -390
  101. package/lib/types/locale/function-list/logical/zh-CN.d.ts +0 -390
  102. package/lib/types/locale/function-list/logical/zh-TW.d.ts +0 -390
  103. package/lib/types/locale/function-list/lookup/en-US.d.ts +0 -812
  104. package/lib/types/locale/function-list/lookup/ja-JP.d.ts +0 -812
  105. package/lib/types/locale/function-list/lookup/ru-RU.d.ts +0 -2
  106. package/lib/types/locale/function-list/lookup/vi-VN.d.ts +0 -722
  107. package/lib/types/locale/function-list/lookup/zh-CN.d.ts +0 -812
  108. package/lib/types/locale/function-list/lookup/zh-TW.d.ts +0 -812
  109. package/lib/types/locale/function-list/math/en-US.d.ts +0 -1388
  110. package/lib/types/locale/function-list/math/ja-JP.d.ts +0 -1388
  111. package/lib/types/locale/function-list/math/ru-RU.d.ts +0 -2
  112. package/lib/types/locale/function-list/math/vi-VN.d.ts +0 -1298
  113. package/lib/types/locale/function-list/math/zh-CN.d.ts +0 -1388
  114. package/lib/types/locale/function-list/math/zh-TW.d.ts +0 -1388
  115. package/lib/types/locale/function-list/statistical/en-US.d.ts +0 -2160
  116. package/lib/types/locale/function-list/statistical/ja-JP.d.ts +0 -2160
  117. package/lib/types/locale/function-list/statistical/ru-RU.d.ts +0 -2
  118. package/lib/types/locale/function-list/statistical/vi-VN.d.ts +0 -1188
  119. package/lib/types/locale/function-list/statistical/zh-CN.d.ts +0 -2160
  120. package/lib/types/locale/function-list/statistical/zh-TW.d.ts +0 -2160
  121. package/lib/types/locale/function-list/text/en-US.d.ts +0 -904
  122. package/lib/types/locale/function-list/text/ja-JP.d.ts +0 -905
  123. package/lib/types/locale/function-list/text/ru-RU.d.ts +0 -856
  124. package/lib/types/locale/function-list/text/vi-VN.d.ts +0 -784
  125. package/lib/types/locale/function-list/text/zh-CN.d.ts +0 -904
  126. package/lib/types/locale/function-list/text/zh-TW.d.ts +0 -904
  127. package/lib/types/locale/function-list/univer/en-US.d.ts +0 -17
  128. package/lib/types/locale/function-list/univer/ja-JP.d.ts +0 -17
  129. package/lib/types/locale/function-list/univer/ru-RU.d.ts +0 -17
  130. package/lib/types/locale/function-list/univer/vi-VN.d.ts +0 -17
  131. package/lib/types/locale/function-list/univer/zh-CN.d.ts +0 -17
  132. package/lib/types/locale/function-list/univer/zh-TW.d.ts +0 -17
  133. package/lib/types/locale/function-list/web/en-US.d.ts +0 -72
  134. package/lib/types/locale/function-list/web/ja-JP.d.ts +0 -72
  135. package/lib/types/locale/function-list/web/ru-RU.d.ts +0 -72
  136. package/lib/types/locale/function-list/web/vi-VN.d.ts +0 -2
  137. package/lib/types/locale/function-list/web/zh-CN.d.ts +0 -72
  138. package/lib/types/locale/function-list/web/zh-TW.d.ts +0 -72
  139. package/lib/types/locale/ru-RU.d.ts +0 -9934
  140. package/lib/types/locale/vi-VN.d.ts +0 -8657
  141. package/lib/types/locale/zh-CN.d.ts +0 -9983
  142. package/lib/types/locale/zh-TW.d.ts +0 -9983
  143. package/lib/types/services/prompt.service.d.ts +0 -160
  144. package/lib/types/services/render-services/ref-selections.render-service.d.ts +0 -42
  145. package/lib/types/views/FormulaPromptContainer.d.ts +0 -2
  146. package/lib/types/views/more-functions/MoreFunctions.d.ts +0 -2
  147. package/lib/types/views/more-functions/function-help/FunctionHelp.d.ts +0 -22
  148. package/lib/types/views/more-functions/function-params/FunctionParams.d.ts +0 -8
  149. package/lib/types/views/more-functions/input-params/InputParams.d.ts +0 -7
  150. package/lib/types/views/more-functions/interface.d.ts +0 -16
  151. package/lib/types/views/more-functions/select-function/SelectFunction.d.ts +0 -6
  152. package/lib/types/views/prompt/help-function/HelpFunction.d.ts +0 -2
  153. package/lib/types/views/prompt/resize-scroll-observer.d.ts +0 -18
  154. package/lib/types/views/prompt/search-function/SearchFunction.d.ts +0 -2
  155. /package/lib/types/{commands/operations/__tests__/insert-function.operation.spec.d.ts → controllers/utils/__tests__/ref-range-move.spec.d.ts} +0 -0
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const FORMULA_UI_PLUGIN_NAME = "SHEET_FORMULA_UI_PLUGIN";
16
+ export declare const SHEETS_FORMULA_PLUGIN_NAME = "SHEETS_FORMULA_PLUGIN";
@@ -1,11 +1,10 @@
1
1
  import { Disposable, IUniverInstanceService } from '@univerjs/core';
2
- import { FormulaDataModel, IActiveDirtyManagerService, IDefinedNamesService } from '@univerjs/engine-formula';
2
+ import { FormulaDataModel, IActiveDirtyManagerService } from '@univerjs/engine-formula';
3
3
  export declare class ActiveDirtyController extends Disposable {
4
4
  private readonly _activeDirtyManagerService;
5
5
  private readonly _univerInstanceService;
6
6
  private readonly _formulaDataModel;
7
- private readonly _definedNamesService;
8
- constructor(_activeDirtyManagerService: IActiveDirtyManagerService, _univerInstanceService: IUniverInstanceService, _formulaDataModel: FormulaDataModel, _definedNamesService: IDefinedNamesService);
7
+ constructor(_activeDirtyManagerService: IActiveDirtyManagerService, _univerInstanceService: IUniverInstanceService, _formulaDataModel: FormulaDataModel);
9
8
  private _initialize;
10
9
  private _initialConversion;
11
10
  private _initialMove;
@@ -1,12 +1,11 @@
1
- import { Disposable, ICommandService, ThemeService } from '@univerjs/core';
1
+ import { Disposable, ICommandService } from '@univerjs/core';
2
2
  import { FormulaDataModel } from '@univerjs/engine-formula';
3
3
  import { SheetInterceptorService } from '@univerjs/sheets';
4
- export declare class ArrayFormulaDisplayController extends Disposable {
4
+ export declare class ArrayFormulaCellInterceptorController extends Disposable {
5
5
  private readonly _commandService;
6
6
  private _sheetInterceptorService;
7
7
  private readonly _formulaDataModel;
8
- private readonly _themeService;
9
- constructor(_commandService: ICommandService, _sheetInterceptorService: SheetInterceptorService, _formulaDataModel: FormulaDataModel, _themeService: ThemeService);
8
+ constructor(_commandService: ICommandService, _sheetInterceptorService: SheetInterceptorService, _formulaDataModel: FormulaDataModel);
10
9
  private _initialize;
11
10
  private _commandExecutedListener;
12
11
  private _initInterceptorCellContent;
@@ -1,13 +1,11 @@
1
- import { MenuConfig } from '@univerjs/ui';
2
- import { BaseFunction, IFunctionInfo, IFunctionNames } from '@univerjs/engine-formula';
3
1
  import { Ctor } from '@univerjs/core';
2
+ import { BaseFunction, IFunctionInfo, IFunctionNames } from '@univerjs/engine-formula';
4
3
  /**
5
4
  * Base configuration for the plugin.
6
5
  */
7
6
  export declare const PLUGIN_CONFIG_KEY_BASE = "sheets-formula.base.config";
8
7
  export declare const configSymbolBase: unique symbol;
9
8
  export interface IUniverSheetsFormulaBaseConfig {
10
- menu?: MenuConfig;
11
9
  notExecuteFormula?: boolean;
12
10
  description?: IFunctionInfo[];
13
11
  function?: Array<[Ctor<BaseFunction>, IFunctionNames]>;
@@ -26,7 +24,3 @@ export declare const defaultPluginRemoteConfig: IUniverSheetsFormulaRemoteConfig
26
24
  */
27
25
  export declare const PLUGIN_CONFIG_KEY_MOBILE = "sheets-formula.mobile.config";
28
26
  export declare const configSymbolMobile: unique symbol;
29
- export interface IUniverSheetsFormulaMobileConfig {
30
- menu?: MenuConfig;
31
- }
32
- export declare const defaultPluginMobileConfig: IUniverSheetsFormulaMobileConfig;
@@ -0,0 +1,5 @@
1
+ import { Disposable, ICommandService } from '@univerjs/core';
2
+ export declare class FormulaController extends Disposable {
3
+ private readonly _commandService;
4
+ constructor(_commandService: ICommandService);
5
+ }
@@ -1,13 +1,16 @@
1
1
  import { Disposable, ICommandService } from '@univerjs/core';
2
- import { FormulaDataModel, IActiveDirtyManagerService } from '@univerjs/engine-formula';
3
- import { INumfmtService } from '@univerjs/sheets';
4
- import { IProgressService } from '@univerjs/ui';
2
+ import { IActiveDirtyManagerService } from '@univerjs/engine-formula';
3
+ /**
4
+ * This interface is for the progress bar to display the calculation progress.
5
+ */
6
+ export interface ICalculationProgress {
7
+ done: number;
8
+ /** The total number of formulas need to calculate. */
9
+ count: number;
10
+ }
5
11
  export declare class TriggerCalculationController extends Disposable {
6
12
  private readonly _commandService;
7
13
  private readonly _activeDirtyManagerService;
8
- private readonly _numfmtService;
9
- private readonly _formulaDataModel;
10
- private readonly _progressService;
11
14
  private _waitingCommandQueue;
12
15
  private _executingDirtyData;
13
16
  private _setTimeoutKey;
@@ -16,8 +19,10 @@ export declare class TriggerCalculationController extends Disposable {
16
19
  private _arrayFormulaCalculationDoneCount;
17
20
  private _executionInProgressParams;
18
21
  private _restartCalculation;
19
- constructor(_commandService: ICommandService, _activeDirtyManagerService: IActiveDirtyManagerService, _numfmtService: INumfmtService, _formulaDataModel: FormulaDataModel, _progressService: IProgressService);
20
- private _initialize;
22
+ private readonly _progress$;
23
+ readonly progress$: import('rxjs').Observable<ICalculationProgress>;
24
+ constructor(_commandService: ICommandService, _activeDirtyManagerService: IActiveDirtyManagerService);
25
+ dispose(): void;
21
26
  private _commandExecutedListener;
22
27
  private _generateDirty;
23
28
  private _mergeDirty;
@@ -0,0 +1,14 @@
1
+ import { Disposable, IUniverInstanceService } from '@univerjs/core';
2
+ import { IDefinedNamesService, LexerTreeBuilder } from '@univerjs/engine-formula';
3
+ import { SheetInterceptorService } from '@univerjs/sheets';
4
+ export declare class UpdateDefinedNameController extends Disposable {
5
+ private readonly _definedNamesService;
6
+ private readonly _univerInstanceService;
7
+ private _sheetInterceptorService;
8
+ private readonly _lexerTreeBuilder;
9
+ constructor(_definedNamesService: IDefinedNamesService, _univerInstanceService: IUniverInstanceService, _sheetInterceptorService: SheetInterceptorService, _lexerTreeBuilder: LexerTreeBuilder);
10
+ private _initialize;
11
+ private _commandExecutedListener;
12
+ private _getUpdateDefinedNameMutations;
13
+ private _removeSheet;
14
+ }
@@ -1,17 +1,16 @@
1
1
  import { Disposable, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
2
- import { IEditorService } from '@univerjs/docs-ui';
3
- import { FormulaDataModel, LexerTreeBuilder } from '@univerjs/engine-formula';
4
- import { SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
2
+ import { FormulaDataModel, IDefinedNamesService, LexerTreeBuilder } from '@univerjs/engine-formula';
3
+ import { SheetInterceptorService } from '@univerjs/sheets';
5
4
  /**
6
5
  * Update formula process
7
6
  *
8
7
  * 1. Command intercepts, converts the command information to adapt refRange, offsets the formula content, and obtains the formula that requires offset content.
9
8
  *
10
- 2. Use refRange to offset the formula position and return undo/redo data to setRangeValues mutation
11
- - Redo data: Delete the old value at the old position on the match, and add the new value at the new position (the new value first checks whether the old position has offset content, if so, use the new offset content, if not, take the old value)
12
- - Undo data: the old position on the match saves the old value, and the new position delete value. Using undos when undoing will operate the data after the offset position.
13
-
14
- 3. onCommandExecuted, before formula calculation, use the setRangeValues information to delete the old formulaData, ArrayFormula and ArrayFormulaCellData, and send the worker (complementary setRangeValues after collaborative conflicts, normal operation triggers formula update, undo/redo are captured and processed here)
9
+ * 2. Use refRange to offset the formula position and return undo/redo data to setRangeValues mutation
10
+ * - Redo data: Delete the old value at the old position on the match, and add the new value at the new position (the new value first checks whether the old position has offset content, if so, use the new offset content, if not, take the old value)
11
+ * - Undo data: the old position on the match saves the old value, and the new position delete value. Using undos when undoing will operate the data after the offset position.
12
+ *
13
+ * 3. onCommandExecuted, before formula calculation, use the setRangeValues information to delete the old formulaData, ArrayFormula and ArrayFormulaCellData, and send the worker (complementary setRangeValues after collaborative conflicts, normal operation triggers formula update, undo/redo are captured and processed here)
15
14
  */
16
15
  export declare class UpdateFormulaController extends Disposable {
17
16
  private readonly _univerInstanceService;
@@ -19,54 +18,14 @@ export declare class UpdateFormulaController extends Disposable {
19
18
  private readonly _lexerTreeBuilder;
20
19
  private readonly _formulaDataModel;
21
20
  private _sheetInterceptorService;
22
- private _selectionManagerService;
23
- private readonly _editorService;
21
+ private readonly _definedNamesService;
24
22
  readonly _injector: Injector;
25
- constructor(_univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _lexerTreeBuilder: LexerTreeBuilder, _formulaDataModel: FormulaDataModel, _sheetInterceptorService: SheetInterceptorService, _selectionManagerService: SheetsSelectionsService, _editorService: IEditorService, _injector: Injector);
26
- private _initialize;
23
+ constructor(_univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _lexerTreeBuilder: LexerTreeBuilder, _formulaDataModel: FormulaDataModel, _sheetInterceptorService: SheetInterceptorService, _definedNamesService: IDefinedNamesService, _injector: Injector);
27
24
  private _commandExecutedListener;
28
25
  private _handleSetRangeValuesMutation;
29
- private _handleRemoveSheetMutation;
26
+ private _handleWorkbookDisposed;
30
27
  private _handleInsertSheetMutation;
31
- private _handleUnitAdded;
28
+ private _handleWorkbookAdded;
32
29
  private _getUpdateFormula;
33
- private _handleMoveRange;
34
- private _handleMoveRows;
35
- private _handleMoveCols;
36
- private _handleInsertRow;
37
- private _handleInsertCol;
38
- private _handleInsertRangeMoveRight;
39
- private _handleInsertRangeMoveDown;
40
- private _handleRemoveRow;
41
- private _handleRemoveCol;
42
- private _handleDeleteRangeMoveUp;
43
- private _handleDeleteRangeMoveLeft;
44
- private _handleSetWorksheetName;
45
- private _handleRemoveWorksheet;
46
30
  private _getFormulaReferenceMoveInfo;
47
- private _getNewRangeByMoveParam;
48
- private _checkIsSameUnitAndSheet;
49
- /**
50
- * Update all ref nodes to the latest offset state.
51
- */
52
- private _updateRefOffset;
53
- /**
54
- * Determine the range of the moving selection,
55
- * and check if it is at the edge of the reference range of the formula.
56
- * @param originRange
57
- * @param fromRange
58
- */
59
- private _checkMoveEdge;
60
- /**
61
- * Calculate the new ref information for the moving selection.
62
- * @param moveEdge the 'from' range lie on the edge of the original range, or does it completely cover the original range
63
- * @param result The original range is divided by 'from' and moved to a new position range.
64
- * @param from The initial range of the moving selection.
65
- * @param to The result range after moving the initial range.
66
- * @param origin The original target range.
67
- * @param remain "The range subtracted from the initial range by 'from'.
68
- * @returns
69
- */
70
- private _getMoveNewRange;
71
- private _getCurrentSheetInfo;
72
31
  }
@@ -1,5 +1,5 @@
1
1
  import { ICellData, IMutationInfo, IObjectMatrixPrimitiveType, IRange, Nullable } from '@univerjs/core';
2
- import { IFormulaData, IFormulaDataItem } from '@univerjs/engine-formula';
2
+ import { IFormulaData, IFormulaDataItem, ISequenceNode } from '@univerjs/engine-formula';
3
3
  export declare enum FormulaReferenceMoveType {
4
4
  MoveRange = 0,// range
5
5
  MoveRows = 1,// move rows
@@ -13,7 +13,9 @@ export declare enum FormulaReferenceMoveType {
13
13
  InsertMoveDown = 9,// range
14
14
  InsertMoveRight = 10,// range
15
15
  SetName = 11,
16
- RemoveSheet = 12
16
+ RemoveSheet = 12,
17
+ SetDefinedName = 13,// update defined name
18
+ RemoveDefinedName = 14
17
19
  }
18
20
  export interface IFormulaReferenceMoveParam {
19
21
  type: FormulaReferenceMoveType;
@@ -23,6 +25,8 @@ export interface IFormulaReferenceMoveParam {
23
25
  from?: IRange;
24
26
  to?: IRange;
25
27
  sheetName?: string;
28
+ definedNameId?: string;
29
+ definedName?: string;
26
30
  }
27
31
  export declare function getFormulaReferenceMoveUndoRedo(oldFormulaData: IFormulaData, newFormulaData: IFormulaData, formulaReferenceMoveParam: IFormulaReferenceMoveParam): {
28
32
  undos: IMutationInfo<object>[];
@@ -69,3 +73,5 @@ export declare function formulaDataItemToCellData(formulaDataItem: Nullable<IFor
69
73
  */
70
74
  export declare function formulaDataToCellData(formulaData: IObjectMatrixPrimitiveType<IFormulaDataItem | null>): IObjectMatrixPrimitiveType<Nullable<ICellData>>;
71
75
  export declare function isFormulaDataItem(cell: IFormulaDataItem): boolean;
76
+ export declare function checkIsSameUnitAndSheet(userUnitId: string, userSheetId: string, currentFormulaUnitId: string, currentFormulaSheetId: string, sequenceRangeUnitId: string, sequenceRangeSheetId: string): boolean;
77
+ export declare function updateRefOffset(sequenceNodes: Array<string | ISequenceNode>, refChangeIds: number[], refOffsetX?: number, refOffsetY?: number): (string | ISequenceNode)[];
@@ -0,0 +1,22 @@
1
+ import { IRange, IUnitRange, Nullable } from '@univerjs/core';
2
+ import { IFormulaReferenceMoveParam } from './ref-range-formula';
3
+ export interface IUnitRangeWithOffset extends IUnitRange {
4
+ refOffsetX: number;
5
+ refOffsetY: number;
6
+ sheetName: string;
7
+ }
8
+ export declare enum OriginRangeEdgeType {
9
+ UP = 0,
10
+ DOWN = 1,
11
+ LEFT = 2,
12
+ RIGHT = 3,
13
+ ALL = 4
14
+ }
15
+ export declare function getNewRangeByMoveParam(unitRangeWidthOffset: IUnitRangeWithOffset, formulaReferenceMoveParam: IFormulaReferenceMoveParam, currentFormulaUnitId: string, currentFormulaSheetId: string): string | undefined;
16
+ /**
17
+ * Determine the range of the moving selection,
18
+ * and check if it is at the edge of the reference range of the formula.
19
+ * @param originRange
20
+ * @param fromRange
21
+ */
22
+ export declare function checkMoveEdge(originRange: IRange, fromRange: IRange): Nullable<OriginRangeEdgeType>;
@@ -0,0 +1,3 @@
1
+ import { ICommandInfo, Nullable, Workbook } from '@univerjs/core';
2
+ import { IFormulaReferenceMoveParam } from './ref-range-formula';
3
+ export declare function getReferenceMoveParams(workbook: Workbook, command: ICommandInfo): Nullable<IFormulaReferenceMoveParam>;
@@ -13,23 +13,16 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export { UniverRemoteSheetsFormulaPlugin, UniverSheetsFormulaMobilePlugin, UniverSheetsFormulaPlugin } from './formula-ui-plugin';
17
- export { IDescriptionService } from './services/description.service';
18
- export { DescriptionService } from './services/description.service';
16
+ export { type IInsertFunction, type IInsertFunctionCommandParams, InsertFunctionCommand } from './commands/commands/insert-function.command';
17
+ export { OtherFormulaMarkDirty } from './commands/mutations/formula.mutation';
18
+ export { UpdateDefinedNameController } from './controllers/update-defined-name.controller';
19
+ export { UpdateFormulaController } from './controllers/update-formula.controller';
20
+ export { DescriptionService, IDescriptionService, type ISearchItem } from './services/description.service';
21
+ export type { IFormulaInfo, IOtherFormulaResult } from './services/formula-common';
22
+ export { FormulaRefRangeService } from './services/formula-ref-range.service';
19
23
  export type { IRegisterFunctionParams, IUnregisterFunctionParams } from './services/register-function.service';
20
24
  export { RegisterFunctionService } from './services/register-function.service';
21
25
  export { IRegisterFunctionService } from './services/register-function.service';
22
- export { IRemoteRegisterFunctionService, RemoteRegisterFunctionService } from './services/remote/remote-register-function.service';
23
- export { FormulaRefRangeService } from './services/formula-ref-range.service';
24
- export { FORMULA_PROMPT_ACTIVATED } from './services/prompt.service';
25
26
  export { RegisterOtherFormulaService } from './services/register-other-formula.service';
26
- export type { IFormulaInfo, IOtherFormulaResult } from './services/formula-common';
27
- export { SheetOnlyPasteFormulaCommand } from './commands/commands/formula-clipboard.command';
28
- export { InsertFunctionCommand } from './commands/commands/insert-function.command';
29
- export { OtherFormulaMarkDirty } from './commands/mutations/formula.mutation';
30
- export { SelectEditorFormulaOperation } from './commands/operations/editor-formula.operation';
31
- export { HelpFunctionOperation } from './commands/operations/help-function.operation';
32
- export { InsertFunctionOperation } from './commands/operations/insert-function.operation';
33
- export { MoreFunctionsOperation } from './commands/operations/more-functions.operation';
34
- export { ReferenceAbsoluteOperation } from './commands/operations/reference-absolute.operation';
35
- export { SearchFunctionOperation } from './commands/operations/search-function.operation';
27
+ export { IRemoteRegisterFunctionService, RemoteRegisterFunctionService } from './services/remote/remote-register-function.service';
28
+ export { UniverRemoteSheetsFormulaPlugin, UniverSheetsFormulaPlugin } from './sheets-formula.plugin';
@@ -1,4 +1,4 @@
1
- import { IConfigService, LocaleService, IDisposable } from '@univerjs/core';
1
+ import { IDisposable, IConfigService, LocaleService } from '@univerjs/core';
2
2
  import { IFunctionInfo, IFunctionNames, IFunctionService } from '@univerjs/engine-formula';
3
3
  export interface ISearchItem {
4
4
  name: string;
@@ -0,0 +1,22 @@
1
+ import { IUniverSheetsFormulaBaseConfig, IUniverSheetsFormulaRemoteConfig } from './controllers/config.schema';
2
+ import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
3
+ export declare class UniverRemoteSheetsFormulaPlugin extends Plugin {
4
+ private readonly _config;
5
+ readonly _injector: Injector;
6
+ private readonly _configService;
7
+ static pluginName: string;
8
+ static type: UniverInstanceType;
9
+ constructor(_config: Partial<IUniverSheetsFormulaRemoteConfig> | undefined, _injector: Injector, _configService: IConfigService);
10
+ onStarting(): void;
11
+ }
12
+ export declare class UniverSheetsFormulaPlugin extends Plugin {
13
+ private readonly _config;
14
+ readonly _injector: Injector;
15
+ private readonly _configService;
16
+ static pluginName: string;
17
+ static type: UniverInstanceType;
18
+ constructor(_config: Partial<IUniverSheetsFormulaBaseConfig> | undefined, _injector: Injector, _configService: IConfigService);
19
+ onStarting(): void;
20
+ onReady(): void;
21
+ onRendered(): void;
22
+ }