12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286 |
- import {
- Ae,
- De,
- Ie,
- J,
- Je,
- O,
- Oe,
- P,
- Q,
- Qe,
- T as T2,
- Te as Te2,
- U,
- Ue,
- Ve,
- Ze as Ze2,
- k,
- ke,
- nt as nt2,
- rt as rt2,
- tt as tt2,
- we,
- x,
- xe
- } from "./chunk-KVSOW4CT.js";
- import {
- Er,
- Ks,
- bi,
- fl,
- me,
- tt,
- ue,
- xt
- } from "./chunk-T4NNB5UY.js";
- import {
- F,
- Go,
- Me,
- Pe,
- T,
- Te,
- V,
- Vo,
- ar as ar2,
- et,
- lh,
- lo,
- on,
- qn,
- uh,
- wt,
- zr
- } from "./chunk-BW43Z7N3.js";
- import {
- Pr
- } from "./chunk-QRYBFJ3R.js";
- import "./chunk-MIOQ566M.js";
- import {
- $e,
- Fa,
- _1,
- j0,
- l1,
- m1,
- n1,
- rt,
- u3
- } from "./chunk-POAJ2YNP.js";
- import {
- BO,
- Po,
- QC,
- a_,
- r_
- } from "./chunk-GBYP4PB2.js";
- import "./chunk-PZD7N4BC.js";
- import {
- Yx
- } from "./chunk-2MK3Q52E.js";
- import "./chunk-BSDDCPAW.js";
- import "./chunk-QG2HZMYH.js";
- import {
- DC,
- Fe,
- K0,
- Mf,
- Mi,
- OR,
- Observable,
- Op,
- Ot,
- Pt,
- Ra,
- SE,
- Vn,
- Vr,
- W0,
- Ze,
- _n,
- ar,
- combineLatest,
- debounceTime,
- dn,
- map,
- merge,
- ml,
- nf,
- nt,
- nu,
- ot,
- switchMap,
- tap,
- tr,
- xR
- } from "./chunk-23V3HWTR.js";
- import {
- require_react
- } from "./chunk-GNR2UJZM.js";
- import {
- __toESM
- } from "./chunk-2LSFTFF7.js";
- // node_modules/.pnpm/@univerjs+sheets-numfmt-ui@0.5.5_@grpc+grpc-js@1.13.4_react-dom@18.3.1_react@18.3.1_rxjs@7.8.1_typescript@5.4.5/node_modules/@univerjs/sheets-numfmt-ui/lib/es/index.js
- var import_react = __toESM(require_react());
- var pt = Object.defineProperty;
- var vt = (t, e, n) => e in t ? pt(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
- var X = (t, e, n) => vt(t, typeof e != "symbol" ? e + "" : e, n);
- var De2 = {};
- var dn2 = Object.defineProperty;
- var hn = Object.getOwnPropertyDescriptor;
- var fn = (t, e, n, r) => {
- for (var s = r > 1 ? void 0 : r ? hn(e, n) : e, i = t.length - 1, o; i >= 0; i--)
- (o = t[i]) && (s = (r ? o(e, n, s) : o(s)) || s);
- return r && s && dn2(e, n, s), s;
- };
- var U2 = (t, e) => (n, r) => e(n, r, t);
- var de = "SHEET_NUMFMT_ALERT";
- var Se = class extends nt {
- constructor(t, e, n, r, s, i, o) {
- super(), this._context = t, this._hoverManagerService = e, this._cellAlertManagerService = n, this._localeService = r, this._formulaDataModel = s, this._zenZoneService = i, this._numfmtService = o, this._init();
- }
- _init() {
- this._initCellAlertPopup(), this._initZenService();
- }
- _initCellAlertPopup() {
- this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(debounceTime(100)).subscribe((t) => {
- var e;
- if (t) {
- const n = t.location, r = this._context.unit, s = r.getActiveSheet();
- if (!s)
- return;
- const i = n.unitId, o = n.subUnitId;
- let a;
- const c = s.getCell(n.row, n.col);
- if (c != null && c.s) {
- const m = r.getStyles().get(c.s);
- m != null && m.n && (a = m.n);
- }
- if (a || (a = this._numfmtService.getValue(i, o, n.row, n.col)), !a) {
- this._hideAlert();
- return;
- }
- if (a.pattern === T && (c != null && c.v) && DC(c.v)) {
- const m = this._cellAlertManagerService.currentAlert.get(de), d = (e = m == null ? void 0 : m.alert) == null ? void 0 : e.location;
- if (d && d.row === n.row && d.col === n.col && d.subUnitId === n.subUnitId && d.unitId === n.unitId)
- return;
- this._cellAlertManagerService.showAlert({
- type: Ks.ERROR,
- title: this._localeService.t("info.error"),
- message: this._localeService.t("info.forceStringInfo"),
- location: n,
- width: 200,
- height: 74,
- key: de
- });
- return;
- }
- }
- this._hideAlert();
- }));
- }
- _initZenService() {
- this.disposeWithMe(this._zenZoneService.visible$.subscribe((t) => {
- t && this._hideAlert();
- }));
- }
- _hideAlert() {
- this._cellAlertManagerService.removeAlert(de);
- }
- };
- Se = fn([
- U2(1, ot(Er)),
- U2(2, ot(bi)),
- U2(3, ot(Vr)),
- U2(4, ot(Pr)),
- U2(5, u3),
- U2(6, ot(wt))
- ], Se);
- var he = {
- id: "sheet.operation.close.numfmt.panel",
- type: ar.OPERATION,
- handler: () => (
- // do nothing, just notify panel is closed
- true
- )
- };
- var A = {
- id: "sheet.operation.open.numfmt.panel",
- type: ar.OPERATION,
- handler: (t) => (t.get(B).openPanel(), true)
- };
- var fe = { exports: {} };
- var L = {};
- var Fe2;
- function pn() {
- if (Fe2)
- return L;
- Fe2 = 1;
- var t = import_react.default, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: true, ref: true, __self: true, __source: true };
- function o(a, c, m) {
- var d, u = {}, h = null, p = null;
- m !== void 0 && (h = "" + m), c.key !== void 0 && (h = "" + c.key), c.ref !== void 0 && (p = c.ref);
- for (d in c)
- r.call(c, d) && !i.hasOwnProperty(d) && (u[d] = c[d]);
- if (a && a.defaultProps)
- for (d in c = a.defaultProps, c)
- u[d] === void 0 && (u[d] = c[d]);
- return { $$typeof: e, type: a, key: h, ref: p, props: u, _owner: s.current };
- }
- return L.Fragment = n, L.jsx = o, L.jsxs = o, L;
- }
- var Le;
- function vn() {
- return Le || (Le = 1, fe.exports = pn()), fe.exports;
- }
- var l = vn();
- var _n2 = Object.defineProperty;
- var gn = Object.getOwnPropertyDescriptor;
- var Sn = (t, e, n, r) => {
- for (var s = r > 1 ? void 0 : r ? gn(e, n) : e, i = t.length - 1, o; i >= 0; i--)
- (o = t[i]) && (s = (r ? o(e, n, s) : o(s)) || s);
- return r && s && _n2(e, n, s), s;
- };
- var yn = (t, e) => (n, r) => e(n, r, t);
- var we2 = (0, import_react.createContext)([]);
- var k2 = class {
- constructor(t) {
- this._localStorageService = t;
- }
- _getKey(t) {
- return `userHabitController_${t}`;
- }
- async addHabit(t, e) {
- const n = this._getKey(t);
- return this._localStorageService.getItem(n).then((r) => {
- r || this._localStorageService.setItem(n, e);
- });
- }
- markHabit(t, e) {
- const n = this._getKey(t);
- this._localStorageService.getItem(n).then((r) => {
- if (r) {
- const s = r.findIndex((i) => i === e);
- s > -1 && r.splice(s, 1), r.unshift(e), this._localStorageService.setItem(n, r);
- }
- });
- }
- async getHabit(t, e) {
- const n = this._getKey(t), r = await this._localStorageService.getItem(n);
- if (e && r) {
- const s = r.map((i, o, a) => {
- const c = a.length;
- return {
- value: i,
- priority: c - o
- };
- });
- return e.sort((i, o) => {
- var m, d;
- const a = ((m = s.find((u) => u.value === i)) == null ? void 0 : m.priority) || -1;
- return (((d = s.find((u) => u.value === o)) == null ? void 0 : d.priority) || -1) - a;
- });
- }
- return r || [];
- }
- deleteHabit(t) {
- this._localStorageService.removeItem(t);
- }
- };
- k2 = Sn([
- yn(0, ot(xR))
- ], k2);
- var He = "numfmtCurrency";
- var bn = (t) => {
- const e = W0(k2), [n, r] = (0, import_react.useState)(J);
- return (0, import_react.useEffect)(() => {
- e.addHabit("numfmtCurrency", []).then(() => {
- e.getHabit(He, [...J]).then((i) => {
- r(i), t(i);
- });
- });
- }, []), { userHabitCurrency: n, mark: (i) => {
- e.markHabit(He, i);
- } };
- };
- var Cn = () => {
- const t = (0, import_react.useRef)([]), [e, n] = (0, import_react.useState)({});
- return (0, import_react.useEffect)(() => {
- t.current.forEach((s) => {
- s();
- }), t.current = [];
- }, [e]), (s) => {
- t.current.push(s), n({});
- };
- };
- var In = (t) => !!ke(t) && t.startsWith("_(");
- var Nn = (t) => {
- const { defaultPattern: e, action: n, onChange: r } = t, [s, i] = (0, import_react.useState)(() => x(e || "", 2)), o = (0, import_react.useContext)(we2), [a, c] = (0, import_react.useState)(() => ke(e) || o[0]), m = (0, import_react.useMemo)(() => o.map((v) => ({ label: v, value: v })), []), u = W0(Vr).t;
- n.current = () => P(`_("${a}"* #,##0${s > 0 ? ".0" : ""}_)`, s);
- const h = (v) => {
- c(v), r(P(`_("${v}"* #,##0${s > 0 ? ".0" : ""}_)`, s));
- }, p = (v) => {
- const f = v || 0;
- i(f), r(P(`_("${a}"* #,##0${f > 0 ? ".0" : ""}_)`, f));
- };
- return l.jsxs("div", { children: [
- l.jsxs("div", { className: "m-t-16 options", children: [
- l.jsxs("div", { className: "option", children: [
- l.jsx("div", { className: "label", children: u("sheet.numfmt.decimalLength") }),
- l.jsx("div", { className: "m-t-8 w-120", children: l.jsx(BO, { value: s, max: 20, min: 0, onChange: p }) })
- ] }),
- l.jsxs("div", { className: "option", children: [
- l.jsx("div", { className: "label", children: u("sheet.numfmt.currencyType") }),
- l.jsx("div", { className: "m-t-8 w-140", children: l.jsx(r_, { onChange: h, options: m, value: a }) })
- ] })
- ] }),
- l.jsx("div", { className: "describe m-t-14", children: u("sheet.numfmt.accountingDes") })
- ] });
- };
- var En = (t) => !!ke(t) && !t.startsWith("_(");
- var Tn = (t) => {
- const n = W0(Vr).t, r = (0, import_react.useContext)(we2), [s, i] = (0, import_react.useState)(() => ke(t.defaultPattern) || r[0]), [o, a] = (0, import_react.useState)(() => x(t.defaultPattern || "", 2)), [c, m] = (0, import_react.useState)(() => {
- var _;
- const f = tt2(s);
- return ((_ = f.find((I) => Ze2(I.value, t.defaultPattern))) == null ? void 0 : _.value) || f[0].value;
- }), d = (0, import_react.useMemo)(() => tt2(s), [s]), u = (0, import_react.useMemo)(() => r.map((f) => ({ label: f, value: f })), [r]);
- t.action.current = () => P(c, o);
- const h = (f) => {
- if (f === void 0)
- return;
- i(f);
- const y = tt2(f)[0].value;
- m(y), t.onChange(P(y, o));
- }, p = (f) => {
- f !== void 0 && (m(f), t.onChange(P(f, o)));
- }, v = (f) => {
- a(f || 0), t.onChange(P(c, f || 0));
- };
- return l.jsxs("div", { children: [
- l.jsxs("div", { className: "m-t-16 options", children: [
- l.jsxs("div", { className: "option", children: [
- l.jsx("div", { className: "label", children: n("sheet.numfmt.decimalLength") }),
- l.jsx("div", { className: "m-t-8 w-120", children: l.jsx(BO, { value: o, max: 20, min: 0, onChange: v }) })
- ] }),
- l.jsxs("div", { className: "option", children: [
- l.jsx("div", { className: "label", children: n("sheet.numfmt.currencyType") }),
- l.jsx("div", { className: "m-t-8 w-140", children: l.jsx(r_, { onChange: h, options: u, value: s }) })
- ] })
- ] }),
- l.jsx("div", { className: "m-t-16 label", children: n("sheet.numfmt.negType") }),
- l.jsx("div", { className: "m-t-8", children: l.jsx(a_, { onChange: p, options: d, value: c }) }),
- l.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.currencyDes") })
- ] });
- };
- var N = function() {
- return N = Object.assign || function(t) {
- for (var e, n = 1, r = arguments.length; n < r; n++) {
- e = arguments[n];
- for (var s in e)
- Object.prototype.hasOwnProperty.call(e, s) && (t[s] = e[s]);
- }
- return t;
- }, N.apply(this, arguments);
- };
- var xn = function(t, e) {
- var n = {};
- for (var r in t)
- Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
- if (t != null && typeof Object.getOwnPropertySymbols == "function")
- for (var s = 0, r = Object.getOwnPropertySymbols(t); s < r.length; s++)
- e.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[s]) && (n[r[s]] = t[r[s]]);
- return n;
- };
- var ot2 = (0, import_react.forwardRef)(function(t, e) {
- var n = t.icon, r = t.id, s = t.className, i = t.extend, o = xn(t, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(s || "").trim(), c = (0, import_react.useRef)("_".concat(Rn()));
- return ct(n, "".concat(r), { defIds: n.defIds, idSuffix: c.current }, N({ ref: e, className: a }, o), i);
- });
- function ct(t, e, n, r, s) {
- return (0, import_react.createElement)(t.tag, N(N({ key: e }, Pn(t, n, s)), r), (Mn(t, n).children || []).map(function(i, o) {
- return ct(i, "".concat(e, "-").concat(t.tag, "-").concat(o), n, void 0, s);
- }));
- }
- function Pn(t, e, n) {
- var r = N({}, t.attrs);
- n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
- var s = e.defIds;
- return !s || s.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(i) {
- var o = i[0], a = i[1];
- typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
- })), r;
- }
- function Mn(t, e) {
- var n, r = e.defIds;
- return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? N(N({}, t), { children: t.children.map(function(s) {
- return typeof s.attrs.id == "string" && r && r.indexOf(s.attrs.id) > -1 ? N(N({}, s), { attrs: N(N({}, s.attrs), { id: s.attrs.id + e.idSuffix }) }) : s;
- }) }) : t;
- }
- function Rn() {
- return Math.random().toString(36).substring(2, 8);
- }
- ot2.displayName = "UniverIcon";
- var jn = { 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" } }] };
- var at = (0, import_react.forwardRef)(function(t, e) {
- return (0, import_react.createElement)(ot2, Object.assign({}, t, {
- id: "check-mark-single",
- ref: e,
- icon: jn
- }));
- });
- at.displayName = "CheckMarkSingle";
- var wn = "univer-custom-format-title";
- var On = "univer-custom-format-input";
- var Un = "univer-custom-format-history-list";
- var $n = "univer-custom-format-history-list-item";
- var Dn = "univer-custom-format-history-list-item-icon-wrap";
- var Fn = "univer-custom-format-des";
- var j = {
- customFormatTitle: wn,
- customFormatInput: On,
- customFormatHistoryList: Un,
- customFormatHistoryListItem: $n,
- customFormatHistoryListItemIconWrap: Dn,
- customFormatDes: Fn
- };
- var pe = "customFormat";
- var ve = "numfmt_custom_pattern";
- function Ln(t) {
- const { defaultPattern: e, action: n, onChange: r } = t, s = W0(k2), i = W0(xR), o = W0(Vr), [a, c] = (0, import_react.useState)(e);
- n.current = () => (s.markHabit(pe, a), i.getItem(ve).then((p = []) => {
- const v = [.../* @__PURE__ */ new Set([a, ...p || []])].splice(0, 10).filter((f) => !!f);
- i.setItem(ve, v);
- }), a);
- const [m, d] = (0, import_react.useState)([]);
- (0, import_react.useEffect)(() => {
- i.getItem(ve).then((p) => {
- const v = [
- ...Q.map((f) => f.suffix("$")),
- ...Te2.map((f) => f.suffix),
- ...xe.map((f) => f.suffix)
- ];
- v.push(...p || []), s.addHabit(pe, []).finally(() => {
- s.getHabit(pe, v).then((f) => {
- d([...new Set(f)]);
- });
- });
- });
- }, []);
- const u = (p) => {
- c(p), r(p);
- }, h = () => {
- r(a);
- };
- return l.jsxs("div", { className: j.customFormat, children: [
- l.jsx("div", { className: j.customFormatTitle, children: o.t("sheet.numfmt.customFormat") }),
- l.jsx(QC, { placeholder: o.t("sheet.numfmt.customFormat"), onBlur: h, value: a, onChange: c, className: j.customFormatInput }),
- l.jsx("div", { className: j.customFormatHistoryList, children: m.map((p) => l.jsxs("div", { onClick: () => u(p), className: j.customFormatHistoryListItem, children: [
- l.jsx("div", { className: j.customFormatHistoryListItemIconWrap, children: a === p && l.jsx(at, {}) }),
- l.jsx("div", { children: p })
- ] }, p)) }),
- l.jsx("div", { className: j.customFormatDes, children: o.t("sheet.numfmt.customFormatDes") })
- ] });
- }
- var Hn = (t) => {
- const e = Op.getInfo(t);
- return nt2().map((n) => n.value).includes(t) || ["date", "datetime", "time"].includes(e.type);
- };
- var An = (t) => {
- const e = (0, import_react.useMemo)(nt2, []), r = W0(Vr).t, [s, i] = (0, import_react.useState)(() => {
- if (t.defaultPattern) {
- const a = e.find((c) => c.value === t.defaultPattern);
- if (a)
- return a.value;
- }
- return e[0].value;
- });
- t.action.current = () => s;
- const o = (a) => {
- a !== void 0 && (i(a), t.onChange(a));
- };
- return l.jsxs("div", { children: [
- l.jsx("div", { className: "m-t-16 label", children: r("sheet.numfmt.dateType") }),
- l.jsx("div", { className: "m-t-8", children: l.jsx(a_, { value: s, options: e, onChange: o }) }),
- l.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.dateDes") })
- ] });
- };
- var kn = (t) => !t;
- var Bn = (t) => {
- const n = W0(Vr).t;
- return t.action.current = () => "", l.jsx("div", { children: l.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.generalDes") }) });
- };
- var Wn = (t) => rt2().some((e) => Ze2(e.value, t));
- var Vn2 = (t) => {
- const e = W0(Vr), n = (0, import_react.useMemo)(rt2, []), [r, s] = (0, import_react.useState)(() => x(t.defaultPattern || "", 0)), [i, o] = (0, import_react.useState)(() => {
- const u = n.find((h) => Ze2(h.value, t.defaultPattern || ""));
- return (u == null ? void 0 : u.value) || n[0].value;
- }), a = (0, import_react.useMemo)(() => P(i, Number(r || 0)), [i, r]), c = (0, import_react.useMemo)(() => !Je(i), [i]), m = (u) => {
- s(u || 0), t.onChange(P(i, Number(u || 0)));
- }, d = (u) => {
- u !== void 0 && (s(x(u, 0)), o(u), t.onChange(u));
- };
- return t.action.current = () => a, l.jsxs("div", { children: [
- l.jsx("div", { className: "m-t-16 label", children: e.t("sheet.numfmt.decimalLength") }),
- l.jsx("div", { className: "m-t-8", children: l.jsx(
- BO,
- {
- disabled: c,
- value: r,
- max: 20,
- min: 0,
- onChange: m
- }
- ) }),
- l.jsxs("div", { className: "m-t-16 label", children: [
- " ",
- e.t("sheet.numfmt.negType")
- ] }),
- l.jsx("div", { className: "m-t-8", children: l.jsx(a_, { onChange: d, options: n, value: i }) }),
- l.jsx("div", { className: "describe m-t-14", children: e.t("sheet.numfmt.thousandthPercentileDes") })
- ] });
- };
- var Gn = (t) => {
- const { defaultValue: e, defaultPattern: n, row: r, col: s } = t.value, i = W0(Vr), o = (0, import_react.useRef)(() => ""), a = i.t, c = Cn(), m = (0, import_react.useMemo)(
- () => [
- { label: "sheet.numfmt.general", component: Bn },
- { label: "sheet.numfmt.accounting", component: Nn },
- { label: "sheet.numfmt.currency", component: Tn },
- { label: "sheet.numfmt.date", component: An },
- { label: "sheet.numfmt.thousandthPercentile", component: Vn2 },
- { label: "sheet.numfmt.customFormat", component: Ln }
- ].map((g) => ({ ...g, label: a(g.label) })),
- []
- ), [d, u] = (0, import_react.useState)(_), [h, p] = (0, import_react.useState)(() => `${r}_${s}`), { mark: v, userHabitCurrency: f } = bn(() => p(`${r}_${s}_userCurrency'`)), y = (0, import_react.useMemo)(() => {
- var g;
- return (g = m.find((w) => w.label === d)) == null ? void 0 : g.component;
- }, [d]);
- function _() {
- return [kn, In, En, Hn, Wn].reduce((w, ht, ft) => w || (ht(n) ? m[ft].label : ""), "") || m[0].label;
- }
- const I = m.map((g) => ({
- label: g.label,
- value: g.label
- })), P2 = (g) => {
- u(g), c(() => t.onChange({ type: "change", value: o.current() || "" }));
- }, J2 = (g) => {
- t.onChange({ type: "change", value: g });
- }, le = () => {
- const g = o.current() || "", w = ke(g);
- w && v(w), t.onChange({ type: "confirm", value: g });
- }, F2 = () => {
- t.onChange({ type: "cancel", value: "" });
- }, me2 = {
- onChange: J2,
- defaultValue: e,
- defaultPattern: n,
- action: o
- };
- return (0, import_react.useEffect)(() => {
- u(_()), p(`${r}_${s}`);
- }, [r, s]), l.jsxs("div", { className: "numfmt-panel p-b-20", children: [
- l.jsxs("div", { children: [
- l.jsx("div", { className: "label m-t-14", children: a("sheet.numfmt.numfmtType") }),
- l.jsx("div", { className: "m-t-8", children: l.jsx(r_, { onChange: P2, options: I, value: d, style: { width: "100%" } }) }),
- l.jsx("div", { children: y && l.jsx(we2.Provider, { value: f, children: (0, import_react.createElement)(y, { ...me2, key: h }) }) })
- ] }),
- l.jsxs("div", { className: "btn-list m-t-14 m-b-20", children: [
- l.jsx(Po, { size: "small", onClick: F2, className: "m-r-12", children: a("sheet.numfmt.cancel") }),
- l.jsx(Po, { type: "primary", size: "small", onClick: le, children: a("sheet.numfmt.confirm") })
- ] })
- ] });
- };
- var Kn = Object.defineProperty;
- var qn2 = Object.getOwnPropertyDescriptor;
- var Yn = (t, e, n, r) => {
- for (var s = r > 1 ? void 0 : r ? qn2(e, n) : e, i = t.length - 1, o; i >= 0; i--)
- (o = t[i]) && (s = (r ? o(e, n, s) : o(s)) || s);
- return r && s && Kn(e, n, s), s;
- };
- var x2 = (t, e) => (n, r) => e(n, r, t);
- var Ae2 = "SHEET_NUMFMT_PANEL";
- var B = class extends nt {
- constructor(e, n, r, s, i, o, a, c, m, d, u) {
- super();
- X(this, "_previewPattern", "");
- X(this, "_sidebarDisposable", null);
- this._sheetInterceptorService = e, this._themeService = n, this._univerInstanceService = r, this._commandService = s, this._selectionManagerService = i, this._renderManagerService = o, this._numfmtService = a, this._componentManager = c, this._sidebarService = m, this._localeService = d, this._sheetsNumfmtCellContentController = u, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener(), this._initNumfmtLocalChange();
- }
- _initNumfmtLocalChange() {
- this.disposeWithMe(merge(this._sheetsNumfmtCellContentController.local$, this._localeService.currentLocale$).subscribe(() => {
- this._forceUpdate();
- }));
- }
- openPanel() {
- var y;
- const e = this._sidebarService, n = this._selectionManagerService, r = this._commandService, s = this._univerInstanceService, i = this._numfmtService, o = this._localeService, c = (((y = n.getCurrentSelections()) == null ? void 0 : y.map((_) => _.range)) || [])[0];
- if (!c)
- return false;
- const m = s.getCurrentUnitForType(Fe.UNIVER_SHEET), d = m.getActiveSheet();
- if (!d)
- return false;
- const u = d.getCellRaw(c.startRow, c.startColumn), h = i.getValue(
- m.getUnitId(),
- d.getSheetId(),
- c.startRow,
- c.startColumn
- );
- let p = "";
- h && (p = h.pattern);
- const v = (u == null ? void 0 : u.t) === dn.NUMBER ? u.v : 12345678, f = {
- onChange: (_) => {
- var I;
- if (_.type === "change")
- this._previewPattern = _.value, this._forceUpdate();
- else if (_.type === "confirm") {
- const P2 = ((I = n.getCurrentSelections()) == null ? void 0 : I.map((F2) => F2.range)) || [], J2 = { values: [] }, le = Qe(_.value);
- P2.forEach((F2) => {
- tr.foreach(F2, (me2, g) => {
- J2.values.push({
- row: me2,
- col: g,
- pattern: _.value,
- type: le
- });
- });
- }), r.executeCommand(T2.id, J2), e.close();
- } else
- _.type === "cancel" && e.close();
- },
- value: { defaultPattern: p, defaultValue: v, row: c.startRow, col: c.startColumn }
- };
- return this._sidebarDisposable = e.open({
- header: { title: o.t("sheet.numfmt.title") },
- children: {
- label: Ae2,
- ...f
- // need passthrough to react props.
- },
- onClose: () => {
- this._forceUpdate(), r.executeCommand(he.id);
- }
- }), true;
- }
- _forceUpdate(e) {
- var r;
- const n = this._renderManagerService.getRenderById(
- e != null ? e : this._univerInstanceService.getCurrentUnitForType(Fe.UNIVER_SHEET).getUnitId()
- );
- n == null || n.with(me).reCalculate(), (r = n == null ? void 0 : n.mainComponent) == null || r.makeDirty();
- }
- _initCommands() {
- [
- A,
- he
- ].forEach((e) => {
- this.disposeWithMe(this._commandService.registerCommand(e));
- });
- }
- _initPanel() {
- this._componentManager.register(Ae2, Gn);
- }
- // eslint-disable-next-line max-lines-per-function
- _initRealTimeRenderingInterceptor() {
- const e = new Observable((r) => {
- this._commandService.onCommandExecuted((s) => {
- s.id === A.id && r.next(true), s.id === he.id && r.next(false);
- });
- }), n = combineLatest([
- e,
- this._selectionManagerService.selectionMoveEnd$.pipe(
- map((r) => r ? r.map((s) => s.range) : [])
- )
- ]);
- this.disposeWithMe(
- Ze(
- n.pipe(
- switchMap(
- ([r, s]) => new Observable((i) => {
- const o = new Mi();
- return r && s.length && i.next({ selectionRanges: s, disposableCollection: o }), () => {
- o.dispose();
- };
- })
- ),
- tap(() => {
- this._previewPattern = null;
- })
- ).subscribe(({ disposableCollection: r, selectionRanges: s }) => {
- var o, a;
- const i = this._univerInstanceService.getCurrentUnitForType(Fe.UNIVER_SHEET);
- this.openPanel(), r.add(
- this._sheetInterceptorService.intercept(et.CELL_CONTENT, {
- priority: 99,
- effect: Vn.Value | Vn.Style,
- handler: (c, m, d) => {
- const { row: u, col: h } = m, p = d(c) || {};
- if (s.find(
- (v) => v.startColumn <= h && v.endColumn >= h && v.startRow <= u && v.endRow >= u
- )) {
- const v = m.worksheet.getCellRaw(u, h), f = v == null ? void 0 : v.v, y = v == null ? void 0 : v.t;
- if (f == null || y !== dn.NUMBER || this._previewPattern === null)
- return p;
- const _ = we(this._previewPattern, f, this._sheetsNumfmtCellContentController.local);
- if (_.color) {
- const P2 = this._themeService.getCurrentTheme()[`${_.color}500`];
- return {
- ...p,
- v: _.result,
- t: dn.STRING,
- s: { cl: { rgb: P2 } }
- };
- }
- return {
- ...p,
- v: _.result,
- t: dn.STRING
- };
- }
- return p;
- }
- })
- ), (a = (o = this._renderManagerService.getRenderById(i.getUnitId())) == null ? void 0 : o.mainComponent) == null || a.makeDirty();
- })
- )
- );
- }
- _commandExecutedListener() {
- const e = [zr.id, Vo.id];
- this.disposeWithMe(
- new Observable((n) => {
- const r = this._commandService.onCommandExecuted((s) => {
- if (e.includes(s.id)) {
- const i = s.params;
- n.next(i.unitId);
- }
- });
- return () => r.dispose();
- }).pipe(debounceTime(16)).subscribe((n) => this._forceUpdate(n))
- );
- }
- _initCloseListener() {
- this._univerInstanceService.getCurrentTypeOfUnit$(Fe.UNIVER_SHEET).subscribe((e) => {
- var n;
- e || ((n = this._sidebarDisposable) == null || n.dispose(), this._sidebarDisposable = null);
- });
- }
- };
- B = Yn([
- x2(0, ot(V)),
- x2(1, ot(ml)),
- x2(2, _n),
- x2(3, Pt),
- x2(4, ot(F)),
- x2(5, Yx),
- x2(6, wt),
- x2(7, ot(n1)),
- x2(8, rt),
- x2(9, ot(Vr)),
- x2(10, ot(U))
- ], B);
- var Zn = Object.defineProperty;
- var zn = Object.getOwnPropertyDescriptor;
- var Jn = (t, e, n, r) => {
- for (var s = r > 1 ? void 0 : r ? zn(e, n) : e, i = t.length - 1, o; i >= 0; i--)
- (o = t[i]) && (s = (r ? o(e, n, s) : o(s)) || s);
- return r && s && Zn(e, n, s), s;
- };
- var H = (t, e) => (n, r) => e(n, r, t);
- var Xn = () => {
- let t = [];
- return {
- add: (s, i, o, a, c) => t.push({ unitId: s, subUnitId: i, row: o, col: a, value: c }),
- getEffects: () => t,
- clean: () => {
- t = [];
- }
- };
- };
- var re = class extends nt {
- constructor(e, n, r, s, i) {
- super();
- X(this, "_collectEffectMutation", Xn());
- this._sheetInterceptorService = e, this._numfmtService = n, this._univerInstanceService = r, this._injector = s, this._editorBridgeService = i, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
- }
- _initInterceptorEditorStart() {
- this._editorBridgeService && this.disposeWithMe(
- Ze(
- this._sheetInterceptorService.writeCellInterceptor.intercept(
- Go,
- {
- handler: (e, n, r) => {
- const s = n.row, i = n.col, o = this._numfmtService.getValue(
- n.unitId,
- n.subUnitId,
- s,
- i
- );
- if (o)
- switch (Qe(o.pattern)) {
- case "scientific":
- case "currency":
- case "grouped":
- case "number": {
- const c = n.worksheet.getCellRaw(s, i);
- return r && r(c);
- }
- case "percent":
- case "date":
- case "time":
- case "datetime":
- default:
- return r && r(e);
- }
- return r(e);
- }
- }
- )
- )
- );
- }
- /**
- * Process the values after edit
- * @private
- * @memberof NumfmtService
- */
- _initInterceptorEditorEnd() {
- this.disposeWithMe(
- Ze(
- this._sheetInterceptorService.writeCellInterceptor.intercept(
- qn,
- {
- // eslint-disable-next-line complexity
- handler: (e, n, r) => {
- var d, u, h, p;
- this._collectEffectMutation.clean();
- const s = this._numfmtService.getValue(
- n.unitId,
- n.subUnitId,
- n.row,
- n.col
- ), i = (d = s && Qe(s.pattern)) != null ? d : "", o = () => {
- s && this._collectEffectMutation.add(
- n.unitId,
- n.subUnitId,
- n.row,
- n.col,
- null
- );
- };
- if (!(e != null && e.v) && !(e != null && e.p) || (s == null ? void 0 : s.pattern) === T || e.t === dn.FORCE_STRING)
- return r(e);
- const a = (u = e.p) == null ? void 0 : u.body, c = (p = (h = e == null ? void 0 : e.p) == null ? void 0 : h.body) != null && p.dataStream ? e.p.body.dataStream.replace(/\r\n$/, "") : String(e.v), m = Op.parseDate(c) || Op.parseTime(c) || Op.parseNumber(c);
- if (a)
- if (er(a)) {
- const { dataStream: v } = a, f = v.replace(/\r\n$/, ""), y = Number(f);
- if (Number.isNaN(y) && !m)
- return r(e);
- } else
- return r(e);
- if (m) {
- m.z && this._collectEffectMutation.add(
- n.unitId,
- n.subUnitId,
- n.row,
- n.col,
- {
- pattern: m.z
- }
- );
- const v = Number(m.v);
- return r({ ...e, p: void 0, v, t: dn.NUMBER });
- } else
- (["date", "time", "datetime", "percent"].includes(i) || !Qn(c)) && o();
- return r(e);
- }
- }
- )
- )
- );
- }
- _initInterceptorCommands() {
- const e = this;
- this.disposeWithMe(
- this._sheetInterceptorService.interceptCommand({
- getMutations(n) {
- var r;
- switch (n.id) {
- case on.id: {
- const s = e._univerInstanceService.getCurrentUnitForType(Fe.UNIVER_SHEET), i = s.getUnitId(), o = (r = s.getActiveSheet()) == null ? void 0 : r.getSheetId();
- if (!o)
- return {
- redos: [],
- undos: []
- };
- const a = e._collectEffectMutation.getEffects();
- if (e._collectEffectMutation.clean(), !a.length)
- return {
- redos: [],
- undos: []
- };
- const c = a.filter((h) => {
- var p;
- return !!((p = h.value) != null && p.pattern);
- }).map((h) => ({
- row: h.row,
- col: h.col,
- pattern: h.value.pattern
- })), m = a.filter((h) => {
- var p;
- return !((p = h.value) != null && p.pattern);
- }).map((h) => ({
- startRow: h.row,
- endColumn: h.col,
- startColumn: h.col,
- endRow: h.row
- })), d = [], u = [];
- if (c.length) {
- const h = {
- id: Vo.id,
- params: lo(i, o, c)
- };
- d.push(h), u.push(...uh(e._injector, h.params));
- }
- if (m.length) {
- const h = {
- id: zr.id,
- params: {
- unitId: i,
- subUnitId: o,
- ranges: m
- }
- };
- d.push(h), u.push(...lh(e._injector, h.params));
- }
- return {
- redos: d,
- undos: u.reverse()
- };
- }
- }
- return {
- redos: [],
- undos: []
- };
- }
- })
- );
- }
- };
- re = Jn([
- H(0, ot(V)),
- H(1, ot(wt)),
- H(2, ot(_n)),
- H(3, ot(Ot)),
- H(4, nf(tt))
- ], re);
- function Qn(t) {
- return /^-?\d+(\.\d+)?$/.test(t);
- }
- function er(t) {
- const { textRuns: e = [], paragraphs: n = [], customRanges: r, customBlocks: s = [] } = t, i = ["va"];
- return !(e.some((o) => !!(o.ts && Object.keys(o.ts).some((c) => i.includes(c)))) || n.some((o) => o.bullet) || n.length >= 2 || r != null && r.length || s.length > 0);
- }
- var ee = [
- {
- label: "sheet.numfmt.general",
- pattern: null
- },
- {
- label: "sheet.numfmt.text",
- pattern: T
- },
- "|",
- {
- label: "sheet.numfmt.number",
- pattern: "0"
- },
- "|",
- {
- label: "sheet.numfmt.accounting",
- pattern: '"¥" #,##0.00_);[Red]("¥"#,##0.00)'
- },
- {
- label: "sheet.numfmt.financialValue",
- pattern: "#,##0.00;[Red]#,##0.00"
- },
- {
- label: "sheet.numfmt.currency",
- pattern: '"¥"#,##0.00_);[Red]("¥"#,##0.00)'
- },
- {
- label: "sheet.numfmt.roundingCurrency",
- pattern: '"¥"#,##0;[Red]"¥"#,##0'
- },
- "|",
- {
- label: "sheet.numfmt.date",
- pattern: "yyyy-mm-dd;@"
- },
- {
- label: "sheet.numfmt.time",
- pattern: 'am/pm h":"mm":"ss'
- },
- {
- label: "sheet.numfmt.dateTime",
- pattern: "yyyy-m-d am/pm h:mm"
- },
- {
- label: "sheet.numfmt.timeDuration",
- pattern: "h:mm:ss"
- },
- "|",
- {
- label: "sheet.numfmt.moreFmt",
- pattern: ""
- }
- ];
- var tr2 = (t) => ({
- icon: new Observable((e) => {
- const n = t.get(k);
- function r(i) {
- return {
- [Ie.US]: "DollarSingle",
- [Ie.RU]: "RoubleSingle",
- [Ie.CN]: "RmbSingle",
- [Ie.AT]: "EuroSingle"
- }[i] || "DollarSingle";
- }
- const s = Ie[n.getCurrencySymbol()] || "$";
- return e.next(r(s)), n.currencySymbol$.subscribe((i) => {
- const o = Ie[i] || "$";
- e.next(r(o));
- });
- }),
- id: Oe.id,
- title: "sheet.numfmt.currency",
- tooltip: "sheet.numfmt.currency",
- type: $e.BUTTON,
- hidden$: Fa(t, Fe.UNIVER_SHEET),
- disabled$: ue(t, { workbookTypes: [Me], worksheetTypes: [Te, ar2], rangeTypes: [Pe] })
- });
- var nr = (t) => ({
- icon: "AddDigitsSingle",
- id: Ue.id,
- title: "sheet.numfmt.addDecimal",
- tooltip: "sheet.numfmt.addDecimal",
- type: $e.BUTTON,
- hidden$: Fa(t, Fe.UNIVER_SHEET),
- disabled$: ue(t, { workbookTypes: [Me], worksheetTypes: [Te, ar2], rangeTypes: [Pe] })
- });
- var rr = (t) => ({
- icon: "ReduceDigitsSingle",
- id: Ve.id,
- title: "sheet.numfmt.subtractDecimal",
- tooltip: "sheet.numfmt.subtractDecimal",
- type: $e.BUTTON,
- hidden$: Fa(t, Fe.UNIVER_SHEET),
- disabled$: ue(t, { workbookTypes: [Me], worksheetTypes: [Te, ar2], rangeTypes: [Pe] })
- });
- var sr = (t) => ({
- icon: "PercentSingle",
- id: De.id,
- title: "sheet.numfmt.percent",
- tooltip: "sheet.numfmt.percent",
- type: $e.BUTTON,
- hidden$: Fa(t, Fe.UNIVER_SHEET),
- disabled$: ue(t, { workbookTypes: [Me], worksheetTypes: [Te, ar2], rangeTypes: [Pe] })
- });
- var ir = (t) => {
- const e = t.get(_n), n = t.get(Pt), r = t.get(Vr), s = t.get(F), i = xt(e, "", ({ workbook: o, worksheet: a }) => new Observable(
- (c) => merge(
- s.selectionMoveEnd$,
- new Observable((m) => {
- const d = [zr.id, Vo.id], u = n.onCommandExecuted((h) => {
- d.includes(h.id) && m.next(null);
- });
- return () => u.dispose();
- })
- ).subscribe(() => {
- var d, u;
- const m = s.getCurrentSelections();
- if (m && m[0]) {
- const h = m[0].range, p = h.startRow, v = h.startColumn, f = (u = o.getStyles().get((d = a.getCell(p, v)) == null ? void 0 : d.s)) == null ? void 0 : u.n, y = f == null ? void 0 : f.pattern;
- let _ = r.t("sheet.numfmt.general");
- if (y) {
- const I = ee.filter((P2) => typeof P2 == "object" && P2.pattern).find(
- (P2) => Ze2(y, P2.pattern)
- );
- I && typeof I == "object" && I.pattern ? _ = r.t(I.label) : _ = r.t("sheet.numfmt.moreFmt");
- }
- c.next(_);
- }
- })
- ));
- return {
- label: lt,
- id: A.id,
- tooltip: "sheet.numfmt.title",
- type: $e.SELECTOR,
- selections: [
- {
- label: {
- name: mt,
- hoverable: false
- }
- }
- ],
- value$: i,
- hidden$: Fa(t, Fe.UNIVER_SHEET),
- disabled$: ue(t, { workbookTypes: [Me], worksheetTypes: [ar2, Te], rangeTypes: [Pe] })
- };
- };
- var lt = "sheet.numfmt.moreNumfmtType";
- var mt = "sheet.numfmt.moreNumfmtType.options";
- var or = (t) => {
- var r;
- const e = W0(Vr), n = (r = t.value) != null ? r : e.t("sheet.numfmt.general");
- return l.jsx("span", { className: "more-numfmt-type", children: n });
- };
- var cr = () => {
- const t = W0(Pt), e = W0(Vr), n = W0(_1), r = W0(U), s = W0(F), i = (c) => {
- const m = s.getCurrentLastSelection();
- if (!m)
- return;
- const d = m.range, u = [];
- tr.foreach(d, (h, p) => {
- c ? u.push({ row: h, col: p, pattern: c, type: Qe(c) }) : u.push({ row: h, col: p });
- }), t.executeCommand(T2.id, { values: u }), n.focus();
- }, o = (c) => {
- if (c === 0)
- i(null);
- else if (c === ee.length - 1)
- t.executeCommand(A.id);
- else {
- const m = ee[c];
- m.pattern && i(m.pattern);
- }
- }, a = 1220;
- return l.jsx("div", { className: "more-numfmt-type-options", children: ee.map((c, m) => c === "|" ? l.jsx("div", { className: "line m-t-4", onClick: (d) => d.stopPropagation() }, m) : l.jsxs(
- "div",
- {
- className: "option-item m-t-4",
- onClick: () => {
- o(m);
- },
- children: [
- l.jsx("div", { children: e.t(c.label) }),
- l.jsx("div", { className: "m-l-26", children: c.pattern ? Ae(c.pattern || "", a, r.local).result : "" })
- ]
- },
- m
- )) });
- };
- var ar3 = {
- [l1.FORMULAS_INSERT]: {
- [Oe.id]: {
- order: 4,
- menuItemFactory: tr2
- },
- [Ue.id]: {
- order: 5,
- menuItemFactory: nr
- },
- [Ve.id]: {
- order: 6,
- menuItemFactory: rr
- },
- [De.id]: {
- order: 7,
- menuItemFactory: sr
- },
- [A.id]: {
- order: 8,
- menuItemFactory: ir
- }
- }
- };
- var lr = Object.defineProperty;
- var mr = Object.getOwnPropertyDescriptor;
- var ur = (t, e, n, r) => {
- for (var s = r > 1 ? void 0 : r ? mr(e, n) : e, i = t.length - 1, o; i >= 0; i--)
- (o = t[i]) && (s = (r ? o(e, n, s) : o(s)) || s);
- return r && s && lr(e, n, s), s;
- };
- var ke2 = (t, e) => (n, r) => e(n, r, t);
- var se = class extends nt {
- constructor(t, e) {
- super(), this._componentManager = t, this._menuManagerService = e, this._initMenu();
- }
- _initMenu() {
- this._menuManagerService.mergeMenu(ar3), this.disposeWithMe(this._componentManager.register(lt, or)), this.disposeWithMe(this._componentManager.register(mt, cr));
- }
- };
- se = ur([
- ke2(0, ot(n1)),
- ke2(1, m1)
- ], se);
- var ut = Object.defineProperty;
- var dr = Object.getOwnPropertyDescriptor;
- var hr = (t, e, n) => e in t ? ut(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
- var fr = (t, e, n, r) => {
- for (var s = r > 1 ? void 0 : r ? dr(e, n) : e, i = t.length - 1, o; i >= 0; i--)
- (o = t[i]) && (s = (r ? o(e, n, s) : o(s)) || s);
- return r && s && ut(e, n, s), s;
- };
- var _e = (t, e) => (n, r) => e(n, r, t);
- var dt = (t, e, n) => hr(t, typeof e != "symbol" ? e + "" : e, n);
- var pr = "SHEET_NUMFMT_UI_PLUGIN";
- var ie = class extends Ra {
- constructor(t = De2, e, n, r) {
- super(), this._config = t, this._injector = e, this._configService = n, this._renderManagerService = r;
- const { menu: s, ...i } = nu(
- {},
- De2,
- this._config
- );
- s && this._configService.setConfig("menu", s, { merge: true }), this._configService.setConfig(j0, i);
- }
- onStarting() {
- K0(this._injector, [
- [B],
- [re],
- [k2],
- [se]
- ]);
- }
- onRendered() {
- this._registerRenderModules(), Mf(this._injector, [
- [B],
- [re],
- [se]
- ]);
- }
- _registerRenderModules() {
- [
- [Se]
- ].forEach((e) => {
- this.disposeWithMe(this._renderManagerService.registerRenderModule(Fe.UNIVER_SHEET, e));
- });
- }
- };
- dt(ie, "pluginName", pr);
- dt(ie, "type", Fe.UNIVER_SHEET);
- ie = fr([
- OR(fl, O),
- _e(1, ot(Ot)),
- _e(2, SE),
- _e(3, Yx)
- ], ie);
- export {
- ie as UniverSheetsNumfmtUIPlugin
- };
- /*! Bundled license information:
- @univerjs/sheets-numfmt-ui/lib/es/index.js:
- (**
- * @license React
- * react-jsx-runtime.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *)
- */
- //# sourceMappingURL=@univerjs_sheets-numfmt-ui.js.map
|