@univerjs/sheets-numfmt 0.6.6 → 0.6.7-nightly.202503261607

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,12 +1,12 @@
1
- var oe = Object.defineProperty;
2
- var ce = (e, t, n) => t in e ? oe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var M = (e, t, n) => ce(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { numfmt as x, CommandType as w, ICommandService as I, IUniverInstanceService as F, IUndoRedoService as ae, CellValueType as T, ObjectMatrix as b, sequenceExecute as ie, Range as R, Inject as N, ThemeService as le, LocaleService as ue, Disposable as J, LocaleType as $, InterceptorEffectEnum as k, UniverInstanceType as X, DependentOn as me, Injector as fe, Plugin as de, registerDependencies as he, touchDependencies as z } from "@univerjs/core";
5
- import { getSheetCommandTarget as G, transformCellsToRange as ge, checkCellValueType as L, rangeMerge as K, SetNumfmtMutation as Q, factorySetNumfmtUndoMutation as pe, RemoveNumfmtMutation as ve, SetRangeValuesMutation as B, factoryRemoveNumfmtUndoMutation as Se, SheetsSelectionsService as j, INumfmtService as W, SheetInterceptorService as ye, INTERCEPTOR_POINT as _e, InterceptCellContentPriority as Ce, UniverSheetsPlugin as be } from "@univerjs/sheets";
6
- import { isTextFormat as ee } from "@univerjs/engine-numfmt";
7
- import { BehaviorSubject as H, merge as Me, switchMap as $e, of as Re, skip as Ie } from "rxjs";
8
- import { stripErrorMargin as Ee } from "@univerjs/engine-formula";
9
- const te = [
1
+ var ae = Object.defineProperty;
2
+ var le = (e, t, n) => t in e ? ae(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var M = (e, t, n) => le(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { numfmt as x, CommandType as P, ICommandService as E, IUniverInstanceService as F, IUndoRedoService as ue, CellValueType as I, ObjectMatrix as b, sequenceExecute as me, Range as N, Inject as T, ThemeService as fe, LocaleService as de, IConfigService as X, Disposable as Q, LocaleType as $, InterceptorEffectEnum as K, UniverInstanceType as ee, DependentOn as ge, Injector as he, Plugin as pe, merge as Se, registerDependencies as ve, touchDependencies as z } from "@univerjs/core";
5
+ import { getSheetCommandTarget as H, transformCellsToRange as ye, checkCellValueType as G, rangeMerge as Y, SetNumfmtMutation as te, factorySetNumfmtUndoMutation as _e, RemoveNumfmtMutation as Ce, SetRangeValuesMutation as B, factoryRemoveNumfmtUndoMutation as be, SheetsSelectionsService as j, INumfmtService as W, SheetInterceptorService as Me, INTERCEPTOR_POINT as $e, InterceptCellContentPriority as Re, UniverSheetsPlugin as Ie } from "@univerjs/sheets";
6
+ import { isTextFormat as ne } from "@univerjs/engine-numfmt";
7
+ import { BehaviorSubject as k, merge as Ne, switchMap as Ee, of as Te, skip as xe } from "rxjs";
8
+ import { stripErrorMargin as Ve } from "@univerjs/engine-formula";
9
+ const re = [
10
10
  "$",
11
11
  "£",
12
12
  "¥",
@@ -34,7 +34,7 @@ const te = [
34
34
  "₽",
35
35
  "₾",
36
36
  "₿"
37
- ], Ne = {
37
+ ], Pe = {
38
38
  US: "$",
39
39
  // United States Dollar
40
40
  CA: "C$",
@@ -74,7 +74,7 @@ const te = [
74
74
  SI: "€",
75
75
  ES: "€"
76
76
  // Add more mappings as needed
77
- }, Te = [
77
+ }, Ue = [
78
78
  {
79
79
  label: "1930-08-05",
80
80
  suffix: "yyyy-MM-dd"
@@ -119,7 +119,7 @@ const te = [
119
119
  label: "08-05 下午 01:30",
120
120
  suffix: "MM-dd A/P hh:mm"
121
121
  }
122
- ], xe = [
122
+ ], we = [
123
123
  {
124
124
  label: "(1,235)",
125
125
  suffix: "#,##0_);(#,##0)"
@@ -147,7 +147,7 @@ const te = [
147
147
  suffix: "#,##0.00_);[Red]-#,##0.00",
148
148
  color: "red"
149
149
  }
150
- ], ne = [
150
+ ], se = [
151
151
  {
152
152
  label: (e) => `${e}1,235`,
153
153
  suffix: (e) => `"${e}"#,##0.00_);"${e}"#,##0.00`
@@ -175,131 +175,131 @@ const te = [
175
175
  suffix: (e) => `"${e}"#,##0.00_);[Red]-"${e}"#,##0.00`,
176
176
  color: "red"
177
177
  }
178
- ], Ve = "SHEET_NUMFMT_PLUGIN", U = (e, t = 0) => {
178
+ ], Oe = "SHEET_NUMFMT_PLUGIN", w = (e, t = 0) => {
179
179
  var r;
180
180
  return e && (r = x.getInfo(e).maxDecimals) != null ? r : t;
181
- }, Je = (e, t) => {
181
+ }, tt = (e, t) => {
182
182
  if (e && !t || !e && t)
183
183
  return !1;
184
184
  const n = (u) => u.reduce(
185
- (d, p) => {
186
- if (d.isEnd)
187
- return d;
188
- const g = p.value || p.num;
189
- return p.type === "point" ? (d.isEnd = !0, d) : { ...d, result: d.result + g };
185
+ (g, p) => {
186
+ if (g.isEnd)
187
+ return g;
188
+ const h = p.value || p.num;
189
+ return p.type === "point" ? (g.isEnd = !0, g) : { ...g, result: g.result + h };
190
190
  },
191
191
  { isEnd: !1, result: "" }
192
- ).result, r = x.getInfo(e)._partitions, s = x.getInfo(t)._partitions, o = n(r[0].tokens), c = n(s[0].tokens), l = n(r[1].tokens), f = n(s[1].tokens);
193
- return o === c && l === f && r[1].color === s[1].color;
192
+ ).result, r = x.getInfo(e)._partitions, s = x.getInfo(t)._partitions, o = n(r[0].tokens), c = n(s[0].tokens), i = n(r[1].tokens), d = n(s[1].tokens);
193
+ return o === c && i === d && r[1].color === s[1].color;
194
194
  }, q = (e) => new Array(Math.min(Math.max(0, Number(e)), 30)).fill(0).join(""), O = (e, t) => e.split(";").map((r) => /\.0?/.test(r) ? r.replace(
195
195
  /\.0*/g,
196
196
  `${t > 0 ? "." : ""}${q(Number(t || 0))}`
197
197
  ) : /0([^0]?)|0$/.test(r) ? r.replace(
198
198
  /0([^0]+)|0$/,
199
199
  `0${t > 0 ? "." : ""}${q(Number(t || 0))}$1`
200
- ) : r).join(";"), Xe = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), P = {
200
+ ) : r).join(";"), nt = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), U = {
201
201
  id: "sheet.command.numfmt.set.numfmt",
202
- type: w.COMMAND,
202
+ type: P.COMMAND,
203
203
  // eslint-disable-next-line max-lines-per-function
204
204
  handler: (e, t) => {
205
205
  if (!t)
206
206
  return !1;
207
- const n = e.get(I), r = e.get(F), s = e.get(ae), o = G(r, t);
207
+ const n = e.get(E), r = e.get(F), s = e.get(ue), o = H(r, t);
208
208
  if (!o) return !1;
209
- const { unitId: c, subUnitId: l, worksheet: f } = o, u = t.values.filter((i) => !!i.pattern), d = t.values.filter((i) => !i.pattern), p = ge(c, l, u), g = {
209
+ const { unitId: c, subUnitId: i, worksheet: d } = o, u = t.values.filter((l) => !!l.pattern), g = t.values.filter((l) => !l.pattern), p = ye(c, i, u), h = {
210
210
  unitId: c,
211
- subUnitId: l,
212
- ranges: d.map((i) => ({
213
- startColumn: i.col,
214
- startRow: i.row,
215
- endColumn: i.col,
216
- endRow: i.row
211
+ subUnitId: i,
212
+ ranges: g.map((l) => ({
213
+ startColumn: l.col,
214
+ startRow: l.row,
215
+ endColumn: l.col,
216
+ endRow: l.row
217
217
  }))
218
- }, C = [], h = [];
218
+ }, C = [], v = [];
219
219
  if (u.length) {
220
- const i = u.reduce((m, a) => {
221
- ee(a.pattern) && m.setValue(a.row, a.col, { t: T.STRING });
222
- const _ = f.getCellRaw(a.row, a.col);
220
+ const l = u.reduce((f, a) => {
221
+ ne(a.pattern) && f.setValue(a.row, a.col, { t: I.STRING });
222
+ const _ = d.getCellRaw(a.row, a.col);
223
223
  if (_) {
224
- const V = L(_.v);
225
- V !== _.t && m.setValue(a.row, a.col, { t: V });
224
+ const V = G(_.v);
225
+ V !== _.t && f.setValue(a.row, a.col, { t: V });
226
226
  }
227
- return m;
228
- }, new b()).getMatrix(), v = new b();
229
- new b(i).forValue((m, a) => {
230
- const _ = f.getCellRaw(m, a);
231
- _ ? v.setValue(m, a, { t: _.t }) : v.setValue(m, a, { t: void 0 });
232
- }), Object.keys(p.values).forEach((m) => {
233
- const a = p.values[m];
234
- a.ranges = K(a.ranges);
227
+ return f;
228
+ }, new b()).getMatrix(), S = new b();
229
+ new b(l).forValue((f, a) => {
230
+ const _ = d.getCellRaw(f, a);
231
+ _ ? S.setValue(f, a, { t: _.t }) : S.setValue(f, a, { t: void 0 });
232
+ }), Object.keys(p.values).forEach((f) => {
233
+ const a = p.values[f];
234
+ a.ranges = Y(a.ranges);
235
235
  }), C.push({
236
- id: Q.id,
236
+ id: te.id,
237
237
  params: p
238
238
  });
239
- const y = pe(e, p);
240
- h.push(...y);
239
+ const y = _e(e, p);
240
+ v.push(...y);
241
241
  }
242
- if (d.length) {
243
- g.ranges = K(g.ranges);
244
- const i = d.reduce((m, a) => {
245
- const _ = f.getCellRaw(a.row, a.col);
242
+ if (g.length) {
243
+ h.ranges = Y(h.ranges);
244
+ const l = g.reduce((f, a) => {
245
+ const _ = d.getCellRaw(a.row, a.col);
246
246
  if (_) {
247
- const V = L(_.v);
248
- V !== _.t && m.setValue(a.row, a.col, { t: V });
247
+ const V = G(_.v);
248
+ V !== _.t && f.setValue(a.row, a.col, { t: V });
249
249
  }
250
- return m;
251
- }, new b()).getMatrix(), v = new b();
252
- new b(i).forValue((m, a) => {
253
- const _ = f.getCellRaw(m, a);
254
- _ ? v.setValue(m, a, { t: _.t }) : v.setValue(m, a, { t: void 0 });
250
+ return f;
251
+ }, new b()).getMatrix(), S = new b();
252
+ new b(l).forValue((f, a) => {
253
+ const _ = d.getCellRaw(f, a);
254
+ _ ? S.setValue(f, a, { t: _.t }) : S.setValue(f, a, { t: void 0 });
255
255
  }), C.push({
256
- id: ve.id,
257
- params: g
256
+ id: Ce.id,
257
+ params: h
258
258
  }, {
259
259
  id: B.id,
260
260
  params: {
261
261
  unitId: c,
262
- subUnitId: l,
263
- cellValue: i
262
+ subUnitId: i,
263
+ cellValue: l
264
264
  }
265
265
  });
266
- const y = Se(e, g);
267
- h.push({
266
+ const y = be(e, h);
267
+ v.push({
268
268
  id: B.id,
269
269
  params: {
270
270
  unitId: c,
271
- subUnitId: l,
272
- cellValue: v.getMatrix()
271
+ subUnitId: i,
272
+ cellValue: S.getMatrix()
273
273
  }
274
274
  }, ...y);
275
275
  }
276
- const S = ie(C, n).result;
277
- return S && s.pushUndoRedo({
276
+ const m = me(C, n).result;
277
+ return m && s.pushUndoRedo({
278
278
  unitID: c,
279
- undoMutations: h,
279
+ undoMutations: v,
280
280
  redoMutations: C
281
- }), S;
281
+ }), m;
282
282
  }
283
- }, we = {
283
+ }, De = {
284
284
  id: "sheet.command.numfmt.add.decimal.command",
285
- type: w.COMMAND,
285
+ type: P.COMMAND,
286
286
  handler: async (e) => {
287
- const t = e.get(I), n = e.get(j), r = e.get(W), s = e.get(F), o = n.getCurrentSelections();
287
+ const t = e.get(E), n = e.get(j), r = e.get(W), s = e.get(F), o = n.getCurrentSelections();
288
288
  if (!o || !o.length)
289
289
  return !1;
290
- const c = G(s);
290
+ const c = H(s);
291
291
  if (!c) return !1;
292
- const { unitId: l, subUnitId: f } = c;
292
+ const { unitId: i, subUnitId: d } = c;
293
293
  let u = 0;
294
294
  o.forEach((C) => {
295
- R.foreach(C.range, (h, S) => {
296
- const i = r.getValue(l, f, h, S);
297
- if (!i) {
298
- const y = c.worksheet.getCellRaw(h, S);
299
- if (!u && y && y.t === T.NUMBER && y.v) {
300
- const m = /\.(\d*)$/.exec(String(y.v));
301
- if (m) {
302
- const a = m[1].length;
295
+ N.foreach(C.range, (v, m) => {
296
+ const l = r.getValue(i, d, v, m);
297
+ if (!l) {
298
+ const y = c.worksheet.getCellRaw(v, m);
299
+ if (!u && y && y.t === I.NUMBER && y.v) {
300
+ const f = /\.(\d*)$/.exec(String(y.v));
301
+ if (f) {
302
+ const a = f[1].length;
303
303
  if (!a)
304
304
  return;
305
305
  u = Math.max(u, a);
@@ -307,35 +307,35 @@ const te = [
307
307
  }
308
308
  return;
309
309
  }
310
- const v = U(i.pattern);
311
- u = v > u ? v : u;
310
+ const S = w(l.pattern);
311
+ u = S > u ? S : u;
312
312
  });
313
313
  });
314
- const d = u + 1, p = O(`0${d > 0 ? ".0" : ""}`, d), g = [];
314
+ const g = u + 1, p = O(`0${g > 0 ? ".0" : ""}`, g), h = [];
315
315
  return o.forEach((C) => {
316
- R.foreach(C.range, (h, S) => {
317
- const i = r.getValue(l, f, h, S);
318
- if (!i)
319
- g.push({
320
- row: h,
321
- col: S,
316
+ N.foreach(C.range, (v, m) => {
317
+ const l = r.getValue(i, d, v, m);
318
+ if (!l)
319
+ h.push({
320
+ row: v,
321
+ col: m,
322
322
  pattern: p
323
323
  });
324
324
  else {
325
- const v = U(i.pattern), y = O(i.pattern, v + 1);
326
- y !== i.pattern && g.push({
327
- row: h,
328
- col: S,
325
+ const S = w(l.pattern), y = O(l.pattern, S + 1);
326
+ y !== l.pattern && h.push({
327
+ row: v,
328
+ col: m,
329
329
  pattern: y
330
330
  });
331
331
  }
332
332
  });
333
- }), g.length ? await t.executeCommand(P.id, { values: g }) : !1;
333
+ }), h.length ? await t.executeCommand(U.id, { values: h }) : !1;
334
334
  }
335
335
  };
336
- class re {
336
+ class oe {
337
337
  constructor() {
338
- M(this, "_currencySymbol$", new H("US"));
338
+ M(this, "_currencySymbol$", new k("US"));
339
339
  M(this, "currencySymbol$", this._currencySymbol$.asObservable());
340
340
  }
341
341
  /**
@@ -348,52 +348,52 @@ class re {
348
348
  return this._currencySymbol$.getValue();
349
349
  }
350
350
  }
351
- const Pe = {
351
+ const Ae = {
352
352
  id: "sheet.command.numfmt.set.currency",
353
- type: w.COMMAND,
353
+ type: P.COMMAND,
354
354
  handler: async (e) => {
355
- const t = e.get(I), n = e.get(j), r = e.get(re), s = Ne[r.getCurrencySymbol()] || "$", o = n.getCurrentSelections();
355
+ const t = e.get(E), n = e.get(j), r = e.get(oe), s = Pe[r.getCurrencySymbol()] || "$", o = n.getCurrentSelections();
356
356
  if (!o || !o.length)
357
357
  return !1;
358
- const c = [], l = ne[4].suffix(s);
358
+ const c = [], i = se[4].suffix(s);
359
359
  return o.forEach((u) => {
360
- R.foreach(u.range, (d, p) => {
361
- c.push({ row: d, col: p, pattern: l, type: "currency" });
360
+ N.foreach(u.range, (g, p) => {
361
+ c.push({ row: g, col: p, pattern: i, type: "currency" });
362
362
  });
363
- }), await t.executeCommand(P.id, { values: c });
363
+ }), await t.executeCommand(U.id, { values: c });
364
364
  }
365
- }, Ue = {
365
+ }, Fe = {
366
366
  id: "sheet.command.numfmt.set.percent",
367
- type: w.COMMAND,
367
+ type: P.COMMAND,
368
368
  handler: async (e) => {
369
- const t = e.get(I), r = e.get(j).getCurrentSelections();
369
+ const t = e.get(E), r = e.get(j).getCurrentSelections();
370
370
  if (!r || !r.length)
371
371
  return !1;
372
372
  const s = [], o = "0%";
373
- return r.forEach((l) => {
374
- R.foreach(l.range, (f, u) => {
375
- s.push({ row: f, col: u, pattern: o, type: "percent" });
373
+ return r.forEach((i) => {
374
+ N.foreach(i.range, (d, u) => {
375
+ s.push({ row: d, col: u, pattern: o, type: "percent" });
376
376
  });
377
- }), await t.executeCommand(P.id, { values: s });
377
+ }), await t.executeCommand(U.id, { values: s });
378
378
  }
379
- }, Oe = {
379
+ }, je = {
380
380
  id: "sheet.command.numfmt.subtract.decimal.command",
381
- type: w.COMMAND,
381
+ type: P.COMMAND,
382
382
  handler: async (e) => {
383
- const t = e.get(I), n = e.get(j), r = e.get(W), s = e.get(F), o = n.getCurrentSelections();
383
+ const t = e.get(E), n = e.get(j), r = e.get(W), s = e.get(F), o = n.getCurrentSelections();
384
384
  if (!o || !o.length)
385
385
  return !1;
386
- const c = G(s);
386
+ const c = H(s);
387
387
  if (!c) return !1;
388
- const { unitId: l, subUnitId: f } = c;
388
+ const { unitId: i, subUnitId: d } = c;
389
389
  let u = 0;
390
- o.forEach((h) => {
391
- R.foreach(h.range, (S, i) => {
392
- const v = r.getValue(l, f, S, i);
393
- if (!v) {
394
- const m = c.worksheet.getCellRaw(S, i);
395
- if (!u && m && m.t === T.NUMBER && m.v) {
396
- const a = /\.(\d*)$/.exec(String(m.v));
390
+ o.forEach((v) => {
391
+ N.foreach(v.range, (m, l) => {
392
+ const S = r.getValue(i, d, m, l);
393
+ if (!S) {
394
+ const f = c.worksheet.getCellRaw(m, l);
395
+ if (!u && f && f.t === I.NUMBER && f.v) {
396
+ const a = /\.(\d*)$/.exec(String(f.v));
397
397
  if (a) {
398
398
  const _ = a[1].length;
399
399
  if (!_)
@@ -403,32 +403,32 @@ const Pe = {
403
403
  }
404
404
  return;
405
405
  }
406
- const y = U(v.pattern);
406
+ const y = w(S.pattern);
407
407
  u = y > u ? y : u;
408
408
  });
409
409
  });
410
- const d = u - 1, p = O(`0${d > 0 ? ".0" : "."}`, d), g = [];
411
- return o.forEach((h) => {
412
- R.foreach(h.range, (S, i) => {
413
- const v = r.getValue(l, f, S, i);
414
- if (!v)
415
- g.push({
416
- row: S,
417
- col: i,
410
+ const g = u - 1, p = O(`0${g > 0 ? ".0" : "."}`, g), h = [];
411
+ return o.forEach((v) => {
412
+ N.foreach(v.range, (m, l) => {
413
+ const S = r.getValue(i, d, m, l);
414
+ if (!S)
415
+ h.push({
416
+ row: m,
417
+ col: l,
418
418
  pattern: p
419
419
  });
420
420
  else {
421
- const y = U(v.pattern);
422
- g.push({
423
- row: S,
424
- col: i,
425
- pattern: O(v.pattern, y - 1)
421
+ const y = w(S.pattern);
422
+ h.push({
423
+ row: m,
424
+ col: l,
425
+ pattern: O(S.pattern, y - 1)
426
426
  });
427
427
  }
428
428
  });
429
- }), await t.executeCommand(P.id, { values: g });
429
+ }), await t.executeCommand(U.id, { values: h });
430
430
  }
431
- }, Qe = (e) => x.getInfo(e).type || "unknown", De = (e, t, n = "en") => {
431
+ }, ce = "sheets-numfmt.config", Z = {}, rt = (e) => x.getInfo(e).type || "unknown", Le = (e, t, n = "en") => {
432
432
  const s = x.getInfo(e)._partitions[1], o = x.format(e, t, { locale: n, throws: !1 });
433
433
  return t < 0 ? {
434
434
  result: o,
@@ -436,27 +436,27 @@ const Pe = {
436
436
  } : {
437
437
  result: o
438
438
  };
439
- }, Ae = (e, t, n) => e === "General" ? {
440
- result: String(Ee(t))
439
+ }, Ge = (e, t, n) => e === "General" ? {
440
+ result: String(Ve(t))
441
441
  // In Excel, the default General format also needs to handle numeric precision.
442
- } : De(e, t, n);
443
- var Fe = Object.getOwnPropertyDescriptor, je = (e, t, n, r) => {
444
- for (var s = r > 1 ? void 0 : r ? Fe(t, n) : t, o = e.length - 1, c; o >= 0; o--)
442
+ } : Le(e, t, n);
443
+ var Be = Object.getOwnPropertyDescriptor, He = (e, t, n, r) => {
444
+ for (var s = r > 1 ? void 0 : r ? Be(t, n) : t, o = e.length - 1, c; o >= 0; o--)
445
445
  (c = e[o]) && (s = c(s) || s);
446
446
  return s;
447
- }, E = (e, t) => (n, r) => t(n, r, e);
448
- const Le = {
447
+ }, R = (e, t) => (n, r) => t(n, r, e);
448
+ const We = {
449
449
  tl: {
450
450
  size: 6,
451
451
  color: "#409f11"
452
452
  }
453
453
  };
454
- let D = class extends J {
455
- constructor(t, n, r, s, o, c) {
454
+ let D = class extends Q {
455
+ constructor(t, n, r, s, o, c, i) {
456
456
  super();
457
- M(this, "_local$", new H("en"));
457
+ M(this, "_local$", new k("en"));
458
458
  M(this, "local$", this._local$.asObservable());
459
- this._instanceService = t, this._sheetInterceptorService = n, this._themeService = r, this._commandService = s, this._numfmtService = o, this._localeService = c, this._initInterceptorCellContent();
459
+ this._instanceService = t, this._sheetInterceptorService = n, this._themeService = r, this._commandService = s, this._numfmtService = o, this._localeService = c, this._configService = i, this._initInterceptorCellContent();
460
460
  }
461
461
  get local() {
462
462
  const t = this._local$.getValue();
@@ -482,56 +482,60 @@ let D = class extends J {
482
482
  // eslint-disable-next-line max-lines-per-function
483
483
  _initInterceptorCellContent() {
484
484
  const t = new b();
485
- this.disposeWithMe(Me(this._local$, this._localeService.currentLocale$).subscribe(() => {
485
+ this.disposeWithMe(Ne(this._local$, this._localeService.currentLocale$).subscribe(() => {
486
486
  t.reset();
487
- })), this.disposeWithMe(this._sheetInterceptorService.intercept(_e.CELL_CONTENT, {
488
- effect: k.Value | k.Style,
487
+ })), this.disposeWithMe(this._sheetInterceptorService.intercept($e.CELL_CONTENT, {
488
+ effect: K.Value | K.Style,
489
489
  handler: (n, r, s) => {
490
+ var v;
490
491
  const o = r.unitId, c = r.subUnitId;
491
- let l;
492
- const f = n;
493
- if (!f)
492
+ let i;
493
+ const d = n;
494
+ if (!d)
494
495
  return s(n);
495
496
  if (n != null && n.s) {
496
- const h = r.workbook.getStyles().get(n.s);
497
- h != null && h.n && (l = h.n);
497
+ const m = r.workbook.getStyles().get(n.s);
498
+ m != null && m.n && (i = m.n);
498
499
  }
499
- if (l || (l = this._numfmtService.getValue(o, c, r.row, r.col)), !l || L(f.v) !== T.NUMBER)
500
+ if (i || (i = this._numfmtService.getValue(o, c, r.row, r.col)), !i || G(d.v) !== I.NUMBER)
500
501
  return s(n);
501
- if (ee(l.pattern))
502
- return s({
502
+ if (ne(i.pattern))
503
+ return (v = this._configService.getConfig(ce)) != null && v.disableTextFormatMark ? s({
503
504
  ...n,
504
- t: T.STRING,
505
+ t: I.STRING
506
+ }) : s({
507
+ ...n,
508
+ t: I.STRING,
505
509
  markers: {
506
510
  ...n == null ? void 0 : n.markers,
507
- ...Le
511
+ ...We
508
512
  }
509
513
  });
510
- let d = "";
514
+ let g = "";
511
515
  const p = t.getValue(r.row, r.col);
512
- if (p && p.parameters === `${f.v}_${l.pattern}`)
516
+ if (p && p.parameters === `${d.v}_${i.pattern}`)
513
517
  return s({ ...n, ...p.result });
514
- const g = Ae(l.pattern, Number(f.v), this.local);
515
- if (d = g.result, !d)
518
+ const h = Ge(i.pattern, Number(d.v), this.local);
519
+ if (g = h.result, !g)
516
520
  return s(n);
517
- const C = { v: d, t: T.NUMBER };
518
- if (g.color) {
519
- const h = this._themeService.getCurrentTheme()[`${g.color}500`];
520
- h && (C.interceptorStyle = { cl: { rgb: h } });
521
+ const C = { v: g, t: I.NUMBER };
522
+ if (h.color) {
523
+ const m = this._themeService.getCurrentTheme()[`${h.color}500`];
524
+ m && (C.interceptorStyle = { cl: { rgb: m } });
521
525
  }
522
526
  return t.setValue(r.row, r.col, {
523
527
  result: C,
524
- parameters: `${f.v}_${l.pattern}`
528
+ parameters: `${d.v}_${i.pattern}`
525
529
  }), s({ ...n, ...C });
526
530
  },
527
- priority: Ce.NUMFMT
531
+ priority: Re.NUMFMT
528
532
  })), this.disposeWithMe(this._commandService.onCommandExecuted((n) => {
529
- if (n.id === Q.id) {
533
+ if (n.id === te.id) {
530
534
  const r = n.params;
531
535
  Object.keys(r.values).forEach((s) => {
532
536
  r.values[s].ranges.forEach((c) => {
533
- R.foreach(c, (l, f) => {
534
- t.realDeleteValue(l, f);
537
+ N.foreach(c, (i, d) => {
538
+ t.realDeleteValue(i, d);
535
539
  });
536
540
  });
537
541
  });
@@ -542,12 +546,12 @@ let D = class extends J {
542
546
  });
543
547
  }
544
548
  })), this.disposeWithMe(
545
- this._instanceService.getCurrentTypeOfUnit$(X.UNIVER_SHEET).pipe(
546
- $e((n) => {
549
+ this._instanceService.getCurrentTypeOfUnit$(ee.UNIVER_SHEET).pipe(
550
+ Ee((n) => {
547
551
  var r;
548
- return (r = n == null ? void 0 : n.activeSheet$) != null ? r : Re(null);
552
+ return (r = n == null ? void 0 : n.activeSheet$) != null ? r : Te(null);
549
553
  }),
550
- Ie(1)
554
+ xe(1)
551
555
  ).subscribe(() => t.reset())
552
556
  );
553
557
  }
@@ -555,18 +559,19 @@ let D = class extends J {
555
559
  this._local$.next(t);
556
560
  }
557
561
  };
558
- D = je([
559
- E(0, F),
560
- E(1, N(ye)),
561
- E(2, N(le)),
562
- E(3, N(I)),
563
- E(4, N(W)),
564
- E(5, N(ue))
562
+ D = He([
563
+ R(0, F),
564
+ R(1, T(Me)),
565
+ R(2, T(fe)),
566
+ R(3, T(E)),
567
+ R(4, T(W)),
568
+ R(5, T(de)),
569
+ R(6, X)
565
570
  ], D);
566
- class Y extends J {
571
+ class J extends Q {
567
572
  constructor() {
568
573
  super(...arguments);
569
- M(this, "_currencySymbol$", new H("US"));
574
+ M(this, "_currencySymbol$", new k("US"));
570
575
  M(this, "currencySymbol$", this._currencySymbol$.asObservable());
571
576
  }
572
577
  /**
@@ -579,75 +584,83 @@ class Y extends J {
579
584
  return this._currencySymbol$.getValue();
580
585
  }
581
586
  }
582
- var Be = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, We = (e, t, n) => t in e ? Be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, He = (e, t, n, r) => {
583
- for (var s = r > 1 ? void 0 : r ? Ge(t, n) : t, o = e.length - 1, c; o >= 0; o--)
587
+ var ke = Object.defineProperty, Ke = Object.getOwnPropertyDescriptor, ze = (e, t, n) => t in e ? ke(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ye = (e, t, n, r) => {
588
+ for (var s = r > 1 ? void 0 : r ? Ke(t, n) : t, o = e.length - 1, c; o >= 0; o--)
584
589
  (c = e[o]) && (s = c(s) || s);
585
590
  return s;
586
- }, Z = (e, t) => (n, r) => t(n, r, e), se = (e, t, n) => We(e, typeof t != "symbol" ? t + "" : t, n);
587
- let A = class extends de {
588
- constructor(e = void 0, t, n) {
589
- super(), this._config = e, this._injector = t, this._commandService = n;
591
+ }, L = (e, t) => (n, r) => t(n, r, e), ie = (e, t, n) => ze(e, typeof t != "symbol" ? t + "" : t, n);
592
+ let A = class extends pe {
593
+ constructor(e = Z, t, n, r) {
594
+ super(), this._config = e, this._injector = t, this._configService = n, this._commandService = r;
595
+ const { ...s } = Se(
596
+ {},
597
+ Z,
598
+ this._config
599
+ );
600
+ this._configService.setConfig(ce, s);
590
601
  }
591
602
  onStarting() {
592
- he(this._injector, [
603
+ ve(this._injector, [
593
604
  [D],
594
- [re],
595
- [Y]
605
+ [oe],
606
+ [J]
596
607
  ]), z(this._injector, [
597
608
  [D]
598
609
  ]);
599
610
  }
600
611
  onRendered() {
601
612
  z(this._injector, [
602
- [Y]
613
+ [J]
603
614
  ]), [
604
- we,
605
- Oe,
606
- Pe,
607
- Ue,
608
- P
615
+ De,
616
+ je,
617
+ Ae,
618
+ Fe,
619
+ U
609
620
  ].forEach((e) => {
610
621
  this.disposeWithMe(this._commandService.registerCommand(e));
611
622
  });
612
623
  }
613
624
  };
614
- se(A, "pluginName", Ve);
615
- se(A, "type", X.UNIVER_SHEET);
616
- A = He([
617
- me(be),
618
- Z(1, N(fe)),
619
- Z(2, I)
625
+ ie(A, "pluginName", Oe);
626
+ ie(A, "type", ee.UNIVER_SHEET);
627
+ A = Ye([
628
+ ge(Ie),
629
+ L(1, T(he)),
630
+ L(2, X),
631
+ L(3, E)
620
632
  ], A);
621
- const et = (e) => te.find((n) => e.includes(n)), tt = () => te.map((e) => ({ label: e, value: e })), nt = (e) => ne.map((t) => ({
633
+ const st = (e) => re.find((n) => e.includes(n)), ot = () => re.map((e) => ({ label: e, value: e })), ct = (e) => se.map((t) => ({
622
634
  label: t.label(e),
623
635
  value: t.suffix(e),
624
636
  color: t.color
625
- })), rt = () => Te.map((e) => ({ label: e.label, value: e.suffix })), st = () => xe.map((e) => ({ label: e.label, value: e.suffix, color: e.color }));
637
+ })), it = () => Ue.map((e) => ({ label: e.label, value: e.suffix })), at = () => we.map((e) => ({ label: e.label, value: e.suffix, color: e.color }));
626
638
  export {
627
- we as AddDecimalCommand,
628
- ne as CURRENCYFORMAT,
629
- Te as DATEFMTLISG,
630
- re as MenuCurrencyService,
631
- xe as NUMBERFORMAT,
632
- Pe as SetCurrencyCommand,
633
- P as SetNumfmtCommand,
634
- Ue as SetPercentCommand,
639
+ De as AddDecimalCommand,
640
+ se as CURRENCYFORMAT,
641
+ Ue as DATEFMTLISG,
642
+ oe as MenuCurrencyService,
643
+ we as NUMBERFORMAT,
644
+ ce as SHEETS_NUMFMT_PLUGIN_CONFIG_KEY,
645
+ Ae as SetCurrencyCommand,
646
+ U as SetNumfmtCommand,
647
+ Fe as SetPercentCommand,
635
648
  D as SheetsNumfmtCellContentController,
636
- Oe as SubtractDecimalCommand,
649
+ je as SubtractDecimalCommand,
637
650
  A as UniverSheetsNumfmtPlugin,
638
- Ne as countryCurrencyMap,
639
- te as currencySymbols,
640
- nt as getCurrencyFormatOptions,
641
- tt as getCurrencyOptions,
642
- et as getCurrencyType,
643
- rt as getDateFormatOptions,
644
- U as getDecimalFromPattern,
651
+ Pe as countryCurrencyMap,
652
+ re as currencySymbols,
653
+ ct as getCurrencyFormatOptions,
654
+ ot as getCurrencyOptions,
655
+ st as getCurrencyType,
656
+ it as getDateFormatOptions,
657
+ w as getDecimalFromPattern,
645
658
  q as getDecimalString,
646
- st as getNumberFormatOptions,
647
- De as getPatternPreview,
648
- Ae as getPatternPreviewIgnoreGeneral,
649
- Qe as getPatternType,
650
- Je as isPatternEqualWithoutDecimal,
651
- Xe as isPatternHasDecimal,
659
+ at as getNumberFormatOptions,
660
+ Le as getPatternPreview,
661
+ Ge as getPatternPreviewIgnoreGeneral,
662
+ rt as getPatternType,
663
+ tt as isPatternEqualWithoutDecimal,
664
+ nt as isPatternHasDecimal,
652
665
  O as setPatternDecimal
653
666
  };