@univerjs/sheets-numfmt 0.2.2 → 0.2.3

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,19 +1,19 @@
1
1
  var dt = Object.defineProperty;
2
2
  var ft = (e, t, r) => t in e ? dt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var ie = (e, t, r) => ft(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { LocaleType as ht, Disposable as z, ObjectMatrix as Le, CellValueType as V, Range as R, UniverInstanceType as T, OnLifecycle as K, LifecycleStages as B, ThemeService as Fe, ICommandService as O, LocaleService as E, IUniverInstanceService as w, CommandType as D, IUndoRedoService as pt, sequenceExecute as vt, runOnLifecycle as _t, ILocalStorageService as gt, toDisposable as Ie, DisposableCollection as St, Plugin as bt, Tools as yt, DependentOn as Ct } from "@univerjs/core";
5
- import { Inject as b, createIdentifier as Tt, Injector as Me, Optional as It } from "@wendellhu/redi";
6
- import { INTERCEPTOR_POINT as We, SetNumfmtMutation as Y, SetRangeValuesMutation as Et, SheetInterceptorService as Pe, INumfmtService as H, getSheetCommandTarget as Re, transformCellsToRange as ke, rangeMerge as Ae, factorySetNumfmtUndoMutation as Ge, RemoveNumfmtMutation as pe, factoryRemoveNumfmtUndoMutation as ze, SelectionManagerService as U, SetRangeValuesCommand as Nt, WorkbookEditablePermission as q, WorksheetEditPermission as J, WorksheetSetCellStylePermission as Z, RangeProtectionPermissionEditPoint as Q, UniverSheetsPlugin as Mt } from "@univerjs/sheets";
7
- import { SheetSkeletonManagerService as Pt, IEditorBridgeService as Rt, getCurrentRangeDisable$ as X, deriveStateFromActiveSheet$ as xt, UniverSheetsUIPlugin as Ot } from "@univerjs/sheets-ui";
8
- import { switchMap as jt, of as $t, skip as wt, Observable as k, combineLatest as Dt, merge as Ut } from "rxjs";
9
- import x from "@univerjs/engine-numfmt";
10
- import { IRenderManagerService as Lt, ITextSelectionRenderManager as At } from "@univerjs/engine-render";
11
- import { ComponentManager as Ke, ISidebarService as Vt, MenuItemType as ee, MenuGroup as te, MenuPosition as ne, getMenuHiddenObservable as re, IMenuService as Bt } from "@univerjs/ui";
12
- import { map as Ht, switchMap as Ft, tap as Wt, debounceTime as kt } from "rxjs/operators";
13
- import Gt, { createContext as zt, useState as I, useEffect as xe, useRef as Ye, useContext as qe, useMemo as P, createElement as Kt } from "react";
14
- import { InputNumber as Oe, Select as je, SelectList as $e, Button as Ve } from "@univerjs/design";
15
- import { useDependency as N, useInjector as Yt } from "@wendellhu/redi/react-bindings";
16
- const Ee = "SHEET_NUMFMT_PLUGIN", me = (e) => x.getInfo(e).type || "unknown", we = (e, t, r) => {
3
+ var ce = (e, t, r) => ft(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { LocaleType as ht, Disposable as K, ObjectMatrix as Le, CellValueType as V, Range as R, UniverInstanceType as T, OnLifecycle as Y, LifecycleStages as B, ThemeService as We, ICommandService as O, LocaleService as E, IUniverInstanceService as w, CommandType as D, IUndoRedoService as pt, sequenceExecute as vt, runOnLifecycle as _t, ILocalStorageService as gt, toDisposable as Ee, DisposableCollection as St, Plugin as bt, Tools as Ct, DependentOn as yt } from "@univerjs/core";
5
+ import { Inject as b, createIdentifier as Tt, Injector as Pe, Optional as It } from "@wendellhu/redi";
6
+ import { INTERCEPTOR_POINT as ke, SetNumfmtMutation as q, SetRangeValuesMutation as Et, SheetInterceptorService as Re, INumfmtService as H, getSheetCommandTarget as xe, transformCellsToRange as Ge, rangeMerge as Ve, factorySetNumfmtUndoMutation as ze, RemoveNumfmtMutation as _e, factoryRemoveNumfmtUndoMutation as Ke, SheetsSelectionsService as U, SetRangeValuesCommand as Nt, WorkbookEditablePermission as J, WorksheetEditPermission as X, WorksheetSetCellStylePermission as Z, RangeProtectionPermissionEditPoint as Q, UniverSheetsPlugin as Mt } from "@univerjs/sheets";
7
+ import { SheetSkeletonManagerService as Pt, IEditorBridgeService as Rt, getCurrentRangeDisable$ as ee, deriveStateFromActiveSheet$ as xt, UniverSheetsUIPlugin as Ot } from "@univerjs/sheets-ui";
8
+ import { switchMap as jt, of as $t, skip as wt, Observable as G, combineLatest as Dt, merge as Ut } from "rxjs";
9
+ import x, { DEFAULT_TEXT_FORMAT as At } from "@univerjs/engine-numfmt";
10
+ import { IRenderManagerService as Lt, ITextSelectionRenderManager as Vt } from "@univerjs/engine-render";
11
+ import { ComponentManager as Ye, ISidebarService as Bt, MenuItemType as te, MenuGroup as ne, MenuPosition as re, getMenuHiddenObservable as se, IMenuService as Ht } from "@univerjs/ui";
12
+ import { map as Ft, switchMap as Wt, tap as kt, debounceTime as Gt } from "rxjs/operators";
13
+ import zt, { createContext as Kt, useState as I, useEffect as Oe, useRef as qe, useContext as Je, useMemo as P, createElement as Yt } from "react";
14
+ import { InputNumber as je, Select as $e, SelectList as we, Button as Be } from "@univerjs/design";
15
+ import { useDependency as N, useInjector as qt } from "@wendellhu/redi/react-bindings";
16
+ const Ne = "SHEET_NUMFMT_PLUGIN", fe = (e) => x.getInfo(e).type || "unknown", De = (e, t, r) => {
17
17
  const n = x.getInfo(e), s = r === ht.ZH_CN ? "zh-CN" : "en", i = n._partitions[1], o = x.format(e, t, { locale: s });
18
18
  return t < 0 ? {
19
19
  result: o,
@@ -22,18 +22,18 @@ const Ee = "SHEET_NUMFMT_PLUGIN", me = (e) => x.getInfo(e).type || "unknown", we
22
22
  result: o
23
23
  };
24
24
  };
25
- var qt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, Zt = (e, t, r, n) => {
26
- for (var s = n > 1 ? void 0 : n ? Jt(t, r) : t, i = e.length - 1, o; i >= 0; i--)
25
+ var Jt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, Zt = (e, t, r, n) => {
26
+ for (var s = n > 1 ? void 0 : n ? Xt(t, r) : t, i = e.length - 1, o; i >= 0; i--)
27
27
  (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
28
- return n && s && qt(t, r, s), s;
29
- }, A = (e, t) => (r, n) => t(r, n, e);
30
- let oe = class extends z {
28
+ return n && s && Jt(t, r, s), s;
29
+ }, L = (e, t) => (r, n) => t(r, n, e);
30
+ let ae = class extends K {
31
31
  constructor(e, t, r, n, s, i) {
32
32
  super(), this._instanceService = e, this._sheetInterceptorService = t, this._themeService = r, this._commandService = n, this._numfmtService = s, this._localeService = i, this._initInterceptorCellContent();
33
33
  }
34
34
  _initInterceptorCellContent() {
35
35
  const e = new Le();
36
- this.disposeWithMe(this._sheetInterceptorService.intercept(We.CELL_CONTENT, {
36
+ this.disposeWithMe(this._sheetInterceptorService.intercept(ke.CELL_CONTENT, {
37
37
  handler: (t, r, n) => {
38
38
  const s = r.unitId, i = r.subUnitId, o = this._numfmtService.getValue(s, i, r.row, r.col);
39
39
  if (!o)
@@ -45,7 +45,7 @@ let oe = class extends z {
45
45
  const f = e.getValue(r.row, r.col);
46
46
  if (f && f.parameters === c.v)
47
47
  return n({ ...t, ...f.result });
48
- const m = we(o.pattern, Number(c.v), this._localeService.getCurrentLocale());
48
+ const m = De(o.pattern, Number(c.v), this._localeService.getCurrentLocale());
49
49
  if (a = m.result, !a)
50
50
  return n(t);
51
51
  const l = { v: a };
@@ -60,7 +60,7 @@ let oe = class extends z {
60
60
  },
61
61
  priority: 10
62
62
  })), this.disposeWithMe(this._commandService.onCommandExecuted((t) => {
63
- if (t.id === Y.id) {
63
+ if (t.id === q.id) {
64
64
  const r = t.params;
65
65
  Object.keys(r.values).forEach((n) => {
66
66
  r.values[n].ranges.forEach((i) => {
@@ -86,19 +86,19 @@ let oe = class extends z {
86
86
  );
87
87
  }
88
88
  };
89
- oe = Zt([
90
- K(B.Rendered, oe),
91
- A(0, w),
92
- A(1, b(Pe)),
93
- A(2, b(Fe)),
94
- A(3, b(O)),
95
- A(4, b(H)),
96
- A(5, b(E))
97
- ], oe);
89
+ ae = Zt([
90
+ Y(B.Rendered, ae),
91
+ L(0, w),
92
+ L(1, b(Re)),
93
+ L(2, b(We)),
94
+ L(3, b(O)),
95
+ L(4, b(H)),
96
+ L(5, b(E))
97
+ ], ae);
98
98
  const j = (e, t = 0) => {
99
99
  var n;
100
100
  return e && (n = x.getInfo(e).maxDecimals) != null ? n : t;
101
- }, ve = (e, t) => {
101
+ }, ge = (e, t) => {
102
102
  if (e && !t || !e && t)
103
103
  return !1;
104
104
  const r = (f) => f.reduce(
@@ -111,21 +111,21 @@ const j = (e, t = 0) => {
111
111
  { isEnd: !1, result: "" }
112
112
  ).result, n = x.getInfo(e)._partitions, s = x.getInfo(t)._partitions, i = r(n[0].tokens), o = r(s[0].tokens), c = r(n[1].tokens), a = r(s[1].tokens);
113
113
  return i === o && c === a && n[1].color === s[1].color;
114
- }, Be = (e) => new Array(Math.min(Math.max(0, Number(e)), 30)).fill(0).join(""), C = (e, t) => e.split(";").map((n) => /\.0?/.test(n) ? n.replace(
114
+ }, He = (e) => new Array(Math.min(Math.max(0, Number(e)), 30)).fill(0).join(""), y = (e, t) => e.split(";").map((n) => /\.0?/.test(n) ? n.replace(
115
115
  /\.0*/g,
116
- `${t > 0 ? "." : ""}${Be(Number(t || 0))}`
116
+ `${t > 0 ? "." : ""}${He(Number(t || 0))}`
117
117
  ) : /0([^0]?)|0$/.test(n) ? n.replace(
118
118
  /0([^0]+)|0$/,
119
- `0${t > 0 ? "." : ""}${Be(Number(t || 0))}$1`
119
+ `0${t > 0 ? "." : ""}${He(Number(t || 0))}$1`
120
120
  ) : n).join(";"), Qt = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), $ = {
121
121
  id: "sheet.command.numfmt.set.numfmt",
122
122
  type: D.COMMAND,
123
123
  handler: (e, t) => {
124
124
  if (!t)
125
125
  return !1;
126
- const r = e.get(O), n = e.get(w), s = e.get(pt), i = Re(n, t);
126
+ const r = e.get(O), n = e.get(w), s = e.get(pt), i = xe(n, t);
127
127
  if (!i) return !1;
128
- const { unitId: o, subUnitId: c } = i, a = t.values.filter((h) => !!h.pattern), f = t.values.filter((h) => !h.pattern), m = ke(o, c, a), l = {
128
+ const { unitId: o, subUnitId: c } = i, a = t.values.filter((h) => !!h.pattern), f = t.values.filter((h) => !h.pattern), m = Ge(o, c, a), l = {
129
129
  unitId: o,
130
130
  subUnitId: c,
131
131
  ranges: f.map((h) => ({
@@ -134,66 +134,66 @@ const j = (e, t = 0) => {
134
134
  endColumn: h.col,
135
135
  endRow: h.row
136
136
  }))
137
- }, u = [], p = [];
137
+ }, u = [], v = [];
138
138
  if (a.length) {
139
- Object.keys(m.values).forEach((v) => {
140
- const g = m.values[v];
141
- g.ranges = Ae(g.ranges);
139
+ Object.keys(m.values).forEach((g) => {
140
+ const p = m.values[g];
141
+ p.ranges = Ve(p.ranges);
142
142
  }), u.push({
143
- id: Y.id,
143
+ id: q.id,
144
144
  params: m
145
145
  });
146
- const h = Ge(e, m);
147
- p.push(...h);
146
+ const h = ze(e, m);
147
+ v.push(...h);
148
148
  }
149
149
  if (f.length) {
150
- l.ranges = Ae(l.ranges), u.push({
151
- id: pe.id,
150
+ l.ranges = Ve(l.ranges), u.push({
151
+ id: _e.id,
152
152
  params: l
153
153
  });
154
- const h = ze(e, l);
155
- p.push(...h);
154
+ const h = Ke(e, l);
155
+ v.push(...h);
156
156
  }
157
157
  const _ = vt(u, r).result;
158
158
  return _ && s.pushUndoRedo({
159
159
  unitID: o,
160
- undoMutations: p,
160
+ undoMutations: v,
161
161
  redoMutations: u
162
162
  }), _;
163
163
  }
164
- }, Je = {
164
+ }, Xe = {
165
165
  id: "sheet.command.numfmt.add.decimal.command",
166
166
  type: D.COMMAND,
167
167
  handler: async (e) => {
168
- const t = e.get(O), r = e.get(U), n = e.get(H), s = e.get(w), i = r.getSelections();
168
+ const t = e.get(O), r = e.get(U), n = e.get(H), s = e.get(w), i = r.getCurrentSelections();
169
169
  if (!i || !i.length)
170
170
  return !1;
171
- const o = Re(s);
171
+ const o = xe(s);
172
172
  if (!o) return !1;
173
173
  const { unitId: c, subUnitId: a } = o;
174
174
  let f = 0;
175
- i.forEach((p) => {
176
- R.foreach(p.range, (_, h) => {
177
- const v = n.getValue(c, a, _, h);
178
- if (!v)
175
+ i.forEach((v) => {
176
+ R.foreach(v.range, (_, h) => {
177
+ const g = n.getValue(c, a, _, h);
178
+ if (!g)
179
179
  return;
180
- const g = j(v.pattern);
181
- f = g > f ? g : f;
180
+ const p = j(g.pattern);
181
+ f = p > f ? p : f;
182
182
  });
183
183
  });
184
- const m = f + 1, l = C(`0${m > 0 ? ".0" : ""}`, m), u = [];
185
- return i.forEach((p) => {
186
- R.foreach(p.range, (_, h) => {
187
- const v = n.getValue(c, a, _, h);
188
- if (!v)
184
+ const m = f + 1, l = y(`0${m > 0 ? ".0" : ""}`, m), u = [];
185
+ return i.forEach((v) => {
186
+ R.foreach(v.range, (_, h) => {
187
+ const g = n.getValue(c, a, _, h);
188
+ if (!g)
189
189
  u.push({
190
190
  row: _,
191
191
  col: h,
192
192
  pattern: l
193
193
  });
194
194
  else {
195
- const g = j(v.pattern), S = C(v.pattern, g + 1);
196
- S !== v.pattern && u.push({
195
+ const p = j(g.pattern), S = y(g.pattern, p + 1);
196
+ S !== g.pattern && u.push({
197
197
  row: _,
198
198
  col: h,
199
199
  pattern: S
@@ -202,7 +202,7 @@ const j = (e, t = 0) => {
202
202
  });
203
203
  }), u.length ? await t.executeCommand($.id, { values: u }) : !1;
204
204
  }
205
- }, Xt = [
205
+ }, en = [
206
206
  {
207
207
  label: "1930-08-05",
208
208
  suffix: "yyyy-MM-dd"
@@ -247,7 +247,7 @@ const j = (e, t = 0) => {
247
247
  label: "08-05 下午 01:30",
248
248
  suffix: "MM-dd A/P hh:mm"
249
249
  }
250
- ], en = [
250
+ ], tn = [
251
251
  {
252
252
  label: "(1,235)",
253
253
  suffix: "#,##0_);(#,##0)"
@@ -307,7 +307,7 @@ const j = (e, t = 0) => {
307
307
  id: "sheet.command.numfmt.set.currency",
308
308
  type: D.COMMAND,
309
309
  handler: async (e) => {
310
- const t = e.get(O), n = e.get(U).getSelections();
310
+ const t = e.get(O), n = e.get(U).getCurrentSelections();
311
311
  if (!n || !n.length)
312
312
  return !1;
313
313
  const s = [], i = Ze[0].suffix("¥");
@@ -317,42 +317,42 @@ const j = (e, t = 0) => {
317
317
  });
318
318
  }), await t.executeCommand($.id, { values: s });
319
319
  }
320
- }, Xe = {
320
+ }, et = {
321
321
  id: "sheet.command.numfmt.subtract.decimal.command",
322
322
  type: D.COMMAND,
323
323
  handler: async (e) => {
324
- const t = e.get(O), r = e.get(U), n = e.get(H), s = e.get(w), i = r.getSelections();
324
+ const t = e.get(O), r = e.get(U), n = e.get(H), s = e.get(w), i = r.getCurrentSelections();
325
325
  if (!i || !i.length)
326
326
  return !1;
327
- const o = Re(s);
327
+ const o = xe(s);
328
328
  if (!o) return !1;
329
329
  const { unitId: c, subUnitId: a } = o;
330
330
  let f = 0;
331
331
  i.forEach((_) => {
332
- R.foreach(_.range, (h, v) => {
333
- const g = n.getValue(c, a, h, v);
334
- if (!g)
332
+ R.foreach(_.range, (h, g) => {
333
+ const p = n.getValue(c, a, h, g);
334
+ if (!p)
335
335
  return;
336
- const S = j(g.pattern);
336
+ const S = j(p.pattern);
337
337
  f = S > f ? S : f;
338
338
  });
339
339
  });
340
- const m = f - 1, l = C(`0${m > 0 ? ".0" : "."}`, m), u = [];
340
+ const m = f - 1, l = y(`0${m > 0 ? ".0" : "."}`, m), u = [];
341
341
  return i.forEach((_) => {
342
- R.foreach(_.range, (h, v) => {
343
- const g = n.getValue(c, a, h, v);
344
- if (!g)
342
+ R.foreach(_.range, (h, g) => {
343
+ const p = n.getValue(c, a, h, g);
344
+ if (!p)
345
345
  u.push({
346
346
  row: h,
347
- col: v,
347
+ col: g,
348
348
  pattern: l
349
349
  });
350
350
  else {
351
- const S = j(g.pattern);
351
+ const S = j(p.pattern);
352
352
  u.push({
353
353
  row: h,
354
- col: v,
355
- pattern: C(g.pattern, S - 1)
354
+ col: g,
355
+ pattern: y(p.pattern, S - 1)
356
356
  });
357
357
  }
358
358
  });
@@ -365,14 +365,14 @@ const j = (e, t = 0) => {
365
365
  // do nothing,just notify panel is closed
366
366
  !0
367
367
  )
368
- }, De = Tt("INumfmtController");
369
- _t(B.Rendered, De);
370
- const de = {
368
+ }, Ue = Tt("INumfmtController");
369
+ _t(B.Rendered, Ue);
370
+ const he = {
371
371
  id: "sheet.operation.open.numfmt.panel",
372
372
  type: D.OPERATION,
373
- handler: (e) => (e.get(De).openPanel(), !0)
373
+ handler: (e) => (e.get(Ue).openPanel(), !0)
374
374
  };
375
- var et = { exports: {} }, _e = {};
375
+ var tt = { exports: {} }, Se = {};
376
376
  /**
377
377
  * @license React
378
378
  * react-jsx-runtime.production.min.js
@@ -382,20 +382,20 @@ var et = { exports: {} }, _e = {};
382
382
  * This source code is licensed under the MIT license found in the
383
383
  * LICENSE file in the root directory of this source tree.
384
384
  */
385
- var tn = Gt, nn = Symbol.for("react.element"), rn = Symbol.for("react.fragment"), sn = Object.prototype.hasOwnProperty, on = tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, cn = { key: !0, ref: !0, __self: !0, __source: !0 };
386
- function tt(e, t, r) {
385
+ var nn = zt, rn = Symbol.for("react.element"), sn = Symbol.for("react.fragment"), on = Object.prototype.hasOwnProperty, cn = nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, an = { key: !0, ref: !0, __self: !0, __source: !0 };
386
+ function nt(e, t, r) {
387
387
  var n, s = {}, i = null, o = null;
388
388
  r !== void 0 && (i = "" + r), t.key !== void 0 && (i = "" + t.key), t.ref !== void 0 && (o = t.ref);
389
- for (n in t) sn.call(t, n) && !cn.hasOwnProperty(n) && (s[n] = t[n]);
389
+ for (n in t) on.call(t, n) && !an.hasOwnProperty(n) && (s[n] = t[n]);
390
390
  if (e && e.defaultProps) for (n in t = e.defaultProps, t) s[n] === void 0 && (s[n] = t[n]);
391
- return { $$typeof: nn, type: e, key: i, ref: o, props: s, _owner: on.current };
391
+ return { $$typeof: rn, type: e, key: i, ref: o, props: s, _owner: cn.current };
392
392
  }
393
- _e.Fragment = rn;
394
- _e.jsx = tt;
395
- _e.jsxs = tt;
396
- et.exports = _e;
397
- var d = et.exports;
398
- const Ue = zt([]), Ne = [
393
+ Se.Fragment = sn;
394
+ Se.jsx = nt;
395
+ Se.jsxs = nt;
396
+ tt.exports = Se;
397
+ var d = tt.exports;
398
+ const Ae = Kt([]), Me = [
399
399
  "$",
400
400
  "£",
401
401
  "¥",
@@ -424,12 +424,12 @@ const Ue = zt([]), Ne = [
424
424
  "₾",
425
425
  "₿"
426
426
  ];
427
- var an = Object.defineProperty, ln = Object.getOwnPropertyDescriptor, un = (e, t, r, n) => {
428
- for (var s = n > 1 ? void 0 : n ? ln(t, r) : t, i = e.length - 1, o; i >= 0; i--)
427
+ var ln = Object.defineProperty, un = Object.getOwnPropertyDescriptor, mn = (e, t, r, n) => {
428
+ for (var s = n > 1 ? void 0 : n ? un(t, r) : t, i = e.length - 1, o; i >= 0; i--)
429
429
  (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
430
- return n && s && an(t, r, s), s;
431
- }, mn = (e, t) => (r, n) => t(r, n, e);
432
- let fe = class {
430
+ return n && s && ln(t, r, s), s;
431
+ }, dn = (e, t) => (r, n) => t(r, n, e);
432
+ let pe = class {
433
433
  constructor(e) {
434
434
  this._localStorageService = e;
435
435
  }
@@ -473,93 +473,93 @@ let fe = class {
473
473
  this._localStorageService.removeItem(e);
474
474
  }
475
475
  };
476
- fe = un([
477
- mn(0, b(gt))
478
- ], fe);
479
- const He = "numfmtCurrency", dn = (e) => {
480
- const t = N(fe), [r, n] = I(Ne);
481
- return xe(() => {
476
+ pe = mn([
477
+ dn(0, b(gt))
478
+ ], pe);
479
+ const Fe = "numfmtCurrency", fn = (e) => {
480
+ const t = N(pe), [r, n] = I(Me);
481
+ return Oe(() => {
482
482
  t.addHabit("numfmtCurrency", []).then(() => {
483
- t.getHabit(He, [...Ne]).then((i) => {
483
+ t.getHabit(Fe, [...Me]).then((i) => {
484
484
  n(i), e && e(i);
485
485
  });
486
486
  });
487
487
  }, []), { userHabitCurrency: r, mark: (i) => {
488
- t.markHabit(He, i);
488
+ t.markHabit(Fe, i);
489
489
  } };
490
- }, fn = () => {
491
- const e = Ye([]), [t, r] = I({});
492
- return xe(() => {
490
+ }, hn = () => {
491
+ const e = qe([]), [t, r] = I({});
492
+ return Oe(() => {
493
493
  e.current.forEach((s) => {
494
494
  s();
495
495
  }), e.current = [];
496
496
  }, [t]), (s) => {
497
497
  e.current.push(s), r({});
498
498
  };
499
- }, se = (e) => Ne.find((r) => e.includes(r)), hn = (e) => !!se(e) && e.startsWith("_("), pn = (e) => {
500
- const [t, r] = I(() => j(e.defaultPattern || "", 2)), n = qe(Ue), [s, i] = I(() => se(e.defaultPattern) || n[0]), o = P(() => n.map((l) => ({ label: l, value: l })), []), a = N(E).t;
501
- e.action.current = () => C(`_("${s}"* #,##0${t > 0 ? ".0" : ""}_)`, t);
499
+ }, ie = (e) => Me.find((r) => e.includes(r)), pn = (e) => !!ie(e) && e.startsWith("_("), vn = (e) => {
500
+ const [t, r] = I(() => j(e.defaultPattern || "", 2)), n = Je(Ae), [s, i] = I(() => ie(e.defaultPattern) || n[0]), o = P(() => n.map((l) => ({ label: l, value: l })), []), a = N(E).t;
501
+ e.action.current = () => y(`_("${s}"* #,##0${t > 0 ? ".0" : ""}_)`, t);
502
502
  const f = (l) => {
503
- i(l), e.onChange(C(`_("${l}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
503
+ i(l), e.onChange(y(`_("${l}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
504
504
  }, m = (l) => {
505
505
  const u = l || 0;
506
- r(u), e.onChange(C(`_("${s}"* #,##0${u > 0 ? ".0" : ""}_)`, u));
506
+ r(u), e.onChange(y(`_("${s}"* #,##0${u > 0 ? ".0" : ""}_)`, u));
507
507
  };
508
508
  return /* @__PURE__ */ d.jsxs("div", { children: [
509
509
  /* @__PURE__ */ d.jsxs("div", { className: "m-t-16 options ", children: [
510
510
  /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
511
511
  /* @__PURE__ */ d.jsx("div", { className: "label", children: a("sheet.numfmt.decimalLength") }),
512
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ d.jsx(Oe, { value: t, max: 20, min: 0, onChange: m }) })
512
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ d.jsx(je, { value: t, max: 20, min: 0, onChange: m }) })
513
513
  ] }),
514
514
  /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
515
515
  /* @__PURE__ */ d.jsx("div", { className: "label", children: a("sheet.numfmt.currencyType") }),
516
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ d.jsx(je, { onChange: f, options: o, value: s }) })
516
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ d.jsx($e, { onChange: f, options: o, value: s }) })
517
517
  ] })
518
518
  ] }),
519
519
  /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: a("sheet.numfmt.accountingDes") })
520
520
  ] });
521
- }, Ce = (e) => Ze.map((t) => ({
521
+ }, Te = (e) => Ze.map((t) => ({
522
522
  label: t.label(e),
523
523
  value: t.suffix(e),
524
524
  color: t.color
525
- })), nt = () => Xt.map((e) => ({ label: e.label, value: e.suffix })), rt = () => en.map((e) => ({ label: e.label, value: e.suffix, color: e.color })), vn = (e) => !!se(e) && !e.startsWith("_("), _n = (e) => {
526
- const r = N(E).t, n = qe(Ue), [s, i] = I(() => se(e.defaultPattern) || n[0]), [o, c] = I(() => j(e.defaultPattern || "", 2)), [a, f] = I(() => {
527
- var g;
528
- const h = Ce(s);
529
- return ((g = h.find((S) => ve(S.value, e.defaultPattern))) == null ? void 0 : g.value) || h[0].value;
530
- }), m = P(() => Ce(s), [s]), l = P(() => n.map((h) => ({ label: h, value: h })), [n]);
531
- e.action.current = () => C(a, o);
525
+ })), rt = () => en.map((e) => ({ label: e.label, value: e.suffix })), st = () => tn.map((e) => ({ label: e.label, value: e.suffix, color: e.color })), _n = (e) => !!ie(e) && !e.startsWith("_("), gn = (e) => {
526
+ const r = N(E).t, n = Je(Ae), [s, i] = I(() => ie(e.defaultPattern) || n[0]), [o, c] = I(() => j(e.defaultPattern || "", 2)), [a, f] = I(() => {
527
+ var p;
528
+ const h = Te(s);
529
+ return ((p = h.find((S) => ge(S.value, e.defaultPattern))) == null ? void 0 : p.value) || h[0].value;
530
+ }), m = P(() => Te(s), [s]), l = P(() => n.map((h) => ({ label: h, value: h })), [n]);
531
+ e.action.current = () => y(a, o);
532
532
  const u = (h) => {
533
533
  if (h === void 0)
534
534
  return;
535
535
  i(h);
536
- const v = Ce(h)[0].value;
537
- f(v), e.onChange(C(v, o));
538
- }, p = (h) => {
539
- h !== void 0 && (f(h), e.onChange(C(h, o)));
536
+ const g = Te(h)[0].value;
537
+ f(g), e.onChange(y(g, o));
538
+ }, v = (h) => {
539
+ h !== void 0 && (f(h), e.onChange(y(h, o)));
540
540
  }, _ = (h) => {
541
- c(h || 0), e.onChange(C(a, h || 0));
541
+ c(h || 0), e.onChange(y(a, h || 0));
542
542
  };
543
543
  return /* @__PURE__ */ d.jsxs("div", { children: [
544
544
  /* @__PURE__ */ d.jsxs("div", { className: "m-t-16 options ", children: [
545
545
  /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
546
546
  /* @__PURE__ */ d.jsx("div", { className: "label", children: r("sheet.numfmt.decimalLength") }),
547
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ d.jsx(Oe, { value: o, max: 20, min: 0, onChange: _ }) })
547
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ d.jsx(je, { value: o, max: 20, min: 0, onChange: _ }) })
548
548
  ] }),
549
549
  /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
550
550
  /* @__PURE__ */ d.jsx("div", { className: "label", children: r("sheet.numfmt.currencyType") }),
551
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ d.jsx(je, { onChange: u, options: l, value: s }) })
551
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ d.jsx($e, { onChange: u, options: l, value: s }) })
552
552
  ] })
553
553
  ] }),
554
554
  /* @__PURE__ */ d.jsx("div", { className: "m-t-16 label", children: r("sheet.numfmt.negType") }),
555
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx($e, { onChange: p, options: m, value: a }) }),
555
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx(we, { onChange: v, options: m, value: a }) }),
556
556
  /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.currencyDes") })
557
557
  ] });
558
- }, gn = (e) => {
559
- const t = x.getInfo(e);
560
- return nt().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
561
558
  }, Sn = (e) => {
562
- const t = P(nt, []), n = N(E).t, [s, i] = I(() => {
559
+ const t = x.getInfo(e);
560
+ return rt().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
561
+ }, bn = (e) => {
562
+ const t = P(rt, []), n = N(E).t, [s, i] = I(() => {
563
563
  if (e.defaultPattern) {
564
564
  const c = t.find((a) => a.value === e.defaultPattern);
565
565
  if (c)
@@ -573,25 +573,25 @@ const He = "numfmtCurrency", dn = (e) => {
573
573
  };
574
574
  return /* @__PURE__ */ d.jsxs("div", { children: [
575
575
  /* @__PURE__ */ d.jsx("div", { className: "m-t-16 label", children: n("sheet.numfmt.dateType") }),
576
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx($e, { value: s, options: t, onChange: o }) }),
576
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx(we, { value: s, options: t, onChange: o }) }),
577
577
  /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.dateDes") })
578
578
  ] });
579
- }, bn = (e) => !e, yn = (e) => {
579
+ }, Cn = (e) => !e, yn = (e) => {
580
580
  const r = N(E).t;
581
581
  return e.action.current = () => "", /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.generalDes") }) });
582
- }, Cn = (e) => rt().some((t) => ve(t.value, e)), Tn = (e) => {
583
- const t = N(E), r = P(rt, []), [n, s] = I(() => j(e.defaultPattern || "", 0)), [i, o] = I(() => {
584
- const l = r.find((u) => ve(u.value, e.defaultPattern || ""));
582
+ }, Tn = (e) => st().some((t) => ge(t.value, e)), In = (e) => {
583
+ const t = N(E), r = P(st, []), [n, s] = I(() => j(e.defaultPattern || "", 0)), [i, o] = I(() => {
584
+ const l = r.find((u) => ge(u.value, e.defaultPattern || ""));
585
585
  return (l == null ? void 0 : l.value) || r[0].value;
586
- }), c = P(() => C(i, Number(n || 0)), [i, n]), a = P(() => !Qt(i), [i]), f = (l) => {
587
- s(l || 0), e.onChange(C(i, Number(l || 0)));
586
+ }), c = P(() => y(i, Number(n || 0)), [i, n]), a = P(() => !Qt(i), [i]), f = (l) => {
587
+ s(l || 0), e.onChange(y(i, Number(l || 0)));
588
588
  }, m = (l) => {
589
589
  l !== void 0 && (s(j(l, 0)), o(l), e.onChange(l));
590
590
  };
591
591
  return e.action.current = () => c, /* @__PURE__ */ d.jsxs("div", { children: [
592
592
  /* @__PURE__ */ d.jsx("div", { className: "m-t-16 label", children: t.t("sheet.numfmt.decimalLength") }),
593
593
  /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx(
594
- Oe,
594
+ je,
595
595
  {
596
596
  disabled: a,
597
597
  value: n,
@@ -604,62 +604,62 @@ const He = "numfmtCurrency", dn = (e) => {
604
604
  " ",
605
605
  t.t("sheet.numfmt.negType")
606
606
  ] }),
607
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx($e, { onChange: m, options: r, value: i }) }),
607
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx(we, { onChange: m, options: r, value: i }) }),
608
608
  /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: t.t("sheet.numfmt.thousandthPercentileDes") })
609
609
  ] });
610
- }, In = (e) => {
611
- const { defaultValue: t, defaultPattern: r, row: n, col: s } = e.value, i = N(E), o = Ye(() => ""), c = i.t, a = fn(), f = P(
610
+ }, En = (e) => {
611
+ const { defaultValue: t, defaultPattern: r, row: n, col: s } = e.value, i = N(E), o = qe(() => ""), c = i.t, a = hn(), f = P(
612
612
  () => [
613
613
  { label: "sheet.numfmt.general", component: yn },
614
- { label: "sheet.numfmt.accounting", component: pn },
615
- { label: "sheet.numfmt.currency", component: _n },
616
- { label: "sheet.numfmt.date", component: Sn },
617
- { label: "sheet.numfmt.thousandthPercentile", component: Tn }
618
- ].map((y) => ({ ...y, label: c(y.label) })),
614
+ { label: "sheet.numfmt.accounting", component: vn },
615
+ { label: "sheet.numfmt.currency", component: gn },
616
+ { label: "sheet.numfmt.date", component: bn },
617
+ { label: "sheet.numfmt.thousandthPercentile", component: In }
618
+ ].map((C) => ({ ...C, label: c(C.label) })),
619
619
  []
620
- ), [m, l] = I(g), [u, p] = I(() => `${n}_${s}`), { mark: _, userHabitCurrency: h } = dn(() => p(`${n}_${s}_userCurrency'`)), v = P(() => {
621
- var y;
622
- return (y = f.find((L) => L.label === m)) == null ? void 0 : y.component;
620
+ ), [m, l] = I(p), [u, v] = I(() => `${n}_${s}`), { mark: _, userHabitCurrency: h } = fn(() => v(`${n}_${s}_userCurrency'`)), g = P(() => {
621
+ var C;
622
+ return (C = f.find((A) => A.label === m)) == null ? void 0 : C.component;
623
623
  }, [m]);
624
- function g() {
625
- return [bn, hn, vn, gn, Cn].reduce((L, ut, mt) => L || (ut(r) ? f[mt].label : ""), "") || f[0].label;
624
+ function p() {
625
+ return [Cn, pn, _n, Sn, Tn].reduce((A, ut, mt) => A || (ut(r) ? f[mt].label : ""), "") || f[0].label;
626
626
  }
627
- const S = f.map((y) => ({
628
- label: y.label,
629
- value: y.label
630
- })), F = (y) => {
631
- l(y), a(() => e.onChange({ type: "change", value: o.current() || "" }));
632
- }, ge = (y) => {
633
- e.onChange({ type: "change", value: y });
634
- }, Se = () => {
635
- const y = o.current() || "", L = se(y);
636
- L && _(L), e.onChange({ type: "confirm", value: y });
627
+ const S = f.map((C) => ({
628
+ label: C.label,
629
+ value: C.label
630
+ })), F = (C) => {
631
+ l(C), a(() => e.onChange({ type: "change", value: o.current() || "" }));
632
+ }, oe = (C) => {
633
+ e.onChange({ type: "change", value: C });
637
634
  }, be = () => {
635
+ const C = o.current() || "", A = ie(C);
636
+ A && _(A), e.onChange({ type: "confirm", value: C });
637
+ }, W = () => {
638
638
  e.onChange({ type: "cancel", value: "" });
639
- }, lt = {
640
- onChange: ge,
639
+ }, Ce = {
640
+ onChange: oe,
641
641
  defaultValue: t,
642
642
  defaultPattern: r,
643
643
  action: o
644
644
  };
645
- return xe(() => {
646
- l(g()), p(`${n}_${s}`);
645
+ return Oe(() => {
646
+ l(p()), v(`${n}_${s}`);
647
647
  }, [n, s]), /* @__PURE__ */ d.jsxs("div", { className: "numfmt-panel p-b-20", children: [
648
648
  /* @__PURE__ */ d.jsxs("div", { children: [
649
649
  /* @__PURE__ */ d.jsx("div", { className: "label m-t-14", children: c("sheet.numfmt.numfmtType") }),
650
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx(je, { onChange: F, options: S, value: m }) }),
651
- /* @__PURE__ */ d.jsx("div", { children: v && /* @__PURE__ */ d.jsx(Ue.Provider, { value: h, children: /* @__PURE__ */ Kt(v, { ...lt, key: u }) }) })
650
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx($e, { onChange: F, options: S, value: m }) }),
651
+ /* @__PURE__ */ d.jsx("div", { children: g && /* @__PURE__ */ d.jsx(Ae.Provider, { value: h, children: /* @__PURE__ */ Yt(g, { ...Ce, key: u }) }) })
652
652
  ] }),
653
653
  /* @__PURE__ */ d.jsxs("div", { className: "btn-list m-t-14 m-b-20", children: [
654
- /* @__PURE__ */ d.jsx(Ve, { size: "small", onClick: be, className: "m-r-12", children: c("sheet.numfmt.cancel") }),
655
- /* @__PURE__ */ d.jsx(Ve, { type: "primary", size: "small", onClick: Se, children: c("sheet.numfmt.confirm") })
654
+ /* @__PURE__ */ d.jsx(Be, { size: "small", onClick: W, className: "m-r-12", children: c("sheet.numfmt.cancel") }),
655
+ /* @__PURE__ */ d.jsx(Be, { type: "primary", size: "small", onClick: be, children: c("sheet.numfmt.confirm") })
656
656
  ] })
657
657
  ] });
658
- }, st = {
658
+ }, it = {
659
659
  id: "sheet.command.numfmt.set.percent",
660
660
  type: D.COMMAND,
661
661
  handler: async (e) => {
662
- const t = e.get(O), n = e.get(U).getSelections();
662
+ const t = e.get(O), n = e.get(U).getCurrentSelections();
663
663
  if (!n || !n.length)
664
664
  return !1;
665
665
  const s = [], i = "0%";
@@ -670,12 +670,12 @@ const He = "numfmtCurrency", dn = (e) => {
670
670
  }), await t.executeCommand($.id, { values: s });
671
671
  }
672
672
  };
673
- var En = Object.defineProperty, Nn = Object.getOwnPropertyDescriptor, Mn = (e, t, r, n) => {
674
- for (var s = n > 1 ? void 0 : n ? Nn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
673
+ var Nn = Object.defineProperty, Mn = Object.getOwnPropertyDescriptor, Pn = (e, t, r, n) => {
674
+ for (var s = n > 1 ? void 0 : n ? Mn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
675
675
  (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
676
- return n && s && En(t, r, s), s;
676
+ return n && s && Nn(t, r, s), s;
677
677
  }, M = (e, t) => (r, n) => t(r, n, e);
678
- let ce = class extends z {
678
+ let le = class extends K {
679
679
  constructor(t, r, n, s, i, o, c, a, f, m) {
680
680
  super();
681
681
  /**
@@ -684,12 +684,13 @@ let ce = class extends z {
684
684
  * @type {(string | null)}
685
685
  * @memberof NumfmtController
686
686
  */
687
- ie(this, "_previewPattern", "");
688
- ie(this, "_sidebarDisposable", null);
687
+ ce(this, "_previewPattern", "");
688
+ ce(this, "_sidebarDisposable", null);
689
689
  this._sheetInterceptorService = t, this._themeService = r, this._univerInstanceService = n, this._commandService = s, this._selectionManagerService = i, this._renderManagerService = o, this._numfmtService = c, this._componentManager = a, this._sidebarService = f, this._localeService = m, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener();
690
690
  }
691
691
  openPanel() {
692
- const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, s = this._univerInstanceService, i = this._numfmtService, o = this._localeService, a = (r.getSelectionRanges() || [])[0];
692
+ var g;
693
+ const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, s = this._univerInstanceService, i = this._numfmtService, o = this._localeService, a = (((g = r.getCurrentSelections()) == null ? void 0 : g.map((p) => p.range)) || [])[0];
693
694
  if (!a)
694
695
  return !1;
695
696
  const f = s.getCurrentUnitForType(T.UNIVER_SHEET), m = f.getActiveSheet();
@@ -701,32 +702,33 @@ let ce = class extends z {
701
702
  a.startRow,
702
703
  a.startColumn
703
704
  );
704
- let p = "";
705
- u && (p = u.pattern);
705
+ let v = "";
706
+ u && (v = u.pattern);
706
707
  const _ = (l == null ? void 0 : l.t) === V.NUMBER ? l.v : 12345678, h = {
707
- onChange: (v) => {
708
- if (v.type === "change")
709
- this._previewPattern = v.value, this._forceUpdate();
710
- else if (v.type === "confirm") {
711
- const g = r.getSelectionRanges() || [], S = { values: [] }, F = me(v.value);
712
- g.forEach((ge) => {
713
- R.foreach(ge, (Se, be) => {
714
- S.values.push({
715
- row: Se,
716
- col: be,
717
- pattern: v.value,
718
- type: F
708
+ onChange: (p) => {
709
+ var S;
710
+ if (p.type === "change")
711
+ this._previewPattern = p.value, this._forceUpdate();
712
+ else if (p.type === "confirm") {
713
+ const F = ((S = r.getCurrentSelections()) == null ? void 0 : S.map((W) => W.range)) || [], oe = { values: [] }, be = fe(p.value);
714
+ F.forEach((W) => {
715
+ R.foreach(W, (Ce, C) => {
716
+ oe.values.push({
717
+ row: Ce,
718
+ col: C,
719
+ pattern: p.value,
720
+ type: be
719
721
  });
720
722
  });
721
- }), n.executeCommand($.id, S), t.close();
722
- } else v.type === "cancel" && t.close();
723
+ }), n.executeCommand($.id, oe), t.close();
724
+ } else p.type === "cancel" && t.close();
723
725
  },
724
- value: { defaultPattern: p, defaultValue: _, row: a.startRow, col: a.startColumn }
726
+ value: { defaultPattern: v, defaultValue: _, row: a.startRow, col: a.startColumn }
725
727
  };
726
728
  return this._sidebarDisposable = t.open({
727
729
  header: { title: o.t("sheet.numfmt.title") },
728
730
  children: {
729
- label: Ee,
731
+ label: Ne,
730
732
  ...h
731
733
  // need passthrough to react props.
732
734
  },
@@ -744,11 +746,11 @@ let ce = class extends z {
744
746
  }
745
747
  _initCommands() {
746
748
  [
747
- Je,
748
749
  Xe,
750
+ et,
749
751
  Qe,
750
- st,
751
- de,
752
+ it,
753
+ he,
752
754
  ye,
753
755
  $
754
756
  ].forEach((t) => {
@@ -756,64 +758,64 @@ let ce = class extends z {
756
758
  });
757
759
  }
758
760
  _initPanel() {
759
- this._componentManager.register(Ee, In);
761
+ this._componentManager.register(Ne, En);
760
762
  }
761
763
  _initRealTimeRenderingInterceptor() {
762
- const t = new k((n) => {
764
+ const t = new G((n) => {
763
765
  this._commandService.onCommandExecuted((s) => {
764
- s.id === de.id && n.next(!0), s.id === ye.id && n.next(!1);
766
+ s.id === he.id && n.next(!0), s.id === ye.id && n.next(!1);
765
767
  });
766
768
  }), r = Dt([
767
769
  t,
768
770
  this._selectionManagerService.selectionMoveEnd$.pipe(
769
- Ht((n) => n ? n.map((s) => s.range) : [])
771
+ Ft((n) => n ? n.map((s) => s.range) : [])
770
772
  )
771
773
  ]);
772
774
  this.disposeWithMe(
773
- Ie(
775
+ Ee(
774
776
  r.pipe(
775
- Ft(
776
- ([n, s]) => new k((i) => {
777
+ Wt(
778
+ ([n, s]) => new G((i) => {
777
779
  const o = new St();
778
780
  return n && s.length && i.next({ selectionRanges: s, disposableCollection: o }), () => {
779
781
  o.dispose();
780
782
  };
781
783
  })
782
784
  ),
783
- Wt(() => {
785
+ kt(() => {
784
786
  this._previewPattern = null;
785
787
  })
786
788
  ).subscribe(({ disposableCollection: n, selectionRanges: s }) => {
787
789
  var o, c;
788
790
  const i = this._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET);
789
791
  this.openPanel(), n.add(
790
- this._sheetInterceptorService.intercept(We.CELL_CONTENT, {
792
+ this._sheetInterceptorService.intercept(ke.CELL_CONTENT, {
791
793
  priority: 99,
792
794
  handler: (a, f, m) => {
793
- const { row: l, col: u } = f, p = m(a) || {};
795
+ const { row: l, col: u } = f, v = m(a) || {};
794
796
  if (s.find(
795
797
  (_) => _.startColumn <= u && _.endColumn >= u && _.startRow <= l && _.endRow >= l
796
798
  )) {
797
- const _ = f.worksheet.getCellRaw(l, u), h = _ == null ? void 0 : _.v, v = _ == null ? void 0 : _.t;
798
- if (h == null || v !== V.NUMBER || this._previewPattern === null)
799
- return p;
800
- const g = we(this._previewPattern, h, this._localeService.getCurrentLocale());
801
- if (g.color) {
802
- const F = this._themeService.getCurrentTheme()[`${g.color}500`];
799
+ const _ = f.worksheet.getCellRaw(l, u), h = _ == null ? void 0 : _.v, g = _ == null ? void 0 : _.t;
800
+ if (h == null || g !== V.NUMBER || this._previewPattern === null)
801
+ return v;
802
+ const p = De(this._previewPattern, h, this._localeService.getCurrentLocale());
803
+ if (p.color) {
804
+ const F = this._themeService.getCurrentTheme()[`${p.color}500`];
803
805
  return {
804
- ...p,
805
- v: g.result,
806
+ ...v,
807
+ v: p.result,
806
808
  t: V.STRING,
807
809
  s: { cl: { rgb: F } }
808
810
  };
809
811
  }
810
812
  return {
811
- ...p,
812
- v: g.result,
813
+ ...v,
814
+ v: p.result,
813
815
  t: V.STRING
814
816
  };
815
817
  }
816
- return p;
818
+ return v;
817
819
  }
818
820
  })
819
821
  ), (c = (o = this._renderManagerService.getRenderById(i.getUnitId())) == null ? void 0 : o.mainComponent) == null || c.makeDirty();
@@ -822,9 +824,9 @@ let ce = class extends z {
822
824
  );
823
825
  }
824
826
  _commandExecutedListener() {
825
- const t = [pe.id, Y.id];
827
+ const t = [_e.id, q.id];
826
828
  this.disposeWithMe(
827
- new k((r) => {
829
+ new G((r) => {
828
830
  const n = this._commandService.onCommandExecuted((s) => {
829
831
  if (t.includes(s.id)) {
830
832
  const i = s.params;
@@ -832,7 +834,7 @@ let ce = class extends z {
832
834
  }
833
835
  });
834
836
  return () => n.dispose();
835
- }).pipe(kt(16)).subscribe((r) => this._forceUpdate(r))
837
+ }).pipe(Gt(16)).subscribe((r) => this._forceUpdate(r))
836
838
  );
837
839
  }
838
840
  _initCloseListener() {
@@ -842,25 +844,25 @@ let ce = class extends z {
842
844
  });
843
845
  }
844
846
  };
845
- ce = Mn([
846
- K(B.Rendered, ce),
847
- M(0, b(Pe)),
848
- M(1, b(Fe)),
847
+ le = Pn([
848
+ Y(B.Rendered, le),
849
+ M(0, b(Re)),
850
+ M(1, b(We)),
849
851
  M(2, w),
850
852
  M(3, O),
851
853
  M(4, b(U)),
852
854
  M(5, Lt),
853
855
  M(6, H),
854
- M(7, b(Ke)),
855
- M(8, Vt),
856
+ M(7, b(Ye)),
857
+ M(8, Bt),
856
858
  M(9, b(E))
857
- ], ce);
858
- var Pn = Object.defineProperty, Rn = Object.getOwnPropertyDescriptor, xn = (e, t, r, n) => {
859
- for (var s = n > 1 ? void 0 : n ? Rn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
859
+ ], le);
860
+ var Rn = Object.defineProperty, xn = Object.getOwnPropertyDescriptor, On = (e, t, r, n) => {
861
+ for (var s = n > 1 ? void 0 : n ? xn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
860
862
  (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
861
- return n && s && Pn(t, r, s), s;
862
- }, W = (e, t) => (r, n) => t(r, n, e);
863
- const On = () => {
863
+ return n && s && Rn(t, r, s), s;
864
+ }, k = (e, t) => (r, n) => t(r, n, e);
865
+ const jn = () => {
864
866
  let e = [];
865
867
  return {
866
868
  add: (s, i, o, c, a) => e.push({ unitId: s, subUnitId: i, row: o, col: c, value: a }),
@@ -870,16 +872,16 @@ const On = () => {
870
872
  }
871
873
  };
872
874
  };
873
- let ae = class extends z {
875
+ let ue = class extends K {
874
876
  constructor(t, r, n, s, i) {
875
877
  super();
876
878
  // collect effect mutations when edit end and push this to commands stack in next commands progress
877
- ie(this, "_collectEffectMutation", On());
879
+ ce(this, "_collectEffectMutation", jn());
878
880
  this._sheetInterceptorService = t, this._numfmtService = r, this._univerInstanceService = n, this._injector = s, this._editorBridgeService = i, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
879
881
  }
880
882
  _initInterceptorEditorStart() {
881
883
  this._editorBridgeService && this.disposeWithMe(
882
- Ie(
884
+ Ee(
883
885
  this._editorBridgeService.interceptor.intercept(
884
886
  this._editorBridgeService.interceptor.getInterceptPoints().BEFORE_CELL_EDIT,
885
887
  {
@@ -891,7 +893,7 @@ let ae = class extends z {
891
893
  i
892
894
  );
893
895
  if (o)
894
- switch (me(o.pattern)) {
896
+ switch (fe(o.pattern)) {
895
897
  case "scientific":
896
898
  case "percent":
897
899
  case "currency":
@@ -918,7 +920,7 @@ let ae = class extends z {
918
920
  */
919
921
  _initInterceptorEditorEnd() {
920
922
  this._editorBridgeService && this.disposeWithMe(
921
- Ie(
923
+ Ee(
922
924
  this._editorBridgeService.interceptor.intercept(
923
925
  this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,
924
926
  {
@@ -930,7 +932,7 @@ let ae = class extends z {
930
932
  r.subUnitId,
931
933
  r.row,
932
934
  r.col
933
- ), i = (m = s && me(s.pattern)) != null ? m : "", o = () => {
935
+ ), i = (m = s && fe(s.pattern)) != null ? m : "", o = () => {
934
936
  s && this._collectEffectMutation.add(
935
937
  r.unitId,
936
938
  r.subUnitId,
@@ -955,7 +957,7 @@ let ae = class extends z {
955
957
  }
956
958
  ), { ...t, v: l, t: V.NUMBER };
957
959
  }
958
- } else (["date", "time", "datetime"].includes(i) || !jn(c)) && o();
960
+ } else (["date", "time", "datetime"].includes(i) || !$n(c)) && o();
959
961
  return n(t);
960
962
  }
961
963
  }
@@ -984,15 +986,15 @@ let ae = class extends z {
984
986
  undos: []
985
987
  };
986
988
  const a = c.filter((u) => {
987
- var p;
988
- return !!((p = u.value) != null && p.pattern);
989
+ var v;
990
+ return !!((v = u.value) != null && v.pattern);
989
991
  }).map((u) => ({
990
992
  row: u.row,
991
993
  col: u.col,
992
994
  pattern: u.value.pattern
993
995
  })), f = c.filter((u) => {
994
- var p;
995
- return !((p = u.value) != null && p.pattern);
996
+ var v;
997
+ return !((v = u.value) != null && v.pattern);
996
998
  }).map((u) => ({
997
999
  startRow: u.row,
998
1000
  endColumn: u.col,
@@ -1001,21 +1003,21 @@ let ae = class extends z {
1001
1003
  })), m = [], l = [];
1002
1004
  if (a) {
1003
1005
  const u = {
1004
- id: Y.id,
1005
- params: ke(i, o, a)
1006
+ id: q.id,
1007
+ params: Ge(i, o, a)
1006
1008
  };
1007
- m.push(u), l.push(...Ge(t._injector, u.params));
1009
+ m.push(u), l.push(...ze(t._injector, u.params));
1008
1010
  }
1009
1011
  if (f) {
1010
1012
  const u = {
1011
- id: pe.id,
1013
+ id: _e.id,
1012
1014
  params: {
1013
1015
  unitId: i,
1014
1016
  subUnitId: o,
1015
1017
  ranges: f
1016
1018
  }
1017
1019
  };
1018
- m.push(u), l.push(...ze(t._injector, u.params));
1020
+ m.push(u), l.push(...Ke(t._injector, u.params));
1019
1021
  }
1020
1022
  return {
1021
1023
  redos: m,
@@ -1032,39 +1034,39 @@ let ae = class extends z {
1032
1034
  );
1033
1035
  }
1034
1036
  };
1035
- ae = xn([
1036
- K(B.Rendered, ae),
1037
- W(0, b(Pe)),
1038
- W(1, b(H)),
1039
- W(2, b(w)),
1040
- W(3, b(Me)),
1041
- W(4, It(Rt))
1042
- ], ae);
1043
- function jn(e) {
1037
+ ue = On([
1038
+ Y(B.Rendered, ue),
1039
+ k(0, b(Re)),
1040
+ k(1, b(H)),
1041
+ k(2, b(w)),
1042
+ k(3, b(Pe)),
1043
+ k(4, It(Rt))
1044
+ ], ue);
1045
+ function $n(e) {
1044
1046
  return /^-?\d+(\.\d+)?$/.test(e);
1045
1047
  }
1046
- var $n = Object.defineProperty, wn = Object.getOwnPropertyDescriptor, Dn = (e, t, r, n) => {
1047
- for (var s = n > 1 ? void 0 : n ? wn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
1048
+ var wn = Object.defineProperty, Dn = Object.getOwnPropertyDescriptor, Un = (e, t, r, n) => {
1049
+ for (var s = n > 1 ? void 0 : n ? Dn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
1048
1050
  (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
1049
- return n && s && $n(t, r, s), s;
1050
- }, Un = (e, t) => (r, n) => t(r, n, e);
1051
- let le = class extends z {
1051
+ return n && s && wn(t, r, s), s;
1052
+ }, An = (e, t) => (r, n) => t(r, n, e);
1053
+ let me = class extends K {
1052
1054
  constructor(e) {
1053
1055
  super(), this._localeService = e;
1054
1056
  }
1055
1057
  };
1056
- le = Dn([
1057
- K(B.Rendered, le),
1058
- Un(0, b(E))
1059
- ], le);
1060
- const ue = [
1058
+ me = Un([
1059
+ Y(B.Rendered, me),
1060
+ An(0, b(E))
1061
+ ], me);
1062
+ const de = [
1061
1063
  {
1062
1064
  label: "sheet.numfmt.general",
1063
1065
  pattern: null
1064
1066
  },
1065
1067
  {
1066
1068
  label: "sheet.numfmt.text",
1067
- pattern: "@@@"
1069
+ pattern: At
1068
1070
  },
1069
1071
  "|",
1070
1072
  {
@@ -1110,30 +1112,30 @@ const ue = [
1110
1112
  label: "sheet.numfmt.moreFmt",
1111
1113
  pattern: ""
1112
1114
  }
1113
- ], it = "sheet.numfmt.moreNumfmtType", ot = "sheet.numfmt.moreNumfmtType.options", Ln = (e) => {
1115
+ ], ot = "sheet.numfmt.moreNumfmtType", ct = "sheet.numfmt.moreNumfmtType.options", Ln = (e) => {
1114
1116
  var n;
1115
1117
  const t = N(E), r = (n = e.value) != null ? n : t.t("sheet.numfmt.general");
1116
1118
  return /* @__PURE__ */ d.jsx("span", { className: "more-numfmt-type", children: r });
1117
- }, An = () => {
1118
- const e = N(O), t = N(E), r = Yt(), n = N(U), s = (c) => {
1119
- const a = n.getLast();
1119
+ }, Vn = () => {
1120
+ const e = N(O), t = N(E), r = qt(), n = N(U), s = (c) => {
1121
+ const a = n.getCurrentLastSelection();
1120
1122
  if (!a)
1121
1123
  return;
1122
- const f = r.get(At), m = a.range, l = [];
1123
- R.foreach(m, (u, p) => {
1124
- c ? l.push({ row: u, col: p, pattern: c, type: me(c) }) : l.push({ row: u, col: p });
1124
+ const f = r.get(Vt), m = a.range, l = [];
1125
+ R.foreach(m, (u, v) => {
1126
+ c ? l.push({ row: u, col: v, pattern: c, type: fe(c) }) : l.push({ row: u, col: v });
1125
1127
  }), e.executeCommand($.id, { values: l }), f.focus();
1126
1128
  }, i = (c) => {
1127
1129
  if (c === 0)
1128
1130
  s(null);
1129
- else if (c === ue.length - 1)
1130
- e.executeCommand(de.id);
1131
+ else if (c === de.length - 1)
1132
+ e.executeCommand(he.id);
1131
1133
  else {
1132
- const a = ue[c];
1134
+ const a = de[c];
1133
1135
  a.pattern && s(a.pattern);
1134
1136
  }
1135
1137
  }, o = 1220;
1136
- return /* @__PURE__ */ d.jsx("div", { className: "more-numfmt-type-options", children: ue.map((c, a) => c === "|" ? /* @__PURE__ */ d.jsx("div", { className: "line m-t-4", onClick: (f) => f.stopPropagation() }, a) : /* @__PURE__ */ d.jsxs(
1138
+ return /* @__PURE__ */ d.jsx("div", { className: "more-numfmt-type-options", children: de.map((c, a) => c === "|" ? /* @__PURE__ */ d.jsx("div", { className: "line m-t-4", onClick: (f) => f.stopPropagation() }, a) : /* @__PURE__ */ d.jsxs(
1137
1139
  "div",
1138
1140
  {
1139
1141
  className: "option-item m-t-4",
@@ -1142,153 +1144,153 @@ const ue = [
1142
1144
  },
1143
1145
  children: [
1144
1146
  /* @__PURE__ */ d.jsx("div", { children: t.t(c.label) }),
1145
- /* @__PURE__ */ d.jsx("div", { className: "m-l-26", children: c.pattern ? we(c.pattern || "", o, t.getCurrentLocale()).result : "" })
1147
+ /* @__PURE__ */ d.jsx("div", { className: "m-l-26", children: c.pattern ? De(c.pattern || "", o, t.getCurrentLocale()).result : "" })
1146
1148
  ]
1147
1149
  },
1148
1150
  a
1149
1151
  )) });
1150
- }, Vn = (e) => ({
1152
+ }, Bn = (e) => ({
1151
1153
  icon: "RmbSingle",
1152
1154
  id: Qe.id,
1153
1155
  title: "sheet.numfmt.currency",
1154
1156
  tooltip: "sheet.numfmt.currency",
1155
- type: ee.BUTTON,
1156
- group: te.TOOLBAR_FORMULAS_INSERT,
1157
- positions: [ne.TOOLBAR_START],
1158
- hidden$: re(e, T.UNIVER_SHEET),
1159
- disabled$: X(e, { workbookTypes: [q], worksheetTypes: [J, Z], rangeTypes: [Q] })
1160
- }), Bn = (e) => ({
1157
+ type: te.BUTTON,
1158
+ group: ne.TOOLBAR_FORMULAS_INSERT,
1159
+ positions: [re.TOOLBAR_START],
1160
+ hidden$: se(e, T.UNIVER_SHEET),
1161
+ disabled$: ee(e, { workbookTypes: [J], worksheetTypes: [X, Z], rangeTypes: [Q] })
1162
+ }), Hn = (e) => ({
1161
1163
  icon: "AddDigitsSingle",
1162
- id: Je.id,
1164
+ id: Xe.id,
1163
1165
  title: "sheet.numfmt.addDecimal",
1164
1166
  tooltip: "sheet.numfmt.addDecimal",
1165
- type: ee.BUTTON,
1166
- positions: [ne.TOOLBAR_START],
1167
- group: te.TOOLBAR_FORMULAS_INSERT,
1168
- hidden$: re(e, T.UNIVER_SHEET),
1169
- disabled$: X(e, { workbookTypes: [q], worksheetTypes: [J, Z], rangeTypes: [Q] })
1170
- }), Hn = (e) => ({
1167
+ type: te.BUTTON,
1168
+ positions: [re.TOOLBAR_START],
1169
+ group: ne.TOOLBAR_FORMULAS_INSERT,
1170
+ hidden$: se(e, T.UNIVER_SHEET),
1171
+ disabled$: ee(e, { workbookTypes: [J], worksheetTypes: [X, Z], rangeTypes: [Q] })
1172
+ }), Fn = (e) => ({
1171
1173
  icon: "ReduceDigitsSingle",
1172
- id: Xe.id,
1174
+ id: et.id,
1173
1175
  title: "sheet.numfmt.subtractDecimal",
1174
1176
  tooltip: "sheet.numfmt.subtractDecimal",
1175
- type: ee.BUTTON,
1176
- group: te.TOOLBAR_FORMULAS_INSERT,
1177
- positions: [ne.TOOLBAR_START],
1178
- hidden$: re(e, T.UNIVER_SHEET),
1179
- disabled$: X(e, { workbookTypes: [q], worksheetTypes: [J, Z], rangeTypes: [Q] })
1180
- }), Fn = (e) => ({
1177
+ type: te.BUTTON,
1178
+ group: ne.TOOLBAR_FORMULAS_INSERT,
1179
+ positions: [re.TOOLBAR_START],
1180
+ hidden$: se(e, T.UNIVER_SHEET),
1181
+ disabled$: ee(e, { workbookTypes: [J], worksheetTypes: [X, Z], rangeTypes: [Q] })
1182
+ }), Wn = (e) => ({
1181
1183
  icon: "PercentSingle",
1182
- id: st.id,
1184
+ id: it.id,
1183
1185
  title: "sheet.numfmt.percent",
1184
1186
  tooltip: "sheet.numfmt.percent",
1185
- type: ee.BUTTON,
1186
- group: te.TOOLBAR_FORMULAS_INSERT,
1187
- positions: [ne.TOOLBAR_START],
1188
- hidden$: re(e, T.UNIVER_SHEET),
1189
- disabled$: X(e, { workbookTypes: [q], worksheetTypes: [J, Z], rangeTypes: [Q] })
1190
- }), Wn = (e) => {
1191
- const t = e.get(H), r = e.get(w), n = e.get(O), s = e.get(E), i = e.get(U), o = xt(r, "", ({ workbook: c, worksheet: a }) => new k(
1187
+ type: te.BUTTON,
1188
+ group: ne.TOOLBAR_FORMULAS_INSERT,
1189
+ positions: [re.TOOLBAR_START],
1190
+ hidden$: se(e, T.UNIVER_SHEET),
1191
+ disabled$: ee(e, { workbookTypes: [J], worksheetTypes: [X, Z], rangeTypes: [Q] })
1192
+ }), kn = (e) => {
1193
+ const t = e.get(H), r = e.get(w), n = e.get(O), s = e.get(E), i = e.get(U), o = xt(r, "", ({ workbook: c, worksheet: a }) => new G(
1192
1194
  (f) => Ut(
1193
1195
  i.selectionMoveEnd$,
1194
- new k((m) => {
1195
- const l = [pe.id, Y.id], u = n.onCommandExecuted((p) => {
1196
- l.includes(p.id) && m.next(null);
1196
+ new G((m) => {
1197
+ const l = [_e.id, q.id], u = n.onCommandExecuted((v) => {
1198
+ l.includes(v.id) && m.next(null);
1197
1199
  });
1198
1200
  return () => u.dispose();
1199
1201
  })
1200
1202
  ).subscribe(() => {
1201
- const m = i.getSelections();
1203
+ const m = i.getCurrentSelections();
1202
1204
  if (m && m[0]) {
1203
- const l = m[0].range, u = l.startRow, p = l.startColumn, _ = t.getValue(c.getUnitId(), a.getSheetId(), u, p), h = _ == null ? void 0 : _.pattern;
1204
- let v = s.t("sheet.numfmt.general");
1205
+ const l = m[0].range, u = l.startRow, v = l.startColumn, _ = t.getValue(c.getUnitId(), a.getSheetId(), u, v), h = _ == null ? void 0 : _.pattern;
1206
+ let g = s.t("sheet.numfmt.general");
1205
1207
  if (h) {
1206
- const g = ue.filter((S) => typeof S == "object" && S.pattern).find(
1207
- (S) => ve(h, S.pattern)
1208
+ const p = de.filter((S) => typeof S == "object" && S.pattern).find(
1209
+ (S) => ge(h, S.pattern)
1208
1210
  );
1209
- g && typeof g == "object" && g.pattern ? v = s.t(g.label) : v = s.t("sheet.numfmt.moreFmt");
1211
+ p && typeof p == "object" && p.pattern ? g = s.t(p.label) : g = s.t("sheet.numfmt.moreFmt");
1210
1212
  }
1211
- f.next(v);
1213
+ f.next(g);
1212
1214
  }
1213
1215
  })
1214
1216
  ));
1215
1217
  return {
1216
- label: it,
1217
- id: de.id,
1218
+ label: ot,
1219
+ id: he.id,
1218
1220
  tooltip: "sheet.numfmt.title",
1219
- type: ee.SELECTOR,
1220
- group: te.TOOLBAR_FORMULAS_INSERT,
1221
- positions: [ne.TOOLBAR_START],
1221
+ type: te.SELECTOR,
1222
+ group: ne.TOOLBAR_FORMULAS_INSERT,
1223
+ positions: [re.TOOLBAR_START],
1222
1224
  selections: [
1223
1225
  {
1224
1226
  label: {
1225
- name: ot,
1227
+ name: ct,
1226
1228
  hoverable: !1
1227
1229
  }
1228
1230
  }
1229
1231
  ],
1230
1232
  value$: o,
1231
- hidden$: re(e, T.UNIVER_SHEET),
1232
- disabled$: X(e, { workbookTypes: [q], worksheetTypes: [Z, J], rangeTypes: [Q] })
1233
+ hidden$: se(e, T.UNIVER_SHEET),
1234
+ disabled$: ee(e, { workbookTypes: [J], worksheetTypes: [Z, X], rangeTypes: [Q] })
1233
1235
  };
1234
1236
  };
1235
- var kn = Object.defineProperty, Gn = Object.getOwnPropertyDescriptor, zn = (e, t, r, n) => {
1236
- for (var s = n > 1 ? void 0 : n ? Gn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
1237
+ var Gn = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, Kn = (e, t, r, n) => {
1238
+ for (var s = n > 1 ? void 0 : n ? zn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
1237
1239
  (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
1238
- return n && s && kn(t, r, s), s;
1239
- }, Te = (e, t) => (r, n) => t(r, n, e);
1240
- const Kn = {};
1241
- let G = class extends z {
1240
+ return n && s && Gn(t, r, s), s;
1241
+ }, Ie = (e, t) => (r, n) => t(r, n, e);
1242
+ const Yn = {};
1243
+ let z = class extends K {
1242
1244
  constructor(e, t, r, n) {
1243
1245
  super(), this._config = e, this._injector = t, this._componentManager = r, this._menuService = n, this._initMenu();
1244
1246
  }
1245
1247
  _initMenu() {
1246
1248
  const { menu: e = {} } = this._config;
1247
- [Fn, Bn, Hn, Vn, Wn].forEach((t) => {
1249
+ [Wn, Hn, Fn, Bn, kn].forEach((t) => {
1248
1250
  this.disposeWithMe(this._menuService.addMenuItem(t(this._injector), e));
1249
- }), this.disposeWithMe(this._componentManager.register(it, Ln)), this.disposeWithMe(this._componentManager.register(ot, An));
1251
+ }), this.disposeWithMe(this._componentManager.register(ot, Ln)), this.disposeWithMe(this._componentManager.register(ct, Vn));
1250
1252
  }
1251
1253
  };
1252
- G = zn([
1253
- K(B.Rendered, G),
1254
- Te(1, b(Me)),
1255
- Te(2, b(Ke)),
1256
- Te(3, b(Bt))
1257
- ], G);
1258
- var ct = Object.defineProperty, Yn = Object.getOwnPropertyDescriptor, qn = (e, t, r) => t in e ? ct(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Jn = (e, t, r, n) => {
1259
- for (var s = n > 1 ? void 0 : n ? Yn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
1254
+ z = Kn([
1255
+ Y(B.Rendered, z),
1256
+ Ie(1, b(Pe)),
1257
+ Ie(2, b(Ye)),
1258
+ Ie(3, b(Ht))
1259
+ ], z);
1260
+ var at = Object.defineProperty, qn = Object.getOwnPropertyDescriptor, Jn = (e, t, r) => t in e ? at(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Xn = (e, t, r, n) => {
1261
+ for (var s = n > 1 ? void 0 : n ? qn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
1260
1262
  (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
1261
- return n && s && ct(t, r, s), s;
1262
- }, Zn = (e, t) => (r, n) => t(r, n, e), at = (e, t, r) => qn(e, typeof t != "symbol" ? t + "" : t, r);
1263
- let he = class extends bt {
1263
+ return n && s && at(t, r, s), s;
1264
+ }, Zn = (e, t) => (r, n) => t(r, n, e), lt = (e, t, r) => Jn(e, typeof t != "symbol" ? t + "" : t, r);
1265
+ let ve = class extends bt {
1264
1266
  constructor(e = {}, t) {
1265
- super(), this._config = e, this._injector = t, this._config = yt.deepMerge({}, Kn, this._config);
1267
+ super(), this._config = e, this._injector = t, this._config = Ct.deepMerge({}, Yn, this._config);
1266
1268
  }
1267
1269
  onStarting() {
1268
- this._injector.add([De, { useClass: ce, lazy: !1 }]), this._injector.add([ae]), this._injector.add([fe]), this._injector.add([oe]), this._injector.add([le]), this._injector.add(
1270
+ this._injector.add([Ue, { useClass: le, lazy: !1 }]), this._injector.add([ue]), this._injector.add([pe]), this._injector.add([ae]), this._injector.add([me]), this._injector.add(
1269
1271
  [
1270
- G,
1272
+ z,
1271
1273
  {
1272
- useFactory: () => this._injector.createInstance(G, this._config)
1274
+ useFactory: () => this._injector.createInstance(z, this._config)
1273
1275
  }
1274
1276
  ]
1275
1277
  );
1276
1278
  }
1277
1279
  };
1278
- at(he, "pluginName", Ee);
1279
- at(he, "type", T.UNIVER_SHEET);
1280
- he = Jn([
1281
- Ct(Mt, Ot),
1282
- Zn(1, b(Me))
1283
- ], he);
1280
+ lt(ve, "pluginName", Ne);
1281
+ lt(ve, "type", T.UNIVER_SHEET);
1282
+ ve = Xn([
1283
+ yt(Mt, Ot),
1284
+ Zn(1, b(Pe))
1285
+ ], ve);
1284
1286
  export {
1285
- Je as AddDecimalCommand,
1287
+ Xe as AddDecimalCommand,
1286
1288
  ye as CloseNumfmtPanelOperator,
1287
- de as OpenNumfmtPanelOperator,
1289
+ he as OpenNumfmtPanelOperator,
1288
1290
  Qe as SetCurrencyCommand,
1289
1291
  $ as SetNumfmtCommand,
1290
- st as SetPercentCommand,
1291
- Xe as SubtractDecimalCommand,
1292
- he as UniverSheetsNumfmtPlugin,
1293
- we as getPatternPreview
1292
+ it as SetPercentCommand,
1293
+ et as SubtractDecimalCommand,
1294
+ ve as UniverSheetsNumfmtPlugin,
1295
+ De as getPatternPreview
1294
1296
  };