@univerjs/sheets-table 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/index.js +39 -52
- package/lib/es/index.js +41 -54
- package/lib/index.js +41 -54
- package/lib/types/controllers/table-theme.factory.d.ts +4 -4
- package/lib/umd/index.js +1 -1
- package/package.json +7 -7
package/lib/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BorderStyleTypes, CellValueType, CommandType, Disposable, ICommandService, IConfigService, ILogService, IResourceManagerService, IUndoRedoService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, LocaleService, Plugin, RTree, Rectangle, UniverInstanceType, customNameCharacterCheck, generateRandomId, merge, regexp, registerDependencies, sequenceExecute, touchDependencies } from "@univerjs/core";
|
|
1
|
+
import { BorderStyleTypes, CellValueType, CommandType, DependentOn, Disposable, ICommandService, IConfigService, ILogService, IResourceManagerService, IUndoRedoService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, LocaleService, Plugin, RTree, Rectangle, UniverInstanceType, customNameCharacterCheck, generateRandomId, merge, regexp, registerDependencies, sequenceExecute, touchDependencies } from "@univerjs/core";
|
|
2
2
|
import { IDefinedNamesService, RemoveSuperTableMutation, SetSuperTableMutation } from "@univerjs/engine-formula";
|
|
3
|
-
import { AddRangeThemeMutation, CopySheetCommand, IExclusiveRangeService, INTERCEPTOR_POINT, InsertColCommand, InsertColMutation, InsertRowCommand, InsertRowMutation, RangeThemeStyle, RefRangeService, RemoveColCommand, RemoveColMutation, RemoveRangeThemeMutation, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, SheetInterceptorService, SheetRangeThemeModel, SheetRangeThemeService, SheetsSelectionsService, ZebraCrossingCacheController, getMoveRangeUndoRedoMutations, getSheetCommandTarget } from "@univerjs/sheets";
|
|
3
|
+
import { AddRangeThemeMutation, CopySheetCommand, IExclusiveRangeService, INTERCEPTOR_POINT, InsertColCommand, InsertColMutation, InsertRowCommand, InsertRowMutation, RangeThemeStyle, RefRangeService, RemoveColCommand, RemoveColMutation, RemoveRangeThemeMutation, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, SheetInterceptorService, SheetRangeThemeModel, SheetRangeThemeService, SheetsSelectionsService, UniverSheetsPlugin, ZebraCrossingCacheController, getMoveRangeUndoRedoMutations, getSheetCommandTarget } from "@univerjs/sheets";
|
|
4
4
|
import { BehaviorSubject, Subject, filter, switchMap } from "rxjs";
|
|
5
5
|
|
|
6
6
|
//#region src/types/enum.ts
|
|
@@ -306,7 +306,7 @@ const tableThemeConfig = tableDefaultThemeStyleArr.map((item, index) => {
|
|
|
306
306
|
});
|
|
307
307
|
|
|
308
308
|
//#endregion
|
|
309
|
-
//#region \0@oxc-project+runtime@0.
|
|
309
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
|
|
310
310
|
function _typeof(o) {
|
|
311
311
|
"@babel/helpers - typeof";
|
|
312
312
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -317,7 +317,7 @@ function _typeof(o) {
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
//#endregion
|
|
320
|
-
//#region \0@oxc-project+runtime@0.
|
|
320
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
|
|
321
321
|
function toPrimitive(t, r) {
|
|
322
322
|
if ("object" != _typeof(t) || !t) return t;
|
|
323
323
|
var e = t[Symbol.toPrimitive];
|
|
@@ -330,14 +330,14 @@ function toPrimitive(t, r) {
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
//#endregion
|
|
333
|
-
//#region \0@oxc-project+runtime@0.
|
|
333
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
|
|
334
334
|
function toPropertyKey(t) {
|
|
335
335
|
var i = toPrimitive(t, "string");
|
|
336
336
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
//#endregion
|
|
340
|
-
//#region \0@oxc-project+runtime@0.
|
|
340
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
|
|
341
341
|
function _defineProperty(e, r, t) {
|
|
342
342
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
343
343
|
value: t,
|
|
@@ -1292,8 +1292,7 @@ var TableFilters = class {
|
|
|
1292
1292
|
return getTableFilterState(this._tableColumnFilterList[columnIndex], sortState);
|
|
1293
1293
|
}
|
|
1294
1294
|
getSortState() {
|
|
1295
|
-
|
|
1296
|
-
return (_this$_tableSortInfo2 = this._tableSortInfo) !== null && _this$_tableSortInfo2 !== void 0 ? _this$_tableSortInfo2 : {};
|
|
1295
|
+
return this._tableSortInfo ?? {};
|
|
1297
1296
|
}
|
|
1298
1297
|
getFilterStates(range) {
|
|
1299
1298
|
const states = [];
|
|
@@ -1363,8 +1362,7 @@ var TableFilters = class {
|
|
|
1363
1362
|
};
|
|
1364
1363
|
}
|
|
1365
1364
|
fromJSON(json) {
|
|
1366
|
-
|
|
1367
|
-
this._tableColumnFilterList = (_json$tableColumnFilt = json.tableColumnFilterList) !== null && _json$tableColumnFilt !== void 0 ? _json$tableColumnFilt : [];
|
|
1365
|
+
this._tableColumnFilterList = json.tableColumnFilterList ?? [];
|
|
1368
1366
|
if (json.tableSortInfo) this._tableSortInfo = json.tableSortInfo;
|
|
1369
1367
|
}
|
|
1370
1368
|
dispose() {
|
|
@@ -1394,9 +1392,8 @@ var Table = class {
|
|
|
1394
1392
|
this._init(header, options);
|
|
1395
1393
|
}
|
|
1396
1394
|
_init(header, options) {
|
|
1397
|
-
var _options$showHeader;
|
|
1398
1395
|
this._tableStyleId = options === null || options === void 0 ? void 0 : options.tableStyleId;
|
|
1399
|
-
this._showHeader = (
|
|
1396
|
+
this._showHeader = (options === null || options === void 0 ? void 0 : options.showHeader) ?? true;
|
|
1400
1397
|
this._showFooter = false;
|
|
1401
1398
|
const range = this.getRange();
|
|
1402
1399
|
const startColumn = range.startColumn;
|
|
@@ -1508,22 +1505,19 @@ var Table = class {
|
|
|
1508
1505
|
this._subUnitId = subUnitId;
|
|
1509
1506
|
}
|
|
1510
1507
|
getTableStyleId() {
|
|
1511
|
-
|
|
1512
|
-
return (_this$_tableStyleId = this._tableStyleId) !== null && _this$_tableStyleId !== void 0 ? _this$_tableStyleId : tableThemeConfig[0].name;
|
|
1508
|
+
return this._tableStyleId ?? tableThemeConfig[0].name;
|
|
1513
1509
|
}
|
|
1514
1510
|
setTableStyleId(tableStyleId) {
|
|
1515
1511
|
this._tableStyleId = tableStyleId;
|
|
1516
1512
|
}
|
|
1517
1513
|
isShowHeader() {
|
|
1518
|
-
|
|
1519
|
-
return (_this$_showHeader = this._showHeader) !== null && _this$_showHeader !== void 0 ? _this$_showHeader : true;
|
|
1514
|
+
return this._showHeader ?? true;
|
|
1520
1515
|
}
|
|
1521
1516
|
setShowHeader(showHeader) {
|
|
1522
1517
|
this._showHeader = showHeader;
|
|
1523
1518
|
}
|
|
1524
1519
|
isShowFooter() {
|
|
1525
|
-
|
|
1526
|
-
return (_this$_showFooter = this._showFooter) !== null && _this$_showFooter !== void 0 ? _this$_showFooter : false;
|
|
1520
|
+
return this._showFooter ?? false;
|
|
1527
1521
|
}
|
|
1528
1522
|
getTableInfo() {
|
|
1529
1523
|
return {
|
|
@@ -1570,14 +1564,13 @@ var Table = class {
|
|
|
1570
1564
|
};
|
|
1571
1565
|
}
|
|
1572
1566
|
fromJSON(json) {
|
|
1573
|
-
var _json$options$showHea, _json$options$showFoo;
|
|
1574
1567
|
this._id = json.id;
|
|
1575
1568
|
this._name = json.name;
|
|
1576
1569
|
this._range = json.range;
|
|
1577
1570
|
this.tableMeta = json.meta;
|
|
1578
1571
|
this._tableStyleId = json.options.tableStyleId || "";
|
|
1579
|
-
this._showHeader =
|
|
1580
|
-
this._showFooter =
|
|
1572
|
+
this._showHeader = json.options.showHeader ?? true;
|
|
1573
|
+
this._showFooter = json.options.showFooter ?? true;
|
|
1581
1574
|
json.columns.forEach((column) => {
|
|
1582
1575
|
const tableColumn = new TableColumn(column.id, column.displayName);
|
|
1583
1576
|
tableColumn.fromJSON(column);
|
|
@@ -1600,7 +1593,7 @@ var Table = class {
|
|
|
1600
1593
|
};
|
|
1601
1594
|
|
|
1602
1595
|
//#endregion
|
|
1603
|
-
//#region \0@oxc-project+runtime@0.
|
|
1596
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
|
|
1604
1597
|
function __decorateParam(paramIndex, decorator) {
|
|
1605
1598
|
return function(target, key) {
|
|
1606
1599
|
decorator(target, key, paramIndex);
|
|
@@ -1608,7 +1601,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
1608
1601
|
}
|
|
1609
1602
|
|
|
1610
1603
|
//#endregion
|
|
1611
|
-
//#region \0@oxc-project+runtime@0.
|
|
1604
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
|
|
1612
1605
|
function __decorate(decorators, target, key, desc) {
|
|
1613
1606
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1614
1607
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1649,7 +1642,7 @@ let TableManager = class TableManager extends Disposable {
|
|
|
1649
1642
|
const worksheet = (_this$_univerInstance = this._univerInstanceService.getUnit(unitId)) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getSheetBySheetId(subUnitId);
|
|
1650
1643
|
const { startRow, startColumn, endColumn } = range;
|
|
1651
1644
|
const header = [];
|
|
1652
|
-
const columnText = prefixText
|
|
1645
|
+
const columnText = prefixText ?? "Column";
|
|
1653
1646
|
for (let i = startColumn; i <= endColumn; i++) header.push(convertCellDataToString(worksheet === null || worksheet === void 0 ? void 0 : worksheet.getCell(startRow, i)) || getColumnName(i - startColumn + 1, columnText));
|
|
1654
1647
|
return header;
|
|
1655
1648
|
}
|
|
@@ -1665,7 +1658,7 @@ let TableManager = class TableManager extends Disposable {
|
|
|
1665
1658
|
* @returns {string} The table id.
|
|
1666
1659
|
*/
|
|
1667
1660
|
addTable(unitId, subUnitId, name, range, header, initId, options) {
|
|
1668
|
-
const id = initId
|
|
1661
|
+
const id = initId ?? generateRandomId();
|
|
1669
1662
|
const table = new Table(id, name, range, header || this.getColumnHeader(unitId, subUnitId, range), options);
|
|
1670
1663
|
table.setSubunitId(subUnitId);
|
|
1671
1664
|
this._ensureUnit(unitId).set(id, table);
|
|
@@ -1894,8 +1887,7 @@ let TableManager = class TableManager extends Disposable {
|
|
|
1894
1887
|
if (rowColOperation) this.operationTableRowCol(unitId, tableId, rowColOperation);
|
|
1895
1888
|
if (updateRange) this.updateTableRange(unitId, tableId, updateRange);
|
|
1896
1889
|
if (theme) {
|
|
1897
|
-
|
|
1898
|
-
const oldTheme = (_table$getTableStyleI = table.getTableStyleId()) !== null && _table$getTableStyleI !== void 0 ? _table$getTableStyleI : "default";
|
|
1890
|
+
const oldTheme = table.getTableStyleId() ?? "default";
|
|
1899
1891
|
table.setTableStyleId(theme);
|
|
1900
1892
|
this._tableThemeChanged$.next({
|
|
1901
1893
|
unitId,
|
|
@@ -1944,6 +1936,7 @@ let TableManager = class TableManager extends Disposable {
|
|
|
1944
1936
|
else if (Array.isArray(data[subUnitId])) tables = data[subUnitId];
|
|
1945
1937
|
if (!tables) return;
|
|
1946
1938
|
tables.forEach((table) => {
|
|
1939
|
+
var _table$options;
|
|
1947
1940
|
const header = this.getColumnHeader(unitId, subUnitId, table.range);
|
|
1948
1941
|
const tableInstance = new Table(table.id, table.name, table.range, header, table.options);
|
|
1949
1942
|
tableInstance.setTableMeta(table.meta);
|
|
@@ -1960,7 +1953,8 @@ let TableManager = class TableManager extends Disposable {
|
|
|
1960
1953
|
subUnitId,
|
|
1961
1954
|
range: table.range,
|
|
1962
1955
|
tableName: table.name,
|
|
1963
|
-
tableId: table.id
|
|
1956
|
+
tableId: table.id,
|
|
1957
|
+
tableStyleId: (_table$options = table.options) === null || _table$options === void 0 ? void 0 : _table$options.tableStyleId
|
|
1964
1958
|
});
|
|
1965
1959
|
});
|
|
1966
1960
|
});
|
|
@@ -2068,13 +2062,12 @@ const AddSheetTableCommand = {
|
|
|
2068
2062
|
id: "sheet.command.add-table",
|
|
2069
2063
|
type: CommandType.COMMAND,
|
|
2070
2064
|
handler: (accessor, params) => {
|
|
2071
|
-
var _params$id;
|
|
2072
2065
|
if (!params) return false;
|
|
2073
2066
|
const undoRedoService = accessor.get(IUndoRedoService);
|
|
2074
2067
|
const commandService = accessor.get(ICommandService);
|
|
2075
2068
|
const localeService = accessor.get(LocaleService);
|
|
2076
2069
|
const tableManager = accessor.get(TableManager);
|
|
2077
|
-
const tableId =
|
|
2070
|
+
const tableId = params.id ?? generateRandomId();
|
|
2078
2071
|
const existingNamesSet = getExistingNamesSet(params.unitId, {
|
|
2079
2072
|
univerInstanceService: accessor.get(IUniverInstanceService),
|
|
2080
2073
|
tableManager,
|
|
@@ -2201,7 +2194,6 @@ const DeleteSheetTableCommand = {
|
|
|
2201
2194
|
id: "sheet.command.delete-table",
|
|
2202
2195
|
type: CommandType.COMMAND,
|
|
2203
2196
|
handler: (accessor, params) => {
|
|
2204
|
-
var _interceptorCommands$, _interceptorCommands$2;
|
|
2205
2197
|
if (!params) return false;
|
|
2206
2198
|
const undoRedoService = accessor.get(IUndoRedoService);
|
|
2207
2199
|
const commandService = accessor.get(ICommandService);
|
|
@@ -2222,13 +2214,13 @@ const DeleteSheetTableCommand = {
|
|
|
2222
2214
|
tableName: tableConfig.name
|
|
2223
2215
|
}
|
|
2224
2216
|
});
|
|
2225
|
-
redos.push(...
|
|
2217
|
+
redos.push(...interceptorCommands.preRedos ?? []);
|
|
2226
2218
|
redos.push({
|
|
2227
2219
|
id: DeleteSheetTableMutation.id,
|
|
2228
2220
|
params: { ...params }
|
|
2229
2221
|
});
|
|
2230
2222
|
redos.push(...interceptorCommands.redos);
|
|
2231
|
-
undos.push(...
|
|
2223
|
+
undos.push(...interceptorCommands.preUndos ?? []);
|
|
2232
2224
|
undos.push({
|
|
2233
2225
|
id: AddSheetTableMutation.id,
|
|
2234
2226
|
params: {
|
|
@@ -2357,7 +2349,6 @@ const SetSheetTableCommand = {
|
|
|
2357
2349
|
id: "sheet.command.set-table-config",
|
|
2358
2350
|
type: CommandType.COMMAND,
|
|
2359
2351
|
handler: (accessor, params) => {
|
|
2360
|
-
var _interceptorCommands$, _interceptorCommands$2;
|
|
2361
2352
|
if (!params) return false;
|
|
2362
2353
|
const { unitId, tableId, name, updateRange, rowColOperation, theme } = params;
|
|
2363
2354
|
const tableManager = accessor.get(TableManager);
|
|
@@ -2416,7 +2407,7 @@ const SetSheetTableCommand = {
|
|
|
2416
2407
|
}
|
|
2417
2408
|
});
|
|
2418
2409
|
const redos = [
|
|
2419
|
-
...
|
|
2410
|
+
...interceptorCommands.preRedos ?? [],
|
|
2420
2411
|
{
|
|
2421
2412
|
id: SetSheetTableMutation.id,
|
|
2422
2413
|
params: redoParams
|
|
@@ -2424,7 +2415,7 @@ const SetSheetTableCommand = {
|
|
|
2424
2415
|
...interceptorCommands.redos
|
|
2425
2416
|
];
|
|
2426
2417
|
const undos = [
|
|
2427
|
-
...
|
|
2418
|
+
...interceptorCommands.preUndos ?? [],
|
|
2428
2419
|
{
|
|
2429
2420
|
id: SetSheetTableMutation.id,
|
|
2430
2421
|
params: undoParams
|
|
@@ -3139,7 +3130,6 @@ const SheetTableRemoveColumnAtCommand = {
|
|
|
3139
3130
|
id: "sheet.command.table-remove-column-at",
|
|
3140
3131
|
type: CommandType.COMMAND,
|
|
3141
3132
|
handler: (accessor, params) => {
|
|
3142
|
-
var _interceptorCommands$, _interceptorCommands$2;
|
|
3143
3133
|
if (!params) return false;
|
|
3144
3134
|
const { unitId, subUnitId, tableId, index, count = 1 } = params;
|
|
3145
3135
|
if (count <= 0) return false;
|
|
@@ -3168,7 +3158,7 @@ const SheetTableRemoveColumnAtCommand = {
|
|
|
3168
3158
|
}
|
|
3169
3159
|
});
|
|
3170
3160
|
const redos = [
|
|
3171
|
-
...
|
|
3161
|
+
...interceptorCommands.preRedos ?? [],
|
|
3172
3162
|
{
|
|
3173
3163
|
id: SetSheetTableMutation.id,
|
|
3174
3164
|
params: {
|
|
@@ -3186,7 +3176,7 @@ const SheetTableRemoveColumnAtCommand = {
|
|
|
3186
3176
|
...interceptorCommands.redos
|
|
3187
3177
|
];
|
|
3188
3178
|
const undos = [
|
|
3189
|
-
...
|
|
3179
|
+
...interceptorCommands.preUndos ?? [],
|
|
3190
3180
|
{
|
|
3191
3181
|
id: SetSheetTableMutation.id,
|
|
3192
3182
|
params: {
|
|
@@ -3310,7 +3300,6 @@ const SheetTableRemoveColCommand = {
|
|
|
3310
3300
|
id: "sheet.command.table-remove-col",
|
|
3311
3301
|
type: CommandType.COMMAND,
|
|
3312
3302
|
handler: (accessor, params) => {
|
|
3313
|
-
var _interceptorCommands$3, _interceptorCommands$4;
|
|
3314
3303
|
if (!params) return false;
|
|
3315
3304
|
const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
|
|
3316
3305
|
if (!target) return false;
|
|
@@ -3354,9 +3343,9 @@ const SheetTableRemoveColCommand = {
|
|
|
3354
3343
|
removedColumnNames: columns.map((column) => column.displayName)
|
|
3355
3344
|
}
|
|
3356
3345
|
});
|
|
3357
|
-
redos.unshift(...
|
|
3346
|
+
redos.unshift(...interceptorCommands.preRedos ?? []);
|
|
3358
3347
|
redos.push(...interceptorCommands.redos);
|
|
3359
|
-
undos.unshift(...
|
|
3348
|
+
undos.unshift(...interceptorCommands.preUndos ?? []);
|
|
3360
3349
|
undos.push({
|
|
3361
3350
|
id: SetSheetTableMutation.id,
|
|
3362
3351
|
params: {
|
|
@@ -3508,7 +3497,7 @@ SheetsTableThemeController = __decorate([
|
|
|
3508
3497
|
//#endregion
|
|
3509
3498
|
//#region package.json
|
|
3510
3499
|
var name = "@univerjs/sheets-table";
|
|
3511
|
-
var version = "1.0.0-
|
|
3500
|
+
var version = "1.0.0-beta.0";
|
|
3512
3501
|
|
|
3513
3502
|
//#endregion
|
|
3514
3503
|
//#region src/controllers/sheet-table-formula.controller.ts
|
|
@@ -3541,14 +3530,14 @@ let SheetTableFormulaController = class SheetTableFormulaController extends Disp
|
|
|
3541
3530
|
sheetId: subUnitId,
|
|
3542
3531
|
range
|
|
3543
3532
|
}
|
|
3544
|
-
});
|
|
3533
|
+
}, { onlyLocal: true });
|
|
3545
3534
|
}));
|
|
3546
3535
|
this.disposeWithMe(this._tableManager.tableNameChanged$.subscribe((event) => {
|
|
3547
3536
|
const { tableId, unitId, oldTableName } = event;
|
|
3548
3537
|
this._commandService.executeCommand(RemoveSuperTableMutation.id, {
|
|
3549
3538
|
unitId,
|
|
3550
3539
|
tableName: oldTableName
|
|
3551
|
-
});
|
|
3540
|
+
}, { onlyLocal: true });
|
|
3552
3541
|
const table = this._tableManager.getTableById(unitId, tableId);
|
|
3553
3542
|
if (!table) return;
|
|
3554
3543
|
this._updateSuperTable(unitId, table, oldTableName);
|
|
@@ -3571,7 +3560,7 @@ let SheetTableFormulaController = class SheetTableFormulaController extends Disp
|
|
|
3571
3560
|
sheetId: tableInfo.subUnitId,
|
|
3572
3561
|
titleMap
|
|
3573
3562
|
}
|
|
3574
|
-
});
|
|
3563
|
+
}, { onlyLocal: true });
|
|
3575
3564
|
}
|
|
3576
3565
|
};
|
|
3577
3566
|
SheetTableFormulaController = __decorate([__decorateParam(0, Inject(TableManager)), __decorateParam(1, ICommandService)], SheetTableFormulaController);
|
|
@@ -3888,7 +3877,6 @@ let SheetTableRefRangeController = class SheetTableRefRangeController extends Di
|
|
|
3888
3877
|
const tableRange = table.getRange();
|
|
3889
3878
|
if (Rectangle.intersects(tableRange, range)) {
|
|
3890
3879
|
if (range.startColumn <= tableRange.startColumn && range.endColumn >= tableRange.endColumn) {
|
|
3891
|
-
var _formulaMutations$pre, _formulaMutations$pre2;
|
|
3892
3880
|
const tableInfo = table.getTableInfo();
|
|
3893
3881
|
const formulaMutations = this._sheetInterceptorService.onCommandExecute({
|
|
3894
3882
|
id: DELETE_SHEET_TABLE_COMMAND_ID,
|
|
@@ -3899,7 +3887,7 @@ let SheetTableRefRangeController = class SheetTableRefRangeController extends Di
|
|
|
3899
3887
|
tableName: tableInfo.name
|
|
3900
3888
|
}
|
|
3901
3889
|
});
|
|
3902
|
-
preRedos.push(...
|
|
3890
|
+
preRedos.push(...formulaMutations.preRedos ?? [], ...formulaMutations.redos);
|
|
3903
3891
|
preRedos.push({
|
|
3904
3892
|
id: DeleteSheetTableMutation.id,
|
|
3905
3893
|
params: {
|
|
@@ -3932,7 +3920,7 @@ let SheetTableRefRangeController = class SheetTableRefRangeController extends Di
|
|
|
3932
3920
|
options: tableJson.options
|
|
3933
3921
|
}
|
|
3934
3922
|
});
|
|
3935
|
-
undos.push(...
|
|
3923
|
+
undos.push(...formulaMutations.preUndos ?? [], ...formulaMutations.undos);
|
|
3936
3924
|
} else if (range.startColumn <= tableRange.startColumn && range.endColumn >= tableRange.startColumn) {
|
|
3937
3925
|
const tableJson = table.toJSON();
|
|
3938
3926
|
const removeColumnCount = range.endColumn - tableRange.startColumn + 1;
|
|
@@ -4070,7 +4058,6 @@ let SheetTableRefRangeController = class SheetTableRefRangeController extends Di
|
|
|
4070
4058
|
};
|
|
4071
4059
|
}
|
|
4072
4060
|
_appendTableColumnFormulaMutations(redos, undos, info) {
|
|
4073
|
-
var _formulaMutations$pre3, _formulaMutations$pre4;
|
|
4074
4061
|
const removedColumnNames = info.columns.map((column) => column.displayName);
|
|
4075
4062
|
if (!removedColumnNames.length) return;
|
|
4076
4063
|
const formulaMutations = this._sheetInterceptorService.onCommandExecute({
|
|
@@ -4084,8 +4071,8 @@ let SheetTableRefRangeController = class SheetTableRefRangeController extends Di
|
|
|
4084
4071
|
removedColumnNames
|
|
4085
4072
|
}
|
|
4086
4073
|
});
|
|
4087
|
-
redos.splice(Math.max(redos.length - 1, 0), 0, ...
|
|
4088
|
-
undos.push(...
|
|
4074
|
+
redos.splice(Math.max(redos.length - 1, 0), 0, ...formulaMutations.preRedos ?? [], ...formulaMutations.redos);
|
|
4075
|
+
undos.push(...formulaMutations.preUndos ?? [], ...formulaMutations.undos);
|
|
4089
4076
|
}
|
|
4090
4077
|
_initCommandListener() {
|
|
4091
4078
|
this._commandService.onCommandExecuted((commandInfo) => {
|
|
@@ -4204,8 +4191,7 @@ let TableFilterController = class TableFilterController extends Disposable {
|
|
|
4204
4191
|
this._tableFilteredOutRows.set(this._getSheetKey(unitId, subUnitId), filteredOutRows);
|
|
4205
4192
|
}
|
|
4206
4193
|
_getTableFilteredOutRows(unitId, subUnitId) {
|
|
4207
|
-
|
|
4208
|
-
return (_this$_tableFilteredO = this._tableFilteredOutRows.get(this._getSheetKey(unitId, subUnitId))) !== null && _this$_tableFilteredO !== void 0 ? _this$_tableFilteredO : /* @__PURE__ */ new Set();
|
|
4194
|
+
return this._tableFilteredOutRows.get(this._getSheetKey(unitId, subUnitId)) ?? /* @__PURE__ */ new Set();
|
|
4209
4195
|
}
|
|
4210
4196
|
_getSheetKey(unitId, subUnitId) {
|
|
4211
4197
|
return `${unitId}|${subUnitId}`;
|
|
@@ -4287,6 +4273,7 @@ _defineProperty(UniverSheetsTablePlugin, "packageName", name);
|
|
|
4287
4273
|
_defineProperty(UniverSheetsTablePlugin, "version", version);
|
|
4288
4274
|
_defineProperty(UniverSheetsTablePlugin, "type", UniverInstanceType.UNIVER_SHEET);
|
|
4289
4275
|
UniverSheetsTablePlugin = __decorate([
|
|
4276
|
+
DependentOn(UniverSheetsPlugin),
|
|
4290
4277
|
__decorateParam(1, Inject(Injector)),
|
|
4291
4278
|
__decorateParam(2, IConfigService),
|
|
4292
4279
|
__decorateParam(3, Inject(ICommandService))
|