@univerjs/sheets-filter-ui 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +4 -4
- package/lib/es/index.js +780 -729
- package/lib/types/commands/sheets-filter.command.d.ts +2 -2
- package/lib/types/commands/sheets-filter.operation.d.ts +1 -1
- package/lib/types/controllers/sheets-filter-render.controller.d.ts +8 -8
- package/lib/types/controllers/sheets-filter-ui.controller.d.ts +13 -5
- package/lib/types/controllers/sheets-filter.menu.d.ts +1 -1
- package/lib/types/index.d.ts +1 -2
- package/lib/types/locale/en-US.d.ts +4 -66
- package/lib/types/locale/index.d.ts +1 -0
- package/lib/types/locale/ru-RU.d.ts +4 -0
- package/lib/types/locale/zh-CN.d.ts +66 -4
- package/lib/types/models/conditions.d.ts +2 -2
- package/lib/types/plugin.d.ts +4 -2
- package/lib/types/services/sheets-filter-panel.service.d.ts +5 -5
- package/lib/types/views/components/SheetsFilterByConditionsPanel.d.ts +1 -1
- package/lib/types/views/components/SheetsFilterByValuesPanel.d.ts +1 -1
- package/lib/types/views/components/SheetsFilterPanel.stories.d.ts +2 -2
- package/lib/types/views/widgets/filter-button.shape.d.ts +1 -1
- package/lib/umd/index.js +4 -4
- package/package.json +21 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IAutoFilter, IFilterColumn } from '@univerjs/sheets-filter';
|
|
2
|
-
import { ISheetCommandSharedParams } from '@univerjs/sheets';
|
|
3
1
|
import { ICommand, IMutationInfo, Nullable } from '@univerjs/core';
|
|
2
|
+
import { ISheetCommandSharedParams } from '@univerjs/sheets';
|
|
3
|
+
import { IAutoFilter, IFilterColumn } from '@univerjs/sheets-filter';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* This command is for toggling filter in the currently active Worksheet.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FilterBy } from '../services/sheets-filter-panel.service';
|
|
2
1
|
import { IOperation } from '@univerjs/core';
|
|
2
|
+
import { FilterBy } from '../services/sheets-filter-panel.service';
|
|
3
3
|
|
|
4
4
|
export declare const FILTER_PANEL_OPENED_KEY = "FILTER_PANEL_OPENED";
|
|
5
5
|
export interface IOpenFilterPanelOperationParams {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { SheetsFilterService } from '@univerjs/sheets-filter';
|
|
1
|
+
import { Workbook, ICommandService, RxDisposable, ThemeService } from '@univerjs/core';
|
|
2
|
+
import { IRenderContext, IRenderController, IRenderManagerService } from '@univerjs/engine-render';
|
|
4
3
|
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { SheetsFilterService } from '@univerjs/sheets-filter';
|
|
5
|
+
import { ISelectionRenderService, SheetRenderController, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
|
|
6
|
+
import { Injector } from '@wendellhu/redi';
|
|
7
7
|
|
|
8
|
-
export declare class SheetsFilterRenderController extends RxDisposable {
|
|
8
|
+
export declare class SheetsFilterRenderController extends RxDisposable implements IRenderController {
|
|
9
|
+
private readonly _context;
|
|
9
10
|
private readonly _injector;
|
|
10
11
|
private readonly _sheetSkeletonManagerService;
|
|
11
12
|
private readonly _sheetsFilterService;
|
|
@@ -13,13 +14,12 @@ export declare class SheetsFilterRenderController extends RxDisposable {
|
|
|
13
14
|
private readonly _sheetInterceptorService;
|
|
14
15
|
private _sheetRenderController;
|
|
15
16
|
private readonly _commandService;
|
|
16
|
-
private readonly _univerInstanceService;
|
|
17
17
|
private readonly _renderManagerService;
|
|
18
18
|
private readonly _selectionRenderService;
|
|
19
19
|
private _filterRangeShape;
|
|
20
20
|
private _buttonRenderDisposable;
|
|
21
21
|
private _filterButtonShapes;
|
|
22
|
-
constructor(_injector: Injector, _sheetSkeletonManagerService: SheetSkeletonManagerService, _sheetsFilterService: SheetsFilterService, _themeService: ThemeService, _sheetInterceptorService: SheetInterceptorService, _sheetRenderController: SheetRenderController, _commandService: ICommandService,
|
|
22
|
+
constructor(_context: IRenderContext<Workbook>, _injector: Injector, _sheetSkeletonManagerService: SheetSkeletonManagerService, _sheetsFilterService: SheetsFilterService, _themeService: ThemeService, _sheetInterceptorService: SheetInterceptorService, _sheetRenderController: SheetRenderController, _commandService: ICommandService, _renderManagerService: IRenderManagerService, _selectionRenderService: ISelectionRenderService);
|
|
23
23
|
private _initRenderer;
|
|
24
24
|
private _renderRange;
|
|
25
25
|
private _renderButtons;
|
|
@@ -1,28 +1,36 @@
|
|
|
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
1
|
import { ICommandService, IContextService, RxDisposable } from '@univerjs/core';
|
|
2
|
+
import { MenuConfig, ComponentManager, IMenuService, IShortcutService } from '@univerjs/ui';
|
|
3
|
+
import { Injector } from '@wendellhu/redi';
|
|
4
|
+
import { SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
|
|
5
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
6
|
+
import { SheetsFilterPanelService } from '../services/sheets-filter-panel.service';
|
|
6
7
|
|
|
8
|
+
export interface IUniverSheetsFilterUIConfig {
|
|
9
|
+
menu: MenuConfig;
|
|
10
|
+
}
|
|
11
|
+
export declare const DefaultSheetFilterUiConfig: {};
|
|
7
12
|
export declare const FILTER_PANEL_POPUP_KEY = "FILTER_PANEL_POPUP";
|
|
8
13
|
/**
|
|
9
14
|
* This controller controls the UI of "filter" features. Menus, commands and filter panel etc. Except for the rendering.
|
|
10
15
|
*/
|
|
11
16
|
export declare class SheetsFilterUIController extends RxDisposable {
|
|
17
|
+
private readonly _config;
|
|
12
18
|
private readonly _injector;
|
|
13
19
|
private readonly _componentManager;
|
|
14
20
|
private readonly _sheetsFilterPanelService;
|
|
15
21
|
private _sheetCanvasPopupService;
|
|
22
|
+
private readonly _renderManagerService;
|
|
16
23
|
private readonly _shortcutService;
|
|
17
24
|
private readonly _commandService;
|
|
18
25
|
private readonly _menuService;
|
|
19
26
|
private readonly _contextService;
|
|
20
|
-
constructor(_injector: Injector, _componentManager: ComponentManager, _sheetsFilterPanelService: SheetsFilterPanelService, _sheetCanvasPopupService: SheetCanvasPopManagerService, _shortcutService: IShortcutService, _commandService: ICommandService, _menuService: IMenuService, _contextService: IContextService);
|
|
27
|
+
constructor(_config: Partial<IUniverSheetsFilterUIConfig>, _injector: Injector, _componentManager: ComponentManager, _sheetsFilterPanelService: SheetsFilterPanelService, _sheetCanvasPopupService: SheetCanvasPopManagerService, _renderManagerService: IRenderManagerService, _shortcutService: IShortcutService, _commandService: ICommandService, _menuService: IMenuService, _contextService: IContextService);
|
|
21
28
|
dispose(): void;
|
|
22
29
|
private _initShortcuts;
|
|
23
30
|
private _initCommands;
|
|
24
31
|
private _initMenuItems;
|
|
25
32
|
private _initUI;
|
|
33
|
+
private _initRenderControllers;
|
|
26
34
|
private _popupDisposable?;
|
|
27
35
|
private _openFilterPopup;
|
|
28
36
|
private _closeFilterPopup;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
2
1
|
import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
2
|
+
import { IAccessor } from '@wendellhu/redi';
|
|
3
3
|
|
|
4
4
|
export declare function SmartToggleFilterMenuItemFactory(accessor: IAccessor): IMenuSelectorItem;
|
|
5
5
|
export declare function ClearFilterCriteriaMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,66 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
1
|
+
import { default as zhCN } from './zh-CN';
|
|
2
|
+
|
|
3
|
+
declare const locale: typeof zhCN;
|
|
4
|
+
export default locale;
|
|
@@ -1,4 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 locale: {
|
|
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
|
+
or: string;
|
|
40
|
+
and: 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 locale;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ExtendCustomFilterOperator, OperatorOrder } from './extended-operators';
|
|
2
|
-
import { IFilterColumn, CustomFilterOperator } from '@univerjs/sheets-filter';
|
|
3
1
|
import { Nullable } from '@univerjs/core';
|
|
2
|
+
import { IFilterColumn, CustomFilterOperator } from '@univerjs/sheets-filter';
|
|
3
|
+
import { ExtendCustomFilterOperator, OperatorOrder } from './extended-operators';
|
|
4
4
|
|
|
5
5
|
export type FilterOperator = ExtendCustomFilterOperator | CustomFilterOperator;
|
|
6
6
|
export interface IFilterConditionFormParams {
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Injector } from '@wendellhu/redi';
|
|
2
1
|
import { LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
|
+
import { Injector } from '@wendellhu/redi';
|
|
3
|
+
import { IUniverSheetsFilterUIConfig } from './controllers/sheets-filter-ui.controller';
|
|
3
4
|
|
|
4
5
|
export declare class UniverSheetsFilterUIPlugin extends Plugin {
|
|
6
|
+
private readonly _config;
|
|
5
7
|
protected readonly _injector: Injector;
|
|
6
8
|
private readonly _localeService;
|
|
7
9
|
static type: UniverInstanceType;
|
|
8
10
|
static pluginName: string;
|
|
9
|
-
constructor(_config:
|
|
11
|
+
constructor(_config: Partial<IUniverSheetsFilterUIConfig>, _injector: Injector, _localeService: LocaleService);
|
|
10
12
|
onStarting(injector: Injector): void;
|
|
11
13
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FilterOperator, IFilterConditionFormParams, IFilterConditionItem } from '../models/conditions';
|
|
2
|
-
import { RefRangeService } from '@univerjs/sheets';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
import { IDisposable, Injector } from '@wendellhu/redi';
|
|
5
|
-
import { SheetsFilterService, FilterColumn, FilterModel } from '@univerjs/sheets-filter';
|
|
6
1
|
import { Nullable, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { SheetsFilterService, FilterColumn, FilterModel } from '@univerjs/sheets-filter';
|
|
3
|
+
import { IDisposable, Injector } from '@wendellhu/redi';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { RefRangeService } from '@univerjs/sheets';
|
|
6
|
+
import { FilterOperator, IFilterConditionFormParams, IFilterConditionItem } from '../models/conditions';
|
|
7
7
|
|
|
8
8
|
export declare enum FilterBy {
|
|
9
9
|
VALUES = 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FilterPanel } from './SheetsFilterPanel';
|
|
2
|
-
import { Meta } from '@storybook/react';
|
|
3
1
|
import { default as React } from 'react';
|
|
2
|
+
import { Meta } from '@storybook/react';
|
|
3
|
+
import { FilterPanel } from './SheetsFilterPanel';
|
|
4
4
|
|
|
5
5
|
declare const meta: Meta<typeof FilterPanel>;
|
|
6
6
|
export default meta;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IMouseEvent, IPointerEvent, IShapeProps, Shape, UniverRenderingContext2D } from '@univerjs/engine-render';
|
|
2
1
|
import { ICommandService, IContextService, ThemeService } from '@univerjs/core';
|
|
2
|
+
import { IMouseEvent, IPointerEvent, IShapeProps, Shape, UniverRenderingContext2D } from '@univerjs/engine-render';
|
|
3
3
|
|
|
4
4
|
export declare const FILTER_ICON_SIZE = 16;
|
|
5
5
|
export declare const FILTER_ICON_PADDING = 1;
|