@univerjs/sheets-formula 0.2.7 → 0.2.9

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 (113) hide show
  1. package/lib/cjs/index.js +4 -4
  2. package/lib/es/index.js +974 -409
  3. package/lib/locale/en-US.json +646 -350
  4. package/lib/locale/ru-RU.json +646 -350
  5. package/lib/locale/vi-VN.json +682 -346
  6. package/lib/locale/zh-CN.json +654 -358
  7. package/lib/locale/zh-TW.json +654 -358
  8. package/lib/types/commands/commands/formula-clipboard.command.d.ts +0 -1
  9. package/lib/types/commands/commands/insert-function.command.d.ts +0 -1
  10. package/lib/types/commands/mutations/formula.mutation.d.ts +0 -1
  11. package/lib/types/commands/operations/__tests__/create-command-test-bed.d.ts +0 -1
  12. package/lib/types/commands/operations/editor-formula.operation.d.ts +0 -1
  13. package/lib/types/commands/operations/help-function.operation.d.ts +0 -1
  14. package/lib/types/commands/operations/insert-function.operation.d.ts +0 -1
  15. package/lib/types/commands/operations/more-functions.operation.d.ts +0 -1
  16. package/lib/types/commands/operations/reference-absolute.operation.d.ts +0 -1
  17. package/lib/types/commands/operations/search-function.operation.d.ts +0 -1
  18. package/lib/types/common/selection.d.ts +0 -1
  19. package/lib/types/controllers/__tests__/create-command-test-bed.d.ts +0 -1
  20. package/lib/types/controllers/active-dirty.controller.d.ts +0 -1
  21. package/lib/types/controllers/array-formula-display.controller.d.ts +0 -1
  22. package/lib/types/controllers/defined-name.controller.d.ts +0 -1
  23. package/lib/types/controllers/formula-alert-render.controller.d.ts +0 -1
  24. package/lib/types/controllers/formula-auto-fill.controller.d.ts +0 -1
  25. package/lib/types/controllers/formula-clipboard.controller.d.ts +0 -1
  26. package/lib/types/controllers/formula-editor-show.controller.d.ts +7 -4
  27. package/lib/types/controllers/formula-render.controller.d.ts +0 -1
  28. package/lib/types/controllers/formula-ui.controller.d.ts +0 -1
  29. package/lib/types/controllers/menu.d.ts +0 -1
  30. package/lib/types/controllers/prompt.controller.d.ts +10 -2
  31. package/lib/types/controllers/shortcuts/prompt.shortcut.d.ts +0 -1
  32. package/lib/types/controllers/trigger-calculation.controller.d.ts +0 -1
  33. package/lib/types/controllers/update-formula.controller.d.ts +0 -1
  34. package/lib/types/controllers/utils/offset-formula-data.d.ts +0 -1
  35. package/lib/types/controllers/utils/ref-range-formula.d.ts +0 -1
  36. package/lib/types/controllers/utils/utils.d.ts +0 -1
  37. package/lib/types/formula-ui-plugin.d.ts +0 -1
  38. package/lib/types/locale/en-US.d.ts +426 -130
  39. package/lib/types/locale/function-list/array/ru-RU.d.ts +0 -1
  40. package/lib/types/locale/function-list/compatibility/en-US.d.ts +6 -2
  41. package/lib/types/locale/function-list/compatibility/ja-JP.d.ts +6 -2
  42. package/lib/types/locale/function-list/compatibility/ru-RU.d.ts +0 -1
  43. package/lib/types/locale/function-list/compatibility/vi-VN.d.ts +6 -2
  44. package/lib/types/locale/function-list/compatibility/zh-CN.d.ts +6 -2
  45. package/lib/types/locale/function-list/compatibility/zh-TW.d.ts +6 -2
  46. package/lib/types/locale/function-list/date/ru-RU.d.ts +0 -1
  47. package/lib/types/locale/function-list/engineering/en-US.d.ts +50 -66
  48. package/lib/types/locale/function-list/engineering/ja-JP.d.ts +50 -66
  49. package/lib/types/locale/function-list/engineering/ru-RU.d.ts +0 -1
  50. package/lib/types/locale/function-list/engineering/vi-VN.d.ts +50 -66
  51. package/lib/types/locale/function-list/engineering/zh-CN.d.ts +50 -66
  52. package/lib/types/locale/function-list/engineering/zh-TW.d.ts +50 -66
  53. package/lib/types/locale/function-list/financial/en-US.d.ts +344 -56
  54. package/lib/types/locale/function-list/financial/ja-JP.d.ts +344 -56
  55. package/lib/types/locale/function-list/financial/ru-RU.d.ts +0 -1
  56. package/lib/types/locale/function-list/financial/vi-VN.d.ts +344 -56
  57. package/lib/types/locale/function-list/financial/zh-CN.d.ts +344 -56
  58. package/lib/types/locale/function-list/financial/zh-TW.d.ts +344 -56
  59. package/lib/types/locale/function-list/information/ru-RU.d.ts +0 -1
  60. package/lib/types/locale/function-list/logical/en-US.d.ts +14 -2
  61. package/lib/types/locale/function-list/logical/ja-JP.d.ts +14 -2
  62. package/lib/types/locale/function-list/logical/ru-RU.d.ts +0 -1
  63. package/lib/types/locale/function-list/logical/vi-VN.d.ts +14 -2
  64. package/lib/types/locale/function-list/logical/zh-CN.d.ts +14 -2
  65. package/lib/types/locale/function-list/logical/zh-TW.d.ts +14 -2
  66. package/lib/types/locale/function-list/lookup/ru-RU.d.ts +0 -1
  67. package/lib/types/locale/function-list/math/ru-RU.d.ts +0 -1
  68. package/lib/types/locale/function-list/statistical/en-US.d.ts +12 -4
  69. package/lib/types/locale/function-list/statistical/ja-JP.d.ts +12 -4
  70. package/lib/types/locale/function-list/statistical/ru-RU.d.ts +0 -1
  71. package/lib/types/locale/function-list/statistical/vi-VN.d.ts +44 -0
  72. package/lib/types/locale/function-list/statistical/zh-CN.d.ts +12 -4
  73. package/lib/types/locale/function-list/statistical/zh-TW.d.ts +12 -4
  74. package/lib/types/locale/function-list/web/vi-VN.d.ts +0 -1
  75. package/lib/types/locale/ru-RU.d.ts +426 -130
  76. package/lib/types/locale/vi-VN.d.ts +458 -126
  77. package/lib/types/locale/zh-CN.d.ts +426 -130
  78. package/lib/types/locale/zh-TW.d.ts +426 -130
  79. package/lib/types/services/description.service.d.ts +0 -1
  80. package/lib/types/services/formula-common.d.ts +0 -1
  81. package/lib/types/services/formula-ref-range.service.d.ts +0 -1
  82. package/lib/types/services/function-list/array.d.ts +0 -1
  83. package/lib/types/services/function-list/compatibility.d.ts +0 -1
  84. package/lib/types/services/function-list/cube.d.ts +0 -1
  85. package/lib/types/services/function-list/database.d.ts +0 -1
  86. package/lib/types/services/function-list/date.d.ts +0 -1
  87. package/lib/types/services/function-list/engineering.d.ts +0 -1
  88. package/lib/types/services/function-list/financial.d.ts +0 -1
  89. package/lib/types/services/function-list/function-list.d.ts +0 -1
  90. package/lib/types/services/function-list/information.d.ts +0 -1
  91. package/lib/types/services/function-list/logical.d.ts +0 -1
  92. package/lib/types/services/function-list/lookup.d.ts +0 -1
  93. package/lib/types/services/function-list/math.d.ts +0 -1
  94. package/lib/types/services/function-list/statistical.d.ts +0 -1
  95. package/lib/types/services/function-list/text.d.ts +0 -1
  96. package/lib/types/services/function-list/univer.d.ts +0 -1
  97. package/lib/types/services/function-list/web.d.ts +0 -1
  98. package/lib/types/services/prompt.service.d.ts +0 -1
  99. package/lib/types/services/register-function.service.d.ts +0 -1
  100. package/lib/types/services/register-other-formula.service.d.ts +0 -1
  101. package/lib/types/services/remote/remote-register-function.service.d.ts +0 -1
  102. package/lib/types/services/render-services/ref-selections.render-service.d.ts +8 -4
  103. package/lib/types/services/utils.d.ts +0 -1
  104. package/lib/types/views/FormulaPromptContainer.d.ts +0 -1
  105. package/lib/types/views/more-functions/MoreFunctions.d.ts +0 -1
  106. package/lib/types/views/more-functions/function-help/FunctionHelp.d.ts +0 -1
  107. package/lib/types/views/more-functions/function-params/FunctionParams.d.ts +0 -1
  108. package/lib/types/views/more-functions/input-params/InputParams.d.ts +0 -1
  109. package/lib/types/views/more-functions/select-function/SelectFunction.d.ts +0 -1
  110. package/lib/types/views/prompt/help-function/HelpFunction.d.ts +0 -1
  111. package/lib/types/views/prompt/search-function/SearchFunction.d.ts +0 -1
  112. package/lib/umd/index.js +4 -4
  113. package/package.json +23 -23
@@ -1,3 +1,2 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  export declare const SheetOnlyPasteFormulaCommand: ICommand;
@@ -1,5 +1,4 @@
1
1
  import { ICommand, IRange } from '@univerjs/core';
2
-
3
2
  export interface IInsertFunction {
4
3
  /**
5
4
  * The range into which the function is to be inserted
@@ -1,5 +1,4 @@
1
1
  import { IMutation } from '@univerjs/core';
2
-
3
2
  export interface IOtherFormulaMarkDirtyParams {
4
3
  [unitId: string]: {
5
4
  [sunUnitId: string]: {
@@ -1,5 +1,4 @@
1
1
  import { Dependency, IWorkbookData, Univer } from '@univerjs/core';
2
-
3
2
  export declare function createCommandTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
4
3
  univer: Univer;
5
4
  get: {
@@ -2,7 +2,6 @@ import { IOperation } from '@univerjs/core';
2
2
  import { DeviceInputEventType } from '@univerjs/engine-render';
3
3
  import { KeyCode, MetaKeys } from '@univerjs/ui';
4
4
  import { META_KEY_CTRL_AND_SHIFT } from '../../common/prompt';
5
-
6
5
  export interface ISelectEditorFormulaOperationParam {
7
6
  eventType: DeviceInputEventType;
8
7
  keycode?: KeyCode;
@@ -1,3 +1,2 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  export declare const HelpFunctionOperation: ICommand;
@@ -1,5 +1,4 @@
1
1
  import { ICellData, ICommand, IRange, Nullable } from '@univerjs/core';
2
-
3
2
  export interface IInsertFunctionOperationParams {
4
3
  /**
5
4
  * function name
@@ -1,3 +1,2 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  export declare const MoreFunctionsOperation: ICommand;
@@ -1,3 +1,2 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  export declare const ReferenceAbsoluteOperation: ICommand;
@@ -1,3 +1,2 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  export declare const SearchFunctionOperation: ICommand;
@@ -1,5 +1,4 @@
1
1
  import { ThemeService } from '@univerjs/core';
2
2
  import { ISelectionStyle } from '@univerjs/sheets';
3
-
4
3
  export declare const FORMULA_REF_SELECTION_PLUGIN_NAME = "formula_reference_selection_plugin_name";
5
4
  export declare function getFormulaRefSelectionStyle(themeService: ThemeService, refColor: string, id: string): ISelectionStyle;
@@ -1,5 +1,4 @@
1
1
  import { Dependency, IWorkbookData, Workbook, Injector, Univer } from '@univerjs/core';
2
-
3
2
  export interface ITestBed {
4
3
  univer: Univer;
5
4
  get: Injector['get'];
@@ -1,6 +1,5 @@
1
1
  import { Disposable, IUniverInstanceService } from '@univerjs/core';
2
2
  import { FormulaDataModel, IActiveDirtyManagerService, IDefinedNamesService } from '@univerjs/engine-formula';
3
-
4
3
  export declare class ActiveDirtyController extends Disposable {
5
4
  private readonly _activeDirtyManagerService;
6
5
  private readonly _univerInstanceService;
@@ -1,7 +1,6 @@
1
1
  import { Disposable, ICommandService, ThemeService } from '@univerjs/core';
2
2
  import { FormulaDataModel } from '@univerjs/engine-formula';
3
3
  import { SheetInterceptorService } from '@univerjs/sheets';
4
-
5
4
  export declare class ArrayFormulaDisplayController extends Disposable {
6
5
  private readonly _commandService;
7
6
  private _sheetInterceptorService;
@@ -1,7 +1,6 @@
1
1
  import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
2
  import { IDefinedNamesService } from '@univerjs/engine-formula';
3
3
  import { IDescriptionService } from '../services/description.service';
4
-
5
4
  export declare const SCOPE_WORKBOOK_VALUE = "AllDefaultWorkbook";
6
5
  /**
7
6
  * header highlight
@@ -1,7 +1,6 @@
1
1
  import { Workbook, Disposable, LocaleService } from '@univerjs/core';
2
2
  import { CellAlertManagerService, HoverManagerService } from '@univerjs/sheets-ui';
3
3
  import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
4
-
5
4
  export declare class FormulaAlertRenderController extends Disposable implements IRenderModule {
6
5
  private readonly _context;
7
6
  private readonly _hoverManagerService;
@@ -1,7 +1,6 @@
1
1
  import { Disposable } from '@univerjs/core';
2
2
  import { LexerTreeBuilder } from '@univerjs/engine-formula';
3
3
  import { AutoFillService } from '@univerjs/sheets-ui';
4
-
5
4
  export declare class FormulaAutoFillController extends Disposable {
6
5
  private readonly _autoFillService;
7
6
  private readonly _lexerTreeBuilder;
@@ -1,7 +1,6 @@
1
1
  import { IAccessor, IMutationInfo, Disposable, Injector, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
2
2
  import { FormulaDataModel, LexerTreeBuilder } from '@univerjs/engine-formula';
3
3
  import { COPY_TYPE, ISheetClipboardService, ICellDataWithSpanInfo, IDiscreteRange, ISheetDiscreteRangeLocation } from '@univerjs/sheets-ui';
4
-
5
4
  export declare const DEFAULT_PASTE_FORMULA = "default-paste-formula";
6
5
  export declare class FormulaClipboardController extends Disposable {
7
6
  private readonly _currentUniverSheet;
@@ -1,8 +1,7 @@
1
- import { Workbook, Disposable, ICommandService, ThemeService } from '@univerjs/core';
1
+ import { Workbook, Disposable, ICommandService, ILogService, ThemeService } from '@univerjs/core';
2
2
  import { FormulaDataModel } from '@univerjs/engine-formula';
3
- import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/engine-render';
3
+ import { IRenderContext, IRenderModule, SpreadsheetSkeleton, IRenderManagerService } from '@univerjs/engine-render';
4
4
  import { IEditorBridgeService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
5
-
6
5
  export declare class FormulaEditorShowController extends Disposable implements IRenderModule {
7
6
  private readonly _context;
8
7
  private _editorBridgeService;
@@ -11,8 +10,12 @@ export declare class FormulaEditorShowController extends Disposable implements I
11
10
  private readonly _renderManagerService;
12
11
  private readonly _sheetSkeletonManagerService;
13
12
  private readonly _commandService;
13
+ private readonly _logService;
14
14
  private _previousShape;
15
- constructor(_context: IRenderContext<Workbook>, _editorBridgeService: IEditorBridgeService, _formulaDataModel: FormulaDataModel, _themeService: ThemeService, _renderManagerService: IRenderManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _commandService: ICommandService);
15
+ private _skeleton;
16
+ constructor(_context: IRenderContext<Workbook>, _editorBridgeService: IEditorBridgeService, _formulaDataModel: FormulaDataModel, _themeService: ThemeService, _renderManagerService: IRenderManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _commandService: ICommandService, _logService: ILogService);
17
+ private _initSkeletonChangeListener;
18
+ protected _changeRuntime(skeleton: SpreadsheetSkeleton): void;
16
19
  private _initInterceptorEditorStart;
17
20
  private _commandExecutedListener;
18
21
  private _displayArrayFormulaRangeShape;
@@ -1,6 +1,5 @@
1
1
  import { RxDisposable } from '@univerjs/core';
2
2
  import { SheetInterceptorService } from '@univerjs/sheets';
3
-
4
3
  export declare class FormulaRenderManagerController extends RxDisposable {
5
4
  private readonly _sheetInterceptorService;
6
5
  constructor(_sheetInterceptorService: SheetInterceptorService);
@@ -2,7 +2,6 @@ import { Disposable, ICommandService, Injector, Ctor } from '@univerjs/core';
2
2
  import { MenuConfig, ComponentManager, IMenuService, IShortcutService, IUIPartsService } from '@univerjs/ui';
3
3
  import { IRenderManagerService } from '@univerjs/engine-render';
4
4
  import { BaseFunction, IFunctionInfo, IFunctionNames } from '@univerjs/engine-formula';
5
-
6
5
  export interface IUniverSheetsFormulaConfig {
7
6
  menu: MenuConfig;
8
7
  notExecuteFormula?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { IAccessor } from '@univerjs/core';
2
2
  import { IMenuItem } from '@univerjs/ui';
3
-
4
3
  export declare function InsertFunctionMenuItemFactory(accessor: IAccessor): IMenuItem;
5
4
  export declare function MoreFunctionsMenuItemFactory(accessor: IAccessor): IMenuItem;
6
5
  export declare function PasteFormulaMenuItemFactory(accessor: IAccessor): IMenuItem;
@@ -7,7 +7,6 @@ import { EditorBridgeService } from '@univerjs/sheets-ui';
7
7
  import { IContextMenuService, IEditorService } from '@univerjs/ui';
8
8
  import { IDescriptionService } from '../services/description.service';
9
9
  import { IFormulaPromptService } from '../services/prompt.service';
10
-
11
10
  export declare class PromptController extends Disposable {
12
11
  private readonly _commandService;
13
12
  private readonly _contextService;
@@ -40,7 +39,7 @@ export declare class PromptController extends Disposable {
40
39
  private _existsSequenceNode;
41
40
  private get _selectionRenderService();
42
41
  /**
43
- * If there are multiple sheet instances, we should enable or disable all of them.
42
+ * For multiple sheet instances.
44
43
  */
45
44
  private get _allSelectionRenderServices();
46
45
  constructor(_commandService: ICommandService, _contextService: IContextService, _textSelectionRenderManager: ITextSelectionRenderManager, _editorBridgeService: EditorBridgeService, _formulaPromptService: IFormulaPromptService, _lexerTreeBuilder: LexerTreeBuilder, _renderManagerService: IRenderManagerService, _themeService: ThemeService, _sheetsSelectionsService: SheetsSelectionsService, _refSelectionsService: SheetsSelectionsService, _univerInstanceService: IUniverInstanceService, _descriptionService: IDescriptionService, _textSelectionManagerService: TextSelectionManagerService, _contextMenuService: IContextMenuService, _editorService: IEditorService);
@@ -54,6 +53,9 @@ export declare class PromptController extends Disposable {
54
53
  private _initialChangeEditor;
55
54
  private _closeRangePrompt;
56
55
  private _initSelectionsEndListener;
56
+ /**
57
+ * For interaction with mouse & keyboard shortcuts on spreadsheet. Not in formula editor.
58
+ */
57
59
  private _updateSelecting;
58
60
  private _currentlyWorkingRefRenderer;
59
61
  private _selectionsChangeDisposables;
@@ -117,7 +119,9 @@ export declare class PromptController extends Disposable {
117
119
  */
118
120
  private _generateRefString;
119
121
  /**
122
+ * Update Editor formula text in prompt editor by current selection in spreadsheet.
120
123
  * Restore the sequenceNode generated by the lexer to the text in the editor, and set the cursor position.
124
+ *
121
125
  * @param sequenceNodes
122
126
  * @param textSelectionOffset
123
127
  */
@@ -151,6 +155,10 @@ export declare class PromptController extends Disposable {
151
155
  private _commandExecutedListener;
152
156
  private _moveInEditor;
153
157
  private _userMouseListener;
158
+ private _inputFormulaListener;
159
+ /**
160
+ * Absolute range, triggered by F4
161
+ */
154
162
  private _changeRefString;
155
163
  private _changeRangeRef;
156
164
  private _changeSingleRef;
@@ -1,5 +1,4 @@
1
1
  import { IShortcutItem, KeyCode } from '@univerjs/ui';
2
-
3
2
  export declare const PROMPT_SELECTION_KEYCODE_ARROW_LIST: KeyCode[];
4
3
  export declare const PROMPT_SELECTION_KEYCODE_LIST: KeyCode[];
5
4
  export declare function promptSelectionShortcutItem(): IShortcutItem<object>[];
@@ -2,7 +2,6 @@ import { Disposable, ICommandService } from '@univerjs/core';
2
2
  import { FormulaDataModel, IActiveDirtyManagerService } from '@univerjs/engine-formula';
3
3
  import { INumfmtService } from '@univerjs/sheets';
4
4
  import { IProgressService } from '@univerjs/ui';
5
-
6
5
  export declare class TriggerCalculationController extends Disposable {
7
6
  private readonly _commandService;
8
7
  private readonly _activeDirtyManagerService;
@@ -2,7 +2,6 @@ import { Disposable, ICommandService, Injector, IUniverInstanceService } from '@
2
2
  import { FormulaDataModel, LexerTreeBuilder } from '@univerjs/engine-formula';
3
3
  import { SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
4
4
  import { IEditorService } from '@univerjs/ui';
5
-
6
5
  /**
7
6
  * Update formula process
8
7
  *
@@ -1,6 +1,5 @@
1
1
  import { IRange } from '@univerjs/core';
2
2
  import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData } from '@univerjs/engine-formula';
3
-
4
3
  export interface IRefRangeWithPosition {
5
4
  row: number;
6
5
  column: number;
@@ -1,6 +1,5 @@
1
1
  import { ICellData, IMutationInfo, IObjectMatrixPrimitiveType, IRange, Nullable } from '@univerjs/core';
2
2
  import { IFormulaData, IFormulaDataItem } from '@univerjs/engine-formula';
3
-
4
3
  export declare enum FormulaReferenceMoveType {
5
4
  MoveRange = 0,// range
6
5
  MoveRows = 1,// move rows
@@ -1,6 +1,5 @@
1
1
  import { ICellData, IContextService, Nullable } from '@univerjs/core';
2
2
  import { ErrorType } from '@univerjs/engine-formula';
3
-
4
3
  export declare function whenEditorStandalone(contextService: IContextService): boolean;
5
4
  /**
6
5
  * Extract the formula error from the cell
@@ -1,7 +1,6 @@
1
1
  import { Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
2
  import { IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { IUniverSheetsFormulaConfig } from './controllers/formula-ui.controller';
4
-
5
4
  export declare class UniverRemoteSheetsFormulaPlugin extends Plugin {
6
5
  private readonly _config;
7
6
  readonly _injector: Injector;