@univerjs/sheets 0.6.6 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +2 -2
- package/lib/es/facade.js +30 -4
- package/lib/es/index.js +221 -221
- package/lib/types/facade/f-range.d.ts +23 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +11 -11
package/lib/es/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var ii = Object.defineProperty;
|
|
2
2
|
var ai = (n, e, t) => e in n ? ii(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var R = (n, e, t) => ai(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { Tools as
|
|
5
|
-
import { SetDefinedNameMutation as zt, RemoveDefinedNameMutation as Sn, SetDefinedNameMutationFactory as Di, SetFormulaCalculationResultMutation as Ai, handleNumfmtInCell as xi, IDefinedNamesService as
|
|
4
|
+
import { Tools as O, CommandType as v, ICommandService as E, IUndoRedoService as V, createInterceptorKey as ut, Disposable as ue, UniverInstanceType as B, InterceptorEffectEnum as ce, InterceptorManager as Ro, toDisposable as Pe, remove as ze, composeInterceptors as ui, DisposableCollection as Gt, IUniverInstanceService as M, BooleanNumber as te, HorizontalAlign as po, BorderStyleTypes as Ss, Inject as $, IResourceManagerService as on, RTree as li, generateRandomId as ci, insertMatrixArray as Cn, sliceMatrixArray as ws, concatMatrixArray as Is, spliceArray as vs, normalizeTextRuns as di, CellValueType as ie, isRealNum as Co, isBooleanString as Ms, isSafeNumeric as hi, ObjectMatrix as G, sequenceExecute as z, RxDisposable as _s, LocaleService as Ye, RANGE_TYPE as L, selectionToArray as mi, Rectangle as N, createIdentifier as So, IContextService as ys, ErrorService as Ut, Range as K, cellToRange as bs, PermissionStatus as J, IPermissionService as Fe, isICellData as Es, Dimension as fe, getArrayLength as Us, Direction as pe, mergeWorksheetSnapshotWithDefault as gi, moveMatrixArray as ks, BorderType as le, FontWeight as fi, FontItalic as Ri, Injector as Hn, ILogService as Ts, DocumentDataModel as pi, BuildTextUtils as Ci, TextX as Si, IConfigService as Ps, Optional as wi, queryObjectMatrix as qe, CustomCommandExecutionError as Ii, IAuthzIoService as vi, UserManagerService as Mi, LRUMap as _i, DependentOn as yi, Plugin as bi, merge as Ei, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE as Ui, AUTO_HEIGHT_FOR_MERGED_CELLS as ki, registerDependencies as Ti, mergeOverrideWithDependencies as Pi, touchDependencies as cn, createRowColIter as Ni, CellModeEnum as Oi } from "@univerjs/core";
|
|
5
|
+
import { SetDefinedNameMutation as zt, RemoveDefinedNameMutation as Sn, SetDefinedNameMutationFactory as Di, SetFormulaCalculationResultMutation as Ai, handleNumfmtInCell as xi, IDefinedNamesService as Ns, stripErrorMargin as Wi, LexerTreeBuilder as $i, operatorToken as Vi, deserializeRangeWithSheet as Li, sequenceNodeType as Hi, deserializeRangeWithSheetWithCache as Bi, UniverFormulaEnginePlugin as Fi } from "@univerjs/engine-formula";
|
|
6
6
|
import { DataSyncPrimaryController as ji } from "@univerjs/rpc";
|
|
7
|
-
import { Subject as Le, BehaviorSubject as dt, merge as Wt, shareReplay as Gi, takeUntil as lo, switchMap as Ke, of as Dt, distinctUntilChanged as zi, skip as
|
|
7
|
+
import { Subject as Le, BehaviorSubject as dt, merge as Wt, shareReplay as Gi, takeUntil as lo, switchMap as Ke, of as Dt, distinctUntilChanged as zi, skip as Os, map as co, first as Ki, filter as jo } from "rxjs";
|
|
8
8
|
import { isTextFormat as to } from "@univerjs/engine-numfmt";
|
|
9
9
|
import { takeUntil as Go, filter as zo, map as Ji } from "rxjs/operators";
|
|
10
10
|
var Yi = /* @__PURE__ */ ((n) => (n.OthersCanView = "othersCanView", n.NoOneElseCanView = "noOneElseCanView", n))(Yi || {}), qi = /* @__PURE__ */ ((n) => (n.DesignedUserCanEdit = "designedUserCanEdit", n.OnlyMe = "onlyMe", n))(qi || {});
|
|
@@ -89,10 +89,10 @@ class me {
|
|
|
89
89
|
this._model.delete(e);
|
|
90
90
|
}
|
|
91
91
|
createRuleId(e, t) {
|
|
92
|
-
let o =
|
|
92
|
+
let o = O.generateRandomId(4);
|
|
93
93
|
const s = this._ensureRuleMap(e, t);
|
|
94
94
|
for (; s.has(o); )
|
|
95
|
-
o =
|
|
95
|
+
o = O.generateRandomId(4);
|
|
96
96
|
return o;
|
|
97
97
|
}
|
|
98
98
|
getTargetByPermissionId(e, t) {
|
|
@@ -105,7 +105,7 @@ class me {
|
|
|
105
105
|
return null;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
const
|
|
108
|
+
const Nd = (n, e) => {
|
|
109
109
|
const t = n.get(me), o = e.ruleIds.map((r) => t.getRule(e.unitId, e.subUnitId, r)).filter((r) => !!r);
|
|
110
110
|
return { id: Ae.id, params: { subUnitId: e.subUnitId, unitId: e.unitId, rules: o } };
|
|
111
111
|
}, Je = {
|
|
@@ -117,7 +117,7 @@ const Od = (n, e) => {
|
|
|
117
117
|
r.deleteRule(t, o, i);
|
|
118
118
|
}), !0;
|
|
119
119
|
}
|
|
120
|
-
},
|
|
120
|
+
}, Od = (n) => {
|
|
121
121
|
const e = { ...n, ruleIds: n.rules.map((t) => t.id) };
|
|
122
122
|
return { id: Je.id, params: e };
|
|
123
123
|
}, Ae = {
|
|
@@ -450,7 +450,7 @@ let F = class extends ue {
|
|
|
450
450
|
worksheet: t,
|
|
451
451
|
row: o,
|
|
452
452
|
col: s,
|
|
453
|
-
origin:
|
|
453
|
+
origin: O.deepClone(r)
|
|
454
454
|
};
|
|
455
455
|
return this.writeCellInterceptor.fetchThroughInterceptors(no)(r, i);
|
|
456
456
|
}
|
|
@@ -1339,9 +1339,9 @@ function Ea(n, e, t) {
|
|
|
1339
1339
|
const o = n.getStyleByCell(e);
|
|
1340
1340
|
o == null && delete e.s, typeof t.s == "string" && (t.s = n.get(t.s));
|
|
1341
1341
|
const s = fn(o, t.s ? t.s : null);
|
|
1342
|
-
s && (
|
|
1342
|
+
s && (O.removeNull(s), Object.entries(s).forEach(([a, u]) => {
|
|
1343
1343
|
typeof u == "object" && u !== null && Object.keys(u).length === 0 && delete s[a];
|
|
1344
|
-
})),
|
|
1344
|
+
})), O.isEmptyObject(s) ? delete e.s : e.s = n.setValue(s);
|
|
1345
1345
|
const r = t.v ? `${t.v}\r
|
|
1346
1346
|
` : "";
|
|
1347
1347
|
!t.p && e.p && (r && r !== ((i = e.p.body) == null ? void 0 : i.dataStream) ? delete e.p : Ta(e.p, t.s ? t.s : null));
|
|
@@ -1364,7 +1364,7 @@ function ka(n, e) {
|
|
|
1364
1364
|
function fn(n, e, t = !1) {
|
|
1365
1365
|
if (e === null) return e;
|
|
1366
1366
|
if (e === void 0) return n;
|
|
1367
|
-
const o =
|
|
1367
|
+
const o = O.deepClone(n) || {};
|
|
1368
1368
|
for (const s in e)
|
|
1369
1369
|
t && ["bd", "tr", "td", "ht", "vt", "tb", "pd", "bg"].includes(s) || (s in o && s === "bd" ? o[s] = Object.assign(o[s], e[s]) : o[s] = e[s]);
|
|
1370
1370
|
return "cl" in o && ("ul" in o && o.ul && (o.ul.cl = o.cl), "ol" in o && o.ol && (o.ol.cl = o.cl), "st" in o && o.st && (o.st.cl = o.cl)), o;
|
|
@@ -1386,10 +1386,10 @@ function Ta(n, e) {
|
|
|
1386
1386
|
st: t,
|
|
1387
1387
|
ed: u
|
|
1388
1388
|
}, m = fn({}, e, !0);
|
|
1389
|
-
m &&
|
|
1389
|
+
m && O.removeNull(m), O.isEmptyObject(m) || (h.ts = m), o.push(h);
|
|
1390
1390
|
}
|
|
1391
1391
|
const d = fn(c, e, !0);
|
|
1392
|
-
d &&
|
|
1392
|
+
d && O.removeNull(d), O.isEmptyObject(d) ? delete a.ts : a.ts = d, o.push(a), t = xs(s, l);
|
|
1393
1393
|
}
|
|
1394
1394
|
const r = n.body.dataStream.endsWith(`\r
|
|
1395
1395
|
`) ? n.body.dataStream.length - 2 : n.body.dataStream.length;
|
|
@@ -1398,7 +1398,7 @@ function Ta(n, e) {
|
|
|
1398
1398
|
st: t,
|
|
1399
1399
|
ed: r
|
|
1400
1400
|
}, u = fn({}, e, !0);
|
|
1401
|
-
u &&
|
|
1401
|
+
u && O.removeNull(u), O.isEmptyObject(u) || (a.ts = u), o.push(a);
|
|
1402
1402
|
}
|
|
1403
1403
|
n.body.textRuns = di(o);
|
|
1404
1404
|
}
|
|
@@ -1416,12 +1416,12 @@ function Pa(n, e, t) {
|
|
|
1416
1416
|
}
|
|
1417
1417
|
return ie.FORCE_STRING;
|
|
1418
1418
|
}
|
|
1419
|
-
return
|
|
1419
|
+
return Na(o) ? to((i = o == null ? void 0 : o.n) == null ? void 0 : i.pattern) ? ie.STRING : Xo(e, t) : to((a = s == null ? void 0 : s.n) == null ? void 0 : a.pattern) ? ie.STRING : Xo(e, t);
|
|
1420
1420
|
}
|
|
1421
1421
|
function Xo(n, e) {
|
|
1422
1422
|
return n.v !== void 0 ? Zo(n.v, n.t) : Zo(e.v, e.t);
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function Na(n) {
|
|
1425
1425
|
var e;
|
|
1426
1426
|
return !!((e = n == null ? void 0 : n.n) != null && e.pattern);
|
|
1427
1427
|
}
|
|
@@ -1429,9 +1429,9 @@ function Zo(n, e) {
|
|
|
1429
1429
|
return n === null ? null : typeof n == "string" ? Co(n) ? (+n == 0 || +n == 1) && e === ie.BOOLEAN ? ie.BOOLEAN : ie.NUMBER : Ms(n) ? ie.BOOLEAN : ie.STRING : typeof n == "number" ? (n === 0 || n === 1) && e === ie.BOOLEAN ? ie.BOOLEAN : ie.NUMBER : typeof n == "boolean" ? ie.BOOLEAN : ie.FORCE_STRING;
|
|
1430
1430
|
}
|
|
1431
1431
|
function Qo(n, e) {
|
|
1432
|
-
return n === ie.NUMBER ? Number(e.v) : n === ie.BOOLEAN ?
|
|
1432
|
+
return n === ie.NUMBER ? Number(e.v) : n === ie.BOOLEAN ? Oa(e.v) ? 1 : 0 : n === ie.STRING || n === ie.FORCE_STRING ? `${e.v}` : e.v;
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1434
|
+
function Oa(n) {
|
|
1435
1435
|
if (typeof n == "string") {
|
|
1436
1436
|
if (n.toUpperCase() === "TRUE")
|
|
1437
1437
|
return !0;
|
|
@@ -1464,7 +1464,7 @@ const be = (n, e) => {
|
|
|
1464
1464
|
throw new Error("worksheet is null error!");
|
|
1465
1465
|
const u = a.getCellMatrix(), l = i.getStyles(), c = new G();
|
|
1466
1466
|
return new G(s).forValue((h, m, g) => {
|
|
1467
|
-
const f =
|
|
1467
|
+
const f = O.deepClone(u == null ? void 0 : u.getValue(h, m)) || {}, p = l.getStyleByCell(f), C = l.getStyleByCell(g);
|
|
1468
1468
|
f.s = Ua(p, C), c.setValue(h, m, Da(f));
|
|
1469
1469
|
}), {
|
|
1470
1470
|
...e,
|
|
@@ -1487,7 +1487,7 @@ const be = (n, e) => {
|
|
|
1487
1487
|
u == null || u.setValue(d, h, {});
|
|
1488
1488
|
else {
|
|
1489
1489
|
const g = u.getValue(d, h) || {}, f = Pa(l, m, g);
|
|
1490
|
-
m.f !== void 0 && (g.f = m.f), m.si !== void 0 && (g.si = m.si), m.p !== void 0 && (g.p = m.p), m.v !== void 0 && (g.v = Qo(f, m)), g.v !== void 0 && (g.t = f, g.v = Qo(f, g)), m.s !== void 0 && Ea(l, g, m), m.custom !== void 0 && (g.custom = m.custom), u.setValue(d, h,
|
|
1490
|
+
m.f !== void 0 && (g.f = m.f), m.si !== void 0 && (g.si = m.si), m.p !== void 0 && (g.p = m.p), m.v !== void 0 && (g.v = Qo(f, m)), g.v !== void 0 && (g.t = f, g.v = Qo(f, g)), m.s !== void 0 && Ea(l, g, m), m.custom !== void 0 && (g.custom = m.custom), u.setValue(d, h, O.removeNull(g));
|
|
1491
1491
|
}
|
|
1492
1492
|
}), !0;
|
|
1493
1493
|
}
|
|
@@ -1757,7 +1757,7 @@ let H = class extends _s {
|
|
|
1757
1757
|
const e = this._instanceSrv.getCurrentTypeOfUnit$(B.UNIVER_SHEET).pipe(Gi(1), lo(this.dispose$));
|
|
1758
1758
|
this.selectionMoveStart$ = e.pipe(Ke((t) => t ? this._ensureWorkbookSelection(t.getUnitId()).selectionMoveStart$ : Dt())), this.selectionMoving$ = e.pipe(Ke((t) => t ? this._ensureWorkbookSelection(t.getUnitId()).selectionMoving$ : Dt())), this.selectionMoveEnd$ = e.pipe(Ke((t) => t ? this._ensureWorkbookSelection(t.getUnitId()).selectionMoveEnd$ : Dt([]))), this.selectionSet$ = e.pipe(Ke((t) => t ? this._ensureWorkbookSelection(t.getUnitId()).selectionSet$ : Dt([]))), this.selectionChanged$ = e.pipe(Ke((t) => t ? this._ensureWorkbookSelection(t.getUnitId()).selectionChanged$ : Dt([]))).pipe(
|
|
1759
1759
|
zi((t, o) => t.length !== o.length ? !1 : t.length === 0 && o.length === 0 ? !0 : t.every((s, r) => JSON.stringify(s) === JSON.stringify(o[r]))),
|
|
1760
|
-
|
|
1760
|
+
Os(1)
|
|
1761
1761
|
), this._instanceSrv.getTypeOfUnitDisposed$(B.UNIVER_SHEET).pipe(lo(this.dispose$)).subscribe((t) => {
|
|
1762
1762
|
this._removeWorkbookSelection(t.getUnitId());
|
|
1763
1763
|
});
|
|
@@ -1983,8 +1983,8 @@ const Dd = "DISABLE_NORMAL_SELECTIONS", Ad = "SELECTIONS_ENABLED", za = "REF_SEL
|
|
|
1983
1983
|
const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(F), i = n.get(Ye), a = k(s, e);
|
|
1984
1984
|
if (!a)
|
|
1985
1985
|
return !1;
|
|
1986
|
-
const { workbook: u, worksheet: l, unitId: c, subUnitId: d } = a, h =
|
|
1987
|
-
h.name = Ja(u, i, h.name), h.id =
|
|
1986
|
+
const { workbook: u, worksheet: l, unitId: c, subUnitId: d } = a, h = O.deepClone(l.getConfig());
|
|
1987
|
+
h.name = Ja(u, i, h.name), h.id = O.generateRandomId();
|
|
1988
1988
|
const g = {
|
|
1989
1989
|
index: u.getSheetIndex(l) + 1,
|
|
1990
1990
|
sheet: h,
|
|
@@ -2048,11 +2048,11 @@ function jn(n, e, t = !0) {
|
|
|
2048
2048
|
endRow: i + u.rowSpan - 1,
|
|
2049
2049
|
endColumn: a + u.colSpan - 1
|
|
2050
2050
|
};
|
|
2051
|
-
|
|
2051
|
+
N.contains(n, l) || s.push(l);
|
|
2052
2052
|
}
|
|
2053
2053
|
}), s.length === 0)
|
|
2054
2054
|
return n;
|
|
2055
|
-
const r =
|
|
2055
|
+
const r = N.union(n, ...s);
|
|
2056
2056
|
return t ? jn(r, e, t) : r;
|
|
2057
2057
|
}
|
|
2058
2058
|
function xd(n, e, t) {
|
|
@@ -2117,7 +2117,7 @@ function $d(n) {
|
|
|
2117
2117
|
if (!n)
|
|
2118
2118
|
return !1;
|
|
2119
2119
|
const { range: e, primary: t } = n;
|
|
2120
|
-
return
|
|
2120
|
+
return N.equals(e, t);
|
|
2121
2121
|
}
|
|
2122
2122
|
function Ya(n) {
|
|
2123
2123
|
function e(t, o) {
|
|
@@ -2260,22 +2260,22 @@ function _o(n, e, t, o = !1) {
|
|
|
2260
2260
|
const s = [], r = [], { range: i, subUnitId: a, unitId: u } = e, { range: l, subUnitId: c } = t, h = n.get(M).getUniverSheetInstance(u), m = h == null ? void 0 : h.getSheetBySheetId(c), g = h == null ? void 0 : h.getSheetBySheetId(a), f = m == null ? void 0 : m.getCellMatrix(), p = g == null ? void 0 : g.getCellMatrix();
|
|
2261
2261
|
if (m && g && f && p) {
|
|
2262
2262
|
const C = jn(l, m, !1);
|
|
2263
|
-
if (!
|
|
2263
|
+
if (!N.equals(l, C) && !o)
|
|
2264
2264
|
return null;
|
|
2265
2265
|
const S = new G(), I = new G(), w = new G();
|
|
2266
2266
|
K.foreach(i, (P, U) => {
|
|
2267
2267
|
const x = p.getValue(P, U);
|
|
2268
|
-
if (S.setValue(P, U,
|
|
2268
|
+
if (S.setValue(P, U, O.deepClone(x)), x) {
|
|
2269
2269
|
const j = h == null ? void 0 : h.getStyles().get(x.s);
|
|
2270
|
-
w.setValue(P, U,
|
|
2270
|
+
w.setValue(P, U, O.deepClone(j));
|
|
2271
2271
|
}
|
|
2272
2272
|
I.setValue(P, U, null);
|
|
2273
2273
|
});
|
|
2274
2274
|
const y = new G(), b = new G();
|
|
2275
2275
|
K.foreach(l, (P, U) => {
|
|
2276
|
-
y.setValue(P, U,
|
|
2276
|
+
y.setValue(P, U, O.deepClone(f.getValue(P, U)));
|
|
2277
2277
|
}), K.foreach(i, (P, U) => {
|
|
2278
|
-
const x = bs(P, U), j =
|
|
2278
|
+
const x = bs(P, U), j = N.getRelativeRange(x, i), Z = N.getPositionRange(j, l), Q = O.deepClone(w.getValue(P, U)), ee = O.deepClone(S.getValue(P, U));
|
|
2279
2279
|
ee && Q && (ee.s = Q), b.setValue(Z.startRow, Z.startColumn, ee);
|
|
2280
2280
|
});
|
|
2281
2281
|
const D = {
|
|
@@ -2319,7 +2319,7 @@ function nu(n, e, t) {
|
|
|
2319
2319
|
return i;
|
|
2320
2320
|
}
|
|
2321
2321
|
var wn = /* @__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))(wn || {}), _ = /* @__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))(_ || {}), A = /* @__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))(A || {});
|
|
2322
|
-
class
|
|
2322
|
+
class Ne {
|
|
2323
2323
|
constructor(e, t, o) {
|
|
2324
2324
|
R(this, "type", A.SelectRange);
|
|
2325
2325
|
R(this, "subType", _.Edit);
|
|
@@ -2575,7 +2575,7 @@ class nr {
|
|
|
2575
2575
|
this.unitId = e, this.subUnitId = t, this.id = `${this.type}.${_.DeleteRow}_${e}_${t}`;
|
|
2576
2576
|
}
|
|
2577
2577
|
}
|
|
2578
|
-
class
|
|
2578
|
+
class Oe {
|
|
2579
2579
|
constructor(e, t) {
|
|
2580
2580
|
R(this, "value", !0);
|
|
2581
2581
|
R(this, "type", A.Worksheet);
|
|
@@ -2743,10 +2743,10 @@ const sn = {
|
|
|
2743
2743
|
const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(F), a = n.get(Fe), u = k(s, e);
|
|
2744
2744
|
if (!u) return !1;
|
|
2745
2745
|
const { subUnitId: l, unitId: c, workbook: d, worksheet: h } = u, { value: m, range: g, redoUndoId: f } = e, p = g ? [g] : (P = r.getCurrentSelections()) == null ? void 0 : P.map((U) => U.range);
|
|
2746
|
-
if (!p || !p.length || !a.getPermissionPoint(new
|
|
2746
|
+
if (!p || !p.length || !a.getPermissionPoint(new Oe(c, l).id)) return !1;
|
|
2747
2747
|
const C = new G();
|
|
2748
2748
|
let S;
|
|
2749
|
-
if (
|
|
2749
|
+
if (O.isArray(m))
|
|
2750
2750
|
for (let U = 0; U < p.length; U++) {
|
|
2751
2751
|
const { startRow: x, startColumn: j, endRow: Z, endColumn: Q } = p[U];
|
|
2752
2752
|
for (let ee = 0; ee <= Z - x; ee++)
|
|
@@ -2780,7 +2780,7 @@ const sn = {
|
|
|
2780
2780
|
redoMutations: [
|
|
2781
2781
|
{ id: X.id, params: I },
|
|
2782
2782
|
...D,
|
|
2783
|
-
|
|
2783
|
+
O.deepClone(U)
|
|
2784
2784
|
],
|
|
2785
2785
|
id: f
|
|
2786
2786
|
}), !0;
|
|
@@ -3003,7 +3003,7 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
|
|
|
3003
3003
|
}
|
|
3004
3004
|
// all subsequent mutations should succeed inorder to make the whole process succeed
|
|
3005
3005
|
// Promise.all([]).then(() => true),
|
|
3006
|
-
}, fr = "sheet.command.delete-range-move-up",
|
|
3006
|
+
}, fr = "sheet.command.delete-range-move-up", Nt = {
|
|
3007
3007
|
type: v.COMMAND,
|
|
3008
3008
|
id: fr,
|
|
3009
3009
|
handler: async (n, e) => {
|
|
@@ -3019,7 +3019,7 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
|
|
|
3019
3019
|
unitId: u,
|
|
3020
3020
|
shiftDimension: fe.ROWS
|
|
3021
3021
|
}, g = i.onCommandExecute({
|
|
3022
|
-
id:
|
|
3022
|
+
id: Nt.id,
|
|
3023
3023
|
params: { range: h }
|
|
3024
3024
|
}), { redo: f, undo: p } = mr(
|
|
3025
3025
|
n,
|
|
@@ -3577,7 +3577,7 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
|
|
|
3577
3577
|
const { unitId: a, workbook: u } = i;
|
|
3578
3578
|
let l = u.getSheets().length;
|
|
3579
3579
|
const c = e == null ? void 0 : e.sheet, d = c == null ? void 0 : c.id, h = gi(c || {});
|
|
3580
|
-
e ? (l = (p = e.index) != null ? p : l, h.id = d ||
|
|
3580
|
+
e ? (l = (p = e.index) != null ? p : l, h.id = d || O.generateRandomId(), h.name = (c == null ? void 0 : c.name) || u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`)) : (h.id = O.generateRandomId(), h.name = u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`));
|
|
3581
3581
|
const m = {
|
|
3582
3582
|
index: l,
|
|
3583
3583
|
sheet: h,
|
|
@@ -3598,7 +3598,7 @@ function Su(n, e) {
|
|
|
3598
3598
|
return i ? {
|
|
3599
3599
|
unitId: t,
|
|
3600
3600
|
subUnitId: o,
|
|
3601
|
-
sourceRange:
|
|
3601
|
+
sourceRange: N.clone(r),
|
|
3602
3602
|
targetRange: {
|
|
3603
3603
|
...s,
|
|
3604
3604
|
endRow: s.endRow + a,
|
|
@@ -3607,7 +3607,7 @@ function Su(n, e) {
|
|
|
3607
3607
|
} : {
|
|
3608
3608
|
unitId: t,
|
|
3609
3609
|
subUnitId: o,
|
|
3610
|
-
targetRange:
|
|
3610
|
+
targetRange: N.clone(s),
|
|
3611
3611
|
sourceRange: {
|
|
3612
3612
|
...r,
|
|
3613
3613
|
endRow: r.endRow - a,
|
|
@@ -3634,7 +3634,7 @@ function wu(n, e) {
|
|
|
3634
3634
|
return i ? {
|
|
3635
3635
|
unitId: t,
|
|
3636
3636
|
subUnitId: o,
|
|
3637
|
-
sourceRange:
|
|
3637
|
+
sourceRange: N.clone(r),
|
|
3638
3638
|
targetRange: {
|
|
3639
3639
|
...s,
|
|
3640
3640
|
endColumn: s.endColumn + a,
|
|
@@ -3643,7 +3643,7 @@ function wu(n, e) {
|
|
|
3643
3643
|
} : {
|
|
3644
3644
|
unitId: t,
|
|
3645
3645
|
subUnitId: o,
|
|
3646
|
-
targetRange:
|
|
3646
|
+
targetRange: N.clone(s),
|
|
3647
3647
|
sourceRange: {
|
|
3648
3648
|
...r,
|
|
3649
3649
|
startColumn: r.startColumn - a,
|
|
@@ -3689,7 +3689,7 @@ const wr = "sheet.command.move-rows", Kn = {
|
|
|
3689
3689
|
const u = n.get(F), l = n.get(M), c = k(l, e);
|
|
3690
3690
|
if (!c) return !1;
|
|
3691
3691
|
const { workbook: d, worksheet: h } = c, m = d.getUnitId(), g = h.getSheetId(), f = n.get(Ut), p = n.get(Ye), C = a[0].range, S = a[0].primary, I = jn(C, h, !1);
|
|
3692
|
-
if (!
|
|
3692
|
+
if (!N.equals(C, I))
|
|
3693
3693
|
return f.emit(p.t("sheets.info.partOfCell")), !1;
|
|
3694
3694
|
if (Iu(s, h))
|
|
3695
3695
|
return f.emit(p.t("sheets.info.acrossMergedCell")), !1;
|
|
@@ -3755,7 +3755,7 @@ const wr = "sheet.command.move-rows", Kn = {
|
|
|
3755
3755
|
const u = n.get(F), l = n.get(M), c = k(l, e);
|
|
3756
3756
|
if (!c) return !1;
|
|
3757
3757
|
const { workbook: d, worksheet: h } = c, m = d.getUnitId(), g = h.getSheetId(), f = n.get(Ut), p = n.get(Ye), C = a[0].range, S = a[0].primary, I = jn(C, h, !1);
|
|
3758
|
-
if (!
|
|
3758
|
+
if (!N.equals(C, I))
|
|
3759
3759
|
return f.emit(p.t("sheets.info.partOfCell")), !1;
|
|
3760
3760
|
if (vu(s, h))
|
|
3761
3761
|
return f.emit(p.t("sheets.info.acrossMergedCell")), !1;
|
|
@@ -3869,7 +3869,7 @@ const qt = {
|
|
|
3869
3869
|
redoMutations: a.filter(Boolean)
|
|
3870
3870
|
}), !0) : !1;
|
|
3871
3871
|
}
|
|
3872
|
-
},
|
|
3872
|
+
}, No = "sheet.command.remove-row", _r = {
|
|
3873
3873
|
type: v.COMMAND,
|
|
3874
3874
|
id: "sheet.command.remove-row-by-range",
|
|
3875
3875
|
handler: (n, e) => {
|
|
@@ -3892,7 +3892,7 @@ const qt = {
|
|
|
3892
3892
|
subUnitId: l,
|
|
3893
3893
|
cellValue: w.getMatrix()
|
|
3894
3894
|
}, b = i.onCommandExecute({
|
|
3895
|
-
id:
|
|
3895
|
+
id: No,
|
|
3896
3896
|
params: { range: f }
|
|
3897
3897
|
});
|
|
3898
3898
|
C.push(...(D = b.preRedos) != null ? D : []), C.push({ id: Ge.id, params: S }), C.push(...(T = b.redos) != null ? T : []), p.push(...(P = b.preUndos) != null ? P : []), p.push({ id: je.id, params: I }), p.push({ id: X.id, params: y }), p.push(...(U = b.undos) != null ? U : []), h.push(...C), d.unshift(...p);
|
|
@@ -3906,7 +3906,7 @@ const qt = {
|
|
|
3906
3906
|
}
|
|
3907
3907
|
}, Yn = {
|
|
3908
3908
|
type: v.COMMAND,
|
|
3909
|
-
id:
|
|
3909
|
+
id: No,
|
|
3910
3910
|
handler: async (n, e) => {
|
|
3911
3911
|
var h;
|
|
3912
3912
|
const t = n.get(H), o = n.get(F), s = n.get(E);
|
|
@@ -3928,7 +3928,7 @@ const qt = {
|
|
|
3928
3928
|
subUnitId: l
|
|
3929
3929
|
}) : !1;
|
|
3930
3930
|
}
|
|
3931
|
-
},
|
|
3931
|
+
}, Oo = "sheet.command.remove-col", yr = {
|
|
3932
3932
|
type: v.COMMAND,
|
|
3933
3933
|
id: "sheet.command.remove-col-by-range",
|
|
3934
3934
|
handler: (n, e) => {
|
|
@@ -3946,7 +3946,7 @@ const qt = {
|
|
|
3946
3946
|
subUnitId: l,
|
|
3947
3947
|
cellValue: h.getMatrix()
|
|
3948
3948
|
}, g = i.onCommandExecute({
|
|
3949
|
-
id:
|
|
3949
|
+
id: Oo,
|
|
3950
3950
|
params: { range: a }
|
|
3951
3951
|
}), f = n.get(E);
|
|
3952
3952
|
return z(
|
|
@@ -3974,7 +3974,7 @@ const qt = {
|
|
|
3974
3974
|
}
|
|
3975
3975
|
}, qn = {
|
|
3976
3976
|
type: v.COMMAND,
|
|
3977
|
-
id:
|
|
3977
|
+
id: Oo,
|
|
3978
3978
|
handler: async (n, e) => {
|
|
3979
3979
|
var h;
|
|
3980
3980
|
const t = n.get(H), o = n.get(F), s = n.get(E);
|
|
@@ -4028,7 +4028,7 @@ const qt = {
|
|
|
4028
4028
|
return {
|
|
4029
4029
|
unitId: e.unitId,
|
|
4030
4030
|
subUnitId: e.subUnitId,
|
|
4031
|
-
ranges:
|
|
4031
|
+
ranges: O.deepClone(e.ranges)
|
|
4032
4032
|
};
|
|
4033
4033
|
}, ne = {
|
|
4034
4034
|
id: "sheet.mutation.add-worksheet-merge",
|
|
@@ -4055,7 +4055,7 @@ const qt = {
|
|
|
4055
4055
|
for (let l = 0; l < a.length; l++)
|
|
4056
4056
|
for (let c = i.length - 1; c >= 0; c--) {
|
|
4057
4057
|
const d = i[c], h = a[l];
|
|
4058
|
-
|
|
4058
|
+
N.intersects(d, h) && u.push(i[c]);
|
|
4059
4059
|
}
|
|
4060
4060
|
return {
|
|
4061
4061
|
unitId: e.unitId,
|
|
@@ -4075,7 +4075,7 @@ const qt = {
|
|
|
4075
4075
|
for (let u = 0; u < a.length; u++)
|
|
4076
4076
|
for (let l = i.length - 1; l >= 0; l--) {
|
|
4077
4077
|
const c = i[l], d = a[u];
|
|
4078
|
-
|
|
4078
|
+
N.intersects(c, d) && i.splice(l, 1);
|
|
4079
4079
|
}
|
|
4080
4080
|
return s.getSpanModel().rebuild(i), !0;
|
|
4081
4081
|
}
|
|
@@ -4093,14 +4093,14 @@ const qt = {
|
|
|
4093
4093
|
unitId: l,
|
|
4094
4094
|
subUnitId: u,
|
|
4095
4095
|
ranges: i
|
|
4096
|
-
}, m = c.getConfig().mergeData.filter((j) => i.some((Z) =>
|
|
4096
|
+
}, m = c.getConfig().mergeData.filter((j) => i.some((Z) => N.intersects(Z, j)));
|
|
4097
4097
|
if (!m.length) return !1;
|
|
4098
4098
|
const g = we(
|
|
4099
4099
|
n,
|
|
4100
4100
|
d
|
|
4101
4101
|
), f = t.getCurrentSelections();
|
|
4102
4102
|
if (!(f != null && f.length)) return !1;
|
|
4103
|
-
const p =
|
|
4103
|
+
const p = O.deepClone(f), C = O.deepClone(f), S = C[C.length - 1], { startRow: I, startColumn: w } = S.range;
|
|
4104
4104
|
S.primary = {
|
|
4105
4105
|
startRow: I,
|
|
4106
4106
|
startColumn: w,
|
|
@@ -4166,7 +4166,7 @@ const bu = (n) => {
|
|
|
4166
4166
|
const l = new G();
|
|
4167
4167
|
K.foreach(s, (d, h) => {
|
|
4168
4168
|
if (r.hasOwnProperty(d)) {
|
|
4169
|
-
const m = r[d], g =
|
|
4169
|
+
const m = r[d], g = O.deepClone(u.getCellRaw(m, h));
|
|
4170
4170
|
l.setValue(d, h, g);
|
|
4171
4171
|
}
|
|
4172
4172
|
});
|
|
@@ -4207,7 +4207,7 @@ const bu = (n) => {
|
|
|
4207
4207
|
}), !0) : !1;
|
|
4208
4208
|
}
|
|
4209
4209
|
};
|
|
4210
|
-
class
|
|
4210
|
+
class Ot {
|
|
4211
4211
|
constructor() {
|
|
4212
4212
|
R(this, "_borderInfo", {
|
|
4213
4213
|
type: le.ALL,
|
|
@@ -4254,7 +4254,7 @@ const Ao = (n, e, t, o) => {
|
|
|
4254
4254
|
let l = t;
|
|
4255
4255
|
if (u && (t.bc_tr || t.ml_tr || t.bl_tr || t.tl_mr || t.tl_bc || t.tl_br)) {
|
|
4256
4256
|
if (o) {
|
|
4257
|
-
const h =
|
|
4257
|
+
const h = O.deepClone(
|
|
4258
4258
|
(c = s.getValue(u.startRow, u.startColumn)) == null ? void 0 : c.s
|
|
4259
4259
|
);
|
|
4260
4260
|
l = h != null && h.bd ? Object.assign(h.bd, t) : t;
|
|
@@ -4266,7 +4266,7 @@ const Ao = (n, e, t, o) => {
|
|
|
4266
4266
|
});
|
|
4267
4267
|
} else {
|
|
4268
4268
|
if (o) {
|
|
4269
|
-
const h =
|
|
4269
|
+
const h = O.deepClone((d = s.getValue(i, a)) == null ? void 0 : d.s);
|
|
4270
4270
|
l = h != null && h.bd ? Object.assign(h.bd, t) : t;
|
|
4271
4271
|
}
|
|
4272
4272
|
s.setValue(i, a, { s: { bd: l } });
|
|
@@ -4382,7 +4382,7 @@ const ku = (n) => {
|
|
|
4382
4382
|
const m = (c = t.getValue(l.startRow, l.startColumn)) == null ? void 0 : c.s;
|
|
4383
4383
|
l.startColumn !== e.startColumn && t.setValue(a, u, {
|
|
4384
4384
|
s: {
|
|
4385
|
-
bd: m != null && m.bd ? Object.assign(m.bd, { l:
|
|
4385
|
+
bd: m != null && m.bd ? Object.assign(m.bd, { l: O.deepClone(o) }) : { l: O.deepClone(o) }
|
|
4386
4386
|
}
|
|
4387
4387
|
});
|
|
4388
4388
|
} else {
|
|
@@ -4390,7 +4390,7 @@ const ku = (n) => {
|
|
|
4390
4390
|
const m = (d = t.getValue(a, u)) == null ? void 0 : d.s;
|
|
4391
4391
|
t.setValue(a, u, {
|
|
4392
4392
|
s: {
|
|
4393
|
-
bd: m != null && m.bd ? Object.assign(m.bd, { r:
|
|
4393
|
+
bd: m != null && m.bd ? Object.assign(m.bd, { r: O.deepClone(o) }) : { r: O.deepClone(o) }
|
|
4394
4394
|
}
|
|
4395
4395
|
});
|
|
4396
4396
|
}
|
|
@@ -4398,7 +4398,7 @@ const ku = (n) => {
|
|
|
4398
4398
|
const m = (h = t.getValue(a, u)) == null ? void 0 : h.s;
|
|
4399
4399
|
t.setValue(a, u, {
|
|
4400
4400
|
s: {
|
|
4401
|
-
bd: m != null && m.bd ? Object.assign(m.bd, { l:
|
|
4401
|
+
bd: m != null && m.bd ? Object.assign(m.bd, { l: O.deepClone(o) }) : { l: O.deepClone(o) }
|
|
4402
4402
|
}
|
|
4403
4403
|
});
|
|
4404
4404
|
}
|
|
@@ -4410,7 +4410,7 @@ const ku = (n) => {
|
|
|
4410
4410
|
const m = (c = t.getValue(l.startRow, l.startColumn)) == null ? void 0 : c.s;
|
|
4411
4411
|
l.startRow !== e.startRow && t.setValue(a, u, {
|
|
4412
4412
|
s: {
|
|
4413
|
-
bd: m != null && m.bd ? Object.assign(m.bd, { t:
|
|
4413
|
+
bd: m != null && m.bd ? Object.assign(m.bd, { t: O.deepClone(o) }) : { t: O.deepClone(o) }
|
|
4414
4414
|
}
|
|
4415
4415
|
});
|
|
4416
4416
|
} else {
|
|
@@ -4418,7 +4418,7 @@ const ku = (n) => {
|
|
|
4418
4418
|
const m = (d = t.getValue(a, u)) == null ? void 0 : d.s;
|
|
4419
4419
|
t.setValue(a, u, {
|
|
4420
4420
|
s: {
|
|
4421
|
-
bd: m != null && m.bd ? Object.assign(m.bd, { b:
|
|
4421
|
+
bd: m != null && m.bd ? Object.assign(m.bd, { b: O.deepClone(o) }) : { b: O.deepClone(o) }
|
|
4422
4422
|
}
|
|
4423
4423
|
});
|
|
4424
4424
|
}
|
|
@@ -4426,7 +4426,7 @@ const ku = (n) => {
|
|
|
4426
4426
|
const m = (h = t.getValue(a, u)) == null ? void 0 : h.s;
|
|
4427
4427
|
t.setValue(a, u, {
|
|
4428
4428
|
s: {
|
|
4429
|
-
bd: m != null && m.bd ? Object.assign(m.bd, { t:
|
|
4429
|
+
bd: m != null && m.bd ? Object.assign(m.bd, { t: O.deepClone(o) }) : { t: O.deepClone(o) }
|
|
4430
4430
|
}
|
|
4431
4431
|
});
|
|
4432
4432
|
}
|
|
@@ -4437,14 +4437,14 @@ function Tu(n) {
|
|
|
4437
4437
|
const { borderStyle: e, tl_br: t, tl_bc: o, tl_mr: s, bl_tr: r, ml_tr: i, bc_tr: a } = n, u = (l, c, d) => {
|
|
4438
4438
|
Ao(n, l, c, d);
|
|
4439
4439
|
};
|
|
4440
|
-
t && u(n.range, { tl_br:
|
|
4440
|
+
t && u(n.range, { tl_br: O.deepClone(e) }, !0), o && u(n.range, { tl_bc: O.deepClone(e) }, !0), s && u(n.range, { tl_mr: O.deepClone(e) }, !0), r && u(n.range, { bl_tr: O.deepClone(e) }, !0), i && u(n.range, { ml_tr: O.deepClone(e) }, !0), a && u(n.range, { bc_tr: O.deepClone(e) }, !0);
|
|
4441
4441
|
}
|
|
4442
4442
|
const Pu = (n) => {
|
|
4443
4443
|
const { top: e, left: t, right: o, bottom: s, borderStyle: r, bottomRange: i, topRange: a, leftRange: u, rightRange: l, bottomRangeOut: c, topRangeOut: d, leftRangeOut: h, rightRangeOut: m } = n, g = (f, p, C) => {
|
|
4444
4444
|
Ao(n, f, p, C);
|
|
4445
4445
|
};
|
|
4446
|
-
e && (g(d, { b: null }), g(a, { t:
|
|
4447
|
-
},
|
|
4446
|
+
e && (g(d, { b: null }), g(a, { t: O.deepClone(r) }, !0)), s && (g(c, { t: null }), g(i, { b: O.deepClone(r) }, !0)), t && (g(h, { r: null }), g(u, { l: O.deepClone(r) }, !0)), o && (g(m, { l: null }), g(l, { r: O.deepClone(r) }, !0));
|
|
4447
|
+
}, Nu = (n) => {
|
|
4448
4448
|
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: m, ml_tr: g, bc_tr: f, topRange: p, bottomRange: C, leftRange: S, rightRange: I, topRangeOut: w, bottomRangeOut: y, leftRangeOut: b, rightRangeOut: D } = n, T = (P, U, x) => {
|
|
4449
4449
|
Ao(n, P, U, x);
|
|
4450
4450
|
};
|
|
@@ -4524,7 +4524,7 @@ const Pu = (n) => {
|
|
|
4524
4524
|
type: v.COMMAND,
|
|
4525
4525
|
handler: (n, e) => {
|
|
4526
4526
|
var C;
|
|
4527
|
-
const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(
|
|
4527
|
+
const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(Ot), a = k(s, e);
|
|
4528
4528
|
if (!a) return !1;
|
|
4529
4529
|
const u = (e == null ? void 0 : e.ranges) || ((C = r.getCurrentSelections()) == null ? void 0 : C.map((S) => S.range));
|
|
4530
4530
|
if (!(u != null && u.length))
|
|
@@ -4532,7 +4532,7 @@ const Pu = (n) => {
|
|
|
4532
4532
|
const { activeBorderType: l } = i.getBorderInfo();
|
|
4533
4533
|
if (!l) return !1;
|
|
4534
4534
|
const c = Uu(i, a, u);
|
|
4535
|
-
ku(c), Pu(c), Tu(c),
|
|
4535
|
+
ku(c), Pu(c), Tu(c), Nu(c);
|
|
4536
4536
|
const { unitId: d, subUnitId: h, mr: m } = c, g = {
|
|
4537
4537
|
unitId: d,
|
|
4538
4538
|
subUnitId: h,
|
|
@@ -4547,33 +4547,33 @@ const Pu = (n) => {
|
|
|
4547
4547
|
redoMutations: [{ id: X.id, params: g }]
|
|
4548
4548
|
}), !0) : !1;
|
|
4549
4549
|
}
|
|
4550
|
-
},
|
|
4550
|
+
}, Ou = {
|
|
4551
4551
|
id: "sheet.command.set-border-position",
|
|
4552
4552
|
type: v.COMMAND,
|
|
4553
4553
|
handler: (n, e) => {
|
|
4554
4554
|
if (!e.value) return !1;
|
|
4555
4555
|
const t = n.get(E);
|
|
4556
|
-
return n.get(
|
|
4556
|
+
return n.get(Ot).setType(e.value), t.syncExecuteCommand(an.id);
|
|
4557
4557
|
}
|
|
4558
4558
|
}, Du = {
|
|
4559
4559
|
id: "sheet.command.set-border-style",
|
|
4560
4560
|
type: v.COMMAND,
|
|
4561
4561
|
handler: (n, e) => {
|
|
4562
4562
|
const t = n.get(E);
|
|
4563
|
-
return n.get(
|
|
4563
|
+
return n.get(Ot).setStyle(e.value), t.syncExecuteCommand(an.id);
|
|
4564
4564
|
}
|
|
4565
4565
|
}, Au = {
|
|
4566
4566
|
id: "sheet.command.set-border-color",
|
|
4567
4567
|
type: v.COMMAND,
|
|
4568
4568
|
handler: (n, e) => {
|
|
4569
4569
|
const t = n.get(E);
|
|
4570
|
-
return n.get(
|
|
4570
|
+
return n.get(Ot).setColor(e.value), t.syncExecuteCommand(an.id);
|
|
4571
4571
|
}
|
|
4572
4572
|
}, xu = {
|
|
4573
4573
|
id: "sheet.command.set-border-basic",
|
|
4574
4574
|
type: v.COMMAND,
|
|
4575
4575
|
handler: (n, e) => {
|
|
4576
|
-
const { unitId: t, subUnitId: o, value: s, ranges: r } = e, { type: i, color: a, style: u } = s, l = n.get(E), c = n.get(
|
|
4576
|
+
const { unitId: t, subUnitId: o, value: s, ranges: r } = e, { type: i, color: a, style: u } = s, l = n.get(E), c = n.get(Ot);
|
|
4577
4577
|
return c.setType(i), a && c.setColor(a), c.setStyle(u), l.syncExecuteCommand(an.id, {
|
|
4578
4578
|
unitId: t,
|
|
4579
4579
|
subUnitId: o,
|
|
@@ -4584,7 +4584,7 @@ const Pu = (n) => {
|
|
|
4584
4584
|
function Wu(n, e) {
|
|
4585
4585
|
if (n == null)
|
|
4586
4586
|
return n;
|
|
4587
|
-
const t =
|
|
4587
|
+
const t = O.deepClone(n);
|
|
4588
4588
|
if (e == null)
|
|
4589
4589
|
return t;
|
|
4590
4590
|
const o = {};
|
|
@@ -4593,7 +4593,7 @@ function Wu(n, e) {
|
|
|
4593
4593
|
function $u(n, e) {
|
|
4594
4594
|
if (n == null)
|
|
4595
4595
|
return n;
|
|
4596
|
-
const t =
|
|
4596
|
+
const t = O.deepClone(n);
|
|
4597
4597
|
if (e == null)
|
|
4598
4598
|
return t;
|
|
4599
4599
|
const o = {};
|
|
@@ -5148,7 +5148,7 @@ const Tr = {
|
|
|
5148
5148
|
]
|
|
5149
5149
|
}), !0;
|
|
5150
5150
|
}
|
|
5151
|
-
},
|
|
5151
|
+
}, Nr = {
|
|
5152
5152
|
type: v.COMMAND,
|
|
5153
5153
|
id: "sheet.command.set-selected-rows-visible",
|
|
5154
5154
|
handler: async (n) => {
|
|
@@ -5164,7 +5164,7 @@ const Tr = {
|
|
|
5164
5164
|
ranges: l
|
|
5165
5165
|
});
|
|
5166
5166
|
}
|
|
5167
|
-
},
|
|
5167
|
+
}, Or = {
|
|
5168
5168
|
type: v.COMMAND,
|
|
5169
5169
|
id: "sheet.command.set-rows-hidden",
|
|
5170
5170
|
handler: (n, e) => {
|
|
@@ -5192,7 +5192,7 @@ const Tr = {
|
|
|
5192
5192
|
primary: Se(T, d),
|
|
5193
5193
|
style: null
|
|
5194
5194
|
}))
|
|
5195
|
-
}, p = i.onCommandExecute({ id:
|
|
5195
|
+
}, p = i.onCommandExecute({ id: Or.id, params: h });
|
|
5196
5196
|
return z([
|
|
5197
5197
|
...(w = p.preRedos) != null ? w : [],
|
|
5198
5198
|
{ id: en.id, params: h },
|
|
@@ -5260,7 +5260,7 @@ const Re = {
|
|
|
5260
5260
|
if (!(h != null && h.length))
|
|
5261
5261
|
return !1;
|
|
5262
5262
|
const m = new G(), g = Ya(i);
|
|
5263
|
-
if (
|
|
5263
|
+
if (O.isArray(u.value))
|
|
5264
5264
|
for (let b = 0; b < h.length; b++)
|
|
5265
5265
|
g.forOperableEach(h[b], (D, T, P) => {
|
|
5266
5266
|
m.setValue(D, T, {
|
|
@@ -5558,7 +5558,7 @@ const Re = {
|
|
|
5558
5558
|
}, ll = (n, e) => {
|
|
5559
5559
|
const r = n.get(M).getUniverSheetInstance(e.unitId).getSheetBySheetId(e.subUnitId).getConfig().tabColor;
|
|
5560
5560
|
return {
|
|
5561
|
-
...
|
|
5561
|
+
...O.deepClone(e),
|
|
5562
5562
|
color: r
|
|
5563
5563
|
};
|
|
5564
5564
|
}, Rn = {
|
|
@@ -5703,7 +5703,7 @@ const Re = {
|
|
|
5703
5703
|
} else p === L.COLUMN ? C = {
|
|
5704
5704
|
subUnitId: l,
|
|
5705
5705
|
unitId: u,
|
|
5706
|
-
ranges: f.map((D) =>
|
|
5706
|
+
ranges: f.map((D) => N.clone(D.range)),
|
|
5707
5707
|
colWidth: m
|
|
5708
5708
|
} : C = {
|
|
5709
5709
|
subUnitId: l,
|
|
@@ -5885,7 +5885,7 @@ const Ft = {
|
|
|
5885
5885
|
}), !0) : !1;
|
|
5886
5886
|
}
|
|
5887
5887
|
}, Rl = (n, e) => ({
|
|
5888
|
-
...
|
|
5888
|
+
...O.deepClone(e),
|
|
5889
5889
|
toOrder: e.fromOrder,
|
|
5890
5890
|
fromOrder: e.toOrder
|
|
5891
5891
|
}), pn = {
|
|
@@ -5997,7 +5997,7 @@ class Br {
|
|
|
5997
5997
|
this.unitId = e, this.subUnitId = t, this.permissionId = o, this.id = `${A.SelectRange}.${_.ManageCollaborator}.${o}`;
|
|
5998
5998
|
}
|
|
5999
5999
|
}
|
|
6000
|
-
const ve = () => [yo,
|
|
6000
|
+
const ve = () => [yo, Ne, Br, Hr], ct = [_.Edit, _.View, _.ManageCollaborator, _.Delete], Xd = (n = "unitId", e = "subUnitId", t = "permissionId") => ve().reduce((o, s) => {
|
|
6001
6001
|
const r = new s(n, e, t);
|
|
6002
6002
|
return o[r.subType] = r.value, o;
|
|
6003
6003
|
}, {}), tn = () => [
|
|
@@ -6039,7 +6039,7 @@ const ve = () => [yo, Oe, Br, Hr], ct = [_.Edit, _.View, _.ManageCollaborator, _
|
|
|
6039
6039
|
_.ViewHistory,
|
|
6040
6040
|
_.CreatePermissionObject
|
|
6041
6041
|
], Ie = () => [
|
|
6042
|
-
|
|
6042
|
+
Oe,
|
|
6043
6043
|
Gn,
|
|
6044
6044
|
ur,
|
|
6045
6045
|
tr
|
|
@@ -6383,7 +6383,7 @@ const $o = {
|
|
|
6383
6383
|
} else f === L.ROW ? p = {
|
|
6384
6384
|
subUnitId: a,
|
|
6385
6385
|
unitId: u,
|
|
6386
|
-
ranges: g.map((x) =>
|
|
6386
|
+
ranges: g.map((x) => N.clone(x.range)),
|
|
6387
6387
|
rowHeight: h
|
|
6388
6388
|
} : p = {
|
|
6389
6389
|
subUnitId: a,
|
|
@@ -6655,7 +6655,7 @@ function Pl(n, e, t, o, s = !1) {
|
|
|
6655
6655
|
lastRow: p
|
|
6656
6656
|
};
|
|
6657
6657
|
}
|
|
6658
|
-
const
|
|
6658
|
+
const Nl = {
|
|
6659
6659
|
type: v.COMMAND,
|
|
6660
6660
|
id: "sheet.command.split-text-to-columns",
|
|
6661
6661
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -6725,7 +6725,7 @@ const Ol = {
|
|
|
6725
6725
|
redoMutations: I
|
|
6726
6726
|
}), !0) : !1;
|
|
6727
6727
|
}
|
|
6728
|
-
},
|
|
6728
|
+
}, Ol = {
|
|
6729
6729
|
id: "sheet.command.toggle-cell-checkbox",
|
|
6730
6730
|
type: v.COMMAND,
|
|
6731
6731
|
handler: (n, e) => {
|
|
@@ -6737,7 +6737,7 @@ const Ol = {
|
|
|
6737
6737
|
const h = l.getCell(s, r);
|
|
6738
6738
|
if (!(h != null && h.p))
|
|
6739
6739
|
return !1;
|
|
6740
|
-
const m =
|
|
6740
|
+
const m = O.deepClone(h.p), g = new pi(m), f = Ci.paragraph.bullet.toggleChecklist({
|
|
6741
6741
|
document: g,
|
|
6742
6742
|
paragraphIndex: i
|
|
6743
6743
|
});
|
|
@@ -7048,7 +7048,7 @@ let En = class extends ue {
|
|
|
7048
7048
|
Mo,
|
|
7049
7049
|
Vs,
|
|
7050
7050
|
Pt,
|
|
7051
|
-
|
|
7051
|
+
Nt,
|
|
7052
7052
|
xo,
|
|
7053
7053
|
Lo,
|
|
7054
7054
|
fu,
|
|
@@ -7082,7 +7082,7 @@ let En = class extends ue {
|
|
|
7082
7082
|
xu,
|
|
7083
7083
|
Au,
|
|
7084
7084
|
an,
|
|
7085
|
-
|
|
7085
|
+
Ou,
|
|
7086
7086
|
Du,
|
|
7087
7087
|
Ur,
|
|
7088
7088
|
Xt,
|
|
@@ -7096,11 +7096,11 @@ let En = class extends ue {
|
|
|
7096
7096
|
il,
|
|
7097
7097
|
sn,
|
|
7098
7098
|
Ho,
|
|
7099
|
-
|
|
7099
|
+
Or,
|
|
7100
7100
|
qu,
|
|
7101
7101
|
Bt,
|
|
7102
7102
|
Er,
|
|
7103
|
-
|
|
7103
|
+
Nr,
|
|
7104
7104
|
Xn,
|
|
7105
7105
|
Zn,
|
|
7106
7106
|
Re,
|
|
@@ -7150,10 +7150,10 @@ let En = class extends ue {
|
|
|
7150
7150
|
Ae,
|
|
7151
7151
|
Je,
|
|
7152
7152
|
ge,
|
|
7153
|
-
|
|
7153
|
+
Ol,
|
|
7154
7154
|
Ft,
|
|
7155
7155
|
ml,
|
|
7156
|
-
|
|
7156
|
+
Nl,
|
|
7157
7157
|
// range theme
|
|
7158
7158
|
Jt,
|
|
7159
7159
|
Kt,
|
|
@@ -7277,15 +7277,15 @@ let kn = class extends ue {
|
|
|
7277
7277
|
}
|
|
7278
7278
|
};
|
|
7279
7279
|
kn = Yl([
|
|
7280
|
-
rs(0,
|
|
7280
|
+
rs(0, Ns),
|
|
7281
7281
|
rs(1, on)
|
|
7282
7282
|
], kn);
|
|
7283
7283
|
const W = {
|
|
7284
7284
|
MoveRangeCommandId: Ls,
|
|
7285
7285
|
InsertRowCommandId: Rr,
|
|
7286
7286
|
InsertColCommandId: Cr,
|
|
7287
|
-
RemoveColCommandId:
|
|
7288
|
-
RemoveRowCommandId:
|
|
7287
|
+
RemoveColCommandId: Oo,
|
|
7288
|
+
RemoveRowCommandId: No,
|
|
7289
7289
|
DeleteRangeMoveLeftCommandId: gr,
|
|
7290
7290
|
DeleteRangeMoveUpCommandId: fr,
|
|
7291
7291
|
InsertRangeMoveDownCommandId: lu,
|
|
@@ -7417,13 +7417,13 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
|
|
|
7417
7417
|
if (!t || !o)
|
|
7418
7418
|
return [];
|
|
7419
7419
|
const s = [];
|
|
7420
|
-
if (
|
|
7420
|
+
if (N.contains(t, e) && s.push({
|
|
7421
7421
|
type: q.Delete
|
|
7422
|
-
}),
|
|
7422
|
+
}), N.contains(o, e)) {
|
|
7423
7423
|
s.push({
|
|
7424
7424
|
type: q.Delete
|
|
7425
7425
|
});
|
|
7426
|
-
const a =
|
|
7426
|
+
const a = N.getRelativeRange(e, o), u = N.getPositionRange(a, t);
|
|
7427
7427
|
return [
|
|
7428
7428
|
{
|
|
7429
7429
|
type: q.Set,
|
|
@@ -7437,17 +7437,17 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
|
|
|
7437
7437
|
const t = (d = n.params) == null ? void 0 : d.toRange, o = (h = n.params) == null ? void 0 : h.fromRange;
|
|
7438
7438
|
if (!t || !o)
|
|
7439
7439
|
return [e];
|
|
7440
|
-
if (!
|
|
7440
|
+
if (!N.intersects(o, e) && !N.intersects(t, e))
|
|
7441
7441
|
return [e];
|
|
7442
|
-
if (
|
|
7443
|
-
const m =
|
|
7444
|
-
return [
|
|
7442
|
+
if (N.contains(o, e)) {
|
|
7443
|
+
const m = N.getRelativeRange(e, o);
|
|
7444
|
+
return [N.getPositionRange(m, t)];
|
|
7445
7445
|
}
|
|
7446
7446
|
const s = new G();
|
|
7447
7447
|
K.foreach(e, (m, g) => {
|
|
7448
7448
|
s.setValue(m, g, 1);
|
|
7449
7449
|
});
|
|
7450
|
-
const r = new G(), i =
|
|
7450
|
+
const r = new G(), i = N.getIntersects(o, e);
|
|
7451
7451
|
i && K.foreach(i, (m, g) => {
|
|
7452
7452
|
s.getValue(m, g) && (s.setValue(m, g, void 0), r.setValue(m, g, 1));
|
|
7453
7453
|
});
|
|
@@ -7470,14 +7470,14 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
|
|
|
7470
7470
|
o.startColumn < t.startColumn && o.endColumn >= t.startColumn && o.endColumn <= t.endColumn || // 6
|
|
7471
7471
|
o.startColumn < t.startColumn && o.endColumn >= t.endColumn
|
|
7472
7472
|
) {
|
|
7473
|
-
const i =
|
|
7473
|
+
const i = N.getIntersects(o, t);
|
|
7474
7474
|
if (i)
|
|
7475
7475
|
return { step: 0, length: -s(i) };
|
|
7476
7476
|
}
|
|
7477
7477
|
if (o.startColumn >= t.startColumn && o.endColumn <= t.endColumn && r(t) >= r(o))
|
|
7478
7478
|
return null;
|
|
7479
7479
|
if (o.startColumn >= t.startColumn && o.startColumn <= t.endColumn && o.endColumn > t.endColumn) {
|
|
7480
|
-
const i =
|
|
7480
|
+
const i = N.getIntersects(o, t);
|
|
7481
7481
|
if (i) {
|
|
7482
7482
|
const a = -s(i);
|
|
7483
7483
|
return { step: -(s(t) - s(i)), length: a };
|
|
@@ -7525,7 +7525,7 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
|
|
|
7525
7525
|
const { range: t, order: o } = n.params || {};
|
|
7526
7526
|
if (!t || !o)
|
|
7527
7527
|
return [];
|
|
7528
|
-
if (
|
|
7528
|
+
if (N.contains(t, e) && e.endRow === e.startRow) {
|
|
7529
7529
|
const s = [], r = e.startRow;
|
|
7530
7530
|
for (const i in o)
|
|
7531
7531
|
if (o[i] === r) {
|
|
@@ -7574,13 +7574,13 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
|
|
|
7574
7574
|
};
|
|
7575
7575
|
function sc(n, e, t) {
|
|
7576
7576
|
const o = [];
|
|
7577
|
-
if (
|
|
7577
|
+
if (N.contains(e, t) && o.push({
|
|
7578
7578
|
type: q.Delete
|
|
7579
|
-
}),
|
|
7579
|
+
}), N.contains(n, t)) {
|
|
7580
7580
|
o.push({
|
|
7581
7581
|
type: q.Delete
|
|
7582
7582
|
});
|
|
7583
|
-
const s =
|
|
7583
|
+
const s = N.getRelativeRange(t, n), r = N.getPositionRange(s, e);
|
|
7584
7584
|
return [
|
|
7585
7585
|
{
|
|
7586
7586
|
type: q.Set,
|
|
@@ -7632,7 +7632,7 @@ const rc = (n, e) => {
|
|
|
7632
7632
|
...t,
|
|
7633
7633
|
startRow: t.startRow,
|
|
7634
7634
|
endRow: Number.POSITIVE_INFINITY
|
|
7635
|
-
}, r =
|
|
7635
|
+
}, r = N.subtract(e, s), i = N.getIntersects(s, e);
|
|
7636
7636
|
if (!i)
|
|
7637
7637
|
return [e];
|
|
7638
7638
|
const a = new G();
|
|
@@ -7663,7 +7663,7 @@ const rc = (n, e) => {
|
|
|
7663
7663
|
...t,
|
|
7664
7664
|
startColumn: t.startColumn,
|
|
7665
7665
|
endColumn: Number.POSITIVE_INFINITY
|
|
7666
|
-
}, r =
|
|
7666
|
+
}, r = N.subtract(e, s), i = N.getIntersects(s, e);
|
|
7667
7667
|
if (!i)
|
|
7668
7668
|
return [e];
|
|
7669
7669
|
const a = new G();
|
|
@@ -7701,7 +7701,7 @@ const rc = (n, e) => {
|
|
|
7701
7701
|
endRow: t.endRow,
|
|
7702
7702
|
startColumn: t.startColumn,
|
|
7703
7703
|
endColumn: Number.POSITIVE_INFINITY
|
|
7704
|
-
}, s = t.endColumn - t.startColumn + 1, r =
|
|
7704
|
+
}, s = t.endColumn - t.startColumn + 1, r = N.getIntersects(t, e), i = N.subtract(e, o), a = N.getIntersects(o, e);
|
|
7705
7705
|
if (!r && !a)
|
|
7706
7706
|
return [e];
|
|
7707
7707
|
const u = new G();
|
|
@@ -7740,7 +7740,7 @@ const rc = (n, e) => {
|
|
|
7740
7740
|
...t,
|
|
7741
7741
|
startRow: t.startRow,
|
|
7742
7742
|
endRow: Number.POSITIVE_INFINITY
|
|
7743
|
-
}, s = t.endRow - t.startRow + 1, r =
|
|
7743
|
+
}, s = t.endRow - t.startRow + 1, r = N.getIntersects(t, e), i = N.subtract(e, o), a = N.getIntersects(o, e);
|
|
7744
7744
|
if (!r && !a)
|
|
7745
7745
|
return [e];
|
|
7746
7746
|
const u = new G();
|
|
@@ -7867,7 +7867,7 @@ const rc = (n, e) => {
|
|
|
7867
7867
|
}
|
|
7868
7868
|
}
|
|
7869
7869
|
return bt(t, n);
|
|
7870
|
-
}, oh = (n, e, t) => [Pt.id,
|
|
7870
|
+
}, oh = (n, e, t) => [Pt.id, Nt.id].includes(e.id) || Qr(e, t).some((r) => N.intersects(r, n)) ? is(n, e) : n, as = (n, e) => {
|
|
7871
7871
|
let t = [];
|
|
7872
7872
|
switch (e.id) {
|
|
7873
7873
|
case W.DeleteRangeMoveLeftCommandId:
|
|
@@ -7899,7 +7899,7 @@ const rc = (n, e) => {
|
|
|
7899
7899
|
}
|
|
7900
7900
|
const o = bt(t, n);
|
|
7901
7901
|
return o ? [o] : [];
|
|
7902
|
-
}, sh = (n, e, t) => [Pt.id,
|
|
7902
|
+
}, sh = (n, e, t) => [Pt.id, Nt.id, rn.id, To].includes(e.id) || Qr(e, t).some((r) => N.intersects(r, n)) ? as(n, e) : n;
|
|
7903
7903
|
function Cc(n, e) {
|
|
7904
7904
|
const { id: t, params: o } = e;
|
|
7905
7905
|
let s = {
|
|
@@ -8281,11 +8281,11 @@ class _c extends ue {
|
|
|
8281
8281
|
if (e.id === Tt.id)
|
|
8282
8282
|
return;
|
|
8283
8283
|
const i = Sc(e);
|
|
8284
|
-
if (i != null && i.some((a) =>
|
|
8284
|
+
if (i != null && i.some((a) => N.intersects(a, this._range)))
|
|
8285
8285
|
return;
|
|
8286
8286
|
}
|
|
8287
8287
|
const t = Cc(this._range, e);
|
|
8288
|
-
if (t &&
|
|
8288
|
+
if (t && N.equals(t, this._range))
|
|
8289
8289
|
return !1;
|
|
8290
8290
|
const o = this._range;
|
|
8291
8291
|
this._range = t, this._callback(o, t);
|
|
@@ -8446,7 +8446,7 @@ let Et = class extends ue {
|
|
|
8446
8446
|
endColumn: +c.endColumn,
|
|
8447
8447
|
rangeType: c.rangeType && +c.rangeType
|
|
8448
8448
|
};
|
|
8449
|
-
e.some((h) =>
|
|
8449
|
+
e.some((h) => N.intersects(h, d)) && l && l.forEach((h) => {
|
|
8450
8450
|
i.add(h);
|
|
8451
8451
|
});
|
|
8452
8452
|
}), [...i];
|
|
@@ -8600,7 +8600,7 @@ let Pn = class extends ue {
|
|
|
8600
8600
|
return { redos: [], undos: [] };
|
|
8601
8601
|
const a = i.getSheetId(), u = i.getConfig().mergeData, l = (o = e._selectionManagerService.getCurrentSelections()) == null ? void 0 : o.map((c) => c.range);
|
|
8602
8602
|
if (l && l.length > 0 && l.some(
|
|
8603
|
-
(d) => u.some((h) =>
|
|
8603
|
+
(d) => u.some((h) => N.intersects(h, d))
|
|
8604
8604
|
)) {
|
|
8605
8605
|
const d = {
|
|
8606
8606
|
unitId: r,
|
|
@@ -8625,7 +8625,7 @@ let Pn = class extends ue {
|
|
|
8625
8625
|
const u = k(this._univerInstanceService, { unitId: t, subUnitId: o });
|
|
8626
8626
|
if (!u)
|
|
8627
8627
|
return a;
|
|
8628
|
-
const { worksheet: l } = u, d = l.getMergeData().filter((h) => s.some((m) =>
|
|
8628
|
+
const { worksheet: l } = u, d = l.getMergeData().filter((h) => s.some((m) => N.intersects(h, m)));
|
|
8629
8629
|
return d.length ? (r.push({
|
|
8630
8630
|
id: oe.id,
|
|
8631
8631
|
params: {
|
|
@@ -8682,7 +8682,7 @@ let Pn = class extends ue {
|
|
|
8682
8682
|
const s = e.params;
|
|
8683
8683
|
return this._handleInsertRangeMoveDownCommand(s, t, o);
|
|
8684
8684
|
}
|
|
8685
|
-
case
|
|
8685
|
+
case Nt.id: {
|
|
8686
8686
|
const s = e.params;
|
|
8687
8687
|
return this._handleDeleteRangeMoveUpCommand(s, t, o);
|
|
8688
8688
|
}
|
|
@@ -8782,8 +8782,8 @@ let Pn = class extends ue {
|
|
|
8782
8782
|
const r = Ue(s, o);
|
|
8783
8783
|
if (!r)
|
|
8784
8784
|
return this._handleNull();
|
|
8785
|
-
const i = r.getMergeData(), a = i.filter((m) =>
|
|
8786
|
-
(m) => !i.some((g) =>
|
|
8785
|
+
const i = r.getMergeData(), a = i.filter((m) => N.intersects(m, e.fromRange)), u = i.filter((m) => N.intersects(m, e.toRange)), l = a.map((m) => N.getRelativeRange(m, e.fromRange)).map((m) => N.getPositionRange(m, e.toRange)), c = ei(l).filter(
|
|
8786
|
+
(m) => !i.some((g) => N.equals(m, g))
|
|
8787
8787
|
), d = [
|
|
8788
8788
|
{
|
|
8789
8789
|
id: oe.id,
|
|
@@ -8844,10 +8844,10 @@ let Pn = class extends ue {
|
|
|
8844
8844
|
const r = Ue(s, o);
|
|
8845
8845
|
if (!r)
|
|
8846
8846
|
return this._handleNull();
|
|
8847
|
-
const { range: i } = e, { startRow: a, endRow: u } = i, l =
|
|
8847
|
+
const { range: i } = e, { startRow: a, endRow: u } = i, l = O.deepClone(r.getMergeData()).reduce((C, S) => (a > S.startRow && a <= S.endRow && C.push(S), C), []);
|
|
8848
8848
|
if (l.length === 0)
|
|
8849
8849
|
return this._handleNull();
|
|
8850
|
-
const c =
|
|
8850
|
+
const c = O.deepClone(r.getMergeData()).reduce((C, S) => {
|
|
8851
8851
|
if (a > S.startRow && a <= S.endRow) {
|
|
8852
8852
|
const I = u - a + 1;
|
|
8853
8853
|
S.endRow += I, this._checkIsMergeCell(S) && C.push(S);
|
|
@@ -8883,10 +8883,10 @@ let Pn = class extends ue {
|
|
|
8883
8883
|
const i = Ue(r, o);
|
|
8884
8884
|
if (!i)
|
|
8885
8885
|
return this._handleNull();
|
|
8886
|
-
const { startColumn: a, endColumn: u } = s, l =
|
|
8886
|
+
const { startColumn: a, endColumn: u } = s, l = O.deepClone(i.getMergeData()).reduce((C, S) => (a > S.startColumn && a <= S.endColumn && C.push(S), C), []);
|
|
8887
8887
|
if (l.length === 0)
|
|
8888
8888
|
return this._handleNull();
|
|
8889
|
-
const c =
|
|
8889
|
+
const c = O.deepClone(i.getMergeData()).reduce((C, S) => {
|
|
8890
8890
|
if (a > S.startColumn && a <= S.endColumn) {
|
|
8891
8891
|
const I = u - a + 1;
|
|
8892
8892
|
S.endColumn += I, this._checkIsMergeCell(S) && C.push(S);
|
|
@@ -8922,11 +8922,11 @@ let Pn = class extends ue {
|
|
|
8922
8922
|
const r = Ue(s, o);
|
|
8923
8923
|
if (!r)
|
|
8924
8924
|
return this._handleNull();
|
|
8925
|
-
const { range: i } = e, { startColumn: a, endColumn: u } = i, l =
|
|
8925
|
+
const { range: i } = e, { startColumn: a, endColumn: u } = i, l = O.deepClone(r.getMergeData()).reduce((I, w) => (N.intersects(i, w) && I.push(w), I), []);
|
|
8926
8926
|
if (l.length === 0)
|
|
8927
8927
|
return this._handleNull();
|
|
8928
|
-
const c =
|
|
8929
|
-
if (
|
|
8928
|
+
const c = O.deepClone(r.getMergeData()).reduce((I, w) => {
|
|
8929
|
+
if (N.intersects(i, w)) {
|
|
8930
8930
|
if (a <= w.startColumn && u >= w.endColumn)
|
|
8931
8931
|
return I;
|
|
8932
8932
|
a >= w.startColumn && u <= w.endColumn ? w.endColumn -= u - a + 1 : a < w.startColumn ? (w.startColumn = a, w.endColumn -= u - a + 1) : u > w.endColumn && (w.endColumn = a - 1), this._checkIsMergeCell(w) && I.push(w);
|
|
@@ -8956,11 +8956,11 @@ let Pn = class extends ue {
|
|
|
8956
8956
|
const i = Ue(r, o);
|
|
8957
8957
|
if (!i)
|
|
8958
8958
|
return this._handleNull();
|
|
8959
|
-
const { startRow: a, endRow: u } = s, l =
|
|
8959
|
+
const { startRow: a, endRow: u } = s, l = O.deepClone(i.getMergeData()).reduce((I, w) => (N.intersects(s, w) && I.push(w), I), []);
|
|
8960
8960
|
if (l.length === 0)
|
|
8961
8961
|
return this._handleNull();
|
|
8962
|
-
const c =
|
|
8963
|
-
if (
|
|
8962
|
+
const c = O.deepClone(i.getMergeData()).reduce((I, w) => {
|
|
8963
|
+
if (N.intersects(s, w)) {
|
|
8964
8964
|
if (a <= w.startRow && u >= w.endRow)
|
|
8965
8965
|
return I;
|
|
8966
8966
|
a >= w.startRow && u <= w.endRow ? w.endRow -= u - a + 1 : a < w.startRow ? (w.startRow = a, w.endRow -= u - a + 1) : u > w.endRow && (w.endRow = a - 1), this._checkIsMergeCell(w) && I.push(w);
|
|
@@ -8993,7 +8993,7 @@ let Pn = class extends ue {
|
|
|
8993
8993
|
const i = e.range, a = r.getMaxColumns() - 1, u = r.getMergeData(), l = [], c = [];
|
|
8994
8994
|
u.forEach((f) => {
|
|
8995
8995
|
const { startRow: p, endRow: C, startColumn: S, endColumn: I } = i;
|
|
8996
|
-
if (
|
|
8996
|
+
if (N.intersects(
|
|
8997
8997
|
{
|
|
8998
8998
|
startRow: p,
|
|
8999
8999
|
startColumn: S,
|
|
@@ -9001,7 +9001,7 @@ let Pn = class extends ue {
|
|
|
9001
9001
|
endColumn: a
|
|
9002
9002
|
},
|
|
9003
9003
|
f
|
|
9004
|
-
) && (l.push(f),
|
|
9004
|
+
) && (l.push(f), N.contains(
|
|
9005
9005
|
{
|
|
9006
9006
|
startRow: p,
|
|
9007
9007
|
startColumn: S,
|
|
@@ -9065,7 +9065,7 @@ let Pn = class extends ue {
|
|
|
9065
9065
|
const i = e.range, a = r.getMaxRows() - 1, u = r.getMergeData(), l = [], c = [];
|
|
9066
9066
|
u.forEach((I) => {
|
|
9067
9067
|
const { startRow: w, startColumn: y, endColumn: b, endRow: D } = i;
|
|
9068
|
-
if (
|
|
9068
|
+
if (N.intersects({ startRow: w, startColumn: y, endRow: a, endColumn: b }, I) && (l.push(I), N.contains({ startRow: w, startColumn: y, endRow: a, endColumn: b }, I))) {
|
|
9069
9069
|
const U = D - w + 1;
|
|
9070
9070
|
c.push({
|
|
9071
9071
|
startRow: I.startRow + U,
|
|
@@ -9122,8 +9122,8 @@ let Pn = class extends ue {
|
|
|
9122
9122
|
const i = e.range, a = r.getMaxRows() - 1, u = r.getMergeData(), l = [], c = [];
|
|
9123
9123
|
u.forEach((I) => {
|
|
9124
9124
|
const { startRow: w, startColumn: y, endColumn: b, endRow: D } = i;
|
|
9125
|
-
if (
|
|
9126
|
-
const U = D - w + 1, x =
|
|
9125
|
+
if (N.intersects({ startRow: w, startColumn: y, endRow: a, endColumn: b }, I) && (l.push(I), N.contains({ startRow: w, startColumn: y, endRow: a, endColumn: b }, I))) {
|
|
9126
|
+
const U = D - w + 1, x = N.moveVertical(I, -U);
|
|
9127
9127
|
c.push(x);
|
|
9128
9128
|
}
|
|
9129
9129
|
});
|
|
@@ -9174,7 +9174,7 @@ let Pn = class extends ue {
|
|
|
9174
9174
|
const i = e.range, a = r.getMaxColumns() - 1, u = r.getMergeData(), l = [], c = [];
|
|
9175
9175
|
u.forEach((f) => {
|
|
9176
9176
|
const { startRow: p, endRow: C, startColumn: S, endColumn: I } = i;
|
|
9177
|
-
if (
|
|
9177
|
+
if (N.intersects(
|
|
9178
9178
|
{
|
|
9179
9179
|
startRow: p,
|
|
9180
9180
|
startColumn: S,
|
|
@@ -9182,7 +9182,7 @@ let Pn = class extends ue {
|
|
|
9182
9182
|
endColumn: a
|
|
9183
9183
|
},
|
|
9184
9184
|
f
|
|
9185
|
-
) && (l.push(f),
|
|
9185
|
+
) && (l.push(f), N.contains(
|
|
9186
9186
|
{
|
|
9187
9187
|
startRow: p,
|
|
9188
9188
|
startColumn: S,
|
|
@@ -9247,7 +9247,7 @@ let Pn = class extends ue {
|
|
|
9247
9247
|
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 = [];
|
|
9248
9248
|
c.forEach((f) => {
|
|
9249
9249
|
let { startRow: p, endRow: C, startColumn: S, endColumn: I, rangeType: w } = f;
|
|
9250
|
-
|
|
9250
|
+
N.intersects(f, s) || (i ? u < p && l > C ? (p -= a, C -= a) : u > C && l <= p && (p += a, C += a) : u < S && l > I ? (S -= a, I -= a) : u > I && l <= S && (S += a, I += a)), f.startRow === f.endRow && f.startColumn === f.endColumn || d.push({ startRow: p, endRow: C, startColumn: S, endColumn: I, rangeType: w });
|
|
9251
9251
|
}), o.setMergeData(d), this.disposableCollection.dispose();
|
|
9252
9252
|
const { unitId: h, subUnitId: m } = e.params, g = (f) => this.refRangeHandle(f, h, m);
|
|
9253
9253
|
d.forEach((f) => {
|
|
@@ -9288,12 +9288,12 @@ function Ee(n, e) {
|
|
|
9288
9288
|
function Ue(n, e) {
|
|
9289
9289
|
return e ? n.getSheetBySheetId(e) : n.getActiveSheet();
|
|
9290
9290
|
}
|
|
9291
|
-
var Pc = Object.getOwnPropertyDescriptor,
|
|
9291
|
+
var Pc = Object.getOwnPropertyDescriptor, Nc = (n, e, t, o) => {
|
|
9292
9292
|
for (var s = o > 1 ? void 0 : o ? Pc(e, t) : e, r = n.length - 1, i; r >= 0; r--)
|
|
9293
9293
|
(i = n[r]) && (s = i(s) || s);
|
|
9294
9294
|
return s;
|
|
9295
|
-
},
|
|
9296
|
-
let
|
|
9295
|
+
}, Oc = (n, e) => (t, o) => e(t, o, n);
|
|
9296
|
+
let Nn = class extends ue {
|
|
9297
9297
|
constructor(n) {
|
|
9298
9298
|
super(), this._sheetInterceptorService = n, this._initialize();
|
|
9299
9299
|
}
|
|
@@ -9317,15 +9317,15 @@ let On = class extends ue {
|
|
|
9317
9317
|
);
|
|
9318
9318
|
}
|
|
9319
9319
|
};
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
],
|
|
9320
|
+
Nn = Nc([
|
|
9321
|
+
Oc(0, $(F))
|
|
9322
|
+
], Nn);
|
|
9323
9323
|
var Dc = Object.getOwnPropertyDescriptor, Ac = (n, e, t, o) => {
|
|
9324
9324
|
for (var s = o > 1 ? void 0 : o ? Dc(e, t) : e, r = n.length - 1, i; r >= 0; r--)
|
|
9325
9325
|
(i = n[r]) && (s = i(s) || s);
|
|
9326
9326
|
return s;
|
|
9327
9327
|
}, Ve = (n, e) => (t, o) => e(t, o, n);
|
|
9328
|
-
let
|
|
9328
|
+
let On = class extends ue {
|
|
9329
9329
|
constructor(e, t, o, s, r, i, a, u, l, c) {
|
|
9330
9330
|
super();
|
|
9331
9331
|
R(this, "disposableCollection", new Gt());
|
|
@@ -9342,15 +9342,15 @@ let Nn = class extends ue {
|
|
|
9342
9342
|
case sn.id:
|
|
9343
9343
|
Es(t.value) && t.value.f ? (o = this._permissionCheckWithFormula(t), s = this._localeService.t("permission.dialog.formulaErr")) : o = this._permissionCheckBySetRangeValue({
|
|
9344
9344
|
workbookTypes: [Me],
|
|
9345
|
-
rangeTypes: [
|
|
9346
|
-
worksheetTypes: [In,
|
|
9345
|
+
rangeTypes: [Ne],
|
|
9346
|
+
worksheetTypes: [In, Oe]
|
|
9347
9347
|
}, t);
|
|
9348
9348
|
break;
|
|
9349
9349
|
case vo.id:
|
|
9350
9350
|
o = this.permissionCheckWithRanges({
|
|
9351
9351
|
workbookTypes: [Me],
|
|
9352
|
-
rangeTypes: [
|
|
9353
|
-
worksheetTypes: [In,
|
|
9352
|
+
rangeTypes: [Ne],
|
|
9353
|
+
worksheetTypes: [In, Oe]
|
|
9354
9354
|
}), s = this._localeService.t("permission.dialog.editErr");
|
|
9355
9355
|
break;
|
|
9356
9356
|
case xo.id:
|
|
@@ -9388,29 +9388,29 @@ let Nn = class extends ue {
|
|
|
9388
9388
|
case Xn.id:
|
|
9389
9389
|
o = this.permissionCheckWithRanges({
|
|
9390
9390
|
workbookTypes: [Me],
|
|
9391
|
-
rangeTypes: [
|
|
9392
|
-
worksheetTypes: [
|
|
9391
|
+
rangeTypes: [Ne],
|
|
9392
|
+
worksheetTypes: [Oe, $t]
|
|
9393
9393
|
}, t.ranges), s = this._localeService.t("permission.dialog.setRowColStyleErr");
|
|
9394
9394
|
break;
|
|
9395
9395
|
case Zn.id:
|
|
9396
9396
|
o = this.permissionCheckWithRanges({
|
|
9397
9397
|
workbookTypes: [Me],
|
|
9398
|
-
rangeTypes: [
|
|
9399
|
-
worksheetTypes: [
|
|
9398
|
+
rangeTypes: [Ne],
|
|
9399
|
+
worksheetTypes: [Oe, Vt]
|
|
9400
9400
|
}, t.ranges), s = this._localeService.t("permission.dialog.setRowColStyleErr");
|
|
9401
9401
|
break;
|
|
9402
9402
|
case Er.id:
|
|
9403
9403
|
o = this.permissionCheckWithRanges({
|
|
9404
9404
|
workbookTypes: [Me],
|
|
9405
|
-
rangeTypes: [
|
|
9406
|
-
worksheetTypes: [
|
|
9405
|
+
rangeTypes: [Ne],
|
|
9406
|
+
worksheetTypes: [Oe, $t]
|
|
9407
9407
|
}), s = this._localeService.t("permission.dialog.setRowColStyleErr");
|
|
9408
9408
|
break;
|
|
9409
|
-
case
|
|
9409
|
+
case Nr.id:
|
|
9410
9410
|
o = this.permissionCheckWithRanges({
|
|
9411
9411
|
workbookTypes: [Me],
|
|
9412
|
-
rangeTypes: [
|
|
9413
|
-
worksheetTypes: [
|
|
9412
|
+
rangeTypes: [Ne],
|
|
9413
|
+
worksheetTypes: [Oe, Vt]
|
|
9414
9414
|
}), s = this._localeService.t("permission.dialog.setRowColStyleErr");
|
|
9415
9415
|
break;
|
|
9416
9416
|
case zn.id:
|
|
@@ -9422,7 +9422,7 @@ let Nn = class extends ue {
|
|
|
9422
9422
|
case Pt.id:
|
|
9423
9423
|
o = this._permissionCheckWithInsertRangeMove("left"), s = this._localeService.t("permission.dialog.insertOrDeleteMoveRangeErr");
|
|
9424
9424
|
break;
|
|
9425
|
-
case
|
|
9425
|
+
case Nt.id:
|
|
9426
9426
|
o = this._permissionCheckWithInsertRangeMove("top"), s = this._localeService.t("permission.dialog.insertOrDeleteMoveRangeErr");
|
|
9427
9427
|
break;
|
|
9428
9428
|
}
|
|
@@ -9454,8 +9454,8 @@ let Nn = class extends ue {
|
|
|
9454
9454
|
const t = k(this._univerInstanceService);
|
|
9455
9455
|
if (!t)
|
|
9456
9456
|
return !1;
|
|
9457
|
-
const { worksheet: o, unitId: s, subUnitId: r } = t, i =
|
|
9458
|
-
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) =>
|
|
9457
|
+
const { worksheet: o, unitId: s, subUnitId: r } = t, i = O.deepClone((l = this._selectionManagerService.getCurrentLastSelection()) == null ? void 0 : l.range);
|
|
9458
|
+
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))));
|
|
9459
9459
|
}
|
|
9460
9460
|
_permissionCheckByWorksheetCommand(e, t, o) {
|
|
9461
9461
|
var l, c;
|
|
@@ -9506,7 +9506,7 @@ let Nn = class extends ue {
|
|
|
9506
9506
|
return !1;
|
|
9507
9507
|
const { workbookTypes: l, worksheetTypes: c, rangeTypes: d } = e, h = [];
|
|
9508
9508
|
return l && h.push(...l.map((g) => new g(o).id)), c && h.push(...c.map((g) => new g(o, s).id)), d && this._rangeProtectionRuleModel.getSubunitRuleList(o, s).forEach((g) => {
|
|
9509
|
-
u.some((p) => g.ranges.some((C) =>
|
|
9509
|
+
u.some((p) => g.ranges.some((C) => N.intersects(C, p))) && h.push(...d.map((p) => new p(o, s, g.permissionId).id));
|
|
9510
9510
|
}), h.length ? this._permissionService.composePermission(h).every((g) => g.value) : !0;
|
|
9511
9511
|
}
|
|
9512
9512
|
_permissionCheckByMoveCommand(e) {
|
|
@@ -9515,7 +9515,7 @@ let Nn = class extends ue {
|
|
|
9515
9515
|
return !1;
|
|
9516
9516
|
const { worksheet: o, unitId: s, subUnitId: r } = t, i = e.toRange;
|
|
9517
9517
|
i.endRow === o.getRowCount() - 1 ? i.endColumn = i.startColumn : i.endRow = i.startRow;
|
|
9518
|
-
const a = this._rangeProtectionRuleModel.getSubunitRuleList(s, r).reduce((u, l) => [...u, ...l.ranges], []).filter((u) =>
|
|
9518
|
+
const a = this._rangeProtectionRuleModel.getSubunitRuleList(s, r).reduce((u, l) => [...u, ...l.ranges], []).filter((u) => N.intersects(u, i));
|
|
9519
9519
|
return a.length > 0 ? !1 : (a.forEach((u) => {
|
|
9520
9520
|
var l, c;
|
|
9521
9521
|
for (let d = u.startRow; d <= u.endRow; d++)
|
|
@@ -9530,7 +9530,7 @@ let Nn = class extends ue {
|
|
|
9530
9530
|
const t = k(this._univerInstanceService);
|
|
9531
9531
|
if (!t)
|
|
9532
9532
|
return !1;
|
|
9533
|
-
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) =>
|
|
9533
|
+
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));
|
|
9534
9534
|
return a.length > 0 ? !1 : (a.forEach((u) => {
|
|
9535
9535
|
var l, c;
|
|
9536
9536
|
for (let d = u.startRow; d <= u.endRow; d++)
|
|
@@ -9607,14 +9607,14 @@ let Nn = class extends ue {
|
|
|
9607
9607
|
const c = k(this._univerInstanceService);
|
|
9608
9608
|
if (!c)
|
|
9609
9609
|
return !1;
|
|
9610
|
-
const d = e.unitId || c.unitId, h = e.subUnitId || c.subUnitId, g = this._rangeProtectionRuleModel.getSubunitRuleList(d, h).filter((p) => p.ranges.some((C) =>
|
|
9610
|
+
const d = e.unitId || c.unitId, h = e.subUnitId || c.subUnitId, g = this._rangeProtectionRuleModel.getSubunitRuleList(d, h).filter((p) => p.ranges.some((C) => N.intersects(C, o))).map((p) => new Ne(d, h, p.permissionId).id);
|
|
9611
9611
|
if (!this._permissionService.composePermission(g).every((p) => p.value))
|
|
9612
9612
|
return !1;
|
|
9613
9613
|
}
|
|
9614
9614
|
return !0;
|
|
9615
9615
|
}
|
|
9616
9616
|
};
|
|
9617
|
-
|
|
9617
|
+
On = Ac([
|
|
9618
9618
|
Ve(0, E),
|
|
9619
9619
|
Ve(1, M),
|
|
9620
9620
|
Ve(2, Fe),
|
|
@@ -9624,8 +9624,8 @@ Nn = Ac([
|
|
|
9624
9624
|
Ve(6, $(Ye)),
|
|
9625
9625
|
Ve(7, $($i)),
|
|
9626
9626
|
Ve(8, ys),
|
|
9627
|
-
Ve(9,
|
|
9628
|
-
],
|
|
9627
|
+
Ve(9, Ns)
|
|
9628
|
+
], On);
|
|
9629
9629
|
var xc = Object.getOwnPropertyDescriptor, Wc = (n, e, t, o) => {
|
|
9630
9630
|
for (var s = o > 1 ? void 0 : o ? xc(e, t) : e, r = n.length - 1, i; r >= 0; r--)
|
|
9631
9631
|
(i = n[r]) && (s = i(s) || s);
|
|
@@ -9726,7 +9726,7 @@ let Rt = class extends ue {
|
|
|
9726
9726
|
}
|
|
9727
9727
|
_getSelectionActions(e, t, o) {
|
|
9728
9728
|
var l, c, d, h, m, g, f, p, C, S, I, w;
|
|
9729
|
-
const s = (d = (c = this._permissionService.getPermissionPoint((l = new
|
|
9729
|
+
const s = (d = (c = this._permissionService.getPermissionPoint((l = new Ne(e, t, o.permissionId)) == null ? void 0 : l.id)) == null ? void 0 : c.value) != null ? d : !0, r = (g = (m = this._permissionService.getPermissionPoint((h = new yo(e, t, o.permissionId)) == null ? void 0 : h.id)) == null ? void 0 : m.value) != null ? g : !0, i = (C = (p = this._permissionService.getPermissionPoint((f = new Br(e, t, o.permissionId)) == null ? void 0 : f.id)) == null ? void 0 : p.value) != null ? C : !1, a = (w = (I = this._permissionService.getPermissionPoint((S = new Hr(e, t, o.permissionId)) == null ? void 0 : S.id)) == null ? void 0 : I.value) != null ? w : !1;
|
|
9730
9730
|
return {
|
|
9731
9731
|
[_.Edit]: s,
|
|
9732
9732
|
[_.View]: r,
|
|
@@ -10018,7 +10018,7 @@ let Dn = class extends ue {
|
|
|
10018
10018
|
_initUserChange() {
|
|
10019
10019
|
this.disposeWithMe(
|
|
10020
10020
|
// When the user changes, the permission points are updated. The first modification needs to be filtered here because it is a Behavior type, but in fact the user information is ready when this controller is initialized.
|
|
10021
|
-
this._userManagerService.currentUser$.pipe(
|
|
10021
|
+
this._userManagerService.currentUser$.pipe(Os(1)).subscribe(() => {
|
|
10022
10022
|
const n = this._permissionService.getAllPermissionPoint();
|
|
10023
10023
|
this._permissionService.clearPermissionMap(), this._worksheetProtectionRuleModel.changeRuleInitState(!1), this._univerInstanceService.getAllUnitsForType(B.UNIVER_SHEET).forEach((t) => {
|
|
10024
10024
|
const o = t.getUnitId();
|
|
@@ -10153,7 +10153,7 @@ let An = class extends ue {
|
|
|
10153
10153
|
if (r != null && r.permissionId) {
|
|
10154
10154
|
const d = [{
|
|
10155
10155
|
[_.View]: (a = (i = this._permissionService.getPermissionPoint(new Gn(o, s).id)) == null ? void 0 : i.value) != null ? a : !1,
|
|
10156
|
-
[_.Edit]: (l = (u = this._permissionService.getPermissionPoint(new
|
|
10156
|
+
[_.Edit]: (l = (u = this._permissionService.getPermissionPoint(new Oe(o, s).id)) == null ? void 0 : u.value) != null ? l : !1
|
|
10157
10157
|
}], h = !((c = d[0]) != null && c[_.View]), m = { ...n, hasWorksheetRule: !0, selectionProtection: d };
|
|
10158
10158
|
return h ? (delete m.s, delete m.v, delete m.p, m) : t(m);
|
|
10159
10159
|
}
|
|
@@ -10292,7 +10292,7 @@ class jc extends ue {
|
|
|
10292
10292
|
const d = u.get(c);
|
|
10293
10293
|
if (d) {
|
|
10294
10294
|
for (const h of d)
|
|
10295
|
-
if (
|
|
10295
|
+
if (N.intersects(r, h.range)) {
|
|
10296
10296
|
o.push(c);
|
|
10297
10297
|
break;
|
|
10298
10298
|
}
|
|
@@ -10438,13 +10438,13 @@ let xn = class extends ue {
|
|
|
10438
10438
|
return { redos: [], undos: [] };
|
|
10439
10439
|
}
|
|
10440
10440
|
_getRefRangeMutationsByDeleteCols(e, t, o) {
|
|
10441
|
-
const s = this._selectionProtectionRuleModel.getSubunitRuleList(t, o).filter((i) => i.ranges.some((a) =>
|
|
10441
|
+
const s = this._selectionProtectionRuleModel.getSubunitRuleList(t, o).filter((i) => i.ranges.some((a) => N.intersects(a, e.range))), r = e.range;
|
|
10442
10442
|
if (s.length) {
|
|
10443
10443
|
const i = [], a = [];
|
|
10444
10444
|
return s.forEach((u) => {
|
|
10445
|
-
const l =
|
|
10446
|
-
if (
|
|
10447
|
-
const m =
|
|
10445
|
+
const l = O.deepClone(u), c = l.ranges.reduce((d, h) => {
|
|
10446
|
+
if (N.intersects(h, r)) {
|
|
10447
|
+
const m = O.deepClone(h), { startColumn: g, endColumn: f } = r;
|
|
10448
10448
|
if (g <= m.startColumn && f >= m.endColumn)
|
|
10449
10449
|
return d;
|
|
10450
10450
|
g >= m.startColumn && f <= m.endColumn ? m.endColumn -= f - g + 1 : g < m.startColumn ? (m.startColumn = g, m.endColumn -= f - g + 1) : f > m.endColumn && (m.endColumn = g - 1), this._checkIsRightRange(m) && d.push(m);
|
|
@@ -10457,13 +10457,13 @@ let xn = class extends ue {
|
|
|
10457
10457
|
return { undos: [], redos: [] };
|
|
10458
10458
|
}
|
|
10459
10459
|
_getRefRangeMutationsByDeleteRows(e, t, o) {
|
|
10460
|
-
const s = this._selectionProtectionRuleModel.getSubunitRuleList(t, o).filter((i) => i.ranges.some((a) =>
|
|
10460
|
+
const s = this._selectionProtectionRuleModel.getSubunitRuleList(t, o).filter((i) => i.ranges.some((a) => N.intersects(a, e.range))), r = e.range;
|
|
10461
10461
|
if (s.length) {
|
|
10462
10462
|
const i = [], a = [];
|
|
10463
10463
|
return s.forEach((u) => {
|
|
10464
|
-
const l =
|
|
10465
|
-
if (
|
|
10466
|
-
const m =
|
|
10464
|
+
const l = O.deepClone(u), c = l.ranges.reduce((d, h) => {
|
|
10465
|
+
if (N.intersects(h, r)) {
|
|
10466
|
+
const m = O.deepClone(h), { startRow: g, endRow: f } = r;
|
|
10467
10467
|
if (g <= m.startRow && f >= m.endRow)
|
|
10468
10468
|
return d;
|
|
10469
10469
|
g >= m.startRow && f <= m.endRow ? m.endRow -= f - g + 1 : g < m.startRow ? (m.startRow = g, m.endRow -= f - g + 1) : f > m.endRow && (m.endRow = g - 1), this._checkIsRightRange(m) && d.push(m);
|
|
@@ -10480,7 +10480,7 @@ let xn = class extends ue {
|
|
|
10480
10480
|
if (i.length) {
|
|
10481
10481
|
const a = [], u = [];
|
|
10482
10482
|
return i.forEach((l) => {
|
|
10483
|
-
const c =
|
|
10483
|
+
const c = O.deepClone(l);
|
|
10484
10484
|
let d = !1;
|
|
10485
10485
|
c.ranges.forEach((h) => {
|
|
10486
10486
|
s > h.startColumn && s <= h.endColumn && (h.endColumn += r, d = !0);
|
|
@@ -10494,7 +10494,7 @@ let xn = class extends ue {
|
|
|
10494
10494
|
if (i.length) {
|
|
10495
10495
|
const a = [], u = [];
|
|
10496
10496
|
return i.forEach((l) => {
|
|
10497
|
-
const c =
|
|
10497
|
+
const c = O.deepClone(l);
|
|
10498
10498
|
let d = !1;
|
|
10499
10499
|
c.ranges.forEach((h) => {
|
|
10500
10500
|
s > h.startRow && s <= h.endRow && (h.endRow += r, d = !0);
|
|
@@ -10508,7 +10508,7 @@ let xn = class extends ue {
|
|
|
10508
10508
|
if (a.length) {
|
|
10509
10509
|
const u = [], l = [];
|
|
10510
10510
|
return a.forEach((c) => {
|
|
10511
|
-
const d =
|
|
10511
|
+
const d = O.deepClone(c), m = e.fromRange.startRow;
|
|
10512
10512
|
let g = !1;
|
|
10513
10513
|
d.ranges.forEach((f) => {
|
|
10514
10514
|
r > f.startRow && r <= f.endRow && (m < f.startRow && (f.startRow = f.startRow - i, f.endRow = f.endRow - i), f.endRow += i, g = !0);
|
|
@@ -10522,7 +10522,7 @@ let xn = class extends ue {
|
|
|
10522
10522
|
if (a.length) {
|
|
10523
10523
|
const u = [], l = [];
|
|
10524
10524
|
return a.forEach((c) => {
|
|
10525
|
-
const d =
|
|
10525
|
+
const d = O.deepClone(c), m = e.fromRange.startColumn;
|
|
10526
10526
|
let g = !1;
|
|
10527
10527
|
d.ranges.forEach((f) => {
|
|
10528
10528
|
r > f.startColumn && r <= f.endColumn && (m < f.startColumn && (f.startColumn = f.startColumn - i, f.endColumn = f.endColumn - i), f.endColumn += i, g = !0);
|
|
@@ -10543,7 +10543,7 @@ let xn = class extends ue {
|
|
|
10543
10543
|
this._selectionProtectionRuleModel.getSubunitRuleList(t.getUnitId(), o.getSheetId()).forEach((f) => {
|
|
10544
10544
|
f.ranges.forEach((C) => {
|
|
10545
10545
|
let { startRow: S, endRow: I, startColumn: w, endColumn: y } = C;
|
|
10546
|
-
|
|
10546
|
+
N.intersects(C, s) || (i ? u < S && l > I ? (S -= a, I -= a) : u > I && l <= S && (S += a, I += a) : u < w && l > y ? (w -= a, y -= a) : u > y && l <= w && (w += a, y += a)), this._checkIsRightRange({ startRow: S, endRow: I, startColumn: w, endColumn: y }) && (C.startColumn = w, C.endColumn = y, C.startRow = S, C.endRow = I);
|
|
10547
10547
|
});
|
|
10548
10548
|
}), this.disposableCollection.dispose();
|
|
10549
10549
|
const { unitId: d, subUnitId: h } = e.params, m = (f) => this.refRangeHandle(f, d, h);
|
|
@@ -10862,7 +10862,7 @@ let Ln = class extends bi {
|
|
|
10862
10862
|
var e;
|
|
10863
10863
|
const n = [
|
|
10864
10864
|
// services
|
|
10865
|
-
[
|
|
10865
|
+
[Ot],
|
|
10866
10866
|
[H],
|
|
10867
10867
|
[Et],
|
|
10868
10868
|
[$n],
|
|
@@ -10873,7 +10873,7 @@ let Ln = class extends bi {
|
|
|
10873
10873
|
// controllers
|
|
10874
10874
|
[En],
|
|
10875
10875
|
[Pn],
|
|
10876
|
-
[
|
|
10876
|
+
[Nn],
|
|
10877
10877
|
[kn],
|
|
10878
10878
|
// permission
|
|
10879
10879
|
[bn],
|
|
@@ -10881,7 +10881,7 @@ let Ln = class extends bi {
|
|
|
10881
10881
|
[ln],
|
|
10882
10882
|
[An],
|
|
10883
10883
|
[Dn],
|
|
10884
|
-
[
|
|
10884
|
+
[On],
|
|
10885
10885
|
// range theme
|
|
10886
10886
|
[Be],
|
|
10887
10887
|
// range protection
|
|
@@ -10922,11 +10922,11 @@ let Ln = class extends bi {
|
|
|
10922
10922
|
[Un],
|
|
10923
10923
|
[kn],
|
|
10924
10924
|
[Be],
|
|
10925
|
-
[
|
|
10925
|
+
[Nn],
|
|
10926
10926
|
[nn],
|
|
10927
10927
|
[xn],
|
|
10928
10928
|
[Et],
|
|
10929
|
-
[
|
|
10929
|
+
[On]
|
|
10930
10930
|
]);
|
|
10931
10931
|
}
|
|
10932
10932
|
};
|
|
@@ -11289,7 +11289,7 @@ function gd(n, e, t, o, s) {
|
|
|
11289
11289
|
c && a.setValue(u, l, c);
|
|
11290
11290
|
}), i.forEach((u) => {
|
|
11291
11291
|
const { startColumn: l, startRow: c, endColumn: d, endRow: h } = u;
|
|
11292
|
-
|
|
11292
|
+
Ni(c, h, l, d).forEach((m, g) => {
|
|
11293
11293
|
m === c && g === l && a.setValue(m, g, {
|
|
11294
11294
|
...r.getValue(m, g),
|
|
11295
11295
|
spanAnchor: { startRow: c, endRow: h, startColumn: l, endColumn: d }
|
|
@@ -11449,7 +11449,7 @@ function fh(n, e, t) {
|
|
|
11449
11449
|
}
|
|
11450
11450
|
}
|
|
11451
11451
|
}
|
|
11452
|
-
return m.length > 0 && (h =
|
|
11452
|
+
return m.length > 0 && (h = N.union(h, ...m)), h;
|
|
11453
11453
|
}
|
|
11454
11454
|
const ni = (n, e, t, o = 1, s = !0, r = !0) => {
|
|
11455
11455
|
const i = K.transformRange(n, e), { startRow: a, endRow: u } = i;
|
|
@@ -11544,7 +11544,7 @@ const Sd = (n, e, t, o, s = 1) => {
|
|
|
11544
11544
|
if (!o || !r)
|
|
11545
11545
|
return null;
|
|
11546
11546
|
const l = { ...r }, { startRow: c, startColumn: d, endRow: h, endColumn: m } = o.range, g = i ? l.startRow === c && l.startColumn === d : l.endRow === h && l.endColumn === m, f = g && i;
|
|
11547
|
-
if (!
|
|
11547
|
+
if (!N.equals(o.range, l)) {
|
|
11548
11548
|
const C = g ? u.range : Sd(o.range, t, l, e);
|
|
11549
11549
|
if (!C)
|
|
11550
11550
|
return null;
|
|
@@ -11659,7 +11659,7 @@ const Sd = (n, e, t, o, s = 1) => {
|
|
|
11659
11659
|
/**
|
|
11660
11660
|
* The permission point for editing the content of a worksheet
|
|
11661
11661
|
*/
|
|
11662
|
-
WorksheetEditPermission:
|
|
11662
|
+
WorksheetEditPermission: Oe,
|
|
11663
11663
|
/**
|
|
11664
11664
|
* The permission point for applying filters in a worksheet
|
|
11665
11665
|
*/
|
|
@@ -11711,7 +11711,7 @@ const Sd = (n, e, t, o, s = 1) => {
|
|
|
11711
11711
|
/**
|
|
11712
11712
|
* The permission point for editing the range protection settings
|
|
11713
11713
|
*/
|
|
11714
|
-
RangeProtectionPermissionEditPoint:
|
|
11714
|
+
RangeProtectionPermissionEditPoint: Ne,
|
|
11715
11715
|
/**
|
|
11716
11716
|
* The permission point for viewing the range protection settings
|
|
11717
11717
|
*/
|
|
@@ -11720,12 +11720,12 @@ const Sd = (n, e, t, o, s = 1) => {
|
|
|
11720
11720
|
const s = n.get(Fe), r = n.get(me), i = s.getPermissionPoint(new Me(e).id);
|
|
11721
11721
|
if (!(i != null && i.value))
|
|
11722
11722
|
return !1;
|
|
11723
|
-
const a = s.getPermissionPoint(new
|
|
11723
|
+
const a = s.getPermissionPoint(new Oe(e, t).id);
|
|
11724
11724
|
if (!(a != null && a.value))
|
|
11725
11725
|
return !1;
|
|
11726
|
-
const l = r.getSubunitRuleList(e, t).filter((c) => c.ranges.some((d) => o.some((h) =>
|
|
11726
|
+
const l = r.getSubunitRuleList(e, t).filter((c) => c.ranges.some((d) => o.some((h) => N.intersects(d, h))));
|
|
11727
11727
|
return l.length ? l.every((c) => {
|
|
11728
|
-
const d = c.permissionId, h = s.getPermissionPoint(new
|
|
11728
|
+
const d = c.permissionId, h = s.getPermissionPoint(new Ne(e, t, d).id);
|
|
11729
11729
|
return !!(h != null && h.value);
|
|
11730
11730
|
}) : !0;
|
|
11731
11731
|
};
|
|
@@ -11758,7 +11758,7 @@ function vd(n, e, t, o) {
|
|
|
11758
11758
|
};
|
|
11759
11759
|
}
|
|
11760
11760
|
function Md(n, e) {
|
|
11761
|
-
const { startRow: t, startColumn: o, endColumn: s, endRow: r } = e, i = n.getMatrixWithMergedCells(t, o, r, s,
|
|
11761
|
+
const { startRow: t, startColumn: o, endColumn: s, endRow: r } = e, i = n.getMatrixWithMergedCells(t, o, r, s, Oi.Intercepted), a = new G();
|
|
11762
11762
|
return i.forValue((u, l, c) => {
|
|
11763
11763
|
c && (u !== t || l !== o) && a.setValue(u, l, null);
|
|
11764
11764
|
}), a;
|
|
@@ -11852,7 +11852,7 @@ function vh(n, e, t, o, s) {
|
|
|
11852
11852
|
const r = n.get(M), i = k(r, { unitId: e, subUnitId: t });
|
|
11853
11853
|
if (!i) return;
|
|
11854
11854
|
const { worksheet: a } = i;
|
|
11855
|
-
if (a.getMergeData().some((d) => o.some((h) =>
|
|
11855
|
+
if (a.getMergeData().some((d) => o.some((h) => N.intersects(h, d))))
|
|
11856
11856
|
throw new Error("The ranges to be merged overlap with the existing merged cells");
|
|
11857
11857
|
n.get(E).executeCommand(eo.id, {
|
|
11858
11858
|
unitId: e,
|
|
@@ -11864,7 +11864,7 @@ function vh(n, e, t, o, s) {
|
|
|
11864
11864
|
const _d = (n, e) => {
|
|
11865
11865
|
const r = n.get(M).getUniverSheetInstance(e.unitId).getSheetBySheetId(e.subUnitId).getConfig().rightToLeft;
|
|
11866
11866
|
return {
|
|
11867
|
-
...
|
|
11867
|
+
...O.deepClone(e),
|
|
11868
11868
|
rightToLeft: r
|
|
11869
11869
|
};
|
|
11870
11870
|
}, uo = {
|
|
@@ -11924,7 +11924,7 @@ export {
|
|
|
11924
11924
|
gt as AddWorksheetProtectionMutation,
|
|
11925
11925
|
xa as AppendRowCommand,
|
|
11926
11926
|
Jo as BEFORE_CELL_EDIT,
|
|
11927
|
-
|
|
11927
|
+
Ot as BorderStyleManagerService,
|
|
11928
11928
|
ih as COMMAND_LISTENER_SKELETON_CHANGE,
|
|
11929
11929
|
ah as COMMAND_LISTENER_VALUE_CHANGE,
|
|
11930
11930
|
zu as CancelFrozenCommand,
|
|
@@ -11935,7 +11935,7 @@ export {
|
|
|
11935
11935
|
Dd as DISABLE_NORMAL_SELECTIONS,
|
|
11936
11936
|
kn as DefinedNameDataController,
|
|
11937
11937
|
Pt as DeleteRangeMoveLeftCommand,
|
|
11938
|
-
|
|
11938
|
+
Nt as DeleteRangeMoveUpCommand,
|
|
11939
11939
|
ru as DeleteRangeProtectionCommand,
|
|
11940
11940
|
Je as DeleteRangeProtectionMutation,
|
|
11941
11941
|
iu as DeleteWorksheetProtectionCommand,
|
|
@@ -11949,8 +11949,8 @@ export {
|
|
|
11949
11949
|
W as EffectRefRangId,
|
|
11950
11950
|
xl as EmptyMutation,
|
|
11951
11951
|
jc as ExclusiveRangeService,
|
|
11952
|
-
|
|
11953
|
-
|
|
11952
|
+
Od as FactoryAddRangeProtectionMutation,
|
|
11953
|
+
Nd as FactoryDeleteRangeProtectionMutation,
|
|
11954
11954
|
Fd as FactorySetRangeProtectionMutation,
|
|
11955
11955
|
gs as IExclusiveRangeService,
|
|
11956
11956
|
ot as INTERCEPTOR_POINT,
|
|
@@ -11997,7 +11997,7 @@ export {
|
|
|
11997
11997
|
Qd as RangeMergeUtil,
|
|
11998
11998
|
Rt as RangeProtectionCache,
|
|
11999
11999
|
Hr as RangeProtectionPermissionDeleteProtectionPoint,
|
|
12000
|
-
|
|
12000
|
+
Ne as RangeProtectionPermissionEditPoint,
|
|
12001
12001
|
Br as RangeProtectionPermissionManageCollaPoint,
|
|
12002
12002
|
yo as RangeProtectionPermissionViewPoint,
|
|
12003
12003
|
xn as RangeProtectionRefRangeService,
|
|
@@ -12040,7 +12040,7 @@ export {
|
|
|
12040
12040
|
xu as SetBorderBasicCommand,
|
|
12041
12041
|
Au as SetBorderColorCommand,
|
|
12042
12042
|
an as SetBorderCommand,
|
|
12043
|
-
|
|
12043
|
+
Ou as SetBorderPositionCommand,
|
|
12044
12044
|
Du as SetBorderStyleCommand,
|
|
12045
12045
|
Lu as SetColDataCommand,
|
|
12046
12046
|
Lt as SetColDataMutation,
|
|
@@ -12070,11 +12070,11 @@ export {
|
|
|
12070
12070
|
Bt as SetRowDataMutation,
|
|
12071
12071
|
Yu as SetRowDataMutationFactory,
|
|
12072
12072
|
Ho as SetRowHeightCommand,
|
|
12073
|
-
|
|
12073
|
+
Or as SetRowHiddenCommand,
|
|
12074
12074
|
en as SetRowHiddenMutation,
|
|
12075
12075
|
Qt as SetRowVisibleMutation,
|
|
12076
12076
|
Er as SetSelectedColsVisibleCommand,
|
|
12077
|
-
|
|
12077
|
+
Nr as SetSelectedRowsVisibleCommand,
|
|
12078
12078
|
re as SetSelectionsOperation,
|
|
12079
12079
|
Xn as SetSpecificColsVisibleCommand,
|
|
12080
12080
|
Zn as SetSpecificRowsVisibleCommand,
|
|
@@ -12118,7 +12118,7 @@ export {
|
|
|
12118
12118
|
xe as SetWorksheetRowIsAutoHeightMutation,
|
|
12119
12119
|
Gr as SetWorksheetShowCommand,
|
|
12120
12120
|
F as SheetInterceptorService,
|
|
12121
|
-
|
|
12121
|
+
On as SheetPermissionCheckController,
|
|
12122
12122
|
Dn as SheetPermissionInitController,
|
|
12123
12123
|
fo as SheetRangeThemeService,
|
|
12124
12124
|
dd as SheetSkeletonChangeType,
|
|
@@ -12126,8 +12126,8 @@ export {
|
|
|
12126
12126
|
hd as SheetValueChangeType,
|
|
12127
12127
|
H as SheetsSelectionsService,
|
|
12128
12128
|
yl as SplitDelimiterEnum,
|
|
12129
|
-
|
|
12130
|
-
|
|
12129
|
+
Nl as SplitTextToColumnsCommand,
|
|
12130
|
+
Ol as ToggleCellCheckboxCommand,
|
|
12131
12131
|
Dl as ToggleGridlinesCommand,
|
|
12132
12132
|
jt as ToggleGridlinesMutation,
|
|
12133
12133
|
_ as UnitAction,
|
|
@@ -12163,7 +12163,7 @@ export {
|
|
|
12163
12163
|
tr as WorksheetDeleteProtectionPermission,
|
|
12164
12164
|
nr as WorksheetDeleteRowPermission,
|
|
12165
12165
|
or as WorksheetEditExtraObjectPermission,
|
|
12166
|
-
|
|
12166
|
+
Oe as WorksheetEditPermission,
|
|
12167
12167
|
sr as WorksheetFilterPermission,
|
|
12168
12168
|
rr as WorksheetInsertColumnPermission,
|
|
12169
12169
|
ir as WorksheetInsertHyperlinkPermission,
|