@univerjs/engine-formula
Advanced tools
Comparing version 0.1.0-beta.4 to 0.1.0-beta.5
@@ -100,2 +100,7 @@ /** | ||
} | ||
export interface INumfmtItemMap { | ||
[unitId: string]: Nullable<{ | ||
[sheetId: string]: IObjectMatrixPrimitiveType<Nullable<string>>; | ||
}>; | ||
} | ||
/** | ||
@@ -135,2 +140,3 @@ * @f formulaString, the text string of the formula. | ||
dirtyUnitFeatureMap: IDirtyUnitFeatureMap; | ||
numfmtItemMap: INumfmtItemMap; | ||
excludedCell?: IUnitExcludedCell; | ||
@@ -137,0 +143,0 @@ allUnitData?: IUnitData; |
@@ -18,2 +18,5 @@ /** | ||
export declare class ObjectClassType extends Disposable { | ||
pattern: string; | ||
getPattern(): string; | ||
setPattern(pattern: string): void; | ||
isError(): boolean; | ||
@@ -20,0 +23,0 @@ isAsyncObject(): boolean; |
@@ -17,3 +17,3 @@ /** | ||
import type { IExecutionOptions, IMutation, IUnitRange, Nullable } from '@univerjs/core'; | ||
import type { IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../../basics/common'; | ||
import type { IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, INumfmtItemMap, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../../basics/common'; | ||
import type { FormulaExecutedStateType, IExecutionInProgressParams } from '../../services/runtime.service'; | ||
@@ -25,2 +25,3 @@ export interface ISetFormulaCalculationStartMutation { | ||
options: Nullable<IExecutionOptions>; | ||
numfmtItemMap: INumfmtItemMap; | ||
forceCalculation?: boolean; | ||
@@ -27,0 +28,0 @@ } |
@@ -34,2 +34,14 @@ /** | ||
execute(): void; | ||
/** | ||
* Compatibility handling for special functions. | ||
*/ | ||
private _compatibility; | ||
/** | ||
* The LOOKUP function follows the following rules when dealing with vectors of different sizes: | ||
* If the lookup_vector is larger than the result_vector, | ||
* the LOOKUP function will ignore the extra portion of the lookup_vector and only use the portion of the result_vector that is the same size as the lookup_vector for lookup and returning results. | ||
* If the lookup_vector is smaller than the result_vector, | ||
* the LOOKUP function will continue using the last value of the result_vector for lookup and returning results after the last value of the lookup_vector. | ||
*/ | ||
private _lookupCompatibility; | ||
private _calculate; | ||
@@ -36,0 +48,0 @@ private _setRefInfo; |
@@ -18,3 +18,3 @@ /** | ||
import { FormulaAstLRU } from '../../basics/cache-lru'; | ||
import type { IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap } from '../../basics/common'; | ||
import type { INumfmtItemMap, IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap } from '../../basics/common'; | ||
import { ObjectClassType } from '../../basics/object-class-type'; | ||
@@ -40,2 +40,3 @@ import { ArrayValueObject } from '../value-object/array-value-object'; | ||
private _runtimeFeatureCellData; | ||
private _numfmtItemData; | ||
private _refOffsetX; | ||
@@ -89,2 +90,4 @@ private _refOffsetY; | ||
}): void; | ||
getNumfmtItemData(): INumfmtItemMap; | ||
setNumfmtItemData(numfmtItemData: INumfmtItemMap): void; | ||
getRowCount(): number; | ||
@@ -91,0 +94,0 @@ getColumnCount(): number; |
@@ -161,2 +161,10 @@ /** | ||
var(): BaseValueObject; | ||
/** | ||
* STDEV.P: ddof=0, ignore strings and booleans | ||
* STDEV.S: ddof=1, ignore strings and booleans | ||
* | ||
* STDEVPA: ddof=0, | ||
* STDEVA: ddof=1, | ||
* @returns | ||
*/ | ||
std(): BaseValueObject; | ||
@@ -163,0 +171,0 @@ log(): BaseValueObject; |
@@ -66,2 +66,9 @@ /** | ||
getZeroOrOneByOneDefault(logicValueObject?: BaseValueObject): number | undefined; | ||
/** | ||
* A logical value that specifies 1/TRUE , 0/FALSE, -1, default 1. | ||
* The difference from getZeroOrOneByOneDefault is that we need to get -1 | ||
* @param logicValueObject | ||
* @returns | ||
*/ | ||
getMatchTypeValue(logicValueObject?: BaseValueObject): number | undefined; | ||
binarySearch(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, searchType?: ArrayBinarySearchType): BaseValueObject; | ||
@@ -68,0 +75,0 @@ equalSearch(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, isFirst?: boolean): BaseValueObject; |
@@ -16,2 +16,4 @@ /** | ||
*/ | ||
export declare const functionDate: never[]; | ||
import { DateFunction } from './date'; | ||
import { FUNCTION_NAMES_DATE } from './function-names'; | ||
export declare const functionDate: (FUNCTION_NAMES_DATE | typeof DateFunction)[][]; |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { type BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
@@ -19,0 +19,0 @@ export declare class Isblank extends BaseFunction { |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { type BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
@@ -19,0 +19,0 @@ export declare class Iferror extends BaseFunction { |
@@ -16,7 +16,6 @@ /** | ||
*/ | ||
import { type BaseValueObject, ErrorValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { StringValueObject } from '../../../engine/value-object/primitive-object'; | ||
import { type BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
export declare class Address extends BaseFunction { | ||
calculate(rowNumber: BaseValueObject, columnNumber: BaseValueObject, absNumber?: BaseValueObject, a1?: BaseValueObject, sheetText?: BaseValueObject): ErrorValueObject | StringValueObject; | ||
calculate(rowNumber: BaseValueObject, columnNumber: BaseValueObject, absNumber?: BaseValueObject, a1?: BaseValueObject, sheetText?: BaseValueObject): BaseValueObject; | ||
} |
@@ -18,8 +18,5 @@ /** | ||
import { FUNCTION_NAMES_LOOKUP } from './function-names'; | ||
import { Hlookup } from './hlookup'; | ||
import { Indirect } from './indirect'; | ||
import { Lookup } from './lookup'; | ||
import { Offset } from './offset'; | ||
import { Vlookup } from './vlookup'; | ||
import { Xlookup } from './xlookup'; | ||
export declare const functionLookup: ((FUNCTION_NAMES_LOOKUP | typeof Address)[] | (FUNCTION_NAMES_LOOKUP | typeof Indirect)[] | (FUNCTION_NAMES_LOOKUP | typeof Offset)[] | (FUNCTION_NAMES_LOOKUP | typeof Vlookup)[] | (FUNCTION_NAMES_LOOKUP | typeof Lookup)[] | (FUNCTION_NAMES_LOOKUP | typeof Hlookup)[] | (FUNCTION_NAMES_LOOKUP | typeof Xlookup)[])[]; | ||
export declare const functionLookup: ((FUNCTION_NAMES_LOOKUP | typeof Address)[] | (FUNCTION_NAMES_LOOKUP | typeof Indirect)[] | (FUNCTION_NAMES_LOOKUP | typeof Offset)[] | (FUNCTION_NAMES_LOOKUP | typeof Xlookup)[])[]; |
@@ -16,5 +16,5 @@ /** | ||
*/ | ||
import type { ArrayValueObject } from '../../..'; | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
import type { ArrayValueObject } from '../../../engine/value-object/array-value-object'; | ||
export declare class Lookup extends BaseFunction { | ||
@@ -21,0 +21,0 @@ calculate(lookupValue: BaseValueObject, lookupVectorOrArray: ArrayValueObject, resultVector?: BaseValueObject): BaseValueObject; |
@@ -18,7 +18,6 @@ /** | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { ErrorValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
export declare class Offset extends BaseFunction { | ||
calculate(reference: BaseValueObject, rows: BaseValueObject, columns: BaseValueObject, height?: BaseValueObject, width?: BaseValueObject): ErrorValueObject | BaseReferenceObject; | ||
calculate(reference: BaseValueObject, rows: BaseValueObject, columns: BaseValueObject, height?: BaseValueObject, width?: BaseValueObject): BaseValueObject | BaseReferenceObject; | ||
private _setDefault; | ||
} |
@@ -16,7 +16,6 @@ /** | ||
*/ | ||
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object'; | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
export declare class Abs extends BaseFunction { | ||
calculate(variant: FunctionVariantType): BaseValueObject; | ||
calculate(variant: BaseValueObject): BaseValueObject; | ||
} |
@@ -16,7 +16,6 @@ /** | ||
*/ | ||
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object'; | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
export declare class Acos extends BaseFunction { | ||
calculate(variant: FunctionVariantType): BaseValueObject; | ||
calculate(variant: BaseValueObject): BaseValueObject; | ||
} |
@@ -16,7 +16,6 @@ /** | ||
*/ | ||
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object'; | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
export declare class Acosh extends BaseFunction { | ||
calculate(variant: FunctionVariantType): BaseValueObject; | ||
calculate(variant: BaseValueObject): BaseValueObject; | ||
} |
@@ -16,7 +16,6 @@ /** | ||
*/ | ||
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object'; | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
export declare class Acot extends BaseFunction { | ||
calculate(variant: FunctionVariantType): BaseValueObject; | ||
calculate(variant: BaseValueObject): BaseValueObject; | ||
} |
@@ -17,3 +17,3 @@ /** | ||
import { compareToken } from '../../../basics/token'; | ||
import { type BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
@@ -20,0 +20,0 @@ export declare class Compare extends BaseFunction { |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
import { type BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
@@ -19,0 +19,0 @@ export declare class Multiply extends BaseFunction { |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { type BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
@@ -19,0 +19,0 @@ export declare class Average extends BaseFunction { |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { type BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
@@ -19,0 +19,0 @@ export declare class Count extends BaseFunction { |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { type BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
@@ -19,0 +19,0 @@ export declare class CountA extends BaseFunction { |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
import type { BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { type BaseValueObject } from '../../../engine/value-object/base-value-object'; | ||
import { BaseFunction } from '../../base-function'; | ||
@@ -19,0 +19,0 @@ export declare class Max extends BaseFunction { |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
export type { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitSheetNameMap, } from './basics/common'; | ||
export type { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitSheetNameMap, INumfmtItemMap, } from './basics/common'; | ||
export { isInDirtyRange } from './basics/dirty'; | ||
@@ -90,1 +90,3 @@ export { ErrorType } from './basics/error-type'; | ||
export { FormulaExecutedStateType, type IAllRuntimeData } from './services/runtime.service'; | ||
export { SetNumfmtFormulaDataMutation } from './commands/mutations/set-numfmt-formula-data.mutation'; | ||
export type { ISetNumfmtFormulaDataMutationParams } from './commands/mutations/set-numfmt-formula-data.mutation'; |
@@ -18,3 +18,3 @@ /** | ||
import { Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core'; | ||
import type { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap } from '../basics/common'; | ||
import type { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, INumfmtItemMap, IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap } from '../basics/common'; | ||
import { LexerTreeBuilder } from '../engine/analysis/lexer-tree-builder'; | ||
@@ -32,2 +32,3 @@ export interface IFormulaIdMap { | ||
private _arrayFormulaCellData; | ||
private _numfmtItemMap; | ||
constructor(_currentUniverService: IUniverInstanceService, _lexerTreeBuilder: LexerTreeBuilder); | ||
@@ -38,6 +39,10 @@ clearPreviousArrayFormulaCellData(clearArrayFormulaCellData: IRuntimeUnitDataType): void; | ||
setFormulaData(value: IFormulaData): void; | ||
getArrayFormulaRange(): IArrayFormulaRangeType; | ||
setArrayFormulaRange(value: IArrayFormulaRangeType): void; | ||
getArrayFormulaRange(): IArrayFormulaRangeType; | ||
getArrayFormulaCellData(): IArrayFormulaUnitCellType; | ||
setArrayFormulaCellData(value: IArrayFormulaUnitCellType): void; | ||
getArrayFormulaCellData(): IArrayFormulaUnitCellType; | ||
getNumfmtItemMap(): INumfmtItemMap; | ||
getNumfmtValue(unitId: string, sheetId: string, row: number, column: number): Nullable<string>; | ||
setNumfmtItemMap(value: INumfmtItemMap): void; | ||
updateNumfmtItemMap(value: INumfmtItemMap): void; | ||
mergeArrayFormulaRange(formulaData: IArrayFormulaRangeType): void; | ||
@@ -53,2 +58,3 @@ deleteArrayFormulaRange(unitId: string, sheetId: string, row: number, column: number): void; | ||
updateArrayFormulaCellData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void; | ||
updateNumfmtData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void; | ||
getFormulaItemBySId(sId: string, sheetId: string, unitId: string): Nullable<IFormulaDataItem>; | ||
@@ -55,0 +61,0 @@ getFormulaDataItem(row: number, column: number, sheetId: string, unitId: string): IFormulaDataItem | undefined; |
@@ -18,3 +18,3 @@ /** | ||
import { Disposable, IUniverInstanceService } from '@univerjs/core'; | ||
import type { IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitSheetNameMap } from '../basics/common'; | ||
import type { IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, INumfmtItemMap, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitSheetNameMap } from '../basics/common'; | ||
export declare const DEFAULT_DOCUMENT_SUB_COMPONENT_ID = "__default_document_sub_component_id20231101__"; | ||
@@ -46,2 +46,3 @@ export interface IFormulaCurrentConfigService { | ||
private _dirtyNameMap; | ||
private _numfmtItemMap; | ||
private _dirtyUnitFeatureMap; | ||
@@ -59,2 +60,3 @@ private _excludedCell; | ||
getDirtyNameMap(): IDirtyUnitSheetNameMap; | ||
getNumfmtItemMap(): INumfmtItemMap; | ||
getDirtyUnitFeatureMap(): IDirtyUnitFeatureMap; | ||
@@ -61,0 +63,0 @@ load(config: IFormulaDatasetConfig): void; |
@@ -18,5 +18,5 @@ /** | ||
import { Disposable } from '@univerjs/core'; | ||
import type { IArrayFormulaRangeType, IFeatureDirtyRangeType, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common'; | ||
import type { IArrayFormulaRangeType, IFeatureDirtyRangeType, INumfmtItemMap, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common'; | ||
import type { BaseAstNode } from '../engine/ast-node/base-ast-node'; | ||
import { type FunctionVariantType } from '../engine/reference-object/base-reference-object'; | ||
import type { FunctionVariantType } from '../engine/reference-object/base-reference-object'; | ||
import { IFormulaCurrentConfigService } from './current-data.service'; | ||
@@ -55,2 +55,3 @@ /** | ||
clearArrayFormulaCellData: IRuntimeUnitDataType; | ||
numfmtItemMap: INumfmtItemMap; | ||
runtimeFeatureRange: { | ||
@@ -131,2 +132,3 @@ [featureId: string]: IFeatureDirtyRangeType; | ||
private _runtimeClearArrayFormulaCellData; | ||
private _numfmtItemMap; | ||
private _runtimeFeatureRange; | ||
@@ -177,2 +179,3 @@ private _runtimeFeatureCellData; | ||
getUnitArrayFormula(): IArrayFormulaRangeType; | ||
getNumfmtItemMap(): INumfmtItemMap; | ||
getRuntimeOtherData(): IRuntimeOtherUnitDataType; | ||
@@ -179,0 +182,0 @@ getRuntimeArrayFormulaCellData(): IRuntimeUnitDataType; |
{ | ||
"name": "@univerjs/engine-formula", | ||
"version": "0.1.0-beta.4", | ||
"version": "0.1.0-beta.5", | ||
"private": false, | ||
@@ -8,2 +8,14 @@ "description": "UniverSheet normal base-formula-engine", | ||
"license": "Apache-2.0", | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/univer" | ||
}, | ||
"homepage": "https://univer.ai", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/dream-num/univer" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/dream-num/univer/issues" | ||
}, | ||
"keywords": [], | ||
@@ -20,3 +32,4 @@ "exports": { | ||
"types": "./lib/types/index.d.ts" | ||
} | ||
}, | ||
"./lib/*": "./lib/*" | ||
}, | ||
@@ -40,5 +53,5 @@ "main": "./lib/cjs/index.js", | ||
"peerDependencies": { | ||
"@wendellhu/redi": ">=0.12.13", | ||
"@wendellhu/redi": "^0.13.0", | ||
"rxjs": ">=7.0.0", | ||
"@univerjs/core": "0.1.0-beta.4" | ||
"@univerjs/core": "0.1.0-beta.5" | ||
}, | ||
@@ -50,10 +63,10 @@ "dependencies": { | ||
"@types/big.js": "^6.2.2", | ||
"@wendellhu/redi": "^0.12.13", | ||
"@wendellhu/redi": "^0.13.0", | ||
"less": "^4.2.0", | ||
"rxjs": "^7.8.1", | ||
"typescript": "^5.3.3", | ||
"vite": "^5.0.12", | ||
"vitest": "^1.2.1", | ||
"@univerjs/core": "0.1.0-beta.4", | ||
"@univerjs/shared": "0.1.0-beta.4" | ||
"vite": "^5.1.4", | ||
"vitest": "^1.3.1", | ||
"@univerjs/shared": "0.1.0-beta.5", | ||
"@univerjs/core": "0.1.0-beta.5" | ||
}, | ||
@@ -60,0 +73,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
945735
225
16794
0
3
0