@univerjs/sheets-filter-ui 0.2.6 → 0.2.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 (31) hide show
  1. package/lib/cjs/index.js +2 -2
  2. package/lib/es/index.js +331 -238
  3. package/lib/types/__testing__/data.d.ts +0 -1
  4. package/lib/types/commands/commands/sheets-filter.command.d.ts +0 -1
  5. package/lib/types/commands/operations/sheets-filter.operation.d.ts +0 -1
  6. package/lib/types/controllers/sheets-filter-mobile-ui.controller.d.ts +0 -1
  7. package/lib/types/controllers/sheets-filter-permission.controller.d.ts +0 -1
  8. package/lib/types/controllers/sheets-filter-render.controller.d.ts +0 -1
  9. package/lib/types/controllers/sheets-filter-ui.controller.d.ts +1 -1
  10. package/lib/types/controllers/sheets-filter.menu.d.ts +0 -1
  11. package/lib/types/controllers/sheets-filter.shortcut.d.ts +0 -1
  12. package/lib/types/index.d.ts +1 -0
  13. package/lib/types/locale/en-US.d.ts +0 -1
  14. package/lib/types/locale/ru-RU.d.ts +0 -1
  15. package/lib/types/locale/vi-VN.d.ts +0 -1
  16. package/lib/types/locale/zh-TW.d.ts +0 -1
  17. package/lib/types/mobile-plugin.d.ts +0 -1
  18. package/lib/types/models/conditions.d.ts +0 -1
  19. package/lib/types/models/utils.d.ts +0 -1
  20. package/lib/types/plugin.d.ts +4 -4
  21. package/lib/types/services/sheets-filter-panel.service.d.ts +5 -8
  22. package/lib/types/views/components/SheetsFilterByConditionsPanel.d.ts +0 -1
  23. package/lib/types/views/components/SheetsFilterByValuesPanel.d.ts +0 -1
  24. package/lib/types/views/components/SheetsFilterPanel.d.ts +0 -1
  25. package/lib/types/views/components/SheetsFilterPanel.stories.d.ts +0 -1
  26. package/lib/types/views/widgets/drawings.d.ts +0 -1
  27. package/lib/types/views/widgets/filter-button.shape.d.ts +0 -1
  28. package/lib/types/worker/generate-filter-values.service.d.ts +31 -0
  29. package/lib/types/worker/plugin.d.ts +12 -0
  30. package/lib/umd/index.js +2 -2
  31. package/package.json +21 -20
@@ -1,5 +1,4 @@
1
1
  import { IWorkbookData } from '@univerjs/core';
2
-
3
2
  export declare function WithCustomFilterModelFactory(): IWorkbookData;
4
3
  export declare function WithValuesFilterModelFactory(): IWorkbookData;
5
4
  export declare function WithValuesAndEmptyFilterModelFactory(): IWorkbookData;
@@ -1,7 +1,6 @@
1
1
  import { ICommand, IMutationInfo, Nullable } from '@univerjs/core';
2
2
  import { ISheetCommandSharedParams } from '@univerjs/sheets';
3
3
  import { IAutoFilter, IFilterColumn } from '@univerjs/sheets-filter';
4
-
5
4
  /**
6
5
  * This command is for toggling filter in the currently active Worksheet.
7
6
  */
@@ -1,6 +1,5 @@
1
1
  import { IOperation } from '@univerjs/core';
2
2
  import { FilterBy } from '../../services/sheets-filter-panel.service';
3
-
4
3
  export declare const FILTER_PANEL_OPENED_KEY = "FILTER_PANEL_OPENED";
5
4
  export interface IOpenFilterPanelOperationParams {
6
5
  unitId: string;
@@ -1,6 +1,5 @@
1
1
  import { RxDisposable } from '@univerjs/core';
2
2
  import { IRenderManagerService } from '@univerjs/engine-render';
3
-
4
3
  export declare class SheetsFilterMobileUIController extends RxDisposable {
5
4
  private readonly _renderManagerService;
6
5
  constructor(_renderManagerService: IRenderManagerService);
@@ -2,7 +2,6 @@ import { Disposable, ICommandService, LocaleService } from '@univerjs/core';
2
2
  import { MenuConfig } from '@univerjs/ui';
3
3
  import { SheetPermissionInterceptorBaseController } from '@univerjs/sheets-ui';
4
4
  import { SheetsFilterService } from '@univerjs/sheets-filter';
5
-
6
5
  export interface IUniverSheetsFilterUIConfig {
7
6
  menu: MenuConfig;
8
7
  }
@@ -3,7 +3,6 @@ import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/
3
3
  import { SheetInterceptorService } from '@univerjs/sheets';
4
4
  import { SheetsFilterService } from '@univerjs/sheets-filter';
5
5
  import { ISheetSelectionRenderService, SheetSkeletonManagerService, SheetsRenderService } from '@univerjs/sheets-ui';
6
-
7
6
  export declare class SheetsFilterRenderController extends RxDisposable implements IRenderModule {
8
7
  private readonly _context;
9
8
  private readonly _injector;
@@ -5,9 +5,9 @@ import { IRenderManagerService } from '@univerjs/engine-render';
5
5
  import { SheetsFilterService } from '@univerjs/sheets-filter';
6
6
  import { SheetsFilterPanelService } from '../services/sheets-filter-panel.service';
7
7
  import { SheetsFilterMobileUIController } from './sheets-filter-mobile-ui.controller';
8
-
9
8
  export interface IUniverSheetsFilterUIConfig {
10
9
  menu: MenuConfig;
10
+ useRemoteFilterValuesGenerator?: boolean;
11
11
  }
12
12
  export declare const DefaultSheetFilterUiConfig: {};
13
13
  export declare const FILTER_PANEL_POPUP_KEY = "FILTER_PANEL_POPUP";
@@ -1,6 +1,5 @@
1
1
  import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
2
2
  import { IAccessor } from '@univerjs/core';
3
-
4
3
  export declare function SmartToggleFilterMenuItemFactory(accessor: IAccessor): IMenuSelectorItem;
5
4
  export declare function ClearFilterCriteriaMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
6
5
  export declare function ReCalcFilterMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
@@ -1,3 +1,2 @@
1
1
  import { IShortcutItem } from '@univerjs/ui';
2
-
3
2
  export declare const SmartToggleFilterShortcut: IShortcutItem;
@@ -15,5 +15,6 @@
15
15
  */
16
16
  export { UniverSheetsFilterUIPlugin } from './plugin';
17
17
  export { UniverSheetsFilterMobileUIPlugin } from './mobile-plugin';
18
+ export { UniverSheetsFilterUIWorkerPlugin } from './worker/plugin';
18
19
  export { SmartToggleSheetsFilterCommand, SetSheetsFilterCriteriaCommand, ClearSheetsFilterCriteriaCommand, ReCalcSheetsFilterCommand, } from './commands/commands/sheets-filter.command';
19
20
  export { OpenFilterPanelOperation, CloseFilterPanelOperation, ChangeFilterByOperation, type IOpenFilterPanelOperationParams, } from './commands/operations/sheets-filter.operation';
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,6 +1,5 @@
1
1
  import { Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
2
  import { IUniverSheetsFilterUIConfig } from './controllers/sheets-filter-ui.controller';
3
-
4
3
  export declare class UniverSheetsFilterMobileUIPlugin extends Plugin {
5
4
  private readonly _config;
6
5
  protected readonly _injector: Injector;
@@ -1,7 +1,6 @@
1
1
  import { Nullable } from '@univerjs/core';
2
2
  import { IFilterColumn, CustomFilterOperator } from '@univerjs/sheets-filter';
3
3
  import { ExtendCustomFilterOperator, OperatorOrder } from './extended-operators';
4
-
5
4
  export type FilterOperator = ExtendCustomFilterOperator | CustomFilterOperator;
6
5
  export interface IFilterConditionFormParams {
7
6
  and?: true;
@@ -1,5 +1,4 @@
1
1
  import { IFilterByValueItem } from '../services/sheets-filter-panel.service';
2
-
3
2
  export declare function statisticFilterByValueItems(items: IFilterByValueItem[]): {
4
3
  checked: number;
5
4
  unchecked: number;
@@ -1,12 +1,12 @@
1
- import { Injector, LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
1
+ import { Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
+ import { IRPCChannelService } from '@univerjs/rpc';
2
3
  import { IUniverSheetsFilterUIConfig } from './controllers/sheets-filter-ui.controller';
3
-
4
4
  export declare class UniverSheetsFilterUIPlugin extends Plugin {
5
5
  private readonly _config;
6
6
  protected readonly _injector: Injector;
7
- private readonly _localeService;
7
+ private readonly _rpcChannelService?;
8
8
  static type: UniverInstanceType;
9
9
  static pluginName: string;
10
- constructor(_config: Partial<IUniverSheetsFilterUIConfig>, _injector: Injector, _localeService: LocaleService);
10
+ constructor(_config: Partial<IUniverSheetsFilterUIConfig>, _injector: Injector, _rpcChannelService?: IRPCChannelService | undefined);
11
11
  onStarting(): void;
12
12
  }
@@ -1,9 +1,8 @@
1
- import { IDisposable, Nullable, Disposable, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
2
- import { SheetsFilterService, FilterColumn, FilterModel } from '@univerjs/sheets-filter';
1
+ import { IDisposable, Nullable, Disposable, ICommandService, Injector } from '@univerjs/core';
2
+ import { FilterColumn, FilterModel } from '@univerjs/sheets-filter';
3
3
  import { Observable } from 'rxjs';
4
4
  import { RefRangeService } from '@univerjs/sheets';
5
5
  import { FilterOperator, IFilterConditionFormParams, IFilterConditionItem } from '../models/conditions';
6
-
7
6
  export declare enum FilterBy {
8
7
  VALUES = 0,
9
8
  CONDITIONS = 1
@@ -44,8 +43,6 @@ export interface IFilterByModel extends IDisposable {
44
43
  */
45
44
  export declare class SheetsFilterPanelService extends Disposable {
46
45
  private readonly _injector;
47
- private _sheetsFilterService;
48
- private readonly _univerInstanceService;
49
46
  private readonly _refRangeService;
50
47
  private readonly _filterBy$;
51
48
  readonly filterBy$: Observable<FilterBy>;
@@ -62,9 +59,9 @@ export declare class SheetsFilterPanelService extends Disposable {
62
59
  private readonly _col$;
63
60
  readonly col$: Observable<number>;
64
61
  get col(): number;
65
- constructor(_injector: Injector, _sheetsFilterService: SheetsFilterService, _univerInstanceService: IUniverInstanceService, _refRangeService: RefRangeService);
62
+ constructor(_injector: Injector, _refRangeService: RefRangeService);
66
63
  dispose(): void;
67
- setupCol(filterModel: FilterModel, col: number): boolean;
64
+ setupCol(filterModel: FilterModel, col: number): void;
68
65
  changeFilterBy(filterBy: FilterBy): boolean;
69
66
  terminate(): boolean;
70
67
  private _filterHeaderListener;
@@ -150,7 +147,7 @@ export declare class ByValuesModel extends Disposable implements IFilterByModel
150
147
  *
151
148
  * @returns the model to control the panel's state
152
149
  */
153
- static fromFilterColumn(injector: Injector, filterModel: FilterModel, col: number): ByValuesModel;
150
+ static fromFilterColumn(injector: Injector, filterModel: FilterModel, col: number): Promise<ByValuesModel>;
154
151
  private readonly _rawFilterItems$;
155
152
  readonly rawFilterItems$: Observable<IFilterByValueItem[]>;
156
153
  get rawFilterItems(): IFilterByValueItem[];
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { ByConditionsModel } from '../../services/sheets-filter-panel.service';
3
-
4
3
  /**
5
4
  * Filter by conditions.
6
5
  */
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { ByValuesModel } from '../../services/sheets-filter-panel.service';
3
-
4
3
  /**
5
4
  * Filter by values.
6
5
  */
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  /**
4
3
  * This Filter Panel component is used to filter the data in the sheet.
5
4
  *
@@ -1,7 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { Meta } from '@storybook/react';
3
3
  import { FilterPanel } from './SheetsFilterPanel';
4
-
5
4
  declare const meta: Meta<typeof FilterPanel>;
6
5
  export default meta;
7
6
  export declare const FilterWithConditions: {
@@ -1,5 +1,4 @@
1
1
  import { UniverRenderingContext2D } from '@univerjs/engine-render';
2
-
3
2
  export declare const FILTER_BUTTON_EMPTY: Path2D;
4
3
  export declare class FilterButton {
5
4
  static drawNoCriteria(ctx: UniverRenderingContext2D, size: number, fgColor: string, bgColor: string): void;
@@ -1,6 +1,5 @@
1
1
  import { ICommandService, IContextService, ThemeService } from '@univerjs/core';
2
2
  import { IMouseEvent, IPointerEvent, IShapeProps, Shape, UniverRenderingContext2D } from '@univerjs/engine-render';
3
-
4
3
  export declare const FILTER_ICON_SIZE = 16;
5
4
  export declare const FILTER_ICON_PADDING = 1;
6
5
  export interface ISheetsFilterButtonShapeProps extends IShapeProps {
@@ -0,0 +1,31 @@
1
+ import { IRange, Worksheet, Disposable, ILogService, IUniverInstanceService, LocaleService } from '@univerjs/core';
2
+ import { IFilterByValueItem } from '../services/sheets-filter-panel.service';
3
+ export interface ISheetsGenerateFilterValuesService {
4
+ getFilterValues(params: {
5
+ unitId: string;
6
+ subUnitId: string;
7
+ filteredOutRowsByOtherColumns: number[];
8
+ filters: boolean;
9
+ blankChecked: boolean;
10
+ iterateRange: IRange;
11
+ alreadyChecked: string[];
12
+ }): Promise<IFilterByValueItem[]>;
13
+ }
14
+ export declare const SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME = "sheets-filter.generate-filter-values.service";
15
+ export declare const ISheetsGenerateFilterValuesService: import('@univerjs/core').IdentifierDecorator<ISheetsGenerateFilterValuesService>;
16
+ export declare class SheetsGenerateFilterValuesService extends Disposable {
17
+ private readonly _localeService;
18
+ private readonly _univerInstanceService;
19
+ private readonly _logService;
20
+ constructor(_localeService: LocaleService, _univerInstanceService: IUniverInstanceService, _logService: ILogService);
21
+ getFilterValues(params: {
22
+ unitId: string;
23
+ subUnitId: string;
24
+ filteredOutRowsByOtherColumns: number[];
25
+ filters: boolean;
26
+ blankChecked: boolean;
27
+ iterateRange: IRange;
28
+ alreadyChecked: string[];
29
+ }): Promise<IFilterByValueItem[]>;
30
+ }
31
+ export declare function getFilterByValueItems(filters: boolean, blankChecked: boolean, localeService: LocaleService, iterateRange: IRange, worksheet: Worksheet, alreadyChecked: Set<string>, filteredOutRowsByOtherColumns: Set<number>): IFilterByValueItem[];
@@ -0,0 +1,12 @@
1
+ import { Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
+ import { IRPCChannelService } from '@univerjs/rpc';
3
+ export declare class UniverSheetsFilterUIWorkerPlugin extends Plugin {
4
+ private readonly _config;
5
+ protected readonly _injector: Injector;
6
+ private readonly _rpcChannelService;
7
+ static type: UniverInstanceType;
8
+ static pluginName: string;
9
+ constructor(_config: unknown, _injector: Injector, _rpcChannelService: IRPCChannelService);
10
+ onStarting(): void;
11
+ onReady(): void;
12
+ }