@univerjs/engine-formula 0.1.10 → 0.1.12

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 (161) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +5916 -5543
  3. package/lib/types/basics/function.d.ts +16 -16
  4. package/lib/types/commands/mutations/set-array-formula-data.mutation.d.ts +1 -1
  5. package/lib/types/commands/mutations/set-feature-calculation.mutation.d.ts +1 -1
  6. package/lib/types/commands/mutations/set-formula-calculation.mutation.d.ts +2 -2
  7. package/lib/types/commands/mutations/set-formula-data.mutation.d.ts +1 -1
  8. package/lib/types/commands/mutations/set-other-formula.mutation.d.ts +1 -1
  9. package/lib/types/commands/mutations/set-super-table.mutation.d.ts +2 -2
  10. package/lib/types/controller/calculate.controller.d.ts +2 -2
  11. package/lib/types/controller/formula.controller.d.ts +4 -4
  12. package/lib/types/controller/register-function.controller.d.ts +2 -2
  13. package/lib/types/controller/set-defined-name.controller.d.ts +1 -1
  14. package/lib/types/controller/set-dependency.controller.d.ts +1 -1
  15. package/lib/types/controller/set-feature-calculation.controller.d.ts +1 -1
  16. package/lib/types/controller/set-other-formula.controller.d.ts +2 -2
  17. package/lib/types/controller/set-super-table.controller.d.ts +1 -1
  18. package/lib/types/engine/analysis/__tests__/create-command-test-bed.d.ts +2 -2
  19. package/lib/types/engine/analysis/lexer-node.d.ts +1 -1
  20. package/lib/types/engine/analysis/lexer-tree-builder.d.ts +4 -4
  21. package/lib/types/engine/analysis/lexer.d.ts +4 -4
  22. package/lib/types/engine/analysis/parser.d.ts +13 -13
  23. package/lib/types/engine/ast-node/ast-root-node.d.ts +3 -3
  24. package/lib/types/engine/ast-node/base-ast-node-factory.d.ts +4 -4
  25. package/lib/types/engine/ast-node/base-ast-node.d.ts +5 -5
  26. package/lib/types/engine/ast-node/function-node.d.ts +10 -10
  27. package/lib/types/engine/ast-node/lambda-node.d.ts +5 -5
  28. package/lib/types/engine/ast-node/lambda-parameter-node.d.ts +3 -3
  29. package/lib/types/engine/ast-node/null-node.d.ts +1 -1
  30. package/lib/types/engine/ast-node/operator-node.d.ts +5 -5
  31. package/lib/types/engine/ast-node/prefix-node.d.ts +7 -7
  32. package/lib/types/engine/ast-node/reference-node.d.ts +8 -8
  33. package/lib/types/engine/ast-node/suffix-node.d.ts +6 -6
  34. package/lib/types/engine/ast-node/union-node.d.ts +4 -4
  35. package/lib/types/engine/ast-node/value-node.d.ts +3 -3
  36. package/lib/types/engine/dependency/dependency-tree.d.ts +2 -2
  37. package/lib/types/engine/dependency/formula-dependency.d.ts +10 -12
  38. package/lib/types/engine/interpreter/interpreter.d.ts +4 -5
  39. package/lib/types/engine/reference-object/base-reference-object.d.ts +6 -6
  40. package/lib/types/engine/reference-object/cell-reference-object.d.ts +3 -3
  41. package/lib/types/engine/reference-object/column-reference-object.d.ts +1 -1
  42. package/lib/types/engine/reference-object/range-reference-object.d.ts +1 -1
  43. package/lib/types/engine/reference-object/row-reference-object.d.ts +1 -1
  44. package/lib/types/engine/reference-object/table-reference-object.d.ts +1 -1
  45. package/lib/types/engine/utils/array-object.d.ts +1 -1
  46. package/lib/types/engine/utils/ast-node-tool.d.ts +1 -1
  47. package/lib/types/engine/utils/node-type.d.ts +3 -3
  48. package/lib/types/engine/utils/numfmt-kit.d.ts +63 -0
  49. package/lib/types/engine/utils/object-compare.d.ts +1 -1
  50. package/lib/types/engine/utils/prefixHandler.d.ts +3 -3
  51. package/lib/types/engine/utils/reference.d.ts +5 -0
  52. package/lib/types/engine/utils/value-object.d.ts +3 -3
  53. package/lib/types/engine/value-object/array-value-object.d.ts +4 -4
  54. package/lib/types/engine/value-object/base-value-object.d.ts +5 -5
  55. package/lib/types/engine/value-object/cube-value-object.d.ts +2 -2
  56. package/lib/types/engine/value-object/lambda-value-object.d.ts +3 -3
  57. package/lib/types/engine/value-object/primitive-object.d.ts +2 -2
  58. package/lib/types/functions/__tests__/create-function-test-bed.d.ts +3 -3
  59. package/lib/types/functions/base-function.d.ts +7 -7
  60. package/lib/types/functions/compatibility/function-map.d.ts +1 -1
  61. package/lib/types/functions/date/date/index.d.ts +3 -1
  62. package/lib/types/functions/date/day/index.d.ts +3 -1
  63. package/lib/types/functions/date/edate/index.d.ts +3 -1
  64. package/lib/types/functions/date/function-map.d.ts +1 -1
  65. package/lib/types/functions/date/month/index.d.ts +3 -1
  66. package/lib/types/functions/date/today/index.d.ts +5 -3
  67. package/lib/types/functions/date/year/index.d.ts +3 -1
  68. package/lib/types/functions/information/function-map.d.ts +1 -1
  69. package/lib/types/functions/information/isblank/index.d.ts +3 -1
  70. package/lib/types/functions/information/iserr/index.d.ts +3 -1
  71. package/lib/types/functions/information/iserror/index.d.ts +3 -1
  72. package/lib/types/functions/information/iseven/iseven.d.ts +4 -2
  73. package/lib/types/functions/information/islogical/index.d.ts +3 -1
  74. package/lib/types/functions/information/isna/index.d.ts +3 -1
  75. package/lib/types/functions/information/isnontext/index.d.ts +3 -1
  76. package/lib/types/functions/information/isnumber/index.d.ts +3 -1
  77. package/lib/types/functions/information/isodd/__tests__/isodd.spec.d.ts +16 -0
  78. package/lib/types/functions/information/isodd/isodd.d.ts +4 -2
  79. package/lib/types/functions/information/isref/index.d.ts +5 -3
  80. package/lib/types/functions/information/istext/index.d.ts +3 -1
  81. package/lib/types/functions/logical/and/index.d.ts +3 -1
  82. package/lib/types/functions/logical/function-map.d.ts +3 -3
  83. package/lib/types/functions/logical/if/index.d.ts +3 -1
  84. package/lib/types/functions/logical/iferror/index.d.ts +4 -2
  85. package/lib/types/functions/logical/lambda/index.d.ts +3 -1
  86. package/lib/types/functions/logical/makearray/index.d.ts +4 -2
  87. package/lib/types/functions/logical/or/index.d.ts +3 -1
  88. package/lib/types/functions/lookup/address/index.d.ts +3 -1
  89. package/lib/types/functions/lookup/column/index.d.ts +4 -2
  90. package/lib/types/functions/lookup/columns/index.d.ts +4 -2
  91. package/lib/types/functions/lookup/function-map.d.ts +10 -10
  92. package/lib/types/functions/lookup/hlookup/index.d.ts +3 -1
  93. package/lib/types/functions/lookup/index/index.d.ts +6 -2
  94. package/lib/types/functions/lookup/indirect/index.d.ts +4 -2
  95. package/lib/types/functions/lookup/lookup/index.d.ts +4 -2
  96. package/lib/types/functions/lookup/match/index.d.ts +4 -2
  97. package/lib/types/functions/lookup/offset/index.d.ts +3 -1
  98. package/lib/types/functions/lookup/row/index.d.ts +4 -2
  99. package/lib/types/functions/lookup/rows/index.d.ts +4 -2
  100. package/lib/types/functions/lookup/vlookup/index.d.ts +4 -2
  101. package/lib/types/functions/lookup/xlookup/index.d.ts +4 -2
  102. package/lib/types/functions/lookup/xmatch/index.d.ts +4 -2
  103. package/lib/types/functions/math/abs/index.d.ts +3 -1
  104. package/lib/types/functions/math/acos/index.d.ts +3 -1
  105. package/lib/types/functions/math/acosh/index.d.ts +3 -1
  106. package/lib/types/functions/math/acot/index.d.ts +3 -1
  107. package/lib/types/functions/math/function-map.d.ts +3 -3
  108. package/lib/types/functions/math/mod/index.d.ts +3 -1
  109. package/lib/types/functions/math/power/index.d.ts +3 -1
  110. package/lib/types/functions/math/product/index.d.ts +3 -1
  111. package/lib/types/functions/math/subtotal/index.d.ts +4 -2
  112. package/lib/types/functions/math/sum/index.d.ts +3 -1
  113. package/lib/types/functions/math/sumif/index.d.ts +1 -1
  114. package/lib/types/functions/math/sumifs/index.d.ts +4 -2
  115. package/lib/types/functions/meta/compare/index.d.ts +4 -2
  116. package/lib/types/functions/meta/cube/index.d.ts +3 -1
  117. package/lib/types/functions/meta/divided/index.d.ts +3 -1
  118. package/lib/types/functions/meta/function-map.d.ts +1 -1
  119. package/lib/types/functions/meta/minus/index.d.ts +3 -1
  120. package/lib/types/functions/meta/multiply/index.d.ts +3 -1
  121. package/lib/types/functions/meta/plus/index.d.ts +3 -1
  122. package/lib/types/functions/statistical/average/index.d.ts +3 -1
  123. package/lib/types/functions/statistical/count/index.d.ts +3 -1
  124. package/lib/types/functions/statistical/counta/index.d.ts +3 -1
  125. package/lib/types/functions/statistical/function-map.d.ts +1 -1
  126. package/lib/types/functions/statistical/max/index.d.ts +3 -1
  127. package/lib/types/functions/statistical/maxifs/index.d.ts +4 -2
  128. package/lib/types/functions/statistical/min/index.d.ts +3 -1
  129. package/lib/types/functions/statistical/stdev-p/index.d.ts +3 -1
  130. package/lib/types/functions/statistical/stdev-s/index.d.ts +3 -1
  131. package/lib/types/functions/statistical/stdeva/index.d.ts +3 -1
  132. package/lib/types/functions/statistical/stdevpa/index.d.ts +3 -1
  133. package/lib/types/functions/statistical/var-p/index.d.ts +3 -1
  134. package/lib/types/functions/statistical/var-s/index.d.ts +3 -1
  135. package/lib/types/functions/statistical/vara/index.d.ts +3 -1
  136. package/lib/types/functions/statistical/varpa/index.d.ts +3 -1
  137. package/lib/types/functions/text/concatenate/index.d.ts +3 -1
  138. package/lib/types/functions/text/function-map.d.ts +1 -1
  139. package/lib/types/functions/text/len/index.d.ts +3 -1
  140. package/lib/types/functions/text/lenb/index.d.ts +3 -1
  141. package/lib/types/functions/text/lower/index.d.ts +3 -1
  142. package/lib/types/functions/text/text/index.d.ts +3 -1
  143. package/lib/types/index.d.ts +2 -1
  144. package/lib/types/models/__tests__/create-command-test-bed.d.ts +1 -1
  145. package/lib/types/models/formula-data.model.d.ts +4 -8
  146. package/lib/types/models/utils/formula-data-util.d.ts +1 -1
  147. package/lib/types/plugin.d.ts +3 -3
  148. package/lib/types/services/active-dirty-manager.service.d.ts +1 -1
  149. package/lib/types/services/calculate-formula.service.d.ts +8 -9
  150. package/lib/types/services/current-data.service.d.ts +1 -1
  151. package/lib/types/services/defined-names.service.d.ts +1 -1
  152. package/lib/types/services/dependency-manager.service.d.ts +1 -1
  153. package/lib/types/services/feature-calculation-manager.service.d.ts +2 -2
  154. package/lib/types/services/function.service.d.ts +3 -3
  155. package/lib/types/services/other-formula-manager.service.d.ts +1 -1
  156. package/lib/types/services/runtime.service.d.ts +4 -4
  157. package/lib/types/services/super-table.service.d.ts +1 -1
  158. package/lib/umd/index.js +1 -1
  159. package/package.json +8 -8
  160. /package/lib/types/{functions/information/iseven/iseven.spec.d.ts → engine/utils/__tests__/numfmt-kit.spec.d.ts} +0 -0
  161. /package/lib/types/functions/information/{isodd/isodd.spec.d.ts → iseven/__tests__/iseven.spec.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
- import { IFormulaIdMap } from './utils/formula-data-util';
2
- import { LexerTreeBuilder } from '../engine/analysis/lexer-tree-builder';
3
- import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap } from '../basics/common';
4
1
  import { ICellData, IObjectMatrixPrimitiveType, IRange, Nullable, Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
2
+ import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap } from '../basics/common';
3
+ import { LexerTreeBuilder } from '../engine/analysis/lexer-tree-builder';
4
+ import { IFormulaIdMap } from './utils/formula-data-util';
5
5
 
6
6
  export interface IRangeChange {
7
7
  oldCell: IRange;
@@ -42,8 +42,4 @@ export declare class FormulaDataModel extends Disposable {
42
42
  getFormulaIdMap(unitId: string, sheetId: string): Map<string, IFormulaIdMap>;
43
43
  getFormulaStringByCell(row: number, column: number, sheetId: string, unitId: string): string | null;
44
44
  }
45
- export declare function initSheetFormulaData(formulaData: IFormulaData, unitId: string, sheetId: string, cellMatrix: ObjectMatrix<Nullable<ICellData>>): {
46
- [x: string]: {
47
- [x: string]: IObjectMatrixPrimitiveType<IFormulaDataItem>;
48
- };
49
- };
45
+ export declare function initSheetFormulaData(formulaData: IFormulaData, unitId: string, sheetId: string, cellMatrix: ObjectMatrix<Nullable<ICellData>>): IFormulaData;
@@ -1,5 +1,5 @@
1
- import { IFormulaDataItem } from '../../basics/common';
2
1
  import { ICellData, IRange, Nullable, ObjectMatrix } from '@univerjs/core';
2
+ import { IFormulaDataItem } from '../../basics/common';
3
3
 
4
4
  export interface IFormulaIdMap {
5
5
  f: string;
@@ -1,7 +1,7 @@
1
- import { BaseFunction } from './functions/base-function';
2
- import { IFunctionNames } from './basics/function';
3
- import { Ctor, Injector } from '@wendellhu/redi';
4
1
  import { Plugin } from '@univerjs/core';
2
+ import { Ctor, Injector } from '@wendellhu/redi';
3
+ import { IFunctionNames } from './basics/function';
4
+ import { BaseFunction } from './functions/base-function';
5
5
 
6
6
  interface IUniverFormulaEngine {
7
7
  notExecuteFormula?: boolean;
@@ -1,5 +1,5 @@
1
- import { IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap } from '../basics/common';
2
1
  import { ICommandInfo, IUnitRange, Nullable, Disposable } from '@univerjs/core';
2
+ import { IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap } from '../basics/common';
3
3
 
4
4
  export interface IDirtyConversionManagerParams {
5
5
  commandId: string;
@@ -1,12 +1,12 @@
1
- import { IAllRuntimeData, IExecutionInProgressParams, IFormulaRuntimeService } from './runtime.service';
2
- import { IFormulaCurrentConfigService } from './current-data.service';
3
- import { Interpreter } from '../engine/interpreter/interpreter';
4
- import { FormulaDependencyGenerator } from '../engine/dependency/formula-dependency';
5
- import { ErrorNode } from '../engine/ast-node/base-ast-node';
6
- import { AstTreeBuilder } from '../engine/analysis/parser';
7
- import { Lexer } from '../engine/analysis/lexer';
8
- import { IFeatureDirtyRangeType, IFormulaDatasetConfig, IRuntimeUnitDataType } from '../basics/common';
9
1
  import { Disposable, IConfigService } from '@univerjs/core';
2
+ import { IFeatureDirtyRangeType, IFormulaDatasetConfig, IRuntimeUnitDataType } from '../basics/common';
3
+ import { Lexer } from '../engine/analysis/lexer';
4
+ import { AstTreeBuilder } from '../engine/analysis/parser';
5
+ import { ErrorNode } from '../engine/ast-node/base-ast-node';
6
+ import { FormulaDependencyGenerator } from '../engine/dependency/formula-dependency';
7
+ import { Interpreter } from '../engine/interpreter/interpreter';
8
+ import { IFormulaCurrentConfigService } from './current-data.service';
9
+ import { IAllRuntimeData, IExecutionInProgressParams, IFormulaRuntimeService } from './runtime.service';
10
10
 
11
11
  export declare const DEFAULT_CYCLE_REFERENCE_COUNT = 1;
12
12
  export declare const CYCLE_REFERENCE_COUNT = "cycleReferenceCount";
@@ -26,7 +26,6 @@ export declare class CalculateFormulaService extends Disposable {
26
26
  private readonly _executionInProgressListener$;
27
27
  readonly executionInProgressListener$: import('rxjs').Observable<IExecutionInProgressParams>;
28
28
  constructor(_configService: IConfigService, _lexer: Lexer, _currentConfigService: IFormulaCurrentConfigService, _runtimeService: IFormulaRuntimeService, _formulaDependencyGenerator: FormulaDependencyGenerator, _interpreter: Interpreter, _astTreeBuilder: AstTreeBuilder);
29
- dispose(): void;
30
29
  /**
31
30
  * Stop the execution of the formula.
32
31
  */
@@ -1,5 +1,5 @@
1
- import { IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
2
1
  import { IUnitRange, Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
2
+ import { IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
3
3
 
4
4
  export declare const DEFAULT_DOCUMENT_SUB_COMPONENT_ID = "__default_document_sub_component_id20231101__";
5
5
  export interface IFormulaCurrentConfigService {
@@ -1,5 +1,5 @@
1
- import { Observable } from 'rxjs';
2
1
  import { IUnitRange, Nullable, Disposable } from '@univerjs/core';
2
+ import { Observable } from 'rxjs';
3
3
 
4
4
  export interface IDefinedNamesServiceParam {
5
5
  id: string;
@@ -1,5 +1,5 @@
1
- import { FormulaDependencyTreeCache, FormulaDependencyTree } from '../engine/dependency/dependency-tree';
2
1
  import { Nullable, Disposable, ObjectMatrix } from '@univerjs/core';
2
+ import { FormulaDependencyTreeCache, FormulaDependencyTree } from '../engine/dependency/dependency-tree';
3
3
 
4
4
  export interface IOtherFormulaDependencyParam {
5
5
  [unitId: string]: Nullable<{
@@ -1,6 +1,6 @@
1
- import { FormulaDependencyTree } from '../engine/dependency/dependency-tree';
2
- import { IFeatureDirtyRangeType, IRuntimeUnitDataType } from '../basics/common';
3
1
  import { IUnitRange, Nullable, Disposable } from '@univerjs/core';
2
+ import { IFeatureDirtyRangeType, IRuntimeUnitDataType } from '../basics/common';
3
+ import { FormulaDependencyTree } from '../engine/dependency/dependency-tree';
4
4
 
5
5
  export interface IFeatureCalculationManagerParam {
6
6
  unitId: string;
@@ -1,7 +1,7 @@
1
- import { BaseFunction } from '../functions/base-function';
2
- import { IFunctionInfo, IFunctionNames } from '../basics/function';
3
- import { IDisposable } from '@wendellhu/redi';
4
1
  import { Nullable, Disposable } from '@univerjs/core';
2
+ import { IDisposable } from '@wendellhu/redi';
3
+ import { IFunctionInfo, IFunctionNames } from '../basics/function';
4
+ import { BaseFunction } from '../functions/base-function';
5
5
 
6
6
  export interface IFunctionService {
7
7
  /**
@@ -1,5 +1,5 @@
1
- import { IDirtyUnitOtherFormulaMap, IFormulaDataItem, IOtherFormulaData } from '../basics/common';
2
1
  import { Nullable, Disposable } from '@univerjs/core';
2
+ import { IDirtyUnitOtherFormulaMap, IFormulaDataItem, IOtherFormulaData } from '../basics/common';
3
3
 
4
4
  export interface IOtherFormulaManagerSearchParam {
5
5
  unitId: string;
@@ -1,8 +1,8 @@
1
- import { IFormulaCurrentConfigService } from './current-data.service';
2
- import { FunctionVariantType } from '../engine/reference-object/base-reference-object';
3
- import { BaseAstNode } from '../engine/ast-node/base-ast-node';
4
- import { IArrayFormulaRangeType, IFeatureDirtyRangeType, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common';
5
1
  import { Nullable, Disposable } from '@univerjs/core';
2
+ import { IArrayFormulaRangeType, IFeatureDirtyRangeType, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common';
3
+ import { BaseAstNode } from '../engine/ast-node/base-ast-node';
4
+ import { FunctionVariantType } from '../engine/reference-object/base-reference-object';
5
+ import { IFormulaCurrentConfigService } from './current-data.service';
6
6
 
7
7
  /**
8
8
  * IDLE: Idle phase of the formula engine.
@@ -1,5 +1,5 @@
1
- import { ISuperTable, TableOptionType } from '../basics/common';
2
1
  import { Nullable, Disposable } from '@univerjs/core';
2
+ import { ISuperTable, TableOptionType } from '../basics/common';
3
3
 
4
4
  export interface ISuperTableOptionParam {
5
5
  tableOption: string;