@univerjs/sheets-filter-ui 1.3.1 → 1.5.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/README.md +18 -7
- package/lib/cjs/config-BF97qkoE.js +309 -0
- package/lib/cjs/index.js +217 -465
- package/lib/cjs/locale/ar-SA.js +1 -2
- package/lib/cjs/locale/ca-ES.js +1 -2
- package/lib/cjs/locale/de-DE.js +1 -2
- package/lib/cjs/locale/en-US.js +1 -2
- package/lib/cjs/locale/es-ES.js +1 -2
- package/lib/cjs/locale/fa-IR.js +1 -2
- package/lib/cjs/locale/fr-FR.js +1 -2
- package/lib/cjs/locale/id-ID.js +1 -2
- package/lib/cjs/locale/it-IT.js +1 -2
- package/lib/cjs/locale/ja-JP.js +1 -2
- package/lib/cjs/locale/ko-KR.js +1 -2
- package/lib/cjs/locale/pl-PL.js +1 -2
- package/lib/cjs/locale/pt-BR.js +1 -2
- package/lib/cjs/locale/ru-RU.js +1 -2
- package/lib/cjs/locale/sk-SK.js +1 -2
- package/lib/cjs/locale/vi-VN.js +1 -2
- package/lib/cjs/locale/zh-CN.js +1 -2
- package/lib/cjs/locale/zh-HK.js +1 -2
- package/lib/cjs/locale/zh-TW.js +1 -2
- package/lib/cjs/worker.js +39 -0
- package/lib/config-CbqvVwlO.js +244 -0
- package/lib/es/config-CbqvVwlO.js +244 -0
- package/lib/es/index.js +110 -352
- package/lib/es/locale/ar-SA.js +1 -2
- package/lib/es/locale/ca-ES.js +1 -2
- package/lib/es/locale/de-DE.js +1 -2
- package/lib/es/locale/en-US.js +1 -2
- package/lib/es/locale/es-ES.js +1 -2
- package/lib/es/locale/fa-IR.js +1 -2
- package/lib/es/locale/fr-FR.js +1 -2
- package/lib/es/locale/id-ID.js +1 -2
- package/lib/es/locale/it-IT.js +1 -2
- package/lib/es/locale/ja-JP.js +1 -2
- package/lib/es/locale/ko-KR.js +1 -2
- package/lib/es/locale/pl-PL.js +1 -2
- package/lib/es/locale/pt-BR.js +1 -2
- package/lib/es/locale/ru-RU.js +1 -2
- package/lib/es/locale/sk-SK.js +1 -2
- package/lib/es/locale/vi-VN.js +1 -2
- package/lib/es/locale/zh-CN.js +1 -2
- package/lib/es/locale/zh-HK.js +1 -2
- package/lib/es/locale/zh-TW.js +1 -2
- package/lib/es/worker.js +33 -0
- package/lib/index.js +110 -352
- package/lib/locale/ar-SA.js +1 -2
- package/lib/locale/ca-ES.js +1 -2
- package/lib/locale/de-DE.js +1 -2
- package/lib/locale/en-US.js +1 -2
- package/lib/locale/es-ES.js +1 -2
- package/lib/locale/fa-IR.js +1 -2
- package/lib/locale/fr-FR.js +1 -2
- package/lib/locale/id-ID.js +1 -2
- package/lib/locale/it-IT.js +1 -2
- package/lib/locale/ja-JP.js +1 -2
- package/lib/locale/ko-KR.js +1 -2
- package/lib/locale/pl-PL.js +1 -2
- package/lib/locale/pt-BR.js +1 -2
- package/lib/locale/ru-RU.js +1 -2
- package/lib/locale/sk-SK.js +1 -2
- package/lib/locale/vi-VN.js +1 -2
- package/lib/locale/zh-CN.js +1 -2
- package/lib/locale/zh-HK.js +1 -2
- package/lib/locale/zh-TW.js +1 -2
- package/lib/types/__tests__/data.d.ts +2 -2
- package/lib/types/index.d.ts +0 -1
- package/lib/types/services/sheets-filter-panel.service.d.ts +1 -1
- package/lib/types/worker/generate-filter-values.service.d.ts +1 -1
- package/lib/types/worker.d.ts +16 -0
- package/lib/umd/index.js +5 -5
- package/lib/worker.js +33 -0
- package/package.json +21 -16
package/lib/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as _defineProperty, d as __decorateParam, i as version, l as getFilterTreeByValueItems, n as defaultPluginConfig, o as ISheetsGenerateFilterValuesService, r as name, s as SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME, t as SHEETS_FILTER_UI_PLUGIN_CONFIG_KEY, u as __decorate } from "./config-CbqvVwlO.js";
|
|
2
|
+
import { BooleanNumber, ColorKit, CommandType, DependentOn, Disposable, ICommandService, IConfigService, IContextService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, LocaleService, Optional, Plugin, Quantity, RxDisposable, SheetTypes, ThemeService, Tools, UniverInstanceType, VerticalAlign, createIdentifier, fromCallback, merge, registerDependencies, touchDependencies } from "@univerjs/core";
|
|
2
3
|
import { ClearSheetsFilterCriteriaCommand, CustomFilterOperator, FILTER_MUTATIONS, FilterBy, ReCalcSheetsFilterCommand, ReCalcSheetsFilterMutation, RemoveSheetsFilterMutation, SetSheetsFilterCriteriaCommand, SetSheetsFilterCriteriaMutation, SetSheetsFilterRangeMutation, SheetsFilterService, SheetsFilterSyncController, SmartToggleSheetsFilterCommand, UniverSheetsFilterPlugin } from "@univerjs/sheets-filter";
|
|
3
|
-
import { IEditorBridgeService, ISheetSelectionRenderService, SelectionControl, SetCellEditVisibleOperation, SheetCanvasPopManagerService, SheetSkeletonManagerService, SheetsRenderService, SheetsUIPart, UniverSheetsMobileUIPlugin, UniverSheetsUIPlugin, getCoordByCell, getCurrentRangeDisable$, getObservableWithExclusiveRange$, whenSheetEditorFocused } from "@univerjs/sheets-ui";
|
|
4
|
+
import { IEditorBridgeService, ISheetSelectionRenderService, SelectionControl, SetCellEditVisibleOperation, SheetCanvasPopManagerService, SheetSkeletonManagerService, SheetsRenderService, SheetsUIPart, UniverSheetsMobileUIPlugin, UniverSheetsUIPlugin, deriveStateFromActiveSheet$, getCoordByCell, getCurrentRangeDisable$, getObservableWithExclusiveRange$, whenSheetEditorFocused } from "@univerjs/sheets-ui";
|
|
4
5
|
import { BuiltInUIPart, ComponentContainer, ComponentManager, ILayoutService, IMenuManagerService, IMessageService, IShortcutService, IUIPartsService, IconManager, KeyCode, MenuItemType, MetaKeys, MobileDrawer, RibbonDataGroup, UniverMobileUIPlugin, connectInjector, getMenuHiddenObservable, useComponentsOfPart, useDependency, useObservable } from "@univerjs/ui";
|
|
5
6
|
import { COLOR_BLACK_RGB, IRenderManagerService, Rect, Shape, UniverRenderEnginePlugin } from "@univerjs/engine-render";
|
|
6
7
|
import { INTERCEPTOR_POINT, RangeProtectionPermissionViewPoint, RefRangeService, SetRangeValuesMutation, SheetInterceptorService, SheetPermissionCheckController, SheetsSelectionsService, UniverSheetsPlugin, WorksheetFilterPermission, WorksheetViewPermission, attachSelectionWithCoord, expandToContinuousRange, getSheetCommandTarget } from "@univerjs/sheets";
|
|
@@ -9,9 +10,9 @@ import { AIcon, BanIcon, CheckMarkIcon, CloseIcon, FilterIcon, InfoIcon, MoreLef
|
|
|
9
10
|
import { Button, Checkbox, Input, MessageType, MobileActionRow, MobileActionRowGroup, MobileSelect, Radio, RadioGroup, Segmented, Select, Switch, Tooltip, Tree, borderClassName, clsx, resetButtonClassName } from "@univerjs/design";
|
|
10
11
|
import { useCallback, useRef, useState } from "react";
|
|
11
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { IRPCChannelService,
|
|
13
|
+
import { IRPCChannelService, toModule } from "@univerjs/rpc";
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
// src/models/conditions.ts
|
|
15
16
|
let FilterConditionItems;
|
|
16
17
|
(function(_FilterConditionItems) {
|
|
17
18
|
const NONE = _FilterConditionItems.NONE = {
|
|
@@ -571,8 +572,7 @@ function getOnlyOperatorAndVal(mapParams) {
|
|
|
571
572
|
return operator1 ? [operator1, val1] : [operator2, val2];
|
|
572
573
|
}
|
|
573
574
|
|
|
574
|
-
|
|
575
|
-
//#region src/models/utils.ts
|
|
575
|
+
// src/models/utils.ts
|
|
576
576
|
function statisticFilterByValueItems(items) {
|
|
577
577
|
const checkedItems = [];
|
|
578
578
|
const uncheckedItems = [];
|
|
@@ -599,204 +599,7 @@ function statisticFilterByValueItems(items) {
|
|
|
599
599
|
};
|
|
600
600
|
}
|
|
601
601
|
|
|
602
|
-
|
|
603
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
604
|
-
function __decorateParam(paramIndex, decorator) {
|
|
605
|
-
return function(target, key) {
|
|
606
|
-
decorator(target, key, paramIndex);
|
|
607
|
-
};
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
//#endregion
|
|
611
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
612
|
-
function __decorate(decorators, target, key, desc) {
|
|
613
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
614
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
615
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
616
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
//#endregion
|
|
620
|
-
//#region src/worker/generate-filter-values.service.ts
|
|
621
|
-
const SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME = "sheets-filter.generate-filter-values.service";
|
|
622
|
-
const ISheetsGenerateFilterValuesService = createIdentifier(SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME);
|
|
623
|
-
let SheetsGenerateFilterValuesService = class SheetsGenerateFilterValuesService extends Disposable {
|
|
624
|
-
constructor(_localeService, _univerInstanceService, _logService) {
|
|
625
|
-
super();
|
|
626
|
-
this._localeService = _localeService;
|
|
627
|
-
this._univerInstanceService = _univerInstanceService;
|
|
628
|
-
this._logService = _logService;
|
|
629
|
-
}
|
|
630
|
-
async getFilterValues(params) {
|
|
631
|
-
var _this$_univerInstance;
|
|
632
|
-
const { unitId, subUnitId, filteredOutRowsByOtherColumns, filterColumn, filters, blankChecked, iterateRange, alreadyChecked } = params;
|
|
633
|
-
const workbook = this._univerInstanceService.getUnit(unitId);
|
|
634
|
-
const worksheet = (_this$_univerInstance = this._univerInstanceService.getUnit(unitId)) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getSheetBySheetId(subUnitId);
|
|
635
|
-
if (!workbook || !worksheet) return [];
|
|
636
|
-
this._logService.debug("[SheetsGenerateFilterValuesService]", "getFilterValues for", {
|
|
637
|
-
unitId,
|
|
638
|
-
subUnitId
|
|
639
|
-
});
|
|
640
|
-
return getFilterTreeByValueItems(filters, this._localeService, iterateRange, worksheet, new Set(filteredOutRowsByOtherColumns), filterColumn, new Set(alreadyChecked.map(String)), blankChecked, workbook.getStyles());
|
|
641
|
-
}
|
|
642
|
-
};
|
|
643
|
-
SheetsGenerateFilterValuesService = __decorate([
|
|
644
|
-
__decorateParam(0, Inject(LocaleService)),
|
|
645
|
-
__decorateParam(1, IUniverInstanceService),
|
|
646
|
-
__decorateParam(2, ILogService)
|
|
647
|
-
], SheetsGenerateFilterValuesService);
|
|
648
|
-
function getFilterTreeByValueItems(filters, localeService, iterateRange, worksheet, filteredOutRowsByOtherColumns, filterColumn, alreadyChecked, blankChecked, styles) {
|
|
649
|
-
var _filterColumn$filtere;
|
|
650
|
-
const items = /* @__PURE__ */ new Map();
|
|
651
|
-
const treeMap = /* @__PURE__ */ new Map();
|
|
652
|
-
const DefaultPattern = "yyyy-mm-dd";
|
|
653
|
-
const EmptyKey = "empty";
|
|
654
|
-
const isNeedClearCheckedStatus = !filters && ((filterColumn === null || filterColumn === void 0 ? void 0 : filterColumn.filterBy) === FilterBy.COLORS || (filterColumn === null || filterColumn === void 0 ? void 0 : filterColumn.filterBy) === FilterBy.CONDITIONS) && ((_filterColumn$filtere = filterColumn.filteredOutRows) === null || _filterColumn$filtere === void 0 ? void 0 : _filterColumn$filtere.size);
|
|
655
|
-
let emptyCount = 0;
|
|
656
|
-
for (const cell of worksheet.iterateByColumn(iterateRange, false, false)) {
|
|
657
|
-
const { row, rowSpan = 1 } = cell;
|
|
658
|
-
let rowIndex = 0;
|
|
659
|
-
while (rowIndex < rowSpan) {
|
|
660
|
-
var _cell$value, _styles$get, _cell$value2;
|
|
661
|
-
const targetRow = row + rowIndex;
|
|
662
|
-
if (filteredOutRowsByOtherColumns.has(targetRow)) {
|
|
663
|
-
rowIndex++;
|
|
664
|
-
continue;
|
|
665
|
-
}
|
|
666
|
-
const value = (cell === null || cell === void 0 ? void 0 : cell.value) ? extractPureTextFromCell(cell.value) : "";
|
|
667
|
-
if (!value) {
|
|
668
|
-
emptyCount += 1;
|
|
669
|
-
rowIndex += rowSpan;
|
|
670
|
-
continue;
|
|
671
|
-
}
|
|
672
|
-
const fmtStr = ((_cell$value = cell.value) === null || _cell$value === void 0 ? void 0 : _cell$value.v) && !cell.value.p ? (_styles$get = styles.get((_cell$value2 = cell.value) === null || _cell$value2 === void 0 ? void 0 : _cell$value2.s)) === null || _styles$get === void 0 || (_styles$get = _styles$get.n) === null || _styles$get === void 0 ? void 0 : _styles$get.pattern : "";
|
|
673
|
-
const isDateValue = fmtStr && numfmt.getFormatInfo(fmtStr).isDate;
|
|
674
|
-
let isIncludeDatePart = false;
|
|
675
|
-
if (isDateValue) {
|
|
676
|
-
const { year, month, day } = numfmt.getFormatDateInfo(fmtStr);
|
|
677
|
-
isIncludeDatePart = year || month || day;
|
|
678
|
-
}
|
|
679
|
-
if (fmtStr && isDateValue && isIncludeDatePart) {
|
|
680
|
-
var _worksheet$getCellRaw, _yearItem$children, _monthItem$children;
|
|
681
|
-
const originValue = (_worksheet$getCellRaw = worksheet.getCellRaw(cell.row, cell.col)) === null || _worksheet$getCellRaw === void 0 ? void 0 : _worksheet$getCellRaw.v;
|
|
682
|
-
if (!originValue) {
|
|
683
|
-
rowIndex++;
|
|
684
|
-
continue;
|
|
685
|
-
}
|
|
686
|
-
const [year, month, day] = numfmt.format(DefaultPattern, Number(originValue)).split("-").map(Number);
|
|
687
|
-
let yearItem = items.get(`${year}`);
|
|
688
|
-
if (!yearItem) {
|
|
689
|
-
yearItem = {
|
|
690
|
-
title: `${year}`,
|
|
691
|
-
key: `${year}`,
|
|
692
|
-
children: [],
|
|
693
|
-
count: 0,
|
|
694
|
-
leaf: false,
|
|
695
|
-
checked: false
|
|
696
|
-
};
|
|
697
|
-
items.set(`${year}`, yearItem);
|
|
698
|
-
treeMap.set(`${year}`, [`${year}`]);
|
|
699
|
-
}
|
|
700
|
-
let monthItem = (_yearItem$children = yearItem.children) === null || _yearItem$children === void 0 ? void 0 : _yearItem$children.find((item) => item.key === `${year}-${month}`);
|
|
701
|
-
if (!monthItem) {
|
|
702
|
-
var _yearItem$children2;
|
|
703
|
-
monthItem = {
|
|
704
|
-
title: localeService.t(`sheets-filter-ui.date.${month}`),
|
|
705
|
-
key: `${year}-${month}`,
|
|
706
|
-
children: [],
|
|
707
|
-
count: 0,
|
|
708
|
-
leaf: false,
|
|
709
|
-
checked: false
|
|
710
|
-
};
|
|
711
|
-
(_yearItem$children2 = yearItem.children) === null || _yearItem$children2 === void 0 || _yearItem$children2.push(monthItem);
|
|
712
|
-
treeMap.set(`${year}-${month}`, [`${year}`, `${year}-${month}`]);
|
|
713
|
-
}
|
|
714
|
-
const dayItem = monthItem === null || monthItem === void 0 || (_monthItem$children = monthItem.children) === null || _monthItem$children === void 0 ? void 0 : _monthItem$children.find((item) => item.key === `${year}-${month}-${day}`);
|
|
715
|
-
if (!dayItem) {
|
|
716
|
-
var _monthItem$children2;
|
|
717
|
-
(_monthItem$children2 = monthItem.children) === null || _monthItem$children2 === void 0 || _monthItem$children2.push({
|
|
718
|
-
title: `${day}`,
|
|
719
|
-
key: `${year}-${month}-${day}`,
|
|
720
|
-
count: 1,
|
|
721
|
-
originValues: /* @__PURE__ */ new Set([value]),
|
|
722
|
-
leaf: true,
|
|
723
|
-
checked: isNeedClearCheckedStatus ? false : alreadyChecked.size ? alreadyChecked.has(value) : !blankChecked
|
|
724
|
-
});
|
|
725
|
-
monthItem.count++;
|
|
726
|
-
yearItem.count++;
|
|
727
|
-
treeMap.set(`${year}-${month}-${day}`, [
|
|
728
|
-
`${year}`,
|
|
729
|
-
`${year}-${month}`,
|
|
730
|
-
`${year}-${month}-${day}`
|
|
731
|
-
]);
|
|
732
|
-
} else {
|
|
733
|
-
dayItem.originValues.add(value);
|
|
734
|
-
dayItem.count++;
|
|
735
|
-
monthItem.count++;
|
|
736
|
-
yearItem.count++;
|
|
737
|
-
}
|
|
738
|
-
} else {
|
|
739
|
-
const key = value;
|
|
740
|
-
let item = items.get(key);
|
|
741
|
-
if (!item) {
|
|
742
|
-
item = {
|
|
743
|
-
title: value,
|
|
744
|
-
leaf: true,
|
|
745
|
-
checked: isNeedClearCheckedStatus ? false : alreadyChecked.size ? alreadyChecked.has(value) : !blankChecked,
|
|
746
|
-
key,
|
|
747
|
-
count: 1
|
|
748
|
-
};
|
|
749
|
-
items.set(key, item);
|
|
750
|
-
treeMap.set(key, [key]);
|
|
751
|
-
} else item.count++;
|
|
752
|
-
}
|
|
753
|
-
rowIndex++;
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
const initialBlankChecked = isNeedClearCheckedStatus ? false : filters ? blankChecked : true;
|
|
757
|
-
if (emptyCount > 0) {
|
|
758
|
-
const item = {
|
|
759
|
-
title: localeService.t("sheets-filter-ui.panel.empty"),
|
|
760
|
-
count: emptyCount,
|
|
761
|
-
leaf: true,
|
|
762
|
-
checked: initialBlankChecked,
|
|
763
|
-
key: EmptyKey
|
|
764
|
-
};
|
|
765
|
-
items.set("empty", item);
|
|
766
|
-
treeMap.set("empty", [EmptyKey]);
|
|
767
|
-
}
|
|
768
|
-
return {
|
|
769
|
-
filterTreeItems: generateFilterTreeBySort(Array.from(items.values())),
|
|
770
|
-
filterTreeMapCache: treeMap
|
|
771
|
-
};
|
|
772
|
-
}
|
|
773
|
-
function generateFilterTreeBySort(tree) {
|
|
774
|
-
return Array.from(tree).sort((a, b) => {
|
|
775
|
-
if (a.children && !b.children) return -1;
|
|
776
|
-
if (!a.children && b.children) return 1;
|
|
777
|
-
return compare(a.title, b.title);
|
|
778
|
-
}).map((yearItem) => {
|
|
779
|
-
if (yearItem.children) yearItem.children.sort((a, b) => {
|
|
780
|
-
return Number.parseInt(a.key.split("-")[1], 10) - Number.parseInt(b.key.split("-")[1], 10);
|
|
781
|
-
}).forEach((monthItem) => {
|
|
782
|
-
if (monthItem.children) monthItem.children.sort((a, b) => {
|
|
783
|
-
return Number.parseInt(a.key.split("-")[2], 10) - Number.parseInt(b.key.split("-")[2], 10);
|
|
784
|
-
});
|
|
785
|
-
});
|
|
786
|
-
return yearItem;
|
|
787
|
-
});
|
|
788
|
-
}
|
|
789
|
-
function compare(strA, strB) {
|
|
790
|
-
const aIsNumeric = isNumeric(strA);
|
|
791
|
-
const bIsNumeric = isNumeric(strB);
|
|
792
|
-
if (aIsNumeric && bIsNumeric) return Number.parseFloat(strA) - Number.parseFloat(strB);
|
|
793
|
-
else if (aIsNumeric && !bIsNumeric) return -1;
|
|
794
|
-
else if (!aIsNumeric && bIsNumeric) return 1;
|
|
795
|
-
else return strA.localeCompare(strB);
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
//#endregion
|
|
799
|
-
//#region src/services/util.ts
|
|
602
|
+
// src/services/util.ts
|
|
800
603
|
function findObjectByKey(data, targetKey) {
|
|
801
604
|
for (const node of data) {
|
|
802
605
|
if (node.key === targetKey) return node;
|
|
@@ -839,50 +642,7 @@ function searchTree(items, searchKeywords) {
|
|
|
839
642
|
return result;
|
|
840
643
|
}
|
|
841
644
|
|
|
842
|
-
|
|
843
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
844
|
-
function _typeof(o) {
|
|
845
|
-
"@babel/helpers - typeof";
|
|
846
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
847
|
-
return typeof o;
|
|
848
|
-
} : function(o) {
|
|
849
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
850
|
-
}, _typeof(o);
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
//#endregion
|
|
854
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
855
|
-
function toPrimitive(t, r) {
|
|
856
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
857
|
-
var e = t[Symbol.toPrimitive];
|
|
858
|
-
if (void 0 !== e) {
|
|
859
|
-
var i = e.call(t, r || "default");
|
|
860
|
-
if ("object" != _typeof(i)) return i;
|
|
861
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
862
|
-
}
|
|
863
|
-
return ("string" === r ? String : Number)(t);
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
//#endregion
|
|
867
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
868
|
-
function toPropertyKey(t) {
|
|
869
|
-
var i = toPrimitive(t, "string");
|
|
870
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
//#endregion
|
|
874
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
875
|
-
function _defineProperty(e, r, t) {
|
|
876
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
877
|
-
value: t,
|
|
878
|
-
enumerable: !0,
|
|
879
|
-
configurable: !0,
|
|
880
|
-
writable: !0
|
|
881
|
-
}) : e[r] = t, e;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
//#endregion
|
|
885
|
-
//#region src/services/sheets-filter-panel.service.ts
|
|
645
|
+
// src/services/sheets-filter-panel.service.ts
|
|
886
646
|
var _ByConditionsModel;
|
|
887
647
|
var _ByValuesModel;
|
|
888
648
|
var _ByColorsModel;
|
|
@@ -1472,8 +1232,7 @@ let ByColorsModel = _ByColorsModel = class ByColorsModel extends Disposable {
|
|
|
1472
1232
|
};
|
|
1473
1233
|
ByColorsModel = _ByColorsModel = __decorate([__decorateParam(4, ICommandService)], ByColorsModel);
|
|
1474
1234
|
|
|
1475
|
-
|
|
1476
|
-
//#region src/commands/operations/sheets-filter.operation.ts
|
|
1235
|
+
// src/commands/operations/sheets-filter.operation.ts
|
|
1477
1236
|
const FILTER_PANEL_OPENED_KEY = "FILTER_PANEL_OPENED";
|
|
1478
1237
|
/**
|
|
1479
1238
|
* The operation to open the filter panel and prepare for changing the filter conditions on a given column.
|
|
@@ -1520,8 +1279,7 @@ const ChangeFilterByOperation = {
|
|
|
1520
1279
|
}
|
|
1521
1280
|
};
|
|
1522
1281
|
|
|
1523
|
-
|
|
1524
|
-
//#region src/menu/sheets-filter.menu.ts
|
|
1282
|
+
// src/menu/sheets-filter.menu.ts
|
|
1525
1283
|
function SmartToggleFilterMenuItemFactory(accessor) {
|
|
1526
1284
|
const sheetsFilterService = accessor.get(SheetsFilterService);
|
|
1527
1285
|
return {
|
|
@@ -1531,10 +1289,7 @@ function SmartToggleFilterMenuItemFactory(accessor) {
|
|
|
1531
1289
|
tooltip: "sheets-filter-ui.toolbar.smart-toggle-filter-tooltip",
|
|
1532
1290
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
|
|
1533
1291
|
activated$: sheetsFilterService.activeFilterModel$.pipe(map((model) => !!model)),
|
|
1534
|
-
disabled$:
|
|
1535
|
-
worksheetTypes: [WorksheetFilterPermission, WorksheetViewPermission],
|
|
1536
|
-
rangeTypes: [RangeProtectionPermissionViewPoint]
|
|
1537
|
-
}))
|
|
1292
|
+
disabled$: getFilterRangeDisabled$(accessor)
|
|
1538
1293
|
};
|
|
1539
1294
|
}
|
|
1540
1295
|
function ClearFilterCriteriaMenuItemFactory(accessor) {
|
|
@@ -1544,7 +1299,10 @@ function ClearFilterCriteriaMenuItemFactory(accessor) {
|
|
|
1544
1299
|
type: MenuItemType.BUTTON,
|
|
1545
1300
|
title: "sheets-filter-ui.toolbar.clear-filter-criteria",
|
|
1546
1301
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
|
|
1547
|
-
disabled$:
|
|
1302
|
+
disabled$: deriveStateFromActiveSheet$(accessor.get(IUniverInstanceService), true, ({ worksheet }) => {
|
|
1303
|
+
if (worksheet.getConfig().type === SheetTypes.CHART) return of(true);
|
|
1304
|
+
return sheetsFilterService.activeFilterModel$.pipe(switchMap((model) => (model === null || model === void 0 ? void 0 : model.hasCriteria$.pipe(map((hasCriteria) => !hasCriteria))) ?? of(true)));
|
|
1305
|
+
})
|
|
1548
1306
|
};
|
|
1549
1307
|
}
|
|
1550
1308
|
function ReCalcFilterMenuItemFactory(accessor) {
|
|
@@ -1554,12 +1312,20 @@ function ReCalcFilterMenuItemFactory(accessor) {
|
|
|
1554
1312
|
type: MenuItemType.BUTTON,
|
|
1555
1313
|
title: "sheets-filter-ui.toolbar.re-calc-filter-conditions",
|
|
1556
1314
|
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
|
|
1557
|
-
disabled$:
|
|
1315
|
+
disabled$: deriveStateFromActiveSheet$(accessor.get(IUniverInstanceService), true, ({ worksheet }) => {
|
|
1316
|
+
if (worksheet.getConfig().type === SheetTypes.CHART) return of(true);
|
|
1317
|
+
return sheetsFilterService.activeFilterModel$.pipe(switchMap((model) => (model === null || model === void 0 ? void 0 : model.hasCriteria$.pipe(map((hasCriteria) => !hasCriteria))) ?? of(true)));
|
|
1318
|
+
})
|
|
1558
1319
|
};
|
|
1559
1320
|
}
|
|
1321
|
+
function getFilterRangeDisabled$(accessor) {
|
|
1322
|
+
return getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, {
|
|
1323
|
+
worksheetTypes: [WorksheetFilterPermission, WorksheetViewPermission],
|
|
1324
|
+
rangeTypes: [RangeProtectionPermissionViewPoint]
|
|
1325
|
+
}));
|
|
1326
|
+
}
|
|
1560
1327
|
|
|
1561
|
-
|
|
1562
|
-
//#region src/menu/schema.ts
|
|
1328
|
+
// src/menu/schema.ts
|
|
1563
1329
|
const menuSchema = { [RibbonDataGroup.ORGANIZATION]: { [SmartToggleSheetsFilterCommand.id]: {
|
|
1564
1330
|
order: 2,
|
|
1565
1331
|
gridLayout: {
|
|
@@ -1577,19 +1343,7 @@ const menuSchema = { [RibbonDataGroup.ORGANIZATION]: { [SmartToggleSheetsFilterC
|
|
|
1577
1343
|
}
|
|
1578
1344
|
} } };
|
|
1579
1345
|
|
|
1580
|
-
|
|
1581
|
-
//#region package.json
|
|
1582
|
-
var name = "@univerjs/sheets-filter-ui";
|
|
1583
|
-
var version = "1.3.1";
|
|
1584
|
-
|
|
1585
|
-
//#endregion
|
|
1586
|
-
//#region src/config/config.ts
|
|
1587
|
-
const SHEETS_FILTER_UI_PLUGIN_CONFIG_KEY = "sheets-filter-ui.config";
|
|
1588
|
-
const configSymbol = Symbol(SHEETS_FILTER_UI_PLUGIN_CONFIG_KEY);
|
|
1589
|
-
const defaultPluginConfig = {};
|
|
1590
|
-
|
|
1591
|
-
//#endregion
|
|
1592
|
-
//#region src/menu/mobile-schema.ts
|
|
1346
|
+
// src/menu/mobile-schema.ts
|
|
1593
1347
|
const mobileMenuSchema = { [RibbonDataGroup.ORGANIZATION]: { [SmartToggleSheetsFilterCommand.id]: {
|
|
1594
1348
|
order: 2,
|
|
1595
1349
|
menuItemFactory: SmartToggleFilterMenuItemFactory,
|
|
@@ -1603,8 +1357,7 @@ const mobileMenuSchema = { [RibbonDataGroup.ORGANIZATION]: { [SmartToggleSheetsF
|
|
|
1603
1357
|
}
|
|
1604
1358
|
} } };
|
|
1605
1359
|
|
|
1606
|
-
|
|
1607
|
-
//#region src/controllers/mobile-menu.controller.ts
|
|
1360
|
+
// src/controllers/mobile-menu.controller.ts
|
|
1608
1361
|
/**
|
|
1609
1362
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1610
1363
|
*
|
|
@@ -1629,8 +1382,7 @@ let SheetsFilterMobileMenuController = class SheetsFilterMobileMenuController ex
|
|
|
1629
1382
|
};
|
|
1630
1383
|
SheetsFilterMobileMenuController = __decorate([__decorateParam(0, ICommandService), __decorateParam(1, IMenuManagerService)], SheetsFilterMobileMenuController);
|
|
1631
1384
|
|
|
1632
|
-
|
|
1633
|
-
//#region src/controllers/mobile/components.controller.ts
|
|
1385
|
+
// src/controllers/mobile/components.controller.ts
|
|
1634
1386
|
/**
|
|
1635
1387
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1636
1388
|
*
|
|
@@ -1654,8 +1406,7 @@ let MobileComponentsController = class MobileComponentsController extends Dispos
|
|
|
1654
1406
|
};
|
|
1655
1407
|
MobileComponentsController = __decorate([__decorateParam(0, Inject(IconManager))], MobileComponentsController);
|
|
1656
1408
|
|
|
1657
|
-
|
|
1658
|
-
//#region src/views/mobile/MobileFilterByColor.tsx
|
|
1409
|
+
// src/views/mobile/MobileFilterByColor.tsx
|
|
1659
1410
|
function MobileColorOption(props) {
|
|
1660
1411
|
const { item, label, textColor = false, onSelect } = props;
|
|
1661
1412
|
return /* @__PURE__ */ jsxs("button", {
|
|
@@ -1721,8 +1472,22 @@ function MobileFilterByColor(props) {
|
|
|
1721
1472
|
});
|
|
1722
1473
|
}
|
|
1723
1474
|
|
|
1724
|
-
|
|
1725
|
-
|
|
1475
|
+
// src/views/mobile/MobileFilterByCondition.tsx
|
|
1476
|
+
/**
|
|
1477
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1478
|
+
*
|
|
1479
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1480
|
+
* you may not use this file except in compliance with the License.
|
|
1481
|
+
* You may obtain a copy of the License at
|
|
1482
|
+
*
|
|
1483
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1484
|
+
*
|
|
1485
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1486
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1487
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1488
|
+
* See the License for the specific language governing permissions and
|
|
1489
|
+
* limitations under the License.
|
|
1490
|
+
*/
|
|
1726
1491
|
function MobileFilterByCondition(props) {
|
|
1727
1492
|
const { model } = props;
|
|
1728
1493
|
const localeService = useDependency(LocaleService);
|
|
@@ -1752,12 +1517,14 @@ function MobileFilterByCondition(props) {
|
|
|
1752
1517
|
/* @__PURE__ */ jsx(MobileSelect, {
|
|
1753
1518
|
value: operator,
|
|
1754
1519
|
options: secondaryOptions,
|
|
1755
|
-
onChange: (nextOperator) => model.onConditionFormChange({ [name]: nextOperator })
|
|
1520
|
+
onChange: (nextOperator) => model.onConditionFormChange({ [name]: nextOperator }),
|
|
1521
|
+
size: "small"
|
|
1756
1522
|
}),
|
|
1757
1523
|
needsValue && /* @__PURE__ */ jsx(Input, {
|
|
1758
1524
|
value,
|
|
1759
1525
|
placeholder: localeService.t("sheets-filter-ui.panel.input-values-placeholder"),
|
|
1760
|
-
onChange: (nextValue) => model.onConditionFormChange({ [name === "operator1" ? "val1" : "val2"]: nextValue })
|
|
1526
|
+
onChange: (nextValue) => model.onConditionFormChange({ [name === "operator1" ? "val1" : "val2"]: nextValue }),
|
|
1527
|
+
size: "small"
|
|
1761
1528
|
})
|
|
1762
1529
|
]
|
|
1763
1530
|
});
|
|
@@ -1769,7 +1536,8 @@ function MobileFilterByCondition(props) {
|
|
|
1769
1536
|
condition.numOfParameters === 1 && /* @__PURE__ */ jsx(Input, {
|
|
1770
1537
|
value: formParams.val1 ?? "",
|
|
1771
1538
|
placeholder: localeService.t("sheets-filter-ui.panel.input-values-placeholder"),
|
|
1772
|
-
onChange: (value) => model.onConditionFormChange({ val1: value })
|
|
1539
|
+
onChange: (value) => model.onConditionFormChange({ val1: value }),
|
|
1540
|
+
size: "small"
|
|
1773
1541
|
}),
|
|
1774
1542
|
condition.numOfParameters >= 2 && renderSecondaryCondition(formParams.operator1, formParams.val1 ?? "", "operator1"),
|
|
1775
1543
|
condition.numOfParameters >= 2 && renderSecondaryCondition(formParams.operator2, formParams.val2 ?? "", "operator2"),
|
|
@@ -1810,8 +1578,22 @@ function MobileFilterByCondition(props) {
|
|
|
1810
1578
|
});
|
|
1811
1579
|
}
|
|
1812
1580
|
|
|
1813
|
-
|
|
1814
|
-
|
|
1581
|
+
// src/views/mobile/MobileFilterByValue.tsx
|
|
1582
|
+
/**
|
|
1583
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1584
|
+
*
|
|
1585
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1586
|
+
* you may not use this file except in compliance with the License.
|
|
1587
|
+
* You may obtain a copy of the License at
|
|
1588
|
+
*
|
|
1589
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1590
|
+
*
|
|
1591
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1592
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1593
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1594
|
+
* See the License for the specific language governing permissions and
|
|
1595
|
+
* limitations under the License.
|
|
1596
|
+
*/
|
|
1815
1597
|
function extractCheckedKeys(items) {
|
|
1816
1598
|
let checkedKeys = [];
|
|
1817
1599
|
items.forEach((item) => {
|
|
@@ -1840,7 +1622,8 @@ function MobileFilterByValue(props) {
|
|
|
1840
1622
|
className: "univer-flex-1",
|
|
1841
1623
|
value: searchText,
|
|
1842
1624
|
placeholder: searchLabel,
|
|
1843
|
-
onChange: (value) => model.setSearchString(value)
|
|
1625
|
+
onChange: (value) => model.setSearchString(value),
|
|
1626
|
+
size: "small"
|
|
1844
1627
|
}), /* @__PURE__ */ jsx("button", {
|
|
1845
1628
|
type: "button",
|
|
1846
1629
|
"aria-label": localeService.t("sheets-filter-ui.panel.cancel"),
|
|
@@ -1854,7 +1637,7 @@ function MobileFilterByValue(props) {
|
|
|
1854
1637
|
},
|
|
1855
1638
|
children: /* @__PURE__ */ jsx(CloseIcon, { className: "univer-size-5" })
|
|
1856
1639
|
})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Checkbox, {
|
|
1857
|
-
className: "univer-
|
|
1640
|
+
className: "univer-flex-1",
|
|
1858
1641
|
contentClassName: "univer-flex univer-items-center univer-gap-1",
|
|
1859
1642
|
indeterminate,
|
|
1860
1643
|
disabled: items.length === 0,
|
|
@@ -1893,8 +1676,7 @@ function MobileFilterByValue(props) {
|
|
|
1893
1676
|
});
|
|
1894
1677
|
}
|
|
1895
1678
|
|
|
1896
|
-
|
|
1897
|
-
//#region src/views/mobile/MobileSheetsFilterPanel.tsx
|
|
1679
|
+
// src/views/mobile/MobileSheetsFilterPanel.tsx
|
|
1898
1680
|
const FILTER_BY_OPTIONS$1 = [
|
|
1899
1681
|
{
|
|
1900
1682
|
label: "sheets-filter-ui.panel.by-values",
|
|
@@ -1928,6 +1710,7 @@ function MobileFilterSyncSwitch() {
|
|
|
1928
1710
|
children: localeService.t(enabled ? "sheets-filter-ui.sync.statusTips.on" : "sheets-filter-ui.sync.statusTips.off")
|
|
1929
1711
|
})]
|
|
1930
1712
|
}), /* @__PURE__ */ jsx(Switch, {
|
|
1713
|
+
"aria-label": localeService.t("sheets-filter-ui.sync.title"),
|
|
1931
1714
|
defaultChecked: enabled,
|
|
1932
1715
|
onChange: (checked) => {
|
|
1933
1716
|
filterSyncController.setEnabled(checked);
|
|
@@ -2024,11 +1807,13 @@ function MobileSheetsFilterPanelContent() {
|
|
|
2024
1807
|
className: "univer-shrink-0 univer-border-0 univer-border-t univer-border-solid univer-border-gray-200 univer-p-4 dark:!univer-border-gray-700",
|
|
2025
1808
|
children: /* @__PURE__ */ jsxs(MobileActionRowGroup, { children: [/* @__PURE__ */ jsx(Button, {
|
|
2026
1809
|
onClick: () => closePanel().catch(() => void 0),
|
|
1810
|
+
size: "middle",
|
|
2027
1811
|
children: localeService.t("sheets-filter-ui.panel.cancel")
|
|
2028
1812
|
}), /* @__PURE__ */ jsx(Button, {
|
|
2029
1813
|
variant: "primary",
|
|
2030
1814
|
disabled: !canApply || !filterByModel,
|
|
2031
1815
|
onClick: () => applyFilter().catch(() => void 0),
|
|
1816
|
+
size: "middle",
|
|
2032
1817
|
children: localeService.t("sheets-filter-ui.panel.confirm")
|
|
2033
1818
|
})] })
|
|
2034
1819
|
}) : void 0,
|
|
@@ -2044,10 +1829,12 @@ function MobileSheetsFilterPanelContent() {
|
|
|
2044
1829
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
2045
1830
|
disabled: !filterRange || col <= filterRange.startColumn,
|
|
2046
1831
|
onClick: () => changeColumn(-1),
|
|
1832
|
+
size: "middle",
|
|
2047
1833
|
children: localeService.t("sheets-filter-ui.panel.mobile.previous-column")
|
|
2048
1834
|
}), /* @__PURE__ */ jsx(Button, {
|
|
2049
1835
|
disabled: !filterRange || col >= filterRange.endColumn,
|
|
2050
1836
|
onClick: () => changeColumn(1),
|
|
1837
|
+
size: "middle",
|
|
2051
1838
|
children: localeService.t("sheets-filter-ui.panel.mobile.next-column")
|
|
2052
1839
|
})]
|
|
2053
1840
|
})]
|
|
@@ -2077,7 +1864,7 @@ function MobileSheetsFilterPanelContent() {
|
|
|
2077
1864
|
}),
|
|
2078
1865
|
/* @__PURE__ */ jsx(MobileFilterSyncSwitch, {}),
|
|
2079
1866
|
/* @__PURE__ */ jsx(Button, {
|
|
2080
|
-
size: "
|
|
1867
|
+
size: "middle",
|
|
2081
1868
|
disabled: !hasCriteria || !filterByModel,
|
|
2082
1869
|
onClick: () => clearFilter().catch(() => void 0),
|
|
2083
1870
|
children: localeService.t("sheets-filter-ui.panel.clear-filter")
|
|
@@ -2088,8 +1875,7 @@ function MobileSheetsFilterPanelContent() {
|
|
|
2088
1875
|
});
|
|
2089
1876
|
}
|
|
2090
1877
|
|
|
2091
|
-
|
|
2092
|
-
//#region src/views/widgets/drawings.ts
|
|
1878
|
+
// src/views/widgets/drawings.ts
|
|
2093
1879
|
const BUTTON_VIEWPORT = 16;
|
|
2094
1880
|
const FILTER_BUTTON_EMPTY = new Path2D("M3.30363 3C2.79117 3 2.51457 3.60097 2.84788 3.99024L6.8 8.60593V12.5662C6.8 12.7184 6.8864 12.8575 7.02289 12.9249L8.76717 13.7863C8.96655 13.8847 9.2 13.7396 9.2 13.5173V8.60593L13.1521 3.99024C13.4854 3.60097 13.2088 3 12.6964 3H3.30363Z");
|
|
2095
1881
|
var FilterButton = class {
|
|
@@ -2131,8 +1917,7 @@ var FilterButton = class {
|
|
|
2131
1917
|
}
|
|
2132
1918
|
};
|
|
2133
1919
|
|
|
2134
|
-
|
|
2135
|
-
//#region src/views/widgets/filter-button.shape.ts
|
|
1920
|
+
// src/views/widgets/filter-button.shape.ts
|
|
2136
1921
|
const FILTER_ICON_SIZE = 16;
|
|
2137
1922
|
let SheetsFilterButtonShape = class SheetsFilterButtonShape extends Shape {
|
|
2138
1923
|
constructor(key, props, _contextService, _commandService, _themeService) {
|
|
@@ -2201,8 +1986,7 @@ SheetsFilterButtonShape = __decorate([
|
|
|
2201
1986
|
__decorateParam(4, Inject(ThemeService))
|
|
2202
1987
|
], SheetsFilterButtonShape);
|
|
2203
1988
|
|
|
2204
|
-
|
|
2205
|
-
//#region src/views/render-modules/sheets-filter.render-controller.ts
|
|
1989
|
+
// src/views/render-modules/sheets-filter.render-controller.ts
|
|
2206
1990
|
const DEFAULT_Z_INDEX = 1e3;
|
|
2207
1991
|
const SHEETS_FILTER_BUTTON_Z_INDEX = 5e3;
|
|
2208
1992
|
function computeIconTop(startY, endY, cellHeight, verticalAlign) {
|
|
@@ -2362,8 +2146,7 @@ SheetsFilterRenderController = __decorate([
|
|
|
2362
2146
|
__decorateParam(7, ISheetSelectionRenderService)
|
|
2363
2147
|
], SheetsFilterRenderController);
|
|
2364
2148
|
|
|
2365
|
-
|
|
2366
|
-
//#region src/controllers/mobile/ui.controller.ts
|
|
2149
|
+
// src/controllers/mobile/ui.controller.ts
|
|
2367
2150
|
let SheetsFilterUIMobileController = class SheetsFilterUIMobileController extends RxDisposable {
|
|
2368
2151
|
constructor(injector, commandService, localeService, sheetsFilterService, messageService, uiPartsService, renderManagerService, sheetsRenderService) {
|
|
2369
2152
|
super();
|
|
@@ -2403,8 +2186,7 @@ SheetsFilterUIMobileController = __decorate([
|
|
|
2403
2186
|
__decorateParam(7, Inject(SheetsRenderService))
|
|
2404
2187
|
], SheetsFilterUIMobileController);
|
|
2405
2188
|
|
|
2406
|
-
|
|
2407
|
-
//#region src/controllers/sheets-filter-permission.controller.ts
|
|
2189
|
+
// src/controllers/sheets-filter-permission.controller.ts
|
|
2408
2190
|
let SheetsFilterPermissionController = class SheetsFilterPermissionController extends Disposable {
|
|
2409
2191
|
constructor(_sheetsFilterService, _localeService, _commandService, _sheetPermissionCheckPermission, _injector, _sheetsSelectionService) {
|
|
2410
2192
|
super();
|
|
@@ -2479,8 +2261,7 @@ SheetsFilterPermissionController = __decorate([
|
|
|
2479
2261
|
__decorateParam(5, Inject(SheetsSelectionsService))
|
|
2480
2262
|
], SheetsFilterPermissionController);
|
|
2481
2263
|
|
|
2482
|
-
|
|
2483
|
-
//#region src/mobile-plugin.ts
|
|
2264
|
+
// src/mobile-plugin.ts
|
|
2484
2265
|
let UniverSheetsFilterMobileUIPlugin = class UniverSheetsFilterMobileUIPlugin extends Plugin {
|
|
2485
2266
|
constructor(_config = defaultPluginConfig, _injector, _configService) {
|
|
2486
2267
|
super();
|
|
@@ -2519,8 +2300,7 @@ UniverSheetsFilterMobileUIPlugin = __decorate([
|
|
|
2519
2300
|
__decorateParam(2, IConfigService)
|
|
2520
2301
|
], UniverSheetsFilterMobileUIPlugin);
|
|
2521
2302
|
|
|
2522
|
-
|
|
2523
|
-
//#region src/views/components/SheetsFilterByColorsPanel.tsx
|
|
2303
|
+
// src/views/components/SheetsFilterByColorsPanel.tsx
|
|
2524
2304
|
/**
|
|
2525
2305
|
* Filter by colors.
|
|
2526
2306
|
*/
|
|
@@ -2586,8 +2366,7 @@ function CheckedIcon() {
|
|
|
2586
2366
|
});
|
|
2587
2367
|
}
|
|
2588
2368
|
|
|
2589
|
-
|
|
2590
|
-
//#region src/views/components/SheetsFilterByConditionsPanel.tsx
|
|
2369
|
+
// src/views/components/SheetsFilterByConditionsPanel.tsx
|
|
2591
2370
|
const PRIMARY_CONDITION_GROUPS = [
|
|
2592
2371
|
[FilterConditionItems.NONE],
|
|
2593
2372
|
[FilterConditionItems.EMPTY, FilterConditionItems.NOT_EMPTY],
|
|
@@ -2691,8 +2470,7 @@ function FilterByCondition(props) {
|
|
|
2691
2470
|
});
|
|
2692
2471
|
}
|
|
2693
2472
|
|
|
2694
|
-
|
|
2695
|
-
//#region src/views/components/SheetsFilterByValuesPanel.tsx
|
|
2473
|
+
// src/views/components/SheetsFilterByValuesPanel.tsx
|
|
2696
2474
|
/**
|
|
2697
2475
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
2698
2476
|
*
|
|
@@ -2818,8 +2596,22 @@ function FilterByValue(props) {
|
|
|
2818
2596
|
});
|
|
2819
2597
|
}
|
|
2820
2598
|
|
|
2821
|
-
|
|
2822
|
-
|
|
2599
|
+
// src/views/components/SheetsFilterSyncSwitch.tsx
|
|
2600
|
+
/**
|
|
2601
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
2602
|
+
*
|
|
2603
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2604
|
+
* you may not use this file except in compliance with the License.
|
|
2605
|
+
* You may obtain a copy of the License at
|
|
2606
|
+
*
|
|
2607
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2608
|
+
*
|
|
2609
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2610
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2611
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2612
|
+
* See the License for the specific language governing permissions and
|
|
2613
|
+
* limitations under the License.
|
|
2614
|
+
*/
|
|
2823
2615
|
function FilterSyncSwitch() {
|
|
2824
2616
|
const sheetsFilterSyncController = useDependency(SheetsFilterSyncController);
|
|
2825
2617
|
const visible = useObservable(sheetsFilterSyncController.visible$, void 0, true);
|
|
@@ -2837,6 +2629,7 @@ function FilterSyncSwitch() {
|
|
|
2837
2629
|
children: /* @__PURE__ */ jsx(InfoIcon, { className: "univer-block" })
|
|
2838
2630
|
})]
|
|
2839
2631
|
}), /* @__PURE__ */ jsx(Switch, {
|
|
2632
|
+
"aria-label": localeService.t("sheets-filter-ui.sync.title"),
|
|
2840
2633
|
defaultChecked: enabled,
|
|
2841
2634
|
onChange: (checked) => {
|
|
2842
2635
|
const message = checked ? localeService.t("sheets-filter-ui.sync.switchTips.on") : localeService.t("sheets-filter-ui.sync.switchTips.off");
|
|
@@ -2851,8 +2644,7 @@ function FilterSyncSwitch() {
|
|
|
2851
2644
|
});
|
|
2852
2645
|
}
|
|
2853
2646
|
|
|
2854
|
-
|
|
2855
|
-
//#region src/views/components/SheetsFilterPanel.tsx
|
|
2647
|
+
// src/views/components/SheetsFilterPanel.tsx
|
|
2856
2648
|
const FILTER_BY_OPTIONS = [
|
|
2857
2649
|
{
|
|
2858
2650
|
label: "sheets-filter-ui.panel.by-values",
|
|
@@ -2955,8 +2747,7 @@ function FilterPanel() {
|
|
|
2955
2747
|
}
|
|
2956
2748
|
const FILTER_PANEL_POPUP_KEY = "FILTER_PANEL_POPUP";
|
|
2957
2749
|
|
|
2958
|
-
|
|
2959
|
-
//#region src/controllers/components.controller.ts
|
|
2750
|
+
// src/controllers/components.controller.ts
|
|
2960
2751
|
/**
|
|
2961
2752
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
2962
2753
|
*
|
|
@@ -2991,8 +2782,7 @@ let ComponentsController = class ComponentsController extends Disposable {
|
|
|
2991
2782
|
};
|
|
2992
2783
|
ComponentsController = __decorate([__decorateParam(0, Inject(ComponentManager)), __decorateParam(1, Inject(IconManager))], ComponentsController);
|
|
2993
2784
|
|
|
2994
|
-
|
|
2995
|
-
//#region src/controllers/sheets-filter.shortcut.ts
|
|
2785
|
+
// src/controllers/sheets-filter.shortcut.ts
|
|
2996
2786
|
const SmartToggleFilterShortcut = {
|
|
2997
2787
|
id: SmartToggleSheetsFilterCommand.id,
|
|
2998
2788
|
binding: KeyCode.L | MetaKeys.CTRL_COMMAND | MetaKeys.SHIFT,
|
|
@@ -3002,8 +2792,7 @@ const SmartToggleFilterShortcut = {
|
|
|
3002
2792
|
groupTitle: "sheets-ui.shortcut.sheet-edit"
|
|
3003
2793
|
};
|
|
3004
2794
|
|
|
3005
|
-
|
|
3006
|
-
//#region src/controllers/ui.controller.ts
|
|
2795
|
+
// src/controllers/ui.controller.ts
|
|
3007
2796
|
let SheetsFilterUIDesktopController = class SheetsFilterUIDesktopController extends RxDisposable {
|
|
3008
2797
|
constructor(_injector, _sheetsFilterPanelService, _sheetCanvasPopupService, _sheetsFilterService, _localeService, _shortcutService, _commandService, _menuManagerService, _contextService, _messageService, sheetsRenderService, renderManagerService) {
|
|
3009
2798
|
super();
|
|
@@ -3100,8 +2889,7 @@ SheetsFilterUIDesktopController = __decorate([
|
|
|
3100
2889
|
__decorateParam(11, IRenderManagerService)
|
|
3101
2890
|
], SheetsFilterUIDesktopController);
|
|
3102
2891
|
|
|
3103
|
-
|
|
3104
|
-
//#region src/plugin.ts
|
|
2892
|
+
// src/plugin.ts
|
|
3105
2893
|
let UniverSheetsFilterUIPlugin = class UniverSheetsFilterUIPlugin extends Plugin {
|
|
3106
2894
|
constructor(_config = defaultPluginConfig, _injector, _configService, _rpcChannelService) {
|
|
3107
2895
|
super();
|
|
@@ -3141,34 +2929,4 @@ UniverSheetsFilterUIPlugin = __decorate([
|
|
|
3141
2929
|
__decorateParam(3, Optional(IRPCChannelService))
|
|
3142
2930
|
], UniverSheetsFilterUIPlugin);
|
|
3143
2931
|
|
|
3144
|
-
|
|
3145
|
-
//#region src/worker/plugin.ts
|
|
3146
|
-
let UniverSheetsFilterUIWorkerPlugin = class UniverSheetsFilterUIWorkerPlugin extends Plugin {
|
|
3147
|
-
constructor(_config = defaultPluginConfig, _injector, _configService, _rpcChannelService) {
|
|
3148
|
-
super();
|
|
3149
|
-
this._config = _config;
|
|
3150
|
-
this._injector = _injector;
|
|
3151
|
-
this._configService = _configService;
|
|
3152
|
-
this._rpcChannelService = _rpcChannelService;
|
|
3153
|
-
const { ...rest } = merge({}, defaultPluginConfig, this._config);
|
|
3154
|
-
this._configService.setConfig(SHEETS_FILTER_UI_PLUGIN_CONFIG_KEY, rest);
|
|
3155
|
-
}
|
|
3156
|
-
onStarting() {
|
|
3157
|
-
[[ISheetsGenerateFilterValuesService, { useClass: SheetsGenerateFilterValuesService }]].forEach((d) => this._injector.add(d));
|
|
3158
|
-
}
|
|
3159
|
-
onReady() {
|
|
3160
|
-
this._rpcChannelService.registerChannel(SHEETS_GENERATE_FILTER_VALUES_SERVICE_NAME, fromModule(this._injector.get(ISheetsGenerateFilterValuesService)));
|
|
3161
|
-
}
|
|
3162
|
-
};
|
|
3163
|
-
_defineProperty(UniverSheetsFilterUIWorkerPlugin, "type", UniverInstanceType.UNIVER_SHEET);
|
|
3164
|
-
_defineProperty(UniverSheetsFilterUIWorkerPlugin, "pluginName", "SHEET_FILTER_UI_WORKER_PLUGIN");
|
|
3165
|
-
_defineProperty(UniverSheetsFilterUIWorkerPlugin, "packageName", name);
|
|
3166
|
-
_defineProperty(UniverSheetsFilterUIWorkerPlugin, "version", version);
|
|
3167
|
-
UniverSheetsFilterUIWorkerPlugin = __decorate([
|
|
3168
|
-
__decorateParam(1, Inject(Injector)),
|
|
3169
|
-
__decorateParam(2, IConfigService),
|
|
3170
|
-
__decorateParam(3, IRPCChannelService)
|
|
3171
|
-
], UniverSheetsFilterUIWorkerPlugin);
|
|
3172
|
-
|
|
3173
|
-
//#endregion
|
|
3174
|
-
export { ChangeFilterByOperation, CloseFilterPanelOperation, OpenFilterPanelOperation, menuSchema as SheetsFilterUIMenuSchema, UniverSheetsFilterMobileUIPlugin, UniverSheetsFilterUIPlugin, UniverSheetsFilterUIWorkerPlugin };
|
|
2932
|
+
export { ChangeFilterByOperation, CloseFilterPanelOperation, OpenFilterPanelOperation, menuSchema as SheetsFilterUIMenuSchema, UniverSheetsFilterMobileUIPlugin, UniverSheetsFilterUIPlugin };
|