@univerjs/sheets-formula-ui 0.3.0-nightly.202410101606

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 (156) hide show
  1. package/README.md +39 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/es/index.js +1 -0
  4. package/lib/index.css +1 -0
  5. package/lib/locale/en-US.json +10987 -0
  6. package/lib/locale/ru-RU.json +10938 -0
  7. package/lib/locale/vi-VN.json +9511 -0
  8. package/lib/locale/zh-CN.json +10987 -0
  9. package/lib/locale/zh-TW.json +10987 -0
  10. package/lib/types/commands/commands/formula-clipboard.command.d.ts +2 -0
  11. package/lib/types/commands/operations/__tests__/create-command-test-bed.d.ts +13 -0
  12. package/lib/types/commands/operations/__tests__/insert-function.operation.spec.d.ts +16 -0
  13. package/lib/types/commands/operations/editor-formula.operation.d.ts +11 -0
  14. package/lib/types/commands/operations/help-function.operation.d.ts +2 -0
  15. package/lib/types/commands/operations/insert-function.operation.d.ts +19 -0
  16. package/lib/types/commands/operations/more-functions.operation.d.ts +2 -0
  17. package/lib/types/commands/operations/reference-absolute.operation.d.ts +2 -0
  18. package/lib/types/commands/operations/search-function.operation.d.ts +2 -0
  19. package/lib/types/common/plugin-name.d.ts +16 -0
  20. package/lib/types/common/prompt.d.ts +16 -0
  21. package/lib/types/common/selection.d.ts +4 -0
  22. package/lib/types/controllers/__tests__/create-command-test-bed.d.ts +7 -0
  23. package/lib/types/controllers/__tests__/formula-auto-fill.controller.spec.d.ts +16 -0
  24. package/lib/types/controllers/__tests__/formula-clipboard.controller.spec.d.ts +16 -0
  25. package/lib/types/controllers/__tests__/update-formula.controller.spec.d.ts +16 -0
  26. package/lib/types/controllers/config.schema.d.ts +15 -0
  27. package/lib/types/controllers/formula-alert-render.controller.d.ts +15 -0
  28. package/lib/types/controllers/formula-auto-fill.controller.d.ts +10 -0
  29. package/lib/types/controllers/formula-clipboard.controller.d.ts +25 -0
  30. package/lib/types/controllers/formula-editor-show.controller.d.ts +28 -0
  31. package/lib/types/controllers/formula-process.controller.d.ts +15 -0
  32. package/lib/types/controllers/formula-render.controller.d.ts +6 -0
  33. package/lib/types/controllers/formula-ui.controller.d.ts +19 -0
  34. package/lib/types/controllers/menu.d.ts +5 -0
  35. package/lib/types/controllers/menu.schema.d.ts +2 -0
  36. package/lib/types/controllers/prompt.controller.d.ts +170 -0
  37. package/lib/types/controllers/shortcuts/prompt.shortcut.d.ts +9 -0
  38. package/lib/types/controllers/utils/__tests__/offset-formula-data.spec.d.ts +16 -0
  39. package/lib/types/controllers/utils/__tests__/ref-range-formula.spec.d.ts +16 -0
  40. package/lib/types/controllers/utils/__tests__/utils.spec.d.ts +16 -0
  41. package/lib/types/controllers/utils/offset-formula-data.d.ts +15 -0
  42. package/lib/types/controllers/utils/ref-range-formula.d.ts +71 -0
  43. package/lib/types/controllers/utils/utils.d.ts +15 -0
  44. package/lib/types/index.d.ts +25 -0
  45. package/lib/types/locale/en-US.d.ts +9983 -0
  46. package/lib/types/locale/function-list/array/en-US.d.ts +17 -0
  47. package/lib/types/locale/function-list/array/ja-JP.d.ts +17 -0
  48. package/lib/types/locale/function-list/array/ru-RU.d.ts +2 -0
  49. package/lib/types/locale/function-list/array/vi-VN.d.ts +17 -0
  50. package/lib/types/locale/function-list/array/zh-CN.d.ts +17 -0
  51. package/lib/types/locale/function-list/array/zh-TW.d.ts +17 -0
  52. package/lib/types/locale/function-list/compatibility/en-US.d.ts +762 -0
  53. package/lib/types/locale/function-list/compatibility/ja-JP.d.ts +762 -0
  54. package/lib/types/locale/function-list/compatibility/ru-RU.d.ts +2 -0
  55. package/lib/types/locale/function-list/compatibility/vi-VN.d.ts +762 -0
  56. package/lib/types/locale/function-list/compatibility/zh-CN.d.ts +762 -0
  57. package/lib/types/locale/function-list/compatibility/zh-TW.d.ts +762 -0
  58. package/lib/types/locale/function-list/cube/en-US.d.ts +144 -0
  59. package/lib/types/locale/function-list/cube/ja-JP.d.ts +144 -0
  60. package/lib/types/locale/function-list/cube/ru-RU.d.ts +144 -0
  61. package/lib/types/locale/function-list/cube/vi-VN.d.ts +144 -0
  62. package/lib/types/locale/function-list/cube/zh-CN.d.ts +144 -0
  63. package/lib/types/locale/function-list/cube/zh-TW.d.ts +144 -0
  64. package/lib/types/locale/function-list/database/en-US.d.ts +234 -0
  65. package/lib/types/locale/function-list/database/ja-JP.d.ts +234 -0
  66. package/lib/types/locale/function-list/database/ru-RU.d.ts +234 -0
  67. package/lib/types/locale/function-list/database/vi-VN.d.ts +234 -0
  68. package/lib/types/locale/function-list/database/zh-CN.d.ts +234 -0
  69. package/lib/types/locale/function-list/database/zh-TW.d.ts +234 -0
  70. package/lib/types/locale/function-list/date/en-US.d.ts +458 -0
  71. package/lib/types/locale/function-list/date/ja-JP.d.ts +458 -0
  72. package/lib/types/locale/function-list/date/ru-RU.d.ts +2 -0
  73. package/lib/types/locale/function-list/date/vi-VN.d.ts +458 -0
  74. package/lib/types/locale/function-list/date/zh-CN.d.ts +458 -0
  75. package/lib/types/locale/function-list/date/zh-TW.d.ts +458 -0
  76. package/lib/types/locale/function-list/engineering/en-US.d.ts +894 -0
  77. package/lib/types/locale/function-list/engineering/ja-JP.d.ts +894 -0
  78. package/lib/types/locale/function-list/engineering/ru-RU.d.ts +2 -0
  79. package/lib/types/locale/function-list/engineering/vi-VN.d.ts +894 -0
  80. package/lib/types/locale/function-list/engineering/zh-CN.d.ts +894 -0
  81. package/lib/types/locale/function-list/engineering/zh-TW.d.ts +894 -0
  82. package/lib/types/locale/function-list/financial/en-US.d.ts +1608 -0
  83. package/lib/types/locale/function-list/financial/ja-JP.d.ts +1608 -0
  84. package/lib/types/locale/function-list/financial/ru-RU.d.ts +2 -0
  85. package/lib/types/locale/function-list/financial/vi-VN.d.ts +1608 -0
  86. package/lib/types/locale/function-list/financial/zh-CN.d.ts +1608 -0
  87. package/lib/types/locale/function-list/financial/zh-TW.d.ts +1608 -0
  88. package/lib/types/locale/function-list/information/en-US.d.ts +327 -0
  89. package/lib/types/locale/function-list/information/ja-JP.d.ts +327 -0
  90. package/lib/types/locale/function-list/information/ru-RU.d.ts +2 -0
  91. package/lib/types/locale/function-list/information/vi-VN.d.ts +255 -0
  92. package/lib/types/locale/function-list/information/zh-CN.d.ts +327 -0
  93. package/lib/types/locale/function-list/information/zh-TW.d.ts +327 -0
  94. package/lib/types/locale/function-list/logical/en-US.d.ts +390 -0
  95. package/lib/types/locale/function-list/logical/ja-JP.d.ts +390 -0
  96. package/lib/types/locale/function-list/logical/ru-RU.d.ts +2 -0
  97. package/lib/types/locale/function-list/logical/vi-VN.d.ts +390 -0
  98. package/lib/types/locale/function-list/logical/zh-CN.d.ts +390 -0
  99. package/lib/types/locale/function-list/logical/zh-TW.d.ts +390 -0
  100. package/lib/types/locale/function-list/lookup/en-US.d.ts +812 -0
  101. package/lib/types/locale/function-list/lookup/ja-JP.d.ts +812 -0
  102. package/lib/types/locale/function-list/lookup/ru-RU.d.ts +2 -0
  103. package/lib/types/locale/function-list/lookup/vi-VN.d.ts +722 -0
  104. package/lib/types/locale/function-list/lookup/zh-CN.d.ts +812 -0
  105. package/lib/types/locale/function-list/lookup/zh-TW.d.ts +812 -0
  106. package/lib/types/locale/function-list/math/en-US.d.ts +1388 -0
  107. package/lib/types/locale/function-list/math/ja-JP.d.ts +1388 -0
  108. package/lib/types/locale/function-list/math/ru-RU.d.ts +2 -0
  109. package/lib/types/locale/function-list/math/vi-VN.d.ts +1298 -0
  110. package/lib/types/locale/function-list/math/zh-CN.d.ts +1388 -0
  111. package/lib/types/locale/function-list/math/zh-TW.d.ts +1388 -0
  112. package/lib/types/locale/function-list/statistical/en-US.d.ts +2160 -0
  113. package/lib/types/locale/function-list/statistical/ja-JP.d.ts +2160 -0
  114. package/lib/types/locale/function-list/statistical/ru-RU.d.ts +2 -0
  115. package/lib/types/locale/function-list/statistical/vi-VN.d.ts +1188 -0
  116. package/lib/types/locale/function-list/statistical/zh-CN.d.ts +2160 -0
  117. package/lib/types/locale/function-list/statistical/zh-TW.d.ts +2160 -0
  118. package/lib/types/locale/function-list/text/en-US.d.ts +904 -0
  119. package/lib/types/locale/function-list/text/ja-JP.d.ts +905 -0
  120. package/lib/types/locale/function-list/text/ru-RU.d.ts +856 -0
  121. package/lib/types/locale/function-list/text/vi-VN.d.ts +784 -0
  122. package/lib/types/locale/function-list/text/zh-CN.d.ts +904 -0
  123. package/lib/types/locale/function-list/text/zh-TW.d.ts +904 -0
  124. package/lib/types/locale/function-list/univer/en-US.d.ts +17 -0
  125. package/lib/types/locale/function-list/univer/ja-JP.d.ts +17 -0
  126. package/lib/types/locale/function-list/univer/ru-RU.d.ts +17 -0
  127. package/lib/types/locale/function-list/univer/vi-VN.d.ts +17 -0
  128. package/lib/types/locale/function-list/univer/zh-CN.d.ts +17 -0
  129. package/lib/types/locale/function-list/univer/zh-TW.d.ts +17 -0
  130. package/lib/types/locale/function-list/web/en-US.d.ts +72 -0
  131. package/lib/types/locale/function-list/web/ja-JP.d.ts +72 -0
  132. package/lib/types/locale/function-list/web/ru-RU.d.ts +72 -0
  133. package/lib/types/locale/function-list/web/vi-VN.d.ts +2 -0
  134. package/lib/types/locale/function-list/web/zh-CN.d.ts +72 -0
  135. package/lib/types/locale/function-list/web/zh-TW.d.ts +72 -0
  136. package/lib/types/locale/ru-RU.d.ts +9934 -0
  137. package/lib/types/locale/vi-VN.d.ts +8657 -0
  138. package/lib/types/locale/zh-CN.d.ts +9983 -0
  139. package/lib/types/locale/zh-TW.d.ts +9983 -0
  140. package/lib/types/services/formula-common.d.ts +18 -0
  141. package/lib/types/services/prompt.service.d.ts +160 -0
  142. package/lib/types/services/render-services/ref-selections.render-service.d.ts +42 -0
  143. package/lib/types/services/utils.d.ts +8 -0
  144. package/lib/types/sheets-formula-ui.plugin.d.ts +19 -0
  145. package/lib/types/views/FormulaPromptContainer.d.ts +2 -0
  146. package/lib/types/views/more-functions/MoreFunctions.d.ts +2 -0
  147. package/lib/types/views/more-functions/function-help/FunctionHelp.d.ts +22 -0
  148. package/lib/types/views/more-functions/function-params/FunctionParams.d.ts +8 -0
  149. package/lib/types/views/more-functions/input-params/InputParams.d.ts +7 -0
  150. package/lib/types/views/more-functions/interface.d.ts +16 -0
  151. package/lib/types/views/more-functions/select-function/SelectFunction.d.ts +6 -0
  152. package/lib/types/views/prompt/help-function/HelpFunction.d.ts +2 -0
  153. package/lib/types/views/prompt/resize-scroll-observer.d.ts +18 -0
  154. package/lib/types/views/prompt/search-function/SearchFunction.d.ts +2 -0
  155. package/lib/umd/index.js +1 -0
  156. package/package.json +113 -0
@@ -0,0 +1,2 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ export declare const SheetOnlyPasteFormulaCommand: ICommand;
@@ -0,0 +1,13 @@
1
+ import { Dependency, IWorkbookData, Univer } from '@univerjs/core';
2
+ export declare function createCommandTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
3
+ univer: Univer;
4
+ get: {
5
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
6
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
7
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
8
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
9
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
10
+ <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
11
+ };
12
+ sheet: import('@univerjs/core').UnitModel<object, number>;
13
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,11 @@
1
+ import { IOperation } from '@univerjs/core';
2
+ import { DeviceInputEventType } from '@univerjs/engine-render';
3
+ import { KeyCode, MetaKeys } from '@univerjs/ui';
4
+ import { META_KEY_CTRL_AND_SHIFT } from '../../common/prompt';
5
+ export interface ISelectEditorFormulaOperationParam {
6
+ eventType: DeviceInputEventType;
7
+ keycode?: KeyCode;
8
+ metaKey?: MetaKeys | typeof META_KEY_CTRL_AND_SHIFT;
9
+ isSingleEditor?: boolean;
10
+ }
11
+ export declare const SelectEditorFormulaOperation: IOperation<ISelectEditorFormulaOperationParam>;
@@ -0,0 +1,2 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ export declare const HelpFunctionOperation: ICommand;
@@ -0,0 +1,19 @@
1
+ import { ICellData, ICommand, IRange, Nullable } from '@univerjs/core';
2
+ export interface IInsertFunctionOperationParams {
3
+ /**
4
+ * function name
5
+ */
6
+ value: string;
7
+ }
8
+ export declare const InsertFunctionOperation: ICommand;
9
+ export declare function isNumberCell(cell: Nullable<ICellData>): boolean | void | null;
10
+ /**
11
+ * Check if a single cell
12
+ * @param range
13
+ */
14
+ export declare function isSingleCell(range: IRange): boolean;
15
+ /**
16
+ * Check if there is a multi-row, multi-column range
17
+ * @param range
18
+ */
19
+ export declare function isMultiRowsColumnsRange(range: IRange): boolean;
@@ -0,0 +1,2 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ export declare const MoreFunctionsOperation: ICommand;
@@ -0,0 +1,2 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ export declare const ReferenceAbsoluteOperation: ICommand;
@@ -0,0 +1,2 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ export declare const SearchFunctionOperation: ICommand;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare const FORMULA_UI_PLUGIN_NAME = "SHEET_FORMULA_UI_PLUGIN";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare const META_KEY_CTRL_AND_SHIFT = "meta_key_ctrl_And_Shift";
@@ -0,0 +1,4 @@
1
+ import { ISelectionStyle } from '@univerjs/sheets';
2
+ import { ThemeService } from '@univerjs/core';
3
+ export declare const FORMULA_REF_SELECTION_PLUGIN_NAME = "formula_reference_selection_plugin_name";
4
+ export declare function getFormulaRefSelectionStyle(themeService: ThemeService, refColor: string, id: string): ISelectionStyle;
@@ -0,0 +1,7 @@
1
+ import { Dependency, IWorkbookData, Workbook, Injector, Univer } from '@univerjs/core';
2
+ export interface ITestBed {
3
+ univer: Univer;
4
+ get: Injector['get'];
5
+ sheet: Workbook;
6
+ }
7
+ export declare function createCommandTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): ITestBed;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,15 @@
1
+ import { Ctor } from '@univerjs/core';
2
+ import { BaseFunction, IFunctionInfo, IFunctionNames } from '@univerjs/engine-formula';
3
+ import { MenuConfig } from '@univerjs/ui';
4
+ /**
5
+ * Base configuration for the plugin.
6
+ */
7
+ export declare const PLUGIN_CONFIG_KEY_BASE = "sheets-formula.base.config";
8
+ export declare const configSymbolBase: unique symbol;
9
+ export interface IUniverSheetsFormulaBaseConfig {
10
+ menu?: MenuConfig;
11
+ notExecuteFormula?: boolean;
12
+ description?: IFunctionInfo[];
13
+ function?: Array<[Ctor<BaseFunction>, IFunctionNames]>;
14
+ }
15
+ export declare const defaultPluginBaseConfig: IUniverSheetsFormulaBaseConfig;
@@ -0,0 +1,15 @@
1
+ import { Workbook, Disposable, LocaleService } from '@univerjs/core';
2
+ import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
+ import { CellAlertManagerService, HoverManagerService } from '@univerjs/sheets-ui';
4
+ import { IZenZoneService } from '@univerjs/ui';
5
+ export declare class FormulaAlertRenderController extends Disposable implements IRenderModule {
6
+ private readonly _context;
7
+ private readonly _hoverManagerService;
8
+ private readonly _cellAlertManagerService;
9
+ private readonly _localeService;
10
+ private readonly _zenZoneService;
11
+ constructor(_context: IRenderContext<Workbook>, _hoverManagerService: HoverManagerService, _cellAlertManagerService: CellAlertManagerService, _localeService: LocaleService, _zenZoneService: IZenZoneService);
12
+ private _init;
13
+ private _initCellAlertPopup;
14
+ private _initZenService;
15
+ }
@@ -0,0 +1,10 @@
1
+ import { AutoFillService } from '@univerjs/sheets-ui';
2
+ import { Disposable } from '@univerjs/core';
3
+ import { LexerTreeBuilder } from '@univerjs/engine-formula';
4
+ export declare class FormulaAutoFillController extends Disposable {
5
+ private readonly _autoFillService;
6
+ private readonly _lexerTreeBuilder;
7
+ constructor(_autoFillService: AutoFillService, _lexerTreeBuilder: LexerTreeBuilder);
8
+ private _registerAutoFill;
9
+ private _fillCopyFormula;
10
+ }
@@ -0,0 +1,25 @@
1
+ import { IAccessor, IMutationInfo, Disposable, Injector, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
2
+ import { ICellDataWithSpanInfo, IDiscreteRange, ISheetDiscreteRangeLocation, COPY_TYPE, ISheetClipboardService } from '@univerjs/sheets-ui';
3
+ import { FormulaDataModel, LexerTreeBuilder } from '@univerjs/engine-formula';
4
+ export declare const DEFAULT_PASTE_FORMULA = "default-paste-formula";
5
+ export declare class FormulaClipboardController extends Disposable {
6
+ private readonly _currentUniverSheet;
7
+ private readonly _lexerTreeBuilder;
8
+ private readonly _sheetClipboardService;
9
+ private readonly _injector;
10
+ private readonly _formulaDataModel;
11
+ constructor(_currentUniverSheet: IUniverInstanceService, _lexerTreeBuilder: LexerTreeBuilder, _sheetClipboardService: ISheetClipboardService, _injector: Injector, _formulaDataModel: FormulaDataModel);
12
+ private _initialize;
13
+ private _registerClipboardHook;
14
+ private _pasteFormulaHook;
15
+ private _pasteWithFormulaHook;
16
+ private _onPasteCells;
17
+ }
18
+ export declare function getSetCellFormulaMutations(unitId: string, subUnitId: string, range: IDiscreteRange, matrix: ObjectMatrix<ICellDataWithSpanInfo>, accessor: IAccessor, copyInfo: {
19
+ copyType: COPY_TYPE;
20
+ copyRange?: IDiscreteRange;
21
+ pasteType: string;
22
+ }, lexerTreeBuilder: LexerTreeBuilder, formulaDataModel: FormulaDataModel, isSpecialPaste: boolean | undefined, pasteFrom: ISheetDiscreteRangeLocation | null): {
23
+ undos: IMutationInfo<object>[];
24
+ redos: IMutationInfo<object>[];
25
+ };
@@ -0,0 +1,28 @@
1
+ import { Workbook, Disposable, ICommandService, ILogService, ThemeService } from '@univerjs/core';
2
+ import { IRenderContext, IRenderModule, SpreadsheetSkeleton, IRenderManagerService } from '@univerjs/engine-render';
3
+ import { FormulaDataModel } from '@univerjs/engine-formula';
4
+ import { IEditorBridgeService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
5
+ export declare class FormulaEditorShowController extends Disposable implements IRenderModule {
6
+ private readonly _context;
7
+ private _editorBridgeService;
8
+ private readonly _formulaDataModel;
9
+ private readonly _themeService;
10
+ private readonly _renderManagerService;
11
+ private readonly _sheetSkeletonManagerService;
12
+ private readonly _commandService;
13
+ private readonly _logService;
14
+ private _previousShape;
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;
19
+ private _initInterceptorEditorStart;
20
+ private _commandExecutedListener;
21
+ private _displayArrayFormulaRangeShape;
22
+ private _createArrayFormulaRangeShape;
23
+ private _removeArrayFormulaRangeShape;
24
+ private _refreshArrayFormulaRangeShape;
25
+ private _checkCurrentSheet;
26
+ private _updateArrayFormulaRangeShape;
27
+ private _refreshArrayFormulaRangeShapeByRow;
28
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
@@ -0,0 +1,6 @@
1
+ import { RxDisposable } from '@univerjs/core';
2
+ import { SheetInterceptorService } from '@univerjs/sheets';
3
+ export declare class FormulaRenderManagerController extends RxDisposable {
4
+ private readonly _sheetInterceptorService;
5
+ constructor(_sheetInterceptorService: SheetInterceptorService);
6
+ }
@@ -0,0 +1,19 @@
1
+ import { Disposable, ICommandService, Injector } from '@univerjs/core';
2
+ import { IRenderManagerService } from '@univerjs/engine-render';
3
+ import { ComponentManager, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
4
+ export declare class FormulaUIController extends Disposable {
5
+ private readonly _injector;
6
+ private readonly _menuManagerService;
7
+ private readonly _commandService;
8
+ private readonly _shortcutService;
9
+ private readonly _uiPartsService;
10
+ private readonly _renderManagerService;
11
+ private readonly _componentManager;
12
+ constructor(_injector: Injector, _menuManagerService: IMenuManagerService, _commandService: ICommandService, _shortcutService: IShortcutService, _uiPartsService: IUIPartsService, _renderManagerService: IRenderManagerService, _componentManager: ComponentManager);
13
+ private _initialize;
14
+ private _registerMenus;
15
+ private _registerCommands;
16
+ private _registerShortcuts;
17
+ private _registerComponents;
18
+ private _registerRenderModules;
19
+ }
@@ -0,0 +1,5 @@
1
+ import { IAccessor } from '@univerjs/core';
2
+ import { IMenuItem } from '@univerjs/ui';
3
+ export declare function InsertFunctionMenuItemFactory(accessor: IAccessor): IMenuItem;
4
+ export declare function MoreFunctionsMenuItemFactory(accessor: IAccessor): IMenuItem;
5
+ export declare function PasteFormulaMenuItemFactory(accessor: IAccessor): IMenuItem;
@@ -0,0 +1,2 @@
1
+ import { MenuSchemaType } from '@univerjs/ui';
2
+ export declare const menuSchema: MenuSchemaType;
@@ -0,0 +1,170 @@
1
+ import { EditorBridgeService } from '@univerjs/sheets-ui';
2
+ import { Disposable, ICommandService, IContextService, IUniverInstanceService, ThemeService } from '@univerjs/core';
3
+ import { DocSelectionManagerService } from '@univerjs/docs';
4
+ import { IEditorService } from '@univerjs/docs-ui';
5
+ import { LexerTreeBuilder } from '@univerjs/engine-formula';
6
+ import { IRenderManagerService } from '@univerjs/engine-render';
7
+ import { SheetsSelectionsService } from '@univerjs/sheets';
8
+ import { IDescriptionService } from '@univerjs/sheets-formula';
9
+ import { IContextMenuService, ILayoutService } from '@univerjs/ui';
10
+ import { IFormulaPromptService } from '../services/prompt.service';
11
+ export declare class PromptController extends Disposable {
12
+ private readonly _commandService;
13
+ private readonly _contextService;
14
+ private readonly _editorBridgeService;
15
+ private readonly _formulaPromptService;
16
+ private readonly _lexerTreeBuilder;
17
+ private readonly _renderManagerService;
18
+ private readonly _themeService;
19
+ private readonly _sheetsSelectionsService;
20
+ private readonly _refSelectionsService;
21
+ private readonly _univerInstanceService;
22
+ private readonly _descriptionService;
23
+ private readonly _docSelectionManagerService;
24
+ private readonly _contextMenuService;
25
+ private readonly _editorService;
26
+ private readonly _layoutService;
27
+ private _listenInputCache;
28
+ private _formulaRefColors;
29
+ private _previousSequenceNodes;
30
+ private _previousRangesCount;
31
+ private _previousInsertRefStringIndex;
32
+ private _currentInsertRefStringIndex;
33
+ private _arrowMoveActionState;
34
+ private _isSelectionMovingRefSelections;
35
+ private _stringColor;
36
+ private _numberColor;
37
+ private _insertSelections;
38
+ private _inputPanelState;
39
+ private _userCursorMove;
40
+ private _previousEditorUnitId;
41
+ private _existsSequenceNode;
42
+ private get _selectionRenderService();
43
+ /**
44
+ * For multiple sheet instances.
45
+ */
46
+ private get _allSelectionRenderServices();
47
+ constructor(_commandService: ICommandService, _contextService: IContextService, _editorBridgeService: EditorBridgeService, _formulaPromptService: IFormulaPromptService, _lexerTreeBuilder: LexerTreeBuilder, _renderManagerService: IRenderManagerService, _themeService: ThemeService, _sheetsSelectionsService: SheetsSelectionsService, _refSelectionsService: SheetsSelectionsService, _univerInstanceService: IUniverInstanceService, _descriptionService: IDescriptionService, _docSelectionManagerService: DocSelectionManagerService, _contextMenuService: IContextMenuService, _editorService: IEditorService, _layoutService: ILayoutService);
48
+ dispose(): void;
49
+ private _resetTemp;
50
+ private _initialize;
51
+ private _initialFormulaTheme;
52
+ private _initialCursorSync;
53
+ private _initialEditorInputChange;
54
+ private _closeRangePromptWhenEditorInvisible;
55
+ private _initialChangeEditor;
56
+ private _closeRangePrompt;
57
+ private _initSelectionsEndListener;
58
+ /**
59
+ * For interaction with mouse & keyboard shortcuts on spreadsheet. Not in formula editor.
60
+ */
61
+ private _updateSelecting;
62
+ private _currentlyWorkingRefRenderer;
63
+ private _selectionsChangeDisposables;
64
+ private _enableRefSelectionsRenderService;
65
+ private _checkClearingLastSelection;
66
+ private _disposeSelectionsChangeListeners;
67
+ private _insertControlSelections;
68
+ private _initAcceptFormula;
69
+ private _changeFunctionPanelState;
70
+ private _changeHelpFunctionPanelState;
71
+ private _hideFunctionPanel;
72
+ private _checkShouldEnterSelectingMode;
73
+ /**
74
+ *
75
+ * @returns Return the character under the current cursor in the editor.
76
+ */
77
+ private _getCurrentChar;
78
+ private _getCurrentDataStream;
79
+ private _isSelectingMode;
80
+ private _enterSelectingMode;
81
+ /**
82
+ * Disable the ref string generation mode. In the ref string generation mode,
83
+ * users can select a certain area using the mouse and arrow keys, and convert the area into a ref string.
84
+ */
85
+ private _quitSelectingMode;
86
+ private _getCurrentBodyDataStreamAndOffset;
87
+ private _getFormulaAndCellEditorBody;
88
+ private _editorModelUnitIds;
89
+ /**
90
+ * Detect whether the user's input content is a formula. If it is a formula,
91
+ * serialize the current input content into a sequenceNode;
92
+ * otherwise, close the formula panel.
93
+ * @param currentInputValue The text content entered by the user in the editor.
94
+ */
95
+ private _contextSwitch;
96
+ private _getContextState;
97
+ /**
98
+ * Highlight cell editor and formula bar editor.
99
+ */
100
+ private _highlightFormula;
101
+ /**
102
+ * :
103
+ * #
104
+ * Generate styles for formula text, highlighting references, text, numbers, and arrays.
105
+ */
106
+ private _buildTextRuns;
107
+ private _exceedCurrentRange;
108
+ /**
109
+ * Draw the referenced selection text based on the style and token.
110
+ * @param refSelections
111
+ */
112
+ private _refreshSelectionForReference;
113
+ private _getPrimary;
114
+ private _getSheetIdByName;
115
+ private _getSheetNameById;
116
+ private _getCurrentUnitIdAndSheetId;
117
+ private _getEditorOpenedForSheet;
118
+ /**
119
+ * Convert the selection range to a ref string for the formula engine, such as A1:B1
120
+ * @param currentSelection
121
+ */
122
+ private _generateRefString;
123
+ /**
124
+ * Update Editor formula text in prompt editor by current selection in spreadsheet.
125
+ * Restore the sequenceNode generated by the lexer to the text in the editor, and set the cursor position.
126
+ *
127
+ * @param sequenceNodes
128
+ * @param textSelectionOffset
129
+ */
130
+ private _syncToEditor;
131
+ private _fitEditorSize;
132
+ /**
133
+ * Update the editor's model value to facilitate formula updates.
134
+ * @param dataStream
135
+ * @param textRuns
136
+ */
137
+ private _updateEditorModel;
138
+ private _insertControlSelectionReplace;
139
+ /**
140
+ * pro/issues/450
141
+ * In range selection mode, certain measures are implemented to ensure that the selection behavior is processed correctly.
142
+ */
143
+ private _focusIsOnlyRange;
144
+ /**
145
+ * pro/issues/450
146
+ * In range selection mode, certain measures are implemented to ensure that the selection behavior is processed correctly.
147
+ */
148
+ private _resetSequenceNodes;
149
+ private _updateRefSelectionStyle;
150
+ private _onSelectionControlChange;
151
+ private _refreshFormulaAndCellEditor;
152
+ private _cursorStateListener;
153
+ private _pressEnter;
154
+ private _pressTab;
155
+ private _pressEsc;
156
+ private _pressArrowKey;
157
+ private _commandExecutedListener;
158
+ private _moveInEditor;
159
+ private _userMouseListener;
160
+ private _inputFormulaListener;
161
+ /**
162
+ * Absolute range, triggered by F4
163
+ */
164
+ private _changeRefString;
165
+ private _changeRangeRef;
166
+ private _changeSingleRef;
167
+ private _getEditorObject;
168
+ private _isFormulaEditorActivated;
169
+ private _isSheetOrFormulaEditor;
170
+ }
@@ -0,0 +1,9 @@
1
+ import { IShortcutItem, KeyCode } from '@univerjs/ui';
2
+ export declare const PROMPT_SELECTION_KEYCODE_ARROW_LIST: KeyCode[];
3
+ export declare const PROMPT_SELECTION_KEYCODE_LIST: KeyCode[];
4
+ export declare function promptSelectionShortcutItem(): IShortcutItem<object>[];
5
+ export declare function promptSelectionShortcutItemShift(): IShortcutItem<object>[];
6
+ export declare function promptSelectionShortcutItemCtrl(): IShortcutItem<object>[];
7
+ export declare function promptSelectionShortcutItemCtrlAndShift(): IShortcutItem<object>[];
8
+ export declare const ChangeRefToAbsoluteShortcut: IShortcutItem;
9
+ export declare function singleEditorPromptSelectionShortcutItem(): IShortcutItem<object>[];
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,15 @@
1
+ import { IRange } from '@univerjs/core';
2
+ import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData } from '@univerjs/engine-formula';
3
+ export interface IRefRangeWithPosition {
4
+ row: number;
5
+ column: number;
6
+ range: IRange;
7
+ }
8
+ export declare function checkFormulaDataNull(formulaData: IFormulaData, unitId: string, sheetId: string): boolean;
9
+ export declare function removeFormulaData(formulaData: IFormulaData | IArrayFormulaRangeType | IArrayFormulaUnitCellType, unitId: string, sheetId?: string): {
10
+ [x: string]: {
11
+ [x: string]: null;
12
+ };
13
+ } | {
14
+ [x: string]: null;
15
+ } | undefined;