@univerjs/sheets-numfmt 0.1.0-beta.2 → 0.1.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{LICENSE.txt → LICENSE} +0 -2
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +1702 -1669
- package/lib/types/controllers/__tests__/auto-fill.controller.spec.d.ts +16 -0
- package/lib/types/controllers/__tests__/cell-content.controller.spec.d.ts +16 -0
- package/lib/types/controllers/__tests__/copy-paste.controller.spec.d.ts +16 -0
- package/lib/types/controllers/__tests__/editor.controller.spec.d.ts +16 -0
- package/lib/types/controllers/__tests__/test.util.d.ts +31 -0
- package/lib/types/controllers/numfmt.cell-content.controller.d.ts +27 -0
- package/lib/types/controllers/numfmt.controller.d.ts +2 -6
- package/lib/types/controllers/numfmt.i18n.controller.d.ts +21 -0
- package/lib/types/controllers/numfmt.menu.controller.d.ts +25 -0
- package/lib/umd/index.js +2 -2
- package/package.json +46 -42
package/lib/es/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { transformCellsToRange as
|
|
6
|
-
import { Inject as
|
|
7
|
-
import { IAutoFillService as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import { InputNumber as
|
|
14
|
-
import { useDependency as de, useInjector as
|
|
15
|
-
const
|
|
1
|
+
var nr = Object.defineProperty;
|
|
2
|
+
var rr = (e, t, r) => t in e ? nr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var Ne = (e, t, r) => (rr(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { CommandType as Ye, ICommandService as Ce, IUniverInstanceService as ve, IUndoRedoService as sr, sequenceExecute as ar, Tools as ir, Disposable as Me, OnLifecycle as je, LifecycleStages as _e, Range as ne, Rectangle as bt, ObjectMatrix as yn, CellValueType as Ue, toDisposable as Te, ThemeService as bn, runOnLifecycle as or, ILocalStorageService as cr, LocaleService as me, DisposableCollection as Sn, UniverInstanceType as jt, Plugin as lr, PluginType as ur } from "@univerjs/core";
|
|
5
|
+
import { transformCellsToRange as Xe, rangeMerge as Ie, SetNumfmtMutation as oe, factorySetNumfmtUndoMutation as et, RemoveNumfmtMutation as te, factoryRemoveNumfmtUndoMutation as Fe, INumfmtService as ye, INTERCEPTOR_POINT as Cn, SheetInterceptorService as xt, SelectionManagerService as Be, ClearSelectionFormatCommand as dr, ClearSelectionAllCommand as mr, SetRangeValuesCommand as pr, getCurrentSheetDisabled$ as It, RefRangeService as fr, EffectRefRangId as ue, handleMoveRows as hr, handleMoveCols as gr, handleIRemoveRow as vr, handleIRemoveCol as _r, handleMoveRange as yr, handleInsertRow as br, handleInsertRangeMoveRight as Sr, handleInsertRangeMoveDown as Cr, handleInsertCol as Mr, handleDeleteRangeMoveUp as jr, handleDeleteRangeMoveLeft as xr, runRefRangeMutations as Ir, RemoveSheetCommand as Rr } from "@univerjs/sheets";
|
|
6
|
+
import { Inject as $, Injector as we, createIdentifier as wr } from "@wendellhu/redi";
|
|
7
|
+
import { IAutoFillService as Pr, APPLY_TYPE as Tt, getAutoFillRepeatRange as Dr, SheetSkeletonManagerService as Lt, COPY_TYPE as mn, PREDEFINED_HOOK_NAME as pn, getRepeatRange as Or, ISheetClipboardService as Er, IEditorBridgeService as Nr } from "@univerjs/sheets-ui";
|
|
8
|
+
import { map as Ze, distinctUntilChanged as Mn, switchMap as jn, tap as kr, debounceTime as Tr, filter as fn, bufferTime as Fr } from "rxjs/operators";
|
|
9
|
+
import { IRenderManagerService as $r, ITextSelectionRenderManager as Ar } from "@univerjs/engine-render";
|
|
10
|
+
import { ComponentManager as xn, ISidebarService as zr, MenuItemType as Rt, MenuGroup as wt, MenuPosition as Pt, getMenuHiddenObservable as Dt, IMenuService as Ur } from "@univerjs/ui";
|
|
11
|
+
import { Observable as ke, combineLatest as Lr, merge as Yt } from "rxjs";
|
|
12
|
+
import Yr, { createContext as Br, useState as ie, useEffect as Bt, useRef as Ht, useContext as In, useMemo as Se, createElement as He, forwardRef as tt } from "react";
|
|
13
|
+
import { InputNumber as Vt, Select as Jt, SelectList as Wt, Button as hn } from "@univerjs/design";
|
|
14
|
+
import { useDependency as de, useInjector as Hr } from "@wendellhu/redi/react-bindings";
|
|
15
|
+
const Le = {
|
|
16
16
|
id: "sheet.command.numfmt.set.numfmt",
|
|
17
|
-
type:
|
|
17
|
+
type: Ye.COMMAND,
|
|
18
18
|
handler: (e, t) => {
|
|
19
19
|
if (!t)
|
|
20
20
|
return !1;
|
|
21
|
-
const
|
|
21
|
+
const r = e.get(Ce), n = e.get(ve), a = e.get(sr), l = n.getCurrentUniverSheetInstance(), u = l.getUnitId(), p = l.getActiveSheet().getSheetId(), v = t.values.filter((R) => !!R.pattern), h = t.values.filter((R) => !R.pattern), f = Xe(u, p, v), b = {
|
|
22
22
|
unitId: u,
|
|
23
|
-
subUnitId:
|
|
23
|
+
subUnitId: p,
|
|
24
24
|
ranges: h.map((R) => ({
|
|
25
25
|
startColumn: R.col,
|
|
26
26
|
startRow: R.row,
|
|
@@ -29,32 +29,32 @@ const Ue = {
|
|
|
29
29
|
}))
|
|
30
30
|
}, I = [], D = [];
|
|
31
31
|
if (v.length) {
|
|
32
|
-
Object.keys(f.values).forEach((
|
|
33
|
-
const
|
|
34
|
-
|
|
32
|
+
Object.keys(f.values).forEach((z) => {
|
|
33
|
+
const B = f.values[z];
|
|
34
|
+
B.ranges = Ie(B.ranges);
|
|
35
35
|
}), I.push({
|
|
36
36
|
id: oe.id,
|
|
37
37
|
params: f
|
|
38
38
|
});
|
|
39
|
-
const R =
|
|
39
|
+
const R = et(e, f);
|
|
40
40
|
D.push(...R);
|
|
41
41
|
}
|
|
42
42
|
if (h.length) {
|
|
43
|
-
b.ranges =
|
|
44
|
-
id:
|
|
43
|
+
b.ranges = Ie(b.ranges), I.push({
|
|
44
|
+
id: te.id,
|
|
45
45
|
params: b
|
|
46
46
|
});
|
|
47
|
-
const R =
|
|
47
|
+
const R = Fe(e, b);
|
|
48
48
|
D.push(...R);
|
|
49
49
|
}
|
|
50
|
-
const
|
|
51
|
-
return
|
|
50
|
+
const E = ar(I, r).result;
|
|
51
|
+
return E && a.pushUndoRedo({
|
|
52
52
|
unitID: u,
|
|
53
53
|
undoMutations: D,
|
|
54
54
|
redoMutations: I
|
|
55
|
-
}),
|
|
55
|
+
}), E;
|
|
56
56
|
}
|
|
57
|
-
},
|
|
57
|
+
}, Ta = {
|
|
58
58
|
sheet: {
|
|
59
59
|
numfmt: {
|
|
60
60
|
title: "数据格式",
|
|
@@ -88,7 +88,7 @@ const Ue = {
|
|
|
88
88
|
subtractDecimal: "减少小数位"
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
},
|
|
91
|
+
}, Vr = {
|
|
92
92
|
sheet: {
|
|
93
93
|
numfmt: {
|
|
94
94
|
title: "数据格式",
|
|
@@ -122,8 +122,8 @@ const Ue = {
|
|
|
122
122
|
subtractDecimal: "减少小数位"
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
},
|
|
126
|
-
const t = e.filter((l) => l.id ===
|
|
125
|
+
}, Qe = "SHEET_NUMFMT_PLUGIN", St = (e) => {
|
|
126
|
+
const t = e.filter((l) => l.id === te.id).map((l) => l.params), r = e.filter((l) => l.id === oe.id).map((l) => l.params), n = [];
|
|
127
127
|
if (t[0]) {
|
|
128
128
|
const l = t.reduce(
|
|
129
129
|
(u, d) => (u.ranges.push(...d.ranges), u),
|
|
@@ -133,19 +133,19 @@ const Ue = {
|
|
|
133
133
|
subUnitId: t[0].subUnitId
|
|
134
134
|
}
|
|
135
135
|
);
|
|
136
|
-
l.ranges =
|
|
136
|
+
l.ranges = Ie(l.ranges), n.push({ id: te.id, params: l });
|
|
137
137
|
}
|
|
138
|
-
const
|
|
139
|
-
const d = Object.keys(l),
|
|
138
|
+
const a = (l, u) => {
|
|
139
|
+
const d = Object.keys(l), p = d.findIndex((v) => {
|
|
140
140
|
const h = l[v];
|
|
141
|
-
return
|
|
141
|
+
return ir.diffValue(h, u);
|
|
142
142
|
});
|
|
143
|
-
return d[
|
|
143
|
+
return d[p];
|
|
144
144
|
};
|
|
145
|
-
if (
|
|
146
|
-
const l =
|
|
147
|
-
(u, d) => (Object.keys(d.values).forEach((
|
|
148
|
-
const v = d.values[
|
|
145
|
+
if (r[0]) {
|
|
146
|
+
const l = r.reduce(
|
|
147
|
+
(u, d) => (Object.keys(d.values).forEach((p) => {
|
|
148
|
+
const v = d.values[p], h = d.refMap[p], f = a(u.refMap, h);
|
|
149
149
|
if (f)
|
|
150
150
|
u.values[f].ranges.push(...v.ranges);
|
|
151
151
|
else {
|
|
@@ -158,33 +158,33 @@ const Ue = {
|
|
|
158
158
|
{
|
|
159
159
|
values: {},
|
|
160
160
|
refMap: {},
|
|
161
|
-
unitId:
|
|
162
|
-
subUnitId:
|
|
161
|
+
unitId: r[0].unitId,
|
|
162
|
+
subUnitId: r[0].subUnitId
|
|
163
163
|
}
|
|
164
164
|
);
|
|
165
165
|
Object.keys(l.values).forEach((u) => {
|
|
166
166
|
const d = l.values[u];
|
|
167
|
-
d.ranges =
|
|
167
|
+
d.ranges = Ie(d.ranges);
|
|
168
168
|
}), n.push({ id: oe.id, params: l });
|
|
169
169
|
}
|
|
170
170
|
return n;
|
|
171
171
|
};
|
|
172
|
-
var
|
|
173
|
-
for (var
|
|
174
|
-
(u = e[l]) && (
|
|
175
|
-
return n &&
|
|
176
|
-
},
|
|
177
|
-
let
|
|
178
|
-
constructor(e, t,
|
|
179
|
-
super(), this._injector = e, this._univerInstanceService = t, this._numfmtService =
|
|
172
|
+
var Jr = Object.defineProperty, Wr = Object.getOwnPropertyDescriptor, Gr = (e, t, r, n) => {
|
|
173
|
+
for (var a = n > 1 ? void 0 : n ? Wr(t, r) : t, l = e.length - 1, u; l >= 0; l--)
|
|
174
|
+
(u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
|
|
175
|
+
return n && a && Jr(t, r, a), a;
|
|
176
|
+
}, ot = (e, t) => (r, n) => t(r, n, e);
|
|
177
|
+
let ut = class extends Me {
|
|
178
|
+
constructor(e, t, r, n) {
|
|
179
|
+
super(), this._injector = e, this._univerInstanceService = t, this._numfmtService = r, this._autoFillService = n, this._initAutoFill();
|
|
180
180
|
}
|
|
181
181
|
_initAutoFill() {
|
|
182
|
-
const e = () => ({ redos: [], undos: [] }), t = (
|
|
183
|
-
const d = this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(),
|
|
184
|
-
startRow:
|
|
185
|
-
startColumn:
|
|
186
|
-
endColumn:
|
|
187
|
-
endRow:
|
|
182
|
+
const e = () => ({ redos: [], undos: [] }), t = (a, l, u) => {
|
|
183
|
+
const d = this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), p = this._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), v = {
|
|
184
|
+
startRow: a.row,
|
|
185
|
+
startColumn: a.col,
|
|
186
|
+
endColumn: a.col,
|
|
187
|
+
endRow: a.row
|
|
188
188
|
}, h = {
|
|
189
189
|
startRow: l.row,
|
|
190
190
|
startColumn: l.col,
|
|
@@ -192,7 +192,7 @@ let ct = class extends Le {
|
|
|
192
192
|
endRow: l.row
|
|
193
193
|
}, f = [];
|
|
194
194
|
if (ne.foreach(u, (b, I) => {
|
|
195
|
-
const D =
|
|
195
|
+
const D = bt.getPositionRange(
|
|
196
196
|
{
|
|
197
197
|
startRow: b,
|
|
198
198
|
startColumn: I,
|
|
@@ -200,14 +200,14 @@ let ct = class extends Le {
|
|
|
200
200
|
endRow: b
|
|
201
201
|
},
|
|
202
202
|
v
|
|
203
|
-
),
|
|
203
|
+
), E = this._numfmtService.getValue(
|
|
204
204
|
d,
|
|
205
|
-
|
|
205
|
+
p,
|
|
206
206
|
D.startRow,
|
|
207
207
|
D.startColumn
|
|
208
208
|
);
|
|
209
|
-
if (
|
|
210
|
-
const R =
|
|
209
|
+
if (E) {
|
|
210
|
+
const R = bt.getPositionRange(
|
|
211
211
|
{
|
|
212
212
|
startRow: b,
|
|
213
213
|
startColumn: I,
|
|
@@ -217,8 +217,8 @@ let ct = class extends Le {
|
|
|
217
217
|
h
|
|
218
218
|
);
|
|
219
219
|
f.push({
|
|
220
|
-
pattern:
|
|
221
|
-
type:
|
|
220
|
+
pattern: E.pattern,
|
|
221
|
+
type: E.type,
|
|
222
222
|
row: R.startRow,
|
|
223
223
|
col: R.startColumn
|
|
224
224
|
});
|
|
@@ -226,32 +226,32 @@ let ct = class extends Le {
|
|
|
226
226
|
}), f.length) {
|
|
227
227
|
const b = {
|
|
228
228
|
id: oe.id,
|
|
229
|
-
params:
|
|
230
|
-
}, I =
|
|
229
|
+
params: Xe(d, p, f)
|
|
230
|
+
}, I = et(this._injector, b.params);
|
|
231
231
|
return {
|
|
232
232
|
redos: [b],
|
|
233
233
|
undos: I
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
236
|
return { redos: [], undos: [] };
|
|
237
|
-
},
|
|
238
|
-
const u = [], d = [],
|
|
239
|
-
row:
|
|
240
|
-
col:
|
|
237
|
+
}, r = (a, l) => {
|
|
238
|
+
const u = [], d = [], p = {
|
|
239
|
+
row: a.startRow,
|
|
240
|
+
col: a.startColumn
|
|
241
241
|
};
|
|
242
|
-
return
|
|
243
|
-
const { undos: f, redos: b } = t(
|
|
242
|
+
return Dr(a, l).forEach((h) => {
|
|
243
|
+
const { undos: f, redos: b } = t(p, h.repeatStartCell, h.relativeRange);
|
|
244
244
|
u.push(...f), d.push(...b);
|
|
245
245
|
}), {
|
|
246
|
-
undos:
|
|
247
|
-
redos:
|
|
246
|
+
undos: St(u),
|
|
247
|
+
redos: St(d)
|
|
248
248
|
};
|
|
249
249
|
}, n = {
|
|
250
|
-
id:
|
|
251
|
-
onFillData: (
|
|
252
|
-
if (u ===
|
|
253
|
-
const { source: d, target:
|
|
254
|
-
return
|
|
250
|
+
id: Qe,
|
|
251
|
+
onFillData: (a, l, u) => {
|
|
252
|
+
if (u === Tt.COPY || u === Tt.ONLY_FORMAT || u === Tt.SERIES) {
|
|
253
|
+
const { source: d, target: p } = a;
|
|
254
|
+
return r(d, p);
|
|
255
255
|
}
|
|
256
256
|
return e();
|
|
257
257
|
}
|
|
@@ -259,726 +259,726 @@ let ct = class extends Le {
|
|
|
259
259
|
this.disposeWithMe(this._autoFillService.addHook(n));
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
],
|
|
269
|
-
var
|
|
270
|
-
function
|
|
262
|
+
ut = Gr([
|
|
263
|
+
je(_e.Rendered, ut),
|
|
264
|
+
ot(0, $(we)),
|
|
265
|
+
ot(1, $(ve)),
|
|
266
|
+
ot(2, $(ye)),
|
|
267
|
+
ot(3, $(Pr))
|
|
268
|
+
], ut);
|
|
269
|
+
var Kr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
270
|
+
function qr(e) {
|
|
271
271
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
272
272
|
}
|
|
273
|
-
var
|
|
273
|
+
var Rn = { exports: {} };
|
|
274
274
|
(function(e, t) {
|
|
275
|
-
(function(
|
|
275
|
+
(function(r, n) {
|
|
276
276
|
e.exports = n();
|
|
277
|
-
})(typeof self < "u" ? self :
|
|
277
|
+
})(typeof self < "u" ? self : Kr, function() {
|
|
278
278
|
return function() {
|
|
279
|
-
var
|
|
280
|
-
for (var o in
|
|
281
|
-
|
|
282
|
-
}, o: function(
|
|
283
|
-
return Object.prototype.hasOwnProperty.call(
|
|
279
|
+
var r = { d: function(i, s) {
|
|
280
|
+
for (var o in s)
|
|
281
|
+
r.o(s, o) && !r.o(i, o) && Object.defineProperty(i, o, { enumerable: !0, get: s[o] });
|
|
282
|
+
}, o: function(i, s) {
|
|
283
|
+
return Object.prototype.hasOwnProperty.call(i, s);
|
|
284
284
|
} }, n = {};
|
|
285
|
-
|
|
286
|
-
return
|
|
285
|
+
r.d(n, { default: function() {
|
|
286
|
+
return tr;
|
|
287
287
|
} });
|
|
288
|
-
var
|
|
288
|
+
var a = { 1078: "af", 1052: "sq", 1118: "am", 5121: "ar_DZ", 15361: "ar_BH", 3073: "ar_EG", 2049: "ar_IQ", 11265: "ar_JO", 13313: "ar_KW", 12289: "ar_LB", 4097: "ar_LY", 6145: "ar_MA", 8193: "ar_OM", 16385: "ar_QA", 1025: "ar_SA", 10241: "ar_SY", 7169: "ar_TN", 14337: "ar_AE", 9217: "ar_YE", 1067: "hy", 1101: "as", 2092: "az_AZ", 1068: "az_AZ", 1069: "eu", 1059: "be", 2117: "bn", 1093: "bn_IN", 5146: "bs", 1026: "bg", 1109: "my", 1027: "ca", 2052: "zh_CN", 3076: "zh_HK", 5124: "zh_MO", 4100: "zh_SG", 1028: "zh_TW", 1050: "hr", 1029: "cs", 1030: "da", 1125: "dv", 2067: "nl_BE", 1043: "nl_NL", 1126: "bin", 3081: "en_AU", 10249: "en_BZ", 4105: "en_CA", 9225: "en_CB", 2057: "en_GB", 16393: "en_IN", 6153: "en_IE", 8201: "en_JM", 5129: "en_NZ", 13321: "en_PH", 7177: "en_ZA", 11273: "en_TT", 1033: "en_US", 12297: "en_ZW", 1061: "et", 1071: "mk", 1080: "fo", 1065: "fa", 1124: "fil", 1035: "fi", 2060: "fr_BE", 11276: "fr_CM", 3084: "fr_CA", 9228: "fr_CG", 12300: "fr_CI", 1036: "fr_FR", 5132: "fr_LU", 13324: "fr_ML", 6156: "fr_MC", 14348: "fr_MA", 10252: "fr_SN", 4108: "fr_CH", 7180: "fr", 1122: "fy_NL", 2108: "gd_IE", 1084: "gd", 1110: "gl", 1079: "ka", 3079: "de_AT", 1031: "de_DE", 5127: "de_LI", 4103: "de_LU", 2055: "de_CH", 1032: "el", 1140: "gn", 1095: "gu", 1279: "en", 1037: "he", 1081: "hi", 1038: "hu", 1039: "is", 1136: "ig_NG", 1057: "id", 1040: "it_IT", 2064: "it_CH", 1041: "ja", 1099: "kn", 1120: "ks", 1087: "kk", 1107: "km", 1111: "kok", 1042: "ko", 1088: "ky", 1108: "lo", 1142: "la", 1062: "lv", 1063: "lt", 2110: "ms_BN", 1086: "ms_MY", 1100: "ml", 1082: "mt", 1112: "mni", 1153: "mi", 1102: "mr", 1104: "mn", 2128: "mn", 1121: "ne", 1044: "no_NO", 2068: "no_NO", 1096: "or", 1045: "pl", 1046: "pt_BR", 2070: "pt_PT", 1094: "pa", 1047: "rm", 2072: "ro_MO", 1048: "ro_RO", 1049: "ru", 2073: "ru_MO", 1083: "se", 1103: "sa", 3098: "sr_SP", 2074: "sr_SP", 1072: "st", 1074: "tn", 1113: "sd", 1115: "si", 1051: "sk", 1060: "sl", 1143: "so", 1070: "sb", 11274: "es_AR", 16394: "es_BO", 13322: "es_CL", 9226: "es_CO", 5130: "es_CR", 7178: "es_DO", 12298: "es_EC", 17418: "es_SV", 4106: "es_GT", 18442: "es_HN", 2058: "es_MX", 19466: "es_NI", 6154: "es_PA", 15370: "es_PY", 10250: "es_PE", 20490: "es_PR", 1034: "es_ES", 14346: "es_UY", 8202: "es_VE", 1089: "sw", 2077: "sv_FI", 1053: "sv_SE", 1114: "syc", 1064: "tg", 1097: "ta", 1092: "tt", 1098: "te", 1054: "th", 1105: "bo", 1073: "ts", 1055: "tr", 1090: "tk", 1058: "uk", 1056: "ur", 2115: "uz_UZ", 1091: "uz_UZ", 1075: "ve", 1066: "vi", 1106: "cy", 1076: "xh", 1085: "yi", 1077: "zu" };
|
|
289
289
|
const l = /^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i, u = {}, d = { group: " ", decimal: ".", positive: "+", negative: "-", percent: "%", exponent: "E", nan: "NaN", infinity: "∞", ampm: ["AM", "PM"], mmmm6: ["Muharram", "Safar", "Rabiʻ I", "Rabiʻ II", "Jumada I", "Jumada II", "Rajab", "Shaʻban", "Ramadan", "Shawwal", "Dhuʻl-Qiʻdah", "Dhuʻl-Hijjah"], mmm6: ["Muh.", "Saf.", "Rab. I", "Rab. II", "Jum. I", "Jum. II", "Raj.", "Sha.", "Ram.", "Shaw.", "Dhuʻl-Q.", "Dhuʻl-H."], mmmm: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], mmm: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], dddd: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], ddd: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] };
|
|
290
|
-
function
|
|
291
|
-
const
|
|
292
|
-
if (!
|
|
293
|
-
throw new SyntaxError("Malformed locale: ".concat(
|
|
294
|
-
return { lang:
|
|
290
|
+
function p(i) {
|
|
291
|
+
const s = l.exec(i);
|
|
292
|
+
if (!s)
|
|
293
|
+
throw new SyntaxError("Malformed locale: ".concat(i));
|
|
294
|
+
return { lang: s[1] + (s[2] ? "_" + s[2] : ""), language: s[1], territory: s[2] || "", codeset: s[3] || "", modifier: s[4] || "" };
|
|
295
295
|
}
|
|
296
|
-
function v(
|
|
297
|
-
if (typeof
|
|
298
|
-
return
|
|
299
|
-
const
|
|
300
|
-
return isFinite(
|
|
296
|
+
function v(i) {
|
|
297
|
+
if (typeof i == "number")
|
|
298
|
+
return a[65535 & i] || null;
|
|
299
|
+
const s = parseInt(i, 16);
|
|
300
|
+
return isFinite(s) && a[65535 & s] ? a[65535 & s] || null : l.test(i) ? i : null;
|
|
301
301
|
}
|
|
302
|
-
function h(
|
|
303
|
-
const
|
|
302
|
+
function h(i) {
|
|
303
|
+
const s = v(i);
|
|
304
304
|
let o = null;
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
o = u[
|
|
305
|
+
if (s) {
|
|
306
|
+
const m = p(s);
|
|
307
|
+
o = u[m.lang] || u[m.language] || null;
|
|
308
308
|
}
|
|
309
309
|
return o;
|
|
310
310
|
}
|
|
311
|
-
function f(
|
|
312
|
-
return Object.assign({}, d,
|
|
311
|
+
function f(i) {
|
|
312
|
+
return Object.assign({}, d, i);
|
|
313
313
|
}
|
|
314
|
-
function b(
|
|
315
|
-
const o = typeof
|
|
316
|
-
return u[o.lang] = f(
|
|
314
|
+
function b(i, s) {
|
|
315
|
+
const o = typeof s == "object" ? s : p(s);
|
|
316
|
+
return u[o.lang] = f(i), o.language === o.lang || u[o.language] || (u[o.language] = f(i)), u[o.lang];
|
|
317
317
|
}
|
|
318
318
|
const I = f({ group: "," });
|
|
319
|
-
function D(
|
|
320
|
-
if (typeof
|
|
321
|
-
return
|
|
322
|
-
if (
|
|
323
|
-
return -D(-
|
|
324
|
-
if (
|
|
325
|
-
const o = 10 ** (
|
|
326
|
-
return D(
|
|
319
|
+
function D(i, s) {
|
|
320
|
+
if (typeof i != "number")
|
|
321
|
+
return i;
|
|
322
|
+
if (i < 0)
|
|
323
|
+
return -D(-i, s);
|
|
324
|
+
if (s) {
|
|
325
|
+
const o = 10 ** (s || 0) || 1;
|
|
326
|
+
return D(i * o, 0) / o;
|
|
327
327
|
}
|
|
328
|
-
return Math.round(
|
|
328
|
+
return Math.round(i);
|
|
329
329
|
}
|
|
330
330
|
I.isDefault = !0, b({ group: ",", ampm: ["上午", "下午"], mmmm: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], mmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], dddd: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], ddd: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"] }, "zh_CN"), b({ group: ",", nan: "非數值", ampm: ["上午", "下午"], mmmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], mmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], dddd: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], ddd: ["週日", "週一", "週二", "週三", "週四", "週五", "週六"] }, "zh_TW"), b({ group: ",", ampm: ["午前", "午後"], mmmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], mmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], dddd: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], ddd: ["日", "月", "火", "水", "木", "金", "土"] }, "ja"), b({ group: ",", ampm: ["오전", "오후"], mmmm: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], mmm: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], dddd: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"], ddd: ["일", "월", "화", "수", "목", "금", "토"] }, "ko"), b({ group: ",", ampm: ["ก่อนเที่ยง", "หลังเที่ยง"], mmmm: ["มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"], mmm: ["ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."], dddd: ["วันอาทิตย์", "วันจันทร์", "วันอังคาร", "วันพุธ", "วันพฤหัสบดี", "วันศุกร์", "วันเสาร์"], ddd: ["อา.", "จ.", "อ.", "พ.", "พฤ.", "ศ.", "ส."] }, "th"), b({ decimal: ",", ampm: ["dop.", "odp."], mmmm: ["ledna", "února", "března", "dubna", "května", "června", "července", "srpna", "září", "října", "listopadu", "prosince"], mmm: ["led", "úno", "bře", "dub", "kvě", "čvn", "čvc", "srp", "zář", "říj", "lis", "pro"], dddd: ["neděle", "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota"], ddd: ["ne", "po", "út", "st", "čt", "pá", "so"] }, "cs"), b({ group: ".", decimal: ",", mmmm: ["januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december"], mmm: ["jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec."], dddd: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"], ddd: ["søn.", "man.", "tir.", "ons.", "tor.", "fre.", "lør."] }, "da"), b({ group: ".", decimal: ",", ampm: ["a.m.", "p.m."], mmmm: ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"], mmm: ["jan.", "feb.", "mrt.", "apr.", "mei", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec."], dddd: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"], ddd: ["zo", "ma", "di", "wo", "do", "vr", "za"] }, "nl"), b({ group: "," }, "en"), b({ decimal: ",", nan: "epäluku", ampm: ["ap.", "ip."], mmmm: ["tammikuuta", "helmikuuta", "maaliskuuta", "huhtikuuta", "toukokuuta", "kesäkuuta", "heinäkuuta", "elokuuta", "syyskuuta", "lokakuuta", "marraskuuta", "joulukuuta"], mmm: ["tammik.", "helmik.", "maalisk.", "huhtik.", "toukok.", "kesäk.", "heinäk.", "elok.", "syysk.", "lokak.", "marrask.", "jouluk."], dddd: ["sunnuntaina", "maanantaina", "tiistaina", "keskiviikkona", "torstaina", "perjantaina", "lauantaina"], ddd: ["su", "ma", "ti", "ke", "to", "pe", "la"] }, "fi"), b({ group: " ", decimal: ",", mmmm: ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"], mmm: ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."], dddd: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], ddd: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."] }, "fr"), b({ group: ".", decimal: ",", mmmm: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], mmm: ["Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sept.", "Okt.", "Nov.", "Dez."], dddd: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], ddd: ["So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."] }, "de"), b({ group: ".", decimal: ",", ampm: ["π.μ.", "μ.μ."], mmmm: ["Ιανουαρίου", "Φεβρουαρίου", "Μαρτίου", "Απριλίου", "Μαΐου", "Ιουνίου", "Ιουλίου", "Αυγούστου", "Σεπτεμβρίου", "Οκτωβρίου", "Νοεμβρίου", "Δεκεμβρίου"], mmm: ["Ιαν", "Φεβ", "Μαρ", "Απρ", "Μαΐ", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ"], dddd: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"], ddd: ["Κυρ", "Δευ", "Τρί", "Τετ", "Πέμ", "Παρ", "Σάβ"] }, "el"), b({ decimal: ",", ampm: ["de.", "du."], mmmm: ["január", "február", "március", "április", "május", "június", "július", "augusztus", "szeptember", "október", "november", "december"], mmm: ["jan.", "febr.", "márc.", "ápr.", "máj.", "jún.", "júl.", "aug.", "szept.", "okt.", "nov.", "dec."], dddd: ["vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"], ddd: ["V", "H", "K", "Sze", "Cs", "P", "Szo"] }, "hu"), b({ group: ".", decimal: ",", ampm: ["f.h.", "e.h."], mmmm: ["janúar", "febrúar", "mars", "apríl", "maí", "júní", "júlí", "ágúst", "september", "október", "nóvember", "desember"], mmm: ["jan.", "feb.", "mar.", "apr.", "maí", "jún.", "júl.", "ágú.", "sep.", "okt.", "nóv.", "des."], dddd: ["sunnudagur", "mánudagur", "þriðjudagur", "miðvikudagur", "fimmtudagur", "föstudagur", "laugardagur"], ddd: ["sun.", "mán.", "þri.", "mið.", "fim.", "fös.", "lau."] }, "is"), b({ group: ".", decimal: ",", mmmm: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], mmm: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agu", "Sep", "Okt", "Nov", "Des"], dddd: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], ddd: ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"] }, "id"), b({ group: ".", decimal: ",", mmmm: ["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre"], mmm: ["gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic"], dddd: ["domenica", "lunedì", "martedì", "mercoledì", "giovedì", "venerdì", "sabato"], ddd: ["dom", "lun", "mar", "mer", "gio", "ven", "sab"] }, "it"), b({ decimal: ",", ampm: ["a.m.", "p.m."], mmmm: ["januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember"], mmm: ["jan.", "feb.", "mar.", "apr.", "mai", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "des."], dddd: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"], ddd: ["søn.", "man.", "tir.", "ons.", "tor.", "fre.", "lør."] }, "nb"), b({ decimal: ",", mmmm: ["stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", "lipca", "sierpnia", "września", "października", "listopada", "grudnia"], mmm: ["sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paź", "lis", "gru"], dddd: ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"], ddd: ["niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob."] }, "pl"), b({ group: ".", decimal: ",", mmmm: ["janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"], mmm: ["jan.", "fev.", "mar.", "abr.", "mai.", "jun.", "jul.", "ago.", "set.", "out.", "nov.", "dez."], dddd: ["domingo", "segunda-feira", "terça-feira", "quarta-feira", "quinta-feira", "sexta-feira", "sábado"], ddd: ["dom.", "seg.", "ter.", "qua.", "qui.", "sex.", "sáb."] }, "pt"), b({ decimal: ",", nan: "не число", mmmm: ["января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"], mmm: ["янв.", "февр.", "мар.", "апр.", "мая", "июн.", "июл.", "авг.", "сент.", "окт.", "нояб.", "дек."], dddd: ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"], ddd: ["вс", "пн", "вт", "ср", "чт", "пт", "сб"] }, "ru"), b({ decimal: ",", mmmm: ["januára", "februára", "marca", "apríla", "mája", "júna", "júla", "augusta", "septembra", "októbra", "novembra", "decembra"], mmm: ["jan", "feb", "mar", "apr", "máj", "jún", "júl", "aug", "sep", "okt", "nov", "dec"], dddd: ["nedeľa", "pondelok", "utorok", "streda", "štvrtok", "piatok", "sobota"], ddd: ["ne", "po", "ut", "st", "št", "pi", "so"] }, "sk"), b({ group: ".", decimal: ",", ampm: ["a. m.", "p. m."], mmmm: ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"], mmm: ["ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sept.", "oct.", "nov.", "dic."], dddd: ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], ddd: ["dom.", "lun.", "mar.", "mié.", "jue.", "vie.", "sáb."] }, "es"), b({ decimal: ",", ampm: ["fm", "em"], mmmm: ["januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december"], mmm: ["jan.", "feb.", "mars", "apr.", "maj", "juni", "juli", "aug.", "sep.", "okt.", "nov.", "dec."], dddd: ["söndag", "måndag", "tisdag", "onsdag", "torsdag", "fredag", "lördag"], ddd: ["sön", "mån", "tis", "ons", "tors", "fre", "lör"] }, "sv"), b({ group: ".", decimal: ",", ampm: ["ÖÖ", "ÖS"], mmmm: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], mmm: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"], dddd: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"], ddd: ["Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt"] }, "tr");
|
|
331
|
-
function
|
|
332
|
-
const
|
|
333
|
-
let y, g, c = Math.abs(
|
|
334
|
-
if ((
|
|
335
|
-
g = [
|
|
336
|
-
else if (
|
|
337
|
-
g = [
|
|
338
|
-
else if (
|
|
339
|
-
g = [1e19 *
|
|
331
|
+
function E(i, s, o) {
|
|
332
|
+
const m = i < 0 ? -1 : 1, _ = 10 ** (s || 2), M = 10 ** (o || 2);
|
|
333
|
+
let y, g, c = Math.abs(i), x = 0, N = 0, S = 0, k = 1;
|
|
334
|
+
if ((i = c) % 1 == 0)
|
|
335
|
+
g = [i * m, 1];
|
|
336
|
+
else if (i < 1e-19)
|
|
337
|
+
g = [m, 1e19];
|
|
338
|
+
else if (i > 1e19)
|
|
339
|
+
g = [1e19 * m, 1];
|
|
340
340
|
else {
|
|
341
341
|
do
|
|
342
|
-
if (c = 1 / (c - Math.floor(c)), y =
|
|
343
|
-
return [
|
|
344
|
-
while (Math.abs(
|
|
345
|
-
g = [
|
|
342
|
+
if (c = 1 / (c - Math.floor(c)), y = k, k = k * Math.floor(c) + x, x = y, N = S, S = Math.floor(i * k + 0.5), S >= _ || k >= M)
|
|
343
|
+
return [m * N, x];
|
|
344
|
+
while (Math.abs(i - S / k) >= 1e-10 && c !== Math.floor(c));
|
|
345
|
+
g = [m * S, k];
|
|
346
346
|
}
|
|
347
347
|
return g;
|
|
348
348
|
}
|
|
349
|
-
const R = { overflow: "######", dateErrorThrows: !1, dateErrorNumber: !0, dateSpanLarge: !0, leap1900: !0, nbsp: !0, throws: !0, invalid: "######", locale: "", ignoreTimezone: !1 },
|
|
350
|
-
function
|
|
351
|
-
if (
|
|
352
|
-
for (const
|
|
353
|
-
if (
|
|
354
|
-
const o = s
|
|
355
|
-
|
|
349
|
+
const R = { overflow: "######", dateErrorThrows: !1, dateErrorNumber: !0, dateSpanLarge: !0, leap1900: !0, nbsp: !0, throws: !0, invalid: "######", locale: "", ignoreTimezone: !1 }, z = Object.assign({}, R);
|
|
350
|
+
function B(i) {
|
|
351
|
+
if (i === null && (i = R), i) {
|
|
352
|
+
for (const s in i)
|
|
353
|
+
if (s in R) {
|
|
354
|
+
const o = i[s];
|
|
355
|
+
z[s] = o ?? R[s];
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
return { ...
|
|
358
|
+
return { ...z };
|
|
359
359
|
}
|
|
360
|
-
const W = { "#": "", 0: "0", "?": " " }, Q = { "@": "text", "-": "minus", "+": "plus" },
|
|
361
|
-
function G(
|
|
362
|
-
return
|
|
360
|
+
const W = { "#": "", 0: "0", "?": " " }, Q = { "@": "text", "-": "minus", "+": "plus" }, pe = ["#000", "#FFF", "#F00", "#0F0", "#00F", "#FF0", "#F0F", "#0FF", "#000", "#FFF", "#F00", "#0F0", "#00F", "#FF0", "#F0F", "#0FF", "#800", "#080", "#008", "#880", "#808", "#088", "#CCC", "#888", "#99F", "#936", "#FFC", "#CFF", "#606", "#F88", "#06C", "#CCF", "#008", "#F0F", "#FF0", "#0FF", "#808", "#800", "#088", "#00F", "#0CF", "#CFF", "#CFC", "#FF9", "#9CF", "#F9C", "#C9F", "#FC9", "#36F", "#3CC", "#9C0", "#FC0"], Pe = ["¤", "$", "£", "¥", "֏", "؋", "৳", "฿", "៛", "₡", "₦", "₩", "₪", "₫", "€", "₭", "₮", "₱", "₲", "₴", "₸", "₹", "₺", "₼", "₽", "₾", "₿"], De = new RegExp("[" + Pe.join("") + "]");
|
|
361
|
+
function G(i, s, o) {
|
|
362
|
+
return s[o + "_max"] = i.length, s[o + "_min"] = i.replace(/#/g, "").length, s;
|
|
363
363
|
}
|
|
364
|
-
const
|
|
365
|
-
function
|
|
366
|
-
if (!(
|
|
367
|
-
const
|
|
368
|
-
for (let
|
|
369
|
-
const _ = o.charAt(
|
|
370
|
-
|
|
364
|
+
const fe = {};
|
|
365
|
+
function $e(i) {
|
|
366
|
+
if (!(i in fe)) {
|
|
367
|
+
const s = [], o = i.replace(/^[#,]+/, "").replace(/[1-9]\d*/g, (m) => "?".repeat(m.length));
|
|
368
|
+
for (let m = 0; m < o.length; m++) {
|
|
369
|
+
const _ = o.charAt(m);
|
|
370
|
+
s[m] = _ in W ? W[_] : _;
|
|
371
371
|
}
|
|
372
|
-
|
|
372
|
+
fe[i] = s.join("");
|
|
373
373
|
}
|
|
374
|
-
return
|
|
374
|
+
return fe[i];
|
|
375
375
|
}
|
|
376
|
-
function
|
|
377
|
-
typeof
|
|
376
|
+
function q(i, s) {
|
|
377
|
+
typeof i == "string" && (i = { type: "string", value: i = i.replace(/ /g, W["?"]) }), s.push(i);
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
const
|
|
381
|
-
let
|
|
379
|
+
function Oe(i) {
|
|
380
|
+
const s = [], o = { scale: 1, percent: !1, text: !1, date: 0, date_eval: !1, date_system: 1, sec_decimals: 0, general: !1, clock: 24, int_pattern: [], frac_pattern: [], man_pattern: [], den_pattern: [], num_pattern: [], tokens: s };
|
|
381
|
+
let m = i + "", _ = "int", M = !1, y = null;
|
|
382
382
|
const g = [];
|
|
383
|
-
let c, x,
|
|
384
|
-
for (;
|
|
385
|
-
if (c = /^General/i.exec(
|
|
386
|
-
o.general = !0,
|
|
387
|
-
else if (_ === "int" && (c = /^[#?0]+(?:,[#?0]+)*/.exec(
|
|
388
|
-
o[_ + "_pattern"].push(c[0]), y = { type: _, num: c[0] },
|
|
389
|
-
else if ((c = /^\//.exec(
|
|
383
|
+
let c, x, N = !1;
|
|
384
|
+
for (; m && !M; ) {
|
|
385
|
+
if (c = /^General/i.exec(m))
|
|
386
|
+
o.general = !0, q({ type: "general" }, s);
|
|
387
|
+
else if (_ === "int" && (c = /^[#?0]+(?:,[#?0]+)*/.exec(m)) || _ === "den" && (c = /^[#?\d]+/.exec(m)) || (c = /^[#?0]+/.exec(m)))
|
|
388
|
+
o[_ + "_pattern"].push(c[0]), y = { type: _, num: c[0] }, q(y, s);
|
|
389
|
+
else if ((c = /^\//.exec(m)) && o[_ + "_pattern"].length) {
|
|
390
390
|
if (!y)
|
|
391
|
-
throw new SyntaxError("Missing a numerator in pattern ".concat(
|
|
392
|
-
o.fractions = !0, o.num_pattern.push(o[_ + "_pattern"].pop()), y.type = "num", _ = "den",
|
|
393
|
-
} else if (c = /^,+/.exec(
|
|
394
|
-
const C =
|
|
395
|
-
x.slice(-1) in W && (c[0].length > 1 || !C) ? o.scale = 1e-3 ** c[0].length : o.dec_fractions ||
|
|
391
|
+
throw new SyntaxError("Missing a numerator in pattern ".concat(i));
|
|
392
|
+
o.fractions = !0, o.num_pattern.push(o[_ + "_pattern"].pop()), y.type = "num", _ = "den", q({ type: "div" }, s);
|
|
393
|
+
} else if (c = /^,+/.exec(m)) {
|
|
394
|
+
const C = m.charAt(1) in W;
|
|
395
|
+
x.slice(-1) in W && (c[0].length > 1 || !C) ? o.scale = 1e-3 ** c[0].length : o.dec_fractions || q(c[0], s);
|
|
396
396
|
} else {
|
|
397
|
-
if (c = /^;/.exec(
|
|
397
|
+
if (c = /^;/.exec(m)) {
|
|
398
398
|
M = !0;
|
|
399
399
|
break;
|
|
400
400
|
}
|
|
401
|
-
if (c = /^[@+-]/.exec(
|
|
402
|
-
c[0] === "@" && (o.text = !0),
|
|
403
|
-
else if (c = /^(?:\[(h+|m+|s+)\])/i.exec(
|
|
404
|
-
const C = c[1].toLowerCase(),
|
|
405
|
-
|
|
406
|
-
} else if (c = /^(?:B2)/i.exec(
|
|
407
|
-
|
|
408
|
-
else if (c = /^(?:B1)/i.exec(
|
|
409
|
-
|
|
410
|
-
else if (c = /^(?:([hHmMsSyYbBdDegG])\1*)/.exec(
|
|
411
|
-
const C = { type: "", size: 0, date: 1, raw: c[0] },
|
|
412
|
-
if (
|
|
401
|
+
if (c = /^[@+-]/.exec(m))
|
|
402
|
+
c[0] === "@" && (o.text = !0), q({ type: Q[c[0]] }, s);
|
|
403
|
+
else if (c = /^(?:\[(h+|m+|s+)\])/i.exec(m)) {
|
|
404
|
+
const C = c[1].toLowerCase(), P = C[0], F = { type: "", size: 0, date: 1, raw: c[0], pad: C.length };
|
|
405
|
+
P === "h" ? (F.size = 16, F.type = "hour-elap") : P === "m" ? (F.size = 32, F.type = "min-elap") : (F.size = 64, F.type = "sec-elap"), o.date = o.date | F.size, g.push(F), q(F, s);
|
|
406
|
+
} else if (c = /^(?:B2)/i.exec(m))
|
|
407
|
+
N || (o.date_system = 6);
|
|
408
|
+
else if (c = /^(?:B1)/i.exec(m))
|
|
409
|
+
N || (o.date_system = 1);
|
|
410
|
+
else if (c = /^(?:([hHmMsSyYbBdDegG])\1*)/.exec(m)) {
|
|
411
|
+
const C = { type: "", size: 0, date: 1, raw: c[0] }, P = c[0].toLowerCase(), F = P[0];
|
|
412
|
+
if (P === "y" || P === "yy")
|
|
413
413
|
C.size = 2, C.type = "year-short";
|
|
414
414
|
else if (F === "y" || F === "e")
|
|
415
415
|
C.size = 2, C.type = "year";
|
|
416
|
-
else if (
|
|
416
|
+
else if (P === "b" || P === "bb")
|
|
417
417
|
C.size = 2, C.type = "b-year-short";
|
|
418
418
|
else if (F === "b")
|
|
419
419
|
C.size = 2, C.type = "b-year";
|
|
420
|
-
else if (
|
|
421
|
-
C.size = 8, C.type = "day", C.pad = /dd/.test(
|
|
422
|
-
else if (
|
|
420
|
+
else if (P === "d" || P === "dd")
|
|
421
|
+
C.size = 8, C.type = "day", C.pad = /dd/.test(P);
|
|
422
|
+
else if (P === "ddd")
|
|
423
423
|
C.size = 8, C.type = "weekday-short";
|
|
424
424
|
else if (F === "d")
|
|
425
425
|
C.size = 8, C.type = "weekday";
|
|
426
426
|
else if (F === "h")
|
|
427
|
-
C.size = 16, C.type = "hour", C.pad = /hh/i.test(
|
|
427
|
+
C.size = 16, C.type = "hour", C.pad = /hh/i.test(P);
|
|
428
428
|
else if (F === "m") {
|
|
429
|
-
|
|
429
|
+
P.length === 3 ? (C.size = 4, C.type = "monthname-short") : P.length === 5 ? (C.size = 4, C.type = "monthname-single") : P.length >= 4 && (C.size = 4, C.type = "monthname");
|
|
430
430
|
const U = g[g.length - 1];
|
|
431
|
-
!C.type && U && !U.used && 80 & U.size && (U.used = !0, C.size = 32, C.type = "min", C.pad = /mm/.test(
|
|
431
|
+
!C.type && U && !U.used && 80 & U.size && (U.used = !0, C.size = 32, C.type = "min", C.pad = /mm/.test(P)), C.type || (C.size = 4, C.type = "month", C.pad = /mm/.test(P), C.indeterminate = !0);
|
|
432
432
|
} else if (F === "s") {
|
|
433
|
-
C.size = 64, C.type = "sec", C.pad = /ss/.test(
|
|
433
|
+
C.size = 64, C.type = "sec", C.pad = /ss/.test(P);
|
|
434
434
|
const U = g[g.length - 1];
|
|
435
435
|
U && 32 & U.size ? C.used = !0 : U && U.indeterminate && (delete U.indeterminate, U.size = 32, U.type = "min", C.used = !0);
|
|
436
436
|
}
|
|
437
|
-
o.date = o.date | C.size, o.date_eval = !0, g.push(C),
|
|
438
|
-
} else if (c = /^(?:AM\/PM|am\/pm|A\/P)/.exec(
|
|
439
|
-
o.clock = 12, o.date = 16 | o.date, o.date_eval = !0,
|
|
440
|
-
else if (o.date && (c = /^\.0{1,3}/i.exec(
|
|
441
|
-
const C = c[0].length - 1,
|
|
442
|
-
o.date = o.date |
|
|
443
|
-
} else if ((c = /^\\(.)/.exec(
|
|
444
|
-
|
|
445
|
-
else if (c = /^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(
|
|
437
|
+
o.date = o.date | C.size, o.date_eval = !0, g.push(C), q(C, s);
|
|
438
|
+
} else if (c = /^(?:AM\/PM|am\/pm|A\/P)/.exec(m))
|
|
439
|
+
o.clock = 12, o.date = 16 | o.date, o.date_eval = !0, q({ type: "am", short: c[0] === "A/P" }, s);
|
|
440
|
+
else if (o.date && (c = /^\.0{1,3}/i.exec(m))) {
|
|
441
|
+
const C = c[0].length - 1, P = [64, 128, 256, 512][C];
|
|
442
|
+
o.date = o.date | P, o.date_eval = !0, o.sec_decimals = Math.max(o.sec_decimals, C), q({ type: "subsec", size: P, decimals: C, date: 1, raw: c[0] }, s);
|
|
443
|
+
} else if ((c = /^\\(.)/.exec(m)) || (c = /^"([^"]*?)"/.exec(m)))
|
|
444
|
+
q(c[1], s);
|
|
445
|
+
else if (c = /^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(m))
|
|
446
446
|
o.condition = [c[1], parseFloat(c[2], 10)];
|
|
447
|
-
else if (c = /^\[\$([^\]]+)\]/.exec(
|
|
448
|
-
const C = c[1].split("-"),
|
|
449
|
-
F &&
|
|
450
|
-
const U = v(
|
|
447
|
+
else if (c = /^\[\$([^\]]+)\]/.exec(m)) {
|
|
448
|
+
const C = c[1].split("-"), P = C.length < 2 ? "" : C[C.length - 1], F = C[0];
|
|
449
|
+
F && q(F, s);
|
|
450
|
+
const U = v(P);
|
|
451
451
|
U && (o.locale = U);
|
|
452
|
-
const
|
|
453
|
-
isFinite(
|
|
454
|
-
} else if (c = /^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(
|
|
455
|
-
o.color = c[2] ?
|
|
456
|
-
else if (!(c = /^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(
|
|
457
|
-
if (c = /^%/.exec(
|
|
458
|
-
o.scale = 100, o.percent = !0,
|
|
459
|
-
else if (c = /^_(\\.|.)/.exec(
|
|
460
|
-
|
|
461
|
-
else if (c = /^\./.exec(
|
|
462
|
-
|
|
463
|
-
else if (c = /^[Ee]([+-]?|(?=[0#?]))/.exec(
|
|
464
|
-
o.exponential = !0, o.exp_plus = c[1] === "+", _ = "man",
|
|
465
|
-
else if (!(c = /^\*(\\.|.)/.exec(
|
|
466
|
-
if (c = /^[BENn[]/.exec(
|
|
467
|
-
throw new SyntaxError("Unexpected char ".concat(
|
|
468
|
-
|
|
452
|
+
const H = parseInt(P, 16);
|
|
453
|
+
isFinite(H) && 16711680 & H && (H >> 16 & 255) === 6 && (o.date_system = 6), N = !0;
|
|
454
|
+
} else if (c = /^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(m))
|
|
455
|
+
o.color = c[2] ? pe[parseInt(c[2], 10)] || "#000" : c[1].toLowerCase();
|
|
456
|
+
else if (!(c = /^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(m))) {
|
|
457
|
+
if (c = /^%/.exec(m))
|
|
458
|
+
o.scale = 100, o.percent = !0, q("%", s);
|
|
459
|
+
else if (c = /^_(\\.|.)/.exec(m))
|
|
460
|
+
q(" ", s);
|
|
461
|
+
else if (c = /^\./.exec(m))
|
|
462
|
+
q({ type: "point", value: c[0] }, s), o.dec_fractions = !0, _ = "frac";
|
|
463
|
+
else if (c = /^[Ee]([+-]?|(?=[0#?]))/.exec(m))
|
|
464
|
+
o.exponential = !0, o.exp_plus = c[1] === "+", _ = "man", q({ type: "exp", plus: c[1] === "+" }, s);
|
|
465
|
+
else if (!(c = /^\*(\\.|.)/.exec(m))) {
|
|
466
|
+
if (c = /^[BENn[]/.exec(m))
|
|
467
|
+
throw new SyntaxError("Unexpected char ".concat(m.charAt(0), " in pattern ").concat(i));
|
|
468
|
+
m[0] === "(" && (o.parens = !0), c = [m[0]], q(c[0], s);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
x = c[0],
|
|
472
|
+
x = c[0], m = m.slice(c ? c[0].length : 1);
|
|
473
473
|
}
|
|
474
|
-
if (o.pattern =
|
|
474
|
+
if (o.pattern = i.slice(0, i.length - m.length), /^((?:\[[^\]]+\])+)(;|$)/.test(o.pattern) && !/^\[(?:h+|m+|s+)\]/.test(o.pattern) && q({ type: "text" }, s), o.fractions && o.dec_fractions || o.fractions && o.exponential)
|
|
475
475
|
throw new SyntaxError("Invalid pattern: ".concat(o.pattern));
|
|
476
476
|
const S = o.int_pattern.join("");
|
|
477
477
|
if (o.grouping = S.indexOf(",") >= 0, o.grouping) {
|
|
478
|
-
const C = S.split(","),
|
|
479
|
-
|
|
478
|
+
const C = S.split(","), P = C.length;
|
|
479
|
+
P === 2 ? (o.group_pri = C[1].length, o.group_sec = o.group_pri) : P > 2 && (o.group_pri = C[P - 1].length, o.group_sec = C[P - 2].length);
|
|
480
480
|
} else
|
|
481
481
|
o.group_pri = 0, o.group_sec = 0;
|
|
482
482
|
G(S.replace(/[,]/g, ""), o, "int"), G(o.frac_pattern.join(""), o, "frac"), G(o.man_pattern.join(""), o, "man");
|
|
483
|
-
let
|
|
484
|
-
const T = /\?/.test(
|
|
485
|
-
return
|
|
486
|
-
const F =
|
|
483
|
+
let k = o.num_pattern.join(""), A = o.den_pattern.join("");
|
|
484
|
+
const T = /\?/.test(A) || /\?/.test(k);
|
|
485
|
+
return A = A.replace(/\d/g, T ? "?" : "#"), T && (A = A.replace(/#$/g, "?")), G(k, o, "num"), G(A, o, "den"), T && (k = k.replace(/#$/g, "?")), o.int_padding = $e(o.int_pattern.join("")), o.man_padding = $e(o.man_pattern.join("")), o.num_padding = $e(k), o.den_padding = $e(A), o.den_pattern.length && (o.denominator = parseInt(o.den_pattern.join("").replace(/\D/g, ""), 10)), o.integer = !!o.int_pattern.join("").length, o.fractions && s.forEach((C, P) => {
|
|
486
|
+
const F = s[P + 1];
|
|
487
487
|
C.type === "string" && F && (F.type === "num" ? C.rule = "num+int" : F.type === "div" ? C.rule = "num" : F.type === "den" && (C.rule = "den"));
|
|
488
488
|
}), o;
|
|
489
489
|
}
|
|
490
|
-
const
|
|
491
|
-
const
|
|
492
|
-
|
|
490
|
+
const Et = (i) => {
|
|
491
|
+
const s = i.condition;
|
|
492
|
+
s && s[1] < 0 && (s[0] === "<" || s[0] === "<=" || s[0] === "=") || i.tokens.unshift({ type: "minus", volatile: !0 });
|
|
493
493
|
};
|
|
494
|
-
function
|
|
495
|
-
const
|
|
496
|
-
let o,
|
|
494
|
+
function Zt(i) {
|
|
495
|
+
const s = [];
|
|
496
|
+
let o, m = !1, _ = null, M = i, y = 0, g = !1, c = 0, x = 0;
|
|
497
497
|
do {
|
|
498
|
-
if (g =
|
|
498
|
+
if (g = Oe(M), (g.date || g.general) && (g.int_pattern.length || g.frac_pattern.length || g.scale !== 1 || g.text))
|
|
499
499
|
throw new Error("Illegal format");
|
|
500
|
-
if (g.condition && (x++,
|
|
500
|
+
if (g.condition && (x++, m = !0), g.text) {
|
|
501
501
|
if (_)
|
|
502
502
|
throw new Error("Unexpected partition");
|
|
503
503
|
_ = g;
|
|
504
504
|
}
|
|
505
|
-
g.locale && (o = v(g.locale)),
|
|
505
|
+
g.locale && (o = v(g.locale)), s.push(g), y = M.charAt(g.pattern.length) === ";" ? 1 : 0, M = M.slice(g.pattern.length + y), c++;
|
|
506
506
|
} while (y && c < 4 && x < 3);
|
|
507
507
|
if (y)
|
|
508
508
|
throw new Error("Unexpected partition");
|
|
509
509
|
if (x > 2)
|
|
510
510
|
throw new Error("Unexpected condition");
|
|
511
|
-
const
|
|
512
|
-
if (
|
|
511
|
+
const N = s[3];
|
|
512
|
+
if (N && (N.int_pattern.length || N.frac_pattern.length || N.date))
|
|
513
513
|
throw new Error("Unexpected partition");
|
|
514
|
-
if (
|
|
515
|
-
const S =
|
|
516
|
-
if (S === 1 && (
|
|
517
|
-
const
|
|
518
|
-
if (
|
|
519
|
-
|
|
514
|
+
if (m) {
|
|
515
|
+
const S = s.length;
|
|
516
|
+
if (S === 1 && (s[1] = Oe("General"), s[1].generated = !0), S < 3) {
|
|
517
|
+
const k = s[0], A = s[1];
|
|
518
|
+
if (Et(k), A.condition)
|
|
519
|
+
Et(A);
|
|
520
520
|
else {
|
|
521
|
-
const T =
|
|
522
|
-
(T[0] === "=" || T[1] >= 0 && (T[0] === ">" || T[0] === ">=")) &&
|
|
521
|
+
const T = k.condition;
|
|
522
|
+
(T[0] === "=" || T[1] >= 0 && (T[0] === ">" || T[0] === ">=")) && A.tokens.unshift({ type: "minus", volatile: !0 });
|
|
523
523
|
}
|
|
524
524
|
} else
|
|
525
|
-
|
|
525
|
+
s.forEach(Et);
|
|
526
526
|
} else {
|
|
527
|
-
if (
|
|
528
|
-
for (let S = 0,
|
|
529
|
-
|
|
530
|
-
if (
|
|
531
|
-
const S =
|
|
532
|
-
S.tokens.unshift({ type: "minus", volatile: !0 }), S.generated = !0,
|
|
527
|
+
if (s.length < 4 && _)
|
|
528
|
+
for (let S = 0, k = s.length; S < k; S++)
|
|
529
|
+
s[S] === _ && s.splice(S, 1);
|
|
530
|
+
if (s.length < 1 && _ && (s[0] = Oe("General"), s[0].generated = !0), s.length < 2) {
|
|
531
|
+
const S = Oe(s[0].pattern);
|
|
532
|
+
S.tokens.unshift({ type: "minus", volatile: !0 }), S.generated = !0, s.push(S);
|
|
533
533
|
}
|
|
534
|
-
if (
|
|
535
|
-
const S =
|
|
536
|
-
S.generated = !0,
|
|
534
|
+
if (s.length < 3) {
|
|
535
|
+
const S = Oe(s[0].pattern);
|
|
536
|
+
S.generated = !0, s.push(S);
|
|
537
537
|
}
|
|
538
|
-
if (
|
|
538
|
+
if (s.length < 4)
|
|
539
539
|
if (_)
|
|
540
|
-
|
|
540
|
+
s.push(_);
|
|
541
541
|
else {
|
|
542
|
-
const S =
|
|
543
|
-
S.generated = !0,
|
|
542
|
+
const S = Oe("@");
|
|
543
|
+
S.generated = !0, s.push(S);
|
|
544
544
|
}
|
|
545
|
-
|
|
545
|
+
s[0].condition = [">", 0], s[1].condition = ["<", 0], s[2].condition = null;
|
|
546
546
|
}
|
|
547
|
-
return { pattern:
|
|
547
|
+
return { pattern: i, partitions: s, locale: o };
|
|
548
548
|
}
|
|
549
549
|
const X = Math.floor;
|
|
550
|
-
function
|
|
551
|
-
if ((!(arguments.length > 1 && arguments[1] !== void 0) || arguments[1]) &&
|
|
552
|
-
if (
|
|
550
|
+
function Qt(i) {
|
|
551
|
+
if ((!(arguments.length > 1 && arguments[1] !== void 0) || arguments[1]) && i >= 0) {
|
|
552
|
+
if (i === 0)
|
|
553
553
|
return [1900, 1, 0];
|
|
554
|
-
if (
|
|
554
|
+
if (i === 60)
|
|
555
555
|
return [1900, 2, 29];
|
|
556
|
-
if (
|
|
557
|
-
return [1900,
|
|
556
|
+
if (i < 60)
|
|
557
|
+
return [1900, i < 32 ? 1 : 2, (i - 1) % 31 + 1];
|
|
558
558
|
}
|
|
559
|
-
let o =
|
|
560
|
-
const
|
|
561
|
-
o -= X((146097 *
|
|
559
|
+
let o = i + 68569 + 2415019;
|
|
560
|
+
const m = X(4 * o / 146097);
|
|
561
|
+
o -= X((146097 * m + 3) / 4);
|
|
562
562
|
const _ = X(4e3 * (o + 1) / 1461001);
|
|
563
563
|
o = o - X(1461 * _ / 4) + 31;
|
|
564
564
|
const M = X(80 * o / 2447), y = o - X(2447 * M / 80);
|
|
565
565
|
o = X(M / 11);
|
|
566
566
|
const g = M + 2 - 12 * o;
|
|
567
|
-
return [0 | 100 * (
|
|
567
|
+
return [0 | 100 * (m - 49) + _ + o, 0 | g, 0 | y];
|
|
568
568
|
}
|
|
569
|
-
function
|
|
570
|
-
return
|
|
569
|
+
function Yn(i) {
|
|
570
|
+
return Qt(i + 1462);
|
|
571
571
|
}
|
|
572
|
-
function
|
|
573
|
-
if (
|
|
572
|
+
function Bn(i) {
|
|
573
|
+
if (i === 60)
|
|
574
574
|
throw new Error("#VALUE!");
|
|
575
|
-
if (
|
|
575
|
+
if (i <= 1)
|
|
576
576
|
return [1317, 8, 29];
|
|
577
|
-
if (
|
|
578
|
-
return [1317,
|
|
579
|
-
const
|
|
580
|
-
let
|
|
581
|
-
const _ = X(
|
|
582
|
-
|
|
583
|
-
const M = X((
|
|
584
|
-
|
|
585
|
-
const y = X((
|
|
586
|
-
return y === 13 ? [30 * _ + M, 12, 30] : [30 * _ + M, y,
|
|
577
|
+
if (i < 60)
|
|
578
|
+
return [1317, i < 32 ? 9 : 10, 1 + (i - 2) % 30];
|
|
579
|
+
const s = 10631 / 30, o = 0.1335;
|
|
580
|
+
let m = i + 466935;
|
|
581
|
+
const _ = X(m / 10631);
|
|
582
|
+
m -= 10631 * _;
|
|
583
|
+
const M = X((m - o) / s);
|
|
584
|
+
m -= X(M * s + o);
|
|
585
|
+
const y = X((m + 28.5001) / 29.5);
|
|
586
|
+
return y === 13 ? [30 * _ + M, 12, 30] : [30 * _ + M, y, m - X(29.5001 * y - 29)];
|
|
587
587
|
}
|
|
588
|
-
function
|
|
589
|
-
let
|
|
590
|
-
const
|
|
591
|
-
return
|
|
588
|
+
function Xt(i) {
|
|
589
|
+
let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, o = !(arguments.length > 2 && arguments[2] !== void 0) || arguments[2];
|
|
590
|
+
const m = X(i);
|
|
591
|
+
return s === 6 ? Bn(m) : s === -1 ? Yn(m) : Qt(m, o);
|
|
592
592
|
}
|
|
593
|
-
const
|
|
594
|
-
function
|
|
593
|
+
const st = Math.floor, Nt = 86400;
|
|
594
|
+
function at(i, s) {
|
|
595
595
|
let o = null;
|
|
596
|
-
if (Array.isArray(
|
|
597
|
-
const [
|
|
598
|
-
o = Date.UTC(
|
|
599
|
-
} else if (
|
|
600
|
-
const
|
|
601
|
-
|
|
596
|
+
if (Array.isArray(i)) {
|
|
597
|
+
const [m, _, M, y, g, c] = i;
|
|
598
|
+
o = Date.UTC(m, _ == null ? 0 : _ - 1, M ?? 1, y || 0, g || 0, c || 0);
|
|
599
|
+
} else if (i instanceof Date && (o = 1 * i, !s || !s.ignoreTimezone)) {
|
|
600
|
+
const m = /* @__PURE__ */ new Date();
|
|
601
|
+
m.setUTCFullYear(i.getFullYear(), i.getMonth(), i.getDate()), m.setUTCHours(i.getHours(), i.getMinutes(), i.getSeconds(), i.getMilliseconds()), o = 1 * m;
|
|
602
602
|
}
|
|
603
603
|
if (o != null && isFinite(o)) {
|
|
604
|
-
const
|
|
605
|
-
return
|
|
604
|
+
const m = o / 864e5;
|
|
605
|
+
return m - (m <= -25509 ? -25568 : -25569);
|
|
606
606
|
}
|
|
607
|
-
return
|
|
607
|
+
return i;
|
|
608
608
|
}
|
|
609
|
-
function
|
|
610
|
-
let o = 0 |
|
|
611
|
-
const
|
|
612
|
-
let _ =
|
|
613
|
-
|
|
614
|
-
const M = _ < 0 ?
|
|
615
|
-
if (
|
|
616
|
-
const
|
|
617
|
-
return
|
|
609
|
+
function en(i, s) {
|
|
610
|
+
let o = 0 | i;
|
|
611
|
+
const m = Nt * (i - o);
|
|
612
|
+
let _ = st(m);
|
|
613
|
+
m - _ > 0.9999 && (_ += 1, _ === Nt && (_ = 0, o += 1));
|
|
614
|
+
const M = _ < 0 ? Nt + _ : _, [y, g, c] = Xt(i, 0, s && s.leap1900), x = st(M / 60 / 60) % 60, N = st(M / 60) % 60, S = st(M) % 60;
|
|
615
|
+
if (s && s.nativeDate) {
|
|
616
|
+
const k = /* @__PURE__ */ new Date(0);
|
|
617
|
+
return k.setUTCFullYear(y, g - 1, c), k.setUTCHours(x, N, S), k;
|
|
618
618
|
}
|
|
619
|
-
return [y, g, c, x,
|
|
619
|
+
return [y, g, c, x, N, S];
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
return !!(
|
|
621
|
+
function Hn(i) {
|
|
622
|
+
return !!(i[0] && i[0].percent || i[1] && i[1].percent || i[2] && i[2].percent || i[3] && i[3].percent);
|
|
623
623
|
}
|
|
624
|
-
function
|
|
625
|
-
return !!(
|
|
624
|
+
function Vn(i) {
|
|
625
|
+
return !!(i[0] && i[0].date || i[1] && i[1].date || i[2] && i[2].date || i[3] && i[3].date);
|
|
626
626
|
}
|
|
627
|
-
function
|
|
628
|
-
const [
|
|
629
|
-
return !(
|
|
627
|
+
function Jn(i) {
|
|
628
|
+
const [s, o, m, _] = i;
|
|
629
|
+
return !(s && !s.generated || o && !o.generated || m && !m.generated || !_ || !_.text || _.generated);
|
|
630
630
|
}
|
|
631
|
-
const
|
|
632
|
-
function
|
|
631
|
+
const Wn = { text: 15, datetime: 10.8, date: 10.8, time: 10.8, percent: 10.6, currency: 10.4, grouped: 10.2, scientific: 6, number: 4, fraction: 2, general: 0, error: 0 }, Gn = [["DMY", 1], ["DM", 2], ["MY", 3], ["MDY", 4], ["MD", 5], ["hmsa", 6], ["hma", 7], ["hms", 8], ["hm", 9]], Kn = { total: 1, sign: 0, period: 0, int: 1, frac: 0 }, Je = (i, s) => i.replace(/\./, s.decimal);
|
|
632
|
+
function tn(i, s, o, m) {
|
|
633
633
|
const _ = 0 | o;
|
|
634
634
|
if (typeof o == "string")
|
|
635
|
-
|
|
635
|
+
i.push(o);
|
|
636
636
|
else if (o === _)
|
|
637
|
-
|
|
637
|
+
i.push(Math.abs(_));
|
|
638
638
|
else {
|
|
639
639
|
const M = Math.abs(o);
|
|
640
640
|
let y = M ? Math.floor(Math.log10(M)) : 0, g = y < 0 ? M * 10 ** -y : M / 10 ** y;
|
|
641
641
|
g === 10 && (g = 1, y++);
|
|
642
|
-
const c = function(
|
|
642
|
+
const c = function(N) {
|
|
643
643
|
let S = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1];
|
|
644
|
-
const
|
|
645
|
-
if (!
|
|
646
|
-
return
|
|
647
|
-
const
|
|
648
|
-
let
|
|
649
|
-
if (T !==
|
|
650
|
-
|
|
651
|
-
const U = String(D(C < 0 ?
|
|
652
|
-
let
|
|
653
|
-
for (;
|
|
654
|
-
if (U[
|
|
655
|
-
|
|
644
|
+
const k = Math.abs(N);
|
|
645
|
+
if (!k)
|
|
646
|
+
return Kn;
|
|
647
|
+
const A = S && N < 0 ? 1 : 0, T = Math.floor(k), C = Math.floor(Math.log10(k) + 1);
|
|
648
|
+
let P = 0, F = 0;
|
|
649
|
+
if (T !== k) {
|
|
650
|
+
P = 1;
|
|
651
|
+
const U = String(D(C < 0 ? k * 10 ** -C : k / 10 ** C, 15));
|
|
652
|
+
let H = U.length, Y = !0, Z = 0;
|
|
653
|
+
for (; Z <= U.length; ) {
|
|
654
|
+
if (U[Z] === ".") {
|
|
655
|
+
H--;
|
|
656
656
|
break;
|
|
657
657
|
}
|
|
658
|
-
U[
|
|
658
|
+
U[Z] === "0" && Y ? H-- : Y = !1, Z++;
|
|
659
659
|
}
|
|
660
|
-
F =
|
|
660
|
+
F = H - C, F < 0 && (F = 0, P = 0);
|
|
661
661
|
}
|
|
662
|
-
return { total:
|
|
662
|
+
return { total: A + Math.max(C, 1) + P + F, digits: Math.max(C, 0) + F, sign: A, period: P, int: Math.max(C, 1), frac: F };
|
|
663
663
|
}(M), x = () => {
|
|
664
|
-
const
|
|
664
|
+
const N = Math.abs(y);
|
|
665
665
|
let S;
|
|
666
|
-
S = g === 1 ? g : D(g, 5),
|
|
666
|
+
S = g === 1 ? g : D(g, 5), i.push(Je(S + "", m), m.exponent, y < 0 ? m.negative : m.positive, N < 10 ? "0" : "", N);
|
|
667
667
|
};
|
|
668
668
|
if (y >= -4 && y <= -1) {
|
|
669
|
-
const
|
|
670
|
-
|
|
669
|
+
const N = M.toPrecision(10 + y).replace(/\.?0+$/, "");
|
|
670
|
+
i.push(Je(N, m));
|
|
671
671
|
} else if (y === 10) {
|
|
672
|
-
const
|
|
673
|
-
|
|
672
|
+
const N = M.toFixed(10).slice(0, 12).replace(/\.$/, "");
|
|
673
|
+
i.push(Je(N, m));
|
|
674
674
|
} else if (Math.abs(y) <= 9)
|
|
675
675
|
if (c.total <= 11) {
|
|
676
|
-
const
|
|
677
|
-
|
|
676
|
+
const N = D(M, 9).toFixed(c.frac);
|
|
677
|
+
i.push(Je(N, m));
|
|
678
678
|
} else
|
|
679
|
-
y === 9 ?
|
|
679
|
+
y === 9 ? i.push(Math.floor(M)) : y >= 0 && y < 9 ? i.push(D(M, 9 - y)) : x();
|
|
680
680
|
else
|
|
681
|
-
c.total >= 12 ? x() : Math.floor(M) === M ?
|
|
681
|
+
c.total >= 12 ? x() : Math.floor(M) === M ? i.push(Math.floor(M)) : i.push(Je(D(M, 9).toFixed(c.frac), m));
|
|
682
682
|
}
|
|
683
|
-
return
|
|
683
|
+
return i;
|
|
684
684
|
}
|
|
685
|
-
const We = 86400,
|
|
686
|
-
let
|
|
687
|
-
const o = Math.floor(Math.log10(
|
|
688
|
-
return
|
|
685
|
+
const We = 86400, nn = { int: "integer", frac: "fraction", man: "mantissa", num: "numerator", den: "denominator" }, rn = function(i) {
|
|
686
|
+
let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
687
|
+
const o = Math.floor(Math.log10(i));
|
|
688
|
+
return s > 1 ? Math.floor(o / s) * s : o;
|
|
689
689
|
};
|
|
690
|
-
function
|
|
691
|
-
let _ = "", M = "", y = "", g = "", c = "", x = 0,
|
|
692
|
-
const
|
|
693
|
-
if (!
|
|
690
|
+
function sn(i, s, o, m) {
|
|
691
|
+
let _ = "", M = "", y = "", g = "", c = "", x = 0, N = 0 | i, S = 0, k = 0, A = 1, T = 0, C = 0, P = 0, F = 0, U = 0, H = 0;
|
|
692
|
+
const Y = m || I;
|
|
693
|
+
if (!s.text && isFinite(s.scale) && s.scale !== 1 && (i = function(L) {
|
|
694
694
|
if (L === 0)
|
|
695
695
|
return L;
|
|
696
|
-
const
|
|
696
|
+
const V = Math.ceil(Math.log10(L < 0 ? -L : L)), j = 10 ** (16 - Math.floor(V));
|
|
697
697
|
return Math.round(L * j) / j;
|
|
698
|
-
}(
|
|
699
|
-
let L = Math.abs(
|
|
698
|
+
}(i * s.scale)), s.exponential) {
|
|
699
|
+
let L = Math.abs(i);
|
|
700
700
|
if (L) {
|
|
701
|
-
const
|
|
702
|
-
x =
|
|
701
|
+
const V = 10 ** -rn(L, s.int_max), j = D(L * V, s.frac_max) / V;
|
|
702
|
+
x = rn(j, s.int_max);
|
|
703
703
|
}
|
|
704
|
-
L /= 10 ** x,
|
|
704
|
+
L /= 10 ** x, i = i < 0 ? -L : L, _ += Math.abs(x);
|
|
705
705
|
}
|
|
706
|
-
if (
|
|
707
|
-
const L = Math.abs(D(
|
|
706
|
+
if (s.integer) {
|
|
707
|
+
const L = Math.abs(D(i, s.fractions ? 1 : s.frac_max));
|
|
708
708
|
c += L < 1 ? "" : Math.floor(L);
|
|
709
709
|
}
|
|
710
|
-
if (
|
|
711
|
-
let L = "",
|
|
712
|
-
for (
|
|
713
|
-
|
|
714
|
-
c =
|
|
710
|
+
if (s.grouping) {
|
|
711
|
+
let L = "", V = c.length;
|
|
712
|
+
for (V > s.group_pri && (V -= s.group_pri, L = Y.group + c.slice(V, V + s.group_pri) + L); V > s.group_sec; )
|
|
713
|
+
V -= s.group_sec, L = Y.group + c.slice(V, V + s.group_sec) + L;
|
|
714
|
+
c = V ? c.slice(0, V) + L : L;
|
|
715
715
|
}
|
|
716
|
-
|
|
717
|
-
let
|
|
718
|
-
if (
|
|
719
|
-
const L = Math.abs(
|
|
716
|
+
s.dec_fractions && (g = String(D(i, s.frac_max)).split(".")[1] || "");
|
|
717
|
+
let Z = !1;
|
|
718
|
+
if (s.fractions) {
|
|
719
|
+
const L = Math.abs(s.integer ? i % 1 : i);
|
|
720
720
|
if (L)
|
|
721
|
-
if (
|
|
722
|
-
y +=
|
|
721
|
+
if (Z = !0, isFinite(s.denominator))
|
|
722
|
+
y += s.denominator, M += D(L * s.denominator), M === "0" && (M = "", y = "", Z = !1, c || (c = "0"));
|
|
723
723
|
else {
|
|
724
|
-
const
|
|
725
|
-
M +=
|
|
724
|
+
const V = E(L, s.integer ? s.num_max : 1 / 0, s.den_max);
|
|
725
|
+
M += V[0], y += V[1], s.integer && M === "0" && (c || (c = "0"), M = "", y = "", Z = !1);
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
|
-
if (
|
|
729
|
-
|
|
730
|
-
const L = We * (
|
|
731
|
-
if (S = Math.floor(L),
|
|
732
|
-
const
|
|
733
|
-
(
|
|
728
|
+
if (s.date) {
|
|
729
|
+
N = Math.trunc(i);
|
|
730
|
+
const L = We * (i - N);
|
|
731
|
+
if (S = Math.floor(L), H = L - S, Math.abs(H) < 1e-6 ? H = 0 : H > 0.9999 && (H = 0, S += 1, S === We && (S = 0, N += 1)), H) {
|
|
732
|
+
const V = 512 & s.date || 256 & s.date || 128 & s.date;
|
|
733
|
+
(V === 512 && H > 0.9995 || V === 256 && H > 0.995 || V === 128 && H > 0.95 || !V && H >= 0.5) && (S++, H = 0);
|
|
734
734
|
}
|
|
735
|
-
if (
|
|
736
|
-
const
|
|
737
|
-
|
|
735
|
+
if (N || s.date_system) {
|
|
736
|
+
const V = Xt(i, s.date_system, o.leap1900);
|
|
737
|
+
k = V[0], A = V[1], T = V[2];
|
|
738
738
|
}
|
|
739
739
|
if (S) {
|
|
740
|
-
const
|
|
741
|
-
U = Math.floor(
|
|
740
|
+
const V = S < 0 ? We + S : S;
|
|
741
|
+
U = Math.floor(V) % 60, F = Math.floor(V / 60) % 60, P = Math.floor(V / 60 / 60) % 60;
|
|
742
742
|
}
|
|
743
|
-
if (C = (6 +
|
|
743
|
+
if (C = (6 + N) % 7, s.date_eval && (be = i, Ee = N + S / We, o.dateSpanLarge ? be < -694324 || Ee >= 35830291 : be < 0 || Ee >= 2958466)) {
|
|
744
744
|
if (o.dateErrorThrows)
|
|
745
745
|
throw new Error("Date out of bounds");
|
|
746
|
-
return o.dateErrorNumber ?
|
|
746
|
+
return o.dateErrorNumber ? tn(i < 0 ? [Y.negative] : [], 0, i, Y).join("") : o.overflow;
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
|
-
var
|
|
750
|
-
if (
|
|
751
|
-
const L =
|
|
752
|
-
_ =
|
|
749
|
+
var be, Ee;
|
|
750
|
+
if (s.int_padding && (c = s.int_padding.length === 1 ? c || s.int_padding : s.int_padding.substring(0, s.int_padding.length - c.length) + c), s.num_padding && (M = s.num_padding.length === 1 ? M || s.num_padding : s.num_padding.substring(0, s.num_padding.length - M.length) + M), s.den_padding && (y = s.den_padding.length === 1 ? y || s.den_padding : y + s.den_padding.slice(y.length)), s.man_padding) {
|
|
751
|
+
const L = s.exp_plus ? "+" : "";
|
|
752
|
+
_ = s.man_padding.length === 1 ? (x < 0 ? "-" : L) + (_ || s.man_padding) : (x < 0 ? "-" : L) + s.man_padding.slice(0, s.man_padding.length - _.length) + _;
|
|
753
753
|
}
|
|
754
754
|
const w = [];
|
|
755
|
-
let
|
|
756
|
-
const
|
|
757
|
-
for (let L = 0,
|
|
758
|
-
const j =
|
|
755
|
+
let re = 0;
|
|
756
|
+
const xe = { int: 0, frac: 0, man: 0, num: 0, den: 0 };
|
|
757
|
+
for (let L = 0, V = s.tokens.length; L < V; L++) {
|
|
758
|
+
const j = s.tokens[L], it = j.num ? j.num.length : 0;
|
|
759
759
|
if (j.type === "string")
|
|
760
|
-
j.rule ? j.rule === "num" ?
|
|
760
|
+
j.rule ? j.rule === "num" ? Z ? w.push(j.value) : (s.num_min > 0 || s.den_min > 0) && w.push(j.value.replace(/./g, W["?"])) : j.rule === "num+int" ? Z && c ? w.push(j.value) : s.den_min > 0 && (c || s.num_min) && w.push(j.value.replace(/./g, W["?"])) : j.rule === "den" && (Z ? w.push(j.value) : (s.den_min > 0 || s.den_min > 0) && w.push(j.value.replace(/./g, W["?"]))) : w.push(j.value);
|
|
761
761
|
else if (j.type === "error")
|
|
762
762
|
w.push(o.invalid);
|
|
763
763
|
else if (j.type === "point")
|
|
764
|
-
w.push(
|
|
764
|
+
w.push(s.date ? j.value : Y.decimal);
|
|
765
765
|
else if (j.type === "general")
|
|
766
|
-
|
|
766
|
+
tn(w, 0, i, Y);
|
|
767
767
|
else if (j.type === "exp")
|
|
768
|
-
w.push(
|
|
768
|
+
w.push(Y.exponent);
|
|
769
769
|
else if (j.type === "minus")
|
|
770
|
-
j.volatile &&
|
|
770
|
+
j.volatile && s.date || j.volatile && (i >= 0 || typeof i != "number") || (j.volatile && !s.fractions && (s.integer || s.dec_fractions) ? (i < 0 && c && c !== "0" || g) && w.push(Y.negative) : w.push(Y.negative));
|
|
771
771
|
else if (j.type === "plus")
|
|
772
|
-
w.push(
|
|
772
|
+
w.push(Y.positive);
|
|
773
773
|
else if (j.type === "text")
|
|
774
|
-
w.push(
|
|
774
|
+
w.push(i);
|
|
775
775
|
else if (j.type === "div")
|
|
776
|
-
|
|
776
|
+
Z ? w.push("/") : s.num_min > 0 || s.den_min > 0 ? w.push(W["?"]) : w.push(W["#"]);
|
|
777
777
|
else if (j.type === "int")
|
|
778
|
-
if (
|
|
778
|
+
if (s.int_pattern.length === 1)
|
|
779
779
|
w.push(c);
|
|
780
780
|
else {
|
|
781
|
-
const K =
|
|
782
|
-
w.push(c.substring(c.length - K, c.length -
|
|
781
|
+
const K = re ? s.int_pattern.join("").length - xe.int : 1 / 0, Ae = re === s.int_pattern.length - 1 ? 0 : s.int_pattern.join("").length - (xe.int + j.num.length);
|
|
782
|
+
w.push(c.substring(c.length - K, c.length - Ae)), re++, xe.int += j.num.length;
|
|
783
783
|
}
|
|
784
784
|
else if (j.type === "frac") {
|
|
785
|
-
const K =
|
|
786
|
-
for (let
|
|
787
|
-
w.push(g[
|
|
788
|
-
|
|
789
|
-
} else if (j.type in
|
|
790
|
-
|
|
785
|
+
const K = xe.frac;
|
|
786
|
+
for (let Ae = 0; Ae < it; Ae++)
|
|
787
|
+
w.push(g[Ae + K] || W[j.num[Ae]]);
|
|
788
|
+
xe.frac += it;
|
|
789
|
+
} else if (j.type in nn)
|
|
790
|
+
s[j.type + "_pattern"].length === 1 ? (j.type === "int" && w.push(c), j.type === "frac" && w.push(g), j.type === "man" && w.push(_), j.type === "num" && w.push(M), j.type === "den" && w.push(y)) : (w.push(nn[j.type].slice(xe[j.type], xe[j.type] + it)), xe[j.type] += it);
|
|
791
791
|
else if (j.type === "year")
|
|
792
|
-
|
|
792
|
+
k < 0 && w.push(Y.negative), w.push(String(Math.abs(k)).padStart(4, "0"));
|
|
793
793
|
else if (j.type === "year-short") {
|
|
794
|
-
const K =
|
|
794
|
+
const K = k % 100;
|
|
795
795
|
w.push(K < 10 ? "0" : "", K);
|
|
796
796
|
} else if (j.type === "month")
|
|
797
|
-
w.push(j.pad &&
|
|
797
|
+
w.push(j.pad && A < 10 ? "0" : "", A);
|
|
798
798
|
else if (j.type === "monthname-single")
|
|
799
|
-
|
|
799
|
+
s.date_system === 6 ? w.push(Y.mmmm6[A - 1].charAt(0)) : w.push(Y.mmmm[A - 1].charAt(0));
|
|
800
800
|
else if (j.type === "monthname-short")
|
|
801
|
-
|
|
801
|
+
s.date_system === 6 ? w.push(Y.mmm6[A - 1]) : w.push(Y.mmm[A - 1]);
|
|
802
802
|
else if (j.type === "monthname")
|
|
803
|
-
|
|
803
|
+
s.date_system === 6 ? w.push(Y.mmmm6[A - 1]) : w.push(Y.mmmm[A - 1]);
|
|
804
804
|
else if (j.type === "weekday-short")
|
|
805
|
-
w.push(
|
|
805
|
+
w.push(Y.ddd[C]);
|
|
806
806
|
else if (j.type === "weekday")
|
|
807
|
-
w.push(
|
|
807
|
+
w.push(Y.dddd[C]);
|
|
808
808
|
else if (j.type === "day")
|
|
809
809
|
w.push(j.pad && T < 10 ? "0" : "", T);
|
|
810
810
|
else if (j.type === "hour") {
|
|
811
|
-
const K =
|
|
811
|
+
const K = P % s.clock || (s.clock < 24 ? s.clock : 0);
|
|
812
812
|
w.push(j.pad && K < 10 ? "0" : "", K);
|
|
813
813
|
} else if (j.type === "min")
|
|
814
814
|
w.push(j.pad && F < 10 ? "0" : "", F);
|
|
815
815
|
else if (j.type === "sec")
|
|
816
816
|
w.push(j.pad && U < 10 ? "0" : "", U);
|
|
817
817
|
else if (j.type === "subsec") {
|
|
818
|
-
w.push(
|
|
819
|
-
const K =
|
|
818
|
+
w.push(Y.decimal);
|
|
819
|
+
const K = H.toFixed(s.sec_decimals);
|
|
820
820
|
w.push(K.slice(2, 2 + j.decimals));
|
|
821
821
|
} else if (j.type === "am") {
|
|
822
|
-
const K =
|
|
823
|
-
j.short && !
|
|
822
|
+
const K = P < 12 ? 0 : 1;
|
|
823
|
+
j.short && !m ? w.push("AP"[K]) : w.push(Y.ampm[K]);
|
|
824
824
|
} else if (j.type === "hour-elap") {
|
|
825
|
-
|
|
826
|
-
const K = 24 *
|
|
825
|
+
i < 0 && w.push(Y.negative);
|
|
826
|
+
const K = 24 * N + Math.floor(Math.abs(S) / 3600);
|
|
827
827
|
w.push(String(Math.abs(K)).padStart(j.pad, "0"));
|
|
828
828
|
} else if (j.type === "min-elap") {
|
|
829
|
-
|
|
830
|
-
const K = 1440 *
|
|
829
|
+
i < 0 && w.push(Y.negative);
|
|
830
|
+
const K = 1440 * N + Math.floor(Math.abs(S) / 60);
|
|
831
831
|
w.push(String(Math.abs(K)).padStart(j.pad, "0"));
|
|
832
832
|
} else if (j.type === "sec-elap") {
|
|
833
|
-
|
|
834
|
-
const K =
|
|
833
|
+
i < 0 && w.push(Y.negative);
|
|
834
|
+
const K = N * We + Math.abs(S);
|
|
835
835
|
w.push(String(Math.abs(K)).padStart(j.pad, "0"));
|
|
836
836
|
} else if (j.type === "b-year")
|
|
837
|
-
w.push(
|
|
837
|
+
w.push(k + 543);
|
|
838
838
|
else if (j.type === "b-year-short") {
|
|
839
|
-
const K = (
|
|
839
|
+
const K = (k + 543) % 100;
|
|
840
840
|
w.push(K < 10 ? "0" : "", K);
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
843
|
return o.nbsp ? w.join("") : w.join("").replace(/\u00a0/g, " ");
|
|
844
844
|
}
|
|
845
|
-
function
|
|
845
|
+
function an(i, s) {
|
|
846
846
|
for (let o = 0; o < 3; o++) {
|
|
847
|
-
const
|
|
848
|
-
if (
|
|
847
|
+
const m = s[o];
|
|
848
|
+
if (m) {
|
|
849
849
|
let _;
|
|
850
|
-
if (
|
|
851
|
-
const M =
|
|
852
|
-
M === "=" ? _ =
|
|
850
|
+
if (m.condition) {
|
|
851
|
+
const M = m.condition[0], y = m.condition[1];
|
|
852
|
+
M === "=" ? _ = i === y : M === ">" ? _ = i > y : M === "<" ? _ = i < y : M === ">=" ? _ = i >= y : M === "<=" ? _ = i <= y : M === "<>" && (_ = i !== y);
|
|
853
853
|
} else
|
|
854
854
|
_ = !0;
|
|
855
855
|
if (_)
|
|
856
|
-
return
|
|
856
|
+
return m;
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
const
|
|
861
|
-
function le(
|
|
862
|
-
if (
|
|
863
|
-
const o =
|
|
864
|
-
|
|
860
|
+
const on = Oe("@"), cn = "black", ce = {};
|
|
861
|
+
function le(i, s) {
|
|
862
|
+
if (i) {
|
|
863
|
+
const o = i[0];
|
|
864
|
+
s[o] = s[o] || {}, le(i.slice(1), s[o]);
|
|
865
865
|
} else
|
|
866
|
-
|
|
866
|
+
s.$ = !0;
|
|
867
867
|
}
|
|
868
|
-
["d-F-y", "d-F-Y", "d-M-y", "d-M-Y", "F-d-y", "F-d-Y", "F-j-y", "F-j-Y", "j-F-y", "j-F-Y", "j-M-y", "j-M-Y", "M-d-y", "M-d-Y", "M-j-y", "M-j-Y", "m-d-y", "m-d-Y", "m-j-y", "m-j-Y", "n-d-y", "n-d-Y", "n-j-y", "n-j-Y", "y-F-d", "y-F-j", "y-M-d", "y-M-j", "Y-F-d", "Y-F-j", "Y-M-d", "Y-m-d", "Y-M-j", "Y-m-j", "Y-n-d", "Y-n-j", "j-F", "j-M", "d-F", "d-M", "n-d", "n-j", "n-Y", "m-d", "m-j", "m-Y", "M-Y", "M-y", "F-y", "F-Y", "Y-M", "Y-n", "Y-m", "Y-F", "Y-M"].forEach((
|
|
869
|
-
le(
|
|
868
|
+
["d-F-y", "d-F-Y", "d-M-y", "d-M-Y", "F-d-y", "F-d-Y", "F-j-y", "F-j-Y", "j-F-y", "j-F-Y", "j-M-y", "j-M-Y", "M-d-y", "M-d-Y", "M-j-y", "M-j-Y", "m-d-y", "m-d-Y", "m-j-y", "m-j-Y", "n-d-y", "n-d-Y", "n-j-y", "n-j-Y", "y-F-d", "y-F-j", "y-M-d", "y-M-j", "Y-F-d", "Y-F-j", "Y-M-d", "Y-m-d", "Y-M-j", "Y-m-j", "Y-n-d", "Y-n-j", "j-F", "j-M", "d-F", "d-M", "n-d", "n-j", "n-Y", "m-d", "m-j", "m-Y", "M-Y", "M-y", "F-y", "F-Y", "Y-M", "Y-n", "Y-m", "Y-F", "Y-M"].forEach((i) => {
|
|
869
|
+
le(i, ce), le(i + " x", ce), le(i + " l", ce), le(i + " l x", ce), le("l " + i, ce), le("l " + i + " x", ce), le(i + " D", ce), le(i + " D x", ce), le("D " + i, ce), le("D " + i + " x", ce);
|
|
870
870
|
});
|
|
871
|
-
const
|
|
872
|
-
function
|
|
873
|
-
const
|
|
874
|
-
if (
|
|
875
|
-
const [, o,
|
|
876
|
-
let g = 1, c = "", x = !1,
|
|
877
|
-
if (!isFinite(
|
|
871
|
+
const qn = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }, Zn = { january: 1, february: 2, march: 3, april: 4, june: 6, july: 7, august: 8, september: 9, october: 10, november: 11, december: 12 }, Qn = { sunday: "l", monday: "l", tuesday: "l", wednesday: "l", thursday: "l", friday: "l", saturday: "l", sun: "D", mon: "D", tue: "D", wed: "D", thu: "D", fri: "D", sat: "D" }, Xn = (/* @__PURE__ */ new Date()).getUTCFullYear();
|
|
872
|
+
function ln(i) {
|
|
873
|
+
const s = new RegExp("^([\\s+%" + Pe.join("") + "(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%" + Pe.join("") + ")]*)$").exec(i);
|
|
874
|
+
if (s) {
|
|
875
|
+
const [, o, m, _, M, y] = s;
|
|
876
|
+
let g = 1, c = "", x = !1, N = !1, S = !1, k = !1, A = !1, T = null, C = !1, P = parseFloat(m.replace(/,/g, ""));
|
|
877
|
+
if (!isFinite(P))
|
|
878
878
|
return null;
|
|
879
879
|
for (let U = 0; U < o.length; U++) {
|
|
880
|
-
const
|
|
881
|
-
if (
|
|
882
|
-
if (x ||
|
|
880
|
+
const H = o[U];
|
|
881
|
+
if (H === "-") {
|
|
882
|
+
if (x || N)
|
|
883
883
|
return null;
|
|
884
884
|
x = !0, g = -1;
|
|
885
|
-
} else if (
|
|
886
|
-
if (
|
|
885
|
+
} else if (De.test(H)) {
|
|
886
|
+
if (A)
|
|
887
887
|
return null;
|
|
888
|
-
|
|
889
|
-
} else if (
|
|
890
|
-
if (
|
|
888
|
+
A = !0, T = H;
|
|
889
|
+
} else if (H === "(") {
|
|
890
|
+
if (N || x)
|
|
891
891
|
return null;
|
|
892
|
-
|
|
893
|
-
} else if (
|
|
894
|
-
if (
|
|
892
|
+
N = !0, g = -1;
|
|
893
|
+
} else if (H === "%") {
|
|
894
|
+
if (k)
|
|
895
895
|
return null;
|
|
896
|
-
|
|
896
|
+
k = !0;
|
|
897
897
|
}
|
|
898
898
|
}
|
|
899
899
|
for (let U = 0; U < y.length; U++) {
|
|
900
|
-
const
|
|
901
|
-
if (
|
|
902
|
-
if (
|
|
900
|
+
const H = y[U];
|
|
901
|
+
if (De.test(H)) {
|
|
902
|
+
if (A)
|
|
903
903
|
return null;
|
|
904
|
-
|
|
905
|
-
} else if (
|
|
906
|
-
if (S || !
|
|
904
|
+
A = !0, T = H, C = !0;
|
|
905
|
+
} else if (H === ")") {
|
|
906
|
+
if (S || !N)
|
|
907
907
|
return null;
|
|
908
908
|
S = !0;
|
|
909
|
-
} else if (
|
|
910
|
-
if (
|
|
909
|
+
} else if (H === "%") {
|
|
910
|
+
if (k)
|
|
911
911
|
return null;
|
|
912
|
-
|
|
912
|
+
k = !0;
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
915
|
if (M) {
|
|
916
|
-
if (
|
|
916
|
+
if (k || A)
|
|
917
917
|
return null;
|
|
918
918
|
c = "0.00E+00";
|
|
919
|
-
} else if (
|
|
920
|
-
if (
|
|
919
|
+
} else if (k) {
|
|
920
|
+
if (A)
|
|
921
921
|
return null;
|
|
922
|
-
c = _.includes(".") ? "0.00%" : "0%",
|
|
923
|
-
} else if (
|
|
922
|
+
c = _.includes(".") ? "0.00%" : "0%", P *= 0.01;
|
|
923
|
+
} else if (A) {
|
|
924
924
|
const U = _.includes(".") ? "#,##0.00" : "#,##0";
|
|
925
925
|
c = C ? U + T : T + U;
|
|
926
926
|
} else
|
|
927
927
|
_.includes(",") && (c = _.includes(".") ? "#,##0.00" : "#,##0");
|
|
928
|
-
const F = { v:
|
|
928
|
+
const F = { v: P * g };
|
|
929
929
|
return c && (F.z = c), F;
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
|
-
const
|
|
933
|
-
const
|
|
932
|
+
const he = (i, s, o) => {
|
|
933
|
+
const m = o.path || "", _ = Object.keys(s);
|
|
934
934
|
for (let M = 0; M < _.length; M++) {
|
|
935
935
|
let y;
|
|
936
936
|
const g = _[M];
|
|
937
|
-
if (
|
|
937
|
+
if (s[g]) {
|
|
938
938
|
if (g === "$" || g === "€")
|
|
939
|
-
|
|
939
|
+
i || (y = o);
|
|
940
940
|
else if (g === "-") {
|
|
941
|
-
const c = /^(\s*([./-]|,\s)\s*|\s+)/.exec(
|
|
941
|
+
const c = /^(\s*([./-]|,\s)\s*|\s+)/.exec(i);
|
|
942
942
|
if (c) {
|
|
943
943
|
const x = c[1] === "-" || c[1] === "/" || c[1] === "." ? c[1] : " ";
|
|
944
944
|
if (!o.sep || o.sep === x) {
|
|
945
|
-
const
|
|
946
|
-
y =
|
|
945
|
+
const N = c[0].replace(/\s+/g, " ");
|
|
946
|
+
y = he(i.slice(c[0].length), s[g], { ...o, sep: x, path: m + N });
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
949
|
} else if (g === " ") {
|
|
950
|
-
const c = /^[,.]?\s+/.exec(
|
|
950
|
+
const c = /^[,.]?\s+/.exec(i);
|
|
951
951
|
if (c) {
|
|
952
952
|
const x = c[0].replace(/\s+/g, " ");
|
|
953
|
-
y =
|
|
953
|
+
y = he(i.slice(c[0].length), s[g], { ...o, path: m + x });
|
|
954
954
|
}
|
|
955
955
|
} else if (g === "j" || g === "d") {
|
|
956
|
-
const c = /^(0?[1-9]|1\d|2\d|3[01])\b/.exec(
|
|
957
|
-
c && (y =
|
|
956
|
+
const c = /^(0?[1-9]|1\d|2\d|3[01])\b/.exec(i);
|
|
957
|
+
c && (y = he(i.slice(c[0].length), s[g], { ...o, day: c[0], path: m + g }));
|
|
958
958
|
} else if (g === "n" || g === "m") {
|
|
959
|
-
const c = /^(0?[1-9]|1[012])\b/.exec(
|
|
960
|
-
c && (y =
|
|
959
|
+
const c = /^(0?[1-9]|1[012])\b/.exec(i);
|
|
960
|
+
c && (y = he(i.slice(c[0].length), s[g], { ...o, month: +c[0], _mon: c[0], path: m + g }));
|
|
961
961
|
} else if (g === "F" || g === "M") {
|
|
962
|
-
const c = /^([a-z]{3,9})\b/i.exec(
|
|
963
|
-
x && (y =
|
|
962
|
+
const c = /^([a-z]{3,9})\b/i.exec(i), x = c && (g === "F" ? Zn : qn)[c[0].toLowerCase()];
|
|
963
|
+
x && (y = he(i.slice(c[0].length), s[g], { ...o, month: x, _mon: c[0], path: m + g }));
|
|
964
964
|
} else if (g === "l" || g === "D") {
|
|
965
|
-
const c = /^([a-z]{3,9})\b/i.exec(
|
|
966
|
-
(c &&
|
|
965
|
+
const c = /^([a-z]{3,9})\b/i.exec(i);
|
|
966
|
+
(c && Qn[c[0].toLowerCase()]) === g && (y = he(i.slice(c[0].length), s[g], { ...o, path: m + g }));
|
|
967
967
|
} else if (g === "y") {
|
|
968
|
-
const c = /^\d\d\b/.exec(
|
|
968
|
+
const c = /^\d\d\b/.exec(i);
|
|
969
969
|
if (c) {
|
|
970
970
|
const x = +c[0] >= 30 ? +c[0] + 1900 : +c[0] + 2e3;
|
|
971
|
-
y =
|
|
971
|
+
y = he(i.slice(c[0].length), s[g], { ...o, year: x, path: m + g });
|
|
972
972
|
}
|
|
973
973
|
} else if (g === "Y") {
|
|
974
|
-
const c = /^\d\d\d\d\b/.exec(
|
|
975
|
-
c && (y =
|
|
974
|
+
const c = /^\d\d\d\d\b/.exec(i);
|
|
975
|
+
c && (y = he(i.slice(c[0].length), s[g], { ...o, year: +c[0], path: m + g }));
|
|
976
976
|
} else {
|
|
977
977
|
if (g !== "x")
|
|
978
978
|
throw new Error('Unknown date token "'.concat(g, '"'));
|
|
979
979
|
{
|
|
980
|
-
const c =
|
|
981
|
-
c && (y =
|
|
980
|
+
const c = kt(i);
|
|
981
|
+
c && (y = he("", s[g], { ...o, time: c.v, tf: c.z, path: m + g }));
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
984
|
if (y)
|
|
@@ -986,13 +986,13 @@ var Sn = { exports: {} };
|
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
};
|
|
989
|
-
function
|
|
990
|
-
const o =
|
|
989
|
+
function un(i, s) {
|
|
990
|
+
const o = he(i.trim(), ce, { path: "" });
|
|
991
991
|
if (o) {
|
|
992
|
-
var
|
|
992
|
+
var m;
|
|
993
993
|
if (o.sep === "." && o.path.length === 3)
|
|
994
994
|
return null;
|
|
995
|
-
const _ = +((
|
|
995
|
+
const _ = +((m = o.year) !== null && m !== void 0 ? m : Xn);
|
|
996
996
|
if (o.day || (o.day = 1), !function(g, c, x) {
|
|
997
997
|
if (x < 1 || c < 1 || c > 12)
|
|
998
998
|
return !1;
|
|
@@ -1011,16 +1011,16 @@ var Sn = { exports: {} };
|
|
|
1011
1011
|
const y = Date.UTC(_, o.month - 1, o.day) / 864e5 + M + (o.time || 0);
|
|
1012
1012
|
if (y >= 0 && y <= 2958465) {
|
|
1013
1013
|
const g = o._mon[0] === "0" || o.day[0] === "0" || o._mon.length === 2 && o.day.length === 2, c = o.path.replace(/[jdlDnmMFyYx-]/g, (x) => x === "j" || x === "d" ? g ? "dd" : "d" : x === "D" ? "ddd" : x === "l" ? "dddd" : x === "n" || x === "m" ? g ? "mm" : "m" : x === "M" ? "mmm" : x === "F" ? "mmmm" : x === "y" ? "yy" : x === "x" ? o.tf || "" : x === "Y" ? "yyyy" : x);
|
|
1014
|
-
return
|
|
1014
|
+
return s && s.nativeDate ? { v: en(y, s), z: c } : { v: y, z: c };
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
1017
|
return null;
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1020
|
-
const
|
|
1021
|
-
if (
|
|
1022
|
-
const [, o,
|
|
1023
|
-
if (M && !_ || !y && !
|
|
1019
|
+
function kt(i) {
|
|
1020
|
+
const s = /^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(i);
|
|
1021
|
+
if (s) {
|
|
1022
|
+
const [, o, m, _, M, y] = s;
|
|
1023
|
+
if (M && !_ || !y && !m && !_)
|
|
1024
1024
|
return null;
|
|
1025
1025
|
let g = 1 * (o || 0);
|
|
1026
1026
|
if (y) {
|
|
@@ -1028,99 +1028,179 @@ var Sn = { exports: {} };
|
|
|
1028
1028
|
return null;
|
|
1029
1029
|
y[0] !== "p" && y[0] !== "P" || (g += 12);
|
|
1030
1030
|
}
|
|
1031
|
-
return { v: (60 * g * 60 + 60 * (1 * (
|
|
1031
|
+
return { v: (60 * g * 60 + 60 * (1 * (m || 0)) + 1 * (_ || 0) + 1 * (M || 0)) / 86400, z: (o.length === 2 ? "hh" : "h") + ":mm" + (_ ? ":ss" : "") + (y ? " AM/PM" : "") };
|
|
1032
1032
|
}
|
|
1033
1033
|
return null;
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return /^\s*true\s*$/i.test(
|
|
1035
|
+
function dn(i) {
|
|
1036
|
+
return /^\s*true\s*$/i.test(i) ? { v: !0 } : /^\s*false\s*$/i.test(i) ? { v: !1 } : null;
|
|
1037
1037
|
}
|
|
1038
1038
|
const Ge = {};
|
|
1039
|
-
function
|
|
1040
|
-
const { pattern: o, partitions:
|
|
1041
|
-
const x = Object.assign({},
|
|
1039
|
+
function er(i, s) {
|
|
1040
|
+
const { pattern: o, partitions: m, locale: _ } = i, M = (c) => {
|
|
1041
|
+
const x = Object.assign({}, B(), s, c);
|
|
1042
1042
|
return _ && (x.locale = _), x;
|
|
1043
1043
|
}, y = (c, x) => {
|
|
1044
|
-
const
|
|
1045
|
-
return function(S,
|
|
1046
|
-
const T = h(
|
|
1044
|
+
const N = M(x);
|
|
1045
|
+
return function(S, k, A) {
|
|
1046
|
+
const T = h(A.locale), C = k[3] ? k[3] : on;
|
|
1047
1047
|
if (typeof S == "boolean" && (S = S ? "TRUE" : "FALSE"), S == null)
|
|
1048
1048
|
return "";
|
|
1049
1049
|
if (typeof S != "number")
|
|
1050
|
-
return
|
|
1050
|
+
return sn(S, C, A, T);
|
|
1051
1051
|
if (!isFinite(S)) {
|
|
1052
1052
|
const F = T || I;
|
|
1053
1053
|
return isNaN(S) ? F.nan : (S < 0 ? F.negative : "") + F.infinity;
|
|
1054
1054
|
}
|
|
1055
|
-
const
|
|
1056
|
-
return
|
|
1057
|
-
}(
|
|
1055
|
+
const P = an(S, k);
|
|
1056
|
+
return P ? sn(S, P, A, T) : A.overflow;
|
|
1057
|
+
}(at(c, N), m, N);
|
|
1058
1058
|
};
|
|
1059
|
-
y.color = (c, x) => function(
|
|
1060
|
-
if (typeof
|
|
1061
|
-
return (S[3] ? S[3].color :
|
|
1062
|
-
const
|
|
1063
|
-
return
|
|
1064
|
-
}(
|
|
1059
|
+
y.color = (c, x) => function(N, S) {
|
|
1060
|
+
if (typeof N != "number" || !isFinite(N))
|
|
1061
|
+
return (S[3] ? S[3].color : on.color) || cn;
|
|
1062
|
+
const k = an(N, S);
|
|
1063
|
+
return k && k.color || cn;
|
|
1064
|
+
}(at(c, M(x)), m);
|
|
1065
1065
|
const g = function(c) {
|
|
1066
1066
|
var x;
|
|
1067
|
-
let
|
|
1068
|
-
const [S,
|
|
1069
|
-
let
|
|
1070
|
-
if (
|
|
1071
|
-
|
|
1067
|
+
let N = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
|
|
1068
|
+
const [S, k] = c, A = S.frac_max, T = { type: "general", isDate: Vn(c), isText: Jn(c), isPercent: Hn(c), maxDecimals: S.general ? 9 : A, scale: (x = S.scale) !== null && x !== void 0 ? x : 1, color: 0, parentheses: 0, grouped: S.grouping ? 1 : 0, _partitions: c }, C = !T.isDate && !T.isText && !S.error && S.tokens.some((Y) => Y.type === "string" && (N ? Y.value === N : De.test(Y.value)));
|
|
1069
|
+
let P = "G", F = A >= 0 ? Math.min(15, A) : "", U = "", H = "";
|
|
1070
|
+
if (k && k.color && (H = "-", T.color = 1), S.parens && (U = "()", T.parentheses = 1), C)
|
|
1071
|
+
P = "C", T.type = "currency";
|
|
1072
1072
|
else if (S.error)
|
|
1073
1073
|
T.type = "error", T.maxDecimals = 0;
|
|
1074
1074
|
else if (T.isDate) {
|
|
1075
|
-
let
|
|
1075
|
+
let Y = 0, Z = 0, be = "";
|
|
1076
1076
|
S.tokens.forEach((w) => {
|
|
1077
|
-
const
|
|
1078
|
-
/^(b-)?year/.test(
|
|
1079
|
-
}), T.type = "date",
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1077
|
+
const re = w.type;
|
|
1078
|
+
/^(b-)?year/.test(re) ? (be += "Y", Z++) : re.startsWith("month") ? (be += "M", Z++) : /^(week)?day/.test(re) ? (be += "D", Z++) : re !== "hour" && re !== "min" && re !== "sec" && re !== "am" || (be += re[0], Y++);
|
|
1079
|
+
}), T.type = "date", Z && Y ? T.type = "datetime" : !Z && Y && (T.type = "time");
|
|
1080
|
+
const Ee = Gn.find((w) => be.startsWith(w[0]));
|
|
1081
|
+
P = Ee ? "D" : "G", F = Ee ? Ee[1] : "";
|
|
1082
1082
|
} else
|
|
1083
|
-
T.isText ? (
|
|
1084
|
-
return T.code =
|
|
1085
|
-
}(
|
|
1083
|
+
T.isText ? (P = "G", T.type = "text", F = "", T.maxDecimals = 0) : S.general ? (P = "G", T.type = "general", F = "") : S.fractions ? (P = "G", T.type = "fraction", F = "") : S.exponential ? (P = "S", T.type = "scientific") : T.isPercent ? (P = "P", T.type = "percent") : S.grouping ? (P = ",", T.type = "grouped") : (S.int_max || A) && (P = "F", T.type = "number");
|
|
1084
|
+
return T.code = P + F + H + U, T.level = Wn[T.type], Object.freeze(T);
|
|
1085
|
+
}(m, (s || {}).currency) || new SyntaxError();
|
|
1086
1086
|
return y.info = g, y.dateInfo = function(c) {
|
|
1087
1087
|
const [x] = c;
|
|
1088
1088
|
return { year: !!(2 & x.date), month: !!(4 & x.date), day: !!(8 & x.date), hours: !!(16 & x.date), minutes: !!(32 & x.date), seconds: !!(64 & x.date), clockType: x.clock === 12 ? 12 : 24 };
|
|
1089
|
-
}(
|
|
1089
|
+
}(m), y.isPercent = () => !!g.isPercent, y.isDate = () => !!g.isDate, y.isText = () => !!g.isText, y.pattern = o, i.error && (y.error = i.error), y.options = M, y.locale = _ || s && s.locale || "", Object.freeze(y);
|
|
1090
1090
|
}
|
|
1091
|
-
function J(
|
|
1092
|
-
|
|
1091
|
+
function J(i, s) {
|
|
1092
|
+
i || (i = "General");
|
|
1093
1093
|
let o = null;
|
|
1094
|
-
return Ge[
|
|
1094
|
+
return Ge[i] ? o = Ge[i] : (o = Object.assign({}, B(), s).throws ? Zt(i) : function(m) {
|
|
1095
1095
|
try {
|
|
1096
|
-
return
|
|
1096
|
+
return Zt(m);
|
|
1097
1097
|
} catch (_) {
|
|
1098
1098
|
const M = { tokens: [{ type: "error" }], error: _.message };
|
|
1099
|
-
return { pattern:
|
|
1099
|
+
return { pattern: m, partitions: [M, M, M, M], error: _.message, locale: null };
|
|
1100
1100
|
}
|
|
1101
|
-
}(
|
|
1101
|
+
}(i), o.error || (Ge[i] = o)), er(o, s);
|
|
1102
1102
|
}
|
|
1103
|
-
J.isDate = (
|
|
1104
|
-
const o =
|
|
1105
|
-
return delete Ge[o.lang], delete Ge[o.language], b(
|
|
1106
|
-
}, J.format = function(
|
|
1107
|
-
let
|
|
1108
|
-
const _ = o && typeof o == "object" ? o : { locale: o, throws: !
|
|
1109
|
-
return J(
|
|
1110
|
-
}, J.is_date = J.isDate, J.parseNumber =
|
|
1111
|
-
var o,
|
|
1112
|
-
return (o = (
|
|
1103
|
+
J.isDate = (i) => J(i, { throws: !1 }).isDate(), J.isPercent = (i) => J(i, { throws: !1 }).isPercent(), J.isText = (i) => J(i, { throws: !1 }).isText(), J.getInfo = (i, s) => J(i, { ...s, throws: !1 }).info, J.getDateInfo = (i, s) => J(i, { ...s, throws: !1 }).dateInfo, J.dateToSerial = at, J.dateFromSerial = en, J.options = B, J.dec2frac = E, J.round = D, J.codeToLocale = a, J.parseLocale = p, J.getLocale = h, J.addLocale = (i, s) => {
|
|
1104
|
+
const o = p(s);
|
|
1105
|
+
return delete Ge[o.lang], delete Ge[o.language], b(i, o);
|
|
1106
|
+
}, J.format = function(i, s, o) {
|
|
1107
|
+
let m = arguments.length > 3 && arguments[3] !== void 0 && arguments[3];
|
|
1108
|
+
const _ = o && typeof o == "object" ? o : { locale: o, throws: !m };
|
|
1109
|
+
return J(i, _)(at(s, _), _);
|
|
1110
|
+
}, J.is_date = J.isDate, J.parseNumber = ln, J.parseDate = un, J.parseTime = kt, J.parseBool = dn, J.parseValue = function(i, s) {
|
|
1111
|
+
var o, m, _;
|
|
1112
|
+
return (o = (m = (_ = ln(i)) !== null && _ !== void 0 ? _ : un(i, s)) !== null && m !== void 0 ? m : kt(i)) !== null && o !== void 0 ? o : dn(i);
|
|
1113
1113
|
};
|
|
1114
|
-
var
|
|
1114
|
+
var tr = J;
|
|
1115
1115
|
return n = n.default;
|
|
1116
1116
|
}();
|
|
1117
1117
|
});
|
|
1118
|
-
})(
|
|
1119
|
-
var
|
|
1120
|
-
const
|
|
1118
|
+
})(Rn);
|
|
1119
|
+
var Zr = Rn.exports, Qr = Zr;
|
|
1120
|
+
const ge = /* @__PURE__ */ qr(Qr), Gt = (e) => ge.getInfo(e).type || "unknown", wn = (e, t) => {
|
|
1121
|
+
const n = ge.getInfo(e)._partitions[1], a = ge.format(e, t, { locale: "zh-CN" });
|
|
1122
|
+
return t < 0 ? {
|
|
1123
|
+
result: a,
|
|
1124
|
+
color: n.color
|
|
1125
|
+
} : {
|
|
1126
|
+
result: a
|
|
1127
|
+
};
|
|
1128
|
+
};
|
|
1129
|
+
var Xr = Object.defineProperty, es = Object.getOwnPropertyDescriptor, ts = (e, t, r, n) => {
|
|
1130
|
+
for (var a = n > 1 ? void 0 : n ? es(t, r) : t, l = e.length - 1, u; l >= 0; l--)
|
|
1131
|
+
(u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
|
|
1132
|
+
return n && a && Xr(t, r, a), a;
|
|
1133
|
+
}, Ke = (e, t) => (r, n) => t(r, n, e);
|
|
1134
|
+
let dt = class extends Me {
|
|
1135
|
+
constructor(e, t, r, n, a) {
|
|
1136
|
+
super(), this._sheetInterceptorService = e, this._themeService = t, this._sheetSkeletonManagerService = r, this._commandService = n, this._numfmtService = a, this._initInterceptorCellContent();
|
|
1137
|
+
}
|
|
1138
|
+
_initInterceptorCellContent() {
|
|
1139
|
+
const e = new yn();
|
|
1140
|
+
this.disposeWithMe(
|
|
1141
|
+
this._sheetInterceptorService.intercept(Cn.CELL_CONTENT, {
|
|
1142
|
+
handler: (t, r, n) => {
|
|
1143
|
+
const a = r.unitId, l = r.subUnitId, u = this._numfmtService.getValue(a, l, r.row, r.col);
|
|
1144
|
+
if (!u)
|
|
1145
|
+
return n(t);
|
|
1146
|
+
const d = t;
|
|
1147
|
+
if (!d || d.t !== Ue.NUMBER)
|
|
1148
|
+
return n(t);
|
|
1149
|
+
let p = "";
|
|
1150
|
+
const v = e.getValue(r.row, r.col);
|
|
1151
|
+
if (v && v.parameters === d.v)
|
|
1152
|
+
return { ...t, ...v.result };
|
|
1153
|
+
const h = wn(u.pattern, Number(d.v));
|
|
1154
|
+
if (p = h.result, !p)
|
|
1155
|
+
return n(t);
|
|
1156
|
+
const f = { v: p };
|
|
1157
|
+
if (h.color) {
|
|
1158
|
+
const b = this._themeService.getCurrentTheme()[`${h.color}500`];
|
|
1159
|
+
b && (f.interceptorStyle = { cl: { rgb: b } });
|
|
1160
|
+
}
|
|
1161
|
+
return e.setValue(r.row, r.col, {
|
|
1162
|
+
result: f,
|
|
1163
|
+
parameters: d.v
|
|
1164
|
+
}), { ...t, ...f };
|
|
1165
|
+
}
|
|
1166
|
+
})
|
|
1167
|
+
), this.disposeWithMe(
|
|
1168
|
+
this._commandService.onCommandExecuted((t) => {
|
|
1169
|
+
if (t.id === oe.id) {
|
|
1170
|
+
const r = t.params;
|
|
1171
|
+
Object.keys(r.values).forEach((n) => {
|
|
1172
|
+
r.values[n].ranges.forEach((l) => {
|
|
1173
|
+
ne.foreach(l, (u, d) => {
|
|
1174
|
+
e.realDeleteValue(u, d);
|
|
1175
|
+
});
|
|
1176
|
+
});
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
})
|
|
1180
|
+
), this.disposeWithMe(
|
|
1181
|
+
Te(
|
|
1182
|
+
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
1183
|
+
Ze((t) => t == null ? void 0 : t.sheetId),
|
|
1184
|
+
Mn()
|
|
1185
|
+
).subscribe(() => {
|
|
1186
|
+
e.reset();
|
|
1187
|
+
})
|
|
1188
|
+
)
|
|
1189
|
+
);
|
|
1190
|
+
}
|
|
1191
|
+
};
|
|
1192
|
+
dt = ts([
|
|
1193
|
+
je(_e.Rendered, dt),
|
|
1194
|
+
Ke(0, $(xt)),
|
|
1195
|
+
Ke(1, $(bn)),
|
|
1196
|
+
Ke(2, $(Lt)),
|
|
1197
|
+
Ke(3, $(Ce)),
|
|
1198
|
+
Ke(4, $(ye))
|
|
1199
|
+
], dt);
|
|
1200
|
+
const Re = (e, t = 0) => e ? ge.getInfo(e).maxDecimals ?? t : t, Ve = (e, t) => {
|
|
1121
1201
|
if (e && !t || !e && t)
|
|
1122
1202
|
return !1;
|
|
1123
|
-
const
|
|
1203
|
+
const r = (v) => v.reduce(
|
|
1124
1204
|
(h, f) => {
|
|
1125
1205
|
if (h.isEnd)
|
|
1126
1206
|
return h;
|
|
@@ -1128,54 +1208,54 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
|
|
|
1128
1208
|
return f.type === "point" ? (h.isEnd = !0, h) : { ...h, result: h.result + b };
|
|
1129
1209
|
},
|
|
1130
1210
|
{ isEnd: !1, result: "" }
|
|
1131
|
-
).result, n =
|
|
1132
|
-
return l === u && d ===
|
|
1133
|
-
},
|
|
1211
|
+
).result, n = ge.getInfo(e)._partitions, a = ge.getInfo(t)._partitions, l = r(n[0].tokens), u = r(a[0].tokens), d = r(n[1].tokens), p = r(a[1].tokens);
|
|
1212
|
+
return l === u && d === p && n[1].color === a[1].color;
|
|
1213
|
+
}, gn = (e) => new Array(Math.min(Math.max(0, Number(e)), 30)).fill(0).join(""), ee = (e, t) => e.split(";").map((n) => /\.0?/.test(n) ? n.replace(
|
|
1134
1214
|
/\.0*/g,
|
|
1135
|
-
`${t > 0 ? "." : ""}${
|
|
1215
|
+
`${t > 0 ? "." : ""}${gn(Number(t || 0))}`
|
|
1136
1216
|
) : /0([^0]?)|0$/.test(n) ? n.replace(
|
|
1137
1217
|
/0([^0]+)|0$/,
|
|
1138
|
-
`0${t > 0 ? "." : ""}${
|
|
1139
|
-
) : n).join(";"),
|
|
1218
|
+
`0${t > 0 ? "." : ""}${gn(Number(t || 0))}$1`
|
|
1219
|
+
) : n).join(";"), ns = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), Pn = {
|
|
1140
1220
|
id: "sheet.command.numfmt.add.decimal.command",
|
|
1141
|
-
type:
|
|
1221
|
+
type: Ye.COMMAND,
|
|
1142
1222
|
handler: async (e) => {
|
|
1143
|
-
const t = e.get(
|
|
1223
|
+
const t = e.get(Ce), r = e.get(Be), n = e.get(ye), a = e.get(ve), l = r.getSelections();
|
|
1144
1224
|
if (!l || !l.length)
|
|
1145
1225
|
return !1;
|
|
1146
|
-
const u =
|
|
1226
|
+
const u = a.getCurrentUniverSheetInstance(), d = u.getActiveSheet(), p = u.getUnitId(), v = d.getSheetId();
|
|
1147
1227
|
let h = 0;
|
|
1148
1228
|
l.forEach((D) => {
|
|
1149
|
-
ne.foreach(D.range, (
|
|
1150
|
-
const
|
|
1151
|
-
if (!
|
|
1229
|
+
ne.foreach(D.range, (E, R) => {
|
|
1230
|
+
const z = n.getValue(p, v, E, R);
|
|
1231
|
+
if (!z)
|
|
1152
1232
|
return;
|
|
1153
|
-
const
|
|
1154
|
-
h =
|
|
1233
|
+
const B = Re(z.pattern);
|
|
1234
|
+
h = B > h ? B : h;
|
|
1155
1235
|
});
|
|
1156
1236
|
});
|
|
1157
|
-
const f = h + 1, b =
|
|
1237
|
+
const f = h + 1, b = ee(`0${f > 0 ? ".0" : ""}`, f), I = [];
|
|
1158
1238
|
return l.forEach((D) => {
|
|
1159
|
-
ne.foreach(D.range, (
|
|
1160
|
-
const
|
|
1161
|
-
if (!
|
|
1239
|
+
ne.foreach(D.range, (E, R) => {
|
|
1240
|
+
const z = n.getValue(p, v, E, R);
|
|
1241
|
+
if (!z || Ve(z.pattern, "0.0"))
|
|
1162
1242
|
I.push({
|
|
1163
|
-
row:
|
|
1243
|
+
row: E,
|
|
1164
1244
|
col: R,
|
|
1165
1245
|
pattern: b
|
|
1166
1246
|
});
|
|
1167
1247
|
else {
|
|
1168
|
-
const
|
|
1169
|
-
W !==
|
|
1170
|
-
row:
|
|
1248
|
+
const B = Re(z.pattern), W = ee(z.pattern, B + 1);
|
|
1249
|
+
W !== z.pattern && I.push({
|
|
1250
|
+
row: E,
|
|
1171
1251
|
col: R,
|
|
1172
1252
|
pattern: W
|
|
1173
1253
|
});
|
|
1174
1254
|
}
|
|
1175
1255
|
});
|
|
1176
|
-
}), I.length ? await t.executeCommand(
|
|
1256
|
+
}), I.length ? await t.executeCommand(Le.id, { values: I }) : !1;
|
|
1177
1257
|
}
|
|
1178
|
-
},
|
|
1258
|
+
}, rs = [
|
|
1179
1259
|
{
|
|
1180
1260
|
label: "1930-08-05",
|
|
1181
1261
|
suffix: "yyyy-MM-dd"
|
|
@@ -1220,7 +1300,7 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
|
|
|
1220
1300
|
label: "08-05 下午 01:30",
|
|
1221
1301
|
suffix: "MM-dd A/P hh:mm"
|
|
1222
1302
|
}
|
|
1223
|
-
],
|
|
1303
|
+
], ss = [
|
|
1224
1304
|
{
|
|
1225
1305
|
label: "(1,235)",
|
|
1226
1306
|
suffix: "#,##0_);(#,##0)"
|
|
@@ -1248,7 +1328,7 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
|
|
|
1248
1328
|
suffix: "#,##0.00_);[Red]-#,##0.00",
|
|
1249
1329
|
color: "red"
|
|
1250
1330
|
}
|
|
1251
|
-
],
|
|
1331
|
+
], Dn = [
|
|
1252
1332
|
{
|
|
1253
1333
|
label: (e) => `${e}1,235`,
|
|
1254
1334
|
suffix: (e) => `"${e}"#,##0.00_);"${e}"#,##0.00`
|
|
@@ -1276,74 +1356,74 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
|
|
|
1276
1356
|
suffix: (e) => `"${e}"#,##0.00_);[Red]-"${e}"#,##0.00`,
|
|
1277
1357
|
color: "red"
|
|
1278
1358
|
}
|
|
1279
|
-
],
|
|
1359
|
+
], On = {
|
|
1280
1360
|
id: "sheet.command.numfmt.set.currency",
|
|
1281
|
-
type:
|
|
1361
|
+
type: Ye.COMMAND,
|
|
1282
1362
|
handler: async (e) => {
|
|
1283
|
-
const t = e.get(
|
|
1363
|
+
const t = e.get(Ce), n = e.get(Be).getSelections();
|
|
1284
1364
|
if (!n || !n.length)
|
|
1285
1365
|
return !1;
|
|
1286
|
-
const
|
|
1366
|
+
const a = [], l = Dn[0].suffix("¥");
|
|
1287
1367
|
return n.forEach((d) => {
|
|
1288
|
-
ne.foreach(d.range, (
|
|
1289
|
-
|
|
1368
|
+
ne.foreach(d.range, (p, v) => {
|
|
1369
|
+
a.push({ row: p, col: v, pattern: l, type: "currency" });
|
|
1290
1370
|
});
|
|
1291
|
-
}), await t.executeCommand(
|
|
1371
|
+
}), await t.executeCommand(Le.id, { values: a });
|
|
1292
1372
|
}
|
|
1293
|
-
},
|
|
1373
|
+
}, En = {
|
|
1294
1374
|
id: "sheet.command.numfmt.subtract.decimal.command",
|
|
1295
|
-
type:
|
|
1375
|
+
type: Ye.COMMAND,
|
|
1296
1376
|
handler: async (e) => {
|
|
1297
|
-
const t = e.get(
|
|
1377
|
+
const t = e.get(Ce), r = e.get(Be), n = e.get(ye), a = e.get(ve), l = r.getSelections();
|
|
1298
1378
|
if (!l || !l.length)
|
|
1299
1379
|
return !1;
|
|
1300
|
-
const u =
|
|
1380
|
+
const u = a.getCurrentUniverSheetInstance(), d = u.getActiveSheet(), p = u.getUnitId(), v = d.getSheetId();
|
|
1301
1381
|
let h = 0;
|
|
1302
|
-
l.forEach((
|
|
1303
|
-
ne.foreach(
|
|
1304
|
-
const
|
|
1305
|
-
if (!
|
|
1382
|
+
l.forEach((E) => {
|
|
1383
|
+
ne.foreach(E.range, (R, z) => {
|
|
1384
|
+
const B = n.getValue(p, v, R, z);
|
|
1385
|
+
if (!B)
|
|
1306
1386
|
return;
|
|
1307
|
-
const W =
|
|
1387
|
+
const W = Re(B.pattern);
|
|
1308
1388
|
h = W > h ? W : h;
|
|
1309
1389
|
});
|
|
1310
1390
|
});
|
|
1311
|
-
const f = h - 1, b =
|
|
1312
|
-
return l.forEach((
|
|
1313
|
-
ne.foreach(
|
|
1314
|
-
const
|
|
1315
|
-
if (!
|
|
1391
|
+
const f = h - 1, b = ee(`0${f > 0 ? ".0" : "."}`, f), I = [];
|
|
1392
|
+
return l.forEach((E) => {
|
|
1393
|
+
ne.foreach(E.range, (R, z) => {
|
|
1394
|
+
const B = n.getValue(p, v, R, z);
|
|
1395
|
+
if (!B || Ve(B.pattern, "0.0"))
|
|
1316
1396
|
I.push({
|
|
1317
1397
|
row: R,
|
|
1318
|
-
col:
|
|
1398
|
+
col: z,
|
|
1319
1399
|
pattern: b
|
|
1320
1400
|
});
|
|
1321
1401
|
else {
|
|
1322
|
-
const W =
|
|
1402
|
+
const W = Re(B.pattern);
|
|
1323
1403
|
I.push({
|
|
1324
1404
|
row: R,
|
|
1325
|
-
col:
|
|
1326
|
-
pattern:
|
|
1405
|
+
col: z,
|
|
1406
|
+
pattern: ee(B.pattern, W - 1)
|
|
1327
1407
|
});
|
|
1328
1408
|
}
|
|
1329
1409
|
});
|
|
1330
|
-
}), await t.executeCommand(
|
|
1410
|
+
}), await t.executeCommand(Le.id, { values: I });
|
|
1331
1411
|
}
|
|
1332
|
-
},
|
|
1412
|
+
}, Ft = {
|
|
1333
1413
|
id: "sheet.operation.close.numfmt.panel",
|
|
1334
|
-
type:
|
|
1414
|
+
type: Ye.OPERATION,
|
|
1335
1415
|
handler: () => (
|
|
1336
1416
|
// do nothing,just notify panel is closed
|
|
1337
1417
|
!0
|
|
1338
1418
|
)
|
|
1339
|
-
},
|
|
1340
|
-
|
|
1341
|
-
const
|
|
1419
|
+
}, Kt = wr("INumfmtController");
|
|
1420
|
+
or(_e.Rendered, Kt);
|
|
1421
|
+
const Ct = {
|
|
1342
1422
|
id: "sheet.operation.open.numfmt.panel",
|
|
1343
|
-
type:
|
|
1344
|
-
handler: (e) => (e.get(
|
|
1423
|
+
type: Ye.OPERATION,
|
|
1424
|
+
handler: (e) => (e.get(Kt).openPanel(), !0)
|
|
1345
1425
|
};
|
|
1346
|
-
var
|
|
1426
|
+
var Nn = { exports: {} }, Ot = {};
|
|
1347
1427
|
/**
|
|
1348
1428
|
* @license React
|
|
1349
1429
|
* react-jsx-runtime.production.min.js
|
|
@@ -1353,23 +1433,23 @@ var In = { exports: {} }, xt = {};
|
|
|
1353
1433
|
* This source code is licensed under the MIT license found in the
|
|
1354
1434
|
* LICENSE file in the root directory of this source tree.
|
|
1355
1435
|
*/
|
|
1356
|
-
var
|
|
1357
|
-
function
|
|
1358
|
-
var n,
|
|
1359
|
-
|
|
1436
|
+
var as = Yr, is = Symbol.for("react.element"), os = Symbol.for("react.fragment"), cs = Object.prototype.hasOwnProperty, ls = as.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, us = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
1437
|
+
function kn(e, t, r) {
|
|
1438
|
+
var n, a = {}, l = null, u = null;
|
|
1439
|
+
r !== void 0 && (l = "" + r), t.key !== void 0 && (l = "" + t.key), t.ref !== void 0 && (u = t.ref);
|
|
1360
1440
|
for (n in t)
|
|
1361
|
-
|
|
1441
|
+
cs.call(t, n) && !us.hasOwnProperty(n) && (a[n] = t[n]);
|
|
1362
1442
|
if (e && e.defaultProps)
|
|
1363
1443
|
for (n in t = e.defaultProps, t)
|
|
1364
|
-
|
|
1365
|
-
return { $$typeof:
|
|
1444
|
+
a[n] === void 0 && (a[n] = t[n]);
|
|
1445
|
+
return { $$typeof: is, type: e, key: l, ref: u, props: a, _owner: ls.current };
|
|
1366
1446
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
var O =
|
|
1372
|
-
const
|
|
1447
|
+
Ot.Fragment = os;
|
|
1448
|
+
Ot.jsx = kn;
|
|
1449
|
+
Ot.jsxs = kn;
|
|
1450
|
+
Nn.exports = Ot;
|
|
1451
|
+
var O = Nn.exports;
|
|
1452
|
+
const qt = Br([]), Ut = [
|
|
1373
1453
|
"$",
|
|
1374
1454
|
"£",
|
|
1375
1455
|
"¥",
|
|
@@ -1398,12 +1478,12 @@ const Vt = Ar([]), Nt = [
|
|
|
1398
1478
|
"₾",
|
|
1399
1479
|
"₿"
|
|
1400
1480
|
];
|
|
1401
|
-
var
|
|
1402
|
-
for (var
|
|
1403
|
-
(u = e[l]) && (
|
|
1404
|
-
return n &&
|
|
1405
|
-
},
|
|
1406
|
-
let
|
|
1481
|
+
var ds = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, ps = (e, t, r, n) => {
|
|
1482
|
+
for (var a = n > 1 ? void 0 : n ? ms(t, r) : t, l = e.length - 1, u; l >= 0; l--)
|
|
1483
|
+
(u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
|
|
1484
|
+
return n && a && ds(t, r, a), a;
|
|
1485
|
+
}, fs = (e, t) => (r, n) => t(r, n, e);
|
|
1486
|
+
let Mt = class {
|
|
1407
1487
|
constructor(e) {
|
|
1408
1488
|
this._localStorageService = e;
|
|
1409
1489
|
}
|
|
@@ -1411,34 +1491,34 @@ let _t = class {
|
|
|
1411
1491
|
return `userHabitController_${e}`;
|
|
1412
1492
|
}
|
|
1413
1493
|
async addHabit(e, t) {
|
|
1414
|
-
const
|
|
1415
|
-
return this._localStorageService.getItem(
|
|
1416
|
-
n || this._localStorageService.setItem(
|
|
1494
|
+
const r = this._getKey(e);
|
|
1495
|
+
return this._localStorageService.getItem(r).then((n) => {
|
|
1496
|
+
n || this._localStorageService.setItem(r, t);
|
|
1417
1497
|
});
|
|
1418
1498
|
}
|
|
1419
1499
|
markHabit(e, t) {
|
|
1420
|
-
const
|
|
1421
|
-
this._localStorageService.getItem(
|
|
1500
|
+
const r = this._getKey(e);
|
|
1501
|
+
this._localStorageService.getItem(r).then((n) => {
|
|
1422
1502
|
if (n) {
|
|
1423
|
-
const
|
|
1424
|
-
|
|
1503
|
+
const a = n.findIndex((l) => l === t);
|
|
1504
|
+
a > -1 && n.splice(a, 1), n.unshift(t), this._localStorageService.setItem(r, n);
|
|
1425
1505
|
}
|
|
1426
1506
|
});
|
|
1427
1507
|
}
|
|
1428
1508
|
async getHabit(e, t) {
|
|
1429
|
-
const
|
|
1509
|
+
const r = this._getKey(e), n = await this._localStorageService.getItem(r);
|
|
1430
1510
|
if (t && n) {
|
|
1431
|
-
const
|
|
1432
|
-
const
|
|
1511
|
+
const a = n.map((l, u, d) => {
|
|
1512
|
+
const p = d.length;
|
|
1433
1513
|
return {
|
|
1434
1514
|
value: l,
|
|
1435
|
-
priority:
|
|
1515
|
+
priority: p - u
|
|
1436
1516
|
};
|
|
1437
1517
|
});
|
|
1438
1518
|
return t.sort((l, u) => {
|
|
1439
1519
|
var v, h;
|
|
1440
|
-
const d = ((v =
|
|
1441
|
-
return (((h =
|
|
1520
|
+
const d = ((v = a.find((f) => f.value === l)) == null ? void 0 : v.priority) || -1;
|
|
1521
|
+
return (((h = a.find((f) => f.value === u)) == null ? void 0 : h.priority) || -1) - d;
|
|
1442
1522
|
});
|
|
1443
1523
|
}
|
|
1444
1524
|
return n || [];
|
|
@@ -1447,131 +1527,125 @@ let _t = class {
|
|
|
1447
1527
|
this._localStorageService.removeItem(e);
|
|
1448
1528
|
}
|
|
1449
1529
|
};
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
],
|
|
1453
|
-
const
|
|
1454
|
-
const t = de(
|
|
1455
|
-
return
|
|
1530
|
+
Mt = ps([
|
|
1531
|
+
fs(0, $(cr))
|
|
1532
|
+
], Mt);
|
|
1533
|
+
const vn = "numfmtCurrency", hs = (e) => {
|
|
1534
|
+
const t = de(Mt), [r, n] = ie(Ut);
|
|
1535
|
+
return Bt(() => {
|
|
1456
1536
|
t.addHabit("numfmtCurrency", []).then(() => {
|
|
1457
|
-
t.getHabit(
|
|
1537
|
+
t.getHabit(vn, [...Ut]).then((l) => {
|
|
1458
1538
|
n(l), e && e(l);
|
|
1459
1539
|
});
|
|
1460
1540
|
});
|
|
1461
|
-
}, []), { userHabitCurrency:
|
|
1462
|
-
t.markHabit(
|
|
1541
|
+
}, []), { userHabitCurrency: r, mark: (l) => {
|
|
1542
|
+
t.markHabit(vn, l);
|
|
1463
1543
|
} };
|
|
1464
|
-
},
|
|
1465
|
-
const e =
|
|
1466
|
-
return
|
|
1467
|
-
e.current.forEach((
|
|
1468
|
-
|
|
1544
|
+
}, gs = () => {
|
|
1545
|
+
const e = Ht([]), [t, r] = ie({});
|
|
1546
|
+
return Bt(() => {
|
|
1547
|
+
e.current.forEach((a) => {
|
|
1548
|
+
a();
|
|
1469
1549
|
}), e.current = [];
|
|
1470
|
-
}, [t]), (
|
|
1471
|
-
e.current.push(
|
|
1550
|
+
}, [t]), (a) => {
|
|
1551
|
+
e.current.push(a), r({});
|
|
1472
1552
|
};
|
|
1473
|
-
},
|
|
1474
|
-
const [t,
|
|
1475
|
-
e.action.current = () =>
|
|
1553
|
+
}, nt = (e) => Ut.find((r) => e.includes(r)), vs = (e) => !!nt(e) && e.startsWith("_("), _s = (e) => {
|
|
1554
|
+
const [t, r] = ie(() => Re(e.defaultPattern || "", 2)), n = In(qt), [a, l] = ie(() => nt(e.defaultPattern) || n[0]), u = Se(() => n.map((f) => ({ label: f, value: f })), []), p = de(me).t;
|
|
1555
|
+
e.action.current = () => ee(`_("${a}"* #,##0${t > 0 ? ".0" : ""}_)`, t);
|
|
1476
1556
|
const v = (f) => {
|
|
1477
|
-
l(f), e.onChange(
|
|
1557
|
+
l(f), e.onChange(ee(`_("${f}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
|
|
1478
1558
|
}, h = (f) => {
|
|
1479
1559
|
const b = f || 0;
|
|
1480
|
-
|
|
1560
|
+
r(b), e.onChange(ee(`_("${a}"* #,##0${b > 0 ? ".0" : ""}_)`, b));
|
|
1481
1561
|
};
|
|
1482
1562
|
return /* @__PURE__ */ O.jsxs("div", { children: [
|
|
1483
1563
|
/* @__PURE__ */ O.jsxs("div", { className: "m-t-16 options ", children: [
|
|
1484
1564
|
/* @__PURE__ */ O.jsxs("div", { className: "option", children: [
|
|
1485
|
-
/* @__PURE__ */ O.jsx("div", { className: "label", children:
|
|
1486
|
-
/* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ O.jsx(
|
|
1565
|
+
/* @__PURE__ */ O.jsx("div", { className: "label", children: p("sheet.numfmt.decimalLength") }),
|
|
1566
|
+
/* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ O.jsx(Vt, { value: t, max: 20, min: 0, onChange: h }) })
|
|
1487
1567
|
] }),
|
|
1488
1568
|
/* @__PURE__ */ O.jsxs("div", { className: "option", children: [
|
|
1489
|
-
/* @__PURE__ */ O.jsx("div", { className: "label", children:
|
|
1490
|
-
/* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ O.jsx(
|
|
1569
|
+
/* @__PURE__ */ O.jsx("div", { className: "label", children: p("sheet.numfmt.currencyType") }),
|
|
1570
|
+
/* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ O.jsx(Jt, { onChange: v, options: u, value: a }) })
|
|
1491
1571
|
] })
|
|
1492
1572
|
] }),
|
|
1493
|
-
/* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children:
|
|
1573
|
+
/* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: p("sheet.numfmt.accountingDes") })
|
|
1494
1574
|
] });
|
|
1495
|
-
},
|
|
1575
|
+
}, $t = (e) => Dn.map((t) => ({
|
|
1496
1576
|
label: t.label(e),
|
|
1497
1577
|
value: t.suffix(e),
|
|
1498
1578
|
color: t.color
|
|
1499
|
-
})),
|
|
1500
|
-
const
|
|
1501
|
-
var
|
|
1502
|
-
const
|
|
1503
|
-
return ((
|
|
1504
|
-
}), h =
|
|
1505
|
-
e.action.current = () =>
|
|
1506
|
-
const b = (
|
|
1507
|
-
l(
|
|
1508
|
-
const R =
|
|
1509
|
-
v(R), e.onChange(
|
|
1510
|
-
}, I = (
|
|
1511
|
-
v(
|
|
1512
|
-
}, D = (
|
|
1513
|
-
d(
|
|
1579
|
+
})), Tn = () => rs.map((e) => ({ label: e.label, value: e.suffix })), Fn = () => ss.map((e) => ({ label: e.label, value: e.suffix, color: e.color })), ys = (e) => !!nt(e) && !e.startsWith("_("), bs = (e) => {
|
|
1580
|
+
const r = de(me).t, n = In(qt), [a, l] = ie(() => nt(e.defaultPattern) || n[0]), [u, d] = ie(() => Re(e.defaultPattern || "", 2)), [p, v] = ie(() => {
|
|
1581
|
+
var z;
|
|
1582
|
+
const E = $t(a);
|
|
1583
|
+
return ((z = E.find((B) => Ve(B.value, e.defaultPattern))) == null ? void 0 : z.value) || E[0].value;
|
|
1584
|
+
}), h = Se(() => $t(a), [a]), f = Se(() => n.map((E) => ({ label: E, value: E })), [n]);
|
|
1585
|
+
e.action.current = () => ee(p, u);
|
|
1586
|
+
const b = (E) => {
|
|
1587
|
+
l(E);
|
|
1588
|
+
const R = $t(E)[0].value;
|
|
1589
|
+
v(R), e.onChange(ee(R, u));
|
|
1590
|
+
}, I = (E) => {
|
|
1591
|
+
v(E), e.onChange(ee(E, u));
|
|
1592
|
+
}, D = (E) => {
|
|
1593
|
+
d(E || 0), e.onChange(ee(p, E || 0));
|
|
1514
1594
|
};
|
|
1515
1595
|
return /* @__PURE__ */ O.jsxs("div", { children: [
|
|
1516
1596
|
/* @__PURE__ */ O.jsxs("div", { className: "m-t-16 options ", children: [
|
|
1517
1597
|
/* @__PURE__ */ O.jsxs("div", { className: "option", children: [
|
|
1518
|
-
/* @__PURE__ */ O.jsx("div", { className: "label", children:
|
|
1519
|
-
/* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ O.jsx(
|
|
1598
|
+
/* @__PURE__ */ O.jsx("div", { className: "label", children: r("sheet.numfmt.decimalLength") }),
|
|
1599
|
+
/* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ O.jsx(Vt, { value: u, max: 20, min: 0, onChange: D }) })
|
|
1520
1600
|
] }),
|
|
1521
1601
|
/* @__PURE__ */ O.jsxs("div", { className: "option", children: [
|
|
1522
|
-
/* @__PURE__ */ O.
|
|
1523
|
-
|
|
1524
|
-
a("sheet.numfmt.currencyType")
|
|
1525
|
-
] }),
|
|
1526
|
-
/* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ O.jsx(zt, { onChange: b, options: f, value: i }) })
|
|
1602
|
+
/* @__PURE__ */ O.jsx("div", { className: "label", children: r("sheet.numfmt.currencyType") }),
|
|
1603
|
+
/* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ O.jsx(Jt, { onChange: b, options: f, value: a }) })
|
|
1527
1604
|
] })
|
|
1528
1605
|
] }),
|
|
1529
|
-
/* @__PURE__ */ O.
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
] }),
|
|
1533
|
-
/* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Lt, { onChange: I, options: h, value: m }) }),
|
|
1534
|
-
/* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: a("sheet.numfmt.currencyDes") })
|
|
1606
|
+
/* @__PURE__ */ O.jsx("div", { className: "m-t-16 label", children: r("sheet.numfmt.negType") }),
|
|
1607
|
+
/* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Wt, { onChange: I, options: h, value: p }) }),
|
|
1608
|
+
/* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.currencyDes") })
|
|
1535
1609
|
] });
|
|
1536
|
-
},
|
|
1537
|
-
const t =
|
|
1538
|
-
return
|
|
1539
|
-
},
|
|
1540
|
-
const t =
|
|
1610
|
+
}, Ss = (e) => {
|
|
1611
|
+
const t = ge.getInfo(e);
|
|
1612
|
+
return Tn().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
|
|
1613
|
+
}, Cs = (e) => {
|
|
1614
|
+
const t = Se(Tn, []), n = de(me).t, [a, l] = ie(() => {
|
|
1541
1615
|
if (e.defaultPattern) {
|
|
1542
|
-
const d = t.find((
|
|
1616
|
+
const d = t.find((p) => p.value === e.defaultPattern);
|
|
1543
1617
|
if (d)
|
|
1544
1618
|
return d.value;
|
|
1545
1619
|
}
|
|
1546
1620
|
return t[0].value;
|
|
1547
1621
|
});
|
|
1548
|
-
e.action.current = () =>
|
|
1622
|
+
e.action.current = () => a;
|
|
1549
1623
|
const u = (d) => {
|
|
1550
1624
|
l(d), e.onChange(d);
|
|
1551
1625
|
};
|
|
1552
1626
|
return /* @__PURE__ */ O.jsxs("div", { children: [
|
|
1553
1627
|
/* @__PURE__ */ O.jsx("div", { className: "m-t-16 label", children: n("sheet.numfmt.dateType") }),
|
|
1554
|
-
/* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(
|
|
1628
|
+
/* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Wt, { value: a, options: t, onChange: u }) }),
|
|
1555
1629
|
/* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.dateDes") })
|
|
1556
1630
|
] });
|
|
1557
|
-
},
|
|
1558
|
-
const
|
|
1559
|
-
return e.action.current = () => "", /* @__PURE__ */ O.jsx("div", { children: /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children:
|
|
1560
|
-
},
|
|
1561
|
-
const t = de(
|
|
1562
|
-
const f =
|
|
1563
|
-
return (f == null ? void 0 : f.value) ||
|
|
1564
|
-
}), d =
|
|
1565
|
-
|
|
1631
|
+
}, Ms = (e) => !e, js = (e) => {
|
|
1632
|
+
const r = de(me).t;
|
|
1633
|
+
return e.action.current = () => "", /* @__PURE__ */ O.jsx("div", { children: /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.generalDes") }) });
|
|
1634
|
+
}, xs = (e) => Fn().some((t) => Ve(t.value, e)), Is = (e) => {
|
|
1635
|
+
const t = de(me), r = Se(Fn, []), [n, a] = ie(() => Re(e.defaultPattern || "", 0)), [l, u] = ie(() => {
|
|
1636
|
+
const f = r.find((b) => Ve(b.value, e.defaultPattern || ""));
|
|
1637
|
+
return (f == null ? void 0 : f.value) || r[0].value;
|
|
1638
|
+
}), d = Se(() => ee(l, Number(n || 0)), [l, n]), p = Se(() => !ns(l), [l]), v = (f) => {
|
|
1639
|
+
a(f || 0), e.onChange(ee(l, Number(f || 0)));
|
|
1566
1640
|
}, h = (f) => {
|
|
1567
|
-
|
|
1641
|
+
a(Re(f, 0)), u(f), e.onChange(f);
|
|
1568
1642
|
};
|
|
1569
1643
|
return e.action.current = () => d, /* @__PURE__ */ O.jsxs("div", { children: [
|
|
1570
1644
|
/* @__PURE__ */ O.jsx("div", { className: "m-t-16 label", children: t.t("sheet.numfmt.decimalLength") }),
|
|
1571
1645
|
/* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(
|
|
1572
|
-
|
|
1646
|
+
Vt,
|
|
1573
1647
|
{
|
|
1574
|
-
disabled:
|
|
1648
|
+
disabled: p,
|
|
1575
1649
|
value: n,
|
|
1576
1650
|
max: 20,
|
|
1577
1651
|
min: 0,
|
|
@@ -1582,739 +1656,319 @@ const mn = "numfmtCurrency", os = (e) => {
|
|
|
1582
1656
|
" ",
|
|
1583
1657
|
t.t("sheet.numfmt.negType")
|
|
1584
1658
|
] }),
|
|
1585
|
-
/* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(
|
|
1659
|
+
/* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Wt, { onChange: h, options: r, value: l }) }),
|
|
1586
1660
|
/* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: t.t("sheet.numfmt.thousandthPercentileDes") })
|
|
1587
1661
|
] });
|
|
1588
|
-
},
|
|
1589
|
-
const { defaultValue: t, defaultPattern:
|
|
1662
|
+
}, Rs = (e) => {
|
|
1663
|
+
const { defaultValue: t, defaultPattern: r, row: n, col: a } = e.value, l = de(me), u = Ht(() => ""), d = l.t, p = gs(), v = Se(
|
|
1590
1664
|
() => [
|
|
1591
|
-
{ label: "sheet.numfmt.general", component:
|
|
1592
|
-
{ label: "sheet.numfmt.accounting", component:
|
|
1593
|
-
{ label: "sheet.numfmt.currency", component:
|
|
1594
|
-
{ label: "sheet.numfmt.date", component:
|
|
1595
|
-
{ label: "sheet.numfmt.thousandthPercentile", component:
|
|
1665
|
+
{ label: "sheet.numfmt.general", component: js },
|
|
1666
|
+
{ label: "sheet.numfmt.accounting", component: _s },
|
|
1667
|
+
{ label: "sheet.numfmt.currency", component: bs },
|
|
1668
|
+
{ label: "sheet.numfmt.date", component: Cs },
|
|
1669
|
+
{ label: "sheet.numfmt.thousandthPercentile", component: Is }
|
|
1596
1670
|
].map((G) => ({ ...G, label: d(G.label) })),
|
|
1597
1671
|
[]
|
|
1598
|
-
), [h, f] = ie(
|
|
1672
|
+
), [h, f] = ie(z), [b, I] = ie(() => `${n}_${a}`), { mark: D, userHabitCurrency: E } = hs(() => I(`${n}_${a}_userCurrency'`)), R = Se(() => {
|
|
1599
1673
|
var G;
|
|
1600
|
-
return (G = v.find((
|
|
1674
|
+
return (G = v.find((fe) => fe.label === h)) == null ? void 0 : G.component;
|
|
1601
1675
|
}, [h]);
|
|
1602
|
-
function
|
|
1603
|
-
return [
|
|
1676
|
+
function z() {
|
|
1677
|
+
return [Ms, vs, ys, Ss, xs].reduce((fe, $e, q) => fe || ($e(r) ? v[q].label : ""), "") || v[0].label;
|
|
1604
1678
|
}
|
|
1605
|
-
const
|
|
1679
|
+
const B = v.map((G) => ({
|
|
1606
1680
|
label: G.label,
|
|
1607
1681
|
value: G.label
|
|
1608
1682
|
})), W = (G) => {
|
|
1609
|
-
f(G),
|
|
1683
|
+
f(G), p(() => e.onChange({ type: "change", value: u.current() || "" }));
|
|
1610
1684
|
}, Q = (G) => {
|
|
1611
1685
|
e.onChange({ type: "change", value: G });
|
|
1612
|
-
},
|
|
1613
|
-
const G = u.current() || "",
|
|
1614
|
-
|
|
1615
|
-
},
|
|
1686
|
+
}, pe = () => {
|
|
1687
|
+
const G = u.current() || "", fe = nt(G);
|
|
1688
|
+
fe && D(fe), e.onChange({ type: "confirm", value: G });
|
|
1689
|
+
}, Pe = () => {
|
|
1616
1690
|
e.onChange({ type: "cancel", value: "" });
|
|
1617
|
-
},
|
|
1691
|
+
}, De = {
|
|
1618
1692
|
onChange: Q,
|
|
1619
1693
|
defaultValue: t,
|
|
1620
|
-
defaultPattern:
|
|
1694
|
+
defaultPattern: r,
|
|
1621
1695
|
action: u
|
|
1622
1696
|
};
|
|
1623
|
-
return
|
|
1624
|
-
f(
|
|
1625
|
-
}, [n,
|
|
1697
|
+
return Bt(() => {
|
|
1698
|
+
f(z()), I(`${n}_${a}`);
|
|
1699
|
+
}, [n, a]), /* @__PURE__ */ O.jsxs("div", { className: "numfmt-panel p-b-20", children: [
|
|
1626
1700
|
/* @__PURE__ */ O.jsxs("div", { children: [
|
|
1627
1701
|
/* @__PURE__ */ O.jsx("div", { className: "label m-t-14", children: d("sheet.numfmt.numfmtType") }),
|
|
1628
|
-
/* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(
|
|
1629
|
-
/* @__PURE__ */ O.jsx("div", { children: R && /* @__PURE__ */ O.jsx(
|
|
1702
|
+
/* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Jt, { onChange: W, options: B, value: h }) }),
|
|
1703
|
+
/* @__PURE__ */ O.jsx("div", { children: R && /* @__PURE__ */ O.jsx(qt.Provider, { value: E, children: /* @__PURE__ */ He(R, { ...De, key: b }) }) })
|
|
1630
1704
|
] }),
|
|
1631
1705
|
/* @__PURE__ */ O.jsxs("div", { className: "btn-list m-t-14 m-b-20", children: [
|
|
1632
|
-
/* @__PURE__ */ O.jsx(
|
|
1633
|
-
/* @__PURE__ */ O.jsx(
|
|
1706
|
+
/* @__PURE__ */ O.jsx(hn, { size: "small", onClick: Pe, className: "m-r-12", children: d("sheet.numfmt.cancel") }),
|
|
1707
|
+
/* @__PURE__ */ O.jsx(hn, { type: "primary", size: "small", onClick: pe, children: d("sheet.numfmt.confirm") })
|
|
1634
1708
|
] })
|
|
1635
1709
|
] });
|
|
1636
1710
|
};
|
|
1637
|
-
var
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
tag: "path",
|
|
1697
|
-
attrs: {
|
|
1698
|
-
fill: "currentColor",
|
|
1699
|
-
d: "M13.403 9.81183C13.1426 9.55148 12.7205 9.55148 12.4602 9.81183 12.1998 10.0722 12.1998 10.4943 12.4602 10.7546L13.3221 11.6166H7.26493C6.89674 11.6166 6.59827 11.915 6.59827 12.2832 6.59827 12.6514 6.89674 12.9499 7.26493 12.9499H13.3221L12.4602 13.8118C12.1998 14.0722 12.1998 14.4943 12.4602 14.7546 12.7205 15.015 13.1426 15.015 13.403 14.7546L15.3985 12.7591C15.4167 12.7412 15.4339 12.7224 15.4499 12.7026 15.48 12.6655 15.5055 12.6259 15.5264 12.5846 15.5724 12.4941 15.5983 12.3917 15.5983 12.2832 15.5983 12.1748 15.5724 12.0724 15.5264 11.9819 15.5055 11.9406 15.48 11.901 15.4499 11.8639 15.4339 11.8441 15.4167 11.8253 15.3986 11.8074L13.403 9.81183zM2.26489 8.21384C2.26489 7.84565 2.56337 7.54717 2.93156 7.54717H3.26489C3.63308 7.54717 3.93156 7.84565 3.93156 8.21384 3.93156 8.58203 3.63308 8.88051 3.26489 8.88051H2.93156C2.56337 8.88051 2.26489 8.58203 2.26489 8.21384z"
|
|
1700
|
-
}
|
|
1701
|
-
}
|
|
1702
|
-
]
|
|
1703
|
-
}, On = Xe(function(e, t) {
|
|
1704
|
-
return Ye(tt, Object.assign({}, e, {
|
|
1705
|
-
id: "add-digits-single",
|
|
1706
|
-
ref: t,
|
|
1707
|
-
icon: js
|
|
1708
|
-
}));
|
|
1709
|
-
});
|
|
1710
|
-
On.displayName = "AddDigitsSingle";
|
|
1711
|
-
const xs = On;
|
|
1712
|
-
var Is = {
|
|
1713
|
-
tag: "svg",
|
|
1714
|
-
attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
|
|
1715
|
-
children: [
|
|
1716
|
-
{
|
|
1717
|
-
tag: "mask",
|
|
1718
|
-
attrs: {
|
|
1719
|
-
id: "mask0_102_556",
|
|
1720
|
-
style: { maskType: "alpha" },
|
|
1721
|
-
width: 17,
|
|
1722
|
-
height: 17,
|
|
1723
|
-
x: 0,
|
|
1724
|
-
y: 0,
|
|
1725
|
-
maskUnits: "userSpaceOnUse"
|
|
1726
|
-
},
|
|
1727
|
-
children: [
|
|
1728
|
-
{
|
|
1729
|
-
tag: "path",
|
|
1730
|
-
attrs: { fill: "#D9D9D9", d: "M0.56 0.77H16.56V16.77H0.56z" }
|
|
1711
|
+
var ws = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, Ds = (e, t, r, n) => {
|
|
1712
|
+
for (var a = n > 1 ? void 0 : n ? Ps(t, r) : t, l = e.length - 1, u; l >= 0; l--)
|
|
1713
|
+
(u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
|
|
1714
|
+
return n && a && ws(t, r, a), a;
|
|
1715
|
+
}, se = (e, t) => (r, n) => t(r, n, e);
|
|
1716
|
+
let mt = class extends Me {
|
|
1717
|
+
constructor(t, r, n, a, l, u, d, p, v, h, f, b) {
|
|
1718
|
+
super();
|
|
1719
|
+
/**
|
|
1720
|
+
* If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
|
|
1721
|
+
* @private
|
|
1722
|
+
* @type {(string | null)}
|
|
1723
|
+
* @memberof NumfmtController
|
|
1724
|
+
*/
|
|
1725
|
+
Ne(this, "_previewPattern", "");
|
|
1726
|
+
Ne(this, "openPanel", () => {
|
|
1727
|
+
const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, a = this._univerInstanceService, l = this._numfmtService, u = this._localeService, p = (r.getSelectionRanges() || [])[0];
|
|
1728
|
+
if (!p)
|
|
1729
|
+
return !1;
|
|
1730
|
+
const v = a.getCurrentUniverSheetInstance(), h = v.getActiveSheet(), f = h.getCellRaw(p.startRow, p.startColumn), b = l.getValue(
|
|
1731
|
+
v.getUnitId(),
|
|
1732
|
+
h.getSheetId(),
|
|
1733
|
+
p.startRow,
|
|
1734
|
+
p.startColumn
|
|
1735
|
+
);
|
|
1736
|
+
let I = "";
|
|
1737
|
+
b && (I = b.pattern);
|
|
1738
|
+
const D = (f == null ? void 0 : f.t) === Ue.NUMBER ? f.v : 12345678, E = {
|
|
1739
|
+
onChange: (R) => {
|
|
1740
|
+
var z, B;
|
|
1741
|
+
if (R.type === "change")
|
|
1742
|
+
this._previewPattern = R.value, this._sheetSkeletonManagerService.reCalculate(), (B = (z = this._renderManagerService.getRenderById(v.getUnitId())) == null ? void 0 : z.mainComponent) == null || B.makeDirty();
|
|
1743
|
+
else if (R.type === "confirm") {
|
|
1744
|
+
const W = r.getSelectionRanges() || [], Q = { values: [] }, pe = Gt(R.value);
|
|
1745
|
+
W.forEach((Pe) => {
|
|
1746
|
+
ne.foreach(Pe, (De, G) => {
|
|
1747
|
+
Q.values.push({
|
|
1748
|
+
row: De,
|
|
1749
|
+
col: G,
|
|
1750
|
+
pattern: R.value,
|
|
1751
|
+
type: pe
|
|
1752
|
+
});
|
|
1753
|
+
});
|
|
1754
|
+
}), n.executeCommand(Le.id, Q), t.close();
|
|
1755
|
+
} else
|
|
1756
|
+
R.type === "cancel" && t.close();
|
|
1757
|
+
},
|
|
1758
|
+
value: { defaultPattern: I, defaultValue: D, row: p.startRow, col: p.startColumn }
|
|
1759
|
+
};
|
|
1760
|
+
t.open({
|
|
1761
|
+
header: { title: u.t("sheet.numfmt.title") },
|
|
1762
|
+
children: {
|
|
1763
|
+
label: Qe,
|
|
1764
|
+
...E
|
|
1765
|
+
// need passthrough to react props.
|
|
1766
|
+
},
|
|
1767
|
+
onClose: () => {
|
|
1768
|
+
var R, z;
|
|
1769
|
+
this._sheetSkeletonManagerService.reCalculate(), (z = (R = this._renderManagerService.getRenderById(v.getUnitId())) == null ? void 0 : R.mainComponent) == null || z.makeDirty(), n.executeCommand(Ft.id);
|
|
1731
1770
|
}
|
|
1732
|
-
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1771
|
+
});
|
|
1772
|
+
});
|
|
1773
|
+
this._sheetInterceptorService = t, this._themeService = r, this._injector = n, this._univerInstanceService = a, this._sheetSkeletonManagerService = l, this._commandService = u, this._selectionManagerService = d, this._renderManagerService = p, this._numfmtService = v, this._componentManager = h, this._sidebarService = f, this._localeService = b, this._initInterceptorCommands(), this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._commandExecutedListener();
|
|
1774
|
+
}
|
|
1775
|
+
_initCommands() {
|
|
1776
|
+
[
|
|
1777
|
+
Pn,
|
|
1778
|
+
En,
|
|
1779
|
+
On,
|
|
1780
|
+
Ct,
|
|
1781
|
+
Ft,
|
|
1782
|
+
Le
|
|
1783
|
+
].forEach((t) => {
|
|
1784
|
+
this.disposeWithMe(this._commandService.registerCommand(t));
|
|
1785
|
+
});
|
|
1786
|
+
}
|
|
1787
|
+
_initPanel() {
|
|
1788
|
+
this._componentManager.register(Qe, Rs);
|
|
1789
|
+
}
|
|
1790
|
+
_initInterceptorCommands() {
|
|
1791
|
+
const t = this;
|
|
1792
|
+
this.disposeWithMe(
|
|
1793
|
+
this._sheetInterceptorService.interceptCommand({
|
|
1794
|
+
getMutations(r) {
|
|
1795
|
+
switch (r.id) {
|
|
1796
|
+
case mr.id:
|
|
1797
|
+
case dr.id: {
|
|
1798
|
+
const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), a = t._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), l = t._selectionManagerService.getSelectionRanges();
|
|
1799
|
+
if (!(l != null && l.length))
|
|
1800
|
+
break;
|
|
1801
|
+
const u = {
|
|
1802
|
+
unitId: n,
|
|
1803
|
+
subUnitId: a,
|
|
1804
|
+
ranges: []
|
|
1805
|
+
}, d = t._numfmtService.getModel(n, a);
|
|
1806
|
+
l.forEach((v) => {
|
|
1807
|
+
ne.foreach(v, (h, f) => {
|
|
1808
|
+
d != null && d.getValue(h, f) && u.ranges.push({
|
|
1809
|
+
startColumn: f,
|
|
1810
|
+
endColumn: f,
|
|
1811
|
+
startRow: h,
|
|
1812
|
+
endRow: h
|
|
1813
|
+
});
|
|
1814
|
+
});
|
|
1815
|
+
}), u.ranges = Ie(u.ranges);
|
|
1816
|
+
const p = Fe(t._injector, u);
|
|
1817
|
+
return {
|
|
1818
|
+
redos: [{ id: te.id, params: u }],
|
|
1819
|
+
undos: p
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1745
1822
|
}
|
|
1823
|
+
return {
|
|
1824
|
+
redos: [],
|
|
1825
|
+
undos: []
|
|
1826
|
+
};
|
|
1746
1827
|
}
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
})
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
},
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
if (d === 0)
|
|
1884
|
-
i(null);
|
|
1885
|
-
else if (d === lt.length - 1)
|
|
1886
|
-
e.executeCommand(vt.id);
|
|
1887
|
-
else {
|
|
1888
|
-
const m = lt[d];
|
|
1889
|
-
m.pattern && i(m.pattern);
|
|
1890
|
-
}
|
|
1891
|
-
}, u = 1220;
|
|
1892
|
-
return /* @__PURE__ */ O.jsx("div", { className: "more-numfmt-type-options", children: lt.map((d, m) => d === "|" ? /* @__PURE__ */ O.jsx("div", { className: "line m-t-4", onClick: (v) => v.stopPropagation() }, m) : /* @__PURE__ */ O.jsxs(
|
|
1893
|
-
"div",
|
|
1894
|
-
{
|
|
1895
|
-
className: "option-item m-t-4",
|
|
1896
|
-
onClick: () => {
|
|
1897
|
-
l(m);
|
|
1898
|
-
},
|
|
1899
|
-
children: [
|
|
1900
|
-
/* @__PURE__ */ O.jsx("div", { children: t.t(d.label) }),
|
|
1901
|
-
/* @__PURE__ */ O.jsx("div", { className: "m-l-26", children: d.pattern ? he.format(d.pattern || "", u, { locale: "zh-CN" }) : "" })
|
|
1902
|
-
]
|
|
1903
|
-
},
|
|
1904
|
-
m
|
|
1905
|
-
)) });
|
|
1906
|
-
}, Ns = (e) => {
|
|
1907
|
-
const t = "icon-rmbSingle";
|
|
1908
|
-
return e.register(t, Os), e.register("MoreDownSingle", Rs), (a) => ({
|
|
1909
|
-
icon: t,
|
|
1910
|
-
id: jn.id,
|
|
1911
|
-
title: "sheet.numfmt.currency",
|
|
1912
|
-
tooltip: "sheet.numfmt.currency",
|
|
1913
|
-
type: St.BUTTON,
|
|
1914
|
-
group: Ct.TOOLBAR_FORMULAS_INSERT,
|
|
1915
|
-
positions: [Mt.TOOLBAR_START],
|
|
1916
|
-
hidden$: jt(a, yt.SHEET),
|
|
1917
|
-
disabled$: bt(a)
|
|
1918
|
-
});
|
|
1919
|
-
}, Ts = (e) => {
|
|
1920
|
-
const t = "icon-addDigitsSingle";
|
|
1921
|
-
return e.register(t, xs), (a) => ({
|
|
1922
|
-
icon: t,
|
|
1923
|
-
id: Cn.id,
|
|
1924
|
-
title: "sheet.numfmt.addDecimal",
|
|
1925
|
-
tooltip: "sheet.numfmt.addDecimal",
|
|
1926
|
-
type: St.BUTTON,
|
|
1927
|
-
positions: [Mt.TOOLBAR_START],
|
|
1928
|
-
group: Ct.TOOLBAR_FORMULAS_INSERT,
|
|
1929
|
-
hidden$: jt(a, yt.SHEET),
|
|
1930
|
-
disabled$: bt(a)
|
|
1931
|
-
});
|
|
1932
|
-
}, Fs = (e) => {
|
|
1933
|
-
const t = "icon-reduceDigitsSingle";
|
|
1934
|
-
return e.register(t, ks), (a) => ({
|
|
1935
|
-
icon: t,
|
|
1936
|
-
id: xn.id,
|
|
1937
|
-
title: "sheet.numfmt.subtractDecimal",
|
|
1938
|
-
tooltip: "sheet.numfmt.subtractDecimal",
|
|
1939
|
-
type: St.BUTTON,
|
|
1940
|
-
group: Ct.TOOLBAR_FORMULAS_INSERT,
|
|
1941
|
-
positions: [Mt.TOOLBAR_START],
|
|
1942
|
-
hidden$: jt(a, yt.SHEET),
|
|
1943
|
-
disabled$: bt(a)
|
|
1944
|
-
});
|
|
1945
|
-
}, $s = (e) => {
|
|
1946
|
-
const t = "sheet.numfmt.moreNumfmtType", a = "sheet.numfmt.moreNumfmtType.options";
|
|
1947
|
-
return e.register(t, Ps), e.register(a, Es), (n) => {
|
|
1948
|
-
const i = n.get(be), l = n.get(ge), u = n.get(je), d = n.get(ve), m = n.get(Ve), v = new Oe(
|
|
1949
|
-
(h) => Ft(
|
|
1950
|
-
m.selectionMoveEnd$,
|
|
1951
|
-
new Oe((f) => {
|
|
1952
|
-
const b = [re.id, oe.id], I = u.onCommandExecuted((D) => {
|
|
1953
|
-
b.includes(D.id) && f.next(null);
|
|
1954
|
-
});
|
|
1955
|
-
return () => I.dispose();
|
|
1956
|
-
})
|
|
1957
|
-
).subscribe(() => {
|
|
1958
|
-
const f = m.getSelections();
|
|
1959
|
-
if (f && f[0]) {
|
|
1960
|
-
const b = l.getCurrentUniverSheetInstance(), I = b.getActiveSheet(), D = f[0].range, P = D.startRow, R = D.startColumn, A = i.getValue(b.getUnitId(), I.getSheetId(), P, R);
|
|
1961
|
-
let V = d.t("sheet.numfmt.general");
|
|
1962
|
-
if (A) {
|
|
1963
|
-
const W = A.pattern, Q = lt.filter((me) => typeof me == "object" && me.pattern).find(
|
|
1964
|
-
(me) => Be(W, me.pattern)
|
|
1965
|
-
);
|
|
1966
|
-
Q && typeof Q == "object" && Q.pattern ? V = d.t(Q.label) : V = d.t("sheet.numfmt.moreFmt");
|
|
1967
|
-
}
|
|
1968
|
-
h.next(V);
|
|
1969
|
-
}
|
|
1970
|
-
})
|
|
1971
|
-
);
|
|
1972
|
-
return {
|
|
1973
|
-
// icon: 'MoreDownSingle',
|
|
1974
|
-
label: t,
|
|
1975
|
-
id: vt.id,
|
|
1976
|
-
tooltip: "sheet.numfmt.title",
|
|
1977
|
-
type: St.SELECTOR,
|
|
1978
|
-
group: Ct.TOOLBAR_FORMULAS_INSERT,
|
|
1979
|
-
positions: [Mt.TOOLBAR_START],
|
|
1980
|
-
selections: [
|
|
1981
|
-
{
|
|
1982
|
-
label: {
|
|
1983
|
-
name: a,
|
|
1984
|
-
hoverable: !1
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
],
|
|
1988
|
-
value$: v,
|
|
1989
|
-
hidden$: jt(n, yt.SHEET),
|
|
1990
|
-
disabled$: bt(n)
|
|
1991
|
-
};
|
|
1992
|
-
};
|
|
1993
|
-
};
|
|
1994
|
-
var As = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, zs = (e, t, a, n) => {
|
|
1995
|
-
for (var i = n > 1 ? void 0 : n ? Us(t, a) : t, l = e.length - 1, u; l >= 0; l--)
|
|
1996
|
-
(u = e[l]) && (i = (n ? u(t, a, i) : u(i)) || i);
|
|
1997
|
-
return n && i && As(t, a, i), i;
|
|
1998
|
-
}, ee = (e, t) => (a, n) => t(a, n, e);
|
|
1999
|
-
let ut = class extends Le {
|
|
2000
|
-
constructor(t, a, n, i, l, u, d, m, v, h, f, b, I) {
|
|
2001
|
-
super();
|
|
2002
|
-
/**
|
|
2003
|
-
* If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
|
|
2004
|
-
* @private
|
|
2005
|
-
* @type {(string | null)}
|
|
2006
|
-
* @memberof NumfmtController
|
|
2007
|
-
*/
|
|
2008
|
-
ke(this, "_previewPattern", "");
|
|
2009
|
-
ke(this, "openPanel", () => {
|
|
2010
|
-
const t = this._sidebarService, a = this._selectionManagerService, n = this._commandService, i = this._univerInstanceService, l = this._numfmtService, u = this._localeService, m = (a.getSelectionRanges() || [])[0];
|
|
2011
|
-
if (!m)
|
|
2012
|
-
return !1;
|
|
2013
|
-
const v = i.getCurrentUniverSheetInstance(), h = v.getActiveSheet(), f = h.getCellRaw(m.startRow, m.startColumn), b = l.getValue(
|
|
2014
|
-
v.getUnitId(),
|
|
2015
|
-
h.getSheetId(),
|
|
2016
|
-
m.startRow,
|
|
2017
|
-
m.startColumn
|
|
2018
|
-
);
|
|
2019
|
-
let I = "";
|
|
2020
|
-
b && (I = b.pattern);
|
|
2021
|
-
const D = (f == null ? void 0 : f.t) === Ae.NUMBER ? f.v : 12345678, P = {
|
|
2022
|
-
onChange: (R) => {
|
|
2023
|
-
var A, V;
|
|
2024
|
-
if (R.type === "change")
|
|
2025
|
-
this._previewPattern = R.value, this._sheetSkeletonManagerService.reCalculate(), (V = (A = this._renderManagerService.getRenderById(v.getUnitId())) == null ? void 0 : A.mainComponent) == null || V.makeDirty();
|
|
2026
|
-
else if (R.type === "confirm") {
|
|
2027
|
-
const W = a.getSelectionRanges() || [], Q = { values: [] }, me = Yt(R.value);
|
|
2028
|
-
W.forEach((xe) => {
|
|
2029
|
-
ne.foreach(xe, (Ie, G) => {
|
|
2030
|
-
Q.values.push({
|
|
2031
|
-
row: Ie,
|
|
2032
|
-
col: G,
|
|
2033
|
-
pattern: R.value,
|
|
2034
|
-
type: me
|
|
2035
|
-
});
|
|
2036
|
-
});
|
|
2037
|
-
}), n.executeCommand(Ue.id, Q), t.close();
|
|
2038
|
-
} else
|
|
2039
|
-
R.type === "cancel" && t.close();
|
|
2040
|
-
},
|
|
2041
|
-
value: { defaultPattern: I, defaultValue: D, row: m.startRow, col: m.startColumn }
|
|
2042
|
-
};
|
|
2043
|
-
t.open({
|
|
2044
|
-
header: { title: u.t("sheet.numfmt.title") },
|
|
2045
|
-
children: {
|
|
2046
|
-
label: gt,
|
|
2047
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2048
|
-
...P
|
|
2049
|
-
// need passthrough to react props.
|
|
2050
|
-
},
|
|
2051
|
-
onClose: () => {
|
|
2052
|
-
var R, A;
|
|
2053
|
-
this._sheetSkeletonManagerService.reCalculate(), (A = (R = this._renderManagerService.getRenderById(v.getUnitId())) == null ? void 0 : R.mainComponent) == null || A.makeDirty(), n.executeCommand(Dt.id);
|
|
2054
|
-
}
|
|
2055
|
-
});
|
|
2056
|
-
});
|
|
2057
|
-
ke(this, "_initLocal", () => {
|
|
2058
|
-
this._localeService.load({ zhCN: zr });
|
|
2059
|
-
});
|
|
2060
|
-
this._sheetInterceptorService = t, this._themeService = a, this._injector = n, this._univerInstanceService = i, this._sheetSkeletonManagerService = l, this._commandService = u, this._selectionManagerService = d, this._renderManagerService = m, this._numfmtService = v, this._componentManager = h, this._menuService = f, this._sidebarService = b, this._localeService = I, this._initInterceptorCommands(), this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._commandExecutedListener(), this._initMenu(), this._initInterceptorCellContent(), this._initLocal();
|
|
2061
|
-
}
|
|
2062
|
-
_initCommands() {
|
|
2063
|
-
[
|
|
2064
|
-
Cn,
|
|
2065
|
-
xn,
|
|
2066
|
-
jn,
|
|
2067
|
-
vt,
|
|
2068
|
-
Dt,
|
|
2069
|
-
Ue
|
|
2070
|
-
].forEach((t) => {
|
|
2071
|
-
this.disposeWithMe(this._commandService.registerCommand(t));
|
|
2072
|
-
});
|
|
2073
|
-
}
|
|
2074
|
-
_initPanel() {
|
|
2075
|
-
this._componentManager.register(gt, ys);
|
|
2076
|
-
}
|
|
2077
|
-
_initMenu() {
|
|
2078
|
-
[Ts, Fs, Ns, $s].map((t) => t(this._componentManager)).forEach((t) => {
|
|
2079
|
-
this.disposeWithMe(this._menuService.addMenuItem(t(this._injector)));
|
|
2080
|
-
});
|
|
2081
|
-
}
|
|
2082
|
-
_initInterceptorCommands() {
|
|
2083
|
-
const t = this;
|
|
2084
|
-
this.disposeWithMe(
|
|
2085
|
-
this._sheetInterceptorService.interceptCommand({
|
|
2086
|
-
getMutations(a) {
|
|
2087
|
-
switch (a.id) {
|
|
2088
|
-
case ir.id:
|
|
2089
|
-
case ar.id: {
|
|
2090
|
-
const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), i = t._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), l = t._selectionManagerService.getSelectionRanges();
|
|
2091
|
-
if (!(l != null && l.length))
|
|
2092
|
-
break;
|
|
2093
|
-
const u = {
|
|
2094
|
-
unitId: n,
|
|
2095
|
-
subUnitId: i,
|
|
2096
|
-
ranges: []
|
|
2097
|
-
}, d = t._numfmtService.getModel(n, i);
|
|
2098
|
-
l.forEach((v) => {
|
|
2099
|
-
ne.foreach(v, (h, f) => {
|
|
2100
|
-
d != null && d.getValue(h, f) && u.ranges.push({
|
|
2101
|
-
startColumn: f,
|
|
2102
|
-
endColumn: f,
|
|
2103
|
-
startRow: h,
|
|
2104
|
-
endRow: h
|
|
2105
|
-
});
|
|
2106
|
-
});
|
|
2107
|
-
}), u.ranges = Ce(u.ranges);
|
|
2108
|
-
const m = Pe(t._injector, u);
|
|
2109
|
-
return {
|
|
2110
|
-
redos: [{ id: re.id, params: u }],
|
|
2111
|
-
undos: m
|
|
2112
|
-
};
|
|
2113
|
-
}
|
|
2114
|
-
}
|
|
2115
|
-
return {
|
|
2116
|
-
redos: [],
|
|
2117
|
-
undos: []
|
|
2118
|
-
};
|
|
2119
|
-
}
|
|
2120
|
-
})
|
|
2121
|
-
);
|
|
2122
|
-
}
|
|
2123
|
-
_initInterceptorCellContent() {
|
|
2124
|
-
const t = new hn();
|
|
2125
|
-
this.disposeWithMe(
|
|
2126
|
-
this._sheetInterceptorService.intercept(an.CELL_CONTENT, {
|
|
2127
|
-
handler: (a, n, i) => {
|
|
2128
|
-
const l = n.unitId, u = n.subUnitId, d = this._numfmtService.getValue(l, u, n.row, n.col);
|
|
2129
|
-
if (!d)
|
|
2130
|
-
return i(a);
|
|
2131
|
-
const m = a;
|
|
2132
|
-
if (!m || m.t !== Ae.NUMBER)
|
|
2133
|
-
return i(a);
|
|
2134
|
-
let v = "";
|
|
2135
|
-
const h = t.getValue(n.row, n.col);
|
|
2136
|
-
if (h && h.parameters === m.v)
|
|
2137
|
-
return { ...a, ...h.result };
|
|
2138
|
-
const f = pn(d.pattern, Number(m.v));
|
|
2139
|
-
if (v = f.result, !v)
|
|
2140
|
-
return i(a);
|
|
2141
|
-
const b = { v };
|
|
2142
|
-
if (f.color) {
|
|
2143
|
-
const I = this._themeService.getCurrentTheme()[`${f.color}500`];
|
|
2144
|
-
I && (b.interceptorStyle = { cl: { rgb: I } });
|
|
2145
|
-
}
|
|
2146
|
-
return t.setValue(n.row, n.col, {
|
|
2147
|
-
result: b,
|
|
2148
|
-
parameters: m.v
|
|
2149
|
-
}), { ...a, ...b };
|
|
2150
|
-
}
|
|
2151
|
-
})
|
|
2152
|
-
), this.disposeWithMe(
|
|
2153
|
-
this._commandService.onCommandExecuted((a) => {
|
|
2154
|
-
if (a.id === oe.id) {
|
|
2155
|
-
const n = a.params;
|
|
2156
|
-
Object.keys(n.values).forEach((i) => {
|
|
2157
|
-
n.values[i].ranges.forEach((u) => {
|
|
2158
|
-
ne.foreach(u, (d, m) => {
|
|
2159
|
-
t.realDeleteValue(d, m);
|
|
2160
|
-
});
|
|
2161
|
-
});
|
|
2162
|
-
});
|
|
2163
|
-
}
|
|
2164
|
-
})
|
|
2165
|
-
), this.disposeWithMe(
|
|
2166
|
-
De(
|
|
2167
|
-
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
2168
|
-
Ze((a) => a == null ? void 0 : a.sheetId),
|
|
2169
|
-
_n()
|
|
2170
|
-
).subscribe(() => {
|
|
2171
|
-
t.reset();
|
|
2172
|
-
})
|
|
2173
|
-
)
|
|
2174
|
-
);
|
|
2175
|
-
}
|
|
2176
|
-
_initRealTimeRenderingInterceptor() {
|
|
2177
|
-
const t = new Oe((n) => {
|
|
2178
|
-
this._commandService.onCommandExecuted((i) => {
|
|
2179
|
-
i.id === vt.id && n.next(!0), i.id === Dt.id && n.next(!1);
|
|
2180
|
-
});
|
|
2181
|
-
}), a = Er([
|
|
2182
|
-
t,
|
|
2183
|
-
this._selectionManagerService.selectionMoveEnd$.pipe(
|
|
2184
|
-
Ze((n) => n ? n.map((i) => i.range) : [])
|
|
2185
|
-
)
|
|
2186
|
-
]);
|
|
2187
|
-
this.disposeWithMe(
|
|
2188
|
-
De(
|
|
2189
|
-
a.pipe(
|
|
2190
|
-
yn(
|
|
2191
|
-
([n, i]) => new Oe((l) => {
|
|
2192
|
-
const u = new gn();
|
|
2193
|
-
return n && i.length && l.next({ selectionRanges: i, disposableCollection: u }), () => {
|
|
2194
|
-
u.dispose();
|
|
2195
|
-
};
|
|
2196
|
-
})
|
|
2197
|
-
),
|
|
2198
|
-
Nr(() => {
|
|
2199
|
-
this._previewPattern = null;
|
|
2200
|
-
})
|
|
2201
|
-
).subscribe(({ disposableCollection: n, selectionRanges: i }) => {
|
|
2202
|
-
var u, d;
|
|
2203
|
-
const l = this._univerInstanceService.getCurrentUniverSheetInstance();
|
|
2204
|
-
this.openPanel(), n.add(
|
|
2205
|
-
this._sheetInterceptorService.intercept(an.CELL_CONTENT, {
|
|
2206
|
-
priority: 99,
|
|
2207
|
-
handler: (m, v, h) => {
|
|
2208
|
-
const { row: f, col: b } = v;
|
|
2209
|
-
if (i.find(
|
|
2210
|
-
(I) => I.startColumn <= b && I.endColumn >= b && I.startRow <= f && I.endRow >= f
|
|
2211
|
-
)) {
|
|
2212
|
-
const I = v.worksheet.getCellRaw(f, b), D = I == null ? void 0 : I.v, P = I == null ? void 0 : I.t;
|
|
2213
|
-
if (D == null || P !== Ae.NUMBER || this._previewPattern === null)
|
|
2214
|
-
return h(m);
|
|
2215
|
-
const R = pn(this._previewPattern, D);
|
|
2216
|
-
if (R.color) {
|
|
2217
|
-
const V = this._themeService.getCurrentTheme()[`${R.color}500`];
|
|
2218
|
-
return {
|
|
2219
|
-
...m,
|
|
2220
|
-
v: R.result,
|
|
2221
|
-
t: Ae.STRING,
|
|
2222
|
-
s: { cl: { rgb: V } }
|
|
2223
|
-
};
|
|
2224
|
-
}
|
|
2225
|
-
return {
|
|
2226
|
-
...m,
|
|
2227
|
-
v: R.result,
|
|
2228
|
-
t: Ae.STRING
|
|
2229
|
-
};
|
|
2230
|
-
}
|
|
2231
|
-
return h(m);
|
|
2232
|
-
}
|
|
2233
|
-
})
|
|
2234
|
-
), (d = (u = this._renderManagerService.getRenderById(l.getUnitId())) == null ? void 0 : u.mainComponent) == null || d.makeDirty();
|
|
2235
|
-
})
|
|
2236
|
-
)
|
|
2237
|
-
);
|
|
2238
|
-
}
|
|
2239
|
-
_commandExecutedListener() {
|
|
2240
|
-
const t = [re.id, oe.id];
|
|
2241
|
-
this.disposeWithMe(
|
|
2242
|
-
De(
|
|
2243
|
-
Ft(
|
|
2244
|
-
new Oe((a) => {
|
|
2245
|
-
const n = this._commandService.onCommandExecuted((i) => {
|
|
2246
|
-
if (t.includes(i.id)) {
|
|
2247
|
-
const l = i.params;
|
|
2248
|
-
a.next(l.unitId);
|
|
2249
|
-
}
|
|
2250
|
-
});
|
|
2251
|
-
return () => {
|
|
2252
|
-
n.dispose();
|
|
2253
|
-
};
|
|
2254
|
-
}),
|
|
2255
|
-
this._numfmtService.modelReplace$
|
|
2256
|
-
).pipe(Tr(16)).subscribe((a) => {
|
|
2257
|
-
var n, i;
|
|
2258
|
-
this._sheetSkeletonManagerService.reCalculate(), (i = (n = this._renderManagerService.getRenderById(a)) == null ? void 0 : n.mainComponent) == null || i.makeDirty();
|
|
2259
|
-
})
|
|
2260
|
-
)
|
|
2261
|
-
);
|
|
2262
|
-
}
|
|
2263
|
-
};
|
|
2264
|
-
ut = zs([
|
|
2265
|
-
He(Ee.Rendered, ut),
|
|
2266
|
-
ee(0, z(Tt)),
|
|
2267
|
-
ee(1, z(nr)),
|
|
2268
|
-
ee(2, z(Ne)),
|
|
2269
|
-
ee(3, z(ge)),
|
|
2270
|
-
ee(4, z(vn)),
|
|
2271
|
-
ee(5, z(je)),
|
|
2272
|
-
ee(6, z(Ve)),
|
|
2273
|
-
ee(7, z(kr)),
|
|
2274
|
-
ee(8, z(be)),
|
|
2275
|
-
ee(9, z(Dr)),
|
|
2276
|
-
ee(10, z(Or)),
|
|
2277
|
-
ee(11, z(Pr)),
|
|
2278
|
-
ee(12, z(ve))
|
|
2279
|
-
], ut);
|
|
2280
|
-
var Ls = Object.defineProperty, Hs = Object.getOwnPropertyDescriptor, Vs = (e, t, a, n) => {
|
|
2281
|
-
for (var i = n > 1 ? void 0 : n ? Hs(t, a) : t, l = e.length - 1, u; l >= 0; l--)
|
|
2282
|
-
(u = e[l]) && (i = (n ? u(t, a, i) : u(i)) || i);
|
|
2283
|
-
return n && i && Ls(t, a, i), i;
|
|
2284
|
-
}, it = (e, t) => (a, n) => t(a, n, e);
|
|
2285
|
-
let dt = class extends Le {
|
|
2286
|
-
constructor(t, a, n, i) {
|
|
2287
|
-
super();
|
|
2288
|
-
ke(this, "_copyInfo");
|
|
2289
|
-
this._sheetClipboardService = t, this._injector = a, this._numfmtService = n, this._univerInstanceService = i, this._initClipboardHook();
|
|
2290
|
-
}
|
|
2291
|
-
_initClipboardHook() {
|
|
2292
|
-
this.disposeWithMe(
|
|
2293
|
-
this._sheetClipboardService.addClipboardHook({
|
|
2294
|
-
id: "numfmt",
|
|
2295
|
-
onBeforeCopy: (t, a, n) => this._collectNumfmt(t, a, n),
|
|
2296
|
-
onPasteCells: (t, a, n, i) => {
|
|
2297
|
-
const { copyType: l = on.COPY, pasteType: u } = i, { range: d } = t || {}, { range: m } = a;
|
|
2298
|
-
return this._generateNumfmtMutations(m, { copyType: l, pasteType: u, copyRange: d });
|
|
2299
|
-
}
|
|
2300
|
-
})
|
|
2301
|
-
);
|
|
2302
|
-
}
|
|
2303
|
-
_collectNumfmt(t, a, n) {
|
|
2304
|
-
const i = new hn();
|
|
2305
|
-
this._copyInfo = {
|
|
2306
|
-
matrix: i,
|
|
2307
|
-
info: {
|
|
2308
|
-
unitId: t,
|
|
2309
|
-
subUnitId: a
|
|
1828
|
+
})
|
|
1829
|
+
);
|
|
1830
|
+
}
|
|
1831
|
+
_initRealTimeRenderingInterceptor() {
|
|
1832
|
+
const t = new ke((n) => {
|
|
1833
|
+
this._commandService.onCommandExecuted((a) => {
|
|
1834
|
+
a.id === Ct.id && n.next(!0), a.id === Ft.id && n.next(!1);
|
|
1835
|
+
});
|
|
1836
|
+
}), r = Lr([
|
|
1837
|
+
t,
|
|
1838
|
+
this._selectionManagerService.selectionMoveEnd$.pipe(
|
|
1839
|
+
Ze((n) => n ? n.map((a) => a.range) : [])
|
|
1840
|
+
)
|
|
1841
|
+
]);
|
|
1842
|
+
this.disposeWithMe(
|
|
1843
|
+
Te(
|
|
1844
|
+
r.pipe(
|
|
1845
|
+
jn(
|
|
1846
|
+
([n, a]) => new ke((l) => {
|
|
1847
|
+
const u = new Sn();
|
|
1848
|
+
return n && a.length && l.next({ selectionRanges: a, disposableCollection: u }), () => {
|
|
1849
|
+
u.dispose();
|
|
1850
|
+
};
|
|
1851
|
+
})
|
|
1852
|
+
),
|
|
1853
|
+
kr(() => {
|
|
1854
|
+
this._previewPattern = null;
|
|
1855
|
+
})
|
|
1856
|
+
).subscribe(({ disposableCollection: n, selectionRanges: a }) => {
|
|
1857
|
+
var u, d;
|
|
1858
|
+
const l = this._univerInstanceService.getCurrentUniverSheetInstance();
|
|
1859
|
+
this.openPanel(), n.add(
|
|
1860
|
+
this._sheetInterceptorService.intercept(Cn.CELL_CONTENT, {
|
|
1861
|
+
priority: 99,
|
|
1862
|
+
handler: (p, v, h) => {
|
|
1863
|
+
const { row: f, col: b } = v;
|
|
1864
|
+
if (a.find(
|
|
1865
|
+
(I) => I.startColumn <= b && I.endColumn >= b && I.startRow <= f && I.endRow >= f
|
|
1866
|
+
)) {
|
|
1867
|
+
const I = v.worksheet.getCellRaw(f, b), D = I == null ? void 0 : I.v, E = I == null ? void 0 : I.t;
|
|
1868
|
+
if (D == null || E !== Ue.NUMBER || this._previewPattern === null)
|
|
1869
|
+
return h(p);
|
|
1870
|
+
const R = wn(this._previewPattern, D);
|
|
1871
|
+
if (R.color) {
|
|
1872
|
+
const B = this._themeService.getCurrentTheme()[`${R.color}500`];
|
|
1873
|
+
return {
|
|
1874
|
+
...p,
|
|
1875
|
+
v: R.result,
|
|
1876
|
+
t: Ue.STRING,
|
|
1877
|
+
s: { cl: { rgb: B } }
|
|
1878
|
+
};
|
|
1879
|
+
}
|
|
1880
|
+
return {
|
|
1881
|
+
...p,
|
|
1882
|
+
v: R.result,
|
|
1883
|
+
t: Ue.STRING
|
|
1884
|
+
};
|
|
1885
|
+
}
|
|
1886
|
+
return h(p);
|
|
1887
|
+
}
|
|
1888
|
+
})
|
|
1889
|
+
), (d = (u = this._renderManagerService.getRenderById(l.getUnitId())) == null ? void 0 : u.mainComponent) == null || d.makeDirty();
|
|
1890
|
+
})
|
|
1891
|
+
)
|
|
1892
|
+
);
|
|
1893
|
+
}
|
|
1894
|
+
_commandExecutedListener() {
|
|
1895
|
+
const t = [te.id, oe.id];
|
|
1896
|
+
this.disposeWithMe(
|
|
1897
|
+
Te(
|
|
1898
|
+
Yt(
|
|
1899
|
+
new ke((r) => {
|
|
1900
|
+
const n = this._commandService.onCommandExecuted((a) => {
|
|
1901
|
+
if (t.includes(a.id)) {
|
|
1902
|
+
const l = a.params;
|
|
1903
|
+
r.next(l.unitId);
|
|
1904
|
+
}
|
|
1905
|
+
});
|
|
1906
|
+
return () => {
|
|
1907
|
+
n.dispose();
|
|
1908
|
+
};
|
|
1909
|
+
}),
|
|
1910
|
+
this._numfmtService.modelReplace$
|
|
1911
|
+
).pipe(Tr(16)).subscribe((r) => {
|
|
1912
|
+
var n, a;
|
|
1913
|
+
this._sheetSkeletonManagerService.reCalculate(), (a = (n = this._renderManagerService.getRenderById(r)) == null ? void 0 : n.mainComponent) == null || a.makeDirty();
|
|
1914
|
+
})
|
|
1915
|
+
)
|
|
1916
|
+
);
|
|
1917
|
+
}
|
|
1918
|
+
};
|
|
1919
|
+
mt = Ds([
|
|
1920
|
+
je(_e.Rendered, mt),
|
|
1921
|
+
se(0, $(xt)),
|
|
1922
|
+
se(1, $(bn)),
|
|
1923
|
+
se(2, $(we)),
|
|
1924
|
+
se(3, $(ve)),
|
|
1925
|
+
se(4, $(Lt)),
|
|
1926
|
+
se(5, $(Ce)),
|
|
1927
|
+
se(6, $(Be)),
|
|
1928
|
+
se(7, $($r)),
|
|
1929
|
+
se(8, $(ye)),
|
|
1930
|
+
se(9, $(xn)),
|
|
1931
|
+
se(10, $(zr)),
|
|
1932
|
+
se(11, $(me))
|
|
1933
|
+
], mt);
|
|
1934
|
+
var Os = Object.defineProperty, Es = Object.getOwnPropertyDescriptor, Ns = (e, t, r, n) => {
|
|
1935
|
+
for (var a = n > 1 ? void 0 : n ? Es(t, r) : t, l = e.length - 1, u; l >= 0; l--)
|
|
1936
|
+
(u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
|
|
1937
|
+
return n && a && Os(t, r, a), a;
|
|
1938
|
+
}, ct = (e, t) => (r, n) => t(r, n, e);
|
|
1939
|
+
let pt = class extends Me {
|
|
1940
|
+
constructor(t, r, n, a) {
|
|
1941
|
+
super();
|
|
1942
|
+
Ne(this, "_copyInfo");
|
|
1943
|
+
this._sheetClipboardService = t, this._injector = r, this._numfmtService = n, this._univerInstanceService = a, this._initClipboardHook();
|
|
1944
|
+
}
|
|
1945
|
+
_initClipboardHook() {
|
|
1946
|
+
this.disposeWithMe(
|
|
1947
|
+
this._sheetClipboardService.addClipboardHook({
|
|
1948
|
+
id: Qe,
|
|
1949
|
+
onBeforeCopy: (t, r, n) => this._collectNumfmt(t, r, n),
|
|
1950
|
+
onPasteCells: (t, r, n, a) => {
|
|
1951
|
+
const { copyType: l = mn.COPY, pasteType: u } = a, { range: d } = t || {}, { range: p } = r;
|
|
1952
|
+
return this._generateNumfmtMutations(p, { copyType: l, pasteType: u, copyRange: d });
|
|
1953
|
+
}
|
|
1954
|
+
})
|
|
1955
|
+
);
|
|
1956
|
+
}
|
|
1957
|
+
_collectNumfmt(t, r, n) {
|
|
1958
|
+
const a = new yn();
|
|
1959
|
+
this._copyInfo = {
|
|
1960
|
+
matrix: a,
|
|
1961
|
+
info: {
|
|
1962
|
+
unitId: t,
|
|
1963
|
+
subUnitId: r
|
|
2310
1964
|
}
|
|
2311
1965
|
};
|
|
2312
|
-
const l = this._numfmtService.getModel(t,
|
|
1966
|
+
const l = this._numfmtService.getModel(t, r);
|
|
2313
1967
|
l && ne.foreach(n, (u, d) => {
|
|
2314
|
-
const
|
|
2315
|
-
if (!
|
|
1968
|
+
const p = this._numfmtService.getValue(t, r, u, d, l);
|
|
1969
|
+
if (!p)
|
|
2316
1970
|
return;
|
|
2317
|
-
const v =
|
|
1971
|
+
const v = bt.getRelativeRange(
|
|
2318
1972
|
{
|
|
2319
1973
|
startRow: u,
|
|
2320
1974
|
endRow: u,
|
|
@@ -2323,114 +1977,112 @@ let dt = class extends Le {
|
|
|
2323
1977
|
},
|
|
2324
1978
|
n
|
|
2325
1979
|
);
|
|
2326
|
-
|
|
2327
|
-
pattern:
|
|
2328
|
-
type:
|
|
1980
|
+
a.setValue(v.startRow, v.startColumn, {
|
|
1981
|
+
pattern: p.pattern,
|
|
1982
|
+
type: p.type
|
|
2329
1983
|
});
|
|
2330
1984
|
});
|
|
2331
1985
|
}
|
|
2332
|
-
_generateNumfmtMutations(t,
|
|
2333
|
-
const n = this._univerInstanceService.getCurrentUniverSheetInstance(),
|
|
2334
|
-
if (
|
|
1986
|
+
_generateNumfmtMutations(t, r) {
|
|
1987
|
+
const n = this._univerInstanceService.getCurrentUniverSheetInstance(), a = n.getActiveSheet(), l = n.getUnitId(), u = a.getSheetId();
|
|
1988
|
+
if (r.copyType === mn.CUT)
|
|
2335
1989
|
return this._copyInfo = null, { redos: [], undos: [] };
|
|
2336
|
-
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !
|
|
1990
|
+
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !r.copyRange)
|
|
2337
1991
|
return { redos: [], undos: [] };
|
|
2338
|
-
if ([
|
|
2339
|
-
|
|
1992
|
+
if ([pn.SPECIAL_PASTE_COL_WIDTH, pn.SPECIAL_PASTE_VALUE].includes(
|
|
1993
|
+
r.pasteType
|
|
2340
1994
|
))
|
|
2341
1995
|
return { redos: [], undos: [] };
|
|
2342
|
-
const d =
|
|
1996
|
+
const d = Or(r.copyRange, t, !0), p = [], v = { unitId: l, subUnitId: u, ranges: [] }, h = this._numfmtService.getModel(l, u);
|
|
2343
1997
|
ne.foreach(t, (I, D) => {
|
|
2344
1998
|
this._numfmtService.getValue(l, u, I, D, h) && v.ranges.push({ startRow: I, startColumn: D, endRow: I, endColumn: D });
|
|
2345
1999
|
}), d.forEach((I) => {
|
|
2346
|
-
this._copyInfo && this._copyInfo.matrix.forValue((D,
|
|
2347
|
-
const
|
|
2000
|
+
this._copyInfo && this._copyInfo.matrix.forValue((D, E, R) => {
|
|
2001
|
+
const z = bt.getPositionRange(
|
|
2348
2002
|
{
|
|
2349
2003
|
startRow: D,
|
|
2350
2004
|
endRow: D,
|
|
2351
|
-
startColumn:
|
|
2352
|
-
endColumn:
|
|
2005
|
+
startColumn: E,
|
|
2006
|
+
endColumn: E
|
|
2353
2007
|
},
|
|
2354
2008
|
I.startRange
|
|
2355
2009
|
);
|
|
2356
|
-
|
|
2357
|
-
row:
|
|
2358
|
-
col:
|
|
2010
|
+
p.push({
|
|
2011
|
+
row: z.startRow,
|
|
2012
|
+
col: z.startColumn,
|
|
2359
2013
|
pattern: R.pattern,
|
|
2360
2014
|
type: R.type
|
|
2361
2015
|
});
|
|
2362
2016
|
});
|
|
2363
2017
|
});
|
|
2364
|
-
const f =
|
|
2018
|
+
const f = Xe(l, u, p);
|
|
2365
2019
|
Object.keys(f.values).forEach((I) => {
|
|
2366
2020
|
const D = f.values[I];
|
|
2367
|
-
D.ranges =
|
|
2368
|
-
}), v.ranges =
|
|
2021
|
+
D.ranges = Ie(D.ranges);
|
|
2022
|
+
}), v.ranges = Ie(v.ranges);
|
|
2369
2023
|
const b = [
|
|
2370
|
-
...
|
|
2371
|
-
...
|
|
2024
|
+
...et(this._injector, f),
|
|
2025
|
+
...Fe(this._injector, v)
|
|
2372
2026
|
];
|
|
2373
2027
|
return {
|
|
2374
2028
|
redos: [
|
|
2375
|
-
{ id:
|
|
2029
|
+
{ id: te.id, params: v },
|
|
2376
2030
|
{ id: oe.id, params: f }
|
|
2377
2031
|
],
|
|
2378
|
-
undos: b
|
|
2032
|
+
undos: St(b)
|
|
2379
2033
|
};
|
|
2380
2034
|
}
|
|
2381
2035
|
};
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
],
|
|
2389
|
-
var
|
|
2390
|
-
for (var
|
|
2391
|
-
(u = e[l]) && (
|
|
2392
|
-
return n &&
|
|
2393
|
-
},
|
|
2394
|
-
const
|
|
2036
|
+
pt = Ns([
|
|
2037
|
+
je(_e.Rendered, pt),
|
|
2038
|
+
ct(0, $(Er)),
|
|
2039
|
+
ct(1, $(we)),
|
|
2040
|
+
ct(2, $(ye)),
|
|
2041
|
+
ct(3, $(ve))
|
|
2042
|
+
], pt);
|
|
2043
|
+
var ks = Object.defineProperty, Ts = Object.getOwnPropertyDescriptor, Fs = (e, t, r, n) => {
|
|
2044
|
+
for (var a = n > 1 ? void 0 : n ? Ts(t, r) : t, l = e.length - 1, u; l >= 0; l--)
|
|
2045
|
+
(u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
|
|
2046
|
+
return n && a && ks(t, r, a), a;
|
|
2047
|
+
}, qe = (e, t) => (r, n) => t(r, n, e);
|
|
2048
|
+
const $s = () => {
|
|
2395
2049
|
let e = [];
|
|
2396
2050
|
return {
|
|
2397
|
-
add: (
|
|
2051
|
+
add: (a, l, u, d, p) => e.push({ unitId: a, subUnitId: l, row: u, col: d, value: p }),
|
|
2398
2052
|
getEffects: () => e,
|
|
2399
2053
|
clean: () => {
|
|
2400
2054
|
e = [];
|
|
2401
2055
|
}
|
|
2402
2056
|
};
|
|
2403
2057
|
};
|
|
2404
|
-
let
|
|
2405
|
-
constructor(t,
|
|
2058
|
+
let ft = class extends Me {
|
|
2059
|
+
constructor(t, r, n, a, l) {
|
|
2406
2060
|
super();
|
|
2407
2061
|
// collect effect mutations when edit end and push this to commands stack in next commands progress
|
|
2408
|
-
|
|
2409
|
-
this._sheetInterceptorService = t, this._numfmtService =
|
|
2062
|
+
Ne(this, "_collectEffectMutation", $s());
|
|
2063
|
+
this._sheetInterceptorService = t, this._numfmtService = r, this._univerInstanceService = n, this._injector = a, this._editorBridgeService = l, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
|
|
2410
2064
|
}
|
|
2411
2065
|
_initInterceptorEditorStart() {
|
|
2412
2066
|
this.disposeWithMe(
|
|
2413
|
-
|
|
2067
|
+
Te(
|
|
2414
2068
|
this._editorBridgeService.interceptor.intercept(
|
|
2415
2069
|
this._editorBridgeService.interceptor.getInterceptPoints().BEFORE_CELL_EDIT,
|
|
2416
2070
|
{
|
|
2417
|
-
handler: (t,
|
|
2418
|
-
const
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2071
|
+
handler: (t, r, n) => {
|
|
2072
|
+
const a = r.row, l = r.col, u = this._numfmtService.getValue(
|
|
2073
|
+
r.unitId,
|
|
2074
|
+
r.subUnitId,
|
|
2075
|
+
a,
|
|
2422
2076
|
l
|
|
2423
2077
|
);
|
|
2424
2078
|
if (u)
|
|
2425
|
-
switch (
|
|
2079
|
+
switch (Gt(u.pattern)) {
|
|
2426
2080
|
case "scientific":
|
|
2427
2081
|
case "percent":
|
|
2428
2082
|
case "currency":
|
|
2429
2083
|
case "grouped":
|
|
2430
|
-
case "number":
|
|
2431
|
-
|
|
2432
|
-
return m && Gs(m, ["s"]);
|
|
2433
|
-
}
|
|
2084
|
+
case "number":
|
|
2085
|
+
return r.worksheet.getCellRaw(a, l);
|
|
2434
2086
|
case "date":
|
|
2435
2087
|
case "time":
|
|
2436
2088
|
case "datetime":
|
|
@@ -2451,45 +2103,45 @@ let mt = class extends Le {
|
|
|
2451
2103
|
*/
|
|
2452
2104
|
_initInterceptorEditorEnd() {
|
|
2453
2105
|
this.disposeWithMe(
|
|
2454
|
-
|
|
2106
|
+
Te(
|
|
2455
2107
|
this._editorBridgeService.interceptor.intercept(
|
|
2456
2108
|
this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,
|
|
2457
2109
|
{
|
|
2458
|
-
handler: (t,
|
|
2110
|
+
handler: (t, r, n) => {
|
|
2459
2111
|
this._collectEffectMutation.clean();
|
|
2460
|
-
const
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2112
|
+
const a = this._numfmtService.getValue(
|
|
2113
|
+
r.unitId,
|
|
2114
|
+
r.subUnitId,
|
|
2115
|
+
r.row,
|
|
2116
|
+
r.col
|
|
2465
2117
|
), l = () => {
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2118
|
+
a && this._collectEffectMutation.add(
|
|
2119
|
+
r.unitId,
|
|
2120
|
+
r.subUnitId,
|
|
2121
|
+
r.row,
|
|
2122
|
+
r.col,
|
|
2471
2123
|
null
|
|
2472
2124
|
);
|
|
2473
2125
|
};
|
|
2474
2126
|
if (!(t != null && t.v))
|
|
2475
2127
|
return n(t);
|
|
2476
|
-
const u = String(t.v), d =
|
|
2128
|
+
const u = String(t.v), d = ge.parseDate(u) || ge.parseTime(u);
|
|
2477
2129
|
if (!!d) {
|
|
2478
2130
|
if (d && d.z) {
|
|
2479
2131
|
const v = Number(d.v);
|
|
2480
2132
|
return this._collectEffectMutation.add(
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2133
|
+
r.unitId,
|
|
2134
|
+
r.subUnitId,
|
|
2135
|
+
r.row,
|
|
2136
|
+
r.col,
|
|
2485
2137
|
{
|
|
2486
2138
|
type: "date",
|
|
2487
2139
|
pattern: d.z
|
|
2488
2140
|
}
|
|
2489
|
-
), { ...t, v, t:
|
|
2141
|
+
), { ...t, v, t: Ue.NUMBER };
|
|
2490
2142
|
}
|
|
2491
2143
|
} else
|
|
2492
|
-
(["date", "time", "datetime"].includes((
|
|
2144
|
+
(["date", "time", "datetime"].includes((a == null ? void 0 : a.type) || "") || !As(u)) && l();
|
|
2493
2145
|
return n(t);
|
|
2494
2146
|
}
|
|
2495
2147
|
}
|
|
@@ -2501,10 +2153,10 @@ let mt = class extends Le {
|
|
|
2501
2153
|
const t = this;
|
|
2502
2154
|
this.disposeWithMe(
|
|
2503
2155
|
this._sheetInterceptorService.interceptCommand({
|
|
2504
|
-
getMutations(
|
|
2505
|
-
switch (
|
|
2506
|
-
case
|
|
2507
|
-
const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(),
|
|
2156
|
+
getMutations(r) {
|
|
2157
|
+
switch (r.id) {
|
|
2158
|
+
case pr.id: {
|
|
2159
|
+
const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), a = t._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), l = t._collectEffectMutation.getEffects();
|
|
2508
2160
|
if (!l.length)
|
|
2509
2161
|
return {
|
|
2510
2162
|
redos: [],
|
|
@@ -2526,27 +2178,27 @@ let mt = class extends Le {
|
|
|
2526
2178
|
endColumn: h.col,
|
|
2527
2179
|
startColumn: h.col,
|
|
2528
2180
|
endRow: h.row
|
|
2529
|
-
})),
|
|
2181
|
+
})), p = [], v = [];
|
|
2530
2182
|
if (u) {
|
|
2531
2183
|
const h = {
|
|
2532
2184
|
id: oe.id,
|
|
2533
|
-
params:
|
|
2185
|
+
params: Xe(n, a, u)
|
|
2534
2186
|
};
|
|
2535
|
-
|
|
2187
|
+
p.push(h), v.push(...et(t._injector, h.params));
|
|
2536
2188
|
}
|
|
2537
2189
|
if (d) {
|
|
2538
2190
|
const h = {
|
|
2539
|
-
id:
|
|
2191
|
+
id: te.id,
|
|
2540
2192
|
params: {
|
|
2541
2193
|
unitId: n,
|
|
2542
|
-
subUnitId:
|
|
2194
|
+
subUnitId: a,
|
|
2543
2195
|
ranges: d
|
|
2544
2196
|
}
|
|
2545
2197
|
};
|
|
2546
|
-
|
|
2198
|
+
p.push(h), v.push(...Fe(t._injector, h.params));
|
|
2547
2199
|
}
|
|
2548
2200
|
return {
|
|
2549
|
-
redos:
|
|
2201
|
+
redos: p,
|
|
2550
2202
|
undos: v.reverse()
|
|
2551
2203
|
};
|
|
2552
2204
|
}
|
|
@@ -2560,201 +2212,582 @@ let mt = class extends Le {
|
|
|
2560
2212
|
);
|
|
2561
2213
|
}
|
|
2562
2214
|
};
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
],
|
|
2571
|
-
|
|
2572
|
-
(n, i) => (n[i] = e[i], n),
|
|
2573
|
-
{}
|
|
2574
|
-
);
|
|
2575
|
-
function Ks(e) {
|
|
2215
|
+
ft = Fs([
|
|
2216
|
+
je(_e.Rendered, ft),
|
|
2217
|
+
qe(0, $(xt)),
|
|
2218
|
+
qe(1, $(ye)),
|
|
2219
|
+
qe(2, $(ve)),
|
|
2220
|
+
qe(3, $(we)),
|
|
2221
|
+
qe(4, $(Nr))
|
|
2222
|
+
], ft);
|
|
2223
|
+
function As(e) {
|
|
2576
2224
|
return /^-?\d+(\.\d+)?$/.test(e);
|
|
2577
2225
|
}
|
|
2578
|
-
var
|
|
2579
|
-
for (var
|
|
2580
|
-
(u = e[l]) && (
|
|
2581
|
-
return n &&
|
|
2582
|
-
},
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2226
|
+
var zs = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, Ls = (e, t, r, n) => {
|
|
2227
|
+
for (var a = n > 1 ? void 0 : n ? Us(t, r) : t, l = e.length - 1, u; l >= 0; l--)
|
|
2228
|
+
(u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
|
|
2229
|
+
return n && a && zs(t, r, a), a;
|
|
2230
|
+
}, Ys = (e, t) => (r, n) => t(r, n, e);
|
|
2231
|
+
let ht = class extends Me {
|
|
2232
|
+
constructor(t) {
|
|
2233
|
+
super();
|
|
2234
|
+
Ne(this, "_initLocal", () => {
|
|
2235
|
+
this._localeService.load({ zhCN: Vr });
|
|
2236
|
+
});
|
|
2237
|
+
this._localeService = t, this._initLocal();
|
|
2238
|
+
}
|
|
2239
|
+
};
|
|
2240
|
+
ht = Ls([
|
|
2241
|
+
je(_e.Rendered, ht),
|
|
2242
|
+
Ys(0, $(me))
|
|
2243
|
+
], ht);
|
|
2244
|
+
var ae = function() {
|
|
2245
|
+
return ae = Object.assign || function(e) {
|
|
2246
|
+
for (var t, r = 1, n = arguments.length; r < n; r++) {
|
|
2247
|
+
t = arguments[r];
|
|
2248
|
+
for (var a in t)
|
|
2249
|
+
Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
|
|
2250
|
+
}
|
|
2251
|
+
return e;
|
|
2252
|
+
}, ae.apply(this, arguments);
|
|
2253
|
+
}, Bs = function(e, t) {
|
|
2254
|
+
var r = {};
|
|
2255
|
+
for (var n in e)
|
|
2256
|
+
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
2257
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
2258
|
+
for (var a = 0, n = Object.getOwnPropertySymbols(e); a < n.length; a++)
|
|
2259
|
+
t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (r[n[a]] = e[n[a]]);
|
|
2260
|
+
return r;
|
|
2261
|
+
}, rt = tt(function(e, t) {
|
|
2262
|
+
var r = e.icon, n = e.id, a = e.className, l = e.extend, u = Bs(e, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(n, " ").concat(a || "").trim(), p = Ht("_".concat(Js()));
|
|
2263
|
+
return $n(r, "".concat(n), { defIds: r.defIds, idSuffix: p.current }, ae({ ref: t, className: d }, u), l);
|
|
2264
|
+
});
|
|
2265
|
+
function $n(e, t, r, n, a) {
|
|
2266
|
+
return He(e.tag, ae(ae({ key: t }, Hs(e, r, a)), n), (Vs(e, r).children || []).map(function(l, u) {
|
|
2267
|
+
return $n(l, "".concat(t, "-").concat(e.tag, "-").concat(u), r, void 0, a);
|
|
2268
|
+
}));
|
|
2269
|
+
}
|
|
2270
|
+
function Hs(e, t, r) {
|
|
2271
|
+
var n = ae({}, e.attrs);
|
|
2272
|
+
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
|
|
2273
|
+
var a = t.defIds;
|
|
2274
|
+
return !a || a.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(l) {
|
|
2275
|
+
var u = l[0], d = l[1];
|
|
2276
|
+
typeof d == "string" && (n[u] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
2277
|
+
})), n;
|
|
2278
|
+
}
|
|
2279
|
+
function Vs(e, t) {
|
|
2280
|
+
var r, n = t.defIds;
|
|
2281
|
+
return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ? ae(ae({}, e), { children: e.children.map(function(a) {
|
|
2282
|
+
return typeof a.attrs.id == "string" && n && n.indexOf(a.attrs.id) > -1 ? ae(ae({}, a), { attrs: ae(ae({}, a.attrs), { id: a.attrs.id + t.idSuffix }) }) : a;
|
|
2283
|
+
}) }) : e;
|
|
2284
|
+
}
|
|
2285
|
+
function Js() {
|
|
2286
|
+
return Math.random().toString(36).substring(2, 8);
|
|
2287
|
+
}
|
|
2288
|
+
rt.displayName = "UniverIcon";
|
|
2289
|
+
var Ws = {
|
|
2290
|
+
tag: "svg",
|
|
2291
|
+
attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
|
|
2292
|
+
children: [
|
|
2293
|
+
{
|
|
2294
|
+
tag: "path",
|
|
2295
|
+
attrs: {
|
|
2296
|
+
fill: "currentColor",
|
|
2297
|
+
d: "M4.93 3.83a2.33 2.33 0 014.67 0v2.64a2.33 2.33 0 01-4.67 0V3.83zm2.33-1a1 1 0 00-1 1v2.64a1 1 0 002 0V3.83a1 1 0 00-1-1zM10.93 3.83a2.33 2.33 0 014.67 0v2.64a2.33 2.33 0 01-4.67 0V3.83zm2.33-1a1 1 0 00-1 1v2.64a1 1 0 102 0V3.83a1 1 0 00-1-1z",
|
|
2298
|
+
fillRule: "evenodd",
|
|
2299
|
+
clipRule: "evenodd"
|
|
2300
|
+
}
|
|
2301
|
+
},
|
|
2302
|
+
{
|
|
2303
|
+
tag: "path",
|
|
2304
|
+
attrs: {
|
|
2305
|
+
fill: "currentColor",
|
|
2306
|
+
d: "M13.4 9.81a.67.67 0 00-.94.94l.86.87H7.26a.67.67 0 100 1.33h6.06l-.86.86a.67.67 0 10.94.94l2-2a.67.67 0 000-.94l-2-2zM2.26 8.21c0-.36.3-.66.67-.66h.33a.67.67 0 010 1.33h-.33a.67.67 0 01-.67-.67z"
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
]
|
|
2310
|
+
}, An = tt(function(e, t) {
|
|
2311
|
+
return He(rt, Object.assign({}, e, {
|
|
2312
|
+
id: "add-digits-single",
|
|
2313
|
+
ref: t,
|
|
2314
|
+
icon: Ws
|
|
2315
|
+
}));
|
|
2316
|
+
});
|
|
2317
|
+
An.displayName = "AddDigitsSingle";
|
|
2318
|
+
const Gs = An;
|
|
2319
|
+
var Ks = {
|
|
2320
|
+
tag: "svg",
|
|
2321
|
+
attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
|
|
2322
|
+
children: [
|
|
2323
|
+
{
|
|
2324
|
+
tag: "mask",
|
|
2325
|
+
attrs: {
|
|
2326
|
+
id: "mask0_102_556",
|
|
2327
|
+
style: { "mask-type": "alpha" },
|
|
2328
|
+
width: 17,
|
|
2329
|
+
height: 17,
|
|
2330
|
+
x: 0,
|
|
2331
|
+
y: 0,
|
|
2332
|
+
maskUnits: "userSpaceOnUse"
|
|
2333
|
+
},
|
|
2334
|
+
children: [
|
|
2335
|
+
{ tag: "path", attrs: { fill: "#D9D9D9", d: "M.56.77h16v16h-16z" } }
|
|
2336
|
+
]
|
|
2337
|
+
},
|
|
2338
|
+
{
|
|
2339
|
+
tag: "g",
|
|
2340
|
+
attrs: { mask: "url(#mask0_102_556)" },
|
|
2341
|
+
children: [
|
|
2342
|
+
{
|
|
2343
|
+
tag: "path",
|
|
2344
|
+
attrs: {
|
|
2345
|
+
fill: "currentColor",
|
|
2346
|
+
d: "M1.2 4.77c.5-.5 1.32-.5 1.83 0l5.1 5.1a.6.6 0 00.86 0l5.1-5.1a1.3 1.3 0 011.84 1.84l-5.95 5.96a2 2 0 01-2.83 0L1.19 6.6a1.3 1.3 0 010-1.84z",
|
|
2347
|
+
fillRule: "evenodd",
|
|
2348
|
+
clipRule: "evenodd"
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
]
|
|
2352
|
+
}
|
|
2353
|
+
]
|
|
2354
|
+
}, zn = tt(function(e, t) {
|
|
2355
|
+
return He(rt, Object.assign({}, e, {
|
|
2356
|
+
id: "more-down-single",
|
|
2357
|
+
ref: t,
|
|
2358
|
+
icon: Ks
|
|
2359
|
+
}));
|
|
2360
|
+
});
|
|
2361
|
+
zn.displayName = "MoreDownSingle";
|
|
2362
|
+
const qs = zn;
|
|
2363
|
+
var Zs = {
|
|
2364
|
+
tag: "svg",
|
|
2365
|
+
attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
|
|
2366
|
+
children: [
|
|
2367
|
+
{
|
|
2368
|
+
tag: "path",
|
|
2369
|
+
attrs: {
|
|
2370
|
+
fill: "currentColor",
|
|
2371
|
+
d: "M5.13 3.84a2.33 2.33 0 014.67 0v2.7a2.33 2.33 0 01-4.67 0v-2.7zm2.34-1a1 1 0 00-1 1v2.7a1 1 0 002 0v-2.7a1 1 0 00-1-1z",
|
|
2372
|
+
fillRule: "evenodd",
|
|
2373
|
+
clipRule: "evenodd"
|
|
2374
|
+
}
|
|
2375
|
+
},
|
|
2376
|
+
{
|
|
2377
|
+
tag: "path",
|
|
2378
|
+
attrs: {
|
|
2379
|
+
fill: "currentColor",
|
|
2380
|
+
d: "M2.13 8.2c0-.37.3-.67.67-.67h.33a.67.67 0 010 1.34H2.8a.67.67 0 01-.67-.67zM8.94 9.79c.26.26.26.68 0 .94l-.86.86h5.39a.67.67 0 010 1.34h-5.4l.87.86a.67.67 0 11-.95.94l-2-2a.66.66 0 010-.94l2-2a.67.67 0 01.95 0z"
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
]
|
|
2384
|
+
}, Un = tt(function(e, t) {
|
|
2385
|
+
return He(rt, Object.assign({}, e, {
|
|
2386
|
+
id: "reduce-digits-single",
|
|
2387
|
+
ref: t,
|
|
2388
|
+
icon: Zs
|
|
2389
|
+
}));
|
|
2390
|
+
});
|
|
2391
|
+
Un.displayName = "ReduceDigitsSingle";
|
|
2392
|
+
const Qs = Un;
|
|
2393
|
+
var Xs = {
|
|
2394
|
+
tag: "svg",
|
|
2395
|
+
attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
|
|
2396
|
+
children: [
|
|
2397
|
+
{
|
|
2398
|
+
tag: "path",
|
|
2399
|
+
attrs: {
|
|
2400
|
+
fill: "currentColor",
|
|
2401
|
+
d: "M4.65 1.78c.3-.23.7-.17.93.13l3.01 4.3 3.01-4.3a.67.67 0 011.07.8L9.93 6.65h2.74a.67.67 0 110 1.33H9.26v1.94h3.67a.67.67 0 010 1.33H9.26v2.88a.67.67 0 01-1.33 0v-2.88H4.26a.67.67 0 010-1.33h3.67V7.98H4.5a.67.67 0 010-1.33h2.75L4.5 2.7a.67.67 0 01.14-.93z"
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
]
|
|
2405
|
+
}, Ln = tt(function(e, t) {
|
|
2406
|
+
return He(rt, Object.assign({}, e, {
|
|
2407
|
+
id: "rmb-single",
|
|
2408
|
+
ref: t,
|
|
2409
|
+
icon: Xs
|
|
2410
|
+
}));
|
|
2411
|
+
});
|
|
2412
|
+
Ln.displayName = "RmbSingle";
|
|
2413
|
+
const ea = Ln, gt = [
|
|
2414
|
+
{
|
|
2415
|
+
label: "sheet.numfmt.general",
|
|
2416
|
+
pattern: null
|
|
2417
|
+
},
|
|
2418
|
+
{
|
|
2419
|
+
label: "sheet.numfmt.text",
|
|
2420
|
+
pattern: "@@@"
|
|
2421
|
+
},
|
|
2422
|
+
"|",
|
|
2423
|
+
{
|
|
2424
|
+
label: "sheet.numfmt.number",
|
|
2425
|
+
pattern: "0"
|
|
2426
|
+
},
|
|
2427
|
+
"|",
|
|
2428
|
+
{
|
|
2429
|
+
label: "sheet.numfmt.accounting",
|
|
2430
|
+
pattern: '"¥" #,##0.00_);[Red]("¥"#,##0.00)'
|
|
2431
|
+
},
|
|
2432
|
+
{
|
|
2433
|
+
label: "sheet.numfmt.financialValue",
|
|
2434
|
+
pattern: "#,##0.00;[Red]#,##0.00"
|
|
2435
|
+
},
|
|
2436
|
+
{
|
|
2437
|
+
label: "sheet.numfmt.currency",
|
|
2438
|
+
pattern: '"¥"#,##0.00_);[Red]("¥"#,##0.00)'
|
|
2439
|
+
},
|
|
2440
|
+
{
|
|
2441
|
+
label: "sheet.numfmt.roundingCurrency",
|
|
2442
|
+
pattern: '"¥"#,##0;[Red]"¥"#,##0'
|
|
2443
|
+
},
|
|
2444
|
+
"|",
|
|
2445
|
+
{
|
|
2446
|
+
label: "sheet.numfmt.date",
|
|
2447
|
+
pattern: "yyyy-mm-dd;@"
|
|
2448
|
+
},
|
|
2449
|
+
{
|
|
2450
|
+
label: "sheet.numfmt.time",
|
|
2451
|
+
pattern: 'am/pm h":"mm":"ss'
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
label: "sheet.numfmt.dateTime",
|
|
2455
|
+
pattern: "yyyy-m-d am/pm h:mm"
|
|
2456
|
+
},
|
|
2457
|
+
{
|
|
2458
|
+
label: "sheet.numfmt.timeDuration",
|
|
2459
|
+
pattern: "h:mm:ss"
|
|
2460
|
+
},
|
|
2461
|
+
"|",
|
|
2462
|
+
{
|
|
2463
|
+
label: "sheet.numfmt.moreFmt",
|
|
2464
|
+
pattern: ""
|
|
2465
|
+
}
|
|
2466
|
+
], ta = (e) => {
|
|
2467
|
+
const t = de(me), r = e.value ?? t.t("sheet.numfmt.general");
|
|
2468
|
+
return /* @__PURE__ */ O.jsx("span", { className: "more-numfmt-type", children: r });
|
|
2469
|
+
}, na = () => {
|
|
2470
|
+
const e = de(Ce), t = de(me), r = Hr(), n = de(Be), a = (d) => {
|
|
2471
|
+
const p = n.getLast();
|
|
2472
|
+
if (!p)
|
|
2473
|
+
return;
|
|
2474
|
+
const v = r.get(Ar), h = p.range, f = [];
|
|
2475
|
+
ne.foreach(h, (b, I) => {
|
|
2476
|
+
d ? f.push({ row: b, col: I, pattern: d, type: Gt(d) }) : f.push({ row: b, col: I });
|
|
2477
|
+
}), e.executeCommand(Le.id, { values: f }), v.focus();
|
|
2478
|
+
}, l = (d) => {
|
|
2479
|
+
if (d === 0)
|
|
2480
|
+
a(null);
|
|
2481
|
+
else if (d === gt.length - 1)
|
|
2482
|
+
e.executeCommand(Ct.id);
|
|
2483
|
+
else {
|
|
2484
|
+
const p = gt[d];
|
|
2485
|
+
p.pattern && a(p.pattern);
|
|
2486
|
+
}
|
|
2487
|
+
}, u = 1220;
|
|
2488
|
+
return /* @__PURE__ */ O.jsx("div", { className: "more-numfmt-type-options", children: gt.map((d, p) => d === "|" ? /* @__PURE__ */ O.jsx("div", { className: "line m-t-4", onClick: (v) => v.stopPropagation() }, p) : /* @__PURE__ */ O.jsxs(
|
|
2489
|
+
"div",
|
|
2490
|
+
{
|
|
2491
|
+
className: "option-item m-t-4",
|
|
2492
|
+
onClick: () => {
|
|
2493
|
+
l(p);
|
|
2494
|
+
},
|
|
2495
|
+
children: [
|
|
2496
|
+
/* @__PURE__ */ O.jsx("div", { children: t.t(d.label) }),
|
|
2497
|
+
/* @__PURE__ */ O.jsx("div", { className: "m-l-26", children: d.pattern ? ge.format(d.pattern || "", u, { locale: "zh-CN" }) : "" })
|
|
2498
|
+
]
|
|
2499
|
+
},
|
|
2500
|
+
p
|
|
2501
|
+
)) });
|
|
2502
|
+
}, ra = (e) => {
|
|
2503
|
+
const t = "icon-rmbSingle";
|
|
2504
|
+
return e.register(t, ea), e.register("MoreDownSingle", qs), (r) => ({
|
|
2505
|
+
icon: t,
|
|
2506
|
+
id: On.id,
|
|
2507
|
+
title: "sheet.numfmt.currency",
|
|
2508
|
+
tooltip: "sheet.numfmt.currency",
|
|
2509
|
+
type: Rt.BUTTON,
|
|
2510
|
+
group: wt.TOOLBAR_FORMULAS_INSERT,
|
|
2511
|
+
positions: [Pt.TOOLBAR_START],
|
|
2512
|
+
hidden$: Dt(r, jt.SHEET),
|
|
2513
|
+
disabled$: It(r)
|
|
2514
|
+
});
|
|
2515
|
+
}, sa = (e) => {
|
|
2516
|
+
const t = "icon-addDigitsSingle";
|
|
2517
|
+
return e.register(t, Gs), (r) => ({
|
|
2518
|
+
icon: t,
|
|
2519
|
+
id: Pn.id,
|
|
2520
|
+
title: "sheet.numfmt.addDecimal",
|
|
2521
|
+
tooltip: "sheet.numfmt.addDecimal",
|
|
2522
|
+
type: Rt.BUTTON,
|
|
2523
|
+
positions: [Pt.TOOLBAR_START],
|
|
2524
|
+
group: wt.TOOLBAR_FORMULAS_INSERT,
|
|
2525
|
+
hidden$: Dt(r, jt.SHEET),
|
|
2526
|
+
disabled$: It(r)
|
|
2527
|
+
});
|
|
2528
|
+
}, aa = (e) => {
|
|
2529
|
+
const t = "icon-reduceDigitsSingle";
|
|
2530
|
+
return e.register(t, Qs), (r) => ({
|
|
2531
|
+
icon: t,
|
|
2532
|
+
id: En.id,
|
|
2533
|
+
title: "sheet.numfmt.subtractDecimal",
|
|
2534
|
+
tooltip: "sheet.numfmt.subtractDecimal",
|
|
2535
|
+
type: Rt.BUTTON,
|
|
2536
|
+
group: wt.TOOLBAR_FORMULAS_INSERT,
|
|
2537
|
+
positions: [Pt.TOOLBAR_START],
|
|
2538
|
+
hidden$: Dt(r, jt.SHEET),
|
|
2539
|
+
disabled$: It(r)
|
|
2540
|
+
});
|
|
2541
|
+
}, ia = (e) => {
|
|
2542
|
+
const t = "sheet.numfmt.moreNumfmtType", r = "sheet.numfmt.moreNumfmtType.options";
|
|
2543
|
+
return e.register(t, ta), e.register(r, na), (n) => {
|
|
2544
|
+
const a = n.get(ye), l = n.get(ve), u = n.get(Ce), d = n.get(me), p = n.get(Be), v = new ke(
|
|
2545
|
+
(h) => Yt(
|
|
2546
|
+
p.selectionMoveEnd$,
|
|
2547
|
+
new ke((f) => {
|
|
2548
|
+
const b = [te.id, oe.id], I = u.onCommandExecuted((D) => {
|
|
2549
|
+
b.includes(D.id) && f.next(null);
|
|
2550
|
+
});
|
|
2551
|
+
return () => I.dispose();
|
|
2552
|
+
})
|
|
2553
|
+
).subscribe(() => {
|
|
2554
|
+
const f = p.getSelections();
|
|
2555
|
+
if (f && f[0]) {
|
|
2556
|
+
const b = l.getCurrentUniverSheetInstance(), I = b.getActiveSheet(), D = f[0].range, E = D.startRow, R = D.startColumn, z = a.getValue(b.getUnitId(), I.getSheetId(), E, R);
|
|
2557
|
+
let B = d.t("sheet.numfmt.general");
|
|
2558
|
+
if (z) {
|
|
2559
|
+
const W = z.pattern, Q = gt.filter((pe) => typeof pe == "object" && pe.pattern).find(
|
|
2560
|
+
(pe) => Ve(W, pe.pattern)
|
|
2561
|
+
);
|
|
2562
|
+
Q && typeof Q == "object" && Q.pattern ? B = d.t(Q.label) : B = d.t("sheet.numfmt.moreFmt");
|
|
2563
|
+
}
|
|
2564
|
+
h.next(B);
|
|
2565
|
+
}
|
|
2566
|
+
})
|
|
2567
|
+
);
|
|
2568
|
+
return {
|
|
2569
|
+
// icon: 'MoreDownSingle',
|
|
2570
|
+
label: t,
|
|
2571
|
+
id: Ct.id,
|
|
2572
|
+
tooltip: "sheet.numfmt.title",
|
|
2573
|
+
type: Rt.SELECTOR,
|
|
2574
|
+
group: wt.TOOLBAR_FORMULAS_INSERT,
|
|
2575
|
+
positions: [Pt.TOOLBAR_START],
|
|
2576
|
+
selections: [
|
|
2577
|
+
{
|
|
2578
|
+
label: {
|
|
2579
|
+
name: r,
|
|
2580
|
+
hoverable: !1
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
],
|
|
2584
|
+
value$: v,
|
|
2585
|
+
hidden$: Dt(n, jt.SHEET),
|
|
2586
|
+
disabled$: It(n)
|
|
2587
|
+
};
|
|
2588
|
+
};
|
|
2589
|
+
};
|
|
2590
|
+
var oa = Object.defineProperty, ca = Object.getOwnPropertyDescriptor, la = (e, t, r, n) => {
|
|
2591
|
+
for (var a = n > 1 ? void 0 : n ? ca(t, r) : t, l = e.length - 1, u; l >= 0; l--)
|
|
2592
|
+
(u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
|
|
2593
|
+
return n && a && oa(t, r, a), a;
|
|
2594
|
+
}, At = (e, t) => (r, n) => t(r, n, e);
|
|
2595
|
+
let vt = class extends Me {
|
|
2596
|
+
constructor(e, t, r) {
|
|
2597
|
+
super(), this._injector = e, this._componentManager = t, this._menuService = r, this._initMenu();
|
|
2598
|
+
}
|
|
2599
|
+
_initMenu() {
|
|
2600
|
+
[sa, aa, ra, ia].map((e) => e(this._componentManager)).forEach((e) => {
|
|
2601
|
+
this.disposeWithMe(this._menuService.addMenuItem(e(this._injector)));
|
|
2602
|
+
});
|
|
2603
|
+
}
|
|
2604
|
+
};
|
|
2605
|
+
vt = la([
|
|
2606
|
+
je(_e.Rendered, vt),
|
|
2607
|
+
At(0, $(we)),
|
|
2608
|
+
At(1, $(xn)),
|
|
2609
|
+
At(2, $(Ur))
|
|
2610
|
+
], vt);
|
|
2611
|
+
var ua = Object.defineProperty, da = Object.getOwnPropertyDescriptor, ma = (e, t, r, n) => {
|
|
2612
|
+
for (var a = n > 1 ? void 0 : n ? da(t, r) : t, l = e.length - 1, u; l >= 0; l--)
|
|
2613
|
+
(u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
|
|
2614
|
+
return n && a && ua(t, r, a), a;
|
|
2615
|
+
}, ze = (e, t) => (r, n) => t(r, n, e);
|
|
2616
|
+
const pa = [oe.id, te.id];
|
|
2617
|
+
let _t = class extends Me {
|
|
2618
|
+
constructor(e, t, r, n, a, l) {
|
|
2619
|
+
super(), this._numfmtService = e, this._univerInstanceService = t, this._injector = r, this._refRangeService = n, this._sheetSkeletonManagerService = a, this._commandService = l, this._registerRefRange(), this._mergeRefMutations();
|
|
2587
2620
|
}
|
|
2588
2621
|
_mergeRefMutations() {
|
|
2589
2622
|
this._refRangeService.interceptor.intercept(this._refRangeService.interceptor.getInterceptPoints().MERGE_REDO, {
|
|
2590
|
-
handler: (e, t,
|
|
2623
|
+
handler: (e, t, r) => {
|
|
2591
2624
|
if (!e)
|
|
2592
|
-
return
|
|
2593
|
-
const n = e.filter((
|
|
2594
|
-
return n.push(...
|
|
2625
|
+
return r(e);
|
|
2626
|
+
const n = e.filter((a) => !pa.includes(a.id));
|
|
2627
|
+
return n.push(...St(e)), r(n);
|
|
2595
2628
|
}
|
|
2596
2629
|
});
|
|
2597
2630
|
}
|
|
2598
2631
|
_registerRefRange() {
|
|
2599
2632
|
this.disposeWithMe(
|
|
2600
|
-
|
|
2601
|
-
|
|
2633
|
+
Te(
|
|
2634
|
+
Yt(
|
|
2602
2635
|
this._sheetSkeletonManagerService.currentSkeleton$.pipe(
|
|
2603
2636
|
Ze((e) => e == null ? void 0 : e.sheetId),
|
|
2604
|
-
|
|
2637
|
+
Mn()
|
|
2605
2638
|
),
|
|
2606
2639
|
this._numfmtService.modelReplace$
|
|
2607
2640
|
).pipe(
|
|
2608
|
-
|
|
2609
|
-
() => new
|
|
2610
|
-
const t = new
|
|
2641
|
+
jn(
|
|
2642
|
+
() => new ke((e) => {
|
|
2643
|
+
const t = new Sn();
|
|
2611
2644
|
return e.next(t), () => {
|
|
2612
2645
|
t.dispose();
|
|
2613
2646
|
};
|
|
2614
2647
|
})
|
|
2615
2648
|
)
|
|
2616
2649
|
).subscribe((e) => {
|
|
2617
|
-
const
|
|
2650
|
+
const r = this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), n = this._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), a = this._numfmtService.getModel(r, n), l = /* @__PURE__ */ new Map(), u = (d, p, v) => {
|
|
2618
2651
|
const h = {
|
|
2619
|
-
startRow:
|
|
2652
|
+
startRow: p,
|
|
2620
2653
|
startColumn: v,
|
|
2621
|
-
endRow:
|
|
2654
|
+
endRow: p,
|
|
2622
2655
|
endColumn: v
|
|
2623
2656
|
};
|
|
2624
2657
|
let f = [];
|
|
2625
2658
|
switch (d.id) {
|
|
2626
2659
|
case ue.DeleteRangeMoveLeftCommandId: {
|
|
2627
|
-
f =
|
|
2660
|
+
f = xr(d, h);
|
|
2628
2661
|
break;
|
|
2629
2662
|
}
|
|
2630
2663
|
case ue.DeleteRangeMoveUpCommandId: {
|
|
2631
|
-
f =
|
|
2664
|
+
f = jr(d, h);
|
|
2632
2665
|
break;
|
|
2633
2666
|
}
|
|
2634
2667
|
case ue.InsertColCommandId: {
|
|
2635
|
-
f =
|
|
2668
|
+
f = Mr(d, h);
|
|
2636
2669
|
break;
|
|
2637
2670
|
}
|
|
2638
2671
|
case ue.InsertRangeMoveDownCommandId: {
|
|
2639
|
-
f =
|
|
2672
|
+
f = Cr(d, h);
|
|
2640
2673
|
break;
|
|
2641
2674
|
}
|
|
2642
2675
|
case ue.InsertRangeMoveRightCommandId: {
|
|
2643
|
-
f =
|
|
2676
|
+
f = Sr(d, h);
|
|
2644
2677
|
break;
|
|
2645
2678
|
}
|
|
2646
2679
|
case ue.InsertRowCommandId: {
|
|
2647
|
-
f =
|
|
2680
|
+
f = br(d, h);
|
|
2648
2681
|
break;
|
|
2649
2682
|
}
|
|
2650
2683
|
case ue.MoveRangeCommandId: {
|
|
2651
|
-
f =
|
|
2684
|
+
f = yr(d, h);
|
|
2652
2685
|
break;
|
|
2653
2686
|
}
|
|
2654
2687
|
case ue.RemoveColCommandId: {
|
|
2655
|
-
f =
|
|
2688
|
+
f = _r(d, h);
|
|
2656
2689
|
break;
|
|
2657
2690
|
}
|
|
2658
2691
|
case ue.RemoveRowCommandId: {
|
|
2659
|
-
f =
|
|
2692
|
+
f = vr(d, h);
|
|
2660
2693
|
break;
|
|
2661
2694
|
}
|
|
2662
2695
|
case ue.MoveColsCommandId: {
|
|
2663
|
-
f =
|
|
2696
|
+
f = gr(d, h);
|
|
2664
2697
|
break;
|
|
2665
2698
|
}
|
|
2666
2699
|
case ue.MoveRowsCommandId:
|
|
2667
|
-
f =
|
|
2700
|
+
f = hr(d, h);
|
|
2668
2701
|
}
|
|
2669
|
-
const b =
|
|
2702
|
+
const b = Ir(f, h), I = this._numfmtService.getValue(r, n, p, v);
|
|
2670
2703
|
if (!b && I) {
|
|
2671
2704
|
const D = {
|
|
2672
|
-
id:
|
|
2705
|
+
id: te.id,
|
|
2673
2706
|
params: {
|
|
2674
|
-
unitId:
|
|
2707
|
+
unitId: r,
|
|
2675
2708
|
subUnitId: n,
|
|
2676
|
-
ranges: [{ startColumn: v, startRow:
|
|
2709
|
+
ranges: [{ startColumn: v, startRow: p, endColumn: v, endRow: p }]
|
|
2677
2710
|
}
|
|
2678
|
-
},
|
|
2711
|
+
}, E = Fe(this._injector, D.params);
|
|
2679
2712
|
return {
|
|
2680
2713
|
redos: [D],
|
|
2681
|
-
undos:
|
|
2714
|
+
undos: E
|
|
2682
2715
|
};
|
|
2683
2716
|
}
|
|
2684
2717
|
if (I && b) {
|
|
2685
|
-
const D = [],
|
|
2718
|
+
const D = [], E = [], R = [
|
|
2686
2719
|
{
|
|
2687
2720
|
pattern: I.pattern,
|
|
2688
2721
|
type: I.type,
|
|
2689
2722
|
row: b.startRow,
|
|
2690
2723
|
col: b.startColumn
|
|
2691
2724
|
}
|
|
2692
|
-
],
|
|
2725
|
+
], z = {
|
|
2693
2726
|
id: oe.id,
|
|
2694
|
-
params:
|
|
2695
|
-
},
|
|
2696
|
-
id:
|
|
2727
|
+
params: Xe(r, n, R)
|
|
2728
|
+
}, B = et(this._injector, z.params), W = {
|
|
2729
|
+
id: te.id,
|
|
2697
2730
|
params: {
|
|
2698
|
-
unitId:
|
|
2731
|
+
unitId: r,
|
|
2699
2732
|
subUnitId: n,
|
|
2700
|
-
ranges: [{ startColumn: v, startRow:
|
|
2733
|
+
ranges: [{ startColumn: v, startRow: p, endColumn: v, endRow: p }]
|
|
2701
2734
|
}
|
|
2702
|
-
}, Q =
|
|
2703
|
-
return D.push(
|
|
2735
|
+
}, Q = Fe(this._injector, W.params);
|
|
2736
|
+
return D.push(z, W), E.push(...B, ...Q), {
|
|
2704
2737
|
redos: D,
|
|
2705
|
-
undos:
|
|
2738
|
+
undos: E.reverse()
|
|
2706
2739
|
};
|
|
2707
2740
|
}
|
|
2708
2741
|
return { redos: [], undos: [] };
|
|
2709
2742
|
};
|
|
2710
|
-
|
|
2743
|
+
a && a.forValue((d, p) => {
|
|
2711
2744
|
const v = {
|
|
2712
2745
|
startRow: d,
|
|
2713
|
-
startColumn:
|
|
2746
|
+
startColumn: p,
|
|
2714
2747
|
endRow: d,
|
|
2715
|
-
endColumn:
|
|
2748
|
+
endColumn: p
|
|
2716
2749
|
}, h = this._refRangeService.registerRefRange(
|
|
2717
2750
|
v,
|
|
2718
|
-
(f) => u(f, d,
|
|
2751
|
+
(f) => u(f, d, p)
|
|
2719
2752
|
);
|
|
2720
|
-
l.set(`${d}_${
|
|
2753
|
+
l.set(`${d}_${p}`, h), e.add(h);
|
|
2721
2754
|
}), e.add(
|
|
2722
|
-
|
|
2723
|
-
new
|
|
2755
|
+
Te(
|
|
2756
|
+
new ke((d) => {
|
|
2724
2757
|
e.add(
|
|
2725
|
-
this._commandService.onCommandExecuted((
|
|
2726
|
-
[oe.id,
|
|
2758
|
+
this._commandService.onCommandExecuted((p) => {
|
|
2759
|
+
[oe.id, te.id].includes(p.id) && d.next(p.params);
|
|
2727
2760
|
})
|
|
2728
2761
|
);
|
|
2729
2762
|
}).pipe(
|
|
2730
|
-
|
|
2731
|
-
(d) => d.unitId ===
|
|
2763
|
+
fn(
|
|
2764
|
+
(d) => d.unitId === r && d.subUnitId === n
|
|
2732
2765
|
),
|
|
2733
|
-
Ze((d) => d.ranges ? d.ranges : d.values ? Object.keys(d.values).reduce((
|
|
2766
|
+
Ze((d) => d.ranges ? d.ranges : d.values ? Object.keys(d.values).reduce((p, v) => {
|
|
2734
2767
|
const h = d.values[v];
|
|
2735
|
-
return
|
|
2768
|
+
return p.push(...h.ranges), p;
|
|
2736
2769
|
}, []) : []),
|
|
2737
2770
|
Fr(300),
|
|
2738
2771
|
// updating the listener moves to the next queue
|
|
2739
2772
|
Ze(
|
|
2740
|
-
(d) => d.reduce((
|
|
2773
|
+
(d) => d.reduce((p, v) => (p.push(...v), p), [])
|
|
2741
2774
|
),
|
|
2742
|
-
|
|
2775
|
+
fn((d) => !!d.length)
|
|
2743
2776
|
).subscribe((d) => {
|
|
2744
|
-
d.forEach((
|
|
2745
|
-
ne.foreach(
|
|
2777
|
+
d.forEach((p) => {
|
|
2778
|
+
ne.foreach(p, (v, h) => {
|
|
2746
2779
|
const f = `${v}_${h}`, b = l.get(f);
|
|
2747
|
-
if (l.delete(f), b && b.dispose(), this._numfmtService.getValue(
|
|
2780
|
+
if (l.delete(f), b && b.dispose(), this._numfmtService.getValue(r, n, v, h)) {
|
|
2748
2781
|
const D = {
|
|
2749
2782
|
startRow: v,
|
|
2750
2783
|
startColumn: h,
|
|
2751
2784
|
endRow: v,
|
|
2752
2785
|
endColumn: h
|
|
2753
|
-
},
|
|
2786
|
+
}, E = this._refRangeService.registerRefRange(
|
|
2754
2787
|
D,
|
|
2755
2788
|
(R) => u(R, v, h)
|
|
2756
2789
|
);
|
|
2757
|
-
l.set(f,
|
|
2790
|
+
l.set(f, E), e.add(E);
|
|
2758
2791
|
}
|
|
2759
2792
|
});
|
|
2760
2793
|
});
|
|
@@ -2766,43 +2799,43 @@ let pt = class extends Le {
|
|
|
2766
2799
|
);
|
|
2767
2800
|
}
|
|
2768
2801
|
};
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
],
|
|
2778
|
-
var
|
|
2779
|
-
for (var
|
|
2780
|
-
(u = e[l]) && (
|
|
2781
|
-
return n &&
|
|
2782
|
-
},
|
|
2783
|
-
let
|
|
2784
|
-
constructor(e, t,
|
|
2785
|
-
super(), this._numfmtService = e, this._sheetInterceptorService = t, this._univerInstanceService =
|
|
2802
|
+
_t = ma([
|
|
2803
|
+
je(_e.Rendered, _t),
|
|
2804
|
+
ze(0, $(ye)),
|
|
2805
|
+
ze(1, $(ve)),
|
|
2806
|
+
ze(2, $(we)),
|
|
2807
|
+
ze(3, $(fr)),
|
|
2808
|
+
ze(4, $(Lt)),
|
|
2809
|
+
ze(5, $(Ce))
|
|
2810
|
+
], _t);
|
|
2811
|
+
var fa = Object.defineProperty, ha = Object.getOwnPropertyDescriptor, ga = (e, t, r, n) => {
|
|
2812
|
+
for (var a = n > 1 ? void 0 : n ? ha(t, r) : t, l = e.length - 1, u; l >= 0; l--)
|
|
2813
|
+
(u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
|
|
2814
|
+
return n && a && fa(t, r, a), a;
|
|
2815
|
+
}, lt = (e, t) => (r, n) => t(r, n, e);
|
|
2816
|
+
let yt = class extends Me {
|
|
2817
|
+
constructor(e, t, r, n) {
|
|
2818
|
+
super(), this._numfmtService = e, this._sheetInterceptorService = t, this._univerInstanceService = r, this._injector = n, this._initSheetChange();
|
|
2786
2819
|
}
|
|
2787
2820
|
_initSheetChange() {
|
|
2788
2821
|
this.disposeWithMe(
|
|
2789
2822
|
this._sheetInterceptorService.interceptCommand({
|
|
2790
2823
|
getMutations: (e) => {
|
|
2791
|
-
if (e.id ===
|
|
2792
|
-
const t = e.params,
|
|
2793
|
-
if (!
|
|
2824
|
+
if (e.id === Rr.id) {
|
|
2825
|
+
const t = e.params, r = t.unitId || va(this._univerInstanceService), n = t.subUnitId || _a(this._univerInstanceService), a = this._numfmtService.getModel(r, n);
|
|
2826
|
+
if (!a)
|
|
2794
2827
|
return { redos: [], undos: [] };
|
|
2795
2828
|
const l = [];
|
|
2796
|
-
|
|
2797
|
-
l.push({ startColumn: v, endColumn: v, startRow:
|
|
2829
|
+
a.forValue((p, v) => {
|
|
2830
|
+
l.push({ startColumn: v, endColumn: v, startRow: p, endRow: p });
|
|
2798
2831
|
});
|
|
2799
2832
|
const u = {
|
|
2800
|
-
unitId:
|
|
2833
|
+
unitId: r,
|
|
2801
2834
|
subUnitId: n,
|
|
2802
|
-
ranges:
|
|
2803
|
-
}, d =
|
|
2835
|
+
ranges: Ie(l)
|
|
2836
|
+
}, d = Fe(this._injector, u);
|
|
2804
2837
|
return {
|
|
2805
|
-
redos: [{ id:
|
|
2838
|
+
redos: [{ id: te.id, params: u }],
|
|
2806
2839
|
undos: d
|
|
2807
2840
|
};
|
|
2808
2841
|
}
|
|
@@ -2812,33 +2845,33 @@ let ft = class extends Le {
|
|
|
2812
2845
|
);
|
|
2813
2846
|
}
|
|
2814
2847
|
};
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
],
|
|
2822
|
-
const
|
|
2823
|
-
var
|
|
2824
|
-
for (var
|
|
2825
|
-
(u = e[l]) && (
|
|
2826
|
-
return n &&
|
|
2827
|
-
},
|
|
2828
|
-
let
|
|
2848
|
+
yt = ga([
|
|
2849
|
+
je(_e.Rendered, yt),
|
|
2850
|
+
lt(0, $(ye)),
|
|
2851
|
+
lt(1, $(xt)),
|
|
2852
|
+
lt(2, $(ve)),
|
|
2853
|
+
lt(3, $(we))
|
|
2854
|
+
], yt);
|
|
2855
|
+
const va = (e) => e.getCurrentUniverSheetInstance().getUnitId(), _a = (e) => e.getCurrentUniverSheetInstance().getActiveSheet().getSheetId();
|
|
2856
|
+
var ya = Object.defineProperty, ba = Object.getOwnPropertyDescriptor, Sa = (e, t, r, n) => {
|
|
2857
|
+
for (var a = n > 1 ? void 0 : n ? ba(t, r) : t, l = e.length - 1, u; l >= 0; l--)
|
|
2858
|
+
(u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
|
|
2859
|
+
return n && a && ya(t, r, a), a;
|
|
2860
|
+
}, Ca = (e, t) => (r, n) => t(r, n, e), zt;
|
|
2861
|
+
let _n = (zt = class extends lr {
|
|
2829
2862
|
constructor(e, t) {
|
|
2830
|
-
super(
|
|
2863
|
+
super(Qe), this._injector = t;
|
|
2831
2864
|
}
|
|
2832
2865
|
onStarting() {
|
|
2833
|
-
this._injector.add([
|
|
2866
|
+
this._injector.add([Kt, { useClass: mt, lazy: !1 }]), this._injector.add([ft]), this._injector.add([Mt]), this._injector.add([_t]), this._injector.add([yt]), this._injector.add([pt]), this._injector.add([ut]), this._injector.add([dt]), this._injector.add([ht]), this._injector.add([vt]);
|
|
2834
2867
|
}
|
|
2835
|
-
},
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
],
|
|
2868
|
+
}, Ne(zt, "type", ur.Sheet), zt);
|
|
2869
|
+
_n = Sa([
|
|
2870
|
+
Ca(1, $(we))
|
|
2871
|
+
], _n);
|
|
2839
2872
|
export {
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2873
|
+
Le as SetNumfmtCommand,
|
|
2874
|
+
_n as UniverSheetsNumfmtPlugin,
|
|
2875
|
+
Ta as enUS,
|
|
2876
|
+
Vr as zhCN
|
|
2844
2877
|
};
|