@univerjs/sheets-numfmt 0.15.2 → 0.15.3-insiders.20260131-cbd5fac
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/cjs/index.js +1 -1
- package/lib/es/index.js +163 -159
- package/lib/index.js +163 -159
- package/lib/umd/index.js +1 -1
- package/package.json +6 -6
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var ae = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var L = (e, r, t) =>
|
|
4
|
-
import { LocaleType as
|
|
5
|
-
import { getSheetCommandTarget as
|
|
2
|
+
var ce = (e, r, t) => r in e ? ae(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
+
var L = (e, r, t) => ce(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import { LocaleType as i, numfmt as x, CommandType as U, ICommandService as $, IUniverInstanceService as V, IUndoRedoService as ie, isTextFormat as J, CellValueType as M, ObjectMatrix as R, sequenceExecute as le, Range as N, isDefaultFormat as G, LocaleService as Q, DEFAULT_NUMBER_FORMAT as ue, Inject as I, ThemeService as fe, Disposable as me, InterceptorEffectEnum as k, UniverInstanceType as ee, IConfigService as te, DependentOn as de, Injector as ge, Plugin as he, merge as pe, registerDependencies as _e, touchDependencies as Se } from "@univerjs/core";
|
|
5
|
+
import { getSheetCommandTarget as W, transformCellsToRange as ve, checkCellValueType as B, rangeMerge as z, SetNumfmtMutation as re, factorySetNumfmtUndoMutation as Ce, RemoveNumfmtMutation as ye, SetRangeValuesMutation as H, factoryRemoveNumfmtUndoMutation as be, SheetsSelectionsService as j, INumfmtService as Z, SheetInterceptorService as Me, INTERCEPTOR_POINT as Re, InterceptCellContentPriority as Ee, UniverSheetsPlugin as Ne } from "@univerjs/sheets";
|
|
6
6
|
import { BehaviorSubject as $e, merge as Ie, switchMap as Te, of as Ue, skip as Oe } from "rxjs";
|
|
7
7
|
import { stripErrorMargin as we } from "@univerjs/engine-formula";
|
|
8
8
|
const ne = [
|
|
@@ -35,45 +35,47 @@ const ne = [
|
|
|
35
35
|
"₿",
|
|
36
36
|
"﷼"
|
|
37
37
|
], w = /* @__PURE__ */ new Map([
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
38
|
+
[i.EN_US, "$"],
|
|
39
|
+
[i.RU_RU, "₽"],
|
|
40
|
+
[i.VI_VN, "₫"],
|
|
41
|
+
[i.ZH_CN, "¥"],
|
|
42
|
+
[i.ZH_TW, "NT$"],
|
|
43
|
+
[i.FR_FR, "€"],
|
|
44
|
+
[i.FA_IR, "﷼"],
|
|
45
|
+
[i.KO_KR, "₩"],
|
|
46
|
+
[i.ES_ES, "€"],
|
|
47
|
+
[i.CA_ES, "€"],
|
|
48
|
+
[i.SK_SK, "€"]
|
|
48
49
|
]);
|
|
49
50
|
function xe(e) {
|
|
50
51
|
switch (e) {
|
|
51
|
-
case
|
|
52
|
-
case
|
|
53
|
-
case
|
|
52
|
+
case i.CA_ES:
|
|
53
|
+
case i.ES_ES:
|
|
54
|
+
case i.FR_FR:
|
|
55
|
+
case i.SK_SK:
|
|
54
56
|
return {
|
|
55
57
|
icon: "EuroIcon",
|
|
56
58
|
symbol: w.get(e) || "€",
|
|
57
59
|
locale: e
|
|
58
60
|
};
|
|
59
|
-
case
|
|
61
|
+
case i.RU_RU:
|
|
60
62
|
return {
|
|
61
63
|
icon: "RoubleIcon",
|
|
62
64
|
symbol: w.get(e) || "₽",
|
|
63
65
|
locale: e
|
|
64
66
|
};
|
|
65
|
-
case
|
|
67
|
+
case i.ZH_CN:
|
|
66
68
|
return {
|
|
67
69
|
icon: "RmbIcon",
|
|
68
70
|
symbol: w.get(e) || "¥",
|
|
69
71
|
locale: e
|
|
70
72
|
};
|
|
71
|
-
case
|
|
73
|
+
case i.EN_US:
|
|
72
74
|
default:
|
|
73
75
|
return {
|
|
74
76
|
icon: "DollarIcon",
|
|
75
77
|
symbol: "$",
|
|
76
|
-
locale:
|
|
78
|
+
locale: i.EN_US
|
|
77
79
|
};
|
|
78
80
|
}
|
|
79
81
|
}
|
|
@@ -203,78 +205,78 @@ const Fe = [
|
|
|
203
205
|
handler: (e, r) => {
|
|
204
206
|
if (!r)
|
|
205
207
|
return !1;
|
|
206
|
-
const t = e.get($), n = e.get(V), s = e.get(
|
|
208
|
+
const t = e.get($), n = e.get(V), s = e.get(ie), a = W(n, r);
|
|
207
209
|
if (!a) return !1;
|
|
208
|
-
const { unitId:
|
|
209
|
-
unitId:
|
|
210
|
+
const { unitId: u, subUnitId: o, worksheet: h } = a, f = r.values.filter((c) => !!c.pattern), C = r.values.filter((c) => !c.pattern), y = ve(u, o, f), p = {
|
|
211
|
+
unitId: u,
|
|
210
212
|
subUnitId: o,
|
|
211
|
-
ranges: C.map((
|
|
212
|
-
startColumn:
|
|
213
|
-
startRow:
|
|
214
|
-
endColumn:
|
|
215
|
-
endRow:
|
|
213
|
+
ranges: C.map((c) => ({
|
|
214
|
+
startColumn: c.col,
|
|
215
|
+
startRow: c.row,
|
|
216
|
+
endColumn: c.col,
|
|
217
|
+
endRow: c.row
|
|
216
218
|
}))
|
|
217
219
|
}, b = [], _ = [];
|
|
218
|
-
if (
|
|
219
|
-
const
|
|
220
|
-
J(
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
const T =
|
|
224
|
-
T !==
|
|
220
|
+
if (f.length) {
|
|
221
|
+
const c = f.reduce((d, l) => {
|
|
222
|
+
J(l.pattern) && d.setValue(l.row, l.col, { t: M.STRING });
|
|
223
|
+
const v = h.getCellRaw(l.row, l.col);
|
|
224
|
+
if (v) {
|
|
225
|
+
const T = B(v.v);
|
|
226
|
+
T !== v.t && d.setValue(l.row, l.col, { t: T });
|
|
225
227
|
}
|
|
226
228
|
return d;
|
|
227
229
|
}, new R()).getMatrix(), g = new R();
|
|
228
|
-
new R(
|
|
229
|
-
const
|
|
230
|
-
|
|
230
|
+
new R(c).forValue((d, l) => {
|
|
231
|
+
const v = h.getCellRaw(d, l);
|
|
232
|
+
v ? g.setValue(d, l, { t: v.t }) : g.setValue(d, l, { t: void 0 });
|
|
231
233
|
}), Object.keys(y.values).forEach((d) => {
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
+
const l = y.values[d];
|
|
235
|
+
l.ranges = z(l.ranges);
|
|
234
236
|
}), b.push({
|
|
235
237
|
id: re.id,
|
|
236
238
|
params: y
|
|
237
239
|
});
|
|
238
|
-
const
|
|
239
|
-
_.push(...
|
|
240
|
+
const S = Ce(e, y);
|
|
241
|
+
_.push(...S);
|
|
240
242
|
}
|
|
241
243
|
if (C.length) {
|
|
242
|
-
p.ranges =
|
|
243
|
-
const
|
|
244
|
-
const
|
|
245
|
-
if (
|
|
246
|
-
const T =
|
|
247
|
-
T !==
|
|
244
|
+
p.ranges = z(p.ranges);
|
|
245
|
+
const c = C.reduce((d, l) => {
|
|
246
|
+
const v = h.getCellRaw(l.row, l.col);
|
|
247
|
+
if (v) {
|
|
248
|
+
const T = B(v.v);
|
|
249
|
+
T !== v.t && d.setValue(l.row, l.col, { t: T });
|
|
248
250
|
}
|
|
249
251
|
return d;
|
|
250
252
|
}, new R()).getMatrix(), g = new R();
|
|
251
|
-
new R(
|
|
252
|
-
const
|
|
253
|
-
|
|
253
|
+
new R(c).forValue((d, l) => {
|
|
254
|
+
const v = h.getCellRaw(d, l);
|
|
255
|
+
v ? g.setValue(d, l, { t: v.t }) : g.setValue(d, l, { t: void 0 });
|
|
254
256
|
}), b.push({
|
|
255
257
|
id: ye.id,
|
|
256
258
|
params: p
|
|
257
259
|
}, {
|
|
258
|
-
id:
|
|
260
|
+
id: H.id,
|
|
259
261
|
params: {
|
|
260
|
-
unitId:
|
|
262
|
+
unitId: u,
|
|
261
263
|
subUnitId: o,
|
|
262
|
-
cellValue:
|
|
264
|
+
cellValue: c
|
|
263
265
|
}
|
|
264
266
|
});
|
|
265
|
-
const
|
|
267
|
+
const S = be(e, p);
|
|
266
268
|
_.push({
|
|
267
|
-
id:
|
|
269
|
+
id: H.id,
|
|
268
270
|
params: {
|
|
269
|
-
unitId:
|
|
271
|
+
unitId: u,
|
|
270
272
|
subUnitId: o,
|
|
271
273
|
cellValue: g.getMatrix()
|
|
272
274
|
}
|
|
273
|
-
}, ...
|
|
275
|
+
}, ...S);
|
|
274
276
|
}
|
|
275
277
|
const m = le(b, t).result;
|
|
276
278
|
return m && s.pushUndoRedo({
|
|
277
|
-
unitID:
|
|
279
|
+
unitID: u,
|
|
278
280
|
undoMutations: _,
|
|
279
281
|
redoMutations: b
|
|
280
282
|
}), m;
|
|
@@ -286,46 +288,46 @@ const Fe = [
|
|
|
286
288
|
const r = e.get($), t = e.get(j), n = e.get(Z), s = e.get(V), a = t.getCurrentSelections();
|
|
287
289
|
if (!a || !a.length)
|
|
288
290
|
return !1;
|
|
289
|
-
const
|
|
290
|
-
if (!
|
|
291
|
-
const { unitId: o, subUnitId: h } =
|
|
292
|
-
let
|
|
291
|
+
const u = W(s);
|
|
292
|
+
if (!u) return !1;
|
|
293
|
+
const { unitId: o, subUnitId: h } = u;
|
|
294
|
+
let f = 0;
|
|
293
295
|
a.forEach((b) => {
|
|
294
296
|
N.foreach(b.range, (_, m) => {
|
|
295
|
-
const
|
|
296
|
-
if (!
|
|
297
|
-
const
|
|
298
|
-
if (!
|
|
299
|
-
const d = /\.(\d*)$/.exec(String(
|
|
297
|
+
const c = n.getValue(o, h, _, m);
|
|
298
|
+
if (!c) {
|
|
299
|
+
const S = u.worksheet.getCellRaw(_, m);
|
|
300
|
+
if (!f && S && S.t === M.NUMBER && S.v) {
|
|
301
|
+
const d = /\.(\d*)$/.exec(String(S.v));
|
|
300
302
|
if (d) {
|
|
301
|
-
const
|
|
302
|
-
if (!
|
|
303
|
+
const l = d[1].length;
|
|
304
|
+
if (!l)
|
|
303
305
|
return;
|
|
304
|
-
|
|
306
|
+
f = Math.max(f, l);
|
|
305
307
|
}
|
|
306
308
|
}
|
|
307
309
|
return;
|
|
308
310
|
}
|
|
309
|
-
const g = P(
|
|
310
|
-
|
|
311
|
+
const g = P(c.pattern);
|
|
312
|
+
f = g > f ? g : f;
|
|
311
313
|
});
|
|
312
314
|
});
|
|
313
|
-
const C =
|
|
315
|
+
const C = f + 1, y = F(`0${C > 0 ? ".0" : ""}`, C), p = [];
|
|
314
316
|
return a.forEach((b) => {
|
|
315
317
|
N.foreach(b.range, (_, m) => {
|
|
316
|
-
const
|
|
317
|
-
if (
|
|
318
|
+
const c = n.getValue(o, h, _, m);
|
|
319
|
+
if (G(c == null ? void 0 : c.pattern))
|
|
318
320
|
p.push({
|
|
319
321
|
row: _,
|
|
320
322
|
col: m,
|
|
321
323
|
pattern: y
|
|
322
324
|
});
|
|
323
325
|
else {
|
|
324
|
-
const g = P(
|
|
325
|
-
|
|
326
|
+
const g = P(c.pattern), S = F(c.pattern, g + 1);
|
|
327
|
+
S !== c.pattern && p.push({
|
|
326
328
|
row: _,
|
|
327
329
|
col: m,
|
|
328
|
-
pattern:
|
|
330
|
+
pattern: S
|
|
329
331
|
});
|
|
330
332
|
}
|
|
331
333
|
});
|
|
@@ -338,9 +340,9 @@ const Fe = [
|
|
|
338
340
|
const r = e.get($), t = e.get(j), n = e.get(Q), s = t.getCurrentSelections();
|
|
339
341
|
if (!s || !s.length)
|
|
340
342
|
return !1;
|
|
341
|
-
const a = [],
|
|
342
|
-
return s.forEach((
|
|
343
|
-
N.foreach(
|
|
343
|
+
const a = [], u = xe(n.getCurrentLocale()), o = Pe(u.locale);
|
|
344
|
+
return s.forEach((f) => {
|
|
345
|
+
N.foreach(f.range, (C, y) => {
|
|
344
346
|
a.push({ row: C, col: y, pattern: o, type: "currency" });
|
|
345
347
|
});
|
|
346
348
|
}), await r.executeCommand(O.id, { values: a });
|
|
@@ -354,64 +356,64 @@ const Fe = [
|
|
|
354
356
|
return !1;
|
|
355
357
|
const s = [], a = "0%";
|
|
356
358
|
return n.forEach((o) => {
|
|
357
|
-
N.foreach(o.range, (h,
|
|
358
|
-
s.push({ row: h, col:
|
|
359
|
+
N.foreach(o.range, (h, f) => {
|
|
360
|
+
s.push({ row: h, col: f, pattern: a, type: "percent" });
|
|
359
361
|
});
|
|
360
362
|
}), await r.executeCommand(O.id, { values: s });
|
|
361
363
|
}
|
|
362
|
-
},
|
|
364
|
+
}, Ke = {
|
|
363
365
|
id: "sheet.command.numfmt.subtract.decimal.command",
|
|
364
366
|
type: U.COMMAND,
|
|
365
367
|
handler: async (e) => {
|
|
366
368
|
const r = e.get($), t = e.get(j), n = e.get(Z), s = e.get(V), a = t.getCurrentSelections();
|
|
367
369
|
if (!a || !a.length)
|
|
368
370
|
return !1;
|
|
369
|
-
const
|
|
370
|
-
if (!
|
|
371
|
-
const { unitId: o, subUnitId: h } =
|
|
372
|
-
let
|
|
371
|
+
const u = W(s);
|
|
372
|
+
if (!u) return !1;
|
|
373
|
+
const { unitId: o, subUnitId: h } = u;
|
|
374
|
+
let f = 0;
|
|
373
375
|
a.forEach((_) => {
|
|
374
|
-
N.foreach(_.range, (m,
|
|
375
|
-
const g = n.getValue(o, h, m,
|
|
376
|
+
N.foreach(_.range, (m, c) => {
|
|
377
|
+
const g = n.getValue(o, h, m, c);
|
|
376
378
|
if (!g) {
|
|
377
|
-
const d =
|
|
378
|
-
if (!
|
|
379
|
-
const
|
|
380
|
-
if (
|
|
381
|
-
const
|
|
382
|
-
if (!
|
|
379
|
+
const d = u.worksheet.getCellRaw(m, c);
|
|
380
|
+
if (!f && d && d.t === M.NUMBER && d.v) {
|
|
381
|
+
const l = /\.(\d*)$/.exec(String(d.v));
|
|
382
|
+
if (l) {
|
|
383
|
+
const v = l[1].length;
|
|
384
|
+
if (!v)
|
|
383
385
|
return;
|
|
384
|
-
|
|
386
|
+
f = Math.max(f, v);
|
|
385
387
|
}
|
|
386
388
|
}
|
|
387
389
|
return;
|
|
388
390
|
}
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
+
const S = P(g.pattern);
|
|
392
|
+
f = S > f ? S : f;
|
|
391
393
|
});
|
|
392
394
|
});
|
|
393
|
-
const C =
|
|
395
|
+
const C = f - 1, y = F(`0${C > 0 ? ".0" : "."}`, C), p = [];
|
|
394
396
|
return a.forEach((_) => {
|
|
395
|
-
N.foreach(_.range, (m,
|
|
396
|
-
const g = n.getValue(o, h, m,
|
|
397
|
-
if (
|
|
397
|
+
N.foreach(_.range, (m, c) => {
|
|
398
|
+
const g = n.getValue(o, h, m, c);
|
|
399
|
+
if (G(g == null ? void 0 : g.pattern))
|
|
398
400
|
p.push({
|
|
399
401
|
row: m,
|
|
400
|
-
col:
|
|
402
|
+
col: c,
|
|
401
403
|
pattern: y
|
|
402
404
|
});
|
|
403
405
|
else {
|
|
404
|
-
const
|
|
406
|
+
const S = P(g.pattern);
|
|
405
407
|
p.push({
|
|
406
408
|
row: m,
|
|
407
|
-
col:
|
|
408
|
-
pattern: F(g.pattern,
|
|
409
|
+
col: c,
|
|
410
|
+
pattern: F(g.pattern, S - 1)
|
|
409
411
|
});
|
|
410
412
|
}
|
|
411
413
|
});
|
|
412
414
|
}), await r.executeCommand(O.id, { values: p });
|
|
413
415
|
}
|
|
414
|
-
}, se = "sheets-numfmt.config", X = {}, st = (e) => x.getFormatInfo(e).type || "unknown",
|
|
416
|
+
}, se = "sheets-numfmt.config", X = {}, st = (e) => x.getFormatInfo(e).type || "unknown", Be = (e, r, t = "en") => {
|
|
415
417
|
try {
|
|
416
418
|
const n = x.formatColor(e, r), s = n ? String(n) : void 0, a = x.format(e, r, { locale: t, throws: !1 });
|
|
417
419
|
return r < 0 ? {
|
|
@@ -426,13 +428,13 @@ const Fe = [
|
|
|
426
428
|
return {
|
|
427
429
|
result: String(r)
|
|
428
430
|
};
|
|
429
|
-
},
|
|
431
|
+
}, He = (e, r, t) => e === ue ? {
|
|
430
432
|
result: String(we(r))
|
|
431
433
|
// In Excel, the default General format also needs to handle numeric precision.
|
|
432
|
-
} :
|
|
433
|
-
var
|
|
434
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
435
|
-
(
|
|
434
|
+
} : Be(e, r, t);
|
|
435
|
+
var Ge = Object.getOwnPropertyDescriptor, We = (e, r, t, n) => {
|
|
436
|
+
for (var s = n > 1 ? void 0 : n ? Ge(r, t) : r, a = e.length - 1, u; a >= 0; a--)
|
|
437
|
+
(u = e[a]) && (s = u(s) || s);
|
|
436
438
|
return s;
|
|
437
439
|
}, E = (e, r) => (t, n) => r(t, n, e);
|
|
438
440
|
const Ze = {
|
|
@@ -442,34 +444,36 @@ const Ze = {
|
|
|
442
444
|
}
|
|
443
445
|
};
|
|
444
446
|
let D = class extends me {
|
|
445
|
-
constructor(r, t, n, s, a,
|
|
447
|
+
constructor(r, t, n, s, a, u, o) {
|
|
446
448
|
super();
|
|
447
449
|
L(this, "_locale$", new $e("en"));
|
|
448
450
|
L(this, "locale$", this._locale$.asObservable());
|
|
449
|
-
this._instanceService = r, this._sheetInterceptorService = t, this._themeService = n, this._commandService = s, this._numfmtService = a, this._localeService =
|
|
451
|
+
this._instanceService = r, this._sheetInterceptorService = t, this._themeService = n, this._commandService = s, this._numfmtService = a, this._localeService = u, this._configService = o, this._initInterceptorCellContent();
|
|
450
452
|
}
|
|
451
453
|
get locale() {
|
|
452
454
|
const r = this._locale$.getValue();
|
|
453
455
|
if (r)
|
|
454
456
|
return r;
|
|
455
457
|
switch (this._localeService.getCurrentLocale()) {
|
|
456
|
-
case
|
|
458
|
+
case i.FR_FR:
|
|
457
459
|
return "fr";
|
|
458
|
-
case
|
|
460
|
+
case i.RU_RU:
|
|
459
461
|
return "ru";
|
|
460
|
-
case
|
|
462
|
+
case i.VI_VN:
|
|
461
463
|
return "vi";
|
|
462
|
-
case
|
|
464
|
+
case i.ZH_CN:
|
|
463
465
|
return "zh-CN";
|
|
464
|
-
case
|
|
466
|
+
case i.KO_KR:
|
|
465
467
|
return "ko";
|
|
466
|
-
case
|
|
468
|
+
case i.ZH_TW:
|
|
467
469
|
return "zh-TW";
|
|
468
|
-
case
|
|
469
|
-
case
|
|
470
|
+
case i.ES_ES:
|
|
471
|
+
case i.CA_ES:
|
|
470
472
|
return "es";
|
|
471
|
-
case
|
|
472
|
-
|
|
473
|
+
case i.SK_SK:
|
|
474
|
+
return "sk";
|
|
475
|
+
case i.EN_US:
|
|
476
|
+
case i.FA_IR:
|
|
473
477
|
default:
|
|
474
478
|
return "en";
|
|
475
479
|
}
|
|
@@ -480,31 +484,31 @@ let D = class extends me {
|
|
|
480
484
|
this.disposeWithMe(Ie(this._locale$, this._localeService.currentLocale$).subscribe(() => {
|
|
481
485
|
r.reset();
|
|
482
486
|
})), this.disposeWithMe(this._sheetInterceptorService.intercept(Re.CELL_CONTENT, {
|
|
483
|
-
effect:
|
|
487
|
+
effect: k.Value | k.Style,
|
|
484
488
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
485
489
|
handler: (t, n, s) => {
|
|
486
490
|
var b, _;
|
|
487
491
|
if (!t || t.v === void 0 || t.v === null || t.t === M.BOOLEAN || t.t === M.FORCE_STRING)
|
|
488
492
|
return s(t);
|
|
489
|
-
const a = n.unitId,
|
|
493
|
+
const a = n.unitId, u = n.subUnitId;
|
|
490
494
|
let o;
|
|
491
495
|
if (t != null && t.s) {
|
|
492
496
|
const m = n.workbook.getStyles().get(t.s);
|
|
493
497
|
m != null && m.n && (o = m.n);
|
|
494
498
|
}
|
|
495
|
-
if (o || (o = this._numfmtService.getValue(a,
|
|
499
|
+
if (o || (o = this._numfmtService.getValue(a, u, n.row, n.col)), G(o == null ? void 0 : o.pattern) || t.t !== M.NUMBER && B(t.v, t.t) !== M.NUMBER)
|
|
496
500
|
return s(t);
|
|
497
501
|
const h = t;
|
|
498
502
|
if ((!t || t === n.rawData) && (t = { ...n.rawData }), J(o == null ? void 0 : o.pattern))
|
|
499
503
|
return (b = this._configService.getConfig(se)) != null && b.disableTextFormatMark ? (t.t = M.STRING, s(t)) : (t.t = M.STRING, t.markers = { ...t == null ? void 0 : t.markers, ...Ze }, s(t));
|
|
500
|
-
let
|
|
504
|
+
let f = "";
|
|
501
505
|
const C = r.getValue(n.row, n.col);
|
|
502
506
|
if (C && C.parameters === `${h.v}_${o == null ? void 0 : o.pattern}`)
|
|
503
507
|
return s({ ...t, ...C.result });
|
|
504
|
-
const y =
|
|
505
|
-
if (
|
|
508
|
+
const y = He(o == null ? void 0 : o.pattern, Number(h.v), this.locale);
|
|
509
|
+
if (f = y.result, !f)
|
|
506
510
|
return s(t);
|
|
507
|
-
const p = { v:
|
|
511
|
+
const p = { v: f, t: M.NUMBER };
|
|
508
512
|
if (y.color) {
|
|
509
513
|
const m = (_ = this._themeService.getColorFromTheme(`${y.color}.500`)) != null ? _ : y.color;
|
|
510
514
|
m && (p.interceptorStyle = { cl: { rgb: m } });
|
|
@@ -519,20 +523,20 @@ let D = class extends me {
|
|
|
519
523
|
if (t.id === re.id) {
|
|
520
524
|
const n = t.params;
|
|
521
525
|
Object.keys(n.values).forEach((s) => {
|
|
522
|
-
n.values[s].ranges.forEach((
|
|
523
|
-
N.foreach(
|
|
526
|
+
n.values[s].ranges.forEach((u) => {
|
|
527
|
+
N.foreach(u, (o, h) => {
|
|
524
528
|
r.realDeleteValue(o, h);
|
|
525
529
|
});
|
|
526
530
|
});
|
|
527
531
|
});
|
|
528
|
-
} else if (t.id ===
|
|
532
|
+
} else if (t.id === H.id) {
|
|
529
533
|
const n = t.params;
|
|
530
534
|
new R(n.cellValue).forValue((s, a) => {
|
|
531
535
|
r.realDeleteValue(s, a);
|
|
532
536
|
});
|
|
533
537
|
}
|
|
534
538
|
})), this.disposeWithMe(
|
|
535
|
-
this._instanceService.getCurrentTypeOfUnit$(
|
|
539
|
+
this._instanceService.getCurrentTypeOfUnit$(ee.UNIVER_SHEET).pipe(
|
|
536
540
|
Te((t) => {
|
|
537
541
|
var n;
|
|
538
542
|
return (n = t == null ? void 0 : t.activeSheet$) != null ? n : Ue(null);
|
|
@@ -545,21 +549,21 @@ let D = class extends me {
|
|
|
545
549
|
this._locale$.next(r);
|
|
546
550
|
}
|
|
547
551
|
};
|
|
548
|
-
D =
|
|
552
|
+
D = We([
|
|
549
553
|
E(0, V),
|
|
550
554
|
E(1, I(Me)),
|
|
551
555
|
E(2, I(fe)),
|
|
552
556
|
E(3, I($)),
|
|
553
557
|
E(4, I(Z)),
|
|
554
558
|
E(5, I(Q)),
|
|
555
|
-
E(6,
|
|
559
|
+
E(6, te)
|
|
556
560
|
], D);
|
|
557
|
-
const
|
|
558
|
-
var
|
|
559
|
-
for (var s = n > 1 ? void 0 : n ? Ye(r, t) : r, a = e.length - 1,
|
|
560
|
-
(
|
|
561
|
+
const ke = "SHEET_NUMFMT_PLUGIN";
|
|
562
|
+
var ze = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, qe = (e, r, t) => r in e ? ze(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, Xe = (e, r, t, n) => {
|
|
563
|
+
for (var s = n > 1 ? void 0 : n ? Ye(r, t) : r, a = e.length - 1, u; a >= 0; a--)
|
|
564
|
+
(u = e[a]) && (s = u(s) || s);
|
|
561
565
|
return s;
|
|
562
|
-
},
|
|
566
|
+
}, K = (e, r) => (t, n) => r(t, n, e), oe = (e, r, t) => qe(e, typeof r != "symbol" ? r + "" : r, t);
|
|
563
567
|
let A = class extends he {
|
|
564
568
|
constructor(e = X, r, t, n) {
|
|
565
569
|
super(), this._config = e, this._injector = r, this._configService = t, this._commandService = n;
|
|
@@ -573,11 +577,11 @@ let A = class extends he {
|
|
|
573
577
|
onStarting() {
|
|
574
578
|
_e(this._injector, [
|
|
575
579
|
[D]
|
|
576
|
-
]),
|
|
580
|
+
]), Se(this._injector, [
|
|
577
581
|
[D]
|
|
578
582
|
]), [
|
|
579
583
|
Ve,
|
|
580
|
-
|
|
584
|
+
Ke,
|
|
581
585
|
je,
|
|
582
586
|
Le,
|
|
583
587
|
O
|
|
@@ -586,19 +590,19 @@ let A = class extends he {
|
|
|
586
590
|
});
|
|
587
591
|
}
|
|
588
592
|
};
|
|
589
|
-
oe(A, "pluginName",
|
|
590
|
-
oe(A, "type",
|
|
593
|
+
oe(A, "pluginName", ke);
|
|
594
|
+
oe(A, "type", ee.UNIVER_SHEET);
|
|
591
595
|
A = Xe([
|
|
592
596
|
de(Ne),
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
597
|
+
K(1, I(ge)),
|
|
598
|
+
K(2, te),
|
|
599
|
+
K(3, $)
|
|
596
600
|
], A);
|
|
597
|
-
const ot = (e) => ne.find((t) => e.includes(t)), at = () => ne.map((e) => ({ label: e, value: e })),
|
|
601
|
+
const ot = (e) => ne.find((t) => e.includes(t)), at = () => ne.map((e) => ({ label: e, value: e })), ct = (e) => Ae.map((r) => ({
|
|
598
602
|
label: r.label(e),
|
|
599
603
|
value: r.suffix(e),
|
|
600
604
|
color: r.color
|
|
601
|
-
})),
|
|
605
|
+
})), it = () => Fe.map((e) => ({ label: e.label, value: e.suffix })), lt = () => De.map((e) => ({ label: e.label, value: e.suffix, color: e.color }));
|
|
602
606
|
export {
|
|
603
607
|
Ve as AddDecimalCommand,
|
|
604
608
|
Ae as CURRENCYFORMAT,
|
|
@@ -609,21 +613,21 @@ export {
|
|
|
609
613
|
O as SetNumfmtCommand,
|
|
610
614
|
Le as SetPercentCommand,
|
|
611
615
|
D as SheetsNumfmtCellContentController,
|
|
612
|
-
|
|
616
|
+
Ke as SubtractDecimalCommand,
|
|
613
617
|
A as UniverSheetsNumfmtPlugin,
|
|
614
618
|
ne as currencySymbols,
|
|
615
619
|
Pe as getCurrencyFormat,
|
|
616
|
-
|
|
620
|
+
ct as getCurrencyFormatOptions,
|
|
617
621
|
at as getCurrencyOptions,
|
|
618
622
|
Y as getCurrencySymbolByLocale,
|
|
619
623
|
xe as getCurrencySymbolIconByLocale,
|
|
620
624
|
ot as getCurrencyType,
|
|
621
|
-
|
|
625
|
+
it as getDateFormatOptions,
|
|
622
626
|
P as getDecimalFromPattern,
|
|
623
627
|
q as getDecimalString,
|
|
624
628
|
lt as getNumberFormatOptions,
|
|
625
|
-
|
|
626
|
-
|
|
629
|
+
Be as getPatternPreview,
|
|
630
|
+
He as getPatternPreviewIgnoreGeneral,
|
|
627
631
|
st as getPatternType,
|
|
628
632
|
nt as isPatternHasDecimal,
|
|
629
633
|
w as localeCurrencySymbolMap,
|