@univerjs/sheets 0.2.12 → 0.2.13

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/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, isSafeNumeric, isRealNum, isBooleanString, 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";
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 seleciton data to WorkbookSelections.
68
- * If type is not specfied, this method would clear all existing selections.
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);
@@ -385,6 +385,24 @@ function getWorksheetDisposableID(unitId, worksheet) {
385
385
  return `${unitId}|${worksheet.getSheetId()}`;
386
386
  }
387
387
  __name(getWorksheetDisposableID, "getWorksheetDisposableID");
388
+ function handleCustom(oldVal, newVal) {
389
+ const merge2 = mergeCustom(oldVal.custom, newVal.custom);
390
+ merge2 && Tools.removeNull(merge2), Tools.isEmptyObject(merge2) ? delete oldVal.custom : oldVal.custom = merge2;
391
+ }
392
+ __name(handleCustom, "handleCustom");
393
+ function mergeCustom(oldCustom, newCustom) {
394
+ return newCustom === null ? newCustom : newCustom === void 0 ? oldCustom : { ...oldCustom, ...newCustom };
395
+ }
396
+ __name(mergeCustom, "mergeCustom");
397
+ function transformCustom(oldCustom, newCustom) {
398
+ if (!newCustom || !Object.keys(newCustom).length)
399
+ return oldCustom;
400
+ const backupCustom = oldCustom || {};
401
+ for (const k in newCustom)
402
+ k in backupCustom || (backupCustom[k] = null);
403
+ return backupCustom;
404
+ }
405
+ __name(transformCustom, "transformCustom");
388
406
  function handleStyle(styles, oldVal, newVal) {
389
407
  var _a20;
390
408
  const oldStyle = styles.getStyleByCell(oldVal);
@@ -397,10 +415,6 @@ function handleStyle(styles, oldVal, newVal) {
397
415
  }
398
416
  __name(handleStyle, "handleStyle");
399
417
  function transformStyle(oldStyle, newStyle) {
400
- return transformNormalKey(oldStyle, newStyle);
401
- }
402
- __name(transformStyle, "transformStyle");
403
- function transformNormalKey(oldStyle, newStyle) {
404
418
  if (!newStyle || !Object.keys(newStyle).length)
405
419
  return oldStyle;
406
420
  const backupStyle = oldStyle || {};
@@ -408,7 +422,7 @@ function transformNormalKey(oldStyle, newStyle) {
408
422
  k === "bd" ? backupStyle[k] = transformBorders(backupStyle[k] || {}, newStyle[k]) : k in backupStyle || (backupStyle[k] = null);
409
423
  return backupStyle;
410
424
  }
411
- __name(transformNormalKey, "transformNormalKey");
425
+ __name(transformStyle, "transformStyle");
412
426
  function transformBorders(oldBorders, newBorders) {
413
427
  if (!newBorders || !Object.keys(newBorders).length)
414
428
  return oldBorders;
@@ -421,11 +435,9 @@ function mergeStyle(oldStyle, newStyle, isRichText = !1) {
421
435
  if (newStyle === null) return newStyle;
422
436
  if (newStyle === void 0) return oldStyle;
423
437
  const backupStyle = Tools.deepClone(oldStyle) || {};
424
- if (backupStyle) {
425
- for (const k in newStyle)
426
- 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]);
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
- }
438
+ for (const k in newStyle)
439
+ 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]);
440
+ 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
441
  }
430
442
  __name(mergeStyle, "mergeStyle");
431
443
  function skipParagraphs(paragraphs, offset) {
@@ -463,36 +475,6 @@ function mergeRichTextStyle(p, newStyle) {
463
475
  p.body.textRuns = normalizeTextRuns(newTextRuns);
464
476
  }
465
477
  __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
478
  function getCellType(styles, newVal, oldVal) {
497
479
  if (newVal.t) return newVal.t;
498
480
  if (newVal.v === null) return null;
@@ -531,6 +513,36 @@ function getCellTypeByPattern(cell, pattern) {
531
513
  return cell.t === CellValueType.FORCE_STRING ? CellValueType.FORCE_STRING : pattern === DEFAULT_TEXT_FORMAT ? CellValueType.STRING : checkCellValueType(cell.v, cell.t);
532
514
  }
533
515
  __name(getCellTypeByPattern, "getCellTypeByPattern");
516
+ function getCellValue(type, cell) {
517
+ 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;
518
+ }
519
+ __name(getCellValue, "getCellValue");
520
+ function extractBooleanValue(value) {
521
+ if (typeof value == "string") {
522
+ if (value.toUpperCase() === "TRUE")
523
+ return !0;
524
+ if (value.toUpperCase() === "FALSE")
525
+ return !1;
526
+ if (isSafeNumeric(value)) {
527
+ if (Number(value) === 0)
528
+ return !1;
529
+ if (Number(value) === 1)
530
+ return !0;
531
+ }
532
+ }
533
+ if (typeof value == "number") {
534
+ if (value === 0)
535
+ return !1;
536
+ if (value === 1)
537
+ return !0;
538
+ }
539
+ return typeof value == "boolean" ? value : null;
540
+ }
541
+ __name(extractBooleanValue, "extractBooleanValue");
542
+ function setNull(value) {
543
+ 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);
544
+ }
545
+ __name(setNull, "setNull");
534
546
  const SetRangeValuesUndoMutationFactory = /* @__PURE__ */ __name((accessor, params) => {
535
547
  const { unitId, subUnitId, cellValue } = params, workbook = accessor.get(IUniverInstanceService).getUniverSheetInstance(unitId);
536
548
  if (workbook == null)
@@ -540,9 +552,8 @@ const SetRangeValuesUndoMutationFactory = /* @__PURE__ */ __name((accessor, para
540
552
  throw new Error("worksheet is null error!");
541
553
  const cellMatrix = worksheet.getCellMatrix(), styles = workbook.getStyles(), undoData = new ObjectMatrix();
542
554
  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
- let newStyle = styles.getStyleByCell(newVal);
545
- newStyle = transformStyle(oldStyle, newStyle), cell.s = newStyle, undoData.setValue(row, col, setNull(cell));
555
+ const cell = Tools.deepClone(cellMatrix == null ? void 0 : cellMatrix.getValue(row, col)) || {}, oldStyle = styles.getStyleByCell(cell), newStyle = styles.getStyleByCell(newVal);
556
+ cell.s = transformStyle(oldStyle, newStyle), cell.custom = transformCustom(cell.custom, newVal == null ? void 0 : newVal.custom), undoData.setValue(row, col, setNull(cell));
546
557
  }), {
547
558
  ...params,
548
559
  options: {},
@@ -564,7 +575,7 @@ const SetRangeValuesUndoMutationFactory = /* @__PURE__ */ __name((accessor, para
564
575
  cellMatrix == null || cellMatrix.setValue(row, col, {});
565
576
  else {
566
577
  const oldVal = cellMatrix.getValue(row, col) || {}, type = getCellType(styles, newVal, oldVal);
567
- newVal.f !== void 0 && (oldVal.f = newVal.f), newVal.si !== void 0 && (oldVal.si = newVal.si), newVal.p !== void 0 && (oldVal.p = newVal.p), newVal.v !== void 0 && (oldVal.v = getCellValue(type, newVal)), oldVal.v !== void 0 && (oldVal.t = type, oldVal.v = getCellValue(type, oldVal)), newVal.s !== void 0 && handleStyle(styles, oldVal, newVal), newVal.custom !== void 0 && (oldVal.custom = newVal.custom), cellMatrix.setValue(row, col, Tools.removeNull(oldVal));
578
+ newVal.f !== void 0 && (oldVal.f = newVal.f), newVal.si !== void 0 && (oldVal.si = newVal.si), newVal.p !== void 0 && (oldVal.p = newVal.p), newVal.v !== void 0 && (oldVal.v = getCellValue(type, newVal)), oldVal.v !== void 0 && (oldVal.t = type, oldVal.v = getCellValue(type, oldVal)), newVal.s !== void 0 && handleStyle(styles, oldVal, newVal), newVal.custom !== void 0 && handleCustom(oldVal, newVal), cellMatrix.setValue(row, col, Tools.removeNull(oldVal));
568
579
  }
569
580
  }), !0;
570
581
  }, "handler")
@@ -6258,7 +6269,7 @@ function adjustRangeOnMutation(range, mutation) {
6258
6269
  break;
6259
6270
  case MoveRangeMutation.id:
6260
6271
  {
6261
- const fromRange = params.fromRange, toRange = params.toRange;
6272
+ const fromRange = params.fromRange || new ObjectMatrix(params.from).getRange(), toRange = params.toRange || new ObjectMatrix(params.to).getRange();
6262
6273
  baseRangeOperator = handleBaseMoveRange(
6263
6274
  fromRange,
6264
6275
  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('@univerjs/core').DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
6
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.MANY, lookUp?: import('@univerjs/core').LookUp): T[];
7
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.OPTIONAL, lookUp?: import('@univerjs/core').LookUp): T | null;
8
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.REQUIRED, lookUp?: import('@univerjs/core').LookUp): T;
9
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity?: import('@univerjs/core').Quantity, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
10
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantityOrLookup?: import('@univerjs/core').Quantity | import('@univerjs/core').LookUp, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
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('@univerjs/core').DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
7
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.MANY, lookUp?: import('@univerjs/core').LookUp): T[];
8
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.OPTIONAL, lookUp?: import('@univerjs/core').LookUp): T | null;
9
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.REQUIRED, lookUp?: import('@univerjs/core').LookUp): T;
10
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity?: import('@univerjs/core').Quantity, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
11
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantityOrLookup?: import('@univerjs/core').Quantity | import('@univerjs/core').LookUp, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
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('@univerjs/core').IdentifierDecorator<IExclusiveRangeService>;
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('@univerjs/core').IdentifierDecorator<INumfmtService>;
21
+ export declare const INumfmtService: import('@wendellhu/redi').IdentifierDecorator<INumfmtService>;
@@ -1,4 +1,4 @@
1
- import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
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('@univerjs/core').DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
7
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.MANY, lookUp?: import('@univerjs/core').LookUp): T[];
8
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.OPTIONAL, lookUp?: import('@univerjs/core').LookUp): T | null;
9
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.REQUIRED, lookUp?: import('@univerjs/core').LookUp): T;
10
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity?: import('@univerjs/core').Quantity, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
11
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantityOrLookup?: import('@univerjs/core').Quantity | import('@univerjs/core').LookUp, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
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('@univerjs/core').DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
6
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.MANY, lookUp?: import('@univerjs/core').LookUp): T[];
7
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.OPTIONAL, lookUp?: import('@univerjs/core').LookUp): T | null;
8
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.REQUIRED, lookUp?: import('@univerjs/core').LookUp): T;
9
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity?: import('@univerjs/core').Quantity, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
10
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantityOrLookup?: import('@univerjs/core').Quantity | import('@univerjs/core').LookUp, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
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('@univerjs/core').IdentifierDecorator<SheetsSelectionsService>;
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 { DeepReadonly, ISelectionCell, Nullable, Workbook, Disposable, IUniverInstanceService, RxDisposable } from '@univerjs/core';
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('@univerjs/core').DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
6
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.MANY, lookUp?: import('@univerjs/core').LookUp): T[];
7
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.OPTIONAL, lookUp?: import('@univerjs/core').LookUp): T | null;
8
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.REQUIRED, lookUp?: import('@univerjs/core').LookUp): T;
9
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity?: import('@univerjs/core').Quantity, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
10
- <T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantityOrLookup?: import('@univerjs/core').Quantity | import('@univerjs/core').LookUp, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
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>, _injector: Injector, _configService: IConfigService);
9
+ constructor(_config: Partial<IUniverSheetsConfig> | undefined, _injector: Injector, _configService: IConfigService);
10
10
  onRendered(): void;
11
11
  private _initConfig;
12
12
  private _initDependencies;