@univerjs/sheets-numfmt 0.1.2 → 0.1.4
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/README.md +2 -0
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +331 -454
- package/lib/index.css +1 -1
- package/lib/types/controllers/numfmt.cell-content.controller.d.ts +3 -2
- package/lib/types/locale/zh-CN.d.ts +1 -0
- package/lib/types/utils/pattern.d.ts +2 -1
- package/lib/umd/index.js +2 -2
- package/package.json +27 -25
- /package/lib/types/components/stories/{panel.stories.d.ts → Panel.stories.d.ts} +0 -0
package/lib/es/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
var $t = Object.defineProperty;
|
|
2
2
|
var Ut = (e, t, r) => t in e ? $t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var Y = (e, t, r) => (Ut(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
-
import { CommandType as X, ICommandService as
|
|
5
|
-
import { transformCellsToRange as me, rangeMerge as z, SetNumfmtMutation as w, factorySetNumfmtUndoMutation as he, RemoveNumfmtMutation as M, factoryRemoveNumfmtUndoMutation as J, INumfmtService as
|
|
6
|
-
import { Inject as g, Injector as K, createIdentifier as
|
|
7
|
-
import { IAutoFillService as
|
|
8
|
-
import { map as le, distinctUntilChanged as
|
|
9
|
-
import
|
|
10
|
-
import { IRenderManagerService as
|
|
11
|
-
import { ComponentManager as
|
|
12
|
-
import { Observable as
|
|
13
|
-
import
|
|
14
|
-
import { InputNumber as
|
|
15
|
-
import { useDependency as
|
|
16
|
-
import { FormulaDataModel as
|
|
4
|
+
import { CommandType as X, ICommandService as D, IUniverInstanceService as E, IUndoRedoService as At, sequenceExecute as Lt, Tools as Vt, Disposable as H, OnLifecycle as k, LifecycleStages as $, Range as R, Rectangle as De, LocaleType as Ht, ObjectMatrix as ut, CellValueType as ie, toDisposable as q, ThemeService as dt, LocaleService as j, runOnLifecycle as kt, ILocalStorageService as Ft, DisposableCollection as mt, UniverInstanceType as de, Plugin as Bt, PluginType as zt } from "@univerjs/core";
|
|
5
|
+
import { transformCellsToRange as me, rangeMerge as z, SetNumfmtMutation as w, factorySetNumfmtUndoMutation as he, RemoveNumfmtMutation as M, factoryRemoveNumfmtUndoMutation as J, INumfmtService as U, INTERCEPTOR_POINT as ht, SheetInterceptorService as Ae, SelectionManagerService as ee, ClearSelectionFormatCommand as Wt, ClearSelectionAllCommand as Kt, SetRangeValuesCommand as Gt, getCurrentSheetDisabled$ as fe, RefRangeService as Yt, EffectRefRangId as N, handleMoveRows as Zt, handleMoveCols as qt, handleIRemoveRow as Jt, handleIRemoveCol as Qt, handleMoveRange as Xt, handleInsertRow as en, handleInsertRangeMoveRight as tn, handleInsertRangeMoveDown as nn, handleInsertCol as rn, handleDeleteRangeMoveUp as sn, handleDeleteRangeMoveLeft as an, runRefRangeMutations as on, RemoveSheetCommand as cn } from "@univerjs/sheets";
|
|
6
|
+
import { Inject as g, Injector as K, createIdentifier as ln } from "@wendellhu/redi";
|
|
7
|
+
import { IAutoFillService as un, APPLY_TYPE as He, getAutoFillRepeatRange as dn, SheetSkeletonManagerService as Ke, COPY_TYPE as rt, PREDEFINED_HOOK_NAME as st, getRepeatRange as mn, ISheetClipboardService as hn, IEditorBridgeService as fn } from "@univerjs/sheets-ui";
|
|
8
|
+
import { map as le, distinctUntilChanged as ft, switchMap as pt, tap as pn, debounceTime as vn, filter as it, bufferTime as gn } from "rxjs/operators";
|
|
9
|
+
import V from "@univerjs/engine-numfmt";
|
|
10
|
+
import { IRenderManagerService as _n, ITextSelectionRenderManager as Sn } from "@univerjs/engine-render";
|
|
11
|
+
import { ComponentManager as vt, ISidebarService as Cn, MenuItemType as pe, MenuGroup as ve, MenuPosition as ge, getMenuHiddenObservable as _e, IMenuService as bn } from "@univerjs/ui";
|
|
12
|
+
import { Observable as Z, combineLatest as yn, merge as Ge } from "rxjs";
|
|
13
|
+
import Rn, { createContext as In, useState as x, useEffect as Ye, useRef as Ze, useContext as gt, useMemo as L, createElement as te, forwardRef as ae } from "react";
|
|
14
|
+
import { InputNumber as qe, Select as Je, SelectList as Qe, Button as at } from "@univerjs/design";
|
|
15
|
+
import { useDependency as T, useInjector as Mn } from "@wendellhu/redi/react-bindings";
|
|
16
|
+
import { FormulaDataModel as Pn } from "@univerjs/engine-formula";
|
|
17
17
|
const Q = {
|
|
18
18
|
id: "sheet.command.numfmt.set.numfmt",
|
|
19
19
|
type: X.COMMAND,
|
|
20
20
|
handler: (e, t) => {
|
|
21
21
|
if (!t)
|
|
22
22
|
return !1;
|
|
23
|
-
const r = e.get(
|
|
23
|
+
const r = e.get(D), n = e.get(E), s = e.get(At), i = n.getCurrentUniverSheetInstance(), a = i.getUnitId(), c = i.getActiveSheet().getSheetId(), d = t.values.filter((f) => !!f.pattern), l = t.values.filter((f) => !f.pattern), u = me(a, c, d), m = {
|
|
24
24
|
unitId: a,
|
|
25
25
|
subUnitId: c,
|
|
26
26
|
ranges: l.map((f) => ({
|
|
@@ -59,6 +59,7 @@ const Q = {
|
|
|
59
59
|
}, On = {
|
|
60
60
|
sheet: {
|
|
61
61
|
numfmt: {
|
|
62
|
+
percent: "Percentage",
|
|
62
63
|
title: "Number format",
|
|
63
64
|
numfmtType: "Format types",
|
|
64
65
|
cancel: "Cancel",
|
|
@@ -90,10 +91,11 @@ const Q = {
|
|
|
90
91
|
subtractDecimal: "Decreasing decimal places"
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
},
|
|
94
|
+
}, xn = On, wn = {
|
|
94
95
|
sheet: {
|
|
95
96
|
numfmt: {
|
|
96
|
-
|
|
97
|
+
percent: "百分比",
|
|
98
|
+
title: "数字格式",
|
|
97
99
|
numfmtType: "格式类型",
|
|
98
100
|
cancel: "取消",
|
|
99
101
|
confirm: "确认",
|
|
@@ -124,7 +126,7 @@ const Q = {
|
|
|
124
126
|
subtractDecimal: "减少小数位"
|
|
125
127
|
}
|
|
126
128
|
}
|
|
127
|
-
},
|
|
129
|
+
}, jn = wn, ue = "SHEET_NUMFMT_PLUGIN", Ee = (e) => {
|
|
128
130
|
const t = e.filter((i) => i.id === M.id).map((i) => i.params), r = e.filter((i) => i.id === w.id).map((i) => i.params), n = [];
|
|
129
131
|
if (t[0]) {
|
|
130
132
|
const i = t.reduce(
|
|
@@ -171,10 +173,10 @@ const Q = {
|
|
|
171
173
|
}
|
|
172
174
|
return n;
|
|
173
175
|
};
|
|
174
|
-
var
|
|
175
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
176
|
+
var Nn = Object.defineProperty, Tn = Object.getOwnPropertyDescriptor, Dn = (e, t, r, n) => {
|
|
177
|
+
for (var s = n > 1 ? void 0 : n ? Tn(t, r) : t, i = e.length - 1, a; i >= 0; i--)
|
|
176
178
|
(a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
|
|
177
|
-
return n && s &&
|
|
179
|
+
return n && s && Nn(t, r, s), s;
|
|
178
180
|
}, Ce = (e, t) => (r, n) => t(r, n, e);
|
|
179
181
|
let Re = class extends H {
|
|
180
182
|
constructor(e, t, r, n) {
|
|
@@ -241,7 +243,7 @@ let Re = class extends H {
|
|
|
241
243
|
row: s.startRow,
|
|
242
244
|
col: s.startColumn
|
|
243
245
|
};
|
|
244
|
-
return
|
|
246
|
+
return dn(s, i).forEach((l) => {
|
|
245
247
|
const { undos: u, redos: m } = t(c, l.repeatStartCell, l.relativeRange);
|
|
246
248
|
a.push(...u), o.push(...m);
|
|
247
249
|
}), {
|
|
@@ -261,47 +263,47 @@ let Re = class extends H {
|
|
|
261
263
|
this.disposeWithMe(this._autoFillService.addHook(n));
|
|
262
264
|
}
|
|
263
265
|
};
|
|
264
|
-
Re =
|
|
265
|
-
k(
|
|
266
|
+
Re = Dn([
|
|
267
|
+
k($.Rendered, Re),
|
|
266
268
|
Ce(0, g(K)),
|
|
267
|
-
Ce(1, g(
|
|
268
|
-
Ce(2, g(
|
|
269
|
-
Ce(3, g(
|
|
269
|
+
Ce(1, g(E)),
|
|
270
|
+
Ce(2, g(U)),
|
|
271
|
+
Ce(3, g(un))
|
|
270
272
|
], Re);
|
|
271
|
-
const Xe = (e) =>
|
|
272
|
-
const n =
|
|
273
|
+
const Xe = (e) => V.getInfo(e).type || "unknown", et = (e, t, r) => {
|
|
274
|
+
const n = V.getInfo(e), s = r === Ht.ZH_CN ? "zh-CN" : "en", i = n._partitions[1], a = V.format(e, t, { locale: s });
|
|
273
275
|
return t < 0 ? {
|
|
274
|
-
result:
|
|
275
|
-
color:
|
|
276
|
+
result: a,
|
|
277
|
+
color: i.color
|
|
276
278
|
} : {
|
|
277
|
-
result:
|
|
279
|
+
result: a
|
|
278
280
|
};
|
|
279
281
|
};
|
|
280
|
-
var
|
|
281
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
282
|
+
var En = Object.defineProperty, $n = Object.getOwnPropertyDescriptor, Un = (e, t, r, n) => {
|
|
283
|
+
for (var s = n > 1 ? void 0 : n ? $n(t, r) : t, i = e.length - 1, a; i >= 0; i--)
|
|
282
284
|
(a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
|
|
283
|
-
return n && s &&
|
|
284
|
-
},
|
|
285
|
+
return n && s && En(t, r, s), s;
|
|
286
|
+
}, re = (e, t) => (r, n) => t(r, n, e);
|
|
285
287
|
let Ie = class extends H {
|
|
286
|
-
constructor(e, t, r, n, s) {
|
|
287
|
-
super(), this._sheetInterceptorService = e, this._themeService = t, this._sheetSkeletonManagerService = r, this._commandService = n, this._numfmtService = s, this._initInterceptorCellContent();
|
|
288
|
+
constructor(e, t, r, n, s, i) {
|
|
289
|
+
super(), this._sheetInterceptorService = e, this._themeService = t, this._sheetSkeletonManagerService = r, this._commandService = n, this._numfmtService = s, this._localeService = i, this._initInterceptorCellContent();
|
|
288
290
|
}
|
|
289
291
|
_initInterceptorCellContent() {
|
|
290
|
-
const e = new
|
|
292
|
+
const e = new ut();
|
|
291
293
|
this.disposeWithMe(
|
|
292
|
-
this._sheetInterceptorService.intercept(
|
|
294
|
+
this._sheetInterceptorService.intercept(ht.CELL_CONTENT, {
|
|
293
295
|
handler: (t, r, n) => {
|
|
294
296
|
const s = r.unitId, i = r.subUnitId, a = this._numfmtService.getValue(s, i, r.row, r.col);
|
|
295
297
|
if (!a)
|
|
296
298
|
return n(t);
|
|
297
299
|
const o = t;
|
|
298
|
-
if (!o || o.t !==
|
|
300
|
+
if (!o || o.t !== ie.NUMBER)
|
|
299
301
|
return n(t);
|
|
300
302
|
let c = "";
|
|
301
303
|
const d = e.getValue(r.row, r.col);
|
|
302
304
|
if (d && d.parameters === o.v)
|
|
303
305
|
return { ...t, ...d.result };
|
|
304
|
-
const l =
|
|
306
|
+
const l = et(a.pattern, Number(o.v), this._localeService.getCurrentLocale());
|
|
305
307
|
if (c = l.result, !c)
|
|
306
308
|
return n(t);
|
|
307
309
|
const u = { v: c };
|
|
@@ -329,10 +331,10 @@ let Ie = class extends H {
|
|
|
329
331
|
}
|
|
330
332
|
})
|
|
331
333
|
), this.disposeWithMe(
|
|
332
|
-
|
|
334
|
+
q(
|
|
333
335
|
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
334
336
|
le((t) => t == null ? void 0 : t.sheetId),
|
|
335
|
-
|
|
337
|
+
ft()
|
|
336
338
|
).subscribe(() => {
|
|
337
339
|
e.reset();
|
|
338
340
|
})
|
|
@@ -340,17 +342,18 @@ let Ie = class extends H {
|
|
|
340
342
|
);
|
|
341
343
|
}
|
|
342
344
|
};
|
|
343
|
-
Ie =
|
|
344
|
-
k(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
345
|
+
Ie = Un([
|
|
346
|
+
k($.Rendered, Ie),
|
|
347
|
+
re(0, g(Ae)),
|
|
348
|
+
re(1, g(dt)),
|
|
349
|
+
re(2, g(Ke)),
|
|
350
|
+
re(3, g(D)),
|
|
351
|
+
re(4, g(U)),
|
|
352
|
+
re(5, g(j))
|
|
350
353
|
], Ie);
|
|
351
354
|
const W = (e, t = 0) => {
|
|
352
355
|
var n;
|
|
353
|
-
return e && (n =
|
|
356
|
+
return e && (n = V.getInfo(e).maxDecimals) != null ? n : t;
|
|
354
357
|
}, Le = (e, t) => {
|
|
355
358
|
if (e && !t || !e && t)
|
|
356
359
|
return !1;
|
|
@@ -362,19 +365,19 @@ const W = (e, t = 0) => {
|
|
|
362
365
|
return u.type === "point" ? (l.isEnd = !0, l) : { ...l, result: l.result + m };
|
|
363
366
|
},
|
|
364
367
|
{ isEnd: !1, result: "" }
|
|
365
|
-
).result, n =
|
|
368
|
+
).result, n = V.getInfo(e)._partitions, s = V.getInfo(t)._partitions, i = r(n[0].tokens), a = r(s[0].tokens), o = r(n[1].tokens), c = r(s[1].tokens);
|
|
366
369
|
return i === a && o === c && n[1].color === s[1].color;
|
|
367
|
-
},
|
|
370
|
+
}, ot = (e) => new Array(Math.min(Math.max(0, Number(e)), 30)).fill(0).join(""), I = (e, t) => e.split(";").map((n) => /\.0?/.test(n) ? n.replace(
|
|
368
371
|
/\.0*/g,
|
|
369
|
-
`${t > 0 ? "." : ""}${
|
|
372
|
+
`${t > 0 ? "." : ""}${ot(Number(t || 0))}`
|
|
370
373
|
) : /0([^0]?)|0$/.test(n) ? n.replace(
|
|
371
374
|
/0([^0]+)|0$/,
|
|
372
|
-
`0${t > 0 ? "." : ""}${
|
|
373
|
-
) : n).join(";"),
|
|
375
|
+
`0${t > 0 ? "." : ""}${ot(Number(t || 0))}$1`
|
|
376
|
+
) : n).join(";"), An = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), _t = {
|
|
374
377
|
id: "sheet.command.numfmt.add.decimal.command",
|
|
375
378
|
type: X.COMMAND,
|
|
376
379
|
handler: async (e) => {
|
|
377
|
-
const t = e.get(
|
|
380
|
+
const t = e.get(D), r = e.get(ee), n = e.get(U), s = e.get(E), i = r.getSelections();
|
|
378
381
|
if (!i || !i.length)
|
|
379
382
|
return !1;
|
|
380
383
|
const a = s.getCurrentUniverSheetInstance(), o = a.getActiveSheet(), c = a.getUnitId(), d = o.getSheetId();
|
|
@@ -409,7 +412,7 @@ const W = (e, t = 0) => {
|
|
|
409
412
|
});
|
|
410
413
|
}), h.length ? await t.executeCommand(Q.id, { values: h }) : !1;
|
|
411
414
|
}
|
|
412
|
-
},
|
|
415
|
+
}, Ln = [
|
|
413
416
|
{
|
|
414
417
|
label: "1930-08-05",
|
|
415
418
|
suffix: "yyyy-MM-dd"
|
|
@@ -454,7 +457,7 @@ const W = (e, t = 0) => {
|
|
|
454
457
|
label: "08-05 下午 01:30",
|
|
455
458
|
suffix: "MM-dd A/P hh:mm"
|
|
456
459
|
}
|
|
457
|
-
],
|
|
460
|
+
], Vn = [
|
|
458
461
|
{
|
|
459
462
|
label: "(1,235)",
|
|
460
463
|
suffix: "#,##0_);(#,##0)"
|
|
@@ -514,7 +517,7 @@ const W = (e, t = 0) => {
|
|
|
514
517
|
id: "sheet.command.numfmt.set.currency",
|
|
515
518
|
type: X.COMMAND,
|
|
516
519
|
handler: async (e) => {
|
|
517
|
-
const t = e.get(
|
|
520
|
+
const t = e.get(D), n = e.get(ee).getSelections();
|
|
518
521
|
if (!n || !n.length)
|
|
519
522
|
return !1;
|
|
520
523
|
const s = [], i = St[0].suffix("¥");
|
|
@@ -528,7 +531,7 @@ const W = (e, t = 0) => {
|
|
|
528
531
|
id: "sheet.command.numfmt.subtract.decimal.command",
|
|
529
532
|
type: X.COMMAND,
|
|
530
533
|
handler: async (e) => {
|
|
531
|
-
const t = e.get(
|
|
534
|
+
const t = e.get(D), r = e.get(ee), n = e.get(U), s = e.get(E), i = r.getSelections();
|
|
532
535
|
if (!i || !i.length)
|
|
533
536
|
return !1;
|
|
534
537
|
const a = s.getCurrentUniverSheetInstance(), o = a.getActiveSheet(), c = a.getUnitId(), d = o.getSheetId();
|
|
@@ -570,12 +573,12 @@ const W = (e, t = 0) => {
|
|
|
570
573
|
// do nothing,just notify panel is closed
|
|
571
574
|
!0
|
|
572
575
|
)
|
|
573
|
-
},
|
|
574
|
-
|
|
576
|
+
}, tt = ln("INumfmtController");
|
|
577
|
+
kt($.Rendered, tt);
|
|
575
578
|
const $e = {
|
|
576
579
|
id: "sheet.operation.open.numfmt.panel",
|
|
577
580
|
type: X.OPERATION,
|
|
578
|
-
handler: (e) => (e.get(
|
|
581
|
+
handler: (e) => (e.get(tt).openPanel(), !0)
|
|
579
582
|
};
|
|
580
583
|
var yt = { exports: {} }, Ve = {};
|
|
581
584
|
/**
|
|
@@ -587,23 +590,23 @@ var yt = { exports: {} }, Ve = {};
|
|
|
587
590
|
* This source code is licensed under the MIT license found in the
|
|
588
591
|
* LICENSE file in the root directory of this source tree.
|
|
589
592
|
*/
|
|
590
|
-
var
|
|
593
|
+
var Hn = Rn, kn = Symbol.for("react.element"), Fn = Symbol.for("react.fragment"), Bn = Object.prototype.hasOwnProperty, zn = Hn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Wn = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
591
594
|
function Rt(e, t, r) {
|
|
592
595
|
var n, s = {}, i = null, a = null;
|
|
593
596
|
r !== void 0 && (i = "" + r), t.key !== void 0 && (i = "" + t.key), t.ref !== void 0 && (a = t.ref);
|
|
594
597
|
for (n in t)
|
|
595
|
-
|
|
598
|
+
Bn.call(t, n) && !Wn.hasOwnProperty(n) && (s[n] = t[n]);
|
|
596
599
|
if (e && e.defaultProps)
|
|
597
600
|
for (n in t = e.defaultProps, t)
|
|
598
601
|
s[n] === void 0 && (s[n] = t[n]);
|
|
599
|
-
return { $$typeof:
|
|
602
|
+
return { $$typeof: kn, type: e, key: i, ref: a, props: s, _owner: zn.current };
|
|
600
603
|
}
|
|
601
|
-
Ve.Fragment =
|
|
604
|
+
Ve.Fragment = Fn;
|
|
602
605
|
Ve.jsx = Rt;
|
|
603
606
|
Ve.jsxs = Rt;
|
|
604
607
|
yt.exports = Ve;
|
|
605
608
|
var p = yt.exports;
|
|
606
|
-
const
|
|
609
|
+
const nt = In([]), We = [
|
|
607
610
|
"$",
|
|
608
611
|
"£",
|
|
609
612
|
"¥",
|
|
@@ -632,11 +635,11 @@ const tt = Rn([]), We = [
|
|
|
632
635
|
"₾",
|
|
633
636
|
"₿"
|
|
634
637
|
];
|
|
635
|
-
var
|
|
636
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
638
|
+
var Kn = Object.defineProperty, Gn = Object.getOwnPropertyDescriptor, Yn = (e, t, r, n) => {
|
|
639
|
+
for (var s = n > 1 ? void 0 : n ? Gn(t, r) : t, i = e.length - 1, a; i >= 0; i--)
|
|
637
640
|
(a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
|
|
638
|
-
return n && s &&
|
|
639
|
-
},
|
|
641
|
+
return n && s && Kn(t, r, s), s;
|
|
642
|
+
}, Zn = (e, t) => (r, n) => t(r, n, e);
|
|
640
643
|
let Ue = class {
|
|
641
644
|
constructor(e) {
|
|
642
645
|
this._localStorageService = e;
|
|
@@ -681,22 +684,22 @@ let Ue = class {
|
|
|
681
684
|
this._localStorageService.removeItem(e);
|
|
682
685
|
}
|
|
683
686
|
};
|
|
684
|
-
Ue =
|
|
685
|
-
|
|
687
|
+
Ue = Yn([
|
|
688
|
+
Zn(0, g(Ft))
|
|
686
689
|
], Ue);
|
|
687
|
-
const
|
|
688
|
-
const t =
|
|
690
|
+
const ct = "numfmtCurrency", qn = (e) => {
|
|
691
|
+
const t = T(Ue), [r, n] = x(We);
|
|
689
692
|
return Ye(() => {
|
|
690
693
|
t.addHabit("numfmtCurrency", []).then(() => {
|
|
691
|
-
t.getHabit(
|
|
694
|
+
t.getHabit(ct, [...We]).then((i) => {
|
|
692
695
|
n(i), e && e(i);
|
|
693
696
|
});
|
|
694
697
|
});
|
|
695
698
|
}, []), { userHabitCurrency: r, mark: (i) => {
|
|
696
|
-
t.markHabit(
|
|
699
|
+
t.markHabit(ct, i);
|
|
697
700
|
} };
|
|
698
|
-
},
|
|
699
|
-
const e =
|
|
701
|
+
}, Jn = () => {
|
|
702
|
+
const e = Ze([]), [t, r] = x({});
|
|
700
703
|
return Ye(() => {
|
|
701
704
|
e.current.forEach((s) => {
|
|
702
705
|
s();
|
|
@@ -704,8 +707,8 @@ const ot = "numfmtCurrency", qn = (e) => {
|
|
|
704
707
|
}, [t]), (s) => {
|
|
705
708
|
e.current.push(s), r({});
|
|
706
709
|
};
|
|
707
|
-
}, Se = (e) => We.find((r) => e.includes(r)),
|
|
708
|
-
const [t, r] = x(() => W(e.defaultPattern || "", 2)), n =
|
|
710
|
+
}, Se = (e) => We.find((r) => e.includes(r)), Qn = (e) => !!Se(e) && e.startsWith("_("), Xn = (e) => {
|
|
711
|
+
const [t, r] = x(() => W(e.defaultPattern || "", 2)), n = gt(nt), [s, i] = x(() => Se(e.defaultPattern) || n[0]), a = L(() => n.map((u) => ({ label: u, value: u })), []), c = T(j).t;
|
|
709
712
|
e.action.current = () => I(`_("${s}"* #,##0${t > 0 ? ".0" : ""}_)`, t);
|
|
710
713
|
const d = (u) => {
|
|
711
714
|
i(u), e.onChange(I(`_("${u}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
|
|
@@ -717,7 +720,7 @@ const ot = "numfmtCurrency", qn = (e) => {
|
|
|
717
720
|
/* @__PURE__ */ p.jsxs("div", { className: "m-t-16 options ", children: [
|
|
718
721
|
/* @__PURE__ */ p.jsxs("div", { className: "option", children: [
|
|
719
722
|
/* @__PURE__ */ p.jsx("div", { className: "label", children: c("sheet.numfmt.decimalLength") }),
|
|
720
|
-
/* @__PURE__ */ p.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ p.jsx(
|
|
723
|
+
/* @__PURE__ */ p.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ p.jsx(qe, { value: t, max: 20, min: 0, onChange: l }) })
|
|
721
724
|
] }),
|
|
722
725
|
/* @__PURE__ */ p.jsxs("div", { className: "option", children: [
|
|
723
726
|
/* @__PURE__ */ p.jsx("div", { className: "label", children: c("sheet.numfmt.currencyType") }),
|
|
@@ -730,12 +733,12 @@ const ot = "numfmtCurrency", qn = (e) => {
|
|
|
730
733
|
label: t.label(e),
|
|
731
734
|
value: t.suffix(e),
|
|
732
735
|
color: t.color
|
|
733
|
-
})), It = () =>
|
|
734
|
-
const r =
|
|
736
|
+
})), It = () => Ln.map((e) => ({ label: e.label, value: e.suffix })), Mt = () => Vn.map((e) => ({ label: e.label, value: e.suffix, color: e.color })), er = (e) => !!Se(e) && !e.startsWith("_("), tr = (e) => {
|
|
737
|
+
const r = T(j).t, n = gt(nt), [s, i] = x(() => Se(e.defaultPattern) || n[0]), [a, o] = x(() => W(e.defaultPattern || "", 2)), [c, d] = x(() => {
|
|
735
738
|
var S;
|
|
736
739
|
const v = Fe(s);
|
|
737
740
|
return ((S = v.find((C) => Le(C.value, e.defaultPattern))) == null ? void 0 : S.value) || v[0].value;
|
|
738
|
-
}), l =
|
|
741
|
+
}), l = L(() => Fe(s), [s]), u = L(() => n.map((v) => ({ label: v, value: v })), [n]);
|
|
739
742
|
e.action.current = () => I(c, a);
|
|
740
743
|
const m = (v) => {
|
|
741
744
|
i(v);
|
|
@@ -750,7 +753,7 @@ const ot = "numfmtCurrency", qn = (e) => {
|
|
|
750
753
|
/* @__PURE__ */ p.jsxs("div", { className: "m-t-16 options ", children: [
|
|
751
754
|
/* @__PURE__ */ p.jsxs("div", { className: "option", children: [
|
|
752
755
|
/* @__PURE__ */ p.jsx("div", { className: "label", children: r("sheet.numfmt.decimalLength") }),
|
|
753
|
-
/* @__PURE__ */ p.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ p.jsx(
|
|
756
|
+
/* @__PURE__ */ p.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ p.jsx(qe, { value: a, max: 20, min: 0, onChange: _ }) })
|
|
754
757
|
] }),
|
|
755
758
|
/* @__PURE__ */ p.jsxs("div", { className: "option", children: [
|
|
756
759
|
/* @__PURE__ */ p.jsx("div", { className: "label", children: r("sheet.numfmt.currencyType") }),
|
|
@@ -761,11 +764,11 @@ const ot = "numfmtCurrency", qn = (e) => {
|
|
|
761
764
|
/* @__PURE__ */ p.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ p.jsx(Qe, { onChange: h, options: l, value: c }) }),
|
|
762
765
|
/* @__PURE__ */ p.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.currencyDes") })
|
|
763
766
|
] });
|
|
764
|
-
}, tr = (e) => {
|
|
765
|
-
const t = D.getInfo(e);
|
|
766
|
-
return It().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
|
|
767
767
|
}, nr = (e) => {
|
|
768
|
-
const t = V
|
|
768
|
+
const t = V.getInfo(e);
|
|
769
|
+
return It().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
|
|
770
|
+
}, rr = (e) => {
|
|
771
|
+
const t = L(It, []), n = T(j).t, [s, i] = x(() => {
|
|
769
772
|
if (e.defaultPattern) {
|
|
770
773
|
const o = t.find((c) => c.value === e.defaultPattern);
|
|
771
774
|
if (o)
|
|
@@ -782,14 +785,14 @@ const ot = "numfmtCurrency", qn = (e) => {
|
|
|
782
785
|
/* @__PURE__ */ p.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ p.jsx(Qe, { value: s, options: t, onChange: a }) }),
|
|
783
786
|
/* @__PURE__ */ p.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.dateDes") })
|
|
784
787
|
] });
|
|
785
|
-
},
|
|
786
|
-
const r =
|
|
788
|
+
}, sr = (e) => !e, ir = (e) => {
|
|
789
|
+
const r = T(j).t;
|
|
787
790
|
return e.action.current = () => "", /* @__PURE__ */ p.jsx("div", { children: /* @__PURE__ */ p.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.generalDes") }) });
|
|
788
|
-
},
|
|
789
|
-
const t =
|
|
791
|
+
}, ar = (e) => Mt().some((t) => Le(t.value, e)), or = (e) => {
|
|
792
|
+
const t = T(j), r = L(Mt, []), [n, s] = x(() => W(e.defaultPattern || "", 0)), [i, a] = x(() => {
|
|
790
793
|
const u = r.find((m) => Le(m.value, e.defaultPattern || ""));
|
|
791
794
|
return (u == null ? void 0 : u.value) || r[0].value;
|
|
792
|
-
}), o =
|
|
795
|
+
}), o = L(() => I(i, Number(n || 0)), [i, n]), c = L(() => !An(i), [i]), d = (u) => {
|
|
793
796
|
s(u || 0), e.onChange(I(i, Number(u || 0)));
|
|
794
797
|
}, l = (u) => {
|
|
795
798
|
s(W(u, 0)), a(u), e.onChange(u);
|
|
@@ -797,7 +800,7 @@ const ot = "numfmtCurrency", qn = (e) => {
|
|
|
797
800
|
return e.action.current = () => o, /* @__PURE__ */ p.jsxs("div", { children: [
|
|
798
801
|
/* @__PURE__ */ p.jsx("div", { className: "m-t-16 label", children: t.t("sheet.numfmt.decimalLength") }),
|
|
799
802
|
/* @__PURE__ */ p.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ p.jsx(
|
|
800
|
-
|
|
803
|
+
qe,
|
|
801
804
|
{
|
|
802
805
|
disabled: c,
|
|
803
806
|
value: n,
|
|
@@ -813,29 +816,29 @@ const ot = "numfmtCurrency", qn = (e) => {
|
|
|
813
816
|
/* @__PURE__ */ p.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ p.jsx(Qe, { onChange: l, options: r, value: i }) }),
|
|
814
817
|
/* @__PURE__ */ p.jsx("div", { className: "describe m-t-14", children: t.t("sheet.numfmt.thousandthPercentileDes") })
|
|
815
818
|
] });
|
|
816
|
-
},
|
|
817
|
-
const { defaultValue: t, defaultPattern: r, row: n, col: s } = e.value, i =
|
|
819
|
+
}, cr = (e) => {
|
|
820
|
+
const { defaultValue: t, defaultPattern: r, row: n, col: s } = e.value, i = T(j), a = Ze(() => ""), o = i.t, c = Jn(), d = L(
|
|
818
821
|
() => [
|
|
819
|
-
{ label: "sheet.numfmt.general", component:
|
|
820
|
-
{ label: "sheet.numfmt.accounting", component:
|
|
821
|
-
{ label: "sheet.numfmt.currency", component:
|
|
822
|
-
{ label: "sheet.numfmt.date", component:
|
|
823
|
-
{ label: "sheet.numfmt.thousandthPercentile", component:
|
|
822
|
+
{ label: "sheet.numfmt.general", component: ir },
|
|
823
|
+
{ label: "sheet.numfmt.accounting", component: Xn },
|
|
824
|
+
{ label: "sheet.numfmt.currency", component: tr },
|
|
825
|
+
{ label: "sheet.numfmt.date", component: rr },
|
|
826
|
+
{ label: "sheet.numfmt.thousandthPercentile", component: or }
|
|
824
827
|
].map((b) => ({ ...b, label: o(b.label) })),
|
|
825
828
|
[]
|
|
826
|
-
), [l, u] = x(S), [m, h] = x(() => `${n}_${s}`), { mark: _, userHabitCurrency: v } = qn(() => h(`${n}_${s}_userCurrency'`)), f =
|
|
829
|
+
), [l, u] = x(S), [m, h] = x(() => `${n}_${s}`), { mark: _, userHabitCurrency: v } = qn(() => h(`${n}_${s}_userCurrency'`)), f = L(() => {
|
|
827
830
|
var b;
|
|
828
831
|
return (b = d.find((ne) => ne.label === l)) == null ? void 0 : b.component;
|
|
829
832
|
}, [l]);
|
|
830
833
|
function S() {
|
|
831
|
-
return [
|
|
834
|
+
return [sr, Qn, er, nr, ar].reduce((ne, Dt, Et) => ne || (Dt(r) ? d[Et].label : ""), "") || d[0].label;
|
|
832
835
|
}
|
|
833
836
|
const C = d.map((b) => ({
|
|
834
837
|
label: b.label,
|
|
835
838
|
value: b.label
|
|
836
839
|
})), y = (b) => {
|
|
837
840
|
u(b), c(() => e.onChange({ type: "change", value: a.current() || "" }));
|
|
838
|
-
},
|
|
841
|
+
}, A = (b) => {
|
|
839
842
|
e.onChange({ type: "change", value: b });
|
|
840
843
|
}, G = () => {
|
|
841
844
|
const b = a.current() || "", ne = Se(b);
|
|
@@ -843,7 +846,7 @@ const ot = "numfmtCurrency", qn = (e) => {
|
|
|
843
846
|
}, F = () => {
|
|
844
847
|
e.onChange({ type: "cancel", value: "" });
|
|
845
848
|
}, B = {
|
|
846
|
-
onChange:
|
|
849
|
+
onChange: A,
|
|
847
850
|
defaultValue: t,
|
|
848
851
|
defaultPattern: r,
|
|
849
852
|
action: a
|
|
@@ -854,18 +857,18 @@ const ot = "numfmtCurrency", qn = (e) => {
|
|
|
854
857
|
/* @__PURE__ */ p.jsxs("div", { children: [
|
|
855
858
|
/* @__PURE__ */ p.jsx("div", { className: "label m-t-14", children: o("sheet.numfmt.numfmtType") }),
|
|
856
859
|
/* @__PURE__ */ p.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ p.jsx(Je, { onChange: y, options: C, value: l }) }),
|
|
857
|
-
/* @__PURE__ */ p.jsx("div", { children: f && /* @__PURE__ */ p.jsx(
|
|
860
|
+
/* @__PURE__ */ p.jsx("div", { children: f && /* @__PURE__ */ p.jsx(nt.Provider, { value: v, children: /* @__PURE__ */ te(f, { ...B, key: m }) }) })
|
|
858
861
|
] }),
|
|
859
862
|
/* @__PURE__ */ p.jsxs("div", { className: "btn-list m-t-14 m-b-20", children: [
|
|
860
|
-
/* @__PURE__ */ p.jsx(
|
|
861
|
-
/* @__PURE__ */ p.jsx(
|
|
863
|
+
/* @__PURE__ */ p.jsx(at, { size: "small", onClick: F, className: "m-r-12", children: o("sheet.numfmt.cancel") }),
|
|
864
|
+
/* @__PURE__ */ p.jsx(at, { type: "primary", size: "small", onClick: G, children: o("sheet.numfmt.confirm") })
|
|
862
865
|
] })
|
|
863
866
|
] });
|
|
864
|
-
},
|
|
867
|
+
}, Pt = {
|
|
865
868
|
id: "sheet.command.numfmt.set.percent",
|
|
866
869
|
type: X.COMMAND,
|
|
867
870
|
handler: async (e) => {
|
|
868
|
-
const t = e.get(
|
|
871
|
+
const t = e.get(D), n = e.get(ee).getSelections();
|
|
869
872
|
if (!n || !n.length)
|
|
870
873
|
return !1;
|
|
871
874
|
const s = [], i = "0%";
|
|
@@ -876,11 +879,11 @@ const ot = "numfmtCurrency", qn = (e) => {
|
|
|
876
879
|
}), await t.executeCommand(Q.id, { values: s });
|
|
877
880
|
}
|
|
878
881
|
};
|
|
879
|
-
var
|
|
880
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
882
|
+
var lr = Object.defineProperty, ur = Object.getOwnPropertyDescriptor, dr = (e, t, r, n) => {
|
|
883
|
+
for (var s = n > 1 ? void 0 : n ? ur(t, r) : t, i = e.length - 1, a; i >= 0; i--)
|
|
881
884
|
(a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
|
|
882
|
-
return n && s &&
|
|
883
|
-
},
|
|
885
|
+
return n && s && lr(t, r, s), s;
|
|
886
|
+
}, P = (e, t) => (r, n) => t(r, n, e);
|
|
884
887
|
let Me = class extends H {
|
|
885
888
|
constructor(t, r, n, s, i, a, o, c, d, l, u, m) {
|
|
886
889
|
super();
|
|
@@ -903,23 +906,23 @@ let Me = class extends H {
|
|
|
903
906
|
);
|
|
904
907
|
let h = "";
|
|
905
908
|
m && (h = m.pattern);
|
|
906
|
-
const _ = (u == null ? void 0 : u.t) ===
|
|
909
|
+
const _ = (u == null ? void 0 : u.t) === ie.NUMBER ? u.v : 12345678, v = {
|
|
907
910
|
onChange: (f) => {
|
|
908
911
|
var S, C;
|
|
909
912
|
if (f.type === "change")
|
|
910
913
|
this._previewPattern = f.value, this._sheetSkeletonManagerService.reCalculate(), (C = (S = this._renderManagerService.getRenderById(d.getUnitId())) == null ? void 0 : S.mainComponent) == null || C.makeDirty();
|
|
911
914
|
else if (f.type === "confirm") {
|
|
912
|
-
const y = r.getSelectionRanges() || [],
|
|
915
|
+
const y = r.getSelectionRanges() || [], A = { values: [] }, G = Xe(f.value);
|
|
913
916
|
y.forEach((F) => {
|
|
914
917
|
R.foreach(F, (B, b) => {
|
|
915
|
-
|
|
918
|
+
A.values.push({
|
|
916
919
|
row: B,
|
|
917
920
|
col: b,
|
|
918
921
|
pattern: f.value,
|
|
919
922
|
type: G
|
|
920
923
|
});
|
|
921
924
|
});
|
|
922
|
-
}), n.executeCommand(Q.id,
|
|
925
|
+
}), n.executeCommand(Q.id, A), t.close();
|
|
923
926
|
} else
|
|
924
927
|
f.type === "cancel" && t.close();
|
|
925
928
|
},
|
|
@@ -945,7 +948,7 @@ let Me = class extends H {
|
|
|
945
948
|
_t,
|
|
946
949
|
bt,
|
|
947
950
|
Ct,
|
|
948
|
-
|
|
951
|
+
Pt,
|
|
949
952
|
$e,
|
|
950
953
|
ke,
|
|
951
954
|
Q
|
|
@@ -954,7 +957,7 @@ let Me = class extends H {
|
|
|
954
957
|
});
|
|
955
958
|
}
|
|
956
959
|
_initPanel() {
|
|
957
|
-
this._componentManager.register(ue,
|
|
960
|
+
this._componentManager.register(ue, cr);
|
|
958
961
|
}
|
|
959
962
|
_initInterceptorCommands() {
|
|
960
963
|
const t = this;
|
|
@@ -962,8 +965,8 @@ let Me = class extends H {
|
|
|
962
965
|
this._sheetInterceptorService.interceptCommand({
|
|
963
966
|
getMutations(r) {
|
|
964
967
|
switch (r.id) {
|
|
965
|
-
case
|
|
966
|
-
case
|
|
968
|
+
case Kt.id:
|
|
969
|
+
case Wt.id: {
|
|
967
970
|
const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), s = t._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), i = t._selectionManagerService.getSelectionRanges();
|
|
968
971
|
if (!(i != null && i.length))
|
|
969
972
|
break;
|
|
@@ -998,35 +1001,35 @@ let Me = class extends H {
|
|
|
998
1001
|
);
|
|
999
1002
|
}
|
|
1000
1003
|
_initRealTimeRenderingInterceptor() {
|
|
1001
|
-
const t = new
|
|
1004
|
+
const t = new Z((n) => {
|
|
1002
1005
|
this._commandService.onCommandExecuted((s) => {
|
|
1003
1006
|
s.id === $e.id && n.next(!0), s.id === ke.id && n.next(!1);
|
|
1004
1007
|
});
|
|
1005
|
-
}), r =
|
|
1008
|
+
}), r = yn([
|
|
1006
1009
|
t,
|
|
1007
1010
|
this._selectionManagerService.selectionMoveEnd$.pipe(
|
|
1008
1011
|
le((n) => n ? n.map((s) => s.range) : [])
|
|
1009
1012
|
)
|
|
1010
1013
|
]);
|
|
1011
1014
|
this.disposeWithMe(
|
|
1012
|
-
|
|
1015
|
+
q(
|
|
1013
1016
|
r.pipe(
|
|
1014
|
-
|
|
1015
|
-
([n, s]) => new
|
|
1016
|
-
const a = new
|
|
1017
|
+
pt(
|
|
1018
|
+
([n, s]) => new Z((i) => {
|
|
1019
|
+
const a = new mt();
|
|
1017
1020
|
return n && s.length && i.next({ selectionRanges: s, disposableCollection: a }), () => {
|
|
1018
1021
|
a.dispose();
|
|
1019
1022
|
};
|
|
1020
1023
|
})
|
|
1021
1024
|
),
|
|
1022
|
-
|
|
1025
|
+
pn(() => {
|
|
1023
1026
|
this._previewPattern = null;
|
|
1024
1027
|
})
|
|
1025
1028
|
).subscribe(({ disposableCollection: n, selectionRanges: s }) => {
|
|
1026
1029
|
var a, o;
|
|
1027
1030
|
const i = this._univerInstanceService.getCurrentUniverSheetInstance();
|
|
1028
1031
|
this.openPanel(), n.add(
|
|
1029
|
-
this._sheetInterceptorService.intercept(
|
|
1032
|
+
this._sheetInterceptorService.intercept(ht.CELL_CONTENT, {
|
|
1030
1033
|
priority: 99,
|
|
1031
1034
|
handler: (c, d, l) => {
|
|
1032
1035
|
const { row: u, col: m } = d;
|
|
@@ -1034,22 +1037,22 @@ let Me = class extends H {
|
|
|
1034
1037
|
(h) => h.startColumn <= m && h.endColumn >= m && h.startRow <= u && h.endRow >= u
|
|
1035
1038
|
)) {
|
|
1036
1039
|
const h = d.worksheet.getCellRaw(u, m), _ = h == null ? void 0 : h.v, v = h == null ? void 0 : h.t;
|
|
1037
|
-
if (_ == null || v !==
|
|
1040
|
+
if (_ == null || v !== ie.NUMBER || this._previewPattern === null)
|
|
1038
1041
|
return l(c);
|
|
1039
|
-
const f =
|
|
1042
|
+
const f = et(this._previewPattern, _, this._localeService.getCurrentLocale());
|
|
1040
1043
|
if (f.color) {
|
|
1041
1044
|
const C = this._themeService.getCurrentTheme()[`${f.color}500`];
|
|
1042
1045
|
return {
|
|
1043
1046
|
...c,
|
|
1044
1047
|
v: f.result,
|
|
1045
|
-
t:
|
|
1048
|
+
t: ie.STRING,
|
|
1046
1049
|
s: { cl: { rgb: C } }
|
|
1047
1050
|
};
|
|
1048
1051
|
}
|
|
1049
1052
|
return {
|
|
1050
1053
|
...c,
|
|
1051
1054
|
v: f.result,
|
|
1052
|
-
t:
|
|
1055
|
+
t: ie.STRING
|
|
1053
1056
|
};
|
|
1054
1057
|
}
|
|
1055
1058
|
return l(c);
|
|
@@ -1063,9 +1066,9 @@ let Me = class extends H {
|
|
|
1063
1066
|
_commandExecutedListener() {
|
|
1064
1067
|
const t = [M.id, w.id];
|
|
1065
1068
|
this.disposeWithMe(
|
|
1066
|
-
|
|
1069
|
+
q(
|
|
1067
1070
|
Ge(
|
|
1068
|
-
new
|
|
1071
|
+
new Z((r) => {
|
|
1069
1072
|
const n = this._commandService.onCommandExecuted((s) => {
|
|
1070
1073
|
if (t.includes(s.id)) {
|
|
1071
1074
|
const i = s.params;
|
|
@@ -1077,7 +1080,7 @@ let Me = class extends H {
|
|
|
1077
1080
|
};
|
|
1078
1081
|
}),
|
|
1079
1082
|
this._numfmtService.modelReplace$
|
|
1080
|
-
).pipe(
|
|
1083
|
+
).pipe(vn(16)).subscribe((r) => {
|
|
1081
1084
|
var n, s;
|
|
1082
1085
|
this._sheetSkeletonManagerService.reCalculate(), (s = (n = this._renderManagerService.getRenderById(r)) == null ? void 0 : n.mainComponent) == null || s.makeDirty();
|
|
1083
1086
|
})
|
|
@@ -1085,27 +1088,27 @@ let Me = class extends H {
|
|
|
1085
1088
|
);
|
|
1086
1089
|
}
|
|
1087
1090
|
};
|
|
1088
|
-
Me =
|
|
1089
|
-
k(
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1091
|
+
Me = dr([
|
|
1092
|
+
k($.Rendered, Me),
|
|
1093
|
+
P(0, g(Ae)),
|
|
1094
|
+
P(1, g(dt)),
|
|
1095
|
+
P(2, g(K)),
|
|
1096
|
+
P(3, g(E)),
|
|
1097
|
+
P(4, g(Ke)),
|
|
1098
|
+
P(5, g(D)),
|
|
1099
|
+
P(6, g(ee)),
|
|
1100
|
+
P(7, g(_n)),
|
|
1101
|
+
P(8, g(U)),
|
|
1102
|
+
P(9, g(vt)),
|
|
1103
|
+
P(10, g(Cn)),
|
|
1104
|
+
P(11, g(j))
|
|
1102
1105
|
], Me);
|
|
1103
|
-
var
|
|
1104
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
1106
|
+
var mr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, fr = (e, t, r, n) => {
|
|
1107
|
+
for (var s = n > 1 ? void 0 : n ? hr(t, r) : t, i = e.length - 1, a; i >= 0; i--)
|
|
1105
1108
|
(a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
|
|
1106
|
-
return n && s &&
|
|
1109
|
+
return n && s && mr(t, r, s), s;
|
|
1107
1110
|
}, be = (e, t) => (r, n) => t(r, n, e);
|
|
1108
|
-
let
|
|
1111
|
+
let Pe = class extends H {
|
|
1109
1112
|
constructor(t, r, n, s) {
|
|
1110
1113
|
super();
|
|
1111
1114
|
Y(this, "_copyInfo");
|
|
@@ -1117,14 +1120,14 @@ let Oe = class extends H {
|
|
|
1117
1120
|
id: ue,
|
|
1118
1121
|
onBeforeCopy: (t, r, n) => this._collectNumfmt(t, r, n),
|
|
1119
1122
|
onPasteCells: (t, r, n, s) => {
|
|
1120
|
-
const { copyType: i =
|
|
1123
|
+
const { copyType: i = rt.COPY, pasteType: a } = s, { range: o } = t || {}, { range: c } = r;
|
|
1121
1124
|
return this._generateNumfmtMutations(c, { copyType: i, pasteType: a, copyRange: o });
|
|
1122
1125
|
}
|
|
1123
1126
|
})
|
|
1124
1127
|
);
|
|
1125
1128
|
}
|
|
1126
1129
|
_collectNumfmt(t, r, n) {
|
|
1127
|
-
const s = new
|
|
1130
|
+
const s = new ut();
|
|
1128
1131
|
this._copyInfo = {
|
|
1129
1132
|
matrix: s,
|
|
1130
1133
|
info: {
|
|
@@ -1154,15 +1157,15 @@ let Oe = class extends H {
|
|
|
1154
1157
|
}
|
|
1155
1158
|
_generateNumfmtMutations(t, r) {
|
|
1156
1159
|
const n = this._univerInstanceService.getCurrentUniverSheetInstance(), s = n.getActiveSheet(), i = n.getUnitId(), a = s.getSheetId();
|
|
1157
|
-
if (r.copyType ===
|
|
1160
|
+
if (r.copyType === rt.CUT)
|
|
1158
1161
|
return this._copyInfo = null, { redos: [], undos: [] };
|
|
1159
1162
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !r.copyRange)
|
|
1160
1163
|
return { redos: [], undos: [] };
|
|
1161
|
-
if ([
|
|
1164
|
+
if ([st.SPECIAL_PASTE_COL_WIDTH, st.SPECIAL_PASTE_VALUE].includes(
|
|
1162
1165
|
r.pasteType
|
|
1163
1166
|
))
|
|
1164
1167
|
return { redos: [], undos: [] };
|
|
1165
|
-
const o =
|
|
1168
|
+
const o = mn(r.copyRange, t, !0), c = [], d = { unitId: i, subUnitId: a, ranges: [] }, l = this._numfmtService.getModel(i, a);
|
|
1166
1169
|
R.foreach(t, (h, _) => {
|
|
1167
1170
|
this._numfmtService.getValue(i, a, h, _, l) && d.ranges.push({ startRow: h, startColumn: _, endRow: h, endColumn: _ });
|
|
1168
1171
|
}), o.forEach((h) => {
|
|
@@ -1202,19 +1205,19 @@ let Oe = class extends H {
|
|
|
1202
1205
|
};
|
|
1203
1206
|
}
|
|
1204
1207
|
};
|
|
1205
|
-
|
|
1206
|
-
k(
|
|
1207
|
-
be(0, g(
|
|
1208
|
+
Pe = fr([
|
|
1209
|
+
k($.Rendered, Pe),
|
|
1210
|
+
be(0, g(hn)),
|
|
1208
1211
|
be(1, g(K)),
|
|
1209
|
-
be(2, g(
|
|
1210
|
-
be(3, g(
|
|
1211
|
-
],
|
|
1212
|
-
var
|
|
1213
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
1212
|
+
be(2, g(U)),
|
|
1213
|
+
be(3, g(E))
|
|
1214
|
+
], Pe);
|
|
1215
|
+
var pr = Object.defineProperty, vr = Object.getOwnPropertyDescriptor, gr = (e, t, r, n) => {
|
|
1216
|
+
for (var s = n > 1 ? void 0 : n ? vr(t, r) : t, i = e.length - 1, a; i >= 0; i--)
|
|
1214
1217
|
(a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
|
|
1215
|
-
return n && s &&
|
|
1218
|
+
return n && s && pr(t, r, s), s;
|
|
1216
1219
|
}, ce = (e, t) => (r, n) => t(r, n, e);
|
|
1217
|
-
const
|
|
1220
|
+
const _r = () => {
|
|
1218
1221
|
let e = [];
|
|
1219
1222
|
return {
|
|
1220
1223
|
add: (s, i, a, o, c) => e.push({ unitId: s, subUnitId: i, row: a, col: o, value: c }),
|
|
@@ -1224,16 +1227,16 @@ const gr = () => {
|
|
|
1224
1227
|
}
|
|
1225
1228
|
};
|
|
1226
1229
|
};
|
|
1227
|
-
let
|
|
1230
|
+
let Oe = class extends H {
|
|
1228
1231
|
constructor(t, r, n, s, i) {
|
|
1229
1232
|
super();
|
|
1230
1233
|
// collect effect mutations when edit end and push this to commands stack in next commands progress
|
|
1231
|
-
Y(this, "_collectEffectMutation",
|
|
1234
|
+
Y(this, "_collectEffectMutation", _r());
|
|
1232
1235
|
this._sheetInterceptorService = t, this._numfmtService = r, this._univerInstanceService = n, this._injector = s, this._editorBridgeService = i, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
|
|
1233
1236
|
}
|
|
1234
1237
|
_initInterceptorEditorStart() {
|
|
1235
1238
|
this.disposeWithMe(
|
|
1236
|
-
|
|
1239
|
+
q(
|
|
1237
1240
|
this._editorBridgeService.interceptor.intercept(
|
|
1238
1241
|
this._editorBridgeService.interceptor.getInterceptPoints().BEFORE_CELL_EDIT,
|
|
1239
1242
|
{
|
|
@@ -1272,7 +1275,7 @@ let Pe = class extends H {
|
|
|
1272
1275
|
*/
|
|
1273
1276
|
_initInterceptorEditorEnd() {
|
|
1274
1277
|
this.disposeWithMe(
|
|
1275
|
-
|
|
1278
|
+
q(
|
|
1276
1279
|
this._editorBridgeService.interceptor.intercept(
|
|
1277
1280
|
this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,
|
|
1278
1281
|
{
|
|
@@ -1294,7 +1297,7 @@ let Pe = class extends H {
|
|
|
1294
1297
|
};
|
|
1295
1298
|
if (!(t != null && t.v))
|
|
1296
1299
|
return n(t);
|
|
1297
|
-
const a = String(t.v), o =
|
|
1300
|
+
const a = String(t.v), o = V.parseDate(a) || V.parseTime(a);
|
|
1298
1301
|
if (!!o) {
|
|
1299
1302
|
if (o && o.z) {
|
|
1300
1303
|
const d = Number(o.v);
|
|
@@ -1307,10 +1310,10 @@ let Pe = class extends H {
|
|
|
1307
1310
|
type: "date",
|
|
1308
1311
|
pattern: o.z
|
|
1309
1312
|
}
|
|
1310
|
-
), { ...t, v: d, t:
|
|
1313
|
+
), { ...t, v: d, t: ie.NUMBER };
|
|
1311
1314
|
}
|
|
1312
1315
|
} else
|
|
1313
|
-
(["date", "time", "datetime"].includes((s == null ? void 0 : s.type) || "") || !
|
|
1316
|
+
(["date", "time", "datetime"].includes((s == null ? void 0 : s.type) || "") || !Sr(a)) && i();
|
|
1314
1317
|
return n(t);
|
|
1315
1318
|
}
|
|
1316
1319
|
}
|
|
@@ -1324,7 +1327,7 @@ let Pe = class extends H {
|
|
|
1324
1327
|
this._sheetInterceptorService.interceptCommand({
|
|
1325
1328
|
getMutations(r) {
|
|
1326
1329
|
switch (r.id) {
|
|
1327
|
-
case
|
|
1330
|
+
case Gt.id: {
|
|
1328
1331
|
const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), s = t._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), i = t._collectEffectMutation.getEffects();
|
|
1329
1332
|
if (!i.length)
|
|
1330
1333
|
return {
|
|
@@ -1381,45 +1384,45 @@ let Pe = class extends H {
|
|
|
1381
1384
|
);
|
|
1382
1385
|
}
|
|
1383
1386
|
};
|
|
1384
|
-
|
|
1385
|
-
k(
|
|
1387
|
+
Oe = gr([
|
|
1388
|
+
k($.Rendered, Oe),
|
|
1386
1389
|
ce(0, g(Ae)),
|
|
1387
|
-
ce(1, g(
|
|
1388
|
-
ce(2, g(
|
|
1390
|
+
ce(1, g(U)),
|
|
1391
|
+
ce(2, g(E)),
|
|
1389
1392
|
ce(3, g(K)),
|
|
1390
|
-
ce(4, g(
|
|
1391
|
-
],
|
|
1392
|
-
function
|
|
1393
|
+
ce(4, g(fn))
|
|
1394
|
+
], Oe);
|
|
1395
|
+
function Sr(e) {
|
|
1393
1396
|
return /^-?\d+(\.\d+)?$/.test(e);
|
|
1394
1397
|
}
|
|
1395
|
-
var
|
|
1396
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
1398
|
+
var Cr = Object.defineProperty, br = Object.getOwnPropertyDescriptor, yr = (e, t, r, n) => {
|
|
1399
|
+
for (var s = n > 1 ? void 0 : n ? br(t, r) : t, i = e.length - 1, a; i >= 0; i--)
|
|
1397
1400
|
(a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
|
|
1398
|
-
return n && s &&
|
|
1399
|
-
},
|
|
1401
|
+
return n && s && Cr(t, r, s), s;
|
|
1402
|
+
}, Rr = (e, t) => (r, n) => t(r, n, e);
|
|
1400
1403
|
let xe = class extends H {
|
|
1401
1404
|
constructor(t) {
|
|
1402
1405
|
super();
|
|
1403
1406
|
Y(this, "_initLocal", () => {
|
|
1404
|
-
this._localeService.load({ zhCN:
|
|
1407
|
+
this._localeService.load({ zhCN: jn, enUS: xn });
|
|
1405
1408
|
});
|
|
1406
1409
|
this._localeService = t, this._initLocal();
|
|
1407
1410
|
}
|
|
1408
1411
|
};
|
|
1409
|
-
xe =
|
|
1410
|
-
k(
|
|
1411
|
-
|
|
1412
|
+
xe = yr([
|
|
1413
|
+
k($.Rendered, xe),
|
|
1414
|
+
Rr(0, g(j))
|
|
1412
1415
|
], xe);
|
|
1413
|
-
var
|
|
1414
|
-
return
|
|
1416
|
+
var O = function() {
|
|
1417
|
+
return O = Object.assign || function(e) {
|
|
1415
1418
|
for (var t, r = 1, n = arguments.length; r < n; r++) {
|
|
1416
1419
|
t = arguments[r];
|
|
1417
1420
|
for (var s in t)
|
|
1418
1421
|
Object.prototype.hasOwnProperty.call(t, s) && (e[s] = t[s]);
|
|
1419
1422
|
}
|
|
1420
1423
|
return e;
|
|
1421
|
-
},
|
|
1422
|
-
},
|
|
1424
|
+
}, O.apply(this, arguments);
|
|
1425
|
+
}, Ir = function(e, t) {
|
|
1423
1426
|
var r = {};
|
|
1424
1427
|
for (var n in e)
|
|
1425
1428
|
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
@@ -1427,17 +1430,17 @@ var P = function() {
|
|
|
1427
1430
|
for (var s = 0, n = Object.getOwnPropertySymbols(e); s < n.length; s++)
|
|
1428
1431
|
t.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[s]) && (r[n[s]] = e[n[s]]);
|
|
1429
1432
|
return r;
|
|
1430
|
-
},
|
|
1431
|
-
var r = e.icon, n = e.id, s = e.className, i = e.extend, a =
|
|
1432
|
-
return
|
|
1433
|
+
}, oe = ae(function(e, t) {
|
|
1434
|
+
var r = e.icon, n = e.id, s = e.className, i = e.extend, a = Ir(e, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(n, " ").concat(s || "").trim(), c = Ze("_".concat(Or()));
|
|
1435
|
+
return Ot(r, "".concat(n), { defIds: r.defIds, idSuffix: c.current }, O({ ref: t, className: o }, a), i);
|
|
1433
1436
|
});
|
|
1434
|
-
function
|
|
1435
|
-
return te(e.tag,
|
|
1436
|
-
return
|
|
1437
|
+
function Ot(e, t, r, n, s) {
|
|
1438
|
+
return te(e.tag, O(O({ key: t }, Mr(e, r, s)), n), (Pr(e, r).children || []).map(function(i, a) {
|
|
1439
|
+
return Ot(i, "".concat(t, "-").concat(e.tag, "-").concat(a), r, void 0, s);
|
|
1437
1440
|
}));
|
|
1438
1441
|
}
|
|
1439
|
-
function
|
|
1440
|
-
var n =
|
|
1442
|
+
function Mr(e, t, r) {
|
|
1443
|
+
var n = O({}, e.attrs);
|
|
1441
1444
|
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
|
|
1442
1445
|
var s = t.defIds;
|
|
1443
1446
|
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) {
|
|
@@ -1445,187 +1448,61 @@ function Ir(e, t, r) {
|
|
|
1445
1448
|
typeof o == "string" && (n[a] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
1446
1449
|
})), n;
|
|
1447
1450
|
}
|
|
1448
|
-
function
|
|
1451
|
+
function Pr(e, t) {
|
|
1449
1452
|
var r, n = t.defIds;
|
|
1450
|
-
return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ?
|
|
1451
|
-
return typeof s.attrs.id == "string" && n && n.indexOf(s.attrs.id) > -1 ?
|
|
1453
|
+
return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ? O(O({}, e), { children: e.children.map(function(s) {
|
|
1454
|
+
return typeof s.attrs.id == "string" && n && n.indexOf(s.attrs.id) > -1 ? O(O({}, s), { attrs: O(O({}, s.attrs), { id: s.attrs.id + t.idSuffix }) }) : s;
|
|
1452
1455
|
}) }) : e;
|
|
1453
1456
|
}
|
|
1454
1457
|
function Or() {
|
|
1455
1458
|
return Math.random().toString(36).substring(2, 8);
|
|
1456
1459
|
}
|
|
1457
|
-
|
|
1458
|
-
var
|
|
1459
|
-
|
|
1460
|
-
attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" },
|
|
1461
|
-
children: [
|
|
1462
|
-
{
|
|
1463
|
-
tag: "path",
|
|
1464
|
-
attrs: {
|
|
1465
|
-
fill: "currentColor",
|
|
1466
|
-
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",
|
|
1467
|
-
fillRule: "evenodd",
|
|
1468
|
-
clipRule: "evenodd"
|
|
1469
|
-
}
|
|
1470
|
-
},
|
|
1471
|
-
{
|
|
1472
|
-
tag: "path",
|
|
1473
|
-
attrs: {
|
|
1474
|
-
fill: "currentColor",
|
|
1475
|
-
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"
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
]
|
|
1479
|
-
}, xt = ie(function(e, t) {
|
|
1480
|
-
return te(ae, Object.assign({}, e, {
|
|
1460
|
+
oe.displayName = "UniverIcon";
|
|
1461
|
+
var xr = { 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" } }] }, xt = ae(function(e, t) {
|
|
1462
|
+
return te(oe, Object.assign({}, e, {
|
|
1481
1463
|
id: "add-digits-single",
|
|
1482
1464
|
ref: t,
|
|
1483
|
-
icon:
|
|
1465
|
+
icon: xr
|
|
1484
1466
|
}));
|
|
1485
1467
|
});
|
|
1486
1468
|
xt.displayName = "AddDigitsSingle";
|
|
1487
|
-
const
|
|
1488
|
-
var
|
|
1489
|
-
|
|
1490
|
-
attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" },
|
|
1491
|
-
children: [
|
|
1492
|
-
{
|
|
1493
|
-
tag: "mask",
|
|
1494
|
-
attrs: {
|
|
1495
|
-
id: "mask0_102_556",
|
|
1496
|
-
style: { maskType: "alpha" },
|
|
1497
|
-
width: 16,
|
|
1498
|
-
height: 16,
|
|
1499
|
-
x: 0,
|
|
1500
|
-
y: 0,
|
|
1501
|
-
maskUnits: "userSpaceOnUse"
|
|
1502
|
-
},
|
|
1503
|
-
children: [
|
|
1504
|
-
{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0 0H16V16H0z" } }
|
|
1505
|
-
]
|
|
1506
|
-
},
|
|
1507
|
-
{
|
|
1508
|
-
tag: "g",
|
|
1509
|
-
attrs: { mask: "url(#mask0_102_556)" },
|
|
1510
|
-
children: [
|
|
1511
|
-
{
|
|
1512
|
-
tag: "path",
|
|
1513
|
-
attrs: {
|
|
1514
|
-
fill: "currentColor",
|
|
1515
|
-
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",
|
|
1516
|
-
fillRule: "evenodd",
|
|
1517
|
-
clipRule: "evenodd"
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1520
|
-
]
|
|
1521
|
-
}
|
|
1522
|
-
]
|
|
1523
|
-
}, wt = ie(function(e, t) {
|
|
1524
|
-
return te(ae, Object.assign({}, e, {
|
|
1469
|
+
const wr = xt;
|
|
1470
|
+
var jr = { 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" } }] }] }, wt = ae(function(e, t) {
|
|
1471
|
+
return te(oe, Object.assign({}, e, {
|
|
1525
1472
|
id: "more-down-single",
|
|
1526
1473
|
ref: t,
|
|
1527
|
-
icon:
|
|
1474
|
+
icon: jr
|
|
1528
1475
|
}));
|
|
1529
1476
|
});
|
|
1530
1477
|
wt.displayName = "MoreDownSingle";
|
|
1531
|
-
const
|
|
1532
|
-
var
|
|
1533
|
-
|
|
1534
|
-
attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" },
|
|
1535
|
-
children: [
|
|
1536
|
-
{
|
|
1537
|
-
tag: "mask",
|
|
1538
|
-
attrs: {
|
|
1539
|
-
id: "mask0_561_2",
|
|
1540
|
-
style: { maskType: "alpha" },
|
|
1541
|
-
width: 16,
|
|
1542
|
-
height: 16,
|
|
1543
|
-
x: 0,
|
|
1544
|
-
y: 0,
|
|
1545
|
-
maskUnits: "userSpaceOnUse"
|
|
1546
|
-
},
|
|
1547
|
-
children: [
|
|
1548
|
-
{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0 0H16V16H0z" } }
|
|
1549
|
-
]
|
|
1550
|
-
},
|
|
1551
|
-
{
|
|
1552
|
-
tag: "g",
|
|
1553
|
-
attrs: {
|
|
1554
|
-
fill: "currentColor",
|
|
1555
|
-
mask: "url(#mask0_561_2)",
|
|
1556
|
-
fillRule: "evenodd",
|
|
1557
|
-
clipRule: "evenodd"
|
|
1558
|
-
},
|
|
1559
|
-
children: [
|
|
1560
|
-
{
|
|
1561
|
-
tag: "path",
|
|
1562
|
-
attrs: {
|
|
1563
|
-
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"
|
|
1564
|
-
}
|
|
1565
|
-
}
|
|
1566
|
-
]
|
|
1567
|
-
}
|
|
1568
|
-
]
|
|
1569
|
-
}, jt = ie(function(e, t) {
|
|
1570
|
-
return te(ae, Object.assign({}, e, {
|
|
1478
|
+
const Nr = wt;
|
|
1479
|
+
var Tr = { 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" } }] }] }, jt = ae(function(e, t) {
|
|
1480
|
+
return te(oe, Object.assign({}, e, {
|
|
1571
1481
|
id: "percent-single",
|
|
1572
1482
|
ref: t,
|
|
1573
|
-
icon:
|
|
1483
|
+
icon: Tr
|
|
1574
1484
|
}));
|
|
1575
1485
|
});
|
|
1576
1486
|
jt.displayName = "PercentSingle";
|
|
1577
|
-
const
|
|
1578
|
-
var
|
|
1579
|
-
|
|
1580
|
-
attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" },
|
|
1581
|
-
children: [
|
|
1582
|
-
{
|
|
1583
|
-
tag: "path",
|
|
1584
|
-
attrs: {
|
|
1585
|
-
fill: "currentColor",
|
|
1586
|
-
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",
|
|
1587
|
-
fillRule: "evenodd",
|
|
1588
|
-
clipRule: "evenodd"
|
|
1589
|
-
}
|
|
1590
|
-
},
|
|
1591
|
-
{
|
|
1592
|
-
tag: "path",
|
|
1593
|
-
attrs: {
|
|
1594
|
-
fill: "currentColor",
|
|
1595
|
-
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"
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
]
|
|
1599
|
-
}, Nt = ie(function(e, t) {
|
|
1600
|
-
return te(ae, Object.assign({}, e, {
|
|
1487
|
+
const Dr = jt;
|
|
1488
|
+
var Er = { 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" } }] }, Nt = ae(function(e, t) {
|
|
1489
|
+
return te(oe, Object.assign({}, e, {
|
|
1601
1490
|
id: "reduce-digits-single",
|
|
1602
1491
|
ref: t,
|
|
1603
|
-
icon:
|
|
1492
|
+
icon: Er
|
|
1604
1493
|
}));
|
|
1605
1494
|
});
|
|
1606
1495
|
Nt.displayName = "ReduceDigitsSingle";
|
|
1607
|
-
const
|
|
1608
|
-
var
|
|
1609
|
-
|
|
1610
|
-
attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" },
|
|
1611
|
-
children: [
|
|
1612
|
-
{
|
|
1613
|
-
tag: "path",
|
|
1614
|
-
attrs: {
|
|
1615
|
-
fill: "currentColor",
|
|
1616
|
-
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"
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
]
|
|
1620
|
-
}, Tt = ie(function(e, t) {
|
|
1621
|
-
return te(ae, Object.assign({}, e, {
|
|
1496
|
+
const $r = Nt;
|
|
1497
|
+
var Ur = { 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" } }] }, Tt = ae(function(e, t) {
|
|
1498
|
+
return te(oe, Object.assign({}, e, {
|
|
1622
1499
|
id: "rmb-single",
|
|
1623
1500
|
ref: t,
|
|
1624
|
-
icon:
|
|
1501
|
+
icon: Ur
|
|
1625
1502
|
}));
|
|
1626
1503
|
});
|
|
1627
1504
|
Tt.displayName = "RmbSingle";
|
|
1628
|
-
const
|
|
1505
|
+
const Ar = Tt, we = [
|
|
1629
1506
|
{
|
|
1630
1507
|
label: "sheet.numfmt.general",
|
|
1631
1508
|
pattern: null
|
|
@@ -1678,16 +1555,16 @@ const Ur = Tt, we = [
|
|
|
1678
1555
|
label: "sheet.numfmt.moreFmt",
|
|
1679
1556
|
pattern: ""
|
|
1680
1557
|
}
|
|
1681
|
-
],
|
|
1558
|
+
], Lr = (e) => {
|
|
1682
1559
|
var n;
|
|
1683
|
-
const t =
|
|
1560
|
+
const t = T(j), r = (n = e.value) != null ? n : t.t("sheet.numfmt.general");
|
|
1684
1561
|
return /* @__PURE__ */ p.jsx("span", { className: "more-numfmt-type", children: r });
|
|
1685
|
-
},
|
|
1686
|
-
const e =
|
|
1562
|
+
}, Vr = () => {
|
|
1563
|
+
const e = T(D), t = T(j), r = Mn(), n = T(ee), s = (o) => {
|
|
1687
1564
|
const c = n.getLast();
|
|
1688
1565
|
if (!c)
|
|
1689
1566
|
return;
|
|
1690
|
-
const d = r.get(
|
|
1567
|
+
const d = r.get(Sn), l = c.range, u = [];
|
|
1691
1568
|
R.foreach(l, (m, h) => {
|
|
1692
1569
|
o ? u.push({ row: m, col: h, pattern: o, type: Xe(o) }) : u.push({ row: m, col: h });
|
|
1693
1570
|
}), e.executeCommand(Q.id, { values: u }), d.focus();
|
|
@@ -1710,14 +1587,14 @@ const Ur = Tt, we = [
|
|
|
1710
1587
|
},
|
|
1711
1588
|
children: [
|
|
1712
1589
|
/* @__PURE__ */ p.jsx("div", { children: t.t(o.label) }),
|
|
1713
|
-
/* @__PURE__ */ p.jsx("div", { className: "m-l-26", children: o.pattern ?
|
|
1590
|
+
/* @__PURE__ */ p.jsx("div", { className: "m-l-26", children: o.pattern ? et(o.pattern || "", a, t.getCurrentLocale()).result : "" })
|
|
1714
1591
|
]
|
|
1715
1592
|
},
|
|
1716
1593
|
c
|
|
1717
1594
|
)) });
|
|
1718
|
-
},
|
|
1595
|
+
}, Hr = (e) => {
|
|
1719
1596
|
const t = "icon-rmbSingle";
|
|
1720
|
-
return e.register(t,
|
|
1597
|
+
return e.register(t, Ar), e.register("MoreDownSingle", Nr), (r) => ({
|
|
1721
1598
|
icon: t,
|
|
1722
1599
|
id: Ct.id,
|
|
1723
1600
|
title: "sheet.numfmt.currency",
|
|
@@ -1728,9 +1605,9 @@ const Ur = Tt, we = [
|
|
|
1728
1605
|
hidden$: _e(r, de.SHEET),
|
|
1729
1606
|
disabled$: fe(r)
|
|
1730
1607
|
});
|
|
1731
|
-
},
|
|
1608
|
+
}, kr = (e) => {
|
|
1732
1609
|
const t = "icon-addDigitsSingle";
|
|
1733
|
-
return e.register(t,
|
|
1610
|
+
return e.register(t, wr), (r) => ({
|
|
1734
1611
|
icon: t,
|
|
1735
1612
|
id: _t.id,
|
|
1736
1613
|
title: "sheet.numfmt.addDecimal",
|
|
@@ -1741,9 +1618,9 @@ const Ur = Tt, we = [
|
|
|
1741
1618
|
hidden$: _e(r, de.SHEET),
|
|
1742
1619
|
disabled$: fe(r)
|
|
1743
1620
|
});
|
|
1744
|
-
},
|
|
1621
|
+
}, Fr = (e) => {
|
|
1745
1622
|
const t = "icon-reduceDigitsSingle";
|
|
1746
|
-
return e.register(t,
|
|
1623
|
+
return e.register(t, $r), (r) => ({
|
|
1747
1624
|
icon: t,
|
|
1748
1625
|
id: bt.id,
|
|
1749
1626
|
title: "sheet.numfmt.subtractDecimal",
|
|
@@ -1754,11 +1631,11 @@ const Ur = Tt, we = [
|
|
|
1754
1631
|
hidden$: _e(r, de.SHEET),
|
|
1755
1632
|
disabled$: fe(r)
|
|
1756
1633
|
});
|
|
1757
|
-
},
|
|
1634
|
+
}, Br = (e) => {
|
|
1758
1635
|
const t = "icon-PercentSingle";
|
|
1759
|
-
return e.register(t,
|
|
1636
|
+
return e.register(t, Dr), (r) => ({
|
|
1760
1637
|
icon: t,
|
|
1761
|
-
id:
|
|
1638
|
+
id: Pt.id,
|
|
1762
1639
|
title: "sheet.numfmt.percent",
|
|
1763
1640
|
tooltip: "sheet.numfmt.percent",
|
|
1764
1641
|
type: pe.BUTTON,
|
|
@@ -1767,13 +1644,13 @@ const Ur = Tt, we = [
|
|
|
1767
1644
|
hidden$: _e(r, de.SHEET),
|
|
1768
1645
|
disabled$: fe(r)
|
|
1769
1646
|
});
|
|
1770
|
-
},
|
|
1647
|
+
}, zr = (e) => {
|
|
1771
1648
|
const t = "sheet.numfmt.moreNumfmtType", r = "sheet.numfmt.moreNumfmtType.options";
|
|
1772
|
-
return e.register(t,
|
|
1773
|
-
const s = n.get(
|
|
1649
|
+
return e.register(t, Lr), e.register(r, Vr), (n) => {
|
|
1650
|
+
const s = n.get(U), i = n.get(Pn), a = n.get(E), o = n.get(D), c = n.get(j), d = n.get(ee), l = new Z(
|
|
1774
1651
|
(u) => Ge(
|
|
1775
1652
|
d.selectionMoveEnd$,
|
|
1776
|
-
new
|
|
1653
|
+
new Z((m) => {
|
|
1777
1654
|
const h = [M.id, w.id], _ = o.onCommandExecuted((v) => {
|
|
1778
1655
|
h.includes(v.id) && m.next(null);
|
|
1779
1656
|
});
|
|
@@ -1782,11 +1659,11 @@ const Ur = Tt, we = [
|
|
|
1782
1659
|
).subscribe(() => {
|
|
1783
1660
|
const m = d.getSelections();
|
|
1784
1661
|
if (m && m[0]) {
|
|
1785
|
-
const h = a.getCurrentUniverSheetInstance(), _ = h.getActiveSheet(), v = m[0].range, f = v.startRow, S = v.startColumn, C = s.getValue(h.getUnitId(), _.getSheetId(), f, S), y = i.getNumfmtValue(h.getUnitId(), _.getSheetId(), f, S),
|
|
1662
|
+
const h = a.getCurrentUniverSheetInstance(), _ = h.getActiveSheet(), v = m[0].range, f = v.startRow, S = v.startColumn, C = s.getValue(h.getUnitId(), _.getSheetId(), f, S), y = i.getNumfmtValue(h.getUnitId(), _.getSheetId(), f, S), A = (C == null ? void 0 : C.pattern) || y;
|
|
1786
1663
|
let G = c.t("sheet.numfmt.general");
|
|
1787
|
-
if (
|
|
1664
|
+
if (A) {
|
|
1788
1665
|
const F = we.filter((B) => typeof B == "object" && B.pattern).find(
|
|
1789
|
-
(B) => Le(
|
|
1666
|
+
(B) => Le(A, B.pattern)
|
|
1790
1667
|
);
|
|
1791
1668
|
F && typeof F == "object" && F.pattern ? G = c.t(F.label) : G = c.t("sheet.numfmt.moreFmt");
|
|
1792
1669
|
}
|
|
@@ -1816,33 +1693,33 @@ const Ur = Tt, we = [
|
|
|
1816
1693
|
};
|
|
1817
1694
|
};
|
|
1818
1695
|
};
|
|
1819
|
-
var
|
|
1820
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
1696
|
+
var Wr = Object.defineProperty, Kr = Object.getOwnPropertyDescriptor, Gr = (e, t, r, n) => {
|
|
1697
|
+
for (var s = n > 1 ? void 0 : n ? Kr(t, r) : t, i = e.length - 1, a; i >= 0; i--)
|
|
1821
1698
|
(a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
|
|
1822
|
-
return n && s &&
|
|
1699
|
+
return n && s && Wr(t, r, s), s;
|
|
1823
1700
|
}, Be = (e, t) => (r, n) => t(r, n, e);
|
|
1824
1701
|
let je = class extends H {
|
|
1825
1702
|
constructor(e, t, r) {
|
|
1826
1703
|
super(), this._injector = e, this._componentManager = t, this._menuService = r, this._initMenu();
|
|
1827
1704
|
}
|
|
1828
1705
|
_initMenu() {
|
|
1829
|
-
[
|
|
1706
|
+
[Br, kr, Fr, Hr, zr].map((e) => e(this._componentManager)).forEach((e) => {
|
|
1830
1707
|
this.disposeWithMe(this._menuService.addMenuItem(e(this._injector)));
|
|
1831
1708
|
});
|
|
1832
1709
|
}
|
|
1833
1710
|
};
|
|
1834
|
-
je =
|
|
1835
|
-
k(
|
|
1711
|
+
je = Gr([
|
|
1712
|
+
k($.Rendered, je),
|
|
1836
1713
|
Be(0, g(K)),
|
|
1837
|
-
Be(1, g(
|
|
1838
|
-
Be(2, g(
|
|
1714
|
+
Be(1, g(vt)),
|
|
1715
|
+
Be(2, g(bn))
|
|
1839
1716
|
], je);
|
|
1840
|
-
var
|
|
1841
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
1717
|
+
var Yr = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, qr = (e, t, r, n) => {
|
|
1718
|
+
for (var s = n > 1 ? void 0 : n ? Zr(t, r) : t, i = e.length - 1, a; i >= 0; i--)
|
|
1842
1719
|
(a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
|
|
1843
|
-
return n && s &&
|
|
1844
|
-
},
|
|
1845
|
-
const
|
|
1720
|
+
return n && s && Yr(t, r, s), s;
|
|
1721
|
+
}, se = (e, t) => (r, n) => t(r, n, e);
|
|
1722
|
+
const Jr = [w.id, M.id];
|
|
1846
1723
|
let Ne = class extends H {
|
|
1847
1724
|
constructor(e, t, r, n, s, i) {
|
|
1848
1725
|
super(), this._numfmtService = e, this._univerInstanceService = t, this._injector = r, this._refRangeService = n, this._sheetSkeletonManagerService = s, this._commandService = i, this._registerRefRange(), this._mergeRefMutations();
|
|
@@ -1852,24 +1729,24 @@ let Ne = class extends H {
|
|
|
1852
1729
|
handler: (e, t, r) => {
|
|
1853
1730
|
if (!e)
|
|
1854
1731
|
return r(e);
|
|
1855
|
-
const n = e.filter((s) => !
|
|
1732
|
+
const n = e.filter((s) => !Jr.includes(s.id));
|
|
1856
1733
|
return n.push(...Ee(e)), r(n);
|
|
1857
1734
|
}
|
|
1858
1735
|
});
|
|
1859
1736
|
}
|
|
1860
1737
|
_registerRefRange() {
|
|
1861
1738
|
this.disposeWithMe(
|
|
1862
|
-
|
|
1739
|
+
q(
|
|
1863
1740
|
Ge(
|
|
1864
1741
|
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
1865
1742
|
le((e) => e == null ? void 0 : e.sheetId),
|
|
1866
|
-
|
|
1743
|
+
ft()
|
|
1867
1744
|
),
|
|
1868
1745
|
this._numfmtService.modelReplace$
|
|
1869
1746
|
).pipe(
|
|
1870
|
-
|
|
1871
|
-
() => new
|
|
1872
|
-
const t = new
|
|
1747
|
+
pt(
|
|
1748
|
+
() => new Z((e) => {
|
|
1749
|
+
const t = new mt();
|
|
1873
1750
|
return e.next(t), () => {
|
|
1874
1751
|
t.dispose();
|
|
1875
1752
|
};
|
|
@@ -1885,50 +1762,50 @@ let Ne = class extends H {
|
|
|
1885
1762
|
};
|
|
1886
1763
|
let u = [];
|
|
1887
1764
|
switch (o.id) {
|
|
1888
|
-
case
|
|
1765
|
+
case N.DeleteRangeMoveLeftCommandId: {
|
|
1766
|
+
u = an(o, l);
|
|
1767
|
+
break;
|
|
1768
|
+
}
|
|
1769
|
+
case N.DeleteRangeMoveUpCommandId: {
|
|
1889
1770
|
u = sn(o, l);
|
|
1890
1771
|
break;
|
|
1891
1772
|
}
|
|
1892
|
-
case
|
|
1773
|
+
case N.InsertColCommandId: {
|
|
1893
1774
|
u = rn(o, l);
|
|
1894
1775
|
break;
|
|
1895
1776
|
}
|
|
1896
|
-
case
|
|
1777
|
+
case N.InsertRangeMoveDownCommandId: {
|
|
1897
1778
|
u = nn(o, l);
|
|
1898
1779
|
break;
|
|
1899
1780
|
}
|
|
1900
|
-
case
|
|
1781
|
+
case N.InsertRangeMoveRightCommandId: {
|
|
1901
1782
|
u = tn(o, l);
|
|
1902
1783
|
break;
|
|
1903
1784
|
}
|
|
1904
|
-
case
|
|
1785
|
+
case N.InsertRowCommandId: {
|
|
1905
1786
|
u = en(o, l);
|
|
1906
1787
|
break;
|
|
1907
1788
|
}
|
|
1908
|
-
case
|
|
1789
|
+
case N.MoveRangeCommandId: {
|
|
1909
1790
|
u = Xt(o, l);
|
|
1910
1791
|
break;
|
|
1911
1792
|
}
|
|
1912
|
-
case
|
|
1793
|
+
case N.RemoveColCommandId: {
|
|
1913
1794
|
u = Qt(o, l);
|
|
1914
1795
|
break;
|
|
1915
1796
|
}
|
|
1916
|
-
case
|
|
1797
|
+
case N.RemoveRowCommandId: {
|
|
1917
1798
|
u = Jt(o, l);
|
|
1918
1799
|
break;
|
|
1919
1800
|
}
|
|
1920
|
-
case
|
|
1921
|
-
u = Zt(o, l);
|
|
1922
|
-
break;
|
|
1923
|
-
}
|
|
1924
|
-
case j.MoveColsCommandId: {
|
|
1801
|
+
case N.MoveColsCommandId: {
|
|
1925
1802
|
u = qt(o, l);
|
|
1926
1803
|
break;
|
|
1927
1804
|
}
|
|
1928
|
-
case
|
|
1929
|
-
u =
|
|
1805
|
+
case N.MoveRowsCommandId:
|
|
1806
|
+
u = Zt(o, l);
|
|
1930
1807
|
}
|
|
1931
|
-
const m =
|
|
1808
|
+
const m = on(u, l), h = this._numfmtService.getValue(r, n, c, d);
|
|
1932
1809
|
if (!m && h) {
|
|
1933
1810
|
const _ = {
|
|
1934
1811
|
id: M.id,
|
|
@@ -1961,8 +1838,8 @@ let Ne = class extends H {
|
|
|
1961
1838
|
subUnitId: n,
|
|
1962
1839
|
ranges: [{ startColumn: d, startRow: c, endColumn: d, endRow: c }]
|
|
1963
1840
|
}
|
|
1964
|
-
},
|
|
1965
|
-
return _.push(S, y), v.push(...C, ...
|
|
1841
|
+
}, A = J(this._injector, y.params);
|
|
1842
|
+
return _.push(S, y), v.push(...C, ...A), {
|
|
1966
1843
|
redos: _,
|
|
1967
1844
|
undos: v.reverse()
|
|
1968
1845
|
};
|
|
@@ -1981,27 +1858,27 @@ let Ne = class extends H {
|
|
|
1981
1858
|
);
|
|
1982
1859
|
i.set(`${o}_${c}`, l), e.add(l);
|
|
1983
1860
|
}), e.add(
|
|
1984
|
-
|
|
1985
|
-
new
|
|
1861
|
+
q(
|
|
1862
|
+
new Z((o) => {
|
|
1986
1863
|
e.add(
|
|
1987
1864
|
this._commandService.onCommandExecuted((c) => {
|
|
1988
1865
|
[w.id, M.id].includes(c.id) && o.next(c.params);
|
|
1989
1866
|
})
|
|
1990
1867
|
);
|
|
1991
1868
|
}).pipe(
|
|
1992
|
-
|
|
1869
|
+
it(
|
|
1993
1870
|
(o) => o.unitId === r && o.subUnitId === n
|
|
1994
1871
|
),
|
|
1995
1872
|
le((o) => o.ranges ? o.ranges : o.values ? Object.keys(o.values).reduce((c, d) => {
|
|
1996
1873
|
const l = o.values[d];
|
|
1997
1874
|
return c.push(...l.ranges), c;
|
|
1998
1875
|
}, []) : []),
|
|
1999
|
-
|
|
1876
|
+
gn(300),
|
|
2000
1877
|
// updating the listener moves to the next queue
|
|
2001
1878
|
le(
|
|
2002
1879
|
(o) => o.reduce((c, d) => (c.push(...d), c), [])
|
|
2003
1880
|
),
|
|
2004
|
-
|
|
1881
|
+
it((o) => !!o.length)
|
|
2005
1882
|
).subscribe((o) => {
|
|
2006
1883
|
o.forEach((c) => {
|
|
2007
1884
|
R.foreach(c, (d, l) => {
|
|
@@ -2029,18 +1906,18 @@ let Ne = class extends H {
|
|
|
2029
1906
|
}
|
|
2030
1907
|
};
|
|
2031
1908
|
Ne = qr([
|
|
2032
|
-
k(
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
1909
|
+
k($.Rendered, Ne),
|
|
1910
|
+
se(0, g(U)),
|
|
1911
|
+
se(1, g(E)),
|
|
1912
|
+
se(2, g(K)),
|
|
1913
|
+
se(3, g(Yt)),
|
|
1914
|
+
se(4, g(Ke)),
|
|
1915
|
+
se(5, g(D))
|
|
2039
1916
|
], Ne);
|
|
2040
|
-
var
|
|
2041
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
1917
|
+
var Qr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, es = (e, t, r, n) => {
|
|
1918
|
+
for (var s = n > 1 ? void 0 : n ? Xr(t, r) : t, i = e.length - 1, a; i >= 0; i--)
|
|
2042
1919
|
(a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
|
|
2043
|
-
return n && s &&
|
|
1920
|
+
return n && s && Qr(t, r, s), s;
|
|
2044
1921
|
}, ye = (e, t) => (r, n) => t(r, n, e);
|
|
2045
1922
|
let Te = class extends H {
|
|
2046
1923
|
constructor(e, t, r, n) {
|
|
@@ -2050,8 +1927,8 @@ let Te = class extends H {
|
|
|
2050
1927
|
this.disposeWithMe(
|
|
2051
1928
|
this._sheetInterceptorService.interceptCommand({
|
|
2052
1929
|
getMutations: (e) => {
|
|
2053
|
-
if (e.id ===
|
|
2054
|
-
const t = e.params, r = t.unitId ||
|
|
1930
|
+
if (e.id === cn.id) {
|
|
1931
|
+
const t = e.params, r = t.unitId || ts(this._univerInstanceService), n = t.subUnitId || ns(this._univerInstanceService), s = this._numfmtService.getModel(r, n);
|
|
2055
1932
|
if (!s)
|
|
2056
1933
|
return { redos: [], undos: [] };
|
|
2057
1934
|
const i = [];
|
|
@@ -2074,34 +1951,34 @@ let Te = class extends H {
|
|
|
2074
1951
|
);
|
|
2075
1952
|
}
|
|
2076
1953
|
};
|
|
2077
|
-
Te =
|
|
2078
|
-
k(
|
|
2079
|
-
ye(0, g(
|
|
1954
|
+
Te = es([
|
|
1955
|
+
k($.Rendered, Te),
|
|
1956
|
+
ye(0, g(U)),
|
|
2080
1957
|
ye(1, g(Ae)),
|
|
2081
|
-
ye(2, g(
|
|
1958
|
+
ye(2, g(E)),
|
|
2082
1959
|
ye(3, g(K))
|
|
2083
1960
|
], Te);
|
|
2084
|
-
const
|
|
2085
|
-
var
|
|
2086
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
1961
|
+
const ts = (e) => e.getCurrentUniverSheetInstance().getUnitId(), ns = (e) => e.getCurrentUniverSheetInstance().getActiveSheet().getSheetId();
|
|
1962
|
+
var rs = Object.defineProperty, ss = Object.getOwnPropertyDescriptor, is = (e, t, r, n) => {
|
|
1963
|
+
for (var s = n > 1 ? void 0 : n ? ss(t, r) : t, i = e.length - 1, a; i >= 0; i--)
|
|
2087
1964
|
(a = e[i]) && (s = (n ? a(t, r, s) : a(s)) || s);
|
|
2088
|
-
return n && s &&
|
|
2089
|
-
},
|
|
2090
|
-
let
|
|
1965
|
+
return n && s && rs(t, r, s), s;
|
|
1966
|
+
}, as = (e, t) => (r, n) => t(r, n, e), ze;
|
|
1967
|
+
let lt = (ze = class extends Bt {
|
|
2091
1968
|
constructor(e, t) {
|
|
2092
1969
|
super(ue), this._injector = t;
|
|
2093
1970
|
}
|
|
2094
1971
|
onStarting() {
|
|
2095
|
-
this._injector.add([
|
|
1972
|
+
this._injector.add([tt, { useClass: Me, lazy: !1 }]), this._injector.add([Oe]), this._injector.add([Ue]), this._injector.add([Ne]), this._injector.add([Te]), this._injector.add([Pe]), this._injector.add([Re]), this._injector.add([Ie]), this._injector.add([xe]), this._injector.add([je]);
|
|
2096
1973
|
}
|
|
2097
|
-
}, Y(ze, "type",
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
],
|
|
1974
|
+
}, Y(ze, "type", zt.Sheet), ze);
|
|
1975
|
+
lt = is([
|
|
1976
|
+
as(1, g(K))
|
|
1977
|
+
], lt);
|
|
2101
1978
|
export {
|
|
2102
1979
|
Q as SetNumfmtCommand,
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
1980
|
+
lt as UniverSheetsNumfmtPlugin,
|
|
1981
|
+
xn as enUS,
|
|
1982
|
+
et as getPatternPreview,
|
|
1983
|
+
jn as zhCN
|
|
2107
1984
|
};
|