@univerjs/sheets-filter-ui 0.21.1 → 0.22.0

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
@@ -11,113 +11,19 @@ import { AIcon, BanIcon, FilterIcon, InfoIcon, SuccessIcon } from "@univerjs/ico
11
11
  import { useCallback, useMemo } from "react";
12
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
13
 
14
- //#region src/models/extended-operators.ts
15
- /**
16
- * Copyright 2023-present DreamNum Co., Ltd.
17
- *
18
- * Licensed under the Apache License, Version 2.0 (the "License");
19
- * you may not use this file except in compliance with the License.
20
- * You may obtain a copy of the License at
21
- *
22
- * http://www.apache.org/licenses/LICENSE-2.0
23
- *
24
- * Unless required by applicable law or agreed to in writing, software
25
- * distributed under the License is distributed on an "AS IS" BASIS,
26
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27
- * See the License for the specific language governing permissions and
28
- * limitations under the License.
29
- */
30
- let OperatorOrder = /* @__PURE__ */ function(OperatorOrder) {
31
- OperatorOrder[OperatorOrder["FIRST"] = 0] = "FIRST";
32
- OperatorOrder[OperatorOrder["SECOND"] = 1] = "SECOND";
33
- return OperatorOrder;
34
- }({});
35
- /**
36
- * Extended custom filter operators.
37
- *
38
- * These operators are not defined in OOXML,
39
- * so when exporting these operators we need to fallback to `CustomFilterOperator` and
40
- * other possible filter types.
41
- */
42
- let ExtendCustomFilterOperator = /* @__PURE__ */ function(ExtendCustomFilterOperator) {
43
- ExtendCustomFilterOperator["NONE"] = "none";
44
- /** Fallback to `<customFilter val="123*" />` */
45
- ExtendCustomFilterOperator["STARTS_WITH"] = "startsWith";
46
- /** Fallback to `<customFilter operator="notEqual" val="123*" />` */
47
- ExtendCustomFilterOperator["DOES_NOT_START_WITH"] = "doesNotStartWith";
48
- /** Fallback to `<customFilter val="*123" />` */
49
- ExtendCustomFilterOperator["ENDS_WITH"] = "endsWith";
50
- /** Fallback to `<customFilter operator="notEqual" val="*123" />` */
51
- ExtendCustomFilterOperator["DOES_NOT_END_WITH"] = "doesNotEndWith";
52
- /** Fallback to `<customFilter val="*123*" />` */
53
- ExtendCustomFilterOperator["CONTAINS"] = "contains";
54
- /** Fallback to `<customFilter operator="notEqual" val="*123*" />` */
55
- ExtendCustomFilterOperator["DOES_NOT_CONTAIN"] = "doesNotContain";
56
- /**
57
- * Text equals. It is not same as CustomFilterOperator.EQUAL.
58
- *
59
- * When equals empty, it will be mapped to.
60
- *
61
- * <autoFilter>
62
- * <filterColumn colId="0">
63
- * <filters blank="1"/>
64
- * </filterColumn>
65
- * </autoFilter>
66
- */
67
- ExtendCustomFilterOperator["EQUALS"] = "equals";
68
- /** Fallback to `<customFilter operator="notEqual" val="" />` */
69
- ExtendCustomFilterOperator["NOT_EQUALS"] = "notEquals";
70
- /**
71
- * Fallback to `<filter blank="1" />`.
72
- *
73
- * It can also fallback to `<customFilter val="" />`, when with another custom filter.
74
- */
75
- ExtendCustomFilterOperator["EMPTY"] = "empty";
76
- /** Fallback to `<customFilter operator="notEqual" val=" " />` */
77
- ExtendCustomFilterOperator["NOT_EMPTY"] = "notEmpty";
78
- /**
79
- * Falls back to the following XML:
80
- *
81
- * ```xml
82
- * <customFilters and="1">
83
- * <customFilter operator="greaterThanOrEqual" val="123"/>
84
- * <customFilter operator="lessThanOrEqual" val="456"/>
85
- * </customFilters>
86
- * ```
87
- *
88
- * Actually in Microsoft Excel, `NOT_BETWEEN` is still `BETWEEN`, as long as the two operators
89
- * are `greaterThanOrEqual` and `lessThanOrEqual`.
90
- */
91
- ExtendCustomFilterOperator["BETWEEN"] = "between";
92
- /**
93
- * Falls back to the following XML:
94
- *
95
- * ```xml
96
- * <customFilters> <!-- no `and="1"` means `OR` -->
97
- * <customFilter operator="lessThan" val="456"/>
98
- * <customFilter operator="greaterThan" val="123"/>
99
- * </customFilters>
100
- * ```
101
- */
102
- ExtendCustomFilterOperator["NOT_BETWEEN"] = "notBetween";
103
- ExtendCustomFilterOperator["CUSTOM"] = "custom";
104
- return ExtendCustomFilterOperator;
105
- }({});
106
-
107
- //#endregion
108
14
  //#region src/models/conditions.ts
109
15
  let FilterConditionItems;
110
16
  (function(_FilterConditionItems) {
111
17
  const NONE = _FilterConditionItems.NONE = {
112
18
  label: "sheets-filter.conditions.none",
113
- operator: ExtendCustomFilterOperator.NONE,
114
- order: OperatorOrder.SECOND,
19
+ operator: "none",
20
+ order: 1,
115
21
  numOfParameters: 0,
116
22
  getDefaultFormParams: () => {
117
23
  throw new Error("[FilterConditionItems.NONE]: should not have initial form params!");
118
24
  },
119
25
  testMappingParams: (params) => {
120
- return params.operator1 === ExtendCustomFilterOperator.NONE;
26
+ return params.operator1 === "none";
121
27
  },
122
28
  mapToFilterColumn: () => null,
123
29
  testMappingFilterColumn: (filterColumn) => {
@@ -129,31 +35,31 @@ let FilterConditionItems;
129
35
  NONE,
130
36
  _FilterConditionItems.EMPTY = {
131
37
  label: "sheets-filter.conditions.empty",
132
- operator: ExtendCustomFilterOperator.EMPTY,
133
- order: OperatorOrder.SECOND,
38
+ operator: "empty",
39
+ order: 1,
134
40
  numOfParameters: 0,
135
41
  getDefaultFormParams: () => {
136
42
  throw new Error("[FilterConditionItems.EMPTY]: should not have initial form params!");
137
43
  },
138
- testMappingParams: ({ operator1 }) => operator1 === ExtendCustomFilterOperator.EMPTY,
44
+ testMappingParams: ({ operator1 }) => operator1 === "empty",
139
45
  mapToFilterColumn: () => ({ customFilters: { customFilters: [{ val: "" }] } }),
140
46
  testMappingFilterColumn: (filterColumn) => {
141
47
  var _filterColumn$customF;
142
48
  if (((_filterColumn$customF = filterColumn.customFilters) === null || _filterColumn$customF === void 0 ? void 0 : _filterColumn$customF.customFilters.length) !== 1) return false;
143
49
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
144
50
  if (!(firstCustomFilter.val === "" && firstCustomFilter.operator === void 0)) return false;
145
- return { operator1: ExtendCustomFilterOperator.EMPTY };
51
+ return { operator1: "empty" };
146
52
  }
147
53
  },
148
54
  _FilterConditionItems.NOT_EMPTY = {
149
55
  label: "sheets-filter.conditions.not-empty",
150
- operator: ExtendCustomFilterOperator.NOT_EMPTY,
151
- order: OperatorOrder.SECOND,
56
+ operator: "notEmpty",
57
+ order: 1,
152
58
  numOfParameters: 0,
153
59
  getDefaultFormParams: () => {
154
60
  throw new Error("[FilterConditionItems.NOT_EMPTY]: should not have initial form params!");
155
61
  },
156
- testMappingParams: ({ operator1 }) => operator1 === ExtendCustomFilterOperator.NOT_EMPTY,
62
+ testMappingParams: ({ operator1 }) => operator1 === "notEmpty",
157
63
  mapToFilterColumn: () => ({ customFilters: { customFilters: [{
158
64
  val: "",
159
65
  operator: CustomFilterOperator.NOT_EQUALS
@@ -163,21 +69,21 @@ let FilterConditionItems;
163
69
  if (((_filterColumn$customF2 = filterColumn.customFilters) === null || _filterColumn$customF2 === void 0 ? void 0 : _filterColumn$customF2.customFilters.length) !== 1) return false;
164
70
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
165
71
  if (!(firstCustomFilter.val === " " && firstCustomFilter.operator === CustomFilterOperator.NOT_EQUALS)) return false;
166
- return { operator1: ExtendCustomFilterOperator.NOT_EMPTY };
72
+ return { operator1: "notEmpty" };
167
73
  }
168
74
  },
169
75
  _FilterConditionItems.TEXT_CONTAINS = {
170
76
  label: "sheets-filter.conditions.text-contains",
171
- operator: ExtendCustomFilterOperator.CONTAINS,
172
- order: OperatorOrder.FIRST,
77
+ operator: "contains",
78
+ order: 0,
173
79
  numOfParameters: 1,
174
80
  getDefaultFormParams: () => ({
175
- operator1: ExtendCustomFilterOperator.CONTAINS,
81
+ operator1: "contains",
176
82
  val1: ""
177
83
  }),
178
84
  testMappingParams: (params) => {
179
85
  const [op] = getOnlyOperatorAndVal(params);
180
- return op === ExtendCustomFilterOperator.CONTAINS;
86
+ return op === "contains";
181
87
  },
182
88
  mapToFilterColumn: (mapParams) => {
183
89
  const { val1 } = mapParams;
@@ -190,7 +96,7 @@ let FilterConditionItems;
190
96
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
191
97
  const valAsString = firstCustomFilter.val.toString();
192
98
  if (!firstCustomFilter.operator && valAsString.startsWith("*") && valAsString.endsWith("*")) return {
193
- operator1: ExtendCustomFilterOperator.CONTAINS,
99
+ operator1: "contains",
194
100
  val1: valAsString.slice(1, -1)
195
101
  };
196
102
  return false;
@@ -198,11 +104,11 @@ let FilterConditionItems;
198
104
  },
199
105
  _FilterConditionItems.DOES_NOT_CONTAIN = {
200
106
  label: "sheets-filter.conditions.does-not-contain",
201
- operator: ExtendCustomFilterOperator.DOES_NOT_CONTAIN,
202
- order: OperatorOrder.FIRST,
107
+ operator: "doesNotContain",
108
+ order: 0,
203
109
  numOfParameters: 1,
204
110
  getDefaultFormParams: () => ({
205
- operator1: ExtendCustomFilterOperator.DOES_NOT_CONTAIN,
111
+ operator1: "doesNotContain",
206
112
  val1: ""
207
113
  }),
208
114
  mapToFilterColumn: (mapParams) => ({ customFilters: { customFilters: [{
@@ -211,7 +117,7 @@ let FilterConditionItems;
211
117
  }] } }),
212
118
  testMappingParams: (params) => {
213
119
  const [op] = getOnlyOperatorAndVal(params);
214
- return op === ExtendCustomFilterOperator.DOES_NOT_CONTAIN;
120
+ return op === "doesNotContain";
215
121
  },
216
122
  testMappingFilterColumn: (filterColumn) => {
217
123
  var _filterColumn$customF4;
@@ -219,7 +125,7 @@ let FilterConditionItems;
219
125
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
220
126
  const valAsString = firstCustomFilter.val.toString();
221
127
  if (firstCustomFilter.operator === CustomFilterOperator.NOT_EQUALS && valAsString.startsWith("*") && valAsString.endsWith("*")) return {
222
- operator1: ExtendCustomFilterOperator.DOES_NOT_CONTAIN,
128
+ operator1: "doesNotContain",
223
129
  val1: valAsString.slice(1, -1)
224
130
  };
225
131
  return false;
@@ -227,17 +133,17 @@ let FilterConditionItems;
227
133
  },
228
134
  _FilterConditionItems.STARTS_WITH = {
229
135
  label: "sheets-filter.conditions.starts-with",
230
- operator: ExtendCustomFilterOperator.STARTS_WITH,
231
- order: OperatorOrder.FIRST,
136
+ operator: "startsWith",
137
+ order: 0,
232
138
  numOfParameters: 1,
233
139
  getDefaultFormParams: () => ({
234
- operator1: ExtendCustomFilterOperator.STARTS_WITH,
140
+ operator1: "startsWith",
235
141
  val1: ""
236
142
  }),
237
143
  mapToFilterColumn: (mapParams) => ({ customFilters: { customFilters: [{ val: `${mapParams.val1}*` }] } }),
238
144
  testMappingParams: (params) => {
239
145
  const [op] = getOnlyOperatorAndVal(params);
240
- return op === ExtendCustomFilterOperator.STARTS_WITH;
146
+ return op === "startsWith";
241
147
  },
242
148
  testMappingFilterColumn: (filterColumn) => {
243
149
  var _filterColumn$customF5;
@@ -245,7 +151,7 @@ let FilterConditionItems;
245
151
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
246
152
  const valAsString = firstCustomFilter.val.toString();
247
153
  if (!firstCustomFilter.operator && valAsString.endsWith("*") && !valAsString.startsWith("*")) return {
248
- operator1: ExtendCustomFilterOperator.STARTS_WITH,
154
+ operator1: "startsWith",
249
155
  val1: valAsString.slice(0, -1)
250
156
  };
251
157
  return false;
@@ -253,17 +159,17 @@ let FilterConditionItems;
253
159
  },
254
160
  _FilterConditionItems.ENDS_WITH = {
255
161
  label: "sheets-filter.conditions.ends-with",
256
- operator: ExtendCustomFilterOperator.ENDS_WITH,
257
- order: OperatorOrder.FIRST,
162
+ operator: "endsWith",
163
+ order: 0,
258
164
  numOfParameters: 1,
259
165
  getDefaultFormParams: () => ({
260
- operator1: ExtendCustomFilterOperator.ENDS_WITH,
166
+ operator1: "endsWith",
261
167
  val1: ""
262
168
  }),
263
169
  mapToFilterColumn: (mapParams) => ({ customFilters: { customFilters: [{ val: `*${mapParams.val1}` }] } }),
264
170
  testMappingParams: (params) => {
265
171
  const [op] = getOnlyOperatorAndVal(params);
266
- return op === ExtendCustomFilterOperator.ENDS_WITH;
172
+ return op === "endsWith";
267
173
  },
268
174
  testMappingFilterColumn: (filterColumn) => {
269
175
  var _filterColumn$customF6;
@@ -271,7 +177,7 @@ let FilterConditionItems;
271
177
  const firstCustomFilter = filterColumn.customFilters.customFilters[0];
272
178
  const valAsString = firstCustomFilter.val.toString();
273
179
  if (!firstCustomFilter.operator && valAsString.startsWith("*") && !valAsString.endsWith("*")) return {
274
- operator1: ExtendCustomFilterOperator.ENDS_WITH,
180
+ operator1: "endsWith",
275
181
  val1: valAsString.slice(1)
276
182
  };
277
183
  return false;
@@ -279,16 +185,16 @@ let FilterConditionItems;
279
185
  },
280
186
  _FilterConditionItems.EQUALS = {
281
187
  label: "sheets-filter.conditions.equals",
282
- operator: ExtendCustomFilterOperator.EQUALS,
283
- order: OperatorOrder.FIRST,
188
+ operator: "equals",
189
+ order: 0,
284
190
  numOfParameters: 1,
285
191
  getDefaultFormParams: () => ({
286
- operator1: ExtendCustomFilterOperator.EQUALS,
192
+ operator1: "equals",
287
193
  val1: ""
288
194
  }),
289
195
  testMappingParams: (params) => {
290
196
  const [op] = getOnlyOperatorAndVal(params);
291
- return op === ExtendCustomFilterOperator.EQUALS;
197
+ return op === "equals";
292
198
  },
293
199
  mapToFilterColumn: (mapParams) => {
294
200
  const { val1 } = mapParams;
@@ -298,11 +204,11 @@ let FilterConditionItems;
298
204
  testMappingFilterColumn: (filterColumn) => {
299
205
  var _filterColumn$filters, _filterColumn$customF7;
300
206
  if (((_filterColumn$filters = filterColumn.filters) === null || _filterColumn$filters === void 0 || (_filterColumn$filters = _filterColumn$filters.filters) === null || _filterColumn$filters === void 0 ? void 0 : _filterColumn$filters.length) === 1) return {
301
- operator1: ExtendCustomFilterOperator.EQUALS,
207
+ operator1: "equals",
302
208
  val1: ""
303
209
  };
304
210
  if (((_filterColumn$customF7 = filterColumn.customFilters) === null || _filterColumn$customF7 === void 0 ? void 0 : _filterColumn$customF7.customFilters.length) === 1 && !filterColumn.customFilters.customFilters[0].operator) return {
305
- operator1: ExtendCustomFilterOperator.EQUALS,
211
+ operator1: "equals",
306
212
  val1: filterColumn.customFilters.customFilters[0].val.toString()
307
213
  };
308
214
  return false;
@@ -312,7 +218,7 @@ let FilterConditionItems;
312
218
  label: "sheets-filter.conditions.greater-than",
313
219
  operator: CustomFilterOperator.GREATER_THAN,
314
220
  numOfParameters: 1,
315
- order: OperatorOrder.FIRST,
221
+ order: 0,
316
222
  getDefaultFormParams: () => ({
317
223
  operator1: CustomFilterOperator.GREATER_THAN,
318
224
  val1: ""
@@ -340,7 +246,7 @@ let FilterConditionItems;
340
246
  label: "sheets-filter.conditions.greater-than-or-equal",
341
247
  operator: CustomFilterOperator.GREATER_THAN_OR_EQUAL,
342
248
  numOfParameters: 1,
343
- order: OperatorOrder.FIRST,
249
+ order: 0,
344
250
  getDefaultFormParams: () => ({
345
251
  operator1: CustomFilterOperator.GREATER_THAN_OR_EQUAL,
346
252
  val1: ""
@@ -368,7 +274,7 @@ let FilterConditionItems;
368
274
  label: "sheets-filter.conditions.less-than",
369
275
  operator: CustomFilterOperator.LESS_THAN,
370
276
  numOfParameters: 1,
371
- order: OperatorOrder.FIRST,
277
+ order: 0,
372
278
  getDefaultFormParams: () => ({
373
279
  operator1: CustomFilterOperator.LESS_THAN,
374
280
  val1: ""
@@ -396,7 +302,7 @@ let FilterConditionItems;
396
302
  label: "sheets-filter.conditions.less-than-or-equal",
397
303
  operator: CustomFilterOperator.LESS_THAN_OR_EQUAL,
398
304
  numOfParameters: 1,
399
- order: OperatorOrder.FIRST,
305
+ order: 0,
400
306
  getDefaultFormParams: () => ({
401
307
  operator1: CustomFilterOperator.LESS_THAN_OR_EQUAL,
402
308
  val1: ""
@@ -424,7 +330,7 @@ let FilterConditionItems;
424
330
  label: "sheets-filter.conditions.equal",
425
331
  operator: CustomFilterOperator.EQUAL,
426
332
  numOfParameters: 1,
427
- order: OperatorOrder.FIRST,
333
+ order: 0,
428
334
  getDefaultFormParams: () => ({
429
335
  operator1: CustomFilterOperator.EQUAL,
430
336
  val1: ""
@@ -452,7 +358,7 @@ let FilterConditionItems;
452
358
  label: "sheets-filter.conditions.not-equal",
453
359
  operator: CustomFilterOperator.NOT_EQUALS,
454
360
  numOfParameters: 1,
455
- order: OperatorOrder.FIRST,
361
+ order: 0,
456
362
  getDefaultFormParams: () => ({
457
363
  operator1: CustomFilterOperator.NOT_EQUALS,
458
364
  val1: ""
@@ -478,8 +384,8 @@ let FilterConditionItems;
478
384
  },
479
385
  _FilterConditionItems.BETWEEN = {
480
386
  label: "sheets-filter.conditions.between",
481
- operator: ExtendCustomFilterOperator.BETWEEN,
482
- order: OperatorOrder.SECOND,
387
+ operator: "between",
388
+ order: 1,
483
389
  numOfParameters: 2,
484
390
  getDefaultFormParams: () => ({
485
391
  and: true,
@@ -531,8 +437,8 @@ let FilterConditionItems;
531
437
  },
532
438
  _FilterConditionItems.NOT_BETWEEN = {
533
439
  label: "sheets-filter.conditions.not-between",
534
- operator: ExtendCustomFilterOperator.NOT_BETWEEN,
535
- order: OperatorOrder.SECOND,
440
+ operator: "notBetween",
441
+ order: 1,
536
442
  numOfParameters: 2,
537
443
  getDefaultFormParams: () => ({
538
444
  operator1: CustomFilterOperator.LESS_THAN,
@@ -578,14 +484,14 @@ let FilterConditionItems;
578
484
  },
579
485
  _FilterConditionItems.CUSTOM = {
580
486
  label: "sheets-filter.conditions.custom",
581
- operator: ExtendCustomFilterOperator.CUSTOM,
582
- order: OperatorOrder.SECOND,
487
+ operator: "custom",
488
+ order: 1,
583
489
  numOfParameters: 2,
584
490
  getDefaultFormParams: () => {
585
491
  return {
586
- operator1: ExtendCustomFilterOperator.NONE,
492
+ operator1: "none",
587
493
  val1: "",
588
- operator2: ExtendCustomFilterOperator.NONE,
494
+ operator2: "none",
589
495
  val2: ""
590
496
  };
591
497
  },
@@ -692,7 +598,7 @@ function statisticFilterByValueItems(items) {
692
598
  }
693
599
 
694
600
  //#endregion
695
- //#region \0@oxc-project+runtime@0.124.0/helpers/decorateParam.js
601
+ //#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
696
602
  function __decorateParam(paramIndex, decorator) {
697
603
  return function(target, key) {
698
604
  decorator(target, key, paramIndex);
@@ -700,7 +606,7 @@ function __decorateParam(paramIndex, decorator) {
700
606
  }
701
607
 
702
608
  //#endregion
703
- //#region \0@oxc-project+runtime@0.124.0/helpers/decorate.js
609
+ //#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
704
610
  function __decorate(decorators, target, key, desc) {
705
611
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
706
612
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -931,7 +837,7 @@ function searchTree(items, searchKeywords) {
931
837
  }
932
838
 
933
839
  //#endregion
934
- //#region \0@oxc-project+runtime@0.124.0/helpers/typeof.js
840
+ //#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
935
841
  function _typeof(o) {
936
842
  "@babel/helpers - typeof";
937
843
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -942,7 +848,7 @@ function _typeof(o) {
942
848
  }
943
849
 
944
850
  //#endregion
945
- //#region \0@oxc-project+runtime@0.124.0/helpers/toPrimitive.js
851
+ //#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
946
852
  function toPrimitive(t, r) {
947
853
  if ("object" != _typeof(t) || !t) return t;
948
854
  var e = t[Symbol.toPrimitive];
@@ -955,14 +861,14 @@ function toPrimitive(t, r) {
955
861
  }
956
862
 
957
863
  //#endregion
958
- //#region \0@oxc-project+runtime@0.124.0/helpers/toPropertyKey.js
864
+ //#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
959
865
  function toPropertyKey(t) {
960
866
  var i = toPrimitive(t, "string");
961
867
  return "symbol" == _typeof(i) ? i : i + "";
962
868
  }
963
869
 
964
870
  //#endregion
965
- //#region \0@oxc-project+runtime@0.124.0/helpers/defineProperty.js
871
+ //#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
966
872
  function _defineProperty(e, r, t) {
967
873
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
968
874
  value: t,
@@ -1092,7 +998,8 @@ let SheetsFilterPanelService = class SheetsFilterPanelService extends Disposable
1092
998
  this._disposePreviousModel();
1093
999
  const range = filterModel.getRange();
1094
1000
  if (range.startRow === range.endRow) return false;
1095
- this.filterByModel = await ByValuesModel.fromFilterColumn(this._injector, filterModel, col);
1001
+ const filterByModel = await ByValuesModel.fromFilterColumn(this._injector, filterModel, col);
1002
+ this.filterByModel = filterByModel;
1096
1003
  this._filterBy$.next(FilterBy.VALUES);
1097
1004
  this._listenToFilterHeaderChange(filterModel, col);
1098
1005
  return true;
@@ -1101,7 +1008,8 @@ let SheetsFilterPanelService = class SheetsFilterPanelService extends Disposable
1101
1008
  this._disposePreviousModel();
1102
1009
  const range = filterModel.getRange();
1103
1010
  if (range.startRow === range.endRow) return false;
1104
- this.filterByModel = await ByColorsModel.fromFilterColumn(this._injector, filterModel, col);
1011
+ const filterByModel = await ByColorsModel.fromFilterColumn(this._injector, filterModel, col);
1012
+ this.filterByModel = filterByModel;
1105
1013
  this._filterBy$.next(FilterBy.COLORS);
1106
1014
  this._listenToFilterHeaderChange(filterModel, col);
1107
1015
  return true;
@@ -1110,7 +1018,8 @@ let SheetsFilterPanelService = class SheetsFilterPanelService extends Disposable
1110
1018
  this._disposePreviousModel();
1111
1019
  const range = filterModel.getRange();
1112
1020
  if (range.startRow === range.endRow) return false;
1113
- this.filterByModel = ByConditionsModel.fromFilterColumn(this._injector, filterModel, col, filterModel.getFilterColumn(col));
1021
+ const model = ByConditionsModel.fromFilterColumn(this._injector, filterModel, col, filterModel.getFilterColumn(col));
1022
+ this.filterByModel = model;
1114
1023
  this._filterBy$.next(FilterBy.CONDITIONS);
1115
1024
  this._listenToFilterHeaderChange(filterModel, col);
1116
1025
  return true;
@@ -1606,7 +1515,7 @@ const ChangeFilterByOperation = {
1606
1515
  //#endregion
1607
1516
  //#region package.json
1608
1517
  var name = "@univerjs/sheets-filter-ui";
1609
- var version = "0.21.1";
1518
+ var version = "0.22.0";
1610
1519
 
1611
1520
  //#endregion
1612
1521
  //#region src/config/config.ts