@univerjs/sheets-table 0.10.2-nightly.202508080617 → 0.10.3-experimental.20250812-b4b6f1a
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 +1 -1
- package/lib/es/index.js +333 -324
- package/lib/index.js +333 -324
- package/lib/types/controllers/config.schema.d.ts +14 -15
- package/lib/types/controllers/sheet-table-theme.controller.d.ts +6 -2
- package/lib/types/controllers/table-theme.factory.d.ts +5 -16
- package/lib/umd/index.js +1 -1
- package/package.json +4 -4
package/lib/es/index.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var b = (t, e, n) =>
|
|
4
|
-
import { CellValueType as q, BorderStyleTypes as
|
|
5
|
-
import { getSheetCommandTarget as $, SheetInterceptorService as
|
|
6
|
-
import { Subject as Q, BehaviorSubject as ke, filter as be, switchMap as
|
|
7
|
-
var I = /* @__PURE__ */ ((t) => (t.Insert = "insert", t.Delete = "delete", t))(I || {}), D = /* @__PURE__ */ ((t) => (t.Row = "row", t.Col = "column", t))(D || {}), Qe = /* @__PURE__ */ ((t) => (t.None = "none", t.String = "string", t.Number = "number", t.Date = "date", t.Bool = "bool", t.Checkbox = "checkbox", t.List = "list", t))(Qe || {}),
|
|
8
|
-
function
|
|
1
|
+
var Ze = Object.defineProperty;
|
|
2
|
+
var et = (t, e, n) => e in t ? Ze(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var b = (t, e, n) => et(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CellValueType as q, BorderStyleTypes as tt, generateRandomId as L, IUniverInstanceService as W, Inject as C, LocaleService as de, Disposable as k, CommandType as N, IUndoRedoService as A, ICommandService as x, sequenceExecute as B, IResourceManagerService as nt, Rectangle as pe, RTree as rt, InterceptorEffectEnum as st, UniverInstanceType as he, customNameCharacterCheck as at, ILogService as ot, Injector as Ae, IConfigService as Be, Plugin as it, merge as lt, registerDependencies as ut, touchDependencies as Ie } from "@univerjs/core";
|
|
5
|
+
import { getSheetCommandTarget as $, SheetInterceptorService as Ce, INTERCEPTOR_POINT as Le, AddRangeThemeMutation as Ee, RemoveRangeThemeMutation as We, SheetRangeThemeModel as He, SheetsSelectionsService as ge, InsertRowMutation as Pe, RemoveRowMutation as Ve, getMoveRangeUndoRedoMutations as me, InsertColMutation as qe, RemoveColMutation as Je, IExclusiveRangeService as ct, RefRangeService as dt, RemoveColCommand as ht, RemoveRowCommand as gt, InsertColCommand as mt, InsertRowCommand as bt, SheetRangeThemeService as wt, RangeThemeStyle as ft } from "@univerjs/sheets";
|
|
6
|
+
import { Subject as Q, BehaviorSubject as ke, filter as be, switchMap as Me } from "rxjs";
|
|
7
|
+
var I = /* @__PURE__ */ ((t) => (t.Insert = "insert", t.Delete = "delete", t))(I || {}), D = /* @__PURE__ */ ((t) => (t.Row = "row", t.Col = "column", t))(D || {}), Qe = /* @__PURE__ */ ((t) => (t.None = "none", t.String = "string", t.Number = "number", t.Date = "date", t.Bool = "bool", t.Checkbox = "checkbox", t.List = "list", t))(Qe || {}), Z = /* @__PURE__ */ ((t) => (t.manual = "manual", t.condition = "condition", t))(Z || {}), U = /* @__PURE__ */ ((t) => (t.Date = "date", t.Number = "number", t.String = "string", t.Logic = "logic", t))(U || {}), F = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.GreaterThan = "greaterThan", t.GreaterThanOrEqual = "greaterThanOrEqual", t.LessThan = "lessThan", t.LessThanOrEqual = "lessThanOrEqual", t.Between = "between", t.NotBetween = "notBetween", t.Above = "above", t.Below = "below", t.TopN = "topN", t))(F || {}), P = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.Contains = "contains", t.NotContains = "notContains", t.StartsWith = "startsWith", t.EndsWith = "endsWith", t))(P || {}), g = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.After = "after", t.AfterOrEqual = "afterOrEqual", t.Before = "before", t.BeforeOrEqual = "beforeOrEqual", t.Between = "between", t.NotBetween = "notBetween", t.Today = "today", t.Yesterday = "yesterday", t.Tomorrow = "tomorrow", t.ThisWeek = "thisWeek", t.LastWeek = "lastWeek", t.NextWeek = "nextWeek", t.ThisMonth = "thisMonth", t.LastMonth = "lastMonth", t.NextMonth = "nextMonth", t.ThisQuarter = "thisQuarter", t.LastQuarter = "lastQuarter", t.NextQuarter = "nextQuarter", t.ThisYear = "thisYear", t.LastYear = "lastYear", t.NextYear = "nextYear", t.YearToDate = "yearToDate", t.Quarter = "quarter", t.Month = "month", t.M1 = "m1", t.M2 = "m2", t.M3 = "m3", t.M4 = "m4", t.M5 = "m5", t.M6 = "m6", t.M7 = "m7", t.M8 = "m8", t.M9 = "m9", t.M10 = "m10", t.M11 = "m11", t.M12 = "m12", t.Q1 = "q1", t.Q2 = "q2", t.Q3 = "q3", t.Q4 = "q4", t))(g || {}), V = /* @__PURE__ */ ((t) => (t[t.FilteredSortNone = 1] = "FilteredSortNone", t[t.FilteredSortAsc = 2] = "FilteredSortAsc", t[t.FilteredSortDesc = 3] = "FilteredSortDesc", t[t.FilterNoneSortNone = 4] = "FilterNoneSortNone", t[t.FilterNoneSortAsc = 5] = "FilterNoneSortAsc", t[t.FilterNoneSortDesc = 6] = "FilterNoneSortDesc", t))(V || {}), Y = /* @__PURE__ */ ((t) => (t.Asc = "asc", t.Desc = "desc", t.None = "none", t))(Y || {});
|
|
8
|
+
function X(t, e) {
|
|
9
9
|
return `${e} ${t}`;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const ve = "TRUE", Fe = "FALSE", Rt = (t) => {
|
|
12
12
|
var n;
|
|
13
13
|
return ((n = t.body) == null ? void 0 : n.dataStream.replace(/\r\n$/, "")) || "";
|
|
14
14
|
};
|
|
15
15
|
function Ye(t) {
|
|
16
16
|
if (t) {
|
|
17
17
|
const { v: e, t: n, p: r } = t;
|
|
18
|
-
return r ? Rt(r) : (n === q.FORCE_STRING || n === q.STRING) && e !== void 0 && e !== null ? String(e) : n === q.BOOLEAN ? e ?
|
|
18
|
+
return r ? Rt(r) : (n === q.FORCE_STRING || n === q.STRING) && e !== void 0 && e !== null ? String(e) : n === q.BOOLEAN ? e ? ve : Fe : n === q.NUMBER ? String(e) : typeof e === "boolean" ? e ? ve : Fe : e == null ? "" : String(e);
|
|
19
19
|
}
|
|
20
20
|
return "";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function pt(t, e) {
|
|
23
23
|
if (t != null)
|
|
24
24
|
switch (e) {
|
|
25
|
-
case
|
|
25
|
+
case Y.Asc:
|
|
26
26
|
return V.FilteredSortAsc;
|
|
27
|
-
case
|
|
27
|
+
case Y.Desc:
|
|
28
28
|
return V.FilteredSortDesc;
|
|
29
29
|
default:
|
|
30
30
|
return V.FilteredSortNone;
|
|
31
31
|
}
|
|
32
32
|
else
|
|
33
33
|
switch (e) {
|
|
34
|
-
case
|
|
34
|
+
case Y.Asc:
|
|
35
35
|
return V.FilterNoneSortAsc;
|
|
36
|
-
case
|
|
36
|
+
case Y.Desc:
|
|
37
37
|
return V.FilterNoneSortDesc;
|
|
38
38
|
default:
|
|
39
39
|
return V.FilterNoneSortNone;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return t ? t.filterType ===
|
|
42
|
+
function St(t) {
|
|
43
|
+
return t ? t.filterType === Z.condition : !1;
|
|
44
44
|
}
|
|
45
45
|
function tr(t) {
|
|
46
|
-
return t ? t.filterType ===
|
|
46
|
+
return t ? t.filterType === Z.manual : !1;
|
|
47
47
|
}
|
|
48
48
|
const y = {
|
|
49
|
-
s:
|
|
49
|
+
s: tt.THIN,
|
|
50
50
|
cl: {
|
|
51
51
|
rgb: "rgb(95 101 116)"
|
|
52
52
|
}
|
|
53
|
-
}, nr = {
|
|
53
|
+
}, Ge = "sheets-table.config", De = {}, nr = {
|
|
54
54
|
headerRowStyle: {
|
|
55
55
|
bd: {
|
|
56
56
|
t: y
|
|
@@ -104,14 +104,14 @@ const y = {
|
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
return e;
|
|
107
|
-
},
|
|
107
|
+
}, Ct = [
|
|
108
108
|
[["#6280F9", "#FFFFFF", "#BAC6F8", "#D2DAFA"], ["#fff"]],
|
|
109
109
|
[["#16BDCA", "#FFFFFF", "#EDFAFA", "#AFECEF"], ["#000"]],
|
|
110
110
|
[["#31C48D", "#FFFFFF", "#F3FAF7", "#BCF0DA"], ["#fff"]],
|
|
111
111
|
[["#AC94FA", "#FFFFFF", "#F6F5FF", "#EDEBFE"], ["#fff"]],
|
|
112
112
|
[["#F17EBB", "#FFFFFF", "#FDF2F8", "#FCE8F3"], ["#fff"]],
|
|
113
113
|
[["#F98080", "#FFFFFF", "#FDF2F2", "#FDE8E8"], ["#fff"]]
|
|
114
|
-
],
|
|
114
|
+
], je = Ct.map((t, e) => {
|
|
115
115
|
const [n, r] = t, [s, a, o, l] = n, [u] = r;
|
|
116
116
|
return {
|
|
117
117
|
name: `table-default-${e}`,
|
|
@@ -191,79 +191,79 @@ class J {
|
|
|
191
191
|
this.id = e.id, this.displayName = e.displayName, this.dataType = e.dataType, this.formula = e.formula, this.meta = e.meta, this.style = e.style;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
const
|
|
194
|
+
const _t = (t) => t.getMonth() <= 2, Tt = (t) => {
|
|
195
195
|
const e = t.getMonth();
|
|
196
196
|
return e > 2 && e <= 5;
|
|
197
|
-
},
|
|
197
|
+
}, It = (t) => {
|
|
198
198
|
const e = t.getMonth();
|
|
199
199
|
return e > 5 && e <= 8;
|
|
200
|
-
},
|
|
200
|
+
}, Mt = (t) => {
|
|
201
201
|
const e = t.getMonth();
|
|
202
202
|
return e > 8 && e <= 11;
|
|
203
|
-
},
|
|
203
|
+
}, vt = (t) => t.getMonth() === 0, Ft = (t) => t.getMonth() === 1, Dt = (t) => t.getMonth() === 2, Nt = (t) => t.getMonth() === 3, yt = (t) => t.getMonth() === 4, xt = (t) => t.getMonth() === 5, Ot = (t) => t.getMonth() === 6, Ut = (t) => t.getMonth() === 7, $t = (t) => t.getMonth() === 8, At = (t) => t.getMonth() === 9, Bt = (t) => t.getMonth() === 10, Lt = (t) => t.getMonth() === 11, Et = (t, e = /* @__PURE__ */ new Date()) => t.toDateString() === e.toDateString(), Wt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
204
204
|
const n = new Date(e);
|
|
205
205
|
return n.setDate(n.getDate() + 1), t.toDateString() === n.toDateString();
|
|
206
|
-
},
|
|
206
|
+
}, Ht = (t, e = /* @__PURE__ */ new Date()) => {
|
|
207
207
|
const n = new Date(e);
|
|
208
208
|
return n.setDate(n.getDate() - 1), t.toDateString() === n.toDateString();
|
|
209
|
-
},
|
|
209
|
+
}, G = (t) => {
|
|
210
210
|
const e = t.getDay(), n = t.getDate() - e + (e === 0 ? -6 : 1), r = new Date(t);
|
|
211
211
|
return r.setDate(n), r;
|
|
212
|
-
},
|
|
213
|
-
const n =
|
|
214
|
-
return n.toDateString() === r.toDateString();
|
|
215
|
-
}, Pt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
216
|
-
const n = j(t), r = new Date(j(e).getTime() + Ge);
|
|
212
|
+
}, ze = 10080 * 60 * 1e3, Pt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
213
|
+
const n = G(t), r = G(e);
|
|
217
214
|
return n.toDateString() === r.toDateString();
|
|
218
215
|
}, Vt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
219
|
-
const n =
|
|
216
|
+
const n = G(t), r = new Date(G(e).getTime() + ze);
|
|
220
217
|
return n.toDateString() === r.toDateString();
|
|
221
|
-
}, qt = (t, e = /* @__PURE__ */ new Date()) =>
|
|
218
|
+
}, qt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
219
|
+
const n = G(t), r = new Date(G(e).getTime() - ze);
|
|
220
|
+
return n.toDateString() === r.toDateString();
|
|
221
|
+
}, Jt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth(), kt = (t) => {
|
|
222
222
|
const e = new Date(t);
|
|
223
223
|
return e.setHours(0, 0, 0, 0), e.setDate(1), e;
|
|
224
|
-
},
|
|
224
|
+
}, Qt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
225
225
|
const n = new Date(e);
|
|
226
226
|
n.setHours(0, 0, 0, 0), n.setMonth(n.getMonth() + 1, 1);
|
|
227
227
|
const r = new Date(n);
|
|
228
228
|
r.setMonth(r.getMonth() + 1, 0);
|
|
229
229
|
const s = t.getTime();
|
|
230
230
|
return s >= n.getTime() && s < r.getTime();
|
|
231
|
-
},
|
|
232
|
-
const n =
|
|
231
|
+
}, Yt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
232
|
+
const n = kt(e), r = new Date(n);
|
|
233
233
|
r.setMonth(r.getMonth() + 1, 0);
|
|
234
234
|
const s = t.getTime();
|
|
235
235
|
return s >= n.getTime() && s < r.getTime();
|
|
236
|
-
},
|
|
236
|
+
}, _e = (t) => {
|
|
237
237
|
const e = new Date(t);
|
|
238
238
|
e.setHours(0, 0, 0, 0), e.setDate(1);
|
|
239
239
|
const n = e.getMonth();
|
|
240
240
|
return e.setMonth(n - n % 3), e;
|
|
241
|
-
},
|
|
242
|
-
const n =
|
|
241
|
+
}, Gt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
242
|
+
const n = _e(e), r = new Date(n);
|
|
243
243
|
r.setMonth(r.getMonth() + 3);
|
|
244
244
|
const s = t.getTime();
|
|
245
245
|
return s >= n.getTime() && s < r.getTime();
|
|
246
|
-
},
|
|
247
|
-
const n =
|
|
246
|
+
}, jt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
247
|
+
const n = _e(e), r = new Date(n);
|
|
248
248
|
r.setMonth(r.getMonth() + 3);
|
|
249
249
|
const s = new Date(r);
|
|
250
250
|
s.setMonth(s.getMonth() + 3, 0);
|
|
251
251
|
const a = t.getTime();
|
|
252
252
|
return a >= r.getTime() && a < s.getTime();
|
|
253
|
-
},
|
|
254
|
-
const n =
|
|
253
|
+
}, zt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
254
|
+
const n = _e(e), r = new Date(n);
|
|
255
255
|
r.setMonth(r.getMonth() - 3);
|
|
256
256
|
const s = new Date(n);
|
|
257
257
|
s.setDate(0);
|
|
258
258
|
const a = t.getTime();
|
|
259
259
|
return a >= r.getTime() && a < s.getTime();
|
|
260
|
-
},
|
|
260
|
+
}, Kt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear(), Xt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() + 1, Zt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() - 1, en = (t, e = /* @__PURE__ */ new Date()) => {
|
|
261
261
|
const n = new Date(e);
|
|
262
262
|
n.setHours(0, 0, 0, 0), n.setMonth(0, 1);
|
|
263
263
|
const r = t.getTime();
|
|
264
264
|
return r >= n.getTime() && r < e.getTime();
|
|
265
265
|
};
|
|
266
|
-
function
|
|
266
|
+
function tn(t) {
|
|
267
267
|
switch (t.compareType) {
|
|
268
268
|
case g.Equal: {
|
|
269
269
|
const e = new Date(t.expectedValue);
|
|
@@ -301,105 +301,105 @@ function en(t) {
|
|
|
301
301
|
};
|
|
302
302
|
case g.Today: {
|
|
303
303
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
304
|
-
return (n) =>
|
|
304
|
+
return (n) => Et(n, e);
|
|
305
305
|
}
|
|
306
306
|
case g.Yesterday: {
|
|
307
307
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
308
|
-
return (n) =>
|
|
308
|
+
return (n) => Ht(n, e);
|
|
309
309
|
}
|
|
310
310
|
case g.Tomorrow: {
|
|
311
311
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
312
|
-
return (n) =>
|
|
312
|
+
return (n) => Wt(n, e);
|
|
313
313
|
}
|
|
314
314
|
case g.ThisWeek: {
|
|
315
315
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
316
|
-
return (n) =>
|
|
316
|
+
return (n) => Pt(n, e);
|
|
317
317
|
}
|
|
318
318
|
case g.LastWeek: {
|
|
319
319
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
320
|
-
return (n) =>
|
|
320
|
+
return (n) => qt(n, e);
|
|
321
321
|
}
|
|
322
322
|
case g.NextWeek: {
|
|
323
323
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
324
|
-
return (n) =>
|
|
324
|
+
return (n) => Vt(n, e);
|
|
325
325
|
}
|
|
326
326
|
case g.ThisMonth: {
|
|
327
327
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
328
|
-
return (n) =>
|
|
328
|
+
return (n) => Jt(n, e);
|
|
329
329
|
}
|
|
330
330
|
case g.LastMonth: {
|
|
331
331
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
332
|
-
return (n) =>
|
|
332
|
+
return (n) => Yt(n, e);
|
|
333
333
|
}
|
|
334
334
|
case g.NextMonth: {
|
|
335
335
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
336
|
-
return (n) =>
|
|
336
|
+
return (n) => Qt(n, e);
|
|
337
337
|
}
|
|
338
338
|
case g.ThisQuarter: {
|
|
339
339
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
340
|
-
return (n) =>
|
|
340
|
+
return (n) => Gt(n, e);
|
|
341
341
|
}
|
|
342
342
|
case g.LastQuarter: {
|
|
343
343
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
344
|
-
return (n) =>
|
|
344
|
+
return (n) => zt(n, e);
|
|
345
345
|
}
|
|
346
346
|
case g.NextQuarter: {
|
|
347
347
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
348
|
-
return (n) =>
|
|
348
|
+
return (n) => jt(n, e);
|
|
349
349
|
}
|
|
350
350
|
case g.ThisYear: {
|
|
351
351
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
352
|
-
return (n) =>
|
|
352
|
+
return (n) => Kt(n, e);
|
|
353
353
|
}
|
|
354
354
|
case g.LastYear: {
|
|
355
355
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
356
|
-
return (n) =>
|
|
356
|
+
return (n) => Zt(n, e);
|
|
357
357
|
}
|
|
358
358
|
case g.NextYear: {
|
|
359
359
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
360
|
-
return (n) =>
|
|
360
|
+
return (n) => Xt(n, e);
|
|
361
361
|
}
|
|
362
362
|
case g.YearToDate: {
|
|
363
363
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
364
|
-
return (n) =>
|
|
364
|
+
return (n) => en(n, e);
|
|
365
365
|
}
|
|
366
366
|
case g.M1:
|
|
367
|
-
return Mt;
|
|
368
|
-
case g.M2:
|
|
369
367
|
return vt;
|
|
370
|
-
case g.
|
|
368
|
+
case g.M2:
|
|
371
369
|
return Ft;
|
|
372
|
-
case g.
|
|
370
|
+
case g.M3:
|
|
373
371
|
return Dt;
|
|
374
|
-
case g.
|
|
372
|
+
case g.M4:
|
|
375
373
|
return Nt;
|
|
376
|
-
case g.
|
|
374
|
+
case g.M5:
|
|
377
375
|
return yt;
|
|
378
|
-
case g.
|
|
376
|
+
case g.M6:
|
|
379
377
|
return xt;
|
|
380
|
-
case g.
|
|
378
|
+
case g.M7:
|
|
381
379
|
return Ot;
|
|
382
|
-
case g.
|
|
380
|
+
case g.M8:
|
|
383
381
|
return Ut;
|
|
384
|
-
case g.
|
|
382
|
+
case g.M9:
|
|
385
383
|
return $t;
|
|
386
|
-
case g.
|
|
384
|
+
case g.M10:
|
|
387
385
|
return At;
|
|
388
|
-
case g.
|
|
386
|
+
case g.M11:
|
|
389
387
|
return Bt;
|
|
388
|
+
case g.M12:
|
|
389
|
+
return Lt;
|
|
390
390
|
case g.Q1:
|
|
391
|
-
return Ct;
|
|
392
|
-
case g.Q2:
|
|
393
391
|
return _t;
|
|
394
|
-
case g.
|
|
392
|
+
case g.Q2:
|
|
395
393
|
return Tt;
|
|
396
|
-
case g.
|
|
394
|
+
case g.Q3:
|
|
397
395
|
return It;
|
|
396
|
+
case g.Q4:
|
|
397
|
+
return Mt;
|
|
398
398
|
default:
|
|
399
399
|
throw new Error("Unsupported compare type");
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
-
class
|
|
402
|
+
class nn {
|
|
403
403
|
/**
|
|
404
404
|
* Initializes a new instance of the Heap class.
|
|
405
405
|
*/
|
|
@@ -463,7 +463,7 @@ class tn {
|
|
|
463
463
|
return this.heap.includes(e);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
class
|
|
466
|
+
class rn extends nn {
|
|
467
467
|
/**
|
|
468
468
|
* Initializes a new instance of the MinHeap class.
|
|
469
469
|
*/
|
|
@@ -502,13 +502,13 @@ class nn extends tn {
|
|
|
502
502
|
this.heap[0] = this.heap.pop(), this.shiftDown(0);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
const
|
|
506
|
-
const n = new
|
|
505
|
+
const sn = (t, e) => {
|
|
506
|
+
const n = new rn();
|
|
507
507
|
for (const r of t)
|
|
508
508
|
n.insert(r), n.size() > e && n.pop();
|
|
509
509
|
return n.heap;
|
|
510
|
-
},
|
|
511
|
-
function
|
|
510
|
+
}, an = (t, e) => t > e, on = (t, e) => t < e, ln = (t, e, n) => sn(t, e).includes(n);
|
|
511
|
+
function un(t, e) {
|
|
512
512
|
switch (t.compareType) {
|
|
513
513
|
case F.Equal: {
|
|
514
514
|
const n = Number(t.expectedValue);
|
|
@@ -544,59 +544,59 @@ function ln(t, e) {
|
|
|
544
544
|
}
|
|
545
545
|
case F.Above: {
|
|
546
546
|
const n = e.average;
|
|
547
|
-
return (r) =>
|
|
547
|
+
return (r) => an(r, n);
|
|
548
548
|
}
|
|
549
549
|
case F.Below: {
|
|
550
550
|
const n = e.average;
|
|
551
|
-
return (r) =>
|
|
551
|
+
return (r) => on(r, n);
|
|
552
552
|
}
|
|
553
553
|
case F.TopN: {
|
|
554
554
|
const n = e.list, r = Number(t.expectedValue);
|
|
555
|
-
return (s) =>
|
|
555
|
+
return (s) => ln(n, r, s);
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
const
|
|
559
|
+
const z = (t) => {
|
|
560
560
|
const n = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\\\*/g, ".*").replace(/\\\?/g, ".");
|
|
561
561
|
return new RegExp(`^${n}$`);
|
|
562
|
-
},
|
|
563
|
-
function
|
|
562
|
+
}, cn = (t, e) => z(e).test(t), dn = (t, e) => !z(e).test(t), hn = (t, e) => z(`*${e}*`).test(t), gn = (t, e) => !z(`*${e}*`).test(t), mn = (t, e) => z(`${e}*`).test(t), bn = (t, e) => z(`*${e}`).test(t);
|
|
563
|
+
function wn(t) {
|
|
564
564
|
switch (t.compareType) {
|
|
565
565
|
case P.Equal:
|
|
566
|
-
return (e) => un(e, t.expectedValue);
|
|
567
|
-
case P.NotEqual:
|
|
568
566
|
return (e) => cn(e, t.expectedValue);
|
|
569
|
-
case P.
|
|
567
|
+
case P.NotEqual:
|
|
570
568
|
return (e) => dn(e, t.expectedValue);
|
|
571
|
-
case P.
|
|
569
|
+
case P.Contains:
|
|
572
570
|
return (e) => hn(e, t.expectedValue);
|
|
573
|
-
case P.
|
|
571
|
+
case P.NotContains:
|
|
574
572
|
return (e) => gn(e, t.expectedValue);
|
|
575
|
-
case P.
|
|
573
|
+
case P.StartsWith:
|
|
576
574
|
return (e) => mn(e, t.expectedValue);
|
|
575
|
+
case P.EndsWith:
|
|
576
|
+
return (e) => bn(e, t.expectedValue);
|
|
577
577
|
default:
|
|
578
578
|
return console.error(`Unknown filter operator: ${t.compareType}`), (e) => !0;
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
const
|
|
581
|
+
const fn = /* @__PURE__ */ new Set([
|
|
582
582
|
F.Above,
|
|
583
583
|
F.Below,
|
|
584
584
|
F.TopN
|
|
585
585
|
]);
|
|
586
586
|
g.Today, g.Yesterday, g.Tomorrow, g.ThisWeek, g.LastWeek, g.NextWeek, g.ThisMonth, g.LastMonth, g.NextMonth, g.ThisQuarter, g.LastQuarter, g.NextQuarter, g.NextYear, g.ThisYear, g.LastYear, g.YearToDate;
|
|
587
|
-
function
|
|
588
|
-
return
|
|
587
|
+
function Ke(t) {
|
|
588
|
+
return fn.has(t);
|
|
589
589
|
}
|
|
590
590
|
function Rn(t, e) {
|
|
591
|
-
if (
|
|
591
|
+
if (Ke(t.filterInfo.compareType))
|
|
592
592
|
return (n) => !0;
|
|
593
593
|
switch (t.filterInfo.conditionType) {
|
|
594
594
|
case U.Date:
|
|
595
|
-
return
|
|
595
|
+
return tn(t.filterInfo);
|
|
596
596
|
case U.Number:
|
|
597
|
-
return
|
|
597
|
+
return un(t.filterInfo, e);
|
|
598
598
|
case U.String:
|
|
599
|
-
return
|
|
599
|
+
return wn(t.filterInfo);
|
|
600
600
|
case U.Logic:
|
|
601
601
|
default:
|
|
602
602
|
return (n) => !0;
|
|
@@ -606,25 +606,25 @@ function oe(t, e, n, r) {
|
|
|
606
606
|
switch (r) {
|
|
607
607
|
case U.Date: {
|
|
608
608
|
const s = Ne(t, e, n);
|
|
609
|
-
return s ?
|
|
609
|
+
return s ? Cn(s) : null;
|
|
610
610
|
}
|
|
611
611
|
case U.Number:
|
|
612
612
|
return Ne(t, e, n);
|
|
613
613
|
case U.String:
|
|
614
614
|
default:
|
|
615
|
-
return
|
|
615
|
+
return Sn(t, e, n);
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
const
|
|
618
|
+
const pn = (t) => {
|
|
619
619
|
var n;
|
|
620
620
|
return ((n = t.body) == null ? void 0 : n.dataStream.replace(/\r\n$/, "")) || "";
|
|
621
621
|
};
|
|
622
|
-
function
|
|
622
|
+
function Sn(t, e, n) {
|
|
623
623
|
const r = t.getCell(e, n);
|
|
624
624
|
if (!r) return null;
|
|
625
625
|
const { v: s, t: a, p: o } = r;
|
|
626
626
|
if (o)
|
|
627
|
-
return
|
|
627
|
+
return pn(o);
|
|
628
628
|
if (typeof s == "string")
|
|
629
629
|
return a === q.BOOLEAN ? s.toUpperCase() : s;
|
|
630
630
|
if (typeof s == "number")
|
|
@@ -639,7 +639,7 @@ function Ne(t, e, n) {
|
|
|
639
639
|
const { v: s, t: a, p: o } = r;
|
|
640
640
|
return o ? null : typeof s == "string" && a === q.NUMBER ? Number(t.getCellRaw(e, n).v) : Number(s);
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function Cn(t) {
|
|
643
643
|
const e = new Date(Date.UTC(1900, 0, 1, 0, 0, 0)), n = new Date(Date.UTC(1900, 1, 28, 0, 0, 0));
|
|
644
644
|
let r = t - 1;
|
|
645
645
|
return r > (n.getTime() - e.getTime()) / (1e3 * 3600 * 24) && (r -= 1), r < 0 && (r = t), new Date(e.getTime() + r * (1e3 * 3600 * 24));
|
|
@@ -662,8 +662,8 @@ class ye {
|
|
|
662
662
|
}
|
|
663
663
|
getFilterState(e) {
|
|
664
664
|
var r;
|
|
665
|
-
const n = ((r = this._tableSortInfo) == null ? void 0 : r.columnIndex) === e ? this._tableSortInfo.sortState :
|
|
666
|
-
return
|
|
665
|
+
const n = ((r = this._tableSortInfo) == null ? void 0 : r.columnIndex) === e ? this._tableSortInfo.sortState : Y.None;
|
|
666
|
+
return pt(this._tableColumnFilterList[e], n);
|
|
667
667
|
}
|
|
668
668
|
getSortState() {
|
|
669
669
|
var e;
|
|
@@ -689,7 +689,7 @@ class ye {
|
|
|
689
689
|
if (a && e) {
|
|
690
690
|
const { startRow: o, endRow: l, startColumn: u } = n, i = u + r, h = this.getExecuteFunc(e, n, r, a);
|
|
691
691
|
for (let d = o; d <= l; d++) {
|
|
692
|
-
const c =
|
|
692
|
+
const c = St(a) ? a.filterInfo.conditionType : U.String;
|
|
693
693
|
oe(e, d, i, c) === null ? s.add(d) : h(oe(e, d, i, c)) || s.add(d);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
@@ -707,11 +707,11 @@ class ye {
|
|
|
707
707
|
};
|
|
708
708
|
}
|
|
709
709
|
getExecuteFunc(e, n, r, s) {
|
|
710
|
-
if (s.filterType ===
|
|
710
|
+
if (s.filterType === Z.manual) {
|
|
711
711
|
const a = new Set(s.values);
|
|
712
712
|
return (o) => a.has(o);
|
|
713
|
-
} else if (s.filterType ===
|
|
714
|
-
const o =
|
|
713
|
+
} else if (s.filterType === Z.condition) {
|
|
714
|
+
const o = Ke(s.filterInfo.compareType) ? this._getNumberCalculatedOptions(e, n, r) : void 0;
|
|
715
715
|
return Rn(s, o);
|
|
716
716
|
} else
|
|
717
717
|
return (a) => !0;
|
|
@@ -847,7 +847,7 @@ class xe {
|
|
|
847
847
|
}
|
|
848
848
|
getTableStyleId() {
|
|
849
849
|
var e;
|
|
850
|
-
return (e = this._tableStyleId) != null ? e :
|
|
850
|
+
return (e = this._tableStyleId) != null ? e : je[0].name;
|
|
851
851
|
}
|
|
852
852
|
setTableStyleId(e) {
|
|
853
853
|
this._tableStyleId = e;
|
|
@@ -917,8 +917,8 @@ class xe {
|
|
|
917
917
|
this._id = "", this._name = "", this._tableStyleId = "", this._showHeader = !0, this._showFooter = !0, delete this._range, this._columns.clear(), this._columnOrder = [];
|
|
918
918
|
}
|
|
919
919
|
}
|
|
920
|
-
var
|
|
921
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
920
|
+
var _n = Object.getOwnPropertyDescriptor, Tn = (t, e, n, r) => {
|
|
921
|
+
for (var s = r > 1 ? void 0 : r ? _n(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
922
922
|
(o = t[a]) && (s = o(s) || s);
|
|
923
923
|
return s;
|
|
924
924
|
}, Oe = (t, e) => (n, r) => e(n, r, t);
|
|
@@ -949,7 +949,7 @@ let _ = class extends k {
|
|
|
949
949
|
var d;
|
|
950
950
|
const a = (d = this._univerInstanceService.getUnit(e)) == null ? void 0 : d.getSheetBySheetId(n), { startRow: o, startColumn: l, endColumn: u } = r, i = [], h = s != null ? s : "Column";
|
|
951
951
|
for (let c = l; c <= u; c++)
|
|
952
|
-
i.push(Ye(a == null ? void 0 : a.getCell(o, c)) ||
|
|
952
|
+
i.push(Ye(a == null ? void 0 : a.getCell(o, c)) || X(c - l + 1, h));
|
|
953
953
|
return i;
|
|
954
954
|
}
|
|
955
955
|
/**
|
|
@@ -1082,7 +1082,7 @@ let _ = class extends k {
|
|
|
1082
1082
|
else if (o === "column") {
|
|
1083
1083
|
d.endColumn += u;
|
|
1084
1084
|
for (let c = 0; c < u; c++) {
|
|
1085
|
-
const m = this._localeService.t("sheets-table.columnPrefix"), S = new J(L(),
|
|
1085
|
+
const m = this._localeService.t("sheets-table.columnPrefix"), S = new J(L(), X(s.getColumnsCount() + 1 + c, m));
|
|
1086
1086
|
i != null && i[c] && S.fromJSON(i[c]);
|
|
1087
1087
|
const w = l + c - h.startColumn;
|
|
1088
1088
|
s.insertColumn(w, S);
|
|
@@ -1112,7 +1112,7 @@ let _ = class extends k {
|
|
|
1112
1112
|
if (o.startColumn < a.startColumn) {
|
|
1113
1113
|
const l = a.startColumn - o.startColumn, u = this._localeService.t("sheets-table.columnPrefix");
|
|
1114
1114
|
for (let i = 0; i < l; i++)
|
|
1115
|
-
s.insertColumn(a.startColumn, new J(L(),
|
|
1115
|
+
s.insertColumn(a.startColumn, new J(L(), X(s.getColumnsCount() + 1, u)));
|
|
1116
1116
|
} else if (o.startColumn > a.startColumn) {
|
|
1117
1117
|
const l = o.startColumn - a.startColumn;
|
|
1118
1118
|
for (let u = l - 1; u >= 0; u--) {
|
|
@@ -1129,7 +1129,7 @@ let _ = class extends k {
|
|
|
1129
1129
|
} else if (o.endColumn > a.endColumn) {
|
|
1130
1130
|
const l = o.endColumn - a.endColumn;
|
|
1131
1131
|
for (let u = 0; u < l; u++)
|
|
1132
|
-
s.insertColumn(a.endColumn, new J(L(),
|
|
1132
|
+
s.insertColumn(a.endColumn, new J(L(), X(s.getColumnsCount() + 1, "Column")));
|
|
1133
1133
|
}
|
|
1134
1134
|
s.setRange(o), this._tableRangeChanged$.next({
|
|
1135
1135
|
unitId: e,
|
|
@@ -1218,16 +1218,16 @@ let _ = class extends k {
|
|
|
1218
1218
|
}), this._tableMap.clear();
|
|
1219
1219
|
}
|
|
1220
1220
|
};
|
|
1221
|
-
_ =
|
|
1221
|
+
_ = Tn([
|
|
1222
1222
|
Oe(0, W),
|
|
1223
1223
|
Oe(1, C(de))
|
|
1224
1224
|
], _);
|
|
1225
|
-
var
|
|
1226
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
1225
|
+
var In = Object.getOwnPropertyDescriptor, Mn = (t, e, n, r) => {
|
|
1226
|
+
for (var s = r > 1 ? void 0 : r ? In(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
1227
1227
|
(o = t[a]) && (s = o(s) || s);
|
|
1228
1228
|
return s;
|
|
1229
|
-
},
|
|
1230
|
-
let
|
|
1229
|
+
}, vn = (t, e) => (n, r) => e(n, r, t);
|
|
1230
|
+
let j = class extends k {
|
|
1231
1231
|
constructor(t) {
|
|
1232
1232
|
super(), this._tableManager = t;
|
|
1233
1233
|
}
|
|
@@ -1271,24 +1271,24 @@ let z = class extends k {
|
|
|
1271
1271
|
return oe(t, e, n, r);
|
|
1272
1272
|
}
|
|
1273
1273
|
};
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
],
|
|
1277
|
-
const
|
|
1274
|
+
j = Mn([
|
|
1275
|
+
vn(0, C(_))
|
|
1276
|
+
], j);
|
|
1277
|
+
const ee = {
|
|
1278
1278
|
id: "sheet.mutation.add-table",
|
|
1279
1279
|
type: N.MUTATION,
|
|
1280
1280
|
handler: (t, e) => {
|
|
1281
1281
|
const { tableId: n, unitId: r, subUnitId: s, name: a, range: o, header: l, options: u } = e;
|
|
1282
|
-
return t.get(
|
|
1282
|
+
return t.get(j).addTable(r, s, a, o, l, n, u), !0;
|
|
1283
1283
|
}
|
|
1284
|
-
},
|
|
1284
|
+
}, te = {
|
|
1285
1285
|
id: "sheet.mutation.delete-table",
|
|
1286
1286
|
type: N.MUTATION,
|
|
1287
1287
|
handler: (t, e) => {
|
|
1288
1288
|
const { unitId: n, subUnitId: r, tableId: s } = e;
|
|
1289
|
-
return t.get(
|
|
1289
|
+
return t.get(j).deleteTable(n, r, s), !0;
|
|
1290
1290
|
}
|
|
1291
|
-
},
|
|
1291
|
+
}, Fn = {
|
|
1292
1292
|
id: "sheet.command.add-table",
|
|
1293
1293
|
type: N.COMMAND,
|
|
1294
1294
|
handler: (t, e) => {
|
|
@@ -1298,17 +1298,17 @@ const te = {
|
|
|
1298
1298
|
const n = t.get(A), r = t.get(x), s = t.get(de), a = (w = e.id) != null ? w : L();
|
|
1299
1299
|
let o = e.name;
|
|
1300
1300
|
if (!o) {
|
|
1301
|
-
const
|
|
1302
|
-
o = `${s.t("sheets-table.tablePrefix")}${
|
|
1301
|
+
const f = t.get(_).getTableList(e.unitId).length;
|
|
1302
|
+
o = `${s.t("sheets-table.tablePrefix")}${f + 1}`;
|
|
1303
1303
|
}
|
|
1304
1304
|
const l = [], u = [], i = t.get(_), { unitId: h, subUnitId: d, range: c } = e, m = i.getColumnHeader(h, d, c, s.t("sheets-table.columnPrefix"));
|
|
1305
|
-
return l.push({ id:
|
|
1305
|
+
return l.push({ id: ee.id, params: { ...e, tableId: a, name: o, header: m } }), u.push({ id: te.id, params: { tableId: a, unitId: e.unitId } }), B(l, r) && n.pushUndoRedo({
|
|
1306
1306
|
unitID: e.unitId,
|
|
1307
1307
|
undoMutations: u,
|
|
1308
1308
|
redoMutations: l
|
|
1309
1309
|
}), !0;
|
|
1310
1310
|
}
|
|
1311
|
-
},
|
|
1311
|
+
}, Dn = {
|
|
1312
1312
|
id: "sheet.command.delete-table",
|
|
1313
1313
|
type: N.COMMAND,
|
|
1314
1314
|
handler: (t, e) => {
|
|
@@ -1317,8 +1317,8 @@ const te = {
|
|
|
1317
1317
|
const n = t.get(A), r = t.get(x), s = t.get(_), a = [], o = [], l = s.getTable(e.unitId, e.tableId), u = l == null ? void 0 : l.toJSON();
|
|
1318
1318
|
if (!u)
|
|
1319
1319
|
throw new Error("[TableManager]: Table not found");
|
|
1320
|
-
return a.push({ id:
|
|
1321
|
-
id:
|
|
1320
|
+
return a.push({ id: te.id, params: { ...e } }), o.push({
|
|
1321
|
+
id: ee.id,
|
|
1322
1322
|
params: {
|
|
1323
1323
|
unitId: e.unitId,
|
|
1324
1324
|
subUnitId: e.subUnitId,
|
|
@@ -1333,29 +1333,29 @@ const te = {
|
|
|
1333
1333
|
redoMutations: a
|
|
1334
1334
|
}), !0;
|
|
1335
1335
|
}
|
|
1336
|
-
},
|
|
1336
|
+
}, Se = {
|
|
1337
1337
|
id: "sheet.mutation.set-table-filter",
|
|
1338
1338
|
type: N.MUTATION,
|
|
1339
1339
|
handler: (t, e) => {
|
|
1340
1340
|
const { tableId: n, unitId: r, column: s, tableFilter: a } = e;
|
|
1341
1341
|
return t.get(_).addFilter(r, n, s, a), !0;
|
|
1342
1342
|
}
|
|
1343
|
-
},
|
|
1343
|
+
}, Nn = {
|
|
1344
1344
|
id: "sheet.command.set-table-filter",
|
|
1345
1345
|
type: N.COMMAND,
|
|
1346
1346
|
handler: (t, e) => {
|
|
1347
1347
|
if (!e)
|
|
1348
1348
|
return !1;
|
|
1349
1349
|
const n = t.get(A), r = t.get(x), s = e.tableId || L(), a = [], o = [];
|
|
1350
|
-
return a.push({ id:
|
|
1350
|
+
return a.push({ id: Se.id, params: { ...e, tableId: s } }), o.push({ id: Se.id, params: { ...e, tableId: s, tableFilter: void 0 } }), B(a, r) && n.pushUndoRedo({
|
|
1351
1351
|
unitID: e.unitId,
|
|
1352
1352
|
undoMutations: o,
|
|
1353
1353
|
redoMutations: a
|
|
1354
1354
|
}), !0;
|
|
1355
1355
|
}
|
|
1356
|
-
},
|
|
1357
|
-
var
|
|
1358
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
1356
|
+
}, Xe = "SHEET_TABLE_PLUGIN", re = "SHEET_TABLE", yn = "table-custom";
|
|
1357
|
+
var xn = Object.getOwnPropertyDescriptor, On = (t, e, n, r) => {
|
|
1358
|
+
for (var s = r > 1 ? void 0 : r ? xn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
1359
1359
|
(o = t[a]) && (s = o(s) || s);
|
|
1360
1360
|
return s;
|
|
1361
1361
|
}, we = (t, e) => (n, r) => e(n, r, t);
|
|
@@ -1368,13 +1368,13 @@ let E = class extends k {
|
|
|
1368
1368
|
getContainerTableWithRange(e, n, r) {
|
|
1369
1369
|
const s = this._ensureTableRangeRTree(e), o = Array.from(s.bulkSearch([{ unitId: e, sheetId: n, range: r }])).find((l) => {
|
|
1370
1370
|
const u = this._tableManager.getTable(e, String(l));
|
|
1371
|
-
return u ?
|
|
1371
|
+
return u ? pe.contains(u.getRange(), r) : !1;
|
|
1372
1372
|
});
|
|
1373
1373
|
if (o)
|
|
1374
1374
|
return this._tableManager.getTable(e, String(o));
|
|
1375
1375
|
}
|
|
1376
1376
|
_ensureTableRangeRTree(e) {
|
|
1377
|
-
return this._tableRangeRTree.has(e) || this._tableRangeRTree.set(e, new
|
|
1377
|
+
return this._tableRangeRTree.has(e) || this._tableRangeRTree.set(e, new rt()), this._tableRangeRTree.get(e);
|
|
1378
1378
|
}
|
|
1379
1379
|
registerTableChangeEvent() {
|
|
1380
1380
|
this.disposeWithMe(
|
|
@@ -1417,7 +1417,7 @@ let E = class extends k {
|
|
|
1417
1417
|
registerTableHeaderInterceptor() {
|
|
1418
1418
|
this.disposeWithMe(
|
|
1419
1419
|
this._sheetInterceptorService.intercept(Le.CELL_CONTENT, {
|
|
1420
|
-
effect:
|
|
1420
|
+
effect: st.Value,
|
|
1421
1421
|
handler: (e, n, r) => {
|
|
1422
1422
|
const { row: s, col: a, unitId: o, subUnitId: l } = n, u = this._ensureTableRangeRTree(o);
|
|
1423
1423
|
if ((e == null ? void 0 : e.v) === void 0 && u) {
|
|
@@ -1460,7 +1460,7 @@ let E = class extends k {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
},
|
|
1462
1462
|
businesses: [he.UNIVER_SHEET],
|
|
1463
|
-
pluginName:
|
|
1463
|
+
pluginName: Xe,
|
|
1464
1464
|
onLoad: (e, n) => {
|
|
1465
1465
|
this._fromJSON(e, n);
|
|
1466
1466
|
},
|
|
@@ -1473,10 +1473,10 @@ let E = class extends k {
|
|
|
1473
1473
|
super.dispose(), this._tableRangeRTree.clear();
|
|
1474
1474
|
}
|
|
1475
1475
|
};
|
|
1476
|
-
E =
|
|
1477
|
-
we(0, C(
|
|
1476
|
+
E = On([
|
|
1477
|
+
we(0, C(Ce)),
|
|
1478
1478
|
we(1, C(_)),
|
|
1479
|
-
we(2, C(
|
|
1479
|
+
we(2, C(nt))
|
|
1480
1480
|
], E);
|
|
1481
1481
|
const p = {
|
|
1482
1482
|
id: "sheet.mutation.set-sheet-table",
|
|
@@ -1487,7 +1487,7 @@ const p = {
|
|
|
1487
1487
|
const { unitId: n, tableId: r, config: s } = e;
|
|
1488
1488
|
return t.get(_).setTableByConfig(n, r, s), !0;
|
|
1489
1489
|
}
|
|
1490
|
-
},
|
|
1490
|
+
}, Un = {
|
|
1491
1491
|
id: "sheet.command.add-table-theme",
|
|
1492
1492
|
type: N.COMMAND,
|
|
1493
1493
|
handler: (t, e) => {
|
|
@@ -1538,7 +1538,7 @@ const p = {
|
|
|
1538
1538
|
redoMutations: o
|
|
1539
1539
|
}), !0;
|
|
1540
1540
|
}
|
|
1541
|
-
},
|
|
1541
|
+
}, $n = {
|
|
1542
1542
|
id: "sheet.command.remove-table-theme",
|
|
1543
1543
|
type: N.COMMAND,
|
|
1544
1544
|
handler: (t, e) => {
|
|
@@ -1546,8 +1546,8 @@ const p = {
|
|
|
1546
1546
|
return !1;
|
|
1547
1547
|
const { unitId: n, tableId: r, themeName: s } = e, a = t.get(_), o = t.get(He), l = a.getTableById(n, r);
|
|
1548
1548
|
if (!l) return !1;
|
|
1549
|
-
const u = l.getSubunitId(), i = [], h = [], d = o.getRegisteredRangeThemes().filter((
|
|
1550
|
-
let m = o.getRegisteredRangeThemes().filter((
|
|
1549
|
+
const u = l.getSubunitId(), i = [], h = [], d = o.getRegisteredRangeThemes().filter((f) => f == null ? void 0 : f.startsWith("table-default"));
|
|
1550
|
+
let m = o.getRegisteredRangeThemes().filter((f) => f == null ? void 0 : f.startsWith(yn)).find((f) => f !== s);
|
|
1551
1551
|
m || (m = d[0]), i.push({ id: p.id, params: { unitId: n, subUnitId: u, tableId: r, config: { theme: m } } }), i.push({ id: We.id, params: { unitId: n, subUnitId: u, styleName: s } });
|
|
1552
1552
|
const S = o.getDefaultRangeThemeStyle(s);
|
|
1553
1553
|
S && (h.push({ id: Ee.id, params: { unitId: n, subUnitId: u, styleJSON: S.toJson() } }), h.push({ id: p.id, params: { unitId: n, subUnitId: u, tableId: r, config: { theme: s } } }));
|
|
@@ -1558,7 +1558,7 @@ const p = {
|
|
|
1558
1558
|
undoMutations: h
|
|
1559
1559
|
}), !0;
|
|
1560
1560
|
}
|
|
1561
|
-
},
|
|
1561
|
+
}, An = {
|
|
1562
1562
|
id: "sheet.command.set-table-config",
|
|
1563
1563
|
type: N.COMMAND,
|
|
1564
1564
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -1571,8 +1571,8 @@ const p = {
|
|
|
1571
1571
|
if (S && S.getSheets().forEach((O) => {
|
|
1572
1572
|
w.add(O.getName());
|
|
1573
1573
|
}), s) {
|
|
1574
|
-
if (!
|
|
1575
|
-
return t.get(
|
|
1574
|
+
if (!at(s, w))
|
|
1575
|
+
return t.get(ot).warn(c.t("sheets-table.tableNameError")), !1;
|
|
1576
1576
|
h.name = i.getDisplayName(), d.name = s;
|
|
1577
1577
|
}
|
|
1578
1578
|
o && (h.rowColOperation = {
|
|
@@ -1583,13 +1583,13 @@ const p = {
|
|
|
1583
1583
|
}, d.rowColOperation = o), a && (h.updateRange = {
|
|
1584
1584
|
newRange: i.getRange()
|
|
1585
1585
|
}, d.updateRange = a), l && (h.theme = i.getTableStyleId(), d.theme = l);
|
|
1586
|
-
const
|
|
1586
|
+
const R = {
|
|
1587
1587
|
unitId: n,
|
|
1588
1588
|
subUnitId: i.getSubunitId(),
|
|
1589
1589
|
tableId: r,
|
|
1590
1590
|
config: d
|
|
1591
1591
|
};
|
|
1592
|
-
return t.get(x).executeCommand(p.id,
|
|
1592
|
+
return t.get(x).executeCommand(p.id, R), t.get(A).pushUndoRedo({
|
|
1593
1593
|
unitID: n,
|
|
1594
1594
|
undoMutations: [
|
|
1595
1595
|
{
|
|
@@ -1605,12 +1605,12 @@ const p = {
|
|
|
1605
1605
|
redoMutations: [
|
|
1606
1606
|
{
|
|
1607
1607
|
id: p.id,
|
|
1608
|
-
params:
|
|
1608
|
+
params: R
|
|
1609
1609
|
}
|
|
1610
1610
|
]
|
|
1611
1611
|
}), !0;
|
|
1612
1612
|
}
|
|
1613
|
-
},
|
|
1613
|
+
}, Bn = {
|
|
1614
1614
|
id: "sheet.command.table-insert-row",
|
|
1615
1615
|
type: N.COMMAND,
|
|
1616
1616
|
handler: (t) => {
|
|
@@ -1623,16 +1623,16 @@ const p = {
|
|
|
1623
1623
|
t.get(_);
|
|
1624
1624
|
const h = u[0].range, c = t.get(E).getContainerTableWithRange(a, o, h);
|
|
1625
1625
|
if (!c) return !1;
|
|
1626
|
-
const m = h.endRow - h.startRow + 1, w = s.getRowCount() - 1,
|
|
1627
|
-
if (w -
|
|
1628
|
-
|
|
1626
|
+
const m = h.endRow - h.startRow + 1, w = s.getRowCount() - 1, R = s.getCellMatrix().getDataRange().endRow, f = [], T = [];
|
|
1627
|
+
if (w - R < m)
|
|
1628
|
+
f.push({
|
|
1629
1629
|
id: Pe.id,
|
|
1630
1630
|
params: {
|
|
1631
1631
|
unitId: a,
|
|
1632
1632
|
subUnitId: o,
|
|
1633
1633
|
range: { ...h }
|
|
1634
1634
|
}
|
|
1635
|
-
}),
|
|
1635
|
+
}), f.push({
|
|
1636
1636
|
id: p.id,
|
|
1637
1637
|
params: {
|
|
1638
1638
|
unitId: a,
|
|
@@ -1669,7 +1669,7 @@ const p = {
|
|
|
1669
1669
|
});
|
|
1670
1670
|
else {
|
|
1671
1671
|
const M = { ...c.getRange() };
|
|
1672
|
-
|
|
1672
|
+
f.push({
|
|
1673
1673
|
id: p.id,
|
|
1674
1674
|
params: {
|
|
1675
1675
|
unitId: a,
|
|
@@ -1697,14 +1697,14 @@ const p = {
|
|
|
1697
1697
|
}
|
|
1698
1698
|
}
|
|
1699
1699
|
});
|
|
1700
|
-
const
|
|
1700
|
+
const K = me(
|
|
1701
1701
|
t,
|
|
1702
1702
|
{
|
|
1703
1703
|
unitId: a,
|
|
1704
1704
|
subUnitId: o,
|
|
1705
1705
|
range: {
|
|
1706
1706
|
startRow: h.startRow,
|
|
1707
|
-
endRow:
|
|
1707
|
+
endRow: R,
|
|
1708
1708
|
startColumn: M.startColumn,
|
|
1709
1709
|
endColumn: M.endColumn
|
|
1710
1710
|
}
|
|
@@ -1714,22 +1714,22 @@ const p = {
|
|
|
1714
1714
|
subUnitId: o,
|
|
1715
1715
|
range: {
|
|
1716
1716
|
startRow: h.startRow + m,
|
|
1717
|
-
endRow:
|
|
1717
|
+
endRow: R + m,
|
|
1718
1718
|
startColumn: M.startColumn,
|
|
1719
1719
|
endColumn: M.endColumn
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
1722
|
);
|
|
1723
|
-
|
|
1723
|
+
K && (f.push(...K.redos), T.push(...K.undos));
|
|
1724
1724
|
}
|
|
1725
1725
|
const O = t.get(x);
|
|
1726
|
-
return B(
|
|
1726
|
+
return B(f, O) && t.get(A).pushUndoRedo({
|
|
1727
1727
|
unitID: a,
|
|
1728
1728
|
undoMutations: T,
|
|
1729
|
-
redoMutations:
|
|
1729
|
+
redoMutations: f
|
|
1730
1730
|
}), !0;
|
|
1731
1731
|
}
|
|
1732
|
-
},
|
|
1732
|
+
}, Ln = {
|
|
1733
1733
|
id: "sheet.command.table-insert-col",
|
|
1734
1734
|
type: N.COMMAND,
|
|
1735
1735
|
handler: (t) => {
|
|
@@ -1741,16 +1741,16 @@ const p = {
|
|
|
1741
1741
|
return !1;
|
|
1742
1742
|
const i = l[0].range, d = t.get(E).getContainerTableWithRange(s, a, i);
|
|
1743
1743
|
if (!d) return !1;
|
|
1744
|
-
const c = i.endColumn - i.startColumn + 1, S = r.getColumnCount() - 1, w = r.getCellMatrix().getDataRange().endColumn,
|
|
1744
|
+
const c = i.endColumn - i.startColumn + 1, S = r.getColumnCount() - 1, w = r.getCellMatrix().getDataRange().endColumn, R = [], f = [];
|
|
1745
1745
|
if (S - w < c)
|
|
1746
|
-
|
|
1746
|
+
R.push({
|
|
1747
1747
|
id: qe.id,
|
|
1748
1748
|
params: {
|
|
1749
1749
|
unitId: s,
|
|
1750
1750
|
subUnitId: a,
|
|
1751
1751
|
range: { ...i }
|
|
1752
1752
|
}
|
|
1753
|
-
}),
|
|
1753
|
+
}), R.push({
|
|
1754
1754
|
id: p.id,
|
|
1755
1755
|
params: {
|
|
1756
1756
|
unitId: s,
|
|
@@ -1765,7 +1765,7 @@ const p = {
|
|
|
1765
1765
|
}
|
|
1766
1766
|
}
|
|
1767
1767
|
}
|
|
1768
|
-
}),
|
|
1768
|
+
}), f.push({
|
|
1769
1769
|
id: p.id,
|
|
1770
1770
|
params: {
|
|
1771
1771
|
unitId: s,
|
|
@@ -1780,7 +1780,7 @@ const p = {
|
|
|
1780
1780
|
}
|
|
1781
1781
|
}
|
|
1782
1782
|
}
|
|
1783
|
-
}),
|
|
1783
|
+
}), f.push({
|
|
1784
1784
|
id: Je.id,
|
|
1785
1785
|
params: {
|
|
1786
1786
|
unitId: s,
|
|
@@ -1790,7 +1790,7 @@ const p = {
|
|
|
1790
1790
|
});
|
|
1791
1791
|
else {
|
|
1792
1792
|
const v = d.getRange();
|
|
1793
|
-
|
|
1793
|
+
R.push({
|
|
1794
1794
|
id: p.id,
|
|
1795
1795
|
params: {
|
|
1796
1796
|
unitId: s,
|
|
@@ -1805,7 +1805,7 @@ const p = {
|
|
|
1805
1805
|
}
|
|
1806
1806
|
}
|
|
1807
1807
|
}
|
|
1808
|
-
}),
|
|
1808
|
+
}), f.push({
|
|
1809
1809
|
id: p.id,
|
|
1810
1810
|
params: {
|
|
1811
1811
|
unitId: s,
|
|
@@ -1844,16 +1844,16 @@ const p = {
|
|
|
1844
1844
|
}
|
|
1845
1845
|
}
|
|
1846
1846
|
);
|
|
1847
|
-
M && (
|
|
1847
|
+
M && (R.push(...M.redos), f.push(...M.undos));
|
|
1848
1848
|
}
|
|
1849
1849
|
const T = t.get(x);
|
|
1850
|
-
return B(
|
|
1850
|
+
return B(R, T) && t.get(A).pushUndoRedo({
|
|
1851
1851
|
unitID: s,
|
|
1852
|
-
undoMutations:
|
|
1853
|
-
redoMutations:
|
|
1852
|
+
undoMutations: f,
|
|
1853
|
+
redoMutations: R
|
|
1854
1854
|
}), !0;
|
|
1855
1855
|
}
|
|
1856
|
-
},
|
|
1856
|
+
}, En = {
|
|
1857
1857
|
id: "sheet.command.table-remove-row",
|
|
1858
1858
|
type: N.COMMAND,
|
|
1859
1859
|
handler: (t, e) => {
|
|
@@ -1896,14 +1896,14 @@ const p = {
|
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
1898
1898
|
});
|
|
1899
|
-
const
|
|
1899
|
+
const f = r.worksheet.getCellMatrix().getDataRange().endRow, T = me(
|
|
1900
1900
|
t,
|
|
1901
1901
|
{
|
|
1902
1902
|
unitId: s,
|
|
1903
1903
|
subUnitId: a,
|
|
1904
1904
|
range: {
|
|
1905
1905
|
startRow: i.endRow + 1,
|
|
1906
|
-
endRow:
|
|
1906
|
+
endRow: f,
|
|
1907
1907
|
startColumn: w.startColumn,
|
|
1908
1908
|
endColumn: w.endColumn
|
|
1909
1909
|
}
|
|
@@ -1913,7 +1913,7 @@ const p = {
|
|
|
1913
1913
|
subUnitId: a,
|
|
1914
1914
|
range: {
|
|
1915
1915
|
startRow: i.startRow,
|
|
1916
|
-
endRow:
|
|
1916
|
+
endRow: f - c,
|
|
1917
1917
|
startColumn: w.startColumn,
|
|
1918
1918
|
endColumn: w.endColumn
|
|
1919
1919
|
}
|
|
@@ -1927,7 +1927,7 @@ const p = {
|
|
|
1927
1927
|
redoMutations: m
|
|
1928
1928
|
}), !0;
|
|
1929
1929
|
}
|
|
1930
|
-
},
|
|
1930
|
+
}, Wn = {
|
|
1931
1931
|
id: "sheet.command.table-remove-col",
|
|
1932
1932
|
type: N.COMMAND,
|
|
1933
1933
|
handler: (t, e) => {
|
|
@@ -1943,7 +1943,7 @@ const p = {
|
|
|
1943
1943
|
return !1;
|
|
1944
1944
|
const h = u[0].range, c = t.get(E).getContainerTableWithRange(a, o, h);
|
|
1945
1945
|
if (!c) return !1;
|
|
1946
|
-
const m = h.endColumn - h.startColumn + 1, S = [], w = [],
|
|
1946
|
+
const m = h.endColumn - h.startColumn + 1, S = [], w = [], R = c.getRange();
|
|
1947
1947
|
S.push({
|
|
1948
1948
|
id: p.id,
|
|
1949
1949
|
params: {
|
|
@@ -1960,10 +1960,10 @@ const p = {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
}
|
|
1962
1962
|
});
|
|
1963
|
-
const
|
|
1964
|
-
for (let
|
|
1965
|
-
const
|
|
1966
|
-
|
|
1963
|
+
const f = [], T = h.startColumn - R.startColumn;
|
|
1964
|
+
for (let ne = 0; ne < m; ne++) {
|
|
1965
|
+
const Te = c.getTableInfo().columns[T + ne];
|
|
1966
|
+
Te && f.push(Te);
|
|
1967
1967
|
}
|
|
1968
1968
|
w.push({
|
|
1969
1969
|
id: p.id,
|
|
@@ -1977,7 +1977,7 @@ const p = {
|
|
|
1977
1977
|
rowColType: D.Col,
|
|
1978
1978
|
index: h.startColumn,
|
|
1979
1979
|
count: m,
|
|
1980
|
-
columnsJson:
|
|
1980
|
+
columnsJson: f
|
|
1981
1981
|
}
|
|
1982
1982
|
}
|
|
1983
1983
|
}
|
|
@@ -1988,8 +1988,8 @@ const p = {
|
|
|
1988
1988
|
unitId: a,
|
|
1989
1989
|
subUnitId: o,
|
|
1990
1990
|
range: {
|
|
1991
|
-
startRow:
|
|
1992
|
-
endRow:
|
|
1991
|
+
startRow: R.startRow,
|
|
1992
|
+
endRow: R.endRow,
|
|
1993
1993
|
startColumn: h.endColumn + 1,
|
|
1994
1994
|
endColumn: v
|
|
1995
1995
|
}
|
|
@@ -1998,27 +1998,27 @@ const p = {
|
|
|
1998
1998
|
unitId: a,
|
|
1999
1999
|
subUnitId: o,
|
|
2000
2000
|
range: {
|
|
2001
|
-
startRow:
|
|
2002
|
-
endRow:
|
|
2001
|
+
startRow: R.startRow,
|
|
2002
|
+
endRow: R.endRow,
|
|
2003
2003
|
startColumn: h.startColumn,
|
|
2004
2004
|
endColumn: v - m
|
|
2005
2005
|
}
|
|
2006
2006
|
}
|
|
2007
2007
|
);
|
|
2008
2008
|
M && (S.push(...M.redos), w.push(...M.undos));
|
|
2009
|
-
const
|
|
2010
|
-
return B(S,
|
|
2009
|
+
const K = t.get(x);
|
|
2010
|
+
return B(S, K) && t.get(A).pushUndoRedo({
|
|
2011
2011
|
unitID: a,
|
|
2012
2012
|
undoMutations: w,
|
|
2013
2013
|
redoMutations: S
|
|
2014
2014
|
}), !0;
|
|
2015
2015
|
}
|
|
2016
|
-
}
|
|
2016
|
+
};
|
|
2017
2017
|
var Hn = Object.getOwnPropertyDescriptor, Pn = (t, e, n, r) => {
|
|
2018
2018
|
for (var s = r > 1 ? void 0 : r ? Hn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2019
2019
|
(o = t[a]) && (s = o(s) || s);
|
|
2020
2020
|
return s;
|
|
2021
|
-
},
|
|
2021
|
+
}, Ue = (t, e) => (n, r) => e(n, r, t);
|
|
2022
2022
|
let ie = class extends k {
|
|
2023
2023
|
constructor(t, e) {
|
|
2024
2024
|
super(), this._tableManager = t, this._exclusiveRangeService = e, this._initRangeListener();
|
|
@@ -2027,7 +2027,7 @@ let ie = class extends k {
|
|
|
2027
2027
|
this.disposeWithMe(
|
|
2028
2028
|
this._tableManager.tableRangeChanged$.subscribe((t) => {
|
|
2029
2029
|
const { range: e, tableId: n, unitId: r, subUnitId: s } = t;
|
|
2030
|
-
this._exclusiveRangeService.clearExclusiveRangesByGroupId(r, s,
|
|
2030
|
+
this._exclusiveRangeService.clearExclusiveRangesByGroupId(r, s, re, n), this._exclusiveRangeService.addExclusiveRange(r, s, re, [{
|
|
2031
2031
|
range: { ...e },
|
|
2032
2032
|
groupId: n
|
|
2033
2033
|
}]);
|
|
@@ -2035,7 +2035,7 @@ let ie = class extends k {
|
|
|
2035
2035
|
), this.disposeWithMe(
|
|
2036
2036
|
this._tableManager.tableAdd$.subscribe((t) => {
|
|
2037
2037
|
const { tableId: e, unitId: n, subUnitId: r, range: s } = t;
|
|
2038
|
-
this._exclusiveRangeService.addExclusiveRange(n, r,
|
|
2038
|
+
this._exclusiveRangeService.addExclusiveRange(n, r, re, [{
|
|
2039
2039
|
range: { ...s },
|
|
2040
2040
|
groupId: e
|
|
2041
2041
|
}]);
|
|
@@ -2043,14 +2043,14 @@ let ie = class extends k {
|
|
|
2043
2043
|
), this.disposeWithMe(
|
|
2044
2044
|
this._tableManager.tableDelete$.subscribe((t) => {
|
|
2045
2045
|
const { tableId: e, unitId: n, subUnitId: r } = t;
|
|
2046
|
-
this._exclusiveRangeService.clearExclusiveRangesByGroupId(n, r,
|
|
2046
|
+
this._exclusiveRangeService.clearExclusiveRangesByGroupId(n, r, re, e);
|
|
2047
2047
|
})
|
|
2048
2048
|
);
|
|
2049
2049
|
}
|
|
2050
2050
|
};
|
|
2051
2051
|
ie = Pn([
|
|
2052
|
-
|
|
2053
|
-
|
|
2052
|
+
Ue(0, C(_)),
|
|
2053
|
+
Ue(1, C(ct))
|
|
2054
2054
|
], ie);
|
|
2055
2055
|
var Vn = Object.getOwnPropertyDescriptor, qn = (t, e, n, r) => {
|
|
2056
2056
|
for (var s = r > 1 ? void 0 : r ? Vn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
@@ -2067,13 +2067,13 @@ let le = class extends k {
|
|
|
2067
2067
|
getMutations(e) {
|
|
2068
2068
|
const n = { redos: [], undos: [] }, { id: r, params: s } = e;
|
|
2069
2069
|
switch (r) {
|
|
2070
|
-
case
|
|
2070
|
+
case bt.id:
|
|
2071
2071
|
return t._generateTableMutationWithInsertRow(s);
|
|
2072
|
-
case
|
|
2072
|
+
case mt.id:
|
|
2073
2073
|
return t._generateTableMutationWithInsertCol(s);
|
|
2074
|
-
case
|
|
2074
|
+
case gt.id:
|
|
2075
2075
|
return t._generateTableMutationWithRemoveRow(s);
|
|
2076
|
-
case
|
|
2076
|
+
case ht.id:
|
|
2077
2077
|
return t._generateTableMutationWithRemoveCol(s);
|
|
2078
2078
|
}
|
|
2079
2079
|
return n;
|
|
@@ -2181,10 +2181,10 @@ let le = class extends k {
|
|
|
2181
2181
|
const { range: i } = t, h = i.endRow - i.startRow + 1;
|
|
2182
2182
|
return u.forEach((d) => {
|
|
2183
2183
|
const c = d.getRange();
|
|
2184
|
-
if (
|
|
2184
|
+
if (pe.intersects(c, i))
|
|
2185
2185
|
if (i.startRow <= c.startRow && i.endRow >= c.startRow) {
|
|
2186
2186
|
r.push({
|
|
2187
|
-
id:
|
|
2187
|
+
id: te.id,
|
|
2188
2188
|
params: {
|
|
2189
2189
|
unitId: o,
|
|
2190
2190
|
subUnitId: l,
|
|
@@ -2193,7 +2193,7 @@ let le = class extends k {
|
|
|
2193
2193
|
});
|
|
2194
2194
|
const m = d.toJSON();
|
|
2195
2195
|
e.push({
|
|
2196
|
-
id:
|
|
2196
|
+
id: ee.id,
|
|
2197
2197
|
params: {
|
|
2198
2198
|
unitId: o,
|
|
2199
2199
|
subUnitId: l,
|
|
@@ -2274,24 +2274,24 @@ let le = class extends k {
|
|
|
2274
2274
|
const { range: i } = t, h = i.endColumn - i.startColumn + 1;
|
|
2275
2275
|
return u.forEach((d) => {
|
|
2276
2276
|
const c = d.getRange();
|
|
2277
|
-
if (
|
|
2277
|
+
if (pe.intersects(c, i)) {
|
|
2278
2278
|
if (i.startColumn <= c.startColumn && i.endColumn >= c.endColumn) {
|
|
2279
2279
|
r.push({
|
|
2280
|
-
id:
|
|
2280
|
+
id: te.id,
|
|
2281
2281
|
params: {
|
|
2282
2282
|
unitId: o,
|
|
2283
2283
|
subUnitId: l,
|
|
2284
2284
|
tableId: d.getId()
|
|
2285
2285
|
}
|
|
2286
2286
|
});
|
|
2287
|
-
const m = d.toJSON(), { startRow: S, startColumn: w, endColumn:
|
|
2287
|
+
const m = d.toJSON(), { startRow: S, startColumn: w, endColumn: R } = m.range, f = this._univerInstanceService.getUnit(o), T = f == null ? void 0 : f.getSheetBySheetId(l);
|
|
2288
2288
|
if (!T)
|
|
2289
2289
|
return { undos: e, redos: n, preRedos: r, preUndos: s };
|
|
2290
2290
|
const O = [];
|
|
2291
|
-
for (let v = w; v <=
|
|
2292
|
-
O.push(Ye(T == null ? void 0 : T.getCell(S, v)) ||
|
|
2291
|
+
for (let v = w; v <= R; v++)
|
|
2292
|
+
O.push(Ye(T == null ? void 0 : T.getCell(S, v)) || X(v - w + 1, this._localeService.t("sheets-table.columnPrefix")));
|
|
2293
2293
|
e.push({
|
|
2294
|
-
id:
|
|
2294
|
+
id: ee.id,
|
|
2295
2295
|
params: {
|
|
2296
2296
|
unitId: o,
|
|
2297
2297
|
subUnitId: l,
|
|
@@ -2322,8 +2322,8 @@ let le = class extends k {
|
|
|
2322
2322
|
});
|
|
2323
2323
|
const S = [];
|
|
2324
2324
|
for (let w = 0; w < m; w++) {
|
|
2325
|
-
const
|
|
2326
|
-
|
|
2325
|
+
const R = d.getTableColumnByIndex(w);
|
|
2326
|
+
R && S.push(R.toJSON());
|
|
2327
2327
|
}
|
|
2328
2328
|
e.push({
|
|
2329
2329
|
id: p.id,
|
|
@@ -2361,9 +2361,9 @@ let le = class extends k {
|
|
|
2361
2361
|
}
|
|
2362
2362
|
});
|
|
2363
2363
|
const S = [], w = i.startColumn - c.startColumn;
|
|
2364
|
-
for (let
|
|
2365
|
-
const
|
|
2366
|
-
|
|
2364
|
+
for (let R = 0; R < m; R++) {
|
|
2365
|
+
const f = d.getTableColumnByIndex(R + w);
|
|
2366
|
+
f && S.push(f.toJSON());
|
|
2367
2367
|
}
|
|
2368
2368
|
e.push({
|
|
2369
2369
|
id: p.id,
|
|
@@ -2401,8 +2401,8 @@ let le = class extends k {
|
|
|
2401
2401
|
});
|
|
2402
2402
|
const m = [], S = i.startColumn - c.startColumn;
|
|
2403
2403
|
for (let w = 0; w < h; w++) {
|
|
2404
|
-
const
|
|
2405
|
-
|
|
2404
|
+
const R = d.getTableColumnByIndex(w + S);
|
|
2405
|
+
R && m.push(R.toJSON());
|
|
2406
2406
|
}
|
|
2407
2407
|
e.push({
|
|
2408
2408
|
id: p.id,
|
|
@@ -2481,10 +2481,10 @@ let le = class extends k {
|
|
|
2481
2481
|
};
|
|
2482
2482
|
le = qn([
|
|
2483
2483
|
H(0, C(x)),
|
|
2484
|
-
H(1, C(
|
|
2484
|
+
H(1, C(dt)),
|
|
2485
2485
|
H(2, C(W)),
|
|
2486
|
-
H(3, C(
|
|
2487
|
-
H(4, C(
|
|
2486
|
+
H(3, C(Ae)),
|
|
2487
|
+
H(4, C(Ce)),
|
|
2488
2488
|
H(5, C(_)),
|
|
2489
2489
|
H(6, C(de))
|
|
2490
2490
|
], le);
|
|
@@ -2492,72 +2492,81 @@ var Jn = Object.getOwnPropertyDescriptor, kn = (t, e, n, r) => {
|
|
|
2492
2492
|
for (var s = r > 1 ? void 0 : r ? Jn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2493
2493
|
(o = t[a]) && (s = o(s) || s);
|
|
2494
2494
|
return s;
|
|
2495
|
-
},
|
|
2495
|
+
}, se = (t, e) => (n, r) => e(n, r, t);
|
|
2496
2496
|
let ue = class extends k {
|
|
2497
|
-
constructor(
|
|
2498
|
-
super()
|
|
2497
|
+
constructor(e, n, r, s) {
|
|
2498
|
+
super();
|
|
2499
|
+
b(this, "_defaultThemeIndex", 0);
|
|
2500
|
+
b(this, "_allThemes", []);
|
|
2501
|
+
this._tableManager = e, this._sheetRangeThemeService = n, this._sheetRangeThemeModel = r, this._configService = s, this._initUserTableTheme(), this.registerTableChangeEvent(), this._initDefaultTableTheme();
|
|
2499
2502
|
}
|
|
2500
2503
|
registerTableChangeEvent() {
|
|
2501
2504
|
this.disposeWithMe(
|
|
2502
|
-
this._tableManager.tableAdd$.subscribe((
|
|
2503
|
-
const { range:
|
|
2504
|
-
this._sheetRangeThemeService.registerRangeThemeStyle(
|
|
2505
|
-
unitId:
|
|
2506
|
-
subUnitId:
|
|
2507
|
-
range: { ...
|
|
2505
|
+
this._tableManager.tableAdd$.subscribe((e) => {
|
|
2506
|
+
const { range: n, tableId: r, unitId: s, subUnitId: a } = e, o = this._tableManager.getTable(s, r), l = this._allThemes[this._defaultThemeIndex].name;
|
|
2507
|
+
o.setTableStyleId(l), this._sheetRangeThemeService.registerRangeThemeStyle(l, {
|
|
2508
|
+
unitId: s,
|
|
2509
|
+
subUnitId: a,
|
|
2510
|
+
range: { ...n }
|
|
2508
2511
|
});
|
|
2509
2512
|
})
|
|
2510
2513
|
), this.disposeWithMe(
|
|
2511
|
-
this._tableManager.tableRangeChanged$.subscribe((
|
|
2512
|
-
const { range:
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2514
|
+
this._tableManager.tableRangeChanged$.subscribe((e) => {
|
|
2515
|
+
const { range: n, oldRange: r, tableId: s, unitId: a, subUnitId: o } = e, l = this._tableManager.getTable(a, s);
|
|
2516
|
+
let u = l.getTableStyleId();
|
|
2517
|
+
u || (u = this._allThemes[this._defaultThemeIndex].name, l.setTableStyleId(u)), this._sheetRangeThemeService.removeRangeThemeRule(u, {
|
|
2518
|
+
unitId: a,
|
|
2519
|
+
subUnitId: o,
|
|
2520
|
+
range: { ...r }
|
|
2521
|
+
}), this._sheetRangeThemeService.registerRangeThemeStyle(u, {
|
|
2522
|
+
unitId: a,
|
|
2523
|
+
subUnitId: o,
|
|
2516
2524
|
range: { ...n }
|
|
2517
|
-
}), this._sheetRangeThemeService.registerRangeThemeStyle(l, {
|
|
2518
|
-
unitId: s,
|
|
2519
|
-
subUnitId: a,
|
|
2520
|
-
range: { ...e }
|
|
2521
2525
|
});
|
|
2522
2526
|
})
|
|
2523
2527
|
), this.disposeWithMe(
|
|
2524
|
-
this._tableManager.tableThemeChanged$.subscribe((
|
|
2525
|
-
const { theme:
|
|
2526
|
-
this._sheetRangeThemeService.removeRangeThemeRule(
|
|
2527
|
-
unitId:
|
|
2528
|
-
subUnitId:
|
|
2529
|
-
range: { ...
|
|
2530
|
-
}), this._sheetRangeThemeService.registerRangeThemeStyle(
|
|
2531
|
-
unitId:
|
|
2532
|
-
subUnitId:
|
|
2533
|
-
range: { ...
|
|
2528
|
+
this._tableManager.tableThemeChanged$.subscribe((e) => {
|
|
2529
|
+
const { theme: n, oldTheme: r, tableId: s, unitId: a, subUnitId: o } = e, u = this._tableManager.getTable(a, s).getRange();
|
|
2530
|
+
this._sheetRangeThemeService.removeRangeThemeRule(r, {
|
|
2531
|
+
unitId: a,
|
|
2532
|
+
subUnitId: o,
|
|
2533
|
+
range: { ...u }
|
|
2534
|
+
}), this._sheetRangeThemeService.registerRangeThemeStyle(n, {
|
|
2535
|
+
unitId: a,
|
|
2536
|
+
subUnitId: o,
|
|
2537
|
+
range: { ...u }
|
|
2534
2538
|
});
|
|
2535
2539
|
})
|
|
2536
2540
|
), this.disposeWithMe(
|
|
2537
|
-
this._tableManager.tableDelete$.subscribe((
|
|
2538
|
-
const { range:
|
|
2539
|
-
this._sheetRangeThemeService.removeRangeThemeRule(
|
|
2540
|
-
unitId:
|
|
2541
|
-
subUnitId:
|
|
2542
|
-
range: { ...
|
|
2541
|
+
this._tableManager.tableDelete$.subscribe((e) => {
|
|
2542
|
+
const { range: n, unitId: r, subUnitId: s, tableStyleId: a = this._allThemes[this._defaultThemeIndex].name } = e;
|
|
2543
|
+
this._sheetRangeThemeService.removeRangeThemeRule(a, {
|
|
2544
|
+
unitId: r,
|
|
2545
|
+
subUnitId: s,
|
|
2546
|
+
range: { ...n }
|
|
2543
2547
|
});
|
|
2544
2548
|
})
|
|
2545
2549
|
);
|
|
2546
2550
|
}
|
|
2551
|
+
_initUserTableTheme() {
|
|
2552
|
+
const e = this._configService.getConfig(Ge) || {}, n = e.defaultThemeIndex || 0, r = e.userThemes || [];
|
|
2553
|
+
this._defaultThemeIndex = n, this._allThemes = r.concat(je);
|
|
2554
|
+
}
|
|
2547
2555
|
_initDefaultTableTheme() {
|
|
2548
|
-
for (let
|
|
2549
|
-
const { name:
|
|
2550
|
-
this._sheetRangeThemeModel.registerDefaultRangeTheme(
|
|
2556
|
+
for (let e = 0; e < this._allThemes.length; e++) {
|
|
2557
|
+
const { name: n, style: r } = this._allThemes[e], s = new ft(n, r);
|
|
2558
|
+
this._sheetRangeThemeModel.registerDefaultRangeTheme(s);
|
|
2551
2559
|
}
|
|
2552
2560
|
}
|
|
2553
2561
|
dispose() {
|
|
2554
|
-
super.dispose();
|
|
2562
|
+
super.dispose(), this._allThemes = [], this._defaultThemeIndex = 0;
|
|
2555
2563
|
}
|
|
2556
2564
|
};
|
|
2557
2565
|
ue = kn([
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2566
|
+
se(0, C(_)),
|
|
2567
|
+
se(1, C(wt)),
|
|
2568
|
+
se(2, C(He)),
|
|
2569
|
+
se(3, Be)
|
|
2561
2570
|
], ue);
|
|
2562
2571
|
var Qn = Object.getOwnPropertyDescriptor, Yn = (t, e, n, r) => {
|
|
2563
2572
|
for (var s = r > 1 ? void 0 : r ? Qn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
@@ -2592,9 +2601,9 @@ let ce = class extends k {
|
|
|
2592
2601
|
_initFilteredOutRows() {
|
|
2593
2602
|
this._tableManager.tableInitStatus$.pipe(
|
|
2594
2603
|
be((e) => e),
|
|
2595
|
-
|
|
2604
|
+
Me(() => this._univerInstanceService.getCurrentTypeOfUnit$(he.UNIVER_SHEET)),
|
|
2596
2605
|
be((e) => e != null),
|
|
2597
|
-
|
|
2606
|
+
Me((e) => e.activeSheet$),
|
|
2598
2607
|
be((e) => e != null)
|
|
2599
2608
|
).subscribe(() => {
|
|
2600
2609
|
const e = $(this._univerInstanceService);
|
|
@@ -2632,101 +2641,101 @@ let ce = class extends k {
|
|
|
2632
2641
|
};
|
|
2633
2642
|
ce = Yn([
|
|
2634
2643
|
fe(0, C(_)),
|
|
2635
|
-
fe(1, C(
|
|
2644
|
+
fe(1, C(Ce)),
|
|
2636
2645
|
fe(2, C(W))
|
|
2637
2646
|
], ce);
|
|
2638
2647
|
var Gn = Object.getOwnPropertyDescriptor, jn = (t, e, n, r) => {
|
|
2639
2648
|
for (var s = r > 1 ? void 0 : r ? Gn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2640
2649
|
(o = t[a]) && (s = o(s) || s);
|
|
2641
2650
|
return s;
|
|
2642
|
-
},
|
|
2643
|
-
let
|
|
2644
|
-
constructor(t =
|
|
2651
|
+
}, Re = (t, e) => (n, r) => e(n, r, t), ae;
|
|
2652
|
+
let $e = (ae = class extends it {
|
|
2653
|
+
constructor(t = De, e, n, r) {
|
|
2645
2654
|
super(), this._config = t, this._injector = e, this._configService = n, this._commandService = r;
|
|
2646
|
-
const { ...s } =
|
|
2655
|
+
const { ...s } = lt(
|
|
2647
2656
|
{},
|
|
2648
|
-
|
|
2657
|
+
De,
|
|
2649
2658
|
this._config
|
|
2650
2659
|
);
|
|
2651
|
-
this._configService.setConfig(
|
|
2660
|
+
this._configService.setConfig(Ge, s), this._initRegisterCommand();
|
|
2652
2661
|
}
|
|
2653
2662
|
onStarting() {
|
|
2654
|
-
|
|
2663
|
+
ut(this._injector, [
|
|
2655
2664
|
[_],
|
|
2656
2665
|
[ue],
|
|
2657
2666
|
[E],
|
|
2658
|
-
[
|
|
2667
|
+
[j],
|
|
2659
2668
|
[ce],
|
|
2660
2669
|
[ie],
|
|
2661
2670
|
[le]
|
|
2662
|
-
]),
|
|
2671
|
+
]), Ie(this._injector, [
|
|
2663
2672
|
[ie],
|
|
2664
2673
|
[le],
|
|
2665
2674
|
[ue],
|
|
2666
2675
|
[E],
|
|
2667
|
-
[
|
|
2676
|
+
[j],
|
|
2668
2677
|
[ce]
|
|
2669
2678
|
]);
|
|
2670
2679
|
}
|
|
2671
2680
|
onReady() {
|
|
2672
|
-
|
|
2681
|
+
Ie(this._injector, [
|
|
2673
2682
|
[_]
|
|
2674
2683
|
]);
|
|
2675
2684
|
}
|
|
2676
2685
|
_initRegisterCommand() {
|
|
2677
2686
|
[
|
|
2678
|
-
vn,
|
|
2679
|
-
te,
|
|
2680
2687
|
Fn,
|
|
2681
|
-
|
|
2682
|
-
Ce,
|
|
2688
|
+
ee,
|
|
2683
2689
|
Dn,
|
|
2684
|
-
|
|
2690
|
+
te,
|
|
2691
|
+
Se,
|
|
2692
|
+
Nn,
|
|
2693
|
+
An,
|
|
2685
2694
|
p,
|
|
2686
|
-
On,
|
|
2687
2695
|
Un,
|
|
2688
|
-
|
|
2696
|
+
$n,
|
|
2689
2697
|
Bn,
|
|
2690
2698
|
Ln,
|
|
2691
|
-
En
|
|
2699
|
+
En,
|
|
2700
|
+
Wn
|
|
2692
2701
|
].forEach((t) => this._commandService.registerCommand(t));
|
|
2693
2702
|
}
|
|
2694
|
-
}, b(ae, "pluginName",
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
],
|
|
2703
|
+
}, b(ae, "pluginName", Xe), b(ae, "type", he.UNIVER_SHEET), ae);
|
|
2704
|
+
$e = jn([
|
|
2705
|
+
Re(1, C(Ae)),
|
|
2706
|
+
Re(2, Be),
|
|
2707
|
+
Re(3, C(x))
|
|
2708
|
+
], $e);
|
|
2700
2709
|
export {
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2710
|
+
Fn as AddSheetTableCommand,
|
|
2711
|
+
ee as AddSheetTableMutation,
|
|
2712
|
+
Un as AddTableThemeCommand,
|
|
2713
|
+
Dn as DeleteSheetTableCommand,
|
|
2714
|
+
te as DeleteSheetTableMutation,
|
|
2715
|
+
$n as RemoveTableThemeCommand,
|
|
2716
|
+
yn as SHEET_TABLE_CUSTOM_THEME_PREFIX,
|
|
2717
|
+
An as SetSheetTableCommand,
|
|
2718
|
+
Nn as SetSheetTableFilterCommand,
|
|
2719
|
+
Se as SetSheetTableFilterMutation,
|
|
2711
2720
|
p as SetSheetTableMutation,
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2721
|
+
Ln as SheetTableInsertColCommand,
|
|
2722
|
+
Bn as SheetTableInsertRowCommand,
|
|
2723
|
+
Wn as SheetTableRemoveColCommand,
|
|
2724
|
+
En as SheetTableRemoveRowCommand,
|
|
2725
|
+
j as SheetTableService,
|
|
2717
2726
|
V as SheetsTableButtonStateEnum,
|
|
2718
2727
|
E as SheetsTableController,
|
|
2719
|
-
|
|
2728
|
+
Y as SheetsTableSortStateEnum,
|
|
2720
2729
|
Qe as TableColumnDataTypeEnum,
|
|
2721
|
-
|
|
2730
|
+
Z as TableColumnFilterTypeEnum,
|
|
2722
2731
|
U as TableConditionTypeEnum,
|
|
2723
2732
|
g as TableDateCompareTypeEnum,
|
|
2724
2733
|
_ as TableManager,
|
|
2725
2734
|
F as TableNumberCompareTypeEnum,
|
|
2726
2735
|
P as TableStringCompareTypeEnum,
|
|
2727
|
-
|
|
2736
|
+
$e as UniverSheetsTablePlugin,
|
|
2728
2737
|
nr as customEmptyThemeWithBorderStyle,
|
|
2729
|
-
|
|
2738
|
+
St as isConditionFilter,
|
|
2730
2739
|
tr as isManualFilter,
|
|
2731
2740
|
rr as processStyleWithBorderStyle
|
|
2732
2741
|
};
|