@univerjs/sheets-numfmt-ui 0.10.5-nightly.202508290716 → 0.10.5
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 +176 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/es/index.js +331 -332
- package/lib/es/locale/ru-RU.js +2 -2
- package/lib/index.js +331 -332
- package/lib/locale/ru-RU.js +2 -2
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/package.json +10 -10
package/lib/index.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var q = (e, t, r) =>
|
|
4
|
-
import { Inject as y, LocaleService as E, IConfigService as $e, Disposable as ne, isTextFormat as De, Tools as
|
|
5
|
-
import { IRenderManagerService as
|
|
6
|
-
import { SHEETS_NUMFMT_PLUGIN_CONFIG_KEY as
|
|
1
|
+
var mt = Object.defineProperty;
|
|
2
|
+
var dt = (e, t, r) => t in e ? mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var q = (e, t, r) => dt(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { Inject as y, LocaleService as E, IConfigService as $e, Disposable as ne, isTextFormat as De, Tools as ht, isRealNum as ft, CommandType as Fe, ILocalStorageService as Le, isPatternEqualWithoutDecimal as re, numfmt as vt, ThemeService as pt, IUniverInstanceService as fe, ICommandService as ve, UniverInstanceType as w, CellValueType as U, toDisposable as de, DisposableCollection as gt, InterceptorEffectEnum as we, Range as Ae, Injector as He, Optional as _t, willLoseNumericPrecision as St, fromCallback as yt, isDefaultFormat as Ct, DEFAULT_TEXT_FORMAT_EXCEL as bt, DependentOn as It, Plugin as Nt, merge as Et, registerDependencies as Tt, touchDependencies as wt } from "@univerjs/core";
|
|
5
|
+
import { IRenderManagerService as je } from "@univerjs/engine-render";
|
|
6
|
+
import { SHEETS_NUMFMT_PLUGIN_CONFIG_KEY as Mt, currencySymbols as Me, getDecimalFromPattern as J, getCurrencyType as V, setPatternDecimal as R, getCurrencyFormatOptions as oe, CURRENCYFORMAT as Pt, DATEFMTLISG as xt, NUMBERFORMAT as Ot, getDateFormatOptions as Be, getNumberFormatOptions as Ve, isPatternHasDecimal as Rt, SheetsNumfmtCellContentController as We, getPatternPreviewIgnoreGeneral as kt, getPatternType as pe, SetNumfmtCommand as Ge, getNumfmtParseValueFilter as Ut, getCurrencySymbolByLocale as $t, SetPercentCommand as Ke, SubtractDecimalCommand as Ze, AddDecimalCommand as Ye, SetCurrencyCommand as ze, getCurrencySymbolIconByLocale as Pe, localeCurrencySymbolMap as Dt, getPatternPreview as Ft, UniverSheetsNumfmtPlugin as Lt } from "@univerjs/sheets-numfmt";
|
|
7
7
|
import { HoverManagerService as At, CellAlertManagerService as Ht, CellAlertType as jt, SheetSkeletonManagerService as Bt, IEditorBridgeService as Vt, deriveStateFromActiveSheet$ as Wt, getCurrentRangeDisable$ as W, UniverSheetsUIPlugin as Gt } from "@univerjs/sheets-ui";
|
|
8
|
-
import { INumfmtService as ge, SheetInterceptorService as
|
|
9
|
-
import { IZenZoneService as Qt, useDependency as b, ComponentManager as
|
|
10
|
-
import { debounceTime as sn, merge as
|
|
8
|
+
import { INumfmtService as ge, SheetInterceptorService as Xe, SheetsSelectionsService as _e, INTERCEPTOR_POINT as Kt, RemoveNumfmtMutation as Se, SetNumfmtMutation as ye, BEFORE_CELL_EDIT as Zt, AFTER_CELL_EDIT as Yt, SetRangeValuesCommand as zt, transformCellsToRange as Xt, factorySetNumfmtUndoMutation as qt, factoryRemoveNumfmtUndoMutation as Jt, RangeProtectionPermissionEditPoint as G, WorksheetSetCellStylePermission as K, WorksheetEditPermission as Z, WorkbookEditablePermission as Y } from "@univerjs/sheets";
|
|
9
|
+
import { IZenZoneService as Qt, useDependency as b, ComponentManager as qe, ISidebarService as en, getMenuHiddenObservable as z, MenuItemType as X, ILayoutService as tn, RibbonDataGroup as nn, IMenuManagerService as rn } from "@univerjs/ui";
|
|
10
|
+
import { debounceTime as sn, merge as Je, Observable as A, combineLatest as on, filter as an } from "rxjs";
|
|
11
11
|
import { map as cn, switchMap as ln, tap as un, debounceTime as mn } from "rxjs/operators";
|
|
12
12
|
import { jsxs as C, jsx as h } from "react/jsx-runtime";
|
|
13
|
-
import { createContext as dn, useState as N, useEffect as ie, useRef as Ce, useContext as
|
|
14
|
-
import { InputNumber as Ie, Select as Ne, SelectList as Ee, Input as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
for (var i = n > 1 ? void 0 : n ? Sn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
|
|
13
|
+
import { createContext as dn, useState as N, useEffect as ie, useRef as Ce, useContext as Qe, useMemo as x, forwardRef as et, createElement as be, useCallback as hn } from "react";
|
|
14
|
+
import { InputNumber as Ie, Select as Ne, SelectList as Ee, Input as fn, clsx as tt, borderClassName as vn, Button as xe, scrollbarClassName as pn, Separator as gn } from "@univerjs/design";
|
|
15
|
+
const Oe = {};
|
|
16
|
+
var _n = Object.getOwnPropertyDescriptor, Sn = (e, t, r, n) => {
|
|
17
|
+
for (var i = n > 1 ? void 0 : n ? _n(t, r) : t, s = e.length - 1, o; s >= 0; s--)
|
|
19
18
|
(o = e[s]) && (i = o(i) || i);
|
|
20
19
|
return i;
|
|
21
20
|
}, D = (e, t) => (r, n) => t(r, n, e);
|
|
@@ -33,19 +32,19 @@ let he = class extends ne {
|
|
|
33
32
|
if (e) {
|
|
34
33
|
const n = e.location, i = this._context.unit, s = i.getActiveSheet();
|
|
35
34
|
if (!s) return;
|
|
36
|
-
const o = n.unitId,
|
|
37
|
-
let
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
const m = i.getStyles().get(
|
|
41
|
-
m != null && m.n && (
|
|
35
|
+
const o = n.unitId, a = n.subUnitId;
|
|
36
|
+
let l;
|
|
37
|
+
const c = s.getCell(n.row, n.col);
|
|
38
|
+
if (c != null && c.s) {
|
|
39
|
+
const m = i.getStyles().get(c.s);
|
|
40
|
+
m != null && m.n && (l = m.n);
|
|
42
41
|
}
|
|
43
|
-
if (
|
|
42
|
+
if (l || (l = this._numfmtService.getValue(o, a, n.row, n.col)), !l) {
|
|
44
43
|
this._hideAlert();
|
|
45
44
|
return;
|
|
46
45
|
}
|
|
47
|
-
if (De(
|
|
48
|
-
if ((t = this._configService.getConfig(
|
|
46
|
+
if (De(l.pattern) && ht.isDefine(c == null ? void 0 : c.v) && ft(c.v)) {
|
|
47
|
+
if ((t = this._configService.getConfig(Mt)) != null && t.disableTextFormatAlert)
|
|
49
48
|
return;
|
|
50
49
|
const m = this._cellAlertManagerService.currentAlert.get(ae), u = (r = m == null ? void 0 : m.alert) == null ? void 0 : r.location;
|
|
51
50
|
if (u && u.row === n.row && u.col === n.col && u.subUnitId === n.subUnitId && u.unitId === n.unitId)
|
|
@@ -74,7 +73,7 @@ let he = class extends ne {
|
|
|
74
73
|
this._cellAlertManagerService.removeAlert(ae);
|
|
75
74
|
}
|
|
76
75
|
};
|
|
77
|
-
he =
|
|
76
|
+
he = Sn([
|
|
78
77
|
D(1, y(At)),
|
|
79
78
|
D(2, y(Ht)),
|
|
80
79
|
D(3, y(E)),
|
|
@@ -84,21 +83,21 @@ he = yn([
|
|
|
84
83
|
], he);
|
|
85
84
|
const ce = {
|
|
86
85
|
id: "sheet.operation.close.numfmt.panel",
|
|
87
|
-
type:
|
|
86
|
+
type: Fe.OPERATION,
|
|
88
87
|
handler: () => (
|
|
89
88
|
// do nothing, just notify panel is closed
|
|
90
89
|
!0
|
|
91
90
|
)
|
|
92
91
|
}, H = {
|
|
93
92
|
id: "sheet.operation.open.numfmt.panel",
|
|
94
|
-
type:
|
|
93
|
+
type: Fe.OPERATION,
|
|
95
94
|
handler: (e) => (e.get(B).openPanel(), !0)
|
|
96
95
|
};
|
|
97
|
-
var
|
|
98
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
96
|
+
var yn = Object.getOwnPropertyDescriptor, Cn = (e, t, r, n) => {
|
|
97
|
+
for (var i = n > 1 ? void 0 : n ? yn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
|
|
99
98
|
(o = e[s]) && (i = o(i) || i);
|
|
100
99
|
return i;
|
|
101
|
-
},
|
|
100
|
+
}, bn = (e, t) => (r, n) => t(r, n, e);
|
|
102
101
|
const Te = dn([]);
|
|
103
102
|
let j = class {
|
|
104
103
|
constructor(e) {
|
|
@@ -125,17 +124,17 @@ let j = class {
|
|
|
125
124
|
async getHabit(e, t) {
|
|
126
125
|
const r = this._getKey(e), n = await this._localStorageService.getItem(r);
|
|
127
126
|
if (t && n) {
|
|
128
|
-
const i = n.map((s, o,
|
|
129
|
-
const
|
|
127
|
+
const i = n.map((s, o, a) => {
|
|
128
|
+
const l = a.length;
|
|
130
129
|
return {
|
|
131
130
|
value: s,
|
|
132
|
-
priority:
|
|
131
|
+
priority: l - o
|
|
133
132
|
};
|
|
134
133
|
});
|
|
135
134
|
return t.sort((s, o) => {
|
|
136
|
-
var
|
|
137
|
-
const
|
|
138
|
-
return (((m = i.find((u) => u.value === o)) == null ? void 0 : m.priority) || -1) -
|
|
135
|
+
var c, m;
|
|
136
|
+
const a = ((c = i.find((u) => u.value === s)) == null ? void 0 : c.priority) || -1;
|
|
137
|
+
return (((m = i.find((u) => u.value === o)) == null ? void 0 : m.priority) || -1) - a;
|
|
139
138
|
});
|
|
140
139
|
}
|
|
141
140
|
return n || [];
|
|
@@ -144,21 +143,21 @@ let j = class {
|
|
|
144
143
|
this._localStorageService.removeItem(e);
|
|
145
144
|
}
|
|
146
145
|
};
|
|
147
|
-
j =
|
|
148
|
-
|
|
146
|
+
j = Cn([
|
|
147
|
+
bn(0, y(Le))
|
|
149
148
|
], j);
|
|
150
|
-
const
|
|
151
|
-
const t = b(j), [r, n] = N(
|
|
149
|
+
const Re = "numfmtCurrency", In = (e) => {
|
|
150
|
+
const t = b(j), [r, n] = N(Me);
|
|
152
151
|
return ie(() => {
|
|
153
152
|
t.addHabit("numfmtCurrency", []).then(() => {
|
|
154
|
-
t.getHabit(
|
|
153
|
+
t.getHabit(Re, [...Me]).then((s) => {
|
|
155
154
|
n(s), e && e(s);
|
|
156
155
|
});
|
|
157
156
|
});
|
|
158
157
|
}, []), { userHabitCurrency: r, mark: (s) => {
|
|
159
|
-
t.markHabit(
|
|
158
|
+
t.markHabit(Re, s);
|
|
160
159
|
} };
|
|
161
|
-
},
|
|
160
|
+
}, Nn = () => {
|
|
162
161
|
const e = Ce([]), [t, r] = N({});
|
|
163
162
|
return ie(() => {
|
|
164
163
|
e.current.forEach((i) => {
|
|
@@ -167,14 +166,14 @@ const Oe = "numfmtCurrency", Nn = (e) => {
|
|
|
167
166
|
}, [t]), (i) => {
|
|
168
167
|
e.current.push(i), r({});
|
|
169
168
|
};
|
|
170
|
-
},
|
|
171
|
-
const { defaultPattern: t, action: r, onChange: n } = e, [i, s] = N(() => J(t || "", 2)), o =
|
|
172
|
-
r.current = () =>
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
},
|
|
169
|
+
}, En = (e) => !!V(e) && e.startsWith("_("), Tn = (e) => {
|
|
170
|
+
const { defaultPattern: t, action: r, onChange: n } = e, [i, s] = N(() => J(t || "", 2)), o = Qe(Te), [a, l] = N(() => V(t) || o[0]), c = x(() => o.map((p) => ({ label: p, value: p })), []), u = b(E).t;
|
|
171
|
+
r.current = () => R(`_("${a}"* #,##0${i > 0 ? ".0" : ""}_)`, i);
|
|
172
|
+
const f = (p) => {
|
|
173
|
+
l(p), n(R(`_("${p}"* #,##0${i > 0 ? ".0" : ""}_)`, i));
|
|
174
|
+
}, v = (p) => {
|
|
176
175
|
const d = p || 0;
|
|
177
|
-
s(d), n(
|
|
176
|
+
s(d), n(R(`_("${a}"* #,##0${d > 0 ? ".0" : ""}_)`, d));
|
|
178
177
|
};
|
|
179
178
|
return /* @__PURE__ */ C("div", { children: [
|
|
180
179
|
/* @__PURE__ */ C("div", { className: "univer-mt-4 univer-flex univer-justify-between", children: [
|
|
@@ -188,7 +187,7 @@ const Oe = "numfmtCurrency", Nn = (e) => {
|
|
|
188
187
|
precision: 0,
|
|
189
188
|
max: 20,
|
|
190
189
|
min: 0,
|
|
191
|
-
onChange:
|
|
190
|
+
onChange: v
|
|
192
191
|
}
|
|
193
192
|
) })
|
|
194
193
|
] }),
|
|
@@ -197,32 +196,32 @@ const Oe = "numfmtCurrency", Nn = (e) => {
|
|
|
197
196
|
/* @__PURE__ */ h("div", { className: "univer-mt-2 univer-w-36", children: /* @__PURE__ */ h(
|
|
198
197
|
Ne,
|
|
199
198
|
{
|
|
200
|
-
options:
|
|
201
|
-
value:
|
|
202
|
-
onChange:
|
|
199
|
+
options: c,
|
|
200
|
+
value: a,
|
|
201
|
+
onChange: f
|
|
203
202
|
}
|
|
204
203
|
) })
|
|
205
204
|
] })
|
|
206
205
|
] }),
|
|
207
206
|
/* @__PURE__ */ h("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: u("sheet.numfmt.accountingDes") })
|
|
208
207
|
] });
|
|
209
|
-
}, wn = (e) => !!V(e) && !e.startsWith("_("),
|
|
210
|
-
const r = b(E).t, n =
|
|
208
|
+
}, wn = (e) => !!V(e) && !e.startsWith("_("), Mn = (e) => {
|
|
209
|
+
const r = b(E).t, n = Qe(Te), [i, s] = N(() => V(e.defaultPattern) || n[0]), [o, a] = N(() => J(e.defaultPattern || "", 2)), [l, c] = N(() => {
|
|
211
210
|
var g;
|
|
212
211
|
const d = oe(i);
|
|
213
212
|
return ((g = d.find((I) => re(I.value, e.defaultPattern))) == null ? void 0 : g.value) || d[0].value;
|
|
214
213
|
}), m = x(() => oe(i), [i]), u = x(() => n.map((d) => ({ label: d, value: d })), [n]);
|
|
215
|
-
e.action.current = () =>
|
|
216
|
-
const
|
|
214
|
+
e.action.current = () => R(l, o);
|
|
215
|
+
const f = (d) => {
|
|
217
216
|
if (d === void 0)
|
|
218
217
|
return;
|
|
219
218
|
s(d);
|
|
220
219
|
const S = oe(d)[0].value;
|
|
221
|
-
|
|
222
|
-
},
|
|
223
|
-
d !== void 0 && (
|
|
220
|
+
c(S), e.onChange(R(S, o));
|
|
221
|
+
}, v = (d) => {
|
|
222
|
+
d !== void 0 && (c(d), e.onChange(R(d, o)));
|
|
224
223
|
}, p = (d) => {
|
|
225
|
-
|
|
224
|
+
a(d || 0), e.onChange(R(l, d || 0));
|
|
226
225
|
};
|
|
227
226
|
return /* @__PURE__ */ C("div", { children: [
|
|
228
227
|
/* @__PURE__ */ C("div", { className: "univer-mt-4 univer-flex univer-justify-between", children: [
|
|
@@ -245,13 +244,13 @@ const Oe = "numfmtCurrency", Nn = (e) => {
|
|
|
245
244
|
{
|
|
246
245
|
value: i,
|
|
247
246
|
options: u,
|
|
248
|
-
onChange:
|
|
247
|
+
onChange: f
|
|
249
248
|
}
|
|
250
249
|
) })
|
|
251
250
|
] })
|
|
252
251
|
] }),
|
|
253
252
|
/* @__PURE__ */ h("div", { className: "label univer-mt-4", children: r("sheet.numfmt.negType") }),
|
|
254
|
-
/* @__PURE__ */ h("div", { className: "univer-mt-2", children: /* @__PURE__ */ h(Ee, { value:
|
|
253
|
+
/* @__PURE__ */ h("div", { className: "univer-mt-2", children: /* @__PURE__ */ h(Ee, { value: l, options: m, onChange: v }) }),
|
|
255
254
|
/* @__PURE__ */ h("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: r("sheet.numfmt.currencyDes") })
|
|
256
255
|
] });
|
|
257
256
|
};
|
|
@@ -263,32 +262,32 @@ var T = function() {
|
|
|
263
262
|
}
|
|
264
263
|
return e;
|
|
265
264
|
}, T.apply(this, arguments);
|
|
266
|
-
},
|
|
265
|
+
}, Pn = function(e, t) {
|
|
267
266
|
var r = {};
|
|
268
267
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
269
268
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
270
269
|
for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
|
|
271
270
|
t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
|
|
272
271
|
return r;
|
|
273
|
-
},
|
|
274
|
-
var r = e.icon, n = e.id, i = e.className, s = e.extend, o =
|
|
275
|
-
return
|
|
272
|
+
}, nt = et(function(e, t) {
|
|
273
|
+
var r = e.icon, n = e.id, i = e.className, s = e.extend, o = Pn(e, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), l = Ce("_".concat(Rn()));
|
|
274
|
+
return rt(r, "".concat(n), { defIds: r.defIds, idSuffix: l.current }, T({ ref: t, className: a }, o), s);
|
|
276
275
|
});
|
|
277
|
-
function
|
|
278
|
-
return be(e.tag, T(T({ key: t },
|
|
279
|
-
return
|
|
276
|
+
function rt(e, t, r, n, i) {
|
|
277
|
+
return be(e.tag, T(T({ key: t }, xn(e, r, i)), n), (On(e, r).children || []).map(function(s, o) {
|
|
278
|
+
return rt(s, "".concat(t, "-").concat(e.tag, "-").concat(o), r, void 0, i);
|
|
280
279
|
}));
|
|
281
280
|
}
|
|
282
|
-
function
|
|
281
|
+
function xn(e, t, r) {
|
|
283
282
|
var n = T({}, e.attrs);
|
|
284
283
|
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1), e.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(function(s) {
|
|
285
|
-
var o = s[0],
|
|
286
|
-
o === "mask" && typeof
|
|
284
|
+
var o = s[0], a = s[1];
|
|
285
|
+
o === "mask" && typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
287
286
|
});
|
|
288
287
|
var i = t.defIds;
|
|
289
288
|
return !i || i.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(s) {
|
|
290
|
-
var o = s[0],
|
|
291
|
-
typeof
|
|
289
|
+
var o = s[0], a = s[1];
|
|
290
|
+
typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
292
291
|
})), n;
|
|
293
292
|
}
|
|
294
293
|
function On(e, t) {
|
|
@@ -297,72 +296,72 @@ function On(e, t) {
|
|
|
297
296
|
return typeof i.attrs.id == "string" && n && n.includes(i.attrs.id) ? T(T({}, i), { attrs: T(T({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
|
|
298
297
|
}) }) : e;
|
|
299
298
|
}
|
|
300
|
-
function
|
|
299
|
+
function Rn() {
|
|
301
300
|
return Math.random().toString(36).substring(2, 8);
|
|
302
301
|
}
|
|
303
|
-
|
|
304
|
-
var kn = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] },
|
|
305
|
-
return be(
|
|
302
|
+
nt.displayName = "UniverIcon";
|
|
303
|
+
var kn = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, it = et(function(e, t) {
|
|
304
|
+
return be(nt, Object.assign({}, e, {
|
|
306
305
|
id: "check-mark-icon",
|
|
307
306
|
ref: t,
|
|
308
307
|
icon: kn
|
|
309
308
|
}));
|
|
310
309
|
});
|
|
311
|
-
|
|
310
|
+
it.displayName = "CheckMarkIcon";
|
|
312
311
|
const le = "customFormat", ue = "numfmt_custom_pattern";
|
|
313
|
-
function
|
|
314
|
-
const { defaultPattern: t, action: r, onChange: n } = e, i = b(j), s = b(
|
|
315
|
-
r.current = () => (i.markHabit(le,
|
|
316
|
-
const p = [.../* @__PURE__ */ new Set([
|
|
312
|
+
function Un(e) {
|
|
313
|
+
const { defaultPattern: t, action: r, onChange: n } = e, i = b(j), s = b(Le), o = b(E), [a, l] = N(t);
|
|
314
|
+
r.current = () => (i.markHabit(le, a), s.getItem(ue).then((v = []) => {
|
|
315
|
+
const p = [.../* @__PURE__ */ new Set([a, ...v || []])].splice(0, 10).filter((d) => !!d);
|
|
317
316
|
s.setItem(ue, p);
|
|
318
|
-
}),
|
|
319
|
-
const [
|
|
317
|
+
}), a);
|
|
318
|
+
const [c, m] = N([]);
|
|
320
319
|
ie(() => {
|
|
321
|
-
s.getItem(ue).then((
|
|
320
|
+
s.getItem(ue).then((v) => {
|
|
322
321
|
const p = [
|
|
323
322
|
...Pt.map((d) => d.suffix("$")),
|
|
324
323
|
...xt.map((d) => d.suffix),
|
|
325
|
-
...
|
|
324
|
+
...Ot.map((d) => d.suffix)
|
|
326
325
|
];
|
|
327
|
-
p.push(...
|
|
326
|
+
p.push(...v || []), i.addHabit(le, []).finally(() => {
|
|
328
327
|
i.getHabit(le, p).then((d) => {
|
|
329
328
|
m([...new Set(d)]);
|
|
330
329
|
});
|
|
331
330
|
});
|
|
332
331
|
});
|
|
333
332
|
}, []);
|
|
334
|
-
const u = (
|
|
335
|
-
|
|
336
|
-
},
|
|
337
|
-
n(
|
|
333
|
+
const u = (v) => {
|
|
334
|
+
l(v), n(v);
|
|
335
|
+
}, f = () => {
|
|
336
|
+
n(a);
|
|
338
337
|
};
|
|
339
338
|
return /* @__PURE__ */ C("div", { children: [
|
|
340
339
|
/* @__PURE__ */ h("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: o.t("sheet.numfmt.customFormat") }),
|
|
341
340
|
/* @__PURE__ */ h(
|
|
342
|
-
|
|
341
|
+
fn,
|
|
343
342
|
{
|
|
344
343
|
placeholder: o.t("sheet.numfmt.customFormat"),
|
|
345
|
-
onBlur:
|
|
346
|
-
value:
|
|
347
|
-
onChange:
|
|
344
|
+
onBlur: f,
|
|
345
|
+
value: a,
|
|
346
|
+
onChange: l,
|
|
348
347
|
className: "univer-mt-2 univer-w-full"
|
|
349
348
|
}
|
|
350
349
|
),
|
|
351
350
|
/* @__PURE__ */ h(
|
|
352
351
|
"div",
|
|
353
352
|
{
|
|
354
|
-
className:
|
|
355
|
-
children:
|
|
353
|
+
className: tt("univer-mt-2 univer-max-h-[400px] univer-overflow-auto univer-rounded-lg univer-p-2", vn),
|
|
354
|
+
children: c.map((v) => /* @__PURE__ */ C(
|
|
356
355
|
"div",
|
|
357
356
|
{
|
|
358
|
-
onClick: () => u(
|
|
357
|
+
onClick: () => u(v),
|
|
359
358
|
className: "univer-flex univer-cursor-pointer univer-items-center univer-gap-1.5 univer-py-1.5 univer-text-sm",
|
|
360
359
|
children: [
|
|
361
|
-
/* @__PURE__ */ h("div", { className: "univer-flex univer-w-4 univer-items-center univer-text-primary-600", children:
|
|
362
|
-
/* @__PURE__ */ h("div", { children:
|
|
360
|
+
/* @__PURE__ */ h("div", { className: "univer-flex univer-w-4 univer-items-center univer-text-primary-600", children: a === v && /* @__PURE__ */ h(it, {}) }),
|
|
361
|
+
/* @__PURE__ */ h("div", { children: v })
|
|
363
362
|
]
|
|
364
363
|
},
|
|
365
|
-
|
|
364
|
+
v
|
|
366
365
|
))
|
|
367
366
|
}
|
|
368
367
|
),
|
|
@@ -375,26 +374,26 @@ function $n(e) {
|
|
|
375
374
|
)
|
|
376
375
|
] });
|
|
377
376
|
}
|
|
378
|
-
const
|
|
379
|
-
const t =
|
|
380
|
-
return
|
|
377
|
+
const $n = (e) => {
|
|
378
|
+
const t = vt.getFormatInfo(e);
|
|
379
|
+
return Be().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
|
|
381
380
|
};
|
|
382
|
-
function
|
|
383
|
-
const { onChange: t, defaultPattern: r } = e, n = x(
|
|
381
|
+
function Dn(e) {
|
|
382
|
+
const { onChange: t, defaultPattern: r } = e, n = x(Be, []), i = b(E), [s, o] = N(() => {
|
|
384
383
|
if (r) {
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
387
|
-
return
|
|
384
|
+
const l = n.find((c) => c.value === r);
|
|
385
|
+
if (l)
|
|
386
|
+
return l.value;
|
|
388
387
|
}
|
|
389
388
|
return n[0].value;
|
|
390
389
|
});
|
|
391
390
|
e.action.current = () => s;
|
|
392
|
-
const
|
|
393
|
-
|
|
391
|
+
const a = (l) => {
|
|
392
|
+
l !== void 0 && (o(l), t(l));
|
|
394
393
|
};
|
|
395
394
|
return /* @__PURE__ */ C("div", { children: [
|
|
396
395
|
/* @__PURE__ */ h("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: i.t("sheet.numfmt.dateType") }),
|
|
397
|
-
/* @__PURE__ */ h("div", { className: "univer-mt-2", children: /* @__PURE__ */ h(Ee, { value: s, options: n, onChange:
|
|
396
|
+
/* @__PURE__ */ h("div", { className: "univer-mt-2", children: /* @__PURE__ */ h(Ee, { value: s, options: n, onChange: a }) }),
|
|
398
397
|
/* @__PURE__ */ h(
|
|
399
398
|
"div",
|
|
400
399
|
{
|
|
@@ -404,7 +403,7 @@ function Fn(e) {
|
|
|
404
403
|
)
|
|
405
404
|
] });
|
|
406
405
|
}
|
|
407
|
-
const
|
|
406
|
+
const Fn = (e) => !e, Ln = (e) => {
|
|
408
407
|
const r = b(E).t;
|
|
409
408
|
return e.action.current = () => "", /* @__PURE__ */ h("div", { children: /* @__PURE__ */ h(
|
|
410
409
|
"div",
|
|
@@ -413,26 +412,26 @@ const Ln = (e) => !e, An = (e) => {
|
|
|
413
412
|
children: r("sheet.numfmt.generalDes")
|
|
414
413
|
}
|
|
415
414
|
) });
|
|
416
|
-
},
|
|
417
|
-
function
|
|
418
|
-
const t = b(E), r = x(
|
|
419
|
-
const u = r.find((
|
|
415
|
+
}, An = (e) => Ve().some((t) => re(t.value, e));
|
|
416
|
+
function Hn(e) {
|
|
417
|
+
const t = b(E), r = x(Ve, []), [n, i] = N(() => J(e.defaultPattern || "", 0)), [s, o] = N(() => {
|
|
418
|
+
const u = r.find((f) => re(f.value, e.defaultPattern || ""));
|
|
420
419
|
return (u == null ? void 0 : u.value) || r[0].value;
|
|
421
|
-
}),
|
|
422
|
-
i(u || 0), e.onChange(
|
|
420
|
+
}), a = x(() => R(s, Number(n || 0)), [s, n]), l = x(() => !Rt(s), [s]), c = (u) => {
|
|
421
|
+
i(u || 0), e.onChange(R(s, Number(u || 0)));
|
|
423
422
|
}, m = (u) => {
|
|
424
423
|
u !== void 0 && (i(J(u, 0)), o(u), e.onChange(u));
|
|
425
424
|
};
|
|
426
|
-
return e.action.current = () =>
|
|
425
|
+
return e.action.current = () => a, /* @__PURE__ */ C("div", { children: [
|
|
427
426
|
/* @__PURE__ */ h("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: t.t("sheet.numfmt.decimalLength") }),
|
|
428
427
|
/* @__PURE__ */ h("div", { className: "univer-mt-2", children: /* @__PURE__ */ h(
|
|
429
428
|
Ie,
|
|
430
429
|
{
|
|
431
|
-
disabled:
|
|
430
|
+
disabled: l,
|
|
432
431
|
value: n,
|
|
433
432
|
max: 20,
|
|
434
433
|
min: 0,
|
|
435
|
-
onChange:
|
|
434
|
+
onChange: c
|
|
436
435
|
}
|
|
437
436
|
) }),
|
|
438
437
|
/* @__PURE__ */ C("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-400", children: [
|
|
@@ -449,70 +448,70 @@ function jn(e) {
|
|
|
449
448
|
)
|
|
450
449
|
] });
|
|
451
450
|
}
|
|
452
|
-
const
|
|
453
|
-
const { defaultValue: t, defaultPattern: r, row: n, col: i } = e.value, s = b(E), o = Ce(() => ""),
|
|
451
|
+
const jn = (e) => {
|
|
452
|
+
const { defaultValue: t, defaultPattern: r, row: n, col: i } = e.value, s = b(E), o = Ce(() => ""), a = s.t, l = Nn(), c = x(
|
|
454
453
|
() => [
|
|
455
|
-
{ label: "sheet.numfmt.general", component:
|
|
456
|
-
{ label: "sheet.numfmt.accounting", component:
|
|
457
|
-
{ label: "sheet.numfmt.currency", component:
|
|
458
|
-
{ label: "sheet.numfmt.date", component:
|
|
459
|
-
{ label: "sheet.numfmt.thousandthPercentile", component:
|
|
460
|
-
{ label: "sheet.numfmt.customFormat", component:
|
|
461
|
-
].map((_) => ({ ..._, label:
|
|
454
|
+
{ label: "sheet.numfmt.general", component: Ln },
|
|
455
|
+
{ label: "sheet.numfmt.accounting", component: Tn },
|
|
456
|
+
{ label: "sheet.numfmt.currency", component: Mn },
|
|
457
|
+
{ label: "sheet.numfmt.date", component: Dn },
|
|
458
|
+
{ label: "sheet.numfmt.thousandthPercentile", component: Hn },
|
|
459
|
+
{ label: "sheet.numfmt.customFormat", component: Un }
|
|
460
|
+
].map((_) => ({ ..._, label: a(_.label) })),
|
|
462
461
|
[]
|
|
463
|
-
), [m, u] = N(g), [
|
|
462
|
+
), [m, u] = N(g), [f, v] = N(() => `${n}_${i}`), { mark: p, userHabitCurrency: d } = In(() => v(`${n}_${i}_userCurrency'`)), S = x(() => {
|
|
464
463
|
var _;
|
|
465
|
-
return (_ =
|
|
464
|
+
return (_ = c.find(($) => $.label === m)) == null ? void 0 : _.component;
|
|
466
465
|
}, [m]);
|
|
467
466
|
function g() {
|
|
468
|
-
return [
|
|
467
|
+
return [Fn, En, wn, $n, An].reduce(($, lt, ut) => $ || (lt(r) ? c[ut].label : ""), "") || c[0].label;
|
|
469
468
|
}
|
|
470
|
-
const I =
|
|
469
|
+
const I = c.map((_) => ({
|
|
471
470
|
label: _.label,
|
|
472
471
|
value: _.label
|
|
473
472
|
})), P = (_) => {
|
|
474
|
-
u(_),
|
|
475
|
-
},
|
|
473
|
+
u(_), l(() => e.onChange({ type: "change", value: o.current() || "" }));
|
|
474
|
+
}, O = hn((_) => {
|
|
476
475
|
e.onChange({ type: "change", value: _ });
|
|
477
|
-
}, []),
|
|
476
|
+
}, []), k = () => {
|
|
478
477
|
const _ = o.current() || "", $ = V(_);
|
|
479
478
|
$ && p($), e.onChange({ type: "confirm", value: _ });
|
|
480
479
|
}, F = () => {
|
|
481
480
|
e.onChange({ type: "cancel", value: "" });
|
|
482
481
|
}, se = {
|
|
483
|
-
onChange:
|
|
482
|
+
onChange: O,
|
|
484
483
|
defaultValue: t,
|
|
485
484
|
defaultPattern: r,
|
|
486
485
|
action: o
|
|
487
486
|
};
|
|
488
487
|
return ie(() => {
|
|
489
|
-
u(g()),
|
|
488
|
+
u(g()), v(`${n}_${i}`);
|
|
490
489
|
}, [n, i]), /* @__PURE__ */ C(
|
|
491
490
|
"div",
|
|
492
491
|
{
|
|
493
|
-
className:
|
|
492
|
+
className: tt("univer-flex univer-h-full univer-flex-col univer-justify-between univer-overflow-y-auto univer-pb-5", pn),
|
|
494
493
|
children: [
|
|
495
494
|
/* @__PURE__ */ C("div", { children: [
|
|
496
|
-
/* @__PURE__ */ h("div", { className: "univer-mt-3.5 univer-text-sm univer-text-gray-400", children:
|
|
495
|
+
/* @__PURE__ */ h("div", { className: "univer-mt-3.5 univer-text-sm univer-text-gray-400", children: a("sheet.numfmt.numfmtType") }),
|
|
497
496
|
/* @__PURE__ */ h("div", { className: "univer-mt-2", children: /* @__PURE__ */ h(Ne, { className: "univer-w-full", value: m, options: I, onChange: P }) }),
|
|
498
|
-
/* @__PURE__ */ h("div", { children: S && /* @__PURE__ */ h(Te.Provider, { value: d, children: /* @__PURE__ */ be(S, { ...se, key:
|
|
497
|
+
/* @__PURE__ */ h("div", { children: S && /* @__PURE__ */ h(Te.Provider, { value: d, children: /* @__PURE__ */ be(S, { ...se, key: f }) }) })
|
|
499
498
|
] }),
|
|
500
499
|
/* @__PURE__ */ C("div", { className: "univer-mb-5 univer-mt-3.5 univer-flex univer-justify-end", children: [
|
|
501
|
-
/* @__PURE__ */ h(xe, { onClick: F, className: "univer-mr-3", children:
|
|
502
|
-
/* @__PURE__ */ h(xe, { variant: "primary", onClick:
|
|
500
|
+
/* @__PURE__ */ h(xe, { onClick: F, className: "univer-mr-3", children: a("sheet.numfmt.cancel") }),
|
|
501
|
+
/* @__PURE__ */ h(xe, { variant: "primary", onClick: k, children: a("sheet.numfmt.confirm") })
|
|
503
502
|
] })
|
|
504
503
|
]
|
|
505
504
|
}
|
|
506
505
|
);
|
|
507
506
|
};
|
|
508
|
-
var
|
|
509
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
507
|
+
var Bn = Object.getOwnPropertyDescriptor, Vn = (e, t, r, n) => {
|
|
508
|
+
for (var i = n > 1 ? void 0 : n ? Bn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
|
|
510
509
|
(o = e[s]) && (i = o(i) || i);
|
|
511
510
|
return i;
|
|
512
|
-
},
|
|
513
|
-
const
|
|
511
|
+
}, M = (e, t) => (r, n) => t(r, n, e);
|
|
512
|
+
const ke = "SHEET_NUMFMT_PANEL";
|
|
514
513
|
let B = class extends ne {
|
|
515
|
-
constructor(t, r, n, i, s, o,
|
|
514
|
+
constructor(t, r, n, i, s, o, a, l, c, m, u) {
|
|
516
515
|
super();
|
|
517
516
|
/**
|
|
518
517
|
* If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
|
|
@@ -522,54 +521,54 @@ let B = class extends ne {
|
|
|
522
521
|
*/
|
|
523
522
|
q(this, "_previewPattern", "");
|
|
524
523
|
q(this, "_sidebarDisposable", null);
|
|
525
|
-
this._sheetInterceptorService = t, this._themeService = r, this._univerInstanceService = n, this._commandService = i, this._selectionManagerService = s, this._renderManagerService = o, this._numfmtService =
|
|
524
|
+
this._sheetInterceptorService = t, this._themeService = r, this._univerInstanceService = n, this._commandService = i, this._selectionManagerService = s, this._renderManagerService = o, this._numfmtService = a, this._componentManager = l, this._sidebarService = c, this._localeService = m, this._sheetsNumfmtCellContentController = u, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener(), this._initNumfmtLocalChange();
|
|
526
525
|
}
|
|
527
526
|
_initNumfmtLocalChange() {
|
|
528
|
-
this.disposeWithMe(
|
|
527
|
+
this.disposeWithMe(Je(this._sheetsNumfmtCellContentController.locale$, this._localeService.currentLocale$).subscribe(() => {
|
|
529
528
|
this._forceUpdate();
|
|
530
529
|
}));
|
|
531
530
|
}
|
|
532
531
|
openPanel() {
|
|
533
532
|
var S;
|
|
534
|
-
const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, i = this._univerInstanceService, s = this._numfmtService, o = this._localeService,
|
|
535
|
-
if (!
|
|
533
|
+
const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, i = this._univerInstanceService, s = this._numfmtService, o = this._localeService, l = (((S = r.getCurrentSelections()) == null ? void 0 : S.map((g) => g.range)) || [])[0];
|
|
534
|
+
if (!l)
|
|
536
535
|
return !1;
|
|
537
|
-
const
|
|
536
|
+
const c = i.getCurrentUnitForType(w.UNIVER_SHEET), m = c.getActiveSheet();
|
|
538
537
|
if (!m)
|
|
539
538
|
return !1;
|
|
540
|
-
const u = m.getCellRaw(
|
|
541
|
-
|
|
539
|
+
const u = m.getCellRaw(l.startRow, l.startColumn), f = s.getValue(
|
|
540
|
+
c.getUnitId(),
|
|
542
541
|
m.getSheetId(),
|
|
543
|
-
|
|
544
|
-
|
|
542
|
+
l.startRow,
|
|
543
|
+
l.startColumn
|
|
545
544
|
);
|
|
546
|
-
let
|
|
547
|
-
|
|
548
|
-
const p = (u == null ? void 0 : u.t) ===
|
|
545
|
+
let v = "";
|
|
546
|
+
f && (v = f.pattern);
|
|
547
|
+
const p = (u == null ? void 0 : u.t) === U.NUMBER ? u.v : 12345678, d = {
|
|
549
548
|
onChange: (g) => {
|
|
550
549
|
var I;
|
|
551
550
|
if (g.type === "change")
|
|
552
551
|
this._previewPattern = g.value, this._forceUpdate();
|
|
553
552
|
else if (g.type === "confirm") {
|
|
554
|
-
const P = ((I = r.getCurrentSelections()) == null ? void 0 : I.map((F) => F.range)) || [],
|
|
553
|
+
const P = ((I = r.getCurrentSelections()) == null ? void 0 : I.map((F) => F.range)) || [], O = { values: [] }, k = pe(g.value);
|
|
555
554
|
P.forEach((F) => {
|
|
556
|
-
|
|
557
|
-
|
|
555
|
+
Ae.foreach(F, (se, _) => {
|
|
556
|
+
O.values.push({
|
|
558
557
|
row: se,
|
|
559
558
|
col: _,
|
|
560
559
|
pattern: g.value,
|
|
561
|
-
type:
|
|
560
|
+
type: k
|
|
562
561
|
});
|
|
563
562
|
});
|
|
564
|
-
}), n.executeCommand(
|
|
563
|
+
}), n.executeCommand(Ge.id, O), t.close();
|
|
565
564
|
} else g.type === "cancel" && t.close();
|
|
566
565
|
},
|
|
567
|
-
value: { defaultPattern:
|
|
566
|
+
value: { defaultPattern: v, defaultValue: p, row: l.startRow, col: l.startColumn }
|
|
568
567
|
};
|
|
569
568
|
return this._sidebarDisposable = t.open({
|
|
570
569
|
header: { title: o.t("sheet.numfmt.title") },
|
|
571
570
|
children: {
|
|
572
|
-
label:
|
|
571
|
+
label: ke,
|
|
573
572
|
...d
|
|
574
573
|
// need passthrough to react props.
|
|
575
574
|
},
|
|
@@ -581,7 +580,7 @@ let B = class extends ne {
|
|
|
581
580
|
_forceUpdate(t) {
|
|
582
581
|
var n;
|
|
583
582
|
const r = this._renderManagerService.getRenderById(
|
|
584
|
-
t != null ? t : this._univerInstanceService.getCurrentUnitForType(
|
|
583
|
+
t != null ? t : this._univerInstanceService.getCurrentUnitForType(w.UNIVER_SHEET).getUnitId()
|
|
585
584
|
);
|
|
586
585
|
r == null || r.with(Bt).reCalculate(), (n = r == null ? void 0 : r.mainComponent) == null || n.makeDirty();
|
|
587
586
|
}
|
|
@@ -595,7 +594,7 @@ let B = class extends ne {
|
|
|
595
594
|
}
|
|
596
595
|
_initPanel() {
|
|
597
596
|
this.disposeWithMe(
|
|
598
|
-
this._componentManager.register(
|
|
597
|
+
this._componentManager.register(ke, jn)
|
|
599
598
|
);
|
|
600
599
|
}
|
|
601
600
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -625,41 +624,41 @@ let B = class extends ne {
|
|
|
625
624
|
this._previewPattern = null;
|
|
626
625
|
})
|
|
627
626
|
).subscribe(({ disposableCollection: n, selectionRanges: i }) => {
|
|
628
|
-
var o,
|
|
629
|
-
const s = this._univerInstanceService.getCurrentUnitForType(
|
|
627
|
+
var o, a;
|
|
628
|
+
const s = this._univerInstanceService.getCurrentUnitForType(w.UNIVER_SHEET);
|
|
630
629
|
this.openPanel(), n.add(
|
|
631
630
|
this._sheetInterceptorService.intercept(Kt.CELL_CONTENT, {
|
|
632
631
|
priority: 99,
|
|
633
|
-
effect:
|
|
634
|
-
handler: (
|
|
632
|
+
effect: we.Value | we.Style,
|
|
633
|
+
handler: (l, c, m) => {
|
|
635
634
|
var p;
|
|
636
|
-
const { row: u, col:
|
|
635
|
+
const { row: u, col: f } = c, v = m(l) || {};
|
|
637
636
|
if (i.find(
|
|
638
|
-
(d) => d.startColumn <=
|
|
637
|
+
(d) => d.startColumn <= f && d.endColumn >= f && d.startRow <= u && d.endRow >= u
|
|
639
638
|
)) {
|
|
640
|
-
const d =
|
|
641
|
-
if (S == null || g !==
|
|
642
|
-
return
|
|
643
|
-
const I =
|
|
639
|
+
const d = c.worksheet.getCellRaw(u, f), S = d == null ? void 0 : d.v, g = d == null ? void 0 : d.t;
|
|
640
|
+
if (S == null || g !== U.NUMBER || this._previewPattern === null)
|
|
641
|
+
return v;
|
|
642
|
+
const I = kt(this._previewPattern, S, this._sheetsNumfmtCellContentController.locale);
|
|
644
643
|
if (I.color) {
|
|
645
644
|
const P = (p = this._themeService.getColorFromTheme(`${I.color}.500`)) != null ? p : I.color;
|
|
646
645
|
return {
|
|
647
|
-
...
|
|
646
|
+
...v,
|
|
648
647
|
v: I.result,
|
|
649
|
-
t:
|
|
648
|
+
t: U.STRING,
|
|
650
649
|
s: { cl: { rgb: P } }
|
|
651
650
|
};
|
|
652
651
|
}
|
|
653
652
|
return {
|
|
654
|
-
...
|
|
653
|
+
...v,
|
|
655
654
|
v: I.result,
|
|
656
|
-
t:
|
|
655
|
+
t: U.STRING
|
|
657
656
|
};
|
|
658
657
|
}
|
|
659
|
-
return
|
|
658
|
+
return v;
|
|
660
659
|
}
|
|
661
660
|
})
|
|
662
|
-
), (
|
|
661
|
+
), (a = (o = this._renderManagerService.getRenderById(s.getUnitId())) == null ? void 0 : o.mainComponent) == null || a.makeDirty();
|
|
663
662
|
})
|
|
664
663
|
)
|
|
665
664
|
);
|
|
@@ -679,34 +678,34 @@ let B = class extends ne {
|
|
|
679
678
|
);
|
|
680
679
|
}
|
|
681
680
|
_initCloseListener() {
|
|
682
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
681
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(w.UNIVER_SHEET).subscribe((t) => {
|
|
683
682
|
var r;
|
|
684
683
|
t || ((r = this._sidebarDisposable) == null || r.dispose(), this._sidebarDisposable = null);
|
|
685
684
|
});
|
|
686
685
|
}
|
|
687
686
|
};
|
|
688
|
-
B =
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
687
|
+
B = Vn([
|
|
688
|
+
M(0, y(Xe)),
|
|
689
|
+
M(1, y(pt)),
|
|
690
|
+
M(2, fe),
|
|
691
|
+
M(3, ve),
|
|
692
|
+
M(4, y(_e)),
|
|
693
|
+
M(5, je),
|
|
694
|
+
M(6, ge),
|
|
695
|
+
M(7, y(qe)),
|
|
696
|
+
M(8, en),
|
|
697
|
+
M(9, y(E)),
|
|
698
|
+
M(10, y(We))
|
|
700
699
|
], B);
|
|
701
|
-
var
|
|
702
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
700
|
+
var Wn = Object.getOwnPropertyDescriptor, Gn = (e, t, r, n) => {
|
|
701
|
+
for (var i = n > 1 ? void 0 : n ? Wn(t, r) : t, s = e.length - 1, o; s >= 0; s--)
|
|
703
702
|
(o = e[s]) && (i = o(i) || i);
|
|
704
703
|
return i;
|
|
705
704
|
}, L = (e, t) => (r, n) => t(r, n, e);
|
|
706
|
-
const
|
|
705
|
+
const Kn = () => {
|
|
707
706
|
let e = [];
|
|
708
707
|
return {
|
|
709
|
-
add: (i, s, o,
|
|
708
|
+
add: (i, s, o, a, l) => e.push({ unitId: i, subUnitId: s, row: o, col: a, value: l }),
|
|
710
709
|
getEffects: () => e,
|
|
711
710
|
clean: () => {
|
|
712
711
|
e = [];
|
|
@@ -717,7 +716,7 @@ let Q = class extends ne {
|
|
|
717
716
|
constructor(t, r, n, i, s) {
|
|
718
717
|
super();
|
|
719
718
|
// collect effect mutations when edit end and push this to commands stack in next commands progress
|
|
720
|
-
q(this, "_collectEffectMutation",
|
|
719
|
+
q(this, "_collectEffectMutation", Kn());
|
|
721
720
|
this._sheetInterceptorService = t, this._numfmtService = r, this._univerInstanceService = n, this._injector = i, this._editorBridgeService = s, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
|
|
722
721
|
}
|
|
723
722
|
_initInterceptorEditorStart() {
|
|
@@ -737,8 +736,8 @@ let Q = class extends ne {
|
|
|
737
736
|
case "currency":
|
|
738
737
|
case "grouped":
|
|
739
738
|
case "number": {
|
|
740
|
-
const
|
|
741
|
-
return
|
|
739
|
+
const l = r.worksheet.getCellRaw(i, s);
|
|
740
|
+
return n && n(l);
|
|
742
741
|
}
|
|
743
742
|
case "percent":
|
|
744
743
|
case "date":
|
|
@@ -765,7 +764,7 @@ let Q = class extends ne {
|
|
|
765
764
|
this._sheetInterceptorService.writeCellInterceptor.intercept(Yt, {
|
|
766
765
|
// eslint-disable-next-line complexity
|
|
767
766
|
handler: (t, r, n) => {
|
|
768
|
-
var
|
|
767
|
+
var l, c, m;
|
|
769
768
|
this._collectEffectMutation.clean();
|
|
770
769
|
const i = this._numfmtService.getValue(
|
|
771
770
|
r.unitId,
|
|
@@ -773,35 +772,35 @@ let Q = class extends ne {
|
|
|
773
772
|
r.row,
|
|
774
773
|
r.col
|
|
775
774
|
);
|
|
776
|
-
if (!(t != null && t.v) && !(t != null && t.p) || De(i == null ? void 0 : i.pattern) || t.t ===
|
|
775
|
+
if (!(t != null && t.v) && !(t != null && t.p) || De(i == null ? void 0 : i.pattern) || t.t === U.FORCE_STRING)
|
|
777
776
|
return n(t);
|
|
778
|
-
const s = (
|
|
777
|
+
const s = (l = t.p) == null ? void 0 : l.body, o = (m = (c = t == null ? void 0 : t.p) == null ? void 0 : c.body) != null && m.dataStream ? t.p.body.dataStream.replace(/\r\n$/, "") : String(t.v), a = Ut(o);
|
|
779
778
|
if (s)
|
|
780
|
-
if (
|
|
781
|
-
const { dataStream: u } = s,
|
|
782
|
-
if (Number.isNaN(
|
|
779
|
+
if (Zn(s)) {
|
|
780
|
+
const { dataStream: u } = s, f = u.replace(/\r\n$/, ""), v = Number(f);
|
|
781
|
+
if (Number.isNaN(v) && !a)
|
|
783
782
|
return n(t);
|
|
784
783
|
} else
|
|
785
784
|
return n(t);
|
|
786
|
-
if (
|
|
787
|
-
if (!
|
|
785
|
+
if (a) {
|
|
786
|
+
if (!a.z && St(o))
|
|
788
787
|
return n({
|
|
789
788
|
...t,
|
|
790
789
|
p: void 0,
|
|
791
790
|
v: o,
|
|
792
|
-
t:
|
|
791
|
+
t: U.FORCE_STRING
|
|
793
792
|
});
|
|
794
|
-
|
|
793
|
+
a.z && this._collectEffectMutation.add(
|
|
795
794
|
r.unitId,
|
|
796
795
|
r.subUnitId,
|
|
797
796
|
r.row,
|
|
798
797
|
r.col,
|
|
799
798
|
{
|
|
800
|
-
pattern:
|
|
799
|
+
pattern: a.z
|
|
801
800
|
}
|
|
802
801
|
);
|
|
803
|
-
const u = Number(
|
|
804
|
-
return n({ ...t, p: void 0, v: u, t:
|
|
802
|
+
const u = Number(a.v);
|
|
803
|
+
return n({ ...t, p: void 0, v: u, t: U.NUMBER });
|
|
805
804
|
}
|
|
806
805
|
return n(t);
|
|
807
806
|
}
|
|
@@ -817,51 +816,51 @@ let Q = class extends ne {
|
|
|
817
816
|
var n;
|
|
818
817
|
switch (r.id) {
|
|
819
818
|
case zt.id: {
|
|
820
|
-
const i = t._univerInstanceService.getCurrentUnitForType(
|
|
819
|
+
const i = t._univerInstanceService.getCurrentUnitForType(w.UNIVER_SHEET), s = i.getUnitId(), o = (n = i.getActiveSheet()) == null ? void 0 : n.getSheetId();
|
|
821
820
|
if (!o)
|
|
822
821
|
return {
|
|
823
822
|
redos: [],
|
|
824
823
|
undos: []
|
|
825
824
|
};
|
|
826
|
-
const
|
|
827
|
-
if (t._collectEffectMutation.clean(), !
|
|
825
|
+
const a = t._collectEffectMutation.getEffects();
|
|
826
|
+
if (t._collectEffectMutation.clean(), !a.length)
|
|
828
827
|
return {
|
|
829
828
|
redos: [],
|
|
830
829
|
undos: []
|
|
831
830
|
};
|
|
832
|
-
const
|
|
833
|
-
var
|
|
834
|
-
return !!((
|
|
835
|
-
}).map((
|
|
836
|
-
row:
|
|
837
|
-
col:
|
|
838
|
-
pattern:
|
|
839
|
-
})),
|
|
840
|
-
var
|
|
841
|
-
return !((
|
|
842
|
-
}).map((
|
|
843
|
-
startRow:
|
|
844
|
-
endColumn:
|
|
845
|
-
startColumn:
|
|
846
|
-
endRow:
|
|
831
|
+
const l = a.filter((f) => {
|
|
832
|
+
var v;
|
|
833
|
+
return !!((v = f.value) != null && v.pattern);
|
|
834
|
+
}).map((f) => ({
|
|
835
|
+
row: f.row,
|
|
836
|
+
col: f.col,
|
|
837
|
+
pattern: f.value.pattern
|
|
838
|
+
})), c = a.filter((f) => {
|
|
839
|
+
var v;
|
|
840
|
+
return !((v = f.value) != null && v.pattern);
|
|
841
|
+
}).map((f) => ({
|
|
842
|
+
startRow: f.row,
|
|
843
|
+
endColumn: f.col,
|
|
844
|
+
startColumn: f.col,
|
|
845
|
+
endRow: f.row
|
|
847
846
|
})), m = [], u = [];
|
|
848
|
-
if (
|
|
849
|
-
const
|
|
847
|
+
if (l.length) {
|
|
848
|
+
const f = {
|
|
850
849
|
id: ye.id,
|
|
851
|
-
params: Xt(s, o,
|
|
850
|
+
params: Xt(s, o, l)
|
|
852
851
|
};
|
|
853
|
-
m.push(
|
|
852
|
+
m.push(f), u.push(...qt(t._injector, f.params));
|
|
854
853
|
}
|
|
855
|
-
if (
|
|
856
|
-
const
|
|
854
|
+
if (c.length) {
|
|
855
|
+
const f = {
|
|
857
856
|
id: Se.id,
|
|
858
857
|
params: {
|
|
859
858
|
unitId: s,
|
|
860
859
|
subUnitId: o,
|
|
861
|
-
ranges:
|
|
860
|
+
ranges: c
|
|
862
861
|
}
|
|
863
862
|
};
|
|
864
|
-
m.push(
|
|
863
|
+
m.push(f), u.push(...Jt(t._injector, f.params));
|
|
865
864
|
}
|
|
866
865
|
return {
|
|
867
866
|
redos: m,
|
|
@@ -878,18 +877,18 @@ let Q = class extends ne {
|
|
|
878
877
|
);
|
|
879
878
|
}
|
|
880
879
|
};
|
|
881
|
-
Q =
|
|
882
|
-
L(0, y(
|
|
880
|
+
Q = Gn([
|
|
881
|
+
L(0, y(Xe)),
|
|
883
882
|
L(1, y(ge)),
|
|
884
|
-
L(2, y(
|
|
885
|
-
L(3, y(
|
|
883
|
+
L(2, y(fe)),
|
|
884
|
+
L(3, y(He)),
|
|
886
885
|
L(4, _t(Vt))
|
|
887
886
|
], Q);
|
|
888
|
-
function
|
|
887
|
+
function Zn(e) {
|
|
889
888
|
const { textRuns: t = [], paragraphs: r = [], customRanges: n, customBlocks: i = [] } = e, s = ["va"];
|
|
890
|
-
return !(t.some((o) => !!(o.ts && Object.keys(o.ts).some((
|
|
889
|
+
return !(t.some((o) => !!(o.ts && Object.keys(o.ts).some((l) => s.includes(l)))) || r.some((o) => o.bullet) || r.length >= 2 || n != null && n.length || i.length > 0);
|
|
891
890
|
}
|
|
892
|
-
const
|
|
891
|
+
const st = (e) => [
|
|
893
892
|
{
|
|
894
893
|
label: "sheet.numfmt.general",
|
|
895
894
|
pattern: null
|
|
@@ -950,76 +949,76 @@ const ot = (e) => [
|
|
|
950
949
|
label: "sheet.numfmt.moreFmt",
|
|
951
950
|
pattern: ""
|
|
952
951
|
}
|
|
953
|
-
],
|
|
952
|
+
], Yn = (e) => ({
|
|
954
953
|
icon: new A((t) => {
|
|
955
954
|
const r = e.get(E);
|
|
956
955
|
return t.next(Pe(r.getCurrentLocale()).icon), r.localeChanged$.subscribe(() => {
|
|
957
956
|
t.next(Pe(r.getCurrentLocale()).icon);
|
|
958
957
|
});
|
|
959
958
|
}),
|
|
960
|
-
id:
|
|
959
|
+
id: ze.id,
|
|
961
960
|
title: "sheet.numfmt.currency",
|
|
962
961
|
tooltip: "sheet.numfmt.currency",
|
|
963
962
|
type: X.BUTTON,
|
|
964
|
-
hidden$: z(e,
|
|
963
|
+
hidden$: z(e, w.UNIVER_SHEET),
|
|
965
964
|
disabled$: W(e, { workbookTypes: [Y], worksheetTypes: [Z, K], rangeTypes: [G] })
|
|
966
|
-
}),
|
|
965
|
+
}), zn = (e) => ({
|
|
967
966
|
icon: "AddDigitsIcon",
|
|
968
|
-
id:
|
|
967
|
+
id: Ye.id,
|
|
969
968
|
title: "sheet.numfmt.addDecimal",
|
|
970
969
|
tooltip: "sheet.numfmt.addDecimal",
|
|
971
970
|
type: X.BUTTON,
|
|
972
|
-
hidden$: z(e,
|
|
971
|
+
hidden$: z(e, w.UNIVER_SHEET),
|
|
973
972
|
disabled$: W(e, { workbookTypes: [Y], worksheetTypes: [Z, K], rangeTypes: [G] })
|
|
974
|
-
}),
|
|
973
|
+
}), Xn = (e) => ({
|
|
975
974
|
icon: "ReduceDigitsIcon",
|
|
976
|
-
id:
|
|
975
|
+
id: Ze.id,
|
|
977
976
|
title: "sheet.numfmt.subtractDecimal",
|
|
978
977
|
tooltip: "sheet.numfmt.subtractDecimal",
|
|
979
978
|
type: X.BUTTON,
|
|
980
|
-
hidden$: z(e,
|
|
979
|
+
hidden$: z(e, w.UNIVER_SHEET),
|
|
981
980
|
disabled$: W(e, { workbookTypes: [Y], worksheetTypes: [Z, K], rangeTypes: [G] })
|
|
982
|
-
}),
|
|
981
|
+
}), qn = (e) => ({
|
|
983
982
|
icon: "PercentIcon",
|
|
984
|
-
id:
|
|
983
|
+
id: Ke.id,
|
|
985
984
|
title: "sheet.numfmt.percent",
|
|
986
985
|
tooltip: "sheet.numfmt.percent",
|
|
987
986
|
type: X.BUTTON,
|
|
988
|
-
hidden$: z(e,
|
|
987
|
+
hidden$: z(e, w.UNIVER_SHEET),
|
|
989
988
|
disabled$: W(e, { workbookTypes: [Y], worksheetTypes: [Z, K], rangeTypes: [G] })
|
|
990
|
-
}),
|
|
991
|
-
const t = e.get(
|
|
989
|
+
}), Jn = (e) => {
|
|
990
|
+
const t = e.get(fe), r = e.get(ve), n = e.get(E), i = e.get(_e), s = [Se.id, ye.id], o = Wt(
|
|
992
991
|
t,
|
|
993
992
|
"",
|
|
994
|
-
({ workbook:
|
|
995
|
-
(
|
|
993
|
+
({ workbook: a, worksheet: l }) => new A(
|
|
994
|
+
(c) => Je(
|
|
996
995
|
i.selectionMoveEnd$,
|
|
997
996
|
yt(r.onCommandExecuted.bind(r)).pipe(
|
|
998
997
|
an(([m]) => s.includes(m.id))
|
|
999
998
|
)
|
|
1000
999
|
).subscribe(() => {
|
|
1001
|
-
var u,
|
|
1000
|
+
var u, f;
|
|
1002
1001
|
const m = i.getCurrentSelections();
|
|
1003
1002
|
if (m && m[0]) {
|
|
1004
|
-
const
|
|
1003
|
+
const v = m[0].range, p = v.startRow, d = v.startColumn, S = (f = a.getStyles().get((u = l.getCell(p, d)) == null ? void 0 : u.s)) == null ? void 0 : f.n, g = S == null ? void 0 : S.pattern, I = $t(n.getCurrentLocale());
|
|
1005
1004
|
let P = n.t("sheet.numfmt.general");
|
|
1006
1005
|
if (Ct(g)) {
|
|
1007
|
-
|
|
1006
|
+
c.next(P);
|
|
1008
1007
|
return;
|
|
1009
1008
|
}
|
|
1010
1009
|
if (g) {
|
|
1011
|
-
const
|
|
1012
|
-
(
|
|
1010
|
+
const O = st(I).filter((k) => typeof k == "object" && k.pattern).find(
|
|
1011
|
+
(k) => re(g, k.pattern)
|
|
1013
1012
|
);
|
|
1014
|
-
|
|
1013
|
+
O && typeof O == "object" && O.pattern ? P = n.t(O.label) : P = n.t("sheet.numfmt.moreFmt");
|
|
1015
1014
|
}
|
|
1016
|
-
|
|
1015
|
+
c.next(P);
|
|
1017
1016
|
}
|
|
1018
1017
|
})
|
|
1019
1018
|
)
|
|
1020
1019
|
);
|
|
1021
1020
|
return {
|
|
1022
|
-
label:
|
|
1021
|
+
label: ot,
|
|
1023
1022
|
id: H.id,
|
|
1024
1023
|
tooltip: "sheet.numfmt.title",
|
|
1025
1024
|
type: X.SELECTOR,
|
|
@@ -1027,92 +1026,92 @@ const ot = (e) => [
|
|
|
1027
1026
|
selections: [
|
|
1028
1027
|
{
|
|
1029
1028
|
label: {
|
|
1030
|
-
name:
|
|
1029
|
+
name: at,
|
|
1031
1030
|
hoverable: !1,
|
|
1032
1031
|
selectable: !1
|
|
1033
1032
|
}
|
|
1034
1033
|
}
|
|
1035
1034
|
],
|
|
1036
1035
|
value$: o,
|
|
1037
|
-
hidden$: z(e,
|
|
1036
|
+
hidden$: z(e, w.UNIVER_SHEET),
|
|
1038
1037
|
disabled$: W(e, { workbookTypes: [Y], worksheetTypes: [K, Z], rangeTypes: [G] })
|
|
1039
1038
|
};
|
|
1040
|
-
},
|
|
1039
|
+
}, ot = "sheet.numfmt.moreNumfmtType", at = "sheet.numfmt.moreNumfmtType.options", Qn = (e) => {
|
|
1041
1040
|
const { value: t } = e, r = b(E), n = t != null ? t : r.t("sheet.numfmt.general");
|
|
1042
1041
|
return /* @__PURE__ */ h("span", { className: "univer-text-sm", children: n });
|
|
1043
|
-
},
|
|
1044
|
-
const e = b(
|
|
1042
|
+
}, er = () => {
|
|
1043
|
+
const e = b(ve), t = b(E), r = b(tn), n = b(We), i = b(_e), s = (c) => {
|
|
1045
1044
|
const m = i.getCurrentLastSelection();
|
|
1046
1045
|
if (!m)
|
|
1047
1046
|
return;
|
|
1048
|
-
const u = m.range,
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
}), e.executeCommand(
|
|
1047
|
+
const u = m.range, f = [];
|
|
1048
|
+
Ae.foreach(u, (v, p) => {
|
|
1049
|
+
c ? f.push({ row: v, col: p, pattern: c, type: pe(c) }) : f.push({ row: v, col: p });
|
|
1050
|
+
}), e.executeCommand(Ge.id, { values: f }), r.focus();
|
|
1052
1051
|
}, o = x(() => {
|
|
1053
|
-
const
|
|
1054
|
-
return
|
|
1055
|
-
}, [t]),
|
|
1056
|
-
if (
|
|
1052
|
+
const c = Dt.get(t.getCurrentLocale());
|
|
1053
|
+
return st(c);
|
|
1054
|
+
}, [t]), a = (c) => {
|
|
1055
|
+
if (c === 0)
|
|
1057
1056
|
s(null);
|
|
1058
|
-
else if (
|
|
1057
|
+
else if (c === o.length - 1)
|
|
1059
1058
|
e.executeCommand(H.id), r.focus();
|
|
1060
1059
|
else {
|
|
1061
|
-
const m = o[
|
|
1060
|
+
const m = o[c];
|
|
1062
1061
|
m.pattern && s(m.pattern);
|
|
1063
1062
|
}
|
|
1064
|
-
},
|
|
1065
|
-
return /* @__PURE__ */ h("div", { className: "univer-grid univer-gap-1 univer-p-1.5", children: o.map((
|
|
1063
|
+
}, l = 1220;
|
|
1064
|
+
return /* @__PURE__ */ h("div", { className: "univer-grid univer-gap-1 univer-p-1.5", children: o.map((c, m) => c === "|" ? /* @__PURE__ */ h(gn, {}, m) : /* @__PURE__ */ C(
|
|
1066
1065
|
"div",
|
|
1067
1066
|
{
|
|
1068
1067
|
className: "univer-flex univer-h-7 univer-items-center univer-justify-between univer-gap-6 univer-rounded univer-px-2 univer-text-sm hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
|
|
1069
1068
|
onClick: () => {
|
|
1070
|
-
|
|
1069
|
+
a(m);
|
|
1071
1070
|
},
|
|
1072
1071
|
children: [
|
|
1073
|
-
/* @__PURE__ */ h("span", { children: t.t(
|
|
1074
|
-
/* @__PURE__ */ h("span", { className: "univer-text-xs univer-text-gray-500", children:
|
|
1072
|
+
/* @__PURE__ */ h("span", { children: t.t(c.label) }),
|
|
1073
|
+
/* @__PURE__ */ h("span", { className: "univer-text-xs univer-text-gray-500", children: c.pattern ? Ft(c.pattern || "", l, n.locale).result.trim() : "" })
|
|
1075
1074
|
]
|
|
1076
1075
|
},
|
|
1077
1076
|
m
|
|
1078
1077
|
)) });
|
|
1079
|
-
},
|
|
1078
|
+
}, tr = {
|
|
1080
1079
|
[nn.FORMULAS]: {
|
|
1081
|
-
[
|
|
1080
|
+
[ze.id]: {
|
|
1082
1081
|
order: 0,
|
|
1083
|
-
menuItemFactory:
|
|
1082
|
+
menuItemFactory: Yn
|
|
1084
1083
|
},
|
|
1085
|
-
[
|
|
1084
|
+
[Ye.id]: {
|
|
1086
1085
|
order: 1,
|
|
1087
|
-
menuItemFactory:
|
|
1086
|
+
menuItemFactory: zn
|
|
1088
1087
|
},
|
|
1089
|
-
[
|
|
1088
|
+
[Ze.id]: {
|
|
1090
1089
|
order: 2,
|
|
1091
|
-
menuItemFactory:
|
|
1090
|
+
menuItemFactory: Xn
|
|
1092
1091
|
},
|
|
1093
|
-
[
|
|
1092
|
+
[Ke.id]: {
|
|
1094
1093
|
order: 3,
|
|
1095
|
-
menuItemFactory:
|
|
1094
|
+
menuItemFactory: qn
|
|
1096
1095
|
},
|
|
1097
1096
|
[H.id]: {
|
|
1098
1097
|
order: 4,
|
|
1099
|
-
menuItemFactory:
|
|
1098
|
+
menuItemFactory: Jn
|
|
1100
1099
|
}
|
|
1101
1100
|
}
|
|
1102
1101
|
};
|
|
1103
|
-
var
|
|
1104
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1102
|
+
var nr = Object.getOwnPropertyDescriptor, rr = (e, t, r, n) => {
|
|
1103
|
+
for (var i = n > 1 ? void 0 : n ? nr(t, r) : t, s = e.length - 1, o; s >= 0; s--)
|
|
1105
1104
|
(o = e[s]) && (i = o(i) || i);
|
|
1106
1105
|
return i;
|
|
1107
|
-
},
|
|
1106
|
+
}, Ue = (e, t) => (r, n) => t(r, n, e);
|
|
1108
1107
|
let ee = class extends ne {
|
|
1109
1108
|
constructor(e, t) {
|
|
1110
1109
|
super(), this._componentManager = e, this._menuManagerService = t, this._initMenu();
|
|
1111
1110
|
}
|
|
1112
1111
|
_initMenu() {
|
|
1113
|
-
this._menuManagerService.mergeMenu(
|
|
1114
|
-
[
|
|
1115
|
-
[
|
|
1112
|
+
this._menuManagerService.mergeMenu(tr), [
|
|
1113
|
+
[ot, Qn],
|
|
1114
|
+
[at, er]
|
|
1116
1115
|
].forEach(([e, t]) => {
|
|
1117
1116
|
this.disposeWithMe(
|
|
1118
1117
|
this._componentManager.register(e, t)
|
|
@@ -1120,22 +1119,22 @@ let ee = class extends ne {
|
|
|
1120
1119
|
});
|
|
1121
1120
|
}
|
|
1122
1121
|
};
|
|
1123
|
-
ee =
|
|
1124
|
-
|
|
1125
|
-
|
|
1122
|
+
ee = rr([
|
|
1123
|
+
Ue(0, y(qe)),
|
|
1124
|
+
Ue(1, rn)
|
|
1126
1125
|
], ee);
|
|
1127
|
-
var
|
|
1128
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1126
|
+
var ir = Object.defineProperty, sr = Object.getOwnPropertyDescriptor, or = (e, t, r) => t in e ? ir(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ar = (e, t, r, n) => {
|
|
1127
|
+
for (var i = n > 1 ? void 0 : n ? sr(t, r) : t, s = e.length - 1, o; s >= 0; s--)
|
|
1129
1128
|
(o = e[s]) && (i = o(i) || i);
|
|
1130
1129
|
return i;
|
|
1131
|
-
}, me = (e, t) => (r, n) => t(r, n, e),
|
|
1132
|
-
const
|
|
1130
|
+
}, me = (e, t) => (r, n) => t(r, n, e), ct = (e, t, r) => or(e, typeof t != "symbol" ? t + "" : t, r);
|
|
1131
|
+
const cr = "SHEET_NUMFMT_UI_PLUGIN";
|
|
1133
1132
|
let te = class extends Nt {
|
|
1134
|
-
constructor(e =
|
|
1133
|
+
constructor(e = Oe, t, r, n) {
|
|
1135
1134
|
super(), this._config = e, this._injector = t, this._configService = r, this._renderManagerService = n;
|
|
1136
1135
|
const { menu: i, ...s } = Et(
|
|
1137
1136
|
{},
|
|
1138
|
-
|
|
1137
|
+
Oe,
|
|
1139
1138
|
this._config
|
|
1140
1139
|
);
|
|
1141
1140
|
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig("sheets-numfmt-ui.config", s);
|
|
@@ -1149,7 +1148,7 @@ let te = class extends Nt {
|
|
|
1149
1148
|
]);
|
|
1150
1149
|
}
|
|
1151
1150
|
onRendered() {
|
|
1152
|
-
this._registerRenderModules(),
|
|
1151
|
+
this._registerRenderModules(), wt(this._injector, [
|
|
1153
1152
|
[B],
|
|
1154
1153
|
[Q],
|
|
1155
1154
|
[ee]
|
|
@@ -1159,17 +1158,17 @@ let te = class extends Nt {
|
|
|
1159
1158
|
[
|
|
1160
1159
|
[he]
|
|
1161
1160
|
].forEach((t) => {
|
|
1162
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
1161
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(w.UNIVER_SHEET, t));
|
|
1163
1162
|
});
|
|
1164
1163
|
}
|
|
1165
1164
|
};
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
te =
|
|
1165
|
+
ct(te, "pluginName", cr);
|
|
1166
|
+
ct(te, "type", w.UNIVER_SHEET);
|
|
1167
|
+
te = ar([
|
|
1169
1168
|
It(Gt, Lt),
|
|
1170
|
-
me(1, y(
|
|
1169
|
+
me(1, y(He)),
|
|
1171
1170
|
me(2, $e),
|
|
1172
|
-
me(3,
|
|
1171
|
+
me(3, je)
|
|
1173
1172
|
], te);
|
|
1174
1173
|
export {
|
|
1175
1174
|
te as UniverSheetsNumfmtUIPlugin
|