@univerjs/sheets-filter 0.1.12 → 0.1.13-nightly.202406041140

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/es/index.js CHANGED
@@ -1,83 +1,83 @@
1
- var ce = Object.defineProperty;
2
- var ue = (s, r, e) => r in s ? ce(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
3
- var _ = (s, r, e) => (ue(s, typeof r != "symbol" ? r + "" : r, e), e);
4
- import { isNumeric as de, Disposable as B, Rectangle as Y, mergeSets as U, Tools as V, extractPureTextFromCell as he, CellValueType as W, CommandType as N, UniverInstanceType as H, fromCallback as fe, OnLifecycle as K, LifecycleStages as Z, IResourceManagerService as me, IUniverInstanceService as k, ICommandService as ee, DisposableCollection as _e, moveMatrixArray as D, Plugin as ge } from "@univerjs/core";
5
- import { Inject as $, Injector as Ce } from "@wendellhu/redi";
6
- import { BehaviorSubject as I, merge as Re, filter as pe, switchMap as Fe, of as we } from "rxjs";
7
- import { SheetInterceptorService as Se, RefRangeService as ve, SetWorksheetActivateCommand as Me, RemoveSheetCommand as Ee, INTERCEPTOR_POINT as Oe, RemoveRowMutation as ye, InsertRowMutation as Ae, MoveRangeCommand as Te, EffectRefRangId as Q, RemoveRowCommand as Ne, RemoveColCommand as xe, InsertColCommand as $e, InsertRowCommand as Pe } from "@univerjs/sheets";
8
- var E = /* @__PURE__ */ ((s) => (s.EQUAL = "equal", s.GREATER_THAN = "greaterThan", s.GREATER_THAN_OR_EQUAL = "greaterThanOrEqual", s.LESS_THAN = "lessThan", s.LESS_THAN_OR_EQUAL = "lessThanOrEqual", s.NOT_EQUALS = "notEqual", s))(E || {});
9
- const Ie = {
10
- operator: E.GREATER_THAN,
11
- fn: (s, r) => A(s) ? s > r : !1
12
- }, Le = {
13
- operator: E.GREATER_THAN_OR_EQUAL,
14
- fn: (s, r) => A(s) ? s >= r : !1
15
- }, Be = {
16
- operator: E.LESS_THAN,
17
- fn: (s, r) => A(s) ? s < r : !1
18
- }, Ue = {
19
- operator: E.LESS_THAN_OR_EQUAL,
20
- fn: (s, r) => A(s) ? s <= r : !1
1
+ var ue = Object.defineProperty;
2
+ var de = (s, t, e) => t in s ? ue(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var g = (s, t, e) => (de(s, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import { isNumeric as he, Disposable as U, Rectangle as Z, mergeSets as H, Tools as q, extractPureTextFromCell as fe, CellValueType as k, CommandType as $, UniverInstanceType as V, fromCallback as me, OnLifecycle as ee, LifecycleStages as te, IResourceManagerService as _e, IUniverInstanceService as re, ICommandService as se, DisposableCollection as ge, moveMatrixArray as D, Plugin as Ce } from "@univerjs/core";
5
+ import { Inject as L, Injector as Re } from "@wendellhu/redi";
6
+ import { BehaviorSubject as x, merge as pe, filter as Fe, switchMap as we, of as Se } from "rxjs";
7
+ import { SheetInterceptorService as ve, RefRangeService as Me, SetWorksheetActivateCommand as Ee, RemoveSheetCommand as Oe, INTERCEPTOR_POINT as ye, RemoveRowMutation as Ae, InsertRowMutation as Te, getSheetCommandTarget as Ne, MoveRowsCommand as xe, MoveRangeCommand as $e, EffectRefRangId as G, RemoveRowCommand as Ie, RemoveColCommand as Le, InsertColCommand as Be, InsertRowCommand as Pe } from "@univerjs/sheets";
8
+ var O = /* @__PURE__ */ ((s) => (s.EQUAL = "equal", s.GREATER_THAN = "greaterThan", s.GREATER_THAN_OR_EQUAL = "greaterThanOrEqual", s.LESS_THAN = "lessThan", s.LESS_THAN_OR_EQUAL = "lessThanOrEqual", s.NOT_EQUALS = "notEqual", s))(O || {});
9
+ const Ue = {
10
+ operator: O.GREATER_THAN,
11
+ fn: (s, t) => T(s) ? s > t : !1
21
12
  }, ze = {
22
- operator: E.EQUAL,
23
- fn: (s, r) => A(s) ? s === r : !1
24
- }, te = {
25
- operator: E.NOT_EQUALS,
26
- fn: (s, r) => {
27
- if (typeof r == "string") {
28
- if (r === " ")
13
+ operator: O.GREATER_THAN_OR_EQUAL,
14
+ fn: (s, t) => T(s) ? s >= t : !1
15
+ }, He = {
16
+ operator: O.LESS_THAN,
17
+ fn: (s, t) => T(s) ? s < t : !1
18
+ }, We = {
19
+ operator: O.LESS_THAN_OR_EQUAL,
20
+ fn: (s, t) => T(s) ? s <= t : !1
21
+ }, be = {
22
+ operator: O.EQUAL,
23
+ fn: (s, t) => T(s) ? s === t : !1
24
+ }, ne = {
25
+ operator: O.NOT_EQUALS,
26
+ fn: (s, t) => {
27
+ if (typeof t == "string") {
28
+ if (t === " ")
29
29
  return s != null;
30
- const e = se(s);
31
- return e && je(r) ? !ne(r).test(e) : e !== r;
30
+ const e = oe(s);
31
+ return e && Qe(t) ? !le(t).test(e) : e !== t;
32
32
  }
33
- return A(s) ? s !== r : !0;
33
+ return T(s) ? s !== t : !0;
34
34
  }
35
- }, re = /* @__PURE__ */ new Map([]), be = [Ie, Le, Be, Ue, ze, te];
36
- be.forEach((s) => {
37
- re.set(s.operator, s);
35
+ }, ie = /* @__PURE__ */ new Map([]), ke = [Ue, ze, He, We, be, ne];
36
+ ke.forEach((s) => {
37
+ ie.set(s.operator, s);
38
38
  });
39
- function We(s) {
39
+ function Ve(s) {
40
40
  return !!s;
41
41
  }
42
- const He = {
43
- fn: (s, r) => {
44
- const e = se(s);
45
- return e === null ? r === "" : ne(r).test(e);
42
+ const je = {
43
+ fn: (s, t) => {
44
+ const e = oe(s);
45
+ return e === null ? t === "" : le(t).test(e);
46
46
  }
47
47
  };
48
- function q(s) {
49
- return s ? re.get(s) : He;
48
+ function J(s) {
49
+ return s ? ie.get(s) : je;
50
50
  }
51
- function A(s) {
51
+ function T(s) {
52
52
  return typeof s == "number";
53
53
  }
54
- function G(s) {
55
- return !!(typeof s == "number" || typeof s == "string" && de(s));
54
+ function X(s) {
55
+ return !!(typeof s == "number" || typeof s == "string" && he(s));
56
56
  }
57
- function se(s) {
57
+ function oe(s) {
58
58
  return typeof s == "boolean" || s == null ? null : typeof s == "string" ? s : s.toString();
59
59
  }
60
- function je(s) {
60
+ function Qe(s) {
61
61
  return typeof s == "number" ? !1 : s.indexOf("*") !== -1 || s.indexOf("?") !== -1;
62
62
  }
63
- function ne(s) {
64
- const r = s.replace(/[.+^${}()|[\]\\]/g, "\\$&").replaceAll("?", ".").replace(/[*]/g, ".$&");
65
- return new RegExp(`^${r}$`);
63
+ function le(s) {
64
+ const t = s.replace(/[.+^${}()|[\]\\]/g, "\\$&").replaceAll("?", ".").replace(/[*]/g, ".$&");
65
+ return new RegExp(`^${t}$`);
66
66
  }
67
- const z = () => /* @__PURE__ */ new Set();
68
- class L extends B {
69
- constructor(e, t, n) {
67
+ const W = () => /* @__PURE__ */ new Set();
68
+ class P extends U {
69
+ constructor(e, r, n) {
70
70
  super();
71
- _(this, "_filteredOutRows$", new I(z()));
71
+ g(this, "_filteredOutRows$", new x(W()));
72
72
  /** An observable value. A set of filtered out rows. */
73
- _(this, "filteredOutRows$", this._filteredOutRows$.asObservable());
73
+ g(this, "filteredOutRows$", this._filteredOutRows$.asObservable());
74
74
  // TODO: we may need to update which cols have criteria rather than simple boolean
75
- _(this, "_hasCriteria$", new I(!1));
76
- _(this, "hasCriteria$", this._hasCriteria$.asObservable());
77
- _(this, "_filterColumnByIndex", /* @__PURE__ */ new Map());
78
- _(this, "_alreadyFilteredOutRows", z());
79
- _(this, "_range");
80
- this.unitId = e, this.subUnitId = t, this._worksheet = n;
75
+ g(this, "_hasCriteria$", new x(!1));
76
+ g(this, "hasCriteria$", this._hasCriteria$.asObservable());
77
+ g(this, "_filterColumnByIndex", /* @__PURE__ */ new Map());
78
+ g(this, "_alreadyFilteredOutRows", W());
79
+ g(this, "_range");
80
+ this.unitId = e, this.subUnitId = r, this._worksheet = n;
81
81
  }
82
82
  get filteredOutRows() {
83
83
  return this._filteredOutRows$.getValue();
@@ -93,8 +93,8 @@ class L extends B {
93
93
  */
94
94
  serialize() {
95
95
  const e = {
96
- ref: Y.clone(this._range),
97
- filterColumns: this._getAllFilterColumns(!0).sort(([t], [n]) => t - n).map(([t, n]) => n.serialize())
96
+ ref: Z.clone(this._range),
97
+ filterColumns: this._getAllFilterColumns(!0).sort(([r], [n]) => r - n).map(([r, n]) => n.serialize())
98
98
  };
99
99
  return this._alreadyFilteredOutRows && (e.cachedFilteredOut = Array.from(this._alreadyFilteredOutRows).sort()), e;
100
100
  }
@@ -105,13 +105,13 @@ class L extends B {
105
105
  * @param worksheet the Worksheet object
106
106
  * @param autoFilter auto filter data
107
107
  */
108
- static deserialize(e, t, n, i) {
109
- const o = new L(e, t, n);
108
+ static deserialize(e, r, n, i) {
109
+ const o = new P(e, r, n);
110
110
  return o._dump(i), o;
111
111
  }
112
112
  _dump(e) {
113
- var t;
114
- this.setRange(e.ref), (t = e.filterColumns) == null || t.forEach((n) => this._setCriteriaWithoutReCalc(n.colId, n)), e.cachedFilteredOut && (this._alreadyFilteredOutRows = new Set(e.cachedFilteredOut), this._emit()), this._emitHasCriteria();
113
+ var r;
114
+ this.setRange(e.ref), (r = e.filterColumns) == null || r.forEach((n) => this._setCriteriaWithoutReCalc(n.colId, n)), e.cachedFilteredOut && (this._alreadyFilteredOutRows = new Set(e.cachedFilteredOut), this._emit()), this._emitHasCriteria();
115
115
  }
116
116
  isRowFiltered(e) {
117
117
  return this._alreadyFilteredOutRows.has(e);
@@ -127,9 +127,9 @@ class L extends B {
127
127
  * @param col
128
128
  */
129
129
  getFilteredOutRowsExceptCol(e) {
130
- return this._getAllFilterColumns(!0).filter(([t]) => t !== e).reduce((t, [, n]) => {
131
- const i = n.calc({ getAlreadyFilteredOutRows: () => t });
132
- return i ? U(t, i) : t;
130
+ return this._getAllFilterColumns(!0).filter(([r]) => r !== e).reduce((r, [, n]) => {
131
+ const i = n.calc({ getAlreadyFilteredOutRows: () => r });
132
+ return i ? H(r, i) : r;
133
133
  }, /* @__PURE__ */ new Set());
134
134
  }
135
135
  /**
@@ -137,45 +137,45 @@ class L extends B {
137
137
  * if the new range not overlaps the old range.
138
138
  */
139
139
  setRange(e) {
140
- this._range = e, this._getAllFilterColumns(!0).forEach(([t, n]) => {
140
+ this._range = e, this._getAllFilterColumns(!0).forEach(([r, n]) => {
141
141
  n.setRangeAndColumn({
142
142
  startRow: e.startRow,
143
143
  endRow: e.endRow,
144
- startColumn: t,
145
- endColumn: t
146
- }, t);
144
+ startColumn: r,
145
+ endColumn: r
146
+ }, r);
147
147
  });
148
148
  }
149
149
  /**
150
150
  * Set or remove filter criteria on a specific row.
151
151
  */
152
- setCriteria(e, t, n = !1) {
152
+ setCriteria(e, r, n = !1) {
153
153
  if (!this._range)
154
154
  throw new Error("[FilterModel] could not set criteria before a range is set!");
155
- if (!t) {
155
+ if (!r) {
156
156
  this._removeCriteria(e), this._rebuildAlreadyFilteredOutRowsWithCache(), n && this._reCalcAllColumns(), this._emit(), this._emitHasCriteria();
157
157
  return;
158
158
  }
159
- this._setCriteriaWithoutReCalc(e, t), n && (this._rebuildAlreadyFilteredOutRowsWithCache(), this._reCalcWithNoCacheColumns(), this._emit(), this._emitHasCriteria());
159
+ this._setCriteriaWithoutReCalc(e, r), n && (this._rebuildAlreadyFilteredOutRowsWithCache(), this._reCalcWithNoCacheColumns(), this._emit(), this._emitHasCriteria());
160
160
  }
161
161
  getAllFilterColumns() {
162
162
  return this._getAllFilterColumns(!0);
163
163
  }
164
164
  getFilterColumn(e) {
165
- var t;
166
- return (t = this._filterColumnByIndex.get(e)) != null ? t : null;
165
+ var r;
166
+ return (r = this._filterColumnByIndex.get(e)) != null ? r : null;
167
167
  }
168
168
  reCalc() {
169
169
  this._reCalcAllColumns(), this._emit();
170
170
  }
171
171
  _getAllFilterColumns(e = !1) {
172
- const t = Array.from(this._filterColumnByIndex.entries());
173
- return e ? t : t.map(([n, i]) => i);
172
+ const r = Array.from(this._filterColumnByIndex.entries());
173
+ return e ? r : r.map(([n, i]) => i);
174
174
  }
175
175
  _reCalcAllColumns() {
176
- this._alreadyFilteredOutRows = z(), this._getAllFilterColumns().forEach((e) => e.__clearCache()), this._reCalcWithNoCacheColumns();
176
+ this._alreadyFilteredOutRows = W(), this._getAllFilterColumns().forEach((e) => e.__clearCache()), this._reCalcWithNoCacheColumns();
177
177
  }
178
- _setCriteriaWithoutReCalc(e, t) {
178
+ _setCriteriaWithoutReCalc(e, r) {
179
179
  const n = this._range;
180
180
  if (!n)
181
181
  throw new Error("[FilterModel] could not set criteria before a range is set!");
@@ -183,17 +183,17 @@ class L extends B {
183
183
  if (e > o || e < i)
184
184
  throw new Error(`[FilterModel] could not set criteria on column ${e} which is out of range!`);
185
185
  let l;
186
- this._filterColumnByIndex.has(e) ? l = this._filterColumnByIndex.get(e) : (l = new Ve(
186
+ this._filterColumnByIndex.has(e) ? l = this._filterColumnByIndex.get(e) : (l = new qe(
187
187
  this.unitId,
188
188
  this.subUnitId,
189
189
  this._worksheet,
190
- t,
190
+ r,
191
191
  { getAlreadyFilteredOutRows: () => this._alreadyFilteredOutRows }
192
- ), l.setRangeAndColumn(n, e), this._filterColumnByIndex.set(e, l)), l.setCriteria(t);
192
+ ), l.setRangeAndColumn(n, e), this._filterColumnByIndex.set(e, l)), l.setCriteria(r);
193
193
  }
194
194
  _removeCriteria(e) {
195
- const t = this._filterColumnByIndex.get(e);
196
- t && (t.dispose(), this._filterColumnByIndex.delete(e));
195
+ const r = this._filterColumnByIndex.get(e);
196
+ r && (r.dispose(), this._filterColumnByIndex.delete(e));
197
197
  }
198
198
  _emit() {
199
199
  this._filteredOutRows$.next(this._alreadyFilteredOutRows);
@@ -202,27 +202,27 @@ class L extends B {
202
202
  this._hasCriteria$.next(this._filterColumnByIndex.size > 0);
203
203
  }
204
204
  _rebuildAlreadyFilteredOutRowsWithCache() {
205
- const e = this._getAllFilterColumns().filter((t) => t.hasCache()).reduce((t, n) => U(t, n.filteredOutRows), /* @__PURE__ */ new Set());
205
+ const e = this._getAllFilterColumns().filter((r) => r.hasCache()).reduce((r, n) => H(r, n.filteredOutRows), /* @__PURE__ */ new Set());
206
206
  this._alreadyFilteredOutRows = e;
207
207
  }
208
208
  _reCalcWithNoCacheColumns() {
209
- const e = this._getAllFilterColumns().filter((t) => !t.hasCache());
210
- for (const t of e) {
211
- const n = t.reCalc();
212
- n && (this._alreadyFilteredOutRows = U(this._alreadyFilteredOutRows, n));
209
+ const e = this._getAllFilterColumns().filter((r) => !r.hasCache());
210
+ for (const r of e) {
211
+ const n = r.reCalc();
212
+ n && (this._alreadyFilteredOutRows = H(this._alreadyFilteredOutRows, n));
213
213
  }
214
214
  }
215
215
  }
216
- class Ve extends B {
217
- constructor(e, t, n, i, o) {
216
+ class qe extends U {
217
+ constructor(e, r, n, i, o) {
218
218
  super();
219
- _(this, "_filteredOutRows", null);
219
+ g(this, "_filteredOutRows", null);
220
220
  /** Cache the filter function. */
221
- _(this, "_filterFn", null);
222
- _(this, "_range", null);
223
- _(this, "_column", 0);
224
- _(this, "_filterByValues", !1);
225
- this.unitId = e, this.subUnitId = t, this._worksheet = n, this._criteria = i, this._filterColumnContext = o;
221
+ g(this, "_filterFn", null);
222
+ g(this, "_range", null);
223
+ g(this, "_column", 0);
224
+ g(this, "_filterByValues", !1);
225
+ this.unitId = e, this.subUnitId = r, this._worksheet = n, this._criteria = i, this._filterColumnContext = o;
226
226
  }
227
227
  get filteredOutRows() {
228
228
  return this._filteredOutRows;
@@ -239,7 +239,7 @@ class Ve extends B {
239
239
  serialize() {
240
240
  if (!this._criteria)
241
241
  throw new Error("[FilterColumn]: could not serialize without a filter column!");
242
- return V.deepClone({
242
+ return q.deepClone({
243
243
  ...this._criteria,
244
244
  colId: this._column
245
245
  });
@@ -248,14 +248,14 @@ class Ve extends B {
248
248
  return this._filteredOutRows !== null;
249
249
  }
250
250
  // The first row should be omitted!
251
- setRangeAndColumn(e, t) {
252
- this._range = e, this._column = t;
251
+ setRangeAndColumn(e, r) {
252
+ this._range = e, this._column = r;
253
253
  }
254
254
  setCriteria(e) {
255
255
  this._criteria = e, this._generateFilterFn(), this._filteredOutRows = null;
256
256
  }
257
257
  getColumnData() {
258
- return V.deepClone(this._criteria);
258
+ return q.deepClone(this._criteria);
259
259
  }
260
260
  /**
261
261
  * Trigger new calculation on this `FilterModel` instance.
@@ -273,15 +273,15 @@ class Ve extends B {
273
273
  throw new Error("[FilterColumn] cannot calculate without a range!");
274
274
  if (typeof this._column != "number")
275
275
  throw new TypeError("[FilterColumn] cannot calculate without a column offset!");
276
- const t = this._column, n = { startColumn: t, endColumn: t, startRow: this._range.startRow + 1, endRow: this._range.endRow }, i = /* @__PURE__ */ new Set(), o = e.getAlreadyFilteredOutRows();
276
+ const r = this._column, n = { startColumn: r, endColumn: r, startRow: this._range.startRow + 1, endRow: this._range.endRow }, i = /* @__PURE__ */ new Set(), o = e.getAlreadyFilteredOutRows();
277
277
  for (const l of this._worksheet.iterateByColumn(n, !1, !1)) {
278
278
  const { row: a, rowSpan: u, col: c } = l;
279
279
  if (o.has(a) && (!u || u === 1))
280
280
  continue;
281
- const h = this._filterByValues ? he(this._worksheet.getCell(a, c)) : Ke(this._worksheet, a, c);
281
+ const h = this._filterByValues ? fe(this._worksheet.getCell(a, c)) : et(this._worksheet, a, c);
282
282
  if (!this._filterFn(h) && (i.add(a), u))
283
- for (let m = 1; m < u; m++)
284
- i.add(a + m);
283
+ for (let _ = 1; _ < u; _++)
284
+ i.add(a + _);
285
285
  }
286
286
  return i;
287
287
  }
@@ -291,108 +291,110 @@ class Ve extends B {
291
291
  }
292
292
  function De(s) {
293
293
  if (s.filters)
294
- return Qe(s.filters);
294
+ return Ge(s.filters);
295
295
  if (s.customFilters)
296
- return qe(s.customFilters);
296
+ return Je(s.customFilters);
297
297
  throw new Error("[FilterModel]: other types of filters are not supported yet.");
298
298
  }
299
- function Qe(s) {
300
- const r = !!s.blank, e = new Set(s.filters);
301
- return (t) => t === void 0 || t === "" ? r : e.has(typeof t == "string" ? t : `${t}`);
302
- }
303
- function qe(s) {
304
- const r = s.customFilters.map((e) => Ye(e));
305
- return Xe(r) ? s.and ? Ge(r) : Je(r) : r[0];
306
- }
307
299
  function Ge(s) {
308
- const [r, e] = s;
309
- return (t) => r(t) && e(t);
300
+ const t = !!s.blank, e = new Set(s.filters);
301
+ return (r) => r === void 0 || r === "" ? t : e.has(typeof r == "string" ? r : `${r}`);
310
302
  }
311
303
  function Je(s) {
312
- const [r, e] = s;
313
- return (t) => r(t) || e(t);
304
+ const t = s.customFilters.map((e) => Ze(e));
305
+ return Ke(t) ? s.and ? Xe(t) : Ye(t) : t[0];
314
306
  }
315
307
  function Xe(s) {
316
- return s.length === 2;
308
+ const [t, e] = s;
309
+ return (r) => t(r) && e(r);
317
310
  }
318
311
  function Ye(s) {
319
- const r = s.val;
320
- if (s.operator === E.NOT_EQUALS && !G(r))
321
- return (n) => te.fn(n, r);
322
- if (We(s.operator)) {
323
- if (!G(r))
312
+ const [t, e] = s;
313
+ return (r) => t(r) || e(r);
314
+ }
315
+ function Ke(s) {
316
+ return s.length === 2;
317
+ }
318
+ function Ze(s) {
319
+ const t = s.val;
320
+ if (s.operator === O.NOT_EQUALS && !X(t))
321
+ return (n) => ne.fn(n, t);
322
+ if (Ve(s.operator)) {
323
+ if (!X(t))
324
324
  return () => !1;
325
- const n = q(s.operator), i = Number(r);
325
+ const n = J(s.operator), i = Number(t);
326
326
  return (o) => n.fn(o, i);
327
327
  }
328
- const e = q(s.operator);
329
- return (t) => e.fn(t, r);
328
+ const e = J(s.operator);
329
+ return (r) => e.fn(r, t);
330
330
  }
331
- function Ke(s, r, e) {
332
- const t = s.getCell(r, e);
333
- if (!t)
331
+ function et(s, t, e) {
332
+ const r = s.getCell(t, e);
333
+ if (!r)
334
334
  return null;
335
- const n = s.getCellRaw(r, e);
336
- return t && !n ? J(t) : n ? t.t === W.NUMBER && typeof t.v == "string" ? n.v : J(n) : null;
335
+ const n = s.getCellRaw(t, e);
336
+ return r && !n ? Y(r) : n ? r.t === k.NUMBER && typeof r.v == "string" ? n.v : Y(n) : null;
337
337
  }
338
- function J(s) {
339
- var t, n;
340
- const r = (n = (t = s.p) == null ? void 0 : t.body) == null ? void 0 : n.dataStream;
341
- if (r)
342
- return r.trimEnd();
338
+ function Y(s) {
339
+ var r, n;
340
+ const t = (n = (r = s.p) == null ? void 0 : r.body) == null ? void 0 : n.dataStream;
341
+ if (t)
342
+ return t.trimEnd();
343
343
  const e = s.v;
344
- return typeof e == "string" ? s.t === W.BOOLEAN ? e.toUpperCase() : e : typeof e == "number" ? s.t === W.BOOLEAN ? e ? "TRUE" : "FALSE" : e : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : "";
344
+ return typeof e == "string" ? s.t === k.BOOLEAN ? e.toUpperCase() : e : typeof e == "number" ? s.t === k.BOOLEAN ? e ? "TRUE" : "FALSE" : e : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : "";
345
345
  }
346
- const C = {
346
+ const R = {
347
347
  id: "sheet.mutation.set-filter-range",
348
- type: N.MUTATION,
349
- handler: (s, r) => {
350
- const { subUnitId: e, unitId: t, range: n } = r;
351
- return s.get(v).ensureFilterModel(t, e).setRange(n), !0;
348
+ type: $.MUTATION,
349
+ handler: (s, t) => {
350
+ const { subUnitId: e, unitId: r, range: n } = t;
351
+ return s.get(v).ensureFilterModel(r, e).setRange(n), !0;
352
352
  }
353
- }, F = {
353
+ }, w = {
354
354
  id: "sheet.mutation.set-filter-criteria",
355
- type: N.MUTATION,
356
- handler: (s, r) => {
357
- const { subUnitId: e, unitId: t, criteria: n, col: i, reCalc: o = !0 } = r, a = s.get(v).getFilterModel(t, e);
355
+ type: $.MUTATION,
356
+ handler: (s, t) => {
357
+ const { subUnitId: e, unitId: r, criteria: n, col: i, reCalc: o = !0 } = t, a = s.get(v).getFilterModel(r, e);
358
358
  return a ? (a.setCriteria(i, n, o), !0) : !1;
359
359
  }
360
- }, y = {
360
+ }, A = {
361
361
  id: "sheet.mutation.remove-filter",
362
- type: N.MUTATION,
363
- handler: (s, r) => {
364
- const { unitId: e, subUnitId: t } = r;
365
- return s.get(v).removeFilterModel(e, t);
362
+ type: $.MUTATION,
363
+ handler: (s, t) => {
364
+ const { unitId: e, subUnitId: r } = t;
365
+ return s.get(v).removeFilterModel(e, r);
366
366
  }
367
- }, ie = {
367
+ }, ae = {
368
368
  id: "sheet.mutation.re-calc-filter",
369
- type: N.MUTATION,
370
- handler: (s, r) => {
371
- const { unitId: e, subUnitId: t } = r, i = s.get(v).getFilterModel(e, t);
369
+ type: $.MUTATION,
370
+ handler: (s, t) => {
371
+ const { unitId: e, subUnitId: r } = t, i = s.get(v).getFilterModel(e, r);
372
372
  return i ? (i.reCalc(), !0) : !1;
373
373
  }
374
374
  };
375
- var Ze = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, et = (s, r, e, t) => {
376
- for (var n = t > 1 ? void 0 : t ? ke(r, e) : r, i = s.length - 1, o; i >= 0; i--)
377
- (o = s[i]) && (n = (t ? o(r, e, n) : o(n)) || n);
378
- return t && n && Ze(r, e, n), n;
379
- }, b = (s, r) => (e, t) => r(e, t, s);
380
- const tt = /* @__PURE__ */ new Set([
381
- C.id,
382
- F.id,
383
- y.id,
384
- ie.id
385
- ]), oe = "SHEET_FILTER_PLUGIN";
386
- let v = class extends B {
387
- constructor(r, e, t) {
375
+ var tt = (s, t, e, r) => {
376
+ for (var n = t, i = s.length - 1, o; i >= 0; i--)
377
+ (o = s[i]) && (n = o(n) || n);
378
+ return n;
379
+ }, b = (s, t) => (e, r) => t(e, r, s);
380
+ const rt = /* @__PURE__ */ new Set([
381
+ R.id,
382
+ w.id,
383
+ A.id,
384
+ ae.id
385
+ ]), ce = "SHEET_FILTER_PLUGIN";
386
+ let v = class extends U {
387
+ constructor(t, e, r) {
388
388
  super();
389
- _(this, "_filterModels", /* @__PURE__ */ new Map());
390
- _(this, "_loadedUnitId$", new I(null));
391
- _(this, "loadedUnitId$", this._loadedUnitId$.asObservable());
392
- _(this, "_activeFilterModel$", new I(null));
389
+ g(this, "_filterModels", /* @__PURE__ */ new Map());
390
+ g(this, "_loadedUnitId$", new x(null));
391
+ g(this, "loadedUnitId$", this._loadedUnitId$.asObservable());
392
+ g(this, "_errorMsg$", new x(null));
393
+ g(this, "errorMsg$", this._errorMsg$.asObservable());
394
+ g(this, "_activeFilterModel$", new x(null));
393
395
  /** An observable value emitting the current Workbook's active Worksheet's filter model (if there is one). */
394
- _(this, "activeFilterModel$", this._activeFilterModel$.asObservable());
395
- this._resourcesManagerService = r, this._univerInstanceService = e, this._commandService = t, this._initModel(), this._initActiveFilterModel();
396
+ g(this, "activeFilterModel$", this._activeFilterModel$.asObservable());
397
+ this._resourcesManagerService = t, this._univerInstanceService = e, this._commandService = r, this._initModel(), this._initActiveFilterModel();
396
398
  }
397
399
  /** The current Workbook's active Worksheet's filter model (if there is one). */
398
400
  get activeFilterModel() {
@@ -403,197 +405,200 @@ let v = class extends B {
403
405
  * @param unitId
404
406
  * @param subUnitId
405
407
  */
406
- ensureFilterModel(r, e) {
407
- const t = this.getFilterModel(r, e);
408
- if (t)
409
- return t;
410
- const n = this._univerInstanceService.getUniverSheetInstance(r);
408
+ ensureFilterModel(t, e) {
409
+ const r = this.getFilterModel(t, e);
410
+ if (r)
411
+ return r;
412
+ const n = this._univerInstanceService.getUniverSheetInstance(t);
411
413
  if (!n)
412
- throw new Error(`[SheetsFilterService]: could not create "FilterModel" on a non-existing workbook ${r}!`);
414
+ throw new Error(`[SheetsFilterService]: could not create "FilterModel" on a non-existing workbook ${t}!`);
413
415
  const i = n.getSheetBySheetId(e);
414
416
  if (!i)
415
417
  throw new Error(`[SheetsFilterService]: could not create "FilterModel" on a non-existing worksheet ${e}!`);
416
- const o = new L(r, e, i);
417
- return this._cacheFilterModel(r, e, o), o;
418
+ const o = new P(t, e, i);
419
+ return this._cacheFilterModel(t, e, o), o;
420
+ }
421
+ getFilterModel(t, e) {
422
+ var r, n;
423
+ return (n = (r = this._filterModels.get(t)) == null ? void 0 : r.get(e)) != null ? n : null;
418
424
  }
419
- getFilterModel(r, e) {
420
- var t, n;
421
- return (n = (t = this._filterModels.get(r)) == null ? void 0 : t.get(e)) != null ? n : null;
425
+ removeFilterModel(t, e) {
426
+ const r = this.getFilterModel(t, e);
427
+ return r ? (r.dispose(), this._filterModels.get(t).delete(e), !0) : !1;
422
428
  }
423
- removeFilterModel(r, e) {
424
- const t = this.getFilterModel(r, e);
425
- return t ? (t.dispose(), this._filterModels.get(r).delete(e), !0) : !1;
429
+ setFilterErrorMsg(t) {
430
+ this._errorMsg$.next(t);
426
431
  }
427
432
  _updateActiveFilterModel() {
428
- let r;
433
+ let t;
429
434
  try {
430
- if (r = this._univerInstanceService.getCurrentUnitForType(H.UNIVER_SHEET), !r) {
435
+ if (t = this._univerInstanceService.getCurrentUnitForType(V.UNIVER_SHEET), !t) {
431
436
  this._activeFilterModel$.next(null);
432
437
  return;
433
438
  }
434
439
  } catch {
435
440
  return;
436
441
  }
437
- const e = r.getActiveSheet();
442
+ const e = t.getRawActiveSheet();
438
443
  if (!e) {
439
444
  this._activeFilterModel$.next(null);
440
445
  return;
441
446
  }
442
- const t = e.getUnitId(), n = e.getSheetId(), i = this.getFilterModel(t, n);
447
+ const r = e.getUnitId(), n = e.getSheetId(), i = this.getFilterModel(r, n);
443
448
  this._activeFilterModel$.next(i);
444
449
  }
445
450
  _initActiveFilterModel() {
446
451
  this.disposeWithMe(
447
- Re(
452
+ pe(
448
453
  // source1: executing filter related mutations
449
- fe(this._commandService.onCommandExecuted).pipe(pe(([r]) => r.type === N.MUTATION && tt.has(r.id))),
454
+ me(this._commandService.onCommandExecuted).pipe(Fe(([t]) => t.type === $.MUTATION && rt.has(t.id))),
450
455
  // source2: activate sheet changes
451
- this._univerInstanceService.getCurrentTypeOfUnit$(H.UNIVER_SHEET).pipe(Fe((r) => {
456
+ this._univerInstanceService.getCurrentTypeOfUnit$(V.UNIVER_SHEET).pipe(we((t) => {
452
457
  var e;
453
- return (e = r == null ? void 0 : r.activeSheet$) != null ? e : we(null);
458
+ return (e = t == null ? void 0 : t.activeSheet$) != null ? e : Se(null);
454
459
  }))
455
460
  ).subscribe(() => this._updateActiveFilterModel())
456
461
  );
457
462
  }
458
- _serializeAutoFiltersForUnit(r) {
459
- const e = this._filterModels.get(r);
463
+ _serializeAutoFiltersForUnit(t) {
464
+ const e = this._filterModels.get(t);
460
465
  if (!e)
461
466
  return "{}";
462
- const t = {};
467
+ const r = {};
463
468
  return e.forEach((n, i) => {
464
- t[i] = n.serialize();
465
- }), JSON.stringify(t);
469
+ r[i] = n.serialize();
470
+ }), JSON.stringify(r);
466
471
  }
467
- _deserializeAutoFiltersForUnit(r, e) {
468
- const t = this._univerInstanceService.getUniverSheetInstance(r);
472
+ _deserializeAutoFiltersForUnit(t, e) {
473
+ const r = this._univerInstanceService.getUniverSheetInstance(t);
469
474
  Object.keys(e).forEach((n) => {
470
- const i = e[n], o = L.deserialize(r, n, t.getSheetBySheetId(n), i);
471
- this._cacheFilterModel(r, n, o);
475
+ const i = e[n], o = P.deserialize(t, n, r.getSheetBySheetId(n), i);
476
+ this._cacheFilterModel(t, n, o);
472
477
  });
473
478
  }
474
479
  _initModel() {
475
480
  this._resourcesManagerService.registerPluginResource({
476
- pluginName: oe,
481
+ pluginName: ce,
477
482
  businesses: [2],
478
- toJson: (r) => this._serializeAutoFiltersForUnit(r),
479
- parseJson: (r) => JSON.parse(r),
480
- onLoad: (r, e) => {
481
- this._deserializeAutoFiltersForUnit(r, e), this._loadedUnitId$.next(r), this._updateActiveFilterModel();
483
+ toJson: (t) => this._serializeAutoFiltersForUnit(t),
484
+ parseJson: (t) => JSON.parse(t),
485
+ onLoad: (t, e) => {
486
+ this._deserializeAutoFiltersForUnit(t, e), this._loadedUnitId$.next(t), this._updateActiveFilterModel();
482
487
  },
483
- onUnLoad: (r) => {
484
- const e = this._filterModels.get(r);
485
- e && (e.forEach((t) => t.dispose()), this._filterModels.delete(r));
488
+ onUnLoad: (t) => {
489
+ const e = this._filterModels.get(t);
490
+ e && (e.forEach((r) => r.dispose()), this._filterModels.delete(t));
486
491
  }
487
492
  });
488
493
  }
489
- _cacheFilterModel(r, e, t) {
490
- this._filterModels.has(r) || this._filterModels.set(r, /* @__PURE__ */ new Map()), this._filterModels.get(r).set(e, t);
494
+ _cacheFilterModel(t, e, r) {
495
+ this._filterModels.has(t) || this._filterModels.set(t, /* @__PURE__ */ new Map()), this._filterModels.get(t).set(e, r);
491
496
  }
492
497
  };
493
- v = et([
494
- K(Z.Ready, v),
495
- b(0, me),
496
- b(1, k),
497
- b(2, ee)
498
+ v = tt([
499
+ ee(te.Ready, v),
500
+ b(0, _e),
501
+ b(1, re),
502
+ b(2, se)
498
503
  ], v);
499
- function rt(s, r) {
504
+ function st(s, t) {
500
505
  for (let e = 0; e < s.length; e++) {
501
- let t = e;
506
+ let r = e;
502
507
  if (s[e])
503
508
  for (let n = e + 1; n < s.length; n++)
504
- s[t] && s[n] && r(s[t], s[n]) && (s[t] = null, t = n);
509
+ s[r] && s[n] && t(s[r], s[n]) && (s[r] = null, r = n);
505
510
  }
506
511
  return s.filter((e) => e !== null);
507
512
  }
508
- function M(s) {
509
- return rt(s, (r, e) => r.id === F.id && e.id === F.id && r.params.unitId === e.params.unitId && r.params.subUnitId === e.params.subUnitId && r.params.col === e.params.col);
513
+ function E(s) {
514
+ return st(s, (t, e) => t.id === w.id && e.id === w.id && t.params.unitId === e.params.unitId && t.params.subUnitId === e.params.subUnitId && t.params.col === e.params.col);
510
515
  }
511
- var st = Object.defineProperty, nt = Object.getOwnPropertyDescriptor, it = (s, r, e, t) => {
512
- for (var n = t > 1 ? void 0 : t ? nt(r, e) : r, i = s.length - 1, o; i >= 0; i--)
513
- (o = s[i]) && (n = (t ? o(r, e, n) : o(n)) || n);
514
- return t && n && st(r, e, n), n;
515
- }, T = (s, r) => (e, t) => r(e, t, s);
516
- let P = class extends B {
517
- constructor(s, r, e, t, n) {
518
- super(), this._commandService = s, this._sheetInterceptorService = r, this._sheetsFilterService = e, this._univerInstanceService = t, this._refRangeService = n, this._initCommands(), this._initRowFilteredInterceptor(), this._initInterceptors(), this._commandExecutedListener();
516
+ var nt = (s, t, e, r) => {
517
+ for (var n = t, i = s.length - 1, o; i >= 0; i--)
518
+ (o = s[i]) && (n = o(n) || n);
519
+ return n;
520
+ }, N = (s, t) => (e, r) => t(e, r, s);
521
+ let B = class extends U {
522
+ constructor(s, t, e, r, n) {
523
+ super(), this._commandService = s, this._sheetInterceptorService = t, this._sheetsFilterService = e, this._univerInstanceService = r, this._refRangeService = n, this._initCommands(), this._initRowFilteredInterceptor(), this._initInterceptors(), this._commandExecutedListener(), this._initErrorHandling();
519
524
  }
520
525
  _initCommands() {
521
526
  [
522
- F,
523
- C,
524
- ie,
525
- y
527
+ w,
528
+ R,
529
+ ae,
530
+ A
526
531
  ].forEach((s) => this.disposeWithMe(this._commandService.registerCommand(s)));
527
532
  }
528
533
  _initInterceptors() {
529
534
  this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
530
535
  getMutations: (e) => this._getUpdateFilter(e)
531
536
  }));
532
- const s = new _e(), r = (e, t) => {
537
+ const s = new ge(), t = (e, r) => {
533
538
  var a;
534
539
  const n = this._univerInstanceService.getUniverSheetInstance(e);
535
- if (!n || !(n == null ? void 0 : n.getSheetBySheetId(t)))
540
+ if (!n || !(n == null ? void 0 : n.getSheetBySheetId(r)))
536
541
  return;
537
542
  s.dispose();
538
- const o = (a = this._sheetsFilterService.getFilterModel(e, t)) == null ? void 0 : a.getRange(), l = (u) => {
543
+ const o = (a = this._sheetsFilterService.getFilterModel(e, r)) == null ? void 0 : a.getRange(), l = (u) => {
539
544
  switch (u.id) {
540
545
  case Pe.id: {
541
- const c = u.params, h = c.unitId || e, m = c.subUnitId || t;
542
- return this._handleInsertRowCommand(c, h, m);
546
+ const c = u.params, h = c.unitId || e, _ = c.subUnitId || r;
547
+ return this._handleInsertRowCommand(c, h, _);
543
548
  }
544
- case $e.id: {
545
- const c = u.params, h = c.unitId || e, m = c.subUnitId || t;
546
- return this._handleInsertColCommand(c, h, m);
549
+ case Be.id: {
550
+ const c = u.params, h = c.unitId || e, _ = c.subUnitId || r;
551
+ return this._handleInsertColCommand(c, h, _);
547
552
  }
548
- case xe.id: {
553
+ case Le.id: {
549
554
  const c = u.params;
550
- return this._handleRemoveColCommand(c, e, t);
555
+ return this._handleRemoveColCommand(c, e, r);
551
556
  }
552
- case Ne.id: {
557
+ case Ie.id: {
553
558
  const c = u.params;
554
- return this._handleRemoveRowCommand(c, e, t);
559
+ return this._handleRemoveRowCommand(c, e, r);
555
560
  }
556
- case Q.MoveColsCommandId: {
561
+ case G.MoveColsCommandId: {
557
562
  const c = u.params;
558
- return this._handleMoveColsCommand(c, e, t);
563
+ return this._handleMoveColsCommand(c, e, r);
559
564
  }
560
- case Q.MoveRowsCommandId: {
565
+ case G.MoveRowsCommandId: {
561
566
  const c = u.params;
562
- return this._handleMoveRowsCommand(c, e, t);
567
+ return this._handleMoveRowsCommand(c, e, r);
563
568
  }
564
- case Te.id: {
569
+ case $e.id: {
565
570
  const c = u.params;
566
- return this._handleMoveRangeCommand(c, e, t);
571
+ return this._handleMoveRangeCommand(c, e, r);
567
572
  }
568
573
  }
569
574
  return { redos: [], undos: [] };
570
575
  };
571
- o && s.add(this._refRangeService.registerRefRange(o, l, e, t));
576
+ o && s.add(this._refRangeService.registerRefRange(o, l, e, r));
572
577
  };
573
578
  this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
574
- if (e.id === Me.id) {
575
- const t = e.params, n = t.subUnitId, i = t.unitId;
579
+ if (e.id === Ee.id) {
580
+ const r = e.params, n = r.subUnitId, i = r.unitId;
576
581
  if (!n || !i)
577
582
  return;
578
- r(i, n);
583
+ t(i, n);
579
584
  }
580
- if (e.id === C.id) {
581
- const t = e.params, n = t.subUnitId, i = t.unitId;
585
+ if (e.id === R.id) {
586
+ const r = e.params, n = r.subUnitId, i = r.unitId;
582
587
  if (!n || !i)
583
588
  return;
584
- r(t.unitId, t.subUnitId);
589
+ t(r.unitId, r.subUnitId);
585
590
  }
586
591
  })), this.disposeWithMe(this._sheetsFilterService.loadedUnitId$.subscribe((e) => {
587
592
  if (e) {
588
- const t = this._univerInstanceService.getUniverSheetInstance(e), n = t == null ? void 0 : t.getActiveSheet();
589
- n && r(e, n.getSheetId());
593
+ const r = this._univerInstanceService.getUniverSheetInstance(e), n = r == null ? void 0 : r.getActiveSheet();
594
+ n && t(e, n.getSheetId());
590
595
  }
591
596
  }));
592
597
  }
593
598
  _getUpdateFilter(s) {
594
- const { id: r } = s;
595
- switch (r) {
596
- case Ee.id: {
599
+ const { id: t } = s;
600
+ switch (t) {
601
+ case Oe.id: {
597
602
  const e = s.params;
598
603
  return this._handleRemoveSheetCommand(e, e.unitId, e.subUnitId);
599
604
  }
@@ -603,45 +608,45 @@ let P = class extends B {
603
608
  undos: []
604
609
  };
605
610
  }
606
- _handleInsertColCommand(s, r, e) {
607
- var f;
608
- const t = this._sheetsFilterService.getFilterModel(r, e), n = (f = t == null ? void 0 : t.getRange()) != null ? f : null;
609
- if (!t || !n)
611
+ _handleInsertColCommand(s, t, e) {
612
+ var m;
613
+ const r = this._sheetsFilterService.getFilterModel(t, e), n = (m = r == null ? void 0 : r.getRange()) != null ? m : null;
614
+ if (!r || !n)
610
615
  return this._handleNull();
611
616
  const { startColumn: i, endColumn: o } = n, { startColumn: l, endColumn: a } = s.range, u = a - l + 1;
612
617
  if (a > o)
613
618
  return this._handleNull();
614
- const c = [], h = [], m = l, p = {
615
- unitId: r,
619
+ const c = [], h = [], _ = l, p = {
620
+ unitId: t,
616
621
  subUnitId: e,
617
622
  range: {
618
623
  ...n,
619
624
  startColumn: l <= i ? i + u : i,
620
625
  endColumn: o + u
621
626
  }
622
- }, R = {
623
- unitId: r,
627
+ }, C = {
628
+ unitId: t,
624
629
  subUnitId: e,
625
630
  range: n
626
631
  };
627
- c.push({ id: C.id, params: p }), h.push({ id: C.id, params: R });
628
- const d = t.getAllFilterColumns().filter((g) => g[0] >= m);
629
- if (d.length !== 0) {
630
- const { undos: g, redos: S } = this.moveCriteria(r, e, d, u);
631
- c.push(...S), h.push(...g);
632
+ c.push({ id: R.id, params: p }), h.push({ id: R.id, params: C });
633
+ const f = r.getAllFilterColumns().filter((d) => d[0] >= _);
634
+ if (f.length !== 0) {
635
+ const { undos: d, redos: S } = this.moveCriteria(t, e, f, u);
636
+ c.push(...S), h.push(...d);
632
637
  }
633
- return { redos: M(c), undos: M(h) };
638
+ return { redos: E(c), undos: E(h) };
634
639
  }
635
- _handleInsertRowCommand(s, r, e) {
636
- var R;
637
- const t = this._sheetsFilterService.getFilterModel(r, e), n = (R = t == null ? void 0 : t.getRange()) != null ? R : null;
638
- if (!t || !n)
640
+ _handleInsertRowCommand(s, t, e) {
641
+ var C;
642
+ const r = this._sheetsFilterService.getFilterModel(t, e), n = (C = r == null ? void 0 : r.getRange()) != null ? C : null;
643
+ if (!r || !n)
639
644
  return this._handleNull();
640
645
  const { startRow: i, endRow: o } = n, { startRow: l, endRow: a } = s.range, u = a - l + 1;
641
646
  if (a > o)
642
647
  return this._handleNull();
643
- const c = [], h = [], m = {
644
- unitId: r,
648
+ const c = [], h = [], _ = {
649
+ unitId: t,
645
650
  subUnitId: e,
646
651
  range: {
647
652
  ...n,
@@ -649,55 +654,55 @@ let P = class extends B {
649
654
  endRow: o + u
650
655
  }
651
656
  }, p = {
652
- unitId: r,
657
+ unitId: t,
653
658
  subUnitId: e,
654
659
  range: n
655
660
  };
656
- return c.push({ id: C.id, params: m }), h.push({ id: C.id, params: p }), {
657
- redos: M(c),
658
- undos: M(h)
661
+ return c.push({ id: R.id, params: _ }), h.push({ id: R.id, params: p }), {
662
+ redos: E(c),
663
+ undos: E(h)
659
664
  };
660
665
  }
661
- _handleRemoveColCommand(s, r, e) {
662
- var w;
663
- const t = this._sheetsFilterService.getFilterModel(r, e), n = (w = t == null ? void 0 : t.getRange()) != null ? w : null;
664
- if (!t || !n)
666
+ _handleRemoveColCommand(s, t, e) {
667
+ var F;
668
+ const r = this._sheetsFilterService.getFilterModel(t, e), n = (F = r == null ? void 0 : r.getRange()) != null ? F : null;
669
+ if (!r || !n)
665
670
  return this._handleNull();
666
671
  const { startColumn: i, endColumn: o } = n, { startColumn: l, endColumn: a } = s.range;
667
672
  if (l > o)
668
673
  return this._handleNull();
669
- const u = [], c = [], h = a < i ? 0 : Math.min(a, o) - Math.max(l, i) + 1, m = a - l + 1, p = t.getAllFilterColumns();
670
- p.forEach((d) => {
671
- const [f, g] = d;
672
- f <= a && f >= l && (u.push({ id: F.id, params: { unitId: r, subUnitId: e, col: f, criteria: null } }), c.push({ id: F.id, params: { unitId: r, subUnitId: e, col: f, criteria: { ...g.serialize(), colId: f } } }));
674
+ const u = [], c = [], h = a < i ? 0 : Math.min(a, o) - Math.max(l, i) + 1, _ = a - l + 1, p = r.getAllFilterColumns();
675
+ p.forEach((f) => {
676
+ const [m, d] = f;
677
+ m <= a && m >= l && (u.push({ id: w.id, params: { unitId: t, subUnitId: e, col: m, criteria: null } }), c.push({ id: w.id, params: { unitId: t, subUnitId: e, col: m, criteria: { ...d.serialize(), colId: m } } }));
673
678
  });
674
- const R = p.filter((d) => {
675
- const [f, g] = d;
676
- return f > a;
679
+ const C = p.filter((f) => {
680
+ const [m, d] = f;
681
+ return m > a;
677
682
  });
678
- if (R.length > 0) {
679
- const { undos: d, redos: f } = this.moveCriteria(r, e, R, -m);
680
- u.push(...f), c.push(...d);
683
+ if (C.length > 0) {
684
+ const { undos: f, redos: m } = this.moveCriteria(t, e, C, -_);
685
+ u.push(...m), c.push(...f);
681
686
  }
682
687
  if (h === o - i + 1) {
683
- const d = {
684
- unitId: r,
688
+ const f = {
689
+ unitId: t,
685
690
  subUnitId: e
686
691
  };
687
- u.push({ id: y.id, params: d });
692
+ u.push({ id: A.id, params: f });
688
693
  } else if (i <= l) {
689
- const d = o - h, f = {
690
- unitId: r,
694
+ const f = o - h, m = {
695
+ unitId: t,
691
696
  subUnitId: e,
692
697
  range: {
693
698
  ...n,
694
- endColumn: d
699
+ endColumn: f
695
700
  }
696
701
  };
697
- u.push({ id: C.id, params: f });
702
+ u.push({ id: R.id, params: m });
698
703
  } else {
699
- const d = {
700
- unitId: r,
704
+ const f = {
705
+ unitId: t,
701
706
  subUnitId: e,
702
707
  range: {
703
708
  ...n,
@@ -705,65 +710,66 @@ let P = class extends B {
705
710
  endColumn: o - (a - l + 1)
706
711
  }
707
712
  };
708
- u.push({ id: C.id, params: d });
713
+ u.push({ id: R.id, params: f });
709
714
  }
710
- return c.push({ id: C.id, params: { range: n, unitId: r, subUnitId: e } }), {
711
- undos: M(c),
712
- redos: M(u)
715
+ return c.push({ id: R.id, params: { range: n, unitId: t, subUnitId: e } }), {
716
+ undos: E(c),
717
+ redos: E(u)
713
718
  };
714
719
  }
715
- _handleRemoveRowCommand(s, r, e) {
716
- var R;
717
- const t = this._sheetsFilterService.getFilterModel(r, e);
718
- if (!t)
720
+ _handleRemoveRowCommand(s, t, e) {
721
+ var C;
722
+ const r = this._sheetsFilterService.getFilterModel(t, e);
723
+ if (!r)
719
724
  return this._handleNull();
720
- const n = t.getRange(), { startRow: i, endRow: o } = n, { startRow: l, endRow: a } = s.range;
725
+ const n = r.getRange(), { startRow: i, endRow: o } = n, { startRow: l, endRow: a } = s.range;
721
726
  if (l > o)
722
727
  return this._handleNull();
723
- const u = [], c = [], h = t.getAllFilterColumns(), m = i <= a && i >= l;
724
- c.push({ id: C.id, params: { range: n, unitId: r, subUnitId: e } });
728
+ const u = [], c = [], h = r.getAllFilterColumns(), _ = i <= a && i >= l;
729
+ c.push({ id: R.id, params: { range: n, unitId: t, subUnitId: e } });
725
730
  const p = Math.min(a, o) - Math.max(l, i) + 1;
726
- if (p === o - i + 1 || m) {
727
- const w = {
728
- unitId: r,
731
+ if (p === o - i + 1 || _) {
732
+ const F = {
733
+ unitId: t,
729
734
  subUnitId: e
730
735
  };
731
- u.push({ id: y.id, params: w }), h.forEach((d) => {
732
- const [f, g] = d, S = {
733
- unitId: r,
736
+ u.push({ id: A.id, params: F }), h.forEach((f) => {
737
+ const [m, d] = f, S = {
738
+ unitId: t,
734
739
  subUnitId: e,
735
- col: f,
736
- criteria: { ...g.serialize(), colId: f }
740
+ col: m,
741
+ criteria: { ...d.serialize(), colId: m }
737
742
  };
738
- c.push({ id: F.id, params: S });
743
+ c.push({ id: w.id, params: S });
739
744
  });
740
745
  } else {
741
- const w = (R = this._univerInstanceService.getUniverSheetInstance(r)) == null ? void 0 : R.getSheetBySheetId(e);
742
- if (!w)
746
+ const F = (C = this._univerInstanceService.getUniverSheetInstance(t)) == null ? void 0 : C.getSheetBySheetId(e);
747
+ if (!F)
743
748
  return this._handleNull();
744
- const d = [];
745
- for (let O = l; O <= a; O++)
746
- w.getRowFiltered(O) && d.push(O);
747
- const f = Math.min(i, l), g = f + (o - i) - p + d.length, S = {
748
- unitId: r,
749
+ const f = [];
750
+ for (let M = l; M <= a; M++)
751
+ F.getRowFiltered(M) && f.push(M);
752
+ const m = Math.min(i, l), d = m + (o - i) - p + f.length, S = {
753
+ unitId: t,
749
754
  subUnitId: e,
750
755
  range: {
751
756
  ...n,
752
- startRow: f,
753
- endRow: g
757
+ startRow: m,
758
+ endRow: d
754
759
  }
755
760
  };
756
- u.push({ id: C.id, params: S });
761
+ u.push({ id: R.id, params: S });
757
762
  }
758
763
  return {
759
- undos: M(c),
760
- redos: M(u)
764
+ undos: E(c),
765
+ redos: E(u)
761
766
  };
762
767
  }
763
- _handleMoveColsCommand(s, r, e) {
764
- var w;
765
- const t = this._sheetsFilterService.getFilterModel(r, e), n = (w = t == null ? void 0 : t.getRange()) != null ? w : null;
766
- if (!t || !n)
768
+ // eslint-disable-next-line max-lines-per-function
769
+ _handleMoveColsCommand(s, t, e) {
770
+ var m;
771
+ const r = this._sheetsFilterService.getFilterModel(t, e), n = (m = r == null ? void 0 : r.getRange()) != null ? m : null;
772
+ if (!r || !n)
767
773
  return this._handleNull();
768
774
  const { startColumn: i, endColumn: o } = n, { fromRange: l, toRange: a } = s;
769
775
  if (l.endColumn < i && a.startColumn <= i || l.startColumn > o && a.endColumn > o)
@@ -772,51 +778,56 @@ let P = class extends B {
772
778
  for (let d = i; d <= o; d++)
773
779
  h[d] = {
774
780
  colIndex: d,
775
- filter: t.getFilterColumn(d)
781
+ filter: r.getFilterColumn(d)
776
782
  };
777
783
  D(l.startColumn, l.endColumn - l.startColumn + 1, a.startColumn, h);
778
- const m = Object.keys(h).map((d) => Number(d)), p = Math.max(...m), R = Math.min(...m);
779
- if (m.forEach((d) => {
780
- var O, j;
781
- const { colIndex: f, filter: g } = h[d], S = d;
782
- if (g) {
783
- const le = {
784
- unitId: r,
785
- subUnitId: e,
786
- col: S,
787
- criteria: { ...g.serialize(), colId: S }
788
- };
789
- if (u.push({ id: F.id, params: le }), c.push({ id: y.id, params: { unitId: r, subUnitId: e, col: S, criteria: { ...(O = t.getFilterColumn(S)) == null ? void 0 : O.serialize(), colId: S } } }), !((j = h[f]) != null && j.filter)) {
790
- const ae = {
791
- unitId: r,
784
+ let _ = n.startColumn, p = n.endColumn;
785
+ i >= l.startColumn && i <= l.endColumn && a.startColumn > l.startColumn && l.endColumn < o && (_ = l.endColumn + 1), o >= l.startColumn && o <= l.endColumn && a.startColumn < l.startColumn && l.startColumn > i && (p = l.startColumn - 1);
786
+ const C = Object.keys(h).map((d) => Number(d)), F = C.find((d) => h[d].colIndex === p), f = C.find((d) => h[d].colIndex === _);
787
+ if (C.forEach((d) => {
788
+ var j, Q;
789
+ const { colIndex: S, filter: M } = h[d], y = d;
790
+ if (M) {
791
+ if (y >= f && y <= F) {
792
+ const z = {
793
+ unitId: t,
794
+ subUnitId: e,
795
+ col: y,
796
+ criteria: { ...M.serialize(), colId: y }
797
+ };
798
+ u.push({ id: w.id, params: z }), c.push({ id: A.id, params: { unitId: t, subUnitId: e, col: y, criteria: { ...(j = r.getFilterColumn(y)) == null ? void 0 : j.serialize(), colId: y } } });
799
+ }
800
+ if (!((Q = h[S]) != null && Q.filter)) {
801
+ const z = {
802
+ unitId: t,
792
803
  subUnitId: e,
793
- col: f,
804
+ col: S,
794
805
  criteria: null
795
806
  };
796
- u.push({ id: F.id, params: ae }), c.push({ id: F.id, params: { unitId: r, subUnitId: e, col: f, criteria: { ...g.serialize(), colId: f } } });
807
+ u.push({ id: w.id, params: z }), c.push({ id: w.id, params: { unitId: t, subUnitId: e, col: S, criteria: { ...M.serialize(), colId: S } } });
797
808
  }
798
809
  }
799
- }), i !== R || o !== p) {
810
+ }), i !== f || o !== F) {
800
811
  const d = {
801
- unitId: r,
812
+ unitId: t,
802
813
  subUnitId: e,
803
814
  range: {
804
815
  ...n,
805
- startColumn: R,
806
- endColumn: p
816
+ startColumn: f,
817
+ endColumn: F
807
818
  }
808
819
  };
809
- u.unshift({ id: C.id, params: d }), c.push({ id: C.id, params: { range: n, unitId: r, subUnitId: e } });
820
+ u.unshift({ id: R.id, params: d }), c.push({ id: R.id, params: { range: n, unitId: t, subUnitId: e } });
810
821
  }
811
822
  return {
812
823
  undos: c,
813
824
  redos: u
814
825
  };
815
826
  }
816
- _handleMoveRowsCommand(s, r, e) {
817
- var w;
818
- const t = this._sheetsFilterService.getFilterModel(r, e), n = (w = t == null ? void 0 : t.getRange()) != null ? w : null;
819
- if (!t || !n)
827
+ _handleMoveRowsCommand(s, t, e) {
828
+ var m;
829
+ const r = this._sheetsFilterService.getFilterModel(t, e), n = (m = r == null ? void 0 : r.getRange()) != null ? m : null;
830
+ if (!r || !n)
820
831
  return this._handleNull();
821
832
  const { startRow: i, endRow: o } = n, { fromRange: l, toRange: a } = s;
822
833
  if (l.endRow < i && a.startRow <= i || l.startRow > o && a.endRow > o)
@@ -824,53 +835,55 @@ let P = class extends B {
824
835
  const u = [], c = [], h = {};
825
836
  for (let d = i; d <= o; d++)
826
837
  h[d] = {
827
- offset: d - i
838
+ oldIndex: d
828
839
  };
829
- D(l.startRow, l.endRow - l.startRow + 1, a.startRow, h);
830
- const m = Object.keys(h).map((d) => Number(d)), p = Math.max(...m), R = Math.min(...m);
831
- if (i !== R || o !== p) {
840
+ const _ = i;
841
+ let p = o;
842
+ o >= l.startRow && o <= l.endRow && a.startRow < l.startRow && l.startRow > i && (p = l.startRow - 1), D(l.startRow, l.endRow - l.startRow + 1, a.startRow, h);
843
+ const C = Object.keys(h).map((d) => Number(d)), F = C.find((d) => h[d].oldIndex === p), f = C.find((d) => h[d].oldIndex === _);
844
+ if (i !== f || o !== F) {
832
845
  const d = {
833
- unitId: r,
846
+ unitId: t,
834
847
  subUnitId: e,
835
848
  range: {
836
849
  ...n,
837
- startRow: R,
838
- endRow: p
850
+ startRow: f,
851
+ endRow: F
839
852
  }
840
853
  };
841
- u.unshift({ id: C.id, params: d }), c.push({ id: C.id, params: { range: n, unitId: r, subUnitId: e } });
854
+ u.unshift({ id: R.id, params: d }), c.push({ id: R.id, params: { range: n, unitId: t, subUnitId: e } });
842
855
  }
843
856
  return {
844
857
  redos: u,
845
858
  undos: c
846
859
  };
847
860
  }
848
- _handleMoveRangeCommand(s, r, e) {
849
- const { fromRange: t, toRange: n } = s, i = this._sheetsFilterService.getFilterModel(r, e);
861
+ _handleMoveRangeCommand(s, t, e) {
862
+ const { fromRange: r, toRange: n } = s, i = this._sheetsFilterService.getFilterModel(t, e);
850
863
  if (!i)
851
864
  return this._handleNull();
852
865
  const o = i.getRange();
853
866
  if (!o)
854
867
  return this._handleNull();
855
868
  const l = [], a = [];
856
- if (Y.contains(t, o)) {
857
- const u = o.startRow - t.startRow, c = o.startColumn - t.startColumn, h = {
869
+ if (Z.contains(r, o)) {
870
+ const u = o.startRow - r.startRow, c = o.startColumn - r.startColumn, h = {
858
871
  startRow: n.startRow + u,
859
872
  startColumn: n.startColumn + c,
860
873
  endRow: n.startRow + u + (o.endRow - o.startRow),
861
874
  endColumn: n.startColumn + c + (o.endColumn - o.startColumn)
862
- }, m = {
863
- id: y.id,
875
+ }, _ = {
876
+ id: A.id,
864
877
  params: {
865
- unitId: r,
878
+ unitId: t,
866
879
  subUnitId: e
867
880
  }
868
- }, p = { id: C.id, params: { unitId: r, subUnitId: e, range: h } }, R = { id: C.id, params: { unitId: r, subUnitId: e, range: o } };
869
- l.push(m, p), a.push(m, R);
870
- const w = i.getAllFilterColumns(), d = n.startColumn - t.startColumn;
871
- w.forEach((f) => {
872
- const [g, S] = f;
873
- S && (l.push({ id: F.id, params: { unitId: r, subUnitId: e, col: g + d, criteria: { ...S.serialize(), colId: g + d } } }), a.push({ id: F.id, params: { unitId: r, subUnitId: e, col: g, criteria: { ...S.serialize(), colId: g } } }));
881
+ }, p = { id: R.id, params: { unitId: t, subUnitId: e, range: h } }, C = { id: R.id, params: { unitId: t, subUnitId: e, range: o } };
882
+ l.push(_, p), a.push(_, C);
883
+ const F = i.getAllFilterColumns(), f = n.startColumn - r.startColumn;
884
+ F.forEach((m) => {
885
+ const [d, S] = m;
886
+ S && (l.push({ id: w.id, params: { unitId: t, subUnitId: e, col: d + f, criteria: { ...S.serialize(), colId: d + f } } }), a.push({ id: w.id, params: { unitId: t, subUnitId: e, col: d, criteria: { ...S.serialize(), colId: d } } }));
874
887
  });
875
888
  }
876
889
  return {
@@ -878,18 +891,18 @@ let P = class extends B {
878
891
  undos: a
879
892
  };
880
893
  }
881
- _handleRemoveSheetCommand(s, r, e) {
882
- const t = this._sheetsFilterService.getFilterModel(r, e);
883
- if (!t)
894
+ _handleRemoveSheetCommand(s, t, e) {
895
+ const r = this._sheetsFilterService.getFilterModel(t, e);
896
+ if (!r)
884
897
  return this._handleNull();
885
- const n = t.getRange();
898
+ const n = r.getRange();
886
899
  if (!n)
887
900
  return this._handleNull();
888
901
  const i = [], o = [];
889
- return t.getAllFilterColumns().forEach((a) => {
902
+ return r.getAllFilterColumns().forEach((a) => {
890
903
  const [u, c] = a;
891
- o.push({ id: F.id, params: { unitId: r, subUnitId: e, col: a, criteria: { ...c.serialize(), colId: a } } });
892
- }), i.push({ id: y.id, params: { unitId: r, subUnitId: e, range: n } }), o.unshift({ id: C.id, params: { range: n, unitId: r, subUnitId: e } }), {
904
+ o.push({ id: w.id, params: { unitId: t, subUnitId: e, col: a, criteria: { ...c.serialize(), colId: a } } });
905
+ }), i.push({ id: A.id, params: { unitId: t, subUnitId: e, range: n } }), o.unshift({ id: R.id, params: { range: n, unitId: t, subUnitId: e } }), {
893
906
  undos: o,
894
907
  redos: i
895
908
  };
@@ -898,33 +911,33 @@ let P = class extends B {
898
911
  return { redos: [], undos: [] };
899
912
  }
900
913
  _initRowFilteredInterceptor() {
901
- this.disposeWithMe(this._sheetInterceptorService.intercept(Oe.ROW_FILTERED, {
902
- handler: (s, r) => {
903
- var e, t;
904
- return s ? !0 : (t = (e = this._sheetsFilterService.getFilterModel(
905
- r.unitId,
906
- r.subUnitId
907
- )) == null ? void 0 : e.isRowFiltered(r.row)) != null ? t : !1;
914
+ this.disposeWithMe(this._sheetInterceptorService.intercept(ye.ROW_FILTERED, {
915
+ handler: (s, t) => {
916
+ var e, r;
917
+ return s ? !0 : (r = (e = this._sheetsFilterService.getFilterModel(
918
+ t.unitId,
919
+ t.subUnitId
920
+ )) == null ? void 0 : e.isRowFiltered(t.row)) != null ? r : !1;
908
921
  }
909
922
  }));
910
923
  }
911
- moveCriteria(s, r, e, t) {
924
+ moveCriteria(s, t, e, r) {
912
925
  const n = {
913
926
  unitId: s,
914
- subUnitId: r,
927
+ subUnitId: t,
915
928
  criteria: null,
916
929
  col: -1
917
930
  }, i = [], o = [];
918
931
  return e.forEach((l) => {
919
932
  const [a, u] = l;
920
933
  o.push({
921
- id: F.id,
934
+ id: w.id,
922
935
  params: {
923
936
  ...n,
924
937
  col: a
925
938
  }
926
939
  }), i.push({
927
- id: F.id,
940
+ id: w.id,
928
941
  params: {
929
942
  ...n,
930
943
  col: a,
@@ -934,17 +947,17 @@ let P = class extends B {
934
947
  }), e.forEach((l) => {
935
948
  const [a, u] = l;
936
949
  o.push({
937
- id: F.id,
950
+ id: w.id,
938
951
  params: {
939
952
  ...n,
940
- col: a + t,
941
- criteria: { ...u.serialize(), colId: a + t }
953
+ col: a + r,
954
+ criteria: { ...u.serialize(), colId: a + r }
942
955
  }
943
956
  }), i.push({
944
- id: F.id,
957
+ id: w.id,
945
958
  params: {
946
959
  ...n,
947
- col: a + t,
960
+ col: a + r,
948
961
  criteria: null
949
962
  }
950
963
  });
@@ -955,12 +968,12 @@ let P = class extends B {
955
968
  }
956
969
  _commandExecutedListener() {
957
970
  this.disposeWithMe(this._commandService.onCommandExecuted((s) => {
958
- const { unitId: r, subUnitId: e } = s.params || {}, t = this._sheetsFilterService.getFilterModel(r, e);
959
- if (!t)
971
+ const { unitId: t, subUnitId: e } = s.params || {}, r = this._sheetsFilterService.getFilterModel(t, e);
972
+ if (!r)
960
973
  return;
961
- const n = Array.from(t.filteredOutRows).sort((l, a) => l - a), i = [];
974
+ const n = Array.from(r.filteredOutRows).sort((l, a) => l - a), i = [];
962
975
  let o = !1;
963
- if (s.id === ye.id) {
976
+ if (s.id === Ae.id) {
964
977
  const { startRow: l, endRow: a } = s.params.range, u = n.filter((c) => c >= l && c <= a);
965
978
  n.forEach((c) => {
966
979
  if (c < l)
@@ -972,60 +985,73 @@ let P = class extends B {
972
985
  i.push(c - (a - l + 1 - u.length));
973
986
  });
974
987
  }
975
- if (s.id === Ae.id) {
988
+ if (s.id === Te.id) {
976
989
  const { startRow: l, endRow: a } = s.params.range;
977
990
  n.forEach((u) => {
978
991
  u >= l ? (o = !0, i.push(u + (a - l + 1))) : i.push(u);
979
992
  });
980
993
  }
981
- o && (t.filteredOutRows = new Set(i));
994
+ o && (r.filteredOutRows = new Set(i));
995
+ }));
996
+ }
997
+ _initErrorHandling() {
998
+ this.disposeWithMe(this._commandService.beforeCommandExecuted((s) => {
999
+ const t = s.params, e = Ne(this._univerInstanceService);
1000
+ if (!e)
1001
+ return;
1002
+ const { subUnitId: r, unitId: n } = e, i = this._sheetsFilterService.getFilterModel(n, r);
1003
+ if (!i)
1004
+ return;
1005
+ const o = i.getRange();
1006
+ if (s.id === xe.id && t.fromRange.startRow <= o.startRow && t.fromRange.endRow >= o.startRow)
1007
+ throw this._sheetsFilterService.setFilterErrorMsg("sheets-filter.msg.filter-header-forbidden"), new Error("[SheetsFilterController]: Cannot move header row of filter");
982
1008
  }));
983
1009
  }
984
1010
  };
985
- P = it([
986
- K(Z.Ready, P),
987
- T(0, ee),
988
- T(1, $(Se)),
989
- T(2, $(v)),
990
- T(3, k),
991
- T(4, $(ve))
992
- ], P);
993
- var ot = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, at = (s, r, e, t) => {
994
- for (var n = t > 1 ? void 0 : t ? lt(r, e) : r, i = s.length - 1, o; i >= 0; i--)
995
- (o = s[i]) && (n = (t ? o(r, e, n) : o(n)) || n);
996
- return t && n && ot(r, e, n), n;
997
- }, ct = (s, r) => (e, t) => r(e, t, s), x;
998
- let X = (x = class extends ge {
999
- constructor(s, r) {
1000
- super(), this._injector = r;
1011
+ B = nt([
1012
+ ee(te.Ready, B),
1013
+ N(0, se),
1014
+ N(1, L(ve)),
1015
+ N(2, L(v)),
1016
+ N(3, re),
1017
+ N(4, L(Me))
1018
+ ], B);
1019
+ var it = (s, t, e, r) => {
1020
+ for (var n = t, i = s.length - 1, o; i >= 0; i--)
1021
+ (o = s[i]) && (n = o(n) || n);
1022
+ return n;
1023
+ }, ot = (s, t) => (e, r) => t(e, r, s), I;
1024
+ let K = (I = class extends Ce {
1025
+ constructor(s, t) {
1026
+ super(), this._injector = t;
1001
1027
  }
1002
1028
  onStarting(s) {
1003
1029
  [
1004
1030
  [v],
1005
- [P]
1006
- ].forEach((r) => s.add(r));
1031
+ [B]
1032
+ ].forEach((t) => s.add(t));
1007
1033
  }
1008
- }, _(x, "type", H.UNIVER_SHEET), _(x, "pluginName", oe), x);
1009
- X = at([
1010
- ct(1, $(Ce))
1011
- ], X);
1034
+ }, g(I, "type", V.UNIVER_SHEET), g(I, "pluginName", ce), I);
1035
+ K = it([
1036
+ ot(1, L(Re))
1037
+ ], K);
1012
1038
  export {
1013
- E as CustomFilterOperator,
1014
- tt as FILTER_MUTATIONS,
1015
- Ve as FilterColumn,
1016
- L as FilterModel,
1017
- ie as ReCalcSheetsFilterMutation,
1018
- y as RemoveSheetsFilterMutation,
1019
- oe as SHEET_FILTER_SNAPSHOT_ID,
1020
- F as SetSheetsFilterCriteriaMutation,
1021
- C as SetSheetsFilterRangeMutation,
1039
+ O as CustomFilterOperator,
1040
+ rt as FILTER_MUTATIONS,
1041
+ qe as FilterColumn,
1042
+ P as FilterModel,
1043
+ ae as ReCalcSheetsFilterMutation,
1044
+ A as RemoveSheetsFilterMutation,
1045
+ ce as SHEET_FILTER_SNAPSHOT_ID,
1046
+ w as SetSheetsFilterCriteriaMutation,
1047
+ R as SetSheetsFilterRangeMutation,
1022
1048
  v as SheetsFilterService,
1023
- X as UniverSheetsFilterPlugin,
1024
- ze as equals,
1025
- q as getCustomFilterFn,
1026
- Ie as greaterThan,
1027
- Le as greaterThanOrEqualTo,
1028
- Be as lessThan,
1029
- Ue as lessThanOrEqualTo,
1030
- te as notEquals
1049
+ K as UniverSheetsFilterPlugin,
1050
+ be as equals,
1051
+ J as getCustomFilterFn,
1052
+ Ue as greaterThan,
1053
+ ze as greaterThanOrEqualTo,
1054
+ He as lessThan,
1055
+ We as lessThanOrEqualTo,
1056
+ ne as notEquals
1031
1057
  };