@univerjs/sheets-filter-ui 0.4.2 → 0.5.0-beta.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/cjs/index.js +3 -8
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/index.js +1422 -2985
- package/lib/{locale/en-US.json → es/locale/en-US.js} +36 -19
- package/lib/{locale/fa-IR.json → es/locale/fa-IR.js} +36 -19
- package/lib/{locale/ru-RU.json → es/locale/ru-RU.js} +36 -19
- package/lib/{locale/vi-VN.json → es/locale/vi-VN.js} +36 -19
- package/lib/{locale/zh-CN.json → es/locale/zh-CN.js} +36 -19
- package/lib/{locale/zh-TW.json → es/locale/zh-TW.js} +36 -19
- package/lib/index.css +1 -1
- package/lib/types/__testing__/data.d.ts +60 -9
- package/lib/types/controllers/sheets-filter-permission.controller.d.ts +1 -1
- package/lib/types/controllers/sheets-filter-ui-desktop.controller.d.ts +2 -2
- package/lib/types/controllers/sheets-filter.menu.d.ts +1 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/locale/zh-CN.d.ts +14 -0
- package/lib/types/models/utils.d.ts +4 -4
- package/lib/types/services/sheets-filter-panel.service.d.ts +20 -9
- package/lib/types/services/util.d.ts +5 -0
- package/lib/types/views/components/SheetsFilterPanel.stories.d.ts +1 -1
- package/lib/types/views/render-modules/sheets-filter.render-controller.d.ts +3 -0
- package/lib/types/worker/generate-filter-values.service.d.ts +14 -4
- package/lib/umd/index.js +3 -8
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +31 -23
- package/lib/types/commands/commands/sheets-filter.command.d.ts +0 -57
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
2
1
|
import { IAccessor } from '@univerjs/core';
|
|
2
|
+
import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
3
3
|
export declare function SmartToggleFilterMenuItemFactory(accessor: IAccessor): IMenuSelectorItem;
|
|
4
4
|
export declare function ClearFilterCriteriaMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
5
5
|
export declare function ReCalcFilterMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -16,5 +16,4 @@
|
|
|
16
16
|
export { UniverSheetsFilterUIPlugin } from './filter-ui-desktop.plugin';
|
|
17
17
|
export { UniverSheetsFilterMobileUIPlugin } from './filter-ui-mobile.plugin';
|
|
18
18
|
export { UniverSheetsFilterUIWorkerPlugin } from './worker/plugin';
|
|
19
|
-
export { ClearSheetsFilterCriteriaCommand, type ISetSheetFilterRangeCommandParams, type ISetSheetsFilterCriteriaCommandParams, ReCalcSheetsFilterCommand, RemoveSheetFilterCommand, SetSheetFilterRangeCommand, SetSheetsFilterCriteriaCommand, SmartToggleSheetsFilterCommand, } from './commands/commands/sheets-filter.command';
|
|
20
19
|
export { ChangeFilterByOperation, CloseFilterPanelOperation, type IOpenFilterPanelOperationParams, OpenFilterPanelOperation, } from './commands/operations/sheets-filter.operation';
|
|
@@ -64,6 +64,20 @@ declare const locale: {
|
|
|
64
64
|
msg: {
|
|
65
65
|
'filter-header-forbidden': string;
|
|
66
66
|
};
|
|
67
|
+
date: {
|
|
68
|
+
1: string;
|
|
69
|
+
2: string;
|
|
70
|
+
3: string;
|
|
71
|
+
4: string;
|
|
72
|
+
5: string;
|
|
73
|
+
6: string;
|
|
74
|
+
7: string;
|
|
75
|
+
8: string;
|
|
76
|
+
9: string;
|
|
77
|
+
10: string;
|
|
78
|
+
11: string;
|
|
79
|
+
12: string;
|
|
80
|
+
};
|
|
67
81
|
};
|
|
68
82
|
};
|
|
69
83
|
export default locale;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function statisticFilterByValueItems(items:
|
|
1
|
+
import { IFilterByValueWithTreeItem } from '../services/sheets-filter-panel.service';
|
|
2
|
+
export declare function statisticFilterByValueItems(items: IFilterByValueWithTreeItem[]): {
|
|
3
3
|
checked: number;
|
|
4
4
|
unchecked: number;
|
|
5
|
-
checkedItems:
|
|
6
|
-
uncheckedItems:
|
|
5
|
+
checkedItems: IFilterByValueWithTreeItem[];
|
|
6
|
+
uncheckedItems: IFilterByValueWithTreeItem[];
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IDisposable, Nullable, Disposable, ICommandService, Injector } from '@univerjs/core';
|
|
2
2
|
import { FilterColumn, FilterModel } from '@univerjs/sheets-filter';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
import { RefRangeService } from '@univerjs/sheets';
|
|
5
4
|
import { FilterOperator, IFilterConditionFormParams, IFilterConditionItem } from '../models/conditions';
|
|
5
|
+
import { RefRangeService } from '@univerjs/sheets';
|
|
6
6
|
export declare enum FilterBy {
|
|
7
7
|
VALUES = 0,
|
|
8
8
|
CONDITIONS = 1
|
|
@@ -17,6 +17,15 @@ export interface IFilterByValueItem {
|
|
|
17
17
|
*/
|
|
18
18
|
isEmpty: boolean;
|
|
19
19
|
}
|
|
20
|
+
export interface IFilterByValueWithTreeItem {
|
|
21
|
+
title: string;
|
|
22
|
+
key: string;
|
|
23
|
+
count: number;
|
|
24
|
+
checked: boolean;
|
|
25
|
+
leaf: boolean;
|
|
26
|
+
originValues?: Set<string>;
|
|
27
|
+
children?: IFilterByValueWithTreeItem[];
|
|
28
|
+
}
|
|
20
29
|
export interface ISheetsFilterPanelService {
|
|
21
30
|
/**
|
|
22
31
|
* Set up the panel to change the filter condition on a specific column.
|
|
@@ -149,11 +158,13 @@ export declare class ByValuesModel extends Disposable implements IFilterByModel
|
|
|
149
158
|
*/
|
|
150
159
|
static fromFilterColumn(injector: Injector, filterModel: FilterModel, col: number): Promise<ByValuesModel>;
|
|
151
160
|
private readonly _rawFilterItems$;
|
|
152
|
-
readonly rawFilterItems$: Observable<
|
|
153
|
-
get rawFilterItems():
|
|
154
|
-
readonly filterItems$: Observable<
|
|
161
|
+
readonly rawFilterItems$: Observable<IFilterByValueWithTreeItem[]>;
|
|
162
|
+
get rawFilterItems(): IFilterByValueWithTreeItem[];
|
|
163
|
+
readonly filterItems$: Observable<IFilterByValueWithTreeItem[]>;
|
|
155
164
|
private _filterItems;
|
|
156
|
-
get filterItems():
|
|
165
|
+
get filterItems(): IFilterByValueWithTreeItem[];
|
|
166
|
+
private _treeMapCache;
|
|
167
|
+
get treeMapCache(): Map<string, string[]>;
|
|
157
168
|
readonly canApply$: Observable<boolean>;
|
|
158
169
|
private readonly _manuallyUpdateFilterItems$;
|
|
159
170
|
private readonly _searchString$;
|
|
@@ -163,16 +174,16 @@ export declare class ByValuesModel extends Disposable implements IFilterByModel
|
|
|
163
174
|
* Filter items would remain unchanged after we create them,
|
|
164
175
|
* though data may change after.
|
|
165
176
|
*/
|
|
166
|
-
items:
|
|
177
|
+
items: IFilterByValueWithTreeItem[], cache: Map<string, string[]>, _commandService: ICommandService);
|
|
167
178
|
dispose(): void;
|
|
168
179
|
deltaCol(offset: number): void;
|
|
169
180
|
setSearchString(str: string): void;
|
|
181
|
+
onCheckAllToggled(checked: boolean): void;
|
|
170
182
|
/**
|
|
171
183
|
* Toggle a filter item.
|
|
172
184
|
*/
|
|
173
|
-
onFilterCheckToggled(item:
|
|
174
|
-
onFilterOnly(
|
|
175
|
-
onCheckAllToggled(checked: boolean): void;
|
|
185
|
+
onFilterCheckToggled(item: IFilterByValueWithTreeItem): void;
|
|
186
|
+
onFilterOnly(itemKeys: string[]): void;
|
|
176
187
|
private _manuallyUpdateFilterItems;
|
|
177
188
|
clear(): Promise<boolean>;
|
|
178
189
|
/**
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IFilterByValueWithTreeItem } from './sheets-filter-panel.service';
|
|
2
|
+
export declare function findObjectByKey(data: IFilterByValueWithTreeItem[], targetKey: string): IFilterByValueWithTreeItem | null;
|
|
3
|
+
export declare function areAllLeafNodesChecked(node: IFilterByValueWithTreeItem): boolean;
|
|
4
|
+
export declare function updateLeafNodesCheckedStatus(node: IFilterByValueWithTreeItem, status?: boolean): void;
|
|
5
|
+
export declare function searchTree(items: IFilterByValueWithTreeItem[], searchKeywords: string[]): IFilterByValueWithTreeItem[];
|
|
@@ -3,6 +3,9 @@ import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
|
3
3
|
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
4
4
|
import { SheetsFilterService } from '@univerjs/sheets-filter';
|
|
5
5
|
import { ISheetSelectionRenderService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
|
|
6
|
+
/**
|
|
7
|
+
* Show selected range in filter.
|
|
8
|
+
*/
|
|
6
9
|
export declare class SheetsFilterRenderController extends RxDisposable implements IRenderModule {
|
|
7
10
|
private readonly _context;
|
|
8
11
|
private readonly _injector;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IRange, Worksheet, Disposable, ILogService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
2
|
-
import { IFilterByValueItem } from '../services/sheets-filter-panel.service';
|
|
1
|
+
import { IRange, Styles, Worksheet, Disposable, ILogService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
2
|
+
import { IFilterByValueItem, IFilterByValueWithTreeItem } from '../services/sheets-filter-panel.service';
|
|
3
3
|
export interface ISheetsGenerateFilterValuesService {
|
|
4
4
|
getFilterValues(params: {
|
|
5
5
|
unitId: string;
|
|
@@ -9,7 +9,10 @@ export interface ISheetsGenerateFilterValuesService {
|
|
|
9
9
|
blankChecked: boolean;
|
|
10
10
|
iterateRange: IRange;
|
|
11
11
|
alreadyChecked: string[];
|
|
12
|
-
}): Promise<
|
|
12
|
+
}): Promise<{
|
|
13
|
+
filterTreeItems: IFilterByValueWithTreeItem[];
|
|
14
|
+
filterTreeMapCache: Map<string, string[]>;
|
|
15
|
+
}>;
|
|
13
16
|
}
|
|
14
17
|
export declare const SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME = "sheets-filter.generate-filter-values.service";
|
|
15
18
|
export declare const ISheetsGenerateFilterValuesService: import('@wendellhu/redi').IdentifierDecorator<ISheetsGenerateFilterValuesService>;
|
|
@@ -26,6 +29,13 @@ export declare class SheetsGenerateFilterValuesService extends Disposable {
|
|
|
26
29
|
blankChecked: boolean;
|
|
27
30
|
iterateRange: IRange;
|
|
28
31
|
alreadyChecked: string[];
|
|
29
|
-
}): Promise<
|
|
32
|
+
}): Promise<never[] | {
|
|
33
|
+
filterTreeItems: IFilterByValueWithTreeItem[];
|
|
34
|
+
filterTreeMapCache: Map<string, string[]>;
|
|
35
|
+
}>;
|
|
30
36
|
}
|
|
31
37
|
export declare function getFilterByValueItems(filters: boolean, blankChecked: boolean, localeService: LocaleService, iterateRange: IRange, worksheet: Worksheet, alreadyChecked: Set<string>, filteredOutRowsByOtherColumns: Set<number>): IFilterByValueItem[];
|
|
38
|
+
export declare function getFilterTreeByValueItems(filters: boolean, localeService: LocaleService, iterateRange: IRange, worksheet: Worksheet, filteredOutRowsByOtherColumns: Set<number>, alreadyChecked: Set<string>, blankChecked: boolean, styles: Styles): {
|
|
39
|
+
filterTreeItems: IFilterByValueWithTreeItem[];
|
|
40
|
+
filterTreeMapCache: Map<string, string[]>;
|
|
41
|
+
};
|