@univerjs/sheets-formula 0.1.5 → 0.1.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/README.md +21 -15
- package/lib/cjs/index.js +8 -8
- package/lib/es/index.js +2839 -2739
- package/lib/index.css +1 -1
- package/lib/types/controllers/active-dirty.controller.d.ts +4 -2
- package/lib/types/controllers/defined-name.controller.d.ts +27 -0
- package/lib/types/controllers/formula-clipboard.controller.d.ts +1 -0
- package/lib/types/controllers/update-formula.controller.d.ts +1 -3
- package/lib/types/controllers/utils/__tests__/ref-range-formula.spec.d.ts +16 -0
- package/lib/types/controllers/utils/offset-formula-data.d.ts +5 -1
- package/lib/types/controllers/utils/ref-range-formula.d.ts +33 -5
- package/lib/types/index.d.ts +2 -0
- package/lib/types/locale/en-US.d.ts +14 -2
- package/lib/types/locale/function-list/statistical/en-US.d.ts +14 -2
- package/lib/types/locale/function-list/statistical/ja-JP.d.ts +14 -2
- package/lib/types/locale/function-list/statistical/zh-CN.d.ts +14 -2
- package/lib/types/locale/zh-CN.d.ts +14 -2
- package/lib/types/services/description.service.d.ts +18 -0
- package/lib/types/services/formula-ref-range.service.d.ts +17 -0
- package/lib/umd/index.js +8 -8
- package/package.json +25 -25
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-formula-help-function{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-xxs);font-weight:500;color:rgb(var(--text-color));overflow-wrap:anywhere;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-xs);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;white-space:pre-wrap;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-help-param,.univer-formula-help-param-prefix,.univer-formula-help-param-item,.univer-formula-help-param-active{z-index:1}.univer-formula-search-function{
|
|
1
|
+
.univer-formula-help-function{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-xxs);font-weight:500;color:rgb(var(--text-color));overflow-wrap:anywhere;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-xs);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;white-space:pre-wrap;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-help-param,.univer-formula-help-param-prefix,.univer-formula-help-param-item,.univer-formula-help-param-active{z-index:1}.univer-formula-search-function{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);overflow:hidden;overflow-y:auto}.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-xxs)}.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);color:rgb(var(--grey-500))}.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{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>span{display:block}.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}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { FormulaDataModel, IActiveDirtyManagerService } from '@univerjs/engine-formula';
|
|
1
|
+
import { FormulaDataModel, IActiveDirtyManagerService, IDefinedNamesService } from '@univerjs/engine-formula';
|
|
2
2
|
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
export declare class ActiveDirtyController extends Disposable {
|
|
5
5
|
private readonly _activeDirtyManagerService;
|
|
6
6
|
private readonly _currentUniverService;
|
|
7
7
|
private readonly _formulaDataModel;
|
|
8
|
-
|
|
8
|
+
private readonly _definedNamesService;
|
|
9
|
+
constructor(_activeDirtyManagerService: IActiveDirtyManagerService, _currentUniverService: IUniverInstanceService, _formulaDataModel: FormulaDataModel, _definedNamesService: IDefinedNamesService);
|
|
9
10
|
private _initialize;
|
|
10
11
|
private _initialConversion;
|
|
12
|
+
private _getDefinedNameMutation;
|
|
11
13
|
private _getSetRangeValuesMutationDirtyRange;
|
|
12
14
|
private _getMoveRangeMutationDirtyRange;
|
|
13
15
|
private _getMoveRowsMutationDirtyRange;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IDescriptionService } from '../services/description.service';
|
|
2
|
+
import { IDefinedNamesService } from '@univerjs/engine-formula';
|
|
3
|
+
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
4
|
+
|
|
5
|
+
export declare const SCOPE_WORKBOOK_VALUE = "AllDefaultWorkbook";
|
|
6
|
+
/**
|
|
7
|
+
* header highlight
|
|
8
|
+
* column menu: show, hover and mousedown event
|
|
9
|
+
*/
|
|
10
|
+
export declare class DefinedNameController extends Disposable {
|
|
11
|
+
private readonly _descriptionService;
|
|
12
|
+
private readonly _definedNamesService;
|
|
13
|
+
private readonly _univerInstanceService;
|
|
14
|
+
private readonly _commandService;
|
|
15
|
+
private _preUnitId;
|
|
16
|
+
constructor(_descriptionService: IDescriptionService, _definedNamesService: IDefinedNamesService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService);
|
|
17
|
+
private _initialize;
|
|
18
|
+
private _descriptionListener;
|
|
19
|
+
private _changeUnitListener;
|
|
20
|
+
private _changeSheetListener;
|
|
21
|
+
private _registerDescription;
|
|
22
|
+
private _unregisterDescription;
|
|
23
|
+
private _unRegisterDescriptions;
|
|
24
|
+
private _getUnitIdAndSheetId;
|
|
25
|
+
private _registerDescriptions;
|
|
26
|
+
private _unregisterDescriptionsForNotInSheetId;
|
|
27
|
+
}
|
|
@@ -14,6 +14,7 @@ export declare class FormulaClipboardController extends Disposable {
|
|
|
14
14
|
private _registerClipboardHook;
|
|
15
15
|
private _pasteFormulaHook;
|
|
16
16
|
private _pasteWithFormulaHook;
|
|
17
|
+
private _onPasteCells;
|
|
17
18
|
}
|
|
18
19
|
export declare function getSetCellFormulaMutations(unitId: string, subUnitId: string, range: IRange, matrix: ObjectMatrix<ICellDataWithSpanInfo>, accessor: IAccessor, copyInfo: {
|
|
19
20
|
copyType: COPY_TYPE;
|
|
@@ -10,7 +10,7 @@ import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/c
|
|
|
10
10
|
*
|
|
11
11
|
2. Use refRange to offset the formula position and return undo/redo data to setRangeValues mutation
|
|
12
12
|
- Redo data: Delete the old value at the old position on the match, and add the new value at the new position (the new value first checks whether the old position has offset content, if so, use the new offset content, if not, take the old value)
|
|
13
|
-
- Undo data: the old position on the match saves the old value, and the new position
|
|
13
|
+
- Undo data: the old position on the match saves the old value, and the new position delete value. Using undos when undoing will operate the data after the offset position.
|
|
14
14
|
|
|
15
15
|
3. onCommandExecuted, before formula calculation, use the setRangeValues information to delete the old formulaData, ArrayFormula and ArrayFormulaCellData, and send the worker (complementary setRangeValues after collaborative conflicts, normal operation triggers formula update, undo/redo are captured and processed here)
|
|
16
16
|
*/
|
|
@@ -25,7 +25,6 @@ export declare class UpdateFormulaController extends Disposable {
|
|
|
25
25
|
constructor(_currentUniverService: IUniverInstanceService, _commandService: ICommandService, _lexerTreeBuilder: LexerTreeBuilder, _formulaDataModel: FormulaDataModel, _sheetInterceptorService: SheetInterceptorService, _selectionManagerService: SelectionManagerService, _injector: Injector);
|
|
26
26
|
private _initialize;
|
|
27
27
|
private _commandExecutedListener;
|
|
28
|
-
private _handleRedoUndo;
|
|
29
28
|
private _handleSetRangeValuesMutation;
|
|
30
29
|
private _handleRemoveSheetMutation;
|
|
31
30
|
private _handleInsertSheetMutation;
|
|
@@ -43,7 +42,6 @@ export declare class UpdateFormulaController extends Disposable {
|
|
|
43
42
|
private _handleDeleteRangeMoveLeft;
|
|
44
43
|
private _handleSetWorksheetName;
|
|
45
44
|
private _handleRemoveWorksheet;
|
|
46
|
-
private _getUpdateFormulaMutations;
|
|
47
45
|
private _getFormulaReferenceMoveInfo;
|
|
48
46
|
private _getNewRangeByMoveParam;
|
|
49
47
|
private _checkIsSameUnitAndSheet;
|
|
@@ -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 {};
|
|
@@ -15,7 +15,11 @@ export interface IRefRangeWithPosition {
|
|
|
15
15
|
export declare function offsetFormula<T>(formulaData: IFormulaDataGenerics<T>, command: ICommandInfo, unitId: string, sheetId: string, selections?: Readonly<Nullable<ISelectionWithStyle[]>>, formulaRangeData?: IFormulaDataGenerics<IRange>, refRanges?: IRefRangeWithPosition[]): IFormulaDataGenerics<T>;
|
|
16
16
|
export declare function offsetArrayFormula(arrayFormulaRange: IArrayFormulaRangeType, command: ICommandInfo, unitId: string, sheetId: string): IArrayFormulaRangeType;
|
|
17
17
|
export declare function checkFormulaDataNull<T>(formulaData: IFormulaDataGenerics<T>, unitId: string, sheetId: string): boolean;
|
|
18
|
-
export declare function removeFormulaData<T>(formulaData: IFormulaDataGenerics<T>, unitId: string, sheetId: string):
|
|
18
|
+
export declare function removeFormulaData<T>(formulaData: IFormulaDataGenerics<T>, unitId: string, sheetId: string): {
|
|
19
|
+
[x: string]: {
|
|
20
|
+
[x: string]: null;
|
|
21
|
+
};
|
|
22
|
+
} | undefined;
|
|
19
23
|
export declare function removeValueFormulaArray<T>(formulaRange: IRange, formulaMatrix: ObjectMatrix<T>): void;
|
|
20
24
|
export declare function inFormulaRange(row: number, column: number, formulaMatrix?: ObjectMatrix<IRange>): boolean;
|
|
21
25
|
export declare function moveRangeUpdateFormulaData<T>(fromRange: IRange, toRange: IRange, fromArrayFormulaCellDataMatrix: ObjectMatrix<T>, toArrayFormulaCellDataMatrix: ObjectMatrix<T>, arrayFormulaRangeMatrix?: ObjectMatrix<IRange>): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IFormulaData } from '@univerjs/engine-formula';
|
|
2
|
-
import { IMutationInfo, IRange } from '@univerjs/core';
|
|
1
|
+
import { IFormulaData, IFormulaDataItem } from '@univerjs/engine-formula';
|
|
2
|
+
import { ICellData, IMutationInfo, IObjectMatrixPrimitiveType, IRange, Nullable } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
export declare enum FormulaReferenceMoveType {
|
|
5
5
|
MoveRange = 0,// range
|
|
@@ -25,6 +25,18 @@ export interface IFormulaReferenceMoveParam {
|
|
|
25
25
|
to?: IRange;
|
|
26
26
|
sheetName?: string;
|
|
27
27
|
}
|
|
28
|
+
export declare function getFormulaReferenceMoveUndoRedo(oldFormulaData: IFormulaData, newFormulaData: IFormulaData, formulaReferenceMoveParam: IFormulaReferenceMoveParam): {
|
|
29
|
+
undos: IMutationInfo<object>[];
|
|
30
|
+
redos: IMutationInfo<object>[];
|
|
31
|
+
};
|
|
32
|
+
export declare function getFormulaReferenceSheet(oldFormulaData: IFormulaData, newFormulaData: IFormulaData): {
|
|
33
|
+
undos: IMutationInfo<object>[];
|
|
34
|
+
redos: IMutationInfo<object>[];
|
|
35
|
+
};
|
|
36
|
+
export declare function getFormulaReferenceRange(oldFormulaData: IFormulaData, newFormulaData: IFormulaData, formulaReferenceMoveParam: IFormulaReferenceMoveParam): {
|
|
37
|
+
undos: IMutationInfo<object>[];
|
|
38
|
+
redos: IMutationInfo<object>[];
|
|
39
|
+
};
|
|
28
40
|
/**
|
|
29
41
|
* For different Command operations, it may be necessary to perform traversal in reverse or in forward order, so first determine the type of Command and then perform traversal.
|
|
30
42
|
* @param oldFormulaData
|
|
@@ -33,6 +45,22 @@ export interface IFormulaReferenceMoveParam {
|
|
|
33
45
|
* @returns
|
|
34
46
|
*/
|
|
35
47
|
export declare function refRangeFormula(oldFormulaData: IFormulaData, newFormulaData: IFormulaData, formulaReferenceMoveParam: IFormulaReferenceMoveParam): {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
48
|
+
redoFormulaData: IObjectMatrixPrimitiveType<Nullable<ICellData>>;
|
|
49
|
+
undoFormulaData: IObjectMatrixPrimitiveType<Nullable<ICellData>>;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Transfer the formulaDataItem to the cellData
|
|
53
|
+
* ┌────────────────────────────────┬─────────────────┐
|
|
54
|
+
* │ IFormulaDataItem │ ICellData │
|
|
55
|
+
* ├──────────────────┬─────┬───┬───┼───────────┬─────┤
|
|
56
|
+
* │ f │ si │ x │ y │ f │ si │
|
|
57
|
+
* ├──────────────────┼─────┼───┼───┼───────────┼─────┤
|
|
58
|
+
* │ =SUM(1) │ │ │ │ =SUM(1) │ │
|
|
59
|
+
* │ │ id1 │ │ │ │ id1 │
|
|
60
|
+
* │ =SUM(1) │ id1 │ │ │ =SUM(1) │ id1 │
|
|
61
|
+
* │ =SUM(1) │ id1 │ 0 │ 0 │ =SUM(1) │ id1 │
|
|
62
|
+
* │ =SUM(1) │ id1 │ 0 │ 1 │ │ id1 │
|
|
63
|
+
* └──────────────────┴─────┴───┴───┴───────────┴─────┘
|
|
64
|
+
*/
|
|
65
|
+
export declare function formulaDataItemToCellData(formulaDataItem: IFormulaDataItem): ICellData | null;
|
|
66
|
+
export declare function isFormulaDataItem(cell: IFormulaDataItem): boolean;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -21,3 +21,5 @@ export { FormulaCustomFunctionService, IFormulaCustomFunctionService, } from './
|
|
|
21
21
|
export type { IRegisterFunctionParams, IUnregisterFunctionParams } from './services/register-function.service';
|
|
22
22
|
export { RegisterFunctionService } from './services/register-function.service';
|
|
23
23
|
export { IRegisterFunctionService } from './services/register-function.service';
|
|
24
|
+
export { FormulaRefRangeService } from './services/formula-ref-range.service';
|
|
25
|
+
export { SPECIAL_PASTE_FORMULA } from './commands/commands/formula-clipboard.command';
|
|
@@ -5425,11 +5425,23 @@ declare const _default: {
|
|
|
5425
5425
|
url: string;
|
|
5426
5426
|
}[];
|
|
5427
5427
|
functionParameter: {
|
|
5428
|
-
|
|
5428
|
+
maxRange: {
|
|
5429
5429
|
name: string;
|
|
5430
5430
|
detail: string;
|
|
5431
5431
|
};
|
|
5432
|
-
|
|
5432
|
+
criteriaRange1: {
|
|
5433
|
+
name: string;
|
|
5434
|
+
detail: string;
|
|
5435
|
+
};
|
|
5436
|
+
criteria1: {
|
|
5437
|
+
name: string;
|
|
5438
|
+
detail: string;
|
|
5439
|
+
};
|
|
5440
|
+
criteriaRange2: {
|
|
5441
|
+
name: string;
|
|
5442
|
+
detail: string;
|
|
5443
|
+
};
|
|
5444
|
+
criteria2: {
|
|
5433
5445
|
name: string;
|
|
5434
5446
|
detail: string;
|
|
5435
5447
|
};
|
|
@@ -1102,11 +1102,23 @@ declare const _default: {
|
|
|
1102
1102
|
url: string;
|
|
1103
1103
|
}[];
|
|
1104
1104
|
functionParameter: {
|
|
1105
|
-
|
|
1105
|
+
maxRange: {
|
|
1106
1106
|
name: string;
|
|
1107
1107
|
detail: string;
|
|
1108
1108
|
};
|
|
1109
|
-
|
|
1109
|
+
criteriaRange1: {
|
|
1110
|
+
name: string;
|
|
1111
|
+
detail: string;
|
|
1112
|
+
};
|
|
1113
|
+
criteria1: {
|
|
1114
|
+
name: string;
|
|
1115
|
+
detail: string;
|
|
1116
|
+
};
|
|
1117
|
+
criteriaRange2: {
|
|
1118
|
+
name: string;
|
|
1119
|
+
detail: string;
|
|
1120
|
+
};
|
|
1121
|
+
criteria2: {
|
|
1110
1122
|
name: string;
|
|
1111
1123
|
detail: string;
|
|
1112
1124
|
};
|
|
@@ -1102,11 +1102,23 @@ declare const _default: {
|
|
|
1102
1102
|
url: string;
|
|
1103
1103
|
}[];
|
|
1104
1104
|
functionParameter: {
|
|
1105
|
-
|
|
1105
|
+
maxRange: {
|
|
1106
1106
|
name: string;
|
|
1107
1107
|
detail: string;
|
|
1108
1108
|
};
|
|
1109
|
-
|
|
1109
|
+
criteriaRange1: {
|
|
1110
|
+
name: string;
|
|
1111
|
+
detail: string;
|
|
1112
|
+
};
|
|
1113
|
+
criteria1: {
|
|
1114
|
+
name: string;
|
|
1115
|
+
detail: string;
|
|
1116
|
+
};
|
|
1117
|
+
criteriaRange2: {
|
|
1118
|
+
name: string;
|
|
1119
|
+
detail: string;
|
|
1120
|
+
};
|
|
1121
|
+
criteria2: {
|
|
1110
1122
|
name: string;
|
|
1111
1123
|
detail: string;
|
|
1112
1124
|
};
|
|
@@ -1102,11 +1102,23 @@ declare const _default: {
|
|
|
1102
1102
|
url: string;
|
|
1103
1103
|
}[];
|
|
1104
1104
|
functionParameter: {
|
|
1105
|
-
|
|
1105
|
+
maxRange: {
|
|
1106
1106
|
name: string;
|
|
1107
1107
|
detail: string;
|
|
1108
1108
|
};
|
|
1109
|
-
|
|
1109
|
+
criteriaRange1: {
|
|
1110
|
+
name: string;
|
|
1111
|
+
detail: string;
|
|
1112
|
+
};
|
|
1113
|
+
criteria1: {
|
|
1114
|
+
name: string;
|
|
1115
|
+
detail: string;
|
|
1116
|
+
};
|
|
1117
|
+
criteriaRange2: {
|
|
1118
|
+
name: string;
|
|
1119
|
+
detail: string;
|
|
1120
|
+
};
|
|
1121
|
+
criteria2: {
|
|
1110
1122
|
name: string;
|
|
1111
1123
|
detail: string;
|
|
1112
1124
|
};
|
|
@@ -5425,11 +5425,23 @@ declare const _default: {
|
|
|
5425
5425
|
url: string;
|
|
5426
5426
|
}[];
|
|
5427
5427
|
functionParameter: {
|
|
5428
|
-
|
|
5428
|
+
maxRange: {
|
|
5429
5429
|
name: string;
|
|
5430
5430
|
detail: string;
|
|
5431
5431
|
};
|
|
5432
|
-
|
|
5432
|
+
criteriaRange1: {
|
|
5433
|
+
name: string;
|
|
5434
|
+
detail: string;
|
|
5435
|
+
};
|
|
5436
|
+
criteria1: {
|
|
5437
|
+
name: string;
|
|
5438
|
+
detail: string;
|
|
5439
|
+
};
|
|
5440
|
+
criteriaRange2: {
|
|
5441
|
+
name: string;
|
|
5442
|
+
detail: string;
|
|
5443
|
+
};
|
|
5444
|
+
criteria2: {
|
|
5433
5445
|
name: string;
|
|
5434
5446
|
detail: string;
|
|
5435
5447
|
};
|
|
@@ -45,6 +45,21 @@ export interface IDescriptionService {
|
|
|
45
45
|
* @param functionList
|
|
46
46
|
*/
|
|
47
47
|
unregisterDescriptions(functionNames: string[]): void;
|
|
48
|
+
/**
|
|
49
|
+
* check if has description
|
|
50
|
+
* @param name
|
|
51
|
+
*/
|
|
52
|
+
hasDescription(name: string): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* check if has defined name description
|
|
55
|
+
* @param name
|
|
56
|
+
*/
|
|
57
|
+
hasDefinedNameDescription(name: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* check if is formula defined name
|
|
60
|
+
* @param name
|
|
61
|
+
*/
|
|
62
|
+
isFormulaDefinedName(name: string): boolean;
|
|
48
63
|
}
|
|
49
64
|
export declare const IDescriptionService: import('@wendellhu/redi').IdentifierDecorator<IDescriptionService>;
|
|
50
65
|
export declare class DescriptionService implements IDescriptionService, IDisposable {
|
|
@@ -62,6 +77,9 @@ export declare class DescriptionService implements IDescriptionService, IDisposa
|
|
|
62
77
|
getSearchListByType(type: number): ISearchItem[];
|
|
63
78
|
registerDescriptions(description: IFunctionInfo[]): void;
|
|
64
79
|
unregisterDescriptions(functionNames: string[]): void;
|
|
80
|
+
hasDescription(name: string): boolean;
|
|
81
|
+
hasDefinedNameDescription(name: string): boolean;
|
|
82
|
+
isFormulaDefinedName(name: string): boolean;
|
|
65
83
|
private _initialize;
|
|
66
84
|
private _initDescription;
|
|
67
85
|
private _registerDescriptions;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IDisposable } from '@wendellhu/redi';
|
|
2
|
+
import { RefRangeService } from '@univerjs/sheets';
|
|
3
|
+
import { LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
4
|
+
import { IMutationInfo, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
5
|
+
|
|
6
|
+
export type FormulaChangeMap = Record<string, Record<string, Record<string, string>>>;
|
|
7
|
+
export type FormulaChangeCallback = (formulaString: string) => {
|
|
8
|
+
redos: IMutationInfo[];
|
|
9
|
+
undos: IMutationInfo[];
|
|
10
|
+
};
|
|
11
|
+
export declare class FormulaRefRangeService extends Disposable {
|
|
12
|
+
private readonly _refRangeService;
|
|
13
|
+
private readonly _lexerTreeBuilder;
|
|
14
|
+
private readonly _univerInstanceService;
|
|
15
|
+
constructor(_refRangeService: RefRangeService, _lexerTreeBuilder: LexerTreeBuilder, _univerInstanceService: IUniverInstanceService);
|
|
16
|
+
registerFormula(formula: string, callback: FormulaChangeCallback): IDisposable;
|
|
17
|
+
}
|