@univerjs/sheets-filter-ui 0.2.4-alpha.0 → 0.2.4

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/es/index.js CHANGED
@@ -1,7 +1,8 @@
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, 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";
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 Ti, IContextService as wt, ThemeService as dn, RxDisposable as vn, fromCallback as Fi, runOnLifecycle as Oi, LifecycleStages as hr, OnLifecycle as mn, Tools as dr, Plugin as pn, DependentOn as _n } from "@univerjs/core";
5
+ import { Quantity as gn, createIdentifier as Ci, Inject as D, Injector as ot } from "@wendellhu/redi";
5
6
  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";
6
7
  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";
7
8
  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";
@@ -11,6 +12,7 @@ import { MessageType as Tn, Select as zr, RadioGroup as io, Radio as kr, Input a
11
12
  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";
12
13
  import * as d from "react";
13
14
  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";
14
16
  import Yr, { flushSync as Xr } from "react-dom";
15
17
  var oe = function() {
16
18
  return oe = Object.assign || function(e) {
@@ -82,7 +84,7 @@ const Ve = {
82
84
  if (!h) return !1;
83
85
  const m = h.range, f = lo(h) ? ki(m, { left: !0, right: !0, up: !0, down: !0 }, i) : m;
84
86
  if (f.endRow === f.startRow) {
85
- const _ = e.get(bn, dn.OPTIONAL), b = e.get(Fe);
87
+ const _ = e.get(bn, gn.OPTIONAL), b = e.get(Fe);
86
88
  return _ == null || _.show({ type: Tn.Warning, content: b.t("sheets-filter.command.not-valid-filter-range") }), !1;
87
89
  }
88
90
  const g = { id: vr.id, params: { unitId: s, subUnitId: l, range: f } }, p = n.syncExecuteCommand(g.id, g.params);
@@ -703,7 +705,7 @@ var Fo = Object.defineProperty, Oo = Object.getOwnPropertyDescriptor, br = (e, t
703
705
  (i = e[a]) && (o = (n ? i(t, r, o) : i(o)) || o);
704
706
  return n && o && Fo(t, r, o), o;
705
707
  }, De = (e, t) => (r, n) => t(r, n, e), bt = /* @__PURE__ */ ((e) => (e[e.VALUES = 0] = "VALUES", e[e.CONDITIONS = 1] = "CONDITIONS", e))(bt || {});
706
- Ti("sheets-filter-ui.sheets-filter-panel.service");
708
+ Ci("sheets-filter-ui.sheets-filter-panel.service");
707
709
  let Re = class extends Mt {
708
710
  constructor(t, r, n, o) {
709
711
  super();
@@ -963,7 +965,7 @@ let Rt = class extends Mt {
963
965
  W++;
964
966
  continue;
965
967
  }
966
- const z = F != null && F.value ? Fi(F.value) : "";
968
+ const z = F != null && F.value ? Ti(F.value) : "";
967
969
  if (!z) {
968
970
  O += 1, W += H;
969
971
  continue;
@@ -1086,7 +1088,7 @@ const Be = "FILTER_PANEL_OPENED", Tt = {
1086
1088
  id: "sheet.operation.close-filter-panel",
1087
1089
  type: Te.OPERATION,
1088
1090
  handler: (e) => {
1089
- const t = e.get(wt), r = e.get(Re), n = e.get(Ni, dn.OPTIONAL);
1091
+ const t = e.get(wt), r = e.get(Re), n = e.get(Ni, gn.OPTIONAL);
1090
1092
  return t.getContextValue(Be) ? (t.setContextValue(Be, !1), n == null || n.focus(), r.terminate()) : !1;
1091
1093
  }
1092
1094
  }, Ln = {
@@ -2844,7 +2846,7 @@ let lr = class extends no {
2844
2846
  lr = Ta([
2845
2847
  Jt(2, wt),
2846
2848
  Jt(3, ae),
2847
- Jt(4, D(vn))
2849
+ Jt(4, D(dn))
2848
2850
  ], lr);
2849
2851
  var Fa = Object.defineProperty, Oa = Object.getOwnPropertyDescriptor, Ca = (e, t, r, n) => {
2850
2852
  for (var o = n > 1 ? void 0 : n ? Oa(t, r) : t, a = e.length - 1, i; a >= 0; a--)
@@ -2852,7 +2854,7 @@ var Fa = Object.defineProperty, Oa = Object.getOwnPropertyDescriptor, Ca = (e, t
2852
2854
  return n && o && Fa(t, r, o), o;
2853
2855
  }, pe = (e, t) => (r, n) => t(r, n, e);
2854
2856
  const Pa = 1e3, Na = 5e3;
2855
- let ur = class extends mn {
2857
+ let ur = class extends vn {
2856
2858
  constructor(t, r, n, o, a, i, s, l, u, c) {
2857
2859
  super();
2858
2860
  N(this, "_filterRangeShape", null);
@@ -2877,7 +2879,7 @@ let ur = class extends mn {
2877
2879
  range: a == null ? void 0 : a.getRange(),
2878
2880
  skeleton: t.skeleton
2879
2881
  });
2880
- return Oi(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
2882
+ return Fi(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(
2881
2883
  Vi(
2882
2884
  ([u]) => u.type === Te.MUTATION && u.params.unitId === r.getUnitId() && Pi.has(u.id)
2883
2885
  ),
@@ -2959,7 +2961,7 @@ ur = Ca([
2959
2961
  pe(1, D(ot)),
2960
2962
  pe(2, D(Zi)),
2961
2963
  pe(3, D(ee)),
2962
- pe(4, D(vn)),
2964
+ pe(4, D(dn)),
2963
2965
  pe(5, D(ho)),
2964
2966
  pe(6, D(Ji)),
2965
2967
  pe(7, ae),
@@ -2971,7 +2973,7 @@ var Ia = Object.defineProperty, Ma = Object.getOwnPropertyDescriptor, wa = (e, t
2971
2973
  (i = e[a]) && (o = (n ? i(t, r, o) : i(o)) || o);
2972
2974
  return n && o && Ia(t, r, o), o;
2973
2975
  }, Aa = (e, t) => (r, n) => t(r, n, e);
2974
- let it = class extends mn {
2976
+ let it = class extends vn {
2975
2977
  constructor(e) {
2976
2978
  super(), this._renderManagerService = e, this._initRenderControllers();
2977
2979
  }
@@ -2982,7 +2984,7 @@ let it = class extends mn {
2982
2984
  it = wa([
2983
2985
  Aa(0, Sr)
2984
2986
  ], it);
2985
- Ci(hr.Rendered, it);
2987
+ Oi(hr.Rendered, it);
2986
2988
  var La = Object.defineProperty, $a = Object.getOwnPropertyDescriptor, Da = (e, t, r, n) => {
2987
2989
  for (var o = n > 1 ? void 0 : n ? $a(t, r) : t, a = e.length - 1, i; a >= 0; a--)
2988
2990
  (i = e[a]) && (o = (n ? i(t, r, o) : i(o)) || o);
@@ -3057,7 +3059,7 @@ let tt = class extends it {
3057
3059
  }
3058
3060
  };
3059
3061
  tt = Da([
3060
- pn(hr.Rendered, tt),
3062
+ mn(hr.Rendered, tt),
3061
3063
  ie(1, D(ot)),
3062
3064
  ie(2, D(Li)),
3063
3065
  ie(3, D(Re)),
@@ -3101,7 +3103,7 @@ let rt = class extends Mt {
3101
3103
  }
3102
3104
  };
3103
3105
  rt = xa([
3104
- pn(hr.Ready, rt),
3106
+ mn(hr.Ready, rt),
3105
3107
  _t(0, D(ee)),
3106
3108
  _t(1, D(Fe)),
3107
3109
  _t(2, ae),
@@ -3113,7 +3115,7 @@ var ti = Object.defineProperty, Ba = Object.getOwnPropertyDescriptor, Wa = (e, t
3113
3115
  return n && o && ti(t, r, o), o;
3114
3116
  }, hn = (e, t) => (r, n) => t(r, n, e), ri = (e, t, r) => Wa(e, typeof t != "symbol" ? t + "" : t, r);
3115
3117
  const ja = "SHEET_FILTER_UI_PLUGIN";
3116
- let Nt = class extends _n {
3118
+ let Nt = class extends pn {
3117
3119
  constructor(e = {}, t, r) {
3118
3120
  super(), this._config = e, this._injector = t, this._localeService = r, this._config = dr.deepMerge({}, ei, this._config);
3119
3121
  }
@@ -3133,7 +3135,7 @@ let Nt = class extends _n {
3133
3135
  ri(Nt, "type", Pe.UNIVER_SHEET);
3134
3136
  ri(Nt, "pluginName", ja);
3135
3137
  Nt = Va([
3136
- gn(En),
3138
+ _n(En),
3137
3139
  hn(1, D(ot)),
3138
3140
  hn(2, D(Fe))
3139
3141
  ], Nt);
@@ -3143,7 +3145,7 @@ var ni = Object.defineProperty, za = Object.getOwnPropertyDescriptor, ka = (e, t
3143
3145
  return n && o && ni(t, r, o), o;
3144
3146
  }, Ga = (e, t) => (r, n) => t(r, n, e), ii = (e, t, r) => ka(e, typeof t != "symbol" ? t + "" : t, r);
3145
3147
  const Ya = "SHEET_FILTER_UI_PLUGIN";
3146
- let It = class extends _n {
3148
+ let It = class extends pn {
3147
3149
  constructor(e = {}, t) {
3148
3150
  super(), this._config = e, this._injector = t, this._config = dr.deepMerge({}, ei, this._config);
3149
3151
  }
@@ -3157,7 +3159,7 @@ let It = class extends _n {
3157
3159
  ii(It, "type", Pe.UNIVER_SHEET);
3158
3160
  ii(It, "pluginName", Ya);
3159
3161
  It = Qa([
3160
- gn(En),
3162
+ _n(En),
3161
3163
  Ga(1, D(ot))
3162
3164
  ], It);
3163
3165
  export {
@@ -1,8 +1,9 @@
1
- import { Workbook, ICommandService, Injector, RxDisposable, ThemeService } from '@univerjs/core';
1
+ import { Workbook, ICommandService, 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';
6
7
 
7
8
  export declare class SheetsFilterRenderController extends RxDisposable implements IRenderModule {
8
9
  private readonly _context;
@@ -1,5 +1,6 @@
1
- import { ICommandService, IContextService, Injector, LocaleService } from '@univerjs/core';
1
+ import { ICommandService, IContextService, LocaleService } from '@univerjs/core';
2
2
  import { ComponentManager, IMenuService, IMessageService, IShortcutService, MenuConfig } from '@univerjs/ui';
3
+ import { Injector } from '@wendellhu/redi';
3
4
  import { SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
4
5
  import { IRenderManagerService } from '@univerjs/engine-render';
5
6
  import { SheetsFilterService } from '@univerjs/sheets-filter';
@@ -1,5 +1,5 @@
1
1
  import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
2
- import { IAccessor } from '@univerjs/core';
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;
@@ -1,4 +1,5 @@
1
- import { Injector, Plugin, UniverInstanceType } from '@univerjs/core';
1
+ import { Plugin, UniverInstanceType } from '@univerjs/core';
2
+ import { Injector } from '@wendellhu/redi';
2
3
  import { IUniverSheetsFilterUIConfig } from './controllers/sheets-filter-ui.controller';
3
4
 
4
5
  export declare class UniverSheetsFilterMobileUIPlugin extends Plugin {
@@ -1,4 +1,5 @@
1
- import { Injector, LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
1
+ import { LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
2
+ import { Injector } from '@wendellhu/redi';
2
3
  import { IUniverSheetsFilterUIConfig } from './controllers/sheets-filter-ui.controller';
3
4
 
4
5
  export declare class UniverSheetsFilterUIPlugin extends Plugin {
@@ -1,5 +1,6 @@
1
- import { IDisposable, Nullable, Disposable, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
1
+ import { Nullable, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
2
  import { SheetsFilterService, FilterColumn, FilterModel } from '@univerjs/sheets-filter';
3
+ import { IDisposable, Injector } from '@wendellhu/redi';
3
4
  import { Observable } from 'rxjs';
4
5
  import { RefRangeService } from '@univerjs/sheets';
5
6
  import { FilterOperator, IFilterConditionFormParams, IFilterConditionItem } from '../models/conditions';
@@ -31,7 +32,7 @@ export interface ISheetsFilterPanelService {
31
32
  */
32
33
  terminate(): boolean;
33
34
  }
34
- export declare const ISheetsFilterPanelService: import('@univerjs/core').IdentifierDecorator<ISheetsFilterPanelService>;
35
+ export declare const ISheetsFilterPanelService: import('@wendellhu/redi').IdentifierDecorator<ISheetsFilterPanelService>;
35
36
  export interface IFilterByModel extends IDisposable {
36
37
  canApply$: Observable<boolean>;
37
38
  deltaCol(offset: number): void;