@univerjs/sheets-table 0.13.0 → 0.14.0-insiders.20251227-b250a8d
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 +430 -406
- package/lib/index.js +430 -406
- package/lib/types/util.d.ts +11 -1
- package/lib/umd/index.js +1 -1
- package/package.json +7 -7
- package/LICENSE +0 -176
package/lib/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var b = (t, e, n) =>
|
|
4
|
-
import { CellValueType as J, BorderStyleTypes as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
var M = /* @__PURE__ */ ((t) => (t.Insert = "insert", t.Delete = "delete", t))(M || {}),
|
|
1
|
+
var ot = Object.defineProperty;
|
|
2
|
+
var it = (t, e, n) => e in t ? ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var b = (t, e, n) => it(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CellValueType as J, UniverInstanceType as j, BorderStyleTypes as lt, createREGEXFromWildChar as Z, generateRandomId as B, IUniverInstanceService as A, Inject as C, LocaleService as be, Disposable as H, CommandType as y, IUndoRedoService as L, ICommandService as D, customNameCharacterCheck as Be, sequenceExecute as E, ILogService as We, IResourceManagerService as ut, Rectangle as _e, RTree as ct, InterceptorEffectEnum as dt, Injector as He, IConfigService as Ve, Plugin as ht, merge as gt, registerDependencies as mt, touchDependencies as Me } from "@univerjs/core";
|
|
5
|
+
import { IDefinedNamesService as Pe, RemoveSuperTableMutation as ve, SetSuperTableMutation as bt } from "@univerjs/engine-formula";
|
|
6
|
+
import { getSheetCommandTarget as $, SheetInterceptorService as Re, INTERCEPTOR_POINT as qe, RemoveSheetCommand as wt, CopySheetCommand as ft, AddRangeThemeMutation as Je, RemoveRangeThemeMutation as ke, SheetRangeThemeModel as Qe, SheetsSelectionsService as we, InsertRowMutation as Ye, RemoveRowMutation as Ge, getMoveRangeUndoRedoMutations as fe, InsertColMutation as je, RemoveColMutation as ze, IExclusiveRangeService as pt, RefRangeService as St, RemoveColCommand as _t, RemoveRowCommand as Ct, InsertColCommand as Rt, InsertRowCommand as Tt, SheetRangeThemeService as It, RangeThemeStyle as Mt, ZebraCrossingCacheController as vt } from "@univerjs/sheets";
|
|
7
|
+
import { Subject as Y, BehaviorSubject as Ke, filter as pe, switchMap as Fe } from "rxjs";
|
|
8
|
+
var M = /* @__PURE__ */ ((t) => (t.Insert = "insert", t.Delete = "delete", t))(M || {}), N = /* @__PURE__ */ ((t) => (t.Row = "row", t.Col = "column", t))(N || {}), Xe = /* @__PURE__ */ ((t) => (t.None = "none", t.String = "string", t.Number = "number", t.Date = "date", t.Bool = "bool", t.Checkbox = "checkbox", t.List = "list", t))(Xe || {}), ne = /* @__PURE__ */ ((t) => (t.manual = "manual", t.condition = "condition", t))(ne || {}), 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 || {}), m = /* @__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))(m || {}), q = /* @__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))(q || {}), G = /* @__PURE__ */ ((t) => (t.Asc = "asc", t.Desc = "desc", t.None = "none", t))(G || {});
|
|
9
9
|
function te(t, e) {
|
|
10
10
|
return `${e} ${t}`;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const Ne = "TRUE", ye = "FALSE", Ft = (t) => {
|
|
13
13
|
var n;
|
|
14
14
|
return ((n = t.body) == null ? void 0 : n.dataStream.replace(/\r\n$/, "")) || "";
|
|
15
15
|
};
|
|
16
|
-
function
|
|
16
|
+
function Ze(t) {
|
|
17
17
|
if (t) {
|
|
18
18
|
const { v: e, t: n, p: s } = t;
|
|
19
|
-
return s ?
|
|
19
|
+
return s ? Ft(s) : (n === J.FORCE_STRING || n === J.STRING) && e !== void 0 && e !== null ? String(e) : n === J.BOOLEAN ? e ? Ne : ye : n === J.NUMBER ? String(e) : typeof e === "boolean" ? e ? Ne : ye : e == null ? "" : String(e);
|
|
20
20
|
}
|
|
21
21
|
return "";
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Nt(t, e) {
|
|
24
24
|
if (t != null)
|
|
25
25
|
switch (e) {
|
|
26
26
|
case G.Asc:
|
|
@@ -40,18 +40,32 @@ function vt(t, e) {
|
|
|
40
40
|
return q.FilterNoneSortNone;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function yt(t) {
|
|
44
44
|
return t ? t.filterType === ne.condition : !1;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function gs(t) {
|
|
47
47
|
return t ? t.filterType === ne.manual : !1;
|
|
48
48
|
}
|
|
49
|
+
function et(t, e) {
|
|
50
|
+
const { univerInstanceService: n, tableManager: s, definedNamesService: r } = e, a = /* @__PURE__ */ new Set(), o = n == null ? void 0 : n.getUnit(t, j.UNIVER_SHEET);
|
|
51
|
+
o && o.getSheets().forEach((i) => {
|
|
52
|
+
a.add(i.getName().toLowerCase());
|
|
53
|
+
});
|
|
54
|
+
const u = s == null ? void 0 : s.getTableList(t);
|
|
55
|
+
u && u.length > 0 && u.forEach((i) => {
|
|
56
|
+
a.add(i.name.toLowerCase());
|
|
57
|
+
});
|
|
58
|
+
const l = r == null ? void 0 : r.getDefinedNameMap(t);
|
|
59
|
+
return l && Object.values(l).forEach((i) => {
|
|
60
|
+
a.add(i.name.toLowerCase());
|
|
61
|
+
}), a;
|
|
62
|
+
}
|
|
49
63
|
const x = {
|
|
50
|
-
s:
|
|
64
|
+
s: lt.THIN,
|
|
51
65
|
cl: {
|
|
52
66
|
rgb: "rgb(95, 101, 116)"
|
|
53
67
|
}
|
|
54
|
-
},
|
|
68
|
+
}, tt = "sheets-table.config", De = {}, ms = {
|
|
55
69
|
headerRowStyle: {
|
|
56
70
|
bd: {
|
|
57
71
|
t: x
|
|
@@ -72,7 +86,7 @@ const x = {
|
|
|
72
86
|
b: x
|
|
73
87
|
}
|
|
74
88
|
}
|
|
75
|
-
},
|
|
89
|
+
}, bs = (t, e) => {
|
|
76
90
|
if (t === "headerRowStyle") {
|
|
77
91
|
if (!e.bd)
|
|
78
92
|
return {
|
|
@@ -105,14 +119,14 @@ const x = {
|
|
|
105
119
|
}
|
|
106
120
|
};
|
|
107
121
|
return e;
|
|
108
|
-
},
|
|
122
|
+
}, Dt = [
|
|
109
123
|
[["#6280F9", "#FFFFFF", "#BAC6F8", "#D2DAFA"], ["#fff"]],
|
|
110
124
|
[["#16BDCA", "#FFFFFF", "#EDFAFA", "#AFECEF"], ["#000"]],
|
|
111
125
|
[["#31C48D", "#FFFFFF", "#F3FAF7", "#BCF0DA"], ["#fff"]],
|
|
112
126
|
[["#AC94FA", "#FFFFFF", "#F6F5FF", "#EDEBFE"], ["#fff"]],
|
|
113
127
|
[["#F17EBB", "#FFFFFF", "#FDF2F8", "#FCE8F3"], ["#fff"]],
|
|
114
128
|
[["#F98080", "#FFFFFF", "#FDF2F2", "#FDE8E8"], ["#fff"]]
|
|
115
|
-
],
|
|
129
|
+
], nt = Dt.map((t, e) => {
|
|
116
130
|
const [n, s] = t, [r, a, o, u] = n, [l] = s;
|
|
117
131
|
return {
|
|
118
132
|
name: `table-default-${e}`,
|
|
@@ -159,7 +173,7 @@ const x = {
|
|
|
159
173
|
}
|
|
160
174
|
};
|
|
161
175
|
});
|
|
162
|
-
class
|
|
176
|
+
class z {
|
|
163
177
|
constructor(e, n) {
|
|
164
178
|
b(this, "dataType");
|
|
165
179
|
b(this, "id");
|
|
@@ -167,7 +181,7 @@ class j {
|
|
|
167
181
|
b(this, "formula");
|
|
168
182
|
b(this, "meta");
|
|
169
183
|
b(this, "style");
|
|
170
|
-
this.id = e, this.displayName = n, this.dataType =
|
|
184
|
+
this.id = e, this.displayName = n, this.dataType = Xe.String, this.formula = "", this.meta = {}, this.style = {};
|
|
171
185
|
}
|
|
172
186
|
getMeta() {
|
|
173
187
|
return this.meta;
|
|
@@ -192,45 +206,45 @@ class j {
|
|
|
192
206
|
this.id = e.id, this.displayName = e.displayName, this.dataType = e.dataType, this.formula = e.formula, this.meta = e.meta, this.style = e.style;
|
|
193
207
|
}
|
|
194
208
|
}
|
|
195
|
-
const
|
|
209
|
+
const xt = (t) => t.getMonth() <= 2, Ot = (t) => {
|
|
196
210
|
const e = t.getMonth();
|
|
197
211
|
return e > 2 && e <= 5;
|
|
198
|
-
},
|
|
212
|
+
}, Ut = (t) => {
|
|
199
213
|
const e = t.getMonth();
|
|
200
214
|
return e > 5 && e <= 8;
|
|
201
|
-
},
|
|
215
|
+
}, $t = (t) => {
|
|
202
216
|
const e = t.getMonth();
|
|
203
217
|
return e > 8 && e <= 11;
|
|
204
|
-
},
|
|
218
|
+
}, At = (t) => t.getMonth() === 0, Lt = (t) => t.getMonth() === 1, Et = (t) => t.getMonth() === 2, Bt = (t) => t.getMonth() === 3, Wt = (t) => t.getMonth() === 4, Ht = (t) => t.getMonth() === 5, Vt = (t) => t.getMonth() === 6, Pt = (t) => t.getMonth() === 7, qt = (t) => t.getMonth() === 8, Jt = (t) => t.getMonth() === 9, kt = (t) => t.getMonth() === 10, Qt = (t) => t.getMonth() === 11, Yt = (t, e = /* @__PURE__ */ new Date()) => t.toDateString() === e.toDateString(), Gt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
205
219
|
const n = new Date(e);
|
|
206
220
|
return n.setDate(n.getDate() + 1), t.toDateString() === n.toDateString();
|
|
207
|
-
},
|
|
221
|
+
}, jt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
208
222
|
const n = new Date(e);
|
|
209
223
|
return n.setDate(n.getDate() - 1), t.toDateString() === n.toDateString();
|
|
210
224
|
}, K = (t) => {
|
|
211
225
|
const e = t.getDay(), n = t.getDate() - e + (e === 0 ? -6 : 1), s = new Date(t);
|
|
212
226
|
return s.setDate(n), s;
|
|
213
|
-
},
|
|
227
|
+
}, st = 10080 * 60 * 1e3, zt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
214
228
|
const n = K(t), s = K(e);
|
|
215
229
|
return n.toDateString() === s.toDateString();
|
|
216
|
-
},
|
|
217
|
-
const n = K(t), s = new Date(K(e).getTime() +
|
|
230
|
+
}, Kt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
231
|
+
const n = K(t), s = new Date(K(e).getTime() + st);
|
|
218
232
|
return n.toDateString() === s.toDateString();
|
|
219
|
-
},
|
|
220
|
-
const n = K(t), s = new Date(K(e).getTime() -
|
|
233
|
+
}, Xt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
234
|
+
const n = K(t), s = new Date(K(e).getTime() - st);
|
|
221
235
|
return n.toDateString() === s.toDateString();
|
|
222
|
-
},
|
|
236
|
+
}, Zt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth(), en = (t) => {
|
|
223
237
|
const e = new Date(t);
|
|
224
238
|
return e.setHours(0, 0, 0, 0), e.setDate(1), e;
|
|
225
|
-
},
|
|
239
|
+
}, tn = (t, e = /* @__PURE__ */ new Date()) => {
|
|
226
240
|
const n = new Date(e);
|
|
227
241
|
n.setHours(0, 0, 0, 0), n.setMonth(n.getMonth() + 1, 1);
|
|
228
242
|
const s = new Date(n);
|
|
229
243
|
s.setMonth(s.getMonth() + 1, 0);
|
|
230
244
|
const r = t.getTime();
|
|
231
245
|
return r >= n.getTime() && r < s.getTime();
|
|
232
|
-
},
|
|
233
|
-
const n =
|
|
246
|
+
}, nn = (t, e = /* @__PURE__ */ new Date()) => {
|
|
247
|
+
const n = en(e), s = new Date(n);
|
|
234
248
|
s.setMonth(s.getMonth() + 1, 0);
|
|
235
249
|
const r = t.getTime();
|
|
236
250
|
return r >= n.getTime() && r < s.getTime();
|
|
@@ -239,32 +253,32 @@ const Nt = (t) => t.getMonth() <= 2, Dt = (t) => {
|
|
|
239
253
|
e.setHours(0, 0, 0, 0), e.setDate(1);
|
|
240
254
|
const n = e.getMonth();
|
|
241
255
|
return e.setMonth(n - n % 3), e;
|
|
242
|
-
},
|
|
256
|
+
}, sn = (t, e = /* @__PURE__ */ new Date()) => {
|
|
243
257
|
const n = Te(e), s = new Date(n);
|
|
244
258
|
s.setMonth(s.getMonth() + 3);
|
|
245
259
|
const r = t.getTime();
|
|
246
260
|
return r >= n.getTime() && r < s.getTime();
|
|
247
|
-
},
|
|
261
|
+
}, rn = (t, e = /* @__PURE__ */ new Date()) => {
|
|
248
262
|
const n = Te(e), s = new Date(n);
|
|
249
263
|
s.setMonth(s.getMonth() + 3);
|
|
250
264
|
const r = new Date(s);
|
|
251
265
|
r.setMonth(r.getMonth() + 3, 0);
|
|
252
266
|
const a = t.getTime();
|
|
253
267
|
return a >= s.getTime() && a < r.getTime();
|
|
254
|
-
},
|
|
268
|
+
}, an = (t, e = /* @__PURE__ */ new Date()) => {
|
|
255
269
|
const n = Te(e), s = new Date(n);
|
|
256
270
|
s.setMonth(s.getMonth() - 3);
|
|
257
271
|
const r = new Date(n);
|
|
258
272
|
r.setDate(0);
|
|
259
273
|
const a = t.getTime();
|
|
260
274
|
return a >= s.getTime() && a < r.getTime();
|
|
261
|
-
},
|
|
275
|
+
}, on = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear(), ln = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() + 1, un = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() - 1, cn = (t, e = /* @__PURE__ */ new Date()) => {
|
|
262
276
|
const n = new Date(e);
|
|
263
277
|
n.setHours(0, 0, 0, 0), n.setMonth(0, 1);
|
|
264
278
|
const s = t.getTime();
|
|
265
279
|
return s >= n.getTime() && s < e.getTime();
|
|
266
280
|
};
|
|
267
|
-
function
|
|
281
|
+
function dn(t) {
|
|
268
282
|
switch (t.compareType) {
|
|
269
283
|
case m.Equal: {
|
|
270
284
|
const e = new Date(t.expectedValue);
|
|
@@ -302,105 +316,105 @@ function un(t) {
|
|
|
302
316
|
};
|
|
303
317
|
case m.Today: {
|
|
304
318
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
305
|
-
return (n) =>
|
|
319
|
+
return (n) => Yt(n, e);
|
|
306
320
|
}
|
|
307
321
|
case m.Yesterday: {
|
|
308
322
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
309
|
-
return (n) =>
|
|
323
|
+
return (n) => jt(n, e);
|
|
310
324
|
}
|
|
311
325
|
case m.Tomorrow: {
|
|
312
326
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
313
|
-
return (n) =>
|
|
327
|
+
return (n) => Gt(n, e);
|
|
314
328
|
}
|
|
315
329
|
case m.ThisWeek: {
|
|
316
330
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
317
|
-
return (n) =>
|
|
331
|
+
return (n) => zt(n, e);
|
|
318
332
|
}
|
|
319
333
|
case m.LastWeek: {
|
|
320
334
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
321
|
-
return (n) =>
|
|
335
|
+
return (n) => Xt(n, e);
|
|
322
336
|
}
|
|
323
337
|
case m.NextWeek: {
|
|
324
338
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
325
|
-
return (n) =>
|
|
339
|
+
return (n) => Kt(n, e);
|
|
326
340
|
}
|
|
327
341
|
case m.ThisMonth: {
|
|
328
342
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
329
|
-
return (n) =>
|
|
343
|
+
return (n) => Zt(n, e);
|
|
330
344
|
}
|
|
331
345
|
case m.LastMonth: {
|
|
332
346
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
333
|
-
return (n) =>
|
|
347
|
+
return (n) => nn(n, e);
|
|
334
348
|
}
|
|
335
349
|
case m.NextMonth: {
|
|
336
350
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
337
|
-
return (n) =>
|
|
351
|
+
return (n) => tn(n, e);
|
|
338
352
|
}
|
|
339
353
|
case m.ThisQuarter: {
|
|
340
354
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
341
|
-
return (n) =>
|
|
355
|
+
return (n) => sn(n, e);
|
|
342
356
|
}
|
|
343
357
|
case m.LastQuarter: {
|
|
344
358
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
345
|
-
return (n) =>
|
|
359
|
+
return (n) => an(n, e);
|
|
346
360
|
}
|
|
347
361
|
case m.NextQuarter: {
|
|
348
362
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
349
|
-
return (n) =>
|
|
363
|
+
return (n) => rn(n, e);
|
|
350
364
|
}
|
|
351
365
|
case m.ThisYear: {
|
|
352
366
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
353
|
-
return (n) =>
|
|
367
|
+
return (n) => on(n, e);
|
|
354
368
|
}
|
|
355
369
|
case m.LastYear: {
|
|
356
370
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
357
|
-
return (n) =>
|
|
371
|
+
return (n) => un(n, e);
|
|
358
372
|
}
|
|
359
373
|
case m.NextYear: {
|
|
360
374
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
361
|
-
return (n) =>
|
|
375
|
+
return (n) => ln(n, e);
|
|
362
376
|
}
|
|
363
377
|
case m.YearToDate: {
|
|
364
378
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
365
|
-
return (n) =>
|
|
379
|
+
return (n) => cn(n, e);
|
|
366
380
|
}
|
|
367
381
|
case m.M1:
|
|
368
|
-
return
|
|
382
|
+
return At;
|
|
369
383
|
case m.M2:
|
|
370
|
-
return
|
|
384
|
+
return Lt;
|
|
371
385
|
case m.M3:
|
|
372
|
-
return
|
|
386
|
+
return Et;
|
|
373
387
|
case m.M4:
|
|
374
388
|
return Bt;
|
|
375
389
|
case m.M5:
|
|
376
|
-
return
|
|
390
|
+
return Wt;
|
|
377
391
|
case m.M6:
|
|
378
|
-
return
|
|
392
|
+
return Ht;
|
|
379
393
|
case m.M7:
|
|
380
|
-
return
|
|
394
|
+
return Vt;
|
|
381
395
|
case m.M8:
|
|
382
|
-
return
|
|
396
|
+
return Pt;
|
|
383
397
|
case m.M9:
|
|
384
|
-
return
|
|
398
|
+
return qt;
|
|
385
399
|
case m.M10:
|
|
386
|
-
return
|
|
400
|
+
return Jt;
|
|
387
401
|
case m.M11:
|
|
388
|
-
return
|
|
402
|
+
return kt;
|
|
389
403
|
case m.M12:
|
|
390
|
-
return
|
|
404
|
+
return Qt;
|
|
391
405
|
case m.Q1:
|
|
392
|
-
return
|
|
406
|
+
return xt;
|
|
393
407
|
case m.Q2:
|
|
394
|
-
return
|
|
408
|
+
return Ot;
|
|
395
409
|
case m.Q3:
|
|
396
|
-
return
|
|
410
|
+
return Ut;
|
|
397
411
|
case m.Q4:
|
|
398
|
-
return
|
|
412
|
+
return $t;
|
|
399
413
|
default:
|
|
400
414
|
throw new Error("Unsupported compare type");
|
|
401
415
|
}
|
|
402
416
|
}
|
|
403
|
-
class
|
|
417
|
+
class hn {
|
|
404
418
|
/**
|
|
405
419
|
* Initializes a new instance of the Heap class.
|
|
406
420
|
*/
|
|
@@ -464,7 +478,7 @@ class cn {
|
|
|
464
478
|
return this.heap.includes(e);
|
|
465
479
|
}
|
|
466
480
|
}
|
|
467
|
-
class
|
|
481
|
+
class gn extends hn {
|
|
468
482
|
/**
|
|
469
483
|
* Initializes a new instance of the MinHeap class.
|
|
470
484
|
*/
|
|
@@ -503,13 +517,13 @@ class dn extends cn {
|
|
|
503
517
|
this.heap[0] = this.heap.pop(), this.shiftDown(0);
|
|
504
518
|
}
|
|
505
519
|
}
|
|
506
|
-
const
|
|
507
|
-
const n = new
|
|
520
|
+
const mn = (t, e) => {
|
|
521
|
+
const n = new gn();
|
|
508
522
|
for (const s of t)
|
|
509
523
|
n.insert(s), n.size() > e && n.pop();
|
|
510
524
|
return n.heap;
|
|
511
|
-
},
|
|
512
|
-
function
|
|
525
|
+
}, bn = (t, e) => t > e, wn = (t, e) => t < e, fn = (t, e, n) => mn(t, e).includes(n);
|
|
526
|
+
function pn(t, e) {
|
|
513
527
|
switch (t.compareType) {
|
|
514
528
|
case F.Equal: {
|
|
515
529
|
const n = Number(t.expectedValue);
|
|
@@ -545,84 +559,84 @@ function wn(t, e) {
|
|
|
545
559
|
}
|
|
546
560
|
case F.Above: {
|
|
547
561
|
const n = e.average;
|
|
548
|
-
return (s) =>
|
|
562
|
+
return (s) => bn(s, n);
|
|
549
563
|
}
|
|
550
564
|
case F.Below: {
|
|
551
565
|
const n = e.average;
|
|
552
|
-
return (s) =>
|
|
566
|
+
return (s) => wn(s, n);
|
|
553
567
|
}
|
|
554
568
|
case F.TopN: {
|
|
555
569
|
const n = e.list, s = Number(t.expectedValue);
|
|
556
|
-
return (r) =>
|
|
570
|
+
return (r) => fn(n, s, r);
|
|
557
571
|
}
|
|
558
572
|
}
|
|
559
573
|
}
|
|
560
|
-
const
|
|
561
|
-
function
|
|
574
|
+
const Sn = (t, e) => Z(e).test(t), _n = (t, e) => !Z(e).test(t), Cn = (t, e) => Z(`*${e}*`).test(t), Rn = (t, e) => !Z(`*${e}*`).test(t), Tn = (t, e) => Z(`${e}*`).test(t), In = (t, e) => Z(`*${e}`).test(t);
|
|
575
|
+
function Mn(t) {
|
|
562
576
|
switch (t.compareType) {
|
|
563
577
|
case P.Equal:
|
|
564
|
-
return (e) =>
|
|
578
|
+
return (e) => Sn(e, t.expectedValue);
|
|
565
579
|
case P.NotEqual:
|
|
566
|
-
return (e) =>
|
|
580
|
+
return (e) => _n(e, t.expectedValue);
|
|
567
581
|
case P.Contains:
|
|
568
|
-
return (e) =>
|
|
582
|
+
return (e) => Cn(e, t.expectedValue);
|
|
569
583
|
case P.NotContains:
|
|
570
|
-
return (e) => _n(e, t.expectedValue);
|
|
571
|
-
case P.StartsWith:
|
|
572
584
|
return (e) => Rn(e, t.expectedValue);
|
|
585
|
+
case P.StartsWith:
|
|
586
|
+
return (e) => Tn(e, t.expectedValue);
|
|
573
587
|
case P.EndsWith:
|
|
574
|
-
return (e) =>
|
|
588
|
+
return (e) => In(e, t.expectedValue);
|
|
575
589
|
default:
|
|
576
590
|
return console.error(`Unknown filter operator: ${t.compareType}`), (e) => !0;
|
|
577
591
|
}
|
|
578
592
|
}
|
|
579
|
-
const
|
|
593
|
+
const vn = /* @__PURE__ */ new Set([
|
|
580
594
|
F.Above,
|
|
581
595
|
F.Below,
|
|
582
596
|
F.TopN
|
|
583
597
|
]);
|
|
584
598
|
m.Today, m.Yesterday, m.Tomorrow, m.ThisWeek, m.LastWeek, m.NextWeek, m.ThisMonth, m.LastMonth, m.NextMonth, m.ThisQuarter, m.LastQuarter, m.NextQuarter, m.NextYear, m.ThisYear, m.LastYear, m.YearToDate;
|
|
585
|
-
function
|
|
586
|
-
return
|
|
599
|
+
function rt(t) {
|
|
600
|
+
return vn.has(t);
|
|
587
601
|
}
|
|
588
|
-
function
|
|
589
|
-
if (
|
|
602
|
+
function Fn(t, e) {
|
|
603
|
+
if (rt(t.filterInfo.compareType))
|
|
590
604
|
return (n) => !0;
|
|
591
605
|
switch (t.filterInfo.conditionType) {
|
|
592
|
-
case
|
|
593
|
-
return
|
|
594
|
-
case
|
|
595
|
-
return
|
|
596
|
-
case
|
|
597
|
-
return
|
|
598
|
-
case
|
|
606
|
+
case U.Date:
|
|
607
|
+
return dn(t.filterInfo);
|
|
608
|
+
case U.Number:
|
|
609
|
+
return pn(t.filterInfo, e);
|
|
610
|
+
case U.String:
|
|
611
|
+
return Mn(t.filterInfo);
|
|
612
|
+
case U.Logic:
|
|
599
613
|
default:
|
|
600
614
|
return (n) => !0;
|
|
601
615
|
}
|
|
602
616
|
}
|
|
603
617
|
function ue(t, e, n, s) {
|
|
604
618
|
switch (s) {
|
|
605
|
-
case
|
|
619
|
+
case U.Date: {
|
|
606
620
|
const r = xe(t, e, n);
|
|
607
|
-
return r ?
|
|
621
|
+
return r ? Dn(r) : null;
|
|
608
622
|
}
|
|
609
|
-
case
|
|
623
|
+
case U.Number:
|
|
610
624
|
return xe(t, e, n);
|
|
611
|
-
case
|
|
625
|
+
case U.String:
|
|
612
626
|
default:
|
|
613
|
-
return
|
|
627
|
+
return yn(t, e, n);
|
|
614
628
|
}
|
|
615
629
|
}
|
|
616
|
-
const
|
|
630
|
+
const Nn = (t) => {
|
|
617
631
|
var n;
|
|
618
632
|
return ((n = t.body) == null ? void 0 : n.dataStream.replace(/\r\n$/, "")) || "";
|
|
619
633
|
};
|
|
620
|
-
function
|
|
634
|
+
function yn(t, e, n) {
|
|
621
635
|
const s = t.getCell(e, n);
|
|
622
636
|
if (!s) return null;
|
|
623
637
|
const { v: r, t: a, p: o } = s;
|
|
624
638
|
if (o)
|
|
625
|
-
return
|
|
639
|
+
return Nn(o);
|
|
626
640
|
if (typeof r == "string")
|
|
627
641
|
return a === J.BOOLEAN ? r.toUpperCase() : r;
|
|
628
642
|
if (typeof r == "number")
|
|
@@ -637,7 +651,7 @@ function xe(t, e, n) {
|
|
|
637
651
|
const { v: r, t: a, p: o } = s;
|
|
638
652
|
return o ? null : typeof r == "string" && a === J.NUMBER ? Number(t.getCellRaw(e, n).v) : Number(r);
|
|
639
653
|
}
|
|
640
|
-
function
|
|
654
|
+
function Dn(t) {
|
|
641
655
|
const e = new Date(Date.UTC(1900, 0, 1, 0, 0, 0)), n = new Date(Date.UTC(1900, 1, 28, 0, 0, 0));
|
|
642
656
|
let s = t - 1;
|
|
643
657
|
return s > (n.getTime() - e.getTime()) / (1e3 * 3600 * 24) && (s -= 1), s < 0 && (s = t), new Date(e.getTime() + s * (1e3 * 3600 * 24));
|
|
@@ -661,7 +675,7 @@ class Oe {
|
|
|
661
675
|
getFilterState(e) {
|
|
662
676
|
var s;
|
|
663
677
|
const n = ((s = this._tableSortInfo) == null ? void 0 : s.columnIndex) === e ? this._tableSortInfo.sortState : G.None;
|
|
664
|
-
return
|
|
678
|
+
return Nt(this._tableColumnFilterList[e], n);
|
|
665
679
|
}
|
|
666
680
|
getSortState() {
|
|
667
681
|
var e;
|
|
@@ -687,7 +701,7 @@ class Oe {
|
|
|
687
701
|
if (a && e) {
|
|
688
702
|
const { startRow: o, endRow: u, startColumn: l } = n, i = l + s, h = this.getExecuteFunc(e, n, s, a);
|
|
689
703
|
for (let d = o; d <= u; d++) {
|
|
690
|
-
const c =
|
|
704
|
+
const c = yt(a) ? a.filterInfo.conditionType : U.String;
|
|
691
705
|
ue(e, d, i, c) === null ? r.add(d) : h(ue(e, d, i, c)) || r.add(d);
|
|
692
706
|
}
|
|
693
707
|
}
|
|
@@ -696,7 +710,7 @@ class Oe {
|
|
|
696
710
|
const { startRow: r, endRow: a, startColumn: o } = n, u = o + s, l = [];
|
|
697
711
|
let i = 0, h = 0;
|
|
698
712
|
for (let d = r; d <= a; d++) {
|
|
699
|
-
const c = ue(e, d, u,
|
|
713
|
+
const c = ue(e, d, u, U.Number);
|
|
700
714
|
c !== null && (l.push(c), i++, h += c);
|
|
701
715
|
}
|
|
702
716
|
return {
|
|
@@ -709,8 +723,8 @@ class Oe {
|
|
|
709
723
|
const a = new Set(r.values);
|
|
710
724
|
return (o) => a.has(o);
|
|
711
725
|
} else if (r.filterType === ne.condition) {
|
|
712
|
-
const o =
|
|
713
|
-
return
|
|
726
|
+
const o = rt(r.filterInfo.compareType) ? this._getNumberCalculatedOptions(e, n, s) : void 0;
|
|
727
|
+
return Fn(r, o);
|
|
714
728
|
} else
|
|
715
729
|
return (a) => !0;
|
|
716
730
|
}
|
|
@@ -753,8 +767,8 @@ class Ue {
|
|
|
753
767
|
for (let l = r; l <= a; l++) {
|
|
754
768
|
const i = l - r;
|
|
755
769
|
let h, d;
|
|
756
|
-
(u = n.columns) != null && u[i] ? (h = n.columns[i].id, d = n.columns[i].displayName) : (h =
|
|
757
|
-
const c = new
|
|
770
|
+
(u = n.columns) != null && u[i] ? (h = n.columns[i].id, d = n.columns[i].displayName) : (h = B(), d = e[l - r]);
|
|
771
|
+
const c = new z(h, d);
|
|
758
772
|
this._columns.set(h, c), this._columnOrder.push(h);
|
|
759
773
|
}
|
|
760
774
|
n.filters && n.filters.forEach((i, h) => {
|
|
@@ -781,7 +795,7 @@ class Ue {
|
|
|
781
795
|
}
|
|
782
796
|
setColumns(e) {
|
|
783
797
|
this._columns.clear(), this._columnOrder = [], e.forEach((n) => {
|
|
784
|
-
const s = new
|
|
798
|
+
const s = new z(n.id, n.displayName);
|
|
785
799
|
s.fromJSON(n), this._columns.set(n.id, s), this._columnOrder.push(n.id);
|
|
786
800
|
});
|
|
787
801
|
}
|
|
@@ -842,7 +856,7 @@ class Ue {
|
|
|
842
856
|
}
|
|
843
857
|
getTableStyleId() {
|
|
844
858
|
var e;
|
|
845
|
-
return (e = this._tableStyleId) != null ? e :
|
|
859
|
+
return (e = this._tableStyleId) != null ? e : nt[0].name;
|
|
846
860
|
}
|
|
847
861
|
setTableStyleId(e) {
|
|
848
862
|
this._tableStyleId = e;
|
|
@@ -905,7 +919,7 @@ class Ue {
|
|
|
905
919
|
fromJSON(e) {
|
|
906
920
|
var s, r;
|
|
907
921
|
this._id = e.id, this._name = e.name, this._range = e.range, this.tableMeta = e.meta, this._tableStyleId = e.options.tableStyleId || "", this._showHeader = (s = e.options.showHeader) != null ? s : !0, this._showFooter = (r = e.options.showFooter) != null ? r : !0, e.columns.forEach((a) => {
|
|
908
|
-
const o = new
|
|
922
|
+
const o = new z(a.id, a.displayName);
|
|
909
923
|
o.fromJSON(a), this._columns.set(a.id, o), this._columnOrder.push(a.id);
|
|
910
924
|
}), this._tableFilters = new Oe(), this._tableFilters.fromJSON(e.filters);
|
|
911
925
|
}
|
|
@@ -913,12 +927,12 @@ class Ue {
|
|
|
913
927
|
this._id = "", this._name = "", this._tableStyleId = "", this._showHeader = !0, this._showFooter = !0, delete this._range, this._columns.clear(), this._columnOrder = [];
|
|
914
928
|
}
|
|
915
929
|
}
|
|
916
|
-
var
|
|
917
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
930
|
+
var xn = Object.getOwnPropertyDescriptor, On = (t, e, n, s) => {
|
|
931
|
+
for (var r = s > 1 ? void 0 : s ? xn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
918
932
|
(o = t[a]) && (r = o(r) || r);
|
|
919
933
|
return r;
|
|
920
934
|
}, $e = (t, e) => (n, s) => e(n, s, t);
|
|
921
|
-
let
|
|
935
|
+
let T = class extends H {
|
|
922
936
|
constructor(e, n) {
|
|
923
937
|
super();
|
|
924
938
|
b(this, "_tableMap");
|
|
@@ -934,7 +948,7 @@ let C = class extends H {
|
|
|
934
948
|
b(this, "tableThemeChanged$", this._tableThemeChanged$.asObservable());
|
|
935
949
|
b(this, "_tableFilterChanged$", new Y());
|
|
936
950
|
b(this, "tableFilterChanged$", this._tableFilterChanged$.asObservable());
|
|
937
|
-
b(this, "_tableInitStatus", new
|
|
951
|
+
b(this, "_tableInitStatus", new Ke(!1));
|
|
938
952
|
b(this, "tableInitStatus$", this._tableInitStatus.asObservable());
|
|
939
953
|
this._univerInstanceService = e, this._localeService = n, this._tableMap = /* @__PURE__ */ new Map();
|
|
940
954
|
}
|
|
@@ -945,7 +959,7 @@ let C = class extends H {
|
|
|
945
959
|
var d;
|
|
946
960
|
const a = (d = this._univerInstanceService.getUnit(e)) == null ? void 0 : d.getSheetBySheetId(n), { startRow: o, startColumn: u, endColumn: l } = s, i = [], h = r != null ? r : "Column";
|
|
947
961
|
for (let c = u; c <= l; c++)
|
|
948
|
-
i.push(
|
|
962
|
+
i.push(Ze(a == null ? void 0 : a.getCell(o, c)) || te(c - u + 1, h));
|
|
949
963
|
return i;
|
|
950
964
|
}
|
|
951
965
|
/**
|
|
@@ -961,7 +975,7 @@ let C = class extends H {
|
|
|
961
975
|
*/
|
|
962
976
|
addTable(e, n, s, r, a, o, u) {
|
|
963
977
|
var c;
|
|
964
|
-
const l = o != null ? o :
|
|
978
|
+
const l = o != null ? o : B(), i = a || this.getColumnHeader(e, n, r), h = new Ue(l, s, r, i, u);
|
|
965
979
|
if (h.setSubunitId(n), this._ensureUnit(e).set(l, h), this._tableAdd$.next({
|
|
966
980
|
unitId: e,
|
|
967
981
|
subUnitId: n,
|
|
@@ -1090,10 +1104,10 @@ let C = class extends H {
|
|
|
1090
1104
|
else if (o === "column") {
|
|
1091
1105
|
d.endColumn += l;
|
|
1092
1106
|
for (let c = 0; c < l; c++) {
|
|
1093
|
-
const g = this._localeService.t("sheets-table.columnPrefix"), _ = new
|
|
1107
|
+
const g = this._localeService.t("sheets-table.columnPrefix"), _ = new z(B(), te(r.getColumnsCount() + 1 + c, g));
|
|
1094
1108
|
i != null && i[c] && _.fromJSON(i[c]);
|
|
1095
|
-
const
|
|
1096
|
-
r.insertColumn(
|
|
1109
|
+
const f = u + c - h.startColumn;
|
|
1110
|
+
r.insertColumn(f, _);
|
|
1097
1111
|
}
|
|
1098
1112
|
}
|
|
1099
1113
|
} else if (o === "row")
|
|
@@ -1120,7 +1134,7 @@ let C = class extends H {
|
|
|
1120
1134
|
if (o.startColumn < a.startColumn) {
|
|
1121
1135
|
const u = a.startColumn - o.startColumn, l = this._localeService.t("sheets-table.columnPrefix");
|
|
1122
1136
|
for (let i = 0; i < u; i++)
|
|
1123
|
-
r.insertColumn(a.startColumn, new
|
|
1137
|
+
r.insertColumn(a.startColumn, new z(B(), te(r.getColumnsCount() + 1, l)));
|
|
1124
1138
|
} else if (o.startColumn > a.startColumn) {
|
|
1125
1139
|
const u = o.startColumn - a.startColumn;
|
|
1126
1140
|
for (let l = u - 1; l >= 0; l--) {
|
|
@@ -1137,7 +1151,7 @@ let C = class extends H {
|
|
|
1137
1151
|
} else if (o.endColumn > a.endColumn) {
|
|
1138
1152
|
const u = o.endColumn - a.endColumn;
|
|
1139
1153
|
for (let l = 0; l < u; l++)
|
|
1140
|
-
r.insertColumn(a.endColumn, new
|
|
1154
|
+
r.insertColumn(a.endColumn, new z(B(), te(r.getColumnsCount() + 1, "Column")));
|
|
1141
1155
|
}
|
|
1142
1156
|
r.setRange(o), this._tableRangeChanged$.next({
|
|
1143
1157
|
unitId: e,
|
|
@@ -1227,15 +1241,15 @@ let C = class extends H {
|
|
|
1227
1241
|
}), this._tableMap.clear();
|
|
1228
1242
|
}
|
|
1229
1243
|
};
|
|
1230
|
-
|
|
1231
|
-
$e(0,
|
|
1232
|
-
$e(1,
|
|
1233
|
-
],
|
|
1234
|
-
var
|
|
1235
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
1244
|
+
T = On([
|
|
1245
|
+
$e(0, A),
|
|
1246
|
+
$e(1, C(be))
|
|
1247
|
+
], T);
|
|
1248
|
+
var Un = Object.getOwnPropertyDescriptor, $n = (t, e, n, s) => {
|
|
1249
|
+
for (var r = s > 1 ? void 0 : s ? Un(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
1236
1250
|
(o = t[a]) && (r = o(r) || r);
|
|
1237
1251
|
return r;
|
|
1238
|
-
},
|
|
1252
|
+
}, An = (t, e) => (n, s) => e(n, s, t);
|
|
1239
1253
|
let X = class extends H {
|
|
1240
1254
|
constructor(t) {
|
|
1241
1255
|
super(), this._tableManager = t;
|
|
@@ -1276,54 +1290,64 @@ let X = class extends H {
|
|
|
1276
1290
|
addFilter(t, e, n, s) {
|
|
1277
1291
|
this._tableManager.addFilter(t, e, n, s);
|
|
1278
1292
|
}
|
|
1279
|
-
getCellValueWithConditionType(t, e, n, s =
|
|
1293
|
+
getCellValueWithConditionType(t, e, n, s = U.String) {
|
|
1280
1294
|
return ue(t, e, n, s);
|
|
1281
1295
|
}
|
|
1282
1296
|
};
|
|
1283
|
-
X =
|
|
1284
|
-
|
|
1297
|
+
X = $n([
|
|
1298
|
+
An(0, C(T))
|
|
1285
1299
|
], X);
|
|
1286
1300
|
const k = {
|
|
1287
1301
|
id: "sheet.mutation.add-table",
|
|
1288
|
-
type:
|
|
1302
|
+
type: y.MUTATION,
|
|
1289
1303
|
handler: (t, e) => {
|
|
1290
1304
|
const { tableId: n, unitId: s, subUnitId: r, name: a, range: o, header: u, options: l } = e;
|
|
1291
1305
|
return t.get(X).addTable(s, r, a, o, u, n, l), !0;
|
|
1292
1306
|
}
|
|
1293
1307
|
}, Q = {
|
|
1294
1308
|
id: "sheet.mutation.delete-table",
|
|
1295
|
-
type:
|
|
1309
|
+
type: y.MUTATION,
|
|
1296
1310
|
handler: (t, e) => {
|
|
1297
1311
|
const { unitId: n, subUnitId: s, tableId: r } = e;
|
|
1298
1312
|
return t.get(X).deleteTable(n, s, r), !0;
|
|
1299
1313
|
}
|
|
1300
|
-
},
|
|
1314
|
+
}, Ln = {
|
|
1301
1315
|
id: "sheet.command.add-table",
|
|
1302
|
-
type:
|
|
1316
|
+
type: y.COMMAND,
|
|
1303
1317
|
handler: (t, e) => {
|
|
1304
|
-
var
|
|
1318
|
+
var p;
|
|
1305
1319
|
if (!e)
|
|
1306
1320
|
return !1;
|
|
1307
|
-
const n = t.get(
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1321
|
+
const n = t.get(L), s = t.get(D), r = t.get(be), a = t.get(T), o = (p = e.id) != null ? p : B(), u = et(e.unitId, {
|
|
1322
|
+
univerInstanceService: t.get(A),
|
|
1323
|
+
tableManager: a,
|
|
1324
|
+
definedNamesService: t.get(Pe)
|
|
1325
|
+
});
|
|
1326
|
+
let l = e.name;
|
|
1327
|
+
if (!l || !Be(l.toLowerCase(), u)) {
|
|
1328
|
+
const w = r.t("sheets-table.tablePrefix");
|
|
1329
|
+
let R = a.getTableList(e.unitId).length + 1;
|
|
1330
|
+
for (const O of u)
|
|
1331
|
+
if (O.startsWith(w.toLowerCase())) {
|
|
1332
|
+
const I = Number(O.slice(w.length));
|
|
1333
|
+
Number.isInteger(I) && I >= R && (R = I + 1);
|
|
1334
|
+
}
|
|
1335
|
+
l = `${w}${R}`;
|
|
1312
1336
|
}
|
|
1313
|
-
const
|
|
1314
|
-
return
|
|
1337
|
+
const i = [], h = [], { unitId: d, subUnitId: c, range: g } = e, _ = a.getColumnHeader(d, c, g, r.t("sheets-table.columnPrefix"));
|
|
1338
|
+
return i.push({ id: k.id, params: { ...e, tableId: o, name: l, header: _ } }), h.push({ id: Q.id, params: { tableId: o, unitId: e.unitId } }), E(i, s) && n.pushUndoRedo({
|
|
1315
1339
|
unitID: e.unitId,
|
|
1316
|
-
undoMutations:
|
|
1317
|
-
redoMutations:
|
|
1340
|
+
undoMutations: h,
|
|
1341
|
+
redoMutations: i
|
|
1318
1342
|
}), !0;
|
|
1319
1343
|
}
|
|
1320
|
-
},
|
|
1344
|
+
}, En = {
|
|
1321
1345
|
id: "sheet.command.delete-table",
|
|
1322
|
-
type:
|
|
1346
|
+
type: y.COMMAND,
|
|
1323
1347
|
handler: (t, e) => {
|
|
1324
1348
|
if (!e)
|
|
1325
1349
|
return !1;
|
|
1326
|
-
const n = t.get(
|
|
1350
|
+
const n = t.get(L), s = t.get(D), r = t.get(T), a = t.get(We), o = [], u = [], l = r.getTable(e.unitId, e.tableId), i = l == null ? void 0 : l.toJSON();
|
|
1327
1351
|
return i ? (o.push({ id: Q.id, params: { ...e } }), u.push({
|
|
1328
1352
|
id: k.id,
|
|
1329
1353
|
params: {
|
|
@@ -1340,29 +1364,29 @@ const k = {
|
|
|
1340
1364
|
redoMutations: o
|
|
1341
1365
|
}), !0) : (a.error("[TableManager]: Table not found"), !1);
|
|
1342
1366
|
}
|
|
1343
|
-
},
|
|
1367
|
+
}, Ce = {
|
|
1344
1368
|
id: "sheet.mutation.set-table-filter",
|
|
1345
|
-
type:
|
|
1369
|
+
type: y.MUTATION,
|
|
1346
1370
|
handler: (t, e) => {
|
|
1347
1371
|
const { tableId: n, unitId: s, column: r, tableFilter: a } = e;
|
|
1348
|
-
return t.get(
|
|
1372
|
+
return t.get(T).addFilter(s, n, r, a), !0;
|
|
1349
1373
|
}
|
|
1350
1374
|
}, Bn = {
|
|
1351
1375
|
id: "sheet.command.set-table-filter",
|
|
1352
|
-
type:
|
|
1376
|
+
type: y.COMMAND,
|
|
1353
1377
|
handler: (t, e) => {
|
|
1354
1378
|
if (!e)
|
|
1355
1379
|
return !1;
|
|
1356
|
-
const n = t.get(
|
|
1357
|
-
return a.push({ id:
|
|
1380
|
+
const n = t.get(L), s = t.get(D), r = e.tableId || B(), a = [], o = [];
|
|
1381
|
+
return a.push({ id: Ce.id, params: { ...e, tableId: r } }), o.push({ id: Ce.id, params: { ...e, tableId: r, tableFilter: void 0 } }), E(a, s) && n.pushUndoRedo({
|
|
1358
1382
|
unitID: e.unitId,
|
|
1359
1383
|
undoMutations: o,
|
|
1360
1384
|
redoMutations: a
|
|
1361
1385
|
}), !0;
|
|
1362
1386
|
}
|
|
1363
|
-
},
|
|
1364
|
-
var
|
|
1365
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
1387
|
+
}, at = "SHEET_TABLE_PLUGIN", re = "SHEET_TABLE", Wn = "table-custom";
|
|
1388
|
+
var Hn = Object.getOwnPropertyDescriptor, Vn = (t, e, n, s) => {
|
|
1389
|
+
for (var r = s > 1 ? void 0 : s ? Hn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
1366
1390
|
(o = t[a]) && (r = o(r) || r);
|
|
1367
1391
|
return r;
|
|
1368
1392
|
}, ae = (t, e) => (n, s) => e(n, s, t);
|
|
@@ -1381,7 +1405,7 @@ let W = class extends H {
|
|
|
1381
1405
|
return this._tableManager.getTable(e, String(o));
|
|
1382
1406
|
}
|
|
1383
1407
|
_ensureTableRangeRTree(e) {
|
|
1384
|
-
return this._tableRangeRTree.has(e) || this._tableRangeRTree.set(e, new
|
|
1408
|
+
return this._tableRangeRTree.has(e) || this._tableRangeRTree.set(e, new ct()), this._tableRangeRTree.get(e);
|
|
1385
1409
|
}
|
|
1386
1410
|
registerTableChangeEvent() {
|
|
1387
1411
|
this.disposeWithMe(
|
|
@@ -1423,8 +1447,8 @@ let W = class extends H {
|
|
|
1423
1447
|
}
|
|
1424
1448
|
registerTableHeaderInterceptor() {
|
|
1425
1449
|
this.disposeWithMe(
|
|
1426
|
-
this._sheetInterceptorService.intercept(
|
|
1427
|
-
effect:
|
|
1450
|
+
this._sheetInterceptorService.intercept(qe.CELL_CONTENT, {
|
|
1451
|
+
effect: dt.Value,
|
|
1428
1452
|
handler: (e, n, s) => {
|
|
1429
1453
|
const { row: r, col: a, unitId: o, subUnitId: u } = n, l = this._ensureTableRangeRTree(o);
|
|
1430
1454
|
if ((e == null ? void 0 : e.v) === void 0 && l) {
|
|
@@ -1434,8 +1458,8 @@ let W = class extends H {
|
|
|
1434
1458
|
if (d) {
|
|
1435
1459
|
const c = d.getRange(), g = a - c.startColumn;
|
|
1436
1460
|
if (c.startRow === r) {
|
|
1437
|
-
const
|
|
1438
|
-
return (!e || e === n.rawData) && (e = { ...n.rawData }), e.v =
|
|
1461
|
+
const f = d.getColumnNameByIndex(g);
|
|
1462
|
+
return (!e || e === n.rawData) && (e = { ...n.rawData }), e.v = f, s(e);
|
|
1439
1463
|
}
|
|
1440
1464
|
}
|
|
1441
1465
|
}
|
|
@@ -1466,8 +1490,8 @@ let W = class extends H {
|
|
|
1466
1490
|
return {};
|
|
1467
1491
|
}
|
|
1468
1492
|
},
|
|
1469
|
-
businesses: [
|
|
1470
|
-
pluginName:
|
|
1493
|
+
businesses: [j.UNIVER_SHEET],
|
|
1494
|
+
pluginName: at,
|
|
1471
1495
|
onLoad: (e, n) => {
|
|
1472
1496
|
this._fromJSON(e, n);
|
|
1473
1497
|
},
|
|
@@ -1483,8 +1507,8 @@ let W = class extends H {
|
|
|
1483
1507
|
// eslint-disable-next-line max-lines-per-function
|
|
1484
1508
|
getMutations: (e) => {
|
|
1485
1509
|
var n;
|
|
1486
|
-
if (e.id ===
|
|
1487
|
-
const s = e.params, r = s.unitId || this._univerInstanceService.getCurrentUnitOfType(
|
|
1510
|
+
if (e.id === wt.id) {
|
|
1511
|
+
const s = e.params, r = s.unitId || this._univerInstanceService.getCurrentUnitOfType(j.UNIVER_SHEET).getUnitId(), a = s.subUnitId || ((n = this._univerInstanceService.getCurrentUnitOfType(j.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : n.getSheetId());
|
|
1488
1512
|
if (!r || !a)
|
|
1489
1513
|
return { redos: [], undos: [] };
|
|
1490
1514
|
const o = this._tableManager.getTablesBySubunitId(r, a);
|
|
@@ -1516,7 +1540,7 @@ let W = class extends H {
|
|
|
1516
1540
|
}
|
|
1517
1541
|
});
|
|
1518
1542
|
}), { redos: u, undos: l };
|
|
1519
|
-
} else if (e.id ===
|
|
1543
|
+
} else if (e.id === ft.id) {
|
|
1520
1544
|
const s = e.params, { unitId: r, subUnitId: a, targetSubUnitId: o } = s;
|
|
1521
1545
|
if (!r || !a || !o)
|
|
1522
1546
|
return { redos: [], undos: [] };
|
|
@@ -1525,7 +1549,7 @@ let W = class extends H {
|
|
|
1525
1549
|
return { redos: [], undos: [] };
|
|
1526
1550
|
const l = [], i = [];
|
|
1527
1551
|
return u.forEach((h) => {
|
|
1528
|
-
const d = h.toJSON(), c =
|
|
1552
|
+
const d = h.toJSON(), c = B();
|
|
1529
1553
|
l.push({
|
|
1530
1554
|
id: k.id,
|
|
1531
1555
|
params: {
|
|
@@ -1562,32 +1586,32 @@ let W = class extends H {
|
|
|
1562
1586
|
super.dispose(), this._tableRangeRTree.clear();
|
|
1563
1587
|
}
|
|
1564
1588
|
};
|
|
1565
|
-
W =
|
|
1566
|
-
ae(0,
|
|
1567
|
-
ae(1,
|
|
1568
|
-
ae(2,
|
|
1569
|
-
ae(3,
|
|
1589
|
+
W = Vn([
|
|
1590
|
+
ae(0, C(A)),
|
|
1591
|
+
ae(1, C(Re)),
|
|
1592
|
+
ae(2, C(T)),
|
|
1593
|
+
ae(3, C(ut))
|
|
1570
1594
|
], W);
|
|
1571
1595
|
const S = {
|
|
1572
1596
|
id: "sheet.mutation.set-sheet-table",
|
|
1573
|
-
type:
|
|
1597
|
+
type: y.MUTATION,
|
|
1574
1598
|
handler: (t, e) => {
|
|
1575
1599
|
if (!e)
|
|
1576
1600
|
return !1;
|
|
1577
1601
|
const { unitId: n, tableId: s, config: r } = e;
|
|
1578
|
-
return t.get(
|
|
1602
|
+
return t.get(T).setTableByConfig(n, s, r), !0;
|
|
1579
1603
|
}
|
|
1580
|
-
},
|
|
1604
|
+
}, Pn = {
|
|
1581
1605
|
id: "sheet.command.add-table-theme",
|
|
1582
|
-
type:
|
|
1606
|
+
type: y.COMMAND,
|
|
1583
1607
|
handler: (t, e) => {
|
|
1584
1608
|
if (!e)
|
|
1585
1609
|
return !1;
|
|
1586
|
-
const n = t.get(
|
|
1610
|
+
const n = t.get(T), { unitId: s, tableId: r, themeStyle: a } = e, o = [], u = [], l = n.getTableById(s, r);
|
|
1587
1611
|
if (!l) return !1;
|
|
1588
1612
|
const i = l.getSubunitId();
|
|
1589
1613
|
o.push({
|
|
1590
|
-
id:
|
|
1614
|
+
id: Je.id,
|
|
1591
1615
|
params: {
|
|
1592
1616
|
unitId: s,
|
|
1593
1617
|
subUnitId: i,
|
|
@@ -1614,7 +1638,7 @@ const S = {
|
|
|
1614
1638
|
}
|
|
1615
1639
|
}
|
|
1616
1640
|
}), u.push({
|
|
1617
|
-
id:
|
|
1641
|
+
id: ke.id,
|
|
1618
1642
|
params: {
|
|
1619
1643
|
unitId: s,
|
|
1620
1644
|
subUnitId: i,
|
|
@@ -1622,49 +1646,49 @@ const S = {
|
|
|
1622
1646
|
}
|
|
1623
1647
|
});
|
|
1624
1648
|
const h = t.get(D);
|
|
1625
|
-
return E(o, h) && t.get(
|
|
1649
|
+
return E(o, h) && t.get(L).pushUndoRedo({
|
|
1626
1650
|
unitID: s,
|
|
1627
1651
|
undoMutations: u,
|
|
1628
1652
|
redoMutations: o
|
|
1629
1653
|
}), !0;
|
|
1630
1654
|
}
|
|
1631
|
-
},
|
|
1655
|
+
}, qn = {
|
|
1632
1656
|
id: "sheet.command.remove-table-theme",
|
|
1633
|
-
type:
|
|
1657
|
+
type: y.COMMAND,
|
|
1634
1658
|
handler: (t, e) => {
|
|
1635
1659
|
if (!e)
|
|
1636
1660
|
return !1;
|
|
1637
|
-
const { unitId: n, tableId: s, themeName: r } = e, a = t.get(
|
|
1661
|
+
const { unitId: n, tableId: s, themeName: r } = e, a = t.get(T), o = t.get(Qe), u = a.getTableById(n, s);
|
|
1638
1662
|
if (!u) return !1;
|
|
1639
|
-
const l = u.getSubunitId(), i = [], h = [], d = o.getRegisteredRangeThemes().filter((
|
|
1640
|
-
let g = o.getRegisteredRangeThemes().filter((
|
|
1641
|
-
g || (g = d[0]), i.push({ id: S.id, params: { unitId: n, subUnitId: l, tableId: s, config: { theme: g } } }), i.push({ id:
|
|
1663
|
+
const l = u.getSubunitId(), i = [], h = [], d = o.getRegisteredRangeThemes().filter((w) => w == null ? void 0 : w.startsWith("table-default"));
|
|
1664
|
+
let g = o.getRegisteredRangeThemes().filter((w) => w == null ? void 0 : w.startsWith(Wn)).find((w) => w !== r);
|
|
1665
|
+
g || (g = d[0]), i.push({ id: S.id, params: { unitId: n, subUnitId: l, tableId: s, config: { theme: g } } }), i.push({ id: ke.id, params: { unitId: n, subUnitId: l, styleName: r } });
|
|
1642
1666
|
const _ = o.getDefaultRangeThemeStyle(r);
|
|
1643
|
-
_ && (h.push({ id:
|
|
1644
|
-
const
|
|
1645
|
-
return E(i,
|
|
1667
|
+
_ && (h.push({ id: Je.id, params: { unitId: n, subUnitId: l, styleJSON: _.toJson() } }), h.push({ id: S.id, params: { unitId: n, subUnitId: l, tableId: s, config: { theme: r } } }));
|
|
1668
|
+
const f = t.get(D);
|
|
1669
|
+
return E(i, f) && t.get(L).pushUndoRedo({
|
|
1646
1670
|
unitID: n,
|
|
1647
1671
|
redoMutations: i,
|
|
1648
1672
|
undoMutations: h
|
|
1649
1673
|
}), !0;
|
|
1650
1674
|
}
|
|
1651
|
-
},
|
|
1675
|
+
}, Jn = {
|
|
1652
1676
|
id: "sheet.command.set-table-config",
|
|
1653
|
-
type:
|
|
1677
|
+
type: y.COMMAND,
|
|
1654
1678
|
// eslint-disable-next-line max-lines-per-function
|
|
1655
1679
|
handler: (t, e) => {
|
|
1656
1680
|
if (!e)
|
|
1657
1681
|
return !1;
|
|
1658
|
-
const { unitId: n, tableId: s, name: r, updateRange: a, rowColOperation: o, theme: u } = e, l = t.get(
|
|
1682
|
+
const { unitId: n, tableId: s, name: r, updateRange: a, rowColOperation: o, theme: u } = e, l = t.get(T), i = l.getTableById(n, s);
|
|
1659
1683
|
if (!i) return !1;
|
|
1660
|
-
const h = {}, d = {}, c = t.get(be),
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
if (!
|
|
1667
|
-
return t.get(
|
|
1684
|
+
const h = {}, d = {}, c = t.get(be), g = et(n, {
|
|
1685
|
+
univerInstanceService: t.get(A),
|
|
1686
|
+
tableManager: l,
|
|
1687
|
+
definedNamesService: t.get(Pe)
|
|
1688
|
+
});
|
|
1689
|
+
if (r) {
|
|
1690
|
+
if (!Be(r.toLowerCase(), g))
|
|
1691
|
+
return t.get(We).warn(c.t("sheets-table.tableNameError")), !1;
|
|
1668
1692
|
h.name = i.getDisplayName(), d.name = r;
|
|
1669
1693
|
}
|
|
1670
1694
|
o && (h.rowColOperation = {
|
|
@@ -1675,13 +1699,13 @@ const S = {
|
|
|
1675
1699
|
}, d.rowColOperation = o), a && (h.updateRange = {
|
|
1676
1700
|
newRange: i.getRange()
|
|
1677
1701
|
}, d.updateRange = a), u && (h.theme = i.getTableStyleId(), d.theme = u);
|
|
1678
|
-
const
|
|
1702
|
+
const _ = {
|
|
1679
1703
|
unitId: n,
|
|
1680
1704
|
subUnitId: i.getSubunitId(),
|
|
1681
1705
|
tableId: s,
|
|
1682
1706
|
config: d
|
|
1683
1707
|
};
|
|
1684
|
-
return t.get(D).executeCommand(S.id,
|
|
1708
|
+
return t.get(D).executeCommand(S.id, _), t.get(L).pushUndoRedo({
|
|
1685
1709
|
unitID: n,
|
|
1686
1710
|
undoMutations: [
|
|
1687
1711
|
{
|
|
@@ -1697,34 +1721,34 @@ const S = {
|
|
|
1697
1721
|
redoMutations: [
|
|
1698
1722
|
{
|
|
1699
1723
|
id: S.id,
|
|
1700
|
-
params:
|
|
1724
|
+
params: _
|
|
1701
1725
|
}
|
|
1702
1726
|
]
|
|
1703
1727
|
}), !0;
|
|
1704
1728
|
}
|
|
1705
|
-
},
|
|
1729
|
+
}, kn = {
|
|
1706
1730
|
id: "sheet.command.table-insert-row",
|
|
1707
|
-
type:
|
|
1731
|
+
type: y.COMMAND,
|
|
1708
1732
|
handler: (t) => {
|
|
1709
|
-
const e = t.get(
|
|
1733
|
+
const e = t.get(A), n = $(e);
|
|
1710
1734
|
if (!n)
|
|
1711
1735
|
return !1;
|
|
1712
1736
|
const { workbook: s, worksheet: r, unitId: a, subUnitId: o } = n, l = t.get(we).getCurrentSelections();
|
|
1713
1737
|
if (!l.length || l.length > 1)
|
|
1714
1738
|
return !1;
|
|
1715
|
-
t.get(
|
|
1739
|
+
t.get(T);
|
|
1716
1740
|
const h = l[0].range, c = t.get(W).getContainerTableWithRange(a, o, h);
|
|
1717
1741
|
if (!c) return !1;
|
|
1718
|
-
const g = h.endRow - h.startRow + 1,
|
|
1719
|
-
if (
|
|
1720
|
-
|
|
1721
|
-
id:
|
|
1742
|
+
const g = h.endRow - h.startRow + 1, f = r.getRowCount() - 1, p = r.getCellMatrix().getDataRange().endRow, w = [], R = [];
|
|
1743
|
+
if (f - p < g)
|
|
1744
|
+
w.push({
|
|
1745
|
+
id: Ye.id,
|
|
1722
1746
|
params: {
|
|
1723
1747
|
unitId: a,
|
|
1724
1748
|
subUnitId: o,
|
|
1725
1749
|
range: { ...h }
|
|
1726
1750
|
}
|
|
1727
|
-
}),
|
|
1751
|
+
}), w.push({
|
|
1728
1752
|
id: S.id,
|
|
1729
1753
|
params: {
|
|
1730
1754
|
unitId: a,
|
|
@@ -1739,7 +1763,7 @@ const S = {
|
|
|
1739
1763
|
}
|
|
1740
1764
|
}
|
|
1741
1765
|
}
|
|
1742
|
-
}),
|
|
1766
|
+
}), R.push({
|
|
1743
1767
|
id: S.id,
|
|
1744
1768
|
params: {
|
|
1745
1769
|
unitId: a,
|
|
@@ -1751,8 +1775,8 @@ const S = {
|
|
|
1751
1775
|
}
|
|
1752
1776
|
}
|
|
1753
1777
|
}
|
|
1754
|
-
}),
|
|
1755
|
-
id:
|
|
1778
|
+
}), R.push({
|
|
1779
|
+
id: Ge.id,
|
|
1756
1780
|
params: {
|
|
1757
1781
|
unitId: a,
|
|
1758
1782
|
subUnitId: o,
|
|
@@ -1761,7 +1785,7 @@ const S = {
|
|
|
1761
1785
|
});
|
|
1762
1786
|
else {
|
|
1763
1787
|
const v = { ...c.getRange() };
|
|
1764
|
-
|
|
1788
|
+
w.push({
|
|
1765
1789
|
id: S.id,
|
|
1766
1790
|
params: {
|
|
1767
1791
|
unitId: a,
|
|
@@ -1776,7 +1800,7 @@ const S = {
|
|
|
1776
1800
|
}
|
|
1777
1801
|
}
|
|
1778
1802
|
}
|
|
1779
|
-
}),
|
|
1803
|
+
}), R.push({
|
|
1780
1804
|
id: S.id,
|
|
1781
1805
|
params: {
|
|
1782
1806
|
unitId: a,
|
|
@@ -1812,20 +1836,20 @@ const S = {
|
|
|
1812
1836
|
}
|
|
1813
1837
|
}
|
|
1814
1838
|
);
|
|
1815
|
-
ee && (
|
|
1839
|
+
ee && (w.push(...ee.redos), R.push(...ee.undos));
|
|
1816
1840
|
}
|
|
1817
|
-
const
|
|
1818
|
-
return E(
|
|
1841
|
+
const O = t.get(D);
|
|
1842
|
+
return E(w, O) && t.get(L).pushUndoRedo({
|
|
1819
1843
|
unitID: a,
|
|
1820
|
-
undoMutations:
|
|
1821
|
-
redoMutations:
|
|
1844
|
+
undoMutations: R,
|
|
1845
|
+
redoMutations: w
|
|
1822
1846
|
}), !0;
|
|
1823
1847
|
}
|
|
1824
|
-
},
|
|
1848
|
+
}, Qn = {
|
|
1825
1849
|
id: "sheet.command.table-insert-col",
|
|
1826
|
-
type:
|
|
1850
|
+
type: y.COMMAND,
|
|
1827
1851
|
handler: (t) => {
|
|
1828
|
-
const e = t.get(
|
|
1852
|
+
const e = t.get(A), n = $(e);
|
|
1829
1853
|
if (!n)
|
|
1830
1854
|
return !1;
|
|
1831
1855
|
const { worksheet: s, unitId: r, subUnitId: a } = n, u = t.get(we).getCurrentSelections();
|
|
@@ -1833,10 +1857,10 @@ const S = {
|
|
|
1833
1857
|
return !1;
|
|
1834
1858
|
const i = u[0].range, d = t.get(W).getContainerTableWithRange(r, a, i);
|
|
1835
1859
|
if (!d) return !1;
|
|
1836
|
-
const c = i.endColumn - i.startColumn + 1, _ = s.getColumnCount() - 1,
|
|
1837
|
-
if (_ -
|
|
1860
|
+
const c = i.endColumn - i.startColumn + 1, _ = s.getColumnCount() - 1, f = s.getCellMatrix().getDataRange().endColumn, p = [], w = [];
|
|
1861
|
+
if (_ - f < c)
|
|
1838
1862
|
p.push({
|
|
1839
|
-
id:
|
|
1863
|
+
id: je.id,
|
|
1840
1864
|
params: {
|
|
1841
1865
|
unitId: r,
|
|
1842
1866
|
subUnitId: a,
|
|
@@ -1851,13 +1875,13 @@ const S = {
|
|
|
1851
1875
|
config: {
|
|
1852
1876
|
rowColOperation: {
|
|
1853
1877
|
operationType: M.Insert,
|
|
1854
|
-
rowColType:
|
|
1878
|
+
rowColType: N.Col,
|
|
1855
1879
|
index: i.startColumn,
|
|
1856
1880
|
count: c
|
|
1857
1881
|
}
|
|
1858
1882
|
}
|
|
1859
1883
|
}
|
|
1860
|
-
}),
|
|
1884
|
+
}), w.push({
|
|
1861
1885
|
id: S.id,
|
|
1862
1886
|
params: {
|
|
1863
1887
|
unitId: r,
|
|
@@ -1866,14 +1890,14 @@ const S = {
|
|
|
1866
1890
|
config: {
|
|
1867
1891
|
rowColOperation: {
|
|
1868
1892
|
operationType: M.Delete,
|
|
1869
|
-
rowColType:
|
|
1893
|
+
rowColType: N.Col,
|
|
1870
1894
|
index: i.startColumn,
|
|
1871
1895
|
count: c
|
|
1872
1896
|
}
|
|
1873
1897
|
}
|
|
1874
1898
|
}
|
|
1875
|
-
}),
|
|
1876
|
-
id:
|
|
1899
|
+
}), w.push({
|
|
1900
|
+
id: ze.id,
|
|
1877
1901
|
params: {
|
|
1878
1902
|
unitId: r,
|
|
1879
1903
|
subUnitId: a,
|
|
@@ -1881,7 +1905,7 @@ const S = {
|
|
|
1881
1905
|
}
|
|
1882
1906
|
});
|
|
1883
1907
|
else {
|
|
1884
|
-
const
|
|
1908
|
+
const I = d.getRange();
|
|
1885
1909
|
p.push({
|
|
1886
1910
|
id: S.id,
|
|
1887
1911
|
params: {
|
|
@@ -1891,13 +1915,13 @@ const S = {
|
|
|
1891
1915
|
config: {
|
|
1892
1916
|
rowColOperation: {
|
|
1893
1917
|
operationType: M.Insert,
|
|
1894
|
-
rowColType:
|
|
1918
|
+
rowColType: N.Col,
|
|
1895
1919
|
index: i.startColumn,
|
|
1896
1920
|
count: c
|
|
1897
1921
|
}
|
|
1898
1922
|
}
|
|
1899
1923
|
}
|
|
1900
|
-
}),
|
|
1924
|
+
}), w.push({
|
|
1901
1925
|
id: S.id,
|
|
1902
1926
|
params: {
|
|
1903
1927
|
unitId: r,
|
|
@@ -1906,7 +1930,7 @@ const S = {
|
|
|
1906
1930
|
config: {
|
|
1907
1931
|
rowColOperation: {
|
|
1908
1932
|
operationType: M.Delete,
|
|
1909
|
-
rowColType:
|
|
1933
|
+
rowColType: N.Col,
|
|
1910
1934
|
index: i.startColumn,
|
|
1911
1935
|
count: c
|
|
1912
1936
|
}
|
|
@@ -1919,39 +1943,39 @@ const S = {
|
|
|
1919
1943
|
unitId: r,
|
|
1920
1944
|
subUnitId: a,
|
|
1921
1945
|
range: {
|
|
1922
|
-
startRow:
|
|
1923
|
-
endRow:
|
|
1946
|
+
startRow: I.startRow,
|
|
1947
|
+
endRow: I.endRow,
|
|
1924
1948
|
startColumn: i.startColumn,
|
|
1925
|
-
endColumn:
|
|
1949
|
+
endColumn: f
|
|
1926
1950
|
}
|
|
1927
1951
|
},
|
|
1928
1952
|
{
|
|
1929
1953
|
unitId: r,
|
|
1930
1954
|
subUnitId: a,
|
|
1931
1955
|
range: {
|
|
1932
|
-
startRow:
|
|
1933
|
-
endRow:
|
|
1956
|
+
startRow: I.startRow,
|
|
1957
|
+
endRow: I.endRow,
|
|
1934
1958
|
startColumn: i.startColumn + c,
|
|
1935
|
-
endColumn:
|
|
1959
|
+
endColumn: f + c
|
|
1936
1960
|
}
|
|
1937
1961
|
}
|
|
1938
1962
|
);
|
|
1939
|
-
v && (p.push(...v.redos),
|
|
1963
|
+
v && (p.push(...v.redos), w.push(...v.undos));
|
|
1940
1964
|
}
|
|
1941
|
-
const
|
|
1942
|
-
return E(p,
|
|
1965
|
+
const R = t.get(D);
|
|
1966
|
+
return E(p, R) && t.get(L).pushUndoRedo({
|
|
1943
1967
|
unitID: r,
|
|
1944
|
-
undoMutations:
|
|
1968
|
+
undoMutations: w,
|
|
1945
1969
|
redoMutations: p
|
|
1946
1970
|
}), !0;
|
|
1947
1971
|
}
|
|
1948
|
-
},
|
|
1972
|
+
}, Yn = {
|
|
1949
1973
|
id: "sheet.command.table-remove-row",
|
|
1950
|
-
type:
|
|
1974
|
+
type: y.COMMAND,
|
|
1951
1975
|
handler: (t, e) => {
|
|
1952
1976
|
if (!e)
|
|
1953
1977
|
return !1;
|
|
1954
|
-
const n = t.get(
|
|
1978
|
+
const n = t.get(A), s = $(n, e);
|
|
1955
1979
|
if (!s)
|
|
1956
1980
|
return !1;
|
|
1957
1981
|
const { unitId: r, subUnitId: a } = s, u = t.get(we).getCurrentSelections();
|
|
@@ -1959,7 +1983,7 @@ const S = {
|
|
|
1959
1983
|
return !1;
|
|
1960
1984
|
const i = u[0].range, d = t.get(W).getContainerTableWithRange(r, a, i);
|
|
1961
1985
|
if (!d) return !1;
|
|
1962
|
-
const c = i.endRow - i.startRow + 1, g = [], _ = [],
|
|
1986
|
+
const c = i.endRow - i.startRow + 1, g = [], _ = [], f = d.getRange();
|
|
1963
1987
|
g.push({
|
|
1964
1988
|
id: S.id,
|
|
1965
1989
|
params: {
|
|
@@ -1969,8 +1993,8 @@ const S = {
|
|
|
1969
1993
|
config: {
|
|
1970
1994
|
updateRange: {
|
|
1971
1995
|
newRange: {
|
|
1972
|
-
...
|
|
1973
|
-
endRow:
|
|
1996
|
+
...f,
|
|
1997
|
+
endRow: f.endRow - c
|
|
1974
1998
|
}
|
|
1975
1999
|
}
|
|
1976
2000
|
}
|
|
@@ -1983,21 +2007,21 @@ const S = {
|
|
|
1983
2007
|
tableId: d.getId(),
|
|
1984
2008
|
config: {
|
|
1985
2009
|
updateRange: {
|
|
1986
|
-
newRange: { ...
|
|
2010
|
+
newRange: { ...f }
|
|
1987
2011
|
}
|
|
1988
2012
|
}
|
|
1989
2013
|
}
|
|
1990
2014
|
});
|
|
1991
|
-
const
|
|
2015
|
+
const w = s.worksheet.getCellMatrix().getDataRange().endRow, R = fe(
|
|
1992
2016
|
t,
|
|
1993
2017
|
{
|
|
1994
2018
|
unitId: r,
|
|
1995
2019
|
subUnitId: a,
|
|
1996
2020
|
range: {
|
|
1997
2021
|
startRow: i.endRow + 1,
|
|
1998
|
-
endRow:
|
|
1999
|
-
startColumn:
|
|
2000
|
-
endColumn:
|
|
2022
|
+
endRow: w,
|
|
2023
|
+
startColumn: f.startColumn,
|
|
2024
|
+
endColumn: f.endColumn
|
|
2001
2025
|
}
|
|
2002
2026
|
},
|
|
2003
2027
|
{
|
|
@@ -2005,37 +2029,37 @@ const S = {
|
|
|
2005
2029
|
subUnitId: a,
|
|
2006
2030
|
range: {
|
|
2007
2031
|
startRow: i.startRow,
|
|
2008
|
-
endRow:
|
|
2009
|
-
startColumn:
|
|
2010
|
-
endColumn:
|
|
2032
|
+
endRow: w - c,
|
|
2033
|
+
startColumn: f.startColumn,
|
|
2034
|
+
endColumn: f.endColumn
|
|
2011
2035
|
}
|
|
2012
2036
|
}
|
|
2013
2037
|
);
|
|
2014
|
-
|
|
2015
|
-
const
|
|
2016
|
-
return E(g,
|
|
2038
|
+
R && (g.push(...R.redos), _.push(...R.undos));
|
|
2039
|
+
const O = t.get(D);
|
|
2040
|
+
return E(g, O) && t.get(L).pushUndoRedo({
|
|
2017
2041
|
unitID: r,
|
|
2018
2042
|
undoMutations: _,
|
|
2019
2043
|
redoMutations: g
|
|
2020
2044
|
}), !0;
|
|
2021
2045
|
}
|
|
2022
|
-
},
|
|
2046
|
+
}, Gn = {
|
|
2023
2047
|
id: "sheet.command.table-remove-col",
|
|
2024
|
-
type:
|
|
2048
|
+
type: y.COMMAND,
|
|
2025
2049
|
handler: (t, e) => {
|
|
2026
2050
|
if (!e)
|
|
2027
2051
|
return !1;
|
|
2028
|
-
const n = t.get(
|
|
2052
|
+
const n = t.get(A), s = $(n, e);
|
|
2029
2053
|
if (!s)
|
|
2030
2054
|
return !1;
|
|
2031
2055
|
const { workbook: r, unitId: a, subUnitId: o } = s;
|
|
2032
|
-
t.get(
|
|
2056
|
+
t.get(T);
|
|
2033
2057
|
const l = t.get(we).getCurrentSelections();
|
|
2034
2058
|
if (!l.length || l.length > 1)
|
|
2035
2059
|
return !1;
|
|
2036
2060
|
const h = l[0].range, c = t.get(W).getContainerTableWithRange(a, o, h);
|
|
2037
2061
|
if (!c) return !1;
|
|
2038
|
-
const g = h.endColumn - h.startColumn + 1, _ = [],
|
|
2062
|
+
const g = h.endColumn - h.startColumn + 1, _ = [], f = [], p = c.getRange();
|
|
2039
2063
|
_.push({
|
|
2040
2064
|
id: S.id,
|
|
2041
2065
|
params: {
|
|
@@ -2045,19 +2069,19 @@ const S = {
|
|
|
2045
2069
|
config: {
|
|
2046
2070
|
rowColOperation: {
|
|
2047
2071
|
operationType: M.Delete,
|
|
2048
|
-
rowColType:
|
|
2072
|
+
rowColType: N.Col,
|
|
2049
2073
|
index: h.startColumn,
|
|
2050
2074
|
count: g
|
|
2051
2075
|
}
|
|
2052
2076
|
}
|
|
2053
2077
|
}
|
|
2054
2078
|
});
|
|
2055
|
-
const
|
|
2079
|
+
const w = [], R = h.startColumn - p.startColumn;
|
|
2056
2080
|
for (let se = 0; se < g; se++) {
|
|
2057
|
-
const Ie = c.getTableInfo().columns[
|
|
2058
|
-
Ie &&
|
|
2081
|
+
const Ie = c.getTableInfo().columns[R + se];
|
|
2082
|
+
Ie && w.push(Ie);
|
|
2059
2083
|
}
|
|
2060
|
-
|
|
2084
|
+
f.push({
|
|
2061
2085
|
id: S.id,
|
|
2062
2086
|
params: {
|
|
2063
2087
|
unitId: a,
|
|
@@ -2066,15 +2090,15 @@ const S = {
|
|
|
2066
2090
|
config: {
|
|
2067
2091
|
rowColOperation: {
|
|
2068
2092
|
operationType: M.Insert,
|
|
2069
|
-
rowColType:
|
|
2093
|
+
rowColType: N.Col,
|
|
2070
2094
|
index: h.startColumn,
|
|
2071
2095
|
count: g,
|
|
2072
|
-
columnsJson:
|
|
2096
|
+
columnsJson: w
|
|
2073
2097
|
}
|
|
2074
2098
|
}
|
|
2075
2099
|
}
|
|
2076
2100
|
});
|
|
2077
|
-
const
|
|
2101
|
+
const I = s.worksheet.getCellMatrix().getDataRange().endColumn, v = fe(
|
|
2078
2102
|
t,
|
|
2079
2103
|
{
|
|
2080
2104
|
unitId: a,
|
|
@@ -2083,7 +2107,7 @@ const S = {
|
|
|
2083
2107
|
startRow: p.startRow,
|
|
2084
2108
|
endRow: p.endRow,
|
|
2085
2109
|
startColumn: h.endColumn + 1,
|
|
2086
|
-
endColumn:
|
|
2110
|
+
endColumn: I
|
|
2087
2111
|
}
|
|
2088
2112
|
},
|
|
2089
2113
|
{
|
|
@@ -2093,21 +2117,21 @@ const S = {
|
|
|
2093
2117
|
startRow: p.startRow,
|
|
2094
2118
|
endRow: p.endRow,
|
|
2095
2119
|
startColumn: h.startColumn,
|
|
2096
|
-
endColumn:
|
|
2120
|
+
endColumn: I - g
|
|
2097
2121
|
}
|
|
2098
2122
|
}
|
|
2099
2123
|
);
|
|
2100
|
-
v && (_.push(...v.redos),
|
|
2124
|
+
v && (_.push(...v.redos), f.push(...v.undos));
|
|
2101
2125
|
const ee = t.get(D);
|
|
2102
|
-
return E(_, ee) && t.get(
|
|
2126
|
+
return E(_, ee) && t.get(L).pushUndoRedo({
|
|
2103
2127
|
unitID: a,
|
|
2104
|
-
undoMutations:
|
|
2128
|
+
undoMutations: f,
|
|
2105
2129
|
redoMutations: _
|
|
2106
2130
|
}), !0;
|
|
2107
2131
|
}
|
|
2108
2132
|
};
|
|
2109
|
-
var
|
|
2110
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
2133
|
+
var jn = Object.getOwnPropertyDescriptor, zn = (t, e, n, s) => {
|
|
2134
|
+
for (var r = s > 1 ? void 0 : s ? jn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2111
2135
|
(o = t[a]) && (r = o(r) || r);
|
|
2112
2136
|
return r;
|
|
2113
2137
|
}, Ae = (t, e) => (n, s) => e(n, s, t);
|
|
@@ -2129,7 +2153,7 @@ let ce = class extends H {
|
|
|
2129
2153
|
), this.disposeWithMe(
|
|
2130
2154
|
this._tableManager.tableDelete$.subscribe((t) => {
|
|
2131
2155
|
const { unitId: e, tableName: n } = t;
|
|
2132
|
-
this._commandService.executeCommand(
|
|
2156
|
+
this._commandService.executeCommand(ve.id, {
|
|
2133
2157
|
unitId: e,
|
|
2134
2158
|
tableName: n
|
|
2135
2159
|
});
|
|
@@ -2137,7 +2161,7 @@ let ce = class extends H {
|
|
|
2137
2161
|
), this.disposeWithMe(
|
|
2138
2162
|
this._tableManager.tableNameChanged$.subscribe((t) => {
|
|
2139
2163
|
const { tableId: e, unitId: n, oldTableName: s } = t;
|
|
2140
|
-
this._commandService.executeCommand(
|
|
2164
|
+
this._commandService.executeCommand(ve.id, {
|
|
2141
2165
|
unitId: n,
|
|
2142
2166
|
tableName: s
|
|
2143
2167
|
});
|
|
@@ -2150,7 +2174,7 @@ let ce = class extends H {
|
|
|
2150
2174
|
const n = e.getTableInfo(), s = n.name, r = n.columns, a = /* @__PURE__ */ new Map();
|
|
2151
2175
|
r.forEach((o, u) => {
|
|
2152
2176
|
a.set(o.displayName, u);
|
|
2153
|
-
}), this._commandService.executeCommand(
|
|
2177
|
+
}), this._commandService.executeCommand(bt.id, {
|
|
2154
2178
|
unitId: t,
|
|
2155
2179
|
tableName: s,
|
|
2156
2180
|
reference: {
|
|
@@ -2161,15 +2185,15 @@ let ce = class extends H {
|
|
|
2161
2185
|
});
|
|
2162
2186
|
}
|
|
2163
2187
|
};
|
|
2164
|
-
ce =
|
|
2165
|
-
Ae(0,
|
|
2188
|
+
ce = zn([
|
|
2189
|
+
Ae(0, C(T)),
|
|
2166
2190
|
Ae(1, D)
|
|
2167
2191
|
], ce);
|
|
2168
|
-
var
|
|
2169
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
2192
|
+
var Kn = Object.getOwnPropertyDescriptor, Xn = (t, e, n, s) => {
|
|
2193
|
+
for (var r = s > 1 ? void 0 : s ? Kn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2170
2194
|
(o = t[a]) && (r = o(r) || r);
|
|
2171
2195
|
return r;
|
|
2172
|
-
},
|
|
2196
|
+
}, Le = (t, e) => (n, s) => e(n, s, t);
|
|
2173
2197
|
let de = class extends H {
|
|
2174
2198
|
constructor(t, e) {
|
|
2175
2199
|
super(), this._tableManager = t, this._exclusiveRangeService = e, this._initRangeListener();
|
|
@@ -2199,12 +2223,12 @@ let de = class extends H {
|
|
|
2199
2223
|
);
|
|
2200
2224
|
}
|
|
2201
2225
|
};
|
|
2202
|
-
de =
|
|
2203
|
-
|
|
2204
|
-
|
|
2226
|
+
de = Xn([
|
|
2227
|
+
Le(0, C(T)),
|
|
2228
|
+
Le(1, C(pt))
|
|
2205
2229
|
], de);
|
|
2206
|
-
var
|
|
2207
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
2230
|
+
var Zn = Object.getOwnPropertyDescriptor, es = (t, e, n, s) => {
|
|
2231
|
+
for (var r = s > 1 ? void 0 : s ? Zn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2208
2232
|
(o = t[a]) && (r = o(r) || r);
|
|
2209
2233
|
return r;
|
|
2210
2234
|
}, V = (t, e) => (n, s) => e(n, s, t);
|
|
@@ -2218,13 +2242,13 @@ let he = class extends H {
|
|
|
2218
2242
|
getMutations(e) {
|
|
2219
2243
|
const n = { redos: [], undos: [] }, { id: s, params: r } = e;
|
|
2220
2244
|
switch (s) {
|
|
2221
|
-
case
|
|
2245
|
+
case Tt.id:
|
|
2222
2246
|
return t._generateTableMutationWithInsertRow(r);
|
|
2223
|
-
case
|
|
2247
|
+
case Rt.id:
|
|
2224
2248
|
return t._generateTableMutationWithInsertCol(r);
|
|
2225
|
-
case
|
|
2249
|
+
case Ct.id:
|
|
2226
2250
|
return t._generateTableMutationWithRemoveRow(r);
|
|
2227
|
-
case
|
|
2251
|
+
case _t.id:
|
|
2228
2252
|
return t._generateTableMutationWithRemoveCol(r);
|
|
2229
2253
|
}
|
|
2230
2254
|
return n;
|
|
@@ -2232,7 +2256,7 @@ let he = class extends H {
|
|
|
2232
2256
|
});
|
|
2233
2257
|
}
|
|
2234
2258
|
_generateTableMutationWithInsertRow(t) {
|
|
2235
|
-
const e = [], n = [], s = $(this._univerInstanceService);
|
|
2259
|
+
const e = [], n = [], s = $(this._univerInstanceService, t);
|
|
2236
2260
|
if (!s)
|
|
2237
2261
|
return { undos: e, redos: n };
|
|
2238
2262
|
const { unitId: r, subUnitId: a } = s, o = this._tableManager.getTablesBySubunitId(r, a);
|
|
@@ -2277,7 +2301,7 @@ let he = class extends H {
|
|
|
2277
2301
|
}), { undos: e, redos: n };
|
|
2278
2302
|
}
|
|
2279
2303
|
_generateTableMutationWithInsertCol(t) {
|
|
2280
|
-
const e = [], n = [], s = $(this._univerInstanceService);
|
|
2304
|
+
const e = [], n = [], s = $(this._univerInstanceService, t);
|
|
2281
2305
|
if (!s)
|
|
2282
2306
|
return { undos: e, redos: n };
|
|
2283
2307
|
const { unitId: r, subUnitId: a } = s, o = this._tableManager.getTablesBySubunitId(r, a);
|
|
@@ -2297,7 +2321,7 @@ let he = class extends H {
|
|
|
2297
2321
|
config: {
|
|
2298
2322
|
rowColOperation: {
|
|
2299
2323
|
operationType: M.Insert,
|
|
2300
|
-
rowColType:
|
|
2324
|
+
rowColType: N.Col,
|
|
2301
2325
|
index: u.startColumn,
|
|
2302
2326
|
count: h
|
|
2303
2327
|
}
|
|
@@ -2312,7 +2336,7 @@ let he = class extends H {
|
|
|
2312
2336
|
config: {
|
|
2313
2337
|
rowColOperation: {
|
|
2314
2338
|
operationType: M.Delete,
|
|
2315
|
-
rowColType:
|
|
2339
|
+
rowColType: N.Col,
|
|
2316
2340
|
index: u.startColumn,
|
|
2317
2341
|
count: h
|
|
2318
2342
|
}
|
|
@@ -2435,12 +2459,12 @@ let he = class extends H {
|
|
|
2435
2459
|
tableId: d.getId()
|
|
2436
2460
|
}
|
|
2437
2461
|
});
|
|
2438
|
-
const g = d.toJSON(), { startRow: _, startColumn:
|
|
2439
|
-
if (!
|
|
2462
|
+
const g = d.toJSON(), { startRow: _, startColumn: f, endColumn: p } = g.range, w = this._univerInstanceService.getUnit(o), R = w == null ? void 0 : w.getSheetBySheetId(u);
|
|
2463
|
+
if (!R)
|
|
2440
2464
|
return { undos: e, redos: n, preRedos: s, preUndos: r };
|
|
2441
|
-
const
|
|
2442
|
-
for (let
|
|
2443
|
-
|
|
2465
|
+
const O = [];
|
|
2466
|
+
for (let I = f; I <= p; I++)
|
|
2467
|
+
O.push(Ze(R == null ? void 0 : R.getCell(_, I)) || te(I - f + 1, this._localeService.t("sheets-table.columnPrefix")));
|
|
2444
2468
|
e.push({
|
|
2445
2469
|
id: k.id,
|
|
2446
2470
|
params: {
|
|
@@ -2448,7 +2472,7 @@ let he = class extends H {
|
|
|
2448
2472
|
subUnitId: u,
|
|
2449
2473
|
tableId: g.id,
|
|
2450
2474
|
name: g.name,
|
|
2451
|
-
header:
|
|
2475
|
+
header: O,
|
|
2452
2476
|
range: g.range,
|
|
2453
2477
|
options: g.options
|
|
2454
2478
|
}
|
|
@@ -2464,7 +2488,7 @@ let he = class extends H {
|
|
|
2464
2488
|
config: {
|
|
2465
2489
|
rowColOperation: {
|
|
2466
2490
|
operationType: M.Delete,
|
|
2467
|
-
rowColType:
|
|
2491
|
+
rowColType: N.Col,
|
|
2468
2492
|
index: c.startColumn,
|
|
2469
2493
|
count: g
|
|
2470
2494
|
}
|
|
@@ -2472,8 +2496,8 @@ let he = class extends H {
|
|
|
2472
2496
|
}
|
|
2473
2497
|
});
|
|
2474
2498
|
const _ = [];
|
|
2475
|
-
for (let
|
|
2476
|
-
const p = d.getTableColumnByIndex(
|
|
2499
|
+
for (let f = 0; f < g; f++) {
|
|
2500
|
+
const p = d.getTableColumnByIndex(f);
|
|
2477
2501
|
p && _.push(p.toJSON());
|
|
2478
2502
|
}
|
|
2479
2503
|
e.push({
|
|
@@ -2485,7 +2509,7 @@ let he = class extends H {
|
|
|
2485
2509
|
config: {
|
|
2486
2510
|
rowColOperation: {
|
|
2487
2511
|
operationType: M.Insert,
|
|
2488
|
-
rowColType:
|
|
2512
|
+
rowColType: N.Col,
|
|
2489
2513
|
index: c.startColumn,
|
|
2490
2514
|
count: g,
|
|
2491
2515
|
columnsJson: _
|
|
@@ -2504,17 +2528,17 @@ let he = class extends H {
|
|
|
2504
2528
|
config: {
|
|
2505
2529
|
rowColOperation: {
|
|
2506
2530
|
operationType: M.Delete,
|
|
2507
|
-
rowColType:
|
|
2531
|
+
rowColType: N.Col,
|
|
2508
2532
|
index: i.startColumn,
|
|
2509
2533
|
count: g
|
|
2510
2534
|
}
|
|
2511
2535
|
}
|
|
2512
2536
|
}
|
|
2513
2537
|
});
|
|
2514
|
-
const _ = [],
|
|
2538
|
+
const _ = [], f = i.startColumn - c.startColumn;
|
|
2515
2539
|
for (let p = 0; p < g; p++) {
|
|
2516
|
-
const
|
|
2517
|
-
|
|
2540
|
+
const w = d.getTableColumnByIndex(p + f);
|
|
2541
|
+
w && _.push(w.toJSON());
|
|
2518
2542
|
}
|
|
2519
2543
|
e.push({
|
|
2520
2544
|
id: S.id,
|
|
@@ -2525,7 +2549,7 @@ let he = class extends H {
|
|
|
2525
2549
|
config: {
|
|
2526
2550
|
rowColOperation: {
|
|
2527
2551
|
operationType: M.Insert,
|
|
2528
|
-
rowColType:
|
|
2552
|
+
rowColType: N.Col,
|
|
2529
2553
|
index: i.startColumn,
|
|
2530
2554
|
count: h,
|
|
2531
2555
|
columnsJson: _
|
|
@@ -2543,7 +2567,7 @@ let he = class extends H {
|
|
|
2543
2567
|
config: {
|
|
2544
2568
|
rowColOperation: {
|
|
2545
2569
|
operationType: M.Delete,
|
|
2546
|
-
rowColType:
|
|
2570
|
+
rowColType: N.Col,
|
|
2547
2571
|
index: i.startColumn,
|
|
2548
2572
|
count: h
|
|
2549
2573
|
}
|
|
@@ -2551,8 +2575,8 @@ let he = class extends H {
|
|
|
2551
2575
|
}
|
|
2552
2576
|
});
|
|
2553
2577
|
const g = [], _ = i.startColumn - c.startColumn;
|
|
2554
|
-
for (let
|
|
2555
|
-
const p = d.getTableColumnByIndex(
|
|
2578
|
+
for (let f = 0; f < h; f++) {
|
|
2579
|
+
const p = d.getTableColumnByIndex(f + _);
|
|
2556
2580
|
p && g.push(p.toJSON());
|
|
2557
2581
|
}
|
|
2558
2582
|
e.push({
|
|
@@ -2564,7 +2588,7 @@ let he = class extends H {
|
|
|
2564
2588
|
config: {
|
|
2565
2589
|
rowColOperation: {
|
|
2566
2590
|
operationType: M.Insert,
|
|
2567
|
-
rowColType:
|
|
2591
|
+
rowColType: N.Col,
|
|
2568
2592
|
index: i.startColumn,
|
|
2569
2593
|
count: h,
|
|
2570
2594
|
columnsJson: g
|
|
@@ -2578,7 +2602,7 @@ let he = class extends H {
|
|
|
2578
2602
|
}
|
|
2579
2603
|
_initCommandListener() {
|
|
2580
2604
|
this._commandService.onCommandExecuted((t) => {
|
|
2581
|
-
if (t.id ===
|
|
2605
|
+
if (t.id === Ye.id) {
|
|
2582
2606
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endRow - r.startRow + 1;
|
|
2583
2607
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2584
2608
|
const l = u.getRange();
|
|
@@ -2590,7 +2614,7 @@ let he = class extends H {
|
|
|
2590
2614
|
}
|
|
2591
2615
|
});
|
|
2592
2616
|
});
|
|
2593
|
-
} else if (t.id ===
|
|
2617
|
+
} else if (t.id === je.id) {
|
|
2594
2618
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endColumn - r.startColumn + 1;
|
|
2595
2619
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2596
2620
|
const l = u.getRange();
|
|
@@ -2602,7 +2626,7 @@ let he = class extends H {
|
|
|
2602
2626
|
}
|
|
2603
2627
|
});
|
|
2604
2628
|
});
|
|
2605
|
-
} else if (t.id ===
|
|
2629
|
+
} else if (t.id === Ge.id) {
|
|
2606
2630
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endRow - r.startRow + 1;
|
|
2607
2631
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2608
2632
|
const l = u.getRange();
|
|
@@ -2614,7 +2638,7 @@ let he = class extends H {
|
|
|
2614
2638
|
}
|
|
2615
2639
|
});
|
|
2616
2640
|
});
|
|
2617
|
-
} else if (t.id ===
|
|
2641
|
+
} else if (t.id === ze.id) {
|
|
2618
2642
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endColumn - r.startColumn + 1;
|
|
2619
2643
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2620
2644
|
const l = u.getRange();
|
|
@@ -2630,17 +2654,17 @@ let he = class extends H {
|
|
|
2630
2654
|
});
|
|
2631
2655
|
}
|
|
2632
2656
|
};
|
|
2633
|
-
he =
|
|
2634
|
-
V(0,
|
|
2635
|
-
V(1,
|
|
2636
|
-
V(2,
|
|
2637
|
-
V(3,
|
|
2638
|
-
V(4,
|
|
2639
|
-
V(5,
|
|
2640
|
-
V(6,
|
|
2657
|
+
he = es([
|
|
2658
|
+
V(0, C(D)),
|
|
2659
|
+
V(1, C(St)),
|
|
2660
|
+
V(2, C(A)),
|
|
2661
|
+
V(3, C(He)),
|
|
2662
|
+
V(4, C(Re)),
|
|
2663
|
+
V(5, C(T)),
|
|
2664
|
+
V(6, C(be))
|
|
2641
2665
|
], he);
|
|
2642
|
-
var
|
|
2643
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
2666
|
+
var ts = Object.getOwnPropertyDescriptor, ns = (t, e, n, s) => {
|
|
2667
|
+
for (var r = s > 1 ? void 0 : s ? ts(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2644
2668
|
(o = t[a]) && (r = o(r) || r);
|
|
2645
2669
|
return r;
|
|
2646
2670
|
}, oe = (t, e) => (n, s) => e(n, s, t);
|
|
@@ -2700,12 +2724,12 @@ let ge = class extends H {
|
|
|
2700
2724
|
);
|
|
2701
2725
|
}
|
|
2702
2726
|
_initUserTableTheme() {
|
|
2703
|
-
const e = this._configService.getConfig(
|
|
2704
|
-
this._defaultThemeIndex = n, this._allThemes = s.concat(
|
|
2727
|
+
const e = this._configService.getConfig(tt) || {}, n = e.defaultThemeIndex || 0, s = e.userThemes || [];
|
|
2728
|
+
this._defaultThemeIndex = n, this._allThemes = s.concat(nt);
|
|
2705
2729
|
}
|
|
2706
2730
|
_initDefaultTableTheme() {
|
|
2707
2731
|
for (let e = 0; e < this._allThemes.length; e++) {
|
|
2708
|
-
const { name: n, style: s } = this._allThemes[e], r = new
|
|
2732
|
+
const { name: n, style: s } = this._allThemes[e], r = new Mt(n, s);
|
|
2709
2733
|
this._sheetRangeThemeModel.registerDefaultRangeTheme(r);
|
|
2710
2734
|
}
|
|
2711
2735
|
}
|
|
@@ -2713,21 +2737,21 @@ let ge = class extends H {
|
|
|
2713
2737
|
super.dispose(), this._allThemes = [], this._defaultThemeIndex = 0;
|
|
2714
2738
|
}
|
|
2715
2739
|
};
|
|
2716
|
-
ge =
|
|
2717
|
-
oe(0,
|
|
2718
|
-
oe(1,
|
|
2719
|
-
oe(2,
|
|
2720
|
-
oe(3,
|
|
2740
|
+
ge = ns([
|
|
2741
|
+
oe(0, C(T)),
|
|
2742
|
+
oe(1, C(It)),
|
|
2743
|
+
oe(2, C(Qe)),
|
|
2744
|
+
oe(3, Ve)
|
|
2721
2745
|
], ge);
|
|
2722
|
-
var
|
|
2723
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
2746
|
+
var ss = Object.getOwnPropertyDescriptor, rs = (t, e, n, s) => {
|
|
2747
|
+
for (var r = s > 1 ? void 0 : s ? ss(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2724
2748
|
(o = t[a]) && (r = o(r) || r);
|
|
2725
2749
|
return r;
|
|
2726
2750
|
}, ie = (t, e) => (n, s) => e(n, s, t);
|
|
2727
2751
|
let me = class extends H {
|
|
2728
2752
|
constructor(e, n, s, r) {
|
|
2729
2753
|
super();
|
|
2730
|
-
b(this, "_tableFilteredOutRows$", new
|
|
2754
|
+
b(this, "_tableFilteredOutRows$", new Ke(/* @__PURE__ */ new Set()));
|
|
2731
2755
|
b(this, "tableFilteredOutRows$", this._tableFilteredOutRows$.asObservable());
|
|
2732
2756
|
b(this, "_subscription", null);
|
|
2733
2757
|
this._tableManager = e, this._sheetInterceptorService = n, this._univerInstanceService = s, this._zebraCrossingCacheController = r, this.registerFilterChangeEvent(), this.initTableHiddenRowIntercept(), this._initFilteredOutRows();
|
|
@@ -2739,7 +2763,7 @@ let me = class extends H {
|
|
|
2739
2763
|
this._tableFilteredOutRows$.next(e);
|
|
2740
2764
|
}
|
|
2741
2765
|
initTableHiddenRowIntercept() {
|
|
2742
|
-
this.disposeWithMe(this._sheetInterceptorService.intercept(
|
|
2766
|
+
this.disposeWithMe(this._sheetInterceptorService.intercept(qe.ROW_FILTERED, {
|
|
2743
2767
|
// 这里需要保证优先级高于sheet的筛选,因为筛选没有next,低于筛选的不会触发interceptor
|
|
2744
2768
|
priority: 100,
|
|
2745
2769
|
handler: (e, n, s) => {
|
|
@@ -2752,9 +2776,9 @@ let me = class extends H {
|
|
|
2752
2776
|
_initFilteredOutRows() {
|
|
2753
2777
|
this._tableManager.tableInitStatus$.pipe(
|
|
2754
2778
|
pe((e) => e),
|
|
2755
|
-
|
|
2779
|
+
Fe(() => this._univerInstanceService.getCurrentTypeOfUnit$(j.UNIVER_SHEET)),
|
|
2756
2780
|
pe((e) => e != null),
|
|
2757
|
-
|
|
2781
|
+
Fe((e) => e.activeSheet$),
|
|
2758
2782
|
pe((e) => e != null)
|
|
2759
2783
|
).subscribe(() => {
|
|
2760
2784
|
const e = $(this._univerInstanceService);
|
|
@@ -2790,30 +2814,30 @@ let me = class extends H {
|
|
|
2790
2814
|
super.dispose(), (e = this._subscription) == null || e.unsubscribe();
|
|
2791
2815
|
}
|
|
2792
2816
|
};
|
|
2793
|
-
me =
|
|
2794
|
-
ie(0,
|
|
2795
|
-
ie(1,
|
|
2796
|
-
ie(2,
|
|
2797
|
-
ie(3,
|
|
2817
|
+
me = rs([
|
|
2818
|
+
ie(0, C(T)),
|
|
2819
|
+
ie(1, C(Re)),
|
|
2820
|
+
ie(2, C(A)),
|
|
2821
|
+
ie(3, C(vt))
|
|
2798
2822
|
], me);
|
|
2799
|
-
var
|
|
2800
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
2823
|
+
var as = Object.getOwnPropertyDescriptor, os = (t, e, n, s) => {
|
|
2824
|
+
for (var r = s > 1 ? void 0 : s ? as(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2801
2825
|
(o = t[a]) && (r = o(r) || r);
|
|
2802
2826
|
return r;
|
|
2803
2827
|
}, Se = (t, e) => (n, s) => e(n, s, t), le;
|
|
2804
|
-
let Ee = (le = class extends
|
|
2828
|
+
let Ee = (le = class extends ht {
|
|
2805
2829
|
constructor(t = De, e, n, s) {
|
|
2806
2830
|
super(), this._config = t, this._injector = e, this._configService = n, this._commandService = s;
|
|
2807
|
-
const { ...r } =
|
|
2831
|
+
const { ...r } = gt(
|
|
2808
2832
|
{},
|
|
2809
2833
|
De,
|
|
2810
2834
|
this._config
|
|
2811
2835
|
);
|
|
2812
|
-
this._configService.setConfig(
|
|
2836
|
+
this._configService.setConfig(tt, r), this._initRegisterCommand();
|
|
2813
2837
|
}
|
|
2814
2838
|
onStarting() {
|
|
2815
|
-
|
|
2816
|
-
[
|
|
2839
|
+
mt(this._injector, [
|
|
2840
|
+
[T],
|
|
2817
2841
|
[ge],
|
|
2818
2842
|
[W],
|
|
2819
2843
|
[X],
|
|
@@ -2833,63 +2857,63 @@ let Ee = (le = class extends ct {
|
|
|
2833
2857
|
[X],
|
|
2834
2858
|
[me]
|
|
2835
2859
|
]), Me(this._injector, [
|
|
2836
|
-
[
|
|
2860
|
+
[T]
|
|
2837
2861
|
]);
|
|
2838
2862
|
}
|
|
2839
2863
|
_initRegisterCommand() {
|
|
2840
2864
|
[
|
|
2841
|
-
|
|
2865
|
+
Ln,
|
|
2842
2866
|
k,
|
|
2843
|
-
|
|
2867
|
+
En,
|
|
2844
2868
|
Q,
|
|
2845
|
-
|
|
2869
|
+
Ce,
|
|
2846
2870
|
Bn,
|
|
2847
|
-
|
|
2871
|
+
Jn,
|
|
2848
2872
|
S,
|
|
2849
|
-
|
|
2850
|
-
Vn,
|
|
2873
|
+
Pn,
|
|
2851
2874
|
qn,
|
|
2852
|
-
Jn,
|
|
2853
2875
|
kn,
|
|
2854
|
-
Qn
|
|
2876
|
+
Qn,
|
|
2877
|
+
Yn,
|
|
2878
|
+
Gn
|
|
2855
2879
|
].forEach((t) => this._commandService.registerCommand(t));
|
|
2856
2880
|
}
|
|
2857
|
-
}, b(le, "pluginName",
|
|
2858
|
-
Ee =
|
|
2859
|
-
Se(1,
|
|
2860
|
-
Se(2,
|
|
2861
|
-
Se(3,
|
|
2881
|
+
}, b(le, "pluginName", at), b(le, "type", j.UNIVER_SHEET), le);
|
|
2882
|
+
Ee = os([
|
|
2883
|
+
Se(1, C(He)),
|
|
2884
|
+
Se(2, Ve),
|
|
2885
|
+
Se(3, C(D))
|
|
2862
2886
|
], Ee);
|
|
2863
2887
|
export {
|
|
2864
|
-
|
|
2888
|
+
Ln as AddSheetTableCommand,
|
|
2865
2889
|
k as AddSheetTableMutation,
|
|
2866
|
-
|
|
2867
|
-
|
|
2890
|
+
Pn as AddTableThemeCommand,
|
|
2891
|
+
En as DeleteSheetTableCommand,
|
|
2868
2892
|
Q as DeleteSheetTableMutation,
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2893
|
+
qn as RemoveTableThemeCommand,
|
|
2894
|
+
Wn as SHEET_TABLE_CUSTOM_THEME_PREFIX,
|
|
2895
|
+
Jn as SetSheetTableCommand,
|
|
2872
2896
|
Bn as SetSheetTableFilterCommand,
|
|
2873
|
-
|
|
2897
|
+
Ce as SetSheetTableFilterMutation,
|
|
2874
2898
|
S as SetSheetTableMutation,
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2899
|
+
Qn as SheetTableInsertColCommand,
|
|
2900
|
+
kn as SheetTableInsertRowCommand,
|
|
2901
|
+
Gn as SheetTableRemoveColCommand,
|
|
2902
|
+
Yn as SheetTableRemoveRowCommand,
|
|
2879
2903
|
X as SheetTableService,
|
|
2880
2904
|
q as SheetsTableButtonStateEnum,
|
|
2881
2905
|
W as SheetsTableController,
|
|
2882
2906
|
G as SheetsTableSortStateEnum,
|
|
2883
|
-
|
|
2907
|
+
Xe as TableColumnDataTypeEnum,
|
|
2884
2908
|
ne as TableColumnFilterTypeEnum,
|
|
2885
|
-
|
|
2909
|
+
U as TableConditionTypeEnum,
|
|
2886
2910
|
m as TableDateCompareTypeEnum,
|
|
2887
|
-
|
|
2911
|
+
T as TableManager,
|
|
2888
2912
|
F as TableNumberCompareTypeEnum,
|
|
2889
2913
|
P as TableStringCompareTypeEnum,
|
|
2890
2914
|
Ee as UniverSheetsTablePlugin,
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2915
|
+
ms as customEmptyThemeWithBorderStyle,
|
|
2916
|
+
yt as isConditionFilter,
|
|
2917
|
+
gs as isManualFilter,
|
|
2918
|
+
bs as processStyleWithBorderStyle
|
|
2895
2919
|
};
|