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