@univerjs/sheets-filter-ui 0.7.0 → 0.8.0-beta.1

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,18 +1,18 @@
1
1
  var Yt = Object.defineProperty;
2
2
  var qt = (t, e, r) => e in t ? Yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
3
  var f = (t, e, r) => qt(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { BooleanNumber as rt, createIdentifier as _t, Inject as E, LocaleService as K, IUniverInstanceService as Ge, ILogService as Kt, extractPureTextFromCell as Xt, numfmt as it, Disposable as me, Injector as X, Quantity as vt, Tools as Te, ICommandService as Q, CommandType as Le, IContextService as Me, UniverInstanceType as Z, ThemeService as gt, RxDisposable as St, fromCallback as Zt, InterceptorEffectEnum as zt, DependentOn as Et, IConfigService as Tt, Optional as Jt, Plugin as je, merge as Nt } from "@univerjs/core";
4
+ import { BooleanNumber as rt, createIdentifier as _t, Inject as E, LocaleService as K, IUniverInstanceService as Ge, ILogService as Kt, extractPureTextFromCell as Xt, numfmt as it, Disposable as me, Injector as X, Quantity as vt, Tools as Te, ICommandService as Q, CommandType as Le, IContextService as we, UniverInstanceType as Z, ThemeService as gt, RxDisposable as St, fromCallback as Zt, InterceptorEffectEnum as zt, DependentOn as Et, IConfigService as Tt, Optional as Jt, Plugin as je, merge as Nt } from "@univerjs/core";
5
5
  import { IRPCChannelService as Ft, toModule as er, fromModule as tr } from "@univerjs/rpc";
6
6
  import { CustomFilterOperator as u, SetSheetsFilterCriteriaCommand as re, SheetsFilterService as V, SmartToggleSheetsFilterCommand as pe, ReCalcSheetsFilterCommand as Ye, ClearSheetsFilterCriteriaCommand as qe, FILTER_MUTATIONS as rr, SetSheetsFilterRangeMutation as ir, SetSheetsFilterCriteriaMutation as sr, RemoveSheetsFilterMutation as nr, ReCalcSheetsFilterMutation as or, RemoveSheetFilterCommand as ar, SetSheetFilterRangeCommand as lr, UniverSheetsFilterPlugin as Ct } from "@univerjs/sheets-filter";
7
7
  import { RefRangeService as cr, SheetPermissionCheckController as ur, SheetsSelectionsService as hr, getSheetCommandTarget as dr, WorksheetFilterPermission as ae, WorksheetViewPermission as le, RangeProtectionPermissionViewPoint as ce, expandToContinuousRange as mr, SheetInterceptorService as pr, SetRangeValuesMutation as fr, INTERCEPTOR_POINT as _r } from "@univerjs/sheets";
8
- import { ILayoutService as vr, useDependency as te, useObservable as B, useComponentsOfPart as gr, ComponentContainer as Sr, getMenuHiddenObservable as Ke, MenuItemType as Xe, RibbonStartGroup as Er, KeyCode as Tr, MetaKeys as st, ComponentManager as Nr, IShortcutService as Fr, IMenuManagerService as Cr, IMessageService as yr } from "@univerjs/ui";
9
- import { SetCellEditVisibleOperation as Or, SheetsUIPart as Rr, getObservableWithExclusiveRange$ as Ir, getCurrentRangeDisable$ as Ar, SheetSkeletonManagerService as Pr, ISheetSelectionRenderService as br, SelectionControl as Lr, attachSelectionWithCoord as Mr, getCoordByCell as wr, SheetsRenderService as yt, whenSheetEditorFocused as $r, SheetCanvasPopManagerService as Ur } from "@univerjs/sheets-ui";
8
+ import { ILayoutService as vr, useDependency as te, useObservable as B, useComponentsOfPart as gr, ComponentContainer as Sr, getMenuHiddenObservable as Ke, MenuItemType as Xe, RibbonDataGroup as Er, KeyCode as Tr, MetaKeys as st, ComponentManager as Nr, IShortcutService as Fr, IMenuManagerService as Cr, IMessageService as yr } from "@univerjs/ui";
9
+ import { SetCellEditVisibleOperation as Or, SheetsUIPart as Rr, getObservableWithExclusiveRange$ as Ir, getCurrentRangeDisable$ as Ar, SheetSkeletonManagerService as Pr, ISheetSelectionRenderService as br, SelectionControl as Lr, attachSelectionWithCoord as wr, getCoordByCell as Mr, SheetsRenderService as yt, whenSheetEditorFocused as $r, SheetCanvasPopManagerService as Ur } from "@univerjs/sheets-ui";
10
10
  import { BehaviorSubject as q, ReplaySubject as Hr, Subject as Dr, merge as kr, combineLatest as xr, throttleTime as Ot, startWith as Rt, map as ie, shareReplay as Br, of as fe, switchMap as Ze, filter as Wr, takeUntil as Qr, distinctUntilChanged as Vr } from "rxjs";
11
11
  import { Select as nt, clsx as It, borderClassName as At, RadioGroup as Gr, Radio as ot, Input as Pt, Checkbox as jr, Tree as Yr, Segmented as qr, Button as Ue, MessageType as Kr } from "@univerjs/design";
12
12
  import { Rect as at, Shape as Xr, IRenderManagerService as bt } from "@univerjs/engine-render";
13
13
  import { jsx as S, jsxs as b, Fragment as lt } from "react/jsx-runtime";
14
- import { forwardRef as Lt, useRef as Zr, createElement as Mt, useCallback as D, useMemo as ze } from "react";
15
- const wt = "sheets-filter-ui.config", Ne = {};
14
+ import { forwardRef as Lt, useRef as Zr, createElement as wt, useCallback as D, useMemo as ze } from "react";
15
+ const Mt = "sheets-filter-ui.config", Ne = {};
16
16
  var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SECOND", t))(F || {}), _ = /* @__PURE__ */ ((t) => (t.NONE = "none", t.STARTS_WITH = "startsWith", t.DOES_NOT_START_WITH = "doesNotStartWith", t.ENDS_WITH = "endsWith", t.DOES_NOT_END_WITH = "doesNotEndWith", t.CONTAINS = "contains", t.DOES_NOT_CONTAIN = "doesNotContain", t.EQUALS = "equals", t.NOT_EQUALS = "notEquals", t.EMPTY = "empty", t.NOT_EMPTY = "notEmpty", t.BETWEEN = "between", t.NOT_BETWEEN = "notBetween", t.CUSTOM = "custom", t))(_ || {}), d;
17
17
  ((t) => {
18
18
  t.NONE = {
@@ -392,9 +392,9 @@ var F = /* @__PURE__ */ ((t) => (t[t.FIRST = 0] = "FIRST", t[t.SECOND = 1] = "SE
392
392
  mapToFilterColumn: (i) => {
393
393
  const { and: o, val1: a, val2: c, operator1: h, operator2: m } = i;
394
394
  function g(R, O) {
395
- for (const M of t.ALL_CONDITIONS)
396
- if (M.operator === R)
397
- return M.mapToFilterColumn({ val1: O, operator1: R });
395
+ for (const w of t.ALL_CONDITIONS)
396
+ if (w.operator === R)
397
+ return w.mapToFilterColumn({ val1: O, operator1: R });
398
398
  }
399
399
  const p = !h || h === t.NONE.operator, T = !m || m === t.NONE.operator;
400
400
  if (p && T)
@@ -528,7 +528,7 @@ Be = Jr([
528
528
  He(2, Kt)
529
529
  ], Be);
530
530
  function $t(t, e, r, s, n, l, i, o) {
531
- var v, C, N, R, O, M, w, _e, ve;
531
+ var v, C, N, R, O, w, M, _e, ve;
532
532
  const a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), h = "yyyy-mm-dd", m = new Set(ei), g = "empty";
533
533
  let p = 0;
534
534
  for (const I of s.iterateByColumn(r, !1, !1)) {
@@ -545,7 +545,7 @@ function $t(t, e, r, s, n, l, i, o) {
545
545
  p += 1, z += tt;
546
546
  continue;
547
547
  }
548
- const ge = (v = I.value) != null && v.v && !I.value.p ? (R = (N = o.get((C = I.value) == null ? void 0 : C.s)) == null ? void 0 : N.n) == null ? void 0 : R.pattern : "", jt = ge && it.isDate(ge);
548
+ const ge = (v = I.value) != null && v.v && !I.value.p ? (R = (N = o.get((C = I.value) == null ? void 0 : C.s)) == null ? void 0 : N.n) == null ? void 0 : R.pattern : "", jt = ge && it.getFormatInfo(ge).isDate;
549
549
  if (ge && jt && m.has(ge)) {
550
550
  const k = (O = s.getCellRaw(I.row, I.col)) == null ? void 0 : O.v;
551
551
  if (!k) {
@@ -562,7 +562,7 @@ function $t(t, e, r, s, n, l, i, o) {
562
562
  leaf: !1,
563
563
  checked: !1
564
564
  }, a.set(`${y}`, j), c.set(`${y}`, [`${y}`]));
565
- let U = (M = j.children) == null ? void 0 : M.find(($e) => $e.key === `${y}-${$}`);
565
+ let U = (w = j.children) == null ? void 0 : w.find(($e) => $e.key === `${y}-${$}`);
566
566
  U || (U = {
567
567
  title: e.t(`sheets-filter.date.${$}`),
568
568
  key: `${y}-${$}`,
@@ -570,9 +570,9 @@ function $t(t, e, r, s, n, l, i, o) {
570
570
  count: 0,
571
571
  leaf: !1,
572
572
  checked: !1
573
- }, (w = j.children) == null || w.push(U), c.set(`${y}-${$}`, [`${y}`, `${y}-${$}`]));
574
- const we = (_e = U == null ? void 0 : U.children) == null ? void 0 : _e.find(($e) => $e.key === `${y}-${$}-${oe}`);
575
- we ? (we.originValues.add(G), we.count++, U.count++, j.count++) : ((ve = U.children) == null || ve.push({
573
+ }, (M = j.children) == null || M.push(U), c.set(`${y}-${$}`, [`${y}`, `${y}-${$}`]));
574
+ const Me = (_e = U == null ? void 0 : U.children) == null ? void 0 : _e.find(($e) => $e.key === `${y}-${$}-${oe}`);
575
+ Me ? (Me.originValues.add(G), Me.count++, U.count++, j.count++) : ((ve = U.children) == null || ve.push({
576
576
  title: `${oe}`,
577
577
  key: `${y}-${$}-${oe}`,
578
578
  count: 1,
@@ -919,15 +919,15 @@ let Re = class extends me {
919
919
  * @returns the model to control the panel's state
920
920
  */
921
921
  static async fromFilterColumn(e, r, s) {
922
- var M;
922
+ var w;
923
923
  const n = e.get(Ge), l = e.get(K), i = e.get(Fe, vt.OPTIONAL), { unitId: o, subUnitId: a } = r, c = n.getUniverSheetInstance(o);
924
924
  if (!c) throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${o}!`);
925
925
  const h = c == null ? void 0 : c.getSheetBySheetId(a);
926
926
  if (!h) throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${o} and subUnitId: ${a}!`);
927
- const m = r.getRange(), g = s, p = (M = r.getFilterColumn(s)) == null ? void 0 : M.getColumnData().filters, T = new Set(p == null ? void 0 : p.filters), v = !!(p && p.blank), C = r.getFilteredOutRowsExceptCol(s), N = { ...m, startRow: m.startRow + 1, startColumn: g, endColumn: g };
927
+ const m = r.getRange(), g = s, p = (w = r.getFilterColumn(s)) == null ? void 0 : w.getColumnData().filters, T = new Set(p == null ? void 0 : p.filters), v = !!(p && p.blank), C = r.getFilteredOutRowsExceptCol(s), N = { ...m, startRow: m.startRow + 1, startColumn: g, endColumn: g };
928
928
  let R, O;
929
929
  if (i) {
930
- const w = await i.getFilterValues({
930
+ const M = await i.getFilterValues({
931
931
  unitId: o,
932
932
  subUnitId: a,
933
933
  filteredOutRowsByOtherColumns: Array.from(C),
@@ -936,10 +936,10 @@ let Re = class extends me {
936
936
  iterateRange: N,
937
937
  alreadyChecked: Array.from(T)
938
938
  });
939
- R = w.filterTreeItems, O = w.filterTreeMapCache;
939
+ R = M.filterTreeItems, O = M.filterTreeMapCache;
940
940
  } else {
941
- const w = $t(!!p, l, N, h, C, T, v, c.getStyles());
942
- R = w.filterTreeItems, O = w.filterTreeMapCache;
941
+ const M = $t(!!p, l, N, h, C, T, v, c.getStyles());
942
+ R = M.filterTreeItems, O = M.filterTreeMapCache;
943
943
  }
944
944
  return e.createInstance(Re, r, s, R, O);
945
945
  }
@@ -1038,7 +1038,7 @@ const se = "FILTER_PANEL_OPENED", Ie = {
1038
1038
  id: "sheet.operation.open-filter-panel",
1039
1039
  type: Le.OPERATION,
1040
1040
  handler: (t, e) => {
1041
- const r = t.get(Me), s = t.get(V), n = t.get(W);
1041
+ const r = t.get(we), s = t.get(V), n = t.get(W);
1042
1042
  t.get(Q).syncExecuteCommand(Or.id, { visible: !1 });
1043
1043
  const { unitId: i, subUnitId: o, col: a } = e, c = s.getFilterModel(i, o);
1044
1044
  return c ? (n.setupCol(c, a), r.getContextValue(se) || r.setContextValue(se, !0), !0) : !1;
@@ -1047,7 +1047,7 @@ const se = "FILTER_PANEL_OPENED", Ie = {
1047
1047
  id: "sheet.operation.close-filter-panel",
1048
1048
  type: Le.OPERATION,
1049
1049
  handler: (t) => {
1050
- const e = t.get(Me), r = t.get(W), s = t.get(vr, vt.OPTIONAL);
1050
+ const e = t.get(we), r = t.get(W), s = t.get(vr, vt.OPTIONAL);
1051
1051
  return e.getContextValue(se) ? (e.setContextValue(se, !1), s == null || s.focus(), r.terminate()) : !1;
1052
1052
  }
1053
1053
  }, Dt = {
@@ -1136,7 +1136,7 @@ var P = function() {
1136
1136
  return xt(r, "".concat(s), { defIds: r.defIds, idSuffix: a.current }, P({ ref: e, className: o }, i), l);
1137
1137
  });
1138
1138
  function xt(t, e, r, s, n) {
1139
- return Mt(t.tag, P(P({ key: e }, ai(t, r, n)), s), (li(t, r).children || []).map(function(l, i) {
1139
+ return wt(t.tag, P(P({ key: e }, ai(t, r, n)), s), (li(t, r).children || []).map(function(l, i) {
1140
1140
  return xt(l, "".concat(e, "-").concat(t.tag, "-").concat(i), r, void 0, n);
1141
1141
  }));
1142
1142
  }
@@ -1155,21 +1155,21 @@ function ai(t, e, r) {
1155
1155
  function li(t, e) {
1156
1156
  var r, s = e.defIds;
1157
1157
  return !s || s.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? P(P({}, t), { children: t.children.map(function(n) {
1158
- return typeof n.attrs.id == "string" && s && s.indexOf(n.attrs.id) > -1 ? P(P({}, n), { attrs: P(P({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
1158
+ return typeof n.attrs.id == "string" && s && s.includes(n.attrs.id) ? P(P({}, n), { attrs: P(P({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
1159
1159
  }) }) : t;
1160
1160
  }
1161
1161
  function ci() {
1162
1162
  return Math.random().toString(36).substring(2, 8);
1163
1163
  }
1164
1164
  kt.displayName = "UniverIcon";
1165
- var ui = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.32182 2.60967C2.98161 2.60967 2.79671 3.0074 3.01601 3.2675L6.85819 7.8246C6.94943 7.93282 6.99947 8.06981 6.99947 8.21136V12.7338C6.99947 12.898 7.0998 13.0455 7.2525 13.1058L8.73833 13.6928C9.00085 13.7965 9.28531 13.6031 9.28531 13.3208V8.21136C9.28531 8.06981 9.33535 7.93282 9.42659 7.8246L13.2688 3.2675C13.4881 3.0074 13.3032 2.60967 12.963 2.60967H3.32182ZM2.09858 4.04101C1.22139 3.0006 1.96097 1.40967 3.32182 1.40967H12.963C14.3238 1.40967 15.0634 3.0006 14.1862 4.04101L10.4853 8.43054V13.3208C10.4853 14.4498 9.34747 15.2237 8.29742 14.8089L6.81158 14.2219C6.20078 13.9806 5.79947 13.3905 5.79947 12.7338V8.43054L2.09858 4.04101Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Bt = Lt(function(t, e) {
1166
- return Mt(kt, Object.assign({}, t, {
1167
- id: "filter-single",
1165
+ var ui = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.32182 2.60967C2.98161 2.60967 2.79671 3.0074 3.01601 3.2675L6.85819 7.8246C6.94943 7.93282 6.99947 8.06981 6.99947 8.21136V12.7338C6.99947 12.898 7.0998 13.0455 7.2525 13.1058L8.73833 13.6928C9.00085 13.7965 9.28531 13.6031 9.28531 13.3208V8.21136C9.28531 8.06981 9.33535 7.93282 9.42659 7.8246L13.2688 3.2675C13.4881 3.0074 13.3032 2.60967 12.963 2.60967H3.32182ZM2.09858 4.04101C1.22139 3.0006 1.96097 1.40967 3.32182 1.40967H12.963C14.3238 1.40967 15.0634 3.0006 14.1862 4.04101L10.4853 8.43054V13.3208C10.4853 14.4498 9.34747 15.2237 8.29742 14.8089L6.81158 14.2219C6.20078 13.9806 5.79947 13.3905 5.79947 12.7338V8.43054L2.09858 4.04101Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Bt = Lt(function(t, e) {
1166
+ return wt(kt, Object.assign({}, t, {
1167
+ id: "filter-icon",
1168
1168
  ref: e,
1169
1169
  icon: ui
1170
1170
  }));
1171
1171
  });
1172
- Bt.displayName = "FilterSingle";
1172
+ Bt.displayName = "FilterIcon";
1173
1173
  function hi(t) {
1174
1174
  var p, T;
1175
1175
  const { model: e } = t, r = te(K), s = B(e.conditionItem$, void 0), n = B(e.filterConditionFormParams$, void 0), l = n != null && n.and ? "AND" : "OR", i = D((v) => {
@@ -1342,7 +1342,7 @@ function pi(t) {
1342
1342
  "span",
1343
1343
  {
1344
1344
  "data-u-comp": "sheets-filter-panel-values-item-text",
1345
- className: "univer-mx-1 univer-inline-block univer-flex-shrink univer-overflow-hidden univer-text-ellipsis univer-whitespace-nowrap univer-text-gray-900 dark:univer-text-white",
1345
+ className: "univer-mx-1 univer-inline-block univer-flex-shrink univer-overflow-hidden univer-text-ellipsis univer-whitespace-nowrap univer-text-gray-900 dark:!univer-text-white",
1346
1346
  children: `${r.t("sheets-filter.panel.select-all")}`
1347
1347
  }
1348
1348
  ),
@@ -1350,7 +1350,7 @@ function pi(t) {
1350
1350
  "span",
1351
1351
  {
1352
1352
  "data-u-comp": "sheets-filter-panel-values-item-count",
1353
- className: "univer-text-gray-400 dark:univer-text-gray-500",
1353
+ className: "univer-text-gray-400 dark:!univer-text-gray-500",
1354
1354
  children: `(${i.checked}/${i.checked + i.unchecked})`
1355
1355
  }
1356
1356
  )
@@ -1375,8 +1375,8 @@ function pi(t) {
1375
1375
  univer-pr-2 univer-border-box univer-max-w-[245px] univer-rounded-md
1376
1376
  [&:hover_a]:univer-inline-block
1377
1377
  hover:univer-bg-gray-50 univer-h-full
1378
- univer-text-gray-900 dark:hover:univer-bg-gray-900
1379
- dark:univer-text-white
1378
+ univer-text-gray-900 dark:hover:!univer-bg-gray-900
1379
+ dark:!univer-text-white
1380
1380
  `,
1381
1381
  attachRender: (p) => /* @__PURE__ */ b(
1382
1382
  "div",
@@ -1387,7 +1387,7 @@ function pi(t) {
1387
1387
  "span",
1388
1388
  {
1389
1389
  "data-u-comp": "sheets-filter-panel-values-item-count",
1390
- className: "univer-text-gray-400 dark:univer-text-gray-500",
1390
+ className: "univer-text-gray-400 dark:!univer-text-gray-500",
1391
1391
  children: `(${p.count})`
1392
1392
  }
1393
1393
  ),
@@ -1433,7 +1433,7 @@ function fi() {
1433
1433
  "div",
1434
1434
  {
1435
1435
  "data-u-comp": "sheets-filter-panel",
1436
- className: "univer-box-border univer-flex univer-h-[432px] univer-w-[312px] univer-flex-col univer-rounded-lg univer-bg-white univer-p-4 univer-shadow-lg dark:univer-border-gray-600 dark:univer-bg-gray-700",
1436
+ className: "univer-box-border univer-flex univer-h-[442px] univer-w-[312px] univer-flex-col univer-rounded-lg univer-bg-white univer-p-4 univer-shadow-lg dark:!univer-border-gray-600 dark:!univer-bg-gray-700",
1437
1437
  children: [
1438
1438
  /* @__PURE__ */ S(
1439
1439
  Sr,
@@ -1457,7 +1457,7 @@ function fi() {
1457
1457
  className: "univer-flex-shrink univer-flex-grow univer-pt-2",
1458
1458
  children: s === ye.VALUES ? /* @__PURE__ */ S(pi, { model: n }) : /* @__PURE__ */ S(hi, { model: n })
1459
1459
  }
1460
- ) : /* @__PURE__ */ S("div", { style: { flex: 1 } }),
1460
+ ) : /* @__PURE__ */ S("div", { className: "univer-flex-1" }),
1461
1461
  /* @__PURE__ */ b(
1462
1462
  "div",
1463
1463
  {
@@ -1465,7 +1465,7 @@ function fi() {
1465
1465
  className: "univer-mt-4 univer-inline-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-nowrap univer-justify-between univer-overflow-hidden",
1466
1466
  children: [
1467
1467
  /* @__PURE__ */ S(Ue, { variant: "link", onClick: c, disabled: o, children: e.t("sheets-filter.panel.clear-filter") }),
1468
- /* @__PURE__ */ b("span", { className: "univer-space-x-2", children: [
1468
+ /* @__PURE__ */ b("span", { className: "univer-flex univer-gap-2", children: [
1469
1469
  /* @__PURE__ */ S(Ue, { variant: "default", onClick: h, children: e.t("sheets-filter.panel.cancel") }),
1470
1470
  /* @__PURE__ */ S(Ue, { disabled: !l, variant: "primary", onClick: m, children: e.t("sheets-filter.panel.confirm") })
1471
1471
  ] })
@@ -1488,7 +1488,7 @@ function vi(t) {
1488
1488
  return {
1489
1489
  id: pe.id,
1490
1490
  type: Xe.BUTTON_SELECTOR,
1491
- icon: "FilterSingle",
1491
+ icon: "FilterIcon",
1492
1492
  tooltip: "sheets-filter.toolbar.smart-toggle-filter-tooltip",
1493
1493
  hidden$: Ke(t, Z.UNIVER_SHEET),
1494
1494
  activated$: e.activeFilterModel$.pipe(ie((r) => !!r)),
@@ -1522,9 +1522,9 @@ function Si(t) {
1522
1522
  };
1523
1523
  }
1524
1524
  const Ei = {
1525
- [Er.FORMULAS_INSERT]: {
1525
+ [Er.ORGANIZATION]: {
1526
1526
  [pe.id]: {
1527
- order: 10,
1527
+ order: 2,
1528
1528
  menuItemFactory: vi,
1529
1529
  [qe.id]: {
1530
1530
  order: 0,
@@ -1604,7 +1604,7 @@ let Qe = class extends Xr {
1604
1604
  }
1605
1605
  };
1606
1606
  Qe = Fi([
1607
- De(2, Me),
1607
+ De(2, we),
1608
1608
  De(3, Q),
1609
1609
  De(4, E(gt))
1610
1610
  ], Qe);
@@ -1666,7 +1666,7 @@ let Ve = class extends St {
1666
1666
  enableAutoFill: !1,
1667
1667
  highlightHeader: !1
1668
1668
  }
1669
- ), a = Mr({
1669
+ ), a = wr({
1670
1670
  range: e,
1671
1671
  primary: null,
1672
1672
  style: { fill: "rgba(0, 0, 0, 0.0)" }
@@ -1678,18 +1678,18 @@ let Ve = class extends St {
1678
1678
  this._interceptCellContent(n, i, e.range);
1679
1679
  const { startColumn: a, endColumn: c, startRow: h } = r;
1680
1680
  for (let m = a; m <= c; m++) {
1681
- const g = `sheets-filter-button-${m}`, p = wr(h, m, o, l), { startX: T, startY: v, endX: C, endY: N } = p, R = C - T, O = N - v;
1681
+ const g = `sheets-filter-button-${m}`, p = Mr(h, m, o, l), { startX: T, startY: v, endX: C, endY: N } = p, R = C - T, O = N - v;
1682
1682
  if (O <= Se || R <= Se)
1683
1683
  continue;
1684
- const M = !!s.getFilterColumn(m), w = C - H - Se, _e = N - H - Se, ve = {
1685
- left: w,
1684
+ const w = !!s.getFilterColumn(m), M = C - H - Se, _e = N - H - Se, ve = {
1685
+ left: M,
1686
1686
  top: _e,
1687
1687
  height: H,
1688
1688
  width: H,
1689
1689
  zIndex: Ri,
1690
1690
  cellHeight: O,
1691
1691
  cellWidth: R,
1692
- filterParams: { unitId: n, subUnitId: i, col: m, hasCriteria: M }
1692
+ filterParams: { unitId: n, subUnitId: i, col: m, hasCriteria: w }
1693
1693
  }, I = this._injector.createInstance(Qe, g, ve);
1694
1694
  this._filterButtonShapes.push(I);
1695
1695
  }
@@ -1701,13 +1701,10 @@ let Ve = class extends St {
1701
1701
  effect: zt.Style,
1702
1702
  handler: (o, a, c) => {
1703
1703
  const { row: h, col: m, unitId: g, subUnitId: p } = a;
1704
- return g !== e || p !== r || h !== n || m < l || m > i ? c(o) : c({
1705
- ...o,
1706
- fontRenderExtension: {
1707
- ...o == null ? void 0 : o.fontRenderExtension,
1708
- rightOffset: H
1709
- }
1710
- });
1704
+ return g !== e || p !== r || h !== n || m < l || m > i || ((!o || o === a.rawData) && (o = { ...a.rawData }), o.fontRenderExtension = {
1705
+ ...o == null ? void 0 : o.fontRenderExtension,
1706
+ rightOffset: H
1707
+ }), c(o);
1711
1708
  },
1712
1709
  priority: 10
1713
1710
  });
@@ -1796,7 +1793,14 @@ let Ae = class extends de {
1796
1793
  this._menuManagerService.mergeMenu(Ei);
1797
1794
  }
1798
1795
  _initUI() {
1799
- this.disposeWithMe(this._componentManager.register(dt, fi)), this.disposeWithMe(this._componentManager.register("FilterSingle", Bt)), this.disposeWithMe(this._contextService.subscribeContextValue$(se).pipe(Vr()).subscribe((e) => {
1796
+ [
1797
+ [dt, fi],
1798
+ ["FilterIcon", Bt]
1799
+ ].forEach(([e, r]) => {
1800
+ this.disposeWithMe(
1801
+ this._componentManager.register(e, r)
1802
+ );
1803
+ }), this.disposeWithMe(this._contextService.subscribeContextValue$(se).pipe(Vr()).subscribe((e) => {
1800
1804
  e ? this._openFilterPopup() : this._closeFilterPopup();
1801
1805
  })), this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe((e) => {
1802
1806
  e && this._messageService.show({
@@ -1832,13 +1836,13 @@ Ae = Li([
1832
1836
  A(6, Fr),
1833
1837
  A(7, Q),
1834
1838
  A(8, Cr),
1835
- A(9, Me),
1839
+ A(9, we),
1836
1840
  A(10, yr),
1837
1841
  A(11, E(yt)),
1838
1842
  A(12, bt)
1839
1843
  ], Ae);
1840
- var Mi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, $i = (t, e, r) => e in t ? Mi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ui = (t, e, r, s) => {
1841
- for (var n = s > 1 ? void 0 : s ? wi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1844
+ var wi = Object.defineProperty, Mi = Object.getOwnPropertyDescriptor, $i = (t, e, r) => e in t ? wi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ui = (t, e, r, s) => {
1845
+ for (var n = s > 1 ? void 0 : s ? Mi(e, r) : e, l = t.length - 1, i; l >= 0; l--)
1842
1846
  (i = t[l]) && (n = i(n) || n);
1843
1847
  return n;
1844
1848
  }, ke = (t, e) => (r, s) => e(r, s, t), Wt = (t, e, r) => $i(t, typeof e != "symbol" ? e + "" : e, r);
@@ -1851,7 +1855,7 @@ let Pe = class extends je {
1851
1855
  Ne,
1852
1856
  this._config
1853
1857
  );
1854
- n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(wt, l);
1858
+ n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(Mt, l);
1855
1859
  }
1856
1860
  onStarting() {
1857
1861
  [
@@ -1893,7 +1897,7 @@ let be = class extends je {
1893
1897
  Ne,
1894
1898
  this._config
1895
1899
  );
1896
- s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(wt, n);
1900
+ s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(Mt, n);
1897
1901
  }
1898
1902
  onStarting() {
1899
1903
  [
package/lib/index.css CHANGED
@@ -1 +1 @@
1
- .univer-mx-1{margin-left:4px;margin-right:4px}.univer-mb-1{margin-bottom:4px}.univer-ml-1{margin-left:4px}.univer-mt-2{margin-top:8px}.univer-mt-4{margin-top:16px}.univer-box-border{box-sizing:border-box}.univer-inline-block{display:inline-block}.univer-flex{display:flex}.univer-inline-flex{display:inline-flex}.univer-hidden{display:none}.univer-h-4{height:16px}.univer-h-5{height:20px}.univer-h-7{height:28px}.univer-h-8{height:32px}.univer-h-\[432px\]{height:432px}.univer-h-full{height:100%}.univer-w-\[312px\]{width:312px}.univer-w-full{width:100%}.univer-max-w-\[245px\]{max-width:245px}.univer-flex-1{flex:1 1 0%}.univer-flex-shrink{flex-shrink:1}.univer-flex-shrink-0{flex-shrink:0}.univer-flex-grow{flex-grow:1}.univer-flex-grow-0{flex-grow:0}.univer-cursor-pointer{cursor:pointer}.univer-flex-col{flex-direction:column}.univer-flex-nowrap{flex-wrap:nowrap}.univer-items-center{align-items:center}.univer-justify-between{justify-content:space-between}.univer-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * (1 - var(--tw-space-x-reverse)));margin-left:8px;margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.univer-overflow-hidden{overflow:hidden}.univer-text-ellipsis{text-overflow:ellipsis}.univer-whitespace-nowrap{white-space:nowrap}.univer-rounded-lg{border-radius:8px}.univer-rounded-md{border-radius:6px}.univer-bg-white{background-color:var(--univer-white)}.univer-p-2{padding:8px}.univer-p-4{padding:16px}.univer-px-1\.5{padding-left:6px;padding-right:6px}.univer-px-2{padding-left:8px;padding-right:8px}.univer-py-0\.5{padding-top:2px;padding-bottom:2px}.univer-py-2\.5{padding-top:10px;padding-bottom:10px}.univer-pb-0{padding-bottom:0}.univer-pl-5{padding-left:20px}.univer-pr-0\.5{padding-right:2px}.univer-pr-2{padding-right:8px}.univer-pt-0{padding-top:0}.univer-pt-2{padding-top:8px}.univer-text-sm{font-size:14px;line-height:20px}.univer-text-xs{font-size:12px;line-height:16px}.univer-text-gray-400{color:var(--univer-gray-400)}.univer-text-gray-500{color:var(--univer-gray-500)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-primary-500{color:var(--univer-primary-500)}.univer-shadow-lg{--tw-shadow: 0px 4px 6px 0px rgba(30, 40, 77, .05), 0px 10px 15px -3px rgba(30, 40, 77, .1);--tw-shadow-colored: 0px 4px 6px 0px var(--tw-shadow-color), 0px 10px 15px -3px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.hover\:univer-bg-gray-50:hover{background-color:var(--univer-gray-50)}.dark\:univer-border-gray-600:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)}.dark\:univer-bg-gray-700:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)}.dark\:univer-text-gray-500:where(.univer-dark,.univer-dark *){color:var(--univer-gray-500)}.dark\:univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)}.dark\:hover\:univer-bg-gray-900:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)}.\[\&\:hover_a\]\:univer-inline-block:hover a{display:inline-block}
1
+ .univer-mx-1{margin-left:4px;margin-right:4px}.univer-mb-1{margin-bottom:4px}.univer-ml-1{margin-left:4px}.univer-mt-2{margin-top:8px}.univer-mt-4{margin-top:16px}.univer-box-border{box-sizing:border-box}.univer-inline-block{display:inline-block}.univer-flex{display:flex}.univer-inline-flex{display:inline-flex}.univer-hidden{display:none}.univer-h-4{height:16px}.univer-h-5{height:20px}.univer-h-7{height:28px}.univer-h-8{height:32px}.univer-h-\[442px\]{height:442px}.univer-h-full{height:100%}.univer-w-\[312px\]{width:312px}.univer-w-full{width:100%}.univer-max-w-\[245px\]{max-width:245px}.univer-flex-1{flex:1 1 0%}.univer-flex-shrink{flex-shrink:1}.univer-flex-shrink-0{flex-shrink:0}.univer-flex-grow{flex-grow:1}.univer-flex-grow-0{flex-grow:0}.univer-cursor-pointer{cursor:pointer}.univer-flex-col{flex-direction:column}.univer-flex-nowrap{flex-wrap:nowrap}.univer-items-center{align-items:center}.univer-justify-between{justify-content:space-between}.univer-gap-2{gap:8px}.univer-overflow-hidden{overflow:hidden}.univer-text-ellipsis{text-overflow:ellipsis}.univer-whitespace-nowrap{white-space:nowrap}.univer-rounded-lg{border-radius:8px}.univer-rounded-md{border-radius:6px}.univer-bg-white{background-color:var(--univer-white)}.univer-p-2{padding:8px}.univer-p-4{padding:16px}.univer-px-1\.5{padding-left:6px;padding-right:6px}.univer-px-2{padding-left:8px;padding-right:8px}.univer-py-0\.5{padding-top:2px;padding-bottom:2px}.univer-py-2\.5{padding-top:10px;padding-bottom:10px}.univer-pb-0{padding-bottom:0}.univer-pl-5{padding-left:20px}.univer-pr-0\.5{padding-right:2px}.univer-pr-2{padding-right:8px}.univer-pt-0{padding-top:0}.univer-pt-2{padding-top:8px}.univer-text-sm{font-size:14px;line-height:20px}.univer-text-xs{font-size:12px;line-height:16px}.univer-text-gray-400{color:var(--univer-gray-400)}.univer-text-gray-500{color:var(--univer-gray-500)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-primary-500{color:var(--univer-primary-500)}.univer-shadow-lg{--tw-shadow: 0px 4px 6px 0px rgba(30, 40, 77, .05), 0px 10px 15px -3px rgba(30, 40, 77, .1);--tw-shadow-colored: 0px 4px 6px 0px var(--tw-shadow-color), 0px 10px 15px -3px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.hover\:univer-bg-gray-50:hover{background-color:var(--univer-gray-50)}.dark\:\!univer-border-gray-600:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)!important}.dark\:\!univer-bg-gray-700:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.dark\:\!univer-text-gray-500:where(.univer-dark,.univer-dark *){color:var(--univer-gray-500)!important}.dark\:\!univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.dark\:hover\:\!univer-bg-gray-900:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)!important}.\[\&\:hover_a\]\:univer-inline-block:hover a{display:inline-block}