@univerjs/sheets-numfmt-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/index.js CHANGED
@@ -1,24 +1,24 @@
1
- var mt = Object.defineProperty;
2
- var dt = (e, t, r) => t in e ? mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var q = (e, t, r) => dt(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { Inject as S, LocaleService as M, IConfigService as Fe, Disposable as ie, isRealNum as ht, CommandType as Ae, ILocalStorageService as Le, numfmt as J, ThemeService as ft, IUniverInstanceService as ge, ICommandService as _e, UniverInstanceType as T, CellValueType as $, toDisposable as ve, DisposableCollection as vt, InterceptorEffectEnum as we, Range as He, Injector as je, Optional as pt, fromCallback as gt, DependentOn as _t, Plugin as St, merge as yt, registerDependencies as Ct, touchDependencies as bt } from "@univerjs/core";
1
+ var dt = Object.defineProperty;
2
+ var ht = (e, t, r) => t in e ? dt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var q = (e, t, r) => ht(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { Inject as C, LocaleService as M, IConfigService as Fe, Disposable as ie, isRealNum as ft, CommandType as Ae, ILocalStorageService as Le, isPatternEqualWithoutDecimal as se, numfmt as J, ThemeService as vt, IUniverInstanceService as ge, ICommandService as _e, UniverInstanceType as T, CellValueType as U, toDisposable as ve, DisposableCollection as pt, InterceptorEffectEnum as Pe, Range as He, Injector as je, Optional as gt, willLoseNumericPrecision as _t, fromCallback as St, DependentOn as yt, Plugin as Ct, merge as bt, registerDependencies as It, touchDependencies as Nt } from "@univerjs/core";
5
5
  import { IRenderManagerService as Be } from "@univerjs/engine-render";
6
- import { SHEETS_NUMFMT_PLUGIN_CONFIG_KEY as Nt, currencySymbols as Re, getDecimalFromPattern as ee, getCurrencyType as V, setPatternDecimal as w, getCurrencyFormatOptions as le, isPatternEqualWithoutDecimal as se, CURRENCYFORMAT as It, DATEFMTLISG as Et, NUMBERFORMAT as Tt, getDateFormatOptions as Ve, getNumberFormatOptions as We, isPatternHasDecimal as Mt, SheetsNumfmtCellContentController as Ge, getPatternPreviewIgnoreGeneral as xt, getPatternType as Se, SetNumfmtCommand as Ke, SetPercentCommand as Ze, SubtractDecimalCommand as Ye, AddDecimalCommand as ze, SetCurrencyCommand as Xe, MenuCurrencyService as Pt, countryCurrencyMap as k, getPatternPreview as wt, UniverSheetsNumfmtPlugin as Rt } from "@univerjs/sheets-numfmt";
7
- import { HoverManagerService as Ot, CellAlertManagerService as Ut, CellAlertType as kt, SheetSkeletonManagerService as Dt, IEditorBridgeService as $t, deriveStateFromActiveSheet$ as Ft, getCurrentRangeDisable$ as W, UniverSheetsUIPlugin as At } from "@univerjs/sheets-ui";
8
- import { isTextFormat as qe, isDefaultFormat as Lt, DEFAULT_TEXT_FORMAT_EXCEL as Ht } from "@univerjs/engine-numfmt";
9
- import { INumfmtService as ye, SheetInterceptorService as Je, SheetsSelectionsService as Ce, INTERCEPTOR_POINT as jt, RemoveNumfmtMutation as be, SetNumfmtMutation as Ne, BEFORE_CELL_EDIT as Bt, AFTER_CELL_EDIT as Vt, SetRangeValuesCommand as Wt, transformCellsToRange as Gt, factorySetNumfmtUndoMutation as Kt, factoryRemoveNumfmtUndoMutation as Zt, RangeProtectionPermissionEditPoint as G, WorksheetSetCellStylePermission as K, WorksheetEditPermission as Z, WorkbookEditablePermission as Y } from "@univerjs/sheets";
10
- import { IZenZoneService as Yt, useDependency as C, ComponentManager as Qe, ISidebarService as zt, getMenuHiddenObservable as z, MenuItemType as X, ILayoutService as Xt, RibbonStartGroup as qt, IMenuManagerService as Jt } from "@univerjs/ui";
11
- import { debounceTime as Qt, merge as et, Observable as L, combineLatest as en, filter as tn } from "rxjs";
12
- import { map as nn, switchMap as rn, tap as sn, debounceTime as on } from "rxjs/operators";
13
- import { jsxs as y, jsx as m } from "react/jsx-runtime";
14
- import { createContext as an, useState as N, useEffect as oe, useRef as Ie, useContext as tt, useMemo as R, forwardRef as nt, createElement as Ee, useCallback as cn } from "react";
15
- import { InputNumber as Te, Select as Me, SelectList as xe, Input as ln, clsx as un, borderClassName as mn, Button as Oe, Separator as dn } from "@univerjs/design";
6
+ import { SHEETS_NUMFMT_PLUGIN_CONFIG_KEY as Et, currencySymbols as Re, getDecimalFromPattern as ee, getCurrencyType as V, setPatternDecimal as R, getCurrencyFormatOptions as le, CURRENCYFORMAT as Tt, DATEFMTLISG as Mt, NUMBERFORMAT as wt, getDateFormatOptions as Ve, getNumberFormatOptions as We, isPatternHasDecimal as xt, SheetsNumfmtCellContentController as Ge, getPatternPreviewIgnoreGeneral as Pt, getPatternType as Se, SetNumfmtCommand as Ke, SetPercentCommand as Ze, SubtractDecimalCommand as Ye, AddDecimalCommand as ze, SetCurrencyCommand as Xe, MenuCurrencyService as Rt, countryCurrencyMap as D, getPatternPreview as Ot, UniverSheetsNumfmtPlugin as Ut } from "@univerjs/sheets-numfmt";
7
+ import { HoverManagerService as kt, CellAlertManagerService as Dt, CellAlertType as $t, SheetSkeletonManagerService as Ft, IEditorBridgeService as At, deriveStateFromActiveSheet$ as Lt, getCurrentRangeDisable$ as W, UniverSheetsUIPlugin as Ht } from "@univerjs/sheets-ui";
8
+ import { isTextFormat as qe, isDefaultFormat as jt, DEFAULT_TEXT_FORMAT_EXCEL as Bt } from "@univerjs/engine-numfmt";
9
+ import { INumfmtService as ye, SheetInterceptorService as Je, SheetsSelectionsService as Ce, INTERCEPTOR_POINT as Vt, RemoveNumfmtMutation as be, SetNumfmtMutation as Ie, BEFORE_CELL_EDIT as Wt, AFTER_CELL_EDIT as Gt, SetRangeValuesCommand as Kt, transformCellsToRange as Zt, factorySetNumfmtUndoMutation as Yt, factoryRemoveNumfmtUndoMutation as zt, RangeProtectionPermissionEditPoint as G, WorksheetSetCellStylePermission as K, WorksheetEditPermission as Z, WorkbookEditablePermission as Y } from "@univerjs/sheets";
10
+ import { IZenZoneService as Xt, useDependency as I, ComponentManager as Qe, ISidebarService as qt, getMenuHiddenObservable as z, MenuItemType as X, ILayoutService as Jt, RibbonDataGroup as Qt, IMenuManagerService as en } from "@univerjs/ui";
11
+ import { debounceTime as tn, merge as et, Observable as L, combineLatest as nn, filter as rn } from "rxjs";
12
+ import { map as sn, switchMap as on, tap as cn, debounceTime as an } from "rxjs/operators";
13
+ import { jsxs as b, jsx as d } from "react/jsx-runtime";
14
+ import { createContext as ln, useState as N, useEffect as oe, useRef as Ne, useContext as tt, useMemo as O, forwardRef as nt, createElement as Ee, useCallback as un } from "react";
15
+ import { InputNumber as Te, Select as Me, SelectList as we, Input as mn, clsx as rt, borderClassName as dn, Button as Oe, scrollbarClassName as hn, Separator as fn } from "@univerjs/design";
16
16
  const Ue = {};
17
- var hn = Object.getOwnPropertyDescriptor, fn = (e, t, r, n) => {
18
- for (var i = n > 1 ? void 0 : n ? hn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
17
+ var vn = Object.getOwnPropertyDescriptor, pn = (e, t, r, n) => {
18
+ for (var i = n > 1 ? void 0 : n ? vn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
19
19
  (o = e[s]) && (i = o(i) || i);
20
20
  return i;
21
- }, D = (e, t) => (r, n) => t(r, n, e);
21
+ }, $ = (e, t) => (r, n) => t(r, n, e);
22
22
  const ue = "SHEET_NUMFMT_ALERT";
23
23
  let pe = class extends ie {
24
24
  constructor(e, t, r, n, i, s, o) {
@@ -28,7 +28,7 @@ let pe = class extends ie {
28
28
  this._initCellAlertPopup(), this._initZenService();
29
29
  }
30
30
  _initCellAlertPopup() {
31
- this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(Qt(100)).subscribe((e) => {
31
+ this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(tn(100)).subscribe((e) => {
32
32
  var t, r;
33
33
  if (e) {
34
34
  const n = e.location, i = this._context.unit, s = i.getActiveSheet();
@@ -37,21 +37,21 @@ let pe = class extends ie {
37
37
  let c;
38
38
  const u = s.getCell(n.row, n.col);
39
39
  if (u != null && u.s) {
40
- const d = i.getStyles().get(u.s);
41
- d != null && d.n && (c = d.n);
40
+ const h = i.getStyles().get(u.s);
41
+ h != null && h.n && (c = h.n);
42
42
  }
43
43
  if (c || (c = this._numfmtService.getValue(o, a, n.row, n.col)), !c) {
44
44
  this._hideAlert();
45
45
  return;
46
46
  }
47
- if (qe(c.pattern) && (u != null && u.v) && ht(u.v)) {
48
- if ((t = this._configService.getConfig(Nt)) != null && t.disableTextFormatAlert)
47
+ if (qe(c.pattern) && (u != null && u.v) && ft(u.v)) {
48
+ if ((t = this._configService.getConfig(Et)) != null && t.disableTextFormatAlert)
49
49
  return;
50
- const d = this._cellAlertManagerService.currentAlert.get(ue), l = (r = d == null ? void 0 : d.alert) == null ? void 0 : r.location;
50
+ const h = this._cellAlertManagerService.currentAlert.get(ue), l = (r = h == null ? void 0 : h.alert) == null ? void 0 : r.location;
51
51
  if (l && l.row === n.row && l.col === n.col && l.subUnitId === n.subUnitId && l.unitId === n.unitId)
52
52
  return;
53
53
  this._cellAlertManagerService.showAlert({
54
- type: kt.WARNING,
54
+ type: $t.ERROR,
55
55
  title: this._localeService.t("info.error"),
56
56
  message: this._localeService.t("info.forceStringInfo"),
57
57
  location: n,
@@ -74,13 +74,13 @@ let pe = class extends ie {
74
74
  this._cellAlertManagerService.removeAlert(ue);
75
75
  }
76
76
  };
77
- pe = fn([
78
- D(1, S(Ot)),
79
- D(2, S(Ut)),
80
- D(3, S(M)),
81
- D(4, Yt),
82
- D(5, S(ye)),
83
- D(6, Fe)
77
+ pe = pn([
78
+ $(1, C(kt)),
79
+ $(2, C(Dt)),
80
+ $(3, C(M)),
81
+ $(4, Xt),
82
+ $(5, C(ye)),
83
+ $(6, Fe)
84
84
  ], pe);
85
85
  const me = {
86
86
  id: "sheet.operation.close.numfmt.panel",
@@ -94,12 +94,12 @@ const me = {
94
94
  type: Ae.OPERATION,
95
95
  handler: (e) => (e.get(B).openPanel(), !0)
96
96
  };
97
- var vn = Object.getOwnPropertyDescriptor, pn = (e, t, r, n) => {
98
- for (var i = n > 1 ? void 0 : n ? vn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
97
+ var gn = Object.getOwnPropertyDescriptor, _n = (e, t, r, n) => {
98
+ for (var i = n > 1 ? void 0 : n ? gn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
99
99
  (o = e[s]) && (i = o(i) || i);
100
100
  return i;
101
- }, gn = (e, t) => (r, n) => t(r, n, e);
102
- const Pe = an([]);
101
+ }, Sn = (e, t) => (r, n) => t(r, n, e);
102
+ const xe = ln([]);
103
103
  let j = class {
104
104
  constructor(e) {
105
105
  this._localStorageService = e;
@@ -133,9 +133,9 @@ let j = class {
133
133
  };
134
134
  });
135
135
  return t.sort((s, o) => {
136
- var u, d;
136
+ var u, h;
137
137
  const a = ((u = i.find((l) => l.value === s)) == null ? void 0 : u.priority) || -1;
138
- return (((d = i.find((l) => l.value === o)) == null ? void 0 : d.priority) || -1) - a;
138
+ return (((h = i.find((l) => l.value === o)) == null ? void 0 : h.priority) || -1) - a;
139
139
  });
140
140
  }
141
141
  return n || [];
@@ -144,11 +144,11 @@ let j = class {
144
144
  this._localStorageService.removeItem(e);
145
145
  }
146
146
  };
147
- j = pn([
148
- gn(0, S(Le))
147
+ j = _n([
148
+ Sn(0, C(Le))
149
149
  ], j);
150
- const ke = "numfmtCurrency", _n = (e) => {
151
- const t = C(j), [r, n] = N(Re);
150
+ const ke = "numfmtCurrency", yn = (e) => {
151
+ const t = I(j), [r, n] = N(Re);
152
152
  return oe(() => {
153
153
  t.addHabit("numfmtCurrency", []).then(() => {
154
154
  t.getHabit(ke, [...Re]).then((s) => {
@@ -158,8 +158,8 @@ const ke = "numfmtCurrency", _n = (e) => {
158
158
  }, []), { userHabitCurrency: r, mark: (s) => {
159
159
  t.markHabit(ke, s);
160
160
  } };
161
- }, Sn = () => {
162
- const e = Ie([]), [t, r] = N({});
161
+ }, Cn = () => {
162
+ const e = Ne([]), [t, r] = N({});
163
163
  return oe(() => {
164
164
  e.current.forEach((i) => {
165
165
  i();
@@ -167,20 +167,20 @@ const ke = "numfmtCurrency", _n = (e) => {
167
167
  }, [t]), (i) => {
168
168
  e.current.push(i), r({});
169
169
  };
170
- }, yn = (e) => !!V(e) && e.startsWith("_("), Cn = (e) => {
171
- const { defaultPattern: t, action: r, onChange: n } = e, [i, s] = N(() => ee(t || "", 2)), o = tt(Pe), [a, c] = N(() => V(t) || o[0]), u = R(() => o.map((p) => ({ label: p, value: p })), []), l = C(M).t;
172
- r.current = () => w(`_("${a}"* #,##0${i > 0 ? ".0" : ""}_)`, i);
173
- const h = (p) => {
174
- c(p), n(w(`_("${p}"* #,##0${i > 0 ? ".0" : ""}_)`, i));
175
- }, f = (p) => {
176
- const v = p || 0;
177
- s(v), n(w(`_("${a}"* #,##0${v > 0 ? ".0" : ""}_)`, v));
170
+ }, bn = (e) => !!V(e) && e.startsWith("_("), In = (e) => {
171
+ const { defaultPattern: t, action: r, onChange: n } = e, [i, s] = N(() => ee(t || "", 2)), o = tt(xe), [a, c] = N(() => V(t) || o[0]), u = O(() => o.map((p) => ({ label: p, value: p })), []), l = I(M).t;
172
+ r.current = () => R(`_("${a}"* #,##0${i > 0 ? ".0" : ""}_)`, i);
173
+ const f = (p) => {
174
+ c(p), n(R(`_("${p}"* #,##0${i > 0 ? ".0" : ""}_)`, i));
175
+ }, v = (p) => {
176
+ const m = p || 0;
177
+ s(m), n(R(`_("${a}"* #,##0${m > 0 ? ".0" : ""}_)`, m));
178
178
  };
179
- return /* @__PURE__ */ y("div", { children: [
180
- /* @__PURE__ */ y("div", { className: "univer-mt-4 univer-flex univer-justify-between", children: [
181
- /* @__PURE__ */ y("div", { className: "option", children: [
182
- /* @__PURE__ */ m("div", { className: "univer-text-sm univer-text-gray-400", children: l("sheet.numfmt.decimalLength") }),
183
- /* @__PURE__ */ m("div", { className: "univer-mt-2 univer-w-32", children: /* @__PURE__ */ m(
179
+ return /* @__PURE__ */ b("div", { children: [
180
+ /* @__PURE__ */ b("div", { className: "univer-mt-4 univer-flex univer-justify-between", children: [
181
+ /* @__PURE__ */ b("div", { className: "option", children: [
182
+ /* @__PURE__ */ d("div", { className: "univer-text-sm univer-text-gray-400", children: l("sheet.numfmt.decimalLength") }),
183
+ /* @__PURE__ */ d("div", { className: "univer-mt-2 univer-w-32", children: /* @__PURE__ */ d(
184
184
  Te,
185
185
  {
186
186
  value: i,
@@ -188,47 +188,47 @@ const ke = "numfmtCurrency", _n = (e) => {
188
188
  precision: 0,
189
189
  max: 20,
190
190
  min: 0,
191
- onChange: f
191
+ onChange: v
192
192
  }
193
193
  ) })
194
194
  ] }),
195
- /* @__PURE__ */ y("div", { className: "option", children: [
196
- /* @__PURE__ */ m("div", { className: "univer-text-sm univer-text-gray-400", children: l("sheet.numfmt.currencyType") }),
197
- /* @__PURE__ */ m("div", { className: "univer-mt-2 univer-w-36", children: /* @__PURE__ */ m(
195
+ /* @__PURE__ */ b("div", { className: "option", children: [
196
+ /* @__PURE__ */ d("div", { className: "univer-text-sm univer-text-gray-400", children: l("sheet.numfmt.currencyType") }),
197
+ /* @__PURE__ */ d("div", { className: "univer-mt-2 univer-w-36", children: /* @__PURE__ */ d(
198
198
  Me,
199
199
  {
200
200
  options: u,
201
201
  value: a,
202
- onChange: h
202
+ onChange: f
203
203
  }
204
204
  ) })
205
205
  ] })
206
206
  ] }),
207
- /* @__PURE__ */ m("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: l("sheet.numfmt.accountingDes") })
207
+ /* @__PURE__ */ d("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: l("sheet.numfmt.accountingDes") })
208
208
  ] });
209
- }, bn = (e) => !!V(e) && !e.startsWith("_("), Nn = (e) => {
210
- const r = C(M).t, n = tt(Pe), [i, s] = N(() => V(e.defaultPattern) || n[0]), [o, a] = N(() => ee(e.defaultPattern || "", 2)), [c, u] = N(() => {
209
+ }, Nn = (e) => !!V(e) && !e.startsWith("_("), En = (e) => {
210
+ const r = I(M).t, n = tt(xe), [i, s] = N(() => V(e.defaultPattern) || n[0]), [o, a] = N(() => ee(e.defaultPattern || "", 2)), [c, u] = N(() => {
211
211
  var g;
212
- const v = le(i);
213
- return ((g = v.find((I) => se(I.value, e.defaultPattern))) == null ? void 0 : g.value) || v[0].value;
214
- }), d = R(() => le(i), [i]), l = R(() => n.map((v) => ({ label: v, value: v })), [n]);
215
- e.action.current = () => w(c, o);
216
- const h = (v) => {
217
- if (v === void 0)
212
+ const m = le(i);
213
+ return ((g = m.find((y) => se(y.value, e.defaultPattern))) == null ? void 0 : g.value) || m[0].value;
214
+ }), h = O(() => le(i), [i]), l = O(() => n.map((m) => ({ label: m, value: m })), [n]);
215
+ e.action.current = () => R(c, o);
216
+ const f = (m) => {
217
+ if (m === void 0)
218
218
  return;
219
- s(v);
220
- const b = le(v)[0].value;
221
- u(b), e.onChange(w(b, o));
222
- }, f = (v) => {
223
- v !== void 0 && (u(v), e.onChange(w(v, o)));
224
- }, p = (v) => {
225
- a(v || 0), e.onChange(w(c, v || 0));
219
+ s(m);
220
+ const S = le(m)[0].value;
221
+ u(S), e.onChange(R(S, o));
222
+ }, v = (m) => {
223
+ m !== void 0 && (u(m), e.onChange(R(m, o)));
224
+ }, p = (m) => {
225
+ a(m || 0), e.onChange(R(c, m || 0));
226
226
  };
227
- return /* @__PURE__ */ y("div", { children: [
228
- /* @__PURE__ */ y("div", { className: "univer-mt-4 univer-flex univer-justify-between", children: [
229
- /* @__PURE__ */ y("div", { className: "option", children: [
230
- /* @__PURE__ */ m("div", { className: "univer-text-sm univer-text-gray-400", children: r("sheet.numfmt.decimalLength") }),
231
- /* @__PURE__ */ m("div", { className: "univer-mt-2 univer-w-32", children: /* @__PURE__ */ m(
227
+ return /* @__PURE__ */ b("div", { children: [
228
+ /* @__PURE__ */ b("div", { className: "univer-mt-4 univer-flex univer-justify-between", children: [
229
+ /* @__PURE__ */ b("div", { className: "option", children: [
230
+ /* @__PURE__ */ d("div", { className: "univer-text-sm univer-text-gray-400", children: r("sheet.numfmt.decimalLength") }),
231
+ /* @__PURE__ */ d("div", { className: "univer-mt-2 univer-w-32", children: /* @__PURE__ */ d(
232
232
  Te,
233
233
  {
234
234
  value: o,
@@ -238,21 +238,21 @@ const ke = "numfmtCurrency", _n = (e) => {
238
238
  }
239
239
  ) })
240
240
  ] }),
241
- /* @__PURE__ */ y("div", { className: "option", children: [
242
- /* @__PURE__ */ m("div", { className: "univer-text-sm univer-text-gray-400", children: r("sheet.numfmt.currencyType") }),
243
- /* @__PURE__ */ m("div", { className: "univer-mt-2 univer-w-36", children: /* @__PURE__ */ m(
241
+ /* @__PURE__ */ b("div", { className: "option", children: [
242
+ /* @__PURE__ */ d("div", { className: "univer-text-sm univer-text-gray-400", children: r("sheet.numfmt.currencyType") }),
243
+ /* @__PURE__ */ d("div", { className: "univer-mt-2 univer-w-36", children: /* @__PURE__ */ d(
244
244
  Me,
245
245
  {
246
246
  value: i,
247
247
  options: l,
248
- onChange: h
248
+ onChange: f
249
249
  }
250
250
  ) })
251
251
  ] })
252
252
  ] }),
253
- /* @__PURE__ */ m("div", { className: "univer-mt-4 label", children: r("sheet.numfmt.negType") }),
254
- /* @__PURE__ */ m("div", { className: "univer-mt-2", children: /* @__PURE__ */ m(xe, { value: c, options: d, onChange: f }) }),
255
- /* @__PURE__ */ m("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: r("sheet.numfmt.currencyDes") })
253
+ /* @__PURE__ */ d("div", { className: "univer-mt-4 label", children: r("sheet.numfmt.negType") }),
254
+ /* @__PURE__ */ d("div", { className: "univer-mt-2", children: /* @__PURE__ */ d(we, { value: c, options: h, onChange: v }) }),
255
+ /* @__PURE__ */ d("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: r("sheet.numfmt.currencyDes") })
256
256
  ] });
257
257
  };
258
258
  var E = function() {
@@ -263,23 +263,23 @@ var E = function() {
263
263
  }
264
264
  return e;
265
265
  }, E.apply(this, arguments);
266
- }, In = function(e, t) {
266
+ }, Tn = function(e, t) {
267
267
  var r = {};
268
268
  for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
269
269
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
270
270
  for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
271
271
  t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
272
272
  return r;
273
- }, rt = nt(function(e, t) {
274
- var r = e.icon, n = e.id, i = e.className, s = e.extend, o = In(e, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), c = Ie("_".concat(Mn()));
275
- return it(r, "".concat(n), { defIds: r.defIds, idSuffix: c.current }, E({ ref: t, className: a }, o), s);
273
+ }, it = nt(function(e, t) {
274
+ var r = e.icon, n = e.id, i = e.className, s = e.extend, o = Tn(e, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), c = Ne("_".concat(xn()));
275
+ return st(r, "".concat(n), { defIds: r.defIds, idSuffix: c.current }, E({ ref: t, className: a }, o), s);
276
276
  });
277
- function it(e, t, r, n, i) {
278
- return Ee(e.tag, E(E({ key: t }, En(e, r, i)), n), (Tn(e, r).children || []).map(function(s, o) {
279
- return it(s, "".concat(t, "-").concat(e.tag, "-").concat(o), r, void 0, i);
277
+ function st(e, t, r, n, i) {
278
+ return Ee(e.tag, E(E({ key: t }, Mn(e, r, i)), n), (wn(e, r).children || []).map(function(s, o) {
279
+ return st(s, "".concat(t, "-").concat(e.tag, "-").concat(o), r, void 0, i);
280
280
  }));
281
281
  }
282
- function En(e, t, r) {
282
+ function Mn(e, t, r) {
283
283
  var n = E({}, e.attrs);
284
284
  r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1), e.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(function(s) {
285
285
  var o = s[0], a = s[1];
@@ -291,138 +291,141 @@ function En(e, t, r) {
291
291
  typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
292
292
  })), n;
293
293
  }
294
- function Tn(e, t) {
294
+ function wn(e, t) {
295
295
  var r, n = t.defIds;
296
296
  return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ? E(E({}, e), { children: e.children.map(function(i) {
297
- return typeof i.attrs.id == "string" && n && n.indexOf(i.attrs.id) > -1 ? E(E({}, i), { attrs: E(E({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
297
+ return typeof i.attrs.id == "string" && n && n.includes(i.attrs.id) ? E(E({}, i), { attrs: E(E({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
298
298
  }) }) : e;
299
299
  }
300
- function Mn() {
300
+ function xn() {
301
301
  return Math.random().toString(36).substring(2, 8);
302
302
  }
303
- rt.displayName = "UniverIcon";
304
- var xn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, st = nt(function(e, t) {
305
- return Ee(rt, Object.assign({}, e, {
306
- id: "check-mark-single",
303
+ it.displayName = "UniverIcon";
304
+ var Pn = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, ot = nt(function(e, t) {
305
+ return Ee(it, Object.assign({}, e, {
306
+ id: "check-mark-icon",
307
307
  ref: t,
308
- icon: xn
308
+ icon: Pn
309
309
  }));
310
310
  });
311
- st.displayName = "CheckMarkSingle";
311
+ ot.displayName = "CheckMarkIcon";
312
312
  const de = "customFormat", he = "numfmt_custom_pattern";
313
- function Pn(e) {
314
- const { defaultPattern: t, action: r, onChange: n } = e, i = C(j), s = C(Le), o = C(M), [a, c] = N(t);
315
- r.current = () => (i.markHabit(de, a), s.getItem(he).then((f = []) => {
316
- const p = [.../* @__PURE__ */ new Set([a, ...f || []])].splice(0, 10).filter((v) => !!v);
313
+ function Rn(e) {
314
+ const { defaultPattern: t, action: r, onChange: n } = e, i = I(j), s = I(Le), o = I(M), [a, c] = N(t);
315
+ r.current = () => (i.markHabit(de, a), s.getItem(he).then((v = []) => {
316
+ const p = [.../* @__PURE__ */ new Set([a, ...v || []])].splice(0, 10).filter((m) => !!m);
317
317
  s.setItem(he, p);
318
318
  }), a);
319
- const [u, d] = N([]);
319
+ const [u, h] = N([]);
320
320
  oe(() => {
321
- s.getItem(he).then((f) => {
321
+ s.getItem(he).then((v) => {
322
322
  const p = [
323
- ...It.map((v) => v.suffix("$")),
324
- ...Et.map((v) => v.suffix),
325
- ...Tt.map((v) => v.suffix)
323
+ ...Tt.map((m) => m.suffix("$")),
324
+ ...Mt.map((m) => m.suffix),
325
+ ...wt.map((m) => m.suffix)
326
326
  ];
327
- p.push(...f || []), i.addHabit(de, []).finally(() => {
328
- i.getHabit(de, p).then((v) => {
329
- d([...new Set(v)]);
327
+ p.push(...v || []), i.addHabit(de, []).finally(() => {
328
+ i.getHabit(de, p).then((m) => {
329
+ h([...new Set(m)]);
330
330
  });
331
331
  });
332
332
  });
333
333
  }, []);
334
- const l = (f) => {
335
- c(f), n(f);
336
- }, h = () => {
334
+ const l = (v) => {
335
+ c(v), n(v);
336
+ }, f = () => {
337
337
  n(a);
338
338
  };
339
- return /* @__PURE__ */ y("div", { children: [
340
- /* @__PURE__ */ m("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: o.t("sheet.numfmt.customFormat") }),
341
- /* @__PURE__ */ m(
342
- ln,
339
+ return /* @__PURE__ */ b("div", { children: [
340
+ /* @__PURE__ */ d("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: o.t("sheet.numfmt.customFormat") }),
341
+ /* @__PURE__ */ d(
342
+ mn,
343
343
  {
344
344
  placeholder: o.t("sheet.numfmt.customFormat"),
345
- onBlur: h,
345
+ onBlur: f,
346
346
  value: a,
347
347
  onChange: c,
348
348
  className: "univer-mt-2 univer-w-full"
349
349
  }
350
350
  ),
351
- /* @__PURE__ */ m(
351
+ /* @__PURE__ */ d(
352
352
  "div",
353
353
  {
354
- className: un("univer-mt-2 univer-max-h-[400px] univer-overflow-auto univer-rounded-lg univer-p-2", mn),
355
- children: u.map((f) => /* @__PURE__ */ y(
354
+ className: rt("univer-mt-2 univer-max-h-[400px] univer-overflow-auto univer-rounded-lg univer-p-2", dn),
355
+ children: u.map((v) => /* @__PURE__ */ b(
356
356
  "div",
357
357
  {
358
- onClick: () => l(f),
358
+ onClick: () => l(v),
359
359
  className: "univer-flex univer-cursor-pointer univer-items-center univer-gap-1.5 univer-py-1.5 univer-text-sm",
360
360
  children: [
361
- /* @__PURE__ */ m("div", { className: "univer-flex univer-w-4 univer-items-center univer-text-primary-600", children: a === f && /* @__PURE__ */ m(st, {}) }),
362
- /* @__PURE__ */ m("div", { children: f })
361
+ /* @__PURE__ */ d("div", { className: "univer-flex univer-w-4 univer-items-center univer-text-primary-600", children: a === v && /* @__PURE__ */ d(ot, {}) }),
362
+ /* @__PURE__ */ d("div", { children: v })
363
363
  ]
364
364
  },
365
- f
365
+ v
366
366
  ))
367
367
  }
368
368
  ),
369
- /* @__PURE__ */ m(
369
+ /* @__PURE__ */ d(
370
370
  "div",
371
371
  {
372
- className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:univer-text-gray-200",
372
+ className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
373
373
  children: o.t("sheet.numfmt.customFormatDes")
374
374
  }
375
375
  )
376
376
  ] });
377
377
  }
378
- const wn = (e) => {
379
- const t = J.getInfo(e);
378
+ const On = (e) => {
379
+ const t = J.getFormatInfo(e);
380
380
  return Ve().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
381
- }, Rn = (e) => {
382
- const t = R(Ve, []), n = C(M).t, [i, s] = N(() => {
383
- if (e.defaultPattern) {
384
- const a = t.find((c) => c.value === e.defaultPattern);
385
- if (a)
386
- return a.value;
381
+ };
382
+ function Un(e) {
383
+ const { onChange: t, defaultPattern: r } = e, n = O(Ve, []), i = I(M), [s, o] = N(() => {
384
+ if (r) {
385
+ const c = n.find((u) => u.value === r);
386
+ if (c)
387
+ return c.value;
387
388
  }
388
- return t[0].value;
389
+ return n[0].value;
389
390
  });
390
- e.action.current = () => i;
391
- const o = (a) => {
392
- a !== void 0 && (s(a), e.onChange(a));
391
+ e.action.current = () => s;
392
+ const a = (c) => {
393
+ c !== void 0 && (o(c), t(c));
393
394
  };
394
- return /* @__PURE__ */ y("div", { children: [
395
- /* @__PURE__ */ m("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: n("sheet.numfmt.dateType") }),
396
- /* @__PURE__ */ m("div", { className: "univer-mt-2", children: /* @__PURE__ */ m(xe, { value: i, options: t, onChange: o }) }),
397
- /* @__PURE__ */ m(
395
+ return /* @__PURE__ */ b("div", { children: [
396
+ /* @__PURE__ */ d("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: i.t("sheet.numfmt.dateType") }),
397
+ /* @__PURE__ */ d("div", { className: "univer-mt-2", children: /* @__PURE__ */ d(we, { value: s, options: n, onChange: a }) }),
398
+ /* @__PURE__ */ d(
398
399
  "div",
399
400
  {
400
- className: "univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:univer-text-gray-200",
401
- children: n("sheet.numfmt.dateDes")
401
+ className: "univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200",
402
+ children: i.t("sheet.numfmt.dateDes")
402
403
  }
403
404
  )
404
405
  ] });
405
- }, On = (e) => !e, Un = (e) => {
406
- const r = C(M).t;
407
- return e.action.current = () => "", /* @__PURE__ */ m("div", { children: /* @__PURE__ */ m(
406
+ }
407
+ const kn = (e) => !e, Dn = (e) => {
408
+ const r = I(M).t;
409
+ return e.action.current = () => "", /* @__PURE__ */ d("div", { children: /* @__PURE__ */ d(
408
410
  "div",
409
411
  {
410
- className: "univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:univer-text-gray-200",
412
+ className: "univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200",
411
413
  children: r("sheet.numfmt.generalDes")
412
414
  }
413
415
  ) });
414
- }, kn = (e) => We().some((t) => se(t.value, e)), Dn = (e) => {
415
- const t = C(M), r = R(We, []), [n, i] = N(() => ee(e.defaultPattern || "", 0)), [s, o] = N(() => {
416
- const l = r.find((h) => se(h.value, e.defaultPattern || ""));
416
+ }, $n = (e) => We().some((t) => se(t.value, e));
417
+ function Fn(e) {
418
+ const t = I(M), r = O(We, []), [n, i] = N(() => ee(e.defaultPattern || "", 0)), [s, o] = N(() => {
419
+ const l = r.find((f) => se(f.value, e.defaultPattern || ""));
417
420
  return (l == null ? void 0 : l.value) || r[0].value;
418
- }), a = R(() => w(s, Number(n || 0)), [s, n]), c = R(() => !Mt(s), [s]), u = (l) => {
419
- i(l || 0), e.onChange(w(s, Number(l || 0)));
420
- }, d = (l) => {
421
+ }), a = O(() => R(s, Number(n || 0)), [s, n]), c = O(() => !xt(s), [s]), u = (l) => {
422
+ i(l || 0), e.onChange(R(s, Number(l || 0)));
423
+ }, h = (l) => {
421
424
  l !== void 0 && (i(ee(l, 0)), o(l), e.onChange(l));
422
425
  };
423
- return e.action.current = () => a, /* @__PURE__ */ y("div", { children: [
424
- /* @__PURE__ */ m("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: t.t("sheet.numfmt.decimalLength") }),
425
- /* @__PURE__ */ m("div", { className: "univer-mt-2", children: /* @__PURE__ */ m(
426
+ return e.action.current = () => a, /* @__PURE__ */ b("div", { children: [
427
+ /* @__PURE__ */ d("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: t.t("sheet.numfmt.decimalLength") }),
428
+ /* @__PURE__ */ d("div", { className: "univer-mt-2", children: /* @__PURE__ */ d(
426
429
  Te,
427
430
  {
428
431
  disabled: c,
@@ -432,83 +435,84 @@ const wn = (e) => {
432
435
  onChange: u
433
436
  }
434
437
  ) }),
435
- /* @__PURE__ */ y("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: [
438
+ /* @__PURE__ */ b("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: [
436
439
  " ",
437
440
  t.t("sheet.numfmt.negType")
438
441
  ] }),
439
- /* @__PURE__ */ m("div", { className: "univer-mt-2", children: /* @__PURE__ */ m(xe, { onChange: d, options: r, value: s }) }),
440
- /* @__PURE__ */ m(
442
+ /* @__PURE__ */ d("div", { className: "univer-mt-2", children: /* @__PURE__ */ d(we, { onChange: h, options: r, value: s }) }),
443
+ /* @__PURE__ */ d(
441
444
  "div",
442
445
  {
443
- className: "univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:univer-text-gray-200",
446
+ className: "univer-mt-3.5 univer-text-sm/5 univer-text-gray-600 dark:!univer-text-gray-200",
444
447
  children: t.t("sheet.numfmt.thousandthPercentileDes")
445
448
  }
446
449
  )
447
450
  ] });
448
- }, $n = (e) => {
449
- const { defaultValue: t, defaultPattern: r, row: n, col: i } = e.value, s = C(M), o = Ie(() => ""), a = s.t, c = Sn(), u = R(
451
+ }
452
+ const An = (e) => {
453
+ const { defaultValue: t, defaultPattern: r, row: n, col: i } = e.value, s = I(M), o = Ne(() => ""), a = s.t, c = Cn(), u = O(
450
454
  () => [
451
- { label: "sheet.numfmt.general", component: Un },
452
- { label: "sheet.numfmt.accounting", component: Cn },
453
- { label: "sheet.numfmt.currency", component: Nn },
454
- { label: "sheet.numfmt.date", component: Rn },
455
- { label: "sheet.numfmt.thousandthPercentile", component: Dn },
456
- { label: "sheet.numfmt.customFormat", component: Pn }
455
+ { label: "sheet.numfmt.general", component: Dn },
456
+ { label: "sheet.numfmt.accounting", component: In },
457
+ { label: "sheet.numfmt.currency", component: En },
458
+ { label: "sheet.numfmt.date", component: Un },
459
+ { label: "sheet.numfmt.thousandthPercentile", component: Fn },
460
+ { label: "sheet.numfmt.customFormat", component: Rn }
457
461
  ].map((_) => ({ ..._, label: a(_.label) })),
458
462
  []
459
- ), [d, l] = N(g), [h, f] = N(() => `${n}_${i}`), { mark: p, userHabitCurrency: v } = _n(() => f(`${n}_${i}_userCurrency'`)), b = R(() => {
463
+ ), [h, l] = N(g), [f, v] = N(() => `${n}_${i}`), { mark: p, userHabitCurrency: m } = yn(() => v(`${n}_${i}_userCurrency'`)), S = O(() => {
460
464
  var _;
461
- return (_ = u.find((U) => U.label === d)) == null ? void 0 : _.component;
462
- }, [d]);
465
+ return (_ = u.find((k) => k.label === h)) == null ? void 0 : _.component;
466
+ }, [h]);
463
467
  function g() {
464
- return [On, yn, bn, wn, kn].reduce((U, lt, ut) => U || (lt(r) ? u[ut].label : ""), "") || u[0].label;
468
+ return [kn, bn, Nn, On, $n].reduce((k, ut, mt) => k || (ut(r) ? u[mt].label : ""), "") || u[0].label;
465
469
  }
466
- const I = u.map((_) => ({
470
+ const y = u.map((_) => ({
467
471
  label: _.label,
468
472
  value: _.label
469
- })), O = (_) => {
473
+ })), x = (_) => {
470
474
  l(_), c(() => e.onChange({ type: "change", value: o.current() || "" }));
471
- }, P = cn((_) => {
475
+ }, P = un((_) => {
472
476
  e.onChange({ type: "change", value: _ });
473
- }, []), ae = () => {
474
- const _ = o.current() || "", U = V(_);
475
- U && p(U), e.onChange({ type: "confirm", value: _ });
477
+ }, []), ce = () => {
478
+ const _ = o.current() || "", k = V(_);
479
+ k && p(k), e.onChange({ type: "confirm", value: _ });
476
480
  }, F = () => {
477
481
  e.onChange({ type: "cancel", value: "" });
478
- }, ce = {
482
+ }, ae = {
479
483
  onChange: P,
480
484
  defaultValue: t,
481
485
  defaultPattern: r,
482
486
  action: o
483
487
  };
484
488
  return oe(() => {
485
- l(g()), f(`${n}_${i}`);
486
- }, [n, i]), /* @__PURE__ */ y(
489
+ l(g()), v(`${n}_${i}`);
490
+ }, [n, i]), /* @__PURE__ */ b(
487
491
  "div",
488
492
  {
489
- className: "univer-flex univer-h-full univer-flex-col univer-justify-between univer-overflow-y-auto univer-pb-5",
493
+ className: rt("univer-flex univer-h-full univer-flex-col univer-justify-between univer-overflow-y-auto univer-pb-5", hn),
490
494
  children: [
491
- /* @__PURE__ */ y("div", { children: [
492
- /* @__PURE__ */ m("div", { className: "univer-mt-3.5 univer-text-sm univer-text-gray-400", children: a("sheet.numfmt.numfmtType") }),
493
- /* @__PURE__ */ m("div", { className: "univer-mt-2", children: /* @__PURE__ */ m(Me, { className: "univer-w-full", value: d, options: I, onChange: O }) }),
494
- /* @__PURE__ */ m("div", { children: b && /* @__PURE__ */ m(Pe.Provider, { value: v, children: /* @__PURE__ */ Ee(b, { ...ce, key: h }) }) })
495
+ /* @__PURE__ */ b("div", { children: [
496
+ /* @__PURE__ */ d("div", { className: "univer-mt-3.5 univer-text-sm univer-text-gray-400", children: a("sheet.numfmt.numfmtType") }),
497
+ /* @__PURE__ */ d("div", { className: "univer-mt-2", children: /* @__PURE__ */ d(Me, { className: "univer-w-full", value: h, options: y, onChange: x }) }),
498
+ /* @__PURE__ */ d("div", { children: S && /* @__PURE__ */ d(xe.Provider, { value: m, children: /* @__PURE__ */ Ee(S, { ...ae, key: f }) }) })
495
499
  ] }),
496
- /* @__PURE__ */ y("div", { className: "univer-mb-5 univer-mt-3.5 univer-flex univer-justify-end", children: [
497
- /* @__PURE__ */ m(Oe, { onClick: F, className: "univer-mr-3", children: a("sheet.numfmt.cancel") }),
498
- /* @__PURE__ */ m(Oe, { variant: "primary", onClick: ae, children: a("sheet.numfmt.confirm") })
500
+ /* @__PURE__ */ b("div", { className: "univer-mb-5 univer-mt-3.5 univer-flex univer-justify-end", children: [
501
+ /* @__PURE__ */ d(Oe, { onClick: F, className: "univer-mr-3", children: a("sheet.numfmt.cancel") }),
502
+ /* @__PURE__ */ d(Oe, { variant: "primary", onClick: ce, children: a("sheet.numfmt.confirm") })
499
503
  ] })
500
504
  ]
501
505
  }
502
506
  );
503
507
  };
504
- var Fn = Object.getOwnPropertyDescriptor, An = (e, t, r, n) => {
505
- for (var i = n > 1 ? void 0 : n ? Fn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
508
+ var Ln = Object.getOwnPropertyDescriptor, Hn = (e, t, r, n) => {
509
+ for (var i = n > 1 ? void 0 : n ? Ln(t, r) : t, s = e.length - 1, o; s >= 0; s--)
506
510
  (o = e[s]) && (i = o(i) || i);
507
511
  return i;
508
- }, x = (e, t) => (r, n) => t(r, n, e);
512
+ }, w = (e, t) => (r, n) => t(r, n, e);
509
513
  const De = "SHEET_NUMFMT_PANEL";
510
514
  let B = class extends ie {
511
- constructor(t, r, n, i, s, o, a, c, u, d, l) {
515
+ constructor(t, r, n, i, s, o, a, c, u, h, l) {
512
516
  super();
513
517
  /**
514
518
  * If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
@@ -518,7 +522,7 @@ let B = class extends ie {
518
522
  */
519
523
  q(this, "_previewPattern", "");
520
524
  q(this, "_sidebarDisposable", null);
521
- this._sheetInterceptorService = t, this._themeService = r, this._univerInstanceService = n, this._commandService = i, this._selectionManagerService = s, this._renderManagerService = o, this._numfmtService = a, this._componentManager = c, this._sidebarService = u, this._localeService = d, this._sheetsNumfmtCellContentController = l, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener(), this._initNumfmtLocalChange();
525
+ this._sheetInterceptorService = t, this._themeService = r, this._univerInstanceService = n, this._commandService = i, this._selectionManagerService = s, this._renderManagerService = o, this._numfmtService = a, this._componentManager = c, this._sidebarService = u, this._localeService = h, this._sheetsNumfmtCellContentController = l, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener(), this._initNumfmtLocalChange();
522
526
  }
523
527
  _initNumfmtLocalChange() {
524
528
  this.disposeWithMe(et(this._sheetsNumfmtCellContentController.local$, this._localeService.currentLocale$).subscribe(() => {
@@ -526,47 +530,47 @@ let B = class extends ie {
526
530
  }));
527
531
  }
528
532
  openPanel() {
529
- var b;
530
- const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, i = this._univerInstanceService, s = this._numfmtService, o = this._localeService, c = (((b = r.getCurrentSelections()) == null ? void 0 : b.map((g) => g.range)) || [])[0];
533
+ var S;
534
+ const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, i = this._univerInstanceService, s = this._numfmtService, o = this._localeService, c = (((S = r.getCurrentSelections()) == null ? void 0 : S.map((g) => g.range)) || [])[0];
531
535
  if (!c)
532
536
  return !1;
533
- const u = i.getCurrentUnitForType(T.UNIVER_SHEET), d = u.getActiveSheet();
534
- if (!d)
537
+ const u = i.getCurrentUnitForType(T.UNIVER_SHEET), h = u.getActiveSheet();
538
+ if (!h)
535
539
  return !1;
536
- const l = d.getCellRaw(c.startRow, c.startColumn), h = s.getValue(
540
+ const l = h.getCellRaw(c.startRow, c.startColumn), f = s.getValue(
537
541
  u.getUnitId(),
538
- d.getSheetId(),
542
+ h.getSheetId(),
539
543
  c.startRow,
540
544
  c.startColumn
541
545
  );
542
- let f = "";
543
- h && (f = h.pattern);
544
- const p = (l == null ? void 0 : l.t) === $.NUMBER ? l.v : 12345678, v = {
546
+ let v = "";
547
+ f && (v = f.pattern);
548
+ const p = (l == null ? void 0 : l.t) === U.NUMBER ? l.v : 12345678, m = {
545
549
  onChange: (g) => {
546
- var I;
550
+ var y;
547
551
  if (g.type === "change")
548
552
  this._previewPattern = g.value, this._forceUpdate();
549
553
  else if (g.type === "confirm") {
550
- const O = ((I = r.getCurrentSelections()) == null ? void 0 : I.map((F) => F.range)) || [], P = { values: [] }, ae = Se(g.value);
551
- O.forEach((F) => {
552
- He.foreach(F, (ce, _) => {
554
+ const x = ((y = r.getCurrentSelections()) == null ? void 0 : y.map((F) => F.range)) || [], P = { values: [] }, ce = Se(g.value);
555
+ x.forEach((F) => {
556
+ He.foreach(F, (ae, _) => {
553
557
  P.values.push({
554
- row: ce,
558
+ row: ae,
555
559
  col: _,
556
560
  pattern: g.value,
557
- type: ae
561
+ type: ce
558
562
  });
559
563
  });
560
564
  }), n.executeCommand(Ke.id, P), t.close();
561
565
  } else g.type === "cancel" && t.close();
562
566
  },
563
- value: { defaultPattern: f, defaultValue: p, row: c.startRow, col: c.startColumn }
567
+ value: { defaultPattern: v, defaultValue: p, row: c.startRow, col: c.startColumn }
564
568
  };
565
569
  return this._sidebarDisposable = t.open({
566
570
  header: { title: o.t("sheet.numfmt.title") },
567
571
  children: {
568
572
  label: De,
569
- ...v
573
+ ...m
570
574
  // need passthrough to react props.
571
575
  },
572
576
  onClose: () => {
@@ -579,7 +583,7 @@ let B = class extends ie {
579
583
  const r = this._renderManagerService.getRenderById(
580
584
  t != null ? t : this._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET).getUnitId()
581
585
  );
582
- r == null || r.with(Dt).reCalculate(), (n = r == null ? void 0 : r.mainComponent) == null || n.makeDirty();
586
+ r == null || r.with(Ft).reCalculate(), (n = r == null ? void 0 : r.mainComponent) == null || n.makeDirty();
583
587
  }
584
588
  _initCommands() {
585
589
  [
@@ -590,7 +594,9 @@ let B = class extends ie {
590
594
  });
591
595
  }
592
596
  _initPanel() {
593
- this._componentManager.register(De, $n);
597
+ this.disposeWithMe(
598
+ this._componentManager.register(De, An)
599
+ );
594
600
  }
595
601
  // eslint-disable-next-line max-lines-per-function
596
602
  _initRealTimeRenderingInterceptor() {
@@ -598,58 +604,59 @@ let B = class extends ie {
598
604
  this._commandService.onCommandExecuted((i) => {
599
605
  i.id === H.id && n.next(!0), i.id === me.id && n.next(!1);
600
606
  });
601
- }), r = en([
607
+ }), r = nn([
602
608
  t,
603
609
  this._selectionManagerService.selectionMoveEnd$.pipe(
604
- nn((n) => n ? n.map((i) => i.range) : [])
610
+ sn((n) => n ? n.map((i) => i.range) : [])
605
611
  )
606
612
  ]);
607
613
  this.disposeWithMe(
608
614
  ve(
609
615
  r.pipe(
610
- rn(
616
+ on(
611
617
  ([n, i]) => new L((s) => {
612
- const o = new vt();
618
+ const o = new pt();
613
619
  return n && i.length && s.next({ selectionRanges: i, disposableCollection: o }), () => {
614
620
  o.dispose();
615
621
  };
616
622
  })
617
623
  ),
618
- sn(() => {
624
+ cn(() => {
619
625
  this._previewPattern = null;
620
626
  })
621
627
  ).subscribe(({ disposableCollection: n, selectionRanges: i }) => {
622
628
  var o, a;
623
629
  const s = this._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET);
624
630
  this.openPanel(), n.add(
625
- this._sheetInterceptorService.intercept(jt.CELL_CONTENT, {
631
+ this._sheetInterceptorService.intercept(Vt.CELL_CONTENT, {
626
632
  priority: 99,
627
- effect: we.Value | we.Style,
628
- handler: (c, u, d) => {
629
- const { row: l, col: h } = u, f = d(c) || {};
633
+ effect: Pe.Value | Pe.Style,
634
+ handler: (c, u, h) => {
635
+ var p;
636
+ const { row: l, col: f } = u, v = h(c) || {};
630
637
  if (i.find(
631
- (p) => p.startColumn <= h && p.endColumn >= h && p.startRow <= l && p.endRow >= l
638
+ (m) => m.startColumn <= f && m.endColumn >= f && m.startRow <= l && m.endRow >= l
632
639
  )) {
633
- const p = u.worksheet.getCellRaw(l, h), v = p == null ? void 0 : p.v, b = p == null ? void 0 : p.t;
634
- if (v == null || b !== $.NUMBER || this._previewPattern === null)
635
- return f;
636
- const g = xt(this._previewPattern, v, this._sheetsNumfmtCellContentController.local);
637
- if (g.color) {
638
- const I = this._themeService.getColorFromTheme(`${g.color}.500`);
640
+ const m = u.worksheet.getCellRaw(l, f), S = m == null ? void 0 : m.v, g = m == null ? void 0 : m.t;
641
+ if (S == null || g !== U.NUMBER || this._previewPattern === null)
642
+ return v;
643
+ const y = Pt(this._previewPattern, S, this._sheetsNumfmtCellContentController.local);
644
+ if (y.color) {
645
+ const x = (p = this._themeService.getColorFromTheme(`${y.color}.500`)) != null ? p : y.color;
639
646
  return {
640
- ...f,
641
- v: g.result,
642
- t: $.STRING,
643
- s: { cl: { rgb: I } }
647
+ ...v,
648
+ v: y.result,
649
+ t: U.STRING,
650
+ s: { cl: { rgb: x } }
644
651
  };
645
652
  }
646
653
  return {
647
- ...f,
648
- v: g.result,
649
- t: $.STRING
654
+ ...v,
655
+ v: y.result,
656
+ t: U.STRING
650
657
  };
651
658
  }
652
- return f;
659
+ return v;
653
660
  }
654
661
  })
655
662
  ), (a = (o = this._renderManagerService.getRenderById(s.getUnitId())) == null ? void 0 : o.mainComponent) == null || a.makeDirty();
@@ -658,7 +665,7 @@ let B = class extends ie {
658
665
  );
659
666
  }
660
667
  _commandExecutedListener() {
661
- const t = [be.id, Ne.id];
668
+ const t = [be.id, Ie.id];
662
669
  this.disposeWithMe(
663
670
  new L((r) => {
664
671
  const n = this._commandService.onCommandExecuted((i) => {
@@ -668,7 +675,7 @@ let B = class extends ie {
668
675
  }
669
676
  });
670
677
  return () => n.dispose();
671
- }).pipe(on(16)).subscribe((r) => this._forceUpdate(r))
678
+ }).pipe(an(16)).subscribe((r) => this._forceUpdate(r))
672
679
  );
673
680
  }
674
681
  _initCloseListener() {
@@ -678,25 +685,25 @@ let B = class extends ie {
678
685
  });
679
686
  }
680
687
  };
681
- B = An([
682
- x(0, S(Je)),
683
- x(1, S(ft)),
684
- x(2, ge),
685
- x(3, _e),
686
- x(4, S(Ce)),
687
- x(5, Be),
688
- x(6, ye),
689
- x(7, S(Qe)),
690
- x(8, zt),
691
- x(9, S(M)),
692
- x(10, S(Ge))
688
+ B = Hn([
689
+ w(0, C(Je)),
690
+ w(1, C(vt)),
691
+ w(2, ge),
692
+ w(3, _e),
693
+ w(4, C(Ce)),
694
+ w(5, Be),
695
+ w(6, ye),
696
+ w(7, C(Qe)),
697
+ w(8, qt),
698
+ w(9, C(M)),
699
+ w(10, C(Ge))
693
700
  ], B);
694
- var Ln = Object.getOwnPropertyDescriptor, Hn = (e, t, r, n) => {
695
- for (var i = n > 1 ? void 0 : n ? Ln(t, r) : t, s = e.length - 1, o; s >= 0; s--)
701
+ var jn = Object.getOwnPropertyDescriptor, Bn = (e, t, r, n) => {
702
+ for (var i = n > 1 ? void 0 : n ? jn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
696
703
  (o = e[s]) && (i = o(i) || i);
697
704
  return i;
698
705
  }, A = (e, t) => (r, n) => t(r, n, e);
699
- const jn = () => {
706
+ const Vn = () => {
700
707
  let e = [];
701
708
  return {
702
709
  add: (i, s, o, a, c) => e.push({ unitId: i, subUnitId: s, row: o, col: a, value: c }),
@@ -710,13 +717,13 @@ let te = class extends ie {
710
717
  constructor(t, r, n, i, s) {
711
718
  super();
712
719
  // collect effect mutations when edit end and push this to commands stack in next commands progress
713
- q(this, "_collectEffectMutation", jn());
720
+ q(this, "_collectEffectMutation", Vn());
714
721
  this._sheetInterceptorService = t, this._numfmtService = r, this._univerInstanceService = n, this._injector = i, this._editorBridgeService = s, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
715
722
  }
716
723
  _initInterceptorEditorStart() {
717
724
  this._editorBridgeService && this.disposeWithMe(
718
725
  ve(
719
- this._sheetInterceptorService.writeCellInterceptor.intercept(Bt, {
726
+ this._sheetInterceptorService.writeCellInterceptor.intercept(Wt, {
720
727
  handler: (t, r, n) => {
721
728
  const i = r.row, s = r.col, o = this._numfmtService.getValue(
722
729
  r.unitId,
@@ -751,13 +758,14 @@ let te = class extends ie {
751
758
  * @private
752
759
  * @memberof NumfmtService
753
760
  */
761
+ // eslint-disable-next-line max-lines-per-function
754
762
  _initInterceptorEditorEnd() {
755
763
  this.disposeWithMe(
756
764
  ve(
757
- this._sheetInterceptorService.writeCellInterceptor.intercept(Vt, {
765
+ this._sheetInterceptorService.writeCellInterceptor.intercept(Gt, {
758
766
  // eslint-disable-next-line complexity
759
767
  handler: (t, r, n) => {
760
- var c, u, d;
768
+ var c, u, h;
761
769
  this._collectEffectMutation.clean();
762
770
  const i = this._numfmtService.getValue(
763
771
  r.unitId,
@@ -765,17 +773,24 @@ let te = class extends ie {
765
773
  r.row,
766
774
  r.col
767
775
  );
768
- if (!(t != null && t.v) && !(t != null && t.p) || qe(i == null ? void 0 : i.pattern) || t.t === $.FORCE_STRING)
776
+ if (!(t != null && t.v) && !(t != null && t.p) || qe(i == null ? void 0 : i.pattern) || t.t === U.FORCE_STRING)
769
777
  return n(t);
770
- const s = (c = t.p) == null ? void 0 : c.body, o = (d = (u = t == null ? void 0 : t.p) == null ? void 0 : u.body) != null && d.dataStream ? t.p.body.dataStream.replace(/\r\n$/, "") : String(t.v), a = J.parseDate(o) || J.parseTime(o) || J.parseNumber(o);
778
+ const s = (c = t.p) == null ? void 0 : c.body, o = (h = (u = t == null ? void 0 : t.p) == null ? void 0 : u.body) != null && h.dataStream ? t.p.body.dataStream.replace(/\r\n$/, "") : String(t.v), a = J.parseDate(o) || J.parseTime(o) || J.parseNumber(o);
771
779
  if (s)
772
- if (Bn(s)) {
773
- const { dataStream: l } = s, h = l.replace(/\r\n$/, ""), f = Number(h);
774
- if (Number.isNaN(f) && !a)
780
+ if (Wn(s)) {
781
+ const { dataStream: l } = s, f = l.replace(/\r\n$/, ""), v = Number(f);
782
+ if (Number.isNaN(v) && !a)
775
783
  return n(t);
776
784
  } else
777
785
  return n(t);
778
786
  if (a) {
787
+ if (!a.z && _t(o))
788
+ return n({
789
+ ...t,
790
+ p: void 0,
791
+ v: o,
792
+ t: U.FORCE_STRING
793
+ });
779
794
  a.z && this._collectEffectMutation.add(
780
795
  r.unitId,
781
796
  r.subUnitId,
@@ -786,7 +801,7 @@ let te = class extends ie {
786
801
  }
787
802
  );
788
803
  const l = Number(a.v);
789
- return n({ ...t, p: void 0, v: l, t: $.NUMBER });
804
+ return n({ ...t, p: void 0, v: l, t: U.NUMBER });
790
805
  }
791
806
  return n(t);
792
807
  }
@@ -801,7 +816,7 @@ let te = class extends ie {
801
816
  getMutations(r) {
802
817
  var n;
803
818
  switch (r.id) {
804
- case Wt.id: {
819
+ case Kt.id: {
805
820
  const i = t._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET), s = i.getUnitId(), o = (n = i.getActiveSheet()) == null ? void 0 : n.getSheetId();
806
821
  if (!o)
807
822
  return {
@@ -814,31 +829,31 @@ let te = class extends ie {
814
829
  redos: [],
815
830
  undos: []
816
831
  };
817
- const c = a.filter((h) => {
818
- var f;
819
- return !!((f = h.value) != null && f.pattern);
820
- }).map((h) => ({
821
- row: h.row,
822
- col: h.col,
823
- pattern: h.value.pattern
824
- })), u = a.filter((h) => {
825
- var f;
826
- return !((f = h.value) != null && f.pattern);
827
- }).map((h) => ({
828
- startRow: h.row,
829
- endColumn: h.col,
830
- startColumn: h.col,
831
- endRow: h.row
832
- })), d = [], l = [];
832
+ const c = a.filter((f) => {
833
+ var v;
834
+ return !!((v = f.value) != null && v.pattern);
835
+ }).map((f) => ({
836
+ row: f.row,
837
+ col: f.col,
838
+ pattern: f.value.pattern
839
+ })), u = a.filter((f) => {
840
+ var v;
841
+ return !((v = f.value) != null && v.pattern);
842
+ }).map((f) => ({
843
+ startRow: f.row,
844
+ endColumn: f.col,
845
+ startColumn: f.col,
846
+ endRow: f.row
847
+ })), h = [], l = [];
833
848
  if (c.length) {
834
- const h = {
835
- id: Ne.id,
836
- params: Gt(s, o, c)
849
+ const f = {
850
+ id: Ie.id,
851
+ params: Zt(s, o, c)
837
852
  };
838
- d.push(h), l.push(...Kt(t._injector, h.params));
853
+ h.push(f), l.push(...Yt(t._injector, f.params));
839
854
  }
840
855
  if (u.length) {
841
- const h = {
856
+ const f = {
842
857
  id: be.id,
843
858
  params: {
844
859
  unitId: s,
@@ -846,10 +861,10 @@ let te = class extends ie {
846
861
  ranges: u
847
862
  }
848
863
  };
849
- d.push(h), l.push(...Zt(t._injector, h.params));
864
+ h.push(f), l.push(...zt(t._injector, f.params));
850
865
  }
851
866
  return {
852
- redos: d,
867
+ redos: h,
853
868
  undos: l.reverse()
854
869
  };
855
870
  }
@@ -863,14 +878,14 @@ let te = class extends ie {
863
878
  );
864
879
  }
865
880
  };
866
- te = Hn([
867
- A(0, S(Je)),
868
- A(1, S(ye)),
869
- A(2, S(ge)),
870
- A(3, S(je)),
871
- A(4, pt($t))
881
+ te = Bn([
882
+ A(0, C(Je)),
883
+ A(1, C(ye)),
884
+ A(2, C(ge)),
885
+ A(3, C(je)),
886
+ A(4, gt(At))
872
887
  ], te);
873
- function Bn(e) {
888
+ function Wn(e) {
874
889
  const { textRuns: t = [], paragraphs: r = [], customRanges: n, customBlocks: i = [] } = e, s = ["va"];
875
890
  return !(t.some((o) => !!(o.ts && Object.keys(o.ts).some((c) => s.includes(c)))) || r.some((o) => o.bullet) || r.length >= 2 || n != null && n.length || i.length > 0);
876
891
  }
@@ -881,7 +896,7 @@ const Q = [
881
896
  },
882
897
  {
883
898
  label: "sheet.numfmt.text",
884
- pattern: Ht
899
+ pattern: Bt
885
900
  },
886
901
  "|",
887
902
  {
@@ -935,21 +950,24 @@ const Q = [
935
950
  label: "sheet.numfmt.moreFmt",
936
951
  pattern: ""
937
952
  }
938
- ], Vn = (e) => ({
953
+ ], Gn = (e) => ({
939
954
  icon: new L((t) => {
940
- const r = e.get(Pt);
941
- function n(s) {
942
- return {
943
- [k.US]: "DollarSingle",
944
- [k.RU]: "RoubleSingle",
945
- [k.CN]: "RmbSingle",
946
- [k.AT]: "EuroSingle"
947
- }[s] || "DollarSingle";
955
+ var s;
956
+ const r = e.get(Rt);
957
+ function n(o) {
958
+ var c;
959
+ return (c = {
960
+ [D.US]: "DollarIcon",
961
+ [D.RU]: "RoubleIcon",
962
+ [D.CN]: "RmbIcon",
963
+ [D.AT]: "EuroIcon"
964
+ }[o]) != null ? c : "DollarIcon";
948
965
  }
949
- const i = k[r.getCurrencySymbol()] || "$";
950
- return t.next(n(i)), r.currencySymbol$.subscribe((s) => {
951
- const o = k[s] || "$";
952
- t.next(n(o));
966
+ const i = (s = D[r.getCurrencySymbol()]) != null ? s : "$";
967
+ return t.next(n(i)), r.currencySymbol$.subscribe((o) => {
968
+ var c;
969
+ const a = (c = D[o]) != null ? c : "$";
970
+ t.next(n(a));
953
971
  });
954
972
  }),
955
973
  id: Xe.id,
@@ -958,63 +976,63 @@ const Q = [
958
976
  type: X.BUTTON,
959
977
  hidden$: z(e, T.UNIVER_SHEET),
960
978
  disabled$: W(e, { workbookTypes: [Y], worksheetTypes: [Z, K], rangeTypes: [G] })
961
- }), Wn = (e) => ({
962
- icon: "AddDigitsSingle",
979
+ }), Kn = (e) => ({
980
+ icon: "AddDigitsIcon",
963
981
  id: ze.id,
964
982
  title: "sheet.numfmt.addDecimal",
965
983
  tooltip: "sheet.numfmt.addDecimal",
966
984
  type: X.BUTTON,
967
985
  hidden$: z(e, T.UNIVER_SHEET),
968
986
  disabled$: W(e, { workbookTypes: [Y], worksheetTypes: [Z, K], rangeTypes: [G] })
969
- }), Gn = (e) => ({
970
- icon: "ReduceDigitsSingle",
987
+ }), Zn = (e) => ({
988
+ icon: "ReduceDigitsIcon",
971
989
  id: Ye.id,
972
990
  title: "sheet.numfmt.subtractDecimal",
973
991
  tooltip: "sheet.numfmt.subtractDecimal",
974
992
  type: X.BUTTON,
975
993
  hidden$: z(e, T.UNIVER_SHEET),
976
994
  disabled$: W(e, { workbookTypes: [Y], worksheetTypes: [Z, K], rangeTypes: [G] })
977
- }), Kn = (e) => ({
978
- icon: "PercentSingle",
995
+ }), Yn = (e) => ({
996
+ icon: "PercentIcon",
979
997
  id: Ze.id,
980
998
  title: "sheet.numfmt.percent",
981
999
  tooltip: "sheet.numfmt.percent",
982
1000
  type: X.BUTTON,
983
1001
  hidden$: z(e, T.UNIVER_SHEET),
984
1002
  disabled$: W(e, { workbookTypes: [Y], worksheetTypes: [Z, K], rangeTypes: [G] })
985
- }), Zn = (e) => {
986
- const t = e.get(ge), r = e.get(_e), n = e.get(M), i = e.get(Ce), s = [be.id, Ne.id], o = Ft(
1003
+ }), zn = (e) => {
1004
+ const t = e.get(ge), r = e.get(_e), n = e.get(M), i = e.get(Ce), s = [be.id, Ie.id], o = Lt(
987
1005
  t,
988
1006
  "",
989
1007
  ({ workbook: a, worksheet: c }) => new L(
990
1008
  (u) => et(
991
1009
  i.selectionMoveEnd$,
992
- gt(r.onCommandExecuted.bind(r)).pipe(
993
- tn(([d]) => s.includes(d.id))
1010
+ St(r.onCommandExecuted.bind(r)).pipe(
1011
+ rn(([h]) => s.includes(h.id))
994
1012
  )
995
1013
  ).subscribe(() => {
996
- var l, h;
997
- const d = i.getCurrentSelections();
998
- if (d && d[0]) {
999
- const f = d[0].range, p = f.startRow, v = f.startColumn, b = (h = a.getStyles().get((l = c.getCell(p, v)) == null ? void 0 : l.s)) == null ? void 0 : h.n, g = b == null ? void 0 : b.pattern;
1000
- let I = n.t("sheet.numfmt.general");
1001
- if (Lt(g)) {
1002
- u.next(I);
1014
+ var l, f;
1015
+ const h = i.getCurrentSelections();
1016
+ if (h && h[0]) {
1017
+ const v = h[0].range, p = v.startRow, m = v.startColumn, S = (f = a.getStyles().get((l = c.getCell(p, m)) == null ? void 0 : l.s)) == null ? void 0 : f.n, g = S == null ? void 0 : S.pattern;
1018
+ let y = n.t("sheet.numfmt.general");
1019
+ if (jt(g)) {
1020
+ u.next(y);
1003
1021
  return;
1004
1022
  }
1005
1023
  if (g) {
1006
- const O = Q.filter((P) => typeof P == "object" && P.pattern).find(
1024
+ const x = Q.filter((P) => typeof P == "object" && P.pattern).find(
1007
1025
  (P) => se(g, P.pattern)
1008
1026
  );
1009
- O && typeof O == "object" && O.pattern ? I = n.t(O.label) : I = n.t("sheet.numfmt.moreFmt");
1027
+ x && typeof x == "object" && x.pattern ? y = n.t(x.label) : y = n.t("sheet.numfmt.moreFmt");
1010
1028
  }
1011
- u.next(I);
1029
+ u.next(y);
1012
1030
  }
1013
1031
  })
1014
1032
  )
1015
1033
  );
1016
1034
  return {
1017
- label: ot,
1035
+ label: ct,
1018
1036
  id: H.id,
1019
1037
  tooltip: "sheet.numfmt.title",
1020
1038
  type: X.SELECTOR,
@@ -1032,17 +1050,17 @@ const Q = [
1032
1050
  hidden$: z(e, T.UNIVER_SHEET),
1033
1051
  disabled$: W(e, { workbookTypes: [Y], worksheetTypes: [K, Z], rangeTypes: [G] })
1034
1052
  };
1035
- }, ot = "sheet.numfmt.moreNumfmtType", at = "sheet.numfmt.moreNumfmtType.options", Yn = (e) => {
1036
- const { value: t } = e, r = C(M), n = t != null ? t : r.t("sheet.numfmt.general");
1037
- return /* @__PURE__ */ m("span", { className: "univer-text-sm", children: n });
1038
- }, zn = () => {
1039
- const e = C(_e), t = C(M), r = C(Xt), n = C(Ge), i = C(Ce), s = (c) => {
1053
+ }, ct = "sheet.numfmt.moreNumfmtType", at = "sheet.numfmt.moreNumfmtType.options", Xn = (e) => {
1054
+ const { value: t } = e, r = I(M), n = t != null ? t : r.t("sheet.numfmt.general");
1055
+ return /* @__PURE__ */ d("span", { className: "univer-text-sm", children: n });
1056
+ }, qn = () => {
1057
+ const e = I(_e), t = I(M), r = I(Jt), n = I(Ge), i = I(Ce), s = (c) => {
1040
1058
  const u = i.getCurrentLastSelection();
1041
1059
  if (!u)
1042
1060
  return;
1043
- const d = u.range, l = [];
1044
- He.foreach(d, (h, f) => {
1045
- c ? l.push({ row: h, col: f, pattern: c, type: Se(c) }) : l.push({ row: h, col: f });
1061
+ const h = u.range, l = [];
1062
+ He.foreach(h, (f, v) => {
1063
+ c ? l.push({ row: f, col: v, pattern: c, type: Se(c) }) : l.push({ row: f, col: v });
1046
1064
  }), e.executeCommand(Ke.id, { values: l }), r.focus();
1047
1065
  }, o = (c) => {
1048
1066
  if (c === 0)
@@ -1054,46 +1072,46 @@ const Q = [
1054
1072
  u.pattern && s(u.pattern);
1055
1073
  }
1056
1074
  }, a = 1220;
1057
- return /* @__PURE__ */ m("div", { className: "univer-grid univer-gap-1 univer-p-1.5", children: Q.map((c, u) => c === "|" ? /* @__PURE__ */ m(dn, {}, u) : /* @__PURE__ */ y(
1075
+ return /* @__PURE__ */ d("div", { className: "univer-grid univer-gap-1 univer-p-1.5", children: Q.map((c, u) => c === "|" ? /* @__PURE__ */ d(fn, {}, u) : /* @__PURE__ */ b(
1058
1076
  "div",
1059
1077
  {
1060
- className: "univer-flex univer-h-7 univer-items-center univer-justify-between univer-gap-6 univer-rounded univer-px-2 univer-text-sm dark:hover:univer-bg-gray-700 hover:univer-bg-gray-100",
1078
+ className: "univer-flex univer-h-7 univer-items-center univer-justify-between univer-gap-6 univer-rounded univer-px-2 univer-text-sm dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100",
1061
1079
  onClick: () => {
1062
1080
  o(u);
1063
1081
  },
1064
1082
  children: [
1065
- /* @__PURE__ */ m("span", { children: t.t(c.label) }),
1066
- /* @__PURE__ */ m("span", { className: "univer-text-xs univer-text-gray-500", children: c.pattern ? wt(c.pattern || "", a, n.local).result.trim() : "" })
1083
+ /* @__PURE__ */ d("span", { children: t.t(c.label) }),
1084
+ /* @__PURE__ */ d("span", { className: "univer-text-xs univer-text-gray-500", children: c.pattern ? Ot(c.pattern || "", a, n.local).result.trim() : "" })
1067
1085
  ]
1068
1086
  },
1069
1087
  u
1070
1088
  )) });
1071
- }, Xn = {
1072
- [qt.FORMULAS_INSERT]: {
1089
+ }, Jn = {
1090
+ [Qt.FORMULAS]: {
1073
1091
  [Xe.id]: {
1074
- order: 4,
1075
- menuItemFactory: Vn
1092
+ order: 0,
1093
+ menuItemFactory: Gn
1076
1094
  },
1077
1095
  [ze.id]: {
1078
- order: 5,
1079
- menuItemFactory: Wn
1096
+ order: 1,
1097
+ menuItemFactory: Kn
1080
1098
  },
1081
1099
  [Ye.id]: {
1082
- order: 6,
1083
- menuItemFactory: Gn
1100
+ order: 2,
1101
+ menuItemFactory: Zn
1084
1102
  },
1085
1103
  [Ze.id]: {
1086
- order: 7,
1087
- menuItemFactory: Kn
1104
+ order: 3,
1105
+ menuItemFactory: Yn
1088
1106
  },
1089
1107
  [H.id]: {
1090
- order: 8,
1091
- menuItemFactory: Zn
1108
+ order: 4,
1109
+ menuItemFactory: zn
1092
1110
  }
1093
1111
  }
1094
1112
  };
1095
- var qn = Object.getOwnPropertyDescriptor, Jn = (e, t, r, n) => {
1096
- for (var i = n > 1 ? void 0 : n ? qn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
1113
+ var Qn = Object.getOwnPropertyDescriptor, er = (e, t, r, n) => {
1114
+ for (var i = n > 1 ? void 0 : n ? Qn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
1097
1115
  (o = e[s]) && (i = o(i) || i);
1098
1116
  return i;
1099
1117
  }, $e = (e, t) => (r, n) => t(r, n, e);
@@ -1102,23 +1120,30 @@ let ne = class extends ie {
1102
1120
  super(), this._componentManager = e, this._menuManagerService = t, this._initMenu();
1103
1121
  }
1104
1122
  _initMenu() {
1105
- this._menuManagerService.mergeMenu(Xn), this.disposeWithMe(this._componentManager.register(ot, Yn)), this.disposeWithMe(this._componentManager.register(at, zn));
1123
+ this._menuManagerService.mergeMenu(Jn), [
1124
+ [ct, Xn],
1125
+ [at, qn]
1126
+ ].forEach(([e, t]) => {
1127
+ this.disposeWithMe(
1128
+ this._componentManager.register(e, t)
1129
+ );
1130
+ });
1106
1131
  }
1107
1132
  };
1108
- ne = Jn([
1109
- $e(0, S(Qe)),
1110
- $e(1, Jt)
1133
+ ne = er([
1134
+ $e(0, C(Qe)),
1135
+ $e(1, en)
1111
1136
  ], ne);
1112
- var Qn = Object.defineProperty, er = Object.getOwnPropertyDescriptor, tr = (e, t, r) => t in e ? Qn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, nr = (e, t, r, n) => {
1113
- for (var i = n > 1 ? void 0 : n ? er(t, r) : t, s = e.length - 1, o; s >= 0; s--)
1137
+ var tr = Object.defineProperty, nr = Object.getOwnPropertyDescriptor, rr = (e, t, r) => t in e ? tr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ir = (e, t, r, n) => {
1138
+ for (var i = n > 1 ? void 0 : n ? nr(t, r) : t, s = e.length - 1, o; s >= 0; s--)
1114
1139
  (o = e[s]) && (i = o(i) || i);
1115
1140
  return i;
1116
- }, fe = (e, t) => (r, n) => t(r, n, e), ct = (e, t, r) => tr(e, typeof t != "symbol" ? t + "" : t, r);
1117
- const rr = "SHEET_NUMFMT_UI_PLUGIN";
1118
- let re = class extends St {
1141
+ }, fe = (e, t) => (r, n) => t(r, n, e), lt = (e, t, r) => rr(e, typeof t != "symbol" ? t + "" : t, r);
1142
+ const sr = "SHEET_NUMFMT_UI_PLUGIN";
1143
+ let re = class extends Ct {
1119
1144
  constructor(e = Ue, t, r, n) {
1120
1145
  super(), this._config = e, this._injector = t, this._configService = r, this._renderManagerService = n;
1121
- const { menu: i, ...s } = yt(
1146
+ const { menu: i, ...s } = bt(
1122
1147
  {},
1123
1148
  Ue,
1124
1149
  this._config
@@ -1126,7 +1151,7 @@ let re = class extends St {
1126
1151
  i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig("sheets-numfmt-ui.config", s);
1127
1152
  }
1128
1153
  onStarting() {
1129
- Ct(this._injector, [
1154
+ It(this._injector, [
1130
1155
  [B],
1131
1156
  [te],
1132
1157
  [j],
@@ -1134,7 +1159,7 @@ let re = class extends St {
1134
1159
  ]);
1135
1160
  }
1136
1161
  onRendered() {
1137
- this._registerRenderModules(), bt(this._injector, [
1162
+ this._registerRenderModules(), Nt(this._injector, [
1138
1163
  [B],
1139
1164
  [te],
1140
1165
  [ne]
@@ -1148,11 +1173,11 @@ let re = class extends St {
1148
1173
  });
1149
1174
  }
1150
1175
  };
1151
- ct(re, "pluginName", rr);
1152
- ct(re, "type", T.UNIVER_SHEET);
1153
- re = nr([
1154
- _t(At, Rt),
1155
- fe(1, S(je)),
1176
+ lt(re, "pluginName", sr);
1177
+ lt(re, "type", T.UNIVER_SHEET);
1178
+ re = ir([
1179
+ yt(Ht, Ut),
1180
+ fe(1, C(je)),
1156
1181
  fe(2, Fe),
1157
1182
  fe(3, Be)
1158
1183
  ], re);