@univerjs/sheets-table 0.10.1 → 0.10.2-nightly.202508071209

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/index.js CHANGED
@@ -1,48 +1,48 @@
1
1
  var Ke = Object.defineProperty;
2
2
  var Xe = (t, e, n) => e in t ? Ke(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var b = (t, e, n) => Xe(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { CellValueType as V, BorderStyleTypes as Ze, generateRandomId as L, IUniverInstanceService as J, Inject as S, LocaleService as Ce, Disposable as k, CommandType as N, IUndoRedoService as $, ICommandService as x, sequenceExecute as A, IResourceManagerService as et, Rectangle as pe, RTree as tt, InterceptorEffectEnum as nt, UniverInstanceType as Se, Injector as Be, Plugin as rt, merge as st, registerDependencies as at, touchDependencies as Me, IConfigService as ot } from "@univerjs/core";
5
- import { getSheetCommandTarget as U, SheetInterceptorService as _e, INTERCEPTOR_POINT as Le, AddRangeThemeMutation as We, RemoveRangeThemeMutation as Ee, SheetRangeThemeModel as He, SheetsSelectionsService as de, InsertRowMutation as Pe, RemoveRowMutation as Ve, getMoveRangeUndoRedoMutations as he, InsertColMutation as qe, RemoveColMutation as Je, IExclusiveRangeService as it, RefRangeService as lt, RemoveColCommand as ut, RemoveRowCommand as ct, InsertColCommand as dt, InsertRowCommand as ht, SheetRangeThemeService as gt, RangeThemeStyle as mt } from "@univerjs/sheets";
6
- import { Subject as Q, BehaviorSubject as ke, filter as ge, switchMap as ve } from "rxjs";
7
- var T = /* @__PURE__ */ ((t) => (t.Insert = "insert", t.Delete = "delete", t))(T || {}), D = /* @__PURE__ */ ((t) => (t.Row = "row", t.Col = "column", t))(D || {}), Qe = /* @__PURE__ */ ((t) => (t.None = "none", t.String = "string", t.Number = "number", t.Date = "date", t.Bool = "bool", t.Checkbox = "checkbox", t.List = "list", t))(Qe || {}), ee = /* @__PURE__ */ ((t) => (t.manual = "manual", t.condition = "condition", t))(ee || {}), 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 || {}), H = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.Contains = "contains", t.NotContains = "notContains", t.StartsWith = "startsWith", t.EndsWith = "endsWith", t))(H || {}), g = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.After = "after", t.AfterOrEqual = "afterOrEqual", t.Before = "before", t.BeforeOrEqual = "beforeOrEqual", t.Between = "between", t.NotBetween = "notBetween", t.Today = "today", t.Yesterday = "yesterday", t.Tomorrow = "tomorrow", t.ThisWeek = "thisWeek", t.LastWeek = "lastWeek", t.NextWeek = "nextWeek", t.ThisMonth = "thisMonth", t.LastMonth = "lastMonth", t.NextMonth = "nextMonth", t.ThisQuarter = "thisQuarter", t.LastQuarter = "lastQuarter", t.NextQuarter = "nextQuarter", t.ThisYear = "thisYear", t.LastYear = "lastYear", t.NextYear = "nextYear", t.YearToDate = "yearToDate", t.Quarter = "quarter", t.Month = "month", t.M1 = "m1", t.M2 = "m2", t.M3 = "m3", t.M4 = "m4", t.M5 = "m5", t.M6 = "m6", t.M7 = "m7", t.M8 = "m8", t.M9 = "m9", t.M10 = "m10", t.M11 = "m11", t.M12 = "m12", t.Q1 = "q1", t.Q2 = "q2", t.Q3 = "q3", t.Q4 = "q4", t))(g || {}), P = /* @__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))(P || {}), G = /* @__PURE__ */ ((t) => (t.Asc = "asc", t.Desc = "desc", t.None = "none", t))(G || {});
4
+ import { CellValueType as q, BorderStyleTypes as Ze, generateRandomId as L, IUniverInstanceService as W, Inject as C, LocaleService as de, Disposable as k, CommandType as N, IUndoRedoService as A, ICommandService as x, sequenceExecute as B, IResourceManagerService as et, Rectangle as Se, RTree as tt, InterceptorEffectEnum as nt, UniverInstanceType as he, customNameCharacterCheck as rt, ILogService as st, Injector as Be, Plugin as at, merge as ot, registerDependencies as it, touchDependencies as Me, IConfigService as lt } from "@univerjs/core";
5
+ import { getSheetCommandTarget as $, SheetInterceptorService as _e, INTERCEPTOR_POINT as Le, AddRangeThemeMutation as Ee, RemoveRangeThemeMutation as We, SheetRangeThemeModel as He, SheetsSelectionsService as ge, InsertRowMutation as Pe, RemoveRowMutation as Ve, getMoveRangeUndoRedoMutations as me, InsertColMutation as qe, RemoveColMutation as Je, IExclusiveRangeService as ut, RefRangeService as ct, RemoveColCommand as dt, RemoveRowCommand as ht, InsertColCommand as gt, InsertRowCommand as mt, SheetRangeThemeService as bt, RangeThemeStyle as wt } from "@univerjs/sheets";
6
+ import { Subject as Q, BehaviorSubject as ke, filter as be, switchMap as ve } from "rxjs";
7
+ var I = /* @__PURE__ */ ((t) => (t.Insert = "insert", t.Delete = "delete", t))(I || {}), D = /* @__PURE__ */ ((t) => (t.Row = "row", t.Col = "column", t))(D || {}), Qe = /* @__PURE__ */ ((t) => (t.None = "none", t.String = "string", t.Number = "number", t.Date = "date", t.Bool = "bool", t.Checkbox = "checkbox", t.List = "list", t))(Qe || {}), ee = /* @__PURE__ */ ((t) => (t.manual = "manual", t.condition = "condition", t))(ee || {}), U = /* @__PURE__ */ ((t) => (t.Date = "date", t.Number = "number", t.String = "string", t.Logic = "logic", t))(U || {}), F = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.GreaterThan = "greaterThan", t.GreaterThanOrEqual = "greaterThanOrEqual", t.LessThan = "lessThan", t.LessThanOrEqual = "lessThanOrEqual", t.Between = "between", t.NotBetween = "notBetween", t.Above = "above", t.Below = "below", t.TopN = "topN", t))(F || {}), P = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.Contains = "contains", t.NotContains = "notContains", t.StartsWith = "startsWith", t.EndsWith = "endsWith", t))(P || {}), g = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.After = "after", t.AfterOrEqual = "afterOrEqual", t.Before = "before", t.BeforeOrEqual = "beforeOrEqual", t.Between = "between", t.NotBetween = "notBetween", t.Today = "today", t.Yesterday = "yesterday", t.Tomorrow = "tomorrow", t.ThisWeek = "thisWeek", t.LastWeek = "lastWeek", t.NextWeek = "nextWeek", t.ThisMonth = "thisMonth", t.LastMonth = "lastMonth", t.NextMonth = "nextMonth", t.ThisQuarter = "thisQuarter", t.LastQuarter = "lastQuarter", t.NextQuarter = "nextQuarter", t.ThisYear = "thisYear", t.LastYear = "lastYear", t.NextYear = "nextYear", t.YearToDate = "yearToDate", t.Quarter = "quarter", t.Month = "month", t.M1 = "m1", t.M2 = "m2", t.M3 = "m3", t.M4 = "m4", t.M5 = "m5", t.M6 = "m6", t.M7 = "m7", t.M8 = "m8", t.M9 = "m9", t.M10 = "m10", t.M11 = "m11", t.M12 = "m12", t.Q1 = "q1", t.Q2 = "q2", t.Q3 = "q3", t.Q4 = "q4", t))(g || {}), V = /* @__PURE__ */ ((t) => (t[t.FilteredSortNone = 1] = "FilteredSortNone", t[t.FilteredSortAsc = 2] = "FilteredSortAsc", t[t.FilteredSortDesc = 3] = "FilteredSortDesc", t[t.FilterNoneSortNone = 4] = "FilterNoneSortNone", t[t.FilterNoneSortAsc = 5] = "FilterNoneSortAsc", t[t.FilterNoneSortDesc = 6] = "FilterNoneSortDesc", t))(V || {}), G = /* @__PURE__ */ ((t) => (t.Asc = "asc", t.Desc = "desc", t.None = "none", t))(G || {});
8
8
  function Z(t, e) {
9
9
  return `${e} ${t}`;
10
10
  }
11
- const Fe = "TRUE", De = "FALSE", bt = (t) => {
11
+ const Fe = "TRUE", De = "FALSE", Rt = (t) => {
12
12
  var n;
13
13
  return ((n = t.body) == null ? void 0 : n.dataStream.replace(/\r\n$/, "")) || "";
14
14
  };
15
15
  function Ye(t) {
16
16
  if (t) {
17
17
  const { v: e, t: n, p: r } = t;
18
- return r ? bt(r) : (n === V.FORCE_STRING || n === V.STRING) && e !== void 0 && e !== null ? String(e) : n === V.BOOLEAN ? e ? Fe : De : n === V.NUMBER ? String(e) : typeof e === "boolean" ? e ? Fe : De : e == null ? "" : String(e);
18
+ return r ? Rt(r) : (n === q.FORCE_STRING || n === q.STRING) && e !== void 0 && e !== null ? String(e) : n === q.BOOLEAN ? e ? Fe : De : n === q.NUMBER ? String(e) : typeof e === "boolean" ? e ? Fe : De : e == null ? "" : String(e);
19
19
  }
20
20
  return "";
21
21
  }
22
- function wt(t, e) {
23
- if (t !== void 0)
22
+ function ft(t, e) {
23
+ if (t != null)
24
24
  switch (e) {
25
25
  case G.Asc:
26
- return P.FilteredSortAsc;
26
+ return V.FilteredSortAsc;
27
27
  case G.Desc:
28
- return P.FilteredSortDesc;
28
+ return V.FilteredSortDesc;
29
29
  default:
30
- return P.FilteredSortNone;
30
+ return V.FilteredSortNone;
31
31
  }
32
32
  else
33
33
  switch (e) {
34
34
  case G.Asc:
35
- return P.FilterNoneSortAsc;
35
+ return V.FilterNoneSortAsc;
36
36
  case G.Desc:
37
- return P.FilterNoneSortDesc;
37
+ return V.FilterNoneSortDesc;
38
38
  default:
39
- return P.FilterNoneSortNone;
39
+ return V.FilterNoneSortNone;
40
40
  }
41
41
  }
42
- function Rt(t) {
42
+ function pt(t) {
43
43
  return t ? t.filterType === ee.condition : !1;
44
44
  }
45
- function Zn(t) {
45
+ function tr(t) {
46
46
  return t ? t.filterType === ee.manual : !1;
47
47
  }
48
48
  const y = {
@@ -50,7 +50,7 @@ const y = {
50
50
  cl: {
51
51
  rgb: "rgb(95 101 116)"
52
52
  }
53
- }, er = {
53
+ }, nr = {
54
54
  headerRowStyle: {
55
55
  bd: {
56
56
  t: y
@@ -71,7 +71,7 @@ const y = {
71
71
  b: y
72
72
  }
73
73
  }
74
- }, tr = (t, e) => {
74
+ }, rr = (t, e) => {
75
75
  if (t === "headerRowStyle") {
76
76
  if (!e.bd)
77
77
  return {
@@ -104,14 +104,14 @@ const y = {
104
104
  }
105
105
  };
106
106
  return e;
107
- }, pt = [
107
+ }, St = [
108
108
  [["#6280F9", "#FFFFFF", "#BAC6F8", "#D2DAFA"], ["#fff"]],
109
109
  [["#16BDCA", "#FFFFFF", "#EDFAFA", "#AFECEF"], ["#000"]],
110
110
  [["#31C48D", "#FFFFFF", "#F3FAF7", "#BCF0DA"], ["#fff"]],
111
111
  [["#AC94FA", "#FFFFFF", "#F6F5FF", "#EDEBFE"], ["#fff"]],
112
112
  [["#F17EBB", "#FFFFFF", "#FDF2F8", "#FCE8F3"], ["#fff"]],
113
113
  [["#F98080", "#FFFFFF", "#FDF2F2", "#FDE8E8"], ["#fff"]]
114
- ], Y = pt.map((t, e) => {
114
+ ], Y = St.map((t, e) => {
115
115
  const [n, r] = t, [s, a, o, l] = n, [u] = r;
116
116
  return {
117
117
  name: `table-default-${e}`,
@@ -158,7 +158,7 @@ const y = {
158
158
  }
159
159
  };
160
160
  });
161
- class q {
161
+ class J {
162
162
  constructor(e, n) {
163
163
  b(this, "dataType");
164
164
  b(this, "id");
@@ -191,45 +191,45 @@ class q {
191
191
  this.id = e.id, this.displayName = e.displayName, this.dataType = e.dataType, this.formula = e.formula, this.meta = e.meta, this.style = e.style;
192
192
  }
193
193
  }
194
- const ft = (t) => t.getMonth() <= 2, Ct = (t) => {
194
+ const Ct = (t) => t.getMonth() <= 2, _t = (t) => {
195
195
  const e = t.getMonth();
196
196
  return e > 2 && e <= 5;
197
- }, St = (t) => {
197
+ }, Tt = (t) => {
198
198
  const e = t.getMonth();
199
199
  return e > 5 && e <= 8;
200
- }, _t = (t) => {
200
+ }, It = (t) => {
201
201
  const e = t.getMonth();
202
202
  return e > 8 && e <= 11;
203
- }, Tt = (t) => t.getMonth() === 0, It = (t) => t.getMonth() === 1, Mt = (t) => t.getMonth() === 2, vt = (t) => t.getMonth() === 3, Ft = (t) => t.getMonth() === 4, Dt = (t) => t.getMonth() === 5, Nt = (t) => t.getMonth() === 6, yt = (t) => t.getMonth() === 7, xt = (t) => t.getMonth() === 8, Ot = (t) => t.getMonth() === 9, Ut = (t) => t.getMonth() === 10, $t = (t) => t.getMonth() === 11, At = (t, e = /* @__PURE__ */ new Date()) => t.toDateString() === e.toDateString(), Bt = (t, e = /* @__PURE__ */ new Date()) => {
203
+ }, Mt = (t) => t.getMonth() === 0, vt = (t) => t.getMonth() === 1, Ft = (t) => t.getMonth() === 2, Dt = (t) => t.getMonth() === 3, Nt = (t) => t.getMonth() === 4, yt = (t) => t.getMonth() === 5, xt = (t) => t.getMonth() === 6, Ot = (t) => t.getMonth() === 7, Ut = (t) => t.getMonth() === 8, $t = (t) => t.getMonth() === 9, At = (t) => t.getMonth() === 10, Bt = (t) => t.getMonth() === 11, Lt = (t, e = /* @__PURE__ */ new Date()) => t.toDateString() === e.toDateString(), Et = (t, e = /* @__PURE__ */ new Date()) => {
204
204
  const n = new Date(e);
205
205
  return n.setDate(n.getDate() + 1), t.toDateString() === n.toDateString();
206
- }, Lt = (t, e = /* @__PURE__ */ new Date()) => {
206
+ }, Wt = (t, e = /* @__PURE__ */ new Date()) => {
207
207
  const n = new Date(e);
208
208
  return n.setDate(n.getDate() - 1), t.toDateString() === n.toDateString();
209
209
  }, j = (t) => {
210
210
  const e = t.getDay(), n = t.getDate() - e + (e === 0 ? -6 : 1), r = new Date(t);
211
211
  return r.setDate(n), r;
212
- }, Ge = 10080 * 60 * 1e3, Wt = (t, e = /* @__PURE__ */ new Date()) => {
212
+ }, Ge = 10080 * 60 * 1e3, Ht = (t, e = /* @__PURE__ */ new Date()) => {
213
213
  const n = j(t), r = j(e);
214
214
  return n.toDateString() === r.toDateString();
215
- }, Et = (t, e = /* @__PURE__ */ new Date()) => {
215
+ }, Pt = (t, e = /* @__PURE__ */ new Date()) => {
216
216
  const n = j(t), r = new Date(j(e).getTime() + Ge);
217
217
  return n.toDateString() === r.toDateString();
218
- }, Ht = (t, e = /* @__PURE__ */ new Date()) => {
218
+ }, Vt = (t, e = /* @__PURE__ */ new Date()) => {
219
219
  const n = j(t), r = new Date(j(e).getTime() - Ge);
220
220
  return n.toDateString() === r.toDateString();
221
- }, Pt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth(), Vt = (t) => {
221
+ }, qt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth(), Jt = (t) => {
222
222
  const e = new Date(t);
223
223
  return e.setHours(0, 0, 0, 0), e.setDate(1), e;
224
- }, qt = (t, e = /* @__PURE__ */ new Date()) => {
224
+ }, kt = (t, e = /* @__PURE__ */ new Date()) => {
225
225
  const n = new Date(e);
226
226
  n.setHours(0, 0, 0, 0), n.setMonth(n.getMonth() + 1, 1);
227
227
  const r = new Date(n);
228
228
  r.setMonth(r.getMonth() + 1, 0);
229
229
  const s = t.getTime();
230
230
  return s >= n.getTime() && s < r.getTime();
231
- }, Jt = (t, e = /* @__PURE__ */ new Date()) => {
232
- const n = Vt(e), r = new Date(n);
231
+ }, Qt = (t, e = /* @__PURE__ */ new Date()) => {
232
+ const n = Jt(e), r = new Date(n);
233
233
  r.setMonth(r.getMonth() + 1, 0);
234
234
  const s = t.getTime();
235
235
  return s >= n.getTime() && s < r.getTime();
@@ -238,32 +238,32 @@ const ft = (t) => t.getMonth() <= 2, Ct = (t) => {
238
238
  e.setHours(0, 0, 0, 0), e.setDate(1);
239
239
  const n = e.getMonth();
240
240
  return e.setMonth(n - n % 3), e;
241
- }, kt = (t, e = /* @__PURE__ */ new Date()) => {
241
+ }, Yt = (t, e = /* @__PURE__ */ new Date()) => {
242
242
  const n = Te(e), r = new Date(n);
243
243
  r.setMonth(r.getMonth() + 3);
244
244
  const s = t.getTime();
245
245
  return s >= n.getTime() && s < r.getTime();
246
- }, Qt = (t, e = /* @__PURE__ */ new Date()) => {
246
+ }, Gt = (t, e = /* @__PURE__ */ new Date()) => {
247
247
  const n = Te(e), r = new Date(n);
248
248
  r.setMonth(r.getMonth() + 3);
249
249
  const s = new Date(r);
250
250
  s.setMonth(s.getMonth() + 3, 0);
251
251
  const a = t.getTime();
252
252
  return a >= r.getTime() && a < s.getTime();
253
- }, Yt = (t, e = /* @__PURE__ */ new Date()) => {
253
+ }, jt = (t, e = /* @__PURE__ */ new Date()) => {
254
254
  const n = Te(e), r = new Date(n);
255
255
  r.setMonth(r.getMonth() - 3);
256
256
  const s = new Date(n);
257
257
  s.setDate(0);
258
258
  const a = t.getTime();
259
259
  return a >= r.getTime() && a < s.getTime();
260
- }, Gt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear(), jt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() + 1, zt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() - 1, Kt = (t, e = /* @__PURE__ */ new Date()) => {
260
+ }, zt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear(), Kt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() + 1, Xt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() - 1, Zt = (t, e = /* @__PURE__ */ new Date()) => {
261
261
  const n = new Date(e);
262
262
  n.setHours(0, 0, 0, 0), n.setMonth(0, 1);
263
263
  const r = t.getTime();
264
264
  return r >= n.getTime() && r < e.getTime();
265
265
  };
266
- function Xt(t) {
266
+ function en(t) {
267
267
  switch (t.compareType) {
268
268
  case g.Equal: {
269
269
  const e = new Date(t.expectedValue);
@@ -301,105 +301,105 @@ function Xt(t) {
301
301
  };
302
302
  case g.Today: {
303
303
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
304
- return (n) => At(n, e);
304
+ return (n) => Lt(n, e);
305
305
  }
306
306
  case g.Yesterday: {
307
307
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
308
- return (n) => Lt(n, e);
308
+ return (n) => Wt(n, e);
309
309
  }
310
310
  case g.Tomorrow: {
311
311
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
312
- return (n) => Bt(n, e);
312
+ return (n) => Et(n, e);
313
313
  }
314
314
  case g.ThisWeek: {
315
315
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
316
- return (n) => Wt(n, e);
316
+ return (n) => Ht(n, e);
317
317
  }
318
318
  case g.LastWeek: {
319
319
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
320
- return (n) => Ht(n, e);
320
+ return (n) => Vt(n, e);
321
321
  }
322
322
  case g.NextWeek: {
323
323
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
324
- return (n) => Et(n, e);
324
+ return (n) => Pt(n, e);
325
325
  }
326
326
  case g.ThisMonth: {
327
327
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
328
- return (n) => Pt(n, e);
328
+ return (n) => qt(n, e);
329
329
  }
330
330
  case g.LastMonth: {
331
331
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
332
- return (n) => Jt(n, e);
332
+ return (n) => Qt(n, e);
333
333
  }
334
334
  case g.NextMonth: {
335
335
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
336
- return (n) => qt(n, e);
336
+ return (n) => kt(n, e);
337
337
  }
338
338
  case g.ThisQuarter: {
339
339
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
340
- return (n) => kt(n, e);
340
+ return (n) => Yt(n, e);
341
341
  }
342
342
  case g.LastQuarter: {
343
343
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
344
- return (n) => Yt(n, e);
344
+ return (n) => jt(n, e);
345
345
  }
346
346
  case g.NextQuarter: {
347
347
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
348
- return (n) => Qt(n, e);
348
+ return (n) => Gt(n, e);
349
349
  }
350
350
  case g.ThisYear: {
351
351
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
352
- return (n) => Gt(n, e);
352
+ return (n) => zt(n, e);
353
353
  }
354
354
  case g.LastYear: {
355
355
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
356
- return (n) => zt(n, e);
356
+ return (n) => Xt(n, e);
357
357
  }
358
358
  case g.NextYear: {
359
359
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
360
- return (n) => jt(n, e);
360
+ return (n) => Kt(n, e);
361
361
  }
362
362
  case g.YearToDate: {
363
363
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
364
- return (n) => Kt(n, e);
364
+ return (n) => Zt(n, e);
365
365
  }
366
366
  case g.M1:
367
- return Tt;
367
+ return Mt;
368
368
  case g.M2:
369
- return It;
369
+ return vt;
370
370
  case g.M3:
371
- return Mt;
371
+ return Ft;
372
372
  case g.M4:
373
- return vt;
373
+ return Dt;
374
374
  case g.M5:
375
- return Ft;
375
+ return Nt;
376
376
  case g.M6:
377
- return Dt;
377
+ return yt;
378
378
  case g.M7:
379
- return Nt;
379
+ return xt;
380
380
  case g.M8:
381
- return yt;
381
+ return Ot;
382
382
  case g.M9:
383
- return xt;
383
+ return Ut;
384
384
  case g.M10:
385
- return Ot;
385
+ return $t;
386
386
  case g.M11:
387
- return Ut;
387
+ return At;
388
388
  case g.M12:
389
- return $t;
389
+ return Bt;
390
390
  case g.Q1:
391
- return ft;
392
- case g.Q2:
393
391
  return Ct;
392
+ case g.Q2:
393
+ return _t;
394
394
  case g.Q3:
395
- return St;
395
+ return Tt;
396
396
  case g.Q4:
397
- return _t;
397
+ return It;
398
398
  default:
399
399
  throw new Error("Unsupported compare type");
400
400
  }
401
401
  }
402
- class Zt {
402
+ class tn {
403
403
  /**
404
404
  * Initializes a new instance of the Heap class.
405
405
  */
@@ -463,7 +463,7 @@ class Zt {
463
463
  return this.heap.includes(e);
464
464
  }
465
465
  }
466
- class en extends Zt {
466
+ class nn extends tn {
467
467
  /**
468
468
  * Initializes a new instance of the MinHeap class.
469
469
  */
@@ -502,13 +502,13 @@ class en extends Zt {
502
502
  this.heap[0] = this.heap.pop(), this.shiftDown(0);
503
503
  }
504
504
  }
505
- const tn = (t, e) => {
506
- const n = new en();
505
+ const rn = (t, e) => {
506
+ const n = new nn();
507
507
  for (const r of t)
508
508
  n.insert(r), n.size() > e && n.pop();
509
509
  return n.heap;
510
- }, nn = (t, e) => t > e, rn = (t, e) => t < e, sn = (t, e, n) => tn(t, e).includes(n);
511
- function an(t, e) {
510
+ }, sn = (t, e) => t > e, an = (t, e) => t < e, on = (t, e, n) => rn(t, e).includes(n);
511
+ function ln(t, e) {
512
512
  switch (t.compareType) {
513
513
  case F.Equal: {
514
514
  const n = Number(t.expectedValue);
@@ -544,94 +544,102 @@ function an(t, e) {
544
544
  }
545
545
  case F.Above: {
546
546
  const n = e.average;
547
- return (r) => nn(r, n);
547
+ return (r) => sn(r, n);
548
548
  }
549
549
  case F.Below: {
550
550
  const n = e.average;
551
- return (r) => rn(r, n);
551
+ return (r) => an(r, n);
552
552
  }
553
553
  case F.TopN: {
554
554
  const n = e.list, r = Number(t.expectedValue);
555
- return (s) => sn(n, r, s);
555
+ return (s) => on(n, r, s);
556
556
  }
557
557
  }
558
558
  }
559
559
  const K = (t) => {
560
560
  const n = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\\\*/g, ".*").replace(/\\\?/g, ".");
561
561
  return new RegExp(`^${n}$`);
562
- }, on = (t, e) => K(e).test(t), ln = (t, e) => !K(e).test(t), un = (t, e) => K(`*${e}*`).test(t), cn = (t, e) => !K(`*${e}*`).test(t), dn = (t, e) => K(`${e}*`).test(t), hn = (t, e) => K(`*${e}`).test(t);
563
- function gn(t) {
562
+ }, un = (t, e) => K(e).test(t), cn = (t, e) => !K(e).test(t), dn = (t, e) => K(`*${e}*`).test(t), hn = (t, e) => !K(`*${e}*`).test(t), gn = (t, e) => K(`${e}*`).test(t), mn = (t, e) => K(`*${e}`).test(t);
563
+ function bn(t) {
564
564
  switch (t.compareType) {
565
- case H.Equal:
566
- return (e) => on(e, t.expectedValue);
567
- case H.NotEqual:
568
- return (e) => ln(e, t.expectedValue);
569
- case H.Contains:
565
+ case P.Equal:
570
566
  return (e) => un(e, t.expectedValue);
571
- case H.NotContains:
567
+ case P.NotEqual:
572
568
  return (e) => cn(e, t.expectedValue);
573
- case H.StartsWith:
569
+ case P.Contains:
574
570
  return (e) => dn(e, t.expectedValue);
575
- case H.EndsWith:
571
+ case P.NotContains:
576
572
  return (e) => hn(e, t.expectedValue);
573
+ case P.StartsWith:
574
+ return (e) => gn(e, t.expectedValue);
575
+ case P.EndsWith:
576
+ return (e) => mn(e, t.expectedValue);
577
577
  default:
578
578
  return console.error(`Unknown filter operator: ${t.compareType}`), (e) => !0;
579
579
  }
580
580
  }
581
- const mn = /* @__PURE__ */ new Set([
581
+ const wn = /* @__PURE__ */ new Set([
582
582
  F.Above,
583
583
  F.Below,
584
584
  F.TopN
585
585
  ]);
586
586
  g.Today, g.Yesterday, g.Tomorrow, g.ThisWeek, g.LastWeek, g.NextWeek, g.ThisMonth, g.LastMonth, g.NextMonth, g.ThisQuarter, g.LastQuarter, g.NextQuarter, g.NextYear, g.ThisYear, g.LastYear, g.YearToDate;
587
587
  function je(t) {
588
- return mn.has(t);
588
+ return wn.has(t);
589
589
  }
590
- function bn(t, e) {
590
+ function Rn(t, e) {
591
591
  if (je(t.filterInfo.compareType))
592
592
  return (n) => !0;
593
593
  switch (t.filterInfo.conditionType) {
594
- case O.Date:
595
- return Xt(t.filterInfo);
596
- case O.Number:
597
- return an(t.filterInfo, e);
598
- case O.String:
599
- return gn(t.filterInfo);
600
- case O.Logic:
594
+ case U.Date:
595
+ return en(t.filterInfo);
596
+ case U.Number:
597
+ return ln(t.filterInfo, e);
598
+ case U.String:
599
+ return bn(t.filterInfo);
600
+ case U.Logic:
601
601
  default:
602
602
  return (n) => !0;
603
603
  }
604
604
  }
605
605
  function oe(t, e, n, r) {
606
606
  switch (r) {
607
- case O.Date: {
607
+ case U.Date: {
608
608
  const s = Ne(t, e, n);
609
- return s ? pn(s) : null;
609
+ return s ? Sn(s) : null;
610
610
  }
611
- case O.Number:
611
+ case U.Number:
612
612
  return Ne(t, e, n);
613
- case O.String:
613
+ case U.String:
614
614
  default:
615
- return Rn(t, e, n);
615
+ return pn(t, e, n);
616
616
  }
617
617
  }
618
- const wn = (t) => {
618
+ const fn = (t) => {
619
619
  var n;
620
620
  return ((n = t.body) == null ? void 0 : n.dataStream.replace(/\r\n$/, "")) || "";
621
621
  };
622
- function Rn(t, e, n) {
622
+ function pn(t, e, n) {
623
623
  const r = t.getCell(e, n);
624
624
  if (!r) return null;
625
625
  const { v: s, t: a, p: o } = r;
626
- return o ? wn(o) : typeof s == "string" ? a === V.BOOLEAN ? s.toUpperCase() : s : typeof s == "number" ? a === V.BOOLEAN ? s ? "TRUE" : "FALSE" : s : typeof s == "boolean" ? s ? "TRUE" : "FALSE" : s === void 0 ? "(空白)" : String(s);
626
+ if (o)
627
+ return fn(o);
628
+ if (typeof s == "string")
629
+ return a === q.BOOLEAN ? s.toUpperCase() : s;
630
+ if (typeof s == "number")
631
+ return a === q.BOOLEAN ? s ? "TRUE" : "FALSE" : s;
632
+ if (typeof s == "boolean") return s ? "TRUE" : "FALSE";
633
+ if (s !== void 0)
634
+ return String(s);
627
635
  }
628
636
  function Ne(t, e, n) {
629
637
  const r = t.getCell(e, n);
630
638
  if (!r) return null;
631
639
  const { v: s, t: a, p: o } = r;
632
- return o ? null : typeof s == "string" && a === V.NUMBER ? Number(t.getCellRaw(e, n).v) : Number(s);
640
+ return o ? null : typeof s == "string" && a === q.NUMBER ? Number(t.getCellRaw(e, n).v) : Number(s);
633
641
  }
634
- function pn(t) {
642
+ function Sn(t) {
635
643
  const e = new Date(Date.UTC(1900, 0, 1, 0, 0, 0)), n = new Date(Date.UTC(1900, 1, 28, 0, 0, 0));
636
644
  let r = t - 1;
637
645
  return r > (n.getTime() - e.getTime()) / (1e3 * 3600 * 24) && (r -= 1), r < 0 && (r = t), new Date(e.getTime() + r * (1e3 * 3600 * 24));
@@ -655,7 +663,7 @@ class ye {
655
663
  getFilterState(e) {
656
664
  var r;
657
665
  const n = ((r = this._tableSortInfo) == null ? void 0 : r.columnIndex) === e ? this._tableSortInfo.sortState : G.None;
658
- return wt(this._tableColumnFilterList[e], n);
666
+ return ft(this._tableColumnFilterList[e], n);
659
667
  }
660
668
  getSortState() {
661
669
  var e;
@@ -681,7 +689,7 @@ class ye {
681
689
  if (a && e) {
682
690
  const { startRow: o, endRow: l, startColumn: u } = n, i = u + r, h = this.getExecuteFunc(e, n, r, a);
683
691
  for (let d = o; d <= l; d++) {
684
- const c = Rt(a) ? a.filterInfo.conditionType : O.String;
692
+ const c = pt(a) ? a.filterInfo.conditionType : U.String;
685
693
  oe(e, d, i, c) === null ? s.add(d) : h(oe(e, d, i, c)) || s.add(d);
686
694
  }
687
695
  }
@@ -690,7 +698,7 @@ class ye {
690
698
  const { startRow: s, endRow: a, startColumn: o } = n, l = o + r, u = [];
691
699
  let i = 0, h = 0;
692
700
  for (let d = s; d <= a; d++) {
693
- const c = oe(e, d, l, O.Number);
701
+ const c = oe(e, d, l, U.Number);
694
702
  c !== null && (u.push(c), i++, h += c);
695
703
  }
696
704
  return {
@@ -704,7 +712,7 @@ class ye {
704
712
  return (o) => a.has(o);
705
713
  } else if (s.filterType === ee.condition) {
706
714
  const o = je(s.filterInfo.compareType) ? this._getNumberCalculatedOptions(e, n, r) : void 0;
707
- return bn(s, o);
715
+ return Rn(s, o);
708
716
  } else
709
717
  return (a) => !0;
710
718
  }
@@ -744,13 +752,13 @@ class xe {
744
752
  var r;
745
753
  if (this._tableStyleId = n == null ? void 0 : n.tableStyleId, this._showHeader = (r = n == null ? void 0 : n.showHeader) != null ? r : !0, this._showFooter = !1, n.columns)
746
754
  n.columns.forEach((s) => {
747
- const a = s.id || L(), o = new q(a, s.displayName);
755
+ const a = s.id || L(), o = new J(a, s.displayName);
748
756
  o.fromJSON(s), this._columns.set(a, o), this._columnOrder.push(a);
749
757
  });
750
758
  else {
751
759
  const s = this.getRange(), a = s.startColumn, o = s.endColumn;
752
760
  for (let l = a; l <= o; l++) {
753
- const u = L(), i = new q(u, e[l - a]);
761
+ const u = L(), i = new J(u, e[l - a]);
754
762
  this._columns.set(u, i), this._columnOrder.push(u);
755
763
  }
756
764
  }
@@ -778,7 +786,7 @@ class xe {
778
786
  }
779
787
  setColumns(e) {
780
788
  this._columns.clear(), this._columnOrder = [], e.forEach((n) => {
781
- const r = new q(n.id, n.displayName);
789
+ const r = new J(n.id, n.displayName);
782
790
  r.fromJSON(n), this._columns.set(n.id, r), this._columnOrder.push(n.id);
783
791
  });
784
792
  }
@@ -901,7 +909,7 @@ class xe {
901
909
  }
902
910
  fromJSON(e) {
903
911
  this._id = e.id, this._name = e.name, this._range = e.range, this.tableMeta = e.meta, this._tableStyleId = e.options.tableStyleId || "", this._showHeader = e.options.showHeader || !0, this._showFooter = e.options.showFooter || !0, e.columns.forEach((r) => {
904
- const s = new q(r.id, r.displayName);
912
+ const s = new J(r.id, r.displayName);
905
913
  s.fromJSON(r), this._columns.set(r.id, s), this._columnOrder.push(r.id);
906
914
  }), this._tableFilters = new ye(), this._tableFilters.fromJSON(e.filters);
907
915
  }
@@ -909,8 +917,8 @@ class xe {
909
917
  this._id = "", this._name = "", this._tableStyleId = "", this._showHeader = !0, this._showFooter = !0, delete this._range, this._columns.clear(), this._columnOrder = [];
910
918
  }
911
919
  }
912
- var fn = Object.getOwnPropertyDescriptor, Cn = (t, e, n, r) => {
913
- for (var s = r > 1 ? void 0 : r ? fn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
920
+ var Cn = Object.getOwnPropertyDescriptor, _n = (t, e, n, r) => {
921
+ for (var s = r > 1 ? void 0 : r ? Cn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
914
922
  (o = t[a]) && (s = o(s) || s);
915
923
  return s;
916
924
  }, Oe = (t, e) => (n, r) => e(n, r, t);
@@ -1068,16 +1076,16 @@ let _ = class extends k {
1068
1076
  const s = this.getTableById(e, n);
1069
1077
  if (!s) return;
1070
1078
  const { operationType: a, rowColType: o, index: l, count: u, columnsJson: i } = r, h = s.getRange(), d = { ...h };
1071
- if (a === T.Insert) {
1079
+ if (a === I.Insert) {
1072
1080
  if (o === "row")
1073
1081
  d.endRow += u;
1074
1082
  else if (o === "column") {
1075
1083
  d.endColumn += u;
1076
1084
  for (let c = 0; c < u; c++) {
1077
- const m = this._localeService.t("sheets-table.columnPrefix"), C = new q(L(), Z(s.getColumnsCount() + 1 + c, m));
1078
- i != null && i[c] && C.fromJSON(i[c]);
1085
+ const m = this._localeService.t("sheets-table.columnPrefix"), S = new J(L(), Z(s.getColumnsCount() + 1 + c, m));
1086
+ i != null && i[c] && S.fromJSON(i[c]);
1079
1087
  const w = l + c - h.startColumn;
1080
- s.insertColumn(w, C);
1088
+ s.insertColumn(w, S);
1081
1089
  }
1082
1090
  }
1083
1091
  } else if (o === "row")
@@ -1104,7 +1112,7 @@ let _ = class extends k {
1104
1112
  if (o.startColumn < a.startColumn) {
1105
1113
  const l = a.startColumn - o.startColumn, u = this._localeService.t("sheets-table.columnPrefix");
1106
1114
  for (let i = 0; i < l; i++)
1107
- s.insertColumn(a.startColumn, new q(L(), Z(s.getColumnsCount() + 1, u)));
1115
+ s.insertColumn(a.startColumn, new J(L(), Z(s.getColumnsCount() + 1, u)));
1108
1116
  } else if (o.startColumn > a.startColumn) {
1109
1117
  const l = o.startColumn - a.startColumn;
1110
1118
  for (let u = l - 1; u >= 0; u--) {
@@ -1121,7 +1129,7 @@ let _ = class extends k {
1121
1129
  } else if (o.endColumn > a.endColumn) {
1122
1130
  const l = o.endColumn - a.endColumn;
1123
1131
  for (let u = 0; u < l; u++)
1124
- s.insertColumn(a.endColumn, new q(L(), Z(s.getColumnsCount() + 1, "Column")));
1132
+ s.insertColumn(a.endColumn, new J(L(), Z(s.getColumnsCount() + 1, "Column")));
1125
1133
  }
1126
1134
  s.setRange(o), this._tableRangeChanged$.next({
1127
1135
  unitId: e,
@@ -1162,17 +1170,30 @@ let _ = class extends k {
1162
1170
  const n = {}, r = this._tableMap.get(e);
1163
1171
  return r && r.forEach((s) => {
1164
1172
  const a = s.getSubunitId();
1165
- n[a] || (n[a] = []), n[a].push(s.toJSON());
1173
+ if (!n[a]) {
1174
+ const o = /* @__PURE__ */ new Set();
1175
+ this.getTablesBySubunitId(e, a).forEach((u) => {
1176
+ const i = u.getTableFilters().getFilterOutRows();
1177
+ if (i)
1178
+ for (const h of i)
1179
+ o.add(h);
1180
+ }), n[a] = {
1181
+ tables: [],
1182
+ tableFilteredOutRows: Array.from(o)
1183
+ };
1184
+ }
1185
+ n[a].tables.push(s.toJSON());
1166
1186
  }), n;
1167
1187
  }
1168
1188
  fromJSON(e, n) {
1169
1189
  const r = this._ensureUnit(e);
1170
1190
  Object.keys(n).forEach((a) => {
1171
- const o = U(this._univerInstanceService, { unitId: e, subUnitId: a });
1191
+ const o = $(this._univerInstanceService, { unitId: e, subUnitId: a });
1172
1192
  if (!o)
1173
1193
  return;
1174
1194
  const l = o.worksheet;
1175
- n[a].forEach((i) => {
1195
+ let u;
1196
+ n[a].tables ? u = n[a].tables : Array.isArray(n[a]) && (u = n[a]), u && u.forEach((i) => {
1176
1197
  const h = this.getColumnHeader(e, a, i.range), d = new xe(i.id, i.name, i.range, h, i.options);
1177
1198
  if (d.setTableMeta(i.meta), i.columns.length && d.setColumns(i.columns), i.filters) {
1178
1199
  const c = d.getTableFilters();
@@ -1197,15 +1218,15 @@ let _ = class extends k {
1197
1218
  }), this._tableMap.clear();
1198
1219
  }
1199
1220
  };
1200
- _ = Cn([
1201
- Oe(0, J),
1202
- Oe(1, S(Ce))
1221
+ _ = _n([
1222
+ Oe(0, W),
1223
+ Oe(1, C(de))
1203
1224
  ], _);
1204
- var Sn = Object.getOwnPropertyDescriptor, _n = (t, e, n, r) => {
1205
- for (var s = r > 1 ? void 0 : r ? Sn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
1225
+ var Tn = Object.getOwnPropertyDescriptor, In = (t, e, n, r) => {
1226
+ for (var s = r > 1 ? void 0 : r ? Tn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
1206
1227
  (o = t[a]) && (s = o(s) || s);
1207
1228
  return s;
1208
- }, Tn = (t, e) => (n, r) => e(n, r, t);
1229
+ }, Mn = (t, e) => (n, r) => e(n, r, t);
1209
1230
  let z = class extends k {
1210
1231
  constructor(t) {
1211
1232
  super(), this._tableManager = t;
@@ -1246,12 +1267,12 @@ let z = class extends k {
1246
1267
  addFilter(t, e, n, r) {
1247
1268
  this._tableManager.addFilter(t, e, n, r);
1248
1269
  }
1249
- getCellValueWithConditionType(t, e, n, r = O.String) {
1270
+ getCellValueWithConditionType(t, e, n, r = U.String) {
1250
1271
  return oe(t, e, n, r);
1251
1272
  }
1252
1273
  };
1253
- z = _n([
1254
- Tn(0, S(_))
1274
+ z = In([
1275
+ Mn(0, C(_))
1255
1276
  ], z);
1256
1277
  const te = {
1257
1278
  id: "sheet.mutation.add-table",
@@ -1267,33 +1288,33 @@ const te = {
1267
1288
  const { unitId: n, subUnitId: r, tableId: s } = e;
1268
1289
  return t.get(z).deleteTable(n, r, s), !0;
1269
1290
  }
1270
- }, In = {
1291
+ }, vn = {
1271
1292
  id: "sheet.command.add-table",
1272
1293
  type: N.COMMAND,
1273
1294
  handler: (t, e) => {
1274
1295
  var w;
1275
1296
  if (!e)
1276
1297
  return !1;
1277
- const n = t.get($), r = t.get(x), s = t.get(Ce), a = (w = e.id) != null ? w : L();
1298
+ const n = t.get(A), r = t.get(x), s = t.get(de), a = (w = e.id) != null ? w : L();
1278
1299
  let o = e.name;
1279
1300
  if (!o) {
1280
1301
  const R = t.get(_).getTableList(e.unitId).length;
1281
- o = `${s.t("sheets-table.tablePrefix")} ${R + 1}`;
1302
+ o = `${s.t("sheets-table.tablePrefix")}${R + 1}`;
1282
1303
  }
1283
1304
  const l = [], u = [], i = t.get(_), { unitId: h, subUnitId: d, range: c } = e, m = i.getColumnHeader(h, d, c, s.t("sheets-table.columnPrefix"));
1284
- return l.push({ id: te.id, params: { ...e, tableId: a, name: o, header: m } }), u.push({ id: ne.id, params: { tableId: a, unitId: e.unitId } }), A(l, r) && n.pushUndoRedo({
1305
+ return l.push({ id: te.id, params: { ...e, tableId: a, name: o, header: m } }), u.push({ id: ne.id, params: { tableId: a, unitId: e.unitId } }), B(l, r) && n.pushUndoRedo({
1285
1306
  unitID: e.unitId,
1286
1307
  undoMutations: u,
1287
1308
  redoMutations: l
1288
1309
  }), !0;
1289
1310
  }
1290
- }, Mn = {
1311
+ }, Fn = {
1291
1312
  id: "sheet.command.delete-table",
1292
1313
  type: N.COMMAND,
1293
1314
  handler: (t, e) => {
1294
1315
  if (!e)
1295
1316
  return !1;
1296
- const n = t.get($), r = t.get(x), s = t.get(_), a = [], o = [], l = s.getTable(e.unitId, e.tableId), u = l == null ? void 0 : l.toJSON();
1317
+ const n = t.get(A), r = t.get(x), s = t.get(_), a = [], o = [], l = s.getTable(e.unitId, e.tableId), u = l == null ? void 0 : l.toJSON();
1297
1318
  if (!u)
1298
1319
  throw new Error("[TableManager]: Table not found");
1299
1320
  return a.push({ id: ne.id, params: { ...e } }), o.push({
@@ -1306,39 +1327,39 @@ const te = {
1306
1327
  range: u.range,
1307
1328
  options: u.options
1308
1329
  }
1309
- }), A(a, r) && n.pushUndoRedo({
1330
+ }), B(a, r) && n.pushUndoRedo({
1310
1331
  unitID: e.unitId,
1311
1332
  undoMutations: o,
1312
1333
  redoMutations: a
1313
1334
  }), !0;
1314
1335
  }
1315
- }, fe = {
1336
+ }, Ce = {
1316
1337
  id: "sheet.mutation.set-table-filter",
1317
1338
  type: N.MUTATION,
1318
1339
  handler: (t, e) => {
1319
1340
  const { tableId: n, unitId: r, column: s, tableFilter: a } = e;
1320
1341
  return t.get(_).addFilter(r, n, s, a), !0;
1321
1342
  }
1322
- }, vn = {
1343
+ }, Dn = {
1323
1344
  id: "sheet.command.set-table-filter",
1324
1345
  type: N.COMMAND,
1325
1346
  handler: (t, e) => {
1326
1347
  if (!e)
1327
1348
  return !1;
1328
- const n = t.get($), r = t.get(x), s = e.tableId || L(), a = [], o = [];
1329
- return a.push({ id: fe.id, params: { ...e, tableId: s } }), o.push({ id: fe.id, params: { ...e, tableId: s, tableFilter: void 0 } }), A(a, r) && n.pushUndoRedo({
1349
+ const n = t.get(A), r = t.get(x), s = e.tableId || L(), a = [], o = [];
1350
+ return a.push({ id: Ce.id, params: { ...e, tableId: s } }), o.push({ id: Ce.id, params: { ...e, tableId: s, tableFilter: void 0 } }), B(a, r) && n.pushUndoRedo({
1330
1351
  unitID: e.unitId,
1331
1352
  undoMutations: o,
1332
1353
  redoMutations: a
1333
1354
  }), !0;
1334
1355
  }
1335
- }, ze = "SHEET_TABLE_PLUGIN", se = "SHEET_TABLE", Fn = "table-custom";
1336
- var Dn = Object.getOwnPropertyDescriptor, Nn = (t, e, n, r) => {
1337
- for (var s = r > 1 ? void 0 : r ? Dn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
1356
+ }, ze = "SHEET_TABLE_PLUGIN", se = "SHEET_TABLE", Nn = "table-custom";
1357
+ var yn = Object.getOwnPropertyDescriptor, xn = (t, e, n, r) => {
1358
+ for (var s = r > 1 ? void 0 : r ? yn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
1338
1359
  (o = t[a]) && (s = o(s) || s);
1339
1360
  return s;
1340
- }, me = (t, e) => (n, r) => e(n, r, t);
1341
- let W = class extends k {
1361
+ }, we = (t, e) => (n, r) => e(n, r, t);
1362
+ let E = class extends k {
1342
1363
  constructor(e, n, r) {
1343
1364
  super();
1344
1365
  b(this, "_tableRangeRTree", /* @__PURE__ */ new Map());
@@ -1347,7 +1368,7 @@ let W = class extends k {
1347
1368
  getContainerTableWithRange(e, n, r) {
1348
1369
  const s = this._ensureTableRangeRTree(e), o = Array.from(s.bulkSearch([{ unitId: e, sheetId: n, range: r }])).find((l) => {
1349
1370
  const u = this._tableManager.getTable(e, String(l));
1350
- return u ? pe.contains(u.getRange(), r) : !1;
1371
+ return u ? Se.contains(u.getRange(), r) : !1;
1351
1372
  });
1352
1373
  if (o)
1353
1374
  return this._tableManager.getTable(e, String(o));
@@ -1438,7 +1459,7 @@ let W = class extends k {
1438
1459
  return {};
1439
1460
  }
1440
1461
  },
1441
- businesses: [Se.UNIVER_SHEET],
1462
+ businesses: [he.UNIVER_SHEET],
1442
1463
  pluginName: ze,
1443
1464
  onLoad: (e, n) => {
1444
1465
  this._fromJSON(e, n);
@@ -1452,11 +1473,11 @@ let W = class extends k {
1452
1473
  super.dispose(), this._tableRangeRTree.clear();
1453
1474
  }
1454
1475
  };
1455
- W = Nn([
1456
- me(0, S(_e)),
1457
- me(1, S(_)),
1458
- me(2, S(et))
1459
- ], W);
1476
+ E = xn([
1477
+ we(0, C(_e)),
1478
+ we(1, C(_)),
1479
+ we(2, C(et))
1480
+ ], E);
1460
1481
  const p = {
1461
1482
  id: "sheet.mutation.set-sheet-table",
1462
1483
  type: N.MUTATION,
@@ -1466,7 +1487,7 @@ const p = {
1466
1487
  const { unitId: n, tableId: r, config: s } = e;
1467
1488
  return t.get(_).setTableByConfig(n, r, s), !0;
1468
1489
  }
1469
- }, yn = {
1490
+ }, On = {
1470
1491
  id: "sheet.command.add-table-theme",
1471
1492
  type: N.COMMAND,
1472
1493
  handler: (t, e) => {
@@ -1476,7 +1497,7 @@ const p = {
1476
1497
  if (!u) return !1;
1477
1498
  const i = u.getSubunitId();
1478
1499
  o.push({
1479
- id: We.id,
1500
+ id: Ee.id,
1480
1501
  params: {
1481
1502
  unitId: r,
1482
1503
  subUnitId: i,
@@ -1503,7 +1524,7 @@ const p = {
1503
1524
  }
1504
1525
  }
1505
1526
  }), l.push({
1506
- id: Ee.id,
1527
+ id: We.id,
1507
1528
  params: {
1508
1529
  unitId: r,
1509
1530
  subUnitId: i,
@@ -1511,13 +1532,13 @@ const p = {
1511
1532
  }
1512
1533
  });
1513
1534
  const h = t.get(x);
1514
- return A(o, h) && t.get($).pushUndoRedo({
1535
+ return B(o, h) && t.get(A).pushUndoRedo({
1515
1536
  unitID: r,
1516
1537
  undoMutations: l,
1517
1538
  redoMutations: o
1518
1539
  }), !0;
1519
1540
  }
1520
- }, xn = {
1541
+ }, Un = {
1521
1542
  id: "sheet.command.remove-table-theme",
1522
1543
  type: N.COMMAND,
1523
1544
  handler: (t, e) => {
@@ -1526,41 +1547,49 @@ const p = {
1526
1547
  const { unitId: n, tableId: r, themeName: s } = e, a = t.get(_), o = t.get(He), l = a.getTableById(n, r);
1527
1548
  if (!l) return !1;
1528
1549
  const u = l.getSubunitId(), i = [], h = [], d = o.getRegisteredRangeThemes().filter((R) => R == null ? void 0 : R.startsWith("table-default"));
1529
- let m = o.getRegisteredRangeThemes().filter((R) => R == null ? void 0 : R.startsWith(Fn)).find((R) => R !== s);
1530
- m || (m = d[0]), i.push({ id: p.id, params: { unitId: n, subUnitId: u, tableId: r, config: { theme: m } } }), i.push({ id: Ee.id, params: { unitId: n, subUnitId: u, styleName: s } });
1531
- const C = o.getDefaultRangeThemeStyle(s);
1532
- C && (h.push({ id: We.id, params: { unitId: n, subUnitId: u, styleJSON: C.toJson() } }), h.push({ id: p.id, params: { unitId: n, subUnitId: u, tableId: r, config: { theme: s } } }));
1550
+ let m = o.getRegisteredRangeThemes().filter((R) => R == null ? void 0 : R.startsWith(Nn)).find((R) => R !== s);
1551
+ m || (m = d[0]), i.push({ id: p.id, params: { unitId: n, subUnitId: u, tableId: r, config: { theme: m } } }), i.push({ id: We.id, params: { unitId: n, subUnitId: u, styleName: s } });
1552
+ const S = o.getDefaultRangeThemeStyle(s);
1553
+ S && (h.push({ id: Ee.id, params: { unitId: n, subUnitId: u, styleJSON: S.toJson() } }), h.push({ id: p.id, params: { unitId: n, subUnitId: u, tableId: r, config: { theme: s } } }));
1533
1554
  const w = t.get(x);
1534
- return A(i, w) && t.get($).pushUndoRedo({
1555
+ return B(i, w) && t.get(A).pushUndoRedo({
1535
1556
  unitID: n,
1536
1557
  redoMutations: i,
1537
1558
  undoMutations: h
1538
1559
  }), !0;
1539
1560
  }
1540
- }, On = {
1561
+ }, $n = {
1541
1562
  id: "sheet.command.set-table-config",
1542
1563
  type: N.COMMAND,
1564
+ // eslint-disable-next-line max-lines-per-function
1543
1565
  handler: (t, e) => {
1544
1566
  if (!e)
1545
1567
  return !1;
1546
1568
  const { unitId: n, tableId: r, name: s, updateRange: a, rowColOperation: o, theme: l } = e, i = t.get(_).getTableById(n, r);
1547
1569
  if (!i) return !1;
1548
- const h = {}, d = {};
1549
- s && (h.name = i.getDisplayName(), d.name = s), o && (h.rowColOperation = {
1550
- operationType: o.operationType === T.Insert ? T.Delete : T.Insert,
1570
+ const h = {}, d = {}, c = t.get(de), S = t.get(W).getCurrentUnitOfType(he.UNIVER_SHEET), w = /* @__PURE__ */ new Set();
1571
+ if (S && S.getSheets().forEach((O) => {
1572
+ w.add(O.getName());
1573
+ }), s) {
1574
+ if (!rt(s, w))
1575
+ return t.get(st).warn(c.t("sheets-table.tableNameError")), !1;
1576
+ h.name = i.getDisplayName(), d.name = s;
1577
+ }
1578
+ o && (h.rowColOperation = {
1579
+ operationType: o.operationType === I.Insert ? I.Delete : I.Insert,
1551
1580
  rowColType: o.rowColType,
1552
1581
  index: o.index,
1553
1582
  count: o.count
1554
1583
  }, d.rowColOperation = o), a && (h.updateRange = {
1555
1584
  newRange: i.getRange()
1556
1585
  }, d.updateRange = a), l && (h.theme = i.getTableStyleId(), d.theme = l);
1557
- const c = {
1586
+ const f = {
1558
1587
  unitId: n,
1559
1588
  subUnitId: i.getSubunitId(),
1560
1589
  tableId: r,
1561
1590
  config: d
1562
1591
  };
1563
- return t.get(x).executeCommand(p.id, c), t.get($).pushUndoRedo({
1592
+ return t.get(x).executeCommand(p.id, f), t.get(A).pushUndoRedo({
1564
1593
  unitID: n,
1565
1594
  undoMutations: [
1566
1595
  {
@@ -1576,25 +1605,25 @@ const p = {
1576
1605
  redoMutations: [
1577
1606
  {
1578
1607
  id: p.id,
1579
- params: c
1608
+ params: f
1580
1609
  }
1581
1610
  ]
1582
1611
  }), !0;
1583
1612
  }
1584
- }, Un = {
1613
+ }, An = {
1585
1614
  id: "sheet.command.table-insert-row",
1586
1615
  type: N.COMMAND,
1587
1616
  handler: (t) => {
1588
- const e = t.get(J), n = U(e);
1617
+ const e = t.get(W), n = $(e);
1589
1618
  if (!n)
1590
1619
  return !1;
1591
- const { workbook: r, worksheet: s, unitId: a, subUnitId: o } = n, u = t.get(de).getCurrentSelections();
1620
+ const { workbook: r, worksheet: s, unitId: a, subUnitId: o } = n, u = t.get(ge).getCurrentSelections();
1592
1621
  if (!u.length || u.length > 1)
1593
1622
  return !1;
1594
1623
  t.get(_);
1595
- const h = u[0].range, c = t.get(W).getContainerTableWithRange(a, o, h);
1624
+ const h = u[0].range, c = t.get(E).getContainerTableWithRange(a, o, h);
1596
1625
  if (!c) return !1;
1597
- const m = h.endRow - h.startRow + 1, w = s.getRowCount() - 1, f = s.getCellMatrix().getDataRange().endRow, R = [], I = [];
1626
+ const m = h.endRow - h.startRow + 1, w = s.getRowCount() - 1, f = s.getCellMatrix().getDataRange().endRow, R = [], T = [];
1598
1627
  if (w - f < m)
1599
1628
  R.push({
1600
1629
  id: Pe.id,
@@ -1618,7 +1647,7 @@ const p = {
1618
1647
  }
1619
1648
  }
1620
1649
  }
1621
- }), I.push({
1650
+ }), T.push({
1622
1651
  id: p.id,
1623
1652
  params: {
1624
1653
  unitId: a,
@@ -1630,7 +1659,7 @@ const p = {
1630
1659
  }
1631
1660
  }
1632
1661
  }
1633
- }), I.push({
1662
+ }), T.push({
1634
1663
  id: Ve.id,
1635
1664
  params: {
1636
1665
  unitId: a,
@@ -1655,7 +1684,7 @@ const p = {
1655
1684
  }
1656
1685
  }
1657
1686
  }
1658
- }), I.push({
1687
+ }), T.push({
1659
1688
  id: p.id,
1660
1689
  params: {
1661
1690
  unitId: a,
@@ -1668,7 +1697,7 @@ const p = {
1668
1697
  }
1669
1698
  }
1670
1699
  });
1671
- const X = he(
1700
+ const X = me(
1672
1701
  t,
1673
1702
  {
1674
1703
  unitId: a,
@@ -1691,29 +1720,29 @@ const p = {
1691
1720
  }
1692
1721
  }
1693
1722
  );
1694
- X && (R.push(...X.redos), I.push(...X.undos));
1723
+ X && (R.push(...X.redos), T.push(...X.undos));
1695
1724
  }
1696
- const B = t.get(x);
1697
- return A(R, B) && t.get($).pushUndoRedo({
1725
+ const O = t.get(x);
1726
+ return B(R, O) && t.get(A).pushUndoRedo({
1698
1727
  unitID: a,
1699
- undoMutations: I,
1728
+ undoMutations: T,
1700
1729
  redoMutations: R
1701
1730
  }), !0;
1702
1731
  }
1703
- }, $n = {
1732
+ }, Bn = {
1704
1733
  id: "sheet.command.table-insert-col",
1705
1734
  type: N.COMMAND,
1706
1735
  handler: (t) => {
1707
- const e = t.get(J), n = U(e);
1736
+ const e = t.get(W), n = $(e);
1708
1737
  if (!n)
1709
1738
  return !1;
1710
- const { worksheet: r, unitId: s, subUnitId: a } = n, l = t.get(de).getCurrentSelections();
1739
+ const { worksheet: r, unitId: s, subUnitId: a } = n, l = t.get(ge).getCurrentSelections();
1711
1740
  if (!l.length || l.length > 1)
1712
1741
  return !1;
1713
- const i = l[0].range, d = t.get(W).getContainerTableWithRange(s, a, i);
1742
+ const i = l[0].range, d = t.get(E).getContainerTableWithRange(s, a, i);
1714
1743
  if (!d) return !1;
1715
- const c = i.endColumn - i.startColumn + 1, C = r.getColumnCount() - 1, w = r.getCellMatrix().getDataRange().endColumn, f = [], R = [];
1716
- if (C - w < c)
1744
+ const c = i.endColumn - i.startColumn + 1, S = r.getColumnCount() - 1, w = r.getCellMatrix().getDataRange().endColumn, f = [], R = [];
1745
+ if (S - w < c)
1717
1746
  f.push({
1718
1747
  id: qe.id,
1719
1748
  params: {
@@ -1729,7 +1758,7 @@ const p = {
1729
1758
  tableId: d.getId(),
1730
1759
  config: {
1731
1760
  rowColOperation: {
1732
- operationType: T.Insert,
1761
+ operationType: I.Insert,
1733
1762
  rowColType: D.Col,
1734
1763
  index: i.startColumn,
1735
1764
  count: c
@@ -1744,7 +1773,7 @@ const p = {
1744
1773
  tableId: d.getId(),
1745
1774
  config: {
1746
1775
  rowColOperation: {
1747
- operationType: T.Delete,
1776
+ operationType: I.Delete,
1748
1777
  rowColType: D.Col,
1749
1778
  index: i.startColumn,
1750
1779
  count: c
@@ -1769,7 +1798,7 @@ const p = {
1769
1798
  tableId: d.getId(),
1770
1799
  config: {
1771
1800
  rowColOperation: {
1772
- operationType: T.Insert,
1801
+ operationType: I.Insert,
1773
1802
  rowColType: D.Col,
1774
1803
  index: i.startColumn,
1775
1804
  count: c
@@ -1784,7 +1813,7 @@ const p = {
1784
1813
  tableId: d.getId(),
1785
1814
  config: {
1786
1815
  rowColOperation: {
1787
- operationType: T.Delete,
1816
+ operationType: I.Delete,
1788
1817
  rowColType: D.Col,
1789
1818
  index: i.startColumn,
1790
1819
  count: c
@@ -1792,7 +1821,7 @@ const p = {
1792
1821
  }
1793
1822
  }
1794
1823
  });
1795
- const M = he(
1824
+ const M = me(
1796
1825
  t,
1797
1826
  {
1798
1827
  unitId: s,
@@ -1817,28 +1846,28 @@ const p = {
1817
1846
  );
1818
1847
  M && (f.push(...M.redos), R.push(...M.undos));
1819
1848
  }
1820
- const I = t.get(x);
1821
- return A(f, I) && t.get($).pushUndoRedo({
1849
+ const T = t.get(x);
1850
+ return B(f, T) && t.get(A).pushUndoRedo({
1822
1851
  unitID: s,
1823
1852
  undoMutations: R,
1824
1853
  redoMutations: f
1825
1854
  }), !0;
1826
1855
  }
1827
- }, An = {
1856
+ }, Ln = {
1828
1857
  id: "sheet.command.table-remove-row",
1829
1858
  type: N.COMMAND,
1830
1859
  handler: (t, e) => {
1831
1860
  if (!e)
1832
1861
  return !1;
1833
- const n = t.get(J), r = U(n);
1862
+ const n = t.get(W), r = $(n);
1834
1863
  if (!r)
1835
1864
  return !1;
1836
- const { unitId: s, subUnitId: a } = r, l = t.get(de).getCurrentSelections();
1865
+ const { unitId: s, subUnitId: a } = r, l = t.get(ge).getCurrentSelections();
1837
1866
  if (!l.length || l.length > 1)
1838
1867
  return !1;
1839
- const i = l[0].range, d = t.get(W).getContainerTableWithRange(s, a, i);
1868
+ const i = l[0].range, d = t.get(E).getContainerTableWithRange(s, a, i);
1840
1869
  if (!d) return !1;
1841
- const c = i.endRow - i.startRow + 1, m = [], C = [], w = d.getRange();
1870
+ const c = i.endRow - i.startRow + 1, m = [], S = [], w = d.getRange();
1842
1871
  m.push({
1843
1872
  id: p.id,
1844
1873
  params: {
@@ -1854,7 +1883,7 @@ const p = {
1854
1883
  }
1855
1884
  }
1856
1885
  }
1857
- }), C.push({
1886
+ }), S.push({
1858
1887
  id: p.id,
1859
1888
  params: {
1860
1889
  unitId: s,
@@ -1867,7 +1896,7 @@ const p = {
1867
1896
  }
1868
1897
  }
1869
1898
  });
1870
- const R = r.worksheet.getCellMatrix().getDataRange().endRow, I = he(
1899
+ const R = r.worksheet.getCellMatrix().getDataRange().endRow, T = me(
1871
1900
  t,
1872
1901
  {
1873
1902
  unitId: s,
@@ -1890,32 +1919,32 @@ const p = {
1890
1919
  }
1891
1920
  }
1892
1921
  );
1893
- I && (m.push(...I.redos), C.push(...I.undos));
1894
- const B = t.get(x);
1895
- return A(m, B) && t.get($).pushUndoRedo({
1922
+ T && (m.push(...T.redos), S.push(...T.undos));
1923
+ const O = t.get(x);
1924
+ return B(m, O) && t.get(A).pushUndoRedo({
1896
1925
  unitID: s,
1897
- undoMutations: C,
1926
+ undoMutations: S,
1898
1927
  redoMutations: m
1899
1928
  }), !0;
1900
1929
  }
1901
- }, Bn = {
1930
+ }, En = {
1902
1931
  id: "sheet.command.table-remove-col",
1903
1932
  type: N.COMMAND,
1904
1933
  handler: (t, e) => {
1905
1934
  if (!e)
1906
1935
  return !1;
1907
- const n = t.get(J), r = U(n);
1936
+ const n = t.get(W), r = $(n);
1908
1937
  if (!r)
1909
1938
  return !1;
1910
1939
  const { workbook: s, unitId: a, subUnitId: o } = r;
1911
1940
  t.get(_);
1912
- const u = t.get(de).getCurrentSelections();
1941
+ const u = t.get(ge).getCurrentSelections();
1913
1942
  if (!u.length || u.length > 1)
1914
1943
  return !1;
1915
- const h = u[0].range, c = t.get(W).getContainerTableWithRange(a, o, h);
1944
+ const h = u[0].range, c = t.get(E).getContainerTableWithRange(a, o, h);
1916
1945
  if (!c) return !1;
1917
- const m = h.endColumn - h.startColumn + 1, C = [], w = [], f = c.getRange();
1918
- C.push({
1946
+ const m = h.endColumn - h.startColumn + 1, S = [], w = [], f = c.getRange();
1947
+ S.push({
1919
1948
  id: p.id,
1920
1949
  params: {
1921
1950
  unitId: a,
@@ -1923,7 +1952,7 @@ const p = {
1923
1952
  tableId: c.getId(),
1924
1953
  config: {
1925
1954
  rowColOperation: {
1926
- operationType: T.Delete,
1955
+ operationType: I.Delete,
1927
1956
  rowColType: D.Col,
1928
1957
  index: h.startColumn,
1929
1958
  count: m
@@ -1931,9 +1960,9 @@ const p = {
1931
1960
  }
1932
1961
  }
1933
1962
  });
1934
- const R = [], I = h.startColumn - f.startColumn;
1963
+ const R = [], T = h.startColumn - f.startColumn;
1935
1964
  for (let re = 0; re < m; re++) {
1936
- const Ie = c.getTableInfo().columns[I + re];
1965
+ const Ie = c.getTableInfo().columns[T + re];
1937
1966
  Ie && R.push(Ie);
1938
1967
  }
1939
1968
  w.push({
@@ -1944,7 +1973,7 @@ const p = {
1944
1973
  tableId: c.getId(),
1945
1974
  config: {
1946
1975
  rowColOperation: {
1947
- operationType: T.Insert,
1976
+ operationType: I.Insert,
1948
1977
  rowColType: D.Col,
1949
1978
  index: h.startColumn,
1950
1979
  count: m,
@@ -1953,7 +1982,7 @@ const p = {
1953
1982
  }
1954
1983
  }
1955
1984
  });
1956
- const v = r.worksheet.getCellMatrix().getDataRange().endColumn, M = he(
1985
+ const v = r.worksheet.getCellMatrix().getDataRange().endColumn, M = me(
1957
1986
  t,
1958
1987
  {
1959
1988
  unitId: a,
@@ -1976,17 +2005,17 @@ const p = {
1976
2005
  }
1977
2006
  }
1978
2007
  );
1979
- M && (C.push(...M.redos), w.push(...M.undos));
2008
+ M && (S.push(...M.redos), w.push(...M.undos));
1980
2009
  const X = t.get(x);
1981
- return A(C, X) && t.get($).pushUndoRedo({
2010
+ return B(S, X) && t.get(A).pushUndoRedo({
1982
2011
  unitID: a,
1983
2012
  undoMutations: w,
1984
- redoMutations: C
2013
+ redoMutations: S
1985
2014
  }), !0;
1986
2015
  }
1987
- }, Ln = "sheets-table.config", Ue = {};
1988
- var Wn = Object.getOwnPropertyDescriptor, En = (t, e, n, r) => {
1989
- for (var s = r > 1 ? void 0 : r ? Wn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2016
+ }, Wn = "sheets-table.config", Ue = {};
2017
+ var Hn = Object.getOwnPropertyDescriptor, Pn = (t, e, n, r) => {
2018
+ for (var s = r > 1 ? void 0 : r ? Hn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
1990
2019
  (o = t[a]) && (s = o(s) || s);
1991
2020
  return s;
1992
2021
  }, $e = (t, e) => (n, r) => e(n, r, t);
@@ -2019,15 +2048,15 @@ let ie = class extends k {
2019
2048
  );
2020
2049
  }
2021
2050
  };
2022
- ie = En([
2023
- $e(0, S(_)),
2024
- $e(1, S(it))
2051
+ ie = Pn([
2052
+ $e(0, C(_)),
2053
+ $e(1, C(ut))
2025
2054
  ], ie);
2026
- var Hn = Object.getOwnPropertyDescriptor, Pn = (t, e, n, r) => {
2027
- for (var s = r > 1 ? void 0 : r ? Hn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2055
+ var Vn = Object.getOwnPropertyDescriptor, qn = (t, e, n, r) => {
2056
+ for (var s = r > 1 ? void 0 : r ? Vn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2028
2057
  (o = t[a]) && (s = o(s) || s);
2029
2058
  return s;
2030
- }, E = (t, e) => (n, r) => e(n, r, t);
2059
+ }, H = (t, e) => (n, r) => e(n, r, t);
2031
2060
  let le = class extends k {
2032
2061
  constructor(t, e, n, r, s, a, o) {
2033
2062
  super(), this._commandService = t, this._refRangeService = e, this._univerInstanceService = n, this._injector = r, this._sheetInterceptorService = s, this._tableManager = a, this._localeService = o, this._initCommandInterceptor(), this._initCommandListener();
@@ -2038,13 +2067,13 @@ let le = class extends k {
2038
2067
  getMutations(e) {
2039
2068
  const n = { redos: [], undos: [] }, { id: r, params: s } = e;
2040
2069
  switch (r) {
2041
- case ht.id:
2070
+ case mt.id:
2042
2071
  return t._generateTableMutationWithInsertRow(s);
2043
- case dt.id:
2072
+ case gt.id:
2044
2073
  return t._generateTableMutationWithInsertCol(s);
2045
- case ct.id:
2074
+ case ht.id:
2046
2075
  return t._generateTableMutationWithRemoveRow(s);
2047
- case ut.id:
2076
+ case dt.id:
2048
2077
  return t._generateTableMutationWithRemoveCol(s);
2049
2078
  }
2050
2079
  return n;
@@ -2052,7 +2081,7 @@ let le = class extends k {
2052
2081
  });
2053
2082
  }
2054
2083
  _generateTableMutationWithInsertRow(t) {
2055
- const e = [], n = [], r = U(this._univerInstanceService);
2084
+ const e = [], n = [], r = $(this._univerInstanceService);
2056
2085
  if (!r)
2057
2086
  return { undos: e, redos: n };
2058
2087
  const { unitId: s, subUnitId: a } = r, o = this._tableManager.getTablesBySubunitId(s, a);
@@ -2097,7 +2126,7 @@ let le = class extends k {
2097
2126
  }), { undos: e, redos: n };
2098
2127
  }
2099
2128
  _generateTableMutationWithInsertCol(t) {
2100
- const e = [], n = [], r = U(this._univerInstanceService);
2129
+ const e = [], n = [], r = $(this._univerInstanceService);
2101
2130
  if (!r)
2102
2131
  return { undos: e, redos: n };
2103
2132
  const { unitId: s, subUnitId: a } = r, o = this._tableManager.getTablesBySubunitId(s, a);
@@ -2116,7 +2145,7 @@ let le = class extends k {
2116
2145
  tableId: u.getId(),
2117
2146
  config: {
2118
2147
  rowColOperation: {
2119
- operationType: T.Insert,
2148
+ operationType: I.Insert,
2120
2149
  rowColType: D.Col,
2121
2150
  index: l.startColumn,
2122
2151
  count: h
@@ -2131,7 +2160,7 @@ let le = class extends k {
2131
2160
  tableId: u.getId(),
2132
2161
  config: {
2133
2162
  rowColOperation: {
2134
- operationType: T.Delete,
2163
+ operationType: I.Delete,
2135
2164
  rowColType: D.Col,
2136
2165
  index: l.startColumn,
2137
2166
  count: h
@@ -2143,7 +2172,7 @@ let le = class extends k {
2143
2172
  }), { undos: e, redos: n };
2144
2173
  }
2145
2174
  _generateTableMutationWithRemoveRow(t) {
2146
- const e = [], n = [], r = [], s = [], a = U(this._univerInstanceService);
2175
+ const e = [], n = [], r = [], s = [], a = $(this._univerInstanceService);
2147
2176
  if (!a)
2148
2177
  return { undos: e, redos: n, preRedos: r, preUndos: s };
2149
2178
  const { unitId: o, subUnitId: l } = a, u = this._tableManager.getTablesBySubunitId(o, l);
@@ -2152,7 +2181,7 @@ let le = class extends k {
2152
2181
  const { range: i } = t, h = i.endRow - i.startRow + 1;
2153
2182
  return u.forEach((d) => {
2154
2183
  const c = d.getRange();
2155
- if (pe.intersects(c, i))
2184
+ if (Se.intersects(c, i))
2156
2185
  if (i.startRow <= c.startRow && i.endRow >= c.startRow) {
2157
2186
  r.push({
2158
2187
  id: ne.id,
@@ -2236,7 +2265,7 @@ let le = class extends k {
2236
2265
  }), { undos: e, redos: n, preRedos: r, preUndos: s };
2237
2266
  }
2238
2267
  _generateTableMutationWithRemoveCol(t) {
2239
- const e = [], n = [], r = [], s = [], a = U(this._univerInstanceService);
2268
+ const e = [], n = [], r = [], s = [], a = $(this._univerInstanceService);
2240
2269
  if (!a)
2241
2270
  return { undos: e, redos: n, preRedos: r, preUndos: s };
2242
2271
  const { unitId: o, subUnitId: l } = a, u = this._tableManager.getTablesBySubunitId(o, l);
@@ -2245,7 +2274,7 @@ let le = class extends k {
2245
2274
  const { range: i } = t, h = i.endColumn - i.startColumn + 1;
2246
2275
  return u.forEach((d) => {
2247
2276
  const c = d.getRange();
2248
- if (pe.intersects(c, i)) {
2277
+ if (Se.intersects(c, i)) {
2249
2278
  if (i.startColumn <= c.startColumn && i.endColumn >= c.endColumn) {
2250
2279
  r.push({
2251
2280
  id: ne.id,
@@ -2255,12 +2284,12 @@ let le = class extends k {
2255
2284
  tableId: d.getId()
2256
2285
  }
2257
2286
  });
2258
- const m = d.toJSON(), { startRow: C, startColumn: w, endColumn: f } = m.range, R = this._univerInstanceService.getUnit(o), I = R == null ? void 0 : R.getSheetBySheetId(l);
2259
- if (!I)
2287
+ const m = d.toJSON(), { startRow: S, startColumn: w, endColumn: f } = m.range, R = this._univerInstanceService.getUnit(o), T = R == null ? void 0 : R.getSheetBySheetId(l);
2288
+ if (!T)
2260
2289
  return { undos: e, redos: n, preRedos: r, preUndos: s };
2261
- const B = [];
2290
+ const O = [];
2262
2291
  for (let v = w; v <= f; v++)
2263
- B.push(Ye(I == null ? void 0 : I.getCell(C, v)) || Z(v - w + 1, this._localeService.t("sheets-table.columnPrefix")));
2292
+ O.push(Ye(T == null ? void 0 : T.getCell(S, v)) || Z(v - w + 1, this._localeService.t("sheets-table.columnPrefix")));
2264
2293
  e.push({
2265
2294
  id: te.id,
2266
2295
  params: {
@@ -2268,7 +2297,7 @@ let le = class extends k {
2268
2297
  subUnitId: l,
2269
2298
  tableId: m.id,
2270
2299
  name: m.name,
2271
- header: B,
2300
+ header: O,
2272
2301
  range: m.range,
2273
2302
  options: m.options
2274
2303
  }
@@ -2283,7 +2312,7 @@ let le = class extends k {
2283
2312
  tableId: d.getId(),
2284
2313
  config: {
2285
2314
  rowColOperation: {
2286
- operationType: T.Delete,
2315
+ operationType: I.Delete,
2287
2316
  rowColType: D.Col,
2288
2317
  index: c.startColumn,
2289
2318
  count: m
@@ -2291,10 +2320,10 @@ let le = class extends k {
2291
2320
  }
2292
2321
  }
2293
2322
  });
2294
- const C = [];
2323
+ const S = [];
2295
2324
  for (let w = 0; w < m; w++) {
2296
2325
  const f = d.getTableColumnByIndex(w);
2297
- f && C.push(f.toJSON());
2326
+ f && S.push(f.toJSON());
2298
2327
  }
2299
2328
  e.push({
2300
2329
  id: p.id,
@@ -2304,11 +2333,11 @@ let le = class extends k {
2304
2333
  tableId: d.getId(),
2305
2334
  config: {
2306
2335
  rowColOperation: {
2307
- operationType: T.Insert,
2336
+ operationType: I.Insert,
2308
2337
  rowColType: D.Col,
2309
2338
  index: c.startColumn,
2310
2339
  count: m,
2311
- columnsJson: C
2340
+ columnsJson: S
2312
2341
  }
2313
2342
  }
2314
2343
  }
@@ -2323,7 +2352,7 @@ let le = class extends k {
2323
2352
  tableId: d.getId(),
2324
2353
  config: {
2325
2354
  rowColOperation: {
2326
- operationType: T.Delete,
2355
+ operationType: I.Delete,
2327
2356
  rowColType: D.Col,
2328
2357
  index: i.startColumn,
2329
2358
  count: m
@@ -2331,10 +2360,10 @@ let le = class extends k {
2331
2360
  }
2332
2361
  }
2333
2362
  });
2334
- const C = [], w = i.startColumn - c.startColumn;
2363
+ const S = [], w = i.startColumn - c.startColumn;
2335
2364
  for (let f = 0; f < m; f++) {
2336
2365
  const R = d.getTableColumnByIndex(f + w);
2337
- R && C.push(R.toJSON());
2366
+ R && S.push(R.toJSON());
2338
2367
  }
2339
2368
  e.push({
2340
2369
  id: p.id,
@@ -2344,11 +2373,11 @@ let le = class extends k {
2344
2373
  tableId: d.getId(),
2345
2374
  config: {
2346
2375
  rowColOperation: {
2347
- operationType: T.Insert,
2376
+ operationType: I.Insert,
2348
2377
  rowColType: D.Col,
2349
2378
  index: i.startColumn,
2350
2379
  count: h,
2351
- columnsJson: C
2380
+ columnsJson: S
2352
2381
  }
2353
2382
  }
2354
2383
  }
@@ -2362,7 +2391,7 @@ let le = class extends k {
2362
2391
  tableId: d.getId(),
2363
2392
  config: {
2364
2393
  rowColOperation: {
2365
- operationType: T.Delete,
2394
+ operationType: I.Delete,
2366
2395
  rowColType: D.Col,
2367
2396
  index: i.startColumn,
2368
2397
  count: h
@@ -2370,9 +2399,9 @@ let le = class extends k {
2370
2399
  }
2371
2400
  }
2372
2401
  });
2373
- const m = [], C = i.startColumn - c.startColumn;
2402
+ const m = [], S = i.startColumn - c.startColumn;
2374
2403
  for (let w = 0; w < h; w++) {
2375
- const f = d.getTableColumnByIndex(w + C);
2404
+ const f = d.getTableColumnByIndex(w + S);
2376
2405
  f && m.push(f.toJSON());
2377
2406
  }
2378
2407
  e.push({
@@ -2383,7 +2412,7 @@ let le = class extends k {
2383
2412
  tableId: d.getId(),
2384
2413
  config: {
2385
2414
  rowColOperation: {
2386
- operationType: T.Insert,
2415
+ operationType: I.Insert,
2387
2416
  rowColType: D.Col,
2388
2417
  index: i.startColumn,
2389
2418
  count: h,
@@ -2450,20 +2479,20 @@ let le = class extends k {
2450
2479
  });
2451
2480
  }
2452
2481
  };
2453
- le = Pn([
2454
- E(0, S(x)),
2455
- E(1, S(lt)),
2456
- E(2, S(J)),
2457
- E(3, S(Be)),
2458
- E(4, S(_e)),
2459
- E(5, S(_)),
2460
- E(6, S(Ce))
2482
+ le = qn([
2483
+ H(0, C(x)),
2484
+ H(1, C(ct)),
2485
+ H(2, C(W)),
2486
+ H(3, C(Be)),
2487
+ H(4, C(_e)),
2488
+ H(5, C(_)),
2489
+ H(6, C(de))
2461
2490
  ], le);
2462
- var Vn = Object.getOwnPropertyDescriptor, qn = (t, e, n, r) => {
2463
- for (var s = r > 1 ? void 0 : r ? Vn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2491
+ var Jn = Object.getOwnPropertyDescriptor, kn = (t, e, n, r) => {
2492
+ for (var s = r > 1 ? void 0 : r ? Jn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2464
2493
  (o = t[a]) && (s = o(s) || s);
2465
2494
  return s;
2466
- }, be = (t, e) => (n, r) => e(n, r, t);
2495
+ }, Re = (t, e) => (n, r) => e(n, r, t);
2467
2496
  let ue = class extends k {
2468
2497
  constructor(t, e, n) {
2469
2498
  super(), this._tableManager = t, this._sheetRangeThemeService = e, this._sheetRangeThemeModel = n, this.registerTableChangeEvent(), this._initDefaultTableTheme();
@@ -2517,7 +2546,7 @@ let ue = class extends k {
2517
2546
  }
2518
2547
  _initDefaultTableTheme() {
2519
2548
  for (let t = 0; t < Y.length; t++) {
2520
- const { name: e, style: n } = Y[t], r = new mt(e, n);
2549
+ const { name: e, style: n } = Y[t], r = new wt(e, n);
2521
2550
  this._sheetRangeThemeModel.registerDefaultRangeTheme(r);
2522
2551
  }
2523
2552
  }
@@ -2525,16 +2554,16 @@ let ue = class extends k {
2525
2554
  super.dispose();
2526
2555
  }
2527
2556
  };
2528
- ue = qn([
2529
- be(0, S(_)),
2530
- be(1, S(gt)),
2531
- be(2, S(He))
2557
+ ue = kn([
2558
+ Re(0, C(_)),
2559
+ Re(1, C(bt)),
2560
+ Re(2, C(He))
2532
2561
  ], ue);
2533
- var Jn = Object.getOwnPropertyDescriptor, kn = (t, e, n, r) => {
2534
- for (var s = r > 1 ? void 0 : r ? Jn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2562
+ var Qn = Object.getOwnPropertyDescriptor, Yn = (t, e, n, r) => {
2563
+ for (var s = r > 1 ? void 0 : r ? Qn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2535
2564
  (o = t[a]) && (s = o(s) || s);
2536
2565
  return s;
2537
- }, we = (t, e) => (n, r) => e(n, r, t);
2566
+ }, fe = (t, e) => (n, r) => e(n, r, t);
2538
2567
  let ce = class extends k {
2539
2568
  constructor(e, n, r) {
2540
2569
  super();
@@ -2562,13 +2591,13 @@ let ce = class extends k {
2562
2591
  }
2563
2592
  _initFilteredOutRows() {
2564
2593
  this._tableManager.tableInitStatus$.pipe(
2565
- ge((e) => e),
2566
- ve(() => this._univerInstanceService.getCurrentTypeOfUnit$(Se.UNIVER_SHEET)),
2567
- ge((e) => e != null),
2594
+ be((e) => e),
2595
+ ve(() => this._univerInstanceService.getCurrentTypeOfUnit$(he.UNIVER_SHEET)),
2596
+ be((e) => e != null),
2568
2597
  ve((e) => e.activeSheet$),
2569
- ge((e) => e != null)
2598
+ be((e) => e != null)
2570
2599
  ).subscribe(() => {
2571
- const e = U(this._univerInstanceService);
2600
+ const e = $(this._univerInstanceService);
2572
2601
  if (!e)
2573
2602
  return;
2574
2603
  const { unitId: n, subUnitId: r } = e;
@@ -2601,31 +2630,31 @@ let ce = class extends k {
2601
2630
  super.dispose(), (e = this._subscription) == null || e.unsubscribe();
2602
2631
  }
2603
2632
  };
2604
- ce = kn([
2605
- we(0, S(_)),
2606
- we(1, S(_e)),
2607
- we(2, S(J))
2633
+ ce = Yn([
2634
+ fe(0, C(_)),
2635
+ fe(1, C(_e)),
2636
+ fe(2, C(W))
2608
2637
  ], ce);
2609
- var Qn = Object.getOwnPropertyDescriptor, Yn = (t, e, n, r) => {
2610
- for (var s = r > 1 ? void 0 : r ? Qn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2638
+ var Gn = Object.getOwnPropertyDescriptor, jn = (t, e, n, r) => {
2639
+ for (var s = r > 1 ? void 0 : r ? Gn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2611
2640
  (o = t[a]) && (s = o(s) || s);
2612
2641
  return s;
2613
- }, Re = (t, e) => (n, r) => e(n, r, t), ae;
2614
- let Ae = (ae = class extends rt {
2642
+ }, pe = (t, e) => (n, r) => e(n, r, t), ae;
2643
+ let Ae = (ae = class extends at {
2615
2644
  constructor(t = Ue, e, n, r) {
2616
2645
  super(), this._config = t, this._injector = e, this._configService = n, this._commandService = r;
2617
- const { ...s } = st(
2646
+ const { ...s } = ot(
2618
2647
  {},
2619
2648
  Ue,
2620
2649
  this._config
2621
2650
  );
2622
- this._configService.setConfig(Ln, s), this._initRegisterCommand();
2651
+ this._configService.setConfig(Wn, s), this._initRegisterCommand();
2623
2652
  }
2624
2653
  onStarting() {
2625
- at(this._injector, [
2654
+ it(this._injector, [
2626
2655
  [_],
2627
2656
  [ue],
2628
- [W],
2657
+ [E],
2629
2658
  [z],
2630
2659
  [ce],
2631
2660
  [ie],
@@ -2634,7 +2663,7 @@ let Ae = (ae = class extends rt {
2634
2663
  [ie],
2635
2664
  [le],
2636
2665
  [ue],
2637
- [W],
2666
+ [E],
2638
2667
  [z],
2639
2668
  [ce]
2640
2669
  ]);
@@ -2646,58 +2675,58 @@ let Ae = (ae = class extends rt {
2646
2675
  }
2647
2676
  _initRegisterCommand() {
2648
2677
  [
2649
- In,
2678
+ vn,
2650
2679
  te,
2651
- Mn,
2680
+ Fn,
2652
2681
  ne,
2653
- fe,
2654
- vn,
2655
- On,
2682
+ Ce,
2683
+ Dn,
2684
+ $n,
2656
2685
  p,
2657
- yn,
2658
- xn,
2686
+ On,
2659
2687
  Un,
2660
- $n,
2661
2688
  An,
2662
- Bn
2689
+ Bn,
2690
+ Ln,
2691
+ En
2663
2692
  ].forEach((t) => this._commandService.registerCommand(t));
2664
2693
  }
2665
- }, b(ae, "pluginName", ze), b(ae, "type", Se.UNIVER_SHEET), ae);
2666
- Ae = Yn([
2667
- Re(1, S(Be)),
2668
- Re(2, ot),
2669
- Re(3, S(x))
2694
+ }, b(ae, "pluginName", ze), b(ae, "type", he.UNIVER_SHEET), ae);
2695
+ Ae = jn([
2696
+ pe(1, C(Be)),
2697
+ pe(2, lt),
2698
+ pe(3, C(x))
2670
2699
  ], Ae);
2671
2700
  export {
2672
- In as AddSheetTableCommand,
2701
+ vn as AddSheetTableCommand,
2673
2702
  te as AddSheetTableMutation,
2674
- yn as AddTableThemeCommand,
2675
- Mn as DeleteSheetTableCommand,
2703
+ On as AddTableThemeCommand,
2704
+ Fn as DeleteSheetTableCommand,
2676
2705
  ne as DeleteSheetTableMutation,
2677
- xn as RemoveTableThemeCommand,
2678
- Fn as SHEET_TABLE_CUSTOM_THEME_PREFIX,
2679
- On as SetSheetTableCommand,
2680
- vn as SetSheetTableFilterCommand,
2681
- fe as SetSheetTableFilterMutation,
2706
+ Un as RemoveTableThemeCommand,
2707
+ Nn as SHEET_TABLE_CUSTOM_THEME_PREFIX,
2708
+ $n as SetSheetTableCommand,
2709
+ Dn as SetSheetTableFilterCommand,
2710
+ Ce as SetSheetTableFilterMutation,
2682
2711
  p as SetSheetTableMutation,
2683
- $n as SheetTableInsertColCommand,
2684
- Un as SheetTableInsertRowCommand,
2685
- Bn as SheetTableRemoveColCommand,
2686
- An as SheetTableRemoveRowCommand,
2712
+ Bn as SheetTableInsertColCommand,
2713
+ An as SheetTableInsertRowCommand,
2714
+ En as SheetTableRemoveColCommand,
2715
+ Ln as SheetTableRemoveRowCommand,
2687
2716
  z as SheetTableService,
2688
- P as SheetsTableButtonStateEnum,
2689
- W as SheetsTableController,
2717
+ V as SheetsTableButtonStateEnum,
2718
+ E as SheetsTableController,
2690
2719
  G as SheetsTableSortStateEnum,
2691
2720
  Qe as TableColumnDataTypeEnum,
2692
2721
  ee as TableColumnFilterTypeEnum,
2693
- O as TableConditionTypeEnum,
2722
+ U as TableConditionTypeEnum,
2694
2723
  g as TableDateCompareTypeEnum,
2695
2724
  _ as TableManager,
2696
2725
  F as TableNumberCompareTypeEnum,
2697
- H as TableStringCompareTypeEnum,
2726
+ P as TableStringCompareTypeEnum,
2698
2727
  Ae as UniverSheetsTablePlugin,
2699
- er as customEmptyThemeWithBorderStyle,
2700
- Rt as isConditionFilter,
2701
- Zn as isManualFilter,
2702
- tr as processStyleWithBorderStyle
2728
+ nr as customEmptyThemeWithBorderStyle,
2729
+ pt as isConditionFilter,
2730
+ tr as isManualFilter,
2731
+ rr as processStyleWithBorderStyle
2703
2732
  };