@univerjs/sheets-filter-ui 0.2.3 → 0.2.4-alpha.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 +4 -4
- package/lib/es/index.js +17 -19
- package/lib/types/controllers/sheets-filter-render.controller.d.ts +1 -2
- package/lib/types/controllers/sheets-filter-ui.controller.d.ts +1 -2
- package/lib/types/controllers/sheets-filter.menu.d.ts +1 -1
- package/lib/types/mobile-plugin.d.ts +1 -2
- package/lib/types/plugin.d.ts +1 -2
- package/lib/types/services/sheets-filter-panel.service.d.ts +2 -3
- package/lib/umd/index.js +4 -4
- package/package.json +20 -22
package/lib/es/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
var bi = Object.defineProperty;
|
|
2
2
|
var yi = (e, t, r) => t in e ? bi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var N = (e, t, r) => yi(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { CommandType as Te, IUniverInstanceService as cr, ICommandService as ae, IUndoRedoService as fr, UniverInstanceType as Pe, LocaleService as Fe, sequenceExecute as Ri, BooleanNumber as Wr, Disposable as Mt, extractPureTextFromCell as
|
|
5
|
-
import { Quantity as gn, createIdentifier as Ci, Inject as D, Injector as ot } from "@wendellhu/redi";
|
|
4
|
+
import { CommandType as Te, IUniverInstanceService as cr, ICommandService as ae, IUndoRedoService as fr, UniverInstanceType as Pe, Quantity as dn, LocaleService as Fe, sequenceExecute as Ri, BooleanNumber as Wr, createIdentifier as Ti, Disposable as Mt, Inject as D, Injector as ot, extractPureTextFromCell as Fi, IContextService as wt, useDependency as $e, ThemeService as vn, RxDisposable as mn, fromCallback as Oi, runOnLifecycle as Ci, LifecycleStages as hr, OnLifecycle as pn, Tools as dr, Plugin as _n, DependentOn as gn } from "@univerjs/core";
|
|
6
5
|
import { SheetsFilterService as ee, RemoveSheetsFilterMutation as gt, SetSheetsFilterRangeMutation as vr, SetSheetsFilterCriteriaMutation as Ue, ReCalcSheetsFilterMutation as Sn, CustomFilterOperator as v, FILTER_MUTATIONS as Pi, UniverSheetsFilterPlugin as En } from "@univerjs/sheets-filter";
|
|
7
6
|
import { IMessageService as bn, ILayoutService as Ni, useObservable as be, useComponentsOfPart as Ii, ComponentContainer as Mi, KeyCode as wi, MetaKeys as Vr, MenuGroup as mr, MenuItemType as pr, MenuPosition as Ai, getMenuHiddenObservable as _r, ComponentManager as Li, IShortcutService as $i, IMenuService as Di } from "@univerjs/ui";
|
|
8
7
|
import { BehaviorSubject as Ce, ReplaySubject as Hi, of as st, Subject as Ui, merge as xi, combineLatest as Bi, throttleTime as yn, startWith as Rn, map as xe, shareReplay as Wi, switchMap as gr, filter as Vi, takeUntil as ji, distinctUntilChanged as zi } from "rxjs";
|
|
@@ -12,7 +11,6 @@ import { MessageType as Tn, Select as zr, RadioGroup as io, Radio as kr, Input a
|
|
|
12
11
|
import { SheetsSelectionsService as ao, isSingleCellSelection as lo, RefRangeService as uo, WorkbookEditablePermission as er, WorksheetFilterPermission as tr, WorksheetEditPermission as rr, RangeProtectionPermissionEditPoint as co, INTERCEPTOR_POINT as fo, SheetInterceptorService as ho, RangeProtectionPermissionViewPoint as Gr } from "@univerjs/sheets";
|
|
13
12
|
import * as d from "react";
|
|
14
13
|
import T, { forwardRef as On, useRef as w, createElement as Cn, useCallback as fe, useMemo as Er, version as vo, isValidElement as mo, useEffect as po, useState as Zt } from "react";
|
|
15
|
-
import { useDependency as $e } from "@wendellhu/redi/react-bindings";
|
|
16
14
|
import Yr, { flushSync as Xr } from "react-dom";
|
|
17
15
|
var oe = function() {
|
|
18
16
|
return oe = Object.assign || function(e) {
|
|
@@ -84,7 +82,7 @@ const Ve = {
|
|
|
84
82
|
if (!h) return !1;
|
|
85
83
|
const m = h.range, f = lo(h) ? ki(m, { left: !0, right: !0, up: !0, down: !0 }, i) : m;
|
|
86
84
|
if (f.endRow === f.startRow) {
|
|
87
|
-
const _ = e.get(bn,
|
|
85
|
+
const _ = e.get(bn, dn.OPTIONAL), b = e.get(Fe);
|
|
88
86
|
return _ == null || _.show({ type: Tn.Warning, content: b.t("sheets-filter.command.not-valid-filter-range") }), !1;
|
|
89
87
|
}
|
|
90
88
|
const g = { id: vr.id, params: { unitId: s, subUnitId: l, range: f } }, p = n.syncExecuteCommand(g.id, g.params);
|
|
@@ -705,7 +703,7 @@ var Fo = Object.defineProperty, Oo = Object.getOwnPropertyDescriptor, br = (e, t
|
|
|
705
703
|
(i = e[a]) && (o = (n ? i(t, r, o) : i(o)) || o);
|
|
706
704
|
return n && o && Fo(t, r, o), o;
|
|
707
705
|
}, De = (e, t) => (r, n) => t(r, n, e), bt = /* @__PURE__ */ ((e) => (e[e.VALUES = 0] = "VALUES", e[e.CONDITIONS = 1] = "CONDITIONS", e))(bt || {});
|
|
708
|
-
|
|
706
|
+
Ti("sheets-filter-ui.sheets-filter-panel.service");
|
|
709
707
|
let Re = class extends Mt {
|
|
710
708
|
constructor(t, r, n, o) {
|
|
711
709
|
super();
|
|
@@ -965,7 +963,7 @@ let Rt = class extends Mt {
|
|
|
965
963
|
W++;
|
|
966
964
|
continue;
|
|
967
965
|
}
|
|
968
|
-
const z = F != null && F.value ?
|
|
966
|
+
const z = F != null && F.value ? Fi(F.value) : "";
|
|
969
967
|
if (!z) {
|
|
970
968
|
O += 1, W += H;
|
|
971
969
|
continue;
|
|
@@ -1088,7 +1086,7 @@ const Be = "FILTER_PANEL_OPENED", Tt = {
|
|
|
1088
1086
|
id: "sheet.operation.close-filter-panel",
|
|
1089
1087
|
type: Te.OPERATION,
|
|
1090
1088
|
handler: (e) => {
|
|
1091
|
-
const t = e.get(wt), r = e.get(Re), n = e.get(Ni,
|
|
1089
|
+
const t = e.get(wt), r = e.get(Re), n = e.get(Ni, dn.OPTIONAL);
|
|
1092
1090
|
return t.getContextValue(Be) ? (t.setContextValue(Be, !1), n == null || n.focus(), r.terminate()) : !1;
|
|
1093
1091
|
}
|
|
1094
1092
|
}, Ln = {
|
|
@@ -2846,7 +2844,7 @@ let lr = class extends no {
|
|
|
2846
2844
|
lr = Ta([
|
|
2847
2845
|
Jt(2, wt),
|
|
2848
2846
|
Jt(3, ae),
|
|
2849
|
-
Jt(4, D(
|
|
2847
|
+
Jt(4, D(vn))
|
|
2850
2848
|
], lr);
|
|
2851
2849
|
var Fa = Object.defineProperty, Oa = Object.getOwnPropertyDescriptor, Ca = (e, t, r, n) => {
|
|
2852
2850
|
for (var o = n > 1 ? void 0 : n ? Oa(t, r) : t, a = e.length - 1, i; a >= 0; a--)
|
|
@@ -2854,7 +2852,7 @@ var Fa = Object.defineProperty, Oa = Object.getOwnPropertyDescriptor, Ca = (e, t
|
|
|
2854
2852
|
return n && o && Fa(t, r, o), o;
|
|
2855
2853
|
}, pe = (e, t) => (r, n) => t(r, n, e);
|
|
2856
2854
|
const Pa = 1e3, Na = 5e3;
|
|
2857
|
-
let ur = class extends
|
|
2855
|
+
let ur = class extends mn {
|
|
2858
2856
|
constructor(t, r, n, o, a, i, s, l, u, c) {
|
|
2859
2857
|
super();
|
|
2860
2858
|
N(this, "_filterRangeShape", null);
|
|
@@ -2879,7 +2877,7 @@ let ur = class extends vn {
|
|
|
2879
2877
|
range: a == null ? void 0 : a.getRange(),
|
|
2880
2878
|
skeleton: t.skeleton
|
|
2881
2879
|
});
|
|
2882
|
-
return
|
|
2880
|
+
return Oi(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
|
|
2883
2881
|
Vi(
|
|
2884
2882
|
([u]) => u.type === Te.MUTATION && u.params.unitId === r.getUnitId() && Pi.has(u.id)
|
|
2885
2883
|
),
|
|
@@ -2961,7 +2959,7 @@ ur = Ca([
|
|
|
2961
2959
|
pe(1, D(ot)),
|
|
2962
2960
|
pe(2, D(Zi)),
|
|
2963
2961
|
pe(3, D(ee)),
|
|
2964
|
-
pe(4, D(
|
|
2962
|
+
pe(4, D(vn)),
|
|
2965
2963
|
pe(5, D(ho)),
|
|
2966
2964
|
pe(6, D(Ji)),
|
|
2967
2965
|
pe(7, ae),
|
|
@@ -2973,7 +2971,7 @@ var Ia = Object.defineProperty, Ma = Object.getOwnPropertyDescriptor, wa = (e, t
|
|
|
2973
2971
|
(i = e[a]) && (o = (n ? i(t, r, o) : i(o)) || o);
|
|
2974
2972
|
return n && o && Ia(t, r, o), o;
|
|
2975
2973
|
}, Aa = (e, t) => (r, n) => t(r, n, e);
|
|
2976
|
-
let it = class extends
|
|
2974
|
+
let it = class extends mn {
|
|
2977
2975
|
constructor(e) {
|
|
2978
2976
|
super(), this._renderManagerService = e, this._initRenderControllers();
|
|
2979
2977
|
}
|
|
@@ -2984,7 +2982,7 @@ let it = class extends vn {
|
|
|
2984
2982
|
it = wa([
|
|
2985
2983
|
Aa(0, Sr)
|
|
2986
2984
|
], it);
|
|
2987
|
-
|
|
2985
|
+
Ci(hr.Rendered, it);
|
|
2988
2986
|
var La = Object.defineProperty, $a = Object.getOwnPropertyDescriptor, Da = (e, t, r, n) => {
|
|
2989
2987
|
for (var o = n > 1 ? void 0 : n ? $a(t, r) : t, a = e.length - 1, i; a >= 0; a--)
|
|
2990
2988
|
(i = e[a]) && (o = (n ? i(t, r, o) : i(o)) || o);
|
|
@@ -3059,7 +3057,7 @@ let tt = class extends it {
|
|
|
3059
3057
|
}
|
|
3060
3058
|
};
|
|
3061
3059
|
tt = Da([
|
|
3062
|
-
|
|
3060
|
+
pn(hr.Rendered, tt),
|
|
3063
3061
|
ie(1, D(ot)),
|
|
3064
3062
|
ie(2, D(Li)),
|
|
3065
3063
|
ie(3, D(Re)),
|
|
@@ -3103,7 +3101,7 @@ let rt = class extends Mt {
|
|
|
3103
3101
|
}
|
|
3104
3102
|
};
|
|
3105
3103
|
rt = xa([
|
|
3106
|
-
|
|
3104
|
+
pn(hr.Ready, rt),
|
|
3107
3105
|
_t(0, D(ee)),
|
|
3108
3106
|
_t(1, D(Fe)),
|
|
3109
3107
|
_t(2, ae),
|
|
@@ -3115,7 +3113,7 @@ var ti = Object.defineProperty, Ba = Object.getOwnPropertyDescriptor, Wa = (e, t
|
|
|
3115
3113
|
return n && o && ti(t, r, o), o;
|
|
3116
3114
|
}, hn = (e, t) => (r, n) => t(r, n, e), ri = (e, t, r) => Wa(e, typeof t != "symbol" ? t + "" : t, r);
|
|
3117
3115
|
const ja = "SHEET_FILTER_UI_PLUGIN";
|
|
3118
|
-
let Nt = class extends
|
|
3116
|
+
let Nt = class extends _n {
|
|
3119
3117
|
constructor(e = {}, t, r) {
|
|
3120
3118
|
super(), this._config = e, this._injector = t, this._localeService = r, this._config = dr.deepMerge({}, ei, this._config);
|
|
3121
3119
|
}
|
|
@@ -3135,7 +3133,7 @@ let Nt = class extends pn {
|
|
|
3135
3133
|
ri(Nt, "type", Pe.UNIVER_SHEET);
|
|
3136
3134
|
ri(Nt, "pluginName", ja);
|
|
3137
3135
|
Nt = Va([
|
|
3138
|
-
|
|
3136
|
+
gn(En),
|
|
3139
3137
|
hn(1, D(ot)),
|
|
3140
3138
|
hn(2, D(Fe))
|
|
3141
3139
|
], Nt);
|
|
@@ -3145,7 +3143,7 @@ var ni = Object.defineProperty, za = Object.getOwnPropertyDescriptor, ka = (e, t
|
|
|
3145
3143
|
return n && o && ni(t, r, o), o;
|
|
3146
3144
|
}, Ga = (e, t) => (r, n) => t(r, n, e), ii = (e, t, r) => ka(e, typeof t != "symbol" ? t + "" : t, r);
|
|
3147
3145
|
const Ya = "SHEET_FILTER_UI_PLUGIN";
|
|
3148
|
-
let It = class extends
|
|
3146
|
+
let It = class extends _n {
|
|
3149
3147
|
constructor(e = {}, t) {
|
|
3150
3148
|
super(), this._config = e, this._injector = t, this._config = dr.deepMerge({}, ei, this._config);
|
|
3151
3149
|
}
|
|
@@ -3159,7 +3157,7 @@ let It = class extends pn {
|
|
|
3159
3157
|
ii(It, "type", Pe.UNIVER_SHEET);
|
|
3160
3158
|
ii(It, "pluginName", Ya);
|
|
3161
3159
|
It = Qa([
|
|
3162
|
-
|
|
3160
|
+
gn(En),
|
|
3163
3161
|
Ga(1, D(ot))
|
|
3164
3162
|
], It);
|
|
3165
3163
|
export {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Workbook, ICommandService, RxDisposable, ThemeService } from '@univerjs/core';
|
|
1
|
+
import { Workbook, ICommandService, Injector, RxDisposable, ThemeService } from '@univerjs/core';
|
|
2
2
|
import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/engine-render';
|
|
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
|
-
import { Injector } from '@wendellhu/redi';
|
|
7
6
|
|
|
8
7
|
export declare class SheetsFilterRenderController extends RxDisposable implements IRenderModule {
|
|
9
8
|
private readonly _context;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ICommandService, IContextService, LocaleService } from '@univerjs/core';
|
|
1
|
+
import { ICommandService, IContextService, Injector, LocaleService } from '@univerjs/core';
|
|
2
2
|
import { ComponentManager, IMenuService, IMessageService, IShortcutService, MenuConfig } from '@univerjs/ui';
|
|
3
|
-
import { Injector } from '@wendellhu/redi';
|
|
4
3
|
import { SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
|
|
5
4
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
6
5
|
import { SheetsFilterService } from '@univerjs/sheets-filter';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
2
|
-
import { IAccessor } from '@
|
|
2
|
+
import { IAccessor } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
export declare function SmartToggleFilterMenuItemFactory(accessor: IAccessor): IMenuSelectorItem;
|
|
5
5
|
export declare function ClearFilterCriteriaMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
|
-
import { Injector } from '@wendellhu/redi';
|
|
1
|
+
import { Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
2
|
import { IUniverSheetsFilterUIConfig } from './controllers/sheets-filter-ui.controller';
|
|
4
3
|
|
|
5
4
|
export declare class UniverSheetsFilterMobileUIPlugin extends Plugin {
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
|
-
import { Injector } from '@wendellhu/redi';
|
|
1
|
+
import { Injector, LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
2
|
import { IUniverSheetsFilterUIConfig } from './controllers/sheets-filter-ui.controller';
|
|
4
3
|
|
|
5
4
|
export declare class UniverSheetsFilterUIPlugin extends Plugin {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Nullable, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
1
|
+
import { IDisposable, Nullable, Disposable, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { SheetsFilterService, FilterColumn, FilterModel } from '@univerjs/sheets-filter';
|
|
3
|
-
import { IDisposable, Injector } from '@wendellhu/redi';
|
|
4
3
|
import { Observable } from 'rxjs';
|
|
5
4
|
import { RefRangeService } from '@univerjs/sheets';
|
|
6
5
|
import { FilterOperator, IFilterConditionFormParams, IFilterConditionItem } from '../models/conditions';
|
|
@@ -32,7 +31,7 @@ export interface ISheetsFilterPanelService {
|
|
|
32
31
|
*/
|
|
33
32
|
terminate(): boolean;
|
|
34
33
|
}
|
|
35
|
-
export declare const ISheetsFilterPanelService: import('@
|
|
34
|
+
export declare const ISheetsFilterPanelService: import('@univerjs/core').IdentifierDecorator<ISheetsFilterPanelService>;
|
|
36
35
|
export interface IFilterByModel extends IDisposable {
|
|
37
36
|
canApply$: Observable<boolean>;
|
|
38
37
|
deltaCol(offset: number): void;
|