@univerjs/sheets-table 0.12.4 → 0.13.0-insiders.20251215-64041bb
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 +421 -396
- package/lib/index.js +421 -396
- package/lib/types/util.d.ts +11 -1
- package/lib/umd/index.js +1 -1
- package/package.json +6 -6
- 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 L, IUniverInstanceService as A, Inject as R, LocaleService as be, Disposable as H, CommandType as y, IUndoRedoService as E, ICommandService as D, customNameCharacterCheck as Le, sequenceExecute as B, 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 Ce, INTERCEPTOR_POINT as qe, RemoveSheetCommand as ft, CopySheetCommand as wt, AddRangeThemeMutation as Je, RemoveRangeThemeMutation as ke, SheetRangeThemeModel as Qe, SheetsSelectionsService as fe, InsertRowMutation as Ye, RemoveRowMutation as Ge, getMoveRangeUndoRedoMutations as we, InsertColMutation as je, RemoveColMutation as ze, IExclusiveRangeService as pt, RefRangeService as St, RemoveColCommand as _t, RemoveRowCommand as Rt, InsertColCommand as Ct, 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());
|
|
53
|
+
});
|
|
54
|
+
const u = s == null ? void 0 : s.getTableList(t);
|
|
55
|
+
u && u.length > 0 && u.forEach((i) => {
|
|
56
|
+
a.add(i.name);
|
|
57
|
+
});
|
|
58
|
+
const l = r == null ? void 0 : r.getDefinedNameMap(t);
|
|
59
|
+
return l && Object.values(l).forEach((i) => {
|
|
60
|
+
a.add(i.name);
|
|
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, Et = (t) => t.getMonth() === 1, Bt = (t) => t.getMonth() === 2, Lt = (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 Et;
|
|
371
385
|
case m.M3:
|
|
372
|
-
return At;
|
|
373
|
-
case m.M4:
|
|
374
386
|
return Bt;
|
|
387
|
+
case m.M4:
|
|
388
|
+
return Lt;
|
|
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, fn = (t, e) => t < e, wn = (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) => fn(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) => wn(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), Rn = (t, e) => Z(`*${e}*`).test(t), Cn = (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) => Sn(e, t.expectedValue);
|
|
569
|
-
case P.NotContains:
|
|
570
582
|
return (e) => Rn(e, t.expectedValue);
|
|
583
|
+
case P.NotContains:
|
|
584
|
+
return (e) => Cn(e, t.expectedValue);
|
|
571
585
|
case P.StartsWith:
|
|
572
|
-
return (e) =>
|
|
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
|
}
|
|
@@ -754,7 +768,7 @@ class Ue {
|
|
|
754
768
|
const i = l - r;
|
|
755
769
|
let h, d;
|
|
756
770
|
(u = n.columns) != null && u[i] ? (h = n.columns[i].id, d = n.columns[i].displayName) : (h = L(), d = e[l - r]);
|
|
757
|
-
const c = new
|
|
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
|
/**
|
|
@@ -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"),
|
|
1094
|
-
i != null && i[c] &&
|
|
1107
|
+
const g = this._localeService.t("sheets-table.columnPrefix"), _ = new z(L(), te(r.getColumnsCount() + 1 + c, g));
|
|
1108
|
+
i != null && i[c] && _.fromJSON(i[c]);
|
|
1095
1109
|
const w = u + c - h.startColumn;
|
|
1096
|
-
r.insertColumn(w,
|
|
1110
|
+
r.insertColumn(w, _);
|
|
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(L(), 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(L(), te(r.getColumnsCount() + 1, "Column")));
|
|
1141
1155
|
}
|
|
1142
1156
|
r.setRange(o), this._tableRangeChanged$.next({
|
|
1143
1157
|
unitId: e,
|
|
@@ -1218,23 +1232,24 @@ let C = class extends H {
|
|
|
1218
1232
|
}), this._tableInitStatus.next(!0);
|
|
1219
1233
|
}
|
|
1220
1234
|
deleteUnitId(e) {
|
|
1221
|
-
this._tableMap.
|
|
1235
|
+
const n = this._tableMap.get(e);
|
|
1236
|
+
n && n.forEach((s) => s.dispose()), this._tableMap.delete(e);
|
|
1222
1237
|
}
|
|
1223
1238
|
dispose() {
|
|
1224
|
-
super.dispose(), this._tableMap.forEach((e) => {
|
|
1239
|
+
super.dispose(), this._tableAdd$.complete(), this._tableDelete$.complete(), this._tableNameChanged$.complete(), this._tableRangeChanged$.complete(), this._tableThemeChanged$.complete(), this._tableFilterChanged$.complete(), this._tableInitStatus.complete(), this._tableMap.forEach((e) => {
|
|
1225
1240
|
e.forEach((n) => n.dispose()), e.clear();
|
|
1226
1241
|
}), this._tableMap.clear();
|
|
1227
1242
|
}
|
|
1228
1243
|
};
|
|
1229
|
-
|
|
1230
|
-
$e(0,
|
|
1231
|
-
$e(1,
|
|
1232
|
-
],
|
|
1233
|
-
var
|
|
1234
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
1244
|
+
T = On([
|
|
1245
|
+
$e(0, A),
|
|
1246
|
+
$e(1, R(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--)
|
|
1235
1250
|
(o = t[a]) && (r = o(r) || r);
|
|
1236
1251
|
return r;
|
|
1237
|
-
},
|
|
1252
|
+
}, An = (t, e) => (n, s) => e(n, s, t);
|
|
1238
1253
|
let X = class extends H {
|
|
1239
1254
|
constructor(t) {
|
|
1240
1255
|
super(), this._tableManager = t;
|
|
@@ -1275,54 +1290,64 @@ let X = class extends H {
|
|
|
1275
1290
|
addFilter(t, e, n, s) {
|
|
1276
1291
|
this._tableManager.addFilter(t, e, n, s);
|
|
1277
1292
|
}
|
|
1278
|
-
getCellValueWithConditionType(t, e, n, s =
|
|
1293
|
+
getCellValueWithConditionType(t, e, n, s = U.String) {
|
|
1279
1294
|
return ue(t, e, n, s);
|
|
1280
1295
|
}
|
|
1281
1296
|
};
|
|
1282
|
-
X =
|
|
1283
|
-
|
|
1297
|
+
X = $n([
|
|
1298
|
+
An(0, R(T))
|
|
1284
1299
|
], X);
|
|
1285
1300
|
const k = {
|
|
1286
1301
|
id: "sheet.mutation.add-table",
|
|
1287
|
-
type:
|
|
1302
|
+
type: y.MUTATION,
|
|
1288
1303
|
handler: (t, e) => {
|
|
1289
1304
|
const { tableId: n, unitId: s, subUnitId: r, name: a, range: o, header: u, options: l } = e;
|
|
1290
1305
|
return t.get(X).addTable(s, r, a, o, u, n, l), !0;
|
|
1291
1306
|
}
|
|
1292
1307
|
}, Q = {
|
|
1293
1308
|
id: "sheet.mutation.delete-table",
|
|
1294
|
-
type:
|
|
1309
|
+
type: y.MUTATION,
|
|
1295
1310
|
handler: (t, e) => {
|
|
1296
1311
|
const { unitId: n, subUnitId: s, tableId: r } = e;
|
|
1297
1312
|
return t.get(X).deleteTable(n, s, r), !0;
|
|
1298
1313
|
}
|
|
1299
|
-
},
|
|
1314
|
+
}, En = {
|
|
1300
1315
|
id: "sheet.command.add-table",
|
|
1301
|
-
type:
|
|
1316
|
+
type: y.COMMAND,
|
|
1302
1317
|
handler: (t, e) => {
|
|
1303
|
-
var
|
|
1318
|
+
var p;
|
|
1304
1319
|
if (!e)
|
|
1305
1320
|
return !1;
|
|
1306
|
-
const n = t.get(
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1321
|
+
const n = t.get(E), s = t.get(D), r = t.get(be), a = t.get(T), o = (p = e.id) != null ? p : L(), 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 || !Le(l, u)) {
|
|
1328
|
+
const f = r.t("sheets-table.tablePrefix");
|
|
1329
|
+
let C = a.getTableList(e.unitId).length + 1;
|
|
1330
|
+
for (const O of u)
|
|
1331
|
+
if (O.startsWith(f)) {
|
|
1332
|
+
const I = Number(O.slice(f.length));
|
|
1333
|
+
Number.isInteger(I) && I >= C && (C = I + 1);
|
|
1334
|
+
}
|
|
1335
|
+
l = `${f}${C}`;
|
|
1311
1336
|
}
|
|
1312
|
-
const
|
|
1313
|
-
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 } }), B(i, s) && n.pushUndoRedo({
|
|
1314
1339
|
unitID: e.unitId,
|
|
1315
|
-
undoMutations:
|
|
1316
|
-
redoMutations:
|
|
1340
|
+
undoMutations: h,
|
|
1341
|
+
redoMutations: i
|
|
1317
1342
|
}), !0;
|
|
1318
1343
|
}
|
|
1319
|
-
},
|
|
1344
|
+
}, Bn = {
|
|
1320
1345
|
id: "sheet.command.delete-table",
|
|
1321
|
-
type:
|
|
1346
|
+
type: y.COMMAND,
|
|
1322
1347
|
handler: (t, e) => {
|
|
1323
1348
|
if (!e)
|
|
1324
1349
|
return !1;
|
|
1325
|
-
const n = t.get(
|
|
1350
|
+
const n = t.get(E), 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();
|
|
1326
1351
|
return i ? (o.push({ id: Q.id, params: { ...e } }), u.push({
|
|
1327
1352
|
id: k.id,
|
|
1328
1353
|
params: {
|
|
@@ -1333,35 +1358,35 @@ const k = {
|
|
|
1333
1358
|
range: i.range,
|
|
1334
1359
|
options: i.options
|
|
1335
1360
|
}
|
|
1336
|
-
}),
|
|
1361
|
+
}), B(o, s) && n.pushUndoRedo({
|
|
1337
1362
|
unitID: e.unitId,
|
|
1338
1363
|
undoMutations: u,
|
|
1339
1364
|
redoMutations: o
|
|
1340
1365
|
}), !0) : (a.error("[TableManager]: Table not found"), !1);
|
|
1341
1366
|
}
|
|
1342
|
-
},
|
|
1367
|
+
}, Re = {
|
|
1343
1368
|
id: "sheet.mutation.set-table-filter",
|
|
1344
|
-
type:
|
|
1369
|
+
type: y.MUTATION,
|
|
1345
1370
|
handler: (t, e) => {
|
|
1346
1371
|
const { tableId: n, unitId: s, column: r, tableFilter: a } = e;
|
|
1347
|
-
return t.get(
|
|
1372
|
+
return t.get(T).addFilter(s, n, r, a), !0;
|
|
1348
1373
|
}
|
|
1349
|
-
},
|
|
1374
|
+
}, Ln = {
|
|
1350
1375
|
id: "sheet.command.set-table-filter",
|
|
1351
|
-
type:
|
|
1376
|
+
type: y.COMMAND,
|
|
1352
1377
|
handler: (t, e) => {
|
|
1353
1378
|
if (!e)
|
|
1354
1379
|
return !1;
|
|
1355
|
-
const n = t.get(
|
|
1356
|
-
return a.push({ id:
|
|
1380
|
+
const n = t.get(E), s = t.get(D), r = e.tableId || L(), a = [], o = [];
|
|
1381
|
+
return a.push({ id: Re.id, params: { ...e, tableId: r } }), o.push({ id: Re.id, params: { ...e, tableId: r, tableFilter: void 0 } }), B(a, s) && n.pushUndoRedo({
|
|
1357
1382
|
unitID: e.unitId,
|
|
1358
1383
|
undoMutations: o,
|
|
1359
1384
|
redoMutations: a
|
|
1360
1385
|
}), !0;
|
|
1361
1386
|
}
|
|
1362
|
-
},
|
|
1363
|
-
var
|
|
1364
|
-
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--)
|
|
1365
1390
|
(o = t[a]) && (r = o(r) || r);
|
|
1366
1391
|
return r;
|
|
1367
1392
|
}, ae = (t, e) => (n, s) => e(n, s, t);
|
|
@@ -1374,13 +1399,13 @@ let W = class extends H {
|
|
|
1374
1399
|
getContainerTableWithRange(e, n, s) {
|
|
1375
1400
|
const r = this._ensureTableRangeRTree(e), o = Array.from(r.bulkSearch([{ unitId: e, sheetId: n, range: s }])).find((u) => {
|
|
1376
1401
|
const l = this._tableManager.getTable(e, String(u));
|
|
1377
|
-
return l ?
|
|
1402
|
+
return l ? _e.contains(l.getRange(), s) : !1;
|
|
1378
1403
|
});
|
|
1379
1404
|
if (o)
|
|
1380
1405
|
return this._tableManager.getTable(e, String(o));
|
|
1381
1406
|
}
|
|
1382
1407
|
_ensureTableRangeRTree(e) {
|
|
1383
|
-
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);
|
|
1384
1409
|
}
|
|
1385
1410
|
registerTableChangeEvent() {
|
|
1386
1411
|
this.disposeWithMe(
|
|
@@ -1422,8 +1447,8 @@ let W = class extends H {
|
|
|
1422
1447
|
}
|
|
1423
1448
|
registerTableHeaderInterceptor() {
|
|
1424
1449
|
this.disposeWithMe(
|
|
1425
|
-
this._sheetInterceptorService.intercept(
|
|
1426
|
-
effect:
|
|
1450
|
+
this._sheetInterceptorService.intercept(qe.CELL_CONTENT, {
|
|
1451
|
+
effect: dt.Value,
|
|
1427
1452
|
handler: (e, n, s) => {
|
|
1428
1453
|
const { row: r, col: a, unitId: o, subUnitId: u } = n, l = this._ensureTableRangeRTree(o);
|
|
1429
1454
|
if ((e == null ? void 0 : e.v) === void 0 && l) {
|
|
@@ -1465,8 +1490,8 @@ let W = class extends H {
|
|
|
1465
1490
|
return {};
|
|
1466
1491
|
}
|
|
1467
1492
|
},
|
|
1468
|
-
businesses: [
|
|
1469
|
-
pluginName:
|
|
1493
|
+
businesses: [j.UNIVER_SHEET],
|
|
1494
|
+
pluginName: at,
|
|
1470
1495
|
onLoad: (e, n) => {
|
|
1471
1496
|
this._fromJSON(e, n);
|
|
1472
1497
|
},
|
|
@@ -1482,8 +1507,8 @@ let W = class extends H {
|
|
|
1482
1507
|
// eslint-disable-next-line max-lines-per-function
|
|
1483
1508
|
getMutations: (e) => {
|
|
1484
1509
|
var n;
|
|
1485
|
-
if (e.id ===
|
|
1486
|
-
const s = e.params, r = s.unitId || this._univerInstanceService.getCurrentUnitOfType(
|
|
1510
|
+
if (e.id === ft.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());
|
|
1487
1512
|
if (!r || !a)
|
|
1488
1513
|
return { redos: [], undos: [] };
|
|
1489
1514
|
const o = this._tableManager.getTablesBySubunitId(r, a);
|
|
@@ -1515,7 +1540,7 @@ let W = class extends H {
|
|
|
1515
1540
|
}
|
|
1516
1541
|
});
|
|
1517
1542
|
}), { redos: u, undos: l };
|
|
1518
|
-
} else if (e.id ===
|
|
1543
|
+
} else if (e.id === wt.id) {
|
|
1519
1544
|
const s = e.params, { unitId: r, subUnitId: a, targetSubUnitId: o } = s;
|
|
1520
1545
|
if (!r || !a || !o)
|
|
1521
1546
|
return { redos: [], undos: [] };
|
|
@@ -1561,32 +1586,32 @@ let W = class extends H {
|
|
|
1561
1586
|
super.dispose(), this._tableRangeRTree.clear();
|
|
1562
1587
|
}
|
|
1563
1588
|
};
|
|
1564
|
-
W =
|
|
1565
|
-
ae(0,
|
|
1566
|
-
ae(1,
|
|
1567
|
-
ae(2,
|
|
1568
|
-
ae(3,
|
|
1589
|
+
W = Vn([
|
|
1590
|
+
ae(0, R(A)),
|
|
1591
|
+
ae(1, R(Ce)),
|
|
1592
|
+
ae(2, R(T)),
|
|
1593
|
+
ae(3, R(ut))
|
|
1569
1594
|
], W);
|
|
1570
1595
|
const S = {
|
|
1571
1596
|
id: "sheet.mutation.set-sheet-table",
|
|
1572
|
-
type:
|
|
1597
|
+
type: y.MUTATION,
|
|
1573
1598
|
handler: (t, e) => {
|
|
1574
1599
|
if (!e)
|
|
1575
1600
|
return !1;
|
|
1576
1601
|
const { unitId: n, tableId: s, config: r } = e;
|
|
1577
|
-
return t.get(
|
|
1602
|
+
return t.get(T).setTableByConfig(n, s, r), !0;
|
|
1578
1603
|
}
|
|
1579
|
-
},
|
|
1604
|
+
}, Pn = {
|
|
1580
1605
|
id: "sheet.command.add-table-theme",
|
|
1581
|
-
type:
|
|
1606
|
+
type: y.COMMAND,
|
|
1582
1607
|
handler: (t, e) => {
|
|
1583
1608
|
if (!e)
|
|
1584
1609
|
return !1;
|
|
1585
|
-
const n = t.get(
|
|
1610
|
+
const n = t.get(T), { unitId: s, tableId: r, themeStyle: a } = e, o = [], u = [], l = n.getTableById(s, r);
|
|
1586
1611
|
if (!l) return !1;
|
|
1587
1612
|
const i = l.getSubunitId();
|
|
1588
1613
|
o.push({
|
|
1589
|
-
id:
|
|
1614
|
+
id: Je.id,
|
|
1590
1615
|
params: {
|
|
1591
1616
|
unitId: s,
|
|
1592
1617
|
subUnitId: i,
|
|
@@ -1613,7 +1638,7 @@ const S = {
|
|
|
1613
1638
|
}
|
|
1614
1639
|
}
|
|
1615
1640
|
}), u.push({
|
|
1616
|
-
id:
|
|
1641
|
+
id: ke.id,
|
|
1617
1642
|
params: {
|
|
1618
1643
|
unitId: s,
|
|
1619
1644
|
subUnitId: i,
|
|
@@ -1621,49 +1646,49 @@ const S = {
|
|
|
1621
1646
|
}
|
|
1622
1647
|
});
|
|
1623
1648
|
const h = t.get(D);
|
|
1624
|
-
return
|
|
1649
|
+
return B(o, h) && t.get(E).pushUndoRedo({
|
|
1625
1650
|
unitID: s,
|
|
1626
1651
|
undoMutations: u,
|
|
1627
1652
|
redoMutations: o
|
|
1628
1653
|
}), !0;
|
|
1629
1654
|
}
|
|
1630
|
-
},
|
|
1655
|
+
}, qn = {
|
|
1631
1656
|
id: "sheet.command.remove-table-theme",
|
|
1632
|
-
type:
|
|
1657
|
+
type: y.COMMAND,
|
|
1633
1658
|
handler: (t, e) => {
|
|
1634
1659
|
if (!e)
|
|
1635
1660
|
return !1;
|
|
1636
|
-
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);
|
|
1637
1662
|
if (!u) return !1;
|
|
1638
1663
|
const l = u.getSubunitId(), i = [], h = [], d = o.getRegisteredRangeThemes().filter((f) => f == null ? void 0 : f.startsWith("table-default"));
|
|
1639
|
-
let g = o.getRegisteredRangeThemes().filter((f) => f == null ? void 0 : f.startsWith(
|
|
1640
|
-
g || (g = d[0]), i.push({ id: S.id, params: { unitId: n, subUnitId: l, tableId: s, config: { theme: g } } }), i.push({ id:
|
|
1641
|
-
const
|
|
1642
|
-
|
|
1664
|
+
let g = o.getRegisteredRangeThemes().filter((f) => f == null ? void 0 : f.startsWith(Wn)).find((f) => f !== 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 } });
|
|
1666
|
+
const _ = o.getDefaultRangeThemeStyle(r);
|
|
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 } } }));
|
|
1643
1668
|
const w = t.get(D);
|
|
1644
|
-
return
|
|
1669
|
+
return B(i, w) && t.get(E).pushUndoRedo({
|
|
1645
1670
|
unitID: n,
|
|
1646
1671
|
redoMutations: i,
|
|
1647
1672
|
undoMutations: h
|
|
1648
1673
|
}), !0;
|
|
1649
1674
|
}
|
|
1650
|
-
},
|
|
1675
|
+
}, Jn = {
|
|
1651
1676
|
id: "sheet.command.set-table-config",
|
|
1652
|
-
type:
|
|
1677
|
+
type: y.COMMAND,
|
|
1653
1678
|
// eslint-disable-next-line max-lines-per-function
|
|
1654
1679
|
handler: (t, e) => {
|
|
1655
1680
|
if (!e)
|
|
1656
1681
|
return !1;
|
|
1657
|
-
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);
|
|
1658
1683
|
if (!i) return !1;
|
|
1659
|
-
const h = {}, d = {}, c = t.get(be),
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
if (!
|
|
1666
|
-
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 (!Le(r, g))
|
|
1691
|
+
return t.get(We).warn(c.t("sheets-table.tableNameError")), !1;
|
|
1667
1692
|
h.name = i.getDisplayName(), d.name = r;
|
|
1668
1693
|
}
|
|
1669
1694
|
o && (h.rowColOperation = {
|
|
@@ -1674,13 +1699,13 @@ const S = {
|
|
|
1674
1699
|
}, d.rowColOperation = o), a && (h.updateRange = {
|
|
1675
1700
|
newRange: i.getRange()
|
|
1676
1701
|
}, d.updateRange = a), u && (h.theme = i.getTableStyleId(), d.theme = u);
|
|
1677
|
-
const
|
|
1702
|
+
const _ = {
|
|
1678
1703
|
unitId: n,
|
|
1679
1704
|
subUnitId: i.getSubunitId(),
|
|
1680
1705
|
tableId: s,
|
|
1681
1706
|
config: d
|
|
1682
1707
|
};
|
|
1683
|
-
return t.get(D).executeCommand(S.id,
|
|
1708
|
+
return t.get(D).executeCommand(S.id, _), t.get(E).pushUndoRedo({
|
|
1684
1709
|
unitID: n,
|
|
1685
1710
|
undoMutations: [
|
|
1686
1711
|
{
|
|
@@ -1696,28 +1721,28 @@ const S = {
|
|
|
1696
1721
|
redoMutations: [
|
|
1697
1722
|
{
|
|
1698
1723
|
id: S.id,
|
|
1699
|
-
params:
|
|
1724
|
+
params: _
|
|
1700
1725
|
}
|
|
1701
1726
|
]
|
|
1702
1727
|
}), !0;
|
|
1703
1728
|
}
|
|
1704
|
-
},
|
|
1729
|
+
}, kn = {
|
|
1705
1730
|
id: "sheet.command.table-insert-row",
|
|
1706
|
-
type:
|
|
1731
|
+
type: y.COMMAND,
|
|
1707
1732
|
handler: (t) => {
|
|
1708
|
-
const e = t.get(
|
|
1733
|
+
const e = t.get(A), n = $(e);
|
|
1709
1734
|
if (!n)
|
|
1710
1735
|
return !1;
|
|
1711
|
-
const { workbook: s, worksheet: r, unitId: a, subUnitId: o } = n, l = t.get(
|
|
1736
|
+
const { workbook: s, worksheet: r, unitId: a, subUnitId: o } = n, l = t.get(fe).getCurrentSelections();
|
|
1712
1737
|
if (!l.length || l.length > 1)
|
|
1713
1738
|
return !1;
|
|
1714
|
-
t.get(
|
|
1739
|
+
t.get(T);
|
|
1715
1740
|
const h = l[0].range, c = t.get(W).getContainerTableWithRange(a, o, h);
|
|
1716
1741
|
if (!c) return !1;
|
|
1717
|
-
const g = h.endRow - h.startRow + 1, w = r.getRowCount() - 1, p = r.getCellMatrix().getDataRange().endRow, f = [],
|
|
1742
|
+
const g = h.endRow - h.startRow + 1, w = r.getRowCount() - 1, p = r.getCellMatrix().getDataRange().endRow, f = [], C = [];
|
|
1718
1743
|
if (w - p < g)
|
|
1719
1744
|
f.push({
|
|
1720
|
-
id:
|
|
1745
|
+
id: Ye.id,
|
|
1721
1746
|
params: {
|
|
1722
1747
|
unitId: a,
|
|
1723
1748
|
subUnitId: o,
|
|
@@ -1738,7 +1763,7 @@ const S = {
|
|
|
1738
1763
|
}
|
|
1739
1764
|
}
|
|
1740
1765
|
}
|
|
1741
|
-
}),
|
|
1766
|
+
}), C.push({
|
|
1742
1767
|
id: S.id,
|
|
1743
1768
|
params: {
|
|
1744
1769
|
unitId: a,
|
|
@@ -1750,8 +1775,8 @@ const S = {
|
|
|
1750
1775
|
}
|
|
1751
1776
|
}
|
|
1752
1777
|
}
|
|
1753
|
-
}),
|
|
1754
|
-
id:
|
|
1778
|
+
}), C.push({
|
|
1779
|
+
id: Ge.id,
|
|
1755
1780
|
params: {
|
|
1756
1781
|
unitId: a,
|
|
1757
1782
|
subUnitId: o,
|
|
@@ -1775,7 +1800,7 @@ const S = {
|
|
|
1775
1800
|
}
|
|
1776
1801
|
}
|
|
1777
1802
|
}
|
|
1778
|
-
}),
|
|
1803
|
+
}), C.push({
|
|
1779
1804
|
id: S.id,
|
|
1780
1805
|
params: {
|
|
1781
1806
|
unitId: a,
|
|
@@ -1788,7 +1813,7 @@ const S = {
|
|
|
1788
1813
|
}
|
|
1789
1814
|
}
|
|
1790
1815
|
});
|
|
1791
|
-
const ee =
|
|
1816
|
+
const ee = we(
|
|
1792
1817
|
t,
|
|
1793
1818
|
{
|
|
1794
1819
|
unitId: a,
|
|
@@ -1811,31 +1836,31 @@ const S = {
|
|
|
1811
1836
|
}
|
|
1812
1837
|
}
|
|
1813
1838
|
);
|
|
1814
|
-
ee && (f.push(...ee.redos),
|
|
1839
|
+
ee && (f.push(...ee.redos), C.push(...ee.undos));
|
|
1815
1840
|
}
|
|
1816
|
-
const
|
|
1817
|
-
return
|
|
1841
|
+
const O = t.get(D);
|
|
1842
|
+
return B(f, O) && t.get(E).pushUndoRedo({
|
|
1818
1843
|
unitID: a,
|
|
1819
|
-
undoMutations:
|
|
1844
|
+
undoMutations: C,
|
|
1820
1845
|
redoMutations: f
|
|
1821
1846
|
}), !0;
|
|
1822
1847
|
}
|
|
1823
|
-
},
|
|
1848
|
+
}, Qn = {
|
|
1824
1849
|
id: "sheet.command.table-insert-col",
|
|
1825
|
-
type:
|
|
1850
|
+
type: y.COMMAND,
|
|
1826
1851
|
handler: (t) => {
|
|
1827
|
-
const e = t.get(
|
|
1852
|
+
const e = t.get(A), n = $(e);
|
|
1828
1853
|
if (!n)
|
|
1829
1854
|
return !1;
|
|
1830
|
-
const { worksheet: s, unitId: r, subUnitId: a } = n, u = t.get(
|
|
1855
|
+
const { worksheet: s, unitId: r, subUnitId: a } = n, u = t.get(fe).getCurrentSelections();
|
|
1831
1856
|
if (!u.length || u.length > 1)
|
|
1832
1857
|
return !1;
|
|
1833
1858
|
const i = u[0].range, d = t.get(W).getContainerTableWithRange(r, a, i);
|
|
1834
1859
|
if (!d) return !1;
|
|
1835
|
-
const c = i.endColumn - i.startColumn + 1,
|
|
1836
|
-
if (
|
|
1860
|
+
const c = i.endColumn - i.startColumn + 1, _ = s.getColumnCount() - 1, w = s.getCellMatrix().getDataRange().endColumn, p = [], f = [];
|
|
1861
|
+
if (_ - w < c)
|
|
1837
1862
|
p.push({
|
|
1838
|
-
id:
|
|
1863
|
+
id: je.id,
|
|
1839
1864
|
params: {
|
|
1840
1865
|
unitId: r,
|
|
1841
1866
|
subUnitId: a,
|
|
@@ -1850,7 +1875,7 @@ const S = {
|
|
|
1850
1875
|
config: {
|
|
1851
1876
|
rowColOperation: {
|
|
1852
1877
|
operationType: M.Insert,
|
|
1853
|
-
rowColType:
|
|
1878
|
+
rowColType: N.Col,
|
|
1854
1879
|
index: i.startColumn,
|
|
1855
1880
|
count: c
|
|
1856
1881
|
}
|
|
@@ -1865,14 +1890,14 @@ const S = {
|
|
|
1865
1890
|
config: {
|
|
1866
1891
|
rowColOperation: {
|
|
1867
1892
|
operationType: M.Delete,
|
|
1868
|
-
rowColType:
|
|
1893
|
+
rowColType: N.Col,
|
|
1869
1894
|
index: i.startColumn,
|
|
1870
1895
|
count: c
|
|
1871
1896
|
}
|
|
1872
1897
|
}
|
|
1873
1898
|
}
|
|
1874
1899
|
}), f.push({
|
|
1875
|
-
id:
|
|
1900
|
+
id: ze.id,
|
|
1876
1901
|
params: {
|
|
1877
1902
|
unitId: r,
|
|
1878
1903
|
subUnitId: a,
|
|
@@ -1880,7 +1905,7 @@ const S = {
|
|
|
1880
1905
|
}
|
|
1881
1906
|
});
|
|
1882
1907
|
else {
|
|
1883
|
-
const
|
|
1908
|
+
const I = d.getRange();
|
|
1884
1909
|
p.push({
|
|
1885
1910
|
id: S.id,
|
|
1886
1911
|
params: {
|
|
@@ -1890,7 +1915,7 @@ const S = {
|
|
|
1890
1915
|
config: {
|
|
1891
1916
|
rowColOperation: {
|
|
1892
1917
|
operationType: M.Insert,
|
|
1893
|
-
rowColType:
|
|
1918
|
+
rowColType: N.Col,
|
|
1894
1919
|
index: i.startColumn,
|
|
1895
1920
|
count: c
|
|
1896
1921
|
}
|
|
@@ -1905,21 +1930,21 @@ const S = {
|
|
|
1905
1930
|
config: {
|
|
1906
1931
|
rowColOperation: {
|
|
1907
1932
|
operationType: M.Delete,
|
|
1908
|
-
rowColType:
|
|
1933
|
+
rowColType: N.Col,
|
|
1909
1934
|
index: i.startColumn,
|
|
1910
1935
|
count: c
|
|
1911
1936
|
}
|
|
1912
1937
|
}
|
|
1913
1938
|
}
|
|
1914
1939
|
});
|
|
1915
|
-
const v =
|
|
1940
|
+
const v = we(
|
|
1916
1941
|
t,
|
|
1917
1942
|
{
|
|
1918
1943
|
unitId: r,
|
|
1919
1944
|
subUnitId: a,
|
|
1920
1945
|
range: {
|
|
1921
|
-
startRow:
|
|
1922
|
-
endRow:
|
|
1946
|
+
startRow: I.startRow,
|
|
1947
|
+
endRow: I.endRow,
|
|
1923
1948
|
startColumn: i.startColumn,
|
|
1924
1949
|
endColumn: w
|
|
1925
1950
|
}
|
|
@@ -1928,8 +1953,8 @@ const S = {
|
|
|
1928
1953
|
unitId: r,
|
|
1929
1954
|
subUnitId: a,
|
|
1930
1955
|
range: {
|
|
1931
|
-
startRow:
|
|
1932
|
-
endRow:
|
|
1956
|
+
startRow: I.startRow,
|
|
1957
|
+
endRow: I.endRow,
|
|
1933
1958
|
startColumn: i.startColumn + c,
|
|
1934
1959
|
endColumn: w + c
|
|
1935
1960
|
}
|
|
@@ -1937,28 +1962,28 @@ const S = {
|
|
|
1937
1962
|
);
|
|
1938
1963
|
v && (p.push(...v.redos), f.push(...v.undos));
|
|
1939
1964
|
}
|
|
1940
|
-
const
|
|
1941
|
-
return
|
|
1965
|
+
const C = t.get(D);
|
|
1966
|
+
return B(p, C) && t.get(E).pushUndoRedo({
|
|
1942
1967
|
unitID: r,
|
|
1943
1968
|
undoMutations: f,
|
|
1944
1969
|
redoMutations: p
|
|
1945
1970
|
}), !0;
|
|
1946
1971
|
}
|
|
1947
|
-
},
|
|
1972
|
+
}, Yn = {
|
|
1948
1973
|
id: "sheet.command.table-remove-row",
|
|
1949
|
-
type:
|
|
1974
|
+
type: y.COMMAND,
|
|
1950
1975
|
handler: (t, e) => {
|
|
1951
1976
|
if (!e)
|
|
1952
1977
|
return !1;
|
|
1953
|
-
const n = t.get(
|
|
1978
|
+
const n = t.get(A), s = $(n);
|
|
1954
1979
|
if (!s)
|
|
1955
1980
|
return !1;
|
|
1956
|
-
const { unitId: r, subUnitId: a } = s, u = t.get(
|
|
1981
|
+
const { unitId: r, subUnitId: a } = s, u = t.get(fe).getCurrentSelections();
|
|
1957
1982
|
if (!u.length || u.length > 1)
|
|
1958
1983
|
return !1;
|
|
1959
1984
|
const i = u[0].range, d = t.get(W).getContainerTableWithRange(r, a, i);
|
|
1960
1985
|
if (!d) return !1;
|
|
1961
|
-
const c = i.endRow - i.startRow + 1, g = [],
|
|
1986
|
+
const c = i.endRow - i.startRow + 1, g = [], _ = [], w = d.getRange();
|
|
1962
1987
|
g.push({
|
|
1963
1988
|
id: S.id,
|
|
1964
1989
|
params: {
|
|
@@ -1974,7 +1999,7 @@ const S = {
|
|
|
1974
1999
|
}
|
|
1975
2000
|
}
|
|
1976
2001
|
}
|
|
1977
|
-
}),
|
|
2002
|
+
}), _.push({
|
|
1978
2003
|
id: S.id,
|
|
1979
2004
|
params: {
|
|
1980
2005
|
unitId: r,
|
|
@@ -1987,7 +2012,7 @@ const S = {
|
|
|
1987
2012
|
}
|
|
1988
2013
|
}
|
|
1989
2014
|
});
|
|
1990
|
-
const f = s.worksheet.getCellMatrix().getDataRange().endRow,
|
|
2015
|
+
const f = s.worksheet.getCellMatrix().getDataRange().endRow, C = we(
|
|
1991
2016
|
t,
|
|
1992
2017
|
{
|
|
1993
2018
|
unitId: r,
|
|
@@ -2010,32 +2035,32 @@ const S = {
|
|
|
2010
2035
|
}
|
|
2011
2036
|
}
|
|
2012
2037
|
);
|
|
2013
|
-
|
|
2014
|
-
const
|
|
2015
|
-
return
|
|
2038
|
+
C && (g.push(...C.redos), _.push(...C.undos));
|
|
2039
|
+
const O = t.get(D);
|
|
2040
|
+
return B(g, O) && t.get(E).pushUndoRedo({
|
|
2016
2041
|
unitID: r,
|
|
2017
|
-
undoMutations:
|
|
2042
|
+
undoMutations: _,
|
|
2018
2043
|
redoMutations: g
|
|
2019
2044
|
}), !0;
|
|
2020
2045
|
}
|
|
2021
|
-
},
|
|
2046
|
+
}, Gn = {
|
|
2022
2047
|
id: "sheet.command.table-remove-col",
|
|
2023
|
-
type:
|
|
2048
|
+
type: y.COMMAND,
|
|
2024
2049
|
handler: (t, e) => {
|
|
2025
2050
|
if (!e)
|
|
2026
2051
|
return !1;
|
|
2027
|
-
const n = t.get(
|
|
2052
|
+
const n = t.get(A), s = $(n);
|
|
2028
2053
|
if (!s)
|
|
2029
2054
|
return !1;
|
|
2030
2055
|
const { workbook: r, unitId: a, subUnitId: o } = s;
|
|
2031
|
-
t.get(
|
|
2032
|
-
const l = t.get(
|
|
2056
|
+
t.get(T);
|
|
2057
|
+
const l = t.get(fe).getCurrentSelections();
|
|
2033
2058
|
if (!l.length || l.length > 1)
|
|
2034
2059
|
return !1;
|
|
2035
2060
|
const h = l[0].range, c = t.get(W).getContainerTableWithRange(a, o, h);
|
|
2036
2061
|
if (!c) return !1;
|
|
2037
|
-
const g = h.endColumn - h.startColumn + 1,
|
|
2038
|
-
|
|
2062
|
+
const g = h.endColumn - h.startColumn + 1, _ = [], w = [], p = c.getRange();
|
|
2063
|
+
_.push({
|
|
2039
2064
|
id: S.id,
|
|
2040
2065
|
params: {
|
|
2041
2066
|
unitId: a,
|
|
@@ -2044,16 +2069,16 @@ const S = {
|
|
|
2044
2069
|
config: {
|
|
2045
2070
|
rowColOperation: {
|
|
2046
2071
|
operationType: M.Delete,
|
|
2047
|
-
rowColType:
|
|
2072
|
+
rowColType: N.Col,
|
|
2048
2073
|
index: h.startColumn,
|
|
2049
2074
|
count: g
|
|
2050
2075
|
}
|
|
2051
2076
|
}
|
|
2052
2077
|
}
|
|
2053
2078
|
});
|
|
2054
|
-
const f = [],
|
|
2079
|
+
const f = [], C = h.startColumn - p.startColumn;
|
|
2055
2080
|
for (let se = 0; se < g; se++) {
|
|
2056
|
-
const Ie = c.getTableInfo().columns[
|
|
2081
|
+
const Ie = c.getTableInfo().columns[C + se];
|
|
2057
2082
|
Ie && f.push(Ie);
|
|
2058
2083
|
}
|
|
2059
2084
|
w.push({
|
|
@@ -2065,7 +2090,7 @@ const S = {
|
|
|
2065
2090
|
config: {
|
|
2066
2091
|
rowColOperation: {
|
|
2067
2092
|
operationType: M.Insert,
|
|
2068
|
-
rowColType:
|
|
2093
|
+
rowColType: N.Col,
|
|
2069
2094
|
index: h.startColumn,
|
|
2070
2095
|
count: g,
|
|
2071
2096
|
columnsJson: f
|
|
@@ -2073,7 +2098,7 @@ const S = {
|
|
|
2073
2098
|
}
|
|
2074
2099
|
}
|
|
2075
2100
|
});
|
|
2076
|
-
const
|
|
2101
|
+
const I = s.worksheet.getCellMatrix().getDataRange().endColumn, v = we(
|
|
2077
2102
|
t,
|
|
2078
2103
|
{
|
|
2079
2104
|
unitId: a,
|
|
@@ -2082,7 +2107,7 @@ const S = {
|
|
|
2082
2107
|
startRow: p.startRow,
|
|
2083
2108
|
endRow: p.endRow,
|
|
2084
2109
|
startColumn: h.endColumn + 1,
|
|
2085
|
-
endColumn:
|
|
2110
|
+
endColumn: I
|
|
2086
2111
|
}
|
|
2087
2112
|
},
|
|
2088
2113
|
{
|
|
@@ -2092,21 +2117,21 @@ const S = {
|
|
|
2092
2117
|
startRow: p.startRow,
|
|
2093
2118
|
endRow: p.endRow,
|
|
2094
2119
|
startColumn: h.startColumn,
|
|
2095
|
-
endColumn:
|
|
2120
|
+
endColumn: I - g
|
|
2096
2121
|
}
|
|
2097
2122
|
}
|
|
2098
2123
|
);
|
|
2099
|
-
v && (
|
|
2124
|
+
v && (_.push(...v.redos), w.push(...v.undos));
|
|
2100
2125
|
const ee = t.get(D);
|
|
2101
|
-
return
|
|
2126
|
+
return B(_, ee) && t.get(E).pushUndoRedo({
|
|
2102
2127
|
unitID: a,
|
|
2103
2128
|
undoMutations: w,
|
|
2104
|
-
redoMutations:
|
|
2129
|
+
redoMutations: _
|
|
2105
2130
|
}), !0;
|
|
2106
2131
|
}
|
|
2107
2132
|
};
|
|
2108
|
-
var
|
|
2109
|
-
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--)
|
|
2110
2135
|
(o = t[a]) && (r = o(r) || r);
|
|
2111
2136
|
return r;
|
|
2112
2137
|
}, Ae = (t, e) => (n, s) => e(n, s, t);
|
|
@@ -2128,7 +2153,7 @@ let ce = class extends H {
|
|
|
2128
2153
|
), this.disposeWithMe(
|
|
2129
2154
|
this._tableManager.tableDelete$.subscribe((t) => {
|
|
2130
2155
|
const { unitId: e, tableName: n } = t;
|
|
2131
|
-
this._commandService.executeCommand(
|
|
2156
|
+
this._commandService.executeCommand(ve.id, {
|
|
2132
2157
|
unitId: e,
|
|
2133
2158
|
tableName: n
|
|
2134
2159
|
});
|
|
@@ -2136,7 +2161,7 @@ let ce = class extends H {
|
|
|
2136
2161
|
), this.disposeWithMe(
|
|
2137
2162
|
this._tableManager.tableNameChanged$.subscribe((t) => {
|
|
2138
2163
|
const { tableId: e, unitId: n, oldTableName: s } = t;
|
|
2139
|
-
this._commandService.executeCommand(
|
|
2164
|
+
this._commandService.executeCommand(ve.id, {
|
|
2140
2165
|
unitId: n,
|
|
2141
2166
|
tableName: s
|
|
2142
2167
|
});
|
|
@@ -2149,7 +2174,7 @@ let ce = class extends H {
|
|
|
2149
2174
|
const n = e.getTableInfo(), s = n.name, r = n.columns, a = /* @__PURE__ */ new Map();
|
|
2150
2175
|
r.forEach((o, u) => {
|
|
2151
2176
|
a.set(o.displayName, u);
|
|
2152
|
-
}), this._commandService.executeCommand(
|
|
2177
|
+
}), this._commandService.executeCommand(bt.id, {
|
|
2153
2178
|
unitId: t,
|
|
2154
2179
|
tableName: s,
|
|
2155
2180
|
reference: {
|
|
@@ -2160,15 +2185,15 @@ let ce = class extends H {
|
|
|
2160
2185
|
});
|
|
2161
2186
|
}
|
|
2162
2187
|
};
|
|
2163
|
-
ce =
|
|
2164
|
-
Ae(0,
|
|
2188
|
+
ce = zn([
|
|
2189
|
+
Ae(0, R(T)),
|
|
2165
2190
|
Ae(1, D)
|
|
2166
2191
|
], ce);
|
|
2167
|
-
var
|
|
2168
|
-
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--)
|
|
2169
2194
|
(o = t[a]) && (r = o(r) || r);
|
|
2170
2195
|
return r;
|
|
2171
|
-
},
|
|
2196
|
+
}, Ee = (t, e) => (n, s) => e(n, s, t);
|
|
2172
2197
|
let de = class extends H {
|
|
2173
2198
|
constructor(t, e) {
|
|
2174
2199
|
super(), this._tableManager = t, this._exclusiveRangeService = e, this._initRangeListener();
|
|
@@ -2198,12 +2223,12 @@ let de = class extends H {
|
|
|
2198
2223
|
);
|
|
2199
2224
|
}
|
|
2200
2225
|
};
|
|
2201
|
-
de =
|
|
2202
|
-
|
|
2203
|
-
|
|
2226
|
+
de = Xn([
|
|
2227
|
+
Ee(0, R(T)),
|
|
2228
|
+
Ee(1, R(pt))
|
|
2204
2229
|
], de);
|
|
2205
|
-
var
|
|
2206
|
-
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--)
|
|
2207
2232
|
(o = t[a]) && (r = o(r) || r);
|
|
2208
2233
|
return r;
|
|
2209
2234
|
}, V = (t, e) => (n, s) => e(n, s, t);
|
|
@@ -2217,13 +2242,13 @@ let he = class extends H {
|
|
|
2217
2242
|
getMutations(e) {
|
|
2218
2243
|
const n = { redos: [], undos: [] }, { id: s, params: r } = e;
|
|
2219
2244
|
switch (s) {
|
|
2220
|
-
case
|
|
2245
|
+
case Tt.id:
|
|
2221
2246
|
return t._generateTableMutationWithInsertRow(r);
|
|
2222
|
-
case
|
|
2247
|
+
case Ct.id:
|
|
2223
2248
|
return t._generateTableMutationWithInsertCol(r);
|
|
2224
|
-
case
|
|
2249
|
+
case Rt.id:
|
|
2225
2250
|
return t._generateTableMutationWithRemoveRow(r);
|
|
2226
|
-
case
|
|
2251
|
+
case _t.id:
|
|
2227
2252
|
return t._generateTableMutationWithRemoveCol(r);
|
|
2228
2253
|
}
|
|
2229
2254
|
return n;
|
|
@@ -2296,7 +2321,7 @@ let he = class extends H {
|
|
|
2296
2321
|
config: {
|
|
2297
2322
|
rowColOperation: {
|
|
2298
2323
|
operationType: M.Insert,
|
|
2299
|
-
rowColType:
|
|
2324
|
+
rowColType: N.Col,
|
|
2300
2325
|
index: u.startColumn,
|
|
2301
2326
|
count: h
|
|
2302
2327
|
}
|
|
@@ -2311,7 +2336,7 @@ let he = class extends H {
|
|
|
2311
2336
|
config: {
|
|
2312
2337
|
rowColOperation: {
|
|
2313
2338
|
operationType: M.Delete,
|
|
2314
|
-
rowColType:
|
|
2339
|
+
rowColType: N.Col,
|
|
2315
2340
|
index: u.startColumn,
|
|
2316
2341
|
count: h
|
|
2317
2342
|
}
|
|
@@ -2331,7 +2356,7 @@ let he = class extends H {
|
|
|
2331
2356
|
const { range: i } = t, h = i.endRow - i.startRow + 1;
|
|
2332
2357
|
return l.forEach((d) => {
|
|
2333
2358
|
const c = d.getRange();
|
|
2334
|
-
if (
|
|
2359
|
+
if (_e.intersects(c, i))
|
|
2335
2360
|
if (i.startRow <= c.startRow && i.endRow >= c.startRow) {
|
|
2336
2361
|
s.push({
|
|
2337
2362
|
id: Q.id,
|
|
@@ -2424,7 +2449,7 @@ let he = class extends H {
|
|
|
2424
2449
|
const { range: i } = t, h = i.endColumn - i.startColumn + 1;
|
|
2425
2450
|
return l.forEach((d) => {
|
|
2426
2451
|
const c = d.getRange();
|
|
2427
|
-
if (
|
|
2452
|
+
if (_e.intersects(c, i)) {
|
|
2428
2453
|
if (i.startColumn <= c.startColumn && i.endColumn >= c.endColumn) {
|
|
2429
2454
|
s.push({
|
|
2430
2455
|
id: Q.id,
|
|
@@ -2434,12 +2459,12 @@ let he = class extends H {
|
|
|
2434
2459
|
tableId: d.getId()
|
|
2435
2460
|
}
|
|
2436
2461
|
});
|
|
2437
|
-
const g = d.toJSON(), { startRow:
|
|
2438
|
-
if (!
|
|
2462
|
+
const g = d.toJSON(), { startRow: _, startColumn: w, endColumn: p } = g.range, f = this._univerInstanceService.getUnit(o), C = f == null ? void 0 : f.getSheetBySheetId(u);
|
|
2463
|
+
if (!C)
|
|
2439
2464
|
return { undos: e, redos: n, preRedos: s, preUndos: r };
|
|
2440
|
-
const
|
|
2441
|
-
for (let
|
|
2442
|
-
|
|
2465
|
+
const O = [];
|
|
2466
|
+
for (let I = w; I <= p; I++)
|
|
2467
|
+
O.push(Ze(C == null ? void 0 : C.getCell(_, I)) || te(I - w + 1, this._localeService.t("sheets-table.columnPrefix")));
|
|
2443
2468
|
e.push({
|
|
2444
2469
|
id: k.id,
|
|
2445
2470
|
params: {
|
|
@@ -2447,7 +2472,7 @@ let he = class extends H {
|
|
|
2447
2472
|
subUnitId: u,
|
|
2448
2473
|
tableId: g.id,
|
|
2449
2474
|
name: g.name,
|
|
2450
|
-
header:
|
|
2475
|
+
header: O,
|
|
2451
2476
|
range: g.range,
|
|
2452
2477
|
options: g.options
|
|
2453
2478
|
}
|
|
@@ -2463,17 +2488,17 @@ let he = class extends H {
|
|
|
2463
2488
|
config: {
|
|
2464
2489
|
rowColOperation: {
|
|
2465
2490
|
operationType: M.Delete,
|
|
2466
|
-
rowColType:
|
|
2491
|
+
rowColType: N.Col,
|
|
2467
2492
|
index: c.startColumn,
|
|
2468
2493
|
count: g
|
|
2469
2494
|
}
|
|
2470
2495
|
}
|
|
2471
2496
|
}
|
|
2472
2497
|
});
|
|
2473
|
-
const
|
|
2498
|
+
const _ = [];
|
|
2474
2499
|
for (let w = 0; w < g; w++) {
|
|
2475
2500
|
const p = d.getTableColumnByIndex(w);
|
|
2476
|
-
p &&
|
|
2501
|
+
p && _.push(p.toJSON());
|
|
2477
2502
|
}
|
|
2478
2503
|
e.push({
|
|
2479
2504
|
id: S.id,
|
|
@@ -2484,10 +2509,10 @@ let he = class extends H {
|
|
|
2484
2509
|
config: {
|
|
2485
2510
|
rowColOperation: {
|
|
2486
2511
|
operationType: M.Insert,
|
|
2487
|
-
rowColType:
|
|
2512
|
+
rowColType: N.Col,
|
|
2488
2513
|
index: c.startColumn,
|
|
2489
2514
|
count: g,
|
|
2490
|
-
columnsJson:
|
|
2515
|
+
columnsJson: _
|
|
2491
2516
|
}
|
|
2492
2517
|
}
|
|
2493
2518
|
}
|
|
@@ -2503,17 +2528,17 @@ let he = class extends H {
|
|
|
2503
2528
|
config: {
|
|
2504
2529
|
rowColOperation: {
|
|
2505
2530
|
operationType: M.Delete,
|
|
2506
|
-
rowColType:
|
|
2531
|
+
rowColType: N.Col,
|
|
2507
2532
|
index: i.startColumn,
|
|
2508
2533
|
count: g
|
|
2509
2534
|
}
|
|
2510
2535
|
}
|
|
2511
2536
|
}
|
|
2512
2537
|
});
|
|
2513
|
-
const
|
|
2538
|
+
const _ = [], w = i.startColumn - c.startColumn;
|
|
2514
2539
|
for (let p = 0; p < g; p++) {
|
|
2515
2540
|
const f = d.getTableColumnByIndex(p + w);
|
|
2516
|
-
f &&
|
|
2541
|
+
f && _.push(f.toJSON());
|
|
2517
2542
|
}
|
|
2518
2543
|
e.push({
|
|
2519
2544
|
id: S.id,
|
|
@@ -2524,10 +2549,10 @@ let he = class extends H {
|
|
|
2524
2549
|
config: {
|
|
2525
2550
|
rowColOperation: {
|
|
2526
2551
|
operationType: M.Insert,
|
|
2527
|
-
rowColType:
|
|
2552
|
+
rowColType: N.Col,
|
|
2528
2553
|
index: i.startColumn,
|
|
2529
2554
|
count: h,
|
|
2530
|
-
columnsJson:
|
|
2555
|
+
columnsJson: _
|
|
2531
2556
|
}
|
|
2532
2557
|
}
|
|
2533
2558
|
}
|
|
@@ -2542,16 +2567,16 @@ let he = class extends H {
|
|
|
2542
2567
|
config: {
|
|
2543
2568
|
rowColOperation: {
|
|
2544
2569
|
operationType: M.Delete,
|
|
2545
|
-
rowColType:
|
|
2570
|
+
rowColType: N.Col,
|
|
2546
2571
|
index: i.startColumn,
|
|
2547
2572
|
count: h
|
|
2548
2573
|
}
|
|
2549
2574
|
}
|
|
2550
2575
|
}
|
|
2551
2576
|
});
|
|
2552
|
-
const g = [],
|
|
2577
|
+
const g = [], _ = i.startColumn - c.startColumn;
|
|
2553
2578
|
for (let w = 0; w < h; w++) {
|
|
2554
|
-
const p = d.getTableColumnByIndex(w +
|
|
2579
|
+
const p = d.getTableColumnByIndex(w + _);
|
|
2555
2580
|
p && g.push(p.toJSON());
|
|
2556
2581
|
}
|
|
2557
2582
|
e.push({
|
|
@@ -2563,7 +2588,7 @@ let he = class extends H {
|
|
|
2563
2588
|
config: {
|
|
2564
2589
|
rowColOperation: {
|
|
2565
2590
|
operationType: M.Insert,
|
|
2566
|
-
rowColType:
|
|
2591
|
+
rowColType: N.Col,
|
|
2567
2592
|
index: i.startColumn,
|
|
2568
2593
|
count: h,
|
|
2569
2594
|
columnsJson: g
|
|
@@ -2577,7 +2602,7 @@ let he = class extends H {
|
|
|
2577
2602
|
}
|
|
2578
2603
|
_initCommandListener() {
|
|
2579
2604
|
this._commandService.onCommandExecuted((t) => {
|
|
2580
|
-
if (t.id ===
|
|
2605
|
+
if (t.id === Ye.id) {
|
|
2581
2606
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endRow - r.startRow + 1;
|
|
2582
2607
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2583
2608
|
const l = u.getRange();
|
|
@@ -2589,7 +2614,7 @@ let he = class extends H {
|
|
|
2589
2614
|
}
|
|
2590
2615
|
});
|
|
2591
2616
|
});
|
|
2592
|
-
} else if (t.id ===
|
|
2617
|
+
} else if (t.id === je.id) {
|
|
2593
2618
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endColumn - r.startColumn + 1;
|
|
2594
2619
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2595
2620
|
const l = u.getRange();
|
|
@@ -2601,7 +2626,7 @@ let he = class extends H {
|
|
|
2601
2626
|
}
|
|
2602
2627
|
});
|
|
2603
2628
|
});
|
|
2604
|
-
} else if (t.id ===
|
|
2629
|
+
} else if (t.id === Ge.id) {
|
|
2605
2630
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endRow - r.startRow + 1;
|
|
2606
2631
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2607
2632
|
const l = u.getRange();
|
|
@@ -2613,7 +2638,7 @@ let he = class extends H {
|
|
|
2613
2638
|
}
|
|
2614
2639
|
});
|
|
2615
2640
|
});
|
|
2616
|
-
} else if (t.id ===
|
|
2641
|
+
} else if (t.id === ze.id) {
|
|
2617
2642
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endColumn - r.startColumn + 1;
|
|
2618
2643
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2619
2644
|
const l = u.getRange();
|
|
@@ -2629,17 +2654,17 @@ let he = class extends H {
|
|
|
2629
2654
|
});
|
|
2630
2655
|
}
|
|
2631
2656
|
};
|
|
2632
|
-
he =
|
|
2633
|
-
V(0,
|
|
2634
|
-
V(1,
|
|
2635
|
-
V(2,
|
|
2636
|
-
V(3,
|
|
2637
|
-
V(4,
|
|
2638
|
-
V(5,
|
|
2639
|
-
V(6,
|
|
2657
|
+
he = es([
|
|
2658
|
+
V(0, R(D)),
|
|
2659
|
+
V(1, R(St)),
|
|
2660
|
+
V(2, R(A)),
|
|
2661
|
+
V(3, R(He)),
|
|
2662
|
+
V(4, R(Ce)),
|
|
2663
|
+
V(5, R(T)),
|
|
2664
|
+
V(6, R(be))
|
|
2640
2665
|
], he);
|
|
2641
|
-
var
|
|
2642
|
-
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--)
|
|
2643
2668
|
(o = t[a]) && (r = o(r) || r);
|
|
2644
2669
|
return r;
|
|
2645
2670
|
}, oe = (t, e) => (n, s) => e(n, s, t);
|
|
@@ -2699,12 +2724,12 @@ let ge = class extends H {
|
|
|
2699
2724
|
);
|
|
2700
2725
|
}
|
|
2701
2726
|
_initUserTableTheme() {
|
|
2702
|
-
const e = this._configService.getConfig(
|
|
2703
|
-
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);
|
|
2704
2729
|
}
|
|
2705
2730
|
_initDefaultTableTheme() {
|
|
2706
2731
|
for (let e = 0; e < this._allThemes.length; e++) {
|
|
2707
|
-
const { name: n, style: s } = this._allThemes[e], r = new
|
|
2732
|
+
const { name: n, style: s } = this._allThemes[e], r = new Mt(n, s);
|
|
2708
2733
|
this._sheetRangeThemeModel.registerDefaultRangeTheme(r);
|
|
2709
2734
|
}
|
|
2710
2735
|
}
|
|
@@ -2712,21 +2737,21 @@ let ge = class extends H {
|
|
|
2712
2737
|
super.dispose(), this._allThemes = [], this._defaultThemeIndex = 0;
|
|
2713
2738
|
}
|
|
2714
2739
|
};
|
|
2715
|
-
ge =
|
|
2716
|
-
oe(0,
|
|
2717
|
-
oe(1,
|
|
2718
|
-
oe(2,
|
|
2719
|
-
oe(3,
|
|
2740
|
+
ge = ns([
|
|
2741
|
+
oe(0, R(T)),
|
|
2742
|
+
oe(1, R(It)),
|
|
2743
|
+
oe(2, R(Qe)),
|
|
2744
|
+
oe(3, Ve)
|
|
2720
2745
|
], ge);
|
|
2721
|
-
var
|
|
2722
|
-
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--)
|
|
2723
2748
|
(o = t[a]) && (r = o(r) || r);
|
|
2724
2749
|
return r;
|
|
2725
2750
|
}, ie = (t, e) => (n, s) => e(n, s, t);
|
|
2726
2751
|
let me = class extends H {
|
|
2727
2752
|
constructor(e, n, s, r) {
|
|
2728
2753
|
super();
|
|
2729
|
-
b(this, "_tableFilteredOutRows$", new
|
|
2754
|
+
b(this, "_tableFilteredOutRows$", new Ke(/* @__PURE__ */ new Set()));
|
|
2730
2755
|
b(this, "tableFilteredOutRows$", this._tableFilteredOutRows$.asObservable());
|
|
2731
2756
|
b(this, "_subscription", null);
|
|
2732
2757
|
this._tableManager = e, this._sheetInterceptorService = n, this._univerInstanceService = s, this._zebraCrossingCacheController = r, this.registerFilterChangeEvent(), this.initTableHiddenRowIntercept(), this._initFilteredOutRows();
|
|
@@ -2738,7 +2763,7 @@ let me = class extends H {
|
|
|
2738
2763
|
this._tableFilteredOutRows$.next(e);
|
|
2739
2764
|
}
|
|
2740
2765
|
initTableHiddenRowIntercept() {
|
|
2741
|
-
this.disposeWithMe(this._sheetInterceptorService.intercept(
|
|
2766
|
+
this.disposeWithMe(this._sheetInterceptorService.intercept(qe.ROW_FILTERED, {
|
|
2742
2767
|
// 这里需要保证优先级高于sheet的筛选,因为筛选没有next,低于筛选的不会触发interceptor
|
|
2743
2768
|
priority: 100,
|
|
2744
2769
|
handler: (e, n, s) => {
|
|
@@ -2751,9 +2776,9 @@ let me = class extends H {
|
|
|
2751
2776
|
_initFilteredOutRows() {
|
|
2752
2777
|
this._tableManager.tableInitStatus$.pipe(
|
|
2753
2778
|
pe((e) => e),
|
|
2754
|
-
|
|
2779
|
+
Fe(() => this._univerInstanceService.getCurrentTypeOfUnit$(j.UNIVER_SHEET)),
|
|
2755
2780
|
pe((e) => e != null),
|
|
2756
|
-
|
|
2781
|
+
Fe((e) => e.activeSheet$),
|
|
2757
2782
|
pe((e) => e != null)
|
|
2758
2783
|
).subscribe(() => {
|
|
2759
2784
|
const e = $(this._univerInstanceService);
|
|
@@ -2789,30 +2814,30 @@ let me = class extends H {
|
|
|
2789
2814
|
super.dispose(), (e = this._subscription) == null || e.unsubscribe();
|
|
2790
2815
|
}
|
|
2791
2816
|
};
|
|
2792
|
-
me =
|
|
2793
|
-
ie(0,
|
|
2794
|
-
ie(1,
|
|
2795
|
-
ie(2,
|
|
2796
|
-
ie(3,
|
|
2817
|
+
me = rs([
|
|
2818
|
+
ie(0, R(T)),
|
|
2819
|
+
ie(1, R(Ce)),
|
|
2820
|
+
ie(2, R(A)),
|
|
2821
|
+
ie(3, R(vt))
|
|
2797
2822
|
], me);
|
|
2798
|
-
var
|
|
2799
|
-
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--)
|
|
2800
2825
|
(o = t[a]) && (r = o(r) || r);
|
|
2801
2826
|
return r;
|
|
2802
2827
|
}, Se = (t, e) => (n, s) => e(n, s, t), le;
|
|
2803
|
-
let
|
|
2828
|
+
let Be = (le = class extends ht {
|
|
2804
2829
|
constructor(t = De, e, n, s) {
|
|
2805
2830
|
super(), this._config = t, this._injector = e, this._configService = n, this._commandService = s;
|
|
2806
|
-
const { ...r } =
|
|
2831
|
+
const { ...r } = gt(
|
|
2807
2832
|
{},
|
|
2808
2833
|
De,
|
|
2809
2834
|
this._config
|
|
2810
2835
|
);
|
|
2811
|
-
this._configService.setConfig(
|
|
2836
|
+
this._configService.setConfig(tt, r), this._initRegisterCommand();
|
|
2812
2837
|
}
|
|
2813
2838
|
onStarting() {
|
|
2814
|
-
|
|
2815
|
-
[
|
|
2839
|
+
mt(this._injector, [
|
|
2840
|
+
[T],
|
|
2816
2841
|
[ge],
|
|
2817
2842
|
[W],
|
|
2818
2843
|
[X],
|
|
@@ -2832,63 +2857,63 @@ let Ee = (le = class extends ct {
|
|
|
2832
2857
|
[X],
|
|
2833
2858
|
[me]
|
|
2834
2859
|
]), Me(this._injector, [
|
|
2835
|
-
[
|
|
2860
|
+
[T]
|
|
2836
2861
|
]);
|
|
2837
2862
|
}
|
|
2838
2863
|
_initRegisterCommand() {
|
|
2839
2864
|
[
|
|
2840
|
-
|
|
2865
|
+
En,
|
|
2841
2866
|
k,
|
|
2842
|
-
An,
|
|
2843
|
-
Q,
|
|
2844
|
-
_e,
|
|
2845
2867
|
Bn,
|
|
2846
|
-
|
|
2868
|
+
Q,
|
|
2869
|
+
Re,
|
|
2870
|
+
Ln,
|
|
2871
|
+
Jn,
|
|
2847
2872
|
S,
|
|
2848
|
-
|
|
2849
|
-
Vn,
|
|
2873
|
+
Pn,
|
|
2850
2874
|
qn,
|
|
2851
|
-
Jn,
|
|
2852
2875
|
kn,
|
|
2853
|
-
Qn
|
|
2876
|
+
Qn,
|
|
2877
|
+
Yn,
|
|
2878
|
+
Gn
|
|
2854
2879
|
].forEach((t) => this._commandService.registerCommand(t));
|
|
2855
2880
|
}
|
|
2856
|
-
}, b(le, "pluginName",
|
|
2857
|
-
|
|
2858
|
-
Se(1,
|
|
2859
|
-
Se(2,
|
|
2860
|
-
Se(3,
|
|
2861
|
-
],
|
|
2881
|
+
}, b(le, "pluginName", at), b(le, "type", j.UNIVER_SHEET), le);
|
|
2882
|
+
Be = os([
|
|
2883
|
+
Se(1, R(He)),
|
|
2884
|
+
Se(2, Ve),
|
|
2885
|
+
Se(3, R(D))
|
|
2886
|
+
], Be);
|
|
2862
2887
|
export {
|
|
2863
|
-
|
|
2888
|
+
En as AddSheetTableCommand,
|
|
2864
2889
|
k as AddSheetTableMutation,
|
|
2865
|
-
|
|
2866
|
-
|
|
2890
|
+
Pn as AddTableThemeCommand,
|
|
2891
|
+
Bn as DeleteSheetTableCommand,
|
|
2867
2892
|
Q as DeleteSheetTableMutation,
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2893
|
+
qn as RemoveTableThemeCommand,
|
|
2894
|
+
Wn as SHEET_TABLE_CUSTOM_THEME_PREFIX,
|
|
2895
|
+
Jn as SetSheetTableCommand,
|
|
2896
|
+
Ln as SetSheetTableFilterCommand,
|
|
2897
|
+
Re as SetSheetTableFilterMutation,
|
|
2873
2898
|
S as SetSheetTableMutation,
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2899
|
+
Qn as SheetTableInsertColCommand,
|
|
2900
|
+
kn as SheetTableInsertRowCommand,
|
|
2901
|
+
Gn as SheetTableRemoveColCommand,
|
|
2902
|
+
Yn as SheetTableRemoveRowCommand,
|
|
2878
2903
|
X as SheetTableService,
|
|
2879
2904
|
q as SheetsTableButtonStateEnum,
|
|
2880
2905
|
W as SheetsTableController,
|
|
2881
2906
|
G as SheetsTableSortStateEnum,
|
|
2882
|
-
|
|
2907
|
+
Xe as TableColumnDataTypeEnum,
|
|
2883
2908
|
ne as TableColumnFilterTypeEnum,
|
|
2884
|
-
|
|
2909
|
+
U as TableConditionTypeEnum,
|
|
2885
2910
|
m as TableDateCompareTypeEnum,
|
|
2886
|
-
|
|
2911
|
+
T as TableManager,
|
|
2887
2912
|
F as TableNumberCompareTypeEnum,
|
|
2888
2913
|
P as TableStringCompareTypeEnum,
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2914
|
+
Be as UniverSheetsTablePlugin,
|
|
2915
|
+
ms as customEmptyThemeWithBorderStyle,
|
|
2916
|
+
yt as isConditionFilter,
|
|
2917
|
+
gs as isManualFilter,
|
|
2918
|
+
bs as processStyleWithBorderStyle
|
|
2894
2919
|
};
|