@univerjs/sheets-numfmt 0.1.11 → 0.1.13

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,233 +1,129 @@
1
- var gt = Object.defineProperty;
2
- var _t = (e, t, r) => t in e ? gt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var U = (e, t, r) => (_t(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import { CommandType as V, ICommandService as $, IUniverInstanceService as W, IUndoRedoService as St, sequenceExecute as Ct, LocaleType as yt, Disposable as X, ObjectMatrix as bt, CellValueType as z, Range as E, toDisposable as Q, OnLifecycle as ee, LifecycleStages as K, ThemeService as ze, LocaleService as T, runOnLifecycle as It, ILocalStorageService as Mt, UniverInstanceType as R, DisposableCollection as Tt, Plugin as xt } from "@univerjs/core";
5
- import { getSheetCommandTarget as Re, transformCellsToRange as We, rangeMerge as Ve, SetNumfmtMutation as te, factorySetNumfmtUndoMutation as Ke, RemoveNumfmtMutation as _e, factoryRemoveNumfmtUndoMutation as Ge, INTERCEPTOR_POINT as Ze, SheetInterceptorService as Oe, INumfmtService as G, SelectionManagerService as H, SetRangeValuesCommand as Nt, getCurrentSheetDisabled$ as ne } from "@univerjs/sheets";
6
- import { Inject as S, createIdentifier as Rt, Injector as De } from "@wendellhu/redi";
7
- import { SheetSkeletonManagerService as qe, IEditorBridgeService as Ot, deriveStateFromActiveSheet$ as Dt } from "@univerjs/sheets-ui";
8
- import { map as Ye, distinctUntilChanged as Pt, switchMap as Et, tap as jt, debounceTime as $t } from "rxjs/operators";
9
- import j from "@univerjs/engine-numfmt";
10
- import { IRenderManagerService as wt, ITextSelectionRenderManager as Lt } from "@univerjs/engine-render";
11
- import { ComponentManager as Je, ISidebarService as Ut, MenuItemType as re, MenuGroup as se, MenuPosition as ie, getMenuHiddenObservable as ae, IMenuService as At } from "@univerjs/ui";
12
- import { Observable as J, combineLatest as Vt, merge as Qe } from "rxjs";
13
- import Ht, { createContext as Bt, useState as M, useEffect as Pe, useRef as Ee, useContext as Xe, useMemo as P, createElement as B, forwardRef as Z } from "react";
14
- import { InputNumber as je, Select as $e, SelectList as we, Button as He } from "@univerjs/design";
1
+ var ht = Object.defineProperty;
2
+ var ft = (e, t, r) => t in e ? ht(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var L = (e, t, r) => (ft(e, typeof t != "symbol" ? t + "" : t, r), r);
4
+ import { CommandType as w, ICommandService as O, IUniverInstanceService as k, IUndoRedoService as pt, sequenceExecute as vt, LocaleType as gt, Disposable as Y, ObjectMatrix as _t, CellValueType as B, Range as P, toDisposable as K, OnLifecycle as q, LifecycleStages as V, ThemeService as Fe, LocaleService as T, runOnLifecycle as St, ILocalStorageService as bt, UniverInstanceType as E, DisposableCollection as yt, Plugin as Ct, Tools as It } from "@univerjs/core";
5
+ import { getSheetCommandTarget as Re, transformCellsToRange as We, rangeMerge as Ae, SetNumfmtMutation as J, factorySetNumfmtUndoMutation as Ge, RemoveNumfmtMutation as ge, factoryRemoveNumfmtUndoMutation as ze, INTERCEPTOR_POINT as Ke, SheetInterceptorService as Pe, INumfmtService as H, SelectionManagerService as D, SetRangeValuesCommand as Tt, WorkbookEditablePermission as Z, WorksheetEditPermission as Q, WorksheetSetCellStylePermission as X, RangeProtectionPermissionEditPoint as ee } from "@univerjs/sheets";
6
+ import { Inject as S, createIdentifier as Mt, Injector as xe } from "@wendellhu/redi";
7
+ import { SheetSkeletonManagerService as Ye, IEditorBridgeService as Nt, getCurrentRangeDisable$ as te, deriveStateFromActiveSheet$ as Et } from "@univerjs/sheets-ui";
8
+ import { map as qe, distinctUntilChanged as Rt, switchMap as Pt, tap as xt, debounceTime as Ot } from "rxjs/operators";
9
+ import x from "@univerjs/engine-numfmt";
10
+ import { IRenderManagerService as jt, ITextSelectionRenderManager as $t } from "@univerjs/engine-render";
11
+ import { ComponentManager as Je, ISidebarService as wt, MenuItemType as ne, MenuGroup as re, MenuPosition as se, getMenuHiddenObservable as ie, IMenuService as Dt } from "@univerjs/ui";
12
+ import { Observable as G, combineLatest as Ut, merge as Ze } from "rxjs";
13
+ import Lt, { createContext as At, useState as I, useEffect as Oe, useRef as Qe, useContext as Xe, useMemo as R, createElement as Bt } from "react";
14
+ import { InputNumber as je, Select as $e, SelectList as we, Button as Be } from "@univerjs/design";
15
15
  import { useDependency as N, useInjector as kt } from "@wendellhu/redi/react-bindings";
16
- const A = {
16
+ const $ = {
17
17
  id: "sheet.command.numfmt.set.numfmt",
18
- type: V.COMMAND,
18
+ type: w.COMMAND,
19
19
  handler: (e, t) => {
20
20
  if (!t)
21
21
  return !1;
22
- const r = e.get($), n = e.get(W), s = e.get(St), i = Re(n, t);
22
+ const r = e.get(O), n = e.get(k), s = e.get(pt), i = Re(n, t);
23
23
  if (!i)
24
24
  return !1;
25
- const { unitId: a, subUnitId: o } = i, l = t.values.filter((f) => !!f.pattern), u = t.values.filter((f) => !f.pattern), d = We(a, o, l), c = {
26
- unitId: a,
27
- subUnitId: o,
28
- ranges: u.map((f) => ({
29
- startColumn: f.col,
30
- startRow: f.row,
31
- endColumn: f.col,
32
- endRow: f.row
25
+ const { unitId: o, subUnitId: a } = i, l = t.values.filter((h) => !!h.pattern), u = t.values.filter((h) => !h.pattern), m = We(o, a, l), c = {
26
+ unitId: o,
27
+ subUnitId: a,
28
+ ranges: u.map((h) => ({
29
+ startColumn: h.col,
30
+ startRow: h.row,
31
+ endColumn: h.col,
32
+ endRow: h.row
33
33
  }))
34
- }, h = [], _ = [];
34
+ }, f = [], _ = [];
35
35
  if (l.length) {
36
- Object.keys(d.values).forEach((p) => {
37
- const g = d.values[p];
38
- g.ranges = Ve(g.ranges);
39
- }), h.push({
40
- id: te.id,
41
- params: d
36
+ Object.keys(m.values).forEach((p) => {
37
+ const v = m.values[p];
38
+ v.ranges = Ae(v.ranges);
39
+ }), f.push({
40
+ id: J.id,
41
+ params: m
42
42
  });
43
- const f = Ke(e, d);
44
- _.push(...f);
43
+ const h = Ge(e, m);
44
+ _.push(...h);
45
45
  }
46
46
  if (u.length) {
47
- c.ranges = Ve(c.ranges), h.push({
48
- id: _e.id,
47
+ c.ranges = Ae(c.ranges), f.push({
48
+ id: ge.id,
49
49
  params: c
50
50
  });
51
- const f = Ge(e, c);
52
- _.push(...f);
51
+ const h = ze(e, c);
52
+ _.push(...h);
53
53
  }
54
- const v = Ct(h, r).result;
55
- return v && s.pushUndoRedo({
56
- unitID: a,
54
+ const g = vt(f, r).result;
55
+ return g && s.pushUndoRedo({
56
+ unitID: o,
57
57
  undoMutations: _,
58
- redoMutations: h
59
- }), v;
58
+ redoMutations: f
59
+ }), g;
60
60
  }
61
- }, Ft = {
62
- sheet: {
63
- numfmt: {
64
- percent: "Percentage",
65
- title: "Number format",
66
- numfmtType: "Format types",
67
- cancel: "Cancel",
68
- confirm: "Confirm",
69
- general: "General",
70
- accounting: "Accounting",
71
- text: "Text",
72
- number: "Number",
73
- currency: "Currency",
74
- date: "Date",
75
- time: "Time",
76
- thousandthPercentile: "Thousands separator",
77
- preview: "Preview",
78
- dateTime: "Date and time",
79
- decimalLength: "Decimal places",
80
- currencyType: "Currency Symbol",
81
- moreFmt: "More Formats",
82
- financialValue: "Financial value",
83
- roundingCurrency: "Rounding up the currency",
84
- timeDuration: "Duration Time",
85
- currencyDes: "The currency format is used to represent general currency values. The accounting format aligns a column of values with decimal points",
86
- accountingDes: "The accounting number format aligns a column of values with currency symbols and decimal points",
87
- dateType: "Date Type",
88
- dateDes: "The date format presents date and time series values as date values.",
89
- negType: "A negative number type",
90
- generalDes: "The regular format does not contain any specific number format.",
91
- thousandthPercentileDes: "The percentile format is used for the representation of ordinary numbers. Monetary and accounting formats provide a specialized format for monetary value calculations.",
92
- addDecimal: "Increase decimal places",
93
- subtractDecimal: "Decreasing decimal places"
94
- }
95
- }
96
- }, zt = Ft, Wt = {
97
- sheet: {
98
- numfmt: {
99
- percent: "百分比",
100
- title: "数字格式",
101
- numfmtType: "格式类型",
102
- cancel: "取消",
103
- confirm: "确认",
104
- general: "常规",
105
- accounting: "会计",
106
- text: "文本",
107
- number: "数值",
108
- currency: "货币",
109
- date: "日期",
110
- time: "时间",
111
- thousandthPercentile: "千分位符",
112
- preview: "示例",
113
- dateTime: "日期时间",
114
- decimalLength: "小数位数",
115
- currencyType: "货币类型",
116
- moreFmt: "更多格式",
117
- financialValue: "财务数值",
118
- roundingCurrency: "货币取整",
119
- timeDuration: "持续时间",
120
- currencyDes: "货币格式用于表示一般货币数值。会计格式可以对一列数值进行小数点对齐",
121
- accountingDes: "会计数字格式可对一列数值进行货币符号和小数点对齐",
122
- dateType: "日期类型",
123
- dateDes: "日期格式将日期和时间系列数值品示为日期值。",
124
- negType: "负数类型",
125
- generalDes: "常规格式不包含任何特定的数字格式。",
126
- thousandthPercentileDes: "千分位符格式用于一般数字的表示。货币和会计格式则提供货币值计算的专用格式。",
127
- addDecimal: "增加小数位",
128
- subtractDecimal: "减少小数位"
129
- }
130
- }
131
- }, Kt = Wt, Gt = {
132
- sheet: {
133
- numfmt: {
134
- percent: "Процент",
135
- title: "Формат числа",
136
- numfmtType: "Типы форматов",
137
- cancel: "Отмена",
138
- confirm: "Подтвердить",
139
- general: "Общий",
140
- accounting: "Бухгалтерский",
141
- text: "Текст",
142
- number: "Число",
143
- currency: "Валюта",
144
- date: "Дата",
145
- time: "Время",
146
- thousandthPercentile: "Разделитель тысяч",
147
- preview: "Предпросмотр",
148
- dateTime: "Дата и время",
149
- decimalLength: "Десятичные знаки",
150
- currencyType: "Символ валюты",
151
- moreFmt: "Другие форматы",
152
- financialValue: "Финансовое значение",
153
- roundingCurrency: "Округление валюты",
154
- timeDuration: "Продолжительность времени",
155
- currencyDes: "Формат валюты используется для представления общих значений валюты. Формат бухгалтерского учета выравнивает столбец значений по десятичным точкам.",
156
- accountingDes: "Формат бухгалтерских чисел выравнивает столбец значений по символам валюты и десятичным точкам.",
157
- dateType: "Тип даты",
158
- dateDes: "Формат даты представляет значения времени и даты как значения даты.",
159
- negType: "Тип отрицательного числа",
160
- generalDes: "Обычный формат не содержит никакого специфического формата числа.",
161
- thousandthPercentileDes: "Формат процента используется для представления обычных чисел. Монетарные и бухгалтерские форматы предоставляют специальный формат для вычислений монетарных значений.",
162
- addDecimal: "Увеличить количество десятичных знаков",
163
- subtractDecimal: "Уменьшить количество десятичных знаков"
164
- }
165
- }
166
- }, Ir = Gt, xe = "SHEET_NUMFMT_PLUGIN", pe = (e) => j.getInfo(e).type || "unknown", Le = (e, t, r) => {
167
- const n = j.getInfo(e), s = r === yt.ZH_CN ? "zh-CN" : "en", i = n._partitions[1], a = j.format(e, t, { locale: s });
61
+ }, Ne = "SHEET_NUMFMT_PLUGIN", fe = (e) => x.getInfo(e).type || "unknown", De = (e, t, r) => {
62
+ const n = x.getInfo(e), s = r === gt.ZH_CN ? "zh-CN" : "en", i = n._partitions[1], o = x.format(e, t, { locale: s });
168
63
  return t < 0 ? {
169
- result: a,
64
+ result: o,
170
65
  color: i.color
171
66
  } : {
172
- result: a
67
+ result: o
173
68
  };
174
69
  };
175
- var Zt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, Yt = (e, t, r, n) => {
176
- for (var s = n > 1 ? void 0 : n ? qt(t, r) : t, i = e.length - 1, a; i >= 0; i--)
177
- (a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
178
- return n && s && Zt(t, r, s), s;
179
- }, F = (e, t) => (r, n) => t(r, n, e);
180
- let le = class extends X {
70
+ var Vt = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, Ft = (e, t, r, n) => {
71
+ for (var s = n > 1 ? void 0 : n ? Ht(t, r) : t, i = e.length - 1, o; i >= 0; i--)
72
+ (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
73
+ return n && s && Vt(t, r, s), s;
74
+ }, A = (e, t) => (r, n) => t(r, n, e);
75
+ let le = class extends Y {
181
76
  constructor(e, t, r, n, s, i) {
182
77
  super(), this._sheetInterceptorService = e, this._themeService = t, this._sheetSkeletonManagerService = r, this._commandService = n, this._numfmtService = s, this._localeService = i, this._initInterceptorCellContent();
183
78
  }
184
79
  _initInterceptorCellContent() {
185
- const e = new bt();
80
+ const e = new _t();
186
81
  this.disposeWithMe(
187
- this._sheetInterceptorService.intercept(Ze.CELL_CONTENT, {
82
+ this._sheetInterceptorService.intercept(Ke.CELL_CONTENT, {
188
83
  handler: (t, r, n) => {
189
- const s = r.unitId, i = r.subUnitId, a = this._numfmtService.getValue(s, i, r.row, r.col);
190
- if (!a)
84
+ const s = r.unitId, i = r.subUnitId, o = this._numfmtService.getValue(s, i, r.row, r.col);
85
+ if (!o)
191
86
  return n(t);
192
- const o = t;
193
- if (!o || o.t !== z.NUMBER)
87
+ const a = t;
88
+ if (!a || a.t !== B.NUMBER)
194
89
  return n(t);
195
90
  let l = "";
196
91
  const u = e.getValue(r.row, r.col);
197
- if (u && u.parameters === o.v)
92
+ if (u && u.parameters === a.v)
198
93
  return n({ ...t, ...u.result });
199
- const d = Le(a.pattern, Number(o.v), this._localeService.getCurrentLocale());
200
- if (l = d.result, !l)
94
+ const m = De(o.pattern, Number(a.v), this._localeService.getCurrentLocale());
95
+ if (l = m.result, !l)
201
96
  return n(t);
202
97
  const c = { v: l };
203
- if (d.color) {
204
- const h = this._themeService.getCurrentTheme()[`${d.color}500`];
205
- h && (c.interceptorStyle = { cl: { rgb: h } });
98
+ if (m.color) {
99
+ const f = this._themeService.getCurrentTheme()[`${m.color}500`];
100
+ f && (c.interceptorStyle = { cl: { rgb: f } });
206
101
  }
207
102
  return e.setValue(r.row, r.col, {
208
103
  result: c,
209
- parameters: o.v
104
+ parameters: a.v
210
105
  }), n({ ...t, ...c });
211
- }
106
+ },
107
+ priority: 10
212
108
  })
213
109
  ), this.disposeWithMe(
214
110
  this._commandService.onCommandExecuted((t) => {
215
- if (t.id === te.id) {
111
+ if (t.id === J.id) {
216
112
  const r = t.params;
217
113
  Object.keys(r.values).forEach((n) => {
218
114
  r.values[n].ranges.forEach((i) => {
219
- E.foreach(i, (a, o) => {
220
- e.realDeleteValue(a, o);
115
+ P.foreach(i, (o, a) => {
116
+ e.realDeleteValue(o, a);
221
117
  });
222
118
  });
223
119
  });
224
120
  }
225
121
  })
226
122
  ), this.disposeWithMe(
227
- Q(
123
+ K(
228
124
  this._sheetSkeletonManagerService.currentSkeleton$.pipe(
229
- Ye((t) => t == null ? void 0 : t.sheetId),
230
- Pt()
125
+ qe((t) => t == null ? void 0 : t.sheetId),
126
+ Rt()
231
127
  ).subscribe(() => {
232
128
  e.reset();
233
129
  })
@@ -235,80 +131,80 @@ let le = class extends X {
235
131
  );
236
132
  }
237
133
  };
238
- le = Yt([
239
- ee(K.Rendered, le),
240
- F(0, S(Oe)),
241
- F(1, S(ze)),
242
- F(2, S(qe)),
243
- F(3, S($)),
244
- F(4, S(G)),
245
- F(5, S(T))
134
+ le = Ft([
135
+ q(V.Rendered, le),
136
+ A(0, S(Pe)),
137
+ A(1, S(Fe)),
138
+ A(2, S(Ye)),
139
+ A(3, S(O)),
140
+ A(4, S(H)),
141
+ A(5, S(T))
246
142
  ], le);
247
- const L = (e, t = 0) => {
143
+ const j = (e, t = 0) => {
248
144
  var n;
249
- return e && (n = j.getInfo(e).maxDecimals) != null ? n : t;
250
- }, Se = (e, t) => {
145
+ return e && (n = x.getInfo(e).maxDecimals) != null ? n : t;
146
+ }, _e = (e, t) => {
251
147
  if (e && !t || !e && t)
252
148
  return !1;
253
149
  const r = (u) => u.reduce(
254
- (d, c) => {
255
- if (d.isEnd)
256
- return d;
257
- const h = c.value || c.num;
258
- return c.type === "point" ? (d.isEnd = !0, d) : { ...d, result: d.result + h };
150
+ (m, c) => {
151
+ if (m.isEnd)
152
+ return m;
153
+ const f = c.value || c.num;
154
+ return c.type === "point" ? (m.isEnd = !0, m) : { ...m, result: m.result + f };
259
155
  },
260
156
  { isEnd: !1, result: "" }
261
- ).result, n = j.getInfo(e)._partitions, s = j.getInfo(t)._partitions, i = r(n[0].tokens), a = r(s[0].tokens), o = r(n[1].tokens), l = r(s[1].tokens);
262
- return i === a && o === l && n[1].color === s[1].color;
263
- }, Be = (e) => new Array(Math.min(Math.max(0, Number(e)), 30)).fill(0).join(""), b = (e, t) => e.split(";").map((n) => /\.0?/.test(n) ? n.replace(
157
+ ).result, n = x.getInfo(e)._partitions, s = x.getInfo(t)._partitions, i = r(n[0].tokens), o = r(s[0].tokens), a = r(n[1].tokens), l = r(s[1].tokens);
158
+ return i === o && a === l && n[1].color === s[1].color;
159
+ }, ke = (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(
264
160
  /\.0*/g,
265
- `${t > 0 ? "." : ""}${Be(Number(t || 0))}`
161
+ `${t > 0 ? "." : ""}${ke(Number(t || 0))}`
266
162
  ) : /0([^0]?)|0$/.test(n) ? n.replace(
267
163
  /0([^0]+)|0$/,
268
- `0${t > 0 ? "." : ""}${Be(Number(t || 0))}$1`
269
- ) : n).join(";"), Jt = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), et = {
164
+ `0${t > 0 ? "." : ""}${ke(Number(t || 0))}$1`
165
+ ) : n).join(";"), Wt = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), et = {
270
166
  id: "sheet.command.numfmt.add.decimal.command",
271
- type: V.COMMAND,
167
+ type: w.COMMAND,
272
168
  handler: async (e) => {
273
- const t = e.get($), r = e.get(H), n = e.get(G), s = e.get(W), i = r.getSelections();
169
+ const t = e.get(O), r = e.get(D), n = e.get(H), s = e.get(k), i = r.getSelections();
274
170
  if (!i || !i.length)
275
171
  return !1;
276
- const a = Re(s);
277
- if (!a)
172
+ const o = Re(s);
173
+ if (!o)
278
174
  return !1;
279
- const { unitId: o, subUnitId: l } = a;
175
+ const { unitId: a, subUnitId: l } = o;
280
176
  let u = 0;
281
177
  i.forEach((_) => {
282
- E.foreach(_.range, (v, f) => {
283
- const p = n.getValue(o, l, v, f);
178
+ P.foreach(_.range, (g, h) => {
179
+ const p = n.getValue(a, l, g, h);
284
180
  if (!p)
285
181
  return;
286
- const g = L(p.pattern);
287
- u = g > u ? g : u;
182
+ const v = j(p.pattern);
183
+ u = v > u ? v : u;
288
184
  });
289
185
  });
290
- const d = u + 1, c = b(`0${d > 0 ? ".0" : ""}`, d), h = [];
186
+ const m = u + 1, c = C(`0${m > 0 ? ".0" : ""}`, m), f = [];
291
187
  return i.forEach((_) => {
292
- E.foreach(_.range, (v, f) => {
293
- const p = n.getValue(o, l, v, f);
188
+ P.foreach(_.range, (g, h) => {
189
+ const p = n.getValue(a, l, g, h);
294
190
  if (!p)
295
- h.push({
296
- row: v,
297
- col: f,
191
+ f.push({
192
+ row: g,
193
+ col: h,
298
194
  pattern: c
299
195
  });
300
196
  else {
301
- const g = L(p.pattern), C = b(p.pattern, g + 1);
302
- C !== p.pattern && h.push({
303
- row: v,
304
- col: f,
305
- pattern: C
197
+ const v = j(p.pattern), b = C(p.pattern, v + 1);
198
+ b !== p.pattern && f.push({
199
+ row: g,
200
+ col: h,
201
+ pattern: b
306
202
  });
307
203
  }
308
204
  });
309
- }), h.length ? await t.executeCommand(A.id, { values: h }) : !1;
205
+ }), f.length ? await t.executeCommand($.id, { values: f }) : !1;
310
206
  }
311
- }, Qt = [
207
+ }, Gt = [
312
208
  {
313
209
  label: "1930-08-05",
314
210
  suffix: "yyyy-MM-dd"
@@ -353,7 +249,7 @@ const L = (e, t = 0) => {
353
249
  label: "08-05 下午 01:30",
354
250
  suffix: "MM-dd A/P hh:mm"
355
251
  }
356
- ], Xt = [
252
+ ], zt = [
357
253
  {
358
254
  label: "(1,235)",
359
255
  suffix: "#,##0_);(#,##0)"
@@ -411,75 +307,75 @@ const L = (e, t = 0) => {
411
307
  }
412
308
  ], nt = {
413
309
  id: "sheet.command.numfmt.set.currency",
414
- type: V.COMMAND,
310
+ type: w.COMMAND,
415
311
  handler: async (e) => {
416
- const t = e.get($), n = e.get(H).getSelections();
312
+ const t = e.get(O), n = e.get(D).getSelections();
417
313
  if (!n || !n.length)
418
314
  return !1;
419
315
  const s = [], i = tt[0].suffix("¥");
420
- return n.forEach((o) => {
421
- E.foreach(o.range, (l, u) => {
316
+ return n.forEach((a) => {
317
+ P.foreach(a.range, (l, u) => {
422
318
  s.push({ row: l, col: u, pattern: i, type: "currency" });
423
319
  });
424
- }), await t.executeCommand(A.id, { values: s });
320
+ }), await t.executeCommand($.id, { values: s });
425
321
  }
426
322
  }, rt = {
427
323
  id: "sheet.command.numfmt.subtract.decimal.command",
428
- type: V.COMMAND,
324
+ type: w.COMMAND,
429
325
  handler: async (e) => {
430
- const t = e.get($), r = e.get(H), n = e.get(G), s = e.get(W), i = r.getSelections();
326
+ const t = e.get(O), r = e.get(D), n = e.get(H), s = e.get(k), i = r.getSelections();
431
327
  if (!i || !i.length)
432
328
  return !1;
433
- const a = Re(s);
434
- if (!a)
329
+ const o = Re(s);
330
+ if (!o)
435
331
  return !1;
436
- const { unitId: o, subUnitId: l } = a;
332
+ const { unitId: a, subUnitId: l } = o;
437
333
  let u = 0;
438
- i.forEach((v) => {
439
- E.foreach(v.range, (f, p) => {
440
- const g = n.getValue(o, l, f, p);
441
- if (!g)
334
+ i.forEach((g) => {
335
+ P.foreach(g.range, (h, p) => {
336
+ const v = n.getValue(a, l, h, p);
337
+ if (!v)
442
338
  return;
443
- const C = L(g.pattern);
444
- u = C > u ? C : u;
339
+ const b = j(v.pattern);
340
+ u = b > u ? b : u;
445
341
  });
446
342
  });
447
- const d = u - 1, c = b(`0${d > 0 ? ".0" : "."}`, d), h = [];
448
- return i.forEach((v) => {
449
- E.foreach(v.range, (f, p) => {
450
- const g = n.getValue(o, l, f, p);
451
- if (!g)
452
- h.push({
453
- row: f,
343
+ const m = u - 1, c = C(`0${m > 0 ? ".0" : "."}`, m), f = [];
344
+ return i.forEach((g) => {
345
+ P.foreach(g.range, (h, p) => {
346
+ const v = n.getValue(a, l, h, p);
347
+ if (!v)
348
+ f.push({
349
+ row: h,
454
350
  col: p,
455
351
  pattern: c
456
352
  });
457
353
  else {
458
- const C = L(g.pattern);
459
- h.push({
460
- row: f,
354
+ const b = j(v.pattern);
355
+ f.push({
356
+ row: h,
461
357
  col: p,
462
- pattern: b(g.pattern, C - 1)
358
+ pattern: C(v.pattern, b - 1)
463
359
  });
464
360
  }
465
361
  });
466
- }), await t.executeCommand(A.id, { values: h });
362
+ }), await t.executeCommand($.id, { values: f });
467
363
  }
468
364
  }, Ie = {
469
365
  id: "sheet.operation.close.numfmt.panel",
470
- type: V.OPERATION,
366
+ type: w.OPERATION,
471
367
  handler: () => (
472
368
  // do nothing,just notify panel is closed
473
369
  !0
474
370
  )
475
- }, Ue = Rt("INumfmtController");
476
- It(K.Rendered, Ue);
477
- const ve = {
371
+ }, Ue = Mt("INumfmtController");
372
+ St(V.Rendered, Ue);
373
+ const pe = {
478
374
  id: "sheet.operation.open.numfmt.panel",
479
- type: V.OPERATION,
375
+ type: w.OPERATION,
480
376
  handler: (e) => (e.get(Ue).openPanel(), !0)
481
377
  };
482
- var st = { exports: {} }, Ce = {};
378
+ var st = { exports: {} }, Se = {};
483
379
  /**
484
380
  * @license React
485
381
  * react-jsx-runtime.production.min.js
@@ -489,23 +385,23 @@ var st = { exports: {} }, Ce = {};
489
385
  * This source code is licensed under the MIT license found in the
490
386
  * LICENSE file in the root directory of this source tree.
491
387
  */
492
- var en = Ht, tn = Symbol.for("react.element"), nn = Symbol.for("react.fragment"), rn = Object.prototype.hasOwnProperty, sn = en.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, an = { key: !0, ref: !0, __self: !0, __source: !0 };
388
+ var Kt = Lt, Yt = Symbol.for("react.element"), qt = Symbol.for("react.fragment"), Jt = Object.prototype.hasOwnProperty, Zt = Kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Qt = { key: !0, ref: !0, __self: !0, __source: !0 };
493
389
  function it(e, t, r) {
494
- var n, s = {}, i = null, a = null;
495
- r !== void 0 && (i = "" + r), t.key !== void 0 && (i = "" + t.key), t.ref !== void 0 && (a = t.ref);
390
+ var n, s = {}, i = null, o = null;
391
+ r !== void 0 && (i = "" + r), t.key !== void 0 && (i = "" + t.key), t.ref !== void 0 && (o = t.ref);
496
392
  for (n in t)
497
- rn.call(t, n) && !an.hasOwnProperty(n) && (s[n] = t[n]);
393
+ Jt.call(t, n) && !Qt.hasOwnProperty(n) && (s[n] = t[n]);
498
394
  if (e && e.defaultProps)
499
395
  for (n in t = e.defaultProps, t)
500
396
  s[n] === void 0 && (s[n] = t[n]);
501
- return { $$typeof: tn, type: e, key: i, ref: a, props: s, _owner: sn.current };
397
+ return { $$typeof: Yt, type: e, key: i, ref: o, props: s, _owner: Zt.current };
502
398
  }
503
- Ce.Fragment = nn;
504
- Ce.jsx = it;
505
- Ce.jsxs = it;
506
- st.exports = Ce;
507
- var m = st.exports;
508
- const Ae = Bt([]), Ne = [
399
+ Se.Fragment = qt;
400
+ Se.jsx = it;
401
+ Se.jsxs = it;
402
+ st.exports = Se;
403
+ var d = st.exports;
404
+ const Le = At([]), Ee = [
509
405
  "$",
510
406
  "£",
511
407
  "¥",
@@ -534,12 +430,12 @@ const Ae = Bt([]), Ne = [
534
430
  "₾",
535
431
  "₿"
536
432
  ];
537
- var cn = Object.defineProperty, on = Object.getOwnPropertyDescriptor, ln = (e, t, r, n) => {
538
- for (var s = n > 1 ? void 0 : n ? on(t, r) : t, i = e.length - 1, a; i >= 0; i--)
539
- (a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
540
- return n && s && cn(t, r, s), s;
541
- }, un = (e, t) => (r, n) => t(r, n, e);
542
- let ge = class {
433
+ var Xt = Object.defineProperty, en = Object.getOwnPropertyDescriptor, tn = (e, t, r, n) => {
434
+ for (var s = n > 1 ? void 0 : n ? en(t, r) : t, i = e.length - 1, o; i >= 0; i--)
435
+ (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
436
+ return n && s && Xt(t, r, s), s;
437
+ }, nn = (e, t) => (r, n) => t(r, n, e);
438
+ let ve = class {
543
439
  constructor(e) {
544
440
  this._localStorageService = e;
545
441
  }
@@ -564,17 +460,17 @@ let ge = class {
564
460
  async getHabit(e, t) {
565
461
  const r = this._getKey(e), n = await this._localStorageService.getItem(r);
566
462
  if (t && n) {
567
- const s = n.map((i, a, o) => {
568
- const l = o.length;
463
+ const s = n.map((i, o, a) => {
464
+ const l = a.length;
569
465
  return {
570
466
  value: i,
571
- priority: l - a
467
+ priority: l - o
572
468
  };
573
469
  });
574
- return t.sort((i, a) => {
575
- var u, d;
576
- const o = ((u = s.find((c) => c.value === i)) == null ? void 0 : u.priority) || -1;
577
- return (((d = s.find((c) => c.value === a)) == null ? void 0 : d.priority) || -1) - o;
470
+ return t.sort((i, o) => {
471
+ var u, m;
472
+ const a = ((u = s.find((c) => c.value === i)) == null ? void 0 : u.priority) || -1;
473
+ return (((m = s.find((c) => c.value === o)) == null ? void 0 : m.priority) || -1) - a;
578
474
  });
579
475
  }
580
476
  return n || [];
@@ -583,122 +479,122 @@ let ge = class {
583
479
  this._localStorageService.removeItem(e);
584
480
  }
585
481
  };
586
- ge = ln([
587
- un(0, S(Mt))
588
- ], ge);
589
- const ke = "numfmtCurrency", mn = (e) => {
590
- const t = N(ge), [r, n] = M(Ne);
591
- return Pe(() => {
482
+ ve = tn([
483
+ nn(0, S(bt))
484
+ ], ve);
485
+ const Ve = "numfmtCurrency", rn = (e) => {
486
+ const t = N(ve), [r, n] = I(Ee);
487
+ return Oe(() => {
592
488
  t.addHabit("numfmtCurrency", []).then(() => {
593
- t.getHabit(ke, [...Ne]).then((i) => {
489
+ t.getHabit(Ve, [...Ee]).then((i) => {
594
490
  n(i), e && e(i);
595
491
  });
596
492
  });
597
493
  }, []), { userHabitCurrency: r, mark: (i) => {
598
- t.markHabit(ke, i);
494
+ t.markHabit(Ve, i);
599
495
  } };
600
- }, dn = () => {
601
- const e = Ee([]), [t, r] = M({});
602
- return Pe(() => {
496
+ }, sn = () => {
497
+ const e = Qe([]), [t, r] = I({});
498
+ return Oe(() => {
603
499
  e.current.forEach((s) => {
604
500
  s();
605
501
  }), e.current = [];
606
502
  }, [t]), (s) => {
607
503
  e.current.push(s), r({});
608
504
  };
609
- }, ce = (e) => Ne.find((r) => e.includes(r)), fn = (e) => !!ce(e) && e.startsWith("_("), hn = (e) => {
610
- const [t, r] = M(() => L(e.defaultPattern || "", 2)), n = Xe(Ae), [s, i] = M(() => ce(e.defaultPattern) || n[0]), a = P(() => n.map((c) => ({ label: c, value: c })), []), l = N(T).t;
611
- e.action.current = () => b(`_("${s}"* #,##0${t > 0 ? ".0" : ""}_)`, t);
505
+ }, oe = (e) => Ee.find((r) => e.includes(r)), on = (e) => !!oe(e) && e.startsWith("_("), cn = (e) => {
506
+ const [t, r] = I(() => j(e.defaultPattern || "", 2)), n = Xe(Le), [s, i] = I(() => oe(e.defaultPattern) || n[0]), o = R(() => n.map((c) => ({ label: c, value: c })), []), l = N(T).t;
507
+ e.action.current = () => C(`_("${s}"* #,##0${t > 0 ? ".0" : ""}_)`, t);
612
508
  const u = (c) => {
613
- i(c), e.onChange(b(`_("${c}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
614
- }, d = (c) => {
615
- const h = c || 0;
616
- r(h), e.onChange(b(`_("${s}"* #,##0${h > 0 ? ".0" : ""}_)`, h));
509
+ i(c), e.onChange(C(`_("${c}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
510
+ }, m = (c) => {
511
+ const f = c || 0;
512
+ r(f), e.onChange(C(`_("${s}"* #,##0${f > 0 ? ".0" : ""}_)`, f));
617
513
  };
618
- return /* @__PURE__ */ m.jsxs("div", { children: [
619
- /* @__PURE__ */ m.jsxs("div", { className: "m-t-16 options ", children: [
620
- /* @__PURE__ */ m.jsxs("div", { className: "option", children: [
621
- /* @__PURE__ */ m.jsx("div", { className: "label", children: l("sheet.numfmt.decimalLength") }),
622
- /* @__PURE__ */ m.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ m.jsx(je, { value: t, max: 20, min: 0, onChange: d }) })
514
+ return /* @__PURE__ */ d.jsxs("div", { children: [
515
+ /* @__PURE__ */ d.jsxs("div", { className: "m-t-16 options ", children: [
516
+ /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
517
+ /* @__PURE__ */ d.jsx("div", { className: "label", children: l("sheet.numfmt.decimalLength") }),
518
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ d.jsx(je, { value: t, max: 20, min: 0, onChange: m }) })
623
519
  ] }),
624
- /* @__PURE__ */ m.jsxs("div", { className: "option", children: [
625
- /* @__PURE__ */ m.jsx("div", { className: "label", children: l("sheet.numfmt.currencyType") }),
626
- /* @__PURE__ */ m.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ m.jsx($e, { onChange: u, options: a, value: s }) })
520
+ /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
521
+ /* @__PURE__ */ d.jsx("div", { className: "label", children: l("sheet.numfmt.currencyType") }),
522
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ d.jsx($e, { onChange: u, options: o, value: s }) })
627
523
  ] })
628
524
  ] }),
629
- /* @__PURE__ */ m.jsx("div", { className: "describe m-t-14", children: l("sheet.numfmt.accountingDes") })
525
+ /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: l("sheet.numfmt.accountingDes") })
630
526
  ] });
631
- }, Me = (e) => tt.map((t) => ({
527
+ }, Te = (e) => tt.map((t) => ({
632
528
  label: t.label(e),
633
529
  value: t.suffix(e),
634
530
  color: t.color
635
- })), at = () => Qt.map((e) => ({ label: e.label, value: e.suffix })), ct = () => Xt.map((e) => ({ label: e.label, value: e.suffix, color: e.color })), pn = (e) => !!ce(e) && !e.startsWith("_("), vn = (e) => {
636
- const r = N(T).t, n = Xe(Ae), [s, i] = M(() => ce(e.defaultPattern) || n[0]), [a, o] = M(() => L(e.defaultPattern || "", 2)), [l, u] = M(() => {
637
- var g;
638
- const f = Me(s);
639
- return ((g = f.find((C) => Se(C.value, e.defaultPattern))) == null ? void 0 : g.value) || f[0].value;
640
- }), d = P(() => Me(s), [s]), c = P(() => n.map((f) => ({ label: f, value: f })), [n]);
641
- e.action.current = () => b(l, a);
642
- const h = (f) => {
643
- i(f);
644
- const p = Me(f)[0].value;
645
- u(p), e.onChange(b(p, a));
646
- }, _ = (f) => {
647
- u(f), e.onChange(b(f, a));
648
- }, v = (f) => {
649
- o(f || 0), e.onChange(b(l, f || 0));
531
+ })), ot = () => Gt.map((e) => ({ label: e.label, value: e.suffix })), ct = () => zt.map((e) => ({ label: e.label, value: e.suffix, color: e.color })), an = (e) => !!oe(e) && !e.startsWith("_("), ln = (e) => {
532
+ const r = N(T).t, n = Xe(Le), [s, i] = I(() => oe(e.defaultPattern) || n[0]), [o, a] = I(() => j(e.defaultPattern || "", 2)), [l, u] = I(() => {
533
+ var v;
534
+ const h = Te(s);
535
+ return ((v = h.find((b) => _e(b.value, e.defaultPattern))) == null ? void 0 : v.value) || h[0].value;
536
+ }), m = R(() => Te(s), [s]), c = R(() => n.map((h) => ({ label: h, value: h })), [n]);
537
+ e.action.current = () => C(l, o);
538
+ const f = (h) => {
539
+ i(h);
540
+ const p = Te(h)[0].value;
541
+ u(p), e.onChange(C(p, o));
542
+ }, _ = (h) => {
543
+ u(h), e.onChange(C(h, o));
544
+ }, g = (h) => {
545
+ a(h || 0), e.onChange(C(l, h || 0));
650
546
  };
651
- return /* @__PURE__ */ m.jsxs("div", { children: [
652
- /* @__PURE__ */ m.jsxs("div", { className: "m-t-16 options ", children: [
653
- /* @__PURE__ */ m.jsxs("div", { className: "option", children: [
654
- /* @__PURE__ */ m.jsx("div", { className: "label", children: r("sheet.numfmt.decimalLength") }),
655
- /* @__PURE__ */ m.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ m.jsx(je, { value: a, max: 20, min: 0, onChange: v }) })
547
+ return /* @__PURE__ */ d.jsxs("div", { children: [
548
+ /* @__PURE__ */ d.jsxs("div", { className: "m-t-16 options ", children: [
549
+ /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
550
+ /* @__PURE__ */ d.jsx("div", { className: "label", children: r("sheet.numfmt.decimalLength") }),
551
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ d.jsx(je, { value: o, max: 20, min: 0, onChange: g }) })
656
552
  ] }),
657
- /* @__PURE__ */ m.jsxs("div", { className: "option", children: [
658
- /* @__PURE__ */ m.jsx("div", { className: "label", children: r("sheet.numfmt.currencyType") }),
659
- /* @__PURE__ */ m.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ m.jsx($e, { onChange: h, options: c, value: s }) })
553
+ /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
554
+ /* @__PURE__ */ d.jsx("div", { className: "label", children: r("sheet.numfmt.currencyType") }),
555
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ d.jsx($e, { onChange: f, options: c, value: s }) })
660
556
  ] })
661
557
  ] }),
662
- /* @__PURE__ */ m.jsx("div", { className: "m-t-16 label", children: r("sheet.numfmt.negType") }),
663
- /* @__PURE__ */ m.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ m.jsx(we, { onChange: _, options: d, value: l }) }),
664
- /* @__PURE__ */ m.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.currencyDes") })
558
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-16 label", children: r("sheet.numfmt.negType") }),
559
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx(we, { onChange: _, options: m, value: l }) }),
560
+ /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.currencyDes") })
665
561
  ] });
666
- }, gn = (e) => {
667
- const t = j.getInfo(e);
668
- return at().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
669
- }, _n = (e) => {
670
- const t = P(at, []), n = N(T).t, [s, i] = M(() => {
562
+ }, un = (e) => {
563
+ const t = x.getInfo(e);
564
+ return ot().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
565
+ }, mn = (e) => {
566
+ const t = R(ot, []), n = N(T).t, [s, i] = I(() => {
671
567
  if (e.defaultPattern) {
672
- const o = t.find((l) => l.value === e.defaultPattern);
673
- if (o)
674
- return o.value;
568
+ const a = t.find((l) => l.value === e.defaultPattern);
569
+ if (a)
570
+ return a.value;
675
571
  }
676
572
  return t[0].value;
677
573
  });
678
574
  e.action.current = () => s;
679
- const a = (o) => {
680
- i(o), e.onChange(o);
575
+ const o = (a) => {
576
+ i(a), e.onChange(a);
681
577
  };
682
- return /* @__PURE__ */ m.jsxs("div", { children: [
683
- /* @__PURE__ */ m.jsx("div", { className: "m-t-16 label", children: n("sheet.numfmt.dateType") }),
684
- /* @__PURE__ */ m.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ m.jsx(we, { value: s, options: t, onChange: a }) }),
685
- /* @__PURE__ */ m.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.dateDes") })
578
+ return /* @__PURE__ */ d.jsxs("div", { children: [
579
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-16 label", children: n("sheet.numfmt.dateType") }),
580
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx(we, { value: s, options: t, onChange: o }) }),
581
+ /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.dateDes") })
686
582
  ] });
687
- }, Sn = (e) => !e, Cn = (e) => {
583
+ }, dn = (e) => !e, hn = (e) => {
688
584
  const r = N(T).t;
689
- return e.action.current = () => "", /* @__PURE__ */ m.jsx("div", { children: /* @__PURE__ */ m.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.generalDes") }) });
690
- }, yn = (e) => ct().some((t) => Se(t.value, e)), bn = (e) => {
691
- const t = N(T), r = P(ct, []), [n, s] = M(() => L(e.defaultPattern || "", 0)), [i, a] = M(() => {
692
- const c = r.find((h) => Se(h.value, e.defaultPattern || ""));
585
+ return e.action.current = () => "", /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.generalDes") }) });
586
+ }, fn = (e) => ct().some((t) => _e(t.value, e)), pn = (e) => {
587
+ const t = N(T), r = R(ct, []), [n, s] = I(() => j(e.defaultPattern || "", 0)), [i, o] = I(() => {
588
+ const c = r.find((f) => _e(f.value, e.defaultPattern || ""));
693
589
  return (c == null ? void 0 : c.value) || r[0].value;
694
- }), o = P(() => b(i, Number(n || 0)), [i, n]), l = P(() => !Jt(i), [i]), u = (c) => {
695
- s(c || 0), e.onChange(b(i, Number(c || 0)));
696
- }, d = (c) => {
697
- s(L(c, 0)), a(c), e.onChange(c);
590
+ }), a = R(() => C(i, Number(n || 0)), [i, n]), l = R(() => !Wt(i), [i]), u = (c) => {
591
+ s(c || 0), e.onChange(C(i, Number(c || 0)));
592
+ }, m = (c) => {
593
+ s(j(c, 0)), o(c), e.onChange(c);
698
594
  };
699
- return e.action.current = () => o, /* @__PURE__ */ m.jsxs("div", { children: [
700
- /* @__PURE__ */ m.jsx("div", { className: "m-t-16 label", children: t.t("sheet.numfmt.decimalLength") }),
701
- /* @__PURE__ */ m.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ m.jsx(
595
+ return e.action.current = () => a, /* @__PURE__ */ d.jsxs("div", { children: [
596
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-16 label", children: t.t("sheet.numfmt.decimalLength") }),
597
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx(
702
598
  je,
703
599
  {
704
600
  disabled: l,
@@ -708,83 +604,83 @@ const ke = "numfmtCurrency", mn = (e) => {
708
604
  onChange: u
709
605
  }
710
606
  ) }),
711
- /* @__PURE__ */ m.jsxs("div", { className: "m-t-16 label", children: [
607
+ /* @__PURE__ */ d.jsxs("div", { className: "m-t-16 label", children: [
712
608
  " ",
713
609
  t.t("sheet.numfmt.negType")
714
610
  ] }),
715
- /* @__PURE__ */ m.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ m.jsx(we, { onChange: d, options: r, value: i }) }),
716
- /* @__PURE__ */ m.jsx("div", { className: "describe m-t-14", children: t.t("sheet.numfmt.thousandthPercentileDes") })
611
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx(we, { onChange: m, options: r, value: i }) }),
612
+ /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: t.t("sheet.numfmt.thousandthPercentileDes") })
717
613
  ] });
718
- }, In = (e) => {
719
- const { defaultValue: t, defaultPattern: r, row: n, col: s } = e.value, i = N(T), a = Ee(() => ""), o = i.t, l = dn(), u = P(
614
+ }, vn = (e) => {
615
+ const { defaultValue: t, defaultPattern: r, row: n, col: s } = e.value, i = N(T), o = Qe(() => ""), a = i.t, l = sn(), u = R(
720
616
  () => [
721
- { label: "sheet.numfmt.general", component: Cn },
722
- { label: "sheet.numfmt.accounting", component: hn },
723
- { label: "sheet.numfmt.currency", component: vn },
724
- { label: "sheet.numfmt.date", component: _n },
725
- { label: "sheet.numfmt.thousandthPercentile", component: bn }
726
- ].map((y) => ({ ...y, label: o(y.label) })),
617
+ { label: "sheet.numfmt.general", component: hn },
618
+ { label: "sheet.numfmt.accounting", component: cn },
619
+ { label: "sheet.numfmt.currency", component: ln },
620
+ { label: "sheet.numfmt.date", component: mn },
621
+ { label: "sheet.numfmt.thousandthPercentile", component: pn }
622
+ ].map((y) => ({ ...y, label: a(y.label) })),
727
623
  []
728
- ), [d, c] = M(g), [h, _] = M(() => `${n}_${s}`), { mark: v, userHabitCurrency: f } = mn(() => _(`${n}_${s}_userCurrency'`)), p = P(() => {
624
+ ), [m, c] = I(v), [f, _] = I(() => `${n}_${s}`), { mark: g, userHabitCurrency: h } = rn(() => _(`${n}_${s}_userCurrency'`)), p = R(() => {
729
625
  var y;
730
- return (y = u.find((k) => k.label === d)) == null ? void 0 : y.component;
731
- }, [d]);
732
- function g() {
733
- return [Sn, fn, pn, gn, yn].reduce((k, pt, vt) => k || (pt(r) ? u[vt].label : ""), "") || u[0].label;
626
+ return (y = u.find((U) => U.label === m)) == null ? void 0 : y.component;
627
+ }, [m]);
628
+ function v() {
629
+ return [dn, on, an, un, fn].reduce((U, mt, dt) => U || (mt(r) ? u[dt].label : ""), "") || u[0].label;
734
630
  }
735
- const C = u.map((y) => ({
631
+ const b = u.map((y) => ({
736
632
  label: y.label,
737
633
  value: y.label
738
- })), O = (y) => {
739
- c(y), l(() => e.onChange({ type: "change", value: a.current() || "" }));
740
- }, D = (y) => {
634
+ })), F = (y) => {
635
+ c(y), l(() => e.onChange({ type: "change", value: o.current() || "" }));
636
+ }, ce = (y) => {
741
637
  e.onChange({ type: "change", value: y });
742
- }, w = () => {
743
- const y = a.current() || "", k = ce(y);
744
- k && v(k), e.onChange({ type: "confirm", value: y });
638
+ }, be = () => {
639
+ const y = o.current() || "", U = oe(y);
640
+ U && g(U), e.onChange({ type: "confirm", value: y });
745
641
  }, ye = () => {
746
642
  e.onChange({ type: "cancel", value: "" });
747
- }, be = {
748
- onChange: D,
643
+ }, Ce = {
644
+ onChange: ce,
749
645
  defaultValue: t,
750
646
  defaultPattern: r,
751
- action: a
647
+ action: o
752
648
  };
753
- return Pe(() => {
754
- c(g()), _(`${n}_${s}`);
755
- }, [n, s]), /* @__PURE__ */ m.jsxs("div", { className: "numfmt-panel p-b-20", children: [
756
- /* @__PURE__ */ m.jsxs("div", { children: [
757
- /* @__PURE__ */ m.jsx("div", { className: "label m-t-14", children: o("sheet.numfmt.numfmtType") }),
758
- /* @__PURE__ */ m.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ m.jsx($e, { onChange: O, options: C, value: d }) }),
759
- /* @__PURE__ */ m.jsx("div", { children: p && /* @__PURE__ */ m.jsx(Ae.Provider, { value: f, children: /* @__PURE__ */ B(p, { ...be, key: h }) }) })
649
+ return Oe(() => {
650
+ c(v()), _(`${n}_${s}`);
651
+ }, [n, s]), /* @__PURE__ */ d.jsxs("div", { className: "numfmt-panel p-b-20", children: [
652
+ /* @__PURE__ */ d.jsxs("div", { children: [
653
+ /* @__PURE__ */ d.jsx("div", { className: "label m-t-14", children: a("sheet.numfmt.numfmtType") }),
654
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx($e, { onChange: F, options: b, value: m }) }),
655
+ /* @__PURE__ */ d.jsx("div", { children: p && /* @__PURE__ */ d.jsx(Le.Provider, { value: h, children: /* @__PURE__ */ Bt(p, { ...Ce, key: f }) }) })
760
656
  ] }),
761
- /* @__PURE__ */ m.jsxs("div", { className: "btn-list m-t-14 m-b-20", children: [
762
- /* @__PURE__ */ m.jsx(He, { size: "small", onClick: ye, className: "m-r-12", children: o("sheet.numfmt.cancel") }),
763
- /* @__PURE__ */ m.jsx(He, { type: "primary", size: "small", onClick: w, children: o("sheet.numfmt.confirm") })
657
+ /* @__PURE__ */ d.jsxs("div", { className: "btn-list m-t-14 m-b-20", children: [
658
+ /* @__PURE__ */ d.jsx(Be, { size: "small", onClick: ye, className: "m-r-12", children: a("sheet.numfmt.cancel") }),
659
+ /* @__PURE__ */ d.jsx(Be, { type: "primary", size: "small", onClick: be, children: a("sheet.numfmt.confirm") })
764
660
  ] })
765
661
  ] });
766
- }, ot = {
662
+ }, at = {
767
663
  id: "sheet.command.numfmt.set.percent",
768
- type: V.COMMAND,
664
+ type: w.COMMAND,
769
665
  handler: async (e) => {
770
- const t = e.get($), n = e.get(H).getSelections();
666
+ const t = e.get(O), n = e.get(D).getSelections();
771
667
  if (!n || !n.length)
772
668
  return !1;
773
669
  const s = [], i = "0%";
774
- return n.forEach((o) => {
775
- E.foreach(o.range, (l, u) => {
670
+ return n.forEach((a) => {
671
+ P.foreach(a.range, (l, u) => {
776
672
  s.push({ row: l, col: u, pattern: i, type: "percent" });
777
673
  });
778
- }), await t.executeCommand(A.id, { values: s });
674
+ }), await t.executeCommand($.id, { values: s });
779
675
  }
780
676
  };
781
- var Mn = Object.defineProperty, Tn = Object.getOwnPropertyDescriptor, xn = (e, t, r, n) => {
782
- for (var s = n > 1 ? void 0 : n ? Tn(t, r) : t, i = e.length - 1, a; i >= 0; i--)
783
- (a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
784
- return n && s && Mn(t, r, s), s;
785
- }, x = (e, t) => (r, n) => t(r, n, e);
786
- let ue = class extends X {
787
- constructor(t, r, n, s, i, a, o, l, u, d, c) {
677
+ var gn = Object.defineProperty, _n = Object.getOwnPropertyDescriptor, Sn = (e, t, r, n) => {
678
+ for (var s = n > 1 ? void 0 : n ? _n(t, r) : t, i = e.length - 1, o; i >= 0; i--)
679
+ (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
680
+ return n && s && gn(t, r, s), s;
681
+ }, M = (e, t) => (r, n) => t(r, n, e);
682
+ let ue = class extends Y {
683
+ constructor(t, r, n, s, i, o, a, l, u, m, c) {
788
684
  super();
789
685
  /**
790
686
  * If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
@@ -792,54 +688,54 @@ let ue = class extends X {
792
688
  * @type {(string | null)}
793
689
  * @memberof NumfmtController
794
690
  */
795
- U(this, "_previewPattern", "");
796
- U(this, "_sidebarDisposable", null);
797
- this._sheetInterceptorService = t, this._themeService = r, this._univerInstanceService = n, this._sheetSkeletonManagerService = s, this._commandService = i, this._selectionManagerService = a, this._renderManagerService = o, this._numfmtService = l, this._componentManager = u, this._sidebarService = d, this._localeService = c, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener();
691
+ L(this, "_previewPattern", "");
692
+ L(this, "_sidebarDisposable", null);
693
+ this._sheetInterceptorService = t, this._themeService = r, this._univerInstanceService = n, this._sheetSkeletonManagerService = s, this._commandService = i, this._selectionManagerService = o, this._renderManagerService = a, this._numfmtService = l, this._componentManager = u, this._sidebarService = m, this._localeService = c, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener();
798
694
  }
799
695
  openPanel() {
800
- const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, s = this._univerInstanceService, i = this._numfmtService, a = this._localeService, l = (r.getSelectionRanges() || [])[0];
696
+ const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, s = this._univerInstanceService, i = this._numfmtService, o = this._localeService, l = (r.getSelectionRanges() || [])[0];
801
697
  if (!l)
802
698
  return !1;
803
- const u = s.getCurrentUnitForType(R.UNIVER_SHEET), d = u.getActiveSheet(), c = d.getCellRaw(l.startRow, l.startColumn), h = i.getValue(
699
+ const u = s.getCurrentUnitForType(E.UNIVER_SHEET), m = u.getActiveSheet(), c = m.getCellRaw(l.startRow, l.startColumn), f = i.getValue(
804
700
  u.getUnitId(),
805
- d.getSheetId(),
701
+ m.getSheetId(),
806
702
  l.startRow,
807
703
  l.startColumn
808
704
  );
809
705
  let _ = "";
810
- h && (_ = h.pattern);
811
- const v = (c == null ? void 0 : c.t) === z.NUMBER ? c.v : 12345678, f = {
706
+ f && (_ = f.pattern);
707
+ const g = (c == null ? void 0 : c.t) === B.NUMBER ? c.v : 12345678, h = {
812
708
  onChange: (p) => {
813
- var g, C;
709
+ var v, b;
814
710
  if (p.type === "change")
815
- this._previewPattern = p.value, this._sheetSkeletonManagerService.reCalculate(), (C = (g = this._renderManagerService.getRenderById(u.getUnitId())) == null ? void 0 : g.mainComponent) == null || C.makeDirty();
711
+ this._previewPattern = p.value, this._sheetSkeletonManagerService.reCalculate(), (b = (v = this._renderManagerService.getRenderById(u.getUnitId())) == null ? void 0 : v.mainComponent) == null || b.makeDirty();
816
712
  else if (p.type === "confirm") {
817
- const O = r.getSelectionRanges() || [], D = { values: [] }, w = pe(p.value);
818
- O.forEach((ye) => {
819
- E.foreach(ye, (be, y) => {
820
- D.values.push({
821
- row: be,
713
+ const F = r.getSelectionRanges() || [], ce = { values: [] }, be = fe(p.value);
714
+ F.forEach((ye) => {
715
+ P.foreach(ye, (Ce, y) => {
716
+ ce.values.push({
717
+ row: Ce,
822
718
  col: y,
823
719
  pattern: p.value,
824
- type: w
720
+ type: be
825
721
  });
826
722
  });
827
- }), n.executeCommand(A.id, D), t.close();
723
+ }), n.executeCommand($.id, ce), t.close();
828
724
  } else
829
725
  p.type === "cancel" && t.close();
830
726
  },
831
- value: { defaultPattern: _, defaultValue: v, row: l.startRow, col: l.startColumn }
727
+ value: { defaultPattern: _, defaultValue: g, row: l.startRow, col: l.startColumn }
832
728
  };
833
729
  return this._sidebarDisposable = t.open({
834
- header: { title: a.t("sheet.numfmt.title") },
730
+ header: { title: o.t("sheet.numfmt.title") },
835
731
  children: {
836
- label: xe,
837
- ...f
732
+ label: Ne,
733
+ ...h
838
734
  // need passthrough to react props.
839
735
  },
840
736
  onClose: () => {
841
- var p, g;
842
- this._sheetSkeletonManagerService.reCalculate(), (g = (p = this._renderManagerService.getRenderById(u.getUnitId())) == null ? void 0 : p.mainComponent) == null || g.makeDirty(), n.executeCommand(Ie.id);
737
+ var p, v;
738
+ this._sheetSkeletonManagerService.reCalculate(), (v = (p = this._renderManagerService.getRenderById(u.getUnitId())) == null ? void 0 : p.mainComponent) == null || v.makeDirty(), n.executeCommand(Ie.id);
843
739
  }
844
740
  }), !0;
845
741
  }
@@ -848,86 +744,86 @@ let ue = class extends X {
848
744
  et,
849
745
  rt,
850
746
  nt,
851
- ot,
852
- ve,
747
+ at,
748
+ pe,
853
749
  Ie,
854
- A
750
+ $
855
751
  ].forEach((t) => {
856
752
  this.disposeWithMe(this._commandService.registerCommand(t));
857
753
  });
858
754
  }
859
755
  _initPanel() {
860
- this._componentManager.register(xe, In);
756
+ this._componentManager.register(Ne, vn);
861
757
  }
862
758
  _initRealTimeRenderingInterceptor() {
863
- const t = new J((n) => {
759
+ const t = new G((n) => {
864
760
  this._commandService.onCommandExecuted((s) => {
865
- s.id === ve.id && n.next(!0), s.id === Ie.id && n.next(!1);
761
+ s.id === pe.id && n.next(!0), s.id === Ie.id && n.next(!1);
866
762
  });
867
- }), r = Vt([
763
+ }), r = Ut([
868
764
  t,
869
765
  this._selectionManagerService.selectionMoveEnd$.pipe(
870
- Ye((n) => n ? n.map((s) => s.range) : [])
766
+ qe((n) => n ? n.map((s) => s.range) : [])
871
767
  )
872
768
  ]);
873
769
  this.disposeWithMe(
874
- Q(
770
+ K(
875
771
  r.pipe(
876
- Et(
877
- ([n, s]) => new J((i) => {
878
- const a = new Tt();
879
- return n && s.length && i.next({ selectionRanges: s, disposableCollection: a }), () => {
880
- a.dispose();
772
+ Pt(
773
+ ([n, s]) => new G((i) => {
774
+ const o = new yt();
775
+ return n && s.length && i.next({ selectionRanges: s, disposableCollection: o }), () => {
776
+ o.dispose();
881
777
  };
882
778
  })
883
779
  ),
884
- jt(() => {
780
+ xt(() => {
885
781
  this._previewPattern = null;
886
782
  })
887
783
  ).subscribe(({ disposableCollection: n, selectionRanges: s }) => {
888
- var a, o;
889
- const i = this._univerInstanceService.getCurrentUnitForType(R.UNIVER_SHEET);
784
+ var o, a;
785
+ const i = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SHEET);
890
786
  this.openPanel(), n.add(
891
- this._sheetInterceptorService.intercept(Ze.CELL_CONTENT, {
787
+ this._sheetInterceptorService.intercept(Ke.CELL_CONTENT, {
892
788
  priority: 99,
893
- handler: (l, u, d) => {
894
- const { row: c, col: h } = u, _ = d(l) || {};
789
+ handler: (l, u, m) => {
790
+ const { row: c, col: f } = u, _ = m(l) || {};
895
791
  if (s.find(
896
- (v) => v.startColumn <= h && v.endColumn >= h && v.startRow <= c && v.endRow >= c
792
+ (g) => g.startColumn <= f && g.endColumn >= f && g.startRow <= c && g.endRow >= c
897
793
  )) {
898
- const v = u.worksheet.getCellRaw(c, h), f = v == null ? void 0 : v.v, p = v == null ? void 0 : v.t;
899
- if (f == null || p !== z.NUMBER || this._previewPattern === null)
794
+ const g = u.worksheet.getCellRaw(c, f), h = g == null ? void 0 : g.v, p = g == null ? void 0 : g.t;
795
+ if (h == null || p !== B.NUMBER || this._previewPattern === null)
900
796
  return _;
901
- const g = Le(this._previewPattern, f, this._localeService.getCurrentLocale());
902
- if (g.color) {
903
- const O = this._themeService.getCurrentTheme()[`${g.color}500`];
797
+ const v = De(this._previewPattern, h, this._localeService.getCurrentLocale());
798
+ if (v.color) {
799
+ const F = this._themeService.getCurrentTheme()[`${v.color}500`];
904
800
  return {
905
801
  ..._,
906
- v: g.result,
907
- t: z.STRING,
908
- s: { cl: { rgb: O } }
802
+ v: v.result,
803
+ t: B.STRING,
804
+ s: { cl: { rgb: F } }
909
805
  };
910
806
  }
911
807
  return {
912
808
  ..._,
913
- v: g.result,
914
- t: z.STRING
809
+ v: v.result,
810
+ t: B.STRING
915
811
  };
916
812
  }
917
813
  return _;
918
814
  }
919
815
  })
920
- ), (o = (a = this._renderManagerService.getRenderById(i.getUnitId())) == null ? void 0 : a.mainComponent) == null || o.makeDirty();
816
+ ), (a = (o = this._renderManagerService.getRenderById(i.getUnitId())) == null ? void 0 : o.mainComponent) == null || a.makeDirty();
921
817
  })
922
818
  )
923
819
  );
924
820
  }
925
821
  _commandExecutedListener() {
926
- const t = [_e.id, te.id];
822
+ const t = [ge.id, J.id];
927
823
  this.disposeWithMe(
928
- Q(
929
- Qe(
930
- new J((r) => {
824
+ K(
825
+ Ze(
826
+ new G((r) => {
931
827
  const n = this._commandService.onCommandExecuted((s) => {
932
828
  if (t.includes(s.id)) {
933
829
  const i = s.params;
@@ -938,7 +834,7 @@ let ue = class extends X {
938
834
  n.dispose();
939
835
  };
940
836
  })
941
- ).pipe($t(16)).subscribe((r) => {
837
+ ).pipe(Ot(16)).subscribe((r) => {
942
838
  var n, s;
943
839
  this._sheetSkeletonManagerService.reCalculate(), (s = (n = this._renderManagerService.getRenderById(r)) == null ? void 0 : n.mainComponent) == null || s.makeDirty();
944
840
  })
@@ -946,63 +842,63 @@ let ue = class extends X {
946
842
  );
947
843
  }
948
844
  _initCloseListener() {
949
- this._univerInstanceService.getCurrentTypeOfUnit$(R.UNIVER_SHEET).subscribe((t) => {
845
+ this._univerInstanceService.getCurrentTypeOfUnit$(E.UNIVER_SHEET).subscribe((t) => {
950
846
  var r;
951
847
  t || ((r = this._sidebarDisposable) == null || r.dispose(), this._sidebarDisposable = null);
952
848
  });
953
849
  }
954
850
  };
955
- ue = xn([
956
- ee(K.Rendered, ue),
957
- x(0, S(Oe)),
958
- x(1, S(ze)),
959
- x(2, W),
960
- x(3, S(qe)),
961
- x(4, $),
962
- x(5, S(H)),
963
- x(6, wt),
964
- x(7, G),
965
- x(8, S(Je)),
966
- x(9, Ut),
967
- x(10, S(T))
851
+ ue = Sn([
852
+ q(V.Rendered, ue),
853
+ M(0, S(Pe)),
854
+ M(1, S(Fe)),
855
+ M(2, k),
856
+ M(3, S(Ye)),
857
+ M(4, O),
858
+ M(5, S(D)),
859
+ M(6, jt),
860
+ M(7, H),
861
+ M(8, S(Je)),
862
+ M(9, wt),
863
+ M(10, S(T))
968
864
  ], ue);
969
- var Nn = Object.defineProperty, Rn = Object.getOwnPropertyDescriptor, On = (e, t, r, n) => {
970
- for (var s = n > 1 ? void 0 : n ? Rn(t, r) : t, i = e.length - 1, a; i >= 0; i--)
971
- (a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
972
- return n && s && Nn(t, r, s), s;
973
- }, Y = (e, t) => (r, n) => t(r, n, e);
974
- const Dn = () => {
865
+ var bn = Object.defineProperty, yn = Object.getOwnPropertyDescriptor, Cn = (e, t, r, n) => {
866
+ for (var s = n > 1 ? void 0 : n ? yn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
867
+ (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
868
+ return n && s && bn(t, r, s), s;
869
+ }, W = (e, t) => (r, n) => t(r, n, e);
870
+ const In = () => {
975
871
  let e = [];
976
872
  return {
977
- add: (s, i, a, o, l) => e.push({ unitId: s, subUnitId: i, row: a, col: o, value: l }),
873
+ add: (s, i, o, a, l) => e.push({ unitId: s, subUnitId: i, row: o, col: a, value: l }),
978
874
  getEffects: () => e,
979
875
  clean: () => {
980
876
  e = [];
981
877
  }
982
878
  };
983
879
  };
984
- let me = class extends X {
880
+ let me = class extends Y {
985
881
  constructor(t, r, n, s, i) {
986
882
  super();
987
883
  // collect effect mutations when edit end and push this to commands stack in next commands progress
988
- U(this, "_collectEffectMutation", Dn());
884
+ L(this, "_collectEffectMutation", In());
989
885
  this._sheetInterceptorService = t, this._numfmtService = r, this._univerInstanceService = n, this._injector = s, this._editorBridgeService = i, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
990
886
  }
991
887
  _initInterceptorEditorStart() {
992
888
  this.disposeWithMe(
993
- Q(
889
+ K(
994
890
  this._editorBridgeService.interceptor.intercept(
995
891
  this._editorBridgeService.interceptor.getInterceptPoints().BEFORE_CELL_EDIT,
996
892
  {
997
893
  handler: (t, r, n) => {
998
- const s = r.row, i = r.col, a = this._numfmtService.getValue(
894
+ const s = r.row, i = r.col, o = this._numfmtService.getValue(
999
895
  r.unitId,
1000
896
  r.subUnitId,
1001
897
  s,
1002
898
  i
1003
899
  );
1004
- if (a)
1005
- switch (pe(a.pattern)) {
900
+ if (o)
901
+ switch (fe(o.pattern)) {
1006
902
  case "scientific":
1007
903
  case "percent":
1008
904
  case "currency":
@@ -1029,19 +925,19 @@ let me = class extends X {
1029
925
  */
1030
926
  _initInterceptorEditorEnd() {
1031
927
  this.disposeWithMe(
1032
- Q(
928
+ K(
1033
929
  this._editorBridgeService.interceptor.intercept(
1034
930
  this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,
1035
931
  {
1036
932
  handler: (t, r, n) => {
1037
- var d;
933
+ var m;
1038
934
  this._collectEffectMutation.clean();
1039
935
  const s = this._numfmtService.getValue(
1040
936
  r.unitId,
1041
937
  r.subUnitId,
1042
938
  r.row,
1043
939
  r.col
1044
- ), i = (d = s && pe(s.pattern)) != null ? d : "", a = () => {
940
+ ), i = (m = s && fe(s.pattern)) != null ? m : "", o = () => {
1045
941
  s && this._collectEffectMutation.add(
1046
942
  r.unitId,
1047
943
  r.subUnitId,
@@ -1052,7 +948,7 @@ let me = class extends X {
1052
948
  };
1053
949
  if (!(t != null && t.v))
1054
950
  return n(t);
1055
- const o = String(t.v), l = j.parseDate(o) || j.parseTime(o);
951
+ const a = String(t.v), l = x.parseDate(a) || x.parseTime(a);
1056
952
  if (!!l) {
1057
953
  if (l && l.z) {
1058
954
  const c = Number(l.v);
@@ -1064,10 +960,10 @@ let me = class extends X {
1064
960
  {
1065
961
  pattern: l.z
1066
962
  }
1067
- ), { ...t, v: c, t: z.NUMBER };
963
+ ), { ...t, v: c, t: B.NUMBER };
1068
964
  }
1069
965
  } else
1070
- (["date", "time", "datetime"].includes(i) || !Pn(o)) && a();
966
+ (["date", "time", "datetime"].includes(i) || !Tn(a)) && o();
1071
967
  return n(t);
1072
968
  }
1073
969
  }
@@ -1081,50 +977,50 @@ let me = class extends X {
1081
977
  this._sheetInterceptorService.interceptCommand({
1082
978
  getMutations(r) {
1083
979
  switch (r.id) {
1084
- case Nt.id: {
1085
- const n = t._univerInstanceService.getCurrentUnitForType(R.UNIVER_SHEET), s = n.getUnitId(), i = n.getActiveSheet().getSheetId(), a = t._collectEffectMutation.getEffects();
1086
- if (!a.length)
980
+ case Tt.id: {
981
+ const n = t._univerInstanceService.getCurrentUnitForType(E.UNIVER_SHEET), s = n.getUnitId(), i = n.getActiveSheet().getSheetId(), o = t._collectEffectMutation.getEffects();
982
+ if (!o.length)
1087
983
  return {
1088
984
  redos: [],
1089
985
  undos: []
1090
986
  };
1091
- const o = a.filter((c) => {
1092
- var h;
1093
- return !!((h = c.value) != null && h.pattern);
987
+ const a = o.filter((c) => {
988
+ var f;
989
+ return !!((f = c.value) != null && f.pattern);
1094
990
  }).map((c) => ({
1095
991
  row: c.row,
1096
992
  col: c.col,
1097
993
  pattern: c.value.pattern
1098
- })), l = a.filter((c) => {
1099
- var h;
1100
- return !((h = c.value) != null && h.pattern);
994
+ })), l = o.filter((c) => {
995
+ var f;
996
+ return !((f = c.value) != null && f.pattern);
1101
997
  }).map((c) => ({
1102
998
  startRow: c.row,
1103
999
  endColumn: c.col,
1104
1000
  startColumn: c.col,
1105
1001
  endRow: c.row
1106
- })), u = [], d = [];
1107
- if (o) {
1002
+ })), u = [], m = [];
1003
+ if (a) {
1108
1004
  const c = {
1109
- id: te.id,
1110
- params: We(s, i, o)
1005
+ id: J.id,
1006
+ params: We(s, i, a)
1111
1007
  };
1112
- u.push(c), d.push(...Ke(t._injector, c.params));
1008
+ u.push(c), m.push(...Ge(t._injector, c.params));
1113
1009
  }
1114
1010
  if (l) {
1115
1011
  const c = {
1116
- id: _e.id,
1012
+ id: ge.id,
1117
1013
  params: {
1118
1014
  unitId: s,
1119
1015
  subUnitId: i,
1120
1016
  ranges: l
1121
1017
  }
1122
1018
  };
1123
- u.push(c), d.push(...Ge(t._injector, c.params));
1019
+ u.push(c), m.push(...ze(t._injector, c.params));
1124
1020
  }
1125
1021
  return {
1126
1022
  redos: u,
1127
- undos: d.reverse()
1023
+ undos: m.reverse()
1128
1024
  };
1129
1025
  }
1130
1026
  }
@@ -1137,125 +1033,32 @@ let me = class extends X {
1137
1033
  );
1138
1034
  }
1139
1035
  };
1140
- me = On([
1141
- ee(K.Rendered, me),
1142
- Y(0, S(Oe)),
1143
- Y(1, S(G)),
1144
- Y(2, S(W)),
1145
- Y(3, S(De)),
1146
- Y(4, S(Ot))
1036
+ me = Cn([
1037
+ q(V.Rendered, me),
1038
+ W(0, S(Pe)),
1039
+ W(1, S(H)),
1040
+ W(2, S(k)),
1041
+ W(3, S(xe)),
1042
+ W(4, S(Nt))
1147
1043
  ], me);
1148
- function Pn(e) {
1044
+ function Tn(e) {
1149
1045
  return /^-?\d+(\.\d+)?$/.test(e);
1150
1046
  }
1151
- var En = Object.defineProperty, jn = Object.getOwnPropertyDescriptor, $n = (e, t, r, n) => {
1152
- for (var s = n > 1 ? void 0 : n ? jn(t, r) : t, i = e.length - 1, a; i >= 0; i--)
1153
- (a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
1154
- return n && s && En(t, r, s), s;
1155
- }, wn = (e, t) => (r, n) => t(r, n, e);
1156
- let de = class extends X {
1157
- constructor(t) {
1158
- super();
1159
- U(this, "_initLocal", () => {
1160
- this._localeService.load({ zhCN: Kt, enUS: zt });
1161
- });
1162
- this._localeService = t, this._initLocal();
1047
+ var Mn = Object.defineProperty, Nn = Object.getOwnPropertyDescriptor, En = (e, t, r, n) => {
1048
+ for (var s = n > 1 ? void 0 : n ? Nn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
1049
+ (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
1050
+ return n && s && Mn(t, r, s), s;
1051
+ }, Rn = (e, t) => (r, n) => t(r, n, e);
1052
+ let de = class extends Y {
1053
+ constructor(e) {
1054
+ super(), this._localeService = e;
1163
1055
  }
1164
1056
  };
1165
- de = $n([
1166
- ee(K.Rendered, de),
1167
- wn(0, S(T))
1057
+ de = En([
1058
+ q(V.Rendered, de),
1059
+ Rn(0, S(T))
1168
1060
  ], de);
1169
- var I = function() {
1170
- return I = Object.assign || function(e) {
1171
- for (var t, r = 1, n = arguments.length; r < n; r++) {
1172
- t = arguments[r];
1173
- for (var s in t)
1174
- Object.prototype.hasOwnProperty.call(t, s) && (e[s] = t[s]);
1175
- }
1176
- return e;
1177
- }, I.apply(this, arguments);
1178
- }, Ln = function(e, t) {
1179
- var r = {};
1180
- for (var n in e)
1181
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
1182
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1183
- for (var s = 0, n = Object.getOwnPropertySymbols(e); s < n.length; s++)
1184
- t.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[s]) && (r[n[s]] = e[n[s]]);
1185
- return r;
1186
- }, q = Z(function(e, t) {
1187
- var r = e.icon, n = e.id, s = e.className, i = e.extend, a = Ln(e, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(n, " ").concat(s || "").trim(), l = Ee("_".concat(Vn()));
1188
- return lt(r, "".concat(n), { defIds: r.defIds, idSuffix: l.current }, I({ ref: t, className: o }, a), i);
1189
- });
1190
- function lt(e, t, r, n, s) {
1191
- return B(e.tag, I(I({ key: t }, Un(e, r, s)), n), (An(e, r).children || []).map(function(i, a) {
1192
- return lt(i, "".concat(t, "-").concat(e.tag, "-").concat(a), r, void 0, s);
1193
- }));
1194
- }
1195
- function Un(e, t, r) {
1196
- var n = I({}, e.attrs);
1197
- r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
1198
- var s = t.defIds;
1199
- return !s || s.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(i) {
1200
- var a = i[0], o = i[1];
1201
- typeof o == "string" && (n[a] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
1202
- })), n;
1203
- }
1204
- function An(e, t) {
1205
- var r, n = t.defIds;
1206
- return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ? I(I({}, e), { children: e.children.map(function(s) {
1207
- 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 + t.idSuffix }) }) : s;
1208
- }) }) : e;
1209
- }
1210
- function Vn() {
1211
- return Math.random().toString(36).substring(2, 8);
1212
- }
1213
- q.displayName = "UniverIcon";
1214
- var Hn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.99988 3.60921C3.99988 2.32055 5.04456 1.27588 6.33321 1.27588 7.62187 1.27588 8.66654 2.32055 8.66654 3.60921V6.24136C8.66654 7.53002 7.62187 8.5747 6.33321 8.5747 5.04455 8.5747 3.99988 7.53002 3.99988 6.24136V3.60921zM6.33321 2.60921C5.78093 2.60921 5.33321 3.05693 5.33321 3.60921V6.24136C5.33321 6.79364 5.78093 7.24136 6.33321 7.24136 6.88549 7.24136 7.33321 6.79364 7.33321 6.24136V3.60921C7.33321 3.05693 6.88549 2.60921 6.33321 2.60921zM9.99988 3.60921C9.99988 2.32055 11.0446 1.27588 12.3332 1.27588 13.6219 1.27588 14.6665 2.32055 14.6665 3.60921V6.24136C14.6665 7.53002 13.6219 8.5747 12.3332 8.5747 11.0446 8.5747 9.99988 7.53002 9.99988 6.24136V3.60921zM12.3332 2.60921C11.7809 2.60921 11.3332 3.05693 11.3332 3.60921V6.24136C11.3332 6.79364 11.7809 7.24136 12.3332 7.24136 12.8855 7.24136 13.3332 6.79364 13.3332 6.24136V3.60921C13.3332 3.05693 12.8855 2.60921 12.3332 2.60921z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M12.4713 9.58625C12.211 9.3259 11.7889 9.3259 11.5285 9.58625 11.2682 9.8466 11.2682 10.2687 11.5285 10.5291L12.3904 11.391H6.33329C5.9651 11.391 5.66663 11.6895 5.66663 12.0577 5.66663 12.4258 5.9651 12.7243 6.33329 12.7243H12.3904L11.5285 13.5862C11.2682 13.8466 11.2682 14.2687 11.5285 14.5291 11.7889 14.7894 12.211 14.7894 12.4713 14.5291L14.4669 12.5335C14.4851 12.5156 14.5022 12.4968 14.5183 12.477 14.5484 12.4399 14.5739 12.4003 14.5948 12.359 14.6407 12.2685 14.6666 12.1661 14.6666 12.0577 14.6666 11.9492 14.6407 11.8468 14.5948 11.7563 14.5739 11.715 14.5484 11.6754 14.5183 11.6383 14.5022 11.6185 14.4851 11.5997 14.4669 11.5818L12.4713 9.58625zM1.33325 7.98825C1.33325 7.62006 1.63173 7.32159 1.99992 7.32159H2.33325C2.70144 7.32159 2.99992 7.62006 2.99992 7.98825 2.99992 8.35644 2.70144 8.65492 2.33325 8.65492H1.99992C1.63173 8.65492 1.33325 8.35644 1.33325 7.98825z" } }] }, ut = Z(function(e, t) {
1215
- return B(q, Object.assign({}, e, {
1216
- id: "add-digits-single",
1217
- ref: t,
1218
- icon: Hn
1219
- }));
1220
- });
1221
- ut.displayName = "AddDigitsSingle";
1222
- const Bn = ut;
1223
- var kn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_102_556", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_102_556)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M0.629584 3.99986C1.13729 3.4922 1.9604 3.49224 2.46806 3.99995L7.57569 9.10806C7.81 9.3424 8.18992 9.3424 8.42424 9.10808L13.5323 3.99998C14.04 3.4923 14.8631 3.4923 15.3708 3.99998C15.8785 4.50766 15.8785 5.33078 15.3708 5.83846L9.41415 11.7951C8.63307 12.5762 7.36669 12.5762 6.58565 11.7951L0.629497 5.83834C0.121839 5.33063 0.121879 4.50752 0.629584 3.99986Z", fillRule: "evenodd", clipRule: "evenodd" } }] }] }, mt = Z(function(e, t) {
1224
- return B(q, Object.assign({}, e, {
1225
- id: "more-down-single",
1226
- ref: t,
1227
- icon: kn
1228
- }));
1229
- });
1230
- mt.displayName = "MoreDownSingle";
1231
- const Fn = mt;
1232
- var zn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_561_2", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { fill: "currentColor", mask: "url(#mask0_561_2)", fillRule: "evenodd", clipRule: "evenodd" }, children: [{ tag: "path", attrs: { d: "M4.91876 2.65039C3.66601 2.65039 2.65045 3.66595 2.65045 4.9187 2.65045 6.17146 3.66601 7.18702 4.91876 7.18702 6.17152 7.18702 7.18708 6.17146 7.18708 4.9187 7.18708 3.66595 6.17152 2.65039 4.91876 2.65039zM3.94663 4.9187C3.94663 4.38181 4.38187 3.94657 4.91876 3.94657 5.45566 3.94657 5.8909 4.38181 5.8909 4.9187 5.8909 5.4556 5.45566 5.89084 4.91876 5.89084 4.38187 5.89084 3.94663 5.4556 3.94663 4.9187zM11.0812 8.81299C9.82842 8.81299 8.81286 9.82855 8.81286 11.0813 8.81286 12.3341 9.82842 13.3496 11.0812 13.3496 12.3339 13.3496 13.3495 12.3341 13.3495 11.0813 13.3495 9.82855 12.3339 8.81299 11.0812 8.81299zM10.109 11.0813C10.109 10.5444 10.5443 10.1092 11.0812 10.1092 11.6181 10.1092 12.0533 10.5444 12.0533 11.0813 12.0533 11.6182 11.6181 12.0534 11.0812 12.0534 10.5443 12.0534 10.109 11.6182 10.109 11.0813zM13.1597 2.84021C13.4128 3.09331 13.4128 3.50365 13.1597 3.75675L3.7568 13.1596C3.5037 13.4127 3.09336 13.4127 2.84026 13.1596 2.58717 12.9065 2.58717 12.4962 2.84026 12.2431L12.2431 2.84021C12.4962 2.58712 12.9066 2.58712 13.1597 2.84021z" } }] }] }, dt = Z(function(e, t) {
1233
- return B(q, Object.assign({}, e, {
1234
- id: "percent-single",
1235
- ref: t,
1236
- icon: zn
1237
- }));
1238
- });
1239
- dt.displayName = "PercentSingle";
1240
- const Wn = dt;
1241
- var Kn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5 3.61825C5 2.32958 6.04468 1.28491 7.33333 1.28491C8.62199 1.28491 9.66667 2.32958 9.66667 3.61825V6.30787C9.66667 7.59653 8.62199 8.64121 7.33333 8.64121C6.04468 8.64121 5 7.59653 5 6.30787V3.61825ZM7.33333 2.61825C6.78105 2.61825 6.33333 3.06596 6.33333 3.61825V6.30787C6.33333 6.86015 6.78106 7.30787 7.33333 7.30787C7.88561 7.30787 8.33333 6.86015 8.33333 6.30787V3.61825C8.33333 3.06596 7.88561 2.61825 7.33333 2.61825Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2 7.9745C2 7.60631 2.29848 7.30783 2.66667 7.30783H3C3.36819 7.30783 3.66667 7.60631 3.66667 7.9745 3.66667 8.34269 3.36819 8.64117 3 8.64117H2.66667C2.29848 8.64117 2 8.34269 2 7.9745zM8.80482 9.56197C9.06517 9.82232 9.06517 10.2444 8.80482 10.5048L7.94289 11.3667H13.3334C13.7016 11.3667 14.0001 11.6652 14.0001 12.0334 14.0001 12.4016 13.7016 12.7 13.3334 12.7H7.94289L8.80482 13.562C9.06517 13.8223 9.06517 14.2444 8.80482 14.5048 8.54447 14.7651 8.12236 14.7651 7.86201 14.5048L5.86201 12.5048C5.79809 12.4409 5.74987 12.3672 5.71733 12.2886 5.68474 12.21 5.66675 12.1238 5.66675 12.0334 5.66675 11.943 5.68474 11.8568 5.71733 11.7782 5.74987 11.6996 5.79809 11.6259 5.86201 11.562L7.86201 9.56197C8.12236 9.30162 8.54447 9.30162 8.80482 9.56197z" } }] }, ft = Z(function(e, t) {
1242
- return B(q, Object.assign({}, e, {
1243
- id: "reduce-digits-single",
1244
- ref: t,
1245
- icon: Kn
1246
- }));
1247
- });
1248
- ft.displayName = "ReduceDigitsSingle";
1249
- const Gn = ft;
1250
- var Zn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.05443 1.55744C4.34898 1.33653 4.76685 1.39623 4.98776 1.69078L7.99996 5.98276L11.0122 1.69078C11.2331 1.39623 11.6509 1.33653 11.9455 1.55744C12.24 1.77836 12.2997 2.19623 12.0788 2.49078L9.33338 6.42708H12.0788C12.447 6.42708 12.7455 6.72556 12.7455 7.09375C12.7455 7.46194 12.447 7.76042 12.0788 7.76042H8.66659V9.69702H12.3348C12.703 9.69702 13.0015 9.9955 13.0015 10.3637C13.0015 10.7319 12.703 11.0304 12.3348 11.0304H8.66659V13.9091C8.66659 14.2773 8.36811 14.5758 7.99992 14.5758C7.63173 14.5758 7.33325 14.2773 7.33325 13.9091V11.0304H3.66508C3.29689 11.0304 2.99841 10.7319 2.99841 10.3637C2.99841 9.9955 3.29689 9.69702 3.66508 9.69702H7.33325V7.76042H3.92109C3.5529 7.76042 3.25443 7.46194 3.25443 7.09375C3.25443 6.72556 3.5529 6.42708 3.92109 6.42708H6.66653L3.92109 2.49078C3.70018 2.19623 3.75987 1.77836 4.05443 1.55744Z" } }] }, ht = Z(function(e, t) {
1251
- return B(q, Object.assign({}, e, {
1252
- id: "rmb-single",
1253
- ref: t,
1254
- icon: Zn
1255
- }));
1256
- });
1257
- ht.displayName = "RmbSingle";
1258
- const qn = ht, fe = [
1061
+ const he = [
1259
1062
  {
1260
1063
  label: "sheet.numfmt.general",
1261
1064
  pattern: null
@@ -1308,30 +1111,30 @@ const qn = ht, fe = [
1308
1111
  label: "sheet.numfmt.moreFmt",
1309
1112
  pattern: ""
1310
1113
  }
1311
- ], Yn = (e) => {
1114
+ ], lt = "sheet.numfmt.moreNumfmtType", ut = "sheet.numfmt.moreNumfmtType.options", Pn = (e) => {
1312
1115
  var n;
1313
1116
  const t = N(T), r = (n = e.value) != null ? n : t.t("sheet.numfmt.general");
1314
- return /* @__PURE__ */ m.jsx("span", { className: "more-numfmt-type", children: r });
1315
- }, Jn = () => {
1316
- const e = N($), t = N(T), r = kt(), n = N(H), s = (o) => {
1117
+ return /* @__PURE__ */ d.jsx("span", { className: "more-numfmt-type", children: r });
1118
+ }, xn = () => {
1119
+ const e = N(O), t = N(T), r = kt(), n = N(D), s = (a) => {
1317
1120
  const l = n.getLast();
1318
1121
  if (!l)
1319
1122
  return;
1320
- const u = r.get(Lt), d = l.range, c = [];
1321
- E.foreach(d, (h, _) => {
1322
- o ? c.push({ row: h, col: _, pattern: o, type: pe(o) }) : c.push({ row: h, col: _ });
1323
- }), e.executeCommand(A.id, { values: c }), u.focus();
1324
- }, i = (o) => {
1325
- if (o === 0)
1123
+ const u = r.get($t), m = l.range, c = [];
1124
+ P.foreach(m, (f, _) => {
1125
+ a ? c.push({ row: f, col: _, pattern: a, type: fe(a) }) : c.push({ row: f, col: _ });
1126
+ }), e.executeCommand($.id, { values: c }), u.focus();
1127
+ }, i = (a) => {
1128
+ if (a === 0)
1326
1129
  s(null);
1327
- else if (o === fe.length - 1)
1328
- e.executeCommand(ve.id);
1130
+ else if (a === he.length - 1)
1131
+ e.executeCommand(pe.id);
1329
1132
  else {
1330
- const l = fe[o];
1133
+ const l = he[a];
1331
1134
  l.pattern && s(l.pattern);
1332
1135
  }
1333
- }, a = 1220;
1334
- return /* @__PURE__ */ m.jsx("div", { className: "more-numfmt-type-options", children: fe.map((o, l) => o === "|" ? /* @__PURE__ */ m.jsx("div", { className: "line m-t-4", onClick: (u) => u.stopPropagation() }, l) : /* @__PURE__ */ m.jsxs(
1136
+ }, o = 1220;
1137
+ return /* @__PURE__ */ d.jsx("div", { className: "more-numfmt-type-options", children: he.map((a, l) => a === "|" ? /* @__PURE__ */ d.jsx("div", { className: "line m-t-4", onClick: (u) => u.stopPropagation() }, l) : /* @__PURE__ */ d.jsxs(
1335
1138
  "div",
1336
1139
  {
1337
1140
  className: "option-item m-t-4",
@@ -1339,154 +1142,145 @@ const qn = ht, fe = [
1339
1142
  i(l);
1340
1143
  },
1341
1144
  children: [
1342
- /* @__PURE__ */ m.jsx("div", { children: t.t(o.label) }),
1343
- /* @__PURE__ */ m.jsx("div", { className: "m-l-26", children: o.pattern ? Le(o.pattern || "", a, t.getCurrentLocale()).result : "" })
1145
+ /* @__PURE__ */ d.jsx("div", { children: t.t(a.label) }),
1146
+ /* @__PURE__ */ d.jsx("div", { className: "m-l-26", children: a.pattern ? De(a.pattern || "", o, t.getCurrentLocale()).result : "" })
1344
1147
  ]
1345
1148
  },
1346
1149
  l
1347
1150
  )) });
1348
- }, Qn = (e) => {
1349
- const t = "icon-rmbSingle";
1350
- return e.register(t, qn), e.register("MoreDownSingle", Fn), (r) => ({
1351
- icon: t,
1352
- id: nt.id,
1353
- title: "sheet.numfmt.currency",
1354
- tooltip: "sheet.numfmt.currency",
1355
- type: re.BUTTON,
1356
- group: se.TOOLBAR_FORMULAS_INSERT,
1357
- positions: [ie.TOOLBAR_START],
1358
- hidden$: ae(r, R.UNIVER_SHEET),
1359
- disabled$: ne(r)
1360
- });
1361
- }, Xn = (e) => {
1362
- const t = "icon-addDigitsSingle";
1363
- return e.register(t, Bn), (r) => ({
1364
- icon: t,
1365
- id: et.id,
1366
- title: "sheet.numfmt.addDecimal",
1367
- tooltip: "sheet.numfmt.addDecimal",
1368
- type: re.BUTTON,
1369
- positions: [ie.TOOLBAR_START],
1370
- group: se.TOOLBAR_FORMULAS_INSERT,
1371
- hidden$: ae(r, R.UNIVER_SHEET),
1372
- disabled$: ne(r)
1373
- });
1374
- }, er = (e) => {
1375
- const t = "icon-reduceDigitsSingle";
1376
- return e.register(t, Gn), (r) => ({
1377
- icon: t,
1378
- id: rt.id,
1379
- title: "sheet.numfmt.subtractDecimal",
1380
- tooltip: "sheet.numfmt.subtractDecimal",
1381
- type: re.BUTTON,
1382
- group: se.TOOLBAR_FORMULAS_INSERT,
1383
- positions: [ie.TOOLBAR_START],
1384
- hidden$: ae(r, R.UNIVER_SHEET),
1385
- disabled$: ne(r)
1386
- });
1387
- }, tr = (e) => {
1388
- const t = "icon-PercentSingle";
1389
- return e.register(t, Wn), (r) => ({
1390
- icon: t,
1391
- id: ot.id,
1392
- title: "sheet.numfmt.percent",
1393
- tooltip: "sheet.numfmt.percent",
1394
- type: re.BUTTON,
1395
- group: se.TOOLBAR_FORMULAS_INSERT,
1396
- positions: [ie.TOOLBAR_START],
1397
- hidden$: ae(r, R.UNIVER_SHEET),
1398
- disabled$: ne(r)
1399
- });
1400
- }, nr = (e) => {
1401
- const t = "sheet.numfmt.moreNumfmtType", r = "sheet.numfmt.moreNumfmtType.options";
1402
- return e.register(t, Yn), e.register(r, Jn), (n) => {
1403
- const s = n.get(G), i = n.get(W), a = n.get($), o = n.get(T), l = n.get(H), u = Dt(i, "", ({ workbook: d, worksheet: c }) => new J(
1404
- (h) => Qe(
1405
- l.selectionMoveEnd$,
1406
- new J((_) => {
1407
- const v = [_e.id, te.id], f = a.onCommandExecuted((p) => {
1408
- v.includes(p.id) && _.next(null);
1409
- });
1410
- return () => f.dispose();
1411
- })
1412
- ).subscribe(() => {
1413
- const _ = l.getSelections();
1414
- if (_ && _[0]) {
1415
- const v = _[0].range, f = v.startRow, p = v.startColumn, g = s.getValue(d.getUnitId(), c.getSheetId(), f, p), C = g == null ? void 0 : g.pattern;
1416
- let O = o.t("sheet.numfmt.general");
1417
- if (C) {
1418
- const D = fe.filter((w) => typeof w == "object" && w.pattern).find(
1419
- (w) => Se(C, w.pattern)
1420
- );
1421
- D && typeof D == "object" && D.pattern ? O = o.t(D.label) : O = o.t("sheet.numfmt.moreFmt");
1422
- }
1423
- h.next(O);
1424
- }
1151
+ }, On = (e) => ({
1152
+ icon: "RmbSingle",
1153
+ id: nt.id,
1154
+ title: "sheet.numfmt.currency",
1155
+ tooltip: "sheet.numfmt.currency",
1156
+ type: ne.BUTTON,
1157
+ group: re.TOOLBAR_FORMULAS_INSERT,
1158
+ positions: [se.TOOLBAR_START],
1159
+ hidden$: ie(e, E.UNIVER_SHEET),
1160
+ disabled$: te(e, { workbookTypes: [Z], worksheetTypes: [Q, X], rangeTypes: [ee] })
1161
+ }), jn = (e) => ({
1162
+ icon: "AddDigitsSingle",
1163
+ id: et.id,
1164
+ title: "sheet.numfmt.addDecimal",
1165
+ tooltip: "sheet.numfmt.addDecimal",
1166
+ type: ne.BUTTON,
1167
+ positions: [se.TOOLBAR_START],
1168
+ group: re.TOOLBAR_FORMULAS_INSERT,
1169
+ hidden$: ie(e, E.UNIVER_SHEET),
1170
+ disabled$: te(e, { workbookTypes: [Z], worksheetTypes: [Q, X], rangeTypes: [ee] })
1171
+ }), $n = (e) => ({
1172
+ icon: "ReduceDigitsSingle",
1173
+ id: rt.id,
1174
+ title: "sheet.numfmt.subtractDecimal",
1175
+ tooltip: "sheet.numfmt.subtractDecimal",
1176
+ type: ne.BUTTON,
1177
+ group: re.TOOLBAR_FORMULAS_INSERT,
1178
+ positions: [se.TOOLBAR_START],
1179
+ hidden$: ie(e, E.UNIVER_SHEET),
1180
+ disabled$: te(e, { workbookTypes: [Z], worksheetTypes: [Q, X], rangeTypes: [ee] })
1181
+ }), wn = (e) => ({
1182
+ icon: "PercentSingle",
1183
+ id: at.id,
1184
+ title: "sheet.numfmt.percent",
1185
+ tooltip: "sheet.numfmt.percent",
1186
+ type: ne.BUTTON,
1187
+ group: re.TOOLBAR_FORMULAS_INSERT,
1188
+ positions: [se.TOOLBAR_START],
1189
+ hidden$: ie(e, E.UNIVER_SHEET),
1190
+ disabled$: te(e, { workbookTypes: [Z], worksheetTypes: [Q, X], rangeTypes: [ee] })
1191
+ }), Dn = (e) => {
1192
+ const t = e.get(H), r = e.get(k), n = e.get(O), s = e.get(T), i = e.get(D), o = Et(r, "", ({ workbook: a, worksheet: l }) => new G(
1193
+ (u) => Ze(
1194
+ i.selectionMoveEnd$,
1195
+ new G((m) => {
1196
+ const c = [ge.id, J.id], f = n.onCommandExecuted((_) => {
1197
+ c.includes(_.id) && m.next(null);
1198
+ });
1199
+ return () => f.dispose();
1425
1200
  })
1426
- ));
1427
- return {
1428
- label: t,
1429
- id: ve.id,
1430
- tooltip: "sheet.numfmt.title",
1431
- type: re.SELECTOR,
1432
- group: se.TOOLBAR_FORMULAS_INSERT,
1433
- positions: [ie.TOOLBAR_START],
1434
- selections: [
1435
- {
1436
- label: {
1437
- name: r,
1438
- hoverable: !1
1439
- }
1201
+ ).subscribe(() => {
1202
+ const m = i.getSelections();
1203
+ if (m && m[0]) {
1204
+ const c = m[0].range, f = c.startRow, _ = c.startColumn, g = t.getValue(a.getUnitId(), l.getSheetId(), f, _), h = g == null ? void 0 : g.pattern;
1205
+ let p = s.t("sheet.numfmt.general");
1206
+ if (h) {
1207
+ const v = he.filter((b) => typeof b == "object" && b.pattern).find(
1208
+ (b) => _e(h, b.pattern)
1209
+ );
1210
+ v && typeof v == "object" && v.pattern ? p = s.t(v.label) : p = s.t("sheet.numfmt.moreFmt");
1440
1211
  }
1441
- ],
1442
- value$: u,
1443
- hidden$: ae(n, R.UNIVER_SHEET),
1444
- disabled$: ne(n)
1445
- };
1212
+ u.next(p);
1213
+ }
1214
+ })
1215
+ ));
1216
+ return {
1217
+ label: lt,
1218
+ id: pe.id,
1219
+ tooltip: "sheet.numfmt.title",
1220
+ type: ne.SELECTOR,
1221
+ group: re.TOOLBAR_FORMULAS_INSERT,
1222
+ positions: [se.TOOLBAR_START],
1223
+ selections: [
1224
+ {
1225
+ label: {
1226
+ name: ut,
1227
+ hoverable: !1
1228
+ }
1229
+ }
1230
+ ],
1231
+ value$: o,
1232
+ hidden$: ie(e, E.UNIVER_SHEET),
1233
+ disabled$: te(e, { workbookTypes: [Z], worksheetTypes: [X, Q], rangeTypes: [ee] })
1446
1234
  };
1447
1235
  };
1448
- var rr = Object.defineProperty, sr = Object.getOwnPropertyDescriptor, ir = (e, t, r, n) => {
1449
- for (var s = n > 1 ? void 0 : n ? sr(t, r) : t, i = e.length - 1, a; i >= 0; i--)
1450
- (a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
1451
- return n && s && rr(t, r, s), s;
1452
- }, Te = (e, t) => (r, n) => t(r, n, e);
1453
- let he = class extends X {
1454
- constructor(e, t, r) {
1455
- super(), this._injector = e, this._componentManager = t, this._menuService = r, this._initMenu();
1236
+ var Un = Object.defineProperty, Ln = Object.getOwnPropertyDescriptor, An = (e, t, r, n) => {
1237
+ for (var s = n > 1 ? void 0 : n ? Ln(t, r) : t, i = e.length - 1, o; i >= 0; i--)
1238
+ (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
1239
+ return n && s && Un(t, r, s), s;
1240
+ }, Me = (e, t) => (r, n) => t(r, n, e);
1241
+ const Bn = {};
1242
+ let z = class extends Y {
1243
+ constructor(e, t, r, n) {
1244
+ super(), this._config = e, this._injector = t, this._componentManager = r, this._menuService = n, this._initMenu();
1456
1245
  }
1457
1246
  _initMenu() {
1458
- [tr, Xn, er, Qn, nr].map((e) => e(this._componentManager)).forEach((e) => {
1459
- this.disposeWithMe(this._menuService.addMenuItem(e(this._injector)));
1460
- });
1247
+ const { menu: e = {} } = this._config;
1248
+ [wn, jn, $n, On, Dn].forEach((t) => {
1249
+ this.disposeWithMe(this._menuService.addMenuItem(t(this._injector), e));
1250
+ }), this.disposeWithMe(this._componentManager.register(lt, Pn)), this.disposeWithMe(this._componentManager.register(ut, xn));
1461
1251
  }
1462
1252
  };
1463
- he = ir([
1464
- ee(K.Rendered, he),
1465
- Te(0, S(De)),
1466
- Te(1, S(Je)),
1467
- Te(2, S(At))
1468
- ], he);
1469
- var ar = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, or = (e, t, r, n) => {
1470
- for (var s = n > 1 ? void 0 : n ? cr(t, r) : t, i = e.length - 1, a; i >= 0; i--)
1471
- (a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
1472
- return n && s && ar(t, r, s), s;
1473
- }, lr = (e, t) => (r, n) => t(r, n, e), oe;
1474
- let Fe = (oe = class extends xt {
1475
- constructor(e, t) {
1476
- super(), this._injector = t;
1253
+ z = An([
1254
+ q(V.Rendered, z),
1255
+ Me(1, S(xe)),
1256
+ Me(2, S(Je)),
1257
+ Me(3, S(Dt))
1258
+ ], z);
1259
+ var kn = Object.defineProperty, Vn = Object.getOwnPropertyDescriptor, Hn = (e, t, r, n) => {
1260
+ for (var s = n > 1 ? void 0 : n ? Vn(t, r) : t, i = e.length - 1, o; i >= 0; i--)
1261
+ (o = e[i]) && (s = (n ? o(t, r, s) : o(s)) || s);
1262
+ return n && s && kn(t, r, s), s;
1263
+ }, Fn = (e, t) => (r, n) => t(r, n, e), ae;
1264
+ let He = (ae = class extends Ct {
1265
+ constructor(e = {}, t) {
1266
+ super(), this._config = e, this._injector = t, this._config = It.deepMerge({}, Bn, this._config);
1477
1267
  }
1478
1268
  onStarting() {
1479
- this._injector.add([Ue, { useClass: ue, lazy: !1 }]), this._injector.add([me]), this._injector.add([ge]), this._injector.add([le]), this._injector.add([de]), this._injector.add([he]);
1269
+ this._injector.add([Ue, { useClass: ue, lazy: !1 }]), this._injector.add([me]), this._injector.add([ve]), this._injector.add([le]), this._injector.add([de]), this._injector.add(
1270
+ [
1271
+ z,
1272
+ {
1273
+ useFactory: () => this._injector.createInstance(z, this._config)
1274
+ }
1275
+ ]
1276
+ );
1480
1277
  }
1481
- }, U(oe, "pluginName", xe), U(oe, "type", R.UNIVER_SHEET), oe);
1482
- Fe = or([
1483
- lr(1, S(De))
1484
- ], Fe);
1278
+ }, L(ae, "pluginName", Ne), L(ae, "type", E.UNIVER_SHEET), ae);
1279
+ He = Hn([
1280
+ Fn(1, S(xe))
1281
+ ], He);
1485
1282
  export {
1486
- A as SetNumfmtCommand,
1487
- Fe as UniverSheetsNumfmtPlugin,
1488
- zt as enUS,
1489
- Le as getPatternPreview,
1490
- Ir as ruRU,
1491
- Kt as zhCN
1283
+ $ as SetNumfmtCommand,
1284
+ He as UniverSheetsNumfmtPlugin,
1285
+ De as getPatternPreview
1492
1286
  };