@univerjs/sheets 0.22.1 → 0.23.0-insiders.20260522-ee0b0a4
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 +1 -41
- package/lib/cjs/index.js +61 -28
- package/lib/es/facade.js +2 -42
- package/lib/es/index.js +61 -28
- package/lib/facade.js +2 -42
- package/lib/index.js +61 -28
- package/lib/types/facade/f-worksheet.d.ts +3 -24
- package/lib/types/index.d.ts +7 -7
- package/lib/types/services/sheet-interceptor/sheet-interceptor.service.d.ts +4 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +8 -8
- package/LICENSE +0 -176
- /package/lib/types/commands/commands/{set-border-command.d.ts → set-border.command.d.ts} +0 -0
- /package/lib/types/commands/mutations/{numfmt-mutation.d.ts → numfmt.mutation.d.ts} +0 -0
- /package/lib/types/commands/utils/{handle-range-mutation.d.ts → handle-range.mutation.d.ts} +0 -0
- /package/lib/types/services/exclusive-range/{exclusive-range-service.d.ts → exclusive-range.service.d.ts} +0 -0
- /package/lib/types/services/{range-theme-service.d.ts → range-theme.service.d.ts} +0 -0
package/lib/cjs/facade.js
CHANGED
|
@@ -3334,7 +3334,6 @@ let FWorksheet = _FWorksheet = class FWorksheet extends _univerjs_core_facade.FB
|
|
|
3334
3334
|
* Sets the frozen state of the current sheet.
|
|
3335
3335
|
* @param {IFreeze} freeze - the scrolling viewport start range and count of freezed rows and columns.
|
|
3336
3336
|
* that means if you want to freeze the first 3 rows and 2 columns, you should set freeze as { startRow: 3, startColumn: 2, xSplit: 2, ySplit: 3 }
|
|
3337
|
-
* @deprecated use `setFrozenRows` and `setFrozenColumns` instead.
|
|
3338
3337
|
* @returns {FWorksheet} This worksheet instance for chaining
|
|
3339
3338
|
* @example
|
|
3340
3339
|
* ```typescript
|
|
@@ -3349,7 +3348,6 @@ let FWorksheet = _FWorksheet = class FWorksheet extends _univerjs_core_facade.FB
|
|
|
3349
3348
|
* ```
|
|
3350
3349
|
*/
|
|
3351
3350
|
setFreeze(freeze) {
|
|
3352
|
-
this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead");
|
|
3353
3351
|
this._commandService.syncExecuteCommand(_univerjs_sheets.SetFrozenCommand.id, {
|
|
3354
3352
|
...freeze,
|
|
3355
3353
|
unitId: this._workbook.getUnitId(),
|
|
@@ -3605,28 +3603,6 @@ let FWorksheet = _FWorksheet = class FWorksheet extends _univerjs_core_facade.FB
|
|
|
3605
3603
|
return this._worksheet.getTabColor();
|
|
3606
3604
|
}
|
|
3607
3605
|
/**
|
|
3608
|
-
* @deprecated use `univerAPI.addEvent(univerAPI.Event.SheetValueChanged, (params) => {})` instead
|
|
3609
|
-
*/
|
|
3610
|
-
onCellDataChange(callback) {
|
|
3611
|
-
return this._injector.get(_univerjs_core.ICommandService).onCommandExecuted((command) => {
|
|
3612
|
-
if (command.id === _univerjs_sheets.SetRangeValuesMutation.id) {
|
|
3613
|
-
const params = command.params;
|
|
3614
|
-
if (params.unitId === this._workbook.getUnitId() && params.subUnitId === this._worksheet.getSheetId() && params.cellValue) callback(new _univerjs_core.ObjectMatrix(params.cellValue));
|
|
3615
|
-
}
|
|
3616
|
-
});
|
|
3617
|
-
}
|
|
3618
|
-
/**
|
|
3619
|
-
* @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeSheetEditEnd, (params) => {})` instead
|
|
3620
|
-
*/
|
|
3621
|
-
onBeforeCellDataChange(callback) {
|
|
3622
|
-
return this._injector.get(_univerjs_core.ICommandService).beforeCommandExecuted((command) => {
|
|
3623
|
-
if (command.id === _univerjs_sheets.SetRangeValuesMutation.id) {
|
|
3624
|
-
const params = command.params;
|
|
3625
|
-
if (params.unitId === this._workbook.getUnitId() && params.subUnitId === this._worksheet.getSheetId() && params.cellValue) callback(new _univerjs_core.ObjectMatrix(params.cellValue));
|
|
3626
|
-
}
|
|
3627
|
-
});
|
|
3628
|
-
}
|
|
3629
|
-
/**
|
|
3630
3606
|
* Hides this sheet. Has no effect if the sheet is already hidden. If this method is called on the only visible sheet, it throws an exception.
|
|
3631
3607
|
* @returns {FWorksheet} Returns the current worksheet instance for method chaining
|
|
3632
3608
|
* @example
|
|
@@ -3822,7 +3798,7 @@ let FWorksheet = _FWorksheet = class FWorksheet extends _univerjs_core_facade.FB
|
|
|
3822
3798
|
}
|
|
3823
3799
|
/**
|
|
3824
3800
|
* Returns a Range corresponding to the dimensions in which data is present.
|
|
3825
|
-
*
|
|
3801
|
+
* Empty cells with style or formatting will also be included in the data range. If there is no data on the sheet, returns a Range corresponding to the top-left cell of the sheet (A1).
|
|
3826
3802
|
* @returns {FRange} The range of the data in the sheet.
|
|
3827
3803
|
* @example
|
|
3828
3804
|
* ```ts
|
|
@@ -3839,14 +3815,6 @@ let FWorksheet = _FWorksheet = class FWorksheet extends _univerjs_core_facade.FB
|
|
|
3839
3815
|
return this.getRange(startRow, startColumn, endRow - startRow + 1, endColumn - startColumn + 1);
|
|
3840
3816
|
}
|
|
3841
3817
|
/**
|
|
3842
|
-
* @deprecated use `getLastColumn` instead.
|
|
3843
|
-
* Returns the column index of the last column that contains content.
|
|
3844
|
-
* @returns {number} the column index of the last column that contains content.
|
|
3845
|
-
*/
|
|
3846
|
-
getLastColumns() {
|
|
3847
|
-
return this._worksheet.getLastColumnWithContent();
|
|
3848
|
-
}
|
|
3849
|
-
/**
|
|
3850
3818
|
* Returns the column index of the last column that contains content.
|
|
3851
3819
|
* @returns {number} the column index of the last column that contains content.
|
|
3852
3820
|
* @example
|
|
@@ -3863,14 +3831,6 @@ let FWorksheet = _FWorksheet = class FWorksheet extends _univerjs_core_facade.FB
|
|
|
3863
3831
|
return this._worksheet.getLastColumnWithContent();
|
|
3864
3832
|
}
|
|
3865
3833
|
/**
|
|
3866
|
-
* @deprecated use `getLastRow` instead.
|
|
3867
|
-
* Returns the row index of the last row that contains content.
|
|
3868
|
-
* @returns {number} the row index of the last row that contains content.
|
|
3869
|
-
*/
|
|
3870
|
-
getLastRows() {
|
|
3871
|
-
return this._worksheet.getLastRowWithContent();
|
|
3872
|
-
}
|
|
3873
|
-
/**
|
|
3874
3834
|
* Returns the row index of the last row that contains content.
|
|
3875
3835
|
* @returns {number} the row index of the last row that contains content.
|
|
3876
3836
|
* @example
|
package/lib/cjs/index.js
CHANGED
|
@@ -235,9 +235,8 @@ let SheetInterceptorService = class SheetInterceptorService extends _univerjs_co
|
|
|
235
235
|
_defineProperty(this, "_afterCommandInterceptors", []);
|
|
236
236
|
_defineProperty(this, "_workbookDisposables", /* @__PURE__ */ new Map());
|
|
237
237
|
_defineProperty(this, "_worksheetDisposables", /* @__PURE__ */ new Map());
|
|
238
|
-
_defineProperty(this, "_interceptorsDirty", false);
|
|
239
238
|
_defineProperty(this, "_composedInterceptorByKey", /* @__PURE__ */ new Map());
|
|
240
|
-
_defineProperty(this, "
|
|
239
|
+
_defineProperty(this, "_composedInterceptorVersion", 0);
|
|
241
240
|
_defineProperty(this, "writeCellInterceptor", new _univerjs_core.InterceptorManager({
|
|
242
241
|
BEFORE_CELL_EDIT,
|
|
243
242
|
AFTER_CELL_EDIT,
|
|
@@ -272,6 +271,7 @@ let SheetInterceptorService = class SheetInterceptorService extends _univerjs_co
|
|
|
272
271
|
this._worksheetDisposables.forEach((disposable) => disposable.dispose());
|
|
273
272
|
this._worksheetDisposables.clear();
|
|
274
273
|
this._interceptorsByName.clear();
|
|
274
|
+
this._composedInterceptorByKey.clear();
|
|
275
275
|
}
|
|
276
276
|
/**
|
|
277
277
|
* Add a listener function to a specific command to add affiliated mutations. It should be called in controllers.
|
|
@@ -437,7 +437,7 @@ let SheetInterceptorService = class SheetInterceptorService extends _univerjs_co
|
|
|
437
437
|
var _b$priority6, _a$priority6;
|
|
438
438
|
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);
|
|
439
439
|
});
|
|
440
|
-
this.
|
|
440
|
+
this._invalidateComposedInterceptors();
|
|
441
441
|
if (key === INTERCEPTOR_POINT.CELL_CONTENT) {
|
|
442
442
|
const JOINED_EFFECT = _univerjs_core.InterceptorEffectEnum.Style | _univerjs_core.InterceptorEffectEnum.Value;
|
|
443
443
|
this._interceptorsByName.set(`${key}-${JOINED_EFFECT}`, sortedInterceptors);
|
|
@@ -449,27 +449,44 @@ let SheetInterceptorService = class SheetInterceptorService extends _univerjs_co
|
|
|
449
449
|
(0, _univerjs_core.remove)(this._interceptorsByName.get(`${key}-${JOINED_EFFECT}`), interceptor);
|
|
450
450
|
(0, _univerjs_core.remove)(this._interceptorsByName.get(`${key}-${_univerjs_core.InterceptorEffectEnum.Style}`), interceptor);
|
|
451
451
|
(0, _univerjs_core.remove)(this._interceptorsByName.get(`${key}-${_univerjs_core.InterceptorEffectEnum.Value}`), interceptor);
|
|
452
|
+
this._invalidateComposedInterceptors();
|
|
452
453
|
}));
|
|
453
454
|
} else {
|
|
454
455
|
this._interceptorsByName.set(key, sortedInterceptors);
|
|
455
|
-
return this.disposeWithMe((0, _univerjs_core.toDisposable)(() =>
|
|
456
|
+
return this.disposeWithMe((0, _univerjs_core.toDisposable)(() => {
|
|
457
|
+
(0, _univerjs_core.remove)(this._interceptorsByName.get(key), interceptor);
|
|
458
|
+
this._invalidateComposedInterceptors();
|
|
459
|
+
}));
|
|
456
460
|
}
|
|
457
461
|
}
|
|
458
462
|
fetchThroughInterceptors(name, effect, _key, filter) {
|
|
459
|
-
var _this$_interceptorsBy;
|
|
460
463
|
const byNamesKey = effect === void 0 ? name : `${name}-${effect}`;
|
|
461
464
|
const key = _key !== null && _key !== void 0 ? _key : byNamesKey;
|
|
462
465
|
let composed = this._composedInterceptorByKey.get(key);
|
|
463
|
-
|
|
464
|
-
if (!composed || !this._interceptorsDirty || composedInterceptorsLength !== (((_this$_interceptorsBy = this._interceptorsByName.get(byNamesKey)) === null || _this$_interceptorsBy === void 0 ? void 0 : _this$_interceptorsBy.length) || 0)) {
|
|
466
|
+
if (!composed) {
|
|
465
467
|
let interceptors = this._interceptorsByName.get(byNamesKey);
|
|
466
468
|
if (interceptors && filter) interceptors = interceptors.filter(filter);
|
|
467
469
|
composed = (0, _univerjs_core.composeInterceptors)(interceptors || []);
|
|
468
470
|
this._composedInterceptorByKey.set(key, composed);
|
|
469
|
-
this._composedInterceptorsLengthByKey.set(key, (interceptors === null || interceptors === void 0 ? void 0 : interceptors.length) || 0);
|
|
470
471
|
}
|
|
471
472
|
return composed;
|
|
472
473
|
}
|
|
474
|
+
_invalidateComposedInterceptors() {
|
|
475
|
+
this._composedInterceptorVersion += 1;
|
|
476
|
+
this._composedInterceptorByKey.clear();
|
|
477
|
+
}
|
|
478
|
+
_getCommonCellContentInterceptor(effect, cache) {
|
|
479
|
+
let composed = cache.get(effect);
|
|
480
|
+
if (!composed) {
|
|
481
|
+
composed = this.fetchThroughInterceptors(INTERCEPTOR_POINT.CELL_CONTENT, effect);
|
|
482
|
+
cache.set(effect, composed);
|
|
483
|
+
}
|
|
484
|
+
return composed;
|
|
485
|
+
}
|
|
486
|
+
_getCommonRowFilteredInterceptor(cache) {
|
|
487
|
+
if (!cache.interceptor) cache.interceptor = this.fetchThroughInterceptors(INTERCEPTOR_POINT.ROW_FILTERED);
|
|
488
|
+
return cache.interceptor;
|
|
489
|
+
}
|
|
473
490
|
_interceptWorkbook(workbook) {
|
|
474
491
|
const disposables = new _univerjs_core.DisposableCollection();
|
|
475
492
|
const unitId = workbook.getUnitId();
|
|
@@ -478,10 +495,14 @@ let SheetInterceptorService = class SheetInterceptorService extends _univerjs_co
|
|
|
478
495
|
const subUnitId = worksheet.getSheetId();
|
|
479
496
|
worksheet.__interceptViewModel((viewModel) => {
|
|
480
497
|
const sheetDisposables = new _univerjs_core.DisposableCollection();
|
|
498
|
+
const commonCellContentInterceptors = /* @__PURE__ */ new Map();
|
|
499
|
+
const commonRowFilteredInterceptor = { interceptor: null };
|
|
500
|
+
let commonCellContentInterceptorsVersion = -1;
|
|
501
|
+
let commonRowFilteredInterceptorVersion = -1;
|
|
481
502
|
sheetInterceptorService._worksheetDisposables.set(getWorksheetDisposableID(unitId, worksheet), sheetDisposables);
|
|
482
503
|
sheetDisposables.add(viewModel.registerCellContentInterceptor({ getCell(row, col, effect, key, filter) {
|
|
483
504
|
const rawData = worksheet.getCellRaw(row, col);
|
|
484
|
-
|
|
505
|
+
const context = {
|
|
485
506
|
unitId,
|
|
486
507
|
subUnitId,
|
|
487
508
|
row,
|
|
@@ -489,10 +510,22 @@ let SheetInterceptorService = class SheetInterceptorService extends _univerjs_co
|
|
|
489
510
|
worksheet,
|
|
490
511
|
workbook,
|
|
491
512
|
rawData
|
|
492
|
-
}
|
|
513
|
+
};
|
|
514
|
+
if (key === void 0 && filter === void 0) {
|
|
515
|
+
if (commonCellContentInterceptorsVersion !== sheetInterceptorService._composedInterceptorVersion) {
|
|
516
|
+
commonCellContentInterceptors.clear();
|
|
517
|
+
commonCellContentInterceptorsVersion = sheetInterceptorService._composedInterceptorVersion;
|
|
518
|
+
}
|
|
519
|
+
return sheetInterceptorService._getCommonCellContentInterceptor(effect, commonCellContentInterceptors)(rawData, context);
|
|
520
|
+
}
|
|
521
|
+
return sheetInterceptorService.fetchThroughInterceptors(INTERCEPTOR_POINT.CELL_CONTENT, effect, key, filter)(rawData, context);
|
|
493
522
|
} }));
|
|
494
523
|
sheetDisposables.add(viewModel.registerRowFilteredInterceptor({ getRowFiltered(row) {
|
|
495
|
-
|
|
524
|
+
if (commonRowFilteredInterceptorVersion !== sheetInterceptorService._composedInterceptorVersion) {
|
|
525
|
+
commonRowFilteredInterceptor.interceptor = null;
|
|
526
|
+
commonRowFilteredInterceptorVersion = sheetInterceptorService._composedInterceptorVersion;
|
|
527
|
+
}
|
|
528
|
+
return !!sheetInterceptorService._getCommonRowFilteredInterceptor(commonRowFilteredInterceptor)(false, {
|
|
496
529
|
unitId,
|
|
497
530
|
subUnitId,
|
|
498
531
|
row,
|
|
@@ -5341,7 +5374,7 @@ const SetRangeValuesCommand = {
|
|
|
5341
5374
|
};
|
|
5342
5375
|
|
|
5343
5376
|
//#endregion
|
|
5344
|
-
//#region src/commands/utils/handle-range
|
|
5377
|
+
//#region src/commands/utils/handle-range.mutation.ts
|
|
5345
5378
|
/**
|
|
5346
5379
|
* InsertRange is not a mutation but combination of `SetRangeValuesMutation` and `MoveRangeMutation`.
|
|
5347
5380
|
* @param accessor
|
|
@@ -13061,7 +13094,7 @@ var BorderStyleManagerService = class {
|
|
|
13061
13094
|
};
|
|
13062
13095
|
|
|
13063
13096
|
//#endregion
|
|
13064
|
-
//#region src/commands/commands/set-border
|
|
13097
|
+
//#region src/commands/commands/set-border.command.ts
|
|
13065
13098
|
function forEach(range, action) {
|
|
13066
13099
|
const { startRow, startColumn, endRow, endColumn } = range;
|
|
13067
13100
|
for (let i = startRow; i <= endRow; i++) for (let j = startColumn; j <= endColumn; j++) action(i, j);
|
|
@@ -16730,7 +16763,7 @@ const SplitTextToColumnsCommand = {
|
|
|
16730
16763
|
const INumfmtService = (0, _univerjs_core.createIdentifier)("INumfmtService");
|
|
16731
16764
|
|
|
16732
16765
|
//#endregion
|
|
16733
|
-
//#region src/commands/mutations/numfmt
|
|
16766
|
+
//#region src/commands/mutations/numfmt.mutation.ts
|
|
16734
16767
|
const factorySetNumfmtUndoMutation = (accessor, option) => {
|
|
16735
16768
|
const numfmtService = accessor.get(INumfmtService);
|
|
16736
16769
|
const { values, unitId, subUnitId } = option;
|
|
@@ -18932,7 +18965,7 @@ let RangeProtectionCache = class RangeProtectionCache extends _univerjs_core.Dis
|
|
|
18932
18965
|
});
|
|
18933
18966
|
}
|
|
18934
18967
|
_initUpdateCellInfoCache() {
|
|
18935
|
-
this._permissionService.permissionPointUpdate$.pipe((0, rxjs.filter)((permission) => permission.type === _univerjs_protocol.UnitObject.SelectRange), (0, rxjs.map)((permission) => permission)).subscribe((permission) => {
|
|
18968
|
+
this.disposeWithMe(this._permissionService.permissionPointUpdate$.pipe((0, rxjs.filter)((permission) => permission.type === _univerjs_protocol.UnitObject.SelectRange), (0, rxjs.map)((permission) => permission)).subscribe((permission) => {
|
|
18936
18969
|
const { subUnitId, unitId, permissionId } = permission;
|
|
18937
18970
|
const ruleId = this._permissionIdCache.get(permissionId);
|
|
18938
18971
|
if (!ruleId) return;
|
|
@@ -18943,8 +18976,8 @@ let RangeProtectionCache = class RangeProtectionCache extends _univerjs_core.Dis
|
|
|
18943
18976
|
const { startRow, endRow, startColumn, endColumn } = range;
|
|
18944
18977
|
for (let i = startRow; i <= endRow; i++) for (let j = startColumn; j <= endColumn; j++) cellInfoMap.delete(`${i}-${j}`);
|
|
18945
18978
|
});
|
|
18946
|
-
});
|
|
18947
|
-
this._ruleModel.ruleChange$.subscribe((info) => {
|
|
18979
|
+
}));
|
|
18980
|
+
this.disposeWithMe(this._ruleModel.ruleChange$.subscribe((info) => {
|
|
18948
18981
|
const { unitId, subUnitId } = info;
|
|
18949
18982
|
const cellInfoMap = this._ensureCellInfoMap(unitId, subUnitId);
|
|
18950
18983
|
info.rule.ranges.forEach((range) => {
|
|
@@ -18960,10 +18993,10 @@ let RangeProtectionCache = class RangeProtectionCache extends _univerjs_core.Dis
|
|
|
18960
18993
|
});
|
|
18961
18994
|
});
|
|
18962
18995
|
}
|
|
18963
|
-
});
|
|
18996
|
+
}));
|
|
18964
18997
|
}
|
|
18965
18998
|
_initUpdateCellRuleCache() {
|
|
18966
|
-
this._ruleModel.ruleChange$.subscribe((ruleChange) => {
|
|
18999
|
+
this.disposeWithMe(this._ruleModel.ruleChange$.subscribe((ruleChange) => {
|
|
18967
19000
|
const { type } = ruleChange;
|
|
18968
19001
|
if (type === "add") this._addCellRuleCache(ruleChange);
|
|
18969
19002
|
else if (type === "delete") this._deleteCellRuleCache(ruleChange);
|
|
@@ -18974,7 +19007,7 @@ let RangeProtectionCache = class RangeProtectionCache extends _univerjs_core.Dis
|
|
|
18974
19007
|
});
|
|
18975
19008
|
this._addCellRuleCache(ruleChange);
|
|
18976
19009
|
}
|
|
18977
|
-
});
|
|
19010
|
+
}));
|
|
18978
19011
|
}
|
|
18979
19012
|
_ensureRuleMap(unitId, subUnitId) {
|
|
18980
19013
|
let subUnitMap = this._cellRuleCache.get(unitId);
|
|
@@ -19107,7 +19140,7 @@ let RangeProtectionCache = class RangeProtectionCache extends _univerjs_core.Dis
|
|
|
19107
19140
|
});
|
|
19108
19141
|
}
|
|
19109
19142
|
_initUpdateRowColInfoCache() {
|
|
19110
|
-
this._permissionService.permissionPointUpdate$.pipe((0, rxjs.filter)((permission) => permission.type === _univerjs_protocol.UnitObject.SelectRange), (0, rxjs.map)((permission) => permission)).subscribe({ next: (permission) => {
|
|
19143
|
+
this.disposeWithMe(this._permissionService.permissionPointUpdate$.pipe((0, rxjs.filter)((permission) => permission.type === _univerjs_protocol.UnitObject.SelectRange), (0, rxjs.map)((permission) => permission)).subscribe({ next: (permission) => {
|
|
19111
19144
|
const { subUnitId, unitId, permissionId } = permission;
|
|
19112
19145
|
const ruleId = this._permissionIdCache.get(permissionId);
|
|
19113
19146
|
if (!ruleId) return;
|
|
@@ -19129,8 +19162,8 @@ let RangeProtectionCache = class RangeProtectionCache extends _univerjs_core.Dis
|
|
|
19129
19162
|
}
|
|
19130
19163
|
}
|
|
19131
19164
|
});
|
|
19132
|
-
} });
|
|
19133
|
-
this._ruleModel.ruleChange$.subscribe((info) => {
|
|
19165
|
+
} }));
|
|
19166
|
+
this.disposeWithMe(this._ruleModel.ruleChange$.subscribe((info) => {
|
|
19134
19167
|
if (info.type === "delete") {
|
|
19135
19168
|
const { unitId, subUnitId, rule } = info;
|
|
19136
19169
|
const rowInfoMap = this._ensureRowColInfoMap(unitId, subUnitId, "row");
|
|
@@ -19147,7 +19180,7 @@ let RangeProtectionCache = class RangeProtectionCache extends _univerjs_core.Dis
|
|
|
19147
19180
|
}
|
|
19148
19181
|
});
|
|
19149
19182
|
}
|
|
19150
|
-
});
|
|
19183
|
+
}));
|
|
19151
19184
|
}
|
|
19152
19185
|
getCellInfo(unitId, subUnitId, row, col) {
|
|
19153
19186
|
var _this$_cellRuleCache$;
|
|
@@ -19190,7 +19223,7 @@ RangeProtectionCache = __decorate([
|
|
|
19190
19223
|
//#endregion
|
|
19191
19224
|
//#region package.json
|
|
19192
19225
|
var name = "@univerjs/sheets";
|
|
19193
|
-
var version = "0.
|
|
19226
|
+
var version = "0.23.0-insiders.20260522-ee0b0a4";
|
|
19194
19227
|
|
|
19195
19228
|
//#endregion
|
|
19196
19229
|
//#region src/controllers/active-worksheet.controller.ts
|
|
@@ -19668,8 +19701,8 @@ SheetPermissionViewModelController = __decorate([
|
|
|
19668
19701
|
], SheetPermissionViewModelController);
|
|
19669
19702
|
|
|
19670
19703
|
//#endregion
|
|
19671
|
-
//#region src/services/exclusive-range/exclusive-range
|
|
19672
|
-
const IExclusiveRangeService = (0, _univerjs_core.createIdentifier)("univer.exclusive-range
|
|
19704
|
+
//#region src/services/exclusive-range/exclusive-range.service.ts
|
|
19705
|
+
const IExclusiveRangeService = (0, _univerjs_core.createIdentifier)("univer.exclusive-range.service");
|
|
19673
19706
|
var ExclusiveRangeService = class extends _univerjs_core.Disposable {
|
|
19674
19707
|
constructor(..._args) {
|
|
19675
19708
|
super(..._args);
|
|
@@ -20530,7 +20563,7 @@ RangeProtectionService = __decorate([
|
|
|
20530
20563
|
], RangeProtectionService);
|
|
20531
20564
|
|
|
20532
20565
|
//#endregion
|
|
20533
|
-
//#region src/services/range-theme
|
|
20566
|
+
//#region src/services/range-theme.service.ts
|
|
20534
20567
|
let SheetRangeThemeService = class SheetRangeThemeService extends _univerjs_core.Disposable {
|
|
20535
20568
|
constructor(_sheetRangeThemeModel) {
|
|
20536
20569
|
super();
|
package/lib/es/facade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BooleanNumber, CanceledError, DEFAULT_STYLES, Dimension, Direction, HorizontalAlign, IAuthzIoService, ICommandService, ILogService, IPermissionService, IResourceLoaderService, IUniverInstanceService, Inject, Injector, LocaleService, ObjectMatrix, RANGE_TYPE, Rectangle, RedoCommand, RichTextValue, TextStyleValue, Tools, UndoCommand, UniverInstanceType, VerticalAlign, WrapStrategy, cellToRange, covertCellValue, covertCellValues, generateIntervalsByPoints, generateRandomId, isNullCell, mergeWorksheetSnapshotWithDefault, toDisposable } from "@univerjs/core";
|
|
2
2
|
import { FBase, FBaseInitialable, FEnum, FEventName, FUniver } from "@univerjs/core/facade";
|
|
3
|
-
import { AddRangeProtectionMutation, AddWorksheetProtectionMutation, AppendRowCommand, AutoFillCommand, COMMAND_LISTENER_VALUE_CHANGE, CancelFrozenCommand, ClearSelectionAllCommand, ClearSelectionContentCommand, ClearSelectionFormatCommand, CopySheetCommand, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, DeleteRangeProtectionMutation, DeleteWorksheetProtectionMutation, DeleteWorksheetRangeThemeStyleCommand, EditStateEnum, InsertColByRangeCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, InsertRowByRangeCommand, InsertSheetCommand, MoveColsCommand, MoveRowsCommand, RangeProtectionPermissionDeleteProtectionPoint, RangeProtectionPermissionEditPoint, RangeProtectionPermissionManageCollaPoint, RangeProtectionPermissionViewPoint, RangeProtectionRuleModel, RangeThemeStyle, RegisterWorksheetRangeThemeStyleCommand, RemoveColByRangeCommand, RemoveDefinedNameCommand, RemoveRowByRangeCommand, RemoveSheetCommand, RemoveWorksheetMergeCommand, SCOPE_WORKBOOK_VALUE_DEFINED_NAME, SetBorderBasicCommand, SetColDataCommand, SetColHiddenCommand, SetColWidthCommand, SetDefinedNameCommand, SetFrozenCommand, SetGridlinesColorCommand, SetHorizontalTextAlignCommand, SetRangeCustomMetadataCommand, SetRangeProtectionMutation, SetRangeValuesCommand,
|
|
3
|
+
import { AddRangeProtectionMutation, AddWorksheetProtectionMutation, AppendRowCommand, AutoFillCommand, COMMAND_LISTENER_VALUE_CHANGE, CancelFrozenCommand, ClearSelectionAllCommand, ClearSelectionContentCommand, ClearSelectionFormatCommand, CopySheetCommand, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, DeleteRangeProtectionMutation, DeleteWorksheetProtectionMutation, DeleteWorksheetRangeThemeStyleCommand, EditStateEnum, InsertColByRangeCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, InsertRowByRangeCommand, InsertSheetCommand, MoveColsCommand, MoveRowsCommand, RangeProtectionPermissionDeleteProtectionPoint, RangeProtectionPermissionEditPoint, RangeProtectionPermissionManageCollaPoint, RangeProtectionPermissionViewPoint, RangeProtectionRuleModel, RangeThemeStyle, RegisterWorksheetRangeThemeStyleCommand, RemoveColByRangeCommand, RemoveDefinedNameCommand, RemoveRowByRangeCommand, RemoveSheetCommand, RemoveWorksheetMergeCommand, SCOPE_WORKBOOK_VALUE_DEFINED_NAME, SetBorderBasicCommand, SetColDataCommand, SetColHiddenCommand, SetColWidthCommand, SetDefinedNameCommand, SetFrozenCommand, SetGridlinesColorCommand, SetHorizontalTextAlignCommand, SetRangeCustomMetadataCommand, SetRangeProtectionMutation, SetRangeValuesCommand, SetRowDataCommand, SetRowHeightCommand, SetRowHiddenCommand, SetSelectionsOperation, SetSpecificColsVisibleCommand, SetSpecificRowsVisibleCommand, SetStyleCommand, SetTabColorCommand, SetTabColorMutation, SetTextRotationCommand, SetTextWrapCommand, SetVerticalTextAlignCommand, SetWorkbookNameCommand, SetWorksheetActiveOperation, SetWorksheetColumnCountCommand, SetWorksheetDefaultStyleMutation, SetWorksheetHideCommand, SetWorksheetHideMutation, SetWorksheetNameCommand, SetWorksheetOrderCommand, SetWorksheetOrderMutation, SetWorksheetRangeThemeStyleCommand, SetWorksheetRowCountCommand, SetWorksheetRowIsAutoHeightCommand, SetWorksheetRowIsAutoHeightMutation, SetWorksheetShowCommand, SheetRangeThemeService, SheetSkeletonChangeType, SheetValueChangeType, SheetsFreezeSyncController, SheetsSelectionsService, SplitDelimiterEnum, SplitTextToColumnsCommand, ToggleGridlinesCommand, UnitObject, UnregisterWorksheetRangeThemeStyleCommand, ViewStateEnum, WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCopySheetPermission, WorkbookCreateProtectPermission, WorkbookCreateSheetPermission, WorkbookDeleteColumnPermission, WorkbookDeleteRowPermission, WorkbookDeleteSheetPermission, WorkbookDuplicatePermission, WorkbookEditablePermission, WorkbookExportPermission, WorkbookHideSheetPermission, WorkbookInsertColumnPermission, WorkbookInsertRowPermission, WorkbookManageCollaboratorPermission, WorkbookMoveSheetPermission, WorkbookPrintPermission, WorkbookRecoverHistoryPermission, WorkbookRenameSheetPermission, WorkbookSharePermission, WorkbookViewHistoryPermission, WorkbookViewPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteProtectionPermission, WorksheetDeleteRowPermission, WorksheetEditExtraObjectPermission, WorksheetEditPermission, WorksheetFilterPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetPivotTablePermission, WorksheetProtectionPointModel, WorksheetProtectionRuleModel, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetSortPermission, WorksheetViewPermission, addMergeCellsUtil, copyRangeStyles, getAddMergeMutationRangeByType, getAllWorksheetPermissionPoint, getAllWorksheetPermissionPointByPointPanel, getNextPrimaryCell, getPrimaryForRange, getValueChangedEffectedRange, validateDefinedName } from "@univerjs/sheets";
|
|
4
4
|
import { FormulaDataModel, IDefinedNamesService, IFunctionService, ISuperTableService, deserializeRangeWithSheet, serializeRange, serializeRangeWithSheet } from "@univerjs/engine-formula";
|
|
5
5
|
import { ObjectScope, UnitAction, UnitObject as UnitObject$1, UnitRole } from "@univerjs/protocol";
|
|
6
6
|
|
|
@@ -3333,7 +3333,6 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
3333
3333
|
* Sets the frozen state of the current sheet.
|
|
3334
3334
|
* @param {IFreeze} freeze - the scrolling viewport start range and count of freezed rows and columns.
|
|
3335
3335
|
* that means if you want to freeze the first 3 rows and 2 columns, you should set freeze as { startRow: 3, startColumn: 2, xSplit: 2, ySplit: 3 }
|
|
3336
|
-
* @deprecated use `setFrozenRows` and `setFrozenColumns` instead.
|
|
3337
3336
|
* @returns {FWorksheet} This worksheet instance for chaining
|
|
3338
3337
|
* @example
|
|
3339
3338
|
* ```typescript
|
|
@@ -3348,7 +3347,6 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
3348
3347
|
* ```
|
|
3349
3348
|
*/
|
|
3350
3349
|
setFreeze(freeze) {
|
|
3351
|
-
this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead");
|
|
3352
3350
|
this._commandService.syncExecuteCommand(SetFrozenCommand.id, {
|
|
3353
3351
|
...freeze,
|
|
3354
3352
|
unitId: this._workbook.getUnitId(),
|
|
@@ -3604,28 +3602,6 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
3604
3602
|
return this._worksheet.getTabColor();
|
|
3605
3603
|
}
|
|
3606
3604
|
/**
|
|
3607
|
-
* @deprecated use `univerAPI.addEvent(univerAPI.Event.SheetValueChanged, (params) => {})` instead
|
|
3608
|
-
*/
|
|
3609
|
-
onCellDataChange(callback) {
|
|
3610
|
-
return this._injector.get(ICommandService).onCommandExecuted((command) => {
|
|
3611
|
-
if (command.id === SetRangeValuesMutation.id) {
|
|
3612
|
-
const params = command.params;
|
|
3613
|
-
if (params.unitId === this._workbook.getUnitId() && params.subUnitId === this._worksheet.getSheetId() && params.cellValue) callback(new ObjectMatrix(params.cellValue));
|
|
3614
|
-
}
|
|
3615
|
-
});
|
|
3616
|
-
}
|
|
3617
|
-
/**
|
|
3618
|
-
* @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeSheetEditEnd, (params) => {})` instead
|
|
3619
|
-
*/
|
|
3620
|
-
onBeforeCellDataChange(callback) {
|
|
3621
|
-
return this._injector.get(ICommandService).beforeCommandExecuted((command) => {
|
|
3622
|
-
if (command.id === SetRangeValuesMutation.id) {
|
|
3623
|
-
const params = command.params;
|
|
3624
|
-
if (params.unitId === this._workbook.getUnitId() && params.subUnitId === this._worksheet.getSheetId() && params.cellValue) callback(new ObjectMatrix(params.cellValue));
|
|
3625
|
-
}
|
|
3626
|
-
});
|
|
3627
|
-
}
|
|
3628
|
-
/**
|
|
3629
3605
|
* Hides this sheet. Has no effect if the sheet is already hidden. If this method is called on the only visible sheet, it throws an exception.
|
|
3630
3606
|
* @returns {FWorksheet} Returns the current worksheet instance for method chaining
|
|
3631
3607
|
* @example
|
|
@@ -3821,7 +3797,7 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
3821
3797
|
}
|
|
3822
3798
|
/**
|
|
3823
3799
|
* Returns a Range corresponding to the dimensions in which data is present.
|
|
3824
|
-
*
|
|
3800
|
+
* Empty cells with style or formatting will also be included in the data range. If there is no data on the sheet, returns a Range corresponding to the top-left cell of the sheet (A1).
|
|
3825
3801
|
* @returns {FRange} The range of the data in the sheet.
|
|
3826
3802
|
* @example
|
|
3827
3803
|
* ```ts
|
|
@@ -3838,14 +3814,6 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
3838
3814
|
return this.getRange(startRow, startColumn, endRow - startRow + 1, endColumn - startColumn + 1);
|
|
3839
3815
|
}
|
|
3840
3816
|
/**
|
|
3841
|
-
* @deprecated use `getLastColumn` instead.
|
|
3842
|
-
* Returns the column index of the last column that contains content.
|
|
3843
|
-
* @returns {number} the column index of the last column that contains content.
|
|
3844
|
-
*/
|
|
3845
|
-
getLastColumns() {
|
|
3846
|
-
return this._worksheet.getLastColumnWithContent();
|
|
3847
|
-
}
|
|
3848
|
-
/**
|
|
3849
3817
|
* Returns the column index of the last column that contains content.
|
|
3850
3818
|
* @returns {number} the column index of the last column that contains content.
|
|
3851
3819
|
* @example
|
|
@@ -3862,14 +3830,6 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
3862
3830
|
return this._worksheet.getLastColumnWithContent();
|
|
3863
3831
|
}
|
|
3864
3832
|
/**
|
|
3865
|
-
* @deprecated use `getLastRow` instead.
|
|
3866
|
-
* Returns the row index of the last row that contains content.
|
|
3867
|
-
* @returns {number} the row index of the last row that contains content.
|
|
3868
|
-
*/
|
|
3869
|
-
getLastRows() {
|
|
3870
|
-
return this._worksheet.getLastRowWithContent();
|
|
3871
|
-
}
|
|
3872
|
-
/**
|
|
3873
3833
|
* Returns the row index of the last row that contains content.
|
|
3874
3834
|
* @returns {number} the row index of the last row that contains content.
|
|
3875
3835
|
* @example
|