@univerjs/sheets-formula 0.1.0-alpha.2 → 0.1.0-alpha.3

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 (56) hide show
  1. package/README.md +1 -1
  2. package/lib/cjs/index.js +6 -4
  3. package/lib/es/index.js +16188 -1827
  4. package/lib/index.css +1 -1
  5. package/lib/types/common/selection.d.ts +1 -1
  6. package/lib/types/controllers/formula-clipboard.controller.d.ts +1 -1
  7. package/lib/types/controllers/formula-editor-show.controller.d.ts +4 -1
  8. package/lib/types/controllers/formula-input.controller.d.ts +3 -1
  9. package/lib/types/controllers/prompt.controller.d.ts +2 -3
  10. package/lib/types/controllers/trigger-calculation.controller.d.ts +1 -0
  11. package/lib/types/controllers/utils.d.ts +2 -2
  12. package/lib/types/locale/en-US.d.ts +9106 -10
  13. package/lib/types/locale/function-list/array/ja-JP.d.ts +17 -0
  14. package/lib/types/locale/function-list/compatibility/en-US.d.ts +740 -1
  15. package/lib/types/locale/function-list/compatibility/ja-JP.d.ts +756 -0
  16. package/lib/types/locale/function-list/compatibility/zh-CN.d.ts +740 -1
  17. package/lib/types/locale/function-list/cube/en-US.d.ts +128 -1
  18. package/lib/types/locale/function-list/cube/ja-JP.d.ts +144 -0
  19. package/lib/types/locale/function-list/cube/zh-CN.d.ts +128 -1
  20. package/lib/types/locale/function-list/database/en-US.d.ts +218 -1
  21. package/lib/types/locale/function-list/database/ja-JP.d.ts +234 -0
  22. package/lib/types/locale/function-list/database/zh-CN.d.ts +218 -1
  23. package/lib/types/locale/function-list/date/en-US.d.ts +452 -1
  24. package/lib/types/locale/function-list/date/ja-JP.d.ts +468 -0
  25. package/lib/types/locale/function-list/date/zh-CN.d.ts +452 -1
  26. package/lib/types/locale/function-list/engineering/en-US.d.ts +974 -1
  27. package/lib/types/locale/function-list/engineering/ja-JP.d.ts +990 -0
  28. package/lib/types/locale/function-list/engineering/zh-CN.d.ts +974 -1
  29. package/lib/types/locale/function-list/financial/en-US.d.ts +992 -1
  30. package/lib/types/locale/function-list/financial/ja-JP.d.ts +1008 -0
  31. package/lib/types/locale/function-list/financial/zh-CN.d.ts +992 -1
  32. package/lib/types/locale/function-list/information/en-US.d.ts +380 -1
  33. package/lib/types/locale/function-list/information/ja-JP.d.ts +396 -0
  34. package/lib/types/locale/function-list/information/zh-CN.d.ts +380 -1
  35. package/lib/types/locale/function-list/logical/en-US.d.ts +344 -1
  36. package/lib/types/locale/function-list/logical/ja-JP.d.ts +360 -0
  37. package/lib/types/locale/function-list/logical/zh-CN.d.ts +344 -1
  38. package/lib/types/locale/function-list/lookup/en-US.d.ts +668 -1
  39. package/lib/types/locale/function-list/lookup/ja-JP.d.ts +684 -0
  40. package/lib/types/locale/function-list/lookup/zh-CN.d.ts +668 -1
  41. package/lib/types/locale/function-list/math/en-US.d.ts +1448 -0
  42. package/lib/types/locale/function-list/math/ja-JP.d.ts +1494 -0
  43. package/lib/types/locale/function-list/math/zh-CN.d.ts +1448 -0
  44. package/lib/types/locale/function-list/statistical/en-US.d.ts +1944 -2
  45. package/lib/types/locale/function-list/statistical/ja-JP.d.ts +2016 -0
  46. package/lib/types/locale/function-list/statistical/zh-CN.d.ts +1944 -2
  47. package/lib/types/locale/function-list/text/en-US.d.ts +848 -1
  48. package/lib/types/locale/function-list/text/ja-JP.d.ts +865 -0
  49. package/lib/types/locale/function-list/text/zh-CN.d.ts +848 -1
  50. package/lib/types/locale/function-list/univer/ja-JP.d.ts +17 -0
  51. package/lib/types/locale/function-list/web/en-US.d.ts +56 -1
  52. package/lib/types/locale/function-list/web/ja-JP.d.ts +72 -0
  53. package/lib/types/locale/function-list/web/zh-CN.d.ts +56 -1
  54. package/lib/types/locale/zh-CN.d.ts +9106 -10
  55. package/lib/umd/index.js +6 -4
  56. package/package.json +20 -22
package/lib/index.css CHANGED
@@ -1 +1 @@
1
- .univer-formula-error-function{position:absolute}.univer-formula-help-function{-webkit-user-select:none;user-select:none;box-sizing:border-box;width:250px;margin:0;line-height:20px;list-style:none;background-color:rgb(var(--bg-color-secondary));border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-lg);outline:none;box-shadow:var(--box-shadow-base)}.univer-formula-help-function-title{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;padding:var(--padding-base) var(--padding-lg);font-size:var(--font-size-xs);font-weight:500;color:rgb(var(--text-color));border-bottom:1px solid rgb(var(--border-color))}.univer-formula-help-function-title-icons{display:flex}.univer-formula-help-function-title-icon{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;margin-left:var(--margin-xs);padding:0;font-size:var(--font-size-lg);color:rgb(var(--text-color-secondary));background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none;transition:background-color .2s}.univer-formula-help-function-title-icon:hover{background-color:rgb(var(--bg-color-hover))}.univer-formula-help-function-content{overflow-y:auto;box-sizing:border-box;max-height:350px;padding:0 var(--padding-lg) var(--padding-base) var(--padding-lg)}.univer-formula-help-function-content-inner{margin-top:var(--margin-sm)}.univer-formula-help-function-content-params{margin:var(--margin-xs) 0}.univer-formula-help-function-content-params-title{margin-bottom:var(--margin-xs);font-size:var(--font-size-xs);font-weight:500;color:rgb(var(--text-color))}.univer-formula-help-function-content-params-detail{font-size:var(--font-size-xxs);font-weight:400;color:rgb(var(--text-color-secondary))}.univer-formula-help-function-active{color:rgb(var(--primary-color))}.univer-formula-help-decorator{cursor:pointer;position:fixed;z-index:10;display:flex;align-items:center;justify-content:center;padding:var(--padding-xs)}.univer-formula-search-function{overflow-y:auto;box-sizing:border-box;width:250px;max-height:400px;margin:0;padding:var(--padding-sm);line-height:20px;list-style:none;background-color:rgb(var(--bg-color-secondary));border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-lg);outline:none;box-shadow:var(--box-shadow-base)}.univer-formula-search-function-item{cursor:pointer;box-sizing:border-box;padding:var(--padding-xs) var(--padding-sm);color:rgb(var(--text-color));border-radius:var(--border-radius-base);transition:background .2s}.univer-formula-search-function-item-name{font-size:var(--font-size-xs)}.univer-formula-search-function-item-name-light{color:rgb(var(--error-color))}.univer-formula-search-function-item-desc{display:block;font-size:var(--font-size-xxs)}.univer-formula-search-function-item-active{background-color:rgb(var(--bg-color-hover))}.univer-formula-more-functions{display:flex;flex-direction:column;justify-content:space-between;height:100%;line-height:20px}.univer-formula-more-functions-operation{display:flex;justify-content:flex-end}.univer-formula-more-functions-operation>button{margin:0 0 var(--margin-lg) var(--margin-base)}.univer-formula-function-params{margin:var(--margin-xs) 0;font-size:var(--font-size-xxs)}.univer-formula-function-params-title{font-weight:500;color:rgb(var(--text-color-secondary))}.univer-formula-function-params-detail{font-weight:400;color:rgb(var(--text-color))}.univer-formula-input-params-list{overflow-y:auto;height:364px}.univer-formula-input-params-list-item-name{font-size:var(--font-size-sm)}.univer-formula-input-params-list-item-selector{margin:var(--margin-xxs) 0 var(--margin-xs) 0}.univer-formula-select-function-select{display:flex;gap:10%;align-items:center;justify-content:space-between}.univer-formula-select-function-result{-webkit-user-select:none;user-select:none;overflow-y:auto;box-sizing:border-box;width:100%;height:364px;margin:0;margin-top:var(--margin-xs);padding:var(--padding-base);list-style:none;border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-base);outline:none}.univer-formula-select-function-result-item{cursor:pointer;position:relative;box-sizing:border-box;padding:var(--padding-xs) 28px;font-size:var(--font-size-xs);color:rgb(var(--text-color));border-radius:var(--border-radius-base);transition:background .2s}.univer-formula-select-function-result-item-name-light{color:rgb(var(--error-color))}.univer-formula-select-function-result-item-selected{position:absolute;top:50%;left:6px;transform:translateY(-50%);display:inline-flex;font-size:var(--font-size-lg);color:rgb(var(--success-color))}.univer-formula-select-function-result-item-active{background-color:rgb(var(--bg-color-hover))}.univer-formula-select-function-content{overflow-y:auto}
1
+ .univer-formula-error-function{position:absolute}.univer-formula-help-function{-webkit-user-select:none;user-select:none;box-sizing:border-box;width:250px;margin:0;line-height:20px;list-style:none;background-color:rgb(var(--bg-color-secondary));border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-lg);outline:none;box-shadow:var(--box-shadow-base)}.univer-formula-help-function-title{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;padding:var(--padding-base) var(--padding-lg);font-size:var(--font-size-xs);font-weight:500;color:rgb(var(--text-color));border-bottom:1px solid rgb(var(--border-color))}.univer-formula-help-function-title-icons{display:flex}.univer-formula-help-function-title-icon{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;margin-left:var(--margin-xs);padding:0;font-size:var(--font-size-lg);color:rgb(var(--text-color-secondary));background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none;transition:background-color .2s}.univer-formula-help-function-title-icon:hover{background-color:rgb(var(--bg-color-hover))}.univer-formula-help-function-content{overflow-y:auto;box-sizing:border-box;max-height:350px;padding:0 var(--padding-lg) var(--padding-base) var(--padding-lg)}.univer-formula-help-function-content-inner{margin-top:var(--margin-sm)}.univer-formula-help-function-content-params{margin:var(--margin-xs) 0}.univer-formula-help-function-content-params-title{margin-bottom:var(--margin-xs);font-size:var(--font-size-xs);font-weight:500;color:rgb(var(--text-color))}.univer-formula-help-function-content-params-detail{font-size:var(--font-size-xxs);font-weight:400;color:rgb(var(--text-color-secondary))}.univer-formula-help-function-active{color:rgb(var(--primary-color))}.univer-formula-help-decorator{cursor:pointer;position:fixed;z-index:10;display:flex;align-items:center;justify-content:center;padding:var(--padding-xs)}.univer-formula-search-function{overflow-y:auto;box-sizing:border-box;width:250px;max-height:400px;margin:0;padding:var(--padding-sm);line-height:20px;list-style:none;background-color:rgb(var(--bg-color-secondary));border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-lg);outline:none;box-shadow:var(--box-shadow-base)}.univer-formula-search-function-item{cursor:pointer;box-sizing:border-box;padding:var(--padding-xs) var(--padding-sm);color:rgb(var(--text-color));border-radius:var(--border-radius-base);transition:background .2s}.univer-formula-search-function-item-name{font-size:var(--font-size-xs)}.univer-formula-search-function-item-name-light{color:rgb(var(--error-color))}.univer-formula-search-function-item-desc{display:block;font-size:var(--font-size-xxs)}.univer-formula-search-function-item-active{background-color:rgb(var(--bg-color-hover))}.univer-formula-more-functions{display:flex;flex-direction:column;justify-content:space-between;height:100%;line-height:20px}.univer-formula-more-functions-operation{display:flex;justify-content:flex-end}.univer-formula-more-functions-operation>button{margin:0 0 var(--margin-lg) var(--margin-base)}.univer-formula-function-params{margin-bottom:var(--margin-xs);font-size:var(--font-size-xxs)}.univer-formula-function-params-title{font-weight:500;color:rgb(var(--text-color-secondary))}.univer-formula-function-params-detail{font-weight:400;color:rgb(var(--text-color))}.univer-formula-input-params-list{overflow-y:auto;height:364px}.univer-formula-input-params-list-item-name{font-size:var(--font-size-sm)}.univer-formula-input-params-list-item-selector{margin:var(--margin-xxs) 0 var(--margin-xs) 0}.univer-formula-select-function-select{display:flex;gap:10%;align-items:center;justify-content:space-between}.univer-formula-select-function-result{-webkit-user-select:none;user-select:none;overflow-y:auto;box-sizing:border-box;width:100%;height:364px;margin:0;margin-top:var(--margin-xs);padding:var(--padding-base);list-style:none;border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-base);outline:none}.univer-formula-select-function-result-item{cursor:pointer;position:relative;box-sizing:border-box;padding:var(--padding-xs) 28px;font-size:var(--font-size-xs);color:rgb(var(--text-color));border-radius:var(--border-radius-base);transition:background .2s}.univer-formula-select-function-result-item-name-light{color:rgb(var(--error-color))}.univer-formula-select-function-result-item-selected{position:absolute;top:50%;left:6px;transform:translateY(-50%);display:inline-flex;font-size:var(--font-size-lg);color:rgb(var(--success-color))}.univer-formula-select-function-result-item-active{background-color:rgb(var(--bg-color-hover))}.univer-formula-select-function-content{overflow-y:auto;max-height:307px;margin:var(--margin-xs) 0}
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ThemeService } from '@univerjs/core';
16
+ import { type ThemeService } from '@univerjs/core';
17
17
  import type { ISelectionStyle } from '@univerjs/sheets';
18
18
  export declare const FORMULA_REF_SELECTION_PLUGIN_NAME = "formula_reference_selection_plugin_name";
19
19
  export declare function getFormulaRefSelectionStyle(themeService: ThemeService, refColor: string, id: string): ISelectionStyle;
@@ -32,7 +32,7 @@ export declare class FormulaClipboardController extends Disposable {
32
32
  private _pasteFormulaHook;
33
33
  private _pasteWithFormulaHook;
34
34
  }
35
- export declare function getSetCellFormulaMutations(workbookId: string, worksheetId: string, range: IRange, matrix: ObjectMatrix<ICellDataWithSpanInfo>, accessor: IAccessor, copyInfo: {
35
+ export declare function getSetCellFormulaMutations(unitId: string, subUnitId: string, range: IRange, matrix: ObjectMatrix<ICellDataWithSpanInfo>, accessor: IAccessor, copyInfo: {
36
36
  copyType: COPY_TYPE;
37
37
  copyRange?: IRange;
38
38
  }, lexerTreeBuilder: LexerTreeBuilder, isSpecialPaste?: boolean): {
@@ -16,6 +16,7 @@
16
16
  import { Disposable, ICommandService, ThemeService } from '@univerjs/core';
17
17
  import { FormulaDataModel, LexerTreeBuilder } from '@univerjs/engine-formula';
18
18
  import { IRenderManagerService } from '@univerjs/engine-render';
19
+ import { SheetInterceptorService } from '@univerjs/sheets';
19
20
  import { IEditorBridgeService, ISelectionRenderService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
20
21
  export declare class FormulaEditorShowController extends Disposable {
21
22
  private _editorBridgeService;
@@ -26,9 +27,11 @@ export declare class FormulaEditorShowController extends Disposable {
26
27
  private readonly _selectionRenderService;
27
28
  private readonly _sheetSkeletonManagerService;
28
29
  private readonly _commandService;
30
+ private _sheetInterceptorService;
29
31
  private _previousShape;
30
- constructor(_editorBridgeService: IEditorBridgeService, _formulaDataModel: FormulaDataModel, _lexerTreeBuilder: LexerTreeBuilder, _themeService: ThemeService, _renderManagerService: IRenderManagerService, _selectionRenderService: ISelectionRenderService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _commandService: ICommandService);
32
+ constructor(_editorBridgeService: IEditorBridgeService, _formulaDataModel: FormulaDataModel, _lexerTreeBuilder: LexerTreeBuilder, _themeService: ThemeService, _renderManagerService: IRenderManagerService, _selectionRenderService: ISelectionRenderService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _commandService: ICommandService, _sheetInterceptorService: SheetInterceptorService);
31
33
  private _initInterceptorEditorStart;
34
+ private _initInterceptorCell;
32
35
  private _commandExecutedListener;
33
36
  private _createArrayFormulaRangeShape;
34
37
  private _removeArrayFormulaRangeShape;
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Disposable, ICommandService } from '@univerjs/core';
17
+ import { TextSelectionManagerService } from '@univerjs/docs';
17
18
  import { LexerTreeBuilder } from '@univerjs/engine-formula';
18
19
  import { IRenderManagerService, ITextSelectionRenderManager } from '@univerjs/engine-render';
19
20
  import type { EditorBridgeService } from '@univerjs/sheets-ui';
@@ -25,8 +26,9 @@ export declare class FormulaInputController extends Disposable {
25
26
  private readonly _lexerTreeBuilder;
26
27
  private readonly _renderManagerService;
27
28
  private readonly _formulaInputService;
29
+ private readonly _textSelectionManagerService;
28
30
  private _userCursorMove;
29
- constructor(_commandService: ICommandService, _textSelectionRenderManager: ITextSelectionRenderManager, _editorBridgeService: EditorBridgeService, _lexerTreeBuilder: LexerTreeBuilder, _renderManagerService: IRenderManagerService, _formulaInputService: IFormulaInputService);
31
+ constructor(_commandService: ICommandService, _textSelectionRenderManager: ITextSelectionRenderManager, _editorBridgeService: EditorBridgeService, _lexerTreeBuilder: LexerTreeBuilder, _renderManagerService: IRenderManagerService, _formulaInputService: IFormulaInputService, _textSelectionManagerService: TextSelectionManagerService);
30
32
  private _initialize;
31
33
  private _initialEditorInputChange;
32
34
  private _userMouseListener;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Disposable, ICommandService, IContextService, IUniverInstanceService, LocaleService, ThemeService } from '@univerjs/core';
16
+ import { Disposable, ICommandService, IContextService, IUniverInstanceService, ThemeService } from '@univerjs/core';
17
17
  import { DocViewModelManagerService, TextSelectionManagerService } from '@univerjs/docs';
18
18
  import { LexerTreeBuilder } from '@univerjs/engine-formula';
19
19
  import { IRenderManagerService, ITextSelectionRenderManager } from '@univerjs/engine-render';
@@ -25,7 +25,6 @@ import { IFormulaInputService } from '../services/formula-input.service';
25
25
  import { IFormulaPromptService } from '../services/prompt.service';
26
26
  export declare class PromptController extends Disposable {
27
27
  private readonly _commandService;
28
- private readonly _localeService;
29
28
  private readonly _contextService;
30
29
  private readonly _textSelectionRenderManager;
31
30
  private readonly _editorBridgeService;
@@ -54,7 +53,7 @@ export declare class PromptController extends Disposable {
54
53
  private _numberColor;
55
54
  private _insertSelections;
56
55
  private _inputPanelState;
57
- constructor(_commandService: ICommandService, _localeService: LocaleService, _contextService: IContextService, _textSelectionRenderManager: ITextSelectionRenderManager, _editorBridgeService: EditorBridgeService, _formulaPromptService: IFormulaPromptService, _lexerTreeBuilder: LexerTreeBuilder, _renderManagerService: IRenderManagerService, _themeService: ThemeService, _selectionManagerService: SelectionManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _currentUniverService: IUniverInstanceService, _selectionRenderService: ISelectionRenderService, _descriptionService: IDescriptionService, _textSelectionManagerService: TextSelectionManagerService, _formulaInputService: IFormulaInputService, _docViewModelManagerService: DocViewModelManagerService);
56
+ constructor(_commandService: ICommandService, _contextService: IContextService, _textSelectionRenderManager: ITextSelectionRenderManager, _editorBridgeService: EditorBridgeService, _formulaPromptService: IFormulaPromptService, _lexerTreeBuilder: LexerTreeBuilder, _renderManagerService: IRenderManagerService, _themeService: ThemeService, _selectionManagerService: SelectionManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _currentUniverService: IUniverInstanceService, _selectionRenderService: ISelectionRenderService, _descriptionService: IDescriptionService, _textSelectionManagerService: TextSelectionManagerService, _formulaInputService: IFormulaInputService, _docViewModelManagerService: DocViewModelManagerService);
58
57
  dispose(): void;
59
58
  private _resetTemp;
60
59
  private _initialize;
@@ -19,6 +19,7 @@ export declare class TriggerCalculationController extends Disposable {
19
19
  private readonly _commandService;
20
20
  private readonly _activeDirtyManagerService;
21
21
  private _waitingCommandQueue;
22
+ private _executingCommandQueue;
22
23
  private _setTimeoutKey;
23
24
  private _startExecutionTime;
24
25
  constructor(_commandService: ICommandService, _activeDirtyManagerService: IActiveDirtyManagerService);
@@ -13,12 +13,12 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICommandInfo, Nullable, ObjectMatrixPrimitiveType } from '@univerjs/core';
16
+ import type { ICommandInfo, IObjectMatrixPrimitiveType, Nullable } from '@univerjs/core';
17
17
  import type { IArrayFormulaRangeType } from '@univerjs/engine-formula';
18
18
  import type { ISelectionWithStyle } from '@univerjs/sheets';
19
19
  interface IFormulaDataGenerics<T> {
20
20
  [unitId: string]: {
21
- [sheetId: string]: ObjectMatrixPrimitiveType<T>;
21
+ [sheetId: string]: IObjectMatrixPrimitiveType<T>;
22
22
  };
23
23
  }
24
24
  export declare function offsetFormula<T>(formulaData: IFormulaDataGenerics<T>, command: ICommandInfo, unitId: string, sheetId: string, selections?: Readonly<Nullable<ISelectionWithStyle[]>>): IFormulaDataGenerics<T>;