@univerjs/sheets-numfmt-ui 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/es/index.js +410 -404
- package/lib/es/locale/fr-FR.js +41 -0
- package/lib/types/controllers/config.schema.d.ts +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/locale/fr-FR.d.ts +3 -0
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/fr-FR.js +1 -0
- package/package.json +18 -16
package/lib/es/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { currencySymbols as
|
|
6
|
-
import { SheetSkeletonManagerService as
|
|
7
|
-
import { ComponentManager as
|
|
8
|
-
import { IRenderManagerService as
|
|
9
|
-
import { INTERCEPTOR_POINT as
|
|
10
|
-
import { Observable as U, combineLatest as
|
|
11
|
-
import { map as
|
|
12
|
-
import
|
|
13
|
-
import { InputNumber as
|
|
14
|
-
import { DEFAULT_TEXT_FORMAT as
|
|
15
|
-
const
|
|
1
|
+
var at = Object.defineProperty;
|
|
2
|
+
var lt = (t, e, r) => e in t ? at(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var X = (t, e, r) => lt(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { CommandType as $e, Inject as N, ILocalStorageService as Fe, useDependency as y, LocaleService as T, numfmt as Z, Disposable as pe, UniverInstanceType as E, CellValueType as L, Range as Le, toDisposable as fe, DisposableCollection as mt, InterceptorEffectEnum as xe, ThemeService as ut, IUniverInstanceService as ve, ICommandService as ge, Injector as He, Optional as dt, useInjector as ht, DependentOn as ft, Plugin as pt, registerDependencies as vt, touchDependencies as gt, IConfigService as _t } from "@univerjs/core";
|
|
5
|
+
import { currencySymbols as Pe, getDecimalFromPattern as ee, getCurrencyType as B, setPatternDecimal as j, getCurrencyFormatOptions as le, isPatternEqualWithoutDecimal as ie, CURRENCYFORMAT as St, DATEFMTLISG as yt, NUMBERFORMAT as bt, getDateFormatOptions as ke, getNumberFormatOptions as Ae, isPatternHasDecimal as Ct, getPatternType as te, SetNumfmtCommand as Be, getPatternPreviewIgnoreGeneral as It, MenuCurrencyService as Nt, countryCurrencyMap as w, SetCurrencyCommand as We, AddDecimalCommand as Ve, SubtractDecimalCommand as Ge, SetPercentCommand as Ke, getPatternPreview as Et, UniverSheetsNumfmtPlugin as Tt } from "@univerjs/sheets-numfmt";
|
|
6
|
+
import { SheetSkeletonManagerService as xt, IEditorBridgeService as Pt, getCurrentRangeDisable$ as W, deriveStateFromActiveSheet$ as jt, UniverSheetsUIPlugin as Rt } from "@univerjs/sheets-ui";
|
|
7
|
+
import { ComponentManager as qe, ISidebarService as Mt, MenuItemType as V, getMenuHiddenObservable as G, ILayoutService as Ot, RibbonStartGroup as wt, IMenuManagerService as Ut, UI_PLUGIN_CONFIG_KEY as Dt } from "@univerjs/ui";
|
|
8
|
+
import { IRenderManagerService as $t } from "@univerjs/engine-render";
|
|
9
|
+
import { INTERCEPTOR_POINT as Ft, RemoveNumfmtMutation as _e, SetNumfmtMutation as Se, SheetInterceptorService as Ye, SheetsSelectionsService as ye, INumfmtService as Je, BEFORE_CELL_EDIT as Lt, AFTER_CELL_EDIT as Ht, SetRangeValuesCommand as kt, transformCellsToRange as At, factorySetNumfmtUndoMutation as Bt, factoryRemoveNumfmtUndoMutation as Wt, WorkbookEditablePermission as K, WorksheetEditPermission as q, WorksheetSetCellStylePermission as Y, RangeProtectionPermissionEditPoint as J } from "@univerjs/sheets";
|
|
10
|
+
import { Observable as U, combineLatest as Vt, merge as Gt } from "rxjs";
|
|
11
|
+
import { map as Kt, switchMap as qt, tap as Yt, debounceTime as Jt } from "rxjs/operators";
|
|
12
|
+
import zt, { createContext as Xt, useState as b, useEffect as oe, useRef as be, useContext as ze, useMemo as R, forwardRef as Xe, createElement as Ce } from "react";
|
|
13
|
+
import { InputNumber as Ie, Select as Ne, SelectList as Ee, Input as Zt, Button as je } from "@univerjs/design";
|
|
14
|
+
import { DEFAULT_TEXT_FORMAT as Ze } from "@univerjs/engine-numfmt";
|
|
15
|
+
const Qt = {}, me = {
|
|
16
16
|
id: "sheet.operation.close.numfmt.panel",
|
|
17
|
-
type:
|
|
17
|
+
type: $e.OPERATION,
|
|
18
18
|
handler: () => (
|
|
19
19
|
// do nothing, just notify panel is closed
|
|
20
20
|
!0
|
|
21
21
|
)
|
|
22
22
|
}, H = {
|
|
23
23
|
id: "sheet.operation.open.numfmt.panel",
|
|
24
|
-
type:
|
|
24
|
+
type: $e.OPERATION,
|
|
25
25
|
handler: (t) => (t.get(A).openPanel(), !0)
|
|
26
26
|
};
|
|
27
|
-
var
|
|
27
|
+
var ue = { exports: {} }, $ = {};
|
|
28
28
|
/**
|
|
29
29
|
* @license React
|
|
30
30
|
* react-jsx-runtime.production.min.js
|
|
@@ -34,24 +34,30 @@ var Je = { exports: {} }, oe = {};
|
|
|
34
34
|
* This source code is licensed under the MIT license found in the
|
|
35
35
|
* LICENSE file in the root directory of this source tree.
|
|
36
36
|
*/
|
|
37
|
-
var
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
var Re;
|
|
38
|
+
function en() {
|
|
39
|
+
if (Re) return $;
|
|
40
|
+
Re = 1;
|
|
41
|
+
var t = zt, e = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
42
|
+
function o(c, a, h) {
|
|
43
|
+
var d, m = {}, u = null, p = null;
|
|
44
|
+
h !== void 0 && (u = "" + h), a.key !== void 0 && (u = "" + a.key), a.ref !== void 0 && (p = a.ref);
|
|
45
|
+
for (d in a) n.call(a, d) && !i.hasOwnProperty(d) && (m[d] = a[d]);
|
|
46
|
+
if (c && c.defaultProps) for (d in a = c.defaultProps, a) m[d] === void 0 && (m[d] = a[d]);
|
|
47
|
+
return { $$typeof: e, type: c, key: u, ref: p, props: m, _owner: s.current };
|
|
48
|
+
}
|
|
49
|
+
return $.Fragment = r, $.jsx = o, $.jsxs = o, $;
|
|
50
|
+
}
|
|
51
|
+
var Me;
|
|
52
|
+
function tn() {
|
|
53
|
+
return Me || (Me = 1, ue.exports = en()), ue.exports;
|
|
44
54
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
oe.jsxs = Xe;
|
|
48
|
-
Je.exports = oe;
|
|
49
|
-
var a = Je.exports, on = Object.defineProperty, cn = Object.getOwnPropertyDescriptor, an = (t, e, r, n) => {
|
|
50
|
-
for (var s = n > 1 ? void 0 : n ? cn(e, r) : e, i = t.length - 1, o; i >= 0; i--)
|
|
55
|
+
var l = tn(), nn = Object.defineProperty, rn = Object.getOwnPropertyDescriptor, sn = (t, e, r, n) => {
|
|
56
|
+
for (var s = n > 1 ? void 0 : n ? rn(e, r) : e, i = t.length - 1, o; i >= 0; i--)
|
|
51
57
|
(o = t[i]) && (s = (n ? o(e, r, s) : o(s)) || s);
|
|
52
|
-
return n && s &&
|
|
53
|
-
},
|
|
54
|
-
const
|
|
58
|
+
return n && s && nn(e, r, s), s;
|
|
59
|
+
}, on = (t, e) => (r, n) => e(r, n, t);
|
|
60
|
+
const Te = Xt([]);
|
|
55
61
|
let k = class {
|
|
56
62
|
constructor(t) {
|
|
57
63
|
this._localStorageService = t;
|
|
@@ -78,16 +84,16 @@ let k = class {
|
|
|
78
84
|
const r = this._getKey(t), n = await this._localStorageService.getItem(r);
|
|
79
85
|
if (e && n) {
|
|
80
86
|
const s = n.map((i, o, c) => {
|
|
81
|
-
const
|
|
87
|
+
const a = c.length;
|
|
82
88
|
return {
|
|
83
89
|
value: i,
|
|
84
|
-
priority:
|
|
90
|
+
priority: a - o
|
|
85
91
|
};
|
|
86
92
|
});
|
|
87
93
|
return e.sort((i, o) => {
|
|
88
|
-
var h,
|
|
94
|
+
var h, d;
|
|
89
95
|
const c = ((h = s.find((m) => m.value === i)) == null ? void 0 : h.priority) || -1;
|
|
90
|
-
return (((
|
|
96
|
+
return (((d = s.find((m) => m.value === o)) == null ? void 0 : d.priority) || -1) - c;
|
|
91
97
|
});
|
|
92
98
|
}
|
|
93
99
|
return n || [];
|
|
@@ -96,111 +102,111 @@ let k = class {
|
|
|
96
102
|
this._localStorageService.removeItem(t);
|
|
97
103
|
}
|
|
98
104
|
};
|
|
99
|
-
k =
|
|
100
|
-
|
|
105
|
+
k = sn([
|
|
106
|
+
on(0, N(Fe))
|
|
101
107
|
], k);
|
|
102
|
-
const
|
|
103
|
-
const e =
|
|
104
|
-
return
|
|
108
|
+
const Oe = "numfmtCurrency", cn = (t) => {
|
|
109
|
+
const e = y(k), [r, n] = b(Pe);
|
|
110
|
+
return oe(() => {
|
|
105
111
|
e.addHabit("numfmtCurrency", []).then(() => {
|
|
106
|
-
e.getHabit(
|
|
112
|
+
e.getHabit(Oe, [...Pe]).then((i) => {
|
|
107
113
|
n(i), t && t(i);
|
|
108
114
|
});
|
|
109
115
|
});
|
|
110
116
|
}, []), { userHabitCurrency: r, mark: (i) => {
|
|
111
|
-
e.markHabit(
|
|
117
|
+
e.markHabit(Oe, i);
|
|
112
118
|
} };
|
|
113
|
-
},
|
|
114
|
-
const t =
|
|
115
|
-
return
|
|
119
|
+
}, an = () => {
|
|
120
|
+
const t = be([]), [e, r] = b({});
|
|
121
|
+
return oe(() => {
|
|
116
122
|
t.current.forEach((s) => {
|
|
117
123
|
s();
|
|
118
124
|
}), t.current = [];
|
|
119
125
|
}, [e]), (s) => {
|
|
120
126
|
t.current.push(s), r({});
|
|
121
127
|
};
|
|
122
|
-
},
|
|
123
|
-
const { defaultPattern: e, action: r, onChange: n } = t, [s, i] =
|
|
128
|
+
}, ln = (t) => !!B(t) && t.startsWith("_("), mn = (t) => {
|
|
129
|
+
const { defaultPattern: e, action: r, onChange: n } = t, [s, i] = b(() => ee(e || "", 2)), o = ze(Te), [c, a] = b(() => B(e) || o[0]), h = R(() => o.map((v) => ({ label: v, value: v })), []), m = y(T).t;
|
|
124
130
|
r.current = () => j(`_("${c}"* #,##0${s > 0 ? ".0" : ""}_)`, s);
|
|
125
131
|
const u = (v) => {
|
|
126
|
-
|
|
132
|
+
a(v), n(j(`_("${v}"* #,##0${s > 0 ? ".0" : ""}_)`, s));
|
|
127
133
|
}, p = (v) => {
|
|
128
|
-
const
|
|
129
|
-
i(
|
|
134
|
+
const f = v || 0;
|
|
135
|
+
i(f), n(j(`_("${c}"* #,##0${f > 0 ? ".0" : ""}_)`, f));
|
|
130
136
|
};
|
|
131
|
-
return /* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
137
|
+
return /* @__PURE__ */ l.jsxs("div", { children: [
|
|
138
|
+
/* @__PURE__ */ l.jsxs("div", { className: "m-t-16 options", children: [
|
|
139
|
+
/* @__PURE__ */ l.jsxs("div", { className: "option", children: [
|
|
140
|
+
/* @__PURE__ */ l.jsx("div", { className: "label", children: m("sheet.numfmt.decimalLength") }),
|
|
141
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ l.jsx(Ie, { value: s, max: 20, min: 0, onChange: p }) })
|
|
136
142
|
] }),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ l.jsxs("div", { className: "option", children: [
|
|
144
|
+
/* @__PURE__ */ l.jsx("div", { className: "label", children: m("sheet.numfmt.currencyType") }),
|
|
145
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ l.jsx(Ne, { onChange: u, options: h, value: c }) })
|
|
140
146
|
] })
|
|
141
147
|
] }),
|
|
142
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ l.jsx("div", { className: "describe m-t-14", children: m("sheet.numfmt.accountingDes") })
|
|
143
149
|
] });
|
|
144
|
-
},
|
|
145
|
-
const r =
|
|
150
|
+
}, un = (t) => !!B(t) && !t.startsWith("_("), dn = (t) => {
|
|
151
|
+
const r = y(T).t, n = ze(Te), [s, i] = b(() => B(t.defaultPattern) || n[0]), [o, c] = b(() => ee(t.defaultPattern || "", 2)), [a, h] = b(() => {
|
|
146
152
|
var g;
|
|
147
|
-
const
|
|
148
|
-
return ((g =
|
|
149
|
-
}),
|
|
150
|
-
t.action.current = () => j(
|
|
151
|
-
const u = (
|
|
152
|
-
if (
|
|
153
|
+
const f = le(s);
|
|
154
|
+
return ((g = f.find((C) => ie(C.value, t.defaultPattern))) == null ? void 0 : g.value) || f[0].value;
|
|
155
|
+
}), d = R(() => le(s), [s]), m = R(() => n.map((f) => ({ label: f, value: f })), [n]);
|
|
156
|
+
t.action.current = () => j(a, o);
|
|
157
|
+
const u = (f) => {
|
|
158
|
+
if (f === void 0)
|
|
153
159
|
return;
|
|
154
|
-
i(
|
|
155
|
-
const S = le(
|
|
160
|
+
i(f);
|
|
161
|
+
const S = le(f)[0].value;
|
|
156
162
|
h(S), t.onChange(j(S, o));
|
|
157
|
-
}, p = (
|
|
158
|
-
|
|
159
|
-
}, v = (
|
|
160
|
-
c(
|
|
163
|
+
}, p = (f) => {
|
|
164
|
+
f !== void 0 && (h(f), t.onChange(j(f, o)));
|
|
165
|
+
}, v = (f) => {
|
|
166
|
+
c(f || 0), t.onChange(j(a, f || 0));
|
|
161
167
|
};
|
|
162
|
-
return /* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ l.jsxs("div", { children: [
|
|
169
|
+
/* @__PURE__ */ l.jsxs("div", { className: "m-t-16 options", children: [
|
|
170
|
+
/* @__PURE__ */ l.jsxs("div", { className: "option", children: [
|
|
171
|
+
/* @__PURE__ */ l.jsx("div", { className: "label", children: r("sheet.numfmt.decimalLength") }),
|
|
172
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ l.jsx(Ie, { value: o, max: 20, min: 0, onChange: v }) })
|
|
167
173
|
] }),
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ l.jsxs("div", { className: "option", children: [
|
|
175
|
+
/* @__PURE__ */ l.jsx("div", { className: "label", children: r("sheet.numfmt.currencyType") }),
|
|
176
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ l.jsx(Ne, { onChange: u, options: m, value: s }) })
|
|
171
177
|
] })
|
|
172
178
|
] }),
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-16 label", children: r("sheet.numfmt.negType") }),
|
|
180
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ l.jsx(Ee, { onChange: p, options: d, value: a }) }),
|
|
181
|
+
/* @__PURE__ */ l.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.currencyDes") })
|
|
176
182
|
] });
|
|
177
183
|
};
|
|
178
|
-
var
|
|
179
|
-
return
|
|
184
|
+
var I = function() {
|
|
185
|
+
return I = Object.assign || function(t) {
|
|
180
186
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
181
187
|
e = arguments[r];
|
|
182
188
|
for (var s in e) Object.prototype.hasOwnProperty.call(e, s) && (t[s] = e[s]);
|
|
183
189
|
}
|
|
184
190
|
return t;
|
|
185
|
-
},
|
|
186
|
-
},
|
|
191
|
+
}, I.apply(this, arguments);
|
|
192
|
+
}, hn = function(t, e) {
|
|
187
193
|
var r = {};
|
|
188
194
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
|
|
189
195
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
190
196
|
for (var s = 0, n = Object.getOwnPropertySymbols(t); s < n.length; s++)
|
|
191
197
|
e.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[s]) && (r[n[s]] = t[n[s]]);
|
|
192
198
|
return r;
|
|
193
|
-
},
|
|
194
|
-
var r = t.icon, n = t.id, s = t.className, i = t.extend, o =
|
|
195
|
-
return
|
|
199
|
+
}, Qe = Xe(function(t, e) {
|
|
200
|
+
var r = t.icon, n = t.id, s = t.className, i = t.extend, o = hn(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(s || "").trim(), a = be("_".concat(vn()));
|
|
201
|
+
return et(r, "".concat(n), { defIds: r.defIds, idSuffix: a.current }, I({ ref: e, className: c }, o), i);
|
|
196
202
|
});
|
|
197
|
-
function
|
|
198
|
-
return
|
|
199
|
-
return
|
|
203
|
+
function et(t, e, r, n, s) {
|
|
204
|
+
return Ce(t.tag, I(I({ key: e }, fn(t, r, s)), n), (pn(t, r).children || []).map(function(i, o) {
|
|
205
|
+
return et(i, "".concat(e, "-").concat(t.tag, "-").concat(o), r, void 0, s);
|
|
200
206
|
}));
|
|
201
207
|
}
|
|
202
|
-
function
|
|
203
|
-
var n =
|
|
208
|
+
function fn(t, e, r) {
|
|
209
|
+
var n = I({}, t.attrs);
|
|
204
210
|
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
|
|
205
211
|
var s = e.defIds;
|
|
206
212
|
return !s || s.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(i) {
|
|
@@ -208,75 +214,75 @@ function gn(t, e, r) {
|
|
|
208
214
|
typeof c == "string" && (n[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
209
215
|
})), n;
|
|
210
216
|
}
|
|
211
|
-
function
|
|
217
|
+
function pn(t, e) {
|
|
212
218
|
var r, n = e.defIds;
|
|
213
|
-
return !n || n.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ?
|
|
214
|
-
return typeof s.attrs.id == "string" && n && n.indexOf(s.attrs.id) > -1 ?
|
|
219
|
+
return !n || n.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? I(I({}, t), { children: t.children.map(function(s) {
|
|
220
|
+
return typeof s.attrs.id == "string" && n && n.indexOf(s.attrs.id) > -1 ? I(I({}, s), { attrs: I(I({}, s.attrs), { id: s.attrs.id + e.idSuffix }) }) : s;
|
|
215
221
|
}) }) : t;
|
|
216
222
|
}
|
|
217
|
-
function
|
|
223
|
+
function vn() {
|
|
218
224
|
return Math.random().toString(36).substring(2, 8);
|
|
219
225
|
}
|
|
220
|
-
|
|
221
|
-
var
|
|
222
|
-
return
|
|
226
|
+
Qe.displayName = "UniverIcon";
|
|
227
|
+
var gn = { tag: "svg", attrs: { 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" } }] }, tt = Xe(function(t, e) {
|
|
228
|
+
return Ce(Qe, Object.assign({}, t, {
|
|
223
229
|
id: "check-mark-single",
|
|
224
230
|
ref: e,
|
|
225
|
-
icon:
|
|
231
|
+
icon: gn
|
|
226
232
|
}));
|
|
227
233
|
});
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
customFormatTitle:
|
|
231
|
-
customFormatInput:
|
|
232
|
-
customFormatHistoryList:
|
|
233
|
-
customFormatHistoryListItem:
|
|
234
|
-
customFormatHistoryListItemIconWrap:
|
|
235
|
-
customFormatDes:
|
|
236
|
-
},
|
|
237
|
-
function
|
|
238
|
-
const { defaultPattern: e, action: r, onChange: n } = t, s =
|
|
239
|
-
r.current = () => (s.markHabit(
|
|
240
|
-
const v = [.../* @__PURE__ */ new Set([c, ...p || []])].splice(0, 10).filter((
|
|
241
|
-
i.setItem(
|
|
234
|
+
tt.displayName = "CheckMarkSingle";
|
|
235
|
+
const _n = "univer-custom-format-title", Sn = "univer-custom-format-input", yn = "univer-custom-format-history-list", bn = "univer-custom-format-history-list-item", Cn = "univer-custom-format-history-list-item-icon-wrap", In = "univer-custom-format-des", M = {
|
|
236
|
+
customFormatTitle: _n,
|
|
237
|
+
customFormatInput: Sn,
|
|
238
|
+
customFormatHistoryList: yn,
|
|
239
|
+
customFormatHistoryListItem: bn,
|
|
240
|
+
customFormatHistoryListItemIconWrap: Cn,
|
|
241
|
+
customFormatDes: In
|
|
242
|
+
}, de = "customFormat", he = "numfmt_custom_pattern";
|
|
243
|
+
function Nn(t) {
|
|
244
|
+
const { defaultPattern: e, action: r, onChange: n } = t, s = y(k), i = y(Fe), o = y(T), [c, a] = b(e);
|
|
245
|
+
r.current = () => (s.markHabit(de, c), i.getItem(he).then((p = []) => {
|
|
246
|
+
const v = [.../* @__PURE__ */ new Set([c, ...p || []])].splice(0, 10).filter((f) => !!f);
|
|
247
|
+
i.setItem(he, v);
|
|
242
248
|
}), c);
|
|
243
|
-
const [h,
|
|
244
|
-
|
|
245
|
-
i.getItem(
|
|
249
|
+
const [h, d] = b([]);
|
|
250
|
+
oe(() => {
|
|
251
|
+
i.getItem(he).then((p) => {
|
|
246
252
|
const v = [
|
|
247
|
-
...
|
|
248
|
-
...
|
|
249
|
-
...
|
|
253
|
+
...St.map((f) => f.suffix("$")),
|
|
254
|
+
...yt.map((f) => f.suffix),
|
|
255
|
+
...bt.map((f) => f.suffix)
|
|
250
256
|
];
|
|
251
|
-
v.push(...p || []), s.addHabit(
|
|
252
|
-
s.getHabit(
|
|
253
|
-
|
|
257
|
+
v.push(...p || []), s.addHabit(de, []).finally(() => {
|
|
258
|
+
s.getHabit(de, v).then((f) => {
|
|
259
|
+
d([...new Set(f)]);
|
|
254
260
|
});
|
|
255
261
|
});
|
|
256
262
|
});
|
|
257
263
|
}, []);
|
|
258
264
|
const m = (p) => {
|
|
259
|
-
|
|
265
|
+
a(p), n(p);
|
|
260
266
|
}, u = () => {
|
|
261
267
|
n(c);
|
|
262
268
|
};
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ l.jsxs("div", { className: M.customFormat, children: [
|
|
270
|
+
/* @__PURE__ */ l.jsx("div", { className: M.customFormatTitle, children: o.t("sheet.numfmt.customFormat") }),
|
|
271
|
+
/* @__PURE__ */ l.jsx(Zt, { placeholder: o.t("sheet.numfmt.customFormat"), onBlur: u, value: c, onChange: a, className: M.customFormatInput }),
|
|
272
|
+
/* @__PURE__ */ l.jsx("div", { className: M.customFormatHistoryList, children: h.map((p) => /* @__PURE__ */ l.jsxs("div", { onClick: () => m(p), className: M.customFormatHistoryListItem, children: [
|
|
273
|
+
/* @__PURE__ */ l.jsx("div", { className: M.customFormatHistoryListItemIconWrap, children: c === p && /* @__PURE__ */ l.jsx(tt, {}) }),
|
|
274
|
+
/* @__PURE__ */ l.jsx("div", { children: p })
|
|
269
275
|
] }, p)) }),
|
|
270
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ l.jsx("div", { className: M.customFormatDes, children: o.t("sheet.numfmt.customFormatDes") })
|
|
271
277
|
] });
|
|
272
278
|
}
|
|
273
|
-
const
|
|
274
|
-
const e =
|
|
275
|
-
return
|
|
276
|
-
},
|
|
277
|
-
const e =
|
|
279
|
+
const En = (t) => {
|
|
280
|
+
const e = Z.getInfo(t);
|
|
281
|
+
return ke().map((r) => r.value).includes(t) || ["date", "datetime", "time"].includes(e.type);
|
|
282
|
+
}, Tn = (t) => {
|
|
283
|
+
const e = R(ke, []), n = y(T).t, [s, i] = b(() => {
|
|
278
284
|
if (t.defaultPattern) {
|
|
279
|
-
const c = e.find((
|
|
285
|
+
const c = e.find((a) => a.value === t.defaultPattern);
|
|
280
286
|
if (c)
|
|
281
287
|
return c.value;
|
|
282
288
|
}
|
|
@@ -286,100 +292,100 @@ const Pn = (t) => {
|
|
|
286
292
|
const o = (c) => {
|
|
287
293
|
c !== void 0 && (i(c), t.onChange(c));
|
|
288
294
|
};
|
|
289
|
-
return /* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
/* @__PURE__ */
|
|
295
|
+
return /* @__PURE__ */ l.jsxs("div", { children: [
|
|
296
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-16 label", children: n("sheet.numfmt.dateType") }),
|
|
297
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ l.jsx(Ee, { value: s, options: e, onChange: o }) }),
|
|
298
|
+
/* @__PURE__ */ l.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.dateDes") })
|
|
293
299
|
] });
|
|
294
|
-
},
|
|
295
|
-
const r =
|
|
296
|
-
return t.action.current = () => "", /* @__PURE__ */
|
|
297
|
-
},
|
|
298
|
-
const e =
|
|
299
|
-
const m = r.find((u) =>
|
|
300
|
+
}, xn = (t) => !t, Pn = (t) => {
|
|
301
|
+
const r = y(T).t;
|
|
302
|
+
return t.action.current = () => "", /* @__PURE__ */ l.jsx("div", { children: /* @__PURE__ */ l.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.generalDes") }) });
|
|
303
|
+
}, jn = (t) => Ae().some((e) => ie(e.value, t)), Rn = (t) => {
|
|
304
|
+
const e = y(T), r = R(Ae, []), [n, s] = b(() => ee(t.defaultPattern || "", 0)), [i, o] = b(() => {
|
|
305
|
+
const m = r.find((u) => ie(u.value, t.defaultPattern || ""));
|
|
300
306
|
return (m == null ? void 0 : m.value) || r[0].value;
|
|
301
|
-
}), c =
|
|
307
|
+
}), c = R(() => j(i, Number(n || 0)), [i, n]), a = R(() => !Ct(i), [i]), h = (m) => {
|
|
302
308
|
s(m || 0), t.onChange(j(i, Number(m || 0)));
|
|
303
|
-
},
|
|
304
|
-
m !== void 0 && (s(
|
|
309
|
+
}, d = (m) => {
|
|
310
|
+
m !== void 0 && (s(ee(m, 0)), o(m), t.onChange(m));
|
|
305
311
|
};
|
|
306
|
-
return t.action.current = () => c, /* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
|
|
312
|
+
return t.action.current = () => c, /* @__PURE__ */ l.jsxs("div", { children: [
|
|
313
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-16 label", children: e.t("sheet.numfmt.decimalLength") }),
|
|
314
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ l.jsx(
|
|
315
|
+
Ie,
|
|
310
316
|
{
|
|
311
|
-
disabled:
|
|
317
|
+
disabled: a,
|
|
312
318
|
value: n,
|
|
313
319
|
max: 20,
|
|
314
320
|
min: 0,
|
|
315
321
|
onChange: h
|
|
316
322
|
}
|
|
317
323
|
) }),
|
|
318
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ l.jsxs("div", { className: "m-t-16 label", children: [
|
|
319
325
|
" ",
|
|
320
326
|
e.t("sheet.numfmt.negType")
|
|
321
327
|
] }),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ l.jsx(Ee, { onChange: d, options: r, value: i }) }),
|
|
329
|
+
/* @__PURE__ */ l.jsx("div", { className: "describe m-t-14", children: e.t("sheet.numfmt.thousandthPercentileDes") })
|
|
324
330
|
] });
|
|
325
|
-
},
|
|
326
|
-
const { defaultValue: e, defaultPattern: r, row: n, col: s } = t.value, i =
|
|
331
|
+
}, Mn = (t) => {
|
|
332
|
+
const { defaultValue: e, defaultPattern: r, row: n, col: s } = t.value, i = y(T), o = be(() => ""), c = i.t, a = an(), h = R(
|
|
327
333
|
() => [
|
|
328
|
-
{ label: "sheet.numfmt.general", component:
|
|
329
|
-
{ label: "sheet.numfmt.accounting", component:
|
|
330
|
-
{ label: "sheet.numfmt.currency", component:
|
|
331
|
-
{ label: "sheet.numfmt.date", component:
|
|
334
|
+
{ label: "sheet.numfmt.general", component: Pn },
|
|
335
|
+
{ label: "sheet.numfmt.accounting", component: mn },
|
|
336
|
+
{ label: "sheet.numfmt.currency", component: dn },
|
|
337
|
+
{ label: "sheet.numfmt.date", component: Tn },
|
|
332
338
|
{ label: "sheet.numfmt.thousandthPercentile", component: Rn },
|
|
333
|
-
{ label: "sheet.numfmt.customFormat", component:
|
|
339
|
+
{ label: "sheet.numfmt.customFormat", component: Nn }
|
|
334
340
|
].map((_) => ({ ..._, label: c(_.label) })),
|
|
335
341
|
[]
|
|
336
|
-
), [
|
|
342
|
+
), [d, m] = b(g), [u, p] = b(() => `${n}_${s}`), { mark: v, userHabitCurrency: f } = cn(() => p(`${n}_${s}_userCurrency'`)), S = R(() => {
|
|
337
343
|
var _;
|
|
338
|
-
return (_ = h.find((
|
|
339
|
-
}, [
|
|
344
|
+
return (_ = h.find((O) => O.label === d)) == null ? void 0 : _.component;
|
|
345
|
+
}, [d]);
|
|
340
346
|
function g() {
|
|
341
|
-
return [
|
|
347
|
+
return [xn, ln, un, En, jn].reduce((O, ot, ct) => O || (ot(r) ? h[ct].label : ""), "") || h[0].label;
|
|
342
348
|
}
|
|
343
|
-
const
|
|
349
|
+
const C = h.map((_) => ({
|
|
344
350
|
label: _.label,
|
|
345
351
|
value: _.label
|
|
346
|
-
})),
|
|
347
|
-
m(_),
|
|
348
|
-
},
|
|
352
|
+
})), x = (_) => {
|
|
353
|
+
m(_), a(() => t.onChange({ type: "change", value: o.current() || "" }));
|
|
354
|
+
}, z = (_) => {
|
|
349
355
|
t.onChange({ type: "change", value: _ });
|
|
350
356
|
}, ce = () => {
|
|
351
|
-
const _ = o.current() || "",
|
|
352
|
-
|
|
353
|
-
},
|
|
357
|
+
const _ = o.current() || "", O = B(_);
|
|
358
|
+
O && v(O), t.onChange({ type: "confirm", value: _ });
|
|
359
|
+
}, D = () => {
|
|
354
360
|
t.onChange({ type: "cancel", value: "" });
|
|
355
361
|
}, ae = {
|
|
356
|
-
onChange:
|
|
362
|
+
onChange: z,
|
|
357
363
|
defaultValue: e,
|
|
358
364
|
defaultPattern: r,
|
|
359
365
|
action: o
|
|
360
366
|
};
|
|
361
|
-
return
|
|
367
|
+
return oe(() => {
|
|
362
368
|
m(g()), p(`${n}_${s}`);
|
|
363
|
-
}, [n, s]), /* @__PURE__ */
|
|
364
|
-
/* @__PURE__ */
|
|
365
|
-
/* @__PURE__ */
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
-
/* @__PURE__ */
|
|
369
|
+
}, [n, s]), /* @__PURE__ */ l.jsxs("div", { className: "numfmt-panel p-b-20", children: [
|
|
370
|
+
/* @__PURE__ */ l.jsxs("div", { children: [
|
|
371
|
+
/* @__PURE__ */ l.jsx("div", { className: "label m-t-14", children: c("sheet.numfmt.numfmtType") }),
|
|
372
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ l.jsx(Ne, { onChange: x, options: C, value: d, style: { width: "100%" } }) }),
|
|
373
|
+
/* @__PURE__ */ l.jsx("div", { children: S && /* @__PURE__ */ l.jsx(Te.Provider, { value: f, children: /* @__PURE__ */ Ce(S, { ...ae, key: u }) }) })
|
|
368
374
|
] }),
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ l.jsxs("div", { className: "btn-list m-t-14 m-b-20", children: [
|
|
376
|
+
/* @__PURE__ */ l.jsx(je, { size: "small", onClick: D, className: "m-r-12", children: c("sheet.numfmt.cancel") }),
|
|
377
|
+
/* @__PURE__ */ l.jsx(je, { type: "primary", size: "small", onClick: ce, children: c("sheet.numfmt.confirm") })
|
|
372
378
|
] })
|
|
373
379
|
] });
|
|
374
380
|
};
|
|
375
|
-
var
|
|
376
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
381
|
+
var On = Object.defineProperty, wn = Object.getOwnPropertyDescriptor, Un = (t, e, r, n) => {
|
|
382
|
+
for (var s = n > 1 ? void 0 : n ? wn(e, r) : e, i = t.length - 1, o; i >= 0; i--)
|
|
377
383
|
(o = t[i]) && (s = (n ? o(e, r, s) : o(s)) || s);
|
|
378
|
-
return n && s &&
|
|
384
|
+
return n && s && On(e, r, s), s;
|
|
379
385
|
}, P = (t, e) => (r, n) => e(r, n, t);
|
|
380
|
-
const
|
|
381
|
-
let A = class extends
|
|
382
|
-
constructor(e, r, n, s, i, o, c,
|
|
386
|
+
const we = "SHEET_NUMFMT_PANEL";
|
|
387
|
+
let A = class extends pe {
|
|
388
|
+
constructor(e, r, n, s, i, o, c, a, h, d) {
|
|
383
389
|
super();
|
|
384
390
|
/**
|
|
385
391
|
* If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
|
|
@@ -387,52 +393,52 @@ let A = class extends fe {
|
|
|
387
393
|
* @type {(string | null)}
|
|
388
394
|
* @memberof NumfmtController
|
|
389
395
|
*/
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
this._sheetInterceptorService = e, this._themeService = r, this._univerInstanceService = n, this._commandService = s, this._selectionManagerService = i, this._renderManagerService = o, this._numfmtService = c, this._componentManager =
|
|
396
|
+
X(this, "_previewPattern", "");
|
|
397
|
+
X(this, "_sidebarDisposable", null);
|
|
398
|
+
this._sheetInterceptorService = e, this._themeService = r, this._univerInstanceService = n, this._commandService = s, this._selectionManagerService = i, this._renderManagerService = o, this._numfmtService = c, this._componentManager = a, this._sidebarService = h, this._localeService = d, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener();
|
|
393
399
|
}
|
|
394
400
|
openPanel() {
|
|
395
401
|
var S;
|
|
396
|
-
const e = this._sidebarService, r = this._selectionManagerService, n = this._commandService, s = this._univerInstanceService, i = this._numfmtService, o = this._localeService,
|
|
397
|
-
if (!
|
|
402
|
+
const e = this._sidebarService, r = this._selectionManagerService, n = this._commandService, s = this._univerInstanceService, i = this._numfmtService, o = this._localeService, a = (((S = r.getCurrentSelections()) == null ? void 0 : S.map((g) => g.range)) || [])[0];
|
|
403
|
+
if (!a)
|
|
398
404
|
return !1;
|
|
399
|
-
const h = s.getCurrentUnitForType(
|
|
400
|
-
if (!
|
|
405
|
+
const h = s.getCurrentUnitForType(E.UNIVER_SHEET), d = h.getActiveSheet();
|
|
406
|
+
if (!d)
|
|
401
407
|
return !1;
|
|
402
|
-
const m =
|
|
408
|
+
const m = d.getCellRaw(a.startRow, a.startColumn), u = i.getValue(
|
|
403
409
|
h.getUnitId(),
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
410
|
+
d.getSheetId(),
|
|
411
|
+
a.startRow,
|
|
412
|
+
a.startColumn
|
|
407
413
|
);
|
|
408
414
|
let p = "";
|
|
409
415
|
u && (p = u.pattern);
|
|
410
|
-
const v = (m == null ? void 0 : m.t) === L.NUMBER ? m.v : 12345678,
|
|
416
|
+
const v = (m == null ? void 0 : m.t) === L.NUMBER ? m.v : 12345678, f = {
|
|
411
417
|
onChange: (g) => {
|
|
412
|
-
var
|
|
418
|
+
var C;
|
|
413
419
|
if (g.type === "change")
|
|
414
420
|
this._previewPattern = g.value, this._forceUpdate();
|
|
415
421
|
else if (g.type === "confirm") {
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
422
|
+
const x = ((C = r.getCurrentSelections()) == null ? void 0 : C.map((D) => D.range)) || [], z = { values: [] }, ce = te(g.value);
|
|
423
|
+
x.forEach((D) => {
|
|
424
|
+
Le.foreach(D, (ae, _) => {
|
|
425
|
+
z.values.push({
|
|
420
426
|
row: ae,
|
|
421
427
|
col: _,
|
|
422
428
|
pattern: g.value,
|
|
423
429
|
type: ce
|
|
424
430
|
});
|
|
425
431
|
});
|
|
426
|
-
}), n.executeCommand(
|
|
432
|
+
}), n.executeCommand(Be.id, z), e.close();
|
|
427
433
|
} else g.type === "cancel" && e.close();
|
|
428
434
|
},
|
|
429
|
-
value: { defaultPattern: p, defaultValue: v, row:
|
|
435
|
+
value: { defaultPattern: p, defaultValue: v, row: a.startRow, col: a.startColumn }
|
|
430
436
|
};
|
|
431
437
|
return this._sidebarDisposable = e.open({
|
|
432
438
|
header: { title: o.t("sheet.numfmt.title") },
|
|
433
439
|
children: {
|
|
434
|
-
label:
|
|
435
|
-
...
|
|
440
|
+
label: we,
|
|
441
|
+
...f
|
|
436
442
|
// need passthrough to react props.
|
|
437
443
|
},
|
|
438
444
|
onClose: () => {
|
|
@@ -443,9 +449,9 @@ let A = class extends fe {
|
|
|
443
449
|
_forceUpdate(e) {
|
|
444
450
|
var n;
|
|
445
451
|
const r = this._renderManagerService.getRenderById(
|
|
446
|
-
e != null ? e : this._univerInstanceService.getCurrentUnitForType(
|
|
452
|
+
e != null ? e : this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SHEET).getUnitId()
|
|
447
453
|
);
|
|
448
|
-
r == null || r.with(
|
|
454
|
+
r == null || r.with(xt).reCalculate(), (n = r == null ? void 0 : r.mainComponent) == null || n.makeDirty();
|
|
449
455
|
}
|
|
450
456
|
_initCommands() {
|
|
451
457
|
[
|
|
@@ -456,25 +462,25 @@ let A = class extends fe {
|
|
|
456
462
|
});
|
|
457
463
|
}
|
|
458
464
|
_initPanel() {
|
|
459
|
-
this._componentManager.register(
|
|
465
|
+
this._componentManager.register(we, Mn);
|
|
460
466
|
}
|
|
461
467
|
_initRealTimeRenderingInterceptor() {
|
|
462
468
|
const e = new U((n) => {
|
|
463
469
|
this._commandService.onCommandExecuted((s) => {
|
|
464
470
|
s.id === H.id && n.next(!0), s.id === me.id && n.next(!1);
|
|
465
471
|
});
|
|
466
|
-
}), r =
|
|
472
|
+
}), r = Vt([
|
|
467
473
|
e,
|
|
468
474
|
this._selectionManagerService.selectionMoveEnd$.pipe(
|
|
469
|
-
|
|
475
|
+
Kt((n) => n ? n.map((s) => s.range) : [])
|
|
470
476
|
)
|
|
471
477
|
]);
|
|
472
478
|
this.disposeWithMe(
|
|
473
|
-
|
|
479
|
+
fe(
|
|
474
480
|
r.pipe(
|
|
475
|
-
|
|
481
|
+
qt(
|
|
476
482
|
([n, s]) => new U((i) => {
|
|
477
|
-
const o = new
|
|
483
|
+
const o = new mt();
|
|
478
484
|
return n && s.length && i.next({ selectionRanges: s, disposableCollection: o }), () => {
|
|
479
485
|
o.dispose();
|
|
480
486
|
};
|
|
@@ -485,27 +491,27 @@ let A = class extends fe {
|
|
|
485
491
|
})
|
|
486
492
|
).subscribe(({ disposableCollection: n, selectionRanges: s }) => {
|
|
487
493
|
var o, c;
|
|
488
|
-
const i = this._univerInstanceService.getCurrentUnitForType(
|
|
494
|
+
const i = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SHEET);
|
|
489
495
|
this.openPanel(), n.add(
|
|
490
|
-
this._sheetInterceptorService.intercept(
|
|
496
|
+
this._sheetInterceptorService.intercept(Ft.CELL_CONTENT, {
|
|
491
497
|
priority: 99,
|
|
492
|
-
effect:
|
|
493
|
-
handler: (
|
|
494
|
-
const { row: m, col: u } = h, p =
|
|
498
|
+
effect: xe.Value | xe.Style,
|
|
499
|
+
handler: (a, h, d) => {
|
|
500
|
+
const { row: m, col: u } = h, p = d(a) || {};
|
|
495
501
|
if (s.find(
|
|
496
502
|
(v) => v.startColumn <= u && v.endColumn >= u && v.startRow <= m && v.endRow >= m
|
|
497
503
|
)) {
|
|
498
|
-
const v = h.worksheet.getCellRaw(m, u),
|
|
499
|
-
if (
|
|
504
|
+
const v = h.worksheet.getCellRaw(m, u), f = v == null ? void 0 : v.v, S = v == null ? void 0 : v.t;
|
|
505
|
+
if (f == null || S !== L.NUMBER || this._previewPattern === null)
|
|
500
506
|
return p;
|
|
501
|
-
const g =
|
|
507
|
+
const g = It(this._previewPattern, f, this._localeService.getCurrentLocale());
|
|
502
508
|
if (g.color) {
|
|
503
|
-
const
|
|
509
|
+
const x = this._themeService.getCurrentTheme()[`${g.color}500`];
|
|
504
510
|
return {
|
|
505
511
|
...p,
|
|
506
512
|
v: g.result,
|
|
507
513
|
t: L.STRING,
|
|
508
|
-
s: { cl: { rgb:
|
|
514
|
+
s: { cl: { rgb: x } }
|
|
509
515
|
};
|
|
510
516
|
}
|
|
511
517
|
return {
|
|
@@ -523,7 +529,7 @@ let A = class extends fe {
|
|
|
523
529
|
);
|
|
524
530
|
}
|
|
525
531
|
_commandExecutedListener() {
|
|
526
|
-
const e = [
|
|
532
|
+
const e = [_e.id, Se.id];
|
|
527
533
|
this.disposeWithMe(
|
|
528
534
|
new U((r) => {
|
|
529
535
|
const n = this._commandService.onCommandExecuted((s) => {
|
|
@@ -533,55 +539,55 @@ let A = class extends fe {
|
|
|
533
539
|
}
|
|
534
540
|
});
|
|
535
541
|
return () => n.dispose();
|
|
536
|
-
}).pipe(
|
|
542
|
+
}).pipe(Jt(16)).subscribe((r) => this._forceUpdate(r))
|
|
537
543
|
);
|
|
538
544
|
}
|
|
539
545
|
_initCloseListener() {
|
|
540
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
546
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(E.UNIVER_SHEET).subscribe((e) => {
|
|
541
547
|
var r;
|
|
542
548
|
e || ((r = this._sidebarDisposable) == null || r.dispose(), this._sidebarDisposable = null);
|
|
543
549
|
});
|
|
544
550
|
}
|
|
545
551
|
};
|
|
546
|
-
A =
|
|
547
|
-
P(0,
|
|
548
|
-
P(1,
|
|
549
|
-
P(2,
|
|
550
|
-
P(3,
|
|
551
|
-
P(4,
|
|
552
|
-
P(5,
|
|
553
|
-
P(6,
|
|
554
|
-
P(7,
|
|
555
|
-
P(8,
|
|
556
|
-
P(9,
|
|
552
|
+
A = Un([
|
|
553
|
+
P(0, N(Ye)),
|
|
554
|
+
P(1, N(ut)),
|
|
555
|
+
P(2, ve),
|
|
556
|
+
P(3, ge),
|
|
557
|
+
P(4, N(ye)),
|
|
558
|
+
P(5, $t),
|
|
559
|
+
P(6, Je),
|
|
560
|
+
P(7, N(qe)),
|
|
561
|
+
P(8, Mt),
|
|
562
|
+
P(9, N(T))
|
|
557
563
|
], A);
|
|
558
|
-
var
|
|
559
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
564
|
+
var Dn = Object.defineProperty, $n = Object.getOwnPropertyDescriptor, Fn = (t, e, r, n) => {
|
|
565
|
+
for (var s = n > 1 ? void 0 : n ? $n(e, r) : e, i = t.length - 1, o; i >= 0; i--)
|
|
560
566
|
(o = t[i]) && (s = (n ? o(e, r, s) : o(s)) || s);
|
|
561
|
-
return n && s &&
|
|
567
|
+
return n && s && Dn(e, r, s), s;
|
|
562
568
|
}, F = (t, e) => (r, n) => e(r, n, t);
|
|
563
|
-
const
|
|
569
|
+
const Ln = () => {
|
|
564
570
|
let t = [];
|
|
565
571
|
return {
|
|
566
|
-
add: (s, i, o, c,
|
|
572
|
+
add: (s, i, o, c, a) => t.push({ unitId: s, subUnitId: i, row: o, col: c, value: a }),
|
|
567
573
|
getEffects: () => t,
|
|
568
574
|
clean: () => {
|
|
569
575
|
t = [];
|
|
570
576
|
}
|
|
571
577
|
};
|
|
572
578
|
};
|
|
573
|
-
let
|
|
579
|
+
let ne = class extends pe {
|
|
574
580
|
constructor(e, r, n, s, i) {
|
|
575
581
|
super();
|
|
576
582
|
// collect effect mutations when edit end and push this to commands stack in next commands progress
|
|
577
|
-
|
|
583
|
+
X(this, "_collectEffectMutation", Ln());
|
|
578
584
|
this._sheetInterceptorService = e, this._numfmtService = r, this._univerInstanceService = n, this._injector = s, this._editorBridgeService = i, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
|
|
579
585
|
}
|
|
580
586
|
_initInterceptorEditorStart() {
|
|
581
587
|
this._editorBridgeService && this.disposeWithMe(
|
|
582
|
-
|
|
588
|
+
fe(
|
|
583
589
|
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
584
|
-
|
|
590
|
+
Lt,
|
|
585
591
|
{
|
|
586
592
|
handler: (e, r, n) => {
|
|
587
593
|
const s = r.row, i = r.col, o = this._numfmtService.getValue(
|
|
@@ -591,7 +597,7 @@ let te = class extends fe {
|
|
|
591
597
|
i
|
|
592
598
|
);
|
|
593
599
|
if (o)
|
|
594
|
-
switch (
|
|
600
|
+
switch (te(o.pattern)) {
|
|
595
601
|
case "scientific":
|
|
596
602
|
case "currency":
|
|
597
603
|
case "grouped":
|
|
@@ -618,21 +624,21 @@ let te = class extends fe {
|
|
|
618
624
|
*/
|
|
619
625
|
_initInterceptorEditorEnd() {
|
|
620
626
|
this.disposeWithMe(
|
|
621
|
-
|
|
627
|
+
fe(
|
|
622
628
|
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
623
|
-
|
|
629
|
+
Ht,
|
|
624
630
|
{
|
|
625
631
|
// eslint-disable-next-line complexity
|
|
626
632
|
handler: (e, r, n) => {
|
|
627
|
-
var
|
|
633
|
+
var d, m, u, p;
|
|
628
634
|
this._collectEffectMutation.clean();
|
|
629
|
-
const
|
|
635
|
+
const s = this._numfmtService.getValue(
|
|
630
636
|
r.unitId,
|
|
631
637
|
r.subUnitId,
|
|
632
638
|
r.row,
|
|
633
639
|
r.col
|
|
634
|
-
),
|
|
635
|
-
|
|
640
|
+
), i = (d = s && te(s.pattern)) != null ? d : "", o = () => {
|
|
641
|
+
s && this._collectEffectMutation.add(
|
|
636
642
|
r.unitId,
|
|
637
643
|
r.subUnitId,
|
|
638
644
|
r.row,
|
|
@@ -640,29 +646,29 @@ let te = class extends fe {
|
|
|
640
646
|
null
|
|
641
647
|
);
|
|
642
648
|
};
|
|
643
|
-
if (!(e != null && e.v) && !(e != null && e.p) || (
|
|
649
|
+
if (!(e != null && e.v) && !(e != null && e.p) || (s == null ? void 0 : s.pattern) === Ze)
|
|
644
650
|
return n(e);
|
|
645
|
-
const
|
|
646
|
-
if (
|
|
647
|
-
if (
|
|
648
|
-
const { dataStream:
|
|
649
|
-
if (Number.isNaN(
|
|
651
|
+
const c = (m = e.p) == null ? void 0 : m.body, a = (p = (u = e == null ? void 0 : e.p) == null ? void 0 : u.body) != null && p.dataStream ? e.p.body.dataStream.replace(/\r\n$/, "") : String(e.v), h = Z.parseDate(a) || Z.parseTime(a) || Z.parseNumber(a);
|
|
652
|
+
if (c)
|
|
653
|
+
if (kn(c)) {
|
|
654
|
+
const { dataStream: v } = c, f = v.replace(/\r\n$/, ""), S = Number(f);
|
|
655
|
+
if (Number.isNaN(S) && !h)
|
|
650
656
|
return n(e);
|
|
651
657
|
} else
|
|
652
658
|
return n(e);
|
|
653
|
-
if (
|
|
654
|
-
|
|
659
|
+
if (h) {
|
|
660
|
+
h.z && this._collectEffectMutation.add(
|
|
655
661
|
r.unitId,
|
|
656
662
|
r.subUnitId,
|
|
657
663
|
r.row,
|
|
658
664
|
r.col,
|
|
659
665
|
{
|
|
660
|
-
pattern:
|
|
666
|
+
pattern: h.z
|
|
661
667
|
}
|
|
662
668
|
);
|
|
663
|
-
const
|
|
664
|
-
return { ...e,
|
|
665
|
-
} else (["date", "time", "datetime", "percent"].includes(
|
|
669
|
+
const v = Number(h.v);
|
|
670
|
+
return n({ ...e, p: void 0, v, t: L.NUMBER });
|
|
671
|
+
} else (["date", "time", "datetime", "percent"].includes(i) || !Hn(a)) && o();
|
|
666
672
|
return n(e);
|
|
667
673
|
}
|
|
668
674
|
}
|
|
@@ -677,8 +683,8 @@ let te = class extends fe {
|
|
|
677
683
|
getMutations(r) {
|
|
678
684
|
var n;
|
|
679
685
|
switch (r.id) {
|
|
680
|
-
case
|
|
681
|
-
const s = e._univerInstanceService.getCurrentUnitForType(
|
|
686
|
+
case kt.id: {
|
|
687
|
+
const s = e._univerInstanceService.getCurrentUnitForType(E.UNIVER_SHEET), i = s.getUnitId(), o = (n = s.getActiveSheet()) == null ? void 0 : n.getSheetId();
|
|
682
688
|
if (!o)
|
|
683
689
|
return {
|
|
684
690
|
redos: [],
|
|
@@ -690,7 +696,7 @@ let te = class extends fe {
|
|
|
690
696
|
redos: [],
|
|
691
697
|
undos: []
|
|
692
698
|
};
|
|
693
|
-
const
|
|
699
|
+
const a = c.filter((u) => {
|
|
694
700
|
var p;
|
|
695
701
|
return !!((p = u.value) != null && p.pattern);
|
|
696
702
|
}).map((u) => ({
|
|
@@ -705,27 +711,27 @@ let te = class extends fe {
|
|
|
705
711
|
endColumn: u.col,
|
|
706
712
|
startColumn: u.col,
|
|
707
713
|
endRow: u.row
|
|
708
|
-
})),
|
|
709
|
-
if (
|
|
714
|
+
})), d = [], m = [];
|
|
715
|
+
if (a.length) {
|
|
710
716
|
const u = {
|
|
711
|
-
id:
|
|
712
|
-
params:
|
|
717
|
+
id: Se.id,
|
|
718
|
+
params: At(i, o, a)
|
|
713
719
|
};
|
|
714
|
-
|
|
720
|
+
d.push(u), m.push(...Bt(e._injector, u.params));
|
|
715
721
|
}
|
|
716
722
|
if (h.length) {
|
|
717
723
|
const u = {
|
|
718
|
-
id:
|
|
724
|
+
id: _e.id,
|
|
719
725
|
params: {
|
|
720
726
|
unitId: i,
|
|
721
727
|
subUnitId: o,
|
|
722
728
|
ranges: h
|
|
723
729
|
}
|
|
724
730
|
};
|
|
725
|
-
|
|
731
|
+
d.push(u), m.push(...Wt(e._injector, u.params));
|
|
726
732
|
}
|
|
727
733
|
return {
|
|
728
|
-
redos:
|
|
734
|
+
redos: d,
|
|
729
735
|
undos: m.reverse()
|
|
730
736
|
};
|
|
731
737
|
}
|
|
@@ -739,28 +745,28 @@ let te = class extends fe {
|
|
|
739
745
|
);
|
|
740
746
|
}
|
|
741
747
|
};
|
|
742
|
-
|
|
743
|
-
F(0,
|
|
744
|
-
F(1,
|
|
745
|
-
F(2,
|
|
746
|
-
F(3,
|
|
747
|
-
F(4,
|
|
748
|
-
],
|
|
749
|
-
function
|
|
748
|
+
ne = Fn([
|
|
749
|
+
F(0, N(Ye)),
|
|
750
|
+
F(1, N(Je)),
|
|
751
|
+
F(2, N(ve)),
|
|
752
|
+
F(3, N(He)),
|
|
753
|
+
F(4, dt(Pt))
|
|
754
|
+
], ne);
|
|
755
|
+
function Hn(t) {
|
|
750
756
|
return /^-?\d+(\.\d+)?$/.test(t);
|
|
751
757
|
}
|
|
752
|
-
function
|
|
758
|
+
function kn(t) {
|
|
753
759
|
const { textRuns: e = [], paragraphs: r = [], customRanges: n, customBlocks: s = [] } = t, i = ["va"];
|
|
754
|
-
return !(e.some((o) => !!(o.ts && Object.keys(o.ts).some((
|
|
760
|
+
return !(e.some((o) => !!(o.ts && Object.keys(o.ts).some((a) => i.includes(a)))) || r.some((o) => o.bullet) || r.length >= 2 || n != null && n.length || s.length > 0);
|
|
755
761
|
}
|
|
756
|
-
const
|
|
762
|
+
const Q = [
|
|
757
763
|
{
|
|
758
764
|
label: "sheet.numfmt.general",
|
|
759
765
|
pattern: null
|
|
760
766
|
},
|
|
761
767
|
{
|
|
762
768
|
label: "sheet.numfmt.text",
|
|
763
|
-
pattern:
|
|
769
|
+
pattern: Ze
|
|
764
770
|
},
|
|
765
771
|
"|",
|
|
766
772
|
{
|
|
@@ -806,211 +812,211 @@ const Z = [
|
|
|
806
812
|
label: "sheet.numfmt.moreFmt",
|
|
807
813
|
pattern: ""
|
|
808
814
|
}
|
|
809
|
-
],
|
|
815
|
+
], An = (t) => ({
|
|
810
816
|
icon: new U((e) => {
|
|
811
|
-
const r = t.get(
|
|
817
|
+
const r = t.get(Nt);
|
|
812
818
|
function n(i) {
|
|
813
819
|
return {
|
|
814
|
-
[
|
|
815
|
-
[
|
|
816
|
-
[
|
|
817
|
-
[
|
|
820
|
+
[w.US]: "DollarSingle",
|
|
821
|
+
[w.RU]: "RoubleSingle",
|
|
822
|
+
[w.CN]: "RmbSingle",
|
|
823
|
+
[w.AT]: "EuroSingle"
|
|
818
824
|
}[i] || "DollarSingle";
|
|
819
825
|
}
|
|
820
|
-
const s =
|
|
826
|
+
const s = w[r.getCurrencySymbol()] || "$";
|
|
821
827
|
return e.next(n(s)), r.currencySymbol$.subscribe((i) => {
|
|
822
|
-
const o =
|
|
828
|
+
const o = w[i] || "$";
|
|
823
829
|
e.next(n(o));
|
|
824
830
|
});
|
|
825
831
|
}),
|
|
826
|
-
id:
|
|
832
|
+
id: We.id,
|
|
827
833
|
title: "sheet.numfmt.currency",
|
|
828
834
|
tooltip: "sheet.numfmt.currency",
|
|
829
835
|
type: V.BUTTON,
|
|
830
|
-
hidden$: G(t,
|
|
831
|
-
disabled$: W(t, { workbookTypes: [K], worksheetTypes: [
|
|
832
|
-
}),
|
|
836
|
+
hidden$: G(t, E.UNIVER_SHEET),
|
|
837
|
+
disabled$: W(t, { workbookTypes: [K], worksheetTypes: [q, Y], rangeTypes: [J] })
|
|
838
|
+
}), Bn = (t) => ({
|
|
833
839
|
icon: "AddDigitsSingle",
|
|
834
|
-
id:
|
|
840
|
+
id: Ve.id,
|
|
835
841
|
title: "sheet.numfmt.addDecimal",
|
|
836
842
|
tooltip: "sheet.numfmt.addDecimal",
|
|
837
843
|
type: V.BUTTON,
|
|
838
|
-
hidden$: G(t,
|
|
839
|
-
disabled$: W(t, { workbookTypes: [K], worksheetTypes: [
|
|
840
|
-
}),
|
|
844
|
+
hidden$: G(t, E.UNIVER_SHEET),
|
|
845
|
+
disabled$: W(t, { workbookTypes: [K], worksheetTypes: [q, Y], rangeTypes: [J] })
|
|
846
|
+
}), Wn = (t) => ({
|
|
841
847
|
icon: "ReduceDigitsSingle",
|
|
842
|
-
id:
|
|
848
|
+
id: Ge.id,
|
|
843
849
|
title: "sheet.numfmt.subtractDecimal",
|
|
844
850
|
tooltip: "sheet.numfmt.subtractDecimal",
|
|
845
851
|
type: V.BUTTON,
|
|
846
|
-
hidden$: G(t,
|
|
847
|
-
disabled$: W(t, { workbookTypes: [K], worksheetTypes: [
|
|
848
|
-
}),
|
|
852
|
+
hidden$: G(t, E.UNIVER_SHEET),
|
|
853
|
+
disabled$: W(t, { workbookTypes: [K], worksheetTypes: [q, Y], rangeTypes: [J] })
|
|
854
|
+
}), Vn = (t) => ({
|
|
849
855
|
icon: "PercentSingle",
|
|
850
|
-
id:
|
|
856
|
+
id: Ke.id,
|
|
851
857
|
title: "sheet.numfmt.percent",
|
|
852
858
|
tooltip: "sheet.numfmt.percent",
|
|
853
859
|
type: V.BUTTON,
|
|
854
|
-
hidden$: G(t,
|
|
855
|
-
disabled$: W(t, { workbookTypes: [K], worksheetTypes: [
|
|
856
|
-
}),
|
|
857
|
-
const e = t.get(
|
|
858
|
-
(
|
|
860
|
+
hidden$: G(t, E.UNIVER_SHEET),
|
|
861
|
+
disabled$: W(t, { workbookTypes: [K], worksheetTypes: [q, Y], rangeTypes: [J] })
|
|
862
|
+
}), Gn = (t) => {
|
|
863
|
+
const e = t.get(ve), r = t.get(ge), n = t.get(T), s = t.get(ye), i = jt(e, "", ({ workbook: o, worksheet: c }) => new U(
|
|
864
|
+
(a) => Gt(
|
|
859
865
|
s.selectionMoveEnd$,
|
|
860
866
|
new U((h) => {
|
|
861
|
-
const
|
|
862
|
-
|
|
867
|
+
const d = [_e.id, Se.id], m = r.onCommandExecuted((u) => {
|
|
868
|
+
d.includes(u.id) && h.next(null);
|
|
863
869
|
});
|
|
864
870
|
return () => m.dispose();
|
|
865
871
|
})
|
|
866
872
|
).subscribe(() => {
|
|
867
|
-
var
|
|
873
|
+
var d, m;
|
|
868
874
|
const h = s.getCurrentSelections();
|
|
869
875
|
if (h && h[0]) {
|
|
870
|
-
const u = h[0].range, p = u.startRow, v = u.startColumn,
|
|
876
|
+
const u = h[0].range, p = u.startRow, v = u.startColumn, f = (m = o.getStyles().get((d = c.getCell(p, v)) == null ? void 0 : d.s)) == null ? void 0 : m.n, S = f == null ? void 0 : f.pattern;
|
|
871
877
|
let g = n.t("sheet.numfmt.general");
|
|
872
878
|
if (S) {
|
|
873
|
-
const
|
|
874
|
-
(
|
|
879
|
+
const C = Q.filter((x) => typeof x == "object" && x.pattern).find(
|
|
880
|
+
(x) => ie(S, x.pattern)
|
|
875
881
|
);
|
|
876
|
-
|
|
882
|
+
C && typeof C == "object" && C.pattern ? g = n.t(C.label) : g = n.t("sheet.numfmt.moreFmt");
|
|
877
883
|
}
|
|
878
|
-
|
|
884
|
+
a.next(g);
|
|
879
885
|
}
|
|
880
886
|
})
|
|
881
887
|
));
|
|
882
888
|
return {
|
|
883
|
-
label:
|
|
889
|
+
label: nt,
|
|
884
890
|
id: H.id,
|
|
885
891
|
tooltip: "sheet.numfmt.title",
|
|
886
892
|
type: V.SELECTOR,
|
|
887
893
|
selections: [
|
|
888
894
|
{
|
|
889
895
|
label: {
|
|
890
|
-
name:
|
|
896
|
+
name: rt,
|
|
891
897
|
hoverable: !1
|
|
892
898
|
}
|
|
893
899
|
}
|
|
894
900
|
],
|
|
895
901
|
value$: i,
|
|
896
|
-
hidden$: G(t,
|
|
897
|
-
disabled$: W(t, { workbookTypes: [K], worksheetTypes: [
|
|
902
|
+
hidden$: G(t, E.UNIVER_SHEET),
|
|
903
|
+
disabled$: W(t, { workbookTypes: [K], worksheetTypes: [Y, q], rangeTypes: [J] })
|
|
898
904
|
};
|
|
899
|
-
},
|
|
905
|
+
}, nt = "sheet.numfmt.moreNumfmtType", rt = "sheet.numfmt.moreNumfmtType.options", Kn = (t) => {
|
|
900
906
|
var n;
|
|
901
|
-
const e =
|
|
902
|
-
return /* @__PURE__ */
|
|
903
|
-
},
|
|
904
|
-
const t =
|
|
905
|
-
|
|
906
|
-
const n =
|
|
907
|
-
const
|
|
908
|
-
if (!
|
|
907
|
+
const e = y(T), r = (n = t.value) != null ? n : e.t("sheet.numfmt.general");
|
|
908
|
+
return /* @__PURE__ */ l.jsx("span", { className: "more-numfmt-type", children: r });
|
|
909
|
+
}, qn = () => {
|
|
910
|
+
const t = y(ge), e = y(T), r = y(Ot);
|
|
911
|
+
ht();
|
|
912
|
+
const n = y(ye), s = (c) => {
|
|
913
|
+
const a = n.getCurrentLastSelection();
|
|
914
|
+
if (!a)
|
|
909
915
|
return;
|
|
910
|
-
const h =
|
|
911
|
-
|
|
912
|
-
c ?
|
|
913
|
-
}), t.executeCommand(
|
|
916
|
+
const h = a.range, d = [];
|
|
917
|
+
Le.foreach(h, (m, u) => {
|
|
918
|
+
c ? d.push({ row: m, col: u, pattern: c, type: te(c) }) : d.push({ row: m, col: u });
|
|
919
|
+
}), t.executeCommand(Be.id, { values: d }), r.focus();
|
|
914
920
|
}, i = (c) => {
|
|
915
921
|
if (c === 0)
|
|
916
922
|
s(null);
|
|
917
|
-
else if (c ===
|
|
923
|
+
else if (c === Q.length - 1)
|
|
918
924
|
t.executeCommand(H.id);
|
|
919
925
|
else {
|
|
920
|
-
const
|
|
921
|
-
|
|
926
|
+
const a = Q[c];
|
|
927
|
+
a.pattern && s(a.pattern);
|
|
922
928
|
}
|
|
923
929
|
}, o = 1220;
|
|
924
|
-
return /* @__PURE__ */
|
|
930
|
+
return /* @__PURE__ */ l.jsx("div", { className: "more-numfmt-type-options", children: Q.map((c, a) => c === "|" ? /* @__PURE__ */ l.jsx("div", { className: "line m-t-4", onClick: (h) => h.stopPropagation() }, a) : /* @__PURE__ */ l.jsxs(
|
|
925
931
|
"div",
|
|
926
932
|
{
|
|
927
933
|
className: "option-item m-t-4",
|
|
928
934
|
onClick: () => {
|
|
929
|
-
i(
|
|
935
|
+
i(a);
|
|
930
936
|
},
|
|
931
937
|
children: [
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ l.jsx("div", { children: e.t(c.label) }),
|
|
939
|
+
/* @__PURE__ */ l.jsx("div", { className: "m-l-26", children: c.pattern ? Et(c.pattern || "", o, e.getCurrentLocale()).result : "" })
|
|
934
940
|
]
|
|
935
941
|
},
|
|
936
|
-
|
|
942
|
+
a
|
|
937
943
|
)) });
|
|
938
|
-
},
|
|
939
|
-
[
|
|
940
|
-
[
|
|
944
|
+
}, Yn = {
|
|
945
|
+
[wt.FORMULAS_INSERT]: {
|
|
946
|
+
[We.id]: {
|
|
941
947
|
order: 4,
|
|
942
|
-
menuItemFactory:
|
|
948
|
+
menuItemFactory: An
|
|
943
949
|
},
|
|
944
|
-
[
|
|
950
|
+
[Ve.id]: {
|
|
945
951
|
order: 5,
|
|
946
|
-
menuItemFactory:
|
|
952
|
+
menuItemFactory: Bn
|
|
947
953
|
},
|
|
948
|
-
[
|
|
954
|
+
[Ge.id]: {
|
|
949
955
|
order: 6,
|
|
950
|
-
menuItemFactory:
|
|
956
|
+
menuItemFactory: Wn
|
|
951
957
|
},
|
|
952
|
-
[
|
|
958
|
+
[Ke.id]: {
|
|
953
959
|
order: 7,
|
|
954
|
-
menuItemFactory:
|
|
960
|
+
menuItemFactory: Vn
|
|
955
961
|
},
|
|
956
962
|
[H.id]: {
|
|
957
963
|
order: 8,
|
|
958
|
-
menuItemFactory:
|
|
964
|
+
menuItemFactory: Gn
|
|
959
965
|
}
|
|
960
966
|
}
|
|
961
967
|
};
|
|
962
|
-
var
|
|
963
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
968
|
+
var Jn = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, Xn = (t, e, r, n) => {
|
|
969
|
+
for (var s = n > 1 ? void 0 : n ? zn(e, r) : e, i = t.length - 1, o; i >= 0; i--)
|
|
964
970
|
(o = t[i]) && (s = (n ? o(e, r, s) : o(s)) || s);
|
|
965
|
-
return n && s &&
|
|
966
|
-
},
|
|
967
|
-
let
|
|
971
|
+
return n && s && Jn(e, r, s), s;
|
|
972
|
+
}, Ue = (t, e) => (r, n) => e(r, n, t);
|
|
973
|
+
let re = class extends pe {
|
|
968
974
|
constructor(t, e) {
|
|
969
975
|
super(), this._componentManager = t, this._menuManagerService = e, this._initMenu();
|
|
970
976
|
}
|
|
971
977
|
_initMenu() {
|
|
972
|
-
this._menuManagerService.mergeMenu(
|
|
978
|
+
this._menuManagerService.mergeMenu(Yn), this.disposeWithMe(this._componentManager.register(nt, Kn)), this.disposeWithMe(this._componentManager.register(rt, qn));
|
|
973
979
|
}
|
|
974
980
|
};
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
],
|
|
979
|
-
var
|
|
980
|
-
for (var s = n > 1 ? void 0 : n ?
|
|
981
|
+
re = Xn([
|
|
982
|
+
Ue(0, N(qe)),
|
|
983
|
+
Ue(1, Ut)
|
|
984
|
+
], re);
|
|
985
|
+
var st = Object.defineProperty, Zn = Object.getOwnPropertyDescriptor, Qn = (t, e, r) => e in t ? st(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, er = (t, e, r, n) => {
|
|
986
|
+
for (var s = n > 1 ? void 0 : n ? Zn(e, r) : e, i = t.length - 1, o; i >= 0; i--)
|
|
981
987
|
(o = t[i]) && (s = (n ? o(e, r, s) : o(s)) || s);
|
|
982
|
-
return n && s &&
|
|
983
|
-
},
|
|
984
|
-
const
|
|
985
|
-
let
|
|
986
|
-
constructor(t =
|
|
988
|
+
return n && s && st(e, r, s), s;
|
|
989
|
+
}, De = (t, e) => (r, n) => e(r, n, t), it = (t, e, r) => Qn(t, typeof e != "symbol" ? e + "" : e, r);
|
|
990
|
+
const tr = "SHEET_NUMFMT_UI_PLUGIN";
|
|
991
|
+
let se = class extends pt {
|
|
992
|
+
constructor(t = Qt, e, r) {
|
|
987
993
|
super(), this._config = t, this._injector = e, this._configService = r;
|
|
988
994
|
const { menu: n, ...s } = this._config;
|
|
989
995
|
n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(Dt, s);
|
|
990
996
|
}
|
|
991
997
|
onStarting() {
|
|
992
|
-
|
|
998
|
+
vt(this._injector, [
|
|
993
999
|
[A],
|
|
994
|
-
[
|
|
1000
|
+
[ne],
|
|
995
1001
|
[k],
|
|
996
|
-
[
|
|
1002
|
+
[re]
|
|
997
1003
|
]);
|
|
998
1004
|
}
|
|
999
1005
|
onRendered() {
|
|
1000
|
-
|
|
1006
|
+
gt(this._injector, [
|
|
1001
1007
|
[A],
|
|
1002
|
-
[
|
|
1003
|
-
[
|
|
1008
|
+
[ne],
|
|
1009
|
+
[re]
|
|
1004
1010
|
]);
|
|
1005
1011
|
}
|
|
1006
1012
|
};
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
],
|
|
1013
|
+
it(se, "pluginName", tr);
|
|
1014
|
+
it(se, "type", E.UNIVER_SHEET);
|
|
1015
|
+
se = er([
|
|
1016
|
+
ft(Rt, Tt),
|
|
1017
|
+
De(1, N(He)),
|
|
1018
|
+
De(2, _t)
|
|
1019
|
+
], se);
|
|
1014
1020
|
export {
|
|
1015
|
-
|
|
1021
|
+
se as UniverSheetsNumfmtUIPlugin
|
|
1016
1022
|
};
|