@univerjs/sheets-numfmt-ui 0.10.3 → 0.10.4

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