@univerjs/sheets-filter-ui 0.1.8

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.
Files changed (34) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +34 -0
  3. package/lib/cjs/index.js +14 -0
  4. package/lib/es/index.js +3158 -0
  5. package/lib/index.css +1 -0
  6. package/lib/types/__testing__/data.d.ts +22 -0
  7. package/lib/types/commands/__tests__/sheets-filter.command.spec.d.ts +16 -0
  8. package/lib/types/commands/__tests__/sheets-filter.operation.spec.d.ts +16 -0
  9. package/lib/types/commands/sheets-filter.command.d.ts +25 -0
  10. package/lib/types/commands/sheets-filter.operation.d.ts +18 -0
  11. package/lib/types/controllers/__tests__/sheets-filter.menu.spec.d.ts +16 -0
  12. package/lib/types/controllers/sheets-filter-render.controller.d.ts +28 -0
  13. package/lib/types/controllers/sheets-filter-ui.controller.d.ts +29 -0
  14. package/lib/types/controllers/sheets-filter.menu.d.ts +6 -0
  15. package/lib/types/controllers/sheets-filter.shortcut.d.ts +3 -0
  16. package/lib/types/index.d.ts +18 -0
  17. package/lib/types/locale/en-US.d.ts +66 -0
  18. package/lib/types/locale/index.d.ts +17 -0
  19. package/lib/types/locale/zh-CN.d.ts +4 -0
  20. package/lib/types/models/__tests__/conditions.spec.d.ts +16 -0
  21. package/lib/types/models/conditions.d.ts +75 -0
  22. package/lib/types/models/extended-operators.d.ts +89 -0
  23. package/lib/types/models/utils.d.ts +8 -0
  24. package/lib/types/plugin.d.ts +11 -0
  25. package/lib/types/services/__tests__/sheets-filter-panel.service.spec.d.ts +16 -0
  26. package/lib/types/services/sheets-filter-panel.service.d.ts +186 -0
  27. package/lib/types/views/components/SheetsFilterByConditionsPanel.d.ts +9 -0
  28. package/lib/types/views/components/SheetsFilterByValuesPanel.d.ts +9 -0
  29. package/lib/types/views/components/SheetsFilterPanel.d.ts +8 -0
  30. package/lib/types/views/components/SheetsFilterPanel.stories.d.ts +15 -0
  31. package/lib/types/views/widgets/drawings.d.ts +7 -0
  32. package/lib/types/views/widgets/filter-button.shape.d.ts +33 -0
  33. package/lib/umd/index.js +14 -0
  34. package/package.json +91 -0
package/lib/index.css ADDED
@@ -0,0 +1 @@
1
+ .univer-sheets-filter-panel{display:flex;width:312px;height:400px;flex-direction:column;background:rgb(var(--bg-color-secondary));border-radius:10px;box-sizing:border-box;box-shadow:var(--box-shadow-lg);padding:16px;overflow:hidden}.univer-sheets-filter-panel-header{flex-grow:0;flex-shrink:0;margin-bottom:4px}.univer-sheets-filter-panel-content{flex-grow:1;flex-shrink:1;overflow:hidden;padding-top:8px}.univer-sheets-filter-panel-select-all{font-size:13px;margin-right:4px}.univer-sheets-filter-panel-select-all-count{font-size:13px;color:rgb(var(--grey-400))}.univer-sheets-filter-panel-values-container{display:flex;height:100%;flex-direction:column}.univer-sheets-filter-panel-values-container>.univer-input-affix-wrapper{flex:0 0 32px}.univer-sheets-filter-panel-values-container .univer-select,.univer-sheets-filter-panel-values-container .univer-input-affix-wrapper,.univer-sheets-filter-panel-values-container .univer-radio-group{width:100%}.univer-sheets-filter-panel-values-find{height:32px;margin-bottom:8px}.univer-sheets-filter-panel-values-list{flex-grow:1;margin-top:8px;border:1px solid rgb(var(--grey-200));box-sizing:border-box;border-radius:6px;overflow:hidden;display:flex;flex-direction:column;padding:6px 0 6px 8px}.univer-sheets-filter-panel-values-list-inner-container{padding-right:8px}.univer-sheets-filter-panel-values-virtual{flex-grow:1}.univer-sheets-filter-panel-values-item{box-sizing:border-box;height:32px;padding:2px 0;width:100%}.univer-sheets-filter-panel-values-item-inner{align-items:center;padding:0 2px 0 24px;line-height:28px;box-sizing:border-box;border-radius:6px;height:28px;display:flex;font-size:13px}.univer-sheets-filter-panel-values-item-inner:hover{background-color:rgb(var(--grey-50))}.univer-sheets-filter-panel-values-item-inner:hover .univer-sheets-filter-panel-values-item-count{margin-right:2px}.univer-sheets-filter-panel-values-item-inner:hover .univer-sheets-filter-panel-values-item-exclude-button{box-sizing:border-box;margin-left:auto;display:inline-block;height:24px;font-size:12px;line-height:12px}.univer-sheets-filter-panel-values-item-inner:hover .univer-sheets-filter-panel-values-item-exclude-button:hover{background-color:rgb(var(--hyacinth-50))}.univer-sheets-filter-panel-values-item-inner:hover .univer-sheets-filter-panel-values-item-exclude-button:active{background-color:rgb(var(--hyacinth-100))}.univer-sheets-filter-panel-values-item-text{display:inline-block;height:100%;margin:0 4px;flex-shrink:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.univer-sheets-filter-panel-values-item-count{color:rgb(var(--grey-400))}.univer-sheets-filter-panel-values-item-exclude-button{display:none}.univer-sheets-filter-panel-conditions-container{display:flex;flex-direction:column;height:100%}.univer-sheets-filter-panel-conditions-container .univer-select,.univer-sheets-filter-panel-conditions-container .univer-input-affix-wrapper,.univer-sheets-filter-panel-conditions-container .univer-radio-group{width:100%;margin-bottom:8px}.univer-sheets-filter-panel-conditions-container-inner{flex-grow:1;border-radius:6px;border:1px solid rgb(var(--grey-200));overflow:hidden;padding:8px}.univer-sheets-filter-panel-conditions-desc{margin-top:-6px;color:rgb(var(--grey-500));font-size:12px;line-height:18px}.univer-sheets-filter-panel-footer{margin-top:16px;flex-grow:0;flex-shrink:0;display:inline-flex;flex-wrap:nowrap;overflow:hidden;justify-content:space-between}.univer-sheets-filter-panel-footer-primary-buttons>.univer-button{margin-left:12px}.univer-sheets-filter-panel .univer-select,.univer-sheets-filter-panel .univer-input{width:100%}.univer-sheets-filter-panel .univer-form-dual-column-layout{margin-bottom:8px}
@@ -0,0 +1,22 @@
1
+ import { IWorkbookData } from '@univerjs/core';
2
+
3
+ export declare function WithCustomFilterModelFactory(): IWorkbookData;
4
+ export declare function WithValuesFilterModelFactory(): IWorkbookData;
5
+ export declare function WithValuesAndEmptyFilterModelFactory(): IWorkbookData;
6
+ export declare function WithMultiEmptyCellsModelFactory(): IWorkbookData;
7
+ export declare function WithTwoFilterColumnsFactory(): IWorkbookData;
8
+ export declare function WithMergedCellFilterFactory(): IWorkbookData;
9
+ export declare const ITEMS: {
10
+ checked: boolean;
11
+ count: number;
12
+ index: number;
13
+ isEmpty: boolean;
14
+ value: string;
15
+ }[];
16
+ export declare const E_ITEMS: {
17
+ checked: boolean;
18
+ count: number;
19
+ index: number;
20
+ isEmpty: boolean;
21
+ value: string;
22
+ }[];
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,25 @@
1
+ import { IAutoFilter, IFilterColumn } from '@univerjs/sheets-filter';
2
+ import { ISheetCommandSharedParams } from '@univerjs/sheets';
3
+ import { ICommand, IMutationInfo, Nullable } from '@univerjs/core';
4
+
5
+ /**
6
+ * This command is for toggling filter in the currently active Worksheet.
7
+ */
8
+ export declare const SmartToggleSheetsFilterCommand: ICommand;
9
+ export interface ISetSheetsFilterCriteriaCommandParams extends ISheetCommandSharedParams {
10
+ col: number;
11
+ criteria: Nullable<IFilterColumn>;
12
+ }
13
+ /**
14
+ * This command is for setting filter criteria to a column in the targeting `FilterModel`.
15
+ */
16
+ export declare const SetSheetsFilterCriteriaCommand: ICommand<ISetSheetsFilterCriteriaCommandParams>;
17
+ /**
18
+ * This command is for clearing all filter criteria in the currently active `FilterModel`.
19
+ */
20
+ export declare const ClearSheetsFilterCriteriaCommand: ICommand;
21
+ /**
22
+ * This command force the currently active `FilterModel` to re-calculate all filter criteria.
23
+ */
24
+ export declare const ReCalcSheetsFilterCommand: ICommand;
25
+ export declare function destructFilterCriteria(unitId: string, subUnitId: string, autoFilter: IAutoFilter): IMutationInfo[];
@@ -0,0 +1,18 @@
1
+ import { FilterBy } from '../services/sheets-filter-panel.service';
2
+ import { IOperation } from '@univerjs/core';
3
+
4
+ export declare const FILTER_PANEL_OPENED_KEY = "FILTER_PANEL_OPENED";
5
+ export interface IOpenFilterPanelOperationParams {
6
+ unitId: string;
7
+ subUnitId: string;
8
+ col: number;
9
+ }
10
+ /**
11
+ * The operation to open the filter panel and prepare for changing the filter conditions on a given column.
12
+ */
13
+ export declare const OpenFilterPanelOperation: IOperation<IOpenFilterPanelOperationParams>;
14
+ export declare const CloseFilterPanelOperation: IOperation;
15
+ export interface IChangeFilterByOperationParams {
16
+ filterBy: FilterBy;
17
+ }
18
+ export declare const ChangeFilterByOperation: IOperation<IChangeFilterByOperationParams>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,28 @@
1
+ import { Injector } from '@wendellhu/redi';
2
+ import { ISelectionRenderService, SheetRenderController, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
3
+ import { SheetsFilterService } from '@univerjs/sheets-filter';
4
+ import { SheetInterceptorService } from '@univerjs/sheets';
5
+ import { IRenderManagerService } from '@univerjs/engine-render';
6
+ import { ICommandService, IUniverInstanceService, RxDisposable, ThemeService } from '@univerjs/core';
7
+
8
+ export declare class SheetsFilterRenderController extends RxDisposable {
9
+ private readonly _injector;
10
+ private readonly _sheetSkeletonManagerService;
11
+ private readonly _sheetsFilterService;
12
+ private readonly _themeService;
13
+ private readonly _sheetInterceptorService;
14
+ private _sheetRenderController;
15
+ private readonly _commandService;
16
+ private readonly _univerInstanceService;
17
+ private readonly _renderManagerService;
18
+ private readonly _selectionRenderService;
19
+ private _filterRangeShape;
20
+ private _buttonRenderDisposable;
21
+ private _filterButtonShapes;
22
+ constructor(_injector: Injector, _sheetSkeletonManagerService: SheetSkeletonManagerService, _sheetsFilterService: SheetsFilterService, _themeService: ThemeService, _sheetInterceptorService: SheetInterceptorService, _sheetRenderController: SheetRenderController, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _selectionRenderService: ISelectionRenderService);
23
+ private _initRenderer;
24
+ private _renderRange;
25
+ private _renderButtons;
26
+ private _interceptCellContent;
27
+ private _disposeRendering;
28
+ }
@@ -0,0 +1,29 @@
1
+ import { SheetsFilterPanelService } from '../services/sheets-filter-panel.service';
2
+ import { SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
3
+ import { Injector } from '@wendellhu/redi';
4
+ import { ComponentManager, IMenuService, IShortcutService } from '@univerjs/ui';
5
+ import { ICommandService, IContextService, RxDisposable } from '@univerjs/core';
6
+
7
+ export declare const FILTER_PANEL_POPUP_KEY = "FILTER_PANEL_POPUP";
8
+ /**
9
+ * This controller controls the UI of "filter" features. Menus, commands and filter panel etc. Except for the rendering.
10
+ */
11
+ export declare class SheetsFilterUIController extends RxDisposable {
12
+ private readonly _injector;
13
+ private readonly _componentManager;
14
+ private readonly _sheetsFilterPanelService;
15
+ private _sheetCanvasPopupService;
16
+ private readonly _shortcutService;
17
+ private readonly _commandService;
18
+ private readonly _menuService;
19
+ private readonly _contextService;
20
+ constructor(_injector: Injector, _componentManager: ComponentManager, _sheetsFilterPanelService: SheetsFilterPanelService, _sheetCanvasPopupService: SheetCanvasPopManagerService, _shortcutService: IShortcutService, _commandService: ICommandService, _menuService: IMenuService, _contextService: IContextService);
21
+ dispose(): void;
22
+ private _initShortcuts;
23
+ private _initCommands;
24
+ private _initMenuItems;
25
+ private _initUI;
26
+ private _popupDisposable?;
27
+ private _openFilterPopup;
28
+ private _closeFilterPopup;
29
+ }
@@ -0,0 +1,6 @@
1
+ import { IAccessor } from '@wendellhu/redi';
2
+ import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
3
+
4
+ export declare function SmartToggleFilterMenuItemFactory(accessor: IAccessor): IMenuSelectorItem;
5
+ export declare function ClearFilterCriteriaMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
6
+ export declare function ReCalcFilterMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
@@ -0,0 +1,3 @@
1
+ import { IShortcutItem } from '@univerjs/ui';
2
+
3
+ export declare const SmartToggleFilterShortcut: IShortcutItem;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export { UniverSheetsFilterUIPlugin } from './plugin';
17
+ export { default as enUS } from './locale/en-US';
18
+ export { default as zhCN } from './locale/zh-CN';
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ declare const _default: {
17
+ 'sheets-filter': {
18
+ toolbar: {
19
+ 'smart-toggle-filter-tooltip': string;
20
+ 'clear-filter-criteria': string;
21
+ 're-calc-filter-conditions': string;
22
+ };
23
+ command: {
24
+ 'not-valid-filter-range': string;
25
+ };
26
+ shortcut: {
27
+ 'smart-toggle-filter': string;
28
+ };
29
+ panel: {
30
+ 'clear-filter': string;
31
+ cancel: string;
32
+ confirm: string;
33
+ 'by-values': string;
34
+ 'by-conditions': string;
35
+ 'filter-only': string;
36
+ 'search-placeholder': string;
37
+ 'select-all': string;
38
+ 'input-values-placeholder': string;
39
+ and: string;
40
+ or: string;
41
+ empty: string;
42
+ '?': string;
43
+ '*': string;
44
+ };
45
+ conditions: {
46
+ none: string;
47
+ empty: string;
48
+ 'not-empty': string;
49
+ 'text-contains': string;
50
+ 'does-not-contain': string;
51
+ 'starts-with': string;
52
+ 'ends-with': string;
53
+ equals: string;
54
+ 'greater-than': string;
55
+ 'greater-than-or-equal': string;
56
+ 'less-than': string;
57
+ 'less-than-or-equal': string;
58
+ equal: string;
59
+ 'not-equal': string;
60
+ between: string;
61
+ 'not-between': string;
62
+ custom: string;
63
+ };
64
+ };
65
+ };
66
+ export default _default;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export { default as enUS } from './en-US';
17
+ export { default as zhCN } from './zh-CN';
@@ -0,0 +1,4 @@
1
+ import { default as enUS } from './en-US';
2
+
3
+ declare const zLocale: typeof enUS;
4
+ export default zLocale;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,75 @@
1
+ import { ExtendCustomFilterOperator, OperatorOrder } from './extended-operators';
2
+ import { IFilterColumn, CustomFilterOperator } from '@univerjs/sheets-filter';
3
+ import { Nullable } from '@univerjs/core';
4
+
5
+ export type FilterOperator = ExtendCustomFilterOperator | CustomFilterOperator;
6
+ export interface IFilterConditionFormParams {
7
+ and?: true;
8
+ operator1?: FilterOperator;
9
+ val1?: string;
10
+ operator2?: FilterOperator;
11
+ val2?: string;
12
+ }
13
+ export interface IFilterConditionItem {
14
+ operator: FilterOperator;
15
+ numOfParameters: number;
16
+ order: OperatorOrder;
17
+ /**
18
+ * Name of the filter condition. Should be an i18n key.
19
+ */
20
+ label: string;
21
+ and?: true;
22
+ /**
23
+ * Get the initial form parameters for this condition item. This should only be called when `numOfParameters` is not `0`.
24
+ */
25
+ getDefaultFormParams(): IFilterConditionFormParams;
26
+ /**
27
+ * Test if the form params can be mapped to this condition item. This should be called when the
28
+ * condition form changes and `numOfParameters` is not `0`.
29
+ * @param params
30
+ */
31
+ testMappingParams(params: IFilterConditionFormParams): boolean;
32
+ /**
33
+ * When user confirm changing filter condition, this method will be called to map the form params
34
+ * to the filter column data.
35
+ * @param mapParams
36
+ */
37
+ mapToFilterColumn(mapParams: IFilterConditionFormParams): Nullable<Omit<IFilterColumn, 'colId'>>;
38
+ /**
39
+ * Test if the filter column data can be mapped to this condition item.
40
+ * It should return the mapping parameters if it can be mapped, otherwise `false`.
41
+ * This should be called when the filter panel opens.
42
+ *
43
+ * @param filterColumn
44
+ * @returns the mapping parameters if it can be mapped, otherwise `false`
45
+ */
46
+ testMappingFilterColumn(filterColumn: Omit<IFilterColumn, 'colId'>): IFilterConditionFormParams | false;
47
+ }
48
+ export declare namespace FilterConditionItems {
49
+ const NONE: IFilterConditionItem;
50
+ const EMPTY: IFilterConditionItem;
51
+ const NOT_EMPTY: IFilterConditionItem;
52
+ const TEXT_CONTAINS: IFilterConditionItem;
53
+ const DOES_NOT_CONTAIN: IFilterConditionItem;
54
+ const STARTS_WITH: IFilterConditionItem;
55
+ const ENDS_WITH: IFilterConditionItem;
56
+ const EQUALS: IFilterConditionItem;
57
+ const GREATER_THAN: IFilterConditionItem;
58
+ const GREATER_THAN_OR_EQUAL: IFilterConditionItem;
59
+ const LESS_THAN: IFilterConditionItem;
60
+ const LESS_THAN_OR_EQUAL: IFilterConditionItem;
61
+ const EQUAL: IFilterConditionItem;
62
+ const NOT_EQUAL: IFilterConditionItem;
63
+ const BETWEEN: IFilterConditionItem;
64
+ const NOT_BETWEEN: IFilterConditionItem;
65
+ /**
66
+ * This should be test last. If no other condition item can be mapped, then it should be mapped.
67
+ */
68
+ const CUSTOM: IFilterConditionItem;
69
+ const ALL_CONDITIONS: IFilterConditionItem[];
70
+ function getItemByOperator(operator: FilterOperator): IFilterConditionItem;
71
+ function testMappingParams(mapParams: IFilterConditionFormParams, numOfParameters: number): IFilterConditionItem;
72
+ function getInitialFormParams(operator: FilterOperator): IFilterConditionFormParams;
73
+ function mapToFilterColumn(condition: IFilterConditionItem, mapParams: IFilterConditionFormParams): Nullable<Omit<IFilterColumn, 'colId'>>;
74
+ function testMappingFilterColumn(filterColumn: Nullable<Omit<IFilterColumn, 'colId'>>): [IFilterConditionItem, IFilterConditionFormParams];
75
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare enum OperatorOrder {
17
+ FIRST = 0,
18
+ SECOND = 1
19
+ }
20
+ /**
21
+ * Extended custom filter operators.
22
+ *
23
+ * These operators are not defined in OOXML,
24
+ * so when exporting these operators we need to fallback to `CustomFilterOperator` and
25
+ * other possible filter types.
26
+ */
27
+ export declare enum ExtendCustomFilterOperator {
28
+ NONE = "none",
29
+ /** Fallback to `<customFilter val="123*" />` */
30
+ STARTS_WITH = "startsWith",
31
+ /** Fallback to `<customFilter operator="notEqual" val="123*" />` */
32
+ DOES_NOT_START_WITH = "doesNotStartWith",
33
+ /** Fallback to `<customFilter val="*123" />` */
34
+ ENDS_WITH = "endsWith",
35
+ /** Fallback to `<customFilter operator="notEqual" val="*123" />` */
36
+ DOES_NOT_END_WITH = "doesNotEndWith",
37
+ /** Fallback to `<customFilter val="*123*" />` */
38
+ CONTAINS = "contains",
39
+ /** Fallback to `<customFilter operator="notEqual" val="*123*" />` */
40
+ DOES_NOT_CONTAIN = "doesNotContain",
41
+ /**
42
+ * Text equals. It is not same as CustomFilterOperator.EQUAL.
43
+ *
44
+ * When equals empty, it will be mapped to.
45
+ *
46
+ * <autoFilter>
47
+ * <filterColumn colId="0">
48
+ * <filters blank="1"/>
49
+ * </filterColumn>
50
+ * </autoFilter>
51
+ */
52
+ EQUALS = "equals",
53
+ /** Fallback to `<customFilter operator="notEqual" val="" />` */
54
+ NOT_EQUALS = "notEquals",
55
+ /**
56
+ * Fallback to `<filter blank="1" />`.
57
+ *
58
+ * It can also fallback to `<customFilter val="" />`, when with another custom filter.
59
+ */
60
+ EMPTY = "empty",
61
+ /** Fallback to `<customFilter operator="notEqual" val=" " />` */
62
+ NOT_EMPTY = "notEmpty",
63
+ /**
64
+ * Falls back to the following XML:
65
+ *
66
+ * ```xml
67
+ * <customFilters and="1">
68
+ * <customFilter operator="greaterThanOrEqual" val="123"/>
69
+ * <customFilter operator="lessThanOrEqual" val="456"/>
70
+ * </customFilters>
71
+ * ```
72
+ *
73
+ * Actually in Microsoft Excel, `NOT_BETWEEN` is still `BETWEEN`, as long as the two operators
74
+ * are `greaterThanOrEqual` and `lessThanOrEqual`.
75
+ */
76
+ BETWEEN = "between",
77
+ /**
78
+ * Falls back to the following XML:
79
+ *
80
+ * ```xml
81
+ * <customFilters> <!-- no `and="1"` means `OR` -->
82
+ * <customFilter operator="lessThan" val="456"/>
83
+ * <customFilter operator="greaterThan" val="123"/>
84
+ * </customFilters>
85
+ * ```
86
+ */
87
+ NOT_BETWEEN = "notBetween",
88
+ CUSTOM = "custom"
89
+ }
@@ -0,0 +1,8 @@
1
+ import { IFilterByValueItem } from '../services/sheets-filter-panel.service';
2
+
3
+ export declare function statisticFilterByValueItems(items: IFilterByValueItem[]): {
4
+ checked: number;
5
+ unchecked: number;
6
+ checkedItems: IFilterByValueItem[];
7
+ uncheckedItems: IFilterByValueItem[];
8
+ };
@@ -0,0 +1,11 @@
1
+ import { Injector } from '@wendellhu/redi';
2
+ import { LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
3
+
4
+ export declare class UniverSheetsFilterUIPlugin extends Plugin {
5
+ protected readonly _injector: Injector;
6
+ private readonly _localeService;
7
+ static type: UniverInstanceType;
8
+ static pluginName: string;
9
+ constructor(_config: unknown, _injector: Injector, _localeService: LocaleService);
10
+ onStarting(injector: Injector): void;
11
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};