@univerjs/sheets-table 1.0.2 → 1.0.4
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 +184 -13
- package/lib/cjs/locale/ar-SA.js +1 -0
- package/lib/cjs/locale/ca-ES.js +1 -0
- package/lib/cjs/locale/de-DE.js +1 -0
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/es-ES.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/cjs/locale/id-ID.js +1 -0
- package/lib/cjs/locale/it-IT.js +1 -0
- package/lib/cjs/locale/ja-JP.js +1 -0
- package/lib/cjs/locale/ko-KR.js +1 -0
- package/lib/cjs/locale/pl-PL.js +1 -0
- package/lib/cjs/locale/pt-BR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-HK.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/index.js +186 -15
- package/lib/es/locale/ar-SA.js +1 -0
- package/lib/es/locale/ca-ES.js +1 -0
- package/lib/es/locale/de-DE.js +1 -0
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/es-ES.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/fr-FR.js +1 -0
- package/lib/es/locale/id-ID.js +1 -0
- package/lib/es/locale/it-IT.js +1 -0
- package/lib/es/locale/ja-JP.js +1 -0
- package/lib/es/locale/ko-KR.js +1 -0
- package/lib/es/locale/pl-PL.js +1 -0
- package/lib/es/locale/pt-BR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/sk-SK.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-HK.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/index.js +186 -15
- package/lib/locale/ar-SA.js +1 -0
- package/lib/locale/ca-ES.js +1 -0
- package/lib/locale/de-DE.js +1 -0
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/es-ES.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/fr-FR.js +1 -0
- package/lib/locale/id-ID.js +1 -0
- package/lib/locale/it-IT.js +1 -0
- package/lib/locale/ja-JP.js +1 -0
- package/lib/locale/ko-KR.js +1 -0
- package/lib/locale/pl-PL.js +1 -0
- package/lib/locale/pt-BR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/sk-SK.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-HK.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/commands/mutations/move-sheet-table.mutation.d.ts +25 -0
- package/lib/types/controllers/sheet-table-move.controller.d.ts +31 -0
- package/lib/types/controllers/table-filter.controller.d.ts +0 -1
- package/lib/types/locale/en-US.d.ts +1 -0
- package/lib/types/models/table-manager.d.ts +1 -0
- package/lib/types/types/type.d.ts +2 -7
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- 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 +7 -7
package/lib/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BooleanNumber, BorderStyleTypes, CellValueType, ColorKit, CommandType, DEFAULT_STYLES, DateSystem, DependentOn, Disposable, FilterSelectionMode, FormulaType, ICommandService, IConfigService, ILogService, IPermissionService, IResourceManagerService, IUndoRedoService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, LocaleService, Plugin, RTree, RecordValueType, Rectangle, UniverInstanceType, customNameCharacterCheck, excelSerialToDateTime, generateRandomId, getColorStyle, merge, numfmt, regexp, registerDependencies, sequenceExecute, toDisposable, touchDependencies } from "@univerjs/core";
|
|
1
|
+
import { BooleanNumber, BorderStyleTypes, CellValueType, ColorKit, CommandType, DEFAULT_STYLES, DateSystem, DependentOn, Disposable, ErrorService, FilterSelectionMode, FormulaType, ICommandService, IConfigService, ILogService, IPermissionService, IResourceManagerService, IUndoRedoService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, LocaleService, Plugin, RTree, RecordValueType, Rectangle, UniverInstanceType, customNameCharacterCheck, excelSerialToDateTime, generateRandomId, getColorStyle, merge, numfmt, regexp, registerDependencies, sequenceExecute, toDisposable, touchDependencies } from "@univerjs/core";
|
|
2
2
|
import { IActiveDirtyManagerService, IDefinedNamesService, ISheetRowFilteredService, LexerTreeBuilder, RemoveSuperTableMutation, SetSuperTableMutation, extractFormulaError, serializeRange } from "@univerjs/engine-formula";
|
|
3
|
-
import { AddRangeThemeMutation, CopySheetCommand, IExclusiveRangeService, INTERCEPTOR_POINT, InsertColCommand, InsertColMutation, InsertRowCommand, InsertRowMutation, RangeThemeStyle, RefRangeService, RemoveColCommand, RemoveColMutation, RemoveRangeThemeMutation, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SheetInterceptorService, SheetRangeThemeModel, SheetRangeThemeService, SheetsSelectionsService, UniverSheetsPlugin, WorkbookEditablePermission, ZebraCrossingCacheController, checkRangesEditablePermission, getMoveRangeCommandMutations, getMoveRangeUndoRedoMutations, getSheetCommandTarget } from "@univerjs/sheets";
|
|
3
|
+
import { AddRangeThemeMutation, CopySheetCommand, IExclusiveRangeService, INTERCEPTOR_POINT, InsertColCommand, InsertColMutation, InsertRowCommand, InsertRowMutation, MoveRangeCommand, RangeThemeStyle, RefRangeService, RemoveColCommand, RemoveColMutation, RemoveRangeThemeMutation, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SheetInterceptorService, SheetRangeThemeModel, SheetRangeThemeService, SheetsSelectionsService, UniverSheetsPlugin, WorkbookEditablePermission, ZebraCrossingCacheController, checkRangesEditablePermission, getMoveRangeCommandMutations, getMoveRangeUndoRedoMutations, getSheetCommandTarget } from "@univerjs/sheets";
|
|
4
4
|
import { BehaviorSubject, Subject, filter, switchMap } from "rxjs";
|
|
5
5
|
|
|
6
6
|
//#region src/types/enum.ts
|
|
@@ -2052,6 +2052,28 @@ let TableManager = class TableManager extends Disposable {
|
|
|
2052
2052
|
oldRange
|
|
2053
2053
|
});
|
|
2054
2054
|
}
|
|
2055
|
+
moveTable(unitId, tableId, subUnitId, range) {
|
|
2056
|
+
const table = this.getTableById(unitId, tableId);
|
|
2057
|
+
if (!table) return;
|
|
2058
|
+
const oldRange = table.getRange();
|
|
2059
|
+
const oldSubUnitId = table.getSubunitId();
|
|
2060
|
+
table.setSubunitId(subUnitId);
|
|
2061
|
+
table.setRange({ ...range });
|
|
2062
|
+
this._tableRangeChanged$.next({
|
|
2063
|
+
unitId,
|
|
2064
|
+
subUnitId,
|
|
2065
|
+
oldSubUnitId,
|
|
2066
|
+
tableId,
|
|
2067
|
+
range: { ...range },
|
|
2068
|
+
oldRange
|
|
2069
|
+
});
|
|
2070
|
+
this._tableFilterChanged$.next({
|
|
2071
|
+
unitId,
|
|
2072
|
+
subUnitId,
|
|
2073
|
+
oldSubUnitId,
|
|
2074
|
+
tableId
|
|
2075
|
+
});
|
|
2076
|
+
}
|
|
2055
2077
|
setTableByConfig(unitId, tableId, config) {
|
|
2056
2078
|
const unitMap = this._tableMap.get(unitId);
|
|
2057
2079
|
const table = unitMap === null || unitMap === void 0 ? void 0 : unitMap.get(tableId);
|
|
@@ -2927,11 +2949,11 @@ let SheetsTableController = class SheetsTableController extends Disposable {
|
|
|
2927
2949
|
});
|
|
2928
2950
|
}));
|
|
2929
2951
|
this.disposeWithMe(this._tableManager.tableRangeChanged$.subscribe((event) => {
|
|
2930
|
-
const { range, tableId, unitId, subUnitId, oldRange } = event;
|
|
2952
|
+
const { range, tableId, unitId, subUnitId, oldRange, oldSubUnitId = subUnitId } = event;
|
|
2931
2953
|
const rTree = this._ensureTableRangeRTree(unitId);
|
|
2932
2954
|
rTree.remove({
|
|
2933
2955
|
unitId,
|
|
2934
|
-
sheetId:
|
|
2956
|
+
sheetId: oldSubUnitId,
|
|
2935
2957
|
id: tableId,
|
|
2936
2958
|
range: { ...oldRange }
|
|
2937
2959
|
});
|
|
@@ -3853,7 +3875,7 @@ let SheetsTableThemeController = class SheetsTableThemeController extends Dispos
|
|
|
3853
3875
|
});
|
|
3854
3876
|
}));
|
|
3855
3877
|
this.disposeWithMe(this._tableManager.tableRangeChanged$.subscribe((event) => {
|
|
3856
|
-
const { range, oldRange, tableId, unitId, subUnitId } = event;
|
|
3878
|
+
const { range, oldRange, tableId, unitId, subUnitId, oldSubUnitId = subUnitId } = event;
|
|
3857
3879
|
const table = this._tableManager.getTable(unitId, tableId);
|
|
3858
3880
|
let tableStyleId = table.getTableStyleId();
|
|
3859
3881
|
if (!tableStyleId) {
|
|
@@ -3862,7 +3884,7 @@ let SheetsTableThemeController = class SheetsTableThemeController extends Dispos
|
|
|
3862
3884
|
}
|
|
3863
3885
|
this._sheetRangeThemeService.removeRangeThemeRule(tableStyleId, {
|
|
3864
3886
|
unitId,
|
|
3865
|
-
subUnitId,
|
|
3887
|
+
subUnitId: oldSubUnitId,
|
|
3866
3888
|
range: { ...oldRange }
|
|
3867
3889
|
});
|
|
3868
3890
|
this._sheetRangeThemeService.registerRangeThemeStyle(tableStyleId, {
|
|
@@ -3924,7 +3946,43 @@ SheetsTableThemeController = __decorate([
|
|
|
3924
3946
|
//#endregion
|
|
3925
3947
|
//#region package.json
|
|
3926
3948
|
var name = "@univerjs/sheets-table";
|
|
3927
|
-
var version = "1.0.
|
|
3949
|
+
var version = "1.0.4";
|
|
3950
|
+
|
|
3951
|
+
//#endregion
|
|
3952
|
+
//#region src/commands/mutations/move-sheet-table.mutation.ts
|
|
3953
|
+
const MoveSheetTableMutation = {
|
|
3954
|
+
id: "sheet.mutation.move-table",
|
|
3955
|
+
type: CommandType.MUTATION,
|
|
3956
|
+
handler: (accessor, params) => {
|
|
3957
|
+
if (!params) return false;
|
|
3958
|
+
const { unitId, tableId, subUnitId, range, calculatedColumns } = params;
|
|
3959
|
+
const manager = accessor.get(TableManager);
|
|
3960
|
+
const table = manager.getTableById(unitId, tableId);
|
|
3961
|
+
const workbook = accessor.get(IUniverInstanceService).getUnit(unitId);
|
|
3962
|
+
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
3963
|
+
if (!table || !worksheet) return false;
|
|
3964
|
+
const columns = calculatedColumns ?? table.getTableInfo().columns.map((column, columnIndex) => {
|
|
3965
|
+
var _worksheet$getCellRaw;
|
|
3966
|
+
const row = range.startRow + (table.isShowHeader() ? 1 : 0);
|
|
3967
|
+
const endRow = range.endRow - (table.isShowFooter() ? 1 : 0);
|
|
3968
|
+
const formula = column.formula && row <= endRow ? (_worksheet$getCellRaw = worksheet.getCellRaw(row, range.startColumn + columnIndex)) === null || _worksheet$getCellRaw === void 0 ? void 0 : _worksheet$getCellRaw.f : void 0;
|
|
3969
|
+
return {
|
|
3970
|
+
columnId: column.id,
|
|
3971
|
+
formula: formula || column.formula,
|
|
3972
|
+
formulaIsArray: column.formulaIsArray
|
|
3973
|
+
};
|
|
3974
|
+
}).filter((column) => column.formula);
|
|
3975
|
+
for (const config of columns) {
|
|
3976
|
+
const column = table.getColumn(config.columnId);
|
|
3977
|
+
if (column) {
|
|
3978
|
+
column.formula = config.formula;
|
|
3979
|
+
column.formulaIsArray = config.formulaIsArray;
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3982
|
+
manager.moveTable(unitId, tableId, subUnitId, range);
|
|
3983
|
+
return true;
|
|
3984
|
+
}
|
|
3985
|
+
};
|
|
3928
3986
|
|
|
3929
3987
|
//#endregion
|
|
3930
3988
|
//#region src/controllers/sheet-table-formula.controller.ts
|
|
@@ -4020,6 +4078,114 @@ SheetTableFormulaController = __decorate([
|
|
|
4020
4078
|
__decorateParam(2, IActiveDirtyManagerService)
|
|
4021
4079
|
], SheetTableFormulaController);
|
|
4022
4080
|
|
|
4081
|
+
//#endregion
|
|
4082
|
+
//#region src/controllers/sheet-table-move.controller.ts
|
|
4083
|
+
let SheetTableMoveController = class SheetTableMoveController extends Disposable {
|
|
4084
|
+
constructor(_tableManager, _sheetInterceptorService, _univerInstanceService, _injector, _localeService, _errorService) {
|
|
4085
|
+
super();
|
|
4086
|
+
this._tableManager = _tableManager;
|
|
4087
|
+
this._sheetInterceptorService = _sheetInterceptorService;
|
|
4088
|
+
this._univerInstanceService = _univerInstanceService;
|
|
4089
|
+
this._injector = _injector;
|
|
4090
|
+
this._localeService = _localeService;
|
|
4091
|
+
this._errorService = _errorService;
|
|
4092
|
+
this.disposeWithMe(this._sheetInterceptorService.interceptBeforeCommand({ performCheck: async (command) => command.id !== MoveRangeCommand.id || this._checkMove(command.params) }));
|
|
4093
|
+
this.disposeWithMe(this._sheetInterceptorService.interceptAfterCommand({ getMutations: (command) => command.id === MoveRangeCommand.id ? this._getMoveMutations(command.params) : {
|
|
4094
|
+
redos: [],
|
|
4095
|
+
undos: []
|
|
4096
|
+
} }));
|
|
4097
|
+
}
|
|
4098
|
+
_getTargets(params) {
|
|
4099
|
+
const source = getSheetCommandTarget(this._univerInstanceService, {
|
|
4100
|
+
unitId: params.fromUnitId ?? params.toUnitId,
|
|
4101
|
+
subUnitId: params.fromSubUnitId
|
|
4102
|
+
});
|
|
4103
|
+
return {
|
|
4104
|
+
source,
|
|
4105
|
+
target: getSheetCommandTarget(this._univerInstanceService, {
|
|
4106
|
+
unitId: params.toUnitId ?? (source === null || source === void 0 ? void 0 : source.unitId),
|
|
4107
|
+
subUnitId: params.toSubUnitId ?? (source === null || source === void 0 ? void 0 : source.subUnitId)
|
|
4108
|
+
})
|
|
4109
|
+
};
|
|
4110
|
+
}
|
|
4111
|
+
_checkMove(params) {
|
|
4112
|
+
const { source, target } = this._getTargets(params);
|
|
4113
|
+
if (!source || !target || source.unitId !== target.unitId) return false;
|
|
4114
|
+
const movingTables = this._tableManager.getTablesBySubunitId(source.unitId, source.subUnitId).filter((table) => Rectangle.contains(params.fromRange, table.getRange()));
|
|
4115
|
+
if (!movingTables.length) return true;
|
|
4116
|
+
const targetTables = this._tableManager.getTablesBySubunitId(target.unitId, target.subUnitId);
|
|
4117
|
+
for (const table of targetTables) {
|
|
4118
|
+
if (movingTables.includes(table) || !Rectangle.intersects(params.toRange, table.getRange())) continue;
|
|
4119
|
+
this._errorService.emit(this._localeService.t("sheets-table.moveTableOverlapError"));
|
|
4120
|
+
return false;
|
|
4121
|
+
}
|
|
4122
|
+
const { fromRange, toRange } = params;
|
|
4123
|
+
if (!this._isValidMoveRange(params, target.worksheet)) return false;
|
|
4124
|
+
return checkRangesEditablePermission(this._injector, source.unitId, source.subUnitId, [fromRange]) && checkRangesEditablePermission(this._injector, target.unitId, target.subUnitId, [toRange]);
|
|
4125
|
+
}
|
|
4126
|
+
_isValidMoveRange(params, worksheet) {
|
|
4127
|
+
const { fromRange, toRange } = params;
|
|
4128
|
+
if (fromRange.endRow - fromRange.startRow !== toRange.endRow - toRange.startRow || fromRange.endColumn - fromRange.startColumn !== toRange.endColumn - toRange.startColumn || toRange.startRow < 0 || toRange.startColumn < 0 || toRange.endRow >= worksheet.getRowCount() || toRange.endColumn >= worksheet.getColumnCount()) return false;
|
|
4129
|
+
return true;
|
|
4130
|
+
}
|
|
4131
|
+
_getMoveMutations(params) {
|
|
4132
|
+
const redos = [];
|
|
4133
|
+
const undos = [];
|
|
4134
|
+
const { source, target } = this._getTargets(params);
|
|
4135
|
+
if (!source || !target || source.unitId !== target.unitId) return {
|
|
4136
|
+
redos,
|
|
4137
|
+
undos
|
|
4138
|
+
};
|
|
4139
|
+
const rowOffset = params.toRange.startRow - params.fromRange.startRow;
|
|
4140
|
+
const columnOffset = params.toRange.startColumn - params.fromRange.startColumn;
|
|
4141
|
+
const tables = this._tableManager.getTablesBySubunitId(source.unitId, source.subUnitId);
|
|
4142
|
+
for (const table of tables) {
|
|
4143
|
+
const range = table.getRange();
|
|
4144
|
+
if (!Rectangle.contains(params.fromRange, range)) continue;
|
|
4145
|
+
redos.push({
|
|
4146
|
+
id: MoveSheetTableMutation.id,
|
|
4147
|
+
params: {
|
|
4148
|
+
unitId: source.unitId,
|
|
4149
|
+
tableId: table.getId(),
|
|
4150
|
+
subUnitId: target.subUnitId,
|
|
4151
|
+
range: {
|
|
4152
|
+
startRow: range.startRow + rowOffset,
|
|
4153
|
+
endRow: range.endRow + rowOffset,
|
|
4154
|
+
startColumn: range.startColumn + columnOffset,
|
|
4155
|
+
endColumn: range.endColumn + columnOffset
|
|
4156
|
+
}
|
|
4157
|
+
}
|
|
4158
|
+
});
|
|
4159
|
+
undos.push({
|
|
4160
|
+
id: MoveSheetTableMutation.id,
|
|
4161
|
+
params: {
|
|
4162
|
+
unitId: source.unitId,
|
|
4163
|
+
tableId: table.getId(),
|
|
4164
|
+
subUnitId: source.subUnitId,
|
|
4165
|
+
range,
|
|
4166
|
+
calculatedColumns: table.getTableInfo().columns.filter((column) => column.formula).map((column) => ({
|
|
4167
|
+
columnId: column.id,
|
|
4168
|
+
formula: column.formula,
|
|
4169
|
+
formulaIsArray: column.formulaIsArray
|
|
4170
|
+
}))
|
|
4171
|
+
}
|
|
4172
|
+
});
|
|
4173
|
+
}
|
|
4174
|
+
return {
|
|
4175
|
+
redos,
|
|
4176
|
+
undos
|
|
4177
|
+
};
|
|
4178
|
+
}
|
|
4179
|
+
};
|
|
4180
|
+
SheetTableMoveController = __decorate([
|
|
4181
|
+
__decorateParam(0, Inject(TableManager)),
|
|
4182
|
+
__decorateParam(1, Inject(SheetInterceptorService)),
|
|
4183
|
+
__decorateParam(2, IUniverInstanceService),
|
|
4184
|
+
__decorateParam(3, Inject(Injector)),
|
|
4185
|
+
__decorateParam(4, Inject(LocaleService)),
|
|
4186
|
+
__decorateParam(5, Inject(ErrorService))
|
|
4187
|
+
], SheetTableMoveController);
|
|
4188
|
+
|
|
4023
4189
|
//#endregion
|
|
4024
4190
|
//#region src/controllers/sheet-table-range.controller.ts
|
|
4025
4191
|
/**
|
|
@@ -4046,8 +4212,8 @@ let SheetTableRangeController = class SheetTableRangeController extends Disposab
|
|
|
4046
4212
|
}
|
|
4047
4213
|
_initRangeListener() {
|
|
4048
4214
|
this.disposeWithMe(this._tableManager.tableRangeChanged$.subscribe((event) => {
|
|
4049
|
-
const { range, tableId, unitId, subUnitId } = event;
|
|
4050
|
-
this._exclusiveRangeService.clearExclusiveRangesByGroupId(unitId,
|
|
4215
|
+
const { range, tableId, unitId, subUnitId, oldSubUnitId = subUnitId } = event;
|
|
4216
|
+
this._exclusiveRangeService.clearExclusiveRangesByGroupId(unitId, oldSubUnitId, FEATURE_TABLE_ID, tableId);
|
|
4051
4217
|
this._exclusiveRangeService.addExclusiveRange(unitId, subUnitId, FEATURE_TABLE_ID, [{
|
|
4052
4218
|
range: { ...range },
|
|
4053
4219
|
groupId: tableId
|
|
@@ -4602,7 +4768,6 @@ let TableFilterController = class TableFilterController extends Disposable {
|
|
|
4602
4768
|
this._sheetRowFilteredService = _sheetRowFilteredService;
|
|
4603
4769
|
this._zebraCrossingCacheController = _zebraCrossingCacheController;
|
|
4604
4770
|
_defineProperty(this, "_tableFilteredOutRows", /* @__PURE__ */ new Map());
|
|
4605
|
-
_defineProperty(this, "_subscription", null);
|
|
4606
4771
|
this.registerFilterChangeEvent();
|
|
4607
4772
|
this.initTableHiddenRowIntercept();
|
|
4608
4773
|
this._registerFormulaRowFiltered();
|
|
@@ -4624,18 +4789,18 @@ let TableFilterController = class TableFilterController extends Disposable {
|
|
|
4624
4789
|
}));
|
|
4625
4790
|
}
|
|
4626
4791
|
_initFilteredOutRows() {
|
|
4627
|
-
this._tableManager.tableInitStatus$.pipe(filter((initialized) => initialized), switchMap(() => {
|
|
4792
|
+
this.disposeWithMe(this._tableManager.tableInitStatus$.pipe(filter((initialized) => initialized), switchMap(() => {
|
|
4628
4793
|
return this._univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET);
|
|
4629
4794
|
}), filter((workbook) => workbook !== null && workbook !== void 0), switchMap((workbook) => workbook.activeSheet$), filter((sheet) => sheet !== null && sheet !== void 0)).subscribe(() => {
|
|
4630
4795
|
const target = getSheetCommandTarget(this._univerInstanceService);
|
|
4631
4796
|
if (!target) return;
|
|
4632
4797
|
const { unitId, subUnitId } = target;
|
|
4633
4798
|
this._refreshTableFilteredOutRows(unitId, subUnitId);
|
|
4634
|
-
});
|
|
4799
|
+
}));
|
|
4635
4800
|
}
|
|
4636
4801
|
registerFilterChangeEvent() {
|
|
4637
4802
|
this.disposeWithMe(this._tableManager.tableFilterChanged$.subscribe((event) => {
|
|
4638
|
-
const { unitId, subUnitId, tableId } = event;
|
|
4803
|
+
const { unitId, subUnitId, tableId, oldSubUnitId } = event;
|
|
4639
4804
|
const workbook = this._univerInstanceService.getUnit(unitId);
|
|
4640
4805
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
4641
4806
|
const table = this._tableManager.getTable(unitId, tableId);
|
|
@@ -4643,6 +4808,10 @@ let TableFilterController = class TableFilterController extends Disposable {
|
|
|
4643
4808
|
table.getTableFilters().doFilter(worksheet, table.getTableFilterRange(), workbook === null || workbook === void 0 ? void 0 : workbook.getDateSystem());
|
|
4644
4809
|
this._refreshTableFilteredOutRows(unitId, subUnitId);
|
|
4645
4810
|
this._zebraCrossingCacheController.updateZebraCrossingCache(unitId, subUnitId);
|
|
4811
|
+
if (oldSubUnitId && oldSubUnitId !== subUnitId) {
|
|
4812
|
+
this._refreshTableFilteredOutRows(unitId, oldSubUnitId);
|
|
4813
|
+
this._zebraCrossingCacheController.updateZebraCrossingCache(unitId, oldSubUnitId);
|
|
4814
|
+
}
|
|
4646
4815
|
}));
|
|
4647
4816
|
}
|
|
4648
4817
|
_refreshTableFilteredOutRows(unitId, subUnitId) {
|
|
@@ -4663,9 +4832,8 @@ let TableFilterController = class TableFilterController extends Disposable {
|
|
|
4663
4832
|
return `${unitId}|${subUnitId}`;
|
|
4664
4833
|
}
|
|
4665
4834
|
dispose() {
|
|
4666
|
-
var _this$_subscription;
|
|
4667
4835
|
super.dispose();
|
|
4668
|
-
|
|
4836
|
+
this._tableFilteredOutRows.clear();
|
|
4669
4837
|
}
|
|
4670
4838
|
};
|
|
4671
4839
|
TableFilterController = __decorate([
|
|
@@ -4698,6 +4866,7 @@ let UniverSheetsTablePlugin = class UniverSheetsTablePlugin extends Plugin {
|
|
|
4698
4866
|
[TableFilterController],
|
|
4699
4867
|
[SheetTableRangeController],
|
|
4700
4868
|
[SheetTableRefRangeController],
|
|
4869
|
+
[SheetTableMoveController],
|
|
4701
4870
|
[SheetTableFormulaController]
|
|
4702
4871
|
]);
|
|
4703
4872
|
}
|
|
@@ -4706,6 +4875,7 @@ let UniverSheetsTablePlugin = class UniverSheetsTablePlugin extends Plugin {
|
|
|
4706
4875
|
[SheetTableFormulaController],
|
|
4707
4876
|
[SheetTableRangeController],
|
|
4708
4877
|
[SheetTableRefRangeController],
|
|
4878
|
+
[SheetTableMoveController],
|
|
4709
4879
|
[SheetsTableThemeController],
|
|
4710
4880
|
[SheetsTableController],
|
|
4711
4881
|
[SheetTableService],
|
|
@@ -4719,6 +4889,7 @@ let UniverSheetsTablePlugin = class UniverSheetsTablePlugin extends Plugin {
|
|
|
4719
4889
|
AddSheetTableMutation,
|
|
4720
4890
|
DeleteSheetTableCommand,
|
|
4721
4891
|
DeleteSheetTableMutation,
|
|
4892
|
+
MoveSheetTableMutation,
|
|
4722
4893
|
SetSheetTableFilterMutation,
|
|
4723
4894
|
SetSheetTableFilterCommand,
|
|
4724
4895
|
SetSheetTableSortStateCommand,
|
package/lib/es/locale/ar-SA.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "عمود",
|
|
4
4
|
tablePrefix: "جدول",
|
|
5
|
+
moveTableOverlapError: "يتداخل نطاق الوجهة مع جدول آخر.",
|
|
5
6
|
tableNameError: "لا يمكن أن يحتوي اسم الجدول على مسافات، ولا يمكن أن يبدأ برقم، ولا يمكن أن يكون مطابقًا لاسم جدول موجود"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/ca-ES.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "Columna",
|
|
4
4
|
tablePrefix: "Taula",
|
|
5
|
+
moveTableOverlapError: "La destinació se superposa amb una altra taula.",
|
|
5
6
|
tableNameError: "El nom de la taula no pot contenir espais, no pot començar amb un número i no pot ser idèntic a un nom de taula existent"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/de-DE.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "Spalte",
|
|
4
4
|
tablePrefix: "Tabelle",
|
|
5
|
+
moveTableOverlapError: "Der Zielbereich überschneidet sich mit einer anderen Tabelle.",
|
|
5
6
|
tableNameError: "Tabellenname darf keine Leerzeichen enthalten, darf nicht mit einer Zahl beginnen und darf nicht mit einem vorhandenen Tabellennamen identisch sein"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/en-US.js
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
const locale = { "sheets-table": {
|
|
18
18
|
columnPrefix: "Column",
|
|
19
19
|
tablePrefix: "Table",
|
|
20
|
+
moveTableOverlapError: "The destination overlaps another table.",
|
|
20
21
|
tableNameError: "Table name cannot contain spaces, cannot start with a number, and cannot be identical to an existing table name"
|
|
21
22
|
} };
|
|
22
23
|
|
package/lib/es/locale/es-ES.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "Columna",
|
|
4
4
|
tablePrefix: "Tabla",
|
|
5
|
+
moveTableOverlapError: "El destino se superpone con otra tabla.",
|
|
5
6
|
tableNameError: "El nombre de la tabla no puede contener espacios, no puede comenzar con un número y no puede ser idéntico a un nombre de tabla existente"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/fa-IR.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "ستون",
|
|
4
4
|
tablePrefix: "جدول",
|
|
5
|
+
moveTableOverlapError: "محدودهٔ مقصد با جدول دیگری همپوشانی دارد.",
|
|
5
6
|
tableNameError: "نام جدول نمیتواند شامل فاصله باشد، نمیتواند با عدد شروع شود و نمیتواند با نام جدولهای موجود تکراری باشد"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/fr-FR.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "Colonne",
|
|
4
4
|
tablePrefix: "Tableau",
|
|
5
|
+
moveTableOverlapError: "La destination chevauche un autre tableau.",
|
|
5
6
|
tableNameError: "Le nom du tableau ne peut pas contenir d'espaces, ne peut pas commencer par un chiffre et ne peut pas être identique à un nom de tableau existant"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/id-ID.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "Kolom",
|
|
4
4
|
tablePrefix: "Tabel",
|
|
5
|
+
moveTableOverlapError: "Rentang tujuan tumpang tindih dengan tabel lain.",
|
|
5
6
|
tableNameError: "Nama tabel tidak boleh mengandung spasi, tidak boleh diawali dengan angka, dan tidak boleh sama dengan nama tabel yang sudah ada"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/it-IT.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "Colonna",
|
|
4
4
|
tablePrefix: "Tabella",
|
|
5
|
+
moveTableOverlapError: "La destinazione si sovrappone a un’altra tabella.",
|
|
5
6
|
tableNameError: "Il nome della tabella non può contenere spazi, non può iniziare con un numero e non può essere identico a un nome di tabella esistente"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/ja-JP.js
CHANGED
package/lib/es/locale/ko-KR.js
CHANGED
package/lib/es/locale/pl-PL.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "Kolumna",
|
|
4
4
|
tablePrefix: "Tabela",
|
|
5
|
+
moveTableOverlapError: "Zakres docelowy nakłada się na inną tabelę.",
|
|
5
6
|
tableNameError: "Nazwa tabeli nie może zawierać spacji, nie może zaczynać się od cyfry i nie może być identyczna z istniejącą nazwą tabeli"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/pt-BR.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "Coluna",
|
|
4
4
|
tablePrefix: "Tabela",
|
|
5
|
+
moveTableOverlapError: "O destino se sobrepõe a outra tabela.",
|
|
5
6
|
tableNameError: "O nome da tabela não pode conter espaços, não pode começar com um número e não pode ser idêntico a um nome de tabela existente"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/ru-RU.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "Столбец",
|
|
4
4
|
tablePrefix: "Таблица",
|
|
5
|
+
moveTableOverlapError: "Диапазон назначения пересекается с другой таблицей.",
|
|
5
6
|
tableNameError: "Имя таблицы не может содержать пробелы, не может начинаться с цифры и не может совпадать с именем существующей таблицы"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/sk-SK.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "Stĺpec",
|
|
4
4
|
tablePrefix: "Tabuľka",
|
|
5
|
+
moveTableOverlapError: "Cieľový rozsah sa prekrýva s inou tabuľkou.",
|
|
5
6
|
tableNameError: "Názov tabuľky nesmie obsahovať medzery, nesmie začínať číslom a nesmie byť zhodný s existujúcim názvom tabuľky"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/vi-VN.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const locale = { "sheets-table": {
|
|
3
3
|
columnPrefix: "Cột",
|
|
4
4
|
tablePrefix: "Bảng",
|
|
5
|
+
moveTableOverlapError: "Vùng đích chồng lấp với một bảng khác.",
|
|
5
6
|
tableNameError: "Tên bảng không thể chứa khoảng trắng, không được bắt đầu bằng số và không được trùng với tên bảng đã có"
|
|
6
7
|
} };
|
|
7
8
|
|
package/lib/es/locale/zh-CN.js
CHANGED
package/lib/es/locale/zh-HK.js
CHANGED