@univerjs/sheets-table 0.11.0 → 0.12.0-nightly.202511220628
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 +491 -429
- package/lib/index.js +491 -429
- package/lib/types/controllers/sheet-table-formula.controller.d.ts +9 -0
- package/lib/umd/index.js +1 -1
- package/package.json +6 -5
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,83 +1,84 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var b = (t, e, n) =>
|
|
4
|
-
import { CellValueType as
|
|
5
|
-
import { getSheetCommandTarget as $, SheetInterceptorService as
|
|
6
|
-
import { Subject as Y, BehaviorSubject as
|
|
7
|
-
|
|
1
|
+
var st = Object.defineProperty;
|
|
2
|
+
var rt = (t, e, n) => e in t ? st(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var b = (t, e, n) => rt(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CellValueType as J, BorderStyleTypes as at, createREGEXFromWildChar as Z, generateRandomId as L, IUniverInstanceService as B, Inject as _, LocaleService as be, Disposable as H, CommandType as N, IUndoRedoService as A, ICommandService as D, sequenceExecute as E, ILogService as Le, IResourceManagerService as ot, Rectangle as Re, RTree as it, InterceptorEffectEnum as lt, UniverInstanceType as z, customNameCharacterCheck as ut, Injector as We, IConfigService as He, Plugin as ct, merge as dt, registerDependencies as ht, touchDependencies as Me } from "@univerjs/core";
|
|
5
|
+
import { getSheetCommandTarget as $, SheetInterceptorService as Ce, INTERCEPTOR_POINT as Ve, RemoveSheetCommand as gt, CopySheetCommand as mt, AddRangeThemeMutation as Pe, RemoveRangeThemeMutation as qe, SheetRangeThemeModel as Je, SheetsSelectionsService as we, InsertRowMutation as ke, RemoveRowMutation as Qe, getMoveRangeUndoRedoMutations as fe, InsertColMutation as Ye, RemoveColMutation as Ge, IExclusiveRangeService as bt, RefRangeService as wt, RemoveColCommand as ft, RemoveRowCommand as pt, InsertColCommand as St, InsertRowCommand as Rt, SheetRangeThemeService as _t, RangeThemeStyle as Ct, ZebraCrossingCacheController as Tt } from "@univerjs/sheets";
|
|
6
|
+
import { Subject as Y, BehaviorSubject as ze, filter as pe, switchMap as ve } from "rxjs";
|
|
7
|
+
import { RemoveSuperTableMutation as Fe, SetSuperTableMutation as It } from "@univerjs/engine-formula";
|
|
8
|
+
var M = /* @__PURE__ */ ((t) => (t.Insert = "insert", t.Delete = "delete", t))(M || {}), y = /* @__PURE__ */ ((t) => (t.Row = "row", t.Col = "column", t))(y || {}), je = /* @__PURE__ */ ((t) => (t.None = "none", t.String = "string", t.Number = "number", t.Date = "date", t.Bool = "bool", t.Checkbox = "checkbox", t.List = "list", t))(je || {}), ne = /* @__PURE__ */ ((t) => (t.manual = "manual", t.condition = "condition", t))(ne || {}), O = /* @__PURE__ */ ((t) => (t.Date = "date", t.Number = "number", t.String = "string", t.Logic = "logic", t))(O || {}), 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 || {});
|
|
8
9
|
function te(t, e) {
|
|
9
10
|
return `${e} ${t}`;
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
+
const ye = "TRUE", Ne = "FALSE", Mt = (t) => {
|
|
12
13
|
var n;
|
|
13
14
|
return ((n = t.body) == null ? void 0 : n.dataStream.replace(/\r\n$/, "")) || "";
|
|
14
15
|
};
|
|
15
|
-
function
|
|
16
|
+
function Ke(t) {
|
|
16
17
|
if (t) {
|
|
17
18
|
const { v: e, t: n, p: s } = t;
|
|
18
|
-
return s ?
|
|
19
|
+
return s ? Mt(s) : (n === J.FORCE_STRING || n === J.STRING) && e !== void 0 && e !== null ? String(e) : n === J.BOOLEAN ? e ? ye : Ne : n === J.NUMBER ? String(e) : typeof e === "boolean" ? e ? ye : Ne : e == null ? "" : String(e);
|
|
19
20
|
}
|
|
20
21
|
return "";
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function vt(t, e) {
|
|
23
24
|
if (t != null)
|
|
24
25
|
switch (e) {
|
|
25
26
|
case G.Asc:
|
|
26
|
-
return
|
|
27
|
+
return q.FilteredSortAsc;
|
|
27
28
|
case G.Desc:
|
|
28
|
-
return
|
|
29
|
+
return q.FilteredSortDesc;
|
|
29
30
|
default:
|
|
30
|
-
return
|
|
31
|
+
return q.FilteredSortNone;
|
|
31
32
|
}
|
|
32
33
|
else
|
|
33
34
|
switch (e) {
|
|
34
35
|
case G.Asc:
|
|
35
|
-
return
|
|
36
|
+
return q.FilterNoneSortAsc;
|
|
36
37
|
case G.Desc:
|
|
37
|
-
return
|
|
38
|
+
return q.FilterNoneSortDesc;
|
|
38
39
|
default:
|
|
39
|
-
return
|
|
40
|
+
return q.FilterNoneSortNone;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
+
function Ft(t) {
|
|
43
44
|
return t ? t.filterType === ne.condition : !1;
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
+
function ds(t) {
|
|
46
47
|
return t ? t.filterType === ne.manual : !1;
|
|
47
48
|
}
|
|
48
|
-
const
|
|
49
|
-
s:
|
|
49
|
+
const x = {
|
|
50
|
+
s: at.THIN,
|
|
50
51
|
cl: {
|
|
51
52
|
rgb: "rgb(95, 101, 116)"
|
|
52
53
|
}
|
|
53
|
-
},
|
|
54
|
+
}, Xe = "sheets-table.config", De = {}, hs = {
|
|
54
55
|
headerRowStyle: {
|
|
55
56
|
bd: {
|
|
56
|
-
t:
|
|
57
|
+
t: x
|
|
57
58
|
}
|
|
58
59
|
},
|
|
59
60
|
headerColumnStyle: {
|
|
60
61
|
bd: {
|
|
61
|
-
l:
|
|
62
|
+
l: x
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
lastColumnStyle: {
|
|
65
66
|
bd: {
|
|
66
|
-
r:
|
|
67
|
+
r: x
|
|
67
68
|
}
|
|
68
69
|
},
|
|
69
70
|
lastRowStyle: {
|
|
70
71
|
bd: {
|
|
71
|
-
b:
|
|
72
|
+
b: x
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
|
-
},
|
|
75
|
+
}, gs = (t, e) => {
|
|
75
76
|
if (t === "headerRowStyle") {
|
|
76
77
|
if (!e.bd)
|
|
77
78
|
return {
|
|
78
79
|
...e,
|
|
79
80
|
bd: {
|
|
80
|
-
t:
|
|
81
|
+
t: x
|
|
81
82
|
}
|
|
82
83
|
};
|
|
83
84
|
} else if (t === "lastRowStyle") {
|
|
@@ -85,7 +86,7 @@ const D = {
|
|
|
85
86
|
return {
|
|
86
87
|
...e,
|
|
87
88
|
bd: {
|
|
88
|
-
b:
|
|
89
|
+
b: x
|
|
89
90
|
}
|
|
90
91
|
};
|
|
91
92
|
} else if (t === "lastColumnStyle") {
|
|
@@ -93,25 +94,25 @@ const D = {
|
|
|
93
94
|
return {
|
|
94
95
|
...e,
|
|
95
96
|
bd: {
|
|
96
|
-
r:
|
|
97
|
+
r: x
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
100
|
} else if (t === "headerColumnStyle" && !e.bd)
|
|
100
101
|
return {
|
|
101
102
|
...e,
|
|
102
103
|
bd: {
|
|
103
|
-
l:
|
|
104
|
+
l: x
|
|
104
105
|
}
|
|
105
106
|
};
|
|
106
107
|
return e;
|
|
107
|
-
},
|
|
108
|
+
}, yt = [
|
|
108
109
|
[["#6280F9", "#FFFFFF", "#BAC6F8", "#D2DAFA"], ["#fff"]],
|
|
109
110
|
[["#16BDCA", "#FFFFFF", "#EDFAFA", "#AFECEF"], ["#000"]],
|
|
110
111
|
[["#31C48D", "#FFFFFF", "#F3FAF7", "#BCF0DA"], ["#fff"]],
|
|
111
112
|
[["#AC94FA", "#FFFFFF", "#F6F5FF", "#EDEBFE"], ["#fff"]],
|
|
112
113
|
[["#F17EBB", "#FFFFFF", "#FDF2F8", "#FCE8F3"], ["#fff"]],
|
|
113
114
|
[["#F98080", "#FFFFFF", "#FDF2F2", "#FDE8E8"], ["#fff"]]
|
|
114
|
-
],
|
|
115
|
+
], Ze = yt.map((t, e) => {
|
|
115
116
|
const [n, s] = t, [r, a, o, u] = n, [l] = s;
|
|
116
117
|
return {
|
|
117
118
|
name: `table-default-${e}`,
|
|
@@ -124,12 +125,12 @@ const D = {
|
|
|
124
125
|
rgb: l
|
|
125
126
|
},
|
|
126
127
|
bd: {
|
|
127
|
-
t:
|
|
128
|
+
t: x
|
|
128
129
|
}
|
|
129
130
|
},
|
|
130
131
|
headerColumnStyle: {
|
|
131
132
|
bd: {
|
|
132
|
-
l:
|
|
133
|
+
l: x
|
|
133
134
|
}
|
|
134
135
|
},
|
|
135
136
|
firstRowStyle: {
|
|
@@ -147,12 +148,12 @@ const D = {
|
|
|
147
148
|
rgb: u
|
|
148
149
|
},
|
|
149
150
|
bd: {
|
|
150
|
-
b:
|
|
151
|
+
b: x
|
|
151
152
|
}
|
|
152
153
|
},
|
|
153
154
|
lastColumnStyle: {
|
|
154
155
|
bd: {
|
|
155
|
-
r:
|
|
156
|
+
r: x
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
}
|
|
@@ -166,7 +167,7 @@ class j {
|
|
|
166
167
|
b(this, "formula");
|
|
167
168
|
b(this, "meta");
|
|
168
169
|
b(this, "style");
|
|
169
|
-
this.id = e, this.displayName = n, this.dataType =
|
|
170
|
+
this.id = e, this.displayName = n, this.dataType = je.String, this.formula = "", this.meta = {}, this.style = {};
|
|
170
171
|
}
|
|
171
172
|
getMeta() {
|
|
172
173
|
return this.meta;
|
|
@@ -191,79 +192,79 @@ class j {
|
|
|
191
192
|
this.id = e.id, this.displayName = e.displayName, this.dataType = e.dataType, this.formula = e.formula, this.meta = e.meta, this.style = e.style;
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
|
-
const
|
|
195
|
+
const Nt = (t) => t.getMonth() <= 2, Dt = (t) => {
|
|
195
196
|
const e = t.getMonth();
|
|
196
197
|
return e > 2 && e <= 5;
|
|
197
|
-
},
|
|
198
|
+
}, xt = (t) => {
|
|
198
199
|
const e = t.getMonth();
|
|
199
200
|
return e > 5 && e <= 8;
|
|
200
|
-
},
|
|
201
|
+
}, Ot = (t) => {
|
|
201
202
|
const e = t.getMonth();
|
|
202
203
|
return e > 8 && e <= 11;
|
|
203
|
-
},
|
|
204
|
+
}, Ut = (t) => t.getMonth() === 0, $t = (t) => t.getMonth() === 1, At = (t) => t.getMonth() === 2, Bt = (t) => t.getMonth() === 3, Et = (t) => t.getMonth() === 4, Lt = (t) => t.getMonth() === 5, Wt = (t) => t.getMonth() === 6, Ht = (t) => t.getMonth() === 7, Vt = (t) => t.getMonth() === 8, Pt = (t) => t.getMonth() === 9, qt = (t) => t.getMonth() === 10, Jt = (t) => t.getMonth() === 11, kt = (t, e = /* @__PURE__ */ new Date()) => t.toDateString() === e.toDateString(), Qt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
204
205
|
const n = new Date(e);
|
|
205
206
|
return n.setDate(n.getDate() + 1), t.toDateString() === n.toDateString();
|
|
206
|
-
},
|
|
207
|
+
}, Yt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
207
208
|
const n = new Date(e);
|
|
208
209
|
return n.setDate(n.getDate() - 1), t.toDateString() === n.toDateString();
|
|
209
210
|
}, K = (t) => {
|
|
210
211
|
const e = t.getDay(), n = t.getDate() - e + (e === 0 ? -6 : 1), s = new Date(t);
|
|
211
212
|
return s.setDate(n), s;
|
|
212
|
-
},
|
|
213
|
+
}, et = 10080 * 60 * 1e3, Gt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
213
214
|
const n = K(t), s = K(e);
|
|
214
215
|
return n.toDateString() === s.toDateString();
|
|
215
|
-
},
|
|
216
|
-
const n = K(t), s = new Date(K(e).getTime() +
|
|
216
|
+
}, zt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
217
|
+
const n = K(t), s = new Date(K(e).getTime() + et);
|
|
217
218
|
return n.toDateString() === s.toDateString();
|
|
218
|
-
},
|
|
219
|
-
const n = K(t), s = new Date(K(e).getTime() -
|
|
219
|
+
}, jt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
220
|
+
const n = K(t), s = new Date(K(e).getTime() - et);
|
|
220
221
|
return n.toDateString() === s.toDateString();
|
|
221
|
-
},
|
|
222
|
+
}, Kt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth(), Xt = (t) => {
|
|
222
223
|
const e = new Date(t);
|
|
223
224
|
return e.setHours(0, 0, 0, 0), e.setDate(1), e;
|
|
224
|
-
},
|
|
225
|
+
}, Zt = (t, e = /* @__PURE__ */ new Date()) => {
|
|
225
226
|
const n = new Date(e);
|
|
226
227
|
n.setHours(0, 0, 0, 0), n.setMonth(n.getMonth() + 1, 1);
|
|
227
228
|
const s = new Date(n);
|
|
228
229
|
s.setMonth(s.getMonth() + 1, 0);
|
|
229
230
|
const r = t.getTime();
|
|
230
231
|
return r >= n.getTime() && r < s.getTime();
|
|
231
|
-
},
|
|
232
|
-
const n =
|
|
232
|
+
}, en = (t, e = /* @__PURE__ */ new Date()) => {
|
|
233
|
+
const n = Xt(e), s = new Date(n);
|
|
233
234
|
s.setMonth(s.getMonth() + 1, 0);
|
|
234
235
|
const r = t.getTime();
|
|
235
236
|
return r >= n.getTime() && r < s.getTime();
|
|
236
|
-
},
|
|
237
|
+
}, Te = (t) => {
|
|
237
238
|
const e = new Date(t);
|
|
238
239
|
e.setHours(0, 0, 0, 0), e.setDate(1);
|
|
239
240
|
const n = e.getMonth();
|
|
240
241
|
return e.setMonth(n - n % 3), e;
|
|
241
|
-
},
|
|
242
|
-
const n =
|
|
242
|
+
}, tn = (t, e = /* @__PURE__ */ new Date()) => {
|
|
243
|
+
const n = Te(e), s = new Date(n);
|
|
243
244
|
s.setMonth(s.getMonth() + 3);
|
|
244
245
|
const r = t.getTime();
|
|
245
246
|
return r >= n.getTime() && r < s.getTime();
|
|
246
|
-
},
|
|
247
|
-
const n =
|
|
247
|
+
}, nn = (t, e = /* @__PURE__ */ new Date()) => {
|
|
248
|
+
const n = Te(e), s = new Date(n);
|
|
248
249
|
s.setMonth(s.getMonth() + 3);
|
|
249
250
|
const r = new Date(s);
|
|
250
251
|
r.setMonth(r.getMonth() + 3, 0);
|
|
251
252
|
const a = t.getTime();
|
|
252
253
|
return a >= s.getTime() && a < r.getTime();
|
|
253
|
-
},
|
|
254
|
-
const n =
|
|
254
|
+
}, sn = (t, e = /* @__PURE__ */ new Date()) => {
|
|
255
|
+
const n = Te(e), s = new Date(n);
|
|
255
256
|
s.setMonth(s.getMonth() - 3);
|
|
256
257
|
const r = new Date(n);
|
|
257
258
|
r.setDate(0);
|
|
258
259
|
const a = t.getTime();
|
|
259
260
|
return a >= s.getTime() && a < r.getTime();
|
|
260
|
-
},
|
|
261
|
+
}, rn = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear(), an = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() + 1, on = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() - 1, ln = (t, e = /* @__PURE__ */ new Date()) => {
|
|
261
262
|
const n = new Date(e);
|
|
262
263
|
n.setHours(0, 0, 0, 0), n.setMonth(0, 1);
|
|
263
264
|
const s = t.getTime();
|
|
264
265
|
return s >= n.getTime() && s < e.getTime();
|
|
265
266
|
};
|
|
266
|
-
function
|
|
267
|
+
function un(t) {
|
|
267
268
|
switch (t.compareType) {
|
|
268
269
|
case m.Equal: {
|
|
269
270
|
const e = new Date(t.expectedValue);
|
|
@@ -301,105 +302,105 @@ function rn(t) {
|
|
|
301
302
|
};
|
|
302
303
|
case m.Today: {
|
|
303
304
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
304
|
-
return (n) =>
|
|
305
|
+
return (n) => kt(n, e);
|
|
305
306
|
}
|
|
306
307
|
case m.Yesterday: {
|
|
307
308
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
308
|
-
return (n) =>
|
|
309
|
+
return (n) => Yt(n, e);
|
|
309
310
|
}
|
|
310
311
|
case m.Tomorrow: {
|
|
311
312
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
312
|
-
return (n) =>
|
|
313
|
+
return (n) => Qt(n, e);
|
|
313
314
|
}
|
|
314
315
|
case m.ThisWeek: {
|
|
315
316
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
316
|
-
return (n) =>
|
|
317
|
+
return (n) => Gt(n, e);
|
|
317
318
|
}
|
|
318
319
|
case m.LastWeek: {
|
|
319
320
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
320
|
-
return (n) =>
|
|
321
|
+
return (n) => jt(n, e);
|
|
321
322
|
}
|
|
322
323
|
case m.NextWeek: {
|
|
323
324
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
324
|
-
return (n) =>
|
|
325
|
+
return (n) => zt(n, e);
|
|
325
326
|
}
|
|
326
327
|
case m.ThisMonth: {
|
|
327
328
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
328
|
-
return (n) =>
|
|
329
|
+
return (n) => Kt(n, e);
|
|
329
330
|
}
|
|
330
331
|
case m.LastMonth: {
|
|
331
332
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
332
|
-
return (n) =>
|
|
333
|
+
return (n) => en(n, e);
|
|
333
334
|
}
|
|
334
335
|
case m.NextMonth: {
|
|
335
336
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
336
|
-
return (n) =>
|
|
337
|
+
return (n) => Zt(n, e);
|
|
337
338
|
}
|
|
338
339
|
case m.ThisQuarter: {
|
|
339
340
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
340
|
-
return (n) =>
|
|
341
|
+
return (n) => tn(n, e);
|
|
341
342
|
}
|
|
342
343
|
case m.LastQuarter: {
|
|
343
344
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
344
|
-
return (n) =>
|
|
345
|
+
return (n) => sn(n, e);
|
|
345
346
|
}
|
|
346
347
|
case m.NextQuarter: {
|
|
347
348
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
348
|
-
return (n) =>
|
|
349
|
+
return (n) => nn(n, e);
|
|
349
350
|
}
|
|
350
351
|
case m.ThisYear: {
|
|
351
352
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
352
|
-
return (n) =>
|
|
353
|
+
return (n) => rn(n, e);
|
|
353
354
|
}
|
|
354
355
|
case m.LastYear: {
|
|
355
356
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
356
|
-
return (n) =>
|
|
357
|
+
return (n) => on(n, e);
|
|
357
358
|
}
|
|
358
359
|
case m.NextYear: {
|
|
359
360
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
360
|
-
return (n) =>
|
|
361
|
+
return (n) => an(n, e);
|
|
361
362
|
}
|
|
362
363
|
case m.YearToDate: {
|
|
363
364
|
const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
|
|
364
|
-
return (n) =>
|
|
365
|
+
return (n) => ln(n, e);
|
|
365
366
|
}
|
|
366
367
|
case m.M1:
|
|
367
|
-
return
|
|
368
|
+
return Ut;
|
|
368
369
|
case m.M2:
|
|
369
|
-
return
|
|
370
|
+
return $t;
|
|
370
371
|
case m.M3:
|
|
371
|
-
return
|
|
372
|
+
return At;
|
|
372
373
|
case m.M4:
|
|
373
|
-
return
|
|
374
|
+
return Bt;
|
|
374
375
|
case m.M5:
|
|
375
|
-
return
|
|
376
|
+
return Et;
|
|
376
377
|
case m.M6:
|
|
377
|
-
return
|
|
378
|
+
return Lt;
|
|
378
379
|
case m.M7:
|
|
379
|
-
return
|
|
380
|
+
return Wt;
|
|
380
381
|
case m.M8:
|
|
381
|
-
return
|
|
382
|
+
return Ht;
|
|
382
383
|
case m.M9:
|
|
383
|
-
return
|
|
384
|
+
return Vt;
|
|
384
385
|
case m.M10:
|
|
385
|
-
return
|
|
386
|
+
return Pt;
|
|
386
387
|
case m.M11:
|
|
387
|
-
return
|
|
388
|
+
return qt;
|
|
388
389
|
case m.M12:
|
|
389
|
-
return
|
|
390
|
+
return Jt;
|
|
390
391
|
case m.Q1:
|
|
391
|
-
return
|
|
392
|
+
return Nt;
|
|
392
393
|
case m.Q2:
|
|
393
|
-
return
|
|
394
|
+
return Dt;
|
|
394
395
|
case m.Q3:
|
|
395
|
-
return
|
|
396
|
+
return xt;
|
|
396
397
|
case m.Q4:
|
|
397
|
-
return
|
|
398
|
+
return Ot;
|
|
398
399
|
default:
|
|
399
400
|
throw new Error("Unsupported compare type");
|
|
400
401
|
}
|
|
401
402
|
}
|
|
402
|
-
class
|
|
403
|
+
class cn {
|
|
403
404
|
/**
|
|
404
405
|
* Initializes a new instance of the Heap class.
|
|
405
406
|
*/
|
|
@@ -463,7 +464,7 @@ class an {
|
|
|
463
464
|
return this.heap.includes(e);
|
|
464
465
|
}
|
|
465
466
|
}
|
|
466
|
-
class
|
|
467
|
+
class dn extends cn {
|
|
467
468
|
/**
|
|
468
469
|
* Initializes a new instance of the MinHeap class.
|
|
469
470
|
*/
|
|
@@ -502,13 +503,13 @@ class on extends an {
|
|
|
502
503
|
this.heap[0] = this.heap.pop(), this.shiftDown(0);
|
|
503
504
|
}
|
|
504
505
|
}
|
|
505
|
-
const
|
|
506
|
-
const n = new
|
|
506
|
+
const hn = (t, e) => {
|
|
507
|
+
const n = new dn();
|
|
507
508
|
for (const s of t)
|
|
508
509
|
n.insert(s), n.size() > e && n.pop();
|
|
509
510
|
return n.heap;
|
|
510
|
-
},
|
|
511
|
-
function
|
|
511
|
+
}, gn = (t, e) => t > e, mn = (t, e) => t < e, bn = (t, e, n) => hn(t, e).includes(n);
|
|
512
|
+
function wn(t, e) {
|
|
512
513
|
switch (t.compareType) {
|
|
513
514
|
case F.Equal: {
|
|
514
515
|
const n = Number(t.expectedValue);
|
|
@@ -544,56 +545,56 @@ function hn(t, e) {
|
|
|
544
545
|
}
|
|
545
546
|
case F.Above: {
|
|
546
547
|
const n = e.average;
|
|
547
|
-
return (s) =>
|
|
548
|
+
return (s) => gn(s, n);
|
|
548
549
|
}
|
|
549
550
|
case F.Below: {
|
|
550
551
|
const n = e.average;
|
|
551
|
-
return (s) =>
|
|
552
|
+
return (s) => mn(s, n);
|
|
552
553
|
}
|
|
553
554
|
case F.TopN: {
|
|
554
555
|
const n = e.list, s = Number(t.expectedValue);
|
|
555
|
-
return (r) =>
|
|
556
|
+
return (r) => bn(n, s, r);
|
|
556
557
|
}
|
|
557
558
|
}
|
|
558
559
|
}
|
|
559
|
-
const
|
|
560
|
-
function
|
|
560
|
+
const fn = (t, e) => Z(e).test(t), pn = (t, e) => !Z(e).test(t), Sn = (t, e) => Z(`*${e}*`).test(t), Rn = (t, e) => !Z(`*${e}*`).test(t), _n = (t, e) => Z(`${e}*`).test(t), Cn = (t, e) => Z(`*${e}`).test(t);
|
|
561
|
+
function Tn(t) {
|
|
561
562
|
switch (t.compareType) {
|
|
562
|
-
case
|
|
563
|
-
return (e) => gn(e, t.expectedValue);
|
|
564
|
-
case V.NotEqual:
|
|
565
|
-
return (e) => mn(e, t.expectedValue);
|
|
566
|
-
case V.Contains:
|
|
567
|
-
return (e) => bn(e, t.expectedValue);
|
|
568
|
-
case V.NotContains:
|
|
569
|
-
return (e) => wn(e, t.expectedValue);
|
|
570
|
-
case V.StartsWith:
|
|
563
|
+
case P.Equal:
|
|
571
564
|
return (e) => fn(e, t.expectedValue);
|
|
572
|
-
case
|
|
565
|
+
case P.NotEqual:
|
|
566
|
+
return (e) => pn(e, t.expectedValue);
|
|
567
|
+
case P.Contains:
|
|
568
|
+
return (e) => Sn(e, t.expectedValue);
|
|
569
|
+
case P.NotContains:
|
|
573
570
|
return (e) => Rn(e, t.expectedValue);
|
|
571
|
+
case P.StartsWith:
|
|
572
|
+
return (e) => _n(e, t.expectedValue);
|
|
573
|
+
case P.EndsWith:
|
|
574
|
+
return (e) => Cn(e, t.expectedValue);
|
|
574
575
|
default:
|
|
575
576
|
return console.error(`Unknown filter operator: ${t.compareType}`), (e) => !0;
|
|
576
577
|
}
|
|
577
578
|
}
|
|
578
|
-
const
|
|
579
|
+
const In = /* @__PURE__ */ new Set([
|
|
579
580
|
F.Above,
|
|
580
581
|
F.Below,
|
|
581
582
|
F.TopN
|
|
582
583
|
]);
|
|
583
584
|
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;
|
|
584
|
-
function
|
|
585
|
-
return
|
|
585
|
+
function tt(t) {
|
|
586
|
+
return In.has(t);
|
|
586
587
|
}
|
|
587
|
-
function
|
|
588
|
-
if (
|
|
588
|
+
function Mn(t, e) {
|
|
589
|
+
if (tt(t.filterInfo.compareType))
|
|
589
590
|
return (n) => !0;
|
|
590
591
|
switch (t.filterInfo.conditionType) {
|
|
591
592
|
case O.Date:
|
|
592
|
-
return
|
|
593
|
+
return un(t.filterInfo);
|
|
593
594
|
case O.Number:
|
|
594
|
-
return
|
|
595
|
+
return wn(t.filterInfo, e);
|
|
595
596
|
case O.String:
|
|
596
|
-
return
|
|
597
|
+
return Tn(t.filterInfo);
|
|
597
598
|
case O.Logic:
|
|
598
599
|
default:
|
|
599
600
|
return (n) => !0;
|
|
@@ -602,46 +603,46 @@ function pn(t, e) {
|
|
|
602
603
|
function ue(t, e, n, s) {
|
|
603
604
|
switch (s) {
|
|
604
605
|
case O.Date: {
|
|
605
|
-
const r =
|
|
606
|
-
return r ?
|
|
606
|
+
const r = xe(t, e, n);
|
|
607
|
+
return r ? yn(r) : null;
|
|
607
608
|
}
|
|
608
609
|
case O.Number:
|
|
609
|
-
return
|
|
610
|
+
return xe(t, e, n);
|
|
610
611
|
case O.String:
|
|
611
612
|
default:
|
|
612
|
-
return
|
|
613
|
+
return Fn(t, e, n);
|
|
613
614
|
}
|
|
614
615
|
}
|
|
615
|
-
const
|
|
616
|
+
const vn = (t) => {
|
|
616
617
|
var n;
|
|
617
618
|
return ((n = t.body) == null ? void 0 : n.dataStream.replace(/\r\n$/, "")) || "";
|
|
618
619
|
};
|
|
619
|
-
function
|
|
620
|
+
function Fn(t, e, n) {
|
|
620
621
|
const s = t.getCell(e, n);
|
|
621
622
|
if (!s) return null;
|
|
622
623
|
const { v: r, t: a, p: o } = s;
|
|
623
624
|
if (o)
|
|
624
|
-
return
|
|
625
|
+
return vn(o);
|
|
625
626
|
if (typeof r == "string")
|
|
626
|
-
return a ===
|
|
627
|
+
return a === J.BOOLEAN ? r.toUpperCase() : r;
|
|
627
628
|
if (typeof r == "number")
|
|
628
|
-
return a ===
|
|
629
|
+
return a === J.BOOLEAN ? r ? "TRUE" : "FALSE" : r;
|
|
629
630
|
if (typeof r == "boolean") return r ? "TRUE" : "FALSE";
|
|
630
631
|
if (r !== void 0)
|
|
631
632
|
return String(r);
|
|
632
633
|
}
|
|
633
|
-
function
|
|
634
|
+
function xe(t, e, n) {
|
|
634
635
|
const s = t.getCell(e, n);
|
|
635
636
|
if (!s) return null;
|
|
636
637
|
const { v: r, t: a, p: o } = s;
|
|
637
|
-
return o ? null : typeof r == "string" && a ===
|
|
638
|
+
return o ? null : typeof r == "string" && a === J.NUMBER ? Number(t.getCellRaw(e, n).v) : Number(r);
|
|
638
639
|
}
|
|
639
|
-
function
|
|
640
|
+
function yn(t) {
|
|
640
641
|
const e = new Date(Date.UTC(1900, 0, 1, 0, 0, 0)), n = new Date(Date.UTC(1900, 1, 28, 0, 0, 0));
|
|
641
642
|
let s = t - 1;
|
|
642
643
|
return s > (n.getTime() - e.getTime()) / (1e3 * 3600 * 24) && (s -= 1), s < 0 && (s = t), new Date(e.getTime() + s * (1e3 * 3600 * 24));
|
|
643
644
|
}
|
|
644
|
-
class
|
|
645
|
+
class Oe {
|
|
645
646
|
constructor() {
|
|
646
647
|
b(this, "_tableColumnFilterList");
|
|
647
648
|
b(this, "_tableSortInfo");
|
|
@@ -660,7 +661,7 @@ class De {
|
|
|
660
661
|
getFilterState(e) {
|
|
661
662
|
var s;
|
|
662
663
|
const n = ((s = this._tableSortInfo) == null ? void 0 : s.columnIndex) === e ? this._tableSortInfo.sortState : G.None;
|
|
663
|
-
return
|
|
664
|
+
return vt(this._tableColumnFilterList[e], n);
|
|
664
665
|
}
|
|
665
666
|
getSortState() {
|
|
666
667
|
var e;
|
|
@@ -686,7 +687,7 @@ class De {
|
|
|
686
687
|
if (a && e) {
|
|
687
688
|
const { startRow: o, endRow: u, startColumn: l } = n, i = l + s, h = this.getExecuteFunc(e, n, s, a);
|
|
688
689
|
for (let d = o; d <= u; d++) {
|
|
689
|
-
const c =
|
|
690
|
+
const c = Ft(a) ? a.filterInfo.conditionType : O.String;
|
|
690
691
|
ue(e, d, i, c) === null ? r.add(d) : h(ue(e, d, i, c)) || r.add(d);
|
|
691
692
|
}
|
|
692
693
|
}
|
|
@@ -708,8 +709,8 @@ class De {
|
|
|
708
709
|
const a = new Set(r.values);
|
|
709
710
|
return (o) => a.has(o);
|
|
710
711
|
} else if (r.filterType === ne.condition) {
|
|
711
|
-
const o =
|
|
712
|
-
return
|
|
712
|
+
const o = tt(r.filterInfo.compareType) ? this._getNumberCalculatedOptions(e, n, s) : void 0;
|
|
713
|
+
return Mn(r, o);
|
|
713
714
|
} else
|
|
714
715
|
return (a) => !0;
|
|
715
716
|
}
|
|
@@ -727,7 +728,7 @@ class De {
|
|
|
727
728
|
this._tableColumnFilterList = [];
|
|
728
729
|
}
|
|
729
730
|
}
|
|
730
|
-
class
|
|
731
|
+
class Ue {
|
|
731
732
|
constructor(e, n, s, r, a = {}) {
|
|
732
733
|
b(this, "_id");
|
|
733
734
|
b(this, "_name");
|
|
@@ -743,7 +744,7 @@ class xe {
|
|
|
743
744
|
b(this, "tableMeta");
|
|
744
745
|
b(this, "_tableFilters");
|
|
745
746
|
b(this, "_subUnitId");
|
|
746
|
-
this._id = e, this._range = s, this._name = n, this._tableFilters = new
|
|
747
|
+
this._id = e, this._range = s, this._name = n, this._tableFilters = new Oe(), this._init(r, a);
|
|
747
748
|
}
|
|
748
749
|
_init(e, n) {
|
|
749
750
|
var o, u;
|
|
@@ -841,7 +842,7 @@ class xe {
|
|
|
841
842
|
}
|
|
842
843
|
getTableStyleId() {
|
|
843
844
|
var e;
|
|
844
|
-
return (e = this._tableStyleId) != null ? e :
|
|
845
|
+
return (e = this._tableStyleId) != null ? e : Ze[0].name;
|
|
845
846
|
}
|
|
846
847
|
setTableStyleId(e) {
|
|
847
848
|
this._tableStyleId = e;
|
|
@@ -906,18 +907,18 @@ class xe {
|
|
|
906
907
|
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) => {
|
|
907
908
|
const o = new j(a.id, a.displayName);
|
|
908
909
|
o.fromJSON(a), this._columns.set(a.id, o), this._columnOrder.push(a.id);
|
|
909
|
-
}), this._tableFilters = new
|
|
910
|
+
}), this._tableFilters = new Oe(), this._tableFilters.fromJSON(e.filters);
|
|
910
911
|
}
|
|
911
912
|
dispose() {
|
|
912
913
|
this._id = "", this._name = "", this._tableStyleId = "", this._showHeader = !0, this._showFooter = !0, delete this._range, this._columns.clear(), this._columnOrder = [];
|
|
913
914
|
}
|
|
914
915
|
}
|
|
915
|
-
var
|
|
916
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
916
|
+
var Nn = Object.getOwnPropertyDescriptor, Dn = (t, e, n, s) => {
|
|
917
|
+
for (var r = s > 1 ? void 0 : s ? Nn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
917
918
|
(o = t[a]) && (r = o(r) || r);
|
|
918
919
|
return r;
|
|
919
|
-
},
|
|
920
|
-
let
|
|
920
|
+
}, $e = (t, e) => (n, s) => e(n, s, t);
|
|
921
|
+
let C = class extends H {
|
|
921
922
|
constructor(e, n) {
|
|
922
923
|
super();
|
|
923
924
|
b(this, "_tableMap");
|
|
@@ -933,7 +934,7 @@ let T = class extends Q {
|
|
|
933
934
|
b(this, "tableThemeChanged$", this._tableThemeChanged$.asObservable());
|
|
934
935
|
b(this, "_tableFilterChanged$", new Y());
|
|
935
936
|
b(this, "tableFilterChanged$", this._tableFilterChanged$.asObservable());
|
|
936
|
-
b(this, "_tableInitStatus", new
|
|
937
|
+
b(this, "_tableInitStatus", new ze(!1));
|
|
937
938
|
b(this, "tableInitStatus$", this._tableInitStatus.asObservable());
|
|
938
939
|
this._univerInstanceService = e, this._localeService = n, this._tableMap = /* @__PURE__ */ new Map();
|
|
939
940
|
}
|
|
@@ -944,7 +945,7 @@ let T = class extends Q {
|
|
|
944
945
|
var d;
|
|
945
946
|
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";
|
|
946
947
|
for (let c = u; c <= l; c++)
|
|
947
|
-
i.push(
|
|
948
|
+
i.push(Ke(a == null ? void 0 : a.getCell(o, c)) || te(c - u + 1, h));
|
|
948
949
|
return i;
|
|
949
950
|
}
|
|
950
951
|
/**
|
|
@@ -960,7 +961,7 @@ let T = class extends Q {
|
|
|
960
961
|
*/
|
|
961
962
|
addTable(e, n, s, r, a, o, u) {
|
|
962
963
|
var c;
|
|
963
|
-
const l = o != null ? o : L(), i = a || this.getColumnHeader(e, n, r), h = new
|
|
964
|
+
const l = o != null ? o : L(), i = a || this.getColumnHeader(e, n, r), h = new Ue(l, s, r, i, u);
|
|
964
965
|
if (h.setSubunitId(n), this._ensureUnit(e).set(l, h), this._tableAdd$.next({
|
|
965
966
|
unitId: e,
|
|
966
967
|
subUnitId: n,
|
|
@@ -1089,10 +1090,10 @@ let T = class extends Q {
|
|
|
1089
1090
|
else if (o === "column") {
|
|
1090
1091
|
d.endColumn += l;
|
|
1091
1092
|
for (let c = 0; c < l; c++) {
|
|
1092
|
-
const g = this._localeService.t("sheets-table.columnPrefix"),
|
|
1093
|
-
i != null && i[c] &&
|
|
1093
|
+
const g = this._localeService.t("sheets-table.columnPrefix"), R = new j(L(), te(r.getColumnsCount() + 1 + c, g));
|
|
1094
|
+
i != null && i[c] && R.fromJSON(i[c]);
|
|
1094
1095
|
const w = u + c - h.startColumn;
|
|
1095
|
-
r.insertColumn(w,
|
|
1096
|
+
r.insertColumn(w, R);
|
|
1096
1097
|
}
|
|
1097
1098
|
}
|
|
1098
1099
|
} else if (o === "row")
|
|
@@ -1201,7 +1202,7 @@ let T = class extends Q {
|
|
|
1201
1202
|
const u = o.worksheet;
|
|
1202
1203
|
let l;
|
|
1203
1204
|
n[a].tables ? l = n[a].tables : Array.isArray(n[a]) && (l = n[a]), l && l.forEach((i) => {
|
|
1204
|
-
const h = this.getColumnHeader(e, a, i.range), d = new
|
|
1205
|
+
const h = this.getColumnHeader(e, a, i.range), d = new Ue(i.id, i.name, i.range, h, i.options);
|
|
1205
1206
|
if (d.setTableMeta(i.meta), i.columns.length && d.setColumns(i.columns), i.filters) {
|
|
1206
1207
|
const c = d.getTableFilters();
|
|
1207
1208
|
c.fromJSON(i.filters), c.doFilter(u, d.getTableFilterRange());
|
|
@@ -1225,16 +1226,16 @@ let T = class extends Q {
|
|
|
1225
1226
|
}), this._tableMap.clear();
|
|
1226
1227
|
}
|
|
1227
1228
|
};
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
],
|
|
1232
|
-
var
|
|
1233
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
1229
|
+
C = Dn([
|
|
1230
|
+
$e(0, B),
|
|
1231
|
+
$e(1, _(be))
|
|
1232
|
+
], C);
|
|
1233
|
+
var xn = Object.getOwnPropertyDescriptor, On = (t, e, n, s) => {
|
|
1234
|
+
for (var r = s > 1 ? void 0 : s ? xn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
1234
1235
|
(o = t[a]) && (r = o(r) || r);
|
|
1235
1236
|
return r;
|
|
1236
|
-
},
|
|
1237
|
-
let X = class extends
|
|
1237
|
+
}, Un = (t, e) => (n, s) => e(n, s, t);
|
|
1238
|
+
let X = class extends H {
|
|
1238
1239
|
constructor(t) {
|
|
1239
1240
|
super(), this._tableManager = t;
|
|
1240
1241
|
}
|
|
@@ -1278,52 +1279,52 @@ let X = class extends Q {
|
|
|
1278
1279
|
return ue(t, e, n, s);
|
|
1279
1280
|
}
|
|
1280
1281
|
};
|
|
1281
|
-
X =
|
|
1282
|
-
|
|
1282
|
+
X = On([
|
|
1283
|
+
Un(0, _(C))
|
|
1283
1284
|
], X);
|
|
1284
|
-
const
|
|
1285
|
+
const k = {
|
|
1285
1286
|
id: "sheet.mutation.add-table",
|
|
1286
1287
|
type: N.MUTATION,
|
|
1287
1288
|
handler: (t, e) => {
|
|
1288
1289
|
const { tableId: n, unitId: s, subUnitId: r, name: a, range: o, header: u, options: l } = e;
|
|
1289
1290
|
return t.get(X).addTable(s, r, a, o, u, n, l), !0;
|
|
1290
1291
|
}
|
|
1291
|
-
},
|
|
1292
|
+
}, Q = {
|
|
1292
1293
|
id: "sheet.mutation.delete-table",
|
|
1293
1294
|
type: N.MUTATION,
|
|
1294
1295
|
handler: (t, e) => {
|
|
1295
1296
|
const { unitId: n, subUnitId: s, tableId: r } = e;
|
|
1296
1297
|
return t.get(X).deleteTable(n, s, r), !0;
|
|
1297
1298
|
}
|
|
1298
|
-
},
|
|
1299
|
+
}, $n = {
|
|
1299
1300
|
id: "sheet.command.add-table",
|
|
1300
1301
|
type: N.COMMAND,
|
|
1301
1302
|
handler: (t, e) => {
|
|
1302
1303
|
var w;
|
|
1303
1304
|
if (!e)
|
|
1304
1305
|
return !1;
|
|
1305
|
-
const n = t.get(A), s = t.get(
|
|
1306
|
+
const n = t.get(A), s = t.get(D), r = t.get(be), a = (w = e.id) != null ? w : L();
|
|
1306
1307
|
let o = e.name;
|
|
1307
1308
|
if (!o) {
|
|
1308
|
-
const f = t.get(
|
|
1309
|
+
const f = t.get(C).getTableList(e.unitId).length;
|
|
1309
1310
|
o = `${r.t("sheets-table.tablePrefix")}${f + 1}`;
|
|
1310
1311
|
}
|
|
1311
|
-
const u = [], l = [], i = t.get(
|
|
1312
|
-
return u.push({ id:
|
|
1312
|
+
const u = [], l = [], i = t.get(C), { unitId: h, subUnitId: d, range: c } = e, g = i.getColumnHeader(h, d, c, r.t("sheets-table.columnPrefix"));
|
|
1313
|
+
return u.push({ id: k.id, params: { ...e, tableId: a, name: o, header: g } }), l.push({ id: Q.id, params: { tableId: a, unitId: e.unitId } }), E(u, s) && n.pushUndoRedo({
|
|
1313
1314
|
unitID: e.unitId,
|
|
1314
1315
|
undoMutations: l,
|
|
1315
1316
|
redoMutations: u
|
|
1316
1317
|
}), !0;
|
|
1317
1318
|
}
|
|
1318
|
-
},
|
|
1319
|
+
}, An = {
|
|
1319
1320
|
id: "sheet.command.delete-table",
|
|
1320
1321
|
type: N.COMMAND,
|
|
1321
1322
|
handler: (t, e) => {
|
|
1322
1323
|
if (!e)
|
|
1323
1324
|
return !1;
|
|
1324
|
-
const n = t.get(A), s = t.get(
|
|
1325
|
-
return i ? (o.push({ id:
|
|
1326
|
-
id:
|
|
1325
|
+
const n = t.get(A), s = t.get(D), r = t.get(C), a = t.get(Le), o = [], u = [], l = r.getTable(e.unitId, e.tableId), i = l == null ? void 0 : l.toJSON();
|
|
1326
|
+
return i ? (o.push({ id: Q.id, params: { ...e } }), u.push({
|
|
1327
|
+
id: k.id,
|
|
1327
1328
|
params: {
|
|
1328
1329
|
unitId: e.unitId,
|
|
1329
1330
|
subUnitId: e.subUnitId,
|
|
@@ -1332,39 +1333,39 @@ const J = {
|
|
|
1332
1333
|
range: i.range,
|
|
1333
1334
|
options: i.options
|
|
1334
1335
|
}
|
|
1335
|
-
}),
|
|
1336
|
+
}), E(o, s) && n.pushUndoRedo({
|
|
1336
1337
|
unitID: e.unitId,
|
|
1337
1338
|
undoMutations: u,
|
|
1338
1339
|
redoMutations: o
|
|
1339
1340
|
}), !0) : (a.error("[TableManager]: Table not found"), !1);
|
|
1340
1341
|
}
|
|
1341
|
-
},
|
|
1342
|
+
}, _e = {
|
|
1342
1343
|
id: "sheet.mutation.set-table-filter",
|
|
1343
1344
|
type: N.MUTATION,
|
|
1344
1345
|
handler: (t, e) => {
|
|
1345
1346
|
const { tableId: n, unitId: s, column: r, tableFilter: a } = e;
|
|
1346
|
-
return t.get(
|
|
1347
|
+
return t.get(C).addFilter(s, n, r, a), !0;
|
|
1347
1348
|
}
|
|
1348
|
-
},
|
|
1349
|
+
}, Bn = {
|
|
1349
1350
|
id: "sheet.command.set-table-filter",
|
|
1350
1351
|
type: N.COMMAND,
|
|
1351
1352
|
handler: (t, e) => {
|
|
1352
1353
|
if (!e)
|
|
1353
1354
|
return !1;
|
|
1354
|
-
const n = t.get(A), s = t.get(
|
|
1355
|
-
return a.push({ id:
|
|
1355
|
+
const n = t.get(A), s = t.get(D), r = e.tableId || L(), a = [], o = [];
|
|
1356
|
+
return a.push({ id: _e.id, params: { ...e, tableId: r } }), o.push({ id: _e.id, params: { ...e, tableId: r, tableFilter: void 0 } }), E(a, s) && n.pushUndoRedo({
|
|
1356
1357
|
unitID: e.unitId,
|
|
1357
1358
|
undoMutations: o,
|
|
1358
1359
|
redoMutations: a
|
|
1359
1360
|
}), !0;
|
|
1360
1361
|
}
|
|
1361
|
-
},
|
|
1362
|
-
var
|
|
1363
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
1362
|
+
}, nt = "SHEET_TABLE_PLUGIN", re = "SHEET_TABLE", En = "table-custom";
|
|
1363
|
+
var Ln = Object.getOwnPropertyDescriptor, Wn = (t, e, n, s) => {
|
|
1364
|
+
for (var r = s > 1 ? void 0 : s ? Ln(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
1364
1365
|
(o = t[a]) && (r = o(r) || r);
|
|
1365
1366
|
return r;
|
|
1366
1367
|
}, ae = (t, e) => (n, s) => e(n, s, t);
|
|
1367
|
-
let W = class extends
|
|
1368
|
+
let W = class extends H {
|
|
1368
1369
|
constructor(e, n, s, r) {
|
|
1369
1370
|
super();
|
|
1370
1371
|
b(this, "_tableRangeRTree", /* @__PURE__ */ new Map());
|
|
@@ -1373,13 +1374,13 @@ let W = class extends Q {
|
|
|
1373
1374
|
getContainerTableWithRange(e, n, s) {
|
|
1374
1375
|
const r = this._ensureTableRangeRTree(e), o = Array.from(r.bulkSearch([{ unitId: e, sheetId: n, range: s }])).find((u) => {
|
|
1375
1376
|
const l = this._tableManager.getTable(e, String(u));
|
|
1376
|
-
return l ?
|
|
1377
|
+
return l ? Re.contains(l.getRange(), s) : !1;
|
|
1377
1378
|
});
|
|
1378
1379
|
if (o)
|
|
1379
1380
|
return this._tableManager.getTable(e, String(o));
|
|
1380
1381
|
}
|
|
1381
1382
|
_ensureTableRangeRTree(e) {
|
|
1382
|
-
return this._tableRangeRTree.has(e) || this._tableRangeRTree.set(e, new
|
|
1383
|
+
return this._tableRangeRTree.has(e) || this._tableRangeRTree.set(e, new it()), this._tableRangeRTree.get(e);
|
|
1383
1384
|
}
|
|
1384
1385
|
registerTableChangeEvent() {
|
|
1385
1386
|
this.disposeWithMe(
|
|
@@ -1421,8 +1422,8 @@ let W = class extends Q {
|
|
|
1421
1422
|
}
|
|
1422
1423
|
registerTableHeaderInterceptor() {
|
|
1423
1424
|
this.disposeWithMe(
|
|
1424
|
-
this._sheetInterceptorService.intercept(
|
|
1425
|
-
effect:
|
|
1425
|
+
this._sheetInterceptorService.intercept(Ve.CELL_CONTENT, {
|
|
1426
|
+
effect: lt.Value,
|
|
1426
1427
|
handler: (e, n, s) => {
|
|
1427
1428
|
const { row: r, col: a, unitId: o, subUnitId: u } = n, l = this._ensureTableRangeRTree(o);
|
|
1428
1429
|
if ((e == null ? void 0 : e.v) === void 0 && l) {
|
|
@@ -1465,7 +1466,7 @@ let W = class extends Q {
|
|
|
1465
1466
|
}
|
|
1466
1467
|
},
|
|
1467
1468
|
businesses: [z.UNIVER_SHEET],
|
|
1468
|
-
pluginName:
|
|
1469
|
+
pluginName: nt,
|
|
1469
1470
|
onLoad: (e, n) => {
|
|
1470
1471
|
this._fromJSON(e, n);
|
|
1471
1472
|
},
|
|
@@ -1481,7 +1482,7 @@ let W = class extends Q {
|
|
|
1481
1482
|
// eslint-disable-next-line max-lines-per-function
|
|
1482
1483
|
getMutations: (e) => {
|
|
1483
1484
|
var n;
|
|
1484
|
-
if (e.id ===
|
|
1485
|
+
if (e.id === gt.id) {
|
|
1485
1486
|
const s = e.params, r = s.unitId || this._univerInstanceService.getCurrentUnitOfType(z.UNIVER_SHEET).getUnitId(), a = s.subUnitId || ((n = this._univerInstanceService.getCurrentUnitOfType(z.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : n.getSheetId());
|
|
1486
1487
|
if (!r || !a)
|
|
1487
1488
|
return { redos: [], undos: [] };
|
|
@@ -1492,14 +1493,14 @@ let W = class extends Q {
|
|
|
1492
1493
|
return o.forEach((i) => {
|
|
1493
1494
|
const h = i.toJSON();
|
|
1494
1495
|
u.push({
|
|
1495
|
-
id:
|
|
1496
|
+
id: Q.id,
|
|
1496
1497
|
params: {
|
|
1497
1498
|
unitId: r,
|
|
1498
1499
|
subUnitId: a,
|
|
1499
1500
|
tableId: h.id
|
|
1500
1501
|
}
|
|
1501
1502
|
}), l.push({
|
|
1502
|
-
id:
|
|
1503
|
+
id: k.id,
|
|
1503
1504
|
params: {
|
|
1504
1505
|
unitId: r,
|
|
1505
1506
|
subUnitId: a,
|
|
@@ -1514,7 +1515,7 @@ let W = class extends Q {
|
|
|
1514
1515
|
}
|
|
1515
1516
|
});
|
|
1516
1517
|
}), { redos: u, undos: l };
|
|
1517
|
-
} else if (e.id ===
|
|
1518
|
+
} else if (e.id === mt.id) {
|
|
1518
1519
|
const s = e.params, { unitId: r, subUnitId: a, targetSubUnitId: o } = s;
|
|
1519
1520
|
if (!r || !a || !o)
|
|
1520
1521
|
return { redos: [], undos: [] };
|
|
@@ -1525,7 +1526,7 @@ let W = class extends Q {
|
|
|
1525
1526
|
return u.forEach((h) => {
|
|
1526
1527
|
const d = h.toJSON(), c = L();
|
|
1527
1528
|
l.push({
|
|
1528
|
-
id:
|
|
1529
|
+
id: k.id,
|
|
1529
1530
|
params: {
|
|
1530
1531
|
unitId: r,
|
|
1531
1532
|
subUnitId: o,
|
|
@@ -1542,7 +1543,7 @@ let W = class extends Q {
|
|
|
1542
1543
|
}
|
|
1543
1544
|
}
|
|
1544
1545
|
}), i.push({
|
|
1545
|
-
id:
|
|
1546
|
+
id: Q.id,
|
|
1546
1547
|
params: {
|
|
1547
1548
|
unitId: r,
|
|
1548
1549
|
subUnitId: o,
|
|
@@ -1560,11 +1561,11 @@ let W = class extends Q {
|
|
|
1560
1561
|
super.dispose(), this._tableRangeRTree.clear();
|
|
1561
1562
|
}
|
|
1562
1563
|
};
|
|
1563
|
-
W =
|
|
1564
|
-
ae(0,
|
|
1565
|
-
ae(1,
|
|
1566
|
-
ae(2,
|
|
1567
|
-
ae(3,
|
|
1564
|
+
W = Wn([
|
|
1565
|
+
ae(0, _(B)),
|
|
1566
|
+
ae(1, _(Ce)),
|
|
1567
|
+
ae(2, _(C)),
|
|
1568
|
+
ae(3, _(ot))
|
|
1568
1569
|
], W);
|
|
1569
1570
|
const S = {
|
|
1570
1571
|
id: "sheet.mutation.set-sheet-table",
|
|
@@ -1573,19 +1574,19 @@ const S = {
|
|
|
1573
1574
|
if (!e)
|
|
1574
1575
|
return !1;
|
|
1575
1576
|
const { unitId: n, tableId: s, config: r } = e;
|
|
1576
|
-
return t.get(
|
|
1577
|
+
return t.get(C).setTableByConfig(n, s, r), !0;
|
|
1577
1578
|
}
|
|
1578
|
-
},
|
|
1579
|
+
}, Hn = {
|
|
1579
1580
|
id: "sheet.command.add-table-theme",
|
|
1580
1581
|
type: N.COMMAND,
|
|
1581
1582
|
handler: (t, e) => {
|
|
1582
1583
|
if (!e)
|
|
1583
1584
|
return !1;
|
|
1584
|
-
const n = t.get(
|
|
1585
|
+
const n = t.get(C), { unitId: s, tableId: r, themeStyle: a } = e, o = [], u = [], l = n.getTableById(s, r);
|
|
1585
1586
|
if (!l) return !1;
|
|
1586
1587
|
const i = l.getSubunitId();
|
|
1587
1588
|
o.push({
|
|
1588
|
-
id:
|
|
1589
|
+
id: Pe.id,
|
|
1589
1590
|
params: {
|
|
1590
1591
|
unitId: s,
|
|
1591
1592
|
subUnitId: i,
|
|
@@ -1612,57 +1613,57 @@ const S = {
|
|
|
1612
1613
|
}
|
|
1613
1614
|
}
|
|
1614
1615
|
}), u.push({
|
|
1615
|
-
id:
|
|
1616
|
+
id: qe.id,
|
|
1616
1617
|
params: {
|
|
1617
1618
|
unitId: s,
|
|
1618
1619
|
subUnitId: i,
|
|
1619
1620
|
styleName: a.getName()
|
|
1620
1621
|
}
|
|
1621
1622
|
});
|
|
1622
|
-
const h = t.get(
|
|
1623
|
-
return
|
|
1623
|
+
const h = t.get(D);
|
|
1624
|
+
return E(o, h) && t.get(A).pushUndoRedo({
|
|
1624
1625
|
unitID: s,
|
|
1625
1626
|
undoMutations: u,
|
|
1626
1627
|
redoMutations: o
|
|
1627
1628
|
}), !0;
|
|
1628
1629
|
}
|
|
1629
|
-
},
|
|
1630
|
+
}, Vn = {
|
|
1630
1631
|
id: "sheet.command.remove-table-theme",
|
|
1631
1632
|
type: N.COMMAND,
|
|
1632
1633
|
handler: (t, e) => {
|
|
1633
1634
|
if (!e)
|
|
1634
1635
|
return !1;
|
|
1635
|
-
const { unitId: n, tableId: s, themeName: r } = e, a = t.get(
|
|
1636
|
+
const { unitId: n, tableId: s, themeName: r } = e, a = t.get(C), o = t.get(Je), u = a.getTableById(n, s);
|
|
1636
1637
|
if (!u) return !1;
|
|
1637
1638
|
const l = u.getSubunitId(), i = [], h = [], d = o.getRegisteredRangeThemes().filter((f) => f == null ? void 0 : f.startsWith("table-default"));
|
|
1638
|
-
let g = o.getRegisteredRangeThemes().filter((f) => f == null ? void 0 : f.startsWith(
|
|
1639
|
-
g || (g = d[0]), i.push({ id: S.id, params: { unitId: n, subUnitId: l, tableId: s, config: { theme: g } } }), i.push({ id:
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1642
|
-
const w = t.get(
|
|
1643
|
-
return
|
|
1639
|
+
let g = o.getRegisteredRangeThemes().filter((f) => f == null ? void 0 : f.startsWith(En)).find((f) => f !== r);
|
|
1640
|
+
g || (g = d[0]), i.push({ id: S.id, params: { unitId: n, subUnitId: l, tableId: s, config: { theme: g } } }), i.push({ id: qe.id, params: { unitId: n, subUnitId: l, styleName: r } });
|
|
1641
|
+
const R = o.getDefaultRangeThemeStyle(r);
|
|
1642
|
+
R && (h.push({ id: Pe.id, params: { unitId: n, subUnitId: l, styleJSON: R.toJson() } }), h.push({ id: S.id, params: { unitId: n, subUnitId: l, tableId: s, config: { theme: r } } }));
|
|
1643
|
+
const w = t.get(D);
|
|
1644
|
+
return E(i, w) && t.get(A).pushUndoRedo({
|
|
1644
1645
|
unitID: n,
|
|
1645
1646
|
redoMutations: i,
|
|
1646
1647
|
undoMutations: h
|
|
1647
1648
|
}), !0;
|
|
1648
1649
|
}
|
|
1649
|
-
},
|
|
1650
|
+
}, Pn = {
|
|
1650
1651
|
id: "sheet.command.set-table-config",
|
|
1651
1652
|
type: N.COMMAND,
|
|
1652
1653
|
// eslint-disable-next-line max-lines-per-function
|
|
1653
1654
|
handler: (t, e) => {
|
|
1654
1655
|
if (!e)
|
|
1655
1656
|
return !1;
|
|
1656
|
-
const { unitId: n, tableId: s, name: r, updateRange: a, rowColOperation: o, theme: u } = e, l = t.get(
|
|
1657
|
+
const { unitId: n, tableId: s, name: r, updateRange: a, rowColOperation: o, theme: u } = e, l = t.get(C), i = l.getTableById(n, s);
|
|
1657
1658
|
if (!i) return !1;
|
|
1658
|
-
const h = {}, d = {}, c = t.get(
|
|
1659
|
-
if (
|
|
1660
|
-
w.add(
|
|
1661
|
-
}), l.getTableList(n).forEach((
|
|
1662
|
-
w.add(
|
|
1659
|
+
const h = {}, d = {}, c = t.get(be), R = t.get(B).getCurrentUnitOfType(z.UNIVER_SHEET), w = /* @__PURE__ */ new Set();
|
|
1660
|
+
if (R && (R.getSheets().forEach((T) => {
|
|
1661
|
+
w.add(T.getName());
|
|
1662
|
+
}), l.getTableList(n).forEach((T) => {
|
|
1663
|
+
w.add(T.name);
|
|
1663
1664
|
})), r) {
|
|
1664
|
-
if (!
|
|
1665
|
-
return t.get(
|
|
1665
|
+
if (!ut(r, w))
|
|
1666
|
+
return t.get(Le).warn(c.t("sheets-table.tableNameError")), !1;
|
|
1666
1667
|
h.name = i.getDisplayName(), d.name = r;
|
|
1667
1668
|
}
|
|
1668
1669
|
o && (h.rowColOperation = {
|
|
@@ -1673,13 +1674,13 @@ const S = {
|
|
|
1673
1674
|
}, d.rowColOperation = o), a && (h.updateRange = {
|
|
1674
1675
|
newRange: i.getRange()
|
|
1675
1676
|
}, d.updateRange = a), u && (h.theme = i.getTableStyleId(), d.theme = u);
|
|
1676
|
-
const
|
|
1677
|
+
const p = {
|
|
1677
1678
|
unitId: n,
|
|
1678
1679
|
subUnitId: i.getSubunitId(),
|
|
1679
1680
|
tableId: s,
|
|
1680
1681
|
config: d
|
|
1681
1682
|
};
|
|
1682
|
-
return t.get(
|
|
1683
|
+
return t.get(D).executeCommand(S.id, p), t.get(A).pushUndoRedo({
|
|
1683
1684
|
unitID: n,
|
|
1684
1685
|
undoMutations: [
|
|
1685
1686
|
{
|
|
@@ -1695,28 +1696,28 @@ const S = {
|
|
|
1695
1696
|
redoMutations: [
|
|
1696
1697
|
{
|
|
1697
1698
|
id: S.id,
|
|
1698
|
-
params:
|
|
1699
|
+
params: p
|
|
1699
1700
|
}
|
|
1700
1701
|
]
|
|
1701
1702
|
}), !0;
|
|
1702
1703
|
}
|
|
1703
|
-
},
|
|
1704
|
+
}, qn = {
|
|
1704
1705
|
id: "sheet.command.table-insert-row",
|
|
1705
1706
|
type: N.COMMAND,
|
|
1706
1707
|
handler: (t) => {
|
|
1707
|
-
const e = t.get(
|
|
1708
|
+
const e = t.get(B), n = $(e);
|
|
1708
1709
|
if (!n)
|
|
1709
1710
|
return !1;
|
|
1710
|
-
const { workbook: s, worksheet: r, unitId: a, subUnitId: o } = n, l = t.get(
|
|
1711
|
+
const { workbook: s, worksheet: r, unitId: a, subUnitId: o } = n, l = t.get(we).getCurrentSelections();
|
|
1711
1712
|
if (!l.length || l.length > 1)
|
|
1712
1713
|
return !1;
|
|
1713
|
-
t.get(
|
|
1714
|
+
t.get(C);
|
|
1714
1715
|
const h = l[0].range, c = t.get(W).getContainerTableWithRange(a, o, h);
|
|
1715
1716
|
if (!c) return !1;
|
|
1716
|
-
const g = h.endRow - h.startRow + 1, w = r.getRowCount() - 1,
|
|
1717
|
-
if (w -
|
|
1717
|
+
const g = h.endRow - h.startRow + 1, w = r.getRowCount() - 1, p = r.getCellMatrix().getDataRange().endRow, f = [], I = [];
|
|
1718
|
+
if (w - p < g)
|
|
1718
1719
|
f.push({
|
|
1719
|
-
id:
|
|
1720
|
+
id: ke.id,
|
|
1720
1721
|
params: {
|
|
1721
1722
|
unitId: a,
|
|
1722
1723
|
subUnitId: o,
|
|
@@ -1750,7 +1751,7 @@ const S = {
|
|
|
1750
1751
|
}
|
|
1751
1752
|
}
|
|
1752
1753
|
}), I.push({
|
|
1753
|
-
id:
|
|
1754
|
+
id: Qe.id,
|
|
1754
1755
|
params: {
|
|
1755
1756
|
unitId: a,
|
|
1756
1757
|
subUnitId: o,
|
|
@@ -1787,14 +1788,14 @@ const S = {
|
|
|
1787
1788
|
}
|
|
1788
1789
|
}
|
|
1789
1790
|
});
|
|
1790
|
-
const ee =
|
|
1791
|
+
const ee = fe(
|
|
1791
1792
|
t,
|
|
1792
1793
|
{
|
|
1793
1794
|
unitId: a,
|
|
1794
1795
|
subUnitId: o,
|
|
1795
1796
|
range: {
|
|
1796
1797
|
startRow: h.startRow,
|
|
1797
|
-
endRow:
|
|
1798
|
+
endRow: p,
|
|
1798
1799
|
startColumn: v.startColumn,
|
|
1799
1800
|
endColumn: v.endColumn
|
|
1800
1801
|
}
|
|
@@ -1804,7 +1805,7 @@ const S = {
|
|
|
1804
1805
|
subUnitId: o,
|
|
1805
1806
|
range: {
|
|
1806
1807
|
startRow: h.startRow + g,
|
|
1807
|
-
endRow:
|
|
1808
|
+
endRow: p + g,
|
|
1808
1809
|
startColumn: v.startColumn,
|
|
1809
1810
|
endColumn: v.endColumn
|
|
1810
1811
|
}
|
|
@@ -1812,35 +1813,35 @@ const S = {
|
|
|
1812
1813
|
);
|
|
1813
1814
|
ee && (f.push(...ee.redos), I.push(...ee.undos));
|
|
1814
1815
|
}
|
|
1815
|
-
const U = t.get(
|
|
1816
|
-
return
|
|
1816
|
+
const U = t.get(D);
|
|
1817
|
+
return E(f, U) && t.get(A).pushUndoRedo({
|
|
1817
1818
|
unitID: a,
|
|
1818
1819
|
undoMutations: I,
|
|
1819
1820
|
redoMutations: f
|
|
1820
1821
|
}), !0;
|
|
1821
1822
|
}
|
|
1822
|
-
},
|
|
1823
|
+
}, Jn = {
|
|
1823
1824
|
id: "sheet.command.table-insert-col",
|
|
1824
1825
|
type: N.COMMAND,
|
|
1825
1826
|
handler: (t) => {
|
|
1826
|
-
const e = t.get(
|
|
1827
|
+
const e = t.get(B), n = $(e);
|
|
1827
1828
|
if (!n)
|
|
1828
1829
|
return !1;
|
|
1829
|
-
const { worksheet: s, unitId: r, subUnitId: a } = n, u = t.get(
|
|
1830
|
+
const { worksheet: s, unitId: r, subUnitId: a } = n, u = t.get(we).getCurrentSelections();
|
|
1830
1831
|
if (!u.length || u.length > 1)
|
|
1831
1832
|
return !1;
|
|
1832
1833
|
const i = u[0].range, d = t.get(W).getContainerTableWithRange(r, a, i);
|
|
1833
1834
|
if (!d) return !1;
|
|
1834
|
-
const c = i.endColumn - i.startColumn + 1,
|
|
1835
|
-
if (
|
|
1836
|
-
|
|
1837
|
-
id:
|
|
1835
|
+
const c = i.endColumn - i.startColumn + 1, R = s.getColumnCount() - 1, w = s.getCellMatrix().getDataRange().endColumn, p = [], f = [];
|
|
1836
|
+
if (R - w < c)
|
|
1837
|
+
p.push({
|
|
1838
|
+
id: Ye.id,
|
|
1838
1839
|
params: {
|
|
1839
1840
|
unitId: r,
|
|
1840
1841
|
subUnitId: a,
|
|
1841
1842
|
range: { ...i }
|
|
1842
1843
|
}
|
|
1843
|
-
}),
|
|
1844
|
+
}), p.push({
|
|
1844
1845
|
id: S.id,
|
|
1845
1846
|
params: {
|
|
1846
1847
|
unitId: r,
|
|
@@ -1871,7 +1872,7 @@ const S = {
|
|
|
1871
1872
|
}
|
|
1872
1873
|
}
|
|
1873
1874
|
}), f.push({
|
|
1874
|
-
id:
|
|
1875
|
+
id: Ge.id,
|
|
1875
1876
|
params: {
|
|
1876
1877
|
unitId: r,
|
|
1877
1878
|
subUnitId: a,
|
|
@@ -1879,8 +1880,8 @@ const S = {
|
|
|
1879
1880
|
}
|
|
1880
1881
|
});
|
|
1881
1882
|
else {
|
|
1882
|
-
const
|
|
1883
|
-
|
|
1883
|
+
const T = d.getRange();
|
|
1884
|
+
p.push({
|
|
1884
1885
|
id: S.id,
|
|
1885
1886
|
params: {
|
|
1886
1887
|
unitId: r,
|
|
@@ -1911,14 +1912,14 @@ const S = {
|
|
|
1911
1912
|
}
|
|
1912
1913
|
}
|
|
1913
1914
|
});
|
|
1914
|
-
const v =
|
|
1915
|
+
const v = fe(
|
|
1915
1916
|
t,
|
|
1916
1917
|
{
|
|
1917
1918
|
unitId: r,
|
|
1918
1919
|
subUnitId: a,
|
|
1919
1920
|
range: {
|
|
1920
|
-
startRow:
|
|
1921
|
-
endRow:
|
|
1921
|
+
startRow: T.startRow,
|
|
1922
|
+
endRow: T.endRow,
|
|
1922
1923
|
startColumn: i.startColumn,
|
|
1923
1924
|
endColumn: w
|
|
1924
1925
|
}
|
|
@@ -1927,37 +1928,37 @@ const S = {
|
|
|
1927
1928
|
unitId: r,
|
|
1928
1929
|
subUnitId: a,
|
|
1929
1930
|
range: {
|
|
1930
|
-
startRow:
|
|
1931
|
-
endRow:
|
|
1931
|
+
startRow: T.startRow,
|
|
1932
|
+
endRow: T.endRow,
|
|
1932
1933
|
startColumn: i.startColumn + c,
|
|
1933
1934
|
endColumn: w + c
|
|
1934
1935
|
}
|
|
1935
1936
|
}
|
|
1936
1937
|
);
|
|
1937
|
-
v && (
|
|
1938
|
+
v && (p.push(...v.redos), f.push(...v.undos));
|
|
1938
1939
|
}
|
|
1939
|
-
const I = t.get(
|
|
1940
|
-
return
|
|
1940
|
+
const I = t.get(D);
|
|
1941
|
+
return E(p, I) && t.get(A).pushUndoRedo({
|
|
1941
1942
|
unitID: r,
|
|
1942
1943
|
undoMutations: f,
|
|
1943
|
-
redoMutations:
|
|
1944
|
+
redoMutations: p
|
|
1944
1945
|
}), !0;
|
|
1945
1946
|
}
|
|
1946
|
-
},
|
|
1947
|
+
}, kn = {
|
|
1947
1948
|
id: "sheet.command.table-remove-row",
|
|
1948
1949
|
type: N.COMMAND,
|
|
1949
1950
|
handler: (t, e) => {
|
|
1950
1951
|
if (!e)
|
|
1951
1952
|
return !1;
|
|
1952
|
-
const n = t.get(
|
|
1953
|
+
const n = t.get(B), s = $(n);
|
|
1953
1954
|
if (!s)
|
|
1954
1955
|
return !1;
|
|
1955
|
-
const { unitId: r, subUnitId: a } = s, u = t.get(
|
|
1956
|
+
const { unitId: r, subUnitId: a } = s, u = t.get(we).getCurrentSelections();
|
|
1956
1957
|
if (!u.length || u.length > 1)
|
|
1957
1958
|
return !1;
|
|
1958
1959
|
const i = u[0].range, d = t.get(W).getContainerTableWithRange(r, a, i);
|
|
1959
1960
|
if (!d) return !1;
|
|
1960
|
-
const c = i.endRow - i.startRow + 1, g = [],
|
|
1961
|
+
const c = i.endRow - i.startRow + 1, g = [], R = [], w = d.getRange();
|
|
1961
1962
|
g.push({
|
|
1962
1963
|
id: S.id,
|
|
1963
1964
|
params: {
|
|
@@ -1973,7 +1974,7 @@ const S = {
|
|
|
1973
1974
|
}
|
|
1974
1975
|
}
|
|
1975
1976
|
}
|
|
1976
|
-
}),
|
|
1977
|
+
}), R.push({
|
|
1977
1978
|
id: S.id,
|
|
1978
1979
|
params: {
|
|
1979
1980
|
unitId: r,
|
|
@@ -1986,7 +1987,7 @@ const S = {
|
|
|
1986
1987
|
}
|
|
1987
1988
|
}
|
|
1988
1989
|
});
|
|
1989
|
-
const f = s.worksheet.getCellMatrix().getDataRange().endRow, I =
|
|
1990
|
+
const f = s.worksheet.getCellMatrix().getDataRange().endRow, I = fe(
|
|
1990
1991
|
t,
|
|
1991
1992
|
{
|
|
1992
1993
|
unitId: r,
|
|
@@ -2009,32 +2010,32 @@ const S = {
|
|
|
2009
2010
|
}
|
|
2010
2011
|
}
|
|
2011
2012
|
);
|
|
2012
|
-
I && (g.push(...I.redos),
|
|
2013
|
-
const U = t.get(
|
|
2014
|
-
return
|
|
2013
|
+
I && (g.push(...I.redos), R.push(...I.undos));
|
|
2014
|
+
const U = t.get(D);
|
|
2015
|
+
return E(g, U) && t.get(A).pushUndoRedo({
|
|
2015
2016
|
unitID: r,
|
|
2016
|
-
undoMutations:
|
|
2017
|
+
undoMutations: R,
|
|
2017
2018
|
redoMutations: g
|
|
2018
2019
|
}), !0;
|
|
2019
2020
|
}
|
|
2020
|
-
},
|
|
2021
|
+
}, Qn = {
|
|
2021
2022
|
id: "sheet.command.table-remove-col",
|
|
2022
2023
|
type: N.COMMAND,
|
|
2023
2024
|
handler: (t, e) => {
|
|
2024
2025
|
if (!e)
|
|
2025
2026
|
return !1;
|
|
2026
|
-
const n = t.get(
|
|
2027
|
+
const n = t.get(B), s = $(n);
|
|
2027
2028
|
if (!s)
|
|
2028
2029
|
return !1;
|
|
2029
2030
|
const { workbook: r, unitId: a, subUnitId: o } = s;
|
|
2030
|
-
t.get(
|
|
2031
|
-
const l = t.get(
|
|
2031
|
+
t.get(C);
|
|
2032
|
+
const l = t.get(we).getCurrentSelections();
|
|
2032
2033
|
if (!l.length || l.length > 1)
|
|
2033
2034
|
return !1;
|
|
2034
2035
|
const h = l[0].range, c = t.get(W).getContainerTableWithRange(a, o, h);
|
|
2035
2036
|
if (!c) return !1;
|
|
2036
|
-
const g = h.endColumn - h.startColumn + 1,
|
|
2037
|
-
|
|
2037
|
+
const g = h.endColumn - h.startColumn + 1, R = [], w = [], p = c.getRange();
|
|
2038
|
+
R.push({
|
|
2038
2039
|
id: S.id,
|
|
2039
2040
|
params: {
|
|
2040
2041
|
unitId: a,
|
|
@@ -2050,10 +2051,10 @@ const S = {
|
|
|
2050
2051
|
}
|
|
2051
2052
|
}
|
|
2052
2053
|
});
|
|
2053
|
-
const f = [], I = h.startColumn -
|
|
2054
|
+
const f = [], I = h.startColumn - p.startColumn;
|
|
2054
2055
|
for (let se = 0; se < g; se++) {
|
|
2055
|
-
const
|
|
2056
|
-
|
|
2056
|
+
const Ie = c.getTableInfo().columns[I + se];
|
|
2057
|
+
Ie && f.push(Ie);
|
|
2057
2058
|
}
|
|
2058
2059
|
w.push({
|
|
2059
2060
|
id: S.id,
|
|
@@ -2072,44 +2073,103 @@ const S = {
|
|
|
2072
2073
|
}
|
|
2073
2074
|
}
|
|
2074
2075
|
});
|
|
2075
|
-
const
|
|
2076
|
+
const T = s.worksheet.getCellMatrix().getDataRange().endColumn, v = fe(
|
|
2076
2077
|
t,
|
|
2077
2078
|
{
|
|
2078
2079
|
unitId: a,
|
|
2079
2080
|
subUnitId: o,
|
|
2080
2081
|
range: {
|
|
2081
|
-
startRow:
|
|
2082
|
-
endRow:
|
|
2082
|
+
startRow: p.startRow,
|
|
2083
|
+
endRow: p.endRow,
|
|
2083
2084
|
startColumn: h.endColumn + 1,
|
|
2084
|
-
endColumn:
|
|
2085
|
+
endColumn: T
|
|
2085
2086
|
}
|
|
2086
2087
|
},
|
|
2087
2088
|
{
|
|
2088
2089
|
unitId: a,
|
|
2089
2090
|
subUnitId: o,
|
|
2090
2091
|
range: {
|
|
2091
|
-
startRow:
|
|
2092
|
-
endRow:
|
|
2092
|
+
startRow: p.startRow,
|
|
2093
|
+
endRow: p.endRow,
|
|
2093
2094
|
startColumn: h.startColumn,
|
|
2094
|
-
endColumn:
|
|
2095
|
+
endColumn: T - g
|
|
2095
2096
|
}
|
|
2096
2097
|
}
|
|
2097
2098
|
);
|
|
2098
|
-
v && (
|
|
2099
|
-
const ee = t.get(
|
|
2100
|
-
return
|
|
2099
|
+
v && (R.push(...v.redos), w.push(...v.undos));
|
|
2100
|
+
const ee = t.get(D);
|
|
2101
|
+
return E(R, ee) && t.get(A).pushUndoRedo({
|
|
2101
2102
|
unitID: a,
|
|
2102
2103
|
undoMutations: w,
|
|
2103
|
-
redoMutations:
|
|
2104
|
+
redoMutations: R
|
|
2104
2105
|
}), !0;
|
|
2105
2106
|
}
|
|
2106
2107
|
};
|
|
2107
|
-
var
|
|
2108
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
2108
|
+
var Yn = Object.getOwnPropertyDescriptor, Gn = (t, e, n, s) => {
|
|
2109
|
+
for (var r = s > 1 ? void 0 : s ? Yn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2110
|
+
(o = t[a]) && (r = o(r) || r);
|
|
2111
|
+
return r;
|
|
2112
|
+
}, Ae = (t, e) => (n, s) => e(n, s, t);
|
|
2113
|
+
let ce = class extends H {
|
|
2114
|
+
constructor(t, e) {
|
|
2115
|
+
super(), this._tableManager = t, this._commandService = e, this._initRangeListener();
|
|
2116
|
+
}
|
|
2117
|
+
_initRangeListener() {
|
|
2118
|
+
this.disposeWithMe(
|
|
2119
|
+
this._tableManager.tableRangeChanged$.subscribe((t) => {
|
|
2120
|
+
const { tableId: e, unitId: n } = t, s = this._tableManager.getTableById(n, e);
|
|
2121
|
+
s && this._updateSuperTable(n, s);
|
|
2122
|
+
})
|
|
2123
|
+
), this.disposeWithMe(
|
|
2124
|
+
this._tableManager.tableAdd$.subscribe((t) => {
|
|
2125
|
+
const { tableId: e, unitId: n } = t, s = this._tableManager.getTableById(n, e);
|
|
2126
|
+
s && this._updateSuperTable(n, s);
|
|
2127
|
+
})
|
|
2128
|
+
), this.disposeWithMe(
|
|
2129
|
+
this._tableManager.tableDelete$.subscribe((t) => {
|
|
2130
|
+
const { unitId: e, tableName: n } = t;
|
|
2131
|
+
this._commandService.executeCommand(Fe.id, {
|
|
2132
|
+
unitId: e,
|
|
2133
|
+
tableName: n
|
|
2134
|
+
});
|
|
2135
|
+
})
|
|
2136
|
+
), this.disposeWithMe(
|
|
2137
|
+
this._tableManager.tableNameChanged$.subscribe((t) => {
|
|
2138
|
+
const { tableId: e, unitId: n, oldTableName: s } = t;
|
|
2139
|
+
this._commandService.executeCommand(Fe.id, {
|
|
2140
|
+
unitId: n,
|
|
2141
|
+
tableName: s
|
|
2142
|
+
});
|
|
2143
|
+
const r = this._tableManager.getTableById(n, e);
|
|
2144
|
+
r && this._updateSuperTable(n, r);
|
|
2145
|
+
})
|
|
2146
|
+
);
|
|
2147
|
+
}
|
|
2148
|
+
_updateSuperTable(t, e) {
|
|
2149
|
+
const n = e.getTableInfo(), s = n.name, r = n.columns, a = /* @__PURE__ */ new Map();
|
|
2150
|
+
r.forEach((o, u) => {
|
|
2151
|
+
a.set(o.displayName, u);
|
|
2152
|
+
}), this._commandService.executeCommand(It.id, {
|
|
2153
|
+
unitId: t,
|
|
2154
|
+
tableName: s,
|
|
2155
|
+
reference: {
|
|
2156
|
+
range: n.range,
|
|
2157
|
+
sheetId: n.subUnitId,
|
|
2158
|
+
titleMap: a
|
|
2159
|
+
}
|
|
2160
|
+
});
|
|
2161
|
+
}
|
|
2162
|
+
};
|
|
2163
|
+
ce = Gn([
|
|
2164
|
+
Ae(0, _(C)),
|
|
2165
|
+
Ae(1, D)
|
|
2166
|
+
], ce);
|
|
2167
|
+
var zn = Object.getOwnPropertyDescriptor, jn = (t, e, n, s) => {
|
|
2168
|
+
for (var r = s > 1 ? void 0 : s ? zn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2109
2169
|
(o = t[a]) && (r = o(r) || r);
|
|
2110
2170
|
return r;
|
|
2111
|
-
},
|
|
2112
|
-
let
|
|
2171
|
+
}, Be = (t, e) => (n, s) => e(n, s, t);
|
|
2172
|
+
let de = class extends H {
|
|
2113
2173
|
constructor(t, e) {
|
|
2114
2174
|
super(), this._tableManager = t, this._exclusiveRangeService = e, this._initRangeListener();
|
|
2115
2175
|
}
|
|
@@ -2138,16 +2198,16 @@ let ce = class extends Q {
|
|
|
2138
2198
|
);
|
|
2139
2199
|
}
|
|
2140
2200
|
};
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
],
|
|
2145
|
-
var
|
|
2146
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
2201
|
+
de = jn([
|
|
2202
|
+
Be(0, _(C)),
|
|
2203
|
+
Be(1, _(bt))
|
|
2204
|
+
], de);
|
|
2205
|
+
var Kn = Object.getOwnPropertyDescriptor, Xn = (t, e, n, s) => {
|
|
2206
|
+
for (var r = s > 1 ? void 0 : s ? Kn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2147
2207
|
(o = t[a]) && (r = o(r) || r);
|
|
2148
2208
|
return r;
|
|
2149
|
-
},
|
|
2150
|
-
let
|
|
2209
|
+
}, V = (t, e) => (n, s) => e(n, s, t);
|
|
2210
|
+
let he = class extends H {
|
|
2151
2211
|
constructor(t, e, n, s, r, a, o) {
|
|
2152
2212
|
super(), this._commandService = t, this._refRangeService = e, this._univerInstanceService = n, this._injector = s, this._sheetInterceptorService = r, this._tableManager = a, this._localeService = o, this._initCommandInterceptor(), this._initCommandListener();
|
|
2153
2213
|
}
|
|
@@ -2157,13 +2217,13 @@ let de = class extends Q {
|
|
|
2157
2217
|
getMutations(e) {
|
|
2158
2218
|
const n = { redos: [], undos: [] }, { id: s, params: r } = e;
|
|
2159
2219
|
switch (s) {
|
|
2160
|
-
case
|
|
2220
|
+
case Rt.id:
|
|
2161
2221
|
return t._generateTableMutationWithInsertRow(r);
|
|
2162
|
-
case
|
|
2222
|
+
case St.id:
|
|
2163
2223
|
return t._generateTableMutationWithInsertCol(r);
|
|
2164
|
-
case
|
|
2224
|
+
case pt.id:
|
|
2165
2225
|
return t._generateTableMutationWithRemoveRow(r);
|
|
2166
|
-
case
|
|
2226
|
+
case ft.id:
|
|
2167
2227
|
return t._generateTableMutationWithRemoveCol(r);
|
|
2168
2228
|
}
|
|
2169
2229
|
return n;
|
|
@@ -2271,10 +2331,10 @@ let de = class extends Q {
|
|
|
2271
2331
|
const { range: i } = t, h = i.endRow - i.startRow + 1;
|
|
2272
2332
|
return l.forEach((d) => {
|
|
2273
2333
|
const c = d.getRange();
|
|
2274
|
-
if (
|
|
2334
|
+
if (Re.intersects(c, i))
|
|
2275
2335
|
if (i.startRow <= c.startRow && i.endRow >= c.startRow) {
|
|
2276
2336
|
s.push({
|
|
2277
|
-
id:
|
|
2337
|
+
id: Q.id,
|
|
2278
2338
|
params: {
|
|
2279
2339
|
unitId: o,
|
|
2280
2340
|
subUnitId: u,
|
|
@@ -2283,7 +2343,7 @@ let de = class extends Q {
|
|
|
2283
2343
|
});
|
|
2284
2344
|
const g = d.toJSON();
|
|
2285
2345
|
e.push({
|
|
2286
|
-
id:
|
|
2346
|
+
id: k.id,
|
|
2287
2347
|
params: {
|
|
2288
2348
|
unitId: o,
|
|
2289
2349
|
subUnitId: u,
|
|
@@ -2364,24 +2424,24 @@ let de = class extends Q {
|
|
|
2364
2424
|
const { range: i } = t, h = i.endColumn - i.startColumn + 1;
|
|
2365
2425
|
return l.forEach((d) => {
|
|
2366
2426
|
const c = d.getRange();
|
|
2367
|
-
if (
|
|
2427
|
+
if (Re.intersects(c, i)) {
|
|
2368
2428
|
if (i.startColumn <= c.startColumn && i.endColumn >= c.endColumn) {
|
|
2369
2429
|
s.push({
|
|
2370
|
-
id:
|
|
2430
|
+
id: Q.id,
|
|
2371
2431
|
params: {
|
|
2372
2432
|
unitId: o,
|
|
2373
2433
|
subUnitId: u,
|
|
2374
2434
|
tableId: d.getId()
|
|
2375
2435
|
}
|
|
2376
2436
|
});
|
|
2377
|
-
const g = d.toJSON(), { startRow:
|
|
2437
|
+
const g = d.toJSON(), { startRow: R, startColumn: w, endColumn: p } = g.range, f = this._univerInstanceService.getUnit(o), I = f == null ? void 0 : f.getSheetBySheetId(u);
|
|
2378
2438
|
if (!I)
|
|
2379
2439
|
return { undos: e, redos: n, preRedos: s, preUndos: r };
|
|
2380
2440
|
const U = [];
|
|
2381
|
-
for (let
|
|
2382
|
-
U.push(
|
|
2441
|
+
for (let T = w; T <= p; T++)
|
|
2442
|
+
U.push(Ke(I == null ? void 0 : I.getCell(R, T)) || te(T - w + 1, this._localeService.t("sheets-table.columnPrefix")));
|
|
2383
2443
|
e.push({
|
|
2384
|
-
id:
|
|
2444
|
+
id: k.id,
|
|
2385
2445
|
params: {
|
|
2386
2446
|
unitId: o,
|
|
2387
2447
|
subUnitId: u,
|
|
@@ -2410,10 +2470,10 @@ let de = class extends Q {
|
|
|
2410
2470
|
}
|
|
2411
2471
|
}
|
|
2412
2472
|
});
|
|
2413
|
-
const
|
|
2473
|
+
const R = [];
|
|
2414
2474
|
for (let w = 0; w < g; w++) {
|
|
2415
|
-
const
|
|
2416
|
-
|
|
2475
|
+
const p = d.getTableColumnByIndex(w);
|
|
2476
|
+
p && R.push(p.toJSON());
|
|
2417
2477
|
}
|
|
2418
2478
|
e.push({
|
|
2419
2479
|
id: S.id,
|
|
@@ -2427,7 +2487,7 @@ let de = class extends Q {
|
|
|
2427
2487
|
rowColType: y.Col,
|
|
2428
2488
|
index: c.startColumn,
|
|
2429
2489
|
count: g,
|
|
2430
|
-
columnsJson:
|
|
2490
|
+
columnsJson: R
|
|
2431
2491
|
}
|
|
2432
2492
|
}
|
|
2433
2493
|
}
|
|
@@ -2450,10 +2510,10 @@ let de = class extends Q {
|
|
|
2450
2510
|
}
|
|
2451
2511
|
}
|
|
2452
2512
|
});
|
|
2453
|
-
const
|
|
2454
|
-
for (let
|
|
2455
|
-
const f = d.getTableColumnByIndex(
|
|
2456
|
-
f &&
|
|
2513
|
+
const R = [], w = i.startColumn - c.startColumn;
|
|
2514
|
+
for (let p = 0; p < g; p++) {
|
|
2515
|
+
const f = d.getTableColumnByIndex(p + w);
|
|
2516
|
+
f && R.push(f.toJSON());
|
|
2457
2517
|
}
|
|
2458
2518
|
e.push({
|
|
2459
2519
|
id: S.id,
|
|
@@ -2467,7 +2527,7 @@ let de = class extends Q {
|
|
|
2467
2527
|
rowColType: y.Col,
|
|
2468
2528
|
index: i.startColumn,
|
|
2469
2529
|
count: h,
|
|
2470
|
-
columnsJson:
|
|
2530
|
+
columnsJson: R
|
|
2471
2531
|
}
|
|
2472
2532
|
}
|
|
2473
2533
|
}
|
|
@@ -2489,10 +2549,10 @@ let de = class extends Q {
|
|
|
2489
2549
|
}
|
|
2490
2550
|
}
|
|
2491
2551
|
});
|
|
2492
|
-
const g = [],
|
|
2552
|
+
const g = [], R = i.startColumn - c.startColumn;
|
|
2493
2553
|
for (let w = 0; w < h; w++) {
|
|
2494
|
-
const
|
|
2495
|
-
|
|
2554
|
+
const p = d.getTableColumnByIndex(w + R);
|
|
2555
|
+
p && g.push(p.toJSON());
|
|
2496
2556
|
}
|
|
2497
2557
|
e.push({
|
|
2498
2558
|
id: S.id,
|
|
@@ -2517,7 +2577,7 @@ let de = class extends Q {
|
|
|
2517
2577
|
}
|
|
2518
2578
|
_initCommandListener() {
|
|
2519
2579
|
this._commandService.onCommandExecuted((t) => {
|
|
2520
|
-
if (t.id ===
|
|
2580
|
+
if (t.id === ke.id) {
|
|
2521
2581
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endRow - r.startRow + 1;
|
|
2522
2582
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2523
2583
|
const l = u.getRange();
|
|
@@ -2529,7 +2589,7 @@ let de = class extends Q {
|
|
|
2529
2589
|
}
|
|
2530
2590
|
});
|
|
2531
2591
|
});
|
|
2532
|
-
} else if (t.id ===
|
|
2592
|
+
} else if (t.id === Ye.id) {
|
|
2533
2593
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endColumn - r.startColumn + 1;
|
|
2534
2594
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2535
2595
|
const l = u.getRange();
|
|
@@ -2541,7 +2601,7 @@ let de = class extends Q {
|
|
|
2541
2601
|
}
|
|
2542
2602
|
});
|
|
2543
2603
|
});
|
|
2544
|
-
} else if (t.id ===
|
|
2604
|
+
} else if (t.id === Qe.id) {
|
|
2545
2605
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endRow - r.startRow + 1;
|
|
2546
2606
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2547
2607
|
const l = u.getRange();
|
|
@@ -2553,7 +2613,7 @@ let de = class extends Q {
|
|
|
2553
2613
|
}
|
|
2554
2614
|
});
|
|
2555
2615
|
});
|
|
2556
|
-
} else if (t.id ===
|
|
2616
|
+
} else if (t.id === Ge.id) {
|
|
2557
2617
|
const e = t.params, { unitId: n, subUnitId: s, range: r } = e, a = r.endColumn - r.startColumn + 1;
|
|
2558
2618
|
this._tableManager.getTablesBySubunitId(n, s).forEach((u) => {
|
|
2559
2619
|
const l = u.getRange();
|
|
@@ -2569,21 +2629,21 @@ let de = class extends Q {
|
|
|
2569
2629
|
});
|
|
2570
2630
|
}
|
|
2571
2631
|
};
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
],
|
|
2581
|
-
var
|
|
2582
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
2632
|
+
he = Xn([
|
|
2633
|
+
V(0, _(D)),
|
|
2634
|
+
V(1, _(wt)),
|
|
2635
|
+
V(2, _(B)),
|
|
2636
|
+
V(3, _(We)),
|
|
2637
|
+
V(4, _(Ce)),
|
|
2638
|
+
V(5, _(C)),
|
|
2639
|
+
V(6, _(be))
|
|
2640
|
+
], he);
|
|
2641
|
+
var Zn = Object.getOwnPropertyDescriptor, es = (t, e, n, s) => {
|
|
2642
|
+
for (var r = s > 1 ? void 0 : s ? Zn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2583
2643
|
(o = t[a]) && (r = o(r) || r);
|
|
2584
2644
|
return r;
|
|
2585
2645
|
}, oe = (t, e) => (n, s) => e(n, s, t);
|
|
2586
|
-
let
|
|
2646
|
+
let ge = class extends H {
|
|
2587
2647
|
constructor(e, n, s, r) {
|
|
2588
2648
|
super();
|
|
2589
2649
|
b(this, "_defaultThemeIndex", 0);
|
|
@@ -2639,12 +2699,12 @@ let he = class extends Q {
|
|
|
2639
2699
|
);
|
|
2640
2700
|
}
|
|
2641
2701
|
_initUserTableTheme() {
|
|
2642
|
-
const e = this._configService.getConfig(
|
|
2643
|
-
this._defaultThemeIndex = n, this._allThemes = s.concat(
|
|
2702
|
+
const e = this._configService.getConfig(Xe) || {}, n = e.defaultThemeIndex || 0, s = e.userThemes || [];
|
|
2703
|
+
this._defaultThemeIndex = n, this._allThemes = s.concat(Ze);
|
|
2644
2704
|
}
|
|
2645
2705
|
_initDefaultTableTheme() {
|
|
2646
2706
|
for (let e = 0; e < this._allThemes.length; e++) {
|
|
2647
|
-
const { name: n, style: s } = this._allThemes[e], r = new
|
|
2707
|
+
const { name: n, style: s } = this._allThemes[e], r = new Ct(n, s);
|
|
2648
2708
|
this._sheetRangeThemeModel.registerDefaultRangeTheme(r);
|
|
2649
2709
|
}
|
|
2650
2710
|
}
|
|
@@ -2652,21 +2712,21 @@ let he = class extends Q {
|
|
|
2652
2712
|
super.dispose(), this._allThemes = [], this._defaultThemeIndex = 0;
|
|
2653
2713
|
}
|
|
2654
2714
|
};
|
|
2655
|
-
|
|
2656
|
-
oe(0,
|
|
2657
|
-
oe(1,
|
|
2658
|
-
oe(2,
|
|
2659
|
-
oe(3,
|
|
2660
|
-
],
|
|
2661
|
-
var
|
|
2662
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
2715
|
+
ge = es([
|
|
2716
|
+
oe(0, _(C)),
|
|
2717
|
+
oe(1, _(_t)),
|
|
2718
|
+
oe(2, _(Je)),
|
|
2719
|
+
oe(3, He)
|
|
2720
|
+
], ge);
|
|
2721
|
+
var ts = Object.getOwnPropertyDescriptor, ns = (t, e, n, s) => {
|
|
2722
|
+
for (var r = s > 1 ? void 0 : s ? ts(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2663
2723
|
(o = t[a]) && (r = o(r) || r);
|
|
2664
2724
|
return r;
|
|
2665
2725
|
}, ie = (t, e) => (n, s) => e(n, s, t);
|
|
2666
|
-
let
|
|
2726
|
+
let me = class extends H {
|
|
2667
2727
|
constructor(e, n, s, r) {
|
|
2668
2728
|
super();
|
|
2669
|
-
b(this, "_tableFilteredOutRows$", new
|
|
2729
|
+
b(this, "_tableFilteredOutRows$", new ze(/* @__PURE__ */ new Set()));
|
|
2670
2730
|
b(this, "tableFilteredOutRows$", this._tableFilteredOutRows$.asObservable());
|
|
2671
2731
|
b(this, "_subscription", null);
|
|
2672
2732
|
this._tableManager = e, this._sheetInterceptorService = n, this._univerInstanceService = s, this._zebraCrossingCacheController = r, this.registerFilterChangeEvent(), this.initTableHiddenRowIntercept(), this._initFilteredOutRows();
|
|
@@ -2678,7 +2738,7 @@ let ge = class extends Q {
|
|
|
2678
2738
|
this._tableFilteredOutRows$.next(e);
|
|
2679
2739
|
}
|
|
2680
2740
|
initTableHiddenRowIntercept() {
|
|
2681
|
-
this.disposeWithMe(this._sheetInterceptorService.intercept(
|
|
2741
|
+
this.disposeWithMe(this._sheetInterceptorService.intercept(Ve.ROW_FILTERED, {
|
|
2682
2742
|
// 这里需要保证优先级高于sheet的筛选,因为筛选没有next,低于筛选的不会触发interceptor
|
|
2683
2743
|
priority: 100,
|
|
2684
2744
|
handler: (e, n, s) => {
|
|
@@ -2690,11 +2750,11 @@ let ge = class extends Q {
|
|
|
2690
2750
|
}
|
|
2691
2751
|
_initFilteredOutRows() {
|
|
2692
2752
|
this._tableManager.tableInitStatus$.pipe(
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2753
|
+
pe((e) => e),
|
|
2754
|
+
ve(() => this._univerInstanceService.getCurrentTypeOfUnit$(z.UNIVER_SHEET)),
|
|
2755
|
+
pe((e) => e != null),
|
|
2756
|
+
ve((e) => e.activeSheet$),
|
|
2757
|
+
pe((e) => e != null)
|
|
2698
2758
|
).subscribe(() => {
|
|
2699
2759
|
const e = $(this._univerInstanceService);
|
|
2700
2760
|
if (!e)
|
|
@@ -2729,104 +2789,106 @@ let ge = class extends Q {
|
|
|
2729
2789
|
super.dispose(), (e = this._subscription) == null || e.unsubscribe();
|
|
2730
2790
|
}
|
|
2731
2791
|
};
|
|
2732
|
-
|
|
2733
|
-
ie(0,
|
|
2734
|
-
ie(1,
|
|
2735
|
-
ie(2,
|
|
2736
|
-
ie(3,
|
|
2737
|
-
],
|
|
2738
|
-
var
|
|
2739
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
2792
|
+
me = ns([
|
|
2793
|
+
ie(0, _(C)),
|
|
2794
|
+
ie(1, _(Ce)),
|
|
2795
|
+
ie(2, _(B)),
|
|
2796
|
+
ie(3, _(Tt))
|
|
2797
|
+
], me);
|
|
2798
|
+
var ss = Object.getOwnPropertyDescriptor, rs = (t, e, n, s) => {
|
|
2799
|
+
for (var r = s > 1 ? void 0 : s ? ss(e, n) : e, a = t.length - 1, o; a >= 0; a--)
|
|
2740
2800
|
(o = t[a]) && (r = o(r) || r);
|
|
2741
2801
|
return r;
|
|
2742
|
-
},
|
|
2743
|
-
let
|
|
2744
|
-
constructor(t =
|
|
2802
|
+
}, Se = (t, e) => (n, s) => e(n, s, t), le;
|
|
2803
|
+
let Ee = (le = class extends ct {
|
|
2804
|
+
constructor(t = De, e, n, s) {
|
|
2745
2805
|
super(), this._config = t, this._injector = e, this._configService = n, this._commandService = s;
|
|
2746
|
-
const { ...r } =
|
|
2806
|
+
const { ...r } = dt(
|
|
2747
2807
|
{},
|
|
2748
|
-
|
|
2808
|
+
De,
|
|
2749
2809
|
this._config
|
|
2750
2810
|
);
|
|
2751
|
-
this._configService.setConfig(
|
|
2811
|
+
this._configService.setConfig(Xe, r), this._initRegisterCommand();
|
|
2752
2812
|
}
|
|
2753
2813
|
onStarting() {
|
|
2754
|
-
|
|
2755
|
-
[
|
|
2756
|
-
[
|
|
2814
|
+
ht(this._injector, [
|
|
2815
|
+
[C],
|
|
2816
|
+
[ge],
|
|
2757
2817
|
[W],
|
|
2758
2818
|
[X],
|
|
2759
|
-
[
|
|
2760
|
-
[ce],
|
|
2761
|
-
[de]
|
|
2762
|
-
]), Ie(this._injector, [
|
|
2763
|
-
[ce],
|
|
2819
|
+
[me],
|
|
2764
2820
|
[de],
|
|
2765
2821
|
[he],
|
|
2766
|
-
[
|
|
2767
|
-
[X],
|
|
2768
|
-
[ge]
|
|
2822
|
+
[ce]
|
|
2769
2823
|
]);
|
|
2770
2824
|
}
|
|
2771
2825
|
onReady() {
|
|
2772
|
-
|
|
2773
|
-
[
|
|
2826
|
+
Me(this._injector, [
|
|
2827
|
+
[ce],
|
|
2828
|
+
[de],
|
|
2829
|
+
[he],
|
|
2830
|
+
[ge],
|
|
2831
|
+
[W],
|
|
2832
|
+
[X],
|
|
2833
|
+
[me]
|
|
2834
|
+
]), Me(this._injector, [
|
|
2835
|
+
[C]
|
|
2774
2836
|
]);
|
|
2775
2837
|
}
|
|
2776
2838
|
_initRegisterCommand() {
|
|
2777
2839
|
[
|
|
2778
|
-
|
|
2779
|
-
J,
|
|
2780
|
-
xn,
|
|
2840
|
+
$n,
|
|
2781
2841
|
k,
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
S,
|
|
2786
|
-
En,
|
|
2842
|
+
An,
|
|
2843
|
+
Q,
|
|
2844
|
+
_e,
|
|
2787
2845
|
Bn,
|
|
2788
|
-
|
|
2846
|
+
Pn,
|
|
2847
|
+
S,
|
|
2789
2848
|
Hn,
|
|
2790
2849
|
Vn,
|
|
2791
|
-
|
|
2850
|
+
qn,
|
|
2851
|
+
Jn,
|
|
2852
|
+
kn,
|
|
2853
|
+
Qn
|
|
2792
2854
|
].forEach((t) => this._commandService.registerCommand(t));
|
|
2793
2855
|
}
|
|
2794
|
-
}, b(le, "pluginName",
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
],
|
|
2856
|
+
}, b(le, "pluginName", nt), b(le, "type", z.UNIVER_SHEET), le);
|
|
2857
|
+
Ee = rs([
|
|
2858
|
+
Se(1, _(We)),
|
|
2859
|
+
Se(2, He),
|
|
2860
|
+
Se(3, _(D))
|
|
2861
|
+
], Ee);
|
|
2800
2862
|
export {
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2863
|
+
$n as AddSheetTableCommand,
|
|
2864
|
+
k as AddSheetTableMutation,
|
|
2865
|
+
Hn as AddTableThemeCommand,
|
|
2866
|
+
An as DeleteSheetTableCommand,
|
|
2867
|
+
Q as DeleteSheetTableMutation,
|
|
2868
|
+
Vn as RemoveTableThemeCommand,
|
|
2869
|
+
En as SHEET_TABLE_CUSTOM_THEME_PREFIX,
|
|
2870
|
+
Pn as SetSheetTableCommand,
|
|
2871
|
+
Bn as SetSheetTableFilterCommand,
|
|
2872
|
+
_e as SetSheetTableFilterMutation,
|
|
2811
2873
|
S as SetSheetTableMutation,
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2874
|
+
Jn as SheetTableInsertColCommand,
|
|
2875
|
+
qn as SheetTableInsertRowCommand,
|
|
2876
|
+
Qn as SheetTableRemoveColCommand,
|
|
2877
|
+
kn as SheetTableRemoveRowCommand,
|
|
2816
2878
|
X as SheetTableService,
|
|
2817
|
-
|
|
2879
|
+
q as SheetsTableButtonStateEnum,
|
|
2818
2880
|
W as SheetsTableController,
|
|
2819
2881
|
G as SheetsTableSortStateEnum,
|
|
2820
|
-
|
|
2882
|
+
je as TableColumnDataTypeEnum,
|
|
2821
2883
|
ne as TableColumnFilterTypeEnum,
|
|
2822
2884
|
O as TableConditionTypeEnum,
|
|
2823
2885
|
m as TableDateCompareTypeEnum,
|
|
2824
|
-
|
|
2886
|
+
C as TableManager,
|
|
2825
2887
|
F as TableNumberCompareTypeEnum,
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2888
|
+
P as TableStringCompareTypeEnum,
|
|
2889
|
+
Ee as UniverSheetsTablePlugin,
|
|
2890
|
+
hs as customEmptyThemeWithBorderStyle,
|
|
2891
|
+
Ft as isConditionFilter,
|
|
2892
|
+
ds as isManualFilter,
|
|
2893
|
+
gs as processStyleWithBorderStyle
|
|
2832
2894
|
};
|