@univerjs/sheets 0.10.13 → 0.10.14
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 +2 -2
- package/lib/es/index.js +224 -224
- package/lib/index.js +224 -224
- package/lib/umd/index.js +2 -2
- package/package.json +9 -9
package/lib/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ci = Object.defineProperty;
|
|
2
2
|
var pi = (n, e, t) => e in n ? Ci(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var R = (n, e, t) => pi(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { CellValueType as re, isTextFormat as mo, isRealNum as
|
|
4
|
+
import { CellValueType as re, isTextFormat as mo, isRealNum as No, isBooleanString as Ps, willLoseNumericPrecision as Si, CommandType as v, IUniverInstanceService as M, Tools as A, createInterceptorKey as ft, Disposable as ue, UniverInstanceType as B, InterceptorEffectEnum as he, InterceptorManager as Oo, toDisposable as Ne, remove as je, composeInterceptors as wi, DisposableCollection as Et, BooleanNumber as te, HorizontalAlign as Do, BorderStyleTypes as Ns, Inject as $, IResourceManagerService as Rn, RTree as Ii, generateRandomId as Ut, insertMatrixArray as Tn, ObjectMatrix as Y, Rectangle as N, moveMatrixArray as Os, sliceMatrixArray as Ds, concatMatrixArray as As, spliceArray as xs, Range as X, normalizeTextRuns as vi, isSafeNumeric as Mi, RANGE_TYPE as j, createRowColIter as _i, ICommandService as E, IUndoRedoService as V, RxDisposable as $s, sequenceExecute as L, selectionToArray as yi, createIdentifier as Ao, IContextService as Ws, ErrorService as Vt, LocaleService as it, cellToRange as Vs, PermissionStatus as q, IPermissionService as Ze, isICellData as Ls, mapObjectMatrix as bi, Dimension as Re, getArrayLength as Hs, Direction as pe, Injector as so, queryObjectMatrix as at, CellModeEnum as Ei, mergeWorksheetSnapshotWithDefault as Ui, BorderType as de, FontWeight as ki, FontItalic as Ti, ILogService as Fs, DocumentDataModel as Pi, BuildTextUtils as Ni, TextX as Oi, IConfigService as xo, CustomCommandExecutionError as Di, IAuthzIoService as Ai, UserManagerService as xi, LRUMap as $i, Optional as Wi, isDefaultFormat as Vi, DependentOn as Li, Plugin as Hi, merge as Fi, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE as Bi, AUTO_HEIGHT_FOR_MERGED_CELLS as ji, registerDependencies as zi, mergeOverrideWithDependencies as Gi, touchDependencies as vn } from "@univerjs/core";
|
|
5
5
|
import { Subject as De, BehaviorSubject as gt, merge as jt, shareReplay as Ki, takeUntil as et, switchMap as tt, of as Ie, distinctUntilChanged as Ji, skip as Bs, map as yo, first as qi, filter as os } from "rxjs";
|
|
6
6
|
import { SetDefinedNameMutation as en, RemoveDefinedNameMutation as Pn, SetDefinedNameMutationFactory as Yi, IDefinedNamesService as js, LexerTreeBuilder as Xi, operatorToken as Zi, deserializeRangeWithSheet as Qi, sequenceNodeType as ea, deserializeRangeWithSheetWithCache as ta, SetFormulaCalculationResultMutation as na, handleNumfmtInCell as oa, stripErrorMargin as sa, UniverFormulaEnginePlugin as ra } from "@univerjs/engine-formula";
|
|
7
7
|
import { takeUntil as ss, filter as rs, map as ia } from "rxjs/operators";
|
|
@@ -13,7 +13,7 @@ function ua(n, e, t) {
|
|
|
13
13
|
const o = n.getStyleByCell(e), s = n.getStyleByCell(t);
|
|
14
14
|
if (t.t === re.FORCE_STRING) {
|
|
15
15
|
if (!mo((r = s == null ? void 0 : s.n) == null ? void 0 : r.pattern) && e.v !== void 0) {
|
|
16
|
-
if (
|
|
16
|
+
if (No(e.v))
|
|
17
17
|
return re.NUMBER;
|
|
18
18
|
if (Ps(`${e.v}`))
|
|
19
19
|
return re.BOOLEAN;
|
|
@@ -30,7 +30,7 @@ function la(n) {
|
|
|
30
30
|
return !!((e = n == null ? void 0 : n.n) != null && e.pattern);
|
|
31
31
|
}
|
|
32
32
|
function as(n, e) {
|
|
33
|
-
return n === null ? null : typeof n == "string" ?
|
|
33
|
+
return n === null ? null : typeof n == "string" ? No(n) ? (+n == 0 || +n == 1) && e === re.BOOLEAN ? re.BOOLEAN : e !== re.STRING && e !== re.FORCE_STRING && Si(n) ? re.FORCE_STRING : re.NUMBER : Ps(n) ? re.BOOLEAN : re.STRING : typeof n == "number" ? (n === 0 || n === 1) && e === re.BOOLEAN ? re.BOOLEAN : re.NUMBER : typeof n == "boolean" ? re.BOOLEAN : re.FORCE_STRING;
|
|
34
34
|
}
|
|
35
35
|
const We = (n, e) => {
|
|
36
36
|
if (n.get(M).getUniverSheetInstance(e.unitId) == null)
|
|
@@ -80,7 +80,7 @@ let G = class extends ue {
|
|
|
80
80
|
R(this, "_worksheetDisposables", /* @__PURE__ */ new Map());
|
|
81
81
|
R(this, "_interceptorsDirty", !1);
|
|
82
82
|
R(this, "_composedInterceptorByKey", /* @__PURE__ */ new Map());
|
|
83
|
-
R(this, "writeCellInterceptor", new
|
|
83
|
+
R(this, "writeCellInterceptor", new Oo({
|
|
84
84
|
BEFORE_CELL_EDIT: ls,
|
|
85
85
|
AFTER_CELL_EDIT: fo,
|
|
86
86
|
VALIDATE_CELL: Ro
|
|
@@ -122,7 +122,7 @@ let G = class extends ue {
|
|
|
122
122
|
return this._commandInterceptors.push(e), this._commandInterceptors.sort((t, o) => {
|
|
123
123
|
var s, r;
|
|
124
124
|
return ((s = o.priority) != null ? s : 0) - ((r = t.priority) != null ? r : 0);
|
|
125
|
-
}), this.disposeWithMe(
|
|
125
|
+
}), this.disposeWithMe(Ne(() => je(this._commandInterceptors, e)));
|
|
126
126
|
}
|
|
127
127
|
/**
|
|
128
128
|
* When command is executing, call this method to gether undo redo mutations from upper features.
|
|
@@ -150,7 +150,7 @@ let G = class extends ue {
|
|
|
150
150
|
return this._afterCommandInterceptors.push(e), this._afterCommandInterceptors.sort((t, o) => {
|
|
151
151
|
var s, r;
|
|
152
152
|
return ((s = o.priority) != null ? s : 0) - ((r = t.priority) != null ? r : 0);
|
|
153
|
-
}), this.disposeWithMe(
|
|
153
|
+
}), this.disposeWithMe(Ne(() => je(this._afterCommandInterceptors, e)));
|
|
154
154
|
}
|
|
155
155
|
afterCommandExecute(e) {
|
|
156
156
|
const t = this._afterCommandInterceptors.map((o) => o.getMutations(e));
|
|
@@ -165,7 +165,7 @@ let G = class extends ue {
|
|
|
165
165
|
return this._autoHeightInterceptors.push(e), this._autoHeightInterceptors.sort((t, o) => {
|
|
166
166
|
var s, r;
|
|
167
167
|
return ((s = o.priority) != null ? s : 0) - ((r = t.priority) != null ? r : 0);
|
|
168
|
-
}), this.disposeWithMe(
|
|
168
|
+
}), this.disposeWithMe(Ne(() => je(this._autoHeightInterceptors, e)));
|
|
169
169
|
}
|
|
170
170
|
generateMutationsOfAutoHeight(e) {
|
|
171
171
|
const t = this._autoHeightInterceptors.map((o) => o.getMutations(e));
|
|
@@ -197,7 +197,7 @@ let G = class extends ue {
|
|
|
197
197
|
return this._beforeCommandInterceptor.push(e), this._beforeCommandInterceptor.sort((t, o) => {
|
|
198
198
|
var s, r;
|
|
199
199
|
return ((s = o.priority) != null ? s : 0) - ((r = t.priority) != null ? r : 0);
|
|
200
|
-
}), this.disposeWithMe(
|
|
200
|
+
}), this.disposeWithMe(Ne(() => je(this._beforeCommandInterceptor, e)));
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
203
203
|
* before command execute, call this method to get the flag of whether it can be executed the command,
|
|
@@ -220,7 +220,7 @@ let G = class extends ue {
|
|
|
220
220
|
return this._rangeInterceptors.push(e), this._rangeInterceptors.sort((t, o) => {
|
|
221
221
|
var s, r;
|
|
222
222
|
return ((s = o.priority) != null ? s : 0) - ((r = t.priority) != null ? r : 0);
|
|
223
|
-
}), this.disposeWithMe(
|
|
223
|
+
}), this.disposeWithMe(Ne(() => je(this._rangeInterceptors, e)));
|
|
224
224
|
}
|
|
225
225
|
generateMutationsByRanges(e) {
|
|
226
226
|
const t = this._rangeInterceptors.map((o) => o.getMutations(e));
|
|
@@ -282,11 +282,11 @@ let G = class extends ue {
|
|
|
282
282
|
), this._interceptorsByName.set(
|
|
283
283
|
`${o}-${he.Value}`,
|
|
284
284
|
r.filter((u) => ((u.effect || a) & he.Value) > 0)
|
|
285
|
-
), this.disposeWithMe(
|
|
285
|
+
), this.disposeWithMe(Ne(() => {
|
|
286
286
|
je(this._interceptorsByName.get(o), t), je(this._interceptorsByName.get(`${o}-${i}`), t), je(this._interceptorsByName.get(`${o}-${he.Style}`), t), je(this._interceptorsByName.get(`${o}-${he.Value}`), t);
|
|
287
287
|
}));
|
|
288
288
|
} else
|
|
289
|
-
return this._interceptorsByName.set(o, r), this.disposeWithMe(
|
|
289
|
+
return this._interceptorsByName.set(o, r), this.disposeWithMe(Ne(() => je(this._interceptorsByName.get(o), t)));
|
|
290
290
|
}
|
|
291
291
|
fetchThroughInterceptors(e, t, o, s) {
|
|
292
292
|
const r = t === void 0 ? e : `${e}-${t}`, i = o != null ? o : r;
|
|
@@ -334,7 +334,7 @@ let G = class extends ue {
|
|
|
334
334
|
}));
|
|
335
335
|
});
|
|
336
336
|
};
|
|
337
|
-
e.getSheets().forEach((i) => r(i)), t.add(e.sheetCreated$.subscribe((i) => r(i))), t.add(
|
|
337
|
+
e.getSheets().forEach((i) => r(i)), t.add(e.sheetCreated$.subscribe((i) => r(i))), t.add(Ne(() => e.getSheets().forEach((i) => this._disposeSheetInterceptor(o, i)))), t.add(e.sheetDisposed$.subscribe((i) => this._disposeSheetInterceptor(o, i))), this._workbookDisposables.set(o, t);
|
|
338
338
|
}
|
|
339
339
|
_disposeWorkbookInterceptor(e) {
|
|
340
340
|
const t = e.getUnitId(), o = this._workbookDisposables.get(t);
|
|
@@ -774,7 +774,7 @@ const Ca = (n, e, t) => new Rt(`light-${n}`, {
|
|
|
774
774
|
lastRowStyle: {
|
|
775
775
|
bd: {
|
|
776
776
|
t: {
|
|
777
|
-
s:
|
|
777
|
+
s: Ns.THIN,
|
|
778
778
|
cl: {
|
|
779
779
|
rgb: "rgb(68,114,196)"
|
|
780
780
|
}
|
|
@@ -839,7 +839,7 @@ var Ta = Object.getOwnPropertyDescriptor, Pa = (n, e, t, o) => {
|
|
|
839
839
|
(i = n[r]) && (s = i(s) || s);
|
|
840
840
|
return s;
|
|
841
841
|
}, Co = (n, e) => (t, o) => e(t, o, n);
|
|
842
|
-
const
|
|
842
|
+
const Na = "SHEET_RANGE_THEME_MODEL_PLUGIN";
|
|
843
843
|
let ve = class extends ue {
|
|
844
844
|
constructor(e, t, o) {
|
|
845
845
|
super();
|
|
@@ -1052,7 +1052,7 @@ let ve = class extends ue {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
},
|
|
1054
1054
|
businesses: [B.UNIVER_SHEET],
|
|
1055
|
-
pluginName:
|
|
1055
|
+
pluginName: Na,
|
|
1056
1056
|
onLoad: (e, t) => {
|
|
1057
1057
|
this.fromJSON(e, t);
|
|
1058
1058
|
},
|
|
@@ -1104,7 +1104,7 @@ const tn = {
|
|
|
1104
1104
|
const { unitId: t, subUnitId: o, range: s, themeName: r } = e, i = n.get(M), a = P(i), u = n.get(ve);
|
|
1105
1105
|
return a ? (u.registerRangeThemeRule(r, { range: s, unitId: t, subUnitId: o }), !0) : !1;
|
|
1106
1106
|
}
|
|
1107
|
-
},
|
|
1107
|
+
}, Oa = (n, e) => {
|
|
1108
1108
|
const t = Qe(n.get(M), e);
|
|
1109
1109
|
if (!t)
|
|
1110
1110
|
throw new Error("[SetWorksheetRangeThemeStyleMutation]: worksheet is null error!");
|
|
@@ -1214,7 +1214,7 @@ function Aa(n, e) {
|
|
|
1214
1214
|
return i ? {
|
|
1215
1215
|
unitId: t,
|
|
1216
1216
|
subUnitId: o,
|
|
1217
|
-
sourceRange:
|
|
1217
|
+
sourceRange: N.clone(r),
|
|
1218
1218
|
targetRange: {
|
|
1219
1219
|
...s,
|
|
1220
1220
|
endRow: s.endRow + a,
|
|
@@ -1223,7 +1223,7 @@ function Aa(n, e) {
|
|
|
1223
1223
|
} : {
|
|
1224
1224
|
unitId: t,
|
|
1225
1225
|
subUnitId: o,
|
|
1226
|
-
targetRange:
|
|
1226
|
+
targetRange: N.clone(s),
|
|
1227
1227
|
sourceRange: {
|
|
1228
1228
|
...r,
|
|
1229
1229
|
endRow: r.endRow - a,
|
|
@@ -1242,7 +1242,7 @@ const Je = {
|
|
|
1242
1242
|
if (!u)
|
|
1243
1243
|
throw new Error("[MoveRowMutation] worksheet is null!");
|
|
1244
1244
|
const l = s.startRow, c = s.endRow - s.startRow + 1, d = r.startRow, h = u.getRowManager().getRowData();
|
|
1245
|
-
return
|
|
1245
|
+
return Os(l, c, d, h), u.getCellMatrix().moveRows(l, c, d), !0;
|
|
1246
1246
|
}
|
|
1247
1247
|
};
|
|
1248
1248
|
function xa(n, e) {
|
|
@@ -1250,7 +1250,7 @@ function xa(n, e) {
|
|
|
1250
1250
|
return i ? {
|
|
1251
1251
|
unitId: t,
|
|
1252
1252
|
subUnitId: o,
|
|
1253
|
-
sourceRange:
|
|
1253
|
+
sourceRange: N.clone(r),
|
|
1254
1254
|
targetRange: {
|
|
1255
1255
|
...s,
|
|
1256
1256
|
endColumn: s.endColumn + a,
|
|
@@ -1259,7 +1259,7 @@ function xa(n, e) {
|
|
|
1259
1259
|
} : {
|
|
1260
1260
|
unitId: t,
|
|
1261
1261
|
subUnitId: o,
|
|
1262
|
-
targetRange:
|
|
1262
|
+
targetRange: N.clone(s),
|
|
1263
1263
|
sourceRange: {
|
|
1264
1264
|
...r,
|
|
1265
1265
|
startColumn: r.startColumn - a,
|
|
@@ -1278,7 +1278,7 @@ const qe = {
|
|
|
1278
1278
|
if (!u)
|
|
1279
1279
|
throw new Error("[MoveColumnMutation] worksheet is null!");
|
|
1280
1280
|
const l = s.startColumn, c = s.endColumn - s.startColumn + 1, d = r.startColumn, h = u.getColumnManager().getColumnData();
|
|
1281
|
-
return
|
|
1281
|
+
return Os(l, c, d, h), u.getCellMatrix().moveColumns(l, c, d), !0;
|
|
1282
1282
|
}
|
|
1283
1283
|
}, $a = (n, e) => {
|
|
1284
1284
|
const s = e.getRowManager().getRowData(), r = {}, i = n.range, a = Ds(i.startRow, i.endRow, s), u = As(r, a);
|
|
@@ -1340,7 +1340,7 @@ const qe = {
|
|
|
1340
1340
|
for (let l = 0; l < a.length; l++)
|
|
1341
1341
|
for (let c = i.length - 1; c >= 0; c--) {
|
|
1342
1342
|
const d = i[c], h = a[l];
|
|
1343
|
-
|
|
1343
|
+
N.intersects(d, h) && u.push(i[c]);
|
|
1344
1344
|
}
|
|
1345
1345
|
return {
|
|
1346
1346
|
unitId: e.unitId,
|
|
@@ -1360,7 +1360,7 @@ const qe = {
|
|
|
1360
1360
|
for (let u = 0; u < a.length; u++)
|
|
1361
1361
|
for (let l = i.length - 1; l >= 0; l--) {
|
|
1362
1362
|
const c = i[l], d = a[u];
|
|
1363
|
-
|
|
1363
|
+
N.intersects(c, d) && i.splice(l, 1);
|
|
1364
1364
|
}
|
|
1365
1365
|
return s.getSpanModel().rebuild(i), !0;
|
|
1366
1366
|
}
|
|
@@ -1372,7 +1372,7 @@ const qe = {
|
|
|
1372
1372
|
...n,
|
|
1373
1373
|
order: t
|
|
1374
1374
|
};
|
|
1375
|
-
},
|
|
1375
|
+
}, Nn = {
|
|
1376
1376
|
id: "sheet.mutation.reorder-range",
|
|
1377
1377
|
type: v.MUTATION,
|
|
1378
1378
|
handler: (n, e) => {
|
|
@@ -1928,7 +1928,7 @@ const mh = [
|
|
|
1928
1928
|
wt.id,
|
|
1929
1929
|
oe.id,
|
|
1930
1930
|
ne.id,
|
|
1931
|
-
|
|
1931
|
+
Nn.id,
|
|
1932
1932
|
qt.id,
|
|
1933
1933
|
Kt.id,
|
|
1934
1934
|
zt.id,
|
|
@@ -2329,7 +2329,7 @@ function ph(n, e, t) {
|
|
|
2329
2329
|
}
|
|
2330
2330
|
}
|
|
2331
2331
|
}
|
|
2332
|
-
return g.length > 0 && (h =
|
|
2332
|
+
return g.length > 0 && (h = N.union(h, ...g)), h;
|
|
2333
2333
|
}
|
|
2334
2334
|
const gu = (n) => {
|
|
2335
2335
|
const e = new Y();
|
|
@@ -2754,7 +2754,7 @@ const _h = (n, e) => {
|
|
|
2754
2754
|
r.addRule(t, o, i);
|
|
2755
2755
|
}), !0;
|
|
2756
2756
|
}
|
|
2757
|
-
},
|
|
2757
|
+
}, Nu = {
|
|
2758
2758
|
type: v.COMMAND,
|
|
2759
2759
|
id: "sheet.command.add-range-protection",
|
|
2760
2760
|
async handler(n, e) {
|
|
@@ -2787,7 +2787,7 @@ const _h = (n, e) => {
|
|
|
2787
2787
|
}
|
|
2788
2788
|
};
|
|
2789
2789
|
var we = /* @__PURE__ */ ((n) => (n[n.MOVE_START = 0] = "MOVE_START", n[n.MOVING = 1] = "MOVING", n[n.MOVE_END = 2] = "MOVE_END", n[n.ONLY_SET = 3] = "ONLY_SET", n))(we || {});
|
|
2790
|
-
class
|
|
2790
|
+
class Ou extends ue {
|
|
2791
2791
|
constructor(t) {
|
|
2792
2792
|
super();
|
|
2793
2793
|
/**
|
|
@@ -3008,7 +3008,7 @@ let z = class extends $s {
|
|
|
3008
3008
|
const o = this._instanceSrv.getUnit(e);
|
|
3009
3009
|
if (!o)
|
|
3010
3010
|
throw new Error(`[SheetsSelectionsService]: cannot resolve unit with id "${e}"!`);
|
|
3011
|
-
t = new
|
|
3011
|
+
t = new Ou(o), this._workbookSelections.set(e, t);
|
|
3012
3012
|
}
|
|
3013
3013
|
return t;
|
|
3014
3014
|
}
|
|
@@ -3138,11 +3138,11 @@ function uo(n, e, t = !0) {
|
|
|
3138
3138
|
endRow: i + u.rowSpan - 1,
|
|
3139
3139
|
endColumn: a + u.colSpan - 1
|
|
3140
3140
|
};
|
|
3141
|
-
|
|
3141
|
+
N.contains(n, l) || s.push(l);
|
|
3142
3142
|
}
|
|
3143
3143
|
}), s.length === 0)
|
|
3144
3144
|
return n;
|
|
3145
|
-
const r =
|
|
3145
|
+
const r = N.union(n, ...s);
|
|
3146
3146
|
return t ? uo(r, e, t) : r;
|
|
3147
3147
|
}
|
|
3148
3148
|
function Uh(n, e, t) {
|
|
@@ -3207,7 +3207,7 @@ function Th(n) {
|
|
|
3207
3207
|
if (!n)
|
|
3208
3208
|
return !1;
|
|
3209
3209
|
const { range: e, primary: t } = n;
|
|
3210
|
-
return
|
|
3210
|
+
return N.equals(e, t);
|
|
3211
3211
|
}
|
|
3212
3212
|
function Wu(n) {
|
|
3213
3213
|
function e(t, o) {
|
|
@@ -3362,7 +3362,7 @@ function Ho(n, e, t, o = !1) {
|
|
|
3362
3362
|
const s = [], r = [], { range: i, subUnitId: a, unitId: u } = e, { range: l, subUnitId: c } = t, h = n.get(M).getUniverSheetInstance(u), g = h == null ? void 0 : h.getSheetBySheetId(c), m = h == null ? void 0 : h.getSheetBySheetId(a), f = g == null ? void 0 : g.getCellMatrix(), C = m == null ? void 0 : m.getCellMatrix();
|
|
3363
3363
|
if (g && m && f && C) {
|
|
3364
3364
|
const p = uo(l, g, !1);
|
|
3365
|
-
if (!
|
|
3365
|
+
if (!N.equals(l, p) && !o)
|
|
3366
3366
|
return null;
|
|
3367
3367
|
const w = new Y(), I = new Y(), S = new Y();
|
|
3368
3368
|
X.foreach(i, (T, U) => {
|
|
@@ -3377,10 +3377,10 @@ function Ho(n, e, t, o = !1) {
|
|
|
3377
3377
|
X.foreach(l, (T, U) => {
|
|
3378
3378
|
y.setValue(T, U, A.deepClone(f.getValue(T, U)));
|
|
3379
3379
|
}), X.foreach(i, (T, U) => {
|
|
3380
|
-
const D = Vs(T, U), H =
|
|
3380
|
+
const D = Vs(T, U), H = N.getRelativeRange(D, i), F = N.getPositionRange(H, l), K = A.deepClone(S.getValue(T, U)), J = A.deepClone(w.getValue(T, U));
|
|
3381
3381
|
J && K && (J.s = K), b.setValue(F.startRow, F.startColumn, J);
|
|
3382
3382
|
});
|
|
3383
|
-
const
|
|
3383
|
+
const O = {
|
|
3384
3384
|
fromRange: e.range,
|
|
3385
3385
|
toRange: t.range,
|
|
3386
3386
|
from: {
|
|
@@ -3405,7 +3405,7 @@ function Ho(n, e, t, o = !1) {
|
|
|
3405
3405
|
},
|
|
3406
3406
|
unitId: u
|
|
3407
3407
|
};
|
|
3408
|
-
s.push({ id: wt.id, params:
|
|
3408
|
+
s.push({ id: wt.id, params: O }), r.push({ id: wt.id, params: k });
|
|
3409
3409
|
}
|
|
3410
3410
|
return {
|
|
3411
3411
|
redos: s,
|
|
@@ -3420,7 +3420,7 @@ function zu(n, e, t) {
|
|
|
3420
3420
|
}
|
|
3421
3421
|
return i;
|
|
3422
3422
|
}
|
|
3423
|
-
var
|
|
3423
|
+
var On = /* @__PURE__ */ ((n) => (n[n.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", n[n.UNIVER_DOC = 1] = "UNIVER_DOC", n[n.UNIVER_SHEET = 2] = "UNIVER_SHEET", n[n.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", n[n.UNIVER_PROJECT = 4] = "UNIVER_PROJECT", n[n.UNRECOGNIZED = -1] = "UNRECOGNIZED", n))(On || {}), _ = /* @__PURE__ */ ((n) => (n[n.View = 0] = "View", n[n.Edit = 1] = "Edit", n[n.ManageCollaborator = 2] = "ManageCollaborator", n[n.Print = 3] = "Print", n[n.Duplicate = 4] = "Duplicate", n[n.Comment = 5] = "Comment", n[n.Copy = 6] = "Copy", n[n.Share = 7] = "Share", n[n.Export = 8] = "Export", n[n.MoveWorksheet = 9] = "MoveWorksheet", n[n.DeleteWorksheet = 10] = "DeleteWorksheet", n[n.HideWorksheet = 11] = "HideWorksheet", n[n.RenameWorksheet = 12] = "RenameWorksheet", n[n.CreateWorksheet = 13] = "CreateWorksheet", n[n.SetWorksheetStyle = 14] = "SetWorksheetStyle", n[n.EditWorksheetCell = 15] = "EditWorksheetCell", n[n.InsertHyperlink = 16] = "InsertHyperlink", n[n.Sort = 17] = "Sort", n[n.Filter = 18] = "Filter", n[n.PivotTable = 19] = "PivotTable", n[n.FloatImg = 20] = "FloatImg", n[n.History = 21] = "History", n[n.RwHgtClWdt = 22] = "RwHgtClWdt", n[n.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", n[n.ViewFilter = 24] = "ViewFilter", n[n.MoveSheet = 25] = "MoveSheet", n[n.DeleteSheet = 26] = "DeleteSheet", n[n.HideSheet = 27] = "HideSheet", n[n.CopySheet = 28] = "CopySheet", n[n.RenameSheet = 29] = "RenameSheet", n[n.CreateSheet = 30] = "CreateSheet", n[n.SelectProtectedCells = 31] = "SelectProtectedCells", n[n.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", n[n.SetCellStyle = 33] = "SetCellStyle", n[n.SetCellValue = 34] = "SetCellValue", n[n.SetRowStyle = 35] = "SetRowStyle", n[n.SetColumnStyle = 36] = "SetColumnStyle", n[n.InsertRow = 37] = "InsertRow", n[n.InsertColumn = 38] = "InsertColumn", n[n.DeleteRow = 39] = "DeleteRow", n[n.DeleteColumn = 40] = "DeleteColumn", n[n.EditExtraObject = 41] = "EditExtraObject", n[n.Delete = 42] = "Delete", n[n.RecoverHistory = 43] = "RecoverHistory", n[n.ViewHistory = 44] = "ViewHistory", n[n.CreatePermissionObject = 45] = "CreatePermissionObject", n[n.UNRECOGNIZED = -1] = "UNRECOGNIZED", n))(_ || {}), x = /* @__PURE__ */ ((n) => (n[n.Unkonwn = 0] = "Unkonwn", n[n.Workbook = 1] = "Workbook", n[n.Worksheet = 2] = "Worksheet", n[n.SelectRange = 3] = "SelectRange", n[n.Document = 4] = "Document", n[n.Slide = 5] = "Slide", n[n.UNRECOGNIZED = -1] = "UNRECOGNIZED", n))(x || {});
|
|
3424
3424
|
class Ve {
|
|
3425
3425
|
constructor(e, t, o) {
|
|
3426
3426
|
R(this, "type", x.SelectRange);
|
|
@@ -3807,7 +3807,7 @@ class Ph {
|
|
|
3807
3807
|
this.unitId = e, this.subUnitId = t, this.id = `${this.type}.${_.SelectProtectedCells}_${e}_${t}`;
|
|
3808
3808
|
}
|
|
3809
3809
|
}
|
|
3810
|
-
class
|
|
3810
|
+
class Nh {
|
|
3811
3811
|
constructor(e, t) {
|
|
3812
3812
|
R(this, "value", !0);
|
|
3813
3813
|
R(this, "type", x.Worksheet);
|
|
@@ -3906,7 +3906,7 @@ const pn = {
|
|
|
3906
3906
|
w = g;
|
|
3907
3907
|
const I = { subUnitId: l, unitId: c, cellValue: w != null ? w : p.getMatrix() }, S = Ae(n, I), y = bi(I.cellValue, (F, K) => h.getCellHeight(F, K) || void 0);
|
|
3908
3908
|
if (!t.syncExecuteCommand(ee.id, I)) return !1;
|
|
3909
|
-
const { undos:
|
|
3909
|
+
const { undos: O, redos: k } = i.onCommandExecute({
|
|
3910
3910
|
id: pn.id,
|
|
3911
3911
|
params: I
|
|
3912
3912
|
}), { undos: T, redos: U } = i.generateMutationsOfAutoHeight({
|
|
@@ -3921,7 +3921,7 @@ const pn = {
|
|
|
3921
3921
|
unitID: c,
|
|
3922
3922
|
undoMutations: [
|
|
3923
3923
|
{ id: ee.id, params: S },
|
|
3924
|
-
...
|
|
3924
|
+
...O,
|
|
3925
3925
|
...T,
|
|
3926
3926
|
F
|
|
3927
3927
|
],
|
|
@@ -3945,16 +3945,16 @@ function Er(n, e) {
|
|
|
3945
3945
|
let I, S;
|
|
3946
3946
|
if (a === Re.COLUMNS) {
|
|
3947
3947
|
const b = Math.min(i.endRow, m.endRow);
|
|
3948
|
-
let
|
|
3948
|
+
let O = 0;
|
|
3949
3949
|
for (let T = i.startRow; T <= b; T++) {
|
|
3950
3950
|
const U = g.getRow(T), D = U ? Hs(U) - 1 : 0;
|
|
3951
|
-
|
|
3951
|
+
O = Math.max(O, D);
|
|
3952
3952
|
}
|
|
3953
3953
|
I = {
|
|
3954
3954
|
startRow: i.startRow,
|
|
3955
3955
|
startColumn: i.startColumn,
|
|
3956
3956
|
endRow: b,
|
|
3957
|
-
endColumn:
|
|
3957
|
+
endColumn: O
|
|
3958
3958
|
};
|
|
3959
3959
|
const k = i.endColumn - i.startColumn + 1;
|
|
3960
3960
|
S = {
|
|
@@ -3964,11 +3964,11 @@ function Er(n, e) {
|
|
|
3964
3964
|
endColumn: I.endColumn + k
|
|
3965
3965
|
};
|
|
3966
3966
|
} else {
|
|
3967
|
-
const b = Math.min(i.endColumn, m.endColumn),
|
|
3967
|
+
const b = Math.min(i.endColumn, m.endColumn), O = m.endRow;
|
|
3968
3968
|
I = {
|
|
3969
3969
|
startRow: i.startRow,
|
|
3970
3970
|
startColumn: i.startColumn,
|
|
3971
|
-
endRow:
|
|
3971
|
+
endRow: O,
|
|
3972
3972
|
endColumn: b
|
|
3973
3973
|
};
|
|
3974
3974
|
const k = i.endRow - i.startRow + 1;
|
|
@@ -4034,7 +4034,7 @@ function Ur(n, e) {
|
|
|
4034
4034
|
const I = Math.min(i.endRow, g.endRow);
|
|
4035
4035
|
let S = 0;
|
|
4036
4036
|
for (let b = i.startRow; b <= I; b++) {
|
|
4037
|
-
const
|
|
4037
|
+
const O = h.getRow(b), k = O ? Hs(O) - 1 : 0;
|
|
4038
4038
|
S = Math.max(S, k);
|
|
4039
4039
|
}
|
|
4040
4040
|
p = {
|
|
@@ -4083,7 +4083,7 @@ function Ur(n, e) {
|
|
|
4083
4083
|
undo: o
|
|
4084
4084
|
};
|
|
4085
4085
|
}
|
|
4086
|
-
function
|
|
4086
|
+
function Oh(n, e, t, o, s, r) {
|
|
4087
4087
|
const { startRow: i, endRow: a, startColumn: u, endColumn: l } = e;
|
|
4088
4088
|
if (s === Re.ROWS) {
|
|
4089
4089
|
const c = a - i + 1;
|
|
@@ -4145,11 +4145,11 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4145
4145
|
g
|
|
4146
4146
|
), p = [...(y = m.preRedos) != null ? y : [], ...f], w = [...m.undos, ...C];
|
|
4147
4147
|
if (p.push(...m.redos), p.push(ut(h, l, u)), w.push(...(b = m.preUndos) != null ? b : []), L(p, t).result) {
|
|
4148
|
-
const
|
|
4148
|
+
const O = i.afterCommandExecute({
|
|
4149
4149
|
id: It.id,
|
|
4150
4150
|
params: { range: h }
|
|
4151
4151
|
});
|
|
4152
|
-
return L(
|
|
4152
|
+
return L(O.redos, t), w.push(...O.undos), p.push(...O.redos), o.pushUndoRedo({
|
|
4153
4153
|
unitID: d,
|
|
4154
4154
|
undoMutations: w.reverse(),
|
|
4155
4155
|
redoMutations: p
|
|
@@ -4182,11 +4182,11 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4182
4182
|
g
|
|
4183
4183
|
), p = [...(y = m.preRedos) != null ? y : [], ...f], w = [...m.undos, ...C];
|
|
4184
4184
|
if (p.push(...m.redos), p.push(ut(h, c, d)), w.push(...(b = m.preUndos) != null ? b : []), L(p, t).result) {
|
|
4185
|
-
const
|
|
4185
|
+
const O = i.afterCommandExecute({
|
|
4186
4186
|
id: vt.id,
|
|
4187
4187
|
params: { range: h }
|
|
4188
4188
|
});
|
|
4189
|
-
return L(
|
|
4189
|
+
return L(O.redos, t), w.push(...O.undos), p.push(...O.redos), o.pushUndoRedo({
|
|
4190
4190
|
unitID: u,
|
|
4191
4191
|
undoMutations: w.reverse(),
|
|
4192
4192
|
redoMutations: p
|
|
@@ -4241,7 +4241,7 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4241
4241
|
const se = h.getCell(J, ae);
|
|
4242
4242
|
se && (b[J] || (b[J] = {}), b[J][ae] = { s: se.s });
|
|
4243
4243
|
});
|
|
4244
|
-
const
|
|
4244
|
+
const O = {
|
|
4245
4245
|
range: m,
|
|
4246
4246
|
subUnitId: d,
|
|
4247
4247
|
unitId: c,
|
|
@@ -4249,7 +4249,7 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4249
4249
|
cellValue: b
|
|
4250
4250
|
}, { redo: k, undo: T } = Er(
|
|
4251
4251
|
n,
|
|
4252
|
-
|
|
4252
|
+
O
|
|
4253
4253
|
);
|
|
4254
4254
|
f.push(...k), C.push(...T);
|
|
4255
4255
|
const U = i.onCommandExecute({
|
|
@@ -4319,7 +4319,7 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4319
4319
|
const se = d.getCell(J, ae);
|
|
4320
4320
|
!se || !se.s || (b[J] || (b[J] = {}), b[J][ae] = { s: se.s });
|
|
4321
4321
|
});
|
|
4322
|
-
const
|
|
4322
|
+
const O = {
|
|
4323
4323
|
range: m,
|
|
4324
4324
|
subUnitId: g,
|
|
4325
4325
|
unitId: h,
|
|
@@ -4327,7 +4327,7 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4327
4327
|
cellValue: b
|
|
4328
4328
|
}, { redo: k, undo: T } = Er(
|
|
4329
4329
|
n,
|
|
4330
|
-
|
|
4330
|
+
O
|
|
4331
4331
|
);
|
|
4332
4332
|
f.push(...k), C.push(...T);
|
|
4333
4333
|
const U = i.onCommandExecute({
|
|
@@ -4357,7 +4357,7 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4357
4357
|
return await o.beforeCommandExecute({
|
|
4358
4358
|
id: Ye.id,
|
|
4359
4359
|
params: e
|
|
4360
|
-
}) ? t.syncExecuteCommand(
|
|
4360
|
+
}) ? t.syncExecuteCommand(Nr.id, {
|
|
4361
4361
|
range: s,
|
|
4362
4362
|
direction: r,
|
|
4363
4363
|
unitId: i,
|
|
@@ -4365,7 +4365,7 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4365
4365
|
cellValue: u
|
|
4366
4366
|
}) : !1;
|
|
4367
4367
|
}
|
|
4368
|
-
},
|
|
4368
|
+
}, Nr = {
|
|
4369
4369
|
type: v.COMMAND,
|
|
4370
4370
|
id: "sheet.command.insert-row-by-range",
|
|
4371
4371
|
handler: (n, e) => {
|
|
@@ -4527,9 +4527,9 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4527
4527
|
};
|
|
4528
4528
|
return n.get(E).executeCommand(Ye.id, f);
|
|
4529
4529
|
}
|
|
4530
|
-
},
|
|
4530
|
+
}, Or = "sheet.command.insert-col", Xe = {
|
|
4531
4531
|
type: v.COMMAND,
|
|
4532
|
-
id:
|
|
4532
|
+
id: Or,
|
|
4533
4533
|
handler: async (n, e) => {
|
|
4534
4534
|
const t = n.get(E), o = n.get(G), { range: s, direction: r, subUnitId: i, unitId: a, cellValue: u } = e;
|
|
4535
4535
|
return await o.beforeCommandExecute({
|
|
@@ -4547,7 +4547,7 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4547
4547
|
type: v.COMMAND,
|
|
4548
4548
|
id: "sheet.command.insert-col-by-range",
|
|
4549
4549
|
handler: (n, e) => {
|
|
4550
|
-
var
|
|
4550
|
+
var O, k, T, U;
|
|
4551
4551
|
const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(G), { range: i, direction: a, subUnitId: u, unitId: l, cellValue: c } = e, { startColumn: d, endColumn: h } = e.range;
|
|
4552
4552
|
i.rangeType = j.COLUMN;
|
|
4553
4553
|
const g = s.getUniverSheetInstance(e.unitId), m = g.getSheetBySheetId(e.subUnitId), f = a === pe.LEFT ? d : d - 1, C = m.getColumnWidth(f), p = {
|
|
@@ -4574,7 +4574,7 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4574
4574
|
id: Xe.id,
|
|
4575
4575
|
params: e
|
|
4576
4576
|
});
|
|
4577
|
-
if (I.unshift(...(
|
|
4577
|
+
if (I.unshift(...(O = y.preRedos) != null ? O : []), I.push(...(k = y.redos) != null ? k : []), I.push(ut(i, g, m)), S.unshift(...(T = y.preUndos) != null ? T : []), S.push(...(U = y.undos) != null ? U : []), L(I, t).result) {
|
|
4578
4578
|
const D = r.afterCommandExecute({
|
|
4579
4579
|
id: Xe.id,
|
|
4580
4580
|
params: e
|
|
@@ -4712,7 +4712,7 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4712
4712
|
unitId: u,
|
|
4713
4713
|
subUnitId: l,
|
|
4714
4714
|
range: I
|
|
4715
|
-
},
|
|
4715
|
+
}, O = $a(
|
|
4716
4716
|
b,
|
|
4717
4717
|
r
|
|
4718
4718
|
), k = r.getCellMatrix().getSlice(I.startRow, I.endRow, 0, r.getColumnCount() - 1), T = {
|
|
@@ -4720,7 +4720,7 @@ const kr = "sheet.command.delete-range-move-left", It = {
|
|
|
4720
4720
|
subUnitId: l,
|
|
4721
4721
|
cellValue: k.getMatrix()
|
|
4722
4722
|
};
|
|
4723
|
-
y.push({ id: Te.id, params: b }), S.push({ id: Ue.id, params:
|
|
4723
|
+
y.push({ id: Te.id, params: b }), S.push({ id: Ue.id, params: O }), S.push({ id: ee.id, params: T }), h.push(...y), d.unshift(...S);
|
|
4724
4724
|
});
|
|
4725
4725
|
const g = i.onCommandExecute({
|
|
4726
4726
|
id: An,
|
|
@@ -4900,7 +4900,7 @@ const $r = "sheet.command.move-rows", an = {
|
|
|
4900
4900
|
const u = n.get(G), l = n.get(M), c = P(l, e);
|
|
4901
4901
|
if (!c) return !1;
|
|
4902
4902
|
const { workbook: d, worksheet: h } = c, g = d.getUnitId(), m = h.getSheetId(), f = n.get(Vt), C = n.get(it), p = a[0].range, w = a[0].primary, I = uo(p, h, !1);
|
|
4903
|
-
if (!
|
|
4903
|
+
if (!N.equals(p, I))
|
|
4904
4904
|
return f.emit(C.t("sheets.info.partOfCell")), !1;
|
|
4905
4905
|
if (ul(s, h))
|
|
4906
4906
|
return f.emit(C.t("sheets.info.acrossMergedCell")), !1;
|
|
@@ -4913,7 +4913,7 @@ const $r = "sheet.command.move-rows", an = {
|
|
|
4913
4913
|
subUnitId: m,
|
|
4914
4914
|
sourceRange: p,
|
|
4915
4915
|
targetRange: S
|
|
4916
|
-
}, b = Aa(n, y),
|
|
4916
|
+
}, b = Aa(n, y), O = n.get(E), k = u.onCommandExecute({ id: an.id, params: e }), T = [
|
|
4917
4917
|
...(H = k.preRedos) != null ? H : [],
|
|
4918
4918
|
{ id: Je.id, params: y }
|
|
4919
4919
|
], U = [
|
|
@@ -4942,12 +4942,12 @@ const $r = "sheet.command.move-rows", an = {
|
|
|
4942
4942
|
};
|
|
4943
4943
|
T.push({ id: ie.id, params: le }), U.push({ id: ie.id, params: Se });
|
|
4944
4944
|
}
|
|
4945
|
-
if (T.push(...k.redos), U.push(...k.undos), L(T,
|
|
4945
|
+
if (T.push(...k.redos), U.push(...k.undos), L(T, O).result) {
|
|
4946
4946
|
const K = u.afterCommandExecute({
|
|
4947
4947
|
id: an.id,
|
|
4948
4948
|
params: e
|
|
4949
4949
|
});
|
|
4950
|
-
return L(K.redos,
|
|
4950
|
+
return L(K.redos, O), T.push(...K.redos), U.push(...K.undos), n.get(V).pushUndoRedo({
|
|
4951
4951
|
unitID: g,
|
|
4952
4952
|
undoMutations: U,
|
|
4953
4953
|
redoMutations: T
|
|
@@ -4973,7 +4973,7 @@ const $r = "sheet.command.move-rows", an = {
|
|
|
4973
4973
|
const u = n.get(G), l = n.get(M), c = P(l, e);
|
|
4974
4974
|
if (!c) return !1;
|
|
4975
4975
|
const { workbook: d, worksheet: h } = c, g = d.getUnitId(), m = h.getSheetId(), f = n.get(Vt), C = n.get(it), p = a[0].range, w = a[0].primary, I = uo(p, h, !1);
|
|
4976
|
-
if (!
|
|
4976
|
+
if (!N.equals(p, I))
|
|
4977
4977
|
return f.emit(C.t("sheets.info.partOfCell")), !1;
|
|
4978
4978
|
if (ll(s, h))
|
|
4979
4979
|
return f.emit(C.t("sheets.info.acrossMergedCell")), !1;
|
|
@@ -4986,7 +4986,7 @@ const $r = "sheet.command.move-rows", an = {
|
|
|
4986
4986
|
subUnitId: m,
|
|
4987
4987
|
sourceRange: p,
|
|
4988
4988
|
targetRange: S
|
|
4989
|
-
}, b = xa(n, y),
|
|
4989
|
+
}, b = xa(n, y), O = n.get(E), k = u.onCommandExecute({ id: un.id, params: e }), T = [
|
|
4990
4990
|
...(H = k.preRedos) != null ? H : [],
|
|
4991
4991
|
{ id: qe.id, params: y }
|
|
4992
4992
|
], U = [
|
|
@@ -5011,12 +5011,12 @@ const $r = "sheet.command.move-rows", an = {
|
|
|
5011
5011
|
};
|
|
5012
5012
|
T.push({ id: ie.id, params: le }), U.push({ id: ie.id, params: Se });
|
|
5013
5013
|
}
|
|
5014
|
-
if (T.push(...k.redos), U.push(...k.undos), L(T,
|
|
5014
|
+
if (T.push(...k.redos), U.push(...k.undos), L(T, O).result) {
|
|
5015
5015
|
const K = u.afterCommandExecute({
|
|
5016
5016
|
id: un.id,
|
|
5017
5017
|
params: e
|
|
5018
5018
|
});
|
|
5019
|
-
return L(K.redos,
|
|
5019
|
+
return L(K.redos, O), T.push(...K.redos), U.push(...K.undos), n.get(V).pushUndoRedo({
|
|
5020
5020
|
unitID: g,
|
|
5021
5021
|
undoMutations: U,
|
|
5022
5022
|
redoMutations: T
|
|
@@ -5108,7 +5108,7 @@ const Lr = "sheet.command.reorder-range", bo = {
|
|
|
5108
5108
|
handler: (n, e) => {
|
|
5109
5109
|
var I, S;
|
|
5110
5110
|
const { subUnitId: t, unitId: o, range: s, order: r } = e, i = n.get(E), a = {
|
|
5111
|
-
id:
|
|
5111
|
+
id: Nn.id,
|
|
5112
5112
|
params: {
|
|
5113
5113
|
unitId: o,
|
|
5114
5114
|
subUnitId: t,
|
|
@@ -5116,7 +5116,7 @@ const Lr = "sheet.command.reorder-range", bo = {
|
|
|
5116
5116
|
range: s
|
|
5117
5117
|
}
|
|
5118
5118
|
}, u = {
|
|
5119
|
-
id:
|
|
5119
|
+
id: Nn.id,
|
|
5120
5120
|
params: Va(a.params)
|
|
5121
5121
|
}, l = n.get(G), c = l.onCommandExecute({ id: bo.id, params: e }), d = [
|
|
5122
5122
|
...(I = c.preRedos) != null ? I : [],
|
|
@@ -5142,7 +5142,7 @@ const Lr = "sheet.command.reorder-range", bo = {
|
|
|
5142
5142
|
}, W = {
|
|
5143
5143
|
MoveRangeCommandId: tr,
|
|
5144
5144
|
InsertRowCommandId: Pr,
|
|
5145
|
-
InsertColCommandId:
|
|
5145
|
+
InsertColCommandId: Or,
|
|
5146
5146
|
RemoveColCommandId: xn,
|
|
5147
5147
|
RemoveRowCommandId: An,
|
|
5148
5148
|
DeleteRangeMoveLeftCommandId: kr,
|
|
@@ -5157,7 +5157,7 @@ var Q = /* @__PURE__ */ ((n) => (n[n.Set = 0] = "Set", n[n.Delete = 1] = "Delete
|
|
|
5157
5157
|
const Mn = Number.MAX_SAFE_INTEGER, Ke = (n) => {
|
|
5158
5158
|
const e = { ...n }, t = Number.isNaN(e.startRow) && Number.isNaN(e.endRow) && !Number.isNaN(e.startColumn) && !Number.isNaN(e.endColumn), o = Number.isNaN(e.startColumn) && Number.isNaN(e.endColumn) && !Number.isNaN(e.startRow) && !Number.isNaN(e.endRow);
|
|
5159
5159
|
return (e.rangeType === j.COLUMN || t) && (e.startRow = 0, e.endRow = Mn), (e.rangeType === j.ROW || o) && (e.startColumn = 0, e.endColumn = Mn), e.rangeType === j.ALL && (e.startColumn = 0, e.endColumn = Mn, e.startRow = 0, e.endRow = Mn), e;
|
|
5160
|
-
},
|
|
5160
|
+
}, Oe = (n) => {
|
|
5161
5161
|
let e = n.rangeType;
|
|
5162
5162
|
return n.rangeType === j.COLUMN ? e = j.ROW : n.rangeType === j.ROW && (e = j.COLUMN), {
|
|
5163
5163
|
startRow: n.startColumn,
|
|
@@ -5276,13 +5276,13 @@ const Mn = Number.MAX_SAFE_INTEGER, Ke = (n) => {
|
|
|
5276
5276
|
if (!t || !o)
|
|
5277
5277
|
return [];
|
|
5278
5278
|
const s = [];
|
|
5279
|
-
if (
|
|
5279
|
+
if (N.contains(t, e) && s.push({
|
|
5280
5280
|
type: Q.Delete
|
|
5281
|
-
}),
|
|
5281
|
+
}), N.contains(o, e)) {
|
|
5282
5282
|
s.push({
|
|
5283
5283
|
type: Q.Delete
|
|
5284
5284
|
});
|
|
5285
|
-
const a =
|
|
5285
|
+
const a = N.getRelativeRange(e, o), u = N.getPositionRange(a, t);
|
|
5286
5286
|
return [
|
|
5287
5287
|
{
|
|
5288
5288
|
type: Q.Set,
|
|
@@ -5296,17 +5296,17 @@ const Mn = Number.MAX_SAFE_INTEGER, Ke = (n) => {
|
|
|
5296
5296
|
const t = (d = n.params) == null ? void 0 : d.toRange, o = (h = n.params) == null ? void 0 : h.fromRange;
|
|
5297
5297
|
if (!t || !o)
|
|
5298
5298
|
return [e];
|
|
5299
|
-
if (!
|
|
5299
|
+
if (!N.intersects(o, e) && !N.intersects(t, e))
|
|
5300
5300
|
return [e];
|
|
5301
|
-
if (
|
|
5302
|
-
const g =
|
|
5303
|
-
return [
|
|
5301
|
+
if (N.contains(o, e)) {
|
|
5302
|
+
const g = N.getRelativeRange(e, o);
|
|
5303
|
+
return [N.getPositionRange(g, t)];
|
|
5304
5304
|
}
|
|
5305
5305
|
const s = new Y();
|
|
5306
5306
|
X.foreach(e, (g, m) => {
|
|
5307
5307
|
s.setValue(g, m, 1);
|
|
5308
5308
|
});
|
|
5309
|
-
const r = new Y(), i =
|
|
5309
|
+
const r = new Y(), i = N.getIntersects(o, e);
|
|
5310
5310
|
i && X.foreach(i, (g, m) => {
|
|
5311
5311
|
s.getValue(g, m) && (s.setValue(g, m, void 0), r.setValue(g, m, 1));
|
|
5312
5312
|
});
|
|
@@ -5321,7 +5321,7 @@ const Mn = Number.MAX_SAFE_INTEGER, Ke = (n) => {
|
|
|
5321
5321
|
const f = g + u, C = m + a;
|
|
5322
5322
|
s.setValue(f, C, (p = r.getValue(g, m)) != null ? p : 0);
|
|
5323
5323
|
}), at(s, (g) => g === 1);
|
|
5324
|
-
},
|
|
5324
|
+
}, Nt = (n, e) => {
|
|
5325
5325
|
const t = Ke(n), o = Ke(e), s = (i) => i.endColumn - i.startColumn + 1, r = (i) => i.endRow - i.startRow + 1;
|
|
5326
5326
|
if (t.startRow <= o.startRow && t.endRow >= o.endRow) {
|
|
5327
5327
|
if (
|
|
@@ -5329,14 +5329,14 @@ const Mn = Number.MAX_SAFE_INTEGER, Ke = (n) => {
|
|
|
5329
5329
|
o.startColumn < t.startColumn && o.endColumn >= t.startColumn && o.endColumn <= t.endColumn || // 6
|
|
5330
5330
|
o.startColumn < t.startColumn && o.endColumn >= t.endColumn
|
|
5331
5331
|
) {
|
|
5332
|
-
const i =
|
|
5332
|
+
const i = N.getIntersects(o, t);
|
|
5333
5333
|
if (i)
|
|
5334
5334
|
return { step: 0, length: -s(i) };
|
|
5335
5335
|
}
|
|
5336
5336
|
if (o.startColumn >= t.startColumn && o.endColumn <= t.endColumn && r(t) >= r(o))
|
|
5337
5337
|
return null;
|
|
5338
5338
|
if (o.startColumn >= t.startColumn && o.startColumn <= t.endColumn && o.endColumn > t.endColumn) {
|
|
5339
|
-
const i =
|
|
5339
|
+
const i = N.getIntersects(o, t);
|
|
5340
5340
|
if (i) {
|
|
5341
5341
|
const a = -s(i);
|
|
5342
5342
|
return { step: -(s(t) - s(i)), length: a };
|
|
@@ -5351,7 +5351,7 @@ const Mn = Number.MAX_SAFE_INTEGER, Ke = (n) => {
|
|
|
5351
5351
|
const t = (r = n.params) == null ? void 0 : r.range;
|
|
5352
5352
|
if (!t)
|
|
5353
5353
|
return [];
|
|
5354
|
-
const o = [], s =
|
|
5354
|
+
const o = [], s = Nt(t, e);
|
|
5355
5355
|
if (!s)
|
|
5356
5356
|
o.push({ type: Q.Delete });
|
|
5357
5357
|
else {
|
|
@@ -5393,7 +5393,7 @@ const Mn = Number.MAX_SAFE_INTEGER, Ke = (n) => {
|
|
|
5393
5393
|
} else
|
|
5394
5394
|
r(o);
|
|
5395
5395
|
function r(a) {
|
|
5396
|
-
const u =
|
|
5396
|
+
const u = Nt(Oe(a), Oe(e));
|
|
5397
5397
|
if (!u)
|
|
5398
5398
|
s.push({ type: Q.Delete });
|
|
5399
5399
|
else {
|
|
@@ -5410,7 +5410,7 @@ const Mn = Number.MAX_SAFE_INTEGER, Ke = (n) => {
|
|
|
5410
5410
|
const { range: t, order: o } = n.params || {};
|
|
5411
5411
|
if (!t || !o)
|
|
5412
5412
|
return [];
|
|
5413
|
-
if (
|
|
5413
|
+
if (N.contains(t, e) && e.endRow === e.startRow) {
|
|
5414
5414
|
const s = [], r = e.startRow;
|
|
5415
5415
|
for (const i in o)
|
|
5416
5416
|
if (o[i] === r) {
|
|
@@ -5424,7 +5424,7 @@ const Mn = Number.MAX_SAFE_INTEGER, Ke = (n) => {
|
|
|
5424
5424
|
return [];
|
|
5425
5425
|
}
|
|
5426
5426
|
return [];
|
|
5427
|
-
},
|
|
5427
|
+
}, Ot = (n, e) => {
|
|
5428
5428
|
const t = Ke(n), o = Ke(e), s = (r) => r.endColumn - r.startColumn + 1;
|
|
5429
5429
|
return t.startRow <= o.startRow && t.endRow >= o.endRow ? (
|
|
5430
5430
|
// 2
|
|
@@ -5459,13 +5459,13 @@ const Mn = Number.MAX_SAFE_INTEGER, Ke = (n) => {
|
|
|
5459
5459
|
};
|
|
5460
5460
|
function Il(n, e, t) {
|
|
5461
5461
|
const o = [];
|
|
5462
|
-
if (
|
|
5462
|
+
if (N.contains(e, t) && o.push({
|
|
5463
5463
|
type: Q.Delete
|
|
5464
|
-
}),
|
|
5464
|
+
}), N.contains(n, t)) {
|
|
5465
5465
|
o.push({
|
|
5466
5466
|
type: Q.Delete
|
|
5467
5467
|
});
|
|
5468
|
-
const s =
|
|
5468
|
+
const s = N.getRelativeRange(t, n), r = N.getPositionRange(s, e);
|
|
5469
5469
|
return [
|
|
5470
5470
|
{
|
|
5471
5471
|
type: Q.Set,
|
|
@@ -5480,7 +5480,7 @@ const vl = (n, e) => {
|
|
|
5480
5480
|
const t = (a = n.params) == null ? void 0 : a.range;
|
|
5481
5481
|
if (!t)
|
|
5482
5482
|
return [];
|
|
5483
|
-
const o = [], s =
|
|
5483
|
+
const o = [], s = Ot(Oe(t), Oe(e)), { step: r, length: i } = s;
|
|
5484
5484
|
return o.push({
|
|
5485
5485
|
type: Q.VerticalMove,
|
|
5486
5486
|
step: r,
|
|
@@ -5491,7 +5491,7 @@ const vl = (n, e) => {
|
|
|
5491
5491
|
const t = (a = n.params) == null ? void 0 : a.range;
|
|
5492
5492
|
if (!t)
|
|
5493
5493
|
return [];
|
|
5494
|
-
const o = [], s =
|
|
5494
|
+
const o = [], s = Ot(t, e), { step: r, length: i } = s;
|
|
5495
5495
|
return o.push({
|
|
5496
5496
|
type: Q.HorizontalMove,
|
|
5497
5497
|
step: r,
|
|
@@ -5502,7 +5502,7 @@ const vl = (n, e) => {
|
|
|
5502
5502
|
const t = (a = n.params) == null ? void 0 : a.range;
|
|
5503
5503
|
if (!t)
|
|
5504
5504
|
return [];
|
|
5505
|
-
const o = [], s =
|
|
5505
|
+
const o = [], s = Ot(Oe(t), Oe(e)), { step: r, length: i } = s;
|
|
5506
5506
|
return o.push({
|
|
5507
5507
|
type: Q.VerticalMove,
|
|
5508
5508
|
step: r,
|
|
@@ -5517,7 +5517,7 @@ const vl = (n, e) => {
|
|
|
5517
5517
|
...t,
|
|
5518
5518
|
startRow: t.startRow,
|
|
5519
5519
|
endRow: Number.POSITIVE_INFINITY
|
|
5520
|
-
}, r =
|
|
5520
|
+
}, r = N.subtract(e, s), i = N.getIntersects(s, e);
|
|
5521
5521
|
if (!i)
|
|
5522
5522
|
return [e];
|
|
5523
5523
|
const a = new Y();
|
|
@@ -5533,7 +5533,7 @@ const vl = (n, e) => {
|
|
|
5533
5533
|
const t = (a = n.params) == null ? void 0 : a.range;
|
|
5534
5534
|
if (!t)
|
|
5535
5535
|
return [];
|
|
5536
|
-
const o = [], s =
|
|
5536
|
+
const o = [], s = Ot(t, e), { step: r, length: i } = s;
|
|
5537
5537
|
return o.push({
|
|
5538
5538
|
type: Q.HorizontalMove,
|
|
5539
5539
|
step: r,
|
|
@@ -5548,7 +5548,7 @@ const vl = (n, e) => {
|
|
|
5548
5548
|
...t,
|
|
5549
5549
|
startColumn: t.startColumn,
|
|
5550
5550
|
endColumn: Number.POSITIVE_INFINITY
|
|
5551
|
-
}, r =
|
|
5551
|
+
}, r = N.subtract(e, s), i = N.getIntersects(s, e);
|
|
5552
5552
|
if (!i)
|
|
5553
5553
|
return [e];
|
|
5554
5554
|
const a = new Y();
|
|
@@ -5564,7 +5564,7 @@ const vl = (n, e) => {
|
|
|
5564
5564
|
const t = (r = n.params) == null ? void 0 : r.range;
|
|
5565
5565
|
if (!t)
|
|
5566
5566
|
return [];
|
|
5567
|
-
const o = [], s =
|
|
5567
|
+
const o = [], s = Nt(t, e);
|
|
5568
5568
|
if (!s)
|
|
5569
5569
|
o.push({ type: Q.Delete });
|
|
5570
5570
|
else {
|
|
@@ -5586,7 +5586,7 @@ const vl = (n, e) => {
|
|
|
5586
5586
|
endRow: t.endRow,
|
|
5587
5587
|
startColumn: t.startColumn,
|
|
5588
5588
|
endColumn: Number.POSITIVE_INFINITY
|
|
5589
|
-
}, s = t.endColumn - t.startColumn + 1, r =
|
|
5589
|
+
}, s = t.endColumn - t.startColumn + 1, r = N.getIntersects(t, e), i = N.subtract(e, o), a = N.getIntersects(o, e);
|
|
5590
5590
|
if (!r && !a)
|
|
5591
5591
|
return [e];
|
|
5592
5592
|
const u = new Y();
|
|
@@ -5604,7 +5604,7 @@ const vl = (n, e) => {
|
|
|
5604
5604
|
const t = (r = n.params) == null ? void 0 : r.range;
|
|
5605
5605
|
if (!t)
|
|
5606
5606
|
return [];
|
|
5607
|
-
const o = [], s =
|
|
5607
|
+
const o = [], s = Nt(Oe(t), Oe(e));
|
|
5608
5608
|
if (!s)
|
|
5609
5609
|
o.push({ type: Q.Delete });
|
|
5610
5610
|
else {
|
|
@@ -5625,7 +5625,7 @@ const vl = (n, e) => {
|
|
|
5625
5625
|
...t,
|
|
5626
5626
|
startRow: t.startRow,
|
|
5627
5627
|
endRow: Number.POSITIVE_INFINITY
|
|
5628
|
-
}, s = t.endRow - t.startRow + 1, r =
|
|
5628
|
+
}, s = t.endRow - t.startRow + 1, r = N.getIntersects(t, e), i = N.subtract(e, o), a = N.getIntersects(o, e);
|
|
5629
5629
|
if (!r && !a)
|
|
5630
5630
|
return [e];
|
|
5631
5631
|
const u = new Y();
|
|
@@ -5638,7 +5638,7 @@ const vl = (n, e) => {
|
|
|
5638
5638
|
u.setValue(d, h, 1);
|
|
5639
5639
|
});
|
|
5640
5640
|
}), at(u, (c) => c === 1);
|
|
5641
|
-
},
|
|
5641
|
+
}, Nl = (n, e) => {
|
|
5642
5642
|
var s;
|
|
5643
5643
|
const t = (s = n.ranges) != null ? s : [n.range], o = new Y();
|
|
5644
5644
|
return X.foreach(e, (r, i) => {
|
|
@@ -5647,7 +5647,7 @@ const vl = (n, e) => {
|
|
|
5647
5647
|
const i = r.startRow, u = r.endRow - i + 1;
|
|
5648
5648
|
o.removeRows(i, u);
|
|
5649
5649
|
}), at(o, (r) => r === 1);
|
|
5650
|
-
},
|
|
5650
|
+
}, Ol = (n, e) => {
|
|
5651
5651
|
const t = n.params, o = t.range.startRow, s = t.range.endRow - t.range.startRow + 1;
|
|
5652
5652
|
return e.startRow >= o ? [{
|
|
5653
5653
|
startRow: e.startRow + s,
|
|
@@ -5752,7 +5752,7 @@ const vl = (n, e) => {
|
|
|
5752
5752
|
}
|
|
5753
5753
|
}
|
|
5754
5754
|
return Dt(t, n);
|
|
5755
|
-
}, Ah = (n, e, t) => [It.id, vt.id].includes(e.id) || jr(e, t).some((r) =>
|
|
5755
|
+
}, Ah = (n, e, t) => [It.id, vt.id].includes(e.id) || jr(e, t).some((r) => N.intersects(r, n)) ? Rs(n, e) : n, Cs = (n, e) => {
|
|
5756
5756
|
let t = [];
|
|
5757
5757
|
switch (e.id) {
|
|
5758
5758
|
case W.DeleteRangeMoveLeftCommandId:
|
|
@@ -5766,7 +5766,7 @@ const vl = (n, e) => {
|
|
|
5766
5766
|
case W.InsertColCommandId:
|
|
5767
5767
|
return Dl(e, n);
|
|
5768
5768
|
case W.InsertRowCommandId:
|
|
5769
|
-
return
|
|
5769
|
+
return Ol(e, n);
|
|
5770
5770
|
case W.MoveColsCommandId:
|
|
5771
5771
|
return Rl(e, n);
|
|
5772
5772
|
case W.MoveRangeCommandId:
|
|
@@ -5780,11 +5780,11 @@ const vl = (n, e) => {
|
|
|
5780
5780
|
break;
|
|
5781
5781
|
}
|
|
5782
5782
|
case W.RemoveRowCommandId:
|
|
5783
|
-
return
|
|
5783
|
+
return Nl(e.params, n);
|
|
5784
5784
|
}
|
|
5785
5785
|
const o = Dt(t, n);
|
|
5786
5786
|
return o ? [o] : [];
|
|
5787
|
-
}, xh = (n, e, t) => [It.id, vt.id, Pt.id, Ko].includes(e.id) || jr(e, t).some((r) =>
|
|
5787
|
+
}, xh = (n, e, t) => [It.id, vt.id, Pt.id, Ko].includes(e.id) || jr(e, t).some((r) => N.intersects(r, n)) ? Cs(n, e) : n;
|
|
5788
5788
|
function Al(n, e) {
|
|
5789
5789
|
const { id: t, params: o } = e;
|
|
5790
5790
|
let s = {
|
|
@@ -5811,16 +5811,16 @@ function Al(n, e) {
|
|
|
5811
5811
|
), s.type = Q.HorizontalMove;
|
|
5812
5812
|
break;
|
|
5813
5813
|
case Me.id:
|
|
5814
|
-
s =
|
|
5814
|
+
s = Nt(o.range, n), s ? s.type = Q.HorizontalMove : s = { step: 0, length: 0, type: Q.Delete };
|
|
5815
5815
|
break;
|
|
5816
5816
|
case Te.id:
|
|
5817
|
-
s =
|
|
5817
|
+
s = Nt(Oe(o.range), Oe(n)), s ? s.type = Q.VerticalMove : s = { step: 0, length: 0, type: Q.Delete };
|
|
5818
5818
|
break;
|
|
5819
5819
|
case Ue.id:
|
|
5820
|
-
s =
|
|
5820
|
+
s = Ot(Oe(o.range), Oe(n)), s.type = Q.VerticalMove;
|
|
5821
5821
|
break;
|
|
5822
5822
|
case ke.id:
|
|
5823
|
-
s =
|
|
5823
|
+
s = Ot(o.range, n), s.type = Q.HorizontalMove;
|
|
5824
5824
|
break;
|
|
5825
5825
|
case wt.id:
|
|
5826
5826
|
{
|
|
@@ -6166,11 +6166,11 @@ class Hl extends ue {
|
|
|
6166
6166
|
if (e.id === Lt.id)
|
|
6167
6167
|
return;
|
|
6168
6168
|
const i = xl(e);
|
|
6169
|
-
if (i != null && i.some((a) =>
|
|
6169
|
+
if (i != null && i.some((a) => N.intersects(a, this._range)))
|
|
6170
6170
|
return;
|
|
6171
6171
|
}
|
|
6172
6172
|
const t = Al(this._range, e);
|
|
6173
|
-
if (t &&
|
|
6173
|
+
if (t && N.equals(t, this._range))
|
|
6174
6174
|
return !1;
|
|
6175
6175
|
const o = this._range;
|
|
6176
6176
|
this._range = t, this._callback(o, t);
|
|
@@ -6179,7 +6179,7 @@ class Hl extends ue {
|
|
|
6179
6179
|
let At = class extends ue {
|
|
6180
6180
|
constructor(e, t, o, s) {
|
|
6181
6181
|
super();
|
|
6182
|
-
R(this, "interceptor", new
|
|
6182
|
+
R(this, "interceptor", new Oo({ MERGE_REDO: Vl, MERGE_UNDO: Ll }));
|
|
6183
6183
|
R(this, "_watchRanges", /* @__PURE__ */ new Set());
|
|
6184
6184
|
R(this, "_refRangeManagerMap", /* @__PURE__ */ new Map());
|
|
6185
6185
|
R(this, "_serializer", Fl());
|
|
@@ -6331,7 +6331,7 @@ let At = class extends ue {
|
|
|
6331
6331
|
endColumn: +c.endColumn,
|
|
6332
6332
|
rangeType: c.rangeType && +c.rangeType
|
|
6333
6333
|
};
|
|
6334
|
-
e.some((h) =>
|
|
6334
|
+
e.some((h) => N.intersects(h, d)) && l && l.forEach((h) => {
|
|
6335
6335
|
i.add(h);
|
|
6336
6336
|
});
|
|
6337
6337
|
}), [...i];
|
|
@@ -6349,13 +6349,13 @@ let At = class extends ue {
|
|
|
6349
6349
|
R(this, "registerRefRange", (e, t, o, s) => {
|
|
6350
6350
|
const r = o || Ss(this._univerInstanceService), i = s || ws(this._univerInstanceService);
|
|
6351
6351
|
if (!r || !i)
|
|
6352
|
-
return
|
|
6352
|
+
return Ne(() => {
|
|
6353
6353
|
});
|
|
6354
6354
|
const a = vs(r, i), u = this._serializer.serialize(e);
|
|
6355
6355
|
let l = this._refRangeManagerMap.get(a);
|
|
6356
6356
|
l || (l = /* @__PURE__ */ new Map(), this._refRangeManagerMap.set(a, l));
|
|
6357
6357
|
const c = l.get(u);
|
|
6358
|
-
return c ? c.add(t) : l.set(u, /* @__PURE__ */ new Set([t])),
|
|
6358
|
+
return c ? c.add(t) : l.set(u, /* @__PURE__ */ new Set([t])), Ne(() => {
|
|
6359
6359
|
const d = l.get(u);
|
|
6360
6360
|
d && (d.delete(t), d.size || (l.delete(u), l.size || this._refRangeManagerMap.delete(a)));
|
|
6361
6361
|
});
|
|
@@ -6377,10 +6377,10 @@ let At = class extends ue {
|
|
|
6377
6377
|
}));
|
|
6378
6378
|
const a = new Hl(e, t, o, s, r);
|
|
6379
6379
|
this._watchRanges.add(a);
|
|
6380
|
-
const u =
|
|
6380
|
+
const u = Ne(() => {
|
|
6381
6381
|
this._watchRanges.delete(a), this._watchRanges.size === 0 && (i == null || i.dispose(), i = null);
|
|
6382
6382
|
}), l = this.disposeWithMe(u);
|
|
6383
|
-
return
|
|
6383
|
+
return Ne(() => {
|
|
6384
6384
|
l.dispose(), u.dispose();
|
|
6385
6385
|
});
|
|
6386
6386
|
}
|
|
@@ -6469,7 +6469,7 @@ let Wn = class extends ue {
|
|
|
6469
6469
|
constructor(e, t, o, s, r, i) {
|
|
6470
6470
|
super();
|
|
6471
6471
|
R(this, "disposableCollection", new Et());
|
|
6472
|
-
R(this, "interceptor", new
|
|
6472
|
+
R(this, "interceptor", new Oo({ MERGE_CELL_INTERCEPTOR_CHECK: Kl }));
|
|
6473
6473
|
this._commandService = e, this._refRangeService = t, this._univerInstanceService = o, this._injector = s, this._sheetInterceptorService = r, this._selectionManagerService = i, this._onRefRangeChange(), this._initCommandInterceptor(), this._commandExecutedListener();
|
|
6474
6474
|
}
|
|
6475
6475
|
_initCommandInterceptor() {
|
|
@@ -6485,7 +6485,7 @@ let Wn = class extends ue {
|
|
|
6485
6485
|
return { redos: [], undos: [] };
|
|
6486
6486
|
const a = i.getSheetId(), u = i.getConfig().mergeData, l = (o = e._selectionManagerService.getCurrentSelections()) == null ? void 0 : o.map((c) => c.range);
|
|
6487
6487
|
if (l && l.length > 0 && l.some(
|
|
6488
|
-
(d) => u.some((h) =>
|
|
6488
|
+
(d) => u.some((h) => N.intersects(h, d))
|
|
6489
6489
|
)) {
|
|
6490
6490
|
const d = {
|
|
6491
6491
|
unitId: r,
|
|
@@ -6510,7 +6510,7 @@ let Wn = class extends ue {
|
|
|
6510
6510
|
const u = P(this._univerInstanceService, { unitId: t, subUnitId: o });
|
|
6511
6511
|
if (!u)
|
|
6512
6512
|
return a;
|
|
6513
|
-
const { worksheet: l } = u, d = l.getMergeData().filter((h) => s.some((g) =>
|
|
6513
|
+
const { worksheet: l } = u, d = l.getMergeData().filter((h) => s.some((g) => N.intersects(h, g)));
|
|
6514
6514
|
return d.length ? (r.push({
|
|
6515
6515
|
id: oe.id,
|
|
6516
6516
|
params: {
|
|
@@ -6667,8 +6667,8 @@ let Wn = class extends ue {
|
|
|
6667
6667
|
const r = $e(s, o);
|
|
6668
6668
|
if (!r)
|
|
6669
6669
|
return this._handleNull();
|
|
6670
|
-
const i = r.getMergeData(), a = i.filter((g) =>
|
|
6671
|
-
(g) => !i.some((m) =>
|
|
6670
|
+
const i = r.getMergeData(), a = i.filter((g) => N.intersects(g, e.fromRange)), u = i.filter((g) => N.intersects(g, e.toRange)), l = a.map((g) => N.getRelativeRange(g, e.fromRange)).map((g) => N.getPositionRange(g, e.toRange)), c = zr(l).filter(
|
|
6671
|
+
(g) => !i.some((m) => N.equals(g, m))
|
|
6672
6672
|
), d = [
|
|
6673
6673
|
{
|
|
6674
6674
|
id: oe.id,
|
|
@@ -6807,11 +6807,11 @@ let Wn = class extends ue {
|
|
|
6807
6807
|
const r = $e(s, o);
|
|
6808
6808
|
if (!r)
|
|
6809
6809
|
return this._handleNull();
|
|
6810
|
-
const { range: i } = e, { startColumn: a, endColumn: u } = i, l = A.deepClone(r.getMergeData()).reduce((I, S) => (
|
|
6810
|
+
const { range: i } = e, { startColumn: a, endColumn: u } = i, l = A.deepClone(r.getMergeData()).reduce((I, S) => (N.intersects(i, S) && I.push(S), I), []);
|
|
6811
6811
|
if (l.length === 0)
|
|
6812
6812
|
return this._handleNull();
|
|
6813
6813
|
const c = A.deepClone(r.getMergeData()).reduce((I, S) => {
|
|
6814
|
-
if (
|
|
6814
|
+
if (N.intersects(i, S)) {
|
|
6815
6815
|
if (a <= S.startColumn && u >= S.endColumn)
|
|
6816
6816
|
return I;
|
|
6817
6817
|
a >= S.startColumn && u <= S.endColumn ? S.endColumn -= u - a + 1 : a < S.startColumn ? (S.startColumn = a, S.endColumn -= u - a + 1) : u > S.endColumn && (S.endColumn = a - 1), this._checkIsMergeCell(S) && I.push(S);
|
|
@@ -6841,11 +6841,11 @@ let Wn = class extends ue {
|
|
|
6841
6841
|
const i = $e(r, o);
|
|
6842
6842
|
if (!i)
|
|
6843
6843
|
return this._handleNull();
|
|
6844
|
-
const { startRow: a, endRow: u } = s, l = A.deepClone(i.getMergeData()).reduce((I, S) => (
|
|
6844
|
+
const { startRow: a, endRow: u } = s, l = A.deepClone(i.getMergeData()).reduce((I, S) => (N.intersects(s, S) && I.push(S), I), []);
|
|
6845
6845
|
if (l.length === 0)
|
|
6846
6846
|
return this._handleNull();
|
|
6847
6847
|
const c = A.deepClone(i.getMergeData()).reduce((I, S) => {
|
|
6848
|
-
if (
|
|
6848
|
+
if (N.intersects(s, S)) {
|
|
6849
6849
|
if (a <= S.startRow && u >= S.endRow)
|
|
6850
6850
|
return I;
|
|
6851
6851
|
a >= S.startRow && u <= S.endRow ? S.endRow -= u - a + 1 : a < S.startRow ? (S.startRow = a, S.endRow -= u - a + 1) : u > S.endRow && (S.endRow = a - 1), this._checkIsMergeCell(S) && I.push(S);
|
|
@@ -6878,7 +6878,7 @@ let Wn = class extends ue {
|
|
|
6878
6878
|
const i = e.range, a = r.getMaxColumns() - 1, u = r.getMergeData(), l = [], c = [];
|
|
6879
6879
|
u.forEach((f) => {
|
|
6880
6880
|
const { startRow: C, endRow: p, startColumn: w, endColumn: I } = i;
|
|
6881
|
-
if (
|
|
6881
|
+
if (N.intersects(
|
|
6882
6882
|
{
|
|
6883
6883
|
startRow: C,
|
|
6884
6884
|
startColumn: w,
|
|
@@ -6886,7 +6886,7 @@ let Wn = class extends ue {
|
|
|
6886
6886
|
endColumn: a
|
|
6887
6887
|
},
|
|
6888
6888
|
f
|
|
6889
|
-
) && (l.push(f),
|
|
6889
|
+
) && (l.push(f), N.contains(
|
|
6890
6890
|
{
|
|
6891
6891
|
startRow: C,
|
|
6892
6892
|
startColumn: w,
|
|
@@ -6949,9 +6949,9 @@ let Wn = class extends ue {
|
|
|
6949
6949
|
return this._handleNull();
|
|
6950
6950
|
const i = e.range, a = r.getMaxRows() - 1, u = r.getMergeData(), l = [], c = [];
|
|
6951
6951
|
u.forEach((I) => {
|
|
6952
|
-
const { startRow: S, startColumn: y, endColumn: b, endRow:
|
|
6953
|
-
if (
|
|
6954
|
-
const U =
|
|
6952
|
+
const { startRow: S, startColumn: y, endColumn: b, endRow: O } = i;
|
|
6953
|
+
if (N.intersects({ startRow: S, startColumn: y, endRow: a, endColumn: b }, I) && (l.push(I), N.contains({ startRow: S, startColumn: y, endRow: a, endColumn: b }, I))) {
|
|
6954
|
+
const U = O - S + 1;
|
|
6955
6955
|
c.push({
|
|
6956
6956
|
startRow: I.startRow + U,
|
|
6957
6957
|
startColumn: I.startColumn,
|
|
@@ -7006,9 +7006,9 @@ let Wn = class extends ue {
|
|
|
7006
7006
|
return this._handleNull();
|
|
7007
7007
|
const i = e.range, a = r.getMaxRows() - 1, u = r.getMergeData(), l = [], c = [];
|
|
7008
7008
|
u.forEach((I) => {
|
|
7009
|
-
const { startRow: S, startColumn: y, endColumn: b, endRow:
|
|
7010
|
-
if (
|
|
7011
|
-
const U =
|
|
7009
|
+
const { startRow: S, startColumn: y, endColumn: b, endRow: O } = i;
|
|
7010
|
+
if (N.intersects({ startRow: S, startColumn: y, endRow: a, endColumn: b }, I) && (l.push(I), N.contains({ startRow: S, startColumn: y, endRow: a, endColumn: b }, I))) {
|
|
7011
|
+
const U = O - S + 1, D = N.moveVertical(I, -U);
|
|
7012
7012
|
c.push(D);
|
|
7013
7013
|
}
|
|
7014
7014
|
});
|
|
@@ -7059,7 +7059,7 @@ let Wn = class extends ue {
|
|
|
7059
7059
|
const i = e.range, a = r.getMaxColumns() - 1, u = r.getMergeData(), l = [], c = [];
|
|
7060
7060
|
u.forEach((f) => {
|
|
7061
7061
|
const { startRow: C, endRow: p, startColumn: w, endColumn: I } = i;
|
|
7062
|
-
if (
|
|
7062
|
+
if (N.intersects(
|
|
7063
7063
|
{
|
|
7064
7064
|
startRow: C,
|
|
7065
7065
|
startColumn: w,
|
|
@@ -7067,7 +7067,7 @@ let Wn = class extends ue {
|
|
|
7067
7067
|
endColumn: a
|
|
7068
7068
|
},
|
|
7069
7069
|
f
|
|
7070
|
-
) && (l.push(f),
|
|
7070
|
+
) && (l.push(f), N.contains(
|
|
7071
7071
|
{
|
|
7072
7072
|
startRow: C,
|
|
7073
7073
|
startColumn: w,
|
|
@@ -7132,7 +7132,7 @@ let Wn = class extends ue {
|
|
|
7132
7132
|
const { sourceRange: s, targetRange: r } = e.params, i = s.startColumn === r.startColumn && s.endColumn === r.endColumn, a = i ? s.endRow - s.startRow + 1 : s.endColumn - s.startColumn + 1, u = i ? s.startRow : s.startColumn, l = i ? r.startRow : r.startColumn, c = o.getConfig().mergeData, d = [];
|
|
7133
7133
|
c.forEach((f) => {
|
|
7134
7134
|
let { startRow: C, endRow: p, startColumn: w, endColumn: I, rangeType: S } = f;
|
|
7135
|
-
|
|
7135
|
+
N.intersects(f, s) || (i ? u < C && l > p ? (C -= a, p -= a) : u > p && l <= C && (C += a, p += a) : u < w && l > I ? (w -= a, I -= a) : u > I && l <= w && (w += a, I += a)), f.startRow === f.endRow && f.startColumn === f.endColumn || d.push({ startRow: C, endRow: p, startColumn: w, endColumn: I, rangeType: S });
|
|
7136
7136
|
}), o.setMergeData(d), this.disposableCollection.dispose();
|
|
7137
7137
|
const { unitId: h, subUnitId: g } = e.params, m = (f) => this.refRangeHandle(f, h, g);
|
|
7138
7138
|
d.forEach((f) => {
|
|
@@ -7296,7 +7296,7 @@ function Hh(n, e, t, o, s) {
|
|
|
7296
7296
|
const r = n.get(M), i = P(r, { unitId: e, subUnitId: t });
|
|
7297
7297
|
if (!i) return;
|
|
7298
7298
|
const { worksheet: a } = i;
|
|
7299
|
-
if (a.getMergeData().some((d) => o.some((h) =>
|
|
7299
|
+
if (a.getMergeData().some((d) => o.some((h) => N.intersects(h, d))))
|
|
7300
7300
|
throw new Error("The ranges to be merged overlap with the existing merged cells");
|
|
7301
7301
|
n.get(E).executeCommand(go.id, {
|
|
7302
7302
|
unitId: e,
|
|
@@ -7426,7 +7426,7 @@ const Mt = {
|
|
|
7426
7426
|
type: v.COMMAND,
|
|
7427
7427
|
id: "sheet.command.set-worksheet-range-theme-style",
|
|
7428
7428
|
handler: (n, e) => {
|
|
7429
|
-
const t = n.get(E), o = n.get(V), { unitId: s } = e, r =
|
|
7429
|
+
const t = n.get(E), o = n.get(V), { unitId: s } = e, r = Oa(n, e);
|
|
7430
7430
|
return t.syncExecuteCommand(tn.id, e) ? (o.pushUndoRedo({
|
|
7431
7431
|
unitID: s,
|
|
7432
7432
|
undoMutations: [{ id: nn.id, params: r }],
|
|
@@ -7752,7 +7752,7 @@ const oc = {
|
|
|
7752
7752
|
unitId: l,
|
|
7753
7753
|
subUnitId: u,
|
|
7754
7754
|
ranges: i
|
|
7755
|
-
}, g = c.getConfig().mergeData.filter((H) => i.some((F) =>
|
|
7755
|
+
}, g = c.getConfig().mergeData.filter((H) => i.some((F) => N.intersects(F, H)));
|
|
7756
7756
|
if (!g.length) return !1;
|
|
7757
7757
|
const m = ye(
|
|
7758
7758
|
n,
|
|
@@ -7774,7 +7774,7 @@ const oc = {
|
|
|
7774
7774
|
unitId: l,
|
|
7775
7775
|
subUnitId: u,
|
|
7776
7776
|
cellValue: y.redoParams.getMatrix()
|
|
7777
|
-
},
|
|
7777
|
+
}, O = {
|
|
7778
7778
|
unitId: l,
|
|
7779
7779
|
subUnitId: u,
|
|
7780
7780
|
cellValue: y.undoParams.getMatrix()
|
|
@@ -7784,7 +7784,7 @@ const oc = {
|
|
|
7784
7784
|
{ id: ie.id, params: { selections: p } }
|
|
7785
7785
|
], T = [
|
|
7786
7786
|
{ id: ne.id, params: m },
|
|
7787
|
-
{ id: ee.id, params:
|
|
7787
|
+
{ id: ee.id, params: O },
|
|
7788
7788
|
{ id: ie.id, params: { selections: C } }
|
|
7789
7789
|
];
|
|
7790
7790
|
return L(k, o) ? (s.pushUndoRedo({
|
|
@@ -7812,7 +7812,7 @@ class Ht {
|
|
|
7812
7812
|
R(this, "_borderInfo", {
|
|
7813
7813
|
type: de.ALL,
|
|
7814
7814
|
color: "#000000",
|
|
7815
|
-
style:
|
|
7815
|
+
style: Ns.THIN,
|
|
7816
7816
|
activeBorderType: !1
|
|
7817
7817
|
});
|
|
7818
7818
|
R(this, "_borderInfo$", new gt(this._borderInfo));
|
|
@@ -7931,7 +7931,7 @@ function hc(n, e, t) {
|
|
|
7931
7931
|
leftRangeOut: S,
|
|
7932
7932
|
bottomRangeOut: y,
|
|
7933
7933
|
rightRangeOut: b,
|
|
7934
|
-
topRange:
|
|
7934
|
+
topRange: O,
|
|
7935
7935
|
leftRange: k,
|
|
7936
7936
|
bottomRange: T,
|
|
7937
7937
|
rightRange: U
|
|
@@ -7959,7 +7959,7 @@ function hc(n, e, t) {
|
|
|
7959
7959
|
leftRangeOut: S,
|
|
7960
7960
|
bottomRangeOut: y,
|
|
7961
7961
|
rightRangeOut: b,
|
|
7962
|
-
topRange:
|
|
7962
|
+
topRange: O,
|
|
7963
7963
|
leftRange: k,
|
|
7964
7964
|
bottomRange: T,
|
|
7965
7965
|
rightRange: U,
|
|
@@ -8045,7 +8045,7 @@ const fc = (n) => {
|
|
|
8045
8045
|
};
|
|
8046
8046
|
e && (m(d, { b: null }), m(a, { t: A.deepClone(r) }, !0)), s && (m(c, { t: null }), m(i, { b: A.deepClone(r) }, !0)), t && (m(h, { r: null }), m(u, { l: A.deepClone(r) }, !0)), o && (m(g, { l: null }), m(l, { r: A.deepClone(r) }, !0));
|
|
8047
8047
|
}, Rc = (n) => {
|
|
8048
|
-
const { range: e, worksheet: t, mr: o, top: s, bottom: r, left: i, right: a, vertical: u, horizontal: l, tl_br: c, tl_bc: d, tl_mr: h, bl_tr: g, ml_tr: m, bc_tr: f, topRange: C, bottomRange: p, leftRange: w, rightRange: I, topRangeOut: S, bottomRangeOut: y, leftRangeOut: b, rightRangeOut:
|
|
8048
|
+
const { range: e, worksheet: t, mr: o, top: s, bottom: r, left: i, right: a, vertical: u, horizontal: l, tl_br: c, tl_bc: d, tl_mr: h, bl_tr: g, ml_tr: m, bc_tr: f, topRange: C, bottomRange: p, leftRange: w, rightRange: I, topRangeOut: S, bottomRangeOut: y, leftRangeOut: b, rightRangeOut: O } = n, k = (T, U, D) => {
|
|
8049
8049
|
Zo(n, T, U, D);
|
|
8050
8050
|
};
|
|
8051
8051
|
!s && !r && !i && !a && !u && !l && !c && !d && !h && !g && !m && !f && (Vn(e, (T, U) => {
|
|
@@ -8118,7 +8118,7 @@ const fc = (n) => {
|
|
|
8118
8118
|
});
|
|
8119
8119
|
}
|
|
8120
8120
|
}
|
|
8121
|
-
}), k(S, { b: null }), k(C, { t: null }, !0), k(y, { t: null }), k(p, { b: null }, !0), k(b, { r: null }), k(w, { l: null }, !0), k(
|
|
8121
|
+
}), k(S, { b: null }), k(C, { t: null }, !0), k(y, { t: null }), k(p, { b: null }, !0), k(b, { r: null }), k(w, { l: null }, !0), k(O, { l: null }), k(I, { r: null }, !0), k(e, { tl_br: null }, !0), k(e, { tl_bc: null }, !0), k(e, { tl_mr: null }, !0), k(e, { bl_tr: null }, !0), k(e, { ml_tr: null }, !0), k(e, { bc_tr: null }, !0));
|
|
8122
8122
|
}, wn = {
|
|
8123
8123
|
id: "sheet.command.set-border",
|
|
8124
8124
|
type: v.COMMAND,
|
|
@@ -8609,7 +8609,7 @@ const Xr = {
|
|
|
8609
8609
|
type: v.COMMAND,
|
|
8610
8610
|
id: "sheet.command.set-rows-hidden",
|
|
8611
8611
|
handler: (n, e) => {
|
|
8612
|
-
var w, I, S, y, b,
|
|
8612
|
+
var w, I, S, y, b, O;
|
|
8613
8613
|
const t = n.get(z), o = n.get(E), s = n.get(V), r = n.get(M), i = n.get(G);
|
|
8614
8614
|
let a = (w = e == null ? void 0 : e.ranges) != null && w.length ? e.ranges : (I = t.getCurrentSelections()) == null ? void 0 : I.map((k) => k.range).filter((k) => k.rangeType === j.ROW);
|
|
8615
8615
|
if (!(a != null && a.length)) return !1;
|
|
@@ -8654,7 +8654,7 @@ const Xr = {
|
|
|
8654
8654
|
...k.undos
|
|
8655
8655
|
],
|
|
8656
8656
|
redoMutations: [
|
|
8657
|
-
...(
|
|
8657
|
+
...(O = C.preRedos) != null ? O : [],
|
|
8658
8658
|
{ id: Tt.id, params: h },
|
|
8659
8659
|
{ id: ie.id, params: g },
|
|
8660
8660
|
...C.redos,
|
|
@@ -8752,14 +8752,14 @@ const Pc = ["ff", "fs", "tr", "tb"], Ce = {
|
|
|
8752
8752
|
});
|
|
8753
8753
|
S = F, y = K;
|
|
8754
8754
|
}
|
|
8755
|
-
const { undos: b, redos:
|
|
8755
|
+
const { undos: b, redos: O } = I.onCommandExecute({
|
|
8756
8756
|
id: Ce.id,
|
|
8757
8757
|
params: e
|
|
8758
|
-
}), k = L([...
|
|
8758
|
+
}), k = L([...O, ...y], l);
|
|
8759
8759
|
return w && k.result ? (c.pushUndoRedo({
|
|
8760
8760
|
unitID: f.unitId,
|
|
8761
8761
|
undoMutations: [{ id: ee.id, params: p }, ...b, ...S],
|
|
8762
|
-
redoMutations: [{ id: ee.id, params: f }, ...
|
|
8762
|
+
redoMutations: [{ id: ee.id, params: f }, ...O, ...y]
|
|
8763
8763
|
}), !0) : !1;
|
|
8764
8764
|
}
|
|
8765
8765
|
}, Bh = {
|
|
@@ -8889,7 +8889,7 @@ const Pc = ["ff", "fs", "tr", "tb"], Ce = {
|
|
|
8889
8889
|
};
|
|
8890
8890
|
return t.syncExecuteCommand(Ce.id, o);
|
|
8891
8891
|
}
|
|
8892
|
-
},
|
|
8892
|
+
}, Nc = {
|
|
8893
8893
|
type: v.COMMAND,
|
|
8894
8894
|
id: "sheet.command.set-text-color",
|
|
8895
8895
|
handler: (n, e) => {
|
|
@@ -8905,7 +8905,7 @@ const Pc = ["ff", "fs", "tr", "tb"], Ce = {
|
|
|
8905
8905
|
};
|
|
8906
8906
|
return t.syncExecuteCommand(Ce.id, o);
|
|
8907
8907
|
}
|
|
8908
|
-
},
|
|
8908
|
+
}, Oc = {
|
|
8909
8909
|
type: v.COMMAND,
|
|
8910
8910
|
id: "sheet.command.reset-text-color",
|
|
8911
8911
|
handler: (n) => {
|
|
@@ -9123,7 +9123,7 @@ const Pc = ["ff", "fs", "tr", "tb"], Ce = {
|
|
|
9123
9123
|
} else C === j.COLUMN ? p = {
|
|
9124
9124
|
subUnitId: l,
|
|
9125
9125
|
unitId: u,
|
|
9126
|
-
ranges: f.map((J) =>
|
|
9126
|
+
ranges: f.map((J) => N.clone(J.range)),
|
|
9127
9127
|
colWidth: g
|
|
9128
9128
|
} : p = {
|
|
9129
9129
|
subUnitId: l,
|
|
@@ -9140,7 +9140,7 @@ const Pc = ["ff", "fs", "tr", "tb"], Ce = {
|
|
|
9140
9140
|
};
|
|
9141
9141
|
const w = n.get(rt).getSkeleton(u, l), { suitableRanges: I, remainingRanges: S } = Sn(p.ranges, w);
|
|
9142
9142
|
Jo(I, a);
|
|
9143
|
-
const y = n.get(G), { undos: b, redos:
|
|
9143
|
+
const y = n.get(G), { undos: b, redos: O } = y.onCommandExecute({
|
|
9144
9144
|
id: Ln.id,
|
|
9145
9145
|
params: p
|
|
9146
9146
|
}), k = qs(
|
|
@@ -9158,18 +9158,18 @@ const Pc = ["ff", "fs", "tr", "tb"], Ce = {
|
|
|
9158
9158
|
}), { undos: H, redos: F } = n.get(G).afterCommandExecute({
|
|
9159
9159
|
id: Ln.id,
|
|
9160
9160
|
params: p
|
|
9161
|
-
}), K = L([...
|
|
9161
|
+
}), K = L([...O, ...F, ...D], s);
|
|
9162
9162
|
return T && K.result && r.pushUndoRedo({
|
|
9163
9163
|
unitID: u,
|
|
9164
9164
|
undoMutations: [{ id: mt.id, params: k }, ...b, ...H, ...U],
|
|
9165
|
-
redoMutations: [{ id: mt.id, params: p }, ...
|
|
9165
|
+
redoMutations: [{ id: mt.id, params: p }, ...O, ...F, ...D]
|
|
9166
9166
|
}), !0;
|
|
9167
9167
|
}
|
|
9168
9168
|
}, Hn = {
|
|
9169
9169
|
type: v.COMMAND,
|
|
9170
9170
|
id: "sheet.command.set-worksheet-col-width",
|
|
9171
9171
|
handler: (n, e) => {
|
|
9172
|
-
var y, b,
|
|
9172
|
+
var y, b, O, k;
|
|
9173
9173
|
const t = n.get(z), o = n.get(E), s = n.get(V), r = n.get(G), i = (y = e == null ? void 0 : e.ranges) != null && y.length ? e.ranges : (b = t.getCurrentSelections()) == null ? void 0 : b.map((T) => T.range);
|
|
9174
9174
|
if (!(i != null && i.length)) return !1;
|
|
9175
9175
|
const a = P(n.get(M), e);
|
|
@@ -9199,7 +9199,7 @@ const Pc = ["ff", "fs", "tr", "tb"], Ce = {
|
|
|
9199
9199
|
return L(T.redos, o), s.pushUndoRedo({
|
|
9200
9200
|
unitID: l,
|
|
9201
9201
|
undoMutations: [
|
|
9202
|
-
...(
|
|
9202
|
+
...(O = I.preUndos) != null ? O : [],
|
|
9203
9203
|
{ id: mt.id, params: f },
|
|
9204
9204
|
...I.undos,
|
|
9205
9205
|
...T.undos,
|
|
@@ -9625,7 +9625,7 @@ let Bn = class extends $s {
|
|
|
9625
9625
|
toJson: n,
|
|
9626
9626
|
parseJson: e,
|
|
9627
9627
|
pluginName: Xc,
|
|
9628
|
-
businesses: [
|
|
9628
|
+
businesses: [On.UNIVER_SHEET],
|
|
9629
9629
|
onLoad: (t, o) => {
|
|
9630
9630
|
this._worksheetProtectionRuleModel.fromObject(o), Object.keys(o).forEach((s) => {
|
|
9631
9631
|
be().forEach((r) => {
|
|
@@ -9668,7 +9668,7 @@ let Bn = class extends $s {
|
|
|
9668
9668
|
toJson: n,
|
|
9669
9669
|
parseJson: e,
|
|
9670
9670
|
pluginName: Zc,
|
|
9671
|
-
businesses: [
|
|
9671
|
+
businesses: [On.UNIVER_SHEET],
|
|
9672
9672
|
onLoad: (t, o) => {
|
|
9673
9673
|
this._worksheetProtectionPointRuleModel.fromObject(o), Object.keys(o).forEach((s) => {
|
|
9674
9674
|
He().forEach((r) => {
|
|
@@ -9827,7 +9827,7 @@ const es = {
|
|
|
9827
9827
|
} else f === j.ROW ? C = {
|
|
9828
9828
|
subUnitId: a,
|
|
9829
9829
|
unitId: u,
|
|
9830
|
-
ranges: m.map((D) =>
|
|
9830
|
+
ranges: m.map((D) => N.clone(D.range)),
|
|
9831
9831
|
rowHeight: h
|
|
9832
9832
|
} : C = {
|
|
9833
9833
|
subUnitId: a,
|
|
@@ -9850,7 +9850,7 @@ const es = {
|
|
|
9850
9850
|
}, I = Wo(w, i), S = n.get(E), y = n.get(V), b = s.onCommandExecute({
|
|
9851
9851
|
id: jn.id,
|
|
9852
9852
|
params: C
|
|
9853
|
-
}),
|
|
9853
|
+
}), O = L([
|
|
9854
9854
|
{
|
|
9855
9855
|
id: nt.id,
|
|
9856
9856
|
params: C
|
|
@@ -9860,7 +9860,7 @@ const es = {
|
|
|
9860
9860
|
params: w
|
|
9861
9861
|
}
|
|
9862
9862
|
], S), k = L([...b.redos], S);
|
|
9863
|
-
if (
|
|
9863
|
+
if (O.result && k.result) {
|
|
9864
9864
|
const D = s.afterCommandExecute({
|
|
9865
9865
|
id: jn.id,
|
|
9866
9866
|
params: C
|
|
@@ -9903,7 +9903,7 @@ const es = {
|
|
|
9903
9903
|
// eslint-disable-next-line max-lines-per-function
|
|
9904
9904
|
handler: (n, e) => {
|
|
9905
9905
|
var I, S, y, b;
|
|
9906
|
-
const t = n.get(z), o = n.get(E), s = n.get(V), r = n.get(M), i = n.get(G), a = (I = e == null ? void 0 : e.ranges) != null && I.length ? e.ranges : (S = t.getCurrentSelections()) == null ? void 0 : S.map((
|
|
9906
|
+
const t = n.get(z), o = n.get(E), s = n.get(V), r = n.get(M), i = n.get(G), a = (I = e == null ? void 0 : e.ranges) != null && I.length ? e.ranges : (S = t.getCurrentSelections()) == null ? void 0 : S.map((O) => O.range);
|
|
9907
9907
|
if (!(a != null && a.length))
|
|
9908
9908
|
return !1;
|
|
9909
9909
|
const u = P(r, e);
|
|
@@ -9932,11 +9932,11 @@ const es = {
|
|
|
9932
9932
|
params: h
|
|
9933
9933
|
}), w = L([...p.redos], o);
|
|
9934
9934
|
if (C.result && w.result) {
|
|
9935
|
-
const
|
|
9935
|
+
const O = i.afterCommandExecute({
|
|
9936
9936
|
id: zn.id,
|
|
9937
9937
|
params: h
|
|
9938
9938
|
});
|
|
9939
|
-
return L(
|
|
9939
|
+
return L(O.redos, o), s.pushUndoRedo({
|
|
9940
9940
|
unitID: l,
|
|
9941
9941
|
undoMutations: [
|
|
9942
9942
|
...(y = p.preRedos) != null ? y : [],
|
|
@@ -9949,7 +9949,7 @@ const es = {
|
|
|
9949
9949
|
params: f
|
|
9950
9950
|
},
|
|
9951
9951
|
...p.undos,
|
|
9952
|
-
...
|
|
9952
|
+
...O.undos
|
|
9953
9953
|
],
|
|
9954
9954
|
redoMutations: [
|
|
9955
9955
|
...(b = p.preRedos) != null ? b : [],
|
|
@@ -9962,7 +9962,7 @@ const es = {
|
|
|
9962
9962
|
params: m
|
|
9963
9963
|
},
|
|
9964
9964
|
...p.redos,
|
|
9965
|
-
...
|
|
9965
|
+
...O.redos
|
|
9966
9966
|
]
|
|
9967
9967
|
}), !0;
|
|
9968
9968
|
}
|
|
@@ -9972,10 +9972,10 @@ const es = {
|
|
|
9972
9972
|
type: v.COMMAND,
|
|
9973
9973
|
id: "sheet.command.set-row-is-auto-height",
|
|
9974
9974
|
handler: (n, e) => {
|
|
9975
|
-
var
|
|
9975
|
+
var O, k;
|
|
9976
9976
|
const t = n.get(E), o = n.get(V), s = n.get(z), r = n.get(M), i = P(r, e);
|
|
9977
9977
|
if (!i) return !1;
|
|
9978
|
-
const { unitId: a, subUnitId: u, worksheet: l } = i, c = (
|
|
9978
|
+
const { unitId: a, subUnitId: u, worksheet: l } = i, c = (O = e == null ? void 0 : e.ranges) != null && O.length ? e.ranges : (k = s.getCurrentSelections()) == null ? void 0 : k.map((T) => T.range);
|
|
9979
9979
|
if (!(c != null && c.length))
|
|
9980
9980
|
return !1;
|
|
9981
9981
|
const d = {
|
|
@@ -10077,11 +10077,11 @@ const es = {
|
|
|
10077
10077
|
endRow: m,
|
|
10078
10078
|
startColumn: w,
|
|
10079
10079
|
endColumn: w + C
|
|
10080
|
-
},
|
|
10080
|
+
}, O = new Y();
|
|
10081
10081
|
for (let D = b.startRow; D <= b.endRow; D++)
|
|
10082
10082
|
for (let H = b.startColumn; H <= b.endColumn; H++) {
|
|
10083
10083
|
const F = f[D - b.startRow];
|
|
10084
|
-
H === 0 && (F == null ? void 0 : F.length) === 1 ?
|
|
10084
|
+
H === 0 && (F == null ? void 0 : F.length) === 1 ? O.setValue(D, H, g.getCell(D, H)) : O.setValue(D, H, {
|
|
10085
10085
|
v: (F == null ? void 0 : F[H - b.startColumn]) || null,
|
|
10086
10086
|
p: null,
|
|
10087
10087
|
f: null,
|
|
@@ -10092,7 +10092,7 @@ const es = {
|
|
|
10092
10092
|
const k = {
|
|
10093
10093
|
unitId: t,
|
|
10094
10094
|
subUnitId: o,
|
|
10095
|
-
cellValue:
|
|
10095
|
+
cellValue: O.clone()
|
|
10096
10096
|
}, T = Ae(n, k);
|
|
10097
10097
|
return I.push({
|
|
10098
10098
|
id: ee.id,
|
|
@@ -10118,13 +10118,13 @@ const es = {
|
|
|
10118
10118
|
const h = l.getCell(s, r);
|
|
10119
10119
|
if (!(h != null && h.p))
|
|
10120
10120
|
return !1;
|
|
10121
|
-
const g = A.deepClone(h.p), m = new Pi(g), f =
|
|
10121
|
+
const g = A.deepClone(h.p), m = new Pi(g), f = Ni.paragraph.bullet.toggleChecklist({
|
|
10122
10122
|
document: m,
|
|
10123
10123
|
paragraphIndex: i
|
|
10124
10124
|
});
|
|
10125
10125
|
if (!f)
|
|
10126
10126
|
return !1;
|
|
10127
|
-
|
|
10127
|
+
Oi.apply(m.getBody(), f.serialize());
|
|
10128
10128
|
const C = {
|
|
10129
10129
|
unitId: t,
|
|
10130
10130
|
subUnitId: o,
|
|
@@ -10699,7 +10699,7 @@ let Jn = class extends ue {
|
|
|
10699
10699
|
if (!t)
|
|
10700
10700
|
return !1;
|
|
10701
10701
|
const { worksheet: o, unitId: s, subUnitId: r } = t, i = A.deepClone((l = this._selectionManagerService.getCurrentLastSelection()) == null ? void 0 : l.range);
|
|
10702
|
-
return !(!i || (e === "top" || e === "bottom" ? i.endRow = o.getRowCount() - 1 : (e === "left" || e === "right") && (i.endColumn = o.getColumnCount() - 1), this._rangeProtectionRuleModel.getSubunitRuleList(s, r).map((c) => c.ranges).flat().some((c) =>
|
|
10702
|
+
return !(!i || (e === "top" || e === "bottom" ? i.endRow = o.getRowCount() - 1 : (e === "left" || e === "right") && (i.endColumn = o.getColumnCount() - 1), this._rangeProtectionRuleModel.getSubunitRuleList(s, r).map((c) => c.ranges).flat().some((c) => N.getIntersects(i, c))));
|
|
10703
10703
|
}
|
|
10704
10704
|
_permissionCheckByWorksheetCommand(e, t, o) {
|
|
10705
10705
|
var l, c;
|
|
@@ -10727,8 +10727,8 @@ let Jn = class extends ue {
|
|
|
10727
10727
|
const w = new p(s, r);
|
|
10728
10728
|
return ((y = (S = this._permissionService.getPermissionPoint(w.id)) == null ? void 0 : S.value) != null ? y : !1) === !1;
|
|
10729
10729
|
}) === !0 || d && d.some((p) => {
|
|
10730
|
-
var b,
|
|
10731
|
-
const w = (
|
|
10730
|
+
var b, O, k, T, U;
|
|
10731
|
+
const w = (O = (b = o.getCell(a, u)) == null ? void 0 : b.selectionProtection) == null ? void 0 : O[0];
|
|
10732
10732
|
if (!(w != null && w.ruleId))
|
|
10733
10733
|
return !1;
|
|
10734
10734
|
const I = (k = this._rangeProtectionRuleModel.getRule(s, r, w.ruleId)) == null ? void 0 : k.permissionId;
|
|
@@ -10750,7 +10750,7 @@ let Jn = class extends ue {
|
|
|
10750
10750
|
return !1;
|
|
10751
10751
|
const { workbookTypes: l, worksheetTypes: c, rangeTypes: d } = e, h = [];
|
|
10752
10752
|
return l && h.push(...l.map((m) => new m(o).id)), c && h.push(...c.map((m) => new m(o, s).id)), d && this._rangeProtectionRuleModel.getSubunitRuleList(o, s).forEach((m) => {
|
|
10753
|
-
u.some((C) => m.ranges.some((p) =>
|
|
10753
|
+
u.some((C) => m.ranges.some((p) => N.intersects(p, C))) && h.push(...d.map((C) => new C(o, s, m.permissionId).id));
|
|
10754
10754
|
}), h.length ? this._permissionService.composePermission(h).every((m) => m.value) : !0;
|
|
10755
10755
|
}
|
|
10756
10756
|
_permissionCheckByMoveCommand(e) {
|
|
@@ -10759,7 +10759,7 @@ let Jn = class extends ue {
|
|
|
10759
10759
|
return !1;
|
|
10760
10760
|
const { worksheet: o, unitId: s, subUnitId: r } = t, i = e.toRange;
|
|
10761
10761
|
i.endRow === o.getRowCount() - 1 ? i.endColumn = i.startColumn : i.endRow = i.startRow;
|
|
10762
|
-
const a = this._rangeProtectionRuleModel.getSubunitRuleList(s, r).reduce((u, l) => [...u, ...l.ranges], []).filter((u) =>
|
|
10762
|
+
const a = this._rangeProtectionRuleModel.getSubunitRuleList(s, r).reduce((u, l) => [...u, ...l.ranges], []).filter((u) => N.intersects(u, i));
|
|
10763
10763
|
return a.length > 0 ? !1 : (a.forEach((u) => {
|
|
10764
10764
|
var l, c;
|
|
10765
10765
|
for (let d = u.startRow; d <= u.endRow; d++)
|
|
@@ -10774,7 +10774,7 @@ let Jn = class extends ue {
|
|
|
10774
10774
|
const t = P(this._univerInstanceService);
|
|
10775
10775
|
if (!t)
|
|
10776
10776
|
return !1;
|
|
10777
|
-
const { worksheet: o, unitId: s, subUnitId: r } = t, i = e.toRange, a = this._rangeProtectionRuleModel.getSubunitRuleList(s, r).reduce((u, l) => [...u, ...l.ranges], []).filter((u) =>
|
|
10777
|
+
const { worksheet: o, unitId: s, subUnitId: r } = t, i = e.toRange, a = this._rangeProtectionRuleModel.getSubunitRuleList(s, r).reduce((u, l) => [...u, ...l.ranges], []).filter((u) => N.intersects(u, i));
|
|
10778
10778
|
return a.length > 0 ? !1 : (a.forEach((u) => {
|
|
10779
10779
|
var l, c;
|
|
10780
10780
|
for (let d = u.startRow; d <= u.endRow; d++)
|
|
@@ -10806,9 +10806,9 @@ let Jn = class extends ue {
|
|
|
10806
10806
|
const I = d.getSheetBySheetName(w.sheetName);
|
|
10807
10807
|
if (!I)
|
|
10808
10808
|
return !0;
|
|
10809
|
-
const { startRow: S, endRow: y, startColumn: b, endColumn:
|
|
10809
|
+
const { startRow: S, endRow: y, startColumn: b, endColumn: O } = w.range;
|
|
10810
10810
|
for (let k = S; k <= y; k++)
|
|
10811
|
-
for (let T = b; T <=
|
|
10811
|
+
for (let T = b; T <= O; T++) {
|
|
10812
10812
|
const U = (a = (i = I.getCell(k, T)) == null ? void 0 : i.selectionProtection) == null ? void 0 : a[0];
|
|
10813
10813
|
if ((U == null ? void 0 : U[_.View]) === !1)
|
|
10814
10814
|
return !1;
|
|
@@ -10836,8 +10836,8 @@ let Jn = class extends ue {
|
|
|
10836
10836
|
}
|
|
10837
10837
|
if (!S)
|
|
10838
10838
|
return !0;
|
|
10839
|
-
const { startRow: b, endRow:
|
|
10840
|
-
for (let U = b; U <=
|
|
10839
|
+
const { startRow: b, endRow: O, startColumn: k, endColumn: T } = w.range;
|
|
10840
|
+
for (let U = b; U <= O; U++)
|
|
10841
10841
|
for (let D = k; D <= T; D++) {
|
|
10842
10842
|
const H = (l = (u = S.getCell(U, D)) == null ? void 0 : u.selectionProtection) == null ? void 0 : l[0];
|
|
10843
10843
|
if ((H == null ? void 0 : H[_.View]) === !1)
|
|
@@ -10851,7 +10851,7 @@ let Jn = class extends ue {
|
|
|
10851
10851
|
const c = P(this._univerInstanceService);
|
|
10852
10852
|
if (!c)
|
|
10853
10853
|
return !1;
|
|
10854
|
-
const d = e.unitId || c.unitId, h = e.subUnitId || c.subUnitId, m = this._rangeProtectionRuleModel.getSubunitRuleList(d, h).filter((C) => C.ranges.some((p) =>
|
|
10854
|
+
const d = e.unitId || c.unitId, h = e.subUnitId || c.subUnitId, m = this._rangeProtectionRuleModel.getSubunitRuleList(d, h).filter((C) => C.ranges.some((p) => N.intersects(p, o))).map((C) => new Ve(d, h, C.permissionId).id);
|
|
10855
10855
|
if (!this._permissionService.composePermission(m).every((C) => C.value))
|
|
10856
10856
|
return !1;
|
|
10857
10857
|
}
|
|
@@ -11259,7 +11259,7 @@ Yn = Td([
|
|
|
11259
11259
|
Io(1, $(ve)),
|
|
11260
11260
|
Io(2, $(M))
|
|
11261
11261
|
], Yn);
|
|
11262
|
-
var Pd = Object.getOwnPropertyDescriptor,
|
|
11262
|
+
var Pd = Object.getOwnPropertyDescriptor, Nd = (n, e, t, o) => {
|
|
11263
11263
|
for (var s = o > 1 ? void 0 : o ? Pd(e, t) : e, r = n.length - 1, i; r >= 0; r--)
|
|
11264
11264
|
(i = n[r]) && (s = i(s) || s);
|
|
11265
11265
|
return s;
|
|
@@ -11324,12 +11324,12 @@ let fn = class {
|
|
|
11324
11324
|
this._cache.clear();
|
|
11325
11325
|
}
|
|
11326
11326
|
};
|
|
11327
|
-
fn =
|
|
11327
|
+
fn = Nd([
|
|
11328
11328
|
ys(0, $(me)),
|
|
11329
11329
|
ys(1, $(Ze))
|
|
11330
11330
|
], fn);
|
|
11331
|
-
var
|
|
11332
|
-
for (var s = o > 1 ? void 0 : o ?
|
|
11331
|
+
var Od = Object.getOwnPropertyDescriptor, Dd = (n, e, t, o) => {
|
|
11332
|
+
for (var s = o > 1 ? void 0 : o ? Od(e, t) : e, r = n.length - 1, i; r >= 0; r--)
|
|
11333
11333
|
(i = n[r]) && (s = i(s) || s);
|
|
11334
11334
|
return s;
|
|
11335
11335
|
}, vo = (n, e) => (t, o) => e(t, o, n);
|
|
@@ -11589,7 +11589,7 @@ let Xn = class extends ue {
|
|
|
11589
11589
|
ti,
|
|
11590
11590
|
Fn,
|
|
11591
11591
|
ns,
|
|
11592
|
-
|
|
11592
|
+
Nn,
|
|
11593
11593
|
ud,
|
|
11594
11594
|
Tt,
|
|
11595
11595
|
// formula SUBTOTAL
|
|
@@ -11621,7 +11621,7 @@ let Xn = class extends ue {
|
|
|
11621
11621
|
Qu,
|
|
11622
11622
|
nl,
|
|
11623
11623
|
tl,
|
|
11624
|
-
|
|
11624
|
+
Nr,
|
|
11625
11625
|
Ye,
|
|
11626
11626
|
ac,
|
|
11627
11627
|
un,
|
|
@@ -11635,7 +11635,7 @@ let Xn = class extends ue {
|
|
|
11635
11635
|
bo,
|
|
11636
11636
|
lc,
|
|
11637
11637
|
Ac,
|
|
11638
|
-
|
|
11638
|
+
Oc,
|
|
11639
11639
|
Dc,
|
|
11640
11640
|
wc,
|
|
11641
11641
|
Sc,
|
|
@@ -11664,7 +11664,7 @@ let Xn = class extends ue {
|
|
|
11664
11664
|
Ce,
|
|
11665
11665
|
Hc,
|
|
11666
11666
|
Un,
|
|
11667
|
-
|
|
11667
|
+
Nc,
|
|
11668
11668
|
Vc,
|
|
11669
11669
|
Wc,
|
|
11670
11670
|
xc,
|
|
@@ -11703,7 +11703,7 @@ let Xn = class extends ue {
|
|
|
11703
11703
|
bt,
|
|
11704
11704
|
xt,
|
|
11705
11705
|
es,
|
|
11706
|
-
|
|
11706
|
+
Nu,
|
|
11707
11707
|
Ec,
|
|
11708
11708
|
oc,
|
|
11709
11709
|
Zl,
|
|
@@ -11821,7 +11821,7 @@ let Qn = class extends ue {
|
|
|
11821
11821
|
if (!n)
|
|
11822
11822
|
return t(n);
|
|
11823
11823
|
const o = e.workbook.getStyles().getStyleByCell(n);
|
|
11824
|
-
return Vi((s = o == null ? void 0 : o.n) == null ? void 0 : s.pattern) && (n == null ? void 0 : n.t) === re.NUMBER && n.v !== void 0 && n.v !== null &&
|
|
11824
|
+
return Vi((s = o == null ? void 0 : o.n) == null ? void 0 : s.pattern) && (n == null ? void 0 : n.t) === re.NUMBER && n.v !== void 0 && n.v !== null && No(n.v) && ((!n || n === e.rawData) && (n = { ...e.rawData }), n.v = sa(Number(n.v))), t(n);
|
|
11825
11825
|
}
|
|
11826
11826
|
})
|
|
11827
11827
|
);
|
|
@@ -11935,7 +11935,7 @@ class jd extends ue {
|
|
|
11935
11935
|
const d = u.get(c);
|
|
11936
11936
|
if (d) {
|
|
11937
11937
|
for (const h of d)
|
|
11938
|
-
if (
|
|
11938
|
+
if (N.intersects(r, h.range)) {
|
|
11939
11939
|
o.push(c);
|
|
11940
11940
|
break;
|
|
11941
11941
|
}
|
|
@@ -12081,12 +12081,12 @@ let to = class extends ue {
|
|
|
12081
12081
|
return { redos: [], undos: [] };
|
|
12082
12082
|
}
|
|
12083
12083
|
_getRefRangeMutationsByDeleteCols(e, t, o) {
|
|
12084
|
-
const s = this._selectionProtectionRuleModel.getSubunitRuleList(t, o).filter((i) => i.ranges.some((a) =>
|
|
12084
|
+
const s = this._selectionProtectionRuleModel.getSubunitRuleList(t, o).filter((i) => i.ranges.some((a) => N.intersects(a, e.range))), r = e.range;
|
|
12085
12085
|
if (s.length) {
|
|
12086
12086
|
const i = [], a = [];
|
|
12087
12087
|
return s.forEach((u) => {
|
|
12088
12088
|
const l = A.deepClone(u), c = l.ranges.reduce((d, h) => {
|
|
12089
|
-
if (
|
|
12089
|
+
if (N.intersects(h, r)) {
|
|
12090
12090
|
const g = A.deepClone(h), { startColumn: m, endColumn: f } = r;
|
|
12091
12091
|
if (m <= g.startColumn && f >= g.endColumn)
|
|
12092
12092
|
return d;
|
|
@@ -12100,12 +12100,12 @@ let to = class extends ue {
|
|
|
12100
12100
|
return { undos: [], redos: [] };
|
|
12101
12101
|
}
|
|
12102
12102
|
_getRefRangeMutationsByDeleteRows(e, t, o) {
|
|
12103
|
-
const s = this._selectionProtectionRuleModel.getSubunitRuleList(t, o).filter((i) => i.ranges.some((a) =>
|
|
12103
|
+
const s = this._selectionProtectionRuleModel.getSubunitRuleList(t, o).filter((i) => i.ranges.some((a) => N.intersects(a, e.range))), r = e.range;
|
|
12104
12104
|
if (s.length) {
|
|
12105
12105
|
const i = [], a = [];
|
|
12106
12106
|
return s.forEach((u) => {
|
|
12107
12107
|
const l = A.deepClone(u), c = l.ranges.reduce((d, h) => {
|
|
12108
|
-
if (
|
|
12108
|
+
if (N.intersects(h, r)) {
|
|
12109
12109
|
const g = A.deepClone(h), { startRow: m, endRow: f } = r;
|
|
12110
12110
|
if (m <= g.startRow && f >= g.endRow)
|
|
12111
12111
|
return d;
|
|
@@ -12186,7 +12186,7 @@ let to = class extends ue {
|
|
|
12186
12186
|
this._selectionProtectionRuleModel.getSubunitRuleList(t.getUnitId(), o.getSheetId()).forEach((f) => {
|
|
12187
12187
|
f.ranges.forEach((p) => {
|
|
12188
12188
|
let { startRow: w, endRow: I, startColumn: S, endColumn: y } = p;
|
|
12189
|
-
|
|
12189
|
+
N.intersects(p, s) || (i ? u < w && l > I ? (w -= a, I -= a) : u > I && l <= w && (w += a, I += a) : u < S && l > y ? (S -= a, y -= a) : u > y && l <= S && (S += a, y += a)), this._checkIsRightRange({ startRow: w, endRow: I, startColumn: S, endColumn: y }) && (p.startColumn = S, p.endColumn = y, p.startRow = w, p.endRow = I);
|
|
12190
12190
|
});
|
|
12191
12191
|
}), this.disposableCollection.dispose();
|
|
12192
12192
|
const { unitId: d, subUnitId: h } = e.params, g = (f) => this.refRangeHandle(f, d, h);
|
|
@@ -12317,7 +12317,7 @@ let no = class extends ue {
|
|
|
12317
12317
|
toJson: n,
|
|
12318
12318
|
parseJson: e,
|
|
12319
12319
|
pluginName: Xd,
|
|
12320
|
-
businesses: [
|
|
12320
|
+
businesses: [On.UNIVER_SHEET],
|
|
12321
12321
|
onLoad: (t, o) => {
|
|
12322
12322
|
const s = this._selectionProtectionRuleModel.toObject();
|
|
12323
12323
|
s[t] = o, this._selectionProtectionRuleModel.fromObject(s);
|
|
@@ -12670,7 +12670,7 @@ const og = {
|
|
|
12670
12670
|
const a = s.getPermissionPoint(new Le(e, t).id);
|
|
12671
12671
|
if (!(a != null && a.value))
|
|
12672
12672
|
return !1;
|
|
12673
|
-
const l = r.getSubunitRuleList(e, t).filter((c) => c.ranges.some((d) => o.some((h) =>
|
|
12673
|
+
const l = r.getSubunitRuleList(e, t).filter((c) => c.ranges.some((d) => o.some((h) => N.intersects(d, h))));
|
|
12674
12674
|
return l.length ? l.every((c) => {
|
|
12675
12675
|
const d = c.permissionId, h = s.getPermissionPoint(new Ve(e, t, d).id);
|
|
12676
12676
|
return !!(h != null && h.value);
|
|
@@ -12768,7 +12768,7 @@ const ih = (n, e, t, o, s = 1) => {
|
|
|
12768
12768
|
if (!o || !r)
|
|
12769
12769
|
return null;
|
|
12770
12770
|
const l = { ...r }, { startRow: c, startColumn: d, endRow: h, endColumn: g } = o.range, m = i ? l.startRow === c && l.startColumn === d : l.endRow === h && l.endColumn === g, f = m && i;
|
|
12771
|
-
if (!
|
|
12771
|
+
if (!N.equals(o.range, l)) {
|
|
12772
12772
|
const p = m ? u.range : ih(o.range, t, l, e);
|
|
12773
12773
|
if (!p)
|
|
12774
12774
|
return null;
|
|
@@ -12793,7 +12793,7 @@ export {
|
|
|
12793
12793
|
eg as AddMergeRedoSelectionsOperationFactory,
|
|
12794
12794
|
We as AddMergeUndoMutationFactory,
|
|
12795
12795
|
tg as AddMergeUndoSelectionsOperationFactory,
|
|
12796
|
-
|
|
12796
|
+
Nu as AddRangeProtectionCommand,
|
|
12797
12797
|
Be as AddRangeProtectionMutation,
|
|
12798
12798
|
ad as AddRangeThemeMutation,
|
|
12799
12799
|
Wh as AddWorksheetMergeAllCommand,
|
|
@@ -12853,7 +12853,7 @@ export {
|
|
|
12853
12853
|
rn as InsertRangeMoveRightCommand,
|
|
12854
12854
|
el as InsertRowAfterCommand,
|
|
12855
12855
|
Qu as InsertRowBeforeCommand,
|
|
12856
|
-
|
|
12856
|
+
Nr as InsertRowByRangeCommand,
|
|
12857
12857
|
Ye as InsertRowCommand,
|
|
12858
12858
|
Ue as InsertRowMutation,
|
|
12859
12859
|
$o as InsertRowMutationUndoFactory,
|
|
@@ -12908,10 +12908,10 @@ export {
|
|
|
12908
12908
|
lc as RemoveWorksheetMergeCommand,
|
|
12909
12909
|
oe as RemoveWorksheetMergeMutation,
|
|
12910
12910
|
bo as ReorderRangeCommand,
|
|
12911
|
-
|
|
12911
|
+
Nn as ReorderRangeMutation,
|
|
12912
12912
|
Va as ReorderRangeUndoMutationFactory,
|
|
12913
12913
|
Ac as ResetBackgroundColorCommand,
|
|
12914
|
-
|
|
12914
|
+
Oc as ResetTextColorCommand,
|
|
12915
12915
|
ng as SCOPE_WORKBOOK_VALUE_DEFINED_NAME,
|
|
12916
12916
|
Eh as SELECTIONS_ENABLED,
|
|
12917
12917
|
Ih as SELECTION_CONTROL_BORDER_BUFFER_COLOR,
|
|
@@ -12967,7 +12967,7 @@ export {
|
|
|
12967
12967
|
Ce as SetStyleCommand,
|
|
12968
12968
|
Hc as SetTabColorCommand,
|
|
12969
12969
|
Un as SetTabColorMutation,
|
|
12970
|
-
|
|
12970
|
+
Nc as SetTextColorCommand,
|
|
12971
12971
|
Vc as SetTextRotationCommand,
|
|
12972
12972
|
Wc as SetTextWrapCommand,
|
|
12973
12973
|
zh as SetUnderlineCommand,
|
|
@@ -12996,7 +12996,7 @@ export {
|
|
|
12996
12996
|
bt as SetWorksheetProtectionMutation,
|
|
12997
12997
|
Ql as SetWorksheetRangeThemeStyleCommand,
|
|
12998
12998
|
tn as SetWorksheetRangeThemeStyleMutation,
|
|
12999
|
-
|
|
12999
|
+
Oa as SetWorksheetRangeThemeStyleMutationFactory,
|
|
13000
13000
|
Xh as SetWorksheetRightToLeftCommand,
|
|
13001
13001
|
So as SetWorksheetRightToLeftMutation,
|
|
13002
13002
|
Xs as SetWorksheetRowAutoHeightMutation,
|
|
@@ -13051,7 +13051,7 @@ export {
|
|
|
13051
13051
|
lr as WorkbookPrintPermission,
|
|
13052
13052
|
cr as WorkbookRecoverHistoryPermission,
|
|
13053
13053
|
Go as WorkbookRenameSheetPermission,
|
|
13054
|
-
|
|
13054
|
+
Ou as WorkbookSelectionModel,
|
|
13055
13055
|
dr as WorkbookSharePermission,
|
|
13056
13056
|
gr as WorkbookViewHistoryPermission,
|
|
13057
13057
|
hr as WorkbookViewPermission,
|
|
@@ -13071,7 +13071,7 @@ export {
|
|
|
13071
13071
|
In as WorksheetProtectionPointModel,
|
|
13072
13072
|
lt as WorksheetProtectionRuleModel,
|
|
13073
13073
|
Ph as WorksheetSelectProtectedCellsPermission,
|
|
13074
|
-
|
|
13074
|
+
Nh as WorksheetSelectUnProtectedCellsPermission,
|
|
13075
13075
|
yr as WorksheetSetCellStylePermission,
|
|
13076
13076
|
Dn as WorksheetSetCellValuePermission,
|
|
13077
13077
|
Zt as WorksheetSetColumnStylePermission,
|
|
@@ -13120,9 +13120,9 @@ export {
|
|
|
13120
13120
|
Ch as getSkeletonChangedEffectedRange,
|
|
13121
13121
|
Rh as getValueChangedEffectedRange,
|
|
13122
13122
|
ao as getVisibleRanges,
|
|
13123
|
-
|
|
13123
|
+
Ot as handleBaseInsertRange,
|
|
13124
13124
|
$n as handleBaseMoveRowsCols,
|
|
13125
|
-
|
|
13125
|
+
Nt as handleBaseRemoveRange,
|
|
13126
13126
|
Cs as handleCommonDefaultRangeChangeWithEffectRefCommands,
|
|
13127
13127
|
xh as handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests,
|
|
13128
13128
|
Rs as handleDefaultRangeChangeWithEffectRefCommands,
|
|
@@ -13135,7 +13135,7 @@ export {
|
|
|
13135
13135
|
Ml as handleInsertCol,
|
|
13136
13136
|
_l as handleInsertRangeMoveDown,
|
|
13137
13137
|
bl as handleInsertRangeMoveRight,
|
|
13138
|
-
|
|
13138
|
+
Oh as handleInsertRangeMutation,
|
|
13139
13139
|
vl as handleInsertRow,
|
|
13140
13140
|
Fr as handleMoveCols,
|
|
13141
13141
|
Cl as handleMoveRange,
|
|
@@ -13143,7 +13143,7 @@ export {
|
|
|
13143
13143
|
Th as isSingleCellSelection,
|
|
13144
13144
|
Qs as rangeMerge,
|
|
13145
13145
|
ku as rangeToDiscreteRange,
|
|
13146
|
-
|
|
13146
|
+
Oe as rotateRange,
|
|
13147
13147
|
Dt as runRefRangeMutations,
|
|
13148
13148
|
kh as setEndForRange,
|
|
13149
13149
|
Mu as splitRangeText,
|