1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388 |
- import {
- Qe as Qe2
- } from "./chunk-KVSOW4CT.js";
- import {
- C,
- Ea,
- F as F2,
- K,
- Ma,
- Me as Me2,
- Ra as Ra2,
- Sa,
- Te as Te2,
- Ve,
- Yt,
- _e,
- be as be2,
- ir,
- ne,
- or,
- pa,
- pe,
- q as q4,
- se,
- sr,
- va
- } from "./chunk-Q35HEJKG.js";
- import {
- Ei,
- fc
- } from "./chunk-U3EPM6JO.js";
- import "./chunk-ALDCSYO3.js";
- import {
- Er,
- Et,
- Hr,
- Ks,
- Sn,
- Ys,
- _s,
- bi,
- gr,
- ke as ke2,
- me as me2,
- ri,
- rt as rt2,
- sE,
- tE,
- tt,
- ue,
- vi,
- ws
- } from "./chunk-T4NNB5UY.js";
- import {
- F,
- Me,
- N,
- Nn as Nn2,
- Pe,
- Te,
- V,
- Zn,
- ar as ar2,
- ea,
- et,
- on,
- yh
- } from "./chunk-BW43Z7N3.js";
- import {
- fn,
- fr
- } from "./chunk-QRYBFJ3R.js";
- import "./chunk-MIOQ566M.js";
- import {
- $e,
- Fa,
- I1,
- Kl,
- h3,
- i3,
- l1,
- m1,
- n1,
- n3,
- rt,
- u3
- } from "./chunk-POAJ2YNP.js";
- import {
- FO,
- HO,
- Po,
- QC,
- e_,
- g_,
- n_,
- r_,
- t_,
- um
- } from "./chunk-GBYP4PB2.js";
- import {
- H,
- be,
- j,
- m,
- me,
- q
- } from "./chunk-757T4GCY.js";
- import {
- M
- } from "./chunk-PZD7N4BC.js";
- import {
- A1,
- Qe,
- S1,
- V2,
- Yx,
- Z,
- ee,
- k3,
- ke,
- p1,
- q2,
- q3,
- u6,
- vf
- } from "./chunk-2MK3Q52E.js";
- import "./chunk-BSDDCPAW.js";
- import "./chunk-QG2HZMYH.js";
- import {
- BehaviorSubject,
- Cl,
- Df,
- Fe,
- Il,
- J0,
- Mi,
- Nn,
- Op,
- Ot,
- Pt,
- Ra,
- Rl,
- S0,
- SE,
- Subject,
- Tn,
- Vn,
- Vr,
- W0,
- WC,
- Wd,
- Xt,
- Ze,
- _l,
- _n,
- ar,
- bufferTime,
- debounceTime,
- distinctUntilChanged,
- dn,
- en,
- filter,
- gt,
- hn,
- iu,
- jt,
- kt,
- ml,
- mu,
- nf,
- nt,
- nu,
- ot,
- q0,
- re,
- rn,
- st,
- tr,
- uR,
- vC,
- we,
- xn,
- z0
- } from "./chunk-23V3HWTR.js";
- import {
- require_react
- } from "./chunk-GNR2UJZM.js";
- import {
- __toESM
- } from "./chunk-2LSFTFF7.js";
- // node_modules/.pnpm/@univerjs+sheets-data-validation-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-data-validation-ui/lib/es/index.js
- var import_react = __toESM(require_react());
- var ko = Object.defineProperty;
- var Wo = (e, t, o) => t in e ? ko(e, t, { enumerable: true, configurable: true, writable: true, value: o }) : e[t] = o;
- var M2 = (e, t, o) => Wo(e, typeof t != "symbol" ? t + "" : t, o);
- var Nt = { exports: {} };
- var nt2 = {};
- var Fn;
- function Ka() {
- if (Fn)
- return nt2;
- Fn = 1;
- var e = import_react.default, t = Symbol.for("react.element"), o = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, a = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: true, ref: true, __self: true, __source: true };
- function r(l, s, c) {
- var u, p = {}, d = null, g = null;
- c !== void 0 && (d = "" + c), s.key !== void 0 && (d = "" + s.key), s.ref !== void 0 && (g = s.ref);
- for (u in s)
- n.call(s, u) && !i.hasOwnProperty(u) && (p[u] = s[u]);
- if (l && l.defaultProps)
- for (u in s = l.defaultProps, s)
- p[u] === void 0 && (p[u] = s[u]);
- return { $$typeof: t, type: l, key: d, ref: g, props: p, _owner: a.current };
- }
- return nt2.Fragment = o, nt2.jsx = r, nt2.jsxs = r, nt2;
- }
- var Nn3;
- function Ga() {
- return Nn3 || (Nn3 = 1, Nt.exports = Ka()), Nt.exports;
- }
- var h = Ga();
- var Za = Object.defineProperty;
- var qa = Object.getOwnPropertyDescriptor;
- var Ja = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? qa(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && Za(t, o, a), a;
- };
- var ot2 = (e, t) => (o, n) => t(o, n, e);
- var st2 = class extends nt {
- constructor(e, t, o, n, a) {
- super(), this._sheetInterceptorService = e, this._dataValidationModel = t, this._dataValidatorRegistryService = o, this._dialogService = n, this._localeService = a, this._initEditorBridgeInterceptor();
- }
- _initEditorBridgeInterceptor() {
- this._sheetInterceptorService.writeCellInterceptor.intercept(
- Zn,
- {
- handler: async (e, t, o) => {
- var C2;
- const n = await e, { worksheet: a, row: i, col: r, unitId: l, subUnitId: s, workbook: c } = t, u = this._dataValidationModel.getRuleIdByLocation(l, s, i, r), p = u ? this._dataValidationModel.getRuleById(l, s, u) : void 0;
- if (!p || p.errorStyle !== _l.STOP)
- return o(Promise.resolve(n));
- const d = await this._dataValidatorRegistryService.getValidatorItem(p.type);
- if (!d || await d.validator(
- {
- value: ne(n),
- interceptValue: ne((C2 = t == null ? void 0 : t.origin) != null ? C2 : n),
- row: i,
- column: r,
- unitId: l,
- subUnitId: s,
- worksheet: a,
- workbook: c,
- t: n == null ? void 0 : n.t
- },
- p
- ))
- return o(Promise.resolve(n));
- const f = a.getCellRaw(i, r);
- return this._dialogService.open({
- width: 368,
- title: {
- title: this._localeService.t("dataValidation.alert.title")
- },
- id: "reject-input-dialog",
- children: {
- title: d.getRuleFinalError(p, { row: i, col: r, unitId: l, subUnitId: s })
- },
- footer: {
- title: import_react.default.createElement(
- Po,
- {
- type: "primary",
- onClick: () => this._dialogService.close("reject-input-dialog")
- },
- this._localeService.t("dataValidation.alert.ok")
- )
- },
- onClose: () => {
- this._dialogService.close("reject-input-dialog");
- }
- }), o(Promise.resolve(f));
- }
- }
- );
- }
- showReject(e) {
- this._dialogService.open({
- width: 368,
- title: {
- title: this._localeService.t("dataValidation.alert.title")
- },
- id: "reject-input-dialog",
- children: {
- title: e
- },
- footer: {
- title: import_react.default.createElement(
- Po,
- {
- type: "primary",
- onClick: () => this._dialogService.close("reject-input-dialog")
- },
- this._localeService.t("dataValidation.alert.ok")
- )
- },
- onClose: () => {
- this._dialogService.close("reject-input-dialog");
- }
- });
- }
- };
- st2 = Ja([
- ot2(0, ot(V)),
- ot2(1, ot(F2)),
- ot2(2, ot(j)),
- ot2(3, h3),
- ot2(4, ot(Vr))
- ], st2);
- var Qa = "univer-dv-date-dropdown";
- var ei = "univer-dv-date-dropdown-btns";
- var Un = {
- dvDateDropdown: Qa,
- dvDateDropdownBtns: ei
- };
- var ti = (e) => {
- if (e == null || typeof e == "boolean")
- return;
- if (typeof e == "number" || !Number.isNaN(+e))
- return rn(Op.format("yyyy-MM-dd HH:mm:ss", Number(e)));
- const t = rn(e);
- if (t.isValid())
- return t;
- };
- function ni(e) {
- var m2;
- const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l, workbook: s } = t, c = W0(Pt), u = W0(st2), p = n.getCell(a, i), d = ne(n.getCellRaw(a, i)), g = ti(d), [f, C2] = (0, import_react.useState)(g), R = f && f.isValid() ? f : rn(), v = W0(Vr), w = W0(F2), I = w.getRuleByLocation(r, l, a, i);
- if (!I)
- return null;
- const V3 = w.getValidator(I.type);
- if (!p || !V3)
- return;
- const _ = !!((m2 = I.bizInfo) != null && m2.showTime), S = async () => {
- var x, j2, N2;
- if (!R)
- return;
- const P = R.format(_ ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00"), F3 = (x = Op.parseDate(P)) == null ? void 0 : x.v, T = s.getStyles().getStyleByCell(p), E = (N2 = (j2 = T == null ? void 0 : T.n) == null ? void 0 : j2.pattern) != null ? N2 : "", A = Qe2(E);
- I.errorStyle !== _l.STOP || await V3.validator({
- value: F3,
- unitId: r,
- subUnitId: l,
- row: a,
- column: i,
- worksheet: n,
- workbook: s,
- interceptValue: P.replace("Z", "").replace("T", " "),
- t: dn.NUMBER
- }, I) ? (o(), await c.executeCommand(Et.id, {
- visible: false,
- eventType: vf.Keyboard,
- unitId: r,
- keycode: I1.ESC
- }), await c.executeCommand(on.id, {
- unitId: r,
- subUnitId: l,
- range: {
- startColumn: i,
- endColumn: i,
- startRow: a,
- endRow: a
- },
- value: {
- v: F3,
- t: 2,
- p: null,
- f: null,
- si: null,
- s: {
- n: {
- pattern: _ ? A === "datetime" ? E : "yyyy-MM-dd hh:mm:ss" : A === "date" ? E : "yyyy-MM-dd"
- }
- }
- }
- })) : u.showReject(V3.getRuleFinalError(I, { row: a, col: i, unitId: r, subUnitId: l }));
- };
- return h.jsxs("div", { className: Un.dvDateDropdown, children: [
- h.jsx(
- FO,
- {
- defaultValue: R,
- pickerValue: R,
- showTime: _ || void 0,
- onSelect: async (y) => {
- C2(y);
- },
- onPanelChange: (y) => {
- C2(y);
- },
- disabledDate: (y) => !Op.parseDate(y.format("YYYY-MM-DD"))
- }
- ),
- h.jsx("div", { className: Un.dvDateDropdownBtns, children: h.jsx(Po, { size: "small", type: "primary", onClick: S, disabled: !R.isValid(), children: v.t("dataValidation.alert.ok") }) })
- ] });
- }
- var ce = function() {
- return ce = Object.assign || function(e) {
- for (var t, o = 1, n = arguments.length; o < n; o++) {
- t = arguments[o];
- for (var a in t)
- Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
- }
- return e;
- }, ce.apply(this, arguments);
- };
- var oi = function(e, t) {
- var o = {};
- for (var n in e)
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
- for (var a = 0, n = Object.getOwnPropertySymbols(e); a < n.length; a++)
- t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (o[n[a]] = e[n[a]]);
- return o;
- };
- var Me3 = (0, import_react.forwardRef)(function(e, t) {
- var o = e.icon, n = e.id, a = e.className, i = e.extend, r = oi(e, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(n, " ").concat(a || "").trim(), s = (0, import_react.useRef)("_".concat(ri2()));
- return Co(o, "".concat(n), { defIds: o.defIds, idSuffix: s.current }, ce({ ref: t, className: l }, r), i);
- });
- function Co(e, t, o, n, a) {
- return (0, import_react.createElement)(e.tag, ce(ce({ key: t }, ai(e, o, a)), n), (ii(e, o).children || []).map(function(i, r) {
- return Co(i, "".concat(t, "-").concat(e.tag, "-").concat(r), o, void 0, a);
- }));
- }
- function ai(e, t, o) {
- var n = ce({}, e.attrs);
- o != null && o.colorChannel1 && n.fill === "colorChannel1" && (n.fill = o.colorChannel1);
- var a = t.defIds;
- return !a || a.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(i) {
- var r = i[0], l = i[1];
- typeof l == "string" && (n[r] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
- })), n;
- }
- function ii(e, t) {
- var o, n = t.defIds;
- return !n || n.length === 0 ? e : e.tag === "defs" && (!((o = e.children) === null || o === void 0) && o.length) ? ce(ce({}, e), { children: e.children.map(function(a) {
- return typeof a.attrs.id == "string" && n && n.indexOf(a.attrs.id) > -1 ? ce(ce({}, a), { attrs: ce(ce({}, a.attrs), { id: a.attrs.id + t.idSuffix }) }) : a;
- }) }) : e;
- }
- function ri2() {
- return Math.random().toString(36).substring(2, 8);
- }
- Me3.displayName = "UniverIcon";
- var si = { 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 Io = (0, import_react.forwardRef)(function(e, t) {
- return (0, import_react.createElement)(Me3, Object.assign({}, e, {
- id: "check-mark-single",
- ref: t,
- icon: si
- }));
- });
- Io.displayName = "CheckMarkSingle";
- var li = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.4917 3.07803C1.4917 2.19437 2.20804 1.47803 3.0917 1.47803H5.6917C6.57536 1.47803 7.2917 2.19437 7.2917 3.07803V5.67803C7.2917 6.56168 6.57535 7.27803 5.6917 7.27803H3.0917C2.20804 7.27803 1.4917 6.56168 1.4917 5.67803V3.07803ZM3.0917 2.67803C2.87078 2.67803 2.6917 2.85711 2.6917 3.07803V5.67803C2.6917 5.89894 2.87079 6.07803 3.0917 6.07803H5.6917C5.91261 6.07803 6.0917 5.89894 6.0917 5.67803V3.07803C6.0917 2.85711 5.91261 2.67803 5.6917 2.67803H3.0917Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M14.6175 2.45279C14.8518 2.68711 14.8518 3.06701 14.6175 3.30132L11.6151 6.30365C11.3957 6.52307 11.0451 6.53897 10.8067 6.34031L8.80915 4.67566C8.55458 4.46352 8.52019 4.08518 8.73233 3.83062 8.94447 3.57605 9.32281 3.54166 9.57737 3.7538L11.154 5.06767 13.769 2.45278C14.0033 2.21847 14.3832 2.21848 14.6175 2.45279zM14.1175 9.19746C14.3518 9.43178 14.3518 9.81168 14.1175 10.046L12.5418 11.6217 14.1175 13.1975C14.3518 13.4318 14.3518 13.8117 14.1175 14.046 13.8832 14.2803 13.5033 14.2803 13.269 14.046L11.6933 12.4703 10.1175 14.046C9.88321 14.2803 9.50331 14.2803 9.269 14.046 9.03468 13.8117 9.03468 13.4318 9.269 13.1975L10.8447 11.6217 9.269 10.046C9.03468 9.81168 9.03468 9.43178 9.269 9.19746 9.50331 8.96315 9.88321 8.96315 10.1175 9.19746L11.6933 10.7732 13.269 9.19746C13.5033 8.96315 13.8832 8.96315 14.1175 9.19746z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.0917 8.72168C2.20804 8.72168 1.4917 9.43802 1.4917 10.3217V12.9217C1.4917 13.8053 2.20804 14.5217 3.0917 14.5217H5.6917C6.57535 14.5217 7.2917 13.8053 7.2917 12.9217V10.3217C7.2917 9.43802 6.57536 8.72168 5.6917 8.72168H3.0917ZM2.6917 10.3217C2.6917 10.1008 2.87078 9.92168 3.0917 9.92168H5.6917C5.91261 9.92168 6.0917 10.1008 6.0917 10.3217V12.9217C6.0917 13.1426 5.91261 13.3217 5.6917 13.3217H3.0917C2.87079 13.3217 2.6917 13.1426 2.6917 12.9217V10.3217Z", fillRule: "evenodd", clipRule: "evenodd" } }] };
- var wo = (0, import_react.forwardRef)(function(e, t) {
- return (0, import_react.createElement)(Me3, Object.assign({}, e, {
- id: "data-validation-single",
- ref: t,
- icon: li
- }));
- });
- wo.displayName = "DataValidationSingle";
- var di = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] };
- var Rn = (0, import_react.forwardRef)(function(e, t) {
- return (0, import_react.createElement)(Me3, Object.assign({}, e, {
- id: "delete-single",
- ref: t,
- icon: di
- }));
- });
- Rn.displayName = "DeleteSingle";
- var ci = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] };
- var Ro = (0, import_react.forwardRef)(function(e, t) {
- return (0, import_react.createElement)(Me3, Object.assign({}, e, {
- id: "increase-single",
- ref: t,
- icon: ci
- }));
- });
- Ro.displayName = "IncreaseSingle";
- var ui = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] };
- var Do = (0, import_react.forwardRef)(function(e, t) {
- return (0, import_react.createElement)(Me3, Object.assign({}, e, {
- id: "more-down-single",
- ref: t,
- icon: ui
- }));
- });
- Do.displayName = "MoreDownSingle";
- var hi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.64645 9.85355C4.45118 9.65829 4.45118 9.34171 4.64645 9.14645L7.64645 6.14645C7.84171 5.95118 8.15829 5.95118 8.35355 6.14645L11.3536 9.14645C11.5488 9.34171 11.5488 9.65829 11.3536 9.85355C11.1583 10.0488 10.8417 10.0488 10.6464 9.85355L8 7.20711L5.35355 9.85355C5.15829 10.0488 4.84171 10.0488 4.64645 9.85355Z", fillRule: "evenodd", clipRule: "evenodd" } }] };
- var Vo = (0, import_react.forwardRef)(function(e, t) {
- return (0, import_react.createElement)(Me3, Object.assign({}, e, {
- id: "more-up-single",
- ref: t,
- icon: hi
- }));
- });
- Vo.displayName = "MoreUpSingle";
- var pi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_622_8", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { fill: "currentColor", mask: "url(#mask0_622_8)" }, children: [{ tag: "path", attrs: { d: "M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z" } }] }] };
- var yo = (0, import_react.forwardRef)(function(e, t) {
- return (0, import_react.createElement)(Me3, Object.assign({}, e, {
- id: "sequence-single",
- ref: t,
- icon: pi
- }));
- });
- yo.displayName = "SequenceSingle";
- var fi = Object.defineProperty;
- var mi = Object.getOwnPropertyDescriptor;
- var gi = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? mi(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && fi(t, o, a), a;
- };
- var Bn = (e, t) => (o, n) => t(o, n, e);
- var fe = class extends nt {
- constructor(t, o) {
- super();
- M2(this, "_open$", new BehaviorSubject(false));
- M2(this, "open$", this._open$.pipe(distinctUntilChanged()));
- M2(this, "_activeRule");
- M2(this, "_activeRule$", new BehaviorSubject(void 0));
- M2(this, "activeRule$", this._activeRule$.asObservable());
- M2(this, "_closeDisposable", null);
- this._univerInstanceService = t, this._sidebarService = o, this.disposeWithMe(
- this._univerInstanceService.getCurrentTypeOfUnit$(Fe.UNIVER_SHEET).pipe(filter((n) => !n)).subscribe(() => {
- this.close();
- })
- ), this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe((n) => {
- n.id === Dt && (n.visible || setTimeout(() => {
- this._sidebarService.sidebarOptions$.next({ visible: false });
- }));
- }));
- }
- get activeRule() {
- return this._activeRule;
- }
- get isOpen() {
- return this._open$.getValue();
- }
- dispose() {
- var t;
- super.dispose(), this._open$.next(false), this._open$.complete(), this._activeRule$.complete(), (t = this._closeDisposable) == null || t.dispose();
- }
- open() {
- this._open$.next(true);
- }
- close() {
- var t;
- this._open$.next(false), (t = this._closeDisposable) == null || t.dispose();
- }
- setCloseDisposable(t) {
- this._closeDisposable = Ze(() => {
- t.dispose(), this._closeDisposable = null;
- });
- }
- setActiveRule(t) {
- this._activeRule = t, this._activeRule$.next(t);
- }
- };
- fe = gi([
- Bn(0, _n),
- Bn(1, rt)
- ], fe);
- function vi2() {
- const e = W0(Ie), t = z0(e.activeDropdown$, e.activeDropdown), o = W0(n1);
- if (!t)
- return null;
- const { location: n, componentKey: a } = t, i = o.get(a), r = `${n.unitId}-${n.subUnitId}-${n.row}-${n.col}`;
- if (!i)
- return null;
- const l = () => {
- e.hideDropdown();
- };
- return h.jsx(
- i,
- {
- location: n,
- hideFn: l
- },
- r
- );
- }
- var Mo = "sheet.ui.dropdown";
- var _i = Object.defineProperty;
- var Si = Object.getOwnPropertyDescriptor;
- var Ci = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? Si(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && _i(t, o, a), a;
- };
- var be3 = (e, t) => (o, n) => t(o, n, e);
- var Ie = class extends nt {
- constructor(t, o, n, a, i, r, l) {
- super();
- M2(this, "_activeDropdown");
- M2(this, "_activeDropdown$", new Subject());
- M2(this, "_currentPopup", null);
- M2(this, "activeDropdown$", this._activeDropdown$.asObservable());
- M2(this, "_zenVisible", false);
- this._canvasPopupManagerService = t, this._univerInstanceService = o, this._dataValidatorRegistryService = n, this._zenZoneService = a, this._renderManagerService = i, this._dataValidationModel = r, this._sheetsSelectionsService = l, this._init(), this._initSelectionChange(), this.disposeWithMe(() => {
- this._activeDropdown$.complete();
- });
- }
- get activeDropdown() {
- return this._activeDropdown;
- }
- _init() {
- this.disposeWithMe(this._zenZoneService.visible$.subscribe((t) => {
- this._zenVisible = t, t && this.hideDropdown();
- }));
- }
- _getDropdownByCell(t, o, n, a) {
- const i = t ? this._univerInstanceService.getUnit(t, Fe.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitForType(Fe.UNIVER_SHEET);
- if (!i)
- return;
- const r = o ? i.getSheetBySheetId(o) : i.getActiveSheet();
- if (!r)
- return;
- const l = this._dataValidationModel.getRuleByLocation(i.getUnitId(), r.getSheetId(), n, a);
- if (!l)
- return;
- const s = this._dataValidatorRegistryService.getValidatorItem(l.type);
- return s == null ? void 0 : s.dropdown;
- }
- _initSelectionChange() {
- this.disposeWithMe(this._sheetsSelectionsService.selectionMoveEnd$.subscribe((t) => {
- t && t.every((o) => !(o.primary && this._getDropdownByCell(o.primary.unitId, o.primary.sheetId, o.primary.actualRow, o.primary.actualColumn))) && this.hideDropdown();
- }));
- }
- showDropdown(t, o = true) {
- const { location: n } = t, { row: a, col: i, unitId: r, subUnitId: l } = n;
- if (this._currentPopup && this._currentPopup.dispose(), this._zenVisible)
- return;
- this._activeDropdown = t, this._activeDropdown$.next(this._activeDropdown);
- const s = this._renderManagerService.getRenderById(iu), c = this._canvasPopupManagerService.attachPopupToCell(
- a,
- i,
- {
- componentKey: Mo,
- onClickOutside: () => {
- o && this.hideDropdown();
- },
- offset: [0, 3],
- excludeOutside: [s == null ? void 0 : s.engine.getCanvasElement()].filter(Boolean)
- },
- r,
- l
- );
- if (!c)
- throw new Error("[DataValidationDropdownManagerService]: cannot show dropdown!");
- const u = new Mi();
- u.add(c), u.add({
- dispose: () => {
- var p, d;
- (d = (p = this._activeDropdown) == null ? void 0 : p.onHide) == null || d.call(p);
- }
- }), this._currentPopup = u;
- }
- hideDropdown() {
- this._activeDropdown && (this._currentPopup && this._currentPopup.dispose(), this._currentPopup = null, this._activeDropdown = null, this._activeDropdown$.next(null));
- }
- showDataValidationDropdown(t, o, n, a, i) {
- const r = this._univerInstanceService.getUnit(t, Fe.UNIVER_SHEET);
- if (!r)
- return;
- const l = r.getSheetBySheetId(o);
- if (!l)
- return;
- const s = this._dataValidationModel.getRuleByLocation(r.getUnitId(), l.getSheetId(), n, a);
- if (!s)
- return;
- const c = this._dataValidatorRegistryService.getValidatorItem(s.type);
- if (!c || !c.dropdown) {
- this.hideDropdown();
- return;
- }
- this.showDropdown({
- location: {
- workbook: r,
- worksheet: l,
- row: n,
- col: a,
- unitId: t,
- subUnitId: o
- },
- componentKey: c.dropdown,
- onHide: i
- });
- }
- };
- Ie = Ci([
- be3(0, ot(vi)),
- be3(1, _n),
- be3(2, ot(j)),
- be3(3, u3),
- be3(4, Yx),
- be3(5, ot(F2)),
- be3(6, ot(F))
- ], Ie);
- var Dt = "DataValidationPanel";
- var Ue = {
- id: "data-validation.operation.open-validation-panel",
- type: ar.OPERATION,
- handler(e, t) {
- if (!t)
- return false;
- const { ruleId: o, isAdd: n } = t, a = e.get(fe), i = e.get(m), r = e.get(_n), l = e.get(rt), s = N(r);
- if (!s)
- return false;
- const { unitId: c, subUnitId: u } = s, p = o ? i.getRuleById(c, u, o) : void 0;
- a.open(), a.setActiveRule(p && {
- unitId: c,
- subUnitId: u,
- rule: p
- });
- const d = l.open({
- id: Dt,
- header: { title: n ? "dataValidation.panel.addTitle" : "dataValidation.panel.title" },
- children: { label: Dt },
- width: 312,
- onClose: () => a.close()
- });
- return a.setCloseDisposable(d), true;
- }
- };
- var Dn = {
- id: "data-validation.operation.close-validation-panel",
- type: ar.OPERATION,
- handler(e) {
- return e.get(fe).close(), true;
- }
- };
- var bo = {
- id: "data-validation.operation.toggle-validation-panel",
- type: ar.OPERATION,
- handler(e) {
- const t = e.get(Pt), o = e.get(fe);
- return o.open(), o.isOpen ? t.executeCommand(Dn.id) : t.executeCommand(Ue.id), true;
- }
- };
- var Tt = {
- type: ar.OPERATION,
- id: "sheet.operation.show-data-validation-dropdown",
- handler(e, t) {
- if (!t)
- return false;
- const o = e.get(Ie), { unitId: n, subUnitId: a, row: i, column: r } = t, l = o.activeDropdown, s = l == null ? void 0 : l.location;
- return s && s.unitId === n && s.subUnitId === a && s.row === i && s.col === r || o.showDataValidationDropdown(
- n,
- a,
- i,
- r
- ), true;
- }
- };
- var Eo = {
- type: ar.OPERATION,
- id: "sheet.operation.hide-data-validation-dropdown",
- handler(e, t) {
- return t ? (e.get(Ie).hideDropdown(), true) : false;
- }
- };
- var Te3 = "#ECECEC";
- var Vn2 = "sheets-data-validation-ui.config";
- var Vt = {};
- var Ii = "univer-dv-list-dropdown";
- var wi = "univer-dv-list-dropdown-title";
- var Ri = "univer-dv-list-dropdown-list";
- var Di = "univer-dv-list-dropdown-list-container";
- var Vi = "univer-dv-list-dropdown-selected-icon";
- var yi = "univer-dv-list-dropdown-item-container";
- var Mi2 = "univer-dv-list-dropdown-item";
- var bi2 = "univer-dv-list-dropdown-split";
- var Ei2 = "univer-dv-list-dropdown-edit";
- var ve = {
- dvListDropdown: Ii,
- dvListDropdownTitle: wi,
- dvListDropdownList: Ri,
- dvListDropdownListContainer: Di,
- dvListDropdownSelectedIcon: Vi,
- dvListDropdownItemContainer: yi,
- dvListDropdownItem: Mi2,
- dvListDropdownSplit: bi2,
- dvListDropdownEdit: Ei2
- };
- var Oi = (e) => {
- var _, S;
- const { value: t, onChange: o, multiple: n, options: a, title: i, onEdit: r, style: l, filter: s, location: c } = e, u = W0(Vr), p = W0(SE), d = s == null ? void 0 : s.toLowerCase(), { row: g, col: f, unitId: C2, subUnitId: R } = c, v = a.filter((m2) => d ? m2.label.toLowerCase().includes(d) : true), w = (S = (_ = p.getConfig(Vn2)) == null ? void 0 : _.showEditOnDropdown) != null ? S : true, I = W0(Nn2), V3 = (0, import_react.useMemo)(() => I.permissionCheckWithRanges(
- {
- workbookTypes: [Me],
- rangeTypes: [Pe],
- worksheetTypes: [Te]
- },
- [{ startColumn: f, startRow: g, endColumn: f, endRow: g }],
- C2,
- R
- ), [I, f, g, C2, R]);
- return h.jsxs("div", { className: ve.dvListDropdown, style: l, children: [
- h.jsx("div", { className: ve.dvListDropdownTitle, children: i }),
- h.jsx("div", { className: ve.dvListDropdownList, children: h.jsx(n_, { children: h.jsx("div", { className: ve.dvListDropdownListContainer, children: v.map((m2, y) => {
- const P = t.indexOf(m2.value) > -1, F3 = () => {
- let E;
- P ? E = new Set(t.filter((x) => x !== m2.value)) : E = new Set(n ? [...t, m2.value] : [m2.value]);
- const A = [];
- a.forEach((x) => {
- E.has(x.value) && A.push(x.value);
- }), o(A);
- }, T = m2.label.toLocaleLowerCase().indexOf(d);
- return h.jsxs("div", { className: ve.dvListDropdownItemContainer, onClick: F3, children: [
- h.jsx("div", { className: ve.dvListDropdownItem, style: { background: m2.color || Te3 }, children: d && m2.label.toLowerCase().includes(d) ? h.jsxs(h.Fragment, { children: [
- h.jsx("span", { children: m2.label.substring(0, T) }),
- h.jsx("span", { style: { fontWeight: "bold" }, children: m2.label.substring(T, T + d.length) }),
- h.jsx("span", { children: m2.label.substring(T + d.length) })
- ] }) : m2.label }),
- h.jsx("div", { className: ve.dvListDropdownSelectedIcon, children: P ? h.jsx(Io, {}) : null })
- ] }, y);
- }) }) }, s) }),
- w && V3 ? h.jsxs(h.Fragment, { children: [
- h.jsx("div", { className: ve.dvListDropdownSplit }),
- h.jsx("div", { className: ve.dvListDropdownEdit, children: h.jsx("a", { onClick: r, children: u.t("dataValidation.list.edit") }) })
- ] }) : null
- ] });
- };
- function Li(e) {
- var j2, N2, H2, X;
- const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l } = t, s = W0(m), [c, u] = (0, import_react.useState)(""), p = W0(Pt), d = W0(Vr), [g, f] = (0, import_react.useState)(""), C2 = W0(tt), R = W0(_n), v = (0, import_react.useMemo)(() => s.ruleChange$.pipe(debounceTime(16)), []), w = W0(F2);
- z0(v);
- const I = i3.useContext(), V3 = ((N2 = (j2 = I.current) == null ? void 0 : j2.right) != null ? N2 : 0) - ((X = (H2 = I.current) == null ? void 0 : H2.left) != null ? X : 0);
- if ((0, import_react.useEffect)(() => {
- const k = p.onCommandExecuted((K2) => {
- var q5, ee2;
- if (K2.id === M.id) {
- const te = K2.params, { unitId: re2 } = te, ae = R.getUnit(re2, Fe.UNIVER_DOC);
- if (!ae || !C2.isVisible().visible)
- return;
- const se2 = st.transform.getPlainText((ee2 = (q5 = ae.getSnapshot().body) == null ? void 0 : q5.dataStream) != null ? ee2 : "");
- u(se2);
- }
- });
- return () => {
- k.dispose();
- };
- }, [p, C2, R]), !n)
- return null;
- const _ = w.getRuleByLocation(r, l, a, i);
- if (!_)
- return null;
- const S = w.getValidator(_.type);
- if (!S)
- return null;
- const m2 = n.getCell(a, i), y = (_ == null ? void 0 : _.renderMode) === Cl.CUSTOM || (_ == null ? void 0 : _.renderMode) === void 0;
- if (!m2 || !_ || !S || S.id.indexOf(Il.LIST) !== 0)
- return;
- const P = _.type === Il.LIST_MULTIPLE, F3 = S.getListWithColor(_, r, l), T = g || sr(n.getCellRaw(a, i)), E = pe(T), A = () => {
- p.executeCommand(Ue.id, {
- ruleId: _.uid
- }), o();
- }, x = F3.map((k) => ({
- label: k.label,
- value: k.label,
- color: y || k.color ? k.color : "transparent"
- }));
- return h.jsx(
- Oi,
- {
- style: { minWidth: V3, maxWidth: Math.max(V3, 200) },
- title: P ? d.t("dataValidation.listMultiple.dropdown") : d.t("dataValidation.list.dropdown"),
- value: E,
- multiple: P,
- onChange: async (k) => {
- const K2 = ir(k), q5 = {
- unitId: r,
- subUnitId: l,
- range: {
- startColumn: i,
- endColumn: i,
- startRow: a,
- endRow: a
- },
- value: {
- v: K2,
- p: null,
- f: null,
- si: null
- }
- };
- C2.isVisible() && C2.changeVisible({
- visible: false,
- keycode: I1.ESC,
- eventType: vf.Keyboard,
- unitId: r
- }), f(K2), P || o(), C2.isVisible().visible && await p.executeCommand(Et.id, {
- visible: false,
- eventType: vf.Keyboard,
- unitId: r,
- keycode: I1.ESC
- }), p.executeCommand(on.id, q5);
- },
- options: x,
- onEdit: A,
- filter: c,
- location: t
- }
- );
- }
- var Pi = "univer-data-validation-options-button";
- var Ti = "univer-data-validation-options-button-icon";
- var Ut = {
- dataValidationOptionsButton: Pi,
- dataValidationOptionsButtonIcon: Ti
- };
- function Ai(e) {
- var c;
- const t = W0(Vr), o = W0(n1), { value: n, onChange: a, extraComponent: i } = e, [r, l] = (0, import_react.useState)(false), s = i ? o.get(i) : null;
- return h.jsxs(h.Fragment, { children: [
- h.jsxs("div", { className: Ut.dataValidationOptionsButton, onClick: () => l(!r), children: [
- t.t("dataValidation.panel.options"),
- r ? h.jsx(Vo, { className: Ut.dataValidationOptionsButtonIcon }) : h.jsx(Do, { className: Ut.dataValidationOptionsButtonIcon })
- ] }),
- r && h.jsxs(h.Fragment, { children: [
- s ? h.jsx(s, { value: n, onChange: a }) : null,
- h.jsx(
- HO,
- {
- label: t.t("dataValidation.panel.invalid"),
- children: h.jsxs(
- t_,
- {
- value: `${(c = n.errorStyle) != null ? c : _l.WARNING}`,
- onChange: (u) => a({ ...n, errorStyle: +u }),
- children: [
- h.jsx(e_, { value: `${_l.WARNING}`, children: t.t("dataValidation.panel.showWarning") }),
- h.jsx(e_, { value: `${_l.STOP}`, children: t.t("dataValidation.panel.rejectInput") })
- ]
- }
- )
- }
- ),
- h.jsx(
- HO,
- {
- label: t.t("dataValidation.panel.messageInfo"),
- children: h.jsx(
- um,
- {
- checked: n.showErrorMessage,
- onChange: () => a({
- ...n,
- showErrorMessage: !n.showErrorMessage
- }),
- children: t.t("dataValidation.panel.showInfo")
- }
- )
- }
- ),
- n.showErrorMessage ? h.jsx(HO, { children: h.jsx(QC, { value: n.error, onChange: (u) => a({ ...n, error: u }) }) }) : null
- ] })
- ] });
- }
- var xi = "univer-data-validation-detail";
- var ji = "univer-data-validation-detail-form-item";
- var Fi = "univer-data-validation-detail-buttons";
- var Ni = "univer-data-validation-detail-button";
- var Be = {
- dataValidationDetail: xi,
- dataValidationDetailFormItem: ji,
- dataValidationDetailButtons: Fi,
- dataValidationDetailButton: Ni
- };
- var Ui = (e) => S0(
- async (t, o, n, a) => {
- const i = await e.executeCommand(t, o, n);
- a == null || a(i);
- },
- 1e3
- );
- function Bi(e, t, o) {
- var n, a, i, r;
- return t ? ((a = (n = e.getUnit(t)) == null ? void 0 : n.getSheetBySheetName(o)) == null ? void 0 : a.getSheetId()) || "" : ((r = (i = e.getCurrentUnitForType(Fe.UNIVER_SHEET)) == null ? void 0 : i.getSheetBySheetName(o)) == null ? void 0 : r.getSheetId()) || "";
- }
- function $i() {
- var se2;
- const [e, t] = (0, import_react.useState)(0), o = W0(fe), n = z0(o.activeRule$, o.activeRule), { unitId: a, subUnitId: i, rule: r } = n || {}, l = r.uid, s = W0(j), c = W0(_n), u = W0(n1), p = W0(Pt), d = W0(m), g = W0(Vr), [f, C2] = (0, import_react.useState)(r), R = s.getValidatorItem(f.type), [v, w] = (0, import_react.useState)(false), I = s.getValidatorsByScope(me.SHEET), [V3, _] = (0, import_react.useState)(() => f.ranges.map((O) => ({ unitId: "", sheetId: "", range: O }))), S = (0, import_react.useMemo)(() => Ui(p), [p]), [m2, y] = (0, import_react.useState)(false), P = (0, import_react.useRef)({}), [F3, T] = (0, import_react.useState)(false), E = W0(F);
- if ((0, import_react.useEffect)(() => () => {
- const O = E.getCurrentLastSelection();
- O && E.setSelections([O]);
- }, [E]), (0, import_react.useEffect)(() => {
- p.onCommandExecuted((O) => {
- (O.id === Nn.id || O.id === Tn.id) && setTimeout(() => {
- const D = d.getRuleById(a, i, l);
- t((U) => U + 1), D && (C2(D), _(D.ranges.map((U) => ({ unitId: "", sheetId: "", range: U }))));
- }, 20);
- });
- }, [p, d, l, i, a]), !R)
- return null;
- const A = R.operators, x = R.operatorNames, j2 = f.operator ? be.includes(f.operator) : false, N2 = () => {
- !f.ranges.length || m2 || (R.validatorFormula(f, a, i).success ? o.setActiveRule(null) : w(true));
- }, H2 = n3((O) => {
- const D = O.split(",").filter(Boolean).map(fn).map(($) => {
- const _e2 = $.sheetName;
- if (_e2) {
- const $o = Bi(c, $.unitId, _e2);
- return { ...$, sheetId: $o };
- }
- return {
- ...$,
- sheetId: ""
- };
- });
- if (uR(D, V3))
- return;
- _(D);
- const U = D.filter(($) => (!$.unitId || $.unitId === a) && (!$.sheetId || $.sheetId === i)).map(($) => $.range);
- if (C2({
- ...f,
- ranges: U
- }), U.length === 0)
- return;
- const B = {
- unitId: a,
- subUnitId: i,
- ruleId: l,
- ranges: U
- };
- S(pa.id, B);
- }), X = (O) => {
- if (Df(O, q(f)))
- return;
- C2({
- ...f,
- ...O
- });
- const D = {
- unitId: a,
- subUnitId: i,
- ruleId: l,
- setting: O
- };
- S(
- Sa.id,
- D,
- void 0
- );
- }, k = async () => {
- await p.executeCommand(Ea.id, {
- ruleId: l,
- unitId: a,
- subUnitId: i
- }), o.setActiveRule(null);
- }, K2 = {
- type: f.type,
- operator: f.operator,
- formula1: f.formula1,
- formula2: f.formula2,
- allowBlank: f.allowBlank
- }, q5 = (O) => {
- const D = s.getValidatorItem(O);
- if (!D)
- return;
- const U = D.operators, B = d.getRuleById(a, i, l), $ = O === (B == null ? void 0 : B.type) || O.includes("list") && (B != null && B.type.includes("list")) ? {
- ...B,
- type: O
- } : {
- ...f,
- type: O,
- operator: U[0],
- formula1: void 0,
- formula2: void 0
- };
- C2($), p.executeCommand(Sa.id, {
- unitId: a,
- subUnitId: i,
- ruleId: f.uid,
- setting: q($)
- });
- }, ee2 = u.get(R.formulaInput), te = (0, import_react.useMemo)(() => V3.map((O) => fr(O.range)).join(","), []), re2 = H(f), ae = (O) => {
- Df(O, H(f)) || (C2({
- ...f,
- ...O
- }), S(
- va.id,
- {
- unitId: a,
- subUnitId: i,
- ruleId: l,
- options: O
- }
- ));
- };
- return Kl((O) => {
- var U;
- const D = (U = P.current) == null ? void 0 : U.handleOutClick;
- D && D(O, () => T(false));
- }), h.jsxs("div", { className: Be.dataValidationDetail, children: [
- h.jsx(
- HO,
- {
- label: g.t("dataValidation.panel.range"),
- error: !f.ranges.length || m2 ? g.t("dataValidation.panel.rangeError") : "",
- children: h.jsx(
- Ei,
- {
- unitId: a,
- subUnitId: i,
- initValue: te,
- onChange: H2,
- onFocus: () => T(true),
- isFocus: F3,
- actions: P.current,
- onVerify: (O) => y(!O)
- }
- )
- }
- ),
- h.jsx(HO, { label: g.t("dataValidation.panel.type"), children: h.jsx(
- r_,
- {
- options: I == null ? void 0 : I.map((O) => ({
- label: g.t(O.title),
- value: O.id
- })),
- value: f.type,
- onChange: q5,
- className: Be.dataValidationDetailFormItem
- }
- ) }),
- A != null && A.length ? h.jsx(HO, { label: g.t("dataValidation.panel.operator"), children: h.jsx(
- r_,
- {
- options: A.map((O, D) => ({
- value: `${O}`,
- label: x[D]
- })),
- value: `${f.operator}`,
- onChange: (O) => {
- X({
- ...K2,
- operator: O
- });
- },
- className: Be.dataValidationDetailFormItem
- }
- ) }) : null,
- ee2 ? h.jsx(
- ee2,
- {
- isTwoFormula: j2,
- value: {
- formula1: f.formula1,
- formula2: f.formula2
- },
- onChange: (O) => {
- X({
- ...K2,
- ...O
- });
- },
- showError: v,
- validResult: R.validatorFormula(f, a, i),
- unitId: a,
- subUnitId: i,
- ruleId: l
- },
- e + f.type
- ) : null,
- h.jsx(HO, { children: h.jsx(
- um,
- {
- checked: (se2 = f.allowBlank) != null ? se2 : true,
- onChange: () => {
- var O;
- return X({
- ...K2,
- allowBlank: !((O = f.allowBlank) == null || O)
- });
- },
- children: g.t("dataValidation.panel.allowBlank")
- }
- ) }),
- h.jsx(Ai, { value: re2, onChange: ae, extraComponent: R.optionsInput }),
- h.jsxs("div", { className: Be.dataValidationDetailButtons, children: [
- h.jsx(Po, { className: Be.dataValidationDetailButton, onClick: k, children: g.t("dataValidation.panel.removeRule") }),
- h.jsx(Po, { className: Be.dataValidationDetailButton, type: "primary", onClick: N2, children: g.t("dataValidation.panel.done") })
- ] })
- ] });
- }
- var ki = "univer-data-validation-item-container";
- var Wi = "univer-data-validation-item-title";
- var Hi = "univer-data-validation-item-content";
- var Yi = "univer-data-validation-item-icon";
- var ct = {
- dataValidationItemContainer: ki,
- dataValidationItemTitle: Wi,
- dataValidationItemContent: Hi,
- dataValidationItemIcon: Yi
- };
- var Xi = (e) => {
- const { rule: t, onClick: o, unitId: n, subUnitId: a, disable: i } = e, r = W0(j), l = W0(Pt), s = W0(ws), c = r.getValidatorItem(t.type), u = (0, import_react.useRef)(), [p, d] = (0, import_react.useState)(false), g = (f) => {
- l.executeCommand(Ea.id, {
- ruleId: t.uid,
- unitId: n,
- subUnitId: a
- }), f.stopPropagation();
- };
- return (0, import_react.useEffect)(() => () => {
- var f;
- u.current && ((f = u.current) == null || f.forEach((C2) => {
- C2 && s.removeShape(C2);
- }));
- }, [s]), h.jsxs(
- "div",
- {
- className: ct.dataValidationItemContainer,
- onClick: o,
- onMouseEnter: () => {
- i || (d(true), u.current = t.ranges.map((f) => s.addShape({
- range: f,
- style: {
- // hasAutoFill: false,
- fill: "rgba(73, 184, 17, 0.05)",
- strokeWidth: 1,
- stroke: "#49B811",
- widgets: {}
- },
- primary: null
- })));
- },
- onMouseLeave: () => {
- var f;
- d(false), (f = u.current) == null || f.forEach((C2) => {
- C2 && s.removeShape(C2);
- }), u.current = void 0;
- },
- children: [
- h.jsx("div", { className: ct.dataValidationItemTitle, children: c == null ? void 0 : c.generateRuleName(t) }),
- h.jsx("div", { className: ct.dataValidationItemContent, children: t.ranges.map((f) => fr(f)).join(",") }),
- p ? h.jsx("div", { className: ct.dataValidationItemIcon, onClick: g, children: h.jsx(Rn, {}) }) : null
- ]
- }
- );
- };
- var zi = "univer-data-validation-list";
- var Ki = "univer-data-validation-list-buttons";
- var Gi = "univer-data-validation-list-button";
- var ut = {
- dataValidationList: zi,
- dataValidationListButtons: Ki,
- dataValidationListButton: Gi
- };
- function Zi() {
- const e = W0(_n), t = z0(
- () => e.getCurrentTypeOfUnit$(Fe.UNIVER_SHEET),
- void 0,
- void 0,
- []
- );
- return t ? h.jsx(qi, { workbook: t }) : null;
- }
- function qi(e) {
- const t = W0(F2), o = W0(_n), n = W0(Pt), a = W0(Ot), i = W0(fe), r = W0(Vr), [l, s] = (0, import_react.useState)([]), { workbook: c } = e, u = z0(c.activeSheet$, void 0, true), p = c.getUnitId(), d = u == null ? void 0 : u.getSheetId();
- (0, import_react.useEffect)(() => {
- s(t.getRules(p, d));
- const w = t.ruleChange$.subscribe((I) => {
- I.unitId === p && I.subUnitId === d && s(t.getRules(p, d));
- });
- return () => {
- w.unsubscribe();
- };
- }, [p, d, t]);
- const g = async () => {
- const w = or(a), I = {
- unitId: p,
- subUnitId: d,
- rule: w
- };
- await n.executeCommand(Ra2.id, I), i.setActiveRule({
- unitId: p,
- subUnitId: d,
- rule: w
- });
- }, f = () => {
- n.executeCommand(Ma.id, {
- unitId: p,
- subUnitId: d
- });
- }, R = ((w) => {
- const I = o.getCurrentUnitForType(Fe.UNIVER_SHEET), V3 = I.getActiveSheet(), _ = I.getUnitId(), S = V3.getSheetId();
- return w.map((y) => yh(a, _, S, y.ranges) ? { ...y } : { ...y, disable: true });
- })(l), v = R == null ? void 0 : R.some((w) => w.disable);
- return h.jsxs("div", { className: ut.dataValidationList, children: [
- R == null ? void 0 : R.map((w) => {
- var I;
- return h.jsx(
- Xi,
- {
- unitId: p,
- subUnitId: d,
- onClick: () => {
- w.disable || i.setActiveRule({
- unitId: p,
- subUnitId: d,
- rule: w
- });
- },
- rule: w,
- disable: (I = w.disable) != null ? I : false
- },
- w.uid
- );
- }),
- h.jsxs("div", { className: ut.dataValidationListButtons, children: [
- l.length && !v ? h.jsx(Po, { className: ut.dataValidationListButton, onClick: f, children: r.t("dataValidation.panel.removeAll") }) : null,
- h.jsx(Po, { className: ut.dataValidationListButton, type: "primary", onClick: g, children: r.t("dataValidation.panel.add") })
- ] })
- ] });
- }
- var Ji = () => {
- const e = W0(fe), t = z0(e.activeRule$, e.activeRule);
- return t ? h.jsx($i, {}, t.rule.uid) : h.jsx(Zi, {});
- };
- var yn = "data-validation.list.dropdown";
- var Oo = "data-validation.date.dropdown";
- var At = {
- type: ar.COMMAND,
- id: "data-validation.command.addRuleAndOpen",
- handler(e) {
- const t = e.get(_n), o = N(t);
- if (!o)
- return false;
- const { workbook: n, worksheet: a } = o, i = or(e), r = e.get(Pt), l = n.getUnitId(), s = a.getSheetId(), c = {
- rule: i,
- unitId: l,
- subUnitId: s
- };
- return r.syncExecuteCommand(Ra2.id, c) ? (r.syncExecuteCommand(Ue.id, {
- ruleId: i.uid,
- isAdd: true
- }), true) : false;
- }
- };
- var Qi = Object.defineProperty;
- var er = Object.getOwnPropertyDescriptor;
- var tr2 = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? er(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && Qi(t, o, a), a;
- };
- var $e2 = (e, t) => (o, n) => t(o, n, e);
- var Ee = "SHEET_DATA_VALIDATION_ALERT";
- var lt = class extends nt {
- constructor(e, t, o, n, a, i) {
- super(), this._hoverManagerService = e, this._cellAlertManagerService = t, this._univerInstanceService = o, this._localeService = n, this._zenZoneService = a, this._dataValidationModel = i, this._init();
- }
- _init() {
- this._initCellAlertPopup(), this._initZenService();
- }
- _initCellAlertPopup() {
- this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(debounceTime(100)).subscribe((e) => {
- var t;
- if (e) {
- const o = this._univerInstanceService.getUnit(e.location.unitId, Fe.UNIVER_SHEET), n = o.getSheetBySheetId(e.location.subUnitId);
- if (!n)
- return;
- const a = this._dataValidationModel.getRuleByLocation(e.location.unitId, e.location.subUnitId, e.location.row, e.location.col);
- if (!a) {
- this._cellAlertManagerService.removeAlert(Ee);
- return;
- }
- if (this._dataValidationModel.validator(a, { ...e.location, workbook: o, worksheet: n }) === Rl.INVALID) {
- const r = this._cellAlertManagerService.currentAlert.get(Ee), l = (t = r == null ? void 0 : r.alert) == null ? void 0 : t.location;
- if (l && l.row === e.location.row && l.col === e.location.col && l.subUnitId === e.location.subUnitId && l.unitId === e.location.unitId) {
- this._cellAlertManagerService.removeAlert(Ee);
- return;
- }
- const s = this._dataValidationModel.getValidator(a.type);
- if (!s) {
- this._cellAlertManagerService.removeAlert(Ee);
- return;
- }
- this._cellAlertManagerService.showAlert({
- type: Ks.ERROR,
- title: this._localeService.t("dataValidation.error.title"),
- message: s == null ? void 0 : s.getRuleFinalError(a, e.location),
- location: e.location,
- width: 200,
- height: 74,
- key: Ee
- });
- return;
- }
- }
- this._cellAlertManagerService.removeAlert(Ee);
- }));
- }
- _initZenService() {
- this.disposeWithMe(this._zenZoneService.visible$.subscribe((e) => {
- e && this._cellAlertManagerService.removeAlert(Ee);
- }));
- }
- };
- lt = tr2([
- $e2(0, ot(Er)),
- $e2(1, ot(bi)),
- $e2(2, _n),
- $e2(3, ot(Vr)),
- $e2(4, u3),
- $e2(5, ot(F2))
- ], lt);
- var nr = Object.defineProperty;
- var or2 = Object.getOwnPropertyDescriptor;
- var ar3 = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? or2(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && nr(t, o, a), a;
- };
- var Bt = (e, t) => (o, n) => t(o, n, e);
- var ze = class extends nt {
- constructor(e, t, o) {
- super(), this._autoFillService = e, this._sheetDataValidationModel = t, this._injector = o, this._initAutoFill();
- }
- // eslint-disable-next-line max-lines-per-function
- _initAutoFill() {
- const e = () => ({ redos: [], undos: [] }), t = (n, a) => {
- const { source: i, target: r, unitId: l, subUnitId: s } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u = _s([i, r]), [p, d] = u.ranges, { mapFunc: g } = u, f = {
- row: p.startRow,
- col: p.startColumn
- }, C2 = tE(p, d), R = new kt(), v = /* @__PURE__ */ new Set();
- C2.forEach((S) => {
- const m2 = S.repeatStartCell, y = S.relativeRange, P = {
- startRow: f.row,
- startColumn: f.col,
- endColumn: f.col,
- endRow: f.row
- }, F3 = {
- startRow: m2.row,
- startColumn: m2.col,
- endColumn: m2.col,
- endRow: m2.row
- };
- tr.foreach(y, (T, E) => {
- const A = en.getPositionRange(
- {
- startRow: T,
- startColumn: E,
- endColumn: E,
- endRow: T
- },
- P
- ), { row: x, col: j2 } = g(A.startRow, A.startColumn), N2 = this._sheetDataValidationModel.getRuleIdByLocation(l, s, x, j2) || "", H2 = en.getPositionRange(
- {
- startRow: T,
- startColumn: E,
- endColumn: E,
- endRow: T
- },
- F3
- ), { row: X, col: k } = g(H2.startRow, H2.startColumn);
- R.setValue(X, k, N2), v.add(N2);
- });
- });
- const w = Array.from(v).map((S) => ({ id: S, ranges: WC(R, (m2) => m2 === S) }));
- c.addRangeRules(w);
- const I = c.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: V3, undoMutations: _ } = be2(l, s, I, this._injector, "patched", a === ke2.ONLY_FORMAT);
- return {
- undos: _,
- redos: V3
- };
- }, o = {
- id: Yt,
- onBeforeFillData: (n) => {
- const { source: a, unitId: i, subUnitId: r } = n;
- for (const l of a.rows)
- for (const s of a.cols) {
- const c = this._sheetDataValidationModel.getRuleByLocation(i, r, l, s);
- if (c && c.type === Il.CHECKBOX) {
- this._autoFillService.setDisableApplyType(ke2.SERIES, true);
- return;
- }
- }
- },
- onFillData: (n, a, i) => i === ke2.COPY || i === ke2.ONLY_FORMAT || i === ke2.SERIES ? t(n, i) : e(),
- onAfterFillData: () => {
- }
- };
- this.disposeWithMe(this._autoFillService.addHook(o));
- }
- };
- ze = ar3([
- Bt(0, Hr),
- Bt(1, ot(F2)),
- Bt(2, ot(Ot))
- ], ze);
- var ir2 = Object.defineProperty;
- var rr = Object.getOwnPropertyDescriptor;
- var sr2 = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? rr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && ir2(t, o, a), a;
- };
- var $t = (e, t) => (o, n) => t(o, n, e);
- var Ke = class extends nt {
- constructor(t, o, n) {
- super();
- M2(this, "_copyInfo");
- this._sheetClipboardService = t, this._sheetDataValidationModel = o, this._injector = n, this._initCopyPaste();
- }
- _initCopyPaste() {
- this._sheetClipboardService.addClipboardHook({
- id: Yt,
- onBeforeCopy: (t, o, n) => this._collect(t, o, n),
- onPasteCells: (t, o, n, a) => {
- const { copyType: i = gr.COPY, pasteType: r } = a, { range: l } = t || {}, { range: s, unitId: c, subUnitId: u } = o;
- return this._generateMutations(s, { copyType: i, pasteType: r, copyRange: l, unitId: c, subUnitId: u });
- }
- });
- }
- _collect(t, o, n) {
- const a = new kt();
- this._copyInfo = {
- unitId: t,
- subUnitId: o,
- matrix: a
- };
- const i = this._injector.invoke((s) => Ys(n, s, t, o));
- if (!i)
- return;
- const { rows: r, cols: l } = i;
- r.forEach((s, c) => {
- l.forEach((u, p) => {
- const d = this._sheetDataValidationModel.getRuleIdByLocation(t, o, s, u);
- a.setValue(c, p, d != null ? d : "");
- });
- });
- }
- // eslint-disable-next-line max-lines-per-function
- _generateMutations(t, o) {
- if (!this._copyInfo)
- return { redos: [], undos: [] };
- if (o.copyType === gr.CUT)
- return this._copyInfo = null, { redos: [], undos: [] };
- if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !o.copyRange)
- return { redos: [], undos: [] };
- if ([
- rt2.SPECIAL_PASTE_COL_WIDTH,
- rt2.SPECIAL_PASTE_VALUE,
- rt2.SPECIAL_PASTE_FORMAT,
- rt2.SPECIAL_PASTE_FORMULA
- ].includes(o.pasteType))
- return { redos: [], undos: [] };
- const { unitId: a, subUnitId: i } = this._copyInfo;
- if (o.unitId !== a || i !== o.subUnitId) {
- const r = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), l = new kt(), s = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: p } = _s([o.copyRange, t]), d = sE(c, u, true), g = /* @__PURE__ */ new Map();
- d.forEach(({ startRange: v }) => {
- var w;
- (w = this._copyInfo) == null || w.matrix.forValue((I, V3, _) => {
- const S = en.getPositionRange(
- {
- startRow: I,
- endRow: I,
- startColumn: V3,
- endColumn: V3
- },
- v
- ), m2 = `${i}-${_}`, y = this._sheetDataValidationModel.getRuleById(a, i, _);
- !this._sheetDataValidationModel.getRuleById(o.unitId, o.subUnitId, m2) && y && g.set(m2, { ...y, uid: m2 });
- const { row: P, col: F3 } = p(S.startRow, S.startColumn);
- s.add(m2), l.setValue(P, F3, m2);
- });
- });
- const f = Array.from(s).map((v) => ({ id: v, ranges: WC(l, (w) => w === v) }));
- r.addRangeRules(f);
- const { redoMutations: C2, undoMutations: R } = be2(
- o.unitId,
- o.subUnitId,
- r.diffWithAddition(this._sheetDataValidationModel.getRules(o.unitId, o.subUnitId), g.values()),
- this._injector,
- "patched",
- false
- );
- return {
- redos: C2,
- undos: R
- };
- } else {
- const r = this._sheetDataValidationModel.getRuleObjectMatrix(a, i).clone(), l = new kt(), s = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: p } = _s([o.copyRange, t]);
- sE(c, u, true).forEach(({ startRange: R }) => {
- var v;
- (v = this._copyInfo) == null || v.matrix.forValue((w, I, V3) => {
- const _ = en.getPositionRange(
- {
- startRow: w,
- endRow: w,
- startColumn: I,
- endColumn: I
- },
- R
- ), { row: S, col: m2 } = p(_.startRow, _.startColumn);
- l.setValue(S, m2, V3), s.add(V3);
- });
- });
- const g = Array.from(s).map((R) => ({ id: R, ranges: WC(l, (v) => v === R) }));
- r.addRangeRules(g);
- const { redoMutations: f, undoMutations: C2 } = be2(
- a,
- i,
- r.diff(this._sheetDataValidationModel.getRules(a, i)),
- this._injector,
- "patched",
- false
- );
- return {
- redos: f,
- undos: C2
- };
- }
- }
- };
- Ke = sr2([
- $t(0, Sn),
- $t(1, ot(F2)),
- $t(2, ot(Ot))
- ], Ke);
- var lr = Object.defineProperty;
- var dr = Object.getOwnPropertyDescriptor;
- var cr = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? dr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && lr(t, o, a), a;
- };
- var kt2 = (e, t) => (o, n) => t(o, n, e);
- var Ge = class extends nt {
- constructor(e, t, o) {
- super(), this._localeService = e, this._commandService = t, this._sheetPermissionCheckController = o, this._commandExecutedListener();
- }
- _commandExecutedListener() {
- this.disposeWithMe(
- this._commandService.beforeCommandExecuted((e) => {
- e.id === Ra2.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
- workbookTypes: [Me],
- rangeTypes: [Pe],
- worksheetTypes: [Te, ar2]
- }) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"))), e.id === pa.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
- workbookTypes: [Me],
- rangeTypes: [Pe],
- worksheetTypes: [Te, ar2]
- }, e.params.ranges) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")));
- })
- );
- }
- };
- Ge = cr([
- kt2(0, ot(Vr)),
- kt2(1, Pt),
- kt2(2, ot(Nn2))
- ], Ge);
- var Lo = "data-validation-single";
- var Po2 = "sheet.menu.data-validation";
- function ur(e) {
- return {
- id: Po2,
- type: $e.SUBITEMS,
- icon: Lo,
- tooltip: "dataValidation.title",
- hidden$: Fa(e, Fe.UNIVER_SHEET),
- disabled$: ue(e, { workbookTypes: [Me], worksheetTypes: [ar2, Te], rangeTypes: [Pe] })
- };
- }
- function hr(e) {
- return {
- id: Ue.id,
- title: "dataValidation.panel.title",
- type: $e.BUTTON
- };
- }
- function pr(e) {
- return {
- id: At.id,
- title: "dataValidation.panel.add",
- type: $e.BUTTON
- };
- }
- var fr2 = {
- [l1.FORMULAS_INSERT]: {
- [Po2]: {
- order: 9,
- menuItemFactory: ur,
- [Ue.id]: {
- order: 0,
- menuItemFactory: hr
- },
- [At.id]: {
- order: 1,
- menuItemFactory: pr
- }
- }
- }
- };
- var mr = Object.defineProperty;
- var gr2 = Object.getOwnPropertyDescriptor;
- var To = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? gr2(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && mr(t, o, a), a;
- };
- var G = (e, t) => (o, n) => t(o, n, e);
- var Ao = {
- tr: {
- size: 6,
- color: "#fe4b4b"
- }
- };
- var Ze2 = class extends J0 {
- constructor(e, t, o, n, a, i, r, l, s, c, u) {
- super(), this._commandService = e, this._menuManagerService = t, this._renderManagerService = o, this._univerInstanceService = n, this._autoHeightController = a, this._dropdownManagerService = i, this._sheetDataValidationModel = r, this._dataValidatorRegistryService = l, this._sheetInterceptorService = s, this._dataValidationCacheService = c, this._editorBridgeService = u, this._initMenu(), this._initDropdown(), this._initViewModelIntercept(), this._initAutoHeight();
- }
- _initMenu() {
- this._menuManagerService.mergeMenu(fr2);
- }
- _initDropdown() {
- this._editorBridgeService && this.disposeWithMe(this._editorBridgeService.visible$.subscribe((e) => {
- var o;
- if (!e.visible) {
- ((o = this._dropdownManagerService.activeDropdown) == null ? void 0 : o.trigger) === "editor-bridge" && this._dropdownManagerService.hideDropdown();
- return;
- }
- const t = this._editorBridgeService.getEditCellState();
- if (t) {
- const { unitId: n, sheetId: a, row: i, column: r } = t, l = this._univerInstanceService.getUniverSheetInstance(n);
- if (!l)
- return;
- const s = this._sheetDataValidationModel.getRuleByLocation(n, a, i, r);
- if (!s)
- return;
- const c = this._dataValidatorRegistryService.getValidatorItem(s.type);
- if (!(c != null && c.dropdown))
- return;
- const u = l.getActiveSheet();
- if (!u)
- return;
- const p = this._dropdownManagerService.activeDropdown, d = p == null ? void 0 : p.location;
- if (d && d.unitId === n && d.subUnitId === a && d.row === i && d.col === r)
- return;
- this._dropdownManagerService.showDropdown(
- {
- location: {
- unitId: n,
- subUnitId: a,
- row: i,
- col: r,
- workbook: l,
- worksheet: u
- },
- componentKey: c.dropdown,
- onHide: () => {
- },
- trigger: "editor-bridge"
- },
- false
- );
- }
- }));
- }
- // eslint-disable-next-line max-lines-per-function
- _initViewModelIntercept() {
- this.disposeWithMe(
- this._sheetInterceptorService.intercept(
- et.CELL_CONTENT,
- {
- effect: Vn.Style,
- // must be after numfmt
- priority: ea.DATA_VALIDATION,
- // eslint-disable-next-line max-lines-per-function, complexity
- handler: (e, t, o) => {
- var v, w, I, V3, _;
- const { row: n, col: a, unitId: i, subUnitId: r, workbook: l, worksheet: s } = t, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
- if (!c)
- return o(e);
- const u = this._sheetDataValidationModel.getRuleById(i, r, c);
- if (!u)
- return o(e);
- const p = (v = this._dataValidationCacheService.getValue(i, r, n, a)) != null ? v : Rl.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), g = t.rawData;
- let f;
- const C2 = {
- get value() {
- var S;
- return f !== void 0 || (f = (S = ne(g)) != null ? S : null), f;
- }
- }, R = {
- get value() {
- var S;
- return `${(S = C2.value) != null ? S : ""}`;
- }
- };
- return o({
- ...e,
- markers: {
- ...e == null ? void 0 : e.markers,
- ...p === Rl.INVALID ? Ao : null
- },
- customRender: [
- ...(w = e == null ? void 0 : e.customRender) != null ? w : [],
- ...d != null && d.canvasRender ? [d.canvasRender] : []
- ],
- fontRenderExtension: {
- ...e == null ? void 0 : e.fontRenderExtension,
- isSkip: ((I = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : I.isSkip) || ((V3 = d == null ? void 0 : d.skipDefaultFontRender) == null ? void 0 : V3.call(d, u, C2.value, t))
- },
- interceptorStyle: {
- ...e == null ? void 0 : e.interceptorStyle,
- ...d == null ? void 0 : d.getExtraStyle(u, R.value, {
- get style() {
- const S = l.getStyles();
- return (typeof (e == null ? void 0 : e.s) == "string" ? S.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
- }
- }, n, a)
- },
- interceptorAutoHeight: () => {
- var P, F3, T, E, A, x;
- const S = (F3 = (P = this._renderManagerService.getRenderById(i)) == null ? void 0 : P.with(me2).getWorksheetSkeleton(r)) == null ? void 0 : F3.skeleton;
- if (!S)
- return;
- const m2 = S.worksheet.getMergedCell(n, a), y = {
- data: e,
- style: S.getsStyles().getStyleByCell(e),
- primaryWithCoord: S.getCellWithCoordByIndex((T = m2 == null ? void 0 : m2.startRow) != null ? T : n, (E = m2 == null ? void 0 : m2.startColumn) != null ? E : a),
- unitId: i,
- subUnitId: r,
- row: n,
- col: a,
- workbook: l,
- worksheet: s
- };
- return (x = (A = d == null ? void 0 : d.canvasRender) == null ? void 0 : A.calcCellAutoHeight) == null ? void 0 : x.call(A, y);
- },
- interceptorAutoWidth: () => {
- var P, F3, T, E, A, x;
- const S = (F3 = (P = this._renderManagerService.getRenderById(i)) == null ? void 0 : P.with(me2).getWorksheetSkeleton(r)) == null ? void 0 : F3.skeleton;
- if (!S)
- return;
- const m2 = S.worksheet.getMergedCell(n, a), y = {
- data: e,
- style: S.getsStyles().getStyleByCell(e),
- primaryWithCoord: S.getCellWithCoordByIndex((T = m2 == null ? void 0 : m2.startRow) != null ? T : n, (E = m2 == null ? void 0 : m2.startColumn) != null ? E : a),
- unitId: i,
- subUnitId: r,
- row: n,
- col: a,
- workbook: l,
- worksheet: s
- };
- return (x = (A = d == null ? void 0 : d.canvasRender) == null ? void 0 : A.calcCellAutoWidth) == null ? void 0 : x.call(A, y);
- },
- coverable: ((_ = e == null ? void 0 : e.coverable) != null ? _ : true) && !(u.type === Il.LIST || u.type === Il.LIST_MULTIPLE)
- });
- }
- }
- )
- );
- }
- _initAutoHeight() {
- this._sheetDataValidationModel.ruleChange$.pipe(
- // patched data-validation change don't need to re-calc row height
- // re-calc of row height will be triggered precisely by the origin command
- filter((e) => e.source === "command"),
- bufferTime(100)
- ).subscribe((e) => {
- if (e.length === 0)
- return;
- const t = [];
- if (e.forEach((o) => {
- var n;
- (o.rule.type === Il.LIST_MULTIPLE || o.rule.type === Il.LIST) && (n = o.rule) != null && n.ranges && t.push(...o.rule.ranges);
- }), t.length) {
- const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
- mu(o.redos, this._commandService);
- }
- });
- }
- };
- Ze2 = To([
- G(0, Pt),
- G(1, m1),
- G(2, Yx),
- G(3, _n),
- G(4, ot(ri)),
- G(5, ot(Ie)),
- G(6, ot(F2)),
- G(7, ot(j)),
- G(8, ot(V)),
- G(9, ot(q4)),
- G(10, nf(tt))
- ], Ze2);
- var $n = class extends J0 {
- constructor(e, t, o, n, a, i, r) {
- super(), this._commandService = e, this._renderManagerService = t, this._autoHeightController = o, this._dataValidatorRegistryService = n, this._sheetInterceptorService = a, this._sheetDataValidationModel = i, this._dataValidationCacheService = r, this._initViewModelIntercept(), this._initAutoHeight();
- }
- _initViewModelIntercept() {
- this.disposeWithMe(
- this._sheetInterceptorService.intercept(
- et.CELL_CONTENT,
- {
- effect: Vn.Style,
- // must be after numfmt
- priority: ea.DATA_VALIDATION,
- // eslint-disable-next-line complexity
- handler: (e, t, o) => {
- var R, v, w, I, V3;
- const { row: n, col: a, unitId: i, subUnitId: r, workbook: l, worksheet: s } = t, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
- if (!c)
- return o(e);
- const u = this._sheetDataValidationModel.getRuleById(i, r, c);
- if (!u)
- return o(e);
- const p = (R = this._dataValidationCacheService.getValue(i, r, n, a)) != null ? R : Rl.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), g = s.getCellRaw(n, a), f = ne(g), C2 = `${f != null ? f : ""}`;
- return o({
- ...e,
- markers: {
- ...e == null ? void 0 : e.markers,
- ...p === Rl.INVALID ? Ao : null
- },
- customRender: [
- ...(v = e == null ? void 0 : e.customRender) != null ? v : [],
- ...d != null && d.canvasRender ? [d.canvasRender] : []
- ],
- fontRenderExtension: {
- ...e == null ? void 0 : e.fontRenderExtension,
- isSkip: ((w = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : w.isSkip) || ((I = d == null ? void 0 : d.skipDefaultFontRender) == null ? void 0 : I.call(d, u, f, t))
- },
- interceptorStyle: {
- ...e == null ? void 0 : e.interceptorStyle,
- ...d == null ? void 0 : d.getExtraStyle(u, C2, {
- get style() {
- const _ = l.getStyles();
- return (typeof (e == null ? void 0 : e.s) == "string" ? _.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
- }
- }, n, a)
- },
- interceptorAutoHeight: () => {
- var y, P, F3, T, E, A;
- const _ = (P = (y = this._renderManagerService.getRenderById(i)) == null ? void 0 : y.with(me2).getWorksheetSkeleton(r)) == null ? void 0 : P.skeleton;
- if (!_)
- return;
- const S = _.worksheet.getMergedCell(n, a), m2 = {
- data: e,
- style: _.getsStyles().getStyleByCell(e),
- primaryWithCoord: _.getCellWithCoordByIndex((F3 = S == null ? void 0 : S.startRow) != null ? F3 : n, (T = S == null ? void 0 : S.startColumn) != null ? T : a),
- unitId: i,
- subUnitId: r,
- row: n,
- col: a,
- workbook: l,
- worksheet: s
- };
- return (A = (E = d == null ? void 0 : d.canvasRender) == null ? void 0 : E.calcCellAutoHeight) == null ? void 0 : A.call(E, m2);
- },
- coverable: ((V3 = e == null ? void 0 : e.coverable) != null ? V3 : true) && !(u.type === Il.LIST || u.type === Il.LIST_MULTIPLE)
- });
- }
- }
- )
- );
- }
- _initAutoHeight() {
- this._sheetDataValidationModel.ruleChange$.pipe(
- filter((e) => e.source === "command"),
- bufferTime(16)
- ).subscribe((e) => {
- const t = [];
- if (e.forEach((o) => {
- var n;
- (n = o.rule) != null && n.ranges && t.push(...o.rule.ranges);
- }), t.length) {
- const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
- mu(o.redos, this._commandService);
- }
- });
- }
- };
- $n = To([
- G(0, Pt),
- G(1, Yx),
- G(2, ot(ri)),
- G(3, ot(j)),
- G(4, ot(V)),
- G(5, ot(F2)),
- G(6, ot(q4))
- ], $n);
- var vr = Object.defineProperty;
- var _r = Object.getOwnPropertyDescriptor;
- var Sr = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? _r(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && vr(t, o, a), a;
- };
- var kn = (e, t) => (o, n) => t(o, n, e);
- var yt = class extends nt {
- constructor(e, t, o) {
- super(), this._context = e, this._sheetDataValidationModel = t, this._sheetSkeletonManagerService = o, this._initSkeletonChange();
- }
- _initSkeletonChange() {
- const e = (t) => {
- var n;
- if (!t.length)
- return;
- const o = /* @__PURE__ */ new Set();
- t.forEach((a) => {
- o.add(a.subUnitId);
- }), o.forEach((a) => {
- var i;
- (i = this._sheetSkeletonManagerService.getWorksheetSkeleton(a)) == null || i.skeleton.makeDirty(true);
- }), (n = this._context.mainComponent) == null || n.makeForceDirty();
- };
- this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(q0(16)).subscribe(e));
- }
- };
- yt = Sr([
- kn(1, ot(F2)),
- kn(2, ot(me2))
- ], yt);
- var Cr = "univer-data-validation-formula";
- var Ir = "univer-data-validation-formula-and";
- var wr = "univer-data-validation-formula-list-item";
- var Rr = "univer-data-validation-formula-list-item-icon";
- var Dr = "univer-data-validation-formula-list-item-drag";
- var Vr2 = "univer-data-validation-formula-list-add";
- var yr = "univer-data-validation-formula-color-select";
- var Mr = "univer-data-validation-formula-color-select-panel";
- var br = "univer-data-validation-formula-color-item";
- var ne2 = {
- dataValidationFormula: Cr,
- dataValidationFormulaAnd: Ir,
- dataValidationFormulaListItem: wr,
- dataValidationFormulaListItemIcon: Rr,
- dataValidationFormulaListItemDrag: Dr,
- dataValidationFormulaListAdd: Vr2,
- dataValidationFormulaColorSelect: yr,
- dataValidationFormulaColorSelectPanel: Mr,
- dataValidationFormulaColorItem: br
- };
- var Er2 = (e) => {
- const { isTwoFormula: t = false, value: o, onChange: n, showError: a, validResult: i } = e, r = W0(Vr), l = a ? i == null ? void 0 : i.formula1 : "", s = a ? i == null ? void 0 : i.formula2 : "";
- return t ? h.jsxs(h.Fragment, { children: [
- h.jsx(HO, { error: l, children: h.jsx(
- QC,
- {
- className: ne2.dataValidationFormula,
- placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
- value: o == null ? void 0 : o.formula1,
- onChange: (c) => {
- n == null || n({
- ...o,
- formula1: c
- });
- }
- }
- ) }),
- h.jsx("div", { className: ne2.dataValidationFormulaAnd, children: r.t("dataValidation.panel.formulaAnd") }),
- h.jsx(HO, { error: s, children: h.jsx(
- QC,
- {
- className: ne2.dataValidationFormula,
- placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
- value: o == null ? void 0 : o.formula2,
- onChange: (c) => {
- n == null || n({
- ...o,
- formula2: c
- });
- }
- }
- ) })
- ] }) : h.jsx(HO, { error: l, children: h.jsx(
- QC,
- {
- className: ne2.dataValidationFormula,
- placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
- value: o == null ? void 0 : o.formula1,
- onChange: (c) => {
- n == null || n({ formula1: c });
- }
- }
- ) });
- };
- function Or(e) {
- const { value: t, onChange: o, showError: n, validResult: a } = e, i = W0(Vr), r = n ? a == null ? void 0 : a.formula1 : "", l = n ? a == null ? void 0 : a.formula2 : "", [s, c] = (0, import_react.useState)(!((t == null ? void 0 : t.formula1) === void 0 && (t == null ? void 0 : t.formula2) === void 0));
- return h.jsxs(h.Fragment, { children: [
- h.jsx(HO, { children: h.jsx(
- um,
- {
- checked: s,
- onChange: (u) => {
- u ? c(true) : (c(false), o == null || o({
- ...t,
- formula1: void 0,
- formula2: void 0
- }));
- },
- children: i.t("dataValidation.checkbox.tips")
- }
- ) }),
- s ? h.jsx(HO, { label: i.t("dataValidation.checkbox.checked"), error: r, children: h.jsx(
- QC,
- {
- className: ne2.dataValidationFormula,
- placeholder: i.t("dataValidation.panel.valuePlaceholder"),
- value: t == null ? void 0 : t.formula1,
- onChange: (u) => {
- o == null || o({
- ...t,
- formula1: u || void 0
- });
- }
- }
- ) }) : null,
- s ? h.jsx(HO, { label: i.t("dataValidation.checkbox.unchecked"), error: l, children: h.jsx(
- QC,
- {
- className: ne2.dataValidationFormula,
- placeholder: i.t("dataValidation.panel.valuePlaceholder"),
- value: t == null ? void 0 : t.formula2,
- onChange: (u) => {
- o == null || o({
- ...t,
- formula2: u || void 0
- });
- }
- }
- ) }) : null
- ] });
- }
- function Lr(e) {
- var p;
- const { unitId: t, subUnitId: o, value: n, onChange: a, showError: i, validResult: r } = e, l = i ? r == null ? void 0 : r.formula1 : void 0, s = (0, import_react.useRef)({}), [c, u] = (0, import_react.useState)(false);
- return Kl((d) => {
- var f;
- const g = (f = s.current) == null ? void 0 : f.handleOutClick;
- g && g(d, () => u(false));
- }), h.jsx(
- fc,
- {
- initValue: (p = n == null ? void 0 : n.formula1) != null ? p : "=",
- unitId: t,
- subUnitId: o,
- isFocus: c,
- onChange: (d) => {
- const g = (d != null ? d : "").trim();
- g !== (n == null ? void 0 : n.formula1) && (a == null || a({
- ...n,
- formula1: g
- }));
- },
- errorText: l,
- onFocus: () => u(true),
- actions: s.current,
- isSupportAcrossSheet: true
- }
- );
- }
- function xo(e) {
- var t, o, n = "";
- if (typeof e == "string" || typeof e == "number")
- n += e;
- else if (typeof e == "object")
- if (Array.isArray(e)) {
- var a = e.length;
- for (t = 0; t < a; t++)
- e[t] && (o = xo(e[t])) && (n && (n += " "), n += o);
- } else
- for (o in e)
- e[o] && (n && (n += " "), n += o);
- return n;
- }
- function Pr() {
- for (var e, t, o = 0, n = "", a = arguments.length; o < a; o++)
- (e = arguments[o]) && (t = xo(e)) && (n && (n += " "), n += t);
- return n;
- }
- var Tr = [
- "#FFFFFF",
- "#FEE7E7",
- "#FEF0E6",
- "#EFFBD0",
- "#E4F4FE",
- "#E8ECFD",
- "#F1EAFA",
- "#FDE8F3",
- "#E5E5E5",
- "#FDCECE",
- "#FDC49B",
- "#DEF6A2",
- "#9FDAFF",
- "#D0D9FB",
- "#E3D5F6",
- "#FBD0E8",
- "#656565",
- "#FE4B4B",
- "#FF8C51",
- "#8BBB11",
- "#0B9EFB",
- "#3A60F7",
- "#9E6DE3",
- "#F248A6"
- ];
- var Ar = (e) => {
- const { value: t, onChange: o, disabled: n } = e, [a, i] = (0, import_react.useState)(false);
- return h.jsx(
- r_,
- {
- disabled: n,
- open: a,
- onDropdownVisibleChange: i,
- dropdownStyle: { width: 112 },
- style: { width: 96, cursor: "pointer" },
- className: ne2.dataValidationFormulaColorSelect,
- value: t,
- onChange: o,
- labelRender: (r) => h.jsx(
- "div",
- {
- className: ne2.dataValidationFormulaColorItem,
- style: { background: r.value, marginTop: 5 }
- }
- ),
- dropdownRender: () => h.jsx("div", { className: ne2.dataValidationFormulaColorSelectPanel, children: Tr.map(
- (r) => h.jsx(
- "div",
- {
- onClick: () => {
- o(r), i(false);
- },
- className: ne2.dataValidationFormulaColorItem,
- style: { background: r }
- },
- r
- )
- ) })
- }
- );
- };
- var Wn = (e) => {
- const { item: t, commonProps: o, style: n } = e, { onItemChange: a, onItemDelete: i } = o;
- return h.jsxs("div", { className: ne2.dataValidationFormulaListItem, style: n, children: [
- t.isRef ? null : h.jsx("div", { className: Pr(ne2.dataValidationFormulaListItemDrag, "draggableHandle"), children: h.jsx(yo, {}) }),
- h.jsx(
- Ar,
- {
- value: t.color,
- onChange: (r) => {
- a(t.id, t.label, r);
- }
- }
- ),
- h.jsx(
- QC,
- {
- disabled: t.isRef,
- value: t.label,
- onChange: (r) => {
- a(t.id, r, t.color);
- }
- }
- ),
- t.isRef ? null : h.jsx("div", { className: ne2.dataValidationFormulaListItemIcon, children: h.jsx(Rn, { onClick: () => i(t.id) }) })
- ] });
- };
- function xr(e) {
- const { value: t, onChange: o = () => {
- }, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: l } = e, { formula1: s = "", formula2: c = "" } = t || {}, u = (0, import_react.useRef)(null), [p, d] = (0, import_react.useState)(() => vC(s) ? "1" : "0"), [g, f] = (0, import_react.useState)(p === "1" ? s : "="), [C2, R] = (0, import_react.useState)(p === "1" ? s : "="), v = W0(Vr), w = W0(j), I = W0(m), V3 = W0(Te2), [_, S] = (0, import_react.useState)(() => c.split(",")), m2 = w.getValidatorItem(Il.LIST), [y, P] = (0, import_react.useState)([]), [F3, T] = (0, import_react.useState)(""), E = r ? i == null ? void 0 : i.formula1 : "", A = (0, import_react.useMemo)(() => I.ruleChange$.pipe(debounceTime(16)), []), x = z0(A), j2 = n3(o);
- (0, import_react.useEffect)(() => {
- (async () => {
- await new Promise((B) => {
- setTimeout(() => B(true), 100);
- });
- const D = I.getRuleById(n, a, l), U = D == null ? void 0 : D.formula1;
- if (vC(U) && m2 && D) {
- const B = await m2.getListAsync(D, n, a);
- P(B);
- }
- })();
- }, [I, x, m2, l, a, n]), (0, import_react.useEffect)(() => {
- vC(s) && s !== C2 && (f(s), R(C2));
- }, [C2, s]);
- const [N2, H2] = (0, import_react.useState)(() => {
- const D = p !== "1" ? pe(s) : [], U = c.split(",");
- return D.map((B, $) => ({
- label: B,
- color: U[$] || Te3,
- isRef: false,
- id: re.generateRandomId(4)
- }));
- }), X = (D, U, B) => {
- const $ = N2.find((_e2) => _e2.id === D);
- $ && ($.label = U, $.color = B, H2([...N2]));
- }, k = (D) => {
- const U = N2.findIndex((B) => B.id === D);
- U !== -1 && (N2.splice(U, 1), H2([...N2]));
- }, K2 = c.split(","), q5 = (0, import_react.useMemo)(() => y.map((D, U) => ({
- label: D,
- color: K2[U] || Te3,
- id: `${U}`,
- isRef: true
- })), [K2, y]), ee2 = (D, U, B) => {
- const $ = [..._];
- $[+D] = B, S($), j2({
- formula1: s,
- formula2: $.join(",")
- });
- }, te = () => {
- H2([
- ...N2,
- {
- label: "",
- color: Te3,
- isRef: false,
- id: re.generateRandomId(4)
- }
- ]);
- };
- (0, import_react.useEffect)(() => {
- if (p === "1")
- return;
- const D = /* @__PURE__ */ new Set(), U = [];
- N2.map((B) => ({
- labelList: B.label.split(","),
- item: B
- })).forEach(({ item: B, labelList: $ }) => {
- $.forEach((_e2) => {
- D.has(_e2) || (D.add(_e2), U.push({
- label: _e2,
- color: B.color
- }));
- });
- }), j2({
- formula1: ir(U.map((B) => B.label)),
- formula2: U.map((B) => B.color === Te3 ? "" : B.color).join(",")
- });
- }, [N2, j2, p, C2, _]);
- const re2 = n3(async (D) => {
- if (!vC(D)) {
- j2 == null || j2({
- formula1: "",
- formula2: c
- });
- return;
- }
- V3.getFormulaRefCheck(D) ? (j2 == null || j2({
- formula1: vC(D) ? D : "",
- formula2: c
- }), T("")) : (j2 == null || j2({
- formula1: "",
- formula2: c
- }), f("="), T(v.t("dataValidation.validFail.formulaError")));
- }), ae = (0, import_react.useRef)({}), [se2, O] = (0, import_react.useState)(false);
- return Kl((D) => {
- var B;
- const U = (B = ae.current) == null ? void 0 : B.handleOutClick;
- U && U(D, () => O(false));
- }), h.jsxs(h.Fragment, { children: [
- h.jsx(HO, { label: v.t("dataValidation.list.options"), children: h.jsxs(
- t_,
- {
- value: p,
- onChange: (D) => {
- d(D), f(C2), D === "1" && j2({
- formula1: C2 === "=" ? "" : C2,
- formula2: _.join(",")
- });
- },
- children: [
- h.jsx(e_, { value: "0", children: v.t("dataValidation.list.customOptions") }),
- h.jsx(e_, { value: "1", children: v.t("dataValidation.list.refOptions") })
- ]
- }
- ) }),
- p === "1" ? h.jsxs(h.Fragment, { children: [
- h.jsx(
- fc,
- {
- initValue: g,
- unitId: n,
- subUnitId: a,
- isFocus: se2,
- onChange: (D = "") => {
- const U = (D != null ? D : "").trim();
- R(U), re2(U);
- },
- errorText: E || F3 || void 0,
- onFocus: () => O(true),
- actions: ae.current,
- isSupportAcrossSheet: true
- }
- ),
- h.jsx("div", { ref: u, style: { marginTop: "12px" }, children: q5.map((D) => h.jsx(Wn, { item: D, commonProps: { onItemChange: ee2 }, style: { marginBottom: 12 } }, D.id)) })
- ] }) : h.jsx(HO, { error: E, children: h.jsxs("div", { ref: u, style: { marginTop: "-12px" }, children: [
- h.jsx(
- g_,
- {
- list: N2,
- onListChange: H2,
- rowHeight: 32,
- margin: [0, 12],
- draggableHandle: ".draggableHandle",
- itemRender: (D) => h.jsx(
- Wn,
- {
- item: D,
- commonProps: {
- onItemChange: X,
- onItemDelete: k
- }
- },
- D.id
- ),
- idKey: "id"
- }
- ),
- h.jsxs("a", { className: ne2.dataValidationFormulaListAdd, onClick: te, children: [
- h.jsx(Ro, {}),
- v.t("dataValidation.list.add")
- ] })
- ] }) })
- ] });
- }
- var jo = "data-validation.custom-formula-input";
- var xt = "data-validation.formula-input";
- var Mn = "data-validation.list-formula-input";
- var Fo = "data-validation.checkbox-formula-input";
- var jr = [
- [
- jo,
- Lr
- ],
- [
- xt,
- Er2
- ],
- [
- Mn,
- xr
- ],
- [
- Fo,
- Or
- ]
- ];
- var Fr = "LIST_RENDER_MODE_OPTION_INPUT";
- function Mt(e) {
- var a;
- const { value: t, onChange: o } = e, n = W0(Vr);
- return h.jsx(HO, { label: n.t("dataValidation.renderMode.label"), children: h.jsxs(t_, { value: `${(a = t.renderMode) != null ? a : Cl.CUSTOM}`, onChange: (i) => o({ ...t, renderMode: +i }), children: [
- h.jsx(e_, { value: `${Cl.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
- h.jsx(e_, { value: `${Cl.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
- h.jsx(e_, { value: `${Cl.TEXT}`, children: n.t("dataValidation.renderMode.text") })
- ] }) });
- }
- Mt.componentKey = Fr;
- var Nr = "DATE_SHOW_TIME_OPTION";
- function bt(e) {
- var a;
- const { value: t, onChange: o } = e, n = W0(Vr);
- return h.jsx(HO, { children: h.jsx(
- um,
- {
- checked: (a = t.bizInfo) == null ? void 0 : a.showTime,
- onChange: (i) => {
- o({
- ...t,
- bizInfo: {
- ...t.bizInfo,
- showTime: i
- }
- });
- },
- children: n.t("dataValidation.showTime.label")
- }
- ) });
- }
- bt.componentKey = Nr;
- var Ur = Object.defineProperty;
- var Br = Object.getOwnPropertyDescriptor;
- var $r = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? Br(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && Ur(t, o, a), a;
- };
- var at = (e, t) => (o, n) => t(o, n, e);
- var ht = 6;
- var dn2 = class {
- constructor(e, t, o, n, a) {
- this._commandService = e, this._formulaService = t, this._themeService = o, this._renderManagerService = n, this._dataValidationModel = a;
- }
- _calc(e, t) {
- var c, u, p;
- const { vt: o, ht: n } = t || {}, a = e.endX - e.startX - ht * 2, i = e.endY - e.startY, r = ((c = t == null ? void 0 : t.fs) != null ? c : 10) * 1.6;
- let l = 0, s = 0;
- switch (o) {
- case hn.TOP:
- s = 0;
- break;
- case hn.BOTTOM:
- s = 0 + (i - r);
- break;
- default:
- s = 0 + (i - r) / 2;
- break;
- }
- switch (n) {
- case Xt.LEFT:
- l = ht;
- break;
- case Xt.RIGHT:
- l = ht + (a - r);
- break;
- default:
- l = ht + (a - r) / 2;
- break;
- }
- return {
- left: e.startX + l,
- top: e.startY + s,
- width: ((u = t == null ? void 0 : t.fs) != null ? u : 10) * 1.6,
- height: ((p = t == null ? void 0 : t.fs) != null ? p : 10) * 1.6
- };
- }
- calcCellAutoHeight(e) {
- var o;
- const { style: t } = e;
- return ((o = t == null ? void 0 : t.fs) != null ? o : 10) * 1.6;
- }
- calcCellAutoWidth(e) {
- var o;
- const { style: t } = e;
- return ((o = t == null ? void 0 : t.fs) != null ? o : 10) * 1.6;
- }
- async _parseFormula(e, t, o) {
- var c, u, p, d, g, f, C2, R, v;
- const { formula1: n = Ve, formula2: a = Me2 } = e, i = await this._formulaService.getRuleFormulaResult(t, o, e.uid), r = se((p = (u = (c = i == null ? void 0 : i[0]) == null ? void 0 : c.result) == null ? void 0 : u[0]) == null ? void 0 : p[0]), l = se((f = (g = (d = i == null ? void 0 : i[1]) == null ? void 0 : d.result) == null ? void 0 : g[0]) == null ? void 0 : f[0]), s = C(String(r)) && C(String(l));
- return {
- formula1: vC(n) ? se((v = (R = (C2 = i == null ? void 0 : i[0]) == null ? void 0 : C2.result) == null ? void 0 : R[0]) == null ? void 0 : v[0]) : n,
- formula2: vC(a) ? l : a,
- isFormulaValid: s
- };
- }
- drawWith(e, t) {
- var E, A, x, j2;
- const { style: o, primaryWithCoord: n, unitId: a, subUnitId: i, worksheet: r, row: l, col: s } = t, c = n.isMergedMainCell ? n.mergeInfo : n, u = ne(r.getCellRaw(l, s)), p = this._dataValidationModel.getRuleByLocation(a, i, l, s);
- if (!p)
- return;
- const d = this._dataValidationModel.getValidator(p.type);
- if (!d)
- return;
- const g = this._themeService.getCurrentTheme();
- if (!((E = d.skipDefaultFontRender) != null && E.call(d, p, u, { unitId: a, subUnitId: i, row: l, column: s })))
- return;
- const f = d.parseFormulaSync(p, a, i), { formula1: C2 } = f, R = this._calc(c, o), { a: v, d: w } = e.getTransform(), I = Z(R.left, v), V3 = Z(R.top, w), _ = S1.create().composeMatrix({
- left: I,
- top: V3,
- scaleX: 1,
- scaleY: 1,
- angle: 0,
- skewX: 0,
- skewY: 0,
- flipX: false,
- flipY: false
- }), S = c.endX - c.startX, m2 = c.endY - c.startY;
- e.save(), e.beginPath(), e.rect(c.startX, c.startY, S, m2), e.clip();
- const y = _.getMatrix();
- e.transform(y[0], y[1], y[2], y[3], y[4], y[5]);
- const P = ((A = o == null ? void 0 : o.fs) != null ? A : 10) * 1.6, F3 = String(u) === String(C2), T = g.hyacinth500;
- u6.drawWith(e, {
- checked: F3,
- width: P,
- height: P,
- fill: (j2 = (x = o == null ? void 0 : o.cl) == null ? void 0 : x.rgb) != null ? j2 : T
- }), e.restore();
- }
- isHit(e, t) {
- const o = t.primaryWithCoord.isMergedMainCell ? t.primaryWithCoord.mergeInfo : t.primaryWithCoord, n = this._calc(o, t.style), a = n.top, i = n.top + n.height, r = n.left, l = n.left + n.width, { x: s, y: c } = e;
- return s <= l && s >= r && c <= i && c >= a;
- }
- async onPointerDown(e, t) {
- var f;
- if (t.button === 2)
- return;
- const { primaryWithCoord: o, unitId: n, subUnitId: a, worksheet: i, row: r, col: l } = e, s = ne(i.getCellRaw(r, l)), c = this._dataValidationModel.getRuleByLocation(n, a, r, l);
- if (!c)
- return;
- const u = this._dataValidationModel.getValidator(c.type);
- if (!u || !((f = u.skipDefaultFontRender) != null && f.call(u, c, s, { unitId: n, subUnitId: a, row: r, column: l })))
- return;
- const { formula1: p, formula2: d } = await this._parseFormula(c, n, a), g = {
- range: {
- startColumn: o.actualColumn,
- endColumn: o.actualColumn,
- startRow: o.actualRow,
- endRow: o.actualRow
- },
- value: {
- v: String(s) === _e(String(p)) ? d : p,
- p: null
- }
- };
- this._commandService.executeCommand(
- on.id,
- g
- );
- }
- onPointerEnter(e, t) {
- var o, n;
- (n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Fe.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(p1.POINTER);
- }
- onPointerLeave(e, t) {
- var o, n;
- (n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Fe.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(p1.DEFAULT);
- }
- };
- dn2 = $r([
- at(0, Pt),
- at(1, ot(K)),
- at(2, ot(ml)),
- at(3, ot(Yx)),
- at(4, ot(F2))
- ], dn2);
- var kr = Object.defineProperty;
- var Wr = Object.getOwnPropertyDescriptor;
- var Hr2 = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? Wr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && kr(t, o, a), a;
- };
- var Yr = (e, t) => (o, n) => t(o, n, e);
- var me3 = class {
- constructor(e) {
- M2(this, "canvasRender", null);
- M2(this, "dropdown");
- M2(this, "optionsInput");
- M2(this, "formulaInput", Mn);
- this.injector = e;
- }
- };
- me3 = Hr2([
- Yr(0, ot(Ot))
- ], me3);
- var Xr = class extends me3 {
- constructor() {
- super(...arguments);
- M2(this, "id", Il.CHECKBOX);
- M2(this, "canvasRender", this.injector.createInstance(dn2));
- M2(this, "formulaInput", Fo);
- }
- };
- var zr = class extends me3 {
- constructor() {
- super(...arguments);
- M2(this, "id", Il.CUSTOM);
- M2(this, "formulaInput", jo);
- }
- };
- var Kr = "data-validation.formula-input";
- var Gr = class extends me3 {
- constructor() {
- super(...arguments);
- M2(this, "id", Il.DATE);
- M2(this, "formulaInput", Kr);
- M2(this, "optionsInput", bt.componentKey);
- M2(this, "dropdown", Oo);
- }
- };
- var Zr = class extends me3 {
- constructor() {
- super(...arguments);
- M2(this, "id", Il.DECIMAL);
- M2(this, "formulaInput", xt);
- }
- };
- var No = 4;
- var qr = 0;
- var Wt = 4;
- var Uo = 4;
- var cn = 6;
- var Et2 = 6;
- var Le = 14;
- function Jr(e, t) {
- const o = q2.getTextSize(e, t), n = o.width + No * 2, { ba: a, bd: i } = o, r = a + i;
- return {
- width: n,
- height: r + qr * 2,
- ba: a
- };
- }
- function Ht(e, t, o, n) {
- const a = Le + cn * 2, i = o - a, r = n - Et2 * 2, l = e.map((d) => ({
- layout: Jr(d, t),
- text: d
- }));
- let s;
- const c = [];
- l.forEach((d) => {
- const { layout: g } = d, { width: f, height: C2 } = g;
- !s || s.width + f + Wt > i ? (s = {
- width: f,
- height: C2,
- items: [{
- ...d,
- left: 0
- }]
- }, c.push(s)) : (s.items.push({
- ...d,
- left: s.width + Wt
- }), s.width = s.width + f + Wt);
- });
- let u = 0, p = 0;
- return c.forEach((d, g) => {
- p = Math.max(p, d.width), g === c.length - 1 ? u += d.height : u += d.height + Uo;
- }), {
- lines: c,
- totalHeight: u,
- contentWidth: i,
- contentHeight: r,
- cellAutoHeight: u + Et2 * 2,
- calcAutoWidth: p + a
- };
- }
- var Qr = 8;
- var es = class extends q3 {
- static drawWith(t, o) {
- const { fontString: n, info: a, fill: i, color: r } = o, { layout: l, text: s } = a;
- t.save(), A1.drawWith(t, {
- width: l.width,
- height: l.height,
- radius: Qr,
- fill: i || Te3
- }), t.translateWithPrecision(No, l.ba), t.font = n, t.fillStyle = r, t.fillText(s, 0, 0), t.restore();
- }
- };
- var ts = Object.defineProperty;
- var ns = Object.getOwnPropertyDescriptor;
- var os = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? ns(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && ts(t, o, a), a;
- };
- var Yt2 = (e, t) => (o, n) => t(o, n, e);
- var as = new Path2D("M3.32201 4.84556C3.14417 5.05148 2.85583 5.05148 2.67799 4.84556L0.134292 1.90016C-0.152586 1.56798 0.0505937 1 0.456301 1L5.5437 1C5.94941 1 6.15259 1.56798 5.86571 1.90016L3.32201 4.84556Z");
- var un = class {
- constructor(e, t, o) {
- M2(this, "zIndex");
- M2(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
- this._commandService = e, this._renderManagerService = t, this._dataValidationModel = o;
- }
- _ensureMap(e) {
- let t = this._dropdownInfoMap.get(e);
- return t || (t = /* @__PURE__ */ new Map(), this._dropdownInfoMap.set(e, t)), t;
- }
- _generateKey(e, t) {
- return `${e}.${t}`;
- }
- _drawDownIcon(e, t, o, n, a) {
- const i = o - Le + 4;
- let r = 4;
- switch (a) {
- case hn.MIDDLE:
- r = (n - Le) / 2 + 4;
- break;
- case hn.BOTTOM:
- r = n - Le + 4;
- break;
- }
- e.save(), e.translateWithPrecision(t.startX + i, t.startY + r), e.fillStyle = "#565656", e.fill(as), e.restore();
- }
- // eslint-disable-next-line max-lines-per-function
- drawWith(e, t, o, n) {
- var X, k;
- const { primaryWithCoord: a, row: i, col: r, style: l, data: s, subUnitId: c } = t, u = a.isMergedMainCell ? a.mergeInfo : a, p = s == null ? void 0 : s.fontRenderExtension, { leftOffset: d = 0, rightOffset: g = 0, topOffset: f = 0, downOffset: C2 = 0 } = p || {}, R = this._ensureMap(c), v = this._generateKey(i, r), w = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, i, r);
- if (!w)
- return;
- const I = this._dataValidationModel.getValidator(w.type);
- if (!I)
- return;
- const V3 = {
- startX: u.startX + d,
- endX: u.endX - g,
- startY: u.startY + f,
- endY: u.endY - C2
- }, _ = V3.endX - V3.startX, S = V3.endY - V3.startY, { cl: m2 } = l || {}, y = (X = typeof m2 == "object" ? m2 == null ? void 0 : m2.rgb : m2) != null ? X : "#000", P = Qe(l != null ? l : void 0), { vt: F3, ht: T } = l || {}, E = F3 != null ? F3 : hn.MIDDLE, A = (k = ne(s)) != null ? k : "", x = I.parseCellValue(A), j2 = I.getListWithColorMap(w), N2 = Ht(x, P, _, S);
- this._drawDownIcon(e, V3, _, S, E), e.save(), e.translateWithPrecision(V3.startX, V3.startY), e.beginPath(), e.rect(0, 0, _ - Le, S), e.clip(), e.translateWithPrecision(cn, Et2);
- let H2 = 0;
- switch (E) {
- case hn.MIDDLE:
- H2 = (N2.contentHeight - N2.totalHeight) / 2;
- break;
- case hn.BOTTOM:
- H2 = N2.contentHeight - N2.totalHeight;
- break;
- }
- e.translateWithPrecision(0, H2), N2.lines.forEach((K2, q5) => {
- e.save();
- const { width: ee2, height: te, items: re2 } = K2;
- let ae = 0;
- switch (T) {
- case Xt.RIGHT:
- ae = N2.contentWidth - ee2;
- break;
- case Xt.CENTER:
- ae = (N2.contentWidth - ee2) / 2;
- break;
- }
- e.translate(ae, q5 * (te + Uo)), re2.forEach((se2) => {
- e.save(), e.translateWithPrecision(se2.left, 0), es.drawWith(e, {
- ...P,
- info: se2,
- color: y,
- fill: j2[se2.text]
- }), e.restore();
- }), e.restore();
- }), e.restore(), R.set(v, {
- left: V3.startX,
- top: V3.startY,
- width: N2.contentWidth + cn + Le,
- height: N2.contentHeight + Et2 * 2
- });
- }
- calcCellAutoHeight(e) {
- var _;
- const { primaryWithCoord: t, style: o, data: n, row: a, col: i } = e, r = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: c = 0, downOffset: u = 0 } = r || {}, p = t.isMergedMainCell ? t.mergeInfo : t, d = {
- startX: p.startX + l,
- endX: p.endX - s,
- startY: p.startY + c,
- endY: p.endY - u
- }, g = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, a, i);
- if (!g)
- return;
- const f = this._dataValidationModel.getValidator(g.type);
- if (!f)
- return;
- const C2 = d.endX - d.startX, R = d.endY - d.startY, v = (_ = ne(n)) != null ? _ : "", w = f.parseCellValue(v), I = Qe(o != null ? o : void 0);
- return Ht(w, I, C2, R).cellAutoHeight;
- }
- calcCellAutoWidth(e) {
- var _;
- const { primaryWithCoord: t, style: o, data: n, row: a, col: i } = e, r = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: c = 0, downOffset: u = 0 } = r || {}, p = t.isMergedMainCell ? t.mergeInfo : t, d = {
- startX: p.startX + l,
- endX: p.endX - s,
- startY: p.startY + c,
- endY: p.endY - u
- }, g = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, a, i);
- if (!g)
- return;
- const f = this._dataValidationModel.getValidator(g.type);
- if (!f)
- return;
- const C2 = d.endX - d.startX, R = d.endY - d.startY, v = (_ = ne(n)) != null ? _ : "", w = f.parseCellValue(v), I = Qe(o != null ? o : void 0);
- return Ht(w, I, C2, R).calcAutoWidth;
- }
- isHit(e, t) {
- const { primaryWithCoord: o } = t, n = o.isMergedMainCell ? o.mergeInfo : o, { endX: a } = n, { x: i } = e;
- return i >= a - Le && i <= a;
- }
- onPointerDown(e, t) {
- if (t.button === 2)
- return;
- const { unitId: o, subUnitId: n, row: a, col: i } = e, r = {
- unitId: o,
- subUnitId: n,
- row: a,
- column: i
- };
- this._commandService.executeCommand(Tt.id, r);
- }
- onPointerEnter(e, t) {
- var o, n;
- (n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Fe.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(p1.POINTER);
- }
- onPointerLeave(e, t) {
- var o, n;
- (n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Fe.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(p1.DEFAULT);
- }
- };
- un = os([
- Yt2(0, Pt),
- Yt2(1, ot(Yx)),
- Yt2(2, ot(F2))
- ], un);
- var is = class extends me3 {
- constructor() {
- super(...arguments);
- M2(this, "id", Il.LIST_MULTIPLE);
- M2(this, "canvasRender", this.injector.createInstance(un));
- M2(this, "dropdown", yn);
- }
- };
- var rs = Object.defineProperty;
- var ss = Object.getOwnPropertyDescriptor;
- var ls = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? ss(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && rs(t, o, a), a;
- };
- var pt = (e, t) => (o, n) => t(o, n, e);
- var Oe = 4;
- var ft = 4;
- var he = 14;
- var pe2 = 6;
- var ke3 = 4;
- var Xt2 = 8;
- var ds = "#565656";
- var Hn = new Path2D("M3.32201 4.84556C3.14417 5.05148 2.85583 5.05148 2.67799 4.84556L0.134292 1.90016C-0.152586 1.56798 0.0505937 1 0.456301 1L5.5437 1C5.94941 1 6.15259 1.56798 5.86571 1.90016L3.32201 4.84556Z");
- function cs(e, t) {
- const o = e.length;
- return {
- id: "d",
- body: {
- dataStream: `${e}${Wd}`,
- textRuns: [
- {
- ts: {
- fs: 11,
- ff: void 0,
- it: we.FALSE,
- bl: we.FALSE,
- ul: {
- s: we.FALSE
- },
- st: {
- s: we.FALSE
- },
- ol: {
- s: we.FALSE
- },
- cl: void 0,
- ...t,
- bg: void 0,
- bd: void 0
- },
- st: 0,
- ed: o
- }
- ]
- },
- documentStyle: {
- pageSize: {
- width: Number.POSITIVE_INFINITY,
- height: Number.POSITIVE_INFINITY
- }
- }
- };
- }
- function Bo(e, t, o) {
- const n = cs(e, o), a = new jt(n), i = new V2(a);
- return {
- documentSkeleton: k3.create(i, t),
- docModel: a,
- docViewModel: i
- };
- }
- function mt(e, t, o) {
- const {
- documentSkeleton: n,
- docModel: a,
- docViewModel: i
- } = Bo(e, t, o);
- return {
- documents: new ke(`DOCUMENTS_${re.generateRandomId()}`, n, {
- pageMarginLeft: 0,
- pageMarginTop: 0
- }),
- documentSkeleton: n,
- docModel: a,
- docViewModel: i
- };
- }
- function Yn(e, t, o, n, a, i, r = true) {
- let l = 0;
- const s = r ? ke3 : 0;
- switch (a) {
- case hn.BOTTOM:
- l = t - n - s;
- break;
- case hn.MIDDLE:
- l = (t - n) / 2;
- break;
- default:
- l = s;
- break;
- }
- l = Math.max(ke3, l);
- let c = 0;
- switch (i) {
- case Xt.CENTER:
- c = (e - o) / 2;
- break;
- case Xt.RIGHT:
- c = e - o;
- break;
- }
- return c = Math.max(pe2, c), {
- paddingLeft: c,
- paddingTop: l
- };
- }
- var hn2 = class {
- constructor(e, t, o, n) {
- M2(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
- M2(this, "zIndex");
- this._localeService = e, this._commandService = t, this._renderManagerService = o, this._dataValidationModel = n;
- }
- _ensureMap(e) {
- let t = this._dropdownInfoMap.get(e);
- return t || (t = /* @__PURE__ */ new Map(), this._dropdownInfoMap.set(e, t)), t;
- }
- _generateKey(e, t) {
- return `${e}.${t}`;
- }
- _drawDownIcon(e, t, o, n, a, i, r) {
- const { t: l = gt.pd.t, b: s = gt.pd.b } = r, c = o - he;
- let u;
- switch (i) {
- case hn.MIDDLE:
- u = (n - ft) / 2;
- break;
- case hn.BOTTOM:
- u = n - s - a - ke3 + (a / 2 - ft / 2);
- break;
- default:
- u = l + ke3 + (a / 2 - ft / 2);
- break;
- }
- e.save(), e.translateWithPrecision(t.startX + c, t.startY + u), e.fillStyle = "#565656", e.fill(Hn), e.restore();
- }
- // eslint-disable-next-line max-lines-per-function, complexity
- drawWith(e, t, o) {
- const { primaryWithCoord: n, row: a, col: i, style: r, data: l, subUnitId: s } = t, c = n.isMergedMainCell ? n.mergeInfo : n, u = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, a, i);
- if (!u)
- return;
- const p = this._dataValidationModel.getValidator(u.type);
- if (!p)
- return;
- const d = l == null ? void 0 : l.fontRenderExtension, { leftOffset: g = 0, rightOffset: f = 0, topOffset: C2 = 0, downOffset: R = 0 } = d || {};
- if (!u || !p || !p || p.id.indexOf(Il.LIST) !== 0 || !p.skipDefaultFontRender(u))
- return;
- const v = {
- startX: c.startX + g,
- endX: c.endX - f,
- startY: c.startY + C2,
- endY: c.endY - R
- }, w = v.endX - v.startX, I = v.endY - v.startY, V3 = this._ensureMap(s), _ = this._generateKey(a, i), S = p.getListWithColor(u), m2 = ne(l), y = `${m2 != null ? m2 : ""}`, P = S.find((x) => x.label === y);
- let { tb: F3, vt: T, ht: E, pd: A } = r || {};
- if (F3 = F3 != null ? F3 : xn.WRAP, T = T != null ? T : hn.BOTTOM, E = E != null ? E : gt.ht, A = A != null ? A : gt.pd, u.renderMode === Cl.ARROW) {
- const { l: x = gt.pd.l, t: j2 = gt.pd.t, r: N2 = gt.pd.r, b: H2 = gt.pd.b } = A, X = w - x - N2 - he - 4, { documentSkeleton: k, documents: K2, docModel: q5 } = mt(y, this._localeService, r);
- F3 === xn.WRAP && q5.updateDocumentDataPageSize(Math.max(X, 1)), k.calculate(), k.getActualSize();
- const ee2 = ee(k), { height: te, width: re2 } = ee2, { paddingTop: ae, paddingLeft: se2 } = Yn(X, I - j2 - H2, re2, te, T, E, true);
- this._drawDownIcon(e, v, w, I, te, T, A), e.save(), e.translateWithPrecision(v.startX + x, v.startY + j2), e.beginPath(), e.rect(0, 0, w - x - N2, I - j2 - H2), e.clip(), e.translateWithPrecision(0, ae), e.save(), e.translateWithPrecision(Oe, 0), e.beginPath(), e.rect(0, 0, X, te), e.clip(), K2.render(e), e.translateWithPrecision(se2, 0), e.restore(), e.restore(), V3.set(_, {
- left: v.endX + x + o.rowHeaderWidth - he,
- top: v.startY + j2 + o.columnHeaderHeight,
- width: he,
- height: I - j2 - H2
- });
- } else {
- e.save(), e.translateWithPrecision(v.startX, v.startY), e.beginPath(), e.rect(0, 0, w, I), e.clip();
- const x = w - pe2 * 2 - Oe - he - 4, { documentSkeleton: j2, documents: N2, docModel: H2 } = mt(y, this._localeService, r);
- F3 === xn.WRAP && H2.updateDocumentDataPageSize(Math.max(x, 1)), j2.calculate();
- const X = ee(j2), { height: k, width: K2 } = X, { paddingTop: q5, paddingLeft: ee2 } = Yn(x, I, K2, k, T, E);
- e.translateWithPrecision(pe2, q5);
- const te = Math.max(w - pe2 * 2, 1), re2 = k;
- A1.drawWith(e, {
- width: te,
- height: re2,
- fill: (P == null ? void 0 : P.color) || Te3,
- radius: Xt2
- }), e.save(), e.translateWithPrecision(Oe, 0), e.beginPath(), e.rect(0, 0, x, k), e.clip(), e.translateWithPrecision(ee2, 0), N2.render(e), e.restore(), e.translateWithPrecision(x + Oe + 4, (k - ft) / 2), e.fillStyle = ds, e.fill(Hn), e.restore(), V3.set(_, {
- left: v.startX + pe2 + o.rowHeaderWidth,
- top: v.startY + q5 + o.columnHeaderHeight,
- width: te,
- height: re2
- });
- }
- }
- calcCellAutoHeight(e) {
- const { primaryWithCoord: t, style: o, data: n, row: a, col: i } = e, r = t.isMergedMainCell ? t.mergeInfo : t, l = n == null ? void 0 : n.fontRenderExtension, { leftOffset: s = 0, rightOffset: c = 0, topOffset: u = 0, downOffset: p = 0 } = l || {}, d = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, a, i);
- if (!d || d.renderMode === Cl.TEXT)
- return;
- const g = {
- startX: r.startX + s,
- endX: r.endX - c,
- startY: r.startY + u,
- endY: r.endY - p
- }, f = g.endX - g.startX, C2 = ne(n), R = `${C2 != null ? C2 : ""}`;
- let { tb: v, pd: w } = o || {};
- const { t: I = gt.pd.t, b: V3 = gt.pd.b } = w != null ? w : {};
- if (v = v != null ? v : xn.WRAP, d.renderMode === Cl.ARROW) {
- const _ = f - he, { documentSkeleton: S, docModel: m2 } = mt(R, this._localeService, o);
- v === xn.WRAP && m2.updateDocumentDataPageSize(Math.max(_, 1)), S.calculate(), S.getActualSize();
- const y = ee(S), { height: P } = y;
- return P + I + V3 + ke3 * 2;
- } else {
- const _ = f - pe2 * 2 - Oe - he, { documentSkeleton: S, docModel: m2 } = Bo(R, this._localeService, o);
- v === xn.WRAP && m2.updateDocumentDataPageSize(Math.max(_, 1)), S.calculate();
- const y = ee(S), {
- height: P
- } = y;
- return P + ke3 * 2;
- }
- }
- calcCellAutoWidth(e) {
- const { primaryWithCoord: t, style: o, data: n, row: a, col: i } = e, r = t.isMergedMainCell ? t.mergeInfo : t, l = n == null ? void 0 : n.fontRenderExtension, { leftOffset: s = 0, rightOffset: c = 0, topOffset: u = 0, downOffset: p = 0 } = l || {}, d = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, a, i);
- if (!d || d.renderMode === Cl.TEXT)
- return;
- const g = {
- startX: r.startX + s,
- endX: r.endX - c,
- startY: r.startY + u,
- endY: r.endY - p
- }, f = g.endX - g.startX, C2 = ne(n), R = `${C2 != null ? C2 : ""}`;
- let { tb: v, pd: w } = o || {};
- const { l: I = gt.pd.l, r: V3 = gt.pd.r } = w != null ? w : {};
- v = v != null ? v : xn.WRAP;
- let _ = pe2 * 2 + he;
- switch (d.renderMode) {
- case Cl.ARROW:
- _ = he + pe2 * 2 + V3 + I;
- break;
- case Cl.CUSTOM:
- _ = he + pe2 * 2 + Oe * 2 + V3 + I + Xt2 / 2 + 1;
- break;
- default:
- _ = he + pe2 * 2 + Oe * 2 + V3 + I + Xt2 / 2 + 1;
- }
- const S = f - _, { documentSkeleton: m2, docModel: y } = mt(R, this._localeService, o);
- return v === xn.WRAP && y.updateDocumentDataPageSize(Math.max(S, 1)), m2.calculate(), m2.getActualSize(), ee(m2).width + _;
- }
- isHit(e, t) {
- const { subUnitId: o, row: n, col: a } = t, r = this._ensureMap(o).get(this._generateKey(n, a)), l = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, n, a);
- if (!l || !r || l.renderMode === Cl.TEXT)
- return false;
- const { top: s, left: c, width: u, height: p } = r, { x: d, y: g } = e;
- return d >= c && d <= c + u && g >= s && g <= s + p;
- }
- onPointerDown(e, t) {
- if (t.button === 2)
- return;
- const { unitId: o, subUnitId: n, row: a, col: i } = e, r = {
- unitId: o,
- subUnitId: n,
- row: a,
- column: i
- };
- this._commandService.executeCommand(Tt.id, r);
- }
- onPointerEnter(e, t) {
- var o, n;
- (n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Fe.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(p1.POINTER);
- }
- onPointerLeave(e, t) {
- var o, n;
- (n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Fe.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(p1.DEFAULT);
- }
- };
- hn2 = ls([
- pt(0, ot(Vr)),
- pt(1, Pt),
- pt(2, ot(Yx)),
- pt(3, ot(F2))
- ], hn2);
- var us = class extends me3 {
- constructor() {
- super(...arguments);
- M2(this, "id", Il.LIST);
- M2(this, "canvasRender", this.injector.createInstance(hn2));
- M2(this, "dropdown", yn);
- M2(this, "optionsInput", Mt.componentKey);
- M2(this, "formulaInput", Mn);
- }
- };
- var hs = class extends me3 {
- constructor() {
- super(...arguments);
- M2(this, "id", Il.TEXT_LENGTH);
- M2(this, "formulaInput", xt);
- }
- };
- var ps = class extends me3 {
- constructor() {
- super(...arguments);
- M2(this, "id", Il.WHOLE);
- M2(this, "formulaInput", xt);
- }
- };
- var fs = Object.defineProperty;
- var ms = Object.getOwnPropertyDescriptor;
- var gs = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? ms(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && fs(t, o, a), a;
- };
- var zt = (e, t) => (o, n) => t(o, n, e);
- var qe = class extends J0 {
- constructor(e, t, o) {
- super(), this._injector = e, this._componentManger = t, this._dataValidatorRegistryService = o, this._initComponents(), this._registerValidatorViews();
- }
- _initComponents() {
- [
- [Lo, wo],
- [Dt, Ji],
- [Mo, vi2],
- [yn, Li],
- [Oo, ni],
- [Mt.componentKey, Mt],
- [bt.componentKey, bt],
- ...jr
- ].forEach(([e, t]) => {
- this.disposeWithMe(this._componentManger.register(
- e,
- t
- ));
- });
- }
- _registerValidatorViews() {
- [
- Zr,
- ps,
- hs,
- Gr,
- Xr,
- us,
- is,
- zr
- ].forEach((e) => {
- const t = this._injector.createInstance(e), o = this._dataValidatorRegistryService.getValidatorItem(t.id);
- o && (o.formulaInput = t.formulaInput, o.canvasRender = t.canvasRender, o.dropdown = t.dropdown, o.optionsInput = t.optionsInput);
- });
- }
- };
- qe = gs([
- zt(0, ot(Ot)),
- zt(1, ot(n1)),
- zt(2, ot(j))
- ], qe);
- var vs = Object.defineProperty;
- var _s2 = Object.getOwnPropertyDescriptor;
- var Ss = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? _s2(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && vs(t, o, a), a;
- };
- var Kt = (e, t) => (o, n) => t(o, n, e);
- var Cs = "SHEET_DATA_VALIDATION_UI_PLUGIN";
- var gt2;
- var Xn = (gt2 = class extends Ra {
- constructor(e = Vt, t, o, n) {
- super(), this._config = e, this._injector = t, this._commandService = o, this._configService = n;
- const { menu: a, ...i } = nu(
- {},
- Vt,
- this._config
- );
- a && this._configService.setConfig("menu", a, { merge: true }), this._configService.setConfig(Vn2, i);
- }
- onStarting() {
- [
- [fe],
- [Ie],
- [lt],
- [ze],
- [Ze2],
- [Ge],
- [Ke],
- [st2],
- [qe]
- ].forEach((e) => {
- this._injector.add(e);
- }), [
- At,
- Tt,
- Eo,
- Dn,
- Ue,
- bo
- ].forEach((e) => {
- this._commandService.registerCommand(e);
- });
- }
- onReady() {
- this._injector.get(Ke), this._injector.get(Ge), this._injector.get(st2), this._injector.get(lt), this._injector.get(Yx).registerRenderModule(
- Fe.UNIVER_SHEET,
- [yt]
- );
- }
- onRendered() {
- this._injector.get(qe), this._injector.get(Ze2);
- }
- onSteady() {
- this._injector.get(ze);
- }
- }, M2(gt2, "pluginName", Cs), M2(gt2, "type", Fe.UNIVER_SHEET), gt2);
- Xn = Ss([
- Kt(1, ot(Ot)),
- Kt(2, Pt),
- Kt(3, SE)
- ], Xn);
- var Is = Object.defineProperty;
- var ws2 = Object.getOwnPropertyDescriptor;
- var Rs = (e, t, o, n) => {
- for (var a = n > 1 ? void 0 : n ? ws2(t, o) : t, i = e.length - 1, r; i >= 0; i--)
- (r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
- return n && a && Is(t, o, a), a;
- };
- var Gt = (e, t) => (o, n) => t(o, n, e);
- var Ds = "SHEET_DATA_VALIDATION_UI_PLUGIN";
- var vt;
- var zn = (vt = class extends Ra {
- constructor(e = Vt, t, o, n) {
- super(), this._config = e, this._injector = t, this._commandService = o, this._configService = n;
- const { menu: a, ...i } = nu(
- {},
- Vt,
- this._config
- );
- a && this._configService.setConfig("menu", a, { merge: true }), this._configService.setConfig(Vn2, i);
- }
- onStarting() {
- [
- [fe],
- [Ie],
- [lt],
- [ze],
- [Ze2],
- [Ge],
- [Ke],
- [qe]
- ].forEach((e) => {
- this._injector.add(e);
- }), [
- At,
- Tt,
- Eo,
- Dn,
- Ue,
- bo
- ].forEach((e) => {
- this._commandService.registerCommand(e);
- });
- }
- onReady() {
- this._injector.get(Ke), this._injector.get(Ge), this._injector.get(Yx).registerRenderModule(
- Fe.UNIVER_SHEET,
- [yt]
- );
- }
- onRendered() {
- this._injector.get(qe), this._injector.get(Ze2);
- }
- onSteady() {
- this._injector.get(ze);
- }
- }, M2(vt, "pluginName", Ds), M2(vt, "type", Fe.UNIVER_SHEET), vt);
- zn = Rs([
- Gt(1, ot(Ot)),
- Gt(2, Pt),
- Gt(3, SE)
- ], zn);
- export {
- Oo as DATE_DROPDOWN_KEY,
- yn as LIST_DROPDOWN_KEY,
- zn as UniverSheetsDataValidationMobileUIPlugin,
- Xn as UniverSheetsDataValidationUIPlugin
- };
- /*! Bundled license information:
- @univerjs/sheets-data-validation-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-data-validation-ui.js.map
|