@univerjs/engine-formula 0.6.6 → 0.6.7
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.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +2302 -2266
- package/lib/types/engine/ast-node/function-node.d.ts +1 -0
- package/lib/types/engine/reference-object/base-reference-object.d.ts +3 -0
- package/lib/types/functions/base-function.d.ts +5 -1
- package/lib/types/functions/math/subtotal/index.d.ts +2 -2
- package/lib/types/index.d.ts +2 -2
- package/lib/types/services/current-data.service.d.ts +5 -1
- package/lib/types/services/sheet-row-filtered.service.d.ts +16 -0
- package/lib/umd/index.js +2 -2
- package/package.json +7 -7
|
@@ -45,6 +45,7 @@ export declare class FunctionNode extends BaseAstNode {
|
|
|
45
45
|
private _setRefData;
|
|
46
46
|
private _setLocale;
|
|
47
47
|
private _setSheetsInfo;
|
|
48
|
+
private _setFilteredOutRows;
|
|
48
49
|
}
|
|
49
50
|
export declare class ErrorFunctionNode extends BaseAstNode {
|
|
50
51
|
constructor(token?: string);
|
|
@@ -16,6 +16,7 @@ export declare class BaseReferenceObject extends ObjectClassType {
|
|
|
16
16
|
private _rangeData;
|
|
17
17
|
private _unitData;
|
|
18
18
|
private _unitStylesData;
|
|
19
|
+
private _filteredOutRows;
|
|
19
20
|
private _defaultUnitId;
|
|
20
21
|
private _forcedUnitId;
|
|
21
22
|
private _runtimeData;
|
|
@@ -67,6 +68,8 @@ export declare class BaseReferenceObject extends ObjectClassType {
|
|
|
67
68
|
setUnitData(unitData: IUnitData): void;
|
|
68
69
|
getUnitStylesData(): IUnitStylesData;
|
|
69
70
|
setUnitStylesData(unitStylesData: IUnitStylesData): void;
|
|
71
|
+
getFilteredOutRows(): number[];
|
|
72
|
+
setFilteredOutRows(filteredOutRows: number[]): void;
|
|
70
73
|
getRuntimeData(): IRuntimeUnitDataType;
|
|
71
74
|
setRuntimeData(runtimeData: IRuntimeUnitDataType): void;
|
|
72
75
|
getArrayFormulaCellData(): IRuntimeUnitDataType;
|
|
@@ -3,10 +3,10 @@ import { IFunctionNames } from '../basics/function';
|
|
|
3
3
|
import { BaseReferenceObject, FunctionVariantType, NodeValueType } from '../engine/reference-object/base-reference-object';
|
|
4
4
|
import { ArrayBinarySearchType, ArrayOrderSearchType } from '../engine/utils/compare';
|
|
5
5
|
import { ArrayValueObject } from '../engine/value-object/array-value-object';
|
|
6
|
+
import { BaseValueObject, ErrorValueObject } from '../engine/value-object/base-value-object';
|
|
6
7
|
import { FormulaFunctionResultValueType, FormulaFunctionValueType } from '../engine/value-object/primitive-object';
|
|
7
8
|
import { FormulaDataModel } from '../models/formula-data.model';
|
|
8
9
|
import { IDefinedNameMapItem } from '../services/defined-names.service';
|
|
9
|
-
import { BaseValueObject, ErrorValueObject } from '../engine/value-object/base-value-object';
|
|
10
10
|
export declare class BaseFunction {
|
|
11
11
|
private _name;
|
|
12
12
|
private _unitId;
|
|
@@ -44,6 +44,10 @@ export declare class BaseFunction {
|
|
|
44
44
|
* Whether the function needs the number of rows and columns in the sheet
|
|
45
45
|
*/
|
|
46
46
|
needsSheetRowColumnCount: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the function needs to filter out rows
|
|
49
|
+
*/
|
|
50
|
+
needsFilteredOutRows: boolean;
|
|
47
51
|
/**
|
|
48
52
|
* Minimum number of parameters
|
|
49
53
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
2
|
-
import { ArrayValueObject } from '../../../engine/value-object/array-value-object';
|
|
3
2
|
import { BaseFunction } from '../../base-function';
|
|
4
3
|
export declare class Subtotal extends BaseFunction {
|
|
5
4
|
minParams: number;
|
|
6
5
|
maxParams: number;
|
|
7
6
|
needsReferenceObject: boolean;
|
|
8
|
-
|
|
7
|
+
needsFilteredOutRows: boolean;
|
|
8
|
+
calculate(functionNum: FunctionVariantType, ...refs: FunctionVariantType[]): FunctionVariantType;
|
|
9
9
|
private _handleSingleObject;
|
|
10
10
|
private _getIndexNumValue;
|
|
11
11
|
private _average;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -104,8 +104,8 @@ export { initSheetFormulaData } from './models/formula-data.model';
|
|
|
104
104
|
export type { IRangeChange } from './models/formula-data.model';
|
|
105
105
|
export { UniverFormulaEnginePlugin } from './plugin';
|
|
106
106
|
export { GlobalComputingStatusService } from './services/global-computing-status.service';
|
|
107
|
-
export { IActiveDirtyManagerService } from './services/active-dirty-manager.service';
|
|
108
|
-
export {
|
|
107
|
+
export { ActiveDirtyManagerService, IActiveDirtyManagerService } from './services/active-dirty-manager.service';
|
|
108
|
+
export { ISheetRowFilteredService, SheetRowFilteredService } from './services/sheet-row-filtered.service';
|
|
109
109
|
export { CalculateFormulaService, ICalculateFormulaService } from './services/calculate-formula.service';
|
|
110
110
|
export { FormulaCurrentConfigService, IFormulaCurrentConfigService, type IFormulaDirtyData } from './services/current-data.service';
|
|
111
111
|
export { DefinedNamesService, type IDefinedNameMapItem, IDefinedNamesService, type IDefinedNamesServiceParam } from './services/defined-names.service';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IUnitRange, LocaleType, Nullable, Disposable, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
2
2
|
import { IArrayFormulaRangeType, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitRowData, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
|
|
3
3
|
import { FormulaDataModel } from '../models/formula-data.model';
|
|
4
|
+
import { ISheetRowFilteredService } from './sheet-row-filtered.service';
|
|
4
5
|
export interface IFormulaDirtyData {
|
|
5
6
|
forceCalculation: boolean;
|
|
6
7
|
dirtyRanges: IUnitRange[];
|
|
@@ -52,11 +53,13 @@ export interface IFormulaCurrentConfigService {
|
|
|
52
53
|
rowCount: number;
|
|
53
54
|
columnCount: number;
|
|
54
55
|
};
|
|
56
|
+
getFilteredOutRows(unitId: string, sheetId: string, startRow: number, endRow: number): number[];
|
|
55
57
|
}
|
|
56
58
|
export declare class FormulaCurrentConfigService extends Disposable implements IFormulaCurrentConfigService {
|
|
57
59
|
private readonly _univerInstanceService;
|
|
58
60
|
private readonly _localeService;
|
|
59
61
|
private readonly _formulaDataModel;
|
|
62
|
+
private readonly _sheetRowFilteredService;
|
|
60
63
|
private _unitData;
|
|
61
64
|
private _unitStylesData;
|
|
62
65
|
private _arrayFormulaCellData;
|
|
@@ -74,7 +77,7 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
|
|
|
74
77
|
private _sheetIdToNameMap;
|
|
75
78
|
private _executeUnitId;
|
|
76
79
|
private _executeSubUnitId;
|
|
77
|
-
constructor(_univerInstanceService: IUniverInstanceService, _localeService: LocaleService, _formulaDataModel: FormulaDataModel);
|
|
80
|
+
constructor(_univerInstanceService: IUniverInstanceService, _localeService: LocaleService, _formulaDataModel: FormulaDataModel, _sheetRowFilteredService: ISheetRowFilteredService);
|
|
78
81
|
dispose(): void;
|
|
79
82
|
getExecuteUnitId(): Nullable<string>;
|
|
80
83
|
getExecuteSubUnitId(): Nullable<string>;
|
|
@@ -106,6 +109,7 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
|
|
|
106
109
|
rowCount: number;
|
|
107
110
|
columnCount: number;
|
|
108
111
|
};
|
|
112
|
+
getFilteredOutRows(unitId: string, sheetId: string, startRow: number, endRow: number): number[];
|
|
109
113
|
load(config: IFormulaDatasetConfig): void;
|
|
110
114
|
getDirtyData(): IFormulaDirtyData;
|
|
111
115
|
loadDirtyRangesAndExcludedCell(dirtyRanges: IUnitRange[], excludedCell?: IUnitExcludedCell): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
type CallbackFunction = (unitId: string, subUnitId: string, row: number) => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* The service that gets the row filter status
|
|
5
|
+
*/
|
|
6
|
+
export interface ISheetRowFilteredService {
|
|
7
|
+
register(callback: CallbackFunction): void;
|
|
8
|
+
getRowFiltered(unitId: string, subUnitId: string, row: number): boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class SheetRowFilteredService extends Disposable implements ISheetRowFilteredService {
|
|
11
|
+
private _getRowFilteredCallback;
|
|
12
|
+
register(callback: CallbackFunction): void;
|
|
13
|
+
getRowFiltered(unitId: string, subUnitId: string, row: number): boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const ISheetRowFilteredService: import('@wendellhu/redi').IdentifierDecorator<SheetRowFilteredService>;
|
|
16
|
+
export {};
|