@univerjs/sheets-numfmt-ui 0.6.5 → 0.6.6-experimental.20250319-2bbe26f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,56 +1,58 @@
1
- var ut = Object.defineProperty;
2
- var dt = (e, t, n) => t in e ? ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var J = (e, t, n) => dt(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { Inject as S, LocaleService as M, Disposable as oe, isRealNum as ht, CommandType as Le, ILocalStorageService as He, numfmt as Q, ThemeService as ft, IUniverInstanceService as Se, ICommandService as ye, UniverInstanceType as T, CellValueType as x, toDisposable as ge, DisposableCollection as pt, InterceptorEffectEnum as Oe, Range as Ae, Injector as je, Optional as vt, fromCallback as gt, DependentOn as _t, IConfigService as St, Plugin as yt, merge as bt, registerDependencies as Ct, touchDependencies as It } from "@univerjs/core";
5
- import { IRenderManagerService as Be } from "@univerjs/engine-render";
6
- import { currencySymbols as Ue, getDecimalFromPattern as te, getCurrencyType as V, setPatternDecimal as O, getCurrencyFormatOptions as ue, isPatternEqualWithoutDecimal as ce, CURRENCYFORMAT as Nt, DATEFMTLISG as Et, NUMBERFORMAT as Tt, getDateFormatOptions as We, getNumberFormatOptions as Ve, isPatternHasDecimal as Mt, SheetsNumfmtCellContentController as Ge, getPatternPreviewIgnoreGeneral as Pt, getPatternType as ne, SetNumfmtCommand as Ke, SetPercentCommand as Ze, SubtractDecimalCommand as ze, AddDecimalCommand as Ye, SetCurrencyCommand as Xe, MenuCurrencyService as wt, countryCurrencyMap as F, getPatternPreview as Rt, UniverSheetsNumfmtPlugin as Ot } from "@univerjs/sheets-numfmt";
7
- import { HoverManagerService as Ut, CellAlertManagerService as Dt, CellAlertType as kt, SheetSkeletonManagerService as Ft, IEditorBridgeService as $t, deriveStateFromActiveSheet$ as xt, getCurrentRangeDisable$ as G, UniverSheetsUIPlugin as Lt } from "@univerjs/sheets-ui";
8
- import { IZenZoneService as Ht, useDependency as C, ComponentManager as qe, ISidebarService as At, getMenuHiddenObservable as K, MenuItemType as Z, ILayoutService as jt, RibbonStartGroup as Bt, IMenuManagerService as Wt, UI_PLUGIN_CONFIG_KEY as Vt } from "@univerjs/ui";
9
- import { FormulaDataModel as Gt } from "@univerjs/engine-formula";
10
- import { isTextFormat as Je, isDefaultFormat as Kt, DEFAULT_TEXT_FORMAT_EXCEL as Zt } from "@univerjs/engine-numfmt";
11
- import { INumfmtService as be, SheetInterceptorService as Qe, SheetsSelectionsService as Ce, INTERCEPTOR_POINT as zt, RemoveNumfmtMutation as Ie, SetNumfmtMutation as Ne, BEFORE_CELL_EDIT as Yt, AFTER_CELL_EDIT as Xt, SetRangeValuesCommand as qt, transformCellsToRange as Jt, factorySetNumfmtUndoMutation as Qt, factoryRemoveNumfmtUndoMutation as en, RangeProtectionPermissionEditPoint as z, WorksheetSetCellStylePermission as Y, WorksheetEditPermission as X, WorkbookEditablePermission as q } from "@univerjs/sheets";
12
- import { debounceTime as tn, merge as et, 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";
1
+ var dt = Object.defineProperty;
2
+ var ht = (e, t, r) => t in e ? dt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var J = (e, t, r) => ht(e, typeof t != "symbol" ? t + "" : t, r);
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
+ 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";
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";
14
14
  import { jsxs as b, jsx as u } from "react/jsx-runtime";
15
- import { createContext as ln, useState as I, useEffect as ae, useRef as Ee, useContext as tt, useMemo as U, forwardRef as nt, 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
- const ke = {};
18
- var dn = Object.getOwnPropertyDescriptor, hn = (e, t, n, r) => {
19
- for (var i = r > 1 ? void 0 : r ? dn(t, n) : t, s = e.length - 1, o; s >= 0; s--)
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";
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--)
20
20
  (o = e[s]) && (i = o(i) || i);
21
21
  return i;
22
- }, $ = (e, t) => (n, r) => t(n, r, e);
22
+ }, D = (e, t) => (r, n) => t(r, n, e);
23
23
  const de = "SHEET_NUMFMT_ALERT";
24
24
  let _e = class extends oe {
25
- constructor(e, t, n, r, i, s, o) {
26
- super(), this._context = e, this._hoverManagerService = t, this._cellAlertManagerService = n, this._localeService = r, this._formulaDataModel = i, this._zenZoneService = s, this._numfmtService = o, this._init();
25
+ constructor(e, t, r, n, i, s, o, a) {
26
+ super(), this._context = e, this._hoverManagerService = t, this._cellAlertManagerService = r, this._localeService = n, this._formulaDataModel = i, this._zenZoneService = s, this._numfmtService = o, this._configService = a, this._init();
27
27
  }
28
28
  _init() {
29
29
  this._initCellAlertPopup(), this._initZenService();
30
30
  }
31
31
  _initCellAlertPopup() {
32
- this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(tn(100)).subscribe((e) => {
33
- var t;
32
+ this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(nn(100)).subscribe((e) => {
33
+ var t, r;
34
34
  if (e) {
35
- const n = e.location, r = this._context.unit, i = r.getActiveSheet();
36
- if (!i) return;
37
- const s = n.unitId, o = n.subUnitId;
38
- let a;
39
- const c = i.getCell(n.row, n.col);
40
- if (c != null && c.s) {
41
- const l = r.getStyles().get(c.s);
42
- l != null && l.n && (a = l.n);
35
+ const n = e.location, i = this._context.unit, s = i.getActiveSheet();
36
+ if (!s) return;
37
+ const o = n.unitId, a = n.subUnitId;
38
+ let c;
39
+ const m = s.getCell(n.row, n.col);
40
+ if (m != null && m.s) {
41
+ const d = i.getStyles().get(m.s);
42
+ d != null && d.n && (c = d.n);
43
43
  }
44
- if (a || (a = this._numfmtService.getValue(s, o, n.row, n.col)), !a) {
44
+ if (c || (c = this._numfmtService.getValue(o, a, n.row, n.col)), !c) {
45
45
  this._hideAlert();
46
46
  return;
47
47
  }
48
- if (Je(a.pattern) && (c != null && c.v) && ht(c.v)) {
49
- const l = this._cellAlertManagerService.currentAlert.get(de), h = (t = l == null ? void 0 : l.alert) == null ? void 0 : t.location;
50
- if (h && h.row === n.row && h.col === n.col && h.subUnitId === n.subUnitId && h.unitId === n.unitId)
48
+ if (Qe(c.pattern) && (m != null && m.v) && ft(m.v)) {
49
+ if ((t = this._configService.getConfig(Nt)) != null && t.disableTextFormatAlert)
50
+ return;
51
+ const d = this._cellAlertManagerService.currentAlert.get(de), l = (r = d == null ? void 0 : d.alert) == null ? void 0 : r.location;
52
+ if (l && l.row === n.row && l.col === n.col && l.subUnitId === n.subUnitId && l.unitId === n.unitId)
51
53
  return;
52
54
  this._cellAlertManagerService.showAlert({
53
- type: kt.ERROR,
55
+ type: kt.WARNING,
54
56
  title: this._localeService.t("info.error"),
55
57
  message: this._localeService.t("info.forceStringInfo"),
56
58
  location: n,
@@ -73,32 +75,33 @@ let _e = class extends oe {
73
75
  this._cellAlertManagerService.removeAlert(de);
74
76
  }
75
77
  };
76
- _e = hn([
77
- $(1, S(Ut)),
78
- $(2, S(Dt)),
79
- $(3, S(M)),
80
- $(4, S(Gt)),
81
- $(5, Ht),
82
- $(6, S(be))
78
+ _e = fn([
79
+ D(1, S(Dt)),
80
+ D(2, S(Ft)),
81
+ D(3, S(M)),
82
+ D(4, S(Kt)),
83
+ D(5, At),
84
+ D(6, S(be)),
85
+ D(7, Le)
83
86
  ], _e);
84
87
  const he = {
85
88
  id: "sheet.operation.close.numfmt.panel",
86
- type: Le.OPERATION,
89
+ type: He.OPERATION,
87
90
  handler: () => (
88
91
  // do nothing, just notify panel is closed
89
92
  !0
90
93
  )
91
94
  }, j = {
92
95
  id: "sheet.operation.open.numfmt.panel",
93
- type: Le.OPERATION,
96
+ type: He.OPERATION,
94
97
  handler: (e) => (e.get(W).openPanel(), !0)
95
98
  };
96
- var fn = Object.getOwnPropertyDescriptor, pn = (e, t, n, r) => {
97
- for (var i = r > 1 ? void 0 : r ? fn(t, n) : t, s = e.length - 1, o; s >= 0; s--)
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--)
98
101
  (o = e[s]) && (i = o(i) || i);
99
102
  return i;
100
- }, vn = (e, t) => (n, r) => t(n, r, e);
101
- const Re = ln([]);
103
+ }, gn = (e, t) => (r, n) => t(r, n, e);
104
+ const Re = mn([]);
102
105
  let B = class {
103
106
  constructor(e) {
104
107
  this._localStorageService = e;
@@ -107,24 +110,24 @@ let B = class {
107
110
  return `userHabitController_${e}`;
108
111
  }
109
112
  async addHabit(e, t) {
110
- const n = this._getKey(e);
111
- return this._localStorageService.getItem(n).then((r) => {
112
- r || this._localStorageService.setItem(n, t);
113
+ const r = this._getKey(e);
114
+ return this._localStorageService.getItem(r).then((n) => {
115
+ n || this._localStorageService.setItem(r, t);
113
116
  });
114
117
  }
115
118
  markHabit(e, t) {
116
- const n = this._getKey(e);
117
- this._localStorageService.getItem(n).then((r) => {
118
- if (r) {
119
- const i = r.findIndex((s) => s === t);
120
- i > -1 && r.splice(i, 1), r.unshift(t), this._localStorageService.setItem(n, r);
119
+ const r = this._getKey(e);
120
+ this._localStorageService.getItem(r).then((n) => {
121
+ if (n) {
122
+ const i = n.findIndex((s) => s === t);
123
+ i > -1 && n.splice(i, 1), n.unshift(t), this._localStorageService.setItem(r, n);
121
124
  }
122
125
  });
123
126
  }
124
127
  async getHabit(e, t) {
125
- const n = this._getKey(e), r = await this._localStorageService.getItem(n);
126
- if (t && r) {
127
- const i = r.map((s, o, a) => {
128
+ const r = this._getKey(e), n = await this._localStorageService.getItem(r);
129
+ if (t && n) {
130
+ const i = n.map((s, o, a) => {
128
131
  const c = a.length;
129
132
  return {
130
133
  value: s,
@@ -132,199 +135,199 @@ let B = class {
132
135
  };
133
136
  });
134
137
  return t.sort((s, o) => {
135
- var l, h;
136
- const a = ((l = i.find((m) => m.value === s)) == null ? void 0 : l.priority) || -1;
137
- return (((h = i.find((m) => m.value === o)) == null ? void 0 : h.priority) || -1) - a;
138
+ var m, d;
139
+ const a = ((m = i.find((l) => l.value === s)) == null ? void 0 : m.priority) || -1;
140
+ return (((d = i.find((l) => l.value === o)) == null ? void 0 : d.priority) || -1) - a;
138
141
  });
139
142
  }
140
- return r || [];
143
+ return n || [];
141
144
  }
142
145
  deleteHabit(e) {
143
146
  this._localStorageService.removeItem(e);
144
147
  }
145
148
  };
146
- B = pn([
147
- vn(0, S(He))
149
+ B = vn([
150
+ gn(0, S(Ae))
148
151
  ], B);
149
- const Fe = "numfmtCurrency", gn = (e) => {
150
- const t = C(B), [n, r] = I(Ue);
152
+ const ke = "numfmtCurrency", _n = (e) => {
153
+ const t = C(B), [r, n] = I(Ue);
151
154
  return ae(() => {
152
155
  t.addHabit("numfmtCurrency", []).then(() => {
153
- t.getHabit(Fe, [...Ue]).then((s) => {
154
- r(s), e && e(s);
156
+ t.getHabit(ke, [...Ue]).then((s) => {
157
+ n(s), e && e(s);
155
158
  });
156
159
  });
157
- }, []), { userHabitCurrency: n, mark: (s) => {
158
- t.markHabit(Fe, s);
160
+ }, []), { userHabitCurrency: r, mark: (s) => {
161
+ t.markHabit(ke, s);
159
162
  } };
160
- }, _n = () => {
161
- const e = Ee([]), [t, n] = I({});
163
+ }, Sn = () => {
164
+ const e = Ee([]), [t, r] = I({});
162
165
  return ae(() => {
163
166
  e.current.forEach((i) => {
164
167
  i();
165
168
  }), e.current = [];
166
169
  }, [t]), (i) => {
167
- e.current.push(i), n({});
170
+ e.current.push(i), r({});
168
171
  };
169
- }, Sn = (e) => !!V(e) && e.startsWith("_("), yn = (e) => {
170
- const { defaultPattern: t, action: n, onChange: r } = e, [i, s] = I(() => te(t || "", 2)), o = tt(Re), [a, c] = I(() => V(t) || o[0]), l = U(() => o.map((v) => ({ label: v, value: v })), []), m = C(M).t;
171
- n.current = () => O(`_("${a}"* #,##0${i > 0 ? ".0" : ""}_)`, i);
172
- const d = (v) => {
173
- c(v), r(O(`_("${v}"* #,##0${i > 0 ? ".0" : ""}_)`, i));
172
+ }, yn = (e) => !!V(e) && e.startsWith("_("), bn = (e) => {
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
+ r.current = () => O(`_("${a}"* #,##0${i > 0 ? ".0" : ""}_)`, i);
175
+ const h = (v) => {
176
+ c(v), n(O(`_("${v}"* #,##0${i > 0 ? ".0" : ""}_)`, i));
174
177
  }, p = (v) => {
175
178
  const f = v || 0;
176
- s(f), r(O(`_("${a}"* #,##0${f > 0 ? ".0" : ""}_)`, f));
179
+ s(f), n(O(`_("${a}"* #,##0${f > 0 ? ".0" : ""}_)`, f));
177
180
  };
178
181
  return /* @__PURE__ */ b("div", { children: [
179
182
  /* @__PURE__ */ b("div", { className: "m-t-16 options", children: [
180
183
  /* @__PURE__ */ b("div", { className: "option", children: [
181
- /* @__PURE__ */ u("div", { className: "label", children: m("sheet.numfmt.decimalLength") }),
184
+ /* @__PURE__ */ u("div", { className: "label", children: l("sheet.numfmt.decimalLength") }),
182
185
  /* @__PURE__ */ u("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ u(Me, { value: i, max: 20, min: 0, onChange: p }) })
183
186
  ] }),
184
187
  /* @__PURE__ */ b("div", { className: "option", children: [
185
- /* @__PURE__ */ u("div", { className: "label", children: m("sheet.numfmt.currencyType") }),
186
- /* @__PURE__ */ u("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ u(Pe, { onChange: d, options: l, value: a }) })
188
+ /* @__PURE__ */ u("div", { className: "label", children: l("sheet.numfmt.currencyType") }),
189
+ /* @__PURE__ */ u("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ u(Pe, { onChange: h, options: m, value: a }) })
187
190
  ] })
188
191
  ] }),
189
- /* @__PURE__ */ u("div", { className: "describe m-t-14", children: m("sheet.numfmt.accountingDes") })
192
+ /* @__PURE__ */ u("div", { className: "describe m-t-14", children: l("sheet.numfmt.accountingDes") })
190
193
  ] });
191
- }, bn = (e) => !!V(e) && !e.startsWith("_("), Cn = (e) => {
192
- const n = C(M).t, r = tt(Re), [i, s] = I(() => V(e.defaultPattern) || r[0]), [o, a] = I(() => te(e.defaultPattern || "", 2)), [c, l] = I(() => {
194
+ }, Cn = (e) => !!V(e) && !e.startsWith("_("), In = (e) => {
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(() => {
193
196
  var g;
194
197
  const f = ue(i);
195
198
  return ((g = f.find((N) => ce(N.value, e.defaultPattern))) == null ? void 0 : g.value) || f[0].value;
196
- }), h = U(() => ue(i), [i]), m = U(() => r.map((f) => ({ label: f, value: f })), [r]);
199
+ }), d = U(() => ue(i), [i]), l = U(() => n.map((f) => ({ label: f, value: f })), [n]);
197
200
  e.action.current = () => O(c, o);
198
- const d = (f) => {
201
+ const h = (f) => {
199
202
  if (f === void 0)
200
203
  return;
201
204
  s(f);
202
205
  const y = ue(f)[0].value;
203
- l(y), e.onChange(O(y, o));
206
+ m(y), e.onChange(O(y, o));
204
207
  }, p = (f) => {
205
- f !== void 0 && (l(f), e.onChange(O(f, o)));
208
+ f !== void 0 && (m(f), e.onChange(O(f, o)));
206
209
  }, v = (f) => {
207
210
  a(f || 0), e.onChange(O(c, f || 0));
208
211
  };
209
212
  return /* @__PURE__ */ b("div", { children: [
210
213
  /* @__PURE__ */ b("div", { className: "m-t-16 options", children: [
211
214
  /* @__PURE__ */ b("div", { className: "option", children: [
212
- /* @__PURE__ */ u("div", { className: "label", children: n("sheet.numfmt.decimalLength") }),
215
+ /* @__PURE__ */ u("div", { className: "label", children: r("sheet.numfmt.decimalLength") }),
213
216
  /* @__PURE__ */ u("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ u(Me, { value: o, max: 20, min: 0, onChange: v }) })
214
217
  ] }),
215
218
  /* @__PURE__ */ b("div", { className: "option", children: [
216
- /* @__PURE__ */ u("div", { className: "label", children: n("sheet.numfmt.currencyType") }),
217
- /* @__PURE__ */ u("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ u(Pe, { onChange: d, options: m, value: i }) })
219
+ /* @__PURE__ */ u("div", { className: "label", children: r("sheet.numfmt.currencyType") }),
220
+ /* @__PURE__ */ u("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ u(Pe, { onChange: h, options: l, value: i }) })
218
221
  ] })
219
222
  ] }),
220
- /* @__PURE__ */ u("div", { className: "m-t-16 label", children: n("sheet.numfmt.negType") }),
221
- /* @__PURE__ */ u("div", { className: "m-t-8", children: /* @__PURE__ */ u(we, { onChange: p, options: h, value: c }) }),
222
- /* @__PURE__ */ u("div", { className: "describe m-t-14", children: n("sheet.numfmt.currencyDes") })
223
+ /* @__PURE__ */ u("div", { className: "m-t-16 label", children: r("sheet.numfmt.negType") }),
224
+ /* @__PURE__ */ u("div", { className: "m-t-8", children: /* @__PURE__ */ u(we, { onChange: p, options: d, value: c }) }),
225
+ /* @__PURE__ */ u("div", { className: "describe m-t-14", children: r("sheet.numfmt.currencyDes") })
223
226
  ] });
224
227
  };
225
228
  var E = function() {
226
229
  return E = Object.assign || function(e) {
227
- for (var t, n = 1, r = arguments.length; n < r; n++) {
228
- t = arguments[n];
230
+ for (var t, r = 1, n = arguments.length; r < n; r++) {
231
+ t = arguments[r];
229
232
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
230
233
  }
231
234
  return e;
232
235
  }, E.apply(this, arguments);
233
- }, In = function(e, t) {
234
- var n = {};
235
- for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
236
+ }, Nn = function(e, t) {
237
+ var r = {};
238
+ for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
236
239
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
237
- for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)
238
- t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
239
- return n;
240
- }, rt = nt(function(e, t) {
241
- var n = e.icon, r = e.id, i = e.className, s = e.extend, o = In(e, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), c = Ee("_".concat(Tn()));
242
- return it(n, "".concat(r), { defIds: n.defIds, idSuffix: c.current }, E({ ref: t, className: a }, o), s);
240
+ for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
241
+ t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
242
+ return r;
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()));
245
+ return st(r, "".concat(n), { defIds: r.defIds, idSuffix: c.current }, E({ ref: t, className: a }, o), s);
243
246
  });
244
- function it(e, t, n, r, i) {
245
- return Te(e.tag, E(E({ key: t }, Nn(e, n, i)), r), (En(e, n).children || []).map(function(s, o) {
246
- return it(s, "".concat(t, "-").concat(e.tag, "-").concat(o), n, void 0, i);
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) {
249
+ return st(s, "".concat(t, "-").concat(e.tag, "-").concat(o), r, void 0, i);
247
250
  }));
248
251
  }
249
- function Nn(e, t, n) {
250
- var r = E({}, e.attrs);
251
- n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1), e.tag === "mask" && r.id && (r.id = r.id + t.idSuffix), Object.entries(r).forEach(function(s) {
252
+ function En(e, t, r) {
253
+ var n = E({}, e.attrs);
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) {
252
255
  var o = s[0], a = s[1];
253
- o === "mask" && typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
256
+ o === "mask" && typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
254
257
  });
255
258
  var i = t.defIds;
256
- return !i || i.length === 0 || (e.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + t.idSuffix), Object.entries(r).forEach(function(s) {
259
+ return !i || i.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(s) {
257
260
  var o = s[0], a = s[1];
258
- typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
259
- })), r;
261
+ typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
262
+ })), n;
260
263
  }
261
- function En(e, t) {
262
- var n, r = t.defIds;
263
- return !r || r.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? E(E({}, e), { children: e.children.map(function(i) {
264
- return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? E(E({}, i), { attrs: E(E({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
264
+ function Tn(e, t) {
265
+ var r, n = t.defIds;
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
+ 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;
265
268
  }) }) : e;
266
269
  }
267
- function Tn() {
270
+ function Mn() {
268
271
  return Math.random().toString(36).substring(2, 8);
269
272
  }
270
- rt.displayName = "UniverIcon";
271
- 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" } }] }, st = nt(function(e, t) {
272
- return Te(rt, Object.assign({}, e, {
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) {
275
+ return Te(it, Object.assign({}, e, {
273
276
  id: "check-mark-single",
274
277
  ref: t,
275
- icon: Mn
278
+ icon: Pn
276
279
  }));
277
280
  });
278
- st.displayName = "CheckMarkSingle";
279
- 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", D = {
280
- customFormatTitle: Pn,
281
- customFormatInput: wn,
282
- customFormatHistoryList: Rn,
283
- customFormatHistoryListItem: On,
284
- customFormatHistoryListItemIconWrap: Un,
285
- customFormatDes: Dn
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
286
289
  }, fe = "customFormat", pe = "numfmt_custom_pattern";
287
290
  function kn(e) {
288
- const { defaultPattern: t, action: n, onChange: r } = e, i = C(B), s = C(He), o = C(M), [a, c] = I(t);
289
- n.current = () => (i.markHabit(fe, a), s.getItem(pe).then((p = []) => {
291
+ const { defaultPattern: t, action: r, onChange: n } = e, i = C(B), s = C(Ae), o = C(M), [a, c] = I(t);
292
+ r.current = () => (i.markHabit(fe, a), s.getItem(pe).then((p = []) => {
290
293
  const v = [.../* @__PURE__ */ new Set([a, ...p || []])].splice(0, 10).filter((f) => !!f);
291
294
  s.setItem(pe, v);
292
295
  }), a);
293
- const [l, h] = I([]);
296
+ const [m, d] = I([]);
294
297
  ae(() => {
295
298
  s.getItem(pe).then((p) => {
296
299
  const v = [
297
- ...Nt.map((f) => f.suffix("$")),
298
- ...Et.map((f) => f.suffix),
299
- ...Tt.map((f) => f.suffix)
300
+ ...Et.map((f) => f.suffix("$")),
301
+ ...Tt.map((f) => f.suffix),
302
+ ...Mt.map((f) => f.suffix)
300
303
  ];
301
304
  v.push(...p || []), i.addHabit(fe, []).finally(() => {
302
305
  i.getHabit(fe, v).then((f) => {
303
- h([...new Set(f)]);
306
+ d([...new Set(f)]);
304
307
  });
305
308
  });
306
309
  });
307
310
  }, []);
308
- const m = (p) => {
309
- c(p), r(p);
310
- }, d = () => {
311
- r(a);
311
+ const l = (p) => {
312
+ c(p), n(p);
313
+ }, h = () => {
314
+ n(a);
312
315
  };
313
- return /* @__PURE__ */ b("div", { className: D.customFormat, children: [
314
- /* @__PURE__ */ u("div", { className: D.customFormatTitle, children: o.t("sheet.numfmt.customFormat") }),
315
- /* @__PURE__ */ u(mn, { placeholder: o.t("sheet.numfmt.customFormat"), onBlur: d, value: a, onChange: c, className: D.customFormatInput }),
316
- /* @__PURE__ */ u("div", { className: D.customFormatHistoryList, children: l.map((p) => /* @__PURE__ */ b("div", { onClick: () => m(p), className: D.customFormatHistoryListItem, children: [
317
- /* @__PURE__ */ u("div", { className: D.customFormatHistoryListItemIconWrap, children: a === p && /* @__PURE__ */ u(st, {}) }),
316
+ return /* @__PURE__ */ b("div", { className: F.customFormat, children: [
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 }),
319
+ /* @__PURE__ */ u("div", { className: F.customFormatHistoryList, children: m.map((p) => /* @__PURE__ */ b("div", { onClick: () => l(p), className: F.customFormatHistoryListItem, children: [
320
+ /* @__PURE__ */ u("div", { className: F.customFormatHistoryListItemIconWrap, children: a === p && /* @__PURE__ */ u(ot, {}) }),
318
321
  /* @__PURE__ */ u("div", { children: p })
319
322
  ] }, p)) }),
320
- /* @__PURE__ */ u("div", { className: D.customFormatDes, children: o.t("sheet.numfmt.customFormatDes") })
323
+ /* @__PURE__ */ u("div", { className: F.customFormatDes, children: o.t("sheet.numfmt.customFormatDes") })
321
324
  ] });
322
325
  }
323
- const Fn = (e) => {
326
+ const $n = (e) => {
324
327
  const t = Q.getInfo(e);
325
- return We().map((n) => n.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
326
- }, $n = (e) => {
327
- const t = U(We, []), r = C(M).t, [i, s] = I(() => {
328
+ return Ve().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
329
+ }, xn = (e) => {
330
+ const t = U(Ve, []), n = C(M).t, [i, s] = I(() => {
328
331
  if (e.defaultPattern) {
329
332
  const a = t.find((c) => c.value === e.defaultPattern);
330
333
  if (a)
@@ -337,21 +340,21 @@ const Fn = (e) => {
337
340
  a !== void 0 && (s(a), e.onChange(a));
338
341
  };
339
342
  return /* @__PURE__ */ b("div", { children: [
340
- /* @__PURE__ */ u("div", { className: "m-t-16 label", children: r("sheet.numfmt.dateType") }),
343
+ /* @__PURE__ */ u("div", { className: "m-t-16 label", children: n("sheet.numfmt.dateType") }),
341
344
  /* @__PURE__ */ u("div", { className: "m-t-8", children: /* @__PURE__ */ u(we, { value: i, options: t, onChange: o }) }),
342
- /* @__PURE__ */ u("div", { className: "describe m-t-14", children: r("sheet.numfmt.dateDes") })
345
+ /* @__PURE__ */ u("div", { className: "describe m-t-14", children: n("sheet.numfmt.dateDes") })
343
346
  ] });
344
- }, xn = (e) => !e, Ln = (e) => {
345
- const n = C(M).t;
346
- return e.action.current = () => "", /* @__PURE__ */ u("div", { children: /* @__PURE__ */ u("div", { className: "describe m-t-14", children: n("sheet.numfmt.generalDes") }) });
347
- }, Hn = (e) => Ve().some((t) => ce(t.value, e)), An = (e) => {
348
- const t = C(M), n = U(Ve, []), [r, i] = I(() => te(e.defaultPattern || "", 0)), [s, o] = I(() => {
349
- const m = n.find((d) => ce(d.value, e.defaultPattern || ""));
350
- return (m == null ? void 0 : m.value) || n[0].value;
351
- }), a = U(() => O(s, Number(r || 0)), [s, r]), c = U(() => !Mt(s), [s]), l = (m) => {
352
- i(m || 0), e.onChange(O(s, Number(m || 0)));
353
- }, h = (m) => {
354
- m !== void 0 && (i(te(m, 0)), o(m), e.onChange(m));
347
+ }, Ln = (e) => !e, Hn = (e) => {
348
+ const r = C(M).t;
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) => {
351
+ const t = C(M), r = U(Ge, []), [n, i] = I(() => te(e.defaultPattern || "", 0)), [s, o] = I(() => {
352
+ const l = r.find((h) => ce(h.value, e.defaultPattern || ""));
353
+ return (l == null ? void 0 : l.value) || r[0].value;
354
+ }), a = U(() => O(s, Number(n || 0)), [s, n]), c = U(() => !Pt(s), [s]), m = (l) => {
355
+ i(l || 0), e.onChange(O(s, Number(l || 0)));
356
+ }, d = (l) => {
357
+ l !== void 0 && (i(te(l, 0)), o(l), e.onChange(l));
355
358
  };
356
359
  return e.action.current = () => a, /* @__PURE__ */ b("div", { children: [
357
360
  /* @__PURE__ */ u("div", { className: "m-t-16 label", children: t.t("sheet.numfmt.decimalLength") }),
@@ -359,42 +362,42 @@ const Fn = (e) => {
359
362
  Me,
360
363
  {
361
364
  disabled: c,
362
- value: r,
365
+ value: n,
363
366
  max: 20,
364
367
  min: 0,
365
- onChange: l
368
+ onChange: m
366
369
  }
367
370
  ) }),
368
371
  /* @__PURE__ */ b("div", { className: "m-t-16 label", children: [
369
372
  " ",
370
373
  t.t("sheet.numfmt.negType")
371
374
  ] }),
372
- /* @__PURE__ */ u("div", { className: "m-t-8", children: /* @__PURE__ */ u(we, { onChange: h, options: n, value: s }) }),
375
+ /* @__PURE__ */ u("div", { className: "m-t-8", children: /* @__PURE__ */ u(we, { onChange: d, options: r, value: s }) }),
373
376
  /* @__PURE__ */ u("div", { className: "describe m-t-14", children: t.t("sheet.numfmt.thousandthPercentileDes") })
374
377
  ] });
375
- }, jn = (e) => {
376
- const { defaultValue: t, defaultPattern: n, row: r, col: i } = e.value, s = C(M), o = Ee(() => ""), a = s.t, c = _n(), l = U(
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(
377
380
  () => [
378
- { label: "sheet.numfmt.general", component: Ln },
379
- { label: "sheet.numfmt.accounting", component: yn },
380
- { label: "sheet.numfmt.currency", component: Cn },
381
- { label: "sheet.numfmt.date", component: $n },
382
- { label: "sheet.numfmt.thousandthPercentile", component: An },
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 },
383
386
  { label: "sheet.numfmt.customFormat", component: kn }
384
387
  ].map((_) => ({ ..._, label: a(_.label) })),
385
388
  []
386
- ), [h, m] = I(g), [d, p] = I(() => `${r}_${i}`), { mark: v, userHabitCurrency: f } = gn(() => p(`${r}_${i}_userCurrency'`)), y = U(() => {
389
+ ), [d, l] = I(g), [h, p] = I(() => `${n}_${i}`), { mark: v, userHabitCurrency: f } = _n(() => p(`${n}_${i}_userCurrency'`)), y = U(() => {
387
390
  var _;
388
- return (_ = l.find((k) => k.label === h)) == null ? void 0 : _.component;
389
- }, [h]);
391
+ return (_ = m.find((k) => k.label === d)) == null ? void 0 : _.component;
392
+ }, [d]);
390
393
  function g() {
391
- return [xn, Sn, bn, Fn, Hn].reduce((k, lt, mt) => k || (lt(n) ? l[mt].label : ""), "") || l[0].label;
394
+ return [Ln, yn, Cn, $n, An].reduce((k, mt, ut) => k || (mt(r) ? m[ut].label : ""), "") || m[0].label;
392
395
  }
393
- const N = l.map((_) => ({
396
+ const N = m.map((_) => ({
394
397
  label: _.label,
395
398
  value: _.label
396
399
  })), w = (_) => {
397
- m(_), c(() => e.onChange({ type: "change", value: o.current() || "" }));
400
+ l(_), c(() => e.onChange({ type: "change", value: o.current() || "" }));
398
401
  }, R = (_) => {
399
402
  e.onChange({ type: "change", value: _ });
400
403
  }, le = () => {
@@ -405,16 +408,16 @@ const Fn = (e) => {
405
408
  }, me = {
406
409
  onChange: R,
407
410
  defaultValue: t,
408
- defaultPattern: n,
411
+ defaultPattern: r,
409
412
  action: o
410
413
  };
411
414
  return ae(() => {
412
- m(g()), p(`${r}_${i}`);
413
- }, [r, i]), /* @__PURE__ */ b("div", { className: "numfmt-panel p-b-20", children: [
415
+ l(g()), p(`${n}_${i}`);
416
+ }, [n, i]), /* @__PURE__ */ b("div", { className: "numfmt-panel p-b-20", children: [
414
417
  /* @__PURE__ */ b("div", { children: [
415
418
  /* @__PURE__ */ u("div", { className: "label m-t-14", children: a("sheet.numfmt.numfmtType") }),
416
- /* @__PURE__ */ u("div", { className: "m-t-8", children: /* @__PURE__ */ u(Pe, { onChange: w, options: N, value: h, style: { width: "100%" } }) }),
417
- /* @__PURE__ */ u("div", { children: y && /* @__PURE__ */ u(Re.Provider, { value: f, children: /* @__PURE__ */ Te(y, { ...me, key: d }) }) })
419
+ /* @__PURE__ */ u("div", { className: "m-t-8", children: /* @__PURE__ */ u(Pe, { onChange: w, options: N, value: d, style: { width: "100%" } }) }),
420
+ /* @__PURE__ */ u("div", { children: y && /* @__PURE__ */ u(Re.Provider, { value: f, children: /* @__PURE__ */ Te(y, { ...me, key: h }) }) })
418
421
  ] }),
419
422
  /* @__PURE__ */ b("div", { className: "btn-list m-t-14 m-b-20", children: [
420
423
  /* @__PURE__ */ u(De, { size: "small", onClick: L, className: "m-r-12", children: a("sheet.numfmt.cancel") }),
@@ -422,14 +425,14 @@ const Fn = (e) => {
422
425
  ] })
423
426
  ] });
424
427
  };
425
- var Bn = Object.getOwnPropertyDescriptor, Wn = (e, t, n, r) => {
426
- for (var i = r > 1 ? void 0 : r ? Bn(t, n) : t, s = e.length - 1, o; s >= 0; s--)
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--)
427
430
  (o = e[s]) && (i = o(i) || i);
428
431
  return i;
429
- }, P = (e, t) => (n, r) => t(n, r, e);
432
+ }, P = (e, t) => (r, n) => t(r, n, e);
430
433
  const $e = "SHEET_NUMFMT_PANEL";
431
434
  let W = class extends oe {
432
- constructor(t, n, r, i, s, o, a, c, l, h, m) {
435
+ constructor(t, r, n, i, s, o, a, c, m, d, l) {
433
436
  super();
434
437
  /**
435
438
  * If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
@@ -439,38 +442,38 @@ let W = class extends oe {
439
442
  */
440
443
  J(this, "_previewPattern", "");
441
444
  J(this, "_sidebarDisposable", null);
442
- this._sheetInterceptorService = t, this._themeService = n, this._univerInstanceService = r, this._commandService = i, this._selectionManagerService = s, this._renderManagerService = o, this._numfmtService = a, this._componentManager = c, this._sidebarService = l, this._localeService = h, this._sheetsNumfmtCellContentController = m, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener(), this._initNumfmtLocalChange();
445
+ 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 = m, this._localeService = d, this._sheetsNumfmtCellContentController = l, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener(), this._initNumfmtLocalChange();
443
446
  }
444
447
  _initNumfmtLocalChange() {
445
- this.disposeWithMe(et(this._sheetsNumfmtCellContentController.local$, this._localeService.currentLocale$).subscribe(() => {
448
+ this.disposeWithMe(tt(this._sheetsNumfmtCellContentController.local$, this._localeService.currentLocale$).subscribe(() => {
446
449
  this._forceUpdate();
447
450
  }));
448
451
  }
449
452
  openPanel() {
450
453
  var y;
451
- const t = this._sidebarService, n = this._selectionManagerService, r = this._commandService, i = this._univerInstanceService, s = this._numfmtService, o = this._localeService, c = (((y = n.getCurrentSelections()) == null ? void 0 : y.map((g) => g.range)) || [])[0];
454
+ const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, i = this._univerInstanceService, s = this._numfmtService, o = this._localeService, c = (((y = r.getCurrentSelections()) == null ? void 0 : y.map((g) => g.range)) || [])[0];
452
455
  if (!c)
453
456
  return !1;
454
- const l = i.getCurrentUnitForType(T.UNIVER_SHEET), h = l.getActiveSheet();
455
- if (!h)
457
+ const m = i.getCurrentUnitForType(T.UNIVER_SHEET), d = m.getActiveSheet();
458
+ if (!d)
456
459
  return !1;
457
- const m = h.getCellRaw(c.startRow, c.startColumn), d = s.getValue(
458
- l.getUnitId(),
459
- h.getSheetId(),
460
+ const l = d.getCellRaw(c.startRow, c.startColumn), h = s.getValue(
461
+ m.getUnitId(),
462
+ d.getSheetId(),
460
463
  c.startRow,
461
464
  c.startColumn
462
465
  );
463
466
  let p = "";
464
- d && (p = d.pattern);
465
- const v = (m == null ? void 0 : m.t) === x.NUMBER ? m.v : 12345678, f = {
467
+ h && (p = h.pattern);
468
+ const v = (l == null ? void 0 : l.t) === x.NUMBER ? l.v : 12345678, f = {
466
469
  onChange: (g) => {
467
470
  var N;
468
471
  if (g.type === "change")
469
472
  this._previewPattern = g.value, this._forceUpdate();
470
473
  else if (g.type === "confirm") {
471
- const w = ((N = n.getCurrentSelections()) == null ? void 0 : N.map((L) => L.range)) || [], R = { values: [] }, le = ne(g.value);
474
+ const w = ((N = r.getCurrentSelections()) == null ? void 0 : N.map((L) => L.range)) || [], R = { values: [] }, le = ne(g.value);
472
475
  w.forEach((L) => {
473
- Ae.foreach(L, (me, _) => {
476
+ je.foreach(L, (me, _) => {
474
477
  R.values.push({
475
478
  row: me,
476
479
  col: _,
@@ -478,7 +481,7 @@ let W = class extends oe {
478
481
  type: le
479
482
  });
480
483
  });
481
- }), r.executeCommand(Ke.id, R), t.close();
484
+ }), n.executeCommand(Ye.id, R), t.close();
482
485
  } else g.type === "cancel" && t.close();
483
486
  },
484
487
  value: { defaultPattern: p, defaultValue: v, row: c.startRow, col: c.startColumn }
@@ -491,16 +494,16 @@ let W = class extends oe {
491
494
  // need passthrough to react props.
492
495
  },
493
496
  onClose: () => {
494
- this._forceUpdate(), r.executeCommand(he.id);
497
+ this._forceUpdate(), n.executeCommand(he.id);
495
498
  }
496
499
  }), !0;
497
500
  }
498
501
  _forceUpdate(t) {
499
- var r;
500
- const n = this._renderManagerService.getRenderById(
502
+ var n;
503
+ const r = this._renderManagerService.getRenderById(
501
504
  t != null ? t : this._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET).getUnitId()
502
505
  );
503
- n == null || n.with(Ft).reCalculate(), (r = n == null ? void 0 : n.mainComponent) == null || r.makeDirty();
506
+ r == null || r.with($t).reCalculate(), (n = r == null ? void 0 : r.mainComponent) == null || n.makeDirty();
504
507
  }
505
508
  _initCommands() {
506
509
  [
@@ -511,50 +514,50 @@ let W = class extends oe {
511
514
  });
512
515
  }
513
516
  _initPanel() {
514
- this._componentManager.register($e, jn);
517
+ this._componentManager.register($e, Bn);
515
518
  }
516
519
  // eslint-disable-next-line max-lines-per-function
517
520
  _initRealTimeRenderingInterceptor() {
518
- const t = new A((r) => {
521
+ const t = new A((n) => {
519
522
  this._commandService.onCommandExecuted((i) => {
520
- i.id === j.id && r.next(!0), i.id === he.id && r.next(!1);
523
+ i.id === j.id && n.next(!0), i.id === he.id && n.next(!1);
521
524
  });
522
- }), n = nn([
525
+ }), r = rn([
523
526
  t,
524
527
  this._selectionManagerService.selectionMoveEnd$.pipe(
525
- sn((r) => r ? r.map((i) => i.range) : [])
528
+ on((n) => n ? n.map((i) => i.range) : [])
526
529
  )
527
530
  ]);
528
531
  this.disposeWithMe(
529
532
  ge(
530
- n.pipe(
531
- on(
532
- ([r, i]) => new A((s) => {
533
- const o = new pt();
534
- return r && i.length && s.next({ selectionRanges: i, disposableCollection: o }), () => {
533
+ r.pipe(
534
+ cn(
535
+ ([n, i]) => new A((s) => {
536
+ const o = new vt();
537
+ return n && i.length && s.next({ selectionRanges: i, disposableCollection: o }), () => {
535
538
  o.dispose();
536
539
  };
537
540
  })
538
541
  ),
539
- cn(() => {
542
+ an(() => {
540
543
  this._previewPattern = null;
541
544
  })
542
- ).subscribe(({ disposableCollection: r, selectionRanges: i }) => {
545
+ ).subscribe(({ disposableCollection: n, selectionRanges: i }) => {
543
546
  var o, a;
544
547
  const s = this._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET);
545
- this.openPanel(), r.add(
548
+ this.openPanel(), n.add(
546
549
  this._sheetInterceptorService.intercept(zt.CELL_CONTENT, {
547
550
  priority: 99,
548
551
  effect: Oe.Value | Oe.Style,
549
- handler: (c, l, h) => {
550
- const { row: m, col: d } = l, p = h(c) || {};
552
+ handler: (c, m, d) => {
553
+ const { row: l, col: h } = m, p = d(c) || {};
551
554
  if (i.find(
552
- (v) => v.startColumn <= d && v.endColumn >= d && v.startRow <= m && v.endRow >= m
555
+ (v) => v.startColumn <= h && v.endColumn >= h && v.startRow <= l && v.endRow >= l
553
556
  )) {
554
- const v = l.worksheet.getCellRaw(m, d), f = v == null ? void 0 : v.v, y = v == null ? void 0 : v.t;
557
+ const v = m.worksheet.getCellRaw(l, h), f = v == null ? void 0 : v.v, y = v == null ? void 0 : v.t;
555
558
  if (f == null || y !== x.NUMBER || this._previewPattern === null)
556
559
  return p;
557
- const g = Pt(this._previewPattern, f, this._sheetsNumfmtCellContentController.local);
560
+ const g = wt(this._previewPattern, f, this._sheetsNumfmtCellContentController.local);
558
561
  if (g.color) {
559
562
  const w = this._themeService.getCurrentTheme()[`${g.color}500`];
560
563
  return {
@@ -581,43 +584,43 @@ let W = class extends oe {
581
584
  _commandExecutedListener() {
582
585
  const t = [Ie.id, Ne.id];
583
586
  this.disposeWithMe(
584
- new A((n) => {
585
- const r = this._commandService.onCommandExecuted((i) => {
587
+ new A((r) => {
588
+ const n = this._commandService.onCommandExecuted((i) => {
586
589
  if (t.includes(i.id)) {
587
590
  const s = i.params;
588
- n.next(s.unitId);
591
+ r.next(s.unitId);
589
592
  }
590
593
  });
591
- return () => r.dispose();
592
- }).pipe(an(16)).subscribe((n) => this._forceUpdate(n))
594
+ return () => n.dispose();
595
+ }).pipe(ln(16)).subscribe((r) => this._forceUpdate(r))
593
596
  );
594
597
  }
595
598
  _initCloseListener() {
596
599
  this._univerInstanceService.getCurrentTypeOfUnit$(T.UNIVER_SHEET).subscribe((t) => {
597
- var n;
598
- t || ((n = this._sidebarDisposable) == null || n.dispose(), this._sidebarDisposable = null);
600
+ var r;
601
+ t || ((r = this._sidebarDisposable) == null || r.dispose(), this._sidebarDisposable = null);
599
602
  });
600
603
  }
601
604
  };
602
- W = Wn([
603
- P(0, S(Qe)),
604
- P(1, S(ft)),
605
+ W = Vn([
606
+ P(0, S(et)),
607
+ P(1, S(pt)),
605
608
  P(2, Se),
606
609
  P(3, ye),
607
610
  P(4, S(Ce)),
608
- P(5, Be),
611
+ P(5, We),
609
612
  P(6, be),
610
- P(7, S(qe)),
611
- P(8, At),
613
+ P(7, S(Je)),
614
+ P(8, jt),
612
615
  P(9, S(M)),
613
- P(10, S(Ge))
616
+ P(10, S(Ke))
614
617
  ], W);
615
- var Vn = Object.getOwnPropertyDescriptor, Gn = (e, t, n, r) => {
616
- for (var i = r > 1 ? void 0 : r ? Vn(t, n) : t, s = e.length - 1, o; s >= 0; s--)
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--)
617
620
  (o = e[s]) && (i = o(i) || i);
618
621
  return i;
619
- }, H = (e, t) => (n, r) => t(n, r, e);
620
- const Kn = () => {
622
+ }, H = (e, t) => (r, n) => t(r, n, e);
623
+ const Yn = () => {
621
624
  let e = [];
622
625
  return {
623
626
  add: (i, s, o, a, c) => e.push({ unitId: i, subUnitId: s, row: o, col: a, value: c }),
@@ -628,20 +631,20 @@ const Kn = () => {
628
631
  };
629
632
  };
630
633
  let re = class extends oe {
631
- constructor(t, n, r, i, s) {
634
+ constructor(t, r, n, i, s) {
632
635
  super();
633
636
  // collect effect mutations when edit end and push this to commands stack in next commands progress
634
- J(this, "_collectEffectMutation", Kn());
635
- this._sheetInterceptorService = t, this._numfmtService = n, this._univerInstanceService = r, this._injector = i, this._editorBridgeService = s, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
637
+ J(this, "_collectEffectMutation", Yn());
638
+ this._sheetInterceptorService = t, this._numfmtService = r, this._univerInstanceService = n, this._injector = i, this._editorBridgeService = s, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
636
639
  }
637
640
  _initInterceptorEditorStart() {
638
641
  this._editorBridgeService && this.disposeWithMe(
639
642
  ge(
640
- this._sheetInterceptorService.writeCellInterceptor.intercept(Yt, {
641
- handler: (t, n, r) => {
642
- const i = n.row, s = n.col, o = this._numfmtService.getValue(
643
- n.unitId,
644
- n.subUnitId,
643
+ this._sheetInterceptorService.writeCellInterceptor.intercept(Xt, {
644
+ handler: (t, r, n) => {
645
+ const i = r.row, s = r.col, o = this._numfmtService.getValue(
646
+ r.unitId,
647
+ r.subUnitId,
645
648
  i,
646
649
  s
647
650
  );
@@ -651,17 +654,17 @@ let re = class extends oe {
651
654
  case "currency":
652
655
  case "grouped":
653
656
  case "number": {
654
- const c = n.worksheet.getCellRaw(i, s);
655
- return r && r(c);
657
+ const c = r.worksheet.getCellRaw(i, s);
658
+ return n && n(c);
656
659
  }
657
660
  case "percent":
658
661
  case "date":
659
662
  case "time":
660
663
  case "datetime":
661
664
  default:
662
- return r && r(t);
665
+ return n && n(t);
663
666
  }
664
- return r(t);
667
+ return n(t);
665
668
  }
666
669
  })
667
670
  )
@@ -675,49 +678,49 @@ let re = class extends oe {
675
678
  _initInterceptorEditorEnd() {
676
679
  this.disposeWithMe(
677
680
  ge(
678
- this._sheetInterceptorService.writeCellInterceptor.intercept(Xt, {
681
+ this._sheetInterceptorService.writeCellInterceptor.intercept(qt, {
679
682
  // eslint-disable-next-line complexity
680
- handler: (t, n, r) => {
681
- var h, m, d, p;
683
+ handler: (t, r, n) => {
684
+ var d, l, h, p;
682
685
  this._collectEffectMutation.clean();
683
686
  const i = this._numfmtService.getValue(
684
- n.unitId,
685
- n.subUnitId,
686
- n.row,
687
- n.col
688
- ), s = (h = i && ne(i.pattern)) != null ? h : "", o = () => {
687
+ r.unitId,
688
+ r.subUnitId,
689
+ r.row,
690
+ r.col
691
+ ), s = (d = i && ne(i.pattern)) != null ? d : "", o = () => {
689
692
  i && this._collectEffectMutation.add(
690
- n.unitId,
691
- n.subUnitId,
692
- n.row,
693
- n.col,
693
+ r.unitId,
694
+ r.subUnitId,
695
+ r.row,
696
+ r.col,
694
697
  null
695
698
  );
696
699
  };
697
- if (!(t != null && t.v) && !(t != null && t.p) || Je(i == null ? void 0 : i.pattern) || t.t === x.FORCE_STRING)
698
- return r(t);
699
- const a = (m = t.p) == null ? void 0 : m.body, c = (p = (d = t == null ? void 0 : t.p) == null ? void 0 : d.body) != null && p.dataStream ? t.p.body.dataStream.replace(/\r\n$/, "") : String(t.v), l = Q.parseDate(c) || Q.parseTime(c) || Q.parseNumber(c);
700
+ if (!(t != null && t.v) && !(t != null && t.p) || Qe(i == null ? void 0 : i.pattern) || t.t === x.FORCE_STRING)
701
+ return n(t);
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);
700
703
  if (a)
701
704
  if (zn(a)) {
702
705
  const { dataStream: v } = a, f = v.replace(/\r\n$/, ""), y = Number(f);
703
- if (Number.isNaN(y) && !l)
704
- return r(t);
706
+ if (Number.isNaN(y) && !m)
707
+ return n(t);
705
708
  } else
706
- return r(t);
707
- if (l) {
708
- l.z && this._collectEffectMutation.add(
709
- n.unitId,
710
- n.subUnitId,
711
- n.row,
712
- n.col,
709
+ return n(t);
710
+ if (m) {
711
+ m.z && this._collectEffectMutation.add(
712
+ r.unitId,
713
+ r.subUnitId,
714
+ r.row,
715
+ r.col,
713
716
  {
714
- pattern: l.z
717
+ pattern: m.z
715
718
  }
716
719
  );
717
- const v = Number(l.v);
718
- return r({ ...t, p: void 0, v, t: x.NUMBER });
720
+ const v = Number(m.v);
721
+ return n({ ...t, p: void 0, v, t: x.NUMBER });
719
722
  } else (["date", "time", "datetime", "percent"].includes(s) || !Zn(c)) && o();
720
- return r(t);
723
+ return n(t);
721
724
  }
722
725
  })
723
726
  )
@@ -727,11 +730,11 @@ let re = class extends oe {
727
730
  const t = this;
728
731
  this.disposeWithMe(
729
732
  this._sheetInterceptorService.interceptCommand({
730
- getMutations(n) {
731
- var r;
732
- switch (n.id) {
733
- case qt.id: {
734
- const i = t._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET), s = i.getUnitId(), o = (r = i.getActiveSheet()) == null ? void 0 : r.getSheetId();
733
+ getMutations(r) {
734
+ var n;
735
+ switch (r.id) {
736
+ case Jt.id: {
737
+ const i = t._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET), s = i.getUnitId(), o = (n = i.getActiveSheet()) == null ? void 0 : n.getSheetId();
735
738
  if (!o)
736
739
  return {
737
740
  redos: [],
@@ -743,43 +746,43 @@ let re = class extends oe {
743
746
  redos: [],
744
747
  undos: []
745
748
  };
746
- const c = a.filter((d) => {
749
+ const c = a.filter((h) => {
747
750
  var p;
748
- return !!((p = d.value) != null && p.pattern);
749
- }).map((d) => ({
750
- row: d.row,
751
- col: d.col,
752
- pattern: d.value.pattern
753
- })), l = a.filter((d) => {
751
+ return !!((p = h.value) != null && p.pattern);
752
+ }).map((h) => ({
753
+ row: h.row,
754
+ col: h.col,
755
+ pattern: h.value.pattern
756
+ })), m = a.filter((h) => {
754
757
  var p;
755
- return !((p = d.value) != null && p.pattern);
756
- }).map((d) => ({
757
- startRow: d.row,
758
- endColumn: d.col,
759
- startColumn: d.col,
760
- endRow: d.row
761
- })), h = [], m = [];
758
+ return !((p = h.value) != null && p.pattern);
759
+ }).map((h) => ({
760
+ startRow: h.row,
761
+ endColumn: h.col,
762
+ startColumn: h.col,
763
+ endRow: h.row
764
+ })), d = [], l = [];
762
765
  if (c.length) {
763
- const d = {
766
+ const h = {
764
767
  id: Ne.id,
765
- params: Jt(s, o, c)
768
+ params: Qt(s, o, c)
766
769
  };
767
- h.push(d), m.push(...Qt(t._injector, d.params));
770
+ d.push(h), l.push(...en(t._injector, h.params));
768
771
  }
769
- if (l.length) {
770
- const d = {
772
+ if (m.length) {
773
+ const h = {
771
774
  id: Ie.id,
772
775
  params: {
773
776
  unitId: s,
774
777
  subUnitId: o,
775
- ranges: l
778
+ ranges: m
776
779
  }
777
780
  };
778
- h.push(d), m.push(...en(t._injector, d.params));
781
+ d.push(h), l.push(...tn(t._injector, h.params));
779
782
  }
780
783
  return {
781
- redos: h,
782
- undos: m.reverse()
784
+ redos: d,
785
+ undos: l.reverse()
783
786
  };
784
787
  }
785
788
  }
@@ -792,19 +795,19 @@ let re = class extends oe {
792
795
  );
793
796
  }
794
797
  };
795
- re = Gn([
796
- H(0, S(Qe)),
798
+ re = Kn([
799
+ H(0, S(et)),
797
800
  H(1, S(be)),
798
801
  H(2, S(Se)),
799
- H(3, S(je)),
800
- H(4, vt($t))
802
+ H(3, S(Be)),
803
+ H(4, gt(xt))
801
804
  ], re);
802
805
  function Zn(e) {
803
806
  return /^-?\d+(\.\d+)?$/.test(e);
804
807
  }
805
808
  function zn(e) {
806
- const { textRuns: t = [], paragraphs: n = [], customRanges: r, customBlocks: i = [] } = e, s = ["va"];
807
- return !(t.some((o) => !!(o.ts && Object.keys(o.ts).some((c) => s.includes(c)))) || n.some((o) => o.bullet) || n.length >= 2 || r != null && r.length || i.length > 0);
809
+ const { textRuns: t = [], paragraphs: r = [], customRanges: n, customBlocks: i = [] } = e, s = ["va"];
810
+ 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);
808
811
  }
809
812
  const ee = [
810
813
  {
@@ -864,94 +867,94 @@ const ee = [
864
867
  label: "sheet.numfmt.moreFmt",
865
868
  pattern: ""
866
869
  }
867
- ], Yn = (e) => ({
870
+ ], Xn = (e) => ({
868
871
  icon: new A((t) => {
869
- const n = e.get(wt);
870
- function r(s) {
872
+ const r = e.get(Rt);
873
+ function n(s) {
871
874
  return {
872
- [F.US]: "DollarSingle",
873
- [F.RU]: "RoubleSingle",
874
- [F.CN]: "RmbSingle",
875
- [F.AT]: "EuroSingle"
875
+ [$.US]: "DollarSingle",
876
+ [$.RU]: "RoubleSingle",
877
+ [$.CN]: "RmbSingle",
878
+ [$.AT]: "EuroSingle"
876
879
  }[s] || "DollarSingle";
877
880
  }
878
- const i = F[n.getCurrencySymbol()] || "$";
879
- return t.next(r(i)), n.currencySymbol$.subscribe((s) => {
880
- const o = F[s] || "$";
881
- t.next(r(o));
881
+ const i = $[r.getCurrencySymbol()] || "$";
882
+ return t.next(n(i)), r.currencySymbol$.subscribe((s) => {
883
+ const o = $[s] || "$";
884
+ t.next(n(o));
882
885
  });
883
886
  }),
884
- id: Xe.id,
887
+ id: qe.id,
885
888
  title: "sheet.numfmt.currency",
886
889
  tooltip: "sheet.numfmt.currency",
887
- type: Z.BUTTON,
890
+ type: Y.BUTTON,
888
891
  hidden$: K(e, T.UNIVER_SHEET),
889
- disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, Y], rangeTypes: [z] })
890
- }), Xn = (e) => ({
892
+ disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, z], rangeTypes: [Z] })
893
+ }), qn = (e) => ({
891
894
  icon: "AddDigitsSingle",
892
- id: Ye.id,
895
+ id: Xe.id,
893
896
  title: "sheet.numfmt.addDecimal",
894
897
  tooltip: "sheet.numfmt.addDecimal",
895
- type: Z.BUTTON,
898
+ type: Y.BUTTON,
896
899
  hidden$: K(e, T.UNIVER_SHEET),
897
- disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, Y], rangeTypes: [z] })
898
- }), qn = (e) => ({
900
+ disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, z], rangeTypes: [Z] })
901
+ }), Jn = (e) => ({
899
902
  icon: "ReduceDigitsSingle",
900
903
  id: ze.id,
901
904
  title: "sheet.numfmt.subtractDecimal",
902
905
  tooltip: "sheet.numfmt.subtractDecimal",
903
- type: Z.BUTTON,
906
+ type: Y.BUTTON,
904
907
  hidden$: K(e, T.UNIVER_SHEET),
905
- disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, Y], rangeTypes: [z] })
906
- }), Jn = (e) => ({
908
+ disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, z], rangeTypes: [Z] })
909
+ }), Qn = (e) => ({
907
910
  icon: "PercentSingle",
908
911
  id: Ze.id,
909
912
  title: "sheet.numfmt.percent",
910
913
  tooltip: "sheet.numfmt.percent",
911
- type: Z.BUTTON,
914
+ type: Y.BUTTON,
912
915
  hidden$: K(e, T.UNIVER_SHEET),
913
- disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, Y], rangeTypes: [z] })
914
- }), Qn = (e) => {
915
- const t = e.get(Se), n = e.get(ye), r = e.get(M), i = e.get(Ce), s = [Ie.id, Ne.id], o = xt(
916
+ disabled$: G(e, { workbookTypes: [q], worksheetTypes: [X, z], rangeTypes: [Z] })
917
+ }), er = (e) => {
918
+ const t = e.get(Se), r = e.get(ye), n = e.get(M), i = e.get(Ce), s = [Ie.id, Ne.id], o = Lt(
916
919
  t,
917
920
  "",
918
921
  ({ workbook: a, worksheet: c }) => new A(
919
- (l) => et(
922
+ (m) => tt(
920
923
  i.selectionMoveEnd$,
921
- gt(n.onCommandExecuted.bind(n)).pipe(
922
- rn(([h]) => s.includes(h.id))
924
+ _t(r.onCommandExecuted.bind(r)).pipe(
925
+ sn(([d]) => s.includes(d.id))
923
926
  )
924
927
  ).subscribe(() => {
925
- var m, d;
926
- const h = i.getCurrentSelections();
927
- if (h && h[0]) {
928
- const p = h[0].range, v = p.startRow, f = p.startColumn, y = (d = a.getStyles().get((m = c.getCell(v, f)) == null ? void 0 : m.s)) == null ? void 0 : d.n, g = y == null ? void 0 : y.pattern;
929
- let N = r.t("sheet.numfmt.general");
930
- if (Kt(g)) {
931
- l.next(N);
928
+ var l, h;
929
+ const d = i.getCurrentSelections();
930
+ if (d && d[0]) {
931
+ 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
+ let N = n.t("sheet.numfmt.general");
933
+ if (Yt(g)) {
934
+ m.next(N);
932
935
  return;
933
936
  }
934
937
  if (g) {
935
938
  const w = ee.filter((R) => typeof R == "object" && R.pattern).find(
936
939
  (R) => ce(g, R.pattern)
937
940
  );
938
- w && typeof w == "object" && w.pattern ? N = r.t(w.label) : N = r.t("sheet.numfmt.moreFmt");
941
+ w && typeof w == "object" && w.pattern ? N = n.t(w.label) : N = n.t("sheet.numfmt.moreFmt");
939
942
  }
940
- l.next(N);
943
+ m.next(N);
941
944
  }
942
945
  })
943
946
  )
944
947
  );
945
948
  return {
946
- label: ot,
949
+ label: ct,
947
950
  id: j.id,
948
951
  tooltip: "sheet.numfmt.title",
949
- type: Z.SELECTOR,
952
+ type: Y.SELECTOR,
950
953
  slot: !0,
951
954
  selections: [
952
955
  {
953
956
  label: {
954
- name: ct,
957
+ name: at,
955
958
  hoverable: !1,
956
959
  selectable: !1
957
960
  }
@@ -959,31 +962,31 @@ const ee = [
959
962
  ],
960
963
  value$: o,
961
964
  hidden$: K(e, T.UNIVER_SHEET),
962
- disabled$: G(e, { workbookTypes: [q], worksheetTypes: [Y, X], rangeTypes: [z] })
965
+ disabled$: G(e, { workbookTypes: [q], worksheetTypes: [z, X], rangeTypes: [Z] })
963
966
  };
964
- }, ot = "sheet.numfmt.moreNumfmtType", ct = "sheet.numfmt.moreNumfmtType.options", er = (e) => {
965
- const { value: t } = e, n = C(M), r = t != null ? t : n.t("sheet.numfmt.general");
966
- return /* @__PURE__ */ u("span", { className: "univer-text-sm", children: r });
967
- }, tr = () => {
968
- const e = C(ye), t = C(M), n = C(jt), r = C(Ge), i = C(Ce), s = (c) => {
969
- const l = i.getCurrentLastSelection();
970
- if (!l)
967
+ }, ct = "sheet.numfmt.moreNumfmtType", at = "sheet.numfmt.moreNumfmtType.options", tr = (e) => {
968
+ const { value: t } = e, r = C(M), n = t != null ? t : r.t("sheet.numfmt.general");
969
+ 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) => {
972
+ const m = i.getCurrentLastSelection();
973
+ if (!m)
971
974
  return;
972
- const h = l.range, m = [];
973
- Ae.foreach(h, (d, p) => {
974
- c ? m.push({ row: d, col: p, pattern: c, type: ne(c) }) : m.push({ row: d, col: p });
975
- }), e.executeCommand(Ke.id, { values: m }), n.focus();
975
+ const d = m.range, l = [];
976
+ je.foreach(d, (h, p) => {
977
+ 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();
976
979
  }, o = (c) => {
977
980
  if (c === 0)
978
981
  s(null);
979
982
  else if (c === ee.length - 1)
980
- e.executeCommand(j.id), n.focus();
983
+ e.executeCommand(j.id), r.focus();
981
984
  else {
982
- const l = ee[c];
983
- l.pattern && s(l.pattern);
985
+ const m = ee[c];
986
+ m.pattern && s(m.pattern);
984
987
  }
985
988
  }, a = 1220;
986
- return /* @__PURE__ */ u("div", { className: "univer-grid univer-gap-1 univer-p-1.5", children: ee.map((c, l) => c === "|" ? /* @__PURE__ */ u(un, {}, l) : /* @__PURE__ */ b(
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(
987
990
  "div",
988
991
  {
989
992
  className: `
@@ -992,71 +995,71 @@ const ee = [
992
995
  hover:univer-bg-gray-100
993
996
  `,
994
997
  onClick: () => {
995
- o(l);
998
+ o(m);
996
999
  },
997
1000
  children: [
998
1001
  /* @__PURE__ */ u("span", { children: t.t(c.label) }),
999
- /* @__PURE__ */ u("span", { className: "univer-text-xs univer-text-gray-500", children: c.pattern ? Rt(c.pattern || "", a, r.local).result.trim() : "" })
1002
+ /* @__PURE__ */ u("span", { className: "univer-text-xs univer-text-gray-500", children: c.pattern ? Ot(c.pattern || "", a, n.local).result.trim() : "" })
1000
1003
  ]
1001
1004
  },
1002
- l
1005
+ m
1003
1006
  )) });
1004
- }, nr = {
1005
- [Bt.FORMULAS_INSERT]: {
1006
- [Xe.id]: {
1007
+ }, rr = {
1008
+ [Wt.FORMULAS_INSERT]: {
1009
+ [qe.id]: {
1007
1010
  order: 4,
1008
- menuItemFactory: Yn
1011
+ menuItemFactory: Xn
1009
1012
  },
1010
- [Ye.id]: {
1013
+ [Xe.id]: {
1011
1014
  order: 5,
1012
- menuItemFactory: Xn
1015
+ menuItemFactory: qn
1013
1016
  },
1014
1017
  [ze.id]: {
1015
1018
  order: 6,
1016
- menuItemFactory: qn
1019
+ menuItemFactory: Jn
1017
1020
  },
1018
1021
  [Ze.id]: {
1019
1022
  order: 7,
1020
- menuItemFactory: Jn
1023
+ menuItemFactory: Qn
1021
1024
  },
1022
1025
  [j.id]: {
1023
1026
  order: 8,
1024
- menuItemFactory: Qn
1027
+ menuItemFactory: er
1025
1028
  }
1026
1029
  }
1027
1030
  };
1028
- var rr = Object.getOwnPropertyDescriptor, ir = (e, t, n, r) => {
1029
- for (var i = r > 1 ? void 0 : r ? rr(t, n) : t, s = e.length - 1, o; s >= 0; s--)
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--)
1030
1033
  (o = e[s]) && (i = o(i) || i);
1031
1034
  return i;
1032
- }, xe = (e, t) => (n, r) => t(n, r, e);
1035
+ }, xe = (e, t) => (r, n) => t(r, n, e);
1033
1036
  let ie = class extends oe {
1034
1037
  constructor(e, t) {
1035
1038
  super(), this._componentManager = e, this._menuManagerService = t, this._initMenu();
1036
1039
  }
1037
1040
  _initMenu() {
1038
- this._menuManagerService.mergeMenu(nr), this.disposeWithMe(this._componentManager.register(ot, er)), this.disposeWithMe(this._componentManager.register(ct, tr));
1041
+ this._menuManagerService.mergeMenu(rr), this.disposeWithMe(this._componentManager.register(ct, tr)), this.disposeWithMe(this._componentManager.register(at, nr));
1039
1042
  }
1040
1043
  };
1041
- ie = ir([
1042
- xe(0, S(qe)),
1043
- xe(1, Wt)
1044
+ ie = sr([
1045
+ xe(0, S(Je)),
1046
+ xe(1, Vt)
1044
1047
  ], ie);
1045
- var sr = Object.defineProperty, or = Object.getOwnPropertyDescriptor, cr = (e, t, n) => t in e ? sr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, ar = (e, t, n, r) => {
1046
- for (var i = r > 1 ? void 0 : r ? or(t, n) : t, s = e.length - 1, o; s >= 0; s--)
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--)
1047
1050
  (o = e[s]) && (i = o(i) || i);
1048
1051
  return i;
1049
- }, ve = (e, t) => (n, r) => t(n, r, e), at = (e, t, n) => cr(e, typeof t != "symbol" ? t + "" : t, n);
1050
- const lr = "SHEET_NUMFMT_UI_PLUGIN";
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";
1051
1054
  let se = class extends yt {
1052
- constructor(e = ke, t, n, r) {
1053
- super(), this._config = e, this._injector = t, this._configService = n, this._renderManagerService = r;
1055
+ constructor(e = Fe, t, r, n) {
1056
+ super(), this._config = e, this._injector = t, this._configService = r, this._renderManagerService = n;
1054
1057
  const { menu: i, ...s } = bt(
1055
1058
  {},
1056
- ke,
1059
+ Fe,
1057
1060
  this._config
1058
1061
  );
1059
- i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Vt, s);
1062
+ i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Gt, s);
1060
1063
  }
1061
1064
  onStarting() {
1062
1065
  Ct(this._injector, [
@@ -1081,13 +1084,13 @@ let se = class extends yt {
1081
1084
  });
1082
1085
  }
1083
1086
  };
1084
- at(se, "pluginName", lr);
1085
- at(se, "type", T.UNIVER_SHEET);
1086
- se = ar([
1087
- _t(Lt, Ot),
1088
- ve(1, S(je)),
1089
- ve(2, St),
1090
- ve(3, Be)
1087
+ lt(se, "pluginName", mr);
1088
+ lt(se, "type", T.UNIVER_SHEET);
1089
+ se = lr([
1090
+ St(Ht, Ut),
1091
+ ve(1, S(Be)),
1092
+ ve(2, Le),
1093
+ ve(3, We)
1091
1094
  ], se);
1092
1095
  export {
1093
1096
  se as UniverSheetsNumfmtUIPlugin