@univerjs/sheets 0.2.12 → 0.2.14
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 +3 -3
- package/lib/es/index.js +41 -48
- package/lib/types/basics/__tests__/cell-custom.spec.d.ts +16 -0
- package/lib/types/basics/cell-custom.d.ts +12 -0
- package/lib/types/commands/mutations/set-range-values.mutation.d.ts +0 -4
- package/lib/types/controllers/__tests__/util.d.ts +6 -6
- package/lib/types/services/__tests__/util.d.ts +6 -6
- package/lib/types/services/exclusive-range/exclusive-range-service.d.ts +1 -1
- package/lib/types/services/numfmt/type.d.ts +1 -1
- package/lib/types/services/permission/permission-point/range/edit.d.ts +1 -1
- package/lib/types/services/ref-range/__tests__/__testing__.d.ts +6 -6
- package/lib/types/services/ref-range/__tests__/ref-range.service.spec.d.ts +6 -6
- package/lib/types/services/selections/ref-selections.service.d.ts +1 -1
- package/lib/types/services/selections/selection-manager.service.d.ts +2 -2
- package/lib/types/services/sheet-interceptor/__tests__/create-core-test-bed.d.ts +6 -6
- package/lib/types/sheets-plugin.d.ts +1 -1
- package/lib/umd/index.js +3 -3
- package/package.json +14 -14
package/lib/es/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
5
|
-
import { RxDisposable, UniverInstanceType, Disposable, IUniverInstanceService, createInterceptorKey, toDisposable, remove, composeInterceptors, DisposableCollection, Tools, normalizeTextRuns, CellValueType,
|
|
5
|
+
import { RxDisposable, UniverInstanceType, Disposable, IUniverInstanceService, createInterceptorKey, toDisposable, remove, composeInterceptors, DisposableCollection, Tools, normalizeTextRuns, CellValueType, isRealNum, isBooleanString, isSafeNumeric, CommandType, ObjectMatrix, ICommandService, IUndoRedoService, sequenceExecute, LocaleService, createIdentifier, IContextService, selectionToArray, Rectangle, RANGE_TYPE, ErrorService, Range, cellToRange, PermissionStatus, IPermissionService, isICellData, Dimension, getArrayLength, insertMatrixArray, spliceArray, sliceMatrixArray, concatMatrixArray, BooleanNumber, Direction, mergeWorksheetSnapshotWithDefault, moveMatrixArray, BorderType, BorderStyleTypes, FontWeight, FontItalic, runOnLifecycle, LifecycleStages, OnLifecycle, Inject, Injector, IResourceManagerService, Optional, IConfigService, queryObjectMatrix, InterceptorManager, ILogService, LRUMap, DependentOn, Plugin, mergeOverrideWithDependencies, ColorKit, getCellInfoInMergeData, makeCellRangeToRangeData, createRowColIter } from "@univerjs/core";
|
|
6
6
|
import { SetDefinedNameMutation, RemoveDefinedNameMutation, SetFormulaCalculationResultMutation, handleNumfmtInCell, IDefinedNamesService, stripErrorMargin, UniverFormulaEnginePlugin } from "@univerjs/engine-formula";
|
|
7
7
|
import { DataSyncPrimaryController } from "@univerjs/rpc";
|
|
8
8
|
import { shareReplay, takeUntil, switchMap, of, Subject, BehaviorSubject, merge, map } from "rxjs";
|
|
@@ -64,8 +64,8 @@ let SheetsSelectionsService = (_a = class extends RxDisposable {
|
|
|
64
64
|
this._ensureWorkbookSelection(unitId).addSelections(sheetId, unitIdOrSelections);
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
|
-
* Set
|
|
68
|
-
* If type is not
|
|
67
|
+
* Set selection data to WorkbookSelections.
|
|
68
|
+
* If type is not specified, this method would clear all existing selections.
|
|
69
69
|
* @param unitIdOrSelections
|
|
70
70
|
* @param worksheetIdOrType
|
|
71
71
|
* @param selectionDatas
|
|
@@ -165,7 +165,7 @@ const _WorkbookSelections = class _WorkbookSelections extends Disposable {
|
|
|
165
165
|
* @param selectionDatas
|
|
166
166
|
* @param type
|
|
167
167
|
*/
|
|
168
|
-
setSelections(sheetId, selectionDatas, type) {
|
|
168
|
+
setSelections(sheetId, selectionDatas = [], type) {
|
|
169
169
|
switch (this._ensureSheetSelection(sheetId).length = 0, this._ensureSheetSelection(sheetId).push(...selectionDatas), type) {
|
|
170
170
|
case 0:
|
|
171
171
|
this._selectionMoveStart$.next(selectionDatas);
|
|
@@ -397,10 +397,6 @@ function handleStyle(styles, oldVal, newVal) {
|
|
|
397
397
|
}
|
|
398
398
|
__name(handleStyle, "handleStyle");
|
|
399
399
|
function transformStyle(oldStyle, newStyle) {
|
|
400
|
-
return transformNormalKey(oldStyle, newStyle);
|
|
401
|
-
}
|
|
402
|
-
__name(transformStyle, "transformStyle");
|
|
403
|
-
function transformNormalKey(oldStyle, newStyle) {
|
|
404
400
|
if (!newStyle || !Object.keys(newStyle).length)
|
|
405
401
|
return oldStyle;
|
|
406
402
|
const backupStyle = oldStyle || {};
|
|
@@ -408,7 +404,7 @@ function transformNormalKey(oldStyle, newStyle) {
|
|
|
408
404
|
k === "bd" ? backupStyle[k] = transformBorders(backupStyle[k] || {}, newStyle[k]) : k in backupStyle || (backupStyle[k] = null);
|
|
409
405
|
return backupStyle;
|
|
410
406
|
}
|
|
411
|
-
__name(
|
|
407
|
+
__name(transformStyle, "transformStyle");
|
|
412
408
|
function transformBorders(oldBorders, newBorders) {
|
|
413
409
|
if (!newBorders || !Object.keys(newBorders).length)
|
|
414
410
|
return oldBorders;
|
|
@@ -421,11 +417,9 @@ function mergeStyle(oldStyle, newStyle, isRichText = !1) {
|
|
|
421
417
|
if (newStyle === null) return newStyle;
|
|
422
418
|
if (newStyle === void 0) return oldStyle;
|
|
423
419
|
const backupStyle = Tools.deepClone(oldStyle) || {};
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
return "cl" in backupStyle && ("ul" in backupStyle && backupStyle.ul && (backupStyle.ul.cl = backupStyle.cl), "ol" in backupStyle && backupStyle.ol && (backupStyle.ol.cl = backupStyle.cl), "st" in backupStyle && backupStyle.st && (backupStyle.st.cl = backupStyle.cl)), backupStyle;
|
|
428
|
-
}
|
|
420
|
+
for (const k in newStyle)
|
|
421
|
+
isRichText && ["bd", "tr", "td", "ht", "vt", "tb", "pd", "bg"].includes(k) || (k in backupStyle && k === "bd" ? backupStyle[k] = Object.assign(backupStyle[k], newStyle[k]) : backupStyle[k] = newStyle[k]);
|
|
422
|
+
return "cl" in backupStyle && ("ul" in backupStyle && backupStyle.ul && (backupStyle.ul.cl = backupStyle.cl), "ol" in backupStyle && backupStyle.ol && (backupStyle.ol.cl = backupStyle.cl), "st" in backupStyle && backupStyle.st && (backupStyle.st.cl = backupStyle.cl)), backupStyle;
|
|
429
423
|
}
|
|
430
424
|
__name(mergeStyle, "mergeStyle");
|
|
431
425
|
function skipParagraphs(paragraphs, offset) {
|
|
@@ -463,36 +457,6 @@ function mergeRichTextStyle(p, newStyle) {
|
|
|
463
457
|
p.body.textRuns = normalizeTextRuns(newTextRuns);
|
|
464
458
|
}
|
|
465
459
|
__name(mergeRichTextStyle, "mergeRichTextStyle");
|
|
466
|
-
function getCellValue(type, cell) {
|
|
467
|
-
return type === CellValueType.NUMBER ? Number(cell.v) : type === CellValueType.BOOLEAN ? extractBooleanValue(cell.v) ? 1 : 0 : type === CellValueType.STRING || type === CellValueType.FORCE_STRING ? `${cell.v}` : cell.v;
|
|
468
|
-
}
|
|
469
|
-
__name(getCellValue, "getCellValue");
|
|
470
|
-
function extractBooleanValue(value) {
|
|
471
|
-
if (typeof value == "string") {
|
|
472
|
-
if (value.toUpperCase() === "TRUE")
|
|
473
|
-
return !0;
|
|
474
|
-
if (value.toUpperCase() === "FALSE")
|
|
475
|
-
return !1;
|
|
476
|
-
if (isSafeNumeric(value)) {
|
|
477
|
-
if (Number(value) === 0)
|
|
478
|
-
return !1;
|
|
479
|
-
if (Number(value) === 1)
|
|
480
|
-
return !0;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
if (typeof value == "number") {
|
|
484
|
-
if (value === 0)
|
|
485
|
-
return !1;
|
|
486
|
-
if (value === 1)
|
|
487
|
-
return !0;
|
|
488
|
-
}
|
|
489
|
-
return typeof value == "boolean" ? value : null;
|
|
490
|
-
}
|
|
491
|
-
__name(extractBooleanValue, "extractBooleanValue");
|
|
492
|
-
function setNull(value) {
|
|
493
|
-
return value == null ? null : (value.f === void 0 && (value.f = null), value.si === void 0 && (value.si = null), value.p === void 0 && (value.p = null), value.v === void 0 && (value.v = null), value.t === void 0 && (value.t = null), value.s === void 0 && (value.s = null), value.custom === void 0 && (value.custom = null), value);
|
|
494
|
-
}
|
|
495
|
-
__name(setNull, "setNull");
|
|
496
460
|
function getCellType(styles, newVal, oldVal) {
|
|
497
461
|
if (newVal.t) return newVal.t;
|
|
498
462
|
if (newVal.v === null) return null;
|
|
@@ -531,6 +495,36 @@ function getCellTypeByPattern(cell, pattern) {
|
|
|
531
495
|
return cell.t === CellValueType.FORCE_STRING ? CellValueType.FORCE_STRING : pattern === DEFAULT_TEXT_FORMAT ? CellValueType.STRING : checkCellValueType(cell.v, cell.t);
|
|
532
496
|
}
|
|
533
497
|
__name(getCellTypeByPattern, "getCellTypeByPattern");
|
|
498
|
+
function getCellValue(type, cell) {
|
|
499
|
+
return type === CellValueType.NUMBER ? Number(cell.v) : type === CellValueType.BOOLEAN ? extractBooleanValue(cell.v) ? 1 : 0 : type === CellValueType.STRING || type === CellValueType.FORCE_STRING ? `${cell.v}` : cell.v;
|
|
500
|
+
}
|
|
501
|
+
__name(getCellValue, "getCellValue");
|
|
502
|
+
function extractBooleanValue(value) {
|
|
503
|
+
if (typeof value == "string") {
|
|
504
|
+
if (value.toUpperCase() === "TRUE")
|
|
505
|
+
return !0;
|
|
506
|
+
if (value.toUpperCase() === "FALSE")
|
|
507
|
+
return !1;
|
|
508
|
+
if (isSafeNumeric(value)) {
|
|
509
|
+
if (Number(value) === 0)
|
|
510
|
+
return !1;
|
|
511
|
+
if (Number(value) === 1)
|
|
512
|
+
return !0;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
if (typeof value == "number") {
|
|
516
|
+
if (value === 0)
|
|
517
|
+
return !1;
|
|
518
|
+
if (value === 1)
|
|
519
|
+
return !0;
|
|
520
|
+
}
|
|
521
|
+
return typeof value == "boolean" ? value : null;
|
|
522
|
+
}
|
|
523
|
+
__name(extractBooleanValue, "extractBooleanValue");
|
|
524
|
+
function setNull(value) {
|
|
525
|
+
return value == null ? null : (value.f === void 0 && (value.f = null), value.si === void 0 && (value.si = null), value.p === void 0 && (value.p = null), value.v === void 0 && (value.v = null), value.t === void 0 && (value.t = null), value.s === void 0 && (value.s = null), value.custom === void 0 && (value.custom = null), value);
|
|
526
|
+
}
|
|
527
|
+
__name(setNull, "setNull");
|
|
534
528
|
const SetRangeValuesUndoMutationFactory = /* @__PURE__ */ __name((accessor, params) => {
|
|
535
529
|
const { unitId, subUnitId, cellValue } = params, workbook = accessor.get(IUniverInstanceService).getUniverSheetInstance(unitId);
|
|
536
530
|
if (workbook == null)
|
|
@@ -540,9 +534,8 @@ const SetRangeValuesUndoMutationFactory = /* @__PURE__ */ __name((accessor, para
|
|
|
540
534
|
throw new Error("worksheet is null error!");
|
|
541
535
|
const cellMatrix = worksheet.getCellMatrix(), styles = workbook.getStyles(), undoData = new ObjectMatrix();
|
|
542
536
|
return new ObjectMatrix(cellValue).forValue((row, col, newVal) => {
|
|
543
|
-
const cell = Tools.deepClone(cellMatrix == null ? void 0 : cellMatrix.getValue(row, col)) || {}, oldStyle = styles.getStyleByCell(cell);
|
|
544
|
-
|
|
545
|
-
newStyle = transformStyle(oldStyle, newStyle), cell.s = newStyle, undoData.setValue(row, col, setNull(cell));
|
|
537
|
+
const cell = Tools.deepClone(cellMatrix == null ? void 0 : cellMatrix.getValue(row, col)) || {}, oldStyle = styles.getStyleByCell(cell), newStyle = styles.getStyleByCell(newVal);
|
|
538
|
+
cell.s = transformStyle(oldStyle, newStyle), undoData.setValue(row, col, setNull(cell));
|
|
546
539
|
}), {
|
|
547
540
|
...params,
|
|
548
541
|
options: {},
|
|
@@ -6258,7 +6251,7 @@ function adjustRangeOnMutation(range, mutation) {
|
|
|
6258
6251
|
break;
|
|
6259
6252
|
case MoveRangeMutation.id:
|
|
6260
6253
|
{
|
|
6261
|
-
const fromRange = params.fromRange, toRange = params.toRange;
|
|
6254
|
+
const fromRange = params.fromRange || new ObjectMatrix(params.from).getRange(), toRange = params.toRange || new ObjectMatrix(params.to).getRange();
|
|
6262
6255
|
baseRangeOperator = handleBaseMoveRange(
|
|
6263
6256
|
fromRange,
|
|
6264
6257
|
toRange,
|
|
@@ -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 {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ICellData, Nullable } from '@univerjs/core';
|
|
2
|
+
/**
|
|
3
|
+
* Update custom object by old and new value
|
|
4
|
+
* @param oldVal
|
|
5
|
+
* @param newVal
|
|
6
|
+
*/
|
|
7
|
+
export declare function handleCustom(oldVal: ICellData, newVal: ICellData): void;
|
|
8
|
+
/**
|
|
9
|
+
* Convert old custom normal key for storage
|
|
10
|
+
* @param style
|
|
11
|
+
*/
|
|
12
|
+
export declare function transformCustom(oldCustom: Nullable<Record<string, any>>, newCustom: Nullable<Record<string, any>>): Nullable<Record<string, any>>;
|
|
@@ -23,8 +23,4 @@ export interface ISetRangeValuesRangeMutationParams extends ISetRangeValuesMutat
|
|
|
23
23
|
* @returns {ISetRangeValuesMutationParams} undo mutation params
|
|
24
24
|
*/
|
|
25
25
|
export declare const SetRangeValuesUndoMutationFactory: (accessor: IAccessor, params: ISetRangeValuesMutationParams) => ISetRangeValuesMutationParams;
|
|
26
|
-
/**
|
|
27
|
-
* TODO@Dushusir: Excel can display numbers with up to about 15 digits of precision. When the user inputs more than 15 digits, interception is required, but there are unknown performance risks.
|
|
28
|
-
Intercept 15-digit number reference function truncateNumber
|
|
29
|
-
*/
|
|
30
26
|
export declare const SetRangeValuesMutation: IMutation<ISetRangeValuesMutationParams, boolean>;
|
|
@@ -2,12 +2,12 @@ import { Dependency, IWorkbookData, Workbook, Univer } from '@univerjs/core';
|
|
|
2
2
|
export declare function createTestBase(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
3
3
|
univer: Univer;
|
|
4
4
|
get: {
|
|
5
|
-
<T>(id: import('@
|
|
6
|
-
<T>(id: import('@
|
|
7
|
-
<T>(id: import('@
|
|
8
|
-
<T>(id: import('@
|
|
9
|
-
<T>(id: import('@
|
|
10
|
-
<T>(id: import('@
|
|
5
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
6
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
|
|
7
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
|
|
8
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
9
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
10
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
11
11
|
};
|
|
12
12
|
sheet: Workbook;
|
|
13
13
|
};
|
|
@@ -3,12 +3,12 @@ export declare const TEST_WORKBOOK_DATA_DEMO: IWorkbookData;
|
|
|
3
3
|
export declare function createTestBase(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
4
4
|
univer: Univer;
|
|
5
5
|
get: {
|
|
6
|
-
<T>(id: import('@
|
|
7
|
-
<T>(id: import('@
|
|
8
|
-
<T>(id: import('@
|
|
9
|
-
<T>(id: import('@
|
|
10
|
-
<T>(id: import('@
|
|
11
|
-
<T>(id: import('@
|
|
6
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
7
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
|
|
8
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
|
|
9
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
10
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
11
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
12
12
|
};
|
|
13
13
|
sheet: Workbook;
|
|
14
14
|
};
|
|
@@ -42,7 +42,7 @@ export interface IExclusiveRangeService {
|
|
|
42
42
|
*/
|
|
43
43
|
getInterestGroupId(selections: ISelectionWithStyle[]): string[];
|
|
44
44
|
}
|
|
45
|
-
export declare const IExclusiveRangeService: import('@
|
|
45
|
+
export declare const IExclusiveRangeService: import('@wendellhu/redi').IdentifierDecorator<IExclusiveRangeService>;
|
|
46
46
|
export declare class ExclusiveRangeService extends Disposable implements IExclusiveRangeService {
|
|
47
47
|
/**
|
|
48
48
|
* Exclusive range data structure is as follows: unitId -> sheetId -> feature -> range
|
|
@@ -18,4 +18,4 @@ export interface INumfmtService {
|
|
|
18
18
|
}>): void;
|
|
19
19
|
deleteValues(unitId: string, subUnitId: string, values: IRange[]): void;
|
|
20
20
|
}
|
|
21
|
-
export declare const INumfmtService: import('@
|
|
21
|
+
export declare const INumfmtService: import('@wendellhu/redi').IdentifierDecorator<INumfmtService>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PermissionStatus, IPermissionPoint } from '@univerjs/core';
|
|
2
2
|
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
3
|
export declare class RangeProtectionPermissionEditPoint implements IPermissionPoint {
|
|
4
4
|
type: UnitObject;
|
|
@@ -3,12 +3,12 @@ export declare const TEST_WORKBOOK_DATA_DEMO: IWorkbookData;
|
|
|
3
3
|
export declare function createTestBase(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
4
4
|
univer: Univer;
|
|
5
5
|
get: {
|
|
6
|
-
<T>(id: import('@
|
|
7
|
-
<T>(id: import('@
|
|
8
|
-
<T>(id: import('@
|
|
9
|
-
<T>(id: import('@
|
|
10
|
-
<T>(id: import('@
|
|
11
|
-
<T>(id: import('@
|
|
6
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
7
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
|
|
8
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
|
|
9
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
10
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
11
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
12
12
|
};
|
|
13
13
|
sheet: Workbook;
|
|
14
14
|
};
|
|
@@ -2,12 +2,12 @@ import { Workbook, Univer } from '@univerjs/core';
|
|
|
2
2
|
export declare function createRefRangeTestBed(): {
|
|
3
3
|
univer: Univer;
|
|
4
4
|
get: {
|
|
5
|
-
<T>(id: import('@
|
|
6
|
-
<T>(id: import('@
|
|
7
|
-
<T>(id: import('@
|
|
8
|
-
<T>(id: import('@
|
|
9
|
-
<T>(id: import('@
|
|
10
|
-
<T>(id: import('@
|
|
5
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
6
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
|
|
7
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
|
|
8
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
9
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
10
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
11
11
|
};
|
|
12
12
|
sheet: Workbook;
|
|
13
13
|
};
|
|
@@ -6,7 +6,7 @@ import { SheetsSelectionsService } from './selection-manager.service';
|
|
|
6
6
|
*
|
|
7
7
|
* Its data should be cleared by the caller quit editing formula and reconstructed when user starts editing.
|
|
8
8
|
*/
|
|
9
|
-
export declare const IRefSelectionsService: import('@
|
|
9
|
+
export declare const IRefSelectionsService: import('@wendellhu/redi').IdentifierDecorator<SheetsSelectionsService>;
|
|
10
10
|
/**
|
|
11
11
|
* RefSelectionsService treats `selectionMoveStart$` `selectionMoving$` and `selectionMoveEnd$` differently
|
|
12
12
|
* than `SheetsSelectionsService`. Because ref selections can be in different workbooks.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Disposable, IUniverInstanceService, RxDisposable, DeepReadonly, ISelectionCell, Nullable, Workbook } from '@univerjs/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { ISelectionWithStyle } from '../../basics/selection';
|
|
4
4
|
export interface ISelectionManagerSearchParam {
|
|
@@ -70,7 +70,7 @@ export declare class WorkbookSelections extends Disposable {
|
|
|
70
70
|
* @param selectionDatas
|
|
71
71
|
* @param type
|
|
72
72
|
*/
|
|
73
|
-
setSelections(sheetId: string, selectionDatas: ISelectionWithStyle[], type: SelectionMoveType): void;
|
|
73
|
+
setSelections(sheetId: string, selectionDatas: ISelectionWithStyle[] | undefined, type: SelectionMoveType): void;
|
|
74
74
|
getCurrentSelections(): Readonly<ISelectionWithStyle[]>;
|
|
75
75
|
getSelectionOfWorksheet(sheetId: string): ISelectionWithStyle[];
|
|
76
76
|
private _getCurrentSelections;
|
|
@@ -2,12 +2,12 @@ import { Dependency, IWorkbookData, Workbook, Univer } from '@univerjs/core';
|
|
|
2
2
|
export declare function createSheetTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
3
3
|
univer: Univer;
|
|
4
4
|
get: {
|
|
5
|
-
<T>(id: import('@
|
|
6
|
-
<T>(id: import('@
|
|
7
|
-
<T>(id: import('@
|
|
8
|
-
<T>(id: import('@
|
|
9
|
-
<T>(id: import('@
|
|
10
|
-
<T>(id: import('@
|
|
5
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
6
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
|
|
7
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
|
|
8
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
9
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
10
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
11
11
|
};
|
|
12
12
|
sheet: Workbook;
|
|
13
13
|
};
|
|
@@ -6,7 +6,7 @@ export declare class UniverSheetsPlugin extends Plugin {
|
|
|
6
6
|
private readonly _configService;
|
|
7
7
|
static pluginName: string;
|
|
8
8
|
static type: UniverInstanceType;
|
|
9
|
-
constructor(_config: Partial<IUniverSheetsConfig
|
|
9
|
+
constructor(_config: Partial<IUniverSheetsConfig> | undefined, _injector: Injector, _configService: IConfigService);
|
|
10
10
|
onRendered(): void;
|
|
11
11
|
private _initConfig;
|
|
12
12
|
private _initDependencies;
|