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