@univerjs/sheets 1.0.0-alpha.7 → 1.0.0-beta.0
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/facade.js +65 -66
- package/lib/cjs/index.js +285 -337
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +65 -66
- package/lib/es/index.js +286 -339
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +65 -66
- package/lib/index.js +286 -339
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/basics/cell-type.d.ts +2 -1
- package/lib/types/basics/selection.d.ts +0 -9
- package/lib/types/commands/commands/remove-row-col.command.d.ts +2 -0
- package/lib/types/commands/utils/selection-command-util.d.ts +2 -1
- package/lib/types/facade/f-worksheet.d.ts +10 -9
- package/lib/types/facade/index.d.ts +0 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/models/range-protection-render.model.d.ts +3 -2
- package/lib/types/services/ref-range/ref-range.service.d.ts +2 -0
- package/lib/types/services/selections/selection-data-model.d.ts +0 -6
- package/lib/types/services/selections/selection.service.d.ts +0 -6
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +8 -8
- package/lib/types/facade/f-types.d.ts +0 -16
package/lib/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AUTO_HEIGHT_FOR_MERGED_CELLS, BORDER_KEYS, BORDER_STYLE_KEYS, BooleanNumber, BorderStyleTypes, BorderType, BuildTextUtils, COLOR_STYLE_KEYS, CellModeEnum, CellValueType, CommandType, CustomCommandExecutionError, DependentOn, Dimension, Direction, Disposable, DisposableCollection, DocumentDataModel, ErrorService, FontItalic, FontWeight, HorizontalAlign, IAuthzIoService, ICommandService, IConfigService, IConfirmService, IContextService, ILogService, IPermissionService, IResourceManagerService, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, IUndoRedoService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, InterceptorManager, LRUMap, LocaleService, MAX_COLUMN_COUNT, MAX_ROW_COUNT, ObjectMatrix, Optional, PADDING_KEYS, PermissionStatus, Plugin, RANGE_TYPE, RTree, Range, Rectangle, RxDisposable, STYLE_KEYS, TEXT_DECORATION_KEYS, TEXT_ROTATION_KEYS, TextX, Tools, UniverInstanceType, UserManagerService, cellToRange, cloneWorksheetData, composeInterceptors, concatMatrixArray, createIdentifier, createInterceptorKey, createRowColIter, generateRandomId, getArrayLength, isBooleanString, isDefaultFormat, isFormulaId, isFormulaString, isICellData, isRealNum, isSafeNumeric, isTextFormat, mapObjectMatrix, merge, mergeIntervals, mergeOverrideWithDependencies, mergeWorksheetSnapshotWithDefault, moveMatrixArray, normalizeTextRuns, numfmt, queryObjectMatrix, regexp, registerDependencies, remove, selectionToArray, sequenceExecute, sliceMatrixArray, spliceArray, throttle, toDisposable, touchDependencies, willLoseNumericPrecision } from "@univerjs/core";
|
|
1
|
+
import { AUTO_HEIGHT_FOR_MERGED_CELLS, BORDER_KEYS, BORDER_STYLE_KEYS, BooleanNumber, BorderStyleTypes, BorderType, BuildTextUtils, COLOR_STYLE_KEYS, CellModeEnum, CellValueType, CommandType, CustomCommandExecutionError, DependentOn, Dimension, Direction, Disposable, DisposableCollection, DocumentDataModel, ErrorService, FontItalic, FontWeight, HorizontalAlign, IAuthzIoService, ICommandService, IConfigService, IConfirmService, IContextService, ILogService, IPermissionService, IResourceManagerService, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, IUndoRedoService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, InterceptorManager, LRUMap, LocaleService, MAX_COLUMN_COUNT, MAX_ROW_COUNT, ObjectMatrix, Optional, PADDING_KEYS, PermissionStatus, Plugin, RANGE_TYPE, RTree, Range, Rectangle, RxDisposable, STYLE_KEYS, TEXT_DECORATION_KEYS, TEXT_ROTATION_KEYS, TextX, Tools, UniverInstanceType, UserManagerService, cellToRange, cloneWorksheetData, composeInterceptors, concatMatrixArray, createIdentifier, createInterceptorKey, createRowColIter, generateRandomId, getArrayLength, getIntersectRange, isBooleanString, isDefaultFormat, isFormulaId, isFormulaString, isICellData, isRealNum, isSafeNumeric, isTextFormat, mapObjectMatrix, merge, mergeIntervals, mergeOverrideWithDependencies, mergeWorksheetSnapshotWithDefault, moveMatrixArray, normalizeTextRuns, numfmt, queryObjectMatrix, regexp, registerDependencies, remove, selectionToArray, sequenceExecute, sliceMatrixArray, spliceArray, throttle, toDisposable, touchDependencies, willLoseNumericPrecision } from "@univerjs/core";
|
|
2
2
|
import { BehaviorSubject, Subject, distinctUntilChanged, filter, first, map, merge as merge$1, of, share, shareReplay, skip, switchMap, takeUntil } from "rxjs";
|
|
3
3
|
import { IDefinedNamesService, LexerTreeBuilder, RemoveDefinedNameMutation, SetDefinedNameMutation, SetDefinedNameMutationFactory, SetFormulaCalculationResultMutation, UniverFormulaEnginePlugin, deserializeRangeWithSheet, deserializeRangeWithSheetWithCache, handleNumfmtInCell, isReferenceStringWithEffectiveColumn, operatorToken, sequenceNodeType, stripErrorMargin } from "@univerjs/engine-formula";
|
|
4
4
|
import { SpreadsheetSkeleton, cjk, precisionTo } from "@univerjs/engine-render";
|
|
@@ -7,6 +7,10 @@ import { filter as filter$1, map as map$1, takeUntil as takeUntil$1 } from "rxjs
|
|
|
7
7
|
import { DataSyncPrimaryController } from "@univerjs/rpc";
|
|
8
8
|
|
|
9
9
|
//#region src/basics/cell-type.ts
|
|
10
|
+
function isCellImage(documentData) {
|
|
11
|
+
var _documentData$drawing;
|
|
12
|
+
return !!(documentData === null || documentData === void 0 || (_documentData$drawing = documentData.drawingsOrder) === null || _documentData$drawing === void 0 ? void 0 : _documentData$drawing.length);
|
|
13
|
+
}
|
|
10
14
|
/**
|
|
11
15
|
* Get cell value type by style, new value and old value.
|
|
12
16
|
* If the new value contains t, then take t directly. In other cases, we need to dynamically determine based on actual data and styles
|
|
@@ -158,7 +162,7 @@ const RangeThemeInterceptorId = "sheet.interceptor.range-theme-id";
|
|
|
158
162
|
const IgnoreRangeThemeInterceptorKey = "sheet.interceptor.ignore-range-theme";
|
|
159
163
|
|
|
160
164
|
//#endregion
|
|
161
|
-
//#region \0@oxc-project+runtime@0.
|
|
165
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
|
|
162
166
|
function _typeof(o) {
|
|
163
167
|
"@babel/helpers - typeof";
|
|
164
168
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -169,7 +173,7 @@ function _typeof(o) {
|
|
|
169
173
|
}
|
|
170
174
|
|
|
171
175
|
//#endregion
|
|
172
|
-
//#region \0@oxc-project+runtime@0.
|
|
176
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
|
|
173
177
|
function toPrimitive(t, r) {
|
|
174
178
|
if ("object" != _typeof(t) || !t) return t;
|
|
175
179
|
var e = t[Symbol.toPrimitive];
|
|
@@ -182,14 +186,14 @@ function toPrimitive(t, r) {
|
|
|
182
186
|
}
|
|
183
187
|
|
|
184
188
|
//#endregion
|
|
185
|
-
//#region \0@oxc-project+runtime@0.
|
|
189
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
|
|
186
190
|
function toPropertyKey(t) {
|
|
187
191
|
var i = toPrimitive(t, "string");
|
|
188
192
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
189
193
|
}
|
|
190
194
|
|
|
191
195
|
//#endregion
|
|
192
|
-
//#region \0@oxc-project+runtime@0.
|
|
196
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
|
|
193
197
|
function _defineProperty(e, r, t) {
|
|
194
198
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
195
199
|
value: t,
|
|
@@ -200,7 +204,7 @@ function _defineProperty(e, r, t) {
|
|
|
200
204
|
}
|
|
201
205
|
|
|
202
206
|
//#endregion
|
|
203
|
-
//#region \0@oxc-project+runtime@0.
|
|
207
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
|
|
204
208
|
function __decorateParam(paramIndex, decorator) {
|
|
205
209
|
return function(target, key) {
|
|
206
210
|
decorator(target, key, paramIndex);
|
|
@@ -208,7 +212,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
208
212
|
}
|
|
209
213
|
|
|
210
214
|
//#endregion
|
|
211
|
-
//#region \0@oxc-project+runtime@0.
|
|
215
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
|
|
212
216
|
function __decorate(decorators, target, key, desc) {
|
|
213
217
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
214
218
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -283,10 +287,7 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
|
|
|
283
287
|
interceptCommand(interceptor) {
|
|
284
288
|
if (this._commandInterceptors.includes(interceptor)) throw new Error("[SheetInterceptorService]: Interceptor already exists!");
|
|
285
289
|
this._commandInterceptors.push(interceptor);
|
|
286
|
-
this._commandInterceptors.sort((a, b) =>
|
|
287
|
-
var _b$priority, _a$priority;
|
|
288
|
-
return ((_b$priority = b.priority) !== null && _b$priority !== void 0 ? _b$priority : 0) - ((_a$priority = a.priority) !== null && _a$priority !== void 0 ? _a$priority : 0);
|
|
289
|
-
});
|
|
290
|
+
this._commandInterceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
290
291
|
return this.disposeWithMe(toDisposable(() => remove(this._commandInterceptors, interceptor)));
|
|
291
292
|
}
|
|
292
293
|
/**
|
|
@@ -297,25 +298,16 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
|
|
|
297
298
|
onCommandExecute(info) {
|
|
298
299
|
const infos = this._commandInterceptors.map((i) => i.getMutations(info));
|
|
299
300
|
return {
|
|
300
|
-
preUndos: infos.map((i) =>
|
|
301
|
-
var _i$preUndos;
|
|
302
|
-
return (_i$preUndos = i.preUndos) !== null && _i$preUndos !== void 0 ? _i$preUndos : [];
|
|
303
|
-
}).flat(),
|
|
301
|
+
preUndos: infos.map((i) => i.preUndos ?? []).flat(),
|
|
304
302
|
undos: infos.map((i) => i.undos).flat(),
|
|
305
|
-
preRedos: infos.map((i) =>
|
|
306
|
-
var _i$preRedos;
|
|
307
|
-
return (_i$preRedos = i.preRedos) !== null && _i$preRedos !== void 0 ? _i$preRedos : [];
|
|
308
|
-
}).flat(),
|
|
303
|
+
preRedos: infos.map((i) => i.preRedos ?? []).flat(),
|
|
309
304
|
redos: infos.map((i) => i.redos).flat()
|
|
310
305
|
};
|
|
311
306
|
}
|
|
312
307
|
interceptAfterCommand(interceptor) {
|
|
313
308
|
if (this._afterCommandInterceptors.includes(interceptor)) throw new Error("[SheetInterceptorService]: Interceptor already exists!");
|
|
314
309
|
this._afterCommandInterceptors.push(interceptor);
|
|
315
|
-
this._afterCommandInterceptors.sort((a, b) =>
|
|
316
|
-
var _b$priority2, _a$priority2;
|
|
317
|
-
return ((_b$priority2 = b.priority) !== null && _b$priority2 !== void 0 ? _b$priority2 : 0) - ((_a$priority2 = a.priority) !== null && _a$priority2 !== void 0 ? _a$priority2 : 0);
|
|
318
|
-
});
|
|
310
|
+
this._afterCommandInterceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
319
311
|
return this.disposeWithMe(toDisposable(() => remove(this._afterCommandInterceptors, interceptor)));
|
|
320
312
|
}
|
|
321
313
|
afterCommandExecute(info) {
|
|
@@ -328,24 +320,15 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
|
|
|
328
320
|
interceptAutoHeight(interceptor) {
|
|
329
321
|
if (this._autoHeightInterceptors.includes(interceptor)) throw new Error("[SheetInterceptorService]: Interceptor already exists!");
|
|
330
322
|
this._autoHeightInterceptors.push(interceptor);
|
|
331
|
-
this._autoHeightInterceptors.sort((a, b) =>
|
|
332
|
-
var _b$priority3, _a$priority3;
|
|
333
|
-
return ((_b$priority3 = b.priority) !== null && _b$priority3 !== void 0 ? _b$priority3 : 0) - ((_a$priority3 = a.priority) !== null && _a$priority3 !== void 0 ? _a$priority3 : 0);
|
|
334
|
-
});
|
|
323
|
+
this._autoHeightInterceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
335
324
|
return this.disposeWithMe(toDisposable(() => remove(this._autoHeightInterceptors, interceptor)));
|
|
336
325
|
}
|
|
337
326
|
generateMutationsOfAutoHeight(ctx) {
|
|
338
327
|
const infos = this._autoHeightInterceptors.map((i) => i.getMutations(ctx));
|
|
339
328
|
return {
|
|
340
|
-
preUndos: infos.map((i) =>
|
|
341
|
-
var _i$preUndos2;
|
|
342
|
-
return (_i$preUndos2 = i.preUndos) !== null && _i$preUndos2 !== void 0 ? _i$preUndos2 : [];
|
|
343
|
-
}).flat(),
|
|
329
|
+
preUndos: infos.map((i) => i.preUndos ?? []).flat(),
|
|
344
330
|
undos: infos.map((i) => i.undos).flat(),
|
|
345
|
-
preRedos: infos.map((i) =>
|
|
346
|
-
var _i$preRedos2;
|
|
347
|
-
return (_i$preRedos2 = i.preRedos) !== null && _i$preRedos2 !== void 0 ? _i$preRedos2 : [];
|
|
348
|
-
}).flat(),
|
|
331
|
+
preRedos: infos.map((i) => i.preRedos ?? []).flat(),
|
|
349
332
|
redos: infos.map((i) => i.redos).flat()
|
|
350
333
|
};
|
|
351
334
|
}
|
|
@@ -361,10 +344,7 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
|
|
|
361
344
|
interceptBeforeCommand(interceptor) {
|
|
362
345
|
if (this._beforeCommandInterceptor.includes(interceptor)) throw new Error("[SheetInterceptorService]: Interceptor already exists!");
|
|
363
346
|
this._beforeCommandInterceptor.push(interceptor);
|
|
364
|
-
this._beforeCommandInterceptor.sort((a, b) =>
|
|
365
|
-
var _b$priority4, _a$priority4;
|
|
366
|
-
return ((_b$priority4 = b.priority) !== null && _b$priority4 !== void 0 ? _b$priority4 : 0) - ((_a$priority4 = a.priority) !== null && _a$priority4 !== void 0 ? _a$priority4 : 0);
|
|
367
|
-
});
|
|
347
|
+
this._beforeCommandInterceptor.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
368
348
|
return this.disposeWithMe(toDisposable(() => remove(this._beforeCommandInterceptor, interceptor)));
|
|
369
349
|
}
|
|
370
350
|
/**
|
|
@@ -383,24 +363,15 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
|
|
|
383
363
|
interceptRanges(interceptor) {
|
|
384
364
|
if (this._rangeInterceptors.includes(interceptor)) throw new Error("[SheetInterceptorService]: Interceptor already exists!");
|
|
385
365
|
this._rangeInterceptors.push(interceptor);
|
|
386
|
-
this._rangeInterceptors.sort((a, b) =>
|
|
387
|
-
var _b$priority5, _a$priority5;
|
|
388
|
-
return ((_b$priority5 = b.priority) !== null && _b$priority5 !== void 0 ? _b$priority5 : 0) - ((_a$priority5 = a.priority) !== null && _a$priority5 !== void 0 ? _a$priority5 : 0);
|
|
389
|
-
});
|
|
366
|
+
this._rangeInterceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
390
367
|
return this.disposeWithMe(toDisposable(() => remove(this._rangeInterceptors, interceptor)));
|
|
391
368
|
}
|
|
392
369
|
generateMutationsByRanges(info) {
|
|
393
370
|
const infos = this._rangeInterceptors.map((i) => i.getMutations(info));
|
|
394
371
|
return {
|
|
395
|
-
preUndos: infos.map((i) =>
|
|
396
|
-
var _i$preUndos3;
|
|
397
|
-
return (_i$preUndos3 = i.preUndos) !== null && _i$preUndos3 !== void 0 ? _i$preUndos3 : [];
|
|
398
|
-
}).flat(),
|
|
372
|
+
preUndos: infos.map((i) => i.preUndos ?? []).flat(),
|
|
399
373
|
undos: infos.map((i) => i.undos).flat(),
|
|
400
|
-
preRedos: infos.map((i) =>
|
|
401
|
-
var _i$preRedos3;
|
|
402
|
-
return (_i$preRedos3 = i.preRedos) !== null && _i$preRedos3 !== void 0 ? _i$preRedos3 : [];
|
|
403
|
-
}).flat(),
|
|
374
|
+
preRedos: infos.map((i) => i.preRedos ?? []).flat(),
|
|
404
375
|
redos: infos.map((i) => i.redos).flat()
|
|
405
376
|
};
|
|
406
377
|
}
|
|
@@ -432,10 +403,7 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
|
|
|
432
403
|
if (!this._interceptorsByName.has(key)) this._interceptorsByName.set(key, []);
|
|
433
404
|
const interceptors = this._interceptorsByName.get(key);
|
|
434
405
|
interceptors.push(interceptor);
|
|
435
|
-
const sortedInterceptors = interceptors.sort((a, b) =>
|
|
436
|
-
var _b$priority6, _a$priority6;
|
|
437
|
-
return ((_b$priority6 = b.priority) !== null && _b$priority6 !== void 0 ? _b$priority6 : 0) - ((_a$priority6 = a.priority) !== null && _a$priority6 !== void 0 ? _a$priority6 : 0);
|
|
438
|
-
});
|
|
406
|
+
const sortedInterceptors = interceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
439
407
|
this._invalidateComposedInterceptors();
|
|
440
408
|
if (key === INTERCEPTOR_POINT.CELL_CONTENT) {
|
|
441
409
|
const JOINED_EFFECT = InterceptorEffectEnum.Style | InterceptorEffectEnum.Value;
|
|
@@ -460,7 +428,7 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
|
|
|
460
428
|
}
|
|
461
429
|
fetchThroughInterceptors(name, effect, _key, filter) {
|
|
462
430
|
const byNamesKey = effect === void 0 ? name : `${name}-${effect}`;
|
|
463
|
-
const key = _key
|
|
431
|
+
const key = _key ?? byNamesKey;
|
|
464
432
|
let composed = this._composedInterceptorByKey.get(key);
|
|
465
433
|
if (!composed) {
|
|
466
434
|
let interceptors = this._interceptorsByName.get(byNamesKey);
|
|
@@ -1680,7 +1648,7 @@ const MoveRowsMutation = {
|
|
|
1680
1648
|
type: CommandType.MUTATION,
|
|
1681
1649
|
handler: (accessor, params) => {
|
|
1682
1650
|
const { unitId, subUnitId, sourceRange, targetRange } = params;
|
|
1683
|
-
const univerSheet = accessor.get(IUniverInstanceService).
|
|
1651
|
+
const univerSheet = accessor.get(IUniverInstanceService).getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
1684
1652
|
if (!univerSheet) throw new Error("[MoveRowMutation] univerSheet is null!");
|
|
1685
1653
|
const worksheet = univerSheet.getSheetBySheetId(subUnitId);
|
|
1686
1654
|
if (!worksheet) throw new Error("[MoveRowMutation] worksheet is null!");
|
|
@@ -1722,7 +1690,7 @@ const MoveColsMutation = {
|
|
|
1722
1690
|
type: CommandType.MUTATION,
|
|
1723
1691
|
handler: (accessor, params) => {
|
|
1724
1692
|
const { unitId, subUnitId, sourceRange, targetRange } = params;
|
|
1725
|
-
const univerSheet = accessor.get(IUniverInstanceService).
|
|
1693
|
+
const univerSheet = accessor.get(IUniverInstanceService).getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
1726
1694
|
if (!univerSheet) throw new Error("[MoveColumnMutation] univerSheet is null!");
|
|
1727
1695
|
const worksheet = univerSheet.getSheetBySheetId(subUnitId);
|
|
1728
1696
|
if (!worksheet) throw new Error("[MoveColumnMutation] worksheet is null!");
|
|
@@ -1753,7 +1721,7 @@ const RemoveRowMutation = {
|
|
|
1753
1721
|
id: "sheet.mutation.remove-rows",
|
|
1754
1722
|
type: CommandType.MUTATION,
|
|
1755
1723
|
handler: (accessor, params) => {
|
|
1756
|
-
const universheet = accessor.get(IUniverInstanceService).
|
|
1724
|
+
const universheet = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
1757
1725
|
if (universheet == null) throw new Error("universheet is null error!");
|
|
1758
1726
|
const worksheet = universheet.getSheetBySheetId(params.subUnitId);
|
|
1759
1727
|
if (!worksheet) return false;
|
|
@@ -1769,7 +1737,7 @@ const RemoveRowMutation = {
|
|
|
1769
1737
|
}
|
|
1770
1738
|
};
|
|
1771
1739
|
const RemoveColMutationFactory = (accessor, params) => {
|
|
1772
|
-
const universheet = accessor.get(IUniverInstanceService).
|
|
1740
|
+
const universheet = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
1773
1741
|
if (universheet == null) throw new Error("universheet is null error!");
|
|
1774
1742
|
const worksheet = universheet.getSheetBySheetId(params.subUnitId);
|
|
1775
1743
|
if (worksheet == null) throw new Error("worksheet is null error!");
|
|
@@ -1788,7 +1756,7 @@ const RemoveColMutation = {
|
|
|
1788
1756
|
id: "sheet.mutation.remove-col",
|
|
1789
1757
|
type: CommandType.MUTATION,
|
|
1790
1758
|
handler: (accessor, params) => {
|
|
1791
|
-
const universheet = accessor.get(IUniverInstanceService).
|
|
1759
|
+
const universheet = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
1792
1760
|
if (universheet == null) throw new Error("universheet is null error!");
|
|
1793
1761
|
const worksheet = universheet.getSheetBySheetId(params.subUnitId);
|
|
1794
1762
|
if (!worksheet) return false;
|
|
@@ -1956,7 +1924,7 @@ const SetColDataMutation = {
|
|
|
1956
1924
|
//#endregion
|
|
1957
1925
|
//#region src/commands/mutations/set-col-visible.mutation.ts
|
|
1958
1926
|
const SetColHiddenUndoMutationFactory = (accessor, params) => {
|
|
1959
|
-
if (accessor.get(IUniverInstanceService).
|
|
1927
|
+
if (accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET) == null) throw new Error("universheet is null error!");
|
|
1960
1928
|
return {
|
|
1961
1929
|
unitId: params.unitId,
|
|
1962
1930
|
subUnitId: params.subUnitId,
|
|
@@ -1967,7 +1935,7 @@ const SetColHiddenMutation = {
|
|
|
1967
1935
|
id: "sheet.mutation.set-col-hidden",
|
|
1968
1936
|
type: CommandType.MUTATION,
|
|
1969
1937
|
handler: (accessor, params) => {
|
|
1970
|
-
const universheet = accessor.get(IUniverInstanceService).
|
|
1938
|
+
const universheet = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
1971
1939
|
if (!universheet) return false;
|
|
1972
1940
|
const manager = universheet.getSheetBySheetId(params.subUnitId).getColumnManager();
|
|
1973
1941
|
for (let i = 0; i < params.ranges.length; i++) {
|
|
@@ -1981,7 +1949,7 @@ const SetColHiddenMutation = {
|
|
|
1981
1949
|
}
|
|
1982
1950
|
};
|
|
1983
1951
|
const SetColVisibleUndoMutationFactory = (accessor, params) => {
|
|
1984
|
-
if (accessor.get(IUniverInstanceService).
|
|
1952
|
+
if (accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET) == null) throw new Error("universheet is null error!");
|
|
1985
1953
|
return {
|
|
1986
1954
|
unitId: params.unitId,
|
|
1987
1955
|
subUnitId: params.subUnitId,
|
|
@@ -1992,7 +1960,7 @@ const SetColVisibleMutation = {
|
|
|
1992
1960
|
id: "sheet.mutation.set-col-visible",
|
|
1993
1961
|
type: CommandType.MUTATION,
|
|
1994
1962
|
handler: (accessor, params) => {
|
|
1995
|
-
const universheet = accessor.get(IUniverInstanceService).
|
|
1963
|
+
const universheet = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
1996
1964
|
if (!universheet) return false;
|
|
1997
1965
|
const manager = universheet.getSheetBySheetId(params.subUnitId).getColumnManager();
|
|
1998
1966
|
for (let i = 0; i < params.ranges.length; i++) {
|
|
@@ -2169,7 +2137,7 @@ function handleStyle(styles, oldVal, newVal) {
|
|
|
2169
2137
|
*/
|
|
2170
2138
|
function transformStyle(oldStyle, newStyle) {
|
|
2171
2139
|
if (!newStyle || !Object.keys(newStyle).length) return oldStyle;
|
|
2172
|
-
const backupStyle = Tools.deepClone(oldStyle
|
|
2140
|
+
const backupStyle = Tools.deepClone(oldStyle ?? {}) || {};
|
|
2173
2141
|
const styleRecord = newStyle;
|
|
2174
2142
|
for (const key of STYLE_KEYS) {
|
|
2175
2143
|
if (!Object.prototype.hasOwnProperty.call(styleRecord, key)) continue;
|
|
@@ -2342,7 +2310,7 @@ function setNull(value) {
|
|
|
2342
2310
|
*/
|
|
2343
2311
|
const SetRangeValuesUndoMutationFactory = (accessor, params) => {
|
|
2344
2312
|
const { unitId, subUnitId, cellValue, isOverrideStyle } = params;
|
|
2345
|
-
const workbook = accessor.get(IUniverInstanceService).
|
|
2313
|
+
const workbook = accessor.get(IUniverInstanceService).getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
2346
2314
|
if (workbook == null) throw new Error("workbook is null error!");
|
|
2347
2315
|
const worksheet = workbook.getSheetBySheetId(subUnitId);
|
|
2348
2316
|
if (worksheet == null) throw new Error("worksheet is null error!");
|
|
@@ -2353,7 +2321,7 @@ const SetRangeValuesUndoMutationFactory = (accessor, params) => {
|
|
|
2353
2321
|
const cell = Tools.deepClone(cellMatrix === null || cellMatrix === void 0 ? void 0 : cellMatrix.getValue(row, col)) || {};
|
|
2354
2322
|
const oldStyle = styles.getStyleByCell(cell);
|
|
2355
2323
|
const newStyle = styles.getStyleByCell(newVal);
|
|
2356
|
-
cell.s = isOverrideStyle && Object.prototype.hasOwnProperty.call(newVal
|
|
2324
|
+
cell.s = isOverrideStyle && Object.prototype.hasOwnProperty.call(newVal ?? {}, "s") ? oldStyle ?? null : transformStyle(oldStyle, newStyle);
|
|
2357
2325
|
undoData.setValue(row, col, setNull(cell));
|
|
2358
2326
|
});
|
|
2359
2327
|
return {
|
|
@@ -2472,7 +2440,7 @@ const SetRowDataMutation = {
|
|
|
2472
2440
|
//#endregion
|
|
2473
2441
|
//#region src/commands/mutations/set-row-visible.mutation.ts
|
|
2474
2442
|
const SetRowVisibleUndoMutationFactory = (accessor, params) => {
|
|
2475
|
-
if (accessor.get(IUniverInstanceService).
|
|
2443
|
+
if (accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET) == null) throw new Error("universheet is null error!");
|
|
2476
2444
|
return {
|
|
2477
2445
|
unitId: params.unitId,
|
|
2478
2446
|
subUnitId: params.subUnitId,
|
|
@@ -2483,7 +2451,7 @@ const SetRowVisibleMutation = {
|
|
|
2483
2451
|
id: "sheet.mutation.set-row-visible",
|
|
2484
2452
|
type: CommandType.MUTATION,
|
|
2485
2453
|
handler: (accessor, params) => {
|
|
2486
|
-
const universheet = accessor.get(IUniverInstanceService).
|
|
2454
|
+
const universheet = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
2487
2455
|
if (universheet == null) throw new Error("universheet is null error!");
|
|
2488
2456
|
const manager = universheet.getSheetBySheetId(params.subUnitId).getRowManager();
|
|
2489
2457
|
for (let i = 0; i < params.ranges.length; i++) {
|
|
@@ -2497,7 +2465,7 @@ const SetRowVisibleMutation = {
|
|
|
2497
2465
|
}
|
|
2498
2466
|
};
|
|
2499
2467
|
const SetRowHiddenUndoMutationFactory = (accessor, params) => {
|
|
2500
|
-
if (accessor.get(IUniverInstanceService).
|
|
2468
|
+
if (accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET) == null) throw new Error("universheet is null error!");
|
|
2501
2469
|
return {
|
|
2502
2470
|
unitId: params.unitId,
|
|
2503
2471
|
subUnitId: params.subUnitId,
|
|
@@ -2508,7 +2476,7 @@ const SetRowHiddenMutation = {
|
|
|
2508
2476
|
id: "sheet.mutation.set-row-hidden",
|
|
2509
2477
|
type: CommandType.MUTATION,
|
|
2510
2478
|
handler: (accessor, params) => {
|
|
2511
|
-
const universheet = accessor.get(IUniverInstanceService).
|
|
2479
|
+
const universheet = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
2512
2480
|
if (universheet == null) throw new Error("universheet is null error!");
|
|
2513
2481
|
const manager = universheet.getSheetBySheetId(params.subUnitId).getRowManager();
|
|
2514
2482
|
for (let i = 0; i < params.ranges.length; i++) {
|
|
@@ -2645,8 +2613,8 @@ const SetWorksheetRowHeightMutationFactory = (params, worksheet) => {
|
|
|
2645
2613
|
const rowHeight = {};
|
|
2646
2614
|
const manager = worksheet.getRowManager();
|
|
2647
2615
|
for (const { startRow, endRow } of ranges) for (let rowIndex = startRow; rowIndex < endRow + 1; rowIndex++) {
|
|
2648
|
-
var _manager$getRow
|
|
2649
|
-
rowHeight[rowIndex] = (
|
|
2616
|
+
var _manager$getRow;
|
|
2617
|
+
rowHeight[rowIndex] = ((_manager$getRow = manager.getRow(rowIndex)) === null || _manager$getRow === void 0 ? void 0 : _manager$getRow.h) ?? worksheet.getConfig().defaultRowHeight;
|
|
2650
2618
|
}
|
|
2651
2619
|
return {
|
|
2652
2620
|
unitId,
|
|
@@ -2675,11 +2643,11 @@ const SetWorksheetRowAutoHeightMutationFactory = (params, worksheet) => {
|
|
|
2675
2643
|
const results = [];
|
|
2676
2644
|
const manager = worksheet.getRowManager();
|
|
2677
2645
|
for (const rowInfo of rowsAutoHeightInfo) {
|
|
2678
|
-
var _manager$
|
|
2646
|
+
var _manager$getRow3;
|
|
2679
2647
|
const { row } = rowInfo;
|
|
2680
2648
|
results.push({
|
|
2681
2649
|
row,
|
|
2682
|
-
autoHeight: (
|
|
2650
|
+
autoHeight: ((_manager$getRow3 = manager.getRow(row)) === null || _manager$getRow3 === void 0 ? void 0 : _manager$getRow3.ah) ?? worksheet.getConfig().defaultRowHeight
|
|
2683
2651
|
});
|
|
2684
2652
|
}
|
|
2685
2653
|
return {
|
|
@@ -2713,10 +2681,7 @@ const SetWorksheetRowIsAutoHeightMutation = {
|
|
|
2713
2681
|
for (const { startRow, endRow } of ranges) for (let rowIndex = startRow; rowIndex <= endRow; rowIndex++) {
|
|
2714
2682
|
const row = manager.getRowOrCreate(rowIndex);
|
|
2715
2683
|
if (typeof autoHeightInfo === "number") row.ia = autoHeightInfo;
|
|
2716
|
-
else
|
|
2717
|
-
var _autoHeightInfo$rowIn;
|
|
2718
|
-
row.ia = (_autoHeightInfo$rowIn = autoHeightInfo[rowIndex]) !== null && _autoHeightInfo$rowIn !== void 0 ? _autoHeightInfo$rowIn : void 0;
|
|
2719
|
-
}
|
|
2684
|
+
else row.ia = autoHeightInfo[rowIndex] ?? void 0;
|
|
2720
2685
|
}
|
|
2721
2686
|
return true;
|
|
2722
2687
|
}
|
|
@@ -3552,7 +3517,8 @@ const findAllRectangle = (topMatrix) => {
|
|
|
3552
3517
|
* @returns {IRange[]}
|
|
3553
3518
|
*/
|
|
3554
3519
|
const rangeMerge = (ranges) => {
|
|
3555
|
-
|
|
3520
|
+
const topMatrix = createTopMatrixFromRanges(ranges);
|
|
3521
|
+
return findAllRectangle(topMatrix);
|
|
3556
3522
|
};
|
|
3557
3523
|
var RangeMergeUtil = class {
|
|
3558
3524
|
constructor() {
|
|
@@ -3575,7 +3541,8 @@ var RangeMergeUtil = class {
|
|
|
3575
3541
|
return this;
|
|
3576
3542
|
}
|
|
3577
3543
|
merge() {
|
|
3578
|
-
|
|
3544
|
+
const topMatrix = createTopMatrixFromMatrix(this._matrix);
|
|
3545
|
+
return findAllRectangle(topMatrix);
|
|
3579
3546
|
}
|
|
3580
3547
|
};
|
|
3581
3548
|
|
|
@@ -4245,21 +4212,12 @@ var WorkbookSelectionModel = class extends Disposable {
|
|
|
4245
4212
|
getCurrentSelections() {
|
|
4246
4213
|
return this._getCurrentSelections();
|
|
4247
4214
|
}
|
|
4248
|
-
/**
|
|
4249
|
-
* @deprecated use `getSelectionsOfWorksheet` instead.
|
|
4250
|
-
* @param sheetId
|
|
4251
|
-
* @returns
|
|
4252
|
-
*/
|
|
4253
|
-
getSelectionOfWorksheet(sheetId) {
|
|
4254
|
-
return this.getSelectionsOfWorksheet(sheetId);
|
|
4255
|
-
}
|
|
4256
4215
|
getSelectionsOfWorksheet(sheetId) {
|
|
4257
4216
|
if (!this._worksheetSelections.has(sheetId)) this._worksheetSelections.set(sheetId, []);
|
|
4258
4217
|
return this._worksheetSelections.get(sheetId);
|
|
4259
4218
|
}
|
|
4260
4219
|
getLastSelectionPrimaryCellOfWorksheet(sheetId) {
|
|
4261
|
-
|
|
4262
|
-
return (_this$_worksheetLastS = this._worksheetLastSelectionPrimaryCell.get(sheetId)) !== null && _this$_worksheetLastS !== void 0 ? _this$_worksheetLastS : null;
|
|
4220
|
+
return this._worksheetLastSelectionPrimaryCell.get(sheetId) ?? null;
|
|
4263
4221
|
}
|
|
4264
4222
|
setSelectionsOfWorksheet(sheetId, selections) {
|
|
4265
4223
|
this._worksheetSelections.set(sheetId, [...selections]);
|
|
@@ -4413,35 +4371,21 @@ let SheetsSelectionsService = class SheetsSelectionsService extends RxDisposable
|
|
|
4413
4371
|
setSelections(unitIdOrSelections, worksheetIdOrType, selectionDatas, type) {
|
|
4414
4372
|
if (typeof unitIdOrSelections === "string" && typeof worksheetIdOrType === "string") {
|
|
4415
4373
|
const unitId = unitIdOrSelections;
|
|
4416
|
-
this._ensureWorkbookSelection(unitId).setSelections(worksheetIdOrType, selectionDatas || [], type
|
|
4374
|
+
this._ensureWorkbookSelection(unitId).setSelections(worksheetIdOrType, selectionDatas || [], type ?? 3);
|
|
4417
4375
|
return;
|
|
4418
4376
|
}
|
|
4419
4377
|
const current = this._currentSelectionPos;
|
|
4420
4378
|
if (!current) throw new Error("[SheetsSelectionsService]: cannot find current selection position!");
|
|
4421
4379
|
const { unitId, sheetId } = current;
|
|
4422
4380
|
if (typeof unitIdOrSelections === "object") {
|
|
4423
|
-
|
|
4424
|
-
const
|
|
4425
|
-
const type = (_ref = worksheetIdOrType) !== null && _ref !== void 0 ? _ref : 3;
|
|
4381
|
+
const selectionData = unitIdOrSelections ?? selectionDatas;
|
|
4382
|
+
const type = worksheetIdOrType ?? 3;
|
|
4426
4383
|
this._ensureWorkbookSelection(unitId).setSelections(sheetId, selectionData, type);
|
|
4427
4384
|
}
|
|
4428
4385
|
}
|
|
4429
4386
|
clearCurrentSelections() {
|
|
4430
4387
|
this._getCurrentSelections().splice(0);
|
|
4431
4388
|
}
|
|
4432
|
-
/**
|
|
4433
|
-
* Determine whether multiple current selections overlap
|
|
4434
|
-
*
|
|
4435
|
-
* @deprecated this should be extracted to an pure function
|
|
4436
|
-
*/
|
|
4437
|
-
isOverlapping() {
|
|
4438
|
-
const selectionDataList = this.getCurrentSelections();
|
|
4439
|
-
if (selectionDataList == null) return false;
|
|
4440
|
-
return selectionDataList.some(({ range }, index) => selectionDataList.some(({ range: range2 }, index2) => {
|
|
4441
|
-
if (index === index2) return false;
|
|
4442
|
-
return range.startRow <= range2.endRow && range.endRow >= range2.startRow && range.startColumn <= range2.endColumn && range.endColumn >= range2.startColumn;
|
|
4443
|
-
}));
|
|
4444
|
-
}
|
|
4445
4389
|
_getCurrentSelections() {
|
|
4446
4390
|
const current = this._currentSelectionPos;
|
|
4447
4391
|
if (!current) return [];
|
|
@@ -5056,6 +5000,9 @@ RefSelectionsService = __decorate([__decorateParam(0, IUniverInstanceService)],
|
|
|
5056
5000
|
|
|
5057
5001
|
//#endregion
|
|
5058
5002
|
//#region src/commands/utils/selection-command-util.ts
|
|
5003
|
+
function hasOverlappingRanges(ranges) {
|
|
5004
|
+
return ranges.some((range, index) => ranges.slice(index + 1).some((other) => Rectangle.simpleRangesIntersect(range, other)));
|
|
5005
|
+
}
|
|
5059
5006
|
function getSelectionsService(accessor, fromCurrentSelection) {
|
|
5060
5007
|
const isInRefSelectionMode = accessor.get(IContextService).getContextValue(REF_SELECTIONS_ENABLED);
|
|
5061
5008
|
return accessor.get(isInRefSelectionMode && !fromCurrentSelection ? IRefSelectionsService : SheetsSelectionsService);
|
|
@@ -5130,15 +5077,14 @@ const MoveRangeCommand = {
|
|
|
5130
5077
|
}
|
|
5131
5078
|
};
|
|
5132
5079
|
function _resolveMoveRangeContext(accessor, params) {
|
|
5133
|
-
var _ref, _params$toUnitId, _params$fromSubUnitId, _ref2, _params$toSubUnitId;
|
|
5134
5080
|
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
5135
5081
|
const target = getSheetCommandTarget(univerInstanceService);
|
|
5136
|
-
const unitId =
|
|
5137
|
-
const fromSubUnitId =
|
|
5138
|
-
const toSubUnitId =
|
|
5082
|
+
const unitId = params.toUnitId ?? params.fromUnitId ?? (target === null || target === void 0 ? void 0 : target.unitId);
|
|
5083
|
+
const fromSubUnitId = params.fromSubUnitId ?? (target === null || target === void 0 ? void 0 : target.subUnitId);
|
|
5084
|
+
const toSubUnitId = params.toSubUnitId ?? params.fromSubUnitId ?? (target === null || target === void 0 ? void 0 : target.subUnitId);
|
|
5139
5085
|
if (!unitId || !fromSubUnitId || !toSubUnitId) return null;
|
|
5140
5086
|
if (params.fromUnitId && params.toUnitId && params.fromUnitId !== params.toUnitId) return null;
|
|
5141
|
-
const workbook = univerInstanceService.
|
|
5087
|
+
const workbook = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
5142
5088
|
const fromWorksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(fromSubUnitId);
|
|
5143
5089
|
const toWorksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(toSubUnitId);
|
|
5144
5090
|
if (!fromWorksheet || !toWorksheet) return null;
|
|
@@ -5151,7 +5097,6 @@ function _resolveMoveRangeContext(accessor, params) {
|
|
|
5151
5097
|
};
|
|
5152
5098
|
}
|
|
5153
5099
|
function getMoveRangeCommandMutations(accessor, params, options = {}) {
|
|
5154
|
-
var _interceptorCommands$, _interceptorCommands$2;
|
|
5155
5100
|
const { includeSelection = true, includeAfterCommand = true, includeAutoHeight = true } = options;
|
|
5156
5101
|
const context = _resolveMoveRangeContext(accessor, params);
|
|
5157
5102
|
if (!context) return null;
|
|
@@ -5173,12 +5118,12 @@ function getMoveRangeCommandMutations(accessor, params, options = {}) {
|
|
|
5173
5118
|
};
|
|
5174
5119
|
const interceptorCommands = sheetInterceptorService.onCommandExecute(commandInfo);
|
|
5175
5120
|
const redos = [
|
|
5176
|
-
...
|
|
5121
|
+
...interceptorCommands.preRedos ?? [],
|
|
5177
5122
|
...moveRangeMutations.redos,
|
|
5178
5123
|
...interceptorCommands.redos
|
|
5179
5124
|
];
|
|
5180
5125
|
const undos = [
|
|
5181
|
-
...
|
|
5126
|
+
...interceptorCommands.preUndos ?? [],
|
|
5182
5127
|
...moveRangeMutations.undos,
|
|
5183
5128
|
...interceptorCommands.undos
|
|
5184
5129
|
];
|
|
@@ -5246,8 +5191,7 @@ function getMoveRangeUndoRedoMutations(accessor, from, to, ignoreMerge = false)
|
|
|
5246
5191
|
const toRedoCellValue = new ObjectMatrix();
|
|
5247
5192
|
const toUndoCellValue = new ObjectMatrix();
|
|
5248
5193
|
Range.foreach(fromRange, (row, col) => {
|
|
5249
|
-
|
|
5250
|
-
const cellData = (_Tools$deepClone = Tools.deepClone(fromWorksheetCellMatrix.getValue(row, col))) !== null && _Tools$deepClone !== void 0 ? _Tools$deepClone : null;
|
|
5194
|
+
const cellData = Tools.deepClone(fromWorksheetCellMatrix.getValue(row, col)) ?? null;
|
|
5251
5195
|
if (cellData === null || cellData === void 0 ? void 0 : cellData.s) cellData.s = workbook.getStyles().get(cellData.s);
|
|
5252
5196
|
fromRedoCellValue.setValue(row, col, null);
|
|
5253
5197
|
fromUndoCellValue.setValue(row, col, cellData);
|
|
@@ -5257,8 +5201,7 @@ function getMoveRangeUndoRedoMutations(accessor, from, to, ignoreMerge = false)
|
|
|
5257
5201
|
toRedoCellValue.setValue(range.startRow, range.startColumn, Tools.deepClone(cellData));
|
|
5258
5202
|
});
|
|
5259
5203
|
Range.foreach(toRange, (row, col) => {
|
|
5260
|
-
|
|
5261
|
-
const cellData = (_Tools$deepClone2 = Tools.deepClone(toWorksheetCellMatrix.getValue(row, col))) !== null && _Tools$deepClone2 !== void 0 ? _Tools$deepClone2 : null;
|
|
5204
|
+
const cellData = Tools.deepClone(toWorksheetCellMatrix.getValue(row, col)) ?? null;
|
|
5262
5205
|
toUndoCellValue.setValue(row, col, cellData);
|
|
5263
5206
|
});
|
|
5264
5207
|
const redoMoveRangeMutationParams = {
|
|
@@ -5325,7 +5268,7 @@ const SetRangeValuesCommand = {
|
|
|
5325
5268
|
id: "sheet.command.set-range-values",
|
|
5326
5269
|
type: CommandType.COMMAND,
|
|
5327
5270
|
handler: (accessor, params) => {
|
|
5328
|
-
var _selectionManagerServ
|
|
5271
|
+
var _selectionManagerServ;
|
|
5329
5272
|
const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
|
|
5330
5273
|
if (!target) return false;
|
|
5331
5274
|
const currentSelections = (_selectionManagerServ = accessor.get(SheetsSelectionsService).getCurrentSelections()) === null || _selectionManagerServ === void 0 ? void 0 : _selectionManagerServ.map((s) => s.range);
|
|
@@ -5353,7 +5296,7 @@ const SetRangeValuesCommand = {
|
|
|
5353
5296
|
const setRangeValuesMutationRedoParams = {
|
|
5354
5297
|
unitId,
|
|
5355
5298
|
subUnitId,
|
|
5356
|
-
cellValue:
|
|
5299
|
+
cellValue: realCellValue ?? cellValue.getMatrix()
|
|
5357
5300
|
};
|
|
5358
5301
|
const setRangeValuesMutationUndoParams = SetRangeValuesUndoMutationFactory(accessor, setRangeValuesMutationRedoParams);
|
|
5359
5302
|
const cellHeights = mapObjectMatrix(setRangeValuesMutationRedoParams.cellValue, (row, col) => worksheet.getCellHeight(row, col) || void 0);
|
|
@@ -5413,7 +5356,7 @@ function getInsertRangeMutations(accessor, params) {
|
|
|
5413
5356
|
const { unitId, subUnitId, range, shiftDimension, cellValue = {} } = params;
|
|
5414
5357
|
const instanceService = accessor.get(IUniverInstanceService);
|
|
5415
5358
|
const sheetInterceptorService = accessor.get(SheetInterceptorService);
|
|
5416
|
-
const workbook = instanceService.
|
|
5359
|
+
const workbook = instanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
5417
5360
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
5418
5361
|
if (worksheet) {
|
|
5419
5362
|
const cellMatrix = worksheet.getCellMatrix();
|
|
@@ -5510,7 +5453,7 @@ function getRemoveRangeMutations(accessor, params) {
|
|
|
5510
5453
|
const { unitId, subUnitId, range, shiftDimension } = params;
|
|
5511
5454
|
const instanceService = accessor.get(IUniverInstanceService);
|
|
5512
5455
|
const sheetInterceptorService = accessor.get(SheetInterceptorService);
|
|
5513
|
-
const workbook = instanceService.
|
|
5456
|
+
const workbook = instanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
5514
5457
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
5515
5458
|
if (worksheet) {
|
|
5516
5459
|
const cellMatrix = worksheet.getCellMatrix();
|
|
@@ -5645,7 +5588,6 @@ const DeleteRangeMoveLeftCommand = {
|
|
|
5645
5588
|
type: CommandType.COMMAND,
|
|
5646
5589
|
id: DeleteRangeMoveLeftCommandId,
|
|
5647
5590
|
handler: async (accessor, params) => {
|
|
5648
|
-
var _sheetInterceptor$pre, _sheetInterceptor$pre2;
|
|
5649
5591
|
const commandService = accessor.get(ICommandService);
|
|
5650
5592
|
const undoRedoService = accessor.get(IUndoRedoService);
|
|
5651
5593
|
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
@@ -5671,11 +5613,11 @@ const DeleteRangeMoveLeftCommand = {
|
|
|
5671
5613
|
params: { range }
|
|
5672
5614
|
});
|
|
5673
5615
|
const { redo: removeRangeRedo, undo: removeRangeUndo } = getRemoveRangeMutations(accessor, deleteRangeMutationParams);
|
|
5674
|
-
const redos = [...
|
|
5616
|
+
const redos = [...sheetInterceptor.preRedos ?? [], ...removeRangeRedo];
|
|
5675
5617
|
const undos = [...sheetInterceptor.undos, ...removeRangeUndo];
|
|
5676
5618
|
redos.push(...sheetInterceptor.redos);
|
|
5677
5619
|
redos.push(followSelectionOperation(range, workbook, worksheet));
|
|
5678
|
-
undos.push(...
|
|
5620
|
+
undos.push(...sheetInterceptor.preUndos ?? []);
|
|
5679
5621
|
if (sequenceExecute(redos, commandService).result) {
|
|
5680
5622
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
5681
5623
|
id: DeleteRangeMoveLeftCommand.id,
|
|
@@ -5705,7 +5647,6 @@ const DeleteRangeMoveUpCommand = {
|
|
|
5705
5647
|
type: CommandType.COMMAND,
|
|
5706
5648
|
id: DeleteRangeMoveUpCommandId,
|
|
5707
5649
|
handler: async (accessor, params) => {
|
|
5708
|
-
var _sheetInterceptor$pre, _sheetInterceptor$pre2;
|
|
5709
5650
|
const commandService = accessor.get(ICommandService);
|
|
5710
5651
|
const undoRedoService = accessor.get(IUndoRedoService);
|
|
5711
5652
|
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
@@ -5731,11 +5672,11 @@ const DeleteRangeMoveUpCommand = {
|
|
|
5731
5672
|
params: { range }
|
|
5732
5673
|
});
|
|
5733
5674
|
const { redo: removeRangeRedo, undo: removeRangeUndo } = getRemoveRangeMutations(accessor, deleteRangeMutationParams);
|
|
5734
|
-
const redos = [...
|
|
5675
|
+
const redos = [...sheetInterceptor.preRedos ?? [], ...removeRangeRedo];
|
|
5735
5676
|
const undos = [...sheetInterceptor.undos, ...removeRangeUndo];
|
|
5736
5677
|
redos.push(...sheetInterceptor.redos);
|
|
5737
5678
|
redos.push(followSelectionOperation(range, workbook, worksheet));
|
|
5738
|
-
undos.push(...
|
|
5679
|
+
undos.push(...sheetInterceptor.preUndos ?? []);
|
|
5739
5680
|
if (sequenceExecute(redos, commandService).result) {
|
|
5740
5681
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
5741
5682
|
id: DeleteRangeMoveUpCommand.id,
|
|
@@ -5765,7 +5706,6 @@ const InsertRangeMoveDownCommand = {
|
|
|
5765
5706
|
type: CommandType.COMMAND,
|
|
5766
5707
|
id: InsertRangeMoveDownCommandId,
|
|
5767
5708
|
handler: async (accessor, params) => {
|
|
5768
|
-
var _sheetInterceptor$pre, _sheetInterceptor$pre2;
|
|
5769
5709
|
const commandService = accessor.get(ICommandService);
|
|
5770
5710
|
const undoRedoService = accessor.get(IUndoRedoService);
|
|
5771
5711
|
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
@@ -5773,7 +5713,7 @@ const InsertRangeMoveDownCommand = {
|
|
|
5773
5713
|
const sheetInterceptorService = accessor.get(SheetInterceptorService);
|
|
5774
5714
|
const errorService = accessor.get(ErrorService);
|
|
5775
5715
|
const localeService = accessor.get(LocaleService);
|
|
5776
|
-
if (selectionManagerService.
|
|
5716
|
+
if (hasOverlappingRanges(selectionManagerService.getCurrentSelections().map(({ range }) => range))) {
|
|
5777
5717
|
errorService.emit(localeService.t("sheets.info.overlappingSelections"));
|
|
5778
5718
|
return false;
|
|
5779
5719
|
}
|
|
@@ -5841,8 +5781,8 @@ const InsertRangeMoveDownCommand = {
|
|
|
5841
5781
|
});
|
|
5842
5782
|
redoMutations.push(...sheetInterceptor.redos);
|
|
5843
5783
|
redoMutations.push(followSelectionOperation(range, workbook, worksheet));
|
|
5844
|
-
undoMutations.push(...
|
|
5845
|
-
redoMutations.unshift(...
|
|
5784
|
+
undoMutations.push(...sheetInterceptor.preUndos ?? []);
|
|
5785
|
+
redoMutations.unshift(...sheetInterceptor.preRedos ?? []);
|
|
5846
5786
|
undoMutations.unshift(...sheetInterceptor.undos);
|
|
5847
5787
|
if (sequenceExecute(redoMutations, commandService).result) {
|
|
5848
5788
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
@@ -5873,7 +5813,6 @@ const InsertRangeMoveRightCommand = {
|
|
|
5873
5813
|
type: CommandType.COMMAND,
|
|
5874
5814
|
id: InsertRangeMoveRightCommandId,
|
|
5875
5815
|
handler: async (accessor, params) => {
|
|
5876
|
-
var _sheetInterceptor$pre, _sheetInterceptor$pre2;
|
|
5877
5816
|
const commandService = accessor.get(ICommandService);
|
|
5878
5817
|
const undoRedoService = accessor.get(IUndoRedoService);
|
|
5879
5818
|
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
@@ -5881,7 +5820,7 @@ const InsertRangeMoveRightCommand = {
|
|
|
5881
5820
|
const sheetInterceptorService = accessor.get(SheetInterceptorService);
|
|
5882
5821
|
const errorService = accessor.get(ErrorService);
|
|
5883
5822
|
const localeService = accessor.get(LocaleService);
|
|
5884
|
-
if (selectionManagerService.
|
|
5823
|
+
if (hasOverlappingRanges(selectionManagerService.getCurrentSelections().map(({ range }) => range))) {
|
|
5885
5824
|
errorService.emit(localeService.t("sheets.info.overlappingSelections"));
|
|
5886
5825
|
return false;
|
|
5887
5826
|
}
|
|
@@ -5949,8 +5888,8 @@ const InsertRangeMoveRightCommand = {
|
|
|
5949
5888
|
});
|
|
5950
5889
|
redoMutations.push(...sheetInterceptor.redos);
|
|
5951
5890
|
redoMutations.push(followSelectionOperation(range, workbook, worksheet));
|
|
5952
|
-
undoMutations.push(...
|
|
5953
|
-
redoMutations.unshift(...
|
|
5891
|
+
undoMutations.push(...sheetInterceptor.preUndos ?? []);
|
|
5892
|
+
redoMutations.unshift(...sheetInterceptor.preRedos ?? []);
|
|
5954
5893
|
undoMutations.unshift(...sheetInterceptor.undos);
|
|
5955
5894
|
if (sequenceExecute(redoMutations, commandService).result) {
|
|
5956
5895
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
@@ -6003,7 +5942,6 @@ const InsertRowByRangeCommand = {
|
|
|
6003
5942
|
type: CommandType.COMMAND,
|
|
6004
5943
|
id: "sheet.command.insert-row-by-range",
|
|
6005
5944
|
handler: (accessor, params) => {
|
|
6006
|
-
var _intercepted$preRedos, _intercepted$redos, _intercepted$preUndos, _intercepted$undos;
|
|
6007
5945
|
const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
|
|
6008
5946
|
if (!target) throw new Error("Workbook or Worksheet not found at InsertRowByRangeCommand");
|
|
6009
5947
|
const { workbook, worksheet, unitId, subUnitId } = target;
|
|
@@ -6046,11 +5984,11 @@ const InsertRowByRangeCommand = {
|
|
|
6046
5984
|
id: InsertRowCommand.id,
|
|
6047
5985
|
params
|
|
6048
5986
|
});
|
|
6049
|
-
redos.unshift(...
|
|
6050
|
-
redos.push(...
|
|
5987
|
+
redos.unshift(...intercepted.preRedos ?? []);
|
|
5988
|
+
redos.push(...intercepted.redos ?? []);
|
|
6051
5989
|
redos.push(followSelectionOperation(range, workbook, worksheet));
|
|
6052
|
-
undos.unshift(...
|
|
6053
|
-
undos.push(...
|
|
5990
|
+
undos.unshift(...intercepted.preUndos ?? []);
|
|
5991
|
+
undos.push(...intercepted.undos ?? []);
|
|
6054
5992
|
if (sequenceExecute(redos, commandService).result) {
|
|
6055
5993
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
6056
5994
|
id: InsertRowCommand.id,
|
|
@@ -6226,7 +6164,6 @@ const InsertColByRangeCommand = {
|
|
|
6226
6164
|
type: CommandType.COMMAND,
|
|
6227
6165
|
id: "sheet.command.insert-col-by-range",
|
|
6228
6166
|
handler: (accessor, params) => {
|
|
6229
|
-
var _intercepted$preRedos2, _intercepted$redos2, _intercepted$preUndos2, _intercepted$undos2;
|
|
6230
6167
|
const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
|
|
6231
6168
|
if (!target) throw new Error("Workbook or Worksheet not found at InsertColByRangeCommand");
|
|
6232
6169
|
const { workbook, worksheet, unitId, subUnitId } = target;
|
|
@@ -6269,11 +6206,11 @@ const InsertColByRangeCommand = {
|
|
|
6269
6206
|
id: InsertColCommand.id,
|
|
6270
6207
|
params
|
|
6271
6208
|
});
|
|
6272
|
-
redos.unshift(...
|
|
6273
|
-
redos.push(...
|
|
6209
|
+
redos.unshift(...intercepted.preRedos ?? []);
|
|
6210
|
+
redos.push(...intercepted.redos ?? []);
|
|
6274
6211
|
redos.push(followSelectionOperation(range, workbook, worksheet));
|
|
6275
|
-
undos.unshift(...
|
|
6276
|
-
undos.push(...
|
|
6212
|
+
undos.unshift(...intercepted.preUndos ?? []);
|
|
6213
|
+
undos.push(...intercepted.undos ?? []);
|
|
6277
6214
|
if (sequenceExecute(redos, commandService).result) {
|
|
6278
6215
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
6279
6216
|
id: InsertColCommand.id,
|
|
@@ -6435,7 +6372,6 @@ const RemoveRowByRangeCommand = {
|
|
|
6435
6372
|
type: CommandType.COMMAND,
|
|
6436
6373
|
id: "sheet.command.remove-row-by-range",
|
|
6437
6374
|
handler: (accessor, params) => {
|
|
6438
|
-
var _intercepted$preRedos;
|
|
6439
6375
|
if (!params) return false;
|
|
6440
6376
|
const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
|
|
6441
6377
|
if (!target) return false;
|
|
@@ -6454,10 +6390,11 @@ const RemoveRowByRangeCommand = {
|
|
|
6454
6390
|
range: visibleRange
|
|
6455
6391
|
};
|
|
6456
6392
|
const undoRemoveRowsParams = RemoveRowsUndoMutationFactory(removeRowsParams, worksheet);
|
|
6393
|
+
const removedRows = worksheet.getCellMatrix().getSlice(visibleRange.startRow, visibleRange.endRow, 0, worksheet.getColumnCount() - 1);
|
|
6457
6394
|
const undoSetRangeValuesParams = {
|
|
6458
6395
|
unitId,
|
|
6459
6396
|
subUnitId,
|
|
6460
|
-
cellValue:
|
|
6397
|
+
cellValue: removedRows.getMatrix()
|
|
6461
6398
|
};
|
|
6462
6399
|
redos.push({
|
|
6463
6400
|
id: RemoveRowMutation.id,
|
|
@@ -6474,33 +6411,33 @@ const RemoveRowByRangeCommand = {
|
|
|
6474
6411
|
redoMutations.push(...redos);
|
|
6475
6412
|
undoMutations.unshift(...undos);
|
|
6476
6413
|
});
|
|
6414
|
+
const interceptorParams = params;
|
|
6477
6415
|
const intercepted = sheetInterceptorService.onCommandExecute({
|
|
6478
6416
|
id: RemoveRowCommandId,
|
|
6479
|
-
params:
|
|
6417
|
+
params: interceptorParams
|
|
6480
6418
|
});
|
|
6481
6419
|
const commandService = accessor.get(ICommandService);
|
|
6482
6420
|
if (sequenceExecute([
|
|
6483
|
-
...
|
|
6421
|
+
...intercepted.preRedos ?? [],
|
|
6484
6422
|
...redoMutations,
|
|
6485
6423
|
...intercepted.redos
|
|
6486
6424
|
], commandService).result) {
|
|
6487
|
-
var _intercepted$preUndos, _intercepted$preRedos2;
|
|
6488
6425
|
setSelection(range, workbook, worksheet, commandService);
|
|
6489
6426
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
6490
6427
|
id: RemoveRowCommandId,
|
|
6491
|
-
params:
|
|
6428
|
+
params: interceptorParams
|
|
6492
6429
|
});
|
|
6493
6430
|
sequenceExecute(afterInterceptors.redos, commandService);
|
|
6494
6431
|
accessor.get(IUndoRedoService).pushUndoRedo({
|
|
6495
6432
|
unitID: unitId,
|
|
6496
6433
|
undoMutations: [
|
|
6497
|
-
...
|
|
6434
|
+
...intercepted.preUndos ?? [],
|
|
6498
6435
|
...undoMutations,
|
|
6499
6436
|
...intercepted.undos,
|
|
6500
6437
|
...afterInterceptors.undos
|
|
6501
6438
|
],
|
|
6502
6439
|
redoMutations: [
|
|
6503
|
-
...
|
|
6440
|
+
...intercepted.preRedos ?? [],
|
|
6504
6441
|
...redoMutations,
|
|
6505
6442
|
...intercepted.redos,
|
|
6506
6443
|
...afterInterceptors.redos
|
|
@@ -6534,7 +6471,11 @@ const RemoveRowCommand = {
|
|
|
6534
6471
|
};
|
|
6535
6472
|
if (!await sheetInterceptorService.beforeCommandExecute({
|
|
6536
6473
|
id: RemoveRowCommand.id,
|
|
6537
|
-
params: {
|
|
6474
|
+
params: {
|
|
6475
|
+
range,
|
|
6476
|
+
unitId,
|
|
6477
|
+
subUnitId
|
|
6478
|
+
}
|
|
6538
6479
|
})) return false;
|
|
6539
6480
|
return commandService.syncExecuteCommand(RemoveRowByRangeCommand.id, {
|
|
6540
6481
|
range,
|
|
@@ -6548,7 +6489,6 @@ const RemoveColByRangeCommand = {
|
|
|
6548
6489
|
type: CommandType.COMMAND,
|
|
6549
6490
|
id: "sheet.command.remove-col-by-range",
|
|
6550
6491
|
handler: (accessor, params) => {
|
|
6551
|
-
var _intercepted$preRedos3;
|
|
6552
6492
|
if (!params) return false;
|
|
6553
6493
|
const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
|
|
6554
6494
|
if (!target) return false;
|
|
@@ -6566,30 +6506,30 @@ const RemoveColByRangeCommand = {
|
|
|
6566
6506
|
subUnitId,
|
|
6567
6507
|
cellValue: worksheet.getCellMatrix().getSlice(0, worksheet.getRowCount() - 1, range.startColumn, range.endColumn).getMatrix()
|
|
6568
6508
|
};
|
|
6509
|
+
const interceptorParams = params;
|
|
6569
6510
|
const intercepted = sheetInterceptorService.onCommandExecute({
|
|
6570
6511
|
id: RemoveColCommandId,
|
|
6571
|
-
params:
|
|
6512
|
+
params: interceptorParams
|
|
6572
6513
|
});
|
|
6573
6514
|
const commandService = accessor.get(ICommandService);
|
|
6574
6515
|
if (sequenceExecute([
|
|
6575
|
-
...
|
|
6516
|
+
...intercepted.preRedos ?? [],
|
|
6576
6517
|
{
|
|
6577
6518
|
id: RemoveColMutation.id,
|
|
6578
6519
|
params: removeColParams
|
|
6579
6520
|
},
|
|
6580
6521
|
...intercepted.redos
|
|
6581
6522
|
], commandService).result) {
|
|
6582
|
-
var _intercepted$preUndos2, _intercepted$preRedos4;
|
|
6583
6523
|
setSelection(range, workbook, worksheet, commandService);
|
|
6584
6524
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
6585
6525
|
id: RemoveColCommandId,
|
|
6586
|
-
params:
|
|
6526
|
+
params: interceptorParams
|
|
6587
6527
|
});
|
|
6588
6528
|
sequenceExecute(afterInterceptors.redos, commandService);
|
|
6589
6529
|
accessor.get(IUndoRedoService).pushUndoRedo({
|
|
6590
6530
|
unitID: unitId,
|
|
6591
6531
|
undoMutations: [
|
|
6592
|
-
...
|
|
6532
|
+
...intercepted.preUndos ?? [],
|
|
6593
6533
|
{
|
|
6594
6534
|
id: InsertColMutation.id,
|
|
6595
6535
|
params: undoRemoveColParams
|
|
@@ -6602,7 +6542,7 @@ const RemoveColByRangeCommand = {
|
|
|
6602
6542
|
...afterInterceptors.undos
|
|
6603
6543
|
],
|
|
6604
6544
|
redoMutations: [
|
|
6605
|
-
...
|
|
6545
|
+
...intercepted.preRedos ?? [],
|
|
6606
6546
|
{
|
|
6607
6547
|
id: RemoveColMutation.id,
|
|
6608
6548
|
params: removeColParams
|
|
@@ -6630,7 +6570,7 @@ const RemoveColCommand = {
|
|
|
6630
6570
|
let range = params === null || params === void 0 ? void 0 : params.range;
|
|
6631
6571
|
if (!range) range = (_selectionManagerServ2 = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ2 === void 0 ? void 0 : _selectionManagerServ2.range;
|
|
6632
6572
|
if (!range) return false;
|
|
6633
|
-
const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
|
|
6573
|
+
const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
|
|
6634
6574
|
if (!target) return false;
|
|
6635
6575
|
const { worksheet, subUnitId, unitId } = target;
|
|
6636
6576
|
range = {
|
|
@@ -6640,7 +6580,11 @@ const RemoveColCommand = {
|
|
|
6640
6580
|
};
|
|
6641
6581
|
if (!await sheetInterceptorService.beforeCommandExecute({
|
|
6642
6582
|
id: RemoveColCommand.id,
|
|
6643
|
-
params: {
|
|
6583
|
+
params: {
|
|
6584
|
+
range,
|
|
6585
|
+
unitId,
|
|
6586
|
+
subUnitId
|
|
6587
|
+
}
|
|
6644
6588
|
})) return false;
|
|
6645
6589
|
return commandService.syncExecuteCommand(RemoveColByRangeCommand.id, {
|
|
6646
6590
|
range,
|
|
@@ -6678,7 +6622,7 @@ const RemoveSheetMutation = {
|
|
|
6678
6622
|
handler: (accessor, params) => {
|
|
6679
6623
|
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
6680
6624
|
const { subUnitId, unitId } = params;
|
|
6681
|
-
const workbook = univerInstanceService.
|
|
6625
|
+
const workbook = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
6682
6626
|
if (!workbook) return false;
|
|
6683
6627
|
return workbook.removeSheet(subUnitId);
|
|
6684
6628
|
}
|
|
@@ -6700,7 +6644,6 @@ const MoveRowsCommand = {
|
|
|
6700
6644
|
id: MoveRowsCommandId,
|
|
6701
6645
|
type: CommandType.COMMAND,
|
|
6702
6646
|
handler: (accessor, params) => {
|
|
6703
|
-
var _interceptorCommands$, _interceptorCommands$2;
|
|
6704
6647
|
const selectionManagerService = accessor.get(SheetsSelectionsService);
|
|
6705
6648
|
const { fromRange: { startRow: fromRow }, toRange: { startRow: toRow }, range } = params;
|
|
6706
6649
|
const selections = range ? [covertRangeToSelection(range)] : selectionManagerService.getCurrentSelections();
|
|
@@ -6742,11 +6685,11 @@ const MoveRowsCommand = {
|
|
|
6742
6685
|
id: MoveRowsCommand.id,
|
|
6743
6686
|
params
|
|
6744
6687
|
});
|
|
6745
|
-
const redos = [...
|
|
6688
|
+
const redos = [...interceptorCommands.preRedos ?? [], {
|
|
6746
6689
|
id: MoveRowsMutation.id,
|
|
6747
6690
|
params: moveRowsParams
|
|
6748
6691
|
}];
|
|
6749
|
-
const undos = [...
|
|
6692
|
+
const undos = [...interceptorCommands.preUndos ?? [], {
|
|
6750
6693
|
id: MoveRowsMutation.id,
|
|
6751
6694
|
params: undoMoveRowsParams
|
|
6752
6695
|
}];
|
|
@@ -6812,7 +6755,6 @@ const MoveColsCommand = {
|
|
|
6812
6755
|
id: MoveColsCommandId,
|
|
6813
6756
|
type: CommandType.COMMAND,
|
|
6814
6757
|
handler: (accessor, params) => {
|
|
6815
|
-
var _interceptorCommands$3, _interceptorCommands$4;
|
|
6816
6758
|
const selectionManagerService = accessor.get(SheetsSelectionsService);
|
|
6817
6759
|
const { fromRange: { startColumn: fromCol }, toRange: { startColumn: toCol }, range } = params;
|
|
6818
6760
|
const selections = range ? [covertRangeToSelection(range)] : selectionManagerService.getCurrentSelections();
|
|
@@ -6854,11 +6796,11 @@ const MoveColsCommand = {
|
|
|
6854
6796
|
id: MoveColsCommand.id,
|
|
6855
6797
|
params
|
|
6856
6798
|
});
|
|
6857
|
-
const redos = [...
|
|
6799
|
+
const redos = [...interceptorCommands.preRedos ?? [], {
|
|
6858
6800
|
id: MoveColsMutation.id,
|
|
6859
6801
|
params: moveColsParams
|
|
6860
6802
|
}];
|
|
6861
|
-
const undos = [...
|
|
6803
|
+
const undos = [...interceptorCommands.preUndos ?? [], {
|
|
6862
6804
|
id: MoveColsMutation.id,
|
|
6863
6805
|
params: undoMoveColsParams
|
|
6864
6806
|
}];
|
|
@@ -6933,7 +6875,6 @@ const ReorderRangeCommand = {
|
|
|
6933
6875
|
id: ReorderRangeCommandId,
|
|
6934
6876
|
type: CommandType.COMMAND,
|
|
6935
6877
|
handler: (accessor, params) => {
|
|
6936
|
-
var _interceptorCommands$, _interceptorCommands$2;
|
|
6937
6878
|
const { subUnitId, unitId, range, order } = params;
|
|
6938
6879
|
const commandService = accessor.get(ICommandService);
|
|
6939
6880
|
const reorderMutation = {
|
|
@@ -6955,12 +6896,12 @@ const ReorderRangeCommand = {
|
|
|
6955
6896
|
params
|
|
6956
6897
|
});
|
|
6957
6898
|
const redos = [
|
|
6958
|
-
...
|
|
6899
|
+
...interceptorCommands.preRedos ?? [],
|
|
6959
6900
|
reorderMutation,
|
|
6960
6901
|
...interceptorCommands.redos
|
|
6961
6902
|
];
|
|
6962
6903
|
const undos = [
|
|
6963
|
-
...
|
|
6904
|
+
...interceptorCommands.preUndos ?? [],
|
|
6964
6905
|
undoReorderMutation,
|
|
6965
6906
|
...interceptorCommands.undos
|
|
6966
6907
|
];
|
|
@@ -7179,9 +7120,8 @@ const handleReorderRangeCommon = (param, targetRange) => {
|
|
|
7179
7120
|
const cacheMatrix = new ObjectMatrix();
|
|
7180
7121
|
Range.foreach(range, (row, col) => {
|
|
7181
7122
|
if (Object.prototype.hasOwnProperty.call(order, row)) {
|
|
7182
|
-
var _matrix$getValue;
|
|
7183
7123
|
const targetRow = order[row];
|
|
7184
|
-
const cloneCell =
|
|
7124
|
+
const cloneCell = matrix.getValue(targetRow, col) ?? 0;
|
|
7185
7125
|
cacheMatrix.setValue(row, col, cloneCell);
|
|
7186
7126
|
}
|
|
7187
7127
|
});
|
|
@@ -7259,7 +7199,7 @@ const handleMoveRangeCommon = (param, targetRange) => {
|
|
|
7259
7199
|
matrix.setValue(row, col, 1);
|
|
7260
7200
|
});
|
|
7261
7201
|
const fromMatrix = new ObjectMatrix();
|
|
7262
|
-
const loopFromRange =
|
|
7202
|
+
const loopFromRange = getIntersectRange(fromRange, targetRange);
|
|
7263
7203
|
loopFromRange && Range.foreach(loopFromRange, (row, col) => {
|
|
7264
7204
|
if (matrix.getValue(row, col)) {
|
|
7265
7205
|
matrix.setValue(row, col, void 0);
|
|
@@ -7275,10 +7215,9 @@ const handleMoveRangeCommon = (param, targetRange) => {
|
|
|
7275
7215
|
endRow: toRange.endRow - rowOffset
|
|
7276
7216
|
};
|
|
7277
7217
|
loopToRange && Range.foreach(loopToRange, (row, col) => {
|
|
7278
|
-
var _fromMatrix$getValue;
|
|
7279
7218
|
const targetRow = row + rowOffset;
|
|
7280
7219
|
const targetCol = col + columnOffset;
|
|
7281
|
-
matrix.setValue(targetRow, targetCol,
|
|
7220
|
+
matrix.setValue(targetRow, targetCol, fromMatrix.getValue(row, col) ?? 0);
|
|
7282
7221
|
});
|
|
7283
7222
|
return queryObjectMatrix(matrix, (value) => value === 1);
|
|
7284
7223
|
};
|
|
@@ -7289,7 +7228,7 @@ const handleBaseRemoveRange = (_removeRange, _targetRange) => {
|
|
|
7289
7228
|
const getRowLength = (range) => range.endRow - range.startRow + 1;
|
|
7290
7229
|
if (removeRange.startRow <= targetRange.startRow && removeRange.endRow >= targetRange.endRow) {
|
|
7291
7230
|
if (targetRange.startColumn < removeRange.startColumn && targetRange.endColumn >= removeRange.startColumn && targetRange.endColumn <= removeRange.endColumn || targetRange.startColumn < removeRange.startColumn && targetRange.endColumn >= removeRange.endColumn) {
|
|
7292
|
-
const intersectedRange =
|
|
7231
|
+
const intersectedRange = getIntersectRange(targetRange, removeRange);
|
|
7293
7232
|
if (intersectedRange) return {
|
|
7294
7233
|
step: 0,
|
|
7295
7234
|
length: -getLength(intersectedRange)
|
|
@@ -7297,7 +7236,7 @@ const handleBaseRemoveRange = (_removeRange, _targetRange) => {
|
|
|
7297
7236
|
}
|
|
7298
7237
|
if (targetRange.startColumn >= removeRange.startColumn && targetRange.endColumn <= removeRange.endColumn && getRowLength(removeRange) >= getRowLength(targetRange)) return null;
|
|
7299
7238
|
if (targetRange.startColumn >= removeRange.startColumn && targetRange.startColumn <= removeRange.endColumn && targetRange.endColumn > removeRange.endColumn) {
|
|
7300
|
-
const intersectedRange =
|
|
7239
|
+
const intersectedRange = getIntersectRange(targetRange, removeRange);
|
|
7301
7240
|
if (intersectedRange) {
|
|
7302
7241
|
const length = -getLength(intersectedRange);
|
|
7303
7242
|
return {
|
|
@@ -7488,7 +7427,7 @@ const handleInsertRangeMoveDownCommon = (param, targetRange) => {
|
|
|
7488
7427
|
endRow: Number.POSITIVE_INFINITY
|
|
7489
7428
|
};
|
|
7490
7429
|
const noMoveRanges = Rectangle.subtract(targetRange, bottomRange);
|
|
7491
|
-
const targetMoveRange =
|
|
7430
|
+
const targetMoveRange = getIntersectRange(bottomRange, targetRange);
|
|
7492
7431
|
if (!targetMoveRange) return [targetRange];
|
|
7493
7432
|
const matrix = new ObjectMatrix();
|
|
7494
7433
|
noMoveRanges.forEach((noMoveRange) => {
|
|
@@ -7525,7 +7464,7 @@ const handleInsertRangeMoveRightCommon = (param, targetRange) => {
|
|
|
7525
7464
|
endColumn: Number.POSITIVE_INFINITY
|
|
7526
7465
|
};
|
|
7527
7466
|
const noMoveRanges = Rectangle.subtract(targetRange, bottomRange);
|
|
7528
|
-
const targetMoveRange =
|
|
7467
|
+
const targetMoveRange = getIntersectRange(bottomRange, targetRange);
|
|
7529
7468
|
if (!targetMoveRange) return [targetRange];
|
|
7530
7469
|
const matrix = new ObjectMatrix();
|
|
7531
7470
|
noMoveRanges.forEach((noMoveRange) => {
|
|
@@ -7566,9 +7505,9 @@ const handleDeleteRangeMoveLeftCommon = (param, targetRange) => {
|
|
|
7566
7505
|
endColumn: Number.POSITIVE_INFINITY
|
|
7567
7506
|
};
|
|
7568
7507
|
const moveCount = range.endColumn - range.startColumn + 1;
|
|
7569
|
-
const targetDeleteRange =
|
|
7508
|
+
const targetDeleteRange = getIntersectRange(range, targetRange);
|
|
7570
7509
|
const noMoveRanges = Rectangle.subtract(targetRange, rightRange);
|
|
7571
|
-
const targetMoveRange =
|
|
7510
|
+
const targetMoveRange = getIntersectRange(rightRange, targetRange);
|
|
7572
7511
|
if (!targetDeleteRange && !targetMoveRange) return [targetRange];
|
|
7573
7512
|
const matrix = new ObjectMatrix();
|
|
7574
7513
|
targetMoveRange && Range.foreach(targetMoveRange, (row, col) => {
|
|
@@ -7611,9 +7550,9 @@ const handleDeleteRangeMoveUpCommon = (param, targetRange) => {
|
|
|
7611
7550
|
endRow: Number.POSITIVE_INFINITY
|
|
7612
7551
|
};
|
|
7613
7552
|
const moveCount = range.endRow - range.startRow + 1;
|
|
7614
|
-
const targetDeleteRange =
|
|
7553
|
+
const targetDeleteRange = getIntersectRange(range, targetRange);
|
|
7615
7554
|
const noMoveRanges = Rectangle.subtract(targetRange, bottomRange);
|
|
7616
|
-
const targetMoveRange =
|
|
7555
|
+
const targetMoveRange = getIntersectRange(bottomRange, targetRange);
|
|
7617
7556
|
if (!targetDeleteRange && !targetMoveRange) return [targetRange];
|
|
7618
7557
|
const matrix = new ObjectMatrix();
|
|
7619
7558
|
targetMoveRange && Range.foreach(targetMoveRange, (row, col) => {
|
|
@@ -7630,8 +7569,7 @@ const handleDeleteRangeMoveUpCommon = (param, targetRange) => {
|
|
|
7630
7569
|
return queryObjectMatrix(matrix, (v) => v === 1);
|
|
7631
7570
|
};
|
|
7632
7571
|
const handleRemoveRowCommon = (param, targetRange) => {
|
|
7633
|
-
|
|
7634
|
-
const mergedRemoved = mergeIntervals(((_param$ranges = param.ranges) !== null && _param$ranges !== void 0 ? _param$ranges : [param.range]).map((range) => [range.startRow, range.endRow]));
|
|
7572
|
+
const mergedRemoved = mergeIntervals((param.ranges ?? [param.range]).map((range) => [range.startRow, range.endRow]));
|
|
7635
7573
|
let targetStartRow = targetRange.startRow;
|
|
7636
7574
|
let targetEndRow = targetRange.endRow;
|
|
7637
7575
|
for (let i = mergedRemoved.length - 1; i >= 0; i--) {
|
|
@@ -8091,7 +8029,7 @@ function getSeparateEffectedRangesOnCommand(accessor, command) {
|
|
|
8091
8029
|
}
|
|
8092
8030
|
case EffectRefRangId.RemoveRowCommandId: {
|
|
8093
8031
|
const params = command.params;
|
|
8094
|
-
const target = getSheetCommandTarget(univerInstanceService);
|
|
8032
|
+
const target = getSheetCommandTarget(univerInstanceService, params);
|
|
8095
8033
|
if (!target) return;
|
|
8096
8034
|
const { worksheet, unitId, subUnitId } = target;
|
|
8097
8035
|
const { range } = params;
|
|
@@ -8107,7 +8045,7 @@ function getSeparateEffectedRangesOnCommand(accessor, command) {
|
|
|
8107
8045
|
}
|
|
8108
8046
|
case EffectRefRangId.RemoveColCommandId: {
|
|
8109
8047
|
const params = command.params;
|
|
8110
|
-
const target = getSheetCommandTarget(univerInstanceService);
|
|
8048
|
+
const target = getSheetCommandTarget(univerInstanceService, params);
|
|
8111
8049
|
if (!target) return;
|
|
8112
8050
|
const { worksheet, unitId, subUnitId } = target;
|
|
8113
8051
|
const { range } = params;
|
|
@@ -8182,8 +8120,9 @@ function getSeparateEffectedRangesOnCommand(accessor, command) {
|
|
|
8182
8120
|
const MERGE_REDO = createInterceptorKey("MERGE_REDO");
|
|
8183
8121
|
const MERGE_UNDO = createInterceptorKey("MERGE_UNDO");
|
|
8184
8122
|
var WatchRange = class extends Disposable {
|
|
8185
|
-
constructor(_unitId, _subUnitId, _range, _callback, _skipIntersects = false) {
|
|
8123
|
+
constructor(revision, _unitId, _subUnitId, _range, _callback, _skipIntersects = false) {
|
|
8186
8124
|
super();
|
|
8125
|
+
this.revision = revision;
|
|
8187
8126
|
this._unitId = _unitId;
|
|
8188
8127
|
this._subUnitId = _subUnitId;
|
|
8189
8128
|
this._range = _range;
|
|
@@ -8222,6 +8161,8 @@ let RefRangeService = class RefRangeService extends Disposable {
|
|
|
8222
8161
|
MERGE_UNDO
|
|
8223
8162
|
}));
|
|
8224
8163
|
_defineProperty(this, "_watchRanges", /* @__PURE__ */ new Set());
|
|
8164
|
+
_defineProperty(this, "_watchRangesListener", null);
|
|
8165
|
+
_defineProperty(this, "_watchRangeRevision", 0);
|
|
8225
8166
|
_defineProperty(this, "_refRangeManagerMap", /* @__PURE__ */ new Map());
|
|
8226
8167
|
_defineProperty(this, "_serializer", createRangeSerializer());
|
|
8227
8168
|
_defineProperty(this, "_onRefRangeChange", () => {
|
|
@@ -8253,15 +8194,14 @@ let RefRangeService = class RefRangeService extends Disposable {
|
|
|
8253
8194
|
}], unitId, subUnitId);
|
|
8254
8195
|
}
|
|
8255
8196
|
case EffectRefRangId.MoveRangeCommandId: {
|
|
8256
|
-
var _params$toUnitId, _params$toSubUnitId;
|
|
8257
8197
|
const params = command.params;
|
|
8258
8198
|
const sourceTarget = getSheetCommandTarget(this._univerInstanceService, {
|
|
8259
8199
|
unitId: params.fromUnitId,
|
|
8260
8200
|
subUnitId: params.fromSubUnitId
|
|
8261
8201
|
});
|
|
8262
8202
|
const destinationTarget = getSheetCommandTarget(this._univerInstanceService, {
|
|
8263
|
-
unitId:
|
|
8264
|
-
subUnitId:
|
|
8203
|
+
unitId: params.toUnitId ?? params.fromUnitId,
|
|
8204
|
+
subUnitId: params.toSubUnitId ?? params.fromSubUnitId
|
|
8265
8205
|
});
|
|
8266
8206
|
if (!sourceTarget && !destinationTarget) return [];
|
|
8267
8207
|
if (sourceTarget && destinationTarget && sourceTarget.unitId === destinationTarget.unitId && sourceTarget.subUnitId === destinationTarget.subUnitId) return this._checkRange([params.fromRange, params.toRange], sourceTarget.unitId, sourceTarget.subUnitId);
|
|
@@ -8300,7 +8240,7 @@ let RefRangeService = class RefRangeService extends Disposable {
|
|
|
8300
8240
|
}
|
|
8301
8241
|
case EffectRefRangId.RemoveRowCommandId: {
|
|
8302
8242
|
const params = command.params;
|
|
8303
|
-
const target = getSheetCommandTarget(this._univerInstanceService);
|
|
8243
|
+
const target = getSheetCommandTarget(this._univerInstanceService, params);
|
|
8304
8244
|
if (!target) return [];
|
|
8305
8245
|
const { worksheet, unitId, subUnitId } = target;
|
|
8306
8246
|
const effectRange = {
|
|
@@ -8314,7 +8254,7 @@ let RefRangeService = class RefRangeService extends Disposable {
|
|
|
8314
8254
|
}
|
|
8315
8255
|
case EffectRefRangId.RemoveColCommandId: {
|
|
8316
8256
|
const params = command.params;
|
|
8317
|
-
const target = getSheetCommandTarget(this._univerInstanceService);
|
|
8257
|
+
const target = getSheetCommandTarget(this._univerInstanceService, params);
|
|
8318
8258
|
if (!target) return [];
|
|
8319
8259
|
const { worksheet, unitId, subUnitId } = target;
|
|
8320
8260
|
const effectRange = {
|
|
@@ -8379,11 +8319,10 @@ let RefRangeService = class RefRangeService extends Disposable {
|
|
|
8379
8319
|
result.push(v);
|
|
8380
8320
|
return result;
|
|
8381
8321
|
}, []).reduce((result, currentValue) => {
|
|
8382
|
-
var _currentValue$preRedo, _currentValue$preUndo;
|
|
8383
8322
|
result.redos.push(...currentValue.redos);
|
|
8384
8323
|
result.undos.push(...currentValue.undos);
|
|
8385
|
-
result.preRedos.push(...
|
|
8386
|
-
result.preUndos.push(...
|
|
8324
|
+
result.preRedos.push(...currentValue.preRedos ?? []);
|
|
8325
|
+
result.preUndos.push(...currentValue.preUndos ?? []);
|
|
8387
8326
|
return result;
|
|
8388
8327
|
}, {
|
|
8389
8328
|
redos: [],
|
|
@@ -8474,18 +8413,22 @@ let RefRangeService = class RefRangeService extends Disposable {
|
|
|
8474
8413
|
});
|
|
8475
8414
|
}
|
|
8476
8415
|
watchRange(unitId, subUnitId, range, callback, skipIntersects) {
|
|
8477
|
-
|
|
8478
|
-
if (this._watchRanges.size === 0) watchRangesListener = this._commandService.onCommandExecuted((command) => {
|
|
8416
|
+
if (!this._watchRangesListener) this._watchRangesListener = this.disposeWithMe(this._commandService.onCommandExecuted((command) => {
|
|
8479
8417
|
if (command.type !== CommandType.MUTATION) return false;
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8418
|
+
const revision = this._watchRangeRevision;
|
|
8419
|
+
for (const watchRange of this._watchRanges) {
|
|
8420
|
+
if (watchRange.revision > revision) continue;
|
|
8421
|
+
watchRange.onMutation(command);
|
|
8422
|
+
}
|
|
8423
|
+
}));
|
|
8424
|
+
const watchRange = new WatchRange(++this._watchRangeRevision, unitId, subUnitId, range, callback, skipIntersects);
|
|
8483
8425
|
this._watchRanges.add(watchRange);
|
|
8484
8426
|
const teardownWatching = toDisposable(() => {
|
|
8485
8427
|
this._watchRanges.delete(watchRange);
|
|
8486
8428
|
if (this._watchRanges.size === 0) {
|
|
8487
|
-
|
|
8488
|
-
|
|
8429
|
+
var _this$_watchRangesLis;
|
|
8430
|
+
(_this$_watchRangesLis = this._watchRangesListener) === null || _this$_watchRangesLis === void 0 || _this$_watchRangesLis.dispose();
|
|
8431
|
+
this._watchRangesListener = null;
|
|
8489
8432
|
}
|
|
8490
8433
|
});
|
|
8491
8434
|
const registerToService = this.disposeWithMe(teardownWatching);
|
|
@@ -8743,7 +8686,7 @@ let MergeCellController = class MergeCellController extends Disposable {
|
|
|
8743
8686
|
}
|
|
8744
8687
|
_onRefRangeChange() {
|
|
8745
8688
|
const registerRefRange = (unitId, subUnitId) => {
|
|
8746
|
-
const workbook = this._univerInstanceService.
|
|
8689
|
+
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
8747
8690
|
if (!workbook) return;
|
|
8748
8691
|
const workSheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
8749
8692
|
if (!workSheet) return;
|
|
@@ -8879,11 +8822,10 @@ let MergeCellController = class MergeCellController extends Disposable {
|
|
|
8879
8822
|
};
|
|
8880
8823
|
}
|
|
8881
8824
|
_handleMoveRangeCommand(params, unitId, subUnitId) {
|
|
8882
|
-
var _params$fromSubUnitId, _params$toSubUnitId;
|
|
8883
8825
|
const workbook = getWorkbook(this._univerInstanceService, unitId);
|
|
8884
8826
|
if (!workbook) return this._handleNull();
|
|
8885
|
-
const sourceSubUnitId =
|
|
8886
|
-
const targetSubUnitId =
|
|
8827
|
+
const sourceSubUnitId = params.fromSubUnitId ?? subUnitId;
|
|
8828
|
+
const targetSubUnitId = params.toSubUnitId ?? sourceSubUnitId;
|
|
8887
8829
|
const sourceWorksheet = getWorksheet(workbook, sourceSubUnitId);
|
|
8888
8830
|
const targetWorksheet = getWorksheet(workbook, targetSubUnitId);
|
|
8889
8831
|
if (!sourceWorksheet || !targetWorksheet) return this._handleNull();
|
|
@@ -9443,7 +9385,7 @@ let MergeCellController = class MergeCellController extends Disposable {
|
|
|
9443
9385
|
this.disposeWithMe(this._commandService.onCommandExecuted((command) => {
|
|
9444
9386
|
if (mutationIdArrByMove$1.includes(command.id)) {
|
|
9445
9387
|
if (!command.params) return;
|
|
9446
|
-
const workbook = this._univerInstanceService.
|
|
9388
|
+
const workbook = this._univerInstanceService.getUnit(command.params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
9447
9389
|
if (!workbook) return;
|
|
9448
9390
|
const worksheet = workbook.getSheetBySheetId(command.params.subUnitId);
|
|
9449
9391
|
if (!worksheet) return;
|
|
@@ -9492,7 +9434,7 @@ let MergeCellController = class MergeCellController extends Disposable {
|
|
|
9492
9434
|
});
|
|
9493
9435
|
}
|
|
9494
9436
|
if (mutationIdByRowCol$1.includes(command.id)) {
|
|
9495
|
-
const workbook = this._univerInstanceService.
|
|
9437
|
+
const workbook = this._univerInstanceService.getUnit(command.params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
9496
9438
|
if (!workbook) return;
|
|
9497
9439
|
const worksheet = workbook.getSheetBySheetId(command.params.subUnitId);
|
|
9498
9440
|
if (!worksheet) return;
|
|
@@ -9557,7 +9499,7 @@ MergeCellController = __decorate([
|
|
|
9557
9499
|
__decorateParam(5, Inject(SheetsSelectionsService))
|
|
9558
9500
|
], MergeCellController);
|
|
9559
9501
|
function getWorkbook(univerInstanceService, unitId) {
|
|
9560
|
-
if (unitId) return univerInstanceService.
|
|
9502
|
+
if (unitId) return univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
9561
9503
|
return univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
|
|
9562
9504
|
}
|
|
9563
9505
|
function getWorksheet(workbook, subUnitId) {
|
|
@@ -9773,10 +9715,11 @@ function getClearContentMutationParamsForRanges(accessor, unitId, worksheet, ran
|
|
|
9773
9715
|
const redos = [];
|
|
9774
9716
|
const subUnitId = worksheet.getSheetId();
|
|
9775
9717
|
ranges.forEach((range) => {
|
|
9718
|
+
const redoMatrix = getClearContentMutationParamForRange(worksheet, range);
|
|
9776
9719
|
const redoMutationParams = {
|
|
9777
9720
|
unitId,
|
|
9778
9721
|
subUnitId,
|
|
9779
|
-
cellValue:
|
|
9722
|
+
cellValue: redoMatrix.clone()
|
|
9780
9723
|
};
|
|
9781
9724
|
const undoMutationParams = SetRangeValuesUndoMutationFactory(accessor, redoMutationParams);
|
|
9782
9725
|
undos.push({
|
|
@@ -9800,8 +9743,8 @@ function getClearContentMutationParamForRange(worksheet, range) {
|
|
|
9800
9743
|
let leftTopCellValue = null;
|
|
9801
9744
|
cellMatrix.forValue((row, col, cellData) => {
|
|
9802
9745
|
if (cellData && row >= startRow && col >= startColumn) {
|
|
9803
|
-
var _cellData$p
|
|
9804
|
-
if (!leftTopCellValue && worksheet.cellHasValue(cellData) && (cellData.v !== "" || ((
|
|
9746
|
+
var _cellData$p;
|
|
9747
|
+
if (!leftTopCellValue && worksheet.cellHasValue(cellData) && (cellData.v !== "" || (((_cellData$p = cellData.p) === null || _cellData$p === void 0 || (_cellData$p = _cellData$p.body) === null || _cellData$p === void 0 || (_cellData$p = _cellData$p.dataStream) === null || _cellData$p === void 0 ? void 0 : _cellData$p.length) ?? 0) > 2)) leftTopCellValue = cellData;
|
|
9805
9748
|
redoMatrix.setValue(row, col, cellData.s ? {
|
|
9806
9749
|
v: null,
|
|
9807
9750
|
t: null,
|
|
@@ -11564,7 +11507,8 @@ const AutoFillRules = {
|
|
|
11564
11507
|
const dataNumArr = [];
|
|
11565
11508
|
for (let i = 0; i < data.length; i++) {
|
|
11566
11509
|
var _data$i;
|
|
11567
|
-
const
|
|
11510
|
+
const txt = `${(_data$i = data[i]) === null || _data$i === void 0 ? void 0 : _data$i.v}`;
|
|
11511
|
+
const matchResult = matchExtendNumber(txt);
|
|
11568
11512
|
if (matchResult.isExtendNumber) dataNumArr.push(matchResult.matchNumber);
|
|
11569
11513
|
}
|
|
11570
11514
|
if (isReverse) {
|
|
@@ -11630,9 +11574,11 @@ const AutoFillRules = {
|
|
|
11630
11574
|
if (isEqualDiff(dataNumArr)) {
|
|
11631
11575
|
if (hasWeek || dataNumArr[dataNumArr.length - 1] < 6 && dataNumArr[0] > 0 || dataNumArr[0] < 6 && dataNumArr[dataNumArr.length - 1] > 0) {
|
|
11632
11576
|
const dataLen = data.length;
|
|
11633
|
-
|
|
11577
|
+
const step = dataNumArr[dataLen - 1] - dataNumArr[dataLen - 2];
|
|
11578
|
+
return reverseIfNeed(fillChnWeek(data, len, step), isReverse);
|
|
11634
11579
|
}
|
|
11635
|
-
|
|
11580
|
+
const step = dataNumArr[1] - dataNumArr[0];
|
|
11581
|
+
return reverseIfNeed(fillChnNumber(data, len, step), isReverse);
|
|
11636
11582
|
}
|
|
11637
11583
|
return fillCopy$1(data, len);
|
|
11638
11584
|
} }
|
|
@@ -11673,7 +11619,8 @@ const AutoFillRules = {
|
|
|
11673
11619
|
}
|
|
11674
11620
|
if (isEqualDiff(dataNumArr)) {
|
|
11675
11621
|
const dataLen = data.length;
|
|
11676
|
-
|
|
11622
|
+
const step = dataNumArr[dataLen - 1] - dataNumArr[dataLen - 2];
|
|
11623
|
+
return reverseIfNeed(fillChnWeek(data, len, step, 1), isReverse);
|
|
11677
11624
|
}
|
|
11678
11625
|
return fillCopy$1(data, len);
|
|
11679
11626
|
} }
|
|
@@ -11713,7 +11660,8 @@ const AutoFillRules = {
|
|
|
11713
11660
|
}
|
|
11714
11661
|
if (isEqualDiff(dataNumArr)) {
|
|
11715
11662
|
const dataLen = data.length;
|
|
11716
|
-
|
|
11663
|
+
const step = dataNumArr[dataLen - 1] - dataNumArr[dataLen - 2];
|
|
11664
|
+
return reverseIfNeed(fillChnWeek(data, len, step, 2), isReverse);
|
|
11717
11665
|
}
|
|
11718
11666
|
return fillCopy$1(data, len);
|
|
11719
11667
|
} }
|
|
@@ -11758,7 +11706,8 @@ const AutoFillRules = {
|
|
|
11758
11706
|
}
|
|
11759
11707
|
if (isEqualDiff(dataNumArr)) {
|
|
11760
11708
|
const dataLen = data.length;
|
|
11761
|
-
|
|
11709
|
+
const step = dataNumArr[dataLen - 1] - dataNumArr[dataLen - 2];
|
|
11710
|
+
return reverseIfNeed(fillLoopSeries(data, len, step, series), isReverse);
|
|
11762
11711
|
}
|
|
11763
11712
|
return fillCopy$1(data, len);
|
|
11764
11713
|
} }
|
|
@@ -12550,7 +12499,7 @@ const InsertSheetMutation = {
|
|
|
12550
12499
|
handler: (accessor, params) => {
|
|
12551
12500
|
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
12552
12501
|
const { sheet, index, unitId, styles } = params;
|
|
12553
|
-
const workbook = univerInstanceService.
|
|
12502
|
+
const workbook = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
12554
12503
|
if (!workbook) return false;
|
|
12555
12504
|
if (styles) workbook.addStyles(styles);
|
|
12556
12505
|
return workbook.addWorksheet(sheet.id, index, cloneWorksheetData(sheet));
|
|
@@ -12618,7 +12567,6 @@ function splitCellDataIntoBatches(unitId, subUnitId, cellData, batchSize) {
|
|
|
12618
12567
|
}
|
|
12619
12568
|
const COPY_SHEET_COMMAND_ID = "sheet.command.copy-sheet";
|
|
12620
12569
|
function buildCopySheetMutations(accessor, workbook, worksheet, unitId, subUnitId, localeService, sheetInterceptorService) {
|
|
12621
|
-
var _intercepted$preRedos, _intercepted$preUndos;
|
|
12622
12570
|
const pluginConfig = accessor.get(IConfigService).getConfig(SHEETS_PLUGIN_CONFIG_KEY);
|
|
12623
12571
|
const largeSheetConfig = {
|
|
12624
12572
|
...defaultLargeSheetOperationConfig,
|
|
@@ -12663,7 +12611,7 @@ function buildCopySheetMutations(accessor, workbook, worksheet, unitId, subUnitI
|
|
|
12663
12611
|
});
|
|
12664
12612
|
return {
|
|
12665
12613
|
redos: [
|
|
12666
|
-
...
|
|
12614
|
+
...intercepted.preRedos ?? [],
|
|
12667
12615
|
{
|
|
12668
12616
|
id: InsertSheetMutation.id,
|
|
12669
12617
|
params: insertSheetMutationParams
|
|
@@ -12671,7 +12619,7 @@ function buildCopySheetMutations(accessor, workbook, worksheet, unitId, subUnitI
|
|
|
12671
12619
|
...intercepted.redos
|
|
12672
12620
|
],
|
|
12673
12621
|
undos: [
|
|
12674
|
-
...
|
|
12622
|
+
...intercepted.preUndos ?? [],
|
|
12675
12623
|
{
|
|
12676
12624
|
id: RemoveSheetMutation.id,
|
|
12677
12625
|
params: removeSheetMutationParams
|
|
@@ -12886,8 +12834,7 @@ const InsertSheetCommand = {
|
|
|
12886
12834
|
const sheetName = sheet === null || sheet === void 0 ? void 0 : sheet.name;
|
|
12887
12835
|
const sheetConfig = mergeWorksheetSnapshotWithDefault(sheet || {});
|
|
12888
12836
|
if (params) {
|
|
12889
|
-
|
|
12890
|
-
index = (_params$index = params.index) !== null && _params$index !== void 0 ? _params$index : index;
|
|
12837
|
+
index = params.index ?? index;
|
|
12891
12838
|
sheetConfig.id = sheetId || generateRandomId();
|
|
12892
12839
|
sheetConfig.name = sheetName ? workbook.uniqueSheetName(sheetName) : workbook.generateNewSheetName(`${localeService.t("sheets.tabs.sheet")}`);
|
|
12893
12840
|
} else {
|
|
@@ -13002,7 +12949,6 @@ const RemoveDefinedNameCommand = {
|
|
|
13002
12949
|
id: "sheet.command.remove-defined-name",
|
|
13003
12950
|
type: CommandType.COMMAND,
|
|
13004
12951
|
handler: (accessor, params) => {
|
|
13005
|
-
var _interceptorCommands$, _interceptorCommands$2;
|
|
13006
12952
|
const commandService = accessor.get(ICommandService);
|
|
13007
12953
|
const undoRedoService = accessor.get(IUndoRedoService);
|
|
13008
12954
|
const sheetInterceptorService = accessor.get(SheetInterceptorService);
|
|
@@ -13013,7 +12959,7 @@ const RemoveDefinedNameCommand = {
|
|
|
13013
12959
|
params
|
|
13014
12960
|
});
|
|
13015
12961
|
const redos = [
|
|
13016
|
-
...
|
|
12962
|
+
...interceptorCommands.preRedos ?? [],
|
|
13017
12963
|
{
|
|
13018
12964
|
id: RemoveDefinedNameMutation.id,
|
|
13019
12965
|
params: removeSheetMutationParams
|
|
@@ -13021,7 +12967,7 @@ const RemoveDefinedNameCommand = {
|
|
|
13021
12967
|
...interceptorCommands.redos
|
|
13022
12968
|
];
|
|
13023
12969
|
const undos = [
|
|
13024
|
-
...
|
|
12970
|
+
...interceptorCommands.preUndos ?? [],
|
|
13025
12971
|
{
|
|
13026
12972
|
id: SetDefinedNameMutation.id,
|
|
13027
12973
|
params: removeSheetMutationParams
|
|
@@ -13049,7 +12995,6 @@ const RemoveSheetCommand = {
|
|
|
13049
12995
|
id: "sheet.command.remove-sheet",
|
|
13050
12996
|
type: CommandType.COMMAND,
|
|
13051
12997
|
handler: (accessor, params) => {
|
|
13052
|
-
var _intercepted$preRedos, _intercepted$preUndos;
|
|
13053
12998
|
const commandService = accessor.get(ICommandService);
|
|
13054
12999
|
const undoRedoService = accessor.get(IUndoRedoService);
|
|
13055
13000
|
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
@@ -13079,7 +13024,7 @@ const RemoveSheetCommand = {
|
|
|
13079
13024
|
}
|
|
13080
13025
|
});
|
|
13081
13026
|
const redos = [
|
|
13082
|
-
...
|
|
13027
|
+
...intercepted.preRedos ?? [],
|
|
13083
13028
|
{
|
|
13084
13029
|
id: RemoveSheetMutation.id,
|
|
13085
13030
|
params: RemoveSheetMutationParams
|
|
@@ -13087,7 +13032,7 @@ const RemoveSheetCommand = {
|
|
|
13087
13032
|
...intercepted.redos
|
|
13088
13033
|
];
|
|
13089
13034
|
const undos = isLargeSheet ? [] : [
|
|
13090
|
-
...
|
|
13035
|
+
...intercepted.preUndos ?? [],
|
|
13091
13036
|
{
|
|
13092
13037
|
id: InsertSheetMutation.id,
|
|
13093
13038
|
params: InsertSheetMutationParams
|
|
@@ -13461,7 +13406,7 @@ const SetBorderCommand = {
|
|
|
13461
13406
|
const setRangeValuesMutationParams = {
|
|
13462
13407
|
unitId,
|
|
13463
13408
|
subUnitId,
|
|
13464
|
-
cellValue: mr.
|
|
13409
|
+
cellValue: mr.clone()
|
|
13465
13410
|
};
|
|
13466
13411
|
const undoSetRangeValuesMutationParams = SetRangeValuesUndoMutationFactory(accessor, setRangeValuesMutationParams);
|
|
13467
13412
|
if (commandService.syncExecuteCommand(SetRangeValuesMutation.id, setRangeValuesMutationParams)) {
|
|
@@ -13617,7 +13562,6 @@ const SetSpecificColsVisibleCommand = {
|
|
|
13617
13562
|
});
|
|
13618
13563
|
const interceptedResult = sequenceExecute([...intercepted.redos], commandService);
|
|
13619
13564
|
if (result.result && interceptedResult.result) {
|
|
13620
|
-
var _intercepted$undos, _intercepted$preRedos;
|
|
13621
13565
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
13622
13566
|
id: SetSpecificColsVisibleCommand.id,
|
|
13623
13567
|
params
|
|
@@ -13634,11 +13578,11 @@ const SetSpecificColsVisibleCommand = {
|
|
|
13634
13578
|
id: SetSelectionsOperation.id,
|
|
13635
13579
|
params: undoSetSelectionsOperationParams
|
|
13636
13580
|
},
|
|
13637
|
-
...
|
|
13581
|
+
...intercepted.undos ?? [],
|
|
13638
13582
|
...afterInterceptors.undos
|
|
13639
13583
|
],
|
|
13640
13584
|
redoMutations: [
|
|
13641
|
-
...
|
|
13585
|
+
...intercepted.preRedos ?? [],
|
|
13642
13586
|
{
|
|
13643
13587
|
id: SetColVisibleMutation.id,
|
|
13644
13588
|
params: redoMutationParams
|
|
@@ -13728,7 +13672,6 @@ const SetColHiddenCommand = {
|
|
|
13728
13672
|
});
|
|
13729
13673
|
const interceptedResult = sequenceExecute([...intercepted.redos], commandService);
|
|
13730
13674
|
if (result.result && interceptedResult.result) {
|
|
13731
|
-
var _intercepted$undos2, _intercepted$preRedos2;
|
|
13732
13675
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
13733
13676
|
id: SetColHiddenCommand.id,
|
|
13734
13677
|
params: redoMutationParams
|
|
@@ -13745,11 +13688,11 @@ const SetColHiddenCommand = {
|
|
|
13745
13688
|
id: SetSelectionsOperation.id,
|
|
13746
13689
|
params: undoSetSelectionsOperationParams
|
|
13747
13690
|
},
|
|
13748
|
-
...
|
|
13691
|
+
...intercepted.undos ?? [],
|
|
13749
13692
|
...afterInterceptors.undos
|
|
13750
13693
|
],
|
|
13751
13694
|
redoMutations: [
|
|
13752
|
-
...
|
|
13695
|
+
...intercepted.preRedos ?? [],
|
|
13753
13696
|
{
|
|
13754
13697
|
id: SetColHiddenMutation.id,
|
|
13755
13698
|
params: redoMutationParams
|
|
@@ -13858,7 +13801,6 @@ const SetDefinedNameCommand = {
|
|
|
13858
13801
|
id: "sheet.command.set-defined-name",
|
|
13859
13802
|
type: CommandType.COMMAND,
|
|
13860
13803
|
handler: (accessor, params) => {
|
|
13861
|
-
var _interceptorCommands$, _interceptorCommands$2;
|
|
13862
13804
|
const commandService = accessor.get(ICommandService);
|
|
13863
13805
|
const undoRedoService = accessor.get(IUndoRedoService);
|
|
13864
13806
|
const sheetInterceptorService = accessor.get(SheetInterceptorService);
|
|
@@ -13870,7 +13812,7 @@ const SetDefinedNameCommand = {
|
|
|
13870
13812
|
params
|
|
13871
13813
|
});
|
|
13872
13814
|
const redos = [
|
|
13873
|
-
...
|
|
13815
|
+
...interceptorCommands.preRedos ?? [],
|
|
13874
13816
|
...oldDefinedNameMutationParams ? [{
|
|
13875
13817
|
id: RemoveDefinedNameMutation.id,
|
|
13876
13818
|
params: oldDefinedNameMutationParams
|
|
@@ -13882,7 +13824,7 @@ const SetDefinedNameCommand = {
|
|
|
13882
13824
|
...interceptorCommands.redos
|
|
13883
13825
|
];
|
|
13884
13826
|
const undos = [
|
|
13885
|
-
...
|
|
13827
|
+
...interceptorCommands.preUndos ?? [],
|
|
13886
13828
|
{
|
|
13887
13829
|
id: RemoveDefinedNameMutation.id,
|
|
13888
13830
|
params: newDefinedNameMutationParams
|
|
@@ -13908,7 +13850,7 @@ const SetDefinedNameCommand = {
|
|
|
13908
13850
|
//#endregion
|
|
13909
13851
|
//#region src/commands/mutations/set-frozen.mutation.ts
|
|
13910
13852
|
const SetFrozenMutationFactory = (accessor, params) => {
|
|
13911
|
-
const universheet = accessor.get(IUniverInstanceService).
|
|
13853
|
+
const universheet = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
13912
13854
|
if (universheet == null) throw new Error("universheet is null error!");
|
|
13913
13855
|
const worksheet = universheet.getSheetBySheetId(params.subUnitId);
|
|
13914
13856
|
if (worksheet == null) throw new Error("worksheet is null error!");
|
|
@@ -13923,7 +13865,7 @@ const SetFrozenMutation = {
|
|
|
13923
13865
|
id: "sheet.mutation.set-frozen",
|
|
13924
13866
|
type: CommandType.MUTATION,
|
|
13925
13867
|
handler: (accessor, params) => {
|
|
13926
|
-
const universheet = accessor.get(IUniverInstanceService).
|
|
13868
|
+
const universheet = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
13927
13869
|
if (universheet == null) throw new Error("universheet is null error!");
|
|
13928
13870
|
const worksheet = universheet.getSheetBySheetId(params.subUnitId);
|
|
13929
13871
|
if (!worksheet) return false;
|
|
@@ -14348,7 +14290,6 @@ const SetSpecificRowsVisibleCommand = {
|
|
|
14348
14290
|
});
|
|
14349
14291
|
const interceptedResult = sequenceExecute([...intercepted.redos], commandService);
|
|
14350
14292
|
if (result.result && interceptedResult.result) {
|
|
14351
|
-
var _intercepted$preUndos, _intercepted$undos, _intercepted$preRedos;
|
|
14352
14293
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
14353
14294
|
id: SetSpecificRowsVisibleCommand.id,
|
|
14354
14295
|
params
|
|
@@ -14357,7 +14298,7 @@ const SetSpecificRowsVisibleCommand = {
|
|
|
14357
14298
|
undoRedoService.pushUndoRedo({
|
|
14358
14299
|
unitID: unitId,
|
|
14359
14300
|
undoMutations: [
|
|
14360
|
-
...
|
|
14301
|
+
...intercepted.preUndos ?? [],
|
|
14361
14302
|
{
|
|
14362
14303
|
id: SetRowHiddenMutation.id,
|
|
14363
14304
|
params: undoMutationParams
|
|
@@ -14366,11 +14307,11 @@ const SetSpecificRowsVisibleCommand = {
|
|
|
14366
14307
|
id: SetSelectionsOperation.id,
|
|
14367
14308
|
params: undoSetSelectionsOperationParams
|
|
14368
14309
|
},
|
|
14369
|
-
...
|
|
14310
|
+
...intercepted.undos ?? [],
|
|
14370
14311
|
...afterInterceptors.undos
|
|
14371
14312
|
],
|
|
14372
14313
|
redoMutations: [
|
|
14373
|
-
...
|
|
14314
|
+
...intercepted.preRedos ?? [],
|
|
14374
14315
|
{
|
|
14375
14316
|
id: SetRowVisibleMutation.id,
|
|
14376
14317
|
params: redoMutationParams
|
|
@@ -14412,7 +14353,7 @@ const SetRowHiddenCommand = {
|
|
|
14412
14353
|
type: CommandType.COMMAND,
|
|
14413
14354
|
id: "sheet.command.set-rows-hidden",
|
|
14414
14355
|
handler: (accessor, params) => {
|
|
14415
|
-
var _params$ranges
|
|
14356
|
+
var _params$ranges;
|
|
14416
14357
|
const selectionManagerService = accessor.get(SheetsSelectionsService);
|
|
14417
14358
|
const commandService = accessor.get(ICommandService);
|
|
14418
14359
|
const undoRedoService = accessor.get(IUndoRedoService);
|
|
@@ -14454,7 +14395,7 @@ const SetRowHiddenCommand = {
|
|
|
14454
14395
|
params: redoMutationParams
|
|
14455
14396
|
});
|
|
14456
14397
|
if (sequenceExecute([
|
|
14457
|
-
...
|
|
14398
|
+
...intercepted.preRedos ?? [],
|
|
14458
14399
|
{
|
|
14459
14400
|
id: SetRowHiddenMutation.id,
|
|
14460
14401
|
params: redoMutationParams
|
|
@@ -14465,7 +14406,6 @@ const SetRowHiddenCommand = {
|
|
|
14465
14406
|
},
|
|
14466
14407
|
...intercepted.redos
|
|
14467
14408
|
], commandService).result) {
|
|
14468
|
-
var _intercepted$preUndos2, _intercepted$undos2, _intercepted$preRedos3;
|
|
14469
14409
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
14470
14410
|
id: SetRowHiddenCommand.id,
|
|
14471
14411
|
params: redoMutationParams
|
|
@@ -14474,7 +14414,7 @@ const SetRowHiddenCommand = {
|
|
|
14474
14414
|
undoRedoService.pushUndoRedo({
|
|
14475
14415
|
unitID: unitId,
|
|
14476
14416
|
undoMutations: [
|
|
14477
|
-
...
|
|
14417
|
+
...intercepted.preUndos ?? [],
|
|
14478
14418
|
{
|
|
14479
14419
|
id: SetRowVisibleMutation.id,
|
|
14480
14420
|
params: undoMutationParams
|
|
@@ -14483,11 +14423,11 @@ const SetRowHiddenCommand = {
|
|
|
14483
14423
|
id: SetSelectionsOperation.id,
|
|
14484
14424
|
params: undoSetSelectionsOperationParams
|
|
14485
14425
|
},
|
|
14486
|
-
...
|
|
14426
|
+
...intercepted.undos ?? [],
|
|
14487
14427
|
...afterInterceptors.undos
|
|
14488
14428
|
],
|
|
14489
14429
|
redoMutations: [
|
|
14490
|
-
...
|
|
14430
|
+
...intercepted.preRedos ?? [],
|
|
14491
14431
|
{
|
|
14492
14432
|
id: SetRowHiddenMutation.id,
|
|
14493
14433
|
params: redoMutationParams
|
|
@@ -14583,7 +14523,7 @@ function mergeSelections(ranges) {
|
|
|
14583
14523
|
//#endregion
|
|
14584
14524
|
//#region src/commands/mutations/set-tab-color.mutation.ts
|
|
14585
14525
|
const SetTabColorUndoMutationFactory = (accessor, params) => {
|
|
14586
|
-
const oldTabColor = accessor.get(IUniverInstanceService).
|
|
14526
|
+
const oldTabColor = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET).getSheetBySheetId(params.subUnitId).getConfig().tabColor;
|
|
14587
14527
|
return {
|
|
14588
14528
|
...Tools.deepClone(params),
|
|
14589
14529
|
color: oldTabColor
|
|
@@ -14593,7 +14533,7 @@ const SetTabColorMutation = {
|
|
|
14593
14533
|
id: "sheet.mutation.set-tab-color",
|
|
14594
14534
|
type: CommandType.MUTATION,
|
|
14595
14535
|
handler: (accessor, params) => {
|
|
14596
|
-
const workbook = accessor.get(IUniverInstanceService).
|
|
14536
|
+
const workbook = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
14597
14537
|
if (!workbook) return false;
|
|
14598
14538
|
const worksheet = workbook.getSheetBySheetId(params.subUnitId);
|
|
14599
14539
|
if (!worksheet) return false;
|
|
@@ -14659,7 +14599,6 @@ const SetWorkbookNameCommand = {
|
|
|
14659
14599
|
type: CommandType.COMMAND,
|
|
14660
14600
|
id: "sheet.command.set-workbook-name",
|
|
14661
14601
|
handler: (accessor, params) => {
|
|
14662
|
-
var _interceptedCommands$;
|
|
14663
14602
|
const commandService = accessor.get(ICommandService);
|
|
14664
14603
|
const sheetInterceptorService = accessor.get(SheetInterceptorService);
|
|
14665
14604
|
if (!getSheetCommandTargetWorkbook(accessor.get(IUniverInstanceService), params)) return false;
|
|
@@ -14672,7 +14611,7 @@ const SetWorkbookNameCommand = {
|
|
|
14672
14611
|
unitId: params.unitId
|
|
14673
14612
|
};
|
|
14674
14613
|
return sequenceExecute([
|
|
14675
|
-
...
|
|
14614
|
+
...interceptedCommands.preRedos ?? [],
|
|
14676
14615
|
{
|
|
14677
14616
|
id: SetWorkbookNameMutation.id,
|
|
14678
14617
|
params: redoMutationParams
|
|
@@ -14848,7 +14787,6 @@ const SetColWidthCommand = {
|
|
|
14848
14787
|
});
|
|
14849
14788
|
const result = sequenceExecute([...intercepted.redos, ...autoHeightRedos], commandService);
|
|
14850
14789
|
if (setColWidthResult && result.result) {
|
|
14851
|
-
var _intercepted$preUndos, _intercepted$preRedos;
|
|
14852
14790
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
14853
14791
|
id: SetColWidthCommand.id,
|
|
14854
14792
|
params: redoMutationParams
|
|
@@ -14857,7 +14795,7 @@ const SetColWidthCommand = {
|
|
|
14857
14795
|
undoRedoService.pushUndoRedo({
|
|
14858
14796
|
unitID: unitId,
|
|
14859
14797
|
undoMutations: [
|
|
14860
|
-
...
|
|
14798
|
+
...intercepted.preUndos ?? [],
|
|
14861
14799
|
{
|
|
14862
14800
|
id: SetWorksheetColWidthMutation.id,
|
|
14863
14801
|
params: undoMutationParams
|
|
@@ -14867,7 +14805,7 @@ const SetColWidthCommand = {
|
|
|
14867
14805
|
...autoHeightUndos
|
|
14868
14806
|
],
|
|
14869
14807
|
redoMutations: [
|
|
14870
|
-
...
|
|
14808
|
+
...intercepted.preRedos ?? [],
|
|
14871
14809
|
{
|
|
14872
14810
|
id: SetWorksheetColWidthMutation.id,
|
|
14873
14811
|
params: redoMutationParams
|
|
@@ -14998,7 +14936,7 @@ const SetWorksheetHideMutation = {
|
|
|
14998
14936
|
id: "sheet.mutation.set-worksheet-hidden",
|
|
14999
14937
|
type: CommandType.MUTATION,
|
|
15000
14938
|
handler: (accessor, params) => {
|
|
15001
|
-
const universheet = accessor.get(IUniverInstanceService).
|
|
14939
|
+
const universheet = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
15002
14940
|
if (universheet == null) return false;
|
|
15003
14941
|
const worksheet = universheet.getSheetBySheetId(params.subUnitId);
|
|
15004
14942
|
if (!worksheet) return false;
|
|
@@ -15065,7 +15003,7 @@ const SetWorksheetNameMutation = {
|
|
|
15065
15003
|
id: "sheet.mutation.set-worksheet-name",
|
|
15066
15004
|
type: CommandType.MUTATION,
|
|
15067
15005
|
handler: (accessor, params) => {
|
|
15068
|
-
const universheet = accessor.get(IUniverInstanceService).
|
|
15006
|
+
const universheet = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
15069
15007
|
if (universheet == null) return false;
|
|
15070
15008
|
const worksheet = universheet.getSheetBySheetId(params.subUnitId);
|
|
15071
15009
|
if (!worksheet) return false;
|
|
@@ -15083,7 +15021,6 @@ const SetWorksheetNameCommand = {
|
|
|
15083
15021
|
type: CommandType.COMMAND,
|
|
15084
15022
|
id: "sheet.command.set-worksheet-name",
|
|
15085
15023
|
handler: (accessor, params) => {
|
|
15086
|
-
var _interceptorCommands$, _interceptorCommands$2;
|
|
15087
15024
|
const commandService = accessor.get(ICommandService);
|
|
15088
15025
|
const undoRedoService = accessor.get(IUndoRedoService);
|
|
15089
15026
|
const sheetInterceptorService = accessor.get(SheetInterceptorService);
|
|
@@ -15101,7 +15038,7 @@ const SetWorksheetNameCommand = {
|
|
|
15101
15038
|
params
|
|
15102
15039
|
});
|
|
15103
15040
|
const redos = [
|
|
15104
|
-
...
|
|
15041
|
+
...interceptorCommands.preRedos ?? [],
|
|
15105
15042
|
{
|
|
15106
15043
|
id: SetWorksheetNameMutation.id,
|
|
15107
15044
|
params: redoMutationParams
|
|
@@ -15109,7 +15046,7 @@ const SetWorksheetNameCommand = {
|
|
|
15109
15046
|
...interceptorCommands.redos
|
|
15110
15047
|
];
|
|
15111
15048
|
const undos = [
|
|
15112
|
-
...
|
|
15049
|
+
...interceptorCommands.preUndos ?? [],
|
|
15113
15050
|
{
|
|
15114
15051
|
id: SetWorksheetNameMutation.id,
|
|
15115
15052
|
params: undoMutationParams
|
|
@@ -15141,7 +15078,7 @@ const SetWorksheetOrderMutation = {
|
|
|
15141
15078
|
id: "sheet.mutation.set-worksheet-order",
|
|
15142
15079
|
type: CommandType.MUTATION,
|
|
15143
15080
|
handler: (accessor, params) => {
|
|
15144
|
-
const workbook = accessor.get(IUniverInstanceService).
|
|
15081
|
+
const workbook = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
15145
15082
|
if (!workbook) return false;
|
|
15146
15083
|
const config = workbook.getConfig();
|
|
15147
15084
|
config.sheetOrder.splice(params.fromOrder, 1);
|
|
@@ -16378,7 +16315,7 @@ const SetWorksheetProtectionCommand = {
|
|
|
16378
16315
|
//#endregion
|
|
16379
16316
|
//#region src/commands/mutations/set-worksheet-right-to-left.mutation.ts
|
|
16380
16317
|
const SetWorksheetRightToLeftUndoMutationFactory = (accessor, params) => {
|
|
16381
|
-
const oldState = accessor.get(IUniverInstanceService).
|
|
16318
|
+
const oldState = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET).getSheetBySheetId(params.subUnitId).getConfig().rightToLeft;
|
|
16382
16319
|
return {
|
|
16383
16320
|
...Tools.deepClone(params),
|
|
16384
16321
|
rightToLeft: oldState
|
|
@@ -16388,7 +16325,7 @@ const SetWorksheetRightToLeftMutation = {
|
|
|
16388
16325
|
id: "sheet.mutation.set-worksheet-right-to-left",
|
|
16389
16326
|
type: CommandType.MUTATION,
|
|
16390
16327
|
handler: (accessor, params) => {
|
|
16391
|
-
const workbook = accessor.get(IUniverInstanceService).
|
|
16328
|
+
const workbook = accessor.get(IUniverInstanceService).getUnit(params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
16392
16329
|
if (!workbook) return false;
|
|
16393
16330
|
const worksheet = workbook.getSheetBySheetId(params.subUnitId);
|
|
16394
16331
|
if (!worksheet) return false;
|
|
@@ -16410,10 +16347,7 @@ const SetWorksheetRightToLeftCommand = {
|
|
|
16410
16347
|
if (!target) return false;
|
|
16411
16348
|
const { unitId, subUnitId } = target;
|
|
16412
16349
|
let rightToLeft = BooleanNumber.FALSE;
|
|
16413
|
-
if (params)
|
|
16414
|
-
var _params$rightToLeft;
|
|
16415
|
-
rightToLeft = (_params$rightToLeft = params.rightToLeft) !== null && _params$rightToLeft !== void 0 ? _params$rightToLeft : BooleanNumber.FALSE;
|
|
16416
|
-
}
|
|
16350
|
+
if (params) rightToLeft = params.rightToLeft ?? BooleanNumber.FALSE;
|
|
16417
16351
|
const setWorksheetRightToLeftMutationParams = {
|
|
16418
16352
|
rightToLeft,
|
|
16419
16353
|
unitId,
|
|
@@ -16546,7 +16480,6 @@ const DeltaRowHeightCommand = {
|
|
|
16546
16480
|
}], commandService);
|
|
16547
16481
|
const interceptedResult = sequenceExecute([...intercepted.redos], commandService);
|
|
16548
16482
|
if (result.result && interceptedResult.result) {
|
|
16549
|
-
var _intercepted$preUndos, _intercepted$preRedos;
|
|
16550
16483
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
16551
16484
|
id: DeltaRowHeightCommand.id,
|
|
16552
16485
|
params: redoMutationParams
|
|
@@ -16555,7 +16488,7 @@ const DeltaRowHeightCommand = {
|
|
|
16555
16488
|
undoRedoService.pushUndoRedo({
|
|
16556
16489
|
unitID: unitId,
|
|
16557
16490
|
undoMutations: [
|
|
16558
|
-
...
|
|
16491
|
+
...intercepted.preUndos ?? [],
|
|
16559
16492
|
{
|
|
16560
16493
|
id: SetWorksheetRowHeightMutation.id,
|
|
16561
16494
|
params: undoMutationParams
|
|
@@ -16568,7 +16501,7 @@ const DeltaRowHeightCommand = {
|
|
|
16568
16501
|
...afterInterceptors.undos
|
|
16569
16502
|
],
|
|
16570
16503
|
redoMutations: [
|
|
16571
|
-
...
|
|
16504
|
+
...intercepted.preRedos ?? [],
|
|
16572
16505
|
{
|
|
16573
16506
|
id: SetWorksheetRowHeightMutation.id,
|
|
16574
16507
|
params: redoMutationParams
|
|
@@ -16628,7 +16561,6 @@ const SetRowHeightCommand = {
|
|
|
16628
16561
|
});
|
|
16629
16562
|
const sheetInterceptorResult = sequenceExecute([...intercepted.redos], commandService);
|
|
16630
16563
|
if (result.result && sheetInterceptorResult.result) {
|
|
16631
|
-
var _intercepted$preRedos2, _intercepted$preRedos3;
|
|
16632
16564
|
const afterInterceptors = sheetInterceptorService.afterCommandExecute({
|
|
16633
16565
|
id: SetRowHeightCommand.id,
|
|
16634
16566
|
params: redoMutationParams
|
|
@@ -16637,7 +16569,7 @@ const SetRowHeightCommand = {
|
|
|
16637
16569
|
undoRedoService.pushUndoRedo({
|
|
16638
16570
|
unitID: unitId,
|
|
16639
16571
|
undoMutations: [
|
|
16640
|
-
...
|
|
16572
|
+
...intercepted.preRedos ?? [],
|
|
16641
16573
|
{
|
|
16642
16574
|
id: SetWorksheetRowHeightMutation.id,
|
|
16643
16575
|
params: undoMutationParams
|
|
@@ -16650,7 +16582,7 @@ const SetRowHeightCommand = {
|
|
|
16650
16582
|
...afterInterceptors.undos
|
|
16651
16583
|
],
|
|
16652
16584
|
redoMutations: [
|
|
16653
|
-
...
|
|
16585
|
+
...intercepted.preRedos ?? [],
|
|
16654
16586
|
{
|
|
16655
16587
|
id: SetWorksheetRowHeightMutation.id,
|
|
16656
16588
|
params: redoMutationParams
|
|
@@ -17606,7 +17538,7 @@ let AutoFillController = class AutoFillController extends Disposable {
|
|
|
17606
17538
|
if (hasStyle) {
|
|
17607
17539
|
var _this$_univerInstance5;
|
|
17608
17540
|
const deleteMergeRanges = [];
|
|
17609
|
-
const mergeData = (_this$_univerInstance5 = this._univerInstanceService.
|
|
17541
|
+
const mergeData = (_this$_univerInstance5 = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET)) === null || _this$_univerInstance5 === void 0 || (_this$_univerInstance5 = _this$_univerInstance5.getSheetBySheetId(subUnitId)) === null || _this$_univerInstance5 === void 0 ? void 0 : _this$_univerInstance5.getMergeData();
|
|
17610
17542
|
if (mergeData) mergeData.forEach((merge) => {
|
|
17611
17543
|
if (Rectangle.intersects(merge, targetRange)) deleteMergeRanges.push(merge);
|
|
17612
17544
|
});
|
|
@@ -17723,7 +17655,7 @@ let CalculateResultApplyController = class CalculateResultApplyController extend
|
|
|
17723
17655
|
const redoMutationsInfo = [];
|
|
17724
17656
|
for (let i = 0; i < unitIds.length; i++) {
|
|
17725
17657
|
const unitId = unitIds[i];
|
|
17726
|
-
const workbook = this._univerInstanceService.
|
|
17658
|
+
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
17727
17659
|
if (!workbook) continue;
|
|
17728
17660
|
const sheetData = unitData[unitId];
|
|
17729
17661
|
if (sheetData == null) continue;
|
|
@@ -17759,7 +17691,7 @@ let CalculateResultApplyController = class CalculateResultApplyController extend
|
|
|
17759
17691
|
* @returns
|
|
17760
17692
|
*/
|
|
17761
17693
|
_getMergedCellData(unitId, sheetId, cellData) {
|
|
17762
|
-
const workbook = this._univerInstanceService.
|
|
17694
|
+
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
17763
17695
|
const styles = workbook === null || workbook === void 0 ? void 0 : workbook.getStyles();
|
|
17764
17696
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(sheetId);
|
|
17765
17697
|
const oldCellDataMatrix = worksheet === null || worksheet === void 0 ? void 0 : worksheet.getCellMatrix();
|
|
@@ -17850,14 +17782,14 @@ const effectedByOnlyLocalMutationIds = [
|
|
|
17850
17782
|
];
|
|
17851
17783
|
let SheetsFreezeSyncController = class SheetsFreezeSyncController extends Disposable {
|
|
17852
17784
|
constructor(_univerInstanceService, _commandService, _configService) {
|
|
17853
|
-
var _this$_configService
|
|
17785
|
+
var _this$_configService$;
|
|
17854
17786
|
super();
|
|
17855
17787
|
this._univerInstanceService = _univerInstanceService;
|
|
17856
17788
|
this._commandService = _commandService;
|
|
17857
17789
|
this._configService = _configService;
|
|
17858
17790
|
_defineProperty(this, "_d", new DisposableCollection());
|
|
17859
17791
|
_defineProperty(this, "_enabled", true);
|
|
17860
|
-
const freezeSync = (
|
|
17792
|
+
const freezeSync = ((_this$_configService$ = this._configService.getConfig("sheets.config")) === null || _this$_configService$ === void 0 ? void 0 : _this$_configService$.freezeSync) ?? true;
|
|
17861
17793
|
this.setEnabled(freezeSync);
|
|
17862
17794
|
}
|
|
17863
17795
|
getEnabled() {
|
|
@@ -18277,7 +18209,7 @@ let SheetPermissionCheckController = class SheetPermissionCheckController extend
|
|
|
18277
18209
|
})) return false;
|
|
18278
18210
|
if (rangeTypes && rangeTypes.length > 0) {
|
|
18279
18211
|
var _this$_selectionManag;
|
|
18280
|
-
const ranges = selectionRanges
|
|
18212
|
+
const ranges = selectionRanges ?? ((_this$_selectionManag = this._selectionManagerService.getCurrentSelections()) === null || _this$_selectionManag === void 0 ? void 0 : _this$_selectionManag.map((s) => s.range));
|
|
18281
18213
|
if (!ranges) return false;
|
|
18282
18214
|
const rules = this._rangeProtectionRuleModel.getSubunitRuleList(_unitId, _subUnitId);
|
|
18283
18215
|
if (rules.length === 0) return true;
|
|
@@ -18494,11 +18426,11 @@ let SheetPermissionCheckController = class SheetPermissionCheckController extend
|
|
|
18494
18426
|
return true;
|
|
18495
18427
|
}
|
|
18496
18428
|
_permissionCheckWithInsertOrDeleteMoveRange(direction, params) {
|
|
18497
|
-
var
|
|
18429
|
+
var _this$_selectionManag3;
|
|
18498
18430
|
const target = getSheetCommandTarget(this._univerInstanceService);
|
|
18499
18431
|
if (!target) return false;
|
|
18500
18432
|
const { worksheet, unitId, subUnitId } = target;
|
|
18501
|
-
const range = (
|
|
18433
|
+
const range = (params === null || params === void 0 ? void 0 : params.range) ?? ((_this$_selectionManag3 = this._selectionManagerService.getCurrentLastSelection()) === null || _this$_selectionManag3 === void 0 ? void 0 : _this$_selectionManag3.range);
|
|
18502
18434
|
if (!range) return false;
|
|
18503
18435
|
if (!this.permissionCheckWithRanges({
|
|
18504
18436
|
workbookTypes: [WorkbookEditablePermission],
|
|
@@ -19033,15 +18965,16 @@ ZebraCrossingCacheController = __decorate([
|
|
|
19033
18965
|
|
|
19034
18966
|
//#endregion
|
|
19035
18967
|
//#region src/models/range-protection-render.model.ts
|
|
19036
|
-
let RangeProtectionRenderModel = class RangeProtectionRenderModel {
|
|
18968
|
+
let RangeProtectionRenderModel = class RangeProtectionRenderModel extends Disposable {
|
|
19037
18969
|
constructor(_selectionProtectionRuleModel, _permissionService) {
|
|
18970
|
+
super();
|
|
19038
18971
|
this._selectionProtectionRuleModel = _selectionProtectionRuleModel;
|
|
19039
18972
|
this._permissionService = _permissionService;
|
|
19040
18973
|
_defineProperty(this, "_cache", new LRUMap(1e4));
|
|
19041
18974
|
this._init();
|
|
19042
18975
|
}
|
|
19043
18976
|
_init() {
|
|
19044
|
-
this._permissionService.permissionPointUpdate$.pipe(filter$1((permission) => permission.type === UnitObject.SelectRange), filter$1((permission) => getAllRangePermissionPoint().some((F) => permission instanceof F)), map$1((permission) => permission)).subscribe((permission) => {
|
|
18977
|
+
this.disposeWithMe(this._permissionService.permissionPointUpdate$.pipe(filter$1((permission) => permission.type === UnitObject.SelectRange), filter$1((permission) => getAllRangePermissionPoint().some((F) => permission instanceof F)), map$1((permission) => permission)).subscribe((permission) => {
|
|
19045
18978
|
const ruleMap = this._selectionProtectionRuleModel.getSubunitRuleList(permission.unitId, permission.subUnitId);
|
|
19046
18979
|
for (const rule of ruleMap) if (rule.permissionId === permission.permissionId) rule.ranges.forEach((range) => {
|
|
19047
18980
|
Range.foreach(range, (row, col) => {
|
|
@@ -19049,8 +18982,8 @@ let RangeProtectionRenderModel = class RangeProtectionRenderModel {
|
|
|
19049
18982
|
this._cache.delete(key);
|
|
19050
18983
|
});
|
|
19051
18984
|
});
|
|
19052
|
-
});
|
|
19053
|
-
this._selectionProtectionRuleModel.ruleChange$.subscribe((info) => {
|
|
18985
|
+
}));
|
|
18986
|
+
this.disposeWithMe(this._selectionProtectionRuleModel.ruleChange$.subscribe((info) => {
|
|
19054
18987
|
info.rule.ranges.forEach((range) => {
|
|
19055
18988
|
Range.foreach(range, (row, col) => {
|
|
19056
18989
|
const key = this._createKey(info.unitId, info.subUnitId, row, col);
|
|
@@ -19066,7 +18999,7 @@ let RangeProtectionRenderModel = class RangeProtectionRenderModel {
|
|
|
19066
18999
|
});
|
|
19067
19000
|
});
|
|
19068
19001
|
}
|
|
19069
|
-
});
|
|
19002
|
+
}));
|
|
19070
19003
|
}
|
|
19071
19004
|
_createKey(unitId, subUnitId, row, col) {
|
|
19072
19005
|
return `${unitId}_${subUnitId}_${row}_${col}`;
|
|
@@ -19081,10 +19014,9 @@ let RangeProtectionRenderModel = class RangeProtectionRenderModel {
|
|
|
19081
19014
|
const result = [];
|
|
19082
19015
|
for (const rule of ruleMap) if (rule.ranges.some((range) => range.startRow <= row && range.endRow >= row && range.startColumn <= col && range.endColumn >= col)) {
|
|
19083
19016
|
const permissionMap = getAllRangePermissionPoint().reduce((result, F) => {
|
|
19084
|
-
var _permission$value;
|
|
19085
19017
|
const instance = new F(unitId, subUnitId, rule.permissionId);
|
|
19086
19018
|
const permission = this._permissionService.getPermissionPoint(instance.id);
|
|
19087
|
-
result[instance.subType] = (
|
|
19019
|
+
result[instance.subType] = (permission === null || permission === void 0 ? void 0 : permission.value) ?? instance.value;
|
|
19088
19020
|
return result;
|
|
19089
19021
|
}, {});
|
|
19090
19022
|
result.push({
|
|
@@ -19099,6 +19031,10 @@ let RangeProtectionRenderModel = class RangeProtectionRenderModel {
|
|
|
19099
19031
|
clear() {
|
|
19100
19032
|
this._cache.clear();
|
|
19101
19033
|
}
|
|
19034
|
+
dispose() {
|
|
19035
|
+
super.dispose();
|
|
19036
|
+
this._cache.clear();
|
|
19037
|
+
}
|
|
19102
19038
|
};
|
|
19103
19039
|
RangeProtectionRenderModel = __decorate([__decorateParam(0, Inject(RangeProtectionRuleModel)), __decorateParam(1, Inject(IPermissionService))], RangeProtectionRenderModel);
|
|
19104
19040
|
|
|
@@ -19236,11 +19172,11 @@ let RangeProtectionCache = class RangeProtectionCache extends Disposable {
|
|
|
19236
19172
|
this._permissionIdCache.delete(rule.permissionId);
|
|
19237
19173
|
}
|
|
19238
19174
|
_getSelectionActions(unitId, subUnitId, rule) {
|
|
19239
|
-
var _this$_permissionServ,
|
|
19240
|
-
const edit = (_this$_permissionServ =
|
|
19241
|
-
const view = (
|
|
19242
|
-
const manageProtection = (
|
|
19243
|
-
const deleteProtection = (
|
|
19175
|
+
var _this$_permissionServ, _RangeProtectionPermi, _this$_permissionServ2, _RangeProtectionPermi2, _this$_permissionServ3, _RangeProtectionPermi3, _this$_permissionServ4, _RangeProtectionPermi4;
|
|
19176
|
+
const edit = ((_this$_permissionServ = this._permissionService.getPermissionPoint((_RangeProtectionPermi = new RangeProtectionPermissionEditPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi === void 0 ? void 0 : _RangeProtectionPermi.id)) === null || _this$_permissionServ === void 0 ? void 0 : _this$_permissionServ.value) ?? false;
|
|
19177
|
+
const view = ((_this$_permissionServ2 = this._permissionService.getPermissionPoint((_RangeProtectionPermi2 = new RangeProtectionPermissionViewPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi2 === void 0 ? void 0 : _RangeProtectionPermi2.id)) === null || _this$_permissionServ2 === void 0 ? void 0 : _this$_permissionServ2.value) ?? false;
|
|
19178
|
+
const manageProtection = ((_this$_permissionServ3 = this._permissionService.getPermissionPoint((_RangeProtectionPermi3 = new RangeProtectionPermissionManageCollaPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi3 === void 0 ? void 0 : _RangeProtectionPermi3.id)) === null || _this$_permissionServ3 === void 0 ? void 0 : _this$_permissionServ3.value) ?? false;
|
|
19179
|
+
const deleteProtection = ((_this$_permissionServ4 = this._permissionService.getPermissionPoint((_RangeProtectionPermi4 = new RangeProtectionPermissionDeleteProtectionPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi4 === void 0 ? void 0 : _RangeProtectionPermi4.id)) === null || _this$_permissionServ4 === void 0 ? void 0 : _this$_permissionServ4.value) ?? false;
|
|
19244
19180
|
return {
|
|
19245
19181
|
[UnitAction.Edit]: edit,
|
|
19246
19182
|
[UnitAction.View]: view,
|
|
@@ -19388,7 +19324,7 @@ RangeProtectionCache = __decorate([
|
|
|
19388
19324
|
//#endregion
|
|
19389
19325
|
//#region package.json
|
|
19390
19326
|
var name = "@univerjs/sheets";
|
|
19391
|
-
var version = "1.0.0-
|
|
19327
|
+
var version = "1.0.0-beta.0";
|
|
19392
19328
|
|
|
19393
19329
|
//#endregion
|
|
19394
19330
|
//#region src/controllers/active-worksheet.controller.ts
|
|
@@ -19413,7 +19349,7 @@ let ActiveWorksheetController = class ActiveWorksheetController extends Disposab
|
|
|
19413
19349
|
_adjustActiveSheetOnHideSheet(mutation) {
|
|
19414
19350
|
var _workbook$getActiveSh;
|
|
19415
19351
|
const { unitId, subUnitId } = mutation.params;
|
|
19416
|
-
const workbook = this._univerInstanceService.
|
|
19352
|
+
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
19417
19353
|
if (!workbook) return;
|
|
19418
19354
|
if (((_workbook$getActiveSh = workbook.getActiveSheet()) === null || _workbook$getActiveSh === void 0 ? void 0 : _workbook$getActiveSh.getSheetId()) !== subUnitId) return;
|
|
19419
19355
|
const nextId = findTheNextUnhiddenSheet(workbook, workbook.getActiveSheetIndex());
|
|
@@ -19421,7 +19357,7 @@ let ActiveWorksheetController = class ActiveWorksheetController extends Disposab
|
|
|
19421
19357
|
}
|
|
19422
19358
|
_beforeAdjustActiveSheetOnRemoveSheet(mutation) {
|
|
19423
19359
|
const { unitId, subUnitId } = mutation.params;
|
|
19424
|
-
const workbook = this._univerInstanceService.
|
|
19360
|
+
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
19425
19361
|
if (!workbook) return;
|
|
19426
19362
|
const worksheet = workbook.getSheetBySheetId(subUnitId);
|
|
19427
19363
|
if (!worksheet) return;
|
|
@@ -19430,7 +19366,7 @@ let ActiveWorksheetController = class ActiveWorksheetController extends Disposab
|
|
|
19430
19366
|
_adjustActiveSheetOnRemoveSheet(mutation) {
|
|
19431
19367
|
if (this._previousSheetIndex === -1) return;
|
|
19432
19368
|
const { unitId } = mutation.params;
|
|
19433
|
-
const workbook = this._univerInstanceService.
|
|
19369
|
+
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
19434
19370
|
if (!workbook) return;
|
|
19435
19371
|
if (workbook.getActiveSheet().getSheetId() === mutation.params.subUnitId) {
|
|
19436
19372
|
const previousIndex = this._previousSheetIndex;
|
|
@@ -19495,7 +19431,6 @@ const ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY = "ONLY_REGISTER_FORMULA_RELAT
|
|
|
19495
19431
|
//#region src/controllers/basic-worksheet.controller.ts
|
|
19496
19432
|
let BasicWorksheetController = class BasicWorksheetController extends Disposable {
|
|
19497
19433
|
constructor(_commandService, _configService, _dataSyncPrimaryController) {
|
|
19498
|
-
var _this$_configService$;
|
|
19499
19434
|
super();
|
|
19500
19435
|
this._commandService = _commandService;
|
|
19501
19436
|
this._configService = _configService;
|
|
@@ -19537,7 +19472,7 @@ let BasicWorksheetController = class BasicWorksheetController extends Disposable
|
|
|
19537
19472
|
this._commandService.registerCommand(mutation);
|
|
19538
19473
|
(_this$_dataSyncPrimar = this._dataSyncPrimaryController) === null || _this$_dataSyncPrimar === void 0 || _this$_dataSyncPrimar.registerSyncingMutations(mutation);
|
|
19539
19474
|
});
|
|
19540
|
-
if (!(
|
|
19475
|
+
if (!(this._configService.getConfig("ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY") ?? false)) [
|
|
19541
19476
|
AddWorksheetMergeCommand,
|
|
19542
19477
|
AddWorksheetMergeAllCommand,
|
|
19543
19478
|
AddWorksheetMergeVerticalCommand,
|
|
@@ -19775,10 +19710,10 @@ let SheetPermissionViewModelController = class SheetPermissionViewModelControlle
|
|
|
19775
19710
|
const { unitId, subUnitId } = context;
|
|
19776
19711
|
const worksheetRule = this._worksheetProtectionRuleModel.getRule(unitId, subUnitId);
|
|
19777
19712
|
if (worksheetRule === null || worksheetRule === void 0 ? void 0 : worksheetRule.permissionId) {
|
|
19778
|
-
var _this$_permissionServ, _this$_permissionServ2,
|
|
19713
|
+
var _this$_permissionServ, _this$_permissionServ2, _selectionProtection$;
|
|
19779
19714
|
const selectionProtection = [{
|
|
19780
|
-
[UnitAction.View]: (_this$_permissionServ =
|
|
19781
|
-
[UnitAction.Edit]: (
|
|
19715
|
+
[UnitAction.View]: ((_this$_permissionServ = this._permissionService.getPermissionPoint(new WorksheetViewPermission(unitId, subUnitId).id)) === null || _this$_permissionServ === void 0 ? void 0 : _this$_permissionServ.value) ?? false,
|
|
19716
|
+
[UnitAction.Edit]: ((_this$_permissionServ2 = this._permissionService.getPermissionPoint(new WorksheetEditPermission(unitId, subUnitId).id)) === null || _this$_permissionServ2 === void 0 ? void 0 : _this$_permissionServ2.value) ?? false
|
|
19782
19717
|
}];
|
|
19783
19718
|
const isSkipRender = !((_selectionProtection$ = selectionProtection[0]) === null || _selectionProtection$ === void 0 ? void 0 : _selectionProtection$[UnitAction.View]);
|
|
19784
19719
|
const _cellData = !cell || cell === context.rawData ? { ...cell } : cell;
|
|
@@ -19897,7 +19832,7 @@ let NumfmtService = class NumfmtService extends Disposable {
|
|
|
19897
19832
|
this._logService = _logService;
|
|
19898
19833
|
}
|
|
19899
19834
|
getValue(unitId, subUnitId, row, col) {
|
|
19900
|
-
const workbook = this._univerInstanceService.
|
|
19835
|
+
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
19901
19836
|
if (!workbook) return;
|
|
19902
19837
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
19903
19838
|
if (!worksheet) return;
|
|
@@ -19910,7 +19845,7 @@ let NumfmtService = class NumfmtService extends Disposable {
|
|
|
19910
19845
|
return null;
|
|
19911
19846
|
}
|
|
19912
19847
|
deleteValues(unitId, subUnitId, values) {
|
|
19913
|
-
const workbook = this._univerInstanceService.
|
|
19848
|
+
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
19914
19849
|
if (!workbook) return;
|
|
19915
19850
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
19916
19851
|
if (!worksheet) return;
|
|
@@ -19927,7 +19862,7 @@ let NumfmtService = class NumfmtService extends Disposable {
|
|
|
19927
19862
|
});
|
|
19928
19863
|
}
|
|
19929
19864
|
setValues(unitId, subUnitId, values) {
|
|
19930
|
-
const workbook = this._univerInstanceService.
|
|
19865
|
+
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
19931
19866
|
if (!workbook) return;
|
|
19932
19867
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
19933
19868
|
if (!worksheet) return;
|
|
@@ -20443,7 +20378,7 @@ let RangeProtectionRefRangeService = class RangeProtectionRefRangeService extend
|
|
|
20443
20378
|
this._selectionProtectionRenderModel.clear();
|
|
20444
20379
|
}
|
|
20445
20380
|
if (mutationIdByRowCol.includes(command.id)) {
|
|
20446
|
-
const workbook = this._univerInstanceService.
|
|
20381
|
+
const workbook = this._univerInstanceService.getUnit(command.params.unitId, UniverInstanceType.UNIVER_SHEET);
|
|
20447
20382
|
if (!workbook) return;
|
|
20448
20383
|
const worksheet = workbook.getSheetBySheetId(command.params.subUnitId);
|
|
20449
20384
|
if (!worksheet) return;
|
|
@@ -21039,11 +20974,14 @@ const getPrimaryCellUp = (scopeRange, worksheet, currentPrimary, step = 1, isFin
|
|
|
21039
20974
|
startRow: next,
|
|
21040
20975
|
endRow: next
|
|
21041
20976
|
};
|
|
21042
|
-
else if (isGoBack)
|
|
21043
|
-
|
|
21044
|
-
|
|
21045
|
-
|
|
21046
|
-
|
|
20977
|
+
else if (isGoBack) {
|
|
20978
|
+
const newPrimary = {
|
|
20979
|
+
...currentPrimary,
|
|
20980
|
+
startRow: endRow,
|
|
20981
|
+
endRow
|
|
20982
|
+
};
|
|
20983
|
+
return getPrimaryCellLeft(scopeRange, worksheet, newPrimary, step, isFindNext, false);
|
|
20984
|
+
}
|
|
21047
20985
|
};
|
|
21048
20986
|
const getPrimaryCellDown = (scopeRange, worksheet, currentPrimary, step = 1, isFindNext = true, isGoBack = true) => {
|
|
21049
20987
|
const { startRow, endRow } = Range.transformRange(scopeRange, worksheet);
|
|
@@ -21060,11 +20998,14 @@ const getPrimaryCellDown = (scopeRange, worksheet, currentPrimary, step = 1, isF
|
|
|
21060
20998
|
startRow: next,
|
|
21061
20999
|
endRow: next
|
|
21062
21000
|
};
|
|
21063
|
-
else if (isGoBack)
|
|
21064
|
-
|
|
21065
|
-
|
|
21066
|
-
|
|
21067
|
-
|
|
21001
|
+
else if (isGoBack) {
|
|
21002
|
+
const newPrimary = {
|
|
21003
|
+
...currentPrimary,
|
|
21004
|
+
startRow,
|
|
21005
|
+
endRow: startRow
|
|
21006
|
+
};
|
|
21007
|
+
return getPrimaryCellRight(scopeRange, worksheet, newPrimary, step, isFindNext, false);
|
|
21008
|
+
}
|
|
21068
21009
|
};
|
|
21069
21010
|
const getPrimaryCellLeft = (scopeRange, worksheet, currentPrimary, step = 1, isFindNext = true, isGoBack = true) => {
|
|
21070
21011
|
const { startColumn, endColumn } = Range.transformRange(scopeRange, worksheet);
|
|
@@ -21081,11 +21022,14 @@ const getPrimaryCellLeft = (scopeRange, worksheet, currentPrimary, step = 1, isF
|
|
|
21081
21022
|
startColumn: next,
|
|
21082
21023
|
endColumn: next
|
|
21083
21024
|
};
|
|
21084
|
-
else if (isGoBack)
|
|
21085
|
-
|
|
21086
|
-
|
|
21087
|
-
|
|
21088
|
-
|
|
21025
|
+
else if (isGoBack) {
|
|
21026
|
+
const newPrimary = {
|
|
21027
|
+
...currentPrimary,
|
|
21028
|
+
startColumn: endColumn,
|
|
21029
|
+
endColumn
|
|
21030
|
+
};
|
|
21031
|
+
return getPrimaryCellUp(scopeRange, worksheet, newPrimary, step, isFindNext, false);
|
|
21032
|
+
}
|
|
21089
21033
|
};
|
|
21090
21034
|
const getPrimaryCellRight = (scopeRange, worksheet, currentPrimary, step = 1, isFindNext = true, isGoBack = true) => {
|
|
21091
21035
|
const { startColumn, endColumn } = Range.transformRange(scopeRange, worksheet);
|
|
@@ -21102,11 +21046,14 @@ const getPrimaryCellRight = (scopeRange, worksheet, currentPrimary, step = 1, is
|
|
|
21102
21046
|
endColumn: next,
|
|
21103
21047
|
startColumn: next
|
|
21104
21048
|
};
|
|
21105
|
-
else if (isGoBack)
|
|
21106
|
-
|
|
21107
|
-
|
|
21108
|
-
|
|
21109
|
-
|
|
21049
|
+
else if (isGoBack) {
|
|
21050
|
+
const newPrimary = {
|
|
21051
|
+
...currentPrimary,
|
|
21052
|
+
startColumn,
|
|
21053
|
+
endColumn: startColumn
|
|
21054
|
+
};
|
|
21055
|
+
return getPrimaryCellDown(scopeRange, worksheet, newPrimary, step, isFindNext, false);
|
|
21056
|
+
}
|
|
21110
21057
|
};
|
|
21111
21058
|
function getCellAtRowCol$1(row, col, worksheet) {
|
|
21112
21059
|
let destRange = null;
|
|
@@ -21328,4 +21275,4 @@ function convertPositionCellToSheetOverGrid(unitId, subUnitId, cellOverGridPosit
|
|
|
21328
21275
|
}
|
|
21329
21276
|
|
|
21330
21277
|
//#endregion
|
|
21331
|
-
export { AFFECT_LAYOUT_STYLES, AFTER_CELL_EDIT, AUTO_FILL_APPLY_TYPE, AUTO_FILL_DATA_TYPE, AUTO_FILL_HOOK_TYPE, AddMergeRedoSelectionsOperationFactory, AddMergeUndoMutationFactory, AddMergeUndoSelectionsOperationFactory, AddRangeProtectionCommand, AddRangeProtectionMutation, AddRangeThemeMutation, AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeMutation, AddWorksheetMergeVerticalCommand, AddWorksheetProtectionCommand, AddWorksheetProtectionMutation, AppendRowCommand, AutoClearContentCommand, AutoFillCommand, AutoFillController, AutoFillRules, AutoFillService, AutoFillTools, BEFORE_CELL_EDIT, BorderStyleManagerService, COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, CalculateResultApplyController, CancelFrozenCommand, CancelMarkDirtyRowAutoHeightOperation, ClearSelectionAllCommand, ClearSelectionContentCommand, ClearSelectionFormatCommand, CopySheetCommand, CopyWorksheetEndMutation, DISABLE_NORMAL_SELECTIONS, DefinedNameDataController, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, DeleteRangeProtectionCommand, DeleteRangeProtectionMutation, DeleteWorksheetProtectionCommand, DeleteWorksheetProtectionMutation, DeleteWorksheetRangeThemeStyleCommand, DeleteWorksheetRangeThemeStyleMutation, DeleteWorksheetRangeThemeStyleMutationFactory, DeltaColumnWidthCommand, DeltaRowHeightCommand, EditStateEnum, EffectRefRangId, EmptyMutation, ExclusiveRangeService, FactoryAddRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, FactorySetRangeProtectionMutation, IAutoFillService, IExclusiveRangeService, INTERCEPTOR_POINT, INumfmtService, IRefSelectionsService, InsertColAfterCommand, InsertColBeforeCommand, InsertColByRangeCommand, InsertColCommand, InsertColMutation, InsertColMutationUndoFactory, InsertDefinedNameCommand, InsertMultiColsLeftCommand, InsertMultiColsRightCommand, InsertMultiRowsAboveCommand, InsertMultiRowsAfterCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowByRangeCommand, InsertRowCommand, InsertRowMutation, InsertRowMutationUndoFactory, InsertSheetCommand, InsertSheetMutation, InsertSheetUndoMutationFactory, InterceptCellContentPriority, MAX_CELL_PER_SHEET_KEY, MERGE_CELL_INTERCEPTOR_CHECK, MarkDirtyFilterChangeMutation, MarkDirtyRowAutoHeightOperation, MergeCellController, MoveColsCommand, MoveColsMutation, MoveColsMutationUndoFactory, MoveRangeCommand, MoveRangeMutation, MoveRowsCommand, MoveRowsMutation, MoveRowsMutationUndoFactory, NumfmtService, OperatorType, PermissionPointsDefinitions, REF_SELECTIONS_ENABLED, RangeMergeUtil, RangeProtectionCache, RangeProtectionPermissionDeleteProtectionPoint, RangeProtectionPermissionEditPoint, RangeProtectionPermissionManageCollaPoint, RangeProtectionPermissionViewPoint, RangeProtectionRefRangeService, RangeProtectionRenderModel, RangeProtectionRuleModel, RangeProtectionService, RangeThemeStyle, RefRangeService, RefSelectionsService, RefillCommand, RegisterWorksheetRangeThemeStyleCommand, RegisterWorksheetRangeThemeStyleMutation, RemoveColByRangeCommand, RemoveColCommand, RemoveColMutation, RemoveDefinedNameCommand, RemoveMergeUndoMutationFactory, RemoveNumfmtMutation, RemoveRangeThemeMutation, RemoveRowByRangeCommand, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, RemoveSheetMutation, RemoveSheetUndoMutationFactory, RemoveWorksheetMergeCommand, RemoveWorksheetMergeMutation, ReorderRangeCommand, ReorderRangeMutation, ReorderRangeUndoMutationFactory, ResetBackgroundColorCommand, ResetTextColorCommand, SCOPE_WORKBOOK_VALUE_DEFINED_NAME, SELECTIONS_ENABLED, SELECTION_CONTROL_BORDER_BUFFER_COLOR, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, SHEETS_PLUGIN_CONFIG_KEY, ScrollToCellOperation, SelectRangeCommand, SelectionMoveType, SetBackgroundColorCommand, SetBoldCommand, SetBorderBasicCommand, SetBorderColorCommand, SetBorderCommand, SetBorderPositionCommand, SetBorderStyleCommand, SetColDataCommand, SetColDataMutation, SetColDataMutationFactory, SetColHiddenCommand, SetColHiddenMutation, SetColVisibleMutation, SetColWidthCommand, SetDefinedNameCommand, SetFontFamilyCommand, SetFontSizeCommand, SetFrozenCommand, SetFrozenMutation, SetFrozenMutationFactory, SetGridlinesColorCommand, SetGridlinesColorMutation, SetHorizontalTextAlignCommand, SetItalicCommand, SetNumfmtMutation, SetOverlineCommand, SetProtectionCommand, SetRangeCustomMetadataCommand, SetRangeProtectionMutation, SetRangeThemeMutation, SetRangeValuesCommand, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SetRowDataCommand, SetRowDataMutation, SetRowDataMutationFactory, SetRowHeightCommand, SetRowHiddenCommand, SetRowHiddenMutation, SetRowVisibleMutation, SetSelectedColsVisibleCommand, SetSelectedRowsVisibleCommand, SetSelectionsOperation, SetShrinkToFitCommand, SetSpecificColsVisibleCommand, SetSpecificRowsVisibleCommand, SetStrikeThroughCommand, SetStyleCommand, SetTabColorCommand, SetTabColorMutation, SetTextColorCommand, SetTextRotationCommand, SetTextWrapCommand, SetUnderlineCommand, SetVerticalTextAlignCommand, SetWorkbookNameCommand, SetWorkbookNameMutation, SetWorksheetActivateCommand, SetWorksheetActiveOperation, SetWorksheetColWidthMutation, SetWorksheetColWidthMutationFactory, SetWorksheetColumnCountCommand, SetWorksheetColumnCountMutation, SetWorksheetColumnCountUndoMutationFactory, SetWorksheetDefaultStyleCommand, SetWorksheetDefaultStyleMutation, SetWorksheetDefaultStyleMutationFactory, SetWorksheetHideCommand, SetWorksheetHideMutation, SetWorksheetNameCommand, SetWorksheetNameMutation, SetWorksheetOrderCommand, SetWorksheetOrderMutation, SetWorksheetPermissionPointsCommand, SetWorksheetPermissionPointsMutation, SetWorksheetProtectionCommand, SetWorksheetProtectionMutation, SetWorksheetRangeThemeStyleCommand, SetWorksheetRangeThemeStyleMutation, SetWorksheetRangeThemeStyleMutationFactory, SetWorksheetRightToLeftCommand, SetWorksheetRightToLeftMutation, SetWorksheetRowAutoHeightMutation, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowCountCommand, SetWorksheetRowCountMutation, SetWorksheetRowCountUndoMutationFactory, SetWorksheetRowHeightMutation, SetWorksheetRowHeightMutationFactory, SetWorksheetRowIsAutoHeightCommand, SetWorksheetRowIsAutoHeightMutation, SetWorksheetRowIsAutoHeightMutationFactory, SetWorksheetShowCommand, SheetCopyDownCommand, SheetCopyRightCommand, SheetInterceptorService, SheetLazyExecuteScheduleService, SheetPermissionCheckController, SheetPermissionInitController, SheetRangeThemeModel, SheetRangeThemeService, SheetSkeletonChangeType, SheetSkeletonService, SheetValueChangeType, SheetsFreezeSyncController, SheetsSelectionsService, SplitDelimiterEnum, SplitTextToColumnsCommand, TextToNumberCommand, ToggleCellCheckboxCommand, ToggleGridlinesCommand, ToggleGridlinesMutation, UniverSheetsPlugin, UnregisterWorksheetRangeThemeStyleCommand, UnregisterWorksheetRangeThemeStyleMutation, VALIDATE_CELL, ViewStateEnum, WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCopySheetPermission, WorkbookCreateProtectPermission, WorkbookCreateSheetPermission, WorkbookDeleteColumnPermission, WorkbookDeleteRowPermission, WorkbookDeleteSheetPermission, WorkbookDuplicatePermission, WorkbookEditablePermission, WorkbookExportPermission, WorkbookHideSheetPermission, WorkbookInsertColumnPermission, WorkbookInsertRowPermission, WorkbookManageCollaboratorPermission, WorkbookMoveSheetPermission, WorkbookPermissionService, WorkbookPrintPermission, WorkbookRecoverHistoryPermission, WorkbookRenameSheetPermission, WorkbookSelectionModel, WorkbookSharePermission, WorkbookViewHistoryPermission, WorkbookViewPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteProtectionPermission, WorksheetDeleteRowPermission, WorksheetEditExtraObjectPermission, WorksheetEditPermission, WorksheetFilterPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetPermissionService, WorksheetPivotTablePermission, WorksheetProtectionPointModel, WorksheetProtectionRuleModel, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetSortPermission, WorksheetViewPermission, ZebraCrossingCacheController, addMergeCellsUtil, adjustRangeOnMutation, alignToMergedCellsBorders, attachPrimaryWithCoord, attachRangeWithCoord, attachSelectionWithCoord, baseProtectionActions, checkCellValueType, checkRangesEditablePermission, convertPositionCellToSheetOverGrid, convertPositionSheetOverGridToAbsolute, convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, copyRangeStyles, countCells, createTopMatrixFromMatrix, createTopMatrixFromRanges, defaultLargeSheetOperationConfig, defaultWorkbookPermissionPoints, defaultWorksheetPermissionPoint, deserializeListOptions, discreteRangeToRange, expandToContinuousRange, factoryRemoveNumfmtUndoMutation, factorySetNumfmtUndoMutation, findAllRectangle, findFirstNonEmptyCell, followSelectionOperation, generateNullCell, generateNullCellValue, getAddMergeMutationRangeByType, getAllRangePermissionPoint, getAllWorkbookPermissionPoint, getAllWorksheetPermissionPoint, getAllWorksheetPermissionPointByPointPanel, getCellAtRowCol, getClearContentMutationParamForRange, getClearContentMutationParamsForRanges, getDefaultRangePermission, getInsertRangeMutations, getMoveRangeCommandMutations, getMoveRangeUndoRedoMutations, getNextPrimaryCell, getPrimaryForRange, getRemoveRangeMutations, getSelectionsService, getSeparateEffectedRangesOnCommand, getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationTarget, getSkeletonChangedEffectedRange, getValueChangedEffectedRange, getVisibleRanges, handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleCommonDefaultRangeChangeWithEffectRefCommands, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests, handleDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleDeleteRangeMutation, handleIRemoveCol, handleIRemoveRow, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRangeMutation, handleInsertRow, handleMoveCols, handleMoveRange, handleMoveRows, isSingleCellSelection, rangeMerge, rangeToDiscreteRange, rotateRange, runRefRangeMutations, serializeListOptions, setEndForRange, splitRangeText, transformCellsToRange, validateDefinedName };
|
|
21278
|
+
export { AFFECT_LAYOUT_STYLES, AFTER_CELL_EDIT, AUTO_FILL_APPLY_TYPE, AUTO_FILL_DATA_TYPE, AUTO_FILL_HOOK_TYPE, AddMergeRedoSelectionsOperationFactory, AddMergeUndoMutationFactory, AddMergeUndoSelectionsOperationFactory, AddRangeProtectionCommand, AddRangeProtectionMutation, AddRangeThemeMutation, AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeMutation, AddWorksheetMergeVerticalCommand, AddWorksheetProtectionCommand, AddWorksheetProtectionMutation, AppendRowCommand, AutoClearContentCommand, AutoFillCommand, AutoFillController, AutoFillRules, AutoFillService, AutoFillTools, BEFORE_CELL_EDIT, BorderStyleManagerService, COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, CalculateResultApplyController, CancelFrozenCommand, CancelMarkDirtyRowAutoHeightOperation, ClearSelectionAllCommand, ClearSelectionContentCommand, ClearSelectionFormatCommand, CopySheetCommand, CopyWorksheetEndMutation, DISABLE_NORMAL_SELECTIONS, DefinedNameDataController, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, DeleteRangeProtectionCommand, DeleteRangeProtectionMutation, DeleteWorksheetProtectionCommand, DeleteWorksheetProtectionMutation, DeleteWorksheetRangeThemeStyleCommand, DeleteWorksheetRangeThemeStyleMutation, DeleteWorksheetRangeThemeStyleMutationFactory, DeltaColumnWidthCommand, DeltaRowHeightCommand, EditStateEnum, EffectRefRangId, EmptyMutation, ExclusiveRangeService, FactoryAddRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, FactorySetRangeProtectionMutation, IAutoFillService, IExclusiveRangeService, INTERCEPTOR_POINT, INumfmtService, IRefSelectionsService, InsertColAfterCommand, InsertColBeforeCommand, InsertColByRangeCommand, InsertColCommand, InsertColMutation, InsertColMutationUndoFactory, InsertDefinedNameCommand, InsertMultiColsLeftCommand, InsertMultiColsRightCommand, InsertMultiRowsAboveCommand, InsertMultiRowsAfterCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowByRangeCommand, InsertRowCommand, InsertRowMutation, InsertRowMutationUndoFactory, InsertSheetCommand, InsertSheetMutation, InsertSheetUndoMutationFactory, InterceptCellContentPriority, MAX_CELL_PER_SHEET_KEY, MERGE_CELL_INTERCEPTOR_CHECK, MarkDirtyFilterChangeMutation, MarkDirtyRowAutoHeightOperation, MergeCellController, MoveColsCommand, MoveColsMutation, MoveColsMutationUndoFactory, MoveRangeCommand, MoveRangeMutation, MoveRowsCommand, MoveRowsMutation, MoveRowsMutationUndoFactory, NumfmtService, OperatorType, PermissionPointsDefinitions, REF_SELECTIONS_ENABLED, RangeMergeUtil, RangeProtectionCache, RangeProtectionPermissionDeleteProtectionPoint, RangeProtectionPermissionEditPoint, RangeProtectionPermissionManageCollaPoint, RangeProtectionPermissionViewPoint, RangeProtectionRefRangeService, RangeProtectionRenderModel, RangeProtectionRuleModel, RangeProtectionService, RangeThemeStyle, RefRangeService, RefSelectionsService, RefillCommand, RegisterWorksheetRangeThemeStyleCommand, RegisterWorksheetRangeThemeStyleMutation, RemoveColByRangeCommand, RemoveColCommand, RemoveColMutation, RemoveDefinedNameCommand, RemoveMergeUndoMutationFactory, RemoveNumfmtMutation, RemoveRangeThemeMutation, RemoveRowByRangeCommand, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, RemoveSheetMutation, RemoveSheetUndoMutationFactory, RemoveWorksheetMergeCommand, RemoveWorksheetMergeMutation, ReorderRangeCommand, ReorderRangeMutation, ReorderRangeUndoMutationFactory, ResetBackgroundColorCommand, ResetTextColorCommand, SCOPE_WORKBOOK_VALUE_DEFINED_NAME, SELECTIONS_ENABLED, SELECTION_CONTROL_BORDER_BUFFER_COLOR, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, SHEETS_PLUGIN_CONFIG_KEY, ScrollToCellOperation, SelectRangeCommand, SelectionMoveType, SetBackgroundColorCommand, SetBoldCommand, SetBorderBasicCommand, SetBorderColorCommand, SetBorderCommand, SetBorderPositionCommand, SetBorderStyleCommand, SetColDataCommand, SetColDataMutation, SetColDataMutationFactory, SetColHiddenCommand, SetColHiddenMutation, SetColVisibleMutation, SetColWidthCommand, SetDefinedNameCommand, SetFontFamilyCommand, SetFontSizeCommand, SetFrozenCommand, SetFrozenMutation, SetFrozenMutationFactory, SetGridlinesColorCommand, SetGridlinesColorMutation, SetHorizontalTextAlignCommand, SetItalicCommand, SetNumfmtMutation, SetOverlineCommand, SetProtectionCommand, SetRangeCustomMetadataCommand, SetRangeProtectionMutation, SetRangeThemeMutation, SetRangeValuesCommand, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SetRowDataCommand, SetRowDataMutation, SetRowDataMutationFactory, SetRowHeightCommand, SetRowHiddenCommand, SetRowHiddenMutation, SetRowVisibleMutation, SetSelectedColsVisibleCommand, SetSelectedRowsVisibleCommand, SetSelectionsOperation, SetShrinkToFitCommand, SetSpecificColsVisibleCommand, SetSpecificRowsVisibleCommand, SetStrikeThroughCommand, SetStyleCommand, SetTabColorCommand, SetTabColorMutation, SetTextColorCommand, SetTextRotationCommand, SetTextWrapCommand, SetUnderlineCommand, SetVerticalTextAlignCommand, SetWorkbookNameCommand, SetWorkbookNameMutation, SetWorksheetActivateCommand, SetWorksheetActiveOperation, SetWorksheetColWidthMutation, SetWorksheetColWidthMutationFactory, SetWorksheetColumnCountCommand, SetWorksheetColumnCountMutation, SetWorksheetColumnCountUndoMutationFactory, SetWorksheetDefaultStyleCommand, SetWorksheetDefaultStyleMutation, SetWorksheetDefaultStyleMutationFactory, SetWorksheetHideCommand, SetWorksheetHideMutation, SetWorksheetNameCommand, SetWorksheetNameMutation, SetWorksheetOrderCommand, SetWorksheetOrderMutation, SetWorksheetPermissionPointsCommand, SetWorksheetPermissionPointsMutation, SetWorksheetProtectionCommand, SetWorksheetProtectionMutation, SetWorksheetRangeThemeStyleCommand, SetWorksheetRangeThemeStyleMutation, SetWorksheetRangeThemeStyleMutationFactory, SetWorksheetRightToLeftCommand, SetWorksheetRightToLeftMutation, SetWorksheetRowAutoHeightMutation, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowCountCommand, SetWorksheetRowCountMutation, SetWorksheetRowCountUndoMutationFactory, SetWorksheetRowHeightMutation, SetWorksheetRowHeightMutationFactory, SetWorksheetRowIsAutoHeightCommand, SetWorksheetRowIsAutoHeightMutation, SetWorksheetRowIsAutoHeightMutationFactory, SetWorksheetShowCommand, SheetCopyDownCommand, SheetCopyRightCommand, SheetInterceptorService, SheetLazyExecuteScheduleService, SheetPermissionCheckController, SheetPermissionInitController, SheetRangeThemeModel, SheetRangeThemeService, SheetSkeletonChangeType, SheetSkeletonService, SheetValueChangeType, SheetsFreezeSyncController, SheetsSelectionsService, SplitDelimiterEnum, SplitTextToColumnsCommand, TextToNumberCommand, ToggleCellCheckboxCommand, ToggleGridlinesCommand, ToggleGridlinesMutation, UniverSheetsPlugin, UnregisterWorksheetRangeThemeStyleCommand, UnregisterWorksheetRangeThemeStyleMutation, VALIDATE_CELL, ViewStateEnum, WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCopySheetPermission, WorkbookCreateProtectPermission, WorkbookCreateSheetPermission, WorkbookDeleteColumnPermission, WorkbookDeleteRowPermission, WorkbookDeleteSheetPermission, WorkbookDuplicatePermission, WorkbookEditablePermission, WorkbookExportPermission, WorkbookHideSheetPermission, WorkbookInsertColumnPermission, WorkbookInsertRowPermission, WorkbookManageCollaboratorPermission, WorkbookMoveSheetPermission, WorkbookPermissionService, WorkbookPrintPermission, WorkbookRecoverHistoryPermission, WorkbookRenameSheetPermission, WorkbookSelectionModel, WorkbookSharePermission, WorkbookViewHistoryPermission, WorkbookViewPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteProtectionPermission, WorksheetDeleteRowPermission, WorksheetEditExtraObjectPermission, WorksheetEditPermission, WorksheetFilterPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetPermissionService, WorksheetPivotTablePermission, WorksheetProtectionPointModel, WorksheetProtectionRuleModel, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetSortPermission, WorksheetViewPermission, ZebraCrossingCacheController, addMergeCellsUtil, adjustRangeOnMutation, alignToMergedCellsBorders, attachPrimaryWithCoord, attachRangeWithCoord, attachSelectionWithCoord, baseProtectionActions, checkCellValueType, checkRangesEditablePermission, convertPositionCellToSheetOverGrid, convertPositionSheetOverGridToAbsolute, convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, copyRangeStyles, countCells, createTopMatrixFromMatrix, createTopMatrixFromRanges, defaultLargeSheetOperationConfig, defaultWorkbookPermissionPoints, defaultWorksheetPermissionPoint, deserializeListOptions, discreteRangeToRange, expandToContinuousRange, factoryRemoveNumfmtUndoMutation, factorySetNumfmtUndoMutation, findAllRectangle, findFirstNonEmptyCell, followSelectionOperation, generateNullCell, generateNullCellValue, getAddMergeMutationRangeByType, getAllRangePermissionPoint, getAllWorkbookPermissionPoint, getAllWorksheetPermissionPoint, getAllWorksheetPermissionPointByPointPanel, getCellAtRowCol, getClearContentMutationParamForRange, getClearContentMutationParamsForRanges, getDefaultRangePermission, getInsertRangeMutations, getMoveRangeCommandMutations, getMoveRangeUndoRedoMutations, getNextPrimaryCell, getPrimaryForRange, getRemoveRangeMutations, getSelectionsService, getSeparateEffectedRangesOnCommand, getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationTarget, getSkeletonChangedEffectedRange, getValueChangedEffectedRange, getVisibleRanges, handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleCommonDefaultRangeChangeWithEffectRefCommands, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests, handleDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleDeleteRangeMutation, handleIRemoveCol, handleIRemoveRow, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRangeMutation, handleInsertRow, handleMoveCols, handleMoveRange, handleMoveRows, isCellImage, isSingleCellSelection, rangeMerge, rangeToDiscreteRange, rotateRange, runRefRangeMutations, serializeListOptions, setEndForRange, splitRangeText, transformCellsToRange, validateDefinedName };
|