@univerjs/sheets-numfmt-ui 0.6.7 → 0.6.9-experimental.20250403-d914ddc

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
@@ -3,20 +3,20 @@ var ht = (e, t, r) => t in e ? dt(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var J = (e, t, r) => ht(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import { Inject as S, LocaleService as M, IConfigService as Le, Disposable as oe, isRealNum as ft, CommandType as He, ILocalStorageService as Ae, numfmt as Q, ThemeService as pt, IUniverInstanceService as Se, ICommandService as ye, UniverInstanceType as T, CellValueType as x, toDisposable as ge, DisposableCollection as vt, InterceptorEffectEnum as Oe, Range as je, Injector as Be, Optional as gt, fromCallback as _t, DependentOn as St, Plugin as yt, merge as bt, registerDependencies as Ct, touchDependencies as It } from "@univerjs/core";
5
5
  import { IRenderManagerService as We } from "@univerjs/engine-render";
6
- import { SHEETS_NUMFMT_PLUGIN_CONFIG_KEY as Nt, currencySymbols as Ue, getDecimalFromPattern as te, getCurrencyType as V, setPatternDecimal as O, getCurrencyFormatOptions as ue, isPatternEqualWithoutDecimal as ce, CURRENCYFORMAT as Et, DATEFMTLISG as Tt, NUMBERFORMAT as Mt, getDateFormatOptions as Ve, getNumberFormatOptions as Ge, isPatternHasDecimal as Pt, SheetsNumfmtCellContentController as Ke, getPatternPreviewIgnoreGeneral as wt, getPatternType as ne, SetNumfmtCommand as Ye, SetPercentCommand as Ze, SubtractDecimalCommand as ze, AddDecimalCommand as Xe, SetCurrencyCommand as qe, MenuCurrencyService as Rt, countryCurrencyMap as $, getPatternPreview as Ot, UniverSheetsNumfmtPlugin as Ut } from "@univerjs/sheets-numfmt";
6
+ import { SHEETS_NUMFMT_PLUGIN_CONFIG_KEY as Nt, currencySymbols as Ue, getDecimalFromPattern as te, getCurrencyType as V, setPatternDecimal as O, getCurrencyFormatOptions as ue, isPatternEqualWithoutDecimal as ce, CURRENCYFORMAT as Et, DATEFMTLISG as Tt, NUMBERFORMAT as Mt, getDateFormatOptions as Ve, getNumberFormatOptions as Ge, isPatternHasDecimal as Pt, SheetsNumfmtCellContentController as Ke, getPatternPreviewIgnoreGeneral as wt, getPatternType as ne, SetNumfmtCommand as Ze, SetPercentCommand as ze, SubtractDecimalCommand as Ye, AddDecimalCommand as Xe, SetCurrencyCommand as qe, MenuCurrencyService as Rt, countryCurrencyMap as $, getPatternPreview as Ot, UniverSheetsNumfmtPlugin as Ut } from "@univerjs/sheets-numfmt";
7
7
  import { HoverManagerService as Dt, CellAlertManagerService as Ft, CellAlertType as kt, SheetSkeletonManagerService as $t, IEditorBridgeService as xt, deriveStateFromActiveSheet$ as Lt, getCurrentRangeDisable$ as G, UniverSheetsUIPlugin as Ht } from "@univerjs/sheets-ui";
8
- import { IZenZoneService as At, useDependency as C, ComponentManager as Je, ISidebarService as jt, getMenuHiddenObservable as K, MenuItemType as Y, ILayoutService as Bt, RibbonStartGroup as Wt, IMenuManagerService as Vt, UI_PLUGIN_CONFIG_KEY as Gt } from "@univerjs/ui";
9
- import { FormulaDataModel as Kt } from "@univerjs/engine-formula";
10
- import { isTextFormat as Qe, isDefaultFormat as Yt, DEFAULT_TEXT_FORMAT_EXCEL as Zt } from "@univerjs/engine-numfmt";
11
- import { INumfmtService as be, SheetInterceptorService as et, SheetsSelectionsService as Ce, INTERCEPTOR_POINT as zt, RemoveNumfmtMutation as Ie, SetNumfmtMutation as Ne, BEFORE_CELL_EDIT as Xt, AFTER_CELL_EDIT as qt, SetRangeValuesCommand as Jt, transformCellsToRange as Qt, factorySetNumfmtUndoMutation as en, factoryRemoveNumfmtUndoMutation as tn, RangeProtectionPermissionEditPoint as Z, WorksheetSetCellStylePermission as z, WorksheetEditPermission as X, WorkbookEditablePermission as q } from "@univerjs/sheets";
12
- import { debounceTime as nn, merge as tt, Observable as A, combineLatest as rn, filter as sn } from "rxjs";
13
- import { map as on, switchMap as cn, tap as an, debounceTime as ln } from "rxjs/operators";
8
+ import { FormulaDataModel as At } from "@univerjs/engine-formula";
9
+ import { isTextFormat as Je, isDefaultFormat as jt, DEFAULT_TEXT_FORMAT_EXCEL as Bt } from "@univerjs/engine-numfmt";
10
+ import { INumfmtService as be, SheetInterceptorService as Qe, SheetsSelectionsService as Ce, INTERCEPTOR_POINT as Wt, RemoveNumfmtMutation as Ie, SetNumfmtMutation as Ne, BEFORE_CELL_EDIT as Vt, AFTER_CELL_EDIT as Gt, SetRangeValuesCommand as Kt, transformCellsToRange as Zt, factorySetNumfmtUndoMutation as zt, factoryRemoveNumfmtUndoMutation as Yt, RangeProtectionPermissionEditPoint as K, WorksheetSetCellStylePermission as Z, WorksheetEditPermission as z, WorkbookEditablePermission as Y } from "@univerjs/sheets";
11
+ import { IZenZoneService as Xt, useDependency as C, ComponentManager as et, ISidebarService as qt, getMenuHiddenObservable as X, MenuItemType as q, ILayoutService as Jt, RibbonStartGroup as Qt, IMenuManagerService as en } from "@univerjs/ui";
12
+ import { debounceTime as tn, merge as tt, Observable as A, combineLatest as nn, filter as rn } from "rxjs";
13
+ import { map as sn, switchMap as on, tap as cn, debounceTime as an } from "rxjs/operators";
14
14
  import { jsxs as b, jsx as u } from "react/jsx-runtime";
15
- import { createContext as mn, useState as I, useEffect as ae, useRef as Ee, useContext as nt, useMemo as U, forwardRef as rt, createElement as Te } from "react";
16
- import { InputNumber as Me, Select as Pe, SelectList as we, Input as un, Button as De, Separator as dn } from "@univerjs/design";
15
+ import { createContext as ln, useState as I, useEffect as ae, useRef as Ee, useContext as nt, useMemo as U, forwardRef as rt, createElement as Te } from "react";
16
+ import { InputNumber as Me, Select as Pe, SelectList as we, Input as mn, Button as De, Separator as un } from "@univerjs/design";
17
17
  const Fe = {};
18
- var hn = Object.getOwnPropertyDescriptor, fn = (e, t, r, n) => {
19
- for (var i = n > 1 ? void 0 : n ? hn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
18
+ var dn = Object.getOwnPropertyDescriptor, hn = (e, t, r, n) => {
19
+ for (var i = n > 1 ? void 0 : n ? dn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
20
20
  (o = e[s]) && (i = o(i) || i);
21
21
  return i;
22
22
  }, D = (e, t) => (r, n) => t(r, n, e);
@@ -29,7 +29,7 @@ let _e = class extends oe {
29
29
  this._initCellAlertPopup(), this._initZenService();
30
30
  }
31
31
  _initCellAlertPopup() {
32
- this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(nn(100)).subscribe((e) => {
32
+ this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(tn(100)).subscribe((e) => {
33
33
  var t, r;
34
34
  if (e) {
35
35
  const n = e.location, i = this._context.unit, s = i.getActiveSheet();
@@ -45,7 +45,7 @@ let _e = class extends oe {
45
45
  this._hideAlert();
46
46
  return;
47
47
  }
48
- if (Qe(c.pattern) && (m != null && m.v) && ft(m.v)) {
48
+ if (Je(c.pattern) && (m != null && m.v) && ft(m.v)) {
49
49
  if ((t = this._configService.getConfig(Nt)) != null && t.disableTextFormatAlert)
50
50
  return;
51
51
  const d = this._cellAlertManagerService.currentAlert.get(de), l = (r = d == null ? void 0 : d.alert) == null ? void 0 : r.location;
@@ -75,12 +75,12 @@ let _e = class extends oe {
75
75
  this._cellAlertManagerService.removeAlert(de);
76
76
  }
77
77
  };
78
- _e = fn([
78
+ _e = hn([
79
79
  D(1, S(Dt)),
80
80
  D(2, S(Ft)),
81
81
  D(3, S(M)),
82
- D(4, S(Kt)),
83
- D(5, At),
82
+ D(4, S(At)),
83
+ D(5, Xt),
84
84
  D(6, S(be)),
85
85
  D(7, Le)
86
86
  ], _e);
@@ -96,12 +96,12 @@ const he = {
96
96
  type: He.OPERATION,
97
97
  handler: (e) => (e.get(W).openPanel(), !0)
98
98
  };
99
- var pn = Object.getOwnPropertyDescriptor, vn = (e, t, r, n) => {
100
- for (var i = n > 1 ? void 0 : n ? pn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
99
+ var fn = Object.getOwnPropertyDescriptor, pn = (e, t, r, n) => {
100
+ for (var i = n > 1 ? void 0 : n ? fn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
101
101
  (o = e[s]) && (i = o(i) || i);
102
102
  return i;
103
- }, gn = (e, t) => (r, n) => t(r, n, e);
104
- const Re = mn([]);
103
+ }, vn = (e, t) => (r, n) => t(r, n, e);
104
+ const Re = ln([]);
105
105
  let B = class {
106
106
  constructor(e) {
107
107
  this._localStorageService = e;
@@ -146,10 +146,10 @@ let B = class {
146
146
  this._localStorageService.removeItem(e);
147
147
  }
148
148
  };
149
- B = vn([
150
- gn(0, S(Ae))
149
+ B = pn([
150
+ vn(0, S(Ae))
151
151
  ], B);
152
- const ke = "numfmtCurrency", _n = (e) => {
152
+ const ke = "numfmtCurrency", gn = (e) => {
153
153
  const t = C(B), [r, n] = I(Ue);
154
154
  return ae(() => {
155
155
  t.addHabit("numfmtCurrency", []).then(() => {
@@ -160,7 +160,7 @@ const ke = "numfmtCurrency", _n = (e) => {
160
160
  }, []), { userHabitCurrency: r, mark: (s) => {
161
161
  t.markHabit(ke, s);
162
162
  } };
163
- }, Sn = () => {
163
+ }, _n = () => {
164
164
  const e = Ee([]), [t, r] = I({});
165
165
  return ae(() => {
166
166
  e.current.forEach((i) => {
@@ -169,7 +169,7 @@ const ke = "numfmtCurrency", _n = (e) => {
169
169
  }, [t]), (i) => {
170
170
  e.current.push(i), r({});
171
171
  };
172
- }, yn = (e) => !!V(e) && e.startsWith("_("), bn = (e) => {
172
+ }, Sn = (e) => !!V(e) && e.startsWith("_("), yn = (e) => {
173
173
  const { defaultPattern: t, action: r, onChange: n } = e, [i, s] = I(() => te(t || "", 2)), o = nt(Re), [a, c] = I(() => V(t) || o[0]), m = U(() => o.map((v) => ({ label: v, value: v })), []), l = C(M).t;
174
174
  r.current = () => O(`_("${a}"* #,##0${i > 0 ? ".0" : ""}_)`, i);
175
175
  const h = (v) => {
@@ -191,7 +191,7 @@ const ke = "numfmtCurrency", _n = (e) => {
191
191
  ] }),
192
192
  /* @__PURE__ */ u("div", { className: "describe m-t-14", children: l("sheet.numfmt.accountingDes") })
193
193
  ] });
194
- }, Cn = (e) => !!V(e) && !e.startsWith("_("), In = (e) => {
194
+ }, bn = (e) => !!V(e) && !e.startsWith("_("), Cn = (e) => {
195
195
  const r = C(M).t, n = nt(Re), [i, s] = I(() => V(e.defaultPattern) || n[0]), [o, a] = I(() => te(e.defaultPattern || "", 2)), [c, m] = I(() => {
196
196
  var g;
197
197
  const f = ue(i);
@@ -233,7 +233,7 @@ var E = function() {
233
233
  }
234
234
  return e;
235
235
  }, E.apply(this, arguments);
236
- }, Nn = function(e, t) {
236
+ }, In = function(e, t) {
237
237
  var r = {};
238
238
  for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
239
239
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
@@ -241,15 +241,15 @@ var E = function() {
241
241
  t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
242
242
  return r;
243
243
  }, it = rt(function(e, t) {
244
- var r = e.icon, n = e.id, i = e.className, s = e.extend, o = Nn(e, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), c = Ee("_".concat(Mn()));
244
+ 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 = Ee("_".concat(Tn()));
245
245
  return st(r, "".concat(n), { defIds: r.defIds, idSuffix: c.current }, E({ ref: t, className: a }, o), s);
246
246
  });
247
247
  function st(e, t, r, n, i) {
248
- return Te(e.tag, E(E({ key: t }, En(e, r, i)), n), (Tn(e, r).children || []).map(function(s, o) {
248
+ return Te(e.tag, E(E({ key: t }, Nn(e, r, i)), n), (En(e, r).children || []).map(function(s, o) {
249
249
  return st(s, "".concat(t, "-").concat(e.tag, "-").concat(o), r, void 0, i);
250
250
  }));
251
251
  }
252
- function En(e, t, r) {
252
+ function Nn(e, t, r) {
253
253
  var n = E({}, e.attrs);
254
254
  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) {
255
255
  var o = s[0], a = s[1];
@@ -261,33 +261,33 @@ function En(e, t, r) {
261
261
  typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
262
262
  })), n;
263
263
  }
264
- function Tn(e, t) {
264
+ function En(e, t) {
265
265
  var r, n = t.defIds;
266
266
  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) {
267
267
  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;
268
268
  }) }) : e;
269
269
  }
270
- function Mn() {
270
+ function Tn() {
271
271
  return Math.random().toString(36).substring(2, 8);
272
272
  }
273
273
  it.displayName = "UniverIcon";
274
- var Pn = { 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" } }] }, ot = rt(function(e, t) {
274
+ var Mn = { 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" } }] }, ot = rt(function(e, t) {
275
275
  return Te(it, Object.assign({}, e, {
276
276
  id: "check-mark-single",
277
277
  ref: t,
278
- icon: Pn
278
+ icon: Mn
279
279
  }));
280
280
  });
281
281
  ot.displayName = "CheckMarkSingle";
282
- const wn = "univer-custom-format-title", Rn = "univer-custom-format-input", On = "univer-custom-format-history-list", Un = "univer-custom-format-history-list-item", Dn = "univer-custom-format-history-list-item-icon-wrap", Fn = "univer-custom-format-des", F = {
283
- customFormatTitle: wn,
284
- customFormatInput: Rn,
285
- customFormatHistoryList: On,
286
- customFormatHistoryListItem: Un,
287
- customFormatHistoryListItemIconWrap: Dn,
288
- customFormatDes: Fn
282
+ const Pn = "univer-custom-format-title", wn = "univer-custom-format-input", Rn = "univer-custom-format-history-list", On = "univer-custom-format-history-list-item", Un = "univer-custom-format-history-list-item-icon-wrap", Dn = "univer-custom-format-des", F = {
283
+ customFormatTitle: Pn,
284
+ customFormatInput: wn,
285
+ customFormatHistoryList: Rn,
286
+ customFormatHistoryListItem: On,
287
+ customFormatHistoryListItemIconWrap: Un,
288
+ customFormatDes: Dn
289
289
  }, fe = "customFormat", pe = "numfmt_custom_pattern";
290
- function kn(e) {
290
+ function Fn(e) {
291
291
  const { defaultPattern: t, action: r, onChange: n } = e, i = C(B), s = C(Ae), o = C(M), [a, c] = I(t);
292
292
  r.current = () => (i.markHabit(fe, a), s.getItem(pe).then((p = []) => {
293
293
  const v = [.../* @__PURE__ */ new Set([a, ...p || []])].splice(0, 10).filter((f) => !!f);
@@ -315,7 +315,7 @@ function kn(e) {
315
315
  };
316
316
  return /* @__PURE__ */ b("div", { className: F.customFormat, children: [
317
317
  /* @__PURE__ */ u("div", { className: F.customFormatTitle, children: o.t("sheet.numfmt.customFormat") }),
318
- /* @__PURE__ */ u(un, { placeholder: o.t("sheet.numfmt.customFormat"), onBlur: h, value: a, onChange: c, className: F.customFormatInput }),
318
+ /* @__PURE__ */ u(mn, { placeholder: o.t("sheet.numfmt.customFormat"), onBlur: h, value: a, onChange: c, className: F.customFormatInput }),
319
319
  /* @__PURE__ */ u("div", { className: F.customFormatHistoryList, children: m.map((p) => /* @__PURE__ */ b("div", { onClick: () => l(p), className: F.customFormatHistoryListItem, children: [
320
320
  /* @__PURE__ */ u("div", { className: F.customFormatHistoryListItemIconWrap, children: a === p && /* @__PURE__ */ u(ot, {}) }),
321
321
  /* @__PURE__ */ u("div", { children: p })
@@ -323,10 +323,10 @@ function kn(e) {
323
323
  /* @__PURE__ */ u("div", { className: F.customFormatDes, children: o.t("sheet.numfmt.customFormatDes") })
324
324
  ] });
325
325
  }
326
- const $n = (e) => {
326
+ const kn = (e) => {
327
327
  const t = Q.getInfo(e);
328
328
  return Ve().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
329
- }, xn = (e) => {
329
+ }, $n = (e) => {
330
330
  const t = U(Ve, []), n = C(M).t, [i, s] = I(() => {
331
331
  if (e.defaultPattern) {
332
332
  const a = t.find((c) => c.value === e.defaultPattern);
@@ -344,10 +344,10 @@ const $n = (e) => {
344
344
  /* @__PURE__ */ u("div", { className: "m-t-8", children: /* @__PURE__ */ u(we, { value: i, options: t, onChange: o }) }),
345
345
  /* @__PURE__ */ u("div", { className: "describe m-t-14", children: n("sheet.numfmt.dateDes") })
346
346
  ] });
347
- }, Ln = (e) => !e, Hn = (e) => {
347
+ }, xn = (e) => !e, Ln = (e) => {
348
348
  const r = C(M).t;
349
349
  return e.action.current = () => "", /* @__PURE__ */ u("div", { children: /* @__PURE__ */ u("div", { className: "describe m-t-14", children: r("sheet.numfmt.generalDes") }) });
350
- }, An = (e) => Ge().some((t) => ce(t.value, e)), jn = (e) => {
350
+ }, Hn = (e) => Ge().some((t) => ce(t.value, e)), An = (e) => {
351
351
  const t = C(M), r = U(Ge, []), [n, i] = I(() => te(e.defaultPattern || "", 0)), [s, o] = I(() => {
352
352
  const l = r.find((h) => ce(h.value, e.defaultPattern || ""));
353
353
  return (l == null ? void 0 : l.value) || r[0].value;
@@ -375,23 +375,23 @@ const $n = (e) => {
375
375
  /* @__PURE__ */ u("div", { className: "m-t-8", children: /* @__PURE__ */ u(we, { onChange: d, options: r, value: s }) }),
376
376
  /* @__PURE__ */ u("div", { className: "describe m-t-14", children: t.t("sheet.numfmt.thousandthPercentileDes") })
377
377
  ] });
378
- }, Bn = (e) => {
379
- const { defaultValue: t, defaultPattern: r, row: n, col: i } = e.value, s = C(M), o = Ee(() => ""), a = s.t, c = Sn(), m = U(
378
+ }, jn = (e) => {
379
+ const { defaultValue: t, defaultPattern: r, row: n, col: i } = e.value, s = C(M), o = Ee(() => ""), a = s.t, c = _n(), m = U(
380
380
  () => [
381
- { label: "sheet.numfmt.general", component: Hn },
382
- { label: "sheet.numfmt.accounting", component: bn },
383
- { label: "sheet.numfmt.currency", component: In },
384
- { label: "sheet.numfmt.date", component: xn },
385
- { label: "sheet.numfmt.thousandthPercentile", component: jn },
386
- { label: "sheet.numfmt.customFormat", component: kn }
381
+ { label: "sheet.numfmt.general", component: Ln },
382
+ { label: "sheet.numfmt.accounting", component: yn },
383
+ { label: "sheet.numfmt.currency", component: Cn },
384
+ { label: "sheet.numfmt.date", component: $n },
385
+ { label: "sheet.numfmt.thousandthPercentile", component: An },
386
+ { label: "sheet.numfmt.customFormat", component: Fn }
387
387
  ].map((_) => ({ ..._, label: a(_.label) })),
388
388
  []
389
- ), [d, l] = I(g), [h, p] = I(() => `${n}_${i}`), { mark: v, userHabitCurrency: f } = _n(() => p(`${n}_${i}_userCurrency'`)), y = U(() => {
389
+ ), [d, l] = I(g), [h, p] = I(() => `${n}_${i}`), { mark: v, userHabitCurrency: f } = gn(() => p(`${n}_${i}_userCurrency'`)), y = U(() => {
390
390
  var _;
391
391
  return (_ = m.find((k) => k.label === d)) == null ? void 0 : _.component;
392
392
  }, [d]);
393
393
  function g() {
394
- return [Ln, yn, Cn, $n, An].reduce((k, mt, ut) => k || (mt(r) ? m[ut].label : ""), "") || m[0].label;
394
+ return [xn, Sn, bn, kn, Hn].reduce((k, mt, ut) => k || (mt(r) ? m[ut].label : ""), "") || m[0].label;
395
395
  }
396
396
  const N = m.map((_) => ({
397
397
  label: _.label,
@@ -425,8 +425,8 @@ const $n = (e) => {
425
425
  ] })
426
426
  ] });
427
427
  };
428
- var Wn = Object.getOwnPropertyDescriptor, Vn = (e, t, r, n) => {
429
- for (var i = n > 1 ? void 0 : n ? Wn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
428
+ var Bn = Object.getOwnPropertyDescriptor, Wn = (e, t, r, n) => {
429
+ for (var i = n > 1 ? void 0 : n ? Bn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
430
430
  (o = e[s]) && (i = o(i) || i);
431
431
  return i;
432
432
  }, P = (e, t) => (r, n) => t(r, n, e);
@@ -481,7 +481,7 @@ let W = class extends oe {
481
481
  type: le
482
482
  });
483
483
  });
484
- }), n.executeCommand(Ye.id, R), t.close();
484
+ }), n.executeCommand(Ze.id, R), t.close();
485
485
  } else g.type === "cancel" && t.close();
486
486
  },
487
487
  value: { defaultPattern: p, defaultValue: v, row: c.startRow, col: c.startColumn }
@@ -514,7 +514,7 @@ let W = class extends oe {
514
514
  });
515
515
  }
516
516
  _initPanel() {
517
- this._componentManager.register($e, Bn);
517
+ this._componentManager.register($e, jn);
518
518
  }
519
519
  // eslint-disable-next-line max-lines-per-function
520
520
  _initRealTimeRenderingInterceptor() {
@@ -522,16 +522,16 @@ let W = class extends oe {
522
522
  this._commandService.onCommandExecuted((i) => {
523
523
  i.id === j.id && n.next(!0), i.id === he.id && n.next(!1);
524
524
  });
525
- }), r = rn([
525
+ }), r = nn([
526
526
  t,
527
527
  this._selectionManagerService.selectionMoveEnd$.pipe(
528
- on((n) => n ? n.map((i) => i.range) : [])
528
+ sn((n) => n ? n.map((i) => i.range) : [])
529
529
  )
530
530
  ]);
531
531
  this.disposeWithMe(
532
532
  ge(
533
533
  r.pipe(
534
- cn(
534
+ on(
535
535
  ([n, i]) => new A((s) => {
536
536
  const o = new vt();
537
537
  return n && i.length && s.next({ selectionRanges: i, disposableCollection: o }), () => {
@@ -539,14 +539,14 @@ let W = class extends oe {
539
539
  };
540
540
  })
541
541
  ),
542
- an(() => {
542
+ cn(() => {
543
543
  this._previewPattern = null;
544
544
  })
545
545
  ).subscribe(({ disposableCollection: n, selectionRanges: i }) => {
546
546
  var o, a;
547
547
  const s = this._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET);
548
548
  this.openPanel(), n.add(
549
- this._sheetInterceptorService.intercept(zt.CELL_CONTENT, {
549
+ this._sheetInterceptorService.intercept(Wt.CELL_CONTENT, {
550
550
  priority: 99,
551
551
  effect: Oe.Value | Oe.Style,
552
552
  handler: (c, m, d) => {
@@ -592,7 +592,7 @@ let W = class extends oe {
592
592
  }
593
593
  });
594
594
  return () => n.dispose();
595
- }).pipe(ln(16)).subscribe((r) => this._forceUpdate(r))
595
+ }).pipe(an(16)).subscribe((r) => this._forceUpdate(r))
596
596
  );
597
597
  }
598
598
  _initCloseListener() {
@@ -602,25 +602,25 @@ let W = class extends oe {
602
602
  });
603
603
  }
604
604
  };
605
- W = Vn([
606
- P(0, S(et)),
605
+ W = Wn([
606
+ P(0, S(Qe)),
607
607
  P(1, S(pt)),
608
608
  P(2, Se),
609
609
  P(3, ye),
610
610
  P(4, S(Ce)),
611
611
  P(5, We),
612
612
  P(6, be),
613
- P(7, S(Je)),
614
- P(8, jt),
613
+ P(7, S(et)),
614
+ P(8, qt),
615
615
  P(9, S(M)),
616
616
  P(10, S(Ke))
617
617
  ], W);
618
- var Gn = Object.getOwnPropertyDescriptor, Kn = (e, t, r, n) => {
619
- for (var i = n > 1 ? void 0 : n ? Gn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
618
+ var Vn = Object.getOwnPropertyDescriptor, Gn = (e, t, r, n) => {
619
+ for (var i = n > 1 ? void 0 : n ? Vn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
620
620
  (o = e[s]) && (i = o(i) || i);
621
621
  return i;
622
622
  }, H = (e, t) => (r, n) => t(r, n, e);
623
- const Yn = () => {
623
+ const Kn = () => {
624
624
  let e = [];
625
625
  return {
626
626
  add: (i, s, o, a, c) => e.push({ unitId: i, subUnitId: s, row: o, col: a, value: c }),
@@ -634,13 +634,13 @@ let re = class extends oe {
634
634
  constructor(t, r, n, i, s) {
635
635
  super();
636
636
  // collect effect mutations when edit end and push this to commands stack in next commands progress
637
- J(this, "_collectEffectMutation", Yn());
637
+ J(this, "_collectEffectMutation", Kn());
638
638
  this._sheetInterceptorService = t, this._numfmtService = r, this._univerInstanceService = n, this._injector = i, this._editorBridgeService = s, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
639
639
  }
640
640
  _initInterceptorEditorStart() {
641
641
  this._editorBridgeService && this.disposeWithMe(
642
642
  ge(
643
- this._sheetInterceptorService.writeCellInterceptor.intercept(Xt, {
643
+ this._sheetInterceptorService.writeCellInterceptor.intercept(Vt, {
644
644
  handler: (t, r, n) => {
645
645
  const i = r.row, s = r.col, o = this._numfmtService.getValue(
646
646
  r.unitId,
@@ -678,7 +678,7 @@ let re = class extends oe {
678
678
  _initInterceptorEditorEnd() {
679
679
  this.disposeWithMe(
680
680
  ge(
681
- this._sheetInterceptorService.writeCellInterceptor.intercept(qt, {
681
+ this._sheetInterceptorService.writeCellInterceptor.intercept(Gt, {
682
682
  // eslint-disable-next-line complexity
683
683
  handler: (t, r, n) => {
684
684
  var d, l, h, p;
@@ -697,7 +697,7 @@ let re = class extends oe {
697
697
  null
698
698
  );
699
699
  };
700
- if (!(t != null && t.v) && !(t != null && t.p) || Qe(i == null ? void 0 : i.pattern) || t.t === x.FORCE_STRING)
700
+ if (!(t != null && t.v) && !(t != null && t.p) || Je(i == null ? void 0 : i.pattern) || t.t === x.FORCE_STRING)
701
701
  return n(t);
702
702
  const a = (l = t.p) == null ? void 0 : l.body, c = (p = (h = t == null ? void 0 : t.p) == null ? void 0 : h.body) != null && p.dataStream ? t.p.body.dataStream.replace(/\r\n$/, "") : String(t.v), m = Q.parseDate(c) || Q.parseTime(c) || Q.parseNumber(c);
703
703
  if (a)
@@ -733,7 +733,7 @@ let re = class extends oe {
733
733
  getMutations(r) {
734
734
  var n;
735
735
  switch (r.id) {
736
- case Jt.id: {
736
+ case Kt.id: {
737
737
  const i = t._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET), s = i.getUnitId(), o = (n = i.getActiveSheet()) == null ? void 0 : n.getSheetId();
738
738
  if (!o)
739
739
  return {
@@ -765,9 +765,9 @@ let re = class extends oe {
765
765
  if (c.length) {
766
766
  const h = {
767
767
  id: Ne.id,
768
- params: Qt(s, o, c)
768
+ params: Zt(s, o, c)
769
769
  };
770
- d.push(h), l.push(...en(t._injector, h.params));
770
+ d.push(h), l.push(...zt(t._injector, h.params));
771
771
  }
772
772
  if (m.length) {
773
773
  const h = {
@@ -778,7 +778,7 @@ let re = class extends oe {
778
778
  ranges: m
779
779
  }
780
780
  };
781
- d.push(h), l.push(...tn(t._injector, h.params));
781
+ d.push(h), l.push(...Yt(t._injector, h.params));
782
782
  }
783
783
  return {
784
784
  redos: d,
@@ -795,8 +795,8 @@ let re = class extends oe {
795
795
  );
796
796
  }
797
797
  };
798
- re = Kn([
799
- H(0, S(et)),
798
+ re = Gn([
799
+ H(0, S(Qe)),
800
800
  H(1, S(be)),
801
801
  H(2, S(Se)),
802
802
  H(3, S(Be)),
@@ -816,13 +816,21 @@ const ee = [
816
816
  },
817
817
  {
818
818
  label: "sheet.numfmt.text",
819
- pattern: Zt
819
+ pattern: Bt
820
820
  },
821
821
  "|",
822
822
  {
823
823
  label: "sheet.numfmt.number",
824
824
  pattern: "0"
825
825
  },
826
+ {
827
+ label: "sheet.numfmt.percent",
828
+ pattern: "0.00%"
829
+ },
830
+ {
831
+ label: "sheet.numfmt.scientific",
832
+ pattern: "0.00E+00"
833
+ },
826
834
  "|",
827
835
  {
828
836
  label: "sheet.numfmt.accounting",
@@ -858,16 +866,11 @@ const ee = [
858
866
  pattern: "h:mm:ss"
859
867
  },
860
868
  "|",
861
- {
862
- label: "sheet.numfmt.percent",
863
- pattern: "0.00%"
864
- },
865
- "|",
866
869
  {
867
870
  label: "sheet.numfmt.moreFmt",
868
871
  pattern: ""
869
872
  }
870
- ], Xn = (e) => ({
873
+ ], Yn = (e) => ({
871
874
  icon: new A((t) => {
872
875
  const r = e.get(Rt);
873
876
  function n(s) {
@@ -887,34 +890,34 @@ const ee = [
887
890
  id: qe.id,
888
891
  title: "sheet.numfmt.currency",
889
892
  tooltip: "sheet.numfmt.currency",
890
- type: Y.BUTTON,
891
- hidden$: K(e, T.UNIVER_SHEET),
892
- disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, z], rangeTypes: [Z] })
893
- }), qn = (e) => ({
893
+ type: q.BUTTON,
894
+ hidden$: X(e, T.UNIVER_SHEET),
895
+ disabled$: G(e, { workbookTypes: [Y], worksheetTypes: [z, Z], rangeTypes: [K] })
896
+ }), Xn = (e) => ({
894
897
  icon: "AddDigitsSingle",
895
898
  id: Xe.id,
896
899
  title: "sheet.numfmt.addDecimal",
897
900
  tooltip: "sheet.numfmt.addDecimal",
898
- type: Y.BUTTON,
899
- hidden$: K(e, T.UNIVER_SHEET),
900
- disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, z], rangeTypes: [Z] })
901
- }), Jn = (e) => ({
901
+ type: q.BUTTON,
902
+ hidden$: X(e, T.UNIVER_SHEET),
903
+ disabled$: G(e, { workbookTypes: [Y], worksheetTypes: [z, Z], rangeTypes: [K] })
904
+ }), qn = (e) => ({
902
905
  icon: "ReduceDigitsSingle",
903
- id: ze.id,
906
+ id: Ye.id,
904
907
  title: "sheet.numfmt.subtractDecimal",
905
908
  tooltip: "sheet.numfmt.subtractDecimal",
906
- type: Y.BUTTON,
907
- hidden$: K(e, T.UNIVER_SHEET),
908
- disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, z], rangeTypes: [Z] })
909
- }), Qn = (e) => ({
909
+ type: q.BUTTON,
910
+ hidden$: X(e, T.UNIVER_SHEET),
911
+ disabled$: G(e, { workbookTypes: [Y], worksheetTypes: [z, Z], rangeTypes: [K] })
912
+ }), Jn = (e) => ({
910
913
  icon: "PercentSingle",
911
- id: Ze.id,
914
+ id: ze.id,
912
915
  title: "sheet.numfmt.percent",
913
916
  tooltip: "sheet.numfmt.percent",
914
- type: Y.BUTTON,
915
- hidden$: K(e, T.UNIVER_SHEET),
916
- disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, z], rangeTypes: [Z] })
917
- }), er = (e) => {
917
+ type: q.BUTTON,
918
+ hidden$: X(e, T.UNIVER_SHEET),
919
+ disabled$: G(e, { workbookTypes: [Y], worksheetTypes: [z, Z], rangeTypes: [K] })
920
+ }), Qn = (e) => {
918
921
  const t = e.get(Se), r = e.get(ye), n = e.get(M), i = e.get(Ce), s = [Ie.id, Ne.id], o = Lt(
919
922
  t,
920
923
  "",
@@ -922,7 +925,7 @@ const ee = [
922
925
  (m) => tt(
923
926
  i.selectionMoveEnd$,
924
927
  _t(r.onCommandExecuted.bind(r)).pipe(
925
- sn(([d]) => s.includes(d.id))
928
+ rn(([d]) => s.includes(d.id))
926
929
  )
927
930
  ).subscribe(() => {
928
931
  var l, h;
@@ -930,7 +933,7 @@ const ee = [
930
933
  if (d && d[0]) {
931
934
  const p = d[0].range, v = p.startRow, f = p.startColumn, y = (h = a.getStyles().get((l = c.getCell(v, f)) == null ? void 0 : l.s)) == null ? void 0 : h.n, g = y == null ? void 0 : y.pattern;
932
935
  let N = n.t("sheet.numfmt.general");
933
- if (Yt(g)) {
936
+ if (jt(g)) {
934
937
  m.next(N);
935
938
  return;
936
939
  }
@@ -949,7 +952,7 @@ const ee = [
949
952
  label: ct,
950
953
  id: j.id,
951
954
  tooltip: "sheet.numfmt.title",
952
- type: Y.SELECTOR,
955
+ type: q.SELECTOR,
953
956
  slot: !0,
954
957
  selections: [
955
958
  {
@@ -961,21 +964,21 @@ const ee = [
961
964
  }
962
965
  ],
963
966
  value$: o,
964
- hidden$: K(e, T.UNIVER_SHEET),
965
- disabled$: G(e, { workbookTypes: [q], worksheetTypes: [z, X], rangeTypes: [Z] })
967
+ hidden$: X(e, T.UNIVER_SHEET),
968
+ disabled$: G(e, { workbookTypes: [Y], worksheetTypes: [Z, z], rangeTypes: [K] })
966
969
  };
967
- }, ct = "sheet.numfmt.moreNumfmtType", at = "sheet.numfmt.moreNumfmtType.options", tr = (e) => {
970
+ }, ct = "sheet.numfmt.moreNumfmtType", at = "sheet.numfmt.moreNumfmtType.options", er = (e) => {
968
971
  const { value: t } = e, r = C(M), n = t != null ? t : r.t("sheet.numfmt.general");
969
972
  return /* @__PURE__ */ u("span", { className: "univer-text-sm", children: n });
970
- }, nr = () => {
971
- const e = C(ye), t = C(M), r = C(Bt), n = C(Ke), i = C(Ce), s = (c) => {
973
+ }, tr = () => {
974
+ const e = C(ye), t = C(M), r = C(Jt), n = C(Ke), i = C(Ce), s = (c) => {
972
975
  const m = i.getCurrentLastSelection();
973
976
  if (!m)
974
977
  return;
975
978
  const d = m.range, l = [];
976
979
  je.foreach(d, (h, p) => {
977
980
  c ? l.push({ row: h, col: p, pattern: c, type: ne(c) }) : l.push({ row: h, col: p });
978
- }), e.executeCommand(Ye.id, { values: l }), r.focus();
981
+ }), e.executeCommand(Ze.id, { values: l }), r.focus();
979
982
  }, o = (c) => {
980
983
  if (c === 0)
981
984
  s(null);
@@ -986,7 +989,7 @@ const ee = [
986
989
  m.pattern && s(m.pattern);
987
990
  }
988
991
  }, a = 1220;
989
- return /* @__PURE__ */ u("div", { className: "univer-grid univer-gap-1 univer-p-1.5", children: ee.map((c, m) => c === "|" ? /* @__PURE__ */ u(dn, {}, m) : /* @__PURE__ */ b(
992
+ return /* @__PURE__ */ u("div", { className: "univer-grid univer-gap-1 univer-p-1.5", children: ee.map((c, m) => c === "|" ? /* @__PURE__ */ u(un, {}, m) : /* @__PURE__ */ b(
990
993
  "div",
991
994
  {
992
995
  className: `
@@ -1004,32 +1007,32 @@ const ee = [
1004
1007
  },
1005
1008
  m
1006
1009
  )) });
1007
- }, rr = {
1008
- [Wt.FORMULAS_INSERT]: {
1010
+ }, nr = {
1011
+ [Qt.FORMULAS_INSERT]: {
1009
1012
  [qe.id]: {
1010
1013
  order: 4,
1011
- menuItemFactory: Xn
1014
+ menuItemFactory: Yn
1012
1015
  },
1013
1016
  [Xe.id]: {
1014
1017
  order: 5,
1015
- menuItemFactory: qn
1018
+ menuItemFactory: Xn
1016
1019
  },
1017
- [ze.id]: {
1020
+ [Ye.id]: {
1018
1021
  order: 6,
1019
- menuItemFactory: Jn
1022
+ menuItemFactory: qn
1020
1023
  },
1021
- [Ze.id]: {
1024
+ [ze.id]: {
1022
1025
  order: 7,
1023
- menuItemFactory: Qn
1026
+ menuItemFactory: Jn
1024
1027
  },
1025
1028
  [j.id]: {
1026
1029
  order: 8,
1027
- menuItemFactory: er
1030
+ menuItemFactory: Qn
1028
1031
  }
1029
1032
  }
1030
1033
  };
1031
- var ir = Object.getOwnPropertyDescriptor, sr = (e, t, r, n) => {
1032
- for (var i = n > 1 ? void 0 : n ? ir(t, r) : t, s = e.length - 1, o; s >= 0; s--)
1034
+ var rr = Object.getOwnPropertyDescriptor, ir = (e, t, r, n) => {
1035
+ for (var i = n > 1 ? void 0 : n ? rr(t, r) : t, s = e.length - 1, o; s >= 0; s--)
1033
1036
  (o = e[s]) && (i = o(i) || i);
1034
1037
  return i;
1035
1038
  }, xe = (e, t) => (r, n) => t(r, n, e);
@@ -1038,19 +1041,19 @@ let ie = class extends oe {
1038
1041
  super(), this._componentManager = e, this._menuManagerService = t, this._initMenu();
1039
1042
  }
1040
1043
  _initMenu() {
1041
- this._menuManagerService.mergeMenu(rr), this.disposeWithMe(this._componentManager.register(ct, tr)), this.disposeWithMe(this._componentManager.register(at, nr));
1044
+ this._menuManagerService.mergeMenu(nr), this.disposeWithMe(this._componentManager.register(ct, er)), this.disposeWithMe(this._componentManager.register(at, tr));
1042
1045
  }
1043
1046
  };
1044
- ie = sr([
1045
- xe(0, S(Je)),
1046
- xe(1, Vt)
1047
+ ie = ir([
1048
+ xe(0, S(et)),
1049
+ xe(1, en)
1047
1050
  ], ie);
1048
- var or = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, ar = (e, t, r) => t in e ? or(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, lr = (e, t, r, n) => {
1049
- for (var i = n > 1 ? void 0 : n ? cr(t, r) : t, s = e.length - 1, o; s >= 0; s--)
1051
+ var sr = Object.defineProperty, or = Object.getOwnPropertyDescriptor, cr = (e, t, r) => t in e ? sr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ar = (e, t, r, n) => {
1052
+ for (var i = n > 1 ? void 0 : n ? or(t, r) : t, s = e.length - 1, o; s >= 0; s--)
1050
1053
  (o = e[s]) && (i = o(i) || i);
1051
1054
  return i;
1052
- }, ve = (e, t) => (r, n) => t(r, n, e), lt = (e, t, r) => ar(e, typeof t != "symbol" ? t + "" : t, r);
1053
- const mr = "SHEET_NUMFMT_UI_PLUGIN";
1055
+ }, ve = (e, t) => (r, n) => t(r, n, e), lt = (e, t, r) => cr(e, typeof t != "symbol" ? t + "" : t, r);
1056
+ const lr = "SHEET_NUMFMT_UI_PLUGIN";
1054
1057
  let se = class extends yt {
1055
1058
  constructor(e = Fe, t, r, n) {
1056
1059
  super(), this._config = e, this._injector = t, this._configService = r, this._renderManagerService = n;
@@ -1059,7 +1062,7 @@ let se = class extends yt {
1059
1062
  Fe,
1060
1063
  this._config
1061
1064
  );
1062
- i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Gt, s);
1065
+ i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig("sheets-numfmt-ui.config", s);
1063
1066
  }
1064
1067
  onStarting() {
1065
1068
  Ct(this._injector, [
@@ -1084,9 +1087,9 @@ let se = class extends yt {
1084
1087
  });
1085
1088
  }
1086
1089
  };
1087
- lt(se, "pluginName", mr);
1090
+ lt(se, "pluginName", lr);
1088
1091
  lt(se, "type", T.UNIVER_SHEET);
1089
- se = lr([
1092
+ se = ar([
1090
1093
  St(Ht, Ut),
1091
1094
  ve(1, S(Be)),
1092
1095
  ve(2, Le),