@univerjs/sheets-numfmt-ui 0.6.0 → 0.6.1

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